@mattilsynet/design 3.0.1 → 3.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/mtds/atlas/atlas-element.js +1 -1
- package/mtds/atlas.iife.js +1 -1
- package/mtds/deprecations.js +43 -36
- package/mtds/deprecations.js.map +1 -1
- package/mtds/index.iife.js +67 -37
- package/mtds/law/law-helper.d.ts +2 -0
- package/mtds/law/law-helper.js +73 -71
- package/mtds/law/law-helper.js.map +1 -1
- package/mtds/law/law.js +7 -6
- package/mtds/law/law.js.map +1 -1
- package/mtds/package.json.js +1 -1
- package/mtds/print/print.css.js +50 -20
- package/mtds/print/print.css.js.map +1 -1
- package/mtds/styles.css +1 -1
- package/mtds/togglegroup/togglegroup.js +15 -15
- package/mtds/togglegroup/togglegroup.js.map +1 -1
- package/mtds/utils.d.ts +2 -2
- package/mtds/utils.js +17 -20
- package/mtds/utils.js.map +1 -1
- package/package.json +9 -9
package/mtds/atlas.iife.js
CHANGED
|
@@ -600,7 +600,7 @@ path.leaflet-interactive:focus:not(:focus-visible) {
|
|
|
600
600
|
print-color-adjust: exact;
|
|
601
601
|
}
|
|
602
602
|
}
|
|
603
|
-
`;_.MarkerClusterGroup=_.FeatureGroup.extend({options:{maxClusterRadius:80,iconCreateFunction:null,spiderfyOnMaxZoom:!0,showCoverageOnHover:!0,zoomToBoundsOnClick:!0,singleMarkerMode:!1,disableClusteringAtZoom:null,removeOutsideVisibleBounds:!0,animate:!0,animateAddingMarkers:!1,spiderfyDistanceMultiplier:1,spiderLegPolylineOptions:{weight:1.5,color:"#222",opacity:.5},chunkedLoading:!1,chunkInterval:200,chunkDelay:50,chunkProgress:null,polygonOptions:{}},initialize:function(n){_.Util.setOptions(this,n),this.options.iconCreateFunction||(this.options.iconCreateFunction=this._defaultIconCreateFunction),this.options.clusterPane||(this.options.clusterPane=_.Marker.prototype.options.pane),this._featureGroup=new _.FeatureGroup,this._featureGroup.addEventParent(this),this._nonPointGroup=new _.FeatureGroup,this._nonPointGroup.addEventParent(this),this._inZoomAnimation=0,this._needsClustering=[],this._needsRemoving=[],this._currentShownBounds=null,this._queue=[],this._childMarkerEventHandlers={dragstart:this._childMarkerDragStart,move:this._childMarkerMoved,dragend:this._childMarkerDragEnd};var t=_.DomUtil.TRANSITION&&this.options.animate;Object.assign(this,t?this._withAnimation:this._noAnimation),this._markerCluster=t?_.MarkerCluster:_.MarkerClusterNonAnimated},addLayer:function(n){if(n instanceof _.LayerGroup)return this.addLayers([n]);if(!n.getLatLng)return this._nonPointGroup.addLayer(n),this.fire("layeradd",{layer:n,propagatedFrom:n}),this;if(!this._map)return this._needsClustering.push(n),this.fire("layeradd",{layer:n,propagatedFrom:n}),this;if(this.hasLayer(n))return this;this._unspiderfy&&this._unspiderfy(),this._addLayer(n,this._maxZoom),this.fire("layeradd",{layer:n,propagatedFrom:n}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons();var t=n,e=this._zoom;if(n.__parent)for(;t.__parent._zoom>=e;)t=t.__parent;return this._currentShownBounds.contains(t.getLatLng())&&(this.options.animateAddingMarkers?this._animationAddLayer(n,t):this._animationAddLayerNonAnimated(n,t)),this},removeLayer:function(n){return n instanceof _.LayerGroup?this.removeLayers([n]):n.getLatLng?this._map?n.__parent?(this._unspiderfy&&(this._unspiderfy(),this._unspiderfyLayer(n)),this._removeLayer(n,!0),this.fire("layerremove",{layer:n,propagatedFrom:n}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),n.off(this._childMarkerEventHandlers,this),this._featureGroup.hasLayer(n)&&(this._featureGroup.removeLayer(n),n.clusterShow&&n.clusterShow()),this):this:(!this._arraySplice(this._needsClustering,n)&&this.hasLayer(n)&&this._needsRemoving.push({layer:n,latlng:n._latlng}),this.fire("layerremove",{layer:n,propagatedFrom:n}),this):(this._nonPointGroup.removeLayer(n),this.fire("layerremove",{layer:n,propagatedFrom:n}),this)},addLayers:function(n,t){if(!Array.isArray(n))return this.addLayer(n);var e=this._featureGroup,i=this._nonPointGroup,s=this.options.chunkedLoading,o=this.options.chunkInterval,r=this.options.chunkProgress,a=n.length,l=0,h=!0,d;if(this._map){const c=Date.now(),u=()=>{for(var p=Date.now();l<a&&!(s&&l%200===0&&Date.now()-p>o);l++){if(d=n[l],d instanceof _.LayerGroup){h&&(n=n.slice(),h=!1),this._extractNonGroupLayers(d,n),a=n.length;continue}if(!d.getLatLng){i.addLayer(d),t||this.fire("layeradd",{layer:d,propagatedFrom:d});continue}if(!this.hasLayer(d)&&(this._addLayer(d,this._maxZoom),t||this.fire("layeradd",{layer:d,propagatedFrom:d}),d.__parent&&d.__parent.getChildCount()===2)){const y=d.__parent.getAllChildMarkers(),g=y[0]===d?y[1]:y[0];e.removeLayer(g)}}r&&r(l,a,Date.now()-c),l===a?(this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds)):setTimeout(u,this.options.chunkDelay)};u()}else{const c=this._needsClustering;for(;l<a;l++){if(d=n[l],d instanceof _.LayerGroup){h&&(n=n.slice(),h=!1),this._extractNonGroupLayers(d,n),a=n.length;continue}if(!d.getLatLng){i.addLayer(d);continue}this.hasLayer(d)||c.push(d)}}return this},removeLayers:function(n){var t,e,i=n.length,s=this._featureGroup,o=this._nonPointGroup,r=!0;if(!this._map){for(t=0;t<i;t++){if(e=n[t],e instanceof _.LayerGroup){r&&(n=n.slice(),r=!1),this._extractNonGroupLayers(e,n),i=n.length;continue}this._arraySplice(this._needsClustering,e),o.removeLayer(e),this.hasLayer(e)&&this._needsRemoving.push({layer:e,latlng:e._latlng}),this.fire("layerremove",{layer:e,propagatedFrom:e})}return this}if(this._unspiderfy){this._unspiderfy();const a=n.slice();let l=i;for(t=0;t<l;t++){if(e=a[t],e instanceof _.LayerGroup){this._extractNonGroupLayers(e,a),l=a.length;continue}this._unspiderfyLayer(e)}}for(t=0;t<i;t++){if(e=n[t],e instanceof _.LayerGroup){r&&(n=n.slice(),r=!1),this._extractNonGroupLayers(e,n),i=n.length;continue}if(!e.__parent){o.removeLayer(e),this.fire("layerremove",{layer:e,propagatedFrom:e});continue}this._removeLayer(e,!0,!0),this.fire("layerremove",{layer:e,propagatedFrom:e}),s.hasLayer(e)&&(s.removeLayer(e),e.clusterShow&&e.clusterShow())}return this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds),this},clearLayers:function(){return this._map||(this._needsClustering=[],delete this._gridClusters,delete this._gridUnclustered),this._noanimationUnspiderfy&&this._noanimationUnspiderfy(),this._featureGroup.clearLayers(),this._nonPointGroup.clearLayers(),this.eachLayer(function(n){n.off(this._childMarkerEventHandlers,this),delete n.__parent},this),this._map&&this._generateInitialClusters(),this},getBounds:function(){var n=new _.LatLngBounds;this._topClusterLevel&&n.extend(this._topClusterLevel._bounds);for(let t=this._needsClustering.length-1;t>=0;t--)n.extend(this._needsClustering[t].getLatLng());return n.extend(this._nonPointGroup.getBounds()),n},eachLayer:function(n,t){var e=this._needsClustering.slice(),i=this._needsRemoving,s,o,r;for(this._topClusterLevel&&this._topClusterLevel.getAllChildMarkers(e),o=e.length-1;o>=0;o--){for(s=!0,r=i.length-1;r>=0;r--)if(i[r].layer===e[o]){s=!1;break}s&&n.call(t,e[o])}this._nonPointGroup.eachLayer(n,t)},getLayers:function(){var n=[];return this.eachLayer(t=>{n.push(t)}),n},getLayer:function(n){var t=null;return n=parseInt(n,10),this.eachLayer(e=>{_.stamp(e)===n&&(t=e)}),t},hasLayer:function(n){if(!n)return!1;var t,e=this._needsClustering;for(t=e.length-1;t>=0;t--)if(e[t]===n)return!0;for(e=this._needsRemoving,t=e.length-1;t>=0;t--)if(e[t].layer===n)return!1;return!!(n.__parent&&n.__parent._group===this)||this._nonPointGroup.hasLayer(n)},zoomToShowLayer:function(n,t){typeof t!="function"&&(t=()=>{});var e=function(){(n._icon||n.__parent._icon)&&!this._inZoomAnimation&&(this._map.off("moveend",e,this),this.off("animationend",e,this),n._icon?t():n.__parent._icon&&(this.once("spiderfied",t,this),n.__parent.spiderfy()))};n._icon&&this._map.getBounds().contains(n.getLatLng())?t():n.__parent._zoom<Math.round(this._map._zoom)?(this._map.on("moveend",e,this),this._map.panTo(n.getLatLng())):(this._map.on("moveend",e,this),this.on("animationend",e,this),n.__parent.zoomToBounds())},onAdd:function(n){this._map=n;var t,e,i;if(!Number.isFinite(this._map.getMaxZoom()))throw"Map has no maxZoom specified";for(this._featureGroup.addTo(n),this._nonPointGroup.addTo(n),this._gridClusters||this._generateInitialClusters(),this._maxLat=n.options.crs.projection.MAX_LATITUDE,t=0,e=this._needsRemoving.length;t<e;t++)i=this._needsRemoving[t],i.newlatlng=i.layer._latlng,i.layer._latlng=i.latlng;for(t=0,e=this._needsRemoving.length;t<e;t++)i=this._needsRemoving[t],this._removeLayer(i.layer,!0),i.layer._latlng=i.newlatlng;this._needsRemoving=[],this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds(),this._map.on("zoomend",this._zoomEnd,this),this._map.on("moveend",this._moveEnd,this),this._spiderfierOnAdd&&this._spiderfierOnAdd(),this._bindEvents(),e=this._needsClustering,this._needsClustering=[],this.addLayers(e,!0)},onRemove:function(n){n.off("zoomend",this._zoomEnd,this),n.off("moveend",this._moveEnd,this),this._unbindEvents(),this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim",""),this._spiderfierOnRemove&&this._spiderfierOnRemove(),delete this._maxLat,this._hideCoverage(),this._featureGroup.remove(),this._nonPointGroup.remove(),this._featureGroup.clearLayers(),this._map=null},getVisibleParent:n=>{for(var t=n;t&&!t._icon;)t=t.__parent;return t||null},_arraySplice:(n,t)=>{for(let e=n.length-1;e>=0;e--)if(n[e]===t)return n.splice(e,1),!0},_removeFromGridUnclustered:function(n,t){for(var e=this._map,i=this._gridUnclustered,s=Math.floor(this._map.getMinZoom());t>=s&&i[t].removeObject(n,e.project(n.getLatLng(),t));t--);},_childMarkerDragStart:n=>{n.target.__dragStart=n.target._latlng},_childMarkerMoved:function(n){if(!this._ignoreMove&&!n.target.__dragStart){const t=(n.target._popup||null)?.isOpen();this._moveChild(n.target,n.oldLatLng,n.latlng),t&&n.target.openPopup()}},_moveChild:function(n,t,e){n._latlng=t,this.removeLayer(n),n._latlng=e,this.addLayer(n)},_childMarkerDragEnd:function(n){n.target.__dragStart&&this._moveChild(n.target,n.target.__dragStart,n.target._latlng),delete n.target.__dragStart},_removeLayer:function(n,t,e){var i=this._gridClusters,s=this._gridUnclustered,o=this._featureGroup,r=this._map,a=Math.floor(this._map.getMinZoom());t&&this._removeFromGridUnclustered(n,this._maxZoom);var l=n.__parent,h=l._markers,d;for(this._arraySplice(h,n);l&&(l._childCount--,l._boundsNeedUpdate=!0,!(l._zoom<a));)t&&l._childCount<=1?(d=l._markers[0]===n?l._markers[1]:l._markers[0],i[l._zoom].removeObject(l,r.project(l._cLatLng,l._zoom)),s[l._zoom].addObject(d,r.project(d.getLatLng(),l._zoom)),this._arraySplice(l.__parent._childClusters,l),l.__parent._markers.push(d),d.__parent=l.__parent,l._icon&&(o.removeLayer(l),e||o.addLayer(d))):l._iconNeedsUpdate=!0,l=l.__parent;delete n.__parent},_isOrIsParent:(n,t)=>{for(;t;){if(n===t)return!0;t=t.parentNode}return!1},fire:function(n,t,e){if(t&&t.propagatedFrom instanceof _.MarkerCluster){if(t.originalEvent&&this._isOrIsParent(t.propagatedFrom._icon,t.originalEvent.relatedTarget))return;n=`cluster${n}`}_.FeatureGroup.prototype.fire.call(this,n,t,e)},listens:function(n,t){return _.FeatureGroup.prototype.listens.call(this,n,t)||_.FeatureGroup.prototype.listens.call(this,`cluster${n}`,t)},_defaultIconCreateFunction:n=>{const t=n.getChildCount();let e=" marker-cluster-";return t<10?e+="small":t<100?e+="medium":e+="large",new _.DivIcon({html:`<div><span>${t}</span></div>`,className:`marker-cluster ${e}`,iconSize:new _.Point(40,40)})},_bindEvents:function(){var n=this._map,t=this.options.spiderfyOnMaxZoom,e=this.options.showCoverageOnHover,i=this.options.zoomToBoundsOnClick;(t||i)&&this.on("clusterclick",this._zoomOrSpiderfy,this),e&&(this.on("clustermouseover",this._showCoverage,this),this.on("clustermouseout",this._hideCoverage,this),n.on("zoomend",this._hideCoverage,this))},_zoomOrSpiderfy:function(n){const t=n.propagatedFrom;let e=t;for(;e._childClusters.length===1;)e=e._childClusters[0];e._zoom===this._maxZoom&&e._childCount===t._childCount&&this.options.spiderfyOnMaxZoom?t.spiderfy():this.options.zoomToBoundsOnClick&&t.zoomToBounds(),n.originalEvent&&n.originalEvent.keyCode===13&&this._map._container.focus()},_showCoverage:function(n){var t=this._map;this._inZoomAnimation||(this._shownPolygon&&t.removeLayer(this._shownPolygon),n.propagatedFrom.getChildCount()>2&&n.propagatedFrom!==this._spiderfied&&(this._shownPolygon=new _.Polygon(n.propagatedFrom.getConvexHull(),this.options.polygonOptions),t.addLayer(this._shownPolygon)))},_hideCoverage:function(){this._shownPolygon&&(this._map.removeLayer(this._shownPolygon),this._shownPolygon=null)},_unbindEvents:function(){var n=this.options.spiderfyOnMaxZoom,t=this.options.showCoverageOnHover,e=this.options.zoomToBoundsOnClick,i=this._map;(n||e)&&this.off("clusterclick",this._zoomOrSpiderfy,this),t&&(this.off("clustermouseover",this._showCoverage,this),this.off("clustermouseout",this._hideCoverage,this),i.off("zoomend",this._hideCoverage,this))},_zoomEnd:function(){this._map&&(this._mergeSplitClusters(),this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds())},_moveEnd:function(){if(!this._inZoomAnimation){var n=this._getExpandedVisibleBounds();this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,n),this._topClusterLevel._recursivelyAddChildrenToMap(null,Math.round(this._map._zoom),n),this._currentShownBounds=n}},_generateInitialClusters:function(){var n=Math.ceil(this._map.getMaxZoom()),t=Math.floor(this._map.getMinZoom()),e=this.options.maxClusterRadius,i=e;typeof e!="function"&&(i=()=>e),this.options.disableClusteringAtZoom!==null&&(n=this.options.disableClusteringAtZoom-1),this._maxZoom=n,this._gridClusters={},this._gridUnclustered={};for(let s=n;s>=t;s--)this._gridClusters[s]=new _.DistanceGrid(i(s)),this._gridUnclustered[s]=new _.DistanceGrid(i(s));this._topClusterLevel=new this._markerCluster(this,t-1)},_addLayer:function(n,t){var e=this._gridClusters,i=this._gridUnclustered,s=Math.floor(this._map.getMinZoom()),o,r;for(this.options.singleMarkerMode&&this._overrideMarkerIcon(n),n.on(this._childMarkerEventHandlers,this);t>=s;t--){o=this._map.project(n.getLatLng(),t);let a=e[t].getNearObject(o);if(a){a._addChild(n),n.__parent=a;return}if(a=i[t].getNearObject(o),a){const l=a.__parent;l&&this._removeLayer(a,!1);const h=new this._markerCluster(this,t,a,n);e[t].addObject(h,this._map.project(h._cLatLng,t)),a.__parent=h,n.__parent=h;let d=h;for(r=t-1;r>l._zoom;r--)d=new this._markerCluster(this,r,d),e[r].addObject(d,this._map.project(a.getLatLng(),r));l._addChild(d),this._removeFromGridUnclustered(a,t);return}i[t].addObject(n,o)}this._topClusterLevel._addChild(n),n.__parent=this._topClusterLevel},_refreshClustersIcons:function(){this._featureGroup.eachLayer(n=>{n instanceof _.MarkerCluster&&n._iconNeedsUpdate&&n._updateIcon()})},_enqueue:function(n){this._queue.push(n),this._queueTimeout||(this._queueTimeout=setTimeout(()=>this._processQueue(),300))},_processQueue:function(){for(let n=0;n<this._queue.length;n++)this._queue[n].call(this);this._queue.length=0,clearTimeout(this._queueTimeout),this._queueTimeout=null},_mergeSplitClusters:function(){var n=Math.round(this._map._zoom);this._processQueue(),this._zoom<n&&this._currentShownBounds.intersects(this._getExpandedVisibleBounds())?(this._animationStart(),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,this._getExpandedVisibleBounds()),this._animationZoomIn(this._zoom,n)):this._zoom>n?(this._animationStart(),this._animationZoomOut(this._zoom,n)):this._moveEnd()},_getExpandedVisibleBounds:function(){if(this.options.removeOutsideVisibleBounds){if(_.Browser.mobile)return this._checkBoundsMaxLat(this._map.getBounds())}else return this._mapBoundsInfinite;return this._checkBoundsMaxLat(this._map.getBounds().pad(1))},_checkBoundsMaxLat:function(n){var t=this._maxLat;return t!==void 0&&(n.getNorth()>=t&&(n._northEast.lat=1/0),n.getSouth()<=-t&&(n._southWest.lat=-1/0)),n},_animationAddLayerNonAnimated:function(n,t){if(t===n)this._featureGroup.addLayer(n);else if(t._childCount===2){t._addToMap();const e=t.getAllChildMarkers();this._featureGroup.removeLayer(e[0]),this._featureGroup.removeLayer(e[1])}else t._updateIcon()},_extractNonGroupLayers:function(n,t){var e=n.getLayers(),i=0,s;for(t=t||[];i<e.length;i++){if(s=e[i],s instanceof _.LayerGroup){this._extractNonGroupLayers(s,t);continue}t.push(s)}return t},_overrideMarkerIcon:function(n){return n.options.icon=this.options.iconCreateFunction({getChildCount:()=>1,getAllChildMarkers:()=>[n]}),n.options.icon}}),_.MarkerClusterGroup.include({_mapBoundsInfinite:new _.LatLngBounds(new _.LatLng(-1/0,-1/0),new _.LatLng(1/0,1/0))}),_.MarkerClusterGroup.include({_noAnimation:{_animationStart:()=>{},_animationZoomIn:function(n,t){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),n),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationZoomOut:function(n,t){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),n),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationAddLayer:function(n,t){this._animationAddLayerNonAnimated(n,t)}},_withAnimation:{_animationStart:function(){this._map._mapPane.className+=" leaflet-cluster-anim",this._inZoomAnimation++},_animationZoomIn:function(n,t){var e=this._getExpandedVisibleBounds(),i=this._featureGroup,s=Math.floor(this._map.getMinZoom()),o;this._ignoreMove=!0,this._topClusterLevel._recursively(e,n,s,r=>{var a=r._latlng,l=r._markers,h;for(e.contains(a)||(a=null),r._isSingleParent()&&n+1===t?(i.removeLayer(r),r._recursivelyAddChildrenToMap(null,t,e)):(r.clusterHide(),r._recursivelyAddChildrenToMap(a,t,e)),o=l.length-1;o>=0;o--)h=l[o],e.contains(h._latlng)||i.removeLayer(h)}),this._forceLayout(),this._topClusterLevel._recursivelyBecomeVisible(e,t),i.eachLayer(r=>{!(r instanceof _.MarkerCluster)&&r._icon&&r.clusterShow()}),this._topClusterLevel._recursively(e,n,t,r=>{r._recursivelyRestoreChildPositions(t)}),this._ignoreMove=!1,this._enqueue(function(){this._topClusterLevel._recursively(e,n,s,r=>{i.removeLayer(r),r.clusterShow()}),this._animationEnd()})},_animationZoomOut:function(n,t){this._animationZoomOutSingle(this._topClusterLevel,n-1,t),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),n,this._getExpandedVisibleBounds())},_animationAddLayer:function(n,t){var e=this._featureGroup;e.addLayer(n),t!==n&&(t._childCount>2?(t._updateIcon(),this._forceLayout(),this._animationStart(),n._setPos(this._map.latLngToLayerPoint(t.getLatLng())),n.clusterHide(),this._enqueue(()=>{e.removeLayer(n),n.clusterShow(),this._animationEnd()})):(this._forceLayout(),this._animationStart(),this._animationZoomOutSingle(t,this._map.getMaxZoom(),this._zoom)))}},_animationZoomOutSingle:function(n,t,e){var i=this._getExpandedVisibleBounds(),s=Math.floor(this._map.getMinZoom());n._recursivelyAnimateChildrenInAndAddSelfToMap(i,s,t+1,e);var o=this;this._forceLayout(),n._recursivelyBecomeVisible(i,e),this._enqueue(function(){if(n._childCount===1){const r=n._markers[0];this._ignoreMove=!0,r.setLatLng(r.getLatLng()),this._ignoreMove=!1,r.clusterShow&&r.clusterShow()}else n._recursively(i,e,s,r=>{r._recursivelyRemoveChildrenFromMap(i,s,t+1)});o._animationEnd()})},_animationEnd:function(){this._map&&(this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim","")),this._inZoomAnimation--,this.fire("animationend")},_forceLayout:()=>{_.Util.falseFn(document.body.offsetWidth)}}),_.MarkerCluster=_.Marker.extend({initialize:function(n,t,e,i){_.Marker.prototype.initialize.call(this,e?e._cLatLng||e.getLatLng():new _.LatLng(0,0),{icon:this,pane:n.options.clusterPane}),this._group=n,this._zoom=t,this._markers=[],this._childClusters=[],this._childCount=0,this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._bounds=new _.LatLngBounds,e&&this._addChild(e),i&&this._addChild(i)},getAllChildMarkers:function(n){n=n||[];for(let t=this._childClusters.length-1;t>=0;t--)this._childClusters[t].getAllChildMarkers(n);for(let t=this._markers.length-1;t>=0;t--)n.push(this._markers[t]);return n},getChildCount:function(){return this._childCount},zoomToBounds:function(n){for(var t=this._childClusters.slice(),e=this._group._map,i=e.getBoundsZoom(this._bounds),s=this._zoom+1,o=e.getZoom(),r;t.length>0&&i>s;){s++;let a=[];for(r=0;r<t.length;r++)a=a.concat(t[r]._childClusters);t=a}i>s?this._group._map.setView(this._latlng,s):i<=o?this._group._map.setView(this._latlng,o+1):this._group._map.fitBounds(this._bounds,n)},getBounds:function(){var n=new _.LatLngBounds;return n.extend(this._bounds),n},_updateIcon:function(){this._iconNeedsUpdate=!0,this._icon&&this.setIcon(this)},createIcon:function(){return this._iconNeedsUpdate&&(this._iconObj=this._group.options.iconCreateFunction(this),this._iconNeedsUpdate=!1),this._iconObj.createIcon()},createShadow:function(){return this._iconObj.createShadow()},_addChild:function(n,t){this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._setClusterCenter(n),n instanceof _.MarkerCluster?(t||(this._childClusters.push(n),n.__parent=this),this._childCount+=n._childCount):(t||this._markers.push(n),this._childCount++),this.__parent&&this.__parent._addChild(n,!0)},_setClusterCenter:function(n){this._cLatLng||(this._cLatLng=n._cLatLng||n._latlng)},_resetBounds:function(){var n=this._bounds;n._southWest&&(n._southWest.lat=1/0,n._southWest.lng=1/0),n._northEast&&(n._northEast.lat=-1/0,n._northEast.lng=-1/0)},_recalculateBounds:function(){var n=this._markers,t=this._childClusters,e=0,i=0,s=this._childCount,o,r,a,l;if(s!==0){for(this._resetBounds(),o=0;o<n.length;o++)a=n[o]._latlng,this._bounds.extend(a),e+=a.lat,i+=a.lng;for(o=0;o<t.length;o++)r=t[o],r._boundsNeedUpdate&&r._recalculateBounds(),this._bounds.extend(r._bounds),a=r._wLatLng,l=r._childCount,e+=a.lat*l,i+=a.lng*l;this._latlng=this._wLatLng=new _.LatLng(e/s,i/s),this._boundsNeedUpdate=!1}},_addToMap:function(n){n&&(this._backupLatlng=this._latlng,this.setLatLng(n)),this._group._featureGroup.addLayer(this)},_recursivelyAnimateChildrenIn:function(n,t,e){this._recursively(n,this._group._map.getMinZoom(),e-1,i=>{var s=i._markers,o,r;for(o=s.length-1;o>=0;o--)r=s[o],r._icon&&(r._setPos(t),r.clusterHide())},i=>{var s=i._childClusters,o,r;for(o=s.length-1;o>=0;o--)r=s[o],r._icon&&(r._setPos(t),r.clusterHide())})},_recursivelyAnimateChildrenInAndAddSelfToMap:function(n,t,e,i){this._recursively(n,i,t,s=>{s._recursivelyAnimateChildrenIn(n,s._group._map.latLngToLayerPoint(s.getLatLng()).round(),e),s._isSingleParent()&&e-1===i?(s.clusterShow(),s._recursivelyRemoveChildrenFromMap(n,t,e)):s.clusterHide(),s._addToMap()})},_recursivelyBecomeVisible:function(n,t){this._recursively(n,this._group._map.getMinZoom(),t,null,e=>{e.clusterShow()})},_recursivelyAddChildrenToMap:function(n,t,e){this._recursively(e,this._group._map.getMinZoom()-1,t,i=>{if(t!==i._zoom)for(let s=i._markers.length-1;s>=0;s--){const o=i._markers[s];e.contains(o._latlng)&&(n&&(o._backupLatlng=o.getLatLng(),o.setLatLng(n),o.clusterHide&&o.clusterHide()),i._group._featureGroup.addLayer(o))}},i=>{i._addToMap(n)})},_recursivelyRestoreChildPositions:function(n){for(let t=this._markers.length-1;t>=0;t--){const e=this._markers[t];e._backupLatlng&&(e.setLatLng(e._backupLatlng),delete e._backupLatlng)}if(n-1===this._zoom)for(let t=this._childClusters.length-1;t>=0;t--)this._childClusters[t]._restorePosition();else for(let t=this._childClusters.length-1;t>=0;t--)this._childClusters[t]._recursivelyRestoreChildPositions(n)},_restorePosition:function(){this._backupLatlng&&(this.setLatLng(this._backupLatlng),delete this._backupLatlng)},_recursivelyRemoveChildrenFromMap:function(n,t,e,i){var s,o;this._recursively(n,t-1,e-1,r=>{for(o=r._markers.length-1;o>=0;o--)s=r._markers[o],(!i||!i.contains(s._latlng))&&(r._group._featureGroup.removeLayer(s),s.clusterShow&&s.clusterShow())},r=>{for(o=r._childClusters.length-1;o>=0;o--)s=r._childClusters[o],(!i||!i.contains(s._latlng))&&(r._group._featureGroup.removeLayer(s),s.clusterShow&&s.clusterShow())})},_recursively:function(n,t,e,i,s){var o=this._childClusters,r=this._zoom,a,l;if(t<=r&&(i&&i(this),s&&r===e&&s(this)),r<t||r<e)for(a=o.length-1;a>=0;a--)l=o[a],n.intersects(l._bounds)&&l._recursively(n,t,e,i,s)},_isSingleParent:function(){return this._childClusters.length>0&&this._childClusters[0]._childCount===this._childCount}}),_.Marker.include({clusterHide:function(){return this.options.opacityWhenUnclustered=this.options.opacity||1,this.setOpacity(0)},clusterShow:function(){var n=this.setOpacity(this.options.opacity||this.options.opacityWhenUnclustered);return delete this.options.opacityWhenUnclustered,n}}),_.DistanceGrid=function(n){this._cellSize=n,this._sqCellSize=n*n,this._grid={},this._objectPoint={}},_.DistanceGrid.prototype={addObject:function(n,t){var e=this._getCoord(t.x),i=this._getCoord(t.y),s=this._grid;s[i]=s[i]||{};var o=s[i];o[e]=o[e]||[];var r=o[e],a=_.Util.stamp(n);this._objectPoint[a]=t,r.push(n)},updateObject:function(n,t){this.removeObject(n),this.addObject(n,t)},removeObject:function(n,t){var e=this._getCoord(t.x),i=this._getCoord(t.y),s=this._grid;s[i]=s[i]||{};var o=s[i];o[e]=o[e]||[];var r=o[e],a,l;for(delete this._objectPoint[_.Util.stamp(n)],a=0,l=r.length;a<l;a++)if(r[a]===n)return r.splice(a,1),l===1&&delete o[e],!0},eachObject:function(n,t){var e,i,s,o,r,a,l,h=this._grid;for(e in h){r=h[e];for(i in r)for(a=r[i],s=0,o=a.length;s<o;s++)l=n.call(t,a[s]),l&&(s--,o--)}},getNearObject:function(n){var t=this._getCoord(n.x),e=this._getCoord(n.y),i,s,o,r,a,l,h,d,c=this._objectPoint,u=this._sqCellSize,p=null;for(i=e-1;i<=e+1;i++)if(r=this._grid[i],r){for(s=t-1;s<=t+1;s++)if(a=r[s],a)for(o=0,l=a.length;o<l;o++)h=a[o],d=this._sqDist(c[_.Util.stamp(h)],n),d<u&&(u=d,p=h)}return p},_getCoord:function(n){return Math.floor(n/this._cellSize)},_sqDist:(n,t)=>{var e=t.x-n.x,i=t.y-n.y;return e*e+i*i}},_.QuickHull={getDistant:(n,t)=>{var e=t[1].lat-t[0].lat,i=t[0].lng-t[1].lng;return i*(n.lat-t[0].lat)+e*(n.lng-t[0].lng)},findMostDistantPointFromBaseLine:function(n,t){var e=0,i=null,s=[],o,r,a;for(o=t.length-1;o>=0;o--){if(r=t[o],a=this.getDistant(r,n),a>0)s.push(r);else continue;a>e&&(e=a,i=r)}return{maxPoint:i,newPoints:s}},buildConvexHull:function(n,t){var e=[],i=this.findMostDistantPointFromBaseLine(n,t);return i.maxPoint?(e=e.concat(this.buildConvexHull([n[0],i.maxPoint],i.newPoints)),e=e.concat(this.buildConvexHull([i.maxPoint,n[1]],i.newPoints)),e):[n[0]]},getConvexHull:function(n){var t=!1,e=!1,i=!1,s=!1,o=null,r=null,a=null,l=null,h=null,d=null,c;for(c=n.length-1;c>=0;c--){const p=n[c];(t===!1||p.lat>t)&&(o=p,t=p.lat),(e===!1||p.lat<e)&&(r=p,e=p.lat),(i===!1||p.lng>i)&&(a=p,i=p.lng),(s===!1||p.lng<s)&&(l=p,s=p.lng)}e!==t?(d=r,h=o):(d=l,h=a);var u=[].concat(this.buildConvexHull([d,h],n),this.buildConvexHull([h,d],n));return u}},_.MarkerCluster.include({getConvexHull:function(){var n=this.getAllChildMarkers(),t=[],e,i;for(i=n.length-1;i>=0;i--)e=n[i].getLatLng(),t.push(e);return _.QuickHull.getConvexHull(t)}}),_.MarkerCluster.include({_2PI:Math.PI*2,_circleFootSeparation:25,_circleStartAngle:Math.PI/6,_spiralFootSeparation:28,_spiralLengthStart:11,_spiralLengthFactor:5,_circleSpiralSwitchover:9,spiderfy:function(){if(!(this._group._spiderfied===this||this._group._inZoomAnimation)){var n=this.getAllChildMarkers(),t=this._group,e=t._map,i=e.latLngToLayerPoint(this._latlng),s;this._group._unspiderfy(),this._group._spiderfied=this,n.length>=this._circleSpiralSwitchover?s=this._generatePointsSpiral(n.length,i):(i.y+=10,s=this._generatePointsCircle(n.length,i)),this._animationSpiderfy(n,s)}},unspiderfy:function(n){this._group._inZoomAnimation||(this._animationUnspiderfy(n),this._group._spiderfied=null)},_generatePointsCircle:function(n,t){var e=this._group.options.spiderfyDistanceMultiplier*this._circleFootSeparation*(2+n),i=e/this._2PI,s=this._2PI/n,o=[],r,a;for(o.length=n,r=n-1;r>=0;r--)a=this._circleStartAngle+r*s,o[r]=new _.Point(t.x+i*Math.cos(a),t.y+i*Math.sin(a))._round();return o},_generatePointsSpiral:function(n,t){var e=this._group.options.spiderfyDistanceMultiplier,i=e*this._spiralLengthStart,s=e*this._spiralFootSeparation,o=e*this._spiralLengthFactor*this._2PI,r=0,a=[],l;for(a.length=n,l=n-1;l>=0;l--)r+=s/i+l*5e-4,a[l]=new _.Point(t.x+i*Math.cos(r),t.y+i*Math.sin(r))._round(),i+=o/r;return a},_noanimationUnspiderfy:function(){var n=this._group,t=n._map,e=n._featureGroup,i=this.getAllChildMarkers(),s,o;for(n._ignoreMove=!0,this.setOpacity(1),o=i.length-1;o>=0;o--)s=i[o],e.removeLayer(s),s._preSpiderfyLatlng&&(s.setLatLng(s._preSpiderfyLatlng),delete s._preSpiderfyLatlng),s.setZIndexOffset&&s.setZIndexOffset(0),s._spiderLeg&&(t.removeLayer(s._spiderLeg),delete s._spiderLeg);n.fire("unspiderfied",{cluster:this,markers:i}),n._ignoreMove=!1,n._spiderfied=null}}),_.MarkerClusterNonAnimated=_.MarkerCluster.extend({_animationSpiderfy:function(n,t){var e=this._group,i=e._map,s=e._featureGroup,o=this._group.options.spiderLegPolylineOptions,r,a,l,h;for(e._ignoreMove=!0,r=0;r<n.length;r++)h=i.layerPointToLatLng(t[r]),a=n[r],l=new _.Polyline([this._latlng,h],o),i.addLayer(l),a._spiderLeg=l,a._preSpiderfyLatlng=a._latlng,a.setLatLng(h),a.setZIndexOffset&&a.setZIndexOffset(1e6),s.addLayer(a);this.setOpacity(.3),e._ignoreMove=!1,e.fire("spiderfied",{cluster:this,markers:n})},_animationUnspiderfy:function(){this._noanimationUnspiderfy()}}),_.MarkerCluster.include({_animationSpiderfy:function(n,t){var e=this._group,i=e._map,s=e._featureGroup,o=this._latlng,r=i.latLngToLayerPoint(o),a=_.Path.SVG,l=Object.assign({},this._group.options.spiderLegPolylineOptions),h=l.opacity,d,c,u,p,y,g;for(h===void 0&&(h=_.MarkerClusterGroup.prototype.options.spiderLegPolylineOptions.opacity),a?(l.opacity=0,l.className=`${l.className||""} leaflet-cluster-spider-leg`):l.opacity=h,e._ignoreMove=!0,d=0;d<n.length;d++)c=n[d],g=i.layerPointToLatLng(t[d]),u=new _.Polyline([o,g],l),i.addLayer(u),c._spiderLeg=u,a&&(p=u._path,y=p.getTotalLength()+.1,p.style.strokeDasharray=y,p.style.strokeDashoffset=y),c.setZIndexOffset&&c.setZIndexOffset(1e6),c.clusterHide&&c.clusterHide(),s.addLayer(c),c._setPos&&c._setPos(r);for(e._forceLayout(),e._animationStart(),d=n.length-1;d>=0;d--)g=i.layerPointToLatLng(t[d]),c=n[d],c._preSpiderfyLatlng=c._latlng,c.setLatLng(g),c.clusterShow&&c.clusterShow(),a&&(u=c._spiderLeg,p=u._path,p.style.strokeDashoffset=0,u.setStyle({opacity:h}));this.setOpacity(.3),e._ignoreMove=!1,setTimeout(()=>{e._animationEnd(),e.fire("spiderfied",{cluster:this,markers:n})},200)},_animationUnspiderfy:function(n){var t=this._group,e=t._map,i=t._featureGroup,s=n?e._latLngToNewLayerPoint(this._latlng,n.zoom,n.center):e.latLngToLayerPoint(this._latlng),o=this.getAllChildMarkers(),r=_.Path.SVG,a,l,h,d,c,u;for(t._ignoreMove=!0,t._animationStart(),this.setOpacity(1),l=o.length-1;l>=0;l--)a=o[l],a._preSpiderfyLatlng&&(a.closePopup(),a.setLatLng(a._preSpiderfyLatlng),delete a._preSpiderfyLatlng,u=!0,a._setPos&&(a._setPos(s),u=!1),a.clusterHide&&(a.clusterHide(),u=!1),u&&i.removeLayer(a),r&&(h=a._spiderLeg,d=h._path,c=d.getTotalLength()+.1,d.style.strokeDashoffset=c,h.setStyle({opacity:0})));t._ignoreMove=!1,setTimeout(()=>{var p=0;for(l=o.length-1;l>=0;l--)a=o[l],a._spiderLeg&&p++;for(l=o.length-1;l>=0;l--)a=o[l],a._spiderLeg&&(a.clusterShow&&a.clusterShow(),a.setZIndexOffset&&a.setZIndexOffset(0),p>1&&i.removeLayer(a),e.removeLayer(a._spiderLeg),delete a._spiderLeg);t._animationEnd(),t.fire("unspiderfied",{cluster:this,markers:o})},200)}}),_.MarkerClusterGroup.include({_spiderfied:null,unspiderfy:function(...n){this._unspiderfy.apply(this,n)},_spiderfierOnAdd:function(){this._map.on("click",this._unspiderfyWrapper,this),this._map.options.zoomAnimation&&this._map.on("zoomstart",this._unspiderfyZoomStart,this),this._map.on("zoomend",this._noanimationUnspiderfy,this),_.Browser.touch||this._map.getRenderer(this)},_spiderfierOnRemove:function(){this._map.off("click",this._unspiderfyWrapper,this),this._map.off("zoomstart",this._unspiderfyZoomStart,this),this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._map.off("zoomend",this._noanimationUnspiderfy,this),this._noanimationUnspiderfy()},_unspiderfyZoomStart:function(){this._map&&this._map.on("zoomanim",this._unspiderfyZoomAnim,this)},_unspiderfyZoomAnim:function(n){this._map._mapPane.classList.contains("leaflet-touching")||(this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._unspiderfy(n))},_unspiderfyWrapper:function(){this._unspiderfy()},_unspiderfy:function(n){this._spiderfied&&this._spiderfied.unspiderfy(n)},_noanimationUnspiderfy:function(){this._spiderfied&&this._spiderfied._noanimationUnspiderfy()},_unspiderfyLayer:function(n){n._spiderLeg&&(this._featureGroup.removeLayer(n),n.clusterShow&&n.clusterShow(),n.setZIndexOffset&&n.setZIndexOffset(0),this._map.removeLayer(n._spiderLeg),delete n._spiderLeg)}}),_.MarkerClusterGroup.include({refreshClusters:function(n){return n?n instanceof _.MarkerClusterGroup?n=n._topClusterLevel.getAllChildMarkers():n instanceof _.LayerGroup?n=n._layers:n instanceof _.MarkerCluster?n=n.getAllChildMarkers():n instanceof _.Marker&&(n=[n]):n=this._topClusterLevel.getAllChildMarkers(),this._flagParentsIconsNeedUpdate(n),this._refreshClustersIcons(),this.options.singleMarkerMode&&this._refreshSingleMarkerModeMarkers(n),this},_flagParentsIconsNeedUpdate:n=>{var t,e;for(t in n)for(e=n[t].__parent;e;)e._iconNeedsUpdate=!0,e=e.__parent},_refreshSingleMarkerModeMarkers:function(n){var t,e;for(t in n)e=n[t],this.hasLayer(e)&&e.setIcon(this._overrideMarkerIcon(e))}}),_.Marker.include({refreshIconOptions:function(n,t){var e=this.options.icon;return _.setOptions(e,n),this.setIcon(e),t&&this.__parent&&this.__parent._group.refreshClusters(this),this}});const Ve=()=>typeof window<"u"&&typeof document<"u";function Yn(n,t){let e;return function(...i){clearTimeout(e),e=setTimeout(()=>n.apply(this,i),t)}}function A(n,t,e){return e===void 0?n.getAttribute(t)??null:(e===null?n.removeAttribute(t):n.getAttribute(t)!==e&&n.setAttribute(t,e),null)}const en=(n,...t)=>{const[e,...i]=t;for(const s of e.split(" "))n.addEventListener(s,...i);return()=>Ke(n,...t)},Ke=(n,...t)=>{const[e,...i]=t;for(const s of e.split(" "))n.removeEventListener(s,...i)},ce=(n,t,e)=>{const i=document.createElement(n);if(e&&(i.textContent=e),t)for(const[s,o]of Object.entries(t))A(i,s,o);return i},ue=typeof HTMLElement>"u"?class{}:HTMLElement,pe=(n,t)=>!Ve()||window.customElements.get(n)||window.customElements.define(n,t),Xn=`/**
|
|
603
|
+
`;_.MarkerClusterGroup=_.FeatureGroup.extend({options:{maxClusterRadius:80,iconCreateFunction:null,spiderfyOnMaxZoom:!0,showCoverageOnHover:!0,zoomToBoundsOnClick:!0,singleMarkerMode:!1,disableClusteringAtZoom:null,removeOutsideVisibleBounds:!0,animate:!0,animateAddingMarkers:!1,spiderfyDistanceMultiplier:1,spiderLegPolylineOptions:{weight:1.5,color:"#222",opacity:.5},chunkedLoading:!1,chunkInterval:200,chunkDelay:50,chunkProgress:null,polygonOptions:{}},initialize:function(n){_.Util.setOptions(this,n),this.options.iconCreateFunction||(this.options.iconCreateFunction=this._defaultIconCreateFunction),this.options.clusterPane||(this.options.clusterPane=_.Marker.prototype.options.pane),this._featureGroup=new _.FeatureGroup,this._featureGroup.addEventParent(this),this._nonPointGroup=new _.FeatureGroup,this._nonPointGroup.addEventParent(this),this._inZoomAnimation=0,this._needsClustering=[],this._needsRemoving=[],this._currentShownBounds=null,this._queue=[],this._childMarkerEventHandlers={dragstart:this._childMarkerDragStart,move:this._childMarkerMoved,dragend:this._childMarkerDragEnd};var t=_.DomUtil.TRANSITION&&this.options.animate;Object.assign(this,t?this._withAnimation:this._noAnimation),this._markerCluster=t?_.MarkerCluster:_.MarkerClusterNonAnimated},addLayer:function(n){if(n instanceof _.LayerGroup)return this.addLayers([n]);if(!n.getLatLng)return this._nonPointGroup.addLayer(n),this.fire("layeradd",{layer:n,propagatedFrom:n}),this;if(!this._map)return this._needsClustering.push(n),this.fire("layeradd",{layer:n,propagatedFrom:n}),this;if(this.hasLayer(n))return this;this._unspiderfy&&this._unspiderfy(),this._addLayer(n,this._maxZoom),this.fire("layeradd",{layer:n,propagatedFrom:n}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons();var t=n,e=this._zoom;if(n.__parent)for(;t.__parent._zoom>=e;)t=t.__parent;return this._currentShownBounds.contains(t.getLatLng())&&(this.options.animateAddingMarkers?this._animationAddLayer(n,t):this._animationAddLayerNonAnimated(n,t)),this},removeLayer:function(n){return n instanceof _.LayerGroup?this.removeLayers([n]):n.getLatLng?this._map?n.__parent?(this._unspiderfy&&(this._unspiderfy(),this._unspiderfyLayer(n)),this._removeLayer(n,!0),this.fire("layerremove",{layer:n,propagatedFrom:n}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),n.off(this._childMarkerEventHandlers,this),this._featureGroup.hasLayer(n)&&(this._featureGroup.removeLayer(n),n.clusterShow&&n.clusterShow()),this):this:(!this._arraySplice(this._needsClustering,n)&&this.hasLayer(n)&&this._needsRemoving.push({layer:n,latlng:n._latlng}),this.fire("layerremove",{layer:n,propagatedFrom:n}),this):(this._nonPointGroup.removeLayer(n),this.fire("layerremove",{layer:n,propagatedFrom:n}),this)},addLayers:function(n,t){if(!Array.isArray(n))return this.addLayer(n);var e=this._featureGroup,i=this._nonPointGroup,s=this.options.chunkedLoading,o=this.options.chunkInterval,r=this.options.chunkProgress,a=n.length,l=0,h=!0,d;if(this._map){const c=Date.now(),u=()=>{for(var p=Date.now();l<a&&!(s&&l%200===0&&Date.now()-p>o);l++){if(d=n[l],d instanceof _.LayerGroup){h&&(n=n.slice(),h=!1),this._extractNonGroupLayers(d,n),a=n.length;continue}if(!d.getLatLng){i.addLayer(d),t||this.fire("layeradd",{layer:d,propagatedFrom:d});continue}if(!this.hasLayer(d)&&(this._addLayer(d,this._maxZoom),t||this.fire("layeradd",{layer:d,propagatedFrom:d}),d.__parent&&d.__parent.getChildCount()===2)){const y=d.__parent.getAllChildMarkers(),g=y[0]===d?y[1]:y[0];e.removeLayer(g)}}r&&r(l,a,Date.now()-c),l===a?(this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds)):setTimeout(u,this.options.chunkDelay)};u()}else{const c=this._needsClustering;for(;l<a;l++){if(d=n[l],d instanceof _.LayerGroup){h&&(n=n.slice(),h=!1),this._extractNonGroupLayers(d,n),a=n.length;continue}if(!d.getLatLng){i.addLayer(d);continue}this.hasLayer(d)||c.push(d)}}return this},removeLayers:function(n){var t,e,i=n.length,s=this._featureGroup,o=this._nonPointGroup,r=!0;if(!this._map){for(t=0;t<i;t++){if(e=n[t],e instanceof _.LayerGroup){r&&(n=n.slice(),r=!1),this._extractNonGroupLayers(e,n),i=n.length;continue}this._arraySplice(this._needsClustering,e),o.removeLayer(e),this.hasLayer(e)&&this._needsRemoving.push({layer:e,latlng:e._latlng}),this.fire("layerremove",{layer:e,propagatedFrom:e})}return this}if(this._unspiderfy){this._unspiderfy();const a=n.slice();let l=i;for(t=0;t<l;t++){if(e=a[t],e instanceof _.LayerGroup){this._extractNonGroupLayers(e,a),l=a.length;continue}this._unspiderfyLayer(e)}}for(t=0;t<i;t++){if(e=n[t],e instanceof _.LayerGroup){r&&(n=n.slice(),r=!1),this._extractNonGroupLayers(e,n),i=n.length;continue}if(!e.__parent){o.removeLayer(e),this.fire("layerremove",{layer:e,propagatedFrom:e});continue}this._removeLayer(e,!0,!0),this.fire("layerremove",{layer:e,propagatedFrom:e}),s.hasLayer(e)&&(s.removeLayer(e),e.clusterShow&&e.clusterShow())}return this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds),this},clearLayers:function(){return this._map||(this._needsClustering=[],delete this._gridClusters,delete this._gridUnclustered),this._noanimationUnspiderfy&&this._noanimationUnspiderfy(),this._featureGroup.clearLayers(),this._nonPointGroup.clearLayers(),this.eachLayer(function(n){n.off(this._childMarkerEventHandlers,this),delete n.__parent},this),this._map&&this._generateInitialClusters(),this},getBounds:function(){var n=new _.LatLngBounds;this._topClusterLevel&&n.extend(this._topClusterLevel._bounds);for(let t=this._needsClustering.length-1;t>=0;t--)n.extend(this._needsClustering[t].getLatLng());return n.extend(this._nonPointGroup.getBounds()),n},eachLayer:function(n,t){var e=this._needsClustering.slice(),i=this._needsRemoving,s,o,r;for(this._topClusterLevel&&this._topClusterLevel.getAllChildMarkers(e),o=e.length-1;o>=0;o--){for(s=!0,r=i.length-1;r>=0;r--)if(i[r].layer===e[o]){s=!1;break}s&&n.call(t,e[o])}this._nonPointGroup.eachLayer(n,t)},getLayers:function(){var n=[];return this.eachLayer(t=>{n.push(t)}),n},getLayer:function(n){var t=null;return n=parseInt(n,10),this.eachLayer(e=>{_.stamp(e)===n&&(t=e)}),t},hasLayer:function(n){if(!n)return!1;var t,e=this._needsClustering;for(t=e.length-1;t>=0;t--)if(e[t]===n)return!0;for(e=this._needsRemoving,t=e.length-1;t>=0;t--)if(e[t].layer===n)return!1;return!!(n.__parent&&n.__parent._group===this)||this._nonPointGroup.hasLayer(n)},zoomToShowLayer:function(n,t){typeof t!="function"&&(t=()=>{});var e=function(){(n._icon||n.__parent._icon)&&!this._inZoomAnimation&&(this._map.off("moveend",e,this),this.off("animationend",e,this),n._icon?t():n.__parent._icon&&(this.once("spiderfied",t,this),n.__parent.spiderfy()))};n._icon&&this._map.getBounds().contains(n.getLatLng())?t():n.__parent._zoom<Math.round(this._map._zoom)?(this._map.on("moveend",e,this),this._map.panTo(n.getLatLng())):(this._map.on("moveend",e,this),this.on("animationend",e,this),n.__parent.zoomToBounds())},onAdd:function(n){this._map=n;var t,e,i;if(!Number.isFinite(this._map.getMaxZoom()))throw"Map has no maxZoom specified";for(this._featureGroup.addTo(n),this._nonPointGroup.addTo(n),this._gridClusters||this._generateInitialClusters(),this._maxLat=n.options.crs.projection.MAX_LATITUDE,t=0,e=this._needsRemoving.length;t<e;t++)i=this._needsRemoving[t],i.newlatlng=i.layer._latlng,i.layer._latlng=i.latlng;for(t=0,e=this._needsRemoving.length;t<e;t++)i=this._needsRemoving[t],this._removeLayer(i.layer,!0),i.layer._latlng=i.newlatlng;this._needsRemoving=[],this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds(),this._map.on("zoomend",this._zoomEnd,this),this._map.on("moveend",this._moveEnd,this),this._spiderfierOnAdd&&this._spiderfierOnAdd(),this._bindEvents(),e=this._needsClustering,this._needsClustering=[],this.addLayers(e,!0)},onRemove:function(n){n.off("zoomend",this._zoomEnd,this),n.off("moveend",this._moveEnd,this),this._unbindEvents(),this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim",""),this._spiderfierOnRemove&&this._spiderfierOnRemove(),delete this._maxLat,this._hideCoverage(),this._featureGroup.remove(),this._nonPointGroup.remove(),this._featureGroup.clearLayers(),this._map=null},getVisibleParent:n=>{for(var t=n;t&&!t._icon;)t=t.__parent;return t||null},_arraySplice:(n,t)=>{for(let e=n.length-1;e>=0;e--)if(n[e]===t)return n.splice(e,1),!0},_removeFromGridUnclustered:function(n,t){for(var e=this._map,i=this._gridUnclustered,s=Math.floor(this._map.getMinZoom());t>=s&&i[t].removeObject(n,e.project(n.getLatLng(),t));t--);},_childMarkerDragStart:n=>{n.target.__dragStart=n.target._latlng},_childMarkerMoved:function(n){if(!this._ignoreMove&&!n.target.__dragStart){const t=(n.target._popup||null)?.isOpen();this._moveChild(n.target,n.oldLatLng,n.latlng),t&&n.target.openPopup()}},_moveChild:function(n,t,e){n._latlng=t,this.removeLayer(n),n._latlng=e,this.addLayer(n)},_childMarkerDragEnd:function(n){n.target.__dragStart&&this._moveChild(n.target,n.target.__dragStart,n.target._latlng),delete n.target.__dragStart},_removeLayer:function(n,t,e){var i=this._gridClusters,s=this._gridUnclustered,o=this._featureGroup,r=this._map,a=Math.floor(this._map.getMinZoom());t&&this._removeFromGridUnclustered(n,this._maxZoom);var l=n.__parent,h=l._markers,d;for(this._arraySplice(h,n);l&&(l._childCount--,l._boundsNeedUpdate=!0,!(l._zoom<a));)t&&l._childCount<=1?(d=l._markers[0]===n?l._markers[1]:l._markers[0],i[l._zoom].removeObject(l,r.project(l._cLatLng,l._zoom)),s[l._zoom].addObject(d,r.project(d.getLatLng(),l._zoom)),this._arraySplice(l.__parent._childClusters,l),l.__parent._markers.push(d),d.__parent=l.__parent,l._icon&&(o.removeLayer(l),e||o.addLayer(d))):l._iconNeedsUpdate=!0,l=l.__parent;delete n.__parent},_isOrIsParent:(n,t)=>{for(;t;){if(n===t)return!0;t=t.parentNode}return!1},fire:function(n,t,e){if(t&&t.propagatedFrom instanceof _.MarkerCluster){if(t.originalEvent&&this._isOrIsParent(t.propagatedFrom._icon,t.originalEvent.relatedTarget))return;n=`cluster${n}`}_.FeatureGroup.prototype.fire.call(this,n,t,e)},listens:function(n,t){return _.FeatureGroup.prototype.listens.call(this,n,t)||_.FeatureGroup.prototype.listens.call(this,`cluster${n}`,t)},_defaultIconCreateFunction:n=>{const t=n.getChildCount();let e=" marker-cluster-";return t<10?e+="small":t<100?e+="medium":e+="large",new _.DivIcon({html:`<div><span>${t}</span></div>`,className:`marker-cluster ${e}`,iconSize:new _.Point(40,40)})},_bindEvents:function(){var n=this._map,t=this.options.spiderfyOnMaxZoom,e=this.options.showCoverageOnHover,i=this.options.zoomToBoundsOnClick;(t||i)&&this.on("clusterclick",this._zoomOrSpiderfy,this),e&&(this.on("clustermouseover",this._showCoverage,this),this.on("clustermouseout",this._hideCoverage,this),n.on("zoomend",this._hideCoverage,this))},_zoomOrSpiderfy:function(n){const t=n.propagatedFrom;let e=t;for(;e._childClusters.length===1;)e=e._childClusters[0];e._zoom===this._maxZoom&&e._childCount===t._childCount&&this.options.spiderfyOnMaxZoom?t.spiderfy():this.options.zoomToBoundsOnClick&&t.zoomToBounds(),n.originalEvent&&n.originalEvent.keyCode===13&&this._map._container.focus()},_showCoverage:function(n){var t=this._map;this._inZoomAnimation||(this._shownPolygon&&t.removeLayer(this._shownPolygon),n.propagatedFrom.getChildCount()>2&&n.propagatedFrom!==this._spiderfied&&(this._shownPolygon=new _.Polygon(n.propagatedFrom.getConvexHull(),this.options.polygonOptions),t.addLayer(this._shownPolygon)))},_hideCoverage:function(){this._shownPolygon&&(this._map.removeLayer(this._shownPolygon),this._shownPolygon=null)},_unbindEvents:function(){var n=this.options.spiderfyOnMaxZoom,t=this.options.showCoverageOnHover,e=this.options.zoomToBoundsOnClick,i=this._map;(n||e)&&this.off("clusterclick",this._zoomOrSpiderfy,this),t&&(this.off("clustermouseover",this._showCoverage,this),this.off("clustermouseout",this._hideCoverage,this),i.off("zoomend",this._hideCoverage,this))},_zoomEnd:function(){this._map&&(this._mergeSplitClusters(),this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds())},_moveEnd:function(){if(!this._inZoomAnimation){var n=this._getExpandedVisibleBounds();this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,n),this._topClusterLevel._recursivelyAddChildrenToMap(null,Math.round(this._map._zoom),n),this._currentShownBounds=n}},_generateInitialClusters:function(){var n=Math.ceil(this._map.getMaxZoom()),t=Math.floor(this._map.getMinZoom()),e=this.options.maxClusterRadius,i=e;typeof e!="function"&&(i=()=>e),this.options.disableClusteringAtZoom!==null&&(n=this.options.disableClusteringAtZoom-1),this._maxZoom=n,this._gridClusters={},this._gridUnclustered={};for(let s=n;s>=t;s--)this._gridClusters[s]=new _.DistanceGrid(i(s)),this._gridUnclustered[s]=new _.DistanceGrid(i(s));this._topClusterLevel=new this._markerCluster(this,t-1)},_addLayer:function(n,t){var e=this._gridClusters,i=this._gridUnclustered,s=Math.floor(this._map.getMinZoom()),o,r;for(this.options.singleMarkerMode&&this._overrideMarkerIcon(n),n.on(this._childMarkerEventHandlers,this);t>=s;t--){o=this._map.project(n.getLatLng(),t);let a=e[t].getNearObject(o);if(a){a._addChild(n),n.__parent=a;return}if(a=i[t].getNearObject(o),a){const l=a.__parent;l&&this._removeLayer(a,!1);const h=new this._markerCluster(this,t,a,n);e[t].addObject(h,this._map.project(h._cLatLng,t)),a.__parent=h,n.__parent=h;let d=h;for(r=t-1;r>l._zoom;r--)d=new this._markerCluster(this,r,d),e[r].addObject(d,this._map.project(a.getLatLng(),r));l._addChild(d),this._removeFromGridUnclustered(a,t);return}i[t].addObject(n,o)}this._topClusterLevel._addChild(n),n.__parent=this._topClusterLevel},_refreshClustersIcons:function(){this._featureGroup.eachLayer(n=>{n instanceof _.MarkerCluster&&n._iconNeedsUpdate&&n._updateIcon()})},_enqueue:function(n){this._queue.push(n),this._queueTimeout||(this._queueTimeout=setTimeout(()=>this._processQueue(),300))},_processQueue:function(){for(let n=0;n<this._queue.length;n++)this._queue[n].call(this);this._queue.length=0,clearTimeout(this._queueTimeout),this._queueTimeout=null},_mergeSplitClusters:function(){var n=Math.round(this._map._zoom);this._processQueue(),this._zoom<n&&this._currentShownBounds.intersects(this._getExpandedVisibleBounds())?(this._animationStart(),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,this._getExpandedVisibleBounds()),this._animationZoomIn(this._zoom,n)):this._zoom>n?(this._animationStart(),this._animationZoomOut(this._zoom,n)):this._moveEnd()},_getExpandedVisibleBounds:function(){if(this.options.removeOutsideVisibleBounds){if(_.Browser.mobile)return this._checkBoundsMaxLat(this._map.getBounds())}else return this._mapBoundsInfinite;return this._checkBoundsMaxLat(this._map.getBounds().pad(1))},_checkBoundsMaxLat:function(n){var t=this._maxLat;return t!==void 0&&(n.getNorth()>=t&&(n._northEast.lat=1/0),n.getSouth()<=-t&&(n._southWest.lat=-1/0)),n},_animationAddLayerNonAnimated:function(n,t){if(t===n)this._featureGroup.addLayer(n);else if(t._childCount===2){t._addToMap();const e=t.getAllChildMarkers();this._featureGroup.removeLayer(e[0]),this._featureGroup.removeLayer(e[1])}else t._updateIcon()},_extractNonGroupLayers:function(n,t){var e=n.getLayers(),i=0,s;for(t=t||[];i<e.length;i++){if(s=e[i],s instanceof _.LayerGroup){this._extractNonGroupLayers(s,t);continue}t.push(s)}return t},_overrideMarkerIcon:function(n){return n.options.icon=this.options.iconCreateFunction({getChildCount:()=>1,getAllChildMarkers:()=>[n]}),n.options.icon}}),_.MarkerClusterGroup.include({_mapBoundsInfinite:new _.LatLngBounds(new _.LatLng(-1/0,-1/0),new _.LatLng(1/0,1/0))}),_.MarkerClusterGroup.include({_noAnimation:{_animationStart:()=>{},_animationZoomIn:function(n,t){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),n),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationZoomOut:function(n,t){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),n),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationAddLayer:function(n,t){this._animationAddLayerNonAnimated(n,t)}},_withAnimation:{_animationStart:function(){this._map._mapPane.className+=" leaflet-cluster-anim",this._inZoomAnimation++},_animationZoomIn:function(n,t){var e=this._getExpandedVisibleBounds(),i=this._featureGroup,s=Math.floor(this._map.getMinZoom()),o;this._ignoreMove=!0,this._topClusterLevel._recursively(e,n,s,r=>{var a=r._latlng,l=r._markers,h;for(e.contains(a)||(a=null),r._isSingleParent()&&n+1===t?(i.removeLayer(r),r._recursivelyAddChildrenToMap(null,t,e)):(r.clusterHide(),r._recursivelyAddChildrenToMap(a,t,e)),o=l.length-1;o>=0;o--)h=l[o],e.contains(h._latlng)||i.removeLayer(h)}),this._forceLayout(),this._topClusterLevel._recursivelyBecomeVisible(e,t),i.eachLayer(r=>{!(r instanceof _.MarkerCluster)&&r._icon&&r.clusterShow()}),this._topClusterLevel._recursively(e,n,t,r=>{r._recursivelyRestoreChildPositions(t)}),this._ignoreMove=!1,this._enqueue(function(){this._topClusterLevel._recursively(e,n,s,r=>{i.removeLayer(r),r.clusterShow()}),this._animationEnd()})},_animationZoomOut:function(n,t){this._animationZoomOutSingle(this._topClusterLevel,n-1,t),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),n,this._getExpandedVisibleBounds())},_animationAddLayer:function(n,t){var e=this._featureGroup;e.addLayer(n),t!==n&&(t._childCount>2?(t._updateIcon(),this._forceLayout(),this._animationStart(),n._setPos(this._map.latLngToLayerPoint(t.getLatLng())),n.clusterHide(),this._enqueue(()=>{e.removeLayer(n),n.clusterShow(),this._animationEnd()})):(this._forceLayout(),this._animationStart(),this._animationZoomOutSingle(t,this._map.getMaxZoom(),this._zoom)))}},_animationZoomOutSingle:function(n,t,e){var i=this._getExpandedVisibleBounds(),s=Math.floor(this._map.getMinZoom());n._recursivelyAnimateChildrenInAndAddSelfToMap(i,s,t+1,e);var o=this;this._forceLayout(),n._recursivelyBecomeVisible(i,e),this._enqueue(function(){if(n._childCount===1){const r=n._markers[0];this._ignoreMove=!0,r.setLatLng(r.getLatLng()),this._ignoreMove=!1,r.clusterShow&&r.clusterShow()}else n._recursively(i,e,s,r=>{r._recursivelyRemoveChildrenFromMap(i,s,t+1)});o._animationEnd()})},_animationEnd:function(){this._map&&(this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim","")),this._inZoomAnimation--,this.fire("animationend")},_forceLayout:()=>{_.Util.falseFn(document.body.offsetWidth)}}),_.MarkerCluster=_.Marker.extend({initialize:function(n,t,e,i){_.Marker.prototype.initialize.call(this,e?e._cLatLng||e.getLatLng():new _.LatLng(0,0),{icon:this,pane:n.options.clusterPane}),this._group=n,this._zoom=t,this._markers=[],this._childClusters=[],this._childCount=0,this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._bounds=new _.LatLngBounds,e&&this._addChild(e),i&&this._addChild(i)},getAllChildMarkers:function(n){n=n||[];for(let t=this._childClusters.length-1;t>=0;t--)this._childClusters[t].getAllChildMarkers(n);for(let t=this._markers.length-1;t>=0;t--)n.push(this._markers[t]);return n},getChildCount:function(){return this._childCount},zoomToBounds:function(n){for(var t=this._childClusters.slice(),e=this._group._map,i=e.getBoundsZoom(this._bounds),s=this._zoom+1,o=e.getZoom(),r;t.length>0&&i>s;){s++;let a=[];for(r=0;r<t.length;r++)a=a.concat(t[r]._childClusters);t=a}i>s?this._group._map.setView(this._latlng,s):i<=o?this._group._map.setView(this._latlng,o+1):this._group._map.fitBounds(this._bounds,n)},getBounds:function(){var n=new _.LatLngBounds;return n.extend(this._bounds),n},_updateIcon:function(){this._iconNeedsUpdate=!0,this._icon&&this.setIcon(this)},createIcon:function(){return this._iconNeedsUpdate&&(this._iconObj=this._group.options.iconCreateFunction(this),this._iconNeedsUpdate=!1),this._iconObj.createIcon()},createShadow:function(){return this._iconObj.createShadow()},_addChild:function(n,t){this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._setClusterCenter(n),n instanceof _.MarkerCluster?(t||(this._childClusters.push(n),n.__parent=this),this._childCount+=n._childCount):(t||this._markers.push(n),this._childCount++),this.__parent&&this.__parent._addChild(n,!0)},_setClusterCenter:function(n){this._cLatLng||(this._cLatLng=n._cLatLng||n._latlng)},_resetBounds:function(){var n=this._bounds;n._southWest&&(n._southWest.lat=1/0,n._southWest.lng=1/0),n._northEast&&(n._northEast.lat=-1/0,n._northEast.lng=-1/0)},_recalculateBounds:function(){var n=this._markers,t=this._childClusters,e=0,i=0,s=this._childCount,o,r,a,l;if(s!==0){for(this._resetBounds(),o=0;o<n.length;o++)a=n[o]._latlng,this._bounds.extend(a),e+=a.lat,i+=a.lng;for(o=0;o<t.length;o++)r=t[o],r._boundsNeedUpdate&&r._recalculateBounds(),this._bounds.extend(r._bounds),a=r._wLatLng,l=r._childCount,e+=a.lat*l,i+=a.lng*l;this._latlng=this._wLatLng=new _.LatLng(e/s,i/s),this._boundsNeedUpdate=!1}},_addToMap:function(n){n&&(this._backupLatlng=this._latlng,this.setLatLng(n)),this._group._featureGroup.addLayer(this)},_recursivelyAnimateChildrenIn:function(n,t,e){this._recursively(n,this._group._map.getMinZoom(),e-1,i=>{var s=i._markers,o,r;for(o=s.length-1;o>=0;o--)r=s[o],r._icon&&(r._setPos(t),r.clusterHide())},i=>{var s=i._childClusters,o,r;for(o=s.length-1;o>=0;o--)r=s[o],r._icon&&(r._setPos(t),r.clusterHide())})},_recursivelyAnimateChildrenInAndAddSelfToMap:function(n,t,e,i){this._recursively(n,i,t,s=>{s._recursivelyAnimateChildrenIn(n,s._group._map.latLngToLayerPoint(s.getLatLng()).round(),e),s._isSingleParent()&&e-1===i?(s.clusterShow(),s._recursivelyRemoveChildrenFromMap(n,t,e)):s.clusterHide(),s._addToMap()})},_recursivelyBecomeVisible:function(n,t){this._recursively(n,this._group._map.getMinZoom(),t,null,e=>{e.clusterShow()})},_recursivelyAddChildrenToMap:function(n,t,e){this._recursively(e,this._group._map.getMinZoom()-1,t,i=>{if(t!==i._zoom)for(let s=i._markers.length-1;s>=0;s--){const o=i._markers[s];e.contains(o._latlng)&&(n&&(o._backupLatlng=o.getLatLng(),o.setLatLng(n),o.clusterHide&&o.clusterHide()),i._group._featureGroup.addLayer(o))}},i=>{i._addToMap(n)})},_recursivelyRestoreChildPositions:function(n){for(let t=this._markers.length-1;t>=0;t--){const e=this._markers[t];e._backupLatlng&&(e.setLatLng(e._backupLatlng),delete e._backupLatlng)}if(n-1===this._zoom)for(let t=this._childClusters.length-1;t>=0;t--)this._childClusters[t]._restorePosition();else for(let t=this._childClusters.length-1;t>=0;t--)this._childClusters[t]._recursivelyRestoreChildPositions(n)},_restorePosition:function(){this._backupLatlng&&(this.setLatLng(this._backupLatlng),delete this._backupLatlng)},_recursivelyRemoveChildrenFromMap:function(n,t,e,i){var s,o;this._recursively(n,t-1,e-1,r=>{for(o=r._markers.length-1;o>=0;o--)s=r._markers[o],(!i||!i.contains(s._latlng))&&(r._group._featureGroup.removeLayer(s),s.clusterShow&&s.clusterShow())},r=>{for(o=r._childClusters.length-1;o>=0;o--)s=r._childClusters[o],(!i||!i.contains(s._latlng))&&(r._group._featureGroup.removeLayer(s),s.clusterShow&&s.clusterShow())})},_recursively:function(n,t,e,i,s){var o=this._childClusters,r=this._zoom,a,l;if(t<=r&&(i&&i(this),s&&r===e&&s(this)),r<t||r<e)for(a=o.length-1;a>=0;a--)l=o[a],n.intersects(l._bounds)&&l._recursively(n,t,e,i,s)},_isSingleParent:function(){return this._childClusters.length>0&&this._childClusters[0]._childCount===this._childCount}}),_.Marker.include({clusterHide:function(){return this.options.opacityWhenUnclustered=this.options.opacity||1,this.setOpacity(0)},clusterShow:function(){var n=this.setOpacity(this.options.opacity||this.options.opacityWhenUnclustered);return delete this.options.opacityWhenUnclustered,n}}),_.DistanceGrid=function(n){this._cellSize=n,this._sqCellSize=n*n,this._grid={},this._objectPoint={}},_.DistanceGrid.prototype={addObject:function(n,t){var e=this._getCoord(t.x),i=this._getCoord(t.y),s=this._grid;s[i]=s[i]||{};var o=s[i];o[e]=o[e]||[];var r=o[e],a=_.Util.stamp(n);this._objectPoint[a]=t,r.push(n)},updateObject:function(n,t){this.removeObject(n),this.addObject(n,t)},removeObject:function(n,t){var e=this._getCoord(t.x),i=this._getCoord(t.y),s=this._grid;s[i]=s[i]||{};var o=s[i];o[e]=o[e]||[];var r=o[e],a,l;for(delete this._objectPoint[_.Util.stamp(n)],a=0,l=r.length;a<l;a++)if(r[a]===n)return r.splice(a,1),l===1&&delete o[e],!0},eachObject:function(n,t){var e,i,s,o,r,a,l,h=this._grid;for(e in h){r=h[e];for(i in r)for(a=r[i],s=0,o=a.length;s<o;s++)l=n.call(t,a[s]),l&&(s--,o--)}},getNearObject:function(n){var t=this._getCoord(n.x),e=this._getCoord(n.y),i,s,o,r,a,l,h,d,c=this._objectPoint,u=this._sqCellSize,p=null;for(i=e-1;i<=e+1;i++)if(r=this._grid[i],r){for(s=t-1;s<=t+1;s++)if(a=r[s],a)for(o=0,l=a.length;o<l;o++)h=a[o],d=this._sqDist(c[_.Util.stamp(h)],n),d<u&&(u=d,p=h)}return p},_getCoord:function(n){return Math.floor(n/this._cellSize)},_sqDist:(n,t)=>{var e=t.x-n.x,i=t.y-n.y;return e*e+i*i}},_.QuickHull={getDistant:(n,t)=>{var e=t[1].lat-t[0].lat,i=t[0].lng-t[1].lng;return i*(n.lat-t[0].lat)+e*(n.lng-t[0].lng)},findMostDistantPointFromBaseLine:function(n,t){var e=0,i=null,s=[],o,r,a;for(o=t.length-1;o>=0;o--){if(r=t[o],a=this.getDistant(r,n),a>0)s.push(r);else continue;a>e&&(e=a,i=r)}return{maxPoint:i,newPoints:s}},buildConvexHull:function(n,t){var e=[],i=this.findMostDistantPointFromBaseLine(n,t);return i.maxPoint?(e=e.concat(this.buildConvexHull([n[0],i.maxPoint],i.newPoints)),e=e.concat(this.buildConvexHull([i.maxPoint,n[1]],i.newPoints)),e):[n[0]]},getConvexHull:function(n){var t=!1,e=!1,i=!1,s=!1,o=null,r=null,a=null,l=null,h=null,d=null,c;for(c=n.length-1;c>=0;c--){const p=n[c];(t===!1||p.lat>t)&&(o=p,t=p.lat),(e===!1||p.lat<e)&&(r=p,e=p.lat),(i===!1||p.lng>i)&&(a=p,i=p.lng),(s===!1||p.lng<s)&&(l=p,s=p.lng)}e!==t?(d=r,h=o):(d=l,h=a);var u=[].concat(this.buildConvexHull([d,h],n),this.buildConvexHull([h,d],n));return u}},_.MarkerCluster.include({getConvexHull:function(){var n=this.getAllChildMarkers(),t=[],e,i;for(i=n.length-1;i>=0;i--)e=n[i].getLatLng(),t.push(e);return _.QuickHull.getConvexHull(t)}}),_.MarkerCluster.include({_2PI:Math.PI*2,_circleFootSeparation:25,_circleStartAngle:Math.PI/6,_spiralFootSeparation:28,_spiralLengthStart:11,_spiralLengthFactor:5,_circleSpiralSwitchover:9,spiderfy:function(){if(!(this._group._spiderfied===this||this._group._inZoomAnimation)){var n=this.getAllChildMarkers(),t=this._group,e=t._map,i=e.latLngToLayerPoint(this._latlng),s;this._group._unspiderfy(),this._group._spiderfied=this,n.length>=this._circleSpiralSwitchover?s=this._generatePointsSpiral(n.length,i):(i.y+=10,s=this._generatePointsCircle(n.length,i)),this._animationSpiderfy(n,s)}},unspiderfy:function(n){this._group._inZoomAnimation||(this._animationUnspiderfy(n),this._group._spiderfied=null)},_generatePointsCircle:function(n,t){var e=this._group.options.spiderfyDistanceMultiplier*this._circleFootSeparation*(2+n),i=e/this._2PI,s=this._2PI/n,o=[],r,a;for(o.length=n,r=n-1;r>=0;r--)a=this._circleStartAngle+r*s,o[r]=new _.Point(t.x+i*Math.cos(a),t.y+i*Math.sin(a))._round();return o},_generatePointsSpiral:function(n,t){var e=this._group.options.spiderfyDistanceMultiplier,i=e*this._spiralLengthStart,s=e*this._spiralFootSeparation,o=e*this._spiralLengthFactor*this._2PI,r=0,a=[],l;for(a.length=n,l=n-1;l>=0;l--)r+=s/i+l*5e-4,a[l]=new _.Point(t.x+i*Math.cos(r),t.y+i*Math.sin(r))._round(),i+=o/r;return a},_noanimationUnspiderfy:function(){var n=this._group,t=n._map,e=n._featureGroup,i=this.getAllChildMarkers(),s,o;for(n._ignoreMove=!0,this.setOpacity(1),o=i.length-1;o>=0;o--)s=i[o],e.removeLayer(s),s._preSpiderfyLatlng&&(s.setLatLng(s._preSpiderfyLatlng),delete s._preSpiderfyLatlng),s.setZIndexOffset&&s.setZIndexOffset(0),s._spiderLeg&&(t.removeLayer(s._spiderLeg),delete s._spiderLeg);n.fire("unspiderfied",{cluster:this,markers:i}),n._ignoreMove=!1,n._spiderfied=null}}),_.MarkerClusterNonAnimated=_.MarkerCluster.extend({_animationSpiderfy:function(n,t){var e=this._group,i=e._map,s=e._featureGroup,o=this._group.options.spiderLegPolylineOptions,r,a,l,h;for(e._ignoreMove=!0,r=0;r<n.length;r++)h=i.layerPointToLatLng(t[r]),a=n[r],l=new _.Polyline([this._latlng,h],o),i.addLayer(l),a._spiderLeg=l,a._preSpiderfyLatlng=a._latlng,a.setLatLng(h),a.setZIndexOffset&&a.setZIndexOffset(1e6),s.addLayer(a);this.setOpacity(.3),e._ignoreMove=!1,e.fire("spiderfied",{cluster:this,markers:n})},_animationUnspiderfy:function(){this._noanimationUnspiderfy()}}),_.MarkerCluster.include({_animationSpiderfy:function(n,t){var e=this._group,i=e._map,s=e._featureGroup,o=this._latlng,r=i.latLngToLayerPoint(o),a=_.Path.SVG,l=Object.assign({},this._group.options.spiderLegPolylineOptions),h=l.opacity,d,c,u,p,y,g;for(h===void 0&&(h=_.MarkerClusterGroup.prototype.options.spiderLegPolylineOptions.opacity),a?(l.opacity=0,l.className=`${l.className||""} leaflet-cluster-spider-leg`):l.opacity=h,e._ignoreMove=!0,d=0;d<n.length;d++)c=n[d],g=i.layerPointToLatLng(t[d]),u=new _.Polyline([o,g],l),i.addLayer(u),c._spiderLeg=u,a&&(p=u._path,y=p.getTotalLength()+.1,p.style.strokeDasharray=y,p.style.strokeDashoffset=y),c.setZIndexOffset&&c.setZIndexOffset(1e6),c.clusterHide&&c.clusterHide(),s.addLayer(c),c._setPos&&c._setPos(r);for(e._forceLayout(),e._animationStart(),d=n.length-1;d>=0;d--)g=i.layerPointToLatLng(t[d]),c=n[d],c._preSpiderfyLatlng=c._latlng,c.setLatLng(g),c.clusterShow&&c.clusterShow(),a&&(u=c._spiderLeg,p=u._path,p.style.strokeDashoffset=0,u.setStyle({opacity:h}));this.setOpacity(.3),e._ignoreMove=!1,setTimeout(()=>{e._animationEnd(),e.fire("spiderfied",{cluster:this,markers:n})},200)},_animationUnspiderfy:function(n){var t=this._group,e=t._map,i=t._featureGroup,s=n?e._latLngToNewLayerPoint(this._latlng,n.zoom,n.center):e.latLngToLayerPoint(this._latlng),o=this.getAllChildMarkers(),r=_.Path.SVG,a,l,h,d,c,u;for(t._ignoreMove=!0,t._animationStart(),this.setOpacity(1),l=o.length-1;l>=0;l--)a=o[l],a._preSpiderfyLatlng&&(a.closePopup(),a.setLatLng(a._preSpiderfyLatlng),delete a._preSpiderfyLatlng,u=!0,a._setPos&&(a._setPos(s),u=!1),a.clusterHide&&(a.clusterHide(),u=!1),u&&i.removeLayer(a),r&&(h=a._spiderLeg,d=h._path,c=d.getTotalLength()+.1,d.style.strokeDashoffset=c,h.setStyle({opacity:0})));t._ignoreMove=!1,setTimeout(()=>{var p=0;for(l=o.length-1;l>=0;l--)a=o[l],a._spiderLeg&&p++;for(l=o.length-1;l>=0;l--)a=o[l],a._spiderLeg&&(a.clusterShow&&a.clusterShow(),a.setZIndexOffset&&a.setZIndexOffset(0),p>1&&i.removeLayer(a),e.removeLayer(a._spiderLeg),delete a._spiderLeg);t._animationEnd(),t.fire("unspiderfied",{cluster:this,markers:o})},200)}}),_.MarkerClusterGroup.include({_spiderfied:null,unspiderfy:function(...n){this._unspiderfy.apply(this,n)},_spiderfierOnAdd:function(){this._map.on("click",this._unspiderfyWrapper,this),this._map.options.zoomAnimation&&this._map.on("zoomstart",this._unspiderfyZoomStart,this),this._map.on("zoomend",this._noanimationUnspiderfy,this),_.Browser.touch||this._map.getRenderer(this)},_spiderfierOnRemove:function(){this._map.off("click",this._unspiderfyWrapper,this),this._map.off("zoomstart",this._unspiderfyZoomStart,this),this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._map.off("zoomend",this._noanimationUnspiderfy,this),this._noanimationUnspiderfy()},_unspiderfyZoomStart:function(){this._map&&this._map.on("zoomanim",this._unspiderfyZoomAnim,this)},_unspiderfyZoomAnim:function(n){this._map._mapPane.classList.contains("leaflet-touching")||(this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._unspiderfy(n))},_unspiderfyWrapper:function(){this._unspiderfy()},_unspiderfy:function(n){this._spiderfied&&this._spiderfied.unspiderfy(n)},_noanimationUnspiderfy:function(){this._spiderfied&&this._spiderfied._noanimationUnspiderfy()},_unspiderfyLayer:function(n){n._spiderLeg&&(this._featureGroup.removeLayer(n),n.clusterShow&&n.clusterShow(),n.setZIndexOffset&&n.setZIndexOffset(0),this._map.removeLayer(n._spiderLeg),delete n._spiderLeg)}}),_.MarkerClusterGroup.include({refreshClusters:function(n){return n?n instanceof _.MarkerClusterGroup?n=n._topClusterLevel.getAllChildMarkers():n instanceof _.LayerGroup?n=n._layers:n instanceof _.MarkerCluster?n=n.getAllChildMarkers():n instanceof _.Marker&&(n=[n]):n=this._topClusterLevel.getAllChildMarkers(),this._flagParentsIconsNeedUpdate(n),this._refreshClustersIcons(),this.options.singleMarkerMode&&this._refreshSingleMarkerModeMarkers(n),this},_flagParentsIconsNeedUpdate:n=>{var t,e;for(t in n)for(e=n[t].__parent;e;)e._iconNeedsUpdate=!0,e=e.__parent},_refreshSingleMarkerModeMarkers:function(n){var t,e;for(t in n)e=n[t],this.hasLayer(e)&&e.setIcon(this._overrideMarkerIcon(e))}}),_.Marker.include({refreshIconOptions:function(n,t){var e=this.options.icon;return _.setOptions(e,n),this.setIcon(e),t&&this.__parent&&this.__parent._group.refreshClusters(this),this}});const Ve=()=>typeof window<"u"&&typeof document<"u";function Yn(n,t){let e;return function(...i){clearTimeout(e),e=setTimeout(()=>n.apply(this,i),t)}}const A=(n,t,e)=>e===void 0?n.getAttribute(t)??null:(e===null?n.removeAttribute(t):n.getAttribute(t)!==e&&n.setAttribute(t,e),null),en=(n,...t)=>{const[e,...i]=t;for(const s of e.split(" "))n.addEventListener(s,...i);return()=>Ke(n,...t)},Ke=(n,...t)=>{const[e,...i]=t;for(const s of e.split(" "))n.removeEventListener(s,...i)},ce=(n,t,e)=>{const i=document.createElement(n);if(e&&(i.textContent=e),t)for(const[s,o]of Object.entries(t))A(i,s,o);return i},ue=typeof HTMLElement>"u"?class{}:HTMLElement,pe=(n,t)=>!Ve()||window.customElements.get(n)||window.customElements.define(n,t),Xn=`/**
|
|
604
604
|
* NOTE:
|
|
605
605
|
* - Dark mode styles are in styles.module.css to leverage data-color-scheme attribute
|
|
606
606
|
* - This file is using --mtds- not --mtds- since we're inside shadow dom
|
package/mtds/deprecations.js
CHANGED
|
@@ -1,32 +1,39 @@
|
|
|
1
|
-
import { DSFieldElement as
|
|
2
|
-
import
|
|
3
|
-
import { getByCSSModule as n, isBrowser as i, onHotReload as
|
|
1
|
+
import { DSFieldElement as p } from "@digdir/designsystemet-web";
|
|
2
|
+
import l from "./styles.module.css.js";
|
|
3
|
+
import { getByCSSModule as n, isBrowser as i, onHotReload as g, on as b, onMutation as y, QUICK_EVENT as S, debounce as E, attr as s } from "./utils.js";
|
|
4
4
|
const f = /* @__PURE__ */ new WeakSet(), a = (t) => !f.has(t) && f.add(t), o = (t, e, r) => window.dsWarnings === !1 || console.warn(
|
|
5
5
|
`\x1B[1m@mattilsynet/design:\x1B[m ${t} is deprecated, please use ${e}:`,
|
|
6
6
|
r
|
|
7
|
-
),
|
|
8
|
-
for (const t of
|
|
7
|
+
), D = n("togglegroup"), u = l.button.split(" "), A = () => {
|
|
8
|
+
for (const t of D) {
|
|
9
9
|
a(t) && !t.hasAttribute("data-toggle-group") && (s(t, "data-toggle-group", "Valgknapper"), o(
|
|
10
10
|
'Only setting class="styles.togglegroup"',
|
|
11
11
|
'data-toggle-group="LABEL-HERE" attribute also for better accessibility',
|
|
12
12
|
t
|
|
13
13
|
));
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
for (const e of t.getElementsByTagName("label"))
|
|
15
|
+
a(e) && !e.classList.contains(u[0]) && (e.classList.add(...u), o(
|
|
16
|
+
'Only setting class="styles.button"',
|
|
17
|
+
'<label class="styles.button">',
|
|
18
|
+
e
|
|
19
|
+
));
|
|
20
|
+
}
|
|
21
|
+
}, L = n("breadcrumbs"), O = () => {
|
|
22
|
+
for (const t of L)
|
|
23
|
+
a(t) && t.nodeName !== "DS-BREADCRUMBS" && (t.classList.add(...l.breadcrumbs.split(" ")), o(
|
|
17
24
|
'Only setting class="styles.breadcrumbs"',
|
|
18
25
|
'<ds-breadcrumbs class="styles.breadcrumbs">',
|
|
19
26
|
t
|
|
20
27
|
));
|
|
21
|
-
},
|
|
22
|
-
for (const t of
|
|
28
|
+
}, C = n("errorsummary"), N = () => {
|
|
29
|
+
for (const t of C)
|
|
23
30
|
a(t) && t.nodeName !== "DS-ERROR-SUMMARY" && o(
|
|
24
31
|
'Only setting class="styles.errorsummary"',
|
|
25
32
|
'<ds-error-summary class="styles.errorsummary">',
|
|
26
33
|
t
|
|
27
34
|
);
|
|
28
|
-
},
|
|
29
|
-
for (const t of
|
|
35
|
+
}, R = n("dialog"), w = () => {
|
|
36
|
+
for (const t of R)
|
|
30
37
|
if (a(t) && (t.hasAttribute("data-variant") && o(
|
|
31
38
|
'<dialog data-variant="drawer">',
|
|
32
39
|
'<dialog data-placement="center|left|right|top|bottom">',
|
|
@@ -43,17 +50,17 @@ const f = /* @__PURE__ */ new WeakSet(), a = (t) => !f.has(t) && f.add(t), o = (
|
|
|
43
50
|
t
|
|
44
51
|
), s(t, "open", null), t.showModal()) : t.matches(":modal:not([open])") && (s(t, "open", ""), t.close());
|
|
45
52
|
}
|
|
46
|
-
},
|
|
53
|
+
}, B = () => {
|
|
47
54
|
for (const t of document.querySelectorAll("[data-count]"))
|
|
48
55
|
if (a(t)) {
|
|
49
56
|
const e = s(t, "data-count");
|
|
50
|
-
t.classList.add(...
|
|
57
|
+
t.classList.add(...l.validation.split(" ")), s(t, "data-limit", e), o(
|
|
51
58
|
`data-count="${e}"`,
|
|
52
59
|
`class="styles.validation" data-field="counter" data-limit="${e}"`,
|
|
53
60
|
t
|
|
54
61
|
);
|
|
55
62
|
}
|
|
56
|
-
},
|
|
63
|
+
}, T = () => {
|
|
57
64
|
for (const t of document.querySelectorAll("[data-command]"))
|
|
58
65
|
if (a(t)) {
|
|
59
66
|
const e = s(t, "data-command");
|
|
@@ -67,42 +74,42 @@ const f = /* @__PURE__ */ new WeakSet(), a = (t) => !f.has(t) && f.add(t), o = (
|
|
|
67
74
|
t
|
|
68
75
|
);
|
|
69
76
|
}
|
|
70
|
-
},
|
|
71
|
-
for (const t of
|
|
72
|
-
},
|
|
73
|
-
for (const t of T)
|
|
74
|
-
a(t) && (t.classList.add(...l), o("<u-combobox>", '<ds-suggestion class="styles.suggestion">', t));
|
|
77
|
+
}, h = i() ? document.getElementsByTagName("u-tabs") : [], I = () => {
|
|
78
|
+
for (const t of h) a(t) && o("u-tabs", "ds-tabs", t);
|
|
79
|
+
}, d = l.suggestion.split(" "), v = i() ? document.getElementsByTagName("u-combobox") : [], $ = i() ? document.getElementsByTagName("ds-suggestion") : [], M = () => {
|
|
75
80
|
for (const t of v)
|
|
76
|
-
a(t) &&
|
|
81
|
+
a(t) && (t.classList.add(...d), o("<u-combobox>", '<ds-suggestion class="styles.suggestion">', t));
|
|
82
|
+
for (const t of $)
|
|
83
|
+
a(t) && !t.classList.contains(d[0]) && (t.classList.add(...d), o(
|
|
77
84
|
"Only using <ds-suggestion>",
|
|
78
85
|
'<ds-suggestion class="styles.suggestion">',
|
|
79
86
|
t
|
|
80
87
|
));
|
|
81
|
-
},
|
|
88
|
+
}, U = ({ target: t }) => {
|
|
82
89
|
if (!(t instanceof Element)) return;
|
|
83
90
|
const e = t?.closest("tr")?.querySelector('[data-command="row"]');
|
|
84
91
|
e && !t?.closest('a,button,label,input,select,textarea,[role="button"]') && e.click();
|
|
85
92
|
const m = t?.closest("dialog");
|
|
86
93
|
m && t?.closest('[data-command="close"]') && m.close();
|
|
87
|
-
}, k = n("field"), c = /* @__PURE__ */ new Set(),
|
|
94
|
+
}, k = n("field"), c = /* @__PURE__ */ new Set(), F = () => {
|
|
88
95
|
for (const t of k)
|
|
89
96
|
t.nodeName !== "DS-FIELD" && (a(t) || o(
|
|
90
97
|
'Only setting class="styles.field"',
|
|
91
98
|
'<ds-field class="styles.field">',
|
|
92
99
|
t
|
|
93
|
-
), !c.has(t) && c.add(t) &&
|
|
94
|
-
},
|
|
100
|
+
), !c.has(t) && c.add(t) && p.prototype.connectedCallback.call(t));
|
|
101
|
+
}, G = () => {
|
|
95
102
|
for (const t of c)
|
|
96
|
-
|
|
97
|
-
},
|
|
98
|
-
for (const t of document.querySelectorAll(
|
|
103
|
+
p.prototype.disconnectedCallback.call(t), c.delete(t);
|
|
104
|
+
}, x = `[data-description], .${l.field.split(" ")[0]} label + p`, q = () => {
|
|
105
|
+
for (const t of document.querySelectorAll(x))
|
|
99
106
|
a(t) && t.getAttribute("data-field") !== "description" && (s(t, "data-field", "description"), o(
|
|
100
107
|
"Descriptions created by data-description of <p> only",
|
|
101
108
|
'data-field="data-description"',
|
|
102
109
|
t
|
|
103
110
|
));
|
|
104
|
-
},
|
|
105
|
-
for (const t of
|
|
111
|
+
}, P = n("validation"), _ = () => {
|
|
112
|
+
for (const t of P)
|
|
106
113
|
a(t) && !t.hasAttribute("data-field") && (s(t, "data-field", "validation"), o(
|
|
107
114
|
'Only setting class="styles.validation"',
|
|
108
115
|
'class="styles.validation" data-field="validation"',
|
|
@@ -111,14 +118,14 @@ const f = /* @__PURE__ */ new WeakSet(), a = (t) => !f.has(t) && f.add(t), o = (
|
|
|
111
118
|
}, V = () => {
|
|
112
119
|
for (const t of document.querySelectorAll("[popover][data-position]"))
|
|
113
120
|
a(t) && (s(t, "data-placement", s(t, "data-position")), o("data-position", "data-placement", t));
|
|
114
|
-
},
|
|
115
|
-
|
|
121
|
+
}, W = E(() => {
|
|
122
|
+
B(), T(), O(), w(), N(), q(), _(), V(), F(), A(), M(), I();
|
|
116
123
|
}, 200);
|
|
117
|
-
|
|
118
|
-
|
|
124
|
+
g("deprecations", () => [
|
|
125
|
+
G,
|
|
119
126
|
// Return as cleanup function
|
|
120
|
-
|
|
121
|
-
|
|
127
|
+
b(document, "click", U, S),
|
|
128
|
+
y(document, W, {
|
|
122
129
|
attributeFilter: [
|
|
123
130
|
"class",
|
|
124
131
|
"data-command",
|
package/mtds/deprecations.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deprecations.js","sources":["../designsystem/deprecations.ts"],"sourcesContent":["import { DSFieldElement } from \"@digdir/designsystemet-web\";\nimport styles from \"./styles.module.css\";\nimport {\n\tattr,\n\tdebounce,\n\tgetByCSSModule,\n\tisBrowser,\n\ton,\n\tonHotReload,\n\tonMutation,\n\tQUICK_EVENT,\n} from \"./utils\";\n\nconst DEPRECATIONS = new WeakSet<Element>();\nconst deprecate = (el: Element) =>\n\t!DEPRECATIONS.has(el) && DEPRECATIONS.add(el);\n\nconst warn = (from: string, to: string, el: Element) =>\n\twindow.dsWarnings === false ||\n\tconsole.warn(\n\t\t`\\x1B[1m@mattilsynet/design:\\x1B[m ${from} is deprecated, please use ${to}:`,\n\t\tel,\n\t);\n\n// Deprecate togglegroup without data-toggle-group attribute\nconst TOGGLEGROUPS = getByCSSModule(\"togglegroup\");\nconst deprecateToggleGroup = () => {\n\tfor (const el of TOGGLEGROUPS)\n\t\tif (deprecate(el) && !el.hasAttribute(\"data-toggle-group\")) {\n\t\t\tattr(el, \"data-toggle-group\", \"Valgknapper\");\n\t\t\twarn(\n\t\t\t\t'Only setting class=\"styles.togglegroup\"',\n\t\t\t\t'data-toggle-group=\"LABEL-HERE\" attribute also for better accessibility',\n\t\t\t\tel,\n\t\t\t);\n\t\t}\n};\n\n// Deprecate errorsummary without ds-error-summary element\nconst BREADCRUMBS = getByCSSModule(\"breadcrumbs\");\nconst deprecateBreadcrumbs = () => {\n\tfor (const el of BREADCRUMBS)\n\t\tif (deprecate(el) && el.nodeName !== \"DS-BREADCRUMBS\") {\n\t\t\tel.classList.add(...styles.breadcrumbs.split(\" \"));\n\t\t\twarn(\n\t\t\t\t'Only setting class=\"styles.breadcrumbs\"',\n\t\t\t\t'<ds-breadcrumbs class=\"styles.breadcrumbs\">',\n\t\t\t\tel,\n\t\t\t);\n\t\t}\n};\n\n// Deprecate errorsummary without ds-error-summary element\nconst ERRORSUMMARYS = getByCSSModule(\"errorsummary\");\nconst deprecateErrorSummary = () => {\n\tfor (const el of ERRORSUMMARYS)\n\t\tif (deprecate(el) && el.nodeName !== \"DS-ERROR-SUMMARY\") {\n\t\t\twarn(\n\t\t\t\t'Only setting class=\"styles.errorsummary\"',\n\t\t\t\t'<ds-error-summary class=\"styles.errorsummary\">',\n\t\t\t\tel,\n\t\t\t);\n\t\t}\n};\n\n// Deprecate data-variant and data-modal and data-closedby on dialogs\nconst DIALOGS = getByCSSModule(\"dialog\") as HTMLCollectionOf<HTMLDialogElement>;\nconst deprecateDialog = () => {\n\tfor (const el of DIALOGS) {\n\t\tif (!deprecate(el)) continue;\n\t\tif (el.hasAttribute(\"data-variant\")) {\n\t\t\twarn(\n\t\t\t\t'<dialog data-variant=\"drawer\">',\n\t\t\t\t'<dialog data-placement=\"center|left|right|top|bottom\">',\n\t\t\t\tel,\n\t\t\t);\n\t\t}\n\t\tif (el.isConnected && el.showModal && el.close) {\n\t\t\tconst closedby = attr(el, \"data-closedby\");\n\t\t\tif (closedby) {\n\t\t\t\tattr(el, \"closedby\", closedby);\n\t\t\t\twarn(\n\t\t\t\t\t`<dialog data-closedby=\"${closedby}\">`,\n\t\t\t\t\t`<dialog closedby=\"${closedby}\">`,\n\t\t\t\t\tel,\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (el.matches('[open]:not([data-modal=\"false\"]):not(:modal)')) {\n\t\t\t\twarn(\n\t\t\t\t\t'<dialog data-modal=\"true\">',\n\t\t\t\t\t'.showModal() or <button command=\"show-modal\" commandfor=\"DIALOG-ID\"></button>',\n\t\t\t\t\tel,\n\t\t\t\t);\n\t\t\t\tattr(el, \"open\", null); // Using attribute instead of .close to avoid `close` event\n\t\t\t\tel.showModal();\n\t\t\t} else if (el.matches(\":modal:not([open])\")) {\n\t\t\t\tattr(el, \"open\", \"\"); // Set as open\n\t\t\t\tel.close(); // So we correctly can call .close, removing <dialog> from #top-layer\n\t\t\t}\n\t\t}\n\t}\n};\n\n// Deprecate data-count in favor of data-limit\nconst deprecateCounter = () => {\n\tfor (const el of document.querySelectorAll(\"[data-count]\"))\n\t\tif (deprecate(el)) {\n\t\t\tconst count = attr(el, \"data-count\");\n\t\t\tel.classList.add(...styles.validation.split(\" \"));\n\t\t\tattr(el, \"data-limit\", count);\n\t\t\twarn(\n\t\t\t\t`data-count=\"${count}\"`,\n\t\t\t\t`class=\"styles.validation\" data-field=\"counter\" data-limit=\"${count}\"`,\n\t\t\t\tel,\n\t\t\t);\n\t\t}\n};\n\n// Deprecate data-command on buttons and other elements\nconst deprecateDataCommand = () => {\n\tfor (const el of document.querySelectorAll(\"[data-command]\"))\n\t\tif (deprecate(el)) {\n\t\t\tconst command = attr(el, \"data-command\");\n\n\t\t\tif (command === \"row\")\n\t\t\t\twarn(\n\t\t\t\t\t`<${el.nodeName.toLowerCase()} data-command=\"${command}\">`,\n\t\t\t\t\t`<tr data-clickdelegatefor=\"${el.nodeName}-ID\">`,\n\t\t\t\t\tel,\n\t\t\t\t);\n\t\t\telse\n\t\t\t\twarn(\n\t\t\t\t\t`<button data-command=\"${command}\">`,\n\t\t\t\t\t`<button command=\"${command?.replace(\"toggle-app-expanded\", \"show-modal\")}\" commandfor=\"TARGET-ID\">`,\n\t\t\t\t\tel,\n\t\t\t\t);\n\t\t}\n};\n\n// Deprecate u-tabs\nconst TABS = isBrowser() ? document.getElementsByTagName(\"u-tabs\") : [];\nconst deprecateUTabs = () => {\n\tfor (const el of TABS) if (deprecate(el)) warn(\"u-tabs\", \"ds-tabs\", el);\n};\n\n// Deprecate u-combobox and add class to ds-suggestion\nconst CSS_SUGGESTION = styles.suggestion.split(\" \");\nconst OLD = isBrowser() ? document.getElementsByTagName(\"u-combobox\") : [];\nconst NEW = isBrowser() ? document.getElementsByTagName(\"ds-suggestion\") : [];\nconst deprecateUCombobox = () => {\n\tfor (const el of OLD)\n\t\tif (deprecate(el)) {\n\t\t\tel.classList.add(...CSS_SUGGESTION);\n\t\t\twarn(\"<u-combobox>\", `<ds-suggestion class=\"styles.suggestion\">`, el);\n\t\t}\n\tfor (const el of NEW)\n\t\tif (deprecate(el) && !el.classList.contains(CSS_SUGGESTION[0])) {\n\t\t\tel.classList.add(...CSS_SUGGESTION);\n\t\t\twarn(\n\t\t\t\t\"Only using <ds-suggestion>\",\n\t\t\t\t`<ds-suggestion class=\"styles.suggestion\">`,\n\t\t\t\tel,\n\t\t\t);\n\t\t}\n};\n\nconst handleCommandClick = ({ target: el }: Event) => {\n\tif (el instanceof Element === false) return;\n\tconst row = el?.closest(\"tr\")?.querySelector('[data-command=\"row\"]');\n\tconst click =\n\t\trow && !el?.closest('a,button,label,input,select,textarea,[role=\"button\"]');\n\tif (click) (row as HTMLElement).click(); // Forward click to data-command=\"row\" element\n\n\tconst dialog = el?.closest(\"dialog\");\n\tconst close = dialog && el?.closest('[data-command=\"close\"]');\n\tif (close) dialog.close();\n};\n\n// Deprecate fields without ds-field element\nconst FIELDS = getByCSSModule(\"field\");\nconst FIELD_UNBIND = new Set<Element>();\nconst deprecateField = () => {\n\tfor (const el of FIELDS)\n\t\tif (el.nodeName !== \"DS-FIELD\") {\n\t\t\tif (!deprecate(el))\n\t\t\t\twarn(\n\t\t\t\t\t'Only setting class=\"styles.field\"',\n\t\t\t\t\t'<ds-field class=\"styles.field\">',\n\t\t\t\t\tel,\n\t\t\t\t);\n\t\t\tif (!FIELD_UNBIND.has(el) && FIELD_UNBIND.add(el)) {\n\t\t\t\tDSFieldElement.prototype.connectedCallback.call(el as DSFieldElement);\n\t\t\t}\n\t\t}\n};\nconst unbindFields = () => {\n\tfor (const el of FIELD_UNBIND) {\n\t\tDSFieldElement.prototype.disconnectedCallback.call(el as DSFieldElement);\n\t\tFIELD_UNBIND.delete(el);\n\t}\n};\n\n// Deprecate validation without data-field=\"validation\"\nconst CSS_DESCRIPTIONS = `[data-description], .${styles.field.split(\" \")[0]} label + p`;\nconst deprecateFeildDescription = () => {\n\tfor (const el of document.querySelectorAll(CSS_DESCRIPTIONS))\n\t\tif (deprecate(el) && el.getAttribute(\"data-field\") !== \"description\") {\n\t\t\tattr(el, \"data-field\", \"description\");\n\t\t\twarn(\n\t\t\t\t\"Descriptions created by data-description of <p> only\",\n\t\t\t\t'data-field=\"data-description\"',\n\t\t\t\tel,\n\t\t\t);\n\t\t}\n};\n\n// Deprecate validation without data-field=\"validation\"\nconst VALIDATIONS = getByCSSModule(\"validation\");\nconst deprecateFieldValidation = () => {\n\tfor (const el of VALIDATIONS)\n\t\tif (deprecate(el) && !el.hasAttribute(\"data-field\")) {\n\t\t\tattr(el, \"data-field\", \"validation\");\n\t\t\twarn(\n\t\t\t\t'Only setting class=\"styles.validation\"',\n\t\t\t\t'class=\"styles.validation\" data-field=\"validation\"',\n\t\t\t\tel,\n\t\t\t);\n\t\t}\n};\n\nconst deprecatePopoverPosition = () => {\n\tfor (const el of document.querySelectorAll(\"[popover][data-position]\"))\n\t\tif (deprecate(el)) {\n\t\t\tattr(el, \"data-placement\", attr(el, \"data-position\"));\n\t\t\twarn(\"data-position\", \"data-placement\", el);\n\t\t}\n};\n\nconst handleDeprecations = debounce(() => {\n\tdeprecateCounter();\n\tdeprecateDataCommand();\n\tdeprecateBreadcrumbs();\n\tdeprecateDialog();\n\tdeprecateErrorSummary();\n\tdeprecateFeildDescription();\n\tdeprecateFieldValidation();\n\tdeprecatePopoverPosition();\n\tdeprecateField(); // Should run after other field deprecations to access correct data-attributes\n\tdeprecateToggleGroup();\n\tdeprecateUCombobox();\n\tdeprecateUTabs();\n}, 200);\n\nonHotReload(\"deprecations\", () => [\n\tunbindFields, // Return as cleanup function\n\ton(document, \"click\", handleCommandClick, QUICK_EVENT),\n\tonMutation(document, handleDeprecations, {\n\t\tattributeFilter: [\n\t\t\t\"class\",\n\t\t\t\"data-command\",\n\t\t\t\"data-count\",\n\t\t\t\"data-description\",\n\t\t\t\"data-variant\",\n\t\t\t\"open\",\n\t\t],\n\t\tattributes: true,\n\t\tchildList: true,\n\t\tsubtree: true,\n\t}),\n]);\n"],"names":["DEPRECATIONS","deprecate","el","warn","from","to","TOGGLEGROUPS","getByCSSModule","deprecateToggleGroup","attr","BREADCRUMBS","deprecateBreadcrumbs","styles","ERRORSUMMARYS","deprecateErrorSummary","DIALOGS","deprecateDialog","closedby","deprecateCounter","count","deprecateDataCommand","command","TABS","isBrowser","deprecateUTabs","CSS_SUGGESTION","OLD","NEW","deprecateUCombobox","handleCommandClick","row","dialog","FIELDS","FIELD_UNBIND","deprecateField","DSFieldElement","unbindFields","CSS_DESCRIPTIONS","deprecateFeildDescription","VALIDATIONS","deprecateFieldValidation","deprecatePopoverPosition","handleDeprecations","debounce","onHotReload","on","QUICK_EVENT","onMutation"],"mappings":";;;AAaA,MAAMA,wBAAmB,QAAA,GACnBC,IAAY,CAACC,MAClB,CAACF,EAAa,IAAIE,CAAE,KAAKF,EAAa,IAAIE,CAAE,GAEvCC,IAAO,CAACC,GAAcC,GAAYH,MACvC,OAAO,eAAe,MACtB,QAAQ;AAAA,EACP,qCAAqCE,CAAI,8BAA8BC,CAAE;AAAA,EACzEH;AACD,GAGKI,IAAeC,EAAe,aAAa,GAC3CC,IAAuB,MAAM;AAClC,aAAWN,KAAMI;AAChB,IAAIL,EAAUC,CAAE,KAAK,CAACA,EAAG,aAAa,mBAAmB,MACxDO,EAAKP,GAAI,qBAAqB,aAAa,GAC3CC;AAAA,MACC;AAAA,MACA;AAAA,MACAD;AAAA,IAAA;AAGJ,GAGMQ,IAAcH,EAAe,aAAa,GAC1CI,IAAuB,MAAM;AAClC,aAAWT,KAAMQ;AAChB,IAAIT,EAAUC,CAAE,KAAKA,EAAG,aAAa,qBACpCA,EAAG,UAAU,IAAI,GAAGU,EAAO,YAAY,MAAM,GAAG,CAAC,GACjDT;AAAA,MACC;AAAA,MACA;AAAA,MACAD;AAAA,IAAA;AAGJ,GAGMW,IAAgBN,EAAe,cAAc,GAC7CO,IAAwB,MAAM;AACnC,aAAWZ,KAAMW;AAChB,IAAIZ,EA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GACAT,EAAA,GACAK,EAAA,GACAF,EAAA,GACAwB,EAAA,GACAE,EAAA,GACAC,EAAA,GACAP,EAAA,GACA1B,EAAA,GACAoB,EAAA,GACAJ,EAAA;AACD,GAAG,GAAG;AAENoB,EAAY,gBAAgB,MAAM;AAAA,EACjCR;AAAA;AAAA,EACAS,EAAG,UAAU,SAAShB,GAAoBiB,CAAW;AAAA,EACrDC,EAAW,UAAUL,GAAoB;AAAA,IACxC,iBAAiB;AAAA,MAChB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,IAED,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,SAAS;AAAA,EAAA,CACT;AACF,CAAC;"}
|
|
1
|
+
{"version":3,"file":"deprecations.js","sources":["../designsystem/deprecations.ts"],"sourcesContent":["import { DSFieldElement } from \"@digdir/designsystemet-web\";\nimport styles from \"./styles.module.css\";\nimport {\n\tattr,\n\tdebounce,\n\tgetByCSSModule,\n\tisBrowser,\n\ton,\n\tonHotReload,\n\tonMutation,\n\tQUICK_EVENT,\n} from \"./utils\";\n\nconst DEPRECATIONS = new WeakSet<Element>();\nconst deprecate = (el: Element) =>\n\t!DEPRECATIONS.has(el) && DEPRECATIONS.add(el);\n\nconst warn = (from: string, to: string, el: Element) =>\n\twindow.dsWarnings === false ||\n\tconsole.warn(\n\t\t`\\x1B[1m@mattilsynet/design:\\x1B[m ${from} is deprecated, please use ${to}:`,\n\t\tel,\n\t);\n\n// Deprecate togglegroup without data-toggle-group attribute\nconst TOGGLEGROUPS = getByCSSModule(\"togglegroup\");\nconst CSS_BUTTON = styles.button.split(\" \");\nconst deprecateToggleGroup = () => {\n\tfor (const el of TOGGLEGROUPS) {\n\t\tif (deprecate(el) && !el.hasAttribute(\"data-toggle-group\")) {\n\t\t\tattr(el, \"data-toggle-group\", \"Valgknapper\");\n\t\t\twarn(\n\t\t\t\t'Only setting class=\"styles.togglegroup\"',\n\t\t\t\t'data-toggle-group=\"LABEL-HERE\" attribute also for better accessibility',\n\t\t\t\tel,\n\t\t\t);\n\t\t}\n\t\tfor (const label of el.getElementsByTagName(\"label\")) {\n\t\t\tif (deprecate(label) && !label.classList.contains(CSS_BUTTON[0])) {\n\t\t\t\tlabel.classList.add(...CSS_BUTTON);\n\t\t\t\twarn(\n\t\t\t\t\t'Only setting class=\"styles.button\"',\n\t\t\t\t\t`<label class=\"styles.button\">`,\n\t\t\t\t\tlabel,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n};\n\n// Deprecate errorsummary without ds-error-summary element\nconst BREADCRUMBS = getByCSSModule(\"breadcrumbs\");\nconst deprecateBreadcrumbs = () => {\n\tfor (const el of BREADCRUMBS)\n\t\tif (deprecate(el) && el.nodeName !== \"DS-BREADCRUMBS\") {\n\t\t\tel.classList.add(...styles.breadcrumbs.split(\" \"));\n\t\t\twarn(\n\t\t\t\t'Only setting class=\"styles.breadcrumbs\"',\n\t\t\t\t'<ds-breadcrumbs class=\"styles.breadcrumbs\">',\n\t\t\t\tel,\n\t\t\t);\n\t\t}\n};\n\n// Deprecate errorsummary without ds-error-summary element\nconst ERRORSUMMARYS = getByCSSModule(\"errorsummary\");\nconst deprecateErrorSummary = () => {\n\tfor (const el of ERRORSUMMARYS)\n\t\tif (deprecate(el) && el.nodeName !== \"DS-ERROR-SUMMARY\") {\n\t\t\twarn(\n\t\t\t\t'Only setting class=\"styles.errorsummary\"',\n\t\t\t\t'<ds-error-summary class=\"styles.errorsummary\">',\n\t\t\t\tel,\n\t\t\t);\n\t\t}\n};\n\n// Deprecate data-variant and data-modal and data-closedby on dialogs\nconst DIALOGS = getByCSSModule(\"dialog\") as HTMLCollectionOf<HTMLDialogElement>;\nconst deprecateDialog = () => {\n\tfor (const el of DIALOGS) {\n\t\tif (!deprecate(el)) continue;\n\t\tif (el.hasAttribute(\"data-variant\")) {\n\t\t\twarn(\n\t\t\t\t'<dialog data-variant=\"drawer\">',\n\t\t\t\t'<dialog data-placement=\"center|left|right|top|bottom\">',\n\t\t\t\tel,\n\t\t\t);\n\t\t}\n\t\tif (el.isConnected && el.showModal && el.close) {\n\t\t\tconst closedby = attr(el, \"data-closedby\");\n\t\t\tif (closedby) {\n\t\t\t\tattr(el, \"closedby\", closedby);\n\t\t\t\twarn(\n\t\t\t\t\t`<dialog data-closedby=\"${closedby}\">`,\n\t\t\t\t\t`<dialog closedby=\"${closedby}\">`,\n\t\t\t\t\tel,\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (el.matches('[open]:not([data-modal=\"false\"]):not(:modal)')) {\n\t\t\t\twarn(\n\t\t\t\t\t'<dialog data-modal=\"true\">',\n\t\t\t\t\t'.showModal() or <button command=\"show-modal\" commandfor=\"DIALOG-ID\"></button>',\n\t\t\t\t\tel,\n\t\t\t\t);\n\t\t\t\tattr(el, \"open\", null); // Using attribute instead of .close to avoid `close` event\n\t\t\t\tel.showModal();\n\t\t\t} else if (el.matches(\":modal:not([open])\")) {\n\t\t\t\tattr(el, \"open\", \"\"); // Set as open\n\t\t\t\tel.close(); // So we correctly can call .close, removing <dialog> from #top-layer\n\t\t\t}\n\t\t}\n\t}\n};\n\n// Deprecate data-count in favor of data-limit\nconst deprecateCounter = () => {\n\tfor (const el of document.querySelectorAll(\"[data-count]\"))\n\t\tif (deprecate(el)) {\n\t\t\tconst count = attr(el, \"data-count\");\n\t\t\tel.classList.add(...styles.validation.split(\" \"));\n\t\t\tattr(el, \"data-limit\", count);\n\t\t\twarn(\n\t\t\t\t`data-count=\"${count}\"`,\n\t\t\t\t`class=\"styles.validation\" data-field=\"counter\" data-limit=\"${count}\"`,\n\t\t\t\tel,\n\t\t\t);\n\t\t}\n};\n\n// Deprecate data-command on buttons and other elements\nconst deprecateDataCommand = () => {\n\tfor (const el of document.querySelectorAll(\"[data-command]\"))\n\t\tif (deprecate(el)) {\n\t\t\tconst command = attr(el, \"data-command\");\n\n\t\t\tif (command === \"row\")\n\t\t\t\twarn(\n\t\t\t\t\t`<${el.nodeName.toLowerCase()} data-command=\"${command}\">`,\n\t\t\t\t\t`<tr data-clickdelegatefor=\"${el.nodeName}-ID\">`,\n\t\t\t\t\tel,\n\t\t\t\t);\n\t\t\telse\n\t\t\t\twarn(\n\t\t\t\t\t`<button data-command=\"${command}\">`,\n\t\t\t\t\t`<button command=\"${command?.replace(\"toggle-app-expanded\", \"show-modal\")}\" commandfor=\"TARGET-ID\">`,\n\t\t\t\t\tel,\n\t\t\t\t);\n\t\t}\n};\n\n// Deprecate u-tabs\nconst TABS = isBrowser() ? document.getElementsByTagName(\"u-tabs\") : [];\nconst deprecateUTabs = () => {\n\tfor (const el of TABS) if (deprecate(el)) warn(\"u-tabs\", \"ds-tabs\", el);\n};\n\n// Deprecate u-combobox and add class to ds-suggestion\nconst CSS_SUGGESTION = styles.suggestion.split(\" \");\nconst OLD = isBrowser() ? document.getElementsByTagName(\"u-combobox\") : [];\nconst NEW = isBrowser() ? document.getElementsByTagName(\"ds-suggestion\") : [];\nconst deprecateUCombobox = () => {\n\tfor (const el of OLD)\n\t\tif (deprecate(el)) {\n\t\t\tel.classList.add(...CSS_SUGGESTION);\n\t\t\twarn(\"<u-combobox>\", `<ds-suggestion class=\"styles.suggestion\">`, el);\n\t\t}\n\tfor (const el of NEW)\n\t\tif (deprecate(el) && !el.classList.contains(CSS_SUGGESTION[0])) {\n\t\t\tel.classList.add(...CSS_SUGGESTION);\n\t\t\twarn(\n\t\t\t\t\"Only using <ds-suggestion>\",\n\t\t\t\t`<ds-suggestion class=\"styles.suggestion\">`,\n\t\t\t\tel,\n\t\t\t);\n\t\t}\n};\n\nconst handleCommandClick = ({ target: el }: Event) => {\n\tif (el instanceof Element === false) return;\n\tconst row = el?.closest(\"tr\")?.querySelector('[data-command=\"row\"]');\n\tconst click =\n\t\trow && !el?.closest('a,button,label,input,select,textarea,[role=\"button\"]');\n\tif (click) (row as HTMLElement).click(); // Forward click to data-command=\"row\" element\n\n\tconst dialog = el?.closest(\"dialog\");\n\tconst close = dialog && el?.closest('[data-command=\"close\"]');\n\tif (close) dialog.close();\n};\n\n// Deprecate fields without ds-field element\nconst FIELDS = getByCSSModule(\"field\");\nconst FIELD_UNBIND = new Set<Element>();\nconst deprecateField = () => {\n\tfor (const el of FIELDS)\n\t\tif (el.nodeName !== \"DS-FIELD\") {\n\t\t\tif (!deprecate(el))\n\t\t\t\twarn(\n\t\t\t\t\t'Only setting class=\"styles.field\"',\n\t\t\t\t\t'<ds-field class=\"styles.field\">',\n\t\t\t\t\tel,\n\t\t\t\t);\n\t\t\tif (!FIELD_UNBIND.has(el) && FIELD_UNBIND.add(el)) {\n\t\t\t\tDSFieldElement.prototype.connectedCallback.call(el as DSFieldElement);\n\t\t\t}\n\t\t}\n};\nconst unbindFields = () => {\n\tfor (const el of FIELD_UNBIND) {\n\t\tDSFieldElement.prototype.disconnectedCallback.call(el as DSFieldElement);\n\t\tFIELD_UNBIND.delete(el);\n\t}\n};\n\n// Deprecate validation without data-field=\"validation\"\nconst CSS_DESCRIPTIONS = `[data-description], .${styles.field.split(\" \")[0]} label + p`;\nconst deprecateFeildDescription = () => {\n\tfor (const el of document.querySelectorAll(CSS_DESCRIPTIONS))\n\t\tif (deprecate(el) && el.getAttribute(\"data-field\") !== \"description\") {\n\t\t\tattr(el, \"data-field\", \"description\");\n\t\t\twarn(\n\t\t\t\t\"Descriptions created by data-description of <p> only\",\n\t\t\t\t'data-field=\"data-description\"',\n\t\t\t\tel,\n\t\t\t);\n\t\t}\n};\n\n// Deprecate validation without data-field=\"validation\"\nconst VALIDATIONS = getByCSSModule(\"validation\");\nconst deprecateFieldValidation = () => {\n\tfor (const el of VALIDATIONS)\n\t\tif (deprecate(el) && !el.hasAttribute(\"data-field\")) {\n\t\t\tattr(el, \"data-field\", \"validation\");\n\t\t\twarn(\n\t\t\t\t'Only setting class=\"styles.validation\"',\n\t\t\t\t'class=\"styles.validation\" data-field=\"validation\"',\n\t\t\t\tel,\n\t\t\t);\n\t\t}\n};\n\nconst deprecatePopoverPosition = () => {\n\tfor (const el of document.querySelectorAll(\"[popover][data-position]\"))\n\t\tif (deprecate(el)) {\n\t\t\tattr(el, \"data-placement\", attr(el, \"data-position\"));\n\t\t\twarn(\"data-position\", \"data-placement\", el);\n\t\t}\n};\n\nconst handleDeprecations = debounce(() => {\n\tdeprecateCounter();\n\tdeprecateDataCommand();\n\tdeprecateBreadcrumbs();\n\tdeprecateDialog();\n\tdeprecateErrorSummary();\n\tdeprecateFeildDescription();\n\tdeprecateFieldValidation();\n\tdeprecatePopoverPosition();\n\tdeprecateField(); // Should run after other field deprecations to access correct data-attributes\n\tdeprecateToggleGroup();\n\tdeprecateUCombobox();\n\tdeprecateUTabs();\n}, 200);\n\nonHotReload(\"deprecations\", () => [\n\tunbindFields, // Return as cleanup function\n\ton(document, \"click\", handleCommandClick, QUICK_EVENT),\n\tonMutation(document, handleDeprecations, {\n\t\tattributeFilter: [\n\t\t\t\"class\",\n\t\t\t\"data-command\",\n\t\t\t\"data-count\",\n\t\t\t\"data-description\",\n\t\t\t\"data-variant\",\n\t\t\t\"open\",\n\t\t],\n\t\tattributes: true,\n\t\tchildList: true,\n\t\tsubtree: true,\n\t}),\n]);\n"],"names":["DEPRECATIONS","deprecate","el","warn","from","to","TOGGLEGROUPS","getByCSSModule","CSS_BUTTON","styles","deprecateToggleGroup","attr","label","BREADCRUMBS","deprecateBreadcrumbs","ERRORSUMMARYS","deprecateErrorSummary","DIALOGS","deprecateDialog","closedby","deprecateCounter","count","deprecateDataCommand","command","TABS","isBrowser","deprecateUTabs","CSS_SUGGESTION","OLD","NEW","deprecateUCombobox","handleCommandClick","row","dialog","FIELDS","FIELD_UNBIND","deprecateField","DSFieldElement","unbindFields","CSS_DESCRIPTIONS","deprecateFeildDescription","VALIDATIONS","deprecateFieldValidation","deprecatePopoverPosition","handleDeprecations","debounce","onHotReload","on","QUICK_EVENT","onMutation"],"mappings":";;;AAaA,MAAMA,wBAAmB,QAAA,GACnBC,IAAY,CAACC,MAClB,CAACF,EAAa,IAAIE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