@map-colonies/react-components 4.0.2 → 4.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- (function(f,r){typeof exports=="object"&&typeof module<"u"?r(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("@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("@material-ui/core/TableHead"),require("@material-ui/icons"),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/helpers"),require("@turf/bbox"),require("@turf/bbox-polygon"),require("textarea-caret"),require("get-input-selection"),require("chonky"),require("chonky-icon-fontawesome"),require("filesize")):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","@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","@material-ui/core/TableHead","@material-ui/icons","@material-ui/core/CssBaseline","@material-ui/core/ScopedCssBaseline","react-dom","resium","cesium","lodash","@turf/boolean-point-in-polygon","@turf/helpers","@turf/bbox","@turf/bbox-polygon","textarea-caret","get-input-selection","chonky","chonky-icon-fontawesome","filesize"],r):(f=typeof globalThis<"u"?globalThis:f||self,r(f.reactComponents={},f.jsxRuntime,f.React,f.dateFns,f.locale,f.pickers,f.DateFnsUtils,f.styles,f.core,f.reactCore,f.useMediaQuery,f.rewind,f.ol,null,f.coordinate,f.control,f.MousePosition,f.proj,f.layer,f.source,f.format,f.interaction,f.Draw,f.TableHead,f.icons,f.CssBaseline,f.ScopedCssBaseline,f.ReactDOM,f.resium,f.Cesium,f.lodash,f.booleanPointInPolygon,f.turf,f.bbox,f.bboxPolygon,f.getCaretCoordinates,f.getInputSelection,f.chonky,f.chonkyIconFontawesome,f.filesize))})(this,function(f,r,d,fe,we,ve,Ge,pe,K,W,Tt,bt,He,Ki,Ve,ke,Ie,_t,ze,We,$e,Mt,Pt,Lt,Ue,At,kt,It,he,S,H,Ot,Dt,qe,Ke,xt,je,x,Bt,Nt){"use strict";var Ui=Object.defineProperty;var qi=(f,r,d)=>r in f?Ui(f,r,{enumerable:!0,configurable:!0,writable:!0,value:d}):f[r]=d;var te=(f,r,d)=>(qi(f,typeof r!="symbol"?r+"":r,d),d);function Ye(e){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(i,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return i.default=e,Object.freeze(i)}const p=Ye(S),Xe=Ye(Dt);var re=(e=>(e.BOX="BOX",e.POLYGON="POLYGON",e.UNKNOWN="UNKNOWN",e))(re||{}),le=(e=>(e.HE="he",e.EN="en",e.RU="ru",e))(le||{}),Se=(e=>(e.TOP_RIGHT="TOP_RIGHT",e.BOTTOM_LEFT="BOTTOM_LEFT",e))(Se||{});const Q={DATE_PICKER:{dateFormat:"dd/MM/yyyy",local:{setText:"set",placeHolderText:"Enter the Date",calendarLocale:le.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:le.EN},renderAsButton:!0,offset:0,disableFuture:!0}},se=e=>{const{children:i,...t}=e;return r.jsx(K.Box,{...t,children:i})},Oe=e=>{const i=e.type==="dark";return d.useMemo(()=>Ze(e,i),[i,e])},Ze=(e,i=!1)=>pe.createTheme({palette:{type:i?"dark":"light",primary:{main:e.primary},secondary:{main:e.secondary},error:{main:e.error},background:{default:e.surface,paper:e.background},text:{primary:i?e.textPrimaryOnDark:e.textPrimaryOnLight,secondary:i?e.textSecondaryOnDark:e.textSecondaryOnLight}}}),ji="",Ft=2,Gt=.5,Ht=pe.makeStyles(e=>pe.createStyles({container:{padding:e.spacing(Ft),alignItems:"center"},setButton:{marginTop:e.spacing(1)},margin:{marginLeft:e.spacing(Gt)}})),Je=e=>{var j,$,X,B;const i=Ht(),t=W.useTheme(),n=Oe(t),[l,s]=d.useState(null),[u,h]=d.useState(null),[C,T]=d.useState(Q.DATE_RANGE_PICKER.dateFormat),L=e.controlsLayout??Q.DATE_RANGE_PICKER.controlsLayout,O=e.disableFuture??Q.DATE_RANGE_PICKER.disableFuture,A=((j=e.local)==null?void 0:j.startPlaceHolderText)??Q.DATE_RANGE_PICKER.local.startPlaceHolderText,N=(($=e.local)==null?void 0:$.endPlaceHolderText)??Q.DATE_RANGE_PICKER.local.endPlaceHolderText,U=((X=e.local)==null?void 0:X.setText)??Q.DATE_RANGE_PICKER.local.setText,R=(((B=e.local)==null?void 0:B.calendarLocale)??Q.DATE_RANGE_PICKER.local.calendarLocale)===le.HE?we.he:we.enUS;d.useEffect(()=>{s(e.from??null)},[e.from]),d.useEffect(()=>{h(e.to??null)},[e.to]),d.useEffect(()=>{T(e.dateFormat??Q.DATE_RANGE_PICKER.dateFormat)},[e.dateFormat]);const G=Boolean(fe.isValid(l)&&!u||fe.isValid(u)&&!l||l&&u&&fe.isValid(l)&&fe.isValid(u)&&fe.isBefore(l,u)),ee=()=>{e.onChange({from:l&&fe.isValid(l)?l:void 0,to:u&&fe.isValid(u)?u:void 0})};return r.jsx(K.ThemeProvider,{theme:n,children:r.jsx(se,{className:`${i.container} drpContainer`,display:"flex",flexDirection:L,width:L==="column"?e.contentWidth:"unset",children:r.jsxs(ve.MuiPickersUtilsProvider,{utils:Ge,locale:R,children:[r.jsx(ve.KeyboardDateTimePicker,{variant:"inline",placeholder:A,onChange:q=>s(q),value:l,disableFuture:O,format:C,maxDate:e.maxDate,minDate:e.minDate}),r.jsx(ve.KeyboardDateTimePicker,{variant:"inline",placeholder:N,className:i.margin,onChange:q=>h(q),value:u,disableFuture:O,format:C,maxDate:e.maxDate,minDate:e.minDate}),r.jsx(W.ThemeProvider,{options:t,children:r.jsx(W.Button,{className:`${i.setButton} ${i.margin}`,raised:!0,onClick:ee,disabled:!G,children:U})})]})})})},Qe=e=>{const{children:i,...t}=e;return r.jsx(K.Popover,{...t,children:i})},Yi="",Vt=e=>{var $,X;const[i,t]=d.useState(null),[n,l]=d.useState(null),[s,u]=d.useState(Q.DATE_RANGE_PICKER.dateFormat),[h,C]=d.useState(null),T=B=>{C(B.currentTarget)},L=B=>{B.currentTarget.tagName==="I"?C(B.currentTarget.previousElementSibling):C(B.currentTarget)},O=()=>{C(null)},A=Boolean(h),N=e.controlsLayout??"column";d.useEffect(()=>{t(e.from??null)},[e.from]),d.useEffect(()=>{l(e.to??null)},[e.to]),d.useEffect(()=>{u(e.dateFormat??Q.DATE_RANGE_PICKER.dateFormat)},[e.dateFormat]);const U=(($=e.local)==null?void 0:$.startPlaceHolderText)??Q.DATE_RANGE_PICKER.local.startPlaceHolderText,Z=((X=e.local)==null?void 0:X.endPlaceHolderText)??Q.DATE_RANGE_PICKER.local.endPlaceHolderText,R=e.renderAsButton===void 0?Q.DATE_RANGE_PICKER.renderAsButton:e.renderAsButton,G=e.offset===void 0?Q.DATE_RANGE_PICKER.offset:e.offset,ee=e.disableFuture===void 0?Q.DATE_RANGE_PICKER.disableFuture:e.disableFuture,j=d.useMemo(()=>`${i?fe.format(i,s):U} - ${n?fe.format(n,s):Z}`,[i,n,s,U,Z]);return r.jsxs(r.Fragment,{children:[R?r.jsx(W.Button,{style:{width:e.width},raised:!0,onClick:T,className:"drpOpener",children:j}):r.jsx(W.TextField,{className:"drpOpener",readOnly:!0,style:{width:e.width},value:j,onClick:L,trailingIcon:{icon:"date_range",tabIndex:0,onClick:L}}),r.jsx(Qe,{open:A,anchorEl:h,onClose:O,anchorOrigin:{vertical:"bottom",horizontal:"left"},keepMounted:!0,children:r.jsx(Je,{controlsLayout:N,contentWidth:((h==null?void 0:h.clientWidth)??0)-G,dateFormat:s,disableFuture:ee,minDate:e.minDate,maxDate:e.maxDate,local:e.local,from:i??void 0,to:n??void 0,onChange:({from:B,to:q})=>{t(B??null),l(q??null),e.onChange({from:B,to:q}),O()}})})]})},Xi="",zt=e=>{const i=W.useTheme(),t=Oe(i),[n,l]=d.useState(e.value),{format:s=Q.DATE_PICKER.dateFormat,variant:u=Q.DATE_PICKER.variant,disableFuture:h=Q.DATE_PICKER.disableFuture,local:C,onChange:T,showTime:L=Q.DATE_PICKER.showTime,value:O,...A}=e,{placeHolderText:N=Q.DATE_PICKER.local.placeHolderText,calendarLocale:U}=C??{placeHolderText:Q.DATE_PICKER.local.placeHolderText,calendarLocale:le.EN},Z=U===le.HE?we.he:we.enUS,R=G=>{l(G),T(G)};return r.jsx(K.ThemeProvider,{theme:t,children:r.jsxs(ve.MuiPickersUtilsProvider,{utils:Ge,locale:Z,children:[L&&r.jsx(ve.KeyboardDateTimePicker,{variant:u,placeholder:N,onChange:R,value:n,disableFuture:h,format:s,...A}),!L&&r.jsx(ve.KeyboardDatePicker,{variant:u,placeholder:N,onChange:R,value:n,disableFuture:h,format:s,...A})]})})},Wt=18,$t=pe.makeStyles(e=>pe.createStyles({drawingButton:{width:e.spacing(Wt)},fullWidth:{width:"100%",marginTop:"36px"}})),Ut=e=>{const i=$t(),[t,n]=d.useState(null),{isSelectionEnabled:l,onCancelDraw:s,onStartDraw:u,onReset:h}=e,C=L=>{n(L.currentTarget)},T=()=>{n(null)};return l?r.jsx(W.Tooltip,{content:"Cancel the ongoing draw",align:"bottomLeft",children:r.jsx(W.Button,{className:i.drawingButton,raised:!0,onClick:s,children:"Cancel Draw"})}):r.jsxs(se,{position:"relative",children:[r.jsx(W.Tooltip,{content:"draw an Area of interest to limit the search",align:"bottomLeft",children:r.jsx(W.Button,{className:i.drawingButton,raised:!0,onClick:C,children:"Draw AOI"})}),r.jsxs(W.Menu,{className:i.fullWidth,open:Boolean(t),onClose:T,children:[r.jsx(W.MenuItem,{onClick:()=>{u(re.POLYGON),T()},children:"Polygon"}),r.jsx(W.MenuItem,{onClick:()=>{u(re.BOX),T()},children:"Box"}),r.jsx(W.MenuItem,{onClick:()=>{h(),T()},children:"Clear"})]})]})},Zi="";var de=(e=>(e.WGS84="EPSG:4326",e.WEB_MERCATOR="EPSG:3857",e))(de||{});const Te=5,be=2,Re=d.createContext(null),qt=Re.Provider,et=35,tt=32,Kt=10,jt=e=>e!==void 0&&e!==de.WGS84?_t.transform([et,tt],de.WGS84,e):[et,tt],Yt=e=>{switch(e){case de.WEB_MERCATOR:return i=>Ve.format(i,"Mercator: {y}m, {x}m",be);case de.WGS84:return i=>Ve.format(i,"WGS84: {y}°N {x}°E",Te);default:return i=>""}},De=()=>{const e=d.useContext(Re);if(e===null)throw new Error("map context is null, please check the provider");return e},Xt=e=>{const i=d.useRef(null),{allowFullScreen:t,showMousePosition:n,projection:l}=e,[s]=d.useState(new He.Map({view:new He.View({projection:l??de.WGS84}),controls:ke.defaults()}));d.useEffect(()=>{s.getView().setCenter(e.center??jt(e.projection))},[s,e.center,e.projection]),d.useEffect(()=>{s.getView().setZoom(e.zoom??Kt)},[s,e.zoom,e.projection]);const u=(h,C)=>{C.getControls().forEach(L=>{L instanceof h&&C.removeControl(L)})};return d.useEffect(()=>{s.setTarget(i.current),t!==void 0&&t?s.addControl(new ke.FullScreen):u(ke.FullScreen,s)},[s,t]),d.useEffect(()=>{n!==void 0&&n?(u(Ie,s),s.addControl(new Ie({coordinateFormat:Yt(l??de.WGS84),projection:l??de.WGS84,undefinedHTML:"&nbsp;"}))):u(Ie,s)},[s,n,l]),r.jsxs(qt,{value:s,children:[r.jsx("div",{className:"map",ref:i}),e.children]})},nt=d.createContext(null),Zt=nt.Provider,Jt=()=>{const e=d.useContext(nt);if(e===null)throw new Error("tile layer context is null, please check the provider");return e},Qt=({options:e,children:i})=>{const t=De(),[n]=d.useState(new ze.Tile(e));return d.useEffect(()=>(t.addLayer(n),()=>{t.removeLayer(n)}),[t,n]),r.jsx(Zt,{value:n,children:i})},it=d.createContext(null),Rt=it.Provider,en=()=>{const e=d.useContext(it);if(e===null)throw new Error("vector layer context is null, please check the provider");return e},tn=({children:e})=>{const i=De(),[t]=d.useState(new ze.Vector);return d.useEffect(()=>(i.addLayer(t),()=>{i.removeLayer(t)}),[i,t]),r.jsx(Rt,{value:t,children:e})},rt=d.createContext(null),nn=rt.Provider,rn=()=>{const e=d.useContext(rt);if(e===null)throw new Error("vector source context is null, please check the provider");return e},on=({children:e})=>{const i=en(),[t]=d.useState(new We.Vector);return d.useEffect(()=>{i.setSource(t)},[t,i]),r.jsx(nn,{value:t,children:e})},sn=({geometry:e})=>{const i=rn();return d.useEffect(()=>{const n=new $e.GeoJSON().readFeature(e);return i.addFeature(n),()=>{i.removeFeature(n)}},[e,i]),null},an=e=>{const i=Jt();return d.useEffect(()=>{i.setSource(new We.OSM)},[i]),null},ln=({drawType:e,onPolygonSelected:i})=>{const t=De();return d.useEffect(()=>{const n={type:"Circle"};switch(e){case re.BOX:n.geometryFunction=Pt.createBox();break;case re.POLYGON:n.type="Polygon";break;default:return}const l=new Mt.Draw(n);t.addInteraction(l);const s=u=>{const C=new $e.GeoJSON().writeGeometryObject(u.feature.getGeometry());i==null||i(C)};return l.on("drawend",s),()=>{l.un("drawend",s),t.removeInteraction(l)}},[i,e,t]),null},Ji="",cn=e=>{const i=t=>{const n=bt(t);e.onPolygonSelection(n)};return r.jsxs(Xt,{allowFullScreen:!0,showMousePosition:!0,children:[r.jsx(Qt,{children:r.jsx(an,{})}),e.selectionPolygon&&r.jsx(tn,{children:r.jsx(on,{children:r.jsx(sn,{geometry:e.selectionPolygon})})}),e.children,e.drawType!==void 0&&r.jsx(ln,{drawType:e.drawType,onPolygonSelected:i})]})},xe=1.5,dn=80,un=pe.makeStyles(e=>pe.createStyles({map:{height:"100%",width:"100%",position:"absolute"},absolute:{position:"absolute",zIndex:1e3,left:e.spacing(xe),top:e.spacing(xe)},contentContainer:{marginTop:e.spacing(xe),width:e.spacing(dn)},filtersContainer:{display:"flex",padding:e.spacing(1)},filtersMargin:{marginLeft:e.spacing(1)}})),hn=e=>{var C;const[i,t]=d.useState(),[n,l]=d.useState(),s=un(),u=T=>{l(T),t(void 0),e.handlePolygonSelected(T)},h=()=>{l(void 0),e.handlePolygonReset()};return r.jsxs("div",{className:s.map,children:[r.jsxs("div",{className:`${s.absolute}`,children:[r.jsxs(K.Paper,{className:s.filtersContainer,children:[r.jsx(Ut,{onCancelDraw:()=>t(void 0),onReset:h,onStartDraw:t,isSelectionEnabled:i!==void 0}),(C=e.filters)==null?void 0:C.map((T,L)=>r.jsx("div",{className:s.filtersMargin,children:T},L))]}),r.jsx(K.Paper,{color:"red",className:`${s.contentContainer}`,children:e.children})]}),r.jsx(cn,{children:e.mapContent,onPolygonSelection:u,drawType:i,selectionPolygon:n})]})};function gn(e){const{headCells:i,order:t,orderBy:n,onRequestSort:l,isCollapseable:s}=e,u=h=>C=>{l(C,h)};return r.jsx(Lt,{children:r.jsxs(K.TableRow,{children:[s&&r.jsx(K.TableCell,{}),i.map(h=>r.jsx(K.TableCell,{align:h.numeric?"right":"left",padding:h.disablePadding?"none":"default",sortDirection:n===h.id?t:!1,children:r.jsx(K.TableSortLabel,{active:n===h.id,direction:n===h.id?t:"asc",onClick:u(h.id),children:h.label})},h.id))]})})}function pn(e){const{cellsMetadata:i,isRowSelected:t,item:n,onRowSelected:l,rowIndex:s,isCollapseable:u,collapsedElement:h}=e,[C,T]=d.useState(!1),L=i.length,O=()=>{l==null||l(s)};return r.jsxs(r.Fragment,{children:[r.jsxs(K.TableRow,{hover:!0,selected:t,onClick:O,children:[u&&r.jsx(K.TableCell,{padding:"checkbox",children:r.jsx(K.IconButton,{"aria-label":"expand row",size:"small",onClick:A=>{A.stopPropagation(),T(!C)},children:C?r.jsx(Ue.KeyboardArrowUp,{}):r.jsx(Ue.KeyboardArrowDown,{})})}),i.map(A=>r.jsx(K.TableCell,{align:A.numeric?"right":"left",padding:A.disablePadding?"none":"default",children:A.transform?A.transform(n[A.id]):n[A.id]},A.id+s.toString()))]}),u&&r.jsx(K.TableRow,{children:r.jsx(K.TableCell,{style:{paddingBottom:0,paddingTop:0},colSpan:L+1,children:r.jsx(K.Collapse,{in:C,unmountOnExit:!0,timeout:"auto",children:h==null?void 0:h(n)})})})]})}function fn(e){const[i,t]=d.useState(""),[n,l]=d.useState("asc"),{cellsMetadata:s,items:u,onRequestSort:h,onRowSelected:C,isCollapseable:T,collapsedElement:L,isDense:O,page:A,rowsPerPage:N,count:U,handleChangePage:Z,handleChangeRowsPerPage:R}=e,G=(ee,j)=>{const $=i===j&&n==="asc";l($?"desc":"asc"),t(j),h(j,$?"desc":"asc")};return r.jsxs(K.TableContainer,{component:K.Paper,children:[r.jsxs(K.Table,{size:O?"small":"medium",children:[r.jsx(gn,{headCells:s,onRequestSort:G,order:n,orderBy:i,isCollapseable:T}),r.jsxs(K.TableBody,{children:[u.map((ee,j)=>r.jsx(pn,{item:ee,rowIndex:j,isCollapseable:T,cellsMetadata:s,collapsedElement:L,isRowSelected:!1,onRowSelected:C},j)),(u.length===0||N>u.length)&&r.jsx(K.TableRow,{style:{height:(O?33:53)*(N-u.length)},children:r.jsx(K.TableCell,{colSpan:T?s.length+1:s.length,children:u.length===0&&r.jsx(K.Typography,{align:"center",children:"No results :("})})})]})]}),r.jsx(K.TablePagination,{rowsPerPage:N,rowsPerPageOptions:[5,10],component:"div",count:U,page:A,onPageChange:Z,onRowsPerPageChange:R})]})}const mn=e=>{const{children:i,...t}=e;return r.jsx(At,{...t,children:i})},yn=e=>{const{children:i,...t}=e;return r.jsx(kt,{...t,children:i})},ot=e=>e*Math.PI/180,_e=e=>e*(180/Math.PI),vn=e=>.05*(5916575505e-1/Math.pow(2,e-1)/2)*(Math.cos(ot(85.362/2))/Math.sin(ot(85.362/2))),Qi="",En=e=>{const i=ue(),t=d.useRef(null),[n,l]=d.useState({x:0,y:0});return d.useEffect(()=>{i.screenSpaceEventHandler.setInputAction(s=>{s!=null&&s.endPosition&&l({...s.endPosition})},S.ScreenSpaceEventType.MOUSE_MOVE)},[t,i]),d.useEffect(()=>{const s=i.scene.globe.ellipsoid,u=i.camera.pickEllipsoid(new S.Cartesian3(n.x,n.y),s);if(u){const h=s.cartesianToCartographic(u);if(t.current){let C="";switch(e.projection){case de.WEB_MERCATOR:{const L=new S.WebMercatorProjection(s).project(h);C=`Mercator: ${L.y.toFixed(be)}m, ${L.x.toFixed(be)}m`,t.current.style.width="220px";break}case de.WGS84:{const T=S.Math.toDegrees(h.longitude).toFixed(Te);C=`WGS84: ${S.Math.toDegrees(h.latitude).toFixed(Te)}°N ${T}°E`,t.current.style.width="200px";break}}t.current.innerHTML=C}}},[n,t,i,e.projection]),r.jsx("div",{className:"trackerPosition",ref:t})},Ri="",Be=[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],Cn=(e,i,t,n)=>{const l=H.get(n,"METERS_UNIT")??"m",s=H.get(n,"KILOMETERS_UNIT")??"km",u={barWidth:void 0,distanceLabel:void 0,lastLegendUpdate:i.lastLegendUpdate},h=new S.EllipsoidGeodesic,C=new Date().getTime();if(C<u.lastLegendUpdate+250)return;u.lastLegendUpdate=C;const T=e.scene.canvas.clientWidth,L=e.scene.canvas.clientHeight,O=e.scene.camera.getPickRay(new S.Cartesian2(T/2|0,L-1)),A=e.scene.camera.getPickRay(new S.Cartesian2(1+T/2|0,L-1)),N=e.scene.globe,U=N.pick(O,e.scene),Z=N.pick(A,e.scene);if(!U||!Z)return;const R=N.ellipsoid.cartesianToCartographic(U),G=N.ellipsoid.cartesianToCartographic(Z);h.setEndPoints(R,G);const ee=h.surfaceDistance,j=100;let $;for(let X=Be.length-1;!H.isNumber($)&&X>=0;--X)Be[X]/ee<j&&($=Be[X]);if(H.isNumber($)){let X="";$>=1e3?X=`${($/1e3).toString()} ${s}`:X=`${$.toString()} ${l}`,u.barWidth=$/ee|0,u.distanceLabel=X}t(u)},wn=e=>{const i=ue(),[t,n]=d.useState({barWidth:void 0,distanceLabel:void 0,lastLegendUpdate:-1});d.useEffect(()=>{const s=C=>{Cn(i,t,n,e.locale)},u=new S.EventHelper,h=C=>{i.scene.globe.tilesLoaded&&(s(new MouseEvent("mouse")),u.removeAll())};return u.add(i.scene.globe.tileLoadProgressEvent,h),i.camera.moveEnd.addEventListener(s),()=>{try{H.get(i,"_cesiumWidget")!=null&&i.camera.moveEnd.removeEventListener(s)}catch(C){console.log('CESIUM camera "moveEnd" remove listener failed',C)}}},[i,e.locale,t]);const l=s=>5+(125-s)/2;return r.jsx("div",{className:"scalePosition",children:H.isNumber(t.barWidth)&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"distance-legend-label",children:t.distanceLabel}),r.jsx("div",{className:"distance-legend-scale-bar",style:{height:"2px",width:`${t.barWidth.toString()}px`,left:`${l(t.barWidth).toString()}px`}})]})})},ie={MORPHING:S.SceneMode.MORPHING,COLUMBUS_VIEW:S.SceneMode.COLUMBUS_VIEW,SCENE2D:S.SceneMode.SCENE2D,SCENE3D:S.SceneMode.SCENE3D},er="",st=(e,i)=>{const n=H.get(i.scene.globe,"_surface.tileProvider"),l=n._quadtree,s=i.canvas.height,u=H.get(i.camera.frustum,"sseDenominator")??1;for(let h=0;h<=19;h++)if(n.getLevelMaximumGeometricError(h)*s/(e*u)<l.maximumScreenSpaceError)return h;return null},Sn=(e,i)=>{e=e||10;const t=[];let n=1e5,l=0;for(let s=1e8;s>n;s=s-n){const u=st(s,i);if(u===null)break;if(u!==l){let h=s,C=s+n;for(;C-h>e;)s=h+(C-h)/2,st(s,i)===u?h=s:C=s;t.push({level:u,height:Math.round(s)}),l=u,t.length>=2&&(n=(t[t.length-2].height-s)/1e3)}}return t},Tn=e=>{const i=ue(),[t,n]=d.useState(1),l=Sn(1,i);return d.useEffect(()=>{const s=()=>{const u=i.camera,h=.5;let C=0;switch(i.scene.mode){case ie.SCENE3D:C=i.scene.mapProjection.ellipsoid.cartesianToCartographic(u.positionWC).height;break;case ie.SCENE2D:C=(u.frustum.right-u.frustum.left)*h;break;case ie.COLUMBUS_VIEW:C=u.position.z;break;default:C=0;break}if(l.length>0){const T=l.reduce((L,O)=>Math.abs(O.height-C)<Math.abs(L.height-C)?O:L);n(T.level)}};return i.camera.moveEnd.addEventListener(s),()=>{try{H.get(i,"_cesiumWidget")!=null&&i.camera.moveEnd.removeEventListener(s)}catch(u){console.log('CESIUM camera "moveEnd"(from zoom tracker) remove listener failed',u)}}},[i,l.length]),r.jsxs("div",{className:"zoomLevel",children:[r.jsx("div",{className:"zoomLevelValue",children:t}),r.jsx("div",{className:"zoomLevelLabel",children:H.get(e.locale,"ZOOM_LABEL")??"zoom"})]})},tr="",bn=-1,_n=e=>{const i=ue(),[t,n]=d.useState(),{sceneModes:l}=e,s=u=>l.findIndex(h=>h===u)>bn;return d.useEffect(()=>{n(i.scene.mode)},[]),r.jsxs(r.Fragment,{children:[s(ie.SCENE3D)&&r.jsx(W.Icon,{icon:r.jsx("div",{className:`mapViewIcon ${t===ie.SCENE3D?"mapViewCurrent":""}`,children:r.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 64 64",children:r.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:()=>{i.scene.morphTo3D(),n(ie.SCENE3D)}}),s(ie.SCENE2D)&&r.jsx(W.Icon,{icon:r.jsx("div",{className:`mapViewIcon ${t===ie.SCENE2D?"mapViewCurrent":""}`,children:r.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 64 64",children:r.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:()=>{i.scene.morphTo2D(),n(ie.SCENE2D)}}),s(ie.COLUMBUS_VIEW)&&r.jsx(W.Icon,{icon:r.jsx("div",{className:`mapViewIcon ${t===ie.COLUMBUS_VIEW?"mapViewCurrent":""}`,children:r.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 64 64",children:r.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:()=>{i.scene.morphToColumbusView(),n(ie.COLUMBUS_VIEW)}})]})},nr="",Mn=pe.makeStyles(e=>pe.createStyles({mapContainer:{width:"60px",height:"60px",border:`${e.palette.background.paper} 2px solid`}})),Pn=e=>{const i=ue(),{baseMaps:t}=e,[n,l]=d.useState(" "),[s,u]=d.useState(),h=Mn();d.useEffect(()=>{const T=t==null?void 0:t.maps.find(L=>L.isCurrent);T&&(u(T),l(T.title!==void 0?T.title:" "))},[t]);const C=T=>{var L,O;if(t){(L=i.layersManager)==null||L.removeBaseMapLayers();const A=t.maps.find(N=>N.id===T);A&&((O=i.layersManager)==null||O.setBaseMapLayers(A),u(A),t.maps.forEach(N=>{N.isCurrent=A===N}))}};return r.jsxs(r.Fragment,{children:[r.jsx("label",{className:"mapLabel",children:n}),r.jsx("ul",{className:"mapSelector",children:t==null?void 0:t.maps.map(T=>r.jsx("li",{className:`mapContainer ${h.mapContainer} ${T===s?"mapContainerSelected":""}`,children:r.jsx("img",{alt:"",className:"mapContainerImg",src:T.thumbnail,onMouseOver:()=>{l(T.title)},onMouseOut:()=>{l((s==null?void 0:s.title)!==void 0?s.title:" ")},onClick:()=>{C(T.id)}})},T.id))})]})},ir="",Ne="ic_settings_24px",Ln=e=>{const[i,t]=d.useState(!1),{sceneModes:n,baseMaps:l,locale:s}=e,u=d.useRef(null),h=H.get(s,"MAP_SETTINGS_DIALOG_TITLE")??"Map Settings",C=H.get(s,"MAP_SETTINGS_SCENE_MODE_TITLE")??"Scene Mode",T=H.get(s,"MAP_SETTINGS_BASE_MAP_TITLE")??"Base Map";return d.useEffect(()=>{const L=O=>{var U;const A=O.target,N=H.get(u,"current");N&&!N.contains(A)&&A.id!==Ne&&((U=A.parentElement)==null?void 0:U.id)!==Ne&&(document.removeEventListener("click",L,!1),t(!1))};return document.addEventListener("click",L,!1),()=>{document.removeEventListener("click",L,!1)}}),r.jsxs(r.Fragment,{children:[r.jsx(W.Icon,{icon:r.jsx("div",{className:"settingsIconContainer",children:r.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 24 24",id:Ne,x:"288",y:"24",children:r.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(!i)}}),i&&r.jsx("div",{id:"dialog-portal-example",className:"settingsDialogPortal",ref:u,children:r.jsxs(W.Dialog,{open:i,onClosed:()=>{t(!1)},children:[r.jsx(W.DialogTitle,{children:h}),r.jsxs(W.DialogContent,{children:[r.jsx("h4",{className:"sectionLabel",children:C}),r.jsx(se,{className:"mapScenesContainer",children:r.jsx(_n,{sceneModes:n})}),r.jsx(se,{className:"baseMapsContainer",children:l&&r.jsxs(r.Fragment,{children:[r.jsx("h4",{className:"sectionLabel",children:T}),r.jsx(Pn,{baseMaps:l})]})})]})]})})]})},rr="",An=r.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:r.jsxs("g",{xmlns:"http://www.w3.org/2000/svg",children:[r.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"}),r.jsx("circle",{cx:"270.1",cy:"56.3",r:"56.3"})]})}),kn=({onClick:e})=>r.jsx(se,{onClick:e,className:"mapLegendToggleContainer",children:r.jsx(W.Icon,{icon:An,className:"mapLegendIcon"})}),In=({legend:{legendImg:e,legendDoc:i,layer:t},docText:n,imgText:l})=>{const s=d.useCallback(()=>{window.open(e,"_blank")},[e]);d.useCallback(()=>{window.open(i,"_blank")},[i]);const u=d.useCallback(()=>{const T=r.jsx(se,{className:"layerNameContainer",children:r.jsx("h3",{style:{maxWidth:`${15}ch`},className:"layerName",children:t})});return(t??"").length>15?r.jsx(W.Tooltip,{content:t,children:T}):T},[t]),h=d.useCallback(()=>[typeof e=="string"&&r.jsx("a",{className:"legendAction",href:e,target:"_blank",rel:"noreferrer",children:l}),typeof i=="string"&&r.jsx("a",{className:"legendAction",href:i,target:"_blank",rel:"noreferrer",children:n})],[e,l,i,n]);return r.jsxs(se,{className:"mapLegend",children:[u(),r.jsx("img",{alt:"Map Legend",className:"legendImg",src:e,onClick:s}),r.jsx(se,{className:"legendActionsContainer",children:h()})]})},On=({legends:e,actionsTexts:{docText:i,imgText:t},noLegendsText:n})=>{const l=d.useCallback(()=>r.jsx(se,{className:"noLegendsContainer",children:r.jsx("h2",{className:"noLegendsMsg",children:n})}),[n]),s=d.useCallback(()=>e.length?e.map((u,h)=>r.jsx(In,{legend:u,docText:i,imgText:t},`${u.layer}_${h}`)):l(),[e]);return r.jsx(se,{className:"mapLegendsList",children:s()})},Dn=({isOpen:e,toggleSidebar:i,title:t="Map Legends",noLegendsText:n="No legends to display...",actionsTexts:l={docText:"Docs",imgText:"View Image"},legends:s=[]})=>e?r.jsxs(W.Drawer,{className:"mapLegendSidebarContainer",modal:!1,dismissible:!0,open:e,children:[r.jsx(W.DrawerHeader,{className:"sidebarHeaderContainer",children:r.jsx(W.DrawerTitle,{className:"sidebarTitle",children:t})}),r.jsxs(W.DrawerContent,{className:"sidebarContent",children:[r.jsx(W.Icon,{onClick:i,className:"mapLegendCloseBtn",icon:{icon:"close",size:"small"}}),r.jsx(On,{noLegendsText:n,legends:s,actionsTexts:l})]})]}):null,at=(e,i,t)=>{let n;if(e.scene.mode!==S.SceneMode.SCENE2D)n=e.scene.pickPosition(new S.Cartesian2(i,t));else{const l=e.scene.globe.ellipsoid;n=e.camera.pickEllipsoid(new S.Cartesian2(i,t),l)}return S.Cartographic.fromCartesian(n)},xn=(e,i,t)=>{const n=at(e,i,t);return{type:"Feature",properties:{},geometry:{type:"Point",coordinates:[S.Math.toDegrees(n.longitude),S.Math.toDegrees(n.latitude)]}}},Bn=(e,i,t)=>{try{const n=at(e,i,t);return{longitude:S.Math.toDegrees(n.longitude),latitude:S.Math.toDegrees(n.latitude)}}catch{return}},ge=document.createElement("canvas"),oe=ge.getContext("2d"),lt=e=>{const n=(e==null?void 0:e.data)??[];for(let l=3;l<n.length;l+=4)if(n[l]<255)return!0;return!1},Nn=async(e,i)=>(i&&i.tileTransparencyCheckedCounter++,new Promise((t,n)=>{try{oe==null||oe.clearRect(0,0,ge.width,ge.height);let l;if(e instanceof HTMLImageElement)l=e;else if(e instanceof ImageBitmap){ge.width=e.width,ge.height=e.height,oe==null||oe.drawImage(e,0,0);const s=oe==null?void 0:oe.getImageData(0,0,ge.width,ge.height),u=lt(s);u&&i&&(i.tileTransparencyCheckedCounter=i.maxTilesForTransparencyCheck),t(u);return}else l=new Image,l.crossOrigin="anonymous",l.src=e;l.onload=()=>{ge.width=l.width,ge.height=l.height,oe==null||oe.drawImage(l,0,0);const s=oe==null?void 0:oe.getImageData(0,0,ge.width,ge.height);lt(s)?(i&&(i.tileTransparencyCheckedCounter=i.maxTilesForTransparencyCheck),t(!0)):t(!1)}}catch(l){console.error("Could not determine image transparency. Error => ",l),n(l)}})),Me=(e,i)=>{const{west:t,east:n,north:l,south:s}=e,{west:u,east:h,north:C,south:T}=i;return t>=u&&n<=h&&l<=C&&s>=T},Pe=3,Le="hasTransparency";function Fe(e,i,t,n,l){return setTimeout(()=>{var h;const s=(h=this.layerListInstance.find(C=>{var T,L;return((T=C._imageryProvider._resource)==null?void 0:T._url)===((L=this._resource)==null?void 0:L._url)}))==null?void 0:h.meta,u=H.get(s,Le)===!0;this.tileTransparencyCheckedCounter<Pe&&!u&&Nn(l==null?void 0:l.url,this).then(C=>{var T;(T=this.mapViewer.layersManager)==null||T.addMetaToLayer({[Le]:C},L=>L._imageryProvider._resource._url===this._resource._url)})},0),e(i,t,n,l)}class ct extends S.UrlTemplateImageryProvider{constructor(t,n){var l;super(t);te(this,"layerListInstance");te(this,"mapViewer");te(this,"maxTilesForTransparencyCheck",Pe);te(this,"tileTransparencyCheckedCounter",0);this.layerListInstance=(l=n.layersManager)==null?void 0:l.layerList,this.mapViewer=n}requestImage(t,n,l,s){return Fe.call(this,super.requestImage.bind(this),t,n,l,s)}}class dt extends S.WebMapServiceImageryProvider{constructor(t,n){var l;super(t);te(this,"layerListInstance");te(this,"mapViewer");te(this,"maxTilesForTransparencyCheck",Pe);te(this,"tileTransparencyCheckedCounter",0);this.layerListInstance=(l=n.layersManager)==null?void 0:l.layerList,this.mapViewer=n}requestImage(t,n,l,s){return Fe.call(this,super.requestImage.bind(this),t,n,l,s)}}class ut extends S.WebMapTileServiceImageryProvider{constructor(t,n){var l;super(t);te(this,"layerListInstance");te(this,"mapViewer");te(this,"maxTilesForTransparencyCheck",Pe);te(this,"tileTransparencyCheckedCounter",0);this.layerListInstance=(l=n.layersManager)==null?void 0:l.layerList,this.mapViewer=n}requestImage(t,n,l,s){return Fe.call(this,super.requestImage.bind(this),t,n,l,s)}}const Fn=1,Gn=-1,ht="TRANSPARENT_BASE_LAYER";class Hn{constructor(i,t,n){te(this,"mapViewer");te(this,"legendsList");te(this,"layerUpdated");te(this,"layers");te(this,"legendsExtractor");this.mapViewer=i,this.layers=this.mapViewer.imageryLayers._layers,this.legendsList=[],this.legendsExtractor=t,this.layerUpdated=new S.Event,n&&this.layerUpdated.addEventListener(n,this),this.mapViewer.shouldOptimizedTileRequests&&(this.layerUpdated.addEventListener(l=>{const s=Object.keys(l);s.length===1&&s[0]===Le&&(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}addMetaToLayer(i,t){const n=this.layers.find(t);n&&(n.meta={...n.meta??{},...i},this.setLegends(),this.layerUpdated.raiseEvent(i))}setBaseMapLayers(i){i.baseRasteLayers.sort((n,l)=>n.zIndex-l.zIndex).forEach((n,l)=>{this.addRasterLayer(n,l,i.id)}),this.mapViewer.shouldOptimizedTileRequests&&(this.removeLayer(ht),this.addTransparentImageryProvider())}addRasterLayer(i,t,n){let l;switch(i.type){case"XYZ_LAYER":{const s=i.options,u=this.mapViewer.shouldOptimizedTileRequests?new ct(s,this.mapViewer):new S.UrlTemplateImageryProvider(s);l=this.mapViewer.imageryLayers.addImageryProvider(u,t);break}case"WMS_LAYER":{const s=i.options,u=this.mapViewer.shouldOptimizedTileRequests?new dt(s,this.mapViewer):new S.WebMapServiceImageryProvider(s);l=this.mapViewer.imageryLayers.addImageryProvider(u,t);break}case"WMTS_LAYER":{const s=i.options,u=this.mapViewer.shouldOptimizedTileRequests?new ut(s,this.mapViewer):new S.WebMapTileServiceImageryProvider(s);l=this.mapViewer.imageryLayers.addImageryProvider(u,t);break}}l&&(l.alpha=i.opacity,l.meta={parentBasetMapId:n,...i},i.show!==void 0&&(l.show=i.show))}removeLayer(i){const t=this.findLayerById(i);t&&this.mapViewer.imageryLayers.remove(t,!0)}removeBaseMapLayers(){this.layers.filter(t=>!!H.get(t.meta,"parentBasetMapId")).forEach(t=>{this.mapViewer.imageryLayers.remove(t,!0)})}removeNotBaseMapLayers(){this.layers.filter(t=>!H.get(t.meta,"parentBasetMapId")).forEach(t=>{this.mapViewer.imageryLayers.remove(t,!0)})}raise(i,t=1){const n=this.findLayerById(i),l=(n==null?void 0:n.meta).zIndex;if(n)for(let s=0;s<t;s++)this.mapViewer.imageryLayers.raise(n);this.updateLayersOrder(i,l,l+t)}lower(i,t=1){const n=this.findLayerById(i),l=(n==null?void 0:n.meta).zIndex,s=this.getBaseLayersCount(),u=this.mapViewer.imageryLayers.indexOf(n);if(u-t<=s&&(t=u-s),n)for(let h=0;h<t;h++)this.mapViewer.imageryLayers.lower(n);this.updateLayersOrder(i,l,l-t)}raiseToTop(i){const t=this.findLayerById(i),n=(t==null?void 0:t.meta).zIndex;t&&this.mapViewer.imageryLayers.raiseToTop(t),this.updateLayersOrder(i,n,this.mapViewer.imageryLayers.length-this.getBaseLayersCount()-1)}lowerToBottom(i){const t=this.findLayerById(i),n=this.getBaseLayersCount(),l=this.mapViewer.imageryLayers.indexOf(t);this.lower(i,l-n)}length(){return this.mapViewer.imageryLayers.length}show(i,t){const n=this.get(i);n!==void 0&&(n.show=t)}showAllNotBase(i){this.layers.filter(n=>!H.get(n.meta,"parentBasetMapId")).forEach(n=>{var l;this.show((l=n.meta)==null?void 0:l.id,i)})}get(i){const t=this.findLayerById(i),n=this.mapViewer.imageryLayers.indexOf(t);return n?this.mapViewer.imageryLayers.get(n):void 0}findLayerByPOI(i,t){const n=xn(this.mapViewer,i,t);return this.layers.filter(u=>!H.get(u.meta,"parentBasetMapId")).filter(u=>{const h=H.get(u.meta,"details.footprint");return h!==void 0?Ot(n.geometry,{type:"Feature",properties:{},geometry:h})&&u.show:(console.warn("CesiumImageryLayer has no defined footprint",u.meta),!1)}).sort((u,h)=>{var C,T;return((C=h.meta)==null?void 0:C.zIndex)-((T=u.meta)==null?void 0:T.zIndex)})}addTransparentImageryProvider(){const i=this.mapViewer.imageryLayers.addImageryProvider(new S.SingleTileImageryProvider({url:"./assets/img/transparent-tile.png",rectangle:new S.Rectangle(-3.141592653589793,-1.5707963267948966,3.141592653589793,1.5707963267948966)}),0);i.meta={id:ht,skipRelevancyCheck:!0}}setLegends(){typeof this.legendsExtractor<"u"&&(this.legendsList=this.legendsExtractor(this.layers))}getBaseLayersCount(){return this.layers.filter(t=>!!H.get(t.meta,"parentBasetMapId")).length}findLayerById(i){return this.layers.find(t=>t.meta!==void 0?t.meta.id===i:!1)}updateLayersOrder(i,t,n){const l=t>n?Fn:Gn,s=t<n?t:n,u=t<n?n:t;this.layers.forEach(h=>{var T;if(!H.get(h.meta,"parentBasetMapId")){const L=(T=h.meta)==null?void 0:T.zIndex;h.meta.zIndex=L>=s&&L<=u&&L!==t?L+l:L===t?n:L}})}hideNonRelevantLayers(){var i,t;for(const n of this.layers)((i=n.meta)==null?void 0:i.relevantToExtent)!==n.show&&n.imageryProvider.ready&&(n.show=((t=n.meta)==null?void 0:t.relevantToExtent)??!0)}markRelevantLayersForExtent(){var i,t;try{const n=this.mapViewer.camera.computeViewRectangle();for(let l=this.layers.length-1;l>=0;l--){const s=this.layers[l],u=!H.isEmpty(n)&&!H.isEmpty(s.rectangle)&&S.Rectangle.intersection(n,s.rectangle);for(let h=this.layers.length-1;h>=l;h--){if(((i=s.meta)==null?void 0:i.skipRelevancyCheck)===!0){s.meta={...s.meta,relevantToExtent:!0};continue}const C=this.layers[h],T=((t=C.meta)==null?void 0:t[Le])===!0;if(s!==C)if(u instanceof S.Rectangle){if(Me(n,s.rectangle))if(Me(n,C.rectangle)&&!T){s.meta={...s.meta??{},relevantToExtent:!1};break}else s.meta={...s.meta??{},relevantToExtent:!0};if(Me(n,C.rectangle)&&!T){s.meta={...s.meta??{},relevantToExtent:!1};break}if(Me(s.rectangle,C.rectangle)){if(s.meta={...s.meta??{},relevantToExtent:T},!T)break}else s.meta={...s.meta??{},relevantToExtent:!0}}else s.meta={...s.meta??{},relevantToExtent:!1};else l===this.layers.length-1&&(s.meta={...s.meta??{},relevantToExtent:u instanceof S.Rectangle})}}}catch(n){console.error(n)}}}const or="",gt=212,pt=260,Vn=0;class zn extends S.Viewer{constructor(t,n){super(t,n);te(this,"layersManager");te(this,"useOptimizedTileRequests")}get shouldOptimizedTileRequests(){return this.useOptimizedTileRequests??!1}set shouldOptimizedTileRequests(t){this.useOptimizedTileRequests=t}}const ft=d.createContext(null),Wn=ft.Provider,$n=1e4,ue=()=>{const e=d.useContext(ft);if(e===null)throw new Error("map context is null, please check the provider");return e},Un=e=>{var w,M,_,b,P,k,V,Y;const i=d.useRef(null),[t,n]=d.useState(),[l,s]=d.useState(),[u,h]=d.useState(),[C,T]=d.useState(),[L,O]=d.useState(),[A,N]=d.useState(),[U,Z]=d.useState(),[R,G]=d.useState(),[ee,j]=d.useState([]),[$,X]=d.useState(),[B,q]=d.useState(!1),[J,o]=d.useState(void 0),[a,v]=d.useState(!1),[c,y]=d.useState(),g={fullscreenButton:!0,timeline:!1,animation:!1,baseLayerPicker:!1,geocoder:!1,navigationHelpButton:!1,homeButton:!1,sceneModePicker:!1,...e},E=(I,D,F,z,me)=>{const ae=t.container,ne=ae.clientWidth,ce=ae.clientHeight,Ce=z+me;return{left:`${ne-I<F?I-(F-(ne-I)):I}px`,top:`${ce-D<Ce?D-(Ce-(ce-D)):D}px`}};d.useEffect(()=>{var I;if(i.current!==null){const D=i.current.cesiumElement;e.imageryContextMenu&&D.screenSpaceEventHandler.setInputAction(F=>{const z=F.position;q(!1),o(z),y(Bn(D,z.x,z.y)),q(!0)},S.ScreenSpaceEventType.RIGHT_CLICK)}n((I=i.current)==null?void 0:I.cesiumElement)},[i,e.imageryContextMenu]),d.useEffect(()=>{var I;t&&(t.shouldOptimizedTileRequests=e.useOptimizedTileRequests??!1,t.layersManager=new Hn(t,(I=e.legends)==null?void 0:I.mapLegendsExtractor,()=>{var D;j((D=t.layersManager)==null?void 0:D.legendsList)}))},[t]),d.useEffect(()=>{t&&(t.shouldOptimizedTileRequests=e.useOptimizedTileRequests??!1)},[e.useOptimizedTileRequests,t]),d.useEffect(()=>{G(e.sceneModes??[ie.SCENE2D,ie.SCENE3D,ie.COLUMBUS_VIEW])},[e.sceneModes]),d.useEffect(()=>{var D,F;X(e.baseMaps);const I=(D=e.baseMaps)==null?void 0:D.maps.find(z=>z.isCurrent);I&&t&&((F=t.layersManager)==null||F.setBaseMapLayers(I))},[e.baseMaps,t]),d.useEffect(()=>{s(e.projection??de.WGS84)},[e.projection]),d.useEffect(()=>{N(e.locale)},[e.locale]),d.useEffect(()=>{h(e.showMousePosition??!0)},[e.showMousePosition]),d.useEffect(()=>{T(e.showZoomLevel??!0)},[e.showZoomLevel]),d.useEffect(()=>{O(e.showScale??!0)},[e.showScale]),d.useEffect(()=>{const I=()=>{if(t===void 0)return{longitude:0,latitude:0,height:0};const F=()=>{const z=t.camera.positionCartographic;return{longitude:_e(z.longitude),latitude:_e(z.latitude),height:z.height}};if(t.scene.mode===S.SceneMode.SCENE3D){const z=new S.Cartesian2(t.container.clientWidth/2,t.container.clientHeight/2),me=t.scene.camera.getPickRay(z),ae=t.scene.globe.pick(me,t.scene),ne=t.scene.globe.ellipsoid.cartesianToCartographic(ae);return ne!==void 0?{longitude:_e(ne.longitude),latitude:_e(ne.latitude),height:t.scene.camera.positionCartographic.height}:F()}else return F()},D=setInterval(()=>{if(t&&t.scene.mode!==S.SceneMode.MORPHING){const F=t.camera,z={position:I(),direction:F.direction.clone(),up:F.up.clone(),right:F.right.clone(),transform:F.transform.clone(),frustum:F.frustum.clone()};Z(z)}},$n);return()=>{clearInterval(D)}},[t]),d.useEffect(()=>{const I=()=>{t&&U&&t.camera.flyTo({destination:S.Cartesian3.fromDegrees(U.position.longitude,U.position.latitude,U.position.height),duration:0})};return t&&t.scene.morphComplete.addEventListener(I),()=>{if(t)try{t.scene.morphComplete.removeEventListener(I)}catch{console.error("morphCompleteHandler event not cleaned")}}},[t,U]),d.useEffect(()=>{const I=e.zoom,D=e.center;t&&H.isNumber(I)&&H.isArray(D)&&t.camera.flyTo({destination:S.Cartesian3.fromDegrees(D[0],D[1],vn(I)),duration:0})},[e.zoom,e.center,t]);const m=d.useCallback(()=>t&&It.createPortal(r.jsxs(r.Fragment,{children:[r.jsxs(se,{className:"sideToolsContainer",children:[r.jsx(Ln,{sceneModes:R,baseMaps:$,locale:A}),r.jsx(kn,{onClick:()=>v(!a)})]}),r.jsxs(se,{className:"toolsContainer",children:[u===!0?r.jsx(En,{projection:l}):r.jsx(r.Fragment,{}),C===!0?r.jsx(Tn,{locale:A}):r.jsx(r.Fragment,{}),L===!0?r.jsx(wn,{locale:A}):r.jsx(r.Fragment,{})]})]}),document.querySelector(".cesium-viewer")),[$,A,t,l,R,u,L,a]);return r.jsx(he.Viewer,{className:"viewer",full:!0,ref:i,...g,children:r.jsxs(Wn,{value:t,children:[r.jsx(Dn,{title:(w=e.legends)==null?void 0:w.title,isOpen:a,toggleSidebar:()=>v(!a),noLegendsText:(M=e.legends)==null?void 0:M.emptyText,legends:((_=e.legends)==null?void 0:_.legendsList)??ee,actionsTexts:(b=e.legends)==null?void 0:b.actionsTexts}),e.children,m(),e.imageryContextMenu&&B&&J&&c&&d.cloneElement(e.imageryContextMenu,{data:(P=t==null?void 0:t.layersManager)==null?void 0:P.findLayerByPOI(J.x,J.y),position:{x:J.x,y:J.y},coordinates:c,style:E(J.x,J.y,((k=e.imageryContextMenuSize)==null?void 0:k.width)??pt,((V=e.imageryContextMenuSize)==null?void 0:V.height)??gt,((Y=e.imageryContextMenuSize)==null?void 0:Y.dynamicHeightIncrement)??Vn),size:e.imageryContextMenuSize??{height:gt,width:pt},handleClose:()=>{q(!B)}})]})})},qn=0,Kn=e=>{const i=ue();return r.jsx(he.Cesium3DTileset,{...e,onReady:t=>{e.isZoomTo===!0&&i.zoomTo(t);const n=i.scene;n.globe.depthTestAgainstTerrain=!0;const l=S.Cartographic.fromCartesian(t.boundingSphere.center),s=e.heightFromGround??qn;if(s){const u=S.Cartesian3.fromRadians(l.longitude,l.latitude,l.height),h=S.Cartesian3.fromRadians(l.longitude,l.latitude,l.height+s),C=S.Cartesian3.subtract(h,u,new S.Cartesian3);t.modelMatrix=S.Matrix4.fromTranslation(C)}}})},jn=e=>r.jsx(he.GeoJsonDataSource,{...e}),Ee=e=>{const{meta:i,...t}=e,n=ue();return d.useLayoutEffect(()=>{var l;(l=n.layersManager)==null||l.addMetaToLayer(i,i.searchLayerPredicate??((s,u)=>{var h,C;return i!==void 0?((h=s._imageryProvider._resource)==null?void 0:h._url)===((C=i.options)==null?void 0:C.url):!1}))},[i,n]),r.jsx(he.ImageryLayer,{...t})},Yn=e=>{const{options:i,...t}=e,n=ue(),l=n.shouldOptimizedTileRequests?new dt(i,n):new S.WebMapServiceImageryProvider(i);return r.jsx(Ee,{...t,imageryProvider:l})},Xn=e=>{const{options:i,...t}=e,n=ue(),l=n.shouldOptimizedTileRequests?new ut(i,n):new S.WebMapTileServiceImageryProvider(i);return r.jsx(Ee,{...t,imageryProvider:l})},Zn=e=>{const{options:i,...t}=e,n=ue(),l=n.shouldOptimizedTileRequests?new ct(i,n):new S.UrlTemplateImageryProvider(i);return r.jsx(Ee,{...t,imageryProvider:l})},Jn=e=>{const{options:i,...t}=e;return r.jsx(Ee,{...t,imageryProvider:new S.OpenStreetMapImageryProvider(i)})},mt=e=>r.jsx(he.Entity,{...e}),Qn=e=>r.jsx(he.EntityDescription,{...e}),yt=e=>r.jsx(he.EntityDescription,{...e}),vt=e=>r.jsx(he.PolygonGraphics,{...e}),Et=e=>r.jsx(he.RectangleGraphics,{...e}),Ct=e=>r.jsx(he.CustomDataSource,{...e}),Rn=e=>r.jsx(he.PolylineGraphics,{...e}),sr="";var ye=function(){var e=p.Ellipsoid.WGS84,i,t=p.Material.fromType(p.Material.ColorType);function n(o,a=new p.Color(1,1,0,.5),v=new p.Color(1,1,1,1)){this._scene=o.scene,t.uniforms.color=a,i=v,this._tooltip={setVisible:()=>{},showAt:()=>{}},this._surfaces=[],this.initialiseHandlers(),this.enhancePrimitives()}n.prototype.initialiseHandlers=function(){var o=this._scene,a=this,v=new p.ScreenSpaceEventHandler(o.canvas);function c(g,E){if(a._handlersMuted!=!0){var m=o.pick(E);m&&m.primitive&&m.primitive[g]&&m.primitive[g](E)}}v.setInputAction(function(g){c("leftClick",g.position)},p.ScreenSpaceEventType.LEFT_CLICK),v.setInputAction(function(g){c("leftDoubleClick",g.position)},p.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);var y;v.setInputAction(function(g){if(a._handlersMuted!=!0){var E=o.pick(g.endPosition);y&&(!E||y!=E.primitive)&&(!(y.isDestroyed&&y.isDestroyed())&&y.mouseOut(g.endPosition),y=null),E&&E.primitive&&(E=E.primitive,E.mouseOut&&(y=E),E.mouseMove&&E.mouseMove(g.endPosition))}},p.ScreenSpaceEventType.MOUSE_MOVE),v.setInputAction(function(g){c("leftUp",g.position)},p.ScreenSpaceEventType.LEFT_UP),v.setInputAction(function(g){c("leftDown",g.position)},p.ScreenSpaceEventType.LEFT_DOWN)},n.prototype.setListener=function(o,a,v){o[a]=v},n.prototype.muteHandlers=function(o){this._handlersMuted=o},n.prototype.registerEditableShape=function(o){var a=this;q(o,"mouseMove",function(v){o.setHighlighted(!0),o._editMode||a._tooltip.showAt(v,"Click to edit this shape")}),q(o,"mouseOut",function(v){o.setHighlighted(!1),a._tooltip.setVisible(!1)}),q(o,"leftClick",function(v){o.setEditMode(!0)})},n.prototype.startDrawing=function(o){this.disableAllEditMode(),this.editCleanUp&&this.editCleanUp(),this.editCleanUp=o,this.muteHandlers(!0)},n.prototype.stopDrawing=function(){this.editCleanUp&&(this.editCleanUp(),this.editCleanUp=null),this.muteHandlers(!1)},n.prototype.disableAllHighlights=function(){this.setHighlighted(void 0)},n.prototype.setHighlighted=function(o){this._highlightedSurface&&!this._highlightedSurface.isDestroyed()&&this._highlightedSurface!=o&&this._highlightedSurface.setHighlighted(!1),this._highlightedSurface=o},n.prototype.disableAllEditMode=function(){this.setEdited(void 0)},n.prototype.setEdited=function(o){this._editedSurface&&!this._editedSurface.isDestroyed()&&this._editedSurface.setEditMode(!1),this._editedSurface=o};var l={ellipsoid:p.Ellipsoid.WGS84,textureRotationAngle:0,height:0,asynchronous:!0,show:!0,debugShowBoundingVolume:!1},s=B(l,{appearance:new p.EllipsoidSurfaceAppearance({aboveGround:!1}),material:t,granularity:Math.PI/180}),u=B(l,{}),h=B(l,{}),C=B(l,{}),T=B(s,{rotation:0}),L=B(l,{width:5,geodesic:!0,granularity:1e4,appearance:new p.PolylineMaterialAppearance({aboveGround:!1}),material:t}),O=function(){function o(){}return o.prototype.initialiseOptions=function(a){X(this,a),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},o.prototype.setAttribute=function(a,v){this[a]=v,this._createPrimitive=!0},o.prototype.getAttribute=function(a){return this[a]},o.prototype.update=function(a,v,c){if(!p.defined(this.ellipsoid))throw new p.DeveloperError("this.ellipsoid must be defined.");if(!p.defined(this.appearance))throw new p.DeveloperError("this.material must be defined.");if(this.granularity<0)throw new p.DeveloperError("this.granularity and scene2D/scene3D overrides must be greater than zero.");if(this.show&&!(!this._createPrimitive&&!p.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 y=this.getGeometry();if(!y)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 p.Primitive({geometryInstances:new p.GeometryInstance({geometry:y,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 p.Primitive({geometryInstances:new p.GeometryInstance({geometry:this.getOutlineGeometry(),attributes:{color:p.ColorGeometryInstanceAttribute.fromColor(this.strokeColor)}}),appearance:new p.PerInstanceColorAppearance({flat:!0,renderState:{depthTest:{enabled:!0},lineWidth:this.strokeWidth||4}})}))}var g=this._primitive;g.appearance.material=this.material,g.debugShowBoundingVolume=this.debugShowBoundingVolume,g.update(a,v,c),this._outlinePolygon&&this._outlinePolygon.update(a,v,c)}},o.prototype.isDestroyed=function(){return!1},o.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),p.destroyObject(this)},o.prototype.setStrokeStyle=function(a,v){(!this.strokeColor||!this.strokeColor.equals(a)||this.strokeWidth!=v)&&(this._createPrimitive=!0,this.strokeColor=a,this.strokeWidth=v)},o}();n.ExtentPrimitive=function(){function o(a){if(!p.defined(a.extent))throw new p.DeveloperError("Extent is required");a=B(a,s),this.initialiseOptions(a),this.setExtent(a.extent)}return o.prototype=new O,o.prototype.setExtent=function(a){this.setAttribute("extent",a)},o.prototype.getExtent=function(){return this.getAttribute("extent")},o.prototype.getGeometry=function(){if(p.defined(this.extent))return new p.RectangleGeometry({rectangle:this.extent,height:this.height,vertexFormat:p.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity})},o.prototype.getOutlineGeometry=function(){return new p.RectangleOutlineGeometry({rectangle:this.extent})},o}(),n.PolygonPrimitive=function(){function o(a){a=B(a,s),this.initialiseOptions(a),this.isPolygon=!0}return o.prototype=new O,o.prototype.setPositions=function(a){this.setAttribute("positions",a)},o.prototype.getPositions=function(){return this.getAttribute("positions")},o.prototype.getGeometry=function(){if(!(!p.defined(this.positions)||this.positions.length<3))return p.PolygonGeometry.fromPositions({positions:this.positions,height:this.height,vertexFormat:p.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity})},o.prototype.getOutlineGeometry=function(){return p.PolygonOutlineGeometry.fromPositions({positions:this.getPositions()})},o}(),n.CirclePrimitive=function(){function o(a){if(!(p.defined(a.center)&&p.defined(a.radius)))throw new p.DeveloperError("Center and radius are required");a=B(a,s),this.initialiseOptions(a),this.setRadius(a.radius)}return o.prototype=new O,o.prototype.setCenter=function(a){this.setAttribute("center",a)},o.prototype.setRadius=function(a){this.setAttribute("radius",Math.max(.1,a))},o.prototype.getCenter=function(){return this.getAttribute("center")},o.prototype.getRadius=function(){return this.getAttribute("radius")},o.prototype.getGeometry=function(){if(p.defined(this.center)&&p.defined(this.radius))return new p.CircleGeometry({center:this.center,radius:this.radius,height:this.height,vertexFormat:p.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity})},o.prototype.getOutlineGeometry=function(){return new p.CircleOutlineGeometry({center:this.getCenter(),radius:this.getRadius()})},o}(),n.EllipsePrimitive=function(){function o(a){if(!(p.defined(a.center)&&p.defined(a.semiMajorAxis)&&p.defined(a.semiMinorAxis)))throw new p.DeveloperError("Center and semi major and semi minor axis are required");a=B(a,T),this.initialiseOptions(a)}return o.prototype=new O,o.prototype.setCenter=function(a){this.setAttribute("center",a)},o.prototype.setSemiMajorAxis=function(a){a<this.getSemiMinorAxis()||this.setAttribute("semiMajorAxis",a)},o.prototype.setSemiMinorAxis=function(a){a>this.getSemiMajorAxis()||this.setAttribute("semiMinorAxis",a)},o.prototype.setRotation=function(a){return this.setAttribute("rotation",a)},o.prototype.getCenter=function(){return this.getAttribute("center")},o.prototype.getSemiMajorAxis=function(){return this.getAttribute("semiMajorAxis")},o.prototype.getSemiMinorAxis=function(){return this.getAttribute("semiMinorAxis")},o.prototype.getRotation=function(){return this.getAttribute("rotation")},o.prototype.getGeometry=function(){if(p.defined(this.center)&&p.defined(this.semiMajorAxis)&&p.defined(this.semiMinorAxis))return new p.EllipseGeometry({ellipsoid:this.ellipsoid,center:this.center,semiMajorAxis:this.semiMajorAxis,semiMinorAxis:this.semiMinorAxis,rotation:this.rotation,height:this.height,vertexFormat:p.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,granularity:this.granularity})},o.prototype.getOutlineGeometry=function(){return new p.EllipseOutlineGeometry({center:this.getCenter(),semiMajorAxis:this.getSemiMajorAxis(),semiMinorAxis:this.getSemiMinorAxis(),rotation:this.getRotation()})},o}(),n.PolylinePrimitive=function(){function o(a){a=B(a,L),this.initialiseOptions(a)}return o.prototype=new O,o.prototype.setPositions=function(a){this.setAttribute("positions",a)},o.prototype.setWidth=function(a){this.setAttribute("width",a)},o.prototype.setGeodesic=function(a){this.setAttribute("geodesic",a)},o.prototype.getPositions=function(){return this.getAttribute("positions")},o.prototype.getWidth=function(){return this.getAttribute("width")},o.prototype.getGeodesic=function(a){return this.getAttribute("geodesic")},o.prototype.getGeometry=function(){if(!(!p.defined(this.positions)||this.positions.length<2))return new p.PolylineGeometry({positions:this.positions,height:this.height,width:this.width<1?1:this.width,vertexFormat:p.EllipsoidSurfaceAppearance.VERTEX_FORMAT,ellipsoid:this.ellipsoid})},o}();var A={iconUrl:"./assets/img/dragIcon.png",shiftX:0,shiftY:0},N={iconUrl:"./assets/img/dragIcon.png",shiftX:0,shiftY:0},U={iconUrl:"./assets/img/dragIconLight.png",shiftX:0,shiftY:0};n.prototype.createBillboardGroup=function(o,a,v){var c=new n.BillboardGroup(this,a);return c.addBillboards(o,v),c},n.BillboardGroup=function(o,a){this._drawHelper=o,this._scene=o._scene,this._options=B(a,A);var v=new p.BillboardCollection;this._scene.primitives.add(v),this._billboards=v,this._orderedBillboards=[]},n.BillboardGroup.prototype.createBillboard=function(o,a){var v=this._billboards.add({show:!0,position:o,pixelOffset:new p.Cartesian2(this._options.shiftX,this._options.shiftY),eyeOffset:new p.Cartesian3(0,0,0),horizontalOrigin:p.HorizontalOrigin.CENTER,verticalOrigin:p.VerticalOrigin.CENTER,scale:1,image:this._options.iconUrl,color:i});if(a){let g=function(m){y.enableRotate=m},E=function(){for(var m=0,w=c._orderedBillboards.length;m<w&&c._orderedBillboards[m]!=v;++m);return m};var c=this,y=this._scene.screenSpaceCameraController;if(a.dragHandlers){var c=this;q(v,"leftDown",function(w){function M(P){v.position=P;for(var k=0,V=c._orderedBillboards.length;k<V&&c._orderedBillboards[k]!=v;++k);a.dragHandlers.onDrag&&a.dragHandlers.onDrag(E(),P)}function _(P){b.destroy(),g(!0),a.dragHandlers.onDragEnd&&a.dragHandlers.onDragEnd(E(),P)}var b=new p.ScreenSpaceEventHandler(c._scene.canvas);b.setInputAction(function(P){var k=c._scene.camera.pickEllipsoid(P.endPosition,e);k?M(k):_(k)},p.ScreenSpaceEventType.MOUSE_MOVE),b.setInputAction(function(P){_(c._scene.camera.pickEllipsoid(P.position,e))},p.ScreenSpaceEventType.LEFT_UP),g(!1),a.dragHandlers.onDragStart&&a.dragHandlers.onDragStart(E(),c._scene.camera.pickEllipsoid(w,e))})}a.onDoubleClick&&q(v,"leftDoubleClick",function(m){a.onDoubleClick(E())}),a.onClick&&q(v,"leftClick",function(m){a.onClick(E())}),a.tooltip&&(q(v,"mouseMove",function(m){c._drawHelper._tooltip.showAt(m,a.tooltip())}),q(v,"mouseOut",function(m){c._drawHelper._tooltip.setVisible(!1)}))}return v},n.BillboardGroup.prototype.insertBillboard=function(o,a,v){this._orderedBillboards.splice(o,0,this.createBillboard(a,v))},n.BillboardGroup.prototype.addBillboard=function(o,a){this._orderedBillboards.push(this.createBillboard(o,a))},n.BillboardGroup.prototype.addBillboards=function(o,a){for(var v=0;v<o.length;v++)this.addBillboard(o[v],a)},n.BillboardGroup.prototype.updateBillboardsPositions=function(o){for(var a=0;a<o.length;a++)this.getBillboard(a).position=o[a]},n.BillboardGroup.prototype.countBillboards=function(){return this._orderedBillboards.length},n.BillboardGroup.prototype.getBillboard=function(o){return this._orderedBillboards[o]},n.BillboardGroup.prototype.removeBillboard=function(o){this._billboards.remove(this.getBillboard(o)),this._orderedBillboards.splice(o,1)},n.BillboardGroup.prototype.remove=function(){this._billboards=this._billboards&&this._billboards.removeAll()&&this._billboards.destroy()},n.BillboardGroup.prototype.setOnTop=function(){this._scene.primitives.raiseToTop(this._billboards)},n.prototype.startDrawingMarker=function(a){var a=B(a,A);this.startDrawing(function(){g.remove(),E.destroy(),y.setVisible(!1)});var v=this,c=this._scene;c.primitives;var y=this._tooltip,g=new n.BillboardGroup(this,a),E=new p.ScreenSpaceEventHandler(c.canvas);E.setInputAction(function(m){if(m.position!=null){var w=c.camera.pickEllipsoid(m.position,e);w&&(g.addBillboard(w),v.stopDrawing(),a.callback(w))}},p.ScreenSpaceEventType.LEFT_CLICK),E.setInputAction(function(m){var w=m.endPosition;if(w!=null){var M=c.camera.pickEllipsoid(w,e);M?y.showAt(w,"<p>Click to add your marker. Position is: </p>"+j(e.cartesianToCartographic(M))):y.showAt(w,"<p>Click on the globe to add your marker.</p>")}},p.ScreenSpaceEventType.MOUSE_MOVE)},n.prototype.startDrawingPolygon=function(a){var a=B(a,s);this.startDrawingPolyshape(!0,a)},n.prototype.startDrawingPolyline=function(a){var a=B(a,L);this.startDrawingPolyshape(!1,a)},n.prototype.startDrawingPolyshape=function(o,a){this.startDrawing(function(){y.remove(m),M.remove(),_.destroy(),g.setVisible(!1),G(c)});var v=this,c=this._scene,y=c.primitives,g=this._tooltip,E=o?3:2,m;o?m=new ye.PolygonPrimitive(a):m=new ye.PolylinePrimitive(a),m.asynchronous=!1,y.add(m);var w=[],M=new n.BillboardGroup(this,A),_=new p.ScreenSpaceEventHandler(c.canvas);R(c),_.setInputAction(function(b){if(b.position!=null){var P=c.camera.pickEllipsoid(b.position,e);P&&(w.length==0&&(w.push(P.clone()),M.addBillboard(w[0])),w.length>=E&&(m.positions=w,m._createPrimitive=!0),w.push(P),M.addBillboard(P))}},p.ScreenSpaceEventType.LEFT_CLICK),_.setInputAction(function(b){var P=b.endPosition;if(P!=null)if(w.length==0)g.showAt(P,"<p>Click to add first point</p>");else{var k=c.camera.pickEllipsoid(P,e);k&&(w.pop(),k.y+=1+Math.random(),w.push(k),w.length>=E&&(m.positions=w,m._createPrimitive=!0),M.getBillboard(w.length-1).position=k,g.showAt(P,"<p>Click to add new point ("+w.length+")</p>"+(w.length>E?"<p>Double click to finish drawing</p>":"")))}},p.ScreenSpaceEventType.MOUSE_MOVE),_.setInputAction(function(b){var P=b.position;if(P!=null){if(w.length<E+2)return;var k=c.camera.pickEllipsoid(P,e);k&&(G(c),v.stopDrawing(),typeof a.callback=="function"&&(w.length-1,a.callback(w)))}},p.ScreenSpaceEventType.LEFT_DOUBLE_CLICK)};function Z(o){return e.cartographicArrayToCartesianArray([p.Rectangle.northwest(o),p.Rectangle.northeast(o),p.Rectangle.southeast(o),p.Rectangle.southwest(o)])}function R(o){o&&(o.canvas.style.cursor="crosshair")}function G(o){o&&(o.canvas.style.cursor="")}n.prototype.startDrawingExtent=function(a){var a=B(a,s);this.startDrawing(function(){m!=null&&y.remove(m),w!=null&&w.remove(),M.destroy(),g.setVisible(!1),G(c)});var v=this,c=this._scene,y=this._scene.primitives,g=this._tooltip,E=null,m=null,w=null,M=new p.ScreenSpaceEventHandler(c.canvas);R(c);function _(b){m==null&&(m=new ye.ExtentPrimitive({extent:b,material:a.material}),m.asynchronous=!1,y.add(m)),m.setExtent(b);var P=Z(b);w==null?(w=new n.BillboardGroup(v,A),w.addBillboards(P)):w.updateBillboardsPositions(P)}M.setInputAction(function(b){if(b.position!=null){var P=c.camera.pickEllipsoid(b.position,e);if(P)if(m==null){E=e.cartesianToCartographic(P);var k=ee(E,E);_(k)}else v.stopDrawing(),typeof a.callback=="function"&&a.callback(ee(E,e.cartesianToCartographic(P)))}},p.ScreenSpaceEventType.LEFT_DOWN),M.setInputAction(function(b){var P=b.endPosition;if(P!=null)if(m==null)g.showAt(P,"<p>Click to start drawing rectangle</p>");else{var k=c.camera.pickEllipsoid(P,e);if(k){var V=ee(E,e.cartesianToCartographic(k));_(V),g.showAt(P,"<p>Drag to change rectangle extent</p><p>Click again to finish drawing</p>")}}},p.ScreenSpaceEventType.MOUSE_MOVE)},n.prototype.startDrawingCircle=function(a){var a=B(a,s);this.startDrawing(function(){E!=null&&y.remove(E),m.remove(),w.destroy(),g.setVisible(!1)});var v=this,c=this._scene,y=this._scene.primitives,g=this._tooltip,E=null,m=null,w=new p.ScreenSpaceEventHandler(c.canvas);w.setInputAction(function(M){if(M.position!=null){var _=c.camera.pickEllipsoid(M.position,e);_&&(E==null?(E=new n.CirclePrimitive({center:_,radius:0,asynchronous:!1,material:a.material}),y.add(E),m=new n.BillboardGroup(v,A),m.addBillboards([_])):(typeof a.callback=="function"&&a.callback(E.getCenter(),E.getRadius()),v.stopDrawing()))}},p.ScreenSpaceEventType.LEFT_DOWN),w.setInputAction(function(M){var _=M.endPosition;if(_!=null)if(E==null)g.showAt(_,"<p>Click to start drawing the circle</p>");else{var b=c.camera.pickEllipsoid(_,e);b&&(E.setRadius(p.Cartesian3.distance(E.getCenter(),b)),m.updateBillboardsPositions(b),g.showAt(_,"<p>Move mouse to change circle radius</p><p>Click again to finish drawing</p>"))}},p.ScreenSpaceEventType.MOUSE_MOVE)},n.prototype.enhancePrimitives=function(){var o=this;p.Billboard.prototype.setEditable=function(){if(this._editable)return;this._editable=!0;var c=this,y=this;function g(E){o._scene.screenSpaceCameraController.enableRotate=E}q(c,"leftDown",function(E){function m(_){c.position=_,y.executeListeners({name:"drag",positions:_})}function w(_){M.destroy(),g(!0),y.executeListeners({name:"dragEnd",positions:_})}var M=new p.ScreenSpaceEventHandler(o._scene.canvas);M.setInputAction(function(_){var b=o._scene.camera.pickEllipsoid(_.endPosition,e);b?m(b):w(b)},p.ScreenSpaceEventType.MOUSE_MOVE),M.setInputAction(function(_){w(o._scene.camera.pickEllipsoid(_.position,e))},p.ScreenSpaceEventType.LEFT_UP),g(!1)}),J(c)};function a(c){o._scene,!(this._highlighted&&this._highlighted==c)&&this._editMode!==!0&&(this._highlighted=c,c?(o.setHighlighted(this),this._strokeColor=this.strokeColor,this.setStrokeStyle(p.Color.fromCssColorString("white"),this.strokeWidth)):this._strokeColor?this.setStrokeStyle(this._strokeColor,this.strokeWidth):this.setStrokeStyle(void 0,void 0))}function v(c){if(this._editMode!=c)if(o.disableAllHighlights(),c){o.setEdited(this);var y=o._scene,g=this;if(this._markers==null){let k=function(I,D){var F=I-1<0?D.length-1:I-1;F<m.countBillboards()&&(m.getBillboard(F).position=Y(F)),F=I,F<m.countBillboards()&&(m.getBillboard(F).position=Y(F))},V=function(){g.executeListeners({name:"onEdited",positions:g.positions})},Y=function(I){var D=g.positions;return e.cartographicToCartesian(new p.EllipsoidGeodesic(e.cartesianToCartographic(D[I]),e.cartesianToCartographic(D[I<D.length-1?I+1:0])).interpolateUsingFraction(.5))};var E=new n.BillboardGroup(o,N),m=new n.BillboardGroup(o,U),w={dragHandlers:{onDrag:function(I,D){g.positions[I]=D,k(I,g.positions),g._createPrimitive=!0},onDragEnd:function(I,D){g._createPrimitive=!0,V()}},onDoubleClick:function(I){g.positions.length<4||(g.positions.splice(I,1),g._createPrimitive=!0,E.removeBillboard(I),m.removeBillboard(I),k(I,g.positions),V())},tooltip:function(){if(g.positions.length>3)return"Double click to remove this point"}};E.addBillboards(g.positions,w),this._markers=E;for(var M=[],_=0,b=g.positions.length+(this.isPolygon?0:-1);_<b;_++)M.push(Y(_));var P={dragHandlers:{onDragStart:function(I,D){this.index=I+1,g.positions.splice(this.index,0,D),g._createPrimitive=!0},onDrag:function(I,D){g.positions[this.index]=D,g._createPrimitive=!0},onDragEnd:function(I,D){E.insertBillboard(this.index,D,w),m.getBillboard(this.index-1).position=Y(this.index-1),m.insertBillboard(this.index,Y(this.index),P),g._createPrimitive=!0,V()}},tooltip:function(){return"Drag to create a new point"}};m.addBillboards(M,P),this._editMarkers=m,this._globeClickhandler=new p.ScreenSpaceEventHandler(y.canvas),this._globeClickhandler.setInputAction(function(I){var D=y.pick(I.position);D&&D.primitive||g.setEditMode(!1)},p.ScreenSpaceEventType.LEFT_CLICK),E.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}ye.PolylinePrimitive.prototype.setEditable=function(){if(!this.setEditMode){var c=this;c.isPolygon=!1,c.asynchronous=!1,o.registerEditableShape(c),c.setEditMode=v;var y=this.width;c.setHighlighted=function(g){this._editMode!==!0&&(g?(o.setHighlighted(this),this.setWidth(y*2)):this.setWidth(y))},c.getExtent=function(){return p.Rectangle.fromCartographicArray(e.cartesianArrayToCartographicArray(this.positions))},J(c),c.setEditMode(!1)}},ye.PolygonPrimitive.prototype.setEditable=function(){var c=this;c.asynchronous=!1,o._scene,o.registerEditableShape(c),c.setEditMode=v,c.setHighlighted=a,J(c),c.setEditMode(!1)},ye.ExtentPrimitive.prototype.setEditable=function(){if(!this.setEditMode){var c=this,y=o._scene;o.registerEditableShape(c),c.asynchronous=!1,c.setEditMode=function(g){if(this._editMode!=g)if(o.disableAllHighlights(),g){if(o.setEdited(this),this._markers==null){let w=function(){c.executeListeners({name:"onEdited",extent:c.extent})};var E=new n.BillboardGroup(o,N),m={dragHandlers:{onDrag:function(M,_){var b=E.getBillboard((M+2)%4).position;c.setExtent(ee(e.cartesianToCartographic(b),e.cartesianToCartographic(_))),E.updateBillboardsPositions(Z(c.extent))},onDragEnd:function(M,_){w()}},tooltip:function(){return"Drag to change the corners of this extent"}};E.addBillboards(Z(c.extent),m),this._markers=E,this._globeClickhandler=new p.ScreenSpaceEventHandler(y.canvas),this._globeClickhandler.setInputAction(function(M){var _=y.pick(M.position);_&&!_.isDestroyed()&&_.primitive||c.setEditMode(!1)},p.ScreenSpaceEventType.LEFT_CLICK),E.setOnTop()}this._editMode=!0}else this._markers!=null&&(this._markers.remove(),this._markers=null,this._globeClickhandler.destroy()),this._editMode=!1},c.setHighlighted=a,J(c),c.setEditMode(!1)}},n.EllipsePrimitive.prototype.setEditable=function(){if(!this.setEditMode){var c=this,y=o._scene;c.asynchronous=!1,o.registerEditableShape(c),c.setEditMode=function(g){if(this._editMode!=g)if(o.disableAllHighlights(),g){o.setEdited(this);var E=this;if(this._markers==null){let M=function(){return p.EllipseOutlineGeometry(e,c.getCenter(),c.getSemiMajorAxis(),c.getSemiMinorAxis(),c.getRotation()+Math.PI/2,Math.PI/2).splice(0,4)},_=function(){c.executeListeners({name:"onEdited",center:c.getCenter(),semiMajorAxis:c.getSemiMajorAxis(),semiMinorAxis:c.getSemiMinorAxis(),rotation:0})};var m=new n.BillboardGroup(o,N),w={dragHandlers:{onDrag:function(b,P){var k=p.Cartesian3.distance(c.getCenter(),P);b%2==0?c.setSemiMajorAxis(k):c.setSemiMinorAxis(k),m.updateBillboardsPositions(M())},onDragEnd:function(b,P){_()}},tooltip:function(){return"Drag to change the excentricity and radius"}};m.addBillboards(M(),w),this._markers=m,this._globeClickhandler=new p.ScreenSpaceEventHandler(y.canvas),this._globeClickhandler.setInputAction(function(b){var P=y.pick(b.position);P&&P.primitive||E.setEditMode(!1)},p.ScreenSpaceEventType.LEFT_CLICK),m.setOnTop()}this._editMode=!0}else this._markers!=null&&(this._markers.remove(),this._markers=null,this._globeClickhandler.destroy()),this._editMode=!1},c.setHighlighted=a,J(c),c.setEditMode(!1)}},n.CirclePrimitive.prototype.getCircleCartesianCoordinates=function(c){for(var y=p.CircleOutlineGeometry.createGeometry(new p.CircleOutlineGeometry({ellipsoid:e,center:this.getCenter(),radius:this.getRadius(),granularity:c})),g=0,E,m=[];g<y.attributes.position.values.length;g+=3)E=y.attributes.position.values,m.push(new p.Cartesian3(E[g],E[g+1],E[g+2]));return m},n.CirclePrimitive.prototype.setEditable=function(){if(!this.setEditMode){var c=this,y=o._scene;c.asynchronous=!1,o.registerEditableShape(c),c.setEditMode=function(g){if(this._editMode!=g)if(o.disableAllHighlights(),g){o.setEdited(this);var E=this;if(this._markers==null){let M=function(){return E.getCircleCartesianCoordinates(p.Math.PI_OVER_TWO)},_=function(){c.executeListeners({name:"onEdited",center:c.getCenter(),radius:c.getRadius()})};var m=new n.BillboardGroup(o,N),w={dragHandlers:{onDrag:function(b,P){c.setRadius(p.Cartesian3.distance(c.getCenter(),P)),m.updateBillboardsPositions(M())},onDragEnd:function(b,P){_()}},tooltip:function(){return"Drag to change the radius"}};m.addBillboards(M(),w),this._markers=m,this._globeClickhandler=new p.ScreenSpaceEventHandler(y.canvas),this._globeClickhandler.setInputAction(function(b){var P=y.pick(b.position);P&&P.primitive||E.setEditMode(!1)},p.ScreenSpaceEventType.LEFT_CLICK),m.setOnTop()}this._editMode=!0}else this._markers!=null&&(this._markers.remove(),this._markers=null,this._globeClickhandler.destroy()),this._editMode=!1},c.setHighlighted=a,J(c),c.setEditMode(!1)}}},n.DrawHelperWidget=function(){function o(a,v){if(!p.defined(v.container))throw new p.DeveloperError("Container is required");var c={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:L,polygonDrawingOptions:u,extentDrawingOptions:h,circleDrawingOptions:C};X(v,c);var y=this,g=document.createElement("DIV");g.className="toolbar",v.container.appendChild(g);function E(M,_,b,P){var k=document.createElement("DIV");k.className="button",k.title=b,g.appendChild(k),k.onclick=P;var V=document.createElement("SPAN");k.appendChild(V);var Y=document.createElement("IMG");return Y.src=_,V.appendChild(Y),k}var m=a._scene;E("marker",v.markerIcon,"Click to start drawing a 2D marker",function(){a.startDrawingMarker({callback:function(M){y.executeListeners({name:"markerCreated",position:M})}})}),E("polyline",v.polylineIcon,"Click to start drawing a 2D polyline",function(){a.startDrawingPolyline({callback:function(M){y.executeListeners({name:"polylineCreated",positions:M})}})}),E("polygon",v.polygonIcon,"Click to start drawing a 2D polygon",function(){a.startDrawingPolygon({callback:function(M){y.executeListeners({name:"polygonCreated",positions:M})}})}),E("extent",v.extentIcon,"Click to start drawing an Extent",function(){a.startDrawingExtent({callback:function(M){y.executeListeners({name:"extentCreated",extent:M})}})}),E("circle",v.circleIcon,"Click to start drawing a Circle",function(){a.startDrawingCircle({callback:function(M,_){y.executeListeners({name:"circleCreated",center:M,radius:_})}})});var w=document.createElement("DIV");w.className="divider",g.appendChild(w),E("clear",v.clearIcon,"Remove all primitives",function(){m.primitives.removeAll()}),J(this)}return o}(),n.prototype.addToolbar=function(o,a){return a=B(a,{container:o}),new n.DrawHelperWidget(this,a)};function ee(o,a){var v=new p.Rectangle;v.west=Math.min(o.longitude,a.longitude),v.east=Math.max(o.longitude,a.longitude),v.south=Math.min(o.latitude,a.latitude),v.north=Math.max(o.latitude,a.latitude);var c=p.Math.EPSILON7;return v.east-v.west<c&&(v.east+=c*2),v.north-v.south<c&&(v.north+=c*2),v}function j(o,a){return o.longitude.toFixed(a||3)+", "+o.latitude.toFixed(a||3)}function $(o,a){if(o==null||typeof o!="object"||o.constructor!=Object&&o.constructor!=Array)return o;if(o.constructor==Date||o.constructor==RegExp||o.constructor==Function||o.constructor==String||o.constructor==Number||o.constructor==Boolean)return new o.constructor(o);a=a||new o.constructor;for(var v in o)a[v]=typeof a[v]>"u"?$(o[v],null):a[v];return a}function X(o,a){o=o||{};var v;for(v in a)o[v]===void 0&&(o[v]=$(a[v]))}function B(o,a){var v=$(o),c;for(c in a)v[c]===void 0&&(v[c]=$(a[c]));return v}function q(o,a,v){o[a]=v}function J(o){o._listeners={},o.addListener=function(a,v){return this._listeners[a]=this._listeners[a]||[],this._listeners[a].push(v),this._listeners[a].length},o.executeListeners=function(a,v){if(this._listeners[a.name]&&this._listeners[a.name].length>0)for(var c=0;c<this._listeners[a.name].length;c++)this._listeners[a.name][c](a);else v&&v(a)}}return n}();const ei=2,ti=(e,i)=>{switch(e){case re.BOX:{if(i.features.length!==ei)throw new Error(`${e} must have 2 points`);const t=H.find(i.features,l=>{var s;return((s=l.properties)==null?void 0:s.type)===Se.BOTTOM_LEFT}),n=H.find(i.features,l=>{var s;return((s=l.properties)==null?void 0:s.type)===Se.TOP_RIGHT});if(n&&t){if(t.geometry.coordinates[0]===n.geometry.coordinates[0]&&t.geometry.coordinates[1]===n.geometry.coordinates[1])throw new Error(`${e} must define BOTTOM_LEFT and TOP_RIGHT different points`);return S.Rectangle.fromDegrees(t.geometry.coordinates[0],t.geometry.coordinates[1],n.geometry.coordinates[0],n.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`)}},ni=e=>{const i=e.map(t=>{const n=S.Cartographic.fromCartesian(t);return[S.Math.toDegrees(n.longitude),S.Math.toDegrees(n.latitude)]});return i.push(i[0]),{type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[i]}}},ii=e=>{const i=Xe.lineString([[S.Math.toDegrees(e.west),S.Math.toDegrees(e.south)],[S.Math.toDegrees(e.east),S.Math.toDegrees(e.north)]]);return Ke(qe(i))},ri=e=>{const i=Xe.lineString([[e.west,e.south],[e.east,e.north]]);return Ke(qe(i)).geometry.coordinates[0].map(n=>S.Cartesian3.fromRadiansArray(n)[0])};class oi extends S.Color{}const si=e=>{const{drawState:i,drawingMaterial:t,drawingVertexColor:n,material:l,hollow:s,outlineWidth:u}=e,h=ue(),[C,T]=d.useState();d.useEffect(()=>{T(new ye(h,t,n))},[]),d.useEffect(()=>{if(C){const O=C;if(i.drawing)switch(i.type){case re.POLYGON:h.scene.globe.depthTestAgainstTerrain=!1,O.startDrawingPolygon({callback:A=>{i.handler({primitive:A,type:re.POLYGON,geojson:ni(A)})}});break;case re.BOX:h.scene.globe.depthTestAgainstTerrain=!1,O.startDrawingExtent({callback:A=>{i.handler({primitive:A,type:re.BOX,geojson:ii(A)})}});break;default:throw new Error(`[CESIUM DRAW]: ${i.type} unrecognized primitive to draw.`)}else O.stopDrawing(),h.scene.globe.depthTestAgainstTerrain=!0}},[i,C]);const L=O=>{let A=O.coordinates!==void 0?O.coordinates:ti(O.type,O.geojson);if(s!==!0)switch(O.type){case re.BOX:return r.jsx(Et,{coordinates:A,material:l??t});case re.POLYGON:return r.jsx(vt,{hierarchy:new S.PolygonHierarchy(A),material:l??t});default:return r.jsx(r.Fragment,{})}else{switch(O.type){case re.BOX:A=ri(A);break;case re.POLYGON:A=[...A,A[0]];break;default:return r.jsx(r.Fragment,{})}return r.jsx(Rn,{positions:A,width:u??1,material:l??t})}};return r.jsx(Ct,{...e,children:e.drawings.map((O,A)=>r.jsxs(mt,{name:O.name,children:[r.jsxs(yt,{children:[r.jsxs("h1",{children:["Drawed Entity ",O.name]}),r.jsx("p",{children:"This is description of drawed entity"})]}),L(O)]},O.id))})};class ai extends S.PolylineDashMaterialProperty{}class li extends S.ConstantProperty{}class ci extends S.ConstantPositionProperty{}class di extends S.Cartesian2{}class ui extends S.Cartesian3{}class hi extends S.Cartographic{}class gi extends S.BoundingSphere{}class pi extends S.Ellipsoid{}class fi extends S.GeographicTilingScheme{}class mi extends S.Rectangle{}class yi extends S.Resource{}class vi extends S.EllipsoidTerrainProvider{}class Ei extends S.CesiumTerrainProvider{}const Ci=S.VerticalOrigin,wi=S.LabelStyle,ar="",Si=38,Ti=40,bi=13,_i=14,Mi=27,Pi=9,Li=10,Ai=100,ki=e=>{const[i,t]=d.useState(e.defaultValue??""),[n,l]=d.useState(!1),[s,u]=d.useState({helperVisible:!1,left:0,right:0,trigger:"",matchLength:0,matchStart:0,options:[],selection:0,top:0,value:"",caret:0,width:"unset"}),h=d.useRef(null);d.useEffect(()=>(window.addEventListener("resize",U),()=>{try{window.removeEventListener("resize",U)}catch(y){console.log('WINDOW "resize" remove listener failed',y)}}),[]),d.useEffect(()=>{typeof e.value<"u"&&t(e.value),typeof e.defaultValue<"u"&&t(e.defaultValue)},[e.value,e.defaultValue]),d.useEffect(()=>{const{options:y}=e,{caret:g}=s;ee(i,g,y)},[e]);const C=(y,g,E)=>{const{trigger:m,matchAny:w,regex:M}=e,_=new RegExp(M);let b=m;Array.isArray(b)||(b=new Array(m)),b.sort();const P={};Array.isArray(E)&&b.forEach(Y=>{P[Y]=E});const k=T(b,_);let V={};for(let Y=0;Y<k.length;Y++){const{triggerStr:I,triggerMatch:D,triggerLength:F}=k[Y];for(let z=g-1;z>=0;--z){const ae=y.substring(z,g).match(_);let ne=-1;if(F>0){const ce=D?z:z-F+1;if(ce<0||(L(I,y,ce)&&(ne=ce+F),!ae&&ne<0))break}else{if(ae&&z>0)continue;if(ne=z===0&&ae?0:z+1,g-ne===0)break}if(ne>=0){const ce=P[I];if(!Array.isArray(ce))continue;const Ce=y.substring(ne,g),Vi=ce.filter($i=>{const St=$i.toLowerCase().indexOf(Ce.toLowerCase());return St!==-1&&(w||St===0)}),zi=I,Wi=Ce.length;V={...V,trigger:zi,matchStart:ne,matchLength:Wi,options:Vi}}}}return V},T=(y,g)=>y.map(m=>({triggerStr:m,triggerMatch:m.match(g),triggerLength:m.length})),L=(y,g,E)=>!y||!y.length||g.substr(E,y.length)===y,O=y=>{const{onChange:g,options:E,spaceRemovers:m,spacer:w,value:M}=e,_=i,b=y.target.value,P=je(A(y.target)).end;if(b.length||G({...s,helperVisible:!1}),t(b),G({...s,caret:P,value:y.target.value}),!b.length||!P)return g(y.target.value);if(n&&m.length&&b.length>2&&w.length){for(let k=0;k<Math.max(_.length,b.length);++k)if(_[k]!==b[k]){if(k>=2&&b[k-1]===w&&m.indexOf(b[k-2])===-1&&m.indexOf(b[k])!==-1&&!H.isEmpty(C(b.substring(0,k-2),P-3,E))){const V=`${b.slice(0,k-1)}${b.slice(k,k+1)}${b.slice(k-1,k)}${b.slice(k+1)}`;return R(k+1),h.current!==null&&(h.current.value=V),M||G({...s,value:V}),g(V)}break}l(!1)}return ee(b,P,E),g(y.target.value)},A=y=>{if(y!==void 0)if(y.children.length>0){const g=y.getElementsByTagName("textarea");if(g.length>0)return g[0];const E=y.getElementsByTagName("input");if(E.length>0)return E[0]}else return y},N=y=>{const{helperVisible:g,options:E,selection:m}=s,{onKeyDown:w,passThroughEnter:M}=e;if(g)switch(y.keyCode){case Mi:y.preventDefault(),j();break;case Si:y.preventDefault(),G({...s,selection:(E.length+m-1)%E.length});break;case Ti:y.preventDefault(),G({...s,selection:(m+1)%E.length});break;case _i:case bi:M||y.preventDefault(),Z(m);break;case Pi:Z(m);break;default:w(y);break}else w(y)},U=()=>{G({...s,helperVisible:!1})},Z=y=>{const{spacer:g,onSelect:E,changeOnSelect:m}=e,{matchStart:w,matchLength:M,options:_,trigger:b}=s,P=_[y],k=i,V=k.substring(0,w-b.length),Y=k.substring(w+M),I={target:h.current},D=m(b,P);I.target!==null&&(I.target.value=`${V}${D}${g}${Y}`),O(I),I.target!==null&&E(I.target.value),j(),R(V.length+D.length+1),l(!0)},R=y=>{G({...s,caret:y});const g=A(h.current);je.setCaretPosition(g,y)},G=y=>{setTimeout(()=>{u({...y})},0)},ee=(y,g,E)=>{const m=h.current;if(h.current===null)return;const w=A(m);if(w===void 0)return;const M=m.getBoundingClientRect(),_=C(y,g,E);if(Object.keys(_).length>0&&w!==null){const b=xt(w,g),P=w.getBoundingClientRect(),{minChars:k,onRequestOptions:V,requestOnlyIfNoOptions:Y,mode:I}=e;let D,F,z,me="unset";I==="assist"?(D=m===w?b.top+w.offsetTop:b.top+M.top,F=Math.min(b.left+w.offsetLeft-Li,w.offsetLeft+P.width-Ai)):(D=M.top+m.offsetHeight,F=m.offsetLeft,z=m.offsetLeft-m.offsetWidth,me=`${M.width}px`),_.matchLength>=k&&(_.options.length>1||_.options.length===1&&_.options[0].length!==_.matchLength)?G({...s,value:y,helperVisible:!0,top:D,left:F,right:z,width:me,..._}):((!Y||!_.options.length)&&V(y.substr(_.matchStart,_.matchLength)),j())}else j()},j=()=>{setTimeout(()=>{G({...s,helperVisible:!1,selection:0})},100)},$=()=>{const{helperVisible:y,left:g,right:E,matchStart:m,matchLength:w,options:M,selection:_,top:b,value:P,width:k}=s;if(!y)return null;const{maxOptions:V,offsetX:Y,offsetY:I,direction:D}=e;if(M.length===0)return null;if(_>=M.length)return G({...s,selection:0}),null;const F=V===0?M.length:V,z=M.slice(0,F).map((ae,ne)=>{const ce=ae.toLowerCase().indexOf(P.substr(m,w).toLowerCase());return r.jsxs("li",{className:ne===_?"active":void 0,onClick:()=>{Z(ne)},onMouseEnter:()=>{G({...s,selection:ne})},children:[ae.slice(0,ce),r.jsx("strong",{children:ae.substr(ce,w)}),ae.slice(ce+w)]},ae)}),me=D==="ltr"?{left:g+Y}:{right:E+Y};return r.jsx("ul",{className:"react-autocomplete-input",style:{...me,top:b+I,width:k},children:z})},{Component:X,ComponentProps:B,defaultValue:q,disabled:J,onBlur:o,value:a,...v}=e,c=Object.assign({},v);return Object.keys(e).forEach(y=>{delete c[y]}),r.jsxs(r.Fragment,{children:[d.cloneElement(X,{disabled:J,onBlur:o,onChange:O,onKeyDown:N,ref:h,value:i,...c,...B}),$()]})},Ii={Component:r.jsx("textarea",{}),ComponentProps:{},defaultValue:void 0,disabled:!1,maxOptions:6,onBlur:e=>{},onChange:e=>{},onKeyDown:e=>{},onRequestOptions:e=>{},onSelect:e=>{},changeOnSelect:(e,i)=>`${e}${i}`,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"},Oi=e=>{let i={...Ii,...e};return e.mode==="autocomplete"&&(i={...i,trigger:"",regex:".",spacer:""}),r.jsx(ki,{...i})},Ae={formatFileModDate:(e,i)=>{const t=x.FileHelper.getModDate(i);return t?e.formatDate(t,{dateStyle:"short",timeStyle:"short"}):null},formatFileSize:(e,i)=>{if(!i||typeof i.size!="number")return null;const t=i.size,n=Nt(t,{bits:!1,output:"object"});return n.symbol==="B"?`${Math.round(n.value/10)/100} KB`:n.symbol==="KB"?`${Math.round(n.value)} ${n.symbol}`:`${n.value} ${n.symbol.toUpperCase()}`}},Di={locale:le.EN,formatters:{...Ae}},xi={locale:le.RU,formatters:{...Ae},messages:{"chonky.toolbar.searchPlaceholder":"Поиск","chonky.toolbar.visibleFileCount":`{fileCount, plural,
1
+ (function(f,r){typeof exports=="object"&&typeof module<"u"?r(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("@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("@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/helpers"),require("@turf/bbox"),require("@turf/bbox-polygon"),require("textarea-caret"),require("get-input-selection"),require("chonky"),require("chonky-icon-fontawesome"),require("filesize")):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","@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","@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/helpers","@turf/bbox","@turf/bbox-polygon","textarea-caret","get-input-selection","chonky","chonky-icon-fontawesome","filesize"],r):(f=typeof globalThis<"u"?globalThis:f||self,r(f.reactComponents={},f.jsxRuntime,f.React,f.dateFns,f.locale,f.pickers,f.DateFnsUtils,f.styles,f.core,f.reactCore,f.useMediaQuery,f.rewind,f.ol,null,f.coordinate,f.control,f.MousePosition,f.proj,f.layer,f.source,f.format,f.interaction,f.Draw,f.TableHead,f.utils,f.CssBaseline,f.ScopedCssBaseline,f.ReactDOM,f.resium,f.Cesium,f.lodash,f.booleanPointInPolygon,f.turf,f.bbox,f.bboxPolygon,f.getCaretCoordinates,f.getInputSelection,f.chonky,f.chonkyIconFontawesome,f.filesize))})(this,function(f,r,d,fe,we,ve,He,pe,K,W,bt,_t,Ve,Xi,ze,Ie,ke,Mt,We,Ue,$e,Pt,Lt,At,qe,It,kt,Dt,he,S,H,Ot,xt,Ke,je,Bt,Ye,x,Nt,Ft){"use strict";var ji=Object.defineProperty;var Yi=(f,r,d)=>r in f?ji(f,r,{enumerable:!0,configurable:!0,writable:!0,value:d}):f[r]=d;var te=(f,r,d)=>(Yi(f,typeof r!="symbol"?r+"":r,d),d);function De(e){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(i,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return i.default=e,Object.freeze(i)}const Xe=De(d),p=De(S),Ze=De(xt);var re=(e=>(e.BOX="BOX",e.POLYGON="POLYGON",e.UNKNOWN="UNKNOWN",e))(re||{}),le=(e=>(e.HE="he",e.EN="en",e.RU="ru",e))(le||{}),Se=(e=>(e.TOP_RIGHT="TOP_RIGHT",e.BOTTOM_LEFT="BOTTOM_LEFT",e))(Se||{});const Q={DATE_PICKER:{dateFormat:"dd/MM/yyyy",local:{setText:"set",placeHolderText:"Enter the Date",calendarLocale:le.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:le.EN},renderAsButton:!0,offset:0,disableFuture:!0}},se=e=>{const{children:i,...t}=e;return r.jsx(K.Box,{...t,children:i})},Oe=e=>{const i=e.type==="dark";return d.useMemo(()=>Je(e,i),[i,e])},Je=(e,i=!1)=>pe.createTheme({palette:{type:i?"dark":"light",primary:{main:e.primary},secondary:{main:e.secondary},error:{main:e.error},background:{default:e.surface,paper:e.background},text:{primary:i?e.textPrimaryOnDark:e.textPrimaryOnLight,secondary:i?e.textSecondaryOnDark:e.textSecondaryOnLight}}}),Zi="",Gt=2,Ht=.5,Vt=pe.makeStyles(e=>pe.createStyles({container:{padding:e.spacing(Gt),alignItems:"center"},setButton:{marginTop:e.spacing(1)},margin:{marginLeft:e.spacing(Ht)}})),Qe=e=>{var j,U,X,B;const i=Vt(),t=W.useTheme(),n=Oe(t),[l,s]=d.useState(null),[u,h]=d.useState(null),[C,T]=d.useState(Q.DATE_RANGE_PICKER.dateFormat),L=e.controlsLayout??Q.DATE_RANGE_PICKER.controlsLayout,D=e.disableFuture??Q.DATE_RANGE_PICKER.disableFuture,A=((j=e.local)==null?void 0:j.startPlaceHolderText)??Q.DATE_RANGE_PICKER.local.startPlaceHolderText,N=((U=e.local)==null?void 0:U.endPlaceHolderText)??Q.DATE_RANGE_PICKER.local.endPlaceHolderText,$=((X=e.local)==null?void 0:X.setText)??Q.DATE_RANGE_PICKER.local.setText,R=(((B=e.local)==null?void 0:B.calendarLocale)??Q.DATE_RANGE_PICKER.local.calendarLocale)===le.HE?we.he:we.enUS;d.useEffect(()=>{s(e.from??null)},[e.from]),d.useEffect(()=>{h(e.to??null)},[e.to]),d.useEffect(()=>{T(e.dateFormat??Q.DATE_RANGE_PICKER.dateFormat)},[e.dateFormat]);const G=Boolean(fe.isValid(l)&&!u||fe.isValid(u)&&!l||l&&u&&fe.isValid(l)&&fe.isValid(u)&&fe.isBefore(l,u)),ee=()=>{e.onChange({from:l&&fe.isValid(l)?l:void 0,to:u&&fe.isValid(u)?u:void 0})};return r.jsx(K.ThemeProvider,{theme:n,children:r.jsx(se,{className:`${i.container} drpContainer`,display:"flex",flexDirection:L,width:L==="column"?e.contentWidth:"unset",children:r.jsxs(ve.MuiPickersUtilsProvider,{utils:He,locale:R,children:[r.jsx(ve.KeyboardDateTimePicker,{variant:"inline",placeholder:A,onChange:q=>s(q),value:l,disableFuture:D,format:C,maxDate:e.maxDate,minDate:e.minDate}),r.jsx(ve.KeyboardDateTimePicker,{variant:"inline",placeholder:N,className:i.margin,onChange:q=>h(q),value:u,disableFuture:D,format:C,maxDate:e.maxDate,minDate:e.minDate}),r.jsx(W.ThemeProvider,{options:t,children:r.jsx(W.Button,{className:`${i.setButton} ${i.margin}`,raised:!0,onClick:ee,disabled:!G,children:$})})]})})})},Re=e=>{const{children:i,...t}=e;return r.jsx(K.Popover,{...t,children:i})},Ji="",zt=e=>{var U,X;const[i,t]=d.useState(null),[n,l]=d.useState(null),[s,u]=d.useState(Q.DATE_RANGE_PICKER.dateFormat),[h,C]=d.useState(null),T=B=>{C(B.currentTarget)},L=B=>{B.currentTarget.tagName==="I"?C(B.currentTarget.previousElementSibling):C(B.currentTarget)},D=()=>{C(null)},A=Boolean(h),N=e.controlsLayout??"column";d.useEffect(()=>{t(e.from??null)},[e.from]),d.useEffect(()=>{l(e.to??null)},[e.to]),d.useEffect(()=>{u(e.dateFormat??Q.DATE_RANGE_PICKER.dateFormat)},[e.dateFormat]);const $=((U=e.local)==null?void 0:U.startPlaceHolderText)??Q.DATE_RANGE_PICKER.local.startPlaceHolderText,Z=((X=e.local)==null?void 0:X.endPlaceHolderText)??Q.DATE_RANGE_PICKER.local.endPlaceHolderText,R=e.renderAsButton===void 0?Q.DATE_RANGE_PICKER.renderAsButton:e.renderAsButton,G=e.offset===void 0?Q.DATE_RANGE_PICKER.offset:e.offset,ee=e.disableFuture===void 0?Q.DATE_RANGE_PICKER.disableFuture:e.disableFuture,j=d.useMemo(()=>`${i?fe.format(i,s):$} - ${n?fe.format(n,s):Z}`,[i,n,s,$,Z]);return r.jsxs(r.Fragment,{children:[R?r.jsx(W.Button,{style:{width:e.width},raised:!0,onClick:T,className:"drpOpener",children:j}):r.jsx(W.TextField,{className:"drpOpener",readOnly:!0,style:{width:e.width},value:j,onClick:L,trailingIcon:{icon:"date_range",tabIndex:0,onClick:L}}),r.jsx(Re,{open:A,anchorEl:h,onClose:D,anchorOrigin:{vertical:"bottom",horizontal:"left"},keepMounted:!0,children:r.jsx(Qe,{controlsLayout:N,contentWidth:((h==null?void 0:h.clientWidth)??0)-G,dateFormat:s,disableFuture:ee,minDate:e.minDate,maxDate:e.maxDate,local:e.local,from:i??void 0,to:n??void 0,onChange:({from:B,to:q})=>{t(B??null),l(q??null),e.onChange({from:B,to:q}),D()}})})]})},Qi="",Wt=e=>{const i=W.useTheme(),t=Oe(i),[n,l]=d.useState(e.value),{format:s=Q.DATE_PICKER.dateFormat,variant:u=Q.DATE_PICKER.variant,disableFuture:h=Q.DATE_PICKER.disableFuture,local:C,onChange:T,showTime:L=Q.DATE_PICKER.showTime,value:D,...A}=e,{placeHolderText:N=Q.DATE_PICKER.local.placeHolderText,calendarLocale:$}=C??{placeHolderText:Q.DATE_PICKER.local.placeHolderText,calendarLocale:le.EN},Z=$===le.HE?we.he:we.enUS,R=G=>{l(G),T(G)};return r.jsx(K.ThemeProvider,{theme:t,children:r.jsxs(ve.MuiPickersUtilsProvider,{utils:He,locale:Z,children:[L&&r.jsx(ve.KeyboardDateTimePicker,{variant:u,placeholder:N,onChange:R,value:n,disableFuture:h,format:s,...A}),!L&&r.jsx(ve.KeyboardDatePicker,{variant:u,placeholder:N,onChange:R,value:n,disableFuture:h,format:s,...A})]})})},Ut=18,$t=pe.makeStyles(e=>pe.createStyles({drawingButton:{width:e.spacing(Ut)},fullWidth:{width:"100%",marginTop:"36px"}})),qt=e=>{const i=$t(),[t,n]=d.useState(null),{isSelectionEnabled:l,onCancelDraw:s,onStartDraw:u,onReset:h}=e,C=L=>{n(L.currentTarget)},T=()=>{n(null)};return l?r.jsx(W.Tooltip,{content:"Cancel the ongoing draw",align:"bottomLeft",children:r.jsx(W.Button,{className:i.drawingButton,raised:!0,onClick:s,children:"Cancel Draw"})}):r.jsxs(se,{position:"relative",children:[r.jsx(W.Tooltip,{content:"draw an Area of interest to limit the search",align:"bottomLeft",children:r.jsx(W.Button,{className:i.drawingButton,raised:!0,onClick:C,children:"Draw AOI"})}),r.jsxs(W.Menu,{className:i.fullWidth,open:Boolean(t),onClose:T,children:[r.jsx(W.MenuItem,{onClick:()=>{u(re.POLYGON),T()},children:"Polygon"}),r.jsx(W.MenuItem,{onClick:()=>{u(re.BOX),T()},children:"Box"}),r.jsx(W.MenuItem,{onClick:()=>{h(),T()},children:"Clear"})]})]})},Ri="";var de=(e=>(e.WGS84="EPSG:4326",e.WEB_MERCATOR="EPSG:3857",e))(de||{});const Te=5,be=2,et=d.createContext(null),Kt=et.Provider,tt=35,nt=32,jt=10,Yt=e=>e!==void 0&&e!==de.WGS84?Mt.transform([tt,nt],de.WGS84,e):[tt,nt],Xt=e=>{switch(e){case de.WEB_MERCATOR:return i=>ze.format(i,"Mercator: {y}m, {x}m",be);case de.WGS84:return i=>ze.format(i,"WGS84: {y}°N {x}°E",Te);default:return i=>""}},xe=()=>{const e=d.useContext(et);if(e===null)throw new Error("map context is null, please check the provider");return e},Zt=e=>{const i=d.useRef(null),{allowFullScreen:t,showMousePosition:n,projection:l}=e,[s]=d.useState(new Ve.Map({view:new Ve.View({projection:l??de.WGS84}),controls:Ie.defaults()}));d.useEffect(()=>{s.getView().setCenter(e.center??Yt(e.projection))},[s,e.center,e.projection]),d.useEffect(()=>{s.getView().setZoom(e.zoom??jt)},[s,e.zoom,e.projection]);const u=(h,C)=>{C.getControls().forEach(L=>{L instanceof h&&C.removeControl(L)})};return d.useEffect(()=>{s.setTarget(i.current),t!==void 0&&t?s.addControl(new Ie.FullScreen):u(Ie.FullScreen,s)},[s,t]),d.useEffect(()=>{n!==void 0&&n?(u(ke,s),s.addControl(new ke({coordinateFormat:Xt(l??de.WGS84),projection:l??de.WGS84,undefinedHTML:"&nbsp;"}))):u(ke,s)},[s,n,l]),r.jsxs(Kt,{value:s,children:[r.jsx("div",{className:"map",ref:i}),e.children]})},it=d.createContext(null),Jt=it.Provider,Qt=()=>{const e=d.useContext(it);if(e===null)throw new Error("tile layer context is null, please check the provider");return e},Rt=({options:e,children:i})=>{const t=xe(),[n]=d.useState(new We.Tile(e));return d.useEffect(()=>(t.addLayer(n),()=>{t.removeLayer(n)}),[t,n]),r.jsx(Jt,{value:n,children:i})},rt=d.createContext(null),en=rt.Provider,tn=()=>{const e=d.useContext(rt);if(e===null)throw new Error("vector layer context is null, please check the provider");return e},nn=({children:e})=>{const i=xe(),[t]=d.useState(new We.Vector);return d.useEffect(()=>(i.addLayer(t),()=>{i.removeLayer(t)}),[i,t]),r.jsx(en,{value:t,children:e})},ot=d.createContext(null),rn=ot.Provider,on=()=>{const e=d.useContext(ot);if(e===null)throw new Error("vector source context is null, please check the provider");return e},sn=({children:e})=>{const i=tn(),[t]=d.useState(new Ue.Vector);return d.useEffect(()=>{i.setSource(t)},[t,i]),r.jsx(rn,{value:t,children:e})},an=({geometry:e})=>{const i=on();return d.useEffect(()=>{const n=new $e.GeoJSON().readFeature(e);return i.addFeature(n),()=>{i.removeFeature(n)}},[e,i]),null},ln=e=>{const i=Qt();return d.useEffect(()=>{i.setSource(new Ue.OSM)},[i]),null},cn=({drawType:e,onPolygonSelected:i})=>{const t=xe();return d.useEffect(()=>{const n={type:"Circle"};switch(e){case re.BOX:n.geometryFunction=Lt.createBox();break;case re.POLYGON:n.type="Polygon";break;default:return}const l=new Pt.Draw(n);t.addInteraction(l);const s=u=>{const C=new $e.GeoJSON().writeGeometryObject(u.feature.getGeometry());i==null||i(C)};return l.on("drawend",s),()=>{l.un("drawend",s),t.removeInteraction(l)}},[i,e,t]),null},er="",dn=e=>{const i=t=>{const n=_t(t);e.onPolygonSelection(n)};return r.jsxs(Zt,{allowFullScreen:!0,showMousePosition:!0,children:[r.jsx(Rt,{children:r.jsx(ln,{})}),e.selectionPolygon&&r.jsx(nn,{children:r.jsx(sn,{children:r.jsx(an,{geometry:e.selectionPolygon})})}),e.children,e.drawType!==void 0&&r.jsx(cn,{drawType:e.drawType,onPolygonSelected:i})]})},Be=1.5,un=80,hn=pe.makeStyles(e=>pe.createStyles({map:{height:"100%",width:"100%",position:"absolute"},absolute:{position:"absolute",zIndex:1e3,left:e.spacing(Be),top:e.spacing(Be)},contentContainer:{marginTop:e.spacing(Be),width:e.spacing(un)},filtersContainer:{display:"flex",padding:e.spacing(1)},filtersMargin:{marginLeft:e.spacing(1)}})),gn=e=>{var C;const[i,t]=d.useState(),[n,l]=d.useState(),s=hn(),u=T=>{l(T),t(void 0),e.handlePolygonSelected(T)},h=()=>{l(void 0),e.handlePolygonReset()};return r.jsxs("div",{className:s.map,children:[r.jsxs("div",{className:`${s.absolute}`,children:[r.jsxs(K.Paper,{className:s.filtersContainer,children:[r.jsx(qt,{onCancelDraw:()=>t(void 0),onReset:h,onStartDraw:t,isSelectionEnabled:i!==void 0}),(C=e.filters)==null?void 0:C.map((T,L)=>r.jsx("div",{className:s.filtersMargin,children:T},L))]}),r.jsx(K.Paper,{color:"red",className:`${s.contentContainer}`,children:e.children})]}),r.jsx(dn,{children:e.mapContent,onPolygonSelection:u,drawType:i,selectionPolygon:n})]})};function pn(e){const{headCells:i,order:t,orderBy:n,onRequestSort:l,isCollapseable:s}=e,u=h=>C=>{l(C,h)};return r.jsx(At,{children:r.jsxs(K.TableRow,{children:[s&&r.jsx(K.TableCell,{}),i.map(h=>r.jsx(K.TableCell,{align:h.numeric?"right":"left",padding:h.disablePadding?"none":"default",sortDirection:n===h.id?t:!1,children:r.jsx(K.TableSortLabel,{active:n===h.id,direction:n===h.id?t:"asc",onClick:u(h.id),children:h.label})},h.id))]})})}const fn=qe.createSvgIcon(Xe.createElement("path",{d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"}),"KeyboardArrowDown"),mn=qe.createSvgIcon(Xe.createElement("path",{d:"M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"}),"KeyboardArrowUp");function yn(e){const{cellsMetadata:i,isRowSelected:t,item:n,onRowSelected:l,rowIndex:s,isCollapseable:u,collapsedElement:h}=e,[C,T]=d.useState(!1),L=i.length,D=()=>{l==null||l(s)};return r.jsxs(r.Fragment,{children:[r.jsxs(K.TableRow,{hover:!0,selected:t,onClick:D,children:[u&&r.jsx(K.TableCell,{padding:"checkbox",children:r.jsx(K.IconButton,{"aria-label":"expand row",size:"small",onClick:A=>{A.stopPropagation(),T(!C)},children:C?r.jsx(mn,{}):r.jsx(fn,{})})}),i.map(A=>r.jsx(K.TableCell,{align:A.numeric?"right":"left",padding:A.disablePadding?"none":"default",children:A.transform?A.transform(n[A.id]):n[A.id]},A.id+s.toString()))]}),u&&r.jsx(K.TableRow,{children:r.jsx(K.TableCell,{style:{paddingBottom:0,paddingTop:0},colSpan:L+1,children:r.jsx(K.Collapse,{in:C,unmountOnExit:!0,timeout:"auto",children:h==null?void 0:h(n)})})})]})}function vn(e){const[i,t]=d.useState(""),[n,l]=d.useState("asc"),{cellsMetadata:s,items:u,onRequestSort:h,onRowSelected:C,isCollapseable:T,collapsedElement:L,isDense:D,page:A,rowsPerPage:N,count:$,handleChangePage:Z,handleChangeRowsPerPage:R}=e,G=(ee,j)=>{const U=i===j&&n==="asc";l(U?"desc":"asc"),t(j),h(j,U?"desc":"asc")};return r.jsxs(K.TableContainer,{component:K.Paper,children:[r.jsxs(K.Table,{size:D?"small":"medium",children:[r.jsx(pn,{headCells:s,onRequestSort:G,order:n,orderBy:i,isCollapseable:T}),r.jsxs(K.TableBody,{children:[u.map((ee,j)=>r.jsx(yn,{item:ee,rowIndex:j,isCollapseable:T,cellsMetadata:s,collapsedElement:L,isRowSelected:!1,onRowSelected:C},j)),(u.length===0||N>u.length)&&r.jsx(K.TableRow,{style:{height:(D?33:53)*(N-u.length)},children:r.jsx(K.TableCell,{colSpan:T?s.length+1:s.length,children:u.length===0&&r.jsx(K.Typography,{align:"center",children:"No results :("})})})]})]}),r.jsx(K.TablePagination,{rowsPerPage:N,rowsPerPageOptions:[5,10],component:"div",count:$,page:A,onPageChange:Z,onRowsPerPageChange:R})]})}const En=e=>{const{children:i,...t}=e;return r.jsx(It,{...t,children:i})},Cn=e=>{const{children:i,...t}=e;return r.jsx(kt,{...t,children:i})},st=e=>e*Math.PI/180,_e=e=>e*(180/Math.PI),wn=e=>.05*(5916575505e-1/Math.pow(2,e-1)/2)*(Math.cos(st(85.362/2))/Math.sin(st(85.362/2))),tr="",Sn=e=>{const i=ue(),t=d.useRef(null),[n,l]=d.useState({x:0,y:0});return d.useEffect(()=>{i.screenSpaceEventHandler.setInputAction(s=>{s!=null&&s.endPosition&&l({...s.endPosition})},S.ScreenSpaceEventType.MOUSE_MOVE)},[t,i]),d.useEffect(()=>{const s=i.scene.globe.ellipsoid,u=i.camera.pickEllipsoid(new S.Cartesian3(n.x,n.y),s);if(u){const h=s.cartesianToCartographic(u);if(t.current){let C="";switch(e.projection){case de.WEB_MERCATOR:{const L=new S.WebMercatorProjection(s).project(h);C=`Mercator: ${L.y.toFixed(be)}m, ${L.x.toFixed(be)}m`,t.current.style.width="220px";break}case de.WGS84:{const T=S.Math.toDegrees(h.longitude).toFixed(Te);C=`WGS84: ${S.Math.toDegrees(h.latitude).toFixed(Te)}°N ${T}°E`,t.current.style.width="200px";break}}t.current.innerHTML=C}}},[n,t,i,e.projection]),r.jsx("div",{className:"trackerPosition",ref:t})},nr="",Ne=[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],Tn=(e,i,t,n)=>{const l=H.get(n,"METERS_UNIT")??"m",s=H.get(n,"KILOMETERS_UNIT")??"km",u={barWidth:void 0,distanceLabel:void 0,lastLegendUpdate:i.lastLegendUpdate},h=new S.EllipsoidGeodesic,C=new Date().getTime();if(C<u.lastLegendUpdate+250)return;u.lastLegendUpdate=C;const T=e.scene.canvas.clientWidth,L=e.scene.canvas.clientHeight,D=e.scene.camera.getPickRay(new S.Cartesian2(T/2|0,L-1)),A=e.scene.camera.getPickRay(new S.Cartesian2(1+T/2|0,L-1)),N=e.scene.globe,$=N.pick(D,e.scene),Z=N.pick(A,e.scene);if(!$||!Z)return;const R=N.ellipsoid.cartesianToCartographic($),G=N.ellipsoid.cartesianToCartographic(Z);h.setEndPoints(R,G);const ee=h.surfaceDistance,j=100;let U;for(let X=Ne.length-1;!H.isNumber(U)&&X>=0;--X)Ne[X]/ee<j&&(U=Ne[X]);if(H.isNumber(U)){let X="";U>=1e3?X=`${(U/1e3).toString()} ${s}`:X=`${U.toString()} ${l}`,u.barWidth=U/ee|0,u.distanceLabel=X}t(u)},bn=e=>{const i=ue(),[t,n]=d.useState({barWidth:void 0,distanceLabel:void 0,lastLegendUpdate:-1});d.useEffect(()=>{const s=C=>{Tn(i,t,n,e.locale)},u=new S.EventHelper,h=C=>{i.scene.globe.tilesLoaded&&(s(new MouseEvent("mouse")),u.removeAll())};return u.add(i.scene.globe.tileLoadProgressEvent,h),i.camera.moveEnd.addEventListener(s),()=>{try{H.get(i,"_cesiumWidget")!=null&&i.camera.moveEnd.removeEventListener(s)}catch(C){console.log('CESIUM camera "moveEnd" remove listener failed',C)}}},[i,e.locale,t]);const l=s=>5+(125-s)/2;return r.jsx("div",{className:"scalePosition",children:H.isNumber(t.barWidth)&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"distance-legend-label",children:t.distanceLabel}),r.jsx("div",{className:"distance-legend-scale-bar",style:{height:"2px",width:`${t.barWidth.toString()}px`,left:`${l(t.barWidth).toString()}px`}})]})})},ie={MORPHING:S.SceneMode.MORPHING,COLUMBUS_VIEW:S.SceneMode.COLUMBUS_VIEW,SCENE2D:S.SceneMode.SCENE2D,SCENE3D:S.SceneMode.SCENE3D},ir="",at=(e,i)=>{const n=H.get(i.scene.globe,"_surface.tileProvider"),l=n._quadtree,s=i.canvas.height,u=H.get(i.camera.frustum,"sseDenominator")??1;for(let h=0;h<=19;h++)if(n.getLevelMaximumGeometricError(h)*s/(e*u)<l.maximumScreenSpaceError)return h;return null},_n=(e,i)=>{e=e||10;const t=[];let n=1e5,l=0;for(let s=1e8;s>n;s=s-n){const u=at(s,i);if(u===null)break;if(u!==l){let h=s,C=s+n;for(;C-h>e;)s=h+(C-h)/2,at(s,i)===u?h=s:C=s;t.push({level:u,height:Math.round(s)}),l=u,t.length>=2&&(n=(t[t.length-2].height-s)/1e3)}}return t},Mn=e=>{const i=ue(),[t,n]=d.useState(1),l=_n(1,i);return d.useEffect(()=>{const s=()=>{const u=i.camera,h=.5;let C=0;switch(i.scene.mode){case ie.SCENE3D:C=i.scene.mapProjection.ellipsoid.cartesianToCartographic(u.positionWC).height;break;case ie.SCENE2D:C=(u.frustum.right-u.frustum.left)*h;break;case ie.COLUMBUS_VIEW:C=u.position.z;break;default:C=0;break}if(l.length>0){const T=l.reduce((L,D)=>Math.abs(D.height-C)<Math.abs(L.height-C)?D:L);n(T.level)}};return i.camera.moveEnd.addEventListener(s),()=>{try{H.get(i,"_cesiumWidget")!=null&&i.camera.moveEnd.removeEventListener(s)}catch(u){console.log('CESIUM camera "moveEnd"(from zoom tracker) remove listener failed',u)}}},[i,l.length]),r.jsxs("div",{className:"zoomLevel",children:[r.jsx("div",{className:"zoomLevelValue",children:t}),r.jsx("div",{className:"zoomLevelLabel",children:H.get(e.locale,"ZOOM_LABEL")??"zoom"})]})},rr="",Pn=-1,Ln=e=>{const i=ue(),[t,n]=d.useState(),{sceneModes:l}=e,s=u=>l.findIndex(h=>h===u)>Pn;return d.useEffect(()=>{n(i.scene.mode)},[]),r.jsxs(r.Fragment,{children:[s(ie.SCENE3D)&&r.jsx(W.Icon,{icon:r.jsx("div",{className:`mapViewIcon ${t===ie.SCENE3D?"mapViewCurrent":""}`,children:r.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 64 64",children:r.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:()=>{i.scene.morphTo3D(),n(ie.SCENE3D)}}),s(ie.SCENE2D)&&r.jsx(W.Icon,{icon:r.jsx("div",{className:`mapViewIcon ${t===ie.SCENE2D?"mapViewCurrent":""}`,children:r.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 64 64",children:r.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:()=>{i.scene.morphTo2D(),n(ie.SCENE2D)}}),s(ie.COLUMBUS_VIEW)&&r.jsx(W.Icon,{icon:r.jsx("div",{className:`mapViewIcon ${t===ie.COLUMBUS_VIEW?"mapViewCurrent":""}`,children:r.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 64 64",children:r.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:()=>{i.scene.morphToColumbusView(),n(ie.COLUMBUS_VIEW)}})]})},or="",An=pe.makeStyles(e=>pe.createStyles({mapContainer:{width:"60px",height:"60px",border:`${e.palette.background.paper} 2px solid`}})),In=e=>{const i=ue(),{baseMaps:t}=e,[n,l]=d.useState(" "),[s,u]=d.useState(),h=An();d.useEffect(()=>{const T=t==null?void 0:t.maps.find(L=>L.isCurrent);T&&(u(T),l(T.title!==void 0?T.title:" "))},[t]);const C=T=>{var L,D;if(t){(L=i.layersManager)==null||L.removeBaseMapLayers();const A=t.maps.find(N=>N.id===T);A&&((D=i.layersManager)==null||D.setBaseMapLayers(A),u(A),t.maps.forEach(N=>{N.isCurrent=A===N}))}};return r.jsxs(r.Fragment,{children:[r.jsx("label",{className:"mapLabel",children:n}),r.jsx("ul",{className:"mapSelector",children:t==null?void 0:t.maps.map(T=>r.jsx("li",{className:`mapContainer ${h.mapContainer} ${T===s?"mapContainerSelected":""}`,children:r.jsx("img",{alt:"",className:"mapContainerImg",src:T.thumbnail,onMouseOver:()=>{l(T.title)},onMouseOut:()=>{l((s==null?void 0:s.title)!==void 0?s.title:" ")},onClick:()=>{C(T.id)}})},T.id))})]})},sr="",Fe="ic_settings_24px",kn=e=>{const[i,t]=d.useState(!1),{sceneModes:n,baseMaps:l,locale:s}=e,u=d.useRef(null),h=H.get(s,"MAP_SETTINGS_DIALOG_TITLE")??"Map Settings",C=H.get(s,"MAP_SETTINGS_SCENE_MODE_TITLE")??"Scene Mode",T=H.get(s,"MAP_SETTINGS_BASE_MAP_TITLE")??"Base Map";return d.useEffect(()=>{const L=D=>{var $;const A=D.target,N=H.get(u,"current");N&&!N.contains(A)&&A.id!==Fe&&(($=A.parentElement)==null?void 0:$.id)!==Fe&&(document.removeEventListener("click",L,!1),t(!1))};return document.addEventListener("click",L,!1),()=>{document.removeEventListener("click",L,!1)}}),r.jsxs(r.Fragment,{children:[r.jsx(W.Icon,{icon:r.jsx("div",{className:"settingsIconContainer",children:r.jsx("svg",{width:"100%",height:"100%",viewBox:"0 0 24 24",id:Fe,x:"288",y:"24",children:r.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(!i)}}),i&&r.jsx("div",{id:"dialog-portal-example",className:"settingsDialogPortal",ref:u,children:r.jsxs(W.Dialog,{open:i,onClosed:()=>{t(!1)},children:[r.jsx(W.DialogTitle,{children:h}),r.jsxs(W.DialogContent,{children:[r.jsx("h4",{className:"sectionLabel",children:C}),r.jsx(se,{className:"mapScenesContainer",children:r.jsx(Ln,{sceneModes:n})}),r.jsx(se,{className:"baseMapsContainer",children:l&&r.jsxs(r.Fragment,{children:[r.jsx("h4",{className:"sectionLabel",children:T}),r.jsx(In,{baseMaps:l})]})})]})]})})]})},ar="",Dn=r.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:r.jsxs("g",{xmlns:"http://www.w3.org/2000/svg",children:[r.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"}),r.jsx("circle",{cx:"270.1",cy:"56.3",r:"56.3"})]})}),On=({onClick:e})=>r.jsx(se,{onClick:e,className:"mapLegendToggleContainer",children:r.jsx(W.Icon,{icon:Dn,className:"mapLegendIcon"})}),xn=({legend:{legendImg:e,legendDoc:i,layer:t},docText:n,imgText:l})=>{const s=d.useCallback(()=>{window.open(e,"_blank")},[e]);d.useCallback(()=>{window.open(i,"_blank")},[i]);const u=d.useCallback(()=>{const T=r.jsx(se,{className:"layerNameContainer",children:r.jsx("h3",{style:{maxWidth:`${15}ch`},className:"layerName",children:t})});return(t??"").length>15?r.jsx(W.Tooltip,{content:t,children:T}):T},[t]),h=d.useCallback(()=>[typeof e=="string"&&r.jsx("a",{className:"legendAction",href:e,target:"_blank",rel:"noreferrer",children:l}),typeof i=="string"&&r.jsx("a",{className:"legendAction",href:i,target:"_blank",rel:"noreferrer",children:n})],[e,l,i,n]);return r.jsxs(se,{className:"mapLegend",children:[u(),r.jsx("img",{alt:"Map Legend",className:"legendImg",src:e,onClick:s}),r.jsx(se,{className:"legendActionsContainer",children:h()})]})},Bn=({legends:e,actionsTexts:{docText:i,imgText:t},noLegendsText:n})=>{const l=d.useCallback(()=>r.jsx(se,{className:"noLegendsContainer",children:r.jsx("h2",{className:"noLegendsMsg",children:n})}),[n]),s=d.useCallback(()=>e.length?e.map((u,h)=>r.jsx(xn,{legend:u,docText:i,imgText:t},`${u.layer}_${h}`)):l(),[e]);return r.jsx(se,{className:"mapLegendsList",children:s()})},Nn=({isOpen:e,toggleSidebar:i,title:t="Map Legends",noLegendsText:n="No legends to display...",actionsTexts:l={docText:"Docs",imgText:"View Image"},legends:s=[]})=>e?r.jsxs(W.Drawer,{className:"mapLegendSidebarContainer",modal:!1,dismissible:!0,open:e,children:[r.jsx(W.DrawerHeader,{className:"sidebarHeaderContainer",children:r.jsx(W.DrawerTitle,{className:"sidebarTitle",children:t})}),r.jsxs(W.DrawerContent,{className:"sidebarContent",children:[r.jsx(W.Icon,{onClick:i,className:"mapLegendCloseBtn",icon:{icon:"close",size:"small"}}),r.jsx(Bn,{noLegendsText:n,legends:s,actionsTexts:l})]})]}):null,lt=(e,i,t)=>{let n;if(e.scene.mode!==S.SceneMode.SCENE2D)n=e.scene.pickPosition(new S.Cartesian2(i,t));else{const l=e.scene.globe.ellipsoid;n=e.camera.pickEllipsoid(new S.Cartesian2(i,t),l)}return S.Cartographic.fromCartesian(n)},Fn=(e,i,t)=>{const n=lt(e,i,t);return{type:"Feature",properties:{},geometry:{type:"Point",coordinates:[S.Math.toDegrees(n.longitude),S.Math.toDegrees(n.latitude)]}}},Gn=(e,i,t)=>{try{const n=lt(e,i,t);return{longitude:S.Math.toDegrees(n.longitude),latitude:S.Math.toDegrees(n.latitude)}}catch{return}},ge=document.createElement("canvas"),oe=ge.getContext("2d"),ct=e=>{const n=(e==null?void 0:e.data)??[];for(let l=3;l<n.length;l+=4)if(n[l]<255)return!0;return!1},Hn=async(e,i)=>(i&&i.tileTransparencyCheckedCounter++,new Promise((t,n)=>{try{oe==null||oe.clearRect(0,0,ge.width,ge.height);let l;if(e instanceof HTMLImageElement)l=e;else if(e instanceof ImageBitmap){ge.width=e.width,ge.height=e.height,oe==null||oe.drawImage(e,0,0);const s=oe==null?void 0:oe.getImageData(0,0,ge.width,ge.height),u=ct(s);u&&i&&(i.tileTransparencyCheckedCounter=i.maxTilesForTransparencyCheck),t(u);return}else l=new Image,l.crossOrigin="anonymous",l.src=e;l.onload=()=>{ge.width=l.width,ge.height=l.height,oe==null||oe.drawImage(l,0,0);const s=oe==null?void 0:oe.getImageData(0,0,ge.width,ge.height);ct(s)?(i&&(i.tileTransparencyCheckedCounter=i.maxTilesForTransparencyCheck),t(!0)):t(!1)}}catch(l){console.error("Could not determine image transparency. Error => ",l),n(l)}})),Me=(e,i)=>{const{west:t,east:n,north:l,south:s}=e,{west:u,east:h,north:C,south:T}=i;return t>=u&&n<=h&&l<=C&&s>=T},Pe=3,Le="hasTransparency";function Ge(e,i,t,n,l){return setTimeout(()=>{var h;const s=(h=this.layerListInstance.find(C=>{var T,L;return((T=C._imageryProvider._resource)==null?void 0:T._url)===((L=this._resource)==null?void 0:L._url)}))==null?void 0:h.meta,u=H.get(s,Le)===!0;this.tileTransparencyCheckedCounter<Pe&&!u&&Hn(l==null?void 0:l.url,this).then(C=>{var T;(T=this.mapViewer.layersManager)==null||T.addMetaToLayer({[Le]:C},L=>L._imageryProvider._resource._url===this._resource._url)})},0),e(i,t,n,l)}class dt extends S.UrlTemplateImageryProvider{constructor(t,n){var l;super(t);te(this,"layerListInstance");te(this,"mapViewer");te(this,"maxTilesForTransparencyCheck",Pe);te(this,"tileTransparencyCheckedCounter",0);this.layerListInstance=(l=n.layersManager)==null?void 0:l.layerList,this.mapViewer=n}requestImage(t,n,l,s){return Ge.call(this,super.requestImage.bind(this),t,n,l,s)}}class ut extends S.WebMapServiceImageryProvider{constructor(t,n){var l;super(t);te(this,"layerListInstance");te(this,"mapViewer");te(this,"maxTilesForTransparencyCheck",Pe);te(this,"tileTransparencyCheckedCounter",0);this.layerListInstance=(l=n.layersManager)==null?void 0:l.layerList,this.mapViewer=n}requestImage(t,n,l,s){return Ge.call(this,super.requestImage.bind(this),t,n,l,s)}}class ht extends S.WebMapTileServiceImageryProvider{constructor(t,n){var l;super(t);te(this,"layerListInstance");te(this,"mapViewer");te(this,"maxTilesForTransparencyCheck",Pe);te(this,"tileTransparencyCheckedCounter",0);this.layerListInstance=(l=n.layersManager)==null?void 0:l.layerList,this.mapViewer=n}requestImage(t,n,l,s){return Ge.call(this,super.requestImage.bind(this),t,n,l,s)}}const Vn=1,zn=-1,gt="TRANSPARENT_BASE_LAYER";class Wn{constructor(i,t,n){te(this,"mapViewer");te(this,"legendsList");te(this,"layerUpdated");te(this,"layers");te(this,"legendsExtractor");this.mapViewer=i,this.layers=this.mapViewer.imageryLayers._layers,this.legendsList=[],this.legendsExtractor=t,this.layerUpdated=new S.Event,n&&this.layerUpdated.addEventListener(n,this),this.mapViewer.shouldOptimizedTileRequests&&(this.layerUpdated.addEventListener(l=>{const s=Object.keys(l);s.length===1&&s[0]===Le&&(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}addMetaToLayer(i,t){const n=this.layers.find(t);n&&(n.meta={...n.meta??{},...i},this.setLegends(),this.layerUpdated.raiseEvent(i))}setBaseMapLayers(i){i.baseRasteLayers.sort((n,l)=>n.zIndex-l.zIndex).forEach((n,l)=>{this.addRasterLayer(n,l,i.id)}),this.mapViewer.shouldOptimizedTileRequests&&(this.removeLayer(gt),this.addTransparentImageryProvider())}addRasterLayer(i,t,n){let l;switch(i.type){case"XYZ_LAYER":{const s=i.options,u=this.mapViewer.shouldOptimizedTileRequests?new dt(s,this.mapViewer):new S.UrlTemplateImageryProvider(s);l=this.mapViewer.imageryLayers.addImageryProvider(u,t);break}case"WMS_LAYER":{const s=i.options,u=this.mapViewer.shouldOptimizedTileRequests?new ut(s,this.mapViewer):new S.WebMapServiceImageryProvider(s);l=this.mapViewer.imageryLayers.addImageryProvider(u,t);break}case"WMTS_LAYER":{const s=i.options,u=this.mapViewer.shouldOptimizedTileRequests?new ht(s,this.mapViewer):new S.WebMapTileServiceImageryProvider(s);l=this.mapViewer.imageryLayers.addImageryProvider(u,t);break}}l&&(l.alpha=i.opacity,l.meta={parentBasetMapId:n,...i},i.show!==void 0&&(l.show=i.show))}removeLayer(i){const t=this.findLayerById(i);t&&this.mapViewer.imageryLayers.remove(t,!0)}removeBaseMapLayers(){this.layers.filter(t=>!!H.get(t.meta,"parentBasetMapId")).forEach(t=>{this.mapViewer.imageryLayers.remove(t,!0)})}removeNotBaseMapLayers(){this.layers.filter(t=>!H.get(t.meta,"parentBasetMapId")).forEach(t=>{this.mapViewer.imageryLayers.remove(t,!0)})}raise(i,t=1){const n=this.findLayerById(i),l=(n==null?void 0:n.meta).zIndex;if(n)for(let s=0;s<t;s++)this.mapViewer.imageryLayers.raise(n);this.updateLayersOrder(i,l,l+t)}lower(i,t=1){const n=this.findLayerById(i),l=(n==null?void 0:n.meta).zIndex,s=this.getBaseLayersCount(),u=this.mapViewer.imageryLayers.indexOf(n);if(u-t<=s&&(t=u-s),n)for(let h=0;h<t;h++)this.mapViewer.imageryLayers.lower(n);this.updateLayersOrder(i,l,l-t)}raiseToTop(i){const t=this.findLayerById(i),n=(t==null?void 0:t.meta).zIndex;t&&this.mapViewer.imageryLayers.raiseToTop(t),this.updateLayersOrder(i,n,this.mapViewer.imageryLayers.length-this.getBaseLayersCount()-1)}lowerToBottom(i){const t=this.findLayerById(i),n=this.getBaseLayersCount(),l=this.mapViewer.imageryLayers.indexOf(t);this.lower(i,l-n)}length(){return this.mapViewer.imageryLayers.length}show(i,t){const n=this.get(i);n!==void 0&&(n.show=t)}showAllNotBase(i){this.layers.filter(n=>!H.get(n.meta,"parentBasetMapId")).forEach(n=>{var l;this.show((l=n.meta)==null?void 0:l.id,i)})}get(i){const t=this.findLayerById(i),n=this.mapViewer.imageryLayers.indexOf(t);return n?this.mapViewer.imageryLayers.get(n):void 0}findLayerByPOI(i,t){const n=Fn(this.mapViewer,i,t);return this.layers.filter(u=>!H.get(u.meta,"parentBasetMapId")).filter(u=>{const h=H.get(u.meta,"details.footprint");return h!==void 0?Ot(n.geometry,{type:"Feature",properties:{},geometry:h})&&u.show:(console.warn("CesiumImageryLayer has no defined footprint",u.meta),!1)}).sort((u,h)=>{var C,T;return((C=h.meta)==null?void 0:C.zIndex)-((T=u.meta)==null?void 0:T.zIndex)})}addTransparentImageryProvider(){const i=this.mapViewer.imageryLayers.addImageryProvider(new S.SingleTileImageryProvider({url:"./assets/img/transparent-tile.png",rectangle:new S.Rectangle(-3.141592653589793,-1.5707963267948966,3.141592653589793,1.5707963267948966)}),0);i.meta={id:gt,skipRelevancyCheck:!0}}setLegends(){typeof this.legendsExtractor<"u"&&(this.legendsList=this.legendsExtractor(this.layers))}getBaseLayersCount(){return this.layers.filter(t=>!!H.get(t.meta,"parentBasetMapId")).length}findLayerById(i){return this.layers.find(t=>t.meta!==void 0?t.meta.id===i:!1)}updateLayersOrder(i,t,n){const l=t>n?Vn:zn,s=t<n?t:n,u=t<n?n:t;this.layers.forEach(h=>{var T;if(!H.get(h.meta,"parentBasetMapId")){const L=(T=h.meta)==null?void 0:T.zIndex;h.meta.zIndex=L>=s&&L<=u&&L!==t?L+l:L===t?n:L}})}hideNonRelevantLayers(){var i,t;for(const n of this.layers)((i=n.meta)==null?void 0:i.relevantToExtent)!==n.show&&n.imageryProvider.ready&&(n.show=((t=n.meta)==null?void 0:t.relevantToExtent)??!0)}markRelevantLayersForExtent(){var i,t;try{const n=this.mapViewer.camera.computeViewRectangle();for(let l=this.layers.length-1;l>=0;l--){const s=this.layers[l],u=!H.isEmpty(n)&&!H.isEmpty(s.rectangle)&&S.Rectangle.intersection(n,s.rectangle);for(let h=this.layers.length-1;h>=l;h--){if(((i=s.meta)==null?void 0:i.skipRelevancyCheck)===!0){s.meta={...s.meta,relevantToExtent:!0};continue}const C=this.layers[h],T=((t=C.meta)==null?void 0:t[Le])===!0;if(s!==C)if(u instanceof S.Rectangle){if(Me(n,s.rectangle))if(Me(n,C.rectangle)&&!T){s.meta={...s.meta??{},relevantToExtent:!1};break}else s.meta={...s.meta??{},relevantToExtent:!0};if(Me(n,C.rectangle)&&!T){s.meta={...s.meta??{},relevantToExtent:!1};break}if(Me(s.rectangle,C.rectangle)){if(s.meta={...s.meta??{},relevantToExtent:T},!T)break}else s.meta={...s.meta??{},relevantToExtent:!0}}else s.meta={...s.meta??{},relevantToExtent:!1};else l===this.layers.length-1&&(s.meta={...s.meta??{},relevantToExtent:u instanceof S.Rectangle})}}}catch(n){console.error(n)}}}const lr="",pt=212,ft=260,Un=0;class $n extends S.Viewer{constructor(t,n){super(t,n);te(this,"layersManager");te(this,"useOptimizedTileRequests")}get shouldOptimizedTileRequests(){return this.useOptimizedTileRequests??!1}set shouldOptimizedTileRequests(t){this.useOptimizedTileRequests=t}}const mt=d.createContext(null),qn=mt.Provider,Kn=1e4,ue=()=>{const e=d.useContext(mt);if(e===null)throw new Error("map context is null, please check the provider");return e},jn=e=>{var w,M,_,b,P,I,V,Y;const i=d.useRef(null),[t,n]=d.useState(),[l,s]=d.useState(),[u,h]=d.useState(),[C,T]=d.useState(),[L,D]=d.useState(),[A,N]=d.useState(),[$,Z]=d.useState(),[R,G]=d.useState(),[ee,j]=d.useState([]),[U,X]=d.useState(),[B,q]=d.useState(!1),[J,o]=d.useState(void 0),[a,v]=d.useState(!1),[c,y]=d.useState(),g={fullscreenButton:!0,timeline:!1,animation:!1,baseLayerPicker:!1,geocoder:!1,navigationHelpButton:!1,homeButton:!1,sceneModePicker:!1,...e},E=(k,O,F,z,me)=>{const ae=t.container,ne=ae.clientWidth,ce=ae.clientHeight,Ce=z+me;return{left:`${ne-k<F?k-(F-(ne-k)):k}px`,top:`${ce-O<Ce?O-(Ce-(ce-O)):O}px`}};d.useEffect(()=>{var k;if(i.current!==null){const O=i.current.cesiumElement;e.imageryContextMenu&&O.screenSpaceEventHandler.setInputAction(F=>{const z=F.position;q(!1),o(z),y(Gn(O,z.x,z.y)),q(!0)},S.ScreenSpaceEventType.RIGHT_CLICK)}n((k=i.current)==null?void 0:k.cesiumElement)},[i,e.imageryContextMenu]),d.useEffect(()=>{var k;t&&(t.shouldOptimizedTileRequests=e.useOptimizedTileRequests??!1,t.layersManager=new Wn(t,(k=e.legends)==null?void 0:k.mapLegendsExtractor,()=>{var O;j((O=t.layersManager)==null?void 0:O.legendsList)}))},[t]),d.useEffect(()=>{t&&(t.shouldOptimizedTileRequests=e.useOptimizedTileRequests??!1)},[e.useOptimizedTileRequests,t]),d.useEffect(()=>{G(e.sceneModes??[ie.SCENE2D,ie.SCENE3D,ie.COLUMBUS_VIEW])},[e.sceneModes]),d.useEffect(()=>{var O,F;X(e.baseMaps);const k=(O=e.baseMaps)==null?void 0:O.maps.find(z=>z.isCurrent);k&&t&&((F=t.layersManager)==null||F.setBaseMapLayers(k))},[e.baseMaps,t]),d.useEffect(()=>{s(e.projection??de.WGS84)},[e.projection]),d.useEffect(()=>{N(e.locale)},[e.locale]),d.useEffect(()=>{h(e.showMousePosition??!0)},[e.showMousePosition]),d.useEffect(()=>{T(e.showZoomLevel??!0)},[e.showZoomLevel]),d.useEffect(()=>{D(e.showScale??!0)},[e.showScale]),d.useEffect(()=>{const k=()=>{if(t===void 0)return{longitude:0,latitude:0,height:0};const F=()=>{const z=t.camera.positionCartographic;return{longitude:_e(z.longitude),latitude:_e(z.latitude),height:z.height}};if(t.scene.mode===S.SceneMode.SCENE3D){const z=new S.Cartesian2(t.container.clientWidth/2,t.container.clientHeight/2),me=t.scene.camera.getPickRay(z),ae=t.scene.globe.pick(me,t.scene),ne=t.scene.globe.ellipsoid.cartesianToCartographic(ae);return ne!==void 0?{longitude:_e(ne.longitude),latitude:_e(ne.latitude),height:t.scene.camera.positionCartographic.height}:F()}else return F()},O=setInterval(()=>{if(t&&t.scene.mode!==S.SceneMode.MORPHING){const F=t.camera,z={position:k(),direction:F.direction.clone(),up:F.up.clone(),right:F.right.clone(),transform:F.transform.clone(),frustum:F.frustum.clone()};Z(z)}},Kn);return()=>{clearInterval(O)}},[t]),d.useEffect(()=>{const k=()=>{t&&$&&t.camera.flyTo({destination:S.Cartesian3.fromDegrees($.position.longitude,$.position.latitude,$.position.height),duration:0})};return t&&t.scene.morphComplete.addEventListener(k),()=>{if(t)try{t.scene.morphComplete.removeEventListener(k)}catch{console.error("morphCompleteHandler event not cleaned")}}},[t,$]),d.useEffect(()=>{const k=e.zoom,O=e.center;t&&H.isNumber(k)&&H.isArray(O)&&t.camera.flyTo({destination:S.Cartesian3.fromDegrees(O[0],O[1],wn(k)),duration:0})},[e.zoom,e.center,t]);const m=d.useCallback(()=>t&&Dt.createPortal(r.jsxs(r.Fragment,{children:[r.jsxs(se,{className:"sideToolsContainer",children:[r.jsx(kn,{sceneModes:R,baseMaps:U,locale:A}),r.jsx(On,{onClick:()=>v(!a)})]}),r.jsxs(se,{className:"toolsContainer",children:[u===!0?r.jsx(Sn,{projection:l}):r.jsx(r.Fragment,{}),C===!0?r.jsx(Mn,{locale:A}):r.jsx(r.Fragment,{}),L===!0?r.jsx(bn,{locale:A}):r.jsx(r.Fragment,{})]})]}),document.querySelector(".cesium-viewer")),[U,A,t,l,R,u,L,a]);return r.jsx(he.Viewer,{className:"viewer",full:!0,ref:i,...g,children:r.jsxs(qn,{value:t,children:[r.jsx(Nn,{title:(w=e.legends)==null?void 0:w.title,isOpen:a,toggleSidebar:()=>v(!a),noLegendsText:(M=e.legends)==null?void 0:M.emptyText,legends:((_=e.legends)==null?void 0:_.legendsList)??ee,actionsTexts:(b=e.legends)==null?void 0:b.actionsTexts}),e.children,m(),e.imageryContextMenu&&B&&J&&c&&d.cloneElement(e.imageryContextMenu,{data:(P=t==null?void 0:t.layersManager)==null?void 0:P.findLayerByPOI(J.x,J.y),position:{x:J.x,y:J.y},coordinates:c,style:E(J.x,J.y,((I=e.imageryContextMenuSize)==null?void 0:I.width)??ft,((V=e.imageryContextMenuSize)==null?void 0:V.height)??pt,((Y=e.imageryContextMenuSize)==null?void 0:Y.dynamicHeightIncrement)??Un),size:e.imageryContextMenuSize??{height:pt,width:ft},handleClose:()=>{q(!B)}})]})})},Yn=0,Xn=e=>{const i=ue();return r.jsx(he.Cesium3DTileset,{...e,onReady:t=>{e.isZoomTo===!0&&i.zoomTo(t);const n=i.scene;n.globe.depthTestAgainstTerrain=!0;const l=S.Cartographic.fromCartesian(t.boundingSphere.center),s=e.heightFromGround??Yn;if(s){const u=S.Cartesian3.fromRadians(l.longitude,l.latitude,l.height),h=S.Cartesian3.fromRadians(l.longitude,l.latitude,l.height+s),C=S.Cartesian3.subtract(h,u,new S.Cartesian3);t.modelMatrix=S.Matrix4.fromTranslation(C)}}})},Zn=e=>r.jsx(he.GeoJsonDataSource,{...e}),Ee=e=>{const{meta:i,...t}=e,n=ue();return d.useLayoutEffect(()=>{var l;(l=n.layersManager)==null||l.addMetaToLayer(i,i.searchLayerPredicate??((s,u)=>{var h,C;return i!==void 0?((h=s._imageryProvider._resource)==null?void 0:h._url)===((C=i.options)==null?void 0:C.url):!1}))},[i,n]),r.jsx(he.ImageryLayer,{...t})},Jn=e=>{const{options:i,...t}=e,n=ue(),l=n.shouldOptimizedTileRequests?new ut(i,n):new S.WebMapServiceImageryProvider(i);return r.jsx(Ee,{...t,imageryProvider:l})},Qn=e=>{const{options:i,...t}=e,n=ue(),l=n.shouldOptimizedTileRequests?new ht(i,n):new S.WebMapTileServiceImageryProvider(i);return r.jsx(Ee,{...t,imageryProvider:l})},Rn=e=>{const{options:i,...t}=e,n=ue(),l=n.shouldOptimizedTileRequests?new dt(i,n):new S.UrlTemplateImageryProvider(i);return r.jsx(Ee,{...t,imageryProvider:l})},ei=e=>{const{options:i,...t}=e;return r.jsx(Ee,{...t,imageryProvider:new S.OpenStreetMapImageryProvider(i)})},yt=e=>r.jsx(he.Entity,{...e}),ti=e=>r.jsx(he.EntityDescription,{...e}),vt=e=>r.jsx(he.EntityDescription,{...e}),Et=e=>r.jsx(he.PolygonGraphics,{...e}),Ct=e=>r.jsx(he.RectangleGraphics,{...e}),wt=e=>r.jsx(he.CustomDataSource,{...e}),ni=e=>r.jsx(he.PolylineGraphics,{...e}),cr="";var ye=function(){var e=p.Ellipsoid.WGS84,i,t=p.Material.fromType(p.Material.ColorType);function n(o,a=new p.Color(1,1,0,.5),v=new p.Color(1,1,1,1)){this._scene=o.scene,t.uniforms.color=a,i=v,this._tooltip={setVisible:()=>{},showAt:()=>{}},this._surfaces=[],this.initialiseHandlers(),this.enhancePrimitives()}n.prototype.initialiseHandlers=function(){var o=this._scene,a=this,v=new p.ScreenSpaceEventHandler(o.canvas);function c(g,E){if(a._handlersMuted!=!0){var m=o.pick(E);m&&m.primitive&&m.primitive[g]&&m.primitive[g](E)}}v.setInputAction(function(g){c("leftClick",g.position)},p.ScreenSpaceEventType.LEFT_CLICK),v.setInputAction(function(g){c("leftDoubleClick",g.position)},p.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);var y;v.setInputAction(function(g){if(a._handlersMuted!=!0){var E=o.pick(g.endPosition);y&&(!E||y!=E.primitive)&&(!(y.isDestroyed&&y.isDestroyed())&&y.mouseOut(g.endPosition),y=null),E&&E.primitive&&(E=E.primitive,E.mouseOut&&(y=E),E.mouseMove&&E.mouseMove(g.endPosition))}},p.ScreenSpaceEventType.MOUSE_MOVE),v.setInputAction(function(g){c("leftUp",g.position)},p.ScreenSpaceEventType.LEFT_UP),v.setInputAction(function(g){c("leftDown",g.position)},p.ScreenSpaceEventType.LEFT_DOWN)},n.prototype.setListener=function(o,a,v){o[a]=v},n.prototype.muteHandlers=function(o){this._handlersMuted=o},n.prototype.registerEditableShape=function(o){var a=this;q(o,"mouseMove",function(v){o.setHighlighted(!0),o._editMode||a._tooltip.showAt(v,"Click to edit this shape")}),q(o,"mouseOut",function(v){o.setHighlighted(!1),a._tooltip.setVisible(!1)}),q(o,"leftClick",function(v){o.setEditMode(!0)})},n.prototype.startDrawing=function(o){this.disableAllEditMode(),this.editCleanUp&&this.editCleanUp(),this.editCleanUp=o,this.muteHandlers(!0)},n.prototype.stopDrawing=function(){this.editCleanUp&&(this.editCleanUp(),this.editCleanUp=null),this.muteHandlers(!1)},n.prototype.disableAllHighlights=function(){this.setHighlighted(void 0)},n.prototype.setHighlighted=function(o){this._highlightedSurface&&!this._highlightedSurface.isDestroyed()&&this._highlightedSurface!=o&&this._highlightedSurface.setHighlighted(!1),this._highlightedSurface=o},n.prototype.disableAllEditMode=function(){this.setEdited(void 0)},n.prototype.setEdited=function(o){this._editedSurface&&!this._editedSurface.isDestroyed()&&this._editedSurface.setEditMode(!1),this._editedSurface=o};var l={ellipsoid:p.Ellipsoid.WGS84,textureRotationAngle:0,height:0,asynchronous:!0,show:!0,debugShowBoundingVolume:!1},s=B(l,{appearance:new p.EllipsoidSurfaceAppearance({aboveGround:!1}),material:t,granularity:Math.PI/180}),u=B(l,{}),h=B(l,{}),C=B(l,{}),T=B(s,{rotation:0}),L=B(l,{width:5,geodesic:!0,granularity:1e4,appearance:new p.PolylineMaterialAppearance({aboveGround:!1}),material:t}),D=function(){function o(){}return o.prototype.initialiseOptions=function(a){X(this,a),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},o.prototype.setAttribute=function(a,v){this[a]=v,this._createPrimitive=!0},o.prototype.getAttribute=function(a){return this[a]},o.prototype.update=function(a,v,c){if(!p.defined(this.ellipsoid))throw new p.DeveloperError("this.ellipsoid must be defined.");if(!p.defined(this.appearance))throw new p.DeveloperError("this.material must be defined.");if(this.granularity<0)throw new p.DeveloperError("this.granularity and scene2D/scene3D overrides must be greater than zero.");if(this.show&&!(!this._createPrimitive&&!p.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 y=this.getGeometry();if(!y)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 p.Primitive({geometryInstances:new p.GeometryInstance({geometry:y,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 p.Primitive({geometryInstances:new p.GeometryInstance({geometry:this.getOutlineGeometry(),attributes:{color:p.ColorGeometryInstanceAttribute.fromColor(this.strokeColor)}}),appearance:new p.PerInstanceColorAppearance({flat:!0,renderState:{depthTest:{enabled:!0},lineWidth:this.strokeWidth||4}})}))}var g=this._primitive;g.appearance.material=this.material,g.debugShowBoundingVolume=this.debugShowBoundingVolume,g.update(a,v,c),this._outlinePolygon&&this._outlinePolygon.update(a,v,c)}},o.prototype.isDestroyed=function(){return!1},o.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),p.destroyObject(this)},o.prototype.setStrokeStyle=function(a,v){(!this.strokeColor||!this.strokeColor.equals(a)||this.strokeWidth!=v)&&(this._createPrimitive=!0,this.strokeColor=a,this.strokeWidth=v)},o}();n.ExtentPrimitive=function(){function o(a){if(!p.defined(a.extent))throw new p.DeveloperError("Extent is required");a=B(a,s),this.initialiseOptions(a),this.setExtent(a.extent)}return o.prototype=new D,o.prototype.setExtent=function(a){this.setAttribute("extent",a)},o.prototype.getExtent=function(){return this.getAttribute("extent")},o.prototype.getGeometry=function(){if(p.defined(this.extent))return new p.RectangleGeometry({rectangle:this.extent,height:this.height,vertexFormat:p.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity})},o.prototype.getOutlineGeometry=function(){return new p.RectangleOutlineGeometry({rectangle:this.extent})},o}(),n.PolygonPrimitive=function(){function o(a){a=B(a,s),this.initialiseOptions(a),this.isPolygon=!0}return o.prototype=new D,o.prototype.setPositions=function(a){this.setAttribute("positions",a)},o.prototype.getPositions=function(){return this.getAttribute("positions")},o.prototype.getGeometry=function(){if(!(!p.defined(this.positions)||this.positions.length<3))return p.PolygonGeometry.fromPositions({positions:this.positions,height:this.height,vertexFormat:p.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity})},o.prototype.getOutlineGeometry=function(){return p.PolygonOutlineGeometry.fromPositions({positions:this.getPositions()})},o}(),n.CirclePrimitive=function(){function o(a){if(!(p.defined(a.center)&&p.defined(a.radius)))throw new p.DeveloperError("Center and radius are required");a=B(a,s),this.initialiseOptions(a),this.setRadius(a.radius)}return o.prototype=new D,o.prototype.setCenter=function(a){this.setAttribute("center",a)},o.prototype.setRadius=function(a){this.setAttribute("radius",Math.max(.1,a))},o.prototype.getCenter=function(){return this.getAttribute("center")},o.prototype.getRadius=function(){return this.getAttribute("radius")},o.prototype.getGeometry=function(){if(p.defined(this.center)&&p.defined(this.radius))return new p.CircleGeometry({center:this.center,radius:this.radius,height:this.height,vertexFormat:p.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity})},o.prototype.getOutlineGeometry=function(){return new p.CircleOutlineGeometry({center:this.getCenter(),radius:this.getRadius()})},o}(),n.EllipsePrimitive=function(){function o(a){if(!(p.defined(a.center)&&p.defined(a.semiMajorAxis)&&p.defined(a.semiMinorAxis)))throw new p.DeveloperError("Center and semi major and semi minor axis are required");a=B(a,T),this.initialiseOptions(a)}return o.prototype=new D,o.prototype.setCenter=function(a){this.setAttribute("center",a)},o.prototype.setSemiMajorAxis=function(a){a<this.getSemiMinorAxis()||this.setAttribute("semiMajorAxis",a)},o.prototype.setSemiMinorAxis=function(a){a>this.getSemiMajorAxis()||this.setAttribute("semiMinorAxis",a)},o.prototype.setRotation=function(a){return this.setAttribute("rotation",a)},o.prototype.getCenter=function(){return this.getAttribute("center")},o.prototype.getSemiMajorAxis=function(){return this.getAttribute("semiMajorAxis")},o.prototype.getSemiMinorAxis=function(){return this.getAttribute("semiMinorAxis")},o.prototype.getRotation=function(){return this.getAttribute("rotation")},o.prototype.getGeometry=function(){if(p.defined(this.center)&&p.defined(this.semiMajorAxis)&&p.defined(this.semiMinorAxis))return new p.EllipseGeometry({ellipsoid:this.ellipsoid,center:this.center,semiMajorAxis:this.semiMajorAxis,semiMinorAxis:this.semiMinorAxis,rotation:this.rotation,height:this.height,vertexFormat:p.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,granularity:this.granularity})},o.prototype.getOutlineGeometry=function(){return new p.EllipseOutlineGeometry({center:this.getCenter(),semiMajorAxis:this.getSemiMajorAxis(),semiMinorAxis:this.getSemiMinorAxis(),rotation:this.getRotation()})},o}(),n.PolylinePrimitive=function(){function o(a){a=B(a,L),this.initialiseOptions(a)}return o.prototype=new D,o.prototype.setPositions=function(a){this.setAttribute("positions",a)},o.prototype.setWidth=function(a){this.setAttribute("width",a)},o.prototype.setGeodesic=function(a){this.setAttribute("geodesic",a)},o.prototype.getPositions=function(){return this.getAttribute("positions")},o.prototype.getWidth=function(){return this.getAttribute("width")},o.prototype.getGeodesic=function(a){return this.getAttribute("geodesic")},o.prototype.getGeometry=function(){if(!(!p.defined(this.positions)||this.positions.length<2))return new p.PolylineGeometry({positions:this.positions,height:this.height,width:this.width<1?1:this.width,vertexFormat:p.EllipsoidSurfaceAppearance.VERTEX_FORMAT,ellipsoid:this.ellipsoid})},o}();var A={iconUrl:"./assets/img/dragIcon.png",shiftX:0,shiftY:0},N={iconUrl:"./assets/img/dragIcon.png",shiftX:0,shiftY:0},$={iconUrl:"./assets/img/dragIconLight.png",shiftX:0,shiftY:0};n.prototype.createBillboardGroup=function(o,a,v){var c=new n.BillboardGroup(this,a);return c.addBillboards(o,v),c},n.BillboardGroup=function(o,a){this._drawHelper=o,this._scene=o._scene,this._options=B(a,A);var v=new p.BillboardCollection;this._scene.primitives.add(v),this._billboards=v,this._orderedBillboards=[]},n.BillboardGroup.prototype.createBillboard=function(o,a){var v=this._billboards.add({show:!0,position:o,pixelOffset:new p.Cartesian2(this._options.shiftX,this._options.shiftY),eyeOffset:new p.Cartesian3(0,0,0),horizontalOrigin:p.HorizontalOrigin.CENTER,verticalOrigin:p.VerticalOrigin.CENTER,scale:1,image:this._options.iconUrl,color:i});if(a){let g=function(m){y.enableRotate=m},E=function(){for(var m=0,w=c._orderedBillboards.length;m<w&&c._orderedBillboards[m]!=v;++m);return m};var c=this,y=this._scene.screenSpaceCameraController;if(a.dragHandlers){var c=this;q(v,"leftDown",function(w){function M(P){v.position=P;for(var I=0,V=c._orderedBillboards.length;I<V&&c._orderedBillboards[I]!=v;++I);a.dragHandlers.onDrag&&a.dragHandlers.onDrag(E(),P)}function _(P){b.destroy(),g(!0),a.dragHandlers.onDragEnd&&a.dragHandlers.onDragEnd(E(),P)}var b=new p.ScreenSpaceEventHandler(c._scene.canvas);b.setInputAction(function(P){var I=c._scene.camera.pickEllipsoid(P.endPosition,e);I?M(I):_(I)},p.ScreenSpaceEventType.MOUSE_MOVE),b.setInputAction(function(P){_(c._scene.camera.pickEllipsoid(P.position,e))},p.ScreenSpaceEventType.LEFT_UP),g(!1),a.dragHandlers.onDragStart&&a.dragHandlers.onDragStart(E(),c._scene.camera.pickEllipsoid(w,e))})}a.onDoubleClick&&q(v,"leftDoubleClick",function(m){a.onDoubleClick(E())}),a.onClick&&q(v,"leftClick",function(m){a.onClick(E())}),a.tooltip&&(q(v,"mouseMove",function(m){c._drawHelper._tooltip.showAt(m,a.tooltip())}),q(v,"mouseOut",function(m){c._drawHelper._tooltip.setVisible(!1)}))}return v},n.BillboardGroup.prototype.insertBillboard=function(o,a,v){this._orderedBillboards.splice(o,0,this.createBillboard(a,v))},n.BillboardGroup.prototype.addBillboard=function(o,a){this._orderedBillboards.push(this.createBillboard(o,a))},n.BillboardGroup.prototype.addBillboards=function(o,a){for(var v=0;v<o.length;v++)this.addBillboard(o[v],a)},n.BillboardGroup.prototype.updateBillboardsPositions=function(o){for(var a=0;a<o.length;a++)this.getBillboard(a).position=o[a]},n.BillboardGroup.prototype.countBillboards=function(){return this._orderedBillboards.length},n.BillboardGroup.prototype.getBillboard=function(o){return this._orderedBillboards[o]},n.BillboardGroup.prototype.removeBillboard=function(o){this._billboards.remove(this.getBillboard(o)),this._orderedBillboards.splice(o,1)},n.BillboardGroup.prototype.remove=function(){this._billboards=this._billboards&&this._billboards.removeAll()&&this._billboards.destroy()},n.BillboardGroup.prototype.setOnTop=function(){this._scene.primitives.raiseToTop(this._billboards)},n.prototype.startDrawingMarker=function(a){var a=B(a,A);this.startDrawing(function(){g.remove(),E.destroy(),y.setVisible(!1)});var v=this,c=this._scene;c.primitives;var y=this._tooltip,g=new n.BillboardGroup(this,a),E=new p.ScreenSpaceEventHandler(c.canvas);E.setInputAction(function(m){if(m.position!=null){var w=c.camera.pickEllipsoid(m.position,e);w&&(g.addBillboard(w),v.stopDrawing(),a.callback(w))}},p.ScreenSpaceEventType.LEFT_CLICK),E.setInputAction(function(m){var w=m.endPosition;if(w!=null){var M=c.camera.pickEllipsoid(w,e);M?y.showAt(w,"<p>Click to add your marker. Position is: </p>"+j(e.cartesianToCartographic(M))):y.showAt(w,"<p>Click on the globe to add your marker.</p>")}},p.ScreenSpaceEventType.MOUSE_MOVE)},n.prototype.startDrawingPolygon=function(a){var a=B(a,s);this.startDrawingPolyshape(!0,a)},n.prototype.startDrawingPolyline=function(a){var a=B(a,L);this.startDrawingPolyshape(!1,a)},n.prototype.startDrawingPolyshape=function(o,a){this.startDrawing(function(){y.remove(m),M.remove(),_.destroy(),g.setVisible(!1),G(c)});var v=this,c=this._scene,y=c.primitives,g=this._tooltip,E=o?3:2,m;o?m=new ye.PolygonPrimitive(a):m=new ye.PolylinePrimitive(a),m.asynchronous=!1,y.add(m);var w=[],M=new n.BillboardGroup(this,A),_=new p.ScreenSpaceEventHandler(c.canvas);R(c),_.setInputAction(function(b){if(b.position!=null){var P=c.camera.pickEllipsoid(b.position,e);P&&(w.length==0&&(w.push(P.clone()),M.addBillboard(w[0])),w.length>=E&&(m.positions=w,m._createPrimitive=!0),w.push(P),M.addBillboard(P))}},p.ScreenSpaceEventType.LEFT_CLICK),_.setInputAction(function(b){var P=b.endPosition;if(P!=null)if(w.length==0)g.showAt(P,"<p>Click to add first point</p>");else{var I=c.camera.pickEllipsoid(P,e);I&&(w.pop(),I.y+=1+Math.random(),w.push(I),w.length>=E&&(m.positions=w,m._createPrimitive=!0),M.getBillboard(w.length-1).position=I,g.showAt(P,"<p>Click to add new point ("+w.length+")</p>"+(w.length>E?"<p>Double click to finish drawing</p>":"")))}},p.ScreenSpaceEventType.MOUSE_MOVE),_.setInputAction(function(b){var P=b.position;if(P!=null){if(w.length<E+2)return;var I=c.camera.pickEllipsoid(P,e);I&&(G(c),v.stopDrawing(),typeof a.callback=="function"&&(w.length-1,a.callback(w)))}},p.ScreenSpaceEventType.LEFT_DOUBLE_CLICK)};function Z(o){return e.cartographicArrayToCartesianArray([p.Rectangle.northwest(o),p.Rectangle.northeast(o),p.Rectangle.southeast(o),p.Rectangle.southwest(o)])}function R(o){o&&(o.canvas.style.cursor="crosshair")}function G(o){o&&(o.canvas.style.cursor="")}n.prototype.startDrawingExtent=function(a){var a=B(a,s);this.startDrawing(function(){m!=null&&y.remove(m),w!=null&&w.remove(),M.destroy(),g.setVisible(!1),G(c)});var v=this,c=this._scene,y=this._scene.primitives,g=this._tooltip,E=null,m=null,w=null,M=new p.ScreenSpaceEventHandler(c.canvas);R(c);function _(b){m==null&&(m=new ye.ExtentPrimitive({extent:b,material:a.material}),m.asynchronous=!1,y.add(m)),m.setExtent(b);var P=Z(b);w==null?(w=new n.BillboardGroup(v,A),w.addBillboards(P)):w.updateBillboardsPositions(P)}M.setInputAction(function(b){if(b.position!=null){var P=c.camera.pickEllipsoid(b.position,e);if(P)if(m==null){E=e.cartesianToCartographic(P);var I=ee(E,E);_(I)}else v.stopDrawing(),typeof a.callback=="function"&&a.callback(ee(E,e.cartesianToCartographic(P)))}},p.ScreenSpaceEventType.LEFT_DOWN),M.setInputAction(function(b){var P=b.endPosition;if(P!=null)if(m==null)g.showAt(P,"<p>Click to start drawing rectangle</p>");else{var I=c.camera.pickEllipsoid(P,e);if(I){var V=ee(E,e.cartesianToCartographic(I));_(V),g.showAt(P,"<p>Drag to change rectangle extent</p><p>Click again to finish drawing</p>")}}},p.ScreenSpaceEventType.MOUSE_MOVE)},n.prototype.startDrawingCircle=function(a){var a=B(a,s);this.startDrawing(function(){E!=null&&y.remove(E),m.remove(),w.destroy(),g.setVisible(!1)});var v=this,c=this._scene,y=this._scene.primitives,g=this._tooltip,E=null,m=null,w=new p.ScreenSpaceEventHandler(c.canvas);w.setInputAction(function(M){if(M.position!=null){var _=c.camera.pickEllipsoid(M.position,e);_&&(E==null?(E=new n.CirclePrimitive({center:_,radius:0,asynchronous:!1,material:a.material}),y.add(E),m=new n.BillboardGroup(v,A),m.addBillboards([_])):(typeof a.callback=="function"&&a.callback(E.getCenter(),E.getRadius()),v.stopDrawing()))}},p.ScreenSpaceEventType.LEFT_DOWN),w.setInputAction(function(M){var _=M.endPosition;if(_!=null)if(E==null)g.showAt(_,"<p>Click to start drawing the circle</p>");else{var b=c.camera.pickEllipsoid(_,e);b&&(E.setRadius(p.Cartesian3.distance(E.getCenter(),b)),m.updateBillboardsPositions(b),g.showAt(_,"<p>Move mouse to change circle radius</p><p>Click again to finish drawing</p>"))}},p.ScreenSpaceEventType.MOUSE_MOVE)},n.prototype.enhancePrimitives=function(){var o=this;p.Billboard.prototype.setEditable=function(){if(this._editable)return;this._editable=!0;var c=this,y=this;function g(E){o._scene.screenSpaceCameraController.enableRotate=E}q(c,"leftDown",function(E){function m(_){c.position=_,y.executeListeners({name:"drag",positions:_})}function w(_){M.destroy(),g(!0),y.executeListeners({name:"dragEnd",positions:_})}var M=new p.ScreenSpaceEventHandler(o._scene.canvas);M.setInputAction(function(_){var b=o._scene.camera.pickEllipsoid(_.endPosition,e);b?m(b):w(b)},p.ScreenSpaceEventType.MOUSE_MOVE),M.setInputAction(function(_){w(o._scene.camera.pickEllipsoid(_.position,e))},p.ScreenSpaceEventType.LEFT_UP),g(!1)}),J(c)};function a(c){o._scene,!(this._highlighted&&this._highlighted==c)&&this._editMode!==!0&&(this._highlighted=c,c?(o.setHighlighted(this),this._strokeColor=this.strokeColor,this.setStrokeStyle(p.Color.fromCssColorString("white"),this.strokeWidth)):this._strokeColor?this.setStrokeStyle(this._strokeColor,this.strokeWidth):this.setStrokeStyle(void 0,void 0))}function v(c){if(this._editMode!=c)if(o.disableAllHighlights(),c){o.setEdited(this);var y=o._scene,g=this;if(this._markers==null){let I=function(k,O){var F=k-1<0?O.length-1:k-1;F<m.countBillboards()&&(m.getBillboard(F).position=Y(F)),F=k,F<m.countBillboards()&&(m.getBillboard(F).position=Y(F))},V=function(){g.executeListeners({name:"onEdited",positions:g.positions})},Y=function(k){var O=g.positions;return e.cartographicToCartesian(new p.EllipsoidGeodesic(e.cartesianToCartographic(O[k]),e.cartesianToCartographic(O[k<O.length-1?k+1:0])).interpolateUsingFraction(.5))};var E=new n.BillboardGroup(o,N),m=new n.BillboardGroup(o,$),w={dragHandlers:{onDrag:function(k,O){g.positions[k]=O,I(k,g.positions),g._createPrimitive=!0},onDragEnd:function(k,O){g._createPrimitive=!0,V()}},onDoubleClick:function(k){g.positions.length<4||(g.positions.splice(k,1),g._createPrimitive=!0,E.removeBillboard(k),m.removeBillboard(k),I(k,g.positions),V())},tooltip:function(){if(g.positions.length>3)return"Double click to remove this point"}};E.addBillboards(g.positions,w),this._markers=E;for(var M=[],_=0,b=g.positions.length+(this.isPolygon?0:-1);_<b;_++)M.push(Y(_));var P={dragHandlers:{onDragStart:function(k,O){this.index=k+1,g.positions.splice(this.index,0,O),g._createPrimitive=!0},onDrag:function(k,O){g.positions[this.index]=O,g._createPrimitive=!0},onDragEnd:function(k,O){E.insertBillboard(this.index,O,w),m.getBillboard(this.index-1).position=Y(this.index-1),m.insertBillboard(this.index,Y(this.index),P),g._createPrimitive=!0,V()}},tooltip:function(){return"Drag to create a new point"}};m.addBillboards(M,P),this._editMarkers=m,this._globeClickhandler=new p.ScreenSpaceEventHandler(y.canvas),this._globeClickhandler.setInputAction(function(k){var O=y.pick(k.position);O&&O.primitive||g.setEditMode(!1)},p.ScreenSpaceEventType.LEFT_CLICK),E.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}ye.PolylinePrimitive.prototype.setEditable=function(){if(!this.setEditMode){var c=this;c.isPolygon=!1,c.asynchronous=!1,o.registerEditableShape(c),c.setEditMode=v;var y=this.width;c.setHighlighted=function(g){this._editMode!==!0&&(g?(o.setHighlighted(this),this.setWidth(y*2)):this.setWidth(y))},c.getExtent=function(){return p.Rectangle.fromCartographicArray(e.cartesianArrayToCartographicArray(this.positions))},J(c),c.setEditMode(!1)}},ye.PolygonPrimitive.prototype.setEditable=function(){var c=this;c.asynchronous=!1,o._scene,o.registerEditableShape(c),c.setEditMode=v,c.setHighlighted=a,J(c),c.setEditMode(!1)},ye.ExtentPrimitive.prototype.setEditable=function(){if(!this.setEditMode){var c=this,y=o._scene;o.registerEditableShape(c),c.asynchronous=!1,c.setEditMode=function(g){if(this._editMode!=g)if(o.disableAllHighlights(),g){if(o.setEdited(this),this._markers==null){let w=function(){c.executeListeners({name:"onEdited",extent:c.extent})};var E=new n.BillboardGroup(o,N),m={dragHandlers:{onDrag:function(M,_){var b=E.getBillboard((M+2)%4).position;c.setExtent(ee(e.cartesianToCartographic(b),e.cartesianToCartographic(_))),E.updateBillboardsPositions(Z(c.extent))},onDragEnd:function(M,_){w()}},tooltip:function(){return"Drag to change the corners of this extent"}};E.addBillboards(Z(c.extent),m),this._markers=E,this._globeClickhandler=new p.ScreenSpaceEventHandler(y.canvas),this._globeClickhandler.setInputAction(function(M){var _=y.pick(M.position);_&&!_.isDestroyed()&&_.primitive||c.setEditMode(!1)},p.ScreenSpaceEventType.LEFT_CLICK),E.setOnTop()}this._editMode=!0}else this._markers!=null&&(this._markers.remove(),this._markers=null,this._globeClickhandler.destroy()),this._editMode=!1},c.setHighlighted=a,J(c),c.setEditMode(!1)}},n.EllipsePrimitive.prototype.setEditable=function(){if(!this.setEditMode){var c=this,y=o._scene;c.asynchronous=!1,o.registerEditableShape(c),c.setEditMode=function(g){if(this._editMode!=g)if(o.disableAllHighlights(),g){o.setEdited(this);var E=this;if(this._markers==null){let M=function(){return p.EllipseOutlineGeometry(e,c.getCenter(),c.getSemiMajorAxis(),c.getSemiMinorAxis(),c.getRotation()+Math.PI/2,Math.PI/2).splice(0,4)},_=function(){c.executeListeners({name:"onEdited",center:c.getCenter(),semiMajorAxis:c.getSemiMajorAxis(),semiMinorAxis:c.getSemiMinorAxis(),rotation:0})};var m=new n.BillboardGroup(o,N),w={dragHandlers:{onDrag:function(b,P){var I=p.Cartesian3.distance(c.getCenter(),P);b%2==0?c.setSemiMajorAxis(I):c.setSemiMinorAxis(I),m.updateBillboardsPositions(M())},onDragEnd:function(b,P){_()}},tooltip:function(){return"Drag to change the excentricity and radius"}};m.addBillboards(M(),w),this._markers=m,this._globeClickhandler=new p.ScreenSpaceEventHandler(y.canvas),this._globeClickhandler.setInputAction(function(b){var P=y.pick(b.position);P&&P.primitive||E.setEditMode(!1)},p.ScreenSpaceEventType.LEFT_CLICK),m.setOnTop()}this._editMode=!0}else this._markers!=null&&(this._markers.remove(),this._markers=null,this._globeClickhandler.destroy()),this._editMode=!1},c.setHighlighted=a,J(c),c.setEditMode(!1)}},n.CirclePrimitive.prototype.getCircleCartesianCoordinates=function(c){for(var y=p.CircleOutlineGeometry.createGeometry(new p.CircleOutlineGeometry({ellipsoid:e,center:this.getCenter(),radius:this.getRadius(),granularity:c})),g=0,E,m=[];g<y.attributes.position.values.length;g+=3)E=y.attributes.position.values,m.push(new p.Cartesian3(E[g],E[g+1],E[g+2]));return m},n.CirclePrimitive.prototype.setEditable=function(){if(!this.setEditMode){var c=this,y=o._scene;c.asynchronous=!1,o.registerEditableShape(c),c.setEditMode=function(g){if(this._editMode!=g)if(o.disableAllHighlights(),g){o.setEdited(this);var E=this;if(this._markers==null){let M=function(){return E.getCircleCartesianCoordinates(p.Math.PI_OVER_TWO)},_=function(){c.executeListeners({name:"onEdited",center:c.getCenter(),radius:c.getRadius()})};var m=new n.BillboardGroup(o,N),w={dragHandlers:{onDrag:function(b,P){c.setRadius(p.Cartesian3.distance(c.getCenter(),P)),m.updateBillboardsPositions(M())},onDragEnd:function(b,P){_()}},tooltip:function(){return"Drag to change the radius"}};m.addBillboards(M(),w),this._markers=m,this._globeClickhandler=new p.ScreenSpaceEventHandler(y.canvas),this._globeClickhandler.setInputAction(function(b){var P=y.pick(b.position);P&&P.primitive||E.setEditMode(!1)},p.ScreenSpaceEventType.LEFT_CLICK),m.setOnTop()}this._editMode=!0}else this._markers!=null&&(this._markers.remove(),this._markers=null,this._globeClickhandler.destroy()),this._editMode=!1},c.setHighlighted=a,J(c),c.setEditMode(!1)}}},n.DrawHelperWidget=function(){function o(a,v){if(!p.defined(v.container))throw new p.DeveloperError("Container is required");var c={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:L,polygonDrawingOptions:u,extentDrawingOptions:h,circleDrawingOptions:C};X(v,c);var y=this,g=document.createElement("DIV");g.className="toolbar",v.container.appendChild(g);function E(M,_,b,P){var I=document.createElement("DIV");I.className="button",I.title=b,g.appendChild(I),I.onclick=P;var V=document.createElement("SPAN");I.appendChild(V);var Y=document.createElement("IMG");return Y.src=_,V.appendChild(Y),I}var m=a._scene;E("marker",v.markerIcon,"Click to start drawing a 2D marker",function(){a.startDrawingMarker({callback:function(M){y.executeListeners({name:"markerCreated",position:M})}})}),E("polyline",v.polylineIcon,"Click to start drawing a 2D polyline",function(){a.startDrawingPolyline({callback:function(M){y.executeListeners({name:"polylineCreated",positions:M})}})}),E("polygon",v.polygonIcon,"Click to start drawing a 2D polygon",function(){a.startDrawingPolygon({callback:function(M){y.executeListeners({name:"polygonCreated",positions:M})}})}),E("extent",v.extentIcon,"Click to start drawing an Extent",function(){a.startDrawingExtent({callback:function(M){y.executeListeners({name:"extentCreated",extent:M})}})}),E("circle",v.circleIcon,"Click to start drawing a Circle",function(){a.startDrawingCircle({callback:function(M,_){y.executeListeners({name:"circleCreated",center:M,radius:_})}})});var w=document.createElement("DIV");w.className="divider",g.appendChild(w),E("clear",v.clearIcon,"Remove all primitives",function(){m.primitives.removeAll()}),J(this)}return o}(),n.prototype.addToolbar=function(o,a){return a=B(a,{container:o}),new n.DrawHelperWidget(this,a)};function ee(o,a){var v=new p.Rectangle;v.west=Math.min(o.longitude,a.longitude),v.east=Math.max(o.longitude,a.longitude),v.south=Math.min(o.latitude,a.latitude),v.north=Math.max(o.latitude,a.latitude);var c=p.Math.EPSILON7;return v.east-v.west<c&&(v.east+=c*2),v.north-v.south<c&&(v.north+=c*2),v}function j(o,a){return o.longitude.toFixed(a||3)+", "+o.latitude.toFixed(a||3)}function U(o,a){if(o==null||typeof o!="object"||o.constructor!=Object&&o.constructor!=Array)return o;if(o.constructor==Date||o.constructor==RegExp||o.constructor==Function||o.constructor==String||o.constructor==Number||o.constructor==Boolean)return new o.constructor(o);a=a||new o.constructor;for(var v in o)a[v]=typeof a[v]>"u"?U(o[v],null):a[v];return a}function X(o,a){o=o||{};var v;for(v in a)o[v]===void 0&&(o[v]=U(a[v]))}function B(o,a){var v=U(o),c;for(c in a)v[c]===void 0&&(v[c]=U(a[c]));return v}function q(o,a,v){o[a]=v}function J(o){o._listeners={},o.addListener=function(a,v){return this._listeners[a]=this._listeners[a]||[],this._listeners[a].push(v),this._listeners[a].length},o.executeListeners=function(a,v){if(this._listeners[a.name]&&this._listeners[a.name].length>0)for(var c=0;c<this._listeners[a.name].length;c++)this._listeners[a.name][c](a);else v&&v(a)}}return n}();const ii=2,ri=(e,i)=>{switch(e){case re.BOX:{if(i.features.length!==ii)throw new Error(`${e} must have 2 points`);const t=H.find(i.features,l=>{var s;return((s=l.properties)==null?void 0:s.type)===Se.BOTTOM_LEFT}),n=H.find(i.features,l=>{var s;return((s=l.properties)==null?void 0:s.type)===Se.TOP_RIGHT});if(n&&t){if(t.geometry.coordinates[0]===n.geometry.coordinates[0]&&t.geometry.coordinates[1]===n.geometry.coordinates[1])throw new Error(`${e} must define BOTTOM_LEFT and TOP_RIGHT different points`);return S.Rectangle.fromDegrees(t.geometry.coordinates[0],t.geometry.coordinates[1],n.geometry.coordinates[0],n.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`)}},oi=e=>{const i=e.map(t=>{const n=S.Cartographic.fromCartesian(t);return[S.Math.toDegrees(n.longitude),S.Math.toDegrees(n.latitude)]});return i.push(i[0]),{type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[i]}}},si=e=>{const i=Ze.lineString([[S.Math.toDegrees(e.west),S.Math.toDegrees(e.south)],[S.Math.toDegrees(e.east),S.Math.toDegrees(e.north)]]);return je(Ke(i))},ai=e=>{const i=Ze.lineString([[e.west,e.south],[e.east,e.north]]);return je(Ke(i)).geometry.coordinates[0].map(n=>S.Cartesian3.fromRadiansArray(n)[0])};class li extends S.Color{}const ci=e=>{const{drawState:i,drawingMaterial:t,drawingVertexColor:n,material:l,hollow:s,outlineWidth:u}=e,h=ue(),[C,T]=d.useState();d.useEffect(()=>{T(new ye(h,t,n))},[]),d.useEffect(()=>{if(C){const D=C;if(i.drawing)switch(i.type){case re.POLYGON:h.scene.globe.depthTestAgainstTerrain=!1,D.startDrawingPolygon({callback:A=>{i.handler({primitive:A,type:re.POLYGON,geojson:oi(A)})}});break;case re.BOX:h.scene.globe.depthTestAgainstTerrain=!1,D.startDrawingExtent({callback:A=>{i.handler({primitive:A,type:re.BOX,geojson:si(A)})}});break;default:throw new Error(`[CESIUM DRAW]: ${i.type} unrecognized primitive to draw.`)}else D.stopDrawing(),h.scene.globe.depthTestAgainstTerrain=!0}},[i,C]);const L=D=>{let A=D.coordinates!==void 0?D.coordinates:ri(D.type,D.geojson);if(s!==!0)switch(D.type){case re.BOX:return r.jsx(Ct,{coordinates:A,material:l??t});case re.POLYGON:return r.jsx(Et,{hierarchy:new S.PolygonHierarchy(A),material:l??t});default:return r.jsx(r.Fragment,{})}else{switch(D.type){case re.BOX:A=ai(A);break;case re.POLYGON:A=[...A,A[0]];break;default:return r.jsx(r.Fragment,{})}return r.jsx(ni,{positions:A,width:u??1,material:l??t})}};return r.jsx(wt,{...e,children:e.drawings.map((D,A)=>r.jsxs(yt,{name:D.name,children:[r.jsxs(vt,{children:[r.jsxs("h1",{children:["Drawed Entity ",D.name]}),r.jsx("p",{children:"This is description of drawed entity"})]}),L(D)]},D.id))})};class di extends S.PolylineDashMaterialProperty{}class ui extends S.ConstantProperty{}class hi extends S.ConstantPositionProperty{}class gi extends S.Cartesian2{}class pi extends S.Cartesian3{}class fi extends S.Cartographic{}class mi extends S.BoundingSphere{}class yi extends S.Ellipsoid{}class vi extends S.GeographicTilingScheme{}class Ei extends S.Rectangle{}class Ci extends S.Resource{}class wi extends S.EllipsoidTerrainProvider{}class Si extends S.CesiumTerrainProvider{}const Ti=S.VerticalOrigin,bi=S.LabelStyle,dr="",_i=38,Mi=40,Pi=13,Li=14,Ai=27,Ii=9,ki=10,Di=100,Oi=e=>{const[i,t]=d.useState(e.defaultValue??""),[n,l]=d.useState(!1),[s,u]=d.useState({helperVisible:!1,left:0,right:0,trigger:"",matchLength:0,matchStart:0,options:[],selection:0,top:0,value:"",caret:0,width:"unset"}),h=d.useRef(null);d.useEffect(()=>(window.addEventListener("resize",$),()=>{try{window.removeEventListener("resize",$)}catch(y){console.log('WINDOW "resize" remove listener failed',y)}}),[]),d.useEffect(()=>{typeof e.value<"u"&&t(e.value),typeof e.defaultValue<"u"&&t(e.defaultValue)},[e.value,e.defaultValue]),d.useEffect(()=>{const{options:y}=e,{caret:g}=s;ee(i,g,y)},[e]);const C=(y,g,E)=>{const{trigger:m,matchAny:w,regex:M}=e,_=new RegExp(M);let b=m;Array.isArray(b)||(b=new Array(m)),b.sort();const P={};Array.isArray(E)&&b.forEach(Y=>{P[Y]=E});const I=T(b,_);let V={};for(let Y=0;Y<I.length;Y++){const{triggerStr:k,triggerMatch:O,triggerLength:F}=I[Y];for(let z=g-1;z>=0;--z){const ae=y.substring(z,g).match(_);let ne=-1;if(F>0){const ce=O?z:z-F+1;if(ce<0||(L(k,y,ce)&&(ne=ce+F),!ae&&ne<0))break}else{if(ae&&z>0)continue;if(ne=z===0&&ae?0:z+1,g-ne===0)break}if(ne>=0){const ce=P[k];if(!Array.isArray(ce))continue;const Ce=y.substring(ne,g),Ui=ce.filter(Ki=>{const Tt=Ki.toLowerCase().indexOf(Ce.toLowerCase());return Tt!==-1&&(w||Tt===0)}),$i=k,qi=Ce.length;V={...V,trigger:$i,matchStart:ne,matchLength:qi,options:Ui}}}}return V},T=(y,g)=>y.map(m=>({triggerStr:m,triggerMatch:m.match(g),triggerLength:m.length})),L=(y,g,E)=>!y||!y.length||g.substr(E,y.length)===y,D=y=>{const{onChange:g,options:E,spaceRemovers:m,spacer:w,value:M}=e,_=i,b=y.target.value,P=Ye(A(y.target)).end;if(b.length||G({...s,helperVisible:!1}),t(b),G({...s,caret:P,value:y.target.value}),!b.length||!P)return g(y.target.value);if(n&&m.length&&b.length>2&&w.length){for(let I=0;I<Math.max(_.length,b.length);++I)if(_[I]!==b[I]){if(I>=2&&b[I-1]===w&&m.indexOf(b[I-2])===-1&&m.indexOf(b[I])!==-1&&!H.isEmpty(C(b.substring(0,I-2),P-3,E))){const V=`${b.slice(0,I-1)}${b.slice(I,I+1)}${b.slice(I-1,I)}${b.slice(I+1)}`;return R(I+1),h.current!==null&&(h.current.value=V),M||G({...s,value:V}),g(V)}break}l(!1)}return ee(b,P,E),g(y.target.value)},A=y=>{if(y!==void 0)if(y.children.length>0){const g=y.getElementsByTagName("textarea");if(g.length>0)return g[0];const E=y.getElementsByTagName("input");if(E.length>0)return E[0]}else return y},N=y=>{const{helperVisible:g,options:E,selection:m}=s,{onKeyDown:w,passThroughEnter:M}=e;if(g)switch(y.keyCode){case Ai:y.preventDefault(),j();break;case _i:y.preventDefault(),G({...s,selection:(E.length+m-1)%E.length});break;case Mi:y.preventDefault(),G({...s,selection:(m+1)%E.length});break;case Li:case Pi:M||y.preventDefault(),Z(m);break;case Ii:Z(m);break;default:w(y);break}else w(y)},$=()=>{G({...s,helperVisible:!1})},Z=y=>{const{spacer:g,onSelect:E,changeOnSelect:m}=e,{matchStart:w,matchLength:M,options:_,trigger:b}=s,P=_[y],I=i,V=I.substring(0,w-b.length),Y=I.substring(w+M),k={target:h.current},O=m(b,P);k.target!==null&&(k.target.value=`${V}${O}${g}${Y}`),D(k),k.target!==null&&E(k.target.value),j(),R(V.length+O.length+1),l(!0)},R=y=>{G({...s,caret:y});const g=A(h.current);Ye.setCaretPosition(g,y)},G=y=>{setTimeout(()=>{u({...y})},0)},ee=(y,g,E)=>{const m=h.current;if(h.current===null)return;const w=A(m);if(w===void 0)return;const M=m.getBoundingClientRect(),_=C(y,g,E);if(Object.keys(_).length>0&&w!==null){const b=Bt(w,g),P=w.getBoundingClientRect(),{minChars:I,onRequestOptions:V,requestOnlyIfNoOptions:Y,mode:k}=e;let O,F,z,me="unset";k==="assist"?(O=m===w?b.top+w.offsetTop:b.top+M.top,F=Math.min(b.left+w.offsetLeft-ki,w.offsetLeft+P.width-Di)):(O=M.top+m.offsetHeight,F=m.offsetLeft,z=m.offsetLeft-m.offsetWidth,me=`${M.width}px`),_.matchLength>=I&&(_.options.length>1||_.options.length===1&&_.options[0].length!==_.matchLength)?G({...s,value:y,helperVisible:!0,top:O,left:F,right:z,width:me,..._}):((!Y||!_.options.length)&&V(y.substr(_.matchStart,_.matchLength)),j())}else j()},j=()=>{setTimeout(()=>{G({...s,helperVisible:!1,selection:0})},100)},U=()=>{const{helperVisible:y,left:g,right:E,matchStart:m,matchLength:w,options:M,selection:_,top:b,value:P,width:I}=s;if(!y)return null;const{maxOptions:V,offsetX:Y,offsetY:k,direction:O}=e;if(M.length===0)return null;if(_>=M.length)return G({...s,selection:0}),null;const F=V===0?M.length:V,z=M.slice(0,F).map((ae,ne)=>{const ce=ae.toLowerCase().indexOf(P.substr(m,w).toLowerCase());return r.jsxs("li",{className:ne===_?"active":void 0,onClick:()=>{Z(ne)},onMouseEnter:()=>{G({...s,selection:ne})},children:[ae.slice(0,ce),r.jsx("strong",{children:ae.substr(ce,w)}),ae.slice(ce+w)]},ae)}),me=O==="ltr"?{left:g+Y}:{right:E+Y};return r.jsx("ul",{className:"react-autocomplete-input",style:{...me,top:b+k,width:I},children:z})},{Component:X,ComponentProps:B,defaultValue:q,disabled:J,onBlur:o,value:a,...v}=e,c=Object.assign({},v);return Object.keys(e).forEach(y=>{delete c[y]}),r.jsxs(r.Fragment,{children:[d.cloneElement(X,{disabled:J,onBlur:o,onChange:D,onKeyDown:N,ref:h,value:i,...c,...B}),U()]})},xi={Component:r.jsx("textarea",{}),ComponentProps:{},defaultValue:void 0,disabled:!1,maxOptions:6,onBlur:e=>{},onChange:e=>{},onKeyDown:e=>{},onRequestOptions:e=>{},onSelect:e=>{},changeOnSelect:(e,i)=>`${e}${i}`,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"},Bi=e=>{let i={...xi,...e};return e.mode==="autocomplete"&&(i={...i,trigger:"",regex:".",spacer:""}),r.jsx(Oi,{...i})},Ae={formatFileModDate:(e,i)=>{const t=x.FileHelper.getModDate(i);return t?e.formatDate(t,{dateStyle:"short",timeStyle:"short"}):null},formatFileSize:(e,i)=>{if(!i||typeof i.size!="number")return null;const t=i.size,n=Ft(t,{bits:!1,output:"object"});return n.symbol==="B"?`${Math.round(n.value/10)/100} KB`:n.symbol==="KB"?`${Math.round(n.value)} ${n.symbol}`:`${n.value} ${n.symbol.toUpperCase()}`}},Ni={locale:le.EN,formatters:{...Ae}},Fi={locale:le.RU,formatters:{...Ae},messages:{"chonky.toolbar.searchPlaceholder":"Поиск","chonky.toolbar.visibleFileCount":`{fileCount, plural,
2
2
  one {# файл}
3
3
  few {# файла}
4
4
  other {# файлов}
@@ -10,7 +10,7 @@
10
10
  =0 {}
11
11
  one {# скрыт}
12
12
  other {# скрыто}
13
- }`,"chonky.fileList.nothingToShow":"Здесь пусто!","chonky.contextMenu.browserMenuShortcut":"Меню браузера: {shortcut}",["chonky.actionGroups.Actions"]:"Действия",["chonky.actionGroups.Options"]:"Опции",[`chonky.actions.${x.ChonkyActions.OpenParentFolder.id}.button.name`]:"Открыть родительскую папку",[`chonky.actions.${x.ChonkyActions.CreateFolder.id}.button.name`]:"Новая папка",[`chonky.actions.${x.ChonkyActions.CreateFolder.id}.button.tooltip`]:"Создать новую папку",[`chonky.actions.${x.ChonkyActions.DeleteFiles.id}.button.name`]:"Удалить файлы",[`chonky.actions.${x.ChonkyActions.OpenSelection.id}.button.name`]:"Открыть выделение",[`chonky.actions.${x.ChonkyActions.SelectAllFiles.id}.button.name`]:"Выделить все",[`chonky.actions.${x.ChonkyActions.ClearSelection.id}.button.name`]:"Сбросить выделение",[`chonky.actions.${x.ChonkyActions.EnableListView.id}.button.name`]:"Показать список",[`chonky.actions.${x.ChonkyActions.EnableGridView.id}.button.name`]:"Показать иконки",[`chonky.actions.${x.ChonkyActions.SortFilesByName.id}.button.name`]:"Сорт. по имени",[`chonky.actions.${x.ChonkyActions.SortFilesBySize.id}.button.name`]:"Сорт. по размеру",[`chonky.actions.${x.ChonkyActions.SortFilesByDate.id}.button.name`]:"Сорт. по дате",[`chonky.actions.${x.ChonkyActions.ToggleHiddenFiles.id}.button.name`]:"Скрытые файлы",[`chonky.actions.${x.ChonkyActions.ToggleShowFoldersFirst.id}.button.name`]:"Папки в начале"}},Bi={locale:le.HE,formatters:{...Ae},messages:{"chonky.toolbar.searchPlaceholder":"חיפוש","chonky.toolbar.visibleFileCount":`{fileCount, plural,
13
+ }`,"chonky.fileList.nothingToShow":"Здесь пусто!","chonky.contextMenu.browserMenuShortcut":"Меню браузера: {shortcut}",["chonky.actionGroups.Actions"]:"Действия",["chonky.actionGroups.Options"]:"Опции",[`chonky.actions.${x.ChonkyActions.OpenParentFolder.id}.button.name`]:"Открыть родительскую папку",[`chonky.actions.${x.ChonkyActions.CreateFolder.id}.button.name`]:"Новая папка",[`chonky.actions.${x.ChonkyActions.CreateFolder.id}.button.tooltip`]:"Создать новую папку",[`chonky.actions.${x.ChonkyActions.DeleteFiles.id}.button.name`]:"Удалить файлы",[`chonky.actions.${x.ChonkyActions.OpenSelection.id}.button.name`]:"Открыть выделение",[`chonky.actions.${x.ChonkyActions.SelectAllFiles.id}.button.name`]:"Выделить все",[`chonky.actions.${x.ChonkyActions.ClearSelection.id}.button.name`]:"Сбросить выделение",[`chonky.actions.${x.ChonkyActions.EnableListView.id}.button.name`]:"Показать список",[`chonky.actions.${x.ChonkyActions.EnableGridView.id}.button.name`]:"Показать иконки",[`chonky.actions.${x.ChonkyActions.SortFilesByName.id}.button.name`]:"Сорт. по имени",[`chonky.actions.${x.ChonkyActions.SortFilesBySize.id}.button.name`]:"Сорт. по размеру",[`chonky.actions.${x.ChonkyActions.SortFilesByDate.id}.button.name`]:"Сорт. по дате",[`chonky.actions.${x.ChonkyActions.ToggleHiddenFiles.id}.button.name`]:"Скрытые файлы",[`chonky.actions.${x.ChonkyActions.ToggleShowFoldersFirst.id}.button.name`]:"Папки в начале"}},Gi={locale:le.HE,formatters:{...Ae},messages:{"chonky.toolbar.searchPlaceholder":"חיפוש","chonky.toolbar.visibleFileCount":`{fileCount, plural,
14
14
  one {פריט #}
15
15
  other {# פריטים}
16
16
  }`,"chonky.toolbar.selectedFileCount":`{fileCount, plural,
@@ -21,4 +21,4 @@
21
21
  =0 {}
22
22
  one {# נסתר}
23
23
  other {# נסתרים}
24
- }`,"chonky.fileList.nothingToShow":"ריק","chonky.contextMenu.browserMenuShortcut":"תפריט דפדפן: {shortcut}",["chonky.actionGroups.Actions"]:"פעולות",["chonky.actionGroups.Options"]:"אפשרויות",[`chonky.actions.${x.ChonkyActions.OpenParentFolder.id}.button.name`]:"פתח סיפריית אב",[`chonky.actions.${x.ChonkyActions.CreateFolder.id}.button.name`]:"סיפרייה חדשה",[`chonky.actions.${x.ChonkyActions.CreateFolder.id}.button.tooltip`]:"צור סיפרייה חדשה",[`chonky.actions.${x.ChonkyActions.DeleteFiles.id}.button.name`]:"מחק",[`chonky.actions.${x.ChonkyActions.OpenSelection.id}.button.name`]:"פתח את הבחירה",[`chonky.actions.${x.ChonkyActions.SelectAllFiles.id}.button.name`]:"בחר הכל",[`chonky.actions.${x.ChonkyActions.ClearSelection.id}.button.name`]:"אפס את הבחירה",[`chonky.actions.${x.ChonkyActions.EnableListView.id}.button.name`]:"תצוגת רשימה",[`chonky.actions.${x.ChonkyActions.EnableGridView.id}.button.name`]:"תצוגת גריד",[`chonky.actions.${x.ChonkyActions.SortFilesByName.id}.button.name`]:"מיון לפי שם",[`chonky.actions.${x.ChonkyActions.SortFilesBySize.id}.button.name`]:"מיון לפי גודל",[`chonky.actions.${x.ChonkyActions.SortFilesByDate.id}.button.name`]:"מיון לפי תאריך",[`chonky.actions.${x.ChonkyActions.ToggleHiddenFiles.id}.button.name`]:"קבצים נסתרים",[`chonky.actions.${x.ChonkyActions.ToggleShowFoldersFirst.id}.button.name`]:"הצגת תיקיות בראש הרשימה"}},Ni={[le.EN]:Di,[le.RU]:xi,[le.HE]:Bi},lr="";class Fi extends x.FileHelper{}const Gi=x.ChonkyActions,wt={listView:x.ChonkyActions.EnableListView.id,gridView:x.ChonkyActions.EnableGridView.id};x.setChonkyDefaults({iconComponent:Bt.ChonkyIconFA});const Hi=d.memo(d.forwardRef(({theme:e,styles:i={height:"100%",minWidth:"600px"},defaultView:t=wt.listView,readOnlyMode:n=!1,locale:l,files:s,folderChain:u,onFileAction:h,...C},T)=>{const L=d.useCallback(q=>null,[]);pe.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 O=q=>q.replace(/([A-Z])/g,J=>"-"+J.toLowerCase()),A=d.useMemo(()=>e!==void 0?Object.keys(e).reduce((J,o)=>{const a=e[o];return o=o.startsWith("--")?o:`--fp-theme-${O(o)}`,J[o]=a,J},{}):{},[e]),[N,U]=d.useState(!1),[Z,R]=d.useState(),[G,ee]=d.useState(!1),[j,$]=d.useState(),[X,B]=d.useState();return d.useEffect(()=>{e&&U(!0),R(t),n?ee(!0):$([x.ChonkyActions.CreateFolder,x.ChonkyActions.DeleteFiles]),l!==void 0&&B(Ni[l])},[e,t,n,l]),r.jsx(se,{style:{...i,...A},children:r.jsx(x.FullFileBrowser,{ref:T,files:s??[],folderChain:u,onFileAction:q=>{typeof h=="function"&&h(q)},thumbnailGenerator:L,defaultFileViewActionId:Z,disableDragAndDrop:G,fileActions:j,darkMode:N,i18n:X,...C})})}));f.useMediaQuery=Tt,Object.defineProperty(f,"CesiumMath",{enumerable:!0,get:()=>S.Math}),Object.defineProperty(f,"cesiumSampleTerrainMostDetailed",{enumerable:!0,get:()=>S.sampleTerrainMostDetailed}),f.Autocomplete=Oi,f.BboxCorner=Se,f.Box=se,f.COORDINATES_MERCATOR_FRACTION_DIGITS=be,f.COORDINATES_WGS_FRACTION_DIGITS=Te,f.Cesium3DTileset=Kn,f.CesiumBoundingSphere=gi,f.CesiumCartesian2=di,f.CesiumCartesian3=ui,f.CesiumCartographic=hi,f.CesiumCesiumTerrainProvider=Ei,f.CesiumColor=oi,f.CesiumConstantPositionProperty=ci,f.CesiumConstantProperty=li,f.CesiumCustomDataSource=Ct,f.CesiumDrawingsDataSource=si,f.CesiumEllipsoid=pi,f.CesiumEllipsoidTerrainProvider=vi,f.CesiumEntity=mt,f.CesiumEntityDescription=Qn,f.CesiumEntityStaticDescription=yt,f.CesiumGeographicTilingScheme=fi,f.CesiumGeojsonLayer=jn,f.CesiumImageryLayer=Ee,f.CesiumLabelStyle=wi,f.CesiumMap=Un,f.CesiumOSMLayer=Jn,f.CesiumPolygonGraphics=vt,f.CesiumPolylineDashMaterialProperty=ai,f.CesiumRectangle=mi,f.CesiumRectangleGraphics=Et,f.CesiumResource=yi,f.CesiumSceneMode=ie,f.CesiumVerticalOrigin=Ci,f.CesiumViewer=zn,f.CesiumWMSLayer=Yn,f.CesiumWMTSLayer=Xn,f.CesiumXYZLayer=Zn,f.CssBaseline=mn,f.DateTimePicker=zt,f.DateTimeRangePicker=Je,f.DateTimeRangePickerFormControl=Vt,f.DrawType=re,f.FileHelper=Fi,f.FilePicker=Hi,f.FilePickerActions=Gi,f.FilePickerView=wt,f.MapFilterContainer=hn,f.Popover=Qe,f.Proj=de,f.ScopedCssBaseline=yn,f.SmartTable=fn,f.SupportedLocales=le,f.defaultFormatters=Ae,f.mapMcToMuiTheme=Ze,f.useCesiumMap=ue,f.useMappedMuiTheme=Oe,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})});
24
+ }`,"chonky.fileList.nothingToShow":"ריק","chonky.contextMenu.browserMenuShortcut":"תפריט דפדפן: {shortcut}",["chonky.actionGroups.Actions"]:"פעולות",["chonky.actionGroups.Options"]:"אפשרויות",[`chonky.actions.${x.ChonkyActions.OpenParentFolder.id}.button.name`]:"פתח סיפריית אב",[`chonky.actions.${x.ChonkyActions.CreateFolder.id}.button.name`]:"סיפרייה חדשה",[`chonky.actions.${x.ChonkyActions.CreateFolder.id}.button.tooltip`]:"צור סיפרייה חדשה",[`chonky.actions.${x.ChonkyActions.DeleteFiles.id}.button.name`]:"מחק",[`chonky.actions.${x.ChonkyActions.OpenSelection.id}.button.name`]:"פתח את הבחירה",[`chonky.actions.${x.ChonkyActions.SelectAllFiles.id}.button.name`]:"בחר הכל",[`chonky.actions.${x.ChonkyActions.ClearSelection.id}.button.name`]:"אפס את הבחירה",[`chonky.actions.${x.ChonkyActions.EnableListView.id}.button.name`]:"תצוגת רשימה",[`chonky.actions.${x.ChonkyActions.EnableGridView.id}.button.name`]:"תצוגת גריד",[`chonky.actions.${x.ChonkyActions.SortFilesByName.id}.button.name`]:"מיון לפי שם",[`chonky.actions.${x.ChonkyActions.SortFilesBySize.id}.button.name`]:"מיון לפי גודל",[`chonky.actions.${x.ChonkyActions.SortFilesByDate.id}.button.name`]:"מיון לפי תאריך",[`chonky.actions.${x.ChonkyActions.ToggleHiddenFiles.id}.button.name`]:"קבצים נסתרים",[`chonky.actions.${x.ChonkyActions.ToggleShowFoldersFirst.id}.button.name`]:"הצגת תיקיות בראש הרשימה"}},Hi={[le.EN]:Ni,[le.RU]:Fi,[le.HE]:Gi},ur="";class Vi extends x.FileHelper{}const zi=x.ChonkyActions,St={listView:x.ChonkyActions.EnableListView.id,gridView:x.ChonkyActions.EnableGridView.id};x.setChonkyDefaults({iconComponent:Nt.ChonkyIconFA});const Wi=d.memo(d.forwardRef(({theme:e,styles:i={height:"100%",minWidth:"600px"},defaultView:t=St.listView,readOnlyMode:n=!1,locale:l,files:s,folderChain:u,onFileAction:h,...C},T)=>{const L=d.useCallback(q=>null,[]);pe.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 D=q=>q.replace(/([A-Z])/g,J=>"-"+J.toLowerCase()),A=d.useMemo(()=>e!==void 0?Object.keys(e).reduce((J,o)=>{const a=e[o];return o=o.startsWith("--")?o:`--fp-theme-${D(o)}`,J[o]=a,J},{}):{},[e]),[N,$]=d.useState(!1),[Z,R]=d.useState(),[G,ee]=d.useState(!1),[j,U]=d.useState(),[X,B]=d.useState();return d.useEffect(()=>{e&&$(!0),R(t),n?ee(!0):U([x.ChonkyActions.CreateFolder,x.ChonkyActions.DeleteFiles]),l!==void 0&&B(Hi[l])},[e,t,n,l]),r.jsx(se,{style:{...i,...A},children:r.jsx(x.FullFileBrowser,{ref:T,files:s??[],folderChain:u,onFileAction:q=>{typeof h=="function"&&h(q)},thumbnailGenerator:L,defaultFileViewActionId:Z,disableDragAndDrop:G,fileActions:j,darkMode:N,i18n:X,...C})})}));f.useMediaQuery=bt,Object.defineProperty(f,"CesiumMath",{enumerable:!0,get:()=>S.Math}),Object.defineProperty(f,"cesiumSampleTerrainMostDetailed",{enumerable:!0,get:()=>S.sampleTerrainMostDetailed}),f.Autocomplete=Bi,f.BboxCorner=Se,f.Box=se,f.COORDINATES_MERCATOR_FRACTION_DIGITS=be,f.COORDINATES_WGS_FRACTION_DIGITS=Te,f.Cesium3DTileset=Xn,f.CesiumBoundingSphere=mi,f.CesiumCartesian2=gi,f.CesiumCartesian3=pi,f.CesiumCartographic=fi,f.CesiumCesiumTerrainProvider=Si,f.CesiumColor=li,f.CesiumConstantPositionProperty=hi,f.CesiumConstantProperty=ui,f.CesiumCustomDataSource=wt,f.CesiumDrawingsDataSource=ci,f.CesiumEllipsoid=yi,f.CesiumEllipsoidTerrainProvider=wi,f.CesiumEntity=yt,f.CesiumEntityDescription=ti,f.CesiumEntityStaticDescription=vt,f.CesiumGeographicTilingScheme=vi,f.CesiumGeojsonLayer=Zn,f.CesiumImageryLayer=Ee,f.CesiumLabelStyle=bi,f.CesiumMap=jn,f.CesiumOSMLayer=ei,f.CesiumPolygonGraphics=Et,f.CesiumPolylineDashMaterialProperty=di,f.CesiumRectangle=Ei,f.CesiumRectangleGraphics=Ct,f.CesiumResource=Ci,f.CesiumSceneMode=ie,f.CesiumVerticalOrigin=Ti,f.CesiumViewer=$n,f.CesiumWMSLayer=Jn,f.CesiumWMTSLayer=Qn,f.CesiumXYZLayer=Rn,f.CssBaseline=En,f.DateTimePicker=Wt,f.DateTimeRangePicker=Qe,f.DateTimeRangePickerFormControl=zt,f.DrawType=re,f.FileHelper=Vi,f.FilePicker=Wi,f.FilePickerActions=zi,f.FilePickerView=St,f.MapFilterContainer=gn,f.Popover=Re,f.Proj=de,f.ScopedCssBaseline=Cn,f.SmartTable=vn,f.SupportedLocales=le,f.defaultFormatters=Ae,f.mapMcToMuiTheme=Je,f.useCesiumMap=ue,f.useMappedMuiTheme=Oe,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})});
@@ -0,0 +1 @@
1
+ export { default } from '@material-ui/core/SvgIcon';
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ import createSvgIcon from './utils/createSvgIcon';
3
+ export default createSvgIcon( /*#__PURE__*/React.createElement("path", {
4
+ d: "M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"
5
+ }), 'KeyboardArrowDown');
@@ -0,0 +1 @@
1
+ export { default } from '@material-ui/core/SvgIcon';
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ import createSvgIcon from './utils/createSvgIcon';
3
+ export default createSvgIcon( /*#__PURE__*/React.createElement("path", {
4
+ d: "M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"
5
+ }), 'KeyboardArrowUp');
@@ -0,0 +1 @@
1
+ export { createSvgIcon as default } from "@material-ui/core/utils";
@@ -0,0 +1 @@
1
+ export { createSvgIcon as default } from '@material-ui/core/utils';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@map-colonies/react-components",
3
- "version": "4.0.2",
3
+ "version": "4.0.3",
4
4
  "main": "./dist/@map-colonies/react-components.umd.js",
5
5
  "module": "./dist/@map-colonies/react-components.es.js",
6
6
  "types": "./dist/index.d.ts",
@@ -26,7 +26,6 @@
26
26
  "@here/quantized-mesh-decoder": "^1.2.8",
27
27
  "@map-colonies/react-core": "^4.0.1",
28
28
  "@material-ui/core": "^4.11.0",
29
- "@material-ui/icons": "^4.9.1",
30
29
  "@material-ui/pickers": "^3.2.10",
31
30
  "@turf/bbox": "^6.0.1",
32
31
  "@turf/bbox-polygon": "^6.0.1",
@@ -69,5 +68,5 @@
69
68
  "files": [
70
69
  "dist"
71
70
  ],
72
- "gitHead": "2ec0cb9f03b289e39379cc805adc4711a60b5777"
71
+ "gitHead": "743519150ee5bd37a9dc053d3fbf4ca07cea121e"
73
72
  }