@map-colonies/react-components 4.10.4 → 4.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/dist/@map-colonies/react-components.es.js +3161 -2745
  2. package/dist/@map-colonies/react-components.umd.js +25 -20
  3. package/dist/animated/animated-values-provider.d.ts +13 -0
  4. package/dist/animated/index.d.ts +1 -0
  5. package/dist/autocomplete/autocomplete.css +1 -1
  6. package/dist/cesium-map/active-layers/active-layers-panel.css +35 -0
  7. package/dist/cesium-map/active-layers/active-layers-panel.d.ts +8 -0
  8. package/dist/cesium-map/active-layers/active-layers-widget.d.ts +8 -0
  9. package/dist/cesium-map/base-map/base-map-widget.d.ts +11 -0
  10. package/dist/cesium-map/base-map/base-maps-panel.d.ts +9 -0
  11. package/dist/cesium-map/base-map/cesium-item.d.ts +9 -0
  12. package/dist/cesium-map/base-map/terrains-panel.d.ts +8 -0
  13. package/dist/cesium-map/data-sources/drawings.data-source.d.ts +1 -1
  14. package/dist/cesium-map/debug/{debug-panel.d.ts → wfs-debug-widget.d.ts} +3 -4
  15. package/dist/cesium-map/debug/wfs.css +7 -7
  16. package/dist/cesium-map/debug/wfs.d.ts +1 -1
  17. package/dist/cesium-map/geocoder/geocoder-panel.css +93 -0
  18. package/dist/cesium-map/geocoder/geocoder-panel.d.ts +39 -0
  19. package/dist/cesium-map/geocoder/geocoder-widget.d.ts +10 -0
  20. package/dist/cesium-map/helpers/constants.d.ts +5 -0
  21. package/dist/cesium-map/{tools → helpers}/draw/drawHelper.css +1 -1
  22. package/dist/cesium-map/helpers/utils.d.ts +10 -2
  23. package/dist/cesium-map/layers/wfs.layer.d.ts +1 -0
  24. package/dist/cesium-map/layers-manager.d.ts +5 -3
  25. package/dist/cesium-map/legend/index.d.ts +3 -0
  26. package/dist/cesium-map/{map-legend/MapLegend.d.ts → legend/legend-item.d.ts} +2 -2
  27. package/dist/cesium-map/{map-legend/MapLegendList.d.ts → legend/legend-list.d.ts} +3 -3
  28. package/dist/cesium-map/{map-legend/MapLegendSidebar.d.ts → legend/legend-sidebar.d.ts} +3 -3
  29. package/dist/cesium-map/legend/legend-widget.d.ts +5 -0
  30. package/dist/cesium-map/{map-legend/MapLegend.css → legend/legend.css} +20 -26
  31. package/dist/cesium-map/map.css +249 -28
  32. package/dist/cesium-map/map.d.ts +27 -10
  33. package/dist/cesium-map/tools/cesium-compass.tool.css +7 -7
  34. package/dist/cesium-map/tools/cesium-compass.tool.d.ts +2 -2
  35. package/dist/cesium-map/tools/coordinates-tracker.tool.css +3 -5
  36. package/dist/cesium-map/tools/index.d.ts +3 -4
  37. package/dist/cesium-map/tools/inspector.tool.d.ts +1 -3
  38. package/dist/cesium-map/tools/scale-tracker.tool.css +6 -4
  39. package/dist/cesium-map/tools/zoom-buttons.css +31 -0
  40. package/dist/cesium-map/tools/{zoom_level-tracker.tool.css → zoom-level-tracker.tool.css} +6 -5
  41. package/dist/cesium-map/widget/cesium-button.d.ts +7 -0
  42. package/dist/cesium-map/widget/cesium-icon.d.ts +7 -0
  43. package/dist/cesium-map/widget/cesium-inspector.d.ts +9 -0
  44. package/dist/cesium-map/widget/cesium-title.d.ts +6 -0
  45. package/dist/cesium-map/widget/cesium-tool.d.ts +8 -0
  46. package/dist/circular-progress-bar/circular-progress-bar.d.ts +26 -0
  47. package/dist/circular-progress-bar/index.d.ts +1 -0
  48. package/dist/index.d.ts +3 -1
  49. package/dist/multi-selection/index.d.ts +1 -0
  50. package/dist/{multiSelection/multiSelection.d.ts → multi-selection/multi-selection.d.ts} +5 -5
  51. package/dist/theme/theme.d.ts +4 -1
  52. package/dist/utils/config.d.ts +1 -0
  53. package/package.json +7 -2
  54. package/dist/cesium-map/debug/debug-panel.css +0 -30
  55. package/dist/cesium-map/map-legend/MapLegendToggle.d.ts +0 -6
  56. package/dist/cesium-map/map-legend/index.d.ts +0 -3
  57. package/dist/cesium-map/settings/base-maps.css +0 -37
  58. package/dist/cesium-map/settings/base-maps.d.ts +0 -6
  59. package/dist/cesium-map/settings/scene-modes.css +0 -19
  60. package/dist/cesium-map/settings/scene-modes.d.ts +0 -6
  61. package/dist/cesium-map/settings/settings.css +0 -57
  62. package/dist/cesium-map/settings/settings.d.ts +0 -23
  63. package/dist/cesium-map/zoom/zoomButtons.css +0 -35
  64. package/dist/multiSelection/index.d.ts +0 -1
  65. /package/dist/cesium-map/{tools → helpers}/draw/drawHelper.d.ts +0 -0
  66. /package/dist/cesium-map/{tools/geojson/geojson-to-primitive.d.ts → helpers/geojson/geojsonToPrimitive.d.ts} +0 -0
  67. /package/dist/cesium-map/{tools → helpers}/geojson/index.d.ts +0 -0
  68. /package/dist/cesium-map/{tools → helpers}/geojson/point.geojson.d.ts +0 -0
  69. /package/dist/cesium-map/{tools → helpers}/geojson/polygon.geojson.d.ts +0 -0
  70. /package/dist/cesium-map/{tools → helpers}/geojson/rectangle.geojson.d.ts +0 -0
  71. /package/dist/cesium-map/{tools/cesium/primitives-conversions.cesium.d.ts → helpers/primitivesConversionsCesium.d.ts} +0 -0
  72. /package/dist/cesium-map/{zoom/zoomButtons.d.ts → tools/zoom-buttons.d.ts} +0 -0
  73. /package/dist/cesium-map/tools/{zoom_level-tracker.tool.d.ts → zoom-level-tracker.tool.d.ts} +0 -0
@@ -1,29 +1,34 @@
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/area"),require("@turf/intersect"),require("@turf/centroid"),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/area","@turf/intersect","@turf/centroid","@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.area,d.intersect,d.centroid,d.bbox,d.getCaretCoordinates,d.getInputSelection,d.chonky,d.chonkyIconFontawesome,d.filesize,d.Select))})(this,function(d,o,l,Me,Ke,Ge,wt,Oe,se,Y,Fn,St,Vn,He,Gn,Tt,Go,Ct,at,lt,Lt,Mt,ct,dt,Hn,Wn,zn,Ye,$n,bt,Un,qn,jn,Pt,Kn,Ho,Yn,_t,Zn,Xn,Jn,De,u,j,Qn,Ze,Dt,Rn,er,Wo,zo,It,ut,Ot,At,tr,kt,nr,xt,R,rr,ir,Nt){"use strict";var Fo=Object.defineProperty;var Vo=(d,o,l)=>o in d?Fo(d,o,{enumerable:!0,configurable:!0,writable:!0,value:l}):d[o]=l;var de=(d,o,l)=>(Vo(d,typeof o!="symbol"?o+"":o,l),l);function ht(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 Bt=ht(l),S=ht(u),Ft=ht(Dt);var Te=(e=>(e.BOX="BOX",e.POLYGON="POLYGON",e.UNKNOWN="UNKNOWN",e))(Te||{}),be=(e=>(e.HE="he",e.EN="en",e.RU="ru",e))(be||{}),Xe=(e=>(e.TOP_RIGHT="TOP_RIGHT",e.BOTTOM_LEFT="BOTTOM_LEFT",e))(Xe||{});const ge={DATE_PICKER:{dateFormat:"dd/MM/yyyy",local:{setText:"set",placeHolderText:"Enter the Date",calendarLocale:be.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:be.EN},renderAsButton:!0,offset:0,disableFuture:!0}},ue=e=>{const{children:n,...t}=e;return o.jsx(se.Box,{...t,children:n})},Je=e=>{const n=e.type==="dark";return l.useMemo(()=>Vt(e,n),[n,e])},Vt=(e,n=!1)=>Oe.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}}}),$o="",or=2,sr=.5,ar=Oe.makeStyles(e=>Oe.createStyles({container:{padding:e.spacing(or),alignItems:"center"},setButton:{marginTop:e.spacing(1)},margin:{marginLeft:e.spacing(sr)}})),Gt=e=>{var X,F,ee,W;const n=ar(),t=Y.useTheme(),r=Je(t),[s,i]=l.useState(null),[h,g]=l.useState(null),[f,y]=l.useState(ge.DATE_RANGE_PICKER.dateFormat),T=e.controlsLayout??ge.DATE_RANGE_PICKER.controlsLayout,m=e.disableFuture??ge.DATE_RANGE_PICKER.disableFuture,M=((X=e.local)==null?void 0:X.startPlaceHolderText)??ge.DATE_RANGE_PICKER.local.startPlaceHolderText,O=((F=e.local)==null?void 0:F.endPlaceHolderText)??ge.DATE_RANGE_PICKER.local.endPlaceHolderText,_=((ee=e.local)==null?void 0:ee.setText)??ge.DATE_RANGE_PICKER.local.setText,Q=(((W=e.local)==null?void 0:W.calendarLocale)??ge.DATE_RANGE_PICKER.local.calendarLocale)===be.HE?Ke.he:Ke.enUS;l.useEffect(()=>{i(e.from??null)},[e.from]),l.useEffect(()=>{g(e.to??null)},[e.to]),l.useEffect(()=>{y(e.dateFormat??ge.DATE_RANGE_PICKER.dateFormat)},[e.dateFormat]);const $=Boolean(Me.isValid(s)&&!h||Me.isValid(h)&&!s||s&&h&&Me.isValid(s)&&Me.isValid(h)&&Me.isBefore(s,h)),J=()=>{e.onChange({from:s&&Me.isValid(s)?s:void 0,to:h&&Me.isValid(h)?h:void 0})};return o.jsx(se.ThemeProvider,{theme:r,children:o.jsx(ue,{className:`${n.container} drpContainer`,display:"flex",flexDirection:T,width:T==="column"?e.contentWidth:"unset",children:o.jsxs(Ge.MuiPickersUtilsProvider,{utils:wt,locale:Q,children:[o.jsx(Ge.KeyboardDateTimePicker,{variant:"inline",placeholder:M,onChange:Z=>i(Z),value:s,disableFuture:m,format:f,maxDate:e.maxDate,minDate:e.minDate}),o.jsx(Ge.KeyboardDateTimePicker,{variant:"inline",placeholder:O,className:n.margin,onChange:Z=>g(Z),value:h,disableFuture:m,format:f,maxDate:e.maxDate,minDate:e.minDate}),o.jsx(Y.ThemeProvider,{options:t,children:o.jsx(Y.Button,{className:`${n.setButton} ${n.margin}`,raised:!0,onClick:J,disabled:!$,children:_})})]})})})},Ht=e=>{const{children:n,...t}=e;return o.jsx(se.Popover,{...t,children:n})},Uo="",lr=e=>{var F,ee;const[n,t]=l.useState(null),[r,s]=l.useState(null),[i,h]=l.useState(ge.DATE_RANGE_PICKER.dateFormat),[g,f]=l.useState(null),y=W=>{f(W.currentTarget)},T=W=>{W.currentTarget.tagName==="I"?f(W.currentTarget.previousElementSibling):f(W.currentTarget)},m=()=>{f(null)},M=Boolean(g),O=e.controlsLayout??"column";l.useEffect(()=>{t(e.from??null)},[e.from]),l.useEffect(()=>{s(e.to??null)},[e.to]),l.useEffect(()=>{h(e.dateFormat??ge.DATE_RANGE_PICKER.dateFormat)},[e.dateFormat]);const _=((F=e.local)==null?void 0:F.startPlaceHolderText)??ge.DATE_RANGE_PICKER.local.startPlaceHolderText,z=((ee=e.local)==null?void 0:ee.endPlaceHolderText)??ge.DATE_RANGE_PICKER.local.endPlaceHolderText,Q=e.renderAsButton===void 0?ge.DATE_RANGE_PICKER.renderAsButton:e.renderAsButton,$=e.offset===void 0?ge.DATE_RANGE_PICKER.offset:e.offset,J=e.disableFuture===void 0?ge.DATE_RANGE_PICKER.disableFuture:e.disableFuture,X=l.useMemo(()=>`${n?Me.format(n,i):_} - ${r?Me.format(r,i):z}`,[n,r,i,_,z]);return o.jsxs(o.Fragment,{children:[Q?o.jsx(Y.Button,{style:{width:e.width},raised:!0,onClick:y,className:"drpOpener",children:X}):o.jsx(Y.TextField,{className:"drpOpener",readOnly:!0,style:{width:e.width},value:X,onClick:T,trailingIcon:{icon:"date_range",tabIndex:0,onClick:T}}),o.jsx(Ht,{open:M,anchorEl:g,onClose:m,anchorOrigin:{vertical:"bottom",horizontal:"left"},keepMounted:!0,children:o.jsx(Gt,{controlsLayout:O,contentWidth:((g==null?void 0:g.clientWidth)??0)-$,dateFormat:i,disableFuture:J,minDate:e.minDate,maxDate:e.maxDate,local:e.local,from:n??void 0,to:r??void 0,onChange:({from:W,to:Z})=>{t(W??null),s(Z??null),e.onChange({from:W,to:Z}),m()}})})]})},Qe=e=>typeof e<"u"&&e!==null&&"startDate"in e&&"endDate"in e,cr=({endDate:e,startDate:n,setEndDate:t=()=>{},setStartDate:r=()=>{},endTimeInputClassName:s="",endTimeLabel:i="",endTimeWrapperClassName:h="",timeRangeInputsWrapperClassName:g="",startTimeInputClassName:f="",startTimeLabel:y="",startTimeWrapperClassName:T=""})=>o.jsxs("div",{className:`timeRangeWrapper ${g}`,children:[o.jsx("div",{className:`startTimeWrapper ${T}`,children:o.jsx(Y.TextField,{label:y,disabled:n===null,className:`timeRangeInput ${f}`,name:"start-time",type:"time",value:He(n).format("HH:mm"),onChange:m=>{const M=He(n),O=He(m.currentTarget.value,"HH:mm"),_=M.set({hours:O.get("hours"),minutes:O.get("minutes")});r(_.toDate())}})}),o.jsx("div",{className:`endTimeWrapper ${h}`,children:o.jsx(Y.TextField,{label:i,disabled:e===null,className:`timeRangeInput ${s}`,name:"end-time",type:"time",value:He(e).format("HH:mm"),onChange:m=>{const M=He(e),O=He(m.currentTarget.value,"HH:mm"),_=M.set({hours:O.get("hours"),minutes:O.get("minutes")});t(_.toDate())}})})]}),dr=l.forwardRef(({value:e,onClick:n,onInputClick:t,...r},s)=>o.jsx(Y.TextField,{...r,className:"dateRangeCustomInput",readOnly:!0,onClick:i=>{n==null||n(i),t==null||t()},ref:s,value:e})),ur=({setStartDate:e=()=>{},setEndDate:n=()=>{},shortcuts:t,dateRange:r,onShortcut:s})=>{const[i,h]=l.useState(),g=l.useMemo(()=>t.map(f=>f instanceof Function?f():f),[t]);return l.useEffect(()=>{for(const f of g){const y=r.startDate&&r.endDate&&Me.isSameDay(f.startDate,r.startDate)&&Me.isSameDay(f.endDate,r.endDate);i?f.id===i&&(y||h(void 0)):y&&h(f.id)}},[r,i,g]),o.jsx("div",{className:"shortcutsContainer",children:g.map((f,y)=>{const T=()=>{e(f.startDate),n(f.endDate)};return o.jsx(Y.Button,{type:"button",className:`shortcut ${i===f.id?"selected":""}`,onClick:m=>{T(),s==null||s({startDate:f.startDate,endDate:f.endDate})},outlined:!0,children:f.label},f.id+y)})})},hr=l.forwardRef((e,n)=>{const{calendarClassName:t,dayClassName:r,monthClassName:s,selectsRange:i,onChange:h,inputName:g,showMonthYearDropdown:f,withShortcuts:y,locale:T="en"}=e,[m,M]=l.useState(null),[O,_]=l.useState(null),[z,Q]=l.useState(!1),$=i?{startDate:m,endDate:O}:m;l.useEffect(()=>{T==="he"&&St.registerLocale("he",Vn)},[T]),l.useEffect(()=>{var F,ee;((F=e.startDate)==null?void 0:F.toString())!==(m==null?void 0:m.toString())&&M(e.startDate),((ee=e.endDate)==null?void 0:ee.toString())!==(O==null?void 0:O.toString())&&_(e.endDate)},[e.startDate,e.endDate,m,O]);const J=l.useMemo(()=>{let F="pickerContainer"+(T==="he"?" pickerContainer-rtl":"");return y&&i&&(F+=" pickerContainer-withShortcuts"),F},[T,y,i]),X=f?{showMonthDropdown:!0,showYearDropdown:!0,dropdownMode:"select"}:{};return o.jsx("div",{className:J,style:{direction:T==="he"?"rtl":"ltr"},children:o.jsx(St,{...e,ref:n,onClickOutside:()=>Q(!1),open:z,startDate:Qe($)?m:void 0,selected:m,endDate:Qe($)?O:void 0,monthsShown:e.monthsShown??2,calendarClassName:`pickerCalendar ${t}`,weekDayClassName:F=>`pickerWeek ${(r==null?void 0:r(F))??""}`,dayClassName:F=>`pickerDay ${(r==null?void 0:r(F))??""}`,monthClassName:F=>`pickerMonth ${(s==null?void 0:s(F))??""}`,onChange:(F,ee)=>{if(Array.isArray(F)){const[W,Z]=F;M(W),_(Z),h==null||h({startDate:W,endDate:Z&&Me.endOfDay(Z)},ee)}else M(F),h==null||h(F,ee)},customInput:o.jsx(dr,{name:g,onInputClick:()=>{Q(!0)}}),showTimeInput:!!(y&&i),timeInputLabel:"",customTimeInput:y&&Qe($)&&o.jsx(ur,{onShortcut:F=>{h==null||h(F),Q(!1)},shortcuts:y,setEndDate:_,setStartDate:M,dateRange:$}),showMonthYearDropdown:void 0,...X})})}),qo="",gr=e=>{const n=Y.useTheme(),t=Je(n),{format:r=ge.DATE_PICKER.dateFormat,variant:s=ge.DATE_PICKER.variant,disableFuture:i=ge.DATE_PICKER.disableFuture,local:h,onChange:g,showTime:f=ge.DATE_PICKER.showTime,value:y,...T}=e,{placeHolderText:m=ge.DATE_PICKER.local.placeHolderText,calendarLocale:M}=h??{placeHolderText:ge.DATE_PICKER.local.placeHolderText,calendarLocale:be.EN},O=M===be.HE?Ke.he:Ke.enUS,_=z=>{g(z)};return o.jsx(se.ThemeProvider,{theme:t,children:o.jsxs(Ge.MuiPickersUtilsProvider,{utils:wt,locale:O,children:[f&&o.jsx(Ge.KeyboardDateTimePicker,{variant:s,placeholder:m,onChange:_,value:y,disableFuture:i,format:r,...T}),!f&&o.jsx(Ge.KeyboardDatePicker,{variant:s,placeholder:m,onChange:_,value:y,disableFuture:i,format:r,...T})]})})},pr=18,fr=Oe.makeStyles(e=>Oe.createStyles({drawingButton:{width:e.spacing(pr)},fullWidth:{width:"100%",marginTop:"36px"}})),mr=e=>{const n=fr(),[t,r]=l.useState(null),{isSelectionEnabled:s,onCancelDraw:i,onStartDraw:h,onReset:g}=e,f=T=>{r(T.currentTarget)},y=()=>{r(null)};return s?o.jsx(Y.Tooltip,{content:"Cancel the ongoing draw",align:"bottomLeft",children:o.jsx(Y.Button,{className:n.drawingButton,raised:!0,onClick:i,children:"Cancel Draw"})}):o.jsxs(ue,{position:"relative",children:[o.jsx(Y.Tooltip,{content:"draw an Area of interest to limit the search",align:"bottomLeft",children:o.jsx(Y.Button,{className:n.drawingButton,raised:!0,onClick:f,children:"Draw AOI"})}),o.jsxs(Y.Menu,{className:n.fullWidth,open:Boolean(t),onClose:y,children:[o.jsx(Y.MenuItem,{onClick:()=>{h(Te.POLYGON),y()},children:"Polygon"}),o.jsx(Y.MenuItem,{onClick:()=>{h(Te.BOX),y()},children:"Box"}),o.jsx(Y.MenuItem,{onClick:()=>{g(),y()},children:"Clear"})]})]})},jo="";var _e=(e=>(e.WGS84="EPSG:4326",e.WEB_MERCATOR="EPSG:3857",e))(_e||{});const Re=5,et=2,Wt=l.createContext(null),yr=Wt.Provider,zt=35,$t=32,vr=10,Er=e=>e!==void 0&&e!==_e.WGS84?Lt.transform([zt,$t],_e.WGS84,e):[zt,$t],wr=e=>{switch(e){case _e.WEB_MERCATOR:return n=>Ct.format(n,"Mercator: {y}m, {x}m",et);case _e.WGS84:return n=>Ct.format(n,"WGS84: {y}°N {x}°E",Re);default:return n=>""}},Fe=()=>{const e=l.useContext(Wt);if(e===null)throw new Error("map context is null, please check the provider");return e},Ut=e=>{const n=l.useRef(null),{allowFullScreen:t,showMousePosition:r,projection:s}=e,[i]=l.useState(new Tt.Map({view:new Tt.View({projection:s??_e.WGS84}),controls:at.defaults()}));l.useEffect(()=>{i.getView().setCenter(e.center??Er(e.projection))},[i,e.center,e.projection]),l.useEffect(()=>{i.getView().setZoom(e.zoom??vr)},[i,e.zoom,e.projection]);const h=(g,f)=>{f.getControls().forEach(T=>{T instanceof g&&f.removeControl(T)})};return l.useEffect(()=>{i.setTarget(n.current),t!==void 0&&t?i.addControl(new at.FullScreen):h(at.FullScreen,i)},[i,t]),l.useEffect(()=>{r!==void 0&&r?(h(lt,i),i.addControl(new lt({coordinateFormat:wr(s??_e.WGS84),projection:s??_e.WGS84,undefinedHTML:"&nbsp;"}))):h(lt,i)},[i,r,s]),o.jsxs(yr,{value:i,children:[o.jsx("div",{className:"map",ref:n}),e.children]})},qt=l.createContext(null),Sr=qt.Provider,qe=()=>{const e=l.useContext(qt);if(e===null)throw new Error("tile layer context is null, please check the provider");return e},jt=({options:e,children:n})=>{const t=Fe(),[r]=l.useState(new Mt.Tile(e));return l.useEffect(()=>(t.addLayer(r),()=>{t.removeLayer(r)}),[t,r]),o.jsx(Sr,{value:r,children:n})},Kt=l.createContext(null),Tr=Kt.Provider,Yt=()=>{const e=l.useContext(Kt);if(e===null)throw new Error("vector layer context is null, please check the provider");return e},Zt=({children:e})=>{const n=Fe(),[t]=l.useState(new Mt.Vector);return l.useEffect(()=>(n.addLayer(t),()=>{n.removeLayer(t)}),[n,t]),o.jsx(Tr,{value:t,children:e})},Xt=l.createContext(null),Cr=Xt.Provider,Jt=()=>{const e=l.useContext(Xt);if(e===null)throw new Error("vector source context is null, please check the provider");return e},Qt=({children:e})=>{const n=Yt(),[t]=l.useState(new ct.Vector);return l.useEffect(()=>{n.setSource(t)},[t,n]),o.jsx(Cr,{value:t,children:e})},Rt=({geometry:e,fitOptions:n,fit:t,featureStyle:r})=>{const s=Jt(),i=Fe();return l.useLayoutEffect(()=>{const g=new dt.GeoJSON().readFeature(e);return t&&s.on("addfeature",function(){i.getView().fit(s.getExtent(),n)}),r&&g.setStyle(r),s.addFeature(g),()=>{s.removeFeature(g)}},[e,s,t]),null},en=e=>{const n=qe();return l.useEffect(()=>{n.setSource(new ct.OSM)},[n]),null},tn=({drawType:e,onPolygonSelected:n})=>{const t=Fe();return l.useEffect(()=>{const r={type:"Circle"};switch(e){case Te.BOX:r.geometryFunction=Wn.createBox();break;case Te.POLYGON:r.type="Polygon";break;default:return}const s=new Hn.Draw(r);t.addInteraction(s);const i=h=>{const f=new dt.GeoJSON().writeGeometryObject(h.feature.getGeometry());n==null||n(f)};return s.on("drawend",i),()=>{s.un("drawend",i),t.removeInteraction(s)}},[n,e,t]),null},Ko="",Lr=e=>{const n=t=>{const r=Gn(t);e.onPolygonSelection(r)};return o.jsxs(Ut,{allowFullScreen:!0,showMousePosition:!0,children:[o.jsx(jt,{children:o.jsx(en,{})}),e.selectionPolygon&&o.jsx(Zt,{children:o.jsx(Qt,{children:o.jsx(Rt,{geometry:e.selectionPolygon})})}),e.children,e.drawType!==void 0&&o.jsx(tn,{drawType:e.drawType,onPolygonSelected:n})]})},gt=1.5,Mr=80,br=Oe.makeStyles(e=>Oe.createStyles({map:{height:"100%",width:"100%",position:"absolute"},absolute:{position:"absolute",zIndex:1e3,left:e.spacing(gt),top:e.spacing(gt)},contentContainer:{marginTop:e.spacing(gt),width:e.spacing(Mr)},filtersContainer:{display:"flex",padding:e.spacing(1)},filtersMargin:{marginLeft:e.spacing(1)}})),Pr=e=>{var f;const[n,t]=l.useState(),[r,s]=l.useState(),i=br(),h=y=>{s(y),t(void 0),e.handlePolygonSelected(y)},g=()=>{s(void 0),e.handlePolygonReset()};return o.jsxs("div",{className:i.map,children:[o.jsxs("div",{className:`${i.absolute}`,children:[o.jsxs(se.Paper,{className:i.filtersContainer,children:[o.jsx(mr,{onCancelDraw:()=>t(void 0),onReset:g,onStartDraw:t,isSelectionEnabled:n!==void 0}),(f=e.filters)==null?void 0:f.map((y,T)=>o.jsx("div",{className:i.filtersMargin,children:y},T))]}),o.jsx(se.Paper,{color:"red",className:`${i.contentContainer}`,children:e.children})]}),o.jsx(Lr,{children:e.mapContent,onPolygonSelection:h,drawType:n,selectionPolygon:r})]})},nn=new Ye.Fill({color:"rgba(255,255,255,0.4)"}),rn=new Ye.Stroke({color:"#3399CC",width:1.25}),on=[new Ye.Style({image:new Ye.Circle({fill:nn,stroke:rn,radius:5}),fill:nn,stroke:rn})],sn=l.createContext(null),_r=sn.Provider,an=()=>{const e=l.useContext(sn);if(e===null)throw new Error("vector tile layer context is null, please check the provider");return e},Dr=({children:e,options:n,style:t})=>{const r=Fe(),[s]=l.useState(new zn({...n,style:t||on}));return l.useEffect(()=>(r.addLayer(s),()=>{r.removeLayer(s)}),[r,s]),l.useEffect(()=>{s.setStyle(t||on)},[s,t]),o.jsx(_r,{value:s,children:e})},pt=20,Ir=256,Or=2,Ar=2,kr="REST",xr=e=>{const n=Lt.get(e.projection),t=n.getExtent(),r=new Array(pt),s=new Array(pt),i=bt.getWidth(t)/Ir,h=e.heightWidthRatio!==void 0?e.heightWidthRatio:Ar,g=e.requestEncoding!==void 0?e.requestEncoding:kr;for(let y=0;y<pt;++y)r[y]=i/Math.pow(Or,y)/h,s[y]=y.toString();return{attributions:e.attributions,url:e.url,layer:e.layer,matrixSet:e.matrixSet,format:e.format,projection:n,tileGrid:new $n({origin:bt.getTopLeft(t),resolutions:r,matrixIds:s}),style:e.style,requestEncoding:g,wrapX:e.wrapX!==void 0?e.wrapX:!0}},Nr=e=>{const n=qe(),{options:t}=e;return l.useEffect(()=>{n.setSource(new ct.WMTS(t))},[n,t]),null},Br=e=>{const{attributions:n,url:t,params:r,serverType:s,transition:i}=e;return{attributions:n,url:t,params:r,serverType:s,transition:i}},Fr=e=>{const n=qe(),{options:t}=e;return l.useEffect(()=>{n.setSource(new Un(t))},[n,t]),null},Vr=e=>{const{attributions:n,url:t}=e;return{attributions:n,url:t}},Gr=e=>{const n=qe(),{options:t}=e;return l.useEffect(()=>{n.setSource(new qn(t))},[n,t]),null},Hr=l.createContext(null),Wr=()=>{const e=l.useContext(Hr);if(e===null)throw new Error("vector tile source context is null, please check the provider");return e},zr=e=>{const{url:n}=e;return{url:n,format:new dt.MVT}},$r=({children:e,options:n})=>{const t=an();return l.useEffect(()=>{t.setSource(new jn(n))},[n,t]),null},Ur=({legendItems:e,title:n,isCollapsed:t})=>{const r=Fe();return l.useEffect(()=>{const s=new Pt({title:n??"",margin:5,maxWidth:300}),i=new Kn({legend:s,collapsed:t===void 0?!0:t});r.addControl(i);const h=new Pt({margin:4});return e.forEach(g=>{h.addItem({title:g.title,style:g.style,typeGeom:"Polygon"})}),s.addItem(h),()=>{r.removeControl(i)}},[r,e,n,t]),o.jsx(o.Fragment,{})};function qr(e){const{headCells:n,order:t,orderBy:r,onRequestSort:s,isCollapseable:i}=e,h=g=>f=>{s(f,g)};return o.jsx(Yn,{children:o.jsxs(se.TableRow,{children:[i&&o.jsx(se.TableCell,{}),n.map(g=>o.jsx(se.TableCell,{align:g.numeric?"right":"left",padding:g.disablePadding?"none":"default",sortDirection:r===g.id?t:!1,children:o.jsx(se.TableSortLabel,{active:r===g.id,direction:r===g.id?t:"asc",onClick:h(g.id),children:g.label})},g.id))]})})}const jr=_t.createSvgIcon(Bt.createElement("path",{d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"}),"KeyboardArrowDown"),Kr=_t.createSvgIcon(Bt.createElement("path",{d:"M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"}),"KeyboardArrowUp");function Yr(e){const{cellsMetadata:n,isRowSelected:t,item:r,onRowSelected:s,rowIndex:i,isCollapseable:h,collapsedElement:g}=e,[f,y]=l.useState(!1),T=n.length,m=()=>{s==null||s(i)};return o.jsxs(o.Fragment,{children:[o.jsxs(se.TableRow,{hover:!0,selected:t,onClick:m,children:[h&&o.jsx(se.TableCell,{padding:"checkbox",children:o.jsx(se.IconButton,{"aria-label":"expand row",size:"small",onClick:M=>{M.stopPropagation(),y(!f)},children:f?o.jsx(Kr,{}):o.jsx(jr,{})})}),n.map(M=>o.jsx(se.TableCell,{align:M.numeric?"right":"left",padding:M.disablePadding?"none":"default",children:M.transform?M.transform(r[M.id]):r[M.id]},M.id+i.toString()))]}),h&&o.jsx(se.TableRow,{children:o.jsx(se.TableCell,{style:{paddingBottom:0,paddingTop:0},colSpan:T+1,children:o.jsx(se.Collapse,{in:f,unmountOnExit:!0,timeout:"auto",children:g==null?void 0:g(r)})})})]})}function Zr(e){const[n,t]=l.useState(""),[r,s]=l.useState("asc"),{cellsMetadata:i,items:h,onRequestSort:g,onRowSelected:f,isCollapseable:y,collapsedElement:T,isDense:m,page:M,rowsPerPage:O,count:_,handleChangePage:z,handleChangeRowsPerPage:Q}=e,$=(J,X)=>{const F=n===X&&r==="asc";s(F?"desc":"asc"),t(X),g(X,F?"desc":"asc")};return o.jsxs(se.TableContainer,{component:se.Paper,children:[o.jsxs(se.Table,{size:m?"small":"medium",children:[o.jsx(qr,{headCells:i,onRequestSort:$,order:r,orderBy:n,isCollapseable:y}),o.jsxs(se.TableBody,{children:[h.map((J,X)=>o.jsx(Yr,{item:J,rowIndex:X,isCollapseable:y,cellsMetadata:i,collapsedElement:T,isRowSelected:!1,onRowSelected:f},X)),(h.length===0||O>h.length)&&o.jsx(se.TableRow,{style:{height:(m?33:53)*(O-h.length)},children:o.jsx(se.TableCell,{colSpan:y?i.length+1:i.length,children:h.length===0&&o.jsx(se.Typography,{align:"center",children:"No results :("})})})]})]}),o.jsx(se.TablePagination,{rowsPerPage:O,rowsPerPageOptions:[5,10],component:"div",count:_,page:M,onPageChange:z,onRowsPerPageChange:Q})]})}const Xr=e=>{const{children:n,...t}=e;return o.jsx(Zn,{...t,children:n})},Jr=e=>{const{children:n,...t}=e;return o.jsx(Xn,{...t,children:n})},ln=e=>e*Math.PI/180,tt=e=>e*(180/Math.PI),Qr=e=>.05*(5916575505e-1/Math.pow(2,e-1)/2)*(Math.cos(ln(85.362/2))/Math.sin(ln(85.362/2))),Yo="",Rr=({children:e,locale:n})=>{var f;const[t,r]=l.useState(!1),[s,i]=l.useState([]),h=l.useMemo(()=>j.get(n,"DEBUG_PANEL_TITLE")??"Debugger Tool",[n]),g=ye();return l.useEffect(()=>{if(!g.layersManager)return;const y=(T,m)=>{var O;T.forEach(_=>{if(m!==void 0&&m!==_.meta.id)return;const{options:z,meta:Q}=_,{zoomLevel:$}=z,{id:J,items:X,total:F,cache:ee,currentZoomLevel:W,featureStructure:Z}=Q;i(ae=>{const a=ae.findIndex(c=>c.id===J);if(a>=0){if(JSON.stringify(ae[a])!==JSON.stringify({id:J,items:X,total:F,cache:ee,currentZoomLevel:W,featureStructure:Z,zoomLevel:$})){const c=[...ae];return c[a]={id:J,items:X,total:F,cache:ee,currentZoomLevel:W,featureStructure:Z,zoomLevel:$},c}}else return[...ae,{id:J,items:X,total:F,cache:ee,currentZoomLevel:W,featureStructure:Z,zoomLevel:$}];return ae})});const M=new Set((O=g.layersManager)==null?void 0:O.dataLayerList.map(_=>_.meta.id));i(_=>_.filter(z=>M.has(z.id)))};return g.layersManager.addDataLayerUpdatedListener(y),()=>{var T;(T=g.layersManager)==null||T.removeDataLayerUpdatedListener(y)}},[(f=g.layersManager)==null?void 0:f.dataLayerList]),o.jsxs(o.Fragment,{children:[o.jsx(Y.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)}}),t&&o.jsx("div",{className:"debugPanel",children:o.jsxs(Y.Dialog,{open:t,onClosed:()=>{r(!1)},children:[o.jsx(Y.DialogTitle,{className:"title",children:h}),o.jsx(Y.DialogContent,{children:l.Children.map(e,y=>l.isValidElement(y)?l.cloneElement(y,{featureTypes:s}):y)})]})})]})},Zo="",ei=({featureTypes:e,locale:n})=>{const t=l.useMemo(()=>j.get(n,"WFS_TITLE")??"Data Layers",[n]),r=l.useMemo(()=>j.get(n,"WFS_CACHE")??"Cache",[n]),s=l.useMemo(()=>j.get(n,"WFS_EXTENT")??"Extent",[n]),i=l.useMemo(()=>j.get(n,"NO_DATA_LAYERS")??"No layers found",[n]),h=l.useMemo(()=>o.jsx(ue,{className:"title",children:t}),[t]),g=l.useMemo(()=>o.jsx(o.Fragment,{children:e.length>0?e.map((f,y)=>o.jsxs(ue,{className:"featureType",children:[o.jsx(Y.Tooltip,{content:`${f.featureStructure.aliasLayerName} ${f.id} (${String(f.zoomLevel)})`,children:o.jsxs(ue,{className:`name ${f.currentZoomLevel<f.zoomLevel?"warning blinking":f.total===-1?"error blinking":""}`,children:[f.featureStructure.aliasLayerName," (",String(f.zoomLevel),"):"]})}),o.jsxs(ue,{className:"info",children:[o.jsxs(ue,{children:[r,": ",f.cache??0]}),f.total>0&&o.jsxs(ue,{className:"spacer",children:[s,": ",f.items," / ",f.total]})]})]},y)):o.jsx(ue,{children:i})}),[e]);return o.jsxs(ue,{className:"wfsContainer",children:[h,g]})},cn=(e,n,t)=>{let r;if(e.scene.mode!==u.SceneMode.SCENE2D)r=e.scene.pickPosition(new u.Cartesian2(n,t));else{const s=e.scene.globe.ellipsoid;r=e.camera.pickEllipsoid(new u.Cartesian2(n,t),s)}return u.Cartographic.fromCartesian(r)},ti=(e,n,t)=>{const r=cn(e,n,t);return{type:"Feature",properties:{},geometry:{type:"Point",coordinates:[u.Math.toDegrees(r.longitude),u.Math.toDegrees(r.latitude)]}}},dn=(e,n,t)=>{try{const r=cn(e,n,t);return{longitude:u.Math.toDegrees(r.longitude),latitude:u.Math.toDegrees(r.latitude)}}catch{return}},Ie=document.createElement("canvas"),Ce=Ie.getContext("2d"),un=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},ni=async(e,n)=>(n&&n.tileTransparencyCheckedCounter++,new Promise((t,r)=>{try{Ce==null||Ce.clearRect(0,0,Ie.width,Ie.height);let s;if(e instanceof HTMLImageElement)s=e;else if(e instanceof ImageBitmap){Ie.width=e.width,Ie.height=e.height,Ce==null||Ce.drawImage(e,0,0);const i=Ce==null?void 0:Ce.getImageData(0,0,Ie.width,Ie.height),h=un(i);h&&n&&(n.tileTransparencyCheckedCounter=n.maxTilesForTransparencyCheck),t(h);return}else s=new Image,s.crossOrigin="anonymous",s.src=e;s.onload=()=>{Ie.width=s.width,Ie.height=s.height,Ce==null||Ce.drawImage(s,0,0);const i=Ce==null?void 0:Ce.getImageData(0,0,Ie.width,Ie.height);un(i)?(n&&(n.tileTransparencyCheckedCounter=n.maxTilesForTransparencyCheck),t(!0)):t(!1)}}catch(s){console.error("Could not determine image transparency. Error => ",s),r(s)}})),nt=(e,n)=>{const{west:t,east:r,north:s,south:i}=e,{west:h,east:g,north:f,south:y}=n;return t>=h&&r<=g&&s<=f&&i>=y},ri=(e,n)=>Rn(e,Ze(n)),ii=e=>{const n=(u.Math.toDegrees(e.west)+u.Math.toDegrees(e.east))/2,t=(u.Math.toDegrees(e.south)+u.Math.toDegrees(e.north))/2;return Dt.point([n,t])},oi=e=>[u.Math.toDegrees(e.west),u.Math.toDegrees(e.south),u.Math.toDegrees(e.east),u.Math.toDegrees(e.north)],si=e=>{const n=e.scene;let r=e.camera.computeViewRectangle(n.globe.ellipsoid);if(!u.defined(r)||!r){console.error("cesium native computeViewRectangle returned invalid rectangle, fallback to custom calculation ");const s=new u.Cartesian2(0,0),i=n.camera.pickEllipsoid(s,n.globe.ellipsoid),h=new u.Cartesian2(n.canvas.width,n.canvas.height),g=n.camera.pickEllipsoid(h,n.globe.ellipsoid),f=n.globe.ellipsoid.cartesianToCartographic(i),y=n.globe.ellipsoid.cartesianToCartographic(g);r=new u.Rectangle(f.longitude,y.latitude,y.longitude,f.latitude)}return r},ai=(e,n=100)=>{const t=e.scene,r=e.camera,s=t.mode,i=si(e);if(!u.defined(i)||!i){console.error("customComputeViewRectangle returned invalid rectangle.");return}if(s===u.SceneMode.SCENE2D)return i;const h=r.positionCartographic;if(!u.defined(h)){console.error("Camera position is undefined in 3D mode.");return}const g=h.latitude,f=h.longitude;if(g<-u.Math.PI_OVER_TWO||g>u.Math.PI_OVER_TWO||f<-u.Math.PI||f>u.Math.PI){console.error("Invalid latitude or longitude values.");return}const y=111320,T=111320*Math.cos(g);let m=n/y,M=n/T;const O=u.Cartesian3.magnitude(r.positionWC);O>1e7&&(m=10,M=10);const _=r.frustum instanceof u.PerspectiveFrustum?r.frustum.fov:Math.PI/3;let z=1;O<5e5?z=.05:O<2e6&&(z=.1),m*=z*(_/Math.PI),M*=z*(_/Math.PI);const Q=r.pitch;if(Q===void 0)return;const $=Math.PI/4,J=Math.max(0,1-Math.abs(Q)/$);m*=J,M*=J;const X=5e-4;m=Math.max(m,X),M=Math.max(M,X);const F=h.latitude-m,ee=h.latitude+m,W=h.longitude-M,Z=h.longitude+M,ae=u.Math.clamp(F,i.south,i.north),a=u.Math.clamp(ee,i.south,i.north),c=u.Math.clamp(W,i.west,i.east),w=u.Math.clamp(Z,i.west,i.east),p=Math.min(1,Q/u.Math.PI_OVER_TWO),C=i.north-(i.north-i.south)*p,v=Math.min(a,C);return new u.Rectangle(u.Math.negativePiToPi(c),u.Math.clamp(ae,-u.Math.PI_OVER_TWO,u.Math.PI_OVER_TWO),u.Math.negativePiToPi(w),u.Math.clamp(v,-u.Math.PI_OVER_TWO,u.Math.PI_OVER_TWO))},rt=3,it="hasTransparency";function ft(e,n,t,r,s){return setTimeout(()=>{var g;const i=(g=this.layerListInstance.find(f=>{var y,T;return((y=f._imageryProvider._resource)==null?void 0:y._url)===((T=this._resource)==null?void 0:T._url)}))==null?void 0:g.meta,h=j.get(i,it)===!0;this.tileTransparencyCheckedCounter<rt&&!h&&ni(s==null?void 0:s.url,this).then(f=>{var y;(y=this.mapViewer.layersManager)==null||y.addMetaToLayer({[it]:f},T=>T._imageryProvider._resource._url===this._resource._url)})},0),e(n,t,r,s)}class hn extends u.UrlTemplateImageryProvider{constructor(t,r){var s;super(t);de(this,"layerListInstance");de(this,"mapViewer");de(this,"maxTilesForTransparencyCheck",rt);de(this,"tileTransparencyCheckedCounter",0);this.layerListInstance=(s=r.layersManager)==null?void 0:s.layerList,this.mapViewer=r}requestImage(t,r,s,i){return ft.call(this,super.requestImage.bind(this),t,r,s,i)}}class gn extends u.WebMapServiceImageryProvider{constructor(t,r){var s;super(t);de(this,"layerListInstance");de(this,"mapViewer");de(this,"maxTilesForTransparencyCheck",rt);de(this,"tileTransparencyCheckedCounter",0);this.layerListInstance=(s=r.layersManager)==null?void 0:s.layerList,this.mapViewer=r}requestImage(t,r,s,i){return ft.call(this,super.requestImage.bind(this),t,r,s,i)}}class pn extends u.WebMapTileServiceImageryProvider{constructor(t,r){var s;super(t);de(this,"layerListInstance");de(this,"mapViewer");de(this,"maxTilesForTransparencyCheck",rt);de(this,"tileTransparencyCheckedCounter",0);this.layerListInstance=(s=r.layersManager)==null?void 0:s.layerList,this.mapViewer=r}requestImage(t,r,s,i){return ft.call(this,super.requestImage.bind(this),t,r,s,i)}}const li=1,ci=-1,fn="TRANSPARENT_BASE_LAYER";class di{constructor(n,t,r,s,i){de(this,"mapViewer");de(this,"legendsList");de(this,"layerUpdated");de(this,"dataLayerUpdated");de(this,"layers");de(this,"dataLayers");de(this,"legendsExtractor");de(this,"layerManagerFootprintMetaFieldPath");de(this,"shouldOptimizedTileRequests");this.mapViewer=n,this.layers=this.mapViewer.imageryLayers._layers,this.dataLayers=[],this.legendsList=[],this.legendsExtractor=t,this.layerUpdated=new u.Event,this.dataLayerUpdated=new u.Event,this.layerManagerFootprintMetaFieldPath=s,this.shouldOptimizedTileRequests=i??!1,r&&this.layerUpdated.addEventListener(r,this),this.shouldOptimizedTileRequests&&(this.layerUpdated.addEventListener(h=>{const g=Object.keys(h);g.length===1&&g[0]===it&&(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.shouldOptimizedTileRequests&&(this.removeLayer(fn),this.addTransparentImageryProvider())}addRasterLayer(n,t,r){let s;switch(n.type){case"XYZ_LAYER":{const i=n.options,h=this.shouldOptimizedTileRequests?new hn(i,this.mapViewer):new u.UrlTemplateImageryProvider(i);s=this.mapViewer.imageryLayers.addImageryProvider(h,t);break}case"WMS_LAYER":{const i=n.options,h=this.shouldOptimizedTileRequests?new gn(i,this.mapViewer):new u.WebMapServiceImageryProvider(i);s=this.mapViewer.imageryLayers.addImageryProvider(h,t);break}case"WMTS_LAYER":{const i=n.options,h=this.shouldOptimizedTileRequests?new pn(i,this.mapViewer):new u.WebMapTileServiceImageryProvider(i);s=this.mapViewer.imageryLayers.addImageryProvider(h,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=>!!j.get(t.meta,"parentBasetMapId")).forEach(t=>{this.mapViewer.imageryLayers.remove(t,!0)})}removeNotBaseMapLayers(){this.layers.filter(t=>!j.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(),h=this.mapViewer.imageryLayers.indexOf(r);if(h-t<=i&&(t=h-i),r)for(let g=0;g<t;g++)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=>!j.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=>!j.get(i.meta,"parentBasetMapId"))),r}findLayerByPOI(n,t,r=!0){if(this.layerManagerFootprintMetaFieldPath){const s=ti(this.mapViewer,n,t);return this.layers.filter(g=>!j.get(g.meta,"parentBasetMapId")).filter(g=>{const f=j.get(g.meta,this.layerManagerFootprintMetaFieldPath);return f!==void 0?Qn(s.geometry,{type:"Feature",properties:{},geometry:f})&&(r?g.show:!0):(console.warn("[LayerManager] [findLayerByPOI] CesiumImageryLayer has no defined footprint",g.meta),!1)}).sort((g,f)=>{var y,T;return((y=f.meta)==null?void 0:y.zIndex)-((T=g.meta)==null?void 0:T.zIndex)})}else return console.warn("[LayerManager] [findLayerByPOI]layerManagerFootprintMetaFieldPath is not defined"),[]}addTransparentImageryProvider(){const n=this.mapViewer.imageryLayers.addImageryProvider(new u.SingleTileImageryProvider({url:"./assets/img/transparent-tile.png",rectangle:new u.Rectangle(-3.141592653589793,-1.5707963267948966,3.141592653589793,1.5707963267948966)}),0);n.meta={id:fn,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=>!!j.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?li:ci,i=t<r?t:r,h=t<r?r:t;this.layers.forEach(g=>{var y;if(!j.get(g.meta,"parentBasetMapId")){const T=(y=g.meta)==null?void 0:y.zIndex;g.meta.zIndex=T>=i&&T<=h&&T!==t?T+s:T===t?r:T}})}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],h=!j.isEmpty(r)&&!j.isEmpty(i.rectangle)&&u.Rectangle.intersection(r,i.rectangle);for(let g=this.layers.length-1;g>=s;g--){if(((n=i.meta)==null?void 0:n.skipRelevancyCheck)===!0){i.meta={...i.meta,relevantToExtent:!0};continue}const f=this.layers[g],y=((t=f.meta)==null?void 0:t[it])===!0;if(i!==f)if(h instanceof u.Rectangle){if(nt(r,i.rectangle))if(nt(r,f.rectangle)&&!y){i.meta={...i.meta??{},relevantToExtent:!1};break}else i.meta={...i.meta??{},relevantToExtent:!0};if(nt(r,f.rectangle)&&!y){i.meta={...i.meta??{},relevantToExtent:!1};break}if(nt(i.rectangle,f.rectangle)){if(i.meta={...i.meta??{},relevantToExtent:y},!y)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:h instanceof u.Rectangle})}}}catch(r){console.error(r)}}}const Xo="",ui=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"})]})}),hi=({onClick:e})=>o.jsx(ue,{onClick:e,className:"mapLegendToggleContainer",children:o.jsx(Y.Icon,{icon:ui,className:"mapLegendIcon"})}),gi=({legend:{legendImg:e,legendDoc:n,layer:t},docText:r,imgText:s})=>{const i=l.useCallback(()=>{window.open(e,"_blank")},[e]);l.useCallback(()=>{window.open(n,"_blank")},[n]);const h=l.useCallback(()=>{const y=o.jsx(ue,{className:"layerNameContainer",children:o.jsx("h3",{style:{maxWidth:`${15}ch`},className:"layerName",children:t})});return(t??"").length>15?o.jsx(Y.Tooltip,{content:t,children:y}):y},[t]),g=l.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(ue,{className:"mapLegend",children:[h(),o.jsx("img",{alt:"Map Legend",className:"legendImg",src:e,onClick:i}),o.jsx(ue,{className:"legendActionsContainer",children:g()})]})},pi=({legends:e,actionsTexts:{docText:n,imgText:t},noLegendsText:r})=>{const s=l.useCallback(()=>o.jsx(ue,{className:"noLegendsContainer",children:o.jsx("h2",{className:"noLegendsMsg",children:r})}),[r]),i=l.useCallback(()=>e.length?e.map((h,g)=>o.jsx(gi,{legend:h,docText:n,imgText:t},`${h.layer}_${g}`)):s(),[e]);return o.jsx(ue,{className:"mapLegendsList",children:i()})},fi=({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(Y.Drawer,{className:"mapLegendSidebarContainer",modal:!1,dismissible:!0,open:e,children:[o.jsx(Y.DrawerHeader,{className:"sidebarHeaderContainer",children:o.jsx(Y.DrawerTitle,{className:"sidebarTitle",children:t})}),o.jsxs(Y.DrawerContent,{className:"sidebarContent",children:[o.jsx(Y.Icon,{onClick:n,className:"mapLegendCloseBtn",icon:{icon:"close",size:"small"}}),o.jsx(pi,{noLegendsText:r,legends:i,actionsTexts:s})]})]}):null;class mi extends u.PolylineDashMaterialProperty{}class yi extends u.ConstantProperty{}class vi extends u.ConstantPositionProperty{}class Ei extends u.Cartesian2{}class wi extends u.Cartesian3{}class mn extends u.Cartographic{}class Si extends u.BoundingSphere{}class Ti extends u.Ellipsoid{}class Ci extends u.GeographicTilingScheme{}class Li extends u.Rectangle{}class Mi extends u.Resource{}class bi extends u.EllipsoidTerrainProvider{}class Pi extends u.CesiumTerrainProvider{}class _i extends u.PolylineGraphics{}class Di extends u.JulianDate{}class Ii extends u.PositionProperty{}class Oi extends u.BillboardGraphics{}class Ai extends u.Color{}class ki extends u.PolygonHierarchy{}class xi extends u.Scene{}const Ni=u.VerticalOrigin,Bi=u.HorizontalOrigin,we=u.SceneMode,Fi=u.LabelStyle,Vi=u.HeightReference,Jo="",Gi=Oe.makeStyles(e=>Oe.createStyles({mapContainer:{width:"60px",height:"60px",border:`${e.palette.background.paper} 2px solid`}})),Hi=e=>{const n=ye(),{baseMaps:t}=e,[r,s]=l.useState(" "),[i,h]=l.useState(),g=Gi();l.useEffect(()=>{const y=t==null?void 0:t.maps.find(T=>T.isCurrent);y&&(h(y),s(y.title!==void 0?y.title:" "))},[t]);const f=y=>{var T,m;if(t){(T=n.layersManager)==null||T.removeBaseMapLayers();const M=t.maps.find(O=>O.id===y);M&&((m=n.layersManager)==null||m.setBaseMapLayers(M),h(M),t.maps.forEach(O=>{O.isCurrent=M===O}))}};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(y=>o.jsx("li",{className:`mapContainer ${g.mapContainer} ${y===i?"mapContainerSelected":""}`,children:o.jsx("img",{alt:"",className:"mapContainerImg",src:y.thumbnail,onMouseOver:()=>{s(y.title)},onMouseOut:()=>{s((i==null?void 0:i.title)!==void 0?i.title:" ")},onClick:()=>{f(y.id)}})},y.id))})]})},Qo="",Wi=-1,zi=e=>{const n=ye(),[t,r]=l.useState(we.SCENE2D),{sceneModes:s}=e,i=h=>s.findIndex(g=>g===h)>Wi;return l.useEffect(()=>{r(n.scene.mode)},[]),o.jsxs(o.Fragment,{children:[i(we.SCENE3D)&&o.jsx(Y.Icon,{icon:o.jsx("div",{className:`mapViewIcon ${t===we.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(we.SCENE3D)}}),i(we.SCENE2D)&&o.jsx(Y.Icon,{icon:o.jsx("div",{className:`mapViewIcon ${t===we.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(we.SCENE2D)}}),i(we.COLUMBUS_VIEW)&&o.jsx(Y.Icon,{icon:o.jsx("div",{className:`mapViewIcon ${t===we.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(we.COLUMBUS_VIEW)}})]})},Ro="",mt="ic_settings_24px",$i=e=>{const[n,t]=l.useState(!1),{sceneModes:r,baseMaps:s,locale:i}=e,h=l.useRef(null),g=j.get(i,"MAP_SETTINGS_DIALOG_TITLE")??"Map Settings",f=j.get(i,"MAP_SETTINGS_SCENE_MODE_TITLE")??"Scene Mode",y=j.get(i,"MAP_SETTINGS_BASE_MAP_TITLE")??"Base Map";return l.useEffect(()=>{const T=m=>{var _;const M=m.target,O=j.get(h,"current");O&&!O.contains(M)&&M.id!==mt&&((_=M.parentElement)==null?void 0:_.id)!==mt&&(document.removeEventListener("click",T,!1),t(!1))};return document.addEventListener("click",T,!1),()=>{document.removeEventListener("click",T,!1)}}),o.jsxs(o.Fragment,{children:[o.jsx(Y.Icon,{icon:o.jsx("div",{className:"settingsIconContainer",children:o.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 24 24",id:mt,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:h,children:o.jsxs(Y.Dialog,{open:n,onClosed:()=>{t(!1)},children:[o.jsx(Y.DialogTitle,{children:g}),o.jsxs(Y.DialogContent,{children:[o.jsx("h4",{className:"sectionLabel",children:f}),o.jsx(ue,{className:"mapScenesContainer",children:o.jsx(zi,{sceneModes:r})}),o.jsx(ue,{className:"baseMapsContainer",children:s&&o.jsxs(o.Fragment,{children:[o.jsx("h4",{className:"sectionLabel",children:y}),o.jsx(Hi,{baseMaps:s})]})})]})]})})]})},es="",Ui=e=>{const n=ye(),{enableCompass:t=!0,enableZoomControls:r=!1,lockCompassNavigation:s=!1,locale:i={DIRECTION:"ltr"}}=e;return l.useEffect(()=>{if(typeof j.get(n,"cesiumNavigation")>"u"){n.extend(er,{enableCompass:t,enableZoomControls:r,enableDistanceLegend:!1}),n.cesiumNavigation.setNavigationLocked(s);const h=document.querySelector(".compass");h&&i.DIRECTION&&h.classList.add(i.DIRECTION)}},[n,t,r,i.DIRECTION,s]),null},ts="",yn=e=>{const n=ye(),t=l.useRef(null),[r,s]=l.useState({x:0,y:0});return l.useEffect(()=>{n.screenSpaceEventHandler.setInputAction(i=>{if(i!=null&&i.endPosition){const h={...i.endPosition};h.x=Math.ceil(h.x),h.y=Math.ceil(h.y),s(h)}},u.ScreenSpaceEventType.MOUSE_MOVE)},[t,n]),l.useEffect(()=>{const i=n.scene.globe.ellipsoid;if(r){const h=dn(n,r.x,r.y);if(h){const g=new mn(h.longitude,h.latitude);if(t.current){let f="";switch(e.projection){case _e.WEB_MERCATOR:{const T=new u.WebMercatorProjection(i).project(g);f=`Mercator: ${T.y.toFixed(et)}m, ${T.x.toFixed(et)}m`,t.current.style.width="220px";break}case _e.WGS84:{const y=g.longitude.toFixed(Re);f=`WGS84: ${g.latitude.toFixed(Re)}°N ${y}°E`,t.current.style.width="200px";break}}t.current.innerHTML=f}}}},[r,t,n,e.projection]),o.jsx("div",{className:"trackerPosition",ref:t})},ns="",yt=[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],qi=(e,n,t,r)=>{const s=j.get(r,"METERS_UNIT")??"m",i=j.get(r,"KILOMETERS_UNIT")??"km",h={barWidth:void 0,distanceLabel:void 0,lastLegendUpdate:n.lastLegendUpdate},g=new u.EllipsoidGeodesic,f=new Date().getTime();if(f<h.lastLegendUpdate+250)return;h.lastLegendUpdate=f;const y=e.scene.canvas.clientWidth,T=e.scene.canvas.clientHeight,m=e.scene.camera.getPickRay(new u.Cartesian2(y/2|0,T-1)),M=e.scene.camera.getPickRay(new u.Cartesian2(1+y/2|0,T-1)),O=e.scene.globe,_=O.pick(m,e.scene),z=O.pick(M,e.scene);if(!_||!z)return;const Q=O.ellipsoid.cartesianToCartographic(_),$=O.ellipsoid.cartesianToCartographic(z);g.setEndPoints(Q,$);const J=g.surfaceDistance,X=100;let F;for(let ee=yt.length-1;!j.isNumber(F)&&ee>=0;--ee)yt[ee]/J<X&&(F=yt[ee]);if(j.isNumber(F)){let ee="";F>=1e3?ee=`${(F/1e3).toString()} ${i}`:ee=`${F.toString()} ${s}`,h.barWidth=F/J|0,h.distanceLabel=ee}t(h)},vn=e=>{const n=ye(),[t,r]=l.useState({barWidth:void 0,distanceLabel:void 0,lastLegendUpdate:-1});l.useEffect(()=>{const i=f=>{qi(n,t,r,e.locale)},h=new u.EventHelper,g=f=>{n.scene.globe.tilesLoaded&&(i(new MouseEvent("mouse")),h.removeAll())};return h.add(n.scene.globe.tileLoadProgressEvent,g),n.camera.moveEnd.addEventListener(i),()=>{try{j.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:j.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`}})]})})},rs="",En=(e,n)=>{const r=j.get(n.scene.globe,"_surface.tileProvider"),s=r._quadtree,i=n.canvas.height,h=j.get(n.camera.frustum,"sseDenominator")??1;for(let g=0;g<=19;g++)if(r.getLevelMaximumGeometricError(g)*i/(e*h)<s.maximumScreenSpaceError)return g;return null},ji=(e,n)=>{e=e||10;const t=[];let r=1e5,s=0;for(let i=1e8;i>r;i=i-r){const h=En(i,n);if(h===null)break;if(h!==s){let g=i,f=i+r;for(;f-g>e;)i=g+(f-g)/2,En(i,n)===h?g=i:f=i;t.push({level:h,height:Math.round(i)}),s=h,t.length>=2&&(r=(t[t.length-2].height-i)/1e3)}}return t},wn=({locale:e=void 0,valueBy:n="RENDERED_TILES"})=>{const t=ye(),r=We(),[s,i]=l.useState(1),h=ji(1,t),g=l.useCallback(()=>{const m=t.camera,M=.5;let O=0;switch(t.scene.mode){case we.SCENE3D:O=t.scene.mapProjection.ellipsoid.cartesianToCartographic(m.positionWC).height;break;case we.SCENE2D:O=(m.frustum.right-m.frustum.left)*M;break;case we.COLUMBUS_VIEW:O=m.position.z;break;default:O=0;break}if(h.length>0){const _=h.reduce((z,Q)=>Math.abs(Q.height-O)<Math.abs(z.height-O)?Q:z);i(_.level),r.setViewState&&r.setViewState(z=>({...z,currentZoomLevel:_.level}))}},[t,h]),f=l.useCallback(()=>{let m=0;t.scene.globe._surface.forEachRenderedTile(function(M){m=Math.max(m,M.level)}),i(m),r.setViewState&&r.setViewState(M=>({...M,currentZoomLevel:m}))},[t]),T=l.useMemo(()=>({CALCULATION:g,RENDERED_TILES:f}),[g,f])[n];return l.useEffect(()=>{const m=t.scene.globe.tileLoadProgressEvent.addEventListener(function(){t.scene.globe.tilesLoaded&&T()});return t.camera.moveEnd.addEventListener(T),()=>{try{typeof j.get(t,"_cesiumWidget")<"u"&&(t.camera.moveEnd.removeEventListener(T),m())}catch(M){console.log('CESIUM camera "moveEnd"(from zoom tracker) remove listener failed',M)}}},[t,T]),o.jsxs("div",{className:"zoomLevel",children:[o.jsx("div",{className:"zoomLevelValue",children:s}),o.jsx("div",{className:"zoomLevelLabel",children:j.get(e,"ZOOM_LABEL")??"zoom"})]})},is="",Ki=()=>{const e=ye(),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(Y.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))})},os="",Sn=212,Tn=260,Yi=0;class Zi extends u.Viewer{constructor(t,r){super(t,r);de(this,"layersManager")}}const vt=l.createContext(null),Xi=vt.Provider,ye=()=>{const e=l.useContext(vt);if(e===null)throw new Error("map context is null, please check the provider");return e.mapViewer},We=()=>{const{mapViewer:e,...n}=l.useContext(vt);if(n===null)throw new Error("map context viewstate is null, please check the provider");return n},Ji=e=>{var b,P,N,G,V,K,oe,ve;const n=l.useRef(null),[t,r]=l.useState(),[s,i]=l.useState(),[h,g]=l.useState(),[f,y]=l.useState(),[T,m]=l.useState(),[M,O]=l.useState(),[_,z]=l.useState(),[Q,$]=l.useState(!1),[J,X]=l.useState(!1),[F,ee]=l.useState(),W=l.useRef(),[Z,ae]=l.useState(),[a,c]=l.useState([]),[w,p]=l.useState(),[C,v]=l.useState(!1),L=l.useRef(),[E,D]=l.useState(void 0),[k,A]=l.useState(!1),[I,x]=l.useState(),[B,ie]=l.useState(),le=l.useMemo(()=>Q||J,[Q,J]),[U,re]=l.useState();l.useEffect(()=>{re({currentZoomLevel:-1,shouldOptimizedTileRequests:e.useOptimizedTileRequests??!1})},[]);const pe={fullscreenButton:!0,timeline:!1,animation:!1,baseLayerPicker:!1,geocoder:!1,navigationHelpButton:!1,homeButton:!1,sceneModePicker:!1,imageryProvider:!1,...e},fe=(q,te,H,ne,me)=>{const he=t.container,ce=he.clientWidth,Ee=he.clientHeight,Le=ne+me;return{left:`${ce-q<H?q-(H-(ce-q)):q}px`,top:`${Ee-te<Le?te-(Le-(Ee-te)):te}px`}},Ae=l.useCallback(q=>{if(n.current!==null){const te=n.current.cesiumElement,H={x:q.offsetX,y:q.offsetY};v(!1),D(H),x(dn(te,H.x,H.y)),v(!0),L.current=q}},[n]);l.useEffect(()=>{var q;if(n.current!==null){const te=n.current.cesiumElement;e.imageryContextMenu&&(te.scene.canvas.removeEventListener("contextmenu",Ae),te.scene.canvas.addEventListener("contextmenu",Ae))}r((q=n.current)==null?void 0:q.cesiumElement)},[n,e.imageryContextMenu]);const Pe=l.useMemo(()=>{var q;if(t)return{mapViewer:t.layersManager?t:Object.assign(t,{layersManager:new di(t,(q=e.legends)==null?void 0:q.mapLegendsExtractor,()=>{var H;c((H=t.layersManager)==null?void 0:H.legendsList)},e.layerManagerFootprintMetaFieldPath,U==null?void 0:U.shouldOptimizedTileRequests)}),viewState:U,setViewState:re}},[e.useOptimizedTileRequests,e.legends,e.layerManagerFootprintMetaFieldPath,t,U]);l.useEffect(()=>{ae(e.sceneModes??[we.SCENE2D,we.SCENE3D,we.COLUMBUS_VIEW])},[e.sceneModes]),l.useEffect(()=>{var te,H;p(e.baseMaps);const q=(te=e.baseMaps)==null?void 0:te.maps.find(ne=>ne.isCurrent);q&&t&&((H=t.layersManager)==null||H.setBaseMapLayers(q))},[e.baseMaps,t]),l.useEffect(()=>{i(e.projection??_e.WGS84)},[e.projection]),l.useEffect(()=>{ee(e.locale)},[e.locale]),l.useEffect(()=>{g(e.showMousePosition??!0)},[e.showMousePosition]),l.useEffect(()=>{y(e.showZoomLevel??!0)},[e.showZoomLevel]),l.useEffect(()=>{m(e.showScale??!0)},[e.showScale]),l.useEffect(()=>{O(e.showCompass??!0)},[e.showCompass]),l.useEffect(()=>{z(e.showLoadingProgress??!0)},[e.showLoadingProgress]),l.useEffect(()=>{var te;const q=()=>{if(t===void 0)return{longitude:0,latitude:0,height:0};const H=()=>{const ne=t.camera.positionCartographic;return{longitude:tt(ne.longitude),latitude:tt(ne.latitude),height:ne.height}};if(t.scene.mode===u.SceneMode.SCENE3D){const ne=new u.Cartesian2(t.container.clientWidth/2,t.container.clientHeight/2),me=t.scene.camera.getPickRay(ne),he=t.scene.globe.pick(me,t.scene);if(!he)return{longitude:0,latitude:0,height:0};const ce=t.scene.globe.ellipsoid.cartesianToCartographic(he);return ce!==void 0?{longitude:tt(ce.longitude),latitude:tt(ce.latitude),height:t.scene.camera.positionCartographic.height}:H()}else return H()};t&&(t.camera.moveEnd.addEventListener(()=>{if(t.scene.mode!==u.SceneMode.MORPHING){const H=t.camera,ne={position:q(),direction:H.direction.clone(),up:H.up.clone(),right:H.right.clone(),transform:H.transform.clone(),frustum:H.frustum.clone()};W.current=ne}}),_&&(t.scene.globe.tileLoadProgressEvent.addEventListener(function(){t.scene.globe.tilesLoaded?$(!1):$(!0)}),(te=t.layersManager)==null||te.addDataLayerUpdatedListener(()=>{var ne;let H=!1;(ne=t.layersManager)==null||ne.dataLayerList.forEach(me=>{if(typeof me.meta.items=="number"&&typeof me.meta.total=="number"&&me.meta.items>0&&me.meta.items<me.meta.total){H=!0;return}}),X(H)})))},[t]),l.useEffect(()=>{const q=()=>{if(t&&W.current){const te=W.current;t.camera.flyTo({destination:u.Cartesian3.fromDegrees(te.position.longitude,te.position.latitude,te.position.height),duration:0})}};return t&&t.scene.morphComplete.addEventListener(q),()=>{if(t)try{t.scene.morphComplete.removeEventListener(q)}catch{console.error("morphCompleteHandler event not cleaned")}}},[t]),l.useEffect(()=>{const q=e.zoom,te=e.center;t&&j.isNumber(q)&&j.isArray(te)&&t.camera.flyTo({destination:u.Cartesian3.fromDegrees(te[0],te[1],Qr(q)),duration:0})},[e.zoom,e.center,t]),l.useEffect(()=>{ie(e.displayZoomButtons??!0)},[e.displayZoomButtons]);const Se=l.useCallback(()=>t&&Jn.createPortal(o.jsxs(o.Fragment,{children:[_&&le&&o.jsx(Y.LinearProgress,{style:{position:"absolute",top:0,height:"10px",zIndex:4}}),o.jsxs(ue,{className:"sideToolsContainer",children:[e.debugPanel&&o.jsx(Rr,{locale:F,children:e.debugPanel.wfs&&o.jsx(ei,{locale:F,featureTypes:[]})}),o.jsx($i,{sceneModes:Z,baseMaps:w,locale:F}),o.jsx(hi,{onClick:()=>A(!k)})]}),o.jsxs(ue,{className:"toolsContainer",children:[h&&o.jsx(yn,{projection:s}),f&&o.jsx(wn,{locale:F,valueBy:"RENDERED_TILES"}),T&&o.jsx(vn,{locale:F}),M&&o.jsx(Ui,{locale:F})]}),B&&o.jsx(Ki,{})]}),document.querySelector(".cesium-viewer")),[w,F,t,s,Z,h,T,k,le]);return o.jsx(De.Viewer,{className:"viewer",full:!0,ref:n,...pe,children:o.jsxs(Xi,{value:Pe,children:[o.jsx(fi,{title:(b=e.legends)==null?void 0:b.title,isOpen:k,toggleSidebar:()=>A(!k),noLegendsText:(P=e.legends)==null?void 0:P.emptyText,legends:((N=e.legends)==null?void 0:N.legendsList)??a,actionsTexts:(G=e.legends)==null?void 0:G.actionsTexts}),e.children,Se(),e.imageryContextMenu&&C&&E&&I&&l.cloneElement(e.imageryContextMenu,{data:(V=t==null?void 0:t.layersManager)==null?void 0:V.findLayerByPOI(E.x,E.y,!1),position:{x:E.x,y:E.y},coordinates:I,style:fe(E.x,E.y,((K=e.imageryContextMenuSize)==null?void 0:K.width)??Tn,((oe=e.imageryContextMenuSize)==null?void 0:oe.height)??Sn,((ve=e.imageryContextMenuSize)==null?void 0:ve.dynamicHeightIncrement)??Yi),size:e.imageryContextMenuSize??{height:Sn,width:Tn},handleClose:()=>{v(!C)},contextEvt:L.current})]})})},Qi=0,Ri=e=>{const n=ye();return o.jsx(De.Cesium3DTileset,{...e,onReady:t=>{e.isZoomTo===!0&&n.zoomTo(t);const r=n.scene;r.globe.depthTestAgainstTerrain=!0;const s=u.Cartographic.fromCartesian(t.boundingSphere.center),i=e.heightFromGround??Qi;if(i){const h=u.Cartesian3.fromRadians(s.longitude,s.latitude,s.height),g=u.Cartesian3.fromRadians(s.longitude,s.latitude,s.height+i),f=u.Cartesian3.subtract(g,h,new u.Cartesian3);t.modelMatrix=u.Matrix4.fromTranslation(f)}}})},ot=180,Cn=.001,Ln=e=>Math.abs(e)/e,Mn=e=>{ot-Math.abs(e[0])<Cn&&(e[0]=Ln(e[0])*(ot-1)),ot/2-Math.abs(e[1])<Cn&&(e[1]=Ln(e[1])*(ot/2-1))},bn=e=>{switch(e.type){case"LineString":e.coordinates.forEach(n=>{Mn(n)});break;case"Polygon":e.coordinates.forEach(n=>{n.forEach(t=>{Mn(t)})});break}},eo=e=>{const{data:n,...t}=e,r=j.cloneDeep(n);return r&&(typeof r.features<"u"?r.features.forEach(s=>{bn(s.geometry)}):bn(r)),o.jsx(De.GeoJsonDataSource,{data:r,...t})},je=e=>{const{meta:n,...t}=e,r=ye();return l.useLayoutEffect(()=>{var s;(s=r.layersManager)==null||s.addMetaToLayer(n,n.searchLayerPredicate)},[n,r]),o.jsx(De.ImageryLayer,{...t})},to=e=>{const{options:n,...t}=e,r=ye(),{viewState:s}=We(),i=l.useMemo(()=>s.shouldOptimizedTileRequests?new gn(n,r):new u.WebMapServiceImageryProvider(n),[s.shouldOptimizedTileRequests]);return o.jsx(je,{...t,imageryProvider:i})},no=e=>{const{options:n,...t}=e,r=ye(),{viewState:s}=We(),i=l.useMemo(()=>s.shouldOptimizedTileRequests?new pn(n,r):new u.WebMapTileServiceImageryProvider(n),[s.shouldOptimizedTileRequests]);return o.jsx(je,{...t,imageryProvider:i})},ro=e=>{const{options:n,...t}=e,r=ye(),{viewState:s}=We(),i=l.useMemo(()=>s.shouldOptimizedTileRequests?new hn(n,r):new u.UrlTemplateImageryProvider(n),[s.shouldOptimizedTileRequests]);return o.jsx(je,{...t,imageryProvider:i})},io=e=>{const{options:n,...t}=e;return o.jsx(je,{...t,imageryProvider:new u.OpenStreetMapImageryProvider(n)})},oo="#FFFF00",so=e=>{const{options:n,meta:t,visualizationHandler:r}=e,{url:s,featureType:i,style:h,pageSize:g,zoomLevel:f,maxCacheSize:y,keyField:T,labeling:m}=n,{color:M,hover:O}=h,_=ye(),z=We(),Q=l.useRef(z.viewState),$=l.useRef(new Map),J=l.useRef(new Set),X=l.useRef(0),[F,ee]=l.useState(t),W=l.useMemo(()=>u.Color.fromCssColorString(O??"#24AEE9").withAlpha(.5),[O]),Z=l.useMemo(()=>`wfs_${i}_${It.v4()}`,[i]),ae=l.useRef(!1);l.useEffect(()=>{Q.current=z.viewState},[z.viewState]);const a=new u.GeoJsonDataSource(Z),c=b=>{const P=[],N=t.featureStructure;if(N&&N.fields)for(const V of N.fields){const{fieldName:K,aliasFieldName:oe}=V,ve=oe,q=b[K]??"N/A";P.push(`
1
+ (function(u,i){typeof exports=="object"&&typeof module<"u"?i(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/bbox"),require("@turf/invariant"),require("@turf/area"),require("@turf/bbox-polygon"),require("@turf/centroid"),require("@turf/helpers"),require("@turf/intersect"),require("@turf/point-to-polygon-distance"),require("@map-colonies/react-core/dist/list/styles"),require("@map-colonies/react-core/dist/textfield/styles"),require("@turf/boolean-point-in-polygon"),require("@cmcleese/cesium-navigation"),require("@cmcleese/cesium-navigation/dist/index.css"),require("@map-colonies/react-core/dist/linear-progress/styles"),require("@map-colonies/react-core/dist/checkbox/styles"),require("p-map"),require("uuid"),require("@turf/boolean-valid"),require("textarea-caret"),require("get-input-selection"),require("chonky"),require("chonky-icon-fontawesome"),require("filesize"),require("react-select"),require("react-circular-progressbar"),require("react-circular-progressbar/dist/styles.css"),require("react-move")):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/bbox","@turf/invariant","@turf/area","@turf/bbox-polygon","@turf/centroid","@turf/helpers","@turf/intersect","@turf/point-to-polygon-distance","@map-colonies/react-core/dist/list/styles","@map-colonies/react-core/dist/textfield/styles","@turf/boolean-point-in-polygon","@cmcleese/cesium-navigation","@cmcleese/cesium-navigation/dist/index.css","@map-colonies/react-core/dist/linear-progress/styles","@map-colonies/react-core/dist/checkbox/styles","p-map","uuid","@turf/boolean-valid","textarea-caret","get-input-selection","chonky","chonky-icon-fontawesome","filesize","react-select","react-circular-progressbar","react-circular-progressbar/dist/styles.css","react-move"],i):(u=typeof globalThis<"u"?globalThis:u||self,i(u.reactComponents={},u.jsxRuntime,u.React,u.dateFns,u.locale,u.pickers,u.DateFnsUtils,u.styles,u.core,u.reactCore,u.useMediaQuery,u.DatePicker,u.datePickerHebrewLocale,u.moment,u.rewind,u.ol,null,u.coordinate,u.control,u.MousePosition,u.proj,u.layer,u.source,u.format,u.interaction,u.Draw,u.VectorTile,u.style,u.WMTSTileGrid,u.extent,u.OlTileWMS,u.OlXYZ,u.VectorTileSource,u.OlExtLegend,u.OlExtLegendCtrl,null,u.TableHead,u.utils,u.CssBaseline,u.ScopedCssBaseline,u.ReactDOM,u.resium,u.Cesium,u.lodash,u.bbox,u.invariant,u.area,u.bboxPolygon,u.centroid,u.turf,u.intersect,u.pointToPolygonDistance,null,null,u.booleanPointInPolygon,u.viewerCesiumNavigationMixin,null,null,null,u.pMap,u.uuid,u.booleanValid,u.getCaretCoordinates,u.getInputSelection,u.chonky,u.chonkyIconFontawesome,u.filesize,u.Select,u.reactCircularProgressbar,null,u.reactMove))})(this,function(u,i,a,Te,Ue,Ne,St,De,ae,J,Xn,bt,Jn,Be,Kn,Ct,os,Mt,at,lt,_t,Pt,ct,dt,Qn,Rn,er,$e,tr,It,nr,rr,ir,At,or,ss,sr,Ot,ar,lr,ut,Me,g,$,qe,cr,Dt,je,dr,kt,xt,ur,as,ls,hr,gr,cs,ds,us,ht,Nt,pr,fr,Bt,re,mr,yr,Ft,Ye,hs,vr){"use strict";var rs=Object.defineProperty;var is=(u,i,a)=>i in u?rs(u,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):u[i]=a;var ue=(u,i,a)=>(is(u,typeof i!="symbol"?i+"":i,a),a);function gt(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const Vt=gt(a),M=gt(g),Gt=gt(kt);var we=(e=>(e.BOX="BOX",e.POLYGON="POLYGON",e.UNKNOWN="UNKNOWN",e))(we||{}),Se=(e=>(e.HE="he",e.EN="en",e.RU="ru",e))(Se||{}),Ze=(e=>(e.TOP_RIGHT="TOP_RIGHT",e.BOTTOM_LEFT="BOTTOM_LEFT",e))(Ze||{});const ge={DATE_PICKER:{dateFormat:"dd/MM/yyyy",local:{setText:"set",placeHolderText:"Enter the Date",calendarLocale:Se.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:Se.EN},renderAsButton:!0,offset:0,disableFuture:!0}},Q=e=>{const{children:t,...n}=e;return i.jsx(ae.Box,{...n,children:t})},Xe=e=>{const t=e.type==="dark";return a.useMemo(()=>Ht(e,t),[t,e])},Ht=(e,t=!1)=>De.createTheme({palette:{type:t?"dark":"light",primary:{main:e.primary},secondary:{main:e.secondary},error:{main:e.error},background:{default:e.surface,paper:e.background},text:{primary:t?e.textPrimaryOnDark:e.textPrimaryOnLight,secondary:t?e.textSecondaryOnDark:e.textSecondaryOnLight}}}),Wt=e=>a.useMemo(()=>({...e,"cesium-color":"#EDFFFF","cesium-error":e["--mdc-theme-gc-error-medium"]??"#FF3636","cesium-warning":e["--mdc-theme-gc-warning-high"]??"#FFA032","cesium-checkbox-color":"#1A73E8","cesium-checkbox-width":"12px","cesium-checkbox-height":"12px","cesium-font-size":"10pt"}),[e]),gs="",Er=2,wr=.5,Lr=De.makeStyles(e=>De.createStyles({container:{padding:e.spacing(Er),alignItems:"center"},setButton:{marginTop:e.spacing(1)},margin:{marginLeft:e.spacing(wr)}})),zt=e=>{var Y,V,X,W;const t=Lr(),n=J.useTheme(),r=Xe(n),[s,o]=a.useState(null),[d,h]=a.useState(null),[f,E]=a.useState(ge.DATE_RANGE_PICKER.dateFormat),C=e.controlsLayout??ge.DATE_RANGE_PICKER.controlsLayout,b=e.disableFuture??ge.DATE_RANGE_PICKER.disableFuture,p=((Y=e.local)==null?void 0:Y.startPlaceHolderText)??ge.DATE_RANGE_PICKER.local.startPlaceHolderText,v=((V=e.local)==null?void 0:V.endPlaceHolderText)??ge.DATE_RANGE_PICKER.local.endPlaceHolderText,I=((X=e.local)==null?void 0:X.setText)??ge.DATE_RANGE_PICKER.local.setText,F=(((W=e.local)==null?void 0:W.calendarLocale)??ge.DATE_RANGE_PICKER.local.calendarLocale)===Se.HE?Ue.he:Ue.enUS;a.useEffect(()=>{o(e.from??null)},[e.from]),a.useEffect(()=>{h(e.to??null)},[e.to]),a.useEffect(()=>{E(e.dateFormat??ge.DATE_RANGE_PICKER.dateFormat)},[e.dateFormat]);const G=Boolean(Te.isValid(s)&&!d||Te.isValid(d)&&!s||s&&d&&Te.isValid(s)&&Te.isValid(d)&&Te.isBefore(s,d)),j=()=>{e.onChange({from:s&&Te.isValid(s)?s:void 0,to:d&&Te.isValid(d)?d:void 0})};return i.jsx(ae.ThemeProvider,{theme:r,children:i.jsx(Q,{className:`${t.container} drpContainer`,display:"flex",flexDirection:C,width:C==="column"?e.contentWidth:"unset",children:i.jsxs(Ne.MuiPickersUtilsProvider,{utils:St,locale:F,children:[i.jsx(Ne.KeyboardDateTimePicker,{variant:"inline",placeholder:p,onChange:Z=>o(Z),value:s,disableFuture:b,format:f,maxDate:e.maxDate,minDate:e.minDate}),i.jsx(Ne.KeyboardDateTimePicker,{variant:"inline",placeholder:v,className:t.margin,onChange:Z=>h(Z),value:d,disableFuture:b,format:f,maxDate:e.maxDate,minDate:e.minDate}),i.jsx(J.ThemeProvider,{options:n,children:i.jsx(J.Button,{className:`${t.setButton} ${t.margin}`,raised:!0,onClick:j,disabled:!G,children:I})})]})})})},Ut=e=>{const{children:t,...n}=e;return i.jsx(ae.Popover,{...n,children:t})},ps="",Tr=e=>{var V,X;const[t,n]=a.useState(null),[r,s]=a.useState(null),[o,d]=a.useState(ge.DATE_RANGE_PICKER.dateFormat),[h,f]=a.useState(null),E=W=>{f(W.currentTarget)},C=W=>{W.currentTarget.tagName==="I"?f(W.currentTarget.previousElementSibling):f(W.currentTarget)},b=()=>{f(null)},p=Boolean(h),v=e.controlsLayout??"column";a.useEffect(()=>{n(e.from??null)},[e.from]),a.useEffect(()=>{s(e.to??null)},[e.to]),a.useEffect(()=>{d(e.dateFormat??ge.DATE_RANGE_PICKER.dateFormat)},[e.dateFormat]);const I=((V=e.local)==null?void 0:V.startPlaceHolderText)??ge.DATE_RANGE_PICKER.local.startPlaceHolderText,L=((X=e.local)==null?void 0:X.endPlaceHolderText)??ge.DATE_RANGE_PICKER.local.endPlaceHolderText,F=e.renderAsButton===void 0?ge.DATE_RANGE_PICKER.renderAsButton:e.renderAsButton,G=e.offset===void 0?ge.DATE_RANGE_PICKER.offset:e.offset,j=e.disableFuture===void 0?ge.DATE_RANGE_PICKER.disableFuture:e.disableFuture,Y=a.useMemo(()=>`${t?Te.format(t,o):I} - ${r?Te.format(r,o):L}`,[t,r,o,I,L]);return i.jsxs(i.Fragment,{children:[F?i.jsx(J.Button,{style:{width:e.width},raised:!0,onClick:E,className:"drpOpener",children:Y}):i.jsx(J.TextField,{className:"drpOpener",readOnly:!0,style:{width:e.width},value:Y,onClick:C,trailingIcon:{icon:"date_range",tabIndex:0,onClick:C}}),i.jsx(Ut,{open:p,anchorEl:h,onClose:b,anchorOrigin:{vertical:"bottom",horizontal:"left"},keepMounted:!0,children:i.jsx(zt,{controlsLayout:v,contentWidth:((h==null?void 0:h.clientWidth)??0)-G,dateFormat:o,disableFuture:j,minDate:e.minDate,maxDate:e.maxDate,local:e.local,from:t??void 0,to:r??void 0,onChange:({from:W,to:Z})=>{n(W??null),s(Z??null),e.onChange({from:W,to:Z}),b()}})})]})},Je=e=>typeof e<"u"&&e!==null&&"startDate"in e&&"endDate"in e,Sr=({endDate:e,startDate:t,setEndDate:n=()=>{},setStartDate:r=()=>{},endTimeInputClassName:s="",endTimeLabel:o="",endTimeWrapperClassName:d="",timeRangeInputsWrapperClassName:h="",startTimeInputClassName:f="",startTimeLabel:E="",startTimeWrapperClassName:C=""})=>i.jsxs("div",{className:`timeRangeWrapper ${h}`,children:[i.jsx("div",{className:`startTimeWrapper ${C}`,children:i.jsx(J.TextField,{label:E,disabled:t===null,className:`timeRangeInput ${f}`,name:"start-time",type:"time",value:Be(t).format("HH:mm"),onChange:b=>{const p=Be(t),v=Be(b.currentTarget.value,"HH:mm"),I=p.set({hours:v.get("hours"),minutes:v.get("minutes")});r(I.toDate())}})}),i.jsx("div",{className:`endTimeWrapper ${d}`,children:i.jsx(J.TextField,{label:o,disabled:e===null,className:`timeRangeInput ${s}`,name:"end-time",type:"time",value:Be(e).format("HH:mm"),onChange:b=>{const p=Be(e),v=Be(b.currentTarget.value,"HH:mm"),I=p.set({hours:v.get("hours"),minutes:v.get("minutes")});n(I.toDate())}})})]}),br=a.forwardRef(({value:e,onClick:t,onInputClick:n,...r},s)=>i.jsx(J.TextField,{...r,className:"dateRangeCustomInput",readOnly:!0,onClick:o=>{t==null||t(o),n==null||n()},ref:s,value:e})),Cr=({setStartDate:e=()=>{},setEndDate:t=()=>{},shortcuts:n,dateRange:r,onShortcut:s})=>{const[o,d]=a.useState(),h=a.useMemo(()=>n.map(f=>f instanceof Function?f():f),[n]);return a.useEffect(()=>{for(const f of h){const E=r.startDate&&r.endDate&&Te.isSameDay(f.startDate,r.startDate)&&Te.isSameDay(f.endDate,r.endDate);o?f.id===o&&(E||d(void 0)):E&&d(f.id)}},[r,o,h]),i.jsx("div",{className:"shortcutsContainer",children:h.map((f,E)=>{const C=()=>{e(f.startDate),t(f.endDate)};return i.jsx(J.Button,{type:"button",className:`shortcut ${o===f.id?"selected":""}`,onClick:b=>{C(),s==null||s({startDate:f.startDate,endDate:f.endDate})},outlined:!0,children:f.label},f.id+E)})})},Mr=a.forwardRef((e,t)=>{const{calendarClassName:n,dayClassName:r,monthClassName:s,selectsRange:o,onChange:d,inputName:h,showMonthYearDropdown:f,withShortcuts:E,locale:C="en"}=e,[b,p]=a.useState(null),[v,I]=a.useState(null),[L,F]=a.useState(!1),G=o?{startDate:b,endDate:v}:b;a.useEffect(()=>{C==="he"&&bt.registerLocale("he",Jn)},[C]),a.useEffect(()=>{var V,X;((V=e.startDate)==null?void 0:V.toString())!==(b==null?void 0:b.toString())&&p(e.startDate),((X=e.endDate)==null?void 0:X.toString())!==(v==null?void 0:v.toString())&&I(e.endDate)},[e.startDate,e.endDate,b,v]);const j=a.useMemo(()=>{let V="pickerContainer"+(C==="he"?" pickerContainer-rtl":"");return E&&o&&(V+=" pickerContainer-withShortcuts"),V},[C,E,o]),Y=f?{showMonthDropdown:!0,showYearDropdown:!0,dropdownMode:"select"}:{};return i.jsx("div",{className:j,style:{direction:C==="he"?"rtl":"ltr"},children:i.jsx(bt,{...e,ref:t,onClickOutside:()=>F(!1),open:L,startDate:Je(G)?b:void 0,selected:b,endDate:Je(G)?v:void 0,monthsShown:e.monthsShown??2,calendarClassName:`pickerCalendar ${n}`,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,X)=>{if(Array.isArray(V)){const[W,Z]=V;p(W),I(Z),d==null||d({startDate:W,endDate:Z&&Te.endOfDay(Z)},X)}else p(V),d==null||d(V,X)},customInput:i.jsx(br,{name:h,onInputClick:()=>{F(!0)}}),showTimeInput:!!(E&&o),timeInputLabel:"",customTimeInput:E&&Je(G)&&i.jsx(Cr,{onShortcut:V=>{d==null||d(V),F(!1)},shortcuts:E,setEndDate:I,setStartDate:p,dateRange:G}),showMonthYearDropdown:void 0,...Y})})}),fs="",_r=e=>{const t=J.useTheme(),n=Xe(t),{format:r=ge.DATE_PICKER.dateFormat,variant:s=ge.DATE_PICKER.variant,disableFuture:o=ge.DATE_PICKER.disableFuture,local:d,onChange:h,showTime:f=ge.DATE_PICKER.showTime,value:E,...C}=e,{placeHolderText:b=ge.DATE_PICKER.local.placeHolderText,calendarLocale:p}=d??{placeHolderText:ge.DATE_PICKER.local.placeHolderText,calendarLocale:Se.EN},v=p===Se.HE?Ue.he:Ue.enUS,I=L=>{h(L)};return i.jsx(ae.ThemeProvider,{theme:n,children:i.jsxs(Ne.MuiPickersUtilsProvider,{utils:St,locale:v,children:[f&&i.jsx(Ne.KeyboardDateTimePicker,{variant:s,placeholder:b,onChange:I,value:E,disableFuture:o,format:r,...C}),!f&&i.jsx(Ne.KeyboardDatePicker,{variant:s,placeholder:b,onChange:I,value:E,disableFuture:o,format:r,...C})]})})},Pr=18,Ir=De.makeStyles(e=>De.createStyles({drawingButton:{width:e.spacing(Pr)},fullWidth:{width:"100%",marginTop:"36px"}})),Ar=e=>{const t=Ir(),[n,r]=a.useState(null),{isSelectionEnabled:s,onCancelDraw:o,onStartDraw:d,onReset:h}=e,f=C=>{r(C.currentTarget)},E=()=>{r(null)};return s?i.jsx(J.Tooltip,{content:"Cancel the ongoing draw",align:"bottomLeft",children:i.jsx(J.Button,{className:t.drawingButton,raised:!0,onClick:o,children:"Cancel Draw"})}):i.jsxs(Q,{position:"relative",children:[i.jsx(J.Tooltip,{content:"draw an Area of interest to limit the search",align:"bottomLeft",children:i.jsx(J.Button,{className:t.drawingButton,raised:!0,onClick:f,children:"Draw AOI"})}),i.jsxs(J.Menu,{className:t.fullWidth,open:Boolean(n),onClose:E,children:[i.jsx(J.MenuItem,{onClick:()=>{d(we.POLYGON),E()},children:"Polygon"}),i.jsx(J.MenuItem,{onClick:()=>{d(we.BOX),E()},children:"Box"}),i.jsx(J.MenuItem,{onClick:()=>{h(),E()},children:"Clear"})]})]})},ms="";var be=(e=>(e.WGS84="EPSG:4326",e.WEB_MERCATOR="EPSG:3857",e))(be||{});const Ke=5,Qe=2,$t=a.createContext(null),Or=$t.Provider,qt=35,jt=32,Dr=10,kr=e=>e!==void 0&&e!==be.WGS84?_t.transform([qt,jt],be.WGS84,e):[qt,jt],xr=e=>{switch(e){case be.WEB_MERCATOR:return t=>Mt.format(t,"Mercator: {y}m, {x}m",Qe);case be.WGS84:return t=>Mt.format(t,"WGS84: {y}°N {x}°E",Ke);default:return t=>""}},ke=()=>{const e=a.useContext($t);if(e===null)throw new Error("map context is null, please check the provider");return e},Yt=e=>{const t=a.useRef(null),{allowFullScreen:n,showMousePosition:r,projection:s}=e,[o]=a.useState(new Ct.Map({view:new Ct.View({projection:s??be.WGS84}),controls:at.defaults()}));a.useEffect(()=>{o.getView().setCenter(e.center??kr(e.projection))},[o,e.center,e.projection]),a.useEffect(()=>{o.getView().setZoom(e.zoom??Dr)},[o,e.zoom,e.projection]);const d=(h,f)=>{f.getControls().forEach(C=>{C instanceof h&&f.removeControl(C)})};return a.useEffect(()=>{o.setTarget(t.current),n!==void 0&&n?o.addControl(new at.FullScreen):d(at.FullScreen,o)},[o,n]),a.useEffect(()=>{r!==void 0&&r?(d(lt,o),o.addControl(new lt({coordinateFormat:xr(s??be.WGS84),projection:s??be.WGS84,undefinedHTML:"&nbsp;"}))):d(lt,o)},[o,r,s]),i.jsxs(Or,{value:o,children:[i.jsx("div",{className:"map",ref:t}),e.children]})},Zt=a.createContext(null),Nr=Zt.Provider,Ge=()=>{const e=a.useContext(Zt);if(e===null)throw new Error("tile layer context is null, please check the provider");return e},Xt=({options:e,children:t})=>{const n=ke(),[r]=a.useState(new Pt.Tile(e));return a.useEffect(()=>(n.addLayer(r),()=>{n.removeLayer(r)}),[n,r]),i.jsx(Nr,{value:r,children:t})},Jt=a.createContext(null),Br=Jt.Provider,Kt=()=>{const e=a.useContext(Jt);if(e===null)throw new Error("vector layer context is null, please check the provider");return e},Qt=({children:e})=>{const t=ke(),[n]=a.useState(new Pt.Vector);return a.useEffect(()=>(t.addLayer(n),()=>{t.removeLayer(n)}),[t,n]),i.jsx(Br,{value:n,children:e})},Rt=a.createContext(null),Fr=Rt.Provider,en=()=>{const e=a.useContext(Rt);if(e===null)throw new Error("vector source context is null, please check the provider");return e},tn=({children:e})=>{const t=Kt(),[n]=a.useState(new ct.Vector);return a.useEffect(()=>{t.setSource(n)},[n,t]),i.jsx(Fr,{value:n,children:e})},nn=({geometry:e,fitOptions:t,fit:n,featureStyle:r})=>{const s=en(),o=ke();return a.useLayoutEffect(()=>{const h=new dt.GeoJSON().readFeature(e);return n&&s.on("addfeature",function(){o.getView().fit(s.getExtent(),t)}),r&&h.setStyle(r),s.addFeature(h),()=>{s.removeFeature(h)}},[e,s,n]),null},rn=e=>{const t=Ge();return a.useEffect(()=>{t.setSource(new ct.OSM)},[t]),null},on=({drawType:e,onPolygonSelected:t})=>{const n=ke();return a.useEffect(()=>{const r={type:"Circle"};switch(e){case we.BOX:r.geometryFunction=Rn.createBox();break;case we.POLYGON:r.type="Polygon";break;default:return}const s=new Qn.Draw(r);n.addInteraction(s);const o=d=>{const f=new dt.GeoJSON().writeGeometryObject(d.feature.getGeometry());t==null||t(f)};return s.on("drawend",o),()=>{s.un("drawend",o),n.removeInteraction(s)}},[t,e,n]),null},ys="",Vr=e=>{const t=n=>{const r=Kn(n);e.onPolygonSelection(r)};return i.jsxs(Yt,{allowFullScreen:!0,showMousePosition:!0,children:[i.jsx(Xt,{children:i.jsx(rn,{})}),e.selectionPolygon&&i.jsx(Qt,{children:i.jsx(tn,{children:i.jsx(nn,{geometry:e.selectionPolygon})})}),e.children,e.drawType!==void 0&&i.jsx(on,{drawType:e.drawType,onPolygonSelected:t})]})},pt=1.5,Gr=80,Hr=De.makeStyles(e=>De.createStyles({map:{height:"100%",width:"100%",position:"absolute"},absolute:{position:"absolute",zIndex:1e3,left:e.spacing(pt),top:e.spacing(pt)},contentContainer:{marginTop:e.spacing(pt),width:e.spacing(Gr)},filtersContainer:{display:"flex",padding:e.spacing(1)},filtersMargin:{marginLeft:e.spacing(1)}})),Wr=e=>{var f;const[t,n]=a.useState(),[r,s]=a.useState(),o=Hr(),d=E=>{s(E),n(void 0),e.handlePolygonSelected(E)},h=()=>{s(void 0),e.handlePolygonReset()};return i.jsxs("div",{className:o.map,children:[i.jsxs("div",{className:`${o.absolute}`,children:[i.jsxs(ae.Paper,{className:o.filtersContainer,children:[i.jsx(Ar,{onCancelDraw:()=>n(void 0),onReset:h,onStartDraw:n,isSelectionEnabled:t!==void 0}),(f=e.filters)==null?void 0:f.map((E,C)=>i.jsx("div",{className:o.filtersMargin,children:E},C))]}),i.jsx(ae.Paper,{color:"red",className:`${o.contentContainer}`,children:e.children})]}),i.jsx(Vr,{children:e.mapContent,onPolygonSelection:d,drawType:t,selectionPolygon:r})]})},sn=new $e.Fill({color:"rgba(255,255,255,0.4)"}),an=new $e.Stroke({color:"#3399CC",width:1.25}),ln=[new $e.Style({image:new $e.Circle({fill:sn,stroke:an,radius:5}),fill:sn,stroke:an})],cn=a.createContext(null),zr=cn.Provider,dn=()=>{const e=a.useContext(cn);if(e===null)throw new Error("vector tile layer context is null, please check the provider");return e},Ur=({children:e,options:t,style:n})=>{const r=ke(),[s]=a.useState(new er({...t,style:n||ln}));return a.useEffect(()=>(r.addLayer(s),()=>{r.removeLayer(s)}),[r,s]),a.useEffect(()=>{s.setStyle(n||ln)},[s,n]),i.jsx(zr,{value:s,children:e})},ft=20,$r=256,qr=2,jr=2,Yr="REST",Zr=e=>{const t=_t.get(e.projection),n=t.getExtent(),r=new Array(ft),s=new Array(ft),o=It.getWidth(n)/$r,d=e.heightWidthRatio!==void 0?e.heightWidthRatio:jr,h=e.requestEncoding!==void 0?e.requestEncoding:Yr;for(let E=0;E<ft;++E)r[E]=o/Math.pow(qr,E)/d,s[E]=E.toString();return{attributions:e.attributions,url:e.url,layer:e.layer,matrixSet:e.matrixSet,format:e.format,projection:t,tileGrid:new tr({origin:It.getTopLeft(n),resolutions:r,matrixIds:s}),style:e.style,requestEncoding:h,wrapX:e.wrapX!==void 0?e.wrapX:!0}},Xr=e=>{const t=Ge(),{options:n}=e;return a.useEffect(()=>{t.setSource(new ct.WMTS(n))},[t,n]),null},Jr=e=>{const{attributions:t,url:n,params:r,serverType:s,transition:o}=e;return{attributions:t,url:n,params:r,serverType:s,transition:o}},Kr=e=>{const t=Ge(),{options:n}=e;return a.useEffect(()=>{t.setSource(new nr(n))},[t,n]),null},Qr=e=>{const{attributions:t,url:n}=e;return{attributions:t,url:n}},Rr=e=>{const t=Ge(),{options:n}=e;return a.useEffect(()=>{t.setSource(new rr(n))},[t,n]),null},ei=a.createContext(null),ti=()=>{const e=a.useContext(ei);if(e===null)throw new Error("vector tile source context is null, please check the provider");return e},ni=e=>{const{url:t}=e;return{url:t,format:new dt.MVT}},ri=({children:e,options:t})=>{const n=dn();return a.useEffect(()=>{n.setSource(new ir(t))},[t,n]),null},ii=({legendItems:e,title:t,isCollapsed:n})=>{const r=ke();return a.useEffect(()=>{const s=new At({title:t??"",margin:5,maxWidth:300}),o=new or({legend:s,collapsed:n===void 0?!0:n});r.addControl(o);const d=new At({margin:4});return e.forEach(h=>{d.addItem({title:h.title,style:h.style,typeGeom:"Polygon"})}),s.addItem(d),()=>{r.removeControl(o)}},[r,e,t,n]),i.jsx(i.Fragment,{})};function oi(e){const{headCells:t,order:n,orderBy:r,onRequestSort:s,isCollapseable:o}=e,d=h=>f=>{s(f,h)};return i.jsx(sr,{children:i.jsxs(ae.TableRow,{children:[o&&i.jsx(ae.TableCell,{}),t.map(h=>i.jsx(ae.TableCell,{align:h.numeric?"right":"left",padding:h.disablePadding?"none":"default",sortDirection:r===h.id?n:!1,children:i.jsx(ae.TableSortLabel,{active:r===h.id,direction:r===h.id?n:"asc",onClick:d(h.id),children:h.label})},h.id))]})})}const si=Ot.createSvgIcon(Vt.createElement("path",{d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"}),"KeyboardArrowDown"),ai=Ot.createSvgIcon(Vt.createElement("path",{d:"M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"}),"KeyboardArrowUp");function li(e){const{cellsMetadata:t,isRowSelected:n,item:r,onRowSelected:s,rowIndex:o,isCollapseable:d,collapsedElement:h}=e,[f,E]=a.useState(!1),C=t.length,b=()=>{s==null||s(o)};return i.jsxs(i.Fragment,{children:[i.jsxs(ae.TableRow,{hover:!0,selected:n,onClick:b,children:[d&&i.jsx(ae.TableCell,{padding:"checkbox",children:i.jsx(ae.IconButton,{"aria-label":"expand row",size:"small",onClick:p=>{p.stopPropagation(),E(!f)},children:f?i.jsx(ai,{}):i.jsx(si,{})})}),t.map(p=>i.jsx(ae.TableCell,{align:p.numeric?"right":"left",padding:p.disablePadding?"none":"default",children:p.transform?p.transform(r[p.id]):r[p.id]},p.id+o.toString()))]}),d&&i.jsx(ae.TableRow,{children:i.jsx(ae.TableCell,{style:{paddingBottom:0,paddingTop:0},colSpan:C+1,children:i.jsx(ae.Collapse,{in:f,unmountOnExit:!0,timeout:"auto",children:h==null?void 0:h(r)})})})]})}function ci(e){const[t,n]=a.useState(""),[r,s]=a.useState("asc"),{cellsMetadata:o,items:d,onRequestSort:h,onRowSelected:f,isCollapseable:E,collapsedElement:C,isDense:b,page:p,rowsPerPage:v,count:I,handleChangePage:L,handleChangeRowsPerPage:F}=e,G=(j,Y)=>{const V=t===Y&&r==="asc";s(V?"desc":"asc"),n(Y),h(Y,V?"desc":"asc")};return i.jsxs(ae.TableContainer,{component:ae.Paper,children:[i.jsxs(ae.Table,{size:b?"small":"medium",children:[i.jsx(oi,{headCells:o,onRequestSort:G,order:r,orderBy:t,isCollapseable:E}),i.jsxs(ae.TableBody,{children:[d.map((j,Y)=>i.jsx(li,{item:j,rowIndex:Y,isCollapseable:E,cellsMetadata:o,collapsedElement:C,isRowSelected:!1,onRowSelected:f},Y)),(d.length===0||v>d.length)&&i.jsx(ae.TableRow,{style:{height:(b?33:53)*(v-d.length)},children:i.jsx(ae.TableCell,{colSpan:E?o.length+1:o.length,children:d.length===0&&i.jsx(ae.Typography,{align:"center",children:"No results :("})})})]})]}),i.jsx(ae.TablePagination,{rowsPerPage:v,rowsPerPageOptions:[5,10],component:"div",count:I,page:p,onPageChange:L,onRowsPerPageChange:F})]})}const di=e=>{const{children:t,...n}=e;return i.jsx(ar,{...n,children:t})},ui=e=>{const{children:t,...n}=e;return i.jsx(lr,{...n,children:t})},un=e=>e*Math.PI/180,Re=e=>e*(180/Math.PI),hi=e=>.05*(5916575505e-1/Math.pow(2,e-1)/2)*(Math.cos(un(85.362/2))/Math.sin(un(85.362/2))),gi=({title:e,onClick:t})=>i.jsx("div",{className:"cesium-cesiumInspector-button",onClick:t,children:e}),pi=({title:e,isVisible:t,onClick:n,children:r})=>i.jsxs(Q,{className:`cesium-cesiumInspector ${t?"cesium-cesiumInspector-visible":""}`,children:[i.jsx(gi,{title:e,onClick:n}),t&&i.jsx(Q,{className:"cesium-cesiumInspector-dropDown",children:r})]}),vs="",mt="Imagery",yt="Data",fi=({locale:e})=>{var b,p;const t=pe(),[n,r]=a.useState([{id:mt,values:[]},{id:yt,values:[]}]),[s,o]=a.useState({}),d=v=>$.get(e,v.toUpperCase())??v,h=()=>t.imageryLayers?Array.from({length:t.imageryLayers.length},(v,I)=>{var G;const L=t.imageryLayers.get(I),F=L.meta;return{id:F==null?void 0:F.id,name:$.get(F,"layerRecord.productName")??(F==null?void 0:F.id),rect:L.rectangle,isBaseMap:(G=t.layersManager)==null?void 0:G.isBaseMapLayer(F)}}):[],f=()=>{var v;return((v=t.layersManager)==null?void 0:v.dataLayerList.map(I=>{var L,F;return{id:(L=I.meta)==null?void 0:L.id,name:$.get(I.meta,"featureStructure.aliasLayerName")??I.meta.productName,rect:g.Rectangle.fromDegrees(...qe((F=I.meta)==null?void 0:F.footprint)),isBaseMap:!1}}))||[]};a.useEffect(()=>{(()=>{const I=[{id:mt,values:h()},{id:yt,values:f()}];r(I),o(I.reduce((L,F)=>({...L,[F.id]:!0}),{}))})()},[]),a.useEffect(()=>{if(!t.layersManager)return;const v=()=>{r(I=>I.map(L=>L.id===mt?{...L,values:h()}:L))};return t.layersManager.addLayerUpdatedListener(v),t.imageryLayers.layerRemoved.addEventListener(v),()=>{var I;$.get(t,"_cesiumWidget")!==void 0&&((I=t.layersManager)==null||I.removeLayerUpdatedListener(v),t.imageryLayers.layerRemoved.removeEventListener(v))}},[(b=t.layersManager)==null?void 0:b.layerList]),a.useEffect(()=>{if(!t.layersManager)return;const v=()=>{r(I=>I.map(L=>L.id===yt?{...L,values:f()}:L))};return t.layersManager.addDataLayerUpdatedListener(v),()=>{var I;(I=t.layersManager)==null||I.removeDataLayerUpdatedListener(v)}},[(p=t.layersManager)==null?void 0:p.dataLayerList]);const E=v=>{o(I=>({...I,[v]:!I[v]}))},C=v=>{t.camera.flyTo({destination:v})};return i.jsx(Q,{className:"activeLayersPanel",children:n.filter(v=>v.values.length>0).map(v=>i.jsxs(Q,{className:`cesium-cesiumInspector-section ${s[v.id]?"cesium-cesiumInspector-section-collapsed":""}`,onClick:()=>E(v.id),children:[i.jsx(J.Typography,{tag:"h3",className:"cesium-cesiumInspector-sectionHeader",children:d(v.id)}),i.jsx(Q,{className:"cesium-cesiumInspector-sectionContent",children:v.values.map(I=>i.jsxs(Q,{className:"layer",children:[i.jsx(J.Tooltip,{content:I.name,children:i.jsx(Q,{className:`name ${I.isBaseMap?"disabled":""}`,children:I.name})}),i.jsx(Q,{className:"icons",children:i.jsx(J.Tooltip,{content:$.get(e,"FLY_TO")??"Fly To",children:i.jsx(Q,{className:"icon",onClick:L=>{L.stopPropagation(),C(I.rect)},children:i.jsxs("svg",{fill:"var(--mdc-theme-cesium-color)",width:"100%",height:"100%",viewBox:"0 0 256 256",children:[i.jsx("path",{d:"M236,120H223.66406A96.15352,96.15352,0,0,0,136,32.33618V20a8,8,0,0,0-16,0V32.33618A96.15352,96.15352,0,0,0,32.33594,120H20a8,8,0,0,0,0,16H32.33594A96.15352,96.15352,0,0,0,120,223.66382V236a8,8,0,0,0,16,0V223.66382A96.15352,96.15352,0,0,0,223.66406,136H236a8,8,0,0,0,0-16Zm-40,16h11.59912A80.14164,80.14164,0,0,1,136,207.59912V196a8,8,0,0,0-16,0v11.59912A80.14164,80.14164,0,0,1,48.40088,136H60a8,8,0,0,0,0-16H48.40088A80.14164,80.14164,0,0,1,120,48.40088V60a8,8,0,0,0,16,0V48.40088A80.14164,80.14164,0,0,1,207.59912,120H196a8,8,0,0,0,0,16Z"}),i.jsx("polygon",{points:"128,80 80,170 128,150 176,170",fill:"var(--mdc-theme-cesium-color)"})]})})})})]},I.id))})]},v.id))})},mi=({locale:e})=>{const[t,n]=a.useState(!1),r=a.useMemo(()=>$.get(e,"ACTIVE_LAYERS_TITLE")??"Active Layers",[e]);return i.jsx(pi,{title:r,isVisible:t,onClick:()=>n(!t),children:i.jsx(fi,{locale:e})})},et=({onClick:e,children:t})=>i.jsx("div",{className:"cesium-toolbar-button cesium-button",onClick:e,children:t}),vt=({title:e})=>i.jsx(Q,{className:"cesium-mc-title",children:e}),Et=({isVisible:e,children:t,title:n})=>i.jsxs(Q,{className:`cesium-mc-tool ${e?"cesium-mc-tool-visible":""}`,children:[n&&i.jsx(vt,{title:n}),t]}),hn=({item:e,isSelected:t,onClick:n})=>i.jsxs(Q,{className:`cesium-baseLayerPicker-item ${t?"cesium-baseLayerPicker-selectedItem":""}`,title:e.title,onClick:n,children:[i.jsx("img",{className:"cesium-baseLayerPicker-itemIcon",src:e.thumbnail,alt:e.title}),i.jsx(Q,{className:"cesium-baseLayerPicker-itemLabel",children:e.title})]}),yi=({title:e,baseMaps:t,setCurrent:n})=>{const r=pe(),[s,o]=a.useState();a.useEffect(()=>{const h=t.maps.find(f=>f.isCurrent);h&&(o(h),n(h))},[t]);const d=h=>{var E,C;(E=r.layersManager)==null||E.removeBaseMapLayers();const f=t.maps.find(b=>b.id===h);f&&((C=r.layersManager)==null||C.setBaseMapLayers(f),o(f),n(f),t.maps.forEach(b=>{b.isCurrent=f===b}))};return i.jsxs(i.Fragment,{children:[i.jsx(vt,{title:e}),i.jsx(Q,{className:"cesium-mc-choices",children:t.maps.map(h=>i.jsx(hn,{item:h,isSelected:s===h,onClick:()=>d(h.id)},h.id))})]})},vi=({title:e,terrains:t})=>{const[n,r]=a.useState(),s=pe();a.useEffect(()=>{const d=t.find(h=>h.isCurrent);d&&r(d)},[t]);const o=d=>{const h=t.find(f=>f.id===d);h&&(s.terrainProvider=h.terrainProvider??new g.EllipsoidTerrainProvider({}),r(h),t.forEach(f=>{f.isCurrent=h===f}))};return i.jsxs(i.Fragment,{children:[i.jsx(vt,{title:e}),i.jsx(Q,{className:"cesium-mc-choices",children:t.map(d=>i.jsx(hn,{item:d,isSelected:n===d,onClick:()=>o(d.id)},d.id))})]})},Ei=({baseMaps:e,terrains:t,locale:n})=>{const[r,s]=a.useState(!1),[o,d]=a.useState(),h=a.useMemo(()=>$.get(n,"BASE_MAP_TITLE")??"Base Map",[n]),f=a.useMemo(()=>$.get(n,"TERRAIN_TITLE")??"Terrain",[n]);return i.jsxs(i.Fragment,{children:[i.jsx(et,{onClick:()=>s(E=>!E),children:i.jsx("img",{className:"cesium-baseLayerPicker-selected",src:o==null?void 0:o.thumbnail,title:o==null?void 0:o.title,alt:"Current Map"})}),i.jsxs(Et,{isVisible:r,children:[e&&i.jsx(yi,{title:h,baseMaps:e,setCurrent:d}),t&&i.jsx(vi,{title:f,terrains:t})]})]})},Es="",wi=({featureTypes:e,locale:t})=>{const n=a.useMemo(()=>$.get(t,"WFS_TITLE")??"Data Layers",[t]),r=a.useMemo(()=>$.get(t,"WFS_CACHE")??"Cache",[t]),s=a.useMemo(()=>$.get(t,"WFS_EXTENT")??"Extent",[t]),o=a.useMemo(()=>$.get(t,"NO_DATA_LAYERS")??"No layers found",[t]),d=a.useMemo(()=>i.jsx(Q,{className:"title",children:n}),[n]),h=a.useMemo(()=>i.jsx(i.Fragment,{children:e.length>0?e.map((f,E)=>i.jsxs(Q,{className:"featureType",children:[i.jsx(J.Tooltip,{content:`${f.featureStructure.aliasLayerName} ${f.id} (${String(f.zoomLevel)})`,children:i.jsxs(Q,{className:`name ${f.currentZoomLevel<f.zoomLevel?"warning blinking":f.total===-1?"error blinking":""}`,children:[f.featureStructure.aliasLayerName," (",String(f.zoomLevel),"):"]})}),i.jsxs(Q,{className:"info",children:[i.jsxs(Q,{children:[r,": ",f.cache??0]}),f.total>0&&i.jsxs(Q,{className:"spacer",children:[s,": ",f.items," / ",f.total]})]})]},E)):i.jsx(Q,{children:o})}),[e]);return i.jsxs(Q,{className:"wfsContainer",children:[d,h]})},Li=({locale:e})=>{var h;const[t,n]=a.useState(!1),[r,s]=a.useState([]),o=a.useMemo(()=>$.get(e,"DEBUG_PANEL_TITLE")??"Debugger Tool",[e]),d=pe();return a.useEffect(()=>{if(!d.layersManager)return;const f=(E,C)=>{var p;E.forEach(v=>{if(C!==void 0&&C!==v.meta.id)return;const{options:I,meta:L}=v,{zoomLevel:F}=I,{id:G,items:j,total:Y,cache:V,currentZoomLevel:X,featureStructure:W}=L;s(Z=>{const te=Z.findIndex(l=>l.id===G);if(te>=0){if(JSON.stringify(Z[te])!==JSON.stringify({id:G,items:j,total:Y,cache:V,currentZoomLevel:X,featureStructure:W,zoomLevel:F})){const l=[...Z];return l[te]={id:G,items:j,total:Y,cache:V,currentZoomLevel:X,featureStructure:W,zoomLevel:F},l}}else return[...Z,{id:G,items:j,total:Y,cache:V,currentZoomLevel:X,featureStructure:W,zoomLevel:F}];return Z})});const b=new Set((p=d.layersManager)==null?void 0:p.dataLayerList.map(v=>v.meta.id));s(v=>v.filter(I=>b.has(I.id)))};return d.layersManager.addDataLayerUpdatedListener(f),()=>{var E;(E=d.layersManager)==null||E.removeDataLayerUpdatedListener(f)}},[(h=d.layersManager)==null?void 0:h.dataLayerList]),i.jsxs(i.Fragment,{children:[i.jsx(et,{onClick:()=>n(!t),children:i.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 24 24",children:i.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",fill:"orange"})})}),i.jsx(Et,{isVisible:t,title:o,children:i.jsx(wi,{featureTypes:r,locale:e})})]})};class Ti extends g.PolylineDashMaterialProperty{}class Si extends g.ConstantProperty{}class bi extends g.ConstantPositionProperty{}class Ci extends g.Cartesian2{}class Mi extends g.Cartesian3{}class gn extends g.Cartographic{}class _i extends g.BoundingSphere{}class Pi extends g.Ellipsoid{}class Ii extends g.GeographicTilingScheme{}class pn extends g.Rectangle{}class Ai extends g.Resource{}class Oi extends g.EllipsoidTerrainProvider{}class Di extends g.CesiumTerrainProvider{}class ki extends g.PolylineGraphics{}class xi extends g.JulianDate{}class Ni extends g.PositionProperty{}class Bi extends g.BillboardGraphics{}class Fi extends g.Color{}class Vi extends g.PolygonHierarchy{}class Gi extends g.Scene{}const Hi=g.VerticalOrigin,Wi=g.HorizontalOrigin,tt=g.SceneMode,zi=g.LabelStyle,Ui=g.HeightReference,_e=document.createElement("canvas"),Le=_e.getContext("2d"),fn=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},$i=async(e,t)=>(t&&t.tileTransparencyCheckedCounter++,new Promise((n,r)=>{try{Le==null||Le.clearRect(0,0,_e.width,_e.height);let s;if(e instanceof HTMLImageElement)s=e;else if(e instanceof ImageBitmap){_e.width=e.width,_e.height=e.height,Le==null||Le.drawImage(e,0,0);const o=Le==null?void 0:Le.getImageData(0,0,_e.width,_e.height),d=fn(o);d&&t&&(t.tileTransparencyCheckedCounter=t.maxTilesForTransparencyCheck),n(d);return}else s=new Image,s.crossOrigin="anonymous",s.src=e;s.onload=()=>{_e.width=s.width,_e.height=s.height,Le==null||Le.drawImage(s,0,0);const o=Le==null?void 0:Le.getImageData(0,0,_e.width,_e.height);fn(o)?(t&&(t.tileTransparencyCheckedCounter=t.maxTilesForTransparencyCheck),n(!0)):n(!1)}}catch(s){console.error("Could not determine image transparency. Error => ",s),r(s)}})),nt=(e,t)=>{const{west:n,east:r,north:s,south:o}=e,{west:d,east:h,north:f,south:E}=t;return n>=d&&r<=h&&s<=f&&o>=E},qi=(e,t)=>ur(e,je(t)),ji=e=>{const t=(g.Math.toDegrees(e.west)+g.Math.toDegrees(e.east))/2,n=(g.Math.toDegrees(e.south)+g.Math.toDegrees(e.north))/2;return kt.point([t,n])},mn=e=>[g.Math.toDegrees(e.west),g.Math.toDegrees(e.south),g.Math.toDegrees(e.east),g.Math.toDegrees(e.north)],yn=e=>{const t=e.scene;let r=e.camera.computeViewRectangle(t.globe.ellipsoid);if(!g.defined(r)||!r){console.error("cesium native computeViewRectangle returned invalid rectangle, fallback to custom calculation ");const s=new g.Cartesian2(0,0),o=t.camera.pickEllipsoid(s,t.globe.ellipsoid),d=new g.Cartesian2(t.canvas.width,t.canvas.height),h=t.camera.pickEllipsoid(d,t.globe.ellipsoid),f=t.globe.ellipsoid.cartesianToCartographic(o),E=t.globe.ellipsoid.cartesianToCartographic(h);r=new g.Rectangle(f.longitude,E.latitude,E.longitude,f.latitude)}return r},Yi=(e,t=100)=>{const n=e.scene,r=e.camera,s=n.mode,o=yn(e);if(!g.defined(o)||!o){console.error("customComputeViewRectangle returned invalid rectangle.");return}if(s===g.SceneMode.SCENE2D)return o;const d=r.positionCartographic;if(!g.defined(d)){console.error("Camera position is undefined in 3D mode.");return}const h=d.latitude,f=d.longitude;if(h<-g.Math.PI_OVER_TWO||h>g.Math.PI_OVER_TWO||f<-g.Math.PI||f>g.Math.PI){console.error("Invalid latitude or longitude values.");return}const E=111320,C=111320*Math.cos(h);let b=t/E,p=t/C;const v=g.Cartesian3.magnitude(r.positionWC);v>1e7&&(b=10,p=10);const I=r.frustum instanceof g.PerspectiveFrustum?r.frustum.fov:Math.PI/3;let L=1;v<5e5?L=.05:v<2e6&&(L=.1),b*=L*(I/Math.PI),p*=L*(I/Math.PI);const F=r.pitch;if(F===void 0)return;const G=Math.PI/4,j=Math.max(0,1-Math.abs(F)/G);b*=j,p*=j;const Y=5e-4;b=Math.max(b,Y),p=Math.max(p,Y);const V=d.latitude-b,X=d.latitude+b,W=d.longitude-p,Z=d.longitude+p,te=g.Math.clamp(V,o.south,o.north),l=g.Math.clamp(X,o.south,o.north),c=g.Math.clamp(W,o.west,o.east),_=g.Math.clamp(Z,o.west,o.east),y=Math.min(1,F/g.Math.PI_OVER_TWO),S=o.north-(o.north-o.south)*y,w=Math.min(l,S);return new g.Rectangle(g.Math.negativePiToPi(c),g.Math.clamp(te,-g.Math.PI_OVER_TWO,g.Math.PI_OVER_TWO),g.Math.negativePiToPi(_),g.Math.clamp(w,-g.Math.PI_OVER_TWO,g.Math.PI_OVER_TWO))},vn=(e,t,n,r,s,o)=>{const d=e.scene.mode===g.SceneMode.SCENE2D,h=p=>{var v;if(p.polygon)return{type:"Polygon",coordinates:[((v=p.polygon.hierarchy)==null?void 0:v.getValue(g.JulianDate.now())).positions.map(F=>{const G=g.Cartographic.fromCartesian(F),j=new g.Cartographic(g.Math.toDegrees(G.longitude),g.Math.toDegrees(G.latitude),d?500:void 0);return[j.longitude,j.latitude,j.height]})]}},f=(p,v,I,L)=>{const F=g.SceneTransforms.wgs84ToWindowCoordinates(p,v);if(!F)return null;const G=F.x+I,j=F.y+L,Y=new g.Cartesian2(G,F.y),V=new g.Cartesian2(F.x,j),X=p.camera.pickEllipsoid(Y,p.globe.ellipsoid),W=p.camera.pickEllipsoid(V,p.globe.ellipsoid);if(!X||!W)return null;const Z=g.Cartesian3.distance(v,X),te=g.Cartesian3.distance(v,W);return{widthMeters:Z,heightMeters:te}},E=(p,v,I)=>{const L=g.Ellipsoid.WGS84,F=p.latitude,G=p.longitude,j=Math.PI/180*L.maximumRadius,Y=Math.PI/180*L.maximumRadius,V=I/2/j,X=v/2/Y,W=F+V,Z=F-V,te=G+X,l=G-X;return{type:"Polygon",coordinates:[[[l,W],[te,W],[te,Z],[l,Z],[l,W]]]}},C=(p,v)=>Dt(p)/Dt(v);if(!e.dataSources.getByName(t.name)[0])return;const b=[];if(t==null||t.entities.values.forEach(p=>{var v,I;if(s&&o&&d)try{const L=je(s),F=xt(h(p),L);if(F){const G=(v=p.properties)==null?void 0:v.label.getValue(g.JulianDate.now()),j=dr(F,{properties:{label:G}}),Y={width:G.width,height:G.height},[V,X,W=0]=j.geometry.coordinates,Z=g.Cartesian3.fromDegrees(V,X,W),te=f(e.scene,Z,Y.width,Y.height);if(te){const l=E({longitude:V,latitude:X},te.widthMeters,te.heightMeters),c=xt(F,{type:"Feature",properties:{},geometry:l});C(c==null?void 0:c.geometry,l)>.7&&b.push(j)}}}catch{console.log("*** Label placement failed: turf.intersect() failed ***","entity -->",p,"extent -->",s)}if(!(n.length>0&&!n.some(L=>p.id.startsWith(L)))&&(p.polygon&&(p.polygon=new g.PolygonGraphics({hierarchy:p.polygon.hierarchy,material:d?g.Color.fromCssColorString(r).withAlpha(.2):g.Color.fromCssColorString(r).withAlpha(.5),outline:!0,outlineColor:g.Color.fromCssColorString(r),outlineWidth:3,height:d?1e4:void 0,perPositionHeight:!1})),p.polyline&&(p.polyline=new g.PolylineGraphics({positions:p.polyline.positions,material:g.Color.fromCssColorString(r).withAlpha(.5),clampToGround:!0,width:4})),p.billboard)){const L=(I=p.position)==null?void 0:I.getValue(g.JulianDate.now()),F=g.Cartographic.fromCartesian(L),G=new g.Cartographic(F.longitude,F.latitude,d?500:e.scene.sampleHeight(g.Cartographic.fromCartesian(L))),j=g.Cartesian3.fromRadians(G.longitude,G.latitude,G.height),Y="#FFFF00";p.position=j,p.billboard=new g.BillboardGraphics({image:"data:image/svg+xml;base64,"+btoa(`
2
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16">
3
+ <circle cx="8" cy="8" r="6" fill="${r}33" stroke="${Y}80" stroke-width="2"/>
4
+ </svg>
5
+ `),verticalOrigin:g.VerticalOrigin.BOTTOM,heightReference:g.HeightReference.NONE,scale:1,disableDepthTestDistance:Number.POSITIVE_INFINITY})}}),e.dataSources.remove(e.dataSources.getByName(`${o==null?void 0:o.dataSourcePrefix}${t.name}`)[0]),o&&d){const p=new g.GeoJsonDataSource(`${o==null?void 0:o.dataSourcePrefix}${t.name}`);e.dataSources.add(p),p.load({type:"FeatureCollection",features:b}).then(v=>{v==null||v.entities.values.forEach(I=>{var L;I.billboard=new g.BillboardGraphics({image:(L=I.properties)==null?void 0:L.label.getValue(g.JulianDate.now()).dataURL,heightReference:g.HeightReference.NONE,scale:1,disableDepthTestDistance:Number.POSITIVE_INFINITY})})})}},Zi=.2,Xi=(e,t=Zi)=>e.width===0?(e.east=e.east+1e-4*t,e.west=e.west-1e-4*t,e.south=e.south-1e-4*t,e.north=e.north+1e-4*t,e):(e.east=e.east+e.width*t,e.west=e.west-e.width*t,e.south=e.south-e.height*t,e.north=e.north+e.height*t,e),ws="",Ji=({options:e,isOpen:t,locale:n})=>{const r=pe(),s=a.useRef(void 0),o=a.useRef(null),[d,h]=a.useState(""),[f,E]=a.useState(!1),[C,b]=a.useState(!0),[p,v]=a.useState(),[I,L]=a.useState(),F=a.useMemo(()=>$.get(n,"SHOW_FEATURE_ON_MAP")??"Show on map",[n]),G=a.useMemo(()=>$.get(n,"IN_MAP_EXTENT")??"Search in extent",[n]),j=a.useMemo(()=>$.get(n,"SEARCH_PLACEHOLDER")??"Search...",[n]),Y=a.useMemo(()=>$.get(n,"NO_RESULTS")??"No Results",[n]),V=a.useMemo(()=>r.scene.mode===g.SceneMode.SCENE2D?!1:(E(!1),!0),[r.scene.mode]),X=300,W=i.jsx("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",children:i.jsx("rect",{x:"0",y:"0",width:16,height:16,rx:"2",ry:"2",fill:"white",stroke:"#ccc",strokeWidth:1})}),Z=i.jsxs("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",children:[i.jsx("rect",{x:"0",y:"0",width:16,height:16,rx:"2",ry:"2",fill:"#1976d2",stroke:"#1976d2",strokeWidth:1}),i.jsx("path",{d:"M4 8l2 2 6-6",fill:"none",stroke:"white",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})]});a.useEffect(()=>{e.forEach(m=>{m.baseUrl&&m.endPoint&&!m.url&&(m.url=m.baseUrl+m.endPoint)})},[e]),a.useEffect(()=>{t&&o.current&&o.current.focus()},[t]),a.useEffect(()=>{if(!r)return;if(!s.current){const T=new g.GeoJsonDataSource("geocoderDataSource");s.current=T,r.dataSources.add(T)}const m=s.current;I&&C?(async()=>{const k={type:"FeatureCollection",features:[I]};await m.load(k),vn(r,m,[],"#01FF1F")})():m.entities.removeAll()},[r,C,I]);const te=m=>{switch(typeof m){case"object":return Array.isArray(m)?`[${m.map(T=>`'${T}'`).join(", ")}]`:JSON.stringify(m);case"boolean":case"number":case"string":return m.toString();case"undefined":return}},l=(m,T,k)=>{const N=te(k);if(N){const A=m.includes("?")?m.endsWith("?")||m.endsWith("&")?"":"&":"?";return`${m}${A}${encodeURIComponent(T)}=${encodeURIComponent(N)}`}return m},c=(m,T)=>(m&&m.forEach(k=>{T=l(T,k[0],k[1])}),T),_=a.useCallback((m,T,k,N)=>((()=>{const D=T.dynamic.queryText,B=typeof D=="string"?D:D.name,ee=typeof D=="string"?void 0:D.relatedParams;if(m=l(m,B,k),ee&&ee.forEach(ne=>{m=l(m,ne[0],ne[1])}),N){const ne=yn(r),q=T.dynamic.geoContext,R=typeof q=="string"?q:q==null?void 0:q.name;if(ne&&R){const ie=mn(ne),he={bbox:[ie[0],ie[1],ie[2],ie[3]]};m=l(m,R,he);const ve=typeof q=="string"||q==null?void 0:q.relatedParams;ve&&ve.forEach(oe=>{m=l(m,oe[0],oe[1])})}}})(),m=c(T.static,m),m),[r]),y=a.useCallback(async(m,T)=>{if(!m){v([]);return}const k=e.map(async D=>{if(D.url){const B=_(D.url,D.params,m,T);return fetch(B,{method:"GET"})}else return Promise.reject({message:"No URL provided. Please provide one"})}),N=await Promise.all(k),A=await Promise.all(N.filter(D=>D!==void 0).map(async D=>{var ee;const B=await D.json();return B.features=(ee=B.features)==null?void 0:ee.map(ne=>({...ne,properties:{...ne.properties,headers:D.headers}})),{body:B,status:D.status,url:D.url,headers:Object.fromEntries(D.headers.entries())}}));v(A)},[_,e]),S=a.useMemo(()=>$.debounce((m,T)=>{y(m,T)},X),[y]);a.useEffect(()=>()=>S.cancel(),[S]);const w=(m,T)=>{h(m),S(m,T)};a.useEffect(()=>{y(d,f)},[f]);const P=m=>{const T=cr.getType(m);let k;switch(T){case"Point":k=i.jsx("svg",{width:"18px",height:"18px",viewBox:"0 0 24 24",fill:"var(--mdc-theme-cesium-color)",children:i.jsx("path",{d:"M12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm8.94 3c-.46-4.17-3.77-7.48-7.94-7.94V1h-2v2.06C6.83 3.52 3.52 6.83 3.06 11H1v2h2.06c.46 4.17 3.77 7.48 7.94 7.94V23h2v-2.06c4.17-.46 7.48-3.77 7.94-7.94H23v-2h-2.06zM12 19c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"})});break;case"LineString":k=i.jsxs("svg",{width:"18px",height:"18px",viewBox:"0 0 24 24",children:[i.jsx("path",{fill:"var(--mdc-theme-cesium-color)",stroke:"var(--mdc-theme-cesium-color)",strokeWidth:.5,d:"M21 6h.046l-5.25 9h-.944L10 9.455V7H7v2.926L1.862 18H0v3h3v-2.926L8.138 10h1.01L14 15.545V18h3v-3h-.046l5.25-9H24V3h-3zM8 8h1v1H8zM2 20H1v-1h1zm14-3h-1v-1h1zm7-13v1h-1V4z"}),i.jsx("path",{fill:"none",d:"M0 0h24v24H0z"})]});break;default:k=i.jsx("svg",{width:"18px",height:"18px",viewBox:"0 0 24 24",fill:"none",stroke:"var(--mdc-theme-cesium-color)",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("path",{d:"M11 4 L20 14 L20 20 L4 20 L4 10 Z"})});break}return i.jsx(Q,{children:k})};return i.jsx(Q,{className:"geocoderContainer",children:i.jsxs(Q,{className:"geocoderForm",children:[i.jsx(J.TextField,{id:"geocoderTextField",className:"cesium-geocoder-input",ref:o,onChange:m=>w(m.target.value,f),placeholder:j,value:d,autoComplete:"off"}),i.jsxs(Q,{className:"search-results",children:[i.jsxs(Q,{className:"checkboxesContainer",children:[i.jsx(J.Checkbox,{className:"checkboxElement",label:F,icon:W,checkedicon:Z,checked:C,onClick:()=>{b(!C)}}),i.jsx(J.Checkbox,{className:"checkboxElement",label:i.jsx(J.Typography,{tag:"span",className:V?"disabled":"",children:G}),checked:f,icon:W,checkedicon:Z,disabled:V,onClick:()=>{E(!f)}})]}),i.jsx(Q,{className:"listsContainer",children:e.map((m,T)=>i.jsxs(J.List,{children:[i.jsx(J.Typography,{className:"bold",tag:"span",children:m.title??m.endPoint}),i.jsx(Q,{className:"listContainer",children:(()=>{var B,ee,ne,q,R,ie,he,ve;const k=(ee=(B=p==null?void 0:p[T])==null?void 0:B.body)==null?void 0:ee.features,N=(R=(q=(ne=p==null?void 0:p[T])==null?void 0:ne.body)==null?void 0:q.features)==null?void 0:R.length,A=(he=(ie=p==null?void 0:p[T])==null?void 0:ie.body)==null?void 0:he.message,D=(ve=p==null?void 0:p[T])==null?void 0:ve.status;return N?k.map((oe,fe)=>{var O,x,H,z,U;return i.jsx(J.ListItem,{className:I===oe?"mdc-ripple-upgraded--background-focused":"",onClick:()=>{var K;r.camera.flyTo({destination:Xi(pn.fromDegrees(...qe(oe.geometry)))}),L(oe),(K=m.callbackFunc)==null||K.call(m,oe,m,fe)},children:i.jsxs(Q,{className:"queryItemResult",children:[i.jsx(J.Tooltip,{content:(x=(O=oe==null?void 0:oe.properties)==null?void 0:O.names)==null?void 0:x.display,children:i.jsx(Q,{children:(U=(z=(H=oe==null?void 0:oe.properties)==null?void 0:H.names)==null?void 0:z.default)==null?void 0:U[0]})}),P(oe)]})},`feature-${fe}`)}):N===0?i.jsx(J.ListItemSecondaryText,{className:"generalListItem queryNoResults",children:Y}):A?i.jsx(J.ListItemSecondaryText,{className:`generalListItem ${D===400?"queryWarning":"queryError"}`,children:A}):i.jsx(J.ListItemSecondaryText,{className:"generalListItem"})})()})]}))})]})]})})},Ki=({options:e,locale:t})=>{const[n,r]=a.useState(!1);return i.jsxs(i.Fragment,{children:[i.jsx(et,{onClick:()=>r(s=>!s),children:i.jsx("svg",{className:"cesium-svgPath-svg",width:"32",height:"32",fill:"var(--mdc-theme-cesium-color)",viewBox:"0 0 32 32",children:i.jsx("path",{d:"M29.772,26.433l-7.126-7.126c0.96-1.583,1.523-3.435,1.524-5.421C24.169,8.093,19.478,3.401,13.688,3.399C7.897,3.401,3.204,8.093,3.204,13.885c0,5.789,4.693,10.481,10.484,10.481c1.987,0,3.839-0.563,5.422-1.523l7.128,7.127L29.772,26.433zM7.203,13.885c0.006-3.582,2.903-6.478,6.484-6.486c3.579,0.008,6.478,2.904,6.484,6.486c-0.007,3.58-2.905,6.476-6.484,6.484C10.106,20.361,7.209,17.465,7.203,13.885z"})})}),i.jsx(Et,{isVisible:n,children:i.jsx(Ji,{options:e,isOpen:n,locale:t})})]})},Qi={GLOBAL:{"BM-GOOGLE_TERRAIN-XYZ_LAYER":"https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}","BM-INFRARED_RASTER-WMS_LAYER":"https://mesonet.agron.iastate.edu/cgi-bin/wms/goes/conus_ir.cgi?","BM-RADAR_RASTER-WMS_LAYER":"https://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi?","BM-VECTOR_TILES_GPS-XYZ_LAYER":"https://gps.tile.openstreetmap.org/lines/{z}/{x}/{y}.png","BM-VECTOR_TILES-XYZ_LAYER":"https://{s}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png?apikey=6170aad10dfd42a38d4d8c709a536f38","BM-WMTS_POPULATION_TILES-WMTS_LAYER":"https://services.arcgisonline.com/arcgis/rest/services/Demographics/USA_Population_Density/MapServer/WMTS/","3D_MODEL":"https://3d.ofek-air.com/3d/Jeru_Old_City_Cesium/ACT/Jeru_Old_City_Cesium_ACT.json"},"WFS Vector layer":{"3d_model":"https://tiles.mapcolonies.net/api/3d/v1/b3dm/32d542c1-b956-4579-91df-2a43b183d8b3/data/vricon.3dtiles/tileset.json?token=eyJhbGciOiJSUzI1NiIsImtpZCI6Im1hcC1jb2xvbmllcy1pbnQifQ.eyJhbyI6WyJodHRwczovL2FwcC1pbnQtY2xpZW50LXJvdXRlLWludGVncmF0aW9uLmFwcHMuajFsazNuanAuZWFzdHVzLmFyb2FwcC5pbyIsImh0dHBzOi8vYXBwLWludC1jbGllbnQtdG9vbHMtcm91dGUtaW50ZWdyYXRpb24uYXBwcy5qMWxrM25qcC5lYXN0dXMuYXJvYXBwLmlvIiwiaHR0cDovL2xvY2FsaG9zdDozMDAwIl0sImQiOlsicmFzdGVyIiwicmFzdGVyV21zIiwicmFzdGVyRXhwb3J0IiwiZGVtIiwidmVjdG9yIiwiM2QiXSwiaWF0IjoxNjc0NjMyMzQ2LCJzdWIiOiJtYXBjb2xvbmllcy1hcHAiLCJpc3MiOiJtYXBjb2xvbmllcy10b2tlbi1jbGkifQ.e-4SmHNOE8FwpcJoHdp-3Dh6D8GqCwM5wZfZIPrivGhfeKdihcsjEj_WN2jWN-ULha_ytZN5gRusLjwikNwgbF6hvb-QTDe3bEHPAjtgpZmF4HaJze8e6VPDF1tTC52CHDzNnwkUGAH1tnVGq10SnyhsGDezUChTVeBeVu-swTI58qCjemUQRw7-Q03uSEH24AkbX2CC1_rNwulo7ChglyTdn01tTWPsPjIuDjeixxm2CUmUHpfZzroaSzwof7ByQe22o3tFddje6ItNLBUC_VN7UfNLa_QPSVbIuNac-iMGFbK-RIyXUK8mp1AwddvSGsBUYcDs8fWMLzKhItljnw",vector_geoserver:"http://geoserver-vector-dev.apps.j1lk3njp.eastus.aroapp.io/geoserver/core/ows"},"WFS Vector layer (Visual)":{"3d_model":"https://tiles.mapcolonies.net/api/3d/v1/b3dm/32d542c1-b956-4579-91df-2a43b183d8b3/data/vricon.3dtiles/tileset.json?token=eyJhbGciOiJSUzI1NiIsImtpZCI6Im1hcC1jb2xvbmllcy1pbnQifQ.eyJhbyI6WyJodHRwczovL2FwcC1pbnQtY2xpZW50LXJvdXRlLWludGVncmF0aW9uLmFwcHMuajFsazNuanAuZWFzdHVzLmFyb2FwcC5pbyIsImh0dHBzOi8vYXBwLWludC1jbGllbnQtdG9vbHMtcm91dGUtaW50ZWdyYXRpb24uYXBwcy5qMWxrM25qcC5lYXN0dXMuYXJvYXBwLmlvIiwiaHR0cDovL2xvY2FsaG9zdDozMDAwIl0sImQiOlsicmFzdGVyIiwicmFzdGVyV21zIiwicmFzdGVyRXhwb3J0IiwiZGVtIiwidmVjdG9yIiwiM2QiXSwiaWF0IjoxNjc0NjMyMzQ2LCJzdWIiOiJtYXBjb2xvbmllcy1hcHAiLCJpc3MiOiJtYXBjb2xvbmllcy10b2tlbi1jbGkifQ.e-4SmHNOE8FwpcJoHdp-3Dh6D8GqCwM5wZfZIPrivGhfeKdihcsjEj_WN2jWN-ULha_ytZN5gRusLjwikNwgbF6hvb-QTDe3bEHPAjtgpZmF4HaJze8e6VPDF1tTC52CHDzNnwkUGAH1tnVGq10SnyhsGDezUChTVeBeVu-swTI58qCjemUQRw7-Q03uSEH24AkbX2CC1_rNwulo7ChglyTdn01tTWPsPjIuDjeixxm2CUmUHpfZzroaSzwof7ByQe22o3tFddje6ItNLBUC_VN7UfNLa_QPSVbIuNac-iMGFbK-RIyXUK8mp1AwddvSGsBUYcDs8fWMLzKhItljnw"},"WFS PP layer":{raster_pp_geoserver:"https://raster-serving-int-pp-geoserver-nginx-route-manual-integration.apps.j1lk3njp.eastus.aroapp.io/geoserver/wfs?token=eyJhbGciOiJSUzI1NiIsImtpZCI6Im1hcC1jb2xvbmllcy1pbnQifQ.eyJkIjpbInJhc3RlciIsInJhc3RlcldtcyIsInJhc3RlckV4cG9ydCIsImRlbSIsInZlY3RvciIsIjNkIl0sImlhdCI6MTY3NDYzMjM0Niwic3ViIjoibWFwY29sb25pZXMtYXBwIiwiaXNzIjoibWFwY29sb25pZXMtdG9rZW4tY2xpIn0.D1u28gFlxf_Z1bzIiRHZonUgrdWwhZy8DtmQj15cIzaABRUrGV2n_OJlgWTuNfrao0SbUZb_s0_qUUW6Gz_zO3ET2bVx5xQjBu0CaIWdmUPDjEYr6tw-eZx8EjFFIyq3rs-Fo0daVY9cX1B2aGW_GeJir1oMnJUURhABYRoh60azzl_utee9UdhDpnr_QElNtzJZIKogngsxCWp7tI7wkTuNCBaQM7aLEcymk0ktxlWEAt1E0nGt1R-bx-HnPeeQyZlxx4UQ1nuYTijpz7N8poaCCExOFeafj9T7megv2BzTrKWgfM1eai8srSgNa3I5wKuW0EyYnGZxdbJe8aseZg"}},Pe=(e,t)=>Qi[e][t],Ri=Pe("GLOBAL","DEFAULT_TERRAIN_PROVIDER_URL");Pe("GLOBAL","TERRAIN_SRTM100"),Pe("GLOBAL","TERRAIN_COMBINED"),Pe("GLOBAL","BM-GOOGLE_TERRAIN-XYZ_LAYER"),Pe("GLOBAL","BM-INFRARED_RASTER-WMS_LAYER"),Pe("GLOBAL","BM-RADAR_RASTER-WMS_LAYER"),Pe("GLOBAL","BM-GOOGLE_TERRAIN-XYZ_LAYER"),Pe("GLOBAL","BM-VECTOR_TILES_GPS-XYZ_LAYER"),Pe("GLOBAL","BM-VECTOR_TILES-XYZ_LAYER"),Pe("GLOBAL","BM-VECTOR_TILES_GPS-XYZ_LAYER"),Pe("GLOBAL","BM-WMTS_POPULATION_TILES-WMTS_LAYER");const En=(e,t,n)=>{let r;if(e.scene.mode!==g.SceneMode.SCENE2D)r=e.scene.pickPosition(new g.Cartesian2(t,n));else{const s=e.scene.globe.ellipsoid;r=e.camera.pickEllipsoid(new g.Cartesian2(t,n),s)}return g.Cartographic.fromCartesian(r)},eo=(e,t,n)=>{const r=En(e,t,n);return{type:"Feature",properties:{},geometry:{type:"Point",coordinates:[g.Math.toDegrees(r.longitude),g.Math.toDegrees(r.latitude)]}}},wn=(e,t,n)=>{try{const r=En(e,t,n);return{longitude:g.Math.toDegrees(r.longitude),latitude:g.Math.toDegrees(r.latitude)}}catch{return}},rt=3,it="hasTransparency";function wt(e,t,n,r,s){return setTimeout(()=>{var h;const o=(h=this.layerListInstance.find(f=>{var E,C;return((E=f._imageryProvider._resource)==null?void 0:E._url)===((C=this._resource)==null?void 0:C._url)}))==null?void 0:h.meta,d=$.get(o,it)===!0;this.tileTransparencyCheckedCounter<rt&&!d&&$i(s==null?void 0:s.url,this).then(f=>{var E;(E=this.mapViewer.layersManager)==null||E.addMetaToLayer({[it]:f},C=>C._imageryProvider._resource._url===this._resource._url)})},0),e(t,n,r,s)}class Ln extends g.UrlTemplateImageryProvider{constructor(n,r){var s;super(n);ue(this,"layerListInstance");ue(this,"mapViewer");ue(this,"maxTilesForTransparencyCheck",rt);ue(this,"tileTransparencyCheckedCounter",0);this.layerListInstance=(s=r.layersManager)==null?void 0:s.layerList,this.mapViewer=r}requestImage(n,r,s,o){return wt.call(this,super.requestImage.bind(this),n,r,s,o)}}class Tn extends g.WebMapServiceImageryProvider{constructor(n,r){var s;super(n);ue(this,"layerListInstance");ue(this,"mapViewer");ue(this,"maxTilesForTransparencyCheck",rt);ue(this,"tileTransparencyCheckedCounter",0);this.layerListInstance=(s=r.layersManager)==null?void 0:s.layerList,this.mapViewer=r}requestImage(n,r,s,o){return wt.call(this,super.requestImage.bind(this),n,r,s,o)}}class Sn extends g.WebMapTileServiceImageryProvider{constructor(n,r){var s;super(n);ue(this,"layerListInstance");ue(this,"mapViewer");ue(this,"maxTilesForTransparencyCheck",rt);ue(this,"tileTransparencyCheckedCounter",0);this.layerListInstance=(s=r.layersManager)==null?void 0:s.layerList,this.mapViewer=r}requestImage(n,r,s,o){return wt.call(this,super.requestImage.bind(this),n,r,s,o)}}const to=1,no=-1,bn="TRANSPARENT_BASE_LAYER";class ro{constructor(t,n,r,s,o){ue(this,"mapViewer");ue(this,"legendsList");ue(this,"layerUpdated");ue(this,"dataLayerUpdated");ue(this,"layers");ue(this,"dataLayers");ue(this,"legendsExtractor");ue(this,"layerManagerFootprintMetaFieldPath");ue(this,"shouldOptimizedTileRequests");this.mapViewer=t,this.layers=this.mapViewer.imageryLayers._layers,this.dataLayers=[],this.legendsList=[],this.legendsExtractor=n,this.layerUpdated=new g.Event,this.dataLayerUpdated=new g.Event,this.layerManagerFootprintMetaFieldPath=s,this.shouldOptimizedTileRequests=o??!1,r&&this.addLayerUpdatedListener(r),this.shouldOptimizedTileRequests&&(this.addLayerUpdatedListener(d=>{const h=Object.keys(d);h.length===1&&h[0]===it&&(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}isBaseMapLayer(t){return!!$.get(t,"parentBasetMapId")}addDataLayer(t){this.dataLayers.push({...t}),this.dataLayerUpdated.raiseEvent(this.dataLayers)}addMetaToLayer(t,n){const r=this.layers.map(s=>s.imageryProvider.readyPromise);Promise.all(r).then(s=>{const o=this.layers.find(n);o&&(o.meta={...o.meta??{},...t},this.setLegends(),this.layerUpdated.raiseEvent(t))})}addMetaToDataLayer(t){const n=this.findDataLayerById(t.id);n&&(n.meta={...n.meta??{},...t},this.dataLayerUpdated.raiseEvent(this.dataLayers,t.id))}setBaseMapLayers(t){t.baseRasterLayers.sort((r,s)=>r.zIndex-s.zIndex).forEach((r,s)=>{this.addRasterLayer(r,s,t.id)}),this.shouldOptimizedTileRequests&&(this.removeLayer(bn),this.addTransparentImageryProvider())}addRasterLayer(t,n,r){let s;switch(t.type){case"XYZ_LAYER":{const o=t.options,d=this.shouldOptimizedTileRequests?new Ln(o,this.mapViewer):new g.UrlTemplateImageryProvider(o);s=this.mapViewer.imageryLayers.addImageryProvider(d,n);break}case"WMS_LAYER":{const o=t.options,d=this.shouldOptimizedTileRequests?new Tn(o,this.mapViewer):new g.WebMapServiceImageryProvider(o);s=this.mapViewer.imageryLayers.addImageryProvider(d,n);break}case"WMTS_LAYER":{const o=t.options,d=this.shouldOptimizedTileRequests?new Sn(o,this.mapViewer):new g.WebMapTileServiceImageryProvider(o);s=this.mapViewer.imageryLayers.addImageryProvider(d,n);break}}s&&(s.alpha=t.opacity,s.meta={parentBasetMapId:r,...t},t.show!==void 0&&(s.show=t.show))}removeLayer(t){const n=this.findLayerById(t);n&&this.mapViewer.imageryLayers.remove(n,!0)}removeDataLayer(t){const n=this.findDataLayerById(t);if(n){const r=this.dataLayers.indexOf(n);r>-1&&this.dataLayers.splice(r,1),this.dataLayerUpdated.raiseEvent(this.dataLayers)}}removeBaseMapLayers(){this.layers.filter(n=>this.isBaseMapLayer(n.meta)).forEach(n=>{this.mapViewer.imageryLayers.remove(n,!0)})}removeNotBaseMapLayers(){this.layers.filter(n=>!$.get(n.meta,"parentBasetMapId")).forEach(n=>{this.mapViewer.imageryLayers.remove(n,!0)})}raise(t,n=1){const r=this.findLayerById(t),s=(r==null?void 0:r.meta).zIndex;if(r)for(let o=0;o<n;o++)this.mapViewer.imageryLayers.raise(r);this.updateLayersOrder(t,s,s+n)}lower(t,n=1){const r=this.findLayerById(t),s=(r==null?void 0:r.meta).zIndex,o=this.getBaseLayersCount(),d=this.mapViewer.imageryLayers.indexOf(r);if(d-n<=o&&(n=d-o),r)for(let h=0;h<n;h++)this.mapViewer.imageryLayers.lower(r);this.updateLayersOrder(t,s,s-n)}raiseToTop(t){const n=this.findLayerById(t),r=(n==null?void 0:n.meta).zIndex;n&&this.mapViewer.imageryLayers.raiseToTop(n),this.updateLayersOrder(t,r,this.mapViewer.imageryLayers.length-this.getBaseLayersCount()-1)}lowerToBottom(t){const n=this.findLayerById(t),r=this.getBaseLayersCount(),s=this.mapViewer.imageryLayers.indexOf(n);this.lower(t,s-r)}length(){return this.mapViewer.imageryLayers.length}show(t,n){const r=this.get(t);r!==void 0&&(r.show=n)}showAllNotBase(t){this.layers.filter(r=>!$.get(r.meta,"parentBasetMapId")).forEach(r=>{var s;this.show((s=r.meta)==null?void 0:s.id,t)})}get(t){const n=this.findLayerById(t),r=this.mapViewer.imageryLayers.indexOf(n);return r?this.mapViewer.imageryLayers.get(r):void 0}pickImageryLayers(t){var s;const n=this.mapViewer.camera.getPickRay(t);let r;return n&&(r=(s=this.mapViewer.imageryLayers.pickImageryLayers(n,this.mapViewer.scene))==null?void 0:s.filter(o=>!$.get(o.meta,"parentBasetMapId"))),r}findLayerByPOI(t,n,r=!0){if(this.layerManagerFootprintMetaFieldPath){const s=eo(this.mapViewer,t,n);return this.layers.filter(h=>!$.get(h.meta,"parentBasetMapId")).filter(h=>{const f=$.get(h.meta,this.layerManagerFootprintMetaFieldPath);return f!==void 0?hr(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 E,C;return((E=f.meta)==null?void 0:E.zIndex)-((C=h.meta)==null?void 0:C.zIndex)})}else return console.warn("[LayerManager] [findLayerByPOI]layerManagerFootprintMetaFieldPath is not defined"),[]}addTransparentImageryProvider(){const t=this.mapViewer.imageryLayers.addImageryProvider(new g.SingleTileImageryProvider({url:"./assets/img/transparent-tile.png",rectangle:new g.Rectangle(-3.141592653589793,-1.5707963267948966,3.141592653589793,1.5707963267948966)}),0);t.meta={id:bn,skipRelevancyCheck:!0,parentBasetMapId:"TRANSPARENT_LAYER"}}addLayerUpdatedListener(t){this.layerUpdated.addEventListener(t,this)}removeLayerUpdatedListener(t){this.layerUpdated.removeEventListener(t,this)}addDataLayerUpdatedListener(t){this.dataLayerUpdated.addEventListener(t,this)}removeDataLayerUpdatedListener(t){this.dataLayerUpdated.removeEventListener(t,this)}findDataLayerById(t){return this.dataLayers.find(n=>n.meta.id===t)}setLegends(){typeof this.legendsExtractor<"u"&&(this.legendsList=this.legendsExtractor(this.layers))}getBaseLayersCount(){return this.layers.filter(n=>!!$.get(n.meta,"parentBasetMapId")).length}findLayerById(t){return this.layers.find(n=>n.meta!==void 0?n.meta.id===t:!1)}updateLayersOrder(t,n,r){const s=n>r?to:no,o=n<r?n:r,d=n<r?r:n;this.layers.forEach(h=>{var E;if(!$.get(h.meta,"parentBasetMapId")){const C=(E=h.meta)==null?void 0:E.zIndex;h.meta.zIndex=C>=o&&C<=d&&C!==n?C+s:C===n?r:C}})}hideNonRelevantLayers(){var t,n;for(const r of this.layers)((t=r.meta)==null?void 0:t.relevantToExtent)!==r.show&&r.imageryProvider.ready&&(r.show=((n=r.meta)==null?void 0:n.relevantToExtent)??!0)}markRelevantLayersForExtent(){var t,n;try{const r=this.mapViewer.camera.computeViewRectangle();for(let s=this.layers.length-1;s>=0;s--){const o=this.layers[s],d=!$.isEmpty(r)&&!$.isEmpty(o.rectangle)&&g.Rectangle.intersection(r,o.rectangle);for(let h=this.layers.length-1;h>=s;h--){if(((t=o.meta)==null?void 0:t.skipRelevancyCheck)===!0){o.meta={...o.meta,relevantToExtent:!0};continue}const f=this.layers[h],E=((n=f.meta)==null?void 0:n[it])===!0;if(o!==f)if(d instanceof g.Rectangle){if(nt(r,o.rectangle))if(nt(r,f.rectangle)&&!E){o.meta={...o.meta??{},relevantToExtent:!1};break}else o.meta={...o.meta??{},relevantToExtent:!0};if(nt(r,f.rectangle)&&!E){o.meta={...o.meta??{},relevantToExtent:!1};break}if(nt(o.rectangle,f.rectangle)){if(o.meta={...o.meta??{},relevantToExtent:E},!E)break}else o.meta={...o.meta??{},relevantToExtent:!0}}else o.meta={...o.meta??{},relevantToExtent:!1};else s===this.layers.length-1&&(o.meta={...o.meta??{},relevantToExtent:d instanceof g.Rectangle})}}}catch(r){console.error(r)}}}const Ts="",io=({legend:{legendImg:e,legendDoc:t,layer:n},docText:r,imgText:s})=>{const o=a.useCallback(()=>{window.open(e,"_blank")},[e]);a.useCallback(()=>{window.open(t,"_blank")},[t]);const d=a.useCallback(()=>{const E=i.jsx(Q,{className:"layerNameContainer",children:i.jsx("h3",{style:{maxWidth:`${15}ch`},className:"layerName",children:n})});return(n??"").length>15?i.jsx(J.Tooltip,{content:n,children:E}):E},[n]),h=a.useCallback(()=>[typeof e=="string"&&i.jsx("a",{className:"legendAction",href:e,target:"_blank",rel:"noreferrer",children:s}),typeof t=="string"&&i.jsx("a",{className:"legendAction",href:t,target:"_blank",rel:"noreferrer",children:r})],[e,s,t,r]);return i.jsxs(Q,{className:"mapLegend",children:[d(),i.jsx("img",{alt:"Map Legend",className:"legendImg",src:e,onClick:o}),i.jsx(Q,{className:"legendActionsContainer",children:h()})]})},oo=({legends:e,actionsTexts:{docText:t,imgText:n},noLegendsText:r})=>{const s=a.useCallback(()=>i.jsx(Q,{className:"noLegendsContainer",children:i.jsx("h2",{className:"noLegendsMsg",children:r})}),[r]),o=a.useCallback(()=>e.length?e.map((d,h)=>i.jsx(io,{legend:d,docText:t,imgText:n},`${d.layer}_${h}`)):s(),[e]);return i.jsx(Q,{className:"mapLegendsList",children:o()})},so=({isOpen:e,toggleSidebar:t,title:n="Map Legends",noLegendsText:r="No legends to display...",actionsTexts:s={docText:"Docs",imgText:"View Image"},legends:o=[]})=>e?i.jsxs(J.Drawer,{className:"mapLegendSidebarContainer",modal:!1,dismissible:!0,open:e,children:[i.jsx(J.DrawerHeader,{className:"sidebarHeaderContainer",children:i.jsx(J.DrawerTitle,{className:"sidebarTitle",children:n})}),i.jsxs(J.DrawerContent,{className:"sidebarContent",children:[i.jsx(J.Icon,{onClick:t,className:"mapLegendCloseBtn",icon:{icon:"close",size:"small"}}),i.jsx(oo,{noLegendsText:r,legends:o,actionsTexts:s})]})]}):null,ao=({legendToggle:e})=>i.jsx(i.Fragment,{children:i.jsx(et,{onClick:e,children:i.jsxs("svg",{height:"100%",width:"100%",viewBox:"-45 -45 650 650",children:[i.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\r
6
+ 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`}),i.jsx("circle",{cx:"270.1",cy:"56.3",r:"56.3"})]})})}),Ss="",Cn=e=>{const t=pe(),{enableCompass:n=!0,enableZoomControls:r=!1,lockCompassNavigation:s=!1,locale:o={DIRECTION:"ltr"}}=e;return a.useEffect(()=>{if(typeof $.get(t,"cesiumNavigation")>"u"){t.extend(gr,{enableCompass:n,enableZoomControls:r,enableDistanceLegend:!1}),t.cesiumNavigation.setNavigationLocked(s);const d=document.querySelector(".compass");d&&o.DIRECTION&&d.classList.add(o.DIRECTION)}},[t,n,r,o.DIRECTION,s]),null},bs="",Mn=e=>{const t=pe(),n=a.useRef(null),[r,s]=a.useState({x:0,y:0});return a.useEffect(()=>{t.screenSpaceEventHandler.setInputAction(o=>{if(o!=null&&o.endPosition){const d={...o.endPosition};d.x=Math.ceil(d.x),d.y=Math.ceil(d.y),s(d)}},g.ScreenSpaceEventType.MOUSE_MOVE)},[n,t]),a.useEffect(()=>{const o=t.scene.globe.ellipsoid;if(r){const d=wn(t,r.x,r.y);if(d){const h=new gn(d.longitude,d.latitude);if(n.current){let f="";switch(e.projection){case be.WEB_MERCATOR:{const C=new g.WebMercatorProjection(o).project(h);f=`Mercator: ${C.y.toFixed(Qe)}m, ${C.x.toFixed(Qe)}m`,n.current.style.width="220px";break}case be.WGS84:{const E=h.longitude.toFixed(Ke);f=`WGS84: ${h.latitude.toFixed(Ke)}°N ${E}°E`,n.current.style.width="200px";break}}n.current.innerHTML=f}}}},[r,n,t,e.projection]),i.jsx("div",{className:"coordinatesTracker",ref:n})},Cs="",Lt=[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],lo=(e,t,n,r)=>{const s=$.get(r,"METERS_UNIT")??"m",o=$.get(r,"KILOMETERS_UNIT")??"km",d={barWidth:void 0,distanceLabel:void 0,lastLegendUpdate:t.lastLegendUpdate},h=new g.EllipsoidGeodesic,f=new Date().getTime();if(f<d.lastLegendUpdate+250)return;d.lastLegendUpdate=f;const E=e.scene.canvas.clientWidth,C=e.scene.canvas.clientHeight,b=e.scene.camera.getPickRay(new g.Cartesian2(E/2|0,C-1)),p=e.scene.camera.getPickRay(new g.Cartesian2(1+E/2|0,C-1)),v=e.scene.globe,I=v.pick(b,e.scene),L=v.pick(p,e.scene);if(!I||!L)return;const F=v.ellipsoid.cartesianToCartographic(I),G=v.ellipsoid.cartesianToCartographic(L);h.setEndPoints(F,G);const j=h.surfaceDistance,Y=100;let V;for(let X=Lt.length-1;!$.isNumber(V)&&X>=0;--X)Lt[X]/j<Y&&(V=Lt[X]);if($.isNumber(V)){let X="";V>=1e3?X=`${(V/1e3).toString()} ${o}`:X=`${V.toString()} ${s}`,d.barWidth=V/j|0,d.distanceLabel=X}n(d)},_n=e=>{const t=pe(),[n,r]=a.useState({barWidth:void 0,distanceLabel:void 0,lastLegendUpdate:-1});a.useEffect(()=>{const o=f=>{lo(t,n,r,e.locale)},d=new g.EventHelper,h=f=>{t.scene.globe.tilesLoaded&&(o(new MouseEvent("mouse")),d.removeAll())};return d.add(t.scene.globe.tileLoadProgressEvent,h),t.camera.moveEnd.addEventListener(o),()=>{try{$.get(t,"_cesiumWidget")!=null&&t.camera.moveEnd.removeEventListener(o)}catch(f){console.log('CESIUM camera "moveEnd" remove listener failed',f)}}},[t,e.locale,n]);const s=o=>5+(125-o)/2;return i.jsx("div",{className:"scaleTracker",children:$.isNumber(n.barWidth)&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"scaleTrackerLabel",children:i.jsx("bdi",{children:n.distanceLabel})}),i.jsx("div",{className:"scaleTrackerBar",style:{height:"2px",width:`${n.barWidth.toString()}px`,left:`${s(n.barWidth).toString()}px`}})]})})},Ms="",Pn=()=>{const e=pe(),t=[{onClick:()=>e.camera.zoomIn(),iconPath:"M48 20h-18v-18h-10v18h-18v10h18v18h10v-18h18z"},{onClick:()=>e.camera.zoomOut(),iconPath:"M2 20h46v10h-46z"}];return i.jsx("div",{className:"zoomButtons",children:t.map((n,r)=>i.jsx(J.Icon,{icon:i.jsx("div",{className:"zoomButton",children:i.jsx("svg",{fill:"var(--mdc-theme-cesium-color)",width:"12px",height:"12px",viewBox:"0 -20 50 50",version:"1.2",baseProfile:"tiny",xmlns:"http://www.w3.org/2000/svg",overflow:"inherit",children:i.jsx("path",{d:n.iconPath})})}),onClick:n.onClick},r))})},_s="",In=(e,t)=>{const r=$.get(t.scene.globe,"_surface.tileProvider"),s=r._quadtree,o=t.canvas.height,d=$.get(t.camera.frustum,"sseDenominator")??1;for(let h=0;h<=19;h++)if(r.getLevelMaximumGeometricError(h)*o/(e*d)<s.maximumScreenSpaceError)return h;return null},co=(e,t)=>{e=e||10;const n=[];let r=1e5,s=0;for(let o=1e8;o>r;o=o-r){const d=In(o,t);if(d===null)break;if(d!==s){let h=o,f=o+r;for(;f-h>e;)o=h+(f-h)/2,In(o,t)===d?h=o:f=o;n.push({level:d,height:Math.round(o)}),s=d,n.length>=2&&(r=(n[n.length-2].height-o)/1e3)}}return n},An=({locale:e=void 0,valueBy:t="RENDERED_TILES"})=>{const n=pe(),r=Fe(),[s,o]=a.useState(1),d=co(1,n),h=a.useCallback(()=>{const b=n.camera,p=.5;let v=0;switch(n.scene.mode){case tt.SCENE3D:v=n.scene.mapProjection.ellipsoid.cartesianToCartographic(b.positionWC).height;break;case tt.SCENE2D:v=(b.frustum.right-b.frustum.left)*p;break;case tt.COLUMBUS_VIEW:v=b.position.z;break;default:v=0;break}if(d.length>0){const I=d.reduce((L,F)=>Math.abs(F.height-v)<Math.abs(L.height-v)?F:L);o(I.level),r.setViewState&&r.setViewState(L=>({...L,currentZoomLevel:I.level}))}},[n,d]),f=a.useCallback(()=>{let b=0;n.scene.globe._surface.forEachRenderedTile(function(p){b=Math.max(b,p.level)}),o(b),r.setViewState&&r.setViewState(p=>({...p,currentZoomLevel:b}))},[n]),C=a.useMemo(()=>({CALCULATION:h,RENDERED_TILES:f}),[h,f])[t];return a.useEffect(()=>{const b=n.scene.globe.tileLoadProgressEvent.addEventListener(function(){n.scene.globe.tilesLoaded&&C()});return n.camera.moveEnd.addEventListener(C),()=>{try{typeof $.get(n,"_cesiumWidget")<"u"&&(n.camera.moveEnd.removeEventListener(C),b())}catch(p){console.log('CESIUM camera "moveEnd"(from zoom tracker) remove listener failed',p)}}},[n,C]),i.jsxs("div",{className:"zoomLevel",children:[i.jsx("div",{className:"zoomLevelValue",children:s}),i.jsx("div",{className:"zoomLevelLabel",children:$.get(e,"ZOOM_LABEL")??"zoom"})]})},Ps="",On=2,Dn=212,kn=260,uo=0;class ho extends g.Viewer{constructor(n,r){super(n,r);ue(this,"layersManager")}}const Tt=a.createContext(null),go=Tt.Provider,pe=()=>{const e=a.useContext(Tt);if(e===null)throw new Error("map context is null, please check the provider");return e.mapViewer},Fe=()=>{const{mapViewer:e,...t}=a.useContext(Tt);if(t===null)throw new Error("map context viewstate is null, please check the provider");return t},po=e=>{var me,ye,Ie,Ve,We,qn,jn,Yn;const t=a.useRef(null),[n,r]=a.useState(),[s,o]=a.useState(),[d,h]=a.useState(),[f,E]=a.useState(),[C,b]=a.useState(),[p,v]=a.useState(),[I,L]=a.useState(),[F,G]=a.useState(),[j,Y]=a.useState(),[V,X]=a.useState(),[W,Z]=a.useState(!1),[te,l]=a.useState(!1),c=a.useRef(),[_,y]=a.useState([]),[S,w]=a.useState(),[P,m]=a.useState(),[T,k]=a.useState(!1),N=a.useRef(),[A,D]=a.useState(void 0),[B,ee]=a.useState(!1),[ne,q]=a.useState(),[R,ie]=a.useState(),he=J.useTheme(),ve=Wt(he),oe=a.useMemo(()=>W||te,[W,te]);a.useEffect(()=>{ie({currentZoomLevel:-1,shouldOptimizedTileRequests:e.useOptimizedTileRequests??!1})},[]);const fe={fullscreenButton:!0,timeline:!1,animation:!1,baseLayerPicker:!1,geocoder:!1,navigationHelpButton:!1,homeButton:$.isNumber(e.zoom)&&$.isArray(e.center),sceneModePicker:!0,imageryProvider:!1,...e},O=(se,de,le,Ee,Ce)=>{const Oe=n.container,Ae=Oe.clientWidth,ze=Oe.clientHeight,Zn=Ee+Ce;return{left:`${Ae-se<le?se-(le-(Ae-se)):se}px`,top:`${ze-de<Zn?de-(Zn-(ze-de)):de}px`}},x=a.useCallback(se=>{if(t.current!==null){const de=t.current.cesiumElement,le={x:se.offsetX,y:se.offsetY};k(!1),D(le),q(wn(de,le.x,le.y)),k(!0),N.current=se}},[t]);a.useEffect(()=>{var se;if(t.current!==null){const de=t.current.cesiumElement;e.imageryContextMenu&&(de.scene.canvas.removeEventListener("contextmenu",x),de.scene.canvas.addEventListener("contextmenu",x))}r((se=t.current)==null?void 0:se.cesiumElement)},[t,e.imageryContextMenu]);const H=a.useMemo(()=>{var se;if(n)return{mapViewer:n.layersManager?n:Object.assign(n,{layersManager:new ro(n,(se=e.legends)==null?void 0:se.mapLegendsExtractor,()=>{var le;y((le=n.layersManager)==null?void 0:le.legendsList)},e.layerManagerFootprintMetaFieldPath,R==null?void 0:R.shouldOptimizedTileRequests)}),viewState:R,setViewState:ie}},[e.useOptimizedTileRequests,e.legends,e.layerManagerFootprintMetaFieldPath,n,R]);a.useEffect(()=>{var de,le;w(e.baseMaps);const se=(de=e.baseMaps)==null?void 0:de.maps.find(Ee=>Ee.isCurrent);se&&n&&((le=n.layersManager)==null||le.setBaseMapLayers(se))},[e.baseMaps,n]),a.useEffect(()=>{const se=e.terrains||(n&&n.terrainProvider?[{id:"1",url:Ri,title:"Default Terrain",thumbnail:"Cesium/Widgets/Images/TerrainProviders/Ellipsoid.png",isCurrent:!0,terrainProvider:n.terrainProvider}]:void 0);m(se)},[e.terrains,n]),a.useEffect(()=>{h(e.projection??be.WGS84)},[e.projection]),a.useEffect(()=>{o(e.locale)},[e.locale]),a.useEffect(()=>{E(e.showMousePosition??!0)},[e.showMousePosition]),a.useEffect(()=>{b(e.showZoomLevel??!0)},[e.showZoomLevel]),a.useEffect(()=>{v(e.showScale??!0)},[e.showScale]),a.useEffect(()=>{L(e.showCompass??!0)},[e.showCompass]),a.useEffect(()=>{X(e.showLoadingProgress??!0)},[e.showLoadingProgress]),a.useEffect(()=>{Y(e.showActiveLayersTool??!0)},[e.showActiveLayersTool]),a.useEffect(()=>{var de;const se=()=>{if(n===void 0)return{longitude:0,latitude:0,height:0};const le=()=>{const Ee=n.camera.positionCartographic;return{longitude:Re(Ee.longitude),latitude:Re(Ee.latitude),height:Ee.height}};if(n.scene.mode===g.SceneMode.SCENE3D){const Ee=new g.Cartesian2(n.container.clientWidth/On,n.container.clientHeight/On),Ce=n.scene.camera.getPickRay(Ee),Oe=n.scene.globe.pick(Ce,n.scene);if(!Oe)return{longitude:0,latitude:0,height:0};const Ae=n.scene.globe.ellipsoid.cartesianToCartographic(Oe);return Ae!==void 0?{longitude:Re(Ae.longitude),latitude:Re(Ae.latitude),height:n.scene.camera.positionCartographic.height}:le()}else return le()};n&&(n.camera.moveEnd.addEventListener(()=>{if(n.scene.mode!==g.SceneMode.MORPHING){const le=n.camera,Ee={position:se(),direction:le.direction.clone(),up:le.up.clone(),right:le.right.clone(),transform:le.transform.clone(),frustum:le.frustum.clone()};c.current=Ee}}),V&&(n.scene.globe.tileLoadProgressEvent.addEventListener(function(){n.scene.globe.tilesLoaded?Z(!1):Z(!0)}),(de=n.layersManager)==null||de.addDataLayerUpdatedListener(()=>{var Ee;let le=!1;(Ee=n.layersManager)==null||Ee.dataLayerList.forEach(Ce=>{if(typeof Ce.meta.items=="number"&&typeof Ce.meta.total=="number"&&Ce.meta.items>0&&Ce.meta.items<Ce.meta.total){le=!0;return}}),l(le)})))},[n]),a.useEffect(()=>{const se=()=>{if(n&&c.current){const de=c.current;n.camera.flyTo({destination:g.Cartesian3.fromDegrees(de.position.longitude,de.position.latitude,de.position.height),duration:0})}};return n&&n.scene.morphComplete.addEventListener(se),()=>{if(n)try{n.scene.morphComplete.removeEventListener(se)}catch{console.error("morphCompleteHandler event not cleaned")}}},[n]),a.useEffect(()=>{const se=e.zoom,de=e.center;if(n&&$.isNumber(se)&&$.isArray(de)){const le=de[0],Ee=de[1],Ce=hi(se);n.camera.flyTo({destination:g.Cartesian3.fromDegrees(le,Ee,Ce),duration:0});const Oe=n.homeButton.viewModel.command,Ae=function(ze){n.camera.flyTo({destination:g.Cartesian3.fromDegrees(le,Ee,Ce),duration:1}),ze.cancel=!0};return Oe.beforeExecute.addEventListener(Ae),()=>{Oe.beforeExecute.removeEventListener(Ae);try{Oe.beforeExecute.removeEventListener(Ae)}catch{console.error("customHomeButtonHandler event not cleaned")}}}},[e.zoom,e.center,n]),a.useEffect(()=>{G(e.showZoomButtons??!0)},[e.showZoomButtons]);const z=()=>{ee(se=>!se)},U=a.useCallback(()=>n&&ut.createPortal(i.jsxs(i.Fragment,{children:[V&&oe&&i.jsx(J.LinearProgress,{style:{position:"absolute",top:0,height:"10px",zIndex:4}}),I&&i.jsx(Cn,{locale:s}),i.jsxs(Q,{className:"bottomToolsContainer",children:[f&&i.jsx(Mn,{projection:d}),C&&i.jsx(An,{locale:s,valueBy:"RENDERED_TILES"}),p&&i.jsx(_n,{locale:s})]}),F&&i.jsx(Pn,{})]}),document.querySelector(".cesium-viewer")),[n,s,d,f,p,oe]),K=a.useCallback(()=>n&&ut.createPortal(i.jsxs(i.Fragment,{children:[e.geocoderPanel&&i.jsx(Ki,{options:[...e.geocoderPanel],locale:s}),i.jsx(Ei,{baseMaps:S,terrains:P,locale:s}),e.showDebuggerTool&&i.jsx(Li,{locale:s}),i.jsx(ao,{legendToggle:z})]}),document.querySelector(".cesium-viewer-toolbar")),[n,s,S,P]),ce=a.useCallback(()=>n&&ut.createPortal(i.jsx(Q,{className:"cesium-viewer-cesiumInspectorContainer widgetsContainer",children:j&&i.jsx(mi,{locale:s})}),document.querySelector(".cesium-widget")),[n,s]);return i.jsx(J.ThemeProvider,{id:"cesiumTheme",options:ve,children:i.jsx(Me.Viewer,{className:"viewer",full:!0,ref:t,...fe,children:i.jsxs(go,{value:H,children:[i.jsx(so,{title:(me=e.legends)==null?void 0:me.title,isOpen:B,toggleSidebar:z,noLegendsText:(ye=e.legends)==null?void 0:ye.emptyText,legends:((Ie=e.legends)==null?void 0:Ie.legendsList)??_,actionsTexts:(Ve=e.legends)==null?void 0:Ve.actionsTexts}),e.children,U(),K(),ce(),e.imageryContextMenu&&T&&A&&ne&&a.cloneElement(e.imageryContextMenu,{data:(We=n==null?void 0:n.layersManager)==null?void 0:We.findLayerByPOI(A.x,A.y,!1),position:{x:A.x,y:A.y},coordinates:ne,style:O(A.x,A.y,((qn=e.imageryContextMenuSize)==null?void 0:qn.width)??kn,((jn=e.imageryContextMenuSize)==null?void 0:jn.height)??Dn,((Yn=e.imageryContextMenuSize)==null?void 0:Yn.dynamicHeightIncrement)??uo),size:e.imageryContextMenuSize??{height:Dn,width:kn},handleClose:()=>{k(!T)},contextEvt:N.current})]})})})},fo=0,mo=e=>{const t=pe();return i.jsx(Me.Cesium3DTileset,{...e,onReady:n=>{e.isZoomTo===!0&&t.zoomTo(n);const r=t.scene;r.globe.depthTestAgainstTerrain=!0;const s=g.Cartographic.fromCartesian(n.boundingSphere.center),o=e.heightFromGround??fo;if(o){const d=g.Cartesian3.fromRadians(s.longitude,s.latitude,s.height),h=g.Cartesian3.fromRadians(s.longitude,s.latitude,s.height+o),f=g.Cartesian3.subtract(h,d,new g.Cartesian3);n.modelMatrix=g.Matrix4.fromTranslation(f)}}})},ot=180,xn=.001,Nn=e=>Math.abs(e)/e,Bn=e=>{ot-Math.abs(e[0])<xn&&(e[0]=Nn(e[0])*(ot-1)),ot/2-Math.abs(e[1])<xn&&(e[1]=Nn(e[1])*(ot/2-1))},Fn=e=>{switch(e.type){case"LineString":e.coordinates.forEach(t=>{Bn(t)});break;case"Polygon":e.coordinates.forEach(t=>{t.forEach(n=>{Bn(n)})});break}},yo=e=>{const{data:t,...n}=e,r=$.cloneDeep(t);return r&&(typeof r.features<"u"?r.features.forEach(s=>{Fn(s.geometry)}):Fn(r)),i.jsx(Me.GeoJsonDataSource,{data:r,...n})},He=e=>{const{meta:t,...n}=e,r=pe();return a.useLayoutEffect(()=>{var s;(s=r.layersManager)==null||s.addMetaToLayer(t,t.searchLayerPredicate)},[t,r]),i.jsx(Me.ImageryLayer,{...n})},vo=e=>{const{options:t,...n}=e,r=pe(),{viewState:s}=Fe(),o=a.useMemo(()=>s.shouldOptimizedTileRequests?new Tn(t,r):new g.WebMapServiceImageryProvider(t),[s.shouldOptimizedTileRequests]);return i.jsx(He,{...n,imageryProvider:o})},Eo=e=>{const{options:t,...n}=e,r=pe(),{viewState:s}=Fe(),o=a.useMemo(()=>s.shouldOptimizedTileRequests?new Sn(t,r):new g.WebMapTileServiceImageryProvider(t),[s.shouldOptimizedTileRequests]);return i.jsx(He,{...n,imageryProvider:o})},wo=e=>{const{options:t,...n}=e,r=pe(),{viewState:s}=Fe(),o=a.useMemo(()=>s.shouldOptimizedTileRequests?new Ln(t,r):new g.UrlTemplateImageryProvider(t),[s.shouldOptimizedTileRequests]);return i.jsx(He,{...n,imageryProvider:o})},Lo=e=>{const{options:t,...n}=e;return i.jsx(He,{...n,imageryProvider:new g.OpenStreetMapImageryProvider(t)})},To=e=>{const{options:t,meta:n,visualizationHandler:r,withGeometryValidation:s=!1}=e,{url:o,featureType:d,style:h,pageSize:f,zoomLevel:E,maxCacheSize:C,keyField:b,labeling:p}=t,{color:v,hover:I}=h,L=pe(),F=Fe(),G=a.useRef(F.viewState),j=a.useRef(new Map),Y=a.useRef(new Set),V=a.useRef(0),[X,W]=a.useState(n),Z=a.useMemo(()=>g.Color.fromCssColorString(I??"#24AEE9").withAlpha(.5),[I]),te=a.useMemo(()=>`wfs_${d}_${Nt.v4()}`,[d]),l=a.useRef(!1);a.useEffect(()=>{G.current=F.viewState},[F.viewState]);const c=new g.GeoJsonDataSource(te),_=O=>{const x=[],H=n.featureStructure;if(H&&H.fields)for(const U of H.fields){const{fieldName:K,aliasFieldName:ce}=U,me=ce,ye=O[K]??"N/A",Ie=Math.max(100,Math.min(180,me.length*10)),Ve="260px";x.push(`
2
7
  <tr>
3
- <td><strong>${ve}:</strong></td>
4
- <td>${q}</td>
8
+ <td style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: ${Ie}px; display: table-cell;">
9
+ <strong>${me}:</strong>
10
+ </td>
11
+ <td style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: ${Ve}; display: table-cell;" title="${ye}">
12
+ ${ye}
13
+ </td>
5
14
  </tr>
6
15
  `)}return`
7
- <table style="width: 100%; direction: ${N.fields.some(V=>V.aliasFieldName!==V.fieldName)?"rtl":"ltr"};">
16
+ <table style="width: 100%; direction: ${H.fields.some(U=>U.aliasFieldName!==U.fieldName)?"rtl":"ltr"};">
8
17
  <tbody>
9
- ${P.join("")}
18
+ ${x.join("")}
10
19
  </tbody>
11
20
  </table>
12
- `},w=b=>b?b.polyline?"polyline":"polygon":"",p=b=>{var G,V;const P=(V=(G=b==null?void 0:b.polygon)==null?void 0:G.hierarchy)==null?void 0:V.getValue(u.JulianDate.now());if(!P)return null;const N=P.positions;return u.BoundingSphere.fromPoints(N).center},C=b=>{const N=_.scene.drillPick(b).map(V=>V.id).filter(V=>V&&V.polygon&&V.entityCollection.owner.name===Z);if(N.length===0)return null;const G=N.map(V=>{const K=p(V);if(!K)return{entity:V,distance:Number.MAX_VALUE};const oe=u.SceneTransforms.wgs84ToWindowCoordinates(_.scene,K);if(!oe)return{entity:V,distance:Number.MAX_VALUE};const ve=b.x-oe.x,q=b.y-oe.y,te=Math.sqrt(ve*ve+q*q);return{entity:V,distance:te}});return G.sort((V,K)=>K.distance-V.distance),G[0].entity},v=b=>{let P=null,N=null;b.setInputAction(G=>{if(_.scene.mode===u.SceneMode.SCENE2D){const K=_.scene.pick(G.endPosition);K&&K.id&&(K.id.polygon||K.id.polyline)?j.get(P,"id")!==j.get(K.id,"id")&&(P&&(P[w(P)].material=N,_.container.style.cursor="default"),P=K.id,N=P[w(P)].material,P[w(P)].material=W,_.container.style.cursor="pointer"):P&&(P[w(P)].material=N,P=null,_.container.style.cursor="default")}else{const K=C(G.endPosition);K?j.get(P,"id")!==j.get(K,"id")&&(P&&(P[w(P)].material=N,_.container.style.cursor="default"),P=K,N=P[w(P)].material,P[w(P)].material=W,_.container.style.cursor="pointer"):P&&(P[w(P)].material=N,P=null,_.container.style.cursor="default")}},u.ScreenSpaceEventType.MOUSE_MOVE)},L=(b,P)=>{const N=navigator.hardwareConcurrency||4;let G=Math.ceil(N*1.5);return P==="cpu"&&(G=Math.max(2,Math.ceil(N/2))),b>=y?Math.min(200,G*4):b>1e3?Math.min(100,G*2):b>300?Math.min(50,G):Math.min(10,G)},E=(b=-1,P=-1)=>{ee(N=>({...N,...t,cache:J.current.size,items:b,total:P,currentZoomLevel:Q.current.currentZoomLevel}))},D=()=>{if(a.entities&&a.entities.values.length>0){a.show=!1,X.current=0;const b=_.dataSources.getByName(`${m==null?void 0:m.dataSourcePrefix}${a.name}`)[0];b&&(b.show=!1,_.dataSources.remove(b))}E(0,0)},k=async(b,P="GET",N)=>{const G={method:P};N!==void 0&&(G.body=N);const V=await fetch(b,G);if(V.status===200)return await V.json()},A=document.createElement("canvas"),I=A.getContext("2d"),x=b=>{const P={fontName:"sans-serif",fontSize:14,padding:4,fillStyle:"white",strokeStyle:"black",lineWidth:3},N=b.split(`
13
- `),G=(m==null?void 0:m.fontSize)??P.fontSize,V=(m==null?void 0:m.padding)??P.padding,K=G+2;I.clearRect(0,0,A.width,A.height),I.font=`${G}px ${(m==null?void 0:m.fontName)??P.fontName}`;const oe=Math.max(...N.map(te=>I.measureText(te).width)),ve=document.createElement("canvas");ve.width=oe+V*2,ve.height=K*N.length+V*2;const q=ve.getContext("2d");return q.font=`${G}px ${(m==null?void 0:m.fontName)??P.fontName}`,q.fillStyle=(m==null?void 0:m.fillStyle)??P.fillStyle,q.strokeStyle=(m==null?void 0:m.strokeStyle)??P.strokeStyle,q.lineWidth=(m==null?void 0:m.lineWidth)??P.lineWidth,N.forEach((te,H)=>{const ne=V+(H+1)*K-4;q.strokeText(te,V,ne),q.fillText(te,V,ne)}),{dataURL:ve.toDataURL(),width:ve.width,height:ve.height}},B=b=>m==null?void 0:m.text.pattern.replace(/\$\{([^}]+)\}/g,(N,G)=>{const V=m.text.fields.find(oe=>oe.name===G);let K="";if(V)if(V.predicate)K=V.predicate(b.properties[G]);else switch(V.type){case"date":K=Me.format(new Date(b.properties[G]),V.format??"dd/MM/yyyy");break;default:K=b.properties[G];break}return K}),ie=async(b,P)=>{const N=[];return b.length>0&&await ut(b,G=>{if(G.properties){const V=G.properties[T??"id"];if(!J.current.has(V)){J.current.add(V),G.properties.fetch_id=P;const K=G.properties.description;if(G.properties.description=void 0,G.properties._description=K,m){const oe=x(B(G));G.properties.label=oe}N.push(G)}}},{concurrency:L(b.length,"cpu")}),N},le=(b,P)=>Array.from($.current.values()).filter(N=>JSON.stringify(N.parentBBox)!==JSON.stringify(b)).reduce((N,G)=>{const V=ri(P,G.bbox);return V>N.distance?{id:G.id,key:G.bbox.join(","),distance:V}:N},{id:"",key:"",distance:-1/0}),U=async b=>{const P=[];await ut(a.entities.values,N=>{if(N.properties&&N.properties.fetch_id.getValue()===b){const G=N.properties[T??"id"].getValue();J.current.delete(G),P.push(N)}},{concurrency:L(a.entities.values.length,"cpu")}),P.length>0&&await ut(P,N=>{a.entities.remove(N)},{concurrency:L(P.length,"cpu")})},re=async(b,P)=>{for(;J.current.size>y;){const N=le(b,P);if(N.id==="")break;await U(N.id),N.key&&$.current.delete(N.key)}},pe=async(b,P,N,G)=>{let V="",K="",oe=[];if(b.numberReturned&&b.numberReturned!==0&&(b.bbox&&(K=b.bbox.join(","),$.current.has(K)||(V=It.v4())),oe=await ie(b.features,V),b.bbox&&oe.length>0&&!$.current.has(K)&&$.current.set(K,{id:V,parentBBox:P,bbox:b.bbox,timestamp:b.timeStamp,items:oe.length})),E(b.numberReturned!==0?N+b.numberReturned:b.numberMatched,b.numberMatched),oe.length===0){b.numberReturned&&b.numberReturned!==0?fe(++X.current*g):(X.current=0,Se(_,a,a.entities.values.map(q=>q.id),P));return}await re(P,G);const ve={type:"FeatureCollection",features:oe};await a.process(ve,{describe:c}),_.scene.requestRender(),Se(_,a,oe.map(q=>q.id),P),b.numberReturned&&b.numberReturned!==0?fe(++X.current*g):X.current=0},fe=l.useCallback(async(b=0)=>{if(!_||_.scene.mode===u.SceneMode.MORPHING)return;const P=ai(_);if(P){if(await Ae(),Q.current.currentZoomLevel>0&&Q.current.currentZoomLevel<f&&(a==null?void 0:a.entities.values.length)>0){D();return}if(Q.current.currentZoomLevel>=f){a.show=!0;const N=oi(P),G=ii(P);try{const V=s.includes("?")?"&":"?";let K=`${s}${V}service=WFS&version=2.0.0&request=GetFeature&typeNames=${i}&outputFormat=application/json&bbox=${N.join(",")},EPSG:4326&startIndex=${b}&count=${g}`;T&&(K+=`&sortBy=${T}%20ASC`);const oe=await k(K);await pe(oe,N,b,G)}catch(V){console.error("Error fetching WFS data:",V),E(-1,-1)}}}},[]),Ae=()=>new Promise(b=>{const P=setInterval(()=>{_.scene.globe.tilesLoaded&&(clearInterval(P),b())},100)}),Pe=(b,P,N,G)=>{const V=b.scene.mode===u.SceneMode.SCENE2D,K=H=>{var ne;if(H.polygon)return{type:"Polygon",coordinates:[((ne=H.polygon.hierarchy)==null?void 0:ne.getValue(u.JulianDate.now())).positions.map(ce=>{const Ee=u.Cartographic.fromCartesian(ce),Le=new u.Cartographic(u.Math.toDegrees(Ee.longitude),u.Math.toDegrees(Ee.latitude),V?500:void 0);return[Le.longitude,Le.latitude,Le.height]})]}},oe=(H,ne,me,he)=>{const ce=u.SceneTransforms.wgs84ToWindowCoordinates(H,ne);if(!ce)return null;const Ee=ce.x+me,Le=ce.y+he,ze=new u.Cartesian2(Ee,ce.y),Ve=new u.Cartesian2(ce.x,Le),xe=H.camera.pickEllipsoid(ze,H.globe.ellipsoid),Ne=H.camera.pickEllipsoid(Ve,H.globe.ellipsoid);if(!xe||!Ne)return null;const $e=u.Cartesian3.distance(ne,xe),Be=u.Cartesian3.distance(ne,Ne);return{widthMeters:$e,heightMeters:Be}},ve=(H,ne,me)=>{const he=u.Ellipsoid.WGS84,ce=H.latitude,Ee=H.longitude,Le=Math.PI/180*he.maximumRadius,ze=Math.PI/180*he.maximumRadius,Ve=me/2/Le,xe=ne/2/ze,Ne=ce+Ve,$e=ce-Ve,Be=Ee+xe,Ue=Ee-xe;return{type:"Polygon",coordinates:[[[Ue,Ne],[Be,Ne],[Be,$e],[Ue,$e],[Ue,Ne]]]}},q=(H,ne)=>Ot(H)/Ot(ne),te=[];if(P==null||P.entities.values.forEach(H=>{var ne,me;if(G&&m&&V)try{const he=Ze(G),ce=At(K(H),he);if(ce){const Ee=(ne=H.properties)==null?void 0:ne.label.getValue(u.JulianDate.now()),Le=tr(ce,{properties:{label:Ee}}),ze={width:Ee.width,height:Ee.height},[Ve,xe,Ne=0]=Le.geometry.coordinates,$e=u.Cartesian3.fromDegrees(Ve,xe,Ne),Be=oe(b.scene,$e,ze.width,ze.height);if(Be){const Ue=ve({longitude:Ve,latitude:xe},Be.widthMeters,Be.heightMeters),Et=At(ce,{type:"Feature",properties:{},geometry:Ue});q(Et==null?void 0:Et.geometry,Ue)>.7&&te.push(Le)}}}catch{console.log("*** Label placement failed: turf.intersect() failed ***","entity -->",H,"extent -->",G)}if(!(N.length>0&&!N.some(he=>H.id.startsWith(he)))&&(H.polygon&&(H.polygon=new u.PolygonGraphics({hierarchy:H.polygon.hierarchy,material:V?u.Color.fromCssColorString(M).withAlpha(.2):u.Color.fromCssColorString(M).withAlpha(.5),outline:!0,outlineColor:u.Color.fromCssColorString(M),outlineWidth:3,height:V?1e4:void 0,perPositionHeight:!1})),H.polyline&&(H.polyline=new u.PolylineGraphics({positions:H.polyline.positions,material:u.Color.fromCssColorString(M).withAlpha(.5),clampToGround:!0,width:4})),H.billboard)){const he=(me=H.position)==null?void 0:me.getValue(u.JulianDate.now()),ce=u.Cartographic.fromCartesian(he),Ee=new u.Cartographic(ce.longitude,ce.latitude,V?500:b.scene.sampleHeight(u.Cartographic.fromCartesian(he))),Le=u.Cartesian3.fromRadians(Ee.longitude,Ee.latitude,Ee.height);H.position=Le,H.billboard=new u.BillboardGraphics({image:"data:image/svg+xml;base64,"+btoa(`
14
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16">
15
- <circle cx="8" cy="8" r="6" fill="${M}33" stroke="${oo}80" stroke-width="2"/>
16
- </svg>
17
- `),verticalOrigin:u.VerticalOrigin.BOTTOM,heightReference:u.HeightReference.NONE,scale:1,disableDepthTestDistance:Number.POSITIVE_INFINITY})}}),b.dataSources.remove(b.dataSources.getByName(`${m==null?void 0:m.dataSourcePrefix}${P.name}`)[0]),m&&V){const H=new u.GeoJsonDataSource(`${m==null?void 0:m.dataSourcePrefix}${P.name}`);b.dataSources.add(H),H.load({type:"FeatureCollection",features:te}).then(ne=>{ne==null||ne.entities.values.forEach(me=>{var he;me.billboard=new u.BillboardGraphics({image:(he=me.properties)==null?void 0:he.label.getValue(u.JulianDate.now()).dataURL,heightReference:u.HeightReference.NONE,scale:1,disableDepthTestDistance:Number.POSITIVE_INFINITY})})})}},Se=(b,P,N,G)=>{r?r(b,P,N,G):Pe(b,P,N,G)};return l.useEffect(()=>{const b=_.dataSources.getByName(Z)[0];b&&Se(_,b,[],void 0)},[_.scene.mode]),l.useEffect(()=>{_.layersManager&&_.layersManager.dataLayerList.length>0&&_.layersManager.findDataLayerById(t.id)!==void 0&&_.layersManager.addMetaToDataLayer(F)},[F]),l.useEffect(()=>{var b;(b=_.layersManager)==null||b.addDataLayer({options:n,meta:{...F},visualizationHandler:r})},[_.layersManager]),l.useEffect(()=>{_.dataSources.add(a);const b=()=>{fe()};_.scene.camera.moveEnd.addEventListener(b);const P=new u.ScreenSpaceEventHandler(_.scene.canvas);return v(P),Q.current.currentZoomLevel>0&&(fe(),ae.current=!0),()=>{var N;j.get(_,"_cesiumWidget")!==void 0&&(J.current.clear(),$.current.clear(),_.dataSources.remove(_.dataSources.getByName(`${m==null?void 0:m.dataSourcePrefix}${a.name}`)[0]),_.dataSources.remove(a,!0),(N=_.layersManager)==null||N.removeDataLayer(t.id),_.scene.camera.moveEnd.removeEventListener(b),P.removeInputAction(u.ScreenSpaceEventType.MOUSE_MOVE))}},[]),null},Pn=e=>o.jsx(De.Entity,{...e}),ao=e=>o.jsx(De.EntityDescription,{...e}),_n=e=>o.jsx(De.EntityDescription,{...e}),Dn=e=>o.jsx(De.PolygonGraphics,{...e}),In=e=>o.jsx(De.RectangleGraphics,{...e}),On=e=>o.jsx(De.CustomDataSource,{...e}),lo=e=>o.jsx(De.PolylineGraphics,{...e}),ss="";var ke=function(){var e=S.Ellipsoid.WGS84,n,t=S.Material.fromType(S.Material.ColorType);function r(a,c=new S.Color(1,1,0,.5),w=new S.Color(1,1,1,1)){this._scene=a.scene,t.uniforms.color=c,n=w,this._tooltip={setVisible:()=>{},showAt:()=>{}},this._surfaces=[],this.initialiseHandlers(),this.enhancePrimitives()}r.prototype.initialiseHandlers=function(){var a=this._scene,c=this,w=new S.ScreenSpaceEventHandler(a.canvas);function p(v,L){if(c._handlersMuted!=!0){var E=a.pick(L);E&&E.primitive&&E.primitive[v]&&E.primitive[v](L)}}w.setInputAction(function(v){p("leftClick",v.position)},S.ScreenSpaceEventType.LEFT_CLICK),w.setInputAction(function(v){p("leftDoubleClick",v.position)},S.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);var C;w.setInputAction(function(v){if(c._handlersMuted!=!0){var L=a.pick(v.endPosition);C&&(!L||C!=L.primitive)&&(!(C.isDestroyed&&C.isDestroyed())&&C.mouseOut(v.endPosition),C=null),L&&L.primitive&&(L=L.primitive,L.mouseOut&&(C=L),L.mouseMove&&L.mouseMove(v.endPosition))}},S.ScreenSpaceEventType.MOUSE_MOVE),w.setInputAction(function(v){p("leftUp",v.position)},S.ScreenSpaceEventType.LEFT_UP),w.setInputAction(function(v){p("leftDown",v.position)},S.ScreenSpaceEventType.LEFT_DOWN)},r.prototype.setListener=function(a,c,w){a[c]=w},r.prototype.muteHandlers=function(a){this._handlersMuted=a},r.prototype.registerEditableShape=function(a){var c=this;Z(a,"mouseMove",function(w){a.setHighlighted(!0),a._editMode||c._tooltip.showAt(w,"Click to edit this shape")}),Z(a,"mouseOut",function(w){a.setHighlighted(!1),c._tooltip.setVisible(!1)}),Z(a,"leftClick",function(w){a.setEditMode(!0)})},r.prototype.startDrawing=function(a){this.disableAllEditMode(),this.editCleanUp&&this.editCleanUp(),this.editCleanUp=a,this.muteHandlers(!0)},r.prototype.stopDrawing=function(){this.editCleanUp&&(this.editCleanUp(),this.editCleanUp=null),this.muteHandlers(!1)},r.prototype.disableAllHighlights=function(){this.setHighlighted(void 0)},r.prototype.setHighlighted=function(a){this._highlightedSurface&&!this._highlightedSurface.isDestroyed()&&this._highlightedSurface!=a&&this._highlightedSurface.setHighlighted(!1),this._highlightedSurface=a},r.prototype.disableAllEditMode=function(){this.setEdited(void 0)},r.prototype.setEdited=function(a){this._editedSurface&&!this._editedSurface.isDestroyed()&&this._editedSurface.setEditMode(!1),this._editedSurface=a};var s={ellipsoid:S.Ellipsoid.WGS84,textureRotationAngle:0,height:0,asynchronous:!0,show:!0,debugShowBoundingVolume:!1},i=W(s,{appearance:new S.EllipsoidSurfaceAppearance({aboveGround:!1}),material:t,granularity:Math.PI/180}),h=W(s,{}),g=W(s,{}),f=W(s,{}),y=W(i,{rotation:0}),T=W(s,{width:5,geodesic:!0,granularity:1e4,appearance:new S.PolylineMaterialAppearance({aboveGround:!1}),material:t}),m=function(){function a(){}return a.prototype.initialiseOptions=function(c){ee(this,c),this._ellipsoid=void 0,this._granularity=void 0,this._height=void 0,this._textureRotationAngle=void 0,this._id=void 0,this._createPrimitive=!0,this._primitive=void 0,this._outlinePolygon=void 0},a.prototype.setAttribute=function(c,w){this[c]=w,this._createPrimitive=!0},a.prototype.getAttribute=function(c){return this[c]},a.prototype.update=function(c,w,p){if(!S.defined(this.ellipsoid))throw new S.DeveloperError("this.ellipsoid must be defined.");if(!S.defined(this.appearance))throw new S.DeveloperError("this.material must be defined.");if(this.granularity<0)throw new S.DeveloperError("this.granularity and scene2D/scene3D overrides must be greater than zero.");if(this.show&&!(!this._createPrimitive&&!S.defined(this._primitive))){if(this._createPrimitive||this._ellipsoid!==this.ellipsoid||this._granularity!==this.granularity||this._height!==this.height||this._textureRotationAngle!==this.textureRotationAngle||this._id!==this.id){var C=this.getGeometry();if(!C)return;this._createPrimitive=!1,this._ellipsoid=this.ellipsoid,this._granularity=this.granularity,this._height=this.height,this._textureRotationAngle=this.textureRotationAngle,this._id=this.id,this._primitive=this._primitive&&this._primitive.destroy(),this._primitive=new S.Primitive({geometryInstances:new S.GeometryInstance({geometry:C,id:this.id,pickPrimitive:this}),appearance:this.appearance,asynchronous:this.asynchronous}),this._outlinePolygon=this._outlinePolygon&&this._outlinePolygon.destroy(),this.strokeColor&&this.getOutlineGeometry&&(this._outlinePolygon=new S.Primitive({geometryInstances:new S.GeometryInstance({geometry:this.getOutlineGeometry(),attributes:{color:S.ColorGeometryInstanceAttribute.fromColor(this.strokeColor)}}),appearance:new S.PerInstanceColorAppearance({flat:!0,renderState:{depthTest:{enabled:!0},lineWidth:this.strokeWidth||4}})}))}var v=this._primitive;v.appearance.material=this.material,v.debugShowBoundingVolume=this.debugShowBoundingVolume,v.update(c,w,p),this._outlinePolygon&&this._outlinePolygon.update(c,w,p)}},a.prototype.isDestroyed=function(){return!1},a.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),S.destroyObject(this)},a.prototype.setStrokeStyle=function(c,w){(!this.strokeColor||!this.strokeColor.equals(c)||this.strokeWidth!=w)&&(this._createPrimitive=!0,this.strokeColor=c,this.strokeWidth=w)},a}();r.ExtentPrimitive=function(){function a(c){if(!S.defined(c.extent))throw new S.DeveloperError("Extent is required");c=W(c,i),this.initialiseOptions(c),this.setExtent(c.extent)}return a.prototype=new m,a.prototype.setExtent=function(c){this.setAttribute("extent",c)},a.prototype.getExtent=function(){return this.getAttribute("extent")},a.prototype.getGeometry=function(){if(S.defined(this.extent))return new S.RectangleGeometry({rectangle:this.extent,height:this.height,vertexFormat:S.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity})},a.prototype.getOutlineGeometry=function(){return new S.RectangleOutlineGeometry({rectangle:this.extent})},a}(),r.PolygonPrimitive=function(){function a(c){c=W(c,i),this.initialiseOptions(c),this.isPolygon=!0}return a.prototype=new m,a.prototype.setPositions=function(c){this.setAttribute("positions",c)},a.prototype.getPositions=function(){return this.getAttribute("positions")},a.prototype.getGeometry=function(){if(!(!S.defined(this.positions)||this.positions.length<3))return S.PolygonGeometry.fromPositions({positions:this.positions,height:this.height,vertexFormat:S.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity})},a.prototype.getOutlineGeometry=function(){return S.PolygonOutlineGeometry.fromPositions({positions:this.getPositions()})},a}(),r.CirclePrimitive=function(){function a(c){if(!(S.defined(c.center)&&S.defined(c.radius)))throw new S.DeveloperError("Center and radius are required");c=W(c,i),this.initialiseOptions(c),this.setRadius(c.radius)}return a.prototype=new m,a.prototype.setCenter=function(c){this.setAttribute("center",c)},a.prototype.setRadius=function(c){this.setAttribute("radius",Math.max(.1,c))},a.prototype.getCenter=function(){return this.getAttribute("center")},a.prototype.getRadius=function(){return this.getAttribute("radius")},a.prototype.getGeometry=function(){if(S.defined(this.center)&&S.defined(this.radius))return new S.CircleGeometry({center:this.center,radius:this.radius,height:this.height,vertexFormat:S.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity})},a.prototype.getOutlineGeometry=function(){return new S.CircleOutlineGeometry({center:this.getCenter(),radius:this.getRadius()})},a}(),r.EllipsePrimitive=function(){function a(c){if(!(S.defined(c.center)&&S.defined(c.semiMajorAxis)&&S.defined(c.semiMinorAxis)))throw new S.DeveloperError("Center and semi major and semi minor axis are required");c=W(c,y),this.initialiseOptions(c)}return a.prototype=new m,a.prototype.setCenter=function(c){this.setAttribute("center",c)},a.prototype.setSemiMajorAxis=function(c){c<this.getSemiMinorAxis()||this.setAttribute("semiMajorAxis",c)},a.prototype.setSemiMinorAxis=function(c){c>this.getSemiMajorAxis()||this.setAttribute("semiMinorAxis",c)},a.prototype.setRotation=function(c){return this.setAttribute("rotation",c)},a.prototype.getCenter=function(){return this.getAttribute("center")},a.prototype.getSemiMajorAxis=function(){return this.getAttribute("semiMajorAxis")},a.prototype.getSemiMinorAxis=function(){return this.getAttribute("semiMinorAxis")},a.prototype.getRotation=function(){return this.getAttribute("rotation")},a.prototype.getGeometry=function(){if(S.defined(this.center)&&S.defined(this.semiMajorAxis)&&S.defined(this.semiMinorAxis))return new S.EllipseGeometry({ellipsoid:this.ellipsoid,center:this.center,semiMajorAxis:this.semiMajorAxis,semiMinorAxis:this.semiMinorAxis,rotation:this.rotation,height:this.height,vertexFormat:S.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,granularity:this.granularity})},a.prototype.getOutlineGeometry=function(){return new S.EllipseOutlineGeometry({center:this.getCenter(),semiMajorAxis:this.getSemiMajorAxis(),semiMinorAxis:this.getSemiMinorAxis(),rotation:this.getRotation()})},a}(),r.PolylinePrimitive=function(){function a(c){c=W(c,T),this.initialiseOptions(c)}return a.prototype=new m,a.prototype.setPositions=function(c){this.setAttribute("positions",c)},a.prototype.setWidth=function(c){this.setAttribute("width",c)},a.prototype.setGeodesic=function(c){this.setAttribute("geodesic",c)},a.prototype.getPositions=function(){return this.getAttribute("positions")},a.prototype.getWidth=function(){return this.getAttribute("width")},a.prototype.getGeodesic=function(c){return this.getAttribute("geodesic")},a.prototype.getGeometry=function(){if(!(!S.defined(this.positions)||this.positions.length<2))return new S.PolylineGeometry({positions:this.positions,height:this.height,width:this.width<1?1:this.width,vertexFormat:S.EllipsoidSurfaceAppearance.VERTEX_FORMAT,ellipsoid:this.ellipsoid})},a}();var M={iconUrl:"./assets/img/dragIcon.png",shiftX:0,shiftY:0},O={iconUrl:"./assets/img/dragIcon.png",shiftX:0,shiftY:0},_={iconUrl:"./assets/img/dragIconLight.png",shiftX:0,shiftY:0};r.prototype.createBillboardGroup=function(a,c,w){var p=new r.BillboardGroup(this,c);return p.addBillboards(a,w),p},r.BillboardGroup=function(a,c){this._drawHelper=a,this._scene=a._scene,this._options=W(c,M);var w=new S.BillboardCollection;this._scene.primitives.add(w),this._billboards=w,this._orderedBillboards=[]},r.BillboardGroup.prototype.createBillboard=function(a,c){var w=this._billboards.add({show:!0,position:a,pixelOffset:new S.Cartesian2(this._options.shiftX,this._options.shiftY),eyeOffset:new S.Cartesian3(0,0,0),horizontalOrigin:S.HorizontalOrigin.CENTER,verticalOrigin:S.VerticalOrigin.CENTER,scale:1,image:this._options.iconUrl,color:n});if(c){let v=function(E){C.enableRotate=E},L=function(){for(var E=0,D=p._orderedBillboards.length;E<D&&p._orderedBillboards[E]!=w;++E);return E};var p=this,C=this._scene.screenSpaceCameraController;if(c.dragHandlers){var p=this;Z(w,"leftDown",function(D){function k(x){w.position=x;for(var B=0,ie=p._orderedBillboards.length;B<ie&&p._orderedBillboards[B]!=w;++B);c.dragHandlers.onDrag&&c.dragHandlers.onDrag(L(),x)}function A(x){I.destroy(),v(!0),c.dragHandlers.onDragEnd&&c.dragHandlers.onDragEnd(L(),x)}var I=new S.ScreenSpaceEventHandler(p._scene.canvas);I.setInputAction(function(x){var B=p._scene.camera.pickEllipsoid(x.endPosition,e);B?k(B):A(B)},S.ScreenSpaceEventType.MOUSE_MOVE),I.setInputAction(function(x){A(p._scene.camera.pickEllipsoid(x.position,e))},S.ScreenSpaceEventType.LEFT_UP),v(!1),c.dragHandlers.onDragStart&&c.dragHandlers.onDragStart(L(),p._scene.camera.pickEllipsoid(D,e))})}c.onDoubleClick&&Z(w,"leftDoubleClick",function(E){c.onDoubleClick(L())}),c.onClick&&Z(w,"leftClick",function(E){c.onClick(L())}),c.tooltip&&(Z(w,"mouseMove",function(E){p._drawHelper._tooltip.showAt(E,c.tooltip())}),Z(w,"mouseOut",function(E){p._drawHelper._tooltip.setVisible(!1)}))}return w},r.BillboardGroup.prototype.insertBillboard=function(a,c,w){this._orderedBillboards.splice(a,0,this.createBillboard(c,w))},r.BillboardGroup.prototype.addBillboard=function(a,c){this._orderedBillboards.push(this.createBillboard(a,c))},r.BillboardGroup.prototype.addBillboards=function(a,c){for(var w=0;w<a.length;w++)this.addBillboard(a[w],c)},r.BillboardGroup.prototype.updateBillboardsPositions=function(a){for(var c=0;c<a.length;c++)this.getBillboard(c).position=a[c]},r.BillboardGroup.prototype.countBillboards=function(){return this._orderedBillboards.length},r.BillboardGroup.prototype.getBillboard=function(a){return this._orderedBillboards[a]},r.BillboardGroup.prototype.removeBillboard=function(a){this._billboards.remove(this.getBillboard(a)),this._orderedBillboards.splice(a,1)},r.BillboardGroup.prototype.remove=function(){this._billboards=this._billboards&&this._billboards.removeAll()&&this._billboards.destroy()},r.BillboardGroup.prototype.setOnTop=function(){this._scene.primitives.raiseToTop(this._billboards)},r.prototype.startDrawingMarker=function(c){var c=W(c,M);this.startDrawing(function(){v.remove(),L.destroy(),C.setVisible(!1)});var w=this,p=this._scene;p.primitives;var C=this._tooltip,v=new r.BillboardGroup(this,c),L=new S.ScreenSpaceEventHandler(p.canvas);L.setInputAction(function(E){if(E.position!=null){var D=p.camera.pickEllipsoid(E.position,e);D&&(v.addBillboard(D),w.stopDrawing(),c.callback(D))}},S.ScreenSpaceEventType.LEFT_CLICK),L.setInputAction(function(E){var D=E.endPosition;if(D!=null){var k=p.camera.pickEllipsoid(D,e);k?C.showAt(D,"<p>Click to add your marker. Position is: </p>"+X(e.cartesianToCartographic(k))):C.showAt(D,"<p>Click on the globe to add your marker.</p>")}},S.ScreenSpaceEventType.MOUSE_MOVE)},r.prototype.startDrawingPolygon=function(c){var c=W(c,i);this.startDrawingPolyshape(!0,c)},r.prototype.startDrawingPolyline=function(c){var c=W(c,T);this.startDrawingPolyshape(!1,c)},r.prototype.startDrawingPolyshape=function(a,c){this.startDrawing(function(){C.remove(E),k.remove(),A.destroy(),v.setVisible(!1),$(p)});var w=this,p=this._scene,C=p.primitives,v=this._tooltip,L=a?3:2,E;a?E=new ke.PolygonPrimitive(c):E=new ke.PolylinePrimitive(c),E.asynchronous=!1,C.add(E);var D=[],k=new r.BillboardGroup(this,M),A=new S.ScreenSpaceEventHandler(p.canvas);Q(p),A.setInputAction(function(I){if(I.position!=null){var x=p.camera.pickEllipsoid(I.position,e);x&&(D.length==0&&(D.push(x.clone()),k.addBillboard(D[0])),D.length>=L&&(E.positions=D,E._createPrimitive=!0),D.push(x),k.addBillboard(x))}},S.ScreenSpaceEventType.LEFT_CLICK),A.setInputAction(function(I){var x=I.endPosition;if(x!=null)if(D.length==0)v.showAt(x,"<p>Click to add first point</p>");else{var B=p.camera.pickEllipsoid(x,e);B&&(D.pop(),B.y+=1+Math.random(),D.push(B),D.length>=L&&(E.positions=D,E._createPrimitive=!0),k.getBillboard(D.length-1).position=B,v.showAt(x,"<p>Click to add new point ("+D.length+")</p>"+(D.length>L?"<p>Double click to finish drawing</p>":"")))}},S.ScreenSpaceEventType.MOUSE_MOVE),A.setInputAction(function(I){var x=I.position;if(x!=null){if(D.length<L+2)return;var B=p.camera.pickEllipsoid(x,e);B&&($(p),w.stopDrawing(),typeof c.callback=="function"&&(D.length-1,c.callback(D)))}},S.ScreenSpaceEventType.LEFT_DOUBLE_CLICK)};function z(a){return e.cartographicArrayToCartesianArray([S.Rectangle.northwest(a),S.Rectangle.northeast(a),S.Rectangle.southeast(a),S.Rectangle.southwest(a)])}function Q(a){a&&(a.canvas.style.cursor="crosshair")}function $(a){a&&(a.canvas.style.cursor="")}r.prototype.startDrawingExtent=function(c){var c=W(c,i);this.startDrawing(function(){E!=null&&C.remove(E),D!=null&&D.remove(),k.destroy(),v.setVisible(!1),$(p)});var w=this,p=this._scene,C=this._scene.primitives,v=this._tooltip,L=null,E=null,D=null,k=new S.ScreenSpaceEventHandler(p.canvas);Q(p);function A(I){E==null&&(E=new ke.ExtentPrimitive({extent:I,material:c.material}),E.asynchronous=!1,C.add(E)),E.setExtent(I);var x=z(I);D==null?(D=new r.BillboardGroup(w,M),D.addBillboards(x)):D.updateBillboardsPositions(x)}k.setInputAction(function(I){if(I.position!=null){var x=p.camera.pickEllipsoid(I.position,e);if(x)if(E==null){L=e.cartesianToCartographic(x);var B=J(L,L);A(B)}else w.stopDrawing(),typeof c.callback=="function"&&c.callback(J(L,e.cartesianToCartographic(x)))}},S.ScreenSpaceEventType.LEFT_DOWN),k.setInputAction(function(I){var x=I.endPosition;if(x!=null)if(E==null)v.showAt(x,"<p>Click to start drawing rectangle</p>");else{var B=p.camera.pickEllipsoid(x,e);if(B){var ie=J(L,e.cartesianToCartographic(B));A(ie),v.showAt(x,"<p>Drag to change rectangle extent</p><p>Click again to finish drawing</p>")}}},S.ScreenSpaceEventType.MOUSE_MOVE)},r.prototype.startDrawingCircle=function(c){var c=W(c,i);this.startDrawing(function(){L!=null&&C.remove(L),E.remove(),D.destroy(),v.setVisible(!1)});var w=this,p=this._scene,C=this._scene.primitives,v=this._tooltip,L=null,E=null,D=new S.ScreenSpaceEventHandler(p.canvas);D.setInputAction(function(k){if(k.position!=null){var A=p.camera.pickEllipsoid(k.position,e);A&&(L==null?(L=new r.CirclePrimitive({center:A,radius:0,asynchronous:!1,material:c.material}),C.add(L),E=new r.BillboardGroup(w,M),E.addBillboards([A])):(typeof c.callback=="function"&&c.callback(L.getCenter(),L.getRadius()),w.stopDrawing()))}},S.ScreenSpaceEventType.LEFT_DOWN),D.setInputAction(function(k){var A=k.endPosition;if(A!=null)if(L==null)v.showAt(A,"<p>Click to start drawing the circle</p>");else{var I=p.camera.pickEllipsoid(A,e);I&&(L.setRadius(S.Cartesian3.distance(L.getCenter(),I)),E.updateBillboardsPositions(I),v.showAt(A,"<p>Move mouse to change circle radius</p><p>Click again to finish drawing</p>"))}},S.ScreenSpaceEventType.MOUSE_MOVE)},r.prototype.enhancePrimitives=function(){var a=this;S.Billboard.prototype.setEditable=function(){if(this._editable)return;this._editable=!0;var p=this,C=this;function v(L){a._scene.screenSpaceCameraController.enableRotate=L}Z(p,"leftDown",function(L){function E(A){p.position=A,C.executeListeners({name:"drag",positions:A})}function D(A){k.destroy(),v(!0),C.executeListeners({name:"dragEnd",positions:A})}var k=new S.ScreenSpaceEventHandler(a._scene.canvas);k.setInputAction(function(A){var I=a._scene.camera.pickEllipsoid(A.endPosition,e);I?E(I):D(I)},S.ScreenSpaceEventType.MOUSE_MOVE),k.setInputAction(function(A){D(a._scene.camera.pickEllipsoid(A.position,e))},S.ScreenSpaceEventType.LEFT_UP),v(!1)}),ae(p)};function c(p){a._scene,!(this._highlighted&&this._highlighted==p)&&this._editMode!==!0&&(this._highlighted=p,p?(a.setHighlighted(this),this._strokeColor=this.strokeColor,this.setStrokeStyle(S.Color.fromCssColorString("white"),this.strokeWidth)):this._strokeColor?this.setStrokeStyle(this._strokeColor,this.strokeWidth):this.setStrokeStyle(void 0,void 0))}function w(p){if(this._editMode!=p)if(a.disableAllHighlights(),p){a.setEdited(this);var C=a._scene,v=this;if(this._markers==null){let B=function(U,re){var pe=U-1<0?re.length-1:U-1;pe<E.countBillboards()&&(E.getBillboard(pe).position=le(pe)),pe=U,pe<E.countBillboards()&&(E.getBillboard(pe).position=le(pe))},ie=function(){v.executeListeners({name:"onEdited",positions:v.positions})},le=function(U){var re=v.positions;return e.cartographicToCartesian(new S.EllipsoidGeodesic(e.cartesianToCartographic(re[U]),e.cartesianToCartographic(re[U<re.length-1?U+1:0])).interpolateUsingFraction(.5))};var L=new r.BillboardGroup(a,O),E=new r.BillboardGroup(a,_),D={dragHandlers:{onDrag:function(U,re){v.positions[U]=re,B(U,v.positions),v._createPrimitive=!0},onDragEnd:function(U,re){v._createPrimitive=!0,ie()}},onDoubleClick:function(U){v.positions.length<4||(v.positions.splice(U,1),v._createPrimitive=!0,L.removeBillboard(U),E.removeBillboard(U),B(U,v.positions),ie())},tooltip:function(){if(v.positions.length>3)return"Double click to remove this point"}};L.addBillboards(v.positions,D),this._markers=L;for(var k=[],A=0,I=v.positions.length+(this.isPolygon?0:-1);A<I;A++)k.push(le(A));var x={dragHandlers:{onDragStart:function(U,re){this.index=U+1,v.positions.splice(this.index,0,re),v._createPrimitive=!0},onDrag:function(U,re){v.positions[this.index]=re,v._createPrimitive=!0},onDragEnd:function(U,re){L.insertBillboard(this.index,re,D),E.getBillboard(this.index-1).position=le(this.index-1),E.insertBillboard(this.index,le(this.index),x),v._createPrimitive=!0,ie()}},tooltip:function(){return"Drag to create a new point"}};E.addBillboards(k,x),this._editMarkers=E,this._globeClickhandler=new S.ScreenSpaceEventHandler(C.canvas),this._globeClickhandler.setInputAction(function(U){var re=C.pick(U.position);re&&re.primitive||v.setEditMode(!1)},S.ScreenSpaceEventType.LEFT_CLICK),L.setOnTop(),E.setOnTop()}this._editMode=!0}else this._markers!=null&&(this._markers.remove(),this._editMarkers.remove(),this._markers=null,this._editMarkers=null,this._globeClickhandler.destroy()),this._editMode=!1}ke.PolylinePrimitive.prototype.setEditable=function(){if(!this.setEditMode){var p=this;p.isPolygon=!1,p.asynchronous=!1,a.registerEditableShape(p),p.setEditMode=w;var C=this.width;p.setHighlighted=function(v){this._editMode!==!0&&(v?(a.setHighlighted(this),this.setWidth(C*2)):this.setWidth(C))},p.getExtent=function(){return S.Rectangle.fromCartographicArray(e.cartesianArrayToCartographicArray(this.positions))},ae(p),p.setEditMode(!1)}},ke.PolygonPrimitive.prototype.setEditable=function(){var p=this;p.asynchronous=!1,a._scene,a.registerEditableShape(p),p.setEditMode=w,p.setHighlighted=c,ae(p),p.setEditMode(!1)},ke.ExtentPrimitive.prototype.setEditable=function(){if(!this.setEditMode){var p=this,C=a._scene;a.registerEditableShape(p),p.asynchronous=!1,p.setEditMode=function(v){if(this._editMode!=v)if(a.disableAllHighlights(),v){if(a.setEdited(this),this._markers==null){let D=function(){p.executeListeners({name:"onEdited",extent:p.extent})};var L=new r.BillboardGroup(a,O),E={dragHandlers:{onDrag:function(k,A){var I=L.getBillboard((k+2)%4).position;p.setExtent(J(e.cartesianToCartographic(I),e.cartesianToCartographic(A))),L.updateBillboardsPositions(z(p.extent))},onDragEnd:function(k,A){D()}},tooltip:function(){return"Drag to change the corners of this extent"}};L.addBillboards(z(p.extent),E),this._markers=L,this._globeClickhandler=new S.ScreenSpaceEventHandler(C.canvas),this._globeClickhandler.setInputAction(function(k){var A=C.pick(k.position);A&&!A.isDestroyed()&&A.primitive||p.setEditMode(!1)},S.ScreenSpaceEventType.LEFT_CLICK),L.setOnTop()}this._editMode=!0}else this._markers!=null&&(this._markers.remove(),this._markers=null,this._globeClickhandler.destroy()),this._editMode=!1},p.setHighlighted=c,ae(p),p.setEditMode(!1)}},r.EllipsePrimitive.prototype.setEditable=function(){if(!this.setEditMode){var p=this,C=a._scene;p.asynchronous=!1,a.registerEditableShape(p),p.setEditMode=function(v){if(this._editMode!=v)if(a.disableAllHighlights(),v){a.setEdited(this);var L=this;if(this._markers==null){let k=function(){return S.EllipseOutlineGeometry(e,p.getCenter(),p.getSemiMajorAxis(),p.getSemiMinorAxis(),p.getRotation()+Math.PI/2,Math.PI/2).splice(0,4)},A=function(){p.executeListeners({name:"onEdited",center:p.getCenter(),semiMajorAxis:p.getSemiMajorAxis(),semiMinorAxis:p.getSemiMinorAxis(),rotation:0})};var E=new r.BillboardGroup(a,O),D={dragHandlers:{onDrag:function(I,x){var B=S.Cartesian3.distance(p.getCenter(),x);I%2==0?p.setSemiMajorAxis(B):p.setSemiMinorAxis(B),E.updateBillboardsPositions(k())},onDragEnd:function(I,x){A()}},tooltip:function(){return"Drag to change the excentricity and radius"}};E.addBillboards(k(),D),this._markers=E,this._globeClickhandler=new S.ScreenSpaceEventHandler(C.canvas),this._globeClickhandler.setInputAction(function(I){var x=C.pick(I.position);x&&x.primitive||L.setEditMode(!1)},S.ScreenSpaceEventType.LEFT_CLICK),E.setOnTop()}this._editMode=!0}else this._markers!=null&&(this._markers.remove(),this._markers=null,this._globeClickhandler.destroy()),this._editMode=!1},p.setHighlighted=c,ae(p),p.setEditMode(!1)}},r.CirclePrimitive.prototype.getCircleCartesianCoordinates=function(p){for(var C=S.CircleOutlineGeometry.createGeometry(new S.CircleOutlineGeometry({ellipsoid:e,center:this.getCenter(),radius:this.getRadius(),granularity:p})),v=0,L,E=[];v<C.attributes.position.values.length;v+=3)L=C.attributes.position.values,E.push(new S.Cartesian3(L[v],L[v+1],L[v+2]));return E},r.CirclePrimitive.prototype.setEditable=function(){if(!this.setEditMode){var p=this,C=a._scene;p.asynchronous=!1,a.registerEditableShape(p),p.setEditMode=function(v){if(this._editMode!=v)if(a.disableAllHighlights(),v){a.setEdited(this);var L=this;if(this._markers==null){let k=function(){return L.getCircleCartesianCoordinates(S.Math.PI_OVER_TWO)},A=function(){p.executeListeners({name:"onEdited",center:p.getCenter(),radius:p.getRadius()})};var E=new r.BillboardGroup(a,O),D={dragHandlers:{onDrag:function(I,x){p.setRadius(S.Cartesian3.distance(p.getCenter(),x)),E.updateBillboardsPositions(k())},onDragEnd:function(I,x){A()}},tooltip:function(){return"Drag to change the radius"}};E.addBillboards(k(),D),this._markers=E,this._globeClickhandler=new S.ScreenSpaceEventHandler(C.canvas),this._globeClickhandler.setInputAction(function(I){var x=C.pick(I.position);x&&x.primitive||L.setEditMode(!1)},S.ScreenSpaceEventType.LEFT_CLICK),E.setOnTop()}this._editMode=!0}else this._markers!=null&&(this._markers.remove(),this._markers=null,this._globeClickhandler.destroy()),this._editMode=!1},p.setHighlighted=c,ae(p),p.setEditMode(!1)}}},r.DrawHelperWidget=function(){function a(c,w){if(!S.defined(w.container))throw new S.DeveloperError("Container is required");var p={markerIcon:"./assets/img/glyphicons_242_google_maps.png",polylineIcon:"./assets/img/glyphicons_097_vector_path_line.png",polygonIcon:"./assets/img/glyphicons_096_vector_path_polygon.png",circleIcon:"./assets/img/glyphicons_095_vector_path_circle.png",extentIcon:"./assets/img/glyphicons_094_vector_path_square.png",clearIcon:"./assets/img/glyphicons_067_cleaning.png",polylineDrawingOptions:T,polygonDrawingOptions:h,extentDrawingOptions:g,circleDrawingOptions:f};ee(w,p);var C=this,v=document.createElement("DIV");v.className="toolbar",w.container.appendChild(v);function L(k,A,I,x){var B=document.createElement("DIV");B.className="button",B.title=I,v.appendChild(B),B.onclick=x;var ie=document.createElement("SPAN");B.appendChild(ie);var le=document.createElement("IMG");return le.src=A,ie.appendChild(le),B}var E=c._scene;L("marker",w.markerIcon,"Click to start drawing a 2D marker",function(){c.startDrawingMarker({callback:function(k){C.executeListeners({name:"markerCreated",position:k})}})}),L("polyline",w.polylineIcon,"Click to start drawing a 2D polyline",function(){c.startDrawingPolyline({callback:function(k){C.executeListeners({name:"polylineCreated",positions:k})}})}),L("polygon",w.polygonIcon,"Click to start drawing a 2D polygon",function(){c.startDrawingPolygon({callback:function(k){C.executeListeners({name:"polygonCreated",positions:k})}})}),L("extent",w.extentIcon,"Click to start drawing an Extent",function(){c.startDrawingExtent({callback:function(k){C.executeListeners({name:"extentCreated",extent:k})}})}),L("circle",w.circleIcon,"Click to start drawing a Circle",function(){c.startDrawingCircle({callback:function(k,A){C.executeListeners({name:"circleCreated",center:k,radius:A})}})});var D=document.createElement("DIV");D.className="divider",v.appendChild(D),L("clear",w.clearIcon,"Remove all primitives",function(){E.primitives.removeAll()}),ae(this)}return a}(),r.prototype.addToolbar=function(a,c){return c=W(c,{container:a}),new r.DrawHelperWidget(this,c)};function J(a,c){var w=new S.Rectangle;w.west=Math.min(a.longitude,c.longitude),w.east=Math.max(a.longitude,c.longitude),w.south=Math.min(a.latitude,c.latitude),w.north=Math.max(a.latitude,c.latitude);var p=S.Math.EPSILON7;return w.east-w.west<p&&(w.east+=p*2),w.north-w.south<p&&(w.north+=p*2),w}function X(a,c){return a.longitude.toFixed(c||3)+", "+a.latitude.toFixed(c||3)}function F(a,c){if(a==null||typeof a!="object"||a.constructor!=Object&&a.constructor!=Array)return a;if(a.constructor==Date||a.constructor==RegExp||a.constructor==Function||a.constructor==String||a.constructor==Number||a.constructor==Boolean)return new a.constructor(a);c=c||new a.constructor;for(var w in a)c[w]=typeof c[w]>"u"?F(a[w],null):c[w];return c}function ee(a,c){a=a||{};var w;for(w in c)a[w]===void 0&&(a[w]=F(c[w]))}function W(a,c){var w=F(a),p;for(p in c)w[p]===void 0&&(w[p]=F(c[p]));return w}function Z(a,c,w){a[c]=w}function ae(a){a._listeners={},a.addListener=function(c,w){return this._listeners[c]=this._listeners[c]||[],this._listeners[c].push(w),this._listeners[c].length},a.executeListeners=function(c,w){if(this._listeners[c.name]&&this._listeners[c.name].length>0)for(var p=0;p<this._listeners[c.name].length;p++)this._listeners[c.name][p](c);else w&&w(c)}}return r}();const co=2,uo=(e,n)=>{switch(e){case Te.BOX:{if(n.features.length!==co)throw new Error(`${e} must have 2 points`);const t=j.find(n.features,s=>{var i;return((i=s.properties)==null?void 0:i.type)===Xe.BOTTOM_LEFT}),r=j.find(n.features,s=>{var i;return((i=s.properties)==null?void 0:i.type)===Xe.TOP_RIGHT});if(r&&t){if(t.geometry.coordinates[0]===r.geometry.coordinates[0]&&t.geometry.coordinates[1]===r.geometry.coordinates[1])throw new Error(`${e} must define BOTTOM_LEFT and TOP_RIGHT different points`);return u.Rectangle.fromDegrees(t.geometry.coordinates[0],t.geometry.coordinates[1],r.geometry.coordinates[0],r.geometry.coordinates[1])}else throw new Error(`${e} geojson must define BOTTOM_LEFT and TOP_RIGHT points`)}default:throw new Error(`${e} type geoJSON still not supported`)}},An=e=>{const n=e.map(t=>{const r=u.Cartographic.fromCartesian(t);return[u.Math.toDegrees(r.longitude),u.Math.toDegrees(r.latitude)]});return n.push(n[0]),{type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[n]}}},kn=e=>{const n=Ft.lineString([[u.Math.toDegrees(e.west),u.Math.toDegrees(e.south)],[u.Math.toDegrees(e.east),u.Math.toDegrees(e.north)]]);return Ze(kt(n))},xn=e=>{const n=Ft.lineString([[e.west,e.south],[e.east,e.north]]);return Ze(kt(n)).geometry.coordinates[0].map(r=>u.Cartesian3.fromRadiansArray(r)[0])},ho=e=>{const{drawState:n,drawingMaterial:t,drawingVertexColor:r,material:s,hollow:i,outlineWidth:h}=e,g=ye(),[f,y]=l.useState();l.useEffect(()=>{y(new ke(g,t,r))},[]),l.useEffect(()=>{if(f){const m=f;if(n.drawing)switch(n.type){case Te.POLYGON:g.scene.globe.depthTestAgainstTerrain=!1,m.startDrawingPolygon({callback:M=>{n.handler({primitive:M,type:Te.POLYGON,geojson:An(M)})}});break;case Te.BOX:g.scene.globe.depthTestAgainstTerrain=!1,m.startDrawingExtent({callback:M=>{n.handler({primitive:M,type:Te.BOX,geojson:kn(M)})}});break;default:throw new Error(`[CESIUM DRAW]: ${n.type} unrecognized primitive to draw.`)}else m.stopDrawing(),g.scene.globe.depthTestAgainstTerrain=!0}},[n,f]);const T=m=>{try{let M=m.coordinates!==void 0?m.coordinates:uo(m.type,m.geojson);if(i!==!0)switch(m.type){case Te.BOX:return o.jsx(In,{coordinates:M,material:s??t});case Te.POLYGON:return o.jsx(Dn,{hierarchy:new u.PolygonHierarchy(M),material:s??t});default:return o.jsx(o.Fragment,{})}else{switch(m.type){case Te.BOX:M=xn(M);break;case Te.POLYGON:M=[...M,M[0]];break;default:return o.jsx(o.Fragment,{})}return o.jsx(lo,{clampToGround:!0,positions:M,width:h??1,material:s??t})}}catch(M){return console.error(M),o.jsx(o.Fragment,{})}};return o.jsx(On,{...e,children:e.drawings.map((m,M)=>o.jsxs(Pn,{name:m.name,children:[o.jsxs(_n,{children:[o.jsxs("h1",{children:["Drawed Entity ",m.name]}),o.jsx("p",{children:"This is description of drawed entity"})]}),T(m)]},m.id))})},go=e=>{const n=ye();return l.useEffect(()=>{n.extend(u.viewerCesiumInspectorMixin)},[n]),o.jsx(o.Fragment,{})},po=-25,Nn=2,fo=e=>{const n=ye(),t=(i,h=",")=>i.slice(i.indexOf(`
21
+ `},y=O=>O?O.polyline?"polyline":"polygon":"",S=O=>{var z,U;const x=(U=(z=O==null?void 0:O.polygon)==null?void 0:z.hierarchy)==null?void 0:U.getValue(g.JulianDate.now());if(!x)return null;const H=x.positions;return g.BoundingSphere.fromPoints(H).center},w=O=>{const H=L.scene.drillPick(O).map(U=>U.id).filter(U=>U&&U.polygon&&U.entityCollection.owner.name===te);if(H.length===0)return null;const z=H.map(U=>{const K=S(U);if(!K)return{entity:U,distance:Number.MAX_VALUE};const ce=g.SceneTransforms.wgs84ToWindowCoordinates(L.scene,K);if(!ce)return{entity:U,distance:Number.MAX_VALUE};const me=O.x-ce.x,ye=O.y-ce.y,Ie=Math.sqrt(me*me+ye*ye);return{entity:U,distance:Ie}});return z.sort((U,K)=>K.distance-U.distance),z[0].entity},P=O=>{let x=null,H=null;O.setInputAction(z=>{if(L.scene.mode===g.SceneMode.SCENE2D){const K=L.scene.pick(z.endPosition);K&&K.id&&(K.id.polygon||K.id.polyline)?$.get(x,"id")!==$.get(K.id,"id")&&(x&&(x[y(x)].material=H,L.container.style.cursor="default"),x=K.id,H=x[y(x)].material,x[y(x)].material=Z,L.container.style.cursor="pointer"):x&&(x[y(x)].material=H,x=null,L.container.style.cursor="default")}else{const K=w(z.endPosition);K?$.get(x,"id")!==$.get(K,"id")&&(x&&(x[y(x)].material=H,L.container.style.cursor="default"),x=K,H=x[y(x)].material,x[y(x)].material=Z,L.container.style.cursor="pointer"):x&&(x[y(x)].material=H,x=null,L.container.style.cursor="default")}},g.ScreenSpaceEventType.MOUSE_MOVE)},m=(O,x)=>{const H=navigator.hardwareConcurrency||4;let z=Math.ceil(H*1.5);return x==="cpu"&&(z=Math.max(2,Math.ceil(H/2))),O>=C?Math.min(200,z*4):O>1e3?Math.min(100,z*2):O>300?Math.min(50,z):Math.min(10,z)},T=(O=-1,x=-1)=>{W(H=>({...H,...n,cache:Y.current.size,items:O,total:x,currentZoomLevel:G.current.currentZoomLevel}))},k=()=>{if(c.entities&&c.entities.values.length>0){c.show=!1,V.current=0;const O=L.dataSources.getByName(`${p==null?void 0:p.dataSourcePrefix}${c.name}`)[0];O&&(O.show=!1,L.dataSources.remove(O))}T(0,0)},N=async(O,x="GET",H)=>{const z={method:x};H!==void 0&&(z.body=H);const U=await fetch(O,z);if(U.status===200)return await U.json()},A=document.createElement("canvas"),D=A.getContext("2d"),B=O=>{const x={fontName:"sans-serif",fontSize:14,padding:4,fillStyle:"white",strokeStyle:"black",lineWidth:3},H=O.split(`
22
+ `),z=(p==null?void 0:p.fontSize)??x.fontSize,U=(p==null?void 0:p.padding)??x.padding,K=z+2;D.clearRect(0,0,A.width,A.height),D.font=`${z}px ${(p==null?void 0:p.fontName)??x.fontName}`;const ce=Math.max(...H.map(Ie=>D.measureText(Ie).width)),me=document.createElement("canvas");me.width=ce+U*2,me.height=K*H.length+U*2;const ye=me.getContext("2d");return ye.font=`${z}px ${(p==null?void 0:p.fontName)??x.fontName}`,ye.fillStyle=(p==null?void 0:p.fillStyle)??x.fillStyle,ye.strokeStyle=(p==null?void 0:p.strokeStyle)??x.strokeStyle,ye.lineWidth=(p==null?void 0:p.lineWidth)??x.lineWidth,H.forEach((Ie,Ve)=>{const We=U+(Ve+1)*K-4;ye.strokeText(Ie,U,We),ye.fillText(Ie,U,We)}),{dataURL:me.toDataURL(),width:me.width,height:me.height}},ee=O=>p==null?void 0:p.text.pattern.replace(/\$\{([^}]+)\}/g,(H,z)=>{const U=p.text.fields.find(ce=>ce.name===z);let K="";if(U)if(U.predicate)K=U.predicate(O.properties[z]);else switch(U.type){case"date":K=Te.format(new Date(O.properties[z]),U.format??"dd/MM/yyyy");break;default:K=O.properties[z];break}return K}),ne=async(O,x)=>{const H=[];return O.length>0&&await ht(O,z=>{if(z.properties){const U=z.properties[b??"id"];let K=!0;if(s)try{K=pr(z.geometry),K||console.error("Skipped invalid WFS feature with",b??"id","->",U)}catch{K=!1,console.error("Skipped invalid WFS feature with",b??"id","->",U)}if(!Y.current.has(U)&&K){Y.current.add(U),z.properties.fetch_id=x;const ce=z.properties.description;if(z.properties.description=void 0,z.properties._description=ce,p){const me=B(ee(z));z.properties.label=me}H.push(z)}}},{concurrency:m(O.length,"cpu")}),H},q=(O,x)=>Array.from(j.current.values()).filter(H=>JSON.stringify(H.parentBBox)!==JSON.stringify(O)).reduce((H,z)=>{const U=qi(x,z.bbox);return U>H.distance?{id:z.id,key:z.bbox.join(","),distance:U}:H},{id:"",key:"",distance:-1/0}),R=async O=>{const x=[];await ht(c.entities.values,H=>{if(H.properties&&H.properties.fetch_id.getValue()===O){const z=H.properties[b??"id"].getValue();Y.current.delete(z),x.push(H)}},{concurrency:m(c.entities.values.length,"cpu")}),x.length>0&&await ht(x,H=>{c.entities.remove(H)},{concurrency:m(x.length,"cpu")})},ie=async(O,x)=>{for(;Y.current.size>C;){const H=q(O,x);if(H.id==="")break;await R(H.id),H.key&&j.current.delete(H.key)}},he=async(O,x,H,z)=>{let U="",K="",ce=[];if(O.numberReturned&&O.numberReturned!==0&&(O.bbox&&(K=O.bbox.join(","),j.current.has(K)||(U=Nt.v4())),ce=await ne(O.features,U),O.bbox&&ce.length>0&&!j.current.has(K)&&j.current.set(K,{id:U,parentBBox:x,bbox:O.bbox,timestamp:O.timeStamp,items:ce.length})),T(O.numberReturned!==0?H+O.numberReturned:O.numberMatched,O.numberMatched),ce.length===0){O.numberReturned&&O.numberReturned!==0?ve(++V.current*f):(V.current=0,fe(L,c,c.entities.values.map(ye=>ye.id),x));return}await ie(x,z);const me={type:"FeatureCollection",features:ce};await c.process(me,{describe:_}),L.scene.requestRender(),fe(L,c,ce.map(ye=>ye.id),x),O.numberReturned&&O.numberReturned!==0?ve(++V.current*f):V.current=0},ve=a.useCallback(async(O=0)=>{if(!L||L.scene.mode===g.SceneMode.MORPHING)return;const x=Yi(L);if(x){if(await oe(),G.current.currentZoomLevel>0&&G.current.currentZoomLevel<E&&(c==null?void 0:c.entities.values.length)>0){k();return}if(G.current.currentZoomLevel>=E){c.show=!0;const H=mn(x),z=ji(x);try{const U=o.includes("?")?"&":"?";let K=`${o}${U}service=WFS&version=2.0.0&request=GetFeature&typeNames=${d}&outputFormat=application/json&bbox=${H.join(",")},EPSG:4326&startIndex=${O}&count=${f}`;b&&(K+=`&sortBy=${b}%20ASC`);const ce=await N(K);await he(ce,H,O,z)}catch(U){console.error("Error fetching WFS data:",U),T(-1,-1)}}}},[]),oe=()=>new Promise(O=>{const x=setInterval(()=>{L.scene.globe.tilesLoaded&&(clearInterval(x),O())},100)}),fe=(O,x,H,z)=>{r?r(O,x,H,z):vn(O,x,H,v,z,p)};return a.useEffect(()=>{const O=L.dataSources.getByName(te)[0];O&&fe(L,O,[],void 0)},[L.scene.mode]),a.useEffect(()=>{L.layersManager&&L.layersManager.dataLayerList.length>0&&L.layersManager.findDataLayerById(n.id)!==void 0&&L.layersManager.addMetaToDataLayer(X)},[X]),a.useEffect(()=>{var O;(O=L.layersManager)==null||O.addDataLayer({options:t,meta:{...X},visualizationHandler:r})},[L.layersManager]),a.useEffect(()=>{L.dataSources.add(c);const O=()=>{ve()};L.scene.camera.moveEnd.addEventListener(O);const x=new g.ScreenSpaceEventHandler(L.scene.canvas);return P(x),G.current.currentZoomLevel>0&&(ve(),l.current=!0),()=>{var H;$.get(L,"_cesiumWidget")!==void 0&&(Y.current.clear(),j.current.clear(),L.dataSources.remove(L.dataSources.getByName(`${p==null?void 0:p.dataSourcePrefix}${c.name}`)[0]),L.dataSources.remove(c,!0),(H=L.layersManager)==null||H.removeDataLayer(n.id),L.scene.camera.moveEnd.removeEventListener(O),x.removeInputAction(g.ScreenSpaceEventType.MOUSE_MOVE))}},[]),null},Vn=e=>i.jsx(Me.Entity,{...e}),So=e=>i.jsx(Me.EntityDescription,{...e}),Gn=e=>i.jsx(Me.EntityDescription,{...e}),Hn=e=>i.jsx(Me.PolygonGraphics,{...e}),Wn=e=>i.jsx(Me.RectangleGraphics,{...e}),zn=e=>i.jsx(Me.CustomDataSource,{...e}),bo=e=>i.jsx(Me.PolylineGraphics,{...e}),Is="";var xe=function(){var e=M.Ellipsoid.WGS84,t,n=M.Material.fromType(M.Material.ColorType);function r(l,c=new M.Color(1,1,0,.5),_=new M.Color(1,1,1,1)){this._scene=l.scene,n.uniforms.color=c,t=_,this._tooltip={setVisible:()=>{},showAt:()=>{}},this._surfaces=[],this.initialiseHandlers(),this.enhancePrimitives()}r.prototype.initialiseHandlers=function(){var l=this._scene,c=this,_=new M.ScreenSpaceEventHandler(l.canvas);function y(w,P){if(c._handlersMuted!=!0){var m=l.pick(P);m&&m.primitive&&m.primitive[w]&&m.primitive[w](P)}}_.setInputAction(function(w){y("leftClick",w.position)},M.ScreenSpaceEventType.LEFT_CLICK),_.setInputAction(function(w){y("leftDoubleClick",w.position)},M.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);var S;_.setInputAction(function(w){if(c._handlersMuted!=!0){var P=l.pick(w.endPosition);S&&(!P||S!=P.primitive)&&(!(S.isDestroyed&&S.isDestroyed())&&S.mouseOut(w.endPosition),S=null),P&&P.primitive&&(P=P.primitive,P.mouseOut&&(S=P),P.mouseMove&&P.mouseMove(w.endPosition))}},M.ScreenSpaceEventType.MOUSE_MOVE),_.setInputAction(function(w){y("leftUp",w.position)},M.ScreenSpaceEventType.LEFT_UP),_.setInputAction(function(w){y("leftDown",w.position)},M.ScreenSpaceEventType.LEFT_DOWN)},r.prototype.setListener=function(l,c,_){l[c]=_},r.prototype.muteHandlers=function(l){this._handlersMuted=l},r.prototype.registerEditableShape=function(l){var c=this;Z(l,"mouseMove",function(_){l.setHighlighted(!0),l._editMode||c._tooltip.showAt(_,"Click to edit this shape")}),Z(l,"mouseOut",function(_){l.setHighlighted(!1),c._tooltip.setVisible(!1)}),Z(l,"leftClick",function(_){l.setEditMode(!0)})},r.prototype.startDrawing=function(l){this.disableAllEditMode(),this.editCleanUp&&this.editCleanUp(),this.editCleanUp=l,this.muteHandlers(!0)},r.prototype.stopDrawing=function(){this.editCleanUp&&(this.editCleanUp(),this.editCleanUp=null),this.muteHandlers(!1)},r.prototype.disableAllHighlights=function(){this.setHighlighted(void 0)},r.prototype.setHighlighted=function(l){this._highlightedSurface&&!this._highlightedSurface.isDestroyed()&&this._highlightedSurface!=l&&this._highlightedSurface.setHighlighted(!1),this._highlightedSurface=l},r.prototype.disableAllEditMode=function(){this.setEdited(void 0)},r.prototype.setEdited=function(l){this._editedSurface&&!this._editedSurface.isDestroyed()&&this._editedSurface.setEditMode(!1),this._editedSurface=l};var s={ellipsoid:M.Ellipsoid.WGS84,textureRotationAngle:0,height:0,asynchronous:!0,show:!0,debugShowBoundingVolume:!1},o=W(s,{appearance:new M.EllipsoidSurfaceAppearance({aboveGround:!1}),material:n,granularity:Math.PI/180}),d=W(s,{}),h=W(s,{}),f=W(s,{}),E=W(o,{rotation:0}),C=W(s,{width:5,geodesic:!0,granularity:1e4,appearance:new M.PolylineMaterialAppearance({aboveGround:!1}),material:n}),b=function(){function l(){}return l.prototype.initialiseOptions=function(c){X(this,c),this._ellipsoid=void 0,this._granularity=void 0,this._height=void 0,this._textureRotationAngle=void 0,this._id=void 0,this._createPrimitive=!0,this._primitive=void 0,this._outlinePolygon=void 0},l.prototype.setAttribute=function(c,_){this[c]=_,this._createPrimitive=!0},l.prototype.getAttribute=function(c){return this[c]},l.prototype.update=function(c,_,y){if(!M.defined(this.ellipsoid))throw new M.DeveloperError("this.ellipsoid must be defined.");if(!M.defined(this.appearance))throw new M.DeveloperError("this.material must be defined.");if(this.granularity<0)throw new M.DeveloperError("this.granularity and scene2D/scene3D overrides must be greater than zero.");if(this.show&&!(!this._createPrimitive&&!M.defined(this._primitive))){if(this._createPrimitive||this._ellipsoid!==this.ellipsoid||this._granularity!==this.granularity||this._height!==this.height||this._textureRotationAngle!==this.textureRotationAngle||this._id!==this.id){var S=this.getGeometry();if(!S)return;this._createPrimitive=!1,this._ellipsoid=this.ellipsoid,this._granularity=this.granularity,this._height=this.height,this._textureRotationAngle=this.textureRotationAngle,this._id=this.id,this._primitive=this._primitive&&this._primitive.destroy(),this._primitive=new M.Primitive({geometryInstances:new M.GeometryInstance({geometry:S,id:this.id,pickPrimitive:this}),appearance:this.appearance,asynchronous:this.asynchronous}),this._outlinePolygon=this._outlinePolygon&&this._outlinePolygon.destroy(),this.strokeColor&&this.getOutlineGeometry&&(this._outlinePolygon=new M.Primitive({geometryInstances:new M.GeometryInstance({geometry:this.getOutlineGeometry(),attributes:{color:M.ColorGeometryInstanceAttribute.fromColor(this.strokeColor)}}),appearance:new M.PerInstanceColorAppearance({flat:!0,renderState:{depthTest:{enabled:!0},lineWidth:this.strokeWidth||4}})}))}var w=this._primitive;w.appearance.material=this.material,w.debugShowBoundingVolume=this.debugShowBoundingVolume,w.update(c,_,y),this._outlinePolygon&&this._outlinePolygon.update(c,_,y)}},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),M.destroyObject(this)},l.prototype.setStrokeStyle=function(c,_){(!this.strokeColor||!this.strokeColor.equals(c)||this.strokeWidth!=_)&&(this._createPrimitive=!0,this.strokeColor=c,this.strokeWidth=_)},l}();r.ExtentPrimitive=function(){function l(c){if(!M.defined(c.extent))throw new M.DeveloperError("Extent is required");c=W(c,o),this.initialiseOptions(c),this.setExtent(c.extent)}return l.prototype=new b,l.prototype.setExtent=function(c){this.setAttribute("extent",c)},l.prototype.getExtent=function(){return this.getAttribute("extent")},l.prototype.getGeometry=function(){if(M.defined(this.extent))return new M.RectangleGeometry({rectangle:this.extent,height:this.height,vertexFormat:M.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity})},l.prototype.getOutlineGeometry=function(){return new M.RectangleOutlineGeometry({rectangle:this.extent})},l}(),r.PolygonPrimitive=function(){function l(c){c=W(c,o),this.initialiseOptions(c),this.isPolygon=!0}return l.prototype=new b,l.prototype.setPositions=function(c){this.setAttribute("positions",c)},l.prototype.getPositions=function(){return this.getAttribute("positions")},l.prototype.getGeometry=function(){if(!(!M.defined(this.positions)||this.positions.length<3))return M.PolygonGeometry.fromPositions({positions:this.positions,height:this.height,vertexFormat:M.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity})},l.prototype.getOutlineGeometry=function(){return M.PolygonOutlineGeometry.fromPositions({positions:this.getPositions()})},l}(),r.CirclePrimitive=function(){function l(c){if(!(M.defined(c.center)&&M.defined(c.radius)))throw new M.DeveloperError("Center and radius are required");c=W(c,o),this.initialiseOptions(c),this.setRadius(c.radius)}return l.prototype=new b,l.prototype.setCenter=function(c){this.setAttribute("center",c)},l.prototype.setRadius=function(c){this.setAttribute("radius",Math.max(.1,c))},l.prototype.getCenter=function(){return this.getAttribute("center")},l.prototype.getRadius=function(){return this.getAttribute("radius")},l.prototype.getGeometry=function(){if(M.defined(this.center)&&M.defined(this.radius))return new M.CircleGeometry({center:this.center,radius:this.radius,height:this.height,vertexFormat:M.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity})},l.prototype.getOutlineGeometry=function(){return new M.CircleOutlineGeometry({center:this.getCenter(),radius:this.getRadius()})},l}(),r.EllipsePrimitive=function(){function l(c){if(!(M.defined(c.center)&&M.defined(c.semiMajorAxis)&&M.defined(c.semiMinorAxis)))throw new M.DeveloperError("Center and semi major and semi minor axis are required");c=W(c,E),this.initialiseOptions(c)}return l.prototype=new b,l.prototype.setCenter=function(c){this.setAttribute("center",c)},l.prototype.setSemiMajorAxis=function(c){c<this.getSemiMinorAxis()||this.setAttribute("semiMajorAxis",c)},l.prototype.setSemiMinorAxis=function(c){c>this.getSemiMajorAxis()||this.setAttribute("semiMinorAxis",c)},l.prototype.setRotation=function(c){return this.setAttribute("rotation",c)},l.prototype.getCenter=function(){return this.getAttribute("center")},l.prototype.getSemiMajorAxis=function(){return this.getAttribute("semiMajorAxis")},l.prototype.getSemiMinorAxis=function(){return this.getAttribute("semiMinorAxis")},l.prototype.getRotation=function(){return this.getAttribute("rotation")},l.prototype.getGeometry=function(){if(M.defined(this.center)&&M.defined(this.semiMajorAxis)&&M.defined(this.semiMinorAxis))return new M.EllipseGeometry({ellipsoid:this.ellipsoid,center:this.center,semiMajorAxis:this.semiMajorAxis,semiMinorAxis:this.semiMinorAxis,rotation:this.rotation,height:this.height,vertexFormat:M.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,granularity:this.granularity})},l.prototype.getOutlineGeometry=function(){return new M.EllipseOutlineGeometry({center:this.getCenter(),semiMajorAxis:this.getSemiMajorAxis(),semiMinorAxis:this.getSemiMinorAxis(),rotation:this.getRotation()})},l}(),r.PolylinePrimitive=function(){function l(c){c=W(c,C),this.initialiseOptions(c)}return l.prototype=new b,l.prototype.setPositions=function(c){this.setAttribute("positions",c)},l.prototype.setWidth=function(c){this.setAttribute("width",c)},l.prototype.setGeodesic=function(c){this.setAttribute("geodesic",c)},l.prototype.getPositions=function(){return this.getAttribute("positions")},l.prototype.getWidth=function(){return this.getAttribute("width")},l.prototype.getGeodesic=function(c){return this.getAttribute("geodesic")},l.prototype.getGeometry=function(){if(!(!M.defined(this.positions)||this.positions.length<2))return new M.PolylineGeometry({positions:this.positions,height:this.height,width:this.width<1?1:this.width,vertexFormat:M.EllipsoidSurfaceAppearance.VERTEX_FORMAT,ellipsoid:this.ellipsoid})},l}();var p={iconUrl:"./assets/img/dragIcon.png",shiftX:0,shiftY:0},v={iconUrl:"./assets/img/dragIcon.png",shiftX:0,shiftY:0},I={iconUrl:"./assets/img/dragIconLight.png",shiftX:0,shiftY:0};r.prototype.createBillboardGroup=function(l,c,_){var y=new r.BillboardGroup(this,c);return y.addBillboards(l,_),y},r.BillboardGroup=function(l,c){this._drawHelper=l,this._scene=l._scene,this._options=W(c,p);var _=new M.BillboardCollection;this._scene.primitives.add(_),this._billboards=_,this._orderedBillboards=[]},r.BillboardGroup.prototype.createBillboard=function(l,c){var _=this._billboards.add({show:!0,position:l,pixelOffset:new M.Cartesian2(this._options.shiftX,this._options.shiftY),eyeOffset:new M.Cartesian3(0,0,0),horizontalOrigin:M.HorizontalOrigin.CENTER,verticalOrigin:M.VerticalOrigin.CENTER,scale:1,image:this._options.iconUrl,color:t});if(c){let w=function(m){S.enableRotate=m},P=function(){for(var m=0,T=y._orderedBillboards.length;m<T&&y._orderedBillboards[m]!=_;++m);return m};var y=this,S=this._scene.screenSpaceCameraController;if(c.dragHandlers){var y=this;Z(_,"leftDown",function(T){function k(D){_.position=D;for(var B=0,ee=y._orderedBillboards.length;B<ee&&y._orderedBillboards[B]!=_;++B);c.dragHandlers.onDrag&&c.dragHandlers.onDrag(P(),D)}function N(D){A.destroy(),w(!0),c.dragHandlers.onDragEnd&&c.dragHandlers.onDragEnd(P(),D)}var A=new M.ScreenSpaceEventHandler(y._scene.canvas);A.setInputAction(function(D){var B=y._scene.camera.pickEllipsoid(D.endPosition,e);B?k(B):N(B)},M.ScreenSpaceEventType.MOUSE_MOVE),A.setInputAction(function(D){N(y._scene.camera.pickEllipsoid(D.position,e))},M.ScreenSpaceEventType.LEFT_UP),w(!1),c.dragHandlers.onDragStart&&c.dragHandlers.onDragStart(P(),y._scene.camera.pickEllipsoid(T,e))})}c.onDoubleClick&&Z(_,"leftDoubleClick",function(m){c.onDoubleClick(P())}),c.onClick&&Z(_,"leftClick",function(m){c.onClick(P())}),c.tooltip&&(Z(_,"mouseMove",function(m){y._drawHelper._tooltip.showAt(m,c.tooltip())}),Z(_,"mouseOut",function(m){y._drawHelper._tooltip.setVisible(!1)}))}return _},r.BillboardGroup.prototype.insertBillboard=function(l,c,_){this._orderedBillboards.splice(l,0,this.createBillboard(c,_))},r.BillboardGroup.prototype.addBillboard=function(l,c){this._orderedBillboards.push(this.createBillboard(l,c))},r.BillboardGroup.prototype.addBillboards=function(l,c){for(var _=0;_<l.length;_++)this.addBillboard(l[_],c)},r.BillboardGroup.prototype.updateBillboardsPositions=function(l){for(var c=0;c<l.length;c++)this.getBillboard(c).position=l[c]},r.BillboardGroup.prototype.countBillboards=function(){return this._orderedBillboards.length},r.BillboardGroup.prototype.getBillboard=function(l){return this._orderedBillboards[l]},r.BillboardGroup.prototype.removeBillboard=function(l){this._billboards.remove(this.getBillboard(l)),this._orderedBillboards.splice(l,1)},r.BillboardGroup.prototype.remove=function(){this._billboards=this._billboards&&this._billboards.removeAll()&&this._billboards.destroy()},r.BillboardGroup.prototype.setOnTop=function(){this._scene.primitives.raiseToTop(this._billboards)},r.prototype.startDrawingMarker=function(c){var c=W(c,p);this.startDrawing(function(){w.remove(),P.destroy(),S.setVisible(!1)});var _=this,y=this._scene;y.primitives;var S=this._tooltip,w=new r.BillboardGroup(this,c),P=new M.ScreenSpaceEventHandler(y.canvas);P.setInputAction(function(m){if(m.position!=null){var T=y.camera.pickEllipsoid(m.position,e);T&&(w.addBillboard(T),_.stopDrawing(),c.callback(T))}},M.ScreenSpaceEventType.LEFT_CLICK),P.setInputAction(function(m){var T=m.endPosition;if(T!=null){var k=y.camera.pickEllipsoid(T,e);k?S.showAt(T,"<p>Click to add your marker. Position is: </p>"+Y(e.cartesianToCartographic(k))):S.showAt(T,"<p>Click on the globe to add your marker.</p>")}},M.ScreenSpaceEventType.MOUSE_MOVE)},r.prototype.startDrawingPolygon=function(c){var c=W(c,o);this.startDrawingPolyshape(!0,c)},r.prototype.startDrawingPolyline=function(c){var c=W(c,C);this.startDrawingPolyshape(!1,c)},r.prototype.startDrawingPolyshape=function(l,c){this.startDrawing(function(){S.remove(m),k.remove(),N.destroy(),w.setVisible(!1),G(y)});var _=this,y=this._scene,S=y.primitives,w=this._tooltip,P=l?3:2,m;l?m=new xe.PolygonPrimitive(c):m=new xe.PolylinePrimitive(c),m.asynchronous=!1,S.add(m);var T=[],k=new r.BillboardGroup(this,p),N=new M.ScreenSpaceEventHandler(y.canvas);F(y),N.setInputAction(function(A){if(A.position!=null){var D=y.camera.pickEllipsoid(A.position,e);D&&(T.length==0&&(T.push(D.clone()),k.addBillboard(T[0])),T.length>=P&&(m.positions=T,m._createPrimitive=!0),T.push(D),k.addBillboard(D))}},M.ScreenSpaceEventType.LEFT_CLICK),N.setInputAction(function(A){var D=A.endPosition;if(D!=null)if(T.length==0)w.showAt(D,"<p>Click to add first point</p>");else{var B=y.camera.pickEllipsoid(D,e);B&&(T.pop(),B.y+=1+Math.random(),T.push(B),T.length>=P&&(m.positions=T,m._createPrimitive=!0),k.getBillboard(T.length-1).position=B,w.showAt(D,"<p>Click to add new point ("+T.length+")</p>"+(T.length>P?"<p>Double click to finish drawing</p>":"")))}},M.ScreenSpaceEventType.MOUSE_MOVE),N.setInputAction(function(A){var D=A.position;if(D!=null){if(T.length<P+2)return;var B=y.camera.pickEllipsoid(D,e);B&&(G(y),_.stopDrawing(),typeof c.callback=="function"&&(T.length-1,c.callback(T)))}},M.ScreenSpaceEventType.LEFT_DOUBLE_CLICK)};function L(l){return e.cartographicArrayToCartesianArray([M.Rectangle.northwest(l),M.Rectangle.northeast(l),M.Rectangle.southeast(l),M.Rectangle.southwest(l)])}function F(l){l&&(l.canvas.style.cursor="crosshair")}function G(l){l&&(l.canvas.style.cursor="")}r.prototype.startDrawingExtent=function(c){var c=W(c,o);this.startDrawing(function(){m!=null&&S.remove(m),T!=null&&T.remove(),k.destroy(),w.setVisible(!1),G(y)});var _=this,y=this._scene,S=this._scene.primitives,w=this._tooltip,P=null,m=null,T=null,k=new M.ScreenSpaceEventHandler(y.canvas);F(y);function N(A){m==null&&(m=new xe.ExtentPrimitive({extent:A,material:c.material}),m.asynchronous=!1,S.add(m)),m.setExtent(A);var D=L(A);T==null?(T=new r.BillboardGroup(_,p),T.addBillboards(D)):T.updateBillboardsPositions(D)}k.setInputAction(function(A){if(A.position!=null){var D=y.camera.pickEllipsoid(A.position,e);if(D)if(m==null){P=e.cartesianToCartographic(D);var B=j(P,P);N(B)}else _.stopDrawing(),typeof c.callback=="function"&&c.callback(j(P,e.cartesianToCartographic(D)))}},M.ScreenSpaceEventType.LEFT_DOWN),k.setInputAction(function(A){var D=A.endPosition;if(D!=null)if(m==null)w.showAt(D,"<p>Click to start drawing rectangle</p>");else{var B=y.camera.pickEllipsoid(D,e);if(B){var ee=j(P,e.cartesianToCartographic(B));N(ee),w.showAt(D,"<p>Drag to change rectangle extent</p><p>Click again to finish drawing</p>")}}},M.ScreenSpaceEventType.MOUSE_MOVE)},r.prototype.startDrawingCircle=function(c){var c=W(c,o);this.startDrawing(function(){P!=null&&S.remove(P),m.remove(),T.destroy(),w.setVisible(!1)});var _=this,y=this._scene,S=this._scene.primitives,w=this._tooltip,P=null,m=null,T=new M.ScreenSpaceEventHandler(y.canvas);T.setInputAction(function(k){if(k.position!=null){var N=y.camera.pickEllipsoid(k.position,e);N&&(P==null?(P=new r.CirclePrimitive({center:N,radius:0,asynchronous:!1,material:c.material}),S.add(P),m=new r.BillboardGroup(_,p),m.addBillboards([N])):(typeof c.callback=="function"&&c.callback(P.getCenter(),P.getRadius()),_.stopDrawing()))}},M.ScreenSpaceEventType.LEFT_DOWN),T.setInputAction(function(k){var N=k.endPosition;if(N!=null)if(P==null)w.showAt(N,"<p>Click to start drawing the circle</p>");else{var A=y.camera.pickEllipsoid(N,e);A&&(P.setRadius(M.Cartesian3.distance(P.getCenter(),A)),m.updateBillboardsPositions(A),w.showAt(N,"<p>Move mouse to change circle radius</p><p>Click again to finish drawing</p>"))}},M.ScreenSpaceEventType.MOUSE_MOVE)},r.prototype.enhancePrimitives=function(){var l=this;M.Billboard.prototype.setEditable=function(){if(this._editable)return;this._editable=!0;var y=this,S=this;function w(P){l._scene.screenSpaceCameraController.enableRotate=P}Z(y,"leftDown",function(P){function m(N){y.position=N,S.executeListeners({name:"drag",positions:N})}function T(N){k.destroy(),w(!0),S.executeListeners({name:"dragEnd",positions:N})}var k=new M.ScreenSpaceEventHandler(l._scene.canvas);k.setInputAction(function(N){var A=l._scene.camera.pickEllipsoid(N.endPosition,e);A?m(A):T(A)},M.ScreenSpaceEventType.MOUSE_MOVE),k.setInputAction(function(N){T(l._scene.camera.pickEllipsoid(N.position,e))},M.ScreenSpaceEventType.LEFT_UP),w(!1)}),te(y)};function c(y){l._scene,!(this._highlighted&&this._highlighted==y)&&this._editMode!==!0&&(this._highlighted=y,y?(l.setHighlighted(this),this._strokeColor=this.strokeColor,this.setStrokeStyle(M.Color.fromCssColorString("white"),this.strokeWidth)):this._strokeColor?this.setStrokeStyle(this._strokeColor,this.strokeWidth):this.setStrokeStyle(void 0,void 0))}function _(y){if(this._editMode!=y)if(l.disableAllHighlights(),y){l.setEdited(this);var S=l._scene,w=this;if(this._markers==null){let B=function(q,R){var ie=q-1<0?R.length-1:q-1;ie<m.countBillboards()&&(m.getBillboard(ie).position=ne(ie)),ie=q,ie<m.countBillboards()&&(m.getBillboard(ie).position=ne(ie))},ee=function(){w.executeListeners({name:"onEdited",positions:w.positions})},ne=function(q){var R=w.positions;return e.cartographicToCartesian(new M.EllipsoidGeodesic(e.cartesianToCartographic(R[q]),e.cartesianToCartographic(R[q<R.length-1?q+1:0])).interpolateUsingFraction(.5))};var P=new r.BillboardGroup(l,v),m=new r.BillboardGroup(l,I),T={dragHandlers:{onDrag:function(q,R){w.positions[q]=R,B(q,w.positions),w._createPrimitive=!0},onDragEnd:function(q,R){w._createPrimitive=!0,ee()}},onDoubleClick:function(q){w.positions.length<4||(w.positions.splice(q,1),w._createPrimitive=!0,P.removeBillboard(q),m.removeBillboard(q),B(q,w.positions),ee())},tooltip:function(){if(w.positions.length>3)return"Double click to remove this point"}};P.addBillboards(w.positions,T),this._markers=P;for(var k=[],N=0,A=w.positions.length+(this.isPolygon?0:-1);N<A;N++)k.push(ne(N));var D={dragHandlers:{onDragStart:function(q,R){this.index=q+1,w.positions.splice(this.index,0,R),w._createPrimitive=!0},onDrag:function(q,R){w.positions[this.index]=R,w._createPrimitive=!0},onDragEnd:function(q,R){P.insertBillboard(this.index,R,T),m.getBillboard(this.index-1).position=ne(this.index-1),m.insertBillboard(this.index,ne(this.index),D),w._createPrimitive=!0,ee()}},tooltip:function(){return"Drag to create a new point"}};m.addBillboards(k,D),this._editMarkers=m,this._globeClickhandler=new M.ScreenSpaceEventHandler(S.canvas),this._globeClickhandler.setInputAction(function(q){var R=S.pick(q.position);R&&R.primitive||w.setEditMode(!1)},M.ScreenSpaceEventType.LEFT_CLICK),P.setOnTop(),m.setOnTop()}this._editMode=!0}else this._markers!=null&&(this._markers.remove(),this._editMarkers.remove(),this._markers=null,this._editMarkers=null,this._globeClickhandler.destroy()),this._editMode=!1}xe.PolylinePrimitive.prototype.setEditable=function(){if(!this.setEditMode){var y=this;y.isPolygon=!1,y.asynchronous=!1,l.registerEditableShape(y),y.setEditMode=_;var S=this.width;y.setHighlighted=function(w){this._editMode!==!0&&(w?(l.setHighlighted(this),this.setWidth(S*2)):this.setWidth(S))},y.getExtent=function(){return M.Rectangle.fromCartographicArray(e.cartesianArrayToCartographicArray(this.positions))},te(y),y.setEditMode(!1)}},xe.PolygonPrimitive.prototype.setEditable=function(){var y=this;y.asynchronous=!1,l._scene,l.registerEditableShape(y),y.setEditMode=_,y.setHighlighted=c,te(y),y.setEditMode(!1)},xe.ExtentPrimitive.prototype.setEditable=function(){if(!this.setEditMode){var y=this,S=l._scene;l.registerEditableShape(y),y.asynchronous=!1,y.setEditMode=function(w){if(this._editMode!=w)if(l.disableAllHighlights(),w){if(l.setEdited(this),this._markers==null){let T=function(){y.executeListeners({name:"onEdited",extent:y.extent})};var P=new r.BillboardGroup(l,v),m={dragHandlers:{onDrag:function(k,N){var A=P.getBillboard((k+2)%4).position;y.setExtent(j(e.cartesianToCartographic(A),e.cartesianToCartographic(N))),P.updateBillboardsPositions(L(y.extent))},onDragEnd:function(k,N){T()}},tooltip:function(){return"Drag to change the corners of this extent"}};P.addBillboards(L(y.extent),m),this._markers=P,this._globeClickhandler=new M.ScreenSpaceEventHandler(S.canvas),this._globeClickhandler.setInputAction(function(k){var N=S.pick(k.position);N&&!N.isDestroyed()&&N.primitive||y.setEditMode(!1)},M.ScreenSpaceEventType.LEFT_CLICK),P.setOnTop()}this._editMode=!0}else this._markers!=null&&(this._markers.remove(),this._markers=null,this._globeClickhandler.destroy()),this._editMode=!1},y.setHighlighted=c,te(y),y.setEditMode(!1)}},r.EllipsePrimitive.prototype.setEditable=function(){if(!this.setEditMode){var y=this,S=l._scene;y.asynchronous=!1,l.registerEditableShape(y),y.setEditMode=function(w){if(this._editMode!=w)if(l.disableAllHighlights(),w){l.setEdited(this);var P=this;if(this._markers==null){let k=function(){return M.EllipseOutlineGeometry(e,y.getCenter(),y.getSemiMajorAxis(),y.getSemiMinorAxis(),y.getRotation()+Math.PI/2,Math.PI/2).splice(0,4)},N=function(){y.executeListeners({name:"onEdited",center:y.getCenter(),semiMajorAxis:y.getSemiMajorAxis(),semiMinorAxis:y.getSemiMinorAxis(),rotation:0})};var m=new r.BillboardGroup(l,v),T={dragHandlers:{onDrag:function(A,D){var B=M.Cartesian3.distance(y.getCenter(),D);A%2==0?y.setSemiMajorAxis(B):y.setSemiMinorAxis(B),m.updateBillboardsPositions(k())},onDragEnd:function(A,D){N()}},tooltip:function(){return"Drag to change the excentricity and radius"}};m.addBillboards(k(),T),this._markers=m,this._globeClickhandler=new M.ScreenSpaceEventHandler(S.canvas),this._globeClickhandler.setInputAction(function(A){var D=S.pick(A.position);D&&D.primitive||P.setEditMode(!1)},M.ScreenSpaceEventType.LEFT_CLICK),m.setOnTop()}this._editMode=!0}else this._markers!=null&&(this._markers.remove(),this._markers=null,this._globeClickhandler.destroy()),this._editMode=!1},y.setHighlighted=c,te(y),y.setEditMode(!1)}},r.CirclePrimitive.prototype.getCircleCartesianCoordinates=function(y){for(var S=M.CircleOutlineGeometry.createGeometry(new M.CircleOutlineGeometry({ellipsoid:e,center:this.getCenter(),radius:this.getRadius(),granularity:y})),w=0,P,m=[];w<S.attributes.position.values.length;w+=3)P=S.attributes.position.values,m.push(new M.Cartesian3(P[w],P[w+1],P[w+2]));return m},r.CirclePrimitive.prototype.setEditable=function(){if(!this.setEditMode){var y=this,S=l._scene;y.asynchronous=!1,l.registerEditableShape(y),y.setEditMode=function(w){if(this._editMode!=w)if(l.disableAllHighlights(),w){l.setEdited(this);var P=this;if(this._markers==null){let k=function(){return P.getCircleCartesianCoordinates(M.Math.PI_OVER_TWO)},N=function(){y.executeListeners({name:"onEdited",center:y.getCenter(),radius:y.getRadius()})};var m=new r.BillboardGroup(l,v),T={dragHandlers:{onDrag:function(A,D){y.setRadius(M.Cartesian3.distance(y.getCenter(),D)),m.updateBillboardsPositions(k())},onDragEnd:function(A,D){N()}},tooltip:function(){return"Drag to change the radius"}};m.addBillboards(k(),T),this._markers=m,this._globeClickhandler=new M.ScreenSpaceEventHandler(S.canvas),this._globeClickhandler.setInputAction(function(A){var D=S.pick(A.position);D&&D.primitive||P.setEditMode(!1)},M.ScreenSpaceEventType.LEFT_CLICK),m.setOnTop()}this._editMode=!0}else this._markers!=null&&(this._markers.remove(),this._markers=null,this._globeClickhandler.destroy()),this._editMode=!1},y.setHighlighted=c,te(y),y.setEditMode(!1)}}},r.DrawHelperWidget=function(){function l(c,_){if(!M.defined(_.container))throw new M.DeveloperError("Container is required");var y={markerIcon:"./assets/img/glyphicons_242_google_maps.png",polylineIcon:"./assets/img/glyphicons_097_vector_path_line.png",polygonIcon:"./assets/img/glyphicons_096_vector_path_polygon.png",circleIcon:"./assets/img/glyphicons_095_vector_path_circle.png",extentIcon:"./assets/img/glyphicons_094_vector_path_square.png",clearIcon:"./assets/img/glyphicons_067_cleaning.png",polylineDrawingOptions:C,polygonDrawingOptions:d,extentDrawingOptions:h,circleDrawingOptions:f};X(_,y);var S=this,w=document.createElement("DIV");w.className="toolbar",_.container.appendChild(w);function P(k,N,A,D){var B=document.createElement("DIV");B.className="button",B.title=A,w.appendChild(B),B.onclick=D;var ee=document.createElement("SPAN");B.appendChild(ee);var ne=document.createElement("IMG");return ne.src=N,ee.appendChild(ne),B}var m=c._scene;P("marker",_.markerIcon,"Click to start drawing a 2D marker",function(){c.startDrawingMarker({callback:function(k){S.executeListeners({name:"markerCreated",position:k})}})}),P("polyline",_.polylineIcon,"Click to start drawing a 2D polyline",function(){c.startDrawingPolyline({callback:function(k){S.executeListeners({name:"polylineCreated",positions:k})}})}),P("polygon",_.polygonIcon,"Click to start drawing a 2D polygon",function(){c.startDrawingPolygon({callback:function(k){S.executeListeners({name:"polygonCreated",positions:k})}})}),P("extent",_.extentIcon,"Click to start drawing an Extent",function(){c.startDrawingExtent({callback:function(k){S.executeListeners({name:"extentCreated",extent:k})}})}),P("circle",_.circleIcon,"Click to start drawing a Circle",function(){c.startDrawingCircle({callback:function(k,N){S.executeListeners({name:"circleCreated",center:k,radius:N})}})});var T=document.createElement("DIV");T.className="divider",w.appendChild(T),P("clear",_.clearIcon,"Remove all primitives",function(){m.primitives.removeAll()}),te(this)}return l}(),r.prototype.addToolbar=function(l,c){return c=W(c,{container:l}),new r.DrawHelperWidget(this,c)};function j(l,c){var _=new M.Rectangle;_.west=Math.min(l.longitude,c.longitude),_.east=Math.max(l.longitude,c.longitude),_.south=Math.min(l.latitude,c.latitude),_.north=Math.max(l.latitude,c.latitude);var y=M.Math.EPSILON7;return _.east-_.west<y&&(_.east+=y*2),_.north-_.south<y&&(_.north+=y*2),_}function Y(l,c){return l.longitude.toFixed(c||3)+", "+l.latitude.toFixed(c||3)}function V(l,c){if(l==null||typeof l!="object"||l.constructor!=Object&&l.constructor!=Array)return l;if(l.constructor==Date||l.constructor==RegExp||l.constructor==Function||l.constructor==String||l.constructor==Number||l.constructor==Boolean)return new l.constructor(l);c=c||new l.constructor;for(var _ in l)c[_]=typeof c[_]>"u"?V(l[_],null):c[_];return c}function X(l,c){l=l||{};var _;for(_ in c)l[_]===void 0&&(l[_]=V(c[_]))}function W(l,c){var _=V(l),y;for(y in c)_[y]===void 0&&(_[y]=V(c[y]));return _}function Z(l,c,_){l[c]=_}function te(l){l._listeners={},l.addListener=function(c,_){return this._listeners[c]=this._listeners[c]||[],this._listeners[c].push(_),this._listeners[c].length},l.executeListeners=function(c,_){if(this._listeners[c.name]&&this._listeners[c.name].length>0)for(var y=0;y<this._listeners[c.name].length;y++)this._listeners[c.name][y](c);else _&&_(c)}}return r}();const Co=e=>{const t=e.map(n=>{const r=g.Cartographic.fromCartesian(n);return[g.Math.toDegrees(r.longitude),g.Math.toDegrees(r.latitude)]});return t.push(t[0]),{type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[t]}}},Mo=e=>{const t=Gt.lineString([[g.Math.toDegrees(e.west),g.Math.toDegrees(e.south)],[g.Math.toDegrees(e.east),g.Math.toDegrees(e.north)]]);return je(qe(t))},_o=2,Po=(e,t)=>{switch(e){case we.BOX:{if(t.features.length!==_o)throw new Error(`${e} must have 2 points`);const n=$.find(t.features,s=>{var o;return((o=s.properties)==null?void 0:o.type)===Ze.BOTTOM_LEFT}),r=$.find(t.features,s=>{var o;return((o=s.properties)==null?void 0:o.type)===Ze.TOP_RIGHT});if(r&&n){if(n.geometry.coordinates[0]===r.geometry.coordinates[0]&&n.geometry.coordinates[1]===r.geometry.coordinates[1])throw new Error(`${e} must define BOTTOM_LEFT and TOP_RIGHT different points`);return g.Rectangle.fromDegrees(n.geometry.coordinates[0],n.geometry.coordinates[1],r.geometry.coordinates[0],r.geometry.coordinates[1])}else throw new Error(`${e} geojson must define BOTTOM_LEFT and TOP_RIGHT points`)}default:throw new Error(`${e} type geoJSON still not supported`)}},Io=e=>{const t=Gt.lineString([[e.west,e.south],[e.east,e.north]]);return je(qe(t)).geometry.coordinates[0].map(r=>g.Cartesian3.fromRadiansArray(r)[0])},Ao=e=>{const{drawState:t,drawingMaterial:n,drawingVertexColor:r,material:s,hollow:o,outlineWidth:d}=e,h=pe(),[f,E]=a.useState();a.useEffect(()=>{E(new xe(h,n,r))},[]),a.useEffect(()=>{if(f){const b=f;if(t.drawing)switch(t.type){case we.POLYGON:h.scene.globe.depthTestAgainstTerrain=!1,b.startDrawingPolygon({callback:p=>{t.handler({primitive:p,type:we.POLYGON,geojson:Co(p)})}});break;case we.BOX:h.scene.globe.depthTestAgainstTerrain=!1,b.startDrawingExtent({callback:p=>{t.handler({primitive:p,type:we.BOX,geojson:Mo(p)})}});break;default:throw new Error(`[CESIUM DRAW]: ${t.type} unrecognized primitive to draw.`)}else b.stopDrawing(),h.scene.globe.depthTestAgainstTerrain=!0}},[t,f]);const C=b=>{try{let p=b.coordinates!==void 0?b.coordinates:Po(b.type,b.geojson);if(o!==!0)switch(b.type){case we.BOX:return i.jsx(Wn,{coordinates:p,material:s??n});case we.POLYGON:return i.jsx(Hn,{hierarchy:new g.PolygonHierarchy(p),material:s??n});default:return i.jsx(i.Fragment,{})}else{switch(b.type){case we.BOX:p=Io(p);break;case we.POLYGON:p=[...p,p[0]];break;default:return i.jsx(i.Fragment,{})}return i.jsx(bo,{clampToGround:!0,positions:p,width:d??1,material:s??n})}}catch(p){return console.error(p),i.jsx(i.Fragment,{})}};return i.jsx(zn,{...e,children:e.drawings.map((b,p)=>i.jsxs(Vn,{name:b.name,children:[i.jsxs(Gn,{children:[i.jsxs("h1",{children:["Drawed Entity ",b.name]}),i.jsx("p",{children:"This is description of drawed entity"})]}),C(b)]},b.id))})},Oo=()=>{const e=pe();return a.useEffect(()=>{e.extend(g.viewerCesiumInspectorMixin)},[e]),null},Do=-25,Un=2,ko=e=>{const t=pe(),n=(o,d=",")=>o.slice(o.indexOf(`
18
23
  `)+1).split(`
19
- `).map(y=>{const T=y.split(h);return{cartographic:u.Cartographic.fromDegrees(parseFloat(T[0]),parseFloat(T[1])),cartesian:new u.Cartesian2(parseFloat(T[0]),parseFloat(T[1]))}}),r=i=>{var g;i.preventDefault(),i.persist();const h=new FileReader;h.onload=f=>{var M;const y=(M=f.target)==null?void 0:M.result,T=t(y),m=u.Ellipsoid.WGS84;console.log(`Loaded CSV content:
20
- `,y),u.sampleTerrainMostDetailed(n.terrainProvider,T.map(O=>O.cartographic)).then(O=>{console.log(O),O=O.slice(0,O.length-1),n.scene.globe.depthTestAgainstTerrain=!0,n.entities.suspendEvents(),n.entities.removeAll(),O.forEach((_,z)=>{n.entities.add({name:(z+Nn).toString(),position:m.cartographicToCartesian(_),billboard:{verticalOrigin:u.VerticalOrigin.BOTTOM,scale:.7,image:"assets/img/map-marker.gif"},label:{text:(z+Nn).toString(),font:"14pt monospace",fillColor:u.Color.BLACK,style:u.LabelStyle.FILL_AND_OUTLINE,outlineWidth:4,outlineColor:u.Color.BLACK,verticalOrigin:u.VerticalOrigin.BOTTOM,pixelOffset:new u.Cartesian2(0,po)},description:`
21
- Long: ${T[z].cartesian.x} </br>
22
- Lat: ${T[z].cartesian.y} </br>
23
- Height(m): <span style="font-weight: 500">${_.height}</span>
24
- `})}),n.entities.resumeEvents(),i.target.files!==null&&(s(`terranian_heights_${i.target.files[0].name}`,T),i.target.value=""),console.log("Pinned point count is ",n.entities.values.length)},O=>{console.error("ERROR while sampleTerrainMostDetailed:",O)})},(g=i.target.files)!=null&&g[0]&&h.readAsText(i.target.files[0])},s=(i,h)=>{const g=M=>{let O="";return O+=M.cartesian.x.toString()+",",O+=M.cartesian.y.toString()+",",O+=M.cartographic.height.toString(),O+`
24
+ `).map(E=>{const C=E.split(d);return{cartographic:g.Cartographic.fromDegrees(parseFloat(C[0]),parseFloat(C[1])),cartesian:new g.Cartesian2(parseFloat(C[0]),parseFloat(C[1]))}}),r=o=>{var h;o.preventDefault(),o.persist();const d=new FileReader;d.onload=f=>{var p;const E=(p=f.target)==null?void 0:p.result,C=n(E),b=g.Ellipsoid.WGS84;console.log(`Loaded CSV content:
25
+ `,E),g.sampleTerrainMostDetailed(t.terrainProvider,C.map(v=>v.cartographic)).then(v=>{console.log(v),v=v.slice(0,v.length-1),t.scene.globe.depthTestAgainstTerrain=!0,t.entities.suspendEvents(),t.entities.removeAll(),v.forEach((I,L)=>{t.entities.add({name:(L+Un).toString(),position:b.cartographicToCartesian(I),billboard:{verticalOrigin:g.VerticalOrigin.BOTTOM,scale:.7,image:"assets/img/map-marker.gif"},label:{text:(L+Un).toString(),font:"14pt monospace",fillColor:g.Color.BLACK,style:g.LabelStyle.FILL_AND_OUTLINE,outlineWidth:4,outlineColor:g.Color.BLACK,verticalOrigin:g.VerticalOrigin.BOTTOM,pixelOffset:new g.Cartesian2(0,Do)},description:`
26
+ Long: ${C[L].cartesian.x} </br>
27
+ Lat: ${C[L].cartesian.y} </br>
28
+ Height(m): <span style="font-weight: 500">${I.height}</span>
29
+ `})}),t.entities.resumeEvents(),o.target.files!==null&&(s(`terranian_heights_${o.target.files[0].name}`,C),o.target.value=""),console.log("Pinned point count is ",t.entities.values.length)},v=>{console.error("ERROR while sampleTerrainMostDetailed:",v)})},(h=o.target.files)!=null&&h[0]&&d.readAsText(o.target.files[0])},s=(o,d)=>{const h=p=>{let v="";return v+=p.cartesian.x.toString()+",",v+=p.cartesian.y.toString()+",",v+=p.cartographic.height.toString(),v+`
25
30
  `};let f=`long,lat,height
26
- `;h.forEach(M=>{f+=g(M)});const y=new Blob([f],{type:"text/csv;charset=utf-8;"}),T=document.createElement("a"),m=URL.createObjectURL(y);T.setAttribute("href",m),T.setAttribute("download",i),T.style.visibility="hidden",document.body.appendChild(T),T.click(),document.body.removeChild(T)};return o.jsx(o.Fragment,{children:o.jsx("input",{type:"file",id:"csvFile",accept:".csv",onChange:i=>{r(i)}})})},as="",mo=38,yo=40,vo=13,Eo=14,wo=27,So=9,To=10,Co=100,Lo=e=>{const[n,t]=l.useState(e.defaultValue??""),[r,s]=l.useState(!1),[i,h]=l.useState({helperVisible:!1,left:0,right:0,trigger:"",matchLength:0,matchStart:0,options:[],selection:0,top:0,value:"",caret:0,width:"unset"}),g=l.useRef(null);l.useEffect(()=>(window.addEventListener("resize",_),()=>{try{window.removeEventListener("resize",_)}catch(C){console.log('WINDOW "resize" remove listener failed',C)}}),[]),l.useEffect(()=>{typeof e.value<"u"&&t(e.value),typeof e.defaultValue<"u"&&t(e.defaultValue)},[e.value,e.defaultValue]),l.useEffect(()=>{const{options:C}=e,{caret:v}=i;J(n,v,C)},[e]);const f=(C,v,L)=>{const{trigger:E,matchAny:D,regex:k}=e,A=new RegExp(k);let I=E;Array.isArray(I)||(I=new Array(E)),I.sort();const x={};Array.isArray(L)&&I.forEach(le=>{x[le]=L});const B=y(I,A);let ie={};for(let le=0;le<B.length;le++){const{triggerStr:U,triggerMatch:re,triggerLength:pe}=B[le];for(let fe=v-1;fe>=0;--fe){const Pe=C.substring(fe,v).match(A);let Se=-1;if(pe>0){const b=re?fe:fe-pe+1;if(b<0||(T(U,C,b)&&(Se=b+pe),!Pe&&Se<0))break}else{if(Pe&&fe>0)continue;if(Se=fe===0&&Pe?0:fe+1,v-Se===0)break}if(Se>=0){const b=x[U];if(!Array.isArray(b))continue;const P=C.substring(Se,v),N=b.filter(K=>{const oe=K.toLowerCase().indexOf(P.toLowerCase());return oe!==-1&&(D||oe===0)}),G=U,V=P.length;ie={...ie,trigger:G,matchStart:Se,matchLength:V,options:N}}}}return ie},y=(C,v)=>C.map(E=>({triggerStr:E,triggerMatch:E.match(v),triggerLength:E.length})),T=(C,v,L)=>!C||!C.length||v.substr(L,C.length)===C,m=C=>{const{onChange:v,options:L,spaceRemovers:E,spacer:D,value:k}=e,A=n,I=C.target.value,x=xt(M(C.target)).end;if(I.length||$({...i,helperVisible:!1}),t(I),$({...i,caret:x,value:C.target.value}),!I.length||!x)return v(C.target.value);if(r&&E.length&&I.length>2&&D.length){for(let B=0;B<Math.max(A.length,I.length);++B)if(A[B]!==I[B]){if(B>=2&&I[B-1]===D&&E.indexOf(I[B-2])===-1&&E.indexOf(I[B])!==-1&&!j.isEmpty(f(I.substring(0,B-2),x-3,L))){const ie=`${I.slice(0,B-1)}${I.slice(B,B+1)}${I.slice(B-1,B)}${I.slice(B+1)}`;return Q(B+1),g.current!==null&&(g.current.value=ie),k||$({...i,value:ie}),v(ie)}break}s(!1)}return J(I,x,L),v(C.target.value)},M=C=>{if(C!==void 0)if(C.children.length>0){const v=C.getElementsByTagName("textarea");if(v.length>0)return v[0];const L=C.getElementsByTagName("input");if(L.length>0)return L[0]}else return C},O=C=>{const{helperVisible:v,options:L,selection:E}=i,{onKeyDown:D,passThroughEnter:k}=e;if(v)switch(C.keyCode){case wo:C.preventDefault(),X();break;case mo:C.preventDefault(),$({...i,selection:(L.length+E-1)%L.length});break;case yo:C.preventDefault(),$({...i,selection:(E+1)%L.length});break;case Eo:case vo:k||C.preventDefault(),z(E);break;case So:z(E);break;default:D(C);break}else D(C)},_=()=>{$({...i,helperVisible:!1})},z=C=>{const{spacer:v,onSelect:L,changeOnSelect:E}=e,{matchStart:D,matchLength:k,options:A,trigger:I}=i,x=A[C],B=n,ie=B.substring(0,D-I.length),le=B.substring(D+k),U={target:g.current},re=E(I,x);U.target!==null&&(U.target.value=`${ie}${re}${v}${le}`),m(U),U.target!==null&&L(U.target.value),X(),Q(ie.length+re.length+1),s(!0)},Q=C=>{$({...i,caret:C});const v=M(g.current);xt.setCaretPosition(v,C)},$=C=>{setTimeout(()=>{h({...C})},0)},J=(C,v,L)=>{const E=g.current;if(g.current===null)return;const D=M(E);if(D===void 0)return;const k=E.getBoundingClientRect(),A=f(C,v,L);if(Object.keys(A).length>0&&D!==null){const I=nr(D,v),x=D.getBoundingClientRect(),{minChars:B,onRequestOptions:ie,requestOnlyIfNoOptions:le,mode:U}=e;let re,pe,fe,Ae="unset";U==="assist"?(re=E===D?I.top+D.offsetTop:I.top+k.top,pe=Math.min(I.left+D.offsetLeft-To,D.offsetLeft+x.width-Co)):(re=k.top+E.offsetHeight,pe=E.offsetLeft,fe=E.offsetLeft-E.offsetWidth,Ae=`${k.width}px`),A.matchLength>=B&&(A.options.length>1||A.options.length===1&&A.options[0].length!==A.matchLength)?$({...i,value:C,helperVisible:!0,top:re,left:pe,right:fe,width:Ae,...A}):((!le||!A.options.length)&&ie(C.substr(A.matchStart,A.matchLength)),X())}else X()},X=()=>{setTimeout(()=>{$({...i,helperVisible:!1,selection:0})},100)},F=()=>{const{helperVisible:C,left:v,right:L,matchStart:E,matchLength:D,options:k,selection:A,top:I,value:x,width:B}=i;if(!C)return null;const{maxOptions:ie,offsetX:le,offsetY:U,direction:re}=e;if(k.length===0)return null;if(A>=k.length)return $({...i,selection:0}),null;const pe=ie===0?k.length:ie,fe=k.slice(0,pe).map((Pe,Se)=>{const b=Pe.toLowerCase().indexOf(x.substr(E,D).toLowerCase());return o.jsxs("li",{className:Se===A?"active":void 0,onClick:()=>{z(Se)},onMouseEnter:()=>{$({...i,selection:Se})},children:[Pe.slice(0,b),o.jsx("strong",{children:Pe.substr(b,D)}),Pe.slice(b+D)]},Pe)}),Ae=re==="ltr"?{left:v+le}:{right:L+le};return o.jsx("ul",{className:"react-autocomplete-input",style:{...Ae,top:I+U,width:B},children:fe})},{Component:ee,ComponentProps:W,defaultValue:Z,disabled:ae,onBlur:a,value:c,...w}=e,p=Object.assign({},w);return Object.keys(e).forEach(C=>{delete p[C]}),o.jsxs(o.Fragment,{children:[l.cloneElement(ee,{disabled:ae,onBlur:a,onChange:m,onKeyDown:O,ref:g,value:n,...p,...W}),F()]})},Mo={Component:o.jsx("textarea",{}),ComponentProps:{},defaultValue:void 0,disabled:!1,maxOptions:6,onBlur:e=>{},onChange:e=>{},onKeyDown:e=>{},onRequestOptions:e=>{},onSelect:e=>{},changeOnSelect:(e,n)=>`${e}${n}`,options:[],regex:"^[A-Za-z0-9\\-_]+$",matchAny:!1,minChars:0,requestOnlyIfNoOptions:!0,spaceRemovers:[",",".","!","?"],spacer:" ",trigger:"@",offsetX:0,offsetY:0,value:void 0,passThroughEnter:!1,mode:"assist",direction:"ltr"},bo=e=>{let n={...Mo,...e};return e.mode==="autocomplete"&&(n={...n,trigger:"",regex:".",spacer:""}),o.jsx(Lo,{...n})},st={formatFileModDate:(e,n)=>{const t=R.FileHelper.getModDate(n);return t?e.formatDate(t,{dateStyle:"short",timeStyle:"short"}):null},formatFileSize:(e,n)=>{if(!n||typeof n.size!="number")return null;const t=n.size,r=ir(t,{bits:!1,output:"object"});return r.symbol==="B"?`${Math.round(r.value/10)/100} KB`:r.symbol==="KB"?`${Math.round(r.value)} ${r.symbol}`:`${r.value} ${r.symbol.toUpperCase()}`}},Po={locale:be.EN,formatters:{...st}},_o={locale:be.RU,formatters:{...st},messages:{"chonky.toolbar.searchPlaceholder":"Поиск","chonky.toolbar.visibleFileCount":`{fileCount, plural,
31
+ `;d.forEach(p=>{f+=h(p)});const E=new Blob([f],{type:"text/csv;charset=utf-8;"}),C=document.createElement("a"),b=URL.createObjectURL(E);C.setAttribute("href",b),C.setAttribute("download",o),C.style.visibility="hidden",document.body.appendChild(C),C.click(),document.body.removeChild(C)};return i.jsx(i.Fragment,{children:i.jsx("input",{type:"file",id:"csvFile",accept:".csv",onChange:o=>{r(o)}})})},As="",xo=38,No=40,Bo=13,Fo=14,Vo=27,Go=9,Ho=10,Wo=100,zo=e=>{const[t,n]=a.useState(e.defaultValue??""),[r,s]=a.useState(!1),[o,d]=a.useState({helperVisible:!1,left:0,right:0,trigger:"",matchLength:0,matchStart:0,options:[],selection:0,top:0,value:"",caret:0,width:"unset"}),h=a.useRef(null);a.useEffect(()=>(window.addEventListener("resize",I),()=>{try{window.removeEventListener("resize",I)}catch(S){console.log('WINDOW "resize" remove listener failed',S)}}),[]),a.useEffect(()=>{typeof e.value<"u"&&n(e.value),typeof e.defaultValue<"u"&&n(e.defaultValue)},[e.value,e.defaultValue]),a.useEffect(()=>{const{options:S}=e,{caret:w}=o;j(t,w,S)},[e]);const f=(S,w,P)=>{const{trigger:m,matchAny:T,regex:k}=e,N=new RegExp(k);let A=m;Array.isArray(A)||(A=new Array(m)),A.sort();const D={};Array.isArray(P)&&A.forEach(ne=>{D[ne]=P});const B=E(A,N);let ee={};for(let ne=0;ne<B.length;ne++){const{triggerStr:q,triggerMatch:R,triggerLength:ie}=B[ne];for(let he=w-1;he>=0;--he){const oe=S.substring(he,w).match(N);let fe=-1;if(ie>0){const O=R?he:he-ie+1;if(O<0||(C(q,S,O)&&(fe=O+ie),!oe&&fe<0))break}else{if(oe&&he>0)continue;if(fe=he===0&&oe?0:he+1,w-fe===0)break}if(fe>=0){const O=D[q];if(!Array.isArray(O))continue;const x=S.substring(fe,w),H=O.filter(K=>{const ce=K.toLowerCase().indexOf(x.toLowerCase());return ce!==-1&&(T||ce===0)}),z=q,U=x.length;ee={...ee,trigger:z,matchStart:fe,matchLength:U,options:H}}}}return ee},E=(S,w)=>S.map(m=>({triggerStr:m,triggerMatch:m.match(w),triggerLength:m.length})),C=(S,w,P)=>!S||!S.length||w.substr(P,S.length)===S,b=S=>{const{onChange:w,options:P,spaceRemovers:m,spacer:T,value:k}=e,N=t,A=S.target.value,D=Bt(p(S.target)).end;if(A.length||G({...o,helperVisible:!1}),n(A),G({...o,caret:D,value:S.target.value}),!A.length||!D)return w(S.target.value);if(r&&m.length&&A.length>2&&T.length){for(let B=0;B<Math.max(N.length,A.length);++B)if(N[B]!==A[B]){if(B>=2&&A[B-1]===T&&m.indexOf(A[B-2])===-1&&m.indexOf(A[B])!==-1&&!$.isEmpty(f(A.substring(0,B-2),D-3,P))){const ee=`${A.slice(0,B-1)}${A.slice(B,B+1)}${A.slice(B-1,B)}${A.slice(B+1)}`;return F(B+1),h.current!==null&&(h.current.value=ee),k||G({...o,value:ee}),w(ee)}break}s(!1)}return j(A,D,P),w(S.target.value)},p=S=>{if(S!==void 0)if(S.children.length>0){const w=S.getElementsByTagName("textarea");if(w.length>0)return w[0];const P=S.getElementsByTagName("input");if(P.length>0)return P[0]}else return S},v=S=>{const{helperVisible:w,options:P,selection:m}=o,{onKeyDown:T,passThroughEnter:k}=e;if(w)switch(S.keyCode){case Vo:S.preventDefault(),Y();break;case xo:S.preventDefault(),G({...o,selection:(P.length+m-1)%P.length});break;case No:S.preventDefault(),G({...o,selection:(m+1)%P.length});break;case Fo:case Bo:k||S.preventDefault(),L(m);break;case Go:L(m);break;default:T(S);break}else T(S)},I=()=>{G({...o,helperVisible:!1})},L=S=>{const{spacer:w,onSelect:P,changeOnSelect:m}=e,{matchStart:T,matchLength:k,options:N,trigger:A}=o,D=N[S],B=t,ee=B.substring(0,T-A.length),ne=B.substring(T+k),q={target:h.current},R=m(A,D);q.target!==null&&(q.target.value=`${ee}${R}${w}${ne}`),b(q),q.target!==null&&P(q.target.value),Y(),F(ee.length+R.length+1),s(!0)},F=S=>{G({...o,caret:S});const w=p(h.current);Bt.setCaretPosition(w,S)},G=S=>{setTimeout(()=>{d({...S})},0)},j=(S,w,P)=>{const m=h.current;if(h.current===null)return;const T=p(m);if(T===void 0)return;const k=m.getBoundingClientRect(),N=f(S,w,P);if(Object.keys(N).length>0&&T!==null){const A=fr(T,w),D=T.getBoundingClientRect(),{minChars:B,onRequestOptions:ee,requestOnlyIfNoOptions:ne,mode:q}=e;let R,ie,he,ve="unset";q==="assist"?(R=m===T?A.top+T.offsetTop:A.top+k.top,ie=Math.min(A.left+T.offsetLeft-Ho,T.offsetLeft+D.width-Wo)):(R=k.top+m.offsetHeight,ie=m.offsetLeft,he=m.offsetLeft-m.offsetWidth,ve=`${k.width}px`),N.matchLength>=B&&(N.options.length>1||N.options.length===1&&N.options[0].length!==N.matchLength)?G({...o,value:S,helperVisible:!0,top:R,left:ie,right:he,width:ve,...N}):((!ne||!N.options.length)&&ee(S.substr(N.matchStart,N.matchLength)),Y())}else Y()},Y=()=>{setTimeout(()=>{G({...o,helperVisible:!1,selection:0})},100)},V=()=>{const{helperVisible:S,left:w,right:P,matchStart:m,matchLength:T,options:k,selection:N,top:A,value:D,width:B}=o;if(!S)return null;const{maxOptions:ee,offsetX:ne,offsetY:q,direction:R}=e;if(k.length===0)return null;if(N>=k.length)return G({...o,selection:0}),null;const ie=ee===0?k.length:ee,he=k.slice(0,ie).map((oe,fe)=>{const O=oe.toLowerCase().indexOf(D.substr(m,T).toLowerCase());return i.jsxs("li",{className:fe===N?"active":void 0,onClick:()=>{L(fe)},onMouseEnter:()=>{G({...o,selection:fe})},children:[oe.slice(0,O),i.jsx("strong",{children:oe.substr(O,T)}),oe.slice(O+T)]},oe)}),ve=R==="ltr"?{left:w+ne}:{right:P+ne};return i.jsx("ul",{className:"react-autocomplete-input",style:{...ve,top:A+q,width:B},children:he})},{Component:X,ComponentProps:W,defaultValue:Z,disabled:te,onBlur:l,value:c,..._}=e,y=Object.assign({},_);return Object.keys(e).forEach(S=>{delete y[S]}),i.jsxs(i.Fragment,{children:[a.cloneElement(X,{disabled:te,onBlur:l,onChange:b,onKeyDown:v,ref:h,value:t,...y,...W}),V()]})},Uo={Component:i.jsx("textarea",{}),ComponentProps:{},defaultValue:void 0,disabled:!1,maxOptions:6,onBlur:e=>{},onChange:e=>{},onKeyDown:e=>{},onRequestOptions:e=>{},onSelect:e=>{},changeOnSelect:(e,t)=>`${e}${t}`,options:[],regex:"^[A-Za-z0-9\\-_]+$",matchAny:!1,minChars:0,requestOnlyIfNoOptions:!0,spaceRemovers:[",",".","!","?"],spacer:" ",trigger:"@",offsetX:0,offsetY:0,value:void 0,passThroughEnter:!1,mode:"assist",direction:"ltr"},$o=e=>{let t={...Uo,...e};return e.mode==="autocomplete"&&(t={...t,trigger:"",regex:".",spacer:""}),i.jsx(zo,{...t})},st={formatFileModDate:(e,t)=>{const n=re.FileHelper.getModDate(t);return n?e.formatDate(n,{dateStyle:"short",timeStyle:"short"}):null},formatFileSize:(e,t)=>{if(!t||typeof t.size!="number")return null;const n=t.size,r=yr(n,{bits:!1,output:"object"});return r.symbol==="B"?`${Math.round(r.value/10)/100} KB`:r.symbol==="KB"?`${Math.round(r.value)} ${r.symbol}`:`${r.value} ${r.symbol.toUpperCase()}`}},qo={locale:Se.EN,formatters:{...st}},jo={locale:Se.RU,formatters:{...st},messages:{"chonky.toolbar.searchPlaceholder":"Поиск","chonky.toolbar.visibleFileCount":`{fileCount, plural,
27
32
  one {# файл}
28
33
  few {# файла}
29
34
  other {# файлов}
@@ -35,7 +40,7 @@
35
40
  =0 {}
36
41
  one {# скрыт}
37
42
  other {# скрыто}
38
- }`,"chonky.fileList.nothingToShow":"Здесь пусто!","chonky.contextMenu.browserMenuShortcut":"Меню браузера: {shortcut}",["chonky.actionGroups.Actions"]:"Действия",["chonky.actionGroups.Options"]:"Опции",[`chonky.actions.${R.ChonkyActions.OpenParentFolder.id}.button.name`]:"Открыть родительскую папку",[`chonky.actions.${R.ChonkyActions.CreateFolder.id}.button.name`]:"Новая папка",[`chonky.actions.${R.ChonkyActions.CreateFolder.id}.button.tooltip`]:"Создать новую папку",[`chonky.actions.${R.ChonkyActions.DeleteFiles.id}.button.name`]:"Удалить файлы",[`chonky.actions.${R.ChonkyActions.OpenSelection.id}.button.name`]:"Открыть выделение",[`chonky.actions.${R.ChonkyActions.SelectAllFiles.id}.button.name`]:"Выделить все",[`chonky.actions.${R.ChonkyActions.ClearSelection.id}.button.name`]:"Сбросить выделение",[`chonky.actions.${R.ChonkyActions.EnableListView.id}.button.name`]:"Показать список",[`chonky.actions.${R.ChonkyActions.EnableGridView.id}.button.name`]:"Показать иконки",[`chonky.actions.${R.ChonkyActions.SortFilesByName.id}.button.name`]:"Сорт. по имени",[`chonky.actions.${R.ChonkyActions.SortFilesBySize.id}.button.name`]:"Сорт. по размеру",[`chonky.actions.${R.ChonkyActions.SortFilesByDate.id}.button.name`]:"Сорт. по дате",[`chonky.actions.${R.ChonkyActions.ToggleHiddenFiles.id}.button.name`]:"Скрытые файлы",[`chonky.actions.${R.ChonkyActions.ToggleShowFoldersFirst.id}.button.name`]:"Папки в начале"}},Do={locale:be.HE,formatters:{...st},messages:{"chonky.toolbar.searchPlaceholder":"חיפוש","chonky.toolbar.visibleFileCount":`{fileCount, plural,
43
+ }`,"chonky.fileList.nothingToShow":"Здесь пусто!","chonky.contextMenu.browserMenuShortcut":"Меню браузера: {shortcut}",["chonky.actionGroups.Actions"]:"Действия",["chonky.actionGroups.Options"]:"Опции",[`chonky.actions.${re.ChonkyActions.OpenParentFolder.id}.button.name`]:"Открыть родительскую папку",[`chonky.actions.${re.ChonkyActions.CreateFolder.id}.button.name`]:"Новая папка",[`chonky.actions.${re.ChonkyActions.CreateFolder.id}.button.tooltip`]:"Создать новую папку",[`chonky.actions.${re.ChonkyActions.DeleteFiles.id}.button.name`]:"Удалить файлы",[`chonky.actions.${re.ChonkyActions.OpenSelection.id}.button.name`]:"Открыть выделение",[`chonky.actions.${re.ChonkyActions.SelectAllFiles.id}.button.name`]:"Выделить все",[`chonky.actions.${re.ChonkyActions.ClearSelection.id}.button.name`]:"Сбросить выделение",[`chonky.actions.${re.ChonkyActions.EnableListView.id}.button.name`]:"Показать список",[`chonky.actions.${re.ChonkyActions.EnableGridView.id}.button.name`]:"Показать иконки",[`chonky.actions.${re.ChonkyActions.SortFilesByName.id}.button.name`]:"Сорт. по имени",[`chonky.actions.${re.ChonkyActions.SortFilesBySize.id}.button.name`]:"Сорт. по размеру",[`chonky.actions.${re.ChonkyActions.SortFilesByDate.id}.button.name`]:"Сорт. по дате",[`chonky.actions.${re.ChonkyActions.ToggleHiddenFiles.id}.button.name`]:"Скрытые файлы",[`chonky.actions.${re.ChonkyActions.ToggleShowFoldersFirst.id}.button.name`]:"Папки в начале"}},Yo={locale:Se.HE,formatters:{...st},messages:{"chonky.toolbar.searchPlaceholder":"חיפוש","chonky.toolbar.visibleFileCount":`{fileCount, plural,
39
44
  one {פריט #}
40
45
  other {# פריטים}
41
46
  }`,"chonky.toolbar.selectedFileCount":`{fileCount, plural,
@@ -46,4 +51,4 @@
46
51
  =0 {}
47
52
  one {# נסתר}
48
53
  other {# נסתרים}
49
- }`,"chonky.fileList.nothingToShow":"ריק","chonky.contextMenu.browserMenuShortcut":"תפריט דפדפן: {shortcut}",["chonky.actionGroups.Actions"]:"פעולות",["chonky.actionGroups.Options"]:"אפשרויות",[`chonky.actions.${R.ChonkyActions.OpenParentFolder.id}.button.name`]:"פתח סיפריית אב",[`chonky.actions.${R.ChonkyActions.CreateFolder.id}.button.name`]:"סיפרייה חדשה",[`chonky.actions.${R.ChonkyActions.CreateFolder.id}.button.tooltip`]:"צור סיפרייה חדשה",[`chonky.actions.${R.ChonkyActions.DeleteFiles.id}.button.name`]:"מחק",[`chonky.actions.${R.ChonkyActions.OpenSelection.id}.button.name`]:"פתח את הבחירה",[`chonky.actions.${R.ChonkyActions.SelectAllFiles.id}.button.name`]:"בחר הכל",[`chonky.actions.${R.ChonkyActions.ClearSelection.id}.button.name`]:"אפס את הבחירה",[`chonky.actions.${R.ChonkyActions.EnableListView.id}.button.name`]:"תצוגת רשימה",[`chonky.actions.${R.ChonkyActions.EnableGridView.id}.button.name`]:"תצוגת גריד",[`chonky.actions.${R.ChonkyActions.SortFilesByName.id}.button.name`]:"מיון לפי שם",[`chonky.actions.${R.ChonkyActions.SortFilesBySize.id}.button.name`]:"מיון לפי גודל",[`chonky.actions.${R.ChonkyActions.SortFilesByDate.id}.button.name`]:"מיון לפי תאריך",[`chonky.actions.${R.ChonkyActions.ToggleHiddenFiles.id}.button.name`]:"קבצים נסתרים",[`chonky.actions.${R.ChonkyActions.ToggleShowFoldersFirst.id}.button.name`]:"הצגת תיקיות בראש הרשימה"}},Io={[be.EN]:Po,[be.RU]:_o,[be.HE]:Do},ls="";class Oo extends R.FileHelper{}const Ao=R.ChonkyActions,Bn={listView:R.ChonkyActions.EnableListView.id,gridView:R.ChonkyActions.EnableGridView.id};R.setChonkyDefaults({iconComponent:rr.ChonkyIconFA});const ko=l.memo(l.forwardRef(({theme:e,styles:n={height:"100%",minWidth:"600px"},defaultView:t=Bn.listView,readOnlyMode:r=!1,locale:s,files:i,folderChain:h,onFileAction:g,...f},y)=>{const T=l.useCallback(Z=>null,[]);Oe.makeStyles({"@global":{".chonky-dropdownList":{backgroundColor:`${e==null?void 0:e.surface} !important`},'li[class*="chonky-activeButton"]':{color:`${e==null?void 0:e.primary} !important`}}})();const m=Z=>Z.replace(/([A-Z])/g,ae=>"-"+ae.toLowerCase()),M=l.useMemo(()=>e!==void 0?Object.keys(e).reduce((ae,a)=>{const c=e[a];return a=a.startsWith("--")?a:`--fp-theme-${m(a)}`,ae[a]=c,ae},{}):{},[e]),[O,_]=l.useState(!1),[z,Q]=l.useState(),[$,J]=l.useState(!1),[X,F]=l.useState(),[ee,W]=l.useState();return l.useEffect(()=>{e&&_(!0),Q(t),r?J(!0):F([R.ChonkyActions.CreateFolder,R.ChonkyActions.DeleteFiles]),s!==void 0&&W(Io[s])},[e,t,r,s]),o.jsx(ue,{style:{...n,...M},children:o.jsx(R.FullFileBrowser,{ref:y,files:i??[],folderChain:h,onFileAction:Z=>{typeof g=="function"&&g(Z)},thumbnailGenerator:T,defaultFileViewActionId:z,disableDragAndDrop:$,fileActions:X,darkMode:O,i18n:ee,...f})})})),xo=e=>o.jsx(Nt.components.Option,{...e,children:o.jsx(Y.Checkbox,{label:e.label,checked:e.isSelected})}),No=e=>{const{styles:n}=e;return o.jsx(Nt,{isMulti:!0,components:{Option:xo},styles:n,isClearable:!0,hideSelectedOptions:!1,closeMenuOnSelect:!1,...e})},Bo=e=>{const{values:n,options:t,onChange:r,placeholder:s,styles:i}=e,h=Y.useTheme(),g=Je(h),[f,y]=l.useState(n),T=m=>{y(m),r&&r(m)};return o.jsx(se.ThemeProvider,{theme:g,children:o.jsx(se.Input,{multiline:!0,fullWidth:!0,disableUnderline:!0,inputComponent:No,value:f,onChange:T,placeholder:s,id:"react-select-single",inputProps:{styles:i,options:t}})})};d.useMediaQuery=Fn,Object.defineProperty(d,"CesiumCesiumEntity",{enumerable:!0,get:()=>u.Entity}),Object.defineProperty(d,"CesiumCesiumPolygonGraphics",{enumerable:!0,get:()=>u.PolygonGraphics}),Object.defineProperty(d,"CesiumGeoJsonDataSource",{enumerable:!0,get:()=>u.GeoJsonDataSource}),Object.defineProperty(d,"CesiumMath",{enumerable:!0,get:()=>u.Math}),Object.defineProperty(d,"CesiumSceneTransforms",{enumerable:!0,get:()=>u.SceneTransforms}),Object.defineProperty(d,"cesiumSampleTerrainMostDetailed",{enumerable:!0,get:()=>u.sampleTerrainMostDetailed}),d.Autocomplete=bo,d.BboxCorner=Xe,d.Box=ue,d.COORDINATES_MERCATOR_FRACTION_DIGITS=et,d.COORDINATES_WGS_FRACTION_DIGITS=Re,d.Cesium3DTileset=Ri,d.CesiumBoundingSphere=Si,d.CesiumCartesian2=Ei,d.CesiumCartesian3=wi,d.CesiumCartographic=mn,d.CesiumCesiumBillboardGraphics=Oi,d.CesiumCesiumPolylineGraphics=_i,d.CesiumCesiumTerrainProvider=Pi,d.CesiumColor=Ai,d.CesiumConstantPositionProperty=vi,d.CesiumConstantProperty=yi,d.CesiumCustomDataSource=On,d.CesiumDrawingsDataSource=ho,d.CesiumEllipsoid=Ti,d.CesiumEllipsoidTerrainProvider=bi,d.CesiumEntity=Pn,d.CesiumEntityDescription=ao,d.CesiumEntityStaticDescription=_n,d.CesiumGeographicTilingScheme=Ci,d.CesiumGeojsonLayer=eo,d.CesiumHeightReference=Vi,d.CesiumHorizontalOrigin=Bi,d.CesiumImageryLayer=je,d.CesiumJulianDate=Di,d.CesiumLabelStyle=Fi,d.CesiumMap=Ji,d.CesiumOSMLayer=io,d.CesiumPolygonGraphics=Dn,d.CesiumPolygonHierarchy=ki,d.CesiumPolylineDashMaterialProperty=mi,d.CesiumPositionProperty=Ii,d.CesiumRectangle=Li,d.CesiumRectangleGraphics=In,d.CesiumResource=Mi,d.CesiumScene=xi,d.CesiumSceneMode=we,d.CesiumVerticalOrigin=Ni,d.CesiumViewer=Zi,d.CesiumWFSLayer=so,d.CesiumWMSLayer=to,d.CesiumWMTSLayer=no,d.CesiumXYZLayer=ro,d.CoordinatesTrackerTool=yn,d.CssBaseline=Xr,d.DateRangePicker=hr,d.DateTimePicker=gr,d.DateTimeRangePicker=Gt,d.DateTimeRangePickerFormControl=lr,d.DrawHelper=ke,d.DrawInteraction=tn,d.DrawType=Te,d.FileHelper=Oo,d.FilePicker=ko,d.FilePickerActions=Ao,d.FilePickerViewObj=Bn,d.GeoJSONFeature=Rt,d.InspectorTool=go,d.Legend=Ur,d.MVTSource=$r,d.Map=Ut,d.MapFilterContainer=Pr,d.MultiSelection=Bo,d.Popover=Ht,d.Proj=_e,d.ScaleTrackerTool=vn,d.ScopedCssBaseline=Jr,d.SmartTable=Zr,d.SupportedLocales=be,d.TerrainianHeightTool=fo,d.TileLayer=jt,d.TileOsm=en,d.TileWMS=Fr,d.TileWMTS=Nr,d.TileXYZ=Gr,d.TimeRangeInput=cr,d.VectorLayer=Zt,d.VectorSource=Qt,d.VectorTileLayer=Dr,d.ZoomLevelTrackerTool=wn,d.defaultFormatters=st,d.getMVTOptions=zr,d.getWMSOptions=Br,d.getWMTSOptions=xr,d.getXYZOptions=Vr,d.isDateRange=Qe,d.mapMcToMuiTheme=Vt,d.polygonToGeoJSON=An,d.rectangleToGeoJSON=kn,d.rectangleToPositions=xn,d.useCesiumMap=ye,d.useCesiumMapViewstate=We,d.useMap=Fe,d.useMappedMuiTheme=Je,d.useTileLayer=qe,d.useVectorLayer=Yt,d.useVectorSource=Jt,d.useVectorTileLayer=an,d.useVectorTileSource=Wr,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
54
+ }`,"chonky.fileList.nothingToShow":"ריק","chonky.contextMenu.browserMenuShortcut":"תפריט דפדפן: {shortcut}",["chonky.actionGroups.Actions"]:"פעולות",["chonky.actionGroups.Options"]:"אפשרויות",[`chonky.actions.${re.ChonkyActions.OpenParentFolder.id}.button.name`]:"פתח סיפריית אב",[`chonky.actions.${re.ChonkyActions.CreateFolder.id}.button.name`]:"סיפרייה חדשה",[`chonky.actions.${re.ChonkyActions.CreateFolder.id}.button.tooltip`]:"צור סיפרייה חדשה",[`chonky.actions.${re.ChonkyActions.DeleteFiles.id}.button.name`]:"מחק",[`chonky.actions.${re.ChonkyActions.OpenSelection.id}.button.name`]:"פתח את הבחירה",[`chonky.actions.${re.ChonkyActions.SelectAllFiles.id}.button.name`]:"בחר הכל",[`chonky.actions.${re.ChonkyActions.ClearSelection.id}.button.name`]:"אפס את הבחירה",[`chonky.actions.${re.ChonkyActions.EnableListView.id}.button.name`]:"תצוגת רשימה",[`chonky.actions.${re.ChonkyActions.EnableGridView.id}.button.name`]:"תצוגת גריד",[`chonky.actions.${re.ChonkyActions.SortFilesByName.id}.button.name`]:"מיון לפי שם",[`chonky.actions.${re.ChonkyActions.SortFilesBySize.id}.button.name`]:"מיון לפי גודל",[`chonky.actions.${re.ChonkyActions.SortFilesByDate.id}.button.name`]:"מיון לפי תאריך",[`chonky.actions.${re.ChonkyActions.ToggleHiddenFiles.id}.button.name`]:"קבצים נסתרים",[`chonky.actions.${re.ChonkyActions.ToggleShowFoldersFirst.id}.button.name`]:"הצגת תיקיות בראש הרשימה"}},Zo={[Se.EN]:qo,[Se.RU]:jo,[Se.HE]:Yo},Os="";class Xo extends re.FileHelper{}const Jo=re.ChonkyActions,$n={listView:re.ChonkyActions.EnableListView.id,gridView:re.ChonkyActions.EnableGridView.id};re.setChonkyDefaults({iconComponent:mr.ChonkyIconFA});const Ko=a.memo(a.forwardRef(({theme:e,styles:t={height:"100%",minWidth:"600px"},defaultView:n=$n.listView,readOnlyMode:r=!1,locale:s,files:o,folderChain:d,onFileAction:h,...f},E)=>{const C=a.useCallback(Z=>null,[]);De.makeStyles({"@global":{".chonky-dropdownList":{backgroundColor:`${e==null?void 0:e.surface} !important`},'li[class*="chonky-activeButton"]':{color:`${e==null?void 0:e.primary} !important`}}})();const b=Z=>Z.replace(/([A-Z])/g,te=>"-"+te.toLowerCase()),p=a.useMemo(()=>e!==void 0?Object.keys(e).reduce((te,l)=>{const c=e[l];return l=l.startsWith("--")?l:`--fp-theme-${b(l)}`,te[l]=c,te},{}):{},[e]),[v,I]=a.useState(!1),[L,F]=a.useState(),[G,j]=a.useState(!1),[Y,V]=a.useState(),[X,W]=a.useState();return a.useEffect(()=>{e&&I(!0),F(n),r?j(!0):V([re.ChonkyActions.CreateFolder,re.ChonkyActions.DeleteFiles]),s!==void 0&&W(Zo[s])},[e,n,r,s]),i.jsx(Q,{style:{...t,...p},children:i.jsx(re.FullFileBrowser,{ref:E,files:o??[],folderChain:d,onFileAction:Z=>{typeof h=="function"&&h(Z)},thumbnailGenerator:C,defaultFileViewActionId:L,disableDragAndDrop:G,fileActions:Y,darkMode:v,i18n:X,...f})})})),Qo=e=>i.jsx(Ft.components.Option,{...e,children:i.jsx(J.Checkbox,{label:e.label,checked:e.isSelected})}),Ro=e=>{const{styles:t}=e;return i.jsx(Ft,{isMulti:!0,components:{Option:Qo},styles:t,isClearable:!0,hideSelectedOptions:!1,closeMenuOnSelect:!1,...e})},es=e=>{const{values:t,options:n,onChange:r,placeholder:s,styles:o}=e,d=J.useTheme(),h=Xe(d),[f,E]=a.useState(t),C=b=>{E(b),r&&r(b)};return i.jsx(ae.ThemeProvider,{theme:h,children:i.jsx(ae.Input,{multiline:!0,fullWidth:!0,disableUnderline:!0,inputComponent:Ro,value:f,onChange:C,placeholder:s,id:"react-select-single",inputProps:{styles:o,options:n}})})},ts=({value:e,text:t,children:n,strokeWidth:r=8,styles:s,background:o=!1,backgroundPadding:d=0,counterClockwise:h=!1,circleRatio:f=1})=>{const E={value:e,strokeWidth:r,background:o,backgroundPadding:d,counterClockwise:h,circleRatio:f,styles:Ye.buildStyles({...s})};return n?i.jsx(Ye.CircularProgressbarWithChildren,{...E,children:n}):i.jsx(Ye.CircularProgressbar,{...E,text:t})},ns=({values:e,valueStart:t=0,valueEnd:n,duration:r,interval:s=1e3,easingFunction:o,repeat:d,children:h})=>{const[f,E]=a.useState(0),[C,b]=a.useState(t),p=a.useRef(void 0),v=e===void 0&&n!==void 0;return a.useEffect(()=>{if(v)return d?p.current=window.setInterval(()=>{b(I=>I===t?n:t)},r?r*1e3:1e3):b(n||t),()=>{window.clearInterval(p.current)};if(e)return p.current=window.setInterval(()=>{E(I=>(I+1)%e.length),b(e[f])},s),()=>clearInterval(p.current)},[e,n,r,s,d,f]),v?i.jsx(vr.Animate,{start:()=>({value:t}),update:()=>({value:[C],timing:{duration:r?r*1e3:1e3,ease:o}}),children:({value:I})=>i.jsx(i.Fragment,{children:h(I)})}):i.jsx(i.Fragment,{children:h(C)})};u.useMediaQuery=Xn,Object.defineProperty(u,"CesiumCesiumEntity",{enumerable:!0,get:()=>g.Entity}),Object.defineProperty(u,"CesiumCesiumPolygonGraphics",{enumerable:!0,get:()=>g.PolygonGraphics}),Object.defineProperty(u,"CesiumGeoJsonDataSource",{enumerable:!0,get:()=>g.GeoJsonDataSource}),Object.defineProperty(u,"CesiumMath",{enumerable:!0,get:()=>g.Math}),Object.defineProperty(u,"CesiumSceneTransforms",{enumerable:!0,get:()=>g.SceneTransforms}),Object.defineProperty(u,"cesiumSampleTerrainMostDetailed",{enumerable:!0,get:()=>g.sampleTerrainMostDetailed}),Object.defineProperty(u,"buildStyles",{enumerable:!0,get:()=>Ye.buildStyles}),u.AnimatedValuesProvider=ns,u.Autocomplete=$o,u.BboxCorner=Ze,u.Box=Q,u.COORDINATES_MERCATOR_FRACTION_DIGITS=Qe,u.COORDINATES_WGS_FRACTION_DIGITS=Ke,u.Cesium3DTileset=mo,u.CesiumBoundingSphere=_i,u.CesiumCartesian2=Ci,u.CesiumCartesian3=Mi,u.CesiumCartographic=gn,u.CesiumCesiumBillboardGraphics=Bi,u.CesiumCesiumPolylineGraphics=ki,u.CesiumCesiumTerrainProvider=Di,u.CesiumColor=Fi,u.CesiumCompassTool=Cn,u.CesiumConstantPositionProperty=bi,u.CesiumConstantProperty=Si,u.CesiumCustomDataSource=zn,u.CesiumDrawingsDataSource=Ao,u.CesiumEllipsoid=Pi,u.CesiumEllipsoidTerrainProvider=Oi,u.CesiumEntity=Vn,u.CesiumEntityDescription=So,u.CesiumEntityStaticDescription=Gn,u.CesiumGeographicTilingScheme=Ii,u.CesiumGeojsonLayer=yo,u.CesiumHeightReference=Ui,u.CesiumHorizontalOrigin=Wi,u.CesiumImageryLayer=He,u.CesiumJulianDate=xi,u.CesiumLabelStyle=zi,u.CesiumMap=po,u.CesiumOSMLayer=Lo,u.CesiumPolygonGraphics=Hn,u.CesiumPolygonHierarchy=Vi,u.CesiumPolylineDashMaterialProperty=Ti,u.CesiumPositionProperty=Ni,u.CesiumRectangle=pn,u.CesiumRectangleGraphics=Wn,u.CesiumResource=Ai,u.CesiumScene=Gi,u.CesiumSceneMode=tt,u.CesiumVerticalOrigin=Hi,u.CesiumViewer=ho,u.CesiumWFSLayer=To,u.CesiumWMSLayer=vo,u.CesiumWMTSLayer=Eo,u.CesiumXYZLayer=wo,u.CircularProgressBar=ts,u.CoordinatesTrackerTool=Mn,u.CssBaseline=di,u.DateRangePicker=Mr,u.DateTimePicker=_r,u.DateTimeRangePicker=zt,u.DateTimeRangePickerFormControl=Tr,u.DrawInteraction=on,u.DrawType=we,u.FileHelper=Xo,u.FilePicker=Ko,u.FilePickerActions=Jo,u.FilePickerViewObj=$n,u.GeoJSONFeature=nn,u.InspectorTool=Oo,u.Legend=ii,u.MVTSource=ri,u.Map=Yt,u.MapFilterContainer=Wr,u.MultiSelection=es,u.Popover=Ut,u.Proj=be,u.ScaleTrackerTool=_n,u.ScopedCssBaseline=ui,u.SmartTable=ci,u.SupportedLocales=Se,u.TerrainianHeightTool=ko,u.TileLayer=Xt,u.TileOsm=rn,u.TileWMS=Kr,u.TileWMTS=Xr,u.TileXYZ=Rr,u.TimeRangeInput=Sr,u.VectorLayer=Qt,u.VectorSource=tn,u.VectorTileLayer=Ur,u.ZoomButtons=Pn,u.ZoomLevelTrackerTool=An,u.defaultFormatters=st,u.getMVTOptions=ni,u.getWMSOptions=Jr,u.getWMTSOptions=Zr,u.getXYZOptions=Qr,u.isDateRange=Je,u.mapMcToMuiTheme=Ht,u.useCesiumMap=pe,u.useCesiumMapViewstate=Fe,u.useMap=ke,u.useMappedCesiumTheme=Wt,u.useMappedMuiTheme=Xe,u.useTileLayer=Ge,u.useVectorLayer=Kt,u.useVectorSource=en,u.useVectorTileLayer=dn,u.useVectorTileSource=ti,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});