1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./AboutModule.js","./vendor.js","./rolldown-runtime.js","../css/AboutModule.css","./AddWMS.js","../css/AddWMS.css","./BufferAnalysis.js","./ContactFormular.js","./AccordionItem.js","../css/AccordionItem.css","../css/ContactFormular.css","./CoordToolkit.js","./initProjections.js","../css/CoordToolkit.css","./CopyrightConstraints.js","../css/CopyrightConstraints.css","./CompareFeatures.js","./TableComponent.js","./ExportButtonGeoJSON.js","../css/ExportButtonGeoJSON.css","./vue-multiselect.esm.js","../css/TableComponent.css","../css/CompareFeatures.css","./CompareMaps.js","../css/CompareMaps.css","./CustomMenuElement.js","./DrawModule.js","./DrawTypes.js","./DrawLayout.js","../css/DrawLayout.css","../css/DrawModule.css","./DrawItem.js","../css/DrawItem.css","./FeatureLister.js","./GraphicalSelect.js","../css/FeatureLister.css","./FileImport.js","../css/FileImport.css","./FilterGeneral.js","./getOAFFeature.js","./isSameOrAfter.js","./vue-datepicker-next.js","../css/vue-datepicker-next.css","./ButtonGroup2.js","../css/ButtonGroup2.css","../css/FilterGeneral.css","../css/vue-multiselect.css","./MenuFolder.js","./LanguageItem.js","../css/LanguageItem.css","./LayerClusterToggler.js","../css/LayerClusterToggler.css","./LayerInformation.js","./LegendSingleLayer.js","../css/LegendSingleLayer.css","../css/LayerInformation.css","./LayerPills.js","../css/LayerPills.css","./LayerSelection.js","../css/LayerSelection.css","./LayerSlider.js","../css/LayerSlider.css","./LayerSwiper.js","../css/LayerSwiper.css","./LegendContainer.js","../css/LegendContainer.css","./LoginComponent.js","../css/LoginComponent.css","./MeasureInMap.js","../css/MeasureInMap.css","./Modeler3D.js","./ModalItem.js","../css/ModalItem.css","./three.core.js","../css/Modeler3D.css","./MouseHover.js","../css/MouseHover.css","./NewsView.js","../css/NewsView.css","./OpenConfig.js","../css/OpenConfig.css","./PortalFooter.js","../css/PortalFooter.css","./PrintMap.js","../css/PrintMap.css","./RoutingTemplate.js","../css/RoutingTemplate.css","./ScaleSwitcher.js","./SelectFeatures.js","../css/SelectFeatures.css","./ShadowTool.js","../css/ShadowTool.css","./ShareView.js","./browser.js","../css/ShareView.css","./StatisticDashboard.js","./describeFeatureType.js","./handleFeatures.js","./debounce.js","../css/StatisticDashboard.css","./StyleVT.js","./WfsSearch.js","../css/WfsSearch.css","./WfsTransaction.js","../css/WfsTransaction.css","./WmsTime.js","../css/WmsTime.css","./gfiOnAddressGaz.js","./waterRiskCheckSearch.js","./mietenspiegelSearch.js","./populationRequest.js","./wps.js","../css/populationRequest.css","./planParken.js","../css/planParken.css","./sdpDownload.js","../css/sdpDownload.css","./streetSmart.js","../css/streetSmart.css","./vcOblique.js","../css/vcOblique.css","./bildungsatlas.js","./BarchartItem.js","./PiechartItem.js","../css/bildungsatlas.css","./boris.js","../css/boris.css","./combinedGfi.js","../css/combinedGfi.css","./dataTable.js","../css/dataTable.css","./dipas.js","../css/dipas.css","./dipasNavigator.js","../css/dipasNavigator.css","./dipasAnalyticsInsights.js","../css/dipasAnalyticsInsights.css","./parking.js","../css/parking.css","./schulinfo.js","../css/schulinfo.css","./solaratlas.js","./sturmflut.js","../css/sturmflut.css","./trafficCount.js","./weekOfYear.js","../css/trafficCount.css","./trinkwasser.js","../css/trinkwasser.css","./verkehrsstaerken.js","../css/verkehrsstaerken.css","./verkehrsfunctions.js","./valuationPrint.js","./mapfishDialog.js","./unionFeatures.js","../css/valuationPrint.css","./commuterFlows.js","../css/commuterFlows.css","./waterRiskCheck.js","./WaterRiskCheckSearchBar.js","../css/WaterRiskCheckSearchBar.css","../css/waterRiskCheck.css","./floodRiskManagement.js","../css/floodRiskManagement.css","./mietenspiegelFormular.js","../css/mietenspiegelFormular.css","./sessionTool.js","./simulationTool.js","../css/simulationTool.css","./bimFactory.js","../css/bimFactory.css","./vpiDashboard.js","./querystring.js","../css/vpiDashboard.css","./geoMarker.js","../css/geoMarker.css","./snippetFeatureInfo.js","./renameKeys.js","../css/snippetFeatureInfo.css","./snippetChart.js","../css/snippetChart.css","./cesium3dTilesInspector.js","./exampleControl.js","./toggleMouseHover.js","./oktagon.js","./quickResponseCode.js","../css/quickResponseCode.css","./addLayerRemotely.js","./drawWithoutGui.js","./DistrictSelector.js","./ToolInfo.js","./display.js","../css/ToolInfo.css","./AlertMessage.js","../css/AlertMessage.css","./esm.js","./DropdownAutocomplete.js","./VProgressLinear.js","../css/VProgressLinear.css","./VSelect.js","./VOverlay.js","./lazy.js","../css/VOverlay.css","./ripple.js","../css/ripple.css","./VAvatar.js","../css/VAvatar.css","./VTextField.js","../css/VTextField.css","./VChip.js","./goto.js","../css/VChip.css","../css/VSelect.css","../css/DropdownAutocomplete.css","./convertToGeoJson.js","./convertFromGeoJson.js","./setBBoxToGeom.js","./getLayerSource.js","./download.js","./convertToGeoJson2.js","./TabBar.js","../css/TabBar.css","./Card.js","./Badges.js","../css/Badges.css","../css/Card.css","./wktParser.js","./TagGroup.js","../css/TagGroup.css","./getBoundingGeometry.js","./esm2.js","./calculateExtent.js","./getMappingJson.js","./prepareDistrictLevels.js","./geomUtils.js","./operations.js","./intersect.js","./getLayerById.js","../css/DistrictSelector.css","./DistrictFinder.js","./CustomCard.js","../css/CustomCard.css","./VSnackbar.js","./VProgressCircular.js","../css/VProgressCircular.css","./layout.js","../css/VSnackbar.css","./chart.js","../css/DistrictFinder.css","./AccessibilityAnalysis.js","./LabeledSli
1der.js","../css/LabeledSlider.css","./ButtonGroup.js","../css/ButtonGroup.css","./unpackCluster.js","./getFlatCoordinates.js","./ResultManagement.js","./SimpleCard.js","../css/SimpleCard.css","../css/AccessibilityAnalysis.css","./Dashboard.js","./VDataTable.js","./VBtn.js","../css/VBtn.css","../css/VDataTable.css","./VRow.js","../css/VRow.css","./ChartItem.js","../css/ChartItem.css","./modifyObject.js","./timeline.js","./ToolBar.js","../css/ToolBar.css","./VApp.js","../css/VApp.css","../css/Dashboard.css","./ColorCodeMap.js","./utils.js","./isEqual.js","./colorScale.js","../css/ColorCodeMap.css","./FeaturesList.js","./getVectorlayerMapping.js","./VDialog.js","../css/VDialog.css","./VSlider.js","../css/VSlider.css","../css/FeaturesList.css","./service.js","./PolygonStyler.js","./VColorPicker.js","../css/VColorPicker.css","../css/PolygonStyler.css","./AreaSelector.js","./VCol.js","./TemplateAdmin.js","./vue-draggable-next.esm-bundler.js","./sort.js","../css/TemplateAdmin.css","./TemplateManager.js","../css/TemplateManager.css","./SaveSession.js","../css/SaveSession.css","./CalculateRatio.js","../css/CalculateRatio.css","./DipasProjects.js","../css/DipasProjects.css","./ReportingTool.js","./AddCardButton.js","../css/AddCardButton.css","../css/ReportingTool.css","./cosiFileImport.js","../css/cosiFileImport.css","./cosiPrintLayoutSelection.js","../css/cosiPrintLayoutSelection.css","./searchBar.js","./potentialDamagedBuilding.js","../css/potentialDamagedBuilding.css","./updateRequirements.js","./HrDraw.js","../css/HrDraw.css","../css/updateRequirements.css","./projects.js","../css/projects.css","./geoAnalyze.js","../css/geoAnalyze.css","./tacticalMark.js","../css/tacticalMark.css","./dataNarrator.js","../css/dataNarrator.css","./storyPlayer.js","./ToastsElement.js","../css/ToastsElement.css","../css/storyPlayer.css","./storyManager.js","../css/storyManager.css","./vuetify.js","../css/vuetify.css"])))=>i.map(i=>d[i]); 2import{o as e,r as t}from"./rolldown-runtime.js";import{$a as n,$r as r,$t as i,Aa as a,Ai as o,Ba as s,Bi as c,Br as l,Bt as u,C as d,Ci as f,Cr as p,D as m,Di as h,Dn as g,E as _,Ea as v,En as ee,Er as te,Fi as y,Fn as ne,Fr as re,Ft as ie,Gi as ae,Gt as b,Hi as oe,Hr as se,Ht as ce,In as le,Ir as x,It as ue,Jr as de,Jt as fe,Ka as pe,Ki as me,Kn as he,Ln as ge,Lr as S,Lt as _e,Ma as ve,Mi as ye,Mn as be,Mr as xe,Ni as Se,Nn as Ce,Nr as we,Nt as Te,O as Ee,Oa as C,Oi as w,On as De,Pi as Oe,Pn as ke,Pr as T,Pt as Ae,Qt as je,Ri as Me,Rn as Ne,Rr as Pe,Rt as Fe,S as Ie,Si as Le,Sn as Re,T as ze,Tn as Be,Tr as Ve,Ur as He,Ut as Ue,Vi as We,Vr as Ge,Vt as Ke,Wa as E,Wi as qe,Wr as Je,Xi as Ye,Xr as Xe,Xt as Ze,Yi as D,Yr as Qe,Yt as $e,Zr as et,Zt as tt,_ as nt,_a as rt,_i as it,_n as at,_r as O,a as ot,ai as st,an as ct,ao as k,ar as lt,b as ut,bn as dt,br as ft,c as pt,ca as A,ci as mt,cn as ht,cr as gt,d as _t,di as vt,dn as yt,ei as bt,f as xt,fi as St,fn as Ct,fo as wt,g as Tt,gi as Et,gn as Dt,gr as j,h as Ot,hi as kt,hn as At,hr as jt,ia as M,ii as Mt,in as Nt,io as Pt,jn as Ft,jr as It,ka as Lt,ki as N,kr as Rt,l as zt,la as P,li as Bt,lr as Vt,m as Ht,mi as Ut,mn as Wt,mr as Gt,n as Kt,na as F,ni as qt,nn as Jt,nr as Yt,o as Xt,oi as Zt,on as Qt,or as $t,p as en,pi as tn,pn as nn,po as rn,pr as an,qa as I,qi as on,qr as sn,r as cn,ra as L,ri as ln,rn as un,rr as dn,sa as R,sn as fn,sr as pn,t as mn,ta as z,tn as hn,tr as gn,ua as _n,un as vn,ur as yn,v as bn,va as xn,vi as Sn,vn as Cn,vr as wn,w as Tn,wi as B,wn as En,wr as Dn,x as On,xi as V,xn as kn,xr as An,y as jn,yn as Mn,yr as Nn,za as Pn,zr as Fn,zt as In}from"./vendor.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})(),rn();function Ln(e){e.use(Oe,{i18next:wt})}function Rn(e,t){let n=window.location.pathname.split(`/`)[2]||window.location.hostname.split(`.`)[0],r=`../mastercode/3_26_0`,i=r.endsWith(`/`)?r:`${r}/`,a=Object.assign({enabled:!1,debug:!1,languages:{de:`deutsch`,en:`english`},fallbackLanguage:`de`,changeLanguageOnStartWhen:[`querystring`,`localStorage`,`navigator`,`htmlTag`],loadPath:`${i}locales/{{lng}}/{{ns}}.json`},e);return Config.portalLanguage!==void 0&&Config.portalLanguage.enabled&&wt.use(Se),wt.on(`initialized`,()=>{a.enabled||wt.changeLanguage(`de`)}),wt.use(ye).init({globalInjection:!0,debug:a.debug,fallbackLng:a.fallbackLanguage,supp
2ortedLngs:Object.keys(a.languages),nonExplicitSupportedLngs:!0,load:`languageOnly`,returnEmptyString:!1,getLanguages:function(){return a.languages},isEnabled:function(){return a.enabled},ns:[`common`],defaultNS:`common`,backend:{loadPath:a.loadPath,crossDomain:!1},detection:{order:a.changeLanguageOnStartWhen,lookupQuerystring:`lng`,lookupCookie:`i18next`,lookupLocalStorage:`i18nextLng_${n}`,lookupFromPathIndex:0,lookupFromSubdomainIndex:0,caches:[`localStorage`],excludeCacheFor:[`cimode`],checkWhitelist:!0},interpolation:{skipOnVariables:!1},appendNamespaceToMissingKey:!0,parseMissingKeyHandler:e=>e.replace(/^(common:|additional:)/,``).replace(/(?<=\s|^)([01]\d|2[0-3])\.([0-5]\d)(?=\s|$)/g,`$1:$2`)}).then(()=>(zn(a),t&&Object.entries(t).forEach(([e,t])=>Object.entries(t).forEach(([t,n])=>wt.addResourceBundle(e,t,n,!0,!0))),{basePath:i,portalId:n,portalLanguage:a}))}function zn({fallbackLanguage:e,languages:t}){let n=wt.language;if(n.includes(`-`)){let r=n.split(`-`)[0];wt.changeLanguage(t[r]?r:e)}}function H(e){return Object.keys(e).reduce((e,t)=>({...e,[t]:e=>e[t]}),{})}function U(e){return Object.keys(e).reduce((e,t)=>{let n=`set${t[0].toUpperCase()}${t.slice(1)}`;return{...e,[n]:(e,n)=>{e[t]=n}}},{})}function Bn(e,t,n=!1,r=200){if(typeof e!=`object`||!e)return[];let i=[];return Vn(e,t,n,r,i,0),i}function Vn(e,t,n,r,i,a){typeof e!=`object`||!e||a>=r||Object.keys(e).forEach(o=>{o===t?n&&Array.isArray(e[o])?e[o].forEach(e=>{e[t]?Vn(e,t,n,r,i,a+1):i.push(e)}):i.push(e[o]):Vn(e[o],t,n,r,i,a+1)})}function Hn(e,t,n,r){let i=[];return e&&Un(i,e,t,n,r),i}function Un(e,t,n,r,i){if(t[r]===i&&e.push(t),Array.isArray(t[n]))for(let a=0;a<t[n].length;a++)Un(e,t[n][a],n,r,i)}function Wn(e,t,n=`asc`){e.sort((e,r)=>{let i,a;return n===`asc`?(i=Gn(e,t),a=Gn(r,t)):n===`desc`&&(i=Gn(r,t),a=Gn(e,t)),i<a?-1:+(i>a)})}function Gn(e,t){let n=t.split(`.`).reduce((e,t)=>e?e[t]:``,e);return isNaN(parseInt(n,10))?n:parseInt(n,10)}function Kn(e){let t=e.length,n=e.filter(e=>`layerSequence`in e),r=e.filter(e=>!Object.hasOwn(e,`layerSequence`));n.sort((e,t)=>e.baselayer&&!t.baselayer?1:!e.baselayer&&t.baselayer?-1:e.layerSequence===t.layerSequence?t.zIndex-e.zIndex:e.layerSequence-t.layerSequence),n.concat(r).forEach((n,r)=>{n.zIndex=--t,e[r]=n})}var qn={sortObjects:Wn,getNestedElement:Gn,sortByLayerSequence:Kn},Jn={configJs:null,deviceMode:`Desktop`,layerConfig:[],loadedConfigs:{configJson:!1,restServicesJson:!1,servicesJson:!1},styleListLoaded:!1,portalConfig:null,restConfig:null,urlParams:[],layerUrlParams:[]},Yn=`mainMenu`,Xn=`portalConfig`,Zn=`secondaryMenu`,Qn=`layerConfig`,$n=`baselayer`,er=`subjectlayer`,tr=[$n,er],nr=9999999;function rr(e){return Object.prototype.hasOwnProperty.call(e,`zIndex`)&&typeof e.zIndex==`number`}function ir(e,t){return function(e){let n=-1,r=t.allLayerConfigsByParentKey(e).filter(e=>rr(e));return r.length>0&&(n=Math.max(...r.map(e=>e.zIndex))),n}}function ar(e,t){return function(e){let n=t.layerConfigById(e);if(n){if(rr(n))return n.zIndex;let e=-1,r=Object.prototype.hasOwnProperty.call(n,`baselayer`)&&n.baselayer,i=r?$n:er;return e=t.maxZIndexOfLayerConfigsByParentKey(i),e===-1&&(e=r?t.maxZIndexOfLayerConfigsByParentKey(er):t.maxZIndexOfLayerConfigsByParentKey($n)),e+1}return null}}function or(e,{layerContainer:t,maxZIndex:n}){Wn(t,`zIndex`),t.forEach(e=>{e.zIndex>n&&(e.zIndex+=1)})}function sr({getters:e}){let t=1;tr.forEach(n=>{let r=e.allLayerConfigsByParentKey(n).filter(rr);Wn(r,`zIndex`),r.forEach(e=>{e.zIndex=t++})})}var cr=1;function lr(){return cr++}function ur(){cr=1}function dr(e){if(!e||e.length===0)return null;let t=Math.max(...e.map(e=>e.zIndex));return e.find(e=>e.zIndex===t)??null}function fr(e,t){let n=t.length>0?t:e;return n.length>0?Math.max(...n.map(e=>e.zIndex)):-1/0}function pr(e,t,n){let r=t.allLayerConfigs.filter(rr),i=[];return i=e.layerConfig[n]?t.allLayerConfigsByParentKey(n).filter(rr):t.visibleSubjectDataLayerConfigs.filter(rr),fr(r,i)}function mr(e){return[...e].map((e,t)=>({layer:e,index:t,zIndex:typeof e?.getZIndex==`function`?e.getZIndex():void 0})).sort((e,t)=>{let n=e.zIndex!==void 0,r=t.zIndex!==void 0;return n&&r&&e.zIndex!==t.zIndex?e.zIndex-t.zIndex:e.index-t.index}).map(e=>e.layer)}function hr(e){return e?.isExternal===!0?Bn(e,`elements`,!0).flat(1/0).filter(e=>e?.type===`layer`&&e?.isExternal===!0&&(e?.showInLayerTree===!0||e?.visibility===!0)&&!rr(e)):[]}function gr(e,t){let n=hr(e);
2return n.forEach((e,n)=>{e.zIndex=t+n+1}),n.length}var _r={alwaysOnTop:nr,hasNumericZIndex:rr,maxZIndexOfLayerConfigsByParentKey:ir,determineZIndex:ar,updateLayerConfigZIndex:or,updateAllZIndexes:sr,incrementZIndex:lr,resetZIndex:ur,sortVisibleLayerListByZindexBeforePrint:mr,getLayerWithMaxZIndex:dr,getMaxZIndexFromConfigs:fr,getMaxZIndexForParentKey:pr,getExternalLayerConfigsWithMissingZIndex:hr,assignZIndexToNestedExternalConfigs:gr},vr={...H(Jn),activeOrFirstCategory:e=>{let t=e.portalConfig?.tree?.categories;if(Array.isArray(t)&&t.length>0){let e=t.filter(e=>e.active===!0);return e?e[0]:t[0]}return null},addLayerButton:e=>e.portalConfig?.tree?.addLayerButton||{},allCategories:e=>e.portalConfig?.tree?.categories,singleBaselayer:e=>e.portalConfig?.tree?.singleBaselayer,allConfigsLoaded:e=>Object.values(e.loadedConfigs).every(e=>e===!0),allLayerConfigs:e=>Bn(e.layerConfig,`elements`,!0).flat(1/0),allFolders:e=>Hn(e.layerConfig[er],`elements`,`type`,`folder`),folderById:(e,t)=>e=>t.allFolders.find(t=>t.id===e),allLayerConfigsByParentKey:e=>t=>Bn(e.layerConfig[t],`elements`,!0).flat(1/0),allLayerConfigsStructured:e=>(t=null)=>{let n=[];return Object.keys(e.layerConfig).forEach(r=>{(!t||r===t)&&Object.keys(e.layerConfig[r]).forEach(t=>{Array.isArray(e.layerConfig[r][t])&&e.layerConfig[r][t].forEach(e=>{n.push(e)})})}),n},allSubjectDataLayerConfigs:(e,t)=>t.allLayerConfigsByParentKey(er),allBaselayerConfigs:(e,t)=>t.allLayerConfigsByParentKey($n),cesiumLibrary:e=>e.configJs?.cesiumLibrary||`https://cesium.com/downloads/cesiumjs/releases/1.110/Build/Cesium/Cesium.js`,twoFingerPan:e=>e.portalConfig?.map?.mapView?.mapInteractions?.interactionModes?.twoFingerPan,controlsConfig:e=>e.portalConfig?.map?.controls||{},configuredModules:(e,t)=>{let n=[];return t.menuFromConfig(`mainMenu`).sections?.forEach(e=>{n=n.concat(e)}),t.menuFromConfig(`secondaryMenu`).sections?.forEach(e=>{e.forEach(e=>{n=e?.type===`folder`?n.concat(e?.elements):n.concat([e])})}),t.controlsConfig.startModule?.mainMenu&&(n=n.concat(t.controlsConfig.startModule.mainMenu)),t.controlsConfig.startModule?.secondaryMenu&&(n=n.concat(t.controlsConfig.startModule.secondaryMenu)),n},maxZIndexOfLayerConfigsByParentKey:_r.maxZIndexOfLayerConfigsByParentKey,determineZIndex:_r.determineZIndex,featureViaURL:e=>e?.portalConfig?.map?.featureViaURL||{},getUrlParamValue:e=>t=>e.urlParams[t.toUpperCase()],ignoredKeys:e=>
2e.configJs?.ignoredKeys||[],invisibleBaselayerConfigs:(e,t)=>t.allBaselayerConfigs.filter(e=>e.visibility!==!0),isBaselayer:(e,t)=>e=>!!t.allLayerConfigs.find(t=>t.id===e).baselayer,isMobile:e=>e.deviceMode===`Mobile`,isModuleAvailable:e=>t=>JSON.stringify(e.portalConfig).includes(`"type":"`+t+`"`),layerConfigsByAttributes:(e,t)=>(e={})=>t.allLayerConfigs.filter(t=>Object.entries(e).every(([e,n])=>{if(typeof n==`object`)throw Error(`Not implemented for objects values`,n);if(Array.isArray(n))throw Error(`Not implemented for array values`,n);return t[e]===n})),layerConfigById:(e,t)=>e=>t.allLayerConfigs.find(t=>t.id===e),layerUrlParams:(e,t)=>{let n=t.layerConfigsByAttributes({showInLayerTree:!0}),r=[];return Wn(n,`zIndex`),n.forEach(e=>{let t={id:e.id};e.visibility===void 0?t.visibility=!1:t.visibility=e.visibility,e.transparency&&(t.transparency=e.transparency),r.push(t)}),r||[]},map3dParameter:e=>e.portalConfig?.map.map3dParameter||{},mapMarker:e=>e.portalConfig?.map.mapMarker||{},mapViewSettings:e=>e.portalConfig?.map.mapView||{},menuFromConfig:e=>t=>e.portalConfig[t]||{},mouseHover:e=>e.portalConfig?.map?.mouseHover||!1,namedProjections:e=>e?.configJs.namedProjections||null,proxyHost:e=>e?.configJs?.proxyHost||``,restServiceById:e=>t=>e?.restConfig?.find(e=>e.id===t),treeHighlightedFeatures:e=>e?.portalConfig?.tree?.highlightedFeatures||!1,treeConfig:e=>e?.portalConfig?.tree,showFolderPath:e=>typeof e.portalConfig?.tree?.showFolderPath==`boolean`&&e.portalConfig?.tree?.showFolderPath,showLayerAddButton:e
2=>typeof e?.portalConfig?.tree?.addLayerButton==`object`?e.portalConfig.tree.addLayerButton.active:e?.portalConfig?.tree?.type===`auto`,startingMapMode:e=>e.portalConfig?.map.startingMapMode||`2D`,uiStyle:e=>e.configJs?.uiStyle?.toUpperCase()||`DEFAULT`,visibleLayerConfigs:(e,t)=>t.allLayerConfigs.filter(e=>e.visibility===!0),visibleSubjectDataLayerConfigs:(e,t)=>t.allSubjectDataLayerConfigs.filter(e=>e.visibility===!0),visibleBaselayerConfigs:(e,t)=>t.allBaselayerConfigs.filter(e=>e.visibility===!0),zoomTo:e=>e?.portalConfig?.map?.zoomTo},yr={...U(Jn),setLayerConfigByParentKey(e,{layerConfigs:t,parentKey:n}){e.layerConfig[n]=t},setLoadedConfigs(e,t){e.loadedConfigs[t]=!0},setMouseHover(e,t){e.portalConfig.map.mouseHover=t},setUrlParams(e,{params:t}){t.forEach((t,n)=>{e.urlParams[n.toUpperCase()]=t});try{e.layerUrlParams=JSON.parse(e.urlParams.LAYERS||`[]`)}catch(t){console.warn(`Failed to parse LAYERS param:`,t),e.layerUrlParams=[]}},useCameraPosition(e,t){e.portalConfig.map.map3dParameter.camera.cameraPosition=t,e.portalConfig.map.map3dParameter.camera.positionInitiallyUsed=!0}},{Axios:br,AxiosError:xr,CanceledError:Sr,isCancel:Cr,CancelToken:wr,VERSION:Tr,all:Er,Cancel:Dr,isAxiosError:Or,spread:kr,toFormData:Ar,AxiosHeaders:jr,HttpStatusCode:Mr,formToJSON:Nr,getAdapter:Pr,mergeConfig:Fr,create:Ir}=B;function Lr(e){let t=document.createElement(`div`);return t.innerHTML=e,t.textContent||t.innerText||``}var Rr=1;function zr(e){let t=String(Br());return Vr(),e?e+t:t}function Br(){return Rr}function Vr(){Rr++}function Hr(){return[`GEOJSON`,`GROUP`,`OAF`,`SENSORTHINGS`,`STATICIMAGE`,`GEOTIFF`,`VECTORBASE`,`VECTORTILE`,`WFS`,`WMS`,`WMTS`,`WMSTIME`]}function Ur(){return[`ENTITIES3D`,`TERRAIN3D`,`TILESET3D`,`GROUP3D`]}function Wr(){return[`VECTORTILE`]}var Gr={getLayerTypes2d:Hr,getLayerTypes3d:Ur,getLayerTypesNotVisibleIn3d:Wr};function Kr(e,t,n,r=[],i=!1){let a=n?.key,o={},s={elements:[]},c={};if(!n)return e;let{bgLayerIds:l,subjectDataLayers:u}=qr(e,t,s,i);return Qr(e,s,o,c,l,u,r,a),s}function qr(e,t,n,r){let i=[],a=[];return t&&(i=Jr(t),t.subjectlayer&&(a=Yr(e,t,n,r))),{bgLayerIds:i,subjectDataLayers:a}}function Jr(e){return vi(Bn(e[$n],`elements`,!0).flat(1/0))}function Yr(e,t,n,r){let i=Bn(t[er],`elements`,!0).flat(1/0),a=di(i);return r&&(i=a,t[er].elements=[]),a.length>0&&a.length===i.length?n.elements=t.subjectlayer.elements?t[er].elements:t[er]:!r&&a.length>0?Xr(e,t,n,i):i=[],i}function Xr(e,t,n,r){t[er].elements.forEach(t=>{let i=Bn(t,`elements`,!0).flat(1/0);t.type===`folder`&&ui(i)?n.elements.push(t):Zr(e,r,t)})}function Zr(e,t,n){let r=e.find(e=>e.id===n.id);if(r){let i=t.findIndex(e=>e.id===r.id),a=Object.assign({},r,n);e.splice(e.indexOf(r),1,a),t.splice(i,1)}}function Qr(e,t,n,r,i,a,o,s){for(let c=0;c<e.length;c++){let l=e[c];$r(l,i,a)||(ei(l,s),ti(l,s)&&(ni(l,o),ri(l,t,n,r,s)))}}function $r(e,t,n){return t.indexOf(e.id)>-1||n.find(t=>t.id===e.id)!==void 0}function ei(e,t){e.datasets[0]&&(e.datasets[0][t]===``||Array.isArray(e.datasets[0][t])&&e.datasets[0][t].length===0||Array.isArray(e.datasets[0][t])&&e.datasets[0][t].length===1&&e.datasets[0][t][0]===``)&&(e.datasets[0][t]=`common:modules.layerTree.noCategory`)}function ti(e,t){return e.datasets[0]&&e.datasets[0][t]!==void 0}function ni(e,t){t.forEach(t=>{t.id===e.id&&Object.assign(e,t)})}function ri(e,t,n,r,i){let a=yi(e,i),o=e.id;for(let i=0;i<a.length;i++)ii(e,t,n,r,a[i],o)}function ii(e,t,n,r,i,a){let o=e.datasets[0].md_name,s=!0;if(r[o]&&r[o].find(e=>e.id===a))return;
2s=bi(r,e,o),Object.keys(n).find(e=>e===i)||gi(t,n,i);let c=t.elements.find(e=>e.name===i);c.id===void 0&&(c.id=li()),ai(e,c,n,r,i,o,s)}function ai(e,t,n,r,i,a,o){Object.keys(n[i]).find(e=>e===a)||(n[i][a]=[],o?mi(t,e,a):hi(t,n,i,a)),o||oi(e,t,n,r,i,a)}function oi(e,t,n,r,i,a){let o=t.elements.find(e=>e.name===a),s=o?o.id:t.id;r[a].length===2&&(s=pi(t,n,r,i,a)),e.parentId=s,n[i][a].push(e),Wn(n[i][a],`name`)}function si(e){e.forEach(e=>{e.id=li(),ci(e)})}function ci(e){e.elements?.forEach(t=>{t.type===`folder`&&(t.id=li(),ci(t)),t.parentId=e.id})}function li(){return zr(`folder-`)}function ui(e){return fi(e).every(e=>Gr.getLayerTypes3d().includes(jt.getLayerWhere({id:e.id})?.typ?.toUpperCase()))}function di(e){return fi(e).filter(e=>Gr.getLayerTypes3d().includes(jt.getLayerWhere({id:e.id})?.typ?.toUpperCase()))}function fi(e){let t=e.filter(e=>e.typ===`GROUP3D`),n=e.filter(e=>e.typ!==`GROUP3D`);return t.forEach(e=>{n.concat(e.children)}),n}function pi(e,t,n,r,i){let a=n[i][0],o={};return t[r][i]=[],_i(e.elements,a.id),o.elements=t[r][i],o.name=i,o.type=`folder`,o.id=li(),o.parentId=e.id,e.elements.push(o),Wn(e.elements,`name`),a.parentId=o.id,t[r][i].push(a),o.id}function mi(e,t,n){Array.isArray(e.elements)||(e.elements=[]),t.parentId=e.id,e.elements.push(Object.assign({},t,{name:n})),Wn(e.elements,`name`)}function hi(e,t,n,r){let i={};i.elements=t[n][r],i.name=r,i.type=`folder`,i.id=li(),i.parentId=e.id,e.elements.push(i),Wn(e.elements,`name`)}function gi(e,t,n){let r={};r.elements=[],r.name=n,r.type=`folder`,r.id=li(),r.parentId=e.id,e.elements.push(r),Wn(e.elements,`name`),t[n]={}}function _i(e,t){let n=e.findIndex(e=>e.id===t);n>-1&&e.splice(n,1)}function vi(e){let t=[];return e.forEach(e=>{Array.isArray(e.id)?t=t.concat(e.id):t.push(e.id)}),t}function yi(e,t){return Array.isArray(e.datasets[0][t])?e.datasets[0][t]:[e.datasets[0][t]]}function bi(e,t,n){return Object.keys(e).find(e=>e===n)?(e[n].find(e=>e.id===t.id)||e[n].push(t),!1):(e[n]=[t],!0)}var xi={build:Kr,setIdsAtFolders:si};function Si(e,t,n,r,i=200){if(typeof e!=`object`||!e)return[];let a=[];return Ci(e,t,i,a,0,n,r),a}function Ci(e,t,n,r,i,a,o){typeof e!=`object`||!e||i>=n||Object.keys(e).forEach(s=>{s===t?e[s][o.key]===o.value&&e[s]!==a?(e[s]=a,r.push(a)):Array.isArray(e[s])&&e[s].forEach((c,l)=>{c[o.key]===o.value&&c!==a?o.replaceObject===c[o.key]?(e[s].splice(l,1,...a),r.push(...a)):(Object.assign(c,a),r.push(c)):Array.isArray(c[t])&&Ci(c,t,n,r,i+1,a,o)}):Ci(e[s],t,n,r,i+1,a,o)})}var wi={replaceInNestedValues:Si};function Ti(e,t=vr.proxyHost()){let n=document.createElement(`a`),r=``,i=e,a=``,o=n.hostname,s=``;return n.href=e,r=n.protocol,r.indexOf(`//`)===-1&&(r+=`//`),s=n.port,n.hostname||=window.location.hostname,n.hostname===`localhost`||!n.hostname?e:(s&&(i=e.replace(`:`+s,``)),i=e.replace(r,``),o=i.includes(`/`)?i.substring(0,i.indexOf(`/`)):i,a=o,a=a.replaceAll(`.`,`_`),console.warn(`Please set up a CORS header for the service with the URL: ${e} This is recommended by the GDI-DE (https://www.gdi-de.org/download/AK_Geodienste_Architektur_GDI-DE_Bereitstellung_Darstellungsdienste.pdf) in chapter 4.7.1.!`),t+`/`+i.replace(o,a))}function Ei(e,t){for(let n in e){let r=e[n];if(r&&typeof r==`object`&&Ei(r,t),r&&Array.isArray(r))for(let e=0;e<r.length;e++)typeof r[e]==`object`&&r[e].useProxy===!0&&r[e].url&&Ei(r,t)}return e?.useProxy===!0&&e?.url&&(e.origUrl=e.url,e.url=Ti(e.url,t)),e}function Di(e,t=!1,n=void 0){let r=Ai(e,jt.getLayerWhere({id:Oi(e?.id)})),i=[];
2if(!r&&e&&e.name===void 0){let t=`Layer with id ${e.id} was not found in services.json and has no name!`;console.warn(t),e.name=`WARN: ${t} `}if(n){let a=[];Ri(n,r||e,a),a.forEach(e=>{i.push(ki(e,t))})}else e&&i.push(ki(r||e,t));return i}function Oi(e,t=`.`){return typeof e==`string`?e.split(t)[0]:e}function ki(e,t=!1){if(e){let n=Gr.getLayerTypes3d();e.type=`layer`,t||e.visibility&&e.showInLayerTree===void 0?($.state.layerUrlParams?.some(t=>t.id===e.id&&t.visibility===!1)&&(e.visibility=!1),e.showInLayerTree=!0):!Object.prototype.hasOwnProperty.call(e,`showInLayerTree`)&&e.visibility===!1&&(e.showInLayerTree=!1),(e.showInLayerTree===!0||e.visibility===!0)&&(e.zIndex=_r.incrementZIndex()),e.is3DLayer=n.includes(e.typ?.toUpperCase())}return e}function Ai(e,t){let n;return e&&(Array.isArray(e.id)?n=ji(e):t!=null&&(n={...t,...e})),n?.useProxy===!0&&Ei(n),n}function ji(e){let t=e.id,n=Ni(t),r=[],i=[],a={};return t.length===0?e:n.length===0?(console.warn(`Configuration of group layer '${e.name}' contains no child that is available in services.json.`),a={...e},a.id=t.join(`-`),a.name=`WARN: ${e.name}`,a.htmlName=`WARN: ${e.name}`,e.typ?.startsWith(`GROUP`)&&(a.children=[]),a):(e.typ?.startsWith(`GROUP`)?(a={...e},a.id=t.join(`-`),e.children?e.children.forEach(r=>{let i=n.findIndex(e=>e.id===r.id);if(t.indexOf(r.id)===-1)console.warn(`Configuration of group layer contains id ${r.id} in children, that is not contained in group layer ids [${e.id}]. Layer will not be displayed correctly.`);else if(i>-1){let t=Object.assign({},n[i],r);!r.maxScale&&e.maxScale&&Fi(t,[e.maxScale],[e.minScale],e),n.splice(i,1,t)}else n.push(r)}):(n.forEach(t=>{e.styleId&&(t.styleId=e.styleId)}),Mi(n,r,i),Fi(a,r,i,e)),a.children=n):Pi(n)?(Mi(n,r,i),a=Object.assign({},n[0],e),a.id=n[0].id,a.layers=n.map(e=>e.layers).toString(),Fi(a,r,i,e)):console.warn(`Layer '${e.name}' with ids as array: [${e.id}] cannot be created. All layers in the ids-array must habe same 'typ' and same 'url'.`),e.id=a.id,a)}function Mi(e,t,n){e.forEach(e=>e.maxScale?t.push(parseInt(e.maxScale,10)):null),e.forEach(e=>e.minScale?n.push(parseInt(e.minScale,10)):null)}function Ni(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n],i=jt.getLayerWhere({id:Oi(r)});
2i?t.push(i):console.warn(`Layer with id:${r} not found in services.json. The Layer ${r} out of group layer with ids: ${e} will not be displayed!`)}return t}function Pi(e){if(e.length>0){let t=e[0].url,n=e[0].typ;return e.every(e=>e.url===t&&e.typ===n)}return!1}function Fi(e,t,n,r){let i=parseInt(r.maxScale,10),a=parseInt(r.minScale,10);e.maxScale=isNaN(i)?Math.max(...t):i,e.minScale=isNaN(a)?Math.min(...n):a}function Ii(e={},t=!1){let n=jt.getLayerList(),r=[],i=e.validLayerTypesAutoTree||[`WMS`,`SENSORTHINGS`,`TERRAIN3D`,`TILESET3D`,`OBLIQUE`],a=e.layerIDsToIgnore||[],o=e.metaIDsToIgnore||[],s=e.metaIDsToMerge||[],c=e.layerIDsToStyle||[],l=c.map(e=>e.id),u={},d=[];for(let e=0;e<n.length;e++){let f=ki(n[e],!t),p=f.typ?.toUpperCase();if(!(!i.includes(p)||!f.datasets||f.datasets.length===0||a.includes(f.id)||o.includes(f.datasets[0].md_id))){if(s.includes(f.datasets[0].md_id)){zi(u,f.datasets[0].md_id,f);continue}if(l.includes(f.id)){Ri(c,f,r);continue}p===`SENSORTHINGS`&&f.related_wms_layers!==void 0&&(d=d.concat(f.related_wms_layers)),f.datasets.length>1?f.datasets.forEach((e,t)=>{let n={...f};n.id=f.id+`_`+t,n.datasets=[e],r.push(n)}):r.push(f)}}return Bi(u,r),Li(d,r),r}function Li(e=[],t=[]){e.forEach(e=>{let n=t.findIndex(t=>t.id===e);n>-1&&t.splice(n,1)})}function Ri(e,t,n){let r=e.find(e=>e.id===t.id),i=Object.assign(t,r);i.typ===`GROUP`&&Array.isArray(i.children)?(r=e.filter(function(e){return i.children.map(e=>e.id).includes(e.id)}),i.children.forEach(e=>{let t=r.find(t=>t.id===e.id),n=e.layers;if(t&&(e.styles=Array.isArray(t.styles)?t.styles.join(`,`):t.styles,Array.isArray(t.styles)&&t.styles.length>1)){let r=n.split(`,`);for(;r.length<t.styles.length;)r.push(r[0]);e.layers=r.join(`,`)}}),n.push(i)):i.typ===`WMS`&&Array.isArray(i.styles)&&i.styles.length>1?i.styles.forEach(function(e,t){let r=Object.assign({},i);r.style=e,r.legendURL=i.legendURL[t],r.name=i.name[t],r.id=i.id+i.styles[t],r.styles=e,n.push(r)}):n.push(i)}function zi(e,t,n){Array.isArray(e[t])||(e[t]=[]),e[t].push(n)}function Bi(e,t){Object.values(e).forEach(e=>{let n=[],r=!1,i,a,o=null;e.forEach((e,t)=>{t===0&&(o=Object.assign({},e),o.name=e.datasets[0].md_name,i=e.maxScale,a=e.minScale),e.gfiAttributes!==`ignore`&&!r&&(o.gfiAttributes=e.gfiAttributes,r=!0),n.push(e.layers),i=Math.max(i,e.maxScale),a=Math.min(a,e.minScale)}),o.layers=n.join(`,`),o.maxScale=i,o.minScale=a,t.push(o)})}var Vi=[];function Hi(e){Vi.push(e),Gr.getLayerTypes2d().includes(e.get(`typ`)?.toUpperCase())&&$.dispatch(`Maps/addLayer`,e.getLayer())}function Ui(e){let t=Ki(e);Gr.getLayerTypes2d().includes(t?.get(`typ`)?.toUpperCase())&&mapCollection.getMap(`2D`)?.removeLayer(t.layer);for(let t=0;t<Vi.length;t++)Vi[t].attributes?.id===e&&Vi.splice(t,1)}function Wi(){for(Vi.forEach(e=>{if(Gr.getLayerTypes2d().includes(e.get(`typ`)?.toUpperCase())){let t=e.getLayer();t.setVisible(!1),mapCollection.getMap(`2D`)?.removeLayer(t)}else Gr.getLayerTypes3d().includes(e.get(`typ`)?.toUpperCase())&&e.setVisible(!1,mapCollection.getMap(`3D`),e.attributes)});Vi.length>0;)Vi.pop()}function Gi(){return Vi}function Ki(e){return Vi.find(t=>t.attributes.id===e)}function qi(){let e=[];return Vi.forEach(t=>{t.getLayer().get(`visible`)&&e.push(t.getLayer())}),e}var W={addLayer:Hi,removeLayerById:Ui,clear:Wi,getLayers:Gi,getLayerById:Ki,getOlLayers:qi};function Ji(){return{addLayerToLayerConfig({dispatch:e,getters:t,state:n},{layerConfig:r,parentKey:i}){let a=t.allLayerConfigs.filter(_r.hasNumericZIndex),o=a.find(e=>e.id===r.id),s=_r.getMaxZIndexForParentKey(n,t,i);if(e(`updateLayerConfigZIndex`,{layerContainer:a,maxZIndex:s}),o===void 0){let a=_r.assignZIndexToNestedExternalConfigs(r,s);if(_r.hasNumericZIndex(r)||(r.zIndex=s+a+1),n.layerConfig[i])n.layerConfig[i].elements.push(r);else{let e=t.folderById(i);e&&e.elements.find(e=>e.id===r.id)===void 0&&e.elements.push(r)}return e(`addBaselayerAttribute`),!0}return!1},replaceByIdInLayerConfig({dispatch:e,getters:t,state:n},{layerConfigs:r=[],trigger:i=!0}={}){r.forEach(r=>{let a=r.layer,o=r.id,s=t.layerConfigById(o),c=s?.visibility,l=[];s?.zIndex===void 0&&r.layer.zIndex===void 0&&a.visibility&&(a.zIndex=t.determineZIndex(o)),l=wi.replaceInNestedValues(n.layerConfig,`elements`,a,{key:`id`,value:o}),l.length>1&&console.warn(`Replaced ${l.length} layers in state.layerConfig with id: ${o}. Layer was found ${l.length} times. You have to correct your config!`),i&&(n.layerConfig={...n.layerConfig}),typeof a.visibility==`boolean`&&typeof c==`boolean`&&c!==a.visibility&&W.getLayerById(o)?.visibilityChanged(a.visibility),!i&&(t[`Maps/mode`]===`2D`&&!r.layer.is3DLayer||t[`Maps/mode`]===`3D`)&&e(`showLayerAttributions`,r.layer)})},addOrReplaceLayer:function({dispatch:e,getters:t},{layerId:n,visibility:r=!0,transparency:i=0,showInLayerTree:a=!0,isBaseLayer:o=!1,zIndex:s,time:c}){let l=t.layerConfigById(n),u=s;if(l)u??=l.zIndex??u,(l.zIndex===null||l.zIndex===null)&&!l.showInLayerTree&&r&&(u??=t.determineZIndex(n)),e(`replaceByIdInLayerConfig`,{layerConfigs:[{id:n,layer:{visibility:r,transparency:i,showInLayerTree:a,zIndex:u,time:c}}]});else{let s=jt.getLayerWhere({id:n}),l=o?$n:er;if(s)s.type=`layer`,s.visibility=r,s.transparency=i,s.showInLayerTree=a,s.zIndex=u??t.determineZIndex(n),c&&(s.time=c),s.styleId&&Ft.returnStyleObject(s.styleId)===void 0?Ft.initStyleAndAddToList(t.configJs,s.styleId).then(()=>{e(`addLayerToLayerConfig`,{layerConfig:s,parentKey:l})}):e(`addLayerToLayerConfig`,{layerConfig:s,parentKey:l});
2else return console.warn(`addOrReplaceLayer- layer with id: `+n+` not added, because it was not found in services.json.`),!1}return!0},showLayerAttributions({dispatch:e},t){let n=t?.layerAttribution;t?.visibility&&n!==void 0&&n!==`nicht vorhanden`&&e(`Alerting/addSingleAlert`,{content:n,category:`info`,title:t?.name,onceInSession:!0},{root:!0})},updateLayerConfigZIndex:_r.updateLayerConfigZIndex,updateAllZIndexes:_r.updateAllZIndexes,extendLayers({dispatch:e,getters:t,state:n}){let r=[];if(e(`addBaselayerAttribute`),n.portalConfig?.tree?.type===`auto`)r=Bn(n.layerConfig,`elements`,!0).flat(1/0),e(`processTreeTypeAuto`,r),e(`updateLayerConfigs`,r);else{t.allLayerConfigsByParentKey(er).map(e=>{let r=Di(e,!t.showLayerAddButton,n.portalConfig?.tree?.layerIDsToStyle);return r.length>1&&wi.replaceInNestedValues(n.layerConfig,`elements`,r,{key:`id`,value:e.id,replaceObject:e.id}),Object.assign(e,r[0])});let i=t.allLayerConfigsStructured(),a=i.filter(e=>e.type===`folder`);i.find(e=>e.legendURL!==void 0)&&console.warn(`legendURL ist deprecated
2in one of the next versions. Please use attribute "legend" as boolean or string with path to legend image or pdf.`),xi.setIdsAtFolders(a),r=Bn(n.layerConfig,`elements`,!0).flat(1/0),t.showLayerAddButton?e(`updateLayerConfigs`,r.filter(e=>e.baselayer===!0||e.visibility===!0||e.showInLayerTree)):e(`updateLayerConfigs`,r)}},addBaselayerAttribute({getters:e}){e.allLayerConfigsByParentKey($n).map(e=>Object.assign(e,{baselayer:!0}))},processTreeTypeAuto({commit:e,getters:t,state:n},r){let i=Ii(n.portalConfig?.tree,t.showLayerAddButton),a=xi.build(i,n.layerConfig,t.activeOrFirstCategory,r);i.find(e=>e.legendURL!==void 0)&&console.warn(`legendURL ist deprecated in one of the next versions. Please use attribute "legend" as boolean or string with path to legend image or pdf.`),e(`setLayerConfigByParentKey`,{layerConfigs:a,parentKey:er})},async changeCategory({commit:e,dispatch:t,getters:n,rootGetters:r,state:i},a){let o=Bn(i.layerConfig,`elements`,!0).flat(1/0),s=Ii(i.portalConfig?.tree,n.showLayerAddButton),c=xi.build(s,i.layerConfig,a,o,!0);e(`setLayerConfigByParentKey`,{layerConfigs:c,parentKey:er}),e(`Modules/LayerSelection/clearLayerSelection`,{root:!0}),t(`Modules/LayerSelection/navigateForward`,{lastFolderName:`root`,subjectDataLayerConfs:c.elements,baselayerConfs:r.allLayerConfigsStructured($n)},{root:!0})},updateLayerConfigs({dispatch:e,getters:t,state:n},r){r.forEach(r=>{let i=Di(r,!t.showLayerAddButton,n.portalConfig?.tree?.layerIDsToStyle);i.length>1&&wi.replaceInNestedValues(n.layerConfig,`elements`,i,{key:`id`,value:r.id,replaceObject:r.id}
2),i.forEach(t=>{t&&e(`replaceByIdInLayerConfig`,{layerConfigs:[{layer:t,id:t.id}]})})})}}}function Yi(e,t,n=`.`){let r=Zi(t,n);if(r===!1){console.warn(`Invalid path parameter given for "getByDotSyntax()":`,t);return}return Xi(e,r)}function Xi(e,t){if(!Array.isArray(t))return;let n=t.shift();if(!(!(e instanceof Object||Array.isArray(e))||e[n]===void 0))return t.length===0?e[n]:Xi(e[n],t)}function Zi(e,t=`.`){let n=[];if(typeof e==`string`){n=e.split(t);for(let e of n)if(e===``)return!1;return n}else if(!Array.isArray(e))return!1;for(let r of e){let e=Zi(r,t);if(e===!1)return!1;n=[...n,...e]}return n}function Qi(e,t,n){if(!(e?.state instanceof Object))return console.warn(`fetchFirstModuleConfig: The given context is missing a state:`,e),!1;if(!Array.isArray(t))return console.warn(`fetchFirstModuleConfig: The given configPaths must be an array, but none is given:`,t),!1;let r=[],i=[],a=[`i18nextTranslate`,`useConfigName`,`type`,`parentId`,`onlyDesktop`],o=e.state[n]||e.state.Modules[n],s,c=!1;for(let c of t){if(s=Yi(e.rootState,c),s===void 0){r.push(Zi(c));continue}if(!(s instanceof Object)||Array.isArray(s)){console.error(`The config for "`+n+`" is not an object and thereby ignored.`,s),console.warn(`Path to the defective config:`,Zi(c));continue}for(let e in s)!a.includes(e)&&o[e]===void 0&&i.push(e);i.length>0&&(console.warn(`Default value were not found in module "`+n+`". Those are taken from config now, but are not expected to have any effect.`,i),console.warn(`Path to the module:`,Zi(c)));break}return s&&(e.state[n]?e.state[n]=$i(s,o):e.state.Modules[n]&&(e.state.Modules[n]=$i(s,o)),c=!0),c}function $i(e,t){if(!(e instanceof Object))return t;if(!(t instanceof Object))return Array.isArray(e)?[...e]:{...e};if(Array.isArray(t)&&t.length>0)return t.splice(0,t.length,...e),t;for(let n in e)e[n]instanceof Object?t[n]=$i(e[n],t[n]):t[n]=e[n];return t}function ea(e){return typeof e==`string`?e.charAt(0).toUpperCase()+e.substring(1):``}function ta(e){return typeof e==`string`?e.charAt(0).toLowerCase()+e.substring(1):``}function na(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e.toUpperCase(),t]))}var ra={upperCaseKeys:na,upperFirst:ea,lowerFirst:ta},ia={...Ji(),loadConfigJs({commit:e},t){Ei(t,t.proxyHost?t.proxyHost:``),e(`setConfigJs`,t)},loadConfigJson({commit:e,state:t,dispatch:n,getters:r}){let i=`.json`,a=`config.json`;(t.configJs?.portalConf?.slice(-5)===i||t.configJs?.portalConf?.slice(-5)!==i&&t.configJs?.portalConf?.includes(i)&&t.configJs?.portalConf?.includes(`?`))&&(a=t.configJs.portalConf),B.get(a).then(t=>{Ei(t.data),e(`setPortalConfig`,t.data?t.data[Xn]:null),r.isMobile&&(n(`moveStartModuleControls`,`mainMenu`),n(`moveStartModuleControls`,`secondaryMenu`)),e(`setLayerConfig`,t.data?t.data[Qn]:null),n(`processLayerNamesHtmlTags`),e(`setLoadedConfigs`,`configJson`)}).catch(e=>{console.error(`Error occured during loading config.json specified by config.js (${a}).`,e)})},moveStartModuleControls({getters:e,state:t},n){t.portalConfig[n]&&e.controlsConfig?.startModule&&([].concat(e.controlsConfig.startModule[n]).forEach(e=>{e&&!t.portalConfig[n]?.sections[0].find(t=>t.type===e.type)&&t.portalConfig[n].sections[0].push(e)}),t.portalConfig.map.controls.startModule[n]=[])},loadRestServicesJson({commit:e,state:t}){B.get(t.configJs?.restConf).then(t=>{Ei(t.data),e(`setRestConfig`,t.data),e(`setLoadedConfigs`,`restServicesJson`)}).catch(e=>{console.error(`Error occured during loading rest-services.json specified by config.js (${t.configJs?.restConf}).`,e)})},loadServicesJson({state:e,commit:t,dispatch:n}){jt.initializeLayerList(e.configJs?.layerConf,(r,i)=>{i?n(`Alerting/addSingleAlert`,{category:`error`,content:i18next.t(`common:app-store.loadServicesJsonFailed`,{layerConf:e.configJs?.layerConf})},{root:!0}):t(`setLoadedConfigs`,`servicesJson`)})},initializeModule:(e,{configPaths:t,type:n})=>Qi(e,t,ea(n)),initializeOther({dispatch:e}){e(`Modules/WmsTime/watchVisibleLayerConfig`,null,{root:!0})},initializeVectorStyle({state:e,commit:t,dispatch:n,getters:r}){let i={mapMarkerPointStyleId:r.mapMarker?.pointStyleId,mapMarkerPolygonStyleId:r.mapMarker?.polygonStyleId,highlightFeaturesPointStyleId:r[`Modules/HighlightFeatures/pointStyleId`],highlightFeaturesPolygonStyleId:r[`Modules/HighlightFeatures/polygonStyleId`],highlightFeaturesLineStyleId:r[`Modules/HighlightFeatures/lineStyleId`],zoomToFeatureId:r.zoomTo?.f
2ind(e=>e.id===`zoomToFeatureId`)?.styleId};Ft.initializeStyleList(i,e.configJs,r.allLayerConfigs,r.configuredModules,(t,r)=>(r&&n(`Alerting/addSingleAlert`,{category:`warning`,content:i18next.t(`common:app-store.loadStylev3JsonFailed`,{style_v3:e.configJs?.styleConf?e.configJs?.styleConf:`style_v3.json`})},{root:!0}),t)).then(()=>{t(`setStyleListLoaded`,!0)}).catch(e=>console.error(e))},initializeUrlParams({commit:e}){e(`setUrlParams`,{params:new URLSearchParams(window.location.search)}),GA.processGlobalUrlParams()},processLayerNamesHtmlTags({state:e}){function t(e){Array.isArray(e)&&e.forEach(e=>{e?.name&&!e?.htmlName&&(e.htmlName=e.name,e.name=Lr(e.name)),Array.isArray(e?.elements)&&t(e.elements)})}Object.values(e.layerConfig).forEach(e=>{Array.isArray(e?.elements)&&t(e.elements)})}},aa={configPaths:[`configJs.alerting`],alertProto:{title:``,category:`info`,confirmText:`common:modules.alerting.hideMessage`,reConfirmText:`common:modules.alerting.showMessage`,content:``,displayFrom:!1,displayUntil:!1,creationDate:``,hash:``,multipleAlert:!1,mustBeConfirmed:!1,once:!1,onceInSession:!1},alerts:[],alertWindowTitle:`common:modules.alerting.alertWindowTitle`,displayedAlerts:{},seenInSessionAlerts:{},fetchBroadcastUrl:!1,initialAlerts:{},moduleOpenAlerts:{},initialClosed:!1,availableCategories:[`news`,`success`,`warning`,`error`,`info`],localStorageDisplayedAlertsKey:`displayedAlerts`,showTheModal:!1,type:`alerting`,displayOnEventList:[],alertsOnEvent:[]},G=e(De(),1),oa={...U(aa),addToAlerts(e,t){e.alerts.push(t)},removeFromAlerts(e,t){e.alerts=e.alerts.filter(e=>e.hash!==t.hash)},setReadyToShow(e,t){e.showTheModal=t},setAlertAsRead(e,t){t.mustBeConfirmed=!1},setAlertAsUnread(e,t){t.mustBeConfirmed=!0},addToDisplayedAlerts(e,t){e.displayedAlerts={...e.displayedAlerts,[t.hash]:(0,G.default)().format()}},addToSeenInSessionAlerts(e,t){e.seenInSessionAlerts={...e.seenInSessionAlerts,[t.hash]:!0}},addToDisplayOnEventList(e,t){e.displayOnEventList.push(t)}},sa={...H(aa),sortedAlerts:e=>t=>{let n={},r=[],i=e.alerts;return t===`onEvent`&&(i=e.alertsOnEvent),i.forEach(e=>{t===`initial`&&Object.hasOwn(e,`displayOnEvent`)||(n[e.category]===void 0&&(n[e.category]=[]),n[e.category].push({...e}))}),Object.keys(n).forEach(e=>{r.push({category:e,content:n[e]})}),r.sort(function(e,t){let n=[`success`,`warning`,`error`];return n.indexOf(t.category)-n.indexOf(e.category)}),r}},ca=e(fn(),1),la=e(Qt(),1);G.default.extend(ca.default);function ua(e,t){let n=e.filter(e=>e.hash===t);return n.length?n[0]:!1}function da(e){return e.displayFrom===!1&&e.displayUntil===!1||(!e.displayFrom||(0,G.default)().isAfter(e.displayFrom))&&(!e.displayUntil||(0,G.default)().isBefore(e.displayUntil))}function fa(e,t){let n=localStorage[e];if(typeof n!=`string`||n.length<1)return!1;try{let e=JSON.parse(n);if(Array.isArray(e))return e.includes(t);if(e&&typeof e==`object`)return Object.hasOwn(e,t)}catch{return n.includes(t)}return!1}function pa(e,t={}){let n=$.getters[`Alerting/localStorageDisplayedAlertsKey`],r=typeof e.displayOnEvent==`object`&&e.displayOnEvent?.type===`Menu/changeCurrentComponent`;return fa(n,e.hash)||e.onceInSession===!0&&Object.hasOwn(t,e.hash)?!1:(e.once===!1||e.once===void 0||e.once===!0&&(!r||e.mustBeConfirmed!==!0)&&$.commit(`Alerting/addToDisplayedAlerts`,e),!0)}function ma(e){return typeof e!=`string`||e.length<1?``:e.startsWith(`common:`)||e.startsWith(`additional:`)?i18next.t(e):e}function ha(e){return(0,la.default)({alertId:e.alertId,content:e.content,title:e.title,category:e.category,displayFrom:e.displayFrom,displayUntil:e.displayUntil,displayOnEvent:e.displayOnEvent,moduleType:e.moduleType,modul:e.modul})}function ga(e){return e&&typeof e==`object`&&(typeof e.moduleType==`string`||typeof e.modul==`string`)&&typeof e.content==`string`}
2var _a={namespaced:!0,state:aa,actions:{addModuleOpenAlertsFromConfig({dispatch:e},t){if(!t||typeof t!=`object`)return;let n=[];n=Array.isArray(t)?t:ga(t)?[t]:Object.entries(t).map(([e,t])=>({...t,alertId:e})),n.forEach(t=>{t&&typeof t==`object`&&e(`addSingleAlertOnModuleOpen`,t)})},addSingleAlertOnModuleOpen({dispatch:e,rootState:t},{alertId:n,moduleType:r,modul:i,content:a,title:o=``,category:s=`info`,mustBeConfirmed:c=!1,once:l=!0,onceInSession:u=!0,displayFrom:d,displayUntil:f}={}){let p=typeof i==`string`&&i.length>0?i:r;typeof p!=`string`||p.length<1||typeof a!=`string`||a.length<1||(e(`addSingleAlert`,{alertId:n,category:s,moduleType:p,title:ma(o),content:ma(a),displayFrom:d,displayUntil:f,initial:!0,initialConfirmed:c,mustBeConfirmed:c,once:l,onceInSession:u,displayOnEvent:{type:`Menu/changeCurrentComponent`,value:{type:p}}}),(t?.Menu?.mainMenu?.currentComponent===p||t?.Menu?.secondaryMenu?.currentComponent===p)&&e(`activateDisplayOnEventAlerts`,{type:`Menu/changeCurrentComponent`,payload:{type:p}}))},cleanup:function({state:e,commit:t},{visibleAlertHashes:n}={}){let r=e.localStorageDisplayedAlertsKey,i=Array.isArray(n);e.alerts.forEach(e=>{i&&!n.includes(e.hash)||(!e.mustBeConfirmed&&e.initialConfirmed!==!1&&e.initial!==void 0&&e.once===!0?(t(`addToDisplayedAlerts`,e),t(`removeFromAlerts`,e)):!e.mustBeConfirmed&&e.onceInSession===!0&&(t(`addToSeenInSessionAlerts`,e),t(`removeFromAlerts`,e)))}),localStorage[r]?localStorage[r]=JSON.stringify({...e.displayedAlerts,...JSON.parse(localStorage[r])}):localStorage[r]=JSON.stringify(e.displayedAlerts),t(`setReadyToShow`,!1)},alertHasBeenRead:function({state:e,commit:t},n){let r=ua(e.alerts,n);r!==!1&&(r.mustBeConfirmed===!0?t(`setAlertAsRead`,r):t(`setAlertAsUnread`,r))},addSingleAlert:function({state:e,commit:t},n){let r=typeof n==`string`?{content:n}:n,i={...e.alertProto},a=e.alerts.some(function(e){return e.initial===!0}),o,s=!1,c=!1,l=!1,u=!1,d=!1;if(r===void 0)return!1;if(r?.category!==void 0&&(o=r.category.toLowerCase()),e.availableCategories.includes(o)?r.displayCategory=`common:modules.alerting.categories.${o}`:r.category===void 0||r.category===``?r.displayCategory=`info`:r.displayCategory=r.category,typeof r.content!=`string`||r.content.length<1)return console.warn(`Alert cancelled, bad content value:`,r.content),!1;for(let e in r)i[e]=r[e];return i.hash=ha(i),s=ua(e.alerts,i.hash)===!1,c=!s&&i.onceInSession,u=da(i),l=pa(i,e.seenInSessionAlerts),i.isNews&&t(`Modules/News/addNews`,i,{root:!0}),typeof i.displayOnEvent==`object`&&t(`addToDisplayOnEventList`,i.displayOnEvent),d=s&&u&&l,d&&((n.multipleAlert!==!0&&!n.initial&&e.initialClosed===!0||n.multipleAlert===!0&&a===!0&&e.initialClosed===!0)&&(e.alerts=e.alerts.filter(e=>Object.hasOwn(e,`displayOnEvent`))),fa(e.localStorageDisplayedAlertsKey,i.hash)||t(`addToAlerts`,i)),e.alerts.length>0&&(ua(e.alerts,i.hash)!==!1&&u&&l&&!c&&(d=!0),d&&t(`setReadyToShow`,!0)),d},addAlertsFromConfig({dispatch:e},t){Object.values(t).forEach(t=>{t.initial=!0,t.isNews=!0,t.initialConfirmed=t.mustBeConfirmed,e(`addSingleAlert`,t)})},activateDisplayOnEventAlerts({state:e,commit:t},n){e.alertsOnEvent=[],e.alerts.forEach(t=>{let r;Object.hasOwn(t,`displayOnEvent`)&&(r=t.displayOnEvent,n.type===r.type&&(typeof r.value==`string`&&r.value===n.payload||typeof r.value==`object`&&Object.entries(r.value).every(([e,t])=>n.payload[e]===t))&&e.alertsOnEvent.push(t))}),t(`setReadyToShow`,!0)}},mutations:oa,getters:sa},va={mergeControlState({commit:e},{controlKey:t,controlValues:n}){Object.keys(n).forEach(r=>{e(`${ra.upperFirst(t)}/set${ra.upperFirst(r)}`,n[r])})}},ya={activatedExpandable:!1,addonControls:{}};y();var K=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},ba={name:`ControlIcon`,props:{iconName:{type:String,default:``},disabled:{type:Boolean,default:!1},title:{type:String,required:!0},onClick:{type:Function,default:()=>console.warn(`No onClick function was defined on this ControlIcon.`)},buttonTitle:{type:String,default:``}},computed:{iconClassOrSrc(){return this.iconName.startsWith(`http`)||this.iconName===``||this.iconName.startsWith(`bi-`)?this.iconName:`bi-${this.iconName}`}}},xa=[`tabindex`,`title`,`disabled`],Sa=[`src`,`alt`],Ca={key:2};function wa(e,t,n,r,i,a){return v(),M(`button`,{type:`button`,tabindex:n.disabled?`-1`:`0`,class:E([`control-icon-controls`,`bootstrap-icon`,`btn`,`my-2`,`control-button-controls`,`btn-light`,`px-1`]),title:n.title,disabled:n.disabled,onClick:t[0]||=on((...e)=>n.onClick&&n.onClick(...e),[`stop`]),onKeyup:t[1]||=me(on((...e)=>n.onClick&&n.onClick(...e),[`stop`,`prevent`]),[`space`])},[!a.iconClassOrSrc.includes(`masterportal`)&&!a.iconClassOrSrc.includes(`http`)?(v(),M(`i`,{key:0,class:E(a.iconClassOrSrc)},null,2)):a.iconClassOrSrc.includes(`http`)?(v(),M(`img`,{key:1,src:a.iconClassOrSrc,alt:n.title,class:`icon-img`},null,8,Sa)):n.buttonTitle===``?L(``,!0):(v(),M(`p`,Ca,I(n.title),1)),Lt(e.$slots,`default`)],40,xa)}var Ta=K(ba,[[`render`,wa]]);y();var Ea={name:`BackForward`,components:{ControlIcon:Ta}
2,computed:{...N(`Controls/BackForward`,[`backAvailable`,`forthAvailable`,`iconBack`,`iconForward`,`supportedDevices`])},mounted(){mapCollection.getMap(`2D`).on(`moveend`,this.memorizeMap)},beforeUnmount(){mapCollection.getMap(`2D`).un(`moveend`,this.memorizeMap)},methods:{...o(`Controls/BackForward`,[`backward`,`forward`,`memorize`]),memorizeMap(){this.memorize(mapCollection.getMapView(`2D`))},moveForward(){this.forward(mapCollection.getMap(`2D`))},moveBackward(){this.backward(mapCollection.getMap(`2D`))}}},Da={id:`back-forward-buttons`};function Oa(e,t,n,r,i,o){let s=a(`ControlIcon`);return v(),M(`div`,Da,[A(s,{class:`forward`,title:e.$t(`common:modules.controls.backForward.stepForward`),disabled:!e.forthAvailable,"icon-name":e.iconForward,"on-click":o.moveForward},null,8,[`title`,`disabled`,`icon-name`,`on-click`]),A(s,{class:`backward`,title:e.$t(`common:modules.controls.backForward.stepBackward`),disabled:!e.backAvailable,"icon-name":e.iconBack,"on-click":o.moveBackward},null,8,[`title`,`disabled`,`icon-name`,`on-click`])])}var ka=K(Ea,[[`render`,Oa]]);y();var Aa={name:`Button3dItem`,components:{ControlIcon:Ta},computed:{...N(`Controls/Button3d`,[`icon2d`,`icon3d`]),...N(`Maps`,[`mode`]),buttonTitle(){return this.$t(this.mode===`2D`?`common:modules.controls.button3d.buttonTitle3d`:`common:modules.controls.button3d.buttonTitle2d`)},buttonIcon(){return this.mode===`2D`?this.icon3d:this.icon2d}},methods:{...w(`Maps`,[`changeMapMode`]),triggerChangeMapMode(){let e=this.mode===`2D`?`3D`:`2D`;this.changeMapMode(e)}}},ja={id:`button-3d-button`};function Ma(e,t,n,r,i,o){let s=a(`ControlIcon`);return v(),M(`div`,ja,[A(s,{title:o.buttonTitle,"on-click":o.triggerChangeMapMode,"button-title":o.buttonTitle,"icon-name":o.buttonIcon},null,8,[`title`,`on-click`,`button-title`,`icon-name`])])}var Na=K(Aa,[[`render`,Ma]]);y();var Pa={name:`FreezeScreenUnfreeze`,emits:[`hideFreezeWin`],mounted(){this.$nextTick(()=>{document.getElementById(`masterportal-container`).appendChild(this.$el),this.$refs.unfreeze&&this.$refs.unfreeze.focus()})},methods:{hideFreezeWin(e){(e.type===`click`||e.which===32||e.which===13)&&this.$emit(`hideFreezeWin`)}}},Fa=[`title`];function Ia(e,t,n,r,i,a){return v(),M(`div`,{id:`freeze-screen-unfreeze`,onKeydown:t[2]||=on(()=>{},[`prevent`,`stop`])},[z(`p`,{ref:`unfreeze`,class:`freeze-screen-unfreeze-button`,title:e.$t(`common:modules.controls.freeze.unfreeze`),tabindex:`0`,role:`button`,onClick:t[0]||=e=>a.hideFreezeWin(e),onKeydown:t[1]||=e=>a.hideFreezeWin(e)},I(e.$t(`common:modules.controls.freeze.unfreeze`)),41,Fa)],32)}var La=K(Pa,[[`render`,Ia],[`__scopeId`,`data-v-54cfdbb1`]]);y();var Ra={name:`FreezeScreen`,components:{FreezeScreenUnfreeze:La,ControlIcon:Ta},data:()=>({isFreezed:!1}),computed:{...N(`Controls/Freeze`,[`icon`])},methods:{showFreezeWin(){this.isFreezed=!0},hideFreezeWin(){this.isFreezed=!1}}},za={id:`freeze-screen-button`};function Ba(e,t,n,r,i,o){let s=a(`ControlIcon`),c=a(`FreezeScreenUnfreeze`);return v(),M(`div`,za,[A(s,{title:e.$t(`common:modules.controls.freeze.freeze`),class:`control`,"icon-name":e.icon,"on-click":o.showFreezeWin},null,8,[`title`,`icon-name`,`on-click`]),e.isFreezed?(v(),F(c,{key:0,onHideFreezeWin:o.hideFreezeWin},null,8,[`onHideFreezeWin`])):L(``,!0)])}var Va=K(Ra,[[`render`,Ba]]);y();function Ha(){let e=document.documentElement;return e.requestFullscreen?(e.requestFullscreen(),!0):e.msRequestFullscreen?(e.msRequestFullscreen(),!0):e.mozRequestFullScreen?(e.mozRequestFullScreen(),!0):e.webkitRequestFullscreen?(e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT),!0):!1}function Ua(){return document.exitFullscreen?(document.exitFullscreen(),!0):document.msExitFullscreen?(document.msExitFullscreen(),!0):document.mozCancelFullScreen?(document.mozCancelFullScreen(),!0):document.webkitExitFullscreen?(document.webkitExitFullscreen(),!0):!1}function Wa(){return!!(document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement)}var Ga={name:`FullScreen`,components:{ControlIcon:Ta},data:function(){return{active:Wa()}},computed:{...N(`Controls/FullScreen`,[`iconArrow`,`iconExit`,`newTabFromFrame`]),...N(`Modules/ShareView`,[`url`])},mounted(){document.addEventListener(`mozfullscreenchange`,this.escapeHandler),document.addEventListener(`MSFullscreenChange`,this.escapeHandler),document.addEventListener(`webkitfullscreenchange`,this.escapeHandler),document.addEventListener(`fullscreenchange`,this.escapeHandler)},unmounted(){document.removeEventListener(`mozfullscreenchange`,this.escapeHandler),document.removeEventListener(`MSFullscreenChange`,this.escapeHandler),document.removeEventListener(`webkitfullscreenchange`,this.escapeHandler),document.removeEventListener(`fullscreenchange`,this.escapeHandler)},methods:{escapeHandler(){this.active=Wa()},toggleFullScreen(){if(this.newTabFromFrame&&window.self!==window.top){window.open(this.url,`_blank`);return}this.active?this.active=!Ua():this.active=Ha()}}},Ka={id:`full-screen-button`};function qa(e,t,n,r,i,o){let s=a(`ControlIcon`);return v(),M(`div`,Ka,[A(s,{title:e.$t(`common:modules.controls.fullScreen.${e.active?`disable`:`enable`}`),"icon-name":e.active?e.iconExit:e.iconArrow,"on-click":o.toggleFullScreen},null,8,[`title`,`icon-name`,`on-click`])])}var Ja=K(Ga,[[`render`,qa]]),Ya={iconGeolocate:`geo-alt`,iconGeolocatePOI:`record-circle`,iconGeolocationMarker:`bi-circle-fill`,iconDirectionArrow:`bi-triangle-fil`,poiDistances:[],supportedDevices:[`Desktop`,`Mobile`],supportedMapModes:[`2D`,`3D`],zoomMode:`once`,activeCategory:``,geolocation:null,iFrameGeolocationEnabled:`common:modules.controls.orientation.iFrameGeolocationEnabled`,onlyFilteredFeatures:!1,poiMode:`currentPosition`,customPosition:`common:modules.controls.orientation.poiChoiceCustomPosition`,poiModeCurrentPositionEnabled:!0,position:null,showPoi:!1,showPoiChoice:!1,showPoiIcon:!1,showAccuracy:!1,showDirection:!1},Xa={...U(Ya),setCurrentPositionEnabled(e,t){e.poiModeCurrentPositionEnabled=t}};y();var Za={name:`PoiChoice`,emits:[`track`],computed:{...N(`Controls/Orientation`,[`poiMode`,`customPosition`,`iFrameGeolocationEnabled`]),choices(){let e=window.self!==window.top,t=this.iFrameGeolocationEnabled===!0;return e&&!t?(this.setPoiMode(`customPosition`),{customPosition:this.$t(this.customPosition)}):{currentPosition:this.$t(`common:modules.controls.orientation.poiChoiceCurrentPosition`),customPosition:this.$t(this.customPosition)}}},mounted(){this.show(),this.$nextTick(()=>{this.$refs[`close-icon`]&&this.$refs[`close-icon`].focus()})},unmounted(){this.poiMode===`currentPosition`&&this.unregisterListener({type:`click`,listener:this.mapClicked,keyForBoundFunctions:`poiChoiceTriggerTrack`})},methods:{...o(`Controls/Orientation`,Object.keys(Xa)),...w(`Maps`,[`registerListener`,`unregisterListener`]),closeIconTriggered(e){(e.type===`click`||e.which===32||e.which===13)&&this.hidePoiChoice()},hidePoiChoice(){this.setShowPoiChoice(!1),document.querySelector(`#geolocatePOI`).classList.remove(`toggleButtonPressed`)},show(){let e=document.querySelector(`.modal.poi-choice`),t=document.querySelector(`.modal-backdrop`);e&&(e.style.display=`block`,e.classList.add(`show`),e.classList.remove(`fade`),t.style.display=`block`,t.classList.add(`show`),t.classList.remove(`fade`))},setPoiOption(e){this.setPoiMode(e?.target?.value),this.setCurrentPositionEnabled(this.poiMode===`currentPosition`)},triggerTrack(){this.$emit(`track`),this.setShowPoiChoice(!1),this.registerListener({type:`click`,listener:this.mapClicked,keyForBoundFunctions:`poiChoiceTriggerTrack`})},mapClicked(e){this.setPosition(e.coordinate),this.setShowPoi(!0),this.unregisterListener({type:`click`,listener:this.mapClicked,keyForBoundFunctions:`poiChoiceTriggerTrack`})},stopPoi(){this.unregisterListener({type:`click`,listener:this.mapClicked,keyForBoundFunctions:`poiChoiceTriggerTrack`}),this.setPoiMode(`currentPosition`),this.setCurrentPositionEnabled(!0),this.$store.dispatch(`Maps/removePointMarker`),this.hidePoiChoice(),document.querySelector(`#geolocatePOI`).classList.remove(`toggleButtonPressed`)}}},Qa={class:`modal fade in poi-choice`},$a={class:`modal-dialog`},eo={class:`modal-content`},to={class:`modal-header`},no={class:`modal-title`},ro=[`title`],io={class:`choice-content`},ao={class:`choice-title`},oo=[`value`,`checked`];function so(e,t,n,r,i,a){return v(),M(`div`,Qa,[z(`div`,$a,[z(`div`,eo,[z(`div`,to,[z(`h4`,
2no,[t[6]||=z(`span`,{class:`control-icon bootstrap-icon standalone`},[z(`i`,{class:`bi-record-circle`})],-1),R(` `+I(e.$t(`common:modules.controls.orientation.titleGeolocatePOI`)),1)]),z(`span`,{ref:`close-icon`,class:`bootstrap-icon`,tabindex:`0`,"aria-hidden":`true`,"data-bs-dismiss":`modal`,title:e.$t(`button.close`),onClick:t[0]||=e=>a.closeIconTriggered(e),onKeydown:t[1]||=e=>a.closeIconTriggered(e)},[...t[7]||=[z(`i`,{class:`bi-x-lg`},null,-1)]],40,ro)]),z(`div`,io,[z(`div`,ao,I(e.$t(`common:modules.controls.orientation.poiChoiceTitle`)),1),(v(!0),M(D,null,C(a.choices,(n,r)=>(v(),M(`label`,{key:n,class:E(r)},[z(`input`,{type:`radio`,name:`poiChoice`,value:r,checked:r===e.poiMode,onChange:t[2]||=(...e)=>a.setPoiOption&&a.setPoiOption(...e)},null,40,oo),R(` `+I(n),1)],2))),128)),t[8]||=z(`hr`,null,null,-1),z(`button`,{class:`confirm btn btn-primary`,tabindex:`0`,onClick:t[3]||=(...e)=>a.triggerTrack&&a.triggerTrack(...e)},I(e.$t(`common:modules.controls.orientation.poiChoiceConfirmation`)),1),z(`button`,{class:`stop btn btn-outline-default`,onClick:t[4]||=(...e)=>a.stopPoi&&a.stopPoi(...e)},I(e.$t(`common:modules.controls.orientation.poiChoiceStop`)),1)])])]),z(`button`,{class:`modal-backdrop fade in`,onClick:t[5]||=(...e)=>a.hidePoiChoice&&a.hidePoiChoice(...e)})])}var co=K(Za,[[`render`,so],[`__scopeId`,`data-v-9f5a6177`]]);function lo(e){if(Array.isArray(e))return e;if(typeof e==`string`)return e.split(` `)}function uo(e){let t=``,n=e.circleStrokeColor||e.attributes&&e.attributes.circleStrokeColor,r=e.circleStrokeWidth||e.attributes&&e.attributes.circleStrokeWidth,i=e.circleFillColor||e.attributes&&e.attributes.circleFillColor,a=n?Be(n,`hex`):`black`,o=Array.isArray(n)&&n.length>3?n[3].toString():0,s=r||`auto`,c=i?Be(i,`hex`):`black`,l=Array.isArray(i)&&i.length>3?i[3]:0;return t+=`<svg height='25' width='25'>`,t+=`<circle cx='12.5' cy='12.5' r='10' stroke='`,t+=a,t+=`' stroke-opacity='`,t+=o,t+=`' stroke-width='`,t+=s,t+=`' fill='`,t+=c,t+=`' fill-opacity='`,t+=l,t+=`'/>`,t+=`</svg>`,t}function fo(e){let t=``,n=e.lineStrokeColor||e.attributes&&e.attributes.lineStrokeColor,r=e.lineStrokeWidth||e.attributes&&e.attributes.lineStrokeWidth,i=e.lineStrokeDash||e.attributes&&e.attributes.lineStrokeDash,a=n?Be(n,`hex`):`black`,o=parseInt(r,10),s=Array.isArray(n)&&n.length>3?n[3].toString():0,c=Array.isArray(i)?i.join(` `):void 0;return t+=`<svg height='25' width='25'>`,t+=`<path d='M 05 20 L 20 05' stroke='`,t+=a,t+=`' stroke-opacity='`,t+=s,t+=`' stroke-width='`,t+=o,c&&(t+=`' stroke-dasharray='`,t+=c),t+=`' fill='none'/>`,t+=`</svg>`,t}function po(e){let t=``,n=e.polygonFillColor||e.attributes&&e.attributes.polygonFillColor,r=e.polygonStrokeColor||e.attributes&&e.attributes.polygonStrokeColor,i=e.polygonStrokeWidth||e.attributes&&e.attributes.polygonStrokeWidth,a=n?Be(n||`black`,`hex`):`black`,o=r?Be(r,`hex`):`black`,s=parseInt(i,10),c=Array.isArray(n)&&n.length>3?n[3].toString():0,l=Array.isArray(r)&&r.length>3?r[3].toString():0;return e.polygonFillHatch||e.attributes&&e.attributes.polygonFillHatch?un.prototype.getPolygonFillHatchLegendDataUrl(e):(t+=`<svg height='25' width='25'>`,t+=`<polygon points='5,5 20,5 20,20 5,20' style='fill:`,t+=a,t+=`;fill-opacity:`,t+=c,t+=`;stroke:`,t+=o,t+=`;stroke-opacity:`,t+=l,t+=`;stroke-width:`,t+=s,t+=`;'/>`,t+=`</svg>`,t)}var mo={createCircle:uo,createLine:fo,createPolygon:po};y();var ho={name:`NavTab`,props:{id:{type:String,required:!0},label:{type:String,required:!0},icon:{type:String,required:!1,default:``},active:{type:Boolean,required:!0},disabled:{type:Boolean,required:!1,default:!1},target:{type:String,required:!0},value:{type:String,required:!1,default:void 0},interaction:{type:Function,required:!1,default:()=>!0},styleVariant:{type:String,required:!1,default:void 0,validator:e=>!e||[`blue`].includes(e)}},methods:{onclick(e){this.disabled||this.interaction(e)},onkeydown(e){let t={ArrowLeft:-1,ArrowRight:1}[e.key];if(t===void 0)return;let n=e.currentTarget.closest(`[role=tablist]`);if(!n)return;e.preventDefault(),e.stopPropagation();let r=[...n.querySelectorAll(`[role=tab]:not([disabled])`)],i=r.indexOf(e.currentTarget),a=i>=0?r[(i+t+r.length)%r.length]:null;a?.focus(),a?.click()}}},go=[`value`],_o=[`id`,`data-bs-target`,`disabled`,`tabindex`,`aria-controls`,`aria-selected`,`aria-disabled`,`aria-label`];function vo(e,t,n,r,i,a){return v(),M(`li`,{class:E([`nav-item`,n.styleVariant&&`nav-item--${n.styleVariant}`]),role:`presentation`,value:n.value},[z(`button`,{id:n.id,class:E([`nav-link`,{active:n.active},n.styleVariant&&`nav-link--${n.styleVariant}`]),"data-bs-toggle":`tab`,"data-bs-target":n.target,type:`button`,role:`tab`,disabled:n.disabled,tabindex:n.active?0:-1,"aria-controls":n.target,"aria-selected":n.active,"aria-disabled":n.disabled,"aria-label":n.label,onClick:t[0]||=(...e)=>a.onclick&&a.onclick(...e),onKeydown:t[1]||=(...e)=>a.onkeydown&&a.onkeydown(...e)}
2,[n.icon?(v(),M(`i`,{key:0,class:E([`bi me-2`,n.icon]),"aria-hidden":`true`},null,2)):L(``,!0),R(` `+I(e.$t(n.label))+` `,1),Lt(e.$slots,`default`,{},void 0,!0)],42,_o)],10,go)}var yo=K(ho,[[`render`,vo],[`__scopeId`,`data-v-79da85aa`]]);y();var bo={name:`PoiOrientation`,components:{NavTab:yo},props:{poiDistances:{type:[Boolean,Array],required:!1,default:()=>[]},getFeaturesInCircle:{type:Function,required:!0}},emits:[`hide`],data(){return{poiFeatures:[],imgPathByFeature:{}}},computed:{...N(`Controls/Orientation`,[`activeCategory`,`position`]),...N([`visibleLayerConfigs`])},watch:{visibleLayerConfigs:{handler(e,t){e.forEach(n=>{t.find(e=>e.id===n.id)||this.$nextTick(()=>{this.areLayerFeaturesLoaded(n.id).then(()=>{this.getFeatures(e)})})}),t?.forEach(t=>{e.find(e=>e.id===t.id)||this.getFeatures(e)})},deep:!0}},mounted(){this.show(),this.getFeatures(this.visibleLayerConfigs),this.initActiveCategory(),this.$nextTick(()=>{this.$refs[`close-icon`]&&this.$refs[`close-icon`].focus()})},methods:{...o(`Controls/Orientation`,Object.keys(Xa)),...w(`Maps`,[`areLayerFeaturesLoaded`,`zoomToExtent`]),closeIconTriggered(e){(e.type===`click`||e.which===32||e.which===13||e.key===`Escape`)&&this.hidePoi()},show(){let e=document.querySelector(`.modal`),t=document.querySelector(`.modal-backdrop`);e&&(e.style.display=`block`,e.classList.add(`show`),e.classList.remove(`fade`),t&&(t.style.display=`block`,t.classList.add(`show`),t.classList.remove(`fade`)))},hidePoi(){this.$emit(`hide`),this.poiFeatures=[],document.querySelector(`#geolocatePOI`).classList.remove(`toggleButtonPressed`)},getFeatures(e){let t=this.poiDistances,n=[],r=this.position,i=[];t.forEach(t=>{i=this.getFeaturesInCircle(e,t,r),i.sort((e,t)=>e.dist2Pos-t.dist2Pos),n.push({category:t,features:i})}),n.forEach(e=>{e.features.forEach(e=>{this.fillImagePath(e),e.nearbyTitleText=this.getFeatureTitle(e)})}),this.poiFeatures=n},initActiveCategory(){let e,t;typeof this.activeCategory!=`number`&&(e=this.poiFeatures,t=e.find(function(e){return e.features.length>0}),this.setActiveCategory(t?t.category:e[0].category))},getFeatureTitle(e){if(!Array.isArray(e.nearbyTitleText)||!e.nearbyTitleText.length){if(e.get(`name`))return[e.get(`name`)];if(e.layerName)return[e.layerName]}return e.nearbyTitleText},zoomFeature(e){let t=e.currentTarget.id,n=this.poiFeatures,r=this.activeCategory,i=lo(n.find(e=>e.category===r).features.find(e=>e.getId()===t).getGeometry().getExtent()),a=mapCollection.getMapView(`2D`).getResolutions(),o=a.indexOf(.2645831904584105)===-1?a.length:a.indexOf(.2645831904584105);this.zoomToExtent({extent:i,options:{maxZoom:o}}),this.$store.dispatch(`Maps/removePointMarker`),this.$emit(`hide`),this.setPoiMode(`currentPosition`),this.setCurrentPositionEnabled(!0),document.querySelector(`#geolocatePOI`).classList.remove(`toggleButtonPressed`)},changedCategory(e){this.setActiveCategory(e)},fillImagePath(e){let t=Ft.returnStyleObject(e.styleId);if(this.imgPathByFeature[e.getId()]=``,t){let n=Jt.getGeometryStyle(e,t.rules,!1,Config.wfsImgPath),r=Jt.createStyle(t,e,!1,Config.wfsImgPath);n.attributes?.type===`icon`?this.imgPathByFeature[e.getId()]=r.getImage()?.getSrc()?r.getImage()?.getSrc():``:Jt.returnLegendByStyleId(e.styleId).then(t=>{t.legendInformation.forEach(t=>{t.geometryType===`Point`&&t.styleObject.attributes?.type===`circle`&&t.label===e.legendValue?this.imgPathByFeature[e.getId()]=mo.createCircle(t.styleObject):t.geometryType===`LineString`&&t.label===e.legendValue?this.imgPathByFeature[e.getId()]=mo.createLine(t.styleObject):t.geometryType===`Polygon`&&t.label===e.legendValue&&(this.imgPathByFeature[e.getId()]=mo.createPolygon(t.styleObject))})})}}}},xo={id:`surrounding_vectorfeatures`,class:`modal fade in poi`,role:`dialog`,"aria-modal":`true`,tabindex:`-1`},So={class:`modal-dialog`},Co={class:`modal-content`},wo={class:`modal-header`},To={class:`modal-title`},Eo=[`title`],Do={class:`nav nav-tabs`,role:`tablist`},Oo={class:`result-count`},ko={class:`tab-content`},Ao=[`id`],jo={class:`poi-list`},Mo=[`id`],No={key:0,class:`poi-icon`},Po=[`innerHTML`],Fo=[`src`,`alt`];function Io(e,t,n,r,i,o){let s=a(`NavTab`);return v(),M(`div`,xo,[z(`div`,So,[z(`div`,Co,[z(`div`,wo,[z(`h4`,To,I(e.$t(`common:modules.controls.orientation.titleGeolocatePOI`)),1),z(`span`,{ref:`close-icon`,class:`bootstrap-icon`,tabindex:`0`,"aria-hidden":`true`,"data-bs-dismiss":`modal`,title:e.$t(`button.close`),onClick:t[0]||=e=>o.closeIconTriggered(e),onKeydown:t[1]||=e=>o.closeIconTriggered(e)},[...t[4]||=[z(`i`,{class:`bi-x-lg`},null,-1)]],40,Eo)]),z(`div`,null,[z(`ul`,Do,[(v(!0),M(D,null,C(i.poiFeatures,(t,n)=>(v(),F(s,{id:`poi-tab-${t.category}`,key:n,label:`${t.category}m`,active:t.category===e.activeCategory,target:`#poi-distance-${t.category}`,interaction:()=>o.changedCategory(t.category)},{default:Pn(()=>[z(`span`,Oo,I(t.features.length),1)]),_:2},1032,[`id`,`label`,`active`,`target`,`interaction`]))),128))]),z(`div`,ko,[(v(!0),M(D,null,C(i.poiFeatures,(n,r)=>(v(),M(`div`,{id:`poi-distance-${n.category}`,key:`list`+r,role:`tabpanel`,class:E([`tab-pane fade show`,n.category===e.activeCategory?`active`:``])},[z(`ul`,jo,[(v(!0),M(D,null,C(n.features,(n,r)=>(v(),M(`li`,{key:`poi-item`+r,class:`poi-item`},[z(`button`,{id:n.getId(),class:`poi-button`,onClick:t[2]||=(...e)=>o.zoomFeature&&o.zoomFeature(...e)},[i.imgPathByFeature[n.getId()].length>0?(v(),M(`div`,No,[i.imgPathByFeature[n.getId()].indexOf(`</svg>`)===-1?(v(),M(`img`,{key:1,src:i.imgPathByFeature[n.getId()],alt:e.$t(`common:modules.controls.orientation.imgAlt`)},null,8,Fo)):(v(),M(`span`,{key:0,innerHTML:i.imgPathByFeature[n.getId()]},null,8,Po))])):L(``,!0),z(`div`,{class:E([`poi-description`,{"full-width":i.imgPathByFeature[n.getId()].length===0}])},[z(`div`,null,[(v(!0),M(D,null,C(n.nearbyTitleText,(e,t)=>(v(),M(`p`,{key:`featNearbyTitleText`+t},[z(`strong`,null,I(e),1)]))),128)),z(`p`,null,I(n.dist2Pos+` `+e.$t(`common:modules.controls.orientation.distanceUnit`)),1
2)])],2)],8,Mo)]))),128))])],10,Ao))),128))])])])]),z(`button`,{class:`modal-backdrop fade show`,onClick:t[3]||=(...e)=>o.hidePoi&&o.hidePoi(...e)})])}var Lo=K(bo,[[`render`,Io],[`__scopeId`,`data-v-2d2c4c2f`]]);function Ro(e=1){return[0,92,169,e]}function zo(e=1){return[[46,127,210,e],[255,217,102,e],[13,86,163,e],[255,130,102,e],[0,48,99,e],[230,159,0,e],[86,180,233,e]]}y();function Bo(){return n(new V)}function Vo({accuracyFeature:e,accuracyLayer:t,map:r}){if(t!==null)return{accuracyLayer:t};let i=Ro(.15),a=Ro(.9),o=n(new Pe),s=n(new Rt({id:`orientation_accuracy_layer`,source:o,style:new T({fill:new S({color:i}),stroke:new x({color:a,width:2})}),zIndex:_r.alwaysOnTop}));return o.addFeature(e),r.addLayer(s),{accuracyLayer:s}}function Ho({showAccuracy:e,geolocation:t,projectionCode:n,accuracyFeature:r}){if(!e||t===null)return;let i=t.getAccuracyGeometry();i&&r.setGeometry(i.clone().transform(`EPSG:4326`,n))}function Uo({geolocation:e,accuracyFeature:t,listener:n}){e&&e.un(`change:accuracyGeometry`,n),t.setGeometry(null)}function Wo({accuracyLayer:e,map:t}){e!==null&&t.removeLayer(e)}function q(e){return Object.prototype.toString.call(e)===`[object Object]`}function Go(e,t,n){let r=e.concat(t),i=0,a=0;for(i=0;i<r.length;i++)for(a=i+1;a<r.length;a++)n(r[i],r[a])&&(r.splice(a,1),a--);return r}function Ko(e,t){let n=new sn([e.getGeometry().getClosestPoint(t),t]);return Math.round(n.getLength())}function qo(e,t){if(typeof t==`string`&&e.get(t)!==void 0)return[e.get(t)];if(Array.isArray(t)){let n=[];return t.forEach(t=>{e.get(t)!==void 0&&n.push(e.get(t))}),n}return[]}function Jo({layerConfigs:e,distance:t,centerPosition:n,onlyFilteredFeatures:r}){let i=new ht(n,t).getExtent(),a=[];e.forEach(e=>{if(e.typ===`WFS`&&e.visibility){let t=W.getLayerById(e.id);t&&a.push(t)}});let o=[],s=[];return a.forEach(e=>{let a,c=[];e.getLayerSource()&&(s=e.getLayerSource().getFeaturesInExtent(i),c=s.filter(e=>q(e.getStyle())&&e.getStyle().getImage()!==null||typeof e.getStyle()==`function`&&e.getStyle()(e)!==null),r===!0&&(s=c),a=s.filter(e=>Ko(e,n)<=t),a.forEach(t=>{Object.assign(t,{styleId:e.get(`styleId`),layerName:e.get(`name`),nearbyTitleText:qo(t,e.get(`nearbyTitle`)),dist2Pos:Ko(t,n)})}),o=Go(a,o,function(e,t){return e===t}))}),o}function Yo(e){return(e*180/Math.PI+360)%360}function Xo(e){return Number.isFinite(e)?e:null}function Zo(e,t){return!e||!Number.isFinite(t)?{}:{"--marker-heading-angle":`${Yo(t)}deg`}}y();var Qo={name:`OrientationItem`,components:{ControlIcon:Ta,PoiChoice:co,PoiOrientation:Lo},data(){return{firstGeolocation:!0,marker:n(new wn({positioning:`center-center`,stopEvent:!1})),tracking:!1,isGeolocationDenied:!1,isGeoLocationPossible:!1,heading:null,previousPosition:null,accuracyFeature:Bo(),accuracyLayer:null}},computed:{...N(`Controls/Orientation`,[`geolocation`,`iconGeolocate`,`iconGeolocatePOI`,`iconGeolocationMarker`,`iconDirectionArrow`,`iFrameGeolocationEnabled`,`onlyFilteredFeatures`,`poiDistances`,`poiMode`,`poiModeCurrentPositionEnabled`,`showDirection`,`showPoi`,`showPoiChoice`,`showPoiIcon`,`zoomMode`,`showAccuracy`]),...N(`Maps`,[`projection`]),...N([`visibleLayerConfigs`]),poiDistancesLocal(){return this.poiDistances===!0?[500,1e3,2e3]:this.poiDistances},markerDirectionStyle(){return Zo(this.showDirection,this.heading)}},watch:{tracking(){this.trackingChanged(),this.checkWFS()}
2,isGeolocationDenied(){this.toggleBackground(),this.checkWFS()},position(){!this.poiModeCurrentPositionEnabled&&this.showPoiIcon&&this.showPoiWindow()},visibleLayerConfigs:{handler(){this.checkWFS()},deep:!0}},created(){this.setIsGeoLocationPossible()},mounted(){this.addElement(),this.checkWFS()},beforeUnmount(){Uo({accuracyFeature:this.accuracyFeature,geolocation:this.geolocation,listener:this.onAccuracyGeometryChange}),this.removeOverlay()},methods:{...o(`Controls/Orientation`,Object.keys(Xa)),...w(`Maps`,[`zoomToCoordinates`]),...w(`Alerting`,[`addSingleAlert`]),onAccuracyGeometryChange(){Ho({accuracyFeature:this.accuracyFeature,geolocation:this.geolocation,projectionCode:this.projection.getCode(),showAccuracy:this.showAccuracy})},setIsGeoLocationPossible(){this.isGeoLocationPossible=window.location.protocol===`https:`||[`localhost`,`127.0.0.1`].indexOf(window.location.hostname)},addElement:function(){this.marker.setElement(document.querySelector(`#geolocation_marker`))},canStartTracking(){let e=window.self!==window.top,t=this.iFrameGeolocationEnabled===!0;return e&&!t?(this.addSingleAlert({category:`error`,content:`<strong>${this.$t(`common:modules.controls.orientation.iFrameGeolocationError`)}`}),!1):this.isGeolocationDenied===!1?!0:(this.onError(),!1)},ensureGeolocationInstance(){if(this.geolocation===null){let e=n(new Qe({tracking:!1,projection:Mt(`EPSG:4326`),trackingOptions:{enableHighAccuracy:!0}}));return this.setGeolocation(e),e}return this.geolocation},unbindGeolocationListeners(e){e.un(`change`,this.positioning),e.un(`error`,this.onError,this),e.un(`change:accuracyGeometry`,this.onAccuracyGeometryChange)},showMarkerOverlay(){let e=mapCollection.getMap(`2D`);if(e.addOverlay(this.marker),this.showAccuracy){let{accuracyLayer:t}=Vo({accuracyFeature:this.accuracyFeature,accuracyLayer:this.accuracyLayer,map:e});this.accuracyLayer=t,this.onAccuracyGeometryChange()}},bindGeolocationListeners(e){this.showAccuracy&&e.on(`change:accuracyGeometry`,this.onAccuracyGeometryChange),e.on(`change`,this.positioning),e.on(`error`,this.onError,this)},startTrackingSession(e){e.setTracking(!0),e.getPosition()&&this.positioning(),this.showAccuracy&&this.onAccuracyGeometryChange(),this.tracking=!0},stopTrackingSession(e){e.setTracking(!1),this.unbindGeolocationListeners(e),this.heading=null,this.previousPosition=null},track(){if(!this.canStartTracking())return;let e=this.ensureGeolocationInstance();this.showMarkerOverlay(),this.unbindGeolocationListeners(e),this.bindGeolocationListeners(e),this.startTrackingSession(e)},untrack(){let e=this.geolocation;if(!e){this.tracking=!1;return}this.stopTrackingSession(e),(this.tracking===!1||this.firstGeolocation===!1)&&this.removeOverlay(),Uo({accuracyFeature:this.accuracyFeature,geolocation:e,listener:this.onAccuracyGeometryChange}),this.unbindGeolocationListeners(e),this.tracking=!1},onError(){this.addSingleAlert({category:`error`,content:`<strong>${this.$t(`common:modules.controls.orientation.geolocationDeniedText`)}</strong>`}),this.isGeolocationDenied=!0,this.geolocation!==null&&this.untrack()},removeOverlay(){let e=mapCollection.getMap(`2D`);e.removeOverlay(this.marker),Wo({accuracyLayer:this.accuracyLayer,map:e}),this.accuracyLayer=null},checkWFS(){let e=[];this.visibleLayerConfigs?.forEach(t=>{t.typ===`WFS`&&e.push(t)}),this.poiDistancesLocal.length>0&&(e.length?this.setShowPoiIcon(!0):(this.setShowPoiIcon(!1),this.$store.dispatch(`Maps/removePointMarker`)))},trackingChanged(){this.tracking?document.querySelector(`#geolocate`).className+=` toggleButtonPressed`:(this.geolocation!==null&&this.untrack(),document.querySelector(`#geolocate`).classList.remove(`toggleButtonPressed`))},getOrientation(){this.tracking?this.geolocation!==null&&this.untrack():this.track()},positionMarker(e){try{this.marker.setPosition(e)}catch{console.error(`wasn't able to set marker`)}},zoomAndCenter(e){this.zoomToCoordinates({center:e,zoom:6})},positioning(){let e=this.geolocation.getPosition(),t=this.firstGeolocation,n=this.zoomMode,r=O(O(`EPSG:4326`),O(this.projection.getCode()),e),i=Xo(this.geolocation.getHeading());Number.isFinite(i)&&(this.heading=i),this.previousPosition=Array.isArray(e)?[...e]:null,this.setPosition(r),n===`once`?t===!0?(this.positionMarker(r),this.zoomAndCenter(r),this.firstGeolocation=!1):this.positionMarker(r):n===`always`?(this.positionMarker(r),this.zoomAndCenter(r),this.firstGeolocation=!1):console.error(`The configured zoomMode: `+n+` does not exist. Please use the params 'once' or 'always'!`),this.onAccuracyGeometryChange(),this.$store.dispatch(`Maps/removePointMarker`)}
2,toggleBackground(){let e=document.getElementById(`geolocate`);this.isGeolocationDenied?e.style.backgroundColor=`grey`:e.style.backgroundColor=`#E10019`},getPOI(){document.querySelector(`#geolocatePOI`).className+=` toggleButtonPressed`,this.setShowPoiChoice(!0)},trackPOI(){let e=null;this.removeOverlay(),this.poiModeCurrentPositionEnabled?(this.$store.dispatch(`Maps/removePointMarker`),this.showMarkerOverlay(),document.querySelector(`#geolocate`).className+=` toggleButtonPressed`,this.geolocation===null?(e=new Qe({tracking:!0,enableHighAccuracy:!0,projection:Mt(`EPSG:4326`)}),this.setGeolocation(e)):(e=this.geolocation,this.setPosition(null),this.showPoiWindow()),e.on(`change`,this.showPoiWindow),e.on(`error`,this.onPOIError)):(this.untrack(),document.querySelector(`#geolocate`).classList.remove(`toggleButtonPressed`))},untrackPOI(){let e=this.geolocation;this.poiModeCurrentPositionEnabled?(e.un(`change`,this.showPoiWindow),e.un(`error`,this.onPOIError)):this.removeOverlay(),this.setShowPoi(!1)},showPoiWindow(){if(!this.position){let e=this.geolocation.getPosition(),t=O(O(`EPSG:4326`),O(this.projection.getCode()),e);this.setPosition(t),this.positioning()}this.setShowPoi(!0)},onPOIError(){this.addSingleAlert({category:`error`,content:`<strong>${this.$t(`common:modules.controls.orientation.trackingDeniedText`)}</strong>`}),this.geolocation!==null&&this.untrack()},getVectorFeaturesInCircle(e,t,n){return Jo({layerConfigs:e,distance:t,centerPosition:n,onlyFilteredFeatures:this.onlyFilteredFeatures})}}},$o={class:`orientationButtons`},es={id:`geolocation_marker`,class:`geolocation_marker`};function ts(e,t,n,r,i,o){let s=a(`ControlIcon`),c=a(`PoiChoice`),l=a(`PoiOrientation`);return v(),M(`div`,$o,[z(`span`,es,[e.showDirection&&Number.isFinite(i.heading)?(v(),M(`span`,{key:0,class:`geolocation_marker_direction_anchor`,style:pe(o.markerDirectionStyle)},[z(`i`,{class:E(e.iconDirectionArrow+` geolocation_marker_direction`)},null,2)],4)):L(``,!0),z(`i`,{class:E(e.iconGeolocationMarker)},null,2)]),A(s,{id:`geolocate`,title:e.$t(`common:modules.controls.orientation.titleGeolocate`),"icon-name":e.iconGeolocate,"on-click":o.getOrientation},null,8,[`title`,`icon-name`,`on-click`]),e.showPoiIcon?(v(),F(s,{key:0,id:`geolocatePOI`,"icon-name":e.iconGeolocatePOI,title:e.$t(`common:modules.controls.orientation.titleGeolocatePOI`),"on-click":o.getPOI},null,8,[`icon-name`,`title`,`on-click`])):L(``,!0),e.showPoiChoice?(v(),F(c,{key:1,id:`geolocatePoiChoice`,onTrack:o.trackPOI},null,8,[`onTrack`])):L(``,!0),e.showPoi?(v(),F(l,{key:2,"poi-distances":o.poiDistancesLocal,"get-features-in-circle":o.getVectorFeaturesInCircle,onHide:o.untrackPOI},null,8,[`poi-distances`,`get-features-in-circle`,`onHide`])):L(``,!0)])}var ns=K(Qo,[[`render`,ts],[`__scopeId`,`data-v-61301659`]]);y();var rs={name:`RotationItem`,components:{ControlIcon:Ta},data:()=>({startTime:null,correction:null,destination:null,distance:null,scenePostRenderListener:null}),computed:{...N(`Maps`,[`mode`]),...N(`Controls/Rotation`,[`compass2d`,`compass3d`,`moveDistance`,`rotation`,`showResetRotation`,`resetRotationIcon`,`rotateClockwiseIcon`,`rotateCounterClockwiseIcon`,`rotationAngle`,`rotationIcons`,`showResetRotationAlways`]),...N([`controlsConfig`,`isMobile`]),controlsRingIcon(){return`url(`+Config.wfsImgPath+`compass/3d-controls-rings.png)`},pointerNorthIcon(){return`url(`+Config.wfsImgPath+`compass/pointer-north-short.png)`},controlsNorthIcon(){return`url(`+Config.wfsImgPath+`compass/3d-controls-north.png)`},controlsSouthIcon(){return`url(`+Config.wfsImgPath+`compass/3d-controls-south.png)`},controlsWestIcon(){return`url(`+Config.wfsImgPath+`compass/3d-controls-west.png)`},controlsEastIcon(){return`url(`+Config.wfsImgPath+`compass/3d-controls-east.png)`}},watch:{mode(e){e===`3D`?this.$nextTick(()=>{this.add3DListener()}):this.remove3DListener()}},mounted(){this.$nextTick(()=>{mapCollection.getMapView(`2D`).on(`change:rotation`,this.updateResetRotationIcon)})},unmounted(){mapCollection.getMapView(`2D`).un(`change:rotation`,this.updateResetRotationIcon)},methods:{...w(`Controls/Rotation`,[`move2d`,`rotateClockwise`,`rotateCounterClockwise`]),...o(`Controls/Rotation`,[`setRotation`,`setRotationIcons`,`setShowResetRotationAlways`]),updateResetRotationIcon(e){this.setRotation(e.target.getRotation()),this.showResetRotation&&this.$el.querySelector(`i`)&&(this.$el.querySelector(`i`).style.transform=`translate(-50%, -50%) rotate(${this.rotation}rad)`),this.mode===`2D`&&this.$el.querySelector(`#north-pointer`)&&(this.$el.querySelector(`#north-pointer`).style.transform=`rotate(${this.rotation}rad)`)},setToNorth(){mapCollection.getMapView(`2D`).animate({rotation:0})},add3DListener(){let e=mapCollection.getMap(`3D`).getCesiumScene(),t=this.$el.querySelector(`#north-pointer`);this.remove3DListener(),this.scenePostRenderListener=e.postRender.addEventListener(function(){t&&(t.style.transform=`rotate(${-1*e.camera.heading}rad)`)})},remove3DListener(){this.scenePostRenderListener&&=(this.scenePostRenderListener(),null)},move:function(e){this.mode===`2D`?this.move2d(e):this.move3d(e)},move3d:function(e){let t=mapCollection.getMap(`3D`).getCesiumScene();switch(e.currentTarget.id){case`compass_north`:t.camera.moveUp(this.moveDistance);break;case`compass_south`:t.camera.moveDown(this.moveDistance);break;case`compass_east`:t.camera.moveRight(this.moveDistance);break;case`compass_west`:t.camera.moveLeft(this.moveDistance);break;default:console.warn(`Rotation move3d event currentTarget id cannot be found! Move not possible.`);break}},northDown(e){let t=this.$el.querySelector(`#north-pointer`).getBoundingClientRect(),n={x:e.clientX,y:e.clientY};if(this.correction={y:t.top+t.height/2-n.y,x:t.left+t.width/2-n.x},this.startTime=new Date().getTime(),this.mode===`3D`){let e=``,t=``,n=``,r=``;e=mapCollection.getMap(`3D`).getCesiumScene(),t=e.camera,n=new Cesium.Ray(t.position,t.direction),r=e.globe.pick(n,e),r&&(this.destination=r,this.distance=Cesium.Cartesian3.distance(t.position,r))}window.addEventListener(`mouseup`,this.northUp.bind(this),{once:!0}),this.$el.onmousemove=this.mouseDragged.bind(this)},northUp(){new Date().getTime()-this.startTime<200&&this.setHeading(0),this.$el.onmousemove=void 0,window.removeEventListener(`mouseup`,this.northUp.bind(this),{once:!0})},mouseDragged(e){let t=``,n=``,r=``,i=``,a=``,o=``;t=this.$el.querySelector(`.compass`).getBoundingClientRect(),n=t.top+t.height/2,r=t.left+t.width/2,i=e.clientY-n+this.correction.y,a=e.clientX-r+this.correction.x,o=Math.atan2(i,a)+Math.PI/2,o=o>0?o:o+2*Math.PI,e.preventDefault(),this.mode===`3D`?this.setHeading(-o):mapCollection.getMapView(`2D`).setRotation(o)},setHeading(e){let t=mapCollection.getMap(`3D`).getCesiumScene().camera,n={orientation:{pitch:t.pitch,roll:t.roll,heading:e}};this.destination&&(n.destination=this.destination),t.setView(n),this.distance!==null&&t.moveBackward(this.distance)}}},is=()=>{c(e=>({c8df4d6c:e.controlsRingIcon,v44bfc70c:e.pointerNorthIcon,v3fbe2e86:e.controlsNorthIcon,v6429c585:e.controlsSouthIcon,v4ec68d6e:e.controlsWestIcon,v91a2b6d2:e.controlsEastIcon}))},as=rs.setup;rs.setup=as?(e,t)=>(is(),as(e,t)):is;var os={id:`rotation-control`},ss={key:0,class:`compass-control btn-group`},cs={class:`compassContainer`},ls={class:`compass`},us=[`title`],ds=[`title`],fs=[`title`],ps=[`title`],ms=[`title`];function hs(e,t,n,r,i,o){let s=a(`ControlIcon`);return v(),M(`div`,os,[!e.isMobile&&(e.mode===`2D`&&e.compass2d||e.mode===`3D`&&e.compass3d)?(v(),M(`div`,ss,[z(`div`,cs,[z(`div`,ls,[z(`button`,{id:`north-pointer`,class:`compass-pointer compass-pointer-north`,type:`button`,tabindex:`0`,title:e.$t(`common:modules.controls.rotation.compass.pointerNorth`),onMousedown:t[0]||=(...e)=>o.northDown&&o.northDown(...e)}
2,null,40,us),z(`button`,{id:`compass_north`,class:`compass-north 3d-control-btn`,tabindex:`0`,title:e.$t(`common:modules.controls.rotation.compass.moveNorth`),type:`button`,onClick:t[1]||=on(e=>o.move(e),[`stop`]),onKeydown:t[2]||=e=>o.move(e)},null,40,ds),z(`button`,{id:`compass_south`,class:`compass-south 3d-control-btn`,tabindex:`0`,title:e.$t(`common:modules.controls.rotation.compass.moveSouth`),type:`button`,onClick:t[3]||=on(e=>o.move(e),[`stop`]),onKeydown:t[4]||=e=>o.move(e)},null,40,fs),z(`button`,{id:`compass_west`,class:`compass-west 3d-control-btn`,tabindex:`0`,type:`button`,title:e.$t(`common:modules.controls.rotation.compass.moveWest`),onClick:t[5]||=on(e=>o.move(e),[`stop`]),onKeydown:t[6]||=e=>o.move(e)},null,40,ps),z(`button`,{id:`compass_east`,class:`compass-east 3d-control-btn`,tabindex:`0`,type:`button`,title:e.$t(`common:modules.controls.rotation.compass.moveEast`),onClick:t[7]||=on(e=>o.move(e),[`stop`]),onKeydown:t[8]||=e=>o.move(e)},null,40,ms)])])])):L(``,!0),e.showResetRotation&&(e.rotation!==0||e.showResetRotationAlways)?(v(),F(s,{key:1,id:`reset-rotation`,class:`reset-rotation-control-icon`,"icon-name":e.resetRotationIcon,title:e.$t(`common:modules.controls.rotation.reset`),disabled:!1,"on-click":o.setToNorth},null,8,[`icon-name`,`title`,`on-click`])):L(``,!0),e.rotationIcons&&!e.isMobile?(v(),F(s,{key:2,id:`rotate-clockwise`,class:`rotate-clockwise-icon`,title:e.$t(`common:modules.controls.rotation.rotateClockwise`),"icon-name":e.rotateClockwiseIcon,"on-click":e.rotateClockwise},null,8,[`title`,`icon-name`,`on-click`])):L(``,!0),e.rotationIcons&&!e.isMobile?(v(),F(s,{key:3,id:`rotate-counter-clockwise`,class:`rotate-counter-clockwise-icon`,title:e.$t(`common:modules.controls.rotation.rotateCounterClockwise`),"icon-name":e.rotateCounterClockwiseIcon,"on-click":e.rotateCounterClockwise},null,8,[`title`,`icon-name`,`on-click`])):L(``,!0)])}var gs=K(rs,[[`render`,hs]]);y();var _s={name:`StartModule`,components:{ControlIcon:Ta},computed:{...N(`Controls/StartModule`,[`configuredModuleStates`,`mainMenu`,`secondaryMenu`])},created(){this.setConfiguredModuleStates({menuModels:this.mainMenu,menuSide:`mainMenu`}),this.setConfiguredModuleStates({menuModels:this.secondaryMenu,menuSide:`secondaryMenu`})},methods:{...w(`Controls/StartModule`,[`setConfiguredModuleStates`,`onClick`])}},vs={id:`start-module-button`};function ys(e,t,n,r,i,o){let s=a(`ControlIcon`);return v(),M(`div`,vs,[(v(!0),M(D,null,C(e.configuredModuleStates,t=>(v(),F(s,{key:`control-module-`+t.state.type,"icon-name":t.state.icon,class:`control`,title:e.$t(t.state.name),disabled:!1,"on-click":()=>e.onClick({moduleState:t.state,menuSide:t.menuSide})},null,8,[`icon-name`,`title`,`on-click`]))),128))])}var bs=K(_s,[[`render`,ys]]);y();var xs={name:`TiltView`,components:{ControlIcon:Ta},computed:{...N(`Controls/TiltView`,[`tiltDownIcon`,`tiltUpIcon`])},methods:{tiltDown(){this.getCamera()?.lookDown()},tiltUp(){this.getCamera()?.lookUp()},getCamera(){return mapCollection.getMap(`3D`)?.getCesiumScene()?.camera}}},Ss={id:`tilt-view-button`};function Cs(e,t,n,r,i,o){let s=a(`ControlIcon`);return v(),M(`div`,Ss,[A(s,{id:`tilt-view-up`,class:`tilt-view-up-button`,title:e.$t(`common:modules.controls.tiltView.upButton`),"icon-name":e.tiltUpIcon,"on-click":o.tiltUp},null,8,[`title`,`icon-name`,`on-click`]),A(s,{id:`tilt-view-down`,class:`tilt-view-down-button`,title:e.$t(`common:modules.controls.tiltView.downButton`),"icon-name":e.tiltDownIcon,"on-click":o.tiltDown},null,8,[`title`,`icon-name`,`on-click`])])}var ws=K(xs,[[`render`,Cs]]);y();var Ts={name:`TotalView`,components:{ControlIcon:Ta},computed:{...N(`Controls/TotalView`,[`icon`]),...N(`Maps`,[`center`,`initialCenter`,`initialZoom`,`zoom`]),mapMoved(){return this.center?this.initialCenter[0]!==Math.round(this.center[0])||this.initialCenter[1]!==Math.round(this.center[1])||this.initialZoom!==this.zoom:!1}},methods:{...w(`Maps`,[`resetView`]),startResetView(){this.resetView()}}},Es={id:`total-view-button`};function Ds(e,t,n,r,i,o){let s=a(`ControlIcon`);return v(),M(`div`,Es,[A(s,{id:`start-totalview`,class:`total-view-button`,title:e.$t(`common:modules.controls.totalView.titleButton`),disabled:!o.mapMoved,"icon-name":e.icon,"on-click":o.startResetView},null,8,[`title`,`disabled`,`icon-name`,`on-click`])])}var Os=K(Ts,[[`render`,Ds]]);y();var ks={name:`ZoomInAndOut`,components:{ControlIcon:Ta},computed:{...N(`Controls/Zoom`,[`iconIn`,`iconOut`]),...N(`Maps`,[`isMaxZoomDisplayed`,`isMinZoomDisplayed`])},methods:{...w(`Maps`,[`decreaseZoom`,`increaseZoom`])}},As={id:`zoom-in-and-out-buttons`};function js(e,t,n,r,i,o){let s=a(`ControlIcon`);return v(),M(`div`,As,[A(s,{title:e.$t(`common:modules.controls.zoom.zoomIn`),"icon-name":e.iconIn,disabled:e.isMaxZoomDisplayed,"on-click":e.increaseZoom},null,8,[`title`,`icon-name`,`disabled`,`on-click`]),A(s,{title:e.$t(`common:modules.controls.zoom.zoomOut`),"icon-name":e.iconOut,disabled:e.isMinZoomDisplayed,"on-click":e.decreaseZoom},null,8,[`title`,`icon-name`,`disabled`,`on-click`])])}var Ms=K(ks,[[`render`,js]]),Ns={...H(ya),componentMap:()=>({BackForward:ka,Button3d:Na,Freeze:Va,FullScreen:Ja,Orientation:ns,Rotation:gs,StartModule:bs,TiltVie
2w:ws,TotalView:Os,Zoom:Ms})},Ps={...U(ya),registerControl(e,{name:t,control:n}){e.addonControls[ra.upperFirst(t)]=n}},Fs={iconBack:`skip-start-fill`,iconForward:`skip-end-fill`,supportedDevices:[`Desktop`],supportedMapModes:[`2D`],memory:[],position:null},Is={...H(Fs),backAvailable:e=>e.position!==null&&typeof e.memory[e.position-1]==`object`,forthAvailable:e=>e.position!==null&&typeof e.memory[e.position+1]==`object`};function Ls(e,t,n){let{memory:r,position:i}=e,a=i===null?null:i+n;if(a!==null)if(r[a]){let n=t.getView(),{center:i,zoom:o}=r[a];n.setZoom(o),n.setCenter(i),e.position=a}else console.error(`Tried to change active backForward memory by ${n} positions, but such a memory does not exist in memory ${JSON.stringify(r)}`)}var Rs={...U(Fs),memorize(e,t){let n=e.position===null?null:e.memory[e.position],r=e.position===null?[]:e.memory.slice(0,e.position+1),i={center:t.getCenter(),zoom:t.getZoom()};if(n&&n.zoom===i.zoom&&n.center[0]===i.center[0]&&n.center[1]===i.center[1])return;let a=[...r,i];a.length>10?a=a.slice(1):e.position=e.position===null?0:e.position+1,e.memory=a},forward(e,t){Ls(e,t,1)},backward(e,t){Ls(e,t,-1)}},zs={namespaced:!0,state:{...Fs},mutations:Rs,getters:Is},Bs={icon2d:`https://geodienste.hamburg.de/lgv-config/img/badge-2d.svg`,icon3d:`badge-3d`,supportedDevices:[`Desktop`,`Mobile`],supportedMapModes:[`2D`,`3D`]},Vs={...H(Bs)},Hs={...U(Bs)},Us={namespaced:!0,state:{...Bs},getters:Vs,mutations:Hs},Ws={icon:`bi-lock`,supportedDevices:[`Desktop`],supportedMapModes:[`2D`,`3D`]},Gs={...H(Ws)},Ks={...U(Ws)},qs={namespaced:!0,state:{...Ws},getters:Gs,mutations:Ks},Js={iconArrow:`arrows-fullscreen`,iconExit:`fullscreen-exit`,supportedDevices:[`Desktop`],supportedMapModes:[`2D`,`3D`],newTabFromFrame:!0},Ys={...H(Js)},Xs={...U(Js)},Zs={namespaced:!0,state:{...Js},getters:Ys,mutations:Xs},Qs={namespaced:!0,state:Ya,mutations:Xa,getters:{...H(Ya)}};function $s(e){return Math.PI/180*e}var ec={move2d({dispatch:e,getters:t,rootGetters:n},r){let i=t.moveDistance,a=n[`Maps/center`],o=null;switch(r.currentTarget.id){case`compass_north`:o=[a[0],a[1]+i];break;case`compass_south`:o=[a[0],a[1]-i];break;case`compass_east`:o=[a[0]+i,a[1]];break;case`compass_west`:o=[a[0]-i,a[1]];break;default:console.warn(`Rotation move2d event currentTarget id cannot be found! Move not possible.`);break}o!==null&&e(`Maps/setCenter`,o,{root:!0})},rotateClockwise({commit:e,getters:t}){let n;n=t.rotation<$s(0)&&t.rotation>-1*($s(t.rotationAngle)+.1)?0:t.rotation+$s(t.rotationAngle),e(`setRotation`,n),mapCollection.getMapView(`2D`).animate({rotation:n})},rotateCounterClockwise({commit:e,getters:t}){let n;n=t.rotation>$s(0)&&t.rotation<$s(t.rotationAngle)+.1?0:t.rotation-$s(t.rotationAngle),e(`setRotation`,n),mapCollection.getMapView(`2D`).animate({rotation:n})}},tc={compass2d:!1,compass3d:!0,moveDistance:1e3,resetRotationIcon:`bi-cursor`,rotateCounterClockwiseIcon:`bi-arrow-counterclockwise`,rotateClockwiseIcon:`bi-arrow-clockwise`,rotation:0,rotationAngle:22.5,rotationIcons:!0,showResetRotation:!0,showResetRotationAlways:!1,supportedDevices:[`Desktop`,`Mobile`],supportedMapModes:[`2D`,`3D`]},nc={...H(tc)},rc={...U(tc)},ic={namespaced:!0,state:{...tc},actions:ec,getters:nc,mutations:rc},ac={setConfiguredModuleStates({commit:e,dispatch:t,rootState:n},{menuModels:r,menuSide:i}){r.forEach(r=>{if(r?.type){let a=ra.upperFirst(r.type),o=n.Modules[a];(!o||o.menuSide!==i)&&(t(`extendModuleState`,{module:r,menuSide:i}),e(`addConfiguredModel`,{menuSide:i,state:n.Modules[a]}))}})},extendModuleState({rootState:e},{module:t,menuSide:n}){e.Modules[ra.upperFirst(t.type)]={...e.Modules[ra.upperFirst(t.type)],menuSide:n,...t}},onClick({commit:e,dispatch:t,rootGetters:n},{moduleState:r,menuSide:i}){n[`Menu/currentComponent`](i).type===r.type?(e(`Menu/switchToRoot`,i,{root:!0}),t(`Menu/resetCurrentMouseMapInteractionsComponent`,i,{root:!0})):(t(`Menu/changeCurrentComponent`,{type:r.type,side:i,props:{name:r.name}},{root:!0}),n[`Menu/expanded`](i)||t(`Menu/toggleMenu`,i,{root:!0}))}},oc={mainMenu:[],secondaryMenu:[],supportedDevices:[`Desktop`,`Mobile`,`Table`],supportedMapModes:[`2D`,`3D`],configuredModuleStates:[]},sc={...H(oc)},cc={...U(oc),addConfiguredModel:(e,t)=>
2{e.configuredModuleStates.push(t)}},lc={namespaced:!0,actions:ac,state:{...oc},getters:sc,mutations:cc},uc={tiltDownIcon:`bi-caret-down-square`,tiltUpIcon:`bi-caret-up-square`,supportedDevices:[`Desktop`],supportedMapModes:[`3D`]},dc={...H(uc)},fc={...U(uc)},pc={namespaced:!0,state:{...uc},getters:dc,mutations:fc},mc={icon:`skip-backward-fill`,supportedDevices:[`Desktop`],supportedMapModes:[`2D`,`3D`]},hc={...H(mc)},gc={...U(mc)},_c={namespaced:!0,state:{...mc},getters:hc,mutations:gc},vc={iconIn:`bi-plus-lg`,iconOut:`bi-dash-lg`,supportedDevices:[`Desktop`],supportedMapModes:[`2D`,`3D`]},yc={...H(vc)},bc={...U(vc)},xc={namespaced:!0,modules:{BackForward:zs,Button3d:Us,Freeze:qs,FullScreen:Zs,Orientation:Qs,Rotation:ic,StartModule:lc,TiltView:pc,TotalView:_c,Zoom:{namespaced:!0,state:{...vc},getters:yc,mutations:bc}},actions:va,getters:Ns,mutations:Ps,state:ya};function Sc(e,t){if(!(!Array.isArray(e)||!q(t)))return e.find(e=>{if(q(e))return Object.keys(t).every(n=>e[n]===t[n])})}y();var Cc={setMapAttributes({dispatch:e}){e(`registerMapListener`),e(`initTwoFingerPan`),e(`registerMapViewListener`),e(`setInitialAttributes`),e(`updateAttributesByMoveend`),e(`updateAttributesByChangeResolution`)},initTwoFingerPan({dispatch:e,rootGetters:t}){if(t.twoFingerPan){let t=document.getElementById(`map`);t.addEventListener(`touchmove`,t=>e(`oneFingerDragMessage`,t)),t.addEventListener(`touchend`,t=>e(`oneFingerDragMessageEnd`,t))}},registerMapListener({dispatch:e}){e(`registerListener`,{type:`change:size`,listener:`updateAttributesByChangeSize`,listenerType:`dispatch`}),e(`registerListener`,{type:`click`,listener:`updateAttributesByClick`,listenerType:`dispatch`}),e(`registerListener`,{type:`moveend`,listener:`updateAttributesByMoveend`,listenerType:`dispatch`}),e(`registerListener`,{type:`pointermove`,listener:`updateAttributesByPointer`,listenerType:`dispatch`})},unregisterMapListener({dispatch:e}){e(`unregisterListener`,{type:`click`,listener:`updateAttributesByClick`,listenerType:`dispatch`}),e(`unregisterListener`,{type:`pointermove`,listener:`updateAttributesByPointer`,listenerType:`dispatch`})},registerMapViewListener({dispatch:e}){mapCollection.getMapView(`2D`).on(`change:resolution`,()=>{e(`updateAttributesByChangeResolution`)})},registerCesiumListener({dispatch:e,rootGetters:t}){let r=mapCollection.getMap(`3D`),i=r.getCesiumScene(),a=new Cesium.ScreenSpaceEventHandler(i.canvas);t[`Modules/GetFeatureInfo/coloredHighlighting3D`]&&t[`Modules/GetFeatureInfo/coloredHighlighting3D`]?.enabled!==!1&&e(`Modules/GetFeatureInfo/highlight3DTile`,``,{root:!0}),_e.map.olcsMap.handle3DEvents({scene:i,map3D:r,callback:t=>e(`updateAttributesByClick`,n(t))}),a.setInputAction(t=>e(`updateAttributesByPointer`,t),Cesium.ScreenSpaceEventType.MOUSE_MOVE)},setInitialAttributes({commit:e}){let t=mapCollection.getMap(`2D`),n=mapCollection.getMapView(`2D`);e(`setInitialCenter`,n.getCenter()),e(`setInitialRotation`,n.getRotation()),e(`setInitialZoom`,n.getZoom()),e(`setMode`,t.mode),e(`setProjection`,n.getProjection()),e(`setResolutions`,n.getResolutions()),e(`setScales`,n.get(`options`).map(e=>e.scale)),e(`setSize`,t.getSize())},updateAttributesByChangeSize({commit:e}){e(`setSize`,mapCollection.getMap(`2D`).getSize())},updateAttributesByClick({getters:e,commit:t},n){e.mode===`2D`?(t(`setClickCoordinate`,n.coordinate),t(`setClickPixel`,n.pixel)):e.mode===`3D`&&n&&(n.pickedPosition&&t(`setClickCoordinate`,n.pickedPosition),n.position?.x&&n.position?.y&&t(`setClickPixel`,[n.position.x,n.position.y]))},updateAttributesByMoveend({commit:e}){let t=mapCollection.getMap(`2D`),n=mapCollection.getMapView(`2D`),r=n.getCenter(),i=n.calculateExtent(t.getSize());e(`setCenter`,r),e(`setExtent`,i),this.$app.config.globalProperties.$remoteInterface?.sendMessage({centerPosition:r}),this.$app.config.globalProperties.$remoteInterface?.sendMessage({currentExtent:i})},updateAttributesByPointer({commit:e,getters:t},n){if(t.mode===`2D`)e(`setMouseCoordinate`,n.coordinate);else if(t.mode===`3D`)try{let r=mapCollection.getMap(`3D`).getCesiumScene(),i=r.pickPosition(n.endPosition),a=r.globe.ellipsoid.cartesianToCartographic(i),o=Zt([Cesium.Math.toDegrees(a.longitude),Cesium.Math.toDegrees(a.latitude)],Mt(`EPSG:4326`),t.projection);o.push(a.height),e(`setMouseCoordinate`,o)}catch{}},updateAttributesByChangeResolution({commit:e}){let t=mapCollection.getMapView(`2D`),n=Sc(t.get(`options`),{resolution:t.getConstrainedResolution(t.getResolution())});
2e(`setMaxZoom`,t.getMaxZoom()),e(`setMinZoom`,t.getMinZoom()),e(`setResolution`,t.getResolution()),e(`setScale`,n?.scale),e(`setZoom`,t.getZoom()),this.$app.config.globalProperties.$remoteInterface?.sendMessage({zoomLevel:t.getZoom()})},oneFingerDragMessage({commit:e,dispatch:t,getters:n},r){r&&(r&&r.targetTouches.length===1&&!n.twoFingerPanStart?t(`Alerting/addSingleAlert`,i18next.t(`common:core.maps.mapRegion.twoFingerPanAlert`),{root:!0}):r.targetTouches.length===2&&e(`setTwoFingerPanStart`,!0))},oneFingerDragMessageEnd({commit:e,dispatch:t},n){if(!n)return;n.targetTouches?.length===0&&e(`setTwoFingerPanStart`,!1);let r=document.getElementById(`map`);r.removeEventListener(`touchmove`,t(`oneFingerDragMessage`)),r.removeEventListener(`touchend`,t(`oneFingerDragMessageEnd`))}},wc={featureLabel:``,coordLabel:``,typeLabel:``};function Tc(e,t,n=4326){let r={type:`FeatureCollection`,crs:{type:`link`,properties:{href:`http://spatialreference.org/ref/epsg/`+n+`/proj4/`,type:`proj4`}},features:[]},i,a,o=!1;return e.forEach(e=>{if(i=n===4326?e.coordinates:j.transform(`EPSG:`+n,`EPSG:4326`,e.coordinates),!i||!Array.isArray(i)||i.length===0||!e.label){o=!0;return}a={type:`Feature`,geometry:{type:t,coordinates:i},properties:{featureLabel:e.label,coordLabel:i,typeLabel:t}},r.features.push(a)}),o&&console.warn(i18next.t(`common:core.maps.featureViaURL.messages.featureParsing`)),r}function Ec(e){let t=[],n=mapCollection.getMap(`2D`).getLayers().getArray().find(t=>t.get(`id`)===e);return n===void 0?(console.warn(i18next.t(`common:core.maps.featureViaURL.messages.layerNotFound`,{layerId:e})),t):(n.getSource().getFeatures().forEach(e=>{t.push(e.getId())}),t)}var Dc={featureViaUrl({dispatch:e,rootGetters:t},n){let{layers:r,epsg:i,zoomTo:a}=t.featureViaURL,o,s;
2r&&n.forEach(t=>{let n=t.layerId,c=t.features,l=r?.findIndex(e=>e.id===n);if(l===-1){console.error(i18next.t(`common:core.maps.featureViaURL.messages.layerNotFound`,{layerId:n}));return}if(!r[l].name){console.error(i18next.t(`common:core.maps.featureViaURL.messages.noNameDefined`,{layerId:n}));return}if(s=t.type===void 0?r[l].geometryType:t.type,s!==`LineString`&&s!==`Point`&&s!==`Polygon`&&s!==`MultiPoint`&&s!==`MultiLineString`&&s!==`MultiPolygon`){console.error(i18next.t(`common:core.maps.featureViaURL.messages.geometryNotSupported`),{layerId:n,geometryType:s});return}if(!c||!Array.isArray(c)||c.length===0){e(`Alerting/addSingleAlert`,{content:i18next.t(`common:core.maps.featureViaURL.messages.featureParsingAll`),multipleAlert:!0},{root:!0});return}o=Tc(c,s,i),o.features.length===0&&e(`Alerting/addSingleAlert`,{content:i18next.t(`common:core.maps.featureViaURL.messages.featureParsingNoneAdded`),multipleAlert:!0},{root:!0}),e(`createVectorLayer`,{layers:r,pos:l,geoJSON:o}).then(()=>{a!==void 0&&(a===n||a.indexOf(n)!==-1)&&e(`zoomToFilteredFeatures`,{ids:Ec(n),layerId:n})})})},createVectorLayer({dispatch:e},{layers:t,pos:n,geoJSON:r}){return e(`addLayerToLayerConfig`,{layerConfig:{gfiAttributes:t[n].gfiAttributes||wc,geojson:r,id:t[n].id,name:t[n].name,showInLayerTree:!0,styleId:t[n].styleId,typ:`GEOJSON`,type:`layer`,visibility:!0},parentKey:er},{root:!0})}};function Oc(e){let t=[9999999,9999999,0,0];return e.forEach(e=>{let n=e?.getGeometry()?.getExtent()||[];t[0]=n[0]<t[0]?n[0]:t[0],t[1]=n[1]<t[1]?n[1]:t[1],t[2]=n[2]>t[2]?n[2]:t[2],t[3]=n[3]>t[3]?n[3]:t[3]}),t}var kc={decreaseZoom({dispatch:e}){e(`setZoom`,mapCollection.getMapView(`2D`).getZoom()-1)},increaseZoom({dispatch:e}){e(`setZoom`,mapCollection.getMapView(`2D`).getZoom()+1)},setZoom(e,t){let n=mapCollection.getMapView(`2D`);t<=n.getMaxZoom()&&t>=n.getMinZoom()&&n.setZoom(t)},zoomToCoordinates({dispatch:e},{center:t,zoom:n,rotation:r}){Array.isArray(t)&&e(`setCenter`,t),r!==void 0&&mapCollection.getMapView(`2D`).setRotation(r),n!==void 0&&e(`setZoom`,n)},zoomToExtent(e,{extent:t,options:n}){mapCollection.getMapView(`2D`).fit(t,{size:mapCollection.getMap(`2D`).getSize(),...Object.assign({duration:800},n)})},zoomToFilteredFeatures({getters:e,dispatch:t},{ids:n,layerId:r,zoomOptions:i}){let a=e.getLayerById(r),o=a?.getSource();if(a?.getSource()){let e=o instanceof Re?o.getSource():o,r=e.getFeatures().filter(e=>n.indexOf(e.getId())>-1),a=Oc(r);r.length>0?t(`zoomToExtent`,{extent:a,options:i}):o.once(`featuresloadend`,()=>{r=e.getFeatures().filter(e=>n.indexOf(e.getId())>-1),r.length>0&&(a=Oc(r),t(`zoomToExtent`,{extent:a,options:i}))})}},zoomToProjExtent({dispatch:e,getters:t},n){if(Object.values(n).every(e=>e!==void 0)){let r=n.projection,i=n.extent.map(e=>parseFloat(e));if(r!==t[`Maps/projectionCode`]){let e=mapCollection.getMap(`2D`),t=i.slice(0,2),r=i.slice(2,4),a=j.transformToMapProjection(e,n.projection,t),o=j.transformToMapProjection(e,n.projection,r);i=a.concat(o)}e(`zoomToExtent`,{extent:i,options:n.options})}}};y();var Ac={},jc={...kc,addInteraction(e,t){mapCollection.getMap(`2D`).addInteraction(k(t))},registerListener({commit:e,dispatch:t},{type:n,listener:r,listenerType:i=`function`,root:a=!1,keyForBoundFunctions:o}){let s=o||String(r);s===`function () { [native code] }`&&console.warn(`Wrong use of 'registerListener' at map for listenerType = 'function', which uses .bind(this): provide 'keyForBoundFunctions'!`),Ac[n]=Ac[n]||{},Ac[n][i]=Ac[n][i]||{},Ac[n][i][s]=n=>{i===`function`?r(n):i===`dispatch`?t(r,n,{root:a}):i===`commit`&&e(r,n,{root:a})},mapCollection.getMap(`2D`).on(n,Ac[n][i][s])},removeInteraction(e,t){let n=mapCollection.getMap(`2D`);if(t&&n.removeInteraction(t)===void 0){let e=n.getInteractions().getArray(),r=e.findIndex(e=>e.ol_uid===t.ol_uid);r>-1?n.getInteractions().removeAt(r):typeof e===Array&&console.warn(`interaction cannot be removed from map:`,t)}},resetView({state:e}){let t=mapCollection.getMapView(`2D`);t.setCenter(e.initialCenter),t.setRotation(e.initialRotation),t.setZoom(e.initialZoom)},setCamera({rootGetters:e},t){mapCollection.getMap(`3D`)?_e.map.olcsMap.setCameraParameter(t,mapCollection.getMap(`3D`),Cesium):(e.map3dParameter||={},e.map3dParameter.camera=t)},flyTo3DCoordinates({rootGetters:e},{altitude:t,heading:n,tilt:r,center:i}){let a=mapCollection.getMap(`3D`).scene_.camera;try{let[o,s]=O(e[`Maps/projection`].getCode(),`EPSG:4326`,[i[0],i[1]]);if(isNaN(o)||isNaN(s)){console.warn(`Transformation of coordinates failed:`,i);return}a.flyTo({destination:Cesium.Cartesian3.fromDegrees(o,s,t),orientation:{heading:Cesium.Math.toRadians(n),pitch:Cesium.Math.toRadians(r),roll:0},duration:2})}catch(e){console.error(`Error transforming coordinates or flying to de
2stination in 3D mode:`,e)}},setCenter({commit:e},t){let n=mapCollection.getMapView(`2D`),r=[t[0],t[1]];r.some(e=>typeof e!=`number`)&&(r=r.map(e=>parseInt(e,10))),Array.isArray(r)&&r.length===2?(e(`setCenter`,t),n.setCenter(t)):console.warn(`Center was not set. Probably there is a data type error. The format of the coordinate must be an array with two numbers.`)},unregisterListener(e,{type:t,listener:n,listenerType:r=`function`,keyForBoundFunctions:i}){if(typeof t==`string`){let e=i||String(n);Ac[t]&&Ac[t][r]&&Ac[t][r][e]&&(mapCollection.getMap(`2D`).un(t,Ac[t][r][e]),Ac[t][r][e]=null)}else f(t)},activateViewpoint({dispatch:e,getters:t},{layerIds:n,altitude:r,heading:i,tilt:a,center:o,zoom:s}){if(Array.isArray(n)&&n.length>0&&n.forEach(t=>{e(`addLayerIfNotPresent`,{layerId:t})}),!Array.isArray(o)||o.length!==2||isNaN(o[0])||isNaN(o[1])){console.warn(`Invalid center coordinates provided:`,o);return}t.mode===`2D`?e(`Maps/zoomToCoordinates`,{center:o,zoom:s},{root:!0}):t.mode===`3D`&&e(`flyTo3DCoordinates`,{altitude:r,heading:i,tilt:a,center:o})},addLayerIfNotPresent({dispatch:e,getters:t,rootGetters:n},{layerId:r}){let i=t.getLayerById(r),a=n.layerConfigById(r),o=jt.getLayerWhere({id:r});if(!a&&!o){e(`Alerting/addSingleAlert`,{category:`warning`,content:i18next.t(`common:core.layers.errorHandling.wrongLayerId`,{layerId:r})},{root:!0});return}i?a.visibility||e(`replaceByIdInLayerConfig`,{layerId:r,layer:{showInLayerTree:!0,visibility:!0}},{root:!0}):a?e(`addOrReplaceLayer`,{layerId:r},{root:!0}):o&&e(`addLayerToLayerConfig`,{layerConfig:{...o,showInLayerTree:!0,visibility:!0},parentKey:er},{root:!0})}},Mc={addLayer(e,t){let n=mapCollection.getMap(`2D`);n.getLayers().getArray().includes(t)?console.warn(`The layer with Id: ${t.get(`id`)} was not added to the map, because the layer already exists!`):(t.get(`alwaysOnTop`)&&t.setZIndex(_r.alwaysOnTop),n.addLayer(t))},async addNewLayerIfNotExists(e,{layerName:t,alwaysOnTop:n=!0}){let r=$.getters[`Maps/getLayerByName`](t);if(!r){r=new Rt({id:t,name:t,source:new Pe,alwaysOnTop:n,zIndex:n===!0?_r.alwaysOnTop:void 0});let e=mapCollection.getMap(`2D`);e.getLayers().getArray().includes(r)?console.warn(`The layer with Id: ${r.get(`id`)} was not added to the map, because the layer already exists!`):e.addLayer(r)}return r},async areLayerFeaturesLoaded(e,t){let n=mapCollection.getMap(`2D`).getLayers().getArray().find(e=>e.get(`id`)===t);await new Promise(e=>{if(n instanceof Rt){let t=n.getSource();n.getSource()instanceof Re&&(t=t.getSource()),t.getFeatures().length>0?e():t.once(`featuresloadend`,()=>{e()})}})},checkLayer(e,t){return!!mapCollection.getMap(`2D`).getLayers().getArray().includes(t)}},Nc={changeMapMode({getters:e,dispatch:t},n){e.mode!==n&&(n===`2D`?(t(`registerMapListener`),t(`activateMap2d`)):n===`3D`&&(t(`unregisterMapListener`),t(`activateMap3d`)))},activateMap2d({commit:e}){mapCollection.getMap(`3D`)?.setEnabled(!1),e(`setMode`,`2D`)},activateMap3d({commit:e,dispatch:t,rootState:n}){let r=mapCollection.getMap(`3D`);t(`checkInitial3dCenterPositionChange`),r?(r.setEnabled(!0),e(`setMode`,`3D`)):n.portalConfig.map.startingMapMode=`3D`},checkInitial3dCenterPositionChange({commit:e,dispatch:t,rootGetters:n}){let r=n.map3dParameter.camera?n.map3dParameter.camera.offset:!1,i=n[`Maps/initialCenter`],a=n[`Maps/initialZoom`],o=n[`Maps/center`],s=n[`Maps/zoom`];if(r&&(i[0]!==o[0]||i[1]!==o[1]||a!==s)&&n.map3dParameter.camera.positionInitiallyUsed===void 0){let[i,a]=O(n[`Maps/projection`].getCode(),`EPSG:4326`,[o[0],o[1]]),s=n.map3dParameter.camera.cameraPosition,c=parseFloat(r);isNaN(c)&&(console.warn(`map3dParameter.camera.offset must be a number! Using offset 0. Please correct your config.json.`),c=0),e(`useCameraPosition`,[i,a+c,s[2]],{root:!0}),t(`Maps/setCamera`,n.map3dParameter,{root:!0})}}};function Pc(e={}){$.dispatch(`Maps/addLayer`,Fc(`POINT`,e.pointStyleId)),$.dispatch(`Maps/addLayer`,Fc(`POLYGON`,e.polygonStyleId))}function Fc(e,t){return Ic(e)(t)}function Ic(e){return{POINT:Lc,POLYGON:Rc}[e]}function Lc(e=`defaultMapMarkerPoint`){return new Rt({altitudeMode:`absolute`,alwaysOnTop:!0,id:`marker_point_layer`,name:`markerPoint`,source:new Pe,styleId:e,visible:!0})}function Rc(e=`defaultMapMarkerPolygon`){return new Rt({altitudeMode:`relativeToGround`,alwaysOnTop:!0,id:`marker_polygon_layer`,name:`markerPolygon`,source:new Pe,styleId:e,visible:!0})}function zc(e,t){if(Hc(e)!==void 0){let n=Hc(e),r=n.get(`styleId`),i=Ft.returnStyleObject(r),a=Jt.createStyle(i,t,!1,Config.wfsImgPath);t.setStyle(a),n.getSource().addFeature(t)}}function Bc(e){let t=Hc(e);
2t.getSource().getFeatures().forEach(e=>{e.setStyle()}),t.getSource().clear()}function Vc(e,t){let n=Hc(e).getSource();n.getFeatures().forEach(e=>{let r=e.getGeometry().getCoordinates()[0].toString().slice(0,12),i=e.getGeometry().getCoordinates()[1].toString().slice(0,12);r===t[0].toString().slice(0,12)&&i===t[1].toString().slice(0,12)&&n.removeFeature(e)})}function Hc(e){return mapCollection.getMap(`2D`)?.getLayers().getArray()?.find(t=>t.get(`id`)===e)}var Uc={initializeMapMarkers:Pc,createMapMarker:Fc,addFeatureToMapMarkerLayer:zc,removeMapMarker:Bc,removeFeatureByCoord:Vc,getMapmarkerLayerById:Hc},Wc={changeMarkerStyle(e,{markerId:t,styleId:n}){Uc.getMapmarkerLayerById(t)?.set(`styleId`,n||`defaultMapMarkerPoint`)},placingPointMarker({commit:e,dispatch:t,rootGetters:n},i){let a=Array.isArray(i)?i:i?.coordinates;if(i?.keepPreviousMarker||t(`removePointMarker`),a){let o=new V({geometry:new r(a)});n[`Menu/currentComponent`](`mainMenu`).type!==`searchBar`&&n[`Modules/SearchBar/searchInput`]!==``&&(e(`Modules/SearchBar/setSearchInput`,``,{root:!0}),e(`Modules/SearchBar/setCurrentSearchInputValue`,``,{root:!0})),Uc.addFeatureToMapMarkerLayer(`marker_point_layer`,o),i.rotation&&t(`rotatePointMarker`,{feature:o,position:i}),e(`setCurrentMarker`,a)}},removePointMarker({commit:e}){Uc.removeMapMarker(`marker_point_layer`),e(`setCurrentMarker`)},removePointMarkerFeature(e,t){Uc.removeFeatureByCoord(`marker_point_layer`,t)},placingPolygonMarker({dispatch:e},t){let n;n=t instanceof V?t:new V({geometry:t}),e(`removePolygonMarker`),Uc.addFeatureToMapMarkerLayer(`marker_polygon_layer`,n)},removePolygonMarker(){Uc.removeMapMarker(`marker_polygon_layer`)},rotatePointMarker({dispatch:e,state:t},{feature:n,position:r}){n.getStyle()?.getImage()?.setRotation(r.rotation*Math.PI/180),t.mode===`3D`&&e(`rotatePointMarkerIn3D`,r)},rotatePointMarkerIn3D({rootGetters:e},t){let n=e[`Maps/clickPixel`],r=t.rotation,i;n&&mapCollection.getMap(`3D`).getCesiumScene().drillPick({x:n[0],y:n[1]}
2,100,200,200).forEach(e=>{if(e?.primitive?.olLayer?.get(`id`)===`marker_point_layer`){switch(r){case 0:i={x:(e.primitive.olFeature.getStyle().getImage().getAnchor()[0]*e.primitive.scale-(e.primitive.width-e.primitive.olFeature.getStyle().getImage().getAnchor()[0])*e.primitive.scale)/2,y:-(e.primitive.olFeature.getStyle().getImage().getAnchor()[1]*e.primitive.scale-(e.primitive.height-e.primitive.olFeature.getStyle().getImage().getAnchor()[1])*e.primitive.scale)/2};break;case 90:i={x:(e.primitive.olFeature.getStyle().getImage().getAnchor()[1]*e.primitive.scale-(e.primitive.height-e.primitive.olFeature.getStyle().getImage().getAnchor()[1])*e.primitive.scale)/2,y:(e.primitive.olFeature.getStyle().getImage().getAnchor()[0]*e.primitive.scale-(e.primitive.width-e.primitive.olFeature.getStyle().getImage().getAnchor()[0])*e.primitive.scale)/2};break;case 180:i={x:(e.primitive.olFeature.getStyle().getImage().getAnchor()[0]*e.primitive.scale-(e.primitive.width-e.primitive.olFeature.getStyle().getImage().getAnchor()[0])*e.primitive.scale)/2,y:(e.primitive.olFeature.getStyle().getImage().getAnchor()[1]*e.primitive.scale-(e.primitive.height-e.primitive.olFeature.getStyle().getImage().getAnchor()[1])*e.primitive.scale)/2};break;case 270:i={x:-(e.primitive.olFeature.getStyle().getImage().getAnchor()[1]*e.primitive.scale-(e.primitive.height-e.primitive.olFeature.getStyle().getImage().getAnchor()[1])*e.primitive.scale)/2,y:(e.primitive.olFeature.getStyle().getImage().getAnchor()[0]*e.primitive.scale-(e.primitive.width-e.primitive.olFeature.getStyle().getImage().getAnchor()[0])*e.primitive.scale)/2};break;default:break}e.primitive.pixelOffset=i,e.primitive.rotation=-r*Math.PI/180}})}};function Gc(e){return[e[0]+(e[2]-e[0])/2,e[1]+(e[3]-e[1])/2]}function Kc(e){return/(?:(?:https?|ftp|file):\/\/|www\.|ftp\.)(?:\([-A-Z0-9+&@#/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#/%=~_|$?!:,.])*(?:\([-A-Z0-9+&@#/%=~_|$?!:,.]*\)|[A-Z0-9+&@#/%=~_|$])/i.test(e)||/[^/]+(?:\.html)$/i.test(e)}function qc(e){return new RegExp(/^(https?:\/\/|s?ftp:\/\/|file:\/\/|\/\/)/i).test(e)}function Jc(e){return new RegExp(/\.(jpe?g|a?png|gif|webp|bmp|svg)$/i).test(e?.split?.(`?`)?.[0])}function Yc(e){return e.replace(/((?:(?:https?|ftp|file):\/\/|www\.|ftp\.)(?:\([-A-ZÃÃÃ0-9+&@#/%=~_|$?!:,.]*\)|[-A-ZÃÃÃ0-9+&@#/%=~_|$?!:,.])*(?:\([-A-ZÃÃÃ0-9+&@#/%=~_|$?!:,.]*\)|[A-ZÃÃÃ0-9+&@#/%=~_|$]))/gi,`<a href="$1" target="_new">$1</a>`)}function Xc(e,t,n=!0){return e.map((e,t)=>n?new V({geometry:new r(Gc(e.getGeometry().getExtent())),name:`featureIcon${t}`}):(e.set(`name`,`featureIcon${t}`),e)).map(e=>{let n;if(Kc(t))n=new T({image:new xe({crossOrigin:`anonymous`,anchor:[.5,24],anchorXUnits:`fraction`,anchorYUnits:`pixels`,src:t,scale:2})});else{let r=Ft.returnStyleObject(t);n=r===void 0?new T:Jt.createStyle(r,e,!1,Config.wfsImgPath)}return e.setStyle(n),e})}function Zc(e){return String(e).replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`).replace(/[^\x00-\x7F]/g,e=>`&#x${e.codePointAt(0).toString(16)};`)}function Qc(e,t){if(typeof e!=`object`||!e||!Object.prototype.hasOwnProperty.call(e,`status`)||!Object.prototype.hasOwnProperty.call(e,`statusText`)||!Object.prototype.hasOwnProperty.call(e,`data`))throw console.warn(`${t}, handleAxiosResponse:`,e),Error(`${t}, handleAxiosResponse: The received response is not valid.`);if(e.status!==200){let n=`${t}
2, handleAxiosResponse: ${e.status===418?`The server refuses to brew coffee because it is, permanently, a teapot.`:`The received status code indicates an error.`}`;throw console.warn(`${t}, handleAxiosResponse:`,e),Error(n)}else if(typeof e.data===String&&e.data&&e.data.includes(`RequestNotAllowed`)&&t.includes(`requestGfi`)){let e=`${t}, handleAxiosResponse: The request is not allowed`;throw Error(e)}return e.data}async function $c(e,t,n,r={}){let i=jt.getLayerWhere({id:e}),a=tl(i?.featureNS,i?.featurePrefix,i?.version,t,n);return i===null?new Promise((t,n)=>n(`The layer with the id ${e} could not be found.`)):i.typ?.toUpperCase()===`GEOJSON`?B.get(i.url).then(e=>Qc(e,`utils/zoomTo/actionsZoomTo/zoomToFeatures`)).then(e=>new dn().readFeatures(e,{featureProjection:r.featureProjection})).then(e=>e.filter(e=>e.getKeys().includes(t)?n.includes(e.get(t).toUpperCase().trim()):!1)):B.get(el(i.url,i.version,i.featureType,a)).then(e=>Qc(e,`utils/zoomTo/actionsZoomTo/zoomToFeatures`)).then(e=>new Ne({version:i.version}).readFeatures(e)).then(e=>e.filter(e=>e.getKeys().includes(t)?n.includes(e.get(t).toUpperCase().trim()):!1))}function el(e,t,n,r){let i=new URL(e);return i.searchParams.set(`service`,`WFS`),i.searchParams.set(`version`,t),i.searchParams.set(`typeName`,n),i.searchParams.set(`request`,`GetFeature`),r!==null&&i.searchParams.set(`filter`,r),i}function tl(e,t,n,r,i){let a=t||`app`,o=e?a+`:`:``,s=e?` xmlns:`+a+`="`+e+`">`:`>`,c=`</Literal></PropertyIsEqualTo>`,l,u=``,d=``,f=``;return!r||r===``?null:(n&&n.startsWith(`1.`)?(u=`<PropertyIsEqualTo matchCase="false"><PropertyName>`+o+r+`</PropertyName><Literal>`,l=`<Filter xmlns="http://www.opengis.net/ogc"`):(u=`<PropertyIsEqualTo matchCase="false"><ValueReference>`+o+r+`</ValueReference><Literal>`,l=`<Filter xmlns="http://www.opengis.net/fes/2.0"`),i.forEach(e=>{let t=Zc(e);d+=u+t+c}),f=i.length>1?`<Or>`+d+`</Or>`:i.length===1?d:u+c,l+=s+f+`</Filter>`,l)}var nl={createUrl:el,createFilter:tl,getAndFilterFeatures:$c},rl={zoomToFeatures({dispatch:e,rootGetters:t},n){let r=t.zoomTo,i=!0,a=!0,o,s=``,c,l,u;return r?(s=r.map(s=>{let{id:d}=s,f=n[d.toUpperCase()];if(f)d===`zoomToFeatureId`?(a=s.centerOfExtent!==!1&&a,f=(Array.isArray(f)?f:f.split(`,`)).map(e=>String(e)),u=s.styleId):d===`zoomToGeometry`&&(f=f.split(`,`).map(e=>e.toUpperCase().trim()),o=s.allowedValues?.map(e=>String(e)),f.length===1&&o!==void 0&&!o.includes(f[0])&&parseInt(f[0],10)<o.length&&parseInt(f[0],10)>0&&(f[0]=o[parseInt(f[0],10)-1]));else return new Promise(e=>e([]));return c=s.layerId,l=s.property,Object.prototype.hasOwnProperty.call(s,`addFeatures`)&&(i=r.addFeatures),nl.getAndFilterFeatures(c,l,f,{featureProjection:t[`Maps/projection`]}).then(t=>{let n=t;return o!==void 0&&(n=n.filter(e=>o.includes(e.get(l).toUpperCase().trim()))),u&&(n=Xc(n,u,a)),i&&n.length>0&&e(`Maps/addLayer`,new Rt({source:new Pe({features:n}),alwaysOnTop:!0}),{root:!0}),new Promise(e=>e(n))})}),Promise.allSettled(s).then(t=>{let n=t.map(t=>t.status===`fulfilled`?t.value:(e(`Alerting/addSingleAlert`,t.reason,{root:!0}),[])).flat(1);return n.length>0?e(`Maps/zoomToExtent`,{extent:Oc(n)},{root:!0}):console.warn(`zoomTo: No features were found for the given layer.`)}).catch(e=>{console.error(`zoomTo: An error occurred while trying to fetch features from one of the given services.`,e)})):!1}};y();var il={highlightFeature({dispatch:e},t){switch(t.type){case`increase`:e(`increaseFeature`,t);break;case`viaLayerIdAndFeatureId`:e(`highlightViaParametricUrl`,t.layerIdAndFeatureId);break;case`highlightMultiPoint`:case`highlightPoint`:e(`highlightPointTypes`,t);break;case`highlightPolygon`:case`highlightMultiPolygon`:e(`highlightPolygonTypes`,t);break;case`highlightLine`:case`highlightMultiLine`:e(`highlightLineTypes`,t);break;default:console.warn(`Unrecognized highlight type: ${t.type}`);break}},async highlightPointTypes({commit:e,dispatch:t},n){if(n.highlightStyle){let r=n.highlightStyle,i=n.feature,a=await t(`fetchAndApplyStyle`,{highlightObject:n,feature:i,returnFirst:i.getGeometry().getType()!==`MultiPoint`})||void 0;if(a)if(e(`Maps/addHighlightedFeature`,i,{root:!0}),e(`Maps/addHighlightedFeatureStyle`,i.getStyle(),{root:!0}),Array.isArray(a)){let e=a.map(e=>{let t=e.clone();return al(t,r),t});i.setStyle(e)}else{let e=a.clone();al(e,r),i.setStyle(e)}else n.layer.id===`importDrawLayer`&&t(`setHighlightStyleToFeature`,{feature:i,
2clonedStyle:typeof i.getStyle()==`object`?i.getStyle()?.clone():void 0,newStyle:r})}else t(`Maps/placingPolygonMarker`,n.feature,{root:!0})},async highlightPolygonTypes({commit:e,dispatch:t},n){if(n.highlightStyle&&Object.keys(n.highlightStyle).length){let r=n.highlightStyle,i=n.feature,a=await t(`fetchAndApplyStyle`,{highlightObject:n,feature:i,returnFirst:i.getGeometry().getType()!==`MultiPolygon`})||void 0;if(a)if(e(`Maps/addHighlightedFeature`,i,{root:!0}),e(`Maps/addHighlightedFeatureStyle`,i.getStyle(),{root:!0}),Array.isArray(a)){let e=a.map(e=>{let t=e.clone();return al(t,r),t});i.setStyle(e)}else{let e=a.clone();al(e,r),i.setStyle(e)}else n.layer.id===`importDrawLayer`&&t(`setHighlightStyleToFeature`,{feature:i,clonedStyle:typeof i.getStyle()==`object`?i.getStyle()?.clone():void 0,newStyle:r})}else t(`Maps/placingPolygonMarker`,n.feature,{root:!0})},async highlightLineTypes({commit:e,dispatch:t},n){if(n.highlightStyle){let r=n.highlightStyle,i=n.feature,a=await t(`fetchAndApplyStyle`,{highlightObject:n,feature:i,returnFirst:i.getGeometry().getType()!==`MultiLineString`})||void 0;if(a)if(e(`Maps/addHighlightedFeature`,i,{root:!0}),e(`Maps/addHighlightedFeatureStyle`,i.getStyle(),{root:!0}),Array.isArray(a)){let e=a.map(e=>{let t=e.clone();return al(t,r),t});i.setStyle(e)}else{let e=a.clone();al(e,r),i.setStyle(e)}else n.layer.id===`importDrawLayer`&&t(`setHighlightStyleToFeature`,{feature:i,clonedStyle:typeof i.getStyle()==`object`?i.getStyle()?.clone():void 0,newStyle:r})}else t(`Maps/placingPolygonMarker`,n.feature,{root:!0})},async highlightViaParametricUrl({dispatch:e},t){if(t){let n=await e(`getHighlightFeature`,{layerId:t[0],featureId:t[1]});n&&e(`Maps/placingPolygonMarker`,n,{root:!0})}},async increaseFeature({commit:e,dispatch:t},n){let r=n.scale?n.scale:1.5,i={layerId:n.layer?.id,featureId:n.id},a=await t(`fetchAndApplyStyle`,{highlightObject:n,feature:n.feature}),o=n.feature,s=a?a.clone():null,c=null;if(o||=await t(`getHighlightFeature`,i),!o){console.warn(`Feature not found for layerId: ${i.layerId} and featureId: ${i.featureId}`);return}s||=typeof o.getStyle()?.clone==`function`?o.getStyle()?.clone():{...o.getStyle()},c=s&&typeof s.getImage==`function`?s.getImage():void 0,c&&(e(`Maps/addHighlightedFeature`,o,{root:!0}),e(`Maps/addHighlightedFeatureStyle`,o.getStyle(),{root:!0}),s.getText()&&s.getText().setScale(r),c.setScale(c.getScale()*r),n?.highlightStyle?.fill&&n?.highlightStyle?.fill?.color&&typeof c.getFill==`function`&&c.getFill().setColor(n.highlightStyle.fill.color),o.setStyle(s))},async getHighlightFeature(e,{layerId:t,featureId:n}){let r=null;await xn();let i=W.getLayerById(t)?.layerSource;return i&&(i.getFeatures().length>0?r=i.getFeatureById(n)||i.getFeatures().find(e=>e.get(`features`)?.find(e=>e.getId()===n)):await new Promise(e=>{i.once(`featuresloadend`,()=>{r=i.getFeatureById(n)||i.getFeatures().find(e=>e.get(`features`)?.find(e=>e.getId()===n)),e()})})),r},async fetchAndApplyStyle(e,{highlightObject:t,feature:n,returnFirst:r=!0}){let i=t.styleId||t.layer.id,a=Ft.returnStyleObject(i),o;return a?(o=Jt.createStyle(a,n,!1,Config.wfsImgPath),r&&Array.isArray(o)&&o.length>0&&(o=o[0]),o):(console.warn(`Style not found for styleId: ${i}`),null)},async setHighlightStyleToFeature({commit:e},{feature:t,clonedStyle:n,newStyle:r}){e(`Maps/addHighlightedFeature`,t,{root:!0}),e(`Maps/addHighlightedFeatureStyle`,t.getStyle(),{root:!0}),n&&(al(n,r),t.setStyle(n))}};function al(e,t){t.fill?.color&&e.getFill().setColor(t.fill.color),t.stroke?.width&&e.getStroke().setWidth(t.stroke.width),t.stroke?.color&&e.getStroke().setColor(t.stroke.color),t.stroke?.width&&e.getStroke().setWidth(t.stroke.width),t.stroke?.color&&e.getStroke().setColor(t.stroke.color)}var ol=t({removeHighlightFeature:()=>sl});async function sl({commit:e,state:t,dispatch:n},r){if(r&&r instanceof V){let i=t.highlightedFeatures.indexOf(r);if(i!==-1){let n=t.highlightedFeatureStyles[i];t.highlightedFeatures[i].setStyle(n),e(`setHighlightedFeatureStyles`,t.highlightedFeatureStyles.filter((e,t)=>t!==i)),e(`setHighlightedFeatures`,t.highlightedFeatures.filter((e,t)=>
2t!==i))}else switch(r.getGeometry()?.getType()){case`Point`:n(`removePointMarker`);break;case`Polygon`:case`MultiPolygon`:case`LineString`:n(`removePolygonMarker`);break;default:break}}else t.highlightedFeatureStyles?.forEach((e,n)=>{t.highlightedFeatures[n].setStyle(e)}),e(`setHighlightedFeatureStyles`,[]),e(`setHighlightedFeatures`,[])}var cl={...Cc,...Dc,...jc,...Mc,...Nc,...Wc,...rl,...il,...ol},ll={center:null,clickCoordinate:null,clickPixel:null,extent:null,highlightedFeatures:[],highlightedFeatureStyles:[],initialCenter:null,initialRotation:null,initialZoom:null,maxZoom:null,minZoom:null,mode:`2D`,mouseCoordinate:null,projection:null,resolution:null,resolutions:null,rotation:null,scale:null,scales:null,size:null,twoFingerPanStart:!1,zoom:null,currentMarker:null},ul={namespaced:!0,actions:cl,getters:{...H(ll),getLayerById:()=>e=>mapCollection.getMap(`2D`).getLayers().getArray().find(t=>t.get(`id`)===e),getLayerByName:()=>e=>mapCollection.getMap(`2D`).getLayers().getArray().find(t=>t.get(`name`)===e),getResolutionByScale:e=>(t,n)=>{let r=e.scales,i=``,a=r.concat([parseInt(t,10)].filter(e=>r.indexOf(e)<0));return a=a.sort((e,t)=>t-e),i=a.indexOf(parseInt(t,10)),a.length===r.length||n===`max`?e.resolutions[i]:n===`min`?e.resolutions[i-1]:null},isMaxZoomDisplayed:e=>e.zoom>=e.maxZoom,isMinZoomDisplayed:e=>e.zoom<=e.minZoom,projectionCode:e=>e.projection?.getCode(),urlParams:e=>{let t={center:e.center,mode:e.mode,zoom:e.zoom};if(t.mode===`3D`){let e=mapCollection.getMap(`3D`)?.getCesiumScene()?.camera,n=Cesium.Cartographic.fromCartesian(e.positionWC);t.lon=Cesium.Math.toDegrees(n.longitude),t.lat=Cesium.Math.toDegrees(n.latitude),t.height=n.height,t.heading=Cesium.Math.toDegrees(e.heading),t.pitch=Cesium.Math.toDegrees(e.pitch)}return`MAPS=${JSON.stringify(t)}`}},mutations:{...U(ll),addHighlightedFeature(e,t){e.highlightedFeatures.push(t)},addHighlightedFeatureStyle(e,t){e.highlightedFeatureStyles.push(t)}},state:{...ll}};function dl(e,t,n){let r=``;e?.response?(console.error(e.response?.data),console.error(e.response?.status),console.error(e.response?.headers),r=`The request was made and the server responded with a status code that falls out of the range of 2xx.`):e?.request?(console.error(e.request),r=`The request was made but no response was received.`):(console.error(`Error`,e?.message),r=`Something happened in setting up the request that triggered an Error.`),console.error(`${t}: ${r}`),console.warn(e?.config),typeof n==`function`&&n(`${t}: ${r}`)}var fl={handleAxiosError:dl};function pl(e,t=!0){let n=[...e.children],r={};return n.length?(e instanceof Element&&e.hasAttributes()&&(r.attributes=ml(e.attributes)),n.forEach(e=>{let i=n.filter(t=>t.nodeName===e.nodeName).length>1,a=e.nodeName.substr(e.nodeName.indexOf(`:`)+1);if(i)r[a]===void 0?r[a]=[pl(e,t)]:Array.isArray(r[a])?r[a].push(pl(e,t)):r[a]=[r[a],pl(e,t)];else{let n=pl(e,t);Array.isArray(r[a])?r[a].push(n):r[a]instanceof Object?r[a]=[r[a],n]:r[a]=n}}),r):t?e.hasAttributes()?{getValue:()=>e.textContent,getAttributes:()=>ml(e.attributes)}:{getValue:()=>e.textContent,getAttributes:()=>void 0}:e.textContent}function ml(e){let t={};for(let n of e)t[n.name]=n.value;return t}(function(e){e&&e.prototype&&!e.prototype.hasOwnProperty.call(`children`)&&Object.defineProperty(e.prototype,"children",{configurable:!0,get:function(){let e=this.childNodes,t=[];return e.forEach(function(e){e.nodeType===1&&t.push(e)}),t}})})(window.Node||window.Element);function hl(e,t,n=`http://www.isotc211.org/2005/gmd`,r=`full`,i=`2.0.2`){return B.get(e,{params:{service:`CSW`,request:`GetRecordById`,version:i,outputschema:n,elementsetname:r,id:t}}).then(e=>pl(e.request.responseXML)).then(e=>gl(e)).catch(e=>fl(e,`getRecordById`))}function gl(e){return{getTitle:()=>vl(e),getAbstract:()=>xl(e),getFrequenzy:()=>Sl(e),getPublicationDate:()=>Cl(e,`publication`),getCreationDate:()=>Cl(e,`creation`),getRevisionDate:()=>Cl(e,`revision`),getDownloadLinks:()=>wl(e),getOwner:()=>Tl(e,`owner`),getContact:()=>Tl(e,`pointOfContact`),getConstraints:(t=!1)=>yl(e,t),getPublisher:()=>Tl(e,`publisher`)}}function _l(e){return e.GetRecordByIdResponse?.MD_Metadata?.identificationInfo?.MD_DataIdentification||e.GetRecordByIdResponse?.MD_Metadata?.identificationInfo?.SV_ServiceIdentification||e.MD_Metadata?.identificationInfo?.MD_DataIdentification}function vl(e){return _l(e)?.citation?.CI_Citation?.title?.CharacterString?.getValue()}function yl(e,t=!1){let n=_l(e)?.resourceConstraints,r,i=[];
2return Array.isArray(n)&&n.forEach(e=>{let n=e.MD_LegalConstraints;if(n?.accessConstraints?.MD_RestrictionCode?.getAttributes()?.codeListValue===`otherRestrictions`&&(r=n?.otherConstraints?.Anchor?.getValue()),n?.useConstraints?.MD_RestrictionCode?.getAttributes()?.codeListValue===`otherRestrictions`){let e=n?.otherConstraints;Array.isArray(e)&&(i=[],e.forEach(e=>{let n=e?.CharacterString?.getValue()||``;i.push(bl(n,t))}))}}),{access:r,use:i}}function bl(e,t){try{let t=JSON.parse(e);if(t.url)return t}catch{if(t)return Yc(e)}return e}function xl(e){let t=_l(e)?.abstract?.CharacterString?.getValue();return/\r|\n/.exec(t)&&(t=t.replace(/(?:\r\n|\r|\n)/g,`<br>`).replace(/(<br ?\/?>)+/gi,`<br>`).replace(/(<br ?\/?>)+/gi,`</p><p>`)),t===void 0?`<p>`+i18next.t(`common:modules.layerInformation.noMetadataLoaded`)+`<p>`:`<p>`+t+`</p>`}function Sl(e){let t=_l(e)?.resourceMaintenance?.MD_MaintenanceInformation?.maintenanceAndUpdateFrequency?.MD_MaintenanceFrequencyCode?.getAttributes(),n={continual:`common:shared.js.api.cswParser.continual`,daily:`common:shared.js.api.cswParser.daily`,weekly:`common:shared.js.api.cswParser.weekly`,fortnightly:`common:shared.js.api.cswParser.fortnightly`,monthly:`common:shared.js.api.cswParser.monthly`,quarterly:`common:shared.js.api.cswParser.quarterly`,biannually:`common:shared.js.api.cswParser.biannually`,annually:`common:shared.js.api.cswParser.annually`,asNeeded:`common:shared.js.api.cswParser.asNeeded`,irregular:`common:shared.js.api.cswParser.irregular`,notPlanned:`common:shared.js.api.cswParser.notPlanned`,unknown:`common:shared.js.api.cswParser.unknown`};if(t?.codeListValue)return n[t.codeListValue]}function Cl(e,t){let n=_l(e)?.citation?.CI_Citation?.date,r;return Array.isArray(n)?n.forEach(e=>{e?.CI_Date?.dateType?.CI_DateTypeCode?.getAttributes()?.codeListValue===t&&(r=e.CI_Date?.date?.DateTime?.getValue()||e.CI_Date?.date?.Date?.getValue())}):n?.CI_Date?.dateType?.CI_DateTypeCode?.getAttributes()?.codeListValue===t&&(r=n.CI_Date?.date?.DateTime?.getValue()||n.CI_Date?.date?.Date?.getValue()),r===void 0?r:(0,G.default)(r).format(`DD.MM.YYYY`)}function wl(e){let t=e.GetRecordByIdResponse?.MD_Metadata?.distributionInfo?.MD_Distribution?.transferOptions,n=[];return typeof t==`object`&&t&&Bn(t,`CI_OnlineResource`).forEach(e=>{e?.function?.CI_OnLineFunctionCode?.getAttributes().codeListValue===`download`&&n.push({link:e?.linkage?.URL.getValue(),linkName:e?.name?.CharacterString.getValue()||e?.description?.CharacterString.getValue()||e?.linkage?.URL.getValue()})}),n.length>0?n:null}function Tl(e,t){let n=_l(e)?.pointOfContact,r=null;if(Array.isArray(n)){for(let e of n)if(e?.CI_ResponsibleParty?.role?.CI_RoleCode?.getAttributes()?.codeListValue===t){r={name:e.CI_ResponsibleParty?.organisationName?.CharacterString?.getValue(),positionName:e.CI_ResponsibleParty?.positionName?.CharacterString?.getValue().split(`,`).reverse(),street:e.CI_ResponsibleParty?.contactInfo?.CI_Contact?.address?.CI_Address?.deliveryPoint?.CharacterString?.getValue(),housenr:``,postalCode:e.CI_ResponsibleParty?.contactInfo?.CI_Contact?.address?.CI_Address?.postalCode?.CharacterString?.getValue(),city:e.CI_ResponsibleParty?.contactInfo?.CI_Contact?.address?.CI_Address?.city?.CharacterString?.getValue(),email:e.CI_ResponsibleParty?.contactInfo?.CI_Contact?.address?.CI_Address?.electronicMailAddress?.CharacterString?.getValue(),phone:e.CI_ResponsibleParty?.contactInfo?.CI_Contact?.phone?.CI_Telephone?.voice?.CharacterString?.getValue(),link:e.CI_ResponsibleParty?.contactInfo?.CI_Contact?.onlineResource?.CI_OnlineResource?.linkage?.URL?.getValue(),country:e.CI_ResponsibleParty?.contactInfo?.CI_Contact?.address?.CI_Address?.country?.CharacterString?.getValue()};break}}else n?.CI_ResponsibleParty?.role?.CI_RoleCode?.getAttributes()?.codeListValue===t&&(r={name:n.CI_ResponsibleParty?.organisationName?.CharacterString?.getValue(),positionName:n.CI_ResponsibleParty?.positionName?.CharacterString?.getValue().split(`,`).reverse(),street:n.CI_ResponsibleParty?.contactInfo?.CI_Contact?.address?.CI_Address?.deliveryPoint?.CharacterString?.getValue(),housenr:``,postalCode:n.CI_ResponsibleParty?.contactInfo?.CI_Contact?.address?.C
2I_Address?.postalCode?.CharacterString?.getValue(),city:n.CI_ResponsibleParty?.contactInfo?.CI_Contact?.address?.CI_Address?.city?.CharacterString?.getValue(),email:n.CI_ResponsibleParty?.contactInfo?.CI_Contact?.address?.CI_Address?.electronicMailAddress?.CharacterString?.getValue(),phone:n.CI_ResponsibleParty?.contactInfo?.CI_Contact?.phone?.CI_Telephone?.voice?.CharacterString?.getValue(),link:n.CI_ResponsibleParty?.contactInfo?.CI_Contact?.onlineResource?.CI_OnlineResource?.linkage?.URL?.getValue(),country:n.CI_ResponsibleParty?.contactInfo?.CI_Contact?.address?.CI_Address?.country?.CharacterString?.getValue()});return r}var El={getRecordById:hl,getMdIdentification:_l,getMetadata:gl,parseDate:Cl,parseTitle:vl,parseConstraints:yl},Dl={name:`masterportal`,private:!0,type:`module`,author:{name:`Implementierungspartnerschaft Masterportal`,email:`[email protected]`,url:`https://www.masterportal.org`},bugs:`https://gitlab.opencode.de/lgvhh/urban-data-solutions/masterportal/-/work_items`,version:`3.26.0`,license:`MIT`,description:`The MasterPortal as OpenSource Geoportal`,repository:{type:`git`,url:`https://bitbucket.org/geowerkstatt-hamburg/masterportal.git`},main:`src/masterportal.js`,scripts:{prestart:`node devtools/certificate/ensureDevCert.mjs`,start:`vite --config devtools/vite.config.js`,"start:localApi":`cross-env VITE_LOCAL_MASTERPORTALAPI=true vite --config devtools/vite.config.js`,startDebug:`vite --debug hmr --debug plugin-transform --config devtools/vite.config.js`,test:`rimraf node_modules/.vite && vitest run --config devtools/vitest.config.js`,"test:watch":`rimraf node_modules/.vite && vitest --config devtools/vitest.config.js --watch`,"test:silent":`rimraf node_modules/.vite && cross-env SILENT=true vitest run --config devtools/vitest.config.js`,"test:silent:watch":`rimraf node_modules/.vite && cross-env SILENT=true vitest --config devtools/vitest.config.js --watch`,lint:`eslint "./**/*.{vue,js,mjs}"`,"lint:fix":`eslint --fix "./**/*.{vue,js,mjs}"`,migrateConfig:`node devtools/tasks/migrator/migrate.js`,build:`node devtools/tasks/viteBuild.js`,buildPortal:`vite build --config devtools/vite.config.js && rimraf dist/portal`,buildExamples:`cross-env EXAMPLES_ONLY=true vite build --config devtools/vite.config.js --mode production && rimraf dist/portal && rimraf --glob "dist/examples_*"`,buildJsDoc:`node devtools/tasks/buildJsDoc.js`,validateOsvSuppressions:`node devtools/security/validateOsvSuppressions.mjs`,versionHotfix:`npm version patch && npm run versionLatest && git tag -d lts && git push --tags -f --no-verify`,versionMinor:`npm version minor && npm run versionLatest && git tag -d lts && git push --tags -f --no-verify`,versionMajor:`npm version major && npm run versionLatest && git tag -d lts && git push --tags -f --no-verify`,versionLatest:`git tag latest -f`,"versionHotfix:all":`npm run versionHotfix && cd addons && npm run versionHotfix && cd .. && cd portalconfigs && npm run versionHotfix && cd ..`,"versionMinor:all":`npm run versionMinor && cd addons && npm run versionMinor && cd .. && cd portalconfigs && npm run versionMinor && cd ..`,"versionMajor:all":`npm run versionMajor && cd addons && npm run versionMajor && cd .. && cd portalconfigs && npm run versionMajor && cd ..`,prePushHook:`node ./node_modules/@masterportal/mpconfigparser/cli.js docs/User/Portal-Config/config.json.md docs/User/Portal-Config/config.json.de.md && npm run validateOsvSuppressions && eslint --max-warnings 0 "./**/*.{vue,js,mjs}" && npm run buildJsDoc && npm run test`,validateDocs:`node devtools/docsValidation/validateDocs.js`,prepare:`husky`},dependencies:{"@masterportal/masterportalapi":`^2.63.0`,"@popperjs/core":`^2.11.8`,axios:`^1.19.0`,bootstrap:`^5.3.8`,"bootstrap-icons":`^1.13.1`,"chart.js":`^4.5.1`,i18next:`^26.1.0`,"i18next-browser-languagedetector":`^8.2.1`,"i18next-http-backend":`^4.0.0`,"i18next-vue":`^5.4.0`,jsts:`^2.12.1`,mqtt:`^5.15.1`,"object-hash":`^3.0.0`,qrcode:`1.5.4`,rimraf:`^6.1.3`,three:`^0.184.0`,"url-parse":`^1.5.10`,vue:`^3.5.33`,"vue-datepicker-next":`^1.0.3`,"vue-multiselect":`3.5.0`,vuedraggable:`^4.1.0`,vuex:`^4.1.0`,pinia:`^4.0.2`},devDependencies:{"@eslint/js":`10.0.1`,"@geoblocks/print":`^0.7.9`,"@masterportal/mpconfigparser":`^2.0.0`,"@sinonjs/fake-timers":`^14.0.0`,"@stylistic/eslint-plugin":`^5.10.0`,"@vitejs/plugin-vue":`^6.0.6`,"@vitest/eslint-plugin":`^1.6.16`,"@vitest/ui":`^4.0.16`,"@vitest/web-worker":`^4.0.16`,"@vue/compiler-sfc":`3.5.33`,"@vue/devtools-api":`^8.1.2`,"@vue/server-renderer":`3.5.33`,"@vue/test-utils":`^2.4.9`,canvas:`^3.2.3`,chai:`^6.2.2`,"child-process-promise":`^2.2.1`,"cross-env":`^10.1.0`,docdash:`^2.0.2`,"esbuild-loader":`^4.4.3`,"eslint-plugin-jsdoc":`63.0.1`,"eslint-plugin-n":`18.0.1`,"eslint-plugin-vue":`10.9.1`,"eslint-plugin-vuejs-accessibility":`2.5.0`,"fs-extra":`^11.3.4`,globals:`^17.6.0`,"https-proxy-agent":`^9.0.0`,husky:`^9.1.7`,jsdoc:`4.0.5`,"jsdoc-vuejs":`^4.0.0`,jsdom:`^29.1.1`,"jsdom-worker":`^0.3.0`,"mock-local-storage":`^1.1.24`,"regenerator-runtime":`^0.14.1`,"replace-in-file":`8.4.0`,"resize-observer-polyfill":`^1.5.1`,sass:`1.77.2`,shelljs:`^0.10.0`,sinon:`22.0.0`,"sinon-chai":`^4.0.1`,vite:`^8.1.4`,"vite-plugin-cp":`^6.0.3`,"vite-plugin-dynamic-import":`^1.6.0`,"vite-plugin-node-polyfills":`^0.28.0`,"vite-plugin-zip-pack":`^1.2.4`,vitest:`^4.0.16`,xmlserializer:`^0.6.1`},overrides:{"@cesium/engine":`npm:dry-uninstall`,"@cesium/widgets":`npm:dry-uninstall`},engines:{node:`>=22.19.0 <23 || >=24 <25`,npm:`>=10.9.3 <12`}},Ol=Ae(`about`,{state:()=>({description:`common:modules.about.description`,icon:`bi-info-circle`,name:`common:modules.about.name`,menuSide:`mainMenu`,type:`about`,abstractText:``,contact:null,cswUrl:``,logo:`/mastercode/3_26_0/img/Logo_Masterportal.svg`,logoLink:`https://masterportal.org`,logoText:`Masterportallogo`,metaDataCatalogueId:`2`,metaId:``,metaUrl:``,noMetadataLoaded:``,showAdditionalMetaData:!0,title:``,version:!0,versionLink:`https://bitbucket.org/geowerkstatt-hamburg/masterportal/downloads/`,ustId:``,privacyStatementText:``,privacyStatementUrl:``,accessibilityText:``,accessibilityUrl:``,hideImprintInFooter:!1}),actions:{async initializeAboutInfo(){let e;if(this.cswUrl&&this.metaId)try{e=await El.getRecordById(this.cswUrl,this.metaId)}catch(e){console.warn(`CSW request failed:`,e)}else if(Config.cswId&&this.metaId!==void 0){let{default:t}=await b(async()=>{let{default:e}=await Promise.resolve().then(()=>IA);return{default:e}},void 0,import.meta.url),n=t.getters.restServiceById(Config.cswId),r=``;if(n?r=n.url:console.warn(`Rest Service with the ID `+Config.cswId+` is not configured in rest-services.json!`),r&&this.metaId)try{e=await El.getRecordById(r,this.metaId)}catch(e){console.warn(`CSW fallback request failed:`,e)}}e!==void 0&&(this.title=e?.getTitle(),this.abstractText=e?.getAbstract(),e?.getContact()?this.contact=e?.getContact():this.contact=e?.getPublisher()),this.currentMasterportalVersionNumber()},currentMasterportalVersionNumber(){this.version=this.version===!0?Dl.version:this.version}}}),kl=Ae(`copyrightConstraints`,{state:()=>({id:`copyrightConstraints`,name:`common:modules.copyrightConstraints.name`,icon:`bi-c-circle`,type:`copyrightConstraints`,cswUrl:`https://gdk.gdi-de.org/gdi-de/srv/ger/csw`,useLayerCswUrl:!1})});function Al(e,t,n){let r=e,i=[];if(r===null||typeof r!=`object`&&typeof r!=`string`)return[];if(typeof r==`string`&&(r=r.split(``)),typeof t!=`function`)return Array.isArray(r)||(r=Object.values(r)),r.concat().sort((e,n)=>e===void 0?1:n===void 0?-1:t===void 0?e>n?1:e<n?-1:0:typeof e!=`object`||!Object.prototype.hasOwnProperty.call(e,t)?1:typeof n!=`object`||!Object.prototype.hasOwnProperty.call(n,t)?-1:e[t]>n[t]?1:e[t]<n[t]?-1:0);if(Array.isArray(r))i=r.map((r,i)=>({idx:t.call(n,r,i,e),obj:r}),n);else{let a;for(a in r)i.push({idx:t.call(n,r[a],a,e),obj:r[a]})}return i.sort((e,t)=>
2e.idx>t.idx?1:e.idx<t.idx?-1:0),i.map(e=>e.obj)}function jl(e,{layerInfo:t,metaDataCatalogueId:n,restServiceById:r}){let i=[],a=``,o=null;if(!e)return i;if(t?.showDocUrl)a=t.showDocUrl+e;else if(t?.isExternal)return i;else typeof r==`function`&&n&&(o=r(n),o?a=o.url+e:console.warn(`Rest Service with the ID `+n+` is not configured in rest-services.json!`));return a&&!i.includes(a)&&i.push(a),i}var Ml=Ae(`layerInformation`,{state:()=>({abstractText:``,customText:null,dateCreation:``,datePublication:``,dateRevision:``,downloadLinks:null,icon:`bi-info-circle`,layerInfo:{},menuSide:`mainMenu`,metaDataCatalogueId:`2`,metaURLs:[],name:`common:modules.layerInformation.name`,noMetadataLoaded:``,periodicityKey:``,showUrlGlobal:null,title:``,type:`layerInformation`,legendAvailable:!0,pointOfContact:``,publisher:``,selectedLayerIndex:0}),getters:{urlParams:e=>{let t={...e.layerInfo},n={};return Object.entries(t).forEach(([e,t])=>{let r=t;Kc(t)&&(r=encodeURIComponent(t)),n[e]=r}),{layerInfo:n}}},actions:{startLayerInformation(e){let t=e?.datasets?.length>0?e.datasets[0].md_id:null,n=e.legendURL!==`ignore`&&e.legend!==`ignore`&&e.legend!==!1,r=null;$.getters.configJs?.metaDataCatalogueId&&$.getters.configJs.metaDataCatalogueId!==this.metaDataCatalogueId&&(this.metaDataCatalogueId=$.getters.configJs.metaDataCatalogueId),e?.datasets?.length>0&&(r=e.datasets[0].md_name),r||=e.name,this.legendAvailable=n,n&&$.getters[`Modules/Legend/layerInfoLegend`].id!==e.id&&($.commit(`Modules/Legend/setLayerInfoLegend`,{}),$.dispatch(`Modules/Legend/createLegendForLayerInfo`,e.id)),$.getters.isMobile&&!$.getters[`Menu/expanded`](`mainMenu`)&&$.dispatch(`Menu/toggleMenu`,`mainMenu`),$.dispatch(`Menu/changeCurrentComponent`,{type:`layerInformation`,side:`mainMenu`,props:{name:r}}),this.setLayerInfo(e),this.setMetadataURL(t),this.additionalSingleLayerInfo()},setLayerInfo(e){let t=e?.datasets?.length>0?e.datasets[0].md_id:null,n=e?.url||e?.capabilitiesUrl,r=[],i=e?.datasets?.[0]?.csw_url??null,a=e?.datasets?.[0]?.customMetadata??null,o=e?.datasets?.[0]?.attributes??null,s=e?.datasets?.[0]?.show_doc_url??null;e?.typ?.startsWith(`GROUP`)&&e.children.forEach(e=>{let t=e.url||e.capabilitiesUrl,n=e.datasets?.[0]||{},c=n.md_id||null,l=n.csw_url||null,u=n.customMetadata||null,d=n.attributes||null,f=n.show_doc_url||null;r.push({name:e.name,type:e.typ,metaID:c,url:t}),e.datasets?.length>0&&(i||=l,a||=u,o||=d,s||=f)}),this.layerInfo={cswUrl:i,id:e?.id,layername:e?.name,showDocUrl:s,typ:e?.typ,...a&&{customMetadata:a},...o&&{attributes:o},...t&&{metaID:t},...r.length>0&&{layers:r},...e?.legendURL&&{legendURL:e.legendURL},...n&&{url:n},...e?.urlIsVisible!==void 0&&{urlIsVisible:e?.urlIsVisible},...e?.isExternal&&{isExternal:!0}}},async additionalSingleLayerInfo(){let e;e=Array.isArray(this.layerInfo.metaID)&&this.layerInfo.metaID.length>0?this.selectedLayerIndex<this.layerInfo.metaID.length?this.layerInfo.metaID[this.selectedLayerIndex]:this.layerInfo.metaID[0]:typeof this.layerInfo.metaID==`string`?this.layerInfo.metaID:null;let t=this.layerInfo.cswUrl,n=this.layerInfo.customMetadata,r=this.layerInfo.attributes,i={metaId:e,cswUrl:t,customMetadata:n,attributes:r};this.getAbstractInfo(i)},async getAbstractInfo(e){let t;if(this.downloadLinks=null,e.cswUrl&&e.metaId!==void 0&&e.metaId!==null)try{t=await El.getRecordById(e.cswUrl,e.metaId)}catch{console.error(i18next.t(`common:modules.layerInformation.noMetadataLoadedConsole`))}else if(Config.cswId!==null&&Config.cswId!==void 0){let n=$.getters.restServiceById(Config.cswId),r=``;this.customText=null,n===void 0?console.warn(`Rest Service with the ID `+Config.cswId+` is not configured in rest-services.json!`):r=n.url,r!==``&&e.metaId!==void 0&&(t=await El.getRecordById(r,e.metaId))}else if(e.customMetadata){let n=await B.get(e.cswUrl).then(e=>pl(e.request.responseXML));t=El.getMetadata(n),this.getCustomMetaData({attributes:e.attributes,metadataAsJson:n})}if(t===void 0?(this.title=``,this.periodicityKey=``,this.datePublication=``,this.abstractText=i18next.t(`common:modules.layerInformation.noMetadataLoaded`),this.noMetadataLoaded=i18next.t(`common:modules.layerInformation.noMetadataLoaded`),this.pointOfContact=``,this.publisher=``,this.dateRevision=``):(this.title=t?.getTitle(),this.abstractText=t?.getAbstract(),this.periodicityKey=t?.getFrequenzy(),this.downloadLinks=t?.getDownloadLinks(),this.datePublication=t?.getPublicationDate(),this.dateCreation=t?.getCreationDate(),this.pointOfContact=t?.getContact(),this.publisher=t?.getPublisher(),this.dateRevision=t?.getRevisionDate(
2)),this.downloadLinks){let e=[];this.downloadLinks.forEach(t=>{e.push(t)}),this.downloadLinks=Al(e,`linkName`)}},getCustomMetaData(e){let t=Object.entries(e.attributes).map(([t,n])=>({[t]:n.split(`.`).reduce((e,t)=>e[t],e.metadataAsJson).getValue()})),n={};for(let e=0;e<t.length;e++)Object.assign(n,t[e]);this.customText=n},setMetadataURL(e){let t=jl(e,{layerInfo:this.layerInfo,metaDataCatalogueId:this.metaDataCatalogueId,restServiceById:$.getters.restServiceById});this.metaURLs=t},setConfigParams(e){e.layerInformation!==void 0&&e.layerInformation.showUrlGlobal!==null?this.showUrlGlobal=e.layerInformation.showUrlGlobal:e.layerInformation===void 0&&(this.showUrlGlobal=void 0)},restoreFromUrlParams(e){let t=ra.upperFirst(this.type),n=e.layerInfo.id,r=$.getters.layerConfigById(n);$.dispatch(`Menu/updateComponentState`,{type:t,attributes:e}),$.getters.styleListLoaded?this.startLayerInformation(r):this.waitAndRestoreLayerInformation(r)},waitAndRestoreLayerInformation(e){$.watch((e,t)=>t.styleListLoaded,t=>{t&&this.startLayerInformation(e)})}}}),Nl={about:Ol,copyrightConstraints:kl,layerInformation:Ml};function Pl(e){return Nl[e]}function Fl(e){return Object.prototype.hasOwnProperty.call(Nl,e)}y();var Il={activateCurrentComponent({commit:e,dispatch:t,rootGetters:n},{currentComponent:r,type:i,side:a}){let o=ra.lowerFirst(i),s=Fl(o)?Pl(o)().name:n[`Modules/${i}/name`];e(`setExpandedBySide`,{expanded:!0,side:a}),t(`changeCurrentComponent`,{type:r.type,side:a,props:{name:s}})},changeCurrentComponent({commit:e,dispatch:t,state:n},{type:r,side:i,props:a}){let o=n[i].navigation.currentComponent.type,s=n[i].navigation.currentComponent.props;if(a?.closeOppositeMenu){let t=i===`mainMenu`?`secondaryMenu`:`mainMenu`;n[t].expanded&&e(`setExpandedBySide`,{expanded:!1,side:t})}o!==r||o===`folder`&&r===`folder`||o===`layerSelection`&&r===`layerSelection`?(e(`setCurrentComponent`,{type:r,side:i,props:a}),t(`changeCurrentMouseMapInteractionsComponent`,{type:r,side:i})):a?.name!==s?.name&&e(`setCurrentComponentProps`,{side:i,props:a})},changeCurrentMouseMapInteractionsComponent({commit:e,rootGetters:t,state:n},{type:r,side:i}){if(r!==n.currentMouseMapInteractionsComponent&&t[`Modules/${ra.upperFirst(r)}/hasMouseMapInteractions`]){let t=i===`mainMenu`?`secondaryMenu`:`mainMenu`;n[t].navigation.currentComponent.type===n.currentMouseMapInteractionsComponent&&e(`switchToRoot`,t),e(`setCurrentMouseMapInteractionsComponent`,r)}},resetCurrentMouseMapInteractionsComponent({commit:e,state:t},n){if(t.defaultComponent!==t.currentMouseMapInteractionsComponent){let r=n===`mainMenu`?`secondaryMenu`:`mainMenu`;t[r].navigation.currentComponent.type===t.currentMouseMapInteractionsComponent&&e(`switchToRoot`,r),e(`setCurrentMouseMapInteractionsComponent`,t.defaultComponent)}},clickedMenuElement({dispatch:e,rootGetters:t},{name:n,path:r,side:i,type:a,properties:o}){if(a){if(a===`customMenuElement`&&(o.openURL!==void 0&&window.open(o.openURL),o.execute!==void 0&&e(o.execute.action,o.execute.payload,{root:!0}),o.htmlContent===void 0&&o.pathToContent===void 0)){t.isMobile&&e(`Menu/toggleMenu`,i,{root:!0});return}a===`folder`?xn(()=>{e(`changeCurrentComponent`,{type:a,side:i,props:{path:r,name:n}})}):e(`changeCurrentComponent`,{type:a,side:i,props:o?Object.assign(o,{name:n}):{name:n}})}},closeMenu({commit:e,dispatch:t,getters:n,state:r},i){n.currentComponent(i).type===r.currentMouseMapInteractionsComponent&&n.currentComponent(i).type!==r.defaultComponent&&t(`changeCurrentMouseMapInteractionsComponent`,{type:r.defaultComponent,side:i}),e(`switchToRoot`,i),t(`toggleMenu`,i)},navigateBack({commit:e,dispatch:t,getters:n,state:r,rootGetters:i},{side:a}){let o=i[`Modules/SearchBar/currentActionEvent`];xn(()=>{n.currentComponent(a).type===r.currentMouseMapInteractionsComponent&&n.currentComponent(a).type!==r.defaultComponent&&t(`changeCurrentMouseMapInteractionsComponent`,{type:r.defaultComponent,side:a}),(n.currentComponent(a).type!==`layerInformation`&&i[`Modules/SearchBar/showAllResults`]===!1||i[`Modules/SearchBar/currentSide`]!==a)&&e(`switchToPreviousComponent`,a),n.currentComponent(a).type===`searchBar`&&(i[`Modules/SearchBar/showAllResults`]===!0&&i[`Modules/SearchBar/currentSide`]===a&&o===``&&t(`resetSearchbarNavigation`,{side:a}),e(`Modules/SearchBar/setPlaceholder`,i[`Modules/SearchBar/globalPlaceholder`],{root:!0})),n.currentComponent(a).type===`layerSelection`&&t(`navigateSearchbarInLayerSelection`,{side:a}),o!==``&&i[`Modules/SearchBar/currentSide`]===a&&t(`navigateSearchbarActionEventNotInLayerSelection`,{side:a}),n.currentComponent(a).type===`layerInformation`&&e(`switchToPreviousComponent`,a)})},resetSearchbarNavigation({commit:e},{side:t}){e(`Modules/SearchBar/setShowAllResults`,!1,{root:!0}),e(`Menu/setCurrentComponentPropsName`,{side:t,name:`common:modules.searchBar.searchResultList`},{root:!0}),e(`Menu/setNavigationHistoryBySide`,{side:t,newHistory:[{type:`root`,props:[]}]},{root:!0})},navigateSearchbarActionEventNotInLayerSelection({commit:e,dispatch:t,rootGetters:n},{side:r}){let i=n[`Modules/SearchBar/currentActionEvent`];
2e(`Modules/SearchBar/setShowSearchResultsInTree`,!1,{root:!0}),i!==`showInTree`&&i!==`showLayerInfo`?t(`resetSearchbarNavigation`,{side:r}):e(`Modules/SearchBar/setShowAllResults`,!0,{root:!0}),e(`Modules/SearchBar/setCurrentActionEvent`,``,{root:!0})},navigateSearchbarInLayerSelection({commit:e,dispatch:t,getters:n},{side:r}){e(`Modules/SearchBar/setShowAllResults`,!1,{root:!0}),n.navigationHistory(r)[1]?.type===`layerSelection`&&n.navigationHistory(r)[2]?.type===`layerSelection`?e(`Modules/SearchBar/setShowSearchResultsInTree`,!0,{root:!0}):(e(`Modules/SearchBar/setSearchResultsActive`,!1,{root:!0}),e(`Modules/SearchBar/setShowSearchResultsInTree`,!1,{root:!0}),t(`Modules/LayerSelection/navigateBack`,{doNotTrack:!0},{root:!0})),e(`switchToPreviousComponent`,r)},resetMenu({commit:e,dispatch:t,getters:n,state:r,rootGetters:i},a){n.currentComponent(a).type===r.currentMouseMapInteractionsComponent&&n.currentComponent(a).type!==r.defaultComponent&&t(`changeCurrentMouseMapInteractionsComponent`,{type:r.defaultComponent,side:a}),n.currentComponent(a).type===`layerInformation`&&t(`Modules/LayerSelection/reset`,null,{root:!0}),n.currentComponent(a).type===`getFeatureInfo`&&i[`Modules/GetFeatureInfo/menuExpandedBeforeGfi`]===!1&&e(`setExpandedBySide`,{expanded:!1,side:a}),e(`switchToRoot`,a)},toggleMenu({commit:e,rootGetters:t,state:n},r){if(r===`mainMenu`)t.isMobile&&n.secondaryMenu.expanded&&e(`setExpandedBySide`,{expanded:!1,side:`secondaryMenu`}),e(`setExpandedBySide`,{expanded:!n.mainMenu.expanded,side:r});else if(r===`secondaryMenu`){t.isMobile&&n.mainMenu.expanded&&e(`setExpandedBySide`,{expanded:!1,side:`mainMenu`});let i=document.getElementById(`module-portal-footer`),a=document.getElementById(`layer-pills`);n.secondaryMenu.expanded&&(a&&(a.style.display=``),i&&(i.style.display=``)),e(`setExpandedBySide`,{expanded:!n.secondaryMenu.expanded,side:r})}},updateComponentState({dispatch:e},{type:t,attributes:n}){this._actions[`Modules/${t}/urlParams`]?typeof n==`object`?e(`Modules/${t}/urlParams`,n,{root:!0}):e(`Modules/${t}/urlParams`,JSON.parse(n),{root:!0}):Object.assign(this.state.Modules[t],n)},setCurrentMenuWidth({commit:e},{type:t,attributes:n}){n.width<=95&&n.width>=5?e(`setCurrentMenuWidth`,{side:t,width:n.width+`%`}):console.error(i18next.t(`common:modules.menu.widthUrlParamError`))}},Ll={currentMouseMapInteractionsComponent:`getFeatureInfo`,defaultComponent:`getFeatureInfo`,customMenuElementIcon:`bi-asterisk`,currentSecondaryMenuWidth:0,currentSecondaryMenuOffsetWidth:0,currentMainMenuWidth:0,currentMainMenuOffsetWidth:0,mainMenu:{configPaths:[`portalConfig.mainMenu.sections`],expanded:!1,expandedTop:`0%`,width:`25%`,currentComponent:`root`,title:null,toggleButtonIcon:`bi-list`,sections:[[]],showDescription:!1,showHeaderIcon:!1,navigation:{currentComponent:{type:`root`,props:[]},history:[]}},secondaryMenu:{configPaths:[`portalConfig.secondaryMenu.sections`],expanded:!1,expandedTop:`70%`,width:`25%`,currentComponent:`root`,sections:[[]],showDescription:!0,title:null,toggleButtonIcon:`bi-tools`,showHeaderIcon:!1,navigation:{currentComponent:{type:`root`,props:[]},history:[]}}},Rl=Symbol(`Path could not be resolved.`);function zl(e,t){return t.reduce((e,t)=>e&&Object.prototype.hasOwnProperty.call(e,t)?e[t]:Rl,e)}var Bl={badPathSymbol:Rl,idx:zl},Vl={namespaced:!0,actions:Il,getters:{...H(Ll),currentComponent:e=>t=>e[t].navigation.currentComponent,currentComponentName:e=>t=>{let n=e[t]?.navigation.currentComponent,r={};switch(n.type){case`root`:r=i18next.t(`common:modules.menu.name`);break;default:r=n.props!==void 0&&n.props.name?i18next.t(n.props.name):n.type;break}return r},currentFolderPath:e=>t=>e[t].navigation.currentComponent.props.path,currentMenuWidth:e=>t=>e[t].width,deactivateModule:(e,t,n,r)=>t=>!!(r[`Modules/${ra.upperFirst(t)}/hasMouseMapInteractions`]&&ra.upperFirst(t)!==e.activeModuleMouseMapInteractions),expanded:e=>t=>e[t].expanded,mainExpanded:e=>e.mainMenu.expanded,mainTitle:e=>e.mainMenu.title,mainToggleButtonIcon:e=>e.mainMenu.toggleButtonIcon,previousNavigationEntryText:e=>t=>{let n=e[t].navigation.history.length===0?``:e[t].navigation.history.slice(-1)[0],r=!1;if(n!==``)switch(n.type){case`root`:r=i18next.t(`common:modules.menu.name`);break;default:r=n.props!==void 0&&n.props.name?i18next.t(n.props.name):n.type;break}return r},navigationHistory:e=>t=>e[t].navigation.history,secondaryExpanded:e=>e.secondaryMenu.expanded,secondaryTitle:e=>e.secondaryMenu.title,secondaryToggleButtonIcon:e=>e.secondaryMenu.toggleButtonIcon,section:(e,t)=>e=>{if(e&&t[e[0]]){let n=Bl.idx(t,e);return n===Bl.badPathSymbol?(console.error(`Menu.getters.section: ${Bl.badPathSymbol.description} ${e}.`),null):n}return console.error(`Menu: The given menu ${e[0]} is not configured in the config.json.`),null},sectionHasItems:e=>(t,n)=>{let r=e?.[t]?.sections?.[n];return Array.isArray(r)?r.length>0:r&&Array.isArray(r.elements)?r.elements.length>0:!1},showDescription:e=>t=>e[t].showDescription,titleBySide:(e,t)=>e=>e===`mainMenu`&&t.mainTitle?{...t.mainTitle,idAppendix:e}
2:e===`secondaryMenu`&&t.secondaryTitle?{...t.secondaryTitle,idAppendix:e}:null,showHeaderIcon:e=>t=>e[t]?.showHeaderIcon,urlParams:(e,t)=>{let n={main:{currentComponent:e.mainMenu.currentComponent},secondary:{currentComponent:e.secondaryMenu.currentComponent}},r=t.getComponentAttributes(e.mainMenu.currentComponent),i=t.getComponentAttributes(e.secondaryMenu.currentComponent);return r&&(n.main.attributes=r),i&&(n.secondary.attributes=i),n},getComponentAttributes:(e,t,n,r)=>e=>{let t;if(e!==`root`){let i=ra.upperFirst(e);t=r[`Modules/${i}/urlParams`],t===void 0&&(t=n.Modules[i])}return t},menuBySide:e=>t=>e[t],secondaryMenuEnabled:(e,t)=>{let n=e.secondaryMenu?.sections;return Array.isArray(n)&&n.some((e,n)=>t?.sectionHasItems?t.sectionHasItems(`secondaryMenu`,n):Array.isArray(e)&&e.length>0||e&&Array.isArray(e.elements)&&e.elements.length>0)},zoomToExtentPadding:e=>{let t=e.mainMenu.expanded?e.currentMainMenuOffsetWidth:0;return[20,(e.secondaryMenu.expanded?e.currentSecondaryMenuOffsetWidth:0)+20,20,t+20]},sectionsBySide:e=>t=>e[t].sections},mutations:{...U(Ll),collapseMenues(e){e.mainMenu.expanded=!1,e.secondaryMenu.expanded=!1},mergeMenuState(e,{menu:t,side:n}){Object.assign(e[n],t)},setCurrentComponent(e,{type:t,side:n,props:r}){let i=e[n].navigation.history;if(i.push(e[n].navigation.currentComponent),i.length>0){let e=i[i.length-1];e.type===`getFeatureInfo`&&e.props?.name===`none`&&(i.pop(),i.length>1&&(e=i[i.length-1],e.type===t&&i.pop()))}e[n].navigation.currentComponent={type:t,props:r},e[n].currentComponent=t},setCurrentComponentProps(e,{side:t,props:n}){e[t].navigation.currentComponent.props=n},setCurrentComponentPropsName(e,{side:t,name:n}){e[t].navigation.currentComponent.props.name=n},setCurrentComponentPropsDescription(e,{side:t,description:n}){e[t].navigation.currentComponent.props.description=n},setCurrentMenuWidth(e,{side:t,width:n}){e[t].width=n},setExpandedBySide(e,{expanded:t,side:n}){e[n].expanded=t},switchToPreviousComponent(e,t){e[t].navigation.history.slice(-1)[0]?.type&&(e[t].navigation.currentComponent={type:e[t].navigation.history.slice(-1)[0].type,props:e[t].navigation.history.slice(-1)[0].props},e[t].currentComponent=e[t].navigation.history.slice(-1)[0].type),e[t].navigation.history.pop()},switchToRoot(e,t){e[t].navigation.currentComponent={props:[],type:`root`},e[t].navigation.history=[],e[t].currentComponent=`root`},setNavigationCurrentComponentBySide(e,{side:t,newComponent:n}){e[t].navigation.currentComponent=n},setNavigationHistoryBySide(e,{side:t,newHistory:n}){e[t].navigation.history=n},setCurrentComponentBySide(e,{side:t,type:n}){e[t].currentComponent=n},setSectionsBySide(e,{side:t,sections:n}){e[t].sections=n}},state:{...Ll}};y();var Hl={componentMap:()=>(moduleCollection={about:P(()=>b(()=>import(`./AboutModule.js`),__vite__mapDeps([0,1,2,3]),import.meta.url)),addWMS:P(()=>b(()=>import(`./AddWMS.js`),__vite__mapDeps([4,1,2,5]),import.meta.url)),bufferAnalysis:P(()=>b(()=>import(`./BufferAnalysis.js`),__vite__mapDeps([6,1,2]),import.meta.url)),contact:P(()=>b(()=>import(`./ContactFormular.js`),__vite__mapDeps([7,1,2,8,9,10]),import.meta.url)),coordToolkit:P(()=>b(()=>import(`./CoordToolkit.js`),__vite__mapDeps([11,1,2,8,9,12,13]),import.meta.url)),copyrightConstraints:P(()=>b(()=>import(`./CopyrightConstraints.js`),__vite__mapDeps([14,1,2,15]),import.meta.url)),compareFeatures:P(()=>b(()=>import(`./CompareFeatures.js`),__vite__mapDeps([16,1,2,17,18,19,20,21,22]),import.meta.url)),compareMaps:P(()=>b(()=>import(`./CompareMaps.js`),__vite__mapDeps([23,1,2,24]),import.meta.url)),customMenuElement:P(()=>b(()=>import(`./CustomMenuElement.js`),__vite__mapDeps([25,1,2]),import.meta.url)),draw:P(()=>b(()=>import(`./DrawModule.js`),__vite__mapDeps([26,1,2,27,28,29,30]),import.meta.url)),draw_old:P(()=>b(()=>import(`./DrawItem.js`),__vite__mapDeps([31,1,2,32]),import.meta.url)),featureLister:P(()=>b(()=>import(`./FeatureLister.js`),__vite__mapDeps([33,1,2,34,17,18,19,20,21,35]),import.meta.url)),fileImport:P(()=>b(()=>import(`./FileImport.js`),__vite__mapDeps([36,1,2,37]),import.meta.url)),filter:P(()=>b(()=>import(`./FilterGeneral.js`),__vite__mapDeps([38,2,1,8,9,18,19,20,39,40,41,42,43,44,45,46]),import.meta.url)),folder:P(()=>b(()=>import(`./MenuFolder.js`),__vite__mapDeps([47,1,2]),import.meta.url)),graphicalSelect:P(()=>b(()=>import(`./GraphicalSelect.js`).then(e=>e.n),__vite__mapDeps([34,2,1]),import.meta.url)),language:P(()=>b(()=>import(`./LanguageItem.js`),__vite__mapDeps([48,1,2,49]),import.meta.url)),layerClusterToggler:P(()=>b(()=>import(`./LayerClusterToggler.js`),__vite__mapDeps([50,1,2,51]),import.meta.url)),layerInformation:P(()=>b(()=>import(`./LayerInformation.js`),__vite__mapDeps([52,1,2,8,9,53,54,55]),import.meta.url)),layerPills:P(()=>b(()=>import(`./LayerPills.js`),__vite__mapDeps([56,1,2,57]),import.meta.url)),layerSelection:P(()=>b(()=>import(`./LayerSelection.js`),__vite__mapDeps([58,1,2,59]),import.meta.url)),layerSlider:P(()=>b(()=>import(`./LayerSlider.js`),__vite__mapDeps([60,1,2,61]),import.meta.url)),layerSwiper:P(()=>b(()=>import(`./LayerSwiper.js`),__vite__mapDeps([62,1,2,63]),import.meta.url)),legend:P(()=>b(()=>import(`./LegendContainer.js`),__vite__mapDeps([64,1,2,53,54,65]),import.meta.url)),login:P(()=>b(()=>import(`./LoginComponent.js`),__vite__mapDeps([66,1,2,67]),import.meta.url)),measure:P(()=>b(()=>import(`./MeasureInMap.js`),__vite__mapDeps([68,1,2,8,9,69]),import.meta.url)),modeler3D:P(()=>b(()=>import(`./Modeler3D.js`),__vite__mapDeps([70,1,2,8,9,27,71,72,28,29,73,12,74]),import.meta.url)),mouseHover:P(()=>b(()=>import(`./MouseHover.js`),__vite__mapDeps([75,1,2,76]),import.meta.url)),news:P(()=>b(()=>import(`./NewsView.js`),__vite__mapDeps([77,2,1,78]),import.meta.url)),openConfig:P(()=>b(()=>import(`./OpenConfig.js`),__vite__mapDeps([79,1,2,80]),import.meta.url)),portalFooter:P(()=>b(()=>import(`./PortalFooter.js`),__vite__mapDeps([81,1,2,82]),import.meta.url)),print:P(()=>b(()=>import(`./PrintMap.js`),__vite__mapDeps([83,1,2,84]),import.meta.url)),routing:P(()=>b(()=>import(`./RoutingTemplate.js`),__vite__mapDeps([85,1,2,86]),import.meta.url)),searchBar:P(()=>b(()=>Promise.resolve().then(()=>mR),void 0,import.meta.url)),scaleSwitcher:P(()=>b(()=>import(`./ScaleSwitcher.js`),__vite__mapDeps([87,1,2]),import.meta.url)),selectFeatures:P(()=>b(()=>import(`./SelectFeatures.js`),__vite__mapDeps([88,1,2,89]),import.meta.url)),shadow:P(()=>b(()=>import(`./ShadowTool.js`),__vite__mapDeps([90,2,1,41,42,91]),import.meta.url)),shareView:P(()=>b(()=>import(`./ShareView.js`),__vite__mapDeps([92,2,1,93,94]),import.meta.url)),statisticDashboard:P(()=>b(()=>import(`./StatisticDashboard.js`),__vite__mapDeps([95,2,1,8,9,20,17,18,19,21,96,39,43,44,97,98,99,46]),import.meta.url)),styleVT:P(()=>b(()=>
2import(`./StyleVT.js`),__vite__mapDeps([100,1,2]),import.meta.url)),wfsSearch:P(()=>b(()=>import(`./WfsSearch.js`).then(e=>e.n),__vite__mapDeps([101,2,1,17,18,19,20,21,102]),import.meta.url)),wfst:P(()=>b(()=>import(`./WfsTransaction.js`),__vite__mapDeps([103,1,2,71,72,104]),import.meta.url)),wmsTime:P(()=>b(()=>import(`./WmsTime.js`),__vite__mapDeps([105,2,1,62,63,106]),import.meta.url)),...moduleCollection},moduleCollection)},Ul={description:`common:modules.addWMS.description`,type:`addWMS`,name:`common:modules.addWMS.name`,icon:`bi-cloud-plus`,supportedDevices:[`Desktop`,`Mobile`,`Table`],supportedMapModes:[`2D`,`3D`],exampleURLs:[],featureCount:void 0,visibility:!1,showInLayerTree:!1},Wl={...H(Ul)},Gl={...U(Ul)},Kl={namespaced:!0,state:{...Ul},mutations:Gl,getters:Wl},ql={active:!1,activatedExpandable:!1,visibleBaselayerIds:[],baselayers:[],configPaths:[`portalConfig.map.baselayerSwitcher`],singleBaseLayer:!1,topBaselayer:null,type:`baselayerSwitcher`},Jl={...U(ql)},Yl={...H(ql),filteredBaseLayers:e=>{if(!e.visibleBaselayerIds.length)return e.baselayers;let t=e.baselayers.filter(t=>e.visibleBaselayerIds.includes(t.id));return t.length===0&&console.warn(`visibleBaselayerIds is set to "${e.visibleBaselayerIds}" but no baselayers match the filter. Please check if the provided IDs are correct.`),t}};function Xl(e,t,n){e&&t.length>=1&&t.forEach(e=>{n.push({id:e.id,layer:{id:e.id,visibility:!1}})})}var Zl={checkAndAdd:Xl},Ql={namespaced:!0,state:ql,mutations:Jl,getters:Yl,actions:{updateLayerVisibilityAndZIndex({dispatch:e,rootGetters:t},n){let r=[],i=_r.getLayerWithMaxZIndex(t.layerConfigsByAttributes({baselayer:!0,showInLayerTree:!0}))?.zIndex??-1/0,a=i+1,o=t.determineZIndex(n);t.isBaselayer(n)&&(e(`updateLayerConfigZIndex`,{layerContainer:t.layerConfigsByAttributes({showInLayerTree:!0}),maxZIndex:i},{root:!0}),o=a++,Zl.checkAndAdd(t.singleBaselayer,t.visibleBaselayerConfigs,r)),r.push({id:n,layer:{id:n,visibility:!0,showInLayerTree:!0,zIndex:o}}),e(`replaceByIdInLayerConfig`,{layerConfigs:r},{root:!0})}}},$l={OUTSIDE:0,WITHIN:1},eu=t({applyBufferRadius:()=>ru,applySelectedSourceLayer:()=>tu,applySelectedTargetLayer:()=>nu});function tu({getters:e,commit:t,dispatch:n},r){e.selectedTargetLayer&&(e.selectedTargetLayer.visibility=!1,t(`setSelectedTargetLayer`,null));let i=typeof r==`string`?e.selectOptions.find(e=>e.id===r):r;if(i)e.selectOptions.forEach(e=>{i.id===e.id?n(`replaceByIdInLayerConfig`,{layerConfigs:[{id:e.id,layer:{id:e.id,visibility:!0,opacity:1}}]},{root:!0}):n(`replaceByIdInLayerConfig`,{layerConfigs:[{id:e.id,layer:{id:e.id,visibility:!1}}]},{root:!0})});else if(i!==null)throw Error(i18next.t(`common:modules.bufferAnalysis.sourceLayerNotFound`,{layerId:r}));t(`setSelectedSourceLayer`,i),e.bufferRadius&&i&&n(`Maps/areLayerFeaturesLoaded`,i.id,{root:!0}).then(()=>{n(`removeGeneratedLayers`),n(`showBuffer`)})}function nu({commit:e,getters:t,dispatch:n},r){let i=typeof r==`string`?t.selectOptions.find(e=>e.id===r):r;if(e(`setSelectedTargetLayer`,i),i)n(`replaceByIdInLayerConfig`,{layerConfigs:[{id:i.id,layer:{id:i.id,visibility:!0}}]},{root:!0}),n(`checkIntersection`);else if(i!==null)throw Error(i18next.t(`common:modules.bufferAnalysis.targetLayerNotFound`,{layerId:r}))}function ru({commit:e,dispatch:t},n){e(`setBufferRadius`,n),n&&(t(`removeGeneratedLayers`),t(`showBuffer`))}var iu=t({initJSTSParser:()=>au,loadSelectOptions:()=>ou});function au({getters:e}){e.jstsParser.inject(r,sn,bt,Xe,l,Ge,Fn)}function ou({commit:e,rootGetters:t,getters:n}){let r=[];t.allSubjectDataLayerConfigs.forEach(e=>{e.typ===`WFS`&&r.push(e)}),r.forEach(t=>{n.selectOptions.includes(t)||e(`addSelectOption`,t)})}var su={...iu,...eu,checkIntersection({dispatch:e,getters:{selectedTargetLayer:t,bufferLayer:n}}){e(`Maps/areLayerFeaturesLoaded`,t.id,{root:!0}).then(()=>{let t=n.getSource().getFeatures();e(`checkIntersectionWithBuffers`,t).then(e(`checkIntersectionsWithIntersections`,t)).then(e(`convertIntersectionsToPolygons`)).then(e(`addNewFeaturesToMap`))})},showBuffer({dispatch:e,commit:t,getters:{selectedSourceLayer:n,jstsParser:r,bufferRadius:i,bufferStyle:a}}){let o=W.getLayerById(n.id)?.getLayerSource().getFeatures()||[],s=new Pe,c=new Rt({id:`buffer_layer`,source:s,alwaysOnTop:!0,zIndex:10});
2t(`setBufferLayer`,c),o.forEach(e=>{let t=r.read(e.getGeometry()),n=Ee.bufferOp(t,i),o=new V({geometry:r.write(n),name:`Buffers`});o.setStyle(a),o.set(`originFeature`,e),s.addFeature(o)}),e(`Maps/addLayer`,c,{root:!0})},removeGeneratedLayers({commit:e,rootState:t,getters:{bufferLayer:n}}){e(`setResultLayer`,{}),n?.ol_uid&&mapCollection.getMap(t.Maps.mode).getLayers().forEach(e=>{e?.ol_uid===n.ol_uid&&mapCollection.getMap(t.Maps.mode).removeLayer(e)}),e(`setBufferLayer`,{}),e(`setIntersections`,[]),e(`setResultFeatures`,[])},resetModule({commit:e,dispatch:t,getters:{selectedSourceLayer:n,selectedTargetLayer:r}}){n&&(n.opacity=1,n.visibility=!1),r&&(r.opacity=1,r.visibility=!1),t(`applySelectedSourceLayer`,null),t(`applySelectedTargetLayer`,null),t(`removeGeneratedLayers`),e(`setSavedUrl`,null),e(`setInputBufferRadius`,0)},checkIntersectionWithBuffers({commit:e,dispatch:t,getters:{selectedTargetLayer:n,jstsParser:r,resultType:i}},a){(W.getLayerById(n.id)?.getLayerSource().getFeatures()||[]).forEach(n=>{let o=n.getGeometry(),s=a.some(e=>{let a=e.getGeometry(),s=e.get(`originFeature`).getId()===n.getId(),c=r.read(a),l=r.read(o);return o.getType()===`Point`&&a.intersectsCoordinate(o.getCoordinates())&&!s?!0:c?.intersects(l)&&!s?(t(`generateIntersectionPolygon`,{properties:n.getProperties(),sourcePoly:c,targetPoly:l}),i!==$l.WITHIN):!1});(!s&&i===$l.OUTSIDE||s&&i===$l.WITHIN)&&e(`addResultFeature`,n)})},generateIntersectionPolygon({commit:e,getters:{resultType:t}},{sourcePoly:n,targetPoly:r,properties:i={}}){let a=t===$l.WITHIN?n.intersection(r):r.difference(n);a.properties=i,e(`addIntersectionPolygon`,a)},checkIntersectionsWithIntersections({dispatch:e,getters:{intersections:t,jstsParser:n}},r){r.forEach(r=>{t.forEach(t=>{let i=r.getGeometry(),a=n.read(i);a.intersects(t)&&e(`generateIntersectionPolygon`,{properties:t.properties,sourcePoly:a,targetPoly:t})})})},convertIntersectionsToPolygons({commit:e,getters:{intersections:t,geoJSONWriter:n}}){t.length&&t.forEach(t=>{e(`addResultFeature`,new dn().readFeature({type:`Feature`,properties:t.properties,geometry:n.write(t)}))})},addNewFeaturesToMap({commit:e,dispatch:t,getters:{resultFeatures:n,selectedTargetLayer:r,selectedSourceLayer:i,bufferLayer:a}}){if(n.length){let i=new Pe,a=r.gfiAttributes,o=new Rt({id:`result_layer`,source:i,style:r.style,alwaysOnTop:!0});e(`setResultLayer`,o),i.addFeatures(n),o.set(`gfiAttributes`,a),t(`Maps/addLayer`,o,{root:!0})}let o=W.getLayerById(r.id),s=W.getLayerById(i.id);o.layer.setOpacity(o.layer.getOpacity()*.5),s.layer.setOpacity(s.layer.getOpacity()*.5),a.setOpacity(.5)},applyValuesFromSavedUrlBuffer({rootState:e,state:t,dispatch:n,commit:r}){let i=e.urlParams?.MENU,a=e.urlParams?.ISINITOPEN,o=e.urlParams?.INITVALUES;try{if(i){let e;e=typeof i==`string`?JSON.parse(i):i;let a=e?.secondary,o=a?.attributes;if(o&&a?.currentComponent===`bufferAnalysis`){let e=t.selectOptions.find(e=>e.id===o.source),i=t.selectOptions.find(e=>e.id===o.target),a=Number(o.radius),s=Number(o.result);e&&n(`applySelectedSourceLayer`,e),a&&(r(`setInputBufferRadius`,a),n(`applyBufferRadius`,a)),s!==void 0&&r(`setResultType`,s),i&&n(`applySelectedTargetLayer`,i);return}}if(a===`bufferAnalysis`&&o){let e=JSON.parse(o),i=t.selectOptions.find(t=>t.id===e.applySelectedSourceLayer),a=t.selectOptions.find(t=>t.id===e.applySelectedTargetLayer),s=Number(e.applyBufferRadius),c=Number(e.setResultType);i&&n(`applySelectedSourceLayer`,i),s&&(r(`setInputBufferRadius`,s),n(`applyBufferRadius`,s)),c!==void 0&&r(`setResultType`,c),a&&n(`applySelectedTargetLayer`,a)}}catch(e){console.error(`Failed to apply bufferAnalysis values from URL:`,e),n(`Alerting/addSingleAlert`,{category:`error`,content:i18next.t(`common:modules.bufferAnalysis.error`)},{root:!0})}}},cu={description:`common:modules.bufferAnalysis.description`,icon:`bi-arrows-angle-expand`,name:`common:modules.bufferAnalysis.name`,type:`bufferAnalysis`,supportedDevices:[`Desktop`,`Mobile`,`Table`],supportedMapModes:[`2D`,`3D`],bufferLayer:{},bufferRadius:0,bufferStyle:new T({fill:new S({color:[`255`,`230`,`65`,`0.3`]}),stroke:new x({color:[`255`,`50`,`0`,`0.5`],width:2})}),geoJSONWriter:new m,inputBufferRadius:0,intersections:[],jstsParser:new _,resultFeatures:[],resultLayer:{},resultType:$l.OUTSIDE,savedUrl:null,selectOptions:[],selectedSourceLayer:null,selectedTargetLayer:null,timerId:null},lu={namespaced:!0,state:cu,mutations:{...U(cu),addResultFeature(e,t){e.resultFeatures.push(t)},addIntersectionPolygon(e,t){e.intersections.push(t)},addSelectOption(e,t){e.selectOptions.push(t)}}
2,actions:su,getters:{...H(cu),urlParams:e=>({type:e.type,name:e.name,icon:e.icon})}},uu={description:`common:modules.contact.description`,name:`common:modules.contact.name`,icon:`bi-envelope`,from:[],serviceId:null,to:[],closeAfterSend:!0,contactInfo:``,deleteAfterSend:!0,includeSystemInfo:!1,locationOfCustomerService:`de`,maxLines:5,showPrivacyPolicy:!1,privacyPolicyLink:`https://www.masterportal.org/datenschutz.html`,subject:``,withTicketNo:!0,mail:``,message:``,privacyPolicyAccepted:!1,phone:``,username:``,supportedDevices:[`Desktop`,`Mobile`,`Table`],supportedMapModes:[`2D`,`3D`],type:`contact`,fileUpload:!1,fileArray:[],maxFileSize:1*1024*1024,maxSumFileSize:6*1024*1024,configuredFileExtensions:[],infoMessage:``};function du(e){let t=``;return t+=`<br>`,t+=`==================<br>`,t+=`Referrer: <a href="${e.referrer}">${e.portalTitle}</a><br>`,t+=`Platform: ${e.platform}<br>`,t+=`Cookies enabled: ${e.cookieEnabled}<br>`,t+=`UserAgent: ${e.userAgent}<br>`,t}function fu({username:e,mail:t,phone:n,message:r},i,a){let o=``;return o+=`Name: ${e}<br>`,o+=`E-Mail: ${t}<br>`,o+=`Tel.:: ${n}<br>`,o+=`==================<br>`,o+=`${r}<br>`,o+=i?`${du(i)}`:``,a&&(o+=`==================<br>`,o+=`${a}`),o}function pu(e,t){return e?`${e}: ${t}`:t}function mu(e=`de`){let t=(0,G.default)().locale(e).format(`MMDD`),n=String(Math.floor(Math.random()*9e3)+1e3),r=String(Math.floor(Math.random()*9e3)+1e3);return t+`-`+n+`-`+r}function hu(e,t=``){if(typeof e!=`object`||!e)return(t?encodeURIComponent(t)+`=`:``)+encodeURIComponent(e);let n=``;return Object.keys(e).forEach(r=>{n&&(n+=`&`),n+=hu(e[r],t?t+`[`+r+`]`:r)}),n}function gu(e,t,n,r){B.post(e,hu(t)).then(e=>{e.status!==200||Object.prototype.hasOwnProperty.call(e.data,`success`)&&e.data.success===!1?(console.error(`An error occurred sending an email. Server response: ${e.data.message}`),console.error(e),r()):n()}).catch(e=>{console.error(`An error occurred sending an email.`),console.error(e),r()})}var _u={httpClient:gu};function vu(e){let{platform:t,cookieEnabled:n,userAgent:r}=navigator;return{portalTitle:e||document.title,referrer:window.location.href,platform:t,cookieEnabled:!!n,userAgent:r}}var yu={onSendSuccess:({state:e,commit:t,dispatch:n,rootGetters:r},i)=>{let{closeAfterSend:a,deleteAfterSend:o,withTicketNo:s}=e,c=i18next.t(`common:modules.contact.successMessage`);if(s&&i&&(c+=`\r 3`,c+=i18next.t(`common:modules.contact.successTicket`),c+=i),n(`Alerting/addSingleAlert`,{category:`success`,content:c},{root:!0}),t(`setPrivacyPolicyAccepted`,!1),o&&(t(`setMail`,``),t(`setMessage`,``),t(`setPhone`,``),t(`setUsername`,``)),a){let n=`Menu/currentComponent`;r[n](`mainMenu`).type===e.type?t(`Menu/switchToRoot`,`mainMenu`,{root:!0}):r[n](`secondaryMenu`).type===e.type&&t(`Menu/switchToRoot`,`secondaryMenu`,{root:!0})}},showWarningAlert({dispatch:e},t){e(`Alerting/addSingleAlert`,{category:`warning`,content:i18next.t(t)},{root:!0})},send:({state:e,dispatch:t,getters:n,rootGetters:r},i)=>{let{to:a,withTicketNo:o,includeSystemInfo:s,subject:c,mailOriginHint:l}=i?.noConfigProps?i:e,u=e.serviceId||e.serviceID,d=vu(r.portalTitle),f=r.restServiceById(u).url,p=o?mu(e.locationOfCustomerService):``,m=e.from;if(!n.validForm){console.warn(`An error occurred sending an email: send with incorrect fields aborted`),t(`showWarningAlert`,`common:modules.contact.errorIncompleteDeclarations`);return}if(!f){console.warn(`"An error occurred sending an e-mail: serviceId ${u} is unknown.`),t(`showWarningAlert`,`common:modules.contact.error.message`);return}_u.httpClient(f,{from:m,to:a,subject:pu(p,c||i18next.t(`common:modules.contact.mailSubject`)+d.portalTitle),text:fu(e,s?d:null,l??null),attachment:e.fileArray},()=>t(`onSendSuccess`,p),()=>t(`showWarningAlert`,`common:modules.contact.error.message`))}},bu=/^.+@.+\..+$/,xu=/^[+]*[(]{0,1}[0-9]{1,4}[)]{0,1}[-\s./0-9]*$/,Su=/.+/,Cu={namespaced:!0,state:uu,actions:yu,getters:{...H(uu),validForm:({showPrivacyPolicy:e,privacyPolicyAccepted:t},{validMail:n,validMessage:r,validPhone:i,validUsername:a})=>(!e||t)&&n&&r&&i&&a,validMail:({mail:e})=>bu.test(e),validMessage:({message:e})=>e.length>=10,validPhone:({phone:e})=>xu.test(e),validUsername:({username:e})=>Su.test(e)},mutations:{...U(uu),togglePrivacyPolicyAccepted:e=>{e.privacyPolicyAccepted=!e.privacyPolicyAccepted}}},wu={icon:`bi-vr`,description:`common:modules.compareMaps.description`,hasMouseMapInteractions:!0,name:`common:modules.compareMaps.name`,supportedDevices:[`Desktop`,`Mobile`,`Table`],supportedMapModes:[`2D`],type:`compareMaps`,active:!1,selectedLayer1Id:``,selectedLayer2Id:``},Tu={...H(wu)},Eu={...U(wu)};function Du(e){e?._onPrerenderListener&&(e.getLayer().un(`prerender`,e._onPrerenderListener),delete e._onPrerenderListener),e?._onPostrenderListener&&(e.getLayer().un(`postrender`,e._onPostrenderListener),delete e._onPostrenderListener)}var Ou={activateSwiper({state:e,commit:t,rootGetters:n}){let r=W.getLayers().find(t=>t.get(`id`)===e.selectedLayer1Id),i=W.getLayers().find(t=>t.get(`id`)===e.selectedLayer2Id);if(!r||!i){console.error(`Cannot activate swiper: One or both layers not found`);return}ku(r,!1,n[`Modules/WmsTime/layerAppendix`]),ku(i,!0,n[`Modules/WmsTime/layerAppendix`]),t(`Modules/LayerSwiper/setActive`,!0,{root:!0}),t(`Modules/LayerSwiper/setSourceLayerId`,e.selectedLayer1Id,{root:!0}),t(`Modules/LayerSwiper/setTargetLayerId`,e.selectedLayer2Id,{root:!0})},deactivateSwiper({state:e,commit:t,dispatch:n}){n(`resetLayer`,e.selectedLayer1Id),n(`resetLayer`,e.selectedLayer2Id),t(`Modules/LayerSwiper/setActive`,!1,{root:!0}),t(`Modules/LayerSwiper/setSourceLayerId`,``,{root:!0}),t(`Modules/LayerSwiper/setTargetLayerId`,``,{root:!0})},resetLayer({rootGetters:e},t){if(!t)return;let n=W.getLayerById(t);ku(n,!1,e[`Modules/WmsTime/layerAppendix`]),Du(n)}};function ku(e,t,n){if(!e)return;let r=e.getLayer().get(`id`);t&&!r.endsWith(n)?e.getLayer().set(`id`,r+n):!t&&r.endsWith(n)&&e.getLayer().set(`id`,r.replace(n,``))}var Au={namespaced:!0,state:wu,mutations:Eu,actions:Ou,getters:Tu},ju={isFeatureOnCompareList:function({state:e,commit:t,dispatch:n,getters:r},i){let{layerId:a}=i;if(t(`setListFull`,!1),!r.isFeatureSelected(i)&&e.layerFeatures[a]===void 0||e.layerFeatures[a].length<e.numberOfFeaturesToShow){t(`addFeatureToLayer`,i),t(`setCurrentFeatureName`,i.properties.Name||i.properties.name),t(`setSelectedLayerId`,i.layerId);for(let t of e.layerFeatures[a])n(`prepareFeatureListToShow`,t)}else n(`Alerting/addSingleAlert`,{category:`info`,content:i18next.t(`common:modules.compareFeatures.feedback.limitReached`)},{root:!0}),t(`setListFull`,!0)},removeFeature:function({state:e,commit:t},{idFeature:n,idLayer:r}
3){t(`removeFeatureFromLists`,{features:e.hasMultipleLayers?e.preparedList[r]:e.preparedList[Object.keys(e.preparedList)[0]],featureId:n,selectedLayerId:r})},prepareFeatureListToShow:function({state:e,commit:t},n){let r=[],i=n.layerId,a=e.layerFeatures[i],o=[],s=[],c=[],l={},u=``,d={},f=!0;Object.values(a).forEach(e=>{o.push(Object.keys(e.properties).length)}),u=o.indexOf(Math.max(...o)),Object.keys(a[u].properties).forEach(function(e,t){e.includes(`id`)&&(f=!1);let n={"row-1":e},i={name:e,order:`origin`,index:t,visible:f};a.forEach(function(t){n[t.featureId]=t.properties[e]}),r.push(n),s.push(i)}),a.forEach(function(e){e.properties.id=e.featureId,e.properties.idLayer=e.layerId,c.push(e.properties)}),d={headers:s,items:c},l={layerId:i,list:r,tableData:d},t(`setHasFeatures`,!0),t(`setList`,l)}},Mu={name:`common:modules.compareFeatures.title`,hasMouseMapInteractions:!1,description:`common:modules.compareFeatures.description`,icon:`bi-star`,supportedDevices:[`Desktop`,`Mobile`,`Table`],supportedMapModes:[`2D`,`3D`],type:`compareFeatures`,numberOfAttributesToShow:50,numberOfFeaturesToShow:3,id:`compareFeatures`,layerFeatures:{},selectedLayerId:``,currentFeatureName:``,listFull:!1,hasFeatures:!1,layerWithFeaturesToShow:[],hasMultipleLayers:!1,preparedList:{},preparedListDisplayTable:{}},Nu={...U(Mu),addFeatureToLayer:(e,t)=>{let{layerId:n}=t;e.layerFeatures={...e.layerFeatures,[n]:[...e.layerFeatures[n]||[],t]},Object.keys(e.layerFeatures).length>1&&(e.hasMultipleLayers=!0)},removeFeatureFromDisplayList(e,t,n){for(let r=0;r<e.preparedListDisplayTable[t]?.items?.length;r++)if(e.preparedListDisplayTable[t].items[r].id===n){e.preparedListDisplayTable[t].items.splice(r,1),e.preparedListDisplayTable[t]?.items?.length===0&&delete e.preparedListDisplayTable[t];break}},removeFeatureFromListSingleLayer(e,t){let n=Object.keys(e.layerFeatures)[0];for(let r of e.layerFeatures[n])if(r.featureId===t){let t=e.layerFeatures[r.layerId].indexOf(r);e.layerFeatures[r.layerId].splice(t,1),e.preparedList={...e.preparedList,[n]:e.layerFeatures[n].map(e=>Object.keys(e.properties).map(t=>({"row-1":t,[e.featureId]:e.properties[t]}))).flat()},e.layerFeatures[n].length===0&&(delete e.preparedList[n],delete e.layerFeatures[n])}},removeFeatureFromListMultipleLayers(e,t,n,r){for(let i of e.layerFeatures[t]){if(i.featureId===n){let n=e.layerFeatures[t].indexOf(i);e.layerFeatures[t].splice(n,1),e.preparedList={...e.preparedList,[t]:[...r]}}e.layerFeatures[t].length===0&&(delete e.preparedList[t],delete e.layerFeatures[t],e.selectedLayerId=Object.keys(e.layerFeatures)[0])}},removeFeatureFromLists(e,t){let{featureId:n,features:r,selectedLayerId:i}=t;for(let e of r)Object.keys(e).includes(n)&&delete e[n];Nu.removeFeatureFromDisplayList(e,i,n),e.hasMultipleLayers?Nu.removeFeatureFromListMultipleLayers(e,i,n,r):Nu.removeFeatureFromListSingleLayer(e,n),Object.keys(e.layerFeatures).length<=1&&(e.hasMultipleLayers=!1),Object.keys(e.layerFeatures).length===0&&(e.hasFeatures=!1)},selectLayerWithFeatures:(e,t)=>{e.layerWithFeaturesToShow=[e.layerFeatures[t]],e.selectedLayerId=t},resetLayerSelection:e=>{Object.keys(e.layerFeatures).length<=1&&(e.hasMultipleLayers=!1)},setList:(e,t)=>{let n=t.layerId,r=t.list,i=t.tableData;e.preparedList[n]=r,e.preparedListDisplayTable[n]=i}},Pu={namespaced:!0,state:Mu,mutations:Nu,actions:ju,getters:{...H(Mu),isFeatureSelected:e=>({featureId:t,layerId:n})=>{if(Object.prototype.hasOwnProperty.call(e.layerFeatures,n)){for(let r of e.layerFeatures[n])if(r.featureId===t)return!0}return!1},selectableLayers:e=>{let t=[];return Object.keys(e.layerFeatures).forEach(n=>{e.layerFeatures[n][0]&&t.push(e.layerFeatures[n][0])}),t}}},Fu={icon:`bi-globe`,description:`common:modules.coordToolkit.description`,hasMouseMapInteractions:!0,name:`common:modules.coordToolkit.name`,supportedDevices:[`Desktop`,`Mobile`,`Table`],supportedMapModes:[`2D`,`3D`],type:`coordToolkit`,coordinatesEasting:{id:`easting`,value:``},coordinatesNorthing:{id:`northing`,value:``},coordinatesEastingExample:``,coordinatesNorthingExample:``,coordInfo:null,currentProjection:{id:`http://www.opengis.net/gml/srs/epsg.xml#25832`,name:`EPSG:25832`,projName:`utm`},delimiter:`|`,eastingNoCoord:!1,eastingNoMatch:!1,height:`common:modules.coordToolkit.hintSupply`,heightElementName:null,heightInfoFormat:`application/vnd.ogc.gml`,heightLayer:null,heightLayerId:null,heightLayerInfo:null,heightValueBuilding:null,heightValueWater:null,keepMarkerVisible:!1,mapProjection:null,mode:`supply`,northingNoCoord:!1,northingNoMatch:!1,positionMapProjection:[],projections:[],showCopyButtons:!0,selectedCoordinates:[],selectPointerMove:null,updatePosition:!0,zoomLevel:7},Iu={...H(Fu),getTransformedPosition:e=>(t,n)=>
3{let r=[0,0];return e.positionMapProjection!==null&&e.positionMapProjection.length>0&&(r=j.transformFromMapProjection(t,n,[...e.positionMapProjection])),r},getProjectionById:e=>t=>e.projections.find(e=>e.id===t),getEastingError:e=>!!(e.eastingNoCoord||e.eastingNoMatch),getNorthingError:e=>!!(e.northingNoCoord||e.northingNoMatch),getLabel:e=>t=>{let n=e.currentProjection?.projName,r;switch(n){case`longlat`:r=`hdms`;break;case`utm`:r=`utm`;break;case`tmerc`:r=`cartesian`;break;default:r=`cartesian`}return`common:modules.coordToolkit.`+r+`.`+t}},Lu={...U(Fu),setProjections:(e,t=[])=>{if(t.filter(t=>t.id===e.currentProjection?.id).length===0){let n=t.find(e=>e.name.indexOf(`25832`)>-1);if(n){let e=t.indexOf(n);t.splice(e,1),t.unshift(n)}e.currentProjection=t[0]}e.projections=t},setExample(e){e.currentProjection&&(e.currentProjection.id===`http://www.opengis.net/gml/srs/epsg.xml#4326`?(e.coordinatesEastingExample=`53° 33â² 25â³`,e.coordinatesNorthingExample=`9° 59â² 50â³`):e.currentProjection.id===`http://www.opengis.net/gml/srs/epsg.xml#4326-DG`?(e.coordinatesEastingExample=`53.55555°`,e.coordinatesNorthingExample=`10.01234°`):e.currentProjection.id===`http://www.opengis.net/gml/srs/epsg.xml#ETRS893GK3`?(e.coordinatesEastingExample=`3564459.13`,e.coordinatesNorthingExample=`5935103.67`):(e.coordinatesEastingExample=`564459.13`,e.coordinatesNorthingExample=`5935103.67`))},resetErrorMessages:(e,t)=>{t===`northing`?(e.northingNoCoord=!1,e.northingNoMatch=!1):t===`easting`?(e.eastingNoCoord=!1,e.eastingNoMatch=!1):t===`all`&&(e.eastingNoCoord=!1,e.eastingNoMatch=!1,e.northingNoCoord=!1,e.northingNoMatch=!1)},resetValues:e=>{e.coordinatesEasting.value=``,e.coordinatesNorthing.value=``},pushCoordinates:(e,t)=>{e.selectedCoordinates.push(t)}};function Ru(e){return typeof e==`string`?zu(e):Array.isArray(e)?Bu(e):{easting:`No value`,northing:`No value`}}function zu(e){let t=e.replace(`E`,``),n=t.indexOf(`N`)>-1?t.split(`N`):t.split(`S`),r,i,a,o,s=null,c=null,l=null,u=null,d=null,f=null,p=null,m=null,h=null,g=null;return n.length===2&&(r=n[0],i=n[1].substring(0,n[1].length-1),r.indexOf(`â²`)===-1&&(r+=` 00â²`),i.indexOf(`â²`)===-1&&(i+=` 00â²`),r.indexOf(`â³`)===-1&&(r+=` 00â³`),i.indexOf(`â³`)===-1&&(i+=` 00â³`)),a=r.trim().split(` `),o=i.trim().split(` `),a=a.map(e=>e.trim()),o=o.map(e=>e.trim()),s=Number(a[0].substring(0,a[0].length-1)),c=Number(o[0].substring(0,o[0].length-1)),l=Number(a[1].substring(0,a[1].length-1))/60,u=Number(o[1].substring(0,o[1].length-1))/60,d=Number(a[2].substring(0,a[2].length-1))/3600,f=Number(o[2].substring(0,o[2].length-1))/3600,p=s+l+d,m=c+u+f,h=p.toFixed(4)+`°`,g=m.toFixed(4)+`°`,{easting:h,northing:g}}function Bu(e){let t=e[0],n=Number(t[0])+Number(t[1]?t[1]:0)/60+Number(t[2]?t[2]:0)/60/60,r=e[1];return[Number(r[0])+Number(r[1]?r[1]:0)/60+Number(r[2]?r[2]:0)/60/60,n]}function Vu(e){if(typeof e!=`string`)return{easting:`No value`,northing:`No value`};let t=e.replace(/E/gi,``),n=-1,r=-1,i=`No value`,a=`No value`,o=e.indexOf(`N`)>-1?t.split(`N`):t.split(`S`);return o.length===2?(i=o[0].trim(),a=o[1].substring(0,o[1].length-1).trim(),i.indexOf(`â²`)===-1&&(i+=` 00â²`),a.indexOf(`â²`)===-1&&(a+=` 00â²`),i.indexOf(`â³`)===-1&&(i+=` 00â³`),a.indexOf(`â³`)===-1&&(a+=` 00â³`)):(t=t.replace(/N/gi,``),t=t.replace(/S/gi,``),n=t.indexOf(`â³`),r=t.indexOf(`â³`,n+1),n>-1?(i=t.substring(0,n+1).trim(),a=t.substring(n+2,r+1).trim()):(i=`No value`,a=`No value`)),{easting:i,northing:a}}function Hu(e){let t=Math.abs(e),n=Math.floor(t),r=(t-n)*60,i=Math.floor(r),a=Math.floor((r-i)*60);return n+`° `+i+`â² `+a+`â³`}function Uu(e,t,n){let r=n.get(`id`);return B({method:`get`,withCredentials:!!($.getters.layerConfigById(r)||jt.getLayerWhere({id:r}))?.isSecured,url:t}).then(e=>Qc(e,`requestGfi`)).then(t=>{let n=null;if(e===`text/xml`)n=Wu(t,e);else if(e===`text/html`)return n=Wu(t,e),n.childNodes.length>0&&(!n.getElementsByTagName(`body`)[0]||n.getElementsByTagName(`body`)[0].children.length>0)&&(!n.getElementsByTagName(`tbody`)[0]||n.getElementsByTagName(`tbody`)[0].children.length>0)?t:null;else e===`application/json`&&(n=t);return n}).then(t=>
3e===`text/xml`?Gu(t):t).catch(e=>{throw e})}function Wu(e,t,n=null){let r=new DOMParser,i=typeof n==`function`?n(e,t):r.parseFromString(e,t),a=null,o=null;if(typeof i!=`object`||!i||!(i instanceof Document)&&i.constructor.name!==`XMLDocument`)throw Error(`requestGfi, checkParsingProcess: the received doc is no valid Document nor XMLDocument`);if(o=i.getElementsByTagName(`parsererror`),o instanceof HTMLCollection&&o.length>0){for(a of o)console.warn(`requestGfi, parseDocumentString: parsererror`,a);throw Error(`requestGfi, parseDocumentString: the parsererror has reported a problem`)}return i}function Gu(e){let t=e.firstChild.tagName,n=`http://www.opengis.net/gml`,r=[],i=null,a=null;return t.includes(`FeatureCollection`)||t.includes(`msGMLOutput`)?(r=Ku(e),i=e.getElementsByTagNameNS(n,`Box`),i.length===1&&r.length>1&&(a=i[0].getElementsByTagNameNS(n,`coordinates`)[0],r.unshift(String(a.innerHTML).split(/[, ]/)))):r=t.includes(`GetFeatureInfoResponse`)?Ju(e):qu(e),r}function Ku(e){return new ne().readFeatures(e)}function qu(e){let t=[];for(let n of e.getElementsByTagName(`FIELDS`)){let e=new V;for(let t of n.attributes)e.set(t.localName,t.value);t.push(e)}return t}function Ju(e){let t=[];for(let n of e.getElementsByTagName(`Feature`)){let e=new V;for(let t of n.children)if(t.tagName===`Attribute`){let n=t.attributes?.name?.value,r=t.attributes?.value?.value;n&&r!==void 0&&e.set(n,r)}t.push(e)}return t}y();function Yu(e){let t={};this.attributes=Object.assign(t,e),this.createLayer(this.attributes)}Yu.prototype.createLayer=function(){console.warn(`Function Layer: 'createLayer' must be overwritten in extended layers!`)},Yu.prototype.createLegend=function(){console.warn(`Function Layer: 'createLegend' must be overwritten in extended layers!`)},Yu.prototype.updateLayerValues=function(){console.warn(`Function Layer: 'updateLayerValues' must be overwritten in extended layers!`)},Yu.prototype.visibilityChanged=function(){},Yu.prototype.get=function(e){return this.attributes[e]},Yu.prototype.getLayer=function(){return this.layer},Yu.prototype.set=function(e,t){this.attributes[e]=t},Yu.prototype.setLayer=function(e){this.layer=e&&n(e)},Yu.prototype.inspectLegendUrl=function(){let e=this.get(`legend`)===void 0||this.get(`legend`);return this.get(`legendURL`)!==void 0&&(this.get(`legendURL`)===``?e=!0:this.get(`legendURL`)===`ignore`?e=!1:(e=this.get(`legendURL`),e=Array.isArray(e)?e:[e])),e};function Xu(e){let t={transparency:0};this.attributes=Object.assign(t,e),Yu.call(this,this.attributes),this.setLayerSource(this.getLayer()?.getSource()),this.controlAutoRefresh(e),this.addErrorListener(this.getLayerSource()),this.autoRefreshObserver=[]}Xu.prototype=Object.create(Yu.prototype),Xu.prototype.controlAutoRefresh=function(e){let t=e?.autoRefresh;(typeof t==`number`||typeof t==`string`)&&(e.visibility&&this.getIntervalAutoRefresh()===void 0?this.startAutoRefresh(parseInt(t,10)):e.visibility||this.stopAutoRefresh())},Xu.prototype.setObserverAutoInterval=function(e){typeof e==`function`&&this.autoRefreshObserver.push(e)};function Zu(e,t){try{let n=new URL(e,window.location.href);return n.searchParams.set(`_refresh`,t),n.href}catch{return`${e}${e.includes(`?`)?`&`:`?`}_refresh=${t}`}}Xu.prototype.startAutoRefresh=function(e){this.setIntervalAutoRefresh(setInterval(()=>{let e=this.getLayer()?.getSource(),t=e instanceof Re?e.getSource():e;t&&(this.prepareLayerSourceForRefresh(t),t.once(`featuresloadend`,()=>{this.autoRefreshObserver.forEach(e=>e())}),t.refresh())},e))},Xu.prototype.prepareLayerSourceForRefresh=function(e){let t=Date.now();if(e){if(typeof e.updateParams==`function`&&typeof e.getParams==`function`){e.updateParams({...e.getParams(),CACHEID:t});return}if(typeof e.getUrls==`function`&&typeof e.setUrls==`function`&&(this.autoRefreshBaseUrls=this.autoRefreshBaseUrls||e.getUrls(),Array.isArray(this.autoRefreshBaseUrls))){e.setUrls(this.autoRefreshBaseUrls.map(e=>Zu(e,t)));return}typeof e.getUrl==`function`&&typeof e.setUrl==`function`&&(this.autoRefreshBaseUrl=this.autoRefreshBaseUrl||e.getUrl(),this.autoRefreshBaseUrl&&e.setUrl(Zu(this.autoRefreshBaseUrl,t)))}},Xu.prototype.stopAutoRefresh=function(){clearInterval(this.getIntervalAutoRefresh()),this.setIntervalAutoRefresh(void 0)},Xu.prototype.updateLayerValues=function(e){this.getLayer()?.setOpacity((100-e.transparency)/100),this.getLayer()?.setVisible(e.visibility),this.getLayer()?.setZIndex(e.zIndex),this.getLayer()instanceof ft&&this.getLayer().getLayers().getArray().forEac
3h(t=>{t.setZIndex(e.zIndex)}),this.controlAutoRefresh(e),e.fitCapabilitiesExtent&&e.visibility&&!e.encompassingBoundingBox?e.capabilitiesUrl?(this.requestCapabilitiesToFitExtent(),e.encompassingBoundingBox=!0):console.warn(`Please add a capabilitiesUrl for your layer configuration if you want to use fitCapabilitiesExtent!`):e.fitCapabilitiesExtent&&!e.visibility&&e.encompassingBoundingBox&&(e.encompassingBoundingBox=!1)},Xu.prototype.getIntervalAutoRefresh=function(){return this.intervalAutoRefresh},Xu.prototype.getLayerSource=function(){return this.layerSource},Xu.prototype.setIntervalAutoRefresh=function(e){this.intervalAutoRefresh=e},Xu.prototype.setLayerSource=function(e){this.layerSource=e},Yu.prototype.prepareFeaturesFor3D=function(e=[]){e.forEach(e=>{let t=e.getGeometry();t.getType()===`GeometryCollection`?t.getGeometries().forEach(e=>this.setAltitudeOnGeometry(e)):t=this.setAltitudeOnGeometry(t),e.setGeometry(t)})},Yu.prototype.setAltitudeOnGeometry=function(e){let t=e.getType(),n=e.getCoordinates();return t===`Point`?e.setCoordinates(this.getPointCoordinatesWithAltitude(n)):t===`MultiPoint`?e.setCoordinates(this.getMultiPointCoordinatesWithAltitude(n)):console.warn(`Type: `+t+` is not supported yet for function "setAltitudeOnGeometry"!`),e},Yu.prototype.getMultiPointCoordinatesWithAltitude=function(e){return e.map(e=>this.getPointCoordinatesWithAltitude(e))},Yu.prototype.getPointCoordinatesWithAltitude=function(e){let t=this.get(`altitude`),n=this.get(`altitudeOffset`);return typeof t==`number`&&(e.length===2?e.push(parseFloat(t)):e.length===3&&(e[2]=parseFloat(t))),typeof n==`number`&&(e.length===2?e.push(parseFloat(n)):e.length===3&&(e[2]+=parseFloat(n))),e},Xu.prototype.addErrorListener=function(e){e?.on(`featuresloaderror`,async function(){let e=this.attributes.url+`&service=`+this.attributes.typ+`&version=`+this.attributes.version+`&request=describeFeatureType`;await this.errorHandling(await B.get(e,{withCredentials:!0}).then(function(e){return e.status}).catch(function(e){return e.toJSON().status}),this.get(`name`))}.bind(this)),e?.on(`tileloaderror`,async function(e){let t=e.tile.src_?e.tile.src_:e.tile.url_;t&&await this.errorHandling(await B.get(t,{withCredentials:!0}).then(function(e){return e.status}).catch(function(e){return e.toJSON().status}),this.get(`name`))}.bind(this)),e?.on(`imageloaderror`,async function(e){await this.errorHandling(await B.get(e.image.src_,{withCredentials:!0}).then(function(e){return e.status}).catch(function(e){return typeof e.toJSON==`function`?e.toJSON().status:0}),this.get(`name`))}.bind(this))},Xu.prototype.errorHandling=function(e,t){let n=``,r=``;this.get(`datasets`)&&this.get(`datasets`)[0]&&(n=i18next.t(`common:core.layers.errorHandling.LinkMetadata`,{linkMetadata:this.get(`datasets`)[0].show_doc_url+this.get(`datasets`)[0].md_id})),e===403&&(r=i18next.t(`common:core.layers.errorHandling.403`,{layerName:t})+n,$.dispatch(`Alerting/addSingleAlert`,{content:r,multipleAlert:!0}),$.watch((e,t)=>t[`Alerting/showTheModal`],e=>{$.dispatch(`replaceByIdInLayerConfig`,{layerConfigs:[{id:this.attributes.id,layer:{id:this.attributes.id,visibility:e,showInLayerTree:!1}}]},{root:!0})}))},Xu.prototype.extractBoundingBox=function(e){let t=this.get(`typ`)===`WMS`,n=t?`EX_GeographicBoundingBox`:`WGS84BoundingBox`,r=t?e.querySelectorAll(`BoundingBox[CRS="EPSG:4326"]`):[e.querySelector(n)],i=mapCollection.getMap(`2D`).getView().getProjection().getCode(),a=`EPSG:4326`;for(let e of r)if(e){let n,r;if(t)n=[parseFloat(e.getAttribute(`miny`)),parseFloat(e.getAttribute(`minx`))],r=[parseFloat(e.getAttribute(`maxy`)),parseFloat(e.getAttribute(`maxx`))];else{let t=e.textContent.trim().split(/\s+/);n=t.slice(0,2).map(parseFloat),r=t.slice(2,4).map(parseFloat)}let o=j.transform(a,i,n),s=j.transform(a,i,r);return this.set(`boundingBox`,[o,s]),[o,s]}return null},Xu.prototype.requestCapabilitiesToFitExtent=async function(){let e=this.get(`capabilitiesUrl`),t=this.get(`typ`),n=t===`WFS`?`Title`:`Name`,r=t===`WFS`?`FeatureType`:`Layer`,i=t===`WFS`?this.get(`featureType`):this.get(`layers`);await B.get(e).then(e=>Qc(e)).then(e=>new DOMParser().parseFromString(e,`text/xml`)).then(e=>e.querySelectorAll(r)).then(e=>
3e.forEach(e=>{let t=e.querySelector(n);t&&t.textContent.includes(i)&&this.zoomToLayerExtent(e)})).catch(e=>{console.error(`Request failed:`,e)})},Xu.prototype.zoomToLayerExtent=function(e){let t=this.extractBoundingBox(e),n=t?St(t):null,r=mapCollection.getMap(`2D`),i=r.getView(),a=n?i.getZoomForResolution(i.getResolutionForExtent(n,r.getSize())):null;t&&$.dispatch(`Maps/zoomToExtent`,{extent:n,options:{maxZoom:a}},{root:!0})};function Qu(e){let t={infoFormat:$.getters.portalConfig?.tree?.rasterLayerDefaultInfoFormat||`text/xml`};this.attributes=Object.assign(t,e),Xu.call(this,this.attributes)}Qu.prototype=Object.create(Xu.prototype);function $u(e){let t={};this.attributes=Object.assign(t,e),Qu.call(this,this.attributes)}$u.prototype=Object.create(Qu.prototype),$u.prototype.createLayer=function(e){let t=this.getRawLayerAttributes(e);this.setLayer(this.createStaticImageLayer(t))},$u.prototype.getRawLayerAttributes=function(e){return{crs:e.crs,imageExtent:e.extent,name:e.name,url:e.url,zIndex:e.zIndex}},$u.prototype.createLegend=function(){},$u.prototype.createStaticImageLayer=function(e={}){let t=new fe({imageExtent:e.imageExtent,url:e.url,projection:e.crs});return new an({name:e.name,source:t,typ:`StaticImage`,zIndex:e.zIndex})};function ed(e,t,n=!1){let r=Object.keys(e||{}),i=td(t,n);return r.filter(e=>!i.includes(n?e.toUpperCase():e)).reduce((t,n)=>(t[n]=e[n],t),{})}function td(e=[],t=!1){let n=[];return e.forEach(e=>n.push(t?String(e).toUpperCase():String(e))),n}function nd(e){let t={};this.attributes=Object.assign(t,e),Qu.call(this,this.attributes),this.initStyle(e)}nd.prototype=Object.create(Qu.prototype),nd.prototype.createLayer=function(e){let t=this.getRawLayerAttributes(e);this.setLayer(this.createGeoTiffLayer(t))},nd.prototype.getRawLayerAttributes=function(e){return{crs:e.crs,name:e.name,urls:e.urls,sources:e.sources,zIndex:e.zIndex,styleId:e.styleId,style:e.style,olSourceOptions:e.olSourceOptions}},nd.prototype.createLegend=function(){},nd.prototype.createGeoTiffLayer=function(e={}){let t=new Ue({sources:e.sources??e.urls.map(e=>({url:e})),projection:e.crs,...e.olSourceOptions});return new Fe({name:e.name,source:t,typ:`GeoTiff`,zIndex:e.zIndex})},nd.prototype.setStyle=function(e){this.set(`style`,e),this.getLayer()?.setStyle(e)},nd.prototype.initStyle=async function(e){e.style!==void 0&&this.setStyle(e.style),e.styleId!==void 0&&($.getters.styleListLoaded?this.createStyle(e):$.watch((e,t)=>t.styleListLoaded,t=>{t&&this.createStyle(e)}))},nd.prototype.createStyle=async function(e){let t=e.styleId,n=Ft.returnStyleObject(t)??await Ft.initStyleAndAddToList(Config,t);if(n!==void 0){let e=ed(Array.isArray(n.rules)&&n.rules?.length>0?n.rules[0].style:null,[`type`]);this.setStyle(e)}else console.warn(i18next.t(`common:core.layers.errorHandling.wrongStyleId`,{styleId:t}))};function rd(e){let t={format:`image/png`,gutter:0,origin:[442800,5809e3],singleTile:!1,tilesize:512,transparent:!0,version:`1.3.0`};this.attributes=Object.assign(t,e),Qu.call(this,this.attributes)}rd.prototype=Object.create(Qu.prototype),rd.prototype.createLayer=function(e){let t=this.getRawLayerAttributes(e),n=this.getLayerParams(e),r=this.getOptions(e);e.fitCapabilitiesExtent&&e.visibility&&!e.encompassingBoundingBox&&(e.capabilitiesUrl?this.requestCapabilitiesToFitExtent():console.warn(`Please add a capabilitiesUrl for your layer configuration if you want to use fitCapabilitiesExtent!`)),this.setLayer(Vt(t,{layerParams:n,options:r}))},rd.prototype.getRawLayerAttributes=function(e){let t={crs:e.crs,cqlFilter:e.cqlFilter,format:e.format,gutter:e.gutter,id:e.id,layers:e.layers,singleTile:e.singleTile,tilesize:e.tilesize,transparent:e.transparent?.toString(),url:e.url,version:e.version,extent:e.extent,isSecured:e.isSecured};return e.styles!==void 0&&(t.STYLES=e.styles),t},rd.prototype.getLayerParams=function(e){return{format:e.format,gfiAsNewWindow:e.gfiAsNe
3wWindow,gfiAttributes:e.gfiAttributes,gfiTheme:e.gfiTheme,gfiTitleAttribute:e.gfiTitleAttribute,infoFormat:e.infoFormat,layers:e.layers,name:e.name,opacity:(100-e.transparency)/100,typ:e.typ,zIndex:e.zIndex,featureCount:e.featureCount,gfiThemeSettings:e.gfiThemeSettings,useFetchForWMS:Config.overwriteWmsLoadfunction===!0||$.getters.isModuleAvailable(`login`)}},rd.prototype.getOptions=function(e){return{origin:e.origin,resolutions:mapCollection.getMapView(`2D`).getResolutions()}},rd.prototype.createLegend=function(){let e=this.get(`version`),t=this.inspectLegendUrl();if(!Array.isArray(t))if(t===!0&&this.get(`url`)&&this.get(`layers`)){let n=Array.isArray(this.get(`layers`))?this.get(`layers`):this.get(`layers`).split(`,`),r=[];n.forEach(t=>{let n=new URL(this.get(`url`));n.searchParams.set(`SERVICE`,`WMS`),n.searchParams.set(`VERSION`,e),n.searchParams.set(`REQUEST`,`GetLegendGraphic`),n.searchParams.set(`FORMAT`,`image/png`),n.searchParams.set(`LAYER`,t),r.push(n.toString())}),t=r}else typeof t==`string`?t=[t]:t===!1&&(t=!1);return t};function id(e){let t={optionsFromCapabilities:!1,capabilitiesUrl:!1};this.attributes=Object.assign(t,e),Qu.call(this,this.attributes)}id.prototype=Object.create(Qu.prototype),id.prototype.createLayer=function(e){let t=this.getRawLayerAttributes(e),n=this.getLayerParams(e);this.setLayer(lt.createLayer(t,n))},id.prototype.getRawLayerAttributes=function(e){return e},id.prototype.getLayerParams=function(e){return{opacity:(100-e.transparent)/100,zIndex:e.zIndex}},id.prototype.createLegend=async function(){let e=this.inspectLegendUrl();if(this.get(`legend`)&&(this.get(`legend`)===``?e=!0:this.get(`legend`)===`ignore`?e=!1:(e=this.get(`legend`),e=Array.isArray(e)?e:[e])),this.get(`optionsFromCapabilities`)===void 0&&e===!0)console.error(`WMTS: No legendURL is specified for the layer!`);else if(this.get(`optionsFromCapabilities`)&&!this.get(`legendURL`)&&(!e||e===!0))try{let t=this.get(`capabilitiesUrl`);(await lt.getWMTSCapabilities(t)).Contents.Layer.forEach(t=>{if(t.Identifier===this.get(`layers`)){let n=Bn(t,`LegendURL`,!0);n==null?(e=null,console.warn(`no legend url found for layer `+this.get(`layers`))):(e=n[0]?.[0]?.href??n[0]?.href,e&&=[e])}})}catch(e){lt.showErrorMessage(e,this.get(`name`))}return e};var ad=e(ze(),1);G.default.extend(ad.default);var od=[`YYYY`,`YYYY-MM`,`YYYY-MM-DD`,`YYYY-MM-DDTHH`,`YYYY-MM-DDTHH:mm`,`YYYY-MM-DDTHH:mm:ss`,`YYYY-MM-DDTHH:mm:ss.SSS`];function sd(e){let t=e.endsWith(`Z`)?e.substring(0,e.length-1):e,n=od.find(e=>(0,G.default)(t,e,!0).isValid());if(!n)throw Error(`Given timestamp "${e}" is not in ISO8601.`);return n}function cd(e){return!isNaN(parseFloat(e))&&isFinite(e)}var ld=e(Tn(),1);G.default.extend(ld.default);function ud(e){return $.getters.layerConfigById?.(e)}function dd(e,t,n){let r=e?.getLayerSource?.().getParams?.()||{},i=t||Object.keys(r).find(e=>e.toLowerCase()===`time`)||`TIME`,a=[i,i?.toUpperCase(),i?.toLowerCase(),`TIME`,`time`].find(e=>e in r);return{dimensionName:i,value:a?r[a]:n}}function fd(e,t,n){$.commit(`Modules/WmsTime/setTimeSliderActive`,{active:!0,currentLayerId:e,playbackDelay:t?.time?.playbackDelay||1}),$.commit(`Modules/WmsTime/setVisibility`,!0),n&&$.commit(`Modules/WmsTime/setTimeSliderDefaultValue`,n)}function pd(e){rd.call(this,Object.assign({keyboardMovement:5,time:!0},e))}pd.prototype=Object.create(rd.prototype),pd.prototype.createCapabilitiesUrl=function(e,t,n){let r=new URL(e);return r.searchParams.set(`service`,`WMS`),r.searchParams.set(`version`,t),r.searchParams.set(`layers`,n),r.searchParams.set(`request`,`GetCapabilities`),r},pd.prototype.createDimensionRangeList=function(e){let{min:t,max:n,resolution:r}=e;if(t&&n&&r){let e=this.getIncrementsFromResolution(r);return this.createTimeRange(t,n,e)}return console.warn(`The attribute "dimensionRange": ${e} is not correctly configured as an object. Ensure that all three attributes, "start", "end", and "range", are configured correctly.`),[]},pd.prototype.createTimeRange=function(e,t,n){let r=G.default.utc(e),i=Object.entries(n),a=G.default.utc(t),o=[],s=sd(e),c=e.endsWith(`Z`)?`Z`:``;for(;r.valueOf()<=a.valueOf();
3)o.push(r.format(s)+c),i.forEach(([e,t])=>{r=r.add(Number(t),e)});return o},pd.prototype.determineDefault=function(e,t,n){if(n!==void 0&&n!==`current`){if(e.includes(n))return n;if(cd(n)&&e.at(n))return e.at(n);console.warn(`Configured WMS-T default ${n} is not within timeRange:`,e,`Falling back to WMS-T default value.`)}if(n===`current`||t===`current`){let t=(0,G.default)();return e.findLast(e=>(0,G.default)(e).diff(t)<=0)||e[e.length-1]}return t||e[0]},pd.prototype.determineStaticDimensions=function(e,t={}){let n={};return e.forEach(e=>{let r=this.extractExtentValues(e)?.timeRange,i=t[e.name],a=this.determineDefault(r,void 0,i===!0?void 0:i);n[e.name.toUpperCase()]=a}),n},pd.prototype.extractExtentValues=function(e){let t,n=e.value.replaceAll(` `,``).split(`,`).map(e=>e.split(`/`)).map(e=>{if(e.length===1)return e;let[n,r,i]=e,a=this.getIncrementsFromResolution(i),o=this.createTimeRange(n,r,a);return(!t||this.incrementIsSmaller(t,a))&&(t=a),o}).flat(1).sort((e,t)=>e>t);return{timeRange:[...new Set(n)],step:t}},pd.prototype.filterDimensionRangeList=function(e,t){return e.filter(e=>t.includes(e)?!0:(console.warn(`The entry: ${e} is not present in the dimension and has been removed from the dimensionRange!`),!1))},pd.prototype.filterDimensions=async function(e,t){let n=[],r=t;return t===void 0?e:(typeof t==`string`&&(r=await this.loadDimensionRangeJson(t)),typeof r==`object`&&!Array.isArray(r)&&Object.keys(r).length>0&&(r=this.createDimensionRangeList(r)),Array.isArray(r)&&r.length>0&&(n=this.filterDimensionRangeList(r,e)),n?.length===0&&(n=e,console.error(`No valid dimensions could be filtered using the attribute: 'dimensionRange'! The entire dimension of the service is being used.`)),n)},pd.prototype.filterWithDimensionRegex=function(e,t){let n=t.filter(t=>new RegExp(e).test(t));return n.length===0&&(n=t,console.warn(`The regular expression returns no matches, therefore the service's dimension range is used!`)),n},pd.prototype.findNode=function(e,t){return[...e.children].find(e=>e.nodeName===t)},pd.prototype.getIncrementsFromResolution=function(e){let t={},n={Y:`year`,M:`month`,D:`day`},r={H:`hour`,M:`minute`,S:`second`},[i,a]=e.split(`T`);return[...i.matchAll(/(\d+)[^0-9]/g)].forEach(([e,r])=>{t[n[e.slice(-1)]]=r}),a&&[...a.matchAll(/(\d+)[^0-9]/g)].forEach(([e,n])=>{t[r[e.slice(-1)]]=n}),t},pd.prototype.getLayerParams=function(e){return Object.assign(rd.prototype.getLayerParams.call(this,e),{visible:!1})},pd.prototype.updateLayerValues=function(e){Qu.prototype.updateLayerValues.call(this,{...e,visibility:this._timeInitialized===!0&&e.visibility})},pd.prototype.getRawLayerAttributes=function(e){return this.prepareTime(e),rd.prototype.getRawLayerAttributes.call(this,e)},pd.prototype.incrementIsSmaller=function(e,t){let n=[e,t].map(({years:e,months:t,days:n,minutes:r,hours:i,seconds:a})=>`P`+(e||``).padStart(4,`0`)+`Y`+(t||``).padStart(2,`0`)+`M`+(n||``).padStart(2,`0`)+`DT`+(r||``).padStart(2,`0`)+`H`+(i||``).padStart(2,`0`)+`M`+(a||``).padStart(2,`0`)+`S`);return n[0]>n[1]},pd.prototype.loadDimensionRangeJson=async function(e){return B.get(e).then(e=>Qc(e)).then(e=>e.dimensionRange).catch(t=>{console.error(`The file: "${e}" could not be loaded. Please ensure that the file is in the correct location and format!`),console.error(t)})},pd.prototype.requestCapabilities=function(e,t,n){return B.get(this.createCapabilitiesUrl(e,t,n)).then(e=>Qc(e,`WMS, createLayerSource, requestCapabilities`))},pd.prototype.retrieveAttributeValues=function(e){return[...e.attributes].reduce((e,t)=>({...e,[t.name]:t.value}),{value:e.innerHTML})},pd.prototype.prepareTime=function(e){let t=typeof e.time==`object`?e.time:{};return t.dimensionName||=`time`,t.extentName||=`time`,this.requestCapabilities(e.url,e.version,e.layers).then(n=>{let{dimension:r,extent:i,staticDimensions:a}=this.retrieveTimeData(n,e.layers,t),o=i||r;if(!o)throw Error(i18next.t(`common:modules.wmsTime.layer.invalidTimeLayer`,{id:this.id}));if(r&&r.units!==`ISO8601`)throw Error(`WMS-T layer ${this.id} specifies time dimension in unit ${r.units}. Only ISO8601 is supported.`);{let{step:n,timeRange:r}=this.extractExtentValues(o);return this.filterDimensions(r,t.dimensionRange).then(r=>this.prepareTimeSliderObject(t,r,o,a,n,e))}}).catch(t=>{console.error(i18next.t(`common:modules.wmsTime.layer.errorTimeLayer`,{error:t,id:e.id}))})},pd.prototype.prepareTimeSliderObject=function(e,t,n,r,i,a){let o=typeof e.dimensionRegex==`string`?this.filterWithDimensionRegex(e.dimensionRegex,t):t,s=this.determineDefault(o,n.default,Array.isArray(e.default)?e.default[0]:e.default),c=e.dualRangeSlider===!0&&Array.isArray(e.default)&&e.default.length>=2?this.determineDefault(o,n.default,e.default[1]):null,l=this.determineStaticDimensions(r,e.staticDimensions),u={defaultValue:s,defaultValueEnd:c,dimensionName:e.dimensionName,step:i,timeRange:o,staticDimensions:l,dualRangeSlider:e.dualRangeSlider||!1,displayFormat:e.displayFormat,displayTimezone:e.displayTimezone},d={};return a.time={...e,...u},u.layerId=a.id,$.commit(`Modules/WmsTime/addTimeSliderObject`,{keyboardMovement:a.keyboardMovement,...u}),d[u.dimensionName]=s,this._timeInitialized=!0,this.getLayerSource().updateParams(d),this.getLayer().setVisible(this.get(`visibility`)===!0),s},pd.prototype.removeLayer=function(e){if($.getters[`Modules/LayerSwiper/active`]){let t=$.getters[`Modules/WmsTime/layerAppendix`],n=e.endsWith(t),r=n?e.replace(t,``):e+t,i=ud(r),a=W.getLayerById(r),o=$.getters[`Modules/WmsTime/timeSlider`]||{},s=Array.isArray(o.objects)?o.objects:[],c=s.find(e=>e.layerId===o.currentLayerId),l=s.find(e=>e.layerId===r),u=$.getters[`Modules/WmsTime/defaultDimensionName`],{dimensionName:d,value:f}=dd(a,u,l?.defaultValue??c?.defaultValue);if(i?.visibility!==!1){if(n)$.dispatch(`replaceByIdInLayerConfig`,{layerConfigs:[{id:e,layer:{id:e,visibility:!1,showInLayerTree:!1}}]});else{let t=W.getLayerById(e);$.dispatch(`replaceByIdInLayerConfig`,{layerConfigs:[{id:e,layer:{id:e,visibility:!0,showInLayerTree:!0,zIndex:i?.zIndex}},{id:r,layer:{id:r,visibility:!1,showInLayerTree:!1}}]}),f&&t?.updateTime?.(e,d,f)}fd(n?r:e,i,f)}$.dispatch(`Modules/WmsTime/deactivateLayerSwiper`)}else $.commit(`Modules/WmsTime/setTimeSliderActive`,{active:!1,currentLayerId:``})},pd.prototype.visibilityChanged=function(e){let t=this.get(`id`),n=$.getters[`Modules/WmsTime/layerAppendix`]||`_secondLayer`,r=ud(t),i=t.endsWith(n),a=i?t.replace(n,``):t+n,o=ud(a),s=e===!0&&!$.getters[`Modules/LayerSwiper/active`]&&r?.visibility===!0&&o?.visibility===!0&&r?.showInLayerTree===!0&&o?.showInLayerTree===!0;if(e===!1&&$.getters[`Modules/LayerSwiper/active`])if(r?.showInLayerTree===!1||r===void 0)this.removeLayer(t);else{let e=$.getters[`Modules/WmsTime/defaultDimensionName`]||`TIME`,t=W.getLayerById(a),n=$.getters[`Modules/WmsTime/timeSlider`]||{},r=Array.isArray(n.objects)?n.objects.find(e=>e.layerId===n.currentLayerId):void 0,{dimensionName:i,value:s}=dd(t,e,(Array.isArray(n.objects)?n.objects.find(e=>e.layerId===a):void 0)?.defaultValue),c=s??r?.defaultValue;o?.visibility===!1?$.dispatch(`Modules/WmsTime/deactivateLayerSwiper`):($.dispatch(`Modules/WmsTime/deactivateLayerSwiper`),fd(a,o,c),c&&t?.updateTime?.(a,i,c))}else if(e===!1&&!$.getters[`Modules/LayerSwiper/active`]&&!i&&r?.showInLayerTree===!1&&o?.showInLayerTree!==!1)$.dispatch(`replaceByIdInLayerConfig`,{layerConfigs:[{id:a,layer:{id:a,visibility:!1,showInLayerTree:!1}}]});else if(s){let e=i?t.replace(n,``):t,r=ud(e),a=$.getters[`Modules/WmsTime/defaultDimensionName`]||`TIME`,{value:o}=dd(W.getLayerById(e),a);$.dispatch(`Modules/WmsTime/toggleSwiper`,t),$.commit(`Modules/WmsTime/setTimeSliderActive`,{active:!0,currentLayerId:e,playbackDelay:r?.time?.playbackDelay||1}),o&&$.commit(`Modules/WmsTime/setTimeSliderDefaultValue`,o)}},pd.prototype.retrieveStaticDimensions=function(e,t){let n=[];
3return e.forEach(e=>{let r=t.querySelector(`Dimension[name="${e}"]`);r?n.push(this.retrieveAttributeValues(r)):console.warn(`No dimension "${e}" could be found! Please check your configuration.`)}),n},pd.prototype.retrieveTimeData=function(e,t,n){let{dimensionName:r,extentName:i}=n,a=typeof n.staticDimensions==`object`?Object.keys(n.staticDimensions):[],o=[...new DOMParser().parseFromString(e,`text/xml`).querySelectorAll(`Layer > Name`)].filter(e=>e.textContent===t)[0].parentNode,s=o.querySelector(`Dimension[name="${r}"]`),c=o.querySelector(`Extent[name="${i}"]`);return{dimension:s?this.retrieveAttributeValues(s):null,extent:c?this.retrieveAttributeValues(c):null,staticDimensions:this.retrieveStaticDimensions(a,o)}},pd.prototype.setIsVisibleInMap=function(e){$.commit(`Modules/WmsTime/setVisibility`,e),Qu.prototype.setIsVisibleInMap.call(this,e)},pd.prototype.updateTime=function(e,t,n,r=null,i={}){if(e===this.get(`id`)){let e={...i};e[t]=r===null?n:n+`/`+r,this.getLayerSource().updateParams(e),this.getLayer().setVisible(!0),$.getters[`Modules/GetFeatureInfo/visible`]===!0&&$.dispatch(`Modules/GetFeatureInfo/collectGfiFeatures`)}};function md(){this.getLayerSource().clear()}function hd(){this.hideAllFeatures(),this.getLayerSource().addFeatures(this.features)}function gd(e){let t=e.map(e=>this.features.find(t=>t.getId()===e));this.hideAllFeatures(),this.getLayerSource().addFeatures(t)}function _d(e){let t=mapCollection.getMap(`2D`);this.isDisposed()&&this.setLayer(En({...this.attributes,source:this.source,style:this.getLayer().get(`style`)})),this.attributes.type===`WFS`&&this.getLayer().getSource().refresh(),e?t.getLayers().getArray().includes(this.getLayer())||$.dispatch(`Maps/addLayer`,this.getLayer()):(this.getLayer().dispose(),t.removeLayer(this.getLayer()))}
3function vd(){return!this.layer||this.layer.disposed}function yd(){}function bd(e){e.source=e.layer.getSource(),e.isDisposed=vd,e.visibilityChanged=_d,e.setStyle=yd,e.isPointLayer=e?.layer?.values_?.isPointLayer,e.hideAllFeatures=md,e.showAllFeatures=hd,e.showFeaturesByIds=gd}var xd={setLayerProperties:bd,hideAllFeatures:md,showAllFeatures:hd,showFeaturesByIds:gd,visibilityChanged:_d,isDisposed:vd,setStyle:yd};function J(e){let t={altitudeMode:`clampToGround`,renderer:`default`,styleId:`default`};this.isStyling=!1,this.geometryTypeRequestLayers=[],this.attributes=Object.assign(t,e),Xu.call(this,this.attributes),e.renderer===`webgl`&&xd.setLayerProperties(this),e.dontInitStyle!==!0&&this.initStyle(e)}J.prototype=Object.create(Xu.prototype),J.prototype.updateLayerValues=function(e){this.getLayer()?.setOpacity((100-e.transparency)/100),this.getLayer()?.setVisible(e.visibility),this.getLayer()?.setZIndex(e.zIndex),this.controlAutoRefresh(e),(this.get(`typ`)===`WFS`||this.get(`typ`)===`OAF`||this.get(`typ`)===`GeoJSON`)&&$.getters[`Maps/mode`]===`3D`&&this.layerSource.getFeatures().length===0&&this.loadFeaturesManually(e),e.fitCapabilitiesExtent&&e.visibility&&!e.encompassingBoundingBox?e.capabilitiesUrl?(this.requestCapabilitiesToFitExtent(),e.encompassingBoundingBox=!0):console.warn(`Please add a capabilitiesUrl for your layer configuration if you want to use fitCapabilitiesExtent!`):e.fitCapabilitiesExtent&&!e.visibility&&e.encompassingBoundingBox&&(e.encompassingBoundingBox=!1)},J.prototype.clusterGeometryFunction=function(e){return e.get(`hideInClustering`)===!0?null:e.getGeometry()},J.prototype.featuresFilter=function(e,t){let n=t.filter(e=>!!e.getGeometry());return e.bboxGeometry&&(n=n.filter(t=>e.bboxGeometry.intersectsCoordinate(Sn(t.getGeometry().getExtent())))),n},J.prototype.getLayerParams=function(e){return{altitudeMode:e.altitudeMode,gfiAttributes:e.gfiAttributes,gfiTheme:e.gfiTheme,gfiTitleAttribute:e.gfiTitleAttribute,name:e.name,opacity:(100-e.transparency)/100,typ:e.typ,zIndex:e.zIndex,renderer:e.renderer,styleId:e.styleId,style:e.style,excludeTypesFromParsing:e.excludeTypesFromParsing,isPointLayer:e.isPointLayer,gfiThemeSettings:e.gfiThemeSettings}},J.prototype.loadingParams=function(e){return{xhrParameters:e.isSecured?{credentials:`include`}:void 0,propertyname:this.propertyNames(e)||void 0,bbox:e.bboxGeometry?.getExtent?.()?.toString()}},J.prototype.propertyNames=function(e){let t=``;return Array.isArray(e.propertyNames)&&(t=e.propertyNames.join(`,`)),t},J.prototype.onLoadingError=function(e){console.error(`Masterportal wfs loading error: `,e)},J.prototype.setStyle=function(e){let t=e===null?void 0:e;this.set(`style`,e),this.getLayer()?.setStyle(t)},J.prototype.initStyle=async function(e){$.getters.styleListLoaded?this.createStyle(e):$.watch((e,t)=>t.styleListLoaded,t=>{t&&this.createStyle(e)})},J.prototype.createStyle=async function(e){let t=e.styleId,n=Ft.returnStyleObject(t)??await Ft.initStyleAndAddToList(Config,t);n===void 0?(this.setStyle(null),console.warn(i18next.t(`common:core.layers.errorHandling.wrongStyleId`,{styleId:t}))):this.setStyle(t=>{if(this.isStyling)return new T;this.isStyling=!0;let r;try{let i=t===void 0?this:t,a=typeof i.get(`features`)==`function`||typeof i.get(`features`)==`object`&&i.get(`features`).length>1;r=Jt.createStyle(n,i,a,Config.wfsImgPath,{layerId:e.id})}finally{this.isStyling=!1}return r})},J.prototype.getStyleFunction=function(){return this.get(`style`)},J.prototype.showFeaturesByIds=function(e){let t=this.getLayerSource()instanceof Re?this.getLayerSource().getSource():this.getLayerSource(),n=t.getFeatures(),r=e.map(e=>t.getFeatureById(e));this.hideAllFeatures(!0),r.forEach(e=>{let t=this.getStyleAsFunction(this.get(`style`));e&&e!==null&&(e.set(`hideInClustering`,!1),e.setStyle(t(e)))}),t.addFeatures(n)},J.prototype.hideAllFeatures=function(e=!1){let t=this.getLayerSource()instanceof Re?this.getLayerSource().getSource():this.getLayerSource(),n=t.getFeatures();t.clear(),n.forEach(e=>{e.set(`hideInClustering`,!0),e.setStyle(new T)}),!e&&t.addFeatures(n)},J.prototype.getStyleAsFunction=function(e){return typeof e==`function`?e:function(){return e}},J.prototype.resolveLegend=function(e,t,n){if(t&&t[0]?.conditions!==void 0&&e?.length)return this.filterUniqueLegendInfo(e,t,n);if(n&&new Set(n.map(e=>
3e.geometryType).filter(Boolean)).size>1){let e=n.filter(e=>e.geometryType===`Point`);return e.length?e:n}return n},J.prototype.createLegend=async function(){let e=Ft.returnStyleObject(this.attributes.styleId),t=e?.rules,n=typeof this.attributes.isSecured==`boolean`&&this.attributes.isSecured,r=this.inspectLegendUrl();if(Array.isArray(r))return r;if(!e||r!==!0)return typeof r==`string`?[r]:r;let i=[t,this.get(`url`),this.get(`version`),this.get(`featureType`),this.get(`styleGeometryType`),n,Config.wfsImgPath],a=await Ie.getGeometryTypeFromWFS(...i);if(a&&a.length>0){let e=this.layer.getSource().getFeatures(),n=e?.[0]?.getGeometry?.()?.getType(),r=n?.replace(`Multi`,``)??n,i=r?a.filter(e=>e.geometryType===r):a;return this.resolveLegend(e,t,i)}let o=await Jt.returnLegendByStyleId(e.styleId);if(e.styleId==="default"){let e=this.layer.getSource().getFeatures()?.[0]?.getGeometry()?.getType(),t=e===`MultiLineString`?`LineString`:e,n=o.legendInformation?.find(e=>e.geometryType===t);return n?[n]:[]}if(this.geometryTypeRequestLayers.includes(this.get(`id`))||(this.geometryTypeRequestLayers.push(this.get(`id`)),Ie.getGeometryTypeFromWFS(...i,(e,t)=>
3(t&&$.dispatch(`Alerting/addSingleAlert`,`<strong>`+i18next.t(`common:core.layers.errorHandling.getGeometryTypeFromWFSFetchfailed`)+`</strong> <br><small>`+i18next.t(`common:core.layers.errorHandling.getGeometryTypeFromWFSFetchfailedMessage`)+`</small>`),e))),t&&t[0]?.conditions!==void 0){let e=this.layer.getSource().getFeatures();return this.resolveLegend(e,t,o.legendInformation)}return o.legendInformation},J.prototype.filterUniqueLegendInfo=function(e,t,n){if(!Array.isArray(e)||e.length===0)return n;let r=new Map((n||[]).map(e=>[String(e?.label),e])),i=new Map,a=[],o,s,c,l,u,d,f,p,m;function h(e){let t=Number(e);return Number.isFinite(t)?t:null}function g(t){if(i.has(t))return i.get(t);let n=new Set;for(let r=0;r<e.length;r++){let i=e[r].get(t);i!==void 0&&n.add(i)}return i.set(t,n),n}function _(e,t){if(Array.isArray(t)&&t.length===2){let n=h(t[0]),r=h(t[1]);if(n===null||r===null)return!1;for(let t of e){let e=h(t);if(e!==null&&e>=n&&e<r)return!0}return!1}let n=h(t);for(let r of e){let e=h(r);if(n!==null&&e!==null){if(e===n)return!0}else if(String(r)===String(t))return!0}return!1}for(f of t||[]){if(p=f&&f.conditions?f.conditions.properties:void 0,Array.isArray(p)&&p.length>0?(o=p[0]&&p[0].attrName,s=p[0]&&p[0].value):p&&typeof p==`object`?(m=Object.keys(p),m.length>0?(o=m[0],s=p[o]):(o=void 0,s=void 0)):(o=void 0,s=void 0),!o){typeof f?.style?.legendValue==`string`&&f.style.legendValue.length>0&&(d=r.get(f.style.legendValue),d&&!a.includes(d)&&a.push(d));continue}c=g(o),l=_(c,s),l&&(u=f&&f.style&&f.style.legendValue!==null&&f.style.legendValue!==void 0?String(f.style.legendValue):String(Array.isArray(s)?`${s[0]},${s[1]}`:s),d=r.get(u),d&&a.push(d))}return a.length?a:n};function Sd(e){let t={};this.attributes=Object.assign(t,e),J.call(this,this.attributes)}Sd.prototype=Object.create(J.prototype),Sd.prototype.createLayer=function(e){let t=this.getRawLayerAttributes(e),n=this.getLayerParams(e),r=this.getOptions(e);this.setLayer(Mn(t,{layerParams:n,options:r}))},Sd.prototype.getRawLayerAttributes=function(e){return{clusterDistance:e.clusterDistance,features:e.geojson,id:e.id,url:e.url}},Sd.prototype.getOptions=function(e){return{afterLoading:t=>this.afterLoading(e,t),clusterGeometryFunction:this.clusterGeometryFunction,featuresFilter:t=>this.featuresFilter(e,t),map:mapCollection.getMap(`2D`),onLoadingError:this.onLoadingError,layerStyle:this.getStyleFunction(e)}},Sd.prototype.afterLoading=function(e,t){Array.isArray(t)&&(t.forEach((t,n)=>{typeof t?.getId==`function`&&t.getId()===void 0&&t.setId(`geojson-`+e.id+`-feature-id-`+n)}),this.prepareFeaturesFor3D(this.layer?.getSource().getFeatures()))},Sd.prototype.createLegend=async function(){let e=Ft.returnStyleObject(this.get(`styleId`)),t=this.inspectLegendUrl();return Array.isArray(t)||(e&&t===!0?t=Cd((await Jt.returnLegendByStyleId(e.styleId)).legendInformation,e):typeof t==`string`&&(t=[t])),t},Sd.prototype.loadFeaturesManually=function(e){dt(this.getRawLayerAttributes(e),this.layer.getSource())};function Cd(e,t){let n=t.rules.map(e=>wd(e)).filter(e=>e!==null),r=[...e],i=r.reduce((e,t,r)=>(n.includes(t.label)&&e.push(r),e),[]),a=i.map(e=>r[e]).sort((e,t)=>n.indexOf(e.label)-n.indexOf(t.label));return i.forEach((e,t)=>{r[e]=a[t]}),r}function wd(e){if(e?.style?.legendValue)return e.style.legendValue;let t=e?.conditions?.properties;return t?Array.isArray(t)?t.map(e=>String(e?.value)).join(`, `):Object.values(t).map(e=>String(e)).join(`, `):null}Sd.prototype.startAutoRefresh=function(e){this.setIntervalAutoRefresh(setInterval(()=>{let e=this.getLayerSource()instanceof Re?this.getLayerSource()?.getSource():this.getLayerSource();e&&(this.prepareLayerSourceForRefresh(e),e.once(`featuresloadend`,()=>{this.afterLoading(this.attributes,this.layer?.getSource?.()?.getFeatures?.()),this.autoRefreshObserver.forEach(e=>e())}),e.refresh())},e))};function Td(e){let t={};this.attributes=Object.assign(t,e),J.call(this,this.attributes),this.prepareFeaturesFor3D(this.layer?.getSource().getFeatures())}Td.prototype=Object.create(J.prototype),Td.prototype.createLayer=function(e){let t=this.getRawLayerAttributes(e),n=this.getLayerParams(e),r=this.getOptions(e);this.setLayer(Dt.createLayer(t,{layerParams:n,options:r}))},Td.prototype.getRawLayerAttributes=function(e){let t=e.crs===!1||e.crs?e.crs:`http://www.opengis.net/def/crs/EPSG/0/25832`;return{bbox:e.bbox||Array.isArray(e.datasets)&&e.datasets[0]?.bbox||$.getters[`Maps/extent`],bboxCrs:e.bboxCrs||t,clusterDistance:e.clusterDistance,collection:e.collection,crs:t,datetime:e.datetime,id:e.id,limit:e.limit===void 0?400:e.limit,offset:e.offset,params:e.params,url:e.url}},Td.prototype.getOptions=function(e){return{clusterGeometryFunction:this.clusterGeometryFunction,doNotLoadInitially:e.doNotLoadInitially,featuresFilter:t=>this.featuresFilter(e,t),loadingParams:this.loadingParams(e),loadingStrategy:e.loadingStrategy===`all`?se:He,onLoadingError:this.onLoadingError,style:this.getStyleFunction(e)}},Td.prototype.createLegend=async function(){let e=Ft.returnStyleObject(this.attributes.styleId),t=e?.rules,n=this.inspectLegendUrl();if(!Array.isArray(n))if(e&&n===!0){let e=this.layer?.getSource()?.getFeatures?.()?.[0]?.getGeometry?.()?.getType?.(),r=(this.get(`styleGeometryType`)||this.get(`geometryType`)||e||`Point`).replace(`Multi`,``);n=d(t||[],[r],Config.wfsImgPath)}else typeof n==`string`&&(n=[n]);return n},Td.prototype.loadFeaturesManually=function(e){let t={...this.getRawLayerAttributes(e)};$.getters[`Maps/mode`]===`3D`&&(t.bbox=void 0),Dt.loadFeaturesManually(t,this.layer.getSource())};
3var Ed=e(On(),1),Dd=e(ut(),1),Od=e(jn(),1);G.default.extend(ld.default);function kd(e){let t=new Date(e.getFullYear(),0,1),n=new Date(e.getFullYear(),6,1);return Math.max(t.getTimezoneOffset(),n.getTimezoneOffset())}function Ad(e){return new Date(e).getTimezoneOffset()<kd(new Date(e))}function jd(e,t=`+1`){let n=t.substring(0,1),r,i;return t.length===2?(r=parseInt(t.substring(1,2),10),r=Ad(e)?r+1:r,i=`0`+r+`00`):t.length>2&&(r=parseInt(t.substring(1,3),10),r=Ad(e)?r+1:r,i=r+`00`),(0,G.default)(e).utcOffset(n+i).format(`YYYY-MM-DDTHH:mm:ss`)}var Md=e(bn(),1),Nd=class{constructor(e){let t=Object.assign({removeIotLinks:!1,httpClient:null,rootNode:!1},e);this.removeIotLinks=t.removeIotLinks,this.httpClient=t.httpClient,this.rootNode=t.rootNode?t.rootNode:`Things`}get(e,t,n,r,i,a){let o=[],s=[];typeof n==`function`&&n(),(typeof a==`function`?a:this.callNextLink).bind(this)(e,o,()=>{typeof t==`function`&&t(s),typeof r==`function`&&r()},e=>{typeof i==`function`&&i(e),typeof r==`function`&&r()},s)}getInExtent(e,t,n,r,i,a,o,s){let c=t&&t.extent?t.extent:!1,l=t&&t.sourceProjection?t.sourceProjection:!1,u=t&&t.targetProjection?t.targetProjection:!1,d=this.convertExtentIntoPoints(c,l,u,e=>{typeof i==`function`&&i(),typeof o==`function`&&o(e),typeof a==`function`&&a()}),f=this.addPointsToUrl(e,d,n,e=>{typeof i==`function`&&i(),typeof o==`function`&&o(e),typeof a==`function`&&a()});d===!1||f===!1||(typeof s==`function`?s:this.get).bind(this)(f,r,i,a,o)}getPolygonQueryWithPoints(e,t,n){let r=t?`st_intersects`:`st_within`,i=``;return Array.isArray(e)?(e.forEach(function(e){!e||!e?.x||!e?.y||(i!==``&&(i+=`,`),i+=e.x+` `+e.y)}),this.rootNode===`Things`?r+`(Locations/location,geography'POLYGON ((`+i+`))')`:r+`(Thing/Locations/location,geography'POLYGON ((`+i+`))')`):(typeof n==`function`&&n(`SensorThingsHttp - getPolygonQueryWithPoints: the given points should be an array`),!1)}convertExtentIntoPoints(e,t,n,r){let i;if(!Array.isArray(e)||e.length!==4)return typeof r==`function`&&r(`SensorThingsHttp - convertExtentToPoints: the given extent must be an array with 4 entries`),!1;if(typeof t!=`string`)return typeof r==`function`&&r(`SensorThingsHttp - convertExtentToPoints: the sourceProjection must be a string describing a projection (e.g. 'EPSG:4326')`),!1;if(typeof n!=`string`)return typeof r==`function`&&r(`SensorThingsHttp - convertExtentToPoints: the targetProjection must be a string describing a projection (e.g. 'EPSG:4326')`),!1;let a=[{x:e[0],y:e[1]},{x:e[2],y:e[1]},{x:e[2],y:e[3]},{x:e[0],y:e[3]},{x:e[0],y:e[1]}];if(t!==n)for(i in a)try{a[i]=j.transform(t,n,a[i])}catch(e){if(typeof r==`function`)return r(e),!1}return a}addPointsToUrl(e,t,n,r){let i=new Md.default(e),a=this.getPolygonQueryWithPoints(t,n,r);return a?!e||typeof e!=`string`||e.indexOf(`http`)!==0?(typeof r==`function`&&r(`SensorThingsHttp - addPointsToUrl: an external url begining with http is expected`),!1):(i.query||={},i.set(`query`,i.query),a&&!Object.prototype.hasOwnProperty.call(i.query,`$filter`)?i.query.$filter=a:a&&i.query.$filter.indexOf(`geography'POLYGON`)===-1&&i.query.$filter.indexOf(`geography%27POLYGON`)===-1&&(i.query.$filter+=` and `+a),i.set(`query`,i.query),i.href):!1}callNextLink(e,t,n,r,i,a){if(!Array.isArray(i)){typeof r==`function`&&r(`SensorThingsHttp - callNextLink: given resultRef is not an array - nextLink: `+e+` - resultRef: `+i);return}this.callHttpClient(e,o=>{if(typeof o!=`object`||!o||Array.isArray(o)){typeof r==`function`&&r(`SensorThingsHttp - callNextLink: the response from the SensorThingsApi is not an object - check nextLink: `+e);return}o?.value&&Array.isArray(o.value)?(o.value.forEach(e=>{i.push(e)}),Object.prototype.hasOwnProperty.call(o,`@iot.nextLink`)&&Array.isArray(t)&&t.push({nextLink:o[`@iot.nextLink`],resultRef
3:i})):i.push(o),(typeof a==`function`?a:this.collectNextLinks).bind(this)(i,t,()=>{let e=this.getNextFiFoObj(t);if(e===!1){typeof n==`function`&&n();return}this.callNextLink(e.nextLink,t,n,r,e.resultRef,a)})},r)}collectNextLinks(e,t,n){if(typeof e!=`object`||!e){typeof n==`function`&&n();return}let r;for(r in e){if(this.removeIotLinks&&(r.indexOf(`@iot.navigationLink`)!==-1||r.indexOf(`@iot.selfLink`)!==-1)){delete e[r];continue}let n=r.indexOf(`@iot.nextLink`);n===-1?this.collectNextLinks(e[r],t):n===0?(Array.isArray(t)&&t.push({nextLink:e[r],resultRef:e.value}),delete e[r]):(Array.isArray(t)&&t.push({nextLink:e[r],resultRef:e[r.substring(0,n)]}),delete e[r])}typeof n==`function`&&n()}getNextFiFoObj(e){if(!Array.isArray(e)||e.length===0||!e[0]?.nextLink)return!1;let t=e.shift(),n=this.fetchTopX(t.nextLink),r=this.fetchSkipX(t.nextLink);return n>0&&n<=r?this.getNextFiFoObj(e):t}fetchTopX(e){if(typeof e!=`string`)return 0;let t=/[$|%24]top=([0-9]+)/.exec(e);return!Array.isArray(t)||!Object.prototype.hasOwnProperty.call(t,1)?0:parseInt(t[1],10)}fetchSkipX(e){if(typeof e!=`string`)return 0;let t=/[$|%24]skip=([0-9]+)/.exec(e);return!Array.isArray(t)||!Object.prototype.hasOwnProperty.call(t,1)?0:parseInt(t[1],10)}callHttpClient(e,t,n){if(typeof this.httpClient==`function`){this.httpClient(e,t,n);return}B({method:`get`,url:e}).then(function(e){e!==void 0&&typeof t==`function`&&t(e.data)}).catch(function(e){typeof n==`function`&&n(e)})}setHttpClient(e){this.httpClient=e}setRemoveIotLinks(e){this.removeIotLinks=e}setRootNode(e){this.rootNode=e}};function Pd(e,t,n){let r=``;if(n){let e=new Date;e.setTime(e.getTime()+n*24*60*60*1e3),r=`; expires=`+e.toUTCString()}let i=window.location.hostname,a=e+`=`+(t||``)+r+`; Secure; Path=/; SameSite=None; domain=`+i;document.cookie=a}function Fd(e){let t=e+`=`,n=document.cookie.split(`;`);for(let e=0;e<n.length;e++){let r=n[e];for(;r.charAt(0)===` `;)r=r.substring(1,r.length);if(r.indexOf(t)===0)return r.substring(t.length,r.length)}}function Id(e){let t=window.location.hostname;document.cookie=e+`=; expires=Thu, 01 Jan 1970 00:00:01 GMT; Path=/; SameSite=None; Secure; domain=`+t}function Ld(e){e.forEach(e=>{Id(e)})}var Rd={set:Pd,get:Fd,erase:Id,eraseAll:Ld};function zd(e,t){let n=typeof e==`string`?e:e.toString();if(!t)return!1;try{return n.match(t)!==null}catch{return!1}}function Bd(e){try{return new URL(e),!0}catch{return!1}}function Vd(e,t){return t?!Bd(e)||zd(e,t):!1}function Hd(){let e=Rd.get(`token`);return e?`Bearer ${e}`:(console.warn(`No authentication token found in cookies`),null)}function Ud(e,t=!0){let n=Hd();return n?(e.headers||={},e.headers.Authorization=n,t&&(e.withCredentials=!0),e):e}var Wd={isUrlMatchingRegex:zd,isAbsoluteUrl:Bd,shouldAddToken:Vd,getAuthToken:Ud,getTokenHeader:Hd};ke();var Gd=Tt(),Kd=43,qd=window.msCrypto||window.crypto||{getRandomValues:e=>{for(let t=0,n=e.length;t<n;t++)e[t]=Math.floor(Math.random()*256);return e},subtle:{digest:(e,t)=>new Promise(n=>n((0,Gd.createHash)(e.toLowerCase().replace(`-`,``)).update(t).digest()))}};function Jd(){return Xd(Zd())}function Yd(){return window.localStorage.getItem(`pkce_state`)||Jd()}function Xd(e){return window.localStorage.setItem(`pkce_state`,e),e}function Zd(){let e=new Uint8Array(Kd);return qd.getRandomValues(e),Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``)}async function Qd(e){let t=null,n=null,r=null;r=new Uint8Array(e.length);for(let t=0;t<e.length;t++)r[t]=e.charCodeAt(t);return t=await qd.subtle.digest(`SHA-256`,r),n=$d(String.fromCharCode.apply(null,new Uint8Array(t))),n}function $d(e){return btoa(e).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/[=]+$/,``)}function ef(e=!1){let t=window.localStorage,n=t.getItem(`code_verifier`),r=n&&!e?n:$d(Zd()).substring(0,Kd);return t.setItem(`code_verifier`,r),r}async function tf(e,t,n,r){let i=Jd(),a=await Qd(ef(!0));return e+`?response_type=code&client_id=`+encodeURIComponent(t)+`&state=`+encodeURIComponent(i)+`&scope=`+encodeURIComponent(r)+`&redirect_uri=`+encodeURIComponent(n)+`&code_challenge=`+encodeURIComponent(a)+`&code_challenge_method=S256`}function nf(e,t,n,r){let i=new XMLHttpRequest;return i.open(`POST`,e,!1),i.setRequestHeader(`Content-Type`,`application/x-www-form-urlencoded; charset=UTF-8`),i.send(new URLSearchParams({grant_type:`authorization_code`,code:r,client_id:t,redirect_uri:n,code_verifier:ef()})),i}function rf(e,t,n){let r=new XMLHttpRequest;return r.open(`POST`,e,!1),r.setRequestHeader(`Content-Type`,`application/x-www-form-urlencoded; charset=UTF-8`),r.send(new URLSearchParams({grant_type:`refresh_token`,client_id:t,refresh_token:n})),r}function af(e,t,n){let r=new XMLHttpRequest;if(r.open(`POST`,e,!1),r.setRequestHeader(`Content-Type`,`application/x-www-form-urlencoded; charset=UTF-8`),r.send(new URLSearchParams({grant_type:`refresh_token`,token:n,client_id:t})),r.status!==200)throw Error(`Failed to revoke token: ${r.statusText}`);return r}function of(e,t,n,r){Rd.set(`token`,e,7),Rd.set(`id_token`,t,7),Rd.set(`expires_in`,n,7),Rd.set(`refresh_token`,r,7);let i=uf(e);Rd.set(`name`,i?.name,7),Rd.set(`email`,i?.email,7),Rd.set(`username`,i?.preferred_username,7),Rd.set(`expiry`,i?.exp,7)}function sf(){Rd.eraseAll([`token`,`expires_in`,`id_token`,`refresh_token`,`name`,`username`,`email`,`expiry`])}function cf(e){let t=uf(e),n=(t.exp?t.exp*1e3:0)-Date.now();return Math.max(0,n)}async function lf(e,t,n){let r=cf(e);if(r>0&&r<=6e4){let e=n.oidcTokenEndpoint,r=n.oidcClientId,i=rf(e,r,t);if(i.status===200){let e=JSON.parse(i.response);of(e.access_token,e.id_token,e.expires_in,e.refresh_token)}else console.error(`Could not refresh token.`,i.response)}}function uf(e){try{let t=e.split(`.`)[1],n=t?t.replace(/-/g,`+`).replace(/_/g,`/`):``,r=t?n+`=`.repeat((4-n.length%4)%4):``,i=t?Ce.from(r,`base64`).toString(`utf8`):``;return!e||typeof e!=`string`||!t?{}:JSON.parse(i)}catch{return{}}}function df(e){let t=uf(e),n=t?.sub||t?.uuid;return typeof n==`string`&&n.length>0?n:void 0}var ff={createCodeChallenge:Qd,generateRandomString:Zd,getVerifier:ef,getAuthCodeUrl:tf,getToken:nf,getState:Yd,setCookies:of,eraseCo
3okies:sf,refreshToken:rf,revokeToken:af,getTokenExpiry:cf,renewTokenIfNecessary:lf,parseJwt:uf,getUserUuidFromToken:df},pf=`masterportal:login-token-updated`;function mf(e){if(typeof e?.rhPath==`string`&&e.rhPath.length>0)return e.rhPath;let t=e?.host||e?.hostname,n=typeof e?.protocol==`string`?e.protocol:`wss`,r=typeof e?.path==`string`?e.path:`/`,i=e?.port;if(typeof t!=`string`||!t)return``;try{if(t.startsWith(`ws://`)||t.startsWith(`wss://`)||t.startsWith(`http://`)||t.startsWith(`https://`)){let e=new URL(r,t);return i&&!e.port&&(e.port=String(i)),e.toString()}return`${n}://${t}${i?`:${i}`:``}${r.startsWith(`/`)?r:`/${r}`}`}catch{return``}}function hf(e,t){let n=mf(e);return!n||!t?!1:Wd.shouldAddToken(n,t)}function gf(e,t){if(!hf(e,t))return{};let n=Rd.get(`token`);return typeof n!=`string`||n.length===0?{}:{username:ff.getUserUuidFromToken(n)||`Bearer`,password:n}}function _f(e,t){let n=gf(e,t??Config?.login?.interceptorUrlRegex);return typeof e!=`object`||!e||!Object.keys(n).length?e:Object.assign(e,n)}function vf(){return pf}var yf={resolveWebsocketAuthUrl:mf,shouldAddWebsocketToken:hf,getMqttAuthOptions:gf,applyMqttAuthOptions:_f,getTokenUpdatedEventName:vf},bf=class{constructor(){this.options={browserBufferSize:65536,host:`https://localhost`,port:``,path:`/mqtt`,protocol:`wss`,mqttVersion:`3.1.1`,rhPath:``,context:this},this.mqttLibObject=null,this.mqttClient=null,this.lastWarnTime=0,this.httpClient=null,this.handlers={},this.tokenUpdatedListener=null,this.lastReconnectAt=null,this.reconnectDebounceMs=2e3}connect(){let e=this.mqttLibObject?.default||this.mqttLibObject;return this.lastWarnTime=0,typeof e?.connect==`function`?(this.mqttClient=e.connect(this.options),this.registerTokenUpdatedListener(),!0):(console.error(`MQTT Error: Invalid or missing library. 'connect' function not found.`),!1)}setOptions(e){this.options=Object.assign(this.options,e),this.isV31()&&(this.options.protocolId=`MQIsdp`,this.options.protocolVersion=3),this.isV50()&&(this.options.protocolVersion=5),this.options?.hostname||(this.options.hostname=this.options.host),yf.applyMqttAuthOptions(this.options)}setMqttLibObject(e){this.mqttLibObject=e}setHttpClient(e){this.httpClient=e}on(e,t,n){if(typeof this.mqttClient?.on!=`function`){typeof n==`function`&&n(`sensorThingsMqtt.js, on: the mqttClient is not ready to react to events. Set mqttClient and connect before adding events.`);return}else if(typeof t!=`function`){typeof n==`function`&&n(`sensorThingsMqtt.js, on: the given event handler must be a function`);return}else if(e===`disconnect`&&(this.isV31()||this.isV311())){typeof n==`function`&&n(`sensorThingsMqtt.js, on(disconnect): this event is only supported for mqtt 5.0 or higher`);return}Object.prototype.hasOwnProperty.call(this.handlers,e)||(this.handlers[e]=[],this.mqttClient.on(e,(...t)=>{this.callHandlers(this.handlers[e],e,...t)})),this.handlers[e].push(t)}callHandlers(e,t,...n){Array.isArray(e)&&e.forEach(e=>{typeof e==`function`&&(t===`message`?this.callMessageHandler(e,this.options.context,...n):e.apply(this.options.context,n))})}callMessageHandler(e,t,n,r,i){let a=``,o=``;try{a=JSON.parse(r)}catch{a=r.toString()}try{o=JSON.parse(i)}catch{o=i}e.call(t,n,a,o)}async subscribe(e,t,n,r){if(typeof this.mqttClient?.subscribe!=`function`){typeof r==`function`&&r(`sensorThingsMqtt.js, subscribe: the mqttClient is not ready to subscribe. Set mqttClient and connect before adding subscriptions.`);return}let i=Object.assign({qos:0,rh:2},t);await new Promise(t=>{this.mqttClient.subscribe(e,i,(a,o)=>{if(a){let t=Date.now();(!this.lastWarnTime||t-this.lastWarnTime>1e4)&&(console.warn(`MQTT: Server rejected subscription for [${e}] (further warnings suppressed for 10s)! Error:`,a),this.lastWarnTime=t)}if(t(),a){typeof r==`function`&&r(a);return}typeof n==`function`&&Array.isArray(o)&&o.length&&n(o[0]?.topic,o[0]?.qos),i.rh!==2&&(this.isV31()||this.isV311())&&this.simulateRetainedHandling(this.options.rhPath,e,this.handlers.message,r)})})}unsubscribe(e,t,n,r){if(typeof this.mqttClient?.unsubscribe!=`function`){typeof r==`function`&&r(`sensorThingsMqtt.js, unsubscribe: the mqttClient is not ready to unsubscribe. Set mqttClient and connect before unsubscribe.`);return}this.mqttClient.unsubscribe(e,t,e=>{if(e&&typeof r==`function`){r(e);return}typeof n==`function`&&n()})}end(e=!1,t=null,n=null,r=null){if(typeof this.mqttClient?.end!=`function`){typeof r==`function`&&r(`sensorThingsMqtt.js, end: the mqttClient is not ready to end. Set mqttClient and connect before ending the connection.`);return}this.mqttClient.end(e,t,n),this.unregisterTokenUpdatedListener()}registerTokenUpdatedListener(){this.tokenUpdatedListener=$.watch((e,t)=>t[`Modules/Login/accessToken`],(e,t)=>{e&&t!==e&&this.reconnectWithUpdatedAuth()})}unregisterTokenUpdatedListener(){typeof this.tokenUpdatedListener==`function`&&(this.tokenUpdatedListener(),this.tokenUpdatedListener=null)}reconnectWithUpdatedAuth(){let e=this.mqttClient,t=Date.now();!e||typeof e.reconnect!=`function`||typeof this.lastReconnectAt==`number`&&t-this.lastReconnectAt<this.reconnectDebounceMs||((typeof e.o
3ptions!=`object`||e.options===null)&&(e.options={}),yf.applyMqttAuthOptions(e.options),this.lastReconnectAt=t,e.reconnect())}simulateRetainedHandling(e,t,n,r){if(!Array.isArray(n)||!n.length)return;if(typeof this.httpClient?.get!=`function`){typeof r==`function`&&r(`sensorThingsMqtt.js, simulateRetainedHandling: to siumlate retained messages a httpClient must be set.`);return}else if(typeof e!=`string`){typeof r==`function`&&r(`sensorThingsMqtt.js, simulateRetainedHandling: To use simulateRetainedHandling the rhPath must be given with the options.`);return}else if(typeof t!=`string`){typeof r==`function`&&r(`sensorThingsMqtt.js, simulateRetainedHandling: A retained message can't be simulated without a topic.`);return}let i=t.substring(t.lastIndexOf(`/`)).toLocaleLowerCase(),a=e.substr(-1)===`/`?e:e+`/`;a+=t,i.indexOf(`observations`)!==-1&&(a+=`?%24orderby=phenomenonTime%20desc&%24top=1`),this.httpClient.get(a,e=>{n.forEach(n=>{typeof n==`function`&&Array.isArray(e)&&e.length&&n(t,e[0],{cmd:`simulate`,dup:!1,qos:0,retain:!0,topic:t,payload:e[0]})})},null,null,r)}isV31(){return this.options.mqttVersion===`3.1`}isV311(){return this.options.mqttVersion===`3.1.1`}isV50(){return this.options.mqttVersion===`5.0`}},xf=class e{constructor(t=null){let n=JSON.stringify({host:t?.host,port:t?.port,path:t?.path,protocol:t?.protocol,mqttVersion:t?.mqttVersion,rhPath:t?.rhPath}),r=null;return(typeof e.instances!=`object`||e.instances===null)&&(e.instances={}),Object.prototype.hasOwnProperty.call(e.instances,n)?e.instances[n]:(r=new bf,r.setOptions(t),r.setMqttLibObject(nt),r.setHttpClient(new Nd),r.connect()&&(e.instances[n]=r),r)}};G.default.extend(Dd.default),G.default.extend(Ed.default);function Y(e){let t={epsg:`EPSG:4326`,showSettings:!0,sourceUpdated:!1,subscriptionTopics:{},mqttClient:null,timezone:`Europe/Berlin`,utc:`+1`,version:`1.1`,showNoDataValue:!0,noDataValue:`no data`,loadThingsOnlyInCurrentExtent:!1,mqttRh:2,mqttQos:2,mqttOptions:{},datastreamAttributes:[`@iot.id`,`@iot.selfLink`,`Observations`,`description`,`name`,`observationType`,`observedArea`,`phenomenonTime`,`properties`,`resultTime`,`unitOfMeasurement`],thingAttributes:[`@iot.id`,`@iot.selfLink`,`Locations`,`description`,`name`,`properties`]};this.attributes=Object.assign(t,e),this.styleRule=[],this.showHistoricalFeatures=!0,J.call(this,this.attributes),this.initializeSensorThings(),this.intervallRequest=null,this.keepUpdating=!1,this.moveLayerRevisible=``,this.subscribedDataStreamIds={},this.isSubscribed=!1,this.locationUpdating={},this.eventKeys={},this.lastScale=null,this.registerInteractionMapResolutionListeners(this.get(`scaleStyleByZoom`)),G.default.locale()!==`de`&&G.default.locale(Od.default),this.registerInteractionMapScaleListeners(),this.prepareFeaturesFor3D(this.layer?.getSource().getFeatures())}Y.prototype=Object.create(J.prototype),Y.prototype.createLayer=function(e){let t=this.getRawLayerAttributes(e),n=this.getLayerParams(e),r=this.getOptions(e);this.setLayer(this.createVectorLayer(t,{layerParams:n,options:r}))},Y.prototype.getRawLayerAttributes=function(e){return{clusterDistance:e.clusterDistance,id:e.id,url:e.url,version:e.version}},Y.prototype.getOptions=function(e){return{clusterGeometryFunction:this.clusterGeometryFunction,featuresFilter:t=>this.featuresFilter(e,t),onLoadingError:this.onLoadingError}},Y.prototype.createVectorLayer=function(e={},{layerParams:t={},options:n={}}={}){let r=new Pe,i=new Rt(Object.assign({source:e.clusterDistance?new Re({source:r,distance:e.clusterDistance,geometryFunction:n.clusterGeometryFunction}):r,id:e.id},t));return e.style&&i.setStyle(e.style),i},Y.prototype.getActualSource=function(){let e=this.getLayerSource();return e instanceof Re?e.getSource():e},Y.prototype.updateLayerValues=function(e){if(this.get(`visibility`)!==e.visibility){let t=this.getStateOfSTALayer(e.visibility,this.isSubscribed);t===!0?this.startSubscription(this.getLayerSource().getFeatures()):t===!1&&this.stopSubscription()}this.getLayer()?.setOpacity((100-e.transparency)/100),this.getLayer()?.setVisible(e.visibility),this.getLayer()?.setZIndex(e.zIndex)},Y.prototype.createLegend=async function(){let e=Ft.returnStyleObject(this.attributes.styleId),t=this.inspectLegendUrl();return Array.isArray(t)||(e&&t===!0?t=(await Jt.returnLegendByStyleId(e.styleId)).legendInformation:typeof t==`string`&&(t=[t])),t},Y.prototype.initStyle=function(e){$.getters.styleListLoaded?this.createStyle(e):$.watch((e,t)=>t.styleListLoaded,t=>{t&&this.createStyle(e)})},Y.prototype.createStyle=function(e){let t=Ft.returnStyleObject(e?.styleId),n=null;t===void 0?(this.setStyle(null),console.warn(i18next.t(`common:core.layers.errorHandling.wrongStyleId`,{styleId:e?.styleId}))):(this.styleRule=t.rules?t.rules:null,n=function(n,r){let i=n===void 0?this:n,a=typeof i.get(`features`)==`function`||typeof i.get(`features`)==`object`&&i.get(`features`).length>1,o=Jt.createStyle(t,i,a,Config.wfsImgPath,{layerId:e.id}),s=Array.isArray(o)?o[0]:o,c=mapCollection.getMapView(`2D`),l=c.getZoomForResolution(r)+1,u=c.getResolutions().length;return s?.getImage()!==null&&e.scaleStyleByZoom&&s.getImage().setScale(s.getImage().getScale()*l/u),o},this.setStyle(n))},Y.prototype.initializeSensorThings=function(){this.isSubscribed=!1;try{this.createMqttConnectionToSensorThings(this.get(`url`),this.get(`mqttOptions`),this.get(`timezone`),this.get(`showNoDataValue`),this.get(`noDataValue`))}catch(e){console.error(`Connecting to mqtt-broker failed. Won't receive live updates. Reason:`,e)}this.toggleSubscriptionsOnMapChanges(),$.getters[`Maps/scale`]>this.get(`maxScaleForHistoricalFeatures`)&&(this.showHistoricalFeatures=!1)},Y.prototype.createMqttConnectionToSensorThings=function(e,t,n,r,i){if(typeof e!=`string`||!e)return;let a=this.getMqttHostFromUrl(e,e=>{console.error(e)}),o=Object.assign({browserBufferSize:65536,host:a,rhPath:e,context:this,path:`/mqtt`,protocol:`wss`,mqttVersion:`3.1.1`},t);this.mqttClient=new xf(o),this.mqttClient.on(`message`,(e,t)=>
3{let a=this.getDatastreamIdFromMqttTopic(e),o=this.getActualSource(),s=typeof o.getFeatures==`function`&&Array.isArray(o.getFeatures())?o.getFeatures():[],c=this.getFeatureByDatastreamId(s,a),l=this.getLocalTimeFormat(t.phenomenonTime,n),u=null;if(this.updateObservationForDatastreams(c,a,t),this.get(`observeLocation`)&&q(c)&&(u=c.clone()),this.updateFeatureProperties(c,a,t.result,l,r,i),this.get(`observeLocation`)&&q(c)&&q(t?.location)&&this.subscribedDataStreamIds[a]?.subscribed){if(typeof c?.get!=`function`)return;this.updateFeatureLocation(c,t,()=>{this.locationUpdating[c.get(`dataStreamId`)]=!1}),this.showHistoricalFeatures&&Array.isArray(c.get(`historicalFeatureIds`))&&c.get(`historicalFeatureIds`).length&&this.updateHistoricalFeatures(c,u,o)}})},Y.prototype.updateHistoricalFeatures=function(e,t,n){if(typeof e?.get!=`function`||!Array.isArray(e.get(`historicalFeatureIds`))||typeof t?.set!=`function`)return;let r=e.get(`historicalFeatureIds`).pop();r!==void 0&&n.removeFeature(n.getFeatureById(r)),t.set(`dataStreamId`,void 0),t.setId(zr(`historicalFeature-`)),e.get(`historicalFeatureIds`).unshift(t.getId()),n.addFeature(t),e.get(`historicalFeatureIds`).forEach((t,r)=>{let i=this.getScale(r,e.get(`historicalFeatureIds`).length,this.get(`scaleStyleByZoom`),mapCollection.getMapView(`2D`).getZoom()+1,mapCollection.getMapView(`2D`).getResolutions().length);q(n.getFeatureById(t))&&(n.getFeatureById(t).set(`originScale`,this.getScale(r,e.get(`historicalFeatureIds`).length)),this.setStyleOfHistoricalFeature(n.getFeatureById(t),i,this.styleRule))})},Y.prototype.getMqttHostFromUrl=function(e,t){if(typeof e!=`string`)return typeof t==`function`&&t(Error(`getMqttHostFromUrl: the given url is not a string.`)),``;let n=e.split(`/`)[2];return typeof n==`string`?n:(typeof t==`function`&&t(Error(`getMqttHostFromUrl: the given url does not include the host name.`)),``)},Y.prototype.getDatastreamIdFromMqttTopic=function(e){if(typeof e!=`string`)return``;let t=e.indexOf(`Datastreams(`);return t===-1?``:e.substring(t+12,e.indexOf(`)`,t+12))},Y.prototype.getFeatureByDatastreamId=function(e,t){if(!Array.isArray(e)||typeof t!=`string`)return null;let n=e.length;for(let r=0;r<n;r++)if(!(typeof e[r]?.get!=`function`||typeof e[r].get(`dataStreamId`)!=`string`||!e[r].get(`dataStreamId`).split(` | `).includes(t)))return e[r];return null},Y.prototype.initializeConnection=function(e,t=!1){let n=this.get(`url`),r=this.get(`version`),i=this.get(`urlParameter`),a={extent:$.getters[`Maps/extent`],sourceProjection:mapCollection.getMapView(`2D`).getProjection().getCode(),targetProjection:this.get(`epsg`)},o=typeof this.get(`intersect`)!=`boolean`||this.get(`intersect`),s=mapCollection.getMapView(`2D`).getProjection(),c=this.get(`epsg`),l=this.get(`gfiTheme`),u=this.get(`utc`),d=this.getDatastreamIdsInCurrentExtent(this.getLayerSource().getFeatures(),$.getters[`Maps/extent`]);this.callSensorThingsAPI(n,r,i,a,o,n=>{let r=t?n.filter(e=>!d.includes(e?.properties?.dataStreamId)):n,i=this.createFeaturesFromSensorData(r,s,c,l,u),a=this.getActualSource(),o=a.getFeatures().filter(e=>e.get(`dataStreamId`)===void 0),f={};this.get(`loadThingsOnlyInCurrentExtent`)&&o.forEach(e=>{f[e.getId()]=e.clone()}),t||a.clear(),Array.isArray(i)&&i.length&&(q(i[0])&&typeof i[0].getGeometry==`function`&&(i[0].getGeometry().getType()===`Point`||i[0].getGeometry().getType()===`MultiPoint`)&&this.prepareFeaturesFor3D(i),a.addFeatures(i)),i.forEac
3h(e=>{typeof e?.get==`function`&&Array.isArray(e.get(`historicalFeatureIds`))&&e.unset(`historicalFeatureIds`)}),typeof e==`function`&&e(i),typeof this.get(`historicalLocations`)==`number`&&this.showHistoricalFeatures&&this.get(`loadThingsOnlyInCurrentExtent`)&&Object.entries(f).length&&(i.forEach(e=>{let t=e.get(`dataStreamId`);this.subscribedDataStreamIds[t]?.subscribed&&Array.isArray(this.subscribedDataStreamIds[t].historicalFeatureIds)&&(e.set(`subscribed`,!0),e.set(`historicalFeatureIds`,this.subscribedDataStreamIds[t].historicalFeatureIds))}),Object.entries(f).forEach(([e,t])=>{t.setId(e),a.addFeature(t)})),this.get(`observeLocation`)&&this.get(`loadThingsOnlyInCurrentExtent`)&&this.getHistoricalLocationsOfFeatures(),a.dispatchEvent({type:`featuresloadend`,features:a.getFeatures()})},e=>{console.warn(e),typeof this.options?.onLoadingError==`function`&&this.options.onLoadingError(e)})},Y.prototype.callSensorThingsAPI=function(e,t,n,r,i,a,o){let s=this.buildSensorThingsUrl(e,t,n),c=new Nd({rootNode:n?.root});this.get(`loadThingsOnlyInCurrentExtent`)?c.getInExtent(s,r,i,r=>{typeof a==`function`&&a(this.getAllThings(r,n,e,t))},null,null,o):c.get(s,r=>{typeof a==`function`&&a(this.getAllThings(r,n,e,t))},null,null,o)},Y.prototype.buildSensorThingsUrl=function(e,t,n){let r=n?.root||`Things`,i=typeof t==`number`?t.toFixed(1):t,a=``;if(q(n))for(let e in n)e!==`root`&&(a!==``&&(a+=`&`),Array.isArray(n[e])?n[e].length&&(a+=`$`+e+`=`+n[e].join(`,`)):a+=`$`+e+`=`+n[e]);return`${e}/v${i}/${r}?${a}`},Y.prototype.getAllThings=function(e,t,n,r){let i;return t?.root===`Datastreams`?(i=this.changeSensordataRootToThings(e,this.get(`datastreamAttributes`),this.get(`thingAttributes`)),i=this.unifyThingsByIds(i)):i=this.flattenArray(e),i=this.createPropertiesOfDatastreams(i,this.get(`showNoDataValue`),this.get(`noDataValue`),this.get(`utc`),this.get(`timezone`)),i=this.aggregatePropertiesOfThings(i,n,r),i},Y.prototype.changeSensordataRootToThings=function(e,t,n){if(!Array.isArray(e))return[];let r=[],i=this.createAssociationObject(t),a=this.createAssociationObject(n);return e.forEach(e=>{if(!q(e?.Thing))return;let t={},n={Datastreams:[t]};Object.keys(e).forEach(n=>{Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=e[n])}),Object.keys(e.Thing).forEach(t=>{Object.prototype.hasOwnProperty.call(a,t)&&(n[t]=e.Thing[t])}),r.push(n)}),r},Y.prototype.createAssociationObject=function(e){if(!Array.isArray(e))return{};let t={};return e.forEach(e=>{t[e]=!0}),t},Y.prototype.unifyThingsByIds=function(e){if(!Array.isArray(e))return[];let t={};return e.forEach(e=>{if(q(e)){if(!q(t[e[`@iot.id`]])){t[e[`@iot.id`]]=e;return}t[e[`@iot.id`]].Datastreams=t[e[`@iot.id`]].Datastreams.concat(e.Datastreams)}}),Object.values(t)},Y.prototype.flattenArray=function(e){if(!Array.isArray(e))return e;let t=[];return e.forEach(e=>{Array.isArray(e)?t=t.concat(e):t.push(e)}),t},Y.prototype.createPropertiesOfDatastreams=function(e,t,n,r,i){return Array.isArray(e)?(e.forEach(e=>{!q(e)||!Array.isArray(e.Datastreams)||(q(e.properties)||(e.properties={}),e.properties.dataStreamId=[],e.properties.dataStreamName=[],e.properties.dataStreamValue=[],e.properties.dataPhenomenonTime=[],this.createPropertiesOfDatastreamsHelper(e.Datastreams,e.properties,t,n,r,i),e.properties.dataStreamId=e.properties.dataStreamId.join(` | `),e.properties.dataStreamValue=e.properties.dataStreamValue.join(` | `),e.properties.dataStreamName=e.properties.dataStreamName.join(` | `),e.properties.dataPhenomenonTime=e.properties.dataPhenomenonTime.join(` | `))}),e):[]},Y.prototype.createPropertiesOfDatastreamsHelper=function(e,t,n,r,i,a){return!Array.isArray(e)||!q(t)?!1:(e.forEach(e=>{if(!q(e))return;let o=String(e[`@iot.id`]),s=e.name,c=Array.isArray(e.Observations)?e.Observations[0]?.result:``,l=e.unitOfMeasurement?.name,u=`dataStream_`+o+`_`+s,d=Array.isArray(e.Observations)?e.Observations[0]?.phenomenonTime:``;this.moveDatastreamPropertiesToThing(t,e.properties),d=jd(d?.split(`/`)[0],i),t.dataStreamId.push(o),t.dataStreamName.push(s),c===``?n&&(t[u]=r,t[u+`_phenomenonTime`]=r,t.dataStreamValue.push(r)):(t[u]=c,t[u+`_phenomenonTime`]=this.getLocalTimeFormat(d,a),t.dataStreamValue.push(c),t.dataPhenomenonTime.push(d)),l!==void 0&&this.get(`rotationUnit`)!==void 0&&l===this.get(`rotationUnit`)&&(t.rotation={isDegree:!0,value:c===void 0?0:c})}),!0)},Y.prototype.moveDatastreamPropertiesToThing=function(e,t){return!q(e)||!q(t)?!1:(Object.entries(t).forEach(([t,n])=>{e[t]===void 0?e[t]=n:e[t]=e[t]+` | `+n}),!0)},Y.prototype.getLocalTimeFormat=function(e,t){let n=this.getFirstPhenomenonTime(e);return n?(0,G.default)(n).tz(t).format(`LLL`):``},Y.prototype.getFirstPhenomenonTime=function(e){if(typeof e==`string`)return e.split(`/`).length===2?e.split(`/`)[0]:e},Y.prototype.aggregatePropertiesOfThings=function(e,t,n){if(!Array.isArray(e))return[];let r=[];
3return e.forEach(e=>{let i={};Array.isArray(e)?this.aggregatePropertiesOfThingAsArray(e,i):this.aggregatePropertiesOfOneThing(e,i),q(i.properties)||(i.properties={}),i.properties.requestUrl=t,i.properties.versionUrl=n,r.push(i)}),r},Y.prototype.aggregatePropertiesOfThingAsArray=function(e,t){if(!Array.isArray(e)||!q(t))return!1;let n=[],r={},i=[];return t.location=this.getThingsGeometry(e[0],0),e.forEach(e=>{!q(e)||!q(e.properties)||(n.push(Object.keys(e.properties)),r=Object.assign(r,e.properties),e?.Datastreams&&(i=i.concat(e.Datastreams)))}),n=[...new Set(this.flattenArray(n))],n.push(`name`),n.push(`description`),n.push(`@iot.id`),t.properties=Object.assign({},r,this.aggregateProperties(e,n)),i.length>0&&(t.properties.Datastreams=i),!0},Y.prototype.getThingsGeometry=function(e,t){let n=e?.Locations||e?.Thing?.Locations,r=n&&Object.prototype.hasOwnProperty.call(n,t)&&n[t]?.location?n[t].location:null;return r?.geometry&&r.geometry?.type?r.geometry:r?.type?r:null},Y.prototype.aggregateProperties=function(e,t){let n={};return t.forEach(t=>{let r=[];e.forEach(e=>{t===`name`||t===`description`||t===`@iot.id`?r.push(e[t]):r.push(e.properties[t])}),n[t]=r.join(` | `)}),n},Y.prototype.aggregatePropertiesOfOneThing=function(e,t){return!q(e)||!q(t)?!1:(t.location=this.getThingsGeometry(e,0),t.properties=e.properties,q(t.properties)||(t.properties={}),t.properties.name=e.name,t.properties.description=e.description,t.properties[`@iot.id`]=e[`@iot.id`],e?.Datastreams&&(t.properties.Datastreams=e.Datastreams),!0)},Y.prototype.createFeaturesFromSensorData=function(e,t,n,r,i,a=!1){if(!Array.isArray(e)||n===void 0)return[];let o=[];return e.forEach((s,c)=>{if(!s?.location)return;let l=this.createFeatureByLocation(s.location,t,n,e=>{console.warn(e)});l.setId(c),l.setProperties(s.properties,!0),q(r)&&l.set(`gfiParams`,r?.params,!0),l.set(`utc`,i,!0),a&&(l.set(`scale`,this.getScale(c-1,e.length-1,this.get(`scaleStyleByZoom`),mapCollection.getMapView(`2D`).getZoom()+1,mapCollection.getMapView(`2D`).getResolutions().length)),l.set(`originScale`,this.getScale(c-1,e.length-1))),l=this.aggregateDataStreamValue(l),l=this.aggregateDataStreamPhenomenonTime(l),o.push(l)}),o.filter(e=>e.getGeometry()!==void 0)},Y.prototype.createFeatureByLocation=function(e,t,n,r){let i=new dn({featureProjection:t,dataProjection:n});try{return i.readFeature(e)}catch{typeof r==`function`&&r(Error(`createFeatureByLocation: JSON structure in sensor thing location can't be parsed.`))}return null},Y.prototype.aggregateDataStreamValue=function(e){let t=e,n=[];return e&&e.get(`dataStreamId`)&&(e.get(`dataStreamId`).split(` | `).forEach((t,r)=>{let i=e.get(`dataStreamName`).split(` | `)[r];this.get(`showNoDataValue`)&&e.get(`dataStream_`+t+`_`+i)===``?n.push(this.get(`noDataValue`)):e.get(`dataStream_`+t+`_`+i)&&n.push(e.get(`dataStream_`+t+`_`+i))}),n.length>0&&t.set(`dataStreamValue`,n.join(` | `),!0)),t},Y.prototype.aggregateDataStreamPhenomenonTime=function(e){let t=e,n=[];return e&&e.get(`dataStreamId`)&&(e.get(`dataStreamId`).split(` | `).forEach((t,r)=>{let i=e.get(`dataStreamName`).split(` | `)[r];this.get(`showNoDataValue`)&&!e.get(`dataStream_`+t+`_`+i+`_phenomenonTime`)?n.push(this.get(`noDataValue`)):e.get(`dataStream_`+t+`_`+i+`_phenomenonTime`)&&n.push(e.get(`dataStream_`+t+`_`+i+`_phenomenonTime`))}),t.set(`dataStreamPhenomenonTime`,n.join(` | `),!0)),t},Y.prototype.toggleSubscriptionsOnMapChanges=function(){let e=this.getStateOfSTALayer(this.getLayer().getVisible(),this.isSubscribed);e===!0?(this.startSubscription(this.getLayer().getSource().getFeatures()),this.get(`observeLocation`)&&this.moveLayerRevisible===!1&&(this.moveLayerRevisible=e)):e===!1&&this.stopSubscription()},Y.prototype.stopSubscription=function(){let e=this.get(`subscriptionTopics`),t=this.get(`version`),n=this.mqttClient;this.isSubscribed=!1,$.dispatch(`Maps/unregisterListener`,{type:`moveend`,listener:this.updateSubscription.bind(this),keyForBoundFunctions:this.updateSubscription.toString()+this.attributes.id}),this.unsubscribeFromSensorThings([],e,t,n),clearTimeout(this.intervallRequest),this.keepUpdating=!1},Y.prototype.getStateOfSTALayer=function(e,t){if(e&&!t)return!0;
3if(!e&&t)return!1},Y.prototype.startSubscription=function(e){this.isSubscribed=!0,!this.get(`loadThingsOnlyInCurrentExtent`)&&Array.isArray(e)&&!e.length?this.initializeConnection(function(){this.startSubscriptionUpdating()}.bind(this)):this.startSubscriptionUpdating()},Y.prototype.startSubscriptionUpdating=function(){this.updateSubscription(),$.dispatch(`Maps/registerListener`,{type:`moveend`,listener:this.updateSubscription.bind(this),keyForBoundFunctions:this.updateSubscription.toString()+this.attributes.id}),this.keepUpdating=!0,this.get(`enableContinuousRequest`)&&this.startIntervalUpdate(typeof this.get(`factor`)==`number`?this.get(`factor`)*1e3:void 0)},Y.prototype.startIntervalUpdate=function(e){!this.keepUpdating||typeof e!=`number`||(this.intervallRequest!==null&&clearTimeout(this.intervallRequest),this.intervallRequest=setTimeout(()=>{let t=this.getDatastreamIdsInCurrentExtent(this.getLayerSource().getFeatures(),$.getters[`Maps/extent`]),n=this.get(`subscriptionTopics`),r=this.get(`version`),i=this.mqttClient,a=this.get(`mqttRh`),o=this.get(`mqttQos`);this.unsubscribeFromSensorThings(t,n,r,i),this.initializeConnection(e=>{this.subscribeToSensorThings(this.getDatastreamIdsInCurrentExtent(e,$.getters[`Maps/extent`]),n,r,i,{rh:a,qos:o})},!0),this.startIntervalUpdate(e)},e))},Y.prototype.updateSubscription=async function(){let e=this.getDatastreamIdsInCurrentExtent(this.getLayer().getSource().getFeatures(),$.getters[`Maps/extent`]),t=this.get(`subscriptionTopics`),n=this.get(`version`),r=this.mqttClient,i=this.get(`mqttRh`),a=this.get(`mqttQos`);!this.get(`loadThingsOnlyInCurrentExtent`)&&!this.moveLayerRevisible?(this.unsubscribeFromSensorThings(e,t,n,r),await this.subscribeToSensorThings(e,t,n,r,{rh:i,qos:a}),typeof this.get(`historicalLocations`)==`number`&&this.getHistoricalLocationsOfFeatures()):(this.unsubscribeFromSensorThings(e,t,n,r),this.initializeConnection(async()=>{await this.subscribeToSensorThings(this.getDatastreamIdsInCurrentExtent(this.getLayer().getSource().getFeatures(),$.getters[`Maps/extent`]),t,n,r,{rh:i,qos:a})})),this.moveLayerRevisible=!1},Y.prototype.getDatastreamIdsInCurrentExtent=function(e,t){let n=this.getFeaturesInExtent(e,t);return this.getDatastreamIds(n)},Y.prototype.getFeaturesInExtent=function(e,t){let n=[],r=t;return r=this.get(`maxSpeedKmh`)===void 0?this.enlargeExtent(t,.05):this.enlargeExtentForMovableFeatures(t,this.get(`maxSpeedKmh`),this.get(`factor`)),e.forEach(e=>{Ut(r,e.getGeometry().getExtent())&&n.push(e)}),n},Y.prototype.enlargeExtent=function(e,t){return tn(e,(e[2]-e[0])*t)},Y.prototype.enlargeExtentForMovableFeatures=function(e,t,n=10){let r=n;return!Array.isArray(e)||e.length!==4?(console.error(`sta.enlargeExtentForMovableFeatures: The first parameter must be an array with the length of 4, but got `+typeof e),!1):typeof t==`number`?(typeof n!=`number`&&(console.error(`sta.enlargeExtentForMovableFeatures: The third parameter must be a number, but got `+typeof n+`. Use the default 10 instead.`),r=10),tn(e,t/3600*1e3*r)):(console.error(`sta.enlargeExtentForMovableFeatures: The second parameter must be a number, but got `+typeof t),!1)},Y.prototype.getDatastreamIds=function(e){if(!Array.isArray(e))return[];let t=[];return e.forEach(e=>{typeof e?.get==`function`&&Array.isArray(e.get(`features`))?e.get(`features`).forEach(e=>{this.getDatastreamIdsHelper(e,t)}):this.getDatastreamIdsHelper(e,t)}),t},Y.prototype.getDatastreamIdsHelper=function(e,t){return typeof e?.get!=`function`||typeof e.get(`dataStreamId`)!=`string`||!Array.isArray(t)?!1:(e.get(`dataStreamId`).split(` | `).forEach(e=>{t.push(e)}),!0)},Y.prototype.unsubscribeFromSensorThings=function(e,t,n,r){if(!Array.isArray(e)||!q(t)||!q(r))return!1;let i={};return e.forEach(e=>{i[e]=!0}),Object.entries(t).forEach(([e,a])=>{if(a===!0&&!Object.prototype.hasOwnProperty.call(i,e)){if(r.unsubscribe(`v`+n+`/Datastreams(`+e+`)/Observations`),this.get(`observeLocation`)){r.unsubscribe(`v`+n+`/Datastreams(`+e+`)/Thing/Locations`),typeof this.get(`historicalLocations`)==`number`&&this.showHistoricalFeatures&&this.resetHistoricalLocations(e);
3let t=this.getActualSource(),i=this.getFeatureByDatastreamId(t.getFeatures(),e);typeof i?.set==`function`&&i.set(`subscribed`,!1),this.subscribedDataStreamIds[e]=!1}t[e]=!1}}),!0},Y.prototype.subscribeToSensorThings=async function(e,t,n,r,i={}){if(!Array.isArray(e)||!q(t)||!q(r))return!1;let a=this.getActualSource(),o=t;for(let s=0;s<e.length;s++){let c=e[s];if(c&&!t[c]){await r.subscribe(`v`+n+`/Datastreams(`+c+`)/Observations`,i),this.get(`observeLocation`)&&await r.subscribe(`v`+n+`/Datastreams(`+c+`)/Thing/Locations`,i,()=>{this.get(`loadThingsOnlyInCurrentExtent`)||this.fetchHistoricalLocationsByDatastreamId(a.getFeatures(),c,parseInt(this.get(`historicalLocations`),10),this.get(`url`),{orderby:`time+desc`,expand:`Locations`},this.get(`version`),()=>{this.locationUpdating[c]=!1})}),o[c]=!0;let e=this.getFeatureByDatastreamId(a.getFeatures(),c);if(!q(e))continue;e.set(`subscribed`,!0,!0),this.subscribedDataStreamIds[c]={subscribed:!0}}}return!0},Y.prototype.updateObservationForDatastreams=function(e,t,n){typeof e?.get!=`function`||!Array.isArray(e.get(`Datastreams`))||e.get(`Datastreams`).forEach(e=>{e[`@iot.id`]!==void 0&&String(e[`@iot.id`])===String(t)&&(e.Observations=[n])})},Y.prototype.updateFeatureLocation=function(e,t,n){if(typeof e?.getGeometry!=`function`||!Array.isArray(t?.location?.geometry?.coordinates)||!t.location.geometry.coordinates.length)return;let r=this.get(`crs`),i=this.get(`epsg`)===r?t.location.geometry.coordinates:j.transform(this.get(`epsg`),r,t.location.geometry.coordinates);typeof n==`function`&&(this.locationUpdating[e.get(`dataStreamId`)]=!0,this.eventKeys[e.get(`dataStreamId`)]=e.getGeometry().once(`change`,()=>{n()})),e.getGeometry().setCoordinates(i)},Y.prototype.updateFeatureProperties=function(e,t,n,r,i,a){if(typeof e?.get!=`function`||typeof e?.set!=`function`||typeof e.get(`dataStreamId`)!=`string`||typeof e.get(`dataStreamName`)!=`string`)return!1;let o=e.get(`dataStreamId`).split(` | `).indexOf(String(t)),s=e.get(`dataStreamName`).split(` | `),c=Object.prototype.hasOwnProperty.call(s,o)?s[o]:``,l=n===``&&i?a:n;return e.set(`dataStream_`+t+`_`+c,l,!0),e.set(`dataStream_`+t+`_`+c+`_phenomenonTime`,r,!0),e.set(`dataStreamValue`,this.replaceValueInPipedProperty(e,`dataStreamValue`,t,l)),e.set(`dataStreamPhenomenonTime`,this.replaceValueInPipedProperty(e,`dataStreamPhenomenonTime`,t,r)),e.get(`rotation`)!==void 0&&l!==void 0&&e.set(`rotation`,{isDegree:!0,value:l}),!0},Y.prototype.registerInteractionMapScaleListeners=function(){$.watch((e,t)=>t[`Maps/scale`],e=>{if(e>this.get(`maxScaleForHistoricalFeatures`)){this.showHistoricalFeatures=!1,this.removeHistoricalFeatures(),this.lastScale=e;return}this.showHistoricalFeatures=!0,e<=this.get(`maxScaleForHistoricalFeatures`)&&this.lastScale>=this.get(`maxScaleForHistoricalFeatures`)&&(this.getHistoricalLocationsOfFeatures(),this.lastScale=e)})},Y.prototype.removeHistoricalFeatures=function(){let e=this.getActualSource();e.getFeatures().filter(e=>e.get(`dataStreamId`)!==void 0&&Array.isArray(e.get(`historicalFeatureIds`))).forEach(t=>{typeof t?.get==`function`&&(t.get(`historicalFeatureIds`).forEach(t=>e.removeFeature(e.getFeatureById(t))),t.unset(`historicalFeatureIds`))})},Y.prototype.replaceValueInPipedProperty=function(e,t,n,r){if(typeof e?.get!=`function`||typeof e.get(`dataStreamId`)!=`string`||typeof e.get(t)!=`string`||typeof t!=`string`||typeof n!=`string`||typeof r!=`string`)return``;let i=e.get(`dataStreamId`).split(` | `),a=e.get(t).split(` | `);return this.replaceValueInArrayByReference(a,i,n,r),a.join(` | `)},Y.prototype.replaceValueInArrayByReference=function(e,t,n,r){if(!Array.isArray(e)||!Array.isArray(t))return!1;let i=t.length;for(let a=0;a<i;a++)n===t[a]&&(e[a]=r);return!0},Y.prototype.fetchHistoricalLocations=function(e,t,n,r){if(typeof e!=`string`||typeof n!=`string`||!q(t))return;let i=this.buildSensorThingsUrl(e,n,t);new Nd({rootNode:t?.root}).getInExtent(i,{extent:$.getters[`Maps/extent`],sourceProjection:$.getters[`Maps/projection`].getCode(),targetProjection:this.get(`epsg`)},!0,e=>{typeof r==`function`&&r(e)},null,null,e=>{console.warn(e)})},Y.prototype.getHistoricalLocationsOfFeatures=function(){let e=this.getActualS
3ource().getFeatures(),t=e.filter(e=>e.get(`dataStreamId`)!==void 0&&!Array.isArray(e.get(`historicalFeatureIds`))),n=this.getDatastreamIdsInCurrentExtent(t,$.getters[`Maps/extent`]),r=this.get(`url`),i={orderby:`time+desc`,expand:`Locations`},a=this.get(`version`),o=parseInt(this.get(`historicalLocations`),10);n.forEach(t=>{this.fetchHistoricalLocationsByDatastreamId(e,t,o,r,i,a)})},Y.prototype.fetchHistoricalLocationsByDatastreamId=function(e,t,n,r,i,a,o){if(!Array.isArray(e)||t===void 0||isNaN(n)||typeof r!=`string`||!q(i)||typeof a!=`string`)return;let s=this.getFeatureByDatastreamId(e,t);i.root=`Datastreams(${t})/Thing/HistoricalLocations`,i.top=n+1,!(this.subscribedDataStreamIds[t]?.subscribed&&s.get(`historicalFeatureIds`))&&this.fetchHistoricalLocations(r,i,a,e=>{if(this.resetHistoricalLocations(t),this.locationUpdating[t]){this.parseSensorDataToFeature(s,e,i,r,a);return}!Array.isArray(e)||!Array.isArray(e[0]?.Locations)||!e[0].Locations.length||this.updateFeatureLocation(s,e[0].Locations[0],()=>{this.parseSensorDataToFeature(s,e,i,r,a),f(this.eventKeys[t]),typeof o==`function`&&o(),this.locationUpdating[s.get(`dataStreamId`)]=!1})})},Y.prototype.parseSensorDataToFeature=function(e,t,n,r,i){if(typeof e?.get!=`function`||Array.isArray(e.get(`historicalFeatureIds`)))return;let a=this.getActualSource(),o=$.getters[`Maps/projection`].getCode(),s=this.get(`epsg`),c=this.get(`gfiTheme`),l=this.get(`utc`),u=this.getAllThings(t,n,r,i),d=this.createFeaturesFromSensorData(u,o,s,c,l,!0),f=[];d.shift(),d.forEach(e=>{f.push(e.getId()),this.setStyleOfHistoricalFeature(e,e.get(`scale`),this.styleRule)}),a.addFeatures(d),e.set(`historicalFeatureIds`,f),q(this.subscribedDataStreamIds[e.get(`dataStreamId`)])&&Object.assign(this.subscribedDataStreamIds[e.get(`dataStreamId`)],{historicalFeatureIds:f})},Y.prototype.resetHistoricalLocations=function(e){let t=this.getActualSource(),n=t.getFeatures().filter(t=>typeof t?.get==`function`&&t.get(`dataStreamId`)===e)[0];typeof n?.get==`function`&&Array.isArray(n.get(`historicalFeatureIds`))&&(n.get(`historicalFeatureIds`).forEach(e=>t.removeFeature(t.getFeatureById(e))),n.unset(`historicalFeatureIds`))},Y.prototype.getScale=function(e,t,n=!1,r=1,i=1){return n?(.7-.5*e/t)*r/i:.7-.5*e/t},Y.prototype.setStyleOfHistoricalFeature=function(e,t,n){if(!Array.isArray(n)||!n.length||!n[0].style){console.error(`The style rule has wrong type, must be an array with at least one entry with prop style!`,n);return}e.setStyle(()=>this.getStyleOfHistoricalFeature(n[0].style,t))},Y.prototype.getStyleOfHistoricalFeature=function(e,t){let n,r,i,a;return e.type===`regularShape`?(n=e.rsRadius,r=e.rsFillColor,i=e.rsStrokeColor,a=e.rsStrokeWidth):(n=e.circleRadius?e.circleRadius:10,r=e.circleFillColor?e.circleFillColor:[0,153,255,1],i=e.circleStrokeColor?e.circleStrokeColor:[0,0,0,1],a=e.circleStrokeWidth?e.circleStrokeWidth:2),new T({image:new re({radius:n,fill:new S({color:r}),stroke:new x({color:i,width:a}),scale:t})})},Y.prototype.setDynamicalScaleOfHistoricalFeatures=function(e,t,n,r,i){!r||!i||typeof t!=`number`||n<1||e.forEach(e=>{if(e.getStyle()){let r=e.getStyle()(e);typeof r.getImage==`function`&&r.getImage()!==null&&(r.getImage().setScale(e.get(`originScale`)*t/n),e.setStyle(()=>r))}})},Y.prototype.registerInteractionMapResolutionListeners=function(e){e&&$.watch((e,t)=>t[`Maps/resolution`],t=>{let n=this.getActualSource().getFeatures().filter(e=>e.get(`dataStreamId`)===void 0&&e.get(`originScale`)!==void 0),r=mapCollection.getMapView(`2D`).getZoomForResolution(t)+1,i=mapCollection.getMapView(`2D`).getResolutions().length;this.setDynamicalScaleOfHistoricalFeatures(n,r,i,this.get(`observeLocation`),e)})};function Sf(e){let t={selectedStyleID:void 0,useMpFonts:!0};this.attributes=Object.assign(t,e),Xu.call(this,this.attributes),e.renderer===`webgl`&&xd.setLayerProperties(this),this.checkProjection(),this.setConfiguredLayerStyle()}Sf.prototype=Object.create(Xu.prototype),Sf.prototype.createLayer=function(e){let t=this.getRawLayerAttributes(e),n=this.getLayerParams(e);this.setLayer(at(t,{layerParams:n,options:{readStyleFromUrl:!1}}
3)),$.dispatch(`Maps/registerListener`,{type:`loadend`,listener:()=>{if(typeof this.layer.getSource!=`function`||typeof this.layer.getSource()?.getFeaturesInExtent!=`function`)return;let e=this.layer.getSource().getFeaturesInExtent($.getters[`Maps/extent`]);this.layer.getSource().dispatchEvent({type:`featuresloadend`,features:e})}})},Sf.prototype.getRawLayerAttributes=function(e){return e},Sf.prototype.getLayerParams=function(e){return{gfiAttributes:e.gfiAttributes,gfiTitleAttribute:e.gfiTitleAttribute,opacity:(100-e.transparency)/100,zIndex:e.zIndex,renderer:e.renderer,styleId:e.styleId,style:e.style,excludeTypesFromParsing:e.excludeTypesFromParsing,isPointLayer:e.isPointLayer}},Sf.prototype.checkProjection=function(e){let t=this.get(`crs`),n=e?.epsg||t;t!==n&&console.warn(`VT Layer ${e.name}: Map (${t}) and layer 4 (${n}) projection mismatch. View will be erroneous.`)},Sf.prototype.setConfiguredLayerStyle=function(){let e;if(this.get(`styleId`)&&this.get(`styleId`)!=="default")this.set(`selectedStyleID`,this.get(`styleId`)),e=this.setStyleById(this.get(`styleId`));else{if(this.get(`vtStyles`)!==void 0){let t=this.get(`vtStyles`).find(({defaultStyle:e})=>e)||this.get(`vtStyles`)[0];t!==void 0&&(this.set(`selectedStyleID`,t.id),e=this.setStyleByDefinition(t))}if(!e){console.warn(`Rendering VT layer ${this.get(`name`)} without style; falls back to OL default styles.`);return}}e&&e.then(()=>this.layer?.setVisible(this.get(`visibility`))).catch(e=>console.error(e))},Sf.prototype.setStyleById=function(e){let t=this.get(`vtStyles`)?.find(({id:t})=>t===e);return t?this.setStyleByDefinition(t):Promise.reject(`No style found with ID ${e} for layer ${this.get(`name`)}.`)},Sf.prototype.setStyleByDefinition=function({id:e,url:t,resolutions:n}){return B.get(t).then(e=>e.data).then(r=>{let i,a,o,s;if(!this.isStyleValid(r))throw Error(`Style set for VT layer is incomplete. Must feature layers, sources, and version. Received: "${JSON.stringify(r)}"`);this.get(`useMpFonts`)&&(s=this.addMpFonts),r.sprite?(i=r.sprite,i.includes(`./`)&&(i=new URL(i,t)),a=i.toString().concat(`.json`),o=i.toString().concat(`.png`),this.fetchSpriteData(a).then(i=>{Cn(this.getLayer(),r,{options:{readStyleFromUrl:!1,resolutions:n,spriteData:i,spriteImageUrl:o,getFonts:s}},t),this.set(`selectedStyleID`,e)})):(Cn(this.getLayer(),r,{options:{readStyleFromUrl:!1,resolutions:n,getFonts:s}},t),this.set(`selectedStyleID`,e))})},Sf.prototype.addMpFonts=function(e){return e.includes(`Bold`)|e.includes(`bold`)?`MasterPortalFont Bold`:e.includes(`Italic`)|e.includes(`italic`)?`MasterPortalFont Italic`:`MasterPortalFont`},Sf.prototype.isStyleValid=function(e){return!!e&&!!e.layers&&!!e.sources&&!!e.version},Sf.prototype.fetchSpriteData=function(e){return B.get(e).then(e=>e.data)},Sf.prototype.showFeaturesByIds=function(e){if(Array.isArray(e)){this.getLayer().get(`basicInitialStyle`)&&this.getLayer().setStyle(this.getLayer().get(`basicInitialStyle`));return}this.getLayer().get(`basicInitialStyle`)||this.getLayer().set(`basicInitialStyle`,this.getLayer().getStyle());let t=this.getLayer().getStyle();this.getLayer().setStyle((n,r)=>e[JSON.stringify(n.getProperties())]?t(n,r):null)};function Cf(e){let t={};this.sourceUpdated=!1,this.attributes=Object.assign(t,e),J.call(this,this.attributes),this.prepareFeaturesFor3D(this.layer?.getSource().getFeatures())}Cf.prototype=Object.create(J.prototype),Cf.prototype.createLayer=function(e){this.layer=this.createVectorLayer(e),this.features=e.features},Cf.prototype.createVectorLayer=function(e){return new Rt({source:new Pe({features:e.features}),name:e.name,typ:e.typ,gfiAttributes:e.gfiAttributes,id:e.id,alwaysOnTop:e.alwaysOnTop})},Cf.prototype.updateSource=function(){this.sourceUpdated===!1&&(this.sourceUpdated=!0,this.layer.getSource().refresh())};function wf(e){let t={crs:mapCollection.getMapView(`2D`).getProjection().getCode(),outputFormat:`XML`,version:`1.1.0`};this.attributes=Object.assign(t,e),J.call(this,this.attributes),this.prepareFeaturesFor3D(this.layer?.getSource().getFeatures())}wf.prototype=Object.create(J.prototype),wf.prototype.createLayer=function(e){let t=this.getRawLayerAttributes(e),n=this.getLayerParams(e),r=this.getOptions(e);
4e.fitCapabilitiesExtent&&e.visibility&&!e.encompassingBoundingBox&&(e.capabilitiesUrl?this.requestCapabilitiesToFitExtent():console.warn(`Please add a capabilitiesUrl for your layer configuration if you want to use fitCapabilitiesExtent!`)),this.setLayer(kn.createLayer(t,{layerParams:n,options:r}))},wf.prototype.getRawLayerAttributes=function(e){return{clusterDistance:e.clusterDistance,crs:e.crs,featureNS:e.featureNS,featureType:e.featureType,id:e.id,url:e.url,version:e.version}},wf.prototype.getOptions=function(e){return{clusterGeometryFunction:this.clusterGeometryFunction,doNotLoadInitially:e.doNotLoadInitially,featuresFilter:t=>this.featuresFilter(e,t),loadingParams:this.loadingParams(e),loadingStrategy:e.loadingStrategy===`all`?se:He,onLoadingError:this.onLoadingError,wfsFilter:e.wfsFilter,style:this.getStyleFunction(e)}},wf.prototype.loadFeaturesManually=function(e){kn.loadFeaturesManually(this.getRawLayerAttributes(e),this.layer.getSource())};function Tf(e,t){let n={};this.attributes=Object.assign(n,e),this.layerFactory=t,Array.isArray(e.children)?Xu.call(this,this.attributes):console.warn(`Wrong configuration for Grouplayer: children are missing.`,e)}Tf.prototype=Object.create(Xu.prototype),Tf.prototype.createLayer=function(e){let t=[],n=[],r=isNaN(e.transparency)?1:(100-e.transparency)/100,i=null;e.children.forEach(r=>{let i=r.autoRefresh!==void 0&&r.autoRefresh!==null,a=e.autoRefresh!==void 0&&e.autoRefresh!==null,o={...r,autoRefresh:!i&&a?e.autoRefresh:r.autoRefresh,visibility:e.visibility},s=this.layerFactory.createLayer(o,`2D`);t.push(s.getLayer()),n.push(s)}),i=new ft({layers:t,zIndex:e.zIndex,opacity:r}),i.getSource=()=>n,this.setLayer(i)},Tf.prototype.updateLayerValues=function(e){Xu.prototype.updateLayerValues.call(this,e),this.getLayerSource().forEach(t=>{let n={...t.attributes,visibility:e.visibility};t.updateLayerValues(n)})},Tf.prototype.controlAutoRefresh=function(){},Tf.prototype.startAutoRefresh=function(){},Tf.prototype.stopAutoRefresh=function(){},Tf.prototype.setLayerSource=function(){this.layerSource=this.getLayer().getSource()},Tf.prototype.getLayerSource=function(){return this.layerSource},Tf.prototype.addErrorListener=function(){this.layerSource.forEach(e=>{Xu.prototype.addErrorListener.call(e.getLayerSource())})};function Ef(e){let t={};this.attributes=Object.assign(t,e),Yu.call(this,this.attributes)}Ef.prototype=Object.create(Yu.prototype),Ef.prototype.setVisible=function(e,t,n={}){this.getLayer()?.setVisible(e,n,t)},Ef.prototype.updateLayerValues=function(e){this.get(`visibility`)!==e.visibility&&this.setVisible(e.visibility,mapCollection.getMap(`3D`),e)},Ef.prototype.setStyle=function(e){let t=e===null?void 0:e;this.set(`style`,t)},Ef.prototype.createLegend=async function(){let e=Ft.returnStyleObject(this.get(`styleId`)),t=this.inspectLegendUrl();if(!Array.isArray(t))if(e&&t===!0){let n=await Jt.returnLegendByStyleId(e.styleId),r=this.layer?.getSource().getFeatures()[0].getGeometry().getType(),i=[];r===`MultiLineString`?(i.push(n.legendInformation.find(e=>e.geometryType===`LineString`)),t=i):(i.push(n.legendInformation.find(e=>e.geometryType===r)),t=i),t=n.legendInformation}else typeof t==`string`&&(t=[t]);return t};function Df(e){let t={};this.attributes=Object.assign(t,e),Ef.call(this,this.attributes)}Df.prototype=Object.create(Ef.prototype),Df.prototype.createLayer=function(e){let t=mapCollection.getMap(`3D`);e?.entities?.forEach(t=>{t.show=e.visibility}),this.setLayer(Wt(e,t))};function Of(e){let t={};this.attributes=Object.assign(t,e),Ef.call(this,this.attributes)}Of.prototype=Object.create(Ef.prototype),Of.prototype.createLayer=function(e){this.setLayer(At(e)),this.setVisible(e.visibility,mapCollection.getMap(`3D`),e)};function kf(e){let t={cesium3DTilesetDefaults:{maximumScreenSpaceError:25},transparency:0};this.hiddenObjects={},this.lastUpdatedSymbol=Symbol(`_lastUpdated`),this.attributes=Object.assign(t,e),Ef.call(this,this.attributes),this.setFeatureVisibilityLastUpdated(Date.now()),this.attributes.hiddenFeatures&&this.attributes.visibility===!0&&this.addToHiddenObjects(this.attributes.hiddenFeatures),this.layer.tileset?.then(e=>e.tileVisible?.addEventListener(this.applyStyle.bind(this))),this.initStyle(e)}kf.prototype=Object.create(Ef.prototype),kf.prototype.createLayer=function(e){this.setLayer(new nn(e)),this.setOpacity(e.transparency),this.setVisible(e.visibility,mapCollection.getMap(`3D`))},kf.prototype.setOpacity=function(e=0){this.getLayer()?.setOpacity((100-e)/100)},kf.prototype.setCesiumSceneOptions=function(e,t){!this.attributes?.defaultDepthTestAgainstTerrain&&t.getCesiumScene().globe.depthTestAgainstTerrain!==e.globe?.depthTestAgainstTerrain?(this.attributes.defaultDepthTestAgainstTerrain={globe:{depthTestAgainstTerrain:t.getCesiumScene().globe.depthTestAgainstTerrain}},$.dispatch(`replaceByIdInLayerConfig`,{layerConfigs:[{id:this.attributes.id,layer:{id:this.attributes.id,defaultDepthTestAgainstTerrain:{globe:{depthTestAgainstTerrain:t.getCesiumScene().globe.depthTestAgainstTerrain}}}}]},{root:!0}),_e.map.olcsMap.setCesiumSceneParams(t.getCesiumScene(),e)):this.attributes.defaultDepthTestAgainstTerrain&&this.attributes?.defaultDepthTestAgainstTerrain?.globe?.depthTestAgainstTerrain!==t.getCesiumScene().globe?.depthTestAgainstTerrain&&(_e.map.olcsMap.setCesiumSceneParams(t.getCesiumScene(),this.attributes.defaultDepthTestAgainstTerrain),$.dispatch(`replaceByIdInLayerConfig`,{layerConfigs:[{id:this.attributes.id,layer:{id:this.attributes.id,defaultDepthTestAgainstTerrain:void 0}}]},{root:!0}))},kf.prototype.setVisible=function(e,t){this.getLayer()?.setVisible(e,t),e&&this.createLegend(),this.attributes.sceneOptions&&this.setCesiumSceneOptions(this.attributes.sceneOptions,mapCollection.getMap(`3D`)),e===!1&&this.attributes.hiddenFeatures&&this.showObjects(this.attributes.hiddenFeatures)},kf.prototype.updateLayerValues=function(e){this.get(`visibility`)!==e.visibility&&this.setVisible(e.visibility,mapCollection.getMap(`3D`)),this.get(`transparency`)!==e.transparency&&this.setOpacity(e.transparency)},kf.prototype.initStyle=async function(e){$.getters.styleListLoaded?this.createStyle(e):$.watch((e,t)=>t.styleListLoaded,t=>{t&&this.createStyle(e)})},kf.prototype.createStyle=async function(e){let t=e.styleId,n=Ft.returnStyleObject(t);if(n!==void 0){let t={color:{conditions:Jt.createStyle(n,void 0,!1,Config.wfsImgPath,{layerId:e.id})}},r=new Cesium.Cesium3DTileStyle(t);this.setStyle(r),this.layer.tileset?.then(e=>{e.style=r})}else t!==void 0&&console.warn(i18next.t(`common:core.layers.errorHandling.wrongStyleId`,{styleId:t}))},kf.prototype.addToHiddenObjects=function(e,t=!1){let n=t;
4e.forEach(e=>{this.hiddenObjects[e]||(this.hiddenObjects[e]=new Set,n=!0)}),n&&this.setFeatureVisibilityLastUpdated(Date.now())},kf.prototype.showObjects=function(e){e.forEach(e=>{this.hiddenObjects[e]&&(this.hiddenObjects[e].forEach(e=>{(e instanceof Cesium.Cesium3DTileFeature||e instanceof Cesium.Cesium3DTilePointFeature)&&this.featureExists(e)&&(e.show=!0)}),delete this.hiddenObjects[e])})},kf.prototype.featureExists=function(e){return e&&e.content&&!e.content.isDestroyed()&&!e.content.batchTable.isDestroyed()},kf.prototype.applyStyle=function(e){if(e.content instanceof Cesium.Composite3DTileContent)for(let t=0;t<e.content.innerContents.length;t++)this.styleContent(e.content.innerContents[t]);else this.styleContent(e.content)},kf.prototype.updateHiddenFeatureList=function(){let e=W.getLayers().filter(e=>e.get(`typ`)===`TileSet3D`),t=[];e.forEach(e=>{let n=e.get(`hiddenFeatures`);t=t.concat(n||[])}),e.forEach(e=>e.addToHiddenObjects(t,!0))},kf.prototype.styleContent=function(e){if(this.get(`hiddenFeatures`)&&this.updateHiddenFeatureList(),!e[this.lastUpdatedSymbol]||e[this.lastUpdatedSymbol]<this.get(`featureVisibilityLastUpdated`)){let t=e.featuresLength;for(let n=0;n<t;n++){let t=e.getFeature(n);if(t){let r=t.getProperty(`id`);r||=`${e.url}${n}`,this.hiddenObjects[r]&&(this.hiddenObjects[r].add(t),t.show=!1)}}e[this.lastUpdatedSymbol]=Date.now()}},kf.prototype.setFeatureVisibilityLastUpdated=function(e){this.set(`featureVisibilityLastUpdated`,e)};function Af(e,t){let n={};this.attributes=Object.assign(n,e),this.layerFactory=t,Array.isArray(e.children)?Ef.call(this,this.attributes):console.warn(`Wrong configuration for 3D Grouplayer: children are missing.`,e)}Af.prototype=Object.create(Ef.prototype),Af.prototype.createLayer=function(e){let t=[],n=isNaN(e.transparency)?1:(100-e.transparency)/100;e.children.forEach(n=>{let r={...n,visibility:e.visibility},i=this.layerFactory.createLayer(r,`3D`);t.push(i)});let r={layers:t,zIndex:e.zIndex,opacity:n};r.getSource=()=>t,this.setLayer(r),this.setLayerSource()},Af.prototype.updateLayerValues=function(e){Ef.prototype.updateLayerValues.call(this,e),this.getLayerSource().forEach(t=>{let n={...t.attributes,visibility:e.visibility,transparency:e.transparency};t.updateLayerValues(n)})},Af.prototype.setVisible=function(e,t){this.getLayerSource().forEach(n=>{n.setVisible(e,t,n.attributes)})},Af.prototype.setLayerSource=function(){this.layerSource=this.getLayer().getSource()},Af.prototype.getLayerSource=function(){return this.layerSource};var jf={GEOJSON:Sd,GROUP:Tf,OAF:Td,SENSORTHINGS:Y,STATICIMAGE:$u,GEOTIFF:nd,VECTORBASE:Cf,VECTORTILE:Sf,WFS:wf,WMS:rd,WMTS:id,WMSTIME:pd},Mf={ENTITIES3D:Df,TERRAIN3D:Of,TILESET3D:kf,GROUP3D:Af};function Nf(e,t){let n,r;return r=e?.typ?.toUpperCase()===`WMS`&&e?.time?`WMSTIME`:e?.typ?.toUpperCase(),jf[r]?n=new jf[r](e,r===`GROUP`?this:void 0):t===`3D`&&Mf[r]&&(n=new Mf[r](e,r===`GROUP3D`?this:void 0)),n}function Pf(){let e=[];return Object.keys(jf).forEach(t=>{jf[t].prototype instanceof J&&e.push(t)}),e}var Ff={createLayer:Nf,getVectorLayerTypes:Pf},If={positionClicked:function({commit:e,dispatch:t,state:n,rootGetters:r}){let i=r.mobile?!0:n.updatePosition,a=r[`Maps/mode`],o=r[`Maps/clickCoordinate`];o&&(e(`setPositionMapProjection`,o),t(`changedPosition`),e(`setUpdatePosition`,!i),a===`2D`?(t(`Maps/placingPointMarker`,o,{root:!0}),n.heightLayer&&(i?t(`getHeight`,o):e(`setHeight`,``))):a===`3D`&&o.length===3&&(t(`Maps/placingPointMarker`,o,{root:!0}),e(`setHeight`,o[2].toFixed(1))))},initHeightLayer({commit:e,state:t,rootGetters:n}){let r=jt.getLayerWhere({id:t.heightLayerId}),i=null;r&&(i=n.layerConfigById(t.heightLayerId),i&&e(`setHeightLayer`,Ff.createLayer(i))),i||console.warn(`CoordToolkit: the layer with id `+t.heightLayerId+` to retrieve height from is not available. Check the Id in config.json with path 'portalConfig.mainMenu.sections.coordToolkit.heightLayerId'!`)},getHeight({dispatch:e,rootGetters:t,state:n},r){let i=t[`Maps/projection`],a=t[`Maps/resolution`],o={INFO_FORMAT:n.heightInfoFormat,FEATURE_COUNT:1};Uu(`text/xml`,n.heightLayer.getLayerSource().getFeatureInfoUrl(r,a,i,o),n.heightLayer).then(t=>{e(`retrieveHeightFromGfiResponse`,t)})},retrieveHeightFromGfiResponse({commit:e,state:t},n){let r=``;if(n.length>=1)if(r=n[0].get(t.heightElementName),r===t.heightValueWater)r=`common:modules.coordToolkit.noHeightWater`;else if(r===t.heightValueBuilding)r=`common:modules.coordToolkit.noHeightBuilding`;else{let e=Number.parseFloat(r);isNaN(e)||(r=e.toFixed(1))}e(`setHeight`,r)}
4,newProjectionSelected({dispatch:e,commit:t,state:n,getters:r},i){let a=r.getProjectionById(i);e(`formatInput`,[n.coordinatesEasting,n.coordinatesNorthing]),e(`transformCoordinatesFromTo`,a),t(`setCurrentProjection`,a),e(`changedPosition`),t(`setExample`)},changedPosition({dispatch:e,state:t,getters:n}){if(t.mode===`supply`){let r=t.currentProjection?.epsg,i=n.getTransformedPosition(mapCollection.getMap(`2D`),r);i&&e(`adjustPosition`,{position:i,targetProjection:t.currentProjection})}},setFirstSearchPosition({dispatch:e,commit:t,state:n,rootState:r,getters:i}){if(n.mode===`search`){let a=n.currentProjection?.epsg,o=i.getTransformedPosition(mapCollection.getMap(`2D`),a);o&&o[0]===0&&o[1]===0&&r.Maps.center&&(t(`setCoordinatesEasting`,{id:`easting`,value:String(r.Maps.center[0]).substring(0,9)}),t(`setCoordinatesNorthing`,{id:`northing`,value:String(r.Maps.center[1]).substring(0,9)}),e(`moveToCoordinates`,r.Maps.center))}},adjustPosition({commit:e,rootGetters:t},{position:n,targetProjection:r}){let i,a,o;if(r&&Array.isArray(n)&&n.length>=2){if(r.projName===`longlat`){let e;i=mt(n.slice(0,2)),e=r.id===`http://www.opengis.net/gml/srs/epsg.xml#4326-DG`?Ru(i):Vu(i),a=e.easting,o=e.northing}else r.id===`http://www.opengis.net/gml/srs/epsg.xml#ETRS893GK3`?t.namedProjections.find(e=>{if(e[1].includes(`ETRS89_3GK3`)){let t=parseInt(e[1].substring(e[1].lastIndexOf(`x_0=`)+4,e[1].indexOf(` +y_0=`)),10);return a=(n[0]+t-r.x0).toFixed(2),o=n[1].toFixed(2),!0}return!1}):(a=n[0].toFixed(2),o=n[1].toFixed(2));e(`setCoordinatesEasting`,{id:`easting`,value:String(a)}),e(`setCoordinatesNorthing`,{id:`northing`,value:String(o)})}},checkPosition({state:e,commit:t,dispatch:n,rootGetters:r}){let i=r[`Maps/mouseCoordinate`],a=r[`Maps/mode`];e.updatePosition&&(a===`2D`&&n(`Maps/placingPointMarker`,i,{root:!0}),a===`3D`&&i.length===3&&t(`setHeight`,i[2].toFixed(1)),t(`setPositionMapProjection`,i),n(`changedPosition`))},searchCoordinate({dispatch:e,commit:t,state:n}){let r=[n.coordinatesEasting,n.coordinatesNorthing];t(`resetErrorMessages`,`all`),e(`formatInput`,r),e(`transformCoordinates`)},removeMarker:function({dispatch:e}){e(`Maps/removePointMarker`,null,{root:!0})},setMarker:function({dispatch:e},t){e(`Maps/placingPointMarker`,[parseFloat(t[0]),parseFloat(t[1])],{root:!0})},validateInput({state:e,commit:t},n){let r=/^[0-9]{6,7}[.,]{0,1}[0-9]{0,3}\s*$/,i=/^[0-9]{7,8}[.,]{0,1}[0-9]{0,3}\s*$/,a=/^[0-9]{6,7}[.,]{0,1}[0-9]{0,3}\s*$/,o=/^[0-9]{7}[.,]{0,1}[0-9]{0,3}\s*$/,s=/^\d[0-9]{0,2}[°]{1}\s*[0-9]{0,2}['`´â²]{0,1}\s*[0-9]{0,2}['`´â²]{0,2}["â³]{0,2}[\sNS]*\s*$/,c=/[0-9]{1,3}[.,][0-9]{0,20}[\s]{0,10}°?\s*$/,{currentProjection:l}=e,u={"http://www.opengis.net/gml/srs/epsg.xml#25832":r,"http://www.opengis.net/gml/srs/epsg.xml#25833":r,"http://www.opengis.net/gml/srs/epsg.xml#4647":i,"http://www.opengis.net/gml/srs/epsg.xml#31467":a,"http://www.opengis.net/gml/srs/epsg.xml#8395":a,"http://www.opengis.net/gml/srs/epsg.xml#ETRS893GK3":o,"http://www.opengis.net/gml/srs/epsg.xml#4326":s,"http://www.opengis.net/gml/srs/epsg.xml#4326-DG":c};n.id===`easting`?(t(`resetErrorMessages`,n.id),n.value===``?t(`setEastingNoCoord`,!0):String(n.value).match(u[l.id])||t(`setEastingNoMatch`,!0)):n.id===`northing`&&(t(`resetErrorMessages`,n.id),n.value===``?t(`setNorthingNoCoord`,!0):String(n.value).match(u[l.id])||t(`setNorthingNoMatch`,!0))},formatInput({state:e,commit:t,getters:n},r){let{currentProjection:i}=e;t(`setSelectedCoordinates`,[]);for(let e of r)if(!n.getEastingError&&!n.getNorthingError){let n;n=i.id===`http://www.opengis.net/gml/srs/epsg.xml#4326-DG`?e=>e.value.split(/[\s°]+/):i.projName===`longlat`?e=>e.value.split(/[\s°â²â³'"´`]+/):e=>e.value,t(`resetErrorMessages`,`all`),t(`pushCoordinates`,n(e))}},transformCoordinatesFromTo({state:e,commit:t},n){let r,i;e.selectedCoordinates.length===2&&(i=e.currentProjection.projName===`longlat`?Ru(e.selectedCoordinates):[Math.round(e.selectedCoordinates[0]),Math.round(e.selectedCoordinates[1])],e.currentProjection.id===`http://www.opengis.net/gml/srs/epsg.xml#ETRS893GK3`&&i[0].toString().length===7&&(i[0]-=3e6),r=O(e.currentProjection,n,i),n.projName===`longlat`&&n.id!==`http://www.opengis.net/gml/srs/epsg.xml#4326-DG`?r=[Hu(r[1]),Hu(r[0])]:n.id===`http://www.opengis.net/gml/srs/epsg.xml#4326-DG`?r=[r[1].toFixed(4)+`°`,r[0].toFixed(4)+`°`]:(n.id===`http://www.opengis.net/gml/srs/epsg.xml#ETRS893GK3`&&r[0].toFixed(2).length===9&&(r[0]+=3e6),r=[r[0].toFixed(2),r[1].toFixed(2)]),t(`setCoordinatesEasting`,{id:`easting`,value:r[0]}),t(`setCoordinatesNorthing`,{id:`northing`,value:r[1]}))},transformCoordinates({state:e,dispatch:t}){let n=mapCollection.getMapView(`2D`).getProjection().getCode();if(e.selectedCoordinates.length===2)if(t(`setZoom`,e.zoomLevel),e.currentProjection.id.indexOf(`4326`)>-1){let r=Ru(e.selectedCoordinates);e.transformedCoordinates=O(O(`EPSG:4326`),O(n),r),t(`moveToCoordinates`,e.transformedCoordinates)}else if(e.currentProjection.id.indexOf(`31467`)>-1){let r=[Math.round(e.selectedCoordinates[0]),Math.round(e.selectedCoordinates[1])];e.transformedCoordinates=O(O(`EPSG:31467`),O(n),r),t(`moveToCoordinates`,e.transformedCoordinates)}else if(e.currentProjection.id.indexOf(`8395`)>-1){let r=[Math.round(e.selectedCoordinates[0]),Math.round(e.selectedCoordinates[1])];e.transformedCoordinates=O(O(`EPSG:8395`),O(n),r),t(`moveToCoordinates`,e.transformedCoordinates)}else if(e.currentProjection.id.indexOf(`ETRS893GK3`)>-1){let r=[Math.round(e.selectedCoordinates[0])-3e6,Math.round(e.selectedCoordinates[1])];e.transformedCoordinates=O(O(`EPSG:8395`),O(n),r),t(`moveToCoordinates`,e.transformedCoordinates)}else if(e.currentProjection.id.indexOf(`4647`)>-1){let r=[Math.round(e.selectedCoordinates[0]),Math.round(e.selectedCoordinates[1])];e.transformedCoordinates=O(O(`EPSG:4647`),O(n),r),t(`moveToCoordinates`,e.transformedCoordinates)}else if(e.currentProjection.epsg!==n){let r;r=e.currentProjection.projName===`longlat`?Ru(e.selectedCoordinates):[Math.round(e.selectedCoordinates[0]),Math.round(e.selectedCoordinates[1])],e.transformedCoordinates=O(O(e.currentProjection.id),O(n),r),t(`moveToCoordinates`,e.transformedCoordinates)}else t(`moveToCoordinates`,e.selectedCoordinates)},moveToCoordinates({dispatch:e},t){e(`setMarker`,t),e(`setCenter`,t)},setZoom:function({dispatch:e},t){e(`Maps/setZoom`,t,{root:!0})},setCenter:function({dispatch:e},t){e(`Maps/setCenter`,[parseFloat(t[0]),parseFloat(t[1])],{root:!0})}},Lf={namespaced:!0,state:{...Fu},mutations:Lu,actions:If,getters:Iu},Rf={},zf={circleOptions:{innerRadius:100,interactive:!0,outerRadius:500,unit:`m`}
4,currentLayout:{fillColor:[55,126,184],fillTransparency:0,strokeColor:[0,0,0],strokeWidth:1},currentLayoutOuterCircle:{fillColor:[0,0,0],fillTransparency:100,strokeColor:[200,0,0],strokeWidth:1},description:`common:modules.draw.description`,drawEdits:[`deleteAll`,`delete`,`modify`,`undo`,`redo`],drawIcons:{box:`bi-square`,circle:`bi-circle`,delete:`bi-eraser-fill`,deleteAll:`bi-trash`,doubleCircle:`bi-record-circle`,geometries:`bi-hexagon-fill`,line:`bi-slash-lg`,modify:`bi-tools`,pen:`bi-pencil-fill`,point:`bi-circle-fill`,polygon:`bi-octagon`,redo:`bi-arrow-right`,symbols:`bi-circle-square`,undo:`bi-arrow-left`},drawTypesGeometrie:[`line`,`box`,`polygon`,`circle`,`doubleCircle`],drawTypesMain:[`pen`,`geometries`,`symbols`],drawTypesSymbols:[`point`],hasMouseMapInteractions:!0,icon:`bi-pencil`,name:`common:modules.draw.name`,selectedDrawType:``,selectedDrawTypeMain:``,selectedInteraction:`draw`,strokeRange:[1,16],supportedDevices:[`Desktop`,`Mobile`,`Table`],supportedMapModes:[`2D`,`3D`],type:`draw`,units:[`m`,`km`]},Bf={...U(zf),setCircleOptions(e,t){Object.assign(e.circleOptions,t)}},Vf={...H(zf)},Hf={namespaced:!0,state:{...zf},mutations:Bf,getters:Vf,actions:Rf},Uf={id:`iconPoint`,type:`simple_point`,value:`simple_point`},Wf={hasMouseMapInteractions:!0,supportedDevices:[`Desktop`,`Mobile`,`Table`],supportedMapModes:[`2D`],drawLayerVisible:!0,addFeatureListener:{},addIconsOfActiveLayers:!1,currentInteraction:`draw`,formerInteraction:``,deactivatedDrawInteractions:[],download:{dataString:``,enabled:!0,features:[],featuresNotSupported:!1,file:``,fileName:``,fileUrl:``,formats:[`KML`,`GEOJSON`,`GPX`,`CSV`],preSelectedFormat:``,selectedFormat:``},drawInteraction:null,drawInteractionTwo:null,drawType:{id:`drawSymbol`,geometry:`Point`},enableAttributesSelector:!1,fId:0,filterList:null,freeHand:!1,icon:`bi-pencil`,iconList:[Uf],id:`draw`,type:`draw_old`,idCounter:0,innerBorderColor:``,imgPath:``,isVisibleInMenu:!0,modifyInteraction:null,modifyAttributesInteraction:null,outerBorderColor:``,pointSize:16,redoArray:[],undoArray:[],renderToWindow:!1,resizableWindow:!0,selectInteraction:null,selectInteractionModify:null,selectInteractionModifyAttributes:null,selectedFeature:null,symbol:Uf,tooltipCircleRadiusNode:null,withoutGUI:!1,zIndex:0,name:`common:modules.draw_old.name`,description:`common:modules.draw_old.description`,drawSymbolSettings:{color:[55,126,184,1],opacity:1},drawLineSettings:{unit:`m`,length:0,strokeWidth:1,opacityContour:1,colorContour:[0,0,0,1],tooltipStyle:{fontSize:`14px`,paddingTop:`3px`,paddingLeft:`3px`,paddingRight:`3px`,backgroundColor:`rgba(255, 255, 255, .9)`}},drawCurveSettings:{strokeWidth:1,opacityContour:1,colorContour:[0,0,0,1]},drawAreaSettings:{strokeWidth:1,unit:`m`,area:0,color:[55,126,184,1],opacity:1,colorContour:[0,0,0,1],opacityContour:1,tooltipStyle:{fontSize:`14px`,paddingTop:`3px`,paddingLeft:`3px`,paddingRight:`3px`,backgroundColor:`rgba(255, 255, 255, .9)`}},drawSquareSettings:{squareMethod:`interactive`,strokeWidth:1,squareSide:0,unit:`m`,squareArea:0,color:[55,126,184,1],opacity:1,colorContour:[0,0,0,1],opacityContour:1,tooltipStyle:{fontSize:`14px`,paddingTop:`3px`,paddingLeft:`3px`,paddingRight:`3px`,backgroundColor:`rgba(255, 255, 255, .9)`}},drawCircleSettings:{circleMethod:`interactive`,unit:`m`,circleRadius:0,strokeWidth:1,color:[55,126,184,1],opacity:1,colorContour:[0,0,0,1],opacityContour:1,tooltipStyle:{fontSize:`14px`,paddingTop:`3px`,paddingLeft:`3px`,paddingRight:`3px`,backgroundColor:`rgba(255, 255, 255, .9)`}},drawDoubleCircleSettings:{circleMethod:`defined`,unit:`m`,circleRadius:0,circleOuterRadius:0,strokeWidth:1,color:[55,126,184,1],opacity:1,colorContour:[0,0,0,1],outerColorContour:[0,0,0,1],opacityContour:1},writeTextSettings:{text:``,fontSize:10,font:`Arial`,color:[55,126,184,1],opacity:1},attributesKeyList:[],semicolonCSVDelimiter:!0,oldStyle:void 0,$app:null};function Gf(e,t,n){return O.defs(e,`+proj=utm +zone=`+n+`ellps=WGS84 +towgs84=0,0,0,0,0,0,1 +units=m +no_defs`),{sourceProj:O(e),destProj:O(t)}}var Kf=[{geometry:`Point`,id:`drawSymbol`},{geometry:`LineString`,id:`drawLine`,altGeometry:[`MultiLineString`]},{geometry:`LineString`,id:`drawCurve`},{geometry:`Polygon`,id:`drawArea`},{geometry:`Square`,id:`drawSquare`},{geometry:`Circle`,id:`drawCircle`},{geometry:`Circle`,id:`drawDoubleCircle`},{geometry:`Point`,id:`writeText`}],qf=t({colorContourOptions:()=>Yf,colorOptions:()=>Jf,drawTypeOptions:()=>Kf,fontOptions:()=>Xf,fontSizeOptions:()=>Zf,pointSizeOptions:()=>$f,strokeOptions:()=>ep,transparencyOptions:()=>tp,unitOptions:()=>Qf}),Jf=[{color:`blue`,value:[55,126,184]},{color:`black`,value:[0,0,0]},{color:`green`,value:[77,175,74]},{color:`grey`,value:[153,153,153]},{color:`orange`,value:[255,127,0]},{color:`red`,value:[228,26,28]},{color:`white`,value:[255,255,255]},{color:`yellow`,value:[255,255,51]}],Yf=[Jf[1],Jf[0],...Jf.slice(2)],Xf=[{caption:`Arial`,value:`Arial`},{caption:`Calibri`,value:`Calibri`},{caption:`Times New Roman`,value:`Times New Roman`}],Zf=[{caption:`10 px`,value:10},{caption:`12 px`,value:12},{caption:`16 px`,value:16},{caption:`20 px`,value:20},{caption:`24 px`,value:24},{caption:`32 px`,value:32}],Qf=[{caption:`m`,value:`m`},{caption:`km`,value:`km`}],$f=[{caption:`6 px`,value:6},{caption:`8 px`,value:8},{caption:`10 px`,value:10},{caption:`12 px`,value:12},{caption:`14 px`,value:14},{caption:`16 px`,value:16}],ep=[{caption:`1 px`,value:1},{caption:`2 px`,value:2},{caption:`3 px`,value:3},{caption:`4 px`,value:4},{caption:`5 px`,value:5},{caption:`6 px`,value:6}],tp=[{caption:`0 %`,value:1},{caption:`10 %`,value:.9},{caption:`20 %`,value:.8},{caption:`30 %`,value:.7}
4,{caption:`40 %`,value:.6},{caption:`50 %`,value:.5},{caption:`60 %`,value:.4},{caption:`70 %`,value:.3},{caption:`80 %`,value:.2},{caption:`90 %`,value:.1},{caption:`100 %`,value:0}],np=Gf(`EPSG:25832`,`EPSG:4326`,`32`);function rp(e,t){return Array.isArray(e)&&e.length===3&&Array.isArray(t)&&t.length===3&&e.every((e,n)=>e===t[n])}function ip(e,t){return`<IconStyle>${`<scale>${t}</scale>`}<Icon>${`<href>${e}</href>`}</Icon></IconStyle>`}function ap(e){let t=Jf.filter(t=>rp(e,t.value));return t&&t[0]?t[0].color:``}function op(e){let t=e.anchor[0],n=e.anchor[1],{xUnit:r,yUnit:i}=e;return`<hotSpot x="${t}" y="${n}" xunits="${r}" yunits="${i}" />`}function sp(e,t){let n=[];for(let r of e){if(t){r.forEach(e=>{n.push(cp(e))});continue}n.push(cp(r))}return t?[n]:n}function cp(e){return O(np.sourceProj,np.destProj,e)}function lp(e){let t=e.getCoordinates(),n=e.getType(),r={category:`error`,content:i18next.t(`common:modules.draw_old.download.unknownGeometry`,{geometry:n}),displayClass:`error`,multipleAlert:!0};switch(n){case`LineString`:return sp(t,!1);case`Point`:return cp(t);case`Polygon`:return sp(t,!0);case`MultiPolygon`:return t;default:return $.dispatch(`Alerting/addSingleAlert`,r,{root:!0}),[]}}function up(e,t){let n=[],r=null;for(let t of e){let e=t.clone(),r=lp(e.getGeometry());r.length===3&&r[2]===0&&r.pop(),e.getGeometry().setCoordinates(r,`XY`),n.push(e)}return r=dp(n,t),r===null?t.writeFeatures(n):new XMLSerializer().serializeToString(r)}function dp(e,t){if(!Array.isArray(e)||!q(t)||!e.some(e=>typeof e.get==`function`&&e.get(`attributes`)))return null;let n=new DOMParser().parseFromString(t.writeFeatures(e),`text/xml`),r=n.getElementsByTagName(`Placemark`);return r.length?(e.forEach((e,t)=>{let n=e.get(`attributes`),i=q(n)?Object.keys(n):[];i.length&&i.forEach(e=>{if(r[t]){let n=r[t].querySelector(`ExtendedData`),i=typeof n.querySelector==`function`?n.querySelector(`Data[name='${e}']`):void 0,a=typeof n.querySelector==`function`?n.querySelector(`Data[name='custom-attribute____${e}']`):void 0;a instanceof Element&&a.remove(),typeof i.setAttribute==`function`&&i.setAttribute(`name`,`custom-attribute____${e}`)}})}),n):null}function fp(e){return`${window.location.origin}/mastercode/3_26_0/img/tools/draw/circle_${ap(e)}.svg`}async function pp(e){let t=e.length,n=Array(t).fill(void 0),r=new gn({extractStyles:!0}),i=Array(t).fill(!1),a=Array(t).fill(void 0),o=Array(t).fill(void 0),s=Array(t).fill(!1),c=Array(t).fill(void 0),l=Array(t).fill(void 0),u=new DOMParser().parseFromString(up(e,r),`text/xml`);return e.forEach((e,t)=>{let r=e.getGeometry().getType(),u,d,f;if(r===`Point`&&e.values_.drawState&&e.values_.drawState.text!==void 0)s[t]=!0,l[t]=e.values_.drawState.fontSize;else{try{f=e.getStyleFunction()(e),d=Array.isArray(f)?f[0]:f}catch{s[t]=!0}if(r===`Point`)if(d.getImage()!==null&&d.getImage().iconImage_!==void 0){i[t]=!0;let e=d.getImage().anchorXUnits_,r=d.getImage().anchorYUnits_,a=d.getImage().anchor_;n[t]={xUnit:e,yUnit:r,anchor:a}}else d.getText()?c[t]=d.getText().getFont():(u=d.getImage().getFill().getColor(),a[t]=[u[0],u[1],u[2]],o[t]=Math.max(...d.getImage().getSize())/32)}}
4),Array.from(u.getElementsByTagName(`Placemark`)).forEach((e,t)=>{if(e.getElementsByTagName(`Point`).length>0&&s[t]===!1){let r=e.getElementsByTagName(`Style`)[0];if(i[t]===!1&&a[t]){let e=ip(fp(a[t]),o[t]);r.innerHTML+=e}else if(i[t]===!0&&n[t]!==void 0){let r=e.getElementsByTagName(`IconStyle`)[0];r.innerHTML+=op(n[t])}}if(e.getElementsByTagName(`Point`).length>0&&s[t]===!0&&!isNaN(l[t])){let n=l[t]/16,r=e.getElementsByTagName(`Style`)[0],i=fp([55,126,184]),a=new DOMParser().parseFromString(`<IconStyle><scale>0</scale><Icon><href>`+i+`</href></Icon></IconStyle>`,`text/xml`),o=new DOMParser().parseFromString(`<scale>`+n+`</scale>`,`text/xml`);r.getElementsByTagName(`LabelStyle`)[0].appendChild(o.getElementsByTagName(`scale`)[0]),r.appendChild(a.getElementsByTagName(`IconStyle`)[0])}}),new XMLSerializer().serializeToString(u)}function mp(e,t=!1,n=!1,r=!1){if(!Array.isArray(e))return typeof t==`function`&&t(`convertJsonToCsv: the given jsonData shall be an array`),!1;let i=n?`;`:`,`,a=r?` 5`:`\r 6`,o=hp(e),s=vp(o),c=s?Object.keys(s).length:0,l=!Array.isArray(s)&&typeof s==`object`&&s?Object.keys(s):!1,u=l?yp(gp(l,i),i,c):``;return o.forEach(e=>{if(typeof e!=`object`||!e){typeof t==`function`&&t(`convertJsonToCsv: a line with an unknown type was found: `+typeof e);return}else u&&(u+=a);u+=yp(gp(Object.values(e),i),i,c)}),u}function hp(e){if(!Array.isArray(e)||!q(e[0]))return e;let t=[],n=new Set;return e.forEach(e=>{q(e)&&Object.keys(e).forEach(e=>{n.add(e)})}),e.forEach(e=>{if(!q(e))return;let r={};n.forEach(t=>{r[t]=Object.prototype.hasOwnProperty.call(e,t)?e[t]:``}),t.push(r)}),t}function gp(e,t){if(typeof e!=`object`||!e)return[];let n=[];return e.forEach(e=>{n.push(_p(e,t))}),n}function _p(e,t){let n=!1,r=``,i=``,a=String(e),o=a.length;for(let e=0;e<o;e++)i=a[e],i===t||i===`\r`||i===` 7`?n=!0:i===`"`&&(n=!0,r+=`"`),r+=i;return n?`"`+r+`"`:r}function vp(e){if(!Array.isArray(e))return null;let t=null,n=0;return e.forEach(e=>{typeof e!=`object`||!e||n<Object.keys(e).length&&(n=Object.keys(e).length,t=e)}),t}function yp(e,t,n){if(!Array.isArray(e))return``;let r=``;for(let i=0;i<n;i++)i>0&&(r+=t),r+=e[i]?String(e[i]):``;return r}function bp(e,t){if(!Array.isArray(e))return!1;let n=new ge;return e.forEach(e=>{if(e instanceof V){let r=n.writeGeometry(e.getGeometry());q(e.get(`csv_attributes`))||e.set(`csv_attributes`,{}),e.get(`csv_attributes`).geometry=r,e.get(`csv_attributes`).epsg=t,Object.keys(e.getProperties()).forEach(t=>{[`masterportal_attributes`,`geometry`,`csv_attributes`].includes(t)||(e.get(`csv_attributes`)[t]=e.get(t))})}}),e}function xp(e){return Array.isArray(e)?(e.forEach(e=>{e instanceof V&&!Object.prototype.hasOwnProperty.call(e.getProperties(),`attributes`)&&(e.set(`attributes`,{}),Object.keys(e.getProperties()).forEach(t=>{[`masterportal_attributes`,`geometry`,`attributes`].includes(t)||(e.get(`attributes`)[t]=e.get(t))}),Object.prototype.hasOwnProperty.call(e.getProperties(),`masterportal_attributes`)&&Object.keys(e.get(`masterportal_attributes`)).forEach(t=>{e.set(t,e.get(`masterportal_attributes`)[t])}))}),e):!1}function Sp(e,t,n){let r=[];for(let i of t)if(n)if(t.length>1)r.push(Sp(e,i,n)[0]);else{i.forEach(t=>{t.length>2?r.push(Sp(e,t,n)):r.push(Cp(e,t))});continue}else i.length>2&&!n?r.push(Sp(e,i,n)):r.push(Cp(e,i));return n?[r]:r}function Cp(e,t){return O(O(e),O(`EPSG:4326`),t)}function wp(e,t){return t.transform(e,`EPSG:4326`)}function Tp(e){let t=e.getCoordinates(),n=e.getType(),r={category:`error`,content:i18next.t(`common:modules.draw_old.download.unknownGeometry`,{geometry:n}),displayClass:`error`,multipleAlert:!0};switch(n){case`LineString`:return Sp($.getters[`Maps/projection`].getCode(),t,!1);case`Point`:return Cp($.getters[`Maps/projection`].getCode(),t);case`Polygon`:return Sp($.getters[`Maps/projection`].getCode(),t,!0);default:return $.dispatch(`Alerting/addSingleAlert`,r,{root:!0}),[]}}var Ep={transformCoordinates:Tp},Dp=t({convertFeatures:()=>Op,fileDownloaded:()=>kp,prepareData:()=>Ap,prepareDownload:()=>jp,setDownloadFeatures:()=>Mp,setDownloadFileName:()=>Np,setDownloadSelectedFormat:()=>Pp,validateFileName:()=>Fp});async function Op({state:e,dispatch:t,commit:n},r){let i=[],a={category:`error`,content:i18next.t(`common:modules.draw_old.download.allGeometryTypesNotSupported`,{geometry:`Polygon`}),displayClass:`error`},o={category:`error`,content:i18next.t(`common:modules.draw_old.download.notSupportedGeometryType`,{geometry:`Polygon`}),displayClass:`error`},s=!1,c=!1;for(let t of e.download.features){let e=t.clone(),n=await Ep.transformCoordinates(e.getGeometry());n.length===3&&n[2]===0&&n.pop(),e.getGeometry().setCoordinates(n,`XY`),i.push(e),r instanceof Yt&&t.getGeometry().getType()===`Polygon`?s=!0:c=!0}return s&&c?(n(`setDownloadFeaturesNotSupported`,!1),t(`Alerting/addSingleAlert`,o,{root:!0})):s?(n(`setDownloadFeaturesNotSupported`,!0),t(`Alerting/addSingleAlert`,a,{root:!0})):n(`setDownloadFeaturesNotSupported`,!1),r.writeFeatures(i)}function kp({state:e,commit:t}){t(`setDownloadSelectedFormat`,e.download.selectedFormat)}async function Ap({state:e,commit:t,dispatch:n,rootGetters:r}){let i=``;switch(e.download.selectedFormat){case`GEOJSON`:i=await n(`convertFeatures`,new dn);break;case`GPX`:i=await n(`convertFeatures`,new Yt);break;
7case`KML`:i=xp(e.download.features),i=await pp(i);break;case`CSV`:i=bp(e.download.features,r[`Maps/projection`].getCode()),i=Array.isArray(i)?mp(i.map(e=>e.get(`csv_attributes`)),!1,e.semicolonCSVDelimiter):``;break;case`none`:t(`setDownloadSelectedFormat`,``);break;default:break}t(`setDownloadDataString`,i)}function jp({state:e,commit:t,dispatch:n}){n(`validateFileName`).then(n=>{if(n&&n!==``){let r=e.download.dataString,i=`data:text/plain;charset=utf-8,${encodeURIComponent(r)}`;t(`setDownloadFile`,n),t(`setDownloadFileUrl`,i)}}).catch(e=>{console.error(e)})}function Mp({state:e,commit:t,dispatch:n,rootGetters:r}){let i=[];this.$app.config.globalProperties.$layer.getSource().getFeatures()?.forEach(t=>{let n=t.clone(),a=n.getGeometry();!n.get(`masterportal_attributes`)?.isVisible&&n.get(`masterportal_attributes`)?.invisibleStyle&&n.setStyle(n.get(`masterportal_attributes`).invisibleStyle),e.oldStyle&&typeof e.selectedFeature?.get==`function`&&t.get(`masterportal_attributes`).styleId===e.selectedFeature.get(`masterportal_attributes`).styleId&&(typeof t.get(`masterportal_attributes`).styleId==`number`||typeof t.get(`masterportal_attributes`).styleId==`string`)&&n.setStyle(e.oldStyle),a instanceof ht?(n.setGeometry(et(a)),wp(r[`Maps/projection`].getCode(),a),n.set(`masterportal_attributes`,Object.assign(n.get(`masterportal_attributes`)??{},{isGeoCircle:!0,geoCircleCenter:a.getCenter().join(`,`),geoCircleRadius:a.getRadius()}))):a.getType()===`Polygon`&&n.get(`masterportal_attributes`)?.drawState?.drawType?.geometry===`Square`&&n.set(`masterportal_attributes`,Object.assign(n.get(`masterportal_attributes`)??{},{isSquare:!0,squareCoords:a.getCoordinates()[0]})),i.push(n)}),t(`setDownloadFeatures`,i),n(`prepareData`),n(`prepareDownload`)}function Np({commit:e,dispatch:t},n){e(`setDownloadFileName`,n),(this.$app.config.globalProperties?.$layer?.getSource()?.getFeatures?.()||[]).length>0&&t(`prepareDownload`)}async function Pp({commit:e,dispatch:t},n){e(`setDownloadSelectedFormat`,n),this.$app.config.globalProperties.$layer.getSource().getFeatures().length>0&&(await t(`setDownloadFeatures`),await t(`prepareData`),t(`prepareDownload`))}function Fp({state:e}){let{fileName:t,selectedFormat:n}=e.download,r=`.${n.toLowerCase()}`;return!t||!n?``:t.toLowerCase().endsWith(r)?t:t+r}function Ip(e,t,n,r,i,a){return new T({image:new re({radius:n===`Point`?r/2:0,fill:n===`Point`?new S({color:e}):new S({color:t})}),fill:new S({color:e}),stroke:new x({color:t,width:i}),zIndex:a})}function Lp(e,t,n,r,i){let a;if(r?.type===`image`)a=new T({image:new xe({crossOrigin:`anonymous`,src:r.value.indexOf(`/`)===-1&&t?t+r.value:r.value,scale:r?.scale?r.scale:1/(96/n),opacity:r?.opacity?r?.opacity:e[3]}),zIndex:i});else throw Error(`Draw: The given type ${r.type} of the symbol is not supported!`);return a}function Rp(e,t,n,r,i){return new T({text:new we({textAlign:`left`,text:r,font:n+`px `+t,fill:new S({color:e}),textBaseline:`bottom`}),zIndex:i})}function zp(e,t){let n=e.drawType,r=e.imgPath,i=e.pointSize,a=e.symbol,o=e.zIndex,s=t.color,c=t.colorContour,l=t.font,u=t.fontSize,d=t.strokeWidth,f=t.text,p=a?.type?a.type===`simple_point`:!1,m=new T;return m=n.id===`drawSymbol`&&!p?Lp(s,r,i,a,o):n.id===`writeText`?Rp(s,l,u,f,9999):Ip(s,c,n.geometry,i,d,o),m.clone()}var Bp={createStyle:zp},Vp=6378137;function Hp(e,t,n,r){let i=parseInt(n,10)*2,a=[Up(t,i,r),Up(t,-1*i,r),Wp(t,i,r),Wp(t,-1*i,r)];e.feature.getGeometry().extent_=[a[3][0],a[1][1],a[2][0],a[0][1]],e.feature.getGeometry().flatCoordinates=[t[0],t[1],a[3][0],a[3][1]]}function Up(e,t,n){let r=t/2,i=st(e,j.getMapProjection(n)),a=r/Vp,o=i[1]+a*180/Math.PI;return Zt([i[0],o],`EPSG:4326`,j.getMapProjection(n))}function Wp(e,t,n){let r=t/2,i=st(e,j.getMapProjection(n)),a=r/(Vp*Math.cos(Math.PI*i[1]/180));return Zt([i[0]+a*180/Math.PI,i[1]],`EPSG:4326`,j.getMapProjection(n))}var Gp={calculateCircle:Hp,getCircleExtentByDistanceLat:Up,getCircleExtentByDistanceLon:Wp};function Kp(e,t,n){let r=Math.sqrt(n)/2,i=[t[0]-r,t[1]+r],a=[t[0]+r,t[1]+r],o=[t[0]-r,t[1]-r],s=[[i,a,[t[0]+r,t[1]-r],o,i]];e.getGeometry().setCoordinates(s)}var qp={calculateSquare:Kp},Jp=`#E10019`;function Yp({state:e,commit:t,dispatch:n},r){let i=JSON.parse(JSON.stringify(e[e.drawType.id+`Settings`])),a=i.circleMethod,o=i.squareMethod;t(`setAddFeatureListener`,this.$app.config.globalProperties.$layer.getSource().once(`addfeature`,e=>n(`handleDrawEvent`,e))),e.currentInteraction===`draw`&&a===`defined`&&e.drawType.geometry===`Circle`&&e[`drawInteraction`+r].finishDrawing(),e.currentInteraction===`draw`&&o===`defined`&&e.drawType.geometry===`Square`&&e[`drawInteraction`+r].finishDrawing()}function Xp({state:e,commit:t,dispatch:n,rootState:r},i){let a=e.drawType.id+`Settings`,o=e.drawType,s=this.$app.config.globalProperties.$layer.getSource(),c=JSON.parse(JSON.stringify(e[a])),l=c.circleMethod,u=c.squareMethod;if(i.feature.set(`masterportal_attributes`,Object.assign(i.feature.get(`masterportal_attributes`)??{},{fromDrawTool:!0})),n(`updateUndoArray`,{remove:!1,feature:i.feature}),l===`defined`&&o.geometry===`Circle`){let t=isNaN(c.circleRadius)?null:parseFloat(c.circleRadius),a=isNaN(c.circleOuterRadius)?null:parseFloat(c.circleOuterRadius),l=i.feature.get(`masterportal_attributes`).isOuterCircle?a:t,u=i.feature.getGeometry().getCenter();t===null||t===0?(e.innerBorderColor=Jp,o.id===`drawDoubleCircle`?a===null||a===0?(n(`Alerting/addSingleAlert`,{category:`error`,content:i18next.t(`common:modules.draw_old.undefinedTwoCircles`),displayClass:`error`,multipleAlert:!0},{root:!0}
7),s.removeFeature(i.feature),e.outerBorderColor=Jp):(n(`Alerting/addSingleAlert`,{category:`error`,content:i18next.t(`common:modules.draw_old.undefinedInnerCircle`),displayClass:`error`,multipleAlert:!0},{root:!0}),s.removeFeature(i.feature),e.outerBorderColor=``):(n(`Alerting/addSingleAlert`,{category:`error`,content:i18next.t(`common:modules.draw_old.undefinedRadius`),displayClass:`error`,multipleAlert:!0},{root:!0}),s.removeFeature(i.feature))):(a===null||a===0?o.id===`drawDoubleCircle`?(n(`Alerting/addSingleAlert`,{category:`error`,content:i18next.t(`common:modules.draw_old.undefinedOuterCircle`),displayClass:`error`,multipleAlert:!0},{root:!0}),s.removeFeature(i.feature),e.outerBorderColor=Jp):Gp.calculateCircle(i,u,l,mapCollection.getMap(r.Maps.mode)):(Gp.calculateCircle(i,u,l,mapCollection.getMap(r.Maps.mode)),e.outerBorderColor=``),e.innerBorderColor=``)}else if(u===`defined`&&o.geometry===`Square`){let e=isNaN(c.squareArea)?null:parseFloat(c.squareArea);if(e===0)n(`Alerting/addSingleAlert`,i18next.t(`common:modules.draw_old.undefinedSquareArea`),{root:!0}),s.removeFeature(i.feature);else{let t=i.feature,n=t.getGeometry().getCoordinates(),r=n[0][0][0],a=n[0][0][1],o=n[0][2][0],s=n[0][2][1],c=[(r+o)/2,(a+s)/2];qp.calculateSquare(t,c,e)}}i.feature.get(`masterportal_attributes`).isOuterCircle&&(c.colorContour=c.outerColorContour),i.feature.setStyle(Zp(c,i.feature.get(`masterportal_attributes`).isOuterCircle)),i.feature.set(`masterportal_attributes`,Object.assign(i.feature.get(`masterportal_attributes`)??{},{invisibleStyle:Bp.createStyle(i.feature.get(`masterportal_attributes`).drawState,c)})),t(`setZIndex`,e.zIndex+1)}function Zp(e,t){return n=>{if(n.get(`masterportal_attributes`).isVisible){let r;return r=t?Object.assign({},n.get(`masterportal_attributes`).drawState,e):Object.assign({},e,n.get(`masterportal_attributes`).drawState),Bp.createStyle(n.get(`masterportal_attributes`).drawState,r)}}}var Qp=t({addSymbolIfNotExists:()=>dm,setArea:()=>em,setCircleMethod:()=>om,setCircleOuterRadius:()=>sm,setCircleRadius:()=>am,setColor:()=>cm,setColorContour:()=>lm,setDrawType:()=>fm,setFont:()=>pm,setFontSize:()=>mm,setLength:()=>$p,setOpacity:()=>hm,setOpacityContour:()=>gm,setOuterColorContour:()=>um,setPointSize:()=>_m,setSquareArea:()=>tm,setSquareMethod:()=>nm,setStrokeWidth:()=>vm,setStyleSettings:()=>rm,setSymbol:()=>ym,setText:()=>bm,setUnit:()=>xm,startInteractions:()=>im});function $p({getters:e,commit:t},n){let{styleSettings:r}=e;r.length=n,rm({getters:e,commit:t},r)}function em({getters:e,commit:t},n){let{styleSettings:r}=e;r.area=n,rm({getters:e,commit:t},r)}function tm({getters:e,commit:t},n){let{styleSettings:r}=e;r.squareArea=n,rm({getters:e,commit:t},r)}function nm({getters:e,commit:t},{target:n}){let r=n.options[n.selectedIndex].value,{styleSettings:i}=e;i.squareMethod=r,rm({getters:e,commit:t},i)}function rm({getters:e,commit:t},n){let r=e.drawType.id+`Settings`;t(`set${r[0].toUpperCase()}${r.slice(1)}`,n)}async function im({state:e,commit:t,dispatch:n,rootState:r}){t(`setSymbol`,e.iconList[0]),t(`setImgPath`,r?.configJs?.wfsImgPath),n(`createDrawInteractionAndAddToMap`,{active:e.currentInteraction===`draw`}),n(`createSelectInteractionAndAddToMap`,e.currentInteraction===`delete`),n(`createModifyInteractionAndAddToMap`,e.currentInteraction===`modify`),n(`createModifyAttributesInteractionAndAddToMap`,e.currentInteraction===`modifyAttributes`),n(`updateDrawLayerVisible`,{value:!0}),e.withoutGUI&&n(`toggleInteraction`,`draw`)}function am({getters:e,commit:t,dispatch:n},r){let{styleSettings:i}=e;i.circleRadius=r,rm({getters:e,commit:t},i),n(`updateCircleRadiusDuringModify`,r)}function om({getters:e,commit:t},{target:n}){let r=n.options[n.selectedIndex].value,{styleSettings:i}=e;i.circleMethod=r,rm({getters:e,commit:t},i)}function sm({getters:e,commit:t,dispatch:n},r){let{styleSettings:i}=e;i.circleOuterRadius=r,rm({getters:e,commit:t},i),n(`updateCircleRadiusDuringModify`,r)}function cm({getters:e,commit:t,dispatch:n},{target:r}){let i=r.options[r.selectedIndex].value.split(`,`),a=[],{styleSettings:o}=e;
7i.forEach(e=>{a.push(parseInt(e,10))}),a.push(o.opacity),o.color=a,rm({getters:e,commit:t},o),n(`updateDrawInteraction`)}function lm({getters:e,commit:t,dispatch:n},{target:r}){let i=r.options[r.selectedIndex].value.split(`,`),a=[],{styleSettings:o}=e;i.forEach(e=>{a.push(parseInt(e,10))}),a.push(o.opacityContour),o.colorContour=a,rm({getters:e,commit:t},o),n(`updateDrawInteraction`)}function um({getters:e,commit:t,dispatch:n},{target:r}){let i=r.options[r.selectedIndex].value.split(`,`),a=[],{styleSettings:o}=e;i.forEach(e=>{a.push(parseInt(e,10))}),a.push(o.opacityContour),o.outerColorContour=a,rm({getters:e,commit:t},o),n(`updateDrawInteraction`)}function dm({state:e,commit:t},n){e.iconList.find(e=>e.id===n.id)||t(`addSymbol`,n)}function fm({commit:e,dispatch:t},{target:n}){let r=n.options[n.selectedIndex];e(`setFreeHand`,r.id===`drawCurve`),e(`setDrawType`,{id:r.id,geometry:r.value}),t(`updateDrawInteraction`)}function pm({getters:e,commit:t,dispatch:n},{target:r}){let i=r.options[r.selectedIndex].value,{styleSettings:a}=e;a.font=i,rm({getters:e,commit:t},a),n(`updateDrawInteraction`)}function mm({getters:e,commit:t,dispatch:n},{target:r}){let i=r.options[r.selectedIndex].value,{styleSettings:a}=e;a.fontSize=i,rm({getters:e,commit:t},a),n(`updateDrawInteraction`)}function hm({getters:e,commit:t,dispatch:n},{target:r}){let i=parseFloat(r.options[r.selectedIndex].value),{styleSettings:a}=e;a.opacity=i,a.color[3]=i,rm({getters:e,commit:t},a),n(`updateDrawInteraction`)}function gm({getters:e,commit:t,dispatch:n},{target:r}){let i=parseFloat(r.options[r.selectedIndex].value),{styleSettings:a}=e;a.opacityContour=i,a.colorContour[3]=i,rm({getters:e,commit:t},a),n(`updateDrawInteraction`)}function _m({commit:e,dispatch:t},{target:n}){let r=n.options[n.selectedIndex];e(`setPointSize`,parseInt(r.value,10)),t(`updateDrawInteraction`)}function vm({getters:e,commit:t,dispatch:n},{target:r}){let i=r.options[r.selectedIndex].value,{styleSettings:a}=e;a.strokeWidth=parseInt(i,10),rm({getters:e,commit:t},a),n(`updateDrawInteraction`)}function ym({state:e,commit:t,dispatch:n},{target:r}){let i=r.options[r.selectedIndex],a=Object.values(e.iconList).filter(e=>e.id===i.value)[0];t(`setSymbol`,a),n(`updateDrawInteraction`)}function bm({getters:e,commit:t,dispatch:n},r){let i;i=r&&typeof r==`object`&&r.target?r.target.value:r;let{styleSettings:a}=e;a.text=i,rm({getters:e,commit:t},a),n(`updateDrawInteraction`)}function xm({getters:e,commit:t,dispatch:n},{target:r}){let i=r.options[r.selectedIndex].value,{styleSettings:a}=e;a.unit=i,rm({getters:e,commit:t},a),n(`updateDrawInteraction`)}var Sm=t({cancelDrawWithoutGUI:()=>Cm,downloadFeaturesWithoutGUI:()=>wm,downloadViaRemoteInterface:()=>Tm,editFeaturesWithoutGUI:()=>Em,initializeWithoutGUI:()=>Dm});function Cm({commit:e,dispatch:t},n){e(`setWithoutGUI`,!0),t(`manipulateInteraction`,{interaction:`draw`,active:!1}),t(`manipulateInteraction`,{interaction:`modify`,active:!1}),t(`manipulateInteraction`,{interaction:`delete`,active:!1}),n?.cursor!==void 0&&document.querySelector(`#map`).classList.remove(`no-cursor`)}function wm({rootState:e},t){let n,r,i={type:`FeatureCollection`,features:[]},a,o,s,c=null,u=[],d=new dn,f=j.getMapProjection(mapCollection.getMap(e.Maps.mode)),p=new Ge([]),m=new l([]),h=new Fn([]);return t?.prmObject?.transformWGS&&(c=`EPSG:4326`),t?.prmObject?.targetProjection!==void 0&&(c=t.prmObject.targetProjection),this.$app.config.globalProperties.$layer!==void 0&&this.$app.config.globalProperties.$layer!==null&&(r=this.$app.config.globalProperties.$layer.getSource().getFeatures(),t?.currentFeature!==void 0&&r.every(e=>e.get(`masterportal_attributes`).styleId!==t?.currentFeature.get(`masterportal_attributes`).styleId)&&r.push(t.currentFeature),t?.prmObject?.geomType===`multiGeometry`?(r.forEach(e=>{a=e.getGeometry().getType(),a===`Polygon`?h.appendPolygon(c===null?e.getGeometry():e.getGeometry().clone().transform(f,c)):a===`Point`?m.appendPoint(c===null?e.getGeometry():e.getGeometry().clone().transform(f,c)):a===`LineString`?p.appendLineString(c===null?e.getGeometry():e.getGeometry().clone().transform(f,c)
7):a===`Circle`?(n=et(c===null?e.getGeometry():e.getGeometry().clone().transform(f,c),64),h.appendPolygon(n)):(a===`MultiPolygon`||a===`MultiPoint`||a===`MultiLineString`)&&(c===null?o=e:(o=e.clone(),o.getGeometry().transform(f,c)),u.push(o))}),h.getCoordinates().length>0&&u.push(new V(h)),m.getCoordinates().length>0&&u.push(new V(m)),p.getCoordinates().length>0&&u.push(new V(p)),i=d.writeFeaturesObject(u)):(r.forEach(e=>{a=e.getGeometry().getType(),c===null?s=e:(s=e.clone(),s.getGeometry().transform(f,c)),a===`Circle`?u.push(new V(et(s.getGeometry(),64))):u.push(s)}),i=d.writeFeaturesObject(u))),JSON.stringify(i)}function Tm(){}function Em({dispatch:e}){e(`toggleInteraction`,`modify`)}async function Dm({state:e,commit:t,dispatch:n,getters:r,rootState:i},{drawType:a,color:o,opacity:s,maxFeatures:c,initialJSON:l,transformWGS:u,zoomToExtent:d}){let f=Om(a),p,m,h;if(t(`setFreeHand`,!1),t(`setWithoutGUI`,!0),[`Point`,`LineString`,`Polygon`,`Circle`,`Square`].indexOf(a)>-1){let{styleSettings:g}=r,_=!1;if(t(`setDrawType`,{id:f,geometry:a}),o&&(g.color=o,g.colorContour=o,rm({getters:r,commit:t},g)),s&&(m=g.color,m[3]=parseFloat(s),g.color=m,g.opacity=s,rm({getters:r,commit:t},g)),_=n(`Maps/checkLayer`,this.$app.config.globalProperties.$layer,{root:!0}),_||n(`Maps/addLayer`,this.$app.config.globalProperties.$layer,{root:!0}),n(`createDrawInteractionAndAddToMap`,{active:!0,maxFeatures:c}),n(`createSelectInteractionAndAddToMap`,!1),n(`createModifyInteractionAndAddToMap`,!1),n(`createModifyAttributesInteractionAndAddToMap`,!1),l)try{if(u){let e=j.getMapProjection(mapCollection.getMap(i.Maps.mode));h=new dn({defaultDataProjection:`EPSG:4326`}),p=h.readFeatures(l,{dataProjection:`EPSG:4326`,featureProjection:e})}else p=h.readFeatures(l);p.length>0&&(this.$app.config.globalProperties.$layer.setStyle(Bp.createStyle(e,g)),this.$app.config.globalProperties.$layer.getSource().addFeatures(p)),p.length>0&&d&&n(`Maps/zoomToExtent`,{extent:this.$app.config.globalProperties.$layer.getSource().getExtent()},{root:!0})}catch{n(`Alerting/addSingleAlert`,{category:`error`,content:i18next.t(`common:modules.draw_old.geometryDrawFailed`),displayClass:`error`,multipleAlert:!0},{root:!0})}}}function Om(e){switch(e){case`Circle`:return`drawCircle`;case`LineString`:return`drawLine`;case`Point`:return`drawSymbol`;case`Polygon`:return`drawArea`;case`Square`:return`drawSquare`;default:return`draw`}}function km(e,t,n){let r;return r=e.drawType.id===`drawSquare`?new i({source:n.config.globalProperties.$layer.getSource(),type:`Circle`,geometryFunction:hn(4),style:Bp.createStyle(e,t)}):new i({source:n.config.globalProperties.$layer.getSource(),type:e.drawType.geometry,style:Bp.createStyle(e,t),freehand:e.freeHand}),r}function Am(e){return new je({source:e.getSource()})}function jm(e){return new je({source:e.getSource()})}function Mm(e,t=0){return new tt({layers:[e],hitTolerance:t})}function Nm(e){return new we({font:`32px bold sans-serif`,fill:new S({color:`#93f105`}),stroke:new x({width:4,color:`#2752d9`}),text:`*`,offsetX:10,offsetY:-5,zIndex:99,placement:e.getGeometry()?.getType()===`Point`?`point`:`line`})}function Pm(e,t=`.`,n=`,`,r=!1){if(typeof e!=`number`&&typeof e!=`string`)return``;if(r&&/^\d{4}$/.test(String(e).trim()))return e;let i=typeof e==`string`?e:e.toString(),a=i.indexOf(`.`),o=(a>-1?i.substring(0,a):i).replace(/\B(?=(\d{3})+(?!\d),?.*)/g,t),s=a>-1&&i.substring(a+1);return s?o+n+s:o}function Fm({state:e,getters:t,commit:n,dispatch:r},i){let a=null,{styleSettings:o}=t,s=document.createElement(`div`),c={mapPointerMoveEvent:e=>{a.setPosition(e.coordinate)},featureChangeEvent:s=>{let c=null,l=``;e?.drawType?.id===`drawCircle`||e?.drawType?.id===`drawDoubleCircle`?c=s.target.getRadius():e?.drawType?.id===`drawSquare`||e?.drawType?.id===`drawArea`?(c=Bt(s.target,{projection:i}),l=`²`):e?.drawType?.id===`drawLine`&&(c=vt(s.target,{projection:i})),o.unit===`km`?a.getElement().innerHTML=(c/1e6).toFixed(3)+` km`+l:a.getElement().innerHTML=Pm(Math.round(c))+` m`+l,em({getters:t,commit:n,dispatch:r},Math.round(c)),Im({state:e,getters:t,commit:n,dispatch:r},c)}};return s.className=`ol-tooltip ol-tooltip-measure`,o?.tooltipStyle&&Object.keys(o.tooltipStyle).length!==0&&Object.keys(o.tooltipStyle).forEach(e
7=>{s.style[e]=o.tooltipStyle[e]}),a=new wn({element:s,offset:[0,-15],positioning:`bottom-center`}),a.set(`mapPointerMoveEvent`,c.mapPointerMoveEvent),a.set(`featureChangeEvent`,c.featureChangeEvent),a}function Im({state:e,getters:t,commit:n,dispatch:r},i){e?.drawType?.id===`drawCircle`||e?.drawType?.id===`drawDoubleCircle`?am({getters:t,commit:n,dispatch:r},Math.round(i)):e?.drawType?.id===`drawSquare`?tm({getters:t,commit:n,dispatch:r},Math.round(i)):e?.drawType?.id===`drawArea`?em({getters:t,commit:n,dispatch:r},Math.round(i)):e?.drawType?.id===`drawLine`&&$p({getters:t,commit:n,dispatch:r},Math.round(i))}function Lm(e,t){if(!Array.isArray(t)||t.length===0)return null;for(let n=0;n<t.length;n++)if(t[n]===null||typeof t[n]!=`object`||!Object.prototype.hasOwnProperty.call(t[n],`geometry`))continue;else if(t[n].geometry===e)return t[n];else if(Object.prototype.hasOwnProperty.call(t[n],`altGeometry`)&&Array.isArray(t[n].altGeometry)){for(let r=0;r<t[n].altGeometry.length;r++)if(t[n].altGeometry[r]===e)return t[n]}return t[0]}function Rm(e,t){let n=JSON.parse(t);n.features[0].properties===null&&(n.features[0].properties={}),n.features[0].properties.centerPoint=e}var zm=JSON.parse(JSON.stringify(Wf)),Bm={...Dp,addDrawStateToFeature({getters:e},t){if(!t)return;let{styleSettings:n}=e,r=JSON.parse(JSON.stringify(n)),i=e.symbol?JSON.parse(JSON.stringify(e.symbol)):``,a=JSON.parse(JSON.stringify(e.zIndex)),o=e.imgPath?JSON.parse(JSON.stringify(e.imgPath)):``,s=JSON.parse(JSON.stringify(e.pointSize)),c=JSON.parse(JSON.stringify(e.drawType));e.drawType.id===`drawDoubleCircle`&&(c={geometry:`Circle`,id:`drawCircle`}),t.set(`masterportal_attributes`,Object.assign(t.get(`masterportal_attributes`)??{},{drawState:{area:r.area,circleMethod:r.circleMethod,circleOuterRadius:r.circleOuterRadius,circleRadius:r.circleRadius,color:r.color,colorContour:r.colorContour,drawType:c,font:r.font,fontSize:parseInt(r.fontSize,10),imgPath:o,lineLength:r.length,opacity:r.opacity,opacityContour:r.opacityContour,outerColorContour:r.outerColorContour,pointSize:s,squareArea:r.squareArea,squareMethod:r.squareMethod,strokeWidth:r.strokeWidth,symbol:i,text:r.text,textAlign:r.textAlign||`left`,textBaseline:r.textBaseline||`bottom`,zIndex:a}}),!1)},addInteraction({dispatch:e},t){e(`Maps/addInteraction`,t,{root:!0})},clearLayer({dispatch:e}){this.$app.config.globalProperties.$layer.getSource().clear(),e(`setDownloadFeatures`)},clearTooltip({rootState:e},t){t.getElement().parentNode.removeChild(t.getElement()),mapCollection.getMap(e.Maps.mode).un(`pointermove`,t.get(`mapPointerMoveEvent`)),mapCollection.getMap(e.Maps.mode).removeOverlay(t)},createCenterPoint({rootState:e},{feature:t,targetProjection:n}){let r,i=[],a=t.getGeometry().getType(),o=mapCollection.getMap(e.Maps.mode);return a===`LineString`?i=n===void 0?t.getGeometry().getCoordinateAt(.5):j.transform(j.getMapProjection(o),n,t.getGeometry().getCoordinateAt(.5)):a===`Point`?i=n===void 0?t.getGeometry().getCoordinates():j.transform(j.getMapProjection(o),n,t.getGeometry().getCoordinates()):a===`Polygon`?(r=n===void 0?t.getGeometry().getInteriorPoint().getCoordinates():j.transform(j.getMapProjection(o),n,t.getGeometry().getInteriorPoint().getCoordinates()),i=r.slice(0,-1)):a===`Circle`&&(i=n===void 0?t.getGeometry().getCenter():j.transform(j.getMapProjection(o),n,t.getGeometry().getCenter())),i},createDrawInteractionAndAddToMap({state:e,commit:t,dispatch:n,getters:r},{active:i,maxFeatures:a}){let{styleSettings:o}=r,s=km(e,o,this.$app);if(e.selectInteractionModify?.getFeatures()?.getArray()?.length>0&&(e.selectInteractionModify.getFeatures().clear(),t(`setSelectedFeature`,null)),t(`setDrawInteraction`,s),n(`manipulateInteraction`,{interaction:`draw`,active:i}),n(`createDrawInteractionListener`,{isOuterCircle:!1,drawInteraction:``,maxFeatures:a}),n(`Maps/addInteraction`,s,{root:!0}),e.drawType.id===`drawDoubleCircle`){let r=km(e,o,this.$app);t(`setDrawInteractionTwo`,r),n(`manipulateInteraction`,{interaction:`draw`,active:i}),n(`createDrawInteractionListener`,{isOuterCircle:!0,drawInteraction:`Two`,maxFeatures:a}),n(`Maps/addInteraction`,r,{root:!0})}},createDrawInteractionListener({rootState:e,state:t,dispatch:n,getters:r,commit:i},{isOuterCircle:a,drawInteraction:o,maxFeatures:s}){let c=t[`drawInteraction`+o],l;c.on(`drawstart`,s=>{s.feature.set(`masterportal_attributes`,Object.assign(s.feature.get(`masterportal_attributes`)??{},{isOuterCircle:a,isVisible:!0})),n(`drawInteractionOnDrawEvent`,o);let c=t?.drawType?.id;if(c===`drawSquare`&&i(`setSquareSide`,0),c===`drawCircle`||c===`drawDoubleCircle`||c===`drawSquare`||c===`drawArea`||c===`drawLine`){l=Fm({state:t,getters:r,commit:i,dispatch:n},mapCollection.getMap(`2D`).getView().getProjection());let a=mapCollection.getMap(e.Maps.mode);a.addOverlay(l),a.on(`pointermove`,l.get(`mapPointerMoveEvent`)),s.feature.getGeometry().on(`change`,l.get(`featureChangeEvent`))}}),s&&s>0&&c.on(`drawstart`,()=>{this.$app.config.globalProperties.$layer.getSource().getFeatures().length>s-1&&(n(`Alerting/addSingleAlert`,{category:`error`,content:i18next.t(`common:modules.draw_old.limitReached`,{c
7ount:s}),displayClass:`error`,multipleAlert:!0},{root:!0}),n(`deactivateDrawInteractions`),c&&n(`removeInteraction`,c))}),c.on(`drawend`,e=>{n(`addDrawStateToFeature`,e.feature),n(`uniqueID`).then(t=>{if(e.feature.set(`masterportal_attributes`,Object.assign(e.feature.get(`masterportal_attributes`)??{},{styleId:t})),l&&=(e.feature.getGeometry().un(`change`,l.get(`featureChangeEvent`)),n(`clearTooltip`,l),null),n(`setDownloadFeatures`),Config.inputMap!==void 0&&Config.inputMap!==null){let{feature:t}=e,{targetProjection:r}=Config.inputMap;n(`cancelDrawWithoutGUI`,{cursor:`auto`}),n(`editFeaturesWithoutGUI`),n(`createCenterPoint`,{feature:t,targetProjection:r}).then(e=>{n(`downloadFeaturesWithoutGUI`,{prmObject:{targetProjection:r},currentFeature:t}).then(t=>Rm({type:`Point`,coordinates:e},t))})}})})},createModifyAttributesInteractionAndAddToMap({commit:e,dispatch:t},n){let r=jm(this.$app.config.globalProperties.$layer),i=Mm(this.$app.config.globalProperties.$layer,10);e(`setModifyAttributesInteraction`,r),t(`manipulateInteraction`,{interaction:`modifyAttributes`,active:n}),t(`createModifyAttributesInteractionListener`),t(`Maps/addInteraction`,r,{root:!0}),e(`setSelectInteractionModifyAttributes`,i),t(`createSelectInteractionModifyAttributesListener`),t(`Maps/addInteraction`,i,{root:!0})},createModifyAttributesInteractionListener({rootState:e,state:t,dispatch:n,commit:r,getters:i}){let a,o=!1;t.modifyAttributesInteraction.on(`modifystart`,s=>{t.selectedFeature&&r(`setSelectedFeature`,null),t.drawType.id===`drawSquare`&&r(`setSquareSide`,`-`),s.features.getArray().forEach(s=>{let c=null;typeof s.getGeometry().getCenter==`function`&&(c=JSON.stringify(s.getGeometry().getCenter())),s.getGeometry().once(`change`,async()=>{if(!o&&(o=!0,!t.selectedFeature||t.selectedFeature.ol_uid!==s.ol_uid)){let o=mapCollection.getMap(e.Maps.mode);await n(`saveAsCurrentFeatureAndApplyStyleSettings`,s),!a&&[`drawCircle`,`drawDoubleCircle`].includes(t.drawType.id)?c===JSON.stringify(s.getGeometry().getCenter())&&(a=Fm({state:t,getters:i,commit:r,dispatch:n},mapCollection.getMap(`2D`).getView().getProjection()),o.addOverlay(a),o.on(`pointermove`,a.get(`mapPointerMoveEvent`)),t.selectedFeature.getGeometry().on(`change`,a.get(`featureChangeEvent`))):(!a&&t.drawType.id===`drawSquare`||t.drawType.id===`drawArea`||t.drawType.id===`drawLine`)&&(a=Fm({state:t,getters:i,commit:r,dispatch:n},mapCollection.getMap(`2D`).getView().getProjection()),o.addOverlay(a),o.on(`pointermove`,a.get(`mapPointerMoveEvent`)),t.selectedFeature.getGeometry().on(`change`,a.get(`featureChangeEvent`)))}})})}),t.modifyAttributesInteraction.on(`modifyend`,e=>{o=!1,a&&=(t.selectedFeature.getGeometry().un(`change`,a.get(`featureChangeEvent`)),n(`clearTooltip`,a),null),n(`setDownloadFeatures`),Config.inputMap!==void 0&&Config.inputMap!==null&&n(`createCenterPoint`,{feature:e.features.getArray()[0],targetProjection:Config.inputMap.targetProjection}).then(t=>{n(`downloadFeaturesWithoutGUI`,{prmObject:{targetProjection:Config.inputMap.targetProjection},currentFeature:e.feature}).then(e=>Rm({type:`Point`,coordinates:t},e))})})},createModifyInteractionAndAddToMap({commit:e,dispatch:t},n){let r=Am(this.$app.config.globalProperties.$layer),i=Mm(this.$app.config.globalProperties.$layer,10);e(`setModifyInteraction`,r),t(`manipulateInteraction`,{interaction:`modify`,active:n}),t(`createModifyInteractionListener`),t(`Maps/addInteraction`,r,{root:!0}),e(`setSelectInteractionModify`,i),t(`createSelectInteractionModifyListener`),t(`Maps/addInteraction`,i,{root:!0})},createModifyInteractionListener({rootState:e,state:t,dispatch:n,commit:r,getters:i}){let a,o=!1;t.modifyInteraction.on(`modifystart`,s=>{t.selectedFeature&&r(`setSelectedFeature`,null),s.features.getArray().forEach(s=>{let c=null;typeof s.getGeometry().getCenter==`function`&&(c=JSON.stringify(s.getGeometry().getCenter())),s.getGeometry().once(`change`,async()=>{o||(o=!0,(!t.selectedFeature||t.selectedFeature.ol_uid!==s.ol_uid)&&(await n(`saveAsCurrentFeatureAndApplyStyleSettings`,s),!a&&(t.drawType.id===`drawCircle`||t.drawType.id===`drawDoubleCircle`)&&c===JSON.stringify(s.getGeometry().getCenter())&&(a=Fm({state:t,getters:i,commit:r,dispatch:n},mapCollection.getMap(`2D`).getView().getProjection()),mapCollection.getMap(e.Maps.mode).addOverlay(a),mapCollection.getMap(e.Maps.mode).on(`pointermove`,a.get(`mapPointerMoveEvent`)),t.selectedFeature.getGeometry().on(`change`,a.get(`featureChangeEvent`)))))})})}),t.modifyInteraction.on(`modifyend`,e=>{o=!1,a&&=(t.selectedFeature.getGeometry().un(`change`,a.get(`featureChangeEvent`)),n(`clearTooltip`,a),null),n(`setDownloadFeatures`),Config.inputMap!==void 0&&Config.inputMap!==null&&n(`createCenterPoint`,{feature:e.features.getArray()[0],targetProjection:Config.inputMap.targetProjection}).then(t=>{n(`downloadFeaturesWithoutGUI`,{prmObject:{targetProjection:Config.inputMap.targetProjection},currentFeature:e.feature}).then(e=>Rm({type:`Point`,coordinates:t},e))})})},createSelectInteractionModifyAttributesListener({state:e,commit:t,dispatch:n}){e.selectInteractionModifyAttributes.on(`select`,r=>{if(e.currentInteraction!==`modifyAttributes`||!r.selected.length){e.selectInteractionModifyAttributes.getFeatures().clear(),e.selectedFeature&&t(`setSelectedFeature`,null);return}let i=r.selected[r.selected.length-1];n(`saveAsCurrentFeatureAndApplyStyleSettings`,i),setTimeout(()=>{e.selectInteractionModifyAttributes.getFeatures().clear();let n=Nm(e.selectedFeature);if(t(`setOldStyle`,e.selectedFeature.getStyle()),typeof e.selectedFeature?.getStyle()==`function`){let t=e.selectedFeature.getStyle()(e.selectedFeature);Array.isArray(t)&&t.length>0&&(t=t[0]),t?.getText()?.getText()||(t.setText(n),e.selectedFeature.setStyle(t))}else if(typeof e.selectedFeature.getStyle()==`object`){let t=e.selectedFeature.getStyle();t&&(t.setText(n),e.selectedFeature.setStyle(t))}},300)})},createSelectInteractionModifyListener({state:e,commit:t,dispatch:n}){e.selectInteractionModify.on(`select`,r=>{if(e.currentInteraction!==`modify`||!r.selected.length){(e.drawType.id===`writeText`||e.drawType.id===`drawSymbol`)&&n(`updateDrawInteraction`),e.selectInteractionModify.getFeatures().clear(),e.selectedFeature&&t(`setSelectedFeature`,null);return}let i=r.selected[r.selected.length-1];n(`saveAsCurrentFeatureAndApplyStyleSettings`,i)})},createSelectInteractionAndAddToMap({commit:e,dispatch:t},n){let r=Mm(this.$app.config.globalProperties.$layer);e(`setSelectInteraction`,r),t(`manipulateInteraction`,{interaction:`delete`,active:n}),t(`createSelectInteractionListener`),t(`Maps/addInteraction`,r,{root:!0})},createSelectInteractionListener({state:e,dispatch:t}){e.selectInteraction.on(`select`,n=>{this.$app.config.globalProperties.$layer.getSource().removeFeature
7(n.selected[0]),e.selectInteraction.getFeatures().clear(),t(`setDownloadFeatures`)})},deactivateDrawInteractions({state:e,rootState:t}){mapCollection.getMap(t.Maps.mode).getInteractions().forEach(t=>{t instanceof i&&e.deactivatedDrawInteractions.indexOf(t)===-1&&e.deactivatedDrawInteractions.push(t)})},drawInteractionOnDrawEvent:Yp,handleDrawEvent:Xp,manipulateInteraction({state:e},{interaction:t,active:n}){t===`draw`?(e.drawInteraction!==void 0&&e.drawInteraction!==null&&e.drawInteraction.setActive(n),e.drawInteractionTwo!==void 0&&e.drawInteractionTwo!==null&&e.drawInteractionTwo.setActive(n)):t===`modify`?(e.modifyInteraction!==void 0&&e.modifyInteraction!==null&&e.modifyInteraction.setActive(n),e.selectInteractionModify!==void 0&&e.selectInteractionModify!==null&&e.selectInteractionModify.setActive(n)):t===`modifyAttributes`?(e.modifyAttributesInteraction!==void 0&&e.modifyAttributesInteraction!==null&&e.modifyInteraction.setActive(n),e.selectInteractionModifyAttributes!==void 0&&e.selectInteractionModifyAttributes!==null&&e.selectInteractionModifyAttributes.setActive(n)):t===`delete`&&e.selectInteraction!==void 0&&e.selectInteraction!==null&&e.selectInteraction.setActive(n)},redoLastStep({state:e,commit:t,dispatch:n}){let r=e.redoArray,i=r[r.length-1];if(i!=null){let r=e.fId;i.setId(r),t(`setFId`,e.fId+1),this.$app.config.globalProperties.$layer.getSource().addFeature(i),this.$app.config.globalProperties.$layer.getSource().getFeatureById(r).setStyle(i.getStyle()),n(`updateRedoArray`,{remove:!0}),n(`updateUndoArray`,{remove:!1,feature:i})}},removeInteraction({dispatch:e},t){e(`Maps/removeInteraction`,t,{root:!0})},resetModule({state:e,commit:t,dispatch:n,getters:r}){n(`toggleInteraction`,`draw`),n(`manipulateInteraction`,{interaction:`draw`,active:!1}),e.drawInteraction&&n(`removeInteraction`,e.drawInteraction),e.drawInteractionTwo&&n(`removeInteraction`,e.drawInteractionTwo),e.modifyInteraction&&n(`removeInteraction`,e.modifyInteraction),e.selectInteractionModify&&n(`removeInteraction`,e.selectInteractionModify),e.selectInteraction&&n(`removeInteraction`,e.selectInteraction),e.modifyAttributesInteraction&&n(`removeInteraction`,e.modifyAttributesInteraction),e.selectInteractionModifyAttributes&&n(`removeInteraction`,e.selectInteractionModifyAttributes),t(`setSelectedFeature`,null),t(`setDrawType`,zm.drawType),t(`setFreeHand`,zm.freeHand),t(`setPointSize`,zm.pointSize),t(`setSymbol`,r.iconList[0]),t(`setWithoutGUI`,zm.withoutGUI),t(`setDownloadDataString`,zm.download.dataString),t(`setDownloadFeatures`,zm.download.features),t(`setDownloadFileName`,zm.download.fileName),t(`setDownloadSelectedFormat`,zm.download.selectedFormat),e.addFeatureListener.listener&&this.$app.config.globalProperties.$layer.getSource().un(`addFeature`,e.addFeatureListener.listener)},saveAsCurrentFeatureAndApplyStyleSettings:async({commit:e,dispatch:t,getters:n},r)=>{let{styleSettings:i}=n,a=r.get(`masterportal_attributes`).drawState;if(a===void 0)e(`setDrawType`,Lm(r.getGeometry().getType(),Kf)),await t(`addDrawStateToFeature`,r),a=r.get(`masterportal_attributes`).drawState;else{let t=r.get(`masterportal_attributes`).drawState.drawType;!t&&a.fontSize?(t={geometry:`Point`,id:`writeText`},e(`setDrawType`,t),a=Object.assign(n.styleSettings,a,{drawType:t}),r.set(`masterportal_attributes`,Object.assign(r.get(`masterportal_attributes`)??{},{drawState:a}))):e(`setDrawType`,t)}if(e(`setSelectedFeature`,r),r.getGeometry().getType()===`LineString`&&i.colorContour===void 0)try{let e=r.getStyle()(r);if(e&&e.length>0){let t=e[e.length-1],n=t.getStroke().getColor();i.colorContour=n,i.opacityContour=n.length===4?n[3]:1,i.strokeWidth=t.getStroke().getWidth()}}catch(e){console.warn(e.message)}Object.assign(i,a),e(`setSymbol`,r.get(`masterportal_attributes`).drawState.symbol),rm({commit:e,getters:n},i)},...Qp,toggleInteraction({getters:e,commit:t,dispatch:n},r){t(`setFormerInteraction`,e.currentInteraction),t(`setCurrentInteraction`,r),t(`setSelectedFeature`,null),r===`draw`?(n(`manipulateInteraction`,{interaction:`draw`,active:!0}),n(`manipulateInteraction`,{interaction:`modify`,active:!1}),n(`manipulateInteraction`,{interaction:`modifyAttributes`,active:!1}),n(`manipulateInteraction`,{interaction:`delete`,active:!1}),n(`updateDrawInteraction`)):r===`modify`?(n(`manipulateInteraction`,{interaction:`draw`,active:!1}),n(`manipulateInteraction`,{interaction:`modify`,active:!0}),n(`manipulateInteraction`,{interaction:`modifyAttributes`,active:!1}),n(`manipulateInteraction`,{interaction:`delete`,active:!1})):r===`modifyAttributes`?(n(`manipulateInteraction`,{interaction:`draw`,active:!1}),n(`manipulateInteraction`,{interaction:`modify`,active:!1}),n(`manipulateInteraction`,{interaction:`modifyAttributes`,active:!0}),n(`manipulateInteraction`,{interaction:`delete`,active:!1})):r===`delete`?(n(`manipulateInteraction`,{interaction:`draw`,active:!1}),n(`manipulateInteraction`,{interaction:`modify`,active:!1}),n(`manipulateInteraction`,{interaction:`modifyAttributes`,active:!1}),n(`manipulateInteraction`,{interaction:`delete`,active:!0})):r===`none`&&(n(`manipulateInteraction`,{interaction:`draw`,active:!1}),n(`manipulateInteraction`,{interaction:`modify`,active:!1}),n(`manipulateInteraction`,{interaction:`modifyAttributes`,active:!1}),n(`manipulateInteraction`,{interaction:`delete`,active:!1}))},undoLastStep({state:e,dispatch:t}){let n=e.undoArray,r=n[n.length-1];r!=null&&(t(`updateRedoArray`,{remove:!1,feature:r}),t(`updateUndoArray`,{remove:!0}),this.$app.config.globalProperties.$layer.getSource().removeFeature
7(r))},uniqueID({state:e,commit:t},n){let r=e.idCounter+1;return t(`setIdCounter`,r),n?n+r:r.toString(10)},updateCircleRadiusDuringModify({state:e,rootState:t,dispatch:n},r){if(e.currentInteraction===`modify`&&e.selectedFeature!==null&&(e.drawType.id===`drawCircle`||e.drawType.id===`drawDoubleCircle`)){let i=e.selectedFeature,a=i.getGeometry().getCenter();Gp.calculateCircle({feature:i},a,r,mapCollection.getMap(t.Maps.mode)),n(`addDrawStateToFeature`,e.selectedFeature)}},updateDrawInteraction({state:e,commit:t,getters:n,dispatch:r}){if(e.currentInteraction===`modify`&&e.selectedFeature!==null){let{styleSettings:t}=n;e.selectedFeature.setStyle(function(e){if(e.get(`masterportal_attributes`).isVisible===void 0||e.get(`masterportal_attributes`).isVisible)return Bp.createStyle(e.get(`masterportal_attributes`).drawState,t)}),r(`addDrawStateToFeature`,e.selectedFeature);return}r(`removeInteraction`,e.drawInteraction),t(`setDrawInteraction`,null),e.drawInteractionTwo!==void 0&&e.drawInteractionTwo!==null&&(e.drawInteractionTwo&&r(`removeInteraction`,e.drawInteractionTwo),t(`setDrawInteractionTwo`,null)),r(`createDrawInteractionAndAddToMap`,{active:!0})},updateRedoArray:({state:e,commit:t},{remove:n,feature:r})=>{let i=e.redoArray;n?i.pop():i.push(r),t(`setRedoArray`,i)},updateDrawLayerVisible:({getters:e,commit:t,dispatch:n},{value:r,layer:i})=>{i?.setVisible(r),r?e.formerInteraction&&n(`toggleInteraction`,e.formerInteraction):(t(`setFormerInteraction`,e.currentInteraction),n(`toggleInteraction`,`none`)),t(`setDrawLayerVisible`,r)},updateUndoArray:({state:e,commit:t},{remove:n,feature:r})=>{let i=e.undoArray;n?i.pop():i.push(r),t(`setUndoArray`,i)},...Sm},Vm={...H(Wf),styleSettings(e){let t=e.drawType.id+`Settings`;return JSON.parse(JSON.stringify(e[t]))},disableFileDownload(e){let{features:t,fileName:n,selectedFormat:r,featuresNotSupported:i}=e.download;return t.length===0||n===``||r===``||r===`none`||i},urlParams:e=>({type:e.type,name:e.name,icon:e.icon})},Hm={namespaced:!0,state:Wf,actions:Bm,mutations:{...U(Wf),setSquareSide:(e,t)=>{e.drawSquareSettings.squareSide=t},setDownloadDataString:(e,t)=>{e.download.dataString=t},setDownloadEnabled:e=>{e.download.enabled=!e.download.enabled},setDownloadFeatures:(e,t)=>{e.download.features=t},setDownloadFile:(e,t)=>{e.download.file=t},setDownloadFileName:(e,t)=>{e.download.fileName=t},setDownloadFileUrl:(e,t)=>{e.download.fileUrl=t},setDownloadFeaturesNotSupported:(e,t)=>{e.download.featuresNotSupported=t},setDownloadSelectedFormat:(e,t)=>{e.download.selectedFormat=t},addSymbol:(e,t)=>{e.iconList.push(t)},setDrawSymbolSettings:(e,t)=>{e.drawSymbolSettings.color=t.color,e.drawSymbolSettings.opacity=t.opacity},setDrawAreaSettings:(e,t)=>{e.drawAreaSettings.area=t.area,e.drawAreaSettings.color=t.color,e.drawAreaSettings.colorContour=t.colorContour,e.drawAreaSettings.opacity=t.opacity,e.drawAreaSettings.opacityContour=t.opacityContour,e.drawAreaSettings.strokeWidth=t.strokeWidth,e.drawAreaSettings.unit=t.unit},setDrawCircleSettings:(e,t)=>{e.drawCircleSettings.circleMethod=t.circleMethod,e.drawCircleSettings.circleOuterRadius=t.circleOuterRadius,e.drawCircleSettings.circleRadius=t.circleRadius,e.drawCircleSettings.color=t.color,e.drawCircleSettings.colorContour=t.colorContour,e.drawCircleSettings.opacity=t.opacity,e.drawCircleSettings.opacityContour=t.opacityContour,e.drawCircleSettings.outerColorContour=t.outerColorContour,e.drawCircleSettings.strokeWidth=t.strokeWidth,e.drawCircleSettings.unit=t.unit},setDrawCurveSettings:(e,t)=>{e.drawCurveSettings.color=t.color,e.drawCurveSettings.colorContour=t.colorContour,e.drawCurveSettings.opacity=t.opacity,e.drawCurveSettings.opacityContour=t.opacityContour,e.drawCurveSettings.strokeWidth=t.strokeWidth},setDrawLineSettings:(e,t)=>{e.drawLineSettings.color=t.color,e.drawLineSettings.colorContour=t.colorContour,e.drawLineSettings.length=t.length,e.drawLineSettings.opacity=t.opacity,e.drawLineSettings.opacityContour=t.opacityContour,e.drawLineSettings.strokeWidth=t.strokeWidth,e.drawLineSettings.unit=t.unit},setDrawSquareSettings:(e,t)=>{e.drawSquareSettings.color=t.color,e.drawSquareSettings.colorContour=t.colorContour,e.drawSquareSettings.opacity=t.opacity,e.drawSquareSettings.opacityContour=t.opacityContour,e.drawSquareSettings.squareArea=t.squareArea,e.drawSquareSettings.squareMethod=t.squareMethod,e.drawSquareSettings.squareSide=t.squareSide,e.drawSquareSettings.strokeWidth=t.strokeWidth,e.drawSquareSettings.unit=t.unit},setAttributesKeyList:(e,t)=>
7{e.attributesKeyList=t}},getters:Vm};async function Um(e,t,n={}){if(e){let r=n.layerName?n.layerName:`common:shared.js.utils.selectedFeatures`,i=Wm(e);if(i){let n=i.get(`name`).replace(i18next.t(r),``).trim(),a=i18next.t(r)+` `+n,o=e.indexOf(n)===-1?e+`_`+zr():e,s=Km(i,o,a,r),c=W.getLayerById(o),l=null;c?($.dispatch(`replaceByIdInLayerConfig`,{layerConfigs:[{id:o,layer:{visibility:s.visibility,showInLayerTree:s.showInLayerTree,zIndex:1/0}}]},{root:!0}),$.dispatch(`updateAllZIndexes`,null,{root:!0})):c=await Gm(s,o),qm(c,s.styleId),l=c.getLayerSource(),l.getFeatures().forEach(e=>l.removeFeature(e)),l.addFeatures(t)}else console.warn(`Layer with id `,e,` not found, layer with features was not created!`)}}function Wm(e){let t=W.getLayerById(e);return t||=Gm(jt.getLayerWhere({id:e}),e),t}async function Gm(e,t){return await $.dispatch(`addLayerToLayerConfig`,{layerConfig:e,parentKey:er},{root:!0}),W.getLayerById(t)}function Km(e,t,n){let r={...e.attributes};return r.visibility=!0,r.id=t,r.typ=`VectorBase`,r.alwaysOnTop=!0,r.name=n,r.showInLayerTree=!0,r.minScale=0,r.maxScale=1/0,r.checkForScale=!1,r}function qm(e,t){let n=Ft.returnStyleObject(t);n!==void 0&&e.getLayer().setStyle(e=>Jt.createStyle(n,e,!1,Config.wfsImgPath))}var Jm={createLayerAddToTree:Um};async function Ym(e,t,n,{dispatch:r,commit:i}){let a=t.url,o=t.version,s=(t.featurePrefix||`app`).replace(/:$/,``),c=t.featureType,l=new URL(a),u=await(await(l.searchParams.set(`service`,`WFS`),l.searchParams.set(`version`,o),l.searchParams.set(`request`,`DescribeFeatureType`),l.searchParams.set(`typeName`,c),fetch(l.toString()))).text(),d=new DOMParser().parseFromString(u,`text/xml`).querySelector(`[type^="gml:"][name]`),f=Array.isArray(d)?d[0]:d,p=he(f?f.getAttribute(`name`):`geom`,e),m=new Ne,h=m.writeGetFeature({srsName:n,featureNS:t.featureNS,featurePrefix:s,featureTypes:[c],filter:p}),g=new XMLSerializer().serializeToString(h),_=await fetch(t.url,{method:`POST`,headers:{"Content-Type":`text/xml`},body:g}),v=``,ee=[];if(!_.ok)throw i(`setLoading`,!1),r(`Alerting/addSingleAlert`,{category:`warning`,content:i18next.t(`common:modules.featureLister.requestFailedAlert`)},{root:!0}),Error(`Failed to fetch data from WFS service: ${_.statusText}`);return v=await _.text(),ee=m.readFeatures(v,{dataProjection:n,featureProjection:n}),ee}async function Xm(e,t,n,r){let i=JSON.stringify(e),a=JSON.parse(i).coordinates[0],o=new Xe([a]);return t.typ===`WFS`?Ym(o,t,n,r):null}var Zm={getSpatialSelection:Xm},Qm={clickOnFeature({state:e,commit:t,dispatch:n,getters:r,rootGetters:i},a){if(a&&a.id){let o=r.selectedFeature(a.id),s=o.getGeometry(),c=r.getGeometryType?.toLowerCase().indexOf(`polygon`)>-1?e.highlightVectorRulesPolygon:e.highlightVectorRulesPointLine;t(`setSelectedRow`,a),n(`switchToDetails`),c&&c.zoomLevel&&s&&typeof s.getType==`function`&&(s.getType()===`Point`?n(`Maps/zoomToCoordinates`,{center:s.getCoordinates()},{root:!0}):n(`Maps/zoomToCoordinates`,{center:Sn(s.getExtent())},{root:!0}),n(`Maps/setZoom`,c.zoomLevel,{root:!0})),i.treeHighlightedFeatures?.active&&Jm.createLayerAddToTree(e.layer.id,[o],i.treeHighlightedFeatures)}},hoverOverFeature({dispatch:e,getters:t},n){if(n&&n.id){let r=t.selectedFeature(n.id);(r.getGeometry().getType()===`Point`||r.getGeometry().getType()===`MultiPoint`)&&e(`Maps/placingPointMarker`,r.getGeometry().flatCoordinates,{root:!0}),(r.getGeometry().getType()===`Polygon`||r.getGeometry().getType()===`MultiPolygon`)&&e(`Maps/placingPolygonMarker`,r.getGeometry(),{root:!0}),(r.getGeometry().getType()===`LineString`||r.getGeometry().getType()===`MultiLineString`)&&e(`Maps/placingPointMarker`,[r.getGeometry().flatCoordinates[0],r.getGeometry().flatCoordinates[1]],{root:!0})}},highlightSelectedFeatures({state:e,dispatch:t,getters:n,rootGetters:r},i){let a=W.getLayerById(e.layer.id)?.getLayerSource()?.getFeatures()||[],o=new Set;for(let s of i){let i=s.getGeometry?.()?.getCoordinates?.()?.toString(),c=a.find(e=>{let t=e.getGeometry?.()?.getCoordinates?.()?.toString();return t&&t===i})||(s.getGeometry?s:n.selectedFeature(s.id_)),l=r.layerConfigById(e.layer.id),u=n.getGeometryType?.toLowerCase().indexOf(`polygon`)>-1?e.highlightVectorRulesPolygon:e.highlightVectorRulesPointLine;if(!c||!c.getGeometry){console.warn(`Feature could not be highlighted - no geometry found:`,s);continue}let d=c.ol_uid;if(o.has(d))continue;o.add(d);let f=c.getGeometry().getType(),p={type:f===`Point`||f===`MultiPoint`?`increase`:`highlightPolygon`,id:c.getId(),layer:{id:e.layer.id},feature:c,scale:u.image?.scale};f===`LineString`&&(p.type=`highlightLine`),u.zoomLevel&&(p.zoomLevel=u.zoomLevel),l&&l.styleId&&(p.styleId=l.styleId),p.highlightStyle={fill:u.fill,stroke:u.stroke,image:u.image},t(`Maps/highlightFeature`,p,{root:!0})}},filterGfiFeaturesOfLayer:async({state:e,commit:t,dispatch:n,rootGetters:r,rootState:i})=>{let a=r.visibleLayerConfigs.find(t=>
7t.id===e.layer.id),o=await Zm.getSpatialSelection(e.selectedArea,a,i.Maps.projection.getCode(),{dispatch:n,commit:t});if(!o){n(`Alerting/addSingleAlert`,{category:`warning`,content:i18next.t(`common:modules.featureLister.requestFailedAlert`)},{root:!0}),t(`setGfiFeaturesOfLayer`,[]),t(`setFeatureCount`,0),t(`setShownFeatures`,0);return}t(`setGfiFeaturesOfLayer`,o),n(`highlightSelectedFeatures`,o)},switchBackToList({state:e,commit:t}){e.layer&&t(`setActiveTab`,`list`)},switchToList:async({state:e,commit:t,dispatch:n})=>{await n(`processGfiFeatures`);let r=e.selectedArea!==null;if(e.gfiFeaturesOfLayer.length===0){n(`Alerting/addSingleAlert`,{category:`info`,content:i18next.t(r?`common:modules.featureLister.noFeaturesFound`:`common:modules.featureLister.noFeaturesFoundInMap`)},{root:!0});return}t(`setFeatureCount`,e.gfiFeaturesOfLayer.length),t(`setShownFeatures`,e.gfiFeaturesOfLayer.length<e.maxFeatures?e.gfiFeaturesOfLayer.length:e.maxFeatures),t(`setSelectedRow`,null),t(`setActiveTab`,`list`)},processGfiFeatures:async({state:e,commit:t,dispatch:n})=>{e.layer&&(e.selectedArea?(t(`setLoading`,!0),await n(`filterGfiFeaturesOfLayer`),t(`setLoading`,!1)):t(`setGfiFeaturesOfLayer`))},switchToDetails({state:e,commit:t}){e.layer&&t(`setActiveTab`,`details`)},switchToThemes({commit:e,dispatch:t}){t(`Maps/removeHighlightFeature`,`decrease`,{root:!0}),t(`Maps/removePointMarker`,null,{root:!0}),t(`Maps/removePolygonMarker`,null,{root:!0}),e(`resetToThemeChooser`)},showMore({state:e,commit:t}){t(`setShownFeatures`,e.shownFeatures<e.featureCount-10?e.shownFeatures+10:e.featureCount)}},$m={hasMouseMapInteractions:!0,type:`featureLister`,description:`common:modules.featureLister.description`,name:`common:modules.featureLister.name`,icon:`bi-list`,maxFeatures:20,layer:null,activeTab:`themes`,gfiFeaturesOfLayer:[],featureCount:``,shownFeatures:``,nestedFeatures:!1,headers:[],selectedRow:null,highlightVectorRulesPolygon:{fill:{color:[255,0,255,.9]},stroke:{width:4,color:[0,0,204,.9]},zoomLevel:7},highlightVectorRulesPointLine:{stroke:{width:8,color:[255,0,255,.9]},image:{scale:2},zoomLevel:7},supportedDevices:[`Desktop`,`Mobile`,`Table`],supportedMapModes:[`2D`],selectedArea:null,loading:!1,showGraphicalSelect:!1,bufferDistance:100};function eh(e){return typeof e!=`object`||!e?e:Object.fromEntries(Object.entries(e).map(([e,t])=>[e,typeof t==`string`?t.replace(/(?:\r\n|\r|\n)/g,`|`):t]))}function th(e,t){let n=e.get(`infoFormat`);return nh(t,e.get(`gfiAsNewWindow`),window.open)===!0?[]:n===`text/xml`||n===`application/vnd.ogc.gml`?rh(e,t):n===`application/json`?ah(e,t):sh(e,t)}function nh(e,t,n){if(typeof e!=`string`||typeof n!=`function`)return!1;let r=t;return(typeof r!=`object`||!r)&&e.startsWith(`http:`,0)&&location.protocol===`https:`&&(r={name:``,specs:``}),typeof r==`object`&&r?(n(e,r?.name?r.name:``,r?.specs?r.specs:``),!0):!1}function rh(e,t){return typeof t==`string`?Uu(`text/xml`,t,e).then(n=>ih(n,e,t)):[]}function ih(e,t,n){let r=[],i=``;return Array.isArray(e)?(Array.isArray(e[0])&&e[0].length&&(i=e.shift().map(e=>Number(e))),e.forEach(function(e){typeof e==`object`&&e&&typeof e.getProperties==`function`&&r.push(lh(t,n,e))}),r=uh(r,t,n,i),r):r}function ah(e,t){return typeof t==`string`?Uu(`application/json`,t,e).then(n=>oh(n,e,t)):[]}function oh(e,t,n){let r=mapCollection.getMap(`2D`)?.getView()?.getProjection(),i=new dn({dataProjection:r,featureProjection:e?.crs?.properties?.name}),a=[];return typeof e==`object`&&Array.isArray(e?.features)&&e.features.forEach(function(e){if(typeof e==`object`){e.getProperties=()=>eh(e.properties||{}),e.getId=()=>e.id||``;try{a.push(lh(t,n,i.readFeature(e)))}catch{a.push(lh(t,n,e)),typeof onerror==`function`&&onerror(Error(`handleJSONResponse: JSON structure in WMS FeatureInfo can't be parsed.`))}}}),a=uh(a,t,n),a}function sh(e,t){return typeof t==`string`?Uu(`text/html`,t,e).then(n=>ch(n,e,t)):[]}function ch(e,t,n){return e===null?[]:[lh(t,n,null,null,e)]}function lh(e,t=``,n=null,r=null,i=``,a=null){return e?{getTitle:()=>{let t=e.get(`gfiTitleAttribute`),r=e.get(`name`);if(t&&n){let e=n.getProperties()[t];if(e!=null&&e!==``&&e!==0)return e;console.warn(`GetFeatureInfo: gfiTitleAttribute "${t}" is configured for layer "${r}" but the attribute is missing, empty, or null in the feature. Falling back to layer name.`)}return r},getTheme:()=>e.get(`gfiTheme`)||`defaultTheme`,getAttributesToShow:()=>e.get(`gfiAttributes`),getProperties:()=>n?eh(n.getProperties()):{},getFeatures:()=>r,getOlFeature:()=>n,getId:()=>n&&typeof n.getId==`function`?n.getId():``,getGfiUrl:()=>t,getMimeType:()=>e.get(`infoFormat`),getLayerId:()=>e.get(`id`)?e.get(`id`):``,getDocument:()=>i,getBBox:()=>a}:{}}function uh(e,t,n,r){return e.length>0&&t&&([`DataTable`].indexOf(t.get(`gfiTheme`))!==-1||[`DataTable`].indexOf(t.get(`gfiTheme`)?.name)!==-1)?[lh(t,n,null,e,void 0,r)]:e}var dh={getWmsFeaturesByMimeType:th,openFeaturesInNewWindow:nh,getXmlFeatures:rh,createGfiFeature:lh,handleXmlResponse:ih,handleHTMLResponse:ch};function fh(e){if(typeof e!=`object`||!e)return[];let t=_h(e),n=[];if(ph(e)){let r=vh(e,t?t.attributes:void 0);r&&n.push(r)}else if(t&&e&&e.primitive&&e.primitive.olFeature){let r=xh(e.primitive.olFeature,t.attributes);
7Array.isArray(r)&&r.forEach(e=>{e&&n.push(e)})}else if(t&&e&&e.primitive&&mh(e.primitive.id)){let r=yh(e,t.attributes);r&&n.push(r)}return n}function ph(e){return e instanceof Cesium.Cesium3DTileFeature||e instanceof Cesium.Cesium3DTilePointFeature}function mh(e){return e instanceof Cesium.Entity}function hh(e,t){let n=null;if(e?.gfiTitleAttribute){let n=(t?.attributes?t.attributes:t)[e.gfiTitleAttribute];if(n!=null&&n!==``)return n;console.warn(`GetFeatureInfo: gfiTitleAttribute "${e.gfiTitleAttribute}" is configured for layer "${e?.name||e?.id||`unknown`}" but the attribute is missing, empty, or null in the feature. Falling back to layer name.`)}if(t?.attributes?.Objektart)n=t?.attributes?.Objektart;else if(e?.name)n=e.name;else if(e?.id){let t=$.getters.layerConfigById(e.id);t&&(n=t.name)}return n===null&&(n=i18next.t(`common:modules.getFeatureInfo.title`)),n}function gh(e,t){let n=hh(e,t),r=e&&e.id?e.id:``,i=e&&e.gfiTheme?e.gfiTheme:`DefaultTheme`,a=e&&e.gfiAttributes?e.gfiAttributes:t?.attributes,o=t?.attributes?t.attributes:t;return lh({get:t=>t===`name`?n:t===`id`?r:t===`gfiTheme`?i:t===`gfiAttributes`?a:t===`gfiTitleAttribute`?e?.gfiTitleAttribute:null},``,{getProperties:()=>o})}function _h(e,t=null,n=null,r=null){let i=null;if(!(typeof e!=`object`||!e)){if(typeof n==`function`?n(e):ph(e)&&typeof e.tileset==`object`&&e?.tileset?.layerReferenceId)i={id:e.tileset.layerReferenceId};else if(!e?.primitive||e.primitive===null||typeof e.primitive!=`object`)return;else e.primitive.olLayer?i={id:e.primitive.olLayer.get(`id`)}:(typeof r==`function`?r(e.primitive.id):mh(e.primitive.id))&&(i={id:e.primitive.id.layerReferenceId});return typeof t==`function`?t(i):{attributes:$.getters.layerConfigById(i.id)}}}function vh(e,t,n=null){if(typeof e!=`object`||!e||typeof e.getPropertyIds!=`function`||typeof e.getProperty!=`function`||!Array.isArray(e.getPropertyIds()))return;let r={};return e.getPropertyIds().forEach(t=>{r[t]=e.getProperty(t)}
7),r.attributes&&r.id&&(r.attributes.gmlid=r.id),typeof n==`function`?n(t,r):gh(t,r)}function yh(e,t,n=null){if(typeof e!=`object`||!e||e.primitive===null||typeof e.primitive!=`object`||e.primitive.id===null||typeof e.primitive.id!=`object`)return;let r=e.primitive.id.attributes;return delete r?.useConfigName,typeof n==`function`?n(t,r):gh(t,r)}function bh(e,t,n=null){if(typeof e!=`object`||!e||typeof e.getProperties!=`function`||typeof e.getProperty!=`function`||!Array.isArray(e.getProperties()))return;let r={};return e.getProperties().forEach(t=>{r[t]=e.getProperty(t)}),typeof n==`function`?n(t,r):gh(t,r)}function xh(e,t,n=null){if(typeof e!=`object`||!e||typeof e.getProperties!=`function`||typeof e.getProperty!=`function`&&typeof e.get!=`function`||e.getProperties()===null||typeof e.getProperties()!=`object`)return;let r=[];if(Object.prototype.hasOwnProperty.call(e.getProperties(),`features`)&&Array.isArray(e.get(`features`)))e.get(`features`).forEach(e=>{let i=null;i=typeof n==`function`?n(e,t):bh(e,t),i&&r.push(i)});else{let i=null;i=typeof n==`function`?n(e,t):bh(e,t),i&&r.push(i)}return r}var Sh={getGfiFeaturesByTileFeature:fh,getGfiFeature:gh,getLayerModelFromTileFeature:_h,getLayerName:hh,getGfiFeatureByCesium3DTileFeature:vh,getGfiFeatureByCesiumEntity:yh,getGfiFeatureByOlFeature:bh,getGfiFeaturesByOlFeature:xh},Ch={namespaced:!0,state:$m,mutations:{...U($m),setGfiFeaturesOfLayer:(e,t)=>{let n=W.getLayerById(e.layer.id),r=t??n.getLayerSource().getFeatures();if(r){let t=[],i=n.getLayer();r.forEach(n=>{if(n.values_&&Object.prototype.hasOwnProperty.call(n.values_,`features`))n.values_.features.forEach(e=>{let n=Sh.getGfiFeature(i.values_,e.values_);n.id=e.getId(),n.geom=e.getGeometry(),n.olFeature=e,t.push(n)}),e.nestedFeatures=!0;else{let r=Sh.getGfiFeature(i.values_,n.values_);r.id=n.getId(),r.geom=n.getGeometry(),r.olFeature=n,t.push(r),e.nestedFeatures=!1}}),e.gfiFeaturesOfLayer=t}},resetToThemeChooser:e=>{e.selectedRow=null,e.activeTab=`themes`,e.selectedArea=null,e.layer=null,e.headers=[],e.gfiFeaturesOfLayer=[]}},actions:Qm,getters:{...H($m),selectedFeature:e=>t=>{let n=e.gfiFeaturesOfLayer.find(e=>e.id===t);if(n?.olFeature)return n.olFeature;let r=W.getLayerById(e.layer.id).getLayerSource().getFeatures();return r.find(e=>e.getId()===t)||r.find(e=>e.get(`features`)?.find(e=>e.getId()===t))},headers:(e,t,n,r)=>{let i=0,a=[];if(e.gfiFeaturesOfLayer.length>0){let t=new Set([`id`]),n={id:`id`};e.gfiFeaturesOfLayer.forEach(e=>{let i=e.getAttributesToShow();i=i===`showAll`?Object.keys(e.getProperties()).map(e=>[e,e]):Object.entries(i),i.forEach(([e,i])=>{r.ignoredKeys.includes(e.toUpperCase())||(t.add(e),e in n||(n[e]=typeof i==`object`&&i.name?i.name:i))})}),a=Array.from(t).map(e=>({name:e===`id`?e:n[e],index:i++,visible:e!==`id`}))}return a},featureDetails(e,t,n,r){if(!e.selectedRow)return{};let i=e.gfiFeaturesOfLayer.find(t=>t.id===e.selectedRow.id),a=[...r.ignoredKeys,`ID`],o=[``,null,void 0],s=Object.values(i.getAttributesToShow());return i.getAttributesToShow()===`showAll`&&(s=Object.keys(e.selectedRow).filter(e=>!a.includes(e.toUpperCase()))),Object.fromEntries(Object.entries(e.selectedRow).filter(([e,t])=>s.includes(e)&&!o.includes(t)))},getGeometryType:e=>{if(e.layer.geometryType)return e.layer.geometryType;let t=W.getLayerById(e.layer.id).getLayerSource().getFeatures();return t.length>0?t[0].getGeometry().getType():(console.warn(`Fails to highlighting feature: no geometry type for layer `,e.layer.id),null)}}},wh={description:`common:modules.fileImport.description`,enableZoomToExtend:!1,featureExtents:{},icon:`bi-box-arrow-in-down`,importedFileNames:[],layer:void 0,layerId:`importDrawLayer`,name:`common:modules.fileImport.name`,selectedFiletype:`auto`,customStylingOption:!1,supportedDevices:[`Desktop`,`Mobile`,`Table`],supportedMapModes:[`2D`,`3D`],type:`fileImport`,gfiAttributes:{},customAttributeStyles:{},geojsonFeatureId:0,showConfirmation:!0,openDrawMenuSide:`secondaryMenu`,useDifferentLayers:!1},Th={auto:{caption:`common:modules.fileImport.captions.supportedFiletypes.auto`},kml:{caption:`common:modules.fileImport.captions.supportedFiletypes.
7kml`,rgx:/\.kml$/i},gpx:{caption:`common:modules.fileImport.captions.supportedFiletypes.gpx`,rgx:/\.gpx$/i},geojson:{caption:`common:modules.fileImport.captions.supportedFiletypes.geojson`,rgx:/\.(geo)?json$/i}},Eh=`16px Arial`,Dh={kml:new gn({extractStyles:!0,iconUrlFunction:e=>e,defaultStyle:[new T({image:new xe({anchor:[20,2],anchorOrigin:`bottom-left`,anchorXUnits:`pixels`,anchorYUnits:`pixels`,crossOrigin:`anonymous`,rotation:0,scale:1,size:[16,16],src:`${window.location.origin}/mastercode/3_26_0/img/tools/draw/circle_blue.svg`}),text:new we({fill:new S({color:[0,0,0,1]})}),zIndex:0})]}),gpx:new Yt,geojson:new dn};function Oh(e){return e.replace(/\.[^.]+$/,``).replace(/[^a-zA-Z0-9-]/g,`-`)}function kh(e,t,n){if(t!==`auto`)return n[t]===void 0?(console.warn(`File import tool: Selected filetype "`+t+`" has no OL Format defined for it.`),!1):n[t];for(let t in Th)if(Th[t].rgx!==void 0&&e.match(Th[t].rgx)!==null){if(n[t]===void 0){console.warn(`File import tool: Filetype "`+t+`" is defined as supported, but there isn't any OL Format defined for it.`);continue}return n[t]}return!1}function Ah(e){let t=e;return t=e.replace(/<.*?cascadingstyle.*?kml:id="(.+)">\s*<style>/gim,(e,t)=>`<Style id="`+t+`">`),t=t.replace(/<\/Style>\s*<\/.*?cascadingstyle>/gim,`</Style>`),t=t.replace(/<Placemark.*?(>)/gim,`<Placemark>`),t=jh(t),t}function jh(e){let t=e,n=t.match(/<href>([^<]*tools\/draw\/circle_[^<]*)<\/href>/g);return n&&n.forEach(e=>{let n=e.replace(/<\/?href>/g,``);if(!n.includes(`/mastercode/3_26_0/img`)||!n.includes(window.location.origin)){let e=n.match(/circle_([^.]+)\.svg/)[1],r=Jf.find(t=>t.color===e)?.value,i=fp(r);t=t.replace(n,i),console.warn(`replaced wrong symbol url during import`,n,` -> `,i)}}),t}function Mh(e){let t=`EPSG:4326`;try{let n=JSON.parse(e);n&&Object.prototype.hasOwnProperty.call(n,`crs`)&&Object.prototype.hasOwnProperty.call(n.crs,`properties`)&&Object.prototype.hasOwnProperty.call(n.crs.properties,`name`)&&(t=n.crs.properties.name)}catch{}return t}function Nh(e){let t=e;return t.forEach(e=>{Object.prototype.hasOwnProperty.call(e.getProperties(),`masterportal_attributes`)?Object.prototype.hasOwnProperty.call(e.get(`masterportal_attributes`),`isVisible`)||(e.get(`masterportal_attributes`).isVisible=!0):e.set(`masterportal_attributes`,{isVisible:!0})}),t}function Ph(e){if(typeof e.getKeys!=`function`||!Array.isArray(e.getKeys()))return{};let t=e.get(`attributes`);return q(t)||(t={}),e.getKeys().forEach(n=>{if(typeof n.split==`function`&&n.split(`custom-attribute____`).length>1){let r=n.split(`custom-attribute____`)[1];t[r]=e.get(n)}}),t}var Fh={checkAndReplaceSymbolUrls:jh,setFeatureExtents({state:e,commit:t},{features:n,fileName:r}){let i=e.featureExtents,a=kt();for(let e=0;e<n.length;e++)Et(a,n[e].getGeometry().getExtent());i[r]=a,t(`setFeatureExtents`,i)},importFile({state:e,dispatch:t,rootGetters:n,commit:r},i){let a=i.layer,o=i.filename,s=kh(o,e.selectedFiletype,Dh),c=Mh(i.raw),l=!1,u,d;if(s instanceof gn&&(i.raw=Ah(i.raw)),s===!1){let e=o.split(`.`),n=e.length>0?`*.`+e[e.length-1]:`unknown`;u={category:`error`,content:i18next.t(`common:modules.fileImport.alertingMessages.missingFormat`,{format:n})},t(`Alerting/addSingleAlert`,u,{root:!0});return}try{if(d=s.readFeatures(i.raw),s instanceof gn){let e=[];
7if(d.forEach((t,n)=>{t.getGeometry()!==null&&t.getGeometry().getType()===`Point`&&t.values_.name===void 0&&e.push(n)}),e.length>0){let t=new gn({extractStyles:!0,showPointNames:!1,crossOrigin:null}).readFeatures(i.raw);e.forEach(e=>{d[e]=t[e]})}}}catch(e){console.warn(e),u={category:`error`,content:i18next.t(`common:modules.fileImport.alertingMessages.formatError`,{filename:o})},t(`Alerting/addSingleAlert`,u,{root:!0});return}if(!Array.isArray(d)||d.length===0){u={category:`error`,content:i18next.t(`common:modules.fileImport.alertingMessages.missingFileContent`,{filename:o})},t(`Alerting/addSingleAlert`,u,{root:!0});return}d.forEach(i=>{let a=Ph(i),s={},d;if(i.setProperties(a),Object.keys(a).forEach(t=>{Object.prototype.hasOwnProperty.call(e.gfiAttributes,t)||r(`setGFIAttribute`,{key:t}),i.unset(`custom-attribute____`+t)}),Object.keys(i.getProperties()).forEach(e=>{if([`isOuterCircle`,`drawState`,`fromDrawTool`,`invisibleStyle`,`styleId`,`source`,`attributes`,`isVisible`,`isGeoCircle`,`geoCircleCenter`,`geoCircleRadius`,`isSquare`,`squareCoords`].indexOf(e)>=0){if(e!==`attributes`&&e!==`drawState`&&e!==`invisibleStyle`&&e!==`masterportal_attributes`){let t=i.get(e);t===`true`?t=!0:t===`false`&&(t=!1),s[e]=t}i.unset(e)}}),i.set(`masterportal_attributes`,s),i.get(`masterportal_attributes`).isGeoCircle){let e=i.get(`masterportal_attributes`).geoCircleCenter.split(`,`).map(parseFloat),t=parseFloat(i.get(`masterportal_attributes`).geoCircleRadius);i.setGeometry(new ht(e,t))}if(i.get(`masterportal_attributes`).isSquare){let e=i.get(`masterportal_attributes`).squareCoords;if(typeof e==`string`)try{e=JSON.parse(e)}catch(t){console.error(`Failed to parse squareCoords:`,t),e=null}Array.isArray(e)&&i.setGeometry(new Xe([e]))}if(/true/.test(i.get(`masterportal_attributes`).fromDrawTool)&&i.get(`name`)&&i.getGeometry().getType()===`Point`){let e=i.getStyleFunction()(i).clone();i.setStyle(new T({image:new re,text:new we({fill:e.getText().getFill(),font:Eh,scale:e.getText().getScale(),text:e.getText().getText(),textAlign:`left`,textBaseline:`bottom`})})),i.get(`masterportal_attributes`).drawState={fontSize:parseInt(Eh.split(`px`)[0],10)*e.getText().getScale(),text:e.getText().getText(),color:e.getText().getFill().getColor()}}i.getGeometry()===null?(l=!0,u={category:`error`,content:i18next.t(`common:modules.fileImport.alertingMessages.featureError`)},t(`Alerting/addSingleAlert`,u,{root:!0})):(d=i.getGeometry().getType()===`GeometryCollection`?i.getGeometry().getGeometries():[i.getGeometry()],d.forEach(e=>{let t=c;c===`urn:ogc:def:crs:EPSG:6.6:4326`||c===`urn:ogc:def:crs:OGC:1.3:CRS84`||c===`urn:ogc:def:crs:OGC:1.3:CRS:84`||c===`urn:ogc:def:crs:OGC:2:84`||c===`urn:x-ogc:def:crs:EPSG:4326`?t=`EPSG:4326`:(c===`EPSG:102100`||c===`EPSG:102113`||c===`EPSG:900913`||c===`urn:ogc:def:crs:EPSG:6.18:3:3857`)&&(t=`EPSG:3857`),e.transform(t,n[`Maps/projectionCode`]),i.set(`source`,o)})),typeof i.get==`function`&&i.get(`masterportal_attributes`).styleId===void 0&&(i.get(`masterportal_attributes`).styleId=zr(``))}),d=Nh(d),a.getSource().addFeatures(d),a.set(`gfiAttributes`,e.gfiAttributes),u=l?{category:`error`,content:i18next.t(`common:modules.fileImport.alertingMessages.successPartly`,{filename:o})}:{category:`success`,content:i18next.t(`common:modules.fileImport.alertingMessages.success`,{filename:o})},e.showConfirmation&&t(`Alerting/addSingleAlert`,{category:u.category,content:u.content},{root:!0}),t(`addImportedFilename`,o),e.enableZoomToExtend&&d.length&&t(`setFeatureExtents`,{features:d,fileName:o})},importGeoJSON({state:e,dispatch:t,rootGetters:n,commit:r},i){let a=i.layer,o=i.filename,s=kh(o,e.selectedFiletype,Dh),c=Mh(i.raw),l,u;if(s===!1){let e=o.split(`.`),n=e.length>0?`*.`+e[e.length-1]:`unknown`;l={category:`error`,content:i18next.t(`common:modules.fileImport.alertingMessages.missingFormat`,{format:n})},t(`Alerting/addSingleAlert`,l,{root:!0});return}try{u=s.readFeatures(i.raw,{dataProjection:c,featureProjection:n[`Maps/projectionCode`]})}catch(e){console.warn(e),l={category:`error`,content:i18next.t(`common:modules.fileImport.alertingMessages.formatError`,{filename:o})},t(`Alerting/addSingleAlert`,l,{root:!0});return}if(!Array.isArray(u)||u.length===0){l={category:`error`,content:i18next.t(`common:modules.fileImport.alertingMessages.missingFileContent`,{filename:o})},t(`Alerting/addSingleAlert`,l,{root:!0});return}a.setStyle(t=>{let n=t.getProperties()?.masterportal_attributes?.drawState,r=e.customAttributeStyles[o],i;
7if(!n&&!r){let e=[226,26,28,.9],n=[228,26,28,.5],r=t?t.getGeometry().getType():`cesium`;return r===`Point`||r===`MultiPoint`?i=Ip(e,e,r,16,1,1):r===`LineString`||r===`MultiLineString`?i=new T({stroke:new x({color:e,width:1})}):r===`Polygon`||r===`MultiPolygon`?i=new T({stroke:new x({color:e,width:1}),fill:new S({color:n})}):r===`Circle`?i=new T({stroke:new x({color:e,width:1}),fill:new S({color:n}),circleRadius:300,colorContour:e}):r===`Square`?i=new T({stroke:new x({color:e,width:1}),fill:new S({color:n})}):(console.warn(`Geometry type not implemented: `+r),i=new T),i.clone()}if(n?.drawType.geometry===`Point`)i=n.text?new T({image:new re({}),text:new we({text:n.text,font:n.fontSize+`px `+(n.font||`Arial,sans-serif`),fill:new S({color:n.color}),textAlign:n.textAlign||`left`,textBaseline:n.textBaseline||`bottom`})}):n?.symbol.value===`simple_point`?Ip(n?.color,n?.color,n?.drawType.geometry,n?.pointSize,1,n?.zIndex):new T({image:new xe({crossOrigin:`anonymous`,src:n.symbol.value.indexOf(`/`)>0?n.symbol.value:n.imgPath+n.symbol.value,scale:n.symbol.scale})});else if(n?.drawType.geometry===`LineString`||n?.drawType.geometry===`MultiLineString`)i=new T({stroke:new x({color:n.colorContour,width:n.strokeWidth})});else if(n?.drawType.geometry===`Polygon`||n?.drawType.geometry===`MultiPolygon`)i=new T({stroke:new x({color:n.colorContour,width:n.strokeWidth}),fill:new S({color:n.color})});else if(n?.drawType.geometry===`Circle`)i=new T({stroke:new x({color:n.colorContour,width:n.strokeWidth}),fill:new S({color:n.color}),circleRadius:n.circleRadius,circleOuterRadius:n.circleOuterRadius,colorContour:n.colorContour,outerColorContour:n.outerColorContour});else if(n?.drawType.geometry===`Square`)i=new T({stroke:new x({color:n.colorContour,width:n.strokeWidth}),fill:new S({color:n.color})});else if(!n&&r){let e=t?t.getGeometry().getType():`cesium`,n=t.get(r[0].attribute),a=r.find(e=>e.attributeValue===n||e.attributeValue===`none`).attributeColor,o=[169,159,163,.9];e===`Point`||e===`MultiPoint`?i=Ip(a,a,e,16,1,1):e===`LineString`||e===`MultiLineString`?i=new T({stroke:new x({color:a,width:2})}):e===`Polygon`||e===`MultiPolygon`?i=new T({stroke:new x({color:o,width:2}),fill:new S({color:a})}):e===`Circle`?i=new T({stroke:new x({color:o,width:2}),fill:new S({color:a}),circleRadius:300,colorContour:a}):e===`Square`&&(i=new T({stroke:new x({color:o,width:2}),fill:new S({color:a})})),t.set(`styleId`,n)}else console.warn(`Geometry type not implemented: `+n.drawType.geometry),i=new T;return i.clone()}),u.forEach(t=>{if(t.get(`fromDrawTool`)&&!t.get(`masterportal_attributes`)){let e={},n={};n.drawState=t.getProperties().drawState,n.invisibleStyle=t.getProperties().invisibleStyle,Object.keys(t.getProperties()).forEach(e=>{[`isOuterCircle`,`drawState`,`fromDrawTool`,`invisibleStyle`,`styleId`,`source`,`attributes`,`isVisible`,`isGeoCircle`,`geoCircleCenter`,`geoCircleRadius`,`isSquare`,`squareCoords`].indexOf(e)>=0&&(e!==`attributes`&&e!==`drawState`&&e!==`invisibleStyle`&&(n[e]=t.get(e)),t.unset(e))}),e.masterportal_attributes=n,t.setProperties(e)}if(q(t.getProperties())&&(Object.keys(t.getProperties()).forEach(t=>{t!==`geometry`&&t!==`isVisible`&&t!==`masterportal_attributes`&&(Object.prototype.hasOwnProperty.call(e.gfiAttributes,t)||r(`setGFIAttribute`,{key:t}))}),Object.prototype.hasOwnProperty.call(t.getProperties(),`masterportal_attributes`)?Object.prototype.hasOwnProperty.call(t.get(`masterportal_attributes`),`isVisible`)||(t.get(`masterportal_attributes`).isVisible=!0):t.set(`masterportal_attributes`,{isVisible:!0})),a.getStyleFunction()(t)!==void 0&&t.setStyle(a.getStyleFunction()(t)),q(t.get(`masterportal_attributes`))&&t.get(`masterportal_attributes`).isGeoCircle){let e=t.get(`masterportal_attributes`).geoCircleCenter.split(`,`).map(parseFloat),r=parseFloat(t.get(`masterportal_attributes`).geoCircleRadius);t.setGeometry(new ht(e,r)),t.getGeometry().transform(c,n[`Maps/projectionCode`])}if(t.get(`masterportal_attributes`).isSquare){let e=t.get(`masterportal_attributes`).squareCoords;t.setGeometry(new Xe([e]))}t.set(`source`,o),t.setId(e.geojsonFeatureId),r(`setGeojsonFeatureId`),a.getSource().addFeature(t)}),Object.keys(e.gfiAttributes).length>0&&(a.set(`gfiAttributes`,e.gfiAttributes),t(`replaceByIdInLayerConfig`,{layerConfigs:[{id:i.layerId||e.layerId,layer:e.gfiAttributes}]},{root:!0})),l={category:`success`,content:i18next.t(`common:modules.fileImport.alertingMessages.success`,{filename:o})},e.showConfirmation&&t(`Alerting/addSingleAlert`,l,{root:!0}),t(`addImportedFilename`,o),e.enableZoomToExtend&&u.length&&t(`setFeatureExtents`,{features:u,fileName:o})},addImportedFilename({state:e,commit:t},n){let r=[...e.importedFileNames];r.push(n),t(`setImportedFileNames`,r)},async addLayerConfig({dispatch:e,state:t,rootGetters:n},r){let i=t.layerId,a=`importDrawLayer`;if(t.useDifferentLayers&&r){let e=Oh(r),t=r.replace(/\.[^.]+$/,``);i=`importDrawLayer_${e}`,a=`importDrawLayer (${t})`}return W.getLayerById(i)?await e(`replaceByIdInLayerConfig`,{layerConfigs:[{id:i,layer:{visibility:!0,showInLayerTree:!0,zIndex:n.determineZIndex(i)}}]},{root:!0}):await e(`addLayerToLayerConfig`,{layerConfig:{id:i,name:a,showInLayerTree:!0,typ:`VECTORBASE`,type:`layer`,visibility:!0},parentKey:er},{root:!0}),{layer:W.getLayerById(i),layerId:i}},openDrawTool({state:e,dispatch:t,rootGetters:n}){let r=[`mainMenu`,`secondaryMenu`].includes(e.openDrawMenuSide)?e.openDrawMenuSide:`secondaryMenu`;t(`Menu/changeCurrentComponent`,{type:`draw_old`,side:r,props:{name:i18next.t(`common:modules.draw_old.name`)}},{root:!0}),n[`Menu/expanded`](r)||t(`Menu/toggleMenu`,r,{root:!0})}},Ih={...H(wh)},Lh={namespaced:!0,state:wh,mutations:{...U(wh),setGFIAttribute:(e,t)=>
7{e.gfiAttributes[t.key]=t.key},setCustomAttributeStyles:(e,t)=>{e.customAttributeStyles[t.filename]=t.customAttributeStyles},setGeojsonFeatureId:e=>{e.geojsonFeatureId+=1}},actions:Fh,getters:Ih},Rh={icon:`bi-funnel-fill`,id:`filter`,type:`filter`,description:`common:modules.filter.description`,name:`common:modules.filter.name`,menuSide:`mainMenu`,clearAll:!1,resetLayer:!1,multiLayerSelector:!0,collapseButtons:!1,liveZoomToFeatures:!0,geometrySelectorOptions:!1,minScale:5e3,saveTo:`void`,layers:[],layerGroups:[],layerConfigs:[],rulesOfFilters:[],serializedString:``,selectedAccordions:[],selectedGroups:[],showCurrentlyActiveFilters:!0,totalResults:{},triggerAllTagsDeleted:!1,onValueDeselect:null,deletedRuleFilterId:void 0,deletedRuleSnippetId:void 0,filtersHits:[],filterGeometry:!1,geometryFeature:void 0,jumpToId:void 0,hasMouseMapInteractions:!1,neededUrlParams:[`rulesOfFilters`,`selectedAccordions`,`selectedGroups`],urlParams:``,closeGfi:!1,preventAdjust:!1,linkText:``,questionLink:``,closeDropdownOnSelect:!0,shouldSubjectDataSelectedInTree:!1,searchInMapExtentState:{},filterOnMoveState:{}},zh={...H(Rh),urlParams:e=>e.urlParams},Bh={...U(Rh),addSpotForRule(e,t){e.rulesOfFilters[t.filterId]=[]},updateRules(e,t){e.rulesOfFilters[t.filterId]=t.rules},deleteFilter(e,t){e.rulesOfFilters[t.filterId]=[]},setAdditionalGeometries(e,t){e.geometrySelectorOptions.additionalGeometries=t.additionalGeometries},updateFilterHits(e,t){e.filtersHits[t.filterId]=t.hits},setSerializedString(e,t){e.serializedString=t.serializiedString},setRulesOfFilters(e,t){e.rulesOfFilters=t.rulesOfFilters}};function Vh(e){return!(typeof e!=`object`||!e||typeof e?.snippetId!=`number`||typeof e?.startup!=`boolean`||typeof e?.fixed!=`boolean`||typeof e?.attrName!=`string`&&!Array.isArray(e.attrName)||typeof e?.operator!=`string`)}function Hh(e){if(!e?.childElementCount)return Error(`The wfs response from the server is empty.`);let t=e;for(;typeof t==`object`&&t;){if(typeof t.getAttribute==`function`&&t.getAttribute(`exceptionCode`))return Error(typeof t?.textContent==`string`?t.textContent.trim():`unknown wfs error`);t=t.firstElementChild}}function Uh(e,t,n){let r=null;if(typeof e==`string`?q(t)?typeof t.version==`string`?typeof t.featureType!=`string`&&!Array.isArray(t.featureType)&&(r=Error(`api/wfs/getFeatureGET: FeatureType is ${t.featureType}. Payload has to have the featureType attribute and it has to be defined and a string or an array.`)):r=Error(`api/wfs/getFeatureGET: Version is ${t.version}. Payload has to have the version attribute and it has to be a string.`):r=Error(`api/wfs/getFeatureGET: Payload is ${t}. Payload has to be defined and an object (not null).`):r=Error(`api/wfs/getFeatureGET: Url is ${e}. Url has to be defined and a string.`),r instanceof Error){if(typeof n==`function`){n(r);return}throw r}let{featureType:i,version:a,propertyNames:o,bbox:s,srsName:c}=t;return B({url:e,method:`GET`,params:{service:`WFS`,request:`GetFeature`,version:a,typeName:Array.isArray(i)?i.join(`,`):i,typeNames:Array.isArray(i)?i.join(`,`):i,propertyName:o,propertyNames:o,bbox:s,srsName:c}}).then(e=>Gh(e,n)).catch(e=>fl(e,`api/wfs/getFeatureGET`,n))}function Wh(e,t,n){let r=null;if(typeof e==`string`?q(t)?Array.isArray(t.featureTypes)||(r=Error(`api/wfs/getFeaturePOST: FeatureTypes is ${t.featureTypes}. FeatureTypes has to be defined and an array.`)):r=Error(`api/wfs/getFeaturePOST: Payload is ${t}. Payload has to be defined and an object (not null).`):r=Error(`api/wfs/getFeaturePOST: Url is ${e}. Url has to be defined and a string.`),r instanceof Error){if(typeof n==`function`){n(r);return}throw r}let{featureTypes:i,srsName:a,featureNS:o,propertyNames:s,geometryName:c,bbox:l,filter:u}=t,d=new Ne().writeGetFeature({srsName:a,featureNS:o,featureTypes:i,propertyNames:s,geometryName:c,bbox:l,filter:u});return B({method:`POST`,headers:{"content-type":`text/xml`},data:new XMLSerializer().serializeToString(d),url:e}).then(e=>Gh(e,n)).catch(e=>fl(e,`api/wfs/getFeaturePOST`,n))}function Gh(e,t){let n=Hh(e?.request?.responseXML);if(n instanceof Error){if(typeof t==`function`){t(n);return}throw n}return e.data}var Kh={getFeatureGET:Uh,getFeaturePOST:Wh};async function qh(e){let t=[];if(!Array.isArray(e))return t;for(let n=0;n<e.length;n++){let r=jt.getLayerWhere({id:e[n].layerId}),i=[],a=null;r!==null&&(a=new Ne({version:r.version}),i=await Kh.getFeatureGET(r.url,{version:r.version,featureType:r.featureType}),t[n]=JSON.parse(JSON.stringify(e[n])),t[n].features=a.readFeatures(i))}return t}var Jh={setRulesArray:(e,{rulesOfFilters:t})=>{Array.isArray(t)&&e.commit(`setRulesOfFilters`,{rulesOfFilters:t})},updateRules:(e,{filterId:t,snippetId:n,rule:r})=>{if(typeof t!=`number`||typeof n!=`number`)return;let i;if(!Array.isArray(e.state.rulesOfFilters[t]))e.commit(`addSpotForRule`,{filterId:t}),i=[];else try{i=e.state.rulesOfFilters?.[t]===void 0?[]:JSON.parse(JSON.stringify(e.state.rulesOfFilters[t]))}catch(e){console.warn(`Cannot parse rules in action updateRules`,e);return}i[n]=r,e.commit(`updateRules`,{filterId:t,rules:i})},deleteAllRules:(e,{filterId:t})=>{if(typeof t!=`number`)return;let n;try{n=e.state.rulesOfFilters?.[t]===void 0?[]:JSON.parse(JSON.stringify(e.state.rulesOfFilters[t]))}catch(e){console.warn(`Cannot parse rules in action updateRules`,e);return}n.forEach((e,t)=>{Vh(e)&&e?.fixed||(n[t]=!1)}),e.commit(`updateRules`,{filterId:t,rules:n})},updateFilterHits:(e,{filterId:t,hits:n})=>{typeof t==`number`&&e.commit(`updateFilterHits`,{filterId:t,hits:n})},serializeState:e=>{let t=e.state.rulesOfFilters,n=e.state.selectedAccordions,r=e.state.selectedGroups,i=JSON.parse(JSON.stringify(e.state.geometrySelectorOptions)),a={rulesOfFilters:t,selectedAccordions:n,selectedGroups:r,geometryFeature:Yh(e.state.geometryFeature,i.invertGeometry),geometrySelectorOptions:i},o=``;Array.isArray(a.geometrySelectorOptions?.additionalGeometries)&&a.geometrySelectorOptions.additionalGeometries.forEac
7h(e=>delete e.features);try{o=JSON.stringify(a)}catch{o=``}e.commit(`setSerializedString`,{serializiedString:o})},deserializeState:async(e,t)=>{let n=t?.rulesOfFilters,r=t?.selectedAccordions,i=Array.isArray(t?.selectedGroups)?t.selectedGroups:[],a,o=[];Array.isArray(n)&&Array.isArray(r)&&(a=JSON.parse(JSON.stringify(t.rulesOfFilters)),n.forEach((e,t)=>{e===null&&(a[t]=void 0)}),e.dispatch(`setRulesArray`,{rulesOfFilters:a}),e.commit(`setSelectedAccordions`,r),e.commit(`setSelectedGroups`,i),e.dispatch(`setGeometryFilterByFeature`,{jsonFeature:t?.geometryFeature,invert:t?.geometrySelectorOptions?.invertGeometry}),t?.geometrySelectorOptions!==void 0&&e.commit(`setGeometrySelectorOptions`,t?.geometrySelectorOptions),t.geometrySelectorOptions&&(o=await qh(t.geometrySelectorOptions.additionalGeometries),e.commit(`setAdditionalGeometries`,{additionalGeometries:o})))},setGeometryFilterByFeature(e,{jsonFeature:t,invert:n}){if(!q(t)||Object.keys(t).length===0)return;let r;try{r=new dn().readFeature(t)}catch{e.dispatch(`Alerting/addSingleAlert`,i18next.t(`common:modules.filter.upload.geometryParseError`),{root:!0});return}let i=r.getGeometry(),a=new Xe([[[-1877994.66,3932281.56],[-1877994.66,9494203.2],[804418.76,9494203.2],[804418.76,3932281.56],[-1877994.66,3932281.56]],i.getCoordinates()[0]]);n&&q(r)&&typeof r.setGeometry==`function`&&r.setGeometry(a),e.commit(`setGeometryFeature`,r),e.commit(`setFilterGeometry`,i)},jumpToFilter(e,{filterId:t}){typeof t==`number`&&e.commit(`setJumpToId`,t)},urlParams({commit:e},t){e(`setUrlParams`,t)}};function Yh(e,t){if(typeof e?.getGeometry!=`function`)return{};let n=e.getGeometry().getCoordinates()[1],r=e.clone();return t&&r.setGeometry(new Xe([n])),JSON.parse(new dn().writeFeature(r))}var Xh={namespaced:!0,state:{...Rh},mutations:Bh,actions:Jh,getters:zh},Zh={centerMapToClickPoint:!1,clickCoordinates:[],coloredHighlighting3D:{},configPaths:[`portalConfig.map.getFeatureInfo`],currentFeature:null,gfiFeatures:[],hasMouseMapInteractions:!0,hideMapMarkerOnVectorHighlight:!1,highlightVectorRules:null,showPolygonMarkerForWMS:!1,icon:`bi-info-circle-fill`,menuSide:`secondaryMenu`,name:`common:modules.getFeatureInfo.name`,path:[],showMarker:!0,showPageNumber:!1,stickyHeader:!1,type:`getFeatureInfo`,visible:!1,globeEventHandler:null,lastPickedFeatureId:null,menuExpandedBeforeGfi:null};function Qh(e,t,n){let r=[];return t.forEach(t=>{let i=n(t);if(i)if(t.get(`typ`)===`VectorTile`&&t.get(`renderer`)===`webgl`){let n=e.getPixelFromCoordinate([i[0],i[3]]),a=e.getPixelFromCoordinate([i[2],i[1]]),o=[];for(let r=n[0];r<=a[0];r++)for(let i=n[1];i<=a[1];i++)e.forEachFeatureAtPixel([r,i],(e,n)=>{n===t&&!o.includes(e)&&o.push(e)},{layerFilter:e=>e===t});o.forEach(e=>{r.push(lh(t,``,e))})}else t.getSource()?.forEachFeatureIntersectingExtent(i,e=>{r.push(lh(t,``,e))})}),r}var $h={...H(Zh),gfiFeaturesAtPixel:()=>(e,t,n)=>{let i=[];if(e&&n===`2D`){mapCollection.getMap(`2D`).forEachFeatureAtPixel(e,(e,t)=>{t?.getVisible()&&t?.get(`gfiAttributes`)&&t?.get(`gfiAttributes`)!==`ignore`&&(e.getProperties().features?e.get(`features`).forEach(e=>{i.push(lh(t,``,e))}):i.push(lh(t,``,e)))},{layerFilter:e=>e.get(`renderer`)!==`WebGL`,hitTolerance:1});let n=mapCollection.getMap(`2D`),a=mapCollection.getMapView(`2D`).getResolution(),o=Qh(n,n.getLayers().getArray().filter(e=>e.get(`renderer`)===`webgl`),e=>tn(new r(t).getExtent(),(e.get(`hitTolerance`)||1)*Math.sqrt(a)));i.push(...o)}return n===`3D`&&mapCollection.getMap(`3D`).getCesiumScene().drillPick({x:e[0],y:e[1]}).forEach(e=>{if(e instanceof Cesium.Cesium3DTileFeature){let t=Sh.getGfiFeaturesByTileFeature(e);Array.isArray(t)&&t.forEach(e=>{i.push(e)})}else e?.primitive instanceof Cesium.Billboard&&e.primitive.olLayer?.get(`gfiAttributes`)&&e.primitive.olLayer?.get(`gfiAttributes`)!==`ignore`&&(i.find(t=>
7t.getLayerId()===e.primitive?.olLayer.get(`id`)&&t.getOlFeature().getId()===e.primitive?.olFeature.getId())||i.push(lh(e.primitive?.olLayer,``,e.primitive?.olFeature)))}),i},gfiFeaturesReverse:e=>e.gfiFeatures!==null&&Array.isArray(e.gfiFeatures)?e.gfiFeatures.slice().reverse():e.gfiFeatures,urlParams:e=>{let t=Object.assign({},e,{layerId:e.currentFeature?e.currentFeature.getLayerId():e.gfiFeatures[0].getLayerId()});return t.currentFeature=null,t.gfiFeatures=[],t}},eg={...U(Zh),removeGfiFeatureByLayerId(e,t){e.gfiFeatures.splice(e.gfiFeatures.findIndex(e=>e.getLayerId()===t),1)},setGlobeEventHandlerCheck(e,t){e.globeEventHandler!==t&&(e.globeEventHandler=t)},destroyGlobeEventHandler(e){e.globeEventHandler&&=(e.globeEventHandler.destroy(),null)}};function tg(e){let t=[];return e.forEach(e=>{e.get(`layers`)&&typeof e.get(`layers`).getArray==`function`?e.get(`layers`).getArray().forEach(e=>t.push(e)):t.push(e)}),t}function ng(e,t){return tg(mapCollection.getMap(`2D`).getLayers().getArray().filter(e=>e.getVisible())).filter(n=>n.get(`typ`)===`WMS`&&e<=n.get(`maxResolution`)&&e>=n.get(`minResolution`)&&t.find(e=>e.typ===`GROUP`?e.id.split(`-`).includes(n.get(`id`)):e.id===n.get(`id`)))}function rg(e,t=`RED`){let n=`color("${typeof t==`string`&&t.trim()!==``?t:`RED`}")`;if(e){let t=e;if(typeof t==`string`&&ig(t))n=`color('${t}')`;else if(Array.isArray(t)&&t.length===1&&typeof t[0]==`string`){let e=t[0].split(`,`).map(e=>parseFloat(e.trim()));if(e.length===4&&e.every(e=>!isNaN(e)&&e>=0&&e<=255)){let[t,r,i,a]=e.map((e,t)=>t===3?e<=1?e:(e/255).toFixed(2):e);n=`color('rgba(${t}, ${r}, ${i}, ${a})')`}else console.warn(`The color format in array is not valid. Expected format: ['R, G, B, A'] with values from 0 to 255.`)}else console.warn(`The color for the 3D highlighting is not valid. Ensure it follows one of the valid color formats.`)}return n}function ig(e){return/^[a-zA-Z]+$/.test(e)||/^rgba?\(\s*(\d{1,3}\s*,\s*){3}(\d(\.\d+)?)?\s*\)$/.test(e)||/^rgb\(\s*(\d{1,3}\s*,\s*){2}\d{1,3}\s*\)$/.test(e)||/^#([0-9A-Fa-f]{3}){1,2}$/.test(e)}function ag(e,t){let n=mapCollection.getMap(`3D`).getCesiumScene()._primitives._primitives.filter(e=>e instanceof Cesium.Cesium3DTileset);requestAnimationFrame(()=>{n.forEach(n=>{let r=n.style?._color?._conditions||[],i=[`\${id} === '${e}'`,t];r.some(([e])=>e===i[0])||(r.push(i),n.style=new Cesium.Cesium3DTileStyle({color:{conditions:r}}))})})}function og(e){let t=mapCollection.getMap(`3D`).getCesiumScene()._primitives._primitives.filter(e=>e instanceof Cesium.Cesium3DTileset);requestAnimationFrame(()=>{for(let n of t)if(n.style&&n.style._color&&n.style._color._conditions){let t=n.style._color._conditions.filter(t=>!t[0].includes(`\${id} === '${e}'`));n.style=new Cesium.Cesium3DTileStyle({color:{conditions:t}})}})}function sg(e){let t=mapCollection.getMap(`3D`).getCesiumScene(),n=j.transform(j.getMapProjection(mapCollection.getMap(`2D`)),`EPSG:4326`,e),r=Cesium.Cartesian3.fromDegrees(n[0],n[1],n[2]||0),i;return i=Cesium.SceneTransforms.worldToWindowCoordinates?Cesium.SceneTransforms.worldToWindowCoordinates(t,r):Cesium.SceneTransforms.wgs84ToWindowCoordinates(t,r),i?[Math.round(i.x),Math.round(i.y)]:null}var cg={coordToPixel3D:sg};async function lg(e,t){return new Promise(n=>{let r=e._primitives._primitives.filter(e=>e instanceof Cesium.Cesium3DTileset);for(let e of r)for(let r of e._selectedTiles){let e=r._content;if(e)for(let r=0;r<e.featuresLength;r++){let i=e.getFeature(r);if(i?.getProperty(`id`)===t){n(i);return}}}n(null)})}var ug={find3DPickedFeature:lg};function dg(e){return new Promise(t=>{let n=e.postRender.addEventListener(()=>{e.globe.tilesLoaded&&(n(),t())})})}async function fg(e,t,n=`RED`){return new Promise(r=>{async function i(){if(ag(t,rg(n,`RED`)),!(await ug.find3DPickedFeature(e,t))?.content?.tile?.boundingSphere){requestAnimationFrame(i);return}r()}i()})}function pg(e){return cg.coordToPixel3D(e)}var mg={highlight3DTile({getters:e,dispatch:t,commit:n}){n(`destroyGlobeEventHandler`);let r=mapCollection.getMap(`3D`).getCesiumScene(),i=rg(e.coloredHighlighting3D?.color,`RED`),a=new Cesium.ScreenSpaceEventHandler(r.canvas);n(`setGlobeEventHandlerCheck`,a),a.setInputAction(function(e){t(`Modules/SearchBar/removeHighlight3DTile`,``,{root:!0}),t(`removeHighlightColor`);let a=r.pick(e.position),o=a?.getProperty(`id`);a?(n(`setLastPickedFeatureId`,o),ag(o,i)):t(`removeHighlightColor`)},Cesium.ScreenSpaceEventType.LEFT_CLICK)},removeHighlight3DTile({dispatch:e,commit:t}){e(`removeHighlightColor`),t(`destroyGlobeEventHandler`)},removeHighlightColor({state:e,commit:t}){e.lastPickedFeatureId&&(og(e.lastPickedFeatureId),t(`setLastPickedFeatureId`,null))},collectGfiFeatures({getters:e,commit:t,dispatch:n,rootGetters:r}){let i=r[`Maps/clickCoordinate`],a=r[`Maps/resolution`],o=r[`Maps/projection`],s=e.gfiFeaturesAtPixel,c=ng(a,r.visibleSubjectDataLayerConfigs.concat(r.visibleBaselayerConfigs)).filter(e=>e.get(`gfiAttributes`)!==`ignore`);return i?(e.menuExpandedBeforeGfi===null&&t(`setMenuExpandedBeforeGfi`,r[`Menu/expanded`](e.menuSide)),Promise.allSettled(c.map(e=>{let t={INFO_FORMAT:e.get(`infoFormat`),FEATURE_COUNT:e.get(`featureCount`)},n=e.getSource().getFeatureInfoUrl(i,a,o,t);return!e.getSource().getParams?.()?.STYLES&&n.indexOf(`STYLES`)&&n.indexOf(`STYLES=&`)===-1&&(n=n.replace(/STYLES=.*?&/g,`STYLES=&`)),th(e,n)})).then(e=>
7{let t=[],r=e.filter((e,n)=>e.status===`rejected`?(console.error(e.reason),t.push(n),!1):!0);if(t.length){let e=t.reduce((e,t)=>`${e}<li>${c[t].get(`name`)}</li>`,``);n(`Alerting/addSingleAlert`,i18next.t(`common:modules.getFeatureInfo.errorMessageLayers`,{layers:e,interpolation:{escapeValue:!1}}),{root:!0})}return r.map(({value:e})=>e)}).then(n=>{let a=r[`Maps/clickPixel`],o=r[`Maps/mode`],c=s(a,i,o).concat(...n);if(c.sort((e,t)=>{let n=r.layerConfigById(e.getLayerId())?.zIndex||0,i=r.layerConfigById(t.getLayerId())?.zIndex||0;return n<i?-1:+(n>i)}),o===`3D`&&(c=c.reverse()),c.length>0)t(`setGfiFeatures`,c);else{if(t(`setGfiFeatures`,null),r[`Menu/currentComponent`](e.menuSide)?.type!==`getFeatureInfo`)return;t(`Menu/switchToPreviousComponent`,e.menuSide,{root:!0}),e.menuExpandedBeforeGfi||t(`Menu/setExpandedBySide`,{expanded:!1,side:e.menuSide},{root:!0}),t(`setMenuExpandedBeforeGfi`,null)}}).catch(e=>{e.message.includes(`The request is not allowed`)?console.warn(e):n(`Alerting/addSingleAlert`,i18next.t(`common:modules.getFeatureInfo.errorMessage`),{root:!0})})):(console.warn(`No click coordinate set for GetFeatureInfo.`),null)},restoreFromUrlParams({getters:e,dispatch:t,rootGetters:n},r){let i=ra.upperFirst(e.type),a=r.clickCoordinates,o=JSON.parse(n.urlParams.MAPS).mode;o===`2D`&&n.styleListLoaded?t(`handleRestore2D`,{attributes:r,componentName:i,clickCoordinates:a}):t(`waitAndRestore`,{attributes:r,componentName:i,clickCoordinates:a,mode:o})},waitAndRestore({dispatch:e},{attributes:t,componentName:n,clickCoordinates:r,mode:i}){i===`2D`?$.watch((e,t)=>t.styleListLoaded,i=>{i&&e(`handleRestore2D`,{attributes:t,componentName:n,clickCoordinates:r})}):$.watch((e,t)=>t[`Maps/mode`],i=>{i===`3D`&&e(`handleRestore3D`,{attributes:t,componentName:n,clickCoordinates:r})})},async handleRestore3D({dispatch:e,commit:t,rootGetters:n},{attributes:r,componentName:i,clickCoordinates:a}){if(n.visibleLayerConfigs.filter(e=>e.typ?.toUpperCase()===`TERRAIN3D`).length===0||!r.lastPickedFeatureId)return;let o=mapCollection.getMap(`3D`).getCesiumScene();await fg(o,r.lastPickedFeatureId,r.coloredHighlighting3D?.color);let s=pg(a);e(`restoreGFI`,{attributes:r,componentName:i,clickCoordinates:a,clickPixel:s}),await dg(o),s=pg(a),t(`Maps/setClickPixel`,s,{root:!0}),e(`Modules/GetFeatureInfo/collectGfiFeatures`,null,{root:!0})},handleRestore2D({dispatch:e},{attributes:t,componentName:n,clickCoordinates:r}){mapCollection.getMap(`2D`).once(`loadend`,function(){e(`restore2D`,{attributes:t,componentName:n,clickCoordinates:r})})},restore2D({dispatch:e},{attributes:t,componentName:n,clickCoordinates:r}){let i=mapCollection.getMap(`2D`).getPixelFromCoordinate([r[0],r[1]]),a=W.getLayerById(t.layerId),o=a.getLayerSource()instanceof Re?a.getLayerSource()?.getSource():a.getLayerSource();o instanceof Pe?o.getFeatures().length>0?e(`restoreGFI`,{attributes:t,componentName:n,clickCoordinates:r,clickPixel:i}):o.once(`featuresloadend`,()=>{e(`restoreGFI`,{attributes:t,componentName:n,clickCoordinates:r,clickPixel:i})}):e(`restoreGFI`,{attributes:t,componentName:n,clickCoordinates:r,clickPixel:i})},restoreGFI({getters:e,commit:t,dispatch:n},{attributes:r,componentName:i,clickCoordinates:a,clickPixel:o}){t(`Maps/setClickCoordinate`,a,{root:!0}),t(`Maps/setClickPixel`,o,{root:!0}),t(`setClickCoordinates`,a),n(`Modules/GetFeatureInfo/collectGfiFeatures`,null,{root:!0}),n(`Menu/activateCurrentComponent`,{currentComponent:{type:e.type},componentName:i,side:e.menuSide},{root:!0}),n(`Menu/updateComponentState`,{type:i,attributes:r},{root:!0})}},hg={namespaced:!0,state:{...Zh},getters:$h,mutations:eg,actions:mg},gg={active:!1,name:`Geometrie`,hasMouseMapInteractions:!0,displayName:`common:shared.modules.graphicalSelect.displayName`,snippetType:`graphicalSelect`,selectionElements:[`Dropdown`],geographicValues:[`Box`,`Circle`,`Polygon`,`Line`],currentValue:``,tooltipMessage:`common:shared.modules.graphicalSelect.tooltipMessage`,tooltipMessagePolygon:`common:shared.modules.graphicalSelect.tooltipMessagePolygon`,selectedAreaGeoJson:void 0,defaultSelection:``,bufferDistance:100,drawEndData:null},_g={...H(gg)},vg={...U(gg)},yg=new wn({id:`circle-overlay`,element:document.createElement(`div`),offset:[15,0],positioning:`center-left`}),bg=new wn({id:`tooltip-overlay`,element:document.createElement(`div`),offset:[15,20],positioning:`top-left`}),xg,Sg={circleOverlay:yg,tooltipOverlay:bg,drawInteraction:xg},Cg={createBufferFromLine:function({commit:e},{geometry:t,layer:n,bufferDistance:r=100,triggerEvent:i=!0}){try{let a=null,o=null,s=null,c=null,l=new dn().writeGeometry(t),u=new Ot().read(l);if(!u||u.isEmpty())throw Error(`Invalid or empty geometry`);if(a=Ee.bufferOp(u,r),o=new m,s=o.write(a),s.type===`MultiPolygon`){let e=s.coordinates[0][0],t=[];
7s.coordinates.forEach((e,n)=>{n===0?t.push(...e.slice(1)):t.push(...e)}),c=[e,...t]}else if(s.type===`Polygon`)c=s.coordinates;else throw Error(`Unexpected geometry type: ${s.type}`);if(c){let r=new V({geometry:new Xe(c)}),a={type:`Polygon`,coordinates:c},o=n.getSource(),s=new V({geometry:t.clone()});o.clear(),o.addFeature(s),o.addFeature(r),i&&(e(`setSelectedAreaGeoJson`,a),e(`setDrawEndData`,a))}}catch(e){console.error(`Error creating buffer:`,e)}},updateDrawInteractionListener:async function({dispatch:e,commit:t},n){n.interaction.on(`drawstart`,function(){e(`Alerting/cleanup`,``,{root:!0}),n.layer.getSource().clear()}),n.interaction.on(`drawend`,async function(r){let i=await e(`featureToGeoJson`,r.feature);n.vm.selectedOptionData!==`Line`&&(t(`setSelectedAreaGeoJson`,i),n.vm.$parent.$emit(`onDrawEnd`,i))})},featureToGeoJson:async function(e,t){let n=new dn,r=t.getGeometry();return r.getType()===`Circle`&&t.setGeometry(et(r)),n.writeGeometryObject(t.getGeometry())},showTooltipOverlay:function({state:e,rootState:t}){let n=t.Maps.mouseCoordinate,r=Sg.tooltipOverlay;e.currentValue===`Polygon`?r.element.innerHTML=i18next.t(e.tooltipMessagePolygon):r.element.innerHTML=i18next.t(e.tooltipMessage),r.setPosition(n)},toggleOverlay:function(e,t){t.type===`Circle`?mapCollection.getMap(`2D`).addOverlay(t.overlayCircle):mapCollection.getMap(`2D`).removeOverlay(t.overlayCircle),mapCollection.getMap(`2D`).addOverlay(t.overlayTool)},createDomOverlay:function(e,t){let n=document.createElement(`div`);n.id=t.id,t.overlay.element=n}},wg={namespaced:!0,state:{...gg},mutations:vg,getters:_g,actions:Cg},Tg={currentLocale:``,description:`common:modules.language.description`,type:`language`,supportedDevices:[`Desktop`,`Mobile`,`Table`],supportedMapModes:[`2D`,`3D`],icon:`bi-flag`,name:`common:modules.language.name`},Eg={changeLocale({commit:e},t){e(`setCurrentLocale`,t.language)}},Dg={...H(Tg)},Og={namespaced:!0,state:Tg,actions:Eg,getters:Dg,mutations:{...U(Tg)}},kg={toggleLayerVisibility({commit:e,dispatch:t,state:n}){n.layerIdList.forEach(e=>{t(`replaceByIdInLayerConfig`,{layerConfigs:[{id:e,layer:{visibility:n.isToggled}}]},{root:!0})}),e(`setIsToggled`,!n.isToggled)}},Ag={active:!1,description:`common:modules.layerClusterToggler.description`,icon:`bi-list`,name:`common:modules.layerClusterToggler.name`,type:`layerClusterToggler`,isToggled:!0,layerIdList:[]},jg={...H(Ag),layerNames:(e,t,n,r)=>{let i=[];return e.layerIdList.forEach(e=>{i.push(r.layerConfigById(e)?.name)}),i}},Mg={...U(Ag)},Ng={namespaced:!0,state:{...Ag},actions:kg,mutations:Mg,getters:jg},Pg={configPaths:[`portalConfig.map.layerPills`],supportedDevices:[`Desktop`,`Mobile`,`Table`],supportedMapModes:[`2D`,`3D`],visibleSubjectDataLayers:[],active:!1,hidden:!1,mobileOnly:!1,type:`layerPills`},Fg={...H(Pg)},Ig={namespaced:!0,state:Pg,mutations:{...U(Pg)},getters:Fg},Lg={center:{},zoomLevel:{},previewUrlByLayerIds:{}},Rg={...H(Lg),previewCenter:e=>t=>e.center[t],previewZoomLevel:e=>t=>e.zoomLevel[t]},zg={setPreviewCenter(e,{id:t,center:n}){e.center[t]=n},setPreviewZoomLevel(e,{id:t,zoomLevel:n}){e.zoomLevel[t]=n},addPreviewUrl(e,{id:t,previewUrl:n}){e.previewUrlByLayerIds[t]=n}},Bg={initialize:async function({commit:e,rootGetters:t},{id:n,center:r,zoomLevel:i}){let a=mapCollection.getMapView(`2D`).getResolutions(),o=r||t[`Maps/initialCenter`],s=typeof i==`number`?i:t[`Maps/initialZoom`];!Array.isArray(o)&&typeof o==`string`&&o.indexOf(`,`)>-1&&(o=[parseFloat(o.split(`,`)[0]),parseFloat(o.split(`,`)[1])]),a[s]===void 0&&(s=t[`Maps/initialZoom`],console.warn(`Unusable zoomLevel ${i} at layer with id:${n} configured, corrected to initialZoom ${s}`)),e(`setPreviewCenter`,{id:n,center:o}),e(`setPreviewZoomLevel`,{id:n,zoomLevel:s})}},Vg={namespaced:!0,state:{...Lg},mutations:zg,getters:Rg,actions:Bg},Hg={visible:!1,type:`layerSelection`,menuSide:`mainMenu`,name:`common:modules.layerSelection.addSubject`,subjectDataLayerConfs:[],baselayerConfs:[],lastFolderNames:[],lastSubjectDataLayerConfs:[],lastBaselayerConfs:[],layerInfoVisible:!1,highlightLayerId:null,encompassingBoundingBox:[1/0,1/0,-1/0,-1/0]},Ug={...U(Hg),clearLayerSelection(e){e.lastFolderNames=[],e.lastSubjectDataLayerConfs=[],e.lastBaselayerConfs=[]},reduceToPreviousLayerSelection(e){e.lastFolderNames.pop(),e.lastSubjectDataLayerConfs.pop(),e.lastBaselayerConfs.pop()},addToLayerSelection(e,{lastFolderName:t,subjectDataLayerConfs:n,baselayerConfs:r}){t!==``&&e.lastFolderNames.push(t),e.lastSubjectDataLayerConfs.push(n),e.lastBaselayerConfs.push(r)}}
7,Wg={...H(Hg),urlParams:e=>({lastFolderNames:e.lastFolderNames})};function Gg(e,t){let n=[],r=[],i=[];return Kg(e,t,n,r,i),{lastBaselayerConfs:n.reverse(),lastSubjectDataLayerConfs:i.reverse(),lastFolderNames:r.reverse()}}function Kg(e,t,n,r,i){if(e.parentId!==void 0){let a=t.folderById(e.parentId);n.push([]),r.push(a.name),i.push(Al(a.elements,e=>e.type!==`folder`)),Kg(a,t,n,r,i)}else n.push(t.allBaselayerConfigs),r.push(`root`),i.push(Al(t.allLayerConfigsStructured(er),e=>e.type!==`folder`))}var qg={collectDataByFolder:Gg},Jg={namespaced:!0,state:Hg,mutations:Ug,getters:Wg,actions:{changeVisibility({dispatch:e,rootGetters:t},{layerId:n,value:r}){let i=[],a={id:n,layer:{id:n,visibility:r,showInLayerTree:r}},o=-1;if(i.push(a),r===!0){if(t.isBaselayer(n)){let n=Math.max(...t.layerConfigsByAttributes({baselayer:!0,showInLayerTree:r}).map(e=>e.zIndex));e(`updateLayerConfigZIndex`,{layerContainer:t.layerConfigsByAttributes({showInLayerTree:!0}),maxZIndex:n},{root:!0}),o=n+1,Zl.checkAndAdd(t.singleBaselayer,t.visibleBaselayerConfigs,i)}else o=t.determineZIndex(n);a.layer.zIndex=o}e(`replaceByIdInLayerConfig`,{layerConfigs:i},{root:!0})},setNavigationByFolder({commit:e,rootGetters:t},{folder:n}){let r=qg.collectDataByFolder(n,t);e(`setLastFolderNames`,r.lastFolderNames),e(`setLastBaselayerConfs`,r.lastBaselayerConfs),e(`setLastSubjectDataLayerConfs`,r.lastSubjectDataLayerConfs)},navigateForward({commit:e},{lastFolderName:t,subjectDataLayerConfs:n,baselayerConfs:r=[]}){e(`addToLayerSelection`,{lastFolderName:t,subjectDataLayerConfs:n,baselayerConfs:r}),e(`setBaselayerConfs`,r),e(`setSubjectDataLayerConfs`,n)},navigateBack({commit:e,getters:t}){e(`reduceToPreviousLayerSelection`),e(`setSubjectDataLayerConfs`,t.lastSubjectDataLayerConfs[t.lastSubjectDataLayerConfs.length-1]),e(`setBaselayerConfs`,t.lastBaselayerConfs[t.lastBaselayerConfs.length-1])},reset({commit:e}){e(`clearLayerSelection`),e(`setSubjectDataLayerConfs`,[]),e(`setBaselayerConfs`,[])},showLayer:({commit:e,dispatch:t,rootGetters:n},{layerId:r})=>{let i=n.layerConfigById(r);if(i||=n.folderById(r),i){let a=``,o,s,c=null;i.parentId?(c=n.folderById(i.parentId),c?(a=c.name,o=Al(c.elements,e=>e.type!==`folder`),s=[],t(`setNavigationByFolder`,{folder:c})):console.warn(`Folder with id `,i.parentId,` not found. Shall be parent of `,i)):(o=Al(n.allLayerConfigsStructured(er),e=>e.type!==`folder`),s=n.allBaselayerConfigs),o&&(t(`navigateForward`,{lastFolderName:a,subjectDataLayerConfs:o,baselayerConfs:s}),e(`setHighlightLayerId`,r),e(`Modules/SearchBar/setShowAllResults`,!1,{root:!0}),e(`setVisible`,!0))}},restoreFromUrlParams({dispatch:e,rootGetters:t},n){t.styleListLoaded?e(`Modules/LayerSelection/restoreLayerSelection`,n.lastFolderNames,{root:!0}):$.watch((e,t)=>t.styleListLoaded,t=>{t&&e(`Modules/LayerSelection/restoreLayerSelection`,n.lastFolderNames,{root:!0})})},restoreLayerSelection({getters:e,dispatch:t,commit:n,rootGetters:r},i){let a=r.allLayerConfigsStructured,o=a($n),s=Al(a(er),e=>e.type!==`folder`),c;if(t(`Modules/LayerSelection/navigateForward`,{lastFolderName:`root`,subjectDataLayerConfs:s,baselayerConfs:o},{root:!0}),i&&Array.isArray(i)){for(let e of i)if(e!==`root`)if(c=s.find(t=>t.name===e&&t.type===`folder`),c)s=Al(c.elements,e=>e.type!==`folder`),t(`Modules/LayerSelection/navigateForward`,{lastFolderName:c.name,subjectDataLayerConfs:s,baselayerConfs:[]},{root:!0});else break}n(`setVisible`,!0),t(`Menu/changeCurrentComponent`,{type:e.type,side:e.menuSide,props:{name:e.name}},{root:!0})}}},Yg={description:`common:modules.layerSlider.description`,icon:`bi-collection-play`,layerIds:[],name:`common:modules.layerSlider.name`,timeInterval:2e3,title:`common:modules.layerSlider.title`,type:`layerSlider`,activeLayer:{layerId:``,index:-1},currentProgressBarWidth:`width: 0%; margin-left: 0%`,progressBarWidth:0,windowsInterval:null,sliderMax:``,sliderMin:`0`,sliderTicks:``},Xg={...H(Yg)},Zg={...U(Yg),setActiveLayer(e,t){e.currentProgressBarWidth=`width: ${e.progressBarWidth}%; margin-left: ${e.progressBarWidth*t.index}%`,e.activeLayer=t},setProgressBarWidth(e,t){e.progressBarWidth=100/t.length},setWindowsInterval(e,t){t===null?(clearInterval(e.windowsInterval),e.windowsInterval=null):e.windowsInterval=setInterval(t,e.timeInterval)},resetActiveLayer(e){e.currentProgressBarWidth=`width: 0%; margin-left: 0%`,e.activeLayer={layerId:``,index:-1}}},Qg={addInformationToLayerIds:({commit:e,rootGetters:t},n)=>{e(`setLayerIds`,n.map((e,n)=>{let r=W.getLayerById(e.layerId);return e.index=n,e.visibility=r?r.layer.getVisible():t.allLayerConfigs.find(({id:t})=>t===e.layerId)?.visibility??!1,e.transparency=r?Math.floor(100-r.layer.getOpacity()*100):t.allLayerConfigs.find(({id:t})=>t===e.layerId)?.transparency??0,e}))},checkIfAllLayersAvailable:({commit:e,rootGetters:t},n)=>{e(`setLayerIds`,n.filter(e=>{let n=e.layerId;return t.allLayerConfigs.some(e=>e.id.includes(n))?!0:(console.warn(`The configuration of the module layerSlider is
7invalid. The layer with the id: "${n}" must be configured in the "layerConfig".`),!1)}))},sendModification:({dispatch:e},{layerId:t,visibility:n,transparency:r})=>{e(`replaceByIdInLayerConfig`,{layerConfigs:[{id:t,layer:{visibility:n,transparency:r||0}}]},{root:!0})},setActiveIndex:({commit:e,dispatch:t,state:n},r)=>{e(`setActiveLayer`,n.layerIds[r]),t(`toggleLayerVisibility`,n.activeLayer.layerId)},toggleLayerVisibility:({dispatch:e,state:t},n)=>{t.layerIds.forEach(t=>{e(`sendModification`,{layerId:t.layerId,visibility:t.layerId===n})})}},$g={namespaced:!0,state:{...Yg},mutations:Zg,actions:Qg,getters:Xg},e_={active:!1,currentTimeSliderObject:null,isMoving:!1,swiper:null,sourceLayerId:null,targetLayerId:null,valueX:null,valueY:null,splitDirection:`vertical`},t_={...H(e_)},n_={...U(e_),setLayerSwiperActive(e,t){e.active=t},setLayerSwiperDomSwiper(e,t){e.swiper=t},setLayerSwiperValueX(e,t){e.valueX=t},setLayerSwiperValueY(e,t){e.valueY=t},setLayerSwiperStyleLeft(e,t){e.swiper.style.left=t+`px`},setLayerSwiperStyleTop(e,t){e.swiper.style.top=t+`px`},setSplitDirection(e,t){e.splitDirection=t}};function r_(e,t,n,r){let i=t;if(e.type===`pointermove`?i=r===`horizontal`?e.pageX:e.pageY:e.type===`keydown`&&(r===`horizontal`?e.key===`ArrowLeft`?i-=n:e.key===`ArrowRight`&&(i+=n):e.key===`ArrowUp`?i-=n:e.key===`ArrowDown`&&(i+=n)),r===`horizontal`){if(i<0)return 0;if(i>window.innerWidth)return window.innerWidth}else{if(i<0)return 0;if(i>window.innerHeight)return window.innerHeight}return i}var i_={moveSwiper({state:e,commit:t,dispatch:n},r){let i;e.splitDirection===`horizontal`?(i=r_(r,e.valueY,e.currentTimeSliderObject.keyboardMovement,`vertical`),t(`setLayerSwiperValueY`,i),t(`setLayerSwiperStyleTop`,i)):(i=r_(r,e.valueX,e.currentTimeSliderObject.keyboardMovement,`horizontal`),t(`setLayerSwiperValueX`,i),t(`setLayerSwiperStyleLeft`,i)),n(`updateMap`)},async updateMap({state:e,rootGetters:t,dispatch:n}){let r=W.getLayerById(e.targetLayerId),i=W.getLayerById(e.sourceLayerId);t[`Modules/WmsTime/TimeSlider/playing`]||await mapCollection.getMap(t[`Maps/mode`]).render(),r&&!r?._onPrerenderListener&&!r?._onPostrenderListener&&(r._onPrerenderListener=e=>{n(`drawLayer`,e)},r._onPostrenderListener=({context:e})=>{e.restore()},r.getLayer().on(`prerender`,r._onPrerenderListener),r.getLayer().on(`postrender`,r._onPostrenderListener)),i&&!i?._onPrerenderListener&&!i?._onPostrenderListener&&(i._onPrerenderListener=e=>{n(`drawLayer`,e)},i._onPostrenderListener=({context:e})=>{e.restore()},i.getLayer().on(`prerender`,i._onPrerenderListener),i.getLayer().on(`postrender`,i._onPostrenderListener))},drawLayer({state:e,rootGetters:t},n){if(!e.sourceLayerId&&!e.targetLayerId)return;let{context:r}=n,i=mapCollection.getMap(t[`Maps/mode`]).getSize(),a=n.target.get(`id`).endsWith(t[`Modules/WmsTime/layerAppendix`]);r.save(),r.beginPath(),e.splitDirection===`horizontal`?a?(r.moveTo(...Je(n,[0,e.valueY])),r.lineTo(...Je(n,[i[0],e.valueY])),r.lineTo(...Je(n,[i[0],i[1]])),r.lineTo(...Je(n,[0,i[1]]))):(r.moveTo(...Je(n,[0,0])),r.lineTo(...Je(n,[i[0],0])),r.lineTo(...Je(n,[i[0],e.valueY])),r.lineTo(...Je(n,[0,e.valueY]))):e.splitDirection===`vertical`&&(a?(r.moveTo(...Je(n,[e.valueX,0])),r.lineTo(...Je(n,[i[0],0])),r.lineTo(...Je(n,[i[0],i[1]])),r.lineTo(...Je(n,[e.valueX,i[1]]))):(r.moveTo(...Je(n,[0,0])),r.lineTo(...Je(n,[e.valueX,0])),r.lineTo(...Je(n,[e.valueX,i[1]])),r.lineTo(...Je(n,[0,i[1]])))),r.closePath(),r.clip()}},a_={namespaced:!0,state:{...e_},mutations:n_,getters:t_,actions:i_},o_={menuSide:`mainMenu`,type:`layerTree`,delay:`500`,delayOnTouchOnly:!0,removeOnSpill:!0,touchStartThreshold:3},s_={namespaced:!0,state:o_,actions:{removeLayer({dispatch:e},t){e(`replaceByIdInLayerConfig`,{...t,showInLayerTree:!1,visibility:!1,zIndex:null}),e(`updateAllZIndexes`,null,{root:!0})},updateTransparency({dispatch:e},{layerConf:t,transparency:n}){e(`replaceByIdInLayerConfig`,{...t,transparency:n})},replaceByIdInLayerConfig({dispatch:e},t){e(`replaceByIdInLayerConfig`,{layerConfigs:[{layer:t,id:t.id}]},{root:!0})}},getters:{...H(o_),layerTreeSortedLayerConfigs:(e,t,n,r)=>e=>{let t;return t=r.showLayerAddButton?r.layerConfigsByAttributes({showInLayerTree:!0}):r.allLayerConfigs,t=[...t],qn.sortObjects(t,`zIndex`,`desc`),e&&t.some(e=>`layerSequence`in e)&&qn.sortByLayerSequence(t),t}},mutations:{...U(o_)}},c_={type:`legend`,icon:`bi-lightbulb`,hasMouseMapInteractions:!1,description:`common:modules.legend.description`,name:`common:modules.legend.name`,supportedDevices:[`Desktop`,`Mobile`,`Table`],supportedMapModes:[`2D`,`3D`],sldVersion:``,legends:[],layerInfoLegend:{},preparedLegend:null},l_={...U(c_)},u_={...H(c_),isLayerInLegend:e=>t=>e.legends.filter(e=>e.id===t).length>0,isLegendChanged:e=>t=>{let n=!1,r=e.legends.filter(e=>e.id===t.id)[0];return encodeURIComponent(JSON.stringify(r))!==encodeURIComponent(JSON.stringify(t))&&(n=!0),n}
7,urlParams:e=>{let t=[...e.legends],n=[];return t.forEach(e=>{let t={...e};if(Array.isArray(t.legend)){let e=[];t.legend.forEach(t=>{let n;n=Kc(t)?encodeURIComponent(t.slice()):{...t},e.push(n)}),t.legend=e,n.push(t)}}),{legends:n,type:e.type,name:e.name,icon:e.icon,sldVersion:e.sldVersion}}},d_={isValidLegendObj:e=>{let t=e.legend,n=e.position,r=!0;return n<0&&(r=!1),(typeof t==`boolean`||!t)&&(r=!1),Array.isArray(t)&&t.length===0&&(r=!1),r}};function f_(e,t=`rgba`){let n=[];switch(n=p_(e)?e.concat([1]):g_(e)?e:m_(e)?[e.r,e.g,e.b,1]:h_(e)?[e.r,e.g,e.b,e.a]:__(e)?C_(e):v_(e)?w_(e):y_(e)?JSON.parse(e).concat([1]):b_(e)?JSON.parse(e):x_(e)?T_(e):S_(e)?E_(e):[0,0,0,1],t){case`rgb`:return n.slice(0,3);case`rgba`:return n;case`hex`:return D_(n);case`hexa`:return O_(n);case`rgbArrayString`:return k_(n);case`rgbaArrayString`:return A_(n);case`rgbString`:return j_(n);case`rgbaString`:return M_(n);default:}return n}function p_(e){return!Array.isArray(e)||e.length!==3||isNaN(parseInt(e[0],10))||parseInt(e[0],10)<0||parseInt(e[0],10)>255||isNaN(parseInt(e[1],10))||parseInt(e[1],10)<0||parseInt(e[1],10)>255?!1:!(isNaN(parseInt(e[2],10))||parseInt(e[2],10)<0||parseInt(e[2],10)>255)}function m_(e){return typeof e==`object`&&!!e&&typeof e.r==`number`&&e.r>=0&&e.r<=255&&typeof e.g==`number`&&e.g>=0&&e.g<=255&&typeof e.b==`number`&&e.b>=0&&e.b<=255&&e.a===void 0}function h_(e){return typeof e==`object`&&!!e&&typeof e.r==`number`&&e.r>=0&&e.r<=255&&typeof e.g==`number`&&e.g>=0&&e.g<=255&&typeof e.b==`number`&&e.b>=0&&e.b<=255&&typeof e.a==`number`&&e.a>=0&&e.a<=1}function g_(e){return!Array.isArray(e)||e.length!==4?!1:p_(e.slice(0,3))?!(isNaN(parseFloat(e[3]))||parseFloat(e[3])<0||parseFloat(e[3])>1):!1}function __(e){return typeof e==`string`?e.indexOf(`#`)!==0||e.length!==4&&e.length!==7?!1:/^[a-f\d]*$/i.test(e.substring(1)):!1}function v_(e){return typeof e==`string`&&!!Object.prototype.hasOwnProperty.call(F_(),e.toLowerCase())}function y_(e){if(typeof e!=`string`)return!1;try{return p_(JSON.parse(e))}catch{return!1}}function b_(e){if(typeof e!=`string`)return!1;try{return g_(JSON.parse(e))}catch{return!1}}function x_(e){if(typeof e!=`string`||e.indexOf(`rgb(`)!==0||e.indexOf(`)`)!==e.length-1)return!1;let t=e.substring(4,e.length-1).split(`,`);try{return p_(t)}catch{return!1}}function S_(e){if(typeof e!=`string`||e.indexOf(`rgba(`)!==0||e.indexOf(`)`)!==e.length-1)return!1;let t=e.substring(5,e.length-1).split(`,`);try{return g_(t)}catch{return!1}}function C_(e){let t;if(e.length===4)t=e.substring(1).split(``).map(e=>e.padStart(2,e));else if(e.length===7)t=e.substring(1).match(/.{2}/g);else return[0,0,0,1];return t.map(e=>parseInt(e,16)).concat([1])}function w_(e){return F_()[e.toLowerCase()]}function T_(e){let t=e.substring(4,e.length-1).split(`,`);return t[0]=parseInt(t[0],10),t[1]=parseInt(t[1],10),t[2]=parseInt(t[2],10),t[3]=1,t}function E_(e){let t=e.substring(5,e.length-1).split(`,`);return t[0]=parseInt(t[0],10),t[1]=parseInt(t[1],10),t[2]=parseInt(t[2],10),t[3]=parseFloat(t[3]),t}function D_(e){return`#`+parseInt(e[0],10).toString(16).padStart(2,`0`)+parseInt(e[1],10).toString(16).padStart(2,`0`)+parseInt(e[2],10).toString(16).padStart(2,`0`)}function O_(e){let t=Math.round(e[3]*100)/100,n=(Math.round(t*255)+0).toString(16).substring(-2);return`#`+parseInt(e[0],10).toString(16).padStart(2,`0`)+parseInt(e[1],10).toString(16).padStart(2,`0`)+parseInt(e[2],10).toString(16).padStart(2,`0`)+n}function k_(e){return`[`+String(e[0])+`, `+String(e[1])+`, `+String(e[2])+`]`}function A_(e){return`[`+String(e[0])+`, `+String(e[1])+`, `+String(e[2])+`, `+String(e[3])+`]`}function j_(e){return`rgb(`+String(e[0])+`, `+String(e[1])+`, `+String(e[2])+`)`}function M_(e){return`rgba(`+String(e[0])+`, `+String(e[1])+`, `+String(e[2])+`, `+String(e[3])+`)`}function N_(e){if(!__(e))return console.warn(`The color to convert from hex to hsl is not a hex value`),!1;let t=parseInt(e.slice(1,3),16)/255,n=parseInt(e.slice(3,5),16)/255,r=parseInt(e.slice(5,7),16)/255,i=Math.max(t,n,r),a=Math.min(t,n,r),o=(i+a)/2,s,c;if(i===a)s=c=0;else{let e=i-a;switch(c=o>.5?e/(2-i-a):e/(i+a),i){case t:s=(n-r)/e+(n<r?6:0);break;case n:s=(r-t)/e+2;break;case r:s=(t-n)/e+4;break}s/=6}return{h:s*360,s:c*100,l:o*100}}function P_(e,t,n){if(typeof e!=`number`||typeof t!=`number`||typeof n!=`number`)return!1;let r=n/100,i=t*Math.min(r,1-r)/100;function a(t){let n=(t+e/30)%12,a=r-i*Math.max(Math.min(n-3,9-n,1),-1);return Math.round(255*a).toString(16).padStart(2,`0`)}return`#${a(0)}${a(8)}${a(4)}`}function F_(){return{aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgrey:[169,169,169,1],darkgreen:[0,100,0,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],grey:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgrey:[211,211,211,1],lightgreen:[144,238,144,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]}}var I_={drawIntervalStyle(e){let t=e.scalingShape,n=[];return t===`CIRCLE_BAR`&&(n=this.drawIntervalCircleBars(e)),n},drawNominalStyle(e){let t=e.attributes.scalingShape.toLowerCase(),n=[];return t===`circlesegments`&&(n=this.drawNominalCircleSegments(e)),n},drawNominalCircleSegments(e){let t=e.attributes.scalingAttribute,n=e.attributes.scalingValues,r=[];
7return Object.keys(n).forEach(n=>{let i=e.attributes.imageScale,a,o,s,c,l,u;if(Array.isArray(e.style)){let d=new V;if(d.set(t,n),u=Nt(d,e.attributes),a=ct(u,5).getImage().getSrc(),o=e.style[0].getImage().getSize(),!o)return;s=e.style[1].getImage().getSrc(),c=[Math.round(o[0]*1.04),Math.round(o[1]*1.04)],l=[c[0]*i,c[1]*i],r.push({name:n,graphic:[a,s],iconSize:l,iconSizeDifferenz:Math.abs((c[0]*i-o[0])/2)})}else r.push({name:n,graphic:e.style.getImage().getSrc()})}),r},drawIntervalCircleBars(e){return e.clone().getStyle().getImage().getSrc()},drawCircleStyle(e){let t=e.circleStrokeColor?f_(e.circleStrokeColor,`rgbString`):`black`,n=e.circleStrokeColor[3]||0,r=e.circleStrokeWidth,i=e.circleFillColor?f_(e.circleFillColor,`rgbString`):`black`,a=e.circleFillColor[3]||0,o=e.circleRadius,s=(o+1.5)*2,c=`data:image/svg+xml;charset=utf-8,`;return c+=`<svg height='`+s+`' width='`+s+`' version='1.1' xmlns='http://www.w3.org/2000/svg'>`,c+=`<circle cx='`+s/2+`' cy='`+s/2+`' r='`+o+`' stroke='`,c+=t,c+=`' stroke-opacity='`,c+=n,c+=`' stroke-width='`,c+=r,c+=`' fill='`,c+=i,c+=`' fill-opacity='`,c+=a,c+=`'/>`,c+=`</svg>`,c},prepareLegendForLineString(e,t){let n=t.lineStrokeColor?f_(t.lineStrokeColor,`rgbString`):`black`,r=t.lineStrokeWidth,i=t.lineStrokeColor[3]||0,a=t.lineStrokeDash?t.lineStrokeDash.join(` `):void 0;if((t.type?t.type.toLowerCase():t.attributes?.type.toLowerCase())===`icon`)e.graphic=t.imagePath+t.imageName;else{let t=`data:image/svg+xml;charset=utf-8,`;t+=`<svg height='35' width='35' version='1.1' xmlns='http://www.w3.org/2000/svg'>`,t+=`<path d='M 05 30 L 30 05' stroke='`,t+=n,t+=`' stroke-opacity='`,t+=i,t+=`' stroke-width='`,t+=r,a&&(t+=`' stroke-dasharray='`,t+=a),t+=`' fill='none'/>`,t+=`</svg>`,e.graphic=t}return e},prepareLegendForPolygon(e,t){let n=t.polygonFillColor?f_(t.polygonFillColor,`rgbString`):`black`,r=t.polygonStrokeColor?f_(t.polygonStrokeColor,`rgbString`):`black`,i=t.polygonStrokeWidth,a=t.polygonFillColor?.[3]||0,o=t.polygonFillHatch,s=t.polygonStrokeColor?.[3]||0,c=t.polygonStrokeCap||`round`,l=t.polygonStrokeDash?.toString()||``,u=t.type?t.type.toLowerCase():t.attributes?.type.toLowerCase();if(o)e.graphic=un.prototype.getPolygonFillHatchLegendDataUrl(t);else if(u===`icon`)e.graphic=t.imagePath+t.imageName;else{let t=`data:image/svg+xml;charset=utf-8,`;t+=`<svg height='35' width='35' version='1.1' xmlns='http://www.w3.org/2000/svg'>`,t+=`<polygon points='5,5 30,5 30,30 5,30' style='fill:`,t+=n,t+=`;fill-opacity:`,t+=a,t+=`;stroke:`,t+=r,t+=`;stroke-opacity:`,t+=s,t+=`;stroke-width:`,t+=i,t+=`;stroke-linecap:`,t+=c,t+=`;stroke-dasharray:`,t+=l,t+=`;'/>`,t+=`</svg>`,e.graphic=t}return e},prepareLegendForCesium(e,t){let n=t.style?t.style.color:`black`,r=`data:image/svg+xml;charset=utf-8,`;return r+=`<svg height='35' width='35' version='1.1' xmlns='http://www.w3.org/2000/svg'>`,r+=`<polygon points='5,5 30,5 30,30 5,30' style='fill:`,r+=n,r+=`;fill-opacity:`,r+=1,r+=`;stroke:`,r+=n,r+=`;stroke-opacity:`,r+=1,r+=`;stroke-width:`,r+=1,r+=`;'/>`,r+=`</svg>`,e.graphic=r,e},prepareNameForCesium(e){let t=e.conditions,n=``;return t&&Object.keys(t).forEach(t=>{let r=e.conditions[t];n+=r}),n},prepareLegendForPoint(e,t){let n=t.imagePath,r=t.type?t.type.toLowerCase():t.attributes.type.toLowerCase(),i=t.imageName,a=e;return t.imageScale!==null&&t.imageScale!==void 0&&(a.imageScale=t.imageScale),r===`icon`?i.startsWith(`https:`)?a.graphic=i:i.startsWith(`<svg`)?a.graphic=`data:image/svg+xml;charset=utf-8,`+encodeURIComponent(i):a.graphic=n+i:r===`circle`?a.graphic=this.drawCircleStyle(t):r===`interval`?a.graphic=this.drawIntervalStyle(t):r===`nominal`&&(a=this.drawNominalStyle(t)),a},prepare(e,t,n){let r={name:n};if(e===`Point`)r=this.prepareLegendForPoint(r,t);else if(e===`LineString`)r=this.prepareLegendForLineString(r,t);else if(e===`Polygon`)if(t?.polygonImage){let e=structuredClone(t);e.type=`icon`,e.imageName=t?.polygonImage,e.imagePath||=Config.wfsImgPath,r=this.prepareLegendForPoint(r,e)}else r=this.prepareLegendForPolygon(r,t);else e===`cesium`&&(r.name=this.prepareNameForCesium(t),r=this.prepareLegendForCesium(r,t));return r}},L_={getLayerHolder:()=>{let e=[];
7return W.getLayers().forEach(t=>{t.get(`typ`)===`GROUP`?t.get(`baselayer`)?(t.attributes.name&&(t.getLayerSource()[0].attributes.name=t.attributes.name),e.push({layer:t.getLayerSource()[0],visibility:t.get(`visibility`)})):t.getLayerSource().forEach(n=>{e.push({layer:n,visibility:t.get(`visibility`)})}):e.push({layer:t,visibility:t.get(`visibility`)})}),e}},R_={namespaced:!0,state:c_,actions:{createLegend({dispatch:e}){L_.getLayerHolder().forEach(t=>{let{layer:n,visibility:r}=t;e(`toggleLayerInLegend`,{layer:n,visibility:r})})},addLegend({state:e,commit:t},n){let r=e.legends;r.find(e=>e.name===n.name)||(r.push(n),t(`setLegends`,r))},sortLegend({state:e,commit:t}){let n={};W.getLayers().forEach(e=>{if(e.get(`typ`)===`GROUP`){let t=e.attributes.zIndex;e.getLayerSource().forEach(e=>{n[e.attributes.id]=t})}}),t(`setLegends`,e.legends.sort(function(e,t){return(t.position??=n[t.id]||0)-(e.position??=n[e.id]||0)}))},removeLegend({state:e,commit:t},n){t(`setLegends`,e.legends.filter(e=>e.id!==n))},async toggleLayerInLegend({dispatch:e},{layer:t,visibility:n}){let r=t.get(`id`),i=t.get(`typ`);n===!1?e(`removeLegend`,r):(i===`GROUP`?e(`prepareLegendForGroupLayer`,t.getLayerSource()):e(`prepareLegend`,await t.createLegend()),e(`generateLegend`,t))},generateLegend({dispatch:e,getters:t},n){let r=n.get(`id`),i=typeof n.getLayer().getZIndex==`function`?n.getLayer().getZIndex():0,a={id:r,name:n.get(`name`),legend:t.preparedLegend,position:i},o=d_.isValidLegendObj(a),s=o&&!t.isLayerInLegend(r),c=o&&!s&&t.isLegendChanged(a);s?e(`addLegend`,a):c&&(e(`removeLegend`,r),e(`addLegend`,a)),e(`sortLegend`)},async createLegendForLayerInfo({dispatch:e},t){let n=W.getLayerById(t);n?e(`generateLegendForLayerInfo`,n):(await e(`changeLayerVisibility`,{layerId:t,visibility:!0}),n=W.getLayerById(t),await e(`generateLegendForLayerInfo`,n),e(`changeLayerVisibility`,{layerId:t,visibility:!1}))},async changeLayerVisibility({dispatch:e},{layerId:t,visibility:n}){await e(`replaceByIdInLayerConfig`,{layerConfigs:[{id:t,layer:{loadingStrategy:`all`,visibility:n}}]},{root:!0})},async generateLegendForLayerInfo({commit:e,dispatch:t},n){let r=null;if(n){let i=null;i=n.get(`typ`)===`GROUP`?t(`prepareLegendForGroupLayer`,n.getLayerSource()):t(`prepareLegend`,await n.createLegend()),r={id:n.get(`id`),name:n.get(`name`),legend:await i,position:typeof n.getLayer().getZIndex==`function`?n.getLayer().getZIndex():0},d_.isValidLegendObj(r)&&e(`setLayerInfoLegend`,r)}},prepareLegend({commit:e},t){let n=[];return Array.isArray(t)&&t.every(e=>typeof e==`string`)&&t.length>0?n=t:Array.isArray(t)&&t.forEach(e=>{let t=e.geometryType,r=e.label,i=e.styleObject,a={name:r};t?a=I_.prepare(t,i,r):e?.name&&e?.graphic&&(a=e),Array.isArray(a)?a.forEach(e=>{n.push(e)}):n.push(a)}),e(`setPreparedLegend`,n),n},async prepareLegendForGroupLayer({commit:e,dispatch:t},n){let r=[];for(let e=0;e<n.length;e++){let i=n[e],a=await t(`prepareLegend`,await i.createLegend());r.push(a)}return e(`setPreparedLegend`,r),r}},mutations:l_,getters:u_},z_={icon:`bi-door-open`,description:`common:modules.login.description`,hasMouseMapInteractions:!1,name:`common:modules.login.login`,supportedDevices:[`Desktop`,`Mobile`,`Table`],supportedMapModes:[`2D`,`3D`],type:`login`,active:!1,loggedIn:!1,username:void 0,screenName:void 0,email:void 0,accessToken:void 0,refreshToken:void 0,iconLogin:`bi-door-open`,iconLogout:`bi-door-closed`,iconLogged:`bi-person-circle`},B_={namespaced:!0,state:z_,mutations:{...U(z_)},getters:{...H(z_)},actions:{async setUpTokenRefreshInterval({dispatch:e}){await e(`checkLoggedIn`),setInterval(()=>{e(`checkLoggedIn`)},1e4)},async getAuthCodeUrl(){let e=Config?.login?.oidcAuthorizationEndpoint||`oidcAuthorizationEndpoint_not_defined_in_config.js`,t=Config?.login?.oidcClientId||`oidcClientId_not_defined_in_config.js`,n=Config?.login?.oidcRedirectUri||`oidcRedirectUri_not_defined_in_config.js`,r=Config?.login?.oidcScope||`oidcScope_not_defined_in_config.js`;return await ff.getAuthCodeUrl(e,t,n,r)},logout({commit:e}){let t=Rd.get(`token`),n=Rd.get(`refresh_token`),r=Config?.login?.oidcClientId,i=Config?.login?.oidcRevocationEndpoint;
7ff.eraseCookies(),e(`setLoggedIn`,!1),e(`setAccessToken`,void 0),e(`setRefreshToken`,void 0),e(`setScreenName`,void 0),e(`setUsername`,void 0),e(`setEmail`,void 0),i&&t&&ff.revokeToken(i,r,t),i&&n&&ff.revokeToken(i,r,n)},async checkLoggedIn({commit:e,dispatch:t}){let n=Config.login,r=Rd.get(`token`),i=Rd.get(`refresh_token`),a=!!r;return e(`setIcon`,a?`bi-door-closed`:`bi-door-open`),e(`setName`,a?`common:modules.login.logout`:`common:modules.login.login`),e(`setAccessToken`,r),e(`setRefreshToken`,i),ff.getTokenExpiry(r)<1?(await t(`logout`),!1):(await ff.renewTokenIfNecessary(r,i,n),e(`setLoggedIn`,a),e(`setScreenName`,Rd.get(`name`)),e(`setUsername`,Rd.get(`username`)),e(`setEmail`,Rd.get(`email`)),a)}}},V_=new Pe,H_={description:`common:modules.measure.description`,name:`common:modules.measure.name`,hasMouseMapInteractions:!0,icon:`bi-arrows-angle-expand`,supportedDevices:[`Desktop`,`Mobile`,`Table`],supportedMapModes:[`2D`,`3D`],type:`measure`,earthRadius:6378137,measurementAccuracy:`meter`,lines:{},polygons:{},geometryValues:[`LineString`,`Polygon`],lineStringUnits:[`m`,`km`],polygonUnits:[`m²`,`km²`],selectedGeometry:`LineString`,selectedLineStringUnit:`0`,selectedPolygonUnit:`0`,unlisteners:[],isDrawing:!1,enableUndoRedo:!1,customNames:{},color:[255,127,0,1],interaction:null,source:V_,layer:null,featureId:null,tooltipCoord:[],featureHistories:{},currentSketch:null,drawingPointHistory:[],currentlyModifyingFeatureId:null,selectedEditInteraction:null,currentSelectInteractions:[],currentModifyInteraction:null,geometryUpdateTrigger:0};function U_(e,t){let n=wt.language||`de`;return e.toLocaleString(n,{minimumFractionDigits:t,maximumFractionDigits:t})}function W_(e,t,n,r,i,a){return Object.keys(t).reduce((o,s)=>{let c=t[s],l=vt(c.getGeometry(),{projection:e,radius:n}),u=a[i];if(l.toFixed(0)===`0`)o[s]=`0`;else if(u===`m`)o[s]=r===`decimeter`||r===`dynamic`&&l<10?`${U_(l,1)} m`:`${U_(l,0)} m`;else if(u===`km`)o[s]=`${U_(l/1e3,1)} km`;else if(u===`nm`){let e=l/1852;o[s]=r===`decimeter`||r===`dynamic`&&e<10?`${U_(e,1)} nm`:`${U_(e,0)} nm`}return o},{})}function G_(e,t,n,r,i,a){return Object.keys(t).reduce((o,s)=>{let c=t[s],l=Bt(c.getGeometry(),{projection:e,radius:n}),u=a[i];if(l.toFixed(0)===`0`)o[s]=`0`;else if(u===`m²`)o[s]=r===`decimeter`||r===`dynamic`&&l<10?`${U_(l,1)} m²`:`${U_(l,0)} m²`;else if(u===`ha`){let e=l/1e4;o[s]=r===`decimeter`||r===`dynamic`&&e<10?`${U_(e,1)} ha`:`${U_(e,0)} ha`}else u===`km²`&&(o[s]=`${U_(l/1e6,1)} km²`);return o},{})}function K_(e,t,n,r){let i=vt(e,{projection:t}),a=n[r];return a===`m`?`${U_(i,+(i<10))} m`:a===`km`?`${U_(i/1e3,1)} km`:a===`nm`?`${U_(i/1852,1)} nm`:``}function q_(e,t,n,r){let i=Bt(e,{projection:t}),a=n[r];return a===`m²`?`${U_(i,+(i<10))} m²`:a===`ha`?`${U_(i/1e4,2)} ha`:a===`km²`?`${U_(i/1e6,2)} km²`:``}function J_(e,t,n,r,i,a,o){return t===`LineString`?K_(e,n,r,i):t===`Polygon`?q_(e,n,a,o):``}function Y_(e){return typeof e==`string`?parseInt(e,10):e}function X_(e){return!e||!Array.isArray(e)?e:typeof structuredClone==`function`?structuredClone(e):JSON.parse(JSON.stringify(e))}function Z_(e,t){if(!e||!t||!Array.isArray(e)||!Array.isArray(t)||e.length<=t.length)return null;for(let n=0;n<e.length;n++)if(n>=t.length||e[n][0]!==t[n][0]||e[n][1]!==t[n][1])return e[n];return null}function Q_(e){if(!e)return!1;let t=e.getGeometry();if(!t)return!1;let n=t.getType();return n===`LineString`?t.getCoordinates().length>=2:n!==`Polygon`||(t.getCoordinates()[0]||[]).length>=4}function $_(e,t,n){let r=e[Y_(t)];if(r&&r.undo.length>0)return!0;if(!n)return!1;let i=n.getGeometry(),a=i.getType();return a===`LineString`?i.getCoordinates().length>1:a===`Polygon`&&(i.getCoordinates()[0]||[]).length>3}function ev(e,t){let n=e[Y_(t)];return!!(n&&n.redo.length>0)}function tv(e){let t=e.getGeometry(),n=t.getType(),r;if(n===`LineString`?r=t.getCoordinates():n===`Polygon`&&(r=t.getCoordinates()[0].slice(0,-1)),!r||r.length<=2)return[];let i=[];for(let e=2;e<r.length;e++)i.push({mode:`addPoint`,timestamp:Date.now(),data:{point:r[e],pointIndex:e,geometryType:n}});return i}function nv(e){let t=e.getGeometry(),n=t.getType();if(n===`LineString`){let e=t.getCoordinates();return e.length<=1?null:{mode:`addPoint`,timestamp:Date.now(),data:{point:e[e.length-1],pointIndex:e.length-1,geometryType:n}}}if(n===`Polygon`){let e=t.getCoordinates()[0];return e.length<=3?null:{mode:`addPoint`,timestamp:Date.now(),data:{point:e[e.length-2],pointIndex:e.length-2,geometryType:n}}}return null}var rv={...H(H_),currentUnits({selectedGeometry:e,lineStringUnits:t,polygonUnits:n}){return e===`LineString`?t:n},lineLengths(e,t,n,r){let{lines:i,earthRadius:a,measurementAccuracy:o,selectedLineStringUnit:s,lineStringUnits:c}=e;return e.geometryUpdateTrigger,W_(r[`Maps/projection`].getCode(),i,a,o,s,c)},polygonAreas(e,t,n,r){let{polygons:i,earthRadius:a,measurementAccuracy:o,selectedPolygonUnit:s,polygonUnits:c}=e;return e.geometryUpdateTrigger,G_(r[`Maps/projection`].getCode(),i,a,o,s,c)}
7,urlParams:e=>{let t={selectedGeometry:e.selectedGeometry,selectedLineStringUnit:e.selectedLineStringUnit,selectedPolygonUnit:e.selectedPolygonUnit};return JSON.stringify(t)},measurementList:({lines:e,polygons:t,customNames:n},r)=>{let i=[];return Object.keys(e).forEach(e=>{i.push({id:e,type:`LineString`,displayValue:r.lineLengths[e]||``,customName:n[e]||null})}),Object.keys(t).forEach(e=>{i.push({id:e,type:`Polygon`,displayValue:r.polygonAreas[e]||``,customName:n[e]||null})}),i},getFeatureById(e){return e.geometryUpdateTrigger,e=>{let t=Y_(e);return V_.getFeatures().find(e=>e.get(`featureId`)===void 0&&Y_(e.ol_uid)===t)}},filteredMeasurementList(e,t){e.geometryUpdateTrigger;let n=e.currentSketch?Y_(e.currentSketch.ol_uid):null;return t.measurementList.filter(e=>!n||Y_(e.id)!==n).filter(e=>Q_(t.getFeatureById(e.id)))},enrichedMeasurementList(e,t){return e.geometryUpdateTrigger,t.filteredMeasurementList.map(n=>({...n,canUndo:$_(e.featureHistories,n.id,t.getFeatureById(n.id)),canRedo:ev(e.featureHistories,n.id)}))},activeMeasurementInfo(e,t,n,r){if(e.geometryUpdateTrigger,!e.currentSketch)return null;let i=e.currentSketch.getGeometry();if(!i)return null;let a=i.getType();return{type:a,displayValue:J_(i,a,r[`Maps/projection`].getCode(),e.lineStringUnits,e.selectedLineStringUnit,e.polygonUnits,e.selectedPolygonUnit)}},canUndoCurrentSketch(e){if(e.geometryUpdateTrigger,!e.currentSketch)return!1;let t=e.currentSketch.getGeometry();return t?(t.getType()===`LineString`?t.getCoordinates():t.getCoordinates()[0]).length>0:!1},canRedoCurrentSketch(e){return e.currentSketch!==null&&e.drawingPointHistory.length>0}},iv={...U(H_),addFeature(e,t){let n=(t.getGeometry?t.getGeometry().getType():e.selectedGeometry)===`LineString`?`lines`:`polygons`;e[n]={...e[n],[t.ol_uid]:t}},removeFeature(e,t){let n=String(t);if(e.lines[n]){let t={...e.lines};delete t[n],e.lines=t}if(e.polygons[n]){let t={...e.polygons};delete t[n],e.polygons=t}if(e.customNames[n]){let t={...e.customNames};delete t[n],e.customNames=t}},setCustomName(e,t){let n=String(t.featureId);e.customNames={...e.customNames,[n]:t.name}},addUnlistener(e,t){e.unlisteners=[...e.unlisteners,t]},initFeatureHistory(e,t){e.featureHistories[t]||(e.featureHistories={...e.featureHistories,[t]:{undo:[],redo:[]}})},removeFeatureHistory(e,t){let n={...e.featureHistories};delete n[t],e.featureHistories=n},clearAllFeatureHistories(e){e.featureHistories={}},pushUndoEntry(e,{normalizedId:t,entry:n}){let r=e.featureHistories[t];r&&(r.undo=[...r.undo,n])},popUndoEntry(e,t){let n=e.featureHistories[t];n&&n.undo.length>0&&(n.undo=n.undo.slice(0,-1))},pushRedoEntry(e,{normalizedId:t,entry:n}){let r=e.featureHistories[t];r&&(r.redo=[...r.redo,n])},popRedoEntry(e,t){let n=e.featureHistories[t];n&&n.redo.length>0&&(n.redo=n.redo.slice(0,-1))},clearRedoForFeature(e,t){let n=e.featureHistories[t];n&&(n.redo=[])},incrementGeometryUpdateTrigger(e){e.geometryUpdateTrigger++}};function av(e){return[new T({fill:new S({color:e.with(3,.3)}),stroke:new x({color:e,width:2}),image:new re({radius:6,stroke:new x({color:e,width:3}),fill:new S({color:e.with(3,.4)})})}),new T({image:new re({radius:6,stroke:new x({color:e,width:3}),fill:new S({color:e.with(3,.4)})}),geometry:function(e){let t=e.getGeometry(),n=[];return n.push(t.getFirstCoordinate()),n.push(t.getLastCoordinate()),new l(n)}}),new T({image:new re({radius:2,stroke:new x({color:e,width:3}),fill:new S({color:e.with(3,.4)})}),geometry:function(e){let t=e.getGeometry(),n=[];
7return t instanceof sn?(t.getCoordinates().forEach(function(e,r){r>0&&r<t.getCoordinates().length-1&&n.push(e)}),n.length===1?new sn([]):new sn(n)):t instanceof Xe?(t.getCoordinates()[0].forEach(function(e,r){r>0&&r<t.getCoordinates()[0].length-1&&n.push(e)}),new Xe([n])):new l(n)}})]}var ov=0;function sv({state:e},t,n,r,a,o){let s=new i({source:V_,type:t,style:av(e.color)}),c=null,l=null;return s.on(`drawstart`,function(e){c=e.feature,c.set(`isBeingDrawn`,!0),n(c),a(c.ol_uid),l=c.getGeometry().getType()===`Polygon`?({target:e})=>{let t=e.getCoordinates()[0];n(c),o(t[t.length-2])}:({target:e})=>{n(c),o(e.getLastCoordinate())},c.getGeometry().on(`change`,l),r(!0)}),s.on(`drawend`,function(){c.getGeometry().un(`change`,l),c.set(`isBeingDrawn`,!1),c.set(`styleId`,`__measureStyle_draw_${ov++}`),c=null,l=null,r(!1)}),s}var cv=[],lv={x:0,y:0,z:0},uv=null;function dv(e=``,t={}){if(!(typeof e!=`string`||typeof t!=`object`))return{origin:`measure`,position:t,label:{text:e,style:Cesium.LabelStyle.FILL_AND_OUTLINE,eyeOffset:{x:0,y:0,z:-5},scaleByDistance:new Cesium.NearFarScalar(1,1,5e3,.05),disableDepthTestDistance:1/0}}}function fv(e={},t=[]){if(!(!(e instanceof Object)||!Array.isArray(t)))return{origin:`measure`,polyline:{positions:t,width:3,material:new Cesium.ColorMaterialProperty(e)}}}function pv(e,t){let n,r,i;try{n=Cesium.Cartographic.fromCartesian(e),r=Cesium.Cartographic.fromRadians(n.longitude,n.latitude,n.height+t),i=Cesium.Cartographic.toCartesian(r)}catch{throw Error(`GetPositionAboveError`)}return i}function mv(){let e=mapCollection.getMap(`3D`).getCesiumScene(),t=mapCollection.getMap(`3D`).getDataSourceDisplay().defaultDataSource.entities,n=e.globe.ellipsoid.cartesianToCartographic(lv)??new Cesium.Cartographic,r=n.height-e.globe.getHeight(n),i=dv(wt.t(`common:modules.measure.height3d`)+`: 8`+U_(r,1)+`m`,lv),a,o=null;try{a=pv(lv,5)}catch(e){console.warn(e);return}if(o=fv(Cesium.Color.GREEN,[lv,a]),t.add(o),t.add(i),uv){let e=Cesium.Cartesian3.distance(uv,lv),n=new Cesium.Cartesian3,r=fv(Cesium.Color.BLUE,[lv,uv]),i=null;Cesium.Cartesian3.midpoint(uv,lv,n),i=dv(wt.t(`common:modules.measure.distance3d`)+`: 9`+U_(e,1)+`m`,n),t.add(r),t.add(i),uv=null}else uv=lv}function hv(e){let t=mapCollection.getMap(`3D`).getCesiumScene(),n={},r=null;try{n.x=e.endPosition.x,n.y=e.endPosition.y,t.globe.depthTestAgainstTerrain=!0,lv=t.pickPosition(n)??new Cesium.Cartesian3,r=pv(lv,5)}catch{return}cv=[lv,r]}function gv(e){let t=fv(Cesium.Color.RED,[]);t.id=`floating`,t.polyline.positions=new Cesium.CallbackProperty(()=>cv,!1),e?.add?.(t)}function _v(){let e=mapCollection.getMap(`3D`).getCesiumScene(),t=mapCollection.getMap(`3D`).getDataSourceDisplay().defaultDataSource.entities,n=new Cesium.ScreenSpaceEventHandler(e.canvas);return!e||!t||!n?{abortDrawing:()=>void 0,stopInteraction:()=>void 0,interaction3d:!0}:(gv(t),n.setInputAction(hv,Cesium.ScreenSpaceEventType.MOUSE_MOVE),n.setInputAction(mv,Cesium.ScreenSpaceEventType.LEFT_CLICK),{abortDrawing:()=>{t.values.filter(e=>e.origin===`measure`).forEach(e=>{t.remove(e)}),gv(t)},stopInteraction:()=>{n.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE),n.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK),t.remove(t.getById(`floating`))},interaction3d:!0})}var vv={cleanupAllInteractions({state:e,commit:t,dispatch:n}){e.interaction&&n(`removeDrawInteraction`),e.currentModifyInteraction&&(n(`Maps/removeInteraction`,e.currentModifyInteraction,{root:!0}),t(`setCurrentModifyInteraction`,null)),e.currentSelectInteractions.forEach(e=>{n(`Maps/removeInteraction`,e,{root:!0})}),t(`setCurrentSelectInteractions`,[]),t(`setSelectedEditInteraction`,null),t(`setCurrentlyModifyingFeatureId`,null)},setInteractionMode({commit:e,dispatch:t},{mode:n,featureId:r=null}){t(`cleanupAllInteractions`),n===`DRAW`?(e(`setSelectedEditInteraction`,``),t(`createDrawInteraction`)):n===`MODIFY`?(e(`setSelectedEditInteraction`,`modify`),e(`setCurrentlyModifyingFeatureId`,r),t(`setupModifyInteraction`,r)):n===`DELETE`?(e(`setSelectedEditInteraction`,`delete`),t(`setupDeleteInteraction`)):n===`IDLE`&&e(`setSelectedEditInteraction`,``)},setupDeleteInteraction({state:e,commit:t,dispatch:n}){let r=Ht.createSelectInteraction(e.layer),i=[r,Ht.createSelectInteraction(e.layer,Ve)],a=r.on(`select`,e=>{if(e.selected.length>0){let r=e.selected[0].ol_uid;n(`deleteSingleFeature`,r),t(`removeFeatureHistory`,Y_(r)),n(`setInteractionMode`,{mode:`DRAW`}),f(a)}});Ht.removeSelectedFeature(r,V_),t(`setCurrentSelectInteractions`,i),i.forEac
9h(e=>n(`Maps/addInteraction`,e,{root:!0}))},setupModifyInteraction({state:e,commit:t,dispatch:n,getters:r},i=null){e.currentModifyInteraction&&(n(`Maps/removeInteraction`,e.currentModifyInteraction,{root:!0}),t(`setCurrentModifyInteraction`,null));let a,o=new Map;if(i){let e=r.getFeatureById(i);if(!e)return;a=new je({features:new Le([e])})}else a=en.createModifyInteraction(V_);a.on(`modifystart`,e=>{e.features.forEach(e=>{n(`capturePreModifyCoords`,e);let r=e.getGeometry(),i=()=>{n(`updateTooltipPositionForFeature`,e),t(`incrementGeometryUpdateTrigger`)};r.on(`change`,i),o.set(e.ol_uid,{geometry:r,changeListener:i})})}),a.on(`modifyend`,e=>{e.features.forEach(e=>{let n=o.get(e.ol_uid);n&&(n.geometry.un(`change`,n.changeListener),o.delete(e.ol_uid));let r=e.getGeometry(),i=r.getType(),a=e.get(`_beforeModifyCoords`),s;if(i===`LineString`?s=r.getCoordinates():i===`Polygon`&&(s=r.getCoordinates()[0]),a&&s){let n=Y_(e.ol_uid);t(`initFeatureHistory`,n),t(`pushUndoEntry`,{normalizedId:n,entry:{mode:`modifyCoordinates`,timestamp:Date.now(),data:{previousCoordinates:a,newCoordinates:X_(s),geometryType:i}}}),t(`clearRedoForFeature`,n)}t(`addFeature`,e),e.unset(`_beforeModifyCoords`)}),e.mapBrowserEvent&&e.mapBrowserEvent.stopPropagation()}),t(`setCurrentModifyInteraction`,a),n(`Maps/addInteraction`,a,{root:!0})},removeIncompleteDrawing({state:e}){let t=e.lines[e.featureId]||e.polygons[e.featureId];if(t&&t.get(`isBeingDrawn`)){let t=e.layer.getSource();t.getFeatures().length>0&&t.removeFeature(t.getFeatures().slice(-1)[0])}},handleModifyMeasurement({state:e,dispatch:t},n){let r=Y_(n),i=e.currentlyModifyingFeatureId?Y_(e.currentlyModifyingFeatureId):null;e.selectedEditInteraction===`modify`&&i===r?(t(`unhighlightFeature`,n),t(`setInteractionMode`,{mode:`DRAW`})):t(`setInteractionMode`,{mode:`MODIFY`,featureId:n})},handleDeleteMeasurement({state:e,commit:t,dispatch:n},r){n(`deleteSingleFeature`,r),t(`removeFeatureHistory`,Y_(r)),e.selectedEditInteraction===`modify`&&n(`setInteractionMode`,{mode:`DRAW`})},highlightFeature({getters:e},t){let n=e.getFeatureById(t);n&&!n.get(`_isHighlighted`)&&(n.set(`_originalStyle`,n.getStyle()),n.set(`_isHighlighted`,!0),n.setStyle(av([0,89,255,1])))},unhighlightFeature({state:e,getters:t},n){let r=t.getFeatureById(n);if(r&&r.get(`_isHighlighted`)){let t=r.get(`_originalStyle`);r.setStyle(t||av(e.color)),r.unset(`_originalStyle`),r.unset(`_isHighlighted`)}}},yv={undoPointOnFeature({commit:e,dispatch:t},{feature:n,historyEntry:r}){let{geometryType:i,pointIndex:a}=r.data,o=n.getGeometry(),s=n.ol_uid;if(i===`LineString`){let e=o.getCoordinates();if(e.length>1&&a>=0&&a<e.length){if(e.splice(a,1),e.length===1){t(`deleteSingleFeature`,s);return}o.setCoordinates(e)}else return}else if(i===`Polygon`){let e=o.getCoordinates()[0];if(e.length>3&&a>=0&&a<e.length-1){if(e.splice(a,1),e.length<4){t(`deleteSingleFeature`,s);return}o.setCoordinates([e])}else{t(`deleteSingleFeature`,s);return}}e(`addFeature`,n),t(`updateTooltipPositionForFeature`,n)},redoPointOnFeature({commit:e,dispatch:t},{feature:n,historyEntry:r}){let{point:i,geometryType:a}=r.data,o=n.getGeometry();if(a===`LineString`){let e=o.getCoordinates();e.push(i),o.setCoordinates(e)}else if(a===`Polygon`){let e=o.getCoordinates()[0];e.splice(e.length-1,0,i),o.setCoordinates([e])}e(`addFeature`,n),t(`updateTooltipPositionForFeature`,n)},undoModifyCoordinates({commit:e,dispatch:t},{feature:n,historyEntry:r}){let{previousCoordinates:i,geometryType:a}=r.data,o=n.getGeometry();a===`LineString`?o.setCoordinates(i):a===`Polygon`&&o.setCoordinates([i]),e(`addFeature`,n),t(`updateTooltipPositionForFeature`,n)},redoModifyCoordinates({commit:e,dispatch:t},{feature:n,historyEntry:r}){let{newCoordinates:i,geometryType:a}=r.data,o=n.getGeometry();a===`LineString`?o.setCoordinates(i):a===`Polygon`&&o.setCoordinates([i]),e(`addFeature`,n),t(`updateTooltipPositionForFeature`,n)},capturePreModifyCoords(e,t){let n=t.getGeometry(),r=n.getType(),i;r===`LineString`?i=n.getCoordinates():r===`Polygon`&&(i=n.getCoordinates()[0]);try{t.set(`_beforeModifyCoords`,X_(i))}
9catch(e){console.warn(`measureUndoRedo: deepCloneCoords failed, using reference copy.`,e),t.set(`_beforeModifyCoords`,i)}},regulateDeleteAll({commit:e,dispatch:t}){t(`cleanupAllInteractions`),e(`clearAllFeatureHistories`),e(`setCurrentSketch`,null),e(`setDrawingPointHistory`,[]),t(`deleteFeatures`),t(`createDrawInteraction`)},syncFeatureHistories({commit:e},t){t.forEach(t=>{e(`initFeatureHistory`,Y_(t.id))})},regulateUndo({state:e,commit:t,dispatch:n,getters:r},i){if(e.currentSketch&&Y_(e.currentSketch.ol_uid)===Y_(i)){n(`undoLastPointInSketch`);return}let a=Y_(i),o=e.featureHistories[a],s=r.getFeatureById(i);if(!s)return;if(!o||o.undo.length===0){n(`undoInitialPoint`,{feature:s,normalizedId:a});return}let c=o.undo[o.undo.length-1];t(`popUndoEntry`,a),c.mode===`addPoint`?n(`undoPointOnFeature`,{feature:s,historyEntry:c}):c.mode===`modifyCoordinates`&&n(`undoModifyCoordinates`,{feature:s,historyEntry:c}),t(`pushRedoEntry`,{normalizedId:a,entry:c})},undoInitialPoint({commit:e,dispatch:t},{feature:n,normalizedId:r}){let i=nv(n);i&&(e(`initFeatureHistory`,r),t(`undoPointOnFeature`,{feature:n,historyEntry:i}),e(`pushRedoEntry`,{normalizedId:r,entry:i}))},regulateRedo({state:e,commit:t,dispatch:n,getters:r},i){if(e.currentSketch&&Y_(e.currentSketch.ol_uid)===Y_(i)){n(`redoLastPointInSketch`);return}let a=Y_(i),o=e.featureHistories[a],s=r.getFeatureById(i);if(!s||!o||o.redo.length===0)return;let c=o.redo[o.redo.length-1];t(`popRedoEntry`,a),c.mode===`addPoint`?n(`redoPointOnFeature`,{feature:s,historyEntry:c}):c.mode===`modifyCoordinates`&&n(`redoModifyCoordinates`,{feature:s,historyEntry:c}),t(`pushUndoEntry`,{normalizedId:a,entry:c})},undoLastPointInSketch({state:e,commit:t,dispatch:n}){if(!e.currentSketch||!e.interaction)return;let r=e.currentSketch.getGeometry();if(!r)return;let i=r.getType(),a=i===`LineString`?r.getCoordinates():r.getCoordinates()[0],o=i===`LineString`?1:2;if(a.length<=o){t(`setDrawingPointHistory`,[...e.drawingPointHistory,{type:`point`,coord:a[0]}]),n(`abortCurrentDrawing`);return}try{e.interaction.removeLastPoint();let o=i===`LineString`?r.getCoordinates():r.getCoordinates()[0],s=i===`LineString`?2:3;if(o.length<=s){let r=[...e.drawingPointHistory];o.forEach(e=>r.push({type:`point`,coord:e})),t(`setDrawingPointHistory`,r),n(`abortCurrentDrawing`);return}let c=Z_(a,o);c&&t(`setDrawingPointHistory`,[...e.drawingPointHistory,{type:`point`,coord:c}])}catch(e){console.warn(`measureUndoRedo: removeLastPoint failed.`,e)}},redoLastPointInSketch({state:e,commit:t}){if(!e.currentSketch||!e.interaction||e.drawingPointHistory.length===0)return;let n=e.drawingPointHistory[e.drawingPointHistory.length-1];if(!n||n.type!==`point`)return;t(`setDrawingPointHistory`,e.drawingPointHistory.slice(0,-1));let r=e.currentSketch.getGeometry(),i=r.getType();if(typeof e.interaction.appendCoordinates==`function`)try{e.interaction.appendCoordinates([n.coord]);return}catch(e){console.warn(`measureUndoRedo: appendCoordinates failed, falling back to manual insertion.`,e)}if(i===`LineString`){let e=r.getCoordinates();e.push(n.coord),r.setCoordinates(e)}else if(i===`Polygon`){let e=r.getCoordinates()[0];e.splice(e.length-1,0,n.coord),r.setCoordinates([e])}r.changed()},abortCurrentDrawing({state:e,commit:t,dispatch:n}){if(e.currentSketch&&(n(`removeTooltipForFeature`,e.currentSketch.ol_uid),V_.removeFeature(e.currentSketch),t(`removeFeature`,e.currentSketch.ol_uid)),e.interaction)try{e.interaction.abortDrawing()}catch(e){console.warn(`measureUndoRedo: abortDrawing failed.`,e)}t(`setCurrentSketch`,null),t(`setDrawingPointHistory`,[])}},bv={namespaced:!0,state:H_,mutations:iv,actions:{deleteFeatures({state:e,commit:t}){let{unlisteners:n,interaction:r}=e;r&&r.abortDrawing(),n.forEach(e=>e()),V_.clear(),t(`setLines`,{}),t(`setPolygons`,{}),t(`setCustomNames`,{}),t(`setUnlisteners`,[])},createDrawInteraction({state:e,dispatch:t,commit:n,getters:r,rootGetters:i}){t(`removeDrawInteraction`);let a=null;if(i[`Maps/mode`]===`3D`)t(`deleteFeatures`),a=_v();else{r.unlisteners.length&&t(`deleteFeatures`);let{selectedGeometry:i}=e;a=sv({state:e},i,e=>n(`addFeature`,e),e=>n(`setIsDrawing`,e),e=>n(`setFeatureId`,e),e=>n(`setTooltipCoord`,e)),a.on(`drawstart`,e=>{n(`setCurrentSketch`,e.feature),n(`setDrawingPointHistory`,[]),n(`incrementGeometryUpdateTrigger`);let t=e.feature.getGeometry();t&&t.on(`change`,()=>{n(`incrementGeometryUpdateTrigger`)})}),a.on(`drawend`,e=>{let t=e.feature.ol_uid,r=Y_(t),i=tv(e.feature);
9n(`initFeatureHistory`,r),i.forEach(e=>n(`pushUndoEntry`,{normalizedId:r,entry:e})),n(`clearRedoForFeature`,r),n(`setCurrentSketch`,null),n(`setDrawingPointHistory`,[])}),t(`Maps/addInteraction`,a,{root:!0})}n(`setInteraction`,a)},removeDrawInteraction({state:e,dispatch:t,commit:n}){let{interaction:r}=e;r&&(r.abortDrawing(),r.interaction3d?r.stopInteraction():t(`Maps/removeInteraction`,r,{root:!0}),n(`setInteraction`,null))},urlParams({commit:e},t){Object.keys(t).forEach(n=>{e(`set${ra.upperFirst(n)}`,t[n])})},removeTooltipForFeature(e,t){let n=Y_(t),r=[];V_.forEachFeature(e=>{let t=e.get(`featureId`);t!==void 0&&Y_(t)===n&&r.push(e)}),r.forEach(e=>V_.removeFeature(e))},updateTooltipPositionForFeature({state:e,commit:t},n){let r=Y_(n.ol_uid),i=n.getGeometry(),a=i.getType(),o=null;if(a===`LineString`)o=i.getLastCoordinate();else if(a===`Polygon`){let e=i.getCoordinates()[0];o=e[e.length-2]}o&&(V_.forEachFeature(e=>{let t=e.get(`featureId`);if(t!==void 0&&Y_(t)===r){let t=e.getGeometry();t&&t.getType()===`Point`&&t.setCoordinates(o)}}),Y_(e.featureId)===r&&t(`setTooltipCoord`,o))},deleteSingleFeature({commit:e,dispatch:t},n){let r=Y_(n),i=V_.getFeatures().find(e=>e.get(`featureId`)===void 0&&Y_(e.ol_uid)===r);i&&(t(`removeTooltipForFeature`,n),V_.removeFeature(i),e(`removeFeature`,i.ol_uid))},...vv,...yv},getters:rv},xv={icon:`bi-bounding-box`,description:`common:modules.modeler3D.description`,hasMouseMapInteractions:!0,name:`common:modules.modeler3D.name`,supportedDevices:[`Desktop`,`Mobile`,`Table`],supportedMapModes:[`3D`],type:`modeler3D`,activeShapePoints:[],adaptToHeight:!0,allowedAttributes:[`Wertbezeichnung`,`Gebaeudefunktion`],buildingFunctionURL:`https://repository.gdi-de.org/schemas/adv/citygml/Codelisten/BuildingFunctionTypeAdV.xml`,buildingSource:`ALKIS`,clampToGroun
9d:!0,coordinateEasting:0,coordinateNorthing:0,currentFilterId:null,currentLayout:{fillColor:[255,255,255],fillTransparency:0,strokeColor:[0,0,0],strokeWidth:1,extrudedHeight:20},currentModelId:null,currentModelPosition:null,currentProjection:{id:`http://www.opengis.net/gml/srs/epsg.xml#25832`,name:`EPSG:25832`,projName:`utm`},currentView:`modeler-import`,cylinderId:null,dimensions:!0,drawDepth:0,drawIcons:{rectangle:`bi-square`,line:`bi-slash-lg`,polygon:`bi-octagon`},drawName:``,drawnModels:[],drawModelTypes:[`rectangle`],drawRotation:0,drawTypes:[`rectangle`,`line`,`polygon`],extrudedHeight:20,filterGroupOrder:[],filterList:[],gmlIdPath:`gmlid`,height:0,hiddenObjects:[],hiddenObjectsWithLayerId:[],hideObjects:!1,highlightStyle:{silhouetteColor:`#E20D0F`,silhouetteSize:4},highlightTimeout:null,importedEntities:[],importedModels:[],isApplyingState:!1,isDragging:!1,isDrawing:!1,isLoading:!1,layerList:[],lineWidth:2,movingEntity:!1,newFillColor:``,newStrokeColor:``,opacity:1,povActive:!1,projections:[],pvoColors:{housing:`#ff0000`,commercial:`#666666`,public:`#44ff44`},rectDepth:0,rectWidth:0,rotation:0,scale:1,selectedDrawModelType:``,selectedDrawType:``,selectedFillColor:``,selectedOutlineColor:``,updateAllLayers:!0,useAnchorMove:!0};function Sv(e,t){let n=t||{x:1,y:1,z:1},r=mapCollection.getMap(`3D`).getCesiumScene(),i=Cesium.Cartographic.fromCartesian(n);return i.height=r.globe.getHeight(i)+e.cylinder.length._value/2,Cesium.Cartographic.toCartesian(i)}function Cv(e,t,n){let r=mapCollection.getMap(`3D`).getDataSourceDisplay().defaultDataSource.entities,i=mapCollection.getMap(`3D`).getCesiumScene(),a=Cesium.Cartographic.fromCartesian(n),o=r.values.filter(e=>e.outline&&e.polyline),s=i.sampleHeight(a,[e,t,...o]),c=e?.polygon?.extrudedHeight-s||s;return s?(t.cylinder.length=c+5,a.height=s+t.cylinder.length._value/2,Cesium.Cartographic.toCartesian(a)):n}function wv(e,t){let n=t||{x:1,y:1,z:1},r=Cesium.Cartographic.fromCartesian(n);return r.height+=e.cylinder.length._value/2,Cesium.Cartographic.toCartesian(r)}function Tv(e){let t=Cesium.PolygonPipeline.triangulate(e,[]),n=0;for(let r=0;r<t.length;r+=3){let i=e[t[r]],a=e[t[r+1]],o=e[t[r+2]],s=Cesium.Cartesian3.subtract(a,i,new Cesium.Cartesian3),c=Cesium.Cartesian3.subtract(o,i,new Cesium.Cartesian3),l=Cesium.Cartesian3.cross(s,c,new Cesium.Cartesian3);n+=Cesium.Cartesian3.magnitude(l)/2}return Math.round(n*100)/100}function Ev({angle:e,center:t,position:n}){let r=Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartographic.toCartesian(t)),i=Cesium.Matrix4.inverse(r,new Cesium.Matrix4),a=Cesium.Matrix4.multiplyByPoint(i,n,new Cesium.Cartesian3),o=new Cesium.Cartesian3(a.x*Math.cos(e)-a.y*Math.sin(e),a.x*Math.sin(e)+a.y*Math.cos(e),a.z);return Cesium.Matrix4.multiplyByPoint(r,o,new Cesium.Cartesian3)}function Dv(e){return new Promise(t=>{let n=new FileReader;n.onloadend=()=>t(n.result),n.readAsDataURL(e)})}async function Ov(e){return(await fetch(e)).blob()}var kv={blobToBase64:Dv,b64toBlob:Ov};y();var Av={handleGeoJsonFile({commit:e,state:t},n){let r=mapCollection.getMap(`3D`).getDataSourceDisplay().defaultDataSource.entities,i=[...t.drawnModels],a;try{a=JSON.parse(n)}catch({message:e}){console.error(`Error while trying to parse the given content:`,e);return}if(!Array.isArray(a?.features)){console.warn(`No features found in the given GeoJSON content.`);return}a.features.forEach(e=>{let t=e.properties,n=t.color,a=t.outlineColor,o=e.geometry.coordinates[0],s=new Cesium.Entity({id:zr(`import`),name:t.name,wasDrawn:!0,clampToGroun
9d:t.clampToGround});e.geometry.type===`Polygon`?s.polygon={material:new Cesium.ColorMaterialProperty(new Cesium.Color(n.red,n.green,n.blue,n.alpha)),outline:!0,outlineColor:new Cesium.Color(a.red,a.green,a.blue,a.alpha),outlineWidth:1,height:o[0][2],extrudedHeight:t.extrudedHeight,shadows:Cesium.ShadowMode.ENABLED,hierarchy:new Cesium.PolygonHierarchy(o.map(e=>Cesium.Cartesian3.fromDegrees(e[0],e[1])))}:e.geometry.type===`Polyline`&&(s.polyline={material:new Cesium.ColorMaterialProperty(new Cesium.Color(n.red,n.green,n.blue,n.alpha)),width:t.width,positions:o.map(e=>Cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]))}),r.add(s),e.geometry.type===`Polygon`&&(s.polygon.rectangle=t.rectangle),i.push({id:s.id,name:s.name,show:!0,edit:!1})}),e(`setDrawnModels`,i),e(`setCurrentView`,`modeler-draw`),e(`setIsLoading`,!1)},async createEntities({dispatch:e},t){if(!(!Array.isArray(t)||!t.length))for(let n=0;n<t.length;n++){let r=t[n]?.blob;if(!(r instanceof Blob))try{r=await kv.b64toBlob(r,t[n]?.blobType)}catch({message:e}){console.error(`Error while parsing base64 into blob:`,e);return}await e(`createEntity`,{blob:r,fileName:t[n].fileName,position:t[n].position,rotation:t[n].rotation,scale:t[n].scale})}},async createEntity({commit:e,state:t},{blob:n,fileName:r,position:i,rotation:a,scale:o}){let s=mapCollection.getMap(`3D`).getDataSourceDisplay().defaultDataSource.entities,c=[...t.importedModels],l={id:zr(`import`),name:r,clampToGroun
9d:!0,model:new Cesium.ModelGraphics({uri:URL.createObjectURL(n)})},u=[...t.importedEntities],d=await kv.blobToBase64(n),f=null,p=null;i&&(l.position=new Cesium.Cartesian3(i.x,i.y,i.z)),f=new Cesium.Entity(l),s.add(f),e(`setUseAnchorMove`,!1),u.push({blob:d,blobType:n?.type,fileName:r,entityId:f.id,rotation:a||t.rotation,scale:t.scale,position:i}),i||e(`setMovingEntity`,!0),e(`setImportedEntities`,u),c.push({id:f.id,name:r,show:!0,edit:!1,heading:a||0}),e(`setImportedModels`,c),e(`setCurrentModelId`,f.id),xn(()=>{typeof a==`number`&&(p=Cesium.Transforms.headingPitchRollQuaternion(f?.position?.getValue(),new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(50),0,0)),f.orientation=p,e(`setRotation`,a)),typeof o==`number`&&(e(`setScale`,o),f.model.scale=o)}),e(`setIsLoading`,!1)},deleteEntity({commit:e,dispatch:t,state:n},r){let i=mapCollection.getMap(`3D`).getDataSourceDisplay().defaultDataSource.entities,a=i.getById(r),o=a?.wasDrawn?n.drawnModels:n.importedModels,s=o.findIndex(e=>e.id===r),c=i.values.filter(e=>e.outline&&e.polyline);s>-1&&a&&(c.forEach(e=>i.remove(e)),t(`removeCylinders`),t(`removeLabels`,a),e(`setActiveShapePoints`,[]),e(`setCylinderId`,null),e(`setCurrentModelId`,null),o.splice(s,1),i.removeById(r))},changeVisibility(e,t){let n=mapCollection.getMap(`3D`).getDataSourceDisplay().defaultDataSource.entities.getById(t.id);n.show=!t.show,t.show=n.show},newProjectionSelected({dispatch:e,commit:t,getters:n},r){t(`setCurrentProjection`,n.getProjectionById(r)),e(`updatePositionUI`)},updateEntityPosition({dispatch:e,state:t}){let n=mapCollection.getMap(`3D`).getDataSourceDisplay().defaultDataSource.entities,r=n.getById(t.currentModelId);if(r)if(e(`transformToCartesian`),r.polygon){let i=n.values.filter(e=>e.cylinder);e(`movePolygon`,{entityId:t.currentModelId,position:t.currentModelPosition}),i.forEach(e=>{e.cylinder.length=r.polygon.extrudedHeight-r.polygon.height+5})}else r.position=t.currentModelPosition},updatePositionUI({commit:e,dispatch:t,getters:n,state:r}){let i=mapCollection.getMap(`3D`).getDataSourceDisplay().defaultDataSource.entities.getById(r.currentModelId),a=i?.position?.getValue()||n.getCenterFromGeometry(i);a&&(t(`transformFromCartesian`,a),i?.polygon instanceof Cesium.PolygonGraphics&&e(`setHeight`,i.polygon.height.getValue()))},updateUI({commit:e,dispatch:t,state:n}){let r=mapCollection.getMap(`3D`).getDataSourceDisplay().defaultDataSource.entities.getById(n.currentModelId);
9if(e(`setAdaptToHeight`,r.clampToGround),r?.polygon instanceof Cesium.PolygonGraphics){if(e(`setExtrudedHeight`,r.polygon.extrudedHeight.getValue()-r.polygon.height.getValue()),e(`setDrawRotation`,0),r.lastRotationAngle=0,r.polygon.rectangle){let t=r.polygon.hierarchy.getValue().positions;e(`setRectWidth`,Cesium.Cartesian3.distance(t[1],t[2])),e(`setRectDepth`,Cesium.Cartesian3.distance(t[1],t[0]))}}else r?.polyline instanceof Cesium.PolylineGraphics?(e(`setLineWidth`,r.originalWidth?r.originalWidth.getValue():r.polyline.width.getValue()),e(`setDrawRotation`,0)):r?.model instanceof Cesium.ModelGraphics&&(e(`setRotation`,n.importedModels.find(e=>e.id===r.id).heading),e(`setScale`,r.model.scale?r.model.scale.getValue():1));t(`updatePositionUI`)},transformFromCartesian({state:e,commit:t},n){let r=Cesium.Cartographic.fromCartesian(n),i=r.height;r=[Cesium.Math.toDegrees(r.longitude),Cesium.Math.toDegrees(r.latitude)],e.currentProjection.epsg!==`EPSG:4326`&&(r=j.transform(`EPSG:4326`,e.currentProjection,r)),e.currentProjection.id===`http://www.opengis.net/gml/srs/epsg.xml#ETRS893GK3`&&r.toFixed(2).length===9&&(r[0]+=3e6),t(`setCoordinateEasting`,r[0]),t(`setCoordinateNorthing`,r[1]),t(`setHeight`,i)},transformToCartesian({commit:e,state:t}){let n=[t.coordinateEasting,t.coordinateNorthing],r=t.height;if(t.currentProjection.epsg!==`EPSG:4326`&&(t.currentProjection.id.indexOf(`ETRS893GK3`)>-1&&(n[0]-=3e6),n=j.transform(t.currentProjection,`EPSG:4326`,n)),t.adaptToHeight){let t=mapCollection.getMap(`3D`).getCesiumScene(),i=Cesium.Cartographic.fromDegrees(n[0],n[1]);r=t.globe.getHeight(i),e(`setHeight`,r)}e(`setCurrentModelPosition`,Cesium.Cartesian3.fromDegrees(n[0],n[1],r))},generateCylinders({dispatch:e,state:t},n){let r=mapCollection.getMap(`3D`).getDataSourceDisplay().defaultDataSource.entities;t.activeShapePoints.forEach((i,a)=>{e(`createCylinder`,{posIndex:a,length:n.polygon?n.polygon.extrudedHeight.getValue()-n.polygon.height.getValue()+5:5});let o=r.values.find(e=>e.id===t.cylinderId);o.position=new Cesium.CallbackProperty(()=>
9n.clampToGround?Sv(o,t.activeShapePoints[o.positionIndex]):Cv(n,o,t.activeShapePoints[o.positionIndex]),!1)})},createCylinder({commit:e,state:t},{position:n=new Cesium.Cartesian3,posIndex:r,length:i,entityId:a=t.currentModelId}){e(`setCylinderId`,mapCollection.getMap(`3D`).getDataSourceDisplay().defaultDataSource.entities.add({attachedEntityId:a,position:n,positionIndex:r,cylinder:{material:new Cesium.ColorMaterialProperty(Cesium.Color.RED),bottomRadius:.1,topRadius:1,length:i||t.extrudedHeight+5}}).id)},removeCylinders(){let e=mapCollection.getMap(`3D`).getDataSourceDisplay().defaultDataSource.entities;e.values.filter(e=>e.cylinder).forEach(t=>{e.remove(t)})},movePolygon({dispatch:e,getters:t,state:n},{entityId:r,position:i,anchor:a=null}){let o=mapCollection.getMap(`3D`).getCesiumScene(),s=mapCollection.getMap(`3D`).getDataSourceDisplay().defaultDataSource.entities.getById(r);if(s?.polygon?.hierarchy&&i){let r=s?.polygon?.hierarchy.getValue().positions,c=t.getCenterFromGeometry(s),l=Cesium.Cartesian3.subtract(i,a||c,new Cesium.Cartesian3);
9s.clampToGround&&(n.height=o.globe.getHeight(Cesium.Cartographic.fromCartesian(c))),s.polygon.height=n.height,s.polygon.extrudedHeight=n.extrudedHeight+n.height,r.forEach(e=>{Cesium.Cartesian3.add(e,l,e)}),e(`transformFromCartesian`,t.getCenterFromGeometry(s))}},movePolyline({getters:e},{entityId:t,position:n,anchor:r=null}){let i=mapCollection.getMap(`3D`).getDataSourceDisplay().defaultDataSource.entities.getById(t);if(i?.polyline?.positions&&n){let t=i.polyline.positions.getValue(),a=e.getCenterFromGeometry(i),o=Cesium.Cartesian3.subtract(n,r||a,new Cesium.Cartesian3);t.forEach(e=>{Cesium.Cartesian3.add(e,o,e)})}},editLayout({commit:e,getters:t,state:n},r){let i=mapCollection.getMap(`3D`).getDataSourceDisplay().defaultDataSource.entities,a=i?.getById(n.currentModelId),o=t.getEntityType(a);if(r===`fillColor`&&a.polygon){let e=a[o].material.color.alpha,t=Cesium.Color.fromBytes(...f_(n.newFillColor,`rgb`)).withAlpha(e);a.polygon.material=new Cesium.ColorMaterialProperty(t)}else if(r===`strokeColor`){let t=Cesium.Color.fromBytes(...f_(n.newStrokeColor,`rgb`));if(n.highlightTimeout&&clearTimeout(n.highlightTimeout),a.polygon){let n=i.values.filter(e=>e.outline);n.forEach(e=>{e.show=!1,a.polygon.outline=!0}),a.polygon.outlineColor=t,a.originalOutlineColor=t,e(`setHighlightTimeout`,setTimeout(()=>{n.forEach(e=>{e.show=!0,a.polygon.outline=!1})},2e3))}else if(a.polyline){let n=a.polyline.material.color;a.polyline.material.color=t,a.originalColor=t,e(`setHighlightTimeout`,setTimeout(()=>{a.polyline.material.color=n},2e3))}}},moveAdjacentRectangleCorners({getters:e,state:t},{movedCornerIndex:n}){let r=mapCollection.getMap(`3D`).getDataSourceDisplay().defaultDataSource.entities.getById(t.currentModelId),i=null,a=null,o=null,s=null,c,l,u=t.activeShapePoints;r&&(r.rotation||t.drawRotation)&&(i=Cesium.Cartographic.fromCartesian(e.getCenterFromGeometry(r)),a=Cesium.Math.toRadians((r.rotation||0)+t.drawRotation),u=u.map(e=>Ev({angle:a,center:i,position:e}))),o=Cesium.Cartographic.fromCartesian(u[n]),s=Cesium.Cartographic.fromCartesian(u[(n+2)%4]),c=Cesium.Cartographic.toCartesian(new Cesium.Cartographic(o.longitude,s.latitude,o.height)),l=Cesium.Cartographic.toCartesian(new Cesium.Cartographic(s.longitude,o.latitude,o.height)),r&&(r.rotation||t.drawRotation)&&(c=Ev({angle:-a,center:i,position:c}),l=Ev({angle:-a,center:i,position:l})),t.activeShapePoints.splice((n+1)%4,1,n%2==0?c:l),t.activeShapePoints.splice((n+3)%4,1,n%2==0?l:c)},rotateDrawnEntity({state:e,getters:t},n){let r=mapCollection.getMap(`3D`).getDataSourceDisplay().defaultDataSource.entities.getById(e.currentModelId),i=Cesium.Math.toRadians(r.lastRotationAngle-n),a=Cesium.Cartographic.fromCartesian(t.getCenterFromGeometry(r));e.activeShapePoints.forEach((t,n)=>{e.activeShapePoints.splice(n,1,Ev({angle:i,center:a,position:t}))}),r.lastRotationAngle=n},updateRectangleDimensions({getters:e,state:t},n){let r=mapCollection.getMap(`3D`).getDataSourceDisplay().defaultDataSource.entities.getById(t.currentModelId),i=e.getCenterFromGeometry(r),a=Cesium.Transforms.eastNorthUpToFixedFrame(i),o=[new Cesium.Cartesian3(-n.width/2,-n.depth/2,0),new Cesium.Cartesian3(-n.width/2,n.depth/2,0),new Cesium.Cartesian3(n.width/2,n.depth/2,0),new Cesium.Cartesian3(n.width/2,-n.depth/2,0)].map(e=>Cesium.Matrix4.multiplyByPoint(a,e,new Cesium.Cartesian3)),s=Cesium.Math.toRadians((-r.rotation||0)-t.drawRotation);o.forEach((e,n)=>{let a=r.rotation||t.drawRotation?Ev({angle:s,center:Cesium.Cartographic.fromCartesian(i),position:e}):e;t.activeShapePoints.splice(n,1,a)})},copyEntity({state:e,commit:t},{id:n,nextId:r}){let i=mapCollection.getMap(`3D`).getDataSourceDisplay().defaultDataSource.entities,a=e.drawnModels,o=i.getById(n),s=o.polygon||o.polyline,c=o.polygon?o.polygon.hierarchy.getValue().positions:o.polyline.positions.getValue(),l=o.polygon?s.material.color.getValue():o.originalColor,u=s.outlineColor?.getValue(),d=JSON.parse(JSON.stringify(c)).map(e=>Cesium.Cartographic.fromCartesian(e)),f=Cesium.Rectangle.fromCartographicArray(d),p=f.east-f.west,m=d.map(e=>(e.longitude+=p,Cesium.Cartesian3.fromRadians(e.longitude,e.latitude,e.height))),h=null;
9o&&(h=new Cesium.Entity({id:r,name:o.name+` copy`,clampToGround:o.clampToGround,show:!0,wasDrawn:!0}),o.polygon?h.polygon={hierarchy:new Cesium.ConstantProperty(new Cesium.PolygonHierarchy(m)),material:new Cesium.ColorMaterialProperty(l),outlineColor:new Cesium.Color(u.red,u.green,u.blue,u.alpha),height:o.polygon.height.getValue(),extrudedHeight:o.polygon.extrudedHeight.getValue()}:h.polyline={positions:new Cesium.ConstantProperty(m),material:new Cesium.ColorMaterialProperty(l),width:o.originalWidth},i.add(h),o.polygon?.rectangle&&(h.polygon.rectangle=!0),a.push({id:h.id,name:h.name,show:!0,edit:!1}),t(`setDrawnModels`,a),t(`setCurrentModelId`,h.id))},removeLabels(e,t){let n=mapCollection.getMap(`3D`).getDataSourceDisplay().defaultDataSource.entities;n.values.filter(e=>e.label&&e.attachedEntityId===t.id).forEach(e=>{n.remove(e)})},resetAll({commit:e,state:t}){let n=mapCollection.getMap(`3D`).getDataSourceDisplay().defaultDataSource.entities,r=W.getLayers().filter(e=>e.get(`typ`)===`TileSet3D`);n.removeAll(),t.hiddenObjects.forEach(e=>{r.forEach(t=>{t.showObjects([e.name])})}),e(`setDrawnModels`,[]),e(`setImportedModels`,[]),e(`setHiddenObjects`,[]),e(`setHiddenObjectsWithLayerId`,[]),e(`setClampToGroun
9d`,!0),e(`setDimensions`,!0),e(`setSelectedDrawType`,``),e(`setCurrentLayout`,{fillColor:[255,255,255],fillTransparency:0,strokeColor:[0,0,0],strokeWidth:1,extrudedHeight:20}),e(`setHideObjects`,!1),e(`setPovActive`,!1),e(`setScale`,1),e(`setCurrentModelId`,null)},bulkHideObjects({state:e,getters:t,commit:n},r){if(!Array.isArray(r))return;let i={},a=t.updateAllLayers,o=JSON.parse(JSON.stringify(e.hiddenObjectsWithLayerId)),s=JSON.parse(JSON.stringify(e.hiddenObjects));r.forEach(({name:e,layerId:t})=>{i[t]||(i[t]=[]),i[t].push(e),s.push({name:e}),o.push({name:e,layerId:t})}),Object.entries(i).forEach(([e,t])=>{let n=W.getLayerById(e);n&&n.layer.tileset?.then(e=>{if(e.tilesLoaded){jv(n,void 0,t,a);return}let r=jv;e?.allTilesLoaded?.addEventListener(r.bind(null,n,t,a,()=>{e.allTilesLoaded?.removeEventListener(r)}))})}),n(`setHiddenObjects`,s),n(`setHiddenObjectsWithLayerId`,o)}};function jv(e,t,n,r){t.forEach(t=>{e.addToHiddenObjects([t],n)}),r()}var Mv={...H(xv),getModelNameById:e=>t=>e.importedModels.concat(e.drawnModels).find(e=>e.id===t).name,getProjectionById:e=>t=>e.projections.find(e=>e.id===t),getLabel:e=>t=>`modules.modeler3D.entity.projections.`+(e.currentProjection?.projName===`longlat`?`hdms`:`cartesian`)+`.`+t,coordAdjusted:e=>({shift:t,coordType:n})=>e.currentProjection.epsg!==`EPSG:4326`||n===`height`?t?1:.1:t?1e-5:1e-6,formatCoord:e=>t=>e.currentProjection.id===`http://www.opengis.net/gml/srs/epsg.xml#4326-DG`?parseFloat(t.split(/[\s°]+/)[0]):e.currentProjection.projName===`longlat`?Ru([t.split(/[\s°â²â³'"´`]+/),`0`])[1]:parseFloat(t),prettyCoord:e=>t=>e.currentProjection.id===`http://www.opengis.net/gml/srs/epsg.xml#4326-DG`?t.toFixed(6)+`°`:e.currentProjection.projName===`longlat`?Hu(t):t.toFixed(2),getCenterFromGeometry:()=>e=>{if(!e)return;let t;if(e.polygon)t=e.polygon.hierarchy.getValue().positions;else if(e.polyline)t=e.polyline.positions.getValue();else return;let n=t.reduce((e,t)=>(Cesium.Cartesian3.add(e,t,e),e),{x:0,y:0,z:0});return Cesium.Cartesian3.divideByScalar(n,t.length,n),n},wasDrawn(e){return mapCollection.getMap(`3D`).getDataSourceDisplay().defaultDataSource.entities?.getById(e.currentModelId)?.wasDrawn},getEntityType:()=>e=>{if(e.polygon)return`polygon`;if(e.polyline)return`line`;if(e.model)return`model`},drawnEntities(){let e=mapCollection.getMap(`3D`).getDataSourceDisplay().defaultDataSource.entities,t=[],n={type:`FeatureCollection`,features:[]},r=[];return e.values.forEach(e=>{!e.model&&!e.cylinder&&!e.outline&&!e.label&&t.push(e)}),t.forEach(e=>{let t=e.polygon?e.polygon:e.polyline,n=e.polygon?e.polygon.hierarchy.getValue().positions:e.polyline.positions.getValue(),i=t.material.color.getValue(),a=t.outlineColor?.getValue(),o={type:`Feature`,properties:{},geometry:{type:e.polygon?`Polygon`:`Polyline`,coordinates:[[]]}};n.forEach(n=>{let r=Cesium.Cartographic.fromCartesian(n),i=Cesium.Math.toDegrees(r.longitude),a=Cesium.Math.toDegrees(r.latitude),s=e.polygon?t.height.getValue():r.height,c=[Number(i),Number(a),Number(s)];o.geometry.coordinates[0].push(c)}
9),o.properties.name=e.name,o.properties.clampToGround=e.clampToGround,o.properties.color=i,e.polygon?(o.properties.rectangle=e.polygon?.rectangle,o.properties.outlineColor=a,o.properties.extrudedHeight=t.extrudedHeight.getValue()):e.polyline&&(o.properties.width=t.width.getValue()),r.push(o)}),n.features=r,n}},Nv={...U(xv),setModelName:(e,t)=>{let n=e.importedModels.concat(e.drawnModels).find(t=>t.id===e.currentModelId);n.name=t},setProjections:(e,t=[])=>{if(t.filter(t=>t.id===e.currentProjection?.id).length===0){let n=t.find(e=>e.name.indexOf(`25832`)>-1);if(n){let e=t.indexOf(n);t.splice(e,1),t.unshift(n)}e.currentProjection=t[0]}e.projections=t}},Pv={namespaced:!0,state:{...xv},mutations:Nv,actions:Av,getters:Mv},Fv={configPaths:[`portalConfig.map.mouseHover`],overlay:new wn({id:`mousehover-overlay`,element:document.createElement(`DIV`),offset:[1,-2],positioning:`bottom-left`}),numFeaturesToShow:2,infoText:`common:modules.mouseHover.infoText`,fontFamily:`common:modules.mouseHover.fontFamily`,titleFontFamily:`common:modules.mouseHover.titleFontFamily`,fontStyle:`common:modules.mouseHover.fontStyle`,titleFontStyle:`common:modules.mouseHover.titleFontStyle`,fontWeight:`common:modules.mouseHover.fontWeight`,titleFontWeight:`common:modules.mouseHover.titleFontWeight`,fontSize:`common:modules.mouseHover.fontSize`,titleFontSize:`common:modules.mouseHover.titleFontSize`,fontColor:`common:modules.mouseHover.fontColor`,titleFontColor:`common:modules.mouseHover.titleFontColor`,infoBorderRadius:`common:modules.mouseHover.infoBorderRadius`,lineHeight:`common:modules.mouseHover.lineHeight`,layersFromConfig:[],mouseHoverLayers:[],mouseHoverInfos:[],infoBox:null,hoverPosition:null,pleaseZoom:!1,highlightOnHover:!1,highlightVectorRulesPolygon:{fill:{color:[255,255,255,.5]},stroke:{width:4,color:[255,0,0,.9]}},highlightVectorRulesPointLine:{stroke:{width:2,color:[255,0,255,.9]},image:{scale:2}},type:`mouseHover`},Iv={namespaced:!0,state:Fv,actions:{initialize({commit:e,dispatch:t,state:n}){let{numFeaturesToShow:i,infoText:a,highlightOnHover:o}=n,s=mapCollection.getMap(`2D`),c=[];t(`setMouseHoverLayers`),e(`setMouseHoverInfos`),s.addOverlay(n.overlay),i&&e(`setNumFeaturesToShow`,i),a&&e(`setInfoText`,a),s.on(`pointermove`,i=>{if(!$.getters.mouseHover||i.originalEvent.pointerType===`touch`)return;c=[],e(`setHoverPosition`,i.coordinate),o&&t(`Maps/removeHighlightFeature`,`decrease`,{root:!0}),s.forEachFeatureAtPixel(i.pixel,(e,n)=>{!n?.getVisible()||n.get(`renderer`)===`webgl`&&!n.get(`isPointLayer`)||(o&&t(`highlightFeature`,{feature:e,layer:n}),e.getProperties().features?e.get(`features`).forEach(e=>{c.push(lh(n,``,e))}):c.push(lh(n,``,e)))});let a=mapCollection.getMapView(`2D`).getResolution(),l=s.getLayers().getArray().filter(e=>e.get(`renderer`)===`webgl`&&!e.get(`isPointLayer`)),u=Qh(s,l,e=>tn(new r(i.coordinate).getExtent(),(e.get(`hitTolerance`)||1)*Math.sqrt(a)));c.push(...u),n.overlay.setPosition(i.coordinate),n.overlay.setElement(document.querySelector(`#mousehover-overlay`)),e(`setInfoBox`,null),c.length>0&&t(`filterInfos`,c)})},setMouseHoverLayers({commit:e,rootGetters:t}){e(`setMouseHoverLayers`,t.allLayerConfigs.filter(e=>e?.mouseHoverField&&e.mouseHoverField!==``))},highlightFeature({dispatch:e,state:t},{feature:n,layer:r}){let{highlightVectorRulesPointLine:i,highlightVectorRulesPolygon:a}=t,o=r.get(`id`),s=n.getGeometry().getType(),c=n.getId(),l=s.toLowerCase().indexOf(`polygon`)>-1?a??t.highlightVectorRulesPolygon:i??t.highlightVectorRulesPointLine,u={type:s===`Point`||s===`MultiPoint`?`increase`:`highlightPolygon`,id:c,layer:r,feature:n,scale:l.image?.scale},d=jt.getLayerWhere({id:o});(s===`LineString`||s===`MultiLineString`)&&(u.type=`highlightLine`),r.id=o,u.zoomLevel=l.zoomLevel,d&&d.styleId?u.styleId=d.styleId:r.get(`styleId`)&&(u.styleId=r.get(`styleId`)),u.highlightStyle={fill:l.fill,stroke:l.stroke,image:l.image},e(`Maps/highlightFeature`,u,{root:!0})},filterInfos({commit:e,state:t},n){let r=[];n.length>0&&n.forEach(i=>{let a=t.mouseHoverInfos.find(e=>e.id===i.getLayerId());if(a){let o=i.getProperties(),s=typeof a.mouseHoverField==`string`?a.mouseHoverField:a.mouseHoverField.filter(e=>Object.keys(o).includes(e)),c=[];
9Array.isArray(s)?s.forEach(e=>{c.push(o[e])}):c.push(o[s]),r.push(c),e(`setPleaseZoom`,n.length>t.numFeaturesToShow),e(`setInfoBox`,r.slice(0,t.numFeaturesToShow))}})}},getters:{...H(Fv)},mutations:{...U(Fv),setMouseHoverInfos:e=>{e.mouseHoverInfos=e.mouseHoverLayers.map(e=>({id:e.id,mouseHoverField:e.mouseHoverField}))}}},Lv={description:`common:modules.news.description`,icon:`bi-newspaper`,name:`common:modules.news.name`,supportedDevices:[`Desktop`,`Mobile`,`Table`],supportedMapModes:[`2D`,`3D`],type:`news`,news:[]},Rv={namespaced:!0,state:Lv,mutations:{...U(Lv),addNews(e,t){e.news.push(t)}},getters:{...H(Lv)}},zv={processConfigJsonOnload({commit:e,dispatch:t},{event:n,targetFileName:r}){let i=JSON.parse(n.target.result),a=[],o=i18next.t(`common:modules.openConfig.loadFileSuccess`,{targetFileName:r});if(W.clear(),e(`setPortalConfig`,i.portalConfig,{root:!0}),Object.keys(i[Qn]).forEach(t=>{e(`setLayerConfigByParentKey`,{layerConfigs:i[Qn][t],parentKey:t},{root:!0})}),t(`extendLayers`,null,{root:!0}),t(`checkAvailabilityOfModules`,{menu:i.portalConfig.mainMenu,notAvailableModules:a}),t(`checkAvailabilityOfModules`,{menu:i.portalConfig.secondaryMenu,notAvailableModules:a}),e(`Menu/setSectionsBySide`,{sections:i.portalConfig.mainMenu?i.portalConfig.mainMenu.sections:[],side:Yn},{root:!0}),e(`Menu/setSectionsBySide`,{sections:i.portalConfig.secondaryMenu?i.portalConfig.secondaryMenu.sections:[],side:Zn},{root:!0}),a.length>0){let e=i18next.t(`common:modules.openConfig.modulesNotAvailable`,{count:a.length,modules:a.join(`, `)});t(`Alerting/addSingleAlert`,{category:`success`,content:o+`<br>`+e},{root:!0})}else t(`Alerting/addSingleAlert`,{category:`success`,content:o},{root:!0})},checkAvailabilityOfModules({rootGetters:e},{menu:t,notAvailableModules:n}){t&&t.sections.forEach((r,i)=>{let a=[];r.forEach(t=>{e[`Modules/componentMap`][t.type]?a.push(t):(console.warn(`openConfig: module not available`,t),n.push(t.type))}),t.sections[i]=a})}},Bv={description:`common:modules.openConfig.description`,icon:`bi-upload`,name:`common:modules.openConfig.name`,supportedDevices:[`Desktop`,`Mobile`,`Table`],supportedMapModes:[`2D`,`3D`],type:`openConfig`},Vv={...U(Bv)},Hv={...H(Bv)},Uv={namespaced:!0,state:{...Bv},mutations:Vv,getters:Hv,actions:zv},Wv={configPaths:[`portalConfig.portalFooter`],scaleLine:!0,scaleLineWidth:2,seperator:` | `,type:`portalFooter`,urls:[]},Gv={...H(Wv)},Kv={...U(Wv)},qv={namespaced:!0,state:{...Wv},getters:Gv,mutations:Kv};function Jv(e=[],t=[]){return!Array.isArray(e)||!Array.isArray(t)||e.length===0?[]:t.length===0?e:e.filter(e=>!t.includes(e))}async function Yv(e){return new Promise((t,n)=>{let r=document.createElement(`div`),i=$.getters[`Maps/size`],a=mapCollection.getMapView(`2D`),o=a.getProperties().options.find(e=>{let t=$.state.Modules.Print.isScaleSelectedManually?$.state.Modules.Print.currentScale:$.state.Modules.Print.optimalScale;return e.scale===t}),s=new It(a.getProperties()),c=window.devicePixelRatio||1;s.setResolution(s.getResolution()/c),r.style.position=`absolute`,r.style.top=`-9999px`,s.setZoom(o.zoomLevel),$.state.Modules.Print.currentScale===$.state.Modules.Print.currentMapScale?(r.style.width=i[0]+1e3+`px`,r.style.height=i[1]+1e3+`px`):(r.style.width=(i[0]%2==0?i[0]+600:i[0]+601)+`px`,r.style.height=(i[1]%2==0?i[1]+600:i[1]+601)+`px`),document.body.appendChild(r);let l=new Nn({target:r,layers:[e],view:s,renderer:`canvas`});l.once(`postrender`,()=>{setTimeout(async()=>{try{l.renderSync();let e=await Zv(l.getViewport().querySelector(`canvas`),l);document.body.removeChild(r),t({imageUrl:e,heatmapExtent:s.calculateExtent()}),l.setTarget(null),l.dispose()}catch(e){document.body.removeChild(r),n(`Error exporting heatmap: `+e.message)}},1e3)})})}function Xv(e,t){let n=t.width,r=t.height,i=new Uint8Array(4*n*r);return e.readPixels(0,0,n,r,e.RGBA,e.UNSIGNED_BYTE,i),i.every((e,t)=>(t%4,e===0))}function Zv(e){let t=e.getContext(`webgl`);return t?new Promise(n=>(Xv(t,e)?n(`empty`):n(e.toDataURL(`image/png`)),null)).catch(e=>{console.error(e)}):(console.error(`WebGL not supported.`),null)}var Qv={defaults:{uniqueIdList:[],visibleLayerIds:null,layout:null,attributes:{map:null,title:``,showLegend:!1,legend:``,showGfi:!1,gfi:null,
9scale:null}},fetchedMetaData:function(e){if(this.isOwnMetaRequest(this.defaults.uniqueIdList,e.uniqueId)&&(this.removeUniqueIdFromList(this.defaults.uniqueIdList,e.uniqueId),this.updateMetaData(e.layerName,e.parsedData),this.defaults.uniqueIdList.length===0)){let t={index:e.index,payload:encodeURIComponent(JSON.stringify(this.defaults)),getResponse:e.getResponse};$.dispatch(`Modules/Print/createPrintJob`,t)}},setAttributes:function(e){this.defaults.attributes=e.attributes,this.defaults.layout=e.layout,this.defaults.outputFilename=e.outputFilename,this.defaults.outputFormat=e.outputFormat},isOwnMetaRequest:function(e,t){return Array.isArray(e)&&e.indexOf(t)!==-1},removeUniqueIdFromList:function(e,t){this.setUniqueIdList(Jv(e,[t]))},updateMetaData:function(e,t){let n=Sc(this.defaults.attributes.legend&&this.defaults.attributes.legend.layers?this.defaults.attributes.legend.layers:void 0,{layerName:e});n!==void 0&&(n.metaDate=t?.date?t.date:`n.N.`,n.metaOwner=t?.orgaOwner?t.orgaOwner:`n.N.`,n.metaAddress=t?.address?this.parseAddressToString(t.address):`n.N.`,n.metaEmail=t?.email?t.email:`n.N.`,n.metaTel=t?.tel?t.tel:`n.N.`,n.metaUrl=t?.url?t.url:`n.N.`,n.metaPeriodicity=t?.periodicity||`n.N.`,n.metaCatalogueLink=t?.catalogueLink||``)},parseAddressToString:function(e){let t,n=!1,r,i,a=!1,o,s=``;return typeof e==`object`&&(t=e.street,n=this.isFilled(t),r=e.housenr,i=e.postalCode,a=this.isFilled(i),o=e.city),n&&(s+=t),this.isFilled(r)&&(n&&(s+=` `),s+=r),s!==``&&(s+=` 10 `),a&&(s+=i),this.isFilled(o)&&(a&&(s+=` `),s+=o),s.trim()===``&&(s+=`n.N.`),s},isFilled:function(e){return e!==void 0&&e.trim()!==``},buildLayers:async function(e,t){let n=[],r=this.defaults.attributes,i=$.getters[`Maps/resolution`],a=[];if(Array.isArray(e))for(let r of e){let e=[];e.push(await this.buildLayerType(r,i,t)),e.forEach(e=>{e!==void 0&&(r?.get(`id`)!==void 0&&a.push(r?.get(`id`)),n.push(e))})}this.setVisibleLayerIds(a),$.state.Modules.Print.printService===`plotservice`?r.map.layers=n:r.map.layers=n.reverse()},getDrawLayerInfo:function(e,t){let n=Al(e.getSource().getFeaturesInExtent(t),function(e){return e.getStyle()&&typeof e.getStyle==`function`&&typeof e.getStyle().getZIndex==`function`?e.getStyle().getZIndex():0}).filter(e=>e.get(`isVisible`)??e.get(`masterportal_attributes`).isVisible);if(n.length>0)return this.buildVector(e,n,t)},setLastPrintedExtent:function(e){this.lastPrintedExtent=e},buildLayerType:async function(e,t,n,r=!1){let i=$.getters[`Maps/extent`],a=typeof e?.get==`function`&&e.get(`minResolution`),o=typeof e?.get==`function`&&e.get(`maxResolution`),s=this.isInScaleRange(a,o,t),c=[],l;if(s||r||e instanceof Rt){let r=e.getSource();e instanceof be?l=await this.buildVectorTile(e,t,this.lastPrintedExtent):e instanceof an?l=this.buildImageWms(e,n):e instanceof Gt?r?.getParams?l=this.buildTileWms(e,n):r?.getLayer&&(l=this.buildWmts(e,r)):e instanceof Fe&&r instanceof Ue?console.warn(`Das Drucken von GeoTiff-Layern wird aktuell noch nicht unterstützt. Der Layer "${e.get(`name`)}" wird ignoriert.`):typeof e?.get==`function`&&e.get(`name`)===`importDrawLayer`?l=this.getDrawLayerInfo(e,i):e instanceof Rt?(c=r.getFeaturesInExtent(this.lastPrintedExtent||i),c.length>0&&(l=this.buildVector(e,c,this.lastPrintedExtent||i))):e instanceof In&&await Yv(e).then(async t=>{let n=t;n.imageUrl===`empty`&&(n=await Yv(e)),l={type:`image`,opacity:1,baseURL:n.imageUrl,extent:n.heatmapExtent}})}return l},isInScaleRange:function(e,t,n){let r=!1;return e<=n&&t>=n&&(r=!0),r},buildWmts:(e,t)=>{let n=[],r=t.getTileGrid(),i=r.getMatrixIds(),{origin_:a,origins_:o,tileSize_:s,tileSizes_:c}=r,l=t.getUrls()[0];for(let e=0;e<i.length;e++)n.push({identifier:i[e],matrixSize:t.matrixSizes[e],topLeftCorner:a||o[e],scaleDenominator:t.scales[e],tileSize:s?[s,s]:[c[e],c[e]]});return l.includes(`{Style}`)&&(l=l.replace(/{Style}/g,`{style}`)),{baseURL:l,opacity:e.getOpacity(),type:`WMTS`,layer:t.getLayer(),style:t.getStyle(),imageFormat:t.getFormat(),matrixSet:t.getMatrixSet(),matrices:n,requestEncoding:t.getRequestEncoding()}},buildVectorTile:async function(e,t,n){xt.useImmediateAPI=!1;let r=$.state.Modules.Print.layoutMapInfo,i=$.state.Modules.Print.dpiForPdf/72,a=r[0]*i,o=r[1]*i,s=await new xt().encodeMVTLayer({layer:e,tileResolution:t,printResolution:t,printExtent:n,canvasSize:[a,o]}),{extent:c,baseURL:l}=s[0];if(s.length!==1)throw Error(`handle several results`);return s[0].baseURL.length<=6?null:{extent:c,baseURL:l,type:`image`,name:e.get(`name`),opacity:1,imageFormat:`image/png`}}
10,buildTileWms:function(e,t){let n=e.getSource(),r=$.state.Modules.Print.printService===`plotservice`,i=null,a,o=n.getParams().LAYERS;return n.getParams().STYLES&&(typeof n.getParams().STYLES==`string`?a=n.getParams().STYLES.split(`,`):Array.isArray(n.getParams().STYLES)?a=n.getParams().STYLES:n.getParams().STYLES&&typeof n.getParams().STYLES==`object`&&`value`in n.getParams().STYLES&&(a=Array.isArray(n.getParams().STYLES.value)?n.getParams().STYLES.value:String(n.getParams().STYLES.value).split(`,`))),Array.isArray(o)||(typeof o==`string`?o=o.split(`,`):o&&typeof o==`object`&&`value`in o?o=Array.isArray(o.value)?o.value:String(o.value).split(`,`):(console.warn(`Unexpected LAYERS param format:`,o),o=[])),i={baseURL:n.getUrls()[0],opacity:e.getOpacity(),type:n.getParams().SINGLETILE||r?`WMS`:`tiledwms`,layers:o,styles:a,imageFormat:n.getParams().FORMAT,customParams:{TRANSPARENT:n.getParams().TRANSPARENT,DPI:typeof t==`number`?t:$.state.Modules.Print.dpiForPdf,TIME:n.getParams().TIME}},r&&(i.title=e.get(`name`)),n.getParams().SINGLETILE||(i.tileSize=[n.getParams().WIDTH,n.getParams().HEIGHT]),Object.prototype.hasOwnProperty.call(n.getParams(),`SLD_BODY`)&&n.getParams().SLD_BODY!==void 0&&(i.customParams.SLD_BODY=n.getParams().SLD_BODY,i.styles=[`style`]),n.getParams().VERSION&&(i.version=n.getParams().VERSION),i},buildGeoTiff:function(e){let t=e.getSource(),n=t.getKey()?.split(`,`)[0],r=n.startsWith(`http`)?n:new URL(n,window.location.href),i={opacity:e.getOpacity(),url:r.toString(),type:`geotiff`};return t.getKey()?.split(`,`).length>1&&console.warn(i18next.t(`common:modules.print.geoTiffWarning`)),i},buildImageWms:function(e,t){let n=e.getSource(),r={baseURL:n.getUrl(),opacity:e.getOpacity(),type:`WMS`};n instanceof fe?(r.type=`image`,r.extent=n.getImageExtent()):(r.layers=n.getParams().LAYERS.split(`,`),r.styles=n.getParams().STYLES?n.getParams().STYLES.split(`,`):void 0,r.imageFormat=n.getParams().FORMAT,r.customParams={TRANSPARENT:n.getParams().TRANSPARENT,DPI:typeof t==`number`?t:$.state.Modules.Print.dpiForPdf,TIME:n.getParams().TIME},n.getParams().VERSION&&(r.version=n.getParams().VERSION)),$.state.Modules.Print.printService===`plotservice`&&(r.title=e.get(`name`));let i=typeof t==`number`?t:$.state.Modules.Print.dpiForPdf;return((this.defaults.layout??``).startsWith(`A0`)||i>=400)&&(r.type=`tiledwms`,r.tileSize=[512,512]),r},buildVector:function(e,t,n){let r=[];return{type:`geojson`,style:this.buildStyle(e,t,r,n),geojson:r,opacity:e.getOpacity()}},buildStyle:function(e,t,n,r){let i={version:`2`},a=[`measureLayer`,`importDrawLayer`],o=e.getSource()?e.getSource().getFeaturesInExtent(r):t;return a.includes(e.values_.id)||t.reverse(),t.forEach(t=>{let r=o.find(e=>e.ol_uid===t.ol_uid),a=this.getFeatureStyle(t,e),s=this.getStyleAttributes(e,t);if(!r)return;let c,l,u,d,f,p;a.forEach((r,a)=>{if(r!==null){let o=Ft.returnStyleObject(e.get(`styleId`)),m=o?Jt.getGeometryStyle(t,o.rules,!1,C
10onfig.wfsImgPath):void 0;if(Array.isArray(m)&&(m=m[0]),c=t.clone(),s.forEach(e=>{let n=c.get(`features`)?c.get(`features`)[0]:c;e.includes(`Datastreams`)?c.set(e,e==="default"&&!n.get(e)?`style`:`${n.getProperties().Datastreams[0].Observations[0].result}_${a}`):r.type&&r.type===`CIRCLESEGMENTS`?(c.setId(`${t.ol_uid}__${a}`),c.set(e,`${r.type}_${r.scalingAttribute.replace(` | `,`_`)}_${a}`)):r.type&&r.type===`imageStyle`?(c.setId(`${t.ol_uid}__${a}`),c.set(e,`${r.type}_${a}`)):c.set(e,e==="default"&&!n.get(e)?`style`:`${n.get(e)}_${a}`),c.ol_uid=t.ol_uid}),f=t.getGeometry().getType(),f===`Point`&&r.getImage()instanceof xe&&r.getImage().getScale()>0){let e=c.getGeometry().getCoordinates(),t=o?.rules?.find(({style:{imageOffsetX:e,imageOffsetY:t}})=>e||t)?.style,[n,r]=mapCollection.getMap(`2D`).getPixelFromCoordinate(e),[i,a]=[t?.imageOffsetX??0,t?.imageOffsetY??0],s=$.state.Modules.Print.currentScale/$.state.Modules.Print.currentMapScale,l=mapCollection.getMap(`2D`).getCoordinateFromPixel([n-i*s,r-a*s,0]);!isNaN(l[0])&&!isNaN(l[1])&&c.getGeometry().setCoordinates(l)}if(p=r.getGeometryFunction(),p!=null&&(c.setGeometry(p(c)),f=p(c).getType(),f===`Polygon`&&this.checkPolygon(c)),l=this.getStylingRules(e,c,s,r),l=l.replace(/,(?=(?:[^'"]*['"][^'"]*['"])*[^'"]*$)/g,` AND `),u=l.replaceAll(`[`,``).replaceAll(`]`,``).replaceAll(`*`,``).split(` AND `).map(e=>e.split(`=`)),Array.isArray(u)&&u.length&&this.unsetStringPropertiesOfFeature(c,u.reduce((e,t)=>Array.isArray(t)&&t.length?[...e,t[0]]:e,[])),this.addFeatureToGeoJsonList(c,n,r),Object.prototype.hasOwnProperty.call(i,l))return;if(d={symbolizers:[]},f===`Point`||f===`MultiPoint`)(r.getImage()!==null||r.getText()!==null)&&d.symbolizers.push(this.buildPointStyle(r,e));else if(f===`Polygon`||f===`MultiPolygon`)d.symbolizers.push(this.buildPolygonStyle(r,e));else if(f===`Circle`)d.symbolizers.push(this.buildPolygonStyle(r,e));else if(f===`LineString`||f===`MultiLineString`){if(e.values_.id===`measureLayer`&&r.stroke_===null)return;d.symbolizers.push(this.buildLineStringStyle(r,e))}r.getText()!==null&&r.getText()!==void 0&&d.symbolizers.push(this.buildTextStyle(r.getText())),l.includes(`@Datastreams`)&&(l=l.replaceAll(`@`,``).replaceAll(`.`,``)),i[l]=d}})}),i},getFeatureStyle:function(e,t){let n;if(e.getStyleFunction()!==void 0)try{n=e.getStyleFunction().call(e)}catch{n=e.getStyleFunction().call(this,e)}else n=t.getStyleFunction().call(t,e);return Array.isArray(n)?n:[n]},getStyleAttributes:function(e,t){let n=e.get(`id`),r=this.getStyleObject(n),i=[`styleId`];if(r!==void 0)if(e.get(`styleId`)){let a=ee(r,t)?.[0]?.conditions?.properties;a&&Object.keys(a).length>0?i=Object.keys(a):(console.warn(`Print: Missing conditions.properties for layer "${n}" and styleId "${e.get(`styleId`)}". Falling back to default style attribute.`),i=[`default`])}else i=[r.get(`styleField`)];return i},getStyleObject(e){let t=W.getLayerById(e);if(t||W.getLayers().forEach(n=>{if(n.get(`typ`)===`GROUP`){let r=n.getLayerSource().find(t=>t.attributes.id===e);r&&(t=r)}}),typeof t?.get==`function`)return Ft.returnStyleObject(t.get(`styleId`))},checkPolygon(e){if(Array.isArray(e.getGeometry().getCoordinates()[0])){let t=e.getGeometry().getCoordinates()[0];if(t[0][0]!==t[t.length-1][0]&&t[0][1]!==t[t.length-1][1]){let n=[];t.forEach(e=>{n.push(e)}),e.getGeometry().setCoordinates(n)}}return e},getStylingRules:function(e,t,n,r,i){let a=Ft.returnStyleObject(e.get(`styleId`)),o=a?Jt.getGeometryStyle(t,a.rules,!1,C
10onfig.wfsImgPath):void 0,s=``;if(Object.prototype.hasOwnProperty.call(t.getProperties(),`masterportal_attributes`)&&t.get(`masterportal_attributes`).styleId&&t.set(`styleId`,t.get(`masterportal_attributes`).styleId),s=t.get(`styleId`)?`styleId`:n,s.length===1&&s[0]===``){if(t.get(`features`)&&t.get(`features`).length===1){let e=new V({properties:t.get(`features`)[0].getProperties(),geometry:t.get(`features`)[0].getGeometry()});return t.get(`features`)[0]=e,r.getImage().getSrc().indexOf(`data:image/svg+xml;charset=utf-8`)===0?e.setId(`first_svg_`+e.ol_uid):e.setId(`second_png_`+e.ol_uid),e.set(e.getId(),String(t.get(`features`).length)),`[`+e.getId()+`='`+String(t.get(`features`).length)+`']`}return t.get(`features`)!==void 0&&r!==void 0&&r.getText().getText()!==void 0?(t.set(`sensorClusterStyle`,t.get(`features`)[0].ol_uid+`_`+String(r.getText().getText())),`[sensorClusterStyle='`+t.get(`features`)[0].ol_uid+`_`+String(r.getText().getText())+`']`):this.getFeatureStyle(t,e).length>1?(r.getImage().getSrc().indexOf(`data:image/svg+xml;charset=utf-8`)===0?t.setId(`first_svg_`+t.ol_uid):t.setId(`second_png_`+t.ol_uid),Object.keys(t.getProperties()).forEach(e=>{e===``&&t.unset(e)}),t.set(t.getId(),String(i)),`[`+t.getId()+`='`+String(i)+`']`):`*`}if(t.get(`features`)!==void 0){if(r!==void 0&&r?.getText()?.getText()!==void 0||t.get(`features`).length>1){let e=t.get(`features`)[0].get(s[0])+`_`+r!==void 0&&r.getText()?.getText()!==void 0?r.getText()?.getText():`cluster`;return t.set(s[0],e),`[${s[0]}='${e}']`}else if(r?.type){let e=t.get(`default`);return`[${s[0]}='${e}']`}return s.reduce((e,n)=>{let r=t.get(`features`)[0].get(n)===void 0?`*`:t.get(`features`)[0].get(n);return t.set(n,r),e+`${n}='${r}',`},`[`).slice(0,-1)+`]`}if(o?.attributes?.labelField?.length>0){let e=o.attributes.labelField;return s.reduce((n,r)=>n+`${r}='${t.get(r)}' AND ${e}='${t.get(e)}',`,`[`).slice(0,-1)+`]`}return s instanceof Array?s.reduce((e,n)=>e+`${n}='${t.get(n)}',`,`[`).slice(0,-1)+`]`:`[`+s+`='`+t.get(s)+`']`},unsetStringPropertiesOfFeature:function(e,t){Object.keys(e.getProperties()).forEach(n=>{let r=e.getProperties()[n];!t.includes(n)&&typeof r==`string`&&e.unset(n,{silent:!0})})},addFeatureToGeoJsonList:function(e,t,n){let r;e.get(`features`)&&e.get(`features`).length===1?e.get(`features`).forEach(i=>{e.getKeys().find(e=>e==="default")&&(i.setProperties({default:e.get(`default`)}),i.setId(e.getId())),r=this.convertFeatureToGeoJson(i,n),r&&t.push(r)}):(r=this.convertFeatureToGeoJson(e,n),r&&t.push(r))},convertFeatureToGeoJson:function(e,t){let n=e.clone(),r=new dn,i=t.getText()?.getText()||``,a;return Object.prototype.hasOwnProperty.call(n.getProperties(),`masterportal_attributes`)&&Object.keys(n.get(`masterportal_attributes`)).forEach(e=>{n.set(e,n.get(`masterportal_attributes`)[e])}),Object.keys(n.getProperties()).forEach(e=>{(q(n.get(e))&&!(n.get(e)instanceof qt)||Array.isArray(n.get(e)))&&n.unset(e)}),n.setId(n.ol_uid),n.set(`_label`,i),n.getGeometry().getType()===`Circle`&&n.setGeometry(et(n.getGeometry(),100)),Object.keys(n.getProperties()).filter(e=>{if(e.includes(`@Datastreams`)){let t=e.replaceAll(`@`,``).replaceAll(`.`,``);n.set(t,n.getProperties()[e]),n.unset(e,{silent:!0})}return!1}),n.unset(`Datastreams`,{silent:!0}),a=r.writeFeatureObject(n),this.isEmptyGeometry(n?.getGeometry?.())&&(a=void 0),a?.properties&&Object.prototype.hasOwnProperty.call(a.properties,`features`)&&delete a.properties.features,a},isEmptyGeometry(e){if(!e)return!0;let t=typeof e.getCoordinates==`function`,n=typeof e.getGeometries==`function`;return!!(t&&(!Array.isArray(e.getCoordinates())||e.getCoordinates().length===0)||n&&(!Array.isArray(e.getGeometries())||e.getGeometries().length===0))},buildPointStyle:function(e,t){return e.getImage()instanceof re?this.buildPointStyleCircle(e.getImage()):e.getImage()instanceof xe&&e.getImage().getScale()>0?this.buildPointStyleIcon(e.getImage(),t):this.buildTextStyle(e.getText())},buildPointStyleCircle:function(e){let t=e.getFill(),n=e.getStroke(),r={type:`point`,pointRadius:e.getRadius()};return t!==null&&(this.buildFillStyle(t,r),this.buildStrokeStyle(t,r)),n!==null&&this.buildStrokeStyle(n,r),r},buildFillStyle:function(e,t){let n=e.getColor();return n instanceof CanvasPattern&&(n=[0,0,0,0]),n[0]===`#`?(t.fillColor=n,t.fillOpacity=1):(t.fillColor=f_(n,`hex`),t.fillOpacity=n[3]),t},buildStrokeStyle:function(e,t){let n=e.getColor();return t.strokeColor=f_(n,`hex`),Array.isArray(n)&&n.length===4&&(t.strokeOpacity=n[3]),typeof e.getWidth==`function`&&e.getWidth()!==void 0&&(t.strokeWidth=e.getWidth()),typeof e.getLineDash==`function`&&e.getLineDash()&&(t.strokeLinecap=e.getLineCap(),e.getLineDash().length>1?t.strokeDashstyle=e.getLineDash().join(` `):t.strokeDashstyle=e.getLineDash()[0]+` `+e.getLineDash()[0],t.strokeDashOffset=e.getLineDashOffset()),t},buildPointStyleIcon:function(e,t){return{type:`point`,graphicWidth:e.getSize()[0]?e.getSize()[0]*e.getScale():60,graphicHeight:e.getSize()[1]?e.getSize()[1]*e.getScale():60,externalGraphic:this.buildGraphicPath(e.getSrc()),graphicOpacity:t.getOpacity()}},buildGraphicPath:function(e){let t=window.location.origin,n=Config.wfsImgPath+this.getImageName(e);return e.indexOf(`http`)===0&&e.indexOf(`localhost`)===-1?n=e:e.charAt(0)===`/`?n=t+e:e.indexOf(`../`)===0||e.indexOf(`./`)===0?n=new URL(e,window.location.href).href:e.indexOf(`data:image/svg+xml;charset=utf-8`)===0?n=e:t.indexOf(`localhost`)===-1&&(n=t+`/lgv-config/img/`+this.getImageName(e)),n},getImageName:function(e){let t=e.lastIndexOf(`/`);return e.indexOf(`/`)===-1?`/`+e:e.substring(t+1)},buildTextStyle:function(e){let t=e.getFont()?e.getFont():`bold 16px Helvetica`,n=this.getFontSize(t),r=n!==null,i=e.getScale()?e.getScale():1,a=r?n:10*i,o=r?this.getFontFamily(t,a):t,s=e.getFill
10().getColor(),c=e.getStroke()?e.getStroke():void 0;return{type:`text`,label:`[_label]`,fontColor:f_(s,`hex`),fontOpacity:s[0]===`#`?1:s[3],labelOutlineColor:c?f_(c.getColor(),`hex`):void 0,labelOutlineWidth:c?c.getWidth():void 0,labelXOffset:e.getOffsetX(),labelYOffset:-e.getOffsetY(),fontSize:a,fontFamily:o,labelAlign:this.getLabelAlign(e)}},getFontSize:function(e){let t=e?e.match(/\d/g):null;return Array.isArray(t)&&t.length>0?t.join(``):null},getFontFamily:function(e,t){let n=e?e.indexOf(` `,e.indexOf(t)):-1;return n>-1?e.substring(n+1):``},getLabelAlign:function(e){let t=e.getTextAlign();return t===`left`?`lb`:t===`right`?`rb`:t===`center`?`cm`:`cb`},buildPolygonStyle:function(e,t){let n=e.getFill(),r=e.getStroke(),i={type:`polygon`,fillOpacity:t.getOpacity(),strokeOpacity:t.getOpacity()};return n!==null&&this.buildFillStyle(n,i),r!==null&&this.buildStrokeStyle(r,i),i},buildLineStringStyle:function(e,t){let n=e.getStroke(),r={type:`line`,strokeOpacity:t.getOpacity()};return n!==null&&this.buildStrokeStyle(n,r),r},buildGfi:function(e,t){let n={},r,i;e&&(t.length>0&&(n.layers=[],r=t[0],i=t[1],n.layers.push({layerName:i.startsWith(`common:`)?i18next.t(i):i,values:this.prepareGfiAttributes(r)})),this.addGfiFeature(this.defaults.attributes.map.layers,t[2])),this.setShowGfi(e),this.setGfi(n)},addGfiFeature:function(e,t){let n=new dn,i=new V({geometry:new r(t),name:`GFI Point`});e.splice(0,0,{type:`geojson`,geojson:[n.writeFeatureObject(i)],style:{version:`2`,"[name='GFI Point']":{symbolizers:[{fillOpacity:0,pointRadius:18,strokeColor:`#e10019`,strokeWidth:3,type:`point`},{fillColor:`#e10019`,pointRadius:4,strokeOpacity:0,type:`point`}]}}})},prepareGfiAttributes:function(e){let t=[],n;for(n in e)t.push({key:n,value:e[n]});return t},buildLegend:async function(e,t,n,r){let i={},a=[],o=$.getters[`Modules/Legend/legends`],s={};if(e&&o.length>0){i.layers=[];for(let e of o)if(W.getLayerById(e.id)?.get(`children`)?.length>0&&(e.id=W.getLayerById(e.id).get(`children`)[0].id),this.defaults.visibleLayerIds.includes(e.id)){let n=this.legendContainsPdf(e.legend);t&&a.push(e.id),n?$.dispatch(`Alerting/addSingleAlert`,{category:`info`,content:`<b>${i18next.t(`common:modules.print.predefinedLegendInfo`,{layerName:e.name})}</b><br>${i18next.t(`common:modules.print.predefinedLegendDownload`)}`,displayClass:`info`,kategorie:`alert-info`}):await this.processLegendImage(e,s)}for(let e in s)i.layers.push({layerName:s[e].names.join(` / `),values:s[e].values})}if(this.setShowLegend(e),this.setLegend(i),t&&a.length>0)a.forEach(e=>{this.getMetaData(e,n,r)});else{let e={index:r,payload:this.defaults,getResponse:n};$.dispatch(`Modules/Print/createPrintJob`,e)}},async processLegendImage(e,t){let n=this.getLegendImageUrl(e),r=n?await this.hashImage(n):null;if(!n){console.warn(`No valid image URL for legend:`,e.name);return}if(!r){console.warn(`[Legend] Failed to generate hash for image:`,n,` (layer:`,e.name,`)`);return}this.updateHashMap(t,r,e)},getLegendImageUrl(e){let t=e.legend?.[0];return t?typeof t==`string`?t:t?.graphic||null:(console.warn(`[Legend] Missing legend entry for:`,e.name),null)},updateHashMap(e,t,n){e[t]?e[t].names.push(n.name):e[t]={names:[n.name],values:this.prepareLegendAttributes(n.legend,$.getters[`Modules/Legend/sldVersion`])}},async hashImage(e){try{let t=await(await fetch(e)).arrayBuffer(),n=await crypto.subtle.digest(`SHA-256`,t);return Array.from(new Uint8Array(n)).map(e=>e.toString(16).padStart(2,`0`)).join(``)}catch(t){return console.error(`Error hashing image ${e}:`,t),null}},legendContainsPdf:function(e){return e.some(e=>{let t=!1;if(typeof e==`object`&&!Array.isArray(e.graphic))t=e.graphic.endsWith(`.pdf`);else if(typeof e==`object`&&Array.isArray(e.graphic))return t;else t=e.endsWith(`.pdf`);return t})},prepareLegendAttributes:function(e,t=``){let n=[];return e.forEach(e=>{let r={legendType:``,geometryType:``,imageUrl:``,color:``,label:e.name},i=typeof e==`object`?e.graphic:e;Array.isArray(i)?(i.forEach(e=>{e.indexOf(`svg`)===-1?r.imageUrl=e:r.svg=decodeURIComponent(e).split(`data:image/svg+xml;charset=utf-8,`)[1]}),r.legendType=`svgAndPng`):i.indexOf(`<svg`)===-1?i.toUpperCase().includes(`GETLEGENDGRAPHIC`)?(r.legendType=`wmsGetLegendGraphic`,r.imageUrl=i+(t?`&sld_version=`+t:``)):(r.legendType=`wfsImage`,r.imageUrl=this.buildGraphicPath(i)):(r.geometryType=this.getGeometryTypeFromSVG(i),r.geometryType===`lineString`?r.svg=decodeURIComponent(i).split(`data:image/svg+xml;charset=utf-8,`)[1]:(r.color=this.getFillColorFromSVG(i),this.getFillStrokeFromSVG(i,r)),r.legendType=`geometry`),r.color!==void 0&&n.push(r)}),[].concat(...n)},getMetaData:function(e,t,n){let r=$.getters.layerConfigById(e),i=r.datasets&&r.datasets[0]?r.datasets[0].md_id:null,a=zr(),o={};i!==null&&(this.defaults.uniqueIdList.push(a),o.layerName=r.name,o.metaId=i,o.keyList=[`date`,`orgaOwner`,`address`,`email`,`tel`,`url`],o.uniqueId=a,o.layer=r,o.getResponse=t,o.index=n,$.dispatch(`Modules/Print/getMetaDataForPrint`,o))},buildScale:function(e){let t=`1:`+e;this.setScale(t)},setMetadata:function(e){this.defaults.attributes.metadata=e},setShowLegend:function(e){this.defaults.attributes.showLegend=e},setLegend:function(e){this.defaults.attributes.legend=e},setShowGfi:function(e){this.defaults.attributes.showGfi=e},setGfi:function(e){this.defaults.attributes.gfi=e},setScale:function(e){this.defaults.attributes.scale=e},setUniqueIdList:function(e){this.defaults.uniqueIdList=e},setVisibleLayerIds:function(e){this.defaults.visibleLayerIds=e},getGeometryTypeFromSVG:function(e){let t=``;return e.includes(`<circle`)&&(t=`point`),e.includes(`<polygon`)&&(t=`polygon`),e.includes(`<path`)&&(t=`lineString`),t},getFillColorFromSVG:function(e){let t=``;return(e.split(/fill:(.+)/)[1]||e.split(`fill='`)[1])&&(t=e.split(/fill:(.+)/)[1]?.split(/;(.+)/)[0]||e.split(`fill='`)[1]?.split(`'`)[0]),t.startsWith(`rgb(`)&&(e.split(/fill-opacity:(.+)/)[1]?.split(/;(.+)/)[0]||e.split(`fill-opacity='`)[1])&&(t=`rgba(${t.split(`)`)[0].split(`(`)[1]}, ${e.split(/fill-opacity:(.+)/)[1]?.split(/;(.+)/)[0]||e.split(/fill-opacity=(.+)/)[1]?.split(`'`)[1]})`),t},getFillStrokeFromSVG:function(e,t){(e.split(/stroke:(.+)/)[1]||e.split(`stroke='`)[1])&&(t.strokeColor=e.split(/stroke:(.+)/)[1]?.split(/;(.+)/)[0]||e.split(`stroke='`)[1]?.split(`'`)[0]),t.strokeColor?.startsWith(`rgb(`)&&(e.split(/stroke-opacity:(.+)/)[1]?.split(/;(.+)/)[0]||e.split(`stroke-opacity='`)[1]?.split(`'`)[0])&&(t.strokeColor=`rgba(${t.strokeColor.split(`)`)[0].split(`(`)[1]}, ${e.split(/stroke-opacity:(.+)/)[1]?.split(/;(.+)/)[0]||e.split(/stroke-opacity=(.+)/)[1]?.split(`'`)[1]}
10)`),(e.split(/stroke-width:(.+)/)[1]||e.split(`stroke-width='`)[1])&&(t.strokeWidth=e.split(/stroke-width:(.+)/)[1]?.split(/;(.+)/)[0]||e.split(`stroke-width='`)[1]?.split(`'`)[0]),e.split(/stroke-dasharray:(.+)/)[1]&&!e.split(/stroke-dasharray:(.+)/)[1]?.startsWith(`;`)&&(t.strokeStyle=`Dashed`)}},$v={getCanvasLayer:function(e){let t=$.getters[`Maps/resolution`],n=[],r={};e.forEach(e=>{n.push(this.buildCanvasLayerType(e,t))});for(let e of n)e!==void 0&&(r=e);return r},buildCanvasLayerType:function(e,t){let n=$.getters[`Maps/extent`],r=e.getMinResolution(),i=e.getMaxResolution(),a=this.isInScaleRange(r,i,t),o=[],s;return a&&(e instanceof an||e instanceof Gt||e instanceof be?s=e:e instanceof Rt&&(o=e.getSource().getFeaturesInExtent(n),o.length>0&&(s=e))),s},isInScaleRange:function(e,t,n){let r=!1;return e<=n&&t>=n&&(r=!0),r}};function ey(e=!1){let t=ny(e),n=ty(t);n.length>0&&(t=t.filter(e=>!(e instanceof ft)),n.forEach(e=>{let n=typeof e.getZIndex==`function`?e.getZIndex():void 0;e.getLayers().forEach(r=>{r.setOpacity(e.getOpacity()),n!==void 0&&r.setZIndex(n),t.push(r)})})),iy(t)}function ty(e){let t=null;return t=e.filter(e=>e instanceof ft),t}function ny(e=!1){let t=mapCollection.getMap(`2D`).getLayers();return typeof t?.getArray==`function`?t.getArray().filter(t=>t.getVisible()===!0&&(t.get(`name`)!==`markerPoint`||e)):[]}function ry(e=!1){let t=this.getVisibleLayerList(e),n=this.getGroupedLayers(t);n.length>0&&n.forEach(e=>{e.getLayers().forEach(e=>{e.setOpacity(1)})})}function iy(e){let t=$.getters[`Maps/getResolutionByScale`]($.getters[`Modules/Print/currentScale`],`max`),n=$.getters[`Maps/getResolutionByScale`]($.getters[`Modules/Print/currentScale`],`min`),r=[],i=[],a=``;e.forEach(e=>{if(t>e.getMaxResolution()||n<e.getMinResolution()){let t=Array.isArray(e.get(`name`))?e.get(`name`)[0]:e.get(`name`);r.push(e),a+=`- `+t+`<br>`}else i.push(e)}),$.commit(`Modules/Print/setInvisibleLayer`,r),$.commit(`Modules/Print/setInvisibleLayerNames`,a),$.dispatch(`Modules/Print/setVisibleLayerList`,_r.sortVisibleLayerListByZindexBeforePrint(i))}var ay={getVisibleLayer:ey,getGroupedLayers:ty,getVisibleLayerList:ny,revertLayerOpacity:ry},oy={retrieveCapabilites:function({state:e,dispatch:t,rootGetters:n,commit:r}){let i;e.serviceId!==``&&(i=n.restServiceById(e.serviceId).url,e.printService!==`plotservice`&&!i.includes(`/print/`)&&(i+=`print/`),r(`setServiceUrl`,i),i=i+e.printAppId+`/`+e.printAppCapabilities,t(`sendRequest`,{serviceUrl:i,requestType:`GET`,onSuccess:`parseCapabilities`}))},parseCapabilities:function({state:e,dispatch:t},n){e.printService===`mapfish`?t(`parseMapfishCapabilities`,n):t(`parsePlotserviceCapabilities`,n)},parseMapfishCapabilities:function({state:e,commit:t,dispatch:n,rootGetters:r},i){t(`setLayoutList`,i.layouts),n(`chooseCurrentLayout`,i.layouts),n(`getAttributeInLayoutByName`,`metadata`),n(`getAttributeInLayoutByName`,`gfi`),n(`getAttributeInLayoutByName`,`legend`),n(`getAttributeInLayoutByName`,`scale`),n(`setDpiList`),n(`ensureDpiForPdfInList`),t(`setFormatList`,e.formatList),t(`setCurrentScale`,r[`Maps/scale`]),n(`togglePostrenderListener`),e.isGfiAvailable&&(n(`getGfiForPrint`),Qv.buildGfi(e.isGfiSelected,e.gfiForPrint))},parsePlotserviceCapabilities:function({state:e,commit:t,dispatch:n,rootGetters:r},i){t(`setLayoutList`,i.layouts),n(`chooseCurrentLayout`,i.layouts),t(`setScaleList`,i.scales.map(e=>parseInt(e.value,10)).sort((e,t)=>e-t)),t(`setFormatList`,i.outputFormats.map(e=>e.name)),t(`setCurrentScale`,r[`Maps/scale`]),n(`togglePostrenderListener`),e.isGfiAvailable&&(n(`getGfiForPrint`),Qv.buildGfi(e.isGfiSelected,e.gfiForPrint))},chooseCurrentLayout:function({state:e,commit:t},n){let r=n.find(t=>t.name===e.currentLayoutName)||n[0];r&&(t(`setCurrentLayout`,r),t(`setCurrentLayoutName`,r.name))},getGfiForPrint:function({commit:e,rootGetters:t}){t[`Modules/GetFeatureInfo/currentFeature`]!==null&&typeof t[`Modules/GetFeatureInfo/currentFeature`]?.getMappedProperties==`function`&&typeof t[`Modules/GetFeatureInfo/currentFeature`]?.getTitle==`function`?e(`setGfiForPrint`,[t[`Modules/GetFeatureInfo/currentFeature`].getMappedProperties(),t[`Modules/GetFeatureInfo/currentFeature`].getTitle(),t[`Maps/clickCoordinate`]]):e(`setGfiForPrint`,[])},getAttributeInLayoutByName:function({state:e,commit:t}
10,n){e.currentLayout.attributes.forEach(e=>{if(e.name===n){let r=n.charAt(0).toUpperCase()+n.slice(1);t(`setIs`+r+`Available`,!0),t(`set`+r+`Attribute`,e)}})},setDpiList:function({state:e,commit:t}){e.currentLayout.attributes.forEach((n,r)=>{n.name===`map`&&t(`setDpiList`,e.currentLayout.attributes[r].clientInfo?.dpiSuggestions||[])})},ensureDpiForPdfInList:function({state:e,commit:t}){e.dpiList.length&&!e.dpiList.includes(e.dpiForPdf)&&t(`setDpiForPdf`,e.dpiList[0])},update3DResolutionScale:function({state:e}){mapCollection.getMap(`3D`).setResolutionScale(e.isIncreased3DResolutionSelected?2:1)},togglePostrenderListener:function({state:e,dispatch:t,commit:n},r=!0){let i=[],a=mapCollection.getMap(`3D`);if(ay.getVisibleLayer(e.printMapMarker),ay.revertLayerOpacity(e.printMapMarker),i.length&&r&&t(`Alerting/addSingleAlert`,{category:`warning`,content:i18next.t(`common:modules.print.vtlWarning`)},{root:!0}),n(`setVisibleLayer`,e.visibleLayerList),r&&e.layoutList.length!==0&&e.visibleLayerList.length>=1){e.eventListener!==void 0&&(t(`Maps/unregisterListener`,{type:e.eventListener},{root:!0}),n(`setEventListener`,void 0));let r=$v.getCanvasLayer(e.visibleLayerList);Object.keys(r).length>0&&n(`setEventListener`,r.on(`postrender`,e=>t(`createPrintMask`,e))),sy(e,t,a)}r||(t(`Maps/unregisterListener`,{type:e.eventListener},{root:!0}),n(`setEventListener`,void 0),a&&Ke(a.getCesiumScene(),null)),mapCollection.getMap(`2D`).render()},setPrintLayers:function({dispatch:e,commit:t,getters:n},r){let i=[],a=``;ay.getVisibleLayer(n.printMapMarker),i=n.invisibleLayer,a=i18next.t(`common:modules.print.invisibleLayer`,{scale:`1: `+Pm(r,`.`)}),a=a+`<br>`+n.invisibleLayerNames,i.length&&a!==n.hintInfo&&n.showInvisibleLayerInfo&&(e(`Alerting/addSingleAlert`,{category:`info`,content:a},{root:!0}),t(`setHintInfo`,a)),i.length||t(`setHintInfo`,``),t(`setInvisibleLayer`,i)},updateCanvasLayer:function({state:e,commit:t,dispatch:n}){let r=e.visibleLayerList,i={};e.currentScaleUrlParams&&=void 0,n(`Maps/unregisterListener`,{type:e.eventListener},{root:!0}),i=$v.getCanvasLayer(r),n(`chooseCurrentLayout`,e.layoutList),Object.keys(i).length&&t(`setEventListener`,i.on(`postrender`,e=>{n(`createPrintMask`,e)}))},compute3dPrintMask:function({dispatch:e}){e(`getPrintMapSize`),e(`getPrintMapScales`)},createPrintMask:function({dispatch:e,state:t},n){e(`getPrintMapSize`),e(`getPrintMapScales`);let r=n.frameState,i=n.context,a={frameState:r,context:i},o={pixelToCoordinateTransform:r.pixelToCoordinateTransform,mapSize:r.size,resolution:r.viewState.resolution,rotation:r.viewState.rotation,printMapSize:t.layoutMapInfo,scale:``,context:i},s={mapSize:r.size,resolution:r.viewState.resolution,printMapSize:t.layoutMapInfo,scaleList:t.scaleList};t.isScaleSelectedManually?o.scale=t.currentScale:t.autoAdjustScale?(e(`getOptimalScale`,s),t.currentScaleUrlParams?o.scale=t.currentScaleUrlParams:o.scale=t.optimalScale):(t.currentScaleUrlParams&&(t.currentScale=t.currentScaleUrlParams),o.scale=t.currentScale),e(`drawMask`,a),e(`drawPrintPage`,o),i.fillStyle=`rgba(0, 5, 25, 0.55)`,i.fill(),e(`setPrintLayers`,o.scale)},getOptimalScale:function({commit:e,state:t},n){let r=n.mapSize[0]*n.resolution,i=n.mapSize[1]*n.resolution,a=r*t.INCHES_PER_METER*t.DOTS_PER_INCH/n.printMapSize[0],o=i*t.INCHES_PER_METER*t.DOTS_PER_INCH/n.printMapSize[1],s=Math.min(a,o),c=n.scaleList[0];n.scaleList.forEach(e=>{s>e&&(c=e)}),e(`setOptimalScale`,c),e(`setCurrentScale`,t.currentScaleUrlParams?t.currentScaleUrlParams:c)},drawMask:function(e,t){let n=t.context,r=t.frameState.viewState.rotation,i=n.canvas.width,a=n.canvas.height,o=-i,s=i,c=-a,l=a;n.save(),n.translate(i/2,a/2),n.rotate(-r),n.beginPath(),n.rect(o,c,s-o,l-c),n.closePath(),n.restore()},drawPrintPage:function({state:e},t){let n=t.context.canvas,r=n.width,i=n.height,a=r>t.mapSize[0]?de:1,o=[t.mapSize[0]*a/2,t.mapSize[1]*a/2],s=t.printMapSize[0]/e.DOTS_PER_INCH/e.INCHES_PER_METER*t.scale/t.resolution*de,c=t.printMapSize[1]/e.DOTS_PER_INCH/e.INCHES_PER_METER*t.scale/t.resolution*de,l=o[0]-s/2,u=o[1]-c/2,d=o[0]+s/2,f=o[1]+c/2,p=-(s/2),m=s/2,h=-(c/2),g=c/2,_=t.pixelToCoordinateTransform,v=ln(_,[l,u]),ee=ln(_,[d,f]),te=kt(),y=t.rotation;t.context.save(),t.context.translate(r/2,i/2),t.context.rotate(-y),t.context.moveTo(p,h),t.context.lineTo(p,g),t.context.lineTo(m,g),t.context.lineTo(m,h),t.context.lineTo(p,h),t.context.closePath(),t.context.restore(
10),it(te,v),it(te,ee),Qv.setLastPrintedExtent(te)},getOptimalResolution:function({commit:e,state:t},n){let r=t.INCHES_PER_METER*t.DOTS_PER_INCH,i=n.printMapSize[0]*n.scale/(r*n.mapSize[0]),a=n.printMapSize[1]*n.scale/(r*n.mapSize[1]);e(`setOptimalResolution`,Math.max(i,a))},getPrintMapSize:function({state:e,commit:t,dispatch:n}){if(e.printService===`plotservice`){let n=e.currentLayout.map;t(`setLayoutMapInfo`,[n.width,n.height])}else{n(`getAttributeInLayoutByName`,`map`);let r=e.mapAttribute.clientInfo;t(`setLayoutMapInfo`,[r.width,r.height])}},getPrintMapScales:function({state:e,dispatch:t,commit:n}){if(e.printService!==`plotservice`){t(`getAttributeInLayoutByName`,`map`);let r=e.mapAttribute.clientInfo;n(`setScaleList`,r.scales.sort((e,t)=>e-t))}}};function sy(e,t,n){n&&Ke(n.getCesiumScene(),()=>{let r={ol3d:n};return t(`compute3dPrintMask`),r.printRectangle=ce(r.ol3d.getCesiumScene().canvas,e.layoutMapInfo[0],e.layoutMapInfo[1]),r.printRectangle.scaling})}var cy={...oy,sendRequest:function({dispatch:e},t){let n=t.serviceUrl;B({url:n,type:t.requestType}).then(n=>{Object.prototype.hasOwnProperty.call(t,`index`)&&(n.data.index=t.index),e(String(t.onSuccess),n.data)})},activatePrintStarted:function({commit:e}){e(`setPrintStarted`,!0)},setVisibleLayerList:function({commit:e},t){e(`setVisibleLayerList`,t)},startPrint3d:async function({state:e,dispatch:t,commit:n},r){n(`setProgressWidth`,`width: 25%`);let i=mapCollection.getMap(`3D`),a=i.getOlMap().getView(),o=a.getProjection().getCode(),s=(function(){let n={ol3d:i};return t(`compute3dPrintMask`),n.printRectangle=ce(n.ol3d.getCesiumScene().canvas,e.layoutMapInfo[0],e.layoutMapInfo[1]),n.printRectangle})(),c=await u(i.getCesiumScene(),s),l=(function(){let e=a.getResolution(),t=a.getCenter(),n=s.width,r=s.height;return[t[0]-n/2*e,t[1]-r/2*e,t[0]+n/2*e,t[1]+r/2*e]})(),d={type:`image`,name:`Cesium`,opacity:1,imageFormat:`image/png`,extent:l,baseURL:c},f={layout:e.currentLayoutName,outputFilename:e.filename,outputFormat:e.currentFormat,attributes:{title:e.title,is3dMode:!0,map:{dpi:e.dpiForPdf,projection:o,bbox:l,useNearestScale:!1,useAdjustBounds:!1}}},p=Qv;Object.assign(f.attributes,r.layoutAttributes),p.setAttributes(f),e.isMetadataAvailable&&p.setMetadata(!0),e.isScaleAvailable&&p.buildScale(e.currentScale),await p.buildLayers(e.visibleLayerList),p.defaults.attributes.map.layers=[d],delete p.defaults.attributes.map.scale,delete p.defaults.attributes.map.center,p.defaults.attributes.map.bbox=d.extent,e.isGfiAvailable&&(t(`getGfiForPrint`),p.buildGfi(e.isGfiSelected,e.gfiForPrint)),e.isLegendAvailable?p.buildLegend(e.isLegendSelected,e.isMetadataAvailable,r.getResponse,r.index):(p.setLegend({}),p.setShowLegend(!1),p=ed(p,[`uniqueIdList`]),t(`createPrintJob`,{index:r.index,payload:p.defaults,printAppId:e.printAppId,currentFormat:e.currentFormat,getResponse:r.getResponse}))},startPrint:async function({state:e,getters:t,dispatch:n,commit:r},i){r(`setProgressWidth`,`width: 25%`),ay.getVisibleLayer(e.printMapMarker);let a=Array.isArray(t.activeAdditionalLayers)?[...t.visibleLayerList,...t.activeAdditionalLayers]:[...t.visibleLayerList],o={layout:e.currentLayoutName,outputFilename:e.filename,outputFormat:e.currentFormat,attributes:{title:e.title,...e.transferParameter,map:{dpi:e.dpiForPdf,projection:mapCollection.getMapView(`2D`).getProjection().getCode(),center:mapCollection.getMapView(`2D`).getCenter(),rotation:mapCollection.getMapView(`2D`).getRotation()*(180/Math.PI),scale:e.currentScale}}},s=Qv,c={};Object.assign(o.attributes,i.layoutAttributes),s.setAttributes(o),e.isMetadataAvailable&&s.setMetadata(!0),e.isScaleAvailable&&s.buildScale(e.currentScale),await s.buildLayers(a),e.isGfiAvailable&&(n(`getGfiForPrint`),s.buildGfi(e.isGfiSelected,e.gfiForPrint)),e.isLegendAvailable?s.buildLegend(e.isLegendSelected,e.isMetadataAvailable,i.getResponse,i.index):(s.setLegend({}),s.setShowLegend(!1),s=ed(s,[`uniqueIdList`]),c={index:i.index,payload:s.defaults,printAppId:e.printAppId,currentFormat:e.currentFormat,getResponse:i.getResponse},n(`createPrintJob`,c))},getMetaDataForPrint:async function({dispatch:e,rootGetters:t},n){let r=n,i;if(r.cswUrl=r.layer?.datasets?.[0]?.csw_url,r.parsedData={},r.cswUrl===null||r.cswUrl===void 0){let e=Config.cswId||`3`;r.cswUrl=t.restServiceById(e).url}if(i=(t.metadata?.useProxy?.includes(r.cswUrl),await El.getRecordById(r.cswUrl,r.metaId)),i===void 0)e(`Alerting/addSingleAlert`,{category:`error`,content:i18next.t(`common:modules.print.errorMessage`,{cswObjCswUrl:r.cswUrl})},{root:!0});else{r.parsedData={},r.parsedData.orgaOwner=i.getPublisher().name||`n.N.`,r.parsedData.address={street:i.getPublisher().street||``,housenr:``,postalCode:i.getPublisher().postalCode||``,city:i.getPublisher().city||``},r.parsedData.email=i.getPublisher().email||`n.N.`,r.parsedData.tel=i.getPublisher().phone||`n.N.`,r.parsedData.url=i.getPublisher().link||`n.N.`,i.getRevisionDate(
10)===void 0?i.getPublicationDate()===void 0?i.getCreationDate()!==void 0&&(r.parsedData.date=i.getCreationDate()):r.parsedData.date=i.getPublicationDate():r.parsedData.date=i.getRevisionDate(),r.parsedData.periodicity=i18next.t(i.getFrequenzy())||`n.N.`;let e=r.layer?.datasets?.[0]?.show_doc_url,t=r.layer?.datasets?.[0]?.md_id;e&&t&&(r.parsedData.catalogueLink=e+t)}Qv.fetchedMetaData(r)},createPrintJob:async function({state:e,dispatch:t,rootGetters:n,commit:r},i){let a=i,o=a.printAppId||e.printAppId,s=a.format||e.currentFormat,c=``,l=``,u=e.serviceUrl,d=e.filename;if(e.printService!==`plotservice`&&!e.serviceUrl.includes(`/print/`)&&(u=e.serviceUrl+`print/`,d=e.filename+`.`+e.outputFormat),r(`setPrintFileReady`,!1),e.serviceUrl===``){let t;t=e.printServiceId!==``&&e.printServiceId!==void 0?n.restServiceById(e.printServiceId).url:n.restServiceById(`mapfish`).url,e.printService!==`plotservice`&&!t.includes(`/print/`)&&(t+=`print/`),r(`setServiceUrl`,t),u=e.serviceUrl}c=e.printService===`plotservice`?u+`/create.json`:u+o+`/report.`+s,r(`setProgressWidth`,`width: 50%`),typeof a.getResponse==`function`&&(e.printService===`plotservice`&&(a.payload=await t(`migratePayload`,a.payload)),l=await a.getResponse(c,a.payload)),`getURL`in l.data?(await r(`setPlotserviceIndex`,e.plotserviceIndex+1),t(`downloadFile`,{fileUrl:l.data.getURL,index:e.plotserviceIndex,filename:d})):(l.data.index=a.index,t(`waitForPrintJob`,l.data))},migratePayload:function({state:e,rootState:t},n){let r={},i=encodeURIComponent(JSON.stringify(n)),a=decodeURIComponent(i).replace(/imageFormat/g,`format`).replace(/image\/[^"]*/g,`image/png`).replace(/"TRANSPARENT":"false"/gi,`"TRANSPARENT":"true"`),o=JSON.parse(a),s=t?.Maps?.scale,c=t?.Maps?.resolution,l=o.attributes.map.center,u=e.layoutMapInfo,d=u[0]/e.DOTS_PER_INCH/e.INCHES_PER_METER*s/c*de,f=u[1]/e.DOTS_PER_INCH/e.INCHES_PER_METER*s/c*de,p=d*c/2,m=f*c/2,h=o.layout,g=t.Maps.projection.code_;return r.layout=h,r.srs=o.attributes.map.projection,r.layers=o.attributes.map.layers,r.layers.forEach(e=>{e.styles=[``]}),r.pages=[{center:l,scale:String(o.attributes.map.scale),scaleText:`Ca. 1 : `+o.attributes.map.scale,geodetic:!0,dpi:String(o.attributes.map.dpi),mapTitle:o.attributes.title}],r.outputFilename=e.filename+`_`,r.outputFormat=e.outputFormat,h.indexOf(`Legende`)>0&&(r.legend=!0),r.addparam===void 0&&(r.addparam={}),r.addparamtype=`default`,r.addparam.bboxwest=String(Math.round((l[0]-p)*10)/10)+` (`+g+`)`,r.addparam.bboxsouth=String(Math.round((l[1]-m)*10)/10)+` (`+g+`)`,r.addparam.bboxeast=String(Math.round((l[0]+p)*10)/10),r.addparam.bboxnorth=String(Math.round((l[1]+m)*10)/10),r.geometries=e.geometries,JSON.stringify(r)},waitForPrintJob:async function({state:e,dispatch:t,commit:n},r){let i=``;e.printService!==`plotservice`&&!e.serviceUrl.includes(`/print/`)&&(i=`print/`);let a=e.printAppId,o=e.serviceUrl+i+a+`/status/`+r.ref+`.json`,s={index:r.index,serviceUrl:o,requestType:`GET`,onSuccess:`waitForPrintJobSuccess`};n(`setProgressWidth`,`width: 75%`),t(`sendRequest`,s)},waitForPrintJobSuccess:async function({state:e,dispatch:t,commit:n},r){let i=``;if(e.printService!==`plotservice`&&!e.serviceUrl.includes(`/print/`)&&(i=`print/`),r.status===`error`||r.data?.status===`error`)t(`Alerting/addSingleAlert`,{category:`error`,content:i18next.t(`common:modules.print.waitForPrintErrorMessage`)},{root:!0}),console.error(`Error: `+r.error),n(`setPrintStarted`,!1),n(`setFileDownloads`,[]);else if(r.done){n(`setProgressWidth`,`width: 100%`);let a=r.downloadURL.lastIndexOf(`/`),o=r.downloadURL.substr(a);t(`downloadFile`,{index:r?.index,fileUrl:e.serviceUrl+i+e.printAppId+`/report`+o,filename:e.filename})}else n(`setProgressWidth`,`width: 80%`),setTimeout(()=>{let n=r.downloadURL.lastIndexOf(`/`),a=r.downloadURL.substr(n),o=e.serviceUrl+i+e.printAppId+`/status`+a+`.json`;t(`sendRequest`,{index:r.index,serviceUrl:o,requestType:`GET`,onSuccess:`waitForPrintJobSuccess`})},2e3)},downloadFile:function({commit:e},t){let n=t.fileUrl;e(`setPrintStarted`,!1),e(`setPrintFileReady`,!0),e(`setFileDownloadUrl`,n),e(`setFilename`,t.filename),t.index!==void 0&&e(`updateFileDownload`,{index:t.index,finishState:!0,downloadUrl:n})}
10,urlParams({commit:e},t){Object.keys(t).forEach(n=>{e(`set${ra.upperFirst(n)}`,t[n])})}},ly={description:`common:modules.print.description`,filename:`report`,icon:`bi-printer`,name:`common:modules.print.name`,supportedDevices:[`Desktop`,`Mobile`,`Table`],supportedMapModes:[`2D`,`3D`],title:`PrintResult`,type:`print`,additionalLayers:[],autoAdjustScale:!0,currentFormat:`pdf`,capabilitiesFilter:{},currentLayout:void 0,currentLayoutName:`A4 Hochformat`,currentMapScale:``,currentScale:void 0,currentScaleUrlParams:void 0,customLayoutSelectionComponent:``,defaultCapabilitiesFilter:{},dpiForPdf:200,dpiList:[],DOTS_PER_INCH:72,eventListener:void 0,eventListener3d:void 0,fileDownloads:[],fileDownloadUrl:``,formatList:[`gif`,`pdf`,`png`,`svg`,`tif`,`tiff`],gfiAttribute:null,gfiForPrint:null,hintInfo:``,hintInfoScale:``,INCHES_PER_METER:39.37,invisibleLayer:[],invisibleLayerNames:[],is3d:!1,isGfiActive:!1,isGfiAvailable:!1,isGfiSelected:!1,isIncreased3DResolutionSelected:!1,isLegendAvailable:!1,isLegendSelected:!1,isMapAvailable:!1,isMetadataAvailable:!1,isScaleAvailable:!1,isScaleSelectedManually:!1,legendLabel:`common:modules.print.withLegendLabel`,layoutList:[],layoutMapInfo:[],layoutNameList:[],legendAttribute:null,mapAttribute:null,metadataAttribute:null,optimalResolution:``,optimalScale:null,outputFormat:`pdf`,overviewmapLayerId:void 0,plotserviceIndex:-1,printAppCapabilities:`capabilities.json`,printAppId:`master`,printFileReady:!1,printMapMarker:!1,printService:`mapfish`,printServiceId:``,printStarted:!1,progressWidth:`width: 0%`,scaleAttribute:null,scaleList:[],showInvisibleLayerInfo:!0,serviceUrl:``,serviceId:``,transferParameter:{},visibleLayer:[],visibleLayerList:[],zoomLevel:null},uy={...U(ly),addFileDownload:(e,t)=>{e.fileDownloads.push(t)},updateFileDownload:(e,t)=>{let n=t.index;e.fileDownloads[n]=Object.assign(e.fileDownloads[n],t)},setAutoAdjustScale:(e,t)=>{e.autoAdjustScale=t,e.isScaleSelectedManually=!1},setAdditionalLayerActive(e,t){e.additionalLayers.find(e=>e.id===t).active=!0},setAdditionalLayerInactive(e,t){e.additionalLayers.find(e=>e.id===t).active=!1}},dy={...H(ly),activeAdditionalLayers:e=>e.additionalLayers.filter(e=>e.active).map(e=>Ff.createLayer(jt.getLayerWhere({id:e.id}
10),`2D`).layer),urlParams:e=>({autoAdjustScale:e.autoAdjustScale,isScaleSelectedManually:e.isScaleSelectedManually,currentFormat:e.currentFormat,currentLayoutName:e.currentLayoutName,currentScale:e.currentScale,currentScaleUrlParams:e.currentScale,dpiForPdf:e.dpiForPdf,title:e.title,isGfiSelected:e.isGfiSelected,isLegendSelected:e.isLegendSelected})},fy={namespaced:!0,state:{...ly},mutations:uy,actions:cy,getters:dy},py={mainMenuWidth:0,secondaryMenuWidth:0},my={...H(py)},hy={...U(py)},gy={namespaced:!0,state:{...py},mutations:hy,getters:my},X={type:`routing`,hasMouseMapInteractions:!0,description:`common:modules.routing.description`,name:`common:modules.routing.name`,icon:`bi-signpost-2`,supportedDevices:[`Desktop`,`Mobile`,`Table`],supportedMapModes:[`2D`],activeRoutingToolOption:`DIRECTIONS`,routingToolOptions:[],taskHandler:null,download:{fileName:``,format:`GEOJSON`},geosearch:{minChars:3,limit:10,bbox:``,type:null,serviceId:null,epsg:`4326`,searchField:null,sortField:null,typeName:null,propertyNames:null,geometryName:null},geosearchReverse:{type:null,serviceId:null,distance:1e3,filter:null},directionsSettings:{type:null,serviceId:null,speedProfile:`CAR`,preference:`RECOMMENDED`,elevation:!1,avoidRadius:.005,maxAvoidRadius:12,defaultAvoidRadius:.005,styleRoute:{fillColor:[255,44,0,1],width:6,highlightColor:[255,255,255,1],highlightWidth:9,partHighlightColor:[255,255,255,1],partHighlightWidth:3},styleWaypoint:{lineColor:[255,127,0],lineWidth:4,fillColor:[255,127,0],textFillColor:`#000`,textLineColor:`#fff`,textLineWidth:3,opacity:.3,radius:8},styleAvoidAreas:{lineColor:[0,127,255],lineWidth:2,fillColor:[0,127,255],opacity:.3,pointRadius:8,pointLineWidth:4},styleElevationProfile:{profileColor:`#fe2c00`,profileFillColor:`#fccac0`,elevationPointLineColor:[0,0,0,1],elevationPointFillColor:[125,125,125,1]},batchProcessing:{enabled:!1,active:!1,limit:1e3,maximumConcurrentRequests:3},avoidAreaOptions:{maxFeatures:50,maxArea:2e5,maxSideLength:2e4}},isochronesSettings:{type:null,serviceId:null,speedProfile:`CAR`,isochronesMethodOption:`TIME`,distanceValue:30,minDistance:1,maxDistance:400,timeValue:30,minTime:1,maxTime:180,intervalOption:`default`,intervalValue:15,minInterval:3,maxInterval:30,attributes:[],areaUnit:`km`,styleCenter:{lineColor:[255,127,0],lineWidth:4,fillColor:[255,127,0],opacity:.3,radius:8},styleIsochrones:{lineWidth:2,opacity:.65,startColor:[66,245,78],endColor:[245,66,66]},batchProcessing:{enabled:!1,active:!1,limit:1e3,maximumConcurrentRequests:3}},tsrSettings:{type:null,serviceId:null,speedProfile:`CAR`,preference:`RECOMMENDED`,elevation:!1,tsrPointLimit:50,styleRoute:{fillColor:[255,44,0],width:6},styleWaypoint:{lineColor:[255,127,0],lineWidth:4,fillColor:[255,127,0],textFillColor:`#000`,textLineColor:`#fff`,textLineWidth:3,opacity:.3,radius:8},styleElevationProfile:{profileColor:`#32a9e8`,profileFillColor:`#8cc7e6`,elevationPointLineColor:[0,0,0,1],elevationPointFillColor:[125,125,125,1]}}},_y={...U(X),updateStateFromUrlParams:(e,t)=>{[`directionsSettings`,`isochronesSettings`,`Directions`,`Isochrones`].forEach(n=>{Object.assign(e[n],t[n])}),e.activeRoutingToolOption=t.activeRoutingToolOption||e.activeRoutingToolOption}},vy=class{constructor(e,t,n){this.coordinates=e,this.displayName=t,this.epsg=n}getDisplayName(){return this.displayName}setDisplayName(e){this.displayName=e}getCoordinates(){return this.coordinates}setCoordinates(e){this.coordinates=e}getEpsg(){return this.epsg}setEpsg(e){this.epsg=e}};async function yy(e){let t=by(e),n=await B.get(t);if(n.status!==200&&!n.data.success)throw Error({status:n.status,message:n.statusText});return n.data.map(e=>Cy(e))}function by(e){let t=$.getters.restServiceById(X.geosearch.serviceId).url,n=new URL(t);return n.searchParams.set(`countrycodes`,`de`),n.searchParams.set(`format`,`json`),n.searchParams.set(`limit`,X.geosearch.limit),n.searchParams.set(`bounded`,`1`),n.searchParams.set(`q`,encodeURIComponent(e)),n}async function xy(e){let t=Sy(e),n=await B.get(t);if(n.status!==200&&!n.data.success)throw Error({status:n.status,message:n.statusText});return Cy(n.data)}function Sy(e){let t=$.getters.restServiceById(X.geosearchReverse.serviceId).url,n=new URL(t);return n.searchParams.set(`lon`,e[0]),n.searchParams.set(`lat`,e[1]),n.searchParams.set(`format`,`json`),n.searchParams.set(`addressdetails`,`0`),n}function Cy(e){return new vy([Number(e.lat),Number(e.lon)],e.display_name)}async function wy(e){let t=await Ty(e),n=await B.get(t,window.location.href);if(n.status!==200&&!n.data.success)throw Error({status:n.status,message:n.statusText});return n.data.features.map(e=>Oy(e))}async function Ty(e){let t=$.getters.restServiceById(X.geosearch.serviceId).url,n=await ky(),r=await n!==!1&&n,i;
10return i=t.startsWith(`/`)?new URL(t,window.location.origin):new URL(t),i.searchParams.set(`count`,X.geosearch.limit),i.searchParams.set(`properties`,`text`),i.searchParams.set(`query`,encodeURIComponent(e)),r&&i.searchParams.set(`bbox`,r),i}function Ey(e){let t=$.getters.restServiceById(X.geosearchReverse.serviceId).url,n=new URL(t);return n.searchParams.set(`lon`,e[0]),n.searchParams.set(`lat`,e[1]),n.searchParams.set(`count`,`1`),n.searchParams.set(`properties`,`text`),n.searchParams.set(`distance`,X.geosearchReverse.distance),n.searchParams.set(`filter`,X.geosearchReverse.filter?X.geosearchReverse.filter:`typ:ort`),n}async function Dy(e){let t=await B.get(Ey(e));if(t.status!==200&&!t.data.success)throw Error({status:t.status,message:t.statusText});return Oy(t.data.features[0])}function Oy(e){return new vy([Number(e.geometry.coordinates[0]),Number(e.geometry.coordinates[1])],e.properties.text)}function ky(){let e=X.directionsSettings.speedProfile;return X.geosearch.bbox!==``&&X.geosearch.bbox[e]?X.geosearch.bbox[e]:!1}async function Ay(e){let t=jy(e),n=await B.get(t);if(n.status!==200&&!n.data.success)throw Error({status:n.status,message:n.statusText});return n.data.locs.map(e=>(e.epsg=n.data.sref,My(e)))}function jy(e){let t=$.getters.restServiceById(X.geosearch.serviceId).url,n=null;return t.endsWith(`/`)?t+=`Lookup`:t+=`/Lookup`,n=new URL(t),n.searchParams.set(`limit`,X.geosearch.limit),n.searchParams.set(`properties`,`text`),n.searchParams.set(`query`,e),n}function My(e){return new vy([Number(e.cx),Number(e.cy)],e.name,e.epsg.toString())}async function Ny(e){let t=mapCollection.getMap(`2D`),n=j.transformFromMapProjection(t,`EPSG:4326`,[$.getters[`Maps/extent`][0],$.getters[`Maps/extent`][1]]),r=j.transformFromMapProjection(t,`EPSG:4326`,[$.getters[`Maps/extent`][2],$.getters[`Maps/extent`][3]]),i=Py(n.concat(r),e),a=await B.get(i);if(a.status!==200&&!a.data.success)throw Error({status:a.status,message:a.statusText});return a.data.features.map(e=>Ly(e))}function Py(e,t){let n=$.getters.restServiceById(X.geosearch.serviceId).url,r=new URL(n);return r.searchParams.set(`lang`,`de`),r.searchParams.set(`lon`,`10`),r.searchParams.set(`lat`,`53.6`),r.searchParams.set(`bbox`,e),r.searchParams.set(`limit`,X.geosearch.limit),r.searchParams.set(`q`,encodeURIComponent(t)),r}async function Fy(e){let t=Iy(e),n=await B.get(t);if(n.status!==200&&!n.data.success)throw Error({status:n.status,message:n.statusText});return Ly(n.data.features[0])}function Iy(e){let t=$.getters.restServiceById(X.geosearchReverse.serviceId).url,n=new URL(t);return n.searchParams.set(`lon`,e[0]),n.searchParams.set(`lat`,e[1]),n}function Ly(e){return new vy([Number(e.geometry.coordinates[0]),Number(e.geometry.coordinates[1])],e.properties.housenumber?e.properties.street+` `+e.properties.housenumber:e.properties.name)}async function Ry(e){let t=zy({sort:X.geosearch.sortField?[{[X.geosearch.sortField]:{order:`asc`}}]:[],query:{bool:{should:[{fuzzy:{[X.geosearch.searchField]:{value:``,fuzziness:`AUTO`,max_expansions:50,prefix_length:0,transpositions:!0,rewrite:`constant_score`}}},{match_phrase_prefix:{[X.geosearch.searchField]:e}}]}},size:X.geosearch.limit}),n=await B.get(t);if(n.status!==200&&!n.data.success)throw Error({status:n.status,message:n.statusText});return n.data.hits.hits.map(e=>(e.epsg=X.geosearch.epsg.toString(),By(e)))}function zy(e){let t=$.getters.restServiceById(X.geosearch.serviceId).url,n=new URL(t);return n.searchParams.set(`source_content_type`,`application/json`),n.searchParams.set(`source`,JSON.stringify(e)),n}function By(e){return new vy([Number(e._source.geometry.coordinates[0]),Number(e._source.geometry.coordinates[1])],e._source.properties.searchField,e.epsg)}async function Vy(e){let t=Hy(e),n=$.getters.restServiceById(X.geosearch.serviceId).url;return(await Uy(n,{geometryName:X.geosearch.geometryName,propertyNames:X.geosearch.propertyNames,labelProperty:X.geosearch.labelProperty,searchString:e,typeName:X.geosearch.typeName,url:n},t)).map(e=>Gy(e))}function Hy(e){let t=`<?xml version='1.0' encoding='UTF-8'?><wfs:GetFeature service='WFS' 11 xmlns:wfs='http://www.opengis.net/wfs' xmlns:ogc='http://www.opengis.net/ogc' xmlns:gml='http://www.opengis.net/gml' 12 traverseXlinkDepth='*' version='1.1.0'>`;t+=`<wfs:Query typeName='${X.geosearch.typeName}'>`;for(let e of X.geosearch.propertyNames)t+=`<wfs:PropertyName>${e}</wfs:PropertyName>`;t+=`<wfs:PropertyName>${X.geosearch.geometryName}</wfs:PropertyName>`,t+=`<wfs:maxFeatures>${X.geosearch.limit}</wfs:maxFeatures>`,t+=`<ogc:Filter>`,X.geosearch.propertyNames.length>1&&(t+=`<ogc:Or>`);for(let n of X.geosearch.propertyNames)t+=`<ogc:PropertyIsLike matchCase='false' wildCard='*' singleChar='#' escapeChar='!'> 13 <ogc:PropertyName>${n}</ogc:PropertyName> 14 <ogc:Literal>*${e}*</ogc:Literal> 15 </ogc:PropertyIsLike>`;return X.geosearch.propertyNames.length>1&&(t+=`</ogc:Or>`),t+=`</ogc:Filter></wfs:Query></wfs:GetFeature>`,t}async function Uy(e,t,n){return Wy((await B.post(e,n,{headers:{"Content-Type":`text/xml`}})).data,t)}function Wy(e,t){let n=new DOMParser().parseFromString(e,`text/xml`),r=t.typeName,i=n.getElementsByTagNameNS(`*`,r.split(`:`)[1]),a=[];for(let e=0;e<i.length;e++){let n=i[e],r=n.getElementsByTagName(t.labelProperty||t.propertyNames?.[0])?.[0],o=n.getElementsByTagName(`gml:Point`)?.[0];if(!r){console.warn(`Missing identifier property (labelProperty) in SPECIALWFS response. Ignoring featureâ¦`);continue}if(!o){console.warn(`Missing geometry property in SPECIALWFS response. Ignoring featureâ¦`);continue}let s=r.textContent,c=o.getElementsByTagName(`gml:pos`)[0].textContent.trim().split(` `).map(Number),l=o.getAttribute(`srsName`);a.push({identifier:s,coordinates:c,epsg:l})}return a}function Gy(e){return new vy([Number(e.coordinates[0]),Number(e.coordinates[1])],e.identifier,e.epsg.split(`EPSG:`).pop())}async function Ky(e){return(await vn(e,{searchAddress:!0,searchStreets:!0,searchHouseNumbers:!0},!0)).map(e=>(e.epsg=`25832`,qy(e)))}function qy(e){return new vy([Number(e.geometry.coordinates[0]),Number(e.geometry.coordinates[1])],e.name,e.epsg.toString())}var Jy=t({avoidSpeedProfileOptions:()=>Xy,downloadFormatOptions:()=>Zy,downloadFormatOptionsTSR:()=>Qy,nonOptionalConfigFields:()=>$y,speedProfileOptions:()=>Yy}),Yy=[`CAR`,`HGV`,`CYCLING`,`FOOT`,`WHEELCHAIR`],Xy=[{id:`HIGHWAYS`,availableProfiles:[`CAR`,`HGV`]},{id:`TOLLWAYS`,availableProfiles:[`CAR`,`HGV`]},{id:`FERRIES`,availableProfiles:[`CAR`,`HGV`,`CYCLING`,`FOOT`,`WHEELCHAIR`]},{id:`STEPS`,availableProfiles:[`CYCLING`,`FOOT`,`WHEELCHAIR`]},{id:`BORDERS`,availableProfiles:[`CAR`,`HGV`]}],Zy=[`KML`,`GEOJSON`,`GPX`],Qy=[`GEOJSON`,`KML`,`GPX`,`CSV`],$y=[`geosearch.type`,`geosearch.serviceId`,`geosearchReverse.type`,`geosearchReverse.serviceId`,`directionsSettings.type`,`directionsSettings.serviceId`,`isochronesSettings.type`,`isochronesSettings.serviceId`],eb={async initRouting({dispatch:e}){await e(`checkNonOptionalConfigFields`)},setFirstWayPoint({dispatch:e},{displayName:t,coordinates:n}){e(`Directions/reset`),e(`Directions/addWaypoint`,{index:0,displayName:t,coordinates:n,fromExtern:!0})},checkNonOptionalConfigFields({state:e}){let t=$y.map(e=>e.split(`.`)).filter(t=>t.reduce((e,t)=>
15e?.[t],e)==null);if(t.length>0)throw Error(`Routing module is not configured correctly. The following required fields are missing: `+t.map(e=>e.join(`.`)).join(`, `));if(e.geosearch.type===`ELASTIC`&&!e.geosearch.searchField)throw Error(`Routing module is not configured correctly. The following required fields for elastic search are missing: searchField`);if(e.geosearch.type===`SPECIALWFS`&&(!e.geosearch.typeName||!e.geosearch.propertyNames||!e.geosearch.geometryName))throw Error(`Routing module is not configured correctly. One of the following required fields for specialWfs search are missing: typeName, propertyNames or geometryName`)},async fetchCoordinatesByText({state:e,dispatch:t},{search:n}){let r=[];if(n.length<e.geosearch.minChars)return r;if(n.length>0)try{if(e.geosearch.type===`NOMINATIM`)r=await yy(n);else if(e.geosearch.type===`BKG`)r=await wy(n);else if(e.geosearch.type===`LOCATIONFINDER`)r=await Ay(n);else if(e.geosearch.type===`KOMOOT`)r=await Ny(n);else if(e.geosearch.type===`ELASTIC`)r=await Ry(n);else if(e.geosearch.type===`SPECIALWFS`)r=await Vy(n);else if(e.geosearch.type===`GAZETTEER`)r=await Ky(n);else throw Error(`Geosearch is not configured correctly.`);r.forEach(async n=>{n.getEpsg()||n.setEpsg(e.geosearch.epsg);let r=await t(`Modules/Routing/transformCoordinatesToLocalProjection`,{coordinates:n.getCoordinates(),epsg:n.getEpsg()},{root:!0});n.setCoordinates(r)})}catch(e){console.error(`Error while fetching geosearch results: `,e),t(`Alerting/addSingleAlert`,{category:`error`,title:i18next.t(`common:modules.alerting.categories.error`),content:i18next.t(`common:modules.routing.errors.fetchingCoordinates`)},{root:!0})}return r},async fetchTextByCoordinates({state:e,dispatch:t},{coordinates:n}){let r=null;try{if(e.geosearch.type===`NOMINATIM`)r=await xy(n);else if(e.geosearch.type===`BKG`)r=await Dy(n);else if(e.geosearch.type===`LOCATIONFINDER`)r=null;else if(e.geosearch.type===`KOMOOT`)r=await Fy(n);else if(e.geosearch.type===`ELASTIC`)r=null;else if(e.geosearch.type===`SPECIALWFS`)r=null;else if(e.geosearch.type===`GAZETTEER`)r=null;else throw Error(`Geosearch is not configured correctly.`);r.forEach(async e=>{e.getEpsg()||e.setEpsg(`4326`);let n=await t(`Modules/Routing/transformCoordinatesToLocalProjection`,{coordinates:e.getCoordinates(),epsg:e.getEpsg()},{root:!0});e.setCoordinates(n)})}catch{}return r},transformCoordinatesLocalToWgs84Projection({rootState:e},t){return j.transform(j.getMapProjection(mapCollection.getMap(e.Maps.mode)),`EPSG:4326`,t)},transformCoordinatesWgs84ToLocalProjection({rootState:e},t){return j.transform(`EPSG:4326`,j.getMapProjection(mapCollection.getMap(e.Maps.mode)),t)},transformCoordinatesToLocalProjection({rootState:e},{coordinates:t,epsg:n}){return j.transform(`EPSG:${n}`,j.getMapProjection(mapCollection.getMap(e.Maps.mode)),t)},urlParams({commit:e},t){e(`updateStateFromUrlParams`,t)}};y();var tb={name:`IconButton`,props:{interaction:{type:Function,required:!1,default:()=>!0},aria:{type:String,required:!0},icon:{type:String,default:null,required:!1},iconArray:{type:Array,default:null,required:!1},classArray:{type:Array,default:null,required:!1},id:{type:String,default:null,required:!1},disabled:{type:Boolean,default:null,required:!1},label:{type:String,default:null,required:!1}},emits:[`click`],methods:{handleClick(e){this.$emit(`click`,e),this.interaction(e)}}},nb=[`id`,`title`,`aria-label`,`disabled`],rb=[`for`,`aria-label`];function ib(e,t,n,r,i,a){return v(),M(`div`,{class:E([n.label?`btn-wrapper flex-column d-flex align-items-center`:``])},[z(`button`,{id:n.id,tabindex:`0`,class:E([`btn d-flex align-items-center justify-items-center mb-auto`,n.classArray]),type:`button`,title:n.aria,"aria-label":n.aria,disabled:n.disabled,onClick:t[0]||=(...e)=>a.handleClick&&a.handleClick(...e)},[z(`i`,{class:E(n.iconArray?n.iconArray:n.icon),role:`img`},null,2)],10,nb),n.label?(v(),M(`label`,{key:0,class:`text-center btn-label`,for:n.id,"aria-label":n.label},I(n.label),9,rb)):L(``,!0)],2)}var ab=K(tb,[[`render`,ib],[`__scopeId`,`data-v-7943bdeb`]]),ob={" ":` `,"<":`<`,">":`>`,"&":`&`,""":`"`,"'":`'`,"–":`-`};
15function sb(e){return typeof e==`string`?e.replace(/&[\w#]+;/g,e=>ob[e]||e):``}y();var cb={name:`LightButton`,props:{text:{type:String,required:!0},interaction:{type:Function,required:!0},icon:{type:String,default:null,required:!1},iconEnd:{type:String,default:null,required:!1},customclass:{type:String,default:null,required:!1},customclasstitle:{type:String,default:null,required:!1},description:{type:String,default:null,required:!1}},methods:{decodeHtmlEntites:sb}},lb=[`aria-label`],ub={class:`col lh-1 btn-texts row py-2`},db={key:0,class:`btn-description text-wrap col-12 pt-2`};function fb(e,t,n,r,i,a){return v(),M(`button`,{type:`button`,class:E([`btn btn-light d-flex align-items-center btn-description mp-btn-light`,[n.customclass]]),"aria-label":a.decodeHtmlEntites(e.$t(n.text)),onClick:t[0]||=(...e)=>n.interaction&&n.interaction(...e)},[n.icon===null?L(``,!0):(v(),M(`i`,{key:0,class:E([n.icon,`col-2`]),role:`img`},null,2)),z(`span`,ub,[z(`span`,{class:E([`btn-title`,[n.customclasstitle]])},I(a.decodeHtmlEntites(e.$t(n.text))),3),n.description?(v(),M(`span`,db,I(e.$t(n.description)),1)):L(``,!0)]),n.iconEnd===null?L(``,!0):(v(),M(`i`,{key:1,class:E([[n.iconEnd,`col-2`],`align-self-end flex-direction`]),role:`img`},null,2))],10,lb)}var pb=K(cb,[[`render`,fb],[`__scopeId`,`data-v-8ede83ab`]]);y();var mb={name:`InputText`,props:{id:{type:String,required:!0},label:{type:String,required:!0},placeholder:{type:String,required:!0},modelValue:{type:null,default:``},htmlType:{type:String,default:`input`,validator:function(e){return[`input`,`textarea`].indexOf(e)!==-1}},type:{type:String,default:`text`,required:!1},maxLength:{type:String,default:null,required:!1},onInput:{type:Function,default:null,required:!1},onChange:{type:Function,default:null,required:!1},disabled:{type:Boolean,default:!1,required:!1},readonly:{type:Boolean,default:!1,required:!1},classObj:{type:Object,default:null,required:!1},min:{type:Number,default:null,required:!1},max:{type:Number,default:null,required:!1},step:{type:Number,default:null,required:!1},errorMessage:{type:String,default:null,required:!1},floatingLabel:{type:Boolean,default:!0}},emits:[`update:modelValue`,`focus`,`blur`,`click`],methods:{focus(){this.$refs.input?.focus()}}},hb=[`for`],gb=[`id`];function _b(e,t,n,r,i,a){return v(),M(`div`,{class:E({"form-floating mb-3":n.floatingLabel})},[(v(),F(ve(n.htmlType),{id:n.id,ref:`input`,type:n.type,class:E([`form-control`,n.classObj]),placeholder:n.placeholder,"aria-label":n.placeholder,value:n.modelValue,readonly:n.readonly,"max-length":n.maxLength,disabled:n.disabled,min:n.min,max:n.max,step:n.step,"error-message":n.errorMessage,style:pe(n.htmlType===`textarea`?`height: 100px`:``),onInput:t[0]||=t=>{e.$emit(`update:modelValue`,t.target.value),n.onInput?.(t.target.value)},onChange:t[1]||=e=>n.onChange?.(e.target.value),onFocus:t[2]||=t=>e.$emit(`focus`,t),onBlur:t[3]||=t=>e.$emit(`blur`,t),onClick:t[4]||=t=>e.$emit(`click`,t)},null,40,[`id`,`type`,`class`,`placeholder`,`aria-label`,`value`,`readonly`,`max-length`,`disabled`,`min`,`max`,`step`,`error-message`,`style`])),n.floatingLabel?(v(),M(`label`,{key:0,class:`input-label`,for:n.id},I(e.$t(n.label)),9,hb)):L(``,!0),n.errorMessage?(v(),M(`span`,{key:1,id:n.id+`-input-help`,class:`invalid-feedback`},I(n.errorMessage),9,gb)):L(``,!0),Lt(e.$slots,`default`,{},void 0,!0)],2)}var vb=K(mb,[[`render`,_b],[`__scopeId`,`data-v-eec1f191`]]);y();var yb={name:`RoutingExportAvoidAreas`,components:{InputText:vb},data(){return{avoidPolygons:{type:`MultiPolygon`,coordinates:[]},exportType:`geojson`,filename:``}},computed:{...N(`Modules/Routing`,[`directionsSettings`])},mounted(){this.appendModalToBody()},methods:{...w(`Modules/Routing/Directions`,[`getAvoidPolygonsWgs84`]),...w(`Alerting`,[`addSingleAlert`]),appendModalToBody(){let e=this.$refs.exportAvoidAreasModal;e&&document.body.appendChild(e)},async submitDownload(){let e=this.$refs.exportAvoidAreasModal,t=pt.getInstance(e);this.avoidPolygons=await this.getAvoidPolygonsWgs84(),this.exportType===`geojson`?this.downloadGeoJSON():this.exportType===`kml`&&this.downloadKML(),t.hide()},validateFileName(e){let t=``;return e.length>40?(t=this.$t(`common:modules.routing.download.error.fileNameTooLong`),{errorMsg:t,isValid:!1}):/\s/.test(e)?(t=this.$t(`common:modules.routing.download.error.fileNameContainsWhiteSpace`),{errorMsg:t,isValid:!1}):/^[A-Za-z0-9_-]*$/.test(e)?{errorMsg:t,isValid:!0}:(t=this.$t(`common:modules.routing.download.error.fileNameContainsInvalidChars`),{errorMsg:t,isValid:!1})},hasAvoidPolygons(e){let t=``;return e.coordinates.length===0?(t=this.$t(`common:modules.routing.exportAvoidAreas.error.noAvoidArea`),{errorMsg:t,isAvailable:!1}):{errorMsg:t,isAvailable:!0}},downloadGeoJSON(){let e=new dn,t=e.readFeatures(this.avoidPolygons),n=e.writeFeatures(t),r=this.validateFileName(this.filename),i=this.hasAvoidPolygons(this.avoidPolygons);r.isValid?i.isAvailable?this.downloadFile(n,`${this.filename}.geojson`):this.addSingleAlert({category:`error`,content:i.errorMsg,title:this.$t(`common:modules.routing.exportAvoidAreas.error.header`)}):this.addSingleAlert({category:`error`,content:r.errorMsg,title:this.$t(`common:modules.routing.download.error.header`)})},async downloadKML(){let e=new dn().readFeatures(this.avoidPolygons),t=this.validateFileName(this.filename),n=this.hasAvoidPolygons(this.avoidPolygons);if(t.isValid)if(n.isAvailable)try{let t=await pp(e);this.downloadFile(t,`${this.filename}.kml`)}catch(e){this.addSingleAlert({category:`error`,content:this.$t(`common:modules.routing.download.error.kmlConversionFailed`),title:this.$t(`common:modules.routing.download.error.header`)}),console.error(`KML Conversion Error:`,e)}else this.addSingleAlert({category:`error`,content:n.errorMsg,title:this.$t(`common:modules.routing.exportAvoidAreas.error.header`)});else this.addSingleAlert({category:`error`,content:t.errorMsg,title:this.$t(`common:modules.routing.download.error.header`)})},downloadFile(e,t){let n=new Blob([e],{type:`text/plain;charset=utf-8`});if(typeof navigator.msSaveOrOpenBlob==`function`)window.navigator.msSaveOrOpenBlob(n,t);else{let e=URL.createObjectURL(n),r=document.createElement(`a`);r.href=e,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(e)}}}},bb={id:`exportAvoidAreasModal`,ref:`exportAvoidAreasModal`,class:`modal`,tabindex:`-1`,"aria-labelledby":`exportAvoidAreasModalLabel`},xb={class:`modal-dialog modal-dialog-centered`},Sb={class:`modal-content`},Cb={class:`modal-header`},wb={id:`exportAvoidAreasModalLabel`,class:`modal-title fs-5`},Tb={class:`modal-body`},Eb={class:`export-avoid-menu`},Db={class:`export-avoid-radio`},Ob={class:`d-flex mb-2`},kb={for:`routing-download-filename`,class:`col-md-4 col-form-label d-flex align-self-center`},Ab={class:`col-md-8`},jb={class:`download-submit`},Mb=[`disabled`];function Nb(e,t,n,r,i,o){let c=a(`InputText`);return v(),M(`div`,bb,[z(`div`,xb,[z(`div`,Sb,[z(`div`,Cb,[z(`h1`,wb,[z(`b`,null,I(e.$t(`common:modules.routing.exportAvoidAreas.header`)),1)]),t[5]||=z(`button`,{type:`button`,class:`btn-close`,"data-bs-dismiss":`modal`,"aria-label":`Close`},null,-1)]),z(`div`,Tb,[z(`div`,Eb,[z(`b`,null,I(e.$t(`common:modules.routing.exportAvoidAreas.format`)),1),z(`div`,Db,[s(z(`input`,{id:`geojson`,"onUpdate:modelValue":t[0]||=e=>i.exportType=e,type:`radio`,name:`exportType`,value:`geojson`,checked:!0},null,512),[[oe,i.exportType]]),t[6]||=z(`label`,{for:`geojson`},` GeoJSON `,-1),s(z(`input`,{id:`kml`,"onUpdate:modelValue":t[1]||=e=>i.exportType=e,type:`radio`,name:`exportType`,value:`kml`},null,512),[[oe,i.exportType]]),t[7]||=z(`label`,{for:`kml`},` KML `,-1)])]),z(`div`,Ob,[z(`label`,kb,[z(`b`,null,I(e.$t(`common:modules.routing.exportAvoidAreas.filename`)),1)]),z(`div`,Ab,[A(c,{id:`rout
15ing-download-filename`,modelValue:i.filename,"onUpdate:modelValue":t[2]||=e=>i.filename=e,type:`text`,placeholder:e.$t(`common:modules.routing.exportAvoidAreas.filenamePlaceholder`),"floating-label":!1,onKeyup:t[3]||=me(t=>i.filename?o.submitDownload():e._,[`enter`])},null,8,[`modelValue`,`placeholder`])])]),t[9]||=z(`hr`,null,null,-1),z(`div`,jb,[z(`button`,{id:`btn-submit`,class:`btn btn-primary`,type:`submit`,disabled:!i.filename,onClick:t[4]||=e=>o.submitDownload()},[t[8]||=z(`i`,{class:`bi bi-download`},null,-1),R(` `+I(e.$t(`common:modules.routing.exportAvoidAreas.download`)),1)],8,Mb)])])])])],512)}var Pb=K(yb,[[`render`,Nb]]);y();var Fb={name:`FileUpload`,props:{change:{type:Function,required:!0},drop:{type:Function,required:!0},multiple:{type:Boolean,default:!0},accept:{type:String,default:void 0}},data(){return{dzIsDropHovering:!1}},computed:{dropZoneAdditionalClass:function(){return this.dzIsDropHovering?`dzReady`:``}},methods:{onDZDragenter(){this.dzIsDropHovering=!0},onDZDragend(){this.dzIsDropHovering=!1},onDZMouseenter(){this.dzIsHovering=!0},onDZMouseleave(){this.dzIsHovering=!1},onDrop(e){this.dzIsDropHovering=!1,this.drop(e)},triggerFileInputClick(){this.$refs[`upload-input-file`].click()}}},Ib={class:`form-floating mb-3`},Lb={class:`vh-center-inner-wrapper`},Rb={class:`caption`},zb=[`multiple`,`accept`];function Bb(e,t,n,r,i,a){return v(),M(`div`,Ib,[z(`div`,{class:E([`vh-center-outer-wrapper drop-area-fake mb-3`,a.dropZoneAdditionalClass])},[z(`div`,Lb,[z(`p`,Rb,[t[8]||=z(`i`,{class:`bi-box-arrow-in-down`},null,-1),R(` `+I(e.$t(`common:shared.modules.inputs.fileUpload.dropzone`)),1)])]),z(`div`,null,[R(I(e.$t(`common:shared.modules.inputs.fileUpload.or`))+` `,1),z(`button`,{ref:`upload-label`,class:`fake-link`,type:`button`,onClick:t[1]||=(...e)=>a.triggerFileInputClick&&a.triggerFileInputClick(...e)},[R(I(e.$t(`common:shared.modules.inputs.fileUpload.browse`))+` `,1),z(`input`,{ref:`upload-input-file`,type:`file`,name:`image`,multiple:n.multiple,accept:n.accept,onChange:t[0]||=(...e)=>n.change&&n.change(...e)},null,40,zb)],512)]),Lt(e.$slots,`default`,{},void 0,!0),z(`div`,{class:`drop-area`,role:`presentation`,onDrop:t[2]||=on((...e)=>a.onDrop&&a.onDrop(...e),[`prevent`]),onDragover:t[3]||=on(()=>{},[`prevent`]),onDragenter:t[4]||=on((...e)=>a.onDZDragenter&&a.onDZDragenter(...e),[`prevent`]),onDragleave:t[5]||=(...e)=>a.onDZDragend&&a.onDZDragend(...e),onMouseenter:t[6]||=(...e)=>a.onDZMouseenter&&a.onDZMouseenter(...e),onMouseleave:t[7]||=(...e)=>a.onDZMouseleave&&a.onDZMouseleave(...e)},null,32)],2)])}var Vb=K(Fb,[[`render`,Bb],[`__scopeId`,`data-v-053d6003`]]);y();var Hb={name:`RoutingImportAvoidAreas`,components:{FileUpload:Vb},emits:[`afterFileValidation`],data(){return{avoidPolygons:{type:`MultiPolygon`,coordinates:[]},filename:``,dzIsDropHovering:!1,maxFeatures:``,maxArea:``,maxSideLength:``,dataIsValid:!0}},computed:{...N(`Modules/Routing`,[`directionsSettings`])},mounted(){this.setRestrictions()},methods:{...w(`Alerting`,[`addSingleAlert`]),...w(`Modules/Routing/Directions`,[`displayImportedAvoidAreas`]),...w(`Modules/Routing`,[`transformCoordinatesWgs84ToLocalProjection`]),appendModalToBody(){let e=document.getElementById(`fileUpload`);e&&document.body.appendChild(e)},setRestrictions(){this.maxArea=this.directionsSettings.avoidAreaOptions.maxArea,this.maxSideLength=this.directionsSettings.avoidAreaOptions.maxSideLength,this.maxFeatures=this.directionsSettings.avoidAreaOptions.maxFeatures},startFileInput(){this.$refs.fileInputLabel.click()},onInputChange(e){e.target.files&&(this.addFiles(e.target.files),e.target.value=null)},addFiles(e){let t=e[0],n=new FileReader;this.dataIsValid=!0,n.onload=e=>{let n=e.target.result;t.name.endsWith(`.geojson`)||t.name.endsWith(`.json`)?this.parseGeoJSON(n):t.name.endsWith(`.kml`)?this.parseKML(n):this.addValidationErrorAlert(this.$t(`common:modules.routing.importAvoidAreas.error.formatError`))},n.readAsText(t),this.$emit(`afterFileValidation`)},parseGeoJSON(e){try{let t=new dn().readFeatures(e);this.checkPolygonFormat(t),this.dataIsValid&&this.validateAndExtractPolygons(t),this.addSingleAlert({category:`success`,content:this.$t(`common:modules.routing.importAvoidAreas.uploadSuccess`),title:this.$t(`common:modules.routing.importAvoidAreas.uploadSuccessTitle`)})}catch{this.addValidationErrorAlert(this.$t(`common:modules.routing.importAvoidAreas.error.parseError`,{type:`GeoJSON`}))}},parseKML(e){try{let t=new gn().readFeatures(e);this.checkPolygonFormat(t),this.dataIsValid&&this.validateAndExtractPolygons(t)}catch{this.addValidationErrorAlert(this.$t(`common:modules.routing.importAvoidAreas.error.parseError`,{type:`KML`}))}},async validateAndExtractPolygons(e){let t=[],n=e.length;for(let r of e){let e=r.getGeometry?r.getGeometry():r.geometry;if(e instanceof Xe||e.type===`Polygon`){let r=e.getCoordinates?e.getCoordinates():e.coordinates;this.checkPolygonCount(n),this.checkClosedPolygon(r),t.push(r)}else if(e instanceof Fn||e.type===`MultiPolygon`){let n=e.getCoordinates?e.getCoordinates():e.coordinates;this.checkPolygonCount(n.length),this.checkClosedPolygon(n[0]),n.forEac
15h(e=>{t.push(e)})}}if(this.dataIsValid){this.avoidPolygons={type:`MultiPolygon`,coordinates:t};for(let e of this.avoidPolygons.coordinates){let t=await this.transformAvoidPolygon(e),n=this.createFeature(t);this.checkPolygonSize(t),this.checkPolygonSideLength(t[0]),this.dataIsValid&&this.displayImportedAvoidAreas(n)}this.hideModalAfterValidation()}this.dataIsValid=!0},async transformPolygonToLocalProjection(e){return await this.transformCoordinatesWgs84ToLocalProjection(e)},async transformAvoidPolygon(e){return[await Promise.all(e[0].map(e=>this.transformPolygonToLocalProjection(e)))]},checkPolygonFormat(e){e.forEach(e=>{let t=e.getGeometry?e.getGeometry():e.geometry;t instanceof Xe||t instanceof Fn||t.type===`Polygon`||t.type===`MultiPolygon`||this.addValidationErrorAlert(this.$t(`common:modules.routing.importAvoidAreas.error.polygonFormatError`))})},checkPolygonCount(e){e>this.maxFeatures?this.addValidationErrorAlert(this.$t(`common:modules.routing.importAvoidAreas.error.tooManyFeatures`,{maxFeatures:this.maxFeatures})):e===0&&this.addValidationErrorAlert(this.$t(`common:modules.routing.importAvoidAreas.error.noAvoidArea`))},checkClosedPolygon(e){if(e.length<1)this.addValidationErrorAlert(this.$t(`common:modules.routing.importAvoidAreas.error.polygonEmpty`));else if(e[0].length<=2)this.addValidationErrorAlert(this.$t(`common:modules.routing.importAvoidAreas.error.polygonNotEnoughPoints`));else{let t=e[0][0],n=e[0][e[0].length-1];t[0]===n[0]&&t[1]===n[1]||this.addValidationErrorAlert(this.$t(`common:modules.routing.importAvoidAreas.error.polygonNotClosed`))}},checkPolygonSize(e){let t=new Xe(e).getArea(),n=this.maxArea*1e3;t>n&&this.addValidationErrorAlert(this.$t(`common:modules.routing.importAvoidAreas.error.areaTooBig`,{area:(t/1e6).toFixed(2),maxArea:(n/1e6).toFixed(2)}))},checkPolygonSideLength(e){let t=this.maxSideLength*1e3;for(let n=0;n<e.length-1;n++){let r=e[n],i=e[n+1],a=Math.sqrt((i[0]-r[0])**2+(i[1]-r[1])**2);if(a>t){this.addValidationErrorAlert(this.$t(`common:modules.routing.importAvoidAreas.error.sideTooLong`,{maxSideLength:(t/1e3).toFixed(2),distance:(a/1e3).toFixed(2)}));return}}},createFeature(e){return new V({geometry:new Xe(e)})},hideModalAfterValidation(){let e=document.getElementById(`fileUpload`);if(e){let t=pt.getInstance(e);t&&t.hide()}},addValidationErrorAlert(e){this.dataIsValid=!1,this.hideModalAfterValidation(),this.addSingleAlert({category:`error`,content:e,title:this.$t(`common:modules.routing.importAvoidAreas.error.header`)})},onDrop(e){e.dataTransfer.files!==void 0&&this.addFiles(e.dataTransfer.files)}}},Ub={class:`justify-content-center`},Wb={ref:`fileInputLabel`,class:`d-none mt-2 mb-2 col-md-12`};function Gb(e,t,n,r,i,o){let s=a(`FileUpload`);return v(),M(D,null,[z(`div`,Ub,[A(s,{id:`fileUpload`,keydown:t=>e.triggerClickOnFileInput(t),change:e=>o.onInputChange(e),drop:e=>o.onDrop(e)},null,8,[`keydown`,`change`,`drop`])]),z(`label`,Wb,[z(`input`,{ref:`fileInput`,type:`file`,accept:`.geojson, .kml`,onChange:t[0]||=e=>o.onInputChange(e)},null,544)],512)],64)}var Kb=K(Hb,[[`render`,Gb],[`__scopeId`,`data-v-7b5df0f7`]]);y();var qb={name:`RoutingCoordinateInput`,components:{IconButton:ab,InputText:vb},props:{waypoint:{type:Object,required:!0},countWaypoints:{type:Number,required:!0}},emits:[`moveWaypointDown`,`moveWaypointUp`,`searchResultSelected`,`removeWaypoint`,`addStartEnd`,`removeAvoidInteraction`],data(){return{search:this.waypoint.getDisplayName()?this.waypoint.getDisplayName():``,awaitingSearch:!1,searchResults:[],ignoreNextSearchChange:!1,isFocused:!1,selectedIndex:-1,timeoutID:null}},computed:{...N(`Modules/Routing/Directions`,[`waypoints`,`isAwaitingRouteModifyEnd`]),...N(`Modules/Routing`,[`activeRoutingToolOption`]),waypointDisplayName(){return this.waypoint.getDisplayName()},isWaypointSet(){return this.waypoint.coordinates.length===2},showDeleteWaypoint(){return this.isWaypointSet||this.countWaypoints>2&&this.waypoint.coordinates.length===0},showMoveWaypointUp(){return this.isWaypointSet&&this.activeRoutingToolOption!==`TSR`&&this.waypoint.index!==0},showMoveWaypointDown(){return this.isWaypointSet&&this.activeRoutingToolOption!==`TSR`&&this.waypoint.index!==this.countWaypoints-1}},watch:{waypointDisplayName:function(e){this.ignoreNextSearchChange=!0,this.search=e||``},waypoints:{handler(e,t){if(t===null){let t=e.filter(e=>e.fromExtern===!0);t&&t.length>0&&(this.search=t[0].displayName)}},deep:!0},search:function(){if(this.ignoreNextSearchChange){this.ignoreNextSearchChange=!1;return}this.awaitingSearch||(this.timeoutID=setTimeout(async()=>{this.awaitingSearch=!1;let e=this.isInputtextWgs84Coordinate(this.search);e?await this.selectWgs84Coordinate(e):(this.searchResults=await this.fetchCoordinatesByText({search:this.search}),this.selectedIndex=-1)},1e3)),this.awaitingSearch=!0},isFocused:function(){this.addStartEnd()},isAwaitingRouteModifyEnd(){this.isAwaitingRouteModifyEnd||(this.search=this.waypoint.getDisplayName())}},unmounted(){clearTimeout(this.timeoutID)},methods:{...w(`Modules/Routing`,[`fetchCoordinatesByText`,`transformCoordinatesWgs84ToLocalProjection`]),addStartEnd(){this.isFocused&&this.$emit(`addStartEnd`)},selectSearchResult(e){e instanceof vy&&(this.waypoint.setFromGeosearchResult(e),this.ignoreNextSearchChange=!0,this.search=e.getDisplayName(),this.searchResults=[],this.selectedIndex=-1,this.$emit(`searchResultSelected`))},async selectWgs84Coordinate(e){this.waypoint.setCoordinates(await this.transformCoordinatesWgs84ToLocalProjection(e)),this.waypoint.setDisplayName(this.search),this.searchResults=[],this.$emit(`searchResultSelected`)},resetInput(){this.ignoreNextSearchChange=!0,this.searchResults=[],this.waypoint.getDisplayName()?this.search=this.waypoint.getDisplayName():this.search=``},isInputtextWgs84Coordinate(){if(typeof this.search!=`string`)return!1;let[e,t]=this.search.split(`, `),n=Number(e),r=Number(t);return!e||!t||!isFinite(n)||Math.abs(n)>90||!isFinite(r)||Math.abs(r)>180?!1:[n,r]},getPlaceholder(){return this.waypoint.index===0?this.$t(`common:modules.routing.startpoint`):this.activeRoutingToolOption!==`TSR`&&this.waypoint.index===this.countWaypoints-1?this.$t(`common:modules.routing.endpoint`):this.activeRoutingToolOption===`TSR`&&this.waypoint.index===this.countWaypoints-1?this.$t(`common:modules.routing.tsr.tsrEndpoint`):this.$t(`common:modules.routing.waypoint`)},removeAvoidInteraction(){this.$emit(`removeAvoidInteraction`)}}},Jb={class:`form-group-sm mx-0 mb-4`},Yb={class:`d-flex justify-content-between`},Xb=[`id`,`for`],Zb={class:`d-flex`},Qb={class:`justify-content-between`},$b={key:0,class:`h-50`},ex={key:1,class:`h-50`},tx={class:`list-group dropdown-menu-search dropdown-menu-left`},nx=[`onMousedown`];function rx(e,t,n,r,i,o){let c=a(`InputText`),l=a(`IconButton`);
15return v(),M(`div`,Jb,[z(`div`,Yb,[z(`label`,{id:`routingCoordinateLabel_`+n.waypoint.index,for:`routingCoordinateInput_`+n.waypoint.index,class:`d-flex flex-row pr-0 pl-0`},[A(c,{id:`routingCoordinateInput_`+n.waypoint.index,modelValue:i.search,"onUpdate:modelValue":t[0]||=e=>i.search=e,"class-obj":[`form-control-sm`,`col-md-12`],class:`w-100`,placeholder:o.getPlaceholder(),label:o.getPlaceholder(),autocomplete:`off`,onFocus:t[1]||=e=>i.isFocused=!0,onBlur:t[2]||=e=>i.isFocused=!1,onClick:o.removeAvoidInteraction},null,8,[`id`,`modelValue`,`placeholder`,`label`,`onClick`]),i.search.length>0&&i.search!==o.waypointDisplayName?(v(),M(`button`,{key:0,class:`btn-icon input-icon reset-button`,onClick:t[3]||=e=>o.resetInput(),onKeydown:t[4]||=me(e=>o.resetInput(),[`enter`])},[...t[5]||=[z(`i`,{class:`bi-x-lg fs-6`},null,-1)]],32)):L(``,!0)],8,Xb),z(`div`,Zb,[z(`div`,Qb,[o.showMoveWaypointUp?(v(),M(`div`,$b,[A(l,{aria:e.$t(`common:modules.routing.moveWaypointUp`),"class-array":[`btn-light`,`btn-up-down`,`button-up`],icon:`bi-chevron-up fs-6`,interaction:()=>e.$emit(`moveWaypointUp`)},null,8,[`aria`,`interaction`])])):L(``,!0),o.showMoveWaypointDown?(v(),M(`div`,ex,[A(l,{aria:e.$t(`common:modules.routing.moveWaypointDown`),"class-array":[`btn-light`,`btn-up-down`],icon:`bi-chevron-down fs-6`,interaction:()=>e.$emit(`moveWaypointDown`)},null,8,[`aria`,`interaction`])])):L(``,!0)]),o.showDeleteWaypoint?(v(),F(l,{key:0,aria:e.$t(`common:modules.routing.deleteWaypoint`),"class-array":[`btn-light`,`m-1`],icon:`bi-x-lg fs-6`,interaction:()=>e.$emit(`removeWaypoint`)},null,8,[`aria`,`interaction`])):L(``,!0)])]),s(z(`ul`,tx,[(v(!0),M(D,null,C(i.searchResults,(e,t)=>(v(),M(`li`,{key:t,class:E([`list-group-item`,{active:t===i.selectedIndex}])},[z(`button`,{class:`btn-icon search-result-button`,onMousedown:t=>o.selectSearchResult(e)},I(e.displayName),41,nx)],2))),128))],512),[[ae,i.searchResults.length>0&&i.isFocused]])])}var ix=K(qb,[[`render`,rx],[`__scopeId`,`data-v-488cbb6b`]]);y();var ax={name:`RoutingDistanceDisplay`,props:{distance:{type:Number,required:!0}},data(){return{mText:` m`,kmText:` km`}},computed:{roundedDistance(){return Math.floor(this.distance)},kmDistance(){return Pm(Math.floor(this.roundedDistance/1e3*10)/10)}}},ox={key:0},sx={key:1};function cx(e,t,n,r,i,a){return a.roundedDistance<1e3?(v(),M(`span`,ox,[z(`b`,null,I(a.roundedDistance),1),R(I(i.mText),1)])):(v(),M(`span`,sx,[z(`b`,null,I(a.kmDistance),1),R(I(i.kmText),1)]))}var lx=K(ax,[[`render`,cx]]);y();var ux={name:`RoutingDurationDisplay`,props:{duration:{type:Number,required:!0}},computed:{minutes(){return Math.floor(this.duration/60)},hours(){return Math.floor(this.duration/3600)},minutesMinusHours(){return Math.floor(this.duration/60%60)}}},dx={key:0},fx={key:1},px={key:0,class:`minutesminushours`},mx={key:2};function hx(e,t,n,r,i,a){return v(),M(`span`,null,[n.duration<60?(v(),M(`b`,dx,`< 1 min`)):n.duration>=3600?(v(),M(`b`,fx,[R(I(a.hours)+` h `,1),a.minutesMinusHours>0?(v(),M(`span`,px,`\xA0`+I(a.minutesMinusHours)+` min`,1)):L(``,!0)])):(v(),M(`b`,mx,I(a.minutes)+` min`,1))])}var gx=K(ux,[[`render`,hx]]);y();var _x={name:`RoutingBatchProcessing`,components:{IconButton:ab,FileUpload:Vb},props:{settings:{type:Object,required:!0},progress:{type:Number,required:!0},isProcessing:{type:Boolean,required:!0},structureText:{type:String,required:!0},exampleText:{type:String,required:!0}},emits:[`cancelProcess`,`filesadded`],watch:{isProcessing:function(e){e&&(this.$refs.fileInput.value=``)}},methods:{onInputChange(e){e.target.files!==void 0&&this.addFiles(e.target.files)},addFiles(e){this.$emit(`filesadded`,e)},onDrop(e){this.dzIsDropHovering=!1,e.dataTransfer.files!==void 0&&this.addFiles(e.dataTransfer.files)}}},vx={id:`routing-batch-processing`},yx={key:0,id:`routing-batch-processing-isprocessing`,class:`d-flex flex-column`},bx={class:`d-flex`},xx=[`value`],Sx={id:`routing-batch-processing-isprocessing-progresstext`,class:`col-3`},Cx={key:1,class:`d-flex flex-column`},wx={class:`strukturtext d-flex flex-column mb-2`},Tx={class:`d-flex flex-column`},Ex={class:`d-flex mb-2`},Dx={ref:`fileInputLabel`,class:`d-none`};function Ox(e,t,n,r,i,o){let s=a(`IconButton`),c=a(`FileUpload`);return v(),M(`div`,vx,[n.isProcessing?(v(),M(`div`,yx,[z(`span`,null,I(e.$t(`common:modules.routing.batchProcessing.isProcessing`)),1),z(`div`,bx,[z(`progress`,{class:`col-8`,max:`100`,value:n.progress},null,8,xx),z(`span`,Sx,I(n.progress)+` %`,1),A(s,{aria:e.$t(`common:modules.routing.batchProcessing.cancel`),"class-array":[`btn-light`],icon:`bi-x`,interaction:()=>e.$emit(`cancelProcess`)},null,8,[`aria`,`interaction`])])])):(v(),M(`div`,Cx,[z(`div`,wx,[z(`div`,Tx,[z(`span`,null,I(e.$t(`common:modules.routing.batchProcessing.structure`))+`:`,1),z(`b`,null,I(n.structureText),1)]),z(`div`,Ex,[z(`span`,null,I(e.$t(`common:modules.routing.batchProcessing.example`))+`:`,1),z(`span`,null,I(n.exampleText),1)])])])),A(c,{id:`fileUpload`,keydown:t=>e.triggerClickOnFileInput(t),change:e=>o.onInputChange(e),drop:e=>o.onDrop(e)},null,8,[`keydown`,`change`,`drop`]),z(`label`,Dx,[z(`input`,{ref:`fileInput`,type:`file`,accept:`.csv`,onChange:t[0]||=e=>o.onInputChange(e)},null,544)],512)])}var kx=K(_x,[[`render`,Ox],[`__scopeId`,`data-v-9e2c33d1`]]),Ax=class{constructor(e,t,n,r){this.total=e.length,this.todo=e,this.running=[],this.complete=[],this.promiseResults=[],this.count=t,this.cancel=!1,this.canceled=!1,this.progress=0,this.addNewResult=n,this.executeAfterCompletion=r,this.run()}isDone(){return this.total===this.complete.length}cancelRun(){this.cancel=!0}runNext(){return this.running.length<this.count&&this.todo.length}run(){if(!this.canceled){if(this.cancel){this.canceled=!0,this.executeAfterCompletion(null);return}for(;
15this.runNext();){let e=this.todo.shift()();e.then(e=>{this.progress=Number(((this.complete.length+1)/this.total*100).toFixed(2)),this.complete.push(this.running.shift()),this.addNewResult(this.promiseResults,e),this.run()}),this.running.push(e)}this.isDone()&&this.executeAfterCompletion(this.promiseResults)}}};y();var jx={name:`DirectionsItemBatchProcessing`,components:{RoutingBatchProcessing:kx},props:{settings:{type:Object,required:!0}},data(){return{isProcessing:!1,countFailed:0,serviceRequests:0}},computed:{...N(`Modules/Routing`,[`taskHandler`,`directionsSettings`])},methods:{...o(`Modules/Routing/Directions`,[`setIsLoadingDirections`]),...o(`Modules/Routing`,[`setTaskHandler`]),...w(`Modules/Routing/Directions`,[`fetchDirections`,`resetRoutingDirectionsResults`]),...w(`Alerting`,[`addSingleAlert`]),addFiles(e){Array.from(e).forEach(e=>{let t=new FileReader;t.onload=async t=>{this.isProcessing=!0,this.setTaskHandler(null),this.countFailed=0,this.serviceRequests=0,this.resetRoutingDirectionsResults(),this.setIsLoadingDirections(!0);try{let n=await this.parseCsv(t.target.result);n&&this.downloadResults(e.name,n),this.countFailed===this.serviceRequests?this.addSingleAlert({category:this.$t(`common:modules.alerting.categories.error`),content:this.$t(`common:modules.routing.directions.batchProcessing.errorAllFailed`)}):this.countFailed!==0&&this.addSingleAlert({category:`error`,title:this.$t(`common:modules.alerting.categories.error`),content:this.$t(`common:modules.routing.directions.batchProcessing.errorSomeFailed`,{countFailed:this.coundFailed})})}catch(e){this.addSingleAlert({category:`error`,title:this.$t(`common:modules.alerting.categories.error`),content:e.message})}this.setIsLoadingDirections(!1),this.countFailed=0,this.isProcessing=!1,this.setTaskHandler(null)},t.readAsText(e)})},createCsvToDownload(e){return!Array.isArray(e)||typeof e[0]!=`object`||e[0]===null?``:Object.keys(e[0]).join(`;`)+` 16`+e.map(e=>Object.values(e).join(`;`)).join(` 17`)},async downloadResults(e,t){let n=this.createCsvToDownload(t),r=this.createDownloadFilename(e);if(typeof navigator.msSaveOrOpenBlob==`function`)window.navigator.msSaveOrOpenBlob(new Blob([``,n],{type:`text/csv;charset=utf-8,%EF%BB%BF`}),r);else{let e=`data:text/plain;charset=utf-8,${encodeURIComponent(n)}`,t=document.createElement(`a`);t.href=e,t.download=r,t.style.visibility=`hidden`,document.body.appendChild(t),t.click(),document.body.removeChild(t)}},createDownloadFilename(e){if(typeof e!=`string`)return`.csv`;let t=e.split(`.`);return t.slice(0,t.length-1).join(`.`)+`.csv`},parseCsv(e){return new Promise((t,n)=>{if(typeof e!=`string`){n(Error(this.$t(`common:modules.routing.directions.batchProcessing.errorNoEntries`)));return}let r=e.replace(/[\r]/g,``).trim(),i=r.split(` 18`),a=i.length,o=[];if(r.length===0||a===0){n(Error(this.$t(`common:modules.routing.directions.batchProcessing.errorNoEntries`)));return}if(this.settings.batchProcessing.limit&&a>this.settings.batchProcessing.limit){n(Error(this.$t(`common:modules.routing.directions.batchProcessing.errorToManyEntriesInFile`,{limit:this.settings.batchProcessing.limit})));return}for(let e=0;e<a;e++){let t=i[e].split(`;`);if(!(t.length===1&&t.includes(``))){if(t.length!==5){n(Error(this.$t(`common:modules.routing.directions.batchProcessing.errorToManyEntriesInRow`,{row:e})));return}if(!this.isNumber(Number(t[1]))||!this.isNumber(Number(t[2]))||!this.isNumber(Number(t[3]))||!this.isNumber(Number(t[4]))){n(Error(this.$t(`common:modules.routing.directions.batchProcessing.errorRowContainsEntriesNoNumber`,{row:e})));return}o.push(()=>this.parseLineParts(t))}}this.setTaskHandler(new Ax(o,this.settings.batchProcessing.maximumConcurrentRequests?this.settings.batchProcessing.maximumConcurrentRequests:this.$store.getters[`Modules/Routing/Directions/settings`].batchProcessing.maximumConcurrentRequests,(e,t)=>e.push(t),e=>t(e)))})},async parseLineParts(e){let t=e[0],n=Number(e[1]),r=Number(e[2]),i=Number(e[3]),a=Number(e[4]),o={ID:t,[this.$t(`common:modules.routing.directions.batchProcessing.downloadHeader.xStart`)]:n,[this.$t(`common:modules.routing.directions.batchProcessing.downloadHeader.yStart`)]:r,[this.$t(`common:modules.routing.directions.batchProcessing.downloadHeader.xEnd`)]:i,[this.$t(`common:modules.routing.directions.batchProcessing.downloadHeader.yEnd`)]:a,[this.$t(`common:modules.routing.directions.batchProcessing.downloadHeader.time`)]:null,[this.$t(`common:modules.routing.directions.batchProcessing.downloadHeader.distance`)]:null,[this.$t(`common:modules.routing.directions.batchProcessing.downloadHeader.profile`)]:this.settings.speedProfile};try{this.serviceRequests+=1;let e=await this.fetchDirections({wgs84Coords:[[n,r],[i,a]],instructions:!1});o[this.$t(`common:modules.routing.directions.batchProcessing.downloadHeader.distance`)]=e.distance.toFixed(2),o[this.$t(`common:modules.routing.directions.batchProcessing.downloadHeader.time`)]=(e.duration/60).toFixed(2)}catch{this.countFailed+=1}return o},isNumber(e){return!isNaN(e)&&typeof e==`number`}}};function Mx(e,t,n,r,i,o){let s=a(`RoutingBatchProcessing`);return v(),F(s,{settings:n.settings,progress:e.taskHandler?e.taskHandler.progress:0,"is-
18processing":i.isProcessing,"structure-text":e.$t(`common:modules.routing.directions.batchProcessing.structure`),"example-text":`1;8.12;50.67;9.12;51.67`,onFilesadded:t[0]||=e=>o.addFiles(e),onCancelProcess:t[1]||=t=>e.taskHandler.cancelRun()},null,8,[`settings`,`progress`,`is-processing`,`structure-text`])}var Nx=K(jx,[[`render`,Mx]]);y();var Px={name:`RoutingBatchProcessingCheckbox`,props:{batchProcessing:{type:Object,required:!0}},emits:[`input`]},Fx={id:`routing-batch-processing-checkbox`,class:`pointer mb-0 d-flex`},Ix=[`checked`],Lx={class:`ms-2`};function Rx(e,t,n,r,i,a){return v(),M(`label`,Fx,[z(`input`,{checked:n.batchProcessing.active,class:`mt-0 d-flex flex-column align-self-center`,type:`checkbox`,onInput:t[0]||=t=>e.$emit(`input`,t.target.checked)},null,40,Ix),z(`span`,Lx,I(e.$t(`common:modules.routing.batchProcessing.header`)),1)])}var zx=K(Px,[[`render`,Rx]]);function Bx(e){let t=X.directionsSettings.styleRoute?X.directionsSettings.styleRoute:X.Directions.settings.styleRoute;return e.get(`isHighlight`)?new T({stroke:new x({color:[...t.partHighlightColor],width:t.partHighlightWidth})}):[new T({stroke:new x({color:[...t.highlightColor],width:t.highlightWidth})}),new T({stroke:new x({color:[...t.fillColor],width:t.width})})]}var Vx={createDirectionsRouteStyle:Bx};function Hx(){let e=X.tsrSettings.styleRoute?X.tsrSettings.styleRoute:X.tsr.settings.styleRoute;return[new T({stroke:new x({color:[...e.fillColor,1],width:e.width})})]}var Ux={createtsrRouteStyle:Hx};y();var Wx={name:`SpinnerItem`,props:{customClass:{type:String,required:!1,default:``}}};function Gx(e,t,n,r,i,a){return v(),M(`div`,{class:E([`spinner-border`,n.customClass]),role:`status`},[...t[0]||=[z(`span`,{class:`visually-hidden`},`Loading...`,-1)]],2)}var Kx=K(Wx,[[`render`,Gx],[`__scopeId`,`data-v-114737da`]]);y();var qx={name:`FlatButton`,components:{SpinnerItem:Kx},props:{customclass:{type:String,default:null,required:!1},disabled:{type:Boolean,default:null,required:!1},icon:{type:String,default:null,required:!1},interaction:{type:Function,required:!1,default:()=>!0},secondary:{type:Boolean,default:!1,required:!1},spinnerTrigger:{type:Boolean,default:!1,required:!1},text:{type:String,required:!0},type:{type:String,required:!1,default:`button`},title:{type:String,required:!1,default:``}}},Jx=[`type`,`aria-label`,`disabled`,`title`],Yx={class:`btn-texts`};function Xx(e,t,n,r,i,o){let s=a(`SpinnerItem`);return v(),M(`button`,{class:E([`flat-button btn btn-secondary d-flex align-items-center custom-mb-3`,[n.customclass,n.secondary?`btn-scnd`:``]]),type:n.type,"aria-label":n.text,disabled:n.disabled,title:n.title,onClick:t[0]||=(...e)=>n.interaction&&n.interaction(...e)},[n.icon!==null&&!n.spinnerTrigger?(v(),M(`i`,{key:0,class:E(n.icon),role:`img`},null,2)):L(``,!0),n.spinnerTrigger?(v(),F(s,{key:1,"custom-class":`p-2`})):L(``,!0),z(`span`,Yx,I(e.$t(n.text)),1)],10,Jx)}var Zx=K(qx,[[`render`,Xx],[`__scopeId`,`data-v-962b6edf`]]);y();var Qx={name:`RoutingDownload`,components:{FlatButton:Zx,InputText:vb},props:{hideGpx:{type:Boolean,default:!1}},data(){return{constants:Jy}},computed:{...N(`Modules/Routing`,[`download`,`activeRoutingToolOption`]),...N(`Modules/Routing/Directions`,[`directionsRouteSource`]),...N(`Modules/Routing/Isochrones`,[`isochronesAreaSource`]),...N(`Modules/Routing/TSR`,[`tsrRouteSource`,`waypoints`,`settings`]),isDisabled(){return!this.download?.fileName?.length},downloadFormatOptions(){let e=[];return[`DIRECTIONS`,`ISOCHRONES`].includes(this.activeRoutingToolOption)?e=Zy:this.activeRoutingToolOption===`TSR`&&(e=Qy),this.hideGpx&&(e=e.filter(e=>e!==`GPX`)),e}},methods:{...w(`Modules/Routing`,[`transformCoordinatesLocalToWgs84Projection`]),...w(`Alerting`,[`addSingleAlert`]),getDownloadFeatures(){return this.activeRoutingToolOption===`DIRECTIONS`?[this.directionsRouteSource.getFeatures().find(e=>!e.get(`isHighlight`))]:this.activeRoutingToolOption===`TSR`?[this.tsrRouteSource.getFeatures().find(e=>!e.get(`isHighlight`))]:this.isochronesAreaSource.getFeatures()},styleFeatures(e){let t=[],n=null;for(let r of e){let e=r.clone();[`DIRECTIONS`,`ISOCHRONES`].includes(this.activeRoutingToolOption)?(n=Vx.createDirectionsRouteStyle(r),n[1]&&e.setStyle(n[1])):this.activeRoutingToolOption===`TSR`&&(n=Ux.createtsrRouteStyle(r),n[0]&&e.setStyle(n[0])),t.push(e)}return t},async convertFeatures(e,t){if(!(t instanceof dn)&&!(t instanceof Yt)||!Array.isArray(e))return``;let n=[];for(let t of e){if(!(t instanceof V))continue;let e=t.clone(),r=e.getGeometry(),i=r.getType(),a=r.getCoordinates(),o=[];if(i===`Point`)o=await this.transformCoordinatesLocalToWgs84Projection(a);else if(i===`LineString`)o=await Promise.all(a.map(e=>this.transformCoordinatesLocalToWgs84Projection(e)));else if(i===`Polygon`)for(let e of a)o.push(await Promise.all(e.map(e=>this.transformCoordinatesLocalToWgs84Projection(e))));r.setCoordinates(o),n.push(e)}return t.writeFeatures(n)},getProfileName(){switch(this.settings.speedProfile){case`CAR`:return i18next.t(`common:modules.routing.speedprofiles.CAR`);case`HGV`:return i18next.t(`common:modules.routing.speedprofiles.HGV`);case`CYCLING`:return i18next.t(`common:modules.routing.speedprofiles.CYCLING`);case`FOOT`:return i18next.t(`common:modules.routing.speedprofiles.FOOT`);case`WHEELCHAIR`:return i18next.t(`common:modules.routing.speedprofiles.WHEELCHAIR`);default:return``}},async convertTSRResultToCsv(){let e=``,t=[],n=``,r=[];
18if(this.activeRoutingToolOption===`TSR`){r.push(i18next.t(`common:modules.routing.tsr.downloadCsv.header`)),this.waypoints[0].coordinates.every((e,t)=>e===this.waypoints[this.waypoints.length-1].coordinates[t])?r.push(i18next.t(`common:modules.routing.tsr.downloadCsv.descriptionRoundTrip`,{start:this.waypoints[0].getDisplayName()})):r.push(i18next.t(`common:modules.routing.tsr.downloadCsv.descriptionNoRoundTrip`,{start:this.waypoints[0].getDisplayName(),end:this.waypoints[this.waypoints.length-1].getDisplayName()})),r.push(i18next.t(`common:modules.routing.tsr.downloadCsv.optimalOrder`,{profile:this.getProfileName()}));for(let[e,i]of this.waypoints.entries())t=await this.transformCoordinatesLocalToWgs84Projection(i.getCoordinates()),n=e===0?i18next.t(`common:modules.routing.startIndex`):e===this.waypoints.length-1?i18next.t(`common:modules.routing.endIndex`):e,r.push(i18next.t(`common:modules.routing.tsr.downloadCsv.waypoint`,{pos:n,displayName:i.getDisplayName(),lon:t[0].toFixed(6),lat:t[1].toFixed(6)}));e=r.join(` 19`)}return e},async getDownloadStringInFormat(e){switch(this.download?.format){case`GEOJSON`:return this.convertFeatures(e,new dn);case`GPX`:return this.convertFeatures(e,new Yt);case`KML`:return pp(e);case`CSV`:return this.convertTSRResultToCsv();default:return}},validateFileName(e){let t=``;return e.length>40?(t=this.$t(`common:modules.routing.download.error.fileNameTooLong`),{errorMsg:t,isValid:!1}):/\s/.test(e)?(t=this.$t(`common:modules.routing.download.error.fileNameContainsWhiteSpace`),{errorMsg:t,isValid:!1}):/^[A-Za-z0-9_-]*$/.test(e)?{errorMsg:t,isValid:!0}:(t=this.$t(`common:modules.routing.download.error.fileNameContainsInvalidChars`),{errorMsg:t,isValid:!1})},getFileName(){if(typeof this.download?.fileName!=`string`||typeof this.download?.format!=`string`)return`unknown`;let e=this.download.format.toLowerCase(),t=this.download.fileName.endsWith(`.${e}`)?this.download.fileName:`${this.download.fileName}.${e}`,n=this.validateFileName(t.slice(0,-Math.abs(e.length+1)));return{name:t,isValid:n.isValid,errorMsg:n.errorMsg}},async downloadResult(){if(this.isDisabled)return;let e=await this.getDownloadStringInFormat(this.styleFeatures(this.getDownloadFeatures())),t=this.getFileName();if(t.isValid)if(typeof navigator.msSaveOrOpenBlob==`function`)window.navigator.msSaveOrOpenBlob(new Blob([e],{type:`text/plain;charset=utf-8`}),t.name);else{let n=`data:text/plain;charset=utf-8,${encodeURIComponent(e)}`,r=document.createElement(`a`);r.href=n,r.download=t.name,r.style.visibility=`hidden`,document.body.appendChild(r),r.click(),document.body.removeChild(r)}else this.addSingleAlert({category:`error`,content:t.errorMsg,title:this.$t(`common:modules.routing.download.error.header`)})}}},$x={id:`routing-download`,class:`form-group-sm`},eS={class:`d-flex mb-2`},tS={for:`routing-DownloadFormatOptions`,class:`col-md-4 col-form-label d-flex align-self-center`},nS={class:`col-md-8`},rS=[`id`,`value`,`selected`],iS={class:`d-flex mb-2`},aS={for:`routing-download-filename`,class:`col-md-4 col-form-label d-flex align-self-center`},oS={class:`col-md-8`},sS={class:`form-group form-group-sm`},cS={class:`d-flex justify-content-center mt-3`};function lS(e,t,n,r,i,o){let s=a(`InputText`),c=a(`FlatButton`);return v(),M(`div`,$x,[z(`h6`,null,I(e.$t(`common:modules.routing.download.header`)),1),z(`div`,eS,[z(`label`,tS,I(e.$t(`common:modules.routing.download.format`)),1),z(`div`,nS,[z(`select`,{id:`routing-DownloadFormatOptions`,class:`form-select form-select-sm`,onChange:t[0]||=t=>e.download.format=t.target.value},[(v(!0),M(D,null,C(o.downloadFormatOptions,t=>(v(),M(`option`,{id:t,key:`routing-DownloadFormatOptions-`+t,value:t,selected:t===e.download.format},I(t),9,rS))),128))],32)])]),z(`div`,iS,[z(`label`,aS,I(e.$t(`common:modules.routing.download.filename`)),1),z(`div`,oS,[A(s,{id:`routing-download-filename`,modelValue:e.download.fileName,"onUpdate:modelValue":t[1]||=t=>e.download.fileName=t,label:e.$t(`common:modules.routing.download.filename`),placeholder:e.$t(`common:modules.routing.download.filename`)},null,8,[`modelValue`,`label`,`placeholder`])])]),z(`div`,sS,[z(`div`,cS,[A(c,{id:`downloadBtn`,"aria-label":e.$t(`common:modules.routing.download.saveResult`),interaction:e=>o.downloadResult(),text:e.$t(`common:modules.routing.download.saveResult`),icon:`bi-save`,class:E({disabled:o.isDisabled}),role:`button`},null,8,[`aria-label`,`interaction`,`text`,`class`])])])])}var uS=K(Qx,[[`render`,lS]]);y();var dS={name:`RoutingSpeedProfileIcon`,props:{interaction:{type:Function,required:!1,default:()=>!1},speedProfileId:{type:String,required:!0},fillColor:{type:String,default:`#000000`},tooltip:{type:String,required:!0}}},fS=[`fill`];function pS(e,t,n,r,i,a){return v(),M(`button`,{class:`btn-svg`,onClick:t[0]||=(...e)=>n.interaction&&n.interaction(...e),onKeydown:t[1]||=me((...e)=>n.interaction&&n.interaction(...e),[`enter`])},[(v(),M(`svg`,{xmlns:`http://www.w3.org/2000/svg`,height:`24px`,viewBox:`0 0 24 24`,width:`24px`,fill:n.fillColor},[z(`title`,null,I(n.tooltip),1),n.speedProfileId===`CAR`?(v(),M(D,{key:0},[t[2]||=z(`path`,{class:`routing-speed-profile-icon-CAR`,d:`M0 0h24v24H0V0z`,fill:`none`},null,-1),t[3]||=z(`path`,{d:`M18.92 6.01C18.72 5.42 18.16 5 17.5 5h-11c-.66 0-1.21.42-1.42 1.01L3 12v8c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-1h12v1c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-8l-2.08-5.99zM6.85 7h10.29l1.08 3.11H5.77L6.85 7zM19 17H5v-5h14v5z`},null,-1),t[4]||=z(`circle`,{cx:`7.5`,cy:`14.5`,r:`1.5`},null,-1),t[5]||=z(`circle`,{cx:`16.5`,cy:`14.5`,r:`1.5`},null,-1)],64)):L(``,!0),n.speedProfileId===`HGV`?(v(),M(D,{key:1},[t[6]||=z(`path`,{class:`routing-speed-profile-icon-HGV`,d:`M0 0h24v24H0V0z`,fill:`none`},null,-1),t[7]||=z(`path`,{d:`M20 8h-3V4H3c-1.1 0-2 .9-2 2v11h2c0 1.66 1.34 3 3 3s3-1.34 3-3h6c0 1.66 1.34 3 3 3s3-1.34 3-3h2v-5l-3-4zm-.5 1.5l1.96 2.5H17V9.5h2.5zM6 18c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm2.22-3c-.55-.61-1.33-1-2.22-1s-1.67.39-2.22 1H3V6h12v9H8.22zM18 18c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1z`},null,-1)],64)):n.speedProfileId===`CYCLING`?(v(),M(D,{key:2},[t[8]||=z(`path`,{class:`routing-speed-profile-icon-CYCLING`,d:`M0 0h24v24H0V0z`,fill:`none`},null,-1),t[9]||=z(`path`,{d:`M15.5 5.5c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zM5 12c-2.8 0-5 2.2-5 5s2.2 5 5 5 5-2.2 5-5-2.2-5-5-5zm0 8.5c-1.9 0-3.5-1.6-3.5-3.5s1.6-3.5 3.5-3.5 3.5 1.6 3.5 3.5-1.6 3.5-3.5 3.5zm5.8-10l2.4-2.4.8.8c1.3 1.3 3 2.1 5.1 2.1V9c-1.5 0-2.7-.6-3.6-1.5l-1.9-1.9c-.5-.4-1-.6-1.6-.
196s-1.1.2-1.4.6L7.8 8.4c-.4.4-.6.9-.6 1.4 0 .6.2 1.1.6 1.4L11 14v5h2v-6.2l-2.2-2.3zM19 12c-2.8 0-5 2.2-5 5s2.2 5 5 5 5-2.2 5-5-2.2-5-5-5zm0 8.5c-1.9 0-3.5-1.6-3.5-3.5s1.6-3.5 3.5-3.5 3.5 1.6 3.5 3.5-1.6 3.5-3.5 3.5z`},null,-1)],64)):n.speedProfileId===`FOOT`?(v(),M(D,{key:3},[t[10]||=z(`path`,{class:`routing-speed-profile-icon-FOOT`,d:`M0 0h24v24H0V0z`,fill:`none`},null,-1),t[11]||=z(`path`,{d:`M13.5 5.5c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zM9.8 8.9L7 23h2.1l1.8-8 2.1 2v6h2v-7.5l-2.1-2 .6-3C14.8 12 16.8 13 19 13v-2c-1.9 0-3.5-1-4.3-2.4l-1-1.6c-.56-.89-1.68-1.25-2.65-.84L6 8.3V13h2V9.6l1.8-.7`},null,-1)],64)):n.speedProfileId===`WHEELCHAIR`?(v(),M(D,{key:4},[t[12]||=z(`path`,{class:`routing-speed-profile-icon-WHEELCHAIR`,d:`M0 0h24v24H0V0z`,fill:`none`},null,-1),t[13]||=z(`circle`,{cx:`12`,cy:`4`,r:`2`},null,-1),t[14]||=z(`path`,{d:`M19 13v-2c-1.54.02-3.09-.75-4.07-1.83l-1.29-1.43c-.17-.19-.38-.34-.61-.45-.01 0-.01-.01-.02-.01H13c-.35-.2-.75-.3-1.19-.26C10.76 7.11 10 8.04 10 9.09V15c0 1.1.9 2 2 2h5v5h2v-5.5c0-1.1-.9-2-2-2h-3v-3.45c1.29 1.07 3.25 1.94 5 1.95zm-9 7c-1.66 0-3-1.34-3-3 0-1.31.84-2.41 2-2.83V12.1c-2.28.46-4 2.48-4 4.9 0 2.76 2.24 5 5 5 2.42 0 4.44-1.72 4.9-4h-2.07c-.41 1.16-1.52 2-2.83 2z`},null,-1)],64)):L(``,!0)],8,fS))],32)}var mS=K(dS,[[`render`,pS],[`__scopeId`,`data-v-2291b9ea`]]);y();var hS={name:`RoutingAvoidFeatures`,props:{activeAvoidFeaturesOptions:{type:Array,required:!0},settings:{type:Object,required:!0},disabled:{type:Boolean,required:!1},isTSR:{type:Boolean,required:!1}},emits:[`addAvoidOption`,`removeAvoidOption`],data(){return{showAvoidFeatures:!1,avoidFeaturesFromConfig:void 0,avoidSpeedProfileOptionsConstants:Xy}},computed:{...N(`Modules/Routing`,[`directionsSettings`]),avoidSpeedProfileOptions({settings:e}){return this.avoidSpeedProfileOptionsConstants?.filter(t=>t.availableProfiles?.includes(e.speedProfile))}},created(){this.avoidFeaturesFromConfig=this.directionsSettings?.customAvoidFeatures,this.avoidFeaturesFromConfig&&this.syncAvoidFeatures(this.avoidFeaturesFromConfig)},methods:{syncAvoidFeatures(e){for(let t in e){this.removeDefaultSetting(t);for(let n in e[t])this.updateAvoidSpeedProfileOptions(e[t][n],t)}},removeDefaultSetting(e){let t=this.avoidSpeedProfileOptionsConstants;for(let n in t)if(this.avoidSpeedProfileOptionsConstants[n].availableProfiles.includes(e)){let t=this.avoidSpeedProfileOptionsConstants[n].availableProfiles.indexOf(e);this.avoidSpeedProfileOptionsConstants[n].availableProfiles.splice(t,1)}},updateAvoidSpeedProfileOptions(e,t){let n=this.avoidSpeedProfileOptionsConstants,r=!1;for(let i in n)n[i].id===e&&(n[i].availableProfiles.includes(t)||(n[i].availableProfiles.push(t),r=!0));r===!1&&n.push({id:e,availableProfiles:[t]})},getIsRoutingAvoidFeaturesOptionsChecked(e){return this.activeAvoidFeaturesOptions?.includes(e.id)},setRoutingAvoidFeaturesOptions(e,t){t?this.$emit(`addAvoidOption`,e.id):this.$emit(`removeAvoidOption`,e.id)}}},gS={id:`routing-avoid-features`,class:`d-flex flex-column`},_S={key:0},vS={key:1},yS={key:0,id:`routing-avoid-features-options`,class:`d-flex flex-column ms-3`},bS=[`id`,`value`,`checked`,`disabled`,`onChange`],xS={class:`ms-2`};function SS(e,t,n,r,i,a){return v(),M(`div`,gS,[z(`button`,{class:`d-flex btn-icon`,onClick:t[0]||=e=>i.showAvoidFeatures=!i.showAvoidFeatures,onKeydown:t[1]||=me(e=>i.showAvoidFeatures=!i.showAvoidFeatures,[`enter`])},[z(`i`,{class:E(i.showAvoidFeatures?`bi-chevron-down`:`bi-chevron-right`)},null,2),n.isTSR?(v(),M(`b`,vS,I(e.$t(`common:modules.routing.tsr.header`)),1)):(v(),M(`b`,_S,I(e.$t(`common:modules.routing.avoidOptions.header`)),1))],32),i.showAvoidFeatures?(v(),M(`div`,yS,[(v(!0),M(D,null,C(a.avoidSpeedProfileOptions,t=>(v(),M(`label`,{key:t.id,class:`pointer`},[z(`input`,{id:`routing-avoid-features-option-input-`+t.id,type:`checkbox`,value:t.id,checked:a.getIsRoutingAvoidFeaturesOptionsChecked(t),disabled:n.disabled,onChange:e=>a.setRoutingAvoidFeaturesOptions(t,e.target.checked)},null,40,bS),z(`span`,xS,I(e.$t(`common:modules.routing.avoidOptions.`+t.id)),1)]))),128))])):L(``,!0)])}var CS=K(hS,[[`render`,SS],[`__scopeId`,`data-v-4a4047aa`]]);y();var wS={name:`RoutingRestrictionsInput`,components:{InputText:vb},data(){return{showRestrictions:!1,isValid:{length:!0,width:!0,height:!0,weight:!0,axleload:!0},min:{length:0,width:0,height:0,weight:0,axleload:0},max:{length:30,width:3.5,height:5,weight:65,axleload:19},length:0,width:0,height:0,weight:0,axleload:0}},computed:{...N(`Modules/Routing/Directions`,[`routingRestrictionsInputData`,`routingRestrictionIsValid`]),...N(`Modules/Routing/Isochrones`,[`isochronesRestrictionsInputData`]),...N(`Modules/Routing`,[`activeRoutingToolOption`]),inputData(){return this.activeRoutingToolOption===`DIRECTIONS`?this.routingRestrictionsInputData:this.isochronesRestrictionsInputData}},watch:{length(){this.validateInput(`length`,this.length,this.min.length,this.max.length)},width(){this.validateInput(`width`,this.width,this.min.width,this.max.width)},height(){this.validateInput(`height`,this.height,this.min.height,this.max.height)},weight(){this.validateInput(`weight`,this.weight,this.min.weight,this.max.weight)},axleload(){this.validateInput(`axleload`,this.axleload,this.min.axleload,this.max.axleload)}},mounted(){this.length=this.inputData.length,this.width=this.inputData.width,this.height=this.inputData.height,this.weight=this.inputData.weight,this.axleload=this.inputData.axleload},methods:{...w(`Modules/Routing/Directions`,[`findDirections`,`removeDirectionsWaypointsDrawInteraction`,`createDirectionsWaypointsDrawInteraction`]),...o(`Modules/Routing/Directions`,[`setRoutingRestrictionIsValid`]),...o(`Modules/Routing/Isochrones`,[`setIsochronesRestrictionIsValid`]),validateInput(e,t,n,r){let i=parseFloat(t);return i>=n&&i<=r?(this.activeRoutingToolOption===`DIRECTIONS`?this.setRoutingRestrictionIsValid({name:e,value:!0}):this.setIsochronesRestrictionIsValid({name:e,value:!0}),this.activeRoutingToolOption===`DIRECTIONS`?(this.routingRestrictionsInputData[e]=i,this.isValid[e]=!0):this.activeRoutingToolOption===`ISOCHRONES`&&(this.isochronesRestrictionsInputData[e]=i,this.isValid[e]=!0),!0):(this.activeRoutingToolOption===`DIRECTIONS`?this.setRoutingRestrictionIsValid({name:e,value:!1}):this.setIsochronesRestrictionIsValid({name:e,value:!1}),this.isValid[e]=!1,!1)}}}
19,TS={id:`routing-restrictions`,class:`d-flex flex-column`},ES={key:0,class:`grid-container`},DS={class:`grid-column`},OS={class:`form-floating mb-3 w-100 mt-3`},kS={class:`form-floating mb-3 w-100 mt-3`},AS={class:`form-floating mb-3 w-100 mt-3`},jS={class:`grid-column`},MS={class:`form-floating mb-3 w-100 mt-3`},NS={class:`form-floating mb-3 w- mt-3`},PS={class:`form-group-row`},FS={for:`hazmatInput`,class:`col-form-label`};function IS(e,t,n,r,i,o){let c=a(`InputText`);return v(),M(`div`,TS,[z(`button`,{class:`d-flex btn-icon`,onClick:t[0]||=e=>i.showRestrictions=!i.showRestrictions,onKeydown:t[1]||=me(e=>i.showRestrictions=!i.showRestrictions,[`enter`])},[z(`i`,{class:E(i.showRestrictions?`bi-chevron-down`:`bi-chevron-right`)},null,2),z(`b`,null,I(e.$t(`common:modules.routing.restrictions.header`)),1)],32),i.showRestrictions?(v(),M(`div`,ES,[z(`div`,DS,[z(`div`,OS,[A(c,{id:`routing-restrictions-length-input`,modelValue:i.length,"onUpdate:modelValue":t[2]||=e=>i.length=e,type:`number`,"class-obj":[`w-100 form-control`+(i.isValid.length?` is-valid`:` is-invalid`)],min:i.min.length,max:i.max.length,step:.1,label:e.$t(`common:modules.routing.restrictions.length`),placeholder:e.$t(`common:modules.routing.restrictions.placeholder`),"error-message":e.$t(`common:modules.routing.restrictions.tooltip`,{min:i.min.length,max:i.max.length}),onChange:t[3]||=t=>e.activeRoutingToolOption===`DIRECTIONS`?e.findDirections():null},null,8,[`modelValue`,`class-obj`,`min`,`max`,`label`,`placeholder`,`error-message`])]),z(`div`,kS,[A(c,{id:`rout
19ing-restrictions-width-input`,modelValue:i.width,"onUpdate:modelValue":t[4]||=e=>i.width=e,type:`number`,"class-obj":[`w-100 form-control`+(i.isValid.width?` is-valid`:` is-invalid`)],min:i.min.width,max:i.max.width,step:.1,label:e.$t(`common:modules.routing.restrictions.width`),placeholder:e.$t(`common:modules.routing.restrictions.placeholder`),"error-message":e.$t(`common:modules.routing.restrictions.tooltip`,{min:i.min.width,max:i.max.width}),onChange:t[5]||=t=>e.activeRoutingToolOption===`DIRECTIONS`?e.findDirections():null},null,8,[`modelValue`,`class-obj`,`min`,`max`,`label`,`placeholder`,`error-message`])]),z(`div`,AS,[A(c,{id:`routing-restrictions-height-input`,modelValue:i.height,"onUpdate:modelValue":t[6]||=e=>i.height=e,type:`number`,"class-obj":[`w-100 form-control`+(i.isValid.height?` is-valid`:` is-invalid`)],min:i.min.height,max:i.max.height,step:.1,label:e.$t(`common:modules.routing.restrictions.height`),placeholder:e.$t(`common:modules.routing.restrictions.placeholder`),"error-message":e.$t(`common:modules.routing.restrictions.tooltip`,{min:i.min.height,max:i.max.height}),onChange:t[7]||=t=>e.activeRoutingToolOption===`DIRECTIONS`?e.findDirections():null},null,8,[`modelValue`,`class-obj`,`min`,`max`,`label`,`placeholder`,`error-message`])])]),z(`div`,jS,[z(`div`,MS,[A(c,{id:`rout
19ing-restrictions-weight-input`,modelValue:i.weight,"onUpdate:modelValue":t[8]||=e=>i.weight=e,type:`number`,"class-obj":[`w-100 form-control`+(i.isValid.weight?` is-valid`:` is-invalid`)],min:i.min.weight,max:i.max.weight,step:.1,label:e.$t(`common:modules.routing.restrictions.weight`),placeholder:e.$t(`common:modules.routing.restrictions.placeholder`),"error-message":e.$t(`common:modules.routing.restrictions.tooltip`,{min:i.min.weight,max:i.max.weight}),onChange:t[9]||=t=>e.activeRoutingToolOption===`DIRECTIONS`?e.findDirections():null},null,8,[`modelValue`,`class-obj`,`min`,`max`,`label`,`placeholder`,`error-message`])]),z(`div`,NS,[A(c,{id:`routing-restrictions-axleload-input`,modelValue:i.axleload,"onUpdate:modelValue":t[10]||=e=>i.axleload=e,type:`number`,"class-obj":[`w-100 form-control`+(i.isValid.axleload?` is-valid`:` is-invalid`)],min:i.min.axleload,max:i.max.axleload,step:.1,label:e.$t(`common:modules.routing.restrictions.axleload`),placeholder:e.$t(`common:modules.routing.restrictions.placeholder`),"error-message":e.$t(`common:modules.routing.restrictions.tooltip`,{min:i.min.axleload,max:i.max.axleload}),onChange:t[11]||=t=>e.activeRoutingToolOption===`DIRECTIONS`?e.findDirections():null},null,8,[`modelValue`,`class-obj`,`min`,`max`,`label`,`placeholder`,`error-message`])]),z(`div`,PS,[z(`label`,FS,I(e.$t(`common:modules.routing.restrictions.hazmat`)),1),z(`div`,null,[s(z(`input`,{id:`hazmatInput`,"onUpdate:modelValue":t[12]||=e=>o.inputData.hazmat=e,type:`checkbox`,autocomplete:`off`,onFocus:t[13]||=t=>e.isFocused=!0,onBlur:t[14]||=t=>e.isFocused=!1,onChange:t[15]||=t=>e.activeRoutingToolOption===`DIRECTIONS`?e.findDirections():null},null,544),[[We,o.inputData.hazmat]])])])])])):L(``,!0)])}var LS=K(wS,[[`render`,IS],[`__scopeId`,`data-v-a78f8a04`]]);y();var RS={name:`RoutingElevationProfile`,data(){return{collapseProfile:!1,distances:[],elevations:[],ascent:``,descent:``,chart:{}}},computed:{...N(`Modules/Routing/Directions`,[`routingDirections`,`directionsElevationSource`]),...N(`Modules/Routing/TSR`,[`tsrDirections`,`tsrElevationSource`]),...N(`Modules/Routing`,[`activeRoutingToolOption`,`directionsSettings`,`tsrSettings`]),directions(){return this.activeRoutingToolOption===`TSR`?this.tsrDirections:this.routingDirections},layerSource(){return this.activeRoutingToolOption===`TSR`?k(this.tsrElevationSource):k(this.directionsElevationSource)}},mounted(){this.distances=this.directions.elevationProfile.data.map(e=>e[0]),this.elevations=this.directions.elevationProfile.data.map(e=>e[1]),this.ascent=Math.round(this.directions.elevationProfile.ascent).toLocaleString(),this.descent=Math.round(this.directions.elevationProfile.descent).toLocaleString();let e=this.$refs.elevationProfile;this.chart=this.drawChart(e),e.addEventListener(`mouseleave`,()=>{let e=this.layerSource;e.removeFeature(e.getFeatures()[0])})},methods:{drawChart(e,t=Xt){let n=``,r=``;return this.activeRoutingToolOption===`DIRECTIONS`?(n=this.directionsSettings.styleElevationProfile.profileColor,r=this.directionsSettings.styleElevationProfile.profileFillColor):this.activeRoutingToolOption===`TSR`&&(n=this.tsrSettings.styleElevationProfile.profileColor,r=this.tsrSettings.styleElevationProfile.profileFillColor),new t(e,{type:`line`,data:{labels:this.distances,datasets:[{data:this.elevations,borderWidth:2,borderColor:n,backgroundColor:r,pointStyle:!1,fill:!0,cubicInterpolationMode:`monotone`}]},options:{interaction:{intersect:!1,mode:`index`},responsive:!0,maintainAspectRatio:!1,scales:{y:{title:{display:!0,text:this.$t(`common:modules.routing.elevationProfile.yAxis`)}},x:{display:!1,title:{display:!0,text:this.$t(`common:modules.routing.elevationProfile.xAxis`)}}},plugins:{title:{display:!0,text:this.$t(`common:modules.routing.elevationProfile.titleChart`)},legend:{display:!1},tooltip:{callbacks:{label:this.labelToolTip,title:this.titleToolTip}}},onHover:this.onHover},plugins:[{afterDraw:this.drawVerticalLine}]})},labelToolTip(e){return`${e.parsed.y} m`},titleToolTip(e){let t=Number(e[0].label);return t<1e3?this.$t(`common:modules.routing.elevationProfile.titleTooltipMeters`,{distance:t.toFixed(2)}):this.$t(`common:modules.routing.elevationProfile.titleTooltipKilometers`,{distance:(t/1e3).toFixed(2)})},onHover(e,t){let n=this.layerSource;if(t.length){let e=t[0].index,i=this.directions.lineString[e];if(n.getFeatures().length===0){let e=new V({geometry:new r(i)});n.addFeature(e)}else n.getFeatures()[0].getGeometry().setCoordinates(i)}},drawVerticalLine(e){let t=``;if(this.activeRoutingToolOption===`DIRECTIONS`?t=this.directionsSettings.styleElevationProfile.elevationPointLineColor:this.activeRoutingToolOption===`TSR`&&(t=this.tsrSettings.styleElevationProfile.elevationPointLineColor),e.tooltip?._active?.length){let n=e.tooltip._active[0].element.x,r=e.scales.y,i=e.ctx;i.save(),i.beginPath(),i.moveTo(n,r.top),i.lineTo(n,r.bottom),i.lineWidth=1,i.strokeStyle=t,i.stroke(),i.restore(
19)}},collapse(){this.collapseProfile?(this.$refs.elevationProfile.style.display=`block`,this.$refs.ascentDescent.style.display=`block`):(this.$refs.elevationProfile.style.display=`none`,this.$refs.ascentDescent.style.display=`none`),this.collapseProfile=!this.collapseProfile}}},zS={id:`elevation-profile`,ref:`elevationProfile`},BS={id:`ascent-descent-data`,ref:`ascentDescent`},VS={class:`d-flex justify-content-around`};function HS(e,t,n,r,i,a){return v(),M(D,null,[z(`button`,{class:`d-flex btn-icon`,onClick:t[0]||=e=>a.collapse()},[z(`i`,{class:E(i.collapseProfile?`bi-chevron-right`:`bi-chevron-down`)},null,2),z(`b`,null,I(e.$t(`common:modules.routing.elevationProfile.titleCollapse`)),1)]),z(`div`,null,[z(`canvas`,zS,null,512)]),z(`div`,BS,[z(`div`,VS,[z(`span`,null,[t[1]||=z(`i`,{class:`bi bi-arrow-up`},null,-1),R(` `+I(i.ascent)+` m `,1)]),z(`span`,null,[t[2]||=z(`i`,{class:`bi bi-arrow-down`},null,-1),R(` `+I(i.descent)+` m `,1)])])],512)],64)}var US=K(RS,[[`render`,HS],[`__scopeId`,`data-v-c76e4c91`]]);function WS(e){let t=X.directionsSettings.styleWaypoint?X.directionsSettings.styleWaypoint:X.Directions.settings.styleWaypoint,n=e.get(`routingId`);return new T({image:new re({radius:t.radius,stroke:new x({color:[...t.lineColor,1],width:t.lineWidth}),fill:new S({color:[...t.fillColor,t.opacity]})}),text:n===void 0?null:new we({textAlign:`center`,textBaseline:`middle`,text:String(n+1),fill:new S({color:t.textFillColor}),stroke:new x({color:t.textLineColor,width:t.textLineWidth})})})}var GS=new Pe,KS=new Rt({source:GS,style:tC,name:`tsr_waypoints_layer`,alwaysOnTop:!0}),qS=new je({source:GS}),JS=new Ze({source:GS}),YS=new i({source:GS,type:`Point`,style:tC,condition:e=>e.originalEvent.buttons===1}),XS=new Pe({features:[new V({geometry:new sn([])})]}),ZS=new Rt({source:XS,style:Ux.createtsrRouteStyle,name:`tsr_route_layer`,alwaysOnTop:!0}),QS=new Pe;function $S(){return new T({image:new re({radius:6,stroke:new x({color:X.tsrSettings.styleElevationProfile.elevationPointLineColor,width:3}),fill:new S({color:X.tsrSettings.styleElevationProfile.elevationPointFillColor})})})}var eC={tsrWaypointsSource:GS,tsrWaypointsLayer:KS,tsrRouteSource:XS,tsrRouteLayer:ZS,tsrElevationSource:QS,tsrElevationLayer:new Rt({source:QS,style:$S,name:`tsr_elevation_layer`,alwaysOnTop:!0}),tsrWaypointsModifyInteraction:qS,tsrWaypointsSnapInteraction:JS,tsrWaypointsDrawInteraction:YS,waypoints:[],addStartEndPoint:1,tsrDirections:null,tsrDistance:``,tsrDuration:``,mapListenerAdded:!1,isLoadingDirections:!1,mapInteractionMode:`WAYPOINTS`,settings:X.tsrSettings};function tC(e){let t=X.tsrSettings.styleWaypoint?X.tsrSettings.styleWaypoint:X.tsr.settings.styleWaypoint,n=e.get(`routingId`),r,i,a;return n===0?(r=new x({color:[244,34,37,1],width:t.lineWidth}),i=new S({color:[244,34,37,t.opacity]}),a=i18next.t(`common:modules.routing.startIndex`)):n===X.TSR.waypoints.length-1?(r=new x({color:[51,
19164,71,1],width:t.lineWidth}),i=new S({color:[51,164,71,t.opacity]}),a=i18next.t(`common:modules.routing.endIndex`)):(r=new x({color:[0,119,182,1],width:t.lineWidth}),i=new S({color:[0,119,182,t.opacity]}),a=eC.tsrDirections?String(n):``),new T({image:new re({radius:t.radius,stroke:r,fill:i}),text:n===void 0?null:new we({textAlign:`center`,textBaseline:`middle`,text:a,fill:new S({color:t.textFillColor}),stroke:new x({color:t.textLineColor,width:t.textLineWidth})})})}function nC(){let e=X.directionsSettings.styleAvoidAreas?X.directionsSettings.styleAvoidAreas:X.Directions.settings.styleAvoidAreas;return new T({fill:new S({color:[...e.fillColor,e.opacity]}),stroke:new x({color:[...e.lineColor,1],width:e.lineWidth}),image:new re({radius:2,stroke:new x({color:[...e.lineColor,1],width:e.pointLineWidth}),fill:new S({color:[...e.fillColor,e.opacity]})})})}y();var rC={name:`RoutingContextMenu`,components:{InputText:vb,FlatButton:Zx},data(){return{map:null,overlay:null,selectPointInteraction:null,selectAvoidInteraction:null,contextMenu:null,coordinates:null,selectedFeature:null,avoidRadius:0}},computed:{...N(`Modules/Routing`,[`activeRoutingToolOption`]),...N(`Modules/Routing/Directions`,{waypointsDirections:`waypoints`}),...N(`Modules/Routing/Directions`,[`directionsWaypointsLayer`,`directionsAvoidLayer`,`directionsAvoidSource`,`directionsAvoidPointLayer`,`directionsAvoidPointSource`,`mapInteractionMode`,`settings`]),...N(`Modules/Routing/TSR`,{waypointsTSR:`waypoints`}),...N(`Modules/Routing/TSR`,[`tsrWaypointsLayer`,`tsrRouteLayer`]),isRadiusValid(){return this.avoidRadius!==``&&this.avoidRadius<=this.settings.maxAvoidRadius&&this.avoidRadius>=0},isMapInteractionModeAvoidPointsEdit(){return this.mapInteractionMode===`AVOID_POINTS`}},watch:{avoidRadius(){this.settings.avoidRadius=this.avoidRadius,this.isRadiusValid&&this.isMapInteractionModeAvoidPointsEdit?this.createDirectionsAvoidPointDrawInteraction():this.removeDirectionsAvoidDrawInteraction()}},mounted(){this.appendModalToBody(),this.map=mapCollection.getMap(`2D`),this.overlay=new wn({id:`context-menu`,element:this.$refs[`ref-context-menu`]}),this.map.addOverlay(this.overlay),this.createRightClickWaypoint(),this.createRightClickAvoidPoint(),this.selectAvoidInteraction=new tt({layers:[k(this.directionsAvoidLayer),k(this.directionsAvoidPointLayer)],style:nC,condition:e=>e.originalEvent.buttons===2}),this.selectAvoidInteraction.on(`select`,e=>{e.selected.length>0?this.selectedFeature={type:`avoid`,feature:e.selected[0]}:this.selectedFeature=null}),this.map.addInteraction(this.selectAvoidInteraction),this.map.getViewport().addEventListener(`contextmenu`,this.setContextMenu)},beforeUnmount(){this.removeModalFromBody()},unmounted(){this.map.removeOverlay(this.map.getOverlayById(`context-menu`)),this.map.getViewport().removeEventListener(`contextmenu`,this.setContextMenu),this.map.removeInteraction(k(this.selectPointInteraction)),this.map.removeInteraction(k(this.selectAvoidInteraction)),document.body.removeEventListener(`click`,this.closeContextMenu)},methods:{...w(`Modules/Routing`,[`fetchTextByCoordinates`,`transformCoordinatesLocalToWgs84Projection`,`transformCoordinatesWgs84ToLocalProjection`]),...w(`Modules/Routing/Directions`,{addWaypointDirections:`addWaypoint`,removeWaypointDirections:`removeWaypoint`}),...w(`Modules/Routing/Directions`,[`findDirections`,`createDirectionsAvoidPointDrawInteraction`,`removeDirectionsAvoidDrawInteraction`]),...w(`Modules/Routing/TSR`,{addWaypointTSR:`addWaypoint`,removeWaypointTSR:`removeWaypoint`}),...w(`Modules/Routing/TSR`,[`isStartEndInput`]),...w(`Alerting`,[`addSingleAlert`]),appendModalToBody(){let e=this.$refs[`ref-avoidPointModal`];e&&document.body.appendChild(e)},removeModalFromBody(){let e=this.$refs[`ref-avoidPointModal`];e&&document.body.removeChild(e)},setContextMenu(e){e.preventDefault(),(this.activeRoutingToolOption===`DIRECTIONS`&&this.mapInteractionMode!==`AVOID_POINTS`&&this.mapInteractionMode!==`AVOID_AREAS`&&this.mapInteractionMode!==`DELETE_AVOID_AREAS`||this.activeRoutingToolOption===`TSR`&&this.tsrRouteLayer.getSource().getFeatures()[0].getGeometry().getCoordinates().length===0)&&(this.coordinates=this.map.getEventC
19oordinate(e),this.overlay.setPosition(this.coordinates),this.contextMenu=zt.getInstance(this.overlay.getElement()),this.contextMenu?this.contextMenu.setContent({content:this.selectedFeature?this.$refs[`ref-context-menu-content-featureclick`].innerHTML:this.$refs[`ref-context-menu-content-mapclick`].innerHTML,title:this.$refs[`ref-context-menu-title`].innerHTML}):this.contextMenu=new zt(this.overlay.getElement(),{animation:!1,container:this.overlay.getElement(),html:!0,placement:`top`,trigger:`focus`,content:this.selectedFeature?this.$refs[`ref-context-menu-content-featureclick`].innerHTML:this.$refs[`ref-context-menu-content-mapclick`].innerHTML,title:this.$refs[`ref-context-menu-title`].innerHTML,customClass:`routing-popover`}),this.contextMenu.show(),this.addEventListenerContextMenu(),document.body.addEventListener(`click`,this.closeContextMenu))},closeContextMenu(e){if(this.contextMenu&&document.querySelector(`.routing-popover`)){let t=document.querySelector(`.routing-popover`).getBoundingClientRect(),n=!0;e.x>=t.left&&e.x<=t.right&&e.y>=t.top&&e.y<=t.bottom&&(n=!1),n&&(this.contextMenu.dispose(),this.contextMenu=null,document.body.removeEventListener(`click`,this.closeContextMenu))}},addEventListenerContextMenu(){document.querySelector(`.routing-popover .popover-header`)&&document.querySelector(`.routing-popover .popover-header`).classList.add(`routing-popover-header`),document.querySelector(`.routing-popover .popover-body`)&&document.querySelector(`.routing-popover .popover-body`).classList.add(`routing-popover-body`),document.getElementsByClassName(`routing-popover-header`)[0].getElementsByClassName(`routing-close-context-menu`)[0]&&document.getElementsByClassName(`routing-popover-header`)[0].getElementsByClassName(`routing-close-context-menu`)[0].addEventListener(`click`,()=>{this.contextMenu.dispose(),this.contextMenu=null}),document.getElementsByClassName(`routing-popover-body`)[0].getElementsByClassName(`list-group`)[0]&&document.getElementsByClassName(`routing-popover-body`)[0].getElementsByClassName(`list-group`)[0].addEventListener(`click`,this.initAction)},handleDirectionsEvent(e,t,n){let r=e.target.id,i=this.selectedFeature&&this.waypointsDirections.find(e=>e.feature.ol_uid===this.selectedFeature.feature.ol_uid),a=this.waypointsDirections.slice(1,this.waypointsDirections.length-1).find(e=>e.coordinates.length===0);switch(r){case`add-startpoint`:this.waypointsDirections[0].setCoordinates(t),n&&this.waypointsDirections[0].setDisplayName(n.getDisplayName()),this.findDirections();break;case`add-waypoint`:a?(this.waypointsDirections[a.index].setCoordinates(t),n&&this.waypointsDirections[a.index].setDisplayName(n.getDisplayName())):this.addWaypointDirections({index:this.waypointsDirections.length-1,coordinates:t,displayName:n?n.getDisplayName():``}),this.findDirections();break;case`add-endpoint`:this.waypointsDirections[this.waypointsDirections.length-1].setCoordinates(t),n&&this.waypointsDirections[this.waypointsDirections.length-1].setDisplayName(n.getDisplayName()),this.findDirections();break;case`add-avoidpoint`:this.avoidRadius=this.settings.avoidRadius,new pt(document.querySelector(`#avoidPointModal`)).show();break;case`remove-point`:this.removeWaypointDirections({index:i.index,reload:!0});break;case`remove-avoid`:this.selectedFeature.feature.getGeometry().getType()===`Circle`?this.directionsAvoidPointSource.removeFeature(this.selectedFeature.feature):this.directionsAvoidSource.removeFeature(this.selectedFeature.feature),this.findDirections();break;default:console.warn(`Action type to handle directions event is invalid.`)}},handleTSREvent(e,t,n){let r=e.target.id,i=this.selectedFeature&&this.waypointsTSR.find(e=>e.feature.ol_uid===this.selectedFeature.feature.ol_uid),a=this.waypointsTSR.slice(1,this.waypointsTSR.length-1).find(e=>e.displayName===void 0);switch(r){case`add-startpoint`:this.waypointsTSR[0].setCoordinates(t),n&&this.waypointsTSR[0].setDisplayName(n.getDisplayName());break;case`add-endpoint`:this.removeWaypointTSR({index:this.waypointsTSR.length-1}
19),this.waypointsTSR[this.waypointsTSR.length-1].setCoordinates(t),n?this.waypointsTSR[this.waypointsTSR.length-1].setDisplayName(n.getDisplayName()):this.waypointsTSR[this.waypointsTSR.length-1].setDisplayName(``);break;case`add-waypoint`:this.isStartEndInput(1),a?(this.waypointsTSR[a.index].setCoordinates(t),n&&this.waypointsTSR[a.index].setDisplayName(n.getDisplayName())):this.addWaypointTSR({index:this.waypointsTSR.length-1,coordinates:t,displayName:n?n.getDisplayName():``});break;case`remove-point`:this.removeWaypointTSR({index:i.index});break;default:console.warn(`Action type to handle directions event is invalid.`)}},async initAction(e){try{let t=await this.fetchTextByCoordinates({coordinates:await this.transformCoordinatesLocalToWgs84Projection(k(this.coordinates))}),n=k(this.coordinates);this.activeRoutingToolOption===`DIRECTIONS`?this.handleDirectionsEvent(e,n,t):this.activeRoutingToolOption===`TSR`&&this.handleTSREvent(e,n,t)}catch{this.addSingleAlert({category:this.$t(`common:modules.alerting.categories.error`),content:this.$t(`common:modules.routing.directions.batchProcessing.errorContextMenuSetPoint`)})}this.contextMenu.dispose(),this.contextMenu=null},showAddwaypointOption(){return this.activeRoutingToolOption!==`DIRECTIONS`||this.waypointsDirections[0]?.coordinates.length>0&&this.waypointsDirections[this.waypointsDirections.length-1]?.coordinates.length>0},addAvoidPoint(){let e=new V({geometry:new ht(this.coordinates)}),t=pt.getInstance(this.$refs[`ref-avoidPointModal`]);e.getGeometry().setRadius(this.avoidRadius>0?this.avoidRadius*1e3:5),this.directionsAvoidPointSource.addFeature(e),t.hide(),this.findDirections()},createRightClickWaypoint(){this.selectPointInteraction=new tt({layers:this.activeRoutingToolOption===`DIRECTIONS`?[k(this.directionsWaypointsLayer)]:[k(this.tsrWaypointsLayer)],style:this.activeRoutingToolOption===`DIRECTIONS`?WS:tC,condition:e=>e.originalEvent.buttons===2}),this.selectPointInteraction.on(`select`,e=>{e.selected.length>0?this.selectedFeature={type:`point`,feature:e.selected[0]}:this.selectedFeature=null}),this.map.addInteraction(this.selectPointInteraction)},createRightClickAvoidPoint(){this.selectAvoidInteraction=new tt({layers:[k(this.directionsAvoidLayer),k(this.directionsAvoidPointLayer)],style:nC,condition:e=>e.originalEvent.buttons===2}),this.selectAvoidInteraction.on(`select`,e=>{e.selected.length>0?this.selectedFeature={type:`avoid`,feature:e.selected[0]}:this.selectedFeature=null}),this.map.addInteraction(this.selectAvoidInteraction)}}},iC={id:`context-menu`,ref:`ref-context-menu`},aC={id:`context-menu-title`,ref:`ref-context-menu-title`},oC={class:`d-flex justify-content-between`},sC={id:`context-menu-content-mapclick`,ref:`ref-context-menu-content-mapclick`,class:`context-menu-content`},cC={class:`list-group list-group-flush`},lC={id:`add-startpoint`,class:`list-group-item list-group-item-action`},uC={key:0,id:`add-waypoint`,class:`list-group-item list-group-item-action`},dC={id:`add-endpoint`,class:`list-group-item list-group-item-action`},fC={key:1,id:`add-avoidpoint`,class:`list-group-item list-group-item-action`},pC={id:`context-menu-content-featureclick`,ref:`ref-context-menu-content-featureclick`,class:`context-menu-content`},mC={class:`list-group list-group-flush`},hC={key:0,id:`remove-point`,class:`list-group-item list-group-item-action`},gC={key:1,id:`remove-avoid`,class:`list-group-item list-group-item-action`},_C={id:`avoidPointModal`,ref:`ref-avoidPointModal`,class:`modal`,tabindex:`-1`,"aria-labelledby":`avoidPointModalLabel`},vC={class:`modal-dialog modal-dialog-centered`},yC={class:`modal-content`},bC={class:`modal-header`},xC={id:`avoidPointModalLabel`,class:`modal-title fs-5`},SC={class:`modal-body`},CC={class:`input-group mb-3`},wC={class:`form-floating mb-3 w-100 mt-3`},TC={class:`form-floating mb-3`},EC={id:`draw-avoidPoint-settings`,class:`form-select`,disabled:``},DC={for:`draw-circle-settings`},OC={class:`d-flex justify-content-center`};function kC(e,t,n,r,i,o){let s=a(`InputText`),c=a(`FlatButton`);return v(),M(D,null,[z(`div`,iC,[z(`div`,aC,[z(`div`,oC,[z(`span`,null,I(e.$t(`common:modules.routing.contextMenu.header`)),1),t[1]||=z(`span`,{class:`routing-close-context-menu`},[z(`i`,{class:`bi bi-x-circle`})],-1)])],512),z(`div`,sC,[z(`ul`,cC,[z(`li`,lC,I(e.$t(`common:modules.routing.contextMenu.addStartpoint`)),1
19),o.showAddwaypointOption()?(v(),M(`li`,uC,I(e.$t(`common:modules.routing.contextMenu.addWaypoint`)),1)):L(``,!0),z(`li`,dC,I(e.$t(`common:modules.routing.contextMenu.addEndpoint`)),1),e.activeRoutingToolOption===`DIRECTIONS`?(v(),M(`li`,fC,I(e.$t(`common:modules.routing.contextMenu.addAvoidPoint`)),1)):L(``,!0)])],512),z(`div`,pC,[z(`ul`,mC,[i.selectedFeature&&i.selectedFeature.type===`point`?(v(),M(`li`,hC,I(e.$t(`common:modules.routing.contextMenu.removePoint`)),1)):L(``,!0),i.selectedFeature&&i.selectedFeature.type===`avoid`?(v(),M(`li`,gC,I(e.$t(`common:modules.routing.contextMenu.removeAvoidPoint`)),1)):L(``,!0)])],512)],512),z(`div`,_C,[z(`div`,vC,[z(`div`,yC,[z(`div`,bC,[z(`h1`,xC,[z(`b`,null,I(e.$t(`common:modules.routing.contextMenu.avoidPointModalTitle`)),1)]),t[2]||=z(`button`,{type:`button`,class:`btn-close`,"data-bs-dismiss":`modal`,"aria-label":`Close`},null,-1)]),z(`div`,SC,[z(`div`,CC,[z(`div`,wC,[A(s,{id:`avoidRadius`,modelValue:i.avoidRadius,"onUpdate:modelValue":t[0]||=e=>i.avoidRadius=e,type:`number`,"class-obj":[`form-control`+(o.isRadiusValid?` is-valid`:` is-invalid`)],class:`w-100`,"aria-describedby":`avoidPointRadius-input-help`,label:e.$t(`common:modules.routing.directions.avoidAreas.avoidPointRadius`),placeholder:e.$t(`common:modules.routing.directions.avoidAreas.avoidPointRadiusOutOfRangeKm`),min:0,step:.1,max:12,"error-message":e.$t(`common:modules.routing.directions.avoidAreas.avoidPointRadiusOutOfRangeKm`)},null,8,[`modelValue`,`class-obj`,`label`,`placeholder`,`error-message`])]),z(`div`,TC,[z(`select`,EC,[z(`option`,null,I(e.$t(`common:modules.routing.directions.avoidAreas.avoidPointRadiusUnitKm`)),1)]),z(`label`,DC,I(e.$t(`common:shared.modules.draw.drawSettingsCircle.unit`)),1)])]),z(`div`,OC,[A(c,{id:`btn-add-avoidpoint`,class:E({disabled:!o.isRadiusValid}),"aria-label":e.$t(`common:modules.routing.settings.submit`),text:e.$t(`common:modules.routing.settings.submit`),interaction:e=>o.addAvoidPoint(),role:`button`},null,8,[`class`,`aria-label`,`text`,`interaction`])])])])])],512)],64)}var AC=K(rC,[[`render`,kC],[`__scopeId`,`data-v-7b9be0ad`]]),jC=t({preferenceOptions:()=>MC}),MC=[`RECOMMENDED`,`SHORTEST`];y();var NC={name:`DirectionsItem`,components:{IconButton:ab,RoutingExportAvoidAreas:Pb,RoutingImportAvoidAreas:Kb,RoutingCoordinateInput:ix,RoutingDistanceDisplay:lx,RoutingDurationDisplay:gx,RoutingDownload:uS,DirectionsItemBatchProcessing:Nx,RoutingBatchProcessingCheckbox:zx,RoutingAvoidFeatures:CS,RoutingSpeedProfileIcon:mS,RoutingRestrictionsInput:LS,RoutingElevationProfile:US,LightButton:pb,RoutingContextMenu:AC,InputText:vb},data(){return{constants:jC,constantsRouting:Jy,defaultPreference:null,avoidRadius:0,showAvoidAreaButtons:!1}},computed:{...N(`Modules/Routing/Directions`,[`directionsRouteSource`,`directionsAvoidSource`,`directionsAvoidPointSource`,`directionsWaypointsSource`,`isInputDisabled`,`mapInteractionMode`,`routingAvoidFeaturesOptions`,`routingRestrictionsInputData`,`routingDirections`,`settings`,`waypoints`,`keepRoutes`]),...N(`Modules/Routing`,[`directionsSettings`]),isMapInteractionModeAvoidAreasEdit(){return this.mapInteractionMode===`AVOID_AREAS`},isMapInteractionModeAvoidPointsEdit(){return this.mapInteractionMode===`AVOID_POINTS`},isMapInteractionModeAvoidAreasDelete(){return this.mapInteractionMode===`DELETE_AVOID_AREAS`},isRadiusValid(){return this.avoidRadius!==``&&this.avoidRadius<=this.settings.maxAvoidRadius&&this.avoidRadius>=0}},watch:{avoidRadius(){this.settings.avoidRadius=this.avoidRadius,this.isRadiusValid?this.createDirectionsAvoidPointDrawInteraction():this.removeDirectionsAvoidDrawInteraction()}},created(){this.initDirections(),this.defaultPreference=this.directionsSettings?.preference},beforeUnmount(){this.closeDirections(),this.removeModalFromBody()},mounted(){this.appendModalToBody(),this.setMapInteractionMode(`WAYPOINTS`),this.createInteractionFromMapInteractionMode(),this.avoidRadius=this.settings.avoidRadius},methods:{...o(`Modules/Routing/Directions`,[`setRoutingDirections`,`setMapInteractionMode`,`setKeepRoutes`,`setRoutingAvoidFeaturesOptions`]),...w(`Modules/Routing/Directions`,[`findDirections`,`unHighlightRoute`,`highlightRoute`,`zoomToRoute`,`initDirections`,`createInteractionFromMapInteractionMode`,`closeDirections`,`addWaypoint`,`removeWaypoint`,`moveWaypointDown`,`moveWaypointUp`,`isStartEndInput`,`createDirectionsAvoidPointDrawInteraction`,`removeDirectionsAvoidDrawInteraction`]),changeSpeedProfile(e){this.isInputDisabled||(this.settings.speedProfile=e,this.findDirections())},changePreference(e){this.settings.preference=e,this.findDirections()},changeMapInteractionModeAvoidAreasEdit(){let e=this.mapInteractionMode===`AVOID_AREAS`;this.setMapInteractionMode(e?`WAYPOINTS`:`AVOID_AREAS`),this.createInteractionFromMapInteractionMode()},changeMapInteractionModeAvoidPointsEdit(){let e=this.mapInteractionMode===`AVOID_POINTS`;this.setMapInteractionMode(e?`WAYPOINTS`:`AVOID_POINTS`),this.avoidRadius=e?this.avoidRadius:this.settings.avoidRadius,this.createInteractionFromMapInteractionMode(),this.isRadiusValid&&this.mapInteractionMode===`AVOID_POINTS`?this.createDirectionsAvoidPointDrawInteraction():this.removeDirectionsAvoidDrawInteraction()},changeMapInteractionModeAvoidAreasDelete(){let e=this.mapInteractionMode===`DELETE_AVOID_AREAS`;this.setMapInteractionMode(e?`WAYPOINTS`:`DELETE_AVOID_AREAS`),this.createInteractionFromMapInteractionMode()},resetMapInteractionMode(){this.setMapInteractionMode(`WAYPOINTS`),this.createInteractionFromMapInteractionMode()},reset(){for(let e=this.waypoints.length-1;e>=0;e--)this.removeWaypoint({index:this.waypoints[e].index});
19this.directionsRouteSource.getFeatures().forEach(e=>e.getGeometry().setCoordinates([])),this.directionsWaypointsSource?.getFeatures().forEach(e=>this.directionsWaypointsSource.removeFeature(e)),this.setRoutingDirections(null),this.directionsAvoidSource.clear(),this.directionsAvoidPointSource.clear(),this.settings.speedProfile===`HGV`&&(this.routingRestrictionsInputData.length=10,this.routingRestrictionsInputData.width=2.4,this.routingRestrictionsInputData.height=2.8,this.routingRestrictionsInputData.weight=18,this.routingRestrictionsInputData.axleload=6,this.routingRestrictionsInputData.hazmat=!1),this.avoidRadius=this.settings.defaultAvoidRadius,this.setRoutingAvoidFeaturesOptions([]),this.settings.preference=this.defaultPreference},onAddAvoidOption(e){this.routingAvoidFeaturesOptions.push(e),this.findDirections()},onRemoveAvoidOption(e){let t=this.routingAvoidFeaturesOptions.findIndex(t=>t===e);this.routingAvoidFeaturesOptions.splice(t,1),this.findDirections()},onBatchProcessingCheckboxInput(e){this.directionsSettings.batchProcessing.active=e},afterFileValidation(){let e=this.$refs.uploadModal;pt.getInstance(e).hide()},appendModalToBody(){let e=this.$refs.uploadModal;e&&document.body.appendChild(e)},removeModalFromBody(){let e=this.$refs.uploadModal;e&&document.body.removeChild(e)},setAvoidRadius(){this.settings.avoidRadius=this.avoidRadius}}},PC={id:`routing-directions`},FC=[`checked`],IC={class:`ms-2`},LC={id:`routing-directions-coordinate-input-form`,class:`form-horizontal`,role:`form`},RC={class:`helptext mb-3`},zC={class:`row mb-3 m-1`},BC=[`title`],VC={id:`routing-avoid-features`,class:`d-flex flex-column`},HC={class:`mx-2`},UC={key:0,class:`mt-2`},WC={class:`d-flex justify-content-between`},GC={class:`btn-grouping d-flex flex-column align-items-center justify-content-center`},KC={id:`addAvoidArea`,for:`addAvoidAreasBtn`,class:`btn-description`},qC={class:`btn-grouping d-flex flex-column align-items-center justify-content-center`},JC={id:`addAvoidPoint`,for:`addAvoidPointBtn`,class:`btn-description`},YC={class:`btn-grouping d-flex flex-column align-items-center justify-content-center`},XC={id:`deleteAvoidArea`,for:`deleteAvoidAreaBtn`,class:`btn-description`},ZC={class:`btn-grouping d-flex flex-column align-items-center justify-content-center`},QC={id:`exportAvoidAreas`,for:`exportAvoidAreasBtn`,class:`btn-description`},$C={class:`btn-grouping d-flex flex-column align-items-center justify-content-center`},ew={id:`importAvoidAreas`,for:`importAvoidAreasBtn`,class:`btn-description`},tw={key:1},nw={class:`d-flex flex-row mb-3`},rw={class:`form-floating mb-3 w-100 mt-3`},iw={class:`form-floating mb-3`},aw={id:`draw-avoidPoint-settings`,class:`form-select`,disabled:``},ow={for:`draw-circle-settings`},sw={id:`uploadModal`,ref:`uploadModal`,class:`modal fade`,tabindex:`-1`,"aria-labelledby":`uploadModalLabel`,"aria-hidden":`true`},cw={class:`modal-dialog modal-dialog-centered`},lw={class:`modal-content`},uw={class:`modal-header`},dw={id:`uploadModalLabel`,class:`modal-title fs-5`},fw=[`aria-label`],pw={class:`modal-body`},mw={class:`mt-2 col-md-12`},hw={class:`mt-2 mb-2 col-md-12`},gw={for:`routing-directions-preference`,class:`routing-directions-preference-label`},_w=[`id`,`value`,`selected`,`disabled`],vw={key:3},yw={key:0,id:`routing-directions-result-directions`},bw={class:`d-flex justify-content-between`},xw=[`onMouseover`,`onFocus`],Sw=[`onClick`,`onKeydown`],Cw={key:0},ww={key:1},Tw=[`onClick`,`onKeydown`],Ew={class:`d-flex justify-content-between`},Dw={key:0},Ow=[`onMouseover`,`onFocus`,`onClick`,`onKeydown`],kw={class:`ms-0 d-flex flex-column pl-2 py-4 step`},Aw={class:`d-flex justify-content-between`},jw={class:`ms-2`},Mw={key:0},Nw={class:`d-flex justify-content-between mt-2`},Pw=[`title`];function Fw(e,t,n,r,i,o){let s=a(`RoutingSpeedProfileIcon`),c=a(`RoutingBatchProcessingCheckbox`),l=a(`DirectionsItemBatchProcessing`),u=a(`RoutingCoordinateInput`),d=a(`IconButton`),f=a(`RoutingExportAvoidAreas`),p=a(`InputText`),m=a(`RoutingImportAvoidAreas`),h=a(`RoutingRestrictionsInput`),g=a(`RoutingAvoidFeatures`),_=a(`RoutingDurationDisplay`),ee=a(`RoutingDistanceDisplay`),te=a(`RoutingElevationProfile`),y=a(`RoutingDownload`),ne=a(`LightButton`),re=a(`RoutingContextMenu`);return v(),M(D,null,[z(`div`,PC,[(v(!0),M(D,null,C(i.constantsRouting.speedProfileOptions,t=>(v(),F(s,{key:t,interaction:()=>o.changeSpeedProfile(t),class:E([`pointer mr-4 `,e.isInputDisabled?`opacity-05`:``]),"speed-profile-id":t,"fill-color":t===e.settings.speedProfile?`#0077ff`:`#000000`,tooltip:e.$t(`common:modules.routing.speedprofiles.`+t)},null,8,[`interaction`,`class`,`speed-profile-id`,`fill-color`,`tooltip`]))),128)),t[47]||=z(`hr`,null,null,-1),z(`input`,{id:`rout
19ing-delete-routes-input`,type:`checkbox`,checked:e.keepRoutes,onChange:t[0]||=t=>e.setKeepRoutes(t.target.checked)},null,40,FC),z(`span`,IC,I(e.$t(`common:modules.routing.directions.keepRoutesAfterClose`)),1),t[48]||=z(`hr`,null,null,-1),e.directionsSettings.batchProcessing.enabled?(v(),M(D,{key:0},[A(c,{"batch-processing":e.directionsSettings.batchProcessing,onInput:t[1]||=e=>o.onBatchProcessingCheckboxInput(e)},null,8,[`batch-processing`]),t[33]||=z(`hr`,null,null,-1)],64)):L(``,!0),e.directionsSettings.batchProcessing.enabled&&e.directionsSettings.batchProcessing.active?(v(),F(l,{key:1,settings:e.settings},null,8,[`settings`])):(v(),M(D,{key:2},[z(`form`,LC,[z(`div`,RC,[z(`span`,null,I(e.$t(`common:modules.routing.coordinateInputHelp`)),1)]),(v(!0),M(D,null,C(e.waypoints.slice(0,e.waypoints.length-1),(n,r)=>(v(),F(u,{key:r,class:E(r===0?`startpoint-input`:`waypoint-input`),"count-waypoints":e.waypoints.length,waypoint:n,onMoveWaypointUp:t=>e.moveWaypointUp(n.index),onMoveWaypointDown:t=>e.moveWaypointDown(n.index),onRemoveWaypoint:t=>e.removeWaypoint({index:n.index,reload:!0}),onRemoveAvoidInteraction:t[2]||=e=>o.resetMapInteractionMode(),onAddStartEnd:t=>e.isStartEndInput(r),onSearchResultSelected:t[3]||=t=>{e.isStartEndInput(-1),e.findDirections()}},null,8,[`class`,`count-waypoints`,`waypoint`,`onMoveWaypointUp`,`onMoveWaypointDown`,`onRemoveWaypoint`,`onAddStartEnd`]))),128)),z(`div`,zC,[z(`button`,{id:`add-waypoint`,type:`button`,class:`btn btn-light justify-content-left text-start`,title:e.$t(`common:modules.routing.addWaypoint`),onClick:t[4]||=t=>{e.isStartEndInput(-1),e.addWaypoint({index:e.waypoints.length-1})}},[t[34]||=z(`i`,{class:`bi-plus-circle`},null,-1),R(` `+I(e.$t(`common:modules.routing.addWaypoint`)),1)],8,BC)]),(v(!0),M(D,null,C(e.waypoints.slice(e.waypoints.length-1,e.waypoints.length),(n,r)=>(v(),F(u,{key:r,class:E(`endpoint-input`),"count-waypoints":e.waypoints.length,waypoint:n,onMoveWaypointUp:t[5]||=t=>e.moveWaypointUp(e.waypoints.length-1),onRemoveWaypoint:t[6]||=t=>e.removeWaypoint({index:e.waypoints.length-1,reload:!0}),onRemoveAvoidInteraction:t[7]||=e=>o.resetMapInteractionMode(),onAddStartEnd:t[8]||=t=>e.isStartEndInput(e.waypoints.length-1),onSearchResultSelected:t[9]||=t=>{e.isStartEndInput(-1),e.findDirections()}},null,8,[`count-waypoints`,`waypoint`]))),128))]),t[37]||=z(`hr`,null,null,-1),z(`div`,VC,[z(`button`,{class:`d-flex btn-dropdown`,onClick:t[10]||=e=>(i.showAvoidAreaButtons=!i.showAvoidAreaButtons,o.resetMapInteractionMode()),onKeydown:t[11]||=me(e=>(i.showAvoidAreaButtons=!i.showAvoidAreaButtons,o.resetMapInteractionMode()),[`enter`])},[z(`i`,{class:E(i.showAvoidAreaButtons?`bi-chevron-down`:`bi-chevron-right`)},null,2),z(`b`,HC,I(e.$t(`common:modules.routing.directions.restrictedAreas`)),1)],32),i.showAvoidAreaButtons?(v(),M(`div`,UC,[z(`div`,WC,[z(`div`,GC,[A(d,{id:`addAvoidAreaBtn`,class:`mx-2`,aria:e.$t(`common:modules.routing.directions.editRestrictedAreas`),icon:`bi-bounding-box-circles fs-7`,"class-array":[o.isMapInteractionModeAvoidAreasEdit?`btn-primary`:`btn-light`],onClick:t[12]||=e=>o.changeMapInteractionModeAvoidAreasEdit(),onKeydown:t[13]||=me(e=>o.changeMapInteractionModeAvoidAreasEdit(),[`enter`])},null,8,[`aria`,`class-array`]),z(`label`,KC,I(e.$t(`common:modules.routing.directions.avoidAreas.avoidArea`)),1)]),z(`div`,qC,[A(d,{id:`addAvoidPointBtn`,class:`mx-2`,aria:e.$t(`common:modules.routing.directions.editRestrictedPoints`),icon:`bi-record-circle fs-7`,"class-array":[o.isMapInteractionModeAvoidPointsEdit?`btn-primary`:`btn-light`],onClick:t[14]||=e=>o.changeMapInteractionModeAvoidPointsEdit(),onKeydown:t[15]||=me(e=>o.changeMapInteractionModeAvoidPointsEdit(),[`enter`])},null,8,[`aria`,`class-array`]),z(`label`,JC,I(e.$t(`common:modules.routing.directions.avoidAreas.avoidPoint`)),1)]),z(`div`,YC,[A(d,{id:`deleteAvoidAreaBtn`,class:`mx-2`,aria:e.$t(`common:modules.routing.directions.deleteRestrictedAreas`),icon:`bi-x-square fs-7`,"class-array":[o.isMapInteractionModeAvoidAreasDelete?`btn-primary`:`btn-light`],onClick:t[16]||=e=>o.changeMapInteractionModeAvoidAreasDelete(),onKeydown:t[17]||=me(e=>o.changeMapInteractionModeAvoidAreasDelete(),[`enter`])},null,8,[`aria`,`class-array`]),z(`label`,XC,I(e.$t(`common:modules.routing.directions.avoidAreas.delete`)),1)]),z(`div`,ZC,[A(d,{id:`exportAvoidAreasBtn`,class:`mx-2`,aria:e.$t(`common:modules.routing.exportAvoidAreas.tooltip`),"class-array":[`btn-light`],icon:`bi-file-earmark-arrow-down fs-7`,"data-bs-toggle":`modal`,"data-bs-target":`#exportAvoidAreasModal`},null,8,[`aria`]),A(f),z(`label`,QC,I(e.$t(`common:modules.routing.directions.avoidAreas.export`)),1)]),z(`div`,$C,[A(d,{id:`importAvoidAreasBtn`,class:`mx-2`,aria:e.$t(`common:modules.routing.importAvoidAreas.tooltip`),"class-array":[`btn-light`],icon:`bi-upload fs-7`,"data-bs-toggle":`modal`,"data-bs-target":`#uploadModal`},null,8,[`aria`]),z(`label`,ew,I(e.$t(`common:modules.routing.directions.avoidAreas.import`)),1)])])])):L(``,!0),o.isMapInteractionModeAvoidPointsEdit?(v(),M(`div`,tw,[z(`div`,nw,[z(`div`,rw,[A(p,{id:`avoidRadius`,modelValue:i.avoidRadius,"onUpdate:modelValue":t[18]||=e=>i.avoidRadius=e,type:`number`,"class-obj":[`form-control`+(o.isRadiusValid?` is-valid`:` is-invalid`)],class:`w-100`,"aria-describedby":`avoidPointRadius-input-help`,label:e.$t(`common:modules.routing.directions.avoidAreas.avoidPointRadius`),placeholder:e.$t(`common:modules.routing.directions.avoidAreas.avoidPointRadiusOutOfRangeKm`),min:0,max:12,step:.1,"error-message":e.$t(`common:modules.routing.directions.avoidAreas.avoidPointRadiusOutOfRangeKm`)},null,8,[`modelValue`,`class-obj`,`label`,`placeholder`,`error-message`])])]),z(`div`,iw,[z(`select`,aw,[z(`option`,null,I(e.$t(`common:modules.routing.directions.avoidAreas.avoidPointRadiusUnitKm`)),1)]),z(`label`,ow,I(e.$t(`common:shared.modules.draw.drawSettingsCircle.unit`)),1)])])):L(``,!0),z(`div`,sw,[z(`div`,cw,[z(`div`,lw,[z(`div`,uw,[z(`h1`,dw,[R(I(e.$t(`common:modules.routing.importAvoidAreas.header`))+` `,1),z(`a`,{href:`javascript:void(0)`,"aria-label":e.$t(`common:modules.routing.importAvoidAreas.help`)},null,8,fw)]),t[35]||=z(`button`,{type:`button`,class:`btn-close`,"data-bs-dismiss":`modal`,"aria-label":`Close`},null,-1)]),z(`div`,pw,[z(`div`,mw,I(e.$t(`common:modules.routing.importAvoidAreas.description`)),1),z(`div`,hw,[R(I(e.$t(`common:modules.routing.importAvoidAreas.structure`))+` `,1),t[36]||=z(`hr`,null,null,-1),A(m,{onAfterFileValidation:t[19]||=e=>o.afterFileValidation()})])])])])],512)])],64)),t[49]||=z(`hr`,null,null,-1),z(`label`,gw,I(e.$t(`common:modules.routing.directions.preferenceLabel`)),1),z(`select`,{id:`rout
19ing-directions-preference`,class:`form-select form-select-sm`,onChange:t[20]||=e=>o.changePreference(e.target.value)},[(v(!0),M(D,null,C(i.constants.preferenceOptions,t=>(v(),M(`option`,{id:t,key:`routing-directions-preference-`+t,value:t,selected:t===e.settings.preference,disabled:e.isInputDisabled},I(e.$t(`common:modules.routing.directions.preference.`+t)),9,_w))),128))],32),t[50]||=z(`hr`,null,null,-1),e.settings.speedProfile===`HGV`?(v(),M(`div`,vw,[A(h)])):L(``,!0),A(g,{settings:e.settings,"active-avoid-features-options":e.routingAvoidFeaturesOptions,disabled:e.isInputDisabled,onAddAvoidOption:t[21]||=e=>o.onAddAvoidOption(e),onRemoveAvoidOption:t[22]||=e=>o.onRemoveAvoidOption(e)},null,8,[`settings`,`active-avoid-features-options`,`disabled`]),e.directionsSettings.batchProcessing.enabled&&e.directionsSettings.batchProcessing.active?L(``,!0):(v(),M(D,{key:4},[t[46]||=z(`hr`,null,null,-1),e.routingDirections?(v(),M(`div`,yw,[z(`div`,bw,[A(s,{"speed-profile-id":e.settings.speedProfile,"fill-color":`#000000`,tooltip:e.$t(`common:modules.routing.speedprofiles.`+e.settings.speedProfile),class:E([`none-pointer-events `])},null,8,[`speed-profile-id`,`tooltip`]),A(_,{duration:e.routingDirections.duration},null,8,[`duration`]),A(ee,{distance:e.routingDirections.distance},null,8,[`distance`])]),t[44]||=z(`hr`,{class:`mb-0`},null,-1),(v(!0),M(D,null,C(e.routingDirections.segments,(n,r)=>(v(),M(D,{key:`segment_header_`+r},[z(`button`,{class:`d-flex step pl-2 py-4 btn-directions`,onMouseover:t=>e.highlightRoute({fromWaypointIndex:r,toWaypointIndex:r+1}),onFocus:t=>e.highlightRoute({fromWaypointIndex:r,toWaypointIndex:r+1}),onMouseout:t[23]||=t=>e.unHighlightRoute(),onBlur:t[24]||=t=>e.unHighlightRoute()},[z(`span`,{role:`button`,tabindex:`0`,class:`d-flex btn-icon`,onClick:e=>n.displayDetails=!n.displayDetails,onKeydown:me(e=>n.displayDetails=!n.displayDetails,[`enter`])},[z(`span`,null,I(r===0?`A`:r),1),z(`b`,null,[n.displayDetails?(v(),M(`span`,Cw,[...t[38]||=[z(`i`,{class:`bi-chevron-down`},null,-1)]])):(v(),M(`span`,ww,[...t[39]||=[z(`i`,{class:`bi-chevron-right`},null,-1)]]))])],40,Sw),z(`span`,{role:`button`,tabindex:`0`,class:`d-flex flex-column ms-2 w-100 btn-directions`,onClick:t=>e.zoomToRoute({fromWaypointIndex:r,toWaypointIndex:r+1}),onKeydown:me(t=>e.zoomToRoute({fromWaypointIndex:r,toWaypointIndex:r+1}),[`enter`])},[z(`b`,null,I(e.waypoints[r].getDisplayName()),1),z(`div`,Ew,[A(_,{duration:n.duration},null,8,[`duration`]),A(ee,{distance:n.distance},null,8,[`distance`])])],40,Tw)],40,xw),t[41]||=z(`hr`,{class:`m-0`},null,-1),n.displayDetails?(v(),M(`div`,Dw,[(v(!0),M(D,null,C(n.steps,(r,i)=>(v(),M(D,{key:i},[i===n.steps.length-1?L(``,!0):(v(),M(`button`,rt({key:0,ref_for:!0},r,{class:`ms-4 d-flex flex-column btn-directions`,onMouseover:t=>e.highlightRoute({coordsIndex:r.getWaypoints()}),onFocus:t=>e.highlightRoute({coordsIndex:r.getWaypoints()}),onMouseout:t[25]||=t=>e.unHighlightRoute(),onBlur:t[26]||=t=>e.unHighlightRoute(),onClick:t=>e.zoomToRoute({coordsIndex:r.getWaypoints()}),onKeydown:me(t=>e.zoomToRoute({coordsIndex:r.getWaypoints()}),[`enter`])}),[z(`div`,kw,[z(`span`,null,I(r.instruction),1),z(`div`,Aw,[A(_,{duration:r.duration},null,8,[`duration`]),A(ee,{distance:r.distance},null,8,[`distance`])])]),t[40]||=z(`hr`,{class:`w-100 m-0`},null,-1)],16,Ow))],64))),128))])):L(``,!0)],64))),128)),z(`button`,{class:`d-flex step pl-2 py-4 btn-directions`,onMouseover:t[27]||=t=>e.highlightRoute({coordsIndex:[e.waypoints[e.waypoints.length-1].getIndexDirectionsLineString()-1,e.waypoints[e.waypoints.length-1].getIndexDirectionsLineString()+1]}),onFocus:t[28]||=t=>e.highlightRoute({coordsIndex:[e.waypoints[e.waypoints.length-1].getIndexDirectionsLineString()-1,e.waypoints[e.waypoints.length-1].getIndexDirectionsLineString()+1]}),onMouseout:t[29]||=t=>e.unHighlightRoute(),onBlur:t[30]||=t=>e.unHighlightRoute(),onClick:t[31]||=t=>e.zoomToRoute({coordsIndex:[e.waypoints[e.waypoints.length-1].getIndexDirectionsLineString()-1,e.waypoints[e.waypoints.length-1].getIndexDirectionsLineString()+1]}),onKeydown:t[32]||=me(t=>e.zoomToRoute({coordsIndex:[e.waypoints[e.waypoints.length-1].getIndexDirectionsLineString()-1,e.waypoints[e.waypoints.length-1].getIndexDirectionsLineString()+1]}),[`enter`])},[t[42]||=z(`span`,null,`B`,-1),z(`b`,jw,I(e.waypoints[e.waypoints.length-1].getDisplayName()),1)],32),t[45]||=z(`hr`,null,null,-1),e.directionsSettings.elevation&&e.routingDirections?(v(),M(`div`,Mw,[A(te),t[43]||=z(`hr`,null,null,-1)])):L(``,!0),A(y)])):L(``,!0)],64)),z(`div`,Nw,[z(`span`,{class:`pointer col-8`,title:e.$t(`common:modules.routing.resetSettings`)},[A(ne,{id:`button-reset`,"class-array":[`btn-light`],icon:`bi-trash fs-6`,interaction:()=>o.reset(),text:e.$t(`common:modules.routing.resetSettings`)},null,8,[`interaction`,`text`])],8,Pw)])]),A(re)],64)}var Iw=K(NC,[[`render`,Fw],[`__scopeId`,`data-v-48581e31`]]);function Lw(e,t){let n=$.getters[`Modules/Routing/directionsSettings`]?.customAvoidFeatures;if(n&&n[t]&&n[t].includes(e))return e.toLowerCase();switch(e){case`HIGHWAYS`:return`highways`;case`TOLLWAYS`:return`tollways`;case`FERRIES`:return`ferries`;case`STEPS`:return`steps`;case`UNPAVEDROADS`:return`unpavedroads`;default:throw Error(`Missing avoidOption translation.`)}}var Rw=class{constructor(e){this.bbox=e,this.areas=[]}getBbox(){return this.bbox}getAreas(){return this.areas}addArea(e){return this.areas.push(e)}},zw=class{constructor({coordinates:e,groupIndex:t,value:n,maximum:r,interval:i,speedProfile:a,optimization:o,avoidSpeedProfileOptions:s,displayValue:c,population:l,area:u}){this.coordinates=e,this.groupIndex=t,this.value=n,this.maximum=r,this.interval=i,this.speedProfile=a,this.optimization=o,this.avoidSpeedProfileOptions=s,this.displayValue=c,this.calculateColor(),this.population=l,this.area=u}calculateColor(){let e=X.Isochrones.settings.styleIsochrones.startColor,t=X.Isochrones.settings.styleIsochrones.endColor,n=this.getValue()-this.getInterval(),r=this.getMaximum()-this.getInterval(),i=n===0||r===0?0:n/r;
19this.color=[(t[0]-e[0])*i+e[0],(t[1]-e[1])*i+e[1],(t[2]-e[2])*i+e[2]]}getCoordinates(){return this.coordinates}getGroupIndex(){return this.groupIndex}getValue(){return this.value}getMaximum(){return this.maximum}getInterval(){return this.interval}getSpeedProfile(){return this.speedProfile}getOptimization(){return this.optimization}getColor(){return this.color}getColorRgbString(){return f_(this.color,`rgbString`)}getAvoidSpeedProfileOptions(){return this.avoidSpeedProfileOptions}getDisplayValue(){return this.displayValue}getGeojsonFeature(e){return{type:`Feature`,geometry:{type:`Polygon`,coordinates:this.getCoordinates()},properties:{value:this.getValue(),interval:this.getInterval(),maximum:this.getMaximum(),color:this.getColor(),groupIndex:this.getGroupIndex(),optimization:this.getOptimization(),speedProfile:this.getSpeedProfile(),avoidSpeedProfileOptions:this.getAvoidSpeedProfileOptions(),...e,...this.getPopulation()&&{population:this.getPopulation()},...this.getArea()&&{area:this.getArea()}}}}getPopulation(){return this.population}getArea(){return this.area}};function Bw(e){switch(e){case`CAR`:return`driving-car`;case`HGV`:return`driving-hgv`;case`CYCLING`:return`cycling-regular`;case`FOOT`:return`foot-walking`;case`WHEELCHAIR`:return`wheelchair`;default:throw Error(`Missing speedProfil translation`)}}var Vw=class{constructor({index:e,feature:t,displayName:n,source:i}){this.index=e,this.indexDirectionsLineString=null,this.feature=t,this.displayName=n,this.source=i,this.addedToSource=!1,this.feature?(this.feature.set(`routingId`,this.index),this.coordinates=this.feature.getGeometry().getCoordinates(),this.addedToSource=!0):(this.coordinates=[],this.feature=new V({geometry:new r(this.coordinates),routingId:this.index})),this.feature.getGeometry().on(`change`,({target:e})=>{this.coordinates=e.getCoordinates()})}getIndex(){return this.index}setIndex(e){this.index=e,this.feature.set(`routingId`,e)}getCoordinates(){return this.coordinates}setCoordinates(e){this.coordinates=e,this.feature.getGeometry().setCoordinates(e),this.addedToSource||=(this.source.addFeature(this.feature),!0)}getFeature(){return this.feature}getDisplayName(){return this.displayName?this.displayName:this.coordinates.length===2?`${this.coordinates[0]}, ${this.coordinates[1]}`:null}setDisplayName(e){this.displayName=e}setFromGeosearchResult(e){this.setCoordinates(e.getCoordinates()),this.setDisplayName(e.getDisplayName())}getIndexDirectionsLineString(){return this.indexDirectionsLineString}setIndexDirectionsLineString(e){this.indexDirectionsLineString=e}reset(){this.displayName=null,this.coordinates=[],this.indexDirectionsLineString=null,this.addedToSource&&this.source.removeFeature(this.feature),this.addedToSource=!1,this.feature.getGeometry().setCoordinates([])}},Hw=new Pe;function Uw(){let e=X.Isochrones.settings.styleCenter;return new T({image:new re({radius:e.radius,stroke:new x({color:[...e.lineColor,1],width:e.lineWidth}),fill:new S({color:[...e.fillColor,e.opacity]})})})}var Ww=new Rt({source:Hw,style:Uw,name:`isochrones_point_layer`,alwaysOnTop:!0}),Gw=new i({source:Hw,type:`Point`,style:Uw,condition:e=>e.originalEvent.buttons===1}),Kw=new je({source:Hw}),qw=new Ze({source:Hw}),Jw=new Pe;function Yw(e){let t=X.Isochrones.settings.styleIsochrones,n=e.get(`color`);return new T({fill:new S({color:[...n,t.opacity]}),stroke:new x({color:[...n,1],width:t.lineWidth})})}var Xw={isochronesPointSource:Hw,isochronesPointLayer:Ww,isochronesPointDrawInteraction:Gw,isochronesPointModifyInteraction:Kw,isochronesPointSnapInteraction:qw,isochronesAreaSource:Jw,isochronesAreaLayer:new Rt({source:Jw,style:Yw,name:`isochrones_area_layer`,alwaysOnTop:!0,opacity:.65}),mapListenerAdded:!1,waypoint:new Vw({index:0,source:Hw}),isochronesRestrictionsInputData:{length:10,width:2.4,height:2.8,weight:18,axleload:6,hazmat:!1},isochronesRestrictionIsValid:{length:!0,width:!0,height:!0,weight:!0,axleload:!0},routingIsochrones:null,isLoadingIsochrones:!1,routingAvoidFeaturesOptions:[],settings:X.isochronesSettings};function Zw(e){switch(e){case`TIME`:return`time`;case`DISTANCE`:return`distance`;default:throw Error(`Missing rangeType translation`)}}function Qw(e){switch(e){case`TIME`:return 60;case`DISTANCE`:return 1e3;default:throw Error(`Missing optimization to multiplicator translation`)}}async function $w({coordinates:e,transformCoordinatesToLocal:t,speedProfile:n,optimization:r,avoidSpeedProfileOptions:i,transformCoordinates:a,avoidBorders:o}){let s=eT(n),c=r===`TIME`?X.isochronesSettings.timeValue:X.isochronesSettings.distanceValue,l=Qw(r),u=c*l,d=X.isochronesSettings.intervalValue*l,f=X.isochronesSettings.intervalValue,p=X.isochronesSettings.attributes,m=null,h=null,g=null,_=null,v=null;try{let t={interval:X.isochronesSettings.intervalOption===`count`?u/f:d,locations:[e],location_type:`start`,range_type:Zw(r),range:[u],options:{...i.length>0&&{avoid_features:i.map(e=>Lw(e.id))},...o&&{avoid_borders:`all`}},...p.length>0&&{attributes:p},area_units:X.isochronesSettings.areaUnit};n===`HGV`&&(t.options.profile_params={},t.options.profile_params.restrictions={length:Xw.isochronesRestrictionsInputData.length,width:Xw.isochronesRestrictionsInputData.width,height:Xw.isochronesRestrictionsInputData.height,weight:Xw.isochronesRestrictionsInputData.weight,axleload:Xw.isochronesRestrictionsInputData.axleload,hazmat:Xw.isochronesRestrictionsInputData.hazmat}),v=await B.post(s,t)}catch(e){let t=e.response?.data?.error?.message?e.response?.data?.error?.message:i18next.t(`common:modules.routing.errors.errorIsochronesFetch`);throw Error(t)}m=v.data,a?(h=await t([m.bbox[0],m.bbox[1]]),g=await t([m.bbox[2],m.bbox[3]])):(h=[m.bbox[0],m.bbox[1]],g=[m.bbox[2],m.bbox[3]]),_=new Rw([h[0],h[1],g[0],g[1]]);for(let e=m.features.length-1;e>=0;e--){let o=m.features[e],s=a?[]:o.geometry.coordinates[0];if(a)for(let e of o.geometry.coordinates[0])s.push(await t(e));_.addArea(new zw({coordinates:[s],groupIndex:o.properties.group_index,value:o.properties.value,maximum:u,interval:X.isochronesSettings.intervalOption===`count`?f:d,speedProfile:n,optimization:r,avoidSpeedProfileOptions:i.map(e=>e.id),displayValue:o.properties.value/l,population:o.properties.total_pop,area:o.properties.area}))}return _}function eT(e){let t=`v2/isochrones/${Bw(e)}/geojson`,n=$.getters.restServiceById(X.isochronesSettings.serviceId).url,r;
19return n.endsWith(`/`)?n+=t:n=n+`/`+t,r=n.startsWith(`/`)?new URL(n,window.location.origin):new URL(n),r}var tT={async findIsochrones({rootState:e,state:t,getters:n,dispatch:r,commit:i}){if(t?.waypoint?.getCoordinates().length<2)return;let{waypoint:a,isochronesAreaSource:o}=t,s=await r(`Modules/Routing/transformCoordinatesLocalToWgs84Projection`,a.getCoordinates(),{root:!0}),c=mapCollection.getMap(e.Maps.mode);if(!n.allHGVRestrictionsValid&&t.settings.speedProfile===`HGV`){await r(`resetIsochronesResult`),r(`Alerting/addSingleAlert`,{category:`error`,title:i18next.t(`common:modules.routing.errors.titleErrorIsochroneFetch`),content:i18next.t(`common:modules.routing.errors.hgvRestrictionOutOfRange`)},{root:!0});return}i(`setIsLoadingIsochrones`,!0),await r(`resetIsochronesResult`);try{let e=await r(`fetchIsochrones`,{wgs84Coords:s,transformCoordinates:!0});o.addFeatures(e.getAreas().map(e=>new V({geometry:new Xe(e.getCoordinates()),value:e.getValue(),maximum:e.getMaximum(),interval:e.getInterval(),speedProfile:e.getSpeedProfile(),optimization:e.getOptimization(),color:e.getColor(),avoidSpeedProfileOptions:e.getAvoidSpeedProfileOptions(),...e.getPopulation()&&{population:e.getPopulation()},...e.getArea()&&{area:e.getArea()}}))),c.getView().fit(o.getExtent()),i(`setRoutingIsochrones`,e)}catch(e){r(`Alerting/addSingleAlert`,{category:`error`,title:i18next.t(`common:modules.alerting.categories.error`),content:e.message},{root:!0})}i(`setIsLoadingIsochrones`,!1)},zoomOnWaypoint({state:e,rootState:t}){mapCollection.getMap(t.Maps.mode).getView().fit(e.waypoint.getFeature().getGeometry(),{maxZoom:7})},resetIsochronesResult({state:e,commit:t}){e.isochronesAreaSource.clear(),t(`setRoutingIsochrones`,null)},async fetchIsochrones({state:e,dispatch:t,getters:n,rootState:r},{wgs84Coords:i,transformCoordinates:a}){let o=r.Modules.Routing.isochronesSettings,{selectedAvoidSpeedProfileOptions:s}=n,c=s.find(e=>e.id===`BORDERS`);if(o.type===`ORS`)return $w({coordinates:i,transformCoordinatesToLocal:e=>t(`Modules/Routing/transformCoordinatesWgs84ToLocalProjection`,e,{root:!0}),speedProfile:e.settings.speedProfile,optimization:e.settings.isochronesMethodOption,avoidSpeedProfileOptions:s.filter(e=>e.id!==`BORDERS`),transformCoordinates:a,avoidBorders:c});throw Error(`Isochrones is not configured correctly.`)},initIsochrones({state:e,commit:t,dispatch:n}){let{isochronesPointLayer:r,isochronesAreaLayer:i,isochronesPointDrawInteraction:a,mapListenerAdded:o}=e;o||(a.on(`drawend`,e=>n(`onIsochronesPointDrawEnd`,e)),n(`createIsochronePointModifyInteractionListener`),t(`setMapListenerAdded`,!0)),n(`Maps/addLayer`,i,{root:!0}),n(`Maps/addLayer`,r,{root:!0}),n(`createIsochronesPointDrawInteraction`)},closeIsochrones({state:e,dispatch:t}){let{isochronesPointLayer:n,isochronesAreaLayer:r}=e,i=mapCollection.getMap(`2D`);i.removeLayer(n),i.removeLayer(r),t(`removeIsochronesPointDrawInteraction`)},async onIsochronesPointDrawEnd({state:e,dispatch:t},n){let{waypoint:r,isochronesPointSource:i,isochronesPointDrawInteraction:a}=e,o=await t(`Modules/Routing/fetchTextByCoordinates`,{coordinates:await t(`Modules/Routing/transformCoordinatesLocalToWgs84Projection`,n.feature.getGeometry().getCoordinates(),{root:!0})},{root:!0});r.setDisplayName(o?o.getDisplayName():null),r.setCoordinates(n.feature.getGeometry().getCoordinates()),i.removeFeature(n.feature),t(`Maps/removeInteraction`,a,{root:!0})},createIsochronePointModifyInteractionListener({state:e,dispatch:t}){let{isochronesPointModifyInteraction:n,waypoint:r}=e;n.on(`modifyend`,async()=>{let e=await t(`Modules/Routing/fetchTextByCoordinates`,{coordinates:await t(`Modules/Routing/transformCoordinatesLocalToWgs84Projection`,r.getCoordinates(),{root:!0})},{root:!0}),n=e?e.getDisplayName():r.getCoordinates();r.setDisplayName(n)})},createIsochronesPointDrawInteraction({state:e,dispatch:t}){t(`removeIsochronesPointDrawInteraction`);let{isochronesPointModifyInteraction:n,isochronesPointSnapInteraction:r,isochronesPointDrawInteraction:i}=e;e.waypoint.getCoordinates().length<2&&t(`Maps/addInteraction`,i,{root:!0}),t(`Maps/addInteraction`,n,{root:!0}),t(`Maps/addInteraction`,r,{root:!0})},removeIsochronesPointDrawInteraction({state:e,dispatch:t}){let{isochronesPointDrawInteraction:n,isochronesPointModifyInteraction:r,isochronesPointSnapInteraction:i}=e;n.abortDrawing(),t(`Maps/removeInteraction`,n,{root:!0}),t(`Maps/removeInteraction`,r,{root:!0}),t(`Maps/removeInteraction`,i,{root:!0})}},nT={...U(Xw),setIsochronesRestrictionIsValid:(e,{name:t,value:n})=>{e.isochronesRestrictionIsValid[t]=n}},rT=t({isochronesMethodeOptions:()=>iT}),iT=[`TIME`,`DISTANCE`];y();
19var aT={name:`SliderItem`,props:{aria:{type:String,required:!0},id:{type:String,default:`shared-slider`,required:!1},label:{type:String,default:null,required:!1},list:{type:String,default:null,required:!1},min:{type:[String,Number],default:null,required:!1},max:{type:[String,Number],default:null,required:!1},step:{type:Number,default:null,required:!1},value:{type:[String,Number],default:`0`,required:!1},disabled:{type:Boolean,default:!1,required:!1},interaction:{type:Function,default:()=>!0,required:!1},classArray:{type:Array,required:!1,default:null},showMarkers:{type:Boolean,required:!1,default:!1},maxMarkers:{type:Number,required:!1,default:11}},data(){return{menuType:null}},computed:{...N(`Modules/ResizeHandle`,[`mainMenuWidth`,`secondaryMenuWidth`]),markers(){if(!this.showMarkers||Number(this.min)>=Number(this.max)||this.maxMarkers<2)return[];let e=Number(this.min),t=Number(this.max),n=(t-e)/(this.maxMarkers-1),r=10**Math.floor(Math.log10(n)),i=Math.ceil(n/r)*r,a=new Set;for(let n=e;n<=t;n+=i){let t=n;if(n!==e&&(t=Math.round(n),i>=10&&(t=Math.round(n/10)*10)),a.add(t),a.size>=this.maxMarkers)break}return a.add(Math.round(t)),Array.from(a).sort((e,t)=>e-t)},shouldShowMarkers(){let e=Math.max(...this.markers.map(e=>String(e).length)),t=Math.max(50,15.400000000000002*e),n=this.markers.length*t,r=this.menuType===`mainMenu`?this.mainMenuWidth:this.secondaryMenuWidth;return this.showMarkers&&r>n}},mounted(){let e=this.$el.closest(`.mp-menu`);e&&(e.classList.contains(`mp-mainMenu`)?this.menuType=`mainMenu`:e.classList.contains(`mp-secondaryMenu`)&&(this.menuType=`secondaryMenu`))}},oT={class:`input-item`},sT={class:`input`},cT=[`id`,`list`,`value`,`aria-label`,`min`,`max`,`step`,`disabled`],lT={key:0,class:`slider-dots`},uT={key:0,class:`d-flex justify-content-between markers`},dT=[`for`];function fT(e,t,n,r,i,a){return v(),M(`div`,{class:E([`slider-item d-flex`,n.classArray])},[z(`div`,oT,[z(`div`,sT,[z(`input`,{id:n.id,ref:`sliderValue`,type:`range`,class:E([`slider`,{"form-range":a.shouldShowMarkers}]),list:n.list,value:n.value,"aria-label":n.aria,min:n.min,max:n.max,step:n.step,disabled:n.disabled,onInput:t[0]||=(...e)=>n.interaction&&n.interaction(...e)},null,42,cT),a.shouldShowMarkers&&a.markers.length>0?(v(),M(`div`,lT,[(v(!0),M(D,null,C(a.markers,(e,t)=>(v(),M(`span`,{key:`dot-`+t,class:`dot`,style:pe({left:`${(e-n.min)/(n.max-n.min)*100}%`})},null,4))),128))])):L(``,!0)]),a.shouldShowMarkers&&a.markers.length>0?(v(),M(`div`,uT,[(v(!0),M(D,null,C(a.markers,(e,t)=>(v(),M(`span`,{key:t,class:E([`marker`,{active:e===n.value}]),style:pe({left:`${(e-n.min)/(n.max-n.min)*100}%`})},I(e),7))),128))])):L(``,!0)]),n.label?(v(),M(`label`,{key:0,for:n.id,class:`label`},I(n.label),9,dT)):L(``,!0)],2)}var pT=K(aT,[[`render`,fT],[`__scopeId`,`data-v-98a2717b`]]);y();var mT={name:`RoutingSliderInput`,components:{SliderItem:pT},props:{label:{type:String,required:!0},value:{type:Number,required:!0},min:{type:Number,required:!0},max:{type:Number,required:!0},step:{type:Number,required:!1,default:1},unit:{type:String,required:!0},disabled:{type:Boolean,required:!0}},emits:[`input`]},hT={class:`d-flex flex-column mt-2`},gT=[`for`],_T={key:0,class:`d-flex justify-content-between`},vT={key:1,class:`d-flex justify-content-between`};function yT(e,t,n,r,i,o){let s=a(`SliderItem`);return v(),M(`div`,hT,[z(`label`,{for:`routing-slider-input-`+n.label},[z(`h6`,null,I(n.label),1)],8,gT),n.label===e.$t(`common:modules.routing.isochrones.interval.count`)?(v(),M(`div`,vT,[z(`span`,null,I(n.min),1),z(`span`,null,[z(`b`,null,I(n.value),1)]),z(`span`,null,I(n.max),1)])):(v(),M(`div`,_T,[z(`span`,null,I(n.min)+` `+I(n.unit),1),z(`span`,null,[z(`b`,null,I(n.value),1),t[0]||=R(),z(`span`,null,I(n.unit),1)]),z(`span`,null,I(n.max)+` `+I(n.unit),1)])),A(s,{id:`routing-sl
19ider-input-`+n.label,aria:n.label===`Maximale Reisedauer`?e.$t(`common:modules.aria.sliderAria`)+e.$t(`common:modules.routing.isochrones.maxTraveltime`):e.$t(`common:modules.aria.sliderAria`)+e.$t(`common:modules.routing.isochrones.interval`),value:n.value,min:n.min,max:n.max,step:n.step,disabled:n.disabled,interaction:t=>e.$emit(`input`,Number(t.target.value)),"show-markers":!0},null,8,[`id`,`aria`,`value`,`min`,`max`,`step`,`disabled`,`interaction`])])}var bT=K(mT,[[`render`,yT]]);y();var xT={name:`IsochronesItemBatchProcessing`,components:{RoutingBatchProcessing:kx},props:{settings:{type:Object,required:!0}},data(){return{isProcessing:!1,countFailed:0,serviceRequests:0}},computed:{...N(`Modules/Routing`,[`taskHandler`,`isochronesSettings`])},methods:{...o(`Modules/Routing/Isochrones`,Object.keys(nT)),...o(`Modules/Routing`,[`setTaskHandler`]),...w(`Modules/Routing/Isochrones`,[`fetchIsochrones`,`resetIsochronesResult`]),...w(`Alerting`,[`addSingleAlert`]),addFiles(e){Array.from(e).forEach(e=>{let t=new FileReader;t.onload=async t=>{this.isProcessing=!0,this.setTaskHandler(null),this.countFailed=0,this.serviceRequests=0,this.resetIsochronesResult(),this.setIsLoadingIsochrones(!0);try{let n=await this.parseCsv(t.target.result);n&&this.downloadResults(e.name,n),this.countFailed===this.serviceRequests?this.addSingleAlert({category:this.$t(`common:modules.alerting.categories.error`),content:this.$t(`common:modules.routing.isochrones.batchProcessing.errorAllFailed`)}):this.countFailed!==0&&this.addSingleAlert({title:this.$t(`common:modules.alerting.categories.error`),category:`error`,content:this.$t(`common:modules.routing.isochrones.batchProcessing.errorSomeFailed`,{countFailed:this.coundFailed})})}catch(e){this.addSingleAlert({category:`error`,title:this.$t(`common:modules.alerting.categories.error`),content:e.message})}this.setIsLoadingIsochrones(!1),this.countFailed=0,this.isProcessing=!1,this.setTaskHandler(null)},t.readAsText(e)})},async downloadResults(e,t){let n=JSON.stringify(t),r=this.createDownloadFilename(e);if(typeof navigator.msSaveOrOpenBlob==`function`)window.navigator.msSaveOrOpenBlob(new Blob([n],{type:`application/geo+json;charset=utf-8`}),r);else{let e=`data:text/plain;charset=utf-8,${encodeURIComponent(n)}`,t=document.createElement(`a`);t.href=e,t.download=r,t.style.visibility=`hidden`,document.body.appendChild(t),t.click(),document.body.removeChild(t)}},createDownloadFilename(e){if(typeof e!=`string`)return`.csv`;let t=e.split(`.`);return t.slice(0,t.length-1).join(`.`)+`.geojson`},parseCsv(e){return new Promise((t,n)=>{if(typeof e!=`string`){n(Error(this.$t(`common:modules.routing.isochrones.batchProcessing.errorNoEntries`)));return}let r=e.replace(/[\r]/g,``).trim(),i=r.split(` 20`),a=i.length,o=[];if(r.length===0||a===0){n(Error(this.$t(`common:modules.routing.isochrones.batchProcessing.errorNoEntries`)));return}if(this.settings.batchProcessing.limit&&a>this.settings.batchProcessing.limit){n(Error(this.$t(`common:modules.routing.isochrones.batchProcessing.errorToManyEntriesInFile`,{limit:this.settings.batchProcessing.limit})));return}for(let e=0;e<a;e++){let t=i[e].split(`;`);if(!(t.length===1&&t.includes(``))){if(t.length!==3){n(Error(this.$t(`common:modules.routing.isochrones.batchProcessing.errorToManyEntriesInRow`,{row:e})));return}if(!this.isNumber(Number(t[1]))||!this.isNumber(Number(t[2]))){n(Error(this.$t(`common:modules.routing.isochrones.batchProcessing.errorRowContainsEntriesNoNumber`,{row:e})));return}o.push(()=>this.parseLineParts(t))}}this.setTaskHandler(new Ax(o,this.settings.batchProcessing.maximumConcurrentRequests?this.settings.batchProcessing.maximumConcurrentRequests:this.$store.getters[`Modules/Routing/Isochrones/settings`].batchProcessing.maximumConcurrentRequests,(e,t)=>e.push(...t),e=>t(e?{type:`FeatureCollection`,features:e}:null)))})},async parseLineParts(e){let t=e[0],n=Number(e[1]),r=Number(e[2]);try{return this.serviceRequests+=1,(await this.fetchIsochrones({wgs84Coords:[n,r],transformCoordinates:!1})).getAreas().map(e=>e.getGeojsonFeature({ID:t,[this.$t(`common:modules.routing.directions.batchProcessing.downloadHeader.xStart`)]:n,[this.$t(`common:modules.routing.directions.batchProcessing.downloadHeader.yStart`)]:r}))}catch{this.countFailed+=1}return[{type:`Feature`,geometry:{type:`Point`,coordinates:[n,r]},properties:{ID:t,[this.$t(`common:modules.routing.directions.batchProcessing.downloadHeader.xStart`)]:n,[this.$t(`common:modules.routing.directions.batchProcessing.downloadHeader.yStart`)]:r,error:!0}}]},isNumber(e){return!isNaN(e)&&typeof e==`number`}}};function ST(e,t,n,r,i,o){let s=a(`RoutingBatchProcessing`);return v(),F(s,{settings:n.settings,progress:e.taskHandler?e.taskHandler.progress:0,"is-
20processing":i.isProcessing,"structure-text":e.$t(`common:modules.routing.isochrones.batchProcessing.structure`),"example-text":`1;8.12;50.67`,onFilesadded:t[0]||=e=>o.addFiles(e),onCancelProcess:t[1]||=t=>e.taskHandler.cancelRun()},null,8,[`settings`,`progress`,`is-processing`,`structure-text`])}var CT=K(xT,[[`render`,ST]]);y();var wT={name:`IsochronesHoverData`,data(){return{overlay:null,hoverMenu:null,coordinates:null,selectAreaInteraction:null,selectedArea:null}},computed:{...N(`Modules/Routing`,[`isochronesSettings`]),...N(`Modules/Routing/Isochrones`,[`isochronesAreaLayer`])},mounted(){this.overlay=new wn({id:`routing-hover-menu`,element:this.$refs.routingHoverMenu}),this.getMap().addOverlay(this.overlay),this.selectAreaInteraction=new tt({layers:[this.isochronesAreaLayer],style:this.getSelectedStyle,condition:Ve}),this.selectAreaInteraction.on(`select`,e=>{e.selected.length>0?this.selectedArea=e.selected[0]:this.selectedArea=null}),this.getMap().addInteraction(this.selectAreaInteraction),this.getMap().getViewport().addEventListener(`mousemove`,this.setHoverMenu)},unmounted(){this.getMap().removeOverlay(this.getMap().getOverlayById(`routing-hover-menu`)),this.getMap().getViewport().removeEventListener(`mousemove`,this.setHoverMenu),this.getMap().removeInteraction(this.selectAreaInteraction)},methods:{setHoverMenu(e){e.preventDefault(),this.coordinates=this.getMap().getEventCoordinate(e),this.overlay.setPosition(this.coordinates),this.hoverMenu=zt.getInstance(this.overlay.getElement()),this.hoverMenu&&this.hoverMenu.dispose(),this.hoverMenu=new zt(this.overlay.getElement(),{animation:!1,container:this.overlay.getElement(),content:this.$refs.routingHoverMenuContent.innerHTML,html:!0,placement:`top`}),this.selectedArea&&this.hoverMenu.show()},getSelectedStyle(e){return new T({fill:new S({color:e.values_.color}),stroke:new x({color:`rgba(0, 0, 0)`,width:2})})},getMap(){return mapCollection.getMap(`2D`)}}},TT={id:`routing-hover-menu`,ref:`routingHoverMenu`},ET={id:`routing-hover-menu-content`,ref:`routingHoverMenuContent`},DT={key:0,class:`d-flex justify-content-between`},OT=[`innerHTML`],kT=[`innerHTML`],AT={key:1},jT={key:2,class:`d-flex justify-content-between`},MT=[`innerHTML`],NT=[`innerHTML`];function PT(e,t,n,r,i,a){return v(),M(`div`,TT,[z(`div`,ET,[e.isochronesSettings.attributes.includes(`total_pop`)?(v(),M(`div`,DT,[z(`b`,null,[z(`span`,{id:`routing-hover-menu-population-description`,innerHTML:e.$t(`common:modules.routing.isochrones.hoverMenu.population`)},null,8,OT)]),z(`b`,null,[z(`span`,{id:`routing-hover-menu-population-value`,innerHTML:i.selectedArea?i.selectedArea.values_.population.toLocaleString():``},null,8,kT)])])):L(``,!0),e.isochronesSettings.attributes.length>1?(v(),M(`hr`,AT)):L(``,!0),e.isochronesSettings.attributes.includes(`area`)?(v(),M(`div`,jT,[z(`b`,null,[z(`span`,{id:`routing-hover-menu-area-description`,innerHTML:e.$t(`common:modules.routing.isochrones.hoverMenu.area`)},null,8,MT)]),z(`b`,null,[z(`span`,{id:`routing-hover-menu-area-value`,innerHTML:i.selectedArea?`${Math.round(i.selectedArea.values_.area).toLocaleString()} ${e.isochronesSettings.areaUnit}²`:``},null,8,NT)])])):L(``,!0)],512)],512)}var FT=K(wT,[[`render`,PT],[`__scopeId`,`data-v-84440765`]]);y();var IT={name:`IsochronesLegend`,computed:{...N(`Modules/Routing`,[`isochronesSettings`]),...N(`Modules/Routing/Isochrones`,[`routingIsochrones`])}},LT={class:`d-flex mb-2`},RT={id:`isochrones-legend-table`,class:`table`},zT={scope:`col`},BT={key:0,scope:`col`},VT={key:1,scope:`col`},HT={key:2,scope:`col`},UT={key:3,scope:`col`},WT={key:0},GT={key:1};function KT(e,t,n,r,i,a){return v(),M(D,null,[z(`span`,LT,I(e.$t(`common:modules.routing.isochrones.legend.title`)),1),z(`div`,null,[z(`table`,RT,[z(`thead`,null,[z(`tr`,null,[z(`th`,zT,I(e.$t(`common:modules.routing.isochrones.legend.color`)),1),e.routingIsochrones.getAreas()[0].getOptimization()===`TIME`?(v(),M(`th`,BT,I(e.$t(`common:modules.routing.isochrones.legend.time`))+` [min] `,1)):(v(),M(`th`,VT,I(e.$t(`common:modules.routing.isochrones.legend.distance`))+` [km] `,1)),e.isochronesSettings.attributes.includes(`area`)?(v(),M(`th`,HT,I(e.$t(`common:modules.routing.isochrones.legend.area`))+` [`+I(e.isochronesSettings.areaUnit)+`²] `,1)):L(``,!0),e.isochronesSettings.attributes.includes(`total_pop`)?(v(),M(`th`,UT,I(e.$t(`common:modules.routing.isochrones.legend.population`)),1)):L(``,!0)])]),z(`tbody`,null,[(v(!0),M(D,null,C(e.routingIsochrones.getAreas(),(t,n)=>(v(),M(`tr`,{key:`result-area-`+n},[z(`td`,null,[z(`div`,{class:`legend-container px-2`,style:pe({backgroundColor:t.getColorRgbString()})},null,4)]),z(`td`,null,[z(`span`,null,I(parseFloat(t.getDisplayValue().toFixed(2)).toLocaleStr
20ing()),1)]),e.isochronesSettings.attributes.includes(`area`)?(v(),M(`td`,WT,[z(`span`,null,I(Math.round(t.getArea()).toLocaleString()),1)])):L(``,!0),e.isochronesSettings.attributes.includes(`total_pop`)?(v(),M(`td`,GT,[z(`span`,null,I(t.getPopulation().toLocaleString()),1)])):L(``,!0)]))),128))])])])],64)}var qT=K(IT,[[`render`,KT],[`__scopeId`,`data-v-c3c690f0`]]);y();var JT={name:`IsochronesItem`,components:{RoutingCoordinateInput:ix,RoutingSliderInput:bT,RoutingDownload:uS,IsochronesItemBatchProcessing:CT,RoutingBatchProcessingCheckbox:zx,RoutingAvoidFeatures:CS,RoutingSpeedProfileIcon:mS,RoutingRestrictionsInput:LS,IsochronesHoverData:FT,IsochronesLegend:qT},data(){return{constants:rT,constantsRouting:Jy}},computed:{...N(`Modules/Routing/Isochrones`,[`isInputDisabled`,`isochronesPointDrawInteraction`,`isochronesPointModifyInteraction`,`waypoint`,`routingIsochrones`,`routingAvoidFeaturesOptions`,`settings`]),...N(`Modules/Routing/`,[`isochronesSettings`]),currentValue(){return this.settings.isochronesMethodOption===`DISTANCE`?this.settings.distanceValue:this.settings.timeValue},maxIntervalValue(){return this.settings.intervalOption===`count`?this.currentValue<=1?this.settings.isochronesMethodOption===`TIME`?this.currentValue:this.currentValue*10:this.currentValue<this.settings.maxInterval?Math.ceil(this.currentValue):this.settings.maxInterval:this.currentValue<this.settings.maxInterval?this.currentValue:this.settings.maxInterval},minIntervalValue(){return this.settings.minInterval},numberOfIsochrones(){return this.settings.intervalOption===`count`?this.settings.intervalValue:this.settings.intervalValue===0?1/0:Math.ceil(this.currentValue/this.settings.intervalValue)}},async created(){this.initIsochrones()},beforeUnmount(){this.closeIsochrones()},methods:{...o(`Modules/Routing/Isochrones`,Object.keys(nT)),...w(`Modules/Routing/Isochrones`,Object.keys(tT)),changeSpeedProfile(e){this.isInputDisabled||(this.settings.speedProfile=e)},changeMethodOption(e){this.settings.isochronesMethodOption=e,this.currentValue<this.settings.intervalValue&&this.setIntervalValue(Math.round(this.currentValue))},setDistanceValue(e){this.settings.intervalOption===`count`?e>1?(e>this.settings.distanceValue?this.settings.distanceValue=Math.ceil(e):this.settings.distanceValue=Math.floor(e),e<this.settings.intervalValue&&this.setIntervalValue(this.settings.distanceValue)):(this.settings.distanceValue=e,e*10<this.settings.intervalValue&&this.setIntervalValue(this.settings.distanceValue*10)):(this.settings.distanceValue=e,e<this.settings.intervalValue&&this.setIntervalValue(e))},setTimeValue(e){this.settings.timeValue=e,e<this.settings.intervalValue&&this.setIntervalValue(e)},setIntervalValue(e){e>this.minIntervalValue?this.settings.intervalValue=e:this.settings.intervalValue=this.minIntervalValue},onRemoveWaypoint(){this.waypoint.reset(),this.createIsochronesPointDrawInteraction(),this.resetIsochronesResult()},onAddAvoidOption(e){this.routingAvoidFeaturesOptions.push(e)},onRemoveAvoidOption(e){let t=this.routingAvoidFeaturesOptions.findIndex(t=>t===e);this.routingAvoidFeaturesOptions.splice(t,1)},onBatchProcessingCheckboxInput(e){this.isochronesSettings.batchProcessing.active=e}}},YT={id:`routing-isochrones`},XT={id:`routing-isochrones-coordinate-input-form`,class:`form-horizontal`,role:`form`},ZT={class:`helptext mb-3`},QT={class:`routing-isochrones-methodoption-lable`,for:`routing-isochrones-methodoption`},$T=[`id`,`value`,`selected`,`disabled`],eE={key:5},tE={class:`d-flex flex-column`},nE={class:`col-12 d-grid gap-2`},rE=[`disabled`],iE={key:0,id:`routing-isochrones-result-isochrones`};function aE(e,t,n,r,i,o){let s=a(`RoutingSpeedProfileIcon`),c=a(`RoutingBatchProcessingCheckbox`),l=a(`IsochronesItemBatchProcessing`),u=a(`RoutingCoordinateInput`),d=a(`RoutingSliderInput`),f=a(`RoutingRestrictionsInput`),p=a(`RoutingAvoidFeatures`),m=a(`IsochronesLegend`),h=a(`RoutingDownload`),g=a(`IsochronesHoverData`);return v(),M(`div`,YT,[(v(!0),M(D,null,C(i.constantsRouting.speedProfileOptions,t=>(v(),F(s,{key:t,interaction:()=>o.changeSpeedProfile(t),class:E([`pointer mr-4 `,e.isInputDisabled?`opacity-05`:``]),"speed-profile-id":t,"fill-color":t===e.settings.speedProfile?`#0077ff`:`#000000`,tooltip:e.$t(`common:modules.routing.speedprofiles.`+t)},null,8,[`interaction`,`class`,`speed-profile-id`,`fill-color`,`tooltip`]))),128)),t[14]||=z(`hr`,null,null,-1),e.isochronesSettings.batchProcessing.enabled?(v(),M(D,{key:0},[A(c,{"batch-processing":e.isochronesSettings.batchProcessing,onInput:t[0]||=e=>o.onBatchProcessingCheckboxInput(e)},null,8,[`batch-processing`]),t[10]||=z(`hr`,null,null,-1)],64)):L(``,!0),e.isochronesSettings.batchProcessing.enabled&&e.isochronesSettings.batchProcessing.active?(v(),F(l,{key:1,settings:e.isochronesSettings},null,8,[`settings`])):(v(),M(D,{key:2},[z(`h6`,null,I(e.$t(`common:modules.routing.isochrones.startpoint`)),1
20),z(`form`,XT,[z(`div`,ZT,[z(`span`,null,I(e.$t(`common:modules.routing.coordinateInputHelp`)),1)]),A(u,{"count-waypoints":1,waypoint:e.waypoint,onRemoveWaypoint:t[1]||=e=>o.onRemoveWaypoint(),onSearchResultSelected:t[2]||=t=>e.zoomOnWaypoint()},null,8,[`waypoint`])])],64)),t[15]||=z(`hr`,null,null,-1),z(`label`,QT,I(e.$t(`common:modules.routing.isochrones.optimizeHeader`)),1),z(`select`,{id:`routing-isochrones-methodoption`,class:`form-select form-select-sm`,onChange:t[3]||=e=>o.changeMethodOption(e.target.value)},[(v(!0),M(D,null,C(i.constants.isochronesMethodeOptions,t=>(v(),M(`option`,{id:t,key:`routing-isochrones-methodoption-`+t,value:t,selected:t===e.settings.isochronesMethodOption,disabled:e.isInputDisabled},I(e.$t(`common:modules.routing.isochrones.optimization.`+t)),9,$T))),128))],32),e.settings.isochronesMethodOption===`DISTANCE`?(v(),F(d,{key:3,label:e.$t(`common:modules.routing.isochrones.maxDistance`),value:e.settings.distanceValue,min:e.settings.minDistance,max:e.settings.maxDistance,disabled:e.isInputDisabled,step:e.settings.intervalOption===`count`?.1:1,unit:`km`,onInput:t[4]||=e=>o.setDistanceValue(e)},null,8,[`label`,`value`,`min`,`max`,`disabled`,`step`])):e.settings.isochronesMethodOption===`TIME`?(v(),F(d,{key:4,label:e.$t(`common:modules.routing.isochrones.maxTraveltime`),value:e.settings.timeValue,min:e.settings.minTime,max:e.settings.maxTime,disabled:e.isInputDisabled,unit:`min`,onInput:t[5]||=e=>o.setTimeValue(e)},null,8,[`label`,`value`,`min`,`max`,`disabled`])):L(``,!0),A(d,{label:e.settings.intervalOption===`count`?e.$t(`common:modules.routing.isochrones.interval.count`):e.$t(`common:modules.routing.isochrones.interval.default`),value:e.settings.intervalValue,min:o.minIntervalValue,max:o.maxIntervalValue,unit:e.settings.isochronesMethodOption===`DISTANCE`?`km`:`min`,disabled:e.isInputDisabled,onInput:t[6]||=e=>o.setIntervalValue(e)},null,8,[`label`,`value`,`min`,`max`,`unit`,`disabled`]),t[16]||=z(`hr`,null,null,-1),e.settings.speedProfile===`HGV`?(v(),M(`div`,eE,[A(f)])):L(``,!0),A(p,{settings:e.settings,"active-avoid-features-options":e.routingAvoidFeaturesOptions,disabled:e.isInputDisabled,onAddAvoidOption:t[7]||=e=>o.onAddAvoidOption(e),onRemoveAvoidOption:t[8]||=e=>o.onRemoveAvoidOption(e)},null,8,[`settings`,`active-avoid-features-options`,`disabled`]),e.isochronesSettings.batchProcessing.enabled&&e.isochronesSettings.batchProcessing.active?L(``,!0):(v(),M(D,{key:6},[t[13]||=z(`hr`,null,null,-1),z(`div`,tE,[z(`div`,nE,[z(`button`,{class:`btn btn-primary`,type:`button`,disabled:e.waypoint.getCoordinates().length===0||e.isInputDisabled||o.numberOfIsochrones>10,onClick:t[9]||=t=>e.findIsochrones()},I(o.numberOfIsochrones>10?e.$t(`common:modules.routing.isochrones.tooManyIntervalsInline`):e.$t(`common:modules.routing.isochrones.calculate`)),9,rE)]),e.routingIsochrones?(v(),M(`div`,iE,[t[11]||=z(`hr`,{class:`w-100`},null,-1),A(m),t[12]||=z(`hr`,{class:`w-100`},null,-1),A(h,{"hide-gpx":``})])):L(``,!0),e.isochronesSettings.attributes.length>0?(v(),F(g,{key:1})):L(``,!0)])],64))])}var oE=K(JT,[[`render`,aE],[`__scopeId`,`data-v-1314b12a`]]);y();var sE={name:`TsrUpload`,components:{FileUpload:Vb},props:{csvHeaders:Boolean},emits:[`afterFileValidation`],data:function(){return{tsrWaypoints:[],dataIsValid:!1,dzIsDropHovering:!1,fileUploaded:!1}},computed:{...N(`Modules/Routing/TSR`,[`waypoints`,`settings`]),...N(`Modules/Routing`,[`taskHandler`,`tsrSettings`])},methods:{...o(`Modules/Routing/TSR`,[`IsLoadingTSR`]),...o(`Modules/Routing`,[`setTaskHandler`]),...w(`Modules/Routing/TSR`,[`fetchTSR`,`resetTSRResults`,`addWaypoint`,`findTSR`,`zoomAfterUpload`,`isStartEndInput`]),...w(`Alerting`,[`addSingleAlert`]),...w(`Modules/Routing`,[`transformCoordinatesWgs84ToLocalProjection`,`fetchTextByCoordinates`]),onInputChange(e){e.target.files!==void 0&&this.addFiles(e.target.files)},startFileInput(){this.$refs.fileInputLabel.click()},addFiles(e){if(this.checkFileType(e[0])){let t=new FileReader;t.readAsText(e[0]),t.onload=async e=>{let t=e.target.result;if(this.csvHeaders&&(t=e.target.result.substring(e.target.result.indexOf(` 21`)+1)),await this.validateCsv(t).catch(e=>{this.dataIsValid=!1,this.addSingleAlert({category:`error`,title:this.$t(`common:modules.routing.tsr.upload.failTitle`),content:this.$t(e)}),console.error(this.$t(e))}),this.dataIsValid)try{this.tsrWaypoints=this.splitCsv(t),await this.addFileToWay
21points(this.tsrWaypoints).then(e=>{e?this.addSingleAlert({category:`info`,title:this.$t(`common:modules.routing.tsr.upload.successTitle`),content:this.$t(`common:modules.routing.tsr.errors.duplicatePoints`)}):(this.addSingleAlert({category:`success`,title:this.$t(`common:modules.routing.tsr.upload.successTitle`),content:this.$t(`common:modules.routing.tsr.upload.successInfo`)}),this.fileUploaded=!0),this.waypoints[0].getCoordinates().length===0&&this.isStartEndInput(0),this.zoomAfterUpload()})}catch(e){this.addSingleAlert({category:`error`,title:this.$t(`common:modules.routing.tsr.upload.failTitle`),content:e.message}),console.error(e.message)}}}this.$emit(`afterFileValidation`)},splitCsv(e){return e.replace(/[\r]/g,``).trim().split(` 22`)},async addFileToWaypoints(e){let t=!1,n=!1;for(let r of e){r=r.includes(`,`)?r.replaceAll(`,`,`.`):r;let e=parseFloat(r.split(`;`)[1]),i=parseFloat(r.split(`;`)[2]),a=await this.fetchTextByCoordinates({coordinates:[e,i]}),o=await this.transformCoordinatesWgs84ToLocalProjection(a?[a.getCoordinates()[1],a.getCoordinates()[0]]:[e,i]);t=await this.waypoints.some(e=>e.coordinates[0]?e.coordinates[0].toFixed(2)===o[0].toFixed(2)&&e.coordinates[1].toFixed(2)===o[1].toFixed(2):!1),t?n=!0:this.addWaypoint({index:this.waypoints.length,coordinates:o,displayName:a?a.getDisplayName():`${o[0].toFixed(2)}, ${o[1].toFixed(2)}`})}return n},checkFileType(e){return e.type===`text/csv`?!0:(this.addSingleAlert({category:`error`,title:this.$t(`common:modules.routing.tsr.upload.failTitle`),content:this.$t(`common:modules.routing.tsr.errors.wrongFileType`)}),!1)},validateCsv(e){return new Promise((t,n)=>{if(typeof e!=`string`){n(Error(this.$t(`common:modules.routing.tsr.errors.errorNoEntries`)));return}if(e.length===0){n(Error(this.$t(`common:modules.routing.tsr.errors.errorNoEntries`)));return}if(this.splitCsv(e).length>this.settings.tsrPointLimit){n(Error(this.$t(`common:modules.routing.tsr.errors.errorToManyEntriesInFile`,{limit:this.settings.tsrPointLimit})));return}this.splitCsv(e).forEach((e,t)=>{let r=e.split(`;`);if(e.length===0){n(Error(this.$t(`common:modules.routing.tsr.errors.emptyRow`)));return}if(r.length!==3){n(Error(this.$t(`common:modules.routing.tsr.errors.wrongNEntriesInRow`,{row:t+1})));return}r.forEach(e=>{if(e.length===0){n(Error(this.$t(`common:modules.routing.tsr.errors.emptyEntriesInRow`,{row:t+1})));return}e.length>25&&n(Error(this.$t(`common:modules.routing.tsr.errors.attributeTooLong`,{row:t+1})))}),r=r.map(e=>e.replaceAll(`,`,`.`)),(!this.isNumber(Number(r[1]))||!this.isNumber(Number(r[2])))&&n(Error(this.$t(`common:modules.routing.tsr.errors.rowContainsEntriesNoNumber`,{row:t+1}))),(r[1]<-180||r[1]>180||r[2]<-90||r[2]>90)&&n(Error(this.$t(`common:modules.routing.tsr.errors.invalidCoordinateRange`,{row:t+1})))}),t(this.dataIsValid=!0)})},isNumber(e){return!isNaN(e)&&typeof e==`number`},onDrop(e){e.dataTransfer.files!==void 0&&this.addFiles(e.dataTransfer.files)}}},cE={class:`justify-content-center`},lE={ref:`fileInputLabel`,class:`d-none mt-2 mb-2 col-md-12`};function uE(e,t,n,r,i,o){let s=a(`FileUpload`);return v(),M(D,null,[z(`div`,cE,[A(s,{id:`fileUpload`,keydown:t=>e.triggerClickOnFileInput(t),change:e=>o.onInputChange(e),drop:e=>o.onDrop(e)},null,8,[`keydown`,`change`,`drop`])]),z(`label`,lE,[z(`input`,{ref:`fileInput`,type:`file`,accept:`.csv`,onChange:t[0]||=e=>o.onInputChange(e)},null,544)],512)],64)}var dE=K(sE,[[`render`,uE]]);y();var fE={name:`TsrOutput`,components:{RoutingDownload:uS,RoutingElevationProfile:US},data:function(){return{}},computed:{...N(`Modules/Routing/TSR`,[`waypoints`,`tsrDuration`,`tsrDistance`]),...N(`Modules/Routing`,[`taskHandler`,`tsrSettings`])},beforeMount(){this.removeTSRWaypointsDrawInteraction()},beforeUnmount(){this.createTSRWaypointsDrawInteraction()},methods:{...w(`Modules/Routing/TSR`,[`removeTSRWaypointsDrawInteraction`,`createTSRWaypointsDrawInteraction`])}},pE={id:`tsr-output`},mE={key:0,class:`d-flex align-items-center`},hE={class:`icon-with-number`},gE={class:`tsr-idx`},_E={key:1,class:`d-flex align-items-center`},vE={class:`icon-with-number`},yE={class:`tsr-idx`},bE={key:2,class:`d-flex align-items-center`},xE={class:`icon-with-number`},SE={class:`tsr-idx`},CE={key:3,class:`d-flex align-items-center`},wE={class:`icon-with-number`},TE={class:`tsr-idx`},EE={key:0};function DE(e,t,n,r,i,o){let s=a(`RoutingElevationProfile`),c=a(`RoutingDownload`);return v(),M(`div`,pE,[z(`p`,null,I(e.$t(`common:modules.routing.tsr.outputHeaderTSR`)),1),(v(!0),M(D,null,C(e.waypoints,(n,r)=>(v(),M(`div`,{key:r,class:`tsr-output-item`},[r===0?(v(),M(`div`,mE,[z(`span`,hE,[t[0]||=z(`i`,{class:`bi bi-circle start-icon`},null,-1),z(`span`,gE,I(e.$t(`common:modules.routing.startIndex`)),1)]),z(`span`,null,I(n.getDisplayName()),1)])):r===e.waypoints.length-1&&e.waypoints[0].coordinates.toString()===e.waypoints[e.waypoints.length-1].coordinates.toString()?(v(),M(`div`,_E,[z(`span`,vE,[t[1]||=z(`i`,{class:`bi bi-circle start-icon`},null,-1),z(`span`,yE,I(e.$t(`common:modules.routing.startIndex`)),1)]),z(`span`,null,I(e.waypoints[0].getDisplayName()),1)])):r===e.waypoints.length-1&&e.waypoints[0].coordinates.toString()!==e.waypoints[e.waypoints.length-1].coordinates.toString()?(v(),M(`div`,bE,[z(`span`,xE,[t[2]||=z(`i`,{class:`bi bi-circle end-icon`},null,-1),z(`span`,SE,I(e.$t(`common:modules.routing.endIndex`)),1)]),z(`span`,null,I(n.getDisplayName()),1)])):(v(),M(`div`,CE,[z(`span`,wE,[t[3]||=z(`i`,{class:`bi bi-circle waypoint-icon`},null,-1),z(`span`,TE,I(r),1)]),z(`span`,null,I(n.getDisplayName()),1)]))]))),128)),z(`div`,null,I(e.$t(`common:modules.routing.tsr.tsrDuration`))+` `+I(e.tsrDuration),1),z(`div`,null,I(e.$t(`common:modules.routing.tsr.tsrDistance`))+` `+I(e.tsrDistance),1),e.tsrSettings.elevation?(v(),M(`div`,EE,[t[4]||=z(`hr`,null,null,-1),A(s)])):L(``,!0),t[5]||=z(`hr`,null,null,-1),A(c)])}var OE=K(fE,[[`render`,DE],[`__scopeId`,`data-v-45f4bf29`]]);y();var kE={name:`TsrItem`,components:{IconButton:ab,RoutingCoordinateInput:ix,RoutingSpeedProfileIcon:mS,RoutingContextMenu:AC,TsrUpload:dE,TsrOutput:OE},data(){return{constantsRouting:Jy,csvHeaders:!1}},computed:{...N(`Modules/Routing/TSR`,[`isInputDisabled`,`settings`,`tsrRouteSource`,`tsrWaypointsLayer`,`tsrDirections`,`getTSRSpeedProfiles`,`waypoints`])},mounted(){this.appendModalToBody(),this.waypoints[0].getCoordinates().length===0&&this.isStartEndInput(0)},async created(){this.initTSR()},beforeUnmount(){this.closeTSR(),this.removeModalFromBody()},methods:{...o(`Modules/Routing/TSR`,[`setTsrDirections`]),...w(`Modules/Routing/TSR`,[`removeWaypoint`,`isStartEndInput`,`addWaypoint`,`addFeatToSource`,`findTSR`,`initTSR`,`closeTSR`]),changeSpeedProfile(e){this.isInputDisabled||(this.settings.speedProfile=e)},reset(){for(let e=this.waypoints.length-1;e>=0;e--)this.removeWaypoint({index:this.waypoints[e].index});
22this.tsrRouteSource?.getFeatures().forEach(e=>e.getGeometry().setCoordinates([])),this.setTsrDirections(null),this.isStartEndInput(0)},resetTsrDirections(){this.tsrRouteSource?.getFeatures().forEach(e=>e.getGeometry().setCoordinates([])),this.setTsrDirections(null),this.tsrWaypointsLayer.changed()},afterFileValidation(){let e=this.$refs.uploadModal;pt.getInstance(e).hide()},appendModalToBody(){document.body.appendChild(this.$refs.uploadModal)},removeModalFromBody(){document.body.removeChild(this.$refs.uploadModal)}}},AE={id:`routing-tsr`},jE={key:0},ME={id:`routing-tsr-coordinate-input-form`,class:`form-horizontal`,role:`form`},NE={class:`helptext mb-3`},PE={class:`row mb-3 m-1`},FE=[`title`],IE={class:`d-flex justify-content-between`},LE={class:`col-12 d-grid gap-2`},RE={key:1,id:`routing-tsr-directions`},zE={id:`uploadModal`,ref:`uploadModal`,class:`modal fade`,tabindex:`-1`,"aria-labelledby":`uploadModalLabel`,"aria-hidden":`true`},BE={class:`modal-dialog modal-dialog-centered`},VE={class:`modal-content`},HE={class:`modal-header`},UE={id:`uploadModalLabel`,class:`modal-title fs-5`},WE={class:`modal-body`},GE={class:`mt-2 col-md-12`},KE={class:`mt-2 mb-2 col-md-12`},qE={class:`form-check form-switch d-flex justify-content-center`},JE={class:`form-check-label`,for:`csvHeaderSwitch`};function YE(e,t,n,r,i,o){let c=a(`RoutingSpeedProfileIcon`),l=a(`RoutingCoordinateInput`),u=a(`IconButton`),d=a(`TsrOutput`),f=a(`TsrUpload`),p=a(`RoutingContextMenu`);return v(),M(D,null,[z(`div`,AE,[e.tsrDirections?(v(),M(`div`,RE,[z(`button`,{type:`button`,class:`btn btn-outline-dark`,onClick:t[9]||=e=>o.resetTsrDirections()},[t[16]||=z(`i`,{class:`bi bi-arrow-left`},null,-1),R(` `+I(e.$t(`common:modules.routing.tsr.modifyWaypointsTSR`)),1)]),A(d)])):(v(),M(`div`,jE,[(v(!0),M(D,null,C(e.getTSRSpeedProfiles,t=>(v(),F(c,{key:t,interaction:()=>o.changeSpeedProfile(t),class:E([`pointer mr-4 `,e.isInputDisabled?`opacity-05`:``]),"speed-profile-id":t,"fill-color":t===e.settings.speedProfile?`#0077ff`:`#000000`,tooltip:e.$t(`common:modules.routing.speedprofiles.`+t)},null,8,[`interaction`,`class`,`speed-profile-id`,`fill-color`,`tooltip`]))),128)),t[13]||=z(`hr`,null,null,-1),z(`div`,null,[z(`form`,ME,[z(`div`,NE,[z(`span`,null,I(e.$t(`common:modules.routing.coordinateInputHelp`)),1)]),(v(!0),M(D,null,C(e.waypoints.slice(0,e.waypoints.length-1),(n,r)=>(v(),F(l,{key:r,class:E(r===0?`startpoint-input`:`waypoint-input`),"count-waypoints":e.waypoints.length,waypoint:n,onRemoveWaypoint:t=>r===0?[e.removeWaypoint({index:n.index,reload:!0}),e.isStartEndInput(0)]:e.removeWaypoint({index:n.index,reload:!0}),onAddStartEnd:t=>e.isStartEndInput(r===0?0:1),onSearchResultSelected:t[0]||=t=>e.isStartEndInput(1)},null,8,[`class`,`count-waypoints`,`waypoint`,`onRemoveWaypoint`,`onAddStartEnd`]))),128)),z(`div`,PE,[z(`button`,{id:`add-waypoint`,type:`button`,class:`btn btn-light justify-content-left text-start`,title:e.$t(`common:modules.routing.addWaypoint`),onClick:t[1]||=t=>{e.isStartEndInput(1),e.addWaypoint({index:e.waypoints.length-1}),e.waypoints[0].getCoordinates().length===0&&e.isStartEndInput(0)},onKeydown:t[2]||=me(t=>e.addWaypoint({index:e.waypoints.length-1}),[`enter`])},[t[12]||=z(`i`,{class:`bi-plus-circle`},null,-1),R(` `+I(e.$t(`common:modules.routing.addWaypoint`)),1)],40,FE)]),A(l,{class:`endpoint-input`,"count-waypoints":e.waypoints.length,waypoint:e.waypoints[e.waypoints.length-1],onRemoveWaypoint:t[3]||=t=>e.removeWaypoint({index:e.waypoints.length-1,reload:!0}),onAddStartEnd:t[4]||=t=>e.isStartEndInput(2),onSearchResultSelected:t[5]||=t=>{e.isStartEndInput(0),e.addFeatToSource(e.waypoints[e.waypoints.length-1])}},null,8,[`count-waypoints`,`waypoint`])]),z(`div`,IE,[z(`div`,{id:`button-up`,"data-bs-toggle":`modal`,"data-bs-target":`#uploadModal`,role:`button`,tabindex:`0`,onClick:t[6]||=t=>e.isStartEndInput(1),onKeypress:t[7]||=t=>e.isStartEndInput(1)},[R(I(e.$t(`common:modules.routing.tsr.upload.header`))+` `,1),A(u,{class:`d-inline-flex`,aria:e.$t(`common:modules.routing.tsr.upload.header`),"class-array":[`btn-light`],icon:`bi-upload fs-6`,interaction:()=>e.isStartEndInput(1)},null,8,[`aria`,`interaction`])],32),z(`div`,null,[A(u,{aria:e.$t(`common:modules.routing.resetSettings`),"class-array":[`btn-light`],icon:`bi-trash fs-6`,interaction:()=>o.reset()},null,8,[`aria`,`interaction`])])])]),t[14]||=z(`hr`,null,null,-1),z(`div`,LE,[z(`button`,{class:`btn btn-primary`,type:`button`,onClick:t[8]||=t=>e.findTSR()},I(e.$t(`common:modules.routing.tsr.calculate`)),1)]),t[15]||=z(`hr`,null,null,-1)])),z(`div`,zE,[z(`div`,BE,[z(`div`,VE,[z(`div`,HE,[z(`h1`,UE,I(e.$t(`common:modules.routing.tsr.upload.header`)),1),t[17]||=z(`button`,{type:`button`,class:`btn-close`,"data-bs-dismiss":`modal`,"aria-label":`Close`},null,-1)]),z(`div`,WE,[z(`div`,GE,I(e.$t(`common:modules.routing.tsr.upload.description`)),1),z(`div`,KE,[R(I(e.$t(`common:modules.routing.tsr.structure`))+` `,1),t[18]||=z(`hr`,null,null,-1),z(`div`,qE,[s(z(`input`,{id:`csvHeaderSwitch`,"onUpdate:modelValue":t[10]||=e=>i.csvHeaders=e,class:`form-check-input`,type:`checkbox`,role:`switch`,"aria-checked":`csvHeaders`},null,512),[[We,i.csvHeaders]]),z(`label`,JE,[z(`b`,null,I(e.$t(`common:modules.routing.tsr.upload.csvHeaders`)),1)])]),t[19]||=z(`hr`,null,null,-1),A(f,{"csv-headers":i.csvHeaders,onAfterFileValidation:t[11]||=e=>o.afterFileValidation()},null,8,[`csv-headers`])])])])])],512)]),A(p)],64)}var XE=K(kE,[[`render`,YE],[`__scopeId`,`data-v-d0a6cdac`]]),ZE={...H(X),filteredRoutingToolOptions({routingToolOptions:e}){let t=[{id:`DIRECTIONS`,component:Iw},{id:`ISOCHRONES`,component:oE},{id:`TSR`,component:XE}],n=e;return n.length===0&&(n=[`DIRECTIONS`,`ISOCHRONES`,`TSR`]),t.filter(e=>n.includes(e.id))}
22,urlParams:e=>{let t={activeRoutingToolOption:e.activeRoutingToolOption,directionsSettings:{speedProfile:e.directionsSettings.speedProfile,preference:e.directionsSettings.preference},isochronesSettings:{speedProfile:e.isochronesSettings.speedProfile,isochronesMethodOption:e.isochronesSettings.isochronesMethodOption,distanceValue:e.isochronesSettings.distanceValue,intervalValue:e.isochronesSettings.intervalValue,timeValue:e.isochronesSettings.timeValue},Directions:{mapInteractionMode:e.Directions.mapInteractionMode,routingAvoidFeaturesOptions:e.Directions.routingAvoidFeaturesOptions},Isochrones:{routingAvoidFeaturesOptions:e.Isochrones.routingAvoidFeaturesOptions}};return JSON.stringify(t)}},QE=new Pe,$E=new Rt({id:`directions_waypoints_layer`,source:QE,style:WS,name:`directions_waypoints_layer`,alwaysOnTop:!0}),eD=new je({source:QE}),tD=new Ze({source:QE}),nD=new i({source:QE,type:`Point`,style:WS,condition:e=>e.originalEvent.buttons===1}),rD=new Pe({features:[new V({geometry:new sn([]),isHighlight:!1}),new V({geometry:new sn([]),isHighlight:!0})]}),iD=new Rt({id:`directions_route_layer`,source:rD,style:Vx.createDirectionsRouteStyle,name:`directions_route_layer`,alwaysOnTop:!0}),aD=new je({source:rD}),oD=new Ze({source:rD}),sD=new Pe;function cD(){let e=X.directionsSettings.styleAvoidAreas?X.directionsSettings.styleAvoidAreas:X.Directions.settings.styleAvoidAreas;return new T({fill:new S({color:[...e.fillColor,e.opacity]}),stroke:new x({color:[...e.lineColor,1],width:e.lineWidth}),image:new re({radius:e.pointRadius,stroke:new x({color:[...e.lineColor,1],width:e.pointLineWidth}),fill:new S({color:[...e.fillColor,e.opacity]})})})}var lD=new Rt({id:`directions_avoid_layer`,source:sD,style:cD,name:`directions_avoid_layer`,alwaysOnTop:!0}),uD=new je({source:sD}),dD=new Ze({source:sD}),fD=new i({source:sD,type:`Polygon`,style:cD}),pD=new tt({condition:p,layers:[lD]}),mD=new Pe,hD=new Rt({id:`directions_avoid_point_layer`,source:mD,style:nC,name:`directions_avoid_point_layer`,alwaysOnTop:!0}),gD=new i({source:mD,type:`Point`,style:nC}),_D=new $e({layers:[hD]}),vD=new tt({condition:p,layers:[hD]}),yD=new Pe;function bD(){return new T({image:new re({radius:6,stroke:new x({color:X.directionsSettings.styleElevationProfile.elevationPointLineColor,width:3}),fill:new S({color:X.directionsSettings.styleElevationProfile.elevationPointFillColor})})})}var xD={directionsWaypointsSource:QE,directionsWaypointsLayer:$E,directionsRouteSource:rD,directionsRouteLayer:iD,directionsAvoidSource:sD,directionsAvoidLayer:lD,directionsAvoidPointSource:mD,directionsAvoidPointLayer:hD,directionsElevationSource:yD,directionsElevationLayer:new Rt({id:`directions_elevation_layer`,source:yD,style:bD,name:`directions_elevation_layer`,alwaysOnTop:!0}),directionsWaypointsModifyInteraction:eD,directionsWaypointsSnapInteraction:tD,directionsWaypointsDrawInteraction:nD,directionsRouteModifyInteraction:aD,directionsRouteSnapInteraction:oD,directionsAvoidModifyInteraction:uD,directionsAvoidSnapInteraction:dD,directionsAvoidDrawInteraction:fD,directionsAvoidSelectInteraction:pD,directionsAvoidPointDrawInteraction:gD,directionsAvoidPointTranslateInteraction:_D,directionsAvoidPointSelectInteraction:vD,waypoints:[],isAwaitingRouteModifyEnd:!1,routingAvoidFeaturesOptions:[],routingRestrictionsInputData:{length:10,width:2.4,height:2.8,weight:18,axleload:6,hazmat:!1},routingRestrictionIsValid:{length:!0,width:!0,height:!0,weight:!0,axleload:!0},addStartEndPoint:-1,keepRoutes:!0,routingDirections:null,mapListenerAdded:!1,isLoadingDirections:!1,mapInteractionMode:`WAYPOINTS`,settings:X.directionsSettings},SD={...U(xD),setRoutingRestrictionIsValid:(e,{name:t,value:n})=>{e.routingRestrictionIsValid[t]=n}},CD=class{constructor({bbox:e,distance:t,duration:n,lineString:r,lineStringWaypointIndex:i,elevationProfile:a}){this.bbox=e,this.distance=t,this.duration=n,this.lineString=r,this.lineStringWaypointIndex=i,this.elevationProfile=a,this.segments=[]}getBbox(){return this.bbox}getDistanceMeter(){return this.distance}getDurationSeconds(){return this.duration}getLineString(){return this.lineString}getSegments(){return this.segments}getLineStringWaypointIndex(){return this.lineStringWaypointIndex}},wD=class{constructor({distance:e,duration:t,instruction:n,name:r,type:i,waypoints:a}){this.distance=e,this.duration=t,this.instruction=n,this.name=r,this.type=i,this.waypoints=a}getDistance(){return this.distance}getDuration(){return this.duration}getInstruction(){return this.instruction}
22getName(){return this.name}getType(){return this.type}getWaypoints(){return this.waypoints}},TD=class{constructor({distance:e,duration:t,steps:n}){this.distance=e,this.duration=t,this.steps=n,this.displayDetails=!1}getDistance(){return this.distance}getDuration(){return this.duration}getSteps(){return this.steps}getDisplayDetails(){return this.displayDetails}};function ED(e,t){let n=$.getters[`Modules/Routing/directionsSettings`]?.customPreferences;if(n&&n[t]?.includes(e))return e.toLowerCase();switch(e){case`RECOMMENDED`:return`recommended`;case`SHORTEST`:return`shortest`;default:throw Error(`Fehlende Preference Ãbersetzung`)}}async function DD({coordinates:e,language:t,transformCoordinatesToLocal:n,speedProfile:r,avoidSpeedProfileOptions:i,preference:a,avoidPolygons:o,instructions:s,elevation:c,avoidBorders:l}){let u=OD(r),d=null,f=null,p=null,m=null,h=null,g=null,_=null,v=null,ee=null;try{let n={coordinates:e,language:t,options:{...i.length>0&&{avoid_features:i.map(e=>Lw(e.id,r))},avoid_polygons:o,...l&&{avoid_borders:`all`}},preference:ED(a,r),units:`m`,geometry:!0,instructions:s,elevation:c};r===`HGV`&&(n.options.profile_params={},n.options.profile_params.restrictions={length:xD.routingRestrictionsInputData.length,width:xD.routingRestrictionsInputData.width,height:xD.routingRestrictionsInputData.height,weight:xD.routingRestrictionsInputData.weight,axleload:xD.routingRestrictionsInputData.axleload,hazmat:xD.routingRestrictionsInputData.hazmat}),ee=await B.post(u,n)}catch(e){throw e.response?.status===404?Error(i18next.t(`common:modules.routing.errors.noRouteFound`)):e.response?.data?.error&&e.response.data.error.code===2003?Error(i18next.t(`common:modules.routing.errors.avoidAreaBig`)):Error(i18next.t(`common:modules.routing.errors.errorRouteFetch`))}d=ee.data,f=d.features[0],p=await n([f.bbox[0],f.bbox[1]]),m=await n([f.bbox[2],f.bbox[3]]),h=[];for(let e of f.geometry.coordinates)h.push(await n(e));if(c&&(g={data:[],ascent:f.properties.ascent,descent:f.properties.descent},_=0,h.forEach((e,t)=>{if(t===0)g.data.push([_,e[2]]);else{let n=[h[t-1][0],h[t-1][1]],r=[h[t][0],h[t][1]];_+=vt(new sn([n,r])),g.data.push([_,e[2]])}})),v=new CD({bbox:[p[0],p[1],m[0],m[1]],lineString:h,distance:f.properties.summary.distance,duration:f.properties.summary.duration,lineStringWaypointIndex:f.properties.way_points,elevationProfile:g}),f.properties.segments)for(let e of f.properties.segments){let t=new TD({distance:e.distance,duration:e.duration,steps:[]});for(let n of e.steps)t.steps.push(new wD({distance:n.distance,duration:n.duration,instruction:n.instruction,name:n.name,type:n.type,waypoints:n.way_points}));v.segments.push(t)}return v}function OD(e){let t=`v2/directions/${Bw(e)}/geojson`,n=$.getters.restServiceById(X.directionsSettings.serviceId).url,r;return n.endsWith(`/`)?n+=t:n=n+`/`+t,r=n.startsWith(`/`)?new URL(n,window.location.origin):new URL(n),r}y();var kD={namespaced:!0,state:xD,mutations:SD,actions:{async findDirections({state:e,getters:t,commit:n,dispatch:r,rootState:i}){if(t.directionsCoordinates.length<2)return;let{waypoints:a,directionsRouteSource:o,routingAvoidFeaturesOptions:s,settings:c,directionsAvoidSource:l}=e,u=await mapCollection.getMap(i.Maps.mode),d=await r(`getDirectionsCoordinatesWgs84`),f=await r(`getRouteFeature`);if(!t.allHGVRestrictionsValid&&e.settings.speedProfile===`HGV`){o.getFeatures().forEach(e=>e.getGeometry().setCoordinates([])),n(`setRoutingDirections`,null),r(`Alerting/addSingleAlert`,{category:`error`,title:i18next.t(`common:modules.routing.errors.titleErrorRouteFetch`),content:i18next.t(`common:modules.routing.errors.hgvRestrictionOutOfRange`)},{root:!0});return}n(`setIsLoadingDirections`,!0),await r(`resetRoutingDirectionsResults`);try{let e=await r(`fetchDirections`,{wgs84Coords:d,instructions:!0});if(JSON.stringify(d)!==JSON.stringify(await r(`getDirectionsCoordinatesWgs84`)))return;f.getGeometry().setCoordinates(e.getLineString()),f.set(`avoidFeaturesOptions`,JSON.parse(JSON.stringify(s))),f.set(`speedProfile`,JSON.parse(JSON.stringify(c.speedProfile))),f.set(`preference`,JSON.parse(JSON.stringify(c.preference))),f.set(`hasAvoidPolygons`,l.getFeatures().length>0),a.forEach((t,n)=>{t.setIndexDirectionsLineString(e.getLineStringWaypointIndex()[n])}),u.getView().fit(o.getExtent()),n(`setRoutingDirections`,e)}catch(e){r(`Alerting/addSingleAlert`,{category:`error`,title:i18next.t(`common:modules.alerting.categories.info`),content:e.message},{root:!0})}n(`setIsLoadingDirections`,!1)},async resetRoutingDirectionsResults({dispatch:e,commit:t}){let n=await e(`getRouteFeature`);t(`setRoutingDirections`,null),n.getGeometry().setCoordinates([])},async fetchDirections({state:e,getters:t,dispatch:n,rootState:r},{wgs84Coords:i,instructions:a}){let o=await r.Modules.Routing.directionsSettings,{selectedAvoidSpeedProfileOptions:s}=t,c=await n(`getAvoidPolygonsWgs84`),l=s.find(e=>e.id===`BORDERS`);if(o.type===`ORS`)return DD({coordinates:i,language:i18next.language,transformCoordinatesToLocal:e=>n(`Modules/Routing/transformCoordinatesWgs84ToLocalProjection`,e,{root:!0}),speedProfile:e.settings.speedProfile,avoidSpeedProfileOptions:s.filter(e=>e.id!==`BORDERS`),preference:e.settings.preference,avoidPolygons:c,instructions:a,elevation:e.settings.elevation,avoidBorders:l});throw Error(`fetchDirections Type is not configured correctly.`)}
22,getRouteFeature({state:e}){let{directionsRouteSource:t}=e;return t.getFeatures().find(e=>!e.get(`isHighlight`))},getHighlightFeature({state:e}){let{directionsRouteSource:t}=e;return t.getFeatures().find(e=>e.get(`isHighlight`))},async unHighlightRoute({dispatch:e}){(await e(`getHighlightFeature`)).getGeometry().setCoordinates([])},async highlightRoute({dispatch:e,state:t},{fromWaypointIndex:n,toWaypointIndex:r,coordsIndex:i}){let{waypoints:a}=t,o=await e(`getRouteFeature`),s=await e(`getHighlightFeature`),c=i?i.slice(0):[a[n].getIndexDirectionsLineString(),a[r].getIndexDirectionsLineString()];s.getGeometry().setCoordinates(o.getGeometry().getCoordinates().slice(...c))},async zoomToRoute({dispatch:e,state:t,rootState:n},{fromWaypointIndex:r,toWaypointIndex:i,coordsIndex:a}){let{waypoints:o}=t,s=mapCollection.getMap(n.Maps.mode),c=await e(`getRouteFeature`),l=a?a.slice(0):[o[r].getIndexDirectionsLineString(),o[i].getIndexDirectionsLineString()],u=new V({geometry:new sn(c.getGeometry().getCoordinates().slice(...l))});s.getView().fit(u.getGeometry().getExtent())},async getDirectionsCoordinatesWgs84({dispatch:e,getters:t}){let n=[],r=t.waypoints.map(e=>e.getCoordinates()).filter(e=>e.length===2);for(let t of r)n.push(await e(`Modules/Routing/transformCoordinatesLocalToWgs84Projection`,t,{root:!0}));return n},async getAvoidPolygonsWgs84({state:e,dispatch:t}){let{directionsAvoidSource:n,directionsAvoidPointSource:r}=e,i=n.getFeatures(),a=r.getFeatures(),o={type:`MultiPolygon`,coordinates:[]};for(let e of i)o.coordinates.push(await t(`getAvoidCoordinates`,e.getGeometry()));for(let e of a){e.getGeometry().getRadius()===0&&e.getGeometry().setRadius(5);let n=et(e.getGeometry(),36);o.coordinates.push(await t(`getAvoidCoordinates`,n))}return o},async getAvoidCoordinates({dispatch:e},t){let n=t.getCoordinates(),r=[];for(let t of n){let n=[];for(let r of t)n.push(await e(`Modules/Routing/transformCoordinatesLocalToWgs84Projection`,r,{root:!0}));r.push(n)}return r},async initDirections({state:e,dispatch:t,commit:n,rootState:r}){let{directionsWaypointsLayer:i,directionsRouteLayer:a,directionsAvoidLayer:o,directionsAvoidPointLayer:s,directionsElevationLayer:c,directionsWaypointsDrawInteraction:l,directionsAvoidDrawInteraction:u,directionsAvoidPointDrawInteraction:d,directionsAvoidSelectInteraction:f,directionsAvoidPointSelectInteraction:p,mapListenerAdded:m}=e,h=(await mapCollection.getMap(r.Maps.mode)).getLayers().getArray();function g(e){return h.some(t=>t.get(`id`)===e)}t(`initWaypoints`),m||(l.on(`drawend`,e=>t(`onDirectionsWaypointsDrawEnd`,e)),u.on(`drawend`,e=>t(`onDirectionsAvoidDrawEnd`,e)),d.on(`drawend`,e=>t(`onDirectionsAvoidPointDrawEnd`,e)),f.on(`select`,e=>t(`onDirectionsAvoidSelect`,e)),p.on(`select`,e=>t(`onDirectionsAvoidPointSelect`,e)),t(`createDirectionsWaypointsModifyInteractionListener`),t(`createDirectionsAvoidModifyInteractionListener`),t(`createDirectionsAvoidPointTranslateInteractionListener`),t(`createDirectionsRouteModifyInteractionListener`),n(`setMapListenerAdded`,!0)),g(a.get(`id`))||t(`Maps/addLayer`,k(a),{root:!0}),g(i.get(`id`))||t(`Maps/addLayer`,k(i),{root:!0}),g(o.get(`id`))||t(`Maps/addLayer`,k(o),{root:!0}),g(s.get(`id`))||t(`Maps/addLayer`,k(s),{root:!0}),g(c.get(`id`))||t(`Maps/addLayer`,k(c),{root:!0}),t(`createInteractionFromMapInteractionMode`)},reset({getters:e,commit:t,dispatch:n}){let{waypoints:r,directionsRouteSource:i,directionsAvoidSource:a,directionsAvoidPointSource:o}=e;if(r.length>0){for(let e=r.length-1;e>=0;e--)n(`removeWaypoint`,{index:r[e].index}),r[e]&&r[e].fromExtern===!0&&r.splice(e,1);i.getFeatures().forEach(e=>e.getGeometry().setCoordinates([])),t(`setRoutingDirections`,null),a.clear(),o.clear()}},createInteractionFromMapInteractionMode({state:e,dispatch:t}){let{mapInteractionMode:n}=e;n===`WAYPOINTS`?t(`createDirectionsWaypointsDrawInteraction`):n===`AVOID_AREAS`?t(`createDirectionsAvoidDrawInteraction`):n===`DELETE_AVOID_AREAS`?t(`createDirectionsAvoidSelectInteraction`):n===`AVOID_POINTS`&&t(`createDirectionsAvoidPointDrawInteraction`)},async closeDirections({state:e,dispatch:t}){let{directionsWaypointsLayer:n,directionsRouteLayer:r,directionsAvoidLayer:i,directionsAvoidPointLayer:a,directionsElevationLayer:o}=e,s=await mapCollection.getMap(`2D`);e.keepRoutes||s.removeLayer(k(r)),s.removeLayer(k(n)),s.removeLayer(k(i)),s.removeLayer(k(a)),s.removeLayer(k(o)),t(`removeMapInteractions`)},createDirectionsWaypointsModifyInteractionListener({state:e,dispatch:t}){let{directionsWaypointsModifyInteraction:n}=e,r;n.on(`modifystart`,e=>
22{e.features.getArray().forEach(e=>{e.getGeometry().once(`change`,()=>{r=e})})}),n.on(`modifyend`,async()=>{let{waypoints:n}=e,i=n[r.get(`routingId`)],a=await t(`Modules/Routing/fetchTextByCoordinates`,{coordinates:await t(`Modules/Routing/transformCoordinatesLocalToWgs84Projection`,r.getGeometry().getCoordinates(),{root:!0})},{root:!0});i.setDisplayName(a?a.getDisplayName():i.getCoordinates()),t(`findDirections`)})},createDirectionsAvoidModifyInteractionListener({state:e,dispatch:t}){let{directionsAvoidModifyInteraction:n}=e;n.on(`modifyend`,async()=>{t(`findDirections`)})},createDirectionsAvoidPointTranslateInteractionListener({state:e,dispatch:t}){let{directionsAvoidPointTranslateInteraction:n}=e;n.on(`translateend`,async()=>{t(`findDirections`)})},findWaypointBetweenLineStringIndex({state:e},{lineStringIndex:t}){let{waypoints:n}=e;for(let e=0;e<n.length;e++){let r=n[e],i=n[e+1];if(!i||r.getIndexDirectionsLineString()===null||i.getIndexDirectionsLineString()===null)break;if(t>=r.getIndexDirectionsLineString()&&t<i.getIndexDirectionsLineString())return e}return null},isStartEndInput({state:e},t){e.addStartEndPoint=t},createDirectionsRouteModifyInteractionListener({state:e,dispatch:t,commit:n}){let{directionsRouteModifyInteraction:i}=e;i.on(`modifyend`,async i=>{let{routingDirections:a}=e,o=i.features.getArray()[0].getGeometry().getCoordinates(),s=a.getLineString();n(`setIsAwaitingRouteModifyEnd`,!0);for(let n=0;n<s.length;n++){if(s[n][0]===o[n][0]&&s[n][1]===o[n][1])continue;let i=o[n].splice(0,2),a=await t(`findWaypointBetweenLineStringIndex`,{lineStringIndex:n}),c=await t(`Modules/Routing/fetchTextByCoordinates`,{coordinates:await t(`Modules/Routing/transformCoordinatesLocalToWgs84Projection`,i,{root:!0})},{root:!0}),l=new V({geometry:new r(i)});await t(`addWaypoint`,{index:a+1,feature:l,displayName:c?c.getDisplayName():null}),e.directionsWaypointsSource.addFeature(l);break}n(`setIsAwaitingRouteModifyEnd`,!1),t(`findDirections`)})},addWaypoint({state:e},{index:t,feature:n,displayName:r,coordinates:i,fromExtern:a}){let o=t,s;if(typeof t!=`number`&&(o=e.waypoints.length),n){let t=e.waypoints.find(e=>e.getCoordinates().length===0);if(t&&e.addStartEndPoint===-1)return t.setCoordinates(n.getGeometry().getCoordinates().splice(0,2)),r&&t.setDisplayName(r),e.directionsWaypointsSource.removeFeature(n),t}n&&e.addStartEndPoint>=0?(e.waypoints[e.addStartEndPoint].setCoordinates(n.getGeometry().getCoordinates()),e.waypoints[e.addStartEndPoint].setDisplayName(r),e.directionsWaypointsSource?.removeFeature(n)):e.addStartEndPoint===-1&&(s=new Vw({index:o,feature:n,displayName:r,source:e.directionsWaypointsSource})),e.addStartEndPoint=-1,s&&(a&&(s.fromExtern=!0),i&&s.setCoordinates(i),e.waypoints.splice(o,0,s));for(let t=o+1;t<e.waypoints.length;t++)e.waypoints[t].setIndex(t);return s},removeWaypoint({state:e,dispatch:t,commit:n},{index:r,reload:i=!1}){let{waypoints:a,directionsWaypointsSource:o,directionsRouteSource:s}=e;if(a.length===2){a[r].reset(),s.getFeatures().forEach(e=>e.getGeometry().setCoordinates([])),n(`setRoutingDirections`,null);return}a[r].addedToSource&&o.removeFeature(a[r].getFeature());for(let e=r;e<a.length;e++)a[e].setIndex(a[e].getIndex()-1);a.splice(r,1),i&&t(`findDirections`)},moveWaypointDown({state:e,dispatch:t},n){let{waypoints:r}=e,i=n+1,a=r[n],o=r[i];n<0||i>=r.length||(r.splice(n,2,r[i],r[n]),a.setIndex(i),o.setIndex(n),t(`findDirections`))},moveWaypointUp({state:e,dispatch:t},n){let{waypoints:r}=e,i=n-1,a=r[n],o=r[i];n<0||i===r.length||(r.splice(i,2,r[n],r[i]),a.setIndex(i),o.setIndex(n),t(`findDirections`))},initWaypoints({dispatch:e,state:t}){let n=t.waypoints.filter(e=>e.fromExtern===!0),r=n.length>0?n.length:t.waypoints.length;for(let t=r;t<2;t++)e(`addWaypoint`,{index:t})},async onDirectionsWaypointsDrawEnd({dispatch:e},t){let n=await e(`Modules/Routing/fetchTextByCoordinates`,{coordinates:await e(`Modules/Routing/transformCoordinatesLocalToWgs84Projection`,t.feature.getGeometry().getCoordinates(),{root:!0})},{root:!0});await e(`addWaypoint`,{feature:t.feature,displayName:n?n.getDisplayName():null}),e(`findDirections`)},async onDirectionsAvoidDrawEnd({dispatch:e}){e(`findDirections`)},onDirectionsAvoidPointDrawEnd({state:e,dispatch:t},n){n.feature.setGeometry(new ht(n.feature.getGeometry().getCoordinates())),n.feature.getGeometry().setRadius(e.settings.avoidRadius>0?e.settings.avoidRadius*1e3:5),t(`findDirections`)},displayImportedAvoidAreas({dispatch:e,state:t},n){t.directionsAvoidSource.addFeature(n),e(`findDirections`)},onDirectionsAvoidSelect({state:e,dispatch:t},n){let{directionsAvoidSource:r}=e;
22for(let e of n.selected)r.removeFeature(e);t(`findDirections`)},onDirectionsAvoidPointSelect({state:e,dispatch:t},n){let{directionsAvoidPointSource:r}=e;for(let e of n.selected)r.removeFeature(e);t(`findDirections`)},createDirectionsWaypointsDrawInteraction({state:e,dispatch:t}){t(`removeMapInteractions`);let{directionsWaypointsModifyInteraction:n,directionsWaypointsSnapInteraction:r,directionsWaypointsDrawInteraction:i,directionsRouteModifyInteraction:a,directionsRouteSnapInteraction:o}=e;t(`Maps/addInteraction`,a,{root:!0}),t(`Maps/addInteraction`,o,{root:!0}),t(`Maps/addInteraction`,i,{root:!0}),t(`Maps/addInteraction`,n,{root:!0}),t(`Maps/addInteraction`,r,{root:!0})},removeDirectionsWaypointsDrawInteraction({state:e,dispatch:t}){let{directionsWaypointsDrawInteraction:n,directionsWaypointsModifyInteraction:r,directionsWaypointsSnapInteraction:i,directionsRouteModifyInteraction:a,directionsRouteSnapInteraction:o}=e;n.abortDrawing(),t(`Maps/removeInteraction`,a,{root:!0}),t(`Maps/removeInteraction`,o,{root:!0}),t(`Maps/removeInteraction`,n,{root:!0}),t(`Maps/removeInteraction`,r,{root:!0}),t(`Maps/removeInteraction`,i,{root:!0})},createDirectionsAvoidDrawInteraction({state:e,dispatch:t}){t(`removeMapInteractions`);let{directionsAvoidModifyInteraction:n,directionsAvoidSnapInteraction:r,directionsAvoidDrawInteraction:i}=e;t(`Maps/addInteraction`,i,{root:!0}),t(`Maps/addInteraction`,n,{root:!0}),t(`Maps/addInteraction`,r,{root:!0})},createDirectionsAvoidPointDrawInteraction({state:e,dispatch:t}){t(`removeMapInteractions`);let{directionsAvoidPointTranslateInteraction:n,directionsAvoidPointDrawInteraction:r}=e;t(`Maps/addInteraction`,r,{root:!0}),t(`Maps/addInteraction`,n,{root:!0})},removeDirectionsAvoidDrawInteraction({state:e,dispatch:t}){let{directionsAvoidModifyInteraction:n,directionsAvoidPointTranslateInteraction:r,directionsAvoidSnapInteraction:i,directionsAvoidDrawInteraction:a,directionsAvoidPointDrawInteraction:o}=e;a.abortDrawing(),t(`Maps/removeInteraction`,n,{root:!0}),t(`Maps/removeInteraction`,r,{root:!0}),t(`Maps/removeInteraction`,i,{root:!0}),t(`Maps/removeInteraction`,a,{root:!0}),t(`Maps/removeInteraction`,o,{root:!0})},createDirectionsAvoidSelectInteraction({state:e,dispatch:t}){t(`removeMapInteractions`);let{directionsAvoidSelectInteraction:n,directionsAvoidPointSelectInteraction:r}=e;t(`Maps/addInteraction`,n,{root:!0}),t(`Maps/addInteraction`,r,{root:!0})},removeDirectionsAvoidSelectInteraction({state:e,dispatch:t}){let{directionsAvoidSelectInteraction:n,directionsAvoidPointSelectInteraction:r}=e;t(`Maps/removeInteraction`,n,{root:!0}),t(`Maps/removeInteraction`,r,{root:!0})},removeMapInteractions({dispatch:e}){e(`removeDirectionsWaypointsDrawInteraction`),e(`removeDirectionsAvoidDrawInteraction`),e(`removeDirectionsAvoidSelectInteraction`)},removeAvoidLayer({state:e,rootState:t}){let{directionsAvoidLayer:n,directionsAvoidPointLayer:r}=e,i=mapCollection.getMap(t.Maps.mode);i.removeLayer(k(n)),i.removeLayer(k(r))},addAvoidLayer({state:e,rootState:t}){let{directionsAvoidLayer:n,directionsAvoidPointLayer:r}=e,i=mapCollection.getMap(t.Maps.mode);i.getLayers().getArray().includes(k(n))||(i.addLayer(k(n)),i.addLayer(k(r)))}},getters:{...H(xD),directionsCoordinates({waypoints:e}){return e.map(e=>e.getCoordinates()).filter(e=>e.length===2)},selectedAvoidSpeedProfileOptions({settings:e,routingAvoidFeaturesOptions:t}){return Xy.filter(n=>n.availableProfiles.includes(e.speedProfile)&&t.includes(n.id))},isInputDisabled({isLoadingDirections:e}){return e},allHGVRestrictionsValid(e){return Object.values(e.routingRestrictionIsValid).every(e=>e)}}},AD={namespaced:!0,state:Xw,mutations:nT,actions:tT,getters:{...H(Xw),selectedAvoidSpeedProfileOptions({settings:e,routingAvoidFeaturesOptions:t}){return Xy.filter(n=>n.availableProfiles.includes(e.speedProfile)&&t.includes(n.id))},isInputDisabled({isLoadingIsochrones:e}){return e},allHGVRestrictionsValid(e){return Object.values(e.isochronesRestrictionIsValid).every(e=>e)}}},jD={...U(eC)},MD=class{constructor({distance:e,duration:t,lineString:n,lineStringWaypointIndex:r,steps:i,elevationProfile:a}){this.distance=e,this.duration=t,this.lineString=n,this.lineStringWaypointIndex=r,this.segments=[],this.steps=i,this.elevationProfile=a}getDistanceMeter(){return this.distance}getDurationSeconds(){return this.duration}getLineString(){return this.lineString}};async function ND({coordinates:e,speedProfile:t,transformCoordinatesToLocal:n}){let r=$.getters.restServiceById(X.tsrSettings.serviceId).url,i=[],a=e[0],o=e[e.length-1],s=[],c=X.tsrSettings.elevation,l=null,u=null,d=null,f=null,p=null,m=null,h=null,g=null,_=null,v=``;t===`CAR`?v=`driving-car`:t===`HGV`?v=`driving-hgv`:t===`CYCLING`?v=`cycling-regular`:t===`FOOT`&&(v=`foot-walking`);for(let t=1;t<e.length-1;t++){let n={id:t-1,location:[e[t][0],e[t][1]]};i.push(n)}try{d=await PD(r,v,a,o,i),c&&(h=d.data.routes[0].steps.map(e=>e.location),f=await FD(v,h))}catch(e){throw e.response.status===404?Error(i18next.t(`common:modules.routing.errors.noRouteFound`)):e.response.data.code===3?Error(i18next.t(`common:modules.routing.tsr.errors.unreachablePoint`)):Error(i18next.t(`common:modules.routing.errors.errorRouteFetch`))}p=d.data,m=p.routes[0].steps,l=c?f.data.features[0]:LD(p,!1).features[0];for(let e of l.geometry.coordinates)s.push(await n(e));return c&&(g={data:[],ascent:l.properties.ascent,descent:l.properties.descent}
22,_=0,s.forEach((e,t)=>{if(t===0)g.data.push([_,e[2]]);else{let n=[s[t-1][0],s[t-1][1]],r=[s[t][0],s[t][1]];_+=vt(new sn([n,r])),g.data.push([_,e[2]])}})),u=new MD({lineString:s,distance:c?l.properties.summary.distance:l.properties.distance,duration:c?l.properties.summary.duration:l.properties.duration,steps:m,elevationProfile:g}),u}async function PD(e,t,n,r,i){return await B.post(e,{vehicles:[{id:0,profile:t,start:[n[0],n[1]],end:[r[0],r[1]]}],jobs:i,options:{g:!0}},{"content-type":`application/json`,Accept:`application/json`})}async function FD(e,t){let n=$.getters.restServiceById(X.directionsSettings.serviceId).url,r=null,i=``,a=`v2/directions/${e}/geojson`,o={coordinates:t,preference:`recommended`,units:`m`,elevation:!0};return n.endsWith(`/`)?n+=a:n=n+`/`+a,i=n.startsWith(`/`)?new URL(n,window.location.origin):new URL(n),r=await B.post(i,o),r}function ID(e,t){let n=[],r=e.length,i=0,a=0,o=0,s=0;for(;i<r;){let r,c=0,l=0;do r=e.charAt(i++).charCodeAt(0)-63,l|=(r&31)<<c,c+=5;while(r>=32);a+=l&1?~(l>>1):l>>1,c=0,l=0;do r=e.charAt(i++).charCodeAt(0)-63,l|=(r&31)<<c,c+=5;while(r>=32);if(o+=l&1?~(l>>1):l>>1,t){c=0,l=0;do r=e.charAt(i++).charCodeAt(0)-63,l|=(r&31)<<c,c+=5;while(r>=32);s+=l&1?~(l>>1):l>>1}try{let e=[a/1e5,o/1e5];t&&e.push(s/100),n.push(e)}catch(e){this.addSingleAlert({category:`error`,title:this.$t(`common:modules.routing.errors.titleErrorRouteFetch`),content:e.message})}}return n}function LD(e,t){let n={},r={};if(`routes`in e)n=e.routes,delete e.routes;else return i;let i={type:`FeatureCollection`,features:[],metadata:e};return n.forEach(e=>{let n=e.geometry,a=ID(n,t);a.forEach(function(e){e.reverse()}),r={type:`Feature`,properties:e,geometry:{type:`LineString`,coordinates:a}},i.features.push(r)}),i}y();var RD={namespaced:!0,modules:{Directions:kD,Isochrones:AD,TSR:{namespaced:!0,state:eC,mutations:jD,actions:{async findTSR({state:e,commit:t,dispatch:n,rootState:r}){if(e.waypoints.length<3){n(`Alerting/addSingleAlert`,{category:`error`,content:i18next.t(`common:modules.routing.tsr.errors.notEnoughPoints`),title:i18next.t(`common:modules.routing.tsr.errors.errorCalculation`)},{root:!0}),console.warn(i18next.t(`common:modules.routing.tsr.errors.notEnoughPoints`));return}if(e.waypoints.filter(t=>t.coordinates.length===0&&t.index!==e.waypoints.length-1).length>0){n(`Alerting/addSingleAlert`,{category:`error`,content:i18next.t(`common:modules.routing.tsr.errors.emptyPoint`),title:i18next.t(`common:modules.routing.tsr.errors.errorCalculation`)},{root:!0}),console.warn(i18next.t(`common:modules.routing.tsr.errors.emptyPoint`));return}let{tsrRouteSource:i,settings:a,tsrWaypointsLayer:o}=e,s=await mapCollection.getMap(r.Maps.mode),c=await n(`getTSRCoordinatesWgs84`),l=await n(`getRouteFeature`);t(`setIsLoadingDirections`,!0),await n(`resetTSRResults`);try{let e=await n(`fetchTSR`,{wgs84Coords:c,instructions:!0}),r=Math.floor(e.duration/3600),u=Math.floor(e.duration/60%60);if((r||u)===0&&(u=`01`),t(`setTsrDistance`,(e.distance/1e3).toFixed(2)+` km`),t(`setTsrDuration`,r+` h `+u+` min`),JSON.stringify(c)!==JSON.stringify(await n(`getTSRCoordinatesWgs84`)))return;await n(`assignWaypointOrder`,e),l.getGeometry().setCoordinates(e.getLineString()),l.set(`speedProfile`,JSON.parse(JSON.stringify(a.speedProfile))),l.set(`preference`,JSON.parse(JSON.stringify(a.preference))),s.getView().fit(i.getExtent()),t(`setTsrDirections`,e),o.changed()}catch(e){n(`Alerting/addSingleAlert`,{category:`error`,title:i18next.t(`common:modules.routing.errors.titleErrorRouteFetch`),content:e.message},{root:!0}),console.warn(i18next.t(`common:modules.routing.errors.titleErrorRouteFetch`))}t(`setIsLoadingDirections`,!1)},assignWaypointOrder({dispatch:e,state:t},n){n.steps.forEach(async(n,r)=>{if(n.type===`job`){let i=await e(`Modules/Routing/transformCoordinatesWgs84ToLocalProjection`,n.location,{root:!0});t.waypoints.find(e=>e.coordinates[0].toFixed(2)===i[0].toFixed(2)&&e.coordinates[1].toFixed(2)===i[1].toFixed(2)).setIndex(r)}t.waypoints.sort((e,t)=>e.index-t.index)})},async resetTSRResults({dispatch:e,commit:t}){let n=await e(`getRouteFeature`);t(`setTsrDirections`,null),n.getGeometry().setCoordinates([])},async fetchTSR({state:e,dispatch:t,rootState:n},{wgs84Coords:r,instructions:i}){if((await n.Modules.Routing.tsrSettings).type===`TSR`)return ND({coordinates:r,language:i18next.language,transformCoordinatesToLocal:e=>t(`Modules/Routing/transformCoordinatesWgs84ToLocalProjection`,e,{root:!0}),speedProfile:e.settings.speedProfile,preference:e.settings.preference,instructions:i});throw Error(`fetchTSR Type is not configured correctly.`)}
22,getRouteFeature({state:e}){let{tsrRouteSource:t}=e;return t.getFeatures()[0]},async getTSRCoordinatesWgs84({state:e,getters:t,dispatch:n}){e.waypoints[e.waypoints.length-1].getCoordinates()[0]||(e.waypoints[e.waypoints.length-1].setCoordinates(e.waypoints[0]?.getCoordinates()),e.waypoints[e.waypoints.length-1].setDisplayName(i18next.t(`common:modules.routing.tsr.tsrEndpoint`)),e.tsrWaypointsSource?.removeFeature(e.waypoints[e.waypoints.length-1].getFeature()));let r=[],i=t.waypoints.map(e=>e.getCoordinates()).filter(e=>e.length===2);for(let e of i)r.push(await n(`Modules/Routing/transformCoordinatesLocalToWgs84Projection`,e,{root:!0}));return r},async initTSR({state:e,dispatch:t,commit:n}){let{tsrWaypointsLayer:r,tsrRouteLayer:i,tsrElevationLayer:a,tsrWaypointsDrawInteraction:o,mapListenerAdded:s}=e;t(`initWaypoints`),s||(o.on(`drawend`,e=>t(`onTSRWaypointsDrawEnd`,e)),t(`createTSRWaypointsModifyInteractionListener`),n(`setMapListenerAdded`,!0)),t(`Maps/addLayer`,k(i),{root:!0}),t(`Maps/addLayer`,k(r),{root:!0}),t(`Maps/addLayer`,k(a),{root:!0}),t(`createInteractionFromMapInteractionMode`)},reset({getters:e,commit:t,dispatch:n}){let{waypoints:r,tsrRouteSource:i}=e;if(r.length>0){for(let e=r.length-1;e>=0;e--)n(`removeWaypoint`,{index:r[e].index}),r[e]&&r[e].fromExtern===!0&&r.splice(e,1);i.getFeatures().forEach(e=>e.getGeometry().setCoordinates([])),t(`setTsrDirections`,null)}},createInteractionFromMapInteractionMode({state:e,dispatch:t}){let{mapInteractionMode:n}=e;n===`WAYPOINTS`&&t(`createTSRWaypointsDrawInteraction`)},async closeTSR({state:e,dispatch:t}){let{tsrWaypointsLayer:n,tsrRouteLayer:r,tsrElevationLayer:i}=e,a=await mapCollection.getMap(`2D`);a.removeLayer(k(r)),a.removeLayer(k(n)),a.removeLayer(k(i)),t(`removeMapInteractions`)},createTSRWaypointsModifyInteractionListener({state:e,dispatch:t}){let{tsrWaypointsModifyInteraction:n}=e,r;n.on(`modifystart`,n=>{n.features.getArray()[0].getGeometry().getCoordinates().toString()===e.waypoints[0].getCoordinates().toString()&&e.waypoints[0].getCoordinates().toString()===e.waypoints[e.waypoints.length-1].getCoordinates().toString()&&t(`removeWaypoint`,{index:e.waypoints.length-1}),n.features.getArray().forEach(e=>{e.getGeometry().once(`change`,()=>{r=e})})}),n.on(`modifyend`,async()=>{let{waypoints:n}=e,i=n[r.get(`routingId`)],a=await t(`Modules/Routing/fetchTextByCoordinates`,{coordinates:await t(`Modules/Routing/transformCoordinatesLocalToWgs84Projection`,r.getGeometry().getCoordinates(),{root:!0})},{root:!0}),o=i.getCoordinates();o[0]=parseFloat(o[0].toFixed(2)),o[1]=parseFloat(o[1].toFixed(2)),i.setCoordinates(o),i.setDisplayName(a?a.getDisplayName():`${o[0]}, ${o[1]}`)})},isStartEndInput({state:e},t){e.addStartEndPoint=t},addFeatToSource({state:e},t){e.tsrWaypointsSource?.hasFeature(t.getFeature())||e.tsrWaypointsSource?.addFeature(t.getFeature())},addWaypoint({state:e,dispatch:t},{index:n,feature:i,displayName:a,coordinates:o,fromExtern:s}){let c=n,l,u,d=e.waypoints.length-1;if(typeof n!=`number`&&(c=e.waypoints.length),i||o){if(o){let e=o;e[0]=parseFloat(e[0].toFixed(2)),e[1]=parseFloat(e[1].toFixed(2)),u=new V({geometry:new r(e)})}else if(i){let e=i.getGeometry().getCoordinates().map(e=>parseFloat(e.toFixed(2)));i.getGeometry().setCoordinates(e),u=i}let t=e.waypoints.find(e=>e.getCoordinates().length===0&&e.index>0&&e.index<d);if(t&&e.addStartEndPoint===1){let n=u.getGeometry().getCoordinates().map(e=>parseFloat(e.toFixed(2)));return t.setCoordinates(n),a&&t.setDisplayName(a),e.tsrWaypointsSource.removeFeature(u),e.addStartEndPoint=1,t}}if(e.addStartEndPoint===1&&(l=new Vw({index:c,feature:i,displayName:a,source:e.tsrWaypointsSource})),e.addStartEndPoint===0){e.waypoints[0].getCoordinates().toString()===e.waypoints[d].getCoordinates().toString()&&t(`removeWaypoint`,{index:d});let n=i.getGeometry().getCoordinates().map(e=>parseFloat(e.toFixed(2)));e.waypoints[0].setCoordinates(n),e.waypoints[0].setDisplayName(a),e.tsrWaypointsSource?.removeFeature(i)}if(e.addStartEndPoint===2){t(`removeWaypoint`,{index:d});let n=i.getGeometry().getCoordinates().map(e=>parseFloat(e.toFixed(2)));
22e.waypoints[d].setCoordinates(n),e.waypoints[d].setDisplayName(a),e.tsrWaypointsSource?.removeFeature(i)}if(e.addStartEndPoint=1,l){if(s&&(l.fromExtern=!0),o){let e=o.map(e=>parseFloat(e.toFixed(2)));l.setCoordinates(e)}e.waypoints.splice(e.waypoints.length-1,0,l)}for(let t=0;t<e.waypoints.length;t++)e.waypoints[t].setIndex(t);return l},removeWaypoint({state:e,commit:t},{index:n=!1}){let{waypoints:r,tsrWaypointsSource:i}=e;if(r.length===2){t(`setTsrDirections`,null),n===0&&JSON.stringify(r[0].getCoordinates())===JSON.stringify(r[r.length-1].getCoordinates())?(t(`setTsrDirections`,null),r.forEach(function(t,n){r[n].reset(),r[n]=new Vw({index:t.index,source:e.tsrWaypointsSource})})):(r[n].reset(),r[n]=new Vw({index:n,source:e.tsrWaypointsSource}));return}if(n===0||n===r.length-1){let t=[n];n===0&&JSON.stringify(r[0].getCoordinates())===JSON.stringify(r[r.length-1].getCoordinates())&&t.push(r.length-1),t.forEach(t=>{r[t].reset(),r[t]=new Vw({index:t,source:e.tsrWaypointsSource})})}else{r[n]?.addedToSource&&i?.removeFeature(r[n].getFeature());for(let e=n;e<r.length;e++)r[e].setIndex(r[e].getIndex()-1);r.splice(n,1)}for(let e=0;e<r.length;e++)r[e].setIndex(e)},initWaypoints({dispatch:e,state:t}){let n=t.waypoints.filter(e=>e.fromExtern===!0),r=n.length>0?n.length:t.waypoints.length;for(let t=r;t<2;t++)e(`addWaypoint`,{index:t})},async onTSRWaypointsDrawEnd({dispatch:e},t){let n=await e(`Modules/Routing/fetchTextByCoordinates`,{coordinates:await e(`Modules/Routing/transformCoordinatesLocalToWgs84Projection`,t.feature.getGeometry().getCoordinates(),{root:!0})},{root:!0});await e(`addWaypoint`,{feature:t.feature,displayName:n?n.getDisplayName():null})},createTSRWaypointsDrawInteraction({state:e,dispatch:t}){t(`removeMapInteractions`);let{tsrWaypointsModifyInteraction:n,tsrWaypointsSnapInteraction:r,tsrWaypointsDrawInteraction:i}=e;t(`Maps/addInteraction`,i,{root:!0}),t(`Maps/addInteraction`,n,{root:!0}),t(`Maps/addInteraction`,r,{root:!0})},removeTSRWaypointsDrawInteraction({state:e,dispatch:t}){let{tsrWaypointsDrawInteraction:n,tsrWaypointsModifyInteraction:r,tsrWaypointsSnapInteraction:i}=e;n.abortDrawing(),t(`Maps/removeInteraction`,n,{root:!0}),t(`Maps/removeInteraction`,r,{root:!0}),t(`Maps/removeInteraction`,i,{root:!0})},removeMapInteractions({dispatch:e}){e(`removeTSRWaypointsDrawInteraction`)},async zoomAfterUpload({state:e,rootState:t}){(await mapCollection.getMap(t.Maps.mode)).getView().fit(e.tsrWaypointsSource.getExtent())}},getters:{...H(eC),tsrCoordinates({waypoints:e}){return e.map(e=>e.getCoordinates()).filter(e=>e.length===2)},isInputDisabled({isLoadingDirections:e}){return e},getTSRSpeedProfiles(){return Yy.filter(e=>![`WHEELCHAIR`].includes(e))}}}},state:X,mutations:_y,actions:eb,getters:ZE},zD={},BD={hasMouseMapInteractions:!1,description:`common:modules.scaleSwitcher.description`,icon:`bi-arrows-angle-contract`,name:`common:modules.scaleSwitcher.name`,supportedDevices:[`Desktop`,`Mobile`,`Table`],supportedMapModes:[`2D`,`3D`],type:`scaleSwitcher`},VD={...U(BD)},HD={...H(BD)},UD={namespaced:!0,state:{...BD},mutations:VD,actions:zD,getters:HD},WD={coloredHighlighting3D:{},configPaths:[`portalConfig.mainMenu.searchBar`,`portalConfig.secondaryMenu.searchBar`],currentSide:`mainMenu`,minCharacters:3,placeholder:`common:modules.searchBar.placeholder.address`,globalPlaceholder:`common:modules.searchBar.placeholder.address`,searchInterfaces:[],suggestionListLength:5,timeout:5e3,type:`searchBar`,zoomLevel:7,currentAvailableCategories:``,currentActionEvent:``,currentSearchInputValue:``,currentComponentName:``,searchInput:``,searchInterfaceInstances:[],searchSuggestions:[],searchResults:[],selectedSearchResults:[],showAllResults:!1,showAllResultsSearchInterfaceInstance:`elasticSearch_0`,showAllResultsSearchCategory:`Thema`,showAllResultsSearchInterfaceInstances:[`elasticSearch`,`topicTree`],showSearchResultsInTree:!1,searchResultsActive:!0,addLayerButtonSearchActive:!0,iconsByActions:{addLayerToTopicTree:`bi-plus-circle`,activateLayerInTopicTree:`bi-eye`,showInTree:`bi-folder2-open`,showLayerInfo:`bi-info-circle`,highlightFeature:`bi-lightbulb`,openGetFeatureInfo:`bi-info-circle`,setMarker:`bi-geo-alt-fill`,zoomToResult:`bi-zoom-in`,startRouting:`bi-signpost-2`},lastPickedFeatureId:null},GD={...H(WD)},KD={...U(WD),addMultipleSearchInterfaceIds(e){let t=e.searchInterfaces.map(e=>
22e.type),n=[...new Set(t.filter((e,n)=>t.indexOf(e)!==n))],r=0;n.forEach(t=>{e.searchInterfaces.forEach(e=>{e.type===t&&e.searchInterfaceId===void 0&&(e.searchInterfaceId=e.type+`_`+r++)})})},addSearchInterfaceInstances(e,t){e.searchInterfaceInstances.push(t)},addSearchResults(e,{searchResults:t}){e.searchResults=e.searchResults.concat(t)},addSuggestionItem(e,t){e.searchSuggestions.push(t)}},qD={activateActions({commit:e,dispatch:t},{searchResult:n,actionType:r}){let i=n.events[r]||{};Object.keys(i).forEach(e=>{t(e,i[e],{root:e.includes(`/`)})}),r===`onClick`&&(n.id?.includes(`folder-`)?t(`showInTree`,{layerId:n.id}):e(`setSearchInput`,i18next.t(n.name)))},activateAction({dispatch:e},{actionName:t,actionArgs:n}){e(t,n)}};function JD({category:e,events:t,id:n,index:r,name:i,searchInterfaceId:a,displayedInfo:o,icon:s,imagePath:c,toolTip:l}={}){this.category=e,this.id=n,this.index=r,this.name=i,this.searchInterfaceId=a,this.events=t,this.displayedInfo=o||``,this.icon=s||``,this.imagePath=c||``,this.toolTip=l||``}function Z(e,t,n=[],r=`default`){this.paging=e,this.searchInterfaceId=t,this.resultEvents=n,this.hitTemplate=r,this.currentController=null,this.searchResults=[],this.searchState=`instantiated`,this.timeout=this.timeout??5e3,this.totalHits=0}Z.prototype.createPossibleActions=function(){throw Error(`This function must be overridden by the sub search interface!`)},Z.prototype.search=function(){throw Error(`This function must be overridden by the sub search interface!`)},Z.prototype.abortRequest=function(){this.currentController instanceof AbortController&&(this.searchState=`aborted`,this.currentController.abort(),this.currentController=null)},Z.prototype.clearSearchResults=function(){this.searchResults=[]},Z.prototype.normalizeResultEvents=function(e,t,n){let r=this.resultEventsToObject(e),i=this.createPossibleActions(t,n);return Object.keys(r).forEach(e=>{Object.keys(r[e]).forEach(t=>{i[t]?r[e][t]=i[t]:delete r[e][t]})}),r},Z.prototype.pushHitsToSearchResults=function(e=[]){this.totalHits=e.length,e.forEach((e,t)=>{let n=Object.assign(e,{index:t,searchInterfaceId:this.searchInterfaceId});this.pushHitToSearchResults(n)})},Z.prototype.pushHitToSearchResults=function(e={}){this.searchResults.push(new JD(e))},Z.prototype.requestSearch=async function(e,t,n,r=`application/json;charset=UTF-8`){let i={},a={};return this.searchState=`running`,this.abortRequest(),this.currentController=new AbortController,t===`GET`?i=await this.sendGetRequest(e,r):t===`POST`&&(i=await this.sendPostRequest(e,n,r)),i.status===200?(this.searchState=`finished`,a=i.data):(this.searchState=`failed`,a.status=`error`,a.message=`error occured in xhr Request!`+i.statusText),a},Z.prototype.sendGetRequest=function(e,t=`application/json;charset=UTF-8`){return B.get(e,{headers:{"Content-Type":t},signal:this.currentController.signal,timeout:this.timeout})},Z.prototype.sendPostRequest=function(e,t,n=`application/json;charset=UTF-8`){return B.post(e,t,{headers:{"Content-Type":n},signal:this.currentController.signal,timeout:this.timeout})},Z.prototype.resultEventsToObject=function(e){let t={};return Object.entries(e).forEach(([e,n])=>{t[e]={},n.forEach(n=>{t[e][n]={}})}),t},Z.prototype.checkConfig=async function(e,t,n){if(e){let r=`' . Wrong configuration of searchinterface `+n+` in config.json. Supported actions:`+t.join(`,`);e.onClick?.forEach(e=>{t.includes(e)||console.warn(`unknown resultEvents.onClick-action '`,e,r)}),e.onHover?.forEach(e=>{t.includes(e)||console.warn(`unknown resultEvents.onHover-action '`,e,r)}),e.buttons?.forEach(e=>{t.includes(e)||console.warn(`unknown resultEvents.button-action '`,e,r)})}};function YD({geoSearchServiceId:e,epsg:t,extent:n,hitTemplate:r,minScore:i,resultEvents:a,searchInterfaceId:o,resultCount:s}={}){this.checkConfig(a,[`setMarker`,`zoomToResult`,`startRouting`,`highlight3DTileByCoordinates`],o),Z.call(this,`request`,o||`bkg`,a||{onClick:[`setMarker`,`zoomToResult`],onHover:[`setMarker`],buttons:[`startRouting`]},r),this.geoSearchServiceId=e,this.epsg=t||`EPSG:25832`,this.extent=n||[454591,5809e3,7e5,6075769],this.minScore=i||.6,this.resultCount=s||20}YD.prototype=Object.create(Z.prototype),YD.prototype.search=async function(e){let t=await this.requestSearch(this.createSearchUrl(e),`GET`);return this.pushHitsToSearchResults(this.normalizeResults(t.features)),this.searchResults},YD.prototype.createSearchUrl=function(e){return`${$?.getters?.restServiceById(this.geoSearchServiceId)?.url}?bbox=${this.extent}&outputformat=json&srsName=${this.epsg}&count=${this.resultCount}&query=${encodeURIComponent(e)}`},YD.prototype.normalizeResults=function(e){let t=[];
22return e.forEach(e=>{e.properties.score>this.minScore&&t.push(this.normalizeResult(e))}),t},YD.prototype.normalizeResult=function(e){return{events:this.normalizeResultEvents(this.resultEvents,e),category:e.properties.typ,id:zr(`BkgGeoSearch`),icon:`bi-signpost-2`,name:e.properties.text,toolTip:e.properties.text}},YD.prototype.createPossibleActions=function(e){let t=e.geometry.coordinates;$.getters[`Maps/projectionCode`]!==this.epsg&&(t=j.transformToMapProjection(mapCollection.getMap(`2D`),this.epsg,[parseFloat(t[0]),parseFloat(t[1])]));let n=O($.getters[`Maps/projection`].getCode(),`EPSG:4326`,t);return{setMarker:{coordinates:t},zoomToResult:{coordinates:t},startRouting:{coordinates:t,name:e.properties?.text},highlight3DTileByCoordinates:{coordinates:n}}};var XD={"2.0.2":{csw:`http://www.opengis.net/cat/csw/2.0.2`,ogc:`http://www.opengis.net/ogc`,cswVersion:`2.0.2`,constraintVersion:`1.1.0`,filterPrefix:`ogc`,anyTextElement:`PropertyName`,anyTextValue:`AnyText`,literalElement:`Literal`},"3.0":{csw:`http://www.opengis.net/cat/csw/3.0`,fes:`http://www.opengis.net/fes/2.0`,cswVersion:`3.0.0`,constraintVersion:`2.0.0`,filterPrefix:`fes`,anyTextElement:`ValueReference`,anyTextValue:`anyText`,literalElement:`Literal`}};function ZD(e,{version:t=`2.0.2`,maxRecords:n=10,startPosition:r=1,elementSetName:i=`brief`,typeName:a=`gmd:MD_Metadata`,outputSchema:o=`http://www.isotc211.org/2005/gmd`,wildCard:s=`*`,serviceTypeFilter:c=null}={}){let l=XD[t]||XD[`2.0.2`],u=l.filterPrefix,d=`${s}${Zc(e)}${s}`,f=Array.isArray(c)&&c.length>0,p=`<?xml version="1.0" encoding="UTF-8"?>`;if(p+=`<csw:GetRecords xmlns:csw="${l.csw}"`,u===`ogc`?p+=` xmlns:ogc="${l.ogc}"`:p+=` xmlns:fes="${l.fes}"`,p+=` xmlns:gmd="http://www.isotc211.org/2005/gmd"`,p+=` service="CSW"`,p+=` version="${l.cswVersion}"`,p+=` resultType="results"`,p+=` outputSchema="${o}"`,p+=` maxRecords="${n}"`,p+=` startPosition="${r}">`,p+=`<csw:Query typeNames="${a}">`,p+=`<csw:ElementSetName>${i}</csw:ElementSetName>`,p+=`<csw:Constraint version="${l.constraintVersion}">`,p+=`<${u}:Filter>`,f&&(p+=`<${u}:And>`),p+=`<${u}:PropertyIsLike wildCard="${s}" singleChar="_" escapeChar="\\">`,p+=`<${u}:${l.anyTextElement}>${l.anyTextValue}</${u}:${l.anyTextElement}>`,p+=`<${u}:${l.literalElement}>${d}</${u}:${l.literalElement}>`,p+=`</${u}:PropertyIsLike>`,f){if(c.length===1)p+=`<${u}:PropertyIsEqualTo>`,p+=`<${u}:PropertyName>ServiceType</${u}:PropertyName>`,p+=`<${u}:Literal>${Zc(c[0])}</${u}:Literal>`,p+=`</${u}:PropertyIsEqualTo>`;else{p+=`<${u}:Or>`;for(let e of c)p+=`<${u}:PropertyIsEqualTo>`,p+=`<${u}:PropertyName>ServiceType</${u}:PropertyName>`,p+=`<${u}:Literal>${Zc(e)}</${u}:Literal>`,p+=`</${u}:PropertyIsEqualTo>`;p+=`</${u}:Or>`}p+=`</${u}:And>`}return p+=`</${u}:Filter>`,p+=`</csw:Constraint>`,p+=`</csw:Query>`,p+=`</csw:GetRecords>`,p}function QD(e){let t=new DOMParser().parseFromString(e,`application/xml`),n=t.querySelector(`parsererror`);if(n)return console.warn(`getCswRecords.parseGetRecordsResponse: XML parse error.`,n.textContent),{numberOfRecordsMatched:0,numberOfRecordsReturned:0,nextRecord:0,records:[]};let r=t.getElementsByTagNameNS(`*`,`SearchResults`)[0];if(!r)return console.warn(`getCswRecords.parseGetRecordsResponse: No SearchResults element found in response.`),{numberOfRecordsMatched:0,numberOfRecordsReturned:0,nextRecord:0,records:[]};let i=parseInt(r.getAttribute(`numberOfRecordsMatched`)||`0`,10),a=parseInt(r.getAttribute(`numberOfRecordsReturned`)||`0`,10),o=parseInt(r.getAttribute(`nextRecord`)||`0`,10),s=t.getElementsByTagNameNS(`http://www.isotc211.org/2005/gmd`,`MD_Metadata`),c=[];for(let e=0;e<s.length;e++)c.push(eO(s[e]));return{numberOfRecordsMatched:i,numberOfRecordsReturned:a,nextRecord:o,records:c}}function $D(e,t,n,r){let i=e.getElementsByTagNameNS(t,`distributionInfo`)[0];if(!i)return null;let a=i.getElementsByTagNameNS(t,`CI_OnlineResource`),o=[];for(let e=0;e<a.length;e++){let i=a[e],s=i.getElementsByTagNameNS(t,`protocol`)[0],c=s?.getElementsByTagNameNS(n,`CharacterString`)[0],l=s?.getElementsByTagNameNS(r,`Anchor`)[0],u=c?.textContent?.trim()||((l?.getAttribute(`xlink:href`)||``)+` `+(l?.textContent?.trim()||``)).trim()||``,d=(i.getElementsByTagNameNS(t,`linkage`)[0]?.getElementsByTagNameNS(t,`URL`)[0])?.textContent?.trim()||``;o.push({protocol:u,url:d})}return o}function eO(e){let t=`http://www.isotc211.org/2005/gmd`,n=`http://www.isotc211.org/2005/gco`,r=e.getElementsByTagNameNS(t,`fileIdentifier`)[0]?.getElementsByTagNameNS(n,`CharacterString`)[0]?.textContent||``,i=e.getElementsByTagNameNS(t,`identificationInfo`)[0],a=i?.getElementsByTagNameNS(t,`MD_DataIdentification`)[0]||i?.getElementsByTagNameNS(`http://www.isotc211.org/2005/srv`,`SV_ServiceIdentification`)[0];return{fileIdentifier:r,title:(a?.getElementsByTagNameNS(t,`citation`)[0]?.getElementsByTagNameNS(t,`CI_Citation`)[0])?.getElementsByTagNameNS(t,`title`)[0]?.getElementsByTagNameNS(n,`CharacterString`)[0]?.textContent||``,abstract:a?.getElementsByTagNameNS(t,`abstract`)[0]?.getElementsByTagNameNS(n,`CharacterString`)[0]?.textContent||``,boun
22dingBox:tO(a,t,n),distributionLinks:$D(e,t,n,`http://www.isotc211.org/2005/gmx`)}}function tO(e,t,n){if(!e)return null;let r=e.getElementsByTagNameNS(t,`EX_GeographicBoundingBox`)[0]||e.getElementsByTagNameNS(`http://www.isotc211.org/2005/srv`,`extent`)[0]?.getElementsByTagNameNS(t,`EX_GeographicBoundingBox`)[0];if(!r)return null;function i(e){let i=r.getElementsByTagNameNS(t,e)[0];return parseFloat(i?.getElementsByTagNameNS(n,`Decimal`)[0]?.textContent||`NaN`)}let a=i(`westBoundLongitude`),o=i(`eastBoundLongitude`),s=i(`southBoundLatitude`),c=i(`northBoundLatitude`);return[a,o,s,c].some(Number.isNaN)?null:{west:a,east:o,south:s,north:c}}var nO={buildGetRecordsXml:ZD,parseGetRecordsResponse:QD};function rO(e,t){let n=e||``,r=t||``,i={OAF:{protocol:/(OGC:API[:-]?FEATURES|OGC:OAF|SERVICE\s*TYPE\/OGC\/(?:OAF|API-FEATURES)|WWW:LINK-1\.0-HTTP--OGC-(?:OAF|API-FEATURES)|OGC\s+API\s*-?\s*FEATURES)/i,url:/(?:[?&]SERVICE=OAF\b|\/OGC\/FEATURES\b|\/COLLECTIONS(?:\/|$)|\/ITEMS(?:\/|$)|\/OAF(?:\/|$)|[_-]OAF[_-]?)/i},WMS:{protocol:/(OGC:WMS|WWW:LINK-1\.0-HTTP--OGC-WMS|OGC\s+WEB\s+MAP\s+SERVICE|SERVICE\s*TYPE\/OGC\/WMS|http:\/\/www\.opengis\.net\/def\/serviceType\/ogc\/wms)/i,url:/(?:[?&]SERVICE=WMS\b|\/WMS(?:\/|$)|[_-]WMS|WMS[_-])/i},WFS:{protocol:/(OGC:WFS|WWW:LINK-1\.0-HTTP--OGC-WFS|OGC\s+WEB\s+FEATURE\s+SERVICE|SERVICE\s*TYPE\/OGC\/WFS|http:\/\/www\.opengis\.net\/def\/serviceType\/ogc\/wfs)/i,url:/(?:[?&]SERVICE=WFS\b|\/WFS(?:\/|$)|[_-]WFS|WFS[_-])/i},WMTS:{protocol:/(OGC:WMTS|WWW:LINK-1\.0-HTTP--OGC-WMTS|OGC\s+WEB\s+MAP\s+TILE\s+SERVICE|SERVICE\s*TYPE\/OGC\/WMTS|SERVICETYPE\/OGC\/WMTS|http:\/\/www\.opengis\.net\/def\/serviceType\/ogc\/wmts)/i,url:/(?:[?&]SERVICE=WMTS(?:&|$)|\/WMTS(?:\/|$|\?|_)|[-_]WMTS(?:[-_]|$)|\/1\.0\.0\/WMTSCAPABILITIES\.XML(?:\?|$))/i}},a=null,o=null;for(let[e,t]of Object.entries(i))!a&&t.protocol.test(n)&&(a=e),!o&&t.url.test(r)&&(o=e);return a&&o?a===o?a:o===`WMTS`||o===`OAF`?o:a:a||o}function iO({definitions:e,hitTemplate:t,resultEvents:n,searchInterfaceId:r}={}){this.checkConfig(n,[`showLayerInfo`,`zoomToResult`,`addLayerFromCswRecord`],r),Z.call(this,`request`,r||`csw`,n||{onClick:[`addLayerFromCswRecord`,`zoomToResult`],buttons:[`showLayerInfo`]},t),this.definitions=e||[]}iO.prototype=Object.create(Z.prototype),iO.prototype.search=async function(e){this.searchState=`running`;for(let t of this.definitions)try{let{records:n,numberOfRecordsMatched:r}=await this.fetchCswResults(t,e);this.totalHits=(this.totalHits||0)+r,this.pushHitsToSearchResults(this.normalizeResults(n,t,e))}catch(e){e.name!==`AbortError`&&e.code!==`ERR_CANCELED`&&console.warn(`SearchInterfaceCSW: search failed for ${t.url}.`,e)}return this.searchState=`finished`,this.searchResults},iO.prototype.fetchCswResults=async function(e,t){let n=this.buildGetRecordsXml(e,t,1);try{let t=await this.requestSearch(e.url,`POST`,n,`application/xml; charset=UTF-8`);return nO.parseGetRecordsResponse(t)}catch(n){if(n.name===`AbortError`||n.code===`ERR_CANCELED`||!e.serviceTypeFilter?.length)throw n;console.warn(`SearchInterfaceCSW: request with serviceTypeFilter failed for ${e.url}. Retrying without filter. Status: ${n?.response?.status??n?.code??`unknown`}.`);let r=this.buildGetRecordsXml({...e,serviceTypeFilter:null},t,1),i=await this.requestSearch(e.url,`POST`,r,`application/xml; charset=UTF-8`);return nO.parseGetRecordsResponse(i)}},iO.prototype.buildGetRecordsXml=function(e,t,n=1){return nO.buildGetRecordsXml(t,{version:e.version||`2.0.2`,maxRecords:e.maxRecords||10,startPosition:n,typeName:e.typeName||`gmd:MD_Metadata`,elementSetName:e.elementSetName||`brief`,serviceTypeFilter:e.serviceTypeFilter||null})},iO.prototype.normalizeResults=function(e,t,n=``){let r=t.filterOnMissingDistribution===!0;return e.filter(e=>e.title).filter(e=>{let{distributionLinks:t}=e;return t==null?!r:t.some(e=>rO(e.protocol,e.url)!==null)}).map(e=>({normalizedResult:this.normalizeResult(e,t),score:this.getRelevanceScore(e,n)})).sort((e,t)=>{if(t.score!==e.score)return t.score-e.score;let n=(e.normalizedResult.name||``).localeCompare(t.normalizedResult.name||``,void 0,{sensitivity:`base`});return n===0?(e.normalizedResult.id||``).localeCompare(t.normalizedResult.id||``,void 0,{sensitivity:`base`}):n}).map(({normalizedResult:e})=>e)},iO.prototype.getRelevanceScore=function(e,t=``){let n=t.trim().toLocaleLowerCase(),r=(e.title||``).toLocaleLowerCase(),i=(e.abstract||``).toLocaleLowerCase();return!n.length||!r.length?0:r===n?100:r.startsWith(n)?60:r.includes(n)?30:i.includes(n)?10:0},iO.prototype.normalizeResult=function(e,t){return{events:this.normalizeResultEvents(this.resultEvents,e,t),category:this.searchInterfaceId,id:zr(`CswSearch`),icon:`bi-list-ul`,name:e.title,toolTip:e.abstract?`${e.title} â ${e.abstract}`:e.title}},iO.prototype.createPossibleActions=function(e,t){let n=t?.showDocUrl||t?.show_doc_url,r=e.distributionLinks?.map(e=>rO(e.protocol,e.url)).find(e=>e!==null)??null,i={showLayerInfo:{layerId:e.fileIdentifier,source:{id:e.fileIdentifier,metaID:e.fileIdentifier,name:e.title,typ:r,isExternal:!0,...n&&{showDocUrl:n},datasets:[{md_id:e.fileIdentifier,csw_url:t?.url||``,md_name:e.title,...n&&{show_doc_url:n}}]}},addLayerFromCswRecord:{fileIdentifier:e.fileIdentifier,recordTitle:e.title,cswUrl:t?.url||``,filterNonQueryableLayers:t?.filterNonQueryableLayers===!0,...n&&{showDocUrl:n}}};if(e.boundingBox){let{west:t,south:n,east:r,north:a}=e.boundingBox,o=$.getters[`Maps/projection`]?.getCode();function s(e,t){return o&&o!==`EPSG:4326`?j.transformToMapProjection(mapCollection.getMap(`2D`),`EPSG:4326`,[e,t]):[e,t]}let c=s(t,n),l=s(r,a);
22i.zoomToResult={coordinates:[c[0],c[1],l[0],l[1]]}}return i};function aO({hitMap:e,serviceId:t,epsg:n,hitIcon:r,hitTemplate:i,hitType:a,payload:o,responseEntryPath:s,resultEvents:c,searchInterfaceId:l,searchStringAttribute:u,requestType:d}={}){this.checkConfig(c,[`addLayerToTopicTree`,`setMarker`,`showInTree`,`showLayerInfo`,`startRouting`,`zoomToResult`,`highlight3DTileByCoordinates`],l),Z.call(this,`request`,l||`elasticSearch`,c||{onClick:[`addLayerToTopicTree`],buttons:[`showInTree`,`showLayerInfo`]},i),this.hitMap=e,this.serviceId=t,this.epsg=n||`EPSG:25832`,this.hitIcon=r||`bi-list-ul`,this.hitType=a||`common:modules.searchBar.type.subject`,this.payload=o||{},this.responseEntryPath=s||``,this.searchStringAttribute=u||`searchString`,this.requestType=d||`POST`}aO.prototype=Object.create(Z.prototype),aO.prototype.search=async function(e){let t=this.searchStringAttribute,n=this.appendSearchStringToPayload(this.payload,t,e),r=this.addIgnoreIdsToPayload(n,$.getters.treeConfig),i={serviceId:this.serviceId,requestType:this.requestType,payload:r,responseEntryPath:this.responseEntryPath},a=await this.initializeSearch(i),o=this.normalizeResults(a.hits);return this.pushHitsToSearchResults(o),this.searchResults},aO.prototype.appendSearchStringToPayload=function(e,t,n){return Object.keys(e).forEach(r=>{typeof e[r]==`object`?e[r]=this.appendSearchStringToPayload(e[r],t,n):r===t&&(e[t]=n)}),e},aO.prototype.addIgnoreIdsToPayload=function(e,t){return t?.layerIDsToIgnore?.length>0&&(e.params.id=t.layerIDsToIgnore),t?.metaIDsToIgnore?.length>0&&(e.params[`datasets.md_id`]=t.metaIDsToIgnore),e},aO.prototype.initializeSearch=async function(e){let t=$?.getters?.restServiceById(this.serviceId),n=t?t.url:e.url,r={status:`success`,message:``,hits:[]};return n?r=await this.sendRequest(n,e,r):(r.status=`error`,r.message=`Cannot retrieve url by rest-service with id: ${this.serviceId} ! Please check the configuration for rest-services!`,r.hits=[]),r},aO.prototype.sendRequest=async function(e,t,n){let r=t.requestType||`POST`,i=t.payload||void 0,a=r===`GET`?`${e}?source_content_type=application/json&source=${JSON.stringify(i)}`:e,o=n;return r===`GET`?o=await this.requestSearch(a,`GET`):r===`POST`&&(o=await this.requestSearch(e,`POST`,i)),o.hits},aO.prototype.normalizeResults=function(e){let t=[];return e.forEach(e=>{let n=this.getResultByPath(e,this.hitMap?.id);t.push({events:this.normalizeResultEvents(this.resultEvents,e),category:this.hitType.startsWith(`common:`)?i18next.t(this.hitType):i18next.t(this.getTranslationByType(this.getResultByPath(e,this.hitType))),icon:this.hitIcon,id:typeof n==`number`?String(n):n,name:this.getResultByPath(e,this.hitMap?.name),toolTip:this.getResultByPath(e,this.hitMap?.toolTip)})}),t},aO.prototype.getTranslationByType=function(e){return i18next.t({District:`common:modules.searchBar.type.district`,Address:`common:modules.searchBar.type.address`,parcel:`common:modules.searchBar.type.parcel`,Street:`common:modules.searchBar.type.street`,County:`common:modules.searchBar.type.county`}[e])},aO.prototype.createPossibleActions=function(e){let t=this.getResultByPath(e,this.hitMap?.coordinate),n=this.getResultByPath(e,this.hitMap?.layerId),r;return t&&(r=j.transformToMapProjection(mapCollection.getMap(`2D`),this.epsg,[parseFloat(t[0]),parseFloat(t[1])])),typeof n==`number`&&(n=String(n)),{addLayerToTopicTree:{layerId:n,source:this.getResultByPath(e,this.hitMap?.source)},setMarker:{coordinates:r},zoomToResult:{coordinates:r},startRouting:{coordinates:r,name:this.getResultByPath(e,this.hitMap?.name)}
22,highlight3DTileByCoordinates:{coordinates:t},showInTree:{layerId:n,source:this.getResultByPath(e,this.hitMap?.source)},showLayerInfo:{layerId:n,source:this.getResultByPath(e,this.hitMap?.source)}}},aO.prototype.getResultByPath=function(e,t){if(t!==void 0){let n=e;if(Array.isArray(t))n=this.getResultByPathArray(e,t);else{let e=t?.split(`.`)||[];for(let t of e){if(typeof n!=`object`||!n)return``;n=n[t]}}return n}return``},aO.prototype.getResultByPathArray=function(e,t){let n;return t.forEach(t=>{let r=t?.split(`.`)||[],i=e;r.forEach(e=>{i=Array.isArray(i[e])?i[e][0]:i[e]}),n=n===void 0?i:n+` - `+i}),n};function oO({serviceId:e,hitTemplate:t,resultEvents:n,searchAddress:r,searchDistricts:i,searchInterfaceId:a,searchHouseNumbers:o,searchParcels:s,searchStreetKey:c,searchStreets:l,showGeographicIdentifier:u}={}){this.checkConfig(n,[`setMarker`,`zoomToResult`,`startRouting`,`highlight3DTileByCoordinates`],a),Z.call(this,`client`,a||`gazetteer`,n||{onClick:[`setMarker`,`zoomToResult`],onHover:[`setMarker`],buttons:[`startRouting`]},t),this.serviceId=e,this.showGeographicIdentifier=u||!1,this.searchAddress=r||!1,this.searchDistricts=i||!1,this.searchHouseNumbers=o||!1,this.searchParcels=s||!1,this.searchStreetKey=c||!1,this.searchStreets=l||!1,yt($?.getters?.restServiceById(this.serviceId)?.url),Ct(this.showGeographicIdentifier)}oO.prototype=Object.create(Z.prototype),oO.prototype.search=async function(e){let t=await this.startSearch(e),n=this.normalizeResults(t);return this.pushHitsToSearchResults(n),this.searchResults},oO.prototype.startSearch=async function(e){let t=[];try{this.searchState=`running`,t=vn(e,{map:mapCollection.getMap(`2D`),searchAddress:this.searchAddress,searchStreets:this.searchStreets,searchDistricts:this.searchDistricts,searchParcels:this.searchParcels,searchStreetKey:this.searchStreetKey,searchHouseNumbers:this.searchHouseNumbers},!0),await t,this.searchState=`finished`}catch(e){this.searchState=`aborted`,String(e)!==`AbortError: The user aborted a request.`&&e.name!==`AbortError`&&(this.searchState=`failed`,console.error(e))}return t},oO.prototype.normalizeResults=function(e){let t=[];return e.forEach(e=>{let n=this.getTranslationByType(e.type),r=e.properties?.geographicIdentifier?._||e.name,i=[e.name,e.properties?.geographicIdentifier?._].filter(
22Boolean).join(`_`).replace(/ /g,``);t.some(e=>e.id===i)||t.push({events:this.normalizeResultEvents(this.resultEvents,e),category:n,id:i,icon:`bi-signpost-split`,name:r})}),t},oO.prototype.getTranslationByType=function(e){return i18next.t({addressAffixed:`common:modules.searchBar.type.address`,addressUnaffixed:`common:modules.searchBar.type.address`,district:`common:modules.searchBar.type.district`,houseNumbersForStreet:`common:modules.searchBar.type.address`,parcel:`common:modules.searchBar.type.parcel`,street:`common:modules.searchBar.type.street`}[e])},oO.prototype.createPossibleActions=function(e){let t=[parseFloat(e.geometry.coordinates[0]),parseFloat(e.geometry.coordinates[1])],n=O($.getters[`Maps/projection`].getCode(),`EPSG:4326`,t);return{setMarker:{coordinates:t},zoomToResult:{coordinates:t},startRouting:{coordinates:t,name:e.name},highlight3DTileByCoordinates:{coordinates:n}}};function sO({serviceId:e,bbox:t,hitTemplate:n,limit:r,lang:i,lat:a,lon:o,osmTag:s,resultEvents:c,searchInterfaceId:l}={}){this.checkConfig(c,[`setMarker`,`zoomToResult`,`startRouting`,`highlight3DTileByCoordinates`],l),Z.call(this,`client`,l||`komootPhoton`,c||{onClick:[`setMarker`,`zoomToResult`],onHover:[`setMarker`],buttons:[`startRouting`]},n),this.serviceId=e,this.bbox=t,this.lang=i||`de`,this.lat=a,this.limit=r,this.lon=o,this.osmTag=s}sO.prototype=Object.create(Z.prototype),sO.prototype.search=async function(e){let t=await this.requestSearch(this.createSearchUrl(e),`GET`);return this.pushHitsToSearchResults(this.normalizeResults(t.features)),this.searchResults},sO.prototype.createSearchUrl=function(e){let t=$?.getters?.restServiceById(this.serviceId)?.url,n={bbox:this.bbox,lat:this.lat,limit:this.limit,lon:this.lon,osm_tag:this.osm_tag},r=`${t}lang=${this.lang}&q=${encodeURIComponent(e)}`;for(let[e,t]of Object.entries(n))t!==void 0&&(r=`${r}&${e}=${t}`);return r},sO.prototype.normalizeResults=function(e){let t=[];return e.forEach(e=>{t.push(this.normalizeResult(e))}),t},sO.prototype.normalizeResult=function(e){let t=this.createDisplayName(e);return{events:this.normalizeResultEvents(this.resultEvents,e),category:`Komoot`,id:zr(`KomootPhoton`),icon:`bi-signpost-2`,name:t,toolTip:this.createToolTipName(e,t)}},sO.prototype.createDisplayName=function(e){let t=e.properties,n={name:``,street:`, `,housenumber:` `,postcode:`, `,city:` `,district:` - `},r=``;for(let[e,i]of Object.entries(n))e===`street`&&t.name===void 0?r+=t[e]:t[e]===void 0?e===`city`&&t.county!==void 0&&(r=r+i+t.county):r=r+i+t[e];return r},sO.prototype.createToolTipName=function(e,t){let n=e.properties,r=t;return n.state!==void 0&&(r=r+`, `+n.state),n.country!==void 0&&(r=r+` `+n.country),n.suburb!==void 0&&(r=r+` (`+n.suburb+`)`),r},sO.prototype.createPossibleActions=function(e){let t=e.geometry.coordinates,n=j.transformToMapProjection(mapCollection.getMap(`2D`),`EPSG:4326`,[parseFloat(t[0]),parseFloat(t[1])]);return{setMarker:{coordinates:n},zoomToResult:{coordinates:n},startRouting:{coordinates:n,name:e.properties?.name},highlight3DTileByCoordinates:{coordinates:e.geometry.coordinates}}};function cO({serviceId:e,classes:t,epsg:n,hitTemplate:r,resultEvents:i,searchInterfaceId:a}={}){this.checkConfig(i,[`setMarker`,`zoomToResult`,`startRouting`],a),Z.call(this,`client`,a||`locationFinder`,i||{onClick:[`setMarker`,`zoomToResult`],onHover:[`setMarker`],buttons:[`startRouting`]},r),this.serviceId=e,this.classes=t||[],this.epsg=n||$.getters[`Maps/projectionCode`]}cO.prototype=Object.create(Z.prototype),cO.prototype.search=async function(e){let t=`${$?.getters?.restServiceById(this.serviceId)?.url}/Lookup?query=${e}&sref=${this.epsg}`,n=this.classes.length>0?`${t}&filter=type:${this.classes.map(e=>e.name).join(`,`)}`:t,r=await this.requestSearch(n,`GET`),i=`EPSG:`+r.sref;return r?.ok?j.getProjection(i)?Array.isArray(r.locs)&&this.pushHitsToSearchResults(this.normalizeResults(r.locs,i)):this.showError({statusText:i18next.t(`common:modules.searchBar.locationFinder.unknownProjection`)+` (`+i+`)`}):this.handleServerError(r),this.searchResults}
22,cO.prototype.handleServerError=function(e){let t=i18next.t(`common:modules.searchBar.locationFinder.serverError`);e.info&&(t=`${t}: ${e.info}`),this.showError({statusText:t})},cO.prototype.showError=function(e){let t=e.msg&&e.msg!==``?e.msg:i18next.t(`common:modules.searchBar.locationFinder.errorMsg`);e.statusText&&e.statusText!==``&&(t+=`: `+e.statusText),console.error(t)},cO.prototype.normalizeResults=function(e,t){let n=[];return e.forEach(e=>{let r=this.classes.find(t=>t.name===e.type)||{};n.push(this.normalizeResult(e,{classDefinition:r,epsgCode:t}))}),n},cO.prototype.normalizeResult=function(e,t){let n=t?.classDefinition?.displayName,r=e.type;if(n){let e=i18next.exists(n)?i18next.t(n):n;r=e.includes(`:`)?e.split(`:`)[1]:e}return{events:this.normalizeResultEvents(this.resultEvents,e,t),category:r,id:`locationFinder_`+e.id,icon:t?.classDefinition?.icon||`bi-signpost-2`,name:e.name}},cO.prototype.createPossibleActions=function(e,t){let n=this.processCoordinatesForActions(e,t);return{setMarker:{coordinates:n},zoomToResult:{coordinates:n},startRouting:{coordinates:n,name:e.name}}},cO.prototype.processCoordinatesForActions=function(e,t){let n=mapCollection.getMap(`2D`),r=t.epsgCode,i=j.transformFromMapProjection(n,r,[parseFloat(e.cx),parseFloat(e.cy)]);if(t.classDefinition?.zoom===`bbox`){let t=j.transformFromMapProjection(n,r,[parseFloat(e.xmin),parseFloat(e.ymin)]),a=j.transformFromMapProjection(n,r,[parseFloat(e.xmax),parseFloat(e.ymax)]);i=[t[0],t[1],a[0],t[1],a[0],a[1],t[0],a[1],t[0],t[1]]}return i};function lO({serviceId:e,classes:t,countryCodes:n,hitTemplate:r,limit:i,resultEvents:a,searchInterfaceId:o,states:s}={}){this.checkConfig(a,[`setMarker`,`zoomToResult`,`startRouting`,`highlight3DTileByCoordinates`],o),Z.call(this,`client`,o||`osmNominatim`,a||{onClick:[`setMarker`,`zoomToResult`],onHover:[`setMarker`],buttons:[`startRouting`]},r),this.serviceId=e,this.classes=t||`place,highway,building,shop,historic,leisure,city,county`,this.countryCodes=n||[`de`],this.limit=i||50,this.states=s||``,this.timeStamp=(0,G.default)()}lO.prototype=Object.create(Z.prototype),lO.prototype.search=async function(e){let t=(0,G.default)();if(t.diff(this.timeStamp)>1e3){this.timeStamp=t;let n=await this.requestSearch(this.createSearchUrl(e),`GET`);this.pushHitsToSearchResults(this.normalizeResults(n))}else await new Promise(t=>{setTimeout(async()=>{e===$.getters[`Modules/SearchBar/searchInput`]&&t(await this.search(e))},1e3)});return this.searchResults},lO.prototype.createSearchUrl=function(e){return`${$?.getters?.restServiceById(this.serviceId)?.url}countrycodes=${this.countryCodes}&format=json&polygon=0&addressdetails=1&extratags=1&limit=${this.limit}&q=${encodeURIComponent(e)}`},lO.prototype.normalizeResults=function(e){let t=this.classes.split(`,`),n=this.states===``?[]:this.states.split(`,`),r=[];return e.forEach(e=>{let i=e.address.state,a=e.address.city;t.includes(e.class)&&(n.length===0||n.includes(i||a))&&r.push(this.normalizeResult(e))}),r},lO.prototype.normalizeResult=function(e){let t=this.createDisplayName(e);return{events:this.normalizeResultEvents(this.resultEvents,e),category:`OpenStreetMap`,icon:`bi-signpost-2`,id:zr(`OSMNominatim`),name:t,toolTip:this.createToolTipName(e,t)}},lO.prototype.createDisplayName=function(e){let t=e.address,n=t.city||t.city_district||t.town||t.village||t.suburb||t.county||``;return(t.road||t.pedestrian)&&(n=`${n}, ${t.road||t.pedestrian}`,t.house_number&&(n=`${n} ${t.house_number}`)),n},lO.prototype.createToolTipName=function(e,t){let n=e.address,r=t;return n.postcode!==void 0&&(n.state||n.city)!==void 0&&(r=r+`, `+n.postcode+` `+(n.state||n.city),n.suburb!==void 0&&(r=r+` (`+n.suburb+`)`)),r},lO.prototype.createPossibleActions=function(e){let t=this.processCoordinatesForActions(e),n=O($.getters[`Maps/projection`].getCode(),`EPSG:4326`,t);return{setMarker:{coordinates:t},zoomToResult:{coordinates:t},startRouting:{coordinates:t,name:e.display_name},highlight3DTileByCoordinates:{coordinates:n}}},lO.prototype.processCoordinatesForActions=function(e){let t,n;if(e.lat&&e.lon)t=parseFloat(e.lat),n=parseFloat(e.lon);else{let r=e.boundingbox;t=(parseFloat(r[0])+parseFloat(r[1]))/2,n=(parseFloat(r[2])+parseFloat(r[3]))/2}return j.transformToMapProjection(mapCollection.getMap(`2D`),`EPSG:4326`,[n,t])};function uO({hitTemplate:e,resultEvents:t,searchInterfaceId:n,searchType:r,toolTip:i}={}){this.checkConfig(t,[`activateLayerInTopicTree`,`showInTree`,`showLayerInfo`],n),Z.call(this,`client`,n||`topicTree`,t||{onClick:[`activateLayerInTopicTree`],buttons:[`showInTree`,`showLayerInfo`]},e),this.searchType=r||``,this.toolTip=i}uO.prototype=Object.create(Z.prototype),uO.prototype.search=async function(e){this.searchState=`running`;let t=this.createRegExp(e.trim()),n=this.searchInLayers($.getters.allLayerConfigs,t),r=this.searchInFolders($.getters.layerConfig,t);return this.pushHitsToSearchResults(n.concat(r)),this.searchState=`f
22inished`,this.searchResults},uO.prototype.createRegExp=function(e){return new RegExp(e.replace(/[-/\\^$*+?.()|[\]{}]/g,`\\$&`),`i`)},uO.prototype.searchInLayers=function(e,t){let n=[];return e.forEach(e=>{if($.getters[`Maps/mode`]===`3D`||!Gr.getLayerTypes3d().includes(e?.typ?.toUpperCase())){let r=e.datasets,i=``,a=!1;this.searchType===`metadata`&&Array.isArray(r)&&r.length>0&&typeof r[0].md_name==`string`?i=i18next.t(e.datasets[0].md_name):typeof e.name==`string`&&(i=i18next.t(e.name)),Array.isArray(r)&&r.length>0&&typeof r[0].md_name==`string`&&(a=!0),this.toolTip===`path`&&(e.layerPath=this.getPath(e)),i.search(t)!==-1&&n.push(this.normalizeLayerResult(e,a))}}),n},uO.prototype.getPath=function(e){let t=[e.name];return t=this.getNamesOfParentFolder(e.parentId,t).reverse(),t.length>0?t.join(`/`):void 0},uO.prototype.getNamesOfParentFolder=function(e,t){if(e!==void 0){let n=$.getters.folderById(e);n&&(t.push(n.name),this.getNamesOfParentFolder(n.parentId,t))}return t},uO.prototype.normalizeLayerResult=function(e,t){let n=``;return this.toolTip===`path`?n=e.layerPath:t&&(n=e.datasets[0].md_name),{events:this.normalizeResultEvents(this.resultEvents,e),category:e.baselayer?i18next.t(`common:modules.searchBar.type.topicBaselayer`):i18next.t(`common:modules.searchBar.type.topic`),icon:`bi-stack`,id:e.id,name:e.name,toolTip:n}},uO.prototype.searchInFolders=function(e,t){let n=[],r=[];return Object.keys(e).forEach(t=>{this.searchInFolder(e[t],n)}),n.forEach(e=>{e.name.search(t)!==-1&&(this.toolTip===`path`&&(e.folderPath=this.getPath(e)),r.push(this.normalizeFolderResult(e)))}),r},uO.prototype.searchInFolder=function(e,t){e?.elements?.forEach(e=>{e?.type===`folder`&&(this.searchInFolder(e,t),t.push(e))})},uO.prototype.normalizeFolderResult=function(e){return{events:this.normalizeResultEvents({...this.resultEvents},e),category:i18next.t(`common:modules.searchBar.type.folder`),icon:`bi-folder`,id:e.id,name:e.name,toolTip:this.toolTip?e.folderPath:e.name}},uO.prototype.createPossibleActions=function(e){let t={};return e.type!==`folder`&&Object.assign(t,{activateLayerInTopicTree:{layerId:e.id},showInTree:{layerId:e.id},showLayerInfo:{layerId:e.id}}),t};function dO({definitions:e,hitTemplate:t,icon:n,geometryName:r,maxFeatures:i,namespaces:a,resultEvents:o,searchInterfaceId:s}={}){this.checkConfig(o,[`highlightFeature`,`setMarker`,`zoomToResult`],s),Z.call(this,`client`,s||`specialWfs`,o||{onClick:[`highlightFeature`,`setMarker`,`zoomToResult`],onHover:[`highlightFeature`,`setMarker`]},t),this.definitions=e,this.icon=n||`bi-house`,this.geometryName=r||`app:geom`,this.maxFeatures=i||20,this.namespaces=a||`xmlns:wfs='http://www.opengis.net/wfs' xmlns:ogc='http://www.opengis.net/ogc' xmlns:gml='http://www.opengis.net/gml'`}dO.prototype=Object.create(Z.prototype),dO.prototype.search=async function(e){this.searchState=`running`;for(let t of this.definitions){let n=this.getWFS110Xml(t,e),r={status:`success`,message:``,hits:[]};try{r=await this.sendRequest(t.url,t,n,r),r.hits=this.normalizeResults(r.hits),this.pushHitsToSearchResults(r.hits)}catch(e){String(e)!==`AbortError: The user aborted a request.`&&e.name!==`AbortError`&&e.code!==`ERR_CANCELED`&&console.warn(`Special WFS search failed for ${t.name} (${t.url}):`,e.message)}}return this.searchState=`finished`,this.searchResults},dO.prototype.normalizeResults=function(e){let t=[];return e.forEach(e=>{t.push({events:this.normalizeResultEvents(this.resultEvents,e),category:i18next.t(e.type),icon:e.icon,id:zr(`SpecialWFS`),name:e.identifier,toolTip:`${e.identifier}`})}),t},dO.prototype.getWFS110Xml=function(e,t){let n=e.typeName,r=e.propertyNames,i=e.geometryName?e.geometryName:this.geometryName,a=e.maxFeatures?e.maxFeatures:this.maxFeatures,o=e.namespaces?this.namespaces+` `+e.namespaces:this.namespaces,s,c;s=`<wfs:GetFeature service='WFS' `,s+=o+` traverseXlinkDepth='*' version='1.1.0'>`,s+=`<wfs:Query typeName='`+n+`'>`;for(c of r)s+=`<wfs:PropertyName>`+c+`</wfs:PropertyName>`;s+=`<wfs:PropertyName>`+i+`</wfs:PropertyName>`,s+=`<wfs:maxFeatures>`+a+`</wfs:maxFeatures>`,s+=`<ogc:Filter>`,r.length>1&&(s+=`<ogc:Or>`);for(c of r)s+=`<ogc:PropertyIsLike matchCase='false' wildCard='*' singleChar='#' escapeChar='!'><ogc:PropertyName>`+c+`</ogc:PropertyName><ogc:Literal>*`+t+`*</ogc:Literal></ogc:PropertyIsLike>`;return r.length>1&&(s+=`</ogc:Or>`),s+=`</ogc:Filter></wfs:Query></wfs:GetFeature>`,s},dO.prototype.sendRequest=async function(e,t,n,r){let i=r,a=await this.requestSearch(e,`POST`,n,`application/xml`);return i=this.fillHitList(a,i,t),i},dO.prototype.fillHitList=function(e,t,n){let r=n.name,i=n.typeName,a=n.propertyNames,o=n.geometryName?n.geometryName:this.geometryName,s=n.icon?n.icon:this.icon,c=[`MULTIPOLYGON`,`MULTISURFACE`],l=new DOMParser().parseFromString(e,`application/xml`),u=i.includes(`:`)?i.split(`:`)[1]:i,d=l.getElementsByTagNameNS(`*`,u),f=t;for(let t=0;t<d.length&&t<this.maxFeatures;t++){let n=d[t];a.forEach(i=>
22{let a=i.includes(`:`)?i.split(`:`)[1]:i,l=o.includes(`:`)?o.split(`:`)[1]:o,u=n.getElementsByTagNameNS(`*`,a),d=n.getElementsByTagNameNS(`*`,l);if(u.length>0&&d.length>0){let n=d[0],i=n.firstElementChild,a=i.localName.toUpperCase(),o=u[0].textContent,l,p,m,h;if(c.includes(a)){let e=i.firstElementChild.localName,t=n.getElementsByTagNameNS(`*`,e);m=this.getInteriorAndExteriorPolygonMembers(t),l=void 0,p=`MultiPolygon`}else if(n.getElementsByTagNameNS(`*`,`interior`).length>0){let e=n.firstElementChild.localName,t=n.getElementsByTagNameNS(`*`,e);m=this.getInteriorAndExteriorPolygonMembers(t),l=void 0,p=`Polygon`,h=!0}else{let n=mapCollection.getMap(`2D`),r=mapCollection.getMapView(`2D`).getProjection().getCode(),i=new Ne().readFeatures(e,{featureProjection:r})[t];if(!i)return;l=i.getGeometry(),m=void 0,p=l?l.getType():`undefined`,this.transformPointGeometryIfNeeded(l,p,n)}f.hits.push({type:r,identifier:o,geometryType:p,geometry:l,coordinates:m,icon:s,interior:h})}})}return f},dO.prototype.getInteriorAndExteriorPolygonMembers=function(e){let t=e.length,n=[];for(let r=0;r<t;r++){let t=[],i=[],a=[],o,s,c,l;if(o=e[r].getElementsByTagNameNS(`*`,`posList`),o.length>1){o=[],s=e[r].getElementsByTagNameNS(`*`,`exterior`),l=s[0].getElementsByTagNameNS(`*`,`posList`)[0].textContent.trim(),i.push(Object.values(l.replace(/\s\s+/g,` `).split(` `))),c=e[r].getElementsByTagNameNS(`*`,`interior`);for(let e in Object.keys(c))a.push(c[e].getElementsByTagNameNS(`*`,`posList`)[0].textContent.trim());a.forEach(e=>i.push(Object.values(e.replace(/\s\s+/g,` `).split(` `)))),n.push(i)}else{for(let e in Object.keys(o)){let n=o[e].textContent.trim();n!==``&&t.push(n)}t.forEach(e=>n.push(Object.values(e.replace(/\s\s+/g,` `).split(` `))))}}return n},dO.prototype.transformPointGeometryIfNeeded=function(e,t,n){if(e){let r=e.getCoordinates();if(t===`Point`&&r[0]<180&&r[0]>-180){let t=j.transformToMapProjection(n,`EPSG:4326`,[r[1],r[0]]);e.setCoordinates(t)}}},dO.prototype.createPossibleActions=function(e){let t=e.geometryType,n=[];if(Array.isArray(e?.coordinates))n=e.interior?e?.coordinates[0]:e?.coordinates;else if(Array.isArray(e?.geometry))e.geometry.forEach(e=>{Array.isArray(e)&&e.forEach(e=>{n.push(parseFloat(e))}),e&&n.push(parseFloat(e))});else if(e?.geometry?.flatCoordinates)if(t===`Point`){let t=e.geometry.getCoordinates();n=[t[0],t[1]]}else t===`Polygon`&&e?.geometry.getEnds().length===1?e?.geometry?.flatCoordinates.forEach(e=>{e&&n.push(parseFloat(e))}):Array.isArray(e?.geometry.getCoordinates())&&e.geometry.getCoordinates().forEac
22h((e,t)=>{if(Array.isArray(e)){let t=[];e.forEach(e=>{if(Array.isArray(e)){let r=[];e.forEach((e,n)=>{Array.isArray(e)?e.forEach((e,t)=>{e>0&&t!==2&&r.push(parseFloat(e))}):e>0&&n!==2&&t.push(parseFloat(e))}),r.length>0&&n.push(r)}}),t.length>0&&n.push(t)}else e>0&&t!==2&&n.push(parseFloat(e))});return{highlightFeature:{hit:{coordinate:n,geometryType:t}},setMarker:{coordinates:t.includes(`Multi`)||e.interior?n[0]:n,geometryType:t},zoomToResult:{coordinates:t.includes(`Multi`)||e.interior?n[0]:n}}};function fO({hitTemplate:e,resultEvents:t,searchInterfaceId:n}={}){this.checkConfig(t,[`openGetFeatureInfo`,`setMarker`,`zoomToResult`,`startRouting`],n),Z.call(this,`client`,n||`visibleVector`,t||{onClick:[`openGetFeatureInfo`,`setMarker`,`zoomToResult`],onHover:[`setMarker`]},e)}fO.prototype=Object.create(Z.prototype),fO.prototype.search=async function(e){this.searchState=`running`;let t=Ff.getVectorLayerTypes(),n=$.getters.visibleLayerConfigs.filter(e=>t.includes(e.typ?.toUpperCase())&&e.searchField&&e.searchField!==``),r=this.findMatchingFeatures(n,e);return this.pushHitsToSearchResults(r),this.searchState=`finished`,this.searchResults},fO.prototype.findMatchingFeatures=function(e,t){let n=[];return e.forEach(e=>{let r=W.getLayerById(e.id),i=r.getLayerSource()instanceof Re?r.getLayerSource().getSource():r.getLayerSource(),a=Array.isArray(e.searchField)?e.searchField:[e.searchField],o=r.attributes,s=e.typ?.toUpperCase();(s===`WFS`||s===`OAF`)&&typeof r.loadFeaturesManually==`function`&&r.loadFeaturesManually(o);let c=i.getFeatures();a.forEach(e=>{c.forEach(i=>{let a=String(i.get(e)).toUpperCase(),o=t.toUpperCase();a.indexOf(o)!==-1&&n.push(this.normalizeResult(i,r,e))})})}),n},fO.prototype.normalizeResult=function(e,t,n){return{events:this.normalizeResultEvents(this.resultEvents,e,t),category:t.attributes.name,displayedInfo:this.getAdditionalInfo(e,t),imagePath:this.getImageSource(e,t),id:e.ol_uid,name:e.get(n),toolTip:e.get(n)}},fO.prototype.getAdditionalInfo=function(e,t){return e.get(t.attributes.additionalInfoField)||``},fO.prototype.getImageSource=function(e,t){let n=``;if(e.getGeometry().getType()===`Point`||e.getGeometry().getType()===`MultiPoint`){let r=t.attributes.style(e);n=Array.isArray(r)?this.getImageSourceFromStyle(r[0]):this.getImageSourceFromStyle(r)}return n},fO.prototype.getImageSourceFromStyle=function(e){return e.getImage()instanceof xe?e.getImage().getSrc():``},fO.prototype.createPossibleActions=function(e,t){let n=this.getCoordinates(e);return{openGetFeatureInfo:{feature:e,layer:t},setMarker:{coordinates:n,feature:e,layer:t},zoomToResult:{coordinates:n},startRouting:{coordinates:n,name:n.toString()}}},fO.prototype.getCoordinates=function(e){let t=Sn(e.getGeometry().getExtent());return e.getGeometry().getType()===`MultiPolygon`&&(e.getGeometry().intersectsCoordinate(t)||(t=this.getRandomCoordinate(e.getGeometry().getCoordinates()))),t},fO.prototype.getRandomCoordinate=function(e){if(Array.isArray(e)&&e[e.length-1]){let t=Math.floor(Math.random()*e.length);return this.getRandomCoordinate(e[t])}return e};var pO={instantiateSearchInterfaces:({commit:e,state:t},n=[])=>{let r={bkg:YD,csw:iO,elasticSearch:aO,gazetteer:oO,komootPhoton:sO,locationFinder:cO,osmNominatim:lO,topicTree:uO,visibleVector:fO,specialWfs:dO};Object.assign(r,...n),e(`setSearchInterfaceInstances`,[]),e(`addMultipleSearchInterfaceIds`),t.searchInterfaces.forEach(t=>{let n=t.type;r[n]?e(`addSearchInterfaceInstances`,new r[n](t)):console.warn(`The searchInterface: "${n}" hasn't been implemented yet`)})},startSearch:({dispatch:e,state:t})=>{t.searchInput.length>=parseInt(t.minCharacters,10)&&e(`search`,{searchInput:t.searchInput})},search:({getters:e,commit:t,dispatch:n,state:r},{searchInput:i})=>{n(`cleanSearchResults`);let a=r.searchInterfaceInstances;e.showAllResults&&(a=r.searchInterfaceInstances.filter(t=>{let n=!1;return e.showAllResultsSearchInterfaceInstances.forEach(e=>{t.searchInterfaceId===e.id&&(n=!0)}),n})),a.forEach(e=>{e.clearSearchResults(),e.search(i).then(e=>{t(`addSearchResults`,{searchResults:e})}).catch(e=>{String(e)!==`AbortError: The user aborted a request.`&&e.name!==`AbortError`&&e.code!==`ERR_CANCELED`&&console.error(e)})})},cleanSearchResults:({commit:e})=>{e(`setSearchResults`,[])}},mO={checkIsCoordInsidePolygon:function(e,t){return!e||e.getGeometry().intersectsCoordinate(t)},getRandomCoordinate:function(e){if(Array.isArray(e)&&e[e.length-1]){let t=Math.floor(Math.random()*e.length);return this.getRandomCoordinate(e[t])}return e},getFirstPointCoordinates:function(e,t){let n=e.getGeometry().getGeometries().find(e=>e.getType()===`Point`);return n?n.getCoordinates():t},extentIsValid:function(e){if(e.length!==4)return!1;for(let t=0;t<e.length;t++)if(typeof e[t]!=`number`||!isFinite(e[t]))return!1;return!0}};function hO(e,t=`POLYGON`){let n=new ge,r=e?.geometryType?e.geometryType.toUpperCase():t,i=e?.coordinate?e.coordinate:e,a,o;
22if(r===`POLYGON`)a=r+`((`,i.forEach(function(e,t,n){Array.isArray(e)?(e?.forEach(function(e,t,n){t%2==0?a+=e+` `:t===n.length-1?a+=e+`)`:a+=e+`, `}),t===n.length-1?a+=`)`:a+=`,(`):t%2==0?a+=e+` `:t===n.length-1?a+=e+`))`:a+=e+`, `});else if(r===`LINESTRING`)a=r+`(`,i.forEach(function(e,t,n){Array.isArray(e)?(e?.forEach(function(e,t,n){t%2==0?a+=e+` `:t===n.length-1?a+=e+`)`:a+=e+`, `}),t===n.length-1?a+=`)`:a+=`,(`):t%2==0?a+=e+` `:t===n.length-1?a+=e+`)`:a+=e+`, `});else if(r===`MULTILINESTRING`)a=r+`((`,i.forEach(function(e,t){e.forEach(function(e,t,n){t%2==0?a+=e+` `:t===n.length-1?a+=e:a+=e+`, `}),t===i.length-1?a+=`))`:a+=`),(`});else if(r===`POINT`)a=r+`(`,i[1]===void 0?Array.isArray(i[0])?i[0].length===2?a+=i[0][0]+` `+i[0][1]:console.warn(`unexpected data in WKT - `+i[0]):a+=i[0]:a+=i[0]+` `+i[1],a+=`)`;else if(r===`MULTIPOLYGON`)a=r+`(((`,i.forEach(function(e,t){e?.forEach(function(e,t,n){Array.isArray(e)?(e.forEach(function(e,t,n){Array.isArray(e)&&console.warn(`coordinates nested too deeply`),t===n.length-1?a+=e+`)`:t%2==0?a+=e+` `:a+=e+`, `}),t===n.length-1?a+=`)`:a+=`,(`):Array.isArray(e)||(t===n.length-1?a+=e+`))`:t%2==0?a+=e+` `:a+=e+`, `)}),t===i.length-1?a+=`)`:a+=`,((`}),o=RegExp(`, \\)\\?\\(`,`g`),a=a.replace(o,`),(`);else return console.warn(`Unsupported geometry type ${r}`),null;return n.readFeature(a)}var gO={getWKTGeom:hO};function _O(e,t){let n=null;if(Cesium.SceneTransforms.worldToWindowCoordinates)n=Cesium.SceneTransforms.worldToWindowCoordinates(e,t);else if(Cesium.SceneTransforms.wgs84ToWindowCoordinates)n=Cesium.SceneTransforms.wgs84ToWindowCoordinates(e,t);else return console.warn(`No suitable function found for coordinate transformation.`),null;return n||(console.warn(`Unable to project the position into screen space.`),null)}function vO(e){if(!e)return``;try{let t=new URL(e);if(!t.search&&t.pathname.includes(`&`)){let e=t.pathname.indexOf(`&`),n=t.pathname.slice(e+1);/^[A-Za-z_][A-Za-z0-9_.-]*=.*/.test(n)&&(t.pathname=t.pathname.slice(0,e),t.search=`?${n}`)}return t.toString()}catch{return e}}function yO(e){let t=`http://www.isotc211.org/2005/gmd`,n=`http://www.isotc211.org/2005/gco`,r=e.getElementsByTagNameNS(t,`protocol`)[0],i=r?.getElementsByTagNameNS(n,`CharacterString`)[0],a=r?.getElementsByTagNameNS(`http://www.isotc211.org/2005/gmx`,`Anchor`)[0],o=i?.textContent?.trim()||((a?.getAttribute(`xlink:href`)||``)+` `+(a?.textContent?.trim()||``)).trim()||``,s=vO((e.getElementsByTagNameNS(t,`linkage`)[0]?.getElementsByTagNameNS(t,`URL`)[0])?.textContent?.trim()||``),c=(e.getElementsByTagNameNS(t,`name`)[0]?.getElementsByTagNameNS(n,`CharacterString`)[0])?.textContent?.trim()||``,l=s.includes(`?`)?s.split(`?`)[1]:``,u=new URLSearchParams(l);return{protocol:o,url:s,layerName:c,urlLayerParam:u.get(`LAYERS`)||u.get(`layers`)||u.get(`Layers`)||``,baseUrl:s?s.split(`?`)[0]:``}}function bO(e,t=[]){return e?(e.Name&&t.push({name:e.Name,title:e.Title,queryable:!!e.queryable}),Array.isArray(e.Layer)?e.Layer.forEach(e=>{bO(e,t)}):e.Layer&&typeof e.Layer==`object`&&bO(e.Layer,t),t):t}async function xO(e){try{let t=await B.get(e,{params:{SERVICE:`WMS`,REQUEST:`GetCapabilities`},timeout:7e3}),n=new le().read(t.data),r=n?.Service?.Title||``,i=n?.Capability?.Layer,a=bO(i);return{layersAdded:a.length>0,serviceUnavailable:!1,serviceTitle:r,layerNames:a.map(e=>e.name),layerTitleEntries:a}}catch(e){return console.warn(`handleWmsFromCsw: WMS GetCapabilities failed, layers will be empty.`,e),{layersAdded:!1,serviceUnavailable:!0,serviceTitle:``,layerNames:[]}}}var SO=[],CO={addMap:function(e,t){e.mode=t,SO.push(e)},clear:function(){SO.length=0},count:function(){return SO.length},isEmpty:function(){return SO.length===0},getMap:function(e){return SO.find(t=>t?.mode===e)},getMapView:function(e){return this.getMap(e).getView()}};function wO(e,t){if(!e||!t)return!1;let n=e.toUpperCase().replaceAll(`::`,`:`),r=t.toUpperCase();return n.endsWith(r)}function TO(e,t){let n=t.find(t=>t?.Identifier===e?.TileMatrixSet)?.SupportedCRS;return n?wO(n,CO.getMapView(`2D`)?.getProjection()?.getCode()||``)||wO(n,`EPSG:4326`)||wO(n,`EPSG:3857`):!1}function EO(e,t=[],n=``){let r=Array.isArray(e?.TileMatrixSetLink)?e.TileMatrixSetLink:[];if(r.length===0)return``;let i=r.find(e=>wO(t.find(t=>t?.Identifier===e?.TileMatrixSet)?.SupportedCRS,n));if(i&&TO(i,t))return i.TileMatrixSet;let a=i?[i,...r.filter(e=>e!==i)]:r,o=a.find(e=>TO(e,t));return(a.find(e=>wO(t.find(t=>t?.Identifier===e?.TileMatrixSet)?.SupportedCRS,`EPSG:3857`))||o)?.TileMatrixSet||``}function DO(e){let t=Array.isArray(e?.ResourceURL)?e.ResourceURL.find(e=>e?.resourceType===`tile`&&e?.format):null,n=Array.isArray(e?.Format)?e.Format:[];return t?.format||n[0]||``}function OO(e){let t=`${e}?SERVICE=WMTS&REQUEST=GetCapabilities`;try{let t=new URL(e);return t.searchParams.set(`SERVICE`,`WMTS`),t.searchParams.set(`REQUEST`,`GetCapabilities`),t.toString()}catch{return t}}function kO(e=[],t=[],n=``){return Array.isArray(e)?e.filter(e=>e?.Identifier).map(e=>({name:e.Identifier,title:e.Title||e.Identifier,format:DO(e),tileMatrixSet:EO(e,t,n)})):[]}async function AO(e){let t=OO(e),n=CO.getMapView(`2D`)?.getProjection()?.getCode()||``;try{let e=await B.get(t,{timeout:7e3}),r=new $t().read(e.data),i=r?.ServiceIdentification?.Title||``,a=r?.Contents?.TileMatrixSet||[],o=kO(r?.Contents?.Layer||[],a,n);return{layersAdded:o.length>0,serviceUnavailable:!1,serviceTitle:i,layerNames:o.map(e=>e.name),layerTitleEntries:o,capabilitiesUrl:t}}catch(e){return console.error(`handleWmtsFromCsw: WMTS GetCapabilities failed, layers will be empty.`,e),{layersAdded:!1,serviceUnavailable:!0,serviceTitle:``,layerNames:[],layerTitleEntries:[],capabilitiesUrl:t}}}function jO(e,t){return Array.from(e?.getElementsByTagName(`*`)||[]).find(e=>e.localName===t)?.textContent?.trim()||``}function MO(e,t){return Array.from(e?.getElementsByTagName(`*`)||[]).filter(e=>e.localName===t)}function NO(e){let t=MO(e,`Operation`).filter(e=>e.getAttribute(`name`)?.toLowerCase()===`getfeature`),n=[];
22return t.forEach(e=>{MO(e,`Parameter`).filter(e=>e.getAttribute(`name`)?.toLowerCase()===`outputformat`).forEach(e=>{n.push(...MO(e,`Format`)),n.push(...MO(e,`Value`))})}),n.length>0?n.map(e=>e.textContent?.trim()).filter(Boolean):MO(e,`Format`).map(e=>e.textContent?.trim()).filter(Boolean)}async function PO(e){let t=[],n=`1.1.0`,r=`XML`,i=!1,a=``,o=[];for(let s of[`2.0.0`,`1.1.0`,`1.0.0`])try{let i=await B.get(e,{params:{SERVICE:`WFS`,REQUEST:`GetCapabilities`,VERSION:s},timeout:7e3}),c=i.request?.responseXML||new DOMParser().parseFromString(i.data,`application/xml`),l=c.documentElement?.getAttribute(`version`)||s,u=Array.from(c.getElementsByTagName(`*`)).find(e=>e.localName===`Service`);a=jO(Array.from(c.getElementsByTagName(`*`)).find(e=>e.localName===`ServiceIdentification`)||c,`Title`)||jO(u||c,`Title`)||``;let d=MO(c,`FeatureType`).map(e=>{let t=Array.from(e.children).find(e=>e.localName===`Name`),n=Array.from(e.children).find(e=>e.localName===`Title`);if(!t?.textContent?.trim())return null;let r=t.textContent.trim(),i=r.indexOf(`:`),a=i===-1?``:r.slice(0,i);return{name:r,featureNS:a&&t.lookupNamespaceURI(a)||``,title:n?.textContent?.trim()||``}}).filter(Boolean).filter((e,t,n)=>n.findIndex(t=>t.name===e.name)===t);if(d.length>0){o=d.map(e=>({name:e.name,title:e.title})),t=d,n=l;let e=NO(c);r=[`application/gml+xml; version=3.2`,`text/xml; subtype=gml/3.2.1`,`text/xml; subtype=gml/3.1.1`,`GML32`,`GML3`,`GML2`,`XML`].find(t=>e.some(e=>e.toLowerCase()===t.toLowerCase()))||e[0]||r;break}}catch{i=!0}return{featureTypes:t,wfsVersion:n,wfsOutputFormat:r,serviceUnavailable:i,serviceTitle:a,featureTypeTitles:o}}function FO(e){let t=new URL(e);return t.pathname!==`/`&&t.pathname.endsWith(`/`)&&(t.pathname=t.pathname.slice(0,-1)),t.toString()}function IO(e,t){let n=new URL(FO(t));if(!e.links||!Array.isArray(e.links))return new URL(`collections`,`${n.toString()}/`).toString();let r=e.links.find(e=>e.rel===`data`||e.rel===`collections`);if(r?.href)try{return new URL(r.href,`${n.toString()}/`).toString()}catch{return r.href}return new URL(`collections`,`${n.toString()}/`).toString()}async function LO(e){try{let t=FO(e),n={},r=``;try{n=(await B.get(t,{timeout:7e3,headers:{Accept:`application/json`}})).data||{},r=n.title||``}catch{}let i=IO(n,e),a=(await B.get(i,{timeout:7e3,headers:{Accept:`application/json`}})).data;!r&&a.title&&(r=a.title);let o=[];Array.isArray(a.collections)?o=a.collections:Array.isArray(a)&&(o=a);let s=o.filter(e=>e.id||e.name).map(e=>({name:e.id||e.name,title:e.title||e.id||e.name}));return{layersAdded:s.length>0,serviceUnavailable:!1,serviceTitle:r,layerNames:s.map(e=>e.name),layerTitleEntries:s}}catch(e){return console.warn(`handleOafFromCsw: OAF collections endpoint failed, collections will be empty.`,e),{layersAdded:!1,serviceUnavailable:!0,serviceTitle:``,layerNames:[],layerTitleEntries:[]}}}function RO(e,t=[]){return!Array.isArray(t)||t.length===0?[]:e===`WMS`?t.map(e=>({name:e.title||e.name,sourceProps:{layers:e.name},queryable:e.queryable??!0})):e===`WFS`?t.map(e=>{let t={featureType:e.name};return e.featureNS&&(t.featureNS=e.featureNS),{name:e.title||e.name,sourceProps:t}}):e===`WMTS`?t.map(e=>{let t={layers:e.name};return e.format&&(t.format=e.format),e.tileMatrixSet&&(t.tileMatrixSet=e.tileMatrixSet),{name:e.title||e.name,sourceProps:t}}):e===`OAF`?t.map(e=>({name:e.title||e.name,sourceProps:{collection:e.name}})):t}function zO(e=``){try{let t=new URL(e),n=t.pathname.split(`/`).filter(Boolean),r=n.findIndex(e=>e.toLowerCase()===`collections`),i=``;return r!==-1&&(n.length>r+1&&(i=decodeURIComponent(n[r+1])),t.pathname=`/${n.slice(0,r).join(`/`)}`),t.search=``,t.hash=``,{baseUrl:t.toString().replace(/\/$/,``),collection:i}}catch{return{baseUrl:e,collection:``}}}async function BO(e){let t=await xO(e),n={serviceUnavailable:t.serviceUnavailable,serviceTitle:t.serviceTitle||``,discoveredLayerEntries:[]};return t.layersAdded&&(n.discoveredLayerEntries=RO(`WMS`,t.layerTitleEntries||[])),n}async function VO(e,t){let n=await PO(e),r=n.featureTypes||[],i={serviceUnavailable:n.serviceUnavailable,serviceTitle:n.serviceTitle||``,wfsVersion:n.wfsVersion,wfsOutputFormat:n.wfsOutputFormat,wfsFeatureNS:``,discoveredLayerEntries:[],effectiveLayerName:t},a=r;if(n.featureTypeTitles&&Array.isArray(n.featureTypeTitles)&&(a=r.map(e=>{let t=n.featureTypeTitles.find(t=>t.name===e.name);return t?{...e,title:t.title}:e})),!t)i.discoveredLayerEntries=RO(`WFS`,a);else{let e=a.find(e=>e.name===t)||a[0];i.effectiveLayerName=e?.name||t,i.wfsFeatureNS=e?.featureNS||``}return i}async function HO(e,t){let n=await AO(e),r=n.layerTitleEntries||[],i={serviceUnavailable:n.serviceUnavailable,serviceTitle:n.serviceTitle||``,wmtsCapabilitiesUrl:n.capabilitiesUrl||``,wmtsFormat:``,wmtsTileMatrixSet:``,discoveredLayerEntries:[],effectiveLayerName:t};if(!t)i.discoveredLayerEntries=RO(`WMTS`,r);else{let e=r.find(e=>e.name===t)||r[0];i.effectiveLayerName=e?.name||t,i.wmtsFormat=e?.format||``,i.wmtsTileMatrixSet=e?.tileMatrixSet||``}return i}async function UO(e,t,n){let r=zO(e||t),i=await LO(r.baseUrl||t),a={serviceUnavailable:i.serviceUnavailable,serviceTitle:i.serviceTitle||``,baseUrl:r.baseUrl||t,discoveredLayerEntries:[],effectiveLayerName:n||``};return!a.effectiveLayerName&&r.collection&&(a.effectiveLayerName=r.collection),i.layersAdded&&(a.discoveredLayerEntries=RO(`OAF`,i.layerTitleEntries||[])),a}async function WO(e){let{protocol:t,url:n,layerName:r,urlLayerParam
22:i,baseUrl:a}=e,o=rO(t,n),s=a,c=(r&&!r.includes(` `)&&![`getcapabilities`,`getmap`,`getfeature`,`gettile`,`getlegendgraphic`,`getfeatureinfo`].includes(r.replace(/[()]/g,``).trim().toLowerCase())?r:``)||i,l=`1.1.0`,u=`XML`,d=``,f=``,p=``,m=``,h=!1,g=``,_=[];return o&&(o===`WMS`&&!c?{serviceUnavailable:h,serviceTitle:g,discoveredLayerEntries:_}=await BO(a):o===`WFS`?{serviceUnavailable:h,serviceTitle:g,wfsVersion:l,wfsOutputFormat:u,wfsFeatureNS:d,discoveredLayerEntries:_,effectiveLayerName:c}=await VO(a,c):o===`WMTS`?{serviceUnavailable:h,serviceTitle:g,wmtsCapabilitiesUrl:f,wmtsFormat:p,wmtsTileMatrixSet:m,discoveredLayerEntries:_,effectiveLayerName:c}=await HO(a,c):o===`OAF`&&({serviceUnavailable:h,serviceTitle:g,baseUrl:s,discoveredLayerEntries:_,effectiveLayerName:c}=await UO(n,a,c))),{typ:o,baseUrl:s,effectiveLayerName:c,wfsVersion:l,wfsOutputFormat:u,wfsFeatureNS:d,wmtsCapabilitiesUrl:f,wmtsFormat:p,wmtsTileMatrixSet:m,serviceUnavailable:h,serviceTitle:g,discoveredLayerEntries:_}}function GO(e){try{return new URL(e).hostname}catch{return e}}async function KO(e,t,n){let r=e.allFolders.find(e=>e.type===`folder`&&e.isExternal===!0&&e.name===n);if(r?.id)return r.id;let i=zr(`folder-`);return await t(`addLayerToLayerConfig`,{layerConfig:{id:i,type:`folder`,isExternal:!0,name:n,elements:[]},parentKey:`subjectlayer`},{root:!0})?i:e.allFolders.find(e=>e.type===`folder`&&e.isExternal===!0&&e.name===n)?.id||null}async function qO({rootGetters:e,dispatch:t,serviceConfig:n,cswContext:r}){let{serviceType:i,serviceTitle:a,layerEntries:o,baseUrl:s,resourceIndex:c,additionalLayerProps:l={}}=n||{},{fileIdentifier:u,cswUrl:d,showDocUrl:f,recordTitle:p}=r||{},m=await KO(e,t,a||GO(s)||u);if(!m||!Array.isArray(o)||o.length===0)return!1;let h=o.length===1;for(let e of o){let n=e?.name||``,r=h&&p?p:n||u,a=e?.title||n||u,o={id:`csw-${u}-${c}-${n.replace(/[^a-zA-Z0-9_.:()-]/g,`_`)}`,name:r,url:s,typ:i,metaID:u,cswUrl:d,datasets:[{md_id:u,csw_url:d,md_name:a,...f&&{show_doc_url:f}}],type:`layer`,isExternal:!0,parentId:m,showInLayerTree:h,visibility:h,...l,...e?.sourceProps};i===`WMS`&&!o.layers&&(o.layers=n),i===`WFS`&&!o.featureType&&(o.featureType=n),i===`OAF`&&!o.collection&&(o.collection=n),await t(`addLayerToLayerConfig`,{layerConfig:o,parentKey:m},{root:!0})}return!0}var JO=1e3;function YO(e,t,n){let r=e.getElementsByTagNameNS(t,`EX_GeographicBoundingBox`)[0],i=r?parseFloat(r.getElementsByTagNameNS(t,`westBoundLongitude`)[0]?.getElementsByTagNameNS(n,`Decimal`)[0]?.textContent):null,a=r?parseFloat(r.getElementsByTagNameNS(t,`southBoundLatitude`)[0]?.getElementsByTagNameNS(n,`Decimal`)[0]?.textContent):null;return{west:i,east:r?parseFloat(r.getElementsByTagNameNS(t,`eastBoundLongitude`)[0]?.getElementsByTagNameNS(n,`Decimal`)[0]?.textContent):null,south:a,north:r?parseFloat(r.getElementsByTagNameNS(t,`northBoundLatitude`)[0]?.getElementsByTagNameNS(n,`Decimal`)[0]?.textContent):null}}function XO({baseUrl:e,wfsVersion:t,responseXml:n,gmdNs:r,gcoNs:i,mapCollection:a,dispatch:o}){let s=!1;async function c(n){try{let r=await B.get(e,{params:{SERVICE:`WFS`,REQUEST:`GetFeature`,VERSION:t,TYPENAME:n,resultType:`hits`}}),i=(r.request?.responseXML||new DOMParser().parseFromString(r.data,`application/xml`)).documentElement,a=i?.getAttribute(`numberOfFeatures`)||i?.getAttribute(`numberMatched`);return a?parseInt(a,10):null}catch(e){return console.warn(`addLayerFromCswRecord: WFS hits request failed.`,e),null}}function l({featureCount:e,layerName:t,largeLayerCount:c=1}){let l=new Date(Date.now()-1e3).toISOString();o(`Alerting/addSingleAlert`,{category:`info`,content:c>1?i18next.t(`common:modules.searchBar.csw.largeWfsLayers`,{layerCount:c}):i18next.t(`common:modules.searchBar.csw.largeWfsLayer`,{count:e,layerName:t}),multipleAlert:!0,once:!0,initial:!1,displayFrom:l},{root:!0});let{west:u,east:d,south:f,north:p}=YO(n,r,i);if(!s&&u!==null&&!isNaN(u)){let e=a.getMap(`2D`)?.getView()?.getProjection()?.getCode(),t=[(u+d)/2,(f+p)/2];e&&e!==`EPSG:4326`&&(t=j.transformToMapProjection(a.getMap(`2D`),`EPSG:4326`,t)),o(`Maps/zoomToCoordinates`,{center:t,zoom:7},{root:!0}),s=!0}return s}async function u(e){let t=0,n=null,r=null;for(let i of e){let e=i.sourceProps?.featureType;if(!e)continue;let a=await c(e),o=a!==null&&a>1e3?`bbox`:`all`;i.sourceProps={...i.sourceProps,loadingStrategy:o},o===`bbox`&&(t++,n===null&&(n=a,r=i.name||e))}t>0&&l({featureCount:n,layerName:r,largeLayerCount:t})}return{getWfsHits:c,alertLargeLayer:l,applyDiscoveredWfsLoadingStrategies:u,WFS_
22LARGE_LAYER_THRESHOLD:JO}}async function ZO(e,t){let n=await B.get(e,{params:{service:`CSW`,request:`GetRecordById`,version:`2.0.2`,outputschema:`http://www.isotc211.org/2005/gmd`,elementsetname:`full`,id:t}});return n.request?.responseXML||new DOMParser().parseFromString(n.data,`application/xml`)}function QO({layerAdded:e,unavailableServiceUrls:t}){let n={once:!0,initial:!1,displayFrom:new Date(Date.now()-1e3).toISOString()};return e?{category:`success`,title:i18next.t(`common:modules.searchBar.csw.layerAddedTitle`),content:i18next.t(`common:modules.searchBar.csw.layerAdded`),multipleAlert:!0,...n}:t.size>0?{category:`info`,content:i18next.t(`common:modules.searchBar.csw.noServiceResponse`,{serviceUrl:t.values().next().value}),...n}:{category:`info`,content:i18next.t(`common:modules.searchBar.csw.noLayerLink`),...n}}function $O({typ:e,baseUrl:t,wfsVersion:n,wfsOutputFormat:r,wmtsCapabilitiesUrl:i,wmtsFormat:a,wmtsTileMatrixSet:o}){if(e===`WFS`)return{version:n,outputFormat:r};if(e===`WMTS`){let e={optionsFromCapabilities:!0,capabilitiesUrl:i||`${t}?SERVICE=WMTS&REQUEST=GetCapabilities`};return a&&(e.format=a),o&&(e.tileMatrixSet=o),e}return e===`OAF`?{bbox:!1,crs:!1,loadingStrategy:`all`}:{}}function ek(e){console.warn(`addLayerFromCswRecord: Failed to fetch CSW record.`),e(`Alerting/addSingleAlert`,{category:`error`,content:i18next.t(`common:modules.searchBar.csw.noLayerLink`)},{root:!0})}function tk({typ:e,effectiveLayerName:t,wfsFeatureNS:n,wmtsFormat:r,wmtsTileMatrixSet:i}){let a;return a=e===`WFS`?{featureType:t}:e===`OAF`?{collection:t}:{layers:t},e===`WFS`&&n&&(a.featureNS=n),e===`WMTS`&&r&&(a.format=r),e===`WMTS`&&i&&(a.tileMatrixSet=i),[{name:t,sourceProps:a}]}async function nk({parsedResource:e,resourceIndex:t,filterNonQueryableLayers:n,rootGetters:r,dispatch:i,responseXml:a,gmdNs:o,gcoNs:s,cswContext:c}){let{typ:l,baseUrl:u,effectiveLayerName:d,wfsVersion:f,wfsOutputFormat:p,wfsFeatureNS:m,wmtsCapabilitiesUrl:h,wmtsFormat:g,wmtsTileMatrixSet:_,serviceUnavailable:v,serviceTitle:ee,discoveredLayerEntries:te}=await WO(e),y=n&&te.length>0?te.filter(e=>e.queryable!==!1):te;if(!l)return{layerAdded:!1,unavailableServiceUrl:null};let ne=$O({typ:l,baseUrl:u,wfsVersion:f,wfsOutputFormat:p,wmtsCapabilitiesUrl:h,wmtsFormat:g,wmtsTileMatrixSet:_});if(l===`WFS`){let e=XO({baseUrl:u,wfsVersion:f,responseXml:a,gmdNs:o,gcoNs:s,mapCollection,dispatch:i});if(d){let t=await e.getWfsHits(d);t!==null&&t>e.WFS_LARGE_LAYER_THRESHOLD?(ne.loadingStrategy=`bbox`,e.alertLargeLayer({featureCount:t,layerName:d})):ne.loadingStrategy=`all`}else y.length>0&&await e.applyDiscoveredWfsLoadingStrategies(y)}let re={rootGetters:r,dispatch:i,serviceConfig:{serviceType:l,serviceTitle:ee,layerEntries:y,baseUrl:u,resourceIndex:t,additionalLayerProps:ne},cswContext:c};return y.length>0&&await qO(re)?{layerAdded:!0,unavailableServiceUrl:v?u:null}:d?{layerAdded:await qO({...re,serviceConfig:{...re.serviceConfig,layerEntries:tk({typ:l,effectiveLayerName:d,wfsFeatureNS:m,wmtsFormat:g,wmtsTileMatrixSet:_})}}),unavailableServiceUrl:v?u:null}:{layerAdded:!1,unavailableServiceUrl:v?u:null}}async function rk({onlineResources:e,filterNonQueryableLayers:t,rootGetters:n,dispatch:r,responseXml:i,gmdNs:a,gcoNs:o,cswContext:s}){let c=new Set,l=!1;for(let u=0;u<e.length;u++){let d=yO(e[u]);if(!d.url)continue;let{layerAdded:f,unavailableServiceUrl:p}=await nk({parsedResource:d,resourceIndex:u,filterNonQueryableLayers:t,rootGetters:n,dispatch:r,responseXml:i,gmdNs:a,gcoNs:o,cswContext:s});if(p&&c.add(p),f){l=!0;break}}return{layerAdded:l,unavailableServiceUrls:c}}var ik={activateLayerInTopicTree:({dispatch:e,rootGetters:t},{layerId:n,source:r})=>{let i=t.layerConfigById(n);if(i){let r=i.zIndex;i.showInLayerTree||(r=t.determineZIndex(n)),e(`replaceByIdInLayerConfig`,{layerConfigs:[{id:n,layer:{id:n,visibility:!0,showInLayerTree:!0,zIndex:r}}]},{root:!0})}else e(`addLayerToTopicTree`,{layerId:n,source:r})},removeLayerFromTopicTree:({dispatch:e,rootGetters:t},{layerId:n})=>{t.layerConfigById(n)&&e(`replaceByIdInLayerConfig`,{layerConfigs:[{id:n,layer:{id:n,visibility:!1,showInLayerTree:!1}}]},{root:!0})},addLayerToTopicTree:({dispatch:e,rootGetters:t},{layerId:n,source:r,showInLayerTree:i=!0,visibility:a=!0})=>{t.layerConfigById(n)?e(`activateLayerInTopicTree`,{layerId:n,source:r}):e(`addLayerToLayerConfig`,{layerConfig:{...r,id:n,showInLayerTree:i,type:`layer`,visibility:a},parentKey:er},{root:!0}).then(t=>{t||e(`Alerting/addSingleAlert`,{category:`error`,content:i18next.t(`common:modules.searchBar.layerResultNotShown`)},{root:!0})})}
22,highlightFeature:({getters:e,dispatch:t},{hit:n})=>{let r,i;Array.isArray(n.coordinate[0])||(n.geometryType=n.geometryType.toUpperCase().replace(`MULTI`,``)),r=gO.getWKTGeom(n,n.geometryType.toUpperCase()),r=r?.getGeometry().getType()===`MultiPolygon`?r?.getGeometry():r,n.geometryType===`Point`||n.geometryType===`MultiPoint`?(t(`Maps/placingPointMarker`,r,{root:!0}),i=Uc.getMapmarkerLayerById(`marker_point_layer`)):(t(`Maps/placingPolygonMarker`,r,{root:!0}),i=Uc.getMapmarkerLayerById(`marker_polygon_layer`));let a=i.getSource().getExtent();mO.extentIsValid(a)&&t(`Maps/zoomToExtent`,{extent:a,options:{maxZoom:e.zoomLevel}},{root:!0})},openGetFeatureInfo:({commit:e},{feature:t,layer:n})=>{e(`Modules/GetFeatureInfo/setGfiFeatures`,[dh.createGfiFeature(n,``,t)],{root:!0})},setMarker:({dispatch:e,commit:t,state:n,rootGetters:r},{coordinates:i,feature:a,geometryType:o,layer:s})=>{let c=i?.map(e=>parseFloat(e,10)),l=a?a?.getGeometry()?.getType():o,u=l===`GeometryCollection`?mO.getFirstPointCoordinates(a,c):c;if(s&&l===`MultiPolygon`){let i={},o=r[`Modules/GetFeatureInfo/highlightVectorRules`],c=n.lastPickedFeatureId,l=r[`Maps/highlightedFeatures`]?.find(e=>e.getId?.()===c);l&&e(`Maps/removeHighlightFeature`,l,{root:!0});let u,d;if(o&&o.fill&&o.stroke)u={color:f_(o.fill.color)},d={color:f_(o.stroke.color),width:o.stroke.width||1};else{let e=Ft.returnStyleObject(`defaultMapMarkerPolygon`),t=e.rules?e.rules[0].style:e?.style;u={color:`rgba(${t.polygonFillColor.join(`, `)})`}
22,d={color:`rgba(${t.polygonStrokeColor.join(`, `)})`,width:t.polygonStrokeWidth[0]}}i.highlightStyle={fill:u,stroke:d},i.type=`highlightMultiPolygon`,i.feature=a,i.styleId=s.get(`styleId`),e(`Maps/highlightFeature`,i,{root:!0}),a.getId?.()&&t(`setLastPickedFeatureId`,a.getId())}a&&(l===`Polygon`||l===`MultiPolygon`)?mO.checkIsCoordInsidePolygon(a,u)||(u=mO.getRandomCoordinate(a.getGeometry().getCoordinates())):!a&&(l===`Polygon`||l===`MultiPolygon`||l===`MultiLineString`)&&(u=gO.getWKTGeom([c],o.toUpperCase()).getGeometry().getFirstCoordinate()),e(`Maps/placingPointMarker`,u,{root:!0})},showInTree:async({commit:e,dispatch:t},{layerId:n,source:r})=>{let i=await t(`retrieveLayerConfig`,{layerId:n,source:r});if(e(`setShowSearchResultsInTree`,!0),t(`Menu/changeCurrentComponent`,{type:`layerSelection`,side:`mainMenu`,props:{name:`common:modules.layerSelection.name`}},{root:!0}),n.includes(`folder-`)){let n=i.elements[0]?.id;t(`Modules/LayerSelection/showLayer`,{layerId:n},{root:!0}),e(`Modules/LayerSelection/setHighlightLayerId`,null,{root:!0})}else i?t(`Modules/LayerSelection/showLayer`,{layerId:n},{root:!0}):(console.warn(`Cannot show layer with id `,n,`: is not contained in services.json`),t(`Alerting/addSingleAlert`,{category:`info`,content:i18next.t(`common:modules.searchBar.layerResultNotShown`)},{root:!0}))},showLayerInfo:async({commit:e,dispatch:t},{layerId:n,source:r})=>{let i=await t(`retrieveLayerConfig`,{layerId:n,source:r});i?(Ml().startLayerInformation(i),e(`Modules/LayerSelection/setLayerInfoVisible`,!0,{root:!0})):(console.warn(`Cannot show info for layer with id `,n,`: is not contained in services.json`),t(`Alerting/addSingleAlert`,{category:`info`,content:i18next.t(`common:modules.searchBar.layerInfoNotShown`)},{root:!0}))},retrieveLayerConfig:({dispatch:e,rootGetters:t},{layerId:n,source:r})=>{let i=t.layerConfigById(n);return!i&&n.includes(`folder-`)&&(i=t.folderById(n)),i||(i=jt.getLayerWhere({id:n}),r&&(e(`addLayerToTopicTree`,{layerId:n,source:r,showInLayerTree:!1,visibility:!1}),i=t.layerConfigById(n))),!i&&r&&(e(`addLayerToTopicTree`,{layerId:n,source:r,showInLayerTree:!1,visibility:!1}),i=t.layerConfigById(n)),i},startRouting:({dispatch:e,rootGetters:t},{coordinates:n,name:r})=>{let i=`secondaryMenu`;e(`Menu/changeCurrentComponent`,{type:`routing`,side:i,props:{name:i18next.t(`common:modules.routing.name`)}},{root:!0}),t[`Menu/expanded`](i)||e(`Menu/toggleMenu`,i,{root:!0}),e(`Modules/Routing/setFirstWayPoint`,{displayName:r,coordinates:n},{root:!0})},zoomToResult:({dispatch:e,getters:t},{coordinates:n})=>{let r=n?.map(e=>parseFloat(e,10));if(r.length===4){let t=mapCollection.getMap(`2D`),n=t.getView();e(`Maps/zoomToExtent`,{extent:r,options:{maxZoom:r?n.getZoomForResolution(n.getResolutionForExtent(r,t.getSize())):null}},{root:!0})}else e(`Maps/zoomToCoordinates`,{center:r,zoom:t.zoomLevel},{root:!0})},highlight3DTileByCoordinates({rootGetters:e,dispatch:t},{coordinates:n}){if(e[`Maps/mode`]!==`3D`)return;let r=mapCollection.getMap(`3D`).getCesiumScene(),[i,a]=n,o=Cesium.Cartesian3.fromDegrees(i,a,0),s=r.camera;t(`Maps/setCamera`,{cameraPosition:[i,a,Cesium.Ellipsoid.WGS84.cartesianToCartographic(s.position).height+140],heading:0,pitch:-90,roll:0},{root:!0}),t(`detectAndHighlight3DTile`,{scene:r,cartesian:o})},async detectAndHighlight3DTile({state:e,dispatch:t,commit:n},{scene:r,cartesian:i}){try{if(e.lastPickedFeatureId){let n=await ug.find3DPickedFeature(r,e.lastPickedFeatureId);if(n){t(`highlightPickedFeature`,{pickedFeature:n});return}}let a=_O(r,i);if(!a){console.warn(`Unable to project the position into screen space.`);return}let o=r.drillPick(a,void 0,20,20).find(e=>e._batchId!==void 0);o?(n(`setLastPickedFeatureId`,o.getProperty(`id`)),t(`highlightPickedFeature`,{pickedFeature:o})):t(`handleLayerLoading`,{scene:r,cartesian:i})}catch(e){console.error(`Error during camera move end:`,e)}},handleLayerLoading({dispatch:e,commit:t},{scene:n,cartesian:r}){let i=Date.now(),a=i-300,o=n.postRender.addEventListener(()=>{let s=Date.now();if(s-i>15e3){o(),e(`removeHighlight3DTile`);return}if(s-a<300)return;a=s;let c=_O(n,r);if(!c)return;let l=n.drillPick(c,void 0,20,20).find(e=>e._batchId!==void 0);l&&(o(),t(`setLastPickedFeatureId`,l.getProperty(`id`)),e(`highlightPickedFeature`,{pickedFeature:l}))})},highlightPickedFeature({rootGetters:e,getters:t,commit:n,dispatch:r},{pickedFeature:i}){if(!i||typeof i.getProperty!=`function`){console.warn(`Invalid picked feature:`,i);return}let a=i.getProperty(`id`),o=e[`Modules/GetFeatureInfo/menuSide`],s=e[`Menu/currentComponent`](o)?.type;if(!a){console.warn(`Picked feature has no ID:`,i);return}r(`Modules/GetFeatureInfo/removeHighlightColor`,``,{root:!0}),n(`Modules/GetFeatureInfo/setGfiFeatures`,null,{root:!0}),s===`getFeatureInfo`&&(n(`Menu/switchToPreviousComponent`,o,{root:!0}),o===`secondaryMenu`&&e[`Menu/secondaryMenu`].currentComponent===`root`&&r(`Menu/closeMenu`,`secondaryMenu`,{root:!0})),ag(a,rg(t.coloredHighlighting3D?.color,`YELLOW`)),n(`setLastPickedFeatureId`,a)},removeHighlight3DTile({commit:e,state:t}){t.lastPickedFeatureId&&(og(t.lastPickedFeatureId),e(`setLastPickedFeatureId`,null))}
22,addLayerFromCswRecord:async({dispatch:e,rootGetters:t},{fileIdentifier:n,cswUrl:r,showDocUrl:i,recordTitle:a,filterNonQueryableLayers:o})=>{let s=`http://www.isotc211.org/2005/gmd`,c;try{c=await ZO(r,n)}catch{ek(e);return}let{layerAdded:l,unavailableServiceUrls:u}=await rk({onlineResources:c.getElementsByTagNameNS(s,`CI_OnlineResource`),filterNonQueryableLayers:o,rootGetters:t,dispatch:e,responseXml:c,gmdNs:s,gcoNs:`http://www.isotc211.org/2005/gco`,cswContext:{fileIdentifier:n,cswUrl:r,showDocUrl:i,recordTitle:a}});e(`Alerting/addSingleAlert`,QO({layerAdded:l,unavailableServiceUrls:u}),{root:!0})}},ak={...qD,...pO,...ik,overwriteDefaultValues:({state:e})=>{Z.prototype.timeout=e.timeout},startLayerSelectionSearch:({dispatch:e,commit:t},n)=>{t(`setShowAllResults`,!0),e(`Menu/clickedMenuElement`,{name:`common:modules.searchBar.searchResultList`,side:n,type:`searchBar`},{root:!0}),t(`Menu/setCurrentComponent`,{type:`layerSelection`,side:n,props:[]},{root:!0}),t(`Menu/setCurrentComponentPropsName`,{side:n,name:`common:modules.searchBar.searchResults`},{root:!0}),t(`Menu/setNavigationHistoryBySide`,{side:n,newHistory:[{type:`root`,props:[]},{type:`layerSelection`,props:{name:`common:modules.layerSelection.addSubject`}},{type:`layerSelection`,props:{name:`common:modules.searchBar.searchResultList`}}]},{root:!0})},checkLayerSelectionSearchConfig:({commit:e,rootGetters:t,rootState:n})=>{let r=n.portalConfig?.tree?.addLayerButton?.searchBar;if(t.showLayerAddButton===!0&&r&&r?.active!==void 0){if(r.searchInterfaceInstances){let t=[];r.searchInterfaceInstances.forEach(e=>{e.searchCategory&&t.push(e)}),e(`setShowAllResultsSearchInterfaceInstances`,t)}else(r.searchInterfaceInstanceId||r.searchCategory)&&(r.searchCategory&&r?.searchInterfaceInstanceId?e(`setShowAllResultsSearchInterfaceInstances`,[{id:r.searchInterfaceInstanceId,searchCategory:r.searchCategory}]):console.warn(`Please check the searchBar configuration at tree.addLayerButton`));typeof r.active==`boolean`&&e(`setAddLayerButtonSearchActive`,r.active)}else e(`setAddLayerButtonSearchActive`,!1)}},ok={namespaced:!0,state:{...WD},mutations:KD,actions:ak,getters:GD},sk={description:`common:modules.selectFeatures.description`,hasMouseMapInteractions:!0,type:`selectFeatures`,name:`common:modules.selectFeatures.name`,icon:`bi-hand-index`,selectedFeatures:[],selectedFeaturesWithRenderInformation:[],selectInteraction:void 0,dragBoxInteraction:void 0,highlightVectorRulesPolygon:{fill:{color:[255,255,0,.9]},stroke:{width:4,color:[255,255,0,.9]},zoomLevel:7},highlightVectorRulesPointLine:{stroke:{width:8,color:[255,255,0,.9]},image:{scale:2},zoomLevel:7}},ck={...H(sk)},lk={...U(sk),addSelectedFeatureWithRenderInformation(e,t){e.selectedFeaturesWithRenderInformation.push(t)},addSelectedFeature(e,t){e.selectedFeatures.push(t)}},uk={highlightFeature({state:e,rootGetters:t,dispatch:n},{feature:r,layerId:i}){n(`Maps/removeHighlightFeature`,`decrease`,{root:!0});let a=W.getOlLayers().find(e=>e.values_.id===i),o=r.getGeometry().getType(),s=r.getId(),c=o.toLowerCase().indexOf(`polygon`)>-1?e.highlightVectorRulesPolygon:e.highlightVectorRulesPointLine,l={type:o===`Point`||o===`MultiPoint`?`increase`:`highlightPolygon`,id:s,layer:a,feature:r,scale:c.image?.scale},u=jt.getLayerWhere({id:i});o===`LineString`&&(l.type=`highlightLine`),a.id=i,l.zoomLevel=c.zoomLevel,u&&u.styleId?l.styleId=u.styleId:a&&a.get(`styleId`)&&(l.styleId=a.get(`styleId`)),l.highlightStyle={fill:c.fill,stroke:c.stroke,image:c.image},n(`Maps/highlightFeature`,l,{root:!0}),c&&c.zoomLevel&&(o===`Point`?n(`Maps/setCenter`,r.getGeometry().getCoordinates(),{root:!0}):n(`Maps/setCenter`,Sn(r.getGeometry().getExtent()),{root:!0}),n(`Maps/setZoom`,c.zoomLevel,{root:!0})),t.treeHighlightedFeatures?.active&&Jm.createLayerAddToTree(i,[r],t.treeType,t.treeHighlightedFeatures)}},dk={namespaced:!0,state:{...sk},mutations:lk,getters:ck,actions:uk},fk={description:`common:modules.shadow.description`,icon:`bi-lamp-fill`,name:`common:modules.shadow.name`,supportedDevices:[`Desktop`,`Mobile`,`Table`],supportedMapModes:[`3D`],type:`shadow`,isShadowEnabled:!1,shadowTime:{}},pk={...H(fk)},mk={...U(fk)},hk={namespaced:!0,state:{...fk},getters:pk,mutations:mk},gk={description:`common:modules.shareView.description`,icon:`bi-share`,name:`common:modules.shareView.name`,supportedDevices:[`Desktop`,`Mobile`,`Table`],supportedMapModes:[`2D`,`3D`],type:`shareView`,copyShare:!0,facebookShare:!1,qrShare:!1},_k={...U(gk)};function vk(e){try{JSON.stringify(e.attributes)}catch(t){delete e.attributes,console.error(`Parsing the attributes of the module: ${e.currentComponent} into a string failed. The attributes were removed due to the following error message: ${t}`)}}var yk={...H(gk),url(e,t,n,r){let i=r.layerUrlParams.filter(e=>!bk(e.id)),a=r[`Maps/urlParams`],o=r[`Menu/urlParams`],s=[gk.type,WD.type],c=new URL(location.origin+location.pathname+`?`+a),l=n?.Maps?.currentMarker;if(r[`Maps/mode`]===`3D`){let e=r[`Modules/SearchBar/lastPickedFeatureId`];e&&c.searchParams.set(`HIGHLIGHTED3D`,e)}
22i.forEach(e=>{let t=W.getLayerById(e.id)?.getLayerSource?.()?.getParams?.()?.TIME;t&&(e.params={...e.params,TIME:t})}),s.includes(o.main.currentComponent)&&(o.main.currentComponent=`root`,delete o.main.attributes),s.includes(o.secondary.currentComponent)&&(o.secondary.currentComponent=`root`,delete o.secondary.attributes);let u=n?.Modules?.BufferAnalysis;if(u?.selectedSourceLayer&&u?.selectedTargetLayer&&u?.bufferRadius&&(o.secondary=o.secondary||{},o.secondary.currentComponent=`bufferAnalysis`,o.secondary.attributes={source:u.selectedSourceLayer.id,target:u.selectedTargetLayer.id,radius:u.bufferRadius,result:u.resultType}),vk(o.main),vk(o.secondary),c.searchParams.set(`MENU`,JSON.stringify(o)),c.searchParams.set(`LAYERS`,JSON.stringify(i)),l&&c.searchParams.set(`MARKER`,JSON.stringify(l)),location.search){let e=new URLSearchParams(location.search),t=[`map/layerids`,`layerids`,`visibility`,`transparency`,`map/mdid`];e?.forEach((e,n)=>{!Array.from(c.searchParams.keys()).some(e=>e.toLowerCase()===n.toLowerCase())&&!t.includes(n.toLowerCase())&&c.searchParams.set(n,e)})}return encodeURI(c.origin+c.pathname+`?`+Array.from(c.searchParams).map(e=>e[0]+`=`+e[1]).join(`&`))}};function bk(e){return W.getLayerById(e)?.attributes?.isDynamic===!0}var xk={namespaced:!0,state:gk,mutations:_k,getters:yk},Sk={id:`statisticDashboard`,name:`common:modules.statisticDashboard.name`,subtitle:`common:modules.statisticDashboard.headings.mrhstatistics`,levelTitle:void 0,description:`common:modules.statisticDashboard.description`,icon:`bi-bar-chart-line-fill`,renderToWindow:!1,resizableWindow:!0,isVisibleInMenu:!0,colorScheme:{},data:[],selectedReferenceData:void 0,selectedCategories:[],selectedReferenceValueTag:void 0,selectedRegions:[],selectedLevel:void 0,flattenedRegions:[],selectedDates:[],selectedStatistics:{},classificationMode:`quantiles`,allowPositiveNegativeClasses:!1,decimalPlaces:1,minNumberOfClasses:3,maxNumberOfClasses:9,numberOfClasses:5,selectableColorPalettes:[{key:`YlGn`,label:`Gelb-Grün`},{key:`YlOrRd`,label:`Gelb-Rot`},{key:`Blues`,label:`Blau`},{key:`Greys`,label:`Grau`},{key:`Greens`,label:`Grün`},{key:`Reds`,label:`Rot`},{key:`Oranges`,label:`Orange`},{key:`Purples`,label:`Violett`}],selectedColorPaletteIndex:0,stepValues:[],colorPalette:[],opacity:.9,chartTableToggle:`table`,legendData:[],addTotalCount:!1,lineLimit:null,downloadFilename:`Statistic Dashboard Download`,barLimit:null,chosenStatisticName:``,isFeatureLoaded:!0},Ck={...H(Sk),selectedDatesValues(e,{selectedDates:t}){let n=[];return t.forEach(e=>{q(e)&&(Array.isArray(e.value)?n.push(...e.value):n.push(e.value))}),n},selectedRegionsValues(e,{selectedRegions:t}){if(!Array.isArray(t))return[];let n=t;t.some(e=>e.label===i18next.t(`common:modules.statisticDashboard.button.all`))&&e?.flattenedRegions!==void 0&&(n=Al(e?.flattenedRegions.find(e=>!Object.prototype.hasOwnProperty.call(e,`child`))?.values,`label`));let r=n.map(e=>e.value),i=r.find(e=>Array.isArray(e));return i===void 0?r:i}},wk={namespaced:!0,state:Sk,getters:Ck,mutations:{...U(Sk)}},Tk={description:`common:modules.styleVT.description`,icon:`bi-paint-bucket`,layerModel:null,name:`common:modules.styleVT.name`,type:`styleVT`,vectorTileLayerList:[]},Ek=Object.assign({},Tk),Dk={refreshVectorTileLayerList({state:e,commit:t,rootGetters:n}){let{layerModel:r}=e,i=n.visibleLayerConfigs||[],a=[];i.forEach(e=>{e.typ===`VectorTile`&&a.push({id:e.id,name:e.name})}),t(`setVectorTileLayerList`,a),r!=null&&a.find(e=>e.id===r.id)===void 0&&t(`setLayerModel`,null)},resetModule({commit:e}){e(`setLayerModel`,Ek.layerModel),e(`setVectorTileLayerList`,Ek.vectorTileLayerList)},startLayerProcess({commit:e,dispatch:t},n){e(`setLayerModel`,n),t(`refreshVectorTileLayerList`)},updateStyle({state:e},t){e.layerModel.setStyleById(t)}},Ok={...H(Tk),selectedLayerId(e){return t=>t===e.layerModel?.id},selectedStyle(e){return t=>t===e.layerModel.get(`selectedStyleID`)}},kk={namespaced:!0,state:Tk,actions:Dk,mutations:{...U(Tk),setLayerModelById(e,t){let n=null;t!==``&&(n=W?.getLayerById(t)),Object.assign(e,{layerModel:n})}},getters:Ok},Ak={type:`wfsSearch`,description:`common:modules.wfsSearch.description`,name:`common:modules.wfsSearch.name`,icon:`bi-search`,instances:[],currentInstanceIndex:0,parsedSource:null,requiredValues:null,userHelp:``,results:[],searched:!1,selectedOptions:{},service:null,showResultList:!1,valuesReset:!1,zoomLevel:5,resultsPerPage:0,multiSelect:!1,fullViewEnabled:!1,supportedDevices:[`Desktop`,`Mobile`,`Table`],supportedMapModes:[`2D`,`3D`]},jk={wildCard:`*`,singleChar:`#`,escapeChar:`!`};function Mk(e){let t=[];
22return e.forEach(e=>{if(e.clause){let n=Mk(e.clause.literals);if(n?.length>0)if(n.length===1)t.push(...n);else{let r=n.join(``);t.push(e.clause.type===`and`?`<ogc:And>${r}</ogc:And>`:`<ogc:Or>${r}</ogc:Or>`)}}else e?.field?.value&&t.push(Pk(e.field))}),t}function Nk(e){let t=``;return e.forEach(e=>{if(e.clause)t+=Nk(e.clause.literals);else if(e.field){let{fieldName:n,parameterIndex:r,value:i}=e.field,a=typeof r==`number`?n[r]:n;i&&(t+=`&${a}=${i}`)}}),t}function Pk(e){let{fieldName:t,parameterIndex:n,queryType:r,value:i}=e,a=typeof n==`number`,o=a?r[n]:r,s=a?t[n]:t,c=o===`like`,l=`<ogc:PropertyName>${s}</ogc:PropertyName><ogc:Literal>${i}${c?jk.wildCard:``}</ogc:Literal>`,u=``;return c&&Object.entries(jk).forEach(([e,t])=>{u+=`${e}="${encodeURIComponent(t)}" `}),c?`<ogc:PropertyIsLike matchCase="false" ${u.slice(0,-1)}>${l}</ogc:PropertyIsLike>`:`<ogc:PropertyIsEqualTo matchCase="false">${l}</ogc:PropertyIsEqualTo>`}function Fk(e){jk=e}function Ik(e){return e.endsWith(`*`)?e:e+`*`}function Lk(e,t=null,n=[]){let r=t===null?e:t;for(let t of r){let{field:r,clause:i}=t;if(r){n.push(r.inputLabel);continue}n.push(i.type,`(`),Lk(e,i.literals,n),n.push(`)`)}return n}function Rk(e){let t=i18next.t(`common:modules.wfsSearch.userHelp.and`),n=i18next.t(`common:modules.wfsSearch.userHelp.or`),r=Lk(e),i=``,a=``;for(let e of r){if(e===`and`||e===`or`){a=e;continue}if(e!==`(`&&e!==`)`){i+=`${e} ${a} `;continue}e===`)`&&a!==``&&(i=i.substring(0,i.length-(a.length+2)),a=``),i+=e}return i.replaceAll(` and `,` ${t} `).replaceAll(` or `,` ${n} `).replaceAll(`)(`,`) ${t} (`).replaceAll(`,`,` / `).replaceAll(`*`,``)}function zk(e,t=null,n=``,r={}){let i=t===null?e:t,a=n?n+`+`:`wfsSearch-`;return i.forEach((t,n)=>{if(t.field)t.field.id=`${a}field-${n}`,t.field.value=null,t.field.required&&(r[t.field.id]=null,t.field.inputLabel=typeof t.field.inputLabel==`object`?t.field.inputLabel.map(e=>Ik(e)):Ik(t.field.inputLabel)),t.clause&&delete t.clause;else{let i=`${a}clause-${n}`;t.clause.id=i,zk(e,t.clause.literals,i,r)}}),r}function Bk(e,t,n,r,i,a=null){return(a||n).forEach(a=>{if(a.clause)Bk(e,t,n,r,i,a.clause.literals);else if(a.field){let n=Array.isArray(a.field.required)?a.field.required[i]:a.field.required;a.field.id===e&&(a.field.value=t,n&&(r[e]=t),Array.isArray(a.field.required)&&(a.field.parameterIndex=i))}}),r}function Vk(e,t=null){(t||e).forEach(t=>{t.clause?Vk(e,t.clause.literals):t.field&&(t.field.value=``)})}var Hk={instanceChanged({commit:e,dispatch:t},n){e(`setCurrentInstanceIndex`,n),t(`prepareModule`)},prepareModule({commit:e,dispatch:t,getters:n,rootGetters:r}){t(`resetModule`,!1);let{currentInstance:i}=n,{requestConfig:{layerId:a,likeFilter:o,restLayerId:s,storedQueryId:c},title:l}=i,u=s?r.restServiceById(s):jt.getLayerWhere({id:a});if(u){let{selectSource:n}=i,r={url:u.url||(u.get?u.get(`url`):void 0),featureNS:u.featureNS||(u.get?u.get(`featureNS`):void 0),featurePrefix:u.featurePrefix||(u.get?u.get(`featurePrefix`):void 0)};e(`setRequiredValues`,{...zk(i.literals)}),e(`setUserHelp`,i.userHelp||Rk(i.literals)),n&&t(`retrieveData`),o&&Fk(o),!c&&a&&(r.typeName=u.featureType||(u.get?u.get(`featureType`):void 0)),e(`setService`,r)}else t(`resetModule`,!0),t(`Alerting/addSingleAlert`,i18next.t(`common:modules.wfsSearch.wrongConfig`,{id:s||a,title:l}),{root:!0})},resetModule({commit:e,dispatch:t},n){e(`setRequiredValues`,null),e(`setSearched`,!1),e(`setService`,null),e(`setUserHelp`,``),t(`resetResult`),t(`Maps/removePolygonMarker`,null,{root:!0}),n&&(e(`setCurrentInstanceIndex`,0),e(`setParsedSource`,null))},retrieveData({commit:e,getters:t}){let{currentInstance:{selectSource:n}}=t;B.get(encodeURI(n)).then(e=>Qc(e,`WfsSearch, retrieveData`)).then(t=>e(`setParsedSource`,t))},resetResult({commit:e,dispatch:t,getters:n,state:r}){e(`setValuesReset`,!0),e(`setSearched`,!1),e(`setResults`,[]),e(`setSelectedOptions`,{}),t(`Maps/removePointMarker`,null,{root:!0}),Vk(n.currentInstance.literals),r.requiredValues!==null&&Object.keys(r.requiredValues).forEach(e=>{r.requiredValues[e]=``})}},Uk={...H(Ak),requiredFields({requiredValues:e}){return e===null||Object.values(e).some(e=>typeof e!=`string`||e===``)},currentInstance({instances:e,currentInstanceIndex:t}){return e[t]}
22,urlParams:e=>({type:e.type,name:e.name,icon:e.icon})};function Wk(e,t,n){let r=Object.entries(e),i=[],a=n;for(let e of r){let[n,{value:r,index:o}]=e,s=n===``?[r]:[n,o];if(n===t)break;a[s[0]]===void 0&&(s[0]=Object.entries(a).find(e=>e[1].id===s[0])[0]),a=a[s[0]],s[1]!==void 0&&(a=a[s[1]]),i.push(...s)}return i.push(t),i}function Gk(e,t){let n=Bl.idx(t,e);return n&&n!==Bl.badPathSymbol&&typeof n[0]==`object`?Kk(n):n===Bl.badPathSymbol||n==null?[]:n}function Kk(e,t=!1){let n=[];return Object.entries(e).forEach(([e,{id:r}])=>n.push({fieldValue:r,displayName:t?`${e} (${r})`:r})),n}function qk(e){let t=e;for(;t.includes(`.`);)t=t.slice(t.indexOf(`.`)+1);return t}var Jk={namespaced:!0,state:Ak,actions:Hk,mutations:{...U(Ak),addOptions:({currentInstanceIndex:e,instances:t},n)=>{let r=t[e];Array.isArray(r?.addedOptions)||(r.addedOptions=[]),r.addedOptions.includes(n)?console.warn(`WfsSearch: The option ${n} is added multiple times to the formular. This entry will be skipped.`):r.addedOptions.push(n)},setSelectedOptions(e,t){if(!t||q(t)&&Object.keys(t).length===0){e.selectedOptions=t;return}let{index:n,options:r,value:i}=t,a=[];i!==``&&(e.selectedOptions[qk(r)]={value:i,index:n}),a=Object.keys(e.selectedOptions).reverse();for(let t of a){if(t===qk(r)){i===``&&delete e.selectedOptions[t];break}delete e.selectedOptions[t]}e.selectedOptions={...e.selectedOptions}}},getters:Uk},Yk={type:`wfst`,name:`common:modules.wfst.name`,description:`common:modules.wfst.description`,icon:`bi-globe`,hasMouseMapInteractions:!0,supportedDevices:[`Desktop`,`Mobile`,`Table`],supportedMapModes:[`2D`],update:!1,multiUpdate:[],delete:!1,layerIds:[],layerSelectLabel:`common:modules.wfst.layerSelectLabel`,lineButton:[],pointButton:[],polygonButton:[],multipolygonButton:[],transactionProcessing:!1,showConfirmModal:!1,showVoidModal:!1,voidModalCallback:{},toggleLayer:!1,showLayerLoader:!1,activateLayerInTree:!1,layerLoading:!1,managedLayer:null,currentLayerIndex:-1,featureProperties:[],featurePropertiesBatch:[],featurePropertiesValues:[],anyInputValue:{},layerInformation:[],selectedInteraction:null,isFormDisabled:!1,active:!1,buttonsDisabled:!1,selectedUpdate:null,processedMultiPolygons:new Set,isDrawMode:!1,lastModifiedMultipolygon:null};function Xk({id:e,geometry:t,geometryName:n},r,i,a=`feature`,o=[]){let s=new V,c=a.replace(/:$/,``);return r.forEach(e=>{let r=i?`${c}:${e.key}`:e.key;if(e.label&&!o.includes(e.label.toLowerCase()))if([``,null,void 0].includes(e.value)&&i)s.set(r,null);else if(e.type===`geometry`)s.setGeometryName(i?`${c}:${n}`:n),s.setGeometry(t);else if([`integer`,`int`,`decimal`,`short`,`float`].includes(e.type)){if(!Number.isFinite(parseFloat(e.value)))return;s.set(r,Number(e.value))}else s.set(r,e.value)}),e&&s.setId(e),s}async function Zk(e,t){let n=e.gfiAttributes===`ignore`,r=e.gfiAttributes===`showAll`,i=e.url,a,o=[],s=[];if(n)return[];try{a=await kn.receivePossibleProperties(i,e.version,e.featureType,e.isSecured)}catch(e){console.error(e)}if(!a)return[];if(o=a.map(e=>e.type===`boolean`&&e.value===null?{...e,valid:!0,value:!1}:e),r)s=o;else{let t=Object.keys(e.gfiAttributes);s=o.reduce((n,r)=>{if(r.type===`geometry`)return[...n,r];if(!t.includes(r.key))return n;let i=e.gfiAttributes[r.key],a=Qk(r,i);return[...n,{...r,label:a}]},[])}return Array.isArray(t)&&s.forEach(e=>{t.forEach(t=>{t.key===e.key&&(e.value=t.value)})}),s}function Qk(e,t){return typeof t==`string`?t:typeof t==`object`&&!Array.isArray(t)&&typeof t?.name==`string`?t.name:e.label}var $k={prepareFeatureProperties:Zk};async function eA(e,t){let{featureMap:n,isVoidFeature:r}=await tA(e),i=nA(n);$.getters[`Modules/Wfst/processedMultiPolygons`]&&r&&i&&rA(i,t)}async function tA(e){let t=new Map,n=$.getters[`Modules/Wfst/processedMultiPolygons`],r=!1,i=!1;for(let a=0;a<e.length;a++){let o=e[a],s={};for(let t=0;t<e.length;t++){let a=e[t];o.ol_uid!==a.ol_uid&&o.getGeometry()?.getCoordinates?.()?.[0]?.[0].every(e=>a.getGeometry()?.intersectsCoordinate(e))&&!n?.has(o)&&(s=a,r=!0,i=await iA())}s?.ol_uid&&i?t.set(o.ol_uid,{outerId:s.ol_uid,feature:o}):(t.set(o.ol_uid,{outerId:`0`,feature:o}),$.commit(`Modules/Wfst/addProcessedMultiPolygon`,o))}return{featureMap:t,isVoidFeature:r}}function nA(e){return Array.from(e).sort((e,t)=>
22(Number(e[1].outerId)===0?Number(e[0]):Number(e[1].outerId))-(Number(t[1].outerId)===0?Number(t[0]):Number(t[1].outerId)))}async function rA(e,t){let n=e.filter(e=>e?.[1]?.outerId!==`0`);if(n)for(let r of n){let n=e.filter(e=>e[0]===r[1]?.outerId).find(e=>e[0]===r[1]?.outerId),i=n[1]?.feature?.getGeometry()?.getCoordinates()?.[0],a=r[1]?.feature?.getGeometry()?.getCoordinates()?.[0];a&&i&&i.push(...a),n[1]?.feature?.getGeometry()?.setCoordinates([i]),t.getSource().removeFeature(r[1].feature)}}async function iA(){let e;return await new Promise(t=>{$.commit(`Modules/Wfst/setShowVoidModal`,{actionConfirmedCallback:()=>{e=!0,t()},actionDeniedCallback:()=>{e=!1,t()}},{root:!0})}),e}function aA(e,t){let n=[];return e.forEach(e=>{n.push(...e.getGeometry().getCoordinates())}),e[0]?.getGeometry()?.setCoordinates(n),e.forEach((e,n)=>{n!==0&&t.getSource().removeFeature(e)}),e[0]}async function oA(e,t){let n=new Set;return e[0].getGeometry().getCoordinates().forEach(e=>{let t=new V({geometry:new Fn([e])});n.add(t)}),e.forEach((e,t)=>{if(t!==0){let t=e.clone();t.setId(e.getId()),n.add(t)}}),t.getSource().clear(),n.forEach(e=>{t.getSource().addFeature(e)}),Array.from(n)}y();var sA=1e4,cA,lA,Q,uA,dA,fA=[],pA,mA=[],hA,gA,_A,vA,yA,bA=null,xA=null,SA=null,CA={};function wA(e){clearTimeout(bA),bA=null,e(`setLayerLoading`,!1)}function TA(e,t){CA={start:()=>{t(`setLayerLoading`,!0),clearTimeout(bA),bA=setTimeout(()=>wA(t),sA)},end:()=>{clearTimeout(bA),bA=setTimeout(()=>wA(t),500)},error:()=>{clearTimeout(bA),bA=setTimeout(()=>wA(t),500)}},e.on(`featuresloadstart`,CA.start),e.on(`featuresloadend`,CA.end),e.on(`featuresloaderror`,CA.error),SA=e,e.loading&&CA.start()}var EA={clearInteractions({dispatch:e,state:t}){let n=mapCollection.getMap(`2D`);cA&&e(`Maps/removeInteraction`,cA,{root:!0}),uA&&e(`Maps/removeInteraction`,uA,{root:!0}),hA&&e(`Maps/removeInteraction`,hA,{root:!0}),vA&&e(`Maps/removeInteraction`,vA,{root:!0}),n.removeLayer(Q),cA=void 0,uA=void 0,hA?.getFeatures().clear(),hA=void 0,_A?.setActive(!1),gA?.setActive(!1),gA=void 0,_A=void 0,vA=void 0,Q=void 0,t.anyInputValue={}},prepareEditButton({dispatch:e,getters:t,commit:n}){e(`clearInteractions`),n(`setButtonsDisabled`,!0),$.watch(()=>t.featureProperties,e=>{e.length&&n(`setButtonsDisabled`,!1)},{deep:!0})},handleLayerSelected({state:e,dispatch:t}){e.showLayerLoader&&t(`startLayerLoader`),e.activateLayerInTree&&t(`activateSelectedLayer`)},activateSelectedLayer({getters:e,rootGetters:t,dispatch:n,commit:r}){let{currentLayerId:i,managedLayer:a}=e;if(a?.id===i||(n(`restoreManagedLayer`),!i))return;let o=t.layerConfigById(i);r(`setManagedLayer`,{id:i,visibility:o?.visibility,showInLayerTree:o?.showInLayerTree,zIndex:o?.zIndex}),n(`replaceByIdInLayerConfig`,{layerConfigs:[{id:i,layer:{id:i,visibility:!0,showInLayerTree:!0}}]},{root:!0})},restoreManagedLayer({getters:e,dispatch:t,commit:n}){let{managedLayer:r}=e;r&&(t(`replaceByIdInLayerConfig`,{layerConfigs:[{id:r.id,layer:{id:r.id,visibility:!!r.visibility,showInLayerTree:!!r.showInLayerTree,zIndex:r.zIndex??null}}]},{root:!0}),t(`updateAllZIndexes`,null,{root:!0}),n(`setManagedLayer`,null))},startLayerLoader({getters:e,commit:t}){let n=W.getLayerById(e.currentLayerId)?.getLayerSource();if(wA(t),xA&&=(clearInterval(xA),null),SA&&=(SA.un(`featuresloadstart`,CA.start),SA.un(`featuresloadend`,CA.end),SA.un(`featuresloaderror`,CA.error),null),n)TA(n,t);else{let r=0;xA=setInterval(()=>{n=W.getLayerById(e.currentLayerId)?.getLayerSource(),r++,n?(clearInterval(xA),xA=null,TA(n,t)):r>40&&(clearInterval(xA),xA=null)},50)}},async prepareInteraction({dispatch:e,getters:t,rootGetters:n,commit:r},i){e(`clearInteractions`);let{currentLayerId:a,currentLayerIndex:o,layerInformation:s,featureProperties:c,toggleLayer:l}=t,u=W.getLayerById(a).layer,d=c.find(e=>e.type!==`geometry`&&e.required);switch(i){case`LineString`:case`Point`:case`Polygon`:case`MultiPolygon`:r(`setSelectedUpdate`,`insert`),e(`handleDrawInteraction`,{sourceLayer:u,interaction:i,featureProperties:c,currentLayerIndex:o,layerInformation:s,rootGetters:n,toggleLayer:l,currentLayerId:a,shouldValidateForm:d});break;case`update`:r(`setSelectedUpdate`,`singleUpdate`),e(`handleUpdateInteraction`,{sourceLayer:u,featureProperties:c,shouldValidateForm:d});break;case`multiUpdate`:r(`setSelectedUpdate`,`multiUpdate`),e(`handleMultiUpdateInteraction`,{sourceLayer:u,featureProperties:c});break;case`delete`:e(`handleDeleteInteraction`,{sourceLayer:u});break;default:break}}
22,async handleDrawInteraction(e,t){let{commit:n,dispatch:r}=e,{sourceLayer:a,interaction:o,featureProperties:s,rootGetters:c,toggleLayer:l,currentLayerId:u,shouldValidateForm:d,layerInformation:f,currentLayerIndex:p}=t,{style:m}=f[p],h={};Q=await r(`Maps/addNewLayerIfNotExists`,{layerName:`module/wfsTransaction/wfsTransaction/vectorLayer`,id:`module/wfsTransaction/wfsTransaction/vectorLayer`},{root:!0}),Q=new Rt({id:`module/wfsTransaction/wfsTransaction/vectorLayer`,name:`module/wfsTransaction/wfsTransaction/vectorLayer`,source:new Pe,alwaysOnTop:!0,zIndex:10}),r(`Maps/addLayer`,Q,{root:!0}),h={source:Q.getSource(),type:o,stopClick:!0,geometryName:s.find(({type:e})=>e===`geometry`)?.key},o===`Point`&&(h.style=m),cA=new i(h),uA=new je({source:Q.getSource(),condition:e=>te(e)&&!Dn(e)}),vA=new $e({layers:[Q],condition:e=>te(e)&&Dn(e)}),Q.setStyle(m),l&&a?.setVisible(!1),cA.on(`drawend`,async e=>{o===`MultiPolygon`&&(await xn(),await eA(await Q?.getSource()?.getFeatures(),Q),n(`setSelectedInteraction`,`insert`)),o!==`MultiPolygon`&&(n(`setSelectedInteraction`,`insert`),a.getSource().addFeature(e.feature),Q.getSource().clear(),r(`validateMinMaxScale`,{dispatch:r,rootGetters:c,currentLayerId:u}),r(`Maps/removeInteraction`,cA,{root:!0})),r(`Maps/addInteraction`,uA,{root:!0}),r(`Maps/addInteraction`,vA,{root:!0})}),r(`Maps/addInteraction`,cA,{root:!0}),d&&r(`validateForm`,s)},handleUpdateInteraction(e,t){let{commit:n,dispatch:r}=e,{sourceLayer:i,featureProperties:a,shouldValidateForm:o}=t,s,c,l;hA=new tt({layers:[i]}),yA=hA.getFeatures(),yA.on(`add`,e=>{if(a.length===0){r(`clearInteractions`);return}n(`setSelectedInteraction`,`selectedUpdate`),c=e.element,l=e.target,s&&s!==c&&s.set(`selected`,!1),c.set(`selected`,!0),dA=c.clone(),pA=c.getId(),dA.setId(pA),r(`addModifyAndTranslateInteractions`,{dispatch:r,target:l}),n(`setFeatureProperties`,a.map(t=>({...t,value:dA?dA.get(t.key):e.element.get(t.key),valid:!0}))),o&&(r(`validateForm`,a),n(`setIsFormDisabled`,!1)),s=c}),r(`Maps/addInteraction`,hA,{root:!0})},handleMultiUpdateInteraction(e,t){let{commit:n,dispatch:r,state:i}=e,{sourceLayer:a,featureProperties:o}=t,s,c,l,u;hA=new tt({condition:p,multi:!0,layers:[a],addCondition:p,removeCondition:p}),yA=hA.getFeatures(),r(`handleSelectInteraction`,{interactionToActivate:hA,interactionsToDeactivate:[gA,_A]}),n(`setSelectedInteraction`,`selectedUpdate`),yA.on(`add`,e=>{c=e.target,s=e.element,s.set(`selected`,!0),yA.getArray().forEach(e=>{r(`processSelectedFeature`,{newSelectedFeature:e,featureProperties:o,target:c})})}),yA.on(`remove`,e=>{l=e.element,l.set(`selected`,!1),u=fA.findIndex(e=>e.getId()===l.getId()),u!==-1&&(fA.splice(u,1),mA.splice(u,1),i.featurePropertiesBatch.splice(u,1))}),r(`Maps/addInteraction`,hA,{root:!0})},handleLassoInteraction({dispatch:e,getters:t}){let n=new Pe,r=new Rt({source:n}),{currentLayerId:a}=t,o=W.getLayerById(a)?.layer,s,c;gA=new i({source:n,multi:!0,type:`Polygon`,freehand:!0}),e(`Maps/addLayer`,r,{root:!0}),e(`handleSelectInteraction`,{interactionToActivate:gA,interactionsToDeactivate:[hA,_A]}),yA=hA.getFeatures(),gA.on(`drawend`,e=>{if(!e.feature){console.warn(`No feature drawn in the event.`);return}s=e.feature.getGeometry(),c=o.getSource().getFeatures().filter(e=>s.intersectsExtent(e.getGeometry().getExtent())),c.forEach(e=>{yA.getArray().includes(e)||yA.push(e)}),setTimeout(()=>{n.clear()},150)}),e(`Maps/addInteraction`,gA,{root:!0})},handleBoxInteraction({dispatch:e,getters:t}){let n=new Pe,r=new Rt({source:n}),{currentLayerId:i}=t,a=W.getLayerById(i)?.layer;_A=new An({layers:[a]}),e(`Maps/addLayer`,r,{root:!0}),e(`handleSelectInteraction`,{interactionToActivate:_A,interactionsToDeactivate:[hA,gA]}),yA=hA.getFeatures(),_A.on(`boxend`,()=>{let e=_A.getGeometry().getExtent();a.getSource().getFeatures().filter(t=>
22e&&t.getGeometry().intersectsExtent(e)).forEach(e=>{yA.getArray().includes(e)||yA.push(e)})}),_A.on(`boxstart`,()=>{n.clear()}),e(`Maps/addInteraction`,_A,{root:!0})},handleClickInteraction(){hA.setActive(!0),_A&&_A.setActive(!1),gA&&gA.setActive(!1)},handleSelectInteraction(e,t){let{interactionToActivate:n,interactionsToDeactivate:r}=t;n.setActive(!0),r.forEach(e=>{e?.setActive(!1)})},processSelectedFeature(e,t){let{commit:n,state:r}=e,{newSelectedFeature:i,featureProperties:a}=t,o;n(`setSelectedInteraction`,`selectedUpdate`),pA=i.getId(),dA=i.clone(),dA.setId(pA),fA.some(e=>e.getId()===dA.getId())||(fA.push(dA),mA.push(pA),o=a.map(e=>({...e,value:fA[fA.length-1]?.get(e.key)})),n(`setFeatureProperties`,o),r.featurePropertiesBatch.includes(o)||r.featurePropertiesBatch.push(o))},handleDeleteInteraction(e,t){let{commit:n,dispatch:r}=e,{sourceLayer:i}=t;n(`setSelectedInteraction`,`delete`),hA=new tt({layers:[i]}),hA.on(`select`,e=>{lA=e.selected[0],n(`setShowConfirmModal`,!0),r(`Maps/removeInteraction`,hA,{root:!0})}),r(`Maps/addInteraction`,hA,{root:!0}),lA=null},addModifyAndTranslateInteractions(e,t){let{dispatch:n}=e,{target:r}=t;uA=new je({features:r,condition:e=>te(e)&&!Dn(e)}),vA=new $e({features:r,condition:e=>te(e)&&Dn(e)}),n(`Maps/addInteraction`,uA,{root:!0}),n(`Maps/addInteraction`,vA,{root:!0})},async handleMultipolygonCreation(e,t){let{dispatch:n}=e,{target:r}=t;if(r.getArray()?.[0]?.get(`geom`)?.getType()!==`MultiPolygon`)n(`Maps/removeInteraction`,hA,{root:!0});else{Q=await n(`Maps/addNewLayerIfNotExists`,{layerName:`tool/wfsTransaction/vectorLayer`},{root:!0}),oA([r.element],Q),hA.getFeatures().clear(),t.sourceLayer.setVisible(!1),Q.getSource().getFeatures().length>
220&&Q.getSource().getFeatures().forEach(e=>{hA.getFeatures().push(e)});let e={source:Q.getSource(),type:`MultiPolygon`,geometryName:t.featureProperties.find(({type:e})=>e===`geometry`)?.key},a={layers:[Q],condition:e=>te(e)&&Dn(e)},o={source:Q.getSource(),condition:e=>te(e)&&!Dn(e)},s=hA.getStyle();Q.setStyle(s),uA=new je(o),vA=new $e(a),cA=new i(e),cA.on(`drawstart`,()=>{Q.setStyle(t.layerInformation[t.currentLayerIndex].style)}),cA.on(`drawend`,async()=>{await xn();let e=await Q.getSource().getFeatures();await xn(),await eA(e,Q),Q.setStyle(s)}),n(`Maps/addInteraction`,cA,{root:!0})}},validateMinMaxScale(e,t){let{dispatch:n,rootGetters:r}=e,{currentLayerId:i}=t,a=W.getLayerById(i),o=r[`Maps/scale`];(a.get(`minScale`)&&o<a.get(`minScale`)||a.get(`maxScale`)&&o>a.get(`maxScale`))&&(Q.getSource().once(`change`,()=>Q.getSource().clear()),n(`Alerting/addSingleAlert`,{category:`error`,content:i18next.t(`common:modules.wfst.error.geometryOutOfRange`),mustBeConfirmed:!1},{root:!0}))},reset({commit:e,dispatch:t,getters:n}){let r=W.getLayerById(n.currentLayerId)?.layer,i=Array.isArray(n.featureProperties);t(`resetCommon`,!0),e(`setFeatureProperties`,i?n.featureProperties.map(e=>({...e,value:null})):n.featureProperties),e(`setFeaturePropertiesBatch`,[]),dA&&(r?.getSource().getFeatures().find(e=>e.getId()===dA.getId())?.setGeometry(dA.getGeometry()),r?.getSource().refresh(),dA=void 0,pA=void 0,fA=[],mA=[])},resetCancel({dispatch:e}){e(`resetCommon`,!1)},resetCommon(e){let{commit:t,dispatch:n,getters:r}=e,i=W.getLayerById(r.currentLayerId)?.layer,a=Array.isArray(r.featureProperties);t(`setSelectedInteraction`,null),t(`setSelectedUpdate`,null),n(`clearInteractions`),a&&(i?.getSource().refresh(),i?.setVisible(!0))},async save({dispatch:e,getters:t,commit:n}){let r=null,i,a=dA||Q.getSource().getFeatures()?.[0],{currentLayerIndex:o,featureProperties:s,layerInformation:c,selectedInteraction:l}=t,u=t.savingErrorMessage(a),d=dA||Q?.getSource()?.getFeatures().filter(e=>e.getGeometry().getType()===`MultiPolygon`),f=c[o].id,p=dA?W.getLayerById(f).getLayerSource().getFeatures().find(e=>e.getId()===pA):a;if(n(`setButtonsDisabled`,!0),u.length>0){e(`Alerting/addSingleAlert`,{category:`Info`,displayClass:`info`,content:u,mustBeConfirmed:!1},{root:!0});return}d.length!==0&&Q&&(d.length>1?(i=aA(d,Q),i.setId(pA)):(i=d[0],i.setId(pA))),r=await Xk({id:a.getId()||pA,geometryName:s.find(({type:e})=>e===`geometry`)?.key,geometry:d&&i?i.getGeometry():p.getGeometry()},s,l===`selectedUpdate`,c[o].featurePrefix),await e(`sendTransaction`,r),n(`setButtonsDisabled`,!1),e(`reset`)},async saveMulti({dispatch:e,getters:t,commit:n}){let{currentLayerIndex:r,featurePropertiesBatch:i,layerInformation:a,selectedInteraction:o,multiUpdate:s}=t,c=a[r].id,l=a[r],u=fA||Q.getSource().getFeatures(),d=s.find(e=>e.layerId===l.id).configAttributes,f,p=0,m;n(`setButtonsDisabled`,!0);for(let n of u){let s=t.savingErrorMessage(n);if(s.length>0){e(`Alerting/addSingleAlert`,{category:`Info`,displayClass:`info`,content:s,mustBeConfirmed:!1},{root:!0});continue}if(m=p,fA[m]){let e=mA[m];e!==-1&&(f=W.getLayerById(c).getLayerSource().getFeatures().find(t=>t.getId()===e))}else f=n;p<i.length?await e(`sendTransaction`,await Xk({id:n.getId()||mA[p],geometryName:n.getGeometryName(),geometry:f.getGeometry()},i[m],o===`selectedUpdate`,a[r].featurePrefix,d)):console.warn(`No properties found for feature at index ${p}`),p++}n(`setButtonsDisabled`,!1),e(`reset`)},async sendTransaction({dispatch:e,getters:t,rootGetters:n},r){let{currentLayerIndex:i,layerInformation:a,selectedInteraction:o,featurePropertiesBatch:s,multiUpdate:c}=t,l=a[i],u=r&&lA!==null?r:lA,d=l.url,f=/:$/,p=`success.${[`LineString`,`Point`,`Polygon`].includes(o)?`insert`:o}`,m=i18next.t(`common:modules.wfst.transaction.`+p),h,g,_,v,ee,te;l.featurePrefix=l.featurePrefix.replace(f,``);try{h=await kn.sendTransaction(n[`Maps/projectionCode`],u,d,l,o)}catch(t){await e(`Alerting/addSingleAlert`,{category:`Info`,displayClass:`info`,content:i18next.t(`Error: ${t.message}`),mustBeConfirmed:!1},{root:!0}),h=null}finally{let t=``;s.length>0&&(ee=c.find(e=>e.layerId===l.id).configAttributes,te=c.find(e=>e.layerId===l.id).controlAttributes,t=`</br></br>`+s.length+i18next.t(`common:modules.wfst.transaction.success.batchInfo`,{layer:i18next.t(l.name)}
22)+`<ul>`+s.map(e=>(g=ee.map(t=>e.find(e=>e.key===t)?.value).filter(e=>e!==void 0),_=te.map(t=>{let n=e.find(e=>e.key===t);return n?`${n.key} "${n.value}"`:null}).filter(e=>e!==null),v=_.join(`, `),v?`<li>${g}: ${v}</li>`:``)).join(``)+`</ul>`),o!==`selectedUpdate`&&W.getLayerById(l.id).getLayerSource().refresh(),h!==null&&e(`Alerting/addSingleAlert`,{category:`success`,content:i18next.t(`common:modules.wfst.transaction.success.baseSuccess`,{transaction:m})+t},{root:!0}),o!==`selectedUpdate`&&await e(`reset`)}return h},validateInput({commit:e},t){if(t.type===`number`){let n=t.value.length>0,r=!Number.isNaN(Number(t.value)),i=n&&r;e(`setFeatureProperty`,{...t,valid:i})}else if(t.type===`text`){let n=/^[A-Za-z0-9 [\]öäüÃÃÃÃ,/\\.-]*$/.test(t.value),r=/^[0-9]*$/.test(t.value),i=n&&!r;e(`setFeatureProperty`,{...t,valid:i})}else if(t.type===`date`){let n=41338944e5>Date.parse(t.value);e(`setFeatureProperty`,{...t,valid:n})}},validateForm({commit:e},t){e(`setIsFormDisabled`,!!t.find(e=>e.type!==`geometry`&&e.required&&e.valid!==!0))},updateFeatureProperty({dispatch:e,commit:t,getters:{featureProperties:n}},r){r.required?(e(`validateInput`,r),e(`validateForm`,n)):t(`setFeatureProperty`,{...r,key:r.key,value:r.value})},setFeatureProperty({commit:e,dispatch:t},{key:n,type:r,value:i}){if(r===`number`&&!Number.isFinite(parseFloat(i))){t(`Alerting/addSingleAlert`,{category:`Info`,displayClass:`info`,content:i18next.t(`common:modules.wfst.error.onlyNumbersAllowed`),mustBeConfirmed:!1},{root:!0});return}e(`setFeatureProperty`,{key:n,value:i})},setFeaturesBatchProperty({commit:e,dispatch:t,state:n},{key:r,type:i,value:a}){if(i===`number`&&!Number.isFinite(parseFloat(a))){t(`Alerting/addSingleAlert`,{category:`error`,content:i18next.t(`common:modules.wfst.error.onlyNumbersAllowed`),mustBeConfirmed:!1},{root:!0});return}a===``?delete n.anyInputValue[r]:n.anyInputValue[r]=a,e(`setFeaturesBatchProperty`,{key:r,value:a})},async setFeatureProperties({commit:e,getters:{currentLayerIndex:t,layerInformation:n,featurePropertiesValues:r}}){if(t===-1){e(`setFeatureProperties`,i18next.t(`common:modules.wfst.error.allLayersNotSelected`));return}let i=n[t];if(!Object.prototype.hasOwnProperty.call(i,`featurePrefix`)){e(`setFeatureProperties`,i18next.t(`common:modules.wfst.error.layerNotConfiguredCorrectly`));return}if(!i.visibility){e(`setFeatureProperties`,i18next.t(`common:modules.wfst.error.layerNotSelected`));return}e(`setFeatureProperties`,await $k.prepareFeatureProperties(i,r))}},DA={LineString:{available:!1,icon:`bi-slash-lg`,multi:!1,text:`common:modules.wfst.interactionSelect.line`},Point:{available:!1,icon:`bi-record-circle`,multi:!1,text:`common:modules.wfst.interactionSelect.point`},Polygon:{available:!1,icon:`bi-hexagon-fill`,multi:!1,text:`common:modules.wfst.interactionSelect.polygon`},MultiPolygon:{available:!1,icon:`bi-hexagon-fill`,multi:!1,text:`common:modules.wfst.interactionSelect.multiPolygon`},update:{available:!1,icon:`bi-pencil-square`,text:`common:modules.wfst.interactionSelect.update`},multiUpdate:{available:!1,icon:`bi-pencil-square`,text:`common:modules.wfst.interactionSelect.multiUpdate`},delete:{available:!1,icon:`bi-trash`,text:`common:modules.wfst.interactionSelect.delete`}};function OA(e){if(typeof e!=`object`||!e)return e;if(e instanceof Date){let t=new Date;return t.setTime(e.getTime()),t}if(e instanceof Array){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=OA(e[n]);return t}if(e instanceof Object){let t={};for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=OA(e[n]));return t}throw Error(`Unable to copy obj this object.`)}var kA={...H(Yk),currentInteractionConfig(e,{currentLayerId:t}){let n=OA(DA);return[`LineString`,`Point`,`Polygon`,`MultiPolygon`,`update`,`multiUpdate`,`delete`].forEach(r=>{let i=[`LineString`,`Point`,`Polygon`,`MultiPolygon`].includes(r),a,o=null;if(a=i?e[(r.endsWith(`String`)?r.replace(`String`,``):r).toLowerCase()+`Button`]:e[r],a){if(typeof a==`string`){n[r].text=a,n[r].available=!0;return}if(typeof a==`boolean`){n[r].available=!0;return}o=a.find(({layerId:e})=>e===t),o!==void 0&&(n[r].available=o.available,o.text!==void 0&&(n[r].text=o.text?o.text:n[r].text),n[r].icon=o.icon?o.icon:n[r].icon,i&&(n[r].multi=o.multi?o.multi:!1))}}),n},currentLayerId(e){return e.layerInformation[e.currentLayerIndex]?.id},layerSelectDisabled({currentLayerIndex:e},{showInteractionsButtons:t}){return e===-1||!t},savingErrorMessage:e=>t=>{let n=e.featureProperties.filter(e=>e.type!==`geometry`&&e.required&&[null,void 0,``].includes(e.value));return t instanceof V?n.length>0?i18next.t(`common:modules.wfst.error.requiredPropertiesNotSet`,{properties:n.map(({label:e})=>e).join(`, `)}):``:i18next.t(`common:modules.wfst.error.noFeature`)},showInteractionsButtons(e){return[null,`delete`,`update`,`multiUpdate`].includes(e.selectedInteraction)},interactionsDisabled(e){return e.buttonsDisabled||e.layerLoading}},AA={namespaced:!0,state:Yk,actions:EA,mutations:{...U(Yk),setFeatureProperty({featureProperties:e},{key:t,value:n,valid:r,required:i}){e.find(e=>e.key===t).value=n,e.find(e=>e.key===t).valid=r,e.find(e=>e.key===t).required=i},setFeaturesBatchProperty({featurePropertiesBatch:e},{key:t,value:n}
22){e.forEach(e=>{e.find(e=>e.key===t).value=n})},addProcessedMultiPolygon({processedMultiPolygons:e},t){e.add(t)},setShowVoidModal(e,t){e.showVoidModal=!0,e.voidModalCallback=t},setHideVoidModal(e){e.showVoidModal=!1,e.voidModalCallback=null}},getters:kA},jA={layerAppendix:`_secondLayer`,windowWidth:1280,visibility:!0,timeSlider:{active:!1,currentLayerId:``,objects:[],playbackDelay:1,playing:!1}},MA={windowWidthChanged({commit:e,dispatch:t,state:n,getters:r,rootGetters:i}){r.windowWidth!==window.innerWidth&&(e(`setWindowWidth`),!r.minWidth&&i[`Modules/LayerSwiper/active`]&&t(`toggleSwiper`,n.timeSlider.currentLayerId+n.layerAppendix))},watchVisibleLayerConfig({commit:e,state:t,rootGetters:n}){n.visibleLayerConfigs.forEach(t=>{t.typ===`WMS`&&t.time&&(e(`setTimeSliderActive`,{active:!0,currentLayerId:t.id,playbackDelay:t.time?.playbackDelay||1}),e(`setVisibility`,!0))}),$.watch((e,t)=>t.visibleLayerConfigs,r=>{if(!t.timeSlider.active)r.forEach(t=>{t.typ===`WMS`&&t.time&&!n[`Modules/CompareMaps/active`]&&(e(`setTimeSliderActive`,{active:!0,currentLayerId:t.id,playbackDelay:t.time?.playbackDelay||1}),e(`setVisibility`,!0))});else if(t.timeSlider.active){let i=n.layerConfigById(t.timeSlider.currentLayerId),a=r.find(e=>e.id===i?.id),o=n[`Modules/LayerSwiper/active`];!a&&!o&&(e(`setTimeSliderActive`,{active:!1,currentLayerId:``,objects:[],playbackDelay:1,playing:!1}),e(`setVisibility`,!1))}},{deep:!0})},deactivateLayerSwiper({commit:e,state:t}){let n=t.timeSlider.currentLayerId+t.layerAppendix;Du(W.getLayerById(n)),Du(W.getLayerById(t.timeSlider.currentLayerId)),e(`Modules/LayerSwiper/setActive`,!1,{root:!0}),e(`Modules/LayerSwiper/setSourceLayerId`,null,{root:!0}),e(`Modules/LayerSwiper/setTargetLayerId`,null,{root:!0})},async toggleSwiper({commit:e,state:t,getters:n,dispatch:r,rootGetters:i},a){let o=i[`Modules/LayerSwiper/active`];e(`Modules/LayerSwiper/setActive`,!o,{root:!0});let s=a.endsWith(t.layerAppendix),c=s?a.replace(t.layerAppendix,``):a,l=c+t.layerAppendix,u=o?l:c,d=W.getLayerById(u),f=d?.getLayerSource?.().getParams?.()[n.defaultDimensionName]??n.defaultValue;if(o){let t=W.getLayerById(l),i=W.getLayerById(c),a=(s?i:t)?.getLayerSource?.().getParams?.()[n.defaultDimensionName]??f;if(Du(t),Du(i),!s&&i){let{transparency:e}=d?.attributes||{};i.updateTime?.(c,n.defaultDimensionName,f),r(`replaceByIdInLayerConfig`,{layerConfigs:[{id:c,layer:{id:c,transparency:e}}]},{root:!0})}a&&e(`setTimeSliderDefaultValue`,a),r(`replaceByIdInLayerConfig`,{layerConfigs:[{id:l,layer:{id:l,visibility:!1,showInLayerTree:!1,zIndex:d?.attributes?.zIndex}}]},{root:!0}),e(`Modules/LayerSwiper/setSourceLayerId`,null,{root:!0}),e(`Modules/LayerSwiper/setTargetLayerId`,null,{root:!0})}else{let{name:t,time:a,url:o,level:s,layers:u,version:p,parentId:m,gfiAttributes:h,featureCount:g}=d.attributes,_=d.attributes.zIndex,v=typeof _==`number`?_+1:void 0;typeof v==`number`&&r(`updateLayerConfigZIndex`,{layerContainer:i.allLayerConfigs.filter(e=>_r.hasNumericZIndex(e)),maxZIndex:_},{root:!0}),e(`Modules/LayerSwiper/setSourceLayerId`,c,{root:!0}),e(`Modules/LayerSwiper/setTargetLayerId`,l,{root:!0}),W.getLayerById(l)?r(`replaceByIdInLayerConfig`,{layerConfigs:[{id:l,layer:{id:l,visibility:!0,showInLayerTree:!0,zIndex:v}}]},{root:!0}):(await r(`addLayerToLayerConfig`,{layerConfig:{id:l,name:t+`_second`,showInLayerTree:!0,typ:`WMS`,type:`layer`,visibility:!0,time:a,url:o,level:s,layers:u,version:p,parentId:m,legendURL:`ignore`,gfiAttributes:h,featureCount:g,zIndex:v},parentKey:er},{root:!0}),typeof v==`number`&&r(`replaceByIdInLayerConfig`,{layerConfigs:[{id:l,layer:{id:l,zIndex:v}}]},{root:!0})),W.getLayerById(l)?.updateTime?.(l,n.defaultDimensionName,f)}}};function NA(e,t){return t.length>0&&e!==``&&t.find(({layerId:t})=>e===t)||{}}var PA={namespaced:!0,state:jA,actions:MA,getters:{...H(jA),currentTimeSliderObject({timeSlider:{currentLayerId:e,objects:t}}){return NA(e,t)},defaultValue(e,{currentTimeSliderObject:t}){return t.defaultValue},defaultValueEnd(e,{currentTimeSliderObject:t}){return t.defaultValueEnd},defaultDimensionName(e,{currentTimeSliderObject:t}){return t.dimensionName||`time`},dualRangeSlider(e,{currentTimeSliderObject:t}){return t?.dualRangeSlider||!1},minWidth({windowWidth:e}){return e>800},staticDimensions(e,{currentTimeSliderObject:t}){return t?.staticDimensions||{}},timeRange(e,{currentTimeSliderObject:t}){return t?.timeRange||[]},displayFormat(e,{currentTimeSliderObject:t}){return t?.displayFormat},displayTimezone(e,{currentTimeSliderObject:t}){return t?.displayTimezone}},mutations:{...U(jA),setWindowWidth(e){e.windowWidth=window.innerWidth},addTimeSliderObject(e,t){e.timeSlider.objects=[...e.timeSlider.objects,t]},setTimeSliderActive({timeSlider:e},{active:t,currentLayerId:n,playbackDelay:r}){e.active=t,e.currentLayerId=n,e.playbackDelay=r},setTimeSliderDefaultValue({timeSlider:{currentLayerId:e,objects:t}},n){let r=NA(e,t);r&&(r.defaultValue=n)},setTimeSliderPlaying({timeSlider:e},t){e.playing=t}}},FA={namespaced:!0,getters:Hl,modules:{AddWMS:{...Kl},BaselayerSwitcher:{...Ql},BufferAnalysis:{...lu},Contact:{...Cu},CoordToolkit:{...Lf},CompareMaps:{...Au},CompareFeatures:{...Pu},Draw:{...Hf},Draw_old:{...Hm},FeatureLister:{...Ch},FileImport:{...Lh},Filter:{...Xh},GetFeatureInfo:{...hg},GraphicalSelect:{...wg},Language:{...Og},LayerClusterToggler:{...Ng},LayerPills:{...Ig},LayerPreview:{...Vg},LayerSelection:{...Jg},LayerSlider:{...$g},LayerSwiper:{...a_},LayerTree:{...s_},Legend:{...R_},Login:{...B_},Measure:{...bv},Modeler3D:{...Pv},MouseHover:{...Iv},News:{...Rv},OpenConfig:{...Uv},ResizeHandle:{...gy},Routing:{...RD},PortalFooter:{...qv},Print:{...fy},ScaleSwitcher:{...UD},SearchBar:{...ok},SelectFeatures:{...dk},Shadow:{...hk},ShareView:{...xk},StatisticDashboard:{...wk},StyleVT:{...kk},WfsSearch:{...Jk},Wfst:{...AA},WmsTime:{...PA}}},IA=t({default:()=>$}),$=h({state:Jn,getters:vr,mutations:yr,actions:ia,modules:{Alerting:_a,Controls:xc,Maps:ul,Menu:Vl,Modules:FA}});function LA(e={},t={}){let n={};
22[e,t].forEach(e=>{Object.keys(e).forEach(t=>{let r=$.getters.getUrlParamValue(t);r!==void 0&&(n[t]=r,typeof e[t]==`function`&&e[t](n))})})}var RA={CONFIGJSON:VA,LNG:HA,UISTYLE:UA},zA={CONFIG:VA,STYLE:UA};function BA(){LA(RA,zA)}function VA(e){Config.portalConf=e.CONFIGJSON||e.CONFIG}function HA(e){i18next.changeLanguage(e.LNG)}function UA(e){Config.uiStyle=e.UISTYLE||e.STYLE}function WA(){let e=null;return new URLSearchParams(window.location.search).forEach((t,n)=>{if(n.toLowerCase().localeCompare(`configjs`)===0)if(t.startsWith(`https://`))e=t;else{let n=window.location.href.split(`?`).shift();e=n.substring(0,n.lastIndexOf(`/`)+1)+t}}),e}var GA={getConfigJsPath:WA,processGlobalUrlParams:BA};y();var KA={name:`SwitchInput`,props:{id:{type:String,required:!0},label:{type:String,required:!0},aria:{type:String,required:!0},disabled:{type:Boolean,default:null,required:!1},checked:{type:Boolean,default:null,required:!1},interaction:{type:Function,required:!1,default:()=>!0}}},qA={class:`form-check form-switch`},JA=[`id`,`aria-label`,`disabled`,`checked`],YA=[`for`];function XA(e,t,n,r,i,a){return v(),M(`div`,qA,[z(`input`,{id:n.id,type:`checkbox`,role:`switch`,"aria-checked":`mixed`,"aria-label":n.aria,class:`form-check-input`,disabled:n.disabled,checked:n.checked,onChange:t[0]||=(...e)=>n.interaction&&n.interaction(...e)},null,40,JA),z(`label`,{class:`form-check-label ps-2 pt-1 me-2`,for:n.id},I(e.$t(n.label)),9,YA)])}var ZA=K(KA,[[`render`,XA],[`__scopeId`,`data-v-f88ab59f`]]);y();var QA={name:`AlertingItem`,components:{SwitchInput:ZA},data(){return{availableLocalStorage:!1,currentUrl:document.URL.replace(/#.*$/,``).replace(/\/*\?.*$/,`/`).replace(/\bwww.\b/,``),unsubscribeAction:null,sortedAlertsSwitch:`initial`}},computed:{...N(`Alerting`,[`alerts`,`alertWindowTitle`,`configPaths`,`displayedAlerts`,`fetchBroadcastUrl`,`initialAlerts`,`moduleOpenAlerts`,`initialClosed`,`localStorageDisplayedAlertsKey`,`showTheModal`,`sortedAlerts`,`type`,`displayOnEventList`]),console:()=>console},created(){try{localStorage&&(this.availableLocalStorage=!0)}catch{this.availableLocalStorage=!1,console.error(`Spelling localestorage is not available in this application. Please allow third party cookies in your browser!`)}this.unsubscribeAction=this.$store.subscribeAction(e=>{this.checkForEventAlerts(e)})},mounted(){this.initializeModule({configPaths:this.configPaths,type:this.t
22ype}),this.fetchBroadcastUrl!==void 0&&this.fetchBroadcastUrl!==!1&&this.fetchBroadcast(this.fetchBroadcastUrl),this.addAlertsFromConfig(this.initialAlerts),this.addModuleOpenAlertsFromConfig(this.moduleOpenAlerts)},unmounted(){this.unsubscribeAction&&this.unsubscribeAction()},methods:{...w([`initializeModule`]),...w(`Alerting`,[`addAlertsFromConfig`,`addModuleOpenAlertsFromConfig`,`addSingleAlert`,`alertHasBeenRead`,`cleanup`,`activateDisplayOnEventAlerts`]),...o(`Alerting`,[`removeFromAlerts`,`setFetchBroadcastUrl`]),axiosCallback:function(e){let t=e.data,n=[],r=[];if(!(t.alerts===void 0||typeof t.alerts!=`object`)){Array.isArray(t.globalAlerts)&&(r=[...r,...t.globalAlerts]),t.restrictedAlerts!==void 0&&typeof t.restrictedAlerts==`object`&&Object.keys(t.restrictedAlerts).forEach(e=>{this.currentUrl.toLowerCase().startsWith(e.toLowerCase())&&Array.isArray(t.restrictedAlerts[e])&&(r=[...r,...t.restrictedAlerts[e]])});for(let e in t.alerts)r.includes(e)&&n.push(t.alerts[e]);n.forEach(e=>{e.initial=!0,e.isNews=!0,e.initialConfirmed=e.mustBeConfirmed,this.addSingleAlert(e)})}},fetchBroadcast:function(e){B.get(e).then(this.axiosCallback).catch(function(e){console.warn(e)})},toggleModal:function(e){this.$store.commit(`Alerting/setShowTheModal`,e)},onModalClose:function(){let e=this.sortedAlerts(this.sortedAlertsSwitch).flatMap(e=>e.content).map(e=>e.hash).filter(e=>typeof e==`string`&&e.length>0);this.cleanup({visibleAlertHashes:e}),this.sortedAlertsSwitch=`initial`,this.$store.commit(`Alerting/setAlertsOnEvent`,[]),this.$store.commit(`Alerting/setInitialClosed`,!0)},markAsRead:function(e){this.alertHasBeenRead(e)},removeAlert:function(e){this.removeFromAlerts({hash:e})},checkCategory:function(e){let t=e.toLowerCase();return t!==`error`&&t!==`warning`&&t!==`success`},selectCategoryClass:function(e){let t=e?.toLowerCase();return t===`news`||t===`success`?`badge rounded-pill bg-success`:t===`warning`?`badge rounded-pill bg-warning`:t===`error`?`badge rounded-pill bg-danger`:`badge rounded-pill bg-info`},checkForEventAlerts:function(e){this.displayOnEventList?.length>0&&this.displayOnEventList.some(t=>t.type===e.type?typeof t.value==`string`&&t.value===e.payload||!!(typeof t.value==`object`&&Object.entries(t.value).every(([t,n])=>e.payload[t]===n)):!1)&&(this.sortedAlertsSwitch=`onEvent`,this.activateDisplayOnEventAlerts(e))}}},$A={key:0,id:`alertModal`,class:`modal`,tabindex:`-1`,"aria-modal":`true`,role:`dialog`},ej={class:`modal-dialog modal-dialog-centered modal-dialog-scrollable`,role:`document`},tj={class:`modal-content`},nj={class:`modal-header`},rj={class:`modal-body`},ij={class:`singleAlertContainer row`},aj={key:0},oj={class:`d-flex justify-content-between mb-3`},sj=[`onClick`],cj={class:`d-flex justify-content-end bd-highlight mb-3`},lj=[`innerHTML`],uj={key:1,class:`d-flex justify-content-between small`},dj=[`innerHTML`],fj={key:1,class:`mt-1`},pj={class:`form-check form-check-reverse form-switch mt-1`};function mj(e,t,n,r,i,o){let s=a(`SwitchInput`);return e.showTheModal&&e.sortedAlerts(i.sortedAlertsSwitch).length>0?(v(),M(`div`,$A,[z(`div`,ej,[z(`div`,tj,[z(`div`,nj,[R(I(e.$t(e.alertWindowTitle))+` `,1),z(`button`,{type:`button`,class:`btn-close`,"aria-label":`Close`,onClick:t[0]||=e=>{o.toggleModal(!1),o.onModalClose()}})]),z(`div`,rj,[(v(!0),M(D,null,C(e.sortedAlerts(i.sortedAlertsSwitch),(t,n)=>(v(),M(`div`,{key:t.category,class:`alertCategoryContainer`},[(v(!0),M(D,null,C(t.content,(t,r)=>(v(),M(`div`,{key:t.hash,class:E(t.category)},[z(`div`,ij,[r>0||n>0?(v(),M(`hr`,aj)):L(``,!0),z(`div`,oj,[z(`h3`,null,I(e.$t(t.title)),1),e.sortedAlerts(i.sortedAlertsSwitch).length>1?(v(),M(`button`,{key:0,type:`button`,class:`btn btn-close btn-sm col-1`,"aria-label":`Close`,onClick:e=>{o.removeAlert(t.hash)}},null,8,sj)):L(``,!0)]),z(`div`,cj,[z(`span`,{class:E(o.selectCategoryClass(t.category)+` badge-pill`)},I(e.$t(t.displayCategory)),3)]),z(`div`,{innerHTML:t.content},null,8,lj),o.checkCategory(t.category)?(v(),M(`div`,uj,[t.creationDate?(v(),M(`div`,{key:0,class:`mt-2 creation-date`,innerHTML:e.$t(`common:modules.alerting.created`)+t.creationDate},null,8,dj)):L(``,!0),t.initialConfirmed&&i.availableLocalStorage?(v(),M(`div`,fj,[z(`div`,pj,[A(s,{id:`flexSwitchCheckDefault`,aria:t.mustBeConfirmed?e.$t(t.confirmText):e.$t(t.reConfirmText),interaction:()=>o.markAsRead(t.hash),label:t.mustBeConfirmed?e.$t(t.confirmText):e.$t(t.reConfirmText)},null,8,[`aria`,`interaction`,`label`])])])):L(``,!0)])):L(``,!0)])],2))),128))]))),128))])])])])):L(``,!0)}var hj=K(QA,[[`render`,mj],[`__scopeId`,`data-v-8079b763`]]);y();var gj={name:`LayerPreview`,props:{layerId:{type:String,required:!0},center:{type:[Array,String],default:null},zoomLevel:{type:Number,default:null},radius:{type:Number,default:1e3},checkable:{type:Boolean,default:!1},checked:{type:Boolean,default:!1},customClass:{type:String,default:``},currentlyVisible:{type:Boolean,default:!1}},emits:[`previewClicked`],data(){return{supportedLayerTyps:[`WMS`,`WMTS`,`VectorTile`,`GROUP`],width:150,height:150,layerName:null}},computed:{...N([`isMobile`,`layerConfigById`]),...N(`Maps`,[`initialCenter`,`initialZoom`]),...N(`Modules/LayerPreview`,[`previewCenter`,`previewZoomLevel`,`previewUrlByLayerIds`])},watch:{layerId(){this.generatePreviewUrlByConfigType()}},mounted(){this.generatePreviewUrlByConfigType()},methods:{...w(`Modules/LayerPreview`,[`initialize`]),...w(`Alerting`,[`addSingleAlert`]),...o(`Modules/LayerPreview`,[`addPreviewUrl`]),calculateExtent(){let e=mapCollection.getMapView(`2D`).getResolutions()[this.previewZoomLevel(this.layerId)],t=typeof this.radius==`number`?this.radius:1e3;return tn(new r(this.previewCenter(this.layerId)).getExtent(),t*Math.sqrt(e))},load(e){B.get(e,{responseType:`blob`}).then(e=>{if(e.status===200){let t=URL.createObjectURL(e.data);this.addPreviewUrl({id:this.layerId,previewUrl:t})}else console.warn(`Cannot load preview for id `+this.layerId+`, response status is `,e.status)}).catch(e=>{console.error(e)})},buildWMSUrl(e,t){let n,r,i=t;if(!i){e.typ===`GROUP`?(n=e.children[0].url,r=yn(e.children[0])):(n=e.url,r=yn(e));let t;t=n.endsWith(`?`)||n.endsWith(`&`)?``:n.indexOf(`?`)===-1?`?`:`&`,i=`${n}${t}SERVICE=WMS&REQUEST=GetMap&WIDTH=${this.width}&HEIGHT=${this.height}`,r.CRS=e.crs?e.crs:mapCollection.getMapView(`2D`).getProjection().getCode(),r.SRS=r.CRS,r.BBOX=this.calculateExtent(),r.STYLES=``,Object.entries(r).forEach(([e,t])=>{e!==`WIDTH`&&e!==`HEIGHT`&&t!==void 0&&(i+=`&${e}=${encodeURIComponent(t)}`)})}this.load(i)},buildWMTSUrl(e,t){e.capabilitiesUrl?lt.getWMTSCapabilities(e.capabilitiesUrl).then(t=>{this.createWMTSPreviewUrlFromCapabilities(e,t)}).catch(t=>{console.warn(`Error occured during creation of url for preview of wmts-layer`,e,t)}):t?this.load(t):console.warn(`There is no preview image for `+e.name+`. You can specify a preview image in the layer config under preview.src.`)},createWMTSPreviewUrlFromCapabilities(e,t){let n={layer:e.layers},r=mapCollection.getMapView(`2D`),i=null,a=null,o=null,s=null,c=null,l=null,u=null;e.tileMatrixSet?n.matrixSet=e.tileMatrixSet:n.projection=`EPSG:3857`,a=gt(t,n),u=O(O(r.getProjection().getCode()),O(a.projection?.getCode()?a.projection?.getCode():`EPSG:3857`),this.previewCenter(this.layerId)),o=a?.tileGrid.getZForResolution(r.getResolutions()[this.previewZoomLevel(this.layerId)]),s=a?.tileGrid.getTileCoordForCoordAndZ(u,o),c=new pn(a),l=c.getTile(s[0],s[1],s[2]),l.load(),i=l.getImage().src,this.load(i)},buildPreviewUrl(e,t){this.addPreviewUrl({id:e.id,previewUrl:t||``})},clicked(){this.$emit(`previewClicked`),_t.getInstance(this.$el)?.hide()},generatePreviewUrlByConfigType(){let e=this.layerConfigById(this.layerId);if(e&&this.supportedLayerTyps.includes(e.typ)){if(this.layerName=Lr(e.name),e.preview?.src&&e.preview?.src!==``){this.layerName=Lr(e.name),this.buildPreviewUrl(e,e.preview.src);return}this.initialize({id:this.layerId,center:this.center,zoomLevel:this.zoomLevel}),this.previewUrlByLayerIds[this.layerId]||(e.typ===`WMS`||e.typ===`GROUP`?this.buildWMSUrl(e,void 0):e.typ===`WMTS`?this.buildWMTSUrl(e,void 0):e.typ===`VectorTile`&&this.buildPreviewUrl(e,void 0))}else console.warn(`Layer for preview cannot be found:`,this.layerId)},getPreviewUrl(){return this.previewUrlByLayerIds[this.layerId]}}},_j=[`data-bs-toggle`,`data-bs-original-title`,`title`],vj={class:`wrapperImg`,title:``},yj=[`src`];function bj(e,t,n,r,i,a){return a.getPreviewUrl()===void 0?L(``,!0):(v(),M(`div`,{key:0,role:`button`,tabindex:`0`,class:E([n.customClass,`layerPreview`]),"data-bs-toggle":e.isMobile?null:`tooltip`,"data-bs-original-title":e.$t(i.layerName),title:e.$t(i.layerName),onClick:t[0]||=e=>a.clicked(),onKeydown:t[1]||=me(e=>a.clicked(),[`enter`])},[z(`div`,vj,[z(`img`,{class:E([n.customClass,`previewImg`]),src:a.getPreviewUrl(),alt:`previewImg`},null,10,yj)]),n.checkable?(v(),M(`div`,{key:0,class:E([n.customClass,`checkable`,{"bi-check-lg":n.checked}])},null,2)):L(``,!0)],42,_j))}var xj=K(gj,[[`render`,bj],[`__scopeId`,`data-v-aca2f8ce`]]);y();var Sj={name:`BaselayerSwitcher`,components:{LayerPreview:xj},computed:{...N([`isMobile`,`visibleBaselayerConfigs`,`allBaselayerConfigs`,`layerConfigsByAttributes`]),...N(`Modules/BaselayerSwitcher`,[`active`,`activatedExpandable`,`visibleBaselayerIds`,`baselayers`,`configPaths`,`singleBaseLayer`,`topBaselayer`,`type`,`filteredBaseLayers`])},watch:{visibleBaselayerConfigs:{handler(e){let t=Object.values(this.allBaselayerConfigs),n=_r.getLayerWithMaxZIndex(e);if(n?.id!==void 0){let e=t.filter(e=>
22e.id!==n.id);this.setTopBaselayer(n),this.setBaselayers(e)}else this.setTopBaselayer(null),this.setBaselayers(t);this.setActivatedExpandable(!1)},deep:!0}},created(){this.initializeModule({configPaths:this.configPaths,type:this.type});let e=[],t=this.layerConfigsByAttributes({baselayer:!0,showInLayerTree:!0});if(t.length>1){let e=_r.getLayerWithMaxZIndex(t);e&&this.setTopBaselayer(e)}else t.length===0?this.setTopBaselayer(null):this.setTopBaselayer(t[0]);Object.values(this.allBaselayerConfigs).forEach(t=>{t.id!==this.topBaselayer?.id&&e.push(t)}),this.setBaselayers(e),document.addEventListener(`click`,e=>{let t=this.$refs[`baselayer-switcher`];t&&t.contains(e.target)||this.setActivatedExpandable(!1)})},methods:{...o(`Modules/BaselayerSwitcher`,[`setActivatedExpandable`,`setBaselayers`,`setTopBaselayer`]),...w([`initializeModule`]),...w(`Modules/BaselayerSwitcher`,[`updateLayerVisibilityAndZIndex`]),switchActiveBaselayer(e){this.updateLayerVisibilityAndZIndex(e.id);let t=this.filteredBaseLayers,n=t.map(e=>e.id).indexOf(e.id);t.splice(n,1),this.topBaselayer!==null&&(t.push(this.topBaselayer),this.singleBaseLayer&&this.layerConfigsByAttributes({id:this.topBaselayer.id}).forEach(e=>{e.visibility=!1})),this.setBaselayers(t),this.setTopBaselayer(e),this.setActivatedExpandable(!1)}}},Cj={key:0,id:`baselayer-switcher`,ref:`baselayer-switcher`,class:`btn-group-vertical my-5 btn-group-background-switcher shadow`,role:`group`},wj=[`onClick`];function Tj(e,t,n,r,i,o){let s=a(`LayerPreview`);return e.filteredBaseLayers.length>0&&e.active?(v(),M(`div`,Cj,[z(`ul`,null,[(v(!0),M(D,null,C(e.filteredBaseLayers,t=>(v(),M(`li`,{key:t.id},[e.activatedExpandable===!0?(v(),M(`button`,{key:0,id:`bs-expanded`,class:`btn btn-light preview`,onClick:e=>o.switchActiveBaselayer(t)},[A(s,{id:`layer-tree-layer-preview-`+t.id,"layer-id":t.id,center:t.preview?.center,"zoom-level":t.preview?.zoomLevel,radius:t.preview?.radius,checkable:t.preview?.checkable,"custom-class":t.preview?.customClass},null,8,[`id`,`layer-id`,`center`,`zoom-level`,`radius`,`checkable`,`custom-class`])],8,wj)):L(``,!0)]))),128)),z(`li`,null,[e.topBaselayer===null?(v(),M(`button`,{key:0,id:`bs-placeholder`,class:`btn btn-light preview top placeholder-button`,onClick:t[0]||=t=>e.setActivatedExpandable(!e.activatedExpandable)},[...t[2]||=[z(`i`,{class:`bi-map`},null,-1)]])):(v(),M(`button`,{key:1,id:`bs-topBaselayer`,class:`btn btn-light preview top`,onClick:t[1]||=t=>e.setActivatedExpandable(!e.activatedExpandable)},[A(s,{id:`layer-tree-layer-preview-`+e.topBaselayer.id,"layer-id":e.topBaselayer.id,center:e.topBaselayer.preview?.center,"zoom-level":e.topBaselayer.preview?.zoomLevel,radius:e.topBaselayer.preview?.radius,checkable:e.topBaselayer.preview?.checkable,"custom-class":e.topBaselayer.preview?.customClass},null,8,[`id`,`layer-id`,`center`,`zoom-level`,`radius`,`checkable`,`custom-class`])]))])])],512)):L(``,!0)}var Ej=K(Sj,[[`render`,Tj],[`__scopeId`,`data-v-5253055c`]]),Dj={isModuleVisible({mapMode:e,deviceMode:t,treeType:n,elements:r=[],supportedMapModes:i=[`2D`,`3D`],supportedDevices:a=[`Desktop`,`Mobile`,`Table`],supportedTreeTypes:o=[`auto`],visibleLayerConfigs:s}){let c=!1;return i?.includes(e)&&a.map(e=>e.toUpperCase()).includes(t.toUpperCase())&&(o.includes(n)||n===void 0)&&(c=r.length>0?r.filter(t=>(t.supportedMapModes||[`2D`,`3D`]).includes(e)).filter(e=>{if(e.showOnlyByLayersVisible&&Array.isArray(e.showOnlyByLayersVisible)){let t=s.filter(e=>e.visibility===!0).map(e=>e.id);return e.showOnlyByLayersVisible.every(e=>t.includes(e))}return!0}).length>0:!0),c}};y();var Oj={name:`ControlBar`,components:{},data(){return{categorizedControls:{initialVisible:[],expandable:[]}}},computed:{...N([`controlsConfig`,`deviceMode`,`uiStyle`,`portalConfig`]),...N(`Controls`,[`activatedExpandable`,`addonControls`,`componentMap`]),...N(`Maps`,[`mode`])},watch:{controlsConfig(e){this.categorizedControls.initialVisible=[],this.categorizedControls.expandable=[],this.initializeControls(e)}},mounted(){this.initializeControls(this.controlsConfig)},methods:{...w(`Controls`,[`mergeControlState`,`moveStartModuleControls`]),...o(`Controls`,[`setActivatedExpandable`]),initializeControls(e){Object.entries(this.componentMap).forEac
22h(([e,t])=>{this.$options.components[e]=t}),Object.entries(k(this.addonControls)).forEach(([e,t])=>{this.$options.components[e]=t}),this.isSimpleStyle()||(this.prepareControls(e),e?.expandable&&this.prepareControls(e.expandable,!0))},isSimpleStyle(){return this.uiStyle===`SIMPLE`},prepareControls(e,t=!1){Object.keys(e).forEach(n=>{if(this.componentMap[ra.upperFirst(n)]||this.addonControls[ra.upperFirst(n)]){let r=e[n];r===!0?this.fillCategorizedControls(n,t):typeof r==`object`&&n!==`expandable`&&(this.mergeControlState({controlKey:n,controlValues:r}),this.fillCategorizedControls(n,t))}})},fillCategorizedControls(e,t){let n={componentKey:ra.upperFirst(e),key:e};t&&this.checkIsVisible(e)?this.categorizedControls.expandable.push(n):this.categorizedControls.initialVisible.push(n)},checkIsVisible(e){let t=this.$store.getters[`Controls/${ra.upperFirst(e)}/supportedMapModes`],n=this.$store.getters[`Controls/${ra.upperFirst(e)}/supportedDevices`],r=this.$store.getters[`Controls/${ra.upperFirst(e)}/supportedTreeTypes`];return Dj.isModuleVisible({mapMode:this.mode,deviceMode:this.deviceMode,treeType:this.portalConfig?.tree?.type,supportedMapModes:t,supportedDevices:n,supportedTreeTypes:r})}}},kj={class:`btn-group-vertical my-5 btn-group-controls shadow`,role:`group`},Aj={key:0},jj={class:`btn-group-vertical`,role:`group`};function Mj(e,t,n,r,i,a){return v(),M(`div`,kj,[(v(!0),M(D,null,C(i.categorizedControls.initialVisible,(e,t)=>(v(),M(`div`,{key:t},[a.checkIsVisible(e.key)?(v(),F(ve(e.componentKey),{key:0})):L(``,!0)]))),128)),i.categorizedControls.expandable.length>=1?(v(),M(`div`,Aj,[t[2]||=z(`hr`,null,null,-1),z(`div`,jj,[s(z(`div`,null,[(v(!0),M(D,null,C(i.categorizedControls.expandable,(e,t)=>(v(),M(`div`,{key:t},[a.checkIsVisible(e.key)?(v(),F(ve(e.componentKey),{key:e.key})):L(``,!0)]))),128))],512),[[ae,e.activatedExpandable]]),z(`button`,{type:`button`,class:`btn control-icon-controls bootstrap-icon my-1 control-button-controls btn-light`,onClick:t[0]||=t=>e.setActivatedExpandable(!e.activatedExpandable)},[...t[1]||=[z(`i`,{class:`bi-three-dots`},null,-1)]])])])):L(``,!0)])}var Nj=K(Oj,[[`render`,Mj],[`__scopeId`,`data-v-4a36a688`]]);y();function Pj(e){Lj(e,$.getters[`Maps/mode`]),Fj(),Ij()}function Fj(){$.watch((e,t)=>t[`Maps/mode`],e=>{e===`3D`&&Lj($.getters.visibleLayerConfigs,e)})}function Ij(){$.watch((e,t)=>t.allLayerConfigs,e=>{Lj(e,$.getters[`Maps/mode`])},{deep:!0})}function Lj(e,t){e?.forEach(e=>{let n=W.getLayerById(e.id);n===void 0?e.visibility===!0&&(n=Ff.createLayer(e,t),zj(n,t)):Rj(n,e)}),$.getters.styleListLoaded?$.dispatch(`Modules/Legend/createLegend`,{root:!0}):$.watch((e,t)=>t.styleListLoaded,e=>{e&&$.dispatch(`Modules/Legend/createLegend`,{root:!0})})}function Rj(e,t){e.updateLayerValues(k(t)),Object.assign(e.attributes,k(t))}function zj(e){e&&(Hj(e),Bj(e),W.addLayer(e))}function Bj(e){e.get(`typ`)===`GROUP`?e.getLayerSource().forEach(t=>{let n=(100-e.get(`transparency`))/100,r=e.get(`zIndex`);Vj(t,e),e.layer.getOpacity()!==1&&t.layer.getOpacity()===1&&t.getLayer().setOpacity(n),t.getLayer().setZIndex(r)}):Vj(e)}function Vj(e,t){if(e.get(`maxScale`)===void 0&&t?.get(`maxScale`)!==void 0&&(e.set(`maxScale`,t.get(`maxScale`)),e.set(`minScale`,t.get(`minScale`))),e.get(`maxScale`)!==void 0){e.get(`minScale`)===void 0&&e.set(`minScale`,0);let t=$.getters[`Maps/getResolutionByScale`](e.get(`maxScale`),`max`),n=$.getters[`Maps/getResolutionByScale`](e.get(`minScale`),`min`);if(e.getLayer&&typeof e.getLayer().setMaxResolution==`function`)e.getLayer().setMaxResolution(t+t/100),e.getLayer().setMinResolution(n);else if(e.tileset){let t=e.get(`maxScale`)/10,n=e.get(`minScale`)/10;e.tileset.show=!0,e.tileset.minimumDistance=n,e.tileset.maximumDistance=t}}}function Hj(e){$.dispatch(`replaceByIdInLayerConfig`,{layerConfigs:[{id:e.get(`id`),layer:e.attributes}],trigger:!1},{root:!0})}function Uj(e,t){t&&(e.set(`resolutions`,t),e.resolutions_=t)}function Wj(e,t){for(let[n,r]of Object.entries(t))n===`startCenter`?e.setCenter(r):n===`startResolution`?e.setResolution(r):n===`startZoomLevel`?e.setZoom(r):e.set(n,r)}y();function Gj(e,t){Kj(e,t),$.dispatch(`Maps/setMapAttributes`),qj(),($.getters.controlsConfig?.button3d||$.getters.controlsConfig?.expandable?.button3d)&&Jj(),Uc.initializeMapMarkers($.getters.mapMarker)}function Kj(e,t){let r=_e.map.createMap({...t,...e,layerConf:jt.getLayerList()},`2D`,{});n(r),mapCollection.addMap(r,`2D`)}function qj(){$.watch((e,t)=>t.mapViewSettings,e=>{let t=mapCollection.getMapView(`2D`),n=e?.options?.map(e=>e.resolution);Uj(t,n),Wj(t,e)})}function Jj(){ot.load3DScript($.getters.cesiumLibrary,()=>{Yj(),$.dispatch(`Maps/registerCesiumListener`),$.getters.startingMapMode===`3D`&&$.dispatch(`Maps/activateMap3d`)})}function Yj(){let e=$.getters.map3dParameter,t=e?.shadowTime,r=_e.map.createMap({cesiumParameter:e,map2D:mapCollection.getMap(`2D`),shadowTime:function(){return this.time?this.time:t?Cesium.JulianDate.fromIso8601(t):Cesium.JulianDate.fromDate(new Date)}}
22,`3D`),i=mapCollection.getMapView(`2D`),a=$.state.urlParams?.MAPS?Object.fromEntries(Object.entries(JSON.parse($.state.urlParams?.MAPS)).map(([e,t])=>[e.toUpperCase(),t])).CENTER:void 0,o=$.state.urlParams.CENTER||$.state.urlParams[`MAP/CENTER`]||a;if(n(r),mapCollection.addMap(r,`3D`),$.state.urlParams.QUERY)$.dispatch(`Modules/SearchBar/startSearch`,$.state.urlParams.QUERY);else if(!o&&e.camera&&$.getters[`Maps/mode`]===`2D`)i.setZoom($.getters[`Maps/initialZoom`]),i.setCenter($.getters[`Maps/initialCenter`]);else if(o&&e.camera&&$.getters[`Maps/mode`]===`2D`){let e;e=Array.isArray(o)?o:o?.includes(`[`)?JSON.parse(o):o?.split(`,`),i.setCenter(e)}}var Xj={create3DMap:Yj,initializeMaps:Gj,load3DMap:Jj},Zj={LAYERS:rM,MDID:oM},Qj={LAYERIDS:iM,"MAP/LAYERIDS":iM,"MAP/MDID":oM,TRANSPARENCY:iM,VISIBILITY:iM},$j=!1,eM=0,tM={};function nM(){LA(Zj,Qj)}function rM(e){let t=JSON.parse(e.LAYERS);sM(),cM(t)}function iM(e){tM={...tM,...e},(tM[`MAP/LAYERIDS`]||tM.LAYERIDS)&&aM(tM)}function aM(e){let t=(e.LAYERIDS||e[`MAP/LAYERIDS`])?.split(`,`),n=e.TRANSPARENCY?.split(`,`),r=e.VISIBILITY?.split(`,`).map(e=>e!==`false`),i=$.getters.layerConfigsByAttributes({baselayer:!0,typ:`GROUP`}),a=[];[...t].forEach((e,n)=>{let r=i.find(t=>t.id.split(`-`).indexOf(e)>-1);r&&t.splice(n,1,r.id)}),a=t.map((e,t)=>({id:e,visibility:!r||r[t],transparency:n?n[t]:0})),(e.MDID||e[`MAP/MDID`])&&(e[`MAP/LAYERIDS`]||e.LAYERIDS)||sM(),cM(a)}function oM(e){let t=(e.MDID||e[`MAP/MDID`]).split(`,`),n=[{id:($.getters.layerConfigsByAttributes({baselayer:!0})?.at(-1)).id}];$.getters.allLayerConfigs.forEach(e=>{e?.datasets?.forEach(r=>{t.includes(r.md_id)&&n.push({id:e.id})})}),sM(),cM(n)}function sM(){$.getters.layerConfigsByAttributes({showInLayerTree:!0}).map(e=>e.id).forEach(e=>{$.dispatch(`replaceByIdInLayerConfig`,{layerConfigs:[{id:e,layer:{id:e,showInLayerTree:!1,visibility:!1}}]})})}function cM(e){let t=window.location?.search?.toUpperCase().includes(`LAYERS=`);e.forEach((e,n)=>{let r=!1,i;$.getters.layerConfigById(e.id)&&(r=$.getters.layerConfigById(e.id).baselayer,$.getters.layerConfigById(e.id).time&&(i=$.getters.layerConfigById(e.id).time));let a;t?a=n:r?($j||=(eM=0,!0),a=eM,eM++):a=n+eM,$.dispatch(`addOrReplaceLayer`,{layerId:e.id,visibility:typeof e.visibility!=`boolean`||e.visibility,transparency:e.transparency||0,showInLayerTree:!0,zIndex:a,time:e.params?.TIME?{default:e.params.TIME}:i},{root:!0}).then(t=>{t||$.dispatch(`Alerting/addSingleAlert`,{content:i18next.t(`common:core.layers.urlParamWarning`,{layerId:e.id}),category:`warning`})})})}var lM={processLayerUrlParams:nM,setLayers:rM,setLayerIds:aM,setLayersByMetadataId:oM,removeCurrentLayerFromLayerTree:sM,addLayerToLayerTree:cM},uM={settings:{pointStyleId:`defaultHighlightFeaturesPoint`,polygonStyleId:`defaultHighlightFeaturesPolygon`,lineStyleId:`defaultHighlightFeaturesLine`,additionalPolygonStyleId:`defaultAdditionalMapMarkerPolygon`},createVectorLayer:async function(e,t,n,r,i){return await i(`addLayerToLayerConfig`,{layerConfig:{gfiAttributes:r.gfiAttributes,id:t,name:n,showInLayerTree:!0,styleId:e,typ:`VECTORBASE`,type:`layer`,visibility:!0,version:r.version,url:r.url,featureType:r.featureType,isDynamic:!0},parentKey:er},{root:!0}),W.getLayerById(t)?.layer},highlightPointFeature:function(e,t,n,i,a,o,s){let c=Ft.returnStyleObject(e),u=[],d=!1;a.forEach(e=>{let t=e.getGeometry(),n=t.getType()===`MultiPoint`,i=t.getType()===`Point`;if(c&&(i||n)){d=!0;let n=t.getCoordinates(),a=new V({geometry:i?new r(n):new l(n)}),o=Jt.createStyle(c,e,!1,Config.wfsImgPath);a.setProperties(e.getProperties()),s.ignoredKeys.forEach(t=>{e.get(t)?a.unset(t):e.get(t.toLowerCase())&&a.unset(t.toLowerCase())}),a.setStyle(o),u.push(a)}}),d&&this.showLayer(t,u,e,i,n,o,s)},showLayer:async function(e,t,n,r,i,a,o){let s=await this.createVectorLayer(n,e,o.treeHighlightedFeatures?.layerName||i,r,a);s.set(`styleId`,n),s.getSource().addFeatures(t),a(`Maps/zoomToExtent`,{extent:s.getSource().getExtent(),options:{duration:0}},{root:!0})},highlightLineOrPolygonFeature:async function(e,t,n,r,i,a,o,s){let c=await Ft.returnStyleObject(e),l=[],u=!1;
22a.forEach(e=>{let t=e.getGeometry();if(c&&t.getType()===r){u=!0;let n=new V({geometry:t}),r=Jt.createStyle(c,n,!1,Config.wfsImgPath);n.setProperties(e.getProperties()),s.ignoredKeys.forEach(t=>{e.get(t)?n.unset(t):e.get(t.toLowerCase())&&n.unset(t.toLowerCase())}),n.setStyle(r),l.push(n)}}),u&&this.showLayer(t,l,e,i,n,o,s)},runHighlighting:function(e,t,n,r){this.highlightPointFeature(this.settings.pointStyleId,`highlight_point_layer`,`highlightPoint`,e,t,n,r),this.highlightLineOrPolygonFeature(this.settings.polygonStyleId,`highlight_polygon_layer`,`highlightPolygon`,`Polygon`,e,t,n,r),this.highlightLineOrPolygonFeature(this.settings.polygonStyleId,`highlight_polygon_layer`,`highlightPolygon`,`MultiPolygon`,e,t,n,r),this.highlightLineOrPolygonFeature(this.settings.lineStyleId,`highlight_line_layer`,`highlightLine`,`LineString`,e,t,n,r),this.highlightLineOrPolygonFeature(this.settings.lineStyleId,`highlight_line_layer`,`highlightLine`,`MultiLineString`,e,t,n,r)},handleGetFeatureError:function(e,t){console.error(t),e(`Alerting/addSingleAlert`,i18next.t(`common:core.maps.highlightFeaturesByAttribute.messages.requestFailed`),{root:!0})},handleGetFeatureResponse:function(e,t,n,r){if(n.status!==200){console.warn(n.status),e(`Alerting/addSingleAlert`,i18next.t(`common:core.maps.highlightFeaturesByAttribute.messages.requestFailed`),{root:!0});return}let i=new Ne({version:r.version}).readFeatures(n.data);if(i.length===0){let t=new DOMParser().parseFromString(n.data,`text/xml`),r=t.getElementsByTagNameNS(`*`,`ExceptionText`).length>0?t.getElementsByTagNameNS(`*`,`ExceptionText`)[0].childNodes[0].nodeValue:``;if(r){console.error(`highlightFeaturesByAttribute: service exception: `+r),e(`Alerting/addSingleAlert`,i18next.t(`common:core.maps.highlightFeaturesByAttribute.messages.requestFailed`),{root:!0});return}}t.styleListLoaded?this.runHighlighting(r,i,e,t):$.watch((e,t)=>t.styleListLoaded,n=>{n&&this.runHighlighting(r,i,e,t)})},getOGCFilterSnippet:function(e,t,n,r,i,a,o){let s=i===void 0?``:i,c=``;return c=e?`<ogc:PropertyIsEqualTo matchCase='false' wildCard='${t}' singleChar='${n}' escapeChar='${r}'> 23 <ogc:PropertyName>${s}${a}</ogc:PropertyName> 24 <ogc:Literal>${o}</ogc:Literal> 25 </ogc:PropertyIsEqualTo>`:`<ogc:PropertyIsLike matchCase='false' wildCard='${t}' singleChar='${n}' escapeChar='${r}'> 26 <ogc:PropertyName>${s}${a}</ogc:PropertyName> 27 <ogc:Literal>${t}${o}${t}</ogc:Literal> 28 </ogc:PropertyIsLike>`,c},getOGCFilterSnippetIn:function(e,t,n,r,i,a,o){let s=``,c=``,l=`;`;e!==void 0&&e.length===1&&(l=e);let u=i===void 0?``:i,d=o.split(l);d.length>=2&&(s+=`<ogc:Or>`);for(c of d)s+=`<ogc:PropertyIsEqualTo matchCase='false' wildCard='${t}' singleChar='${n}' escapeChar='${r}'> 29 <ogc:PropertyName>${u}${a}</ogc:PropertyName> 30 <ogc:Literal>${c}</ogc:Literal> 31 </ogc:PropertyIsEqualTo>`;return d.length>=2&&(s+=`</ogc:Or>`),s},getWFSQuery:function(e,t,n){return`<?xml version='1.0' encoding='UTF-8'?> 32 <wfs:GetFeature service='WFS' xmlns:wfs='http://www.opengis.net/wfs' xmlns:ogc='http://www.opengis.net/ogc' xmlns:gml='http://www.opengis.net/gml' xmlns:app='http://www.deegree.org/app' traverseXlinkDepth='*' version='${t}'> 33 <wfs:Query typeName='${e}'> 34 <ogc:Filter> 35 ${n} 36 </ogc:Filter> 37 </wfs:Query> 38 </wfs:GetFeature>`},configHasErrors:function(e,t){return e?e.url?!e.wildCard||e.wildCard?.length!==1?(console.error(`highlightFeaturesByAttribute: wildCard config setting must exist and be one character`),!0):!e.singleChar||e.singleChar?.length!==1?(console.error(`highlightFeaturesByAttribute: singleChar config setting must exist and be one character`),!0):!e.escapeChar||e.escapeChar?.length!==1?(console.error(`highlightFeaturesByAttribute: escapeChar config setting must exist and be one character`),!0):!1:(console.error(`highlightFeaturesByAttribute: Layer with ID `+t+` has no url configured`),!0):(console.error(`highlightFeaturesByAttribute: Layer with ID `+t+` not found in Config`),!0)},highlightFeaturesByAttribute:function(e,t,n,r,i,a){let o=t.layerConfigById(n),s=a&&a.toLowerCase()===`isequal`,c=a&&a.toLowerCase()===`isin`,l=this.getOGCFilterSnippet(s,o?.wildCard,o?.singleChar,o?.escapeChar,o?.featurePrefix,r,i),u=this.getWFSQuery(o?.featureType,o?.version,l);if(c){let e=this.getOGCFilterSnippetIn(o?.valueDelimiter,o?.wildCard,o?.singleChar,o?.escapeChar,o?.featurePrefix,r,i);u=this.getWFSQuery(o?.featureType,o?.version,e)}if(this.configHasErrors(o,n)){e(`Alerting/addSingleAlert`,i18next.t(`common:core.maps.highlightFeaturesByAttribute.messages.configurationError`),{root:!0});return}B.post(o.url,u,{headers:{"Content-Type":`raw`},timeout:o?.timeout,withCredentials:o.isSecured}).then(n=>{this.handleGetFeatureResponse(e,t,n,o)}).catch(t=>this.handleGetFeatureError(e,t))}},dM={FEATUREVIAURL:hM,HIGHLIGHTFEATURE:gM,HIGHLIGHTFEATURESBYATTRIBUTE:_M,MAPS:mM,MARKER:bM,ZOOMTOEXTENT:wM,ZOOMTOFEATUREID:CM,ZOOMTOGEOMETRY:CM,HIGHLIGHTED3D:TM},fM={"API/HIGHLIGHTFEATURESBYATTRIBUTE":_M,ATTRIBUTENAME:_M,ATTRIBUTEQUERY:_M,ATTRIBUTEVALUE:_M,BEZIRK:CM,CENTER:SM,FEATUREID:CM,MAP:xM,MAPMARKER:bM,MAPMODE:xM,"MAP/CENTER":SM,"MAP/HIGHLIGHTFEATURE":gM,"MAP/MAPMODE":xM,"MAP/PROJECTION":vM,"MAP/ZOOMLEVEL":SM,"MAP/ZOOMTOEXTENT":wM,"MAP/ZOOMTOFEATUREID":CM,"MAP/ZOOMTOGEOMETRY":CM,PROJECTION:vM,WFSID:_M,ZOOMLEVEL:SM,HEADING:yM,TILT:yM,ALTITUDE:yM};function pM(){LA(dM,fM)}function mM(e){let t=Object.fromEntries(Object.entries(JSON.parse(e.MAPS)).map(([e,t])=>[e.toUpperCase(),t]));yM(t),xM(t),SM(t)}function hM(e){try{$.dispatch(`Maps/featureViaUrl`,JSON.parse(e.FEATUREVIAURL))}catch(e){console.warn(i18next.t(`common:core.maps.featureViaURL.messages.featureParsing`)),console.error(e)}}function gM(e){let t=(e.HIGHLIGHTFEATURE||e[`MAP/HIGHLIGHTFEATURE`])?.split(`,`)[0],n=(e.HIGHLIGHTFEATURE||e[`MAP/HIGHLIGHTFEATURE`])?.split(`,`);
38n.shift(),n.forEach(e=>{$.dispatch(`Maps/highlightFeature`,{layerIdAndFeatureId:[t,e],type:`viaLayerIdAndFeatureId`})}),$.dispatch(`Maps/zoomToFilteredFeatures`,{ids:n,layerId:t,zoomOptions:{duration:0}})}function _M(e){if(!e.ATTRIBUTENAME&&!e.ATTRIBUTEVALUE&&!e.ATTRIBUTEQUERY||!e.WFSID)return;let t=e.ATTRIBUTENAME,n=e.ATTRIBUTEVALUE,r=e.ATTRIBUTEQUERY,i=e.WFSID;t&&n&&r&&i?uM.highlightFeaturesByAttribute($.dispatch,$.getters,i,t,n,r):console.warn(`Not all required URL parameters given for highlightFeaturesByAttribute.`)}function vM(e){(e.CENTER||e[`MAP/CENTER`])&&SM(e),(e.MARKER||e.MAPMARKER)&&bM(e),(e.ZOOMTOEXTENT||e[`MAP/ZOOMTOEXTENT`])&&wM(e)}function yM(e){let t={};e.LON!==void 0&&e.LAT!==void 0&&e.HEIGHT!==void 0&&(t.cameraPosition=[e.LON,e.LAT,e.HEIGHT]),e.HEADING!==void 0&&(t.heading=e.HEADING),e.PITCH!==void 0&&(t.pitch=e.PITCH),e.ALTITUDE!==void 0&&(t.altitude=e.ALTITUDE),e.TILT!==void 0&&(t.tilt=e.TILT),Object.keys(t).length>0&&$.dispatch(`Maps/setCamera`,t)}function bM(e){let t=e.PROJECTION||e[`MAP/PROJECTION`],n=e.MARKER||e.MAPMARKER;n&&!Array.isArray(n)&&(n=n.includes(`[`)?JSON.parse(n):n?.split(`,`)),n=n?.map(e=>parseFloat(e,10)),$.getters.styleListLoaded?$.dispatch(`Maps/placingPointMarker`,t?j.transformToMapProjection(mapCollection.getMap(`2D`),t,n):n):$.watch((e,t)=>t.styleListLoaded,e=>{e&&$.dispatch(`Maps/placingPointMarker`,t?j.transformToMapProjection(mapCollection.getMap(`2D`),t,n):n)})}function xM(e){$.dispatch(`Maps/changeMapMode`,(e.MODE||e.MAP||e.MAPMODE||e[`MAP/MAPMODE`])?.toUpperCase())}function SM(e){let t=e.PROJECTION||e[`MAP/PROJECTION`],n=e.CENTER||e[`MAP/CENTER`];n&&!Array.isArray(n)&&(n=n.includes(`[`)?JSON.parse(n):n?.split(`,`)),$.dispatch(`Maps/zoomToCoordinates`,{center:t?j.transformToMapProjection(mapCollection.getMap(`2D`),t,n):n,zoom:e.ZOOM??e.ZOOMLEVEL??e[`MAP/ZOOMLEVEL`],rotation:e.ROTATION})}function CM(e){$.dispatch(`Maps/zoomToFeatures`,{ZOOMTOFEATUREID:e.FEATUREID||e.ZOOMTOFEATUREID||e[`MAP/ZOOMTOFEATUREID`],ZOOMTOGEOMETRY:e.BEZIRK||e.ZOOMTOGEOMETRY||e[`MAP/ZOOMTOGEOMETRY`]})}function wM(e){$.dispatch(`Maps/zoomToProjExtent`,{extent:(e.ZOOMTOEXTENT||e[`MAP/ZOOMTOEXTENT`])?.split(`,`),options:{duration:0},projection:e.PROJECTION||e[`MAP/PROJECTION`]||$.getters[`Maps/projectionCode`]})}function TM(e){let t=e.HIGHLIGHTED3D;t&&$.watch(()=>$.getters[`Maps/mode`],e=>{if(e!==`3D`)return;let n=mapCollection.getMap(`3D`);if(!n||typeof n.getCesiumScene!=`function`){console.warn(`3D map is not ready yet. Highlight not applied.`);return}let r=n.getCesiumScene(),i=rg($.getters[`Modules/SearchBar/coloredHighlighting3D`]?.color,`YELLOW`);r.globe.tileLoadProgressEvent.addEventListener(function e(){$.commit(`Modules/SearchBar/setLastPickedFeatureId`,t),ag(t,i),r.globe.tilesLoaded&&r.globe.tileLoadProgressEvent.removeEventListener(e)})},{immediate:!0})}var EM={processMapUrlParams:pM,setMapAttributes:mM,featureViaUrl:hM,highlightFeature:gM,highlightFeaturesByAttributes:_M,highlight3DFeatureUrlParam:TM,processProjection:vM,setMapMarker:bM,setCamera:yM,setMode:xM,zoomToCoordinates:SM,zoomToFeatures:CM,zoomToProjExtent:wM},DM=parseInt({gridBreakpointsXs:`0`,gridBreakpointsSm:`576px`,gridBreakpointsMd:`768px`,gridBreakpointsLg:`992px`,gridBreakpointsXl:`1200px`,gridBreakpointsXxl:`1400px`,"btn-primary":`_btn-primary_10uyo_25`,"btn-secondary":`_btn-secondary_10uyo_45`,"btn-light":`_btn-light_10uyo_60`,"btn-pagination":`_btn-pagination_10uyo_76`,"page-dot":`_page-dot_10uyo_76`,accordion:`_accordion_10uyo_93`,"form-control":`_form-control_10uyo_99`,"form-select":`_form-select_10uyo_99`}.gridBreakpointsMd,10)||768;function OM(){return window.innerWidth<DM}var kM={MENU:MM,MAINWIDTH:LM,SECONDARYWIDTH:RM,MAINCLOSED:zM,SECONDARYCLOSED:BM},AM={ISINITOPEN:NM,STARTUPMODUL:NM};function jM(){LA(kM,AM)}function MM(e){let t=ra.upperCaseKeys(JSON.parse(e.MENU));Object.keys(t).forEach(e=>{let n=ra.upperCaseKeys(t[e]),{currentComponent:r,side:i}=PM(n.CURRENTCOMPONENT,e),a=n.ATTRIBUTES,o=r?ra.upperFirst(r.type):ra.upperFirst(n.CURRENTCOMPONENT);if(i)$.dispatch(`Menu/activateCurrentComponent`,{currentComponent:r,type:o,side:i}),a&&$.dispatch(`Menu/updateComponentState`,{type:o,attributes:a});else if($._actions[`Modules/${o}/restoreFromUrlParams`])$.dispatch(`Modules/${o}/restoreFromUrlParams`,a,{root:!0});else{let e=Pl(n.CURRENTCOMPONENT);if(e){let t=e();typeof t.restoreFromUrlParams==`function`&&t.restoreFromUrlParams(a)}}})}function NM(e){let{currentComponent:t,side:n}=PM(e.ISINITOPEN||e.STARTUPMODUL);if(!t||!n)return;let r=ra.upperFirst(t.type);$.dispatch(`Menu/activateCurrentComponent`,{currentComponent:t,type:r,side:n})}function PM(e){let t=$.getters[`Menu/mainMenu`]?.sections||[],n=$.getters[`Menu/secondaryMenu`]?.sections||[],r=FM(t,e),i=FM(n,e);return r&&!i?{currentComponent:r,side:`mainMenu`}:!r&&i||r&&i?{currentComponent:i,side:`secondaryMenu`}:{currentComponent:void 0,side:void 0}}function FM(e,t){for(let n of e){let e=IM(n,t);if(e)return e}}function IM(e,t){for(let n of e||[])if(n.type){if(n.type.toUpperCase()===t.toUpperCase())return n;if(n.type.toUpperCase()===`FOLDER`&&Array.isArray(n.elements)){let e=IM(n.elements,t);
38if(e)return e}}}function LM(e){e.MAINWIDTH&&!OM()&&$.dispatch(`Menu/setCurrentMenuWidth`,{type:`mainMenu`,attributes:{width:e.MAINWIDTH}},{root:!0})}function RM(e){e.SECONDARYWIDTH&&!OM()&&$.dispatch(`Menu/setCurrentMenuWidth`,{type:`secondaryMenu`,attributes:{width:e.SECONDARYWIDTH}},{root:!0})}function zM(e){OM()||e.MAINCLOSED===`true`===$.getters[`Menu/mainExpanded`]&&$.dispatch(`Menu/toggleMenu`,`mainMenu`)}function BM(e){OM()||e.SECONDARYCLOSED===`true`===$.getters[`Menu/secondaryExpanded`]&&$.dispatch(`Menu/toggleMenu`,`secondaryMenu`)}var VM={processMenuUrlParams:jM,setAttributesToComponent:MM,isInitOpen:NM,getCurrentComponent:PM,findInSections:FM,findElement:IM,setMenuWidth:LM,setSecondaryMenuWidth:RM,setMainMenuClosed:zM,setSecondaryMenuClosed:BM},HM={QUERY:GM},UM={"SEARCH/QUERY":GM};function WM(){LA(HM,UM)}function GM(e){let t=e.QUERY?e.QUERY:e[`SEARCH/QUERY`],n=t?.toLowerCase().trim();$.commit(`Modules/SearchBar/setSearchInput`,t),$.watch((e,t)=>t[`Modules/SearchBar/searchResults`],e=>{e&&e.forEach(e=>{let t=e?.events?.onClick?.zoomToResult?.coordinates,r=e?.name?.toLowerCase().trim(),i=e?.searchInterfaceId?.includes(`elastic`);if(t&&r===n&&i){let e=t.map(e=>parseFloat(e,10));$.getters.styleListLoaded?($.dispatch(`Maps/zoomToCoordinates`,{center:e,zoom:$.getters[`Modules/SearchBar/zoomLevel`]}),$.dispatch(`Maps/placingPointMarker`,e)):$.watch((e,t)=>t.styleListLoaded,t=>{t&&($.dispatch(`Maps/zoomToCoordinates`,{center:e,zoom:$.getters[`Modules/SearchBar/zoomLevel`]}),$.dispatch(`Maps/placingPointMarker`,e))})}})},{deep:!0})}var KM={processSearchBarUrlParams:WM,setQueryToSearchInput:GM};y();function qM(){xn(()=>{lM.processLayerUrlParams(),EM.processMapUrlParams(),VM.processMenuUrlParams(),KM.processSearchBarUrlParams()})}var JM={startProcessUrlParams:qM},YM=e(cn());function XM(e,t){return{...t,_source:e.$options.name}}function ZM(e){return e&&e.replaceAll(`.`,`-`)}y();var QM={name:`LayerCheckBox`,components:{LayerPreview:xj},props:{conf:{type:Object,required:!0},isLayerTree:{type:Boolean,required:!0},disabled:{type:Boolean,default:!1}},computed:{...N([`singleBaselayer`,`visibleBaselayerConfigs`]),...N(`Modules/LayerSelection`,[`layersToAdd`,`highlightLayerId`]),isLayerVisible(){return typeof this.conf.visibility==`boolean`&&this.conf.visibility},isBold(){return this.isLayerVisible||this.highlightLayerId===this.conf.id},layerName(){return this.conf.shortname||this.conf.name}},mounted(){this.highlightLayerId===this.conf.id&&this.$nextTick(()=>{let e=document.querySelector(`#layer-selection-treenode-`+ZM(this.highlightLayerId));!e||this.hasAutoScrolled||(this.hasAutoScrolled=!0,setTimeout(()=>e.scrollIntoView({block:`nearest`,behavior:`smooth`}),0))})},methods:{...w([`replaceByIdInLayerConfig`]),...w(`Modules/LayerSelection`,[`changeVisibility`]),...o(`Modules/LayerSelection`,[`addSelectedLayer`,`removeSelectedLayer`]),escapeId:ZM,visibilityInLayerTreeChanged(e){let t=[];t.push({id:this.conf.id,layer:{id:this.conf.id,visibility:e}}),this.conf.baselayer&&Zl.checkAndAdd(this.singleBaselayer,this.visibleBaselayerConfigs,t),this.replaceByIdInLayerConfig(XM(this,{layerConfigs:t}))},clicked(){let e=!this.isLayerVisible;this.isLayerTree?this.visibilityInLayerTreeChanged(e):this.changeVisibility({layerId:this.conf.id,value:e})}}}
38,$M={key:0,class:`w-100 p-1`},eN=[`for`,`aria-label`],tN=[`id`,`aria-checked`,`aria-label`,`disabled`,`title`],nN=[`id`],rN={key:0,class:`bi-lock-fill pe-1`},iN=[`innerHTML`];function aN(e,t,n,r,i,o){let s=a(`LayerPreview`);return n.conf.baselayer&&!n.isLayerTree?(v(),M(`div`,$M,[A(s,{id:`layer-tree-layer-preview-`+n.conf.id,"layer-id":n.conf.id,checkable:!0,checked:o.isLayerVisible,"zoom-level":typeof n.conf.preview?.zoomLevel==`number`?n.conf.preview?.zoomLevel:null,radius:n.conf.preview?.radius?n.conf.preview?.radius:null,center:n.conf.preview?.center?n.conf.preview?.center:null,"custom-class":n.conf.preview?.customClass?n.conf.preview?.customClass:null,onPreviewClicked:t[0]||=e=>o.clicked()},null,8,[`id`,`layer-id`,`checked`,`zoom-level`,`radius`,`center`,`custom-class`]),z(`label`,{class:E([`pt-4`]),for:`layer-tree-layer-preview-`+n.conf.id,tabindex:`0`,"aria-label":o.layerName},[z(`span`,null,I(e.$t(n.conf.shortname||n.conf.name)),1)],8,eN)])):(v(),M(`button`,{key:1,id:`layer-checkbox-`+o.escapeId(n.conf.id),role:`checkbox`,"aria-checked":o.isLayerVisible,"aria-label":e.$t(o.layerName),disabled:n.disabled,class:`btn d-flex w-100 layer-tree-layer-title pe-2 p-1 btn-light`,title:e.$t(o.layerName),onClick:t[1]||=e=>o.clicked(),onKeydown:[t[2]||=me(on(e=>o.clicked(),[`prevent`]),[`enter`]),t[3]||=me(on(e=>o.clicked(),[`prevent`]),[`space`])]},[z(`span`,{id:`layer-tree-layer-checkbox-`+n.conf.id,class:E([`layer-tree-layer-checkbox ps-1 pe-3`,{"bi-check-square":!(n.conf.baselayer&&e.singleBaselayer)&&o.isLayerVisible,"bi-square":!(n.conf.baselayer&&e.singleBaselayer)&&!o.isLayerVisible,"bi-check-circle":n.conf.baselayer&&e.singleBaselayer&&o.isLayerVisible,"bi-circle":n.conf.baselayer&&e.singleBaselayer&&!o.isLayerVisible}])},null,10,nN),n.conf.isSecured?(v(),M(`i`,rN)):L(``,!0),z(`span`,{class:E([`layer-tree-layer-label`,`mt-0 d-flex flex-column align-self-start`,o.isBold?`font-bold`:``])},[z(`span`,{innerHTML:e.$t(n.conf.shortname||n.conf.htmlName||n.conf.name)},null,8,iN)],2)],40,tN))}var oN=K(QM,[[`render`,aN],[`__scopeId`,`data-v-b693f785`]]);y();var sN={name:`LayerComponentIconFilter`,components:{IconButton:ab},props:{layerConf:{type:Object,required:!0}},computed:{...N(`Modules/Filter`,[`icon`,`name`,`menuSide`]),...N(`Menu`,[`expanded`])},methods:{...w(`Menu`,[`changeCurrentComponent`,`toggleMenu`]),...o(`Modules/Filter`,[`setSelectedAccordions`]),showFilter(){this.setSelectedAccordions([{filterId:this.layerConf.filterRefId,layerId:this.layerConf.id}]),this.changeCurrentComponent({type:`filter`,side:this.menuSide,props:{name:this.name,icon:this.icon}}),this.expanded(this.menuSide)||this.toggleMenu(this.menuSide)}}},cN={key:0};function lN(e,t,n,r,i,o){let s=a(`IconButton`);return typeof n.layerConf.filterRefId==`number`?(v(),M(`div`,cN,[A(s,{"class-array":[`btn-light`],aria:e.$t(`common:modules.filter.name`),icon:e.icon,interaction:()=>o.showFilter()},null,8,[`aria`,`icon`,`interaction`])])):L(``,!0)}var uN=K(sN,[[`render`,lN]]);y();var dN={name:`LayerComponentIconInfo`,components:{IconButton:ab},props:{layerConf:{type:Object,required:!0},isLayerTree:{type:Boolean,required:!0}},computed:{...ue(Ml,[`icon`]),showInfoIcon(){return this.layerConf?.datasets!==!1}},methods:{...ie(Ml,[`startLayerInformation`]),...o(`Modules/LayerSelection`,[`setLayerInfoVisible`]),showLayerInformation(){this.startLayerInformation(XM(this,this.layerConf)),this.isLayerTree||this.setLayerInfoVisible(!0)}}},fN=[`id`];function pN(e,t,n,r,i,o){let s=a(`IconButton`);return v(),M(`div`,{id:`layer-component-icon-info-`+n.layerConf.id},[A(s,{id:`layer-component-icon-info-button-`+n.layerConf.id,"class-array":[`btn-light`],aria:e.$t(`common:modules.layerTree.infosAndLegend`),icon:e.icon,interaction:()=>o.showLayerInformation(),style:pe({visibility:o.showInfoIcon?`visible`:`hidden`})},null,8,[`id`,`aria`,`icon`,`interaction`,`style`])],8,fN)}var mN=K(dN,[[`render`,pN]]);y();var hN={name:`LayerComponentIconCustom`,components:{IconButton:ab},props:{layerConf:{type:Object,required:!0}},computed:{...N(`Menu`,[`expanded`]),customIconConfig(){return this.layerConf.customLayerIcon||{}}},methods:{executeCustomAction(){let e=this.customIconConfig.execute;
38e&&$.dispatch(e.action,e.payload)}}},gN={key:0};function _N(e,t,n,r,i,o){let s=a(`IconButton`);return o.customIconConfig.type===`customLayerIcon`?(v(),M(`div`,gN,[A(s,{"class-array":[`btn-light`],aria:o.customIconConfig.description,icon:o.customIconConfig.icon,interaction:o.executeCustomAction},null,8,[`aria`,`icon`,`interaction`])])):L(``,!0)}var vN=K(hN,[[`render`,_N]]);y();var yN={name:`LayerComponentIconSubMenu`,components:{IconButton:ab},props:{layerConf:{type:Object,required:!0}},mounted(){let e=this.$refs[`collapse-sub-menu`];e&&e.addEventListener(`show.bs.collapse`,()=>{this.setLayerInfo(this.layerConf),this.setMetadataURL(this.mdid),this.additionalSingleLayerInfo()})},methods:{...ie(Ml,[`setMetadataURL`,`additionalSingleLayerInfo`,`setLayerInfo`])}},bN=[`id`];function xN(e,t,n,r,i,o){let s=a(`IconButton`);return v(),M(`div`,{id:`layer-component-icon-sub-menu-`+n.layerConf.id,ref:`collapse-sub-menu`,class:`layer-component-icon-sub-menu`},[A(s,{id:`layer-component-icon-sub-menu-button-`+n.layerConf.id,"class-array":[`btn-light`],"data-bs-toggle":`collapse`,"data-bs-target":`#collapse-sub-menu-`+n.layerConf.id.split(`.`).join(`_`),icon:`bi-sliders`,aria:e.$t(`common:modules.layerTree.iconSubMenu`)},null,8,[`id`,`data-bs-target`,`aria`])],8,bN)}var SN=K(yN,[[`render`,xN]]);y();var CN={name:`LayerInfoContactButton`,components:{FlatButton:Zx},props:{layerName:{type:String,required:!0},previousComponent:{type:String,required:!0}},computed:{...N([`isModuleAvailable`,`portalConfig`]),...ue(Ml,[`layerInfo`,`pointOfContact`,`publisher`]),...N(`Modules/LayerTree`,[`menuSide`]),...N(`Modules/Contact`,{contactType:`type`,contactName:`name`}),...N(`Modules/BaselayerSwitcher`,[`topBaselayer`]),contact(){return this.pointOfContact||this.publisher||null},contactConfigured(){return this.isModuleAvailable(this.contactType)},infoMessage(){return this.portalConfig.tree.contactPublisherName&&this.contact.name?this.$t(`common:modules.layerInformation.contactPublisher`)+this.contact.name:this.$t(`common:modules.layerInformation.contactInfoMessage`)+this.layerName},mailSubject(){return this.$t(`common:modules.layerInformation.mailSubject`)+this.layerName},mailOriginHint(){let e=`{"layerInfo":{"id":"${this.layerInfo.id}"}}`;return this.$t(`common:modules.layerInformation.mailOriginHint`)+` <br>`+encodeURI(window.location.href.toString().split(`#`)[0]+`?MENU={"main":{"currentComponent":"layerInformation","attributes":${e}}}&LAYERS=[{"id":"${this.layerInfo.id}","visibility":true},{"id":"${this.topBaselayer?.id}","visibility":true}]`)}},methods:{...w(`Menu`,[`changeCurrentComponent`]),openContactModule(){let e={name:this.$t(this.contactName),to:[{email:this.contact.email,name:this.contact.name}],infoMessage:this.infoMessage,includeSystemInfo:!1,subject:this.mailSubject,mailOriginHint:this.mailOriginHint,withTicketNo:!1,noConfigProps:!0,previousComponent:this.previousComponent,layerName:this.layerName};this.changeCurrentComponent({type:this.contactType,side:this.menuSide,props:e})}}},wN={id:`'layer-component-sub-menu-contact-button' + layerConf.id`};function TN(e,t,n,r,i,o){let s=a(`FlatButton`);return v(),M(`div`,wN,[o.contactConfigured&&o.contact?(v(),F(s,{key:0,class:`mb-3 openContactButton`,interaction:o.openContactModule,text:e.$t(`common:modules.about.contactButton`),icon:`bi-envelope`,customclass:`btn-light`,title:e.$t(`common:modules.about.contactButton`)},null,8,[`interaction`,`text`,`title`])):L(``,!0)])}var EN=K(CN,[[`render`,TN]]);y();var DN={name:`LayerComponentSubMenu`,components:{FlatButton:Zx,SliderItem:pT,LayerInfoContactButton:EN},props:{layerConf:{type:Object,required:!0}},computed:{...N([`folderById`,`showFolderPath`,`portalConfig`,`layerConfig`]),...N(`Modules/LayerTree`,[`menuSide`]),...N(`Modules/LayerSelection`,{layerSelectionType:`type`,layerSelectionName:`name`}),transparency(){return this.layerConf.transparency||0},supportedTransparency(){let e=Gr.getLayerTypes3d().filter(e=>e!==`TILESET3D`);return this.layerConf.typ?.toUpperCase()===`GROUP3D`?this.layerConf.children.every(e=>e.typ?.toUpperCase()===`TILESET3D`):!e.includes(this.layerConf.typ?.toUpperCase())},layerName(){return this.layerConf?.datasets?.length>0&&this.layerConf.datasets[0].md_name?this.layerConf.datasets[0].md_name:this.layerConf.name},mdid(){return this.layerConf?.datasets?.length>0?this.layerConf.datasets[0].md_id:null},isRootLayer(){return this.layerConfig[er].elements.some(e=>e.type!==`folder`&&e.id===this.layerConf.id)}},methods:{...w(`Menu`,[`changeCurrentComponent`]),...w(`Modules/LayerTree`,[`removeLayer`,`updateTransparency`]),...w(`Modules/LayerSelection`,[`showLayer`]),getPath(){let e=[];this.getNamesOfParentFolder(this.layerConf.parentId,e),e=e.reverse();let t=e.map(e=>this.$t(e)===e?e:this.$t(e));return t.length>0?t.join(`/`):null},getNamesOfParentFolder(e,t){if(e!==void 0){let n=this.folderById(e);n&&(t.push(n.name),this.getNamesOfParentFolder(n.parentId,t))}return t},goToLayer(){this.changeCurrentComponent({type:this.layerSelectionType,side:this.menuSide,props:{layerId:this.layerConf.id,name:this.layerSelectionName}}),this.showLayer({layerId:this.layerConf.id})}}},ON=[`id`],kN={key:0}
38,AN=[`id`],jN=[`for`],MN={class:`remove-layer-container`};function NN(e,t,n,r,i,o){let s=a(`FlatButton`),c=a(`SliderItem`),l=a(`LayerInfoContactButton`);return v(),M(`div`,{id:`layer-component-sub-menu-`+n.layerConf.id,class:`d-flex flex-column layer-component-sub-menu`},[e.showFolderPath&&(o.getPath()||o.isRootLayer)?(v(),M(`div`,kN,[A(s,{interaction:o.goToLayer,text:o.isRootLayer?`common:modules.layerTree.rootLayerPath`:o.getPath(),customclass:`path btn-light`,icon:`bi-folder`},null,8,[`interaction`,`text`])])):L(``,!0),o.supportedTransparency?(v(),M(`div`,{key:1,id:`layer-component-icon-sub-menu-transparency-container-`+n.layerConf.id,class:`d-flex transparency-container`},[t[0]||=z(`i`,{class:`bi-droplet-half`},null,-1),z(`label`,{for:`layer-component-sub-menu-transparency-input-`+n.layerConf.id},I(e.$t(`common:modules.layerTree.iconTransparency`)+`:`),9,jN),A(c,{id:`layer-component-sub-menu-transparency-input-`+n.layerConf.id,aria:e.$t(`common:modules.aria.sliderAria`)+`${o.transparency}%`,label:`${o.transparency}%`,value:o.transparency,min:0,max:100,step:1,interaction:t=>e.updateTransparency({layerConf:n.layerConf,transparency:parseInt(t.target.value,10)}),"show-markers":!0},null,8,[`id`,`aria`,`label`,`value`,`interaction`])],8,AN)):L(``,!0),z(`div`,MN,[A(s,{interaction:()=>e.removeLayer(n.layerConf),text:`common:modules.layerTree.iconRemoveLayer`,customclass:`btn-light`,icon:`bi-trash3`},null,8,[`interaction`])]),e.portalConfig.tree.subMenuContactButton===!1?L(``,!0):(v(),F(l,{key:2,class:`layerInfo-contact-button`,"layer-name":o.layerName,"previous-component":`root`},null,8,[`layer-name`]))],8,ON)}var PN=K(DN,[[`render`,NN],[`__scopeId`,`data-v-d1a1af3d`]]),FN=e=>({computed:{...N(`Maps`,[`scale`,`scales`,`mode`]),...N([`layerConfigById`]),rawLayers(){return this[e].typ===`GROUP`&&(this[e].minScale||this[e].maxScale)?[this[e]]:(this[e].id??``).split(`-`).map(e=>jt.getLayerWhere({id:e})??null).filter(e=>!!e)},rawLayersScaleBoundaries(){return this.rawLayers.reduce(([e,t],n)=>{let r=this.layerConfigById(n.id),i=r?r.minScale:n.minScale,a=r?r.maxScale:n.maxScale,o=parseInt(i,10),s=parseInt(a,10);return[isNaN(o)?e:Math.min(o,e??1/0),isNaN(s)?t:Math.max(s,t??-1/0)]},[void 0,void 0])},tooltipText(){let[t,n]=this.rawLayersScaleBoundaries||[],r=this[e],i=r?.minScale===void 0?t??null:parseInt(r.minScale,10),a=r?.maxScale===void 0?n??null:parseInt(r.maxScale,10),o=i===0?this.scales[this.scales.length-1]:i;return o&&a?this.$t(`common:modules.layerTree.invisibleLayer`,{minScale:`1: `+Pm(o),maxScale:`1: `+Pm(a)}):o?this.$t(`common:modules.layerTree.invisibleLayerMinScale`,{minScale:`1: `+Pm(o)}):a?this.$t(`common:modules.layerTree.invisibleLayerMaxScale`,{maxScale:`1: `+Pm(a)}):``},scaleIsOutOfRange(){let t=this.rawLayers.length>0?this.rawLayers[0]:null,n=this[e],r=n?.minScale??t?.minScale,i=n?.maxScale??t?.maxScale;if(i===void 0)return!1;let a=this.scale>parseInt(i,10)||this.scale<parseInt(r,10),o=t?.id??null,s=this.layerConfigById(o);if(this.mode===`3D`&&s?.visibility!==!1){let e=W.getLayerById(o);e?.attributes?.is3DLayer?e.layer.setVisible(!a,mapCollection.getMap(`3D`),e.attributes):e?.attributes&&e.layer.setVisible(!a)}return a}}});y();var IN={name:`LayerComponent`,components:{LayerCheckBox:oN,LayerComponentIconFilter:uN,LayerComponentIconInfo:mN,LayerComponentIconCustom:vN,LayerComponentIconSubMenu:SN,LayerComponentSubMenu:PN},mixins:[FN(`conf`)],props:{conf:{type:Object,required:!0}},computed:{...N(`Maps`,[`mode`,`scale`,`scales`])},methods:{show(){let e=this.mode===`2D`?!Gr.getLayerTypes3d().includes(this.conf.typ?.toUpperCase()):!Gr.getLayerTypesNotVisibleIn3d().includes(this.conf.typ?.toUpperCase());return this.isLayerTree()?this.conf.showInLayerTree===!0&&e&&this.conf.isNeverVisibleInTree!==!0:e&&this.conf.isNeverVisibleInTree!==!0},isLayerTree(){return this.$parent.$options.name!==`LayerSelectionTreeNode`}}},LN=[`id`],RN={class:`d-flex justify-content-between align-items-center handle-layer-component-drag`},zN=[`data-bs-toggle`,`title`],BN={class:`d-flex`},VN=[`id`];function HN(e,t,n,r,i,o){let s=a(`LayerCheckBox`),c=a(`LayerComponentIconFilter`),l=a(`LayerComponentIconSubMenu`),u=a(`LayerComponentIconInfo`),d=a(`LayerComponentIconCustom`),f=
38a(`LayerComponentSubMenu`);return o.show()?(v(),M(`div`,{key:0,id:`layer-tree-layer-`+n.conf.id,class:E([`layer-tree-layer`,`d-flex`,`flex-column`,`justify-content-between`,o.isLayerTree()?``:`layer-selection`])},[z(`div`,RN,[z(`span`,{"data-bs-toggle":e.scaleIsOutOfRange?`tooltip`:null,"data-bs-placement":`bottom`,"data-bs-custom-class":`custom-tooltip`,title:e.scaleIsOutOfRange?e.tooltipText:``,class:`layer-checkbox-tooltip`},[A(s,{conf:n.conf,disabled:e.scaleIsOutOfRange,"is-layer-tree":o.isLayerTree()},null,8,[`conf`,`disabled`,`is-layer-tree`])],8,zN),z(`div`,BN,[A(c,{"layer-conf":n.conf},null,8,[`layer-conf`]),o.isLayerTree()?(v(),F(l,{key:0,"layer-conf":n.conf},null,8,[`layer-conf`])):L(``,!0),A(u,{"is-layer-tree":o.isLayerTree(),"layer-conf":n.conf},null,8,[`is-layer-tree`,`layer-conf`]),o.isLayerTree()?(v(),F(d,{key:1,"layer-conf":n.conf},null,8,[`layer-conf`])):L(``,!0)])]),o.isLayerTree()?(v(),M(`div`,{key:0,id:`collapse-sub-menu-`+n.conf.id.split(`.`).join(`_`),class:`collapse`},[A(f,{"layer-conf":n.conf},null,8,[`layer-conf`])],8,VN)):L(``,!0)],10,LN)):L(``,!0)}var UN=K(IN,[[`render`,HN],[`__scopeId`,`data-v-161fb318`]]);y();var WN={name:`LayerTreeNode`,components:{Draggable:YM.default,Layer:UN},data(){return{isOpen:!1,sortedByLayerSequence:!1,firstDrag:!1}},computed:{...N([`portalConfig`,`allLayerConfigs`,`layerConfigsByAttributes`,`showLayerAddButton`]),...N(`Modules/LayerTree`,[`delay`,`delayOnTouchOnly`,`removeOnSpill`,`touchStartThreshold`,`layerTreeSortedLayerConfigs`]),sortedLayerConfig:{get(){return this.layerTreeSortedLayerConfigs(!this.firstDrag)},set(e){let t=e.length;this.sortedByLayerSequence=!0,e.forEach(e=>{e.zIndex=--t,this.replaceByIdInLayerConfig(e)})}}},mounted(){this.showLayerAddButton||this.setRemoveOnSpill(!1)},methods:{...w(`Modules/LayerTree`,[`removeLayer`,`replaceByIdInLayerConfig`]),...o(`Modules/LayerTree`,[`setRemoveOnSpill`]),isLayerShowInLayerTree(e){return e?.type===`layer`&&e?.showInLayerTree===!0&&e?.isNeverVisibleInTree!==!0},getLayerArray(e){return e?.elements?e.elements.filter(e=>e.type===`layer`&&e.showInLayerTree===!0):[]},removeLayerOnSpill(e){this.showLayerAddButton&&this.removeLayer(this.sortedLayerConfig[e.oldIndex])},hideTooltip(e){let t=e.item.querySelector(`.layer-checkbox-tooltip`).getAttribute(`aria-describedby`);t&&(document.getElementById(t).style.display=`none`)},checkMove(e){if(this.portalConfig.tree.allowBaselayerDrag!==!1)return this.firstDrag=!0,!0;let t=e.draggedContext.element,n=e.relatedContext.element;return t.baselayer&&!n.baselayer||!t.baselayer&&n.baselayer?!1:(this.firstDrag=!0,!0)}}};function GN(e,t,n,r,i,o){let s=a(`Layer`),c=a(`Draggable`);return v(),F(c,{modelValue:o.sortedLayerConfig,"onUpdate:modelValue":t[0]||=e=>o.sortedLayerConfig=e,class:`dragArea no-list ps-0 ms-2`,tag:`ul`,"item-key":`name`,"chosen-class":`chosen`,handle:`.handle-layer-component-drag`,"delay-on-touch-only":e.delayOnTouchOnly,delay:e.delay,"remove-on-spill":e.removeOnSpill,"touch-start-threshold":e.touchStartThreshold,onSpill:o.removeLayerOnSpill,move:o.checkMove,onStart:o.hideTooltip},{item:Pn(({element:e})=>[z(`li`,null,[o.isLayerShowInLayerTree(e)?(v(),F(s,{key:0,conf:e},null,8,[`conf`])):o.getLayerArray(e).length>0?(v(!0),M(D,{key:1},C(o.getLayerArray(e),(e,t)=>(v(),F(s,{key:`layer`+t,conf:e},null,8,[`conf`]))),128)):L(``,!0)])]),_:1},8,[`modelValue`,`delay-on-touch-only`,`delay`,`remove-on-spill`,`touch-start-threshold`,`onSpill`,`move`,`onStart`])}var KN=K(WN,[[`render`,GN],[`__scopeId`,`data-v-7ff3abdd`]]);y();var qN={name:`ElevatedButton`,props:{text:{type:String,required:!0},interaction:{type:Function,required:!0},icon:{type:String,default:null,required:!1}}},JN=[`aria-label`];function YN(e,t,n,r,i,a){return v(),M(`button`,{class:`btn btn-primary d-flex align-items-center shadow`,type:`button`,"aria-label":n.text,onClick:t[0]||=(...e)=>n.interaction&&n.interaction(...e)},[n.icon===null?L(``,!0):(v(),M(`i`,{key:0,class:E(n.icon),role:`img`},null,2)),R(` `+I(e.$t(n.text)),1)],8,JN)}var XN=K(qN,[[`render`,YN],[`__scopeId`,`data-v-b7d36553`]]);y();var ZN={name:`LayerTree`,components:{ElevatedButton:XN,LayerTreeNode:KN},computed:{...N([`addLayerButton`,`allLayerConfigsStructured`,`showLayerAddButton`,`portalConfig`]),...N(`Modules/LayerTree`,[`menuSide`]),...N(`Modules/LayerSelection`,{layerSelectionType:`type`,layerSelectionName:`name`}),title(){return typeof this.addLayerButton?.buttonTitle==`string`&&this.addLayerButton?.buttonTitle!==``?this.addLayerButton?.buttonTitle:`common:modules.layerTree.addLayer`},reverseLayer(){return!!this.addLayerButton?.reverseLayer}},methods:{...w(`Modules/LayerSelection`,[`navigateForward`]),...w(`Menu`,[`changeCurrentComponent`]),...o(`Modules/LayerSelection`,{setLayerSelectionVisible:`setVisible`}),sort(e){return Al(e,e=>e.type!==`folder`)}
38,reverseAllLayerConfigs(e){return e.reverse().forEach(e=>{e.type===`folder`&&this.reverseAllLayerConfigs(e.elements)}),e},showLayerSelection(){let e=this.allLayerConfigsStructured(er),t=this.sort(this.reverseLayer?this.reverseAllLayerConfigs(e):e),n=this.allLayerConfigsStructured($n);this.changeCurrentComponent({type:this.layerSelectionType,side:this.menuSide,props:{name:this.layerSelectionName}}),this.navigateForward({lastFolderName:`root`,subjectDataLayerConfs:t,baselayerConfs:n}),this.setLayerSelectionVisible(!0)}}},QN={id:`layer-tree`,class:`layer-tree`},$N={key:0,class:`mt-4 d-flex justify-content-center sticky`};function eP(e,t,n,r,i,o){let s=a(`LayerTreeNode`),c=a(`ElevatedButton`);return v(),M(D,null,[z(`div`,QN,[A(s),e.showLayerAddButton?(v(),M(`div`,$N,[A(c,{id:`add-layer-btn`,"aria-label":e.$t(o.title),interaction:o.showLayerSelection,text:e.$t(o.title),icon:`bi-plus-circle`},null,8,[`aria-label`,`interaction`,`text`])])):L(``,!0)]),t[0]||=z(`hr`,null,null,-1)],64)}var tP=K(ZN,[[`render`,eP],[`__scopeId`,`data-v-ffa78421`]]);y();var nP={name:`MenuContainerBodyRootItemElement`,components:{LightButton:pb},props:{name:{type:String,required:!0,validator:e=>e!==``},description:{type:String,default:``},icon:{type:String,default:``,validator:e=>e.startsWith(`bi-`)},path:{type:Array,default:()=>[]},properties:{type:Object,required:!0}},computed:{...N([`deviceMode`,`portalConfig`]),...N(`Maps`,[`mode`]),...N(`Menu`,[`mainMenu`,`secondaryMenu`,`showDescription`,`expanded`,`currentComponent`,`currentComponentName`,`navigationHistory`]),...N([`visibleLayerConfigs`]),menu(){return this.side===`mainMenu`?this.mainMenu:this.secondaryMenu},showIcon(){return typeof this.icon==`string`&&this.icon.length>0},side(){return this.path[0]},type(){return this.properties.type},isAllRequiredLayersVisible(){return this.areLayersVisible(this.properties?.showOnlyByLayersVisible)},hasVisibleChildElement(){return Array.isArray(this.properties?.elements)?this.properties.elements.some(e=>this.areLayersVisible(e.showOnlyByLayersVisible)):!1}},watch:{visibleLayerConfigs:{handler(e,t){if(!Array.isArray(this.properties.elements))return;let n=(t||[]).filter(e=>e.visibility).map(e=>e.id),r=(e||[]).filter(e=>e.visibility).map(e=>e.id);for(let e of this.properties.elements){let t=e.showOnlyByLayersVisible||[],i=t.some(e=>r.includes(e)&&!n.includes(e));if(t.length!==0&&i&&this.areLayersVisible(t)){this.properties.showEntryDirectly===!0&&this.type===`folder`&&(this.expanded(this.side)||this.toggleMenu(this.side),this.currentComponent(this.side)?.props?.name!==this.name&&!this.navigationHistory(this.side)?.some(e=>e?.props?.name===this.name)&&this.changeCurrentComponent({type:this.type,side:this.side,props:{name:this.name,path:this.path}}));break}}},deep:!0}},created(){this.type===this.menu.currentComponent&&this.type!==`folder`&&this.clickedMenuElement({name:this.name,path:this.path,side:this.side,type:this.type,properties:this.properties})},methods:{...w(`Menu`,[`clickedMenuElement`,`resetMenu`,`changeCurrentComponent`,`toggleMenu`]),areLayersVisible(e){if(!Array.isArray(e)||e.length===0)return!0;let t=this.visibleLayerConfigs?.filter(e=>e.visibility).map(e=>e.id);return e.every(e=>t?.includes(e))},checkIsVisible(){let{supportedMapModes:e,supportedDevices:t,supp
38ortedTreeTypes:n,elements:r}=this.properties,i=Dj.isModuleVisible({mapMode:this.mode,deviceMode:this.deviceMode,treeType:this.portalConfig?.tree?.type,elements:r,supportedMapModes:e,supportedDevices:t,supportedTreeTypes:n,visibleLayerConfigs:this.visibleLayerConfigs});return!i&&this.menu.currentComponent===this.type&&this.menu.navigation.currentComponent.props.name===this.name&&this.resetMenu(this.side),i&&(this.isAllRequiredLayersVisible||this.hasVisibleChildElement)}}};function rP(e,t,n,r,i,o){let s=a(`LightButton`);return v(),M(`div`,null,[o.checkIsVisible()?(v(),F(s,{key:0,interaction:()=>e.clickedMenuElement({name:n.name,path:n.path,side:o.side,type:o.type,properties:n.properties}),text:n.name,icon:o.showIcon?n.icon:null,description:e.showDescription(o.side)?n.description:null,customclass:`w-100 justify-content-start mp-menu-root-element`},null,8,[`interaction`,`text`,`icon`,`description`])):L(``,!0)])}var iP=K(nP,[[`render`,rP],[`__scopeId`,`data-v-8e05ff17`]]);y();var aP={name:`MenuContainerBodyRootItems`,components:{MenuContainerBodyRootItemElement:iP},props:{idAppendix:{type:String,required:!0},path:{type:Array,default:()=>[]},side:{type:String,default:`mainMenu`,validator:e=>e===`mainMenu`||e===`secondaryMenu`}},computed:{...N(`Menu`,[`customMenuElementIcon`,`section`,`sectionsBySide`]),sections(){return this.sectionsBySide(this.side)}},watch:{sections:{handler(){this.prepareItemProps()},deep:!0}},created(){this.prepareItemProps()},methods:{chooseProperties(e){let t=e;if(`type`in e){if(Fl(e.type)){let t=Pl(e.type)();return{name:t.name,icon:t.icon,description:t.description,...e,type:e.type}}let n=this.$store.state.Modules[ra.upperFirst(e.type)];e.type===`customMenuElement`&&!Object.prototype.hasOwnProperty.call(t,`icon`)&&(t.icon=this.customMenuElementIcon),typeof n==`object`&&(t=n)}return t},prepareItemProps(){this.itemProps=[];let e=this.section(this.path);e&&(Array.isArray(e)?this.section(this.path).forEach(e=>{let t=this.chooseProperties(e);t&&this.itemProps.push(t)}):e.elements.forEach(e=>{let t=this.chooseProperties(e);t&&this.itemProps.push(t)}))}}},oP=[`id`];function sP(e,t,n,r,i,o){let s=a(`MenuContainerBodyRootItemElement`);return v(),M(`div`,{id:`mp-menu-body-items-`+n.idAppendix,class:`flex-column`},[(v(!0),M(D,null,C(e.itemProps,(e,t)=>(v(),F(s,{id:`mp-menu-body-items-element-`+t+`-`+n.idAppendix,key:t,properties:e,name:e.name,icon:e.icon,description:e.description,path:[...n.path,t]},null,8,[`id`,`properties`,`name`,`icon`,`description`,`path`]))),128))],8,oP)}var cP=K(aP,[[`render`,sP]]);y();var lP={name:`MenuContainerBodyRoot`,components:{LayerTree:tP,MenuContainerBodyRootItems:cP},props:{side:{type:String,default:`mainMenu`,validator:e=>e===`mainMenu`||e===`secondaryMenu`}},computed:{...N(`Menu`,[`mainMenu`,`secondaryMenu`,`sectionHasItems`,`titleBySide`]),menu(){return this.side===`mainMenu`?this.mainMenu:this.secondaryMenu}},methods:{path(e){return[this.side,`sections`,e]}}},uP=[`id`];function dP(e,t,n,r,i,o){let s=a(`LayerTree`),c=a(`MenuContainerBodyRootItems`);return v(),M(`div`,{id:`mp-body-root-`+n.side},[n.side===`mainMenu`?(v(),F(s,{key:0})):L(``,!0),(v(!0),M(D,null,C(o.menu.sections,(r,i)=>(v(),M(D,{key:i},[e.sectionHasItems(n.side,i)?(v(),M(D,{key:0},[A(c,{"id-appendix":n.side,side:n.side,path:o.path(i)},null,8,[`id-appendix`,`side`,`path`]),t[0]||=z(`hr`,null,null,-1)],64)):L(``,!0)],64))),128))],8,uP)}var fP=K(lP,[[`render`,dP]]);y();var pP={name:`MenuNavigation`,props:{side:{type:String,required:!0,validator:e=>e===`mainMenu`||e===`secondaryMenu`}},computed:{...N(`Menu`,[`previousNavigationEntryText`,`currentComponent`,`showHeaderIcon`,`secondaryMenuEnabled`]),...N([`isMobile`]),currentMenuComponent(){return this.currentComponent(this.side)||{}},previousNavigation(){return this.previousNavigationEntryText(this.side)},currentTitle(){let e=this.currentMenuComponent,t=e?.props?.name||`common:modules.${e?.type}.name`;return this.$t(t)},currentIcon(){return this.currentMenuComponent?.props?.icon},showIcon(){return this.showHeaderIcon(this.side)},isSecondaryGfiWithoutMenu(){return this.side===`secondaryMenu`&&!this.secondaryMenuEnabled&&this.currentMenuComponent.type===`getFeatureInfo`},showPreviousNavigation(){if(!this.previousNavigation)return!1;let e=this.previousNavigation===this.$t(`common:modules.menu.name`);return!(this.isSecondaryGfiWithoutMenu&&e)},showCloseButton(){return!this.isMobile&&(this.showPreviousNavigation||this.isSecondaryGfiWithoutMenu)}},methods:{...w(`Menu`,[`navigateBack`,`resetMenu`])}},mP=[`id`],hP={class:`mp-menu-navigation`},gP=[`id`],_P={class:`mp-menu-navigation-link-text mb-1`},vP=[`id`,`aria-label`],yP={key:0,class:`mp-menu-navigation-moduletitle mb-4`};function bP(e,t,n,r,i,a){return a.showPreviousNavigation||a.showCloseButton?(v(),M(`div`,{key:0,id:`mp-menu-navigation-`+n.side},[z(`div`,hP,[a.showPreviousNavigation?(v(),M(`a`,{key:0,id:`mp-navigation-`+n.side,class:`pt-2 mp-menu-navigation-link`,href:`#`,onClick:t[0]||=on(t=>e.navigateBack({side:n.side}),[`prevent`]),onKeypress:t[1]||=t=>e.navigateBack({side:n.side})},[z(`h6`,_P,[t[3]||=z(`p`,{class:`bi-chevron-left me-2`},null,-1),R(I(a.previousNavigation),1)])],40,gP)):L(``,!0),a.showCloseButton?(v(),M(`button`,{key:1,id:`mp-menu-navigation-reset-button-`+n.side,type:`button`,class:`btn-close mp-menu-navigation-reset-button ms-auto`,"aria-label":e.$t(`common:modules.menu.ariaLabelClose`),onClick:t[2]||=t=>e.resetMenu(n.side)},null,8,vP)):L(``,!0)]),a.currentTitle===`none`?L(``,!0):(v(),M(`h4`,yP,[a.showIcon&&a.currentIcon!==null?(v(),M(`i`,{key:0,class:E([a.currentIcon,`col-2`]),role:`img`},null,2)):L(``,!0),R(` `+I(a.currentTitle),1)]))],8,mP)):L(``,!0)}var xP=K(pP,[[`render`,bP],[`__scopeId`,`data-v-8b1aeb45`]]);function SP(e,t=null){if(typeof e!=`string`)return``;let n=Object.assign({uppercase:!0,replacements:{_:` `}},t),r=e;return typeof n.replacements==`object`&&n.replacements!==null&&Object.keys(n.replacements).forEac
38h(e=>{typeof n.replacements[e]==`string`&&(r=r.split(e).join(n.replacements[e]))}),n.uppercase&&(r=r.charAt(0).toUpperCase()+r.substring(1)),r}function CP(e,t){if(typeof e!=`string`||typeof t!=`function`)return``;let n=t(e),r=e.split(`:`);return r.length>2||r.length===2&&r[1]===n?e:n}function wP(e){return new RegExp(/^\+[0-9]{2,4}[^a-zA-Z]*$/).test(e)}function TP(e,t=`tel:`){let n=String(e);return[` `,`-`,`(`,`)`,`.`,`/`].forEach(e=>{n=n.split(e).join(``)}),t+n}function EP(e){return typeof e!=`string`||e.length<6||e.length>254?!1:new RegExp(/(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/i).test(e)}function DP(e){if(!e)return!1;let t=e.match(/<\/?[^>]+(>|$)/g),n=[`br`,`img`,`input`,`meta`,`link`,`hr`,`base`,`col`,`command`,`embed`,`keygen`,`param`,`source`,`track`,`wbr`];if(t){let e=t.filter(e=>{let t=e.slice(1,-1);return!e.startsWith(`</`)&&!n.includes(t)&&!t.endsWith(`/`)}),r=t.filter(e=>e.startsWith(`</`));if(e.length!==r.length)return!1}return!0}function OP(e){let t=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi.test(e),n=/onerror|onload|onclick|onchange|onmouseover|onmouseout|onkeydown|onkeyup|onkeypress/gi.test(e);return!!(t||n)}function kP(e){let t=/<\/?[a-z][\s\S]*>/i.test(e);return!(!e||typeof e!=`string`||!DP(e)||OP(e)||!t)}y();var AP={name:`CompareFeatureIcon`,props:{feature:{type:Object,required:!0}},data:function(){return{gfiFeature:{featureId:this.feature.getId(),layerId:this.feature.getLayerId(),layerName:this.feature.getTitle(),attributesToShow:this.feature.getAttributesToShow(),properties:this.feature.getMappedProperties()}}},computed:{...N(`Modules/CompareFeatures`,{isFeatureSelected:`isFeatureSelected`,compareFeaturesType:`type`}),...N(`Maps`,[`mode`]),...N([`configuredModules`]),featureIsOnCompareList(){return this.isFeatureSelected(this.gfiFeature)}},watch:{feature(e){this.gfiFeature={featureId:e.getId(),layerId:e.getLayerId(),layerName:e.getTitle(),attributesToShow:e.getAttributesToShow(),properties:e.getMappedProperties()}}},methods:{...w(`Modules/CompareFeatures`,[`isFeatureOnCompareList`,`removeFeature`]),toogleFeatureToCompareList:function(e){if(e?.target?.classList?.contains(`bi-star`))this.isFeatureOnCompareList(this.gfiFeature);else{let e=this.gfiFeature.layerId,t=this.gfiFeature.featureId;this.removeFeature({idFeature:t,idLayer:e})}}}},jP=[`title`];function MP(e,t,n,r,i,a){return e.mode===`2D`&&e.configuredModules.some(t=>t.type===e.compareFeaturesType)?(v(),M(`span`,{key:0,class:`bootstrap-icon`,title:a.featureIsOnCompareList?e.$t(`modules.getFeatureInfo.favoriteIcons.compareFeatureIcon.fromCompareList`):e.$t(`modules.getFeatureInfo.favoriteIcons.compareFeatureIcon.toCompareList`),role:`button`,tabindex:`0`,onClick:t[0]||=(...e)=>a.toogleFeatureToCompareList&&a.toogleFeatureToCompareList(...e),onKeydown:t[1]||=me((...e)=>a.toogleFeatureToCompareList&&a.toogleFeatureToCompareList(...e),[`enter`])},[z(`i`,{class:E([a.featureIsOnCompareList?`bi-star-fill`:`bi-star`])},null,2)],40,jP)):L(``,!0)}var NP=K(AP,[[`render`,MP],[`__scopeId`,`data-v-37d22ae5`]]);function PP(e,t){return typeof t!=`string`||typeof e!=`string`?!1:t.substr(0,1)===`/`?e+t:e+`/`+t}function FP(e,t,n,r,i){new Nd({removeIotLinks:!0}).get(e,t,n,r,i)}function IP(e,t,n,r=null,i=!1){return LP([e],t,n,r,[i||Ro()])}function LP(e,t,n,r=null,i=!1){if(!Array.isArray(e))return!1;let a=[],o=[],s=Array.isArray(i)&&i.length?i:zo();return e.forEach((e,i)=>{if(!Array.isArray(e))return;let c=[],l=[];e.forEach(e=>{RP(e)&&(l.push(zP(e.phenomenonTime,n)),c.push(e.result))}),a.push(l),o.push(Object.assign({label:t,data:c,borderColor:f_(s[i%s.length],`rgbaString`),backgroundColor:f_(s[i%s.length],`rgbaString`),spanGaps:!1,fill:!1,borderWidth:2,pointRadius:4,pointHoverRadius:4,lineTension:0},r))}),!Array.isArray(a)||!a.length||!Array.isArray(o)||!o.length?!1:{datasets:o,labels:a[0]}}function RP(e){return typeof e==`object`&&!!e&&(typeof e[`@iot.id`]==`number`||typeof e[`@iot.id`]==`string`)&&typeof e.phenomenonTime==`string`&&Object.prototype.hasOwnProperty.call(e,`result`)}function zP(e,t){if(typeof e!=`string`||typeof t!=`string`)return!1;let n=(0,G.default)(e.indexOf(`/`)===-1?e:e.split(`/`)[0]);return n.isValid()?n.format(t):!1}function BP(e,...t){return typeof e!=`object`||!e?(console.error(`deepAssign: The given target is not an object. Please check the target object before handing it over to deepAssign.`),null):(t.forEach(t=>{VP(e,t,200)}),e)}function VP(e,t,n,r=0,i=!1,a=!0){if(n<=r||typeof t!=`object`||!t)return null;for(let[o]of Object.entries(t)){if(e==null)return null;let s=i?Object.keys(e).find(e=>e.toLowerCase()===o.toLowerCase()):o;if(typeof t[o]==`object`&&t[o]!==null)if(a&&(!Object.prototype.hasOwnProperty.call(e,s)||typeof e[s]!=`object`||e[s]===null)&&(e[s]={}),Array.isArray(t[o])&&typeof t[o][0]!=`object`)e[s]=t[o];else{let c=VP(e[s],t[o],n,r+1,i,a);if(!a&&c==null)return null}else e[s]=t[o]}return e}y();var HP={name:`LinechartItem`,props:{givenOptions:{type:Object,required:!1,default:null},data:{type:Object,required:!0}},data(){return{defaultOptions:{responsive:!0,plugins:{legend:{dis
38play:!1}},scales:{y:{ticks:{precision:0,beginAtZero:!0,callback:e=>Pm(e)}}},tooltips:{callbacks:{label:(e,t)=>t.datasets[e.datasetIndex].label+`: `+Pm(e.value)}}},chart:null}},watch:{data(e){this.resetChart(e)}},mounted(){this.$nextTick(()=>{this.resetChart(this.data)})},beforeUnmount(){this.destroyChart()},methods:{resetChart(e){let t=this.$el;if(!t||typeof t.getContext!=`function`)return;let n=typeof Kt.getChart==`function`?Kt.getChart(t):null,r=t.getContext(`2d`),i={type:`line`,data:e,options:this.getChartJsOptions(this.defaultOptions,this.givenOptions)};n&&(n.stop(),n.destroy(),this.chart===n&&(this.chart=null)),this.chart&&this.destroyChart(),r&&(this.chart=new Kt(r,i))},getChartJsOptions(e,t){return typeof e!=`object`||!e?typeof t==`object`&&t?t:{}:BP(e,t)},destroyChart(){let e=this.$el,t=e&&typeof Kt.getChart==`function`?Kt.getChart(e):null;t&&(t.stop(),t.destroy(),this.chart===t&&(this.chart=null)),this.chart&&=(this.chart.stop(),this.chart.destroy(),null)}}};function UP(e,t,n,r,i,a){return v(),M(`canvas`)}var WP=K(HP,[[`render`,UP]]);function GP(e){return new Blob([``,e],{type:`text/csv;charset=utf-8,%EF%BB%BF`})}function KP(e,t){return typeof navigator.msSaveBlob==`function`?(navigator.msSaveBlob(e,t),!0):!1}function qP(e,t,n=!1){let r=document.createElement(`a`),i=``;return r?.download===void 0||typeof URL?.createObjectURL!=`function`?(typeof n==`function`&&n(`ExportButtonCSV: this browser does not support HTML5 download attribute`),!1):(i=URL.createObjectURL(e),r.setAttribute(`href`,i),r.setAttribute(`download`,t),r.style.visibility=`hidden`,document.body.appendChild(r),r.click(),URL.revokeObjectURL(i),document.body.removeChild(r),!0)}y();var JP={name:`ExportButtonCSV`,props:{title:{type:String,required:!1,default:`common:shared.modules.buttons.download`},data:{type:[Object,Boolean],required:!1,default:!1},handler:{type:[Function,Boolean],required:!1,default:!1},url:{type:[String,Boolean],required:!1,default:!1},filename:{type:[String,Boolean],required:!1,default:!1},postfixFormat:{type:String,required:!1,default:`_YYYY-MM-DD_HH-mm-ss`},useSemicolon:{type:Boolean,required:!1,default:!1}},data(){return{downloadDisabled:!1}},methods:{enableDownload(){this.downloadDisabled=!1},disableDownload(){this.downloadDisabled=!0},enableDownloadAfterTimeout(){setTimeout(()=>{this.downloadDisabled=!1},2200)},handleDownloadError(e){console.warn(e),this.$store.dispatch(`Alerting/addSingleAlert`,i18next.t(`common:shared.modules.buttons.error.download`))},download(){if(this.downloadDisabled)return;let e=typeof this.filename==`string`&&this.createFilename(this.filename,this.postfixFormat);this.disableDownload(),typeof this.data==`object`&&this.data!==null?this.downloadWithData(this.data,e):typeof this.handler==`function`?this.downloadWithHandler(this.handler,e):typeof this.url==`string`&&typeof e==`string`?this.downloadWithUrl(this.url,e):typeof this.url==`string`?(window.location=this.url,this.enableDownloadAfterTimeout()):(this.handleDownloadError(`ExportButtonCSV: no data, handler or url was given to download something`),this.enableDownload())},downloadWithData(e,t){let n=mp(e,e=>{this.handleDownloadError(e)},this.useSemicolon);this.fakeDownloadCsvText(n,t||`download`,e=>{this.handleDownloadError(e)}),this.enableDownloadAfterTimeout()},downloadWithHandler(e,t){e(e=>{this.downloadWithData(e,t)})},downloadWithUrl(e,t){this.downloadUrl(e,e=>{this.fakeDownloadCsvText(e,t,e=>{this.handleDownloadError(e)}),this.enableDownloadAfterTimeout()},e=>{this.handleDownloadError(e),this.enableDownload()})},fakeDownloadCsvText(e,t,n){if(typeof e!=`string`)return typeof n==`function`&&n(`ExportButtonCSV: The given csv text is not a string.`),!1;let r=GP(e);return KP(r,t)||qP(r,t,n)?!0:(typeof n==`function`&&n(`ExportButtonCSV: Neither navigator nor html5 technic available for download.`),!1)},downloadUrl(e,t,n){B.get(e).then(r=>{if(!Object.prototype.hasOwnProperty.call(r,`data`)&&typeof n==`function`){n(`ExportButtonCSV: the called url generates no valid axios data attribute - `+e);return}typeof t==`function`&&t(r.data)}).catch(e=>n(e))},createFilename(e,t){return t?String(e)+(0,G.default)().format(String(t))+`.csv`:String(e)+`.csv`}}},YP={class:`btn-texts`},XP={key:1,type:`button`,class:E([`btn`,`exportButton`]),disabled:``},ZP={class:`btn-texts`};function QP(e,t,n,r,i,a){return i.downloadDisabled?(v(),M(`button`,XP,[t[2]||=z(`span`,{class:`bootstrap-icon spin-animation`},[z(`i`,{class:`bi-cloud-arrow-down-fill`})],-1),z(`span`,ZP,I(e.$t(n.title)),1)])):(v(),M(`button`,{key:0,t
38ype:`button`,class:E([`btn`,`exportButton`]),onClick:t[0]||=e=>a.download()},[t[1]||=z(`span`,{class:`bootstrap-icon`},[z(`i`,{class:`bi-cloud-arrow-down-fill`})],-1),z(`span`,YP,I(e.$t(n.title)),1)]))}var $P=K(JP,[[`render`,QP],[`__scopeId`,`data-v-d094106b`]]);y();var eF={name:`DefaultThemeSensorChart`,components:{LinechartItem:WP,ExportButtonCSV:$P},props:{type:{type:String,required:!1,default:``},label:{type:String,required:!1,default:``},query:{type:String,required:!1,default:``},format:{type:String,required:!1,default:``},staObject:{type:Object,required:!1,default:null},options:{type:Object,required:!1,default:null},chartOptions:{type:Object,required:!1,default:null},download:{type:Boolean,required:!1,default:!1}},data:()=>({linechartData:null,linechartDataOptions:{},downloadUrl:!1,downloadFilename:!1}),watch:{staObject(e){e&&(this.linechartData=null,this.initChart(),this.initDownloadUrl())}},mounted(){this.staObject&&(this.linechartData=null,this.initChart(),this.initDownloadUrl())},methods:{initChart(){let e=PP(this.staObject[`@iot.selfLink`],this.query);this.linechartDataOptions=Object.assign({legend:{display:!1}},this.chartOptions),FP(e,e=>{let t=this.label?this.label:this.staObject.name;this.downloadFilename=t,this.linechartData=IP(e,t,this.format,this.options)},()=>{},()=>{},e=>{console.error(e)})}
38,initDownloadUrl(){typeof this.download==`boolean`&&this.download&&(this.downloadUrl=PP(this.staObject[`@iot.selfLink`],this.query)+`&$resultFormat=CSV`)}}},tF={key:0,class:`link`};function nF(e,t,n,r,i,o){let s=a(`LinechartItem`),c=a(`ExportButtonCSV`);return v(),M(`div`,null,[z(`div`,null,[e.linechartData?(v(),F(s,{key:0,"given-options":e.linechartDataOptions,data:e.linechartData},null,8,[`given-options`,`data`])):L(``,!0)]),typeof e.downloadUrl==`string`?(v(),M(`div`,tF,[A(c,{url:e.downloadUrl,filename:e.downloadFilename},null,8,[`url`,`filename`])])):L(``,!0)])}var rF=K(eF,[[`render`,nF],[`__scopeId`,`data-v-b12a56d6`]]);function iF(e,t=`@`,n=`.`,r=20){if(typeof e!=`object`||!e||typeof r!=`number`||r<0||typeof t!=`string`||typeof n!=`string`)return!1;let i={};for(let[a,o]of Object.entries(e))typeof o==`object`&&o?aF(o,i,t+oF(a),0,r,n):i[a]=o;return i}function aF(e,t,n,r,i,a){if(!(r>=i))for(let[o,s]of Object.entries(e))typeof s==`object`&&s?aF(s,t,n+a+oF(o),r+1,i,a):t[n+a+oF(o)]=s}function oF(e,t=`.`,n=`\\`){if(typeof e!=`string`)return e;let r=e.length,i=``;for(let a=0;a<r;a++)e[a]===t&&(i+=n),i+=e[a];return i}y();var sF={name:`DefaultTheme`,components:{CompareFeatureIcon:n(NP),DefaultThemeSensorChart:n(rF)},props:{feature:{type:Object,required:!0}},data:()=>({importedComponents:[],showFavoriteIcons:!0,beautifyKeysParam:!0,showObjectKeysParam:!1}),computed:{mimeType:function(){return this.feature.getMimeType()}},watch:{feature(){this.$nextTick(()=>{this.addTextHtmlContentToIframe(),this.initParams(this.feature.getTheme()?.params)})}},created(){this.showFavoriteIcons=this.feature.getTheme()?.params?.showFavoriteIcons?this.feature.getTheme().params.showFavoriteIcons:this.showFavoriteIcons,this.setImportedComponents()},mounted(){this.$nextTick(()=>{this.addTextHtmlContentToIframe(),this.initParams(this.feature.getTheme()?.params)})},methods:{beautifyKey:SP,isWebLink:qc,isImage:Jc,isPhoneNumber:wP,getPhoneNumberAsWebLink:TP,isEmailAddress:EP,isHTML:kP,translateKeyWithPlausibilityCheck:CP,mappedPropertiesExists(e){return typeof e==`object`&&!!e&&typeof e.getMappedProperties==`function`},hasMappedProperties(e){return Object.keys(e.getMappedProperties()).length!==0},hasPipe:function(e){return typeof e==`string`&&e.includes(`|`)},getMappedPropertiesOfFeature(e,t=!1){if(t===!0){let t=iF(e.getMappedProperties());return t===!1?{}:t}return e.getMappedProperties()},initParams(e){typeof e!=`object`||!e||(this.beautifyKeysParam=e?.beautifyKeys,this.showObjectKeysParam=e?.showObjectKeys)},isSensorChart(e){return typeof e==`object`&&!!e&&(e.type===`linechart`||e.type===`barchart`||e.type===`cakechart`)&&typeof e.query==`string`&&typeof e.staObject==`object`&&e.staObject!==null&&typeof e.staObject[`@iot.selfLink`]==`string`},setImportedComponents:function(){Object.keys(this.$options.components).forEach(e=>{e!==`DefaultTheme`&&this.importedComponents.push(this.$options.components[e])})},addTextHtmlContentToIframe:function(){let e=document.getElementsByClassName(`gfi-iFrame`)[0];this.mimeType===`text/html`&&e&&(this.setIframeSize(e,this.feature.getTheme()?.params),e.contentWindow.document.open(),e.contentWindow.document.write(this.feature.getDocument()),e.contentWindow.document.close())},setIframeSize:function(e,t){document.getElementsByClassName(`gfi-theme-iframe`)[0].style.maxWidth=``,e.style.width=t?.iframe?.width,e.style.height=t?.iframe?.height}}},cF={key:0,class:`favorite-icon-container`},lF={key:1,class:`table-wrapper`},uF={class:`table table-hover`},dF={key:0},fF={key:0},pF={key:0,class:`font-bold firstCol`},mF={key:0},hF={key:1},gF={key:1},_F=[`href`],vF={key:2},yF=[`href`],bF=[`alt`,`src`],xF={key:3},SF=[`innerHTML`],CF={key:4},wF=[`href`],TF={key:5},EF=[`href`],DF=[`innerHTML`],OF={key:7},kF=[`innerHTML`],AF={key:9,colspan:`2`},jF={key:10},MF={key:2,class:`gfi-iFrame`,title:`gfi-iFrame`};function NF(e,t,n,r,i,o){let s=a(`DefaultThemeSensorChart`);return v(),M(`div`,{class:E(o.mimeType===`text/html`?`gfi-theme-iframe`:``)},[e.showFavoriteIcons&&o.mimeType!==`text/html`?(v(),M(`div`,cF,[(v(!0),M(D,null,C(e.importedComponents,e=>(v(),F(ve(e),{key:`favorite-`+e.name,feature:n.feature},null,8,[`feature`]))),128))])):L(``,!0),o.mimeType===`text/html`?L(``,!0):(v(),M(`div`,lF,[z(`table`,uF,[o.mappedPropertiesExists(n.feature)?(v(),M(`tbody`,dF,[o.hasMappedProperties(n.feature)?(v(!0),M(D,{key:1},C(o.getMappedPropertiesOfFeature(n.feature,e.showObjectKeysParam),(t,n)=>(v(),M(`tr`,{key:n},[o.isSensorChart(t)?L(``,!0):(v(),M(`td`,pF,[e.beautifyKeysParam?(v(),M(`span`,mF,I(o.beautifyKey(o.translateKeyWithPlausibilityCheck(n,t=>e.$t(t)))),1)):(v(),M(`span`,hF,I(n),1))])),o.isWebLink(t)&&!o.isImage(t)?(v(),M(`td`,gF,[z(`a`,{href:t,target:`_blank`},`Link`,8,_F)])):o.isWebLink(t)&&o.isImage(t)?(v(),M(`td`,vF,[z(`a`,{href:t,target:`_blank`},[z(`img`,{class:`gfi-theme-images-image`,alt:e.$t(`common:modules.getFeatureInfo.themes.default.imgAlt`),src:t},null,8,bF)],8,yF)])):o.isHTML(t)?(v(),M(`td`,xF,[z(`div`,{innerHTML:t},null,8,SF)])):o.isPhoneNumber(t)?(v(),M(`td`,CF,[z(`a`,{href:o.getPhoneNumberAsWebLink(t)},I(t),9,wF)])):o.isEmailAddress(t)?(v(),M(`td`,TF,[z(`a`,{href:`mailto:${t}`},I(t),9,EF)])):Array.isArray(t)?(v(),M(`td`,{key:6,innerHTML:t.join(`<br>`)},null,8,DF)):o.hasPipe(t)?(v(),M(`td`,OF,[(v(!0),M(D,null,C(t.split(`|`),(e,t)=>(v(),M(`p`,{key:t},I(e),1))),128))])):typeof t==`string`&&t.includes(`<br>`)?(v(),M(`td`,{key:8,innerHTML:t},null,8,kF)):o.isSensorChart(t)?(v(),M(`td`,AF,[A(s,{type:t.type,label:t.label,query:t.query,format:t.format,"sta-object":t.staObject,options:t.options,"chart-options":t.chartOptions,download:t.download},null,8,[`type`,`label`,`query`,`format`,`sta-object`,`options`,`chart-options`,`download`])])):(v(),M(`td`,jF,I(t),1))]))),128)):(v(),M(`tr`,fF,[z(`td`,null,I(e.$t(`common:modules.getFeatureInfo.themes.default.noAttributeAvailable`)),1)]))])):L(``,!0)])])),o.mimeType===`text/html`?(v(),M(`iframe`,MF)):L(``,!0)],2)}var PF=K(sF,[[`render`,NF],[`__scopeId`,`data-v-e9b4e83e`]]);y();
38var FF={name:`SensorThemeData`,props:{feature:{type:Object,required:!0},show:{type:Boolean,required:!0}},data:function(){return{columnHeaderAttribute:`dataStreamName`}},computed:{firstColumnHeaderName:function(){return this.feature.getTheme()?.params?.data?.firstColumnHeaderName||this.$t(`common:modules.getFeatureInfo.themes.sensor.sensorData.firstColumnHeaderName`)},splittedMappedProperties:function(){let e=this.feature.getMappedProperties();return Object.entries(e).forEach(([t,n])=>{let r=typeof n==`string`?n.split(` | `):n;e[t]=Array.isArray(r)?r:[r]}),e},columnHeaders:function(){return this.feature.getProperties()[this.columnHeaderAttribute]?.split(` | `)}},created(){this.columnHeaderAttribute=this.feature.getTheme()?.params?.data?.columnHeaderAttribute||this.columnHeaderAttribute},methods:{isWebLink:qc,isPhoneNumber:wP,getPhoneNumberAsWebLink:TP,isEmailAddress:EP,beautifyKey:SP}},IF={key:0,class:`px-3`},LF={class:`table-wrapper`},RF={class:`table`},zF={class:`row`},BF={class:`col`},VF={class:`col`},HF={key:0},UF=[`href`],WF={key:1},GF=[`href`],KF={key:2},qF=[`href`],JF={key:3};function YF(e,t,n,r,i,a){return n.show?(v(),M(`div`,IF,[z(`div`,LF,[z(`table`,RF,[z(`thead`,null,[z(`tr`,zF,[z(`th`,BF,I(a.firstColumnHeaderName),1),(v(!0),M(D,null,C(a.columnHeaders,(e,t)=>(v(),M(`th`,{key:e+`_`+t,class:`col`},I(e),1))),128))])]),z(`tbody`,null,[(v(!0),M(D,null,C(a.splittedMappedProperties,(e,t)=>(v(),M(`tr`,{key:t,class:`row`},[z(`th`,VF,I(a.beautifyKey(t)),1),(v(!0),M(D,null,C(e,(e,t)=>(v(),M(`td`,{key:e+`_`+t,class:`col`},[a.isWebLink(e)?(v(),M(`span`,HF,[z(`a`,{href:e,target:`_blank`},` Link `,8,UF)])):a.isPhoneNumber(e)?(v(),M(`span`,WF,[z(`a`,{href:a.getPhoneNumberAsWebLink(e)},I(e),9,GF)])):a.isEmailAddress(e)?(v(),M(`span`,KF,[z(`a`,{href:`mailto:${e}`},I(e),9,qF)])):(v(),M(`span`,JF,I(e),1))]))),128))]))),128))])])])])):L(``,!0)}var XF=K(FF,[[`render`,YF],[`__scopeId`,`data-v-92cb78c6`]]),ZF=e(mn());function QF(e,t,n,r,i,a=[]){let o=(0,G.default)(r).toDate().getTime(),s=``,c=0,l=e,u=t,d=(0,G.default)(n).toDate().getTime();return a.forEach(e=>{let t=e?.result||l,n,r;t!==l&&(n=e?.phenomenonTime?(0,G.default)(e.phenomenonTime).toDate().getTime():``,r=(n-d)*u,c+=r,d=n,l=t,u=+(i===l))}),s=(o-d)*u,c=isNaN(s)?c:c+s,Math.round(c/3600)/1e3}function $F(e,t,n){return Array.isArray(e)===!1?[]:e.filter(e=>{let r=e?.phenomenonTime?(0,G.default)(e.phenomenonTime).format(`YYYY-MM-DDTHH:mm:ss`):``;return r>=t&&r<n})}function eI(e,t,n){let r=t||[],i=r.length>0&&r[0]?.phenomenonTime?(0,G.default)(r[0].phenomenonTime).format(`YYYY-MM-DD`):``,a=e||{},o=r.length>0&&r[0]?.result?r[0].result:``,s=+(n===o);return Object.keys(a).forEach(e=>{let t=parseFloat(e,10),c=(0,G.default)(i).add(t,`hour`).format(`YYYY-MM-DDTHH:mm:ss`),l=(0,G.default)(i).add(t+1,`hour`).format(`YYYY-MM-DDTHH:mm:ss`),u=$F(r,c,l);(0,G.default)(l).toDate().getTime()>(0,G.default)().toDate().getTime()?a[t]=void 0:u.length===0?a[t]=s:(a[t]=QF(o,s,c,l,n,u),o=u[u.length-1].result,s=+(n===o))}),a}function tI(){let e={};for(let t=0;t<24;t++)e[t]=0;return e}function nI(e,t=[]){let n=[];return t.forEach(t=>{let r=(0,G.default)((0,G.default)(t[0].phenomenonTime).format(`YYYY-MM-DD`)).format(`YYYY-MM-DDTHH:mm:ss`),i=(0,G.default)(t[0].phenomenonTime).format(`YYYY-MM-DDTHH:mm:ss`),a=tI(),o={};i!==r&&Array.isArray(t)&&t.reverse(),o=eI(a,t,e),n.push(o)}),n}function rI(e,t=[]){let n=[];return t.forEach(t=>{let r=parseFloat(t[e],10);r!==void 0&&!isNaN(r)&&n.push(r)}),n}function iI(e=[]){let t=[];for(let n=0;n<24;n++){let r=0,i=rI(n,e);if(i.length===0){t.push({hour:n,result:0});continue}i=i.filter(e=>e!==void 0),r=i.reduce((e,t)=>e+t)/i.length,isNaN(r)&&(r=0),t.push({hour:n,result:Math.round(r*1e3)/1e3})}return t}y(),G.default.extend(ZF.default);var aI={name:`SensorThemeBarChart`,props:{show:{type:Boolean,required:!0},chartValue:{type:Object,required:!0},targetValue:{type:String,required:!0},chartsParams:{type:Object,required:!0},periodLength:{type:Number,required:!0},periodUnit:{type:String,required:!0},processedHistoricalDataByWeekday:{type:Array,required:!0}},data:()=>
38({momentLocale:null,weekdayIndex:0,chart:null,hoverBackgroundColor:`rgba(0, 0, 0, 0.8)`,chartColor:`rgba(0, 0, 0, 1)`,barPercentage:1,titleText:``,noticeText:``,maxValue:1}),computed:{weekday(){return this.momentLocale.localeData().weekdays((0,G.default)().add(this.weekdayIndex,`day`))}},watch:{show(e){e||this.destroyChart()}},created(){this.momentLocale=(0,G.default)().locale(this.$i18next.language),this.hoverBackgroundColor=this.chartsParams?.hoverBackgroundColor||this.hoverBackgroundColor,this.barPercentage=this.chartsParams?.barPercentage||this.barPercentage,this.chartColor=this.chartValue?.color||this.chartColor,this.noticeText=this.chartValue?.noticeText||this.noticeText},mounted(){this.momentLocale.locale(this.$i18next.language)},updated(){this.initialize()},methods:{initialize(){this.show&&this.$nextTick(()=>{this.chart===null&&this.createChart(),this.drawChart(this.calculateDataForOneWeekday(),this.maxValue)})},calculateDataForOneWeekday(){let e=nI(this.targetValue,this.processedHistoricalDataByWeekday[this.weekdayIndex]);return this.titleText=[this.$t(this.chartValue?.title||``),`${this.$t(`common:modules.getFeatureInfo.themes.sensor.sensorBarChart.chartTitleAverage`)} `+this.$t(`common:modules.getFeatureInfo.themes.sensor.sensorBarChart.${this.periodUnit}`,{count:this.periodLength}),this.$t(this.noticeText)],iI(e)},destroyChart(){this.chart instanceof Kt&&(this.chart.destroy(),this.chart=null)},createChart(){let e=this.$refs[`sensorChart_${this.targetValue}`];Kt.defaults.font.family=`'MasterPortalFont', 'Arial Narrow', 'Arial', 'sans-serif'`,Kt.defaults.color=`#000000`,this.chart=Pt(new Kt(e,{type:`bar`}))},drawChart(e,t){this.chart.data=this.createChartData(e),this.chart.options={layout:this.createChartLayout(),plugins:{title:this.createChartTitle(),legend:this.createChartLegend(),tooltip:this.createChartTooltip(t)},responsive:!0,scales:this.createChartScales(t)},this.chart.update()},createChartData(e){return{labels:e.map(e=>e.hour),datasets:[{backgroundColor:this.chartColor,data:e.map(e=>e.result),barPercentage:this.barPercentage,hoverBackgroundColor:this.hoverBackgroundColor}]}},createChartTitle(){return{display:!0,position:`bottom`,text:this.titleText}},createChartLegend(){return{display:!1}},createChartTooltip(e){return{callbacks:{label:t=>(t.raw/e*100).toFixed(0)+`%`,title:()=>!1}}},createChartScales(e){return{x:{min:0,max:23,ticks:{callback:e=>e%2?``:this.$t(`common:modules.getFeatureInfo.themes.sensor.sensorBarChart.clock`,{value:e})}},y:{min:0,max:e,ticks:{callback:t=>(t/e*100).toFixed(0)+`%`}}}},createChartLayout(){return{padding:{left:10,right:10,top:0,bottom:0}}},showPreviousWeekDay(){--this.weekdayIndex,this.weekdayIndex<0&&(this.weekdayIndex=6)},showNextWeekDay(){this.weekdayIndex+=1,this.weekdayIndex>6&&(this.weekdayIndex=0)}}},oI={key:0},sI={class:`sensor-button-container`},cI=[`title`],lI={class:`day`},uI=[`title`],dI={class:`sensor-chart-container`},fI=[`id`];function pI(e,t,n,r,i,a){return n.show?(v(),M(`div`,oI,[z(`div`,sI,[z(`button`,{id:`left`,type:`button`,class:`leftButton kat btn`,title:e.$t(`common:modules.getFeatureInfo.themes.sensor.sensorBarChart.previousWeekday`),onClick:t[0]||=(...e)=>a.showPreviousWeekDay&&a.showPreviousWeekDay(...e)},[...t[2]||=[z(`span`,{class:`bootstrap-icon`},[z(`i`,{class:`bi-chevron-left`}
38)],-1)]],8,cI),z(`span`,lI,I(a.weekday),1),z(`button`,{id:`right`,type:`button`,class:`rightButton kat btn`,title:e.$t(`common:modules.getFeatureInfo.themes.sensor.sensorBarChart.nextWeekday`),onClick:t[1]||=(...e)=>a.showNextWeekDay&&a.showNextWeekDay(...e)},[...t[3]||=[z(`span`,{class:`bootstrap-icon`},[z(`i`,{class:`bi-chevron-right`})],-1)]],8,uI)]),z(`div`,dI,[z(`canvas`,{id:`sensorChart_${n.targetValue}`,ref:`sensorChart_${n.targetValue}`},null,8,fI)])])):L(``,!0)}var mI=K(aI,[[`render`,pI],[`__scopeId`,`data-v-054681d8`]]);function hI(e){return{phenomenonTime:(0,G.default)((0,G.default)(e.phenomenonTime).format(`YYYY-MM-DD`)).format(`YYYY-MM-DDTHH:mm:ss`),result:e.result}}function gI(e){let t=e===void 0?[]:e;return t.forEach(e=>{(e?.Observations?e.Observations:[]).forEach((e,t)=>{e.index=t})}),t}function _I(e,t){let n=(0,G.default)().format(`YYYY-MM-DD`),r=[[],[],[],[],[],[],[]];return gI(e).forEach(e=>{let i=e?.Observations?e.Observations:[],a=i[i.length-1],o=!0,s=n,c=0;i.length!==0&&(r[c].push([]),(0,G.default)(a?.phenomenonTime).format(`YYYY-MM-DD`)>(0,G.default)(t).format(`YYYY-MM-DD`)&&i.push(hI(a))),i.forEach(e=>{let n=(0,G.default)(e.phenomenonTime).format(`YYYY-MM-DD`),i,a,l;for(;o;)if(l=r[c].length-1,(0,G.default)(s)<(0,G.default)(t)){o=!1,r[c].pop();break}else if(n===s){r[c][l].push(e);break}else i=(0,G.default)(s).format(`YYYY-MM-DDTHH:mm:ss`),a=e.result,r[c][l].push({phenomenonTime:i,result:a}),s=(0,G.default)(s).subtract(1,`days`).format(`YYYY-MM-DD`),c>=6?c=0:c++,r[c].push([])})}),r}y();var vI={name:`SensorTheme`,components:{SensorThemeData:XF,SensorThemeBarChart:mI,NavTab:yo},props:{feature:{type:Object,required:!0}},data:function(){return{periodLength:3,periodUnit:`month`,processedHistoricalDataByWeekday:[],activeTab:`data`,startDate:``}},computed:{...N([`layerConfigById`]),gfiParams:function(){return this.feature.getTheme()?.params},dataName:function(){return this.gfiParams?.data?.name||this.$t(`common:modules.getFeatureInfo.themes.sensor.sensor.dataName`)},header:function(){let e=this.gfiParams?.header||{name:this.$t(`common:modules.getFeatureInfo.themes.sensor.sensor.header.name`),description:this.$t(`common:modules.getFeatureInfo.themes.sensor.sensor.header.description`),ownerThing:this.$t(`common:modules.getFeatureInfo.themes.sensor.sensor.header.ownerThing`)};return e?.useConfigName&&delete e.useConfigName,e},chartvalues:function(){return this.gfiParams?.charts?.values}},watch:{feature(){this.loadHistoricalData()}},created(){this.periodLength=typeof this.gfiParams?.historicalData?.periodLength==`number`?this.gfiParams.historicalData.periodLength:this.periodLength,this.periodUnit=this.gfiParams?.historicalData?.periodUnit===`year`?this.gfiParams.historicalData.periodUnit:this.periodUnit,this.loadHistoricalData()},methods:{loadHistoricalData:function(){let e=this.layerConfigById(this.feature.getLayerId());if(e){let t=`${e.url}/v${e.version}/[email protected]&$expand=Observations($select=result,phenomenonTime;$orderby=phenomenonTime%20desc;$filter=phenomenonTime%20gt%20${this.createFilterDate(this.periodLength,this.periodUnit)})&$filter=${this.createFilterDataStream(this.feature.getProperties()?.dataStreamId)}`;this.fetchObservations(t)}},createFilterDate:function(e,t){let n=(0,G.default)().subtract(e,t);return this.startDate=n,n.subtract(1,`week`).format(`YYYY-MM-DDTHH:mm:ss.sss`)+`Z`},createFilterDataStream:function(e){let t=e.split(` | `),n=``;return t.forEach((e,t)=>{n=t===0?`@iot.id%20eq%20${e}`:`${n}%20or%[email protected]%20eq%20${e}`}),n},fetchObservations:function(e){let t=[],n=[];B.get(e).then(e=>{e.data.value.forEach((r,i)=>{n.push(r),Object.prototype.hasOwnProperty.call(r,`[email protected]`)&&this.fetchNextLinks(r[`[email protected]`],i,n,t,e.data.value.length)})})},fetchNextLinks:function(e,t,n,r,i){B.get(e).then(e=>{e?.data?.value&&(n[t].Observations=n[t].Observations.concat(e.data.value)),Object.prototype.hasOwnProperty.call(e?.data,`@iot.nextLink`)?this.fetchNextLinks(e.data[`@iot.nextLink`],t,n,r,i):(r.push(t),r.length===i&&(this.processedHistoricalDataByWeekday=_I(n,this.startDate)))})},isActiveTab(e){return this.activeTab===String(e)},getTabPaneClasses(e){return{active:this.isActiveTab(e),show:this.isActiveTab(e),"tab-pane":!0,fade:!0}},createHref:function(e){return`#${String(e)}`}}},yI={class:`gfi-theme-sensor`}
38,bI={key:0,class:`sensor-text`},xI={class:`sensor-nav-tabs`},SI={class:`nav nav-tabs`,role:`tablist`};function CI(e,t,n,r,i,o){let s=a(`NavTab`),c=a(`SensorThemeData`),l=a(`SensorThemeBarChart`);return v(),M(`div`,yI,[o.header?(v(),M(`div`,bI,[(v(!0),M(D,null,C(o.header,(e,r)=>(v(),M(`strong`,{key:r},[R(I(e+`: `+n.feature.getProperties()[r])+` `,1),t[0]||=z(`br`,null,null,-1)]))),128))])):L(``,!0),z(`div`,xI,[z(`ul`,SI,[A(s,{id:`sensor-data-tab`,label:o.dataName,active:o.isActiveTab(`data`),target:`#data`,interaction:()=>{e.activeTab=`data`},"style-variant":`blue`},null,8,[`label`,`active`,`interaction`]),(v(!0),M(D,null,C(o.chartvalues,(t,n)=>(v(),F(s,{id:`sensor-chart-tab-${n}`,key:n,label:e.$t(t.title||t),active:o.isActiveTab(n),disabled:e.processedHistoricalDataByWeekday.length===0,target:`#${n}`,interaction:()=>{e.activeTab=String(n)},"style-variant":`blue`},null,8,[`id`,`label`,`active`,`disabled`,`target`,`interaction`]))),128))])]),z(`div`,null,[A(c,{id:`data`,key:`sensorCharts-dataComponent`,show:o.isActiveTab(`data`),class:E(o.getTabPaneClasses(`data`)),feature:n.feature},null,8,[`show`,`class`,`feature`]),(v(!0),M(D,null,C(o.chartvalues,(t,n)=>(v(),F(l,{key:`sensorCharts-barChartComponent-${n}`,class:E(o.getTabPaneClasses(n)),show:o.isActiveTab(n),"chart-value":typeof t==`object`?t:{title:t},"target-value":typeof n==`number`?t:n,"charts-params":o.gfiParams.charts,"period-length":e.periodLength,"period-unit":e.periodUnit,"processed-historical-data-by-weekday":e.processedHistoricalDataByWeekday},null,8,[`class`,`show`,`chart-value`,`target-value`,`charts-params`,`period-length`,`period-unit`,`processed-historical-data-by-weekday`]))),128))])])}var wI=K(vI,[[`render`,CI],[`__scopeId`,`data-v-13a103c8`]]);function TI(e,t,n){let r;return e.includes(t)?r=t:e.map(e=>e.slice(-5)===`Theme`?e:`${e}Theme`).includes(n)?r=n:(console.warn(String(`The gfi theme '`+t+`' could not be found, the default theme will be used. Please check your configuration!`)),r=`DefaultTheme`),r}function EI(e,t,n){let r=Object.keys(t),i=ra.upperFirst(e&&typeof e==`object`?e.name:e),a=i.slice(-5)===`Theme`?i:`${i}Theme`,o=``;return r&&r.length&&r.includes(a)?o=a:n?o=TI(n,i,a):(console.warn(String(`The gfi theme '`+i+`' could not be found, the default theme will be used. Please check your configuration!`)),o=`DefaultTheme`),o}y();var DI={name:`GetFeatureInfoDetached`,components:{DefaultTheme:PF,SensorTheme:wI},props:{feature:{type:Object,required:!0},isUpdated:{type:Boolean,required:!1,default:!1},pagerIndex:{type:Number,required:!1,default:0},totalFeatures:{type:Number,required:!1,default:1},showPageNumber:{type:Boolean,required:!1,default:!0}},emits:[`updateFeatureDone`],data(){return{isContentHtml:!1,lastFeature:null}},computed:{...N(`Maps`,[`clickCoordinate`]),...N(`Modules/SearchBar`,[`searchInput`]),...N(`Modules/GetFeatureInfo`,[`centerMapToClickPoint`,`currentFeature`,`highlightVectorRules`,`showPolygonMarkerForWMS`,`menuSide`,`showMarker`,`hideMapMarkerOnVectorHighlight`,`stickyHeader`]),title:function(){return Lr(this.feature.getTitle())},theme:function(){return EI(this.feature.getTheme(),this.$options.components,this.$gfiThemeAddons)},showCounter:function(){return this.showPageNumber&&this.totalFeatures>1},pageCounterText:function(){return`(${this.pagerIndex+1}/${this.totalFeatures})`}},created(){this.feature?.getMimeType()===`text/html`&&(this.isContentHtml=!0)}
38,mounted(){this.highlightVectorFeature(),this.highlightWMSFeature(),this.setMarker()},updated:function(){this.isUpdated&&(this.highlightVectorFeature(),this.highlightWMSFeature(),this.setMarker(),this.$emit(`updateFeatureDone`))},beforeUnmount:function(){this.removePointMarker(),this.removeHighlighting(),this.removePolygonMarker()},methods:{...o(`Modules/GetFeatureInfo`,[`setShowMarker`]),...w(`Maps`,[`placingPointMarker`,`removePointMarker`,`removePolygonMarker`,`highlightFeature`,`removeHighlightFeature`,`setCenter`]),removeHtmlTags:Lr,setMarker(){this.clickCoordinate&&(this.centerMapToClickPoint&&this.setCenter(this.clickCoordinate),this.showMarker&&this.placingPointMarker(this.clickCoordinate))},hideMarker(){this.setShowMarker(!1)},highlightVectorFeature(){if(this.highlightVectorRules){let e=W.getLayerById(this.feature.getLayerId())?.get(`styleId`),t={feature:this.feature.getOlFeature(),layer:{id:this.feature.getLayerId()},styleId:e};if(this.hideMapMarkerOnVectorHighlight&&(this.hideMarker(),this.removePointMarker()),this.removeHighlighting(),this.feature.getOlFeature
38()&&typeof this.feature.getOlFeature().getGeometry==`function`)switch(this.feature.getOlFeature().getGeometry()?.getType()){case`Point`:t.type=`increase`,t.scale=this.highlightVectorRules.image.scale;break;case`Polygon`:t.type=`highlightPolygon`,t.highlightStyle={fill:this.highlightVectorRules.fill,stroke:this.highlightVectorRules.stroke};break;case`MultiPolygon`:t.type=`highlightMultiPolygon`,t.highlightStyle={fill:this.highlightVectorRules.fill,stroke:this.highlightVectorRules.stroke};break;case`LineString`:t.type=`highlightLine`,t.highlightStyle={stroke:this.highlightVectorRules.stroke};break;case`MultiLineString`:t.type=`highlightMultiLine`,t.highlightStyle={stroke:this.highlightVectorRules.stroke};break;default:break}t.type&&this.highlightFeature(t),this.lastFeature=this.feature}},highlightWMSFeature(){if(this.showPolygonMarkerForWMS){let e=W.getLayerById(this.feature.getLayerId()),t={feature:this.feature.getOlFeature(),layer:{id:this.feature.getLayerId()}};if(e?.attributes?.typ?.toLowerCase()===`wms`){if(this.removePolygonMarker(),this.hideMapMarkerOnVectorHighlight&&this.hideMarker(),this.feature.getOlFeature
38()&&typeof this.feature.getOlFeature().getGeometry==`function`)switch(this.feature.getOlFeature().getGeometry()?.getType()){case`Point`:t.type=`highlightPoint`;break;case`MultiPoint`:t.type=`highlightMultiPoint`;break;case`Polygon`:t.type=`highlightPolygon`;break;case`MultiPolygon`:t.type=`highlightMultiPolygon`;break;case`LineString`:t.type=`highlightLine`;break;case`MultiLineString`:t.type=`highlightMultiLine`;break;default:break}t.type&&this.highlightFeature(t),this.lastFeature=this.feature}}},removeHighlighting:function(){this.lastFeature&&this.removeHighlightFeature(this.lastFeature.getOlFeature())},translate(e,t=null){return this.$t(e,t)}}},OI={key:0,class:`gfi-detached-container`},kI={ref:`gfiHeader`,class:`gfi-header-fixed d-flex align-items-center justify-content-between`},AI={class:`gfi-title-container mx-3 flex-grow-1`},jI={key:0,class:`gfi-page-counter`},MI={class:`gfi-title font-bold`},NI={class:`gfi-content-scrollable`},PI={key:1},FI={ref:`gfiHeader`,class:`gfi-header-simple d-flex align-items-center justify-content-between mt-3 mb-4`},II={class:`gfi-title-container mx-3 flex-grow-1`},LI={key:0,class:`gfi-page-counter`},RI={class:`gfi-title font-bold`};function zI(e,t,n,r,i,a){return e.stickyHeader?(v(),M(`div`,OI,[z(`div`,kI,[Lt(e.$slots,`pager-left`,{},void 0,!0),z(`div`,AI,[a.showCounter?(v(),M(`div`,jI,I(a.pageCounterText),1)):L(``,!0),z(`div`,MI,I(a.translate(a.title)),1)]),Lt(e.$slots,`pager-right`,{},void 0,!0)],512),z(`div`,NI,[(v(),F(ve(a.theme),{feature:n.feature},null,8,[`feature`]))])])):(v(),M(`div`,PI,[z(`div`,FI,[Lt(e.$slots,`pager-left`,{},void 0,!0),z(`div`,II,[a.showCounter?(v(),M(`div`,LI,I(a.pageCounterText),1)):L(``,!0),z(`div`,RI,I(a.translate(a.title)),1)]),Lt(e.$slots,`pager-right`,{},void 0,!0)],512),z(`div`,null,[(v(),F(ve(a.theme),{feature:n.feature},null,8,[`feature`]))])]))}var BI=K(DI,[[`render`,zI],[`__scopeId`,`data-v-32c9cd81`]]);y();var VI={name:`GetFeatureInfo`,components:{GetFeatureInfoDetached:BI,IconButton:ab},data(){return{pagerIndex:0,componentKey:!1,updatedFeature:!1,leftIcon:`bi-chevron-left`,rightIcon:`bi-chevron-right`}},computed:{...N([`ignoredKeys`,`visibleSubjectDataLayerConfigs`]),...N(`Modules/GetFeatureInfo`,[`configPaths`,`currentFeature`,`menuSide`,`name`,`showMarker`,`showPageNumber`,`type`,`visible`]),...N(`Modules/GetFeatureInfo`,{gfiFeatures:`gfiFeaturesReverse`}),...N(`Maps`,{clickCoordinate:`clickCoordinate`,mapSize:`size`}),...N(`Menu`,[`currentComponent`,`currentMouseMapInteractionsComponent`,`expanded`]),...N(`Maps`,{mapMode:`mode`}),currentComponentType(){return this.currentComponent(this.menuSide)?.type},currentViewType(){return`GetFeatureInfoDetached`},feature(){return this.gfiFeatures!==null&&Array.isArray(this.gfiFeatures)&&this.gfiFeatures.length>0?this.gfiFeatures[this.pagerIndex]:null},leftPager(){return this.gfiFeatures.length>1&&this.pagerIndex>0},rightPager(){return this.gfiFeatures.length>1&&this.pagerIndex<this.gfiFeatures.length-1}},watch:{visible(e){let t=[`mainMenu`,`secondaryMenu`].find(e=>e!==this.menuSide);e?(this.currentComponent(this.menuSide).type===`print`&&(this.createMappedProperties(this.feature),this.setMenuSide(t)),this.changeCurrentComponent({type:this.type,side:this.menuSide,props:{name:`none`}})):this.reset()},visibleSubjectDataLayerConfigs:{handler(e,t){t.length!==e.length&&this.feature&&e.filter(e=>!t.includes(e)).length===0&&t.filter(t=>!e.includes(t)).forEach(e=>{this.feature?.getLayerId()===e.id&&e.visibility===!1&&(this.gfiFeatures.length===1?this.reset():(this.pagerIndex=0,this.collectGfiFeatures()))})},deep:!0},clickCoordinate:{handler(e){this.currentMouseMapInteractionsComponent===this.type&&(this.pagerIndex=0,this.reopenMenuOnNextFeatureUpdate=!0,this.setClickCoordinates(e),this.collectGfiFeatures())},deep:!0},currentComponentType(e){e!==this.type&&this.setVisible(!1)},feature(e){this.setCurrentFeature(e)},mapSize:{handler(){this.currentViewType===`GetFeatureInfoDetached`&&(this.componentKey=!this.componentKey)},deep:!0},gfiFeatures:{handler(e,t){let n=t===null,r=!this.expanded(this.menuSide),i=Array.isArray(e)&&e.some(e=>e?.getMimeType?.()===`text/html`);e?.length>
380?(t!==null&&(e.forEach(e=>{t.find(t=>t.getId()===e.getId())||(n=!0)}),t.forEach(t=>{e.find(e=>e.getId()===t.getId())||(n=!0)})),n&&this.setVisible(!0),r&&(n||i&&this.reopenMenuOnNextFeatureUpdate===!0)&&this.toggleMenu(this.menuSide),this.setUpdatedFeature(!0)):e===null&&this.setUpdatedFeature(!1),this.reopenMenuOnNextFeatureUpdate=!1},deep:!0}},mounted(){this.initializeModule({configPaths:this.configPaths,type:this.type}),this.setMenuSide(this.menuSide)},beforeUpdate(){this.feature&&this.createMappedProperties(this.feature)},methods:{...o(`Modules/GetFeatureInfo`,[`setGfiFeatures`,`setCurrentFeature`,`setVisible`,`setMenuSide`,`setClickCoordinates`]),...w([`initializeModule`]),...w(`Modules/GetFeatureInfo`,[`collectGfiFeatures`,`removeHighlightColor`]),...w(`Menu`,[`changeCurrentComponent`,`resetMenu`,`toggleMenu`]),reset:function(){this.pagerIndex=0,this.reopenMenuOnNextFeatureUpdate=!1,this.setGfiFeatures(null),this.mapMode===`3D`&&this.removeHighlightColor()},setUpdatedFeature:function(e=!1){this.updatedFeature=e},increasePagerIndex:function(){this.pagerIndex<this.gfiFeatures.length-1&&(this.pagerIndex+=1)},decreasePagerIndex:function(){this.pagerIndex>0&&--this.pagerIndex},createMappedProperties:function(e){Array.isArray(e?.getFeatures())?e.getFeatures().forEach(e=>{this.createMappedProperties(e)}):e?.getProperties()&&e?.getProperties()!==null&&(e.getMappedProperties=()=>this.prepareProperties(e.getProperties(),e.getAttributesToShow(),this.ignoredKeys))},prepareProperties:function(e,t,n){return t===`showAll`&&Array.isArray(n)||t===void 0?ed(e,n,!0):g(e,t)}}},HI={key:0,class:`gfi`};function UI(e,t,n,r,i,o){let s=a(`IconButton`);return e.visible&&o.feature!==null?(v(),M(`div`,HI,[e.visible&&o.feature!==null?(v(),F(ve(o.currentViewType),{key:i.componentKey,feature:o.feature,"is-updated":i.updatedFeature,"pager-index":i.pagerIndex,"total-features":e.gfiFeatures.length,"show-page-number":e.showPageNumber,onUpdateFeatureDone:t[0]||=e=>o.setUpdatedFeature(!0),onClose:o.reset},{"pager-left":Pn(()=>[z(`div`,{class:E([`gfi-pager`,o.leftPager?``:`gfi-pager-left-margin`])},[o.leftPager?(v(),F(s,{key:0,aria:e.$t(`common:modules.getFeatureInfo.buttonBack`),"class-array":[`pager-left`,`pager`,`btn-primary`],icon:i.leftIcon,role:`button`,interaction:o.decreasePagerIndex},null,8,[`aria`,`icon`,`interaction`])):L(``,!0)],2)]),"pager-right":Pn(()=>[z(`div`,{class:E([`gfi-pager`,o.rightPager?``:`gfi-pager-right-margin`])},[o.rightPager?(v(),F(s,{key:0,aria:e.$t(`common:modules.getFeatureInfo.buttonForward`),"class-array":[`pager-right`,`pager`,`btn-primary`,`d-flex`,`flex-row-reverse`],icon:i.rightIcon,role:`button`,interaction:o.increasePagerIndex},null,8,[`aria`,`icon`,`interaction`])):L(``,!0)],2)]),_:1},40,[`feature`,`is-updated`,`pager-index`,`total-features`,`show-page-number`,`onClose`])):L(``,!0)])):L(``,!0)}var WI=K(VI,[[`render`,UI],[`__scopeId`,`data-v-347abc52`]]),GI={name:`MenuComponentKeepAlivePlaceholder`,render(){return null}};function KI(e,t,n=[`type`]){if(!e||!t||typeof t!=`object`)return;let r=new Set(Object.keys(e.$state)),i={};Object.entries(t).forEach(([e,t])=>{r.has(e)&&!n.includes(e)&&(i[e]=t)}),e.$patch(i)}y();var qI={name:`MenuContainerBody`,components:{GetFeatureInfo:WI,MenuContainerBodyRoot:fP,MenuNavigation:xP,MenuComponentKeepAlivePlaceholder:GI},props:{side:{type:String,default:`mainMenu`,validator:e=>e===`mainMenu`||e===`secondaryMenu`}},computed:{...N(`Menu`,[`defaultComponent`,`mainMenu`,`secondaryMenu`,`mainExpanded`,`secondaryExpanded`]),...N(`Modules`,[`componentMap`]),...N(`Modules/GetFeatureInfo`,{gfiMenuSide:`menuSide`}),menu(){return this.side===`mainMenu`?this.mainMenu:this.secondaryMenu},currentComponent(){let e=this.menu.navigation.currentComponent.type;return e!==`root`&&e!==this.defaultComponent&&(e=this.componentMap[e]),e},keepAliveComponents(){let e=Object.keys(this.componentMap).filter(e=>typeof this.componentMap[e]?.activated==`function`&&typeof this.componentMap[e]?.deactivated==`function`).map(e=>this.componentMap[e].name);return e.push(`MenuComponentKeepAlivePlaceholder`),e},currentComponentName(){return[`root`,`getFeatureInfo`].includes(this.currentComponent)?`MenuComponentKeepAlivePlaceholder`:this.currentComponent}}
38,mounted(){this.menu?.sections?.forEach((e,t)=>{let n=`${this.menu.configPaths}.${t}`;this.initializeModuleConfig(e,n)})},methods:{...w([`initializeModule`]),initializeModuleConfig(e,t){e.forEach((e,n)=>{let r=`${t}.${n}`;e.type===`folder`?this.initializeModuleConfig(e.elements,`${r}.elements`):Fl(e.type)?KI(Pl(e.type)(),e):e.type!==`customMenuElement`&&this.initializeModule({configPaths:[r],type:e.type})})}}},JI=[`id`];function YI(e,t,n,r,i,o){let c=a(`MenuNavigation`),l=a(`GetFeatureInfo`),u=a(`MenuContainerBodyRoot`);return v(),M(`div`,{id:`mp-body-`+n.side,class:E([`mp-menu-body flex-grow-1`,{"mp-menu-body-collapsed":!e.mainExpanded&&n.side===`mainMenu`||!e.secondaryExpanded&&n.side===`secondaryMenu`}])},[A(c,{side:n.side},null,8,[`side`]),n.side===e.gfiMenuSide?s((v(),F(l,{key:0},null,512)),[[ae,o.currentComponent===`getFeatureInfo`]]):L(``,!0),(v(),F(Ye,{include:o.keepAliveComponents},[(v(),F(ve(o.currentComponentName),{class:`menu-body-component`,side:n.side},null,8,[`side`]))],1032,[`include`])),s(A(u,{side:n.side},null,8,[`side`]),[[ae,o.currentComponent===`root`]])],10,JI)}var XI=K(qI,[[`render`,YI],[`__scopeId`,`data-v-63fdddca`]]);function ZI(e,t,n){let r=document.getElementById(`masterportal-container`),i=document.getElementById(`mp-menu-${e.side===`mainMenu`?Zn:Yn}`);if(!r||!i)return;let a=r.offsetWidth,o=i.offsetWidth,s=Math.min(a*e.maxWidth-o-n,Math.max(a*e.minWidth,t));e.side===`mainMenu`?e.setMainMenuWidth(s):e.side===`secondaryMenu`&&e.setSecondaryMenuWidth(s),e.handleElement.style.maxWidth!==`none`&&(e.handleElement.style.maxWidth=`none`),e.handleElement.style.width=`${Math.round(s)}px`}function QI(e){return!isNaN(e)&&typeof e==`number`&&e>=0&&e<=1}y();var $I={right:[1,0],left:[-1,0]},eL=300,tL={name:`ResizeHandle`,props:{handlePosition:{type:String,default:`right`,validator:e=>[`right`,`left`].includes(e)},minWidth:{type:Number,default:0,validator:QI},maxWidth:{type:Number,default:1,validator:QI},targetElement:{type:String,default:``},targetSelector:{type:String,default:`parentNode`},side:{type:String,required:!0,validator(e){return e===`mainMenu`||e===`secondaryMenu`}}},emits:[`endResizing`,`leftScreen`,`resizing`,`startResizing`],data:()=>({boundOnMouseMove:null,boundOnMouseUp:null,boundOnWindowBlur:null,boundOnVisibilityChange:null,deltaCursorPosition:{x:0,y:0},initialCursorPosition:{x:0,y:0},isResizing:!1,initialDimensions:{width:0},touchStarted:!1,touchDevice:!1,timeoutReference:null}),computed:{eventData(){return{cursorClass:`ew-resize`,deltaCursorPosition:this.deltaCursorPosition,handleElement:this.handleElement,handlePosition:this.handlePosition,initialCursorPosition:this.initialCursorPosition,initialDimensions:this.initialDimensions,minWidth:this.minWidth,maxWidth:this.maxWidth}},handleElement(){if(this.targetElement!==``)return document.querySelector(this.targetElement);if(this.targetSelector===`parentNode`)return this.$el.parentNode;let e=this.$el.closest(this.targetSelector);return e===null&&console.warn(`ResizeHandle: No target element found. Please verify your markup and selector. Currently defined target element selector:`,this.targetSelector),e},resizeEventNames(){return this.touchDevice?{move:`touchmove`,end:`touchend`,cancel:`touchcancel`}:{move:`mousemove`,end:`mouseup`,cancel:null}}},watch:{isResizing(e){let{move:t,end:n,cancel:r}=this.resizeEventNames;if(e){this.handleElement.classList.add(`resize-handle-is-resizing`),document.addEventListener(t,this.boundOnMouseMove),document.addEventListener(n,this.boundOnMouseUp),r&&document.addEventListener(r,this.boundOnMouseUp),window.addEventListener(`blur`,this.boundOnWindowBlur),document.addEventListener(`visibilitychange`,this.boundOnVisibilityChange),this.$emit(`startResizing`,this.eventData),document.querySelector(`body`).classList.add(`resize-handle-is-resizing`);return}this.handleElement.classList.remove(`resize-handle-is-resizing`),document.removeEventListener(t,this.boundOnMouseMove),document.removeEventListener(n,this.boundOnMouseUp),r&&document.removeEventListener(r,this.boundOnMouseUp),window.removeEventListener(`blur`,this.boundOnWindowBlur),document.removeEventListener(`visibilitychange`,this.boundOnVisibilityChange),this.$emit(`endResizing`,this.eventData),document.querySelector(`body`).classList.remove(`resize-handle-is-resizing`)}},mounted(){this.$el.parentNode!==null&&(this.saveInitialDimensions(),this.setNewSize()),this.boundOnMouseMove=this.onMouseMove.bind(this),this.boundOnMouseUp=this.onMouseUp.bind(this),this.boundOnWindowBlur=this.onWindowBlur.bind(this),this.boundOnVisibilityChange=this.onVisibilityChange.bind(this)},beforeUnmount(){let{move:e,end:t,cancel:n}=this.resizeEventNames;document.removeEventListener(e,this.boundOnMouseMove),document.removeEventListener(t,this.boundOnMouseUp),n&&document.removeEventListener(n,this.boundOnMouseUp),window.removeEventListener(`blur`,this.boundOnWindowBlur),document.removeEventListener(`visibilitychange`,this.boundOnVisibilityChange)},methods:{...o(`Modules/ResizeHandle`,[`setMainMenuWidth`,`setSecondaryMenuWidth`]),moveHandle(e){if(e===`ArrowLeft`||e===`ArrowRight`){let t=(e===`ArrowLeft`?1:-1)*(this.side===`mainMenu`?-1:1)*10;ZI(this,this.handleElement.offsetWidth+t,eL)}},onMouseDown(e){e.button===0&&(this.touchStarted||(this.touchDevice=!1,this.startResizing(e)))},onMouseMove(e){let t=e.touches?e.touches[0].clientX:e.clientX,n=e.touches?e.touches[0].clientY:e.clientY,r=t-this.initialCursorPosition.x,i=n-this.initialCursorPosition.y;if(!e.touches&&e.buttons===0){this.onMouseUp();return}(t<0||t>window.innerWidth||n<0||n>window.innerHeight)&&(this.$emit(`leftScreen`,this.eventData),this.isResizing=!1),this.deltaCursorPosition.x=Math.round(r),this.deltaCursorPosition.y=Math.round(i),this.setNewSize(),this.$emit(`resizing`,this.eventData)},onMouseUp(){this.isResizing=!1},onWindowBlur(){this.isResizing&&this.onMouseUp()},onVisibilityChange(){!this.isResizing||document.visibilityState===`visible`||this.onMouseUp()},onTouchStart(e){this.setTouchStarted(),this.touchDevice=!0,this.startResizing(e)},saveInitialCursorCoordinates(e){this.initialCursorPosition.x=e.touches?e.touches[0].clientX:e.clientX,this.initialCursorPosition.y=e.touches?e.touches[0].clientY:e.clientY},saveInitialDimensions(){this.initialDimensions.width=this.handleElement.offsetWidth<this.minWidth?this.minWidth:this.handleElement.offsetWidth,this.handleElement.style.width=this.initialDimensions.width},setNewSize(){ZI(this,this.initialDimensions.width+$I[this.handlePosition][0]*this.deltaCursorPosition.x,eL)},setTouchStarted(){this.touchStarted=!0,clearTimeout(this.timeoutReference),this.timeoutReference=setTimeout(()=>{this.touchStarted=!1},400)},startResizing(e){e.preventDefault(),this.handleElement!==null&&(this.saveInitialCursorCoordinates(e),this.saveInitialDimensions(),this.isResizing=!0)}}};function nL(e,t,n,r,i,a){return v(),M(`button`,{id:`resize-handle`,class:E([`btn resize-handle`,[{"resize-handle-is-resizing":e.isResizing},`resize-handle-type-`+n.handlePosition,`resize-handle-cursor-ew-resize`]]),onFocus:t[0]||=(...e)=>a.moveHandle&&a.moveHandle(...e),onKeydown:t[1]||=e=>a.moveHandle(e.key),onMousedown:t[2]||=(...e)=>a.onMouseDown&&a.onMouseDown(...e),onTouchstart:t[3]||=(...e)=>a.onTouchStart&&a.onTouchStart(...e)},[Lt(e.$slots,`default`)],34)}var rL=K(tL,[[`render`,nL]]);y();
38var iL={name:`MenuContainerBodyRootLogo`,props:{idAppendix:{type:String,required:!0},text:{type:String,required:!1,default:null},link:{type:String,default:``},logo:{type:String,default:``},toolTip:{type:String,default:``}}},aL=[`id`,`href`,`target`,`title`],oL=[`src`,`alt`],sL=[`innerHTML`];function cL(e,t,n,r,i,a){return v(),M(`a`,{id:`mp-menu-logo-`+n.idAppendix,href:n.link?n.link:`#`,target:n.link?`_blank`:`_self`,title:n.toolTip,class:E([`mp-menu-logo`,{"logo-only":n.text===null}])},[n.logo?(v(),M(`img`,{key:0,src:n.logo,alt:n.toolTip||n.text,class:E({logoOnly:n.text===null})},null,10,oL)):L(``,!0),n.text===null?L(``,!0):(v(),M(`h1`,{key:1,innerHTML:e.$t(n.text)},null,8,sL))],10,aL)}var lL=K(iL,[[`render`,cL],[`__scopeId`,`data-v-6176e7b3`]]);y();var uL={name:`SearchBarSuggestionListItem`,mixins:[FN(`searchSuggestion`)],props:{searchSuggestion:{type:Object,required:!0}},methods:{...w(`Modules/SearchBar`,[`activateActions`,`removeHighlight3DTile`]),handleClick(){this.removeHighlight3DTile(),this.activateActions({searchResult:this.searchSuggestion,actionType:`onClick`}),_t.getInstance(this.$el.querySelector(`.layer-checkbox-tooltip`))?.hide()}}},dL={id:`search-bar-suggestion-list-item`},fL={class:`d-flex flex-row bd-highlight bold`},pL=[`data-bs-toggle`,`title`],mL=[`title`,`aria-label`],hL={class:`btn-title`};function gL(e,t,n,r,i,a){return v(),M(`div`,dL,[z(`div`,fL,[z(`span`,{class:`layer-checkbox-tooltip`,"data-bs-toggle":e.scaleIsOutOfRange?`tooltip`:null,"data-bs-placement":`bottom`,"data-bs-custom-class":`custom-tooltip`,title:e.scaleIsOutOfRange?e.tooltipText:``},[z(`button`,{type:`button`,class:`btn btn-light d-flex`,title:n.searchSuggestion.toolTip?e.$t(n.searchSuggestion.toolTip):e.$t(n.searchSuggestion.name),"aria-label":n.searchSuggestion.toolTip?e.$t(n.searchSuggestion.toolTip):e.$t(n.searchSuggestion.name),onClick:t[0]||=(...e)=>a.handleClick&&a.handleClick(...e),onKeydown:t[1]||=me(t=>e.activateActions({searchResult:n.searchSuggestion,actionType:`onClick`}),[`enter`]),onMouseover:t[2]||=t=>e.activateActions({searchResult:n.searchSuggestion,actionType:`onHover`}),onFocus:t[3]||=t=>e.activateActions({searchResult:n.searchSuggestion,actionType:`onHover`})},[z(`span`,hL,I(e.$t(n.searchSuggestion.name)),1)],40,mL)],8,pL)])])}var _L=K(uL,[[`render`,gL],[`__scopeId`,`data-v-797cd31f`]]);y();var vL={name:`SearchBarSuggestionList`,components:{SearchBarSuggestionListItem:_L},props:{limitedSortedSearchResults:{type:Object,required:!0}},data(){return{currentShowAllList:[]}},computed:{...N(`Modules/SearchBar`,[`minCharacters`,`showSearchResultsInTree`,`searchInput`,`searchResults`,`searchResultsActive`,`showAllResults`,`currentSide`,`showAllResultsSearchInterfaceInstances`]),...N(`Menu`,[`menuBySide`]),...N([`portalConfig`])},methods:{...o(`Modules/SearchBar`,[`setCurrentAvailableCategories`,`setPlaceholder`,`setShowAllResults`,`setShowAllResultsSearchInterfaceInstances`]),...o(`Menu`,[`setNavigationCurrentComponentBySide`,`setNavigationHistoryBySide`,`setCurrentComponent`,`setCurrentComponentBySide`]),prepareShowAllResults(e){let t=this.currentSide,n={id:this.limitedSortedSearchResults.results.categoryProvider[e],searchCategory:e};if(!this.showAllResultsSearchInterfaceInstances.find(e=>e.id===n.id)){let e=[...this.showAllResultsSearchInterfaceInstances];e.push(n),this.setShowAllResultsSearchInterfaceInstances(e)}if(this.menuBySide(t)){let n=i18next.t(`common:modules.searchBar.searchResults`)+` - `+e;this.setNavigationCurrentComponentBySide({side:t,newComponent:{props:{name:n},type:`searchBar`}}),this.setPlaceholder(i18next.t(`common:modules.searchBar.placeholder.searchFor`)+` `+e),this.setCurrentComponentBySide({side:t,type:`searchBar`}),this.setNavigationHistoryBySide({side:t,newHistory:[{type:`root`,props:[]},{type:`searchBar`,props:{name:n}},{type:`searchBar`,props:{name:`modules.searchBar.searchResultList`}}]})}this.setCurrentAvailableCategories(e),this.currentShowAllList=this.limitedSortedSearchResults.currentShowAllList.filter(t=>t.category===e),this.setShowAllResults(!0)},getFirstByCategory(e){let t=this.limitedSortedSearchResults.results;return Object.values(t).find(t=>t?.category===e)}}},yL={key:0,class:`suggestions-container`},bL=[`title`],xL=[`src`],SL=[`id`],CL={class:`showAllSection`},wL=[`title`,`onClick`];function TL(e,t,n,r,i,o){let s=a(`SearchBarSuggestionListItem`);return e.searchInput?.length>=e.minCharacters&&e.searchResultsActive&&e.searchResults?.length>0&&!e.showSearchResultsInTree?(v(),M(`div`,yL,[(v(!0),M(D,null,C(n.limitedSortedSearchResults.results.availableCategories,r
38=>(v(),M(`div`,{id:`search-bar-suggestion-list`,key:r},[z(`h5`,{id:`search-bar-suggestion-heading`,class:`bold mb-4 mt-4`,title:e.$t(`common:modules.searchBar.searchResultsFrom`)+n.limitedSortedSearchResults.results.categoryProvider[r]+`-`+e.$t(`common:modules.searchBar.search`)},[o.getFirstByCategory(r)?.imagePath?(v(),M(`img`,{key:0,alt:`search result image`,class:`search-bar-suggestion-image`,src:o.getFirstByCategory(r).imagePath},null,8,xL)):L(``,!0),o.getFirstByCategory(r)?.imagePath?L(``,!0):(v(),M(`i`,{key:1,class:E(n.limitedSortedSearchResults.results[r+`Icon`])},null,2)),R(` `+I(r+`: `+n.limitedSortedSearchResults.results[r+`Count`]+` `+e.$t(`common:modules.searchBar.searchResults`)),1)],8,bL),(v(!0),M(D,null,C(e.showAllResults===!1?n.limitedSortedSearchResults.results:n.limitedSortedSearchResults.currentShowAllList,(e,t)=>(v(),M(`div`,{key:e.id+`-`+t},[e.category===r?(v(),M(`p`,{key:0,id:`suggestion_searchInputLi`+t,class:`mb-0`},[A(s,{"search-suggestion":e},null,8,[`search-suggestion`])],8,SL)):L(``,!0)]))),128)),z(`div`,CL,[z(`button`,{type:`button`,class:`btn btn-light d-flex text-left`,title:e.$t(`common:modules.searchBar.showAllResults`),onClick:e=>o.prepareShowAllResults(r)},[R(I(e.$t(`common:modules.searchBar.showAll`))+` `,1),t[0]||=z(`span`,{class:`bi-chevron-right`},null,-1)],8,wL)])]))),128))])):L(``,!0)}var EL=K(vL,[[`render`,TL],[`__scopeId`,`data-v-da2962b7`]]);y();var DL={name:`ActionButton`,components:{IconButton:ab},props:{actionName:{type:String,required:!0},actionArgs:{type:Object,required:!0}},computed:{...N([`isModuleAvailable`]),...N(`Modules/SearchBar`,[`showAllResults`,`iconsByActions`,`searchInputValue`])},methods:{...w(`Modules/SearchBar`,[`activateAction`]),...o(`Modules/SearchBar`,[`setSearchResultsActive`,`setCurrentActionEvent`]),displayAction(){return this.actionName!==`startRouting`||this.isModuleAvailable(`routing`)},callAction(){this.setCurrentActionEvent(this.actionName),this.activateAction({actionName:this.actionName,actionArgs:this.actionArgs})}}};function OL(e,t,n,r,i,o){let s=a(`IconButton`);return o.displayAction()?(v(),F(s,{key:0,aria:e.$t(`common:modules.searchBar.actions.`+n.actionName),"class-array":[`btn-light`,`ms-2`],icon:e.iconsByActions[n.actionName],interaction:o.callAction},null,8,[`aria`,`icon`,`interaction`])):L(``,!0)}var kL=K(DL,[[`render`,OL]]);y();var AL={name:`SearchBarResultListGeneralItem`,components:{ActionButton:kL},props:{searchResult:{type:Object,required:!0}},computed:{actions(){return this.searchResult.events.buttons?this.searchResult.events.buttons:[]}},methods:{...w(`Modules/SearchBar`,[`activateActions`,`removeHighlight3DTile`]),handleClick(){this.removeHighlight3DTile(),this.activateActions({searchResult:this.searchResult,actionType:`onClick`})}}},jL=[`id`],ML={class:`d-flex flex-row align-items-center bold search-bar-result-list-general-row`},NL=[`title`,`aria-label`],PL=[`src`],FL={class:`btn-title`},IL={class:`d-flex search-bar-result-list-general-actions`};function LL(e,t,n,r,i,o){let s=a(`ActionButton`);return v(),M(`div`,{id:`search-bar-result-list-general-item`+n.searchResult.id},[z(`div`,ML,[z(`button`,{type:`button`,class:`btn btn-light d-flex search-bar-result-list-general-item-button`,title:n.searchResult.toolTip?n.searchResult.toolTip:n.searchResult.name,"aria-label":n.searchResult.toolTip?n.searchResult.toolTip:n.searchResult.name,onClick:t[0]||=(...e)=>o.handleClick&&o.handleClick(...e),onKeydown:t[1]||=me(t=>e.activateActions({searchResult:n.searchResult,actionType:`onClick`}),[`enter`]),onMouseover:t[2]||=t=>e.activateActions({searchResult:n.searchResult,actionType:`onHover`}),onFocus:t[3]||=t=>e.activateActions({searchResult:n.searchResult,actionType:`onHover`})},[n.searchResult?.imagePath?(v(),M(`img`,{key:0,alt:`search result image`,class:`search-bar-result-list-general-image`,src:n.searchResult?.imagePath},null,8,PL)):L(``,!0),z(`span`,FL,I(n.searchResult.name),1)],40,NL),z(`div`,IL,[(v(!0),M(D,null,C(Object.keys(o.actions),(e,t)=>(v(),M(`div`,{key:t},[A(s,{"action-name":e,"action-args":o.actions[e]},null,8,[`action-name`,`action-args`])]))),128))])])],8,jL)}var RL=K(AL,[[`render`,LL],[`__scopeId`,`data-v-5275c65d`]]);y();
38var zL={name:`SearchBarResultListGeneral`,components:{SearchBarResultListGeneralItem:RL},props:{resultItems:{type:Array,required:!0}},computed:{...N(`Modules/SearchBar`,[`searchInput`,`searchResults`,`selectedSearchResults`])}},BL={class:`results-general-container`},VL=[`id`];function HL(e,t,n,r,i,o){let s=a(`SearchBarResultListGeneralItem`);return v(),M(`div`,BL,[(v(!0),M(D,null,C(n.resultItems,(e,t)=>(v(),M(`div`,{key:e.id+`-`+t},[z(`p`,{id:`searchInputLi`+e.id,class:`mb-1`},[A(s,{"search-result":e},null,8,[`search-result`])],8,VL)]))),128))])}var UL=K(zL,[[`render`,HL]]);y();var WL={name:`SearchBarResultListTopicTreeItem`,components:{ActionButton:kL},mixins:[FN(`searchResult`)],props:{searchResult:{type:Object,required:!0}},computed:{...N([`visibleLayerConfigs`]),...N(`Modules/SearchBar`,[`selectedSearchResults`]),isChecked(){let e=this.searchResult.events?.onClick?.activateLayerInTopicTree?.layerId||this.searchResult.events?.onClick?.addLayerToTopicTree?.layerId;return this.visibleLayerConfigs?.find(t=>t.id===e)!==void 0||this.selectedSearchResults.find(e=>this.searchResult.id===e.id)!==void 0},actions(){return this.searchResult.events.buttons?this.searchResult.events.buttons:[]}},methods:{...w(`Modules/SearchBar`,[`addLayerToTopicTree`,`removeLayerFromTopicTree`,`showInTree`]),addOrRemoveLayer(){let e=this.searchResult.events?.onClick?.activateLayerInTopicTree||this.searchResult.events?.onClick?.addLayerToTopicTree;this.searchResult.category.includes(`Ordner`)?this.showInTree({layerId:this.searchResult.id}):e&&(this.isChecked?this.removeLayerFromTopicTree(e):this.addLayerToTopicTree(e)),_t.getInstance(this.$el.querySelector(`.layer-checkbox-tooltip`))?.hide()}}},GL=[`id`],KL={class:`search-result-checkbox`},qL=[`data-bs-toggle`,`title`],JL=[`title`,`aria-label`],YL={key:0},XL=[`id`],ZL=[`for`,`aria-label`],QL={class:`d-flex`};function $L(e,t,n,r,i,o){let s=a(`ActionButton`);return v(),M(`div`,{id:`search-bar-result-list-topic-tree-item-`+n.searchResult.id,class:`d-flex flex-row align-items-center`},[z(`span`,KL,[z(`span`,{class:`layer-checkbox-tooltip`,"data-bs-toggle":e.scaleIsOutOfRange?`tooltip`:null,"data-bs-placement":`bottom`,"data-bs-custom-class":`custom-tooltip`,title:e.scaleIsOutOfRange?e.tooltipText:``},[z(`button`,{class:`btn d-flex w-100 pe-2 p-1 btn-light search-bar-result-list-topic-tree-item-title`,title:n.searchResult.toolTip?e.$t(n.searchResult.toolTip):e.$t(n.searchResult.name),"aria-label":n.searchResult.toolTip?e.$t(n.searchResult.toolTip):e.$t(n.searchResult.name),onClick:t[0]||=(...e)=>o.addOrRemoveLayer&&o.addOrRemoveLayer(...e),onKeydown:t[1]||=me((...e)=>o.addOrRemoveLayer&&o.addOrRemoveLayer(...e),[`enter`])},[n.searchResult.category.includes(`Ordner`)?(v(),M(`span`,YL,[z(`i`,{class:E([n.searchResult.icon,`pe-3`])},null,2)])):(v(),M(`span`,{key:1,id:`search-bar-result-list-topic-tree-item-checkbox-`+n.searchResult.id,class:E([`search-bar-result-list-topic-tree-item-checkbox ps-1 pe-3`,{"bi-check-square":o.isChecked,"bi-square":!o.isChecked}])},null,10,XL)),z(`span`,{class:E([`search-bar-result-list-topic-tree-item-label`,`mt-0 d-flex flex-column align-self-start`,o.isChecked?`font-bold`:``]),for:`search-bar-result-list-topic-tree-item-checkbox-`+n.searchResult.id,tabindex:`0`,"aria-label":e.$t(n.searchResult.name)},[z(`span`,null,I(e.$t(n.searchResult.name)),1)],10,ZL)],40,JL)],8,qL)]),z(`div`,QL,[(v(!0),M(D,null,C(Object.keys(o.actions),(e,t)=>(v(),M(`div`,{key:t},[A(s,{"action-name":e,"action-args":o.actions[e]},null,8,[`action-name`,`action-args`])]))),128))])],8,GL)}var eR=K(WL,[[`render`,$L],[`__scopeId`,`data-v-ba332532`]]);y();var tR={name:`SearchBarResultListTopicTree`,components:{SearchBarResultListTopicTreeItem:eR},props:{resultItems:{type:Array,required:!0}},data:()=>({items:{}}),computed:{...N(`Modules/SearchBar`,[`searchInput`,`searchResults`,`selectedSearchResults`])},watch:{resultItems:{handler(e){this.sortByCategories(e)},deep:!0}},created(){this.sortByCategories(this.resultItems)},methods:{sortByCategories(e){e.forEach(e=>{this.items[e.category]===void 0?this.items[e.category]=[e]:this.items[e.category].find(t=>
38t.id===e.id)||this.items[e.category].push(e)})}}},nR={class:`results-topic-tree-container`},rR=[`title`],iR=[`id`];function aR(e,t,n,r,i,o){let s=a(`SearchBarResultListTopicTreeItem`);return v(),M(`div`,nR,[(v(!0),M(D,null,C(Object.keys(e.items),(t,n)=>(v(),M(`div`,{key:t+`-`+n},[z(`h5`,{class:`bold mb-4 mt-4`,title:e.$t(`common:modules.searchBar.searchResultsFrom`)+t+`-`+e.$t(`common:modules.searchBar.search`)},[e.items[t][0]?.icon?(v(),M(`i`,{key:0,class:E(e.items[t][0]?.icon)},null,2)):L(``,!0),R(` `+I(t+`: `+e.items[t].length+` `+e.$t(`common:modules.searchBar.searchResults`)),1)],8,rR),(v(!0),M(D,null,C(e.items[t],(e,t)=>(v(),M(`div`,{key:e.id+`-`+t},[z(`span`,{id:`searchInputLi`+t},[A(s,{"search-result":e},null,8,[`search-result`])],8,iR)]))),128))]))),128))])}var oR=K(tR,[[`render`,aR],[`__scopeId`,`data-v-0faf9275`]]);y();var sR={name:`SearchBarResultList`,components:{SearchBarResultListGeneral:UL,SearchBarResultListTopicTree:oR},props:{limitedSortedSearchResults:{type:Object,required:!0}},data(){return{currentShowAllList:[]}},computed:{...N(`Modules/SearchBar`,[`currentAvailableCategories`,`showAllResultsSearchInterfaceInstance`,`minCharacters`,`searchInput`,`searchInterfaceInstances`,`searchResults`,`searchResultsActive`,`currentSide`,`addLayerButtonSearchActive`]),...N(`Menu`,[`currentComponent`]),resultItems(){return this.currentComponent(this.currentSide).type===`layerSelection`?this.limitedSortedSearchResults?.currentShowAllList:this.limitedSortedSearchResults?.currentShowAllList.filter(e=>this.currentAvailableCategories.startsWith(e.category))},hitTemplate(){if(this.resultItems)return this.searchInterfaceInstances.find(e=>e.searchInterfaceId===this.resultItems[0]?.searchInterfaceId)?.hitTemplate}},methods:{...o(`Modules/SearchBar`,[`setSearchResultsActive`])}},cR={key:0,class:`results-container`},lR={id:`search-bar-result-list`},uR=[`title`],dR=[`src`];function fR(e,t,n,r,i,o){let s=a(`SearchBarResultListTopicTree`),c=a(`SearchBarResultListGeneral`);return e.searchInput?.length>=e.minCharacters&&e.searchResultsActive&&e.searchResults?.length>0?(v(),M(`div`,cR,[z(`div`,lR,[e.addLayerButtonSearchActive?L(``,!0):(v(),M(`h5`,{key:0,id:`search-bar-result-heading`,class:`bold mb-4 mt-4`,title:e.$t(`common:modules.searchBar.searchResultsFrom`)+n.limitedSortedSearchResults?.results.categoryProvider[e.currentAvailableCategories]+`-`+e.$t(`common:modules.searchBar.search`)},[n.limitedSortedSearchResults?.results[e.currentAvailableCategories+`ImgPath`]?(v(),M(`img`,{key:0,alt:`search result image`,src:e.searchResult.imgPath},null,8,dR)):L(``,!0),n.limitedSortedSearchResults?.results[e.currentAvailableCategories+`ImgPath`]?L(``,!0):(v(),M(`i`,{key:1,class:E(n.limitedSortedSearchResults?.results[e.currentAvailableCategories+`Icon`])},null,2)),R(` `+I(e.currentAvailableCategories+`: `+n.limitedSortedSearchResults?.results[e.currentAvailableCategories+`Count`]+` `+e.$t(`common:modules.searchBar.searchResults`)),1)],8,uR)),o.hitTemplate===`layer`?(v(),F(s,{key:1,"result-items":o.resultItems},null,8,[`result-items`])):(v(),F(c,{key:2,"result-items":o.resultItems},null,8,[`result-items`]))])])):L(``,!0)}var pR=K(sR,[[`render`,fR],[`__scopeId`,`data-v-8875002d`]]),mR=t({default:()=>xR});y();var hR={name:`SearchBar`,components:{SearchBarResultList:pR,SearchBarSuggestionList:EL},props:{clickAction:{type:Function,default:void 0,required:!1}},data:function(){return{currentComponentSide:void 0,currentSearchInput:this.searchInput,layerSelectionPlaceHolder:this.placeholder}},computed:{...N(`Modules/SearchBar`,[`configPaths`,`minCharacters`,`placeholder`,`searchInput`,`searchInterfaceInstances`,`searchResults`,`showAllResults`,`suggestionListLength`,`addLayerButtonSearchActive`,`type`,`currentSide`]),...N(`Menu`,{menuCurrentComponent:`currentComponent`,previousNavigationEntryText:`previousNavigationEntryText`}),...N([`portalConfig`]),searchInputValue:{get(){return this.searchInput},set(e){this.setSearchInput(e),this.removeHighlight3DTile()}},searchActivated(){return this.searchInputValue?.length>=parseInt(this.minCharacters,10)},searchResultsWithUniqueCategories(){return this.searchInterfaceInstances.every(e=>e.searchState!==`running`)&&[...new Set(this.searchResults.map(e=>
38e.category))].forEach(e=>{let t=this.searchResults.filter(t=>t.category===e),n=[...new Set(t.map(e=>e.searchInterfaceId))];if(n.length>1){let e=0;n.forEach(n=>{t.forEach(t=>{t.searchInterfaceId===n&&(t.category=t.category+`_`+e)}),++e})}}),this.searchResults},limitedSortedSearchResults(){let e={},t=[];return e.categoryProvider={},this.setSearchSuggestions([]),e.availableCategories=[],this.searchInterfaceInstances.forEach(n=>{for(let[r,i]of Object.entries(this.searchResultsWithUniqueCategories))i.searchInterfaceId===n.searchInterfaceId&&(e[i.category+`Count`]=e[i.category+`Count`]===void 0?1:++e[i.category+`Count`],e.availableCategories.includes(i.category)===!1&&(e.availableCategories.push(i.category),e.categoryProvider[i.category]=i.searchInterfaceId),t.push(i),e[i.category+`Count`]<=this.suggestionListLength&&(e[r]=i,this.addSuggestionItem(i)),i.imgPath&&(e[i.category+`ImgPath`]=i.imgPath),i.icon&&(e[i.category+`Icon`]=i.icon))}),{results:e,currentShowAllList:t}}},watch:{currentComponentSide:{handler(e){(e===`root`||e===`layerSelection`&&this.addLayerButtonSearchActive===!0)&&(this.$refs?.searchInput.blur(),e===`root`&&(this.setSearchResultsActive(!1),this.setShowAllResults(!1),this.setShowSearchResultsInTree(!1),this.setCurrentActionEvent(``),this.navigateBack({side:this.currentSide,doNotTrack:!0}))),e===`layerSelection`&&this.addLayerButtonSearchActive===!0?this.layerSelectionPlaceHolder=`common:modules.searchBar.search`:this.layerSelectionPlaceHolder=this.placeholder,this.setGlobalPlaceholder(this.layerSelectionPlaceHolder)},deep:!0},searchInputValue:{handler(e){e===``?(this.removePointMarker(),this.removePolygonMarker(),this.removeHighlight3DTile()):this.checkCurrentComponent(this.currentComponentSide)},deep:!0},placeholder(e){this.layerSelectionPlaceHolder=e}},updated(){this.$nextTick(()=>{this.searchInput!==``&&this.$refs.searchInput.focus()})},mounted(){this.checkLayerSelectionSearchConfig(),this.setCurrentSide(this.portalConfig?.mainMenu?.searchBar===void 0?`secondaryMenu`:`mainMenu`),this.currentComponentSide=this.menuCurrentComponent(this.currentSide).type,this.initializeModule({configPaths:this.configPaths,type:this.t
38ype}),this.overwriteDefaultValues(),this.instantiateSearchInterfaces(this.$searchInterfaceAddons)},methods:{...w([`initializeModule`]),...w(`Maps`,[`removePointMarker`,`removePolygonMarker`]),...w(`Modules/SearchBar`,[`instantiateSearchInterfaces`,`overwriteDefaultValues`,`activateActions`,`startLayerSelectionSearch`,`checkLayerSelectionSearchConfig`,`search`,`removeHighlight3DTile`]),...w(`Menu`,[`navigateBack`]),...o(`Modules/SearchBar`,[`setGlobalPlaceholder`,`addSuggestionItem`,`setCurrentActionEvent`,`setShowAllResults`,`setShowSearchResultsInTree`,`setSearchInput`,`setSearchResultsActive`,`setSearchSuggestions`,`setCurrentSide`]),...o(`Menu`,[`switchToRoot`,`switchToPreviousComponent`,`setCurrentComponentBySide`,`setCurrentComponentPropsName`]),startSearch(e){this.searchActivated&&(e===`root`&&this.clickAction(),this.setSearchResultsActive(!0),this.search({searchInput:this.searchInputValue}))},checkCurrentComponent(e){e===`root`?(this.clickAction(),this.searchInputValue.length>=this.minCharacters&&this.startSearch()):e===`layerSelection`?(this.searchInputValue?.length===0&&(this.navigateBack({side:this.currentSide,doNotTrack:!0}),this.startLayerSelectionSearch(this.currentSide),this.startSearch()),this.searchInputValue.length>=this.minCharacters&&(this.startLayerSelectionSearch(this.currentSide),this.startSearch())):this.startSearch()},zoomToAndMarkSearchResult(e){e!==void 0&&(this.removePointMarker(),this.searchResults.forEach(t=>{let n=t.category.toLowerCase(),r=t.name.toLowerCase();(n.includes(`adresse`)||n.includes(`address`)||n.includes(`straÃe`))&&e.toLowerCase()===r&&this.activateActions({searchResult:t,actionType:`onClick`})}))},clearSearch(){this.searchInputValue=``,this.$refs.searchInput.focus()}}},gR={id:`search-bar`},_R={class:`input-group mb-3`},vR=[`placeholder`,`aria-label`],yR=[`disabled`,`aria-label`];function bR(e,t,n,r,i,o){let c=a(`SearchBarSuggestionList`),l=a(`SearchBarResultList`);return v(),M(`div`,gR,[z(`div`,_R,[s(z(`input`,{id:`searchInput`,ref:`searchInput`,"onUpdate:modelValue":t[0]||=e=>o.searchInputValue=e,type:`search`,class:`form-control`,placeholder:e.$t(e.layerSelectionPlaceHolder),"aria-label":e.$t(e.layerSelectionPlaceHolder),onKeydown:t[1]||=me(t=>(o.zoomToAndMarkSearchResult(o.searchInputValue),o.checkCurrentComponent(e.currentComponentSide)),[`enter`])},null,40,vR),[[qe,o.searchInputValue]]),o.searchInputValue?(v(),M(`button`,{key:0,class:`btn-icon input-icon reset-button`,type:`button`,"aria-label":`Clear search`,onClick:t[2]||=(...e)=>o.clearSearch&&o.clearSearch(...e)},[...t[4]||=[z(`i`,{class:`bi-x-lg fs-6`},null,-1)]])):L(``,!0),z(`button`,{id:`search-button`,class:`btn btn-primary`,disabled:!o.searchActivated,"aria-label":e.$t(e.placeholder),type:`button`,onClick:t[3]||=t=>(o.zoomToAndMarkSearchResult(o.searchInputValue),o.checkCurrentComponent(e.currentComponentSide))},[...t[5]||=[z(`i`,{class:`bi-search`,role:`img`},null,-1)]],8,yR)]),e.showAllResults?e.showAllResults?(v(),F(l,{key:1,"limited-sorted-search-results":o.limitedSortedSearchResults},null,8,[`limited-sorted-search-results`])):L(``,!0):(v(),F(c,{key:0,"limited-sorted-search-results":o.limitedSortedSearchResults},null,8,[`limited-sorted-search-results`]))])}var xR=K(hR,[[`render`,bR],[`__scopeId`,`data-v-f7efe76e`]]);y();var SR={name:`MenuContainer`,components:{MenuContainerBody:XI,MenuContainerBodyRootLogo:lL,ResizeHandle:rL,SearchBar:xR},props:{side:{type:String,default:`mainMenu`,validator:e=>e===`mainMenu`||e===`secondaryMenu`}},computed:{...N([`menuFromConfig`,`isMobile`,`uiStyle`]),...N(`Modules`,[`componentMap`]),...N(`Menu`,[`mainMenu`,`secondaryMenu`,`currentMenuWidth`,`mainExpanded`,`secondaryExpanded`,`titleBySide`,`currentComponent`,`defaultComponent`,`secondaryMenuEnabled`]),menu(){return this.side===`mainMenu`?this.mainMenu:this.secondaryMenu},currentComponent(){let e=this.menu?.navigation?.currentComponent?.type;return e!==`root`&&e!==this.defaultComponent&&(e=this.componentMap[e]),e},handlePosition(){return this.side===`mainMenu`?`right`:`left`},expanded(){return this.side===`mainMenu`?this.mainExpanded:this.secondaryExpanded},menuInlineStyles(){return{width:this.expanded?this.currentMenuWidth(this.side):`0`,top:this.isMobile?this[this.side]?.expandedTo
38p:`0%`}}},watch:{mainMenu(e){this.mergeMenuState({menu:e,side:`mainMenu`})},secondaryMenu(e){this.mergeMenuState({menu:e,side:`secondaryMenu`})},isMobile(e){e?(this.collapseMenues(),this.setCurrentMenuWidth({side:this.side,width:`100%`})):this.setCurrentMenuWidth({side:this.side,width:`25%`})}},created(){this.mergeMenuState({menu:this.menuFromConfig(this.side),side:this.side}),this.isMobile&&(this.collapseMenues(),this.setCurrentMenuWidth({side:this.side,width:`100%`}))},methods:{...o(`Menu`,[`collapseMenues`,`mergeMenuState`,`setCurrentMenuWidth`,`setCurrentMainMenuOffsetWidth`,`setCurrentSecondaryMenuWidth`,`setCurrentSecondaryMenuOffsetWidth`,`setCurrentMainMenuWidth`]),...o(`Modules/LayerPills`,{setLayerPillsHidden:`setHidden`}),...w(`Menu`,[`clickedMenuElement`,`toggleMenu`,`closeMenu`]),openSearchBar(){this.clickedMenuElement({name:`common:modules.searchBar.searchResultList`,side:this.side,type:`searchBar`})},onResize(e){let t=e.handleElement.offsetWidth/document.documentElement.clientWidth;this.side===`mainMenu`&&this.uiStyle===`DEFAULT`&&(this.setCurrentMainMenuWidth(t),this.setCurrentMainMenuOffsetWidth(e.handleElement.offsetWidth)),this.side===`secondaryMenu`&&this.uiStyle===`DEFAULT`&&(this.hideElementsForBiggerMenu(t),this.setCurrentSecondaryMenuWidth(t),this.setCurrentSecondaryMenuOffsetWidth(e.handleElement.offsetWidth))},hideElementsForBiggerMenu(e){let t=document.documentElement.clientWidth>1e3?.7:.5,n=document.getElementById(`module-portal-footer`);this.setLayerPillsHidden(e>=t),n&&(n.style.display=e>t?`none`:``)},onTransitionEnd(e){let t=e.target.offsetWidth/document.documentElement.clientWidth;e.propertyName===`width`&&(e.target.id.includes(`secondary`)?(this.setCurrentSecondaryMenuWidth(t),this.setCurrentSecondaryMenuOffsetWidth(e.target.offsetWidth)):e.target.id.includes(`main`)&&(this.setCurrentMainMenuWidth(t),this.setCurrentMainMenuOffsetWidth(e.target.offsetWidth)))}}},CR=[`id`,`aria-label`],wR=[`id`],TR=[`id`,`aria-label`],ER=[`id`];function DR(e,t,n,r,i,o){let s=a(`MenuContainerBodyRootLogo`),c=a(`SearchBar`),l=a(`MenuContainerBody`),u=a(`ResizeHandle`);return v(),M(`div`,{id:`mp-menu-`+n.side,class:E([`mp-menu shadow d-flex`,[`mp-`+n.side,{"mp-menu-table":e.uiStyle===`TABLE`,"mp-secondaryMenu-expanded":e.secondaryExpanded&&n.side===`secondaryMenu`,hidden:!e.secondaryMenuEnabled&&n.side===`secondaryMenu`}]]),tabindex:`-1`,style:pe(o.menuInlineStyles),"aria-label":e.titleBySide(n.side)?e.titleBySide(n.side).text:null,onTransitionend:t[2]||=(...e)=>o.onTransitionEnd&&o.onTransitionEnd(...e)},[z(`div`,{id:`mp-header-`+n.side,class:E([`mp-menu-header`,{"mp-menu-header-collapsed":!e.mainExpanded&&n.side===`mainMenu`||!e.secondaryExpanded&&n.side===`secondaryMenu`}])},[z(`button`,{id:`mp-menu-header-close-button-`+n.side,type:`button`,class:`btn-close p-2 mp-menu-header-close-button`,"aria-label":e.$t(`common:modules.menu.ariaLabelClose`),onClick:t[0]||=t=>e.closeMenu(n.side)},null,8,TR),o.currentComponent===`root`&&e.titleBySide(n.side)?(v(),M(`div`,{key:0,id:`mp-subHeader-`+n.side,class:E([`mp-menu-subHeader`,{"mp-menu-subHeader-collapsed":!e.mainExpanded&&n.side===`mainMenu`||!e.secondaryExpanded&&n.side===`secondaryMenu`}])},[A(s,rt({class:`mb-5 mt-4`},e.titleBySide(n.side)),null,16),A(c,{"click-action":o.openSearchBar},null,8,[`click-action`])],10,ER)):L(``,!0)],10,wR),A(l,{side:n.side},null,8,[`side`]),e.isMobile?L(``,!0):(v(),F(u,{key:0,id:`mp-resize-handle-`+n.side,class:`mp-menu-container-handle`,"handle-position":o.handlePosition,mutation:e.setCurrentMenuWidth,"min-width":0,"max-width":.95,side:n.side,onResizing:t[1]||=e=>o.onResize(e)},{default:Pn(()=>[...t[3]||=[R(` â® `,-1)]]),_:1},8,[`id`,`handle-position`,`mutation`,`side`]))],46,CR)}var OR=K(SR,[[`render`,DR]]);y();var kR={name:`MenuToggleButton`,props:{side:{type:String,default:`mainMenu`,validator:e=>e===`mainMenu`||e===`secondaryMenu`}},computed:{...N(`Menu`,[`mainExpanded`,`secondaryExpanded`,`mainToggleButtonIcon`,`secondaryToggleButtonIcon`,`secondaryMenuEnabled`]),iconClass(){let e;return e=this.side===`mainMenu`?this.mainExpanded?`bi-chevron-left`:this.mainToggleButtonIcon:this.secondaryExpanded?`bi-chevron-right`:this.secondaryToggleButtonIcon,e},showButton(){return this.side===`mainMenu`||this.secondaryMenuEnabled}},methods:{...w(`Menu`,[`toggleMenu`])}},AR=[`id`,`aria-label`];function jR(e,t,n,r,i,a){return a.showButton?(v(),M(`button`,{key:0,id:n.side+`-toggle-button`,class:E([`btn btn-light bootstrap-icon shadow menu-toggle-button`,[`toggle-button-`+n.side,{expanded:e.mainExpanded&&n.side===`mainMenu`||e.secondaryExpanded&&n.side===`secondaryMenu`}]]),type:`button`,"aria-label":e.$t(`common:modules.menu.ariaLabelOpen`),onClick:t[0]||=t=>e.toggleMenu(n.side)},[z(`i`,{class:E(a.iconClass)},null,2)],10,AR)):L(``,!0)}var MR=K(kR,[[`render`,jR],[`__scopeId`,`data-v-e09fa5ab`]]),NR={exampleSearch:()=>b(()=>import(`./exampleSearch.js`),[],import.meta.url),gfiOnAddressGaz:()=>b(()=>import(`./gfiOnAddressGaz.js`),__vite__mapDeps([107,1,2]),import.meta.url),waterRiskCheckSearch:()=>b(()=>import(`./waterRiskCheckSearch.js`),__vite__mapDeps([108,1,2]),import.meta.url),mietenspiegelSearch:()=>b(()=>import(`./mietenspiegelSearch.js`),__vite__mapDeps([109,1,2]),import.meta.url),populationRequest:()=>b(()=>import(`./populationRequest.js`),__vite__mapDeps([110,1,2,34,111,112]),import.meta.url),planParken:()=>b(()=>import(`./planParken.js`),__vite__mapDeps([113,1,2,34,111,114]),import.meta.url),sdpDownload:()=>b(()=>import(`./sdpDownload.js`),__vite__mapDeps([115,1,2,34,116]),import.meta.url),streetSmart:()=>b(()=>import(`./streetSmart.js`),__vite__mapDeps([117,1,2,118]),import.meta.url),vcOblique:()=>b(()=>import(`./vcOblique.js`),__vite__mapDeps([119,1,2,120]),import.meta.url),bildungsatlas:()=>b(()=>import(`./bildungsatlas.js`),__vite__mapDeps([121,2,1,122,123,124]),import.meta.url),borisComponent:()=>b(()=>import(`./boris.js`),__vite__mapDeps([125,1,2,111,126]),import.meta.url),combinedGfi:()=>b(()=>import(`./combinedGfi.js`),__vite__mapDeps([127,2,1,8,9,128]),import.meta.url),dataTable:()=>b(()=>import(`./dataTable.js`),__vite__mapDeps([129,1,2,18,19,17,20,21,130]),import.meta.url),dipas:()=>b(()=>import(`./dipas.js`),__vite__mapDeps([131,1,2,132]),import.meta.url),dipasNavigator:()=>b(()=>import(`./dipasNavigator.js`),__vite__mapDeps([133,2,1,134]),import.meta.url),dipasAnalyticsInsights:()=>b(()=>import(`./dipasAnalyticsInsights.js`),__vite__mapDeps([135,1,2,136]),import.meta.url),privateParking:()=>b(()=>import(`./parking.js`),__vite__mapDeps([137,1,2,138]),import.meta.url),schulinfo:()=>b(()=>import(`./schulinfo.js`),__vite__mapDeps([139,1,2,140]),import.meta.url),solaratlas:()=>b(()=>import(`./solaratlas.js`),__vite__mapDeps([141,1,2]),import.meta.url),sturmflut:()=>b(()=>import(`./sturmflut.js`),__vite__mapDeps([142,1,2,143]),import.meta.url),trafficCount:()=>b(()=>import(`./trafficCount.js`),__vite__mapDeps([144,2,1,40,145,41,42,146]),import.meta.url),trinkwasser:()=>b(()=>import(`./trinkwasser.js`),__vite__mapDeps([147,1,2,148]),import.meta.url),verkehrsstaerken:()=>b(()=>import(`./verkehrsstaerken.js`),__vite__mapDeps([149,1,2,150]),import.meta.url),verkehrsfunctions:()=>b(()=>import(`./verkehrsfunctions.js`),__vite__mapDeps([151,2,1]),import.meta.url),valuationPrint:()=>b(()=>import(`./valuationPrint.js`),__vite__mapDeps([152,2,1,8,9,39,153,154,71,72,101,17,18,19,20,21,102,155]),import.meta.url),commuterFlows:()=>b(()=>import(`./commuterFlows.js`),__vite__mapDeps([156,2,1,157]),import.meta.url),waterRiskCheck:()=>b(()=>import(`./waterRiskCheck.js`),__vite__mapDeps([158,2,1,8,9,39,153,71,72,159,98,160,161]
38),import.meta.url),floodRiskManagement:()=>b(()=>import(`./floodRiskManagement.js`),__vite__mapDeps([162,1,2,8,9,163]),import.meta.url),mietenspiegelFormular:()=>b(()=>import(`./mietenspiegelFormular.js`),__vite__mapDeps([164,2,1,165]),import.meta.url),sessionTool:()=>b(()=>import(`./sessionTool.js`),__vite__mapDeps([166,1,2]),import.meta.url),simulationTool:()=>b(()=>import(`./simulationTool.js`),__vite__mapDeps([167,1,2,8,9,20,39,27,28,29,97,168]),import.meta.url),bimFactory:()=>b(()=>import(`./bimFactory.js`),__vite__mapDeps([169,1,2,8,9,34,17,18,19,20,21,170]),import.meta.url),vpiDashboard:()=>b(()=>import(`./vpiDashboard.js`),__vite__mapDeps([171,2,1,20,122,172,123,145,41,42,173]),import.meta.url),geoMarker:()=>b(()=>import(`./geoMarker.js`),__vite__mapDeps([174,2,1,34,20,71,72,40,172,175,46]),import.meta.url),snippetFeatureInfo:()=>b(()=>import(`./snippetFeatureInfo.js`),__vite__mapDeps([176,1,2,8,9,177,178]),import.meta.url),snippetChart:()=>b(()=>import(`./snippetChart.js`),__vite__mapDeps([179,1,2,8,9,122,180]),import.meta.url),cesium3dTilesInspector:()=>b(()=>import(`./cesium3dTilesInspector.js`),__vite__mapDeps([181,2]),import.meta.url),exampleControl:()=>b(()=>import(`./exampleControl.js`),__vite__mapDeps([182,1,2]),import.meta.url),toggleMouseHover:()=>b(()=>import(`./toggleMouseHover.js`),__vite__mapDeps([183,1,2]),import.meta.url),oktagonComponent:()=>b(()=>import(`./oktagon.js`),__vite__mapDeps([184,1,2]),import.meta.url),quickResponseCode:()=>b(()=>import(`./quickResponseCode.js`),__vite__mapDeps([185,2,1,93,186]),import.meta.url),addLayerRemotely:()=>b(()=>import(`./addLayerRemotely.js`),__vite__mapDeps([187,1,2]),import.meta.url),drawWithoutGui:()=>b(()=>import(`./drawWithoutGui.js`),__vite__mapDeps([188,1,2]),import.meta.url),districtSelector:()=>b(()=>import(`./DistrictSelector.js`),__vite__mapDeps([189,1,2,8,9,111,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,96,234,235,236,237,39,27,238]),import.meta.url),districtFinder:()=>b(()=>import(`./DistrictFinder.js`),__vite__mapDeps([239,2,1,8,9,190,191,192,199,197,198,200,201,202,203,204,205,206,207,208,209,210,211,212,193,194,240,241,196,213,223,224,242,243,244,245,246,227,228,232,233,96,234,195,247,39,248]),import.meta.url),accessibilityAnalysis:()=>b(()=>import(`./AccessibilityAnalysis.js`),__vite__mapDeps([249,2,1,8,9,111,190,191,192,250,251,193,194,252,253,240,241,195,203,204,254,196,197,198,199,200,201,202,205,206,207,208,209,210,211,212,213,214,215,217,216,230,255,218,219,220,221,256,222,223,224,225,257,258,242,243,244,245,246,226,259]),import.meta.url),dashboard:()=>b(()=>import(`./Dashboard.js`),__vite__mapDeps([260,1,2,8,9,190,191,192,197,198,200,201,202,199,203,204,205,206,207,208,209,210,211,212,261,262,243,244,263,264,193,194,196,213,245,265,266,267,122,227,228,268,269,236,270,235,271,252,253,272,177,273,274,275]),import.meta.url),colorCodeMap:()=>b(()=>import(`./ColorCodeMap.js`),__vite__mapDeps([276,1,2,277,216,217,218,229,230,195,231,269,236,278,96,234,270,279,233,280]),import.meta.url),featuresList:()=>b(()=>import(`./FeaturesList.js`),__vite__mapDeps([281,2,1,190,8,9,191,192,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,261,262,243,244,263,264,254,196,213,217,265,266,282,269,278,234,195,271,252,253,272,177,273,245,274,283,284,285,286,287]),import.meta.url),distanceScoreService:()=>b(()=>import(`./service.js`),__vite__mapDeps([288,1,2,255,231,39]),import.meta.url),polygonStyler:()=>b(()=>import(`./PolygonStyler.js`),__vite__mapDeps([289,1,2,190,8,9,191,192,199,197,198,200,201,202,203,204,205,206,207,208,209,210,211,212,261,262,243,244,263,264,273,245,274,283,284,285,286,290,291,292]),import.meta.url),areaSelector:()=>b(()=>import(`./AreaSelector.js`),__vite__mapDeps([293,1,2,111,190,8,9,191,192,207,197,198,203,204,208,216,217,219,265,266,294,262,243,244,263]),import.meta.url),templateAdmin:()=>b(()=>import(`./TemplateAdmin.js`),__vite__mapDeps([295,2,1,190,8,9,191,192,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,220,221,222,223,224,225,296,297,298]),import.meta.url),templateManager:()=>b(()=>import(`./TemplateManager.js`),__vite__mapDeps([299,1,2,8,9,190,191,192,193,194,240,241,227,209,203,204,205,206,210,211,228,232,300]),import.meta.url),saveSession:()=>b(()=>import(`./SaveSession.js`),__vite__mapDeps([301,1,2,190,8,9,191,192,193,194,218,257,258,242,197,198,200,201,202,205,206,243,244,245,246,302]),import.meta.url),calculateRatio:()=>b(()=>import(`./CalculateRatio.js`),__vite__mapDeps([303,1,2,8,9,190,191,192,261,199,197,198,200,201,202,203,204,205,206,207,208,209,210,211,212,262,243,244,263,264,193,194,252,253,240,241,196,213,214,217,218,256,222,223,224,225,277,216,229,230,195,231,269,236,278,96,234,270,267,122,227,228,268,282,279,232,3
3804]),import.meta.url),dipasProjects:()=>b(()=>import(`./DipasProjects.js`),__vite__mapDeps([305,2,1,8,9,190,191,192,250,251,193,194,203,204,201,214,215,218,223,224,222,225,227,209,205,206,210,211,228,237,306]),import.meta.url),reportingTool:()=>b(()=>import(`./ReportingTool.js`),__vite__mapDeps([307,2,1,8,9,190,191,192,200,197,198,201,202,199,203,204,205,206,207,208,209,210,211,212,193,194,240,241,196,213,223,224,262,243,244,263,277,216,217,218,229,230,195,231,269,236,278,96,234,270,227,228,235,247,153,154,308,309,296,310]),import.meta.url),cosiFileImport:()=>b(()=>import(`./cosiFileImport.js`),__vite__mapDeps([311,1,2,190,8,9,191,192,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,265,266,294,262,243,244,263,285,286,290,291,312]),import.meta.url),cosiPrintLayoutSelection:()=>b(()=>import(`./cosiPrintLayoutSelection.js`),__vite__mapDeps([313,1,2,314]),import.meta.url),waterRiskCheckSearchBar:()=>b(()=>import(`./searchBar.js`),__vite__mapDeps([315,159,1,2,98,160]),import.meta.url),potentialDamagedBuilding:()=>b(()=>import(`./potentialDamagedBuilding.js`),__vite__mapDeps([316,1,2,43,44,317]),import.meta.url),updateRequirements:()=>b(()=>import(`./updateRequirements.js`),__vite__mapDeps([318,1,2,319,27,320,321]),import.meta.url),projects:()=>b(()=>import(`./projects.js`),__vite__mapDeps([322,1,2,20,319,27,320,323,46]),import.meta.url),geoAnalyze:()=>b(()=>import(`./geoAnalyze.js`),__vite__mapDeps([324,1,2,27,325]),import.meta.url),tacticalMark:()=>b(()=>import(`./tacticalMark.js`),__vite__mapDeps([326,1,2,327]),import.meta.url),dataNarrator:()=>b(()=>import(`./dataNarrator.js`),__vite__mapDeps([328,1,2,329]),import.meta.url),storyPlayer:()=>b(()=>import(`./storyPlayer.js`),__vite__mapDeps([330,1,2,193,194,331,332,333]),import.meta.url),storyManager:()=>b(()=>import(`./storyManager.js`),__vite__mapDeps([334,2,1,8,9,20,193,194,308,309,297,331,332,335,46]),import.meta.url),userTracking:()=>b(()=>import(`./userTracking.js`),[],import.meta.url)};y();var PR={exampleSearch:{entry:`searchInterfaces/exampleSearch/index.js`,type:`searchInterface`,path:`searchInterfaces/exampleSearch`},gfiOnAddressGaz:{entry:`searchInterfaces/gfiOnAddressGaz/index.js`,type:`searchInterface`,path:`searchInterfaces/gfiOnAddressGaz`},waterRiskCheckSearch:{entry:`searchInterfaces/waterRiskCheckSearch/index.js`,type:`searchInterface`,path:`searchInterfaces/waterRiskCheckSearch`},mietenspiegelSearch:{entry:`searchInterfaces/mietenspiegelSearch/index.js`,type:`searchInterface`,path:`searchInterfaces/mietenspiegelSearch`},populationRequest:{entry:`populationRequest/index.js`,type:`tool`},planParken:{entry:`planParken/index.js`,type:`tool`},sdpDownload:{entry:`sdpDownload/index.js`,type:`tool`,path:`sdpDownload`},streetSmart:{entry:`streetSmart/index.js`,type:`tool`},vcOblique:{entry:`vcOblique/index.js`,type:`tool`,path:`vcOblique`},bildungsatlas:{entry:`gfiThemes/bildungsatlas/index.js`,path:`gfiThemes/bildungsatlas`,type:`gfiTheme`},borisComponent:{entry:`boris/index.js`,type:`tool`,path:`boris`},combinedGfi:{entry:`gfiThemes/combinedGfi/index.js`,path:`gfiThemes/combinedGfi`,type:`gfiTheme`},dataTable:{entry:`gfiThemes/dataTable/index.js`,path:`gfiThemes/dataTable`,type:`gfiTheme`},dipas:{entry:`gfiThemes/dipas/index.js`,path:`gfiThemes/dipas`,type:`gfiTheme`},dipasNavigator:{entry:`gfiThemes/dipasNavigator/index.js`,path:`gfiThemes/dipasNavigator`,type:`gfiTheme`},dipasAnalyticsInsights:{entry:`gfiThemes/dipasAnalyticsInsights/index.js`,path:`gfiThemes/dipasAnalyticsInsights`,type:`gfiTheme`},privateParking:{entry:`gfiThemes/parking/index.js`,path:`gfiThemes/parking`,type:`gfiTheme`},schulinfo:{entry:`gfiThemes/schulinfo/index.js`,path:`gfiThemes/schulinfo`,type:`gfiTheme`},solaratlas:{entry:`gfiThemes/solaratlas/index.js`,path:`gfiThemes/solaratlas`,type:`gfiTheme`},sturmflut:{entry:`gfiThemes/sturmflut/index.js`,path:`gfiThemes/sturmflut`,type:`gfiTheme`},trafficCount:{entry:`gfiThemes/trafficCount/index.js`,path:`gfiThemes/trafficCount`,type:`gfiTheme`},trinkwasser:{entry:`gfiThemes/trinkwasser/index.js`,path:`gfiThemes/trinkwasser`,type:`gfiTheme`},verkehrsstaerken:{entry:`gfiThemes/verkehrsstaerken/index.js`,path:`gfiThemes/verkehrsstaerken`,type:`gfiTheme`},verkehrsfunctions:{entry:`verkehrsfunctions/index.js`,type:`javascript`},valuationPrint:{entry:`valuationPrint/index.js`,type:`tool`},commuterFlows:{entry:`commuterFlows/index.js`,type:`tool`},waterRiskCheck:{entry:`waterRiskCheck/index.js`,type:`tool`},floodRiskManagement:{entry:`floodRiskManagement/index.js`,type:`tool`},mietenspiegelFormular:{entry:`mietenspiegelFormular/index.js`,type:`tool`},sessionTool:{entry:`sessionTool/index.js`,type:`tool`},simulationTool:{entry:`simulationTool/index.js`,type:`tool`},bimFactory:{entry:`bimFactory/index.js`,type:`tool`},vpiDashboard:{entry:`vpiDashboard/index.js`,type:`tool`},geoMarker:{entry:`geoMarker/index.js`,type:`tool`},snippetFeatureInfo:{entry:`filterSnippets/snippetFeatureInfo/index.js`,path:`filterSnippets/snippetFeatureInfo`,type:`filterSnippet`},snippetChart:{entry:`filterSnippets/snippetChart/index.js`,path:`filterSnippets/snippetChart`,type:`filterSnippet`},cesium3dTilesInspector:{entry:`cesium3dTilesInspector/index.js`,type:`javascript`},exampleControl:{entry:`controls/exampleControl/index.js`,path:`controls/exampleControl`,type:`control`},toggleMouseHover:{entry:`controls/toggleMouseHover/index.js`,path:`controls/toggleMouseHover`,type:`control`},oktagonComponent:{entry:`oktagon/index.js`,type:`tool`,path:`oktagon`},quickResponseCode:{entry:`quickResponseCode/index.js`,type:`tool`},addLayerRemotely:{entry:`addLayerRemotely/index.js`,type:`tool`},drawWithoutGui:{entry:`drawWithoutGui/index.js`,type:`javascript`},districtSelector:{entry:`cosi/DistrictSelector/index.js`,path:`cosi/DistrictSelector`,type:`tool`},districtFinder:{entry:`cosi/DistrictFinder/index.js`,path:`cosi/DistrictFinder`,type:`tool`},accessibilityAnalysis:{entry:`cosi/AccessibilityAnalysis/index.js`,path:`cosi/AccessibilityAnalysis`,type:`tool`},dashboard:{entry:`cosi/Dashboard/index.js`,path:`cosi/Dashboard`,type:`tool`},colorCodeMap:{entry:`cosi/ColorCodeMap/index.js`,path:`cosi/ColorCodeMap`,type:`tool`},featuresList:{entry:`cosi/FeaturesList/index.js`,path:`cosi/FeaturesList`,type:`tool`},distanceScoreService:{entry:`cosi/FeaturesList/service/index.js`,path:`cosi/FeaturesList/service`,type:`tool`},polygonStyler:{entry:`cosi/PolygonStyler/index.js`,path:`cosi/PolygonStyler`,type:`tool`},areaSelector:{entry:`cosi/AreaSelector/index.js`,path:`cosi/AreaSelector`,type:`tool`},templateAdmin:{entry:`cosi/TemplateAdmin/index.js`,path:`cosi/TemplateAdmin`,type:`tool`},templateManager:{entry:`cosi/TemplateManager/index.js`,path:`cosi/TemplateManager`,type:`tool`},saveSession:{entry:`cosi/SaveSession/index.js`,path:`cosi/SaveSession`,type:`tool`},calculateRatio:{entry:`cosi/CalculateRatio/index.js`,path:`cosi/CalculateRatio`,type:`tool`},dipasProjects:{entry:`cosi/DipasProjects/index.js`,path:`cosi/DipasProjects`,type:`tool`},reportingTool:{entry:`cosi/ReportingTool/index.js`,path:`cosi/ReportingTool`,type:`tool`},cosiFileImport:{entry:`cosi/cosiFileImport/index.js`,path:`cosi/cosiFileImport`,type:`tool`},cosiPrintLayoutSelection:{entry:`cosi/cosiPrintLayoutSelection/index.js`,path:`cosi/cosiPrintLayoutSelection`,type:`vueComponent`},waterRiskCheckSearchBar:{entry:`waterRiskCheck/searchBar/index.js`,path:`waterRiskCheck/searchBar`,type:`tool`},potentialDamagedBuilding:{entry:`heavyRain/potentialDamagedBuilding/index.js`,path:`heavyRain/potentialDamagedBuilding`,type:`tool`},updateRequirements:{entry:`heavyRain/updateRequirements/index.js`,path:`heavyRain/updateRequirements`,type:`tool`},projects:{entry:`heavyRain/projects/index.js`,path:`heavyRain/projects`,type:`tool`},geoAnalyze:{entry:`geoAnalyze/index.js`,path:`geoAnalyze`,type:`tool`},tacticalMark:{entry:`tacticalMark/index.js`,type:`tool`},dataNarrator:{entry:`dataNarrator/index.js`,path:`dataNarrator`,type:`tool`},storyPlayer:{entry:`storyTellingTool/storyPlayer/index.js`,path:`storyTellingTool/storyPlayer`,type:`tool`},storyManager:{entry:`storyTellingTool/storyManager/index.js`,path:`storyTellingTool/storyManager`,type:`tool`},userTracking:{entry:`userTracking/index.js`,type:`javascript`}},FR={loadAddons:async function(e,t){if(e.config.globalProperties.$gfiThemeAddons=[],e.config.globalProperties.$searchInterfaceAddons=[],t){let n=t.map(async t=>{try{let n=PR[t];n&&Object.prototype.hasOwnProperty.call(n,`type`)&&(n.type===`control`?await this.loadControl
38s(t):n.type===`gfiTheme`?await this.loadGfiThemes(t,e):n.type===`searchInterface`?await this.loadSearchInterfaces(t,e):n.type===`tool`?await this.loadToolAddons(t):n.type===`javascript`?await this.loadJavascriptAddons(t):n.type===`vueComponent`?await this.loadVueComponentAddons(t,e):n.type===`filterSnippet`&&await this.loadFilterSnippetAddons(t,e))}catch(e){console.warn(e),console.warn(`The module ${t} does not include a Vue-component and/or vuex-store-module. Please make sure the folder contains a ${t}.vue and ${t}.js file.`,e)}});await Promise.all(n)}},loadJavascriptAddons:async function(e){let t=await this.loadAddon(e);t.store&&$.registerModule([ea(e)],t.store)},loadVueComponentAddons:async function(e,t){let n=await this.loadAddon(e);t.component(n.component.name,n.component),n.store&&$.registerModule([`Modules`,n.component.name],n.store)},loadControls:async function(e){let t=await this.loadAddon(e),n=t.component.name.charAt(0).toLowerCase()+t.component.name.slice(1);_n(t.component.name,t.component),t.store&&$.registerModule([`Controls`,t.component.name],t.store),$.commit(`Controls/registerControl`,{name:n,control:t.component})},loadGfiThemes:async function(e,t){let n=await this.loadAddon(e),r=n.component.name.charAt(0).toLowerCase()+n.component.name.slice(1);t.component(n.component.name,n.component),t.config.globalProperties.$gfiThemeAddons.push(n.component.name),n.store&&($.registerModule([`Modules`,n.component.name],n.store),moduleCollection[r]=n.component)},loadSearchInterfaces:async function(e,t){let n=await this.loadAddon(e);t.config.globalProperties.$searchInterfaceAddons.push(n)},loadToolAddons:async function(e){let t=await this.loadAddon(e),n=t.component.name.charAt(0).toLowerCase()+t.component.name.slice(1);$.registerModule([`Modules`,t.component.name],t.store),moduleCollection[n]=t.component},loadFilterSnippetAddons:async function(e,t){let n=await this.loadAddon(e),r=n.component.name.charAt(0).toLowerCase()+n.component.name.slice(1);t.component(n.component.name,n.component),n.store&&($.registerModule([`Modules`,n.component.name],n.store),moduleCollection[r]=n.component)},loadAddon:async function(e){let t=(await NR[e]()).default;for(let e in t.locales)i18next.addResourceBundle(e,`additional`,t.locales[e],!0);return t}};y();var IR={name:`App`,components:{Alerting:hj,BaselayerSwitcher:Ej,ControlBar:Nj,MenuContainer:OR,MenuToggleButton:MR},data(){return{addonsLoaded:!1,cleanupResize:null}},computed:{...N([`allConfigsLoaded`,`configJs`,`deviceMode`,`mapViewSettings`,`uiStyle`,`visibleLayerConfigs`]),...N(`Menu`,[`mainExpanded`,`mainMenu`,`secondaryExpanded`,`secondaryMenu`,`secondaryMenuEnabled`]),...N(`Modules`,[`componentMap`])},watch:{async allConfigsLoaded(e){e&&(await FR.loadAddons(this.$.appContext.app,Config.addons),this.addonsLoaded=!0,this.extendLayers(),this.initializeVectorStyle(),Xj.initializeMaps(this.mapViewSettings,this.configJs),Pj(this.visibleLayerConfigs),JM.startProcessUrlParams(),this.initializeOther(),await this.$nextTick(),this.$store?.getters?.isModuleAvailable?.(`login`)&&await this.setUpTokenRefreshInterval())}},created(){this.setGlobalVariables(),this.initializeUrlParams(),this.loadConfigsToTheVuexState(),this.checkVueObservation(),this.regulateDeviceMode(),new _t(document.body,{selector:`[data-bs-toggle='tooltip']`})},unmounted(){this.cleanupResize&&this.cleanupResize()},methods:{...o([`setDeviceMode`]),...w([`extendLayers`,`initializeOther`,`initializeVectorStyle`,`loadConfigJs`,`loadConfigJson`,`loadRestServicesJson`,`loadServicesJson`,`initializeUrlParams`]),...w(`Modules/Login`,[`checkLoggedIn`,`setUpTokenRefreshInterval`]),setGlobalVariables(){window.mapCollection=CO,window.moduleCollection={},window.i18next=wt},loadConfigsToTheVuexState(){this.loadConfigJs(Config),this.loadServicesJson(),this.loadConfigJson(),this.loadRestServicesJson()},checkVueObservation(){},regulateDeviceMode(){let e=`Mobile`,t=`Desktop`,n=window.matchMedia(`(max-width: 768px)`);this.setDeviceMode(n.matches?e:t),this.mediaQueryHandler=n=>{this.setDeviceMode(n.matches?e:t)},n.addEventListener(`change`,this.mediaQueryHandler),this.cleanupResize=()=>{n.removeEventListener(`change`,this.mediaQueryHandler)}}}},LR={id:`masterportal-container`,class:`masterportal-container`},RR={key:0},zR={class:`elements-positioned-over-map`};function BR(e,t,n,r,i,o){let s=a(`Alerting`),c=a(`MenuContainer`),l=a(`MenuToggleButton`),u=a(`BaselayerSwitcher`),d=a(`ControlBar`);return v(),M(`div`,LR,[e.allConfigsLoaded&&i.addonsLoaded?(v(),M(`div`,RR,[A(s)])):L(``,!0),e.allConfigsLoaded&&i.addonsLoaded&&e.mainMenu&&e.uiStyle!==`SIMPLE`?(v(),F(c,{key:1,side:`mainMenu`})):L(``,!0),e.allConfigsLoaded&&i.addonsLoaded&&e.mainMenu&&e.uiStyle!==`SIMPLE`?(v(),F(l,{key:2,side:`mainMenu`})):L(``,!0),e.allConfigsLoaded&&i.addonsLoaded?(v(),M(D,{key:3},[z(`div`,zR,[(v(),F(ve(e.componentMap.mouseHover))),(v(),F(ve(e.componentMap.wmsTime))),e.uiStyle===`SIMPLE`?L(``,!0):(v(),F(u,{key:0})),e.uiStyle===`SIMPLE`?L(``,!0):(v(),F(ve(e.componentMap.layerPills),{key:1})),(v(),F(ve(e.componentMap.portalFooter)))]),z(`div`,{class:E([`controls-element`,{"me-5":!e.secondaryMenuEnabled}])},[A(d,{class:`controls`})],2)],64)):L(``,!0),e.allConfigsLoaded&&i.addonsLoaded&&e.secondaryMenu&&e.uiStyle!==`SIMPLE`?(v(),F(l,{key:4,side:`secondaryMenu`})):L(``,!0),e.allConfigsLoaded&&i.addonsLoaded&&e.secondaryMenu&&e.uiStyle!==`SIMPLE`?(v(),F(c,{key:5,side:`secondaryMenu`})):L(``,!0),t[0]||=z(`div`,{id:`map-wrapper`,class:`mp-map`,tabindex:`0`},[z(`div`,{id:`map`})],-1)])}var VR=K(IR,[[`render`,BR],[`__scopeId`,`data-v-c8db8a1d`]]),HR={mounted(e,t){new _t(e,t.value??{})},updated(e,t){_t.getInstance(e)?._config&&Object.assign(_t.getInstance(e)._config,t.value??{})},beforeUnmount(e){let t=e.getAttribute(`aria-describedby`);t&&document.getElementById(t)?.remove();let n=_t.getInstance(e);n&&(n.disable(),setTimeout(()=>{n.dispose()},2e3))}},UR={install(e,t){if(t===void 0||typeof t.postMessageUrl!=`string`){console.error(`RemoteInterface could not been installed: Param "postMessageUrl" missing.`);return}window.addEventListener(`message`,e=>{let t=``;if(!(e.data.namespace===void 0||e.data.action===void 0)){t=e.data.namespace+`/`+e.data.action,e.data.args===void 0&&(e.data.args=null);try{$.dispatch(t,e.data.args,{root:!0})}catch(e){console.error(`RemoteInterface could not call "`+t+`". Please ensure this action is available.`),console.error(`RemoteInterface error while calling "`+t+`": `,e)}}}),e.config.globalProperties.$remoteInterface={sendMessage:e=>{if(!(e instanceof Object)){console.error(`RemoteInterface sendMessage error: Given param is not an Object.`);return}parent.postMessage(e,t.postMessageUrl)}}}};function WR(e,t=!0){if(!e)return;B.interceptors.request.use(n=>Wd.shouldAddToken(n.url,e)?Wd.getAuthToken(n,t):n,e=>Promise.reject(e)),(function(n,r){XMLHttpRequest.prototype._hasAuth=!1,XMLHttpRequest.prototype.setRequestHeader=function(e,t){e.toLowerCase()===`authorization`&&this._hasAuth||(this._hasAuth=!0,r.call(this,e,t))},XMLHttpRequest.prototype.open=function(r,i,...a){let o=n.call(this,r,i,...a);if(!Wd.shouldAddToken(i,e))return o;let s=Wd.getTokenHeader();return s&&(this.setRequestHeader(`Authorization`,s),t&&(this.withCredentials=!0)),o}})(XMLHttpRequest.prototype.open,XMLHttpRequest.prototype.setRequestHeader);let{fetch:n}=window;window.fetch=async(r,i)=>{if(!Wd.shouldAddToken(r,e))return n(r,i);let a={...i,headers:i?.headers||{}};t&&(a.credentials=`include`);let o=Wd.getAuthToken(a,t);return n(r,o)}}var GR={addInterceptor:WR};function KR(){if(!Object.prototype.hasOwnProperty.call(Config,`login`))return!1;let e=new URLSearchParams(window.location.search);if(e.has(`error`)){let t=e.get(`error`),n=e.get(`error_description`);return`<h1>`+t+`</h1><p>`+n+`</p>`}if(e.has(`code`)){let t=null,n=Config.login,r=e.get(`code`),i=e.get(`state`),a=ff.getToken(n.oidcTokenEndpoint,n.oidcClientId,n.oidcRedirectUri,r);return ff.getState()===i?a?.status===200?(t=JSON.parse(a.response),ff.setCookies(t.access_token,t.id_token,t.expires_in,t.refresh_token),qR(n),`user logged in: `+(Rd.get(`email`)||`no email defined for user`)):(ff.eraseCo
38okies(),`Status: `+a?.status+` `+a?.responseText):`<h1>Invalid state</h1>`}return qR(Config.login),!1}function qR(e){let t=Rd.get(`token`);if(t!==void 0){let n=ff.parseJwt(t),r=n.exp?n.exp*1e3:Date.now()+1e4;Date.now()>r&&ff.eraseCookies(),GR.addInterceptor(e?.interceptorUrlRegex,e?.includeCredentials!==!1)}}var JR={handleLoginParameters:KR},YR=(e,t,n)=>{let r=t.lastIndexOf(`?`),i=e[r===-1||r<t.lastIndexOf(`/`)?t:t.slice(0,r)];return i?typeof i==`function`?i():Promise.resolve(i):new Promise((e,r)=>{(typeof queueMicrotask==`function`?queueMicrotask:setTimeout)(r.bind(null,Error(`Unknown variable dynamic import: `+t+(t.split(`/`).length===n?``:`. Note that variables only represent file names one level deep.`))))})};async function XR(){if(!Config.vuetifyFolder){console.error(`Vuetify: Plugin folder name must be provided. Please check your config.js`);return}try{return(await YR(Object.assign({
38"../../addons/cosi/plugins/vuetify/index.js":()=>b(()=>import(`./vuetify.js`),__vite__mapDeps([336,1,2,191,210,337]),import.meta.url)
38}),`../../addons/${Config.vuetifyFolder}/plugins/vuetify/index.js`,7)).default}catch(e){console.error(`Vuetify cannot be loaded from file ${Config.vuetifyFolder}. Please check the file name set in the portal's config.js and try again.`,e);return}}y();var ZR;window.__appMounted=window.__appMounted||!1;var QR=GA.getConfigJsPath()===null?window.location.pathname.substring(0,window.location.pathname.lastIndexOf(`/`)+1)+`config.js`+window.location.search:GA.getConfigJsPath();new Promise((e,t)=>{let n=document.createElement(`script`);document.body.appendChild(n),n.onload=e,n.onerror=t,n.async=!0,n.src=QR}).then(()=>{if(ZR=Me(VR),JR.handleLoginParameters()){window.close();return}Object.prototype.hasOwnProperty.call(Config,`remoteInterface`)&&ZR.use(UR,Config.remoteInterface),ZR.directive(`bs-tooltip`,HR);let e=Te();ZR.use(e),ZR.use($),$.$app=ZR,Config.vuetifyFolder&&XR().then(e=>{e&&ZR.use(e)}),Rn(Config.portalLanguage||{},Config.portalLocales).then(()=>{Ln(ZR),ZR.mount(`#masterportal-root`),window.__appMounted=!0})}),(function(){Array.from(document.querySelectorAll(`link[rel="stylesheet"]`)).forEach(e=>{document.head.appendChild(e)})})();export{Jy as $,Kc as $t,Gk as A,Pm as At,ck as B,Lu as Bt,XM as C,U as Cn,qh as Ct,ZA as D,zh as Dt,Dj as E,Bh as Et,Nk as F,xf as Ft,DD as G,Al as Gt,CO as H,$l as Ht,Pk as I,Nd as It,Kx as J,El as Jt,pT as K,kl as Kt,Ck as L,cd as Lt,Rk as M,pp as Mt,Bk as N,qf as Nt,$ as O,Sh as Ot,Mk as P,Ff as Pt,ab as Q,Jc as Qt,_k as R,ed as Rt,ZM as S,H as Sn,$h as St,Pj as T,Vh as Tt,aO as U,Ml as Ut,ik as V,Eu as Vt,Z as W,jl as Wt,vb as X,fl as Xt,Vb as Y,pl as Yt,pb as Z,Qc as Zt,XN as _,Zn as _n,__ as _t,qP as a,mo as an,Jv as at,EN as b,Kn as bn,Sg as bt,BP as c,K as cn,wv as ct,EP as d,Ii as dn,V_ as dt,qc as en,_y as et,TP as f,xi as fn,f_ as ft,cP as g,Yn as gn,F_ as gt,SP as h,Sr as hn,M_ as ht,GP as i,yo as in,Qv as it,Kk as j,mp as jt,Wk as k,th as kt,NP as l,ea as ln,Tv as lt,CP as m,zr as mn,P_ as mt,PF as n,Sc as nn,ay as nt,KP as o,lo as on,Cv as ot,wP as p,Gr as pn,N_ as pt,Zx as q,Ol as qt,$P as r,q as rn,$v as rt,WP as s,Ta as sn,Sv as st,xR as t,Uc as tn,uy as tt,kP as u,W as un,av as ut,UN as v,$n as vn,t_ as vt,OM as w,Kh as wt,oN as x,Bn as xn,ng as xt,FN as y,er as yn,Dg as yt,lk as z,Uu as zt};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.