@map-colonies/react-components 4.9.1 → 4.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('body[dir=rtl] .drpOpener .mdc-text-field{direction:ltr}body[dir=rtl] .drpContainer .MuiInputLabel-formControl{right:0px;left:unset}body[dir=rtl] .drpContainer .MuiInputBase-input{direction:ltr;text-align:end}.map{height:100%;width:100%}.ol-mouse-position{top:auto!important;right:auto!important;bottom:8px;left:8px;background-color:#fff;opacity:.7;font-size:12px;padding:2px;border-radius:2px}.ol-zoom{top:2.5em;right:.5em;left:unset}.trackerPosition{background-color:var(--mdc-theme-surface);z-index:2000;padding:2px;border-radius:2px;font-size:12px;height:24px;text-align:center;line-height:20px;white-space:nowrap}.scalePosition{background-color:var(--mdc-theme-surface);padding:1px;border-radius:2px;font-size:12px;width:110px}.scale-tracker-label{text-align:center}.scale-tracker-bar{background:var(--mdc-theme-on-surface);margin:0 auto;display:block;transition:all .5s ease-in-out}.zoomLevel{z-index:2000;background-color:var(--mdc-theme-surface);border-radius:2px;padding:2px;height:24px}.zoomLevelValue{margin:2px;font-size:14px;line-height:10px;text-align:center}.zoomLevelLabel{font-size:8px;line-height:8px}.mapViewIcon{fill:#fff;width:40px;height:40px;background:#303336;border:1px solid #444;border-radius:4px}.mapViewIcon:hover{background:#48b;border-color:#aef}.mapViewCurrent{fill:#aef;border:1px solid #aef;border-radius:4px}.mapSelector{width:260px;list-style:none;padding-left:0;display:flex;flex-wrap:wrap;grid-gap:4px;min-height:140px;margin-block-start:0px;padding-inline-start:0px}.mapContainerSelected{border:blueviolet 2px solid!important;border-radius:2px}.mapContainer:hover{border:tomato 2px solid;border-radius:2px}.mapContainerImg{width:100%;height:100%}.mapLabel{font-size:12px}.mapLabel:before{content:"\\a0"}.mapScenesContainer{display:flex;gap:8px}.settingsIconContainer,.mapLegendToggleContainer,.debugPanelIconContainer{fill:#fff;width:40px;height:40px;background:#303336;border:1px solid #444;border-radius:4px}.settingsIconContainer:hover,.mapLegendToggleContainer:hover,.debugPanelIconContainer:hover{background:#48b;border-color:#aef}.baseMapsContainer{margin-top:12px;min-height:58%}.settingsDialogPortal{transform:translateZ(0);height:calc(100vh - 220px);max-height:460px;width:280px;position:absolute;top:44px;right:12px}.settingsDialogPortal .mdc-dialog__container{align-items:unset}.settingsDialogPortal .mdc-dialog .mdc-dialog__surface{max-height:unset}body[dir=rtl] .settingsDialogPortal{left:12px;right:unset}.sectionLabel{margin-block-end:.5em}.zoom-buttons-container{display:flex;flex-direction:column;gap:2px;--full-screen-button-offset: 8px;--full-screen-button-size: 29px;--full-screen-button-bottom: 8px;position:absolute;bottom:calc(var(--full-screen-button-offset) + var(--full-screen-button-size) + var(--full-screen-button-bottom));right:var(--full-screen-button-offset);left:unset}body[dir=rtl] .zoom-buttons-container{left:var(--full-screen-button-offset);right:unset}.zoom-button{cursor:pointer;width:29px;height:29px;background:#303336;border:1px solid #444;border-radius:4px;box-sizing:border-box;display:flex;justify-content:center;padding:4px}.zoom-button:hover{background:#48b;border-color:#aef}.mapLegendSidebarContainer{width:340px;height:100%;position:relative;overflow-y:auto;overflow-x:hidden;font-size:16px}.mapLegendSidebarContainer.mdc-drawer--animate{transform:translate(0)!important;transition:none!important}.mapLegendSidebarContainer.mdc-drawer--dismissible{position:relative}div.MuiPaper-root{transition:none!important}.mapLegendCloseBtn{position:absolute;top:0;right:0;cursor:pointer;width:50px;height:50px;padding:20px;font-size:24px}body[dir=rtl] .mapLegendCloseBtn{right:unset;left:0}.mapLegendToggleContainer{display:flex;align-items:center;justify-content:center}.mapLegendIcon{width:2rem;height:2rem;transform:translate(8%,8%)}.sidebarHeaderContainer{text-align:center;margin-top:40px}.sidebarTitle{font-size:1.5rem;font-weight:700}.mapLegend{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:10px 14px}.layerNameContainer{width:90%;display:flex;justify-content:center;align-items:center}.layerName{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.legendImg{width:90%;height:150px;border:1px solid black;border-radius:5px;object-fit:cover;cursor:pointer}.legendActionsContainer{display:flex;flex-direction:row;align-self:center}.legendAction:not(:last-child):after{content:"|";margin:0 4px}.mapLegendsList{display:flex;flex-direction:column;padding:20px 0;width:100%;height:90%}.legendAction{text-decoration:underline;cursor:pointer;font-size:1.1rem;transition:all .1s ease-in-out;width:max-content}.legendAction:hover{filter:brightness(1.2)}.noLegendsContainer{width:100%;height:100%;display:flex;flex-direction:column;justify-content:center;align-items:center}.noLegendsMsg{text-align:center}.compass.rtl{right:unset;left:24px}.compass.ltr{left:unset;right:24px}.debugPanel{transform:translateZ(0);height:calc(100vh - 220px);max-height:460px;width:280px;position:absolute;top:44px;right:
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('body[dir=rtl] .drpOpener .mdc-text-field{direction:ltr}body[dir=rtl] .drpContainer .MuiInputLabel-formControl{right:0px;left:unset}body[dir=rtl] .drpContainer .MuiInputBase-input{direction:ltr;text-align:end}.map{height:100%;width:100%}.ol-mouse-position{top:auto!important;right:auto!important;bottom:8px;left:8px;background-color:#fff;opacity:.7;font-size:12px;padding:2px;border-radius:2px}.ol-zoom{top:2.5em;right:.5em;left:unset}.trackerPosition{background-color:var(--mdc-theme-surface);z-index:2000;padding:2px;border-radius:2px;font-size:12px;height:24px;text-align:center;line-height:20px;white-space:nowrap}.scalePosition{background-color:var(--mdc-theme-surface);padding:1px;border-radius:2px;font-size:12px;width:110px}.scale-tracker-label{text-align:center}.scale-tracker-bar{background:var(--mdc-theme-on-surface);margin:0 auto;display:block;transition:all .5s ease-in-out}.zoomLevel{z-index:2000;background-color:var(--mdc-theme-surface);border-radius:2px;padding:2px;height:24px}.zoomLevelValue{margin:2px;font-size:14px;line-height:10px;text-align:center}.zoomLevelLabel{font-size:8px;line-height:8px}.mapViewIcon{fill:#fff;width:40px;height:40px;background:#303336;border:1px solid #444;border-radius:4px}.mapViewIcon:hover{background:#48b;border-color:#aef}.mapViewCurrent{fill:#aef;border:1px solid #aef;border-radius:4px}.mapSelector{width:260px;list-style:none;padding-left:0;display:flex;flex-wrap:wrap;grid-gap:4px;min-height:140px;margin-block-start:0px;padding-inline-start:0px}.mapContainerSelected{border:blueviolet 2px solid!important;border-radius:2px}.mapContainer:hover{border:tomato 2px solid;border-radius:2px}.mapContainerImg{width:100%;height:100%}.mapLabel{font-size:12px}.mapLabel:before{content:"\\a0"}.mapScenesContainer{display:flex;gap:8px}.settingsIconContainer,.mapLegendToggleContainer,.debugPanelIconContainer{fill:#fff;width:40px;height:40px;background:#303336;border:1px solid #444;border-radius:4px}.settingsIconContainer:hover,.mapLegendToggleContainer:hover,.debugPanelIconContainer:hover{background:#48b;border-color:#aef}.baseMapsContainer{margin-top:12px;min-height:58%}.settingsDialogPortal{transform:translateZ(0);height:calc(100vh - 220px);max-height:460px;width:280px;position:absolute;top:44px;right:12px}.settingsDialogPortal .mdc-dialog__container{align-items:unset}.settingsDialogPortal .mdc-dialog .mdc-dialog__surface{max-height:unset}body[dir=rtl] .settingsDialogPortal{left:12px;right:unset}.sectionLabel{margin-block-end:.5em}.zoom-buttons-container{display:flex;flex-direction:column;gap:2px;--full-screen-button-offset: 8px;--full-screen-button-size: 29px;--full-screen-button-bottom: 8px;position:absolute;bottom:calc(var(--full-screen-button-offset) + var(--full-screen-button-size) + var(--full-screen-button-bottom));right:var(--full-screen-button-offset);left:unset}body[dir=rtl] .zoom-buttons-container{left:var(--full-screen-button-offset);right:unset}.zoom-button{cursor:pointer;width:29px;height:29px;background:#303336;border:1px solid #444;border-radius:4px;box-sizing:border-box;display:flex;justify-content:center;padding:4px}.zoom-button:hover{background:#48b;border-color:#aef}.mapLegendSidebarContainer{width:340px;height:100%;position:relative;overflow-y:auto;overflow-x:hidden;font-size:16px}.mapLegendSidebarContainer.mdc-drawer--animate{transform:translate(0)!important;transition:none!important}.mapLegendSidebarContainer.mdc-drawer--dismissible{position:relative}div.MuiPaper-root{transition:none!important}.mapLegendCloseBtn{position:absolute;top:0;right:0;cursor:pointer;width:50px;height:50px;padding:20px;font-size:24px}body[dir=rtl] .mapLegendCloseBtn{right:unset;left:0}.mapLegendToggleContainer{display:flex;align-items:center;justify-content:center}.mapLegendIcon{width:2rem;height:2rem;transform:translate(8%,8%)}.sidebarHeaderContainer{text-align:center;margin-top:40px}.sidebarTitle{font-size:1.5rem;font-weight:700}.mapLegend{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:10px 14px}.layerNameContainer{width:90%;display:flex;justify-content:center;align-items:center}.layerName{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.legendImg{width:90%;height:150px;border:1px solid black;border-radius:5px;object-fit:cover;cursor:pointer}.legendActionsContainer{display:flex;flex-direction:row;align-self:center}.legendAction:not(:last-child):after{content:"|";margin:0 4px}.mapLegendsList{display:flex;flex-direction:column;padding:20px 0;width:100%;height:90%}.legendAction{text-decoration:underline;cursor:pointer;font-size:1.1rem;transition:all .1s ease-in-out;width:max-content}.legendAction:hover{filter:brightness(1.2)}.noLegendsContainer{width:100%;height:100%;display:flex;flex-direction:column;justify-content:center;align-items:center}.noLegendsMsg{text-align:center}.compass.rtl{right:unset;left:24px}.compass.ltr{left:unset;right:24px}.debugPanel{transform:translateZ(0);height:calc(100vh - 220px);max-height:460px;width:280px;position:absolute;top:44px;right:110px}.debugPanel .mdc-dialog__container{align-items:unset}.debugPanel .mdc-dialog .mdc-dialog__surface{max-height:unset}body[dir=rtl] .debugPanel{left:110px;right:unset}.debugPanel .title{text-align:center;font-size:16px}.wfsContainer .title{text-align:center;font-weight:700;margin-bottom:12px;width:260px}.wfsContainer .featureType{font-size:12px;margin-bottom:12px;direction:ltr}body[dir=rtl] .wfsContainer .featureType{direction:rtl}.wfsContainer .name{color:#aef;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:260px}.wfsContainer .info{display:flex}.wfsContainer .spacer{margin:0 20px}.wfsContainer .blinking{animation:blink 1s infinite}@keyframes blink{0%,to{opacity:1}50%{opacity:.5}}.cesium-widget-credits{display:none!important}.cesium-viewer-fullscreenContainer{bottom:8px;right:8px;left:unset}body[dir=rtl] .cesium-viewer-fullscreenContainer{left:8px;right:unset}body[dir=rtl] .cesium-viewer-toolbar{left:5px;right:unset}.cesium-button.cesium-fullscreenButton{border-radius:14%}.toolsContainer{color:var(--mdc-theme-on-surface);display:flex;gap:8px;z-index:2000;position:absolute;bottom:12px;right:40px;opacity:.7}body[dir=rtl] .toolsContainer{left:40px;right:unset}.sideToolsContainer{display:flex;flex-direction:row;gap:8px;z-index:2000;position:absolute;top:12px;right:40px}body[dir=rtl] .sideToolsContainer{left:40px;right:unset}.viewer{display:flex;flex-direction:row}.viewer .mdc-linear-progress__bar-inner{border-top-width:10px}.twipsy{display:block;position:absolute;visibility:visible;max-width:200px;min-width:100px;padding:5px;font-size:11px;z-index:1000;opacity:.8;-khtml-opacity:.8;-moz-opacity:.8;filter:alpha(opacity=80)}.twipsy.left .twipsy-arrow{top:50%;right:0;margin-top:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:5px solid #000000}.twipsy.right .twipsy-arrow{top:50%;left:0;margin-top:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-right:5px solid #000000}.twipsy-inner{padding:3px 8px;background-color:#000;color:#fff;text-align:center;max-width:200px;text-decoration:none;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.twipsy-arrow{position:absolute;width:0;height:0}.toolbar{margin:0;padding:0;background:white}.toolbar>.button{margin:5px;padding:5px;border:1px solid #eee;cursor:pointer}.toolbar>.button:hover{background:#eee}.infoWindow{position:absolute;min-width:100px;max-width:300px}.infoWindow #frame{padding:10px;border:1px solid black;background:white}.infoWindow #close{float:right;margin:5px 2px;font-size:small;color:gray;cursor:pointer}.infoWindow #arrow{position:absolute;bottom:-8px;left:50%;margin-left:-10px;border-right:10px solid transparent;border-left:10px solid transparent;border-top:10px solid white}.react-autocomplete-input{background-clip:padding-box;background-color:#fff;bottom:auto;box-shadow:0 6px 12px #0000002d;display:block;font-size:14px;list-style:none;padding:1px;position:absolute;z-index:20000;margin-block-start:unset;margin-block-end:unset}.react-autocomplete-input>li{cursor:pointer;padding:10px;min-width:100px}.react-autocomplete-input>li.active{background-color:#337ab7;color:#fff}body[dir=rtl] .chonky-fileListWrapper [class^=listContainer-]{direction:rtl!important}body[dir=rtl] .chonky-fileEntryClickableWrapper [class^=listFileEntryProperty-],body[dir=rtl] .chonky-navbarContainer{direction:ltr!important}body[dir=rtl] .chonky-chonkyRoot{text-align:right}body[dir=rtl] .chonky-infoText{margin-left:unset;margin-right:12px}body[dir=rtl] .chonky-contextMenuList .MuiListItemText-root,body[dir=rtl] .chonky-dropdownList .MuiListItemText-root{text-align:right}body[dir=rtl] .chonky-icon{margin-right:unset;margin-left:8px}.chonky-chonkyRoot div[class^=folderBackSide]{box-shadow:unset}.chonky-chonkyRoot div[class^=folderBackSide]:after{border-color:var(--fp-theme-background, #fff) var(--fp-theme-background, #fff) transparent transparent}.chonky-chonkyRoot div[class^=listFileEntryIcon-]{color:#d5d5d5}.chonky-chonkyRoot div[class*=previewFile-d]{background-color:#d5d5d5}.chonky-chonkyRoot div[class^=selectionIndicator-]{background:var(--fp-theme-selection-background, #455570)}.chonky-chonkyRoot{background-color:var(--fp-theme-background, #fff)!important}.chonky-contextMenuList{background-color:var(--fp-theme-surface, #fff)!important}button[class*=chonky-activeButton],.chonky-selectionSizeText{color:var(--fp-theme-primary, #24aee9)!important}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
2
|
var kn = Object.defineProperty;
|
|
3
3
|
var Rn = (e, n, t) => n in e ? kn(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t;
|
|
4
4
|
var te = (e, n, t) => (Rn(e, typeof n != "symbol" ? n + "" : n, t), t);
|
|
@@ -1468,7 +1468,7 @@ const Bo = /* @__PURE__ */ l("svg", { xmlns: "http://www.w3.org/2000/svg", enabl
|
|
|
1468
1468
|
console.error("computeViewRectangle returned invalid rectangle.");
|
|
1469
1469
|
return;
|
|
1470
1470
|
}
|
|
1471
|
-
if (o
|
|
1471
|
+
if (o === Ce.SCENE2D)
|
|
1472
1472
|
return r;
|
|
1473
1473
|
const c = i.positionCartographic;
|
|
1474
1474
|
if (!Bt(c)) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(d,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("react/jsx-runtime"),require("react"),require("date-fns"),require("date-fns/locale"),require("@material-ui/pickers"),require("@date-io/date-fns"),require("@material-ui/core/styles"),require("@material-ui/core"),require("@map-colonies/react-core"),require("@material-ui/core/useMediaQuery"),require("react-datepicker"),require("date-fns/locale/he"),require("moment"),require("@turf/rewind"),require("ol"),require("ol/ol.css"),require("ol/coordinate"),require("ol/control"),require("ol/control/MousePosition"),require("ol/proj"),require("ol/layer"),require("ol/source"),require("ol/format"),require("ol/interaction"),require("ol/interaction/Draw"),require("ol/layer/VectorTile"),require("ol/style"),require("ol/tilegrid/WMTS"),require("ol/extent"),require("ol/source/TileWMS"),require("ol/source/XYZ"),require("ol/source/VectorTile"),require("ol-ext/legend/Legend"),require("ol-ext/control/Legend"),require("ol-ext/dist/ol-ext.css"),require("@material-ui/core/TableHead"),require("@material-ui/core/utils"),require("@material-ui/core/CssBaseline"),require("@material-ui/core/ScopedCssBaseline"),require("react-dom"),require("resium"),require("cesium"),require("lodash"),require("@turf/boolean-point-in-polygon"),require("@turf/bbox-polygon"),require("@turf/helpers"),require("@turf/point-to-polygon-distance"),require("@cmcleese/cesium-navigation"),require("@cmcleese/cesium-navigation/dist/index.css"),require("@map-colonies/react-core/dist/linear-progress/styles"),require("uuid"),require("p-map"),require("@turf/bbox"),require("textarea-caret"),require("get-input-selection"),require("chonky"),require("chonky-icon-fontawesome"),require("filesize"),require("react-select")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","date-fns","date-fns/locale","@material-ui/pickers","@date-io/date-fns","@material-ui/core/styles","@material-ui/core","@map-colonies/react-core","@material-ui/core/useMediaQuery","react-datepicker","date-fns/locale/he","moment","@turf/rewind","ol","ol/ol.css","ol/coordinate","ol/control","ol/control/MousePosition","ol/proj","ol/layer","ol/source","ol/format","ol/interaction","ol/interaction/Draw","ol/layer/VectorTile","ol/style","ol/tilegrid/WMTS","ol/extent","ol/source/TileWMS","ol/source/XYZ","ol/source/VectorTile","ol-ext/legend/Legend","ol-ext/control/Legend","ol-ext/dist/ol-ext.css","@material-ui/core/TableHead","@material-ui/core/utils","@material-ui/core/CssBaseline","@material-ui/core/ScopedCssBaseline","react-dom","resium","cesium","lodash","@turf/boolean-point-in-polygon","@turf/bbox-polygon","@turf/helpers","@turf/point-to-polygon-distance","@cmcleese/cesium-navigation","@cmcleese/cesium-navigation/dist/index.css","@map-colonies/react-core/dist/linear-progress/styles","uuid","p-map","@turf/bbox","textarea-caret","get-input-selection","chonky","chonky-icon-fontawesome","filesize","react-select"],o):(d=typeof globalThis<"u"?globalThis:d||self,o(d.reactComponents={},d.jsxRuntime,d.React,d.dateFns,d.locale,d.pickers,d.DateFnsUtils,d.styles,d.core,d.reactCore,d.useMediaQuery,d.DatePicker,d.datePickerHebrewLocale,d.moment,d.rewind,d.ol,null,d.coordinate,d.control,d.MousePosition,d.proj,d.layer,d.source,d.format,d.interaction,d.Draw,d.VectorTile,d.style,d.WMTSTileGrid,d.extent,d.OlTileWMS,d.OlXYZ,d.VectorTileSource,d.OlExtLegend,d.OlExtLegendCtrl,null,d.TableHead,d.utils,d.CssBaseline,d.ScopedCssBaseline,d.ReactDOM,d.resium,d.Cesium,d.lodash,d.booleanPointInPolygon,d.bboxPolygon,d.turf,d.pointToPolygonDistance,d.viewerCesiumNavigationMixin,null,null,d.uuid,d.pMap,d.bbox,d.getCaretCoordinates,d.getInputSelection,d.chonky,d.chonkyIconFontawesome,d.filesize,d.Select))})(this,function(d,o,c,me,Ae,Le,at,Se,Q,U,bn,lt,Mn,be,_n,ct,wo,dt,Ze,Xe,ut,ht,Je,Qe,Pn,Dn,In,ke,On,gt,An,kn,Nn,pt,xn,Co,Bn,ft,Fn,Vn,Gn,ve,p,q,Hn,Re,mt,Wn,zn,Lo,bo,yt,et,vt,$n,Et,K,Un,qn,St){"use strict";var So=Object.defineProperty;var To=(d,o,c)=>o in d?So(d,o,{enumerable:!0,configurable:!0,writable:!0,value:c}):d[o]=c;var ne=(d,o,c)=>(To(d,typeof o!="symbol"?o+"":o,c),c);function tt(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const Tt=tt(c),w=tt(p),wt=tt(mt);var he=(e=>(e.BOX="BOX",e.POLYGON="POLYGON",e.UNKNOWN="UNKNOWN",e))(he||{}),fe=(e=>(e.HE="he",e.EN="en",e.RU="ru",e))(fe||{}),Ne=(e=>(e.TOP_RIGHT="TOP_RIGHT",e.BOTTOM_LEFT="BOTTOM_LEFT",e))(Ne||{});const ie={DATE_PICKER:{dateFormat:"dd/MM/yyyy",local:{setText:"set",placeHolderText:"Enter the Date",calendarLocale:fe.EN},disableFuture:!0,showTime:!1,variant:"inline"},DATE_RANGE_PICKER:{dateFormat:"dd/MM/yyyy HH:mm",controlsLayout:"row",local:{setText:"set",startPlaceHolderText:"Start of time",endPlaceHolderText:"End of time",calendarLocale:fe.EN},renderAsButton:!0,offset:0,disableFuture:!0}},oe=e=>{const{children:n,...t}=e;return o.jsx(Q.Box,{...t,children:n})},xe=e=>{const n=e.type==="dark";return c.useMemo(()=>Ct(e,n),[n,e])},Ct=(e,n=!1)=>Se.createTheme({palette:{type:n?"dark":"light",primary:{main:e.primary},secondary:{main:e.secondary},error:{main:e.error},background:{default:e.surface,paper:e.background},text:{primary:n?e.textPrimaryOnDark:e.textPrimaryOnLight,secondary:n?e.textSecondaryOnDark:e.textSecondaryOnLight}}}),Mo="",jn=2,Kn=.5,Yn=Se.makeStyles(e=>Se.createStyles({container:{padding:e.spacing(jn),alignItems:"center"},setButton:{marginTop:e.spacing(1)},margin:{marginLeft:e.spacing(Kn)}})),Lt=e=>{var Y,V,j,H;const n=Yn(),t=U.useTheme(),r=xe(t),[s,i]=c.useState(null),[u,h]=c.useState(null),[f,m]=c.useState(ie.DATE_RANGE_PICKER.dateFormat),v=e.controlsLayout??ie.DATE_RANGE_PICKER.controlsLayout,M=e.disableFuture??ie.DATE_RANGE_PICKER.disableFuture,b=((Y=e.local)==null?void 0:Y.startPlaceHolderText)??ie.DATE_RANGE_PICKER.local.startPlaceHolderText,T=((V=e.local)==null?void 0:V.endPlaceHolderText)??ie.DATE_RANGE_PICKER.local.endPlaceHolderText,G=((j=e.local)==null?void 0:j.setText)??ie.DATE_RANGE_PICKER.local.setText,Z=(((H=e.local)==null?void 0:H.calendarLocale)??ie.DATE_RANGE_PICKER.local.calendarLocale)===fe.HE?Ae.he:Ae.enUS;c.useEffect(()=>{i(e.from??null)},[e.from]),c.useEffect(()=>{h(e.to??null)},[e.to]),c.useEffect(()=>{m(e.dateFormat??ie.DATE_RANGE_PICKER.dateFormat)},[e.dateFormat]);const $=Boolean(me.isValid(s)&&!u||me.isValid(u)&&!s||s&&u&&me.isValid(s)&&me.isValid(u)&&me.isBefore(s,u)),X=()=>{e.onChange({from:s&&me.isValid(s)?s:void 0,to:u&&me.isValid(u)?u:void 0})};return o.jsx(Q.ThemeProvider,{theme:r,children:o.jsx(oe,{className:`${n.container} drpContainer`,display:"flex",flexDirection:v,width:v==="column"?e.contentWidth:"unset",children:o.jsxs(Le.MuiPickersUtilsProvider,{utils:at,locale:Z,children:[o.jsx(Le.KeyboardDateTimePicker,{variant:"inline",placeholder:b,onChange:W=>i(W),value:s,disableFuture:M,format:f,maxDate:e.maxDate,minDate:e.minDate}),o.jsx(Le.KeyboardDateTimePicker,{variant:"inline",placeholder:T,className:n.margin,onChange:W=>h(W),value:u,disableFuture:M,format:f,maxDate:e.maxDate,minDate:e.minDate}),o.jsx(U.ThemeProvider,{options:t,children:o.jsx(U.Button,{className:`${n.setButton} ${n.margin}`,raised:!0,onClick:X,disabled:!$,children:G})})]})})})},bt=e=>{const{children:n,...t}=e;return o.jsx(Q.Popover,{...t,children:n})},_o="",Zn=e=>{var V,j;const[n,t]=c.useState(null),[r,s]=c.useState(null),[i,u]=c.useState(ie.DATE_RANGE_PICKER.dateFormat),[h,f]=c.useState(null),m=H=>{f(H.currentTarget)},v=H=>{H.currentTarget.tagName==="I"?f(H.currentTarget.previousElementSibling):f(H.currentTarget)},M=()=>{f(null)},b=Boolean(h),T=e.controlsLayout??"column";c.useEffect(()=>{t(e.from??null)},[e.from]),c.useEffect(()=>{s(e.to??null)},[e.to]),c.useEffect(()=>{u(e.dateFormat??ie.DATE_RANGE_PICKER.dateFormat)},[e.dateFormat]);const G=((V=e.local)==null?void 0:V.startPlaceHolderText)??ie.DATE_RANGE_PICKER.local.startPlaceHolderText,z=((j=e.local)==null?void 0:j.endPlaceHolderText)??ie.DATE_RANGE_PICKER.local.endPlaceHolderText,Z=e.renderAsButton===void 0?ie.DATE_RANGE_PICKER.renderAsButton:e.renderAsButton,$=e.offset===void 0?ie.DATE_RANGE_PICKER.offset:e.offset,X=e.disableFuture===void 0?ie.DATE_RANGE_PICKER.disableFuture:e.disableFuture,Y=c.useMemo(()=>`${n?me.format(n,i):G} - ${r?me.format(r,i):z}`,[n,r,i,G,z]);return o.jsxs(o.Fragment,{children:[Z?o.jsx(U.Button,{style:{width:e.width},raised:!0,onClick:m,className:"drpOpener",children:Y}):o.jsx(U.TextField,{className:"drpOpener",readOnly:!0,style:{width:e.width},value:Y,onClick:v,trailingIcon:{icon:"date_range",tabIndex:0,onClick:v}}),o.jsx(bt,{open:b,anchorEl:h,onClose:M,anchorOrigin:{vertical:"bottom",horizontal:"left"},keepMounted:!0,children:o.jsx(Lt,{controlsLayout:T,contentWidth:((h==null?void 0:h.clientWidth)??0)-$,dateFormat:i,disableFuture:X,minDate:e.minDate,maxDate:e.maxDate,local:e.local,from:n??void 0,to:r??void 0,onChange:({from:H,to:W})=>{t(H??null),s(W??null),e.onChange({from:H,to:W}),M()}})})]})},Be=e=>typeof e<"u"&&e!==null&&"startDate"in e&&"endDate"in e,Xn=({endDate:e,startDate:n,setEndDate:t=()=>{},setStartDate:r=()=>{},endTimeInputClassName:s="",endTimeLabel:i="",endTimeWrapperClassName:u="",timeRangeInputsWrapperClassName:h="",startTimeInputClassName:f="",startTimeLabel:m="",startTimeWrapperClassName:v=""})=>o.jsxs("div",{className:`timeRangeWrapper ${h}`,children:[o.jsx("div",{className:`startTimeWrapper ${v}`,children:o.jsx(U.TextField,{label:m,disabled:n===null,className:`timeRangeInput ${f}`,name:"start-time",type:"time",value:be(n).format("HH:mm"),onChange:M=>{const b=be(n),T=be(M.currentTarget.value,"HH:mm"),G=b.set({hours:T.get("hours"),minutes:T.get("minutes")});r(G.toDate())}})}),o.jsx("div",{className:`endTimeWrapper ${u}`,children:o.jsx(U.TextField,{label:i,disabled:e===null,className:`timeRangeInput ${s}`,name:"end-time",type:"time",value:be(e).format("HH:mm"),onChange:M=>{const b=be(e),T=be(M.currentTarget.value,"HH:mm"),G=b.set({hours:T.get("hours"),minutes:T.get("minutes")});t(G.toDate())}})})]}),Jn=c.forwardRef(({value:e,onClick:n,onInputClick:t,...r},s)=>o.jsx(U.TextField,{...r,className:"dateRangeCustomInput",readOnly:!0,onClick:i=>{n==null||n(i),t==null||t()},ref:s,value:e})),Qn=({setStartDate:e=()=>{},setEndDate:n=()=>{},shortcuts:t,dateRange:r,onShortcut:s})=>{const[i,u]=c.useState(),h=c.useMemo(()=>t.map(f=>f instanceof Function?f():f),[t]);return c.useEffect(()=>{for(const f of h){const m=r.startDate&&r.endDate&&me.isSameDay(f.startDate,r.startDate)&&me.isSameDay(f.endDate,r.endDate);i?f.id===i&&(m||u(void 0)):m&&u(f.id)}},[r,i,h]),o.jsx("div",{className:"shortcutsContainer",children:h.map((f,m)=>{const v=()=>{e(f.startDate),n(f.endDate)};return o.jsx(U.Button,{type:"button",className:`shortcut ${i===f.id?"selected":""}`,onClick:M=>{v(),s==null||s({startDate:f.startDate,endDate:f.endDate})},outlined:!0,children:f.label},f.id+m)})})},Rn=c.forwardRef((e,n)=>{const{calendarClassName:t,dayClassName:r,monthClassName:s,selectsRange:i,onChange:u,inputName:h,showMonthYearDropdown:f,withShortcuts:m,locale:v="en"}=e,[M,b]=c.useState(null),[T,G]=c.useState(null),[z,Z]=c.useState(!1),$=i?{startDate:M,endDate:T}:M;c.useEffect(()=>{v==="he"&<.registerLocale("he",Mn)},[v]),c.useEffect(()=>{var V,j;((V=e.startDate)==null?void 0:V.toString())!==(M==null?void 0:M.toString())&&b(e.startDate),((j=e.endDate)==null?void 0:j.toString())!==(T==null?void 0:T.toString())&&G(e.endDate)},[e.startDate,e.endDate,M,T]);const X=c.useMemo(()=>{let V="pickerContainer"+(v==="he"?" pickerContainer-rtl":"");return m&&i&&(V+=" pickerContainer-withShortcuts"),V},[v,m,i]),Y=f?{showMonthDropdown:!0,showYearDropdown:!0,dropdownMode:"select"}:{};return o.jsx("div",{className:X,style:{direction:v==="he"?"rtl":"ltr"},children:o.jsx(lt,{...e,ref:n,onClickOutside:()=>Z(!1),open:z,startDate:Be($)?M:void 0,selected:M,endDate:Be($)?T:void 0,monthsShown:e.monthsShown??2,calendarClassName:`pickerCalendar ${t}`,weekDayClassName:V=>`pickerWeek ${(r==null?void 0:r(V))??""}`,dayClassName:V=>`pickerDay ${(r==null?void 0:r(V))??""}`,monthClassName:V=>`pickerMonth ${(s==null?void 0:s(V))??""}`,onChange:(V,j)=>{if(Array.isArray(V)){const[H,W]=V;b(H),G(W),u==null||u({startDate:H,endDate:W&&me.endOfDay(W)},j)}else b(V),u==null||u(V,j)},customInput:o.jsx(Jn,{name:h,onInputClick:()=>{Z(!0)}}),showTimeInput:!!(m&&i),timeInputLabel:"",customTimeInput:m&&Be($)&&o.jsx(Qn,{onShortcut:V=>{u==null||u(V),Z(!1)},shortcuts:m,setEndDate:G,setStartDate:b,dateRange:$}),showMonthYearDropdown:void 0,...Y})})}),Po="",er=e=>{const n=U.useTheme(),t=xe(n),{format:r=ie.DATE_PICKER.dateFormat,variant:s=ie.DATE_PICKER.variant,disableFuture:i=ie.DATE_PICKER.disableFuture,local:u,onChange:h,showTime:f=ie.DATE_PICKER.showTime,value:m,...v}=e,{placeHolderText:M=ie.DATE_PICKER.local.placeHolderText,calendarLocale:b}=u??{placeHolderText:ie.DATE_PICKER.local.placeHolderText,calendarLocale:fe.EN},T=b===fe.HE?Ae.he:Ae.enUS,G=z=>{h(z)};return o.jsx(Q.ThemeProvider,{theme:t,children:o.jsxs(Le.MuiPickersUtilsProvider,{utils:at,locale:T,children:[f&&o.jsx(Le.KeyboardDateTimePicker,{variant:s,placeholder:M,onChange:G,value:m,disableFuture:i,format:r,...v}),!f&&o.jsx(Le.KeyboardDatePicker,{variant:s,placeholder:M,onChange:G,value:m,disableFuture:i,format:r,...v})]})})},tr=18,nr=Se.makeStyles(e=>Se.createStyles({drawingButton:{width:e.spacing(tr)},fullWidth:{width:"100%",marginTop:"36px"}})),rr=e=>{const n=nr(),[t,r]=c.useState(null),{isSelectionEnabled:s,onCancelDraw:i,onStartDraw:u,onReset:h}=e,f=v=>{r(v.currentTarget)},m=()=>{r(null)};return s?o.jsx(U.Tooltip,{content:"Cancel the ongoing draw",align:"bottomLeft",children:o.jsx(U.Button,{className:n.drawingButton,raised:!0,onClick:i,children:"Cancel Draw"})}):o.jsxs(oe,{position:"relative",children:[o.jsx(U.Tooltip,{content:"draw an Area of interest to limit the search",align:"bottomLeft",children:o.jsx(U.Button,{className:n.drawingButton,raised:!0,onClick:f,children:"Draw AOI"})}),o.jsxs(U.Menu,{className:n.fullWidth,open:Boolean(t),onClose:m,children:[o.jsx(U.MenuItem,{onClick:()=>{u(he.POLYGON),m()},children:"Polygon"}),o.jsx(U.MenuItem,{onClick:()=>{u(he.BOX),m()},children:"Box"}),o.jsx(U.MenuItem,{onClick:()=>{h(),m()},children:"Clear"})]})]})},Do="";var ye=(e=>(e.WGS84="EPSG:4326",e.WEB_MERCATOR="EPSG:3857",e))(ye||{});const Fe=5,Ve=2,Mt=c.createContext(null),ir=Mt.Provider,_t=35,Pt=32,or=10,sr=e=>e!==void 0&&e!==ye.WGS84?ut.transform([_t,Pt],ye.WGS84,e):[_t,Pt],ar=e=>{switch(e){case ye.WEB_MERCATOR:return n=>dt.format(n,"Mercator: {y}m, {x}m",Ve);case ye.WGS84:return n=>dt.format(n,"WGS84: {y}°N {x}°E",Fe);default:return n=>""}},Ce=()=>{const e=c.useContext(Mt);if(e===null)throw new Error("map context is null, please check the provider");return e},Dt=e=>{const n=c.useRef(null),{allowFullScreen:t,showMousePosition:r,projection:s}=e,[i]=c.useState(new ct.Map({view:new ct.View({projection:s??ye.WGS84}),controls:Ze.defaults()}));c.useEffect(()=>{i.getView().setCenter(e.center??sr(e.projection))},[i,e.center,e.projection]),c.useEffect(()=>{i.getView().setZoom(e.zoom??or)},[i,e.zoom,e.projection]);const u=(h,f)=>{f.getControls().forEach(v=>{v instanceof h&&f.removeControl(v)})};return c.useEffect(()=>{i.setTarget(n.current),t!==void 0&&t?i.addControl(new Ze.FullScreen):u(Ze.FullScreen,i)},[i,t]),c.useEffect(()=>{r!==void 0&&r?(u(Xe,i),i.addControl(new Xe({coordinateFormat:ar(s??ye.WGS84),projection:s??ye.WGS84,undefinedHTML:" "}))):u(Xe,i)},[i,r,s]),o.jsxs(ir,{value:i,children:[o.jsx("div",{className:"map",ref:n}),e.children]})},It=c.createContext(null),lr=It.Provider,_e=()=>{const e=c.useContext(It);if(e===null)throw new Error("tile layer context is null, please check the provider");return e},Ot=({options:e,children:n})=>{const t=Ce(),[r]=c.useState(new ht.Tile(e));return c.useEffect(()=>(t.addLayer(r),()=>{t.removeLayer(r)}),[t,r]),o.jsx(lr,{value:r,children:n})},At=c.createContext(null),cr=At.Provider,kt=()=>{const e=c.useContext(At);if(e===null)throw new Error("vector layer context is null, please check the provider");return e},Nt=({children:e})=>{const n=Ce(),[t]=c.useState(new ht.Vector);return c.useEffect(()=>(n.addLayer(t),()=>{n.removeLayer(t)}),[n,t]),o.jsx(cr,{value:t,children:e})},xt=c.createContext(null),dr=xt.Provider,Bt=()=>{const e=c.useContext(xt);if(e===null)throw new Error("vector source context is null, please check the provider");return e},Ft=({children:e})=>{const n=kt(),[t]=c.useState(new Je.Vector);return c.useEffect(()=>{n.setSource(t)},[t,n]),o.jsx(dr,{value:t,children:e})},Vt=({geometry:e,fitOptions:n,fit:t,featureStyle:r})=>{const s=Bt(),i=Ce();return c.useLayoutEffect(()=>{const h=new Qe.GeoJSON().readFeature(e);return t&&s.on("addfeature",function(){i.getView().fit(s.getExtent(),n)}),r&&h.setStyle(r),s.addFeature(h),()=>{s.removeFeature(h)}},[e,s,t]),null},Gt=e=>{const n=_e();return c.useEffect(()=>{n.setSource(new Je.OSM)},[n]),null},Ht=({drawType:e,onPolygonSelected:n})=>{const t=Ce();return c.useEffect(()=>{const r={type:"Circle"};switch(e){case he.BOX:r.geometryFunction=Dn.createBox();break;case he.POLYGON:r.type="Polygon";break;default:return}const s=new Pn.Draw(r);t.addInteraction(s);const i=u=>{const f=new Qe.GeoJSON().writeGeometryObject(u.feature.getGeometry());n==null||n(f)};return s.on("drawend",i),()=>{s.un("drawend",i),t.removeInteraction(s)}},[n,e,t]),null},Io="",ur=e=>{const n=t=>{const r=_n(t);e.onPolygonSelection(r)};return o.jsxs(Dt,{allowFullScreen:!0,showMousePosition:!0,children:[o.jsx(Ot,{children:o.jsx(Gt,{})}),e.selectionPolygon&&o.jsx(Nt,{children:o.jsx(Ft,{children:o.jsx(Vt,{geometry:e.selectionPolygon})})}),e.children,e.drawType!==void 0&&o.jsx(Ht,{drawType:e.drawType,onPolygonSelected:n})]})},nt=1.5,hr=80,gr=Se.makeStyles(e=>Se.createStyles({map:{height:"100%",width:"100%",position:"absolute"},absolute:{position:"absolute",zIndex:1e3,left:e.spacing(nt),top:e.spacing(nt)},contentContainer:{marginTop:e.spacing(nt),width:e.spacing(hr)},filtersContainer:{display:"flex",padding:e.spacing(1)},filtersMargin:{marginLeft:e.spacing(1)}})),pr=e=>{var f;const[n,t]=c.useState(),[r,s]=c.useState(),i=gr(),u=m=>{s(m),t(void 0),e.handlePolygonSelected(m)},h=()=>{s(void 0),e.handlePolygonReset()};return o.jsxs("div",{className:i.map,children:[o.jsxs("div",{className:`${i.absolute}`,children:[o.jsxs(Q.Paper,{className:i.filtersContainer,children:[o.jsx(rr,{onCancelDraw:()=>t(void 0),onReset:h,onStartDraw:t,isSelectionEnabled:n!==void 0}),(f=e.filters)==null?void 0:f.map((m,v)=>o.jsx("div",{className:i.filtersMargin,children:m},v))]}),o.jsx(Q.Paper,{color:"red",className:`${i.contentContainer}`,children:e.children})]}),o.jsx(ur,{children:e.mapContent,onPolygonSelection:u,drawType:n,selectionPolygon:r})]})},Wt=new ke.Fill({color:"rgba(255,255,255,0.4)"}),zt=new ke.Stroke({color:"#3399CC",width:1.25}),$t=[new ke.Style({image:new ke.Circle({fill:Wt,stroke:zt,radius:5}),fill:Wt,stroke:zt})],Ut=c.createContext(null),fr=Ut.Provider,qt=()=>{const e=c.useContext(Ut);if(e===null)throw new Error("vector tile layer context is null, please check the provider");return e},mr=({children:e,options:n,style:t})=>{const r=Ce(),[s]=c.useState(new In({...n,style:t||$t}));return c.useEffect(()=>(r.addLayer(s),()=>{r.removeLayer(s)}),[r,s]),c.useEffect(()=>{s.setStyle(t||$t)},[s,t]),o.jsx(fr,{value:s,children:e})},rt=20,yr=256,vr=2,Er=2,Sr="REST",Tr=e=>{const n=ut.get(e.projection),t=n.getExtent(),r=new Array(rt),s=new Array(rt),i=gt.getWidth(t)/yr,u=e.heightWidthRatio!==void 0?e.heightWidthRatio:Er,h=e.requestEncoding!==void 0?e.requestEncoding:Sr;for(let m=0;m<rt;++m)r[m]=i/Math.pow(vr,m)/u,s[m]=m.toString();return{attributions:e.attributions,url:e.url,layer:e.layer,matrixSet:e.matrixSet,format:e.format,projection:n,tileGrid:new On({origin:gt.getTopLeft(t),resolutions:r,matrixIds:s}),style:e.style,requestEncoding:h,wrapX:e.wrapX!==void 0?e.wrapX:!0}},wr=e=>{const n=_e(),{options:t}=e;return c.useEffect(()=>{n.setSource(new Je.WMTS(t))},[n,t]),null},Cr=e=>{const{attributions:n,url:t,params:r,serverType:s,transition:i}=e;return{attributions:n,url:t,params:r,serverType:s,transition:i}},Lr=e=>{const n=_e(),{options:t}=e;return c.useEffect(()=>{n.setSource(new An(t))},[n,t]),null},br=e=>{const{attributions:n,url:t}=e;return{attributions:n,url:t}},Mr=e=>{const n=_e(),{options:t}=e;return c.useEffect(()=>{n.setSource(new kn(t))},[n,t]),null},_r=c.createContext(null),Pr=()=>{const e=c.useContext(_r);if(e===null)throw new Error("vector tile source context is null, please check the provider");return e},Dr=e=>{const{url:n}=e;return{url:n,format:new Qe.MVT}},Ir=({children:e,options:n})=>{const t=qt();return c.useEffect(()=>{t.setSource(new Nn(n))},[n,t]),null},Or=({legendItems:e,title:n,isCollapsed:t})=>{const r=Ce();return c.useEffect(()=>{const s=new pt({title:n??"",margin:5,maxWidth:300}),i=new xn({legend:s,collapsed:t===void 0?!0:t});r.addControl(i);const u=new pt({margin:4});return e.forEach(h=>{u.addItem({title:h.title,style:h.style,typeGeom:"Polygon"})}),s.addItem(u),()=>{r.removeControl(i)}},[r,e,n,t]),o.jsx(o.Fragment,{})};function Ar(e){const{headCells:n,order:t,orderBy:r,onRequestSort:s,isCollapseable:i}=e,u=h=>f=>{s(f,h)};return o.jsx(Bn,{children:o.jsxs(Q.TableRow,{children:[i&&o.jsx(Q.TableCell,{}),n.map(h=>o.jsx(Q.TableCell,{align:h.numeric?"right":"left",padding:h.disablePadding?"none":"default",sortDirection:r===h.id?t:!1,children:o.jsx(Q.TableSortLabel,{active:r===h.id,direction:r===h.id?t:"asc",onClick:u(h.id),children:h.label})},h.id))]})})}const kr=ft.createSvgIcon(Tt.createElement("path",{d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"}),"KeyboardArrowDown"),Nr=ft.createSvgIcon(Tt.createElement("path",{d:"M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"}),"KeyboardArrowUp");function xr(e){const{cellsMetadata:n,isRowSelected:t,item:r,onRowSelected:s,rowIndex:i,isCollapseable:u,collapsedElement:h}=e,[f,m]=c.useState(!1),v=n.length,M=()=>{s==null||s(i)};return o.jsxs(o.Fragment,{children:[o.jsxs(Q.TableRow,{hover:!0,selected:t,onClick:M,children:[u&&o.jsx(Q.TableCell,{padding:"checkbox",children:o.jsx(Q.IconButton,{"aria-label":"expand row",size:"small",onClick:b=>{b.stopPropagation(),m(!f)},children:f?o.jsx(Nr,{}):o.jsx(kr,{})})}),n.map(b=>o.jsx(Q.TableCell,{align:b.numeric?"right":"left",padding:b.disablePadding?"none":"default",children:b.transform?b.transform(r[b.id]):r[b.id]},b.id+i.toString()))]}),u&&o.jsx(Q.TableRow,{children:o.jsx(Q.TableCell,{style:{paddingBottom:0,paddingTop:0},colSpan:v+1,children:o.jsx(Q.Collapse,{in:f,unmountOnExit:!0,timeout:"auto",children:h==null?void 0:h(r)})})})]})}function Br(e){const[n,t]=c.useState(""),[r,s]=c.useState("asc"),{cellsMetadata:i,items:u,onRequestSort:h,onRowSelected:f,isCollapseable:m,collapsedElement:v,isDense:M,page:b,rowsPerPage:T,count:G,handleChangePage:z,handleChangeRowsPerPage:Z}=e,$=(X,Y)=>{const V=n===Y&&r==="asc";s(V?"desc":"asc"),t(Y),h(Y,V?"desc":"asc")};return o.jsxs(Q.TableContainer,{component:Q.Paper,children:[o.jsxs(Q.Table,{size:M?"small":"medium",children:[o.jsx(Ar,{headCells:i,onRequestSort:$,order:r,orderBy:n,isCollapseable:m}),o.jsxs(Q.TableBody,{children:[u.map((X,Y)=>o.jsx(xr,{item:X,rowIndex:Y,isCollapseable:m,cellsMetadata:i,collapsedElement:v,isRowSelected:!1,onRowSelected:f},Y)),(u.length===0||T>u.length)&&o.jsx(Q.TableRow,{style:{height:(M?33:53)*(T-u.length)},children:o.jsx(Q.TableCell,{colSpan:m?i.length+1:i.length,children:u.length===0&&o.jsx(Q.Typography,{align:"center",children:"No results :("})})})]})]}),o.jsx(Q.TablePagination,{rowsPerPage:T,rowsPerPageOptions:[5,10],component:"div",count:G,page:b,onPageChange:z,onRowsPerPageChange:Z})]})}const Fr=e=>{const{children:n,...t}=e;return o.jsx(Fn,{...t,children:n})},Vr=e=>{const{children:n,...t}=e;return o.jsx(Vn,{...t,children:n})},jt=e=>e*Math.PI/180,Ge=e=>e*(180/Math.PI),Gr=e=>.05*(5916575505e-1/Math.pow(2,e-1)/2)*(Math.cos(jt(85.362/2))/Math.sin(jt(85.362/2)));class Hr extends p.PolylineDashMaterialProperty{}class Wr extends p.ConstantProperty{}class zr extends p.ConstantPositionProperty{}class $r extends p.Cartesian2{}class Ur extends p.Cartesian3{}class Kt extends p.Cartographic{}class qr extends p.BoundingSphere{}class jr extends p.Ellipsoid{}class Kr extends p.GeographicTilingScheme{}class Yr extends p.Rectangle{}class Zr extends p.Resource{}class Xr extends p.EllipsoidTerrainProvider{}class Jr extends p.CesiumTerrainProvider{}class Qr extends p.PolylineGraphics{}class Rr extends p.JulianDate{}class ei extends p.PositionProperty{}class ti extends p.BillboardGraphics{}const ni=p.VerticalOrigin,ri=p.HorizontalOrigin,ii=p.LabelStyle,oi=p.HeightReference,Yt=(e,n,t)=>{let r;if(e.scene.mode!==p.SceneMode.SCENE2D)r=e.scene.pickPosition(new p.Cartesian2(n,t));else{const s=e.scene.globe.ellipsoid;r=e.camera.pickEllipsoid(new p.Cartesian2(n,t),s)}return p.Cartographic.fromCartesian(r)},si=(e,n,t)=>{const r=Yt(e,n,t);return{type:"Feature",properties:{},geometry:{type:"Point",coordinates:[p.Math.toDegrees(r.longitude),p.Math.toDegrees(r.latitude)]}}},Zt=(e,n,t)=>{try{const r=Yt(e,n,t);return{longitude:p.Math.toDegrees(r.longitude),latitude:p.Math.toDegrees(r.latitude)}}catch{return}},Oo="",Xt=e=>{const n=le(),t=c.useRef(null),[r,s]=c.useState({x:0,y:0});return c.useEffect(()=>{n.screenSpaceEventHandler.setInputAction(i=>{if(i!=null&&i.endPosition){const u={...i.endPosition};u.x=Math.ceil(u.x),u.y=Math.ceil(u.y),s(u)}},p.ScreenSpaceEventType.MOUSE_MOVE)},[t,n]),c.useEffect(()=>{const i=n.scene.globe.ellipsoid;if(r){const u=Zt(n,r.x,r.y);if(u){const h=new Kt(u.longitude,u.latitude);if(t.current){let f="";switch(e.projection){case ye.WEB_MERCATOR:{const v=new p.WebMercatorProjection(i).project(h);f=`Mercator: ${v.y.toFixed(Ve)}m, ${v.x.toFixed(Ve)}m`,t.current.style.width="220px";break}case ye.WGS84:{const m=h.longitude.toFixed(Fe);f=`WGS84: ${h.latitude.toFixed(Fe)}°N ${m}°E`,t.current.style.width="200px";break}}t.current.innerHTML=f}}}},[r,t,n,e.projection]),o.jsx("div",{className:"trackerPosition",ref:t})},Ao="",it=[1,2,3,5,10,20,30,50,100,200,300,500,1e3,2e3,3e3,5e3,1e4,2e4,3e4,5e4,1e5,2e5,3e5,5e5,1e6,2e6,3e6,5e6,1e7,2e7,3e7,5e7],ai=(e,n,t,r)=>{const s=q.get(r,"METERS_UNIT")??"m",i=q.get(r,"KILOMETERS_UNIT")??"km",u={barWidth:void 0,distanceLabel:void 0,lastLegendUpdate:n.lastLegendUpdate},h=new p.EllipsoidGeodesic,f=new Date().getTime();if(f<u.lastLegendUpdate+250)return;u.lastLegendUpdate=f;const m=e.scene.canvas.clientWidth,v=e.scene.canvas.clientHeight,M=e.scene.camera.getPickRay(new p.Cartesian2(m/2|0,v-1)),b=e.scene.camera.getPickRay(new p.Cartesian2(1+m/2|0,v-1)),T=e.scene.globe,G=T.pick(M,e.scene),z=T.pick(b,e.scene);if(!G||!z)return;const Z=T.ellipsoid.cartesianToCartographic(G),$=T.ellipsoid.cartesianToCartographic(z);h.setEndPoints(Z,$);const X=h.surfaceDistance,Y=100;let V;for(let j=it.length-1;!q.isNumber(V)&&j>=0;--j)it[j]/X<Y&&(V=it[j]);if(q.isNumber(V)){let j="";V>=1e3?j=`${(V/1e3).toString()} ${i}`:j=`${V.toString()} ${s}`,u.barWidth=V/X|0,u.distanceLabel=j}t(u)},Jt=e=>{const n=le(),[t,r]=c.useState({barWidth:void 0,distanceLabel:void 0,lastLegendUpdate:-1});c.useEffect(()=>{const i=f=>{ai(n,t,r,e.locale)},u=new p.EventHelper,h=f=>{n.scene.globe.tilesLoaded&&(i(new MouseEvent("mouse")),u.removeAll())};return u.add(n.scene.globe.tileLoadProgressEvent,h),n.camera.moveEnd.addEventListener(i),()=>{try{q.get(n,"_cesiumWidget")!=null&&n.camera.moveEnd.removeEventListener(i)}catch(f){console.log('CESIUM camera "moveEnd" remove listener failed',f)}}},[n,e.locale,t]);const s=i=>5+(125-i)/2;return o.jsx("div",{className:"scalePosition",children:q.isNumber(t.barWidth)&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"scale-tracker-label",children:o.jsx("bdi",{children:t.distanceLabel})}),o.jsx("div",{className:"scale-tracker-bar",style:{height:"2px",width:`${t.barWidth.toString()}px`,left:`${s(t.barWidth).toString()}px`}})]})})},ue={MORPHING:p.SceneMode.MORPHING,COLUMBUS_VIEW:p.SceneMode.COLUMBUS_VIEW,SCENE2D:p.SceneMode.SCENE2D,SCENE3D:p.SceneMode.SCENE3D},ko="",Qt=(e,n)=>{const r=q.get(n.scene.globe,"_surface.tileProvider"),s=r._quadtree,i=n.canvas.height,u=q.get(n.camera.frustum,"sseDenominator")??1;for(let h=0;h<=19;h++)if(r.getLevelMaximumGeometricError(h)*i/(e*u)<s.maximumScreenSpaceError)return h;return null},li=(e,n)=>{e=e||10;const t=[];let r=1e5,s=0;for(let i=1e8;i>r;i=i-r){const u=Qt(i,n);if(u===null)break;if(u!==s){let h=i,f=i+r;for(;f-h>e;)i=h+(f-h)/2,Qt(i,n)===u?h=i:f=i;t.push({level:u,height:Math.round(i)}),s=u,t.length>=2&&(r=(t[t.length-2].height-i)/1e3)}}return t},Rt=({locale:e=void 0,valueBy:n="RENDERED_TILES"})=>{const t=le(),[r,s]=c.useState(1),i=li(1,t),u=c.useCallback(()=>{const v=t.camera,M=.5;let b=0;switch(t.scene.mode){case ue.SCENE3D:b=t.scene.mapProjection.ellipsoid.cartesianToCartographic(v.positionWC).height;break;case ue.SCENE2D:b=(v.frustum.right-v.frustum.left)*M;break;case ue.COLUMBUS_VIEW:b=v.position.z;break;default:b=0;break}if(i.length>0){const T=i.reduce((G,z)=>Math.abs(z.height-b)<Math.abs(G.height-b)?z:G);s(T.level),t.currentZoomLevel=T.level}},[t,i]),h=c.useCallback(()=>{let v=0;t.scene.globe._surface.forEachRenderedTile(function(M){v=Math.max(v,M.level)}),s(v),t.currentZoomLevel=v},[t]),m=c.useMemo(()=>({CALCULATION:u,RENDERED_TILES:h}),[u,h])[n];return c.useEffect(()=>{const v=t.scene.globe.tileLoadProgressEvent.addEventListener(function(){t.scene.globe.tilesLoaded&&m()});return t.camera.moveEnd.addEventListener(m),()=>{try{typeof q.get(t,"_cesiumWidget")<"u"&&(t.camera.moveEnd.removeEventListener(m),v())}catch(M){console.log('CESIUM camera "moveEnd"(from zoom tracker) remove listener failed',M)}}},[t,m]),o.jsxs("div",{className:"zoomLevel",children:[o.jsx("div",{className:"zoomLevelValue",children:r}),o.jsx("div",{className:"zoomLevelLabel",children:q.get(e,"ZOOM_LABEL")??"zoom"})]})},No="",ci=-1,di=e=>{const n=le(),[t,r]=c.useState(),{sceneModes:s}=e,i=u=>s.findIndex(h=>h===u)>ci;return c.useEffect(()=>{r(n.scene.mode)},[]),o.jsxs(o.Fragment,{children:[i(ue.SCENE3D)&&o.jsx(U.Icon,{icon:o.jsx("div",{className:`mapViewIcon ${t===ue.SCENE3D?"mapViewCurrent":""}`,children:o.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 64 64",children:o.jsx("path",{d:"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"})})}),onClick:()=>{n.scene.morphTo3D(),r(ue.SCENE3D)}}),i(ue.SCENE2D)&&o.jsx(U.Icon,{icon:o.jsx("div",{className:`mapViewIcon ${t===ue.SCENE2D?"mapViewCurrent":""}`,children:o.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 64 64",children:o.jsx("path",{d:"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"})})}),onClick:()=>{n.scene.morphTo2D(),r(ue.SCENE2D)}}),i(ue.COLUMBUS_VIEW)&&o.jsx(U.Icon,{icon:o.jsx("div",{className:`mapViewIcon ${t===ue.COLUMBUS_VIEW?"mapViewCurrent":""}`,children:o.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 64 64",children:o.jsx("path",{d:"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"})})}),onClick:()=>{n.scene.morphToColumbusView(),r(ue.COLUMBUS_VIEW)}})]})},xo="",ui=Se.makeStyles(e=>Se.createStyles({mapContainer:{width:"60px",height:"60px",border:`${e.palette.background.paper} 2px solid`}})),hi=e=>{const n=le(),{baseMaps:t}=e,[r,s]=c.useState(" "),[i,u]=c.useState(),h=ui();c.useEffect(()=>{const m=t==null?void 0:t.maps.find(v=>v.isCurrent);m&&(u(m),s(m.title!==void 0?m.title:" "))},[t]);const f=m=>{var v,M;if(t){(v=n.layersManager)==null||v.removeBaseMapLayers();const b=t.maps.find(T=>T.id===m);b&&((M=n.layersManager)==null||M.setBaseMapLayers(b),u(b),t.maps.forEach(T=>{T.isCurrent=b===T}))}};return o.jsxs(o.Fragment,{children:[o.jsx("label",{className:"mapLabel",children:r}),o.jsx("ul",{className:"mapSelector",children:t==null?void 0:t.maps.map(m=>o.jsx("li",{className:`mapContainer ${h.mapContainer} ${m===i?"mapContainerSelected":""}`,children:o.jsx("img",{alt:"",className:"mapContainerImg",src:m.thumbnail,onMouseOver:()=>{s(m.title)},onMouseOut:()=>{s((i==null?void 0:i.title)!==void 0?i.title:" ")},onClick:()=>{f(m.id)}})},m.id))})]})},Bo="",ot="ic_settings_24px",gi=e=>{const[n,t]=c.useState(!1),{sceneModes:r,baseMaps:s,locale:i}=e,u=c.useRef(null),h=q.get(i,"MAP_SETTINGS_DIALOG_TITLE")??"Map Settings",f=q.get(i,"MAP_SETTINGS_SCENE_MODE_TITLE")??"Scene Mode",m=q.get(i,"MAP_SETTINGS_BASE_MAP_TITLE")??"Base Map";return c.useEffect(()=>{const v=M=>{var G;const b=M.target,T=q.get(u,"current");T&&!T.contains(b)&&b.id!==ot&&((G=b.parentElement)==null?void 0:G.id)!==ot&&(document.removeEventListener("click",v,!1),t(!1))};return document.addEventListener("click",v,!1),()=>{document.removeEventListener("click",v,!1)}}),o.jsxs(o.Fragment,{children:[o.jsx(U.Icon,{icon:o.jsx("div",{className:"settingsIconContainer",children:o.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 24 24",id:ot,x:"288",y:"24",children:o.jsx("path",{d:"M19.43 12.98c.04-.32.07-.64.07-.98s-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.12-.22-.39-.3-.61-.22l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65A.488.488 0 0 0 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.23-.09-.49 0-.61.22l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98s.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.12.22.39.3.61.22l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.23.09.49 0 .61-.22l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.65zM12 15.5c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5 3.5 1.57 3.5 3.5-1.57 3.5-3.5 3.5z"})})}),onClick:()=>{t(!n)}}),n&&o.jsx("div",{className:"settingsDialogPortal",ref:u,children:o.jsxs(U.Dialog,{open:n,onClosed:()=>{t(!1)},children:[o.jsx(U.DialogTitle,{children:h}),o.jsxs(U.DialogContent,{children:[o.jsx("h4",{className:"sectionLabel",children:f}),o.jsx(oe,{className:"mapScenesContainer",children:o.jsx(di,{sceneModes:r})}),o.jsx(oe,{className:"baseMapsContainer",children:s&&o.jsxs(o.Fragment,{children:[o.jsx("h4",{className:"sectionLabel",children:m}),o.jsx(hi,{baseMaps:s})]})})]})]})})]})},Fo="",pi=()=>{const e=le(),n=[{onClick:()=>e.camera.zoomIn(),iconPath:"M48 20h-18v-18h-10v18h-18v10h18v18h10v-18h18z"},{onClick:()=>e.camera.zoomOut(),iconPath:"M2 20h46v10h-46z"}];return o.jsx("div",{className:"zoom-buttons-container",children:n.map((t,r)=>o.jsx(U.Icon,{icon:o.jsx("div",{className:"zoom-button",children:o.jsx("svg",{fill:"#fff",width:"10px",height:"10px",viewBox:"0 -20 50 50",version:"1.2",baseProfile:"tiny",xmlns:"http://www.w3.org/2000/svg",overflow:"inherit",children:o.jsx("path",{d:t.iconPath})})}),onClick:t.onClick},r))})},Vo="",fi=o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",enableBackground:"new 0 0 24 24",height:"24",width:"24",viewBox:"0 0 612 612",children:o.jsxs("g",{xmlns:"http://www.w3.org/2000/svg",children:[o.jsx("path",{d:"M322.4,173.9l-129,16.2l-4.6,21.4l25.3,4.7c16.5,3.9,19.8,9.9,16.2,26.4l-41.5,195.3c-10.9,50.5,5.9,74.3,45.5,74.3 c30.7,0,66.3-14.2,82.5-33.6l4.9-23.4c-11.3,9.9-27.7,13.9-38.6,13.9c-15.5,0-21.1-10.9-17.1-30L322.4,173.9z"}),o.jsx("circle",{cx:"270.1",cy:"56.3",r:"56.3"})]})}),mi=({onClick:e})=>o.jsx(oe,{onClick:e,className:"mapLegendToggleContainer",children:o.jsx(U.Icon,{icon:fi,className:"mapLegendIcon"})}),yi=({legend:{legendImg:e,legendDoc:n,layer:t},docText:r,imgText:s})=>{const i=c.useCallback(()=>{window.open(e,"_blank")},[e]);c.useCallback(()=>{window.open(n,"_blank")},[n]);const u=c.useCallback(()=>{const m=o.jsx(oe,{className:"layerNameContainer",children:o.jsx("h3",{style:{maxWidth:`${15}ch`},className:"layerName",children:t})});return(t??"").length>15?o.jsx(U.Tooltip,{content:t,children:m}):m},[t]),h=c.useCallback(()=>[typeof e=="string"&&o.jsx("a",{className:"legendAction",href:e,target:"_blank",rel:"noreferrer",children:s}),typeof n=="string"&&o.jsx("a",{className:"legendAction",href:n,target:"_blank",rel:"noreferrer",children:r})],[e,s,n,r]);return o.jsxs(oe,{className:"mapLegend",children:[u(),o.jsx("img",{alt:"Map Legend",className:"legendImg",src:e,onClick:i}),o.jsx(oe,{className:"legendActionsContainer",children:h()})]})},vi=({legends:e,actionsTexts:{docText:n,imgText:t},noLegendsText:r})=>{const s=c.useCallback(()=>o.jsx(oe,{className:"noLegendsContainer",children:o.jsx("h2",{className:"noLegendsMsg",children:r})}),[r]),i=c.useCallback(()=>e.length?e.map((u,h)=>o.jsx(yi,{legend:u,docText:n,imgText:t},`${u.layer}_${h}`)):s(),[e]);return o.jsx(oe,{className:"mapLegendsList",children:i()})},Ei=({isOpen:e,toggleSidebar:n,title:t="Map Legends",noLegendsText:r="No legends to display...",actionsTexts:s={docText:"Docs",imgText:"View Image"},legends:i=[]})=>e?o.jsxs(U.Drawer,{className:"mapLegendSidebarContainer",modal:!1,dismissible:!0,open:e,children:[o.jsx(U.DrawerHeader,{className:"sidebarHeaderContainer",children:o.jsx(U.DrawerTitle,{className:"sidebarTitle",children:t})}),o.jsxs(U.DrawerContent,{className:"sidebarContent",children:[o.jsx(U.Icon,{onClick:n,className:"mapLegendCloseBtn",icon:{icon:"close",size:"small"}}),o.jsx(vi,{noLegendsText:r,legends:i,actionsTexts:s})]})]}):null,Ee=document.createElement("canvas"),ge=Ee.getContext("2d"),en=e=>{const r=(e==null?void 0:e.data)??[];for(let s=3;s<r.length;s+=4)if(r[s]<255)return!0;return!1},Si=async(e,n)=>(n&&n.tileTransparencyCheckedCounter++,new Promise((t,r)=>{try{ge==null||ge.clearRect(0,0,Ee.width,Ee.height);let s;if(e instanceof HTMLImageElement)s=e;else if(e instanceof ImageBitmap){Ee.width=e.width,Ee.height=e.height,ge==null||ge.drawImage(e,0,0);const i=ge==null?void 0:ge.getImageData(0,0,Ee.width,Ee.height),u=en(i);u&&n&&(n.tileTransparencyCheckedCounter=n.maxTilesForTransparencyCheck),t(u);return}else s=new Image,s.crossOrigin="anonymous",s.src=e;s.onload=()=>{Ee.width=s.width,Ee.height=s.height,ge==null||ge.drawImage(s,0,0);const i=ge==null?void 0:ge.getImageData(0,0,Ee.width,Ee.height);en(i)?(n&&(n.tileTransparencyCheckedCounter=n.maxTilesForTransparencyCheck),t(!0)):t(!1)}}catch(s){console.error("Could not determine image transparency. Error => ",s),r(s)}})),He=(e,n)=>{const{west:t,east:r,north:s,south:i}=e,{west:u,east:h,north:f,south:m}=n;return t>=u&&r<=h&&s<=f&&i>=m},Ti=(e,n)=>Wn(e,Re(n)),wi=e=>{const n=(p.Math.toDegrees(e.west)+p.Math.toDegrees(e.east))/2,t=(p.Math.toDegrees(e.south)+p.Math.toDegrees(e.north))/2;return mt.point([n,t])},Ci=e=>[p.Math.toDegrees(e.west),p.Math.toDegrees(e.south),p.Math.toDegrees(e.east),p.Math.toDegrees(e.north)],Li=(e,n=100)=>{const t=e.scene,r=e.camera,s=t.mode,i=r.computeViewRectangle(t.globe.ellipsoid);if(!p.defined(i)||!i){console.error("computeViewRectangle returned invalid rectangle.");return}if(s!==p.SceneMode.SCENE3D)return i;const u=r.positionCartographic;if(!p.defined(u)){console.error("Camera position is undefined in 3D mode.");return}const h=u.latitude,f=u.longitude;if(h<-p.Math.PI_OVER_TWO||h>p.Math.PI_OVER_TWO||f<-p.Math.PI||f>p.Math.PI){console.error("Invalid latitude or longitude values.");return}const m=111320,v=111320*Math.cos(h);let M=n/m,b=n/v;const T=p.Cartesian3.magnitude(r.positionWC);T>1e7&&(M=10,b=10);const G=r.frustum instanceof p.PerspectiveFrustum?r.frustum.fov:Math.PI/3;let z=1;T<5e5?z=.05:T<2e6&&(z=.1),M*=z*(G/Math.PI),b*=z*(G/Math.PI);const Z=r.pitch;if(Z===void 0)return;const $=Math.PI/4,X=Math.max(0,1-Math.abs(Z)/$);M*=X,b*=X;const Y=5e-4;M=Math.max(M,Y),b=Math.max(b,Y);const V=u.latitude-M,j=u.latitude+M,H=u.longitude-b,W=u.longitude+b,te=p.Math.clamp(V,i.south,i.north),a=p.Math.clamp(j,i.south,i.north),l=p.Math.clamp(H,i.west,i.east),C=p.Math.clamp(W,i.west,i.east),g=Math.min(1,Z/p.Math.PI_OVER_TWO),S=i.north-(i.north-i.south)*g,y=Math.min(a,S);return new p.Rectangle(p.Math.negativePiToPi(l),p.Math.clamp(te,-p.Math.PI_OVER_TWO,p.Math.PI_OVER_TWO),p.Math.negativePiToPi(C),p.Math.clamp(y,-p.Math.PI_OVER_TWO,p.Math.PI_OVER_TWO))},We=3,ze="hasTransparency";function st(e,n,t,r,s){return setTimeout(()=>{var h;const i=(h=this.layerListInstance.find(f=>{var m,v;return((m=f._imageryProvider._resource)==null?void 0:m._url)===((v=this._resource)==null?void 0:v._url)}))==null?void 0:h.meta,u=q.get(i,ze)===!0;this.tileTransparencyCheckedCounter<We&&!u&&Si(s==null?void 0:s.url,this).then(f=>{var m;(m=this.mapViewer.layersManager)==null||m.addMetaToLayer({[ze]:f},v=>v._imageryProvider._resource._url===this._resource._url)})},0),e(n,t,r,s)}class tn extends p.UrlTemplateImageryProvider{constructor(t,r){var s;super(t);ne(this,"layerListInstance");ne(this,"mapViewer");ne(this,"maxTilesForTransparencyCheck",We);ne(this,"tileTransparencyCheckedCounter",0);this.layerListInstance=(s=r.layersManager)==null?void 0:s.layerList,this.mapViewer=r}requestImage(t,r,s,i){return st.call(this,super.requestImage.bind(this),t,r,s,i)}}class nn extends p.WebMapServiceImageryProvider{constructor(t,r){var s;super(t);ne(this,"layerListInstance");ne(this,"mapViewer");ne(this,"maxTilesForTransparencyCheck",We);ne(this,"tileTransparencyCheckedCounter",0);this.layerListInstance=(s=r.layersManager)==null?void 0:s.layerList,this.mapViewer=r}requestImage(t,r,s,i){return st.call(this,super.requestImage.bind(this),t,r,s,i)}}class rn extends p.WebMapTileServiceImageryProvider{constructor(t,r){var s;super(t);ne(this,"layerListInstance");ne(this,"mapViewer");ne(this,"maxTilesForTransparencyCheck",We);ne(this,"tileTransparencyCheckedCounter",0);this.layerListInstance=(s=r.layersManager)==null?void 0:s.layerList,this.mapViewer=r}requestImage(t,r,s,i){return st.call(this,super.requestImage.bind(this),t,r,s,i)}}const bi=1,Mi=-1,on="TRANSPARENT_BASE_LAYER";class _i{constructor(n,t,r,s){ne(this,"mapViewer");ne(this,"legendsList");ne(this,"layerUpdated");ne(this,"dataLayerUpdated");ne(this,"layers");ne(this,"dataLayers");ne(this,"legendsExtractor");ne(this,"layerManagerFootprintMetaFieldPath");this.mapViewer=n,this.layers=this.mapViewer.imageryLayers._layers,this.dataLayers=[],this.legendsList=[],this.legendsExtractor=t,this.layerUpdated=new p.Event,this.dataLayerUpdated=new p.Event,this.layerManagerFootprintMetaFieldPath=s,r&&this.layerUpdated.addEventListener(r,this),this.mapViewer.shouldOptimizedTileRequests&&(this.layerUpdated.addEventListener(i=>{const u=Object.keys(i);u.length===1&&u[0]===ze&&(this.markRelevantLayersForExtent(),this.hideNonRelevantLayers())}),this.mapViewer.imageryLayers.layerRemoved.addEventListener(()=>{this.setLegends(),this.markRelevantLayersForExtent(),this.hideNonRelevantLayers()}),this.mapViewer.imageryLayers.layerMoved.addEventListener(()=>{this.markRelevantLayersForExtent(),this.hideNonRelevantLayers()}),this.mapViewer.imageryLayers.layerAdded.addEventListener(()=>{this.markRelevantLayersForExtent(),this.hideNonRelevantLayers()}),this.mapViewer.camera.moveEnd.addEventListener(()=>{this.markRelevantLayersForExtent(),this.hideNonRelevantLayers()}))}get layerList(){return this.layers}get dataLayerList(){return this.dataLayers}addDataLayer(n){this.dataLayers.push({...n}),this.dataLayerUpdated.raiseEvent(this.dataLayers)}addMetaToLayer(n,t){const r=this.layers.map(s=>s.imageryProvider.readyPromise);Promise.all(r).then(s=>{const i=this.layers.find(t);i&&(i.meta={...i.meta??{},...n},this.setLegends(),this.layerUpdated.raiseEvent(n))})}addMetaToDataLayer(n){const t=this.findDataLayerById(n.id);t&&(t.meta={...t.meta??{},...n},this.dataLayerUpdated.raiseEvent(this.dataLayers,n.id))}setBaseMapLayers(n){n.baseRasteLayers.sort((r,s)=>r.zIndex-s.zIndex).forEach((r,s)=>{this.addRasterLayer(r,s,n.id)}),this.mapViewer.shouldOptimizedTileRequests&&(this.removeLayer(on),this.addTransparentImageryProvider())}addRasterLayer(n,t,r){let s;switch(n.type){case"XYZ_LAYER":{const i=n.options,u=this.mapViewer.shouldOptimizedTileRequests?new tn(i,this.mapViewer):new p.UrlTemplateImageryProvider(i);s=this.mapViewer.imageryLayers.addImageryProvider(u,t);break}case"WMS_LAYER":{const i=n.options,u=this.mapViewer.shouldOptimizedTileRequests?new nn(i,this.mapViewer):new p.WebMapServiceImageryProvider(i);s=this.mapViewer.imageryLayers.addImageryProvider(u,t);break}case"WMTS_LAYER":{const i=n.options,u=this.mapViewer.shouldOptimizedTileRequests?new rn(i,this.mapViewer):new p.WebMapTileServiceImageryProvider(i);s=this.mapViewer.imageryLayers.addImageryProvider(u,t);break}}s&&(s.alpha=n.opacity,s.meta={parentBasetMapId:r,...n},n.show!==void 0&&(s.show=n.show))}removeLayer(n){const t=this.findLayerById(n);t&&this.mapViewer.imageryLayers.remove(t,!0)}removeDataLayer(n){const t=this.findDataLayerById(n);if(t){const r=this.dataLayers.indexOf(t);r>-1&&this.dataLayers.splice(r,1),this.dataLayerUpdated.raiseEvent(this.dataLayers)}}removeBaseMapLayers(){this.layers.filter(t=>!!q.get(t.meta,"parentBasetMapId")).forEach(t=>{this.mapViewer.imageryLayers.remove(t,!0)})}removeNotBaseMapLayers(){this.layers.filter(t=>!q.get(t.meta,"parentBasetMapId")).forEach(t=>{this.mapViewer.imageryLayers.remove(t,!0)})}raise(n,t=1){const r=this.findLayerById(n),s=(r==null?void 0:r.meta).zIndex;if(r)for(let i=0;i<t;i++)this.mapViewer.imageryLayers.raise(r);this.updateLayersOrder(n,s,s+t)}lower(n,t=1){const r=this.findLayerById(n),s=(r==null?void 0:r.meta).zIndex,i=this.getBaseLayersCount(),u=this.mapViewer.imageryLayers.indexOf(r);if(u-t<=i&&(t=u-i),r)for(let h=0;h<t;h++)this.mapViewer.imageryLayers.lower(r);this.updateLayersOrder(n,s,s-t)}raiseToTop(n){const t=this.findLayerById(n),r=(t==null?void 0:t.meta).zIndex;t&&this.mapViewer.imageryLayers.raiseToTop(t),this.updateLayersOrder(n,r,this.mapViewer.imageryLayers.length-this.getBaseLayersCount()-1)}lowerToBottom(n){const t=this.findLayerById(n),r=this.getBaseLayersCount(),s=this.mapViewer.imageryLayers.indexOf(t);this.lower(n,s-r)}length(){return this.mapViewer.imageryLayers.length}show(n,t){const r=this.get(n);r!==void 0&&(r.show=t)}showAllNotBase(n){this.layers.filter(r=>!q.get(r.meta,"parentBasetMapId")).forEach(r=>{var s;this.show((s=r.meta)==null?void 0:s.id,n)})}get(n){const t=this.findLayerById(n),r=this.mapViewer.imageryLayers.indexOf(t);return r?this.mapViewer.imageryLayers.get(r):void 0}pickImageryLayers(n){var s;const t=this.mapViewer.camera.getPickRay(n);let r;return t&&(r=(s=this.mapViewer.imageryLayers.pickImageryLayers(t,this.mapViewer.scene))==null?void 0:s.filter(i=>!q.get(i.meta,"parentBasetMapId"))),r}findLayerByPOI(n,t,r=!0){if(this.layerManagerFootprintMetaFieldPath){const s=si(this.mapViewer,n,t);return this.layers.filter(h=>!q.get(h.meta,"parentBasetMapId")).filter(h=>{const f=q.get(h.meta,this.layerManagerFootprintMetaFieldPath);return f!==void 0?Hn(s.geometry,{type:"Feature",properties:{},geometry:f})&&(r?h.show:!0):(console.warn("[LayerManager] [findLayerByPOI] CesiumImageryLayer has no defined footprint",h.meta),!1)}).sort((h,f)=>{var m,v;return((m=f.meta)==null?void 0:m.zIndex)-((v=h.meta)==null?void 0:v.zIndex)})}else return console.warn("[LayerManager] [findLayerByPOI]layerManagerFootprintMetaFieldPath is not defined"),[]}addTransparentImageryProvider(){const n=this.mapViewer.imageryLayers.addImageryProvider(new p.SingleTileImageryProvider({url:"./assets/img/transparent-tile.png",rectangle:new p.Rectangle(-3.141592653589793,-1.5707963267948966,3.141592653589793,1.5707963267948966)}),0);n.meta={id:on,skipRelevancyCheck:!0,parentBasetMapId:"TRANSPARENT_LAYER"}}addDataLayerUpdatedListener(n){this.dataLayerUpdated.addEventListener(n,this)}removeDataLayerUpdatedListener(n){this.dataLayerUpdated.removeEventListener(n,this)}findDataLayerById(n){return this.dataLayers.find(t=>t.meta.id===n)}setLegends(){typeof this.legendsExtractor<"u"&&(this.legendsList=this.legendsExtractor(this.layers))}getBaseLayersCount(){return this.layers.filter(t=>!!q.get(t.meta,"parentBasetMapId")).length}findLayerById(n){return this.layers.find(t=>t.meta!==void 0?t.meta.id===n:!1)}updateLayersOrder(n,t,r){const s=t>r?bi:Mi,i=t<r?t:r,u=t<r?r:t;this.layers.forEach(h=>{var m;if(!q.get(h.meta,"parentBasetMapId")){const v=(m=h.meta)==null?void 0:m.zIndex;h.meta.zIndex=v>=i&&v<=u&&v!==t?v+s:v===t?r:v}})}hideNonRelevantLayers(){var n,t;for(const r of this.layers)((n=r.meta)==null?void 0:n.relevantToExtent)!==r.show&&r.imageryProvider.ready&&(r.show=((t=r.meta)==null?void 0:t.relevantToExtent)??!0)}markRelevantLayersForExtent(){var n,t;try{const r=this.mapViewer.camera.computeViewRectangle();for(let s=this.layers.length-1;s>=0;s--){const i=this.layers[s],u=!q.isEmpty(r)&&!q.isEmpty(i.rectangle)&&p.Rectangle.intersection(r,i.rectangle);for(let h=this.layers.length-1;h>=s;h--){if(((n=i.meta)==null?void 0:n.skipRelevancyCheck)===!0){i.meta={...i.meta,relevantToExtent:!0};continue}const f=this.layers[h],m=((t=f.meta)==null?void 0:t[ze])===!0;if(i!==f)if(u instanceof p.Rectangle){if(He(r,i.rectangle))if(He(r,f.rectangle)&&!m){i.meta={...i.meta??{},relevantToExtent:!1};break}else i.meta={...i.meta??{},relevantToExtent:!0};if(He(r,f.rectangle)&&!m){i.meta={...i.meta??{},relevantToExtent:!1};break}if(He(i.rectangle,f.rectangle)){if(i.meta={...i.meta??{},relevantToExtent:m},!m)break}else i.meta={...i.meta??{},relevantToExtent:!0}}else i.meta={...i.meta??{},relevantToExtent:!1};else s===this.layers.length-1&&(i.meta={...i.meta??{},relevantToExtent:u instanceof p.Rectangle})}}}catch(r){console.error(r)}}}const Go="",Pi=e=>{const n=le(),{enableCompass:t=!0,enableZoomControls:r=!1,lockCompassNavigation:s=!1,locale:i={DIRECTION:"ltr"}}=e;return c.useEffect(()=>{if(typeof q.get(n,"cesiumNavigation")>"u"){n.extend(zn,{enableCompass:t,enableZoomControls:r,enableDistanceLegend:!1}),n.cesiumNavigation.setNavigationLocked(s);const u=document.querySelector(".compass");u&&i.DIRECTION&&u.classList.add(i.DIRECTION)}},[n,t,r,i.DIRECTION,s]),null},Ho="",Di=({children:e,locale:n})=>{const[t,r]=c.useState(!1),s=c.useMemo(()=>q.get(n,"DEBUG_PANEL_TITLE")??"Debugger Tool",[n]);return o.jsxs(o.Fragment,{children:[o.jsx(U.Icon,{icon:o.jsx("div",{className:"debugPanelIconContainer",children:o.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 24 24",children:o.jsx("path",{d:"M11.99 18.54l-7.37-5.73L3 14.07l9 7 9-7-1.63-1.27-7.38 5.74zM12 16l7.36-5.73L21 9l-9-7-9 7 1.63 1.27L12 16z"})})}),onClick:()=>{r(!t)}}),o.jsx("div",{className:"debugPanel",children:o.jsxs(U.Dialog,{open:t,onClosed:()=>{r(!1)},children:[o.jsx(U.DialogTitle,{className:"title",children:s}),o.jsx(U.DialogContent,{children:e})]})})]})},Wo="",Ii=({locale:e})=>{var h;const n=le(),[t,r]=c.useState([]),s=c.useMemo(()=>q.get(e,"WFS_TITLE")??"Data Layers",[e]),i=c.useMemo(()=>q.get(e,"WFS_CACHE")??"Cache",[e]),u=c.useMemo(()=>q.get(e,"WFS_EXTENT")??"Extent",[e]);return c.useEffect(()=>{if(!n.layersManager)return;const f=(m,v)=>{var b;m.forEach(T=>{if(v!==void 0&&v!==T.meta.id)return;const{options:G,meta:z}=T,{zoomLevel:Z}=G,{id:$,items:X,total:Y,cache:V,currentZoomLevel:j,featureStructure:H}=z;r(W=>{const te=W.findIndex(a=>a.id===$);if(te>=0){if(JSON.stringify(W[te])!==JSON.stringify({id:$,items:X,total:Y,cache:V,currentZoomLevel:j,featureStructure:H,zoomLevel:Z})){const a=[...W];return a[te]={id:$,items:X,total:Y,cache:V,currentZoomLevel:j,featureStructure:H,zoomLevel:Z},a}}else return[...W,{id:$,items:X,total:Y,cache:V,currentZoomLevel:j,featureStructure:H,zoomLevel:Z}];return W})});const M=new Set((b=n.layersManager)==null?void 0:b.dataLayerList.map(T=>T.meta.id));r(T=>T.filter(G=>M.has(G.id)))};return n.layersManager.addDataLayerUpdatedListener(f),()=>{var m;(m=n.layersManager)==null||m.removeDataLayerUpdatedListener(f)}},[(h=n.layersManager)==null?void 0:h.dataLayerList]),o.jsxs(oe,{className:"wfsContainer",children:[o.jsx(oe,{className:"title",children:s}),t.map((f,m)=>o.jsxs(oe,{className:"featureType",children:[o.jsx(U.Tooltip,{content:`${f.featureStructure.aliasLayerName} ${f.id} (${String(f.zoomLevel)})`,children:o.jsxs(oe,{className:`name ${f.currentZoomLevel<f.zoomLevel?"warning blinking":f.total===-1?"error blinking":""}`,children:[f.featureStructure.aliasLayerName," ",f.id," (",String(f.zoomLevel),"):"]})}),o.jsxs(oe,{className:"info",children:[o.jsxs(oe,{children:[i,": ",f.cache??0]}),f.total>0&&o.jsxs(oe,{className:"spacer",children:[u,": ",f.items," / ",f.total]})]})]},m))]})},zo="",sn=212,an=260,Oi=0;class Ai extends p.Viewer{constructor(t,r){super(t,r);ne(this,"layersManager");ne(this,"currentZoomLevel");ne(this,"useOptimizedTileRequests")}get shouldOptimizedTileRequests(){return this.useOptimizedTileRequests??!1}set shouldOptimizedTileRequests(t){this.useOptimizedTileRequests=t}}const ln=c.createContext(null),ki=ln.Provider,le=()=>{const e=c.useContext(ln);if(e===null)throw new Error("map context is null, please check the provider");return e},Ni=e=>{var re,de,De,qe,je,Ke,Ye,Ie;const n=c.useRef(null),[t,r]=c.useState(),[s,i]=c.useState(),[u,h]=c.useState(),[f,m]=c.useState(),[v,M]=c.useState(),[b,T]=c.useState(),[G,z]=c.useState(),[Z,$]=c.useState(!1),[X,Y]=c.useState(!1),[V,j]=c.useState(),H=c.useRef(),[W,te]=c.useState(),[a,l]=c.useState([]),[C,g]=c.useState(),[S,y]=c.useState(!1),L=c.useRef(),[E,D]=c.useState(void 0),[k,A]=c.useState(!1),[O,x]=c.useState(),[B,_]=c.useState(),[I,P]=c.useState(),F=c.useMemo(()=>Z||X,[Z,X]),N={fullscreenButton:!0,timeline:!1,animation:!1,baseLayerPicker:!1,geocoder:!1,navigationHelpButton:!1,homeButton:!1,sceneModePicker:!1,imageryProvider:!1,...e},J=(ee,R,ae,pe,Te)=>{const Oe=t.container,Me=Oe.clientWidth,Cn=Oe.clientHeight,Ln=pe+Te;return{left:`${Me-ee<ae?ee-(ae-(Me-ee)):ee}px`,top:`${Cn-R<Ln?R-(Ln-(Cn-R)):R}px`}},se=c.useCallback(ee=>{if(n.current!==null){const R=n.current.cesiumElement,ae={x:ee.offsetX,y:ee.offsetY};y(!1),D(ae),x(Zt(R,ae.x,ae.y)),y(!0),L.current=ee}},[n]);c.useEffect(()=>{var ee;if(n.current!==null){const R=n.current.cesiumElement;e.imageryContextMenu&&(R.scene.canvas.removeEventListener("contextmenu",se),R.scene.canvas.addEventListener("contextmenu",se))}r((ee=n.current)==null?void 0:ee.cesiumElement)},[n,e.imageryContextMenu]),c.useEffect(()=>{var ee;t&&(t.shouldOptimizedTileRequests=e.useOptimizedTileRequests??!1,t.layersManager=new _i(t,(ee=e.legends)==null?void 0:ee.mapLegendsExtractor,()=>{var R;l((R=t.layersManager)==null?void 0:R.legendsList)},e.layerManagerFootprintMetaFieldPath))},[t]),c.useEffect(()=>{t&&(t.shouldOptimizedTileRequests=e.useOptimizedTileRequests??!1)},[e.useOptimizedTileRequests,t]),c.useEffect(()=>{te(e.sceneModes??[ue.SCENE2D,ue.SCENE3D,ue.COLUMBUS_VIEW])},[e.sceneModes]),c.useEffect(()=>{var R,ae;g(e.baseMaps);const ee=(R=e.baseMaps)==null?void 0:R.maps.find(pe=>pe.isCurrent);ee&&t&&((ae=t.layersManager)==null||ae.setBaseMapLayers(ee))},[e.baseMaps,t]),c.useEffect(()=>{i(e.projection??ye.WGS84)},[e.projection]),c.useEffect(()=>{j(e.locale)},[e.locale]),c.useEffect(()=>{h(e.showMousePosition??!0)},[e.showMousePosition]),c.useEffect(()=>{m(e.showZoomLevel??!0)},[e.showZoomLevel]),c.useEffect(()=>{M(e.showScale??!0)},[e.showScale]),c.useEffect(()=>{T(e.showCompass??!0)},[e.showCompass]),c.useEffect(()=>{z(e.showLoadingProgress??!0)},[e.showLoadingProgress]),c.useEffect(()=>{P(e.debugPanel)},[e.debugPanel]),c.useEffect(()=>{var R;const ee=()=>{if(t===void 0)return{longitude:0,latitude:0,height:0};const ae=()=>{const pe=t.camera.positionCartographic;return{longitude:Ge(pe.longitude),latitude:Ge(pe.latitude),height:pe.height}};if(t.scene.mode===p.SceneMode.SCENE3D){const pe=new p.Cartesian2(t.container.clientWidth/2,t.container.clientHeight/2),Te=t.scene.camera.getPickRay(pe),Oe=t.scene.globe.pick(Te,t.scene);if(!Oe)return{longitude:0,latitude:0,height:0};const Me=t.scene.globe.ellipsoid.cartesianToCartographic(Oe);return Me!==void 0?{longitude:Ge(Me.longitude),latitude:Ge(Me.latitude),height:t.scene.camera.positionCartographic.height}:ae()}else return ae()};t&&(t.camera.moveEnd.addEventListener(()=>{if(t.scene.mode!==p.SceneMode.MORPHING){const ae=t.camera,pe={position:ee(),direction:ae.direction.clone(),up:ae.up.clone(),right:ae.right.clone(),transform:ae.transform.clone(),frustum:ae.frustum.clone()};H.current=pe}}),G&&(t.scene.globe.tileLoadProgressEvent.addEventListener(function(){t.scene.globe.tilesLoaded?$(!1):$(!0)}),(R=t.layersManager)==null||R.addDataLayerUpdatedListener(()=>{var pe;let ae=!1;(pe=t.layersManager)==null||pe.dataLayerList.forEach(Te=>{if(typeof Te.meta.items=="number"&&typeof Te.meta.total=="number"&&Te.meta.items>0&&Te.meta.items<Te.meta.total){ae=!0;return}}),Y(ae)})))},[t]),c.useEffect(()=>{const ee=()=>{if(t&&H.current){const R=H.current;t.camera.flyTo({destination:p.Cartesian3.fromDegrees(R.position.longitude,R.position.latitude,R.position.height),duration:0})}};return t&&t.scene.morphComplete.addEventListener(ee),()=>{if(t)try{t.scene.morphComplete.removeEventListener(ee)}catch{console.error("morphCompleteHandler event not cleaned")}}},[t]),c.useEffect(()=>{const ee=e.zoom,R=e.center;t&&q.isNumber(ee)&&q.isArray(R)&&t.camera.flyTo({destination:p.Cartesian3.fromDegrees(R[0],R[1],Gr(ee)),duration:0})},[e.zoom,e.center,t]),c.useEffect(()=>{_(e.displayZoomButtons??!0)},[e.displayZoomButtons]);const ce=c.useCallback(()=>t&&Gn.createPortal(o.jsxs(o.Fragment,{children:[G&&F&&o.jsx(U.LinearProgress,{style:{position:"absolute",top:0,height:"10px",zIndex:4}}),o.jsxs(oe,{className:"sideToolsContainer",children:[I&&o.jsx(Di,{locale:V,children:I.wfs&&o.jsx(Ii,{locale:V})}),o.jsx(gi,{sceneModes:W,baseMaps:C,locale:V}),o.jsx(mi,{onClick:()=>A(!k)})]}),o.jsxs(oe,{className:"toolsContainer",children:[u&&o.jsx(Xt,{projection:s}),f&&o.jsx(Rt,{locale:V,valueBy:"RENDERED_TILES"}),v&&o.jsx(Jt,{locale:V}),b&&o.jsx(Pi,{locale:V})]}),B&&o.jsx(pi,{})]}),document.querySelector(".cesium-viewer")),[C,V,t,s,W,u,v,k,F]);return o.jsx(ve.Viewer,{className:"viewer",full:!0,ref:n,...N,children:o.jsxs(ki,{value:t,children:[o.jsx(Ei,{title:(re=e.legends)==null?void 0:re.title,isOpen:k,toggleSidebar:()=>A(!k),noLegendsText:(de=e.legends)==null?void 0:de.emptyText,legends:((De=e.legends)==null?void 0:De.legendsList)??a,actionsTexts:(qe=e.legends)==null?void 0:qe.actionsTexts}),e.children,ce(),e.imageryContextMenu&&S&&E&&O&&c.cloneElement(e.imageryContextMenu,{data:(je=t==null?void 0:t.layersManager)==null?void 0:je.findLayerByPOI(E.x,E.y,!1),position:{x:E.x,y:E.y},coordinates:O,style:J(E.x,E.y,((Ke=e.imageryContextMenuSize)==null?void 0:Ke.width)??an,((Ye=e.imageryContextMenuSize)==null?void 0:Ye.height)??sn,((Ie=e.imageryContextMenuSize)==null?void 0:Ie.dynamicHeightIncrement)??Oi),size:e.imageryContextMenuSize??{height:sn,width:an},handleClose:()=>{y(!S)},contextEvt:L.current})]})})},xi=0,Bi=e=>{const n=le();return o.jsx(ve.Cesium3DTileset,{...e,onReady:t=>{e.isZoomTo===!0&&n.zoomTo(t);const r=n.scene;r.globe.depthTestAgainstTerrain=!0;const s=p.Cartographic.fromCartesian(t.boundingSphere.center),i=e.heightFromGround??xi;if(i){const u=p.Cartesian3.fromRadians(s.longitude,s.latitude,s.height),h=p.Cartesian3.fromRadians(s.longitude,s.latitude,s.height+i),f=p.Cartesian3.subtract(h,u,new p.Cartesian3);t.modelMatrix=p.Matrix4.fromTranslation(f)}}})},$e=180,cn=.001,dn=e=>Math.abs(e)/e,un=e=>{$e-Math.abs(e[0])<cn&&(e[0]=dn(e[0])*($e-1)),$e/2-Math.abs(e[1])<cn&&(e[1]=dn(e[1])*($e/2-1))},hn=e=>{switch(e.type){case"LineString":e.coordinates.forEach(n=>{un(n)});break;case"Polygon":e.coordinates.forEach(n=>{n.forEach(t=>{un(t)})});break}},Fi=e=>{const{data:n,...t}=e,r=q.cloneDeep(n);return r&&(typeof r.features<"u"?r.features.forEach(s=>{hn(s.geometry)}):hn(r)),o.jsx(ve.GeoJsonDataSource,{data:r,...t})},Pe=e=>{const{meta:n,...t}=e,r=le();return c.useLayoutEffect(()=>{var s;(s=r.layersManager)==null||s.addMetaToLayer(n,n.searchLayerPredicate)},[n,r]),o.jsx(ve.ImageryLayer,{...t})},Vi=e=>{const{options:n,...t}=e,r=le(),s=r.shouldOptimizedTileRequests?new nn(n,r):new p.WebMapServiceImageryProvider(n);return o.jsx(Pe,{...t,imageryProvider:s})},Gi=e=>{const{options:n,...t}=e,r=le(),s=r.shouldOptimizedTileRequests?new rn(n,r):new p.WebMapTileServiceImageryProvider(n);return o.jsx(Pe,{...t,imageryProvider:s})},Hi=e=>{const{options:n,...t}=e,r=le(),s=r.shouldOptimizedTileRequests?new tn(n,r):new p.UrlTemplateImageryProvider(n);return o.jsx(Pe,{...t,imageryProvider:s})},Wi=e=>{const{options:n,...t}=e;return o.jsx(Pe,{...t,imageryProvider:new p.OpenStreetMapImageryProvider(n)})},zi=e=>{const{options:n,meta:t,visualizationHandler:r}=e,{url:s,featureType:i,style:u,pageSize:h,zoomLevel:f,maxCacheSize:m,keyField:v}=n,{color:M,hover:b}=u,T=le(),G=c.useRef(new Map),z=c.useRef(new Set),Z=c.useRef(0),[$,X]=c.useState(t),Y=c.useMemo(()=>p.Color.fromCssColorString(M??"#01FF1F").withAlpha(.5),[M]),V=c.useMemo(()=>p.Color.fromCssColorString(M??"#01FF1F").withAlpha(.2),[M]),j=c.useMemo(()=>p.Color.fromCssColorString(b??"#24AEE9").withAlpha(.5),[b]),H=c.useMemo(()=>`wfs_${i}_${yt.v4()}`,[i]),W=new p.GeoJsonDataSource(H),te=_=>{const I=[],P=t.featureStructure;if(P&&P.fields)for(const N of P.fields){const{fieldName:J,aliasFieldName:se}=N,ce=se,re=_[J.toLowerCase()]??"N/A";I.push(`
|
|
1
|
+
(function(d,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("react/jsx-runtime"),require("react"),require("date-fns"),require("date-fns/locale"),require("@material-ui/pickers"),require("@date-io/date-fns"),require("@material-ui/core/styles"),require("@material-ui/core"),require("@map-colonies/react-core"),require("@material-ui/core/useMediaQuery"),require("react-datepicker"),require("date-fns/locale/he"),require("moment"),require("@turf/rewind"),require("ol"),require("ol/ol.css"),require("ol/coordinate"),require("ol/control"),require("ol/control/MousePosition"),require("ol/proj"),require("ol/layer"),require("ol/source"),require("ol/format"),require("ol/interaction"),require("ol/interaction/Draw"),require("ol/layer/VectorTile"),require("ol/style"),require("ol/tilegrid/WMTS"),require("ol/extent"),require("ol/source/TileWMS"),require("ol/source/XYZ"),require("ol/source/VectorTile"),require("ol-ext/legend/Legend"),require("ol-ext/control/Legend"),require("ol-ext/dist/ol-ext.css"),require("@material-ui/core/TableHead"),require("@material-ui/core/utils"),require("@material-ui/core/CssBaseline"),require("@material-ui/core/ScopedCssBaseline"),require("react-dom"),require("resium"),require("cesium"),require("lodash"),require("@turf/boolean-point-in-polygon"),require("@turf/bbox-polygon"),require("@turf/helpers"),require("@turf/point-to-polygon-distance"),require("@cmcleese/cesium-navigation"),require("@cmcleese/cesium-navigation/dist/index.css"),require("@map-colonies/react-core/dist/linear-progress/styles"),require("uuid"),require("p-map"),require("@turf/bbox"),require("textarea-caret"),require("get-input-selection"),require("chonky"),require("chonky-icon-fontawesome"),require("filesize"),require("react-select")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","date-fns","date-fns/locale","@material-ui/pickers","@date-io/date-fns","@material-ui/core/styles","@material-ui/core","@map-colonies/react-core","@material-ui/core/useMediaQuery","react-datepicker","date-fns/locale/he","moment","@turf/rewind","ol","ol/ol.css","ol/coordinate","ol/control","ol/control/MousePosition","ol/proj","ol/layer","ol/source","ol/format","ol/interaction","ol/interaction/Draw","ol/layer/VectorTile","ol/style","ol/tilegrid/WMTS","ol/extent","ol/source/TileWMS","ol/source/XYZ","ol/source/VectorTile","ol-ext/legend/Legend","ol-ext/control/Legend","ol-ext/dist/ol-ext.css","@material-ui/core/TableHead","@material-ui/core/utils","@material-ui/core/CssBaseline","@material-ui/core/ScopedCssBaseline","react-dom","resium","cesium","lodash","@turf/boolean-point-in-polygon","@turf/bbox-polygon","@turf/helpers","@turf/point-to-polygon-distance","@cmcleese/cesium-navigation","@cmcleese/cesium-navigation/dist/index.css","@map-colonies/react-core/dist/linear-progress/styles","uuid","p-map","@turf/bbox","textarea-caret","get-input-selection","chonky","chonky-icon-fontawesome","filesize","react-select"],o):(d=typeof globalThis<"u"?globalThis:d||self,o(d.reactComponents={},d.jsxRuntime,d.React,d.dateFns,d.locale,d.pickers,d.DateFnsUtils,d.styles,d.core,d.reactCore,d.useMediaQuery,d.DatePicker,d.datePickerHebrewLocale,d.moment,d.rewind,d.ol,null,d.coordinate,d.control,d.MousePosition,d.proj,d.layer,d.source,d.format,d.interaction,d.Draw,d.VectorTile,d.style,d.WMTSTileGrid,d.extent,d.OlTileWMS,d.OlXYZ,d.VectorTileSource,d.OlExtLegend,d.OlExtLegendCtrl,null,d.TableHead,d.utils,d.CssBaseline,d.ScopedCssBaseline,d.ReactDOM,d.resium,d.Cesium,d.lodash,d.booleanPointInPolygon,d.bboxPolygon,d.turf,d.pointToPolygonDistance,d.viewerCesiumNavigationMixin,null,null,d.uuid,d.pMap,d.bbox,d.getCaretCoordinates,d.getInputSelection,d.chonky,d.chonkyIconFontawesome,d.filesize,d.Select))})(this,function(d,o,c,me,Ae,Le,at,Se,Q,U,bn,lt,Mn,be,_n,ct,wo,dt,Ze,Xe,ut,ht,Je,Qe,Pn,Dn,In,ke,On,gt,An,kn,Nn,pt,xn,Co,Bn,ft,Fn,Vn,Gn,ve,p,q,Hn,Re,mt,Wn,zn,Lo,bo,yt,et,vt,$n,Et,K,Un,qn,St){"use strict";var So=Object.defineProperty;var To=(d,o,c)=>o in d?So(d,o,{enumerable:!0,configurable:!0,writable:!0,value:c}):d[o]=c;var ne=(d,o,c)=>(To(d,typeof o!="symbol"?o+"":o,c),c);function tt(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const Tt=tt(c),w=tt(p),wt=tt(mt);var he=(e=>(e.BOX="BOX",e.POLYGON="POLYGON",e.UNKNOWN="UNKNOWN",e))(he||{}),fe=(e=>(e.HE="he",e.EN="en",e.RU="ru",e))(fe||{}),Ne=(e=>(e.TOP_RIGHT="TOP_RIGHT",e.BOTTOM_LEFT="BOTTOM_LEFT",e))(Ne||{});const ie={DATE_PICKER:{dateFormat:"dd/MM/yyyy",local:{setText:"set",placeHolderText:"Enter the Date",calendarLocale:fe.EN},disableFuture:!0,showTime:!1,variant:"inline"},DATE_RANGE_PICKER:{dateFormat:"dd/MM/yyyy HH:mm",controlsLayout:"row",local:{setText:"set",startPlaceHolderText:"Start of time",endPlaceHolderText:"End of time",calendarLocale:fe.EN},renderAsButton:!0,offset:0,disableFuture:!0}},oe=e=>{const{children:n,...t}=e;return o.jsx(Q.Box,{...t,children:n})},xe=e=>{const n=e.type==="dark";return c.useMemo(()=>Ct(e,n),[n,e])},Ct=(e,n=!1)=>Se.createTheme({palette:{type:n?"dark":"light",primary:{main:e.primary},secondary:{main:e.secondary},error:{main:e.error},background:{default:e.surface,paper:e.background},text:{primary:n?e.textPrimaryOnDark:e.textPrimaryOnLight,secondary:n?e.textSecondaryOnDark:e.textSecondaryOnLight}}}),Mo="",jn=2,Kn=.5,Yn=Se.makeStyles(e=>Se.createStyles({container:{padding:e.spacing(jn),alignItems:"center"},setButton:{marginTop:e.spacing(1)},margin:{marginLeft:e.spacing(Kn)}})),Lt=e=>{var Y,V,j,H;const n=Yn(),t=U.useTheme(),r=xe(t),[s,i]=c.useState(null),[u,h]=c.useState(null),[f,m]=c.useState(ie.DATE_RANGE_PICKER.dateFormat),v=e.controlsLayout??ie.DATE_RANGE_PICKER.controlsLayout,M=e.disableFuture??ie.DATE_RANGE_PICKER.disableFuture,b=((Y=e.local)==null?void 0:Y.startPlaceHolderText)??ie.DATE_RANGE_PICKER.local.startPlaceHolderText,T=((V=e.local)==null?void 0:V.endPlaceHolderText)??ie.DATE_RANGE_PICKER.local.endPlaceHolderText,G=((j=e.local)==null?void 0:j.setText)??ie.DATE_RANGE_PICKER.local.setText,Z=(((H=e.local)==null?void 0:H.calendarLocale)??ie.DATE_RANGE_PICKER.local.calendarLocale)===fe.HE?Ae.he:Ae.enUS;c.useEffect(()=>{i(e.from??null)},[e.from]),c.useEffect(()=>{h(e.to??null)},[e.to]),c.useEffect(()=>{m(e.dateFormat??ie.DATE_RANGE_PICKER.dateFormat)},[e.dateFormat]);const $=Boolean(me.isValid(s)&&!u||me.isValid(u)&&!s||s&&u&&me.isValid(s)&&me.isValid(u)&&me.isBefore(s,u)),X=()=>{e.onChange({from:s&&me.isValid(s)?s:void 0,to:u&&me.isValid(u)?u:void 0})};return o.jsx(Q.ThemeProvider,{theme:r,children:o.jsx(oe,{className:`${n.container} drpContainer`,display:"flex",flexDirection:v,width:v==="column"?e.contentWidth:"unset",children:o.jsxs(Le.MuiPickersUtilsProvider,{utils:at,locale:Z,children:[o.jsx(Le.KeyboardDateTimePicker,{variant:"inline",placeholder:b,onChange:W=>i(W),value:s,disableFuture:M,format:f,maxDate:e.maxDate,minDate:e.minDate}),o.jsx(Le.KeyboardDateTimePicker,{variant:"inline",placeholder:T,className:n.margin,onChange:W=>h(W),value:u,disableFuture:M,format:f,maxDate:e.maxDate,minDate:e.minDate}),o.jsx(U.ThemeProvider,{options:t,children:o.jsx(U.Button,{className:`${n.setButton} ${n.margin}`,raised:!0,onClick:X,disabled:!$,children:G})})]})})})},bt=e=>{const{children:n,...t}=e;return o.jsx(Q.Popover,{...t,children:n})},_o="",Zn=e=>{var V,j;const[n,t]=c.useState(null),[r,s]=c.useState(null),[i,u]=c.useState(ie.DATE_RANGE_PICKER.dateFormat),[h,f]=c.useState(null),m=H=>{f(H.currentTarget)},v=H=>{H.currentTarget.tagName==="I"?f(H.currentTarget.previousElementSibling):f(H.currentTarget)},M=()=>{f(null)},b=Boolean(h),T=e.controlsLayout??"column";c.useEffect(()=>{t(e.from??null)},[e.from]),c.useEffect(()=>{s(e.to??null)},[e.to]),c.useEffect(()=>{u(e.dateFormat??ie.DATE_RANGE_PICKER.dateFormat)},[e.dateFormat]);const G=((V=e.local)==null?void 0:V.startPlaceHolderText)??ie.DATE_RANGE_PICKER.local.startPlaceHolderText,z=((j=e.local)==null?void 0:j.endPlaceHolderText)??ie.DATE_RANGE_PICKER.local.endPlaceHolderText,Z=e.renderAsButton===void 0?ie.DATE_RANGE_PICKER.renderAsButton:e.renderAsButton,$=e.offset===void 0?ie.DATE_RANGE_PICKER.offset:e.offset,X=e.disableFuture===void 0?ie.DATE_RANGE_PICKER.disableFuture:e.disableFuture,Y=c.useMemo(()=>`${n?me.format(n,i):G} - ${r?me.format(r,i):z}`,[n,r,i,G,z]);return o.jsxs(o.Fragment,{children:[Z?o.jsx(U.Button,{style:{width:e.width},raised:!0,onClick:m,className:"drpOpener",children:Y}):o.jsx(U.TextField,{className:"drpOpener",readOnly:!0,style:{width:e.width},value:Y,onClick:v,trailingIcon:{icon:"date_range",tabIndex:0,onClick:v}}),o.jsx(bt,{open:b,anchorEl:h,onClose:M,anchorOrigin:{vertical:"bottom",horizontal:"left"},keepMounted:!0,children:o.jsx(Lt,{controlsLayout:T,contentWidth:((h==null?void 0:h.clientWidth)??0)-$,dateFormat:i,disableFuture:X,minDate:e.minDate,maxDate:e.maxDate,local:e.local,from:n??void 0,to:r??void 0,onChange:({from:H,to:W})=>{t(H??null),s(W??null),e.onChange({from:H,to:W}),M()}})})]})},Be=e=>typeof e<"u"&&e!==null&&"startDate"in e&&"endDate"in e,Xn=({endDate:e,startDate:n,setEndDate:t=()=>{},setStartDate:r=()=>{},endTimeInputClassName:s="",endTimeLabel:i="",endTimeWrapperClassName:u="",timeRangeInputsWrapperClassName:h="",startTimeInputClassName:f="",startTimeLabel:m="",startTimeWrapperClassName:v=""})=>o.jsxs("div",{className:`timeRangeWrapper ${h}`,children:[o.jsx("div",{className:`startTimeWrapper ${v}`,children:o.jsx(U.TextField,{label:m,disabled:n===null,className:`timeRangeInput ${f}`,name:"start-time",type:"time",value:be(n).format("HH:mm"),onChange:M=>{const b=be(n),T=be(M.currentTarget.value,"HH:mm"),G=b.set({hours:T.get("hours"),minutes:T.get("minutes")});r(G.toDate())}})}),o.jsx("div",{className:`endTimeWrapper ${u}`,children:o.jsx(U.TextField,{label:i,disabled:e===null,className:`timeRangeInput ${s}`,name:"end-time",type:"time",value:be(e).format("HH:mm"),onChange:M=>{const b=be(e),T=be(M.currentTarget.value,"HH:mm"),G=b.set({hours:T.get("hours"),minutes:T.get("minutes")});t(G.toDate())}})})]}),Jn=c.forwardRef(({value:e,onClick:n,onInputClick:t,...r},s)=>o.jsx(U.TextField,{...r,className:"dateRangeCustomInput",readOnly:!0,onClick:i=>{n==null||n(i),t==null||t()},ref:s,value:e})),Qn=({setStartDate:e=()=>{},setEndDate:n=()=>{},shortcuts:t,dateRange:r,onShortcut:s})=>{const[i,u]=c.useState(),h=c.useMemo(()=>t.map(f=>f instanceof Function?f():f),[t]);return c.useEffect(()=>{for(const f of h){const m=r.startDate&&r.endDate&&me.isSameDay(f.startDate,r.startDate)&&me.isSameDay(f.endDate,r.endDate);i?f.id===i&&(m||u(void 0)):m&&u(f.id)}},[r,i,h]),o.jsx("div",{className:"shortcutsContainer",children:h.map((f,m)=>{const v=()=>{e(f.startDate),n(f.endDate)};return o.jsx(U.Button,{type:"button",className:`shortcut ${i===f.id?"selected":""}`,onClick:M=>{v(),s==null||s({startDate:f.startDate,endDate:f.endDate})},outlined:!0,children:f.label},f.id+m)})})},Rn=c.forwardRef((e,n)=>{const{calendarClassName:t,dayClassName:r,monthClassName:s,selectsRange:i,onChange:u,inputName:h,showMonthYearDropdown:f,withShortcuts:m,locale:v="en"}=e,[M,b]=c.useState(null),[T,G]=c.useState(null),[z,Z]=c.useState(!1),$=i?{startDate:M,endDate:T}:M;c.useEffect(()=>{v==="he"&<.registerLocale("he",Mn)},[v]),c.useEffect(()=>{var V,j;((V=e.startDate)==null?void 0:V.toString())!==(M==null?void 0:M.toString())&&b(e.startDate),((j=e.endDate)==null?void 0:j.toString())!==(T==null?void 0:T.toString())&&G(e.endDate)},[e.startDate,e.endDate,M,T]);const X=c.useMemo(()=>{let V="pickerContainer"+(v==="he"?" pickerContainer-rtl":"");return m&&i&&(V+=" pickerContainer-withShortcuts"),V},[v,m,i]),Y=f?{showMonthDropdown:!0,showYearDropdown:!0,dropdownMode:"select"}:{};return o.jsx("div",{className:X,style:{direction:v==="he"?"rtl":"ltr"},children:o.jsx(lt,{...e,ref:n,onClickOutside:()=>Z(!1),open:z,startDate:Be($)?M:void 0,selected:M,endDate:Be($)?T:void 0,monthsShown:e.monthsShown??2,calendarClassName:`pickerCalendar ${t}`,weekDayClassName:V=>`pickerWeek ${(r==null?void 0:r(V))??""}`,dayClassName:V=>`pickerDay ${(r==null?void 0:r(V))??""}`,monthClassName:V=>`pickerMonth ${(s==null?void 0:s(V))??""}`,onChange:(V,j)=>{if(Array.isArray(V)){const[H,W]=V;b(H),G(W),u==null||u({startDate:H,endDate:W&&me.endOfDay(W)},j)}else b(V),u==null||u(V,j)},customInput:o.jsx(Jn,{name:h,onInputClick:()=>{Z(!0)}}),showTimeInput:!!(m&&i),timeInputLabel:"",customTimeInput:m&&Be($)&&o.jsx(Qn,{onShortcut:V=>{u==null||u(V),Z(!1)},shortcuts:m,setEndDate:G,setStartDate:b,dateRange:$}),showMonthYearDropdown:void 0,...Y})})}),Po="",er=e=>{const n=U.useTheme(),t=xe(n),{format:r=ie.DATE_PICKER.dateFormat,variant:s=ie.DATE_PICKER.variant,disableFuture:i=ie.DATE_PICKER.disableFuture,local:u,onChange:h,showTime:f=ie.DATE_PICKER.showTime,value:m,...v}=e,{placeHolderText:M=ie.DATE_PICKER.local.placeHolderText,calendarLocale:b}=u??{placeHolderText:ie.DATE_PICKER.local.placeHolderText,calendarLocale:fe.EN},T=b===fe.HE?Ae.he:Ae.enUS,G=z=>{h(z)};return o.jsx(Q.ThemeProvider,{theme:t,children:o.jsxs(Le.MuiPickersUtilsProvider,{utils:at,locale:T,children:[f&&o.jsx(Le.KeyboardDateTimePicker,{variant:s,placeholder:M,onChange:G,value:m,disableFuture:i,format:r,...v}),!f&&o.jsx(Le.KeyboardDatePicker,{variant:s,placeholder:M,onChange:G,value:m,disableFuture:i,format:r,...v})]})})},tr=18,nr=Se.makeStyles(e=>Se.createStyles({drawingButton:{width:e.spacing(tr)},fullWidth:{width:"100%",marginTop:"36px"}})),rr=e=>{const n=nr(),[t,r]=c.useState(null),{isSelectionEnabled:s,onCancelDraw:i,onStartDraw:u,onReset:h}=e,f=v=>{r(v.currentTarget)},m=()=>{r(null)};return s?o.jsx(U.Tooltip,{content:"Cancel the ongoing draw",align:"bottomLeft",children:o.jsx(U.Button,{className:n.drawingButton,raised:!0,onClick:i,children:"Cancel Draw"})}):o.jsxs(oe,{position:"relative",children:[o.jsx(U.Tooltip,{content:"draw an Area of interest to limit the search",align:"bottomLeft",children:o.jsx(U.Button,{className:n.drawingButton,raised:!0,onClick:f,children:"Draw AOI"})}),o.jsxs(U.Menu,{className:n.fullWidth,open:Boolean(t),onClose:m,children:[o.jsx(U.MenuItem,{onClick:()=>{u(he.POLYGON),m()},children:"Polygon"}),o.jsx(U.MenuItem,{onClick:()=>{u(he.BOX),m()},children:"Box"}),o.jsx(U.MenuItem,{onClick:()=>{h(),m()},children:"Clear"})]})]})},Do="";var ye=(e=>(e.WGS84="EPSG:4326",e.WEB_MERCATOR="EPSG:3857",e))(ye||{});const Fe=5,Ve=2,Mt=c.createContext(null),ir=Mt.Provider,_t=35,Pt=32,or=10,sr=e=>e!==void 0&&e!==ye.WGS84?ut.transform([_t,Pt],ye.WGS84,e):[_t,Pt],ar=e=>{switch(e){case ye.WEB_MERCATOR:return n=>dt.format(n,"Mercator: {y}m, {x}m",Ve);case ye.WGS84:return n=>dt.format(n,"WGS84: {y}°N {x}°E",Fe);default:return n=>""}},Ce=()=>{const e=c.useContext(Mt);if(e===null)throw new Error("map context is null, please check the provider");return e},Dt=e=>{const n=c.useRef(null),{allowFullScreen:t,showMousePosition:r,projection:s}=e,[i]=c.useState(new ct.Map({view:new ct.View({projection:s??ye.WGS84}),controls:Ze.defaults()}));c.useEffect(()=>{i.getView().setCenter(e.center??sr(e.projection))},[i,e.center,e.projection]),c.useEffect(()=>{i.getView().setZoom(e.zoom??or)},[i,e.zoom,e.projection]);const u=(h,f)=>{f.getControls().forEach(v=>{v instanceof h&&f.removeControl(v)})};return c.useEffect(()=>{i.setTarget(n.current),t!==void 0&&t?i.addControl(new Ze.FullScreen):u(Ze.FullScreen,i)},[i,t]),c.useEffect(()=>{r!==void 0&&r?(u(Xe,i),i.addControl(new Xe({coordinateFormat:ar(s??ye.WGS84),projection:s??ye.WGS84,undefinedHTML:" "}))):u(Xe,i)},[i,r,s]),o.jsxs(ir,{value:i,children:[o.jsx("div",{className:"map",ref:n}),e.children]})},It=c.createContext(null),lr=It.Provider,_e=()=>{const e=c.useContext(It);if(e===null)throw new Error("tile layer context is null, please check the provider");return e},Ot=({options:e,children:n})=>{const t=Ce(),[r]=c.useState(new ht.Tile(e));return c.useEffect(()=>(t.addLayer(r),()=>{t.removeLayer(r)}),[t,r]),o.jsx(lr,{value:r,children:n})},At=c.createContext(null),cr=At.Provider,kt=()=>{const e=c.useContext(At);if(e===null)throw new Error("vector layer context is null, please check the provider");return e},Nt=({children:e})=>{const n=Ce(),[t]=c.useState(new ht.Vector);return c.useEffect(()=>(n.addLayer(t),()=>{n.removeLayer(t)}),[n,t]),o.jsx(cr,{value:t,children:e})},xt=c.createContext(null),dr=xt.Provider,Bt=()=>{const e=c.useContext(xt);if(e===null)throw new Error("vector source context is null, please check the provider");return e},Ft=({children:e})=>{const n=kt(),[t]=c.useState(new Je.Vector);return c.useEffect(()=>{n.setSource(t)},[t,n]),o.jsx(dr,{value:t,children:e})},Vt=({geometry:e,fitOptions:n,fit:t,featureStyle:r})=>{const s=Bt(),i=Ce();return c.useLayoutEffect(()=>{const h=new Qe.GeoJSON().readFeature(e);return t&&s.on("addfeature",function(){i.getView().fit(s.getExtent(),n)}),r&&h.setStyle(r),s.addFeature(h),()=>{s.removeFeature(h)}},[e,s,t]),null},Gt=e=>{const n=_e();return c.useEffect(()=>{n.setSource(new Je.OSM)},[n]),null},Ht=({drawType:e,onPolygonSelected:n})=>{const t=Ce();return c.useEffect(()=>{const r={type:"Circle"};switch(e){case he.BOX:r.geometryFunction=Dn.createBox();break;case he.POLYGON:r.type="Polygon";break;default:return}const s=new Pn.Draw(r);t.addInteraction(s);const i=u=>{const f=new Qe.GeoJSON().writeGeometryObject(u.feature.getGeometry());n==null||n(f)};return s.on("drawend",i),()=>{s.un("drawend",i),t.removeInteraction(s)}},[n,e,t]),null},Io="",ur=e=>{const n=t=>{const r=_n(t);e.onPolygonSelection(r)};return o.jsxs(Dt,{allowFullScreen:!0,showMousePosition:!0,children:[o.jsx(Ot,{children:o.jsx(Gt,{})}),e.selectionPolygon&&o.jsx(Nt,{children:o.jsx(Ft,{children:o.jsx(Vt,{geometry:e.selectionPolygon})})}),e.children,e.drawType!==void 0&&o.jsx(Ht,{drawType:e.drawType,onPolygonSelected:n})]})},nt=1.5,hr=80,gr=Se.makeStyles(e=>Se.createStyles({map:{height:"100%",width:"100%",position:"absolute"},absolute:{position:"absolute",zIndex:1e3,left:e.spacing(nt),top:e.spacing(nt)},contentContainer:{marginTop:e.spacing(nt),width:e.spacing(hr)},filtersContainer:{display:"flex",padding:e.spacing(1)},filtersMargin:{marginLeft:e.spacing(1)}})),pr=e=>{var f;const[n,t]=c.useState(),[r,s]=c.useState(),i=gr(),u=m=>{s(m),t(void 0),e.handlePolygonSelected(m)},h=()=>{s(void 0),e.handlePolygonReset()};return o.jsxs("div",{className:i.map,children:[o.jsxs("div",{className:`${i.absolute}`,children:[o.jsxs(Q.Paper,{className:i.filtersContainer,children:[o.jsx(rr,{onCancelDraw:()=>t(void 0),onReset:h,onStartDraw:t,isSelectionEnabled:n!==void 0}),(f=e.filters)==null?void 0:f.map((m,v)=>o.jsx("div",{className:i.filtersMargin,children:m},v))]}),o.jsx(Q.Paper,{color:"red",className:`${i.contentContainer}`,children:e.children})]}),o.jsx(ur,{children:e.mapContent,onPolygonSelection:u,drawType:n,selectionPolygon:r})]})},Wt=new ke.Fill({color:"rgba(255,255,255,0.4)"}),zt=new ke.Stroke({color:"#3399CC",width:1.25}),$t=[new ke.Style({image:new ke.Circle({fill:Wt,stroke:zt,radius:5}),fill:Wt,stroke:zt})],Ut=c.createContext(null),fr=Ut.Provider,qt=()=>{const e=c.useContext(Ut);if(e===null)throw new Error("vector tile layer context is null, please check the provider");return e},mr=({children:e,options:n,style:t})=>{const r=Ce(),[s]=c.useState(new In({...n,style:t||$t}));return c.useEffect(()=>(r.addLayer(s),()=>{r.removeLayer(s)}),[r,s]),c.useEffect(()=>{s.setStyle(t||$t)},[s,t]),o.jsx(fr,{value:s,children:e})},rt=20,yr=256,vr=2,Er=2,Sr="REST",Tr=e=>{const n=ut.get(e.projection),t=n.getExtent(),r=new Array(rt),s=new Array(rt),i=gt.getWidth(t)/yr,u=e.heightWidthRatio!==void 0?e.heightWidthRatio:Er,h=e.requestEncoding!==void 0?e.requestEncoding:Sr;for(let m=0;m<rt;++m)r[m]=i/Math.pow(vr,m)/u,s[m]=m.toString();return{attributions:e.attributions,url:e.url,layer:e.layer,matrixSet:e.matrixSet,format:e.format,projection:n,tileGrid:new On({origin:gt.getTopLeft(t),resolutions:r,matrixIds:s}),style:e.style,requestEncoding:h,wrapX:e.wrapX!==void 0?e.wrapX:!0}},wr=e=>{const n=_e(),{options:t}=e;return c.useEffect(()=>{n.setSource(new Je.WMTS(t))},[n,t]),null},Cr=e=>{const{attributions:n,url:t,params:r,serverType:s,transition:i}=e;return{attributions:n,url:t,params:r,serverType:s,transition:i}},Lr=e=>{const n=_e(),{options:t}=e;return c.useEffect(()=>{n.setSource(new An(t))},[n,t]),null},br=e=>{const{attributions:n,url:t}=e;return{attributions:n,url:t}},Mr=e=>{const n=_e(),{options:t}=e;return c.useEffect(()=>{n.setSource(new kn(t))},[n,t]),null},_r=c.createContext(null),Pr=()=>{const e=c.useContext(_r);if(e===null)throw new Error("vector tile source context is null, please check the provider");return e},Dr=e=>{const{url:n}=e;return{url:n,format:new Qe.MVT}},Ir=({children:e,options:n})=>{const t=qt();return c.useEffect(()=>{t.setSource(new Nn(n))},[n,t]),null},Or=({legendItems:e,title:n,isCollapsed:t})=>{const r=Ce();return c.useEffect(()=>{const s=new pt({title:n??"",margin:5,maxWidth:300}),i=new xn({legend:s,collapsed:t===void 0?!0:t});r.addControl(i);const u=new pt({margin:4});return e.forEach(h=>{u.addItem({title:h.title,style:h.style,typeGeom:"Polygon"})}),s.addItem(u),()=>{r.removeControl(i)}},[r,e,n,t]),o.jsx(o.Fragment,{})};function Ar(e){const{headCells:n,order:t,orderBy:r,onRequestSort:s,isCollapseable:i}=e,u=h=>f=>{s(f,h)};return o.jsx(Bn,{children:o.jsxs(Q.TableRow,{children:[i&&o.jsx(Q.TableCell,{}),n.map(h=>o.jsx(Q.TableCell,{align:h.numeric?"right":"left",padding:h.disablePadding?"none":"default",sortDirection:r===h.id?t:!1,children:o.jsx(Q.TableSortLabel,{active:r===h.id,direction:r===h.id?t:"asc",onClick:u(h.id),children:h.label})},h.id))]})})}const kr=ft.createSvgIcon(Tt.createElement("path",{d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"}),"KeyboardArrowDown"),Nr=ft.createSvgIcon(Tt.createElement("path",{d:"M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"}),"KeyboardArrowUp");function xr(e){const{cellsMetadata:n,isRowSelected:t,item:r,onRowSelected:s,rowIndex:i,isCollapseable:u,collapsedElement:h}=e,[f,m]=c.useState(!1),v=n.length,M=()=>{s==null||s(i)};return o.jsxs(o.Fragment,{children:[o.jsxs(Q.TableRow,{hover:!0,selected:t,onClick:M,children:[u&&o.jsx(Q.TableCell,{padding:"checkbox",children:o.jsx(Q.IconButton,{"aria-label":"expand row",size:"small",onClick:b=>{b.stopPropagation(),m(!f)},children:f?o.jsx(Nr,{}):o.jsx(kr,{})})}),n.map(b=>o.jsx(Q.TableCell,{align:b.numeric?"right":"left",padding:b.disablePadding?"none":"default",children:b.transform?b.transform(r[b.id]):r[b.id]},b.id+i.toString()))]}),u&&o.jsx(Q.TableRow,{children:o.jsx(Q.TableCell,{style:{paddingBottom:0,paddingTop:0},colSpan:v+1,children:o.jsx(Q.Collapse,{in:f,unmountOnExit:!0,timeout:"auto",children:h==null?void 0:h(r)})})})]})}function Br(e){const[n,t]=c.useState(""),[r,s]=c.useState("asc"),{cellsMetadata:i,items:u,onRequestSort:h,onRowSelected:f,isCollapseable:m,collapsedElement:v,isDense:M,page:b,rowsPerPage:T,count:G,handleChangePage:z,handleChangeRowsPerPage:Z}=e,$=(X,Y)=>{const V=n===Y&&r==="asc";s(V?"desc":"asc"),t(Y),h(Y,V?"desc":"asc")};return o.jsxs(Q.TableContainer,{component:Q.Paper,children:[o.jsxs(Q.Table,{size:M?"small":"medium",children:[o.jsx(Ar,{headCells:i,onRequestSort:$,order:r,orderBy:n,isCollapseable:m}),o.jsxs(Q.TableBody,{children:[u.map((X,Y)=>o.jsx(xr,{item:X,rowIndex:Y,isCollapseable:m,cellsMetadata:i,collapsedElement:v,isRowSelected:!1,onRowSelected:f},Y)),(u.length===0||T>u.length)&&o.jsx(Q.TableRow,{style:{height:(M?33:53)*(T-u.length)},children:o.jsx(Q.TableCell,{colSpan:m?i.length+1:i.length,children:u.length===0&&o.jsx(Q.Typography,{align:"center",children:"No results :("})})})]})]}),o.jsx(Q.TablePagination,{rowsPerPage:T,rowsPerPageOptions:[5,10],component:"div",count:G,page:b,onPageChange:z,onRowsPerPageChange:Z})]})}const Fr=e=>{const{children:n,...t}=e;return o.jsx(Fn,{...t,children:n})},Vr=e=>{const{children:n,...t}=e;return o.jsx(Vn,{...t,children:n})},jt=e=>e*Math.PI/180,Ge=e=>e*(180/Math.PI),Gr=e=>.05*(5916575505e-1/Math.pow(2,e-1)/2)*(Math.cos(jt(85.362/2))/Math.sin(jt(85.362/2)));class Hr extends p.PolylineDashMaterialProperty{}class Wr extends p.ConstantProperty{}class zr extends p.ConstantPositionProperty{}class $r extends p.Cartesian2{}class Ur extends p.Cartesian3{}class Kt extends p.Cartographic{}class qr extends p.BoundingSphere{}class jr extends p.Ellipsoid{}class Kr extends p.GeographicTilingScheme{}class Yr extends p.Rectangle{}class Zr extends p.Resource{}class Xr extends p.EllipsoidTerrainProvider{}class Jr extends p.CesiumTerrainProvider{}class Qr extends p.PolylineGraphics{}class Rr extends p.JulianDate{}class ei extends p.PositionProperty{}class ti extends p.BillboardGraphics{}const ni=p.VerticalOrigin,ri=p.HorizontalOrigin,ii=p.LabelStyle,oi=p.HeightReference,Yt=(e,n,t)=>{let r;if(e.scene.mode!==p.SceneMode.SCENE2D)r=e.scene.pickPosition(new p.Cartesian2(n,t));else{const s=e.scene.globe.ellipsoid;r=e.camera.pickEllipsoid(new p.Cartesian2(n,t),s)}return p.Cartographic.fromCartesian(r)},si=(e,n,t)=>{const r=Yt(e,n,t);return{type:"Feature",properties:{},geometry:{type:"Point",coordinates:[p.Math.toDegrees(r.longitude),p.Math.toDegrees(r.latitude)]}}},Zt=(e,n,t)=>{try{const r=Yt(e,n,t);return{longitude:p.Math.toDegrees(r.longitude),latitude:p.Math.toDegrees(r.latitude)}}catch{return}},Oo="",Xt=e=>{const n=le(),t=c.useRef(null),[r,s]=c.useState({x:0,y:0});return c.useEffect(()=>{n.screenSpaceEventHandler.setInputAction(i=>{if(i!=null&&i.endPosition){const u={...i.endPosition};u.x=Math.ceil(u.x),u.y=Math.ceil(u.y),s(u)}},p.ScreenSpaceEventType.MOUSE_MOVE)},[t,n]),c.useEffect(()=>{const i=n.scene.globe.ellipsoid;if(r){const u=Zt(n,r.x,r.y);if(u){const h=new Kt(u.longitude,u.latitude);if(t.current){let f="";switch(e.projection){case ye.WEB_MERCATOR:{const v=new p.WebMercatorProjection(i).project(h);f=`Mercator: ${v.y.toFixed(Ve)}m, ${v.x.toFixed(Ve)}m`,t.current.style.width="220px";break}case ye.WGS84:{const m=h.longitude.toFixed(Fe);f=`WGS84: ${h.latitude.toFixed(Fe)}°N ${m}°E`,t.current.style.width="200px";break}}t.current.innerHTML=f}}}},[r,t,n,e.projection]),o.jsx("div",{className:"trackerPosition",ref:t})},Ao="",it=[1,2,3,5,10,20,30,50,100,200,300,500,1e3,2e3,3e3,5e3,1e4,2e4,3e4,5e4,1e5,2e5,3e5,5e5,1e6,2e6,3e6,5e6,1e7,2e7,3e7,5e7],ai=(e,n,t,r)=>{const s=q.get(r,"METERS_UNIT")??"m",i=q.get(r,"KILOMETERS_UNIT")??"km",u={barWidth:void 0,distanceLabel:void 0,lastLegendUpdate:n.lastLegendUpdate},h=new p.EllipsoidGeodesic,f=new Date().getTime();if(f<u.lastLegendUpdate+250)return;u.lastLegendUpdate=f;const m=e.scene.canvas.clientWidth,v=e.scene.canvas.clientHeight,M=e.scene.camera.getPickRay(new p.Cartesian2(m/2|0,v-1)),b=e.scene.camera.getPickRay(new p.Cartesian2(1+m/2|0,v-1)),T=e.scene.globe,G=T.pick(M,e.scene),z=T.pick(b,e.scene);if(!G||!z)return;const Z=T.ellipsoid.cartesianToCartographic(G),$=T.ellipsoid.cartesianToCartographic(z);h.setEndPoints(Z,$);const X=h.surfaceDistance,Y=100;let V;for(let j=it.length-1;!q.isNumber(V)&&j>=0;--j)it[j]/X<Y&&(V=it[j]);if(q.isNumber(V)){let j="";V>=1e3?j=`${(V/1e3).toString()} ${i}`:j=`${V.toString()} ${s}`,u.barWidth=V/X|0,u.distanceLabel=j}t(u)},Jt=e=>{const n=le(),[t,r]=c.useState({barWidth:void 0,distanceLabel:void 0,lastLegendUpdate:-1});c.useEffect(()=>{const i=f=>{ai(n,t,r,e.locale)},u=new p.EventHelper,h=f=>{n.scene.globe.tilesLoaded&&(i(new MouseEvent("mouse")),u.removeAll())};return u.add(n.scene.globe.tileLoadProgressEvent,h),n.camera.moveEnd.addEventListener(i),()=>{try{q.get(n,"_cesiumWidget")!=null&&n.camera.moveEnd.removeEventListener(i)}catch(f){console.log('CESIUM camera "moveEnd" remove listener failed',f)}}},[n,e.locale,t]);const s=i=>5+(125-i)/2;return o.jsx("div",{className:"scalePosition",children:q.isNumber(t.barWidth)&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"scale-tracker-label",children:o.jsx("bdi",{children:t.distanceLabel})}),o.jsx("div",{className:"scale-tracker-bar",style:{height:"2px",width:`${t.barWidth.toString()}px`,left:`${s(t.barWidth).toString()}px`}})]})})},ue={MORPHING:p.SceneMode.MORPHING,COLUMBUS_VIEW:p.SceneMode.COLUMBUS_VIEW,SCENE2D:p.SceneMode.SCENE2D,SCENE3D:p.SceneMode.SCENE3D},ko="",Qt=(e,n)=>{const r=q.get(n.scene.globe,"_surface.tileProvider"),s=r._quadtree,i=n.canvas.height,u=q.get(n.camera.frustum,"sseDenominator")??1;for(let h=0;h<=19;h++)if(r.getLevelMaximumGeometricError(h)*i/(e*u)<s.maximumScreenSpaceError)return h;return null},li=(e,n)=>{e=e||10;const t=[];let r=1e5,s=0;for(let i=1e8;i>r;i=i-r){const u=Qt(i,n);if(u===null)break;if(u!==s){let h=i,f=i+r;for(;f-h>e;)i=h+(f-h)/2,Qt(i,n)===u?h=i:f=i;t.push({level:u,height:Math.round(i)}),s=u,t.length>=2&&(r=(t[t.length-2].height-i)/1e3)}}return t},Rt=({locale:e=void 0,valueBy:n="RENDERED_TILES"})=>{const t=le(),[r,s]=c.useState(1),i=li(1,t),u=c.useCallback(()=>{const v=t.camera,M=.5;let b=0;switch(t.scene.mode){case ue.SCENE3D:b=t.scene.mapProjection.ellipsoid.cartesianToCartographic(v.positionWC).height;break;case ue.SCENE2D:b=(v.frustum.right-v.frustum.left)*M;break;case ue.COLUMBUS_VIEW:b=v.position.z;break;default:b=0;break}if(i.length>0){const T=i.reduce((G,z)=>Math.abs(z.height-b)<Math.abs(G.height-b)?z:G);s(T.level),t.currentZoomLevel=T.level}},[t,i]),h=c.useCallback(()=>{let v=0;t.scene.globe._surface.forEachRenderedTile(function(M){v=Math.max(v,M.level)}),s(v),t.currentZoomLevel=v},[t]),m=c.useMemo(()=>({CALCULATION:u,RENDERED_TILES:h}),[u,h])[n];return c.useEffect(()=>{const v=t.scene.globe.tileLoadProgressEvent.addEventListener(function(){t.scene.globe.tilesLoaded&&m()});return t.camera.moveEnd.addEventListener(m),()=>{try{typeof q.get(t,"_cesiumWidget")<"u"&&(t.camera.moveEnd.removeEventListener(m),v())}catch(M){console.log('CESIUM camera "moveEnd"(from zoom tracker) remove listener failed',M)}}},[t,m]),o.jsxs("div",{className:"zoomLevel",children:[o.jsx("div",{className:"zoomLevelValue",children:r}),o.jsx("div",{className:"zoomLevelLabel",children:q.get(e,"ZOOM_LABEL")??"zoom"})]})},No="",ci=-1,di=e=>{const n=le(),[t,r]=c.useState(),{sceneModes:s}=e,i=u=>s.findIndex(h=>h===u)>ci;return c.useEffect(()=>{r(n.scene.mode)},[]),o.jsxs(o.Fragment,{children:[i(ue.SCENE3D)&&o.jsx(U.Icon,{icon:o.jsx("div",{className:`mapViewIcon ${t===ue.SCENE3D?"mapViewCurrent":""}`,children:o.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 64 64",children:o.jsx("path",{d:"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"})})}),onClick:()=>{n.scene.morphTo3D(),r(ue.SCENE3D)}}),i(ue.SCENE2D)&&o.jsx(U.Icon,{icon:o.jsx("div",{className:`mapViewIcon ${t===ue.SCENE2D?"mapViewCurrent":""}`,children:o.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 64 64",children:o.jsx("path",{d:"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"})})}),onClick:()=>{n.scene.morphTo2D(),r(ue.SCENE2D)}}),i(ue.COLUMBUS_VIEW)&&o.jsx(U.Icon,{icon:o.jsx("div",{className:`mapViewIcon ${t===ue.COLUMBUS_VIEW?"mapViewCurrent":""}`,children:o.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 64 64",children:o.jsx("path",{d:"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"})})}),onClick:()=>{n.scene.morphToColumbusView(),r(ue.COLUMBUS_VIEW)}})]})},xo="",ui=Se.makeStyles(e=>Se.createStyles({mapContainer:{width:"60px",height:"60px",border:`${e.palette.background.paper} 2px solid`}})),hi=e=>{const n=le(),{baseMaps:t}=e,[r,s]=c.useState(" "),[i,u]=c.useState(),h=ui();c.useEffect(()=>{const m=t==null?void 0:t.maps.find(v=>v.isCurrent);m&&(u(m),s(m.title!==void 0?m.title:" "))},[t]);const f=m=>{var v,M;if(t){(v=n.layersManager)==null||v.removeBaseMapLayers();const b=t.maps.find(T=>T.id===m);b&&((M=n.layersManager)==null||M.setBaseMapLayers(b),u(b),t.maps.forEach(T=>{T.isCurrent=b===T}))}};return o.jsxs(o.Fragment,{children:[o.jsx("label",{className:"mapLabel",children:r}),o.jsx("ul",{className:"mapSelector",children:t==null?void 0:t.maps.map(m=>o.jsx("li",{className:`mapContainer ${h.mapContainer} ${m===i?"mapContainerSelected":""}`,children:o.jsx("img",{alt:"",className:"mapContainerImg",src:m.thumbnail,onMouseOver:()=>{s(m.title)},onMouseOut:()=>{s((i==null?void 0:i.title)!==void 0?i.title:" ")},onClick:()=>{f(m.id)}})},m.id))})]})},Bo="",ot="ic_settings_24px",gi=e=>{const[n,t]=c.useState(!1),{sceneModes:r,baseMaps:s,locale:i}=e,u=c.useRef(null),h=q.get(i,"MAP_SETTINGS_DIALOG_TITLE")??"Map Settings",f=q.get(i,"MAP_SETTINGS_SCENE_MODE_TITLE")??"Scene Mode",m=q.get(i,"MAP_SETTINGS_BASE_MAP_TITLE")??"Base Map";return c.useEffect(()=>{const v=M=>{var G;const b=M.target,T=q.get(u,"current");T&&!T.contains(b)&&b.id!==ot&&((G=b.parentElement)==null?void 0:G.id)!==ot&&(document.removeEventListener("click",v,!1),t(!1))};return document.addEventListener("click",v,!1),()=>{document.removeEventListener("click",v,!1)}}),o.jsxs(o.Fragment,{children:[o.jsx(U.Icon,{icon:o.jsx("div",{className:"settingsIconContainer",children:o.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 24 24",id:ot,x:"288",y:"24",children:o.jsx("path",{d:"M19.43 12.98c.04-.32.07-.64.07-.98s-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.12-.22-.39-.3-.61-.22l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65A.488.488 0 0 0 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.23-.09-.49 0-.61.22l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98s.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.12.22.39.3.61.22l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.23.09.49 0 .61-.22l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.65zM12 15.5c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5 3.5 1.57 3.5 3.5-1.57 3.5-3.5 3.5z"})})}),onClick:()=>{t(!n)}}),n&&o.jsx("div",{className:"settingsDialogPortal",ref:u,children:o.jsxs(U.Dialog,{open:n,onClosed:()=>{t(!1)},children:[o.jsx(U.DialogTitle,{children:h}),o.jsxs(U.DialogContent,{children:[o.jsx("h4",{className:"sectionLabel",children:f}),o.jsx(oe,{className:"mapScenesContainer",children:o.jsx(di,{sceneModes:r})}),o.jsx(oe,{className:"baseMapsContainer",children:s&&o.jsxs(o.Fragment,{children:[o.jsx("h4",{className:"sectionLabel",children:m}),o.jsx(hi,{baseMaps:s})]})})]})]})})]})},Fo="",pi=()=>{const e=le(),n=[{onClick:()=>e.camera.zoomIn(),iconPath:"M48 20h-18v-18h-10v18h-18v10h18v18h10v-18h18z"},{onClick:()=>e.camera.zoomOut(),iconPath:"M2 20h46v10h-46z"}];return o.jsx("div",{className:"zoom-buttons-container",children:n.map((t,r)=>o.jsx(U.Icon,{icon:o.jsx("div",{className:"zoom-button",children:o.jsx("svg",{fill:"#fff",width:"10px",height:"10px",viewBox:"0 -20 50 50",version:"1.2",baseProfile:"tiny",xmlns:"http://www.w3.org/2000/svg",overflow:"inherit",children:o.jsx("path",{d:t.iconPath})})}),onClick:t.onClick},r))})},Vo="",fi=o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",enableBackground:"new 0 0 24 24",height:"24",width:"24",viewBox:"0 0 612 612",children:o.jsxs("g",{xmlns:"http://www.w3.org/2000/svg",children:[o.jsx("path",{d:"M322.4,173.9l-129,16.2l-4.6,21.4l25.3,4.7c16.5,3.9,19.8,9.9,16.2,26.4l-41.5,195.3c-10.9,50.5,5.9,74.3,45.5,74.3 c30.7,0,66.3-14.2,82.5-33.6l4.9-23.4c-11.3,9.9-27.7,13.9-38.6,13.9c-15.5,0-21.1-10.9-17.1-30L322.4,173.9z"}),o.jsx("circle",{cx:"270.1",cy:"56.3",r:"56.3"})]})}),mi=({onClick:e})=>o.jsx(oe,{onClick:e,className:"mapLegendToggleContainer",children:o.jsx(U.Icon,{icon:fi,className:"mapLegendIcon"})}),yi=({legend:{legendImg:e,legendDoc:n,layer:t},docText:r,imgText:s})=>{const i=c.useCallback(()=>{window.open(e,"_blank")},[e]);c.useCallback(()=>{window.open(n,"_blank")},[n]);const u=c.useCallback(()=>{const m=o.jsx(oe,{className:"layerNameContainer",children:o.jsx("h3",{style:{maxWidth:`${15}ch`},className:"layerName",children:t})});return(t??"").length>15?o.jsx(U.Tooltip,{content:t,children:m}):m},[t]),h=c.useCallback(()=>[typeof e=="string"&&o.jsx("a",{className:"legendAction",href:e,target:"_blank",rel:"noreferrer",children:s}),typeof n=="string"&&o.jsx("a",{className:"legendAction",href:n,target:"_blank",rel:"noreferrer",children:r})],[e,s,n,r]);return o.jsxs(oe,{className:"mapLegend",children:[u(),o.jsx("img",{alt:"Map Legend",className:"legendImg",src:e,onClick:i}),o.jsx(oe,{className:"legendActionsContainer",children:h()})]})},vi=({legends:e,actionsTexts:{docText:n,imgText:t},noLegendsText:r})=>{const s=c.useCallback(()=>o.jsx(oe,{className:"noLegendsContainer",children:o.jsx("h2",{className:"noLegendsMsg",children:r})}),[r]),i=c.useCallback(()=>e.length?e.map((u,h)=>o.jsx(yi,{legend:u,docText:n,imgText:t},`${u.layer}_${h}`)):s(),[e]);return o.jsx(oe,{className:"mapLegendsList",children:i()})},Ei=({isOpen:e,toggleSidebar:n,title:t="Map Legends",noLegendsText:r="No legends to display...",actionsTexts:s={docText:"Docs",imgText:"View Image"},legends:i=[]})=>e?o.jsxs(U.Drawer,{className:"mapLegendSidebarContainer",modal:!1,dismissible:!0,open:e,children:[o.jsx(U.DrawerHeader,{className:"sidebarHeaderContainer",children:o.jsx(U.DrawerTitle,{className:"sidebarTitle",children:t})}),o.jsxs(U.DrawerContent,{className:"sidebarContent",children:[o.jsx(U.Icon,{onClick:n,className:"mapLegendCloseBtn",icon:{icon:"close",size:"small"}}),o.jsx(vi,{noLegendsText:r,legends:i,actionsTexts:s})]})]}):null,Ee=document.createElement("canvas"),ge=Ee.getContext("2d"),en=e=>{const r=(e==null?void 0:e.data)??[];for(let s=3;s<r.length;s+=4)if(r[s]<255)return!0;return!1},Si=async(e,n)=>(n&&n.tileTransparencyCheckedCounter++,new Promise((t,r)=>{try{ge==null||ge.clearRect(0,0,Ee.width,Ee.height);let s;if(e instanceof HTMLImageElement)s=e;else if(e instanceof ImageBitmap){Ee.width=e.width,Ee.height=e.height,ge==null||ge.drawImage(e,0,0);const i=ge==null?void 0:ge.getImageData(0,0,Ee.width,Ee.height),u=en(i);u&&n&&(n.tileTransparencyCheckedCounter=n.maxTilesForTransparencyCheck),t(u);return}else s=new Image,s.crossOrigin="anonymous",s.src=e;s.onload=()=>{Ee.width=s.width,Ee.height=s.height,ge==null||ge.drawImage(s,0,0);const i=ge==null?void 0:ge.getImageData(0,0,Ee.width,Ee.height);en(i)?(n&&(n.tileTransparencyCheckedCounter=n.maxTilesForTransparencyCheck),t(!0)):t(!1)}}catch(s){console.error("Could not determine image transparency. Error => ",s),r(s)}})),He=(e,n)=>{const{west:t,east:r,north:s,south:i}=e,{west:u,east:h,north:f,south:m}=n;return t>=u&&r<=h&&s<=f&&i>=m},Ti=(e,n)=>Wn(e,Re(n)),wi=e=>{const n=(p.Math.toDegrees(e.west)+p.Math.toDegrees(e.east))/2,t=(p.Math.toDegrees(e.south)+p.Math.toDegrees(e.north))/2;return mt.point([n,t])},Ci=e=>[p.Math.toDegrees(e.west),p.Math.toDegrees(e.south),p.Math.toDegrees(e.east),p.Math.toDegrees(e.north)],Li=(e,n=100)=>{const t=e.scene,r=e.camera,s=t.mode,i=r.computeViewRectangle(t.globe.ellipsoid);if(!p.defined(i)||!i){console.error("computeViewRectangle returned invalid rectangle.");return}if(s===p.SceneMode.SCENE2D)return i;const u=r.positionCartographic;if(!p.defined(u)){console.error("Camera position is undefined in 3D mode.");return}const h=u.latitude,f=u.longitude;if(h<-p.Math.PI_OVER_TWO||h>p.Math.PI_OVER_TWO||f<-p.Math.PI||f>p.Math.PI){console.error("Invalid latitude or longitude values.");return}const m=111320,v=111320*Math.cos(h);let M=n/m,b=n/v;const T=p.Cartesian3.magnitude(r.positionWC);T>1e7&&(M=10,b=10);const G=r.frustum instanceof p.PerspectiveFrustum?r.frustum.fov:Math.PI/3;let z=1;T<5e5?z=.05:T<2e6&&(z=.1),M*=z*(G/Math.PI),b*=z*(G/Math.PI);const Z=r.pitch;if(Z===void 0)return;const $=Math.PI/4,X=Math.max(0,1-Math.abs(Z)/$);M*=X,b*=X;const Y=5e-4;M=Math.max(M,Y),b=Math.max(b,Y);const V=u.latitude-M,j=u.latitude+M,H=u.longitude-b,W=u.longitude+b,te=p.Math.clamp(V,i.south,i.north),a=p.Math.clamp(j,i.south,i.north),l=p.Math.clamp(H,i.west,i.east),C=p.Math.clamp(W,i.west,i.east),g=Math.min(1,Z/p.Math.PI_OVER_TWO),S=i.north-(i.north-i.south)*g,y=Math.min(a,S);return new p.Rectangle(p.Math.negativePiToPi(l),p.Math.clamp(te,-p.Math.PI_OVER_TWO,p.Math.PI_OVER_TWO),p.Math.negativePiToPi(C),p.Math.clamp(y,-p.Math.PI_OVER_TWO,p.Math.PI_OVER_TWO))},We=3,ze="hasTransparency";function st(e,n,t,r,s){return setTimeout(()=>{var h;const i=(h=this.layerListInstance.find(f=>{var m,v;return((m=f._imageryProvider._resource)==null?void 0:m._url)===((v=this._resource)==null?void 0:v._url)}))==null?void 0:h.meta,u=q.get(i,ze)===!0;this.tileTransparencyCheckedCounter<We&&!u&&Si(s==null?void 0:s.url,this).then(f=>{var m;(m=this.mapViewer.layersManager)==null||m.addMetaToLayer({[ze]:f},v=>v._imageryProvider._resource._url===this._resource._url)})},0),e(n,t,r,s)}class tn extends p.UrlTemplateImageryProvider{constructor(t,r){var s;super(t);ne(this,"layerListInstance");ne(this,"mapViewer");ne(this,"maxTilesForTransparencyCheck",We);ne(this,"tileTransparencyCheckedCounter",0);this.layerListInstance=(s=r.layersManager)==null?void 0:s.layerList,this.mapViewer=r}requestImage(t,r,s,i){return st.call(this,super.requestImage.bind(this),t,r,s,i)}}class nn extends p.WebMapServiceImageryProvider{constructor(t,r){var s;super(t);ne(this,"layerListInstance");ne(this,"mapViewer");ne(this,"maxTilesForTransparencyCheck",We);ne(this,"tileTransparencyCheckedCounter",0);this.layerListInstance=(s=r.layersManager)==null?void 0:s.layerList,this.mapViewer=r}requestImage(t,r,s,i){return st.call(this,super.requestImage.bind(this),t,r,s,i)}}class rn extends p.WebMapTileServiceImageryProvider{constructor(t,r){var s;super(t);ne(this,"layerListInstance");ne(this,"mapViewer");ne(this,"maxTilesForTransparencyCheck",We);ne(this,"tileTransparencyCheckedCounter",0);this.layerListInstance=(s=r.layersManager)==null?void 0:s.layerList,this.mapViewer=r}requestImage(t,r,s,i){return st.call(this,super.requestImage.bind(this),t,r,s,i)}}const bi=1,Mi=-1,on="TRANSPARENT_BASE_LAYER";class _i{constructor(n,t,r,s){ne(this,"mapViewer");ne(this,"legendsList");ne(this,"layerUpdated");ne(this,"dataLayerUpdated");ne(this,"layers");ne(this,"dataLayers");ne(this,"legendsExtractor");ne(this,"layerManagerFootprintMetaFieldPath");this.mapViewer=n,this.layers=this.mapViewer.imageryLayers._layers,this.dataLayers=[],this.legendsList=[],this.legendsExtractor=t,this.layerUpdated=new p.Event,this.dataLayerUpdated=new p.Event,this.layerManagerFootprintMetaFieldPath=s,r&&this.layerUpdated.addEventListener(r,this),this.mapViewer.shouldOptimizedTileRequests&&(this.layerUpdated.addEventListener(i=>{const u=Object.keys(i);u.length===1&&u[0]===ze&&(this.markRelevantLayersForExtent(),this.hideNonRelevantLayers())}),this.mapViewer.imageryLayers.layerRemoved.addEventListener(()=>{this.setLegends(),this.markRelevantLayersForExtent(),this.hideNonRelevantLayers()}),this.mapViewer.imageryLayers.layerMoved.addEventListener(()=>{this.markRelevantLayersForExtent(),this.hideNonRelevantLayers()}),this.mapViewer.imageryLayers.layerAdded.addEventListener(()=>{this.markRelevantLayersForExtent(),this.hideNonRelevantLayers()}),this.mapViewer.camera.moveEnd.addEventListener(()=>{this.markRelevantLayersForExtent(),this.hideNonRelevantLayers()}))}get layerList(){return this.layers}get dataLayerList(){return this.dataLayers}addDataLayer(n){this.dataLayers.push({...n}),this.dataLayerUpdated.raiseEvent(this.dataLayers)}addMetaToLayer(n,t){const r=this.layers.map(s=>s.imageryProvider.readyPromise);Promise.all(r).then(s=>{const i=this.layers.find(t);i&&(i.meta={...i.meta??{},...n},this.setLegends(),this.layerUpdated.raiseEvent(n))})}addMetaToDataLayer(n){const t=this.findDataLayerById(n.id);t&&(t.meta={...t.meta??{},...n},this.dataLayerUpdated.raiseEvent(this.dataLayers,n.id))}setBaseMapLayers(n){n.baseRasteLayers.sort((r,s)=>r.zIndex-s.zIndex).forEach((r,s)=>{this.addRasterLayer(r,s,n.id)}),this.mapViewer.shouldOptimizedTileRequests&&(this.removeLayer(on),this.addTransparentImageryProvider())}addRasterLayer(n,t,r){let s;switch(n.type){case"XYZ_LAYER":{const i=n.options,u=this.mapViewer.shouldOptimizedTileRequests?new tn(i,this.mapViewer):new p.UrlTemplateImageryProvider(i);s=this.mapViewer.imageryLayers.addImageryProvider(u,t);break}case"WMS_LAYER":{const i=n.options,u=this.mapViewer.shouldOptimizedTileRequests?new nn(i,this.mapViewer):new p.WebMapServiceImageryProvider(i);s=this.mapViewer.imageryLayers.addImageryProvider(u,t);break}case"WMTS_LAYER":{const i=n.options,u=this.mapViewer.shouldOptimizedTileRequests?new rn(i,this.mapViewer):new p.WebMapTileServiceImageryProvider(i);s=this.mapViewer.imageryLayers.addImageryProvider(u,t);break}}s&&(s.alpha=n.opacity,s.meta={parentBasetMapId:r,...n},n.show!==void 0&&(s.show=n.show))}removeLayer(n){const t=this.findLayerById(n);t&&this.mapViewer.imageryLayers.remove(t,!0)}removeDataLayer(n){const t=this.findDataLayerById(n);if(t){const r=this.dataLayers.indexOf(t);r>-1&&this.dataLayers.splice(r,1),this.dataLayerUpdated.raiseEvent(this.dataLayers)}}removeBaseMapLayers(){this.layers.filter(t=>!!q.get(t.meta,"parentBasetMapId")).forEach(t=>{this.mapViewer.imageryLayers.remove(t,!0)})}removeNotBaseMapLayers(){this.layers.filter(t=>!q.get(t.meta,"parentBasetMapId")).forEach(t=>{this.mapViewer.imageryLayers.remove(t,!0)})}raise(n,t=1){const r=this.findLayerById(n),s=(r==null?void 0:r.meta).zIndex;if(r)for(let i=0;i<t;i++)this.mapViewer.imageryLayers.raise(r);this.updateLayersOrder(n,s,s+t)}lower(n,t=1){const r=this.findLayerById(n),s=(r==null?void 0:r.meta).zIndex,i=this.getBaseLayersCount(),u=this.mapViewer.imageryLayers.indexOf(r);if(u-t<=i&&(t=u-i),r)for(let h=0;h<t;h++)this.mapViewer.imageryLayers.lower(r);this.updateLayersOrder(n,s,s-t)}raiseToTop(n){const t=this.findLayerById(n),r=(t==null?void 0:t.meta).zIndex;t&&this.mapViewer.imageryLayers.raiseToTop(t),this.updateLayersOrder(n,r,this.mapViewer.imageryLayers.length-this.getBaseLayersCount()-1)}lowerToBottom(n){const t=this.findLayerById(n),r=this.getBaseLayersCount(),s=this.mapViewer.imageryLayers.indexOf(t);this.lower(n,s-r)}length(){return this.mapViewer.imageryLayers.length}show(n,t){const r=this.get(n);r!==void 0&&(r.show=t)}showAllNotBase(n){this.layers.filter(r=>!q.get(r.meta,"parentBasetMapId")).forEach(r=>{var s;this.show((s=r.meta)==null?void 0:s.id,n)})}get(n){const t=this.findLayerById(n),r=this.mapViewer.imageryLayers.indexOf(t);return r?this.mapViewer.imageryLayers.get(r):void 0}pickImageryLayers(n){var s;const t=this.mapViewer.camera.getPickRay(n);let r;return t&&(r=(s=this.mapViewer.imageryLayers.pickImageryLayers(t,this.mapViewer.scene))==null?void 0:s.filter(i=>!q.get(i.meta,"parentBasetMapId"))),r}findLayerByPOI(n,t,r=!0){if(this.layerManagerFootprintMetaFieldPath){const s=si(this.mapViewer,n,t);return this.layers.filter(h=>!q.get(h.meta,"parentBasetMapId")).filter(h=>{const f=q.get(h.meta,this.layerManagerFootprintMetaFieldPath);return f!==void 0?Hn(s.geometry,{type:"Feature",properties:{},geometry:f})&&(r?h.show:!0):(console.warn("[LayerManager] [findLayerByPOI] CesiumImageryLayer has no defined footprint",h.meta),!1)}).sort((h,f)=>{var m,v;return((m=f.meta)==null?void 0:m.zIndex)-((v=h.meta)==null?void 0:v.zIndex)})}else return console.warn("[LayerManager] [findLayerByPOI]layerManagerFootprintMetaFieldPath is not defined"),[]}addTransparentImageryProvider(){const n=this.mapViewer.imageryLayers.addImageryProvider(new p.SingleTileImageryProvider({url:"./assets/img/transparent-tile.png",rectangle:new p.Rectangle(-3.141592653589793,-1.5707963267948966,3.141592653589793,1.5707963267948966)}),0);n.meta={id:on,skipRelevancyCheck:!0,parentBasetMapId:"TRANSPARENT_LAYER"}}addDataLayerUpdatedListener(n){this.dataLayerUpdated.addEventListener(n,this)}removeDataLayerUpdatedListener(n){this.dataLayerUpdated.removeEventListener(n,this)}findDataLayerById(n){return this.dataLayers.find(t=>t.meta.id===n)}setLegends(){typeof this.legendsExtractor<"u"&&(this.legendsList=this.legendsExtractor(this.layers))}getBaseLayersCount(){return this.layers.filter(t=>!!q.get(t.meta,"parentBasetMapId")).length}findLayerById(n){return this.layers.find(t=>t.meta!==void 0?t.meta.id===n:!1)}updateLayersOrder(n,t,r){const s=t>r?bi:Mi,i=t<r?t:r,u=t<r?r:t;this.layers.forEach(h=>{var m;if(!q.get(h.meta,"parentBasetMapId")){const v=(m=h.meta)==null?void 0:m.zIndex;h.meta.zIndex=v>=i&&v<=u&&v!==t?v+s:v===t?r:v}})}hideNonRelevantLayers(){var n,t;for(const r of this.layers)((n=r.meta)==null?void 0:n.relevantToExtent)!==r.show&&r.imageryProvider.ready&&(r.show=((t=r.meta)==null?void 0:t.relevantToExtent)??!0)}markRelevantLayersForExtent(){var n,t;try{const r=this.mapViewer.camera.computeViewRectangle();for(let s=this.layers.length-1;s>=0;s--){const i=this.layers[s],u=!q.isEmpty(r)&&!q.isEmpty(i.rectangle)&&p.Rectangle.intersection(r,i.rectangle);for(let h=this.layers.length-1;h>=s;h--){if(((n=i.meta)==null?void 0:n.skipRelevancyCheck)===!0){i.meta={...i.meta,relevantToExtent:!0};continue}const f=this.layers[h],m=((t=f.meta)==null?void 0:t[ze])===!0;if(i!==f)if(u instanceof p.Rectangle){if(He(r,i.rectangle))if(He(r,f.rectangle)&&!m){i.meta={...i.meta??{},relevantToExtent:!1};break}else i.meta={...i.meta??{},relevantToExtent:!0};if(He(r,f.rectangle)&&!m){i.meta={...i.meta??{},relevantToExtent:!1};break}if(He(i.rectangle,f.rectangle)){if(i.meta={...i.meta??{},relevantToExtent:m},!m)break}else i.meta={...i.meta??{},relevantToExtent:!0}}else i.meta={...i.meta??{},relevantToExtent:!1};else s===this.layers.length-1&&(i.meta={...i.meta??{},relevantToExtent:u instanceof p.Rectangle})}}}catch(r){console.error(r)}}}const Go="",Pi=e=>{const n=le(),{enableCompass:t=!0,enableZoomControls:r=!1,lockCompassNavigation:s=!1,locale:i={DIRECTION:"ltr"}}=e;return c.useEffect(()=>{if(typeof q.get(n,"cesiumNavigation")>"u"){n.extend(zn,{enableCompass:t,enableZoomControls:r,enableDistanceLegend:!1}),n.cesiumNavigation.setNavigationLocked(s);const u=document.querySelector(".compass");u&&i.DIRECTION&&u.classList.add(i.DIRECTION)}},[n,t,r,i.DIRECTION,s]),null},Ho="",Di=({children:e,locale:n})=>{const[t,r]=c.useState(!1),s=c.useMemo(()=>q.get(n,"DEBUG_PANEL_TITLE")??"Debugger Tool",[n]);return o.jsxs(o.Fragment,{children:[o.jsx(U.Icon,{icon:o.jsx("div",{className:"debugPanelIconContainer",children:o.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 24 24",children:o.jsx("path",{d:"M11.99 18.54l-7.37-5.73L3 14.07l9 7 9-7-1.63-1.27-7.38 5.74zM12 16l7.36-5.73L21 9l-9-7-9 7 1.63 1.27L12 16z"})})}),onClick:()=>{r(!t)}}),o.jsx("div",{className:"debugPanel",children:o.jsxs(U.Dialog,{open:t,onClosed:()=>{r(!1)},children:[o.jsx(U.DialogTitle,{className:"title",children:s}),o.jsx(U.DialogContent,{children:e})]})})]})},Wo="",Ii=({locale:e})=>{var h;const n=le(),[t,r]=c.useState([]),s=c.useMemo(()=>q.get(e,"WFS_TITLE")??"Data Layers",[e]),i=c.useMemo(()=>q.get(e,"WFS_CACHE")??"Cache",[e]),u=c.useMemo(()=>q.get(e,"WFS_EXTENT")??"Extent",[e]);return c.useEffect(()=>{if(!n.layersManager)return;const f=(m,v)=>{var b;m.forEach(T=>{if(v!==void 0&&v!==T.meta.id)return;const{options:G,meta:z}=T,{zoomLevel:Z}=G,{id:$,items:X,total:Y,cache:V,currentZoomLevel:j,featureStructure:H}=z;r(W=>{const te=W.findIndex(a=>a.id===$);if(te>=0){if(JSON.stringify(W[te])!==JSON.stringify({id:$,items:X,total:Y,cache:V,currentZoomLevel:j,featureStructure:H,zoomLevel:Z})){const a=[...W];return a[te]={id:$,items:X,total:Y,cache:V,currentZoomLevel:j,featureStructure:H,zoomLevel:Z},a}}else return[...W,{id:$,items:X,total:Y,cache:V,currentZoomLevel:j,featureStructure:H,zoomLevel:Z}];return W})});const M=new Set((b=n.layersManager)==null?void 0:b.dataLayerList.map(T=>T.meta.id));r(T=>T.filter(G=>M.has(G.id)))};return n.layersManager.addDataLayerUpdatedListener(f),()=>{var m;(m=n.layersManager)==null||m.removeDataLayerUpdatedListener(f)}},[(h=n.layersManager)==null?void 0:h.dataLayerList]),o.jsxs(oe,{className:"wfsContainer",children:[o.jsx(oe,{className:"title",children:s}),t.map((f,m)=>o.jsxs(oe,{className:"featureType",children:[o.jsx(U.Tooltip,{content:`${f.featureStructure.aliasLayerName} ${f.id} (${String(f.zoomLevel)})`,children:o.jsxs(oe,{className:`name ${f.currentZoomLevel<f.zoomLevel?"warning blinking":f.total===-1?"error blinking":""}`,children:[f.featureStructure.aliasLayerName," ",f.id," (",String(f.zoomLevel),"):"]})}),o.jsxs(oe,{className:"info",children:[o.jsxs(oe,{children:[i,": ",f.cache??0]}),f.total>0&&o.jsxs(oe,{className:"spacer",children:[u,": ",f.items," / ",f.total]})]})]},m))]})},zo="",sn=212,an=260,Oi=0;class Ai extends p.Viewer{constructor(t,r){super(t,r);ne(this,"layersManager");ne(this,"currentZoomLevel");ne(this,"useOptimizedTileRequests")}get shouldOptimizedTileRequests(){return this.useOptimizedTileRequests??!1}set shouldOptimizedTileRequests(t){this.useOptimizedTileRequests=t}}const ln=c.createContext(null),ki=ln.Provider,le=()=>{const e=c.useContext(ln);if(e===null)throw new Error("map context is null, please check the provider");return e},Ni=e=>{var re,de,De,qe,je,Ke,Ye,Ie;const n=c.useRef(null),[t,r]=c.useState(),[s,i]=c.useState(),[u,h]=c.useState(),[f,m]=c.useState(),[v,M]=c.useState(),[b,T]=c.useState(),[G,z]=c.useState(),[Z,$]=c.useState(!1),[X,Y]=c.useState(!1),[V,j]=c.useState(),H=c.useRef(),[W,te]=c.useState(),[a,l]=c.useState([]),[C,g]=c.useState(),[S,y]=c.useState(!1),L=c.useRef(),[E,D]=c.useState(void 0),[k,A]=c.useState(!1),[O,x]=c.useState(),[B,_]=c.useState(),[I,P]=c.useState(),F=c.useMemo(()=>Z||X,[Z,X]),N={fullscreenButton:!0,timeline:!1,animation:!1,baseLayerPicker:!1,geocoder:!1,navigationHelpButton:!1,homeButton:!1,sceneModePicker:!1,imageryProvider:!1,...e},J=(ee,R,ae,pe,Te)=>{const Oe=t.container,Me=Oe.clientWidth,Cn=Oe.clientHeight,Ln=pe+Te;return{left:`${Me-ee<ae?ee-(ae-(Me-ee)):ee}px`,top:`${Cn-R<Ln?R-(Ln-(Cn-R)):R}px`}},se=c.useCallback(ee=>{if(n.current!==null){const R=n.current.cesiumElement,ae={x:ee.offsetX,y:ee.offsetY};y(!1),D(ae),x(Zt(R,ae.x,ae.y)),y(!0),L.current=ee}},[n]);c.useEffect(()=>{var ee;if(n.current!==null){const R=n.current.cesiumElement;e.imageryContextMenu&&(R.scene.canvas.removeEventListener("contextmenu",se),R.scene.canvas.addEventListener("contextmenu",se))}r((ee=n.current)==null?void 0:ee.cesiumElement)},[n,e.imageryContextMenu]),c.useEffect(()=>{var ee;t&&(t.shouldOptimizedTileRequests=e.useOptimizedTileRequests??!1,t.layersManager=new _i(t,(ee=e.legends)==null?void 0:ee.mapLegendsExtractor,()=>{var R;l((R=t.layersManager)==null?void 0:R.legendsList)},e.layerManagerFootprintMetaFieldPath))},[t]),c.useEffect(()=>{t&&(t.shouldOptimizedTileRequests=e.useOptimizedTileRequests??!1)},[e.useOptimizedTileRequests,t]),c.useEffect(()=>{te(e.sceneModes??[ue.SCENE2D,ue.SCENE3D,ue.COLUMBUS_VIEW])},[e.sceneModes]),c.useEffect(()=>{var R,ae;g(e.baseMaps);const ee=(R=e.baseMaps)==null?void 0:R.maps.find(pe=>pe.isCurrent);ee&&t&&((ae=t.layersManager)==null||ae.setBaseMapLayers(ee))},[e.baseMaps,t]),c.useEffect(()=>{i(e.projection??ye.WGS84)},[e.projection]),c.useEffect(()=>{j(e.locale)},[e.locale]),c.useEffect(()=>{h(e.showMousePosition??!0)},[e.showMousePosition]),c.useEffect(()=>{m(e.showZoomLevel??!0)},[e.showZoomLevel]),c.useEffect(()=>{M(e.showScale??!0)},[e.showScale]),c.useEffect(()=>{T(e.showCompass??!0)},[e.showCompass]),c.useEffect(()=>{z(e.showLoadingProgress??!0)},[e.showLoadingProgress]),c.useEffect(()=>{P(e.debugPanel)},[e.debugPanel]),c.useEffect(()=>{var R;const ee=()=>{if(t===void 0)return{longitude:0,latitude:0,height:0};const ae=()=>{const pe=t.camera.positionCartographic;return{longitude:Ge(pe.longitude),latitude:Ge(pe.latitude),height:pe.height}};if(t.scene.mode===p.SceneMode.SCENE3D){const pe=new p.Cartesian2(t.container.clientWidth/2,t.container.clientHeight/2),Te=t.scene.camera.getPickRay(pe),Oe=t.scene.globe.pick(Te,t.scene);if(!Oe)return{longitude:0,latitude:0,height:0};const Me=t.scene.globe.ellipsoid.cartesianToCartographic(Oe);return Me!==void 0?{longitude:Ge(Me.longitude),latitude:Ge(Me.latitude),height:t.scene.camera.positionCartographic.height}:ae()}else return ae()};t&&(t.camera.moveEnd.addEventListener(()=>{if(t.scene.mode!==p.SceneMode.MORPHING){const ae=t.camera,pe={position:ee(),direction:ae.direction.clone(),up:ae.up.clone(),right:ae.right.clone(),transform:ae.transform.clone(),frustum:ae.frustum.clone()};H.current=pe}}),G&&(t.scene.globe.tileLoadProgressEvent.addEventListener(function(){t.scene.globe.tilesLoaded?$(!1):$(!0)}),(R=t.layersManager)==null||R.addDataLayerUpdatedListener(()=>{var pe;let ae=!1;(pe=t.layersManager)==null||pe.dataLayerList.forEach(Te=>{if(typeof Te.meta.items=="number"&&typeof Te.meta.total=="number"&&Te.meta.items>0&&Te.meta.items<Te.meta.total){ae=!0;return}}),Y(ae)})))},[t]),c.useEffect(()=>{const ee=()=>{if(t&&H.current){const R=H.current;t.camera.flyTo({destination:p.Cartesian3.fromDegrees(R.position.longitude,R.position.latitude,R.position.height),duration:0})}};return t&&t.scene.morphComplete.addEventListener(ee),()=>{if(t)try{t.scene.morphComplete.removeEventListener(ee)}catch{console.error("morphCompleteHandler event not cleaned")}}},[t]),c.useEffect(()=>{const ee=e.zoom,R=e.center;t&&q.isNumber(ee)&&q.isArray(R)&&t.camera.flyTo({destination:p.Cartesian3.fromDegrees(R[0],R[1],Gr(ee)),duration:0})},[e.zoom,e.center,t]),c.useEffect(()=>{_(e.displayZoomButtons??!0)},[e.displayZoomButtons]);const ce=c.useCallback(()=>t&&Gn.createPortal(o.jsxs(o.Fragment,{children:[G&&F&&o.jsx(U.LinearProgress,{style:{position:"absolute",top:0,height:"10px",zIndex:4}}),o.jsxs(oe,{className:"sideToolsContainer",children:[I&&o.jsx(Di,{locale:V,children:I.wfs&&o.jsx(Ii,{locale:V})}),o.jsx(gi,{sceneModes:W,baseMaps:C,locale:V}),o.jsx(mi,{onClick:()=>A(!k)})]}),o.jsxs(oe,{className:"toolsContainer",children:[u&&o.jsx(Xt,{projection:s}),f&&o.jsx(Rt,{locale:V,valueBy:"RENDERED_TILES"}),v&&o.jsx(Jt,{locale:V}),b&&o.jsx(Pi,{locale:V})]}),B&&o.jsx(pi,{})]}),document.querySelector(".cesium-viewer")),[C,V,t,s,W,u,v,k,F]);return o.jsx(ve.Viewer,{className:"viewer",full:!0,ref:n,...N,children:o.jsxs(ki,{value:t,children:[o.jsx(Ei,{title:(re=e.legends)==null?void 0:re.title,isOpen:k,toggleSidebar:()=>A(!k),noLegendsText:(de=e.legends)==null?void 0:de.emptyText,legends:((De=e.legends)==null?void 0:De.legendsList)??a,actionsTexts:(qe=e.legends)==null?void 0:qe.actionsTexts}),e.children,ce(),e.imageryContextMenu&&S&&E&&O&&c.cloneElement(e.imageryContextMenu,{data:(je=t==null?void 0:t.layersManager)==null?void 0:je.findLayerByPOI(E.x,E.y,!1),position:{x:E.x,y:E.y},coordinates:O,style:J(E.x,E.y,((Ke=e.imageryContextMenuSize)==null?void 0:Ke.width)??an,((Ye=e.imageryContextMenuSize)==null?void 0:Ye.height)??sn,((Ie=e.imageryContextMenuSize)==null?void 0:Ie.dynamicHeightIncrement)??Oi),size:e.imageryContextMenuSize??{height:sn,width:an},handleClose:()=>{y(!S)},contextEvt:L.current})]})})},xi=0,Bi=e=>{const n=le();return o.jsx(ve.Cesium3DTileset,{...e,onReady:t=>{e.isZoomTo===!0&&n.zoomTo(t);const r=n.scene;r.globe.depthTestAgainstTerrain=!0;const s=p.Cartographic.fromCartesian(t.boundingSphere.center),i=e.heightFromGround??xi;if(i){const u=p.Cartesian3.fromRadians(s.longitude,s.latitude,s.height),h=p.Cartesian3.fromRadians(s.longitude,s.latitude,s.height+i),f=p.Cartesian3.subtract(h,u,new p.Cartesian3);t.modelMatrix=p.Matrix4.fromTranslation(f)}}})},$e=180,cn=.001,dn=e=>Math.abs(e)/e,un=e=>{$e-Math.abs(e[0])<cn&&(e[0]=dn(e[0])*($e-1)),$e/2-Math.abs(e[1])<cn&&(e[1]=dn(e[1])*($e/2-1))},hn=e=>{switch(e.type){case"LineString":e.coordinates.forEach(n=>{un(n)});break;case"Polygon":e.coordinates.forEach(n=>{n.forEach(t=>{un(t)})});break}},Fi=e=>{const{data:n,...t}=e,r=q.cloneDeep(n);return r&&(typeof r.features<"u"?r.features.forEach(s=>{hn(s.geometry)}):hn(r)),o.jsx(ve.GeoJsonDataSource,{data:r,...t})},Pe=e=>{const{meta:n,...t}=e,r=le();return c.useLayoutEffect(()=>{var s;(s=r.layersManager)==null||s.addMetaToLayer(n,n.searchLayerPredicate)},[n,r]),o.jsx(ve.ImageryLayer,{...t})},Vi=e=>{const{options:n,...t}=e,r=le(),s=r.shouldOptimizedTileRequests?new nn(n,r):new p.WebMapServiceImageryProvider(n);return o.jsx(Pe,{...t,imageryProvider:s})},Gi=e=>{const{options:n,...t}=e,r=le(),s=r.shouldOptimizedTileRequests?new rn(n,r):new p.WebMapTileServiceImageryProvider(n);return o.jsx(Pe,{...t,imageryProvider:s})},Hi=e=>{const{options:n,...t}=e,r=le(),s=r.shouldOptimizedTileRequests?new tn(n,r):new p.UrlTemplateImageryProvider(n);return o.jsx(Pe,{...t,imageryProvider:s})},Wi=e=>{const{options:n,...t}=e;return o.jsx(Pe,{...t,imageryProvider:new p.OpenStreetMapImageryProvider(n)})},zi=e=>{const{options:n,meta:t,visualizationHandler:r}=e,{url:s,featureType:i,style:u,pageSize:h,zoomLevel:f,maxCacheSize:m,keyField:v}=n,{color:M,hover:b}=u,T=le(),G=c.useRef(new Map),z=c.useRef(new Set),Z=c.useRef(0),[$,X]=c.useState(t),Y=c.useMemo(()=>p.Color.fromCssColorString(M??"#01FF1F").withAlpha(.5),[M]),V=c.useMemo(()=>p.Color.fromCssColorString(M??"#01FF1F").withAlpha(.2),[M]),j=c.useMemo(()=>p.Color.fromCssColorString(b??"#24AEE9").withAlpha(.5),[b]),H=c.useMemo(()=>`wfs_${i}_${yt.v4()}`,[i]),W=new p.GeoJsonDataSource(H),te=_=>{const I=[],P=t.featureStructure;if(P&&P.fields)for(const N of P.fields){const{fieldName:J,aliasFieldName:se}=N,ce=se,re=_[J.toLowerCase()]??"N/A";I.push(`
|
|
2
2
|
<tr>
|
|
3
3
|
<td><strong>${ce}:</strong></td>
|
|
4
4
|
<td>${re}</td>
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
width: 280px;
|
|
6
6
|
position: absolute;
|
|
7
7
|
top: 44px;
|
|
8
|
-
right:
|
|
8
|
+
right: 110px;
|
|
9
9
|
/* color: #AFBFDA;
|
|
10
10
|
background: #2D3748;
|
|
11
11
|
padding: 20px 24px; */
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
body[dir='rtl'] .debugPanel {
|
|
23
|
-
left:
|
|
23
|
+
left: 110px;
|
|
24
24
|
right: unset;
|
|
25
25
|
}
|
|
26
26
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@map-colonies/react-components",
|
|
3
|
-
"version": "4.9.
|
|
3
|
+
"version": "4.9.3",
|
|
4
4
|
"main": "./dist/@map-colonies/react-components.umd.js",
|
|
5
5
|
"module": "./dist/@map-colonies/react-components.es.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -76,5 +76,5 @@
|
|
|
76
76
|
"files": [
|
|
77
77
|
"dist"
|
|
78
78
|
],
|
|
79
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "714ba9ec7af1e2753670a32ee2a634d6fd77f210"
|
|
80
80
|
}
|