From f2b703722b46e6058e3d67cdba549b1e4b9f2976 Mon Sep 17 00:00:00 2001 From: Nathaniel Schmitz Date: Thu, 10 Oct 2024 13:17:53 -0400 Subject: [PATCH 01/57] Implement LayerManager using LitElement + anywidget --- .gitignore | 1 + geemap/core.py | 12 +- geemap/map_widgets.py | 463 +++-------- geemap/static/ipywidgets_styles.js | 94 +++ geemap/static/layer_manager.css | 2 + geemap/static/layer_manager.js | 192 +++++ geemap/static/layer_manager_row.css | 2 + geemap/static/layer_manager_row.js | 304 +++++++ geemap/static/material_styles.js | 63 ++ geemap/static/utils.js | 2 + js/common.css | 1 + js/ipywidgets_styles.ts | 56 ++ js/layer_manager.ts | 108 +++ js/layer_manager_row.ts | 238 ++++++ js/material_styles.ts | 25 + js/utils.ts | 20 + package-lock.json | 1181 +++++++++++++++++++++++++++ package.json | 15 + pyproject.toml | 40 +- requirements.txt | 1 + tests/fake_map.py | 23 +- tests/test_map_widgets.py | 334 ++++---- tsconfig.json | 27 + 23 files changed, 2663 insertions(+), 541 deletions(-) create mode 100644 geemap/static/ipywidgets_styles.js create mode 100644 geemap/static/layer_manager.css create mode 100644 geemap/static/layer_manager.js create mode 100644 geemap/static/layer_manager_row.css create mode 100644 geemap/static/layer_manager_row.js create mode 100644 geemap/static/material_styles.js create mode 100644 geemap/static/utils.js create mode 100644 js/common.css create mode 100644 js/ipywidgets_styles.ts create mode 100644 js/layer_manager.ts create mode 100644 js/layer_manager_row.ts create mode 100644 js/material_styles.ts create mode 100644 js/utils.ts create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 tsconfig.json diff --git a/.gitignore b/.gitignore index ef3ab1d719..bdc8de7a19 100644 --- a/.gitignore +++ b/.gitignore @@ -38,6 +38,7 @@ eggs/ .eggs/ lib/ lib64/ +node_modules/ parts/ sdist/ var/ diff --git a/geemap/core.py b/geemap/core.py index c332882f86..28d566e18b 100644 --- a/geemap/core.py +++ b/geemap/core.py @@ -926,14 +926,10 @@ def _on_toggle_toolbar_layers(self, is_open: bool) -> None: if self._layer_manager: return - def _on_open_vis(layer_name: str) -> None: - layer = self.ee_layers.get(layer_name, None) - self._add_layer_editor(position="bottomright", layer_dict=layer) - layer_manager = map_widgets.LayerManager(self) layer_manager.header_hidden = True layer_manager.close_button_hidden = True - layer_manager.on_open_vis = _on_open_vis + layer_manager.refresh_layers() self._toolbar.accessory_widget = layer_manager else: self._toolbar.accessory_widget = None @@ -949,13 +945,9 @@ def _add_layer_manager(self, position: str, **kwargs: Any) -> None: if self._layer_manager: return - def _on_open_vis(layer_name: str) -> None: - layer = self.ee_layers.get(layer_name, None) - self._add_layer_editor(position="bottomright", layer_dict=layer) - layer_manager = map_widgets.LayerManager(self, **kwargs) layer_manager.on_close = lambda: self.remove("layer_manager") - layer_manager.on_open_vis = _on_open_vis + layer_manager.refresh_layers() layer_manager_control = ipyleaflet.WidgetControl( widget=layer_manager, position=position ) diff --git a/geemap/map_widgets.py b/geemap/map_widgets.py index eeaa3c19f2..e091466491 100644 --- a/geemap/map_widgets.py +++ b/geemap/map_widgets.py @@ -1,20 +1,28 @@ """Various ipywidgets that can be added to a map.""" import functools -from typing import Any, Dict, List, Optional, Tuple, Union - +import pathlib +from typing import Any, Callable, Dict, List, Optional, Tuple, Union import IPython from IPython.display import HTML, display +import anywidget import ee -import ipyevents import ipytree import ipywidgets +import traitlets from . import coreutils +class TypedTuple(traitlets.Container): + """A trait for a tuple of any length with type-checked elements.""" + + klass = tuple + _cast_types = (list,) + + def _set_css_in_cell_output(info: Any) -> None: """Sets CSS styles in the cell output for different themes. @@ -878,361 +886,140 @@ def _objects_info(self, latlon: List[float]) -> ipytree.Node: return self._root_node("Objects", nodes) -@Theme.apply -class LayerManager(ipywidgets.VBox): - """A layer manager widget for managing map layers.""" +class LayerManagerRow(anywidget.AnyWidget): + """A layer manager row widget for geemap.""" - def __init__(self, host_map: "geemap.Map"): - """Initializes a layer manager widget. + _esm = pathlib.Path(__file__).parent / "static" / "layer_manager_row.js" + _css = pathlib.Path(__file__).parent / "static" / "layer_manager_row.css" - Args: - host_map (geemap.Map): The geemap.Map object. - """ - self._host_map = host_map - if not host_map: - raise ValueError("Must pass a valid map when creating a layer manager.") + name = traitlets.Unicode("").tag(sync=True) + visible = traitlets.Bool(True).tag(sync=True) + opacity = traitlets.Float(1).tag(sync=True) + is_loading = traitlets.Bool(False).tag(sync=True) - self._collapse_button = ipywidgets.ToggleButton( - value=False, - tooltip="Layer Manager", - icon="server", - layout=ipywidgets.Layout( - width="28px", height="28px", padding="0px 0px 0px 4px" - ), - ) - self._close_button = ipywidgets.Button( - tooltip="Close the tool", - icon="times", - button_style="primary", - layout=ipywidgets.Layout(width="28px", height="28px", padding="0px"), - ) + def __init__(self, host_map: "core.MapInterface", layer: Any): + super().__init__() + self.host_map = host_map + self.layer = layer + if not host_map or not layer: + raise ValueError( + "Must pass a valid map and layer when creating a layer manager row." + ) - self._toolbar_header = ipywidgets.HBox( - children=[self._close_button, self._collapse_button] - ) - self._toolbar_footer = ipywidgets.VBox(children=[]) + self.name = layer.name + self.visible = self._get_layer_visibility() + self.opacity = self._get_layer_opacity() + + self.opacity_link: Optional[ipywidgets.widget_link.Link] = None + self.visibility_link: Optional[ipywidgets.widget_link.Link] = None + self._setup_event_listeners() + + def _can_set_up_jslink(self, obj: Any, trait: str) -> bool: + return isinstance(obj, ipywidgets.Widget) and hasattr(obj, trait) + + def _traitlet_link_type(self) -> Callable[..., Any]: + if coreutils.in_colab_shell(): + # TODO: jslink doesn't work in Colab before the layers are added to the map. + # A potential workaround is calling display() on the layer before jslinking. + return ipywidgets.link + return ipywidgets.jslink + + def _setup_event_listeners(self) -> None: + self.layer.observe(self._on_layer_loading_changed, "loading") + self.on_msg(self._handle_message_event) + + link_func = self._traitlet_link_type() + if self._can_set_up_jslink(self.layer, "opacity"): + self.opacity_link = link_func((self.layer, "opacity"), (self, "opacity")) + if self._can_set_up_jslink(self.layer, "visible"): + self.visibility_link = link_func((self.layer, "visible"), (self, "visible")) + + def _on_layer_loading_changed(self, change: Dict[str, Any]) -> None: + self.is_loading = change.get("new", False) + + def _handle_message_event( + self, widget: ipywidgets.Widget, content: Dict[str, Any], buffers: List[Any] + ) -> None: + del widget, buffers # Unused + if content.get("type") == "click": + self._handle_button_click(content.get("id", "")) + + @traitlets.observe("opacity") + def _on_opacity_change(self, change: Dict[str, Any]) -> None: + if self._can_set_up_jslink(self.layer, "opacity"): + return # Return if the opacity is handled by a jslink. + if opacity := change.get("new"): + if self.layer in self.host_map.geojson_layers: + # For GeoJSON layers, use style.opacity and style.fillOpacity. + self.layer.style.update({"opacity": opacity, "fillOpacity": opacity}) + + def _get_layer_opacity(self) -> float: + if hasattr(self.layer, "opacity"): + return self.layer.opacity + elif self.layer in self.host_map.geojson_layers: + opacity = self.layer.style.get("opacity", 1.0) + fill_opacity = self.layer.style.get("fillOpacity", 1.0) + return max(opacity, fill_opacity) + return 1.0 - self._collapse_button.observe(self._on_collapse_click, "value") - self._close_button.on_click(self._on_close_click) + def _get_layer_visibility(self) -> bool: + if hasattr(self.layer, "visible"): + return self.layer.visible + return True - self.on_close = None - self.on_open_vis = None + def _handle_button_click(self, msg_id: str) -> None: + if msg_id == "settings": + self._open_layer_editor() + elif msg_id == "delete": + self._delete_layer() - self.collapsed = False - self.header_hidden = False - self.close_button_hidden = False + def _open_layer_editor(self) -> None: + metadata = self.host_map.ee_layers.get(self.name, None) + self.host_map.add("layer_editor", position="bottomright", layer_dict=metadata) - super().__init__([self._toolbar_header, self._toolbar_footer]) + def _delete_layer(self) -> None: + self.host_map.remove_layer(self.layer) - @property - def collapsed(self) -> bool: - """bool: Whether the layer manager is collapsed.""" - return not self._collapse_button.value - @collapsed.setter - def collapsed(self, value: bool) -> None: - self._collapse_button.value = not value +class LayerManager(anywidget.AnyWidget): + """A layer manager widget for geemap.""" - @property - def header_hidden(self) -> bool: - """bool: Whether the header is hidden.""" - return self._toolbar_header.layout.display == "none" + _esm = pathlib.Path(__file__).parent / "static" / "layer_manager.js" + _css = pathlib.Path(__file__).parent / "static" / "layer_manager.css" - @header_hidden.setter - def header_hidden(self, value: bool) -> None: - self._toolbar_header.layout.display = "none" if value else "block" + # Whether all layers should be visible or not. Represented as a checkbox in the UI. + visible = traitlets.Bool(True).tag(sync=True) - @property - def close_button_hidden(self) -> bool: - """bool: Whether the close button is hidden.""" - return self._close_button.style.display == "none" + # Child widgets in the container. Using a tuple here to force reassignment to update + # the list. When a proper notifying-list trait exists, use that instead. + children = TypedTuple( + trait=traitlets.Instance(ipywidgets.Widget), + help="List of widget children", + ).tag(sync=True, **ipywidgets.widget_serialization) - @close_button_hidden.setter - def close_button_hidden(self, value: bool) -> None: - self._close_button.style.display = "none" if value else "inline-block" + def __init__(self, host_map: "core.MapInterface"): + super().__init__() + self.host_map = host_map + if not host_map: + raise ValueError("Must pass a valid map when creating a layer manager.") def refresh_layers(self) -> None: - """Recreates all the layer widgets.""" - toggle_all_layout = ipywidgets.Layout( - height="18px", width="30ex", padding="0px 4px 25px 4px" - ) - toggle_all_checkbox = ipywidgets.Checkbox( - value=False, - description="All layers on/off", - indent=False, - layout=toggle_all_layout, - ) - toggle_all_checkbox.observe(self._on_all_layers_visibility_toggled, "value") - - layer_rows = [] - # non_basemap_layers = self._host_map.layers[1:] # Skip the basemap. - for layer in self._host_map.layers: - layer_rows.append(self._render_layer_row(layer)) - self._toolbar_footer.children = [toggle_all_checkbox] + layer_rows + """Refresh the layers in the layer manager. - def _on_close_click(self, _) -> None: - """Handles the close button click event.""" - if self.on_close: - self.on_close() - - def _on_collapse_click(self, change: Dict[str, Any]) -> None: - """Handles the collapse button click event. - - Args: - change (Dict[str, Any]): The change event arguments. + Uses the map interface to pull active layers. This function must be called + whenever a layer is added or removed on the map. """ - if change["new"]: - self.refresh_layers() - self.children = [self._toolbar_header, self._toolbar_footer] - else: - self.children = [self._collapse_button] + self.children = list(map(self._create_row_widget, self.host_map.layers)) - def _render_layer_row(self, layer: Any) -> ipywidgets.HBox: - """Renders a row for a layer. - - Args: - layer (Any): The layer to render. - - Returns: - ipywidgets.HBox: The rendered layer row. - """ - visibility_checkbox = ipywidgets.Checkbox( - value=self._compute_layer_visibility(layer), - description=layer.name, - indent=False, - layout=ipywidgets.Layout(height="18px", width="140px"), - ) - visibility_checkbox.observe( - lambda change: self._on_layer_visibility_changed(change, layer), "value" - ) - - opacity_slider = ipywidgets.FloatSlider( - value=self._compute_layer_opacity(layer), - min=0, - max=1, - step=0.01, - readout=False, - layout=ipywidgets.Layout(width="70px", padding="0px 3px 0px 0px"), - ) - opacity_slider.observe( - lambda change: self._on_layer_opacity_changed(change, layer), "value" - ) - - settings_button = ipywidgets.Button( - icon="gear", - layout=ipywidgets.Layout(width="25px", height="25px", padding="0px"), - tooltip=layer.name, - ) - settings_button.on_click(self._on_layer_settings_click) - - spinner = ipywidgets.Button( - icon="times", - layout=ipywidgets.Layout(width="25px", height="25px", padding="0px"), - tooltip="Loaded", - ) - - def loading_change(change): - if change["new"]: - spinner.tooltip = "Loading ..." - spinner.icon = "spinner spin lg" - else: - spinner.tooltip = "Loaded" - spinner.icon = "times" - - layer.observe(loading_change, "loading") - - spinner_event = ipyevents.Event( - source=spinner, watched_events=["mouseenter", "mouseleave"] - ) - - def handle_spinner_event(event): - if event["type"] == "mouseenter": - spinner.icon = "times" - elif event["type"] == "mouseleave": - if hasattr(layer, "loading") and layer.loading: - spinner.icon = "spinner spin lg" - else: - spinner.icon = "times" - - spinner_event.on_dom_event(handle_spinner_event) - - def remove_layer_click(_): - self._on_layer_remove_click(layer) - - spinner.on_click(remove_layer_click) - - return ipywidgets.HBox( - [ - visibility_checkbox, - opacity_slider, - settings_button, - spinner, - ], - layout=ipywidgets.Layout(padding="0px 4px 0px 4px"), - ) - - def _find_layer_row_index(self, layer: Any) -> int: - """Finds the index of a layer row. - - Args: - layer (Any): The layer to find. - - Returns: - int: The index of the layer row. - """ - for index, child in enumerate(self._toolbar_footer.children[1:]): - if child.children[0].description == layer.name: - return index + 1 - return -1 - - def _remove_confirm_widget(self) -> None: - """Removes the confirm widget.""" - for index, child in enumerate(self._toolbar_footer.children[1:]): - if child.children[0].value == "Remove layer?": - self._toolbar_footer.children = ( - self._toolbar_footer.children[: index + 1] - + self._toolbar_footer.children[index + 2 :] - ) - break - - def _on_layer_remove_click(self, layer: Any) -> None: - """Handles the layer remove click event. - - Args: - layer (Any): The layer to remove. - """ - self._remove_confirm_widget() - - label = ipywidgets.Label( - "Remove layer?", - layout=ipywidgets.Layout(padding="0px 4px 0px 4px"), - ) - yes_button = ipywidgets.Button( - description="Yes", - button_style="primary", - ) - yes_button.layout.width = "86px" - no_button = ipywidgets.Button( - description="No", - button_style="primary", - ) - no_button.layout.width = "86px" - - confirm_widget = ipywidgets.HBox( - [label, yes_button, no_button], layout=ipywidgets.Layout(width="284px") - ) - - layer_row_index = self._find_layer_row_index(layer) - - self._toolbar_footer.children = ( - list(self._toolbar_footer.children[: layer_row_index + 1]) - + [confirm_widget] - + list(self._toolbar_footer.children[layer_row_index + 1 :]) - ) - - def on_yes_button_click(_): - self._host_map.remove_layer(layer) - self._remove_confirm_widget() - - yes_button.on_click(on_yes_button_click) - - def on_no_button_click(_): - self._remove_confirm_widget() - - no_button.on_click(on_no_button_click) - - def _compute_layer_opacity(self, layer: Any) -> float: - """Computes the opacity of a layer. - - Args: - layer (Any): The layer to compute the opacity for. - - Returns: - float: The opacity of the layer. - """ - if layer in self._host_map.geojson_layers: - opacity = layer.style.get("opacity", 1.0) - fill_opacity = layer.style.get("fillOpacity", 1.0) - return max(opacity, fill_opacity) - return layer.opacity if hasattr(layer, "opacity") else 1.0 - - def _compute_layer_visibility(self, layer: Any) -> bool: - """Computes the visibility of a layer. - - Args: - layer (Any): The layer to compute the visibility for. - - Returns: - bool: The visibility of the layer. - """ - return layer.visible if hasattr(layer, "visible") else True - - def _on_layer_settings_click(self, button: ipywidgets.Button) -> None: - """Handles the layer settings click event. - - Args: - button (ipywidgets.Button): The button that was clicked. - """ - if self.on_open_vis: - self.on_open_vis(button.tooltip) - - def _on_all_layers_visibility_toggled(self, change: Dict[str, Any]) -> None: - """Handles the all layers visibility toggled event. - - Args: - change (Dict[str, Any]): The change event arguments. - """ - checkboxes = [ - row.children[0] for row in self._toolbar_footer.children[1:] - ] # Skip the all on/off checkbox. - for checkbox in checkboxes: - checkbox.value = change["new"] - - def _on_layer_opacity_changed(self, change: Dict[str, Any], layer: Any) -> None: - """Handles the layer opacity changed event. - - Args: - change (Dict[str, Any]): The change event arguments. - layer (Any): The layer to change the opacity for. - """ - if layer in self._host_map.geojson_layers: - # For non-TileLayer, use layer.style.opacity and layer.style.fillOpacity. - layer.style.update({"opacity": change["new"], "fillOpacity": change["new"]}) - elif hasattr(layer, "opacity"): - layer.opacity = change["new"] - - def _on_layer_visibility_changed(self, change: Dict[str, Any], layer: Any) -> None: - """Handles the layer visibility changed event. - - Args: - change (Dict[str, Any]): The change event arguments. - layer (Any): The layer to change the visibility for. - """ - if hasattr(layer, "visible"): - layer.visible = change["new"] - - layer_name = change["owner"].description - if layer_name not in self._host_map.ee_layers: - return + def _create_row_widget(self, layer: Any) -> LayerManagerRow: + return LayerManagerRow(self.host_map, layer) - layer_dict = self._host_map.ee_layers[layer_name] - for attachment_name in ["legend", "colorbar"]: - attachment = layer_dict.get(attachment_name, None) - attachment_on_map = attachment in self._host_map.controls - if change["new"] and not attachment_on_map: - try: - self._host_map.add(attachment) - except: - from ipyleaflet import WidgetControl - - widget = attachment.widget - position = attachment.position - control = WidgetControl(widget=widget, position=position) - self._host_map.add(control) - layer_dict["colorbar"] = control - - elif not change["new"] and attachment_on_map: - self._host_map.remove_control(attachment) + @traitlets.observe("visible") + def _observe_visible(self, change: Dict[str, Any]) -> None: + # When the `visible` property changes, propagate that change to all children. + if (visible := change.get("new")) is not None: + for child in self.children: + child.visible = visible @Theme.apply diff --git a/geemap/static/ipywidgets_styles.js b/geemap/static/ipywidgets_styles.js new file mode 100644 index 0000000000..a788ad9e1b --- /dev/null +++ b/geemap/static/ipywidgets_styles.js @@ -0,0 +1,94 @@ +var R=globalThis,N=R.ShadowRoot&&(R.ShadyCSS===void 0||R.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,k=Symbol(),Z=new WeakMap,E=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==k)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(N&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=Z.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Z.set(e,t))}return t}toString(){return this.cssText}},X=r=>new E(typeof r=="string"?r:r+"",void 0,k),z=(r,...t)=>{let e=r.length===1?r[0]:t.reduce((s,i,o)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[o+1],r[0]);return new E(e,r,k)},L=(r,t)=>{if(N)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=R.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s)}},T=N?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return X(e)})(r):r;var{is:pt,defineProperty:ut,getOwnPropertyDescriptor:$t,getOwnPropertyNames:ft,getOwnPropertySymbols:_t,getPrototypeOf:gt}=Object,M=globalThis,G=M.trustedTypes,mt=G?G.emptyScript:"",At=M.reactiveElementPolyfillSupport,w=(r,t)=>r,I={toAttribute(r,t){switch(t){case Boolean:r=r?mt:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},tt=(r,t)=>!pt(r,t),Y={attribute:!0,type:String,converter:I,reflect:!1,hasChanged:tt};Symbol.metadata??=Symbol("metadata"),M.litPropertyMetadata??=new WeakMap;var $=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Y){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&ut(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:o}=$t(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i?.call(this)},set(n){let p=i?.call(this);o.call(this,n),this.requestUpdate(t,p,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Y}static _$Ei(){if(this.hasOwnProperty(w("elementProperties")))return;let t=gt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(w("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(w("properties"))){let e=this.properties,s=[...ft(e),..._t(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(T(i))}else t!==void 0&&e.push(T(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return L(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let o=(s.converter?.toAttribute!==void 0?s.converter:I).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let o=s.getPropertyOptions(i),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:I;this._$Em=i,this[i]=n.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??tt)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,o]of this._$Ep)this[i]=o;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,o]of s)o.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],o)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[w("elementProperties")]=new Map,$[w("finalized")]=new Map,At?.({ReactiveElement:$}),(M.reactiveElementVersions??=[]).push("2.0.4");var J=globalThis,j=J.trustedTypes,et=j?j.createPolicy("lit-html",{createHTML:r=>r}):void 0,ht="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,at="?"+_,yt=`<${at}>`,A=document,C=()=>A.createComment(""),P=r=>r===null||typeof r!="object"&&typeof r!="function",F=Array.isArray,vt=r=>F(r)||typeof r?.[Symbol.iterator]=="function",B=`[ +\f\r]`,x=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,st=/-->/g,it=/>/g,g=RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`,"g"),rt=/'/g,ot=/"/g,lt=/^(?:script|style|textarea|title)$/i,Q=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),Ut=Q(1),Ht=Q(2),Ot=Q(3),y=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),nt=new WeakMap,m=A.createTreeWalker(A,129);function ct(r,t){if(!F(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return et!==void 0?et.createHTML(t):t}var St=(r,t)=>{let e=r.length-1,s=[],i,o=t===2?"":t===3?"":"",n=x;for(let p=0;p"?(n=i??x,a=-1):d[1]===void 0?a=-2:(a=n.lastIndex-d[2].length,l=d[1],n=d[3]===void 0?g:d[3]==='"'?ot:rt):n===ot||n===rt?n=g:n===st||n===it?n=x:(n=g,i=void 0);let f=n===g&&r[p+1].startsWith("/>")?" ":"";o+=n===x?h+yt:a>=0?(s.push(l),h.slice(0,a)+ht+h.slice(a)+_+f):h+_+(a===-2?p:f)}return[ct(r,o+(r[e]||"")+(t===2?"":t===3?"":"")),s]},U=class r{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let o=0,n=0,p=t.length-1,h=this.parts,[l,d]=St(t,e);if(this.el=r.createElement(l,s),m.currentNode=this.el.content,e===2||e===3){let a=this.el.content.firstChild;a.replaceWith(...a.childNodes)}for(;(i=m.nextNode())!==null&&h.length0){i.textContent=j?j.emptyScript:"";for(let f=0;f2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=c}_$AI(t,e=this,s,i){let o=this.strings,n=!1;if(o===void 0)t=v(this,t,e,0),n=!P(t)||t!==this._$AH&&t!==y,n&&(this._$AH=t);else{let p=t,h,l;for(t=o[0],h=0;h{let s=e?.renderBefore??t,i=s._$litPart$;if(i===void 0){let o=e?.renderBefore??null;s._$litPart$=i=new H(t.insertBefore(C(),o),o,void 0,e??{})}return i._$AI(r),i};var b=class extends ${constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=dt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return y}};b._$litElement$=!0,b.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:b});var Et=globalThis.litElementPolyfillSupport;Et?.({LitElement:b});(globalThis.litElementVersions??=[]).push("4.1.0");var qt=z` + .legacy-button { + align-items: center; + background-color: var(--jp-layout-color2); + border-width: 0; + box-shadow: none; + color: var(--jp-ui-font-color1); + cursor: pointer; + display: flex; + font-family: "Helvetica Neue", Arial, Helvetica, sans-serif; + font-size: var(--jp-widgets-font-size); + justify-content: center; + line-height: var(--jp-widgets-inline-height); + padding: 0; + } + + .legacy-button.primary { + background-color: var(--jp-brand-color1); + color: var(--jp-ui-inverse-font-color1); + } + + .legacy-button:hover:enabled, + .legacy-button:focus:enabled { + box-shadow: var(--jp-elevation-z2); + } + + .legacy-slider { + -webkit-appearance: none; + appearance: none; + background: var(--jp-layout-color3); + border-radius: 3px; + height: 4px; + outline: none; + } + + .legacy-slider::-webkit-slider-thumb, + .legacy-slider::-moz-range-thumb { + -moz-appearance: none; + -webkit-appearance: none; + appearance: none; + border-radius: 50%; + cursor: pointer; + height: var(--jp-widgets-slider-handle-size); + width: var(--jp-widgets-slider-handle-size); + } + + .legacy-text { + color: var(--jp-widgets-label-color); + font-family: "Helvetica Neue", Arial, Helvetica, sans-serif; + font-size: var(--jp-widgets-font-size); + height: var(--jp-widgets-inline-height); + line-height: var(--jp-widgets-inline-height); + } +`;export{qt as legacyStyles}; +/*! Bundled license information: + +@lit/reactive-element/css-tag.js: + (** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/reactive-element.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +lit-html/lit-html.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +lit-element/lit-element.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +lit-html/is-server.js: + (** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) +*/ +//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vbm9kZV9tb2R1bGVzL0BsaXQvcmVhY3RpdmUtZWxlbWVudC9zcmMvY3NzLXRhZy50cyIsICIuLi8uLi9ub2RlX21vZHVsZXMvQGxpdC9yZWFjdGl2ZS1lbGVtZW50L3NyYy9yZWFjdGl2ZS1lbGVtZW50LnRzIiwgIi4uLy4uL25vZGVfbW9kdWxlcy9saXQtaHRtbC9zcmMvbGl0LWh0bWwudHMiLCAiLi4vLi4vbm9kZV9tb2R1bGVzL2xpdC1lbGVtZW50L3NyYy9saXQtZWxlbWVudC50cyIsICIuLi8uLi9qcy9pcHl3aWRnZXRzX3N0eWxlcy50cyJdLAogICJzb3VyY2VzQ29udGVudCI6IFsiLyoqXG4gKiBAbGljZW5zZVxuICogQ29weXJpZ2h0IDIwMTkgR29vZ2xlIExMQ1xuICogU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IEJTRC0zLUNsYXVzZVxuICovXG5cbmNvbnN0IE5PREVfTU9ERSA9IGZhbHNlO1xuXG4vLyBBbGxvd3MgbWluaWZpZXJzIHRvIHJlbmFtZSByZWZlcmVuY2VzIHRvIGdsb2JhbFRoaXNcbmNvbnN0IGdsb2JhbCA9IGdsb2JhbFRoaXM7XG5cbi8qKlxuICogV2hldGhlciB0aGUgY3VycmVudCBicm93c2VyIHN1cHBvcnRzIGBhZG9wdGVkU3R5bGVTaGVldHNgLlxuICovXG5leHBvcnQgY29uc3Qgc3VwcG9ydHNBZG9wdGluZ1N0eWxlU2hlZXRzOiBib29sZWFuID1cbiAgZ2xvYmFsLlNoYWRvd1Jvb3QgJiZcbiAgKGdsb2JhbC5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V4dCBub2Rlcy5cbiAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAvXig/OnRleHRhcmVhfHRlbXBsYXRlKSQvaSEudGVzdCh0YWcpICYmXG4gICAgICAgICAgICAobm9kZSBhcyBFbGVtZW50KS5pbm5lckhUTUwuaW5jbHVkZXMobWFya2VyKVxuICAgICAgICAgICkge1xuICAgICAgICAgICAgY29uc3QgbSA9XG4gICAgICAgICAgICAgIGBFeHByZXNzaW9ucyBhcmUgbm90IHN1cHBvcnRlZCBpbnNpZGUgXFxgJHt0YWd9XFxgIGAgK1xuICAgICAgICAgICAgICBgZWxlbWVudHMuIFNlZSBodHRwczovL2xpdC5kZXYvbXNnL2V4cHJlc3Npb24taW4tJHt0YWd9IGZvciBtb3JlIGAgK1xuICAgICAgICAgICAgICBgaW5mb3JtYXRpb24uYDtcbiAgICAgICAgICAgIGlmICh0YWcgPT09ICd0ZW1wbGF0ZScpIHtcbiAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKG0pO1xuICAgICAgICAgICAgfSBlbHNlIGlzc3VlV2FybmluZygnJywgbSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIC8vIFRPRE8gKGp1c3RpbmZhZ25hbmkpOiBmb3IgYXR0ZW1wdGVkIGR5bmFtaWMgdGFnIG5hbWVzLCB3ZSBkb24ndFxuICAgICAgICAvLyBpbmNyZW1lbnQgdGhlIGJpbmRpbmdJbmRleCwgYW5kIGl0J2xsIGJlIG9mZiBieSAxIGluIHRoZSBlbGVtZW50XG4gICAgICAgIC8vIGFuZCBvZmYgYnkgdHdvIGFmdGVyIGl0LlxuICAgICAgICBpZiAoKG5vZGUgYXMgRWxlbWVudCkuaGFzQXR0cmlidXRlcygpKSB7XG4gICAgICAgICAgZm9yIChjb25zdCBuYW1lIG9mIChub2RlIGFzIEVsZW1lbnQpLmdldEF0dHJpYnV0ZU5hbWVzKCkpIHtcbiAgICAgICAgICAgIGlmIChuYW1lLmVuZHNXaXRoKGJvdW5kQXR0cmlidXRlU3VmZml4KSkge1xuICAgICAgICAgICAgICBjb25zdCByZWFsTmFtZSA9IGF0dHJOYW1lc1thdHRyTmFtZUluZGV4KytdO1xuICAgICAgICAgICAgICBjb25zdCB2YWx1ZSA9IChub2RlIGFzIEVsZW1lbnQpLmdldEF0dHJpYnV0ZShuYW1lKSE7XG4gICAgICAgICAgICAgIGNvbnN0IHN0YXRpY3MgPSB2YWx1ZS5zcGxpdChtYXJrZXIpO1xuICAgICAgICAgICAgICBjb25zdCBtID0gLyhbLj9AXSk/KC4qKS8uZXhlYyhyZWFsTmFtZSkhO1xuICAgICAgICAgICAgICBwYXJ0cy5wdXNoKHtcbiAgICAgICAgICAgICAgICB0eXBlOiBBVFRSSUJVVEVfUEFSVCxcbiAgICAgICAgICAgICAgICBpbmRleDogbm9kZUluZGV4LFxuICAgICAgICAgICAgICAgIG5hbWU6IG1bMl0sXG4gICAgICAgICAgICAgICAgc3RyaW5nczogc3RhdGljcyxcbiAgICAgICAgICAgICAgICBjdG9yOlxuICAgICAgICAgICAgICAgICAgbVsxXSA9PT0gJy4nXG4gICAgICAgICAgICAgICAgICAgID8gUHJvcGVydHlQYXJ0XG4gICAgICAgICAgICAgICAgICAgIDogbVsxXSA9PT0gJz8nXG4gICAgICAgICAgICAgICAgICAgICAgPyBCb29sZWFuQXR0cmlidXRlUGFydFxuICAgICAgICAgICAgICAgICAgICAgIDogbVsxXSA9PT0gJ0AnXG4gICAgICAgICAgICAgICAgICAgICAgICA/IEV2ZW50UGFydFxuICAgICAgICAgICAgICAgICAgICAgICAgOiBBdHRyaWJ1dGVQYXJ0LFxuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgKG5vZGUgYXMgRWxlbWVudCkucmVtb3ZlQXR0cmlidXRlKG5hbWUpO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChuYW1lLnN0YXJ0c1dpdGgobWFya2VyKSkge1xuICAgICAgICAgICAgICBwYXJ0cy5wdXNoKHtcbiAgICAg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1cbiAgICB9XG4gICAgaWYgKGNoYW5nZSAmJiAhbm9Db21taXQpIHtcbiAgICAgIHRoaXMuX2NvbW1pdFZhbHVlKHZhbHVlKTtcbiAgICB9XG4gIH1cblxuICAvKiogQGludGVybmFsICovXG4gIF9jb21taXRWYWx1ZSh2YWx1ZTogdW5rbm93bikge1xuICAgIGlmICh2YWx1ZSA9PT0gbm90aGluZykge1xuICAgICAgKHdyYXAodGhpcy5lbGVtZW50KSBhcyBFbGVtZW50KS5yZW1vdmVBdHRyaWJ1dGUodGhpcy5uYW1lKTtcbiAgICB9IGVsc2Uge1xuICAgICAgaWYgKEVOQUJMRV9FWFRSQV9TRUNVUklUWV9IT09LUykge1xuICAgICAgICBpZiAodGhpcy5fc2FuaXRpemVyID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICB0aGlzLl9zYW5pdGl6ZXIgPSBzYW5pdGl6ZXJGYWN0b3J5SW50ZXJuYWwoXG4gICAgICAgICAgICB0aGlzLmVsZW1lbnQsXG4gICAgICAgICAgICB0aGlzLm5hbWUsXG4gICAgICAgICAgICAnYXR0cmlidXRlJyxcbiAgICAgICAgICApO1xuICAgICAgICB9XG4gICAgICAgIHZhbHVlID0gdGhpcy5fc2FuaXRpemVyKHZhbHVlID8/ICcnKTtcbiAgICAgIH1cbiAgICAgIGRlYnVnTG9nRXZlbnQgJiZcbiAgICAgICAgZGVidWdMb2dFdmVudCh7XG4gICAgICAgICAga2luZDogJ2NvbW1pdCBhdHRyaWJ1dGUnLFxuICAgICAgICAgIGVsZW1lbnQ6IHRoaXMuZWxlbWVudCxcbiAgICAgICAgICBuYW1lOiB0aGlzLm5hbWUsXG4gICAgICAgICAgdmFsdWUsXG4gICAgICAgICAgb3B0aW9uczogdGhpcy5vcHRpb25zLFxuICAgICAgICB9KTtcbiAgICAgICh3cmFwKHRoaXMuZWxlbWVudCkgYXMgRWxlbWVudCkuc2V0QXR0cmlidXRlKFxuICAgICAgICB0aGlzLm5hbWUsXG4gICAgICAgIC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IiwgImxlZ2FjeVN0eWxlcyIsICJpIl0KfQo= diff --git a/geemap/static/layer_manager.css b/geemap/static/layer_manager.css new file mode 100644 index 0000000000..202059d823 --- /dev/null +++ b/geemap/static/layer_manager.css @@ -0,0 +1,2 @@ +@import"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined"; +/*# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFtdLAogICJzb3VyY2VzQ29udGVudCI6IFtdLAogICJtYXBwaW5ncyI6ICIiLAogICJuYW1lcyI6IFtdCn0K */ diff --git a/geemap/static/layer_manager.js b/geemap/static/layer_manager.js new file mode 100644 index 0000000000..79a6fd5c7c --- /dev/null +++ b/geemap/static/layer_manager.js @@ -0,0 +1,192 @@ +var At=Object.defineProperty;var vt=Object.getOwnPropertyDescriptor;var st=(r,t,e,s)=>{for(var i=s>1?void 0:s?vt(t,e):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(i=(s?n(t,e,i):n(i))||i);return s&&i&&At(t,e,i),i};var T=globalThis,k=T.ShadowRoot&&(T.ShadyCSS===void 0||T.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,V=Symbol(),it=new WeakMap,x=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==V)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(k&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=it.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&it.set(e,t))}return t}toString(){return this.cssText}},rt=r=>new x(typeof r=="string"?r:r+"",void 0,V),w=(r,...t)=>{let e=r.length===1?r[0]:t.reduce((s,i,o)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[o+1],r[0]);return new x(e,r,V)},B=(r,t)=>{if(k)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=T.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s)}},j=k?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return rt(e)})(r):r;var{is:bt,defineProperty:St,getOwnPropertyDescriptor:Et,getOwnPropertyNames:xt,getOwnPropertySymbols:wt,getPrototypeOf:Ct}=Object,L=globalThis,ot=L.trustedTypes,Pt=ot?ot.emptyScript:"",Mt=L.reactiveElementPolyfillSupport,C=(r,t)=>r,P={toAttribute(r,t){switch(t){case Boolean:r=r?Pt:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},z=(r,t)=>!bt(r,t),nt={attribute:!0,type:String,converter:P,reflect:!1,hasChanged:z};Symbol.metadata??=Symbol("metadata"),L.litPropertyMetadata??=new WeakMap;var m=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=nt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&St(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:o}=Et(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i?.call(this)},set(n){let h=i?.call(this);o.call(this,n),this.requestUpdate(t,h,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??nt}static _$Ei(){if(this.hasOwnProperty(C("elementProperties")))return;let t=Ct(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(C("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(C("properties"))){let e=this.properties,s=[...xt(e),...wt(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(j(i))}else t!==void 0&&e.push(j(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return B(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let o=(s.converter?.toAttribute!==void 0?s.converter:P).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let o=s.getPropertyOptions(i),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:P;this._$Em=i,this[i]=n.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??z)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,o]of this._$Ep)this[i]=o;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,o]of s)o.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],o)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};m.elementStyles=[],m.shadowRootOptions={mode:"open"},m[C("elementProperties")]=new Map,m[C("finalized")]=new Map,Mt?.({ReactiveElement:m}),(L.reactiveElementVersions??=[]).push("2.0.4");var X=globalThis,I=X.trustedTypes,at=I?I.createPolicy("lit-html",{createHTML:r=>r}):void 0,ut="$lit$",g=`lit$${Math.random().toFixed(9).slice(2)}$`,mt="?"+g,Ut=`<${mt}>`,A=document,U=()=>A.createComment(""),N=r=>r===null||typeof r!="object"&&typeof r!="function",Y=Array.isArray,Nt=r=>Y(r)||typeof r?.[Symbol.iterator]=="function",W=`[ +\f\r]`,M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,lt=/-->/g,ht=/>/g,$=RegExp(`>|${W}(?:([^\\s"'>=/]+)(${W}*=${W}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`,"g"),ct=/'/g,dt=/"/g,ft=/^(?:script|style|textarea|title)$/i,G=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),gt=G(1),Bt=G(2),Wt=G(3),v=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),pt=new WeakMap,_=A.createTreeWalker(A,129);function yt(r,t){if(!Y(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return at!==void 0?at.createHTML(t):t}var Ot=(r,t)=>{let e=r.length-1,s=[],i,o=t===2?"":t===3?"":"",n=M;for(let h=0;h"?(n=i??M,l=-1):p[1]===void 0?l=-2:(l=n.lastIndex-p[2].length,c=p[1],n=p[3]===void 0?$:p[3]==='"'?dt:ct):n===dt||n===ct?n=$:n===lt||n===ht?n=M:(n=$,i=void 0);let f=n===$&&r[h+1].startsWith("/>")?" ":"";o+=n===M?a+Ut:l>=0?(s.push(c),a.slice(0,l)+ut+a.slice(l)+g+f):a+g+(l===-2?h:f)}return[yt(r,o+(r[e]||"")+(t===2?"":t===3?"":"")),s]},O=class r{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let o=0,n=0,h=t.length-1,a=this.parts,[c,p]=Ot(t,e);if(this.el=r.createElement(c,s),_.currentNode=this.el.content,e===2||e===3){let l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(i=_.nextNode())!==null&&a.length0){i.textContent=I?I.emptyScript:"";for(let f=0;f2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=d}_$AI(t,e=this,s,i){let o=this.strings,n=!1;if(o===void 0)t=b(this,t,e,0),n=!N(t)||t!==this._$AH&&t!==v,n&&(this._$AH=t);else{let h=t,a,c;for(t=o[0],a=0;a{let s=e?.renderBefore??t,i=s._$litPart$;if(i===void 0){let o=e?.renderBefore??null;s._$litPart$=i=new R(t.insertBefore(U(),o),o,void 0,e??{})}return i._$AI(r),i};var y=class extends m{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=$t(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return v}};y._$litElement$=!0,y.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:y});var Ht=globalThis.litElementPolyfillSupport;Ht?.({LitElement:y});(globalThis.litElementVersions??=[]).push("4.1.0");var Tt={attribute:!0,type:String,converter:P,reflect:!1,hasChanged:z},kt=(r=Tt,t,e)=>{let{kind:s,metadata:i}=e,o=globalThis.litPropertyMetadata.get(i);if(o===void 0&&globalThis.litPropertyMetadata.set(i,o=new Map),o.set(e.name,r),s==="accessor"){let{name:n}=e;return{set(h){let a=t.get.call(this);t.set.call(this,h),this.requestUpdate(n,a,r)},init(h){return h!==void 0&&this.P(n,void 0,r),h}}}if(s==="setter"){let{name:n}=e;return function(h){let a=this[n];t.call(this,h),this.requestUpdate(n,a,r)}}throw Error("Unsupported decorator location: "+s)};function tt(r){return(t,e)=>typeof e=="object"?kt(r,t,e):((s,i,o)=>{let n=i.hasOwnProperty(o);return i.constructor.createProperty(o,n?{...s,wrapped:!0}:s),n?Object.getOwnPropertyDescriptor(i,o):void 0})(r,t,e)}var _t=w` + .legacy-button { + align-items: center; + background-color: var(--jp-layout-color2); + border-width: 0; + box-shadow: none; + color: var(--jp-ui-font-color1); + cursor: pointer; + display: flex; + font-family: "Helvetica Neue", Arial, Helvetica, sans-serif; + font-size: var(--jp-widgets-font-size); + justify-content: center; + line-height: var(--jp-widgets-inline-height); + padding: 0; + } + + .legacy-button.primary { + background-color: var(--jp-brand-color1); + color: var(--jp-ui-inverse-font-color1); + } + + .legacy-button:hover:enabled, + .legacy-button:focus:enabled { + box-shadow: var(--jp-elevation-z2); + } + + .legacy-slider { + -webkit-appearance: none; + appearance: none; + background: var(--jp-layout-color3); + border-radius: 3px; + height: 4px; + outline: none; + } + + .legacy-slider::-webkit-slider-thumb, + .legacy-slider::-moz-range-thumb { + -moz-appearance: none; + -webkit-appearance: none; + appearance: none; + border-radius: 50%; + cursor: pointer; + height: var(--jp-widgets-slider-handle-size); + width: var(--jp-widgets-slider-handle-size); + } + + .legacy-text { + color: var(--jp-widgets-label-color); + font-family: "Helvetica Neue", Arial, Helvetica, sans-serif; + font-size: var(--jp-widgets-font-size); + height: var(--jp-widgets-inline-height); + line-height: var(--jp-widgets-inline-height); + } +`;async function jt(r,t){return Promise.all(r.map(e=>t.get_model(e.slice(10))))}async function et(r,t){let e=t.get("children"),s=await jt(e,t.widget_manager),i=await Promise.all(s.map(o=>o.widget_manager.create_view(o)));r.innerHTML="";for(let o of i)r.appendChild(o.el)}var D=class D extends y{constructor(){super(...arguments);this._model=void 0;this.visible=!1}static get componentName(){return"layer-manager"}static{this.styles=[_t,w` + .container { + padding: 0 4px 2px 4px; + } + + .row { + align-items: center; + display: flex; + gap: 4px; + height: 30px; + } + + .visibility-checkbox { + margin: 2px; + } + `]}static{this.modelNameToViewName=new Map([["children",null],["visible","visible"]])}set model(e){this._model=e;for(let[s,i]of D.modelNameToViewName)i&&(this[i]=e.get(s),e.on(`change:${s}`,()=>{this[i]=e.get(s)}))}render(){return gt` +
+
+ + All layers on/off +
+ +
+ `}updated(e){for(let[s,i]of e)this._model?.set(s,this[s]);this._model?.save_changes()}onLayerVisibilityChanged(e){let s=e.target;this.visible=s.checked}};st([tt()],D.prototype,"visible",2);var E=D;customElements.get(E.componentName)||customElements.define(E.componentName,E);async function Lt({model:r,el:t}){let e=document.createElement(E.componentName);e.model=r,t.appendChild(e),et(e,r),r.on("change:children",()=>{et(e,r)})}var qe={render:Lt};export{E as LayerManager,qe as default}; +/*! Bundled license information: + +@lit/reactive-element/css-tag.js: + (** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/reactive-element.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +lit-html/lit-html.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +lit-element/lit-element.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +lit-html/is-server.js: + (** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/decorators/custom-element.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/decorators/property.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/decorators/state.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/decorators/event-options.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/decorators/base.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/decorators/query.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/decorators/query-all.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/decorators/query-async.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/decorators/query-assigned-elements.js: + (** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/decorators/query-assigned-nodes.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) +*/ +//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vbm9kZV9tb2R1bGVzL0BsaXQvcmVhY3RpdmUtZWxlbWVudC9zcmMvY3NzLXRhZy50cyIsICIuLi8uLi9ub2RlX21vZHVsZXMvQGxpdC9yZWFjdGl2ZS1lbGVtZW50L3NyYy9yZWFjdGl2ZS1lbGVtZW50LnRzIiwgIi4uLy4uL25vZGVfbW9kdWxlcy9saXQtaHRtbC9zcmMvbGl0LWh0bWwudHMiLCAiLi4vLi4vbm9kZV9tb2R1bGVzL2xpdC1lbGVtZW50L3NyYy9saXQtZWxlbWVudC50cyIsICIuLi8uLi9ub2RlX21vZHVsZXMvQGxpdC9yZWFjdGl2ZS1lbGVtZW50L3NyYy9kZWNvcmF0b3JzL3Byb3BlcnR5LnRzIiwgIi4uLy4uL2pzL2lweXdpZGdldHNfc3R5bGVzLnRzIiwgIi4uLy4uL2pzL3V0aWxzLnRzIiwgIi4uLy4uL2pzL2xheWVyX21hbmFnZXIudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbIi8qKlxuICogQGxpY2Vuc2VcbiAqIENvcHlyaWdodCAyMDE5IEdvb2dsZSBMTENcbiA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1lcygpKSB7XG4gICAgICAgICAgICBpZiAobmFtZS5lbmRzV2l0aChib3VuZEF0dHJpYnV0ZVN1ZmZpeCkpIHtcbiAgICAgICAgICAgICAgY29uc3QgcmVhbE5hbWUgPSBhdHRyTmFtZXNbYXR0ck5hbWVJbmRleCsrXTtcbiAgICAgICAgICAgICAgY29uc3QgdmFsdWUgPSAobm9kZSBhcyBFbGVtZW50KS5nZXRBdHRyaWJ1dGUobmFtZSkhO1xuICAgICAgICAgICAgICBjb25zdCBzdGF0aWNzID0gdmFsdWUuc3BsaXQobWFya2VyKTtcbiAgICAgICAgICAgICAgY29uc3QgbSA9IC8oWy4/QF0pPyguKikvLmV4ZWMocmVhbE5hbWUpITtcbiAgICAgICAgICAgICAgcGFydHMucHVzaCh7XG4gICAgICAgICAgICAgICAgdHlwZTogQVRUUklCVVRFX1BBUlQsXG4gICAgICAgICAgICAgICAgaW5kZXg6IG5vZGVJbmRleCxcbiAgICAgICAgICAgICAgICBuYW1lOiBtWzJdLFxuICAgICAgICAgICAgICAgIHN0cmluZ3M6IHN0YXRpY3MsXG4gICAgICAgICAgICAgICAgY3RvcjpcbiAgICAgICAgICAgICAgICAgIG1bMV0gPT09ICcuJ1xuICAgICAgICAgICAgICAgICAgICA/IFByb3BlcnR5UGFydFxuICAgICAgICAgICAgICAgICAgICA6IG1bMV0gPT09ICc/J1xuICAgICAgICAgICAgICAgICAgICAgID8gQm9vbGVhbkF0dHJpYnV0ZVBhcnRcbiAgICAgICAgICAgICAgICAgICAgICA6IG1bMV0gPT09ICdAJ1xuICAgICAgICAgICAgICAgICAgICAgICAgPyBFdmVudFBhcnRcbiAgICAgICAgICAgICAgICAgICAgICAgIDogQXR0cmlidXRlUGFydCxcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgIChub2RlIGFzIEVsZW1lbnQpLnJlbW92ZUF0dHJpYnV0ZShuYW1lKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobmFtZS5zdGFydHNXaXRoKG1hcmtlcikpIHtcbiAgICAgICAgICAgICAgcGFydHMucHVzaCh7XG4gICAgICAgICAgICAgICAgdHlwZTogRUxFTUVOVF9QQVJULFxuICAgICAgICAgICAgICAgIGluZGV4OiBub2RlSW5kZXgsXG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAobm9kZSBhcyBFbGVtZW50KS5yZW1vdmVBdHRyaWJ1dGUobmFtZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIC8vIFRPRE8gKGp1c3RpbmZhZ25hbmkpOiBiZW5jaG1hcmsgdGhlIHJlZ2V4IGFnYWluc3QgdGVzdGluZyBmb3IgZWFjaFxuICAgICAgICAvLyBvZiB0aGUgMyByYXcgdGV4dCBlbGVtZW50IG5hbWVzLlxuICAgICAgICBpZiAocmF3VGV4dEVsZW1lbnQudGVzdCgobm9kZSBhcyBFbGVtZW50KS50YWdOYW1lKSkge1xuICAgICAgICAgIC8vIEZvciByYXcgdGV4dCBlbGVtZW50cyB3ZSBuZWVkIHRvIHNwbGl0IHRoZSB0ZXh0IGNvbnRlbnQgb25cbiAgICAgICAgICAvLyBtYXJrZXJzLCBjcmVhdGUgYSBUZXh0IG5vZGUgZm9yIGVhY2ggc2VnbWVudCwgYW5kIGNyZWF0ZVxuICAgICAgICAgIC8vIGEgVGVtcGxhdGVQYXJ0IGZvciBlYWNoIG1hcmtlci5cbiAgICAgICAgICBjb25zdCBzdHJpbmdzID0gKG5vZGUgYXMgRWxlbWVudCkudGV4dENvbnRlbnQhLnNwbGl0KG1hcmtlcik7XG4gICAgICAgICAgY29uc3QgbGFzdEluZGV4ID0gc3RyaW5ncy5sZW5ndGggLSAxO1xuICAgICAgICAgIGlmIChsYXN0SW5kZXggPiAwKSB7XG4gICAgICAgICAgICAobm9kZSBhcyBFbGVtZW50KS50ZXh0Q29udGVudCA9IHRydXN0ZWRUeXBlc1xuICAgICAgICAgICAgICA/ICh0cnVzdGVkVHlwZXMuZW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leX1gLCAoKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICh0aGlzIGFzIGFueSlbd2lkZ2V0S2V5XSA9IG1vZGVsLmdldChtb2RlbEtleSk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBAcHJvcGVydHkoKVxuICAgIHZpc2libGU6IGJvb2xlYW4gPSBmYWxzZTtcblxuICAgIHJlbmRlcigpIHtcbiAgICAgICAgcmV0dXJuIGh0bWxgXG4gICAgICAgICAgICA8ZGl2IGNsYXNzPVwiY29udGFpbmVyXCI+XG4gICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInJvd1wiPlxuICAgICAgICAgICAgICAgICAgICA8aW5wdXRcbiAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU9XCJjaGVja2JveFwiXG4gICAgICAgICAgICAgICAgICAgICAgICBjbGFzcz1cInZpc2liaWxpdHktY2hlY2tib3hcIlxuICAgICAgICAgICAgICAgICAgICAgICAgLmNoZWNrZWQ9XCIke3RoaXMudmlzaWJsZX1cIlxuICAgICAgICAgICAgICAgICAgICAgICAgQGNoYW5nZT1cIiR7dGhpcy5vbkxheWVyVmlzaWJpbGl0eUNoYW5nZWR9XCJcbiAgICAgICAgICAgICAgICAgICAgLz5cbiAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJsZWdhY3ktdGV4dCBhbGwtbGF5ZXJzLXRleHRcIj5BbGwgbGF5ZXJzIG9uL29mZjwvc3Bhbj5cbiAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgICA8c2xvdD48L3Nsb3Q+XG4gICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgYDtcbiAgICB9XG5cbiAgICB1cGRhdGVkKGNoYW5nZWRQcm9wZXJ0aWVzOiBhbnkpIHtcbiAgICAgICAgLy8gVXBkYXRlIHRoZSBtb2RlbCBwcm9wZXJ0aWVzIHNvIHRoZXkncmUgcmVm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HJvcGVydGllcyIsICJwcm9wZXJ0eSIsICJfIiwgImV2ZW50IiwgInRhcmdldCIsICJfX2RlY29yYXRlQ2xhc3MiLCAibiIsICJMYXllck1hbmFnZXIiLCAicmVuZGVyIiwgImVsIiwgIm1hbmFnZXIiLCAidXBkYXRlQ2hpbGRyZW4iLCAibGF5ZXJfbWFuYWdlcl9kZWZhdWx0Il0KfQo= diff --git a/geemap/static/layer_manager_row.css b/geemap/static/layer_manager_row.css new file mode 100644 index 0000000000..202059d823 --- /dev/null +++ b/geemap/static/layer_manager_row.css @@ -0,0 +1,2 @@ +@import"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined"; +/*# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFtdLAogICJzb3VyY2VzQ29udGVudCI6IFtdLAogICJtYXBwaW5ncyI6ICIiLAogICJuYW1lcyI6IFtdCn0K */ diff --git a/geemap/static/layer_manager_row.js b/geemap/static/layer_manager_row.js new file mode 100644 index 0000000000..ded592464a --- /dev/null +++ b/geemap/static/layer_manager_row.js @@ -0,0 +1,304 @@ +var _t=Object.defineProperty;var bt=Object.getOwnPropertyDescriptor;var w=(o,t,e,s)=>{for(var i=s>1?void 0:s?bt(t,e):t,n=o.length-1,r;n>=0;n--)(r=o[n])&&(i=(s?r(t,e,i):r(i))||i);return s&&i&&_t(t,e,i),i};var L=globalThis,z=L.ShadowRoot&&(L.ShadyCSS===void 0||L.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,W=Symbol(),it=new WeakMap,k=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==W)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(z&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=it.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&it.set(e,t))}return t}toString(){return this.cssText}},ot=o=>new k(typeof o=="string"?o:o+"",void 0,W),v=(o,...t)=>{let e=o.length===1?o[0]:t.reduce((s,i,n)=>s+(r=>{if(r._$cssResult$===!0)return r.cssText;if(typeof r=="number")return r;throw Error("Value passed to 'css' function must be a 'css' function result: "+r+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+o[n+1],o[0]);return new k(e,o,W)},J=(o,t)=>{if(z)o.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=L.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,o.appendChild(s)}},D=z?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return ot(e)})(o):o;var{is:At,defineProperty:xt,getOwnPropertyDescriptor:St,getOwnPropertyNames:wt,getOwnPropertySymbols:Et,getPrototypeOf:Ct}=Object,I=globalThis,nt=I.trustedTypes,Pt=nt?nt.emptyScript:"",kt=I.reactiveElementPolyfillSupport,R=(o,t)=>o,U={toAttribute(o,t){switch(t){case Boolean:o=o?Pt:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},V=(o,t)=>!At(o,t),rt={attribute:!0,type:String,converter:U,reflect:!1,hasChanged:V};Symbol.metadata??=Symbol("metadata"),I.litPropertyMetadata??=new WeakMap;var m=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=rt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&xt(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:n}=St(this.prototype,t)??{get(){return this[e]},set(r){this[e]=r}};return{get(){return i?.call(this)},set(r){let h=i?.call(this);n.call(this,r),this.requestUpdate(t,h,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??rt}static _$Ei(){if(this.hasOwnProperty(R("elementProperties")))return;let t=Ct(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(R("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(R("properties"))){let e=this.properties,s=[...wt(e),...Et(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(D(i))}else t!==void 0&&e.push(D(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return J(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let n=(s.converter?.toAttribute!==void 0?s.converter:U).toAttribute(e,s.type);this._$Em=t,n==null?this.removeAttribute(i):this.setAttribute(i,n),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let n=s.getPropertyOptions(i),r=typeof n.converter=="function"?{fromAttribute:n.converter}:n.converter?.fromAttribute!==void 0?n.converter:U;this._$Em=i,this[i]=r.fromAttribute(e,n.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??V)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,n]of this._$Ep)this[i]=n;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,n]of s)n.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],n)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};m.elementStyles=[],m.shadowRootOptions={mode:"open"},m[R("elementProperties")]=new Map,m[R("finalized")]=new Map,kt?.({ReactiveElement:m}),(I.reactiveElementVersions??=[]).push("2.0.4");var G=globalThis,q=G.trustedTypes,at=q?q.createPolicy("lit-html",{createHTML:o=>o}):void 0,ut="$lit$",g=`lit$${Math.random().toFixed(9).slice(2)}$`,mt="?"+g,Rt=`<${mt}>`,A=document,O=()=>A.createComment(""),N=o=>o===null||typeof o!="object"&&typeof o!="function",tt=Array.isArray,Ut=o=>tt(o)||typeof o?.[Symbol.iterator]=="function",K=`[ +\f\r]`,M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,lt=/-->/g,ht=/>/g,_=RegExp(`>|${K}(?:([^\\s"'>=/]+)(${K}*=${K}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`,"g"),ct=/'/g,dt=/"/g,ft=/^(?:script|style|textarea|title)$/i,et=o=>(t,...e)=>({_$litType$:o,strings:t,values:e}),st=et(1),qt=et(2),Bt=et(3),x=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),pt=new WeakMap,b=A.createTreeWalker(A,129);function gt(o,t){if(!tt(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return at!==void 0?at.createHTML(t):t}var Mt=(o,t)=>{let e=o.length-1,s=[],i,n=t===2?"":t===3?"":"",r=M;for(let h=0;h"?(r=i??M,l=-1):p[1]===void 0?l=-2:(l=r.lastIndex-p[2].length,d=p[1],r=p[3]===void 0?_:p[3]==='"'?dt:ct):r===dt||r===ct?r=_:r===lt||r===ht?r=M:(r=_,i=void 0);let f=r===_&&o[h+1].startsWith("/>")?" ":"";n+=r===M?a+Rt:l>=0?(s.push(d),a.slice(0,l)+ut+a.slice(l)+g+f):a+g+(l===-2?h:f)}return[gt(o,n+(o[e]||"")+(t===2?"":t===3?"":"")),s]},H=class o{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let n=0,r=0,h=t.length-1,a=this.parts,[d,p]=Mt(t,e);if(this.el=o.createElement(d,s),b.currentNode=this.el.content,e===2||e===3){let l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(i=b.nextNode())!==null&&a.length0){i.textContent=q?q.emptyScript:"";for(let f=0;f2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=c}_$AI(t,e=this,s,i){let n=this.strings,r=!1;if(n===void 0)t=E(this,t,e,0),r=!N(t)||t!==this._$AH&&t!==x,r&&(this._$AH=t);else{let h=t,a,d;for(t=n[0],a=0;a{let s=e?.renderBefore??t,i=s._$litPart$;if(i===void 0){let n=e?.renderBefore??null;s._$litPart$=i=new T(t.insertBefore(O(),n),n,void 0,e??{})}return i._$AI(o),i};var y=class extends m{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=yt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return x}};y._$litElement$=!0,y.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:y});var Nt=globalThis.litElementPolyfillSupport;Nt?.({LitElement:y});(globalThis.litElementVersions??=[]).push("4.1.0");var Ht={attribute:!0,type:String,converter:U,reflect:!1,hasChanged:V},Tt=(o=Ht,t,e)=>{let{kind:s,metadata:i}=e,n=globalThis.litPropertyMetadata.get(i);if(n===void 0&&globalThis.litPropertyMetadata.set(i,n=new Map),n.set(e.name,o),s==="accessor"){let{name:r}=e;return{set(h){let a=t.get.call(this);t.set.call(this,h),this.requestUpdate(r,a,o)},init(h){return h!==void 0&&this.P(r,void 0,o),h}}}if(s==="setter"){let{name:r}=e;return function(h){let a=this[r];t.call(this,h),this.requestUpdate(r,a,o)}}throw Error("Unsupported decorator location: "+s)};function S(o){return(t,e)=>typeof e=="object"?Tt(o,t,e):((s,i,n)=>{let r=i.hasOwnProperty(n);return i.constructor.createProperty(n,r?{...s,wrapped:!0}:s),r?Object.getOwnPropertyDescriptor(i,n):void 0})(o,t,e)}var $t=v` + .legacy-button { + align-items: center; + background-color: var(--jp-layout-color2); + border-width: 0; + box-shadow: none; + color: var(--jp-ui-font-color1); + cursor: pointer; + display: flex; + font-family: "Helvetica Neue", Arial, Helvetica, sans-serif; + font-size: var(--jp-widgets-font-size); + justify-content: center; + line-height: var(--jp-widgets-inline-height); + padding: 0; + } + + .legacy-button.primary { + background-color: var(--jp-brand-color1); + color: var(--jp-ui-inverse-font-color1); + } + + .legacy-button:hover:enabled, + .legacy-button:focus:enabled { + box-shadow: var(--jp-elevation-z2); + } + + .legacy-slider { + -webkit-appearance: none; + appearance: none; + background: var(--jp-layout-color3); + border-radius: 3px; + height: 4px; + outline: none; + } + + .legacy-slider::-webkit-slider-thumb, + .legacy-slider::-moz-range-thumb { + -moz-appearance: none; + -webkit-appearance: none; + appearance: none; + border-radius: 50%; + cursor: pointer; + height: var(--jp-widgets-slider-handle-size); + width: var(--jp-widgets-slider-handle-size); + } + + .legacy-text { + color: var(--jp-widgets-label-color); + font-family: "Helvetica Neue", Arial, Helvetica, sans-serif; + font-size: var(--jp-widgets-font-size); + height: var(--jp-widgets-inline-height); + line-height: var(--jp-widgets-inline-height); + } +`;var vt=v` + @font-face { + font-family: 'Material Symbols Outlined'; + font-style: normal; + font-weight: 400; + src: url(https://fonts.gstatic.com/s/materialsymbolsoutlined/v205/kJF1BvYX7BgnkSrUwT8OhrdQw4oELdPIeeII9v6oDMzByHX9rA6RzaxHMPdY43zj-jCxv3fzvRNU22ZXGJpEpjC_1v-p_4MrImHCIJIZrDCvHOejbd5zrDAt.woff2) format('woff2'); + } + + .material-symbols-outlined { + -webkit-font-feature-settings: 'liga'; + -webkit-font-smoothing: antialiased; + direction: ltr; + display: inline-block; + font-family: 'Material Symbols Outlined'; + font-style: normal; + font-weight: normal; + letter-spacing: normal; + line-height: 1; + text-transform: none; + white-space: nowrap; + word-wrap: normal; + } +`;var $=class $ extends y{constructor(){super(...arguments);this._model=void 0;this.name="";this.visible=!0;this.opacity=0;this.isLoading=!1;this.isConfirmDialogVisible=!1}static get componentName(){return"layer-manager-row"}static{this.styles=[$t,vt,v` + .row { + align-items: center; + display: flex; + gap: 4px; + height: 30px; + } + + .layer-name { + flex-grow: 1; + max-width: 150px; + overflow: hidden; + text-overflow: ellipsis; + } + + .settings-delete-button { + font-size: 14px; + height: 26px; + width: 26px; + } + + .layer-opacity-slider { + width: 70px; + } + + .layer-visibility-checkbox { + margin: 2px; + } + + .spinner { + -webkit-animation: spin 2s linear infinite; + animation: spin 2s linear infinite; + border-radius: 50%; + border: 4px solid var(--jp-widgets-input-border-color); + border-top: 4px solid var(--jp-widgets-color); + height: 12px; + width: 12px; + } + + @-webkit-keyframes spin { + 0% { -webkit-transform: rotate(0deg); } + 100% { -webkit-transform: rotate(360deg); } + } + + @keyframes spin { + 0% { transform: rotate(0deg); } + 100% { transform: rotate(360deg); } + } + + button.loading .spinner, + button.loading:hover .close-icon, + button.done-loading .close-icon { + display: block; + } + + button.loading .close-icon, + button.loading:hover .spinner, + button.done-loading .spinner { + display: none; + } + + .remove-layer-text { + flex-grow: 1; + } + + .confirm-deny-button { + height: 26px; + width: 70px; + } + `]}static{this.modelNameToViewName=new Map([["name","name"],["visible","visible"],["opacity","opacity"],["is_loading","isLoading"]])}set model(e){this._model=e;for(let[s,i]of $.modelNameToViewName)i&&(this[i]=e.get(s),e.on(`change:${s}`,()=>{this[i]=e.get(s)}))}render(){return st` +
+ + ${this.name} + + + +
+ ${this.renderConfirmDialog()} + `}renderConfirmDialog(){return this.isConfirmDialogVisible?st` +
+ Remove layer? + + +
+ `:c}updated(e){for(let[s,i]of e)this._model?.set(s,this[s]);this._model?.save_changes()}onLayerVisibilityChanged(e){let s=e.target;this.visible=s.checked}onLayerOpacityChanged(e){let s=e.target;this.opacity=parseFloat(s.value)}onSettingsClicked(e){this._model?.send({type:"click",id:"settings"})}onDeleteClicked(e){this.isConfirmDialogVisible=!0}confirmDeletion(e){this._model?.send({type:"click",id:"delete"})}cancelDeletion(e){this.isConfirmDialogVisible=!1}};w([S()],$.prototype,"name",2),w([S()],$.prototype,"visible",2),w([S()],$.prototype,"opacity",2),w([S()],$.prototype,"isLoading",2),w([S()],$.prototype,"isConfirmDialogVisible",2);var P=$;customElements.get(P.componentName)||customElements.define(P.componentName,P);function jt({model:o,el:t}){let e=document.createElement(P.componentName);e.model=o,t.appendChild(e)}var Ve={render:jt};export{P as LayerManagerRow,Ve as default}; +/*! Bundled license information: + +@lit/reactive-element/css-tag.js: + (** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/reactive-element.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +lit-html/lit-html.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +lit-element/lit-element.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +lit-html/is-server.js: + (** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/decorators/custom-element.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/decorators/property.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/decorators/state.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/decorators/event-options.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/decorators/base.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/decorators/query.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/decorators/query-all.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/decorators/query-async.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/decorators/query-assigned-elements.js: + (** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/decorators/query-assigned-nodes.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) +*/ +//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vbm9kZV9tb2R1bGVzL0BsaXQvcmVhY3RpdmUtZWxlbWVudC9zcmMvY3NzLXRhZy50cyIsICIuLi8uLi9ub2RlX21vZHVsZXMvQGxpdC9yZWFjdGl2ZS1lbGVtZW50L3NyYy9yZWFjdGl2ZS1lbGVtZW50LnRzIiwgIi4uLy4uL25vZGVfbW9kdWxlcy9saXQtaHRtbC9zcmMvbGl0LWh0bWwudHMiLCAiLi4vLi4vbm9kZV9tb2R1bGVzL2xpdC1lbGVtZW50L3NyYy9saXQtZWxlbWVudC50cyIsICIuLi8uLi9ub2RlX21vZHVsZXMvQGxpdC9yZWFjdGl2ZS1lbGVtZW50L3NyYy9kZWNvcmF0b3JzL3Byb3BlcnR5LnRzIiwgIi4uLy4uL2pzL2lweXdpZGdld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ZGV4LFxuICAgICAgICAgICAgICAgIG5hbWU6IG1bMl0sXG4gICAgICAgICAgICAgICAgc3RyaW5nczogc3RhdGljcyxcbiAgICAgICAgICAgICAgICBjdG9yOlxuICAgICAgICAgICAgICAgICAgbVsxXSA9PT0gJy4nXG4gICAgICAgICAgICAgICAgICAgID8gUHJvcGVydHlQYXJ0XG4gICAgICAgICAgICAgICAgICAgIDogbVsxXSA9PT0gJz8nXG4gICAgICAgICAgICAgICAgICAgICAgPyBCb29sZWFuQXR0cmlidXRlUGFydFxuICAgICAgICAgICAgICAgICAgICAgIDogbVsxXSA9PT0gJ0AnXG4gICAgICAgICAgICAgICAgICAgICAgICA/IEV2ZW50UGFydFxuICAgICAgICAgICAgICAgICAgICAgICAgOiBBdHRyaWJ1dGVQYXJ0LFxuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgKG5vZGUgYXMgRWxlbWVudCkucmVtb3ZlQXR0cmlidXRlKG5hbWUpO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChuYW1lLnN0YXJ0c1dpdGgobWFya2VyKSkge1xuICAgICAgICAgICAgICBwYXJ0cy5wdXNoKHtcbiAgICAgICAgICAgICAgICB0eXBlOiBFTEVNRU5UX1BBUlQsXG4gICAgICAgICAgICAgICAgaW5kZXg6IG5vZGVJbmRleCxcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgIChub2RlIGFzIEVsZW1lbnQpLnJlbW92ZUF0dHJpYnV0ZShuYW1lKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgLy8gVE9ETyAoanVzdGluZmFnbmFuaSk6IGJlbmNobWFyayB0aGUgcmVnZXggYWdhaW5zdCB0ZXN0aW5nIGZvciBlYWNoXG4gICAgICAgIC8vIG9mIHRoZSAzIHJhdyB0ZXh0IGVsZW1lbnQgbmFtZXMuXG4gICAgICAgIGlmIChyYXdUZXh0RWxlbWVudC50ZXN0KChub2RlIGFzIEVsZW1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gpITtcbiAgICBsZXQgbm9kZUluZGV4ID0gMDtcbiAgICBsZXQgcGFydEluZGV4ID0gMDtcbiAgICBsZXQgdGVtcGxhdGVQYXJ0ID0gcGFydHNbMF07XG5cbiAgICB3aGlsZSAodGVtcGxhdGVQYXJ0ICE9PSB1bmRlZmluZWQpIHtcbiAgICAgIGlmIChub2RlSW5kZXggPT09IHRlbXBsYXRlUGFydC5pbmRleCkge1xuICAgICAgICBsZXQgcGFydDogUGFydCB8IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHRlbXBsYXRlUGFydC50eXBlID09PSBDSElMRF9QQVJUKSB7XG4gICAgICAgICAgcGFydCA9IG5ldyBDaGlsZFBhcnQoXG4gICAgICAgICAgICBub2RlIGFzIEhUTUxFbGVtZW50LFxuICAgICAgICAgICAgbm9kZS5uZXh0U2libGluZyxcbiAgICAgICAgICAgIHRoaXMsXG4gICAgICAgICAgICBvcHRpb25zLFxuICAgICAgICAgICk7XG4gICAgICAgIH0gZWxzZSBpZiAodGVtcGxhdGVQYXJ0LnR5cGUgPT09IEFUVFJJQlVURV9QQVJUKSB7XG4gICAgICAgICAgcGFydCA9IG5ldyB0ZW1wbGF0ZVBhcnQuY3RvcihcbiAgICAgICAgICAgIG5vZGUgYXMgSFRNTEVsZW1lbnQsXG4gICAgICAgICAgICB0ZW1wbGF0ZVBhcnQubmFtZSxcbiAgICAgICAgICAgIHRlbXBsYXRlUGFydC5zdHJpbmdzLFxuICAgICAgICAgICAgdGhpcyxcbiAgICAgICAgICAgIG9wdGlvbnMsXG4gICAgICAgICAgKTtcbiAgICAgICAgfSBlbHNlIGlmICh0ZW1wbGF0ZVBhcnQudHlwZSA9PT0gRUxFTUVOVF9QQVJUKSB7XG4gICAgICAgICAgcGFydCA9IG5ldyBFbGVtZW50UGFydChub2RlIGFzIEhUTUxFbGVtZW50LCB0aGlzLCBvcHRpb25zKTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLl8kcGFydHMucHVzaChwYXJ0KTtc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tZW50IHtcbiAgICBzdGF0aWMgZ2V0IGNvbXBvbmVudE5hbWUoKSB7XG4gICAgICAgIHJldHVybiBgbGF5ZXItbWFuYWdlci1yb3dgO1xuICAgIH1cblxuICAgIHN0YXRpYyBzdHlsZXMgPSBbXG4gICAgICAgIGxlZ2FjeVN0eWxlcyxcbiAgICAgICAgbWF0ZXJpYWxTdHlsZXMsXG4gICAgICAgIGNzc2BcbiAgICAgICAgICAgIC5yb3cge1xuICAgICAgICAgICAgICAgIGFsaWduLWl0ZW1zOiBjZW50ZXI7XG4gICAgICAgICAgICAgICAgZGlzcGxheTogZmxleDtcbiAgICAgICAgICAgICAgICBnYXA6IDRweDtcbiAgICAgICAgICAgICAgICBoZWlnaHQ6IDMwcHg7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC5sYXllci1uYW1lIHtcbiAgICAgICAgICAgICAgICBmbGV4LWdyb3c6IDE7XG4gICAgICAgICAgICAgICAgbWF4LXdpZHRoOiAxNTBweDtcbiAgICAgICAgICAgICAgICBvdmVyZmxvdzogaGlkZGVuO1xuICAgICAgICAgICAgICAgIHRleHQtb3ZlcmZsb3c6IGVsbGlwc2lzO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAuc2V0dGluZ3MtZGVsZXRlLWJ1dHRvbiB7XG4gICAgICAgICAgICAgICAgZm9udC1zaXplOiAxNHB4O1xuICAgICAgICAgICAgICAgIGhlaWdodDogMjZweDtcbiAgICAgICAgICAgICAgICB3aWR0aDogMjZweDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLmxheWVyLW9wYWNpdHktc2xpZGVyIHtcbiAgICAgICAgICAgICAgICB3aWR0aDogNzBweDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLmxheWVyLXZpc2liaWxpdHktY2hlY2tib3gge1xuICAgICAgICAgICAgICAgIG1hcmdpbjogMnB4O1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAuc3Bpbm5lciB7XG4gICAgICAgICAgICAgICAgLXdlYmtpdC1hbmltYXRpb246IHNwaW4gMnMgbGluZWFyIGluZmluaXRlO1xuICAgICAgICAgICAgICAgIGFuaW1hdGlvbjogc3BpbiAycyBsaW5lYXIgaW5maW5pdGU7XG4gICAgICAgICAgICAgICAgYm9yZGVyLXJhZGl1czogNTAlO1xuICAgICAgICAgICAgICAgIGJvcmRlcjogNHB4IHNvbGlkIHZhcigtLWpwLXdpZGdldHMtaW5wdXQtYm9yZGVyLWNvbG9yKTtcbiAgICAgICAgICAgICAgICBib3JkZXItdG9wOiA0cHggc29saWQgdmFyKC0tanAtd2lkZ2V0cy1jb2xvcik7XG4gICAgICAgICAgICAgICAgaGVpZ2h0OiAxMnB4O1xuICAgICAgICAgICAgICAgIHdpZHRoOiAxMnB4O1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBALXdlYmtpdC1rZXlmcmFtZXMgc3BpbiB7XG4gICAgICAgICAgICAgICAgMCUgeyAtd2Via2l0LXRyYW5zZm9ybTogcm90YXRlKDBkZWcpOyB9XG4gICAgICAgICAgICAgICAgMTAwJSB7IC13ZWJraXQtdHJhbnNmb3JtOiByb3RhdGUoMzYwZGVnKTsgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBAa2V5ZnJhbWVzIHNwaW4ge1xuICAgICAgICAgICAgICAgIDAlIHsgdHJhbnNmb3JtOiByb3RhdGUoMGRlZyk7IH1cbiAgICAgICAgICAgICAgICAxMDAlIHsgdHJhbnNmb3JtOiByb3RhdGUoMzYwZGVnKTsgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIFxuICAgICAgICAgICAgYnV0dG9uLmxvYWRpbmcgLnNwaW5uZXIsXG4gICAgICAgICAgICBidXR0b24ubG9hZGluZzpob3ZlciAuY2xvc2UtaWNvbixcbiAgICAgICAgICAgIGJ1dHRvbi5kb25lLWxvYWRpbmcgLmNsb3NlLWljb24ge1xuICAgICAgICAgICAgICAgIGRpc3BsYXk6IGJsb2NrO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBidXR0b24ubG9hZGluZyAuY2xvc2UtaWNvbixcbiAgICAgICAgICAgIGJ1dHRvbi5sb2FkaW5nOmhvdmVyIC5zcGlubmVyLFxuICAgICAgICAgICAgYnV0dG9uLmRvbmUtbG9hZGluZyAuc3Bpbm5lciB7XG4gICAgICAgICAgICAgICAgZGlzcGxheTogbm9uZTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLnJlbW92ZS1sYXllci10ZXh0IHtcbiAgICAgICAgICAgICAgICBmbGV4LWdyb3c6IDE7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC5jb25maXJtLWRlbnktYnV0dG9uIHtcbiAgICAgICAgICAgICAgICBoZWlnaHQ6IDI2cHg7XG4gICAgICAgICAgICAgICAgd2lkdGg6IDcwcHg7XG4gICAgICAgICAgICB9XG4gICAgICAgIGAsXG4gICAgXTtcblxuICAgIHByaXZhdGUgX21vZGVsOiBBbnlNb2RlbDxMYXllck1hbmFnZXJSb3dNb2RlbD4gfCB1bmRlZmluZWQgPSB1bmRlZmluZWQ7XG4gICAgcHJpdmF0ZSBzdGF0aWMgbW9kZWxOYW1lVG9WaWV3TmFtZSA9IG5ldyBNYXA8a2V5b2YgTGF5ZXJNYW5hZ2VyUm93TW9kZWwsIGtleW9mIExheWVyTWFuYWdlclJvdyB8IG51bGw+KFtcbiAgICAgICAgW1wibmFtZVwiLCBcIm5hbWVcIl0sXG4gICAgICAgIFtcInZpc2libGVcIiwgXCJ2aXNpYmxlXCJdLFxuICAgICAgICBbXCJvcGFjaXR5XCIsIFwib3BhY2l0eVwiXSxcbiAgICAgICAgW1wiaXNfbG9hZGluZ1wiLCBcImlzTG9hZGluZ1wiXSxcbiAgICBdKTtcblxuICAgIHNldCBtb2RlbChtb2RlbDogQW55TW9kZWw8TGF5ZXJNYW5hZ2VyUm93TW9kZWw+KSB7XG4gICAgICAgIHRoaXMuX21vZGVsID0gbW9kZWw7XG4gICAgICAgIGZvciAoY29uc3QgW21vZGVsS2V5LCB3aWRnZXRLZXldIG9mIExheWVyTWFuYWdlclJvdy5tb2RlbE5hbWVUb1ZpZXdOYW1lKSB7XG4gICAgICAgICAgICBpZiAod2lkZ2V0S2V5KSB7XG4gICAgICAgICAgICAgICAgLy8gR2V0IGluaXRpYWwgdmFsdWVzIGZyb20gdGhlIFB5dGhvbiBtb2RlbC5cbiAgICAgICAgICAgICAgICAodGhpcyBhcyBhbnkpW3dpZGdldEtleV0gPSBtb2RlbC5nZXQobW9kZWxLZXkpO1xuICAgICAgICAgICAgICAgIC8vIExpc3RlbiBmb3IgdXBkYXRlcyB0byB0aGUgbW9kZWwuXG4gICAgICAgICAgICAgICAgbW9kZWwub24oYGNoYW5nZToke21vZGVsS2V5fWAsICgpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgKHRoaXMgYXMgYW55KVt3aWRnZXRLZXldID0gbW9kZWwuZ2V0KG1vZGVsS2V5KTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIEBwcm9wZXJ0eSgpXG4gICAgbmFtZTogc3RyaW5nID0gXCJcIjtcblxuICAgIEBwcm9wZXJ0eSgpXG4gICAgdmlzaWJsZTogYm9vbGVhbiA9IHRydWU7XG5cbiAgICBAcHJvcGVydHkoKVxuICAgIG9wYWNpdHk6IG51bWJlciA9IDA7XG5cbiAgICBAcHJvcGVydHkoKVxuICAgIGlzTG9hZGluZzogYm9vbGVhbiA9IGZhbHNlO1xuXG4gICAgQHByb3BlcnR5KClcbiAgICBpc0NvbmZpcm1EaWFsb2dWaXNpYmxlOiBib29sZWFuID0gZmFsc2U7XG5cbiAgICByZW5kZXIoKTogVGVtcGxhdGVSZXN1bHQge1xuICAgICAgICByZXR1cm4gaHRtbGBcbiAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJyb3dcIj5cbiAgICAgICAgICAgICAgICA8aW5wdXRcbiAgICAgICAgICAgICAgICAgICAgdHlwZT1cImNoZWNrYm94XCJcbiAgICAgICAgICAgICAgICAgICAgY2xhc3M9XCJsYXllci12aXNpYmlsaXR5LWNoZWNrYm94XCJcbiAgICAgICAgICAgICAgICAgICAgLmNoZWNrZWQ9XCIke3RoaXMudmlzaWJsZX1cIlxuICAgICAgICAgICAgICAgICAgICBAY2hhbmdlPVwiJHt0aGlzLm9uTGF5ZXJWaXNpYmlsaXR5Q2hhbmdlZH1cIlxuICAgICAgICAgICAgICAgIC8+XG4gICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJsZWdhY3ktdGV4dCBsYXllci1uYW1lXCI+JHt0aGlzLm5hbWV9PC9zcGFuPlxuICAgICAgICAgICAgICAgIDxpbnB1dFxuICAgICAgICAgICAgICAgICAgICB0eXBlPVwicmFuZ2VcIlxuICAgICAgICAgICAgICAgICAgICBjbGFzcz1cImxlZ2FjeS1zbGlkZXIgbGF5ZXItb3BhY2l0eS1zbGlkZXJcIlxuICAgICAgICAgICAgICAgICAgICBtaW49XCIwXCJcbiAgICAgICAgICAgICAgICAgICAgbWF4PVwiMVwiXG4gICAgICAgICAgICAgICAgICAgIHN0ZXA9XCIwLjAxXCJcbiAgICAgICAgICAgICAgICAgICAgLnZhbHVlPVwiJHt0aGlzLm9wYWNpdHl9XCJcbiAgICAgICAgICAgICAgICAgICAgQGlucHV0PVwiJHt0aGlzLm9uTGF5ZXJPcGFjaXR5Q2hhbmdlZH1cIlxuICAgICAgICAgICAgICAgIC8+XG4gICAgICAgICAgICAgICAgPGJ1dHRvblxuICAgICAgICAgICAgICAgICAgICBjbGFzcz1cImxlZ2FjeS1idXR0b24gc2V0dGluZ3MtZGVsZXRlLWJ1dHRvblwiXG4gICAgICAgICAgICAgICAgICAgIEBjbGljaz1cIiR7dGhpcy5vblNldHRpbmdzQ2xpY2tlZH1cIlxuICAgICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJtYXRlcmlhbC1zeW1ib2xzLW91dGxpbmVkXCI+JiN4ZThiODs8L3NwYW4+XG4gICAgICAgICAgICAgICAgPC9idXR0b24+XG4gICAgICAgICAgICAgICAgPGJ1dHRvblxuICAgICAgICAgICAgICAgICAgICBjbGFzcz1cImxlZ2FjeS1idXR0b24gc2V0dGluZ3MtZGVsZXRlLWJ1dHRvbiAke3RoaXMuaXNMb2FkaW5nID8gJ2xvYWRpbmcnIDogJ2RvbmUtbG9hZGluZyd9XCJcbiAgICAgICAgICAgICAgICAgICAgQGNsaWNrPVwiJHt0aGlzLm9uRGVsZXRlQ2xpY2tlZH1cIlxuICAgICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInNwaW5uZXJcIj48L2Rpdj5cbiAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJjbG9zZS1pY29uIG1hdGVyaWFsLXN5bWJvbHMtb3V0bGluZWRcIj4mI3hlNWNkOzwvc3Bhbj5cbiAgICAgICAgICAgICAgICA8L2J1dHRvbj5cbiAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgJHt0aGlzLnJlbmRlckNvbmZpcm1EaWFsb2coKX1cbiAgICAgICAgYDtcbiAgICB9XG5cbiAgICBwcml2YXRlIHJlbmRlckNvbmZpcm1EaWFsb2coKTogVGVtcGxhdGVSZXN1bHQgfCB2b2lkIHtcbiAgICAgICAgaWYgKCF0aGlzLmlzQ29uZmlybURpYWxvZ1Zpc2libGUpIHtcbiAgICAgICAgICAgIHJldHVybiBub3RoaW5nO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBodG1sYFxuICAgICAgICAgICAgPGRpdiBjbGFzcz1cInJvd1wiPlxuICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwibGVnYWN5LXRleHQgcmVtb3ZlLWxheWVyLXRleHRcIj5SZW1vdmUgbGF5ZXI/PC9zcGFuPlxuICAgICAgICAgICAgICAgICAgICA8YnV0dG9uXG4gICAgICAgICAgICAgICAgICAgICAgICBjbGFzcz1cImxlZ2FjeS1idXR0b24gcHJpbWFyeSBjb25maXJtLWRlbnktYnV0dG9uXCJcbiAgICAgICAgICAgICAgICAgICAgICAgIEBjbGljaz1cIiR7dGhpcy5jb25maXJtRGVsZXRpb259XCJcbiAgICAgICAgICAgICAgICAgICAgPlxuICAgICAgICAgICAgICAgICAgICAgICAgWWVzXG4gICAgICAgICAgICAgICAgICAgIDwvYnV0dG9uPlxuICAgICAgICAgICAgICAgICAgICA8YnV0dG9uXG4gICAgICAgICAgICAgICAgICAgICAgICBjbGFzcz1cImxlZ2FjeS1idXR0b24gcHJpbWFyeSBjb25maXJtLWRlbnktYnV0dG9uXCJcbiAgICAgICAgICAgICAgICAgICAgICAgIEBjbGljaz1cIiR7dGhpcy5jYW5jZWxEZWxldGlvbn1cIlxuICAgICAgICAgICAgICAgICAgICA+XG4gICAgICAgICAgICAgICAgICAgICAgICBOb1xuICAgICAgICAgICAgICAgICAgICA8L2J1dHRvbj5cbiAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICBgO1xuICAgIH1cblxuICAgIHVwZGF0ZWQoY2hhbmdlZFByb3BlcnRpZXM6IGFueSkge1xuICAgICAgICAvLyBVcGRhdGUgdGhlIG1vZGVsIHByb3BlcnRpZXMgc28gdGhleSdyZSByZWZsZWN0ZWQgaW4gUHl0aG9uLlxuICAgICAgICBmb3IgKGNvbnN0IFtwcm9wZXJ0eSwgX10gb2YgY2hhbmdlZFByb3BlcnRpZXMpIHtcbiAgICAgICAgICAgIHRoaXMuX21vZGVsPy5zZXQocHJvcGVydHksIHRoaXNbcHJvcGVydHkgYXMga2V5b2YgTGF5ZXJNYW5hZ2VyUm93XSk7XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5fbW9kZWw/LnNhdmVfY2hhbmdlcygpO1xuICAgIH1cblxuICAgIHByaXZhdGUgb25MYXllclZpc2liaWxpdHlDaGFuZ2VkKGV2ZW50OiBFdmVudCkge1xuICAgICAgICB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PYmplY3QiLCAiZ2V0T3duUHJvcGVydHlEZXNjcmlwdG9yIiwgImxlZ2FjeVN0eWxlcyIsICJpIiwgIm1hdGVyaWFsU3R5bGVzIiwgImkiLCAiX0xheWVyTWFuYWdlclJvdyIsICJoIiwgImxlZ2FjeVN0eWxlcyIsICJtYXRlcmlhbFN0eWxlcyIsICJpIiwgIm1vZGVsIiwgIm1vZGVsS2V5IiwgIndpZGdldEtleSIsICJrZSIsICJEIiwgImNoYW5nZWRQcm9wZXJ0aWVzIiwgInByb3BlcnR5IiwgIl8iLCAiZXZlbnQiLCAidGFyZ2V0IiwgIl9fZGVjb3JhdGVDbGFzcyIsICJuIiwgIkxheWVyTWFuYWdlclJvdyIsICJyZW5kZXIiLCAiZWwiLCAicm93IiwgImxheWVyX21hbmFnZXJfcm93X2RlZmF1bHQiXQp9Cg== diff --git a/geemap/static/material_styles.js b/geemap/static/material_styles.js new file mode 100644 index 0000000000..7207557d14 --- /dev/null +++ b/geemap/static/material_styles.js @@ -0,0 +1,63 @@ +var R=globalThis,T=R.ShadowRoot&&(R.ShadyCSS===void 0||R.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,L=Symbol(),F=new WeakMap,b=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==L)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(T&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=F.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&F.set(e,t))}return t}toString(){return this.cssText}},Q=o=>new b(typeof o=="string"?o:o+"",void 0,L),z=(o,...t)=>{let e=o.length===1?o[0]:t.reduce((s,i,r)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+o[r+1],o[0]);return new b(e,o,L)},I=(o,t)=>{if(T)o.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=R.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,o.appendChild(s)}},M=T?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return Q(e)})(o):o;var{is:pt,defineProperty:ut,getOwnPropertyDescriptor:$t,getOwnPropertyNames:ft,getOwnPropertySymbols:_t,getPrototypeOf:mt}=Object,N=globalThis,Y=N.trustedTypes,At=Y?Y.emptyScript:"",gt=N.reactiveElementPolyfillSupport,w=(o,t)=>o,j={toAttribute(o,t){switch(t){case Boolean:o=o?At:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},tt=(o,t)=>!pt(o,t),G={attribute:!0,type:String,converter:j,reflect:!1,hasChanged:tt};Symbol.metadata??=Symbol("metadata"),N.litPropertyMetadata??=new WeakMap;var $=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=G){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&ut(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:r}=$t(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i?.call(this)},set(n){let p=i?.call(this);r.call(this,n),this.requestUpdate(t,p,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??G}static _$Ei(){if(this.hasOwnProperty(w("elementProperties")))return;let t=mt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(w("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(w("properties"))){let e=this.properties,s=[...ft(e),..._t(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(M(i))}else t!==void 0&&e.push(M(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return I(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let r=(s.converter?.toAttribute!==void 0?s.converter:j).toAttribute(e,s.type);this._$Em=t,r==null?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let r=s.getPropertyOptions(i),n=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute!==void 0?r.converter:j;this._$Em=i,this[i]=n.fromAttribute(e,r.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??tt)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,r]of this._$Ep)this[i]=r;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,r]of s)r.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],r)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[w("elementProperties")]=new Map,$[w("finalized")]=new Map,gt?.({ReactiveElement:$}),(N.reactiveElementVersions??=[]).push("2.0.4");var K=globalThis,k=K.trustedTypes,et=k?k.createPolicy("lit-html",{createHTML:o=>o}):void 0,ht="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,at="?"+_,yt=`<${at}>`,g=document,x=()=>g.createComment(""),P=o=>o===null||typeof o!="object"&&typeof o!="function",X=Array.isArray,vt=o=>X(o)||typeof o?.[Symbol.iterator]=="function",B=`[ +\f\r]`,C=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,st=/-->/g,it=/>/g,m=RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`,"g"),ot=/'/g,rt=/"/g,lt=/^(?:script|style|textarea|title)$/i,Z=o=>(t,...e)=>({_$litType$:o,strings:t,values:e}),Ut=Z(1),Ht=Z(2),Ot=Z(3),y=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),nt=new WeakMap,A=g.createTreeWalker(g,129);function ct(o,t){if(!X(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return et!==void 0?et.createHTML(t):t}var St=(o,t)=>{let e=o.length-1,s=[],i,r=t===2?"":t===3?"":"",n=C;for(let p=0;p"?(n=i??C,a=-1):d[1]===void 0?a=-2:(a=n.lastIndex-d[2].length,l=d[1],n=d[3]===void 0?m:d[3]==='"'?rt:ot):n===rt||n===ot?n=m:n===st||n===it?n=C:(n=m,i=void 0);let f=n===m&&o[p+1].startsWith("/>")?" ":"";r+=n===C?h+yt:a>=0?(s.push(l),h.slice(0,a)+ht+h.slice(a)+_+f):h+_+(a===-2?p:f)}return[ct(o,r+(o[e]||"")+(t===2?"":t===3?"":"")),s]},U=class o{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let r=0,n=0,p=t.length-1,h=this.parts,[l,d]=St(t,e);if(this.el=o.createElement(l,s),A.currentNode=this.el.content,e===2||e===3){let a=this.el.content.firstChild;a.replaceWith(...a.childNodes)}for(;(i=A.nextNode())!==null&&h.length0){i.textContent=k?k.emptyScript:"";for(let f=0;f2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=c}_$AI(t,e=this,s,i){let r=this.strings,n=!1;if(r===void 0)t=v(this,t,e,0),n=!P(t)||t!==this._$AH&&t!==y,n&&(this._$AH=t);else{let p=t,h,l;for(t=r[0],h=0;h{let s=e?.renderBefore??t,i=s._$litPart$;if(i===void 0){let r=e?.renderBefore??null;s._$litPart$=i=new H(t.insertBefore(x(),r),r,void 0,e??{})}return i._$AI(o),i};var E=class extends ${constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=dt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return y}};E._$litElement$=!0,E.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:E});var bt=globalThis.litElementPolyfillSupport;bt?.({LitElement:E});(globalThis.litElementVersions??=[]).push("4.1.0");var Jt=z` + @font-face { + font-family: 'Material Symbols Outlined'; + font-style: normal; + font-weight: 400; + src: url(https://fonts.gstatic.com/s/materialsymbolsoutlined/v205/kJF1BvYX7BgnkSrUwT8OhrdQw4oELdPIeeII9v6oDMzByHX9rA6RzaxHMPdY43zj-jCxv3fzvRNU22ZXGJpEpjC_1v-p_4MrImHCIJIZrDCvHOejbd5zrDAt.woff2) format('woff2'); + } + + .material-symbols-outlined { + -webkit-font-feature-settings: 'liga'; + -webkit-font-smoothing: antialiased; + direction: ltr; + display: inline-block; + font-family: 'Material Symbols Outlined'; + font-style: normal; + font-weight: normal; + letter-spacing: normal; + line-height: 1; + text-transform: none; + white-space: nowrap; + word-wrap: normal; + } +`;export{Jt as materialStyles}; +/*! Bundled license information: + +@lit/reactive-element/css-tag.js: + (** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/reactive-element.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +lit-html/lit-html.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +lit-element/lit-element.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +lit-html/is-server.js: + (** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) +*/ +//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vbm9kZV9tb2R1bGVzL0BsaXQvcmVhY3RpdmUtZWxlbWVudC9zcmMvY3NzLXRhZy50cyIsICIuLi8uLi9ub2RlX21vZHVsZXMvQGxpdC9yZWFjdGl2ZS1lbGVtZW50L3NyYy9yZWFjdGl2ZS1lbGVtZW50LnRzIiwgIi4uLy4uL25vZGVfbW9kdWxlcy9saXQtaHRtbC9zcmMvbGl0LWh0bWwudHMiLCAiLi4vLi4vbm9kZV9tb2R1bGVzL2xpdC1lbGVtZW50L3NyYy9saXQtZWxlbWVudC50cyIsICIuLi8uLi9qcy9tYXRlcmlhbF9zdHlsZXMudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbIi8qKlxuICogQGxpY2Vuc2VcbiAqIENvcHlyaWdodCAyMDE5IEdvb2dsZSBMTENcbiAqIFNQRFgtTGljZW5zZS1JZGVudGlmaWVyOiBCU0QtMy1DbGF1c2VcbiAqL1xuXG5jb25zdCBOT0RFX01PREUgPSBmYWxzZTtcblxuLy8gQWxsb3dzIG1pbmlmaWVycyB0byBy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mFtZXNbYXR0ck5hbWVJbmRleCsrXTtcbiAgICAgICAgICAgICAgY29uc3QgdmFsdWUgPSAobm9kZSBhcyBFbGVtZW50KS5nZXRBdHRyaWJ1dGUobmFtZSkhO1xuICAgICAgICAgICAgICBjb25zdCBzdGF0aWNzID0gdmFsdWUuc3BsaXQobWFya2VyKTtcbiAgICAgICAgICAgICAgY29uc3QgbSA9IC8oWy4/QF0pPyguKikvLmV4ZWMocmVhbE5hbWUpITtcbiAgICAgICAgICAgICAgcGFydHMucHVzaCh7XG4gICAgICAgICAgICAgICAgdHlwZTogQVRUUklCVVRFX1BBUlQsXG4gICAgICAgICAgICAgICAgaW5kZXg6IG5vZGVJbmRleCxcbiAgICAgICAgICAgICAgICBuYW1lOiBtWzJdLFxuICAgICAgICAgICAgICAgIHN0cmluZ3M6IHN0YXRpY3MsXG4gICAgICAgICAgICAgICAgY3RvcjpcbiAgICAgICAgICAgICAgICAgIG1bMV0gPT09ICcuJ1xuICAgICAgICAgICAgICAgICAgICA/IFByb3BlcnR5UGFydFxuICAgICAgICAgICAgICAgICAgICA6IG1bMV0gPT09ICc/J1xuICAgICAgICAgICAgICAgICAgICAgID8gQm9vbGVhbkF0dHJpYnV0ZVBhcnRcbiAgICAgICAgICAgICAgICAgICAgICA6IG1bMV0gPT09ICdAJ1xuICAgICAgICAgICAgICAgICAgICAgICAgPyBFdmVudFBhcnRcbiAgICAgICAgICAgICAgICAgICAgICAgIDogQXR0cmlidXRlUGFydCxcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgIChub2RlIGFzIEVsZW1lbnQpLnJlbW92ZUF0dHJpYnV0ZShuYW1lKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobmFtZS5zdGFydHNXaXRoKG1hcmtlcikpIHtcbiAgICAgICAgICAgICAgcGFydHMucHVzaCh7XG4gICAgICAgICAgICAgICAgdHlwZTogRUxFTUVOVF9QQVJULFxuICAgICAgICAgICAgICAgIGluZGV4OiBub2RlSW5kZXg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SA9PT0gJ1NDUklQVCcpIHtcbiAgICAgICAgICBsZXQgbWVzc2FnZSA9ICdGb3JiaWRkZW4nO1xuICAgICAgICAgIGlmIChERVZfTU9ERSkge1xuICAgICAgICAgICAgaWYgKHBhcmVudE5vZGVOYW1lID09PSAnU1RZTEUnKSB7XG4gICAgICAgICAgICAgIG1lc3NhZ2UgPVxuICAgICAgICAgICAgICAgIGBMaXQgZG9lcyBub3Qgc3VwcG9ydCBiaW5kaW5nIGluc2lkZSBzdHlsZSBub2Rlcy4gYCArXG4gICAgICAgICAgICAgICAgYFRoaXMgaXMgYSBzZWN1cml0eSByaXNrLCBhcyBzdHlsZSBpbmplY3Rpb24gYXR0YWNrcyBjYW4gYCArXG4gICAgICAgICAgICAgICAgYGV4ZmlsdHJhdGUgZGF0YSBhbmQgc3Bvb2YgVUlzLiBgICtcbiAgICAgICAgICAgICAgICBgQ29uc2lkZXIgaW5zdGVhZCB1c2luZyBjc3NcXGAuLi5cXGAgbGl0ZXJhbHMgYCArXG4gICAgICAgICAgICAgICAgYHRvIGNvbXBvc2Ugc3R5bGVzLCBhbmQgZG8gZHluYW1pYyBzdHlsaW5nIHdpdGggYCArXG4gICAgICAgICAgICAgICAgYGNzcyBjdXN0b20gcHJvcGVydGllcywgOjpwYXJ0cywgPHNsb3Q+cywgYCArXG4gICAgICAgICAgICAgICAgYGFuZCBieSBtdXRhdGluZyB0aGUgRE9NIHJhdGhlciB0aGFuIHN0eWxlc2hlZXRzLmA7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBtZXNzYWdlID1cbiAgICAgICAgICAgICAgICBgTGl0IGRvZXMgbm90IHN1cHBvcnQgYmluZGluZyBpbnNpZGUgc2NyaXB0IG5vZGVzLiBgICtcbiAgICAgICAgICAgICAgICBgVGhpcyBpcyBhIHNlY3VyaXR5IHJpc2ssIGFzIGl0IGNvdWxkIGFsbG93IGFyYml0cmFyeSBgICtcbiAgICAgICAgICAgICAgICBgY29kZSBleGVjd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VudFBvbHlmaWxsU3VwcG9ydCIsICJnbG9iYWxUaGlzIiwgImxpdEVsZW1lbnRWZXJzaW9ucyIsICJwdXNoIiwgIm1hdGVyaWFsU3R5bGVzIiwgImkiXQp9Cg== diff --git a/geemap/static/utils.js b/geemap/static/utils.js new file mode 100644 index 0000000000..103d8fd56d --- /dev/null +++ b/geemap/static/utils.js @@ -0,0 +1,2 @@ +async function d(e,i){return Promise.all(e.map(t=>i.get_model(t.slice(10))))}async function l(e,i){let t=i.get("children"),a=await d(t,i.widget_manager),r=await Promise.all(a.map(n=>n.widget_manager.create_view(n)));e.innerHTML="";for(let n of r)e.appendChild(n.el)}export{l as updateChildren}; +//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vanMvdXRpbHMudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImltcG9ydCB0eXBlIHsgQW55TW9kZWwgfSBmcm9tIFwiQGFueXdpZGdldC90eXBlc1wiO1xuaW1wb3J0IHsgSVdpZGdldE1hbmFnZXIsIFdpZGdldE1vZGVsIH0gZnJvbSBcIkBqdXB5dGVyLXdpZGdldHMvYmFzZVwiO1xuXG5hc3luYyBmdW5jdGlvbiB1bnBhY2tNb2RlbHMobW9kZWxJZHM6IEFycmF5PHN0cmluZz4sIG1hbmFnZXI6IElXaWRnZXRNYW5hZ2VyKTogUHJvbWlzZTxBcnJheTxXaWRnZXRNb2RlbD4+IHtcbiAgICByZXR1cm4gUHJvbWlzZS5hbGwoXG4gICAgICAgIG1vZGVsSWRzLm1hcChpZCA9PiBtYW5hZ2VyLmdldF9tb2RlbChpZC5zbGljZShcIklQWV9NT0RFTF9cIi5sZW5ndGgpKSlcbiAgICApO1xufVxuXG5leHBvcnQgYXN5bmMgZnVuY3Rpb24gdXBkYXRlQ2hpbGRyZW4oY29udGFpbmVyOiBIVE1MRWxlbWVudCwgbW9kZWw6IEFueU1vZGVsPGFueT4pIHtcbiAgICBjb25zdCB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uYWdlciIsICJpZCIsICJ1cGRhdGVDaGlsZHJlbiIsICJjb250YWluZXIiLCAibW9kZWwiLCAiY2hpbGRyZW4iLCAiY2hpbGRfbW9kZWxzIiwgImNoaWxkX3ZpZXdzIiwgImNoaWxkX3ZpZXciXQp9Cg== diff --git a/js/common.css b/js/common.css new file mode 100644 index 0000000000..dcfde1b8aa --- /dev/null +++ b/js/common.css @@ -0,0 +1 @@ +@import url(https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined); \ No newline at end of file diff --git a/js/ipywidgets_styles.ts b/js/ipywidgets_styles.ts new file mode 100644 index 0000000000..79928f2624 --- /dev/null +++ b/js/ipywidgets_styles.ts @@ -0,0 +1,56 @@ +import { css } from "lit"; + +export const legacyStyles = css` + .legacy-button { + align-items: center; + background-color: var(--jp-layout-color2); + border-width: 0; + box-shadow: none; + color: var(--jp-ui-font-color1); + cursor: pointer; + display: flex; + font-family: "Helvetica Neue", Arial, Helvetica, sans-serif; + font-size: var(--jp-widgets-font-size); + justify-content: center; + line-height: var(--jp-widgets-inline-height); + padding: 0; + } + + .legacy-button.primary { + background-color: var(--jp-brand-color1); + color: var(--jp-ui-inverse-font-color1); + } + + .legacy-button:hover:enabled, + .legacy-button:focus:enabled { + box-shadow: var(--jp-elevation-z2); + } + + .legacy-slider { + -webkit-appearance: none; + appearance: none; + background: var(--jp-layout-color3); + border-radius: 3px; + height: 4px; + outline: none; + } + + .legacy-slider::-webkit-slider-thumb, + .legacy-slider::-moz-range-thumb { + -moz-appearance: none; + -webkit-appearance: none; + appearance: none; + border-radius: 50%; + cursor: pointer; + height: var(--jp-widgets-slider-handle-size); + width: var(--jp-widgets-slider-handle-size); + } + + .legacy-text { + color: var(--jp-widgets-label-color); + font-family: "Helvetica Neue", Arial, Helvetica, sans-serif; + font-size: var(--jp-widgets-font-size); + height: var(--jp-widgets-inline-height); + line-height: var(--jp-widgets-inline-height); + } +`; \ No newline at end of file diff --git a/js/layer_manager.ts b/js/layer_manager.ts new file mode 100644 index 0000000000..842c251466 --- /dev/null +++ b/js/layer_manager.ts @@ -0,0 +1,108 @@ +import type { AnyModel, RenderContext } from "@anywidget/types"; +import { html, css, LitElement } from "lit"; +import { property } from "lit/decorators.js"; +import { legacyStyles } from './ipywidgets_styles'; +import { updateChildren } from "./utils"; + +import "./common.css"; + +interface LayerManagerModel { + children: any; + visible: boolean; +} + +export class LayerManager extends LitElement { + static get componentName() { + return `layer-manager`; + } + + static styles = [ + legacyStyles, + css` + .container { + padding: 0 4px 2px 4px; + } + + .row { + align-items: center; + display: flex; + gap: 4px; + height: 30px; + } + + .visibility-checkbox { + margin: 2px; + } + `, + ]; + + private _model: AnyModel | undefined = undefined; + private static modelNameToViewName = new Map([ + ["children", null], + ["visible", "visible"], + ]); + + set model(model: AnyModel) { + this._model = model; + for (const [modelKey, widgetKey] of LayerManager.modelNameToViewName) { + if (widgetKey) { + // Get initial values from the Python model. + (this as any)[widgetKey] = model.get(modelKey); + // Listen for updates to the model. + model.on(`change:${modelKey}`, () => { + (this as any)[widgetKey] = model.get(modelKey); + }); + } + } + } + + @property() + visible: boolean = false; + + render() { + return html` +
+
+ + All layers on/off +
+ +
+ `; + } + + updated(changedProperties: any) { + // Update the model properties so they're reflected in Python. + for (const [property, _] of changedProperties) { + this._model?.set(property, this[property as keyof LayerManager]); + } + this._model?.save_changes(); + } + + private onLayerVisibilityChanged(event: Event) { + const target = event.target as HTMLInputElement; + this.visible = target.checked; + } +} + +if (!customElements.get(LayerManager.componentName)) { + customElements.define(LayerManager.componentName, LayerManager); +} + +async function render({ model, el }: RenderContext) { + const manager = document.createElement(LayerManager.componentName); + manager.model = model; + el.appendChild(manager); + + updateChildren(manager, model); + model.on("change:children", () => { + updateChildren(manager, model); + }); +} + +export default { render }; diff --git a/js/layer_manager_row.ts b/js/layer_manager_row.ts new file mode 100644 index 0000000000..0630432dd6 --- /dev/null +++ b/js/layer_manager_row.ts @@ -0,0 +1,238 @@ +import type { AnyModel, RenderContext } from "@anywidget/types"; +import { html, css, LitElement, TemplateResult, nothing } from "lit"; +import { property } from "lit/decorators.js"; + +import "./common.css"; +import { legacyStyles } from './ipywidgets_styles'; +import { materialStyles } from "./material_styles"; + +interface LayerManagerRowModel { + name: string; + visible: boolean; + opacity: number; + is_loading: boolean; +} + +export class LayerManagerRow extends LitElement { + static get componentName() { + return `layer-manager-row`; + } + + static styles = [ + legacyStyles, + materialStyles, + css` + .row { + align-items: center; + display: flex; + gap: 4px; + height: 30px; + } + + .layer-name { + flex-grow: 1; + max-width: 150px; + overflow: hidden; + text-overflow: ellipsis; + } + + .settings-delete-button { + font-size: 14px; + height: 26px; + width: 26px; + } + + .layer-opacity-slider { + width: 70px; + } + + .layer-visibility-checkbox { + margin: 2px; + } + + .spinner { + -webkit-animation: spin 2s linear infinite; + animation: spin 2s linear infinite; + border-radius: 50%; + border: 4px solid var(--jp-widgets-input-border-color); + border-top: 4px solid var(--jp-widgets-color); + height: 12px; + width: 12px; + } + + @-webkit-keyframes spin { + 0% { -webkit-transform: rotate(0deg); } + 100% { -webkit-transform: rotate(360deg); } + } + + @keyframes spin { + 0% { transform: rotate(0deg); } + 100% { transform: rotate(360deg); } + } + + button.loading .spinner, + button.loading:hover .close-icon, + button.done-loading .close-icon { + display: block; + } + + button.loading .close-icon, + button.loading:hover .spinner, + button.done-loading .spinner { + display: none; + } + + .remove-layer-text { + flex-grow: 1; + } + + .confirm-deny-button { + height: 26px; + width: 70px; + } + `, + ]; + + private _model: AnyModel | undefined = undefined; + private static modelNameToViewName = new Map([ + ["name", "name"], + ["visible", "visible"], + ["opacity", "opacity"], + ["is_loading", "isLoading"], + ]); + + set model(model: AnyModel) { + this._model = model; + for (const [modelKey, widgetKey] of LayerManagerRow.modelNameToViewName) { + if (widgetKey) { + // Get initial values from the Python model. + (this as any)[widgetKey] = model.get(modelKey); + // Listen for updates to the model. + model.on(`change:${modelKey}`, () => { + (this as any)[widgetKey] = model.get(modelKey); + }); + } + } + } + + @property() + name: string = ""; + + @property() + visible: boolean = true; + + @property() + opacity: number = 0; + + @property() + isLoading: boolean = false; + + @property() + isConfirmDialogVisible: boolean = false; + + render(): TemplateResult { + return html` +
+ + ${this.name} + + + +
+ ${this.renderConfirmDialog()} + `; + } + + private renderConfirmDialog(): TemplateResult | void { + if (!this.isConfirmDialogVisible) { + return nothing; + } + return html` +
+ Remove layer? + + +
+ `; + } + + updated(changedProperties: any) { + // Update the model properties so they're reflected in Python. + for (const [property, _] of changedProperties) { + this._model?.set(property, this[property as keyof LayerManagerRow]); + } + this._model?.save_changes(); + } + + private onLayerVisibilityChanged(event: Event) { + const target = event.target as HTMLInputElement; + this.visible = target.checked; + } + + private onLayerOpacityChanged(event: Event) { + const target = event.target as HTMLInputElement; + this.opacity = parseFloat(target.value); + } + + private onSettingsClicked(_: Event) { + this._model?.send({ "type": "click", "id": "settings" }); + } + + private onDeleteClicked(_: Event) { + this.isConfirmDialogVisible = true; + } + + private confirmDeletion(_: Event) { + this._model?.send({ "type": "click", "id": "delete" }); + } + + private cancelDeletion(_: Event) { + this.isConfirmDialogVisible = false; + } +} + +if (!customElements.get(LayerManagerRow.componentName)) { + customElements.define(LayerManagerRow.componentName, LayerManagerRow); +} + +function render({ model, el }: RenderContext) { + const row = document.createElement(LayerManagerRow.componentName); + row.model = model; + el.appendChild(row); +} + +export default { render }; diff --git a/js/material_styles.ts b/js/material_styles.ts new file mode 100644 index 0000000000..90789019cf --- /dev/null +++ b/js/material_styles.ts @@ -0,0 +1,25 @@ +import { css } from "lit"; + +export const materialStyles = css` + @font-face { + font-family: 'Material Symbols Outlined'; + font-style: normal; + font-weight: 400; + src: url(https://fonts.gstatic.com/s/materialsymbolsoutlined/v205/kJF1BvYX7BgnkSrUwT8OhrdQw4oELdPIeeII9v6oDMzByHX9rA6RzaxHMPdY43zj-jCxv3fzvRNU22ZXGJpEpjC_1v-p_4MrImHCIJIZrDCvHOejbd5zrDAt.woff2) format('woff2'); + } + + .material-symbols-outlined { + -webkit-font-feature-settings: 'liga'; + -webkit-font-smoothing: antialiased; + direction: ltr; + display: inline-block; + font-family: 'Material Symbols Outlined'; + font-style: normal; + font-weight: normal; + letter-spacing: normal; + line-height: 1; + text-transform: none; + white-space: nowrap; + word-wrap: normal; + } +`; \ No newline at end of file diff --git a/js/utils.ts b/js/utils.ts new file mode 100644 index 0000000000..bdfa64ef87 --- /dev/null +++ b/js/utils.ts @@ -0,0 +1,20 @@ +import type { AnyModel } from "@anywidget/types"; +import { IWidgetManager, WidgetModel } from "@jupyter-widgets/base"; + +async function unpackModels(modelIds: Array, manager: IWidgetManager): Promise> { + return Promise.all( + modelIds.map(id => manager.get_model(id.slice("IPY_MODEL_".length))) + ); +} + +export async function updateChildren(container: HTMLElement, model: AnyModel) { + const children = model.get("children"); + const child_models = await unpackModels(children, model.widget_manager); + const child_views = await Promise.all( + child_models.map(model => model.widget_manager.create_view(model)) + ); + container.innerHTML = ``; + for (const child_view of child_views) { + container.appendChild(child_view.el); + } +} diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000000..cab1fced92 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,1181 @@ +{ + "name": "geemap", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "dependencies": { + "lit": "^3.2.0" + }, + "devDependencies": { + "@anywidget/types": "^0.1.9", + "esbuild": "^0.23.0", + "typescript": "^5.5.3" + } + }, + "node_modules/@anywidget/types": { + "version": "0.1.9", + "resolved": "https://registry.npmjs.org/@anywidget/types/-/types-0.1.9.tgz", + "integrity": "sha512-RvPp2qEDJGdNBpA6KGEEorLBmX7HkVUR+UTWFsc8fUkhsTVEoicDPTxYdLEdt9Wt0XUvLh0QhVOheICDJpyUnA==", + "dev": true, + "dependencies": { + "@jupyter-widgets/base": "^6.0.7" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.23.1.tgz", + "integrity": "sha512-6VhYk1diRqrhBAqpJEdjASR/+WVRtfjpqKuNw11cLiaWpAT/Uu+nokB+UJnevzy/P9C/ty6AOe0dwueMrGh/iQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.23.1.tgz", + "integrity": "sha512-uz6/tEy2IFm9RYOyvKl88zdzZfwEfKZmnX9Cj1BHjeSGNuGLuMD1kR8y5bteYmwqKm1tj8m4cb/aKEorr6fHWQ==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.23.1.tgz", + "integrity": "sha512-xw50ipykXcLstLeWH7WRdQuysJqejuAGPd30vd1i5zSyKK3WE+ijzHmLKxdiCMtH1pHz78rOg0BKSYOSB/2Khw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.23.1.tgz", + "integrity": "sha512-nlN9B69St9BwUoB+jkyU090bru8L0NA3yFvAd7k8dNsVH8bi9a8cUAUSEcEEgTp2z3dbEDGJGfP6VUnkQnlReg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.23.1.tgz", + "integrity": "sha512-YsS2e3Wtgnw7Wq53XXBLcV6JhRsEq8hkfg91ESVadIrzr9wO6jJDMZnCQbHm1Guc5t/CdDiFSSfWP58FNuvT3Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.23.1.tgz", + "integrity": "sha512-aClqdgTDVPSEGgoCS8QDG37Gu8yc9lTHNAQlsztQ6ENetKEO//b8y31MMu2ZaPbn4kVsIABzVLXYLhCGekGDqw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.23.1.tgz", + "integrity": "sha512-h1k6yS8/pN/NHlMl5+v4XPfikhJulk4G+tKGFIOwURBSFzE8bixw1ebjluLOjfwtLqY0kewfjLSrO6tN2MgIhA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.23.1.tgz", + "integrity": "sha512-lK1eJeyk1ZX8UklqFd/3A60UuZ/6UVfGT2LuGo3Wp4/z7eRTRYY+0xOu2kpClP+vMTi9wKOfXi2vjUpO1Ro76g==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.23.1.tgz", + "integrity": "sha512-CXXkzgn+dXAPs3WBwE+Kvnrf4WECwBdfjfeYHpMeVxWE0EceB6vhWGShs6wi0IYEqMSIzdOF1XjQ/Mkm5d7ZdQ==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.23.1.tgz", + "integrity": "sha512-/93bf2yxencYDnItMYV/v116zff6UyTjo4EtEQjUBeGiVpMmffDNUyD9UN2zV+V3LRV3/on4xdZ26NKzn6754g==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.23.1.tgz", + "integrity": "sha512-VTN4EuOHwXEkXzX5nTvVY4s7E/Krz7COC8xkftbbKRYAl96vPiUssGkeMELQMOnLOJ8k3BY1+ZY52tttZnHcXQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.23.1.tgz", + "integrity": "sha512-Vx09LzEoBa5zDnieH8LSMRToj7ir/Jeq0Gu6qJ/1GcBq9GkfoEAoXvLiW1U9J1qE/Y/Oyaq33w5p2ZWrNNHNEw==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.23.1.tgz", + "integrity": "sha512-nrFzzMQ7W4WRLNUOU5dlWAqa6yVeI0P78WKGUo7lg2HShq/yx+UYkeNSE0SSfSure0SqgnsxPvmAUu/vu0E+3Q==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.23.1.tgz", + "integrity": "sha512-dKN8fgVqd0vUIjxuJI6P/9SSSe/mB9rvA98CSH2sJnlZ/OCZWO1DJvxj8jvKTfYUdGfcq2dDxoKaC6bHuTlgcw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.23.1.tgz", + "integrity": "sha512-5AV4Pzp80fhHL83JM6LoA6pTQVWgB1HovMBsLQ9OZWLDqVY8MVobBXNSmAJi//Csh6tcY7e7Lny2Hg1tElMjIA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.23.1.tgz", + "integrity": "sha512-9ygs73tuFCe6f6m/Tb+9LtYxWR4c9yg7zjt2cYkjDbDpV/xVn+68cQxMXCjUpYwEkze2RcU/rMnfIXNRFmSoDw==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.23.1.tgz", + "integrity": "sha512-EV6+ovTsEXCPAp58g2dD68LxoP/wK5pRvgy0J/HxPGB009omFPv3Yet0HiaqvrIrgPTBuC6wCH1LTOY91EO5hQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.23.1.tgz", + "integrity": "sha512-aevEkCNu7KlPRpYLjwmdcuNz6bDFiE7Z8XC4CPqExjTvrHugh28QzUXVOZtiYghciKUacNktqxdpymplil1beA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.23.1.tgz", + "integrity": "sha512-3x37szhLexNA4bXhLrCC/LImN/YtWis6WXr1VESlfVtVeoFJBRINPJ3f0a/6LV8zpikqoUg4hyXw0sFBt5Cr+Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.23.1.tgz", + "integrity": "sha512-aY2gMmKmPhxfU+0EdnN+XNtGbjfQgwZj43k8G3fyrDM/UdZww6xrWxmDkuz2eCZchqVeABjV5BpildOrUbBTqA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.23.1.tgz", + "integrity": "sha512-RBRT2gqEl0IKQABT4XTj78tpk9v7ehp+mazn2HbUeZl1YMdaGAQqhapjGTCe7uw7y0frDi4gS0uHzhvpFuI1sA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.23.1.tgz", + "integrity": "sha512-4O+gPR5rEBe2FpKOVyiJ7wNDPA8nGzDuJ6gN4okSA1gEOYZ67N8JPk58tkWtdtPeLz7lBnY6I5L3jdsr3S+A6A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.23.1.tgz", + "integrity": "sha512-BcaL0Vn6QwCwre3Y717nVHZbAa4UBEigzFm6VdsVdT/MbZ38xoj1X9HPkZhbmaBGUD1W8vxAfffbDe8bA6AKnQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.23.1.tgz", + "integrity": "sha512-BHpFFeslkWrXWyUPnbKm+xYYVYruCinGcftSBaa8zoF9hZO4BcSCFUvHVTtzpIY6YzUnYtuEhZ+C9iEXjxnasg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@jupyter-widgets/base": { + "version": "6.0.10", + "resolved": "https://registry.npmjs.org/@jupyter-widgets/base/-/base-6.0.10.tgz", + "integrity": "sha512-iJvBT4drhwd3kpfMXaIFoD+FZTqbm1pKNi8Gvv+Wggnefyw6SHugZ0hjHoBxZD362wEUM8fpHQmdj59KvXWg0g==", + "dev": true, + "dependencies": { + "@jupyterlab/services": "^6.0.0 || ^7.0.0", + "@lumino/coreutils": "^1.11.1 || ^2.1", + "@lumino/messaging": "^1.10.1 || ^2.1", + "@lumino/widgets": "^1.30.0 || ^2.1", + "@types/backbone": "1.4.14", + "@types/lodash": "^4.14.134", + "backbone": "1.4.0", + "jquery": "^3.1.1", + "lodash": "^4.17.4" + } + }, + "node_modules/@jupyter/ydoc": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@jupyter/ydoc/-/ydoc-2.1.1.tgz", + "integrity": "sha512-NeEwqXQ2j1OyLq4uezeQmsMiI+Qo5k7dYIMqNByOM7dJp6sHeP0jQ96w7BEc9E4SmrxwcOT4cLvcJWJE8Xun4g==", + "dev": true, + "dependencies": { + "@jupyterlab/nbformat": "^3.0.0 || ^4.0.0-alpha.21 || ^4.0.0", + "@lumino/coreutils": "^1.11.0 || ^2.0.0", + "@lumino/disposable": "^1.10.0 || ^2.0.0", + "@lumino/signaling": "^1.10.0 || ^2.0.0", + "y-protocols": "^1.0.5", + "yjs": "^13.5.40" + } + }, + "node_modules/@jupyterlab/coreutils": { + "version": "6.2.5", + "resolved": "https://registry.npmjs.org/@jupyterlab/coreutils/-/coreutils-6.2.5.tgz", + "integrity": "sha512-P3HniEv3bZ3EvV3zUwCmruR713fclGvSTfsuwFPBgI8M3rNIZYqGQ13xkTun7Zl6DUr2E8mrC/cq9jNwxW33yw==", + "dev": true, + "dependencies": { + "@lumino/coreutils": "^2.1.2", + "@lumino/disposable": "^2.1.2", + "@lumino/signaling": "^2.1.2", + "minimist": "~1.2.0", + "path-browserify": "^1.0.0", + "url-parse": "~1.5.4" + } + }, + "node_modules/@jupyterlab/nbformat": { + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/@jupyterlab/nbformat/-/nbformat-4.2.5.tgz", + "integrity": "sha512-DF8bdlsEziUR5oKUr3Mm0wUx7kHZjlAtEjD6oJ8cOogQqTrMyBnUAgVjPr9QQob5J7qiyzz9aW2DYtaX+jFhng==", + "dev": true, + "dependencies": { + "@lumino/coreutils": "^2.1.2" + } + }, + "node_modules/@jupyterlab/services": { + "version": "7.2.5", + "resolved": "https://registry.npmjs.org/@jupyterlab/services/-/services-7.2.5.tgz", + "integrity": "sha512-Ya/jA8p8WOfiPPERinZasigsfSth54nNNWBQUrT2MEitdka3jVsjC3fR9R5XBpYQ59Qkczz782jMfXvaWNfCHQ==", + "dev": true, + "dependencies": { + "@jupyter/ydoc": "^2.0.1", + "@jupyterlab/coreutils": "^6.2.5", + "@jupyterlab/nbformat": "^4.2.5", + "@jupyterlab/settingregistry": "^4.2.5", + "@jupyterlab/statedb": "^4.2.5", + "@lumino/coreutils": "^2.1.2", + "@lumino/disposable": "^2.1.2", + "@lumino/polling": "^2.1.2", + "@lumino/properties": "^2.0.1", + "@lumino/signaling": "^2.1.2", + "ws": "^8.11.0" + } + }, + "node_modules/@jupyterlab/settingregistry": { + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/@jupyterlab/settingregistry/-/settingregistry-4.2.5.tgz", + "integrity": "sha512-RTHwFoldrP8h4hMxZrKafrOt3mLYKAcmUsnExkzKCqHuc3CIOh9hj+eN3gCh1mxjabbP9QIK0/08e89Rp/EG5w==", + "dev": true, + "dependencies": { + "@jupyterlab/nbformat": "^4.2.5", + "@jupyterlab/statedb": "^4.2.5", + "@lumino/commands": "^2.3.0", + "@lumino/coreutils": "^2.1.2", + "@lumino/disposable": "^2.1.2", + "@lumino/signaling": "^2.1.2", + "@rjsf/utils": "^5.13.4", + "ajv": "^8.12.0", + "json5": "^2.2.3" + }, + "peerDependencies": { + "react": ">=16" + } + }, + "node_modules/@jupyterlab/statedb": { + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/@jupyterlab/statedb/-/statedb-4.2.5.tgz", + "integrity": "sha512-GGP4NSkVzcn/zYZyjKId8OvDxq+JQTHEmiE2ayzUvvP4BwpGJ2GafY1V+QT5Tl+4SB0AzowpNud6XHUJ28M/tA==", + "dev": true, + "dependencies": { + "@lumino/commands": "^2.3.0", + "@lumino/coreutils": "^2.1.2", + "@lumino/disposable": "^2.1.2", + "@lumino/properties": "^2.0.1", + "@lumino/signaling": "^2.1.2" + } + }, + "node_modules/@lit-labs/ssr-dom-shim": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@lit-labs/ssr-dom-shim/-/ssr-dom-shim-1.2.1.tgz", + "integrity": "sha512-wx4aBmgeGvFmOKucFKY+8VFJSYZxs9poN3SDNQFF6lT6NrQUnHiPB2PWz2sc4ieEcAaYYzN+1uWahEeTq2aRIQ==" + }, + "node_modules/@lit/reactive-element": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@lit/reactive-element/-/reactive-element-2.0.4.tgz", + "integrity": "sha512-GFn91inaUa2oHLak8awSIigYz0cU0Payr1rcFsrkf5OJ5eSPxElyZfKh0f2p9FsTiZWXQdWGJeXZICEfXXYSXQ==", + "dependencies": { + "@lit-labs/ssr-dom-shim": "^1.2.0" + } + }, + "node_modules/@lumino/algorithm": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@lumino/algorithm/-/algorithm-2.0.2.tgz", + "integrity": "sha512-cI8yJ2+QK1yM5ZRU3Kuaw9fJ/64JEDZEwWWp7+U0cd/mvcZ44BGdJJ29w+tIet1QXxPAvnsUleWyQ5qm4qUouA==", + "dev": true + }, + "node_modules/@lumino/collections": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/@lumino/collections/-/collections-1.9.3.tgz", + "integrity": "sha512-2i2Wf1xnfTgEgdyKEpqM16bcYRIhUOGCDzaVCEZACVG9R1CgYwOe3zfn71slBQOVSjjRgwYrgLXu4MBpt6YK+g==", + "dev": true, + "dependencies": { + "@lumino/algorithm": "^1.9.2" + } + }, + "node_modules/@lumino/collections/node_modules/@lumino/algorithm": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/@lumino/algorithm/-/algorithm-1.9.2.tgz", + "integrity": "sha512-Z06lp/yuhz8CtIir3PNTGnuk7909eXt4ukJsCzChsGuot2l5Fbs96RJ/FOHgwCedaX74CtxPjXHXoszFbUA+4A==", + "dev": true + }, + "node_modules/@lumino/commands": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@lumino/commands/-/commands-2.3.1.tgz", + "integrity": "sha512-DpX1kkE4PhILpvK1T4ZnaFb6UP4+YTkdZifvN3nbiomD64O2CTd+wcWIBpZMgy6MMgbVgrE8dzHxHk1EsKxNxw==", + "dev": true, + "dependencies": { + "@lumino/algorithm": "^2.0.2", + "@lumino/coreutils": "^2.2.0", + "@lumino/disposable": "^2.1.3", + "@lumino/domutils": "^2.0.2", + "@lumino/keyboard": "^2.0.2", + "@lumino/signaling": "^2.1.3", + "@lumino/virtualdom": "^2.0.2" + } + }, + "node_modules/@lumino/coreutils": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@lumino/coreutils/-/coreutils-2.2.0.tgz", + "integrity": "sha512-x5wnQ/GjWBayJ6vXVaUi6+Q6ETDdcUiH9eSfpRZFbgMQyyM6pi6baKqJBK2CHkCc/YbAEl6ipApTgm3KOJ/I3g==", + "dev": true, + "dependencies": { + "@lumino/algorithm": "^2.0.2" + } + }, + "node_modules/@lumino/disposable": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@lumino/disposable/-/disposable-2.1.3.tgz", + "integrity": "sha512-k5KXy/+T3UItiWHY4WwQawnsJnGo3aNtP5CTRKqo4+tbTNuhc3rTSvygJlNKIbEfIZXW2EWYnwfFDozkYx95eA==", + "dev": true, + "dependencies": { + "@lumino/signaling": "^2.1.3" + } + }, + "node_modules/@lumino/domutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@lumino/domutils/-/domutils-2.0.2.tgz", + "integrity": "sha512-2Kp6YHaMNI1rKB0PrALvOsZBHPy2EvVVAvJLWjlCm8MpWOVETjFp0MA9QpMubT9I76aKbaI5s1o1NJyZ8Y99pQ==", + "dev": true + }, + "node_modules/@lumino/dragdrop": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@lumino/dragdrop/-/dragdrop-2.1.5.tgz", + "integrity": "sha512-zqwR4GakrQBKZOW6S5pj2nfrQDurOErAoe9x3HS3BKLa1AzWA+t9PD5NESOKd81NqXFHjiMirSyFkTUs6pw+uA==", + "dev": true, + "dependencies": { + "@lumino/coreutils": "^2.2.0", + "@lumino/disposable": "^2.1.3" + } + }, + "node_modules/@lumino/keyboard": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@lumino/keyboard/-/keyboard-2.0.2.tgz", + "integrity": "sha512-icRUpvswDaFjqmAJNbQRb/aTu6Iugo6Y2oC08TiIwhQtLS9W+Ee9VofdqvbPSvCm6DkyP+DCWMuA3KXZ4V4g4g==", + "dev": true + }, + "node_modules/@lumino/messaging": { + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/@lumino/messaging/-/messaging-1.10.3.tgz", + "integrity": "sha512-F/KOwMCdqvdEG8CYAJcBSadzp6aI7a47Fr60zAKGqZATSRRRV41q53iXU7HjFPqQqQIvdn9Z7J32rBEAyQAzww==", + "dev": true, + "dependencies": { + "@lumino/algorithm": "^1.9.2", + "@lumino/collections": "^1.9.3" + } + }, + "node_modules/@lumino/messaging/node_modules/@lumino/algorithm": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/@lumino/algorithm/-/algorithm-1.9.2.tgz", + "integrity": "sha512-Z06lp/yuhz8CtIir3PNTGnuk7909eXt4ukJsCzChsGuot2l5Fbs96RJ/FOHgwCedaX74CtxPjXHXoszFbUA+4A==", + "dev": true + }, + "node_modules/@lumino/polling": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@lumino/polling/-/polling-2.1.3.tgz", + "integrity": "sha512-WEZk96ddK6eHEhdDkFUAAA40EOLit86QVbqQqnbPmhdGwFogek26Kq9b1U273LJeirv95zXCATOJAkjRyb7D+w==", + "dev": true, + "dependencies": { + "@lumino/coreutils": "^2.2.0", + "@lumino/disposable": "^2.1.3", + "@lumino/signaling": "^2.1.3" + } + }, + "node_modules/@lumino/properties": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@lumino/properties/-/properties-2.0.2.tgz", + "integrity": "sha512-b312oA3Bh97WFK8efXejYmC3DVJmvzJk72LQB7H3fXhfqS5jUWvL7MSnNmgcQvGzl9fIhDWDWjhtSTi0KGYYBg==", + "dev": true + }, + "node_modules/@lumino/signaling": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@lumino/signaling/-/signaling-2.1.3.tgz", + "integrity": "sha512-9Wd4iMk8F1i6pYjy65bqKuPlzQMicyL9xy1/ccS20kovPcfD074waneL/7BVe+3M8i+fGa3x2qjbWrBzOdTdNw==", + "dev": true, + "dependencies": { + "@lumino/algorithm": "^2.0.2", + "@lumino/coreutils": "^2.2.0" + } + }, + "node_modules/@lumino/virtualdom": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@lumino/virtualdom/-/virtualdom-2.0.2.tgz", + "integrity": "sha512-HYZThOtZSoknjdXA102xpy5CiXtTFCVz45EXdWeYLx3NhuEwuAIX93QBBIhupalmtFlRg1yhdDNV40HxJ4kcXg==", + "dev": true, + "dependencies": { + "@lumino/algorithm": "^2.0.2" + } + }, + "node_modules/@lumino/widgets": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@lumino/widgets/-/widgets-2.5.0.tgz", + "integrity": "sha512-RSRpc6aIEiuw79jqWUHYWXLJ2GBy7vhwuqgo94UVzg6oeh3XBECX0OvXGjK2k7N2BhmRrIs9bXky7Dm861S6mQ==", + "dev": true, + "dependencies": { + "@lumino/algorithm": "^2.0.2", + "@lumino/commands": "^2.3.1", + "@lumino/coreutils": "^2.2.0", + "@lumino/disposable": "^2.1.3", + "@lumino/domutils": "^2.0.2", + "@lumino/dragdrop": "^2.1.5", + "@lumino/keyboard": "^2.0.2", + "@lumino/messaging": "^2.0.2", + "@lumino/properties": "^2.0.2", + "@lumino/signaling": "^2.1.3", + "@lumino/virtualdom": "^2.0.2" + } + }, + "node_modules/@lumino/widgets/node_modules/@lumino/collections": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@lumino/collections/-/collections-2.0.2.tgz", + "integrity": "sha512-o0QmfV1D3WhAeA8GI1/YmEPaK89JtHVa764rQ5T0LdbDEwUtUDbjavHs1E/+y66tNTXz9RUJ4D2rcSb9tysYsg==", + "dev": true, + "dependencies": { + "@lumino/algorithm": "^2.0.2" + } + }, + "node_modules/@lumino/widgets/node_modules/@lumino/messaging": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@lumino/messaging/-/messaging-2.0.2.tgz", + "integrity": "sha512-2sUF07cYA0f3mDil41Eh5sfBk0aGAH/mOh1I4+vyRUsKyBqp4WTUtpJFd8xVJGAntygxwnebIygkIaXXTIQvxA==", + "dev": true, + "dependencies": { + "@lumino/algorithm": "^2.0.2", + "@lumino/collections": "^2.0.2" + } + }, + "node_modules/@rjsf/utils": { + "version": "5.21.1", + "resolved": "https://registry.npmjs.org/@rjsf/utils/-/utils-5.21.1.tgz", + "integrity": "sha512-KEwEtIswzKE2WTLRxvh5vwMwvNMTHnRSxwaRlz3QKz5/iQr9XGJTWcmArjIN3y0ypfLk+X6qZsboamQBIhTV3w==", + "dev": true, + "dependencies": { + "json-schema-merge-allof": "^0.8.1", + "jsonpointer": "^5.0.1", + "lodash": "^4.17.21", + "lodash-es": "^4.17.21", + "react-is": "^18.2.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "react": "^16.14.0 || >=17" + } + }, + "node_modules/@types/backbone": { + "version": "1.4.14", + "resolved": "https://registry.npmjs.org/@types/backbone/-/backbone-1.4.14.tgz", + "integrity": "sha512-85ldQ99fiYTJFBlZuAJRaCdvTZKZ2p1fSs3fVf+6Ub6k1X0g0hNJ0qJ/2FOByyyAQYLtbEz3shX5taKQfBKBDw==", + "dev": true, + "dependencies": { + "@types/jquery": "*", + "@types/underscore": "*" + } + }, + "node_modules/@types/jquery": { + "version": "3.5.30", + "resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-3.5.30.tgz", + "integrity": "sha512-nbWKkkyb919DOUxjmRVk8vwtDb0/k8FKncmUKFi+NY+QXqWltooxTrswvz4LspQwxvLdvzBN1TImr6cw3aQx2A==", + "dev": true, + "dependencies": { + "@types/sizzle": "*" + } + }, + "node_modules/@types/lodash": { + "version": "4.17.9", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.9.tgz", + "integrity": "sha512-w9iWudx1XWOHW5lQRS9iKpK/XuRhnN+0T7HvdCCd802FYkT1AMTnxndJHGrNJwRoRHkslGr4S29tjm1cT7x/7w==", + "dev": true + }, + "node_modules/@types/sizzle": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.8.tgz", + "integrity": "sha512-0vWLNK2D5MT9dg0iOo8GlKguPAU02QjmZitPEsXRuJXU/OGIOt9vT9Fc26wtYuavLxtO45v9PGleoL9Z0k1LHg==", + "dev": true + }, + "node_modules/@types/trusted-types": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz", + "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==" + }, + "node_modules/@types/underscore": { + "version": "1.11.15", + "resolved": "https://registry.npmjs.org/@types/underscore/-/underscore-1.11.15.tgz", + "integrity": "sha512-HP38xE+GuWGlbSRq9WrZkousaQ7dragtZCruBVMi0oX1migFZavZ3OROKHSkNp/9ouq82zrWtZpg18jFnVN96g==", + "dev": true + }, + "node_modules/ajv": { + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", + "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/backbone": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/backbone/-/backbone-1.4.0.tgz", + "integrity": "sha512-RLmDrRXkVdouTg38jcgHhyQ/2zjg7a8E6sz2zxfz21Hh17xDJYUHBZimVIt5fUyS8vbfpeSmTL3gUjTEvUV3qQ==", + "dev": true, + "dependencies": { + "underscore": ">=1.8.3" + } + }, + "node_modules/compute-gcd": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/compute-gcd/-/compute-gcd-1.2.1.tgz", + "integrity": "sha512-TwMbxBNz0l71+8Sc4czv13h4kEqnchV9igQZBi6QUaz09dnz13juGnnaWWJTRsP3brxOoxeB4SA2WELLw1hCtg==", + "dev": true, + "dependencies": { + "validate.io-array": "^1.0.3", + "validate.io-function": "^1.0.2", + "validate.io-integer-array": "^1.0.0" + } + }, + "node_modules/compute-lcm": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/compute-lcm/-/compute-lcm-1.1.2.tgz", + "integrity": "sha512-OFNPdQAXnQhDSKioX8/XYT6sdUlXwpeMjfd6ApxMJfyZ4GxmLR1xvMERctlYhlHwIiz6CSpBc2+qYKjHGZw4TQ==", + "dev": true, + "dependencies": { + "compute-gcd": "^1.2.1", + "validate.io-array": "^1.0.3", + "validate.io-function": "^1.0.2", + "validate.io-integer-array": "^1.0.0" + } + }, + "node_modules/esbuild": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.23.1.tgz", + "integrity": "sha512-VVNz/9Sa0bs5SELtn3f7qhJCDPCF5oMEl5cO9/SSinpE9hbPVvxbd572HH5AKiP7WD8INO53GgfDDhRjkylHEg==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.23.1", + "@esbuild/android-arm": "0.23.1", + "@esbuild/android-arm64": "0.23.1", + "@esbuild/android-x64": "0.23.1", + "@esbuild/darwin-arm64": "0.23.1", + "@esbuild/darwin-x64": "0.23.1", + "@esbuild/freebsd-arm64": "0.23.1", + "@esbuild/freebsd-x64": "0.23.1", + "@esbuild/linux-arm": "0.23.1", + "@esbuild/linux-arm64": "0.23.1", + "@esbuild/linux-ia32": "0.23.1", + "@esbuild/linux-loong64": "0.23.1", + "@esbuild/linux-mips64el": "0.23.1", + "@esbuild/linux-ppc64": "0.23.1", + "@esbuild/linux-riscv64": "0.23.1", + "@esbuild/linux-s390x": "0.23.1", + "@esbuild/linux-x64": "0.23.1", + "@esbuild/netbsd-x64": "0.23.1", + "@esbuild/openbsd-arm64": "0.23.1", + "@esbuild/openbsd-x64": "0.23.1", + "@esbuild/sunos-x64": "0.23.1", + "@esbuild/win32-arm64": "0.23.1", + "@esbuild/win32-ia32": "0.23.1", + "@esbuild/win32-x64": "0.23.1" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "node_modules/fast-uri": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.1.tgz", + "integrity": "sha512-MWipKbbYiYI0UC7cl8m/i/IWTqfC8YXsqjzybjddLsFjStroQzsHXkc73JutMvBiXmOvapk+axIl79ig5t55Bw==", + "dev": true + }, + "node_modules/isomorphic.js": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/isomorphic.js/-/isomorphic.js-0.2.5.tgz", + "integrity": "sha512-PIeMbHqMt4DnUP3MA/Flc0HElYjMXArsw1qwJZcm9sqR8mq3l8NYizFMty0pWwE/tzIGH3EKK5+jes5mAr85yw==", + "dev": true, + "funding": { + "type": "GitHub Sponsors ❤", + "url": "https://github.com/sponsors/dmonad" + } + }, + "node_modules/jquery": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.1.tgz", + "integrity": "sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg==", + "dev": true + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true, + "peer": true + }, + "node_modules/json-schema-compare": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/json-schema-compare/-/json-schema-compare-0.2.2.tgz", + "integrity": "sha512-c4WYmDKyJXhs7WWvAWm3uIYnfyWFoIp+JEoX34rctVvEkMYCPGhXtvmFFXiffBbxfZsvQ0RNnV5H7GvDF5HCqQ==", + "dev": true, + "dependencies": { + "lodash": "^4.17.4" + } + }, + "node_modules/json-schema-merge-allof": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/json-schema-merge-allof/-/json-schema-merge-allof-0.8.1.tgz", + "integrity": "sha512-CTUKmIlPJbsWfzRRnOXz+0MjIqvnleIXwFTzz+t9T86HnYX/Rozria6ZVGLktAU9e+NygNljveP+yxqtQp/Q4w==", + "dev": true, + "dependencies": { + "compute-lcm": "^1.1.2", + "json-schema-compare": "^0.2.2", + "lodash": "^4.17.20" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/jsonpointer": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-5.0.1.tgz", + "integrity": "sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/lib0": { + "version": "0.2.97", + "resolved": "https://registry.npmjs.org/lib0/-/lib0-0.2.97.tgz", + "integrity": "sha512-Q4d1ekgvufi9FiHkkL46AhecfNjznSL9MRNoJRQ76gBHS9OqU2ArfQK0FvBpuxgWeJeNI0LVgAYMIpsGeX4gYg==", + "dev": true, + "dependencies": { + "isomorphic.js": "^0.2.4" + }, + "bin": { + "0ecdsa-generate-keypair": "bin/0ecdsa-generate-keypair.js", + "0gentesthtml": "bin/gentesthtml.js", + "0serve": "bin/0serve.js" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "type": "GitHub Sponsors ❤", + "url": "https://github.com/sponsors/dmonad" + } + }, + "node_modules/lit": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/lit/-/lit-3.2.0.tgz", + "integrity": "sha512-s6tI33Lf6VpDu7u4YqsSX78D28bYQulM+VAzsGch4fx2H0eLZnJsUBsPWmGYSGoKDNbjtRv02rio1o+UdPVwvw==", + "dependencies": { + "@lit/reactive-element": "^2.0.4", + "lit-element": "^4.1.0", + "lit-html": "^3.2.0" + } + }, + "node_modules/lit-element": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/lit-element/-/lit-element-4.1.0.tgz", + "integrity": "sha512-gSejRUQJuMQjV2Z59KAS/D4iElUhwKpIyJvZ9w+DIagIQjfJnhR20h2Q5ddpzXGS+fF0tMZ/xEYGMnKmaI/iww==", + "dependencies": { + "@lit-labs/ssr-dom-shim": "^1.2.0", + "@lit/reactive-element": "^2.0.4", + "lit-html": "^3.2.0" + } + }, + "node_modules/lit-html": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/lit-html/-/lit-html-3.2.0.tgz", + "integrity": "sha512-pwT/HwoxqI9FggTrYVarkBKFN9MlTUpLrDHubTmW4SrkL3kkqW5gxwbxMMUnbbRHBC0WTZnYHcjDSCM559VyfA==", + "dependencies": { + "@types/trusted-types": "^2.0.2" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/lodash-es": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", + "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==", + "dev": true + }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dev": true, + "peer": true, + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/path-browserify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", + "dev": true + }, + "node_modules/querystringify": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", + "dev": true + }, + "node_modules/react": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", + "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", + "dev": true, + "peer": true, + "dependencies": { + "loose-envify": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "dev": true + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", + "dev": true + }, + "node_modules/typescript": { + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.2.tgz", + "integrity": "sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/underscore": { + "version": "1.13.7", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.7.tgz", + "integrity": "sha512-GMXzWtsc57XAtguZgaQViUOzs0KTkk8ojr3/xAxXLITqf/3EMwxC0inyETfDFjH/Krbhuep0HNbbjI9i/q3F3g==", + "dev": true + }, + "node_modules/url-parse": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", + "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", + "dev": true, + "dependencies": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + } + }, + "node_modules/validate.io-array": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/validate.io-array/-/validate.io-array-1.0.6.tgz", + "integrity": "sha512-DeOy7CnPEziggrOO5CZhVKJw6S3Yi7e9e65R1Nl/RTN1vTQKnzjfvks0/8kQ40FP/dsjRAOd4hxmJ7uLa6vxkg==", + "dev": true + }, + "node_modules/validate.io-function": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/validate.io-function/-/validate.io-function-1.0.2.tgz", + "integrity": "sha512-LlFybRJEriSuBnUhQyG5bwglhh50EpTL2ul23MPIuR1odjO7XaMLFV8vHGwp7AZciFxtYOeiSCT5st+XSPONiQ==", + "dev": true + }, + "node_modules/validate.io-integer": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/validate.io-integer/-/validate.io-integer-1.0.5.tgz", + "integrity": "sha512-22izsYSLojN/P6bppBqhgUDjCkr5RY2jd+N2a3DCAUey8ydvrZ/OkGvFPR7qfOpwR2LC5p4Ngzxz36g5Vgr/hQ==", + "dev": true, + "dependencies": { + "validate.io-number": "^1.0.3" + } + }, + "node_modules/validate.io-integer-array": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/validate.io-integer-array/-/validate.io-integer-array-1.0.0.tgz", + "integrity": "sha512-mTrMk/1ytQHtCY0oNO3dztafHYyGU88KL+jRxWuzfOmQb+4qqnWmI+gykvGp8usKZOM0H7keJHEbRaFiYA0VrA==", + "dev": true, + "dependencies": { + "validate.io-array": "^1.0.3", + "validate.io-integer": "^1.0.4" + } + }, + "node_modules/validate.io-number": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/validate.io-number/-/validate.io-number-1.0.3.tgz", + "integrity": "sha512-kRAyotcbNaSYoDnXvb4MHg/0a1egJdLwS6oJ38TJY7aw9n93Fl/3blIXdyYvPOp55CNxywooG/3BcrwNrBpcSg==", + "dev": true + }, + "node_modules/ws": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", + "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", + "dev": true, + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/y-protocols": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/y-protocols/-/y-protocols-1.0.6.tgz", + "integrity": "sha512-vHRF2L6iT3rwj1jub/K5tYcTT/mEYDUppgNPXwp8fmLpui9f7Yeq3OEtTLVF012j39QnV+KEQpNqoN7CWU7Y9Q==", + "dev": true, + "dependencies": { + "lib0": "^0.2.85" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=8.0.0" + }, + "funding": { + "type": "GitHub Sponsors ❤", + "url": "https://github.com/sponsors/dmonad" + }, + "peerDependencies": { + "yjs": "^13.0.0" + } + }, + "node_modules/yjs": { + "version": "13.6.19", + "resolved": "https://registry.npmjs.org/yjs/-/yjs-13.6.19.tgz", + "integrity": "sha512-GNKw4mEUn5yWU2QPHRx8jppxmCm9KzbBhB4qJLUJFiiYD0g/tDVgXQ7aPkyh01YO28kbs2J/BEbWBagjuWyejw==", + "dev": true, + "dependencies": { + "lib0": "^0.2.86" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=8.0.0" + }, + "funding": { + "type": "GitHub Sponsors ❤", + "url": "https://github.com/sponsors/dmonad" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000000..f23be7baa5 --- /dev/null +++ b/package.json @@ -0,0 +1,15 @@ +{ + "scripts": { + "dev": "npm run build -- --sourcemap=inline --watch", + "build": "esbuild js/*.ts --minify --format=esm --bundle --outdir=geemap/static", + "typecheck": "tsc --noEmit" + }, + "dependencies": { + "lit": "^3.2.0" + }, + "devDependencies": { + "@anywidget/types": "^0.1.9", + "esbuild": "^0.23.0", + "typescript": "^5.5.3" + } +} diff --git a/pyproject.toml b/pyproject.toml index 3820e49280..7c59e3974d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,7 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + [project] name = "geemap" version = "0.34.5" @@ -25,12 +29,12 @@ classifiers = [ "Programming Language :: Python :: 3.13", ] -[project.entry-points."console_scripts"] +[project.scripts] geemap = "geemap.cli:main" [project.optional-dependencies] all = [ - "geemap[backends,extra,lidar,raster,sql,apps,vector,workshop,maplibre]", + "geemap[backends,dev,extra,lidar,raster,sql,apps,vector,workshop,maplibre]", ] ai = [ "google-api-core", @@ -42,6 +46,10 @@ backends = [ "pydeck", "plotly", ] +dev = [ + "watchfiles", + "jupyterlab", +] extra = [ "ee_extra>=0.0.15", "ffmpeg-python", @@ -119,11 +127,9 @@ exclude = ["docs*"] [tool.setuptools.dynamic] dependencies = {file = ["requirements.txt"]} - [tool.distutils.bdist_wheel] universal = true - [tool.bumpversion] current_version = "0.34.5" commit = true @@ -147,10 +153,28 @@ max-line-length = 88 [tool.setuptools_scm] +[tool.hatch.envs.default] +features = ["dev"] + +[tool.hatch.build] +only-packages = true +artifacts = ["geemap/static/*"] + +[tool.hatch.build.hooks.jupyter-builder] +build-function = "hatch_jupyter_builder.npm_builder" +ensured-targets = [ + "geemap/static/layer_manager_row.js", + "geemap/static/layer_manager.js", +] +skip-if-exists = [ + "geemap/static/layer_manager_row.js", + "geemap/static/layer_manager.js", +] +dependencies = ["hatch-jupyter-builder>=0.5.0"] + +[tool.hatch.build.hooks.jupyter-builder.build-kwargs] +npm = "npm" +build_cmd = "build" [project.urls] Homepage = "https://github.com/gee-community/geemap" - -[build-system] -requires = ["setuptools>=64", "setuptools_scm>=8"] -build-backend = "setuptools.build_meta" \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 9c946a1151..acafc3090d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ +anywidget bqplot colour earthengine-api>=1.0.0 diff --git a/tests/fake_map.py b/tests/fake_map.py index 9cb247422f..626adcdb62 100644 --- a/tests/fake_map.py +++ b/tests/fake_map.py @@ -1,4 +1,10 @@ +"""Fake map used for testing.""" + +import unittest + import ee +import ipywidgets +import traitlets from geemap import ee_tile_layers @@ -15,6 +21,7 @@ def __init__(self): self.ee_layers = {} self.geojson_layers = [] self.controls = [] + self.add = unittest.mock.MagicMock() self._recognized_attrs = self.__dict__.keys() @@ -79,9 +86,6 @@ def add_layer( } self.layers.append(layer) - def add(self, obj): - del obj # Unused. - def remove_layer(self, layer): if isinstance(layer, str): layer = self.ee_layers[layer]["ee_layer"] @@ -173,15 +177,20 @@ def observe(self, func, names): pass -class FakeTileLayer: +class FakeTileLayer(ipywidgets.Widget): + """A fake tile layer.""" + + name = traitlets.Unicode("").tag(sync=True) + visible = traitlets.Bool(True).tag(sync=True) + opacity = traitlets.Float(1).tag(sync=True) + loading = traitlets.Bool(False).tag(sync=True) + def __init__(self, name="test-layer", visible=True, opacity=1.0): + super().__init__() self.name = name self.visible = visible self.opacity = opacity - def observe(self, func, names): - pass - class FakeGeoJSONLayer: def __init__(self, name="test-layer", visible=True, style=None): diff --git a/tests/test_map_widgets.py b/tests/test_map_widgets.py index 385a5eaea9..446723f74c 100644 --- a/tests/test_map_widgets.py +++ b/tests/test_map_widgets.py @@ -459,82 +459,144 @@ def test_map_click_twice(self): ) -class TestLayerManager(unittest.TestCase): - """Tests for the LayerManager class in the `map_widgets` module.""" - - @property - def collapse_button(self): - """Returns the collapse button on layer_manager or None.""" - return utils.query_widget( - self.layer_manager, - ipywidgets.ToggleButton, - lambda c: c.tooltip == "Layer Manager", - ) +def _create_fake_map() -> fake_map.FakeMap: + ret = fake_map.FakeMap() + ret.layers = [ + fake_map.FakeTileLayer("OpenStreetMap"), # Basemap + fake_map.FakeTileLayer("GMaps", False, 0.5), # Extra basemap + fake_map.FakeEeTileLayer("test-layer", True, 0.8), + fake_map.FakeGeoJSONLayer( + "test-geojson-layer", + False, + {"some-style": "red", "opacity": 0.3, "fillOpacity": 0.2}, + ), + ] + ret.ee_layers = { + "test-layer": {"ee_object": None, "ee_layer": ret.layers[2], "vis_params": None} + } + ret.geojson_layers = [ret.layers[3]] + return ret + + +@unittest.mock.patch( + "geemap.map_widgets.LayerManagerRow._traitlet_link_type", + new=unittest.mock.Mock(return_value=ipywidgets.link), +) # jslink isn't supported in ipywidgets +class TestLayerManagerRow(unittest.TestCase): + """Tests for the LayerManagerRow class in the `layer_manager` module.""" - @property - def close_button(self): - """Returns the close button on layer_manager or None.""" - return utils.query_widget( - self.layer_manager, - ipywidgets.Button, - lambda c: c.tooltip == "Close the tool", - ) - - @property - def toggle_all_checkbox(self): - """Returns the toggle all checkbox on layer_manager or None.""" - return utils.query_widget( - self.layer_manager, - ipywidgets.Checkbox, - lambda c: c.description == "All layers on/off", + def setUp(self): + self.fake_map = _create_fake_map() + + def test_row_invalid_map_or_layer(self): + """Tests that a valid map and layer must be passed in.""" + with self.assertRaisesRegex(ValueError, "valid map and layer"): + map_widgets.LayerManagerRow(None, None) + + def test_row(self): + """Tests LayerManagerRow is initialized correctly for a standard layer.""" + layer = fake_map.FakeTileLayer(name="layer-name", visible=False, opacity=0.2) + row = map_widgets.LayerManagerRow(self.fake_map, layer) + + self.assertFalse(row.is_loading) + self.assertEqual(row.name, layer.name) + self.assertEqual(row.visible, layer.visible) + self.assertEqual(row.opacity, layer.opacity) + + def test_geojson_row(self): + """Tests LayerManagerRow is initialized correctly for a GeoJSON layer.""" + layer = fake_map.FakeGeoJSONLayer( + name="layer-name", visible=True, style={"opacity": 0.2, "fillOpacity": 0.4} + ) + self.fake_map.geojson_layers.append(layer) + row = map_widgets.LayerManagerRow(self.fake_map, layer) + + self.assertEqual(row.name, layer.name) + self.assertTrue(row.visible) + self.assertEqual(row.opacity, 0.4) + + def test_layer_update_row_properties(self): + """Tests layer updates update row traitlets.""" + layer = fake_map.FakeTileLayer(name="layer-name", visible=False, opacity=0.2) + row = map_widgets.LayerManagerRow(self.fake_map, layer) + + layer.loading = True + layer.opacity = 0.42 + layer.visible = True + self.assertTrue(row.is_loading) + self.assertEqual(row.opacity, 0.42) + self.assertTrue(row.visible) + + def test_row_update_layer_properties(self): + """Tests row updates update layer traitlets.""" + layer = fake_map.FakeTileLayer(name="layer-name", visible=False, opacity=0.2) + row = map_widgets.LayerManagerRow(self.fake_map, layer) + + row.opacity = 0.42 + row.visible = True + self.assertEqual(layer.opacity, 0.42) + self.assertTrue(layer.visible) + + def test_geojson_row_update_layer_properties(self): + """Tests GeoJSON row updates update layer traitlets.""" + layer = fake_map.FakeGeoJSONLayer( + name="layer-name", visible=True, style={"opacity": 0.2, "fillOpacity": 0.4} + ) + self.fake_map.geojson_layers.append(layer) + row = map_widgets.LayerManagerRow(self.fake_map, layer) + + row.opacity = 0.42 + row.visible = True + self.assertEqual(layer.style["opacity"], 0.42) + self.assertEqual(layer.style["fillOpacity"], 0.42) + self.assertTrue(layer.visible) + + def test_settings_button_clicked_non_ee_layer(self): + """Tests that the layer vis editor is opened when settings is clicked.""" + row = map_widgets.LayerManagerRow(self.fake_map, self.fake_map.layers[0]) + + msg = {"type": "click", "id": "settings"} + row._handle_custom_msg(msg, []) # pylint: disable=protected-access + + self.fake_map.add.assert_called_once_with( + "layer_editor", position="bottomright", layer_dict=None + ) + + def test_settings_button_clicked_ee_layer(self): + """Tests that the layer vis editor is opened when settings is clicked.""" + row = map_widgets.LayerManagerRow(self.fake_map, self.fake_map.layers[2]) + + msg = {"type": "click", "id": "settings"} + row._handle_custom_msg(msg, []) # pylint: disable=protected-access + + self.fake_map.add.assert_called_once_with( + "layer_editor", + position="bottomright", + layer_dict={ + "ee_object": None, + "ee_layer": self.fake_map.layers[2], + "vis_params": None, + }, ) - @property - def layer_rows(self): - """Returns the ipywidgets rows on layer_manager.""" - return utils.query_widget( - self.layer_manager, ipywidgets.VBox, lambda c: True - ).children[1:] + def test_delete_button_clicked(self): + """Tests that the layer is removed when delete is clicked.""" + row = map_widgets.LayerManagerRow(self.fake_map, self.fake_map.layers[0]) - def _query_checkbox_on_row(self, row, name): - return utils.query_widget( - row, ipywidgets.Checkbox, lambda c: c.description == name - ) + msg = {"type": "click", "id": "delete"} + row._handle_custom_msg(msg, []) # pylint: disable=protected-access - def _query_slider_on_row(self, row): - return utils.query_widget(row, ipywidgets.FloatSlider, lambda _: True) + self.assertEqual(len(self.fake_map.layers), 3) + self.assertEqual(self.fake_map.layers[0].name, "GMaps") + self.assertEqual(self.fake_map.layers[1].name, "test-layer") + self.assertEqual(self.fake_map.layers[2].name, "test-geojson-layer") - def _query_button_on_row(self, row): - return utils.query_widget(row, ipywidgets.Button, lambda _: True) - def _validate_row(self, row, name, checked, opacity): - self.assertEqual(self._query_checkbox_on_row(row, name).value, checked) - self.assertEqual(self._query_slider_on_row(row).value, opacity) - self.assertIsNotNone(self._query_button_on_row(row)) +class TestLayerManager(unittest.TestCase): + """Tests for the LayerManager class in the `layer_manager` module.""" def setUp(self): - self.fake_map = fake_map.FakeMap() - self.fake_map.layers = [ - fake_map.FakeTileLayer(name="OpenStreetMap"), # Basemap - fake_map.FakeTileLayer( - name="GMaps", visible=False, opacity=0.5 - ), # Extra basemap - fake_map.FakeEeTileLayer(name="test-layer", visible=True, opacity=0.8), - fake_map.FakeGeoJSONLayer( - name="test-geojson-layer", - visible=False, - style={"some-style": "red", "opacity": 0.3, "fillOpacity": 0.2}, - ), - ] - self.fake_map.ee_layers = { - "test-layer": { - "ee_object": None, - "ee_layer": self.fake_map.layers[2], - "vis_params": None, - }, - } - self.fake_map.geojson_layers = [self.fake_map.layers[3]] - + self.fake_map = _create_fake_map() self.layer_manager = map_widgets.LayerManager(self.fake_map) def test_layer_manager_no_map(self): @@ -542,122 +604,38 @@ def test_layer_manager_no_map(self): with self.assertRaisesRegex(ValueError, "valid map"): map_widgets.LayerManager(None) - def test_layer_manager(self): - self.assertIsNotNone(self.collapse_button) - self.assertIsNotNone(self.close_button) - self.assertIsNotNone(self.toggle_all_checkbox) - - # Verify computed properties are correct. - self.assertFalse(self.layer_manager.collapsed) - self.assertFalse(self.layer_manager.header_hidden) - self.assertFalse(self.layer_manager.close_button_hidden) - - self.assertEqual(len(self.layer_rows), 4) - self._validate_row(self.layer_rows[1], "GMaps", False, 0.5) - self._validate_row(self.layer_rows[2], "test-layer", True, 0.8) - self._validate_row(self.layer_rows[3], "test-geojson-layer", False, 0.3) - - def test_layer_manager_toggle_all_visibility(self): - """Tests that the toggle all checkbox changes visibilities.""" - # True then False because the event doesn't fire if the value doesn't change. - self.toggle_all_checkbox.value = True - self.toggle_all_checkbox.value = False - - layers = self.fake_map.layers - for layer in layers[1:]: # The base layer doesn't get toggled. - self.assertFalse(layer.visible, f"{layer.name} shouldn't be visible") - - self.toggle_all_checkbox.value = True - - for layer in self.fake_map.layers: - self.assertEqual(layer.visible, True, f"{layer.name} should be visible") - - def test_layer_manager_opacity_changed(self): - """Tests that the opacity slider changes opacities.""" - ee_layer = self.layer_rows[2] - ee_layer_slider = self._query_slider_on_row(ee_layer) - ee_layer_slider.value = 0.01 - self.assertEqual(self.fake_map.layers[2].opacity, 0.01) - - geojson_layer = self.layer_rows[3] - geojson_layer_slider = self._query_slider_on_row(geojson_layer) - geojson_layer_slider.value = 0.02 - self.assertEqual( - self.fake_map.layers[3].style, - {"some-style": "red", "opacity": 0.02, "fillOpacity": 0.02}, - ) - - def test_layer_manager_click_settings(self): - """Tests that the settings button fires an event.""" - on_open_vis_mock = Mock() - self.layer_manager.on_open_vis = on_open_vis_mock - ee_layer_button = self._query_button_on_row(self.layer_rows[1]) - - ee_layer_button.click() - - on_open_vis_mock.assert_called_once() - - def test_layer_manager_click_close(self): - """Tests that the close button fires an event.""" - on_close_mock = Mock() - self.layer_manager.on_close = on_close_mock - - self.close_button.click() - - on_close_mock.assert_called_once() - - def test_layer_manager_refresh_layers(self): - """Tests that refresh_layers refreshes the layers.""" - self.fake_map.layers = [] + def _validate_row( + self, index: int, name: str, visible: bool, opacity: float + ) -> None: + child = self.layer_manager.children[index] + self.assertEqual(child.host_map, self.fake_map) + self.assertEqual(child.layer, self.fake_map.layers[index]) + self.assertEqual(child.name, name) + self.assertEqual(child.visible, visible) + self.assertAlmostEqual(child.opacity, opacity) + + def test_refresh_layers_updates_children(self): + """Tests that refresh layers updates children.""" self.layer_manager.refresh_layers() - self.assertEqual(len(self.layer_rows), 0) - - def test_layer_manager_collapsed(self): - """Tests that setting the collapsed property collapses the widget.""" - self.layer_manager.collapsed = True - - self.assertIsNotNone(self.collapse_button) - self.assertIsNone(self.close_button) - self.assertIsNone(self.toggle_all_checkbox) - self.assertEqual(len(self.layer_rows), 0) - - self.layer_manager.collapsed = False + self.assertEqual(len(self.layer_manager.children), len(self.fake_map.layers)) + self._validate_row(0, name="OpenStreetMap", visible=True, opacity=1.0) + self._validate_row(1, name="GMaps", visible=False, opacity=0.5) + self._validate_row(2, name="test-layer", visible=True, opacity=0.8) + self._validate_row(3, name="test-geojson-layer", visible=False, opacity=0.3) - self.assertIsNotNone(self.collapse_button) - self.assertIsNotNone(self.close_button) - self.assertIsNotNone(self.toggle_all_checkbox) - self.assertEqual(len(self.layer_rows), 4) - - def test_layer_manager_header_hidden(self): - """Tests that setting the header_hidden property hides the header.""" - self.layer_manager.header_hidden = True - - self.assertIsNone(self.collapse_button) - self.assertIsNone(self.close_button) - self.assertIsNotNone(self.toggle_all_checkbox) - - self.layer_manager.header_hidden = False - - self.assertIsNotNone(self.collapse_button) - self.assertIsNotNone(self.close_button) - self.assertIsNotNone(self.toggle_all_checkbox) - - def test_layer_manager_close_button_hidden(self): - """Tests that setting the close_button_hidden property hides the close - button. - """ - self.layer_manager.close_button_hidden = True - - self.assertIsNotNone(self.collapse_button) - self.assertIsNone(self.close_button) - self.assertIsNotNone(self.toggle_all_checkbox) + def test_visibility_updates_children(self): + """Tests that tweaking the visibility updates children visibilities.""" + self.layer_manager.refresh_layers() + self.assertTrue(self.layer_manager.visible) - self.layer_manager.close_button_hidden = False + self.layer_manager.visible = False + for child in self.layer_manager.children: + self.assertFalse(child.visible) - self.assertIsNotNone(self.collapse_button) - self.assertIsNotNone(self.close_button) - self.assertIsNotNone(self.toggle_all_checkbox) + self.layer_manager.visible = True + for child in self.layer_manager.children: + self.assertTrue(child.visible) class TestBasemap(unittest.TestCase): diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000000..595c14b993 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,27 @@ +{ + "include": [ + "js" + ], + "compilerOptions": { + "target": "ES2020", + "module": "ESNext", + "lib": [ + "ES2020", + "DOM", + "DOM.Iterable" + ], + "skipLibCheck": true, + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "react", + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true, + "experimentalDecorators": true, + "emitDecoratorMetadata": true + } +} \ No newline at end of file From 8e3ee048ba030aa758885c8107d9016ec1af944d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 10 Oct 2024 17:21:23 +0000 Subject: [PATCH 02/57] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- geemap/static/ipywidgets_styles.js | 4 ++-- geemap/static/layer_manager.js | 4 ++-- geemap/static/layer_manager_row.js | 6 +++--- geemap/static/material_styles.js | 4 ++-- js/layer_manager_row.ts | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/geemap/static/ipywidgets_styles.js b/geemap/static/ipywidgets_styles.js index a788ad9e1b..509f652597 100644 --- a/geemap/static/ipywidgets_styles.js +++ b/geemap/static/ipywidgets_styles.js @@ -1,5 +1,5 @@ -var R=globalThis,N=R.ShadowRoot&&(R.ShadyCSS===void 0||R.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,k=Symbol(),Z=new WeakMap,E=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==k)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(N&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=Z.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Z.set(e,t))}return t}toString(){return this.cssText}},X=r=>new E(typeof r=="string"?r:r+"",void 0,k),z=(r,...t)=>{let e=r.length===1?r[0]:t.reduce((s,i,o)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[o+1],r[0]);return new E(e,r,k)},L=(r,t)=>{if(N)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=R.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s)}},T=N?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return X(e)})(r):r;var{is:pt,defineProperty:ut,getOwnPropertyDescriptor:$t,getOwnPropertyNames:ft,getOwnPropertySymbols:_t,getPrototypeOf:gt}=Object,M=globalThis,G=M.trustedTypes,mt=G?G.emptyScript:"",At=M.reactiveElementPolyfillSupport,w=(r,t)=>r,I={toAttribute(r,t){switch(t){case Boolean:r=r?mt:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},tt=(r,t)=>!pt(r,t),Y={attribute:!0,type:String,converter:I,reflect:!1,hasChanged:tt};Symbol.metadata??=Symbol("metadata"),M.litPropertyMetadata??=new WeakMap;var $=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Y){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&ut(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:o}=$t(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i?.call(this)},set(n){let p=i?.call(this);o.call(this,n),this.requestUpdate(t,p,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Y}static _$Ei(){if(this.hasOwnProperty(w("elementProperties")))return;let t=gt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(w("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(w("properties"))){let e=this.properties,s=[...ft(e),..._t(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(T(i))}else t!==void 0&&e.push(T(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return L(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let o=(s.converter?.toAttribute!==void 0?s.converter:I).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let o=s.getPropertyOptions(i),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:I;this._$Em=i,this[i]=n.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??tt)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,o]of this._$Ep)this[i]=o;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,o]of s)o.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],o)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[w("elementProperties")]=new Map,$[w("finalized")]=new Map,At?.({ReactiveElement:$}),(M.reactiveElementVersions??=[]).push("2.0.4");var J=globalThis,j=J.trustedTypes,et=j?j.createPolicy("lit-html",{createHTML:r=>r}):void 0,ht="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,at="?"+_,yt=`<${at}>`,A=document,C=()=>A.createComment(""),P=r=>r===null||typeof r!="object"&&typeof r!="function",F=Array.isArray,vt=r=>F(r)||typeof r?.[Symbol.iterator]=="function",B=`[ -\f\r]`,x=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,st=/-->/g,it=/>/g,g=RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^ +var R=globalThis,N=R.ShadowRoot&&(R.ShadyCSS===void 0||R.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,k=Symbol(),Z=new WeakMap,E=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==k)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(N&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=Z.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Z.set(e,t))}return t}toString(){return this.cssText}},X=r=>new E(typeof r=="string"?r:r+"",void 0,k),z=(r,...t)=>{let e=r.length===1?r[0]:t.reduce((s,i,o)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[o+1],r[0]);return new E(e,r,k)},L=(r,t)=>{if(N)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=R.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s)}},T=N?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return X(e)})(r):r;var{is:pt,defineProperty:ut,getOwnPropertyDescriptor:$t,getOwnPropertyNames:ft,getOwnPropertySymbols:_t,getPrototypeOf:gt}=Object,M=globalThis,G=M.trustedTypes,mt=G?G.emptyScript:"",At=M.reactiveElementPolyfillSupport,w=(r,t)=>r,I={toAttribute(r,t){switch(t){case Boolean:r=r?mt:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},tt=(r,t)=>!pt(r,t),Y={attribute:!0,type:String,converter:I,reflect:!1,hasChanged:tt};Symbol.metadata??=Symbol("metadata"),M.litPropertyMetadata??=new WeakMap;var $=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Y){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&ut(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:o}=$t(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i?.call(this)},set(n){let p=i?.call(this);o.call(this,n),this.requestUpdate(t,p,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Y}static _$Ei(){if(this.hasOwnProperty(w("elementProperties")))return;let t=gt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(w("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(w("properties"))){let e=this.properties,s=[...ft(e),..._t(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(T(i))}else t!==void 0&&e.push(T(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return L(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let o=(s.converter?.toAttribute!==void 0?s.converter:I).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let o=s.getPropertyOptions(i),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:I;this._$Em=i,this[i]=n.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??tt)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,o]of this._$Ep)this[i]=o;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,o]of s)o.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],o)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[w("elementProperties")]=new Map,$[w("finalized")]=new Map,At?.({ReactiveElement:$}),(M.reactiveElementVersions??=[]).push("2.0.4");var J=globalThis,j=J.trustedTypes,et=j?j.createPolicy("lit-html",{createHTML:r=>r}):void 0,ht="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,at="?"+_,yt=`<${at}>`,A=document,C=()=>A.createComment(""),P=r=>r===null||typeof r!="object"&&typeof r!="function",F=Array.isArray,vt=r=>F(r)||typeof r?.[Symbol.iterator]=="function",B=`[ +\f\r]`,x=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,st=/-->/g,it=/>/g,g=RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`,"g"),rt=/'/g,ot=/"/g,lt=/^(?:script|style|textarea|title)$/i,Q=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),Ut=Q(1),Ht=Q(2),Ot=Q(3),y=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),nt=new WeakMap,m=A.createTreeWalker(A,129);function ct(r,t){if(!F(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return et!==void 0?et.createHTML(t):t}var St=(r,t)=>{let e=r.length-1,s=[],i,o=t===2?"":t===3?"":"",n=x;for(let p=0;p"?(n=i??x,a=-1):d[1]===void 0?a=-2:(a=n.lastIndex-d[2].length,l=d[1],n=d[3]===void 0?g:d[3]==='"'?ot:rt):n===ot||n===rt?n=g:n===st||n===it?n=x:(n=g,i=void 0);let f=n===g&&r[p+1].startsWith("/>")?" ":"";o+=n===x?h+yt:a>=0?(s.push(l),h.slice(0,a)+ht+h.slice(a)+_+f):h+_+(a===-2?p:f)}return[ct(r,o+(r[e]||"")+(t===2?"":t===3?"":"")),s]},U=class r{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let o=0,n=0,p=t.length-1,h=this.parts,[l,d]=St(t,e);if(this.el=r.createElement(l,s),m.currentNode=this.el.content,e===2||e===3){let a=this.el.content.firstChild;a.replaceWith(...a.childNodes)}for(;(i=m.nextNode())!==null&&h.length0){i.textContent=j?j.emptyScript:"";for(let f=0;f2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=c}_$AI(t,e=this,s,i){let o=this.strings,n=!1;if(o===void 0)t=v(this,t,e,0),n=!P(t)||t!==this._$AH&&t!==y,n&&(this._$AH=t);else{let p=t,h,l;for(t=o[0],h=0;h{let s=e?.renderBefore??t,i=s._$litPart$;if(i===void 0){let o=e?.renderBefore??null;s._$litPart$=i=new H(t.insertBefore(C(),o),o,void 0,e??{})}return i._$AI(r),i};var b=class extends ${constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=dt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return y}};b._$litElement$=!0,b.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:b});var Et=globalThis.litElementPolyfillSupport;Et?.({LitElement:b});(globalThis.litElementVersions??=[]).push("4.1.0");var qt=z` .legacy-button { align-items: center; diff --git a/geemap/static/layer_manager.js b/geemap/static/layer_manager.js index 79a6fd5c7c..f6c41ce8f9 100644 --- a/geemap/static/layer_manager.js +++ b/geemap/static/layer_manager.js @@ -1,5 +1,5 @@ -var At=Object.defineProperty;var vt=Object.getOwnPropertyDescriptor;var st=(r,t,e,s)=>{for(var i=s>1?void 0:s?vt(t,e):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(i=(s?n(t,e,i):n(i))||i);return s&&i&&At(t,e,i),i};var T=globalThis,k=T.ShadowRoot&&(T.ShadyCSS===void 0||T.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,V=Symbol(),it=new WeakMap,x=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==V)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(k&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=it.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&it.set(e,t))}return t}toString(){return this.cssText}},rt=r=>new x(typeof r=="string"?r:r+"",void 0,V),w=(r,...t)=>{let e=r.length===1?r[0]:t.reduce((s,i,o)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[o+1],r[0]);return new x(e,r,V)},B=(r,t)=>{if(k)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=T.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s)}},j=k?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return rt(e)})(r):r;var{is:bt,defineProperty:St,getOwnPropertyDescriptor:Et,getOwnPropertyNames:xt,getOwnPropertySymbols:wt,getPrototypeOf:Ct}=Object,L=globalThis,ot=L.trustedTypes,Pt=ot?ot.emptyScript:"",Mt=L.reactiveElementPolyfillSupport,C=(r,t)=>r,P={toAttribute(r,t){switch(t){case Boolean:r=r?Pt:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},z=(r,t)=>!bt(r,t),nt={attribute:!0,type:String,converter:P,reflect:!1,hasChanged:z};Symbol.metadata??=Symbol("metadata"),L.litPropertyMetadata??=new WeakMap;var m=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=nt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&St(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:o}=Et(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i?.call(this)},set(n){let h=i?.call(this);o.call(this,n),this.requestUpdate(t,h,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??nt}static _$Ei(){if(this.hasOwnProperty(C("elementProperties")))return;let t=Ct(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(C("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(C("properties"))){let e=this.properties,s=[...xt(e),...wt(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(j(i))}else t!==void 0&&e.push(j(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return B(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let o=(s.converter?.toAttribute!==void 0?s.converter:P).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let o=s.getPropertyOptions(i),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:P;this._$Em=i,this[i]=n.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??z)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,o]of this._$Ep)this[i]=o;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,o]of s)o.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],o)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};m.elementStyles=[],m.shadowRootOptions={mode:"open"},m[C("elementProperties")]=new Map,m[C("finalized")]=new Map,Mt?.({ReactiveElement:m}),(L.reactiveElementVersions??=[]).push("2.0.4");var X=globalThis,I=X.trustedTypes,at=I?I.createPolicy("lit-html",{createHTML:r=>r}):void 0,ut="$lit$",g=`lit$${Math.random().toFixed(9).slice(2)}$`,mt="?"+g,Ut=`<${mt}>`,A=document,U=()=>A.createComment(""),N=r=>r===null||typeof r!="object"&&typeof r!="function",Y=Array.isArray,Nt=r=>Y(r)||typeof r?.[Symbol.iterator]=="function",W=`[ -\f\r]`,M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,lt=/-->/g,ht=/>/g,$=RegExp(`>|${W}(?:([^\\s"'>=/]+)(${W}*=${W}*(?:[^ +var At=Object.defineProperty;var vt=Object.getOwnPropertyDescriptor;var st=(r,t,e,s)=>{for(var i=s>1?void 0:s?vt(t,e):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(i=(s?n(t,e,i):n(i))||i);return s&&i&&At(t,e,i),i};var T=globalThis,k=T.ShadowRoot&&(T.ShadyCSS===void 0||T.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,V=Symbol(),it=new WeakMap,x=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==V)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(k&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=it.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&it.set(e,t))}return t}toString(){return this.cssText}},rt=r=>new x(typeof r=="string"?r:r+"",void 0,V),w=(r,...t)=>{let e=r.length===1?r[0]:t.reduce((s,i,o)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[o+1],r[0]);return new x(e,r,V)},B=(r,t)=>{if(k)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=T.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s)}},j=k?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return rt(e)})(r):r;var{is:bt,defineProperty:St,getOwnPropertyDescriptor:Et,getOwnPropertyNames:xt,getOwnPropertySymbols:wt,getPrototypeOf:Ct}=Object,L=globalThis,ot=L.trustedTypes,Pt=ot?ot.emptyScript:"",Mt=L.reactiveElementPolyfillSupport,C=(r,t)=>r,P={toAttribute(r,t){switch(t){case Boolean:r=r?Pt:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},z=(r,t)=>!bt(r,t),nt={attribute:!0,type:String,converter:P,reflect:!1,hasChanged:z};Symbol.metadata??=Symbol("metadata"),L.litPropertyMetadata??=new WeakMap;var m=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=nt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&St(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:o}=Et(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i?.call(this)},set(n){let h=i?.call(this);o.call(this,n),this.requestUpdate(t,h,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??nt}static _$Ei(){if(this.hasOwnProperty(C("elementProperties")))return;let t=Ct(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(C("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(C("properties"))){let e=this.properties,s=[...xt(e),...wt(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(j(i))}else t!==void 0&&e.push(j(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return B(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let o=(s.converter?.toAttribute!==void 0?s.converter:P).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let o=s.getPropertyOptions(i),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:P;this._$Em=i,this[i]=n.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??z)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,o]of this._$Ep)this[i]=o;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,o]of s)o.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],o)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};m.elementStyles=[],m.shadowRootOptions={mode:"open"},m[C("elementProperties")]=new Map,m[C("finalized")]=new Map,Mt?.({ReactiveElement:m}),(L.reactiveElementVersions??=[]).push("2.0.4");var X=globalThis,I=X.trustedTypes,at=I?I.createPolicy("lit-html",{createHTML:r=>r}):void 0,ut="$lit$",g=`lit$${Math.random().toFixed(9).slice(2)}$`,mt="?"+g,Ut=`<${mt}>`,A=document,U=()=>A.createComment(""),N=r=>r===null||typeof r!="object"&&typeof r!="function",Y=Array.isArray,Nt=r=>Y(r)||typeof r?.[Symbol.iterator]=="function",W=`[ +\f\r]`,M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,lt=/-->/g,ht=/>/g,$=RegExp(`>|${W}(?:([^\\s"'>=/]+)(${W}*=${W}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`,"g"),ct=/'/g,dt=/"/g,ft=/^(?:script|style|textarea|title)$/i,G=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),gt=G(1),Bt=G(2),Wt=G(3),v=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),pt=new WeakMap,_=A.createTreeWalker(A,129);function yt(r,t){if(!Y(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return at!==void 0?at.createHTML(t):t}var Ot=(r,t)=>{let e=r.length-1,s=[],i,o=t===2?"":t===3?"":"",n=M;for(let h=0;h"?(n=i??M,l=-1):p[1]===void 0?l=-2:(l=n.lastIndex-p[2].length,c=p[1],n=p[3]===void 0?$:p[3]==='"'?dt:ct):n===dt||n===ct?n=$:n===lt||n===ht?n=M:(n=$,i=void 0);let f=n===$&&r[h+1].startsWith("/>")?" ":"";o+=n===M?a+Ut:l>=0?(s.push(c),a.slice(0,l)+ut+a.slice(l)+g+f):a+g+(l===-2?h:f)}return[yt(r,o+(r[e]||"")+(t===2?"":t===3?"":"")),s]},O=class r{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let o=0,n=0,h=t.length-1,a=this.parts,[c,p]=Ot(t,e);if(this.el=r.createElement(c,s),_.currentNode=this.el.content,e===2||e===3){let l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(i=_.nextNode())!==null&&a.length0){i.textContent=I?I.emptyScript:"";for(let f=0;f2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=d}_$AI(t,e=this,s,i){let o=this.strings,n=!1;if(o===void 0)t=b(this,t,e,0),n=!N(t)||t!==this._$AH&&t!==v,n&&(this._$AH=t);else{let h=t,a,c;for(t=o[0],a=0;a{let s=e?.renderBefore??t,i=s._$litPart$;if(i===void 0){let o=e?.renderBefore??null;s._$litPart$=i=new R(t.insertBefore(U(),o),o,void 0,e??{})}return i._$AI(r),i};var y=class extends m{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=$t(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return v}};y._$litElement$=!0,y.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:y});var Ht=globalThis.litElementPolyfillSupport;Ht?.({LitElement:y});(globalThis.litElementVersions??=[]).push("4.1.0");var Tt={attribute:!0,type:String,converter:P,reflect:!1,hasChanged:z},kt=(r=Tt,t,e)=>{let{kind:s,metadata:i}=e,o=globalThis.litPropertyMetadata.get(i);if(o===void 0&&globalThis.litPropertyMetadata.set(i,o=new Map),o.set(e.name,r),s==="accessor"){let{name:n}=e;return{set(h){let a=t.get.call(this);t.set.call(this,h),this.requestUpdate(n,a,r)},init(h){return h!==void 0&&this.P(n,void 0,r),h}}}if(s==="setter"){let{name:n}=e;return function(h){let a=this[n];t.call(this,h),this.requestUpdate(n,a,r)}}throw Error("Unsupported decorator location: "+s)};function tt(r){return(t,e)=>typeof e=="object"?kt(r,t,e):((s,i,o)=>{let n=i.hasOwnProperty(o);return i.constructor.createProperty(o,n?{...s,wrapped:!0}:s),n?Object.getOwnPropertyDescriptor(i,o):void 0})(r,t,e)}var _t=w` .legacy-button { align-items: center; diff --git a/geemap/static/layer_manager_row.js b/geemap/static/layer_manager_row.js index ded592464a..b12f1ad61f 100644 --- a/geemap/static/layer_manager_row.js +++ b/geemap/static/layer_manager_row.js @@ -1,5 +1,5 @@ -var _t=Object.defineProperty;var bt=Object.getOwnPropertyDescriptor;var w=(o,t,e,s)=>{for(var i=s>1?void 0:s?bt(t,e):t,n=o.length-1,r;n>=0;n--)(r=o[n])&&(i=(s?r(t,e,i):r(i))||i);return s&&i&&_t(t,e,i),i};var L=globalThis,z=L.ShadowRoot&&(L.ShadyCSS===void 0||L.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,W=Symbol(),it=new WeakMap,k=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==W)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(z&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=it.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&it.set(e,t))}return t}toString(){return this.cssText}},ot=o=>new k(typeof o=="string"?o:o+"",void 0,W),v=(o,...t)=>{let e=o.length===1?o[0]:t.reduce((s,i,n)=>s+(r=>{if(r._$cssResult$===!0)return r.cssText;if(typeof r=="number")return r;throw Error("Value passed to 'css' function must be a 'css' function result: "+r+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+o[n+1],o[0]);return new k(e,o,W)},J=(o,t)=>{if(z)o.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=L.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,o.appendChild(s)}},D=z?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return ot(e)})(o):o;var{is:At,defineProperty:xt,getOwnPropertyDescriptor:St,getOwnPropertyNames:wt,getOwnPropertySymbols:Et,getPrototypeOf:Ct}=Object,I=globalThis,nt=I.trustedTypes,Pt=nt?nt.emptyScript:"",kt=I.reactiveElementPolyfillSupport,R=(o,t)=>o,U={toAttribute(o,t){switch(t){case Boolean:o=o?Pt:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},V=(o,t)=>!At(o,t),rt={attribute:!0,type:String,converter:U,reflect:!1,hasChanged:V};Symbol.metadata??=Symbol("metadata"),I.litPropertyMetadata??=new WeakMap;var m=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=rt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&xt(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:n}=St(this.prototype,t)??{get(){return this[e]},set(r){this[e]=r}};return{get(){return i?.call(this)},set(r){let h=i?.call(this);n.call(this,r),this.requestUpdate(t,h,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??rt}static _$Ei(){if(this.hasOwnProperty(R("elementProperties")))return;let t=Ct(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(R("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(R("properties"))){let e=this.properties,s=[...wt(e),...Et(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(D(i))}else t!==void 0&&e.push(D(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return J(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let n=(s.converter?.toAttribute!==void 0?s.converter:U).toAttribute(e,s.type);this._$Em=t,n==null?this.removeAttribute(i):this.setAttribute(i,n),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let n=s.getPropertyOptions(i),r=typeof n.converter=="function"?{fromAttribute:n.converter}:n.converter?.fromAttribute!==void 0?n.converter:U;this._$Em=i,this[i]=r.fromAttribute(e,n.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??V)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,n]of this._$Ep)this[i]=n;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,n]of s)n.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],n)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};m.elementStyles=[],m.shadowRootOptions={mode:"open"},m[R("elementProperties")]=new Map,m[R("finalized")]=new Map,kt?.({ReactiveElement:m}),(I.reactiveElementVersions??=[]).push("2.0.4");var G=globalThis,q=G.trustedTypes,at=q?q.createPolicy("lit-html",{createHTML:o=>o}):void 0,ut="$lit$",g=`lit$${Math.random().toFixed(9).slice(2)}$`,mt="?"+g,Rt=`<${mt}>`,A=document,O=()=>A.createComment(""),N=o=>o===null||typeof o!="object"&&typeof o!="function",tt=Array.isArray,Ut=o=>tt(o)||typeof o?.[Symbol.iterator]=="function",K=`[ -\f\r]`,M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,lt=/-->/g,ht=/>/g,_=RegExp(`>|${K}(?:([^\\s"'>=/]+)(${K}*=${K}*(?:[^ +var _t=Object.defineProperty;var bt=Object.getOwnPropertyDescriptor;var w=(o,t,e,s)=>{for(var i=s>1?void 0:s?bt(t,e):t,n=o.length-1,r;n>=0;n--)(r=o[n])&&(i=(s?r(t,e,i):r(i))||i);return s&&i&&_t(t,e,i),i};var L=globalThis,z=L.ShadowRoot&&(L.ShadyCSS===void 0||L.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,W=Symbol(),it=new WeakMap,k=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==W)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(z&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=it.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&it.set(e,t))}return t}toString(){return this.cssText}},ot=o=>new k(typeof o=="string"?o:o+"",void 0,W),v=(o,...t)=>{let e=o.length===1?o[0]:t.reduce((s,i,n)=>s+(r=>{if(r._$cssResult$===!0)return r.cssText;if(typeof r=="number")return r;throw Error("Value passed to 'css' function must be a 'css' function result: "+r+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+o[n+1],o[0]);return new k(e,o,W)},J=(o,t)=>{if(z)o.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=L.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,o.appendChild(s)}},D=z?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return ot(e)})(o):o;var{is:At,defineProperty:xt,getOwnPropertyDescriptor:St,getOwnPropertyNames:wt,getOwnPropertySymbols:Et,getPrototypeOf:Ct}=Object,I=globalThis,nt=I.trustedTypes,Pt=nt?nt.emptyScript:"",kt=I.reactiveElementPolyfillSupport,R=(o,t)=>o,U={toAttribute(o,t){switch(t){case Boolean:o=o?Pt:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},V=(o,t)=>!At(o,t),rt={attribute:!0,type:String,converter:U,reflect:!1,hasChanged:V};Symbol.metadata??=Symbol("metadata"),I.litPropertyMetadata??=new WeakMap;var m=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=rt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&xt(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:n}=St(this.prototype,t)??{get(){return this[e]},set(r){this[e]=r}};return{get(){return i?.call(this)},set(r){let h=i?.call(this);n.call(this,r),this.requestUpdate(t,h,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??rt}static _$Ei(){if(this.hasOwnProperty(R("elementProperties")))return;let t=Ct(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(R("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(R("properties"))){let e=this.properties,s=[...wt(e),...Et(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(D(i))}else t!==void 0&&e.push(D(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return J(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let n=(s.converter?.toAttribute!==void 0?s.converter:U).toAttribute(e,s.type);this._$Em=t,n==null?this.removeAttribute(i):this.setAttribute(i,n),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let n=s.getPropertyOptions(i),r=typeof n.converter=="function"?{fromAttribute:n.converter}:n.converter?.fromAttribute!==void 0?n.converter:U;this._$Em=i,this[i]=r.fromAttribute(e,n.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??V)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,n]of this._$Ep)this[i]=n;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,n]of s)n.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],n)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};m.elementStyles=[],m.shadowRootOptions={mode:"open"},m[R("elementProperties")]=new Map,m[R("finalized")]=new Map,kt?.({ReactiveElement:m}),(I.reactiveElementVersions??=[]).push("2.0.4");var G=globalThis,q=G.trustedTypes,at=q?q.createPolicy("lit-html",{createHTML:o=>o}):void 0,ut="$lit$",g=`lit$${Math.random().toFixed(9).slice(2)}$`,mt="?"+g,Rt=`<${mt}>`,A=document,O=()=>A.createComment(""),N=o=>o===null||typeof o!="object"&&typeof o!="function",tt=Array.isArray,Ut=o=>tt(o)||typeof o?.[Symbol.iterator]=="function",K=`[ +\f\r]`,M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,lt=/-->/g,ht=/>/g,_=RegExp(`>|${K}(?:([^\\s"'>=/]+)(${K}*=${K}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`,"g"),ct=/'/g,dt=/"/g,ft=/^(?:script|style|textarea|title)$/i,et=o=>(t,...e)=>({_$litType$:o,strings:t,values:e}),st=et(1),qt=et(2),Bt=et(3),x=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),pt=new WeakMap,b=A.createTreeWalker(A,129);function gt(o,t){if(!tt(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return at!==void 0?at.createHTML(t):t}var Mt=(o,t)=>{let e=o.length-1,s=[],i,n=t===2?"":t===3?"":"",r=M;for(let h=0;h"?(r=i??M,l=-1):p[1]===void 0?l=-2:(l=r.lastIndex-p[2].length,d=p[1],r=p[3]===void 0?_:p[3]==='"'?dt:ct):r===dt||r===ct?r=_:r===lt||r===ht?r=M:(r=_,i=void 0);let f=r===_&&o[h+1].startsWith("/>")?" ":"";n+=r===M?a+Rt:l>=0?(s.push(d),a.slice(0,l)+ut+a.slice(l)+g+f):a+g+(l===-2?h:f)}return[gt(o,n+(o[e]||"")+(t===2?"":t===3?"":"")),s]},H=class o{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let n=0,r=0,h=t.length-1,a=this.parts,[d,p]=Mt(t,e);if(this.el=o.createElement(d,s),b.currentNode=this.el.content,e===2||e===3){let l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(i=b.nextNode())!==null&&a.length0){i.textContent=q?q.emptyScript:"";for(let f=0;f2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=c}_$AI(t,e=this,s,i){let n=this.strings,r=!1;if(n===void 0)t=E(this,t,e,0),r=!N(t)||t!==this._$AH&&t!==x,r&&(this._$AH=t);else{let h=t,a,d;for(t=n[0],a=0;a{let s=e?.renderBefore??t,i=s._$litPart$;if(i===void 0){let n=e?.renderBefore??null;s._$litPart$=i=new T(t.insertBefore(O(),n),n,void 0,e??{})}return i._$AI(o),i};var y=class extends m{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=yt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return x}};y._$litElement$=!0,y.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:y});var Nt=globalThis.litElementPolyfillSupport;Nt?.({LitElement:y});(globalThis.litElementVersions??=[]).push("4.1.0");var Ht={attribute:!0,type:String,converter:U,reflect:!1,hasChanged:V},Tt=(o=Ht,t,e)=>{let{kind:s,metadata:i}=e,n=globalThis.litPropertyMetadata.get(i);if(n===void 0&&globalThis.litPropertyMetadata.set(i,n=new Map),n.set(e.name,o),s==="accessor"){let{name:r}=e;return{set(h){let a=t.get.call(this);t.set.call(this,h),this.requestUpdate(r,a,o)},init(h){return h!==void 0&&this.P(r,void 0,o),h}}}if(s==="setter"){let{name:r}=e;return function(h){let a=this[r];t.call(this,h),this.requestUpdate(r,a,o)}}throw Error("Unsupported decorator location: "+s)};function S(o){return(t,e)=>typeof e=="object"?Tt(o,t,e):((s,i,n)=>{let r=i.hasOwnProperty(n);return i.constructor.createProperty(n,r?{...s,wrapped:!0}:s),r?Object.getOwnPropertyDescriptor(i,n):void 0})(o,t,e)}var $t=v` .legacy-button { align-items: center; @@ -123,7 +123,7 @@ var _t=Object.defineProperty;var bt=Object.getOwnPropertyDescriptor;var w=(o,t,e 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } - + button.loading .spinner, button.loading:hover .close-icon, button.done-loading .close-icon { diff --git a/geemap/static/material_styles.js b/geemap/static/material_styles.js index 7207557d14..bedb21f150 100644 --- a/geemap/static/material_styles.js +++ b/geemap/static/material_styles.js @@ -1,5 +1,5 @@ -var R=globalThis,T=R.ShadowRoot&&(R.ShadyCSS===void 0||R.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,L=Symbol(),F=new WeakMap,b=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==L)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(T&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=F.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&F.set(e,t))}return t}toString(){return this.cssText}},Q=o=>new b(typeof o=="string"?o:o+"",void 0,L),z=(o,...t)=>{let e=o.length===1?o[0]:t.reduce((s,i,r)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+o[r+1],o[0]);return new b(e,o,L)},I=(o,t)=>{if(T)o.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=R.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,o.appendChild(s)}},M=T?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return Q(e)})(o):o;var{is:pt,defineProperty:ut,getOwnPropertyDescriptor:$t,getOwnPropertyNames:ft,getOwnPropertySymbols:_t,getPrototypeOf:mt}=Object,N=globalThis,Y=N.trustedTypes,At=Y?Y.emptyScript:"",gt=N.reactiveElementPolyfillSupport,w=(o,t)=>o,j={toAttribute(o,t){switch(t){case Boolean:o=o?At:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},tt=(o,t)=>!pt(o,t),G={attribute:!0,type:String,converter:j,reflect:!1,hasChanged:tt};Symbol.metadata??=Symbol("metadata"),N.litPropertyMetadata??=new WeakMap;var $=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=G){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&ut(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:r}=$t(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i?.call(this)},set(n){let p=i?.call(this);r.call(this,n),this.requestUpdate(t,p,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??G}static _$Ei(){if(this.hasOwnProperty(w("elementProperties")))return;let t=mt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(w("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(w("properties"))){let e=this.properties,s=[...ft(e),..._t(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(M(i))}else t!==void 0&&e.push(M(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return I(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let r=(s.converter?.toAttribute!==void 0?s.converter:j).toAttribute(e,s.type);this._$Em=t,r==null?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let r=s.getPropertyOptions(i),n=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute!==void 0?r.converter:j;this._$Em=i,this[i]=n.fromAttribute(e,r.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??tt)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,r]of this._$Ep)this[i]=r;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,r]of s)r.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],r)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[w("elementProperties")]=new Map,$[w("finalized")]=new Map,gt?.({ReactiveElement:$}),(N.reactiveElementVersions??=[]).push("2.0.4");var K=globalThis,k=K.trustedTypes,et=k?k.createPolicy("lit-html",{createHTML:o=>o}):void 0,ht="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,at="?"+_,yt=`<${at}>`,g=document,x=()=>g.createComment(""),P=o=>o===null||typeof o!="object"&&typeof o!="function",X=Array.isArray,vt=o=>X(o)||typeof o?.[Symbol.iterator]=="function",B=`[ -\f\r]`,C=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,st=/-->/g,it=/>/g,m=RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^ +var R=globalThis,T=R.ShadowRoot&&(R.ShadyCSS===void 0||R.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,L=Symbol(),F=new WeakMap,b=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==L)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(T&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=F.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&F.set(e,t))}return t}toString(){return this.cssText}},Q=o=>new b(typeof o=="string"?o:o+"",void 0,L),z=(o,...t)=>{let e=o.length===1?o[0]:t.reduce((s,i,r)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+o[r+1],o[0]);return new b(e,o,L)},I=(o,t)=>{if(T)o.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=R.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,o.appendChild(s)}},M=T?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return Q(e)})(o):o;var{is:pt,defineProperty:ut,getOwnPropertyDescriptor:$t,getOwnPropertyNames:ft,getOwnPropertySymbols:_t,getPrototypeOf:mt}=Object,N=globalThis,Y=N.trustedTypes,At=Y?Y.emptyScript:"",gt=N.reactiveElementPolyfillSupport,w=(o,t)=>o,j={toAttribute(o,t){switch(t){case Boolean:o=o?At:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},tt=(o,t)=>!pt(o,t),G={attribute:!0,type:String,converter:j,reflect:!1,hasChanged:tt};Symbol.metadata??=Symbol("metadata"),N.litPropertyMetadata??=new WeakMap;var $=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=G){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&ut(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:r}=$t(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i?.call(this)},set(n){let p=i?.call(this);r.call(this,n),this.requestUpdate(t,p,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??G}static _$Ei(){if(this.hasOwnProperty(w("elementProperties")))return;let t=mt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(w("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(w("properties"))){let e=this.properties,s=[...ft(e),..._t(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(M(i))}else t!==void 0&&e.push(M(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return I(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let r=(s.converter?.toAttribute!==void 0?s.converter:j).toAttribute(e,s.type);this._$Em=t,r==null?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let r=s.getPropertyOptions(i),n=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute!==void 0?r.converter:j;this._$Em=i,this[i]=n.fromAttribute(e,r.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??tt)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,r]of this._$Ep)this[i]=r;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,r]of s)r.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],r)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[w("elementProperties")]=new Map,$[w("finalized")]=new Map,gt?.({ReactiveElement:$}),(N.reactiveElementVersions??=[]).push("2.0.4");var K=globalThis,k=K.trustedTypes,et=k?k.createPolicy("lit-html",{createHTML:o=>o}):void 0,ht="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,at="?"+_,yt=`<${at}>`,g=document,x=()=>g.createComment(""),P=o=>o===null||typeof o!="object"&&typeof o!="function",X=Array.isArray,vt=o=>X(o)||typeof o?.[Symbol.iterator]=="function",B=`[ +\f\r]`,C=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,st=/-->/g,it=/>/g,m=RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`,"g"),ot=/'/g,rt=/"/g,lt=/^(?:script|style|textarea|title)$/i,Z=o=>(t,...e)=>({_$litType$:o,strings:t,values:e}),Ut=Z(1),Ht=Z(2),Ot=Z(3),y=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),nt=new WeakMap,A=g.createTreeWalker(g,129);function ct(o,t){if(!X(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return et!==void 0?et.createHTML(t):t}var St=(o,t)=>{let e=o.length-1,s=[],i,r=t===2?"":t===3?"":"",n=C;for(let p=0;p"?(n=i??C,a=-1):d[1]===void 0?a=-2:(a=n.lastIndex-d[2].length,l=d[1],n=d[3]===void 0?m:d[3]==='"'?rt:ot):n===rt||n===ot?n=m:n===st||n===it?n=C:(n=m,i=void 0);let f=n===m&&o[p+1].startsWith("/>")?" ":"";r+=n===C?h+yt:a>=0?(s.push(l),h.slice(0,a)+ht+h.slice(a)+_+f):h+_+(a===-2?p:f)}return[ct(o,r+(o[e]||"")+(t===2?"":t===3?"":"")),s]},U=class o{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let r=0,n=0,p=t.length-1,h=this.parts,[l,d]=St(t,e);if(this.el=o.createElement(l,s),A.currentNode=this.el.content,e===2||e===3){let a=this.el.content.firstChild;a.replaceWith(...a.childNodes)}for(;(i=A.nextNode())!==null&&h.length0){i.textContent=k?k.emptyScript:"";for(let f=0;f2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=c}_$AI(t,e=this,s,i){let r=this.strings,n=!1;if(r===void 0)t=v(this,t,e,0),n=!P(t)||t!==this._$AH&&t!==y,n&&(this._$AH=t);else{let p=t,h,l;for(t=r[0],h=0;h{let s=e?.renderBefore??t,i=s._$litPart$;if(i===void 0){let r=e?.renderBefore??null;s._$litPart$=i=new H(t.insertBefore(x(),r),r,void 0,e??{})}return i._$AI(o),i};var E=class extends ${constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=dt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return y}};E._$litElement$=!0,E.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:E});var bt=globalThis.litElementPolyfillSupport;bt?.({LitElement:E});(globalThis.litElementVersions??=[]).push("4.1.0");var Jt=z` @font-face { font-family: 'Material Symbols Outlined'; diff --git a/js/layer_manager_row.ts b/js/layer_manager_row.ts index 0630432dd6..e760f0105f 100644 --- a/js/layer_manager_row.ts +++ b/js/layer_manager_row.ts @@ -69,7 +69,7 @@ export class LayerManagerRow extends LitElement { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } - + button.loading .spinner, button.loading:hover .close-icon, button.done-loading .close-icon { From 919e39a07238b2b1932951bebc1b914ac573a50a Mon Sep 17 00:00:00 2001 From: Nathaniel Schmitz Date: Fri, 11 Oct 2024 16:43:43 -0400 Subject: [PATCH 03/57] Update static files --- geemap/static/ipywidgets_styles.js | 5 ++--- geemap/static/layer_manager.css | 1 - geemap/static/layer_manager.js | 5 ++--- geemap/static/layer_manager_row.css | 1 - geemap/static/layer_manager_row.js | 5 ++--- geemap/static/material_styles.js | 5 ++--- geemap/static/utils.js | 1 - 7 files changed, 8 insertions(+), 15 deletions(-) diff --git a/geemap/static/ipywidgets_styles.js b/geemap/static/ipywidgets_styles.js index 509f652597..5af999a37d 100644 --- a/geemap/static/ipywidgets_styles.js +++ b/geemap/static/ipywidgets_styles.js @@ -1,5 +1,5 @@ -var R=globalThis,N=R.ShadowRoot&&(R.ShadyCSS===void 0||R.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,k=Symbol(),Z=new WeakMap,E=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==k)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(N&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=Z.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Z.set(e,t))}return t}toString(){return this.cssText}},X=r=>new E(typeof r=="string"?r:r+"",void 0,k),z=(r,...t)=>{let e=r.length===1?r[0]:t.reduce((s,i,o)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[o+1],r[0]);return new E(e,r,k)},L=(r,t)=>{if(N)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=R.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s)}},T=N?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return X(e)})(r):r;var{is:pt,defineProperty:ut,getOwnPropertyDescriptor:$t,getOwnPropertyNames:ft,getOwnPropertySymbols:_t,getPrototypeOf:gt}=Object,M=globalThis,G=M.trustedTypes,mt=G?G.emptyScript:"",At=M.reactiveElementPolyfillSupport,w=(r,t)=>r,I={toAttribute(r,t){switch(t){case Boolean:r=r?mt:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},tt=(r,t)=>!pt(r,t),Y={attribute:!0,type:String,converter:I,reflect:!1,hasChanged:tt};Symbol.metadata??=Symbol("metadata"),M.litPropertyMetadata??=new WeakMap;var $=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Y){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&ut(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:o}=$t(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i?.call(this)},set(n){let p=i?.call(this);o.call(this,n),this.requestUpdate(t,p,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Y}static _$Ei(){if(this.hasOwnProperty(w("elementProperties")))return;let t=gt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(w("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(w("properties"))){let e=this.properties,s=[...ft(e),..._t(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(T(i))}else t!==void 0&&e.push(T(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return L(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let o=(s.converter?.toAttribute!==void 0?s.converter:I).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let o=s.getPropertyOptions(i),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:I;this._$Em=i,this[i]=n.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??tt)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,o]of this._$Ep)this[i]=o;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,o]of s)o.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],o)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[w("elementProperties")]=new Map,$[w("finalized")]=new Map,At?.({ReactiveElement:$}),(M.reactiveElementVersions??=[]).push("2.0.4");var J=globalThis,j=J.trustedTypes,et=j?j.createPolicy("lit-html",{createHTML:r=>r}):void 0,ht="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,at="?"+_,yt=`<${at}>`,A=document,C=()=>A.createComment(""),P=r=>r===null||typeof r!="object"&&typeof r!="function",F=Array.isArray,vt=r=>F(r)||typeof r?.[Symbol.iterator]=="function",B=`[ -\f\r]`,x=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,st=/-->/g,it=/>/g,g=RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^ +var R=globalThis,N=R.ShadowRoot&&(R.ShadyCSS===void 0||R.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,k=Symbol(),Z=new WeakMap,E=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==k)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(N&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=Z.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Z.set(e,t))}return t}toString(){return this.cssText}},X=r=>new E(typeof r=="string"?r:r+"",void 0,k),z=(r,...t)=>{let e=r.length===1?r[0]:t.reduce((s,i,o)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[o+1],r[0]);return new E(e,r,k)},L=(r,t)=>{if(N)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=R.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s)}},T=N?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return X(e)})(r):r;var{is:pt,defineProperty:ut,getOwnPropertyDescriptor:$t,getOwnPropertyNames:ft,getOwnPropertySymbols:_t,getPrototypeOf:gt}=Object,M=globalThis,G=M.trustedTypes,mt=G?G.emptyScript:"",At=M.reactiveElementPolyfillSupport,w=(r,t)=>r,I={toAttribute(r,t){switch(t){case Boolean:r=r?mt:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},tt=(r,t)=>!pt(r,t),Y={attribute:!0,type:String,converter:I,reflect:!1,hasChanged:tt};Symbol.metadata??=Symbol("metadata"),M.litPropertyMetadata??=new WeakMap;var $=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Y){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&ut(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:o}=$t(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i?.call(this)},set(n){let p=i?.call(this);o.call(this,n),this.requestUpdate(t,p,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Y}static _$Ei(){if(this.hasOwnProperty(w("elementProperties")))return;let t=gt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(w("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(w("properties"))){let e=this.properties,s=[...ft(e),..._t(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(T(i))}else t!==void 0&&e.push(T(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return L(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let o=(s.converter?.toAttribute!==void 0?s.converter:I).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let o=s.getPropertyOptions(i),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:I;this._$Em=i,this[i]=n.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??tt)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,o]of this._$Ep)this[i]=o;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,o]of s)o.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],o)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[w("elementProperties")]=new Map,$[w("finalized")]=new Map,At?.({ReactiveElement:$}),(M.reactiveElementVersions??=[]).push("2.0.4");var J=globalThis,j=J.trustedTypes,et=j?j.createPolicy("lit-html",{createHTML:r=>r}):void 0,ht="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,at="?"+_,yt=`<${at}>`,A=document,C=()=>A.createComment(""),P=r=>r===null||typeof r!="object"&&typeof r!="function",F=Array.isArray,vt=r=>F(r)||typeof r?.[Symbol.iterator]=="function",B=`[ +\f\r]`,x=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,st=/-->/g,it=/>/g,g=RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`,"g"),rt=/'/g,ot=/"/g,lt=/^(?:script|style|textarea|title)$/i,Q=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),Ut=Q(1),Ht=Q(2),Ot=Q(3),y=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),nt=new WeakMap,m=A.createTreeWalker(A,129);function ct(r,t){if(!F(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return et!==void 0?et.createHTML(t):t}var St=(r,t)=>{let e=r.length-1,s=[],i,o=t===2?"":t===3?"":"",n=x;for(let p=0;p"?(n=i??x,a=-1):d[1]===void 0?a=-2:(a=n.lastIndex-d[2].length,l=d[1],n=d[3]===void 0?g:d[3]==='"'?ot:rt):n===ot||n===rt?n=g:n===st||n===it?n=x:(n=g,i=void 0);let f=n===g&&r[p+1].startsWith("/>")?" ":"";o+=n===x?h+yt:a>=0?(s.push(l),h.slice(0,a)+ht+h.slice(a)+_+f):h+_+(a===-2?p:f)}return[ct(r,o+(r[e]||"")+(t===2?"":t===3?"":"")),s]},U=class r{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let o=0,n=0,p=t.length-1,h=this.parts,[l,d]=St(t,e);if(this.el=r.createElement(l,s),m.currentNode=this.el.content,e===2||e===3){let a=this.el.content.firstChild;a.replaceWith(...a.childNodes)}for(;(i=m.nextNode())!==null&&h.length0){i.textContent=j?j.emptyScript:"";for(let f=0;f2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=c}_$AI(t,e=this,s,i){let o=this.strings,n=!1;if(o===void 0)t=v(this,t,e,0),n=!P(t)||t!==this._$AH&&t!==y,n&&(this._$AH=t);else{let p=t,h,l;for(t=o[0],h=0;h{let s=e?.renderBefore??t,i=s._$litPart$;if(i===void 0){let o=e?.renderBefore??null;s._$litPart$=i=new H(t.insertBefore(C(),o),o,void 0,e??{})}return i._$AI(r),i};var b=class extends ${constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=dt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return y}};b._$litElement$=!0,b.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:b});var Et=globalThis.litElementPolyfillSupport;Et?.({LitElement:b});(globalThis.litElementVersions??=[]).push("4.1.0");var qt=z` .legacy-button { align-items: center; @@ -91,4 +91,3 @@ lit-html/is-server.js: * SPDX-License-Identifier: BSD-3-Clause *) */ -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vbm9kZV9tb2R1bGVzL0BsaXQvcmVhY3RpdmUtZWxlbWVudC9zcmMvY3NzLXRhZy50cyIsICIuLi8uLi9ub2RlX21vZHVsZXMvQGxpdC9yZWFjdGl2ZS1lbGVtZW50L3NyYy9yZWFjdGl2ZS1lbGVtZW50LnRzIiwgIi4uLy4uL25vZGVfbW9kdWxlcy9saXQtaHRtbC9zcmMvbGl0LWh0bWwudHMiLCAiLi4vLi4vbm9kZV9tb2R1bGVzL2xpdC1lbGVtZW50L3NyYy9saXQtZWxlbWVudC50cyIsICIuLi8uLi9qcy9pcHl3aWRnZXRzX3N0eWxlcy50cyJdLAogICJzb3VyY2VzQ29udGVudCI6IFsiLyoqXG4gKiBAbGljZW5zZVxuICogQ29weXJpZ2h0IDIwMTkgR29vZ2xlIExMQ1xuICogU1BEWC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hZ25hbmkpOiBmb3IgYXR0ZW1wdGVkIGR5bmFtaWMgdGFnIG5hbWVzLCB3ZSBkb24ndFxuICAgICAgICAvLyBpbmNyZW1lbnQgdGhlIGJpbmRpbmdJbmRleCwgYW5kIGl0J2xsIGJlIG9mZiBieSAxIGluIHRoZSBlbGVtZW50XG4gICAgICAgIC8vIGFuZCBvZmYgYnkgdHdvIGFmdGVyIGl0LlxuICAgICAgICBpZiAoKG5vZGUgYXMgRWxlbWVudCkuaGFzQXR0cmlidXRlcygpKSB7XG4gICAgICAgICAgZm9yIChjb25zdCBuYW1lIG9mIChub2RlIGFzIEVsZW1lbnQpLmdldEF0dHJpYnV0ZU5hbWVzKCkpIHtcbiAgICAgICAgICAgIGlmIChuYW1lLmVuZHNXaXRoKGJvdW5kQXR0cmlidXRlU3VmZml4KSkge1xuICAgICAgICAgICAgICBjb25zdCByZWFsTmFtZSA9IGF0dHJOYW1lc1thdHRyTmFtZUluZGV4KytdO1xuICAgICAgICAgICAgICBjb25zdCB2YWx1ZSA9IChub2RlIGFzIEVsZW1lbnQpLmdldEF0dHJpYnV0ZShuYW1lKSE7XG4gICAgICAgICAgICAgIGNvbnN0IHN0YXRpY3MgPSB2YWx1ZS5zcGxpdChtYXJrZXIpO1xuICAgICAgICAgICAgICBjb25zdCBtID0gLyhbLj9AXSk/KC4qKS8uZXhlYyhyZWFsTmFtZSkhO1xuICAgICAgICAgICAgICBwYXJ0cy5wdXNoKHtcbiAgICAgICAgICAgICAgICB0eXBlOiBBVFRSSUJVVEVfUEFSVCxcbiAgICAgICAgICAgICAgICBpbmRleDogbm9kZUluZGV4LFxuICAgICAgICAgICAgICAgIG5hbWU6IG1bMl0sXG4gICAgICAgICAgICAgICAgc3RyaW5nczogc3RhdGljcyxcbiAgICAgICAgICAgICAgICBjdG9yOlxuICAgICAgICAgICAgICAgICAgbVsxXSA9PT0gJy4nXG4gICAgICAgICAgICAgICAgICAgID8gUHJvcGVydHlQYXJ0XG4gICAgICAgICAgICAgICAgICAgIDogbVsxXSA9PT0gJz8nXG4gICAgICAgICAgICAgICAgICAgICAgPyBCb29sZWFuQXR0cmlidXRlUGFydFxuICAgICAgICAgICAgICAgICAgICAgIDogbVsxXSA9PT0gJ0AnXG4gICAgICAgICAgICAgICAgICAgICAgICA/IEV2ZW50UGFydFxuICAgICAgICAgICAgICAgICAgICAgICAgOiBBdHRyaWJ1dGVQYXJ0LFxuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgKG5vZGUgYXMgRWxlbWVudCkucmVtb3ZlQXR0cmlidXRlKG5hbWUpO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChuYW1lLnN0YXJ0c1dpdGgobWFya2VyKSkge1xuICAgICAgICAgICAgICBwYXJ0cy5wdXNoKHtcbiAgICAgICAgICAgICAgICB0eXBlOiBFTEVNRU5UX1BBUlQsXG4gICAgICAgICAgICAgICAgaW5kZXg6IG5vZGVJbmRleCxcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgIChub2RlIGFzIEVsZW1lbnQpLnJlbW92ZUF0dHJpYnV0ZShuYW1lKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgLy8gVE9ETyAoanVzdGluZmFnbmFuaSk6IGJlbmNobWFyayB0aGUgcmVnZXggYWdhaW5zdCB0ZXN0aW5nIGZvciBlYWNoXG4gICAgICAgIC8vIG9mIHRoZSAzIHJhdyB0ZXh0IGVsZW1lbnQgbmFtZXMuXG4gICAgICAgIGlmIChyYXdUZXh0RWxlbWVudC50ZXN0KChub2RlIGFzIEVsZW1lbnQpLnRhZ05hbWUpKSB7XG4gICAgICAgICAgLy8gRm9yIHJhdyB0ZXh0IGVsZW1lbnRzIHdlIG5lZWQgdG8gc3BsaXQgdGhlIHRleHQgY29udGVudCBvblxuICAgICAgICAgIC8vIG1hcmtlcnMsIGNyZWF0ZSBhIFRleHQgbm9kZSBmb3IgZWFjaCBzZWdtZW50LCBhbmQgY3J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BsYXRlUGFydC5pbmRleCkge1xuICAgICAgICBsZXQgcGFydDogUGFydCB8IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHRlbXBsYXRlUGFydC50eXBlID09PSBDSElMRF9QQVJUKSB7XG4gICAgICAgICAgcGFydCA9IG5ldyBDaGlsZFBhcnQoXG4gICAgICAgICAgICBub2RlIGFzIEhUTUxFbGVtZW50LFxuICAgICAgICAgICAgbm9kZS5uZXh0U2libGluZyxcbiAgICAgICAgICAgIHRoaXMsXG4gICAgICAgICAgICBvcHRpb25zLFxuICAgICAgICAgICk7XG4gICAgICAgIH0gZWxzZSBpZiAodGVtcGxhdGVQYXJ0LnR5cGUgPT09IEFUVFJJQlVURV9QQVJUKSB7XG4gICAgICAgICAgcGFydCA9IG5ldyB0ZW1wbGF0ZVBhcnQuY3RvcihcbiAgICAgICAgICAgIG5vZGUgYXMgSFRNTEVsZW1lbnQsXG4gICAgICAgICAgICB0ZW1wbGF0ZVBhcnQubmFtZSxcbiAgICAgICAgICAgIHRlbXBsYXRlUGFydC5zdHJpbmdzLFxuICAgICAgICAgICAgdGhpcyxcbiAgICAgICAgICAgIG9wdGlvbnMsXG4gICAgICAgICAgKTtcbiAgICAgICAgfSBlbHNlIGlmICh0ZW1wbGF0ZVBhcnQudHlwZSA9PT0gRUxFTUVOVF9QQVJUKSB7XG4gICAgICAgICAgcGFydCA9IG5ldyBFbGVtZW50UGFydChub2RlIGFzIEhUTUxFbGVtZW50LCB0aGlzLCBvcHRpb25zKTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLl8kcGFydHMucHVzaChwYXJ0KTtcbiAgICAgICAgdGVtcGxhdGVQYXJ0ID0gcGFydHNbKytwYXJ0SW5kZXhdO1xuICAgICAgfVxuICAgICAgaWYgKG5vZGVJbmRleCAhPT0gdGVtcGxhdGVQYXJ0Py5pbmRleCkge1xuICAgICAgICBub2RlID0gd2Fsa2VyLm5leHROb2RlKCkhO1xuICAgICAgICBub2RlSW5kZXgrKztcbiAg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uICAgICAgICBpZiAodiA9PT0gbm90aGluZykge1xuICAgICAgICAgIHZhbHVlID0gbm90aGluZztcbiAgICAgICAgfSBlbHNlIGlmICh2YWx1ZSAhPT0gbm90aGluZykge1xuICAgICAgICAgIHZhbHVlICs9ICh2ID8/ICcnKSArIHN0cmluZ3NbaSArIDFdO1xuICAgICAgICB9XG4gICAgICAgIC8vIFdlIGFsd2F5cyByZWNvcmQgZWFjaCB2YWx1ZSwgZXZlbiBpZiBvbmUgaXMgYG5vdGhpbmdgLCBmb3IgZnV0dXJlXG4gICAgICAgIC8vIGNoYW5nZSBkZXRlY3Rpb24uXG4gICAgICAgICh0aGlzLl8kY29tbWl0dGVkVmFsdWUgYXMgQXJyYXk8dW5rbm93bj4pW2ldID0gdjtcbiAgICAgIH1cbiAgICB9XG4gICAgaWYgKGNoYW5nZSAmJiAhbm9Db21taXQpIHtcbiAgICAgIHRoaXMuX2NvbW1pdFZhbHVlKHZhbHVlKTtcbiAgICB9XG4gIH1cblxuICAvKiogQGludGVybmFsICovXG4gIF9jb21taXRWYWx1ZSh2YWx1ZTogdW5rbm93bikge1xuICAgIGlmICh2YWx1ZSA9PT0gbm90aGluZykge1xuICAgICAgKHdyYXAodGhpcy5lbGVtZW50KSBhcyBFbGVtZW50KS5yZW1vdmVBdHRyaWJ1dGUodGhpcy5uYW1lKTtcbiAgICB9IGVsc2Uge1xuICAgICAgaWYgKEVOQUJMRV9FWFRSQV9TRUNVUklUWV9IT09LUykge1xuICAgICAgICBpZiAodGhpcy5fc2FuaXRpemVyID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICB0aGlzLl9zYW5pdGl6ZXIgPSBzYW5pdGl6ZXJGYWN0b3J5SW50ZXJuYWwoXG4gICAgICAgICAgICB0aGlzLmVsZW1lbnQsXG4gICAgICAgICAgICB0aGlzLm5hbWUsXG4gICAgICAgICAgICAnYXR0cmlidXRlJyxcbiAgICAgICAgICApO1xuICAgICAgICB9XG4gICAgICAgIHZhbHVlID0gdGh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XIiLCAicmVuZGVyQmVmb3JlIiwgImZpcnN0Q2hpbGQiLCAiY2hhbmdlZFByb3BlcnRpZXMiLCAidmFsdWUiLCAicmVuZGVyIiwgImhhc1VwZGF0ZWQiLCAiaXNDb25uZWN0ZWQiLCAidXBkYXRlIiwgImNvbm5lY3RlZENhbGxiYWNrIiwgInNldENvbm5lY3RlZCIsICJkaXNjb25uZWN0ZWRDYWxsYmFjayIsICJub0NoYW5nZSIsICJnbG9iYWxUaGlzIiwgImxpdEVsZW1lbnRIeWRyYXRlU3VwcG9ydCIsICJwb2x5ZmlsbFN1cHBvcnQiLCAibGl0RWxlbWVudFBvbHlmaWxsU3VwcG9ydCIsICJnbG9iYWxUaGlzIiwgImxpdEVsZW1lbnRWZXJzaW9ucyIsICJwdXNoIiwgImxlZ2FjeVN0eWxlcyIsICJpIl0KfQo= diff --git a/geemap/static/layer_manager.css b/geemap/static/layer_manager.css index 202059d823..04ef49523b 100644 --- a/geemap/static/layer_manager.css +++ b/geemap/static/layer_manager.css @@ -1,2 +1 @@ @import"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined"; -/*# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFtdLAogICJzb3VyY2VzQ29udGVudCI6IFtdLAogICJtYXBwaW5ncyI6ICIiLAogICJuYW1lcyI6IFtdCn0K */ diff --git a/geemap/static/layer_manager.js b/geemap/static/layer_manager.js index f6c41ce8f9..a8f4001eba 100644 --- a/geemap/static/layer_manager.js +++ b/geemap/static/layer_manager.js @@ -1,5 +1,5 @@ -var At=Object.defineProperty;var vt=Object.getOwnPropertyDescriptor;var st=(r,t,e,s)=>{for(var i=s>1?void 0:s?vt(t,e):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(i=(s?n(t,e,i):n(i))||i);return s&&i&&At(t,e,i),i};var T=globalThis,k=T.ShadowRoot&&(T.ShadyCSS===void 0||T.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,V=Symbol(),it=new WeakMap,x=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==V)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(k&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=it.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&it.set(e,t))}return t}toString(){return this.cssText}},rt=r=>new x(typeof r=="string"?r:r+"",void 0,V),w=(r,...t)=>{let e=r.length===1?r[0]:t.reduce((s,i,o)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[o+1],r[0]);return new x(e,r,V)},B=(r,t)=>{if(k)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=T.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s)}},j=k?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return rt(e)})(r):r;var{is:bt,defineProperty:St,getOwnPropertyDescriptor:Et,getOwnPropertyNames:xt,getOwnPropertySymbols:wt,getPrototypeOf:Ct}=Object,L=globalThis,ot=L.trustedTypes,Pt=ot?ot.emptyScript:"",Mt=L.reactiveElementPolyfillSupport,C=(r,t)=>r,P={toAttribute(r,t){switch(t){case Boolean:r=r?Pt:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},z=(r,t)=>!bt(r,t),nt={attribute:!0,type:String,converter:P,reflect:!1,hasChanged:z};Symbol.metadata??=Symbol("metadata"),L.litPropertyMetadata??=new WeakMap;var m=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=nt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&St(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:o}=Et(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i?.call(this)},set(n){let h=i?.call(this);o.call(this,n),this.requestUpdate(t,h,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??nt}static _$Ei(){if(this.hasOwnProperty(C("elementProperties")))return;let t=Ct(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(C("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(C("properties"))){let e=this.properties,s=[...xt(e),...wt(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(j(i))}else t!==void 0&&e.push(j(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return B(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let o=(s.converter?.toAttribute!==void 0?s.converter:P).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let o=s.getPropertyOptions(i),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:P;this._$Em=i,this[i]=n.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??z)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,o]of this._$Ep)this[i]=o;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,o]of s)o.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],o)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};m.elementStyles=[],m.shadowRootOptions={mode:"open"},m[C("elementProperties")]=new Map,m[C("finalized")]=new Map,Mt?.({ReactiveElement:m}),(L.reactiveElementVersions??=[]).push("2.0.4");var X=globalThis,I=X.trustedTypes,at=I?I.createPolicy("lit-html",{createHTML:r=>r}):void 0,ut="$lit$",g=`lit$${Math.random().toFixed(9).slice(2)}$`,mt="?"+g,Ut=`<${mt}>`,A=document,U=()=>A.createComment(""),N=r=>r===null||typeof r!="object"&&typeof r!="function",Y=Array.isArray,Nt=r=>Y(r)||typeof r?.[Symbol.iterator]=="function",W=`[ -\f\r]`,M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,lt=/-->/g,ht=/>/g,$=RegExp(`>|${W}(?:([^\\s"'>=/]+)(${W}*=${W}*(?:[^ +var At=Object.defineProperty;var vt=Object.getOwnPropertyDescriptor;var st=(r,t,e,s)=>{for(var i=s>1?void 0:s?vt(t,e):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(i=(s?n(t,e,i):n(i))||i);return s&&i&&At(t,e,i),i};var T=globalThis,k=T.ShadowRoot&&(T.ShadyCSS===void 0||T.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,V=Symbol(),it=new WeakMap,x=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==V)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(k&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=it.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&it.set(e,t))}return t}toString(){return this.cssText}},rt=r=>new x(typeof r=="string"?r:r+"",void 0,V),w=(r,...t)=>{let e=r.length===1?r[0]:t.reduce((s,i,o)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[o+1],r[0]);return new x(e,r,V)},B=(r,t)=>{if(k)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=T.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s)}},j=k?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return rt(e)})(r):r;var{is:bt,defineProperty:St,getOwnPropertyDescriptor:Et,getOwnPropertyNames:xt,getOwnPropertySymbols:wt,getPrototypeOf:Ct}=Object,L=globalThis,ot=L.trustedTypes,Pt=ot?ot.emptyScript:"",Mt=L.reactiveElementPolyfillSupport,C=(r,t)=>r,P={toAttribute(r,t){switch(t){case Boolean:r=r?Pt:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},z=(r,t)=>!bt(r,t),nt={attribute:!0,type:String,converter:P,reflect:!1,hasChanged:z};Symbol.metadata??=Symbol("metadata"),L.litPropertyMetadata??=new WeakMap;var m=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=nt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&St(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:o}=Et(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i?.call(this)},set(n){let h=i?.call(this);o.call(this,n),this.requestUpdate(t,h,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??nt}static _$Ei(){if(this.hasOwnProperty(C("elementProperties")))return;let t=Ct(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(C("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(C("properties"))){let e=this.properties,s=[...xt(e),...wt(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(j(i))}else t!==void 0&&e.push(j(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return B(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let o=(s.converter?.toAttribute!==void 0?s.converter:P).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let o=s.getPropertyOptions(i),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:P;this._$Em=i,this[i]=n.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??z)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,o]of this._$Ep)this[i]=o;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,o]of s)o.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],o)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};m.elementStyles=[],m.shadowRootOptions={mode:"open"},m[C("elementProperties")]=new Map,m[C("finalized")]=new Map,Mt?.({ReactiveElement:m}),(L.reactiveElementVersions??=[]).push("2.0.4");var X=globalThis,I=X.trustedTypes,at=I?I.createPolicy("lit-html",{createHTML:r=>r}):void 0,ut="$lit$",g=`lit$${Math.random().toFixed(9).slice(2)}$`,mt="?"+g,Ut=`<${mt}>`,A=document,U=()=>A.createComment(""),N=r=>r===null||typeof r!="object"&&typeof r!="function",Y=Array.isArray,Nt=r=>Y(r)||typeof r?.[Symbol.iterator]=="function",W=`[ +\f\r]`,M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,lt=/-->/g,ht=/>/g,$=RegExp(`>|${W}(?:([^\\s"'>=/]+)(${W}*=${W}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`,"g"),ct=/'/g,dt=/"/g,ft=/^(?:script|style|textarea|title)$/i,G=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),gt=G(1),Bt=G(2),Wt=G(3),v=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),pt=new WeakMap,_=A.createTreeWalker(A,129);function yt(r,t){if(!Y(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return at!==void 0?at.createHTML(t):t}var Ot=(r,t)=>{let e=r.length-1,s=[],i,o=t===2?"":t===3?"":"",n=M;for(let h=0;h"?(n=i??M,l=-1):p[1]===void 0?l=-2:(l=n.lastIndex-p[2].length,c=p[1],n=p[3]===void 0?$:p[3]==='"'?dt:ct):n===dt||n===ct?n=$:n===lt||n===ht?n=M:(n=$,i=void 0);let f=n===$&&r[h+1].startsWith("/>")?" ":"";o+=n===M?a+Ut:l>=0?(s.push(c),a.slice(0,l)+ut+a.slice(l)+g+f):a+g+(l===-2?h:f)}return[yt(r,o+(r[e]||"")+(t===2?"":t===3?"":"")),s]},O=class r{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let o=0,n=0,h=t.length-1,a=this.parts,[c,p]=Ot(t,e);if(this.el=r.createElement(c,s),_.currentNode=this.el.content,e===2||e===3){let l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(i=_.nextNode())!==null&&a.length0){i.textContent=I?I.emptyScript:"";for(let f=0;f2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=d}_$AI(t,e=this,s,i){let o=this.strings,n=!1;if(o===void 0)t=b(this,t,e,0),n=!N(t)||t!==this._$AH&&t!==v,n&&(this._$AH=t);else{let h=t,a,c;for(t=o[0],a=0;a{let s=e?.renderBefore??t,i=s._$litPart$;if(i===void 0){let o=e?.renderBefore??null;s._$litPart$=i=new R(t.insertBefore(U(),o),o,void 0,e??{})}return i._$AI(r),i};var y=class extends m{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=$t(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return v}};y._$litElement$=!0,y.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:y});var Ht=globalThis.litElementPolyfillSupport;Ht?.({LitElement:y});(globalThis.litElementVersions??=[]).push("4.1.0");var Tt={attribute:!0,type:String,converter:P,reflect:!1,hasChanged:z},kt=(r=Tt,t,e)=>{let{kind:s,metadata:i}=e,o=globalThis.litPropertyMetadata.get(i);if(o===void 0&&globalThis.litPropertyMetadata.set(i,o=new Map),o.set(e.name,r),s==="accessor"){let{name:n}=e;return{set(h){let a=t.get.call(this);t.set.call(this,h),this.requestUpdate(n,a,r)},init(h){return h!==void 0&&this.P(n,void 0,r),h}}}if(s==="setter"){let{name:n}=e;return function(h){let a=this[n];t.call(this,h),this.requestUpdate(n,a,r)}}throw Error("Unsupported decorator location: "+s)};function tt(r){return(t,e)=>typeof e=="object"?kt(r,t,e):((s,i,o)=>{let n=i.hasOwnProperty(o);return i.constructor.createProperty(o,n?{...s,wrapped:!0}:s),n?Object.getOwnPropertyDescriptor(i,o):void 0})(r,t,e)}var _t=w` .legacy-button { align-items: center; @@ -189,4 +189,3 @@ lit-html/is-server.js: * SPDX-License-Identifier: BSD-3-Clause *) */ -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vbm9kZV9tb2R1bGVzL0BsaXQvcmVhY3RpdmUtZWxlbWVudC9zcmMvY3NzLXRhZy50cyIsICIuLi8uLi9ub2RlX21vZHVsZXMvQGxpdC9yZWFjdGl2ZS1lbGVtZW50L3NyYy9yZWFjdGl2ZS1lbGVtZW50LnRzIiwgIi4uLy4uL25vZGVfbW9kdWxlcy9saXQtaHRtbC9zcmMvbGl0LWh0bWwudHMiLCAiLi4vLi4vbm9kZV9tb2R1bGVzL2xpdC1lbGVtZW50L3NyYy9saXQt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lcywgd2UgZG9uJ3RcbiAgICAgICAgLy8gaW5jcmVtZW50IHRoZSBiaW5kaW5nSW5kZXgsIGFuZCBpdCdsbCBiZSBvZmYgYnkgMSBpbiB0aGUgZWxlbWVudFxuICAgICAgICAvLyBhbmQgb2ZmIGJ5IHR3byBhZnRlciBpdC5cbiAgICAgICAgaWYgKChub2RlIGFzIEVsZW1lbnQpLmhhc0F0dHJpYnV0ZXMoKSkge1xuICAgICAgICAgIGZvciAoY29uc3QgbmFtZSBvZiAobm9kZSBhcyBFbGVtZW50KS5nZXRBdHRyaWJ1dGVOYW1lcygpKSB7XG4gICAgICAgICAgICBpZiAobmFtZS5lbmRzV2l0aChib3VuZEF0dHJpYnV0ZVN1ZmZpeCkpIHtcbiAgICAgICAgICAgICAgY29uc3QgcmVhbE5hbWUgPSBhdHRyTmFtZXNbYXR0ck5hbWVJbmRleCsrXTtcbiAgICAgICAgICAgICAgY29uc3QgdmFsdWUgPSAobm9kZSBhcyBFbGVtZW50KS5nZXRBdHRyaWJ1dGUobmFtZSkhO1xuICAgICAgICAgICAgICBjb25zdCBzdGF0aWNzID0gdmFsdWUuc3BsaXQobWFya2VyKTtcbiAgICAgICAgICAgICAgY29uc3QgbSA9IC8oWy4/QF0pPyguKikvLmV4ZWMocmVhbE5hbWUpITtcbiAgICAgICAgICAgICAgcGFydHMucHVzaCh7XG4gICAgICAgICAgICAgICAgdHlwZTogQVRUUklCVVRFX1BBUlQsXG4gICAgICAgICAgICAgICAgaW5kZXg6IG5vZGVJbmRleCxcbiAgICAgICAgICAgICAgICBuYW1lOiBtWzJdLFxuICAgICAgICAgICAgICAgIHN0cmluZ3M6IHN0YXRpY3MsXG4gICAgICAgICAgICAgICAgY3RvcjpcbiAgICAgICAgICAgICAgICAgIG1bMV0gPT09ICcuJ1xuICAgICAgICAgICAgICAgICAgICA/IFByb3BlcnR5UGFydFxuICAgICAgICAgICAgICAgICAgICA6IG1bMV0gPT09ICc/J1xuICAgICAgICAgICAgICAgICAgICAgID8gQm9vbGVhbkF0dHJpYnV0ZVBhcnRcbiAgICAgICAgICAgICAgICAgICAgICA6IG1bMV0gPT09ICdAJ1xuICAgICAgICAgICAgICAgICAgICAgICAgPyBFdmVudFBhcnRcbiAgICAgICAgICAgICAgICAgICAgICAgIDogQXR0cmlidXRlUGFydCxcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgIChub2RlIGFzIEVsZW1lbnQpLnJlbW92ZUF0dHJpYnV0ZShuYW1lKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobmFtZS5zdGFydHNXaXRoKG1hcmtlcikpIHtcbiAgICAgICAgICAgICAgcGFydHMucHVzaCh7XG4gICAgICAgICAgICAgICAgdHlwZTogRUxFTUVOVF9QQVJULFxuICAgICAgICAgICAgICAgIGluZGV4OiBub2RlSW5kZXgsXG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAobm9kZSBhcyBFbGVtZW50KS5yZW1vdmVBdHRyaWJ1dGUobmFtZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIC8vIFRPRE8gKGp1c3RpbmZhZ25hbmkpOiBiZW5jaG1hcmsgdGhlIHJlZ2V4IGFnYWluc3QgdGVzdGluZyBmb3IgZWFjaFxuICAgICAgICAvLyBvZiB0aGUgMyByYXcgdGV4dCBlbGVtZW50IG5hbWVzLlxuICAgICAgICBpZiAocmF3VGV4dEVsZW1lbnQudGVzdCgobm9kZSBhcyBFbGVtZW50KS50YWdOYW1lKSkge1xuICAgICAgICAgIC8vIEZvciByYXcgdGV4dCBlbGVtZW50cyB3ZSBuZWVkIHRvIHNwbGl0IHRoZSB0ZXh0IGNvbnRlbnQgb25cbiAgICAgICAgICAvLyBtYXJrZXJzLCBjcmVhdGUgYSBUZXh0IG5vZGUgZm9yIGVhY2ggc2VnbWVudCwgYW5kIGNyZWF0ZVxuICAgICAgICAgIC8vIGEgVGVtcGxhdGVQYXJ0IGZvciBlYWNoIG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GggYCArXG4gICAgICAgICAgICAgICAgYGNzcyBjdXN0b20gcHJvcGVydGllcywgOjpwYXJ0cywgPHNsb3Q+cywgYCArXG4gICAgICAgICAgICAgICAgYGFuZCBieSBtdXRhdGluZyB0aGUgRE9NIHJhdGhlciB0aGFuIHN0eWxlc2hlZXRzLmA7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBtZXNzYWdlID1cbiAgICAgICAgICAgICAgICBgTGl0IGRvZXMgbm90IHN1cHBvcnQgYmluZGluZyBpbnNpZGUgc2NyaXB0IG5vZGVzLiBgICtcbiAgICAgICAgICAgICAgICBgVGhpcyBpcyBhIHNlY3VyaXR5IHJpc2ssIGFzIGl0IGNvdWxkIGFsbG93IGFyYml0cmFyeSBgICtcbiAgICAgICAgICAgICAgICBgY29kZSBleGVjdXRpb24uYDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgdGhyb3cgbmV3IEVycm9yKG1lc3NhZ2UpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBkZWJ1Z0xvZ0V2ZW50ICYmXG4gICAgICAgIGRlYnVnTG9nRXZlbnQoe1xuICAgICAgICAgIGtpbmQ6ICdjb21taXQgbm9kZScsXG4gICAgICAgICAgc3RhcnQ6IHRoaXMuXyRzdGFydE5vZGUsXG4gICAgICAgICAgcGFyZW50OiB0aGlzLl8kcGFyZW50LFxuICAgICAgICAgIHZhbHVlOiB2YWx1ZSxcbiAgICAgICAgICBvcHRpb25zOiB0aGlzLm9wdGlvbnMsXG4gICAgICAgIH0pO1xuICAgICAgdGhpcy5fJGNvbW1pdHRlZFZhbHVlID0gdGhpcy5faW5zZXJ0KHZhbHVlKTtcbiAgICB9XG4gIH1cblxuICBwcml2YXRlIF9jb21taXRUZXh0KHZhbHVlOiB1bmtub3duKTogdm9pZCB7XG4gICAgLy8gSWYgdGhlIGNvbW1pdHRlZCB2YWx1ZSBpcyBhIHByaW1pdGl2ZSBpdCBtZWFucyB3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5hZ2VyYDtcbiAgICB9XG5cbiAgICBzdGF0aWMgc3R5bGVzID0gW1xuICAgICAgICBsZWdhY3lTdHlsZXMsXG4gICAgICAgIGNzc2BcbiAgICAgICAgICAgIC5jb250YWluZXIge1xuICAgICAgICAgICAgICAgIHBhZGRpbmc6IDAgNHB4IDJweCA0cHg7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC5yb3cge1xuICAgICAgICAgICAgICAgIGFsaWduLWl0ZW1zOiBjZW50ZXI7XG4gICAgICAgICAgICAgICAgZGlzcGxheTogZmxleDtcbiAgICAgICAgICAgICAgICBnYXA6IDRweDtcbiAgICAgICAgICAgICAgICBoZWlnaHQ6IDMwcHg7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC52aXNpYmlsaXR5LWNoZWNrYm94IHtcbiAgICAgICAgICAgICAgICBtYXJnaW46IDJweDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgYCxcbiAgICBdO1xuXG4gICAgcHJpdmF0ZSBfbW9kZWw6IEFueU1vZGVsPExheWVyTWFuYWdlck1vZGVsPiB8IHVuZGVmaW5lZCA9IHVuZGVmaW5lZDtcbiAgICBwcml2YXRlIHN0YXRpYyBtb2RlbE5hbWVUb1ZpZXdOYW1lID0gbmV3IE1hcDxrZXlvZiBMYXllck1hbmFnZXJNb2RlbCwga2V5b2YgTGF5ZXJNYW5hZ2VyIHwgbnVsbD4oW1xuICAgICAgICBbXCJjaGlsZHJlblwiLCBudWxsXSxcbiAgICAgICAgW1widmlzaWJsZVwiLCBcInZpc2libGVcIl0sXG4gICAgXSk7XG5cbiAgICBzZXQgbW9kZWwobW9kZWw6IEFueU1vZGVsPExheWVyTWFuYWdlck1vZGVsPikge1xuICAgICAgICB0aGlzLl9tb2RlbCA9IG1vZGVsO1xuICAgICAgICBmb3IgKGNvbnN0IFttb2RlbEtleSwgd2lkZ2V0S2V5XSBvZiBMYXllck1hbmFnZXIubW9kZWxOYW1lVG9WaWV3TmFtZSkge1xuICAgICAgICAgICAgaWYgKHdpZGdldEtleSkge1xuICAgICAgICAgICAgICAgIC8vIEdldCBpbml0aWFsIHZhbHVlcyBmcm9tIHRoZSBQeXRob24gbW9kZWwuXG4gICAgICAgICAgICAgICAgKHRoaXMgYXMgYW55KVt3aWRnZXRLZXldID0gbW9kZWwuZ2V0KG1vZGVsS2V5KTtcbiAgICAgICAgICAgICAgICAvLyBMaXN0ZW4gZm9yIHVwZGF0ZXMgdG8gdGhlIG1vZGVsLlxuICAgICAgICAgICAgICAgIG1vZGVsLm9uKGBjaGFuZ2U6JHttb2RlbEtleX1gLCAoKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICh0aGlzIGFzIGFueSlbd2lkZ2V0S2V5XSA9IG1vZGVsLmdldChtb2RlbEtleSk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBAcHJvcGVydHkoKVxuICAgIHZpc2libGU6IGJvb2xlYW4gPSBmYWxzZTtcblxuICAgIHJlbmRlcigpIHtcbiAgICAgICAgcmV0dXJuIGh0bWxgXG4gICAgICAgICAgICA8ZGl2IGNsYXNzPVwiY29udGFpbmVyXCI+XG4gICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInJvd1wiPlxuICAgICAgICAgICAgICAgICAgICA8aW5wdXRcbiAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU9XCJjaGVja2JveFwiXG4gICAgICAgICAgICAgICAgICAgICAgICBjbGFzcz1cInZpc2liaWxpdHktY2hlY2tib3hcIlxuICAgICAgICAgICAgICAgICAgICAgICAgLmNoZWNrZWQ9XCIke3RoaXMudmlzaWJsZX1cIlxuICAgICAgICAgICAgICAgICAgICAgICAgQGNoYW5nZT1cIiR7dGhpcy5vbkxheWVyVmlzaWJpbGl0eUNoYW5nZWR9XCJcbiAgICAgICAgICAgICAgICAgICAgLz5cbiAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJsZWdhY3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CAiaSIsICJ1bnBhY2tNb2RlbHMiLCAibW9kZWxJZHMiLCAibWFuYWdlciIsICJpZCIsICJ1cGRhdGVDaGlsZHJlbiIsICJjb250YWluZXIiLCAibW9kZWwiLCAiY2hpbGRyZW4iLCAiY2hpbGRfbW9kZWxzIiwgImNoaWxkX3ZpZXdzIiwgImNoaWxkX3ZpZXciLCAiX0xheWVyTWFuYWdlciIsICJoIiwgImxlZ2FjeVN0eWxlcyIsICJpIiwgIm1vZGVsIiwgIm1vZGVsS2V5IiwgIndpZGdldEtleSIsICJrZSIsICJjaGFuZ2VkUHJvcGVydGllcyIsICJwcm9wZXJ0eSIsICJfIiwgImV2ZW50IiwgInRhcmdldCIsICJfX2RlY29yYXRlQ2xhc3MiLCAibiIsICJMYXllck1hbmFnZXIiLCAicmVuZGVyIiwgImVsIiwgIm1hbmFnZXIiLCAidXBkYXRlQ2hpbGRyZW4iLCAibGF5ZXJfbWFuYWdlcl9kZWZhdWx0Il0KfQo= diff --git a/geemap/static/layer_manager_row.css b/geemap/static/layer_manager_row.css index 202059d823..04ef49523b 100644 --- a/geemap/static/layer_manager_row.css +++ b/geemap/static/layer_manager_row.css @@ -1,2 +1 @@ @import"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined"; -/*# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFtdLAogICJzb3VyY2VzQ29udGVudCI6IFtdLAogICJtYXBwaW5ncyI6ICIiLAogICJuYW1lcyI6IFtdCn0K */ diff --git a/geemap/static/layer_manager_row.js b/geemap/static/layer_manager_row.js index b12f1ad61f..010a3b9d5d 100644 --- a/geemap/static/layer_manager_row.js +++ b/geemap/static/layer_manager_row.js @@ -1,5 +1,5 @@ -var _t=Object.defineProperty;var bt=Object.getOwnPropertyDescriptor;var w=(o,t,e,s)=>{for(var i=s>1?void 0:s?bt(t,e):t,n=o.length-1,r;n>=0;n--)(r=o[n])&&(i=(s?r(t,e,i):r(i))||i);return s&&i&&_t(t,e,i),i};var L=globalThis,z=L.ShadowRoot&&(L.ShadyCSS===void 0||L.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,W=Symbol(),it=new WeakMap,k=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==W)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(z&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=it.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&it.set(e,t))}return t}toString(){return this.cssText}},ot=o=>new k(typeof o=="string"?o:o+"",void 0,W),v=(o,...t)=>{let e=o.length===1?o[0]:t.reduce((s,i,n)=>s+(r=>{if(r._$cssResult$===!0)return r.cssText;if(typeof r=="number")return r;throw Error("Value passed to 'css' function must be a 'css' function result: "+r+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+o[n+1],o[0]);return new k(e,o,W)},J=(o,t)=>{if(z)o.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=L.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,o.appendChild(s)}},D=z?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return ot(e)})(o):o;var{is:At,defineProperty:xt,getOwnPropertyDescriptor:St,getOwnPropertyNames:wt,getOwnPropertySymbols:Et,getPrototypeOf:Ct}=Object,I=globalThis,nt=I.trustedTypes,Pt=nt?nt.emptyScript:"",kt=I.reactiveElementPolyfillSupport,R=(o,t)=>o,U={toAttribute(o,t){switch(t){case Boolean:o=o?Pt:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},V=(o,t)=>!At(o,t),rt={attribute:!0,type:String,converter:U,reflect:!1,hasChanged:V};Symbol.metadata??=Symbol("metadata"),I.litPropertyMetadata??=new WeakMap;var m=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=rt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&xt(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:n}=St(this.prototype,t)??{get(){return this[e]},set(r){this[e]=r}};return{get(){return i?.call(this)},set(r){let h=i?.call(this);n.call(this,r),this.requestUpdate(t,h,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??rt}static _$Ei(){if(this.hasOwnProperty(R("elementProperties")))return;let t=Ct(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(R("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(R("properties"))){let e=this.properties,s=[...wt(e),...Et(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(D(i))}else t!==void 0&&e.push(D(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return J(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let n=(s.converter?.toAttribute!==void 0?s.converter:U).toAttribute(e,s.type);this._$Em=t,n==null?this.removeAttribute(i):this.setAttribute(i,n),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let n=s.getPropertyOptions(i),r=typeof n.converter=="function"?{fromAttribute:n.converter}:n.converter?.fromAttribute!==void 0?n.converter:U;this._$Em=i,this[i]=r.fromAttribute(e,n.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??V)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,n]of this._$Ep)this[i]=n;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,n]of s)n.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],n)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};m.elementStyles=[],m.shadowRootOptions={mode:"open"},m[R("elementProperties")]=new Map,m[R("finalized")]=new Map,kt?.({ReactiveElement:m}),(I.reactiveElementVersions??=[]).push("2.0.4");var G=globalThis,q=G.trustedTypes,at=q?q.createPolicy("lit-html",{createHTML:o=>o}):void 0,ut="$lit$",g=`lit$${Math.random().toFixed(9).slice(2)}$`,mt="?"+g,Rt=`<${mt}>`,A=document,O=()=>A.createComment(""),N=o=>o===null||typeof o!="object"&&typeof o!="function",tt=Array.isArray,Ut=o=>tt(o)||typeof o?.[Symbol.iterator]=="function",K=`[ -\f\r]`,M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,lt=/-->/g,ht=/>/g,_=RegExp(`>|${K}(?:([^\\s"'>=/]+)(${K}*=${K}*(?:[^ +var _t=Object.defineProperty;var bt=Object.getOwnPropertyDescriptor;var w=(o,t,e,s)=>{for(var i=s>1?void 0:s?bt(t,e):t,n=o.length-1,r;n>=0;n--)(r=o[n])&&(i=(s?r(t,e,i):r(i))||i);return s&&i&&_t(t,e,i),i};var L=globalThis,z=L.ShadowRoot&&(L.ShadyCSS===void 0||L.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,W=Symbol(),it=new WeakMap,k=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==W)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(z&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=it.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&it.set(e,t))}return t}toString(){return this.cssText}},ot=o=>new k(typeof o=="string"?o:o+"",void 0,W),v=(o,...t)=>{let e=o.length===1?o[0]:t.reduce((s,i,n)=>s+(r=>{if(r._$cssResult$===!0)return r.cssText;if(typeof r=="number")return r;throw Error("Value passed to 'css' function must be a 'css' function result: "+r+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+o[n+1],o[0]);return new k(e,o,W)},J=(o,t)=>{if(z)o.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=L.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,o.appendChild(s)}},D=z?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return ot(e)})(o):o;var{is:At,defineProperty:xt,getOwnPropertyDescriptor:St,getOwnPropertyNames:wt,getOwnPropertySymbols:Et,getPrototypeOf:Ct}=Object,I=globalThis,nt=I.trustedTypes,Pt=nt?nt.emptyScript:"",kt=I.reactiveElementPolyfillSupport,R=(o,t)=>o,U={toAttribute(o,t){switch(t){case Boolean:o=o?Pt:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},V=(o,t)=>!At(o,t),rt={attribute:!0,type:String,converter:U,reflect:!1,hasChanged:V};Symbol.metadata??=Symbol("metadata"),I.litPropertyMetadata??=new WeakMap;var m=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=rt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&xt(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:n}=St(this.prototype,t)??{get(){return this[e]},set(r){this[e]=r}};return{get(){return i?.call(this)},set(r){let h=i?.call(this);n.call(this,r),this.requestUpdate(t,h,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??rt}static _$Ei(){if(this.hasOwnProperty(R("elementProperties")))return;let t=Ct(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(R("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(R("properties"))){let e=this.properties,s=[...wt(e),...Et(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(D(i))}else t!==void 0&&e.push(D(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return J(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let n=(s.converter?.toAttribute!==void 0?s.converter:U).toAttribute(e,s.type);this._$Em=t,n==null?this.removeAttribute(i):this.setAttribute(i,n),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let n=s.getPropertyOptions(i),r=typeof n.converter=="function"?{fromAttribute:n.converter}:n.converter?.fromAttribute!==void 0?n.converter:U;this._$Em=i,this[i]=r.fromAttribute(e,n.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??V)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,n]of this._$Ep)this[i]=n;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,n]of s)n.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],n)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};m.elementStyles=[],m.shadowRootOptions={mode:"open"},m[R("elementProperties")]=new Map,m[R("finalized")]=new Map,kt?.({ReactiveElement:m}),(I.reactiveElementVersions??=[]).push("2.0.4");var G=globalThis,q=G.trustedTypes,at=q?q.createPolicy("lit-html",{createHTML:o=>o}):void 0,ut="$lit$",g=`lit$${Math.random().toFixed(9).slice(2)}$`,mt="?"+g,Rt=`<${mt}>`,A=document,O=()=>A.createComment(""),N=o=>o===null||typeof o!="object"&&typeof o!="function",tt=Array.isArray,Ut=o=>tt(o)||typeof o?.[Symbol.iterator]=="function",K=`[ +\f\r]`,M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,lt=/-->/g,ht=/>/g,_=RegExp(`>|${K}(?:([^\\s"'>=/]+)(${K}*=${K}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`,"g"),ct=/'/g,dt=/"/g,ft=/^(?:script|style|textarea|title)$/i,et=o=>(t,...e)=>({_$litType$:o,strings:t,values:e}),st=et(1),qt=et(2),Bt=et(3),x=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),pt=new WeakMap,b=A.createTreeWalker(A,129);function gt(o,t){if(!tt(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return at!==void 0?at.createHTML(t):t}var Mt=(o,t)=>{let e=o.length-1,s=[],i,n=t===2?"":t===3?"":"",r=M;for(let h=0;h"?(r=i??M,l=-1):p[1]===void 0?l=-2:(l=r.lastIndex-p[2].length,d=p[1],r=p[3]===void 0?_:p[3]==='"'?dt:ct):r===dt||r===ct?r=_:r===lt||r===ht?r=M:(r=_,i=void 0);let f=r===_&&o[h+1].startsWith("/>")?" ":"";n+=r===M?a+Rt:l>=0?(s.push(d),a.slice(0,l)+ut+a.slice(l)+g+f):a+g+(l===-2?h:f)}return[gt(o,n+(o[e]||"")+(t===2?"":t===3?"":"")),s]},H=class o{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let n=0,r=0,h=t.length-1,a=this.parts,[d,p]=Mt(t,e);if(this.el=o.createElement(d,s),b.currentNode=this.el.content,e===2||e===3){let l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(i=b.nextNode())!==null&&a.length0){i.textContent=q?q.emptyScript:"";for(let f=0;f2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=c}_$AI(t,e=this,s,i){let n=this.strings,r=!1;if(n===void 0)t=E(this,t,e,0),r=!N(t)||t!==this._$AH&&t!==x,r&&(this._$AH=t);else{let h=t,a,d;for(t=n[0],a=0;a{let s=e?.renderBefore??t,i=s._$litPart$;if(i===void 0){let n=e?.renderBefore??null;s._$litPart$=i=new T(t.insertBefore(O(),n),n,void 0,e??{})}return i._$AI(o),i};var y=class extends m{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=yt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return x}};y._$litElement$=!0,y.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:y});var Nt=globalThis.litElementPolyfillSupport;Nt?.({LitElement:y});(globalThis.litElementVersions??=[]).push("4.1.0");var Ht={attribute:!0,type:String,converter:U,reflect:!1,hasChanged:V},Tt=(o=Ht,t,e)=>{let{kind:s,metadata:i}=e,n=globalThis.litPropertyMetadata.get(i);if(n===void 0&&globalThis.litPropertyMetadata.set(i,n=new Map),n.set(e.name,o),s==="accessor"){let{name:r}=e;return{set(h){let a=t.get.call(this);t.set.call(this,h),this.requestUpdate(r,a,o)},init(h){return h!==void 0&&this.P(r,void 0,o),h}}}if(s==="setter"){let{name:r}=e;return function(h){let a=this[r];t.call(this,h),this.requestUpdate(r,a,o)}}throw Error("Unsupported decorator location: "+s)};function S(o){return(t,e)=>typeof e=="object"?Tt(o,t,e):((s,i,n)=>{let r=i.hasOwnProperty(n);return i.constructor.createProperty(n,r?{...s,wrapped:!0}:s),r?Object.getOwnPropertyDescriptor(i,n):void 0})(o,t,e)}var $t=v` .legacy-button { align-items: center; @@ -301,4 +301,3 @@ lit-html/is-server.js: * SPDX-License-Identifier: BSD-3-Clause *) */ -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vbm9kZV9tb2R1bGVzL0BsaXQvcmVhY3RpdmUtZWxlbWVudC9zcmMvY3NzLXRhZy50cyIsICIuLi8uLi9ub2RlX21vZHVsZXMvQGxpdC9yZWFjdGl2ZS1lbGVtZW50L3NyYy9yZWFjdGl2ZS1lbGVtZW50LnRzIiwgIi4uLy4uL25vZGVfbW9kdWxlcy9saXQtaHR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2YWx1ZS5zcGxpdChtYXJrZXIpO1xuICAgICAgICAgICAgICBjb25zdCBtID0gLyhbLj9AXSk/KC4qKS8uZXhlYyhyZWFsTmFtZSkhO1xuICAgICAgICAgICAgICBwYXJ0cy5wdXNoKHtcbiAgICAgICAgICAgICAgICB0eXBlOiBBVFRSSUJVVEVfUEFSVCxcbiAgICAgICAgICAgICAgICBpbmRleDogbm9kZUluZGV4LFxuICAgICAgICAgICAgICAgIG5hbWU6IG1bMl0sXG4gICAgICAgICAgICAgICAgc3RyaW5nczogc3RhdGljcyxcbiAgICAgICAgICAgICAgICBjdG9yOlxuICAgICAgICAgICAgICAgICAgbVsxXSA9PT0gJy4nXG4gICAgICAgICAgICAgICAgICAgID8gUHJvcGVydHlQYXJ0XG4gICAgICAgICAgICAgICAgICAgIDogbVsxXSA9PT0gJz8nXG4gICAgICAgICAgICAgICAgICAgICAgPyBCb29sZWFuQXR0cmlidXRlUGFydFxuICAgICAgICAgICAgICAgICAgICAgIDogbVsxXSA9PT0gJ0AnXG4gICAgICAgICAgICAgICAgICAgICAgICA/IEV2ZW50UGFydFxuICAgICAgICAgICAgICAgICAgICAgICAgOiBBdHRyaWJ1dGVQYXJ0LFxuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgKG5vZGUgYXMgRWxlbWVudCkucmVtb3ZlQXR0cmlidXRlKG5hbWUpO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChuYW1lLnN0YXJ0c1dpdGgobWFya2VyKSkge1xuICAgICAgICAgICAgICBwYXJ0cy5wdXNoKHtcbiAgICAgICAgICAgICAgICB0eXBlOiBFTEVNRU5UX1BBUlQsXG4gICAgICAgICAgICAgICAgaW5kZXg6IG5vZGVJbmRleCxcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgIChub2RlIGFzIEVsZW1lbnQpLnJlbW92ZUF0dHJpYnV0ZShuYW1lKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAg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ZmFjZSBMYXllck1hbmFnZXJSb3dNb2RlbCB7XG4gICAgbmFtZTogc3RyaW5nO1xuICAgIHZpc2libGU6IGJvb2xlYW47XG4gICAgb3BhY2l0eTogbnVtYmVyO1xuICAgIGlzX2xvYWRpbmc6IGJvb2xlYW47XG59XG5cbmV4cG9ydCBjbGFzcyBMYXllck1hbmFnZXJSb3cgZXh0ZW5kcyBMaXRFbGVtZW50IHtcbiAgICBzdGF0aWMgZ2V0IGNvbXBvbmVudE5hbWUoKSB7XG4gICAgICAgIHJldHVybiBgbGF5ZXItbWFuYWdlci1yb3dgO1xuICAgIH1cblxuICAgIHN0YXRpYyBzdHlsZXMgPSBbXG4gICAgICAgIGxlZ2FjeVN0eWxlcyxcbiAgICAgICAgbWF0ZXJpYWxTdHlsZXMsXG4gICAgICAgIGNzc2BcbiAgICAgICAgICAgIC5yb3cge1xuICAgICAgICAgICAgICAgIGFsaWduLWl0ZW1zOiBjZW50ZXI7XG4gICAgICAgICAgICAgICAgZGlzcGxheTogZmxleDtcbiAgICAgICAgICAgICAgICBnYXA6IDRweDtcbiAgICAgICAgICAgICAgICBoZWlnaHQ6IDMwcHg7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC5sYXllci1uYW1lIHtcbiAgICAgICAgICAgICAgICBmbGV4LWdyb3c6IDE7XG4gICAgICAgICAgICAgICAgbWF4LXdpZHRoOiAxNTBweDtcbiAgICAgICAgICAgICAgICBvdmVyZmxvdzogaGlkZGVuO1xuICAgICAgICAgICAgICAgIHRleHQtb3ZlcmZsb3c6IGVsbGlwc2lzO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAuc2V0dGluZ3MtZGVsZXRlLWJ1dHRvbiB7XG4gICAgICAgICAgICAgICAgZm9udC1zaXplOiAxNHB4O1xuICAgICAgICAgICAgICAgIGhlaWdodDogMjZweDtcbiAgICAgICAgICAgICAgICB3aWR0aDogMjZweDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLmxheWVyLW9wYWNpdHktc2xpZGVyIHtcbiAgICAgICAgICAgICAgICB3aWR0aDogNzBweDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLmxheWVyLXZpc2liaWxpdHktY2hlY2tib3gge1xuICAgICAgICAgICAgICAgIG1hcmdpbjogMnB4O1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAuc3Bpbm5lciB7XG4gICAgICAgICAgICAgICAgLXdlYmtpdC1hbmltYXRpb246IHNwaW4gMnMgbGluZWFyIGluZmluaXRlO1xuICAgICAgICAgICAgICAgIGFuaW1hdGlvbjogc3BpbiAycyBsaW5lYXIgaW5maW5pdGU7XG4gICAgICAgICAgICAgICAgYm9yZGVyLXJhZGl1czogNTAlO1xuICAgICAgICAgICAgICAgIGJvcmRlcjogNHB4IHNvbGlkIHZhcigtLWpwLXdpZGdldHMtaW5wdXQtYm9yZGVyLWNvbG9yKTtcbiAgICAgICAgICAgICAgICBib3JkZXItdG9wOiA0cHggc29saWQgdmFyKC0tanAtd2lkZ2V0cy1jb2xvcik7XG4gICAgICAgICAgICAgICAgaGVpZ2h0OiAxMnB4O1xuICAgICAgICAgICAgICAgIHdpZHRoOiAxMnB4O1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBALXdlYmtpdC1rZXlmcmFtZXMgc3BpbiB7XG4gICAgICAgICAgICAgICAgMCUgeyAtd2Via2l0LXRyYW5zZm9ybTogcm90YXRlKDBkZWcpOyB9XG4gICAgICAgICAgICAgICAgMTAwJSB7IC13ZWJraXQtdHJhbnNmb3JtOiByb3RhdGUoMzYwZGVnKTsgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBAa2V5ZnJhbWVzIHNwaW4ge1xuICAgICAgICAgICAgICAgIDAlIHsgdHJhbnNmb3JtOiByb3RhdGUoMGRlZyk7IH1cbiAgICAgICAgICAgICAgICAxMDAlIHsgdHJhbnNmb3JtOiByb3RhdGUoMzYwZGVnKTsgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIFxuICAgICAgICAgICAgYnV0dG9uLmxvYWRpbmcgLnNwaW5uZXIsXG4gICAgICAgICAgICBidXR0b24ubG9hZGluZzpob3ZlciAuY2xvc2UtaWNvbixcbiAgICAgICAgICAgIGJ1dHRvbi5kb25lLWxvYWRpbmcgLmNsb3NlLWljb24ge1xuICAgICAgICAgICAgICAgIGRpc3BsYXk6IGJsb2NrO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBidXR0b24ubG9hZGluZyAuY2xvc2UtaWNvbixcbiAgICAgICAgICAgIGJ1dHRvbi5sb2FkaW5nOmhvdmVyIC5zcGlubmVyLFxuICAgICAgICAgICAgYnV0dG9uLmRvbmUtbG9hZGluZyAuc3Bpbm5lciB7XG4gICAgICAgICAgICAgICAgZGlzcGxheTogbm9uZTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLnJlbW92ZS1sYXllci10ZXh0IHtcbiAgICAgICAgICAgICAgICBmbGV4LWdyb3c6IDE7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC5jb25maXJtLWRlbnktYnV0dG9uIHtcbiAgICAgICAgICAgICAgICBoZWlnaHQ6IDI2cHg7XG4gICAgICAgICAgICAgICAgd2lkdGg6IDcwcHg7XG4gICAgICAgICAgICB9XG4gICAgICAgIGAsXG4gICAgXTtcblxuICAgIHByaXZhdGUgX21vZGVsOiBBbnlNb2RlbDxMYXllck1hbmFnZXJSb3dNb2RlbD4gfCB1bmRlZmluZWQgPSB1bmRlZmluZWQ7XG4gICAgcHJpdmF0ZSBzdGF0aWMgbW9kZWxOYW1lVG9WaWV3TmFtZSA9IG5ldyBNYXA8a2V5b2YgTGF5ZXJNYW5hZ2VyUm93TW9kZWwsIGtleW9mIExheWVyTWFuYWdlclJvdyB8IG51bGw+KFtcbiAgICAgICAgW1wibmFtZVwiLCBcIm5hbWVcIl0sXG4gICAgICAgIFtcInZpc2libGVcIiwgXCJ2aXNpYmxlXCJdLFxuICAgICAgICBbX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nR5KClcbiAgICBpc0NvbmZpcm1EaWFsb2dWaXNpYmxlOiBib29sZWFuID0gZmFsc2U7XG5cbiAgICByZW5kZXIoKTogVGVtcGxhdGVSZXN1bHQge1xuICAgICAgICByZXR1cm4gaHRtbGBcbiAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJyb3dcIj5cbiAgICAgICAgICAgICAgICA8aW5wdXRcbiAgICAgICAgICAgICAgICAgICAgdHlwZT1cImNoZWNrYm94XCJcbiAgICAgICAgICAgICAgICAgICAgY2xhc3M9XCJsYXllci12aXNpYmlsaXR5LWNoZWNrYm94XCJcbiAgICAgICAgICAgICAgICAgICAgLmNoZWNrZWQ9XCIke3RoaXMudmlzaWJsZX1cIlxuICAgICAgICAgICAgICAgICAgICBAY2hhbmdlPVwiJHt0aGlzLm9uTGF5ZXJWaXNpYmlsaXR5Q2hhbmdlZH1cIlxuICAgICAgICAgICAgICAgIC8+XG4gICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJsZWdhY3ktdGV4dCBsYXllci1uYW1lXCI+JHt0aGlzLm5hbWV9PC9zcGFuPlxuICAgICAgICAgICAgICAgIDxpbnB1dFxuICAgICAgICAgICAgICAgICAgICB0eXBlPVwicmFuZ2VcIlxuICAgICAgICAgICAgICAgICAgICBjbGFzcz1cImxlZ2FjeS1zbGlkZXIgbGF5ZXItb3BhY2l0eS1zbGlkZXJcIlxuICAgICAgICAgICAgICAgICAgICBtaW49XCIwXCJcbiAgICAgICAgICAgICAgICAgICAgbWF4PVwiMVwiXG4gICAgICAgICAgICAgICAgICAgIHN0ZXA9XCIwLjAxXCJcbiAgICAgICAgICAgICAgICAgICAgLnZhbHVlPVwiJHt0aGlzLm9wYWNpdHl9XCJcbiAgICAgICAgICAgICAgICAgICAgQGlucHV0PVwiJHt0aGlzLm9uTGF5ZXJPcGFjaXR5Q2hhbmdlZH1cIlxuICAgICAgICAgICAgICAgIC8+XG4gICAgICAgICAgICAgICAgPGJ1dHRvblxuICAgICAgICAgICAgICAgICAgICBjbGFzcz1cImxlZ2FjeS1idXR0b24gc2V0dGluZ3MtZGVsZXRlLWJ1dHRvblwiXG4gICAgICAgICAgICAgICAgICAgIEBjbGljaz1cIiR7dGhpcy5vblNldHRpbmdzQ2xpY2tlZH1cIlxuICAgICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJtYXRlcmlhbC1zeW1ib2xzLW91dGxpbmVkXCI+JiN4ZThiODs8L3NwYW4+XG4gICAgICAgICAgICAgICAgPC9idXR0b24+XG4gICAgICAgICAgICAgICAgPGJ1dHRvblxuICAgICAgICAgICAgICAgICAgICBjbGFzcz1cImxlZ2FjeS1idXR0b24gc2V0dGluZ3MtZGVsZXRlLWJ1dHRvbiAke3RoaXMuaXNMb2FkaW5nID8gJ2xvYWRpbmcnIDogJ2RvbmUtbG9hZGluZyd9XCJcbiAgICAgICAgICAgICAgICAgICAgQGNsaWNrPVwiJHt0aGlzLm9uRGVsZXRlQ2xpY2tlZH1cIlxuICAgICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInNwaW5uZXJcIj48L2Rpdj5cbiAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJjbG9zZS1pY29uIG1hdGVyaWFsLXN5bWJvbHMtb3V0bGluZWRcIj4mI3hlNWNkOzwvc3Bhbj5cbiAgICAgICAgICAgICAgICA8L2J1dHRvbj5cbiAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgJHt0aGlzLnJlbmRlckNvbmZpcm1EaWFsb2coKX1cbiAgICAgICAgYDtcbiAgICB9XG5cbiAgICBwcml2YXRlIHJlbmRlckNvbmZpcm1EaWFsb2coKTogVGVtcGxhdGVSZXN1bHQgfCB2b2lkIHtcbiAgICAgICAgaWYgKCF0aGlzLmlzQ29uZmlybURpYWxvZ1Zpc2libGUpIHtcbiAgICAgICAgICAgIHJldHVybiBub3RoaW5nO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBodG1sYFxuICAgICAgICAgICAgPGRpdiBjbGFzcz1cInJvd1wiPlxuICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwibGVnYWN5LXRleHQgcmVtb3ZlLWxheWVyLXRleHRcIj5SZW1vdmUgbGF5ZXI/PC9zcGFuPlxuICAgICAgICAgICAgICAgICAgICA8YnV0dG9uXG4gICAgICAgICAgICAgICAgICAgICAgICBjbGFzcz1cImxlZ2FjeS1idXR0b24gcHJpbWFyeSBjb25maXJtLWRlbnktYnV0dG9uXCJcbiAgICAgICAgICAgICAgICAgICAgICAgIEBjbGljaz1cIiR7dGhpcy5jb25maXJtRGVsZXRpb259XCJcbiAgICAgICAgICAgICAgICAgICAgPlxuICAgICAgICAgICAgICAgICAgICAgICAgWWVzXG4gICAgICAgICAgICAgICAgICAgIDwvYnV0dG9uPlxuICAgICAgICAgICAgICAgICAgICA8YnV0dG9uXG4gICAgICAgICAgICAgICAgICAgICAgICBjbGFzcz1cImxlZ2FjeS1idXR0b24gcHJpbWFyeSBjb25maXJtLWRlbnktYnV0dG9uXCJcbiAgICAgICAgICAgICAgICAgICAgICAgIEBjbGljaz1cIiR7dGhpcy5jYW5jZWxEZWxldGlvbn1cIlxuICAgICAgICAgICAgICAgICAgICA+XG4gICAgICAgICAgICAgICAgICAgICAgICBOb1xuICAgICAgICAgICAgICAgICAgICA8L2J1dHRvbj5cbiAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICBgO1xuICAgIH1cblxuICAgIHVwZGF0ZWQoY2hhbmdlZFByb3BlcnRpZXM6IGFueSkge1xuICAgICAgICAvLyBVcGRhdGUgdGhlIG1vZGVsIHByb3BlcnRpZXMgc28gdGhleSdyZSByZWZsZWN0ZWQgaW4gUHl0aG9uLlxuICAgICAgICBmb3IgKGNvbnN0IFtwcm9wZXJ0eSwgX10gb2YgY2hhbmdlZFByb3BlcnRpZXMpIHtcbiAgICAgICAgICAgIHRoaXMuX21vZGVsPy5zZXQocH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VcGRhdGUiLCAiXyRjaGFuZ2VQcm9wZXJ0eSIsICJ2YWx1ZSIsICJFcnJvciIsICJwcm9wZXJ0eSIsICJwcm90b09yVGFyZ2V0IiwgIm5hbWVPckNvbnRleHQiLCAicHJvdG8iLCAiaGFzT3duUHJvcGVydHkiLCAiY29uc3RydWN0b3IiLCAiY3JlYXRlUHJvcGVydHkiLCAid3JhcHBlZCIsICJPYmplY3QiLCAiZ2V0T3duUHJvcGVydHlEZXNjcmlwdG9yIiwgImxlZ2FjeVN0eWxlcyIsICJpIiwgIm1hdGVyaWFsU3R5bGVzIiwgImkiLCAiX0xheWVyTWFuYWdlclJvdyIsICJoIiwgImxlZ2FjeVN0eWxlcyIsICJtYXRlcmlhbFN0eWxlcyIsICJpIiwgIm1vZGVsIiwgIm1vZGVsS2V5IiwgIndpZGdldEtleSIsICJrZSIsICJEIiwgImNoYW5nZWRQcm9wZXJ0aWVzIiwgInByb3BlcnR5IiwgIl8iLCAiZXZlbnQiLCAidGFyZ2V0IiwgIl9fZGVjb3JhdGVDbGFzcyIsICJuIiwgIkxheWVyTWFuYWdlclJvdyIsICJyZW5kZXIiLCAiZWwiLCAicm93IiwgImxheWVyX21hbmFnZXJfcm93X2RlZmF1bHQiXQp9Cg== diff --git a/geemap/static/material_styles.js b/geemap/static/material_styles.js index bedb21f150..2aff906ab4 100644 --- a/geemap/static/material_styles.js +++ b/geemap/static/material_styles.js @@ -1,5 +1,5 @@ -var R=globalThis,T=R.ShadowRoot&&(R.ShadyCSS===void 0||R.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,L=Symbol(),F=new WeakMap,b=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==L)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(T&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=F.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&F.set(e,t))}return t}toString(){return this.cssText}},Q=o=>new b(typeof o=="string"?o:o+"",void 0,L),z=(o,...t)=>{let e=o.length===1?o[0]:t.reduce((s,i,r)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+o[r+1],o[0]);return new b(e,o,L)},I=(o,t)=>{if(T)o.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=R.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,o.appendChild(s)}},M=T?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return Q(e)})(o):o;var{is:pt,defineProperty:ut,getOwnPropertyDescriptor:$t,getOwnPropertyNames:ft,getOwnPropertySymbols:_t,getPrototypeOf:mt}=Object,N=globalThis,Y=N.trustedTypes,At=Y?Y.emptyScript:"",gt=N.reactiveElementPolyfillSupport,w=(o,t)=>o,j={toAttribute(o,t){switch(t){case Boolean:o=o?At:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},tt=(o,t)=>!pt(o,t),G={attribute:!0,type:String,converter:j,reflect:!1,hasChanged:tt};Symbol.metadata??=Symbol("metadata"),N.litPropertyMetadata??=new WeakMap;var $=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=G){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&ut(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:r}=$t(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i?.call(this)},set(n){let p=i?.call(this);r.call(this,n),this.requestUpdate(t,p,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??G}static _$Ei(){if(this.hasOwnProperty(w("elementProperties")))return;let t=mt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(w("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(w("properties"))){let e=this.properties,s=[...ft(e),..._t(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(M(i))}else t!==void 0&&e.push(M(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return I(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let r=(s.converter?.toAttribute!==void 0?s.converter:j).toAttribute(e,s.type);this._$Em=t,r==null?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let r=s.getPropertyOptions(i),n=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute!==void 0?r.converter:j;this._$Em=i,this[i]=n.fromAttribute(e,r.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??tt)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,r]of this._$Ep)this[i]=r;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,r]of s)r.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],r)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[w("elementProperties")]=new Map,$[w("finalized")]=new Map,gt?.({ReactiveElement:$}),(N.reactiveElementVersions??=[]).push("2.0.4");var K=globalThis,k=K.trustedTypes,et=k?k.createPolicy("lit-html",{createHTML:o=>o}):void 0,ht="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,at="?"+_,yt=`<${at}>`,g=document,x=()=>g.createComment(""),P=o=>o===null||typeof o!="object"&&typeof o!="function",X=Array.isArray,vt=o=>X(o)||typeof o?.[Symbol.iterator]=="function",B=`[ -\f\r]`,C=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,st=/-->/g,it=/>/g,m=RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^ +var R=globalThis,T=R.ShadowRoot&&(R.ShadyCSS===void 0||R.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,L=Symbol(),F=new WeakMap,b=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==L)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(T&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=F.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&F.set(e,t))}return t}toString(){return this.cssText}},Q=o=>new b(typeof o=="string"?o:o+"",void 0,L),z=(o,...t)=>{let e=o.length===1?o[0]:t.reduce((s,i,r)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+o[r+1],o[0]);return new b(e,o,L)},I=(o,t)=>{if(T)o.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=R.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,o.appendChild(s)}},M=T?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return Q(e)})(o):o;var{is:pt,defineProperty:ut,getOwnPropertyDescriptor:$t,getOwnPropertyNames:ft,getOwnPropertySymbols:_t,getPrototypeOf:mt}=Object,N=globalThis,Y=N.trustedTypes,At=Y?Y.emptyScript:"",gt=N.reactiveElementPolyfillSupport,w=(o,t)=>o,j={toAttribute(o,t){switch(t){case Boolean:o=o?At:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},tt=(o,t)=>!pt(o,t),G={attribute:!0,type:String,converter:j,reflect:!1,hasChanged:tt};Symbol.metadata??=Symbol("metadata"),N.litPropertyMetadata??=new WeakMap;var $=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=G){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&ut(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:r}=$t(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i?.call(this)},set(n){let p=i?.call(this);r.call(this,n),this.requestUpdate(t,p,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??G}static _$Ei(){if(this.hasOwnProperty(w("elementProperties")))return;let t=mt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(w("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(w("properties"))){let e=this.properties,s=[...ft(e),..._t(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(M(i))}else t!==void 0&&e.push(M(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return I(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let r=(s.converter?.toAttribute!==void 0?s.converter:j).toAttribute(e,s.type);this._$Em=t,r==null?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let r=s.getPropertyOptions(i),n=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute!==void 0?r.converter:j;this._$Em=i,this[i]=n.fromAttribute(e,r.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??tt)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,r]of this._$Ep)this[i]=r;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,r]of s)r.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],r)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[w("elementProperties")]=new Map,$[w("finalized")]=new Map,gt?.({ReactiveElement:$}),(N.reactiveElementVersions??=[]).push("2.0.4");var K=globalThis,k=K.trustedTypes,et=k?k.createPolicy("lit-html",{createHTML:o=>o}):void 0,ht="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,at="?"+_,yt=`<${at}>`,g=document,x=()=>g.createComment(""),P=o=>o===null||typeof o!="object"&&typeof o!="function",X=Array.isArray,vt=o=>X(o)||typeof o?.[Symbol.iterator]=="function",B=`[ +\f\r]`,C=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,st=/-->/g,it=/>/g,m=RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`,"g"),ot=/'/g,rt=/"/g,lt=/^(?:script|style|textarea|title)$/i,Z=o=>(t,...e)=>({_$litType$:o,strings:t,values:e}),Ut=Z(1),Ht=Z(2),Ot=Z(3),y=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),nt=new WeakMap,A=g.createTreeWalker(g,129);function ct(o,t){if(!X(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return et!==void 0?et.createHTML(t):t}var St=(o,t)=>{let e=o.length-1,s=[],i,r=t===2?"":t===3?"":"",n=C;for(let p=0;p"?(n=i??C,a=-1):d[1]===void 0?a=-2:(a=n.lastIndex-d[2].length,l=d[1],n=d[3]===void 0?m:d[3]==='"'?rt:ot):n===rt||n===ot?n=m:n===st||n===it?n=C:(n=m,i=void 0);let f=n===m&&o[p+1].startsWith("/>")?" ":"";r+=n===C?h+yt:a>=0?(s.push(l),h.slice(0,a)+ht+h.slice(a)+_+f):h+_+(a===-2?p:f)}return[ct(o,r+(o[e]||"")+(t===2?"":t===3?"":"")),s]},U=class o{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let r=0,n=0,p=t.length-1,h=this.parts,[l,d]=St(t,e);if(this.el=o.createElement(l,s),A.currentNode=this.el.content,e===2||e===3){let a=this.el.content.firstChild;a.replaceWith(...a.childNodes)}for(;(i=A.nextNode())!==null&&h.length0){i.textContent=k?k.emptyScript:"";for(let f=0;f2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=c}_$AI(t,e=this,s,i){let r=this.strings,n=!1;if(r===void 0)t=v(this,t,e,0),n=!P(t)||t!==this._$AH&&t!==y,n&&(this._$AH=t);else{let p=t,h,l;for(t=r[0],h=0;h{let s=e?.renderBefore??t,i=s._$litPart$;if(i===void 0){let r=e?.renderBefore??null;s._$litPart$=i=new H(t.insertBefore(x(),r),r,void 0,e??{})}return i._$AI(o),i};var E=class extends ${constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=dt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return y}};E._$litElement$=!0,E.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:E});var bt=globalThis.litElementPolyfillSupport;bt?.({LitElement:E});(globalThis.litElementVersions??=[]).push("4.1.0");var Jt=z` @font-face { font-family: 'Material Symbols Outlined'; @@ -60,4 +60,3 @@ lit-html/is-server.js: * SPDX-License-Identifier: BSD-3-Clause *) */ -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vbm9kZV9tb2R1bGVzL0BsaXQvcmVhY3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xuICAgICAgICAvLyBUT0RPIChqdXN0aW5mYWduYW5pKTogZm9yIGF0dGVtcHRlZCBkeW5hbWljIHRhZyBuYW1lcywgd2UgZG9uJ3RcbiAgICAgICAgLy8gaW5jcmVtZW50IHRoZSBiaW5kaW5nSW5kZXgsIGFuZCBpdCdsbCBiZSBvZmYgYnkgMSBpbiB0aGUgZWxlbWVudFxuICAgICAgICAvLyBhbmQgb2ZmIGJ5IHR3byBhZnRlciBpdC5cbiAgICAgICAgaWYgKChub2RlIGFzIEVsZW1lbnQpLmhhc0F0dHJpYnV0ZXMoKSkge1xuICAgICAgICAgIGZvciAoY29uc3QgbmFtZSBvZiAobm9kZSBhcyBFbGVtZW50KS5nZXRBdHRyaWJ1dGVOYW1lcygpKSB7XG4gICAgICAgICAgICBpZiAobmFtZS5lbmRzV2l0aChib3VuZEF0dHJpYnV0ZVN1ZmZpeCkpIHtcbiAgICAgICAgICAgICAgY29uc3QgcmVhbE5hbWUgPSBhdHRyTmFtZXNbYXR0ck5hbWVJbmRleCsrXTtcbiAgICAgICAgICAgICAgY29uc3QgdmFsdWUgPSAobm9kZSBhcyBFbGVtZW50KS5nZXRBdHRyaWJ1dGUobmFtZSkhO1xuICAgICAgICAgICAgICBjb25zdCBzdGF0aWNzID0gdmFsdWUuc3BsaXQobWFya2VyKTtcbiAgICAgICAgICAgICAgY29uc3QgbSA9IC8oWy4/QF0pPyguKikvLmV4ZWMocmVhbE5hbWUpITtcbiAgICAgICAgICAgICAgcGFydHMucHVzaCh7XG4gICAgICAgICAgICAgICAgdHlwZTogQVRUUklCVVRFX1BBUlQsXG4gICAgICAgICAgICAgICAgaW5kZXg6IG5vZGVJbmRleCxcbiAgICAgICAgICAgICAgICBuYW1lOiBtWzJdLFxuICAgICAgICAgICAgICAgIHN0cmluZ3M6IHN0YXRpY3MsXG4gICAgICAgICAgICAgICAgY3RvcjpcbiAgICAgICAgICAgICAgICAgIG1bMV0gPT09ICcuJ1xuICAgICAgICAgICAgICAgICAgICA/IFByb3BlcnR5UGFydFxuICAgICAgICAgICAgICAgICAgICA6IG1bMV0gPT09ICc/J1xuICAgICAgICAgICAgICAgICAgICAgID8gQm9vbGVhbkF0dHJpYnV0ZVBhcnRcbiAgICAgICAgICAgICAgICAgICAgICA6IG1bMV0gPT09ICdAJ1xuICAgICAgICAgICAgICAgICAgICAgICAgPyBFdmVudFBhcnRcbiAgICAgICAgICAgICAgICAgICAgICAgIDogQXR0cmlidXRlUGFydCxcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgIChub2RlIGFzIEVsZW1lbnQpLnJlbW92ZUF0dHJpYnV0ZShuYW1lKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobmFtZS5zdGFydHNXaXRoKG1hcmtlcikpIHtcbiAgICAgICAgICAgICAgcGFydHMucHVzaCh7XG4gICAgICAgICAgICAgICAgdHlwZTogRUxFTUVOVF9QQVJULFxuICAgICAgICAgICAgICAgIGluZGV4OiBub2RlSW5kZXgsXG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAobm9kZSBhcyBFbGVtZW50KS5yZW1vdmVBdHRyaWJ1dGUobmFtZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIC8vIFRPRE8gKGp1c3RpbmZhZ25hbmkpOiBiZW5jaG1hcmsgdGhlIHJlZ2V4IGFnYWluc3QgdGVzdGluZyBmb3IgZWFjaFxuICAgICAgICAvLyBvZiB0aGUgMyByYXcgdGV4dCBlbGVtZW50IG5hbWVzLlxuICAgICAgICBpZiAocmF3VGV4dEVsZW1lbnQudGVzdCgobm9kZSBhcyBFbGVtZW50KS50YWdOYW1lKSkge1xuICAgICAgICAgIC8vIEZvciByYXcgdGV4dCBlbGVtZW50cyB3ZSBuZWVkIHRvIHNwbGl0IHRoZSB0ZXh0IGNvbnRlbnQgb25cbiAgICAgICAgICAvLyBtYXJrZXJzLCBjcmVhdGUgYSBUZXh0IG5vZGUgZm9yIGVhY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4gICAgICAgICAgICAgICAgYHRvIGNvbXBvc2Ugc3R5bGVzLCBhbmQgZG8gZHluYW1pYyBzdHlsaW5nIHdpdGggYCArXG4gICAgICAgICAgICAgICAgYGNzcyBjdXN0b20gcHJvcGVydGllcywgOjpwYXJ0cywgPHNsb3Q+cywgYCArXG4gICAgICAgICAgICAgICAgYGFuZCBieSBtdXRhdGluZyB0aGUgRE9NIHJhdGhlciB0aGFuIHN0eWxlc2hlZXRzLmA7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBtZXNzYWdlID1cbiAgICAgICAgICAgICAgICBgTGl0IGRvZXMgbm90IHN1cHBvcnQgYmluZGluZyBpbnNpZGUgc2NyaXB0IG5vZGVzLiBgICtcbiAgICAgICAgICAgICAgICBgVGhpcyBpcyBhIHNlY3VyaXR5IHJpc2ssIGFzIGl0IGNvdWxkIGFsbG93IGFyYml0cmFyeSBgICtcbiAgICAgICAgICAgICAgICBgY29kZSBleGVjdXRpb24uYDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgdGhyb3cgbmV3IEVycm9yKG1lc3NhZ2UpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBkZWJ1Z0xvZ0V2ZW50ICYmXG4gICAgICAgIGRlYnVnTG9nRXZlbnQoe1xuICAgICAgICAgIGtpbmQ6ICdjb21taXQgbm9kZScsXG4gICAgICAgICAgc3RhcnQ6IHRoaXMuXyRzdGFydE5vZGUsXG4gICAgICAgICAgcGFyZW50OiB0aGlzLl8kcGFyZW50LFxuICAgICAgICAgIHZhbHVlOiB2YWx1ZSxcbiAgICAgICAgICBvcHRpb25zOiB0aGlzLm9wdGlvbnMsXG4gICAgICAgIH0pO1xuICAgICAgdGhpcy5fJGNvbW1pdHRlZFZhbHVlID0gdGhpcy5faW5zZXJ0KHZhbHVlKTtcbiAgICB9XG4gIH1cblxuICBwcml2YXRlIF9jb21taXRUZXh0KHZhbHVlOiB1bmtub3duKTogdm9pZC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ZXRWYWx1ZSIsICJMaXRFbGVtZW50IiwgIlJlYWN0aXZlRWxlbWVudCIsICJjb25zdHJ1Y3RvciIsICJ0aGlzIiwgInJlbmRlck9wdGlvbnMiLCAiaG9zdCIsICJfX2NoaWxkUGFydCIsICJjcmVhdGVSZW5kZXJSb290IiwgInJlbmRlclJvb3QiLCAic3VwZXIiLCAicmVuZGVyQmVmb3JlIiwgImZpcnN0Q2hpbGQiLCAiY2hhbmdlZFByb3BlcnRpZXMiLCAidmFsdWUiLCAicmVuZGVyIiwgImhhc1VwZGF0ZWQiLCAiaXNDb25uZWN0ZWQiLCAidXBkYXRlIiwgImNvbm5lY3RlZENhbGxiYWNrIiwgInNldENvbm5lY3RlZCIsICJkaXNjb25uZWN0ZWRDYWxsYmFjayIsICJub0NoYW5nZSIsICJnbG9iYWxUaGlzIiwgImxpdEVsZW1lbnRIeWRyYXRlU3VwcG9ydCIsICJwb2x5ZmlsbFN1cHBvcnQiLCAibGl0RWxlbWVudFBvbHlmaWxsU3VwcG9ydCIsICJnbG9iYWxUaGlzIiwgImxpdEVsZW1lbnRWZXJzaW9ucyIsICJwdXNoIiwgIm1hdGVyaWFsU3R5bGVzIiwgImkiXQp9Cg== diff --git a/geemap/static/utils.js b/geemap/static/utils.js index 103d8fd56d..2704aeeb1f 100644 --- a/geemap/static/utils.js +++ b/geemap/static/utils.js @@ -1,2 +1 @@ async function d(e,i){return Promise.all(e.map(t=>i.get_model(t.slice(10))))}async function l(e,i){let t=i.get("children"),a=await d(t,i.widget_manager),r=await Promise.all(a.map(n=>n.widget_manager.create_view(n)));e.innerHTML="";for(let n of r)e.appendChild(n.el)}export{l as updateChildren}; -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vanMvdXRpbHMudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImltcG9ydCB0eXBlIHsgQW55TW9kZWwgfSBmcm9tIFwiQGFueXdpZGdldC90eXBlc1w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LEVBQXNELENBQ3ZHLE9BQU8sUUFBUSxJQUNYRCxFQUFTLElBQUlFLEdBQU1ELEVBQVEsVUFBVUMsRUFBRyxNQUFNLEVBQW1CLENBQUMsQ0FBQyxDQUN2RSxDQUNKLENBRUEsZUFBc0JDLEVBQWVDLEVBQXdCQyxFQUFzQixDQUMvRSxJQUFNQyxFQUFXRCxFQUFNLElBQUksVUFBVSxFQUMvQkUsRUFBZSxNQUFNUixFQUFhTyxFQUFVRCxFQUFNLGNBQWMsRUFDaEVHLEVBQWMsTUFBTSxRQUFRLElBQzlCRCxFQUFhLElBQUlGLEdBQVNBLEVBQU0sZUFBZSxZQUFZQSxDQUFLLENBQUMsQ0FDckUsRUFDQUQsRUFBVSxVQUFZLEdBQ3RCLFFBQVdLLEtBQWNELEVBQ3JCSixFQUFVLFlBQVlLLEVBQVcsRUFBRSxDQUUzQyIsCiAgIm5hbWVzIjogWyJ1bnBhY2tNb2RlbHMiLCAibW9kZWxJZHMiLCAibWFuYWdlciIsICJpZCIsICJ1cGRhdGVDaGlsZHJlbiIsICJjb250YWluZXIiLCAibW9kZWwiLCAiY2hpbGRyZW4iLCAiY2hpbGRfbW9kZWxzIiwgImNoaWxkX3ZpZXdzIiwgImNoaWxkX3ZpZXciXQp9Cg== From f5af00d9f2b81da396f9fee668ea2e9972df76c2 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 11 Oct 2024 20:44:30 +0000 Subject: [PATCH 04/57] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- geemap/static/ipywidgets_styles.js | 4 ++-- geemap/static/layer_manager.js | 4 ++-- geemap/static/layer_manager_row.js | 4 ++-- geemap/static/material_styles.js | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/geemap/static/ipywidgets_styles.js b/geemap/static/ipywidgets_styles.js index 5af999a37d..4b907e8604 100644 --- a/geemap/static/ipywidgets_styles.js +++ b/geemap/static/ipywidgets_styles.js @@ -1,5 +1,5 @@ -var R=globalThis,N=R.ShadowRoot&&(R.ShadyCSS===void 0||R.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,k=Symbol(),Z=new WeakMap,E=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==k)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(N&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=Z.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Z.set(e,t))}return t}toString(){return this.cssText}},X=r=>new E(typeof r=="string"?r:r+"",void 0,k),z=(r,...t)=>{let e=r.length===1?r[0]:t.reduce((s,i,o)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[o+1],r[0]);return new E(e,r,k)},L=(r,t)=>{if(N)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=R.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s)}},T=N?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return X(e)})(r):r;var{is:pt,defineProperty:ut,getOwnPropertyDescriptor:$t,getOwnPropertyNames:ft,getOwnPropertySymbols:_t,getPrototypeOf:gt}=Object,M=globalThis,G=M.trustedTypes,mt=G?G.emptyScript:"",At=M.reactiveElementPolyfillSupport,w=(r,t)=>r,I={toAttribute(r,t){switch(t){case Boolean:r=r?mt:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},tt=(r,t)=>!pt(r,t),Y={attribute:!0,type:String,converter:I,reflect:!1,hasChanged:tt};Symbol.metadata??=Symbol("metadata"),M.litPropertyMetadata??=new WeakMap;var $=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Y){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&ut(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:o}=$t(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i?.call(this)},set(n){let p=i?.call(this);o.call(this,n),this.requestUpdate(t,p,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Y}static _$Ei(){if(this.hasOwnProperty(w("elementProperties")))return;let t=gt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(w("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(w("properties"))){let e=this.properties,s=[...ft(e),..._t(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(T(i))}else t!==void 0&&e.push(T(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return L(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let o=(s.converter?.toAttribute!==void 0?s.converter:I).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let o=s.getPropertyOptions(i),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:I;this._$Em=i,this[i]=n.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??tt)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,o]of this._$Ep)this[i]=o;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,o]of s)o.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],o)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[w("elementProperties")]=new Map,$[w("finalized")]=new Map,At?.({ReactiveElement:$}),(M.reactiveElementVersions??=[]).push("2.0.4");var J=globalThis,j=J.trustedTypes,et=j?j.createPolicy("lit-html",{createHTML:r=>r}):void 0,ht="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,at="?"+_,yt=`<${at}>`,A=document,C=()=>A.createComment(""),P=r=>r===null||typeof r!="object"&&typeof r!="function",F=Array.isArray,vt=r=>F(r)||typeof r?.[Symbol.iterator]=="function",B=`[ -\f\r]`,x=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,st=/-->/g,it=/>/g,g=RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^ +var R=globalThis,N=R.ShadowRoot&&(R.ShadyCSS===void 0||R.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,k=Symbol(),Z=new WeakMap,E=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==k)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(N&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=Z.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Z.set(e,t))}return t}toString(){return this.cssText}},X=r=>new E(typeof r=="string"?r:r+"",void 0,k),z=(r,...t)=>{let e=r.length===1?r[0]:t.reduce((s,i,o)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[o+1],r[0]);return new E(e,r,k)},L=(r,t)=>{if(N)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=R.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s)}},T=N?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return X(e)})(r):r;var{is:pt,defineProperty:ut,getOwnPropertyDescriptor:$t,getOwnPropertyNames:ft,getOwnPropertySymbols:_t,getPrototypeOf:gt}=Object,M=globalThis,G=M.trustedTypes,mt=G?G.emptyScript:"",At=M.reactiveElementPolyfillSupport,w=(r,t)=>r,I={toAttribute(r,t){switch(t){case Boolean:r=r?mt:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},tt=(r,t)=>!pt(r,t),Y={attribute:!0,type:String,converter:I,reflect:!1,hasChanged:tt};Symbol.metadata??=Symbol("metadata"),M.litPropertyMetadata??=new WeakMap;var $=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Y){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&ut(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:o}=$t(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i?.call(this)},set(n){let p=i?.call(this);o.call(this,n),this.requestUpdate(t,p,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Y}static _$Ei(){if(this.hasOwnProperty(w("elementProperties")))return;let t=gt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(w("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(w("properties"))){let e=this.properties,s=[...ft(e),..._t(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(T(i))}else t!==void 0&&e.push(T(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return L(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let o=(s.converter?.toAttribute!==void 0?s.converter:I).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let o=s.getPropertyOptions(i),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:I;this._$Em=i,this[i]=n.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??tt)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,o]of this._$Ep)this[i]=o;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,o]of s)o.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],o)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[w("elementProperties")]=new Map,$[w("finalized")]=new Map,At?.({ReactiveElement:$}),(M.reactiveElementVersions??=[]).push("2.0.4");var J=globalThis,j=J.trustedTypes,et=j?j.createPolicy("lit-html",{createHTML:r=>r}):void 0,ht="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,at="?"+_,yt=`<${at}>`,A=document,C=()=>A.createComment(""),P=r=>r===null||typeof r!="object"&&typeof r!="function",F=Array.isArray,vt=r=>F(r)||typeof r?.[Symbol.iterator]=="function",B=`[ +\f\r]`,x=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,st=/-->/g,it=/>/g,g=RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`,"g"),rt=/'/g,ot=/"/g,lt=/^(?:script|style|textarea|title)$/i,Q=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),Ut=Q(1),Ht=Q(2),Ot=Q(3),y=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),nt=new WeakMap,m=A.createTreeWalker(A,129);function ct(r,t){if(!F(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return et!==void 0?et.createHTML(t):t}var St=(r,t)=>{let e=r.length-1,s=[],i,o=t===2?"":t===3?"":"",n=x;for(let p=0;p"?(n=i??x,a=-1):d[1]===void 0?a=-2:(a=n.lastIndex-d[2].length,l=d[1],n=d[3]===void 0?g:d[3]==='"'?ot:rt):n===ot||n===rt?n=g:n===st||n===it?n=x:(n=g,i=void 0);let f=n===g&&r[p+1].startsWith("/>")?" ":"";o+=n===x?h+yt:a>=0?(s.push(l),h.slice(0,a)+ht+h.slice(a)+_+f):h+_+(a===-2?p:f)}return[ct(r,o+(r[e]||"")+(t===2?"":t===3?"":"")),s]},U=class r{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let o=0,n=0,p=t.length-1,h=this.parts,[l,d]=St(t,e);if(this.el=r.createElement(l,s),m.currentNode=this.el.content,e===2||e===3){let a=this.el.content.firstChild;a.replaceWith(...a.childNodes)}for(;(i=m.nextNode())!==null&&h.length0){i.textContent=j?j.emptyScript:"";for(let f=0;f2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=c}_$AI(t,e=this,s,i){let o=this.strings,n=!1;if(o===void 0)t=v(this,t,e,0),n=!P(t)||t!==this._$AH&&t!==y,n&&(this._$AH=t);else{let p=t,h,l;for(t=o[0],h=0;h{let s=e?.renderBefore??t,i=s._$litPart$;if(i===void 0){let o=e?.renderBefore??null;s._$litPart$=i=new H(t.insertBefore(C(),o),o,void 0,e??{})}return i._$AI(r),i};var b=class extends ${constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=dt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return y}};b._$litElement$=!0,b.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:b});var Et=globalThis.litElementPolyfillSupport;Et?.({LitElement:b});(globalThis.litElementVersions??=[]).push("4.1.0");var qt=z` .legacy-button { align-items: center; diff --git a/geemap/static/layer_manager.js b/geemap/static/layer_manager.js index a8f4001eba..b27896c6f1 100644 --- a/geemap/static/layer_manager.js +++ b/geemap/static/layer_manager.js @@ -1,5 +1,5 @@ -var At=Object.defineProperty;var vt=Object.getOwnPropertyDescriptor;var st=(r,t,e,s)=>{for(var i=s>1?void 0:s?vt(t,e):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(i=(s?n(t,e,i):n(i))||i);return s&&i&&At(t,e,i),i};var T=globalThis,k=T.ShadowRoot&&(T.ShadyCSS===void 0||T.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,V=Symbol(),it=new WeakMap,x=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==V)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(k&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=it.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&it.set(e,t))}return t}toString(){return this.cssText}},rt=r=>new x(typeof r=="string"?r:r+"",void 0,V),w=(r,...t)=>{let e=r.length===1?r[0]:t.reduce((s,i,o)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[o+1],r[0]);return new x(e,r,V)},B=(r,t)=>{if(k)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=T.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s)}},j=k?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return rt(e)})(r):r;var{is:bt,defineProperty:St,getOwnPropertyDescriptor:Et,getOwnPropertyNames:xt,getOwnPropertySymbols:wt,getPrototypeOf:Ct}=Object,L=globalThis,ot=L.trustedTypes,Pt=ot?ot.emptyScript:"",Mt=L.reactiveElementPolyfillSupport,C=(r,t)=>r,P={toAttribute(r,t){switch(t){case Boolean:r=r?Pt:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},z=(r,t)=>!bt(r,t),nt={attribute:!0,type:String,converter:P,reflect:!1,hasChanged:z};Symbol.metadata??=Symbol("metadata"),L.litPropertyMetadata??=new WeakMap;var m=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=nt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&St(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:o}=Et(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i?.call(this)},set(n){let h=i?.call(this);o.call(this,n),this.requestUpdate(t,h,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??nt}static _$Ei(){if(this.hasOwnProperty(C("elementProperties")))return;let t=Ct(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(C("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(C("properties"))){let e=this.properties,s=[...xt(e),...wt(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(j(i))}else t!==void 0&&e.push(j(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return B(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let o=(s.converter?.toAttribute!==void 0?s.converter:P).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let o=s.getPropertyOptions(i),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:P;this._$Em=i,this[i]=n.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??z)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,o]of this._$Ep)this[i]=o;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,o]of s)o.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],o)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};m.elementStyles=[],m.shadowRootOptions={mode:"open"},m[C("elementProperties")]=new Map,m[C("finalized")]=new Map,Mt?.({ReactiveElement:m}),(L.reactiveElementVersions??=[]).push("2.0.4");var X=globalThis,I=X.trustedTypes,at=I?I.createPolicy("lit-html",{createHTML:r=>r}):void 0,ut="$lit$",g=`lit$${Math.random().toFixed(9).slice(2)}$`,mt="?"+g,Ut=`<${mt}>`,A=document,U=()=>A.createComment(""),N=r=>r===null||typeof r!="object"&&typeof r!="function",Y=Array.isArray,Nt=r=>Y(r)||typeof r?.[Symbol.iterator]=="function",W=`[ -\f\r]`,M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,lt=/-->/g,ht=/>/g,$=RegExp(`>|${W}(?:([^\\s"'>=/]+)(${W}*=${W}*(?:[^ +var At=Object.defineProperty;var vt=Object.getOwnPropertyDescriptor;var st=(r,t,e,s)=>{for(var i=s>1?void 0:s?vt(t,e):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(i=(s?n(t,e,i):n(i))||i);return s&&i&&At(t,e,i),i};var T=globalThis,k=T.ShadowRoot&&(T.ShadyCSS===void 0||T.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,V=Symbol(),it=new WeakMap,x=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==V)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(k&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=it.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&it.set(e,t))}return t}toString(){return this.cssText}},rt=r=>new x(typeof r=="string"?r:r+"",void 0,V),w=(r,...t)=>{let e=r.length===1?r[0]:t.reduce((s,i,o)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[o+1],r[0]);return new x(e,r,V)},B=(r,t)=>{if(k)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=T.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s)}},j=k?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return rt(e)})(r):r;var{is:bt,defineProperty:St,getOwnPropertyDescriptor:Et,getOwnPropertyNames:xt,getOwnPropertySymbols:wt,getPrototypeOf:Ct}=Object,L=globalThis,ot=L.trustedTypes,Pt=ot?ot.emptyScript:"",Mt=L.reactiveElementPolyfillSupport,C=(r,t)=>r,P={toAttribute(r,t){switch(t){case Boolean:r=r?Pt:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},z=(r,t)=>!bt(r,t),nt={attribute:!0,type:String,converter:P,reflect:!1,hasChanged:z};Symbol.metadata??=Symbol("metadata"),L.litPropertyMetadata??=new WeakMap;var m=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=nt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&St(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:o}=Et(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i?.call(this)},set(n){let h=i?.call(this);o.call(this,n),this.requestUpdate(t,h,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??nt}static _$Ei(){if(this.hasOwnProperty(C("elementProperties")))return;let t=Ct(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(C("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(C("properties"))){let e=this.properties,s=[...xt(e),...wt(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(j(i))}else t!==void 0&&e.push(j(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return B(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let o=(s.converter?.toAttribute!==void 0?s.converter:P).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let o=s.getPropertyOptions(i),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:P;this._$Em=i,this[i]=n.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??z)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,o]of this._$Ep)this[i]=o;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,o]of s)o.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],o)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};m.elementStyles=[],m.shadowRootOptions={mode:"open"},m[C("elementProperties")]=new Map,m[C("finalized")]=new Map,Mt?.({ReactiveElement:m}),(L.reactiveElementVersions??=[]).push("2.0.4");var X=globalThis,I=X.trustedTypes,at=I?I.createPolicy("lit-html",{createHTML:r=>r}):void 0,ut="$lit$",g=`lit$${Math.random().toFixed(9).slice(2)}$`,mt="?"+g,Ut=`<${mt}>`,A=document,U=()=>A.createComment(""),N=r=>r===null||typeof r!="object"&&typeof r!="function",Y=Array.isArray,Nt=r=>Y(r)||typeof r?.[Symbol.iterator]=="function",W=`[ +\f\r]`,M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,lt=/-->/g,ht=/>/g,$=RegExp(`>|${W}(?:([^\\s"'>=/]+)(${W}*=${W}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`,"g"),ct=/'/g,dt=/"/g,ft=/^(?:script|style|textarea|title)$/i,G=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),gt=G(1),Bt=G(2),Wt=G(3),v=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),pt=new WeakMap,_=A.createTreeWalker(A,129);function yt(r,t){if(!Y(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return at!==void 0?at.createHTML(t):t}var Ot=(r,t)=>{let e=r.length-1,s=[],i,o=t===2?"":t===3?"":"",n=M;for(let h=0;h"?(n=i??M,l=-1):p[1]===void 0?l=-2:(l=n.lastIndex-p[2].length,c=p[1],n=p[3]===void 0?$:p[3]==='"'?dt:ct):n===dt||n===ct?n=$:n===lt||n===ht?n=M:(n=$,i=void 0);let f=n===$&&r[h+1].startsWith("/>")?" ":"";o+=n===M?a+Ut:l>=0?(s.push(c),a.slice(0,l)+ut+a.slice(l)+g+f):a+g+(l===-2?h:f)}return[yt(r,o+(r[e]||"")+(t===2?"":t===3?"":"")),s]},O=class r{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let o=0,n=0,h=t.length-1,a=this.parts,[c,p]=Ot(t,e);if(this.el=r.createElement(c,s),_.currentNode=this.el.content,e===2||e===3){let l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(i=_.nextNode())!==null&&a.length0){i.textContent=I?I.emptyScript:"";for(let f=0;f2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=d}_$AI(t,e=this,s,i){let o=this.strings,n=!1;if(o===void 0)t=b(this,t,e,0),n=!N(t)||t!==this._$AH&&t!==v,n&&(this._$AH=t);else{let h=t,a,c;for(t=o[0],a=0;a{let s=e?.renderBefore??t,i=s._$litPart$;if(i===void 0){let o=e?.renderBefore??null;s._$litPart$=i=new R(t.insertBefore(U(),o),o,void 0,e??{})}return i._$AI(r),i};var y=class extends m{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=$t(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return v}};y._$litElement$=!0,y.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:y});var Ht=globalThis.litElementPolyfillSupport;Ht?.({LitElement:y});(globalThis.litElementVersions??=[]).push("4.1.0");var Tt={attribute:!0,type:String,converter:P,reflect:!1,hasChanged:z},kt=(r=Tt,t,e)=>{let{kind:s,metadata:i}=e,o=globalThis.litPropertyMetadata.get(i);if(o===void 0&&globalThis.litPropertyMetadata.set(i,o=new Map),o.set(e.name,r),s==="accessor"){let{name:n}=e;return{set(h){let a=t.get.call(this);t.set.call(this,h),this.requestUpdate(n,a,r)},init(h){return h!==void 0&&this.P(n,void 0,r),h}}}if(s==="setter"){let{name:n}=e;return function(h){let a=this[n];t.call(this,h),this.requestUpdate(n,a,r)}}throw Error("Unsupported decorator location: "+s)};function tt(r){return(t,e)=>typeof e=="object"?kt(r,t,e):((s,i,o)=>{let n=i.hasOwnProperty(o);return i.constructor.createProperty(o,n?{...s,wrapped:!0}:s),n?Object.getOwnPropertyDescriptor(i,o):void 0})(r,t,e)}var _t=w` .legacy-button { align-items: center; diff --git a/geemap/static/layer_manager_row.js b/geemap/static/layer_manager_row.js index 010a3b9d5d..118f9692ca 100644 --- a/geemap/static/layer_manager_row.js +++ b/geemap/static/layer_manager_row.js @@ -1,5 +1,5 @@ -var _t=Object.defineProperty;var bt=Object.getOwnPropertyDescriptor;var w=(o,t,e,s)=>{for(var i=s>1?void 0:s?bt(t,e):t,n=o.length-1,r;n>=0;n--)(r=o[n])&&(i=(s?r(t,e,i):r(i))||i);return s&&i&&_t(t,e,i),i};var L=globalThis,z=L.ShadowRoot&&(L.ShadyCSS===void 0||L.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,W=Symbol(),it=new WeakMap,k=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==W)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(z&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=it.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&it.set(e,t))}return t}toString(){return this.cssText}},ot=o=>new k(typeof o=="string"?o:o+"",void 0,W),v=(o,...t)=>{let e=o.length===1?o[0]:t.reduce((s,i,n)=>s+(r=>{if(r._$cssResult$===!0)return r.cssText;if(typeof r=="number")return r;throw Error("Value passed to 'css' function must be a 'css' function result: "+r+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+o[n+1],o[0]);return new k(e,o,W)},J=(o,t)=>{if(z)o.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=L.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,o.appendChild(s)}},D=z?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return ot(e)})(o):o;var{is:At,defineProperty:xt,getOwnPropertyDescriptor:St,getOwnPropertyNames:wt,getOwnPropertySymbols:Et,getPrototypeOf:Ct}=Object,I=globalThis,nt=I.trustedTypes,Pt=nt?nt.emptyScript:"",kt=I.reactiveElementPolyfillSupport,R=(o,t)=>o,U={toAttribute(o,t){switch(t){case Boolean:o=o?Pt:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},V=(o,t)=>!At(o,t),rt={attribute:!0,type:String,converter:U,reflect:!1,hasChanged:V};Symbol.metadata??=Symbol("metadata"),I.litPropertyMetadata??=new WeakMap;var m=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=rt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&xt(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:n}=St(this.prototype,t)??{get(){return this[e]},set(r){this[e]=r}};return{get(){return i?.call(this)},set(r){let h=i?.call(this);n.call(this,r),this.requestUpdate(t,h,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??rt}static _$Ei(){if(this.hasOwnProperty(R("elementProperties")))return;let t=Ct(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(R("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(R("properties"))){let e=this.properties,s=[...wt(e),...Et(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(D(i))}else t!==void 0&&e.push(D(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return J(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let n=(s.converter?.toAttribute!==void 0?s.converter:U).toAttribute(e,s.type);this._$Em=t,n==null?this.removeAttribute(i):this.setAttribute(i,n),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let n=s.getPropertyOptions(i),r=typeof n.converter=="function"?{fromAttribute:n.converter}:n.converter?.fromAttribute!==void 0?n.converter:U;this._$Em=i,this[i]=r.fromAttribute(e,n.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??V)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,n]of this._$Ep)this[i]=n;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,n]of s)n.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],n)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};m.elementStyles=[],m.shadowRootOptions={mode:"open"},m[R("elementProperties")]=new Map,m[R("finalized")]=new Map,kt?.({ReactiveElement:m}),(I.reactiveElementVersions??=[]).push("2.0.4");var G=globalThis,q=G.trustedTypes,at=q?q.createPolicy("lit-html",{createHTML:o=>o}):void 0,ut="$lit$",g=`lit$${Math.random().toFixed(9).slice(2)}$`,mt="?"+g,Rt=`<${mt}>`,A=document,O=()=>A.createComment(""),N=o=>o===null||typeof o!="object"&&typeof o!="function",tt=Array.isArray,Ut=o=>tt(o)||typeof o?.[Symbol.iterator]=="function",K=`[ -\f\r]`,M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,lt=/-->/g,ht=/>/g,_=RegExp(`>|${K}(?:([^\\s"'>=/]+)(${K}*=${K}*(?:[^ +var _t=Object.defineProperty;var bt=Object.getOwnPropertyDescriptor;var w=(o,t,e,s)=>{for(var i=s>1?void 0:s?bt(t,e):t,n=o.length-1,r;n>=0;n--)(r=o[n])&&(i=(s?r(t,e,i):r(i))||i);return s&&i&&_t(t,e,i),i};var L=globalThis,z=L.ShadowRoot&&(L.ShadyCSS===void 0||L.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,W=Symbol(),it=new WeakMap,k=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==W)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(z&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=it.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&it.set(e,t))}return t}toString(){return this.cssText}},ot=o=>new k(typeof o=="string"?o:o+"",void 0,W),v=(o,...t)=>{let e=o.length===1?o[0]:t.reduce((s,i,n)=>s+(r=>{if(r._$cssResult$===!0)return r.cssText;if(typeof r=="number")return r;throw Error("Value passed to 'css' function must be a 'css' function result: "+r+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+o[n+1],o[0]);return new k(e,o,W)},J=(o,t)=>{if(z)o.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=L.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,o.appendChild(s)}},D=z?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return ot(e)})(o):o;var{is:At,defineProperty:xt,getOwnPropertyDescriptor:St,getOwnPropertyNames:wt,getOwnPropertySymbols:Et,getPrototypeOf:Ct}=Object,I=globalThis,nt=I.trustedTypes,Pt=nt?nt.emptyScript:"",kt=I.reactiveElementPolyfillSupport,R=(o,t)=>o,U={toAttribute(o,t){switch(t){case Boolean:o=o?Pt:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},V=(o,t)=>!At(o,t),rt={attribute:!0,type:String,converter:U,reflect:!1,hasChanged:V};Symbol.metadata??=Symbol("metadata"),I.litPropertyMetadata??=new WeakMap;var m=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=rt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&xt(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:n}=St(this.prototype,t)??{get(){return this[e]},set(r){this[e]=r}};return{get(){return i?.call(this)},set(r){let h=i?.call(this);n.call(this,r),this.requestUpdate(t,h,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??rt}static _$Ei(){if(this.hasOwnProperty(R("elementProperties")))return;let t=Ct(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(R("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(R("properties"))){let e=this.properties,s=[...wt(e),...Et(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(D(i))}else t!==void 0&&e.push(D(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return J(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let n=(s.converter?.toAttribute!==void 0?s.converter:U).toAttribute(e,s.type);this._$Em=t,n==null?this.removeAttribute(i):this.setAttribute(i,n),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let n=s.getPropertyOptions(i),r=typeof n.converter=="function"?{fromAttribute:n.converter}:n.converter?.fromAttribute!==void 0?n.converter:U;this._$Em=i,this[i]=r.fromAttribute(e,n.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??V)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,n]of this._$Ep)this[i]=n;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,n]of s)n.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],n)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};m.elementStyles=[],m.shadowRootOptions={mode:"open"},m[R("elementProperties")]=new Map,m[R("finalized")]=new Map,kt?.({ReactiveElement:m}),(I.reactiveElementVersions??=[]).push("2.0.4");var G=globalThis,q=G.trustedTypes,at=q?q.createPolicy("lit-html",{createHTML:o=>o}):void 0,ut="$lit$",g=`lit$${Math.random().toFixed(9).slice(2)}$`,mt="?"+g,Rt=`<${mt}>`,A=document,O=()=>A.createComment(""),N=o=>o===null||typeof o!="object"&&typeof o!="function",tt=Array.isArray,Ut=o=>tt(o)||typeof o?.[Symbol.iterator]=="function",K=`[ +\f\r]`,M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,lt=/-->/g,ht=/>/g,_=RegExp(`>|${K}(?:([^\\s"'>=/]+)(${K}*=${K}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`,"g"),ct=/'/g,dt=/"/g,ft=/^(?:script|style|textarea|title)$/i,et=o=>(t,...e)=>({_$litType$:o,strings:t,values:e}),st=et(1),qt=et(2),Bt=et(3),x=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),pt=new WeakMap,b=A.createTreeWalker(A,129);function gt(o,t){if(!tt(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return at!==void 0?at.createHTML(t):t}var Mt=(o,t)=>{let e=o.length-1,s=[],i,n=t===2?"":t===3?"":"",r=M;for(let h=0;h"?(r=i??M,l=-1):p[1]===void 0?l=-2:(l=r.lastIndex-p[2].length,d=p[1],r=p[3]===void 0?_:p[3]==='"'?dt:ct):r===dt||r===ct?r=_:r===lt||r===ht?r=M:(r=_,i=void 0);let f=r===_&&o[h+1].startsWith("/>")?" ":"";n+=r===M?a+Rt:l>=0?(s.push(d),a.slice(0,l)+ut+a.slice(l)+g+f):a+g+(l===-2?h:f)}return[gt(o,n+(o[e]||"")+(t===2?"":t===3?"":"")),s]},H=class o{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let n=0,r=0,h=t.length-1,a=this.parts,[d,p]=Mt(t,e);if(this.el=o.createElement(d,s),b.currentNode=this.el.content,e===2||e===3){let l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(i=b.nextNode())!==null&&a.length0){i.textContent=q?q.emptyScript:"";for(let f=0;f2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=c}_$AI(t,e=this,s,i){let n=this.strings,r=!1;if(n===void 0)t=E(this,t,e,0),r=!N(t)||t!==this._$AH&&t!==x,r&&(this._$AH=t);else{let h=t,a,d;for(t=n[0],a=0;a{let s=e?.renderBefore??t,i=s._$litPart$;if(i===void 0){let n=e?.renderBefore??null;s._$litPart$=i=new T(t.insertBefore(O(),n),n,void 0,e??{})}return i._$AI(o),i};var y=class extends m{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=yt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return x}};y._$litElement$=!0,y.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:y});var Nt=globalThis.litElementPolyfillSupport;Nt?.({LitElement:y});(globalThis.litElementVersions??=[]).push("4.1.0");var Ht={attribute:!0,type:String,converter:U,reflect:!1,hasChanged:V},Tt=(o=Ht,t,e)=>{let{kind:s,metadata:i}=e,n=globalThis.litPropertyMetadata.get(i);if(n===void 0&&globalThis.litPropertyMetadata.set(i,n=new Map),n.set(e.name,o),s==="accessor"){let{name:r}=e;return{set(h){let a=t.get.call(this);t.set.call(this,h),this.requestUpdate(r,a,o)},init(h){return h!==void 0&&this.P(r,void 0,o),h}}}if(s==="setter"){let{name:r}=e;return function(h){let a=this[r];t.call(this,h),this.requestUpdate(r,a,o)}}throw Error("Unsupported decorator location: "+s)};function S(o){return(t,e)=>typeof e=="object"?Tt(o,t,e):((s,i,n)=>{let r=i.hasOwnProperty(n);return i.constructor.createProperty(n,r?{...s,wrapped:!0}:s),r?Object.getOwnPropertyDescriptor(i,n):void 0})(o,t,e)}var $t=v` .legacy-button { align-items: center; diff --git a/geemap/static/material_styles.js b/geemap/static/material_styles.js index 2aff906ab4..d5a7762b34 100644 --- a/geemap/static/material_styles.js +++ b/geemap/static/material_styles.js @@ -1,5 +1,5 @@ -var R=globalThis,T=R.ShadowRoot&&(R.ShadyCSS===void 0||R.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,L=Symbol(),F=new WeakMap,b=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==L)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(T&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=F.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&F.set(e,t))}return t}toString(){return this.cssText}},Q=o=>new b(typeof o=="string"?o:o+"",void 0,L),z=(o,...t)=>{let e=o.length===1?o[0]:t.reduce((s,i,r)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+o[r+1],o[0]);return new b(e,o,L)},I=(o,t)=>{if(T)o.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=R.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,o.appendChild(s)}},M=T?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return Q(e)})(o):o;var{is:pt,defineProperty:ut,getOwnPropertyDescriptor:$t,getOwnPropertyNames:ft,getOwnPropertySymbols:_t,getPrototypeOf:mt}=Object,N=globalThis,Y=N.trustedTypes,At=Y?Y.emptyScript:"",gt=N.reactiveElementPolyfillSupport,w=(o,t)=>o,j={toAttribute(o,t){switch(t){case Boolean:o=o?At:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},tt=(o,t)=>!pt(o,t),G={attribute:!0,type:String,converter:j,reflect:!1,hasChanged:tt};Symbol.metadata??=Symbol("metadata"),N.litPropertyMetadata??=new WeakMap;var $=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=G){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&ut(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:r}=$t(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i?.call(this)},set(n){let p=i?.call(this);r.call(this,n),this.requestUpdate(t,p,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??G}static _$Ei(){if(this.hasOwnProperty(w("elementProperties")))return;let t=mt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(w("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(w("properties"))){let e=this.properties,s=[...ft(e),..._t(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(M(i))}else t!==void 0&&e.push(M(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return I(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let r=(s.converter?.toAttribute!==void 0?s.converter:j).toAttribute(e,s.type);this._$Em=t,r==null?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let r=s.getPropertyOptions(i),n=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute!==void 0?r.converter:j;this._$Em=i,this[i]=n.fromAttribute(e,r.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??tt)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,r]of this._$Ep)this[i]=r;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,r]of s)r.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],r)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[w("elementProperties")]=new Map,$[w("finalized")]=new Map,gt?.({ReactiveElement:$}),(N.reactiveElementVersions??=[]).push("2.0.4");var K=globalThis,k=K.trustedTypes,et=k?k.createPolicy("lit-html",{createHTML:o=>o}):void 0,ht="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,at="?"+_,yt=`<${at}>`,g=document,x=()=>g.createComment(""),P=o=>o===null||typeof o!="object"&&typeof o!="function",X=Array.isArray,vt=o=>X(o)||typeof o?.[Symbol.iterator]=="function",B=`[ -\f\r]`,C=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,st=/-->/g,it=/>/g,m=RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^ +var R=globalThis,T=R.ShadowRoot&&(R.ShadyCSS===void 0||R.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,L=Symbol(),F=new WeakMap,b=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==L)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(T&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=F.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&F.set(e,t))}return t}toString(){return this.cssText}},Q=o=>new b(typeof o=="string"?o:o+"",void 0,L),z=(o,...t)=>{let e=o.length===1?o[0]:t.reduce((s,i,r)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+o[r+1],o[0]);return new b(e,o,L)},I=(o,t)=>{if(T)o.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=R.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,o.appendChild(s)}},M=T?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return Q(e)})(o):o;var{is:pt,defineProperty:ut,getOwnPropertyDescriptor:$t,getOwnPropertyNames:ft,getOwnPropertySymbols:_t,getPrototypeOf:mt}=Object,N=globalThis,Y=N.trustedTypes,At=Y?Y.emptyScript:"",gt=N.reactiveElementPolyfillSupport,w=(o,t)=>o,j={toAttribute(o,t){switch(t){case Boolean:o=o?At:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},tt=(o,t)=>!pt(o,t),G={attribute:!0,type:String,converter:j,reflect:!1,hasChanged:tt};Symbol.metadata??=Symbol("metadata"),N.litPropertyMetadata??=new WeakMap;var $=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=G){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&ut(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:r}=$t(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i?.call(this)},set(n){let p=i?.call(this);r.call(this,n),this.requestUpdate(t,p,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??G}static _$Ei(){if(this.hasOwnProperty(w("elementProperties")))return;let t=mt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(w("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(w("properties"))){let e=this.properties,s=[...ft(e),..._t(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(M(i))}else t!==void 0&&e.push(M(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return I(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let r=(s.converter?.toAttribute!==void 0?s.converter:j).toAttribute(e,s.type);this._$Em=t,r==null?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let r=s.getPropertyOptions(i),n=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute!==void 0?r.converter:j;this._$Em=i,this[i]=n.fromAttribute(e,r.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??tt)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,r]of this._$Ep)this[i]=r;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,r]of s)r.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],r)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[w("elementProperties")]=new Map,$[w("finalized")]=new Map,gt?.({ReactiveElement:$}),(N.reactiveElementVersions??=[]).push("2.0.4");var K=globalThis,k=K.trustedTypes,et=k?k.createPolicy("lit-html",{createHTML:o=>o}):void 0,ht="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,at="?"+_,yt=`<${at}>`,g=document,x=()=>g.createComment(""),P=o=>o===null||typeof o!="object"&&typeof o!="function",X=Array.isArray,vt=o=>X(o)||typeof o?.[Symbol.iterator]=="function",B=`[ +\f\r]`,C=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,st=/-->/g,it=/>/g,m=RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`,"g"),ot=/'/g,rt=/"/g,lt=/^(?:script|style|textarea|title)$/i,Z=o=>(t,...e)=>({_$litType$:o,strings:t,values:e}),Ut=Z(1),Ht=Z(2),Ot=Z(3),y=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),nt=new WeakMap,A=g.createTreeWalker(g,129);function ct(o,t){if(!X(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return et!==void 0?et.createHTML(t):t}var St=(o,t)=>{let e=o.length-1,s=[],i,r=t===2?"":t===3?"":"",n=C;for(let p=0;p"?(n=i??C,a=-1):d[1]===void 0?a=-2:(a=n.lastIndex-d[2].length,l=d[1],n=d[3]===void 0?m:d[3]==='"'?rt:ot):n===rt||n===ot?n=m:n===st||n===it?n=C:(n=m,i=void 0);let f=n===m&&o[p+1].startsWith("/>")?" ":"";r+=n===C?h+yt:a>=0?(s.push(l),h.slice(0,a)+ht+h.slice(a)+_+f):h+_+(a===-2?p:f)}return[ct(o,r+(o[e]||"")+(t===2?"":t===3?"":"")),s]},U=class o{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let r=0,n=0,p=t.length-1,h=this.parts,[l,d]=St(t,e);if(this.el=o.createElement(l,s),A.currentNode=this.el.content,e===2||e===3){let a=this.el.content.firstChild;a.replaceWith(...a.childNodes)}for(;(i=A.nextNode())!==null&&h.length0){i.textContent=k?k.emptyScript:"";for(let f=0;f2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=c}_$AI(t,e=this,s,i){let r=this.strings,n=!1;if(r===void 0)t=v(this,t,e,0),n=!P(t)||t!==this._$AH&&t!==y,n&&(this._$AH=t);else{let p=t,h,l;for(t=r[0],h=0;h{let s=e?.renderBefore??t,i=s._$litPart$;if(i===void 0){let r=e?.renderBefore??null;s._$litPart$=i=new H(t.insertBefore(x(),r),r,void 0,e??{})}return i._$AI(o),i};var E=class extends ${constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=dt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return y}};E._$litElement$=!0,E.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:E});var bt=globalThis.litElementPolyfillSupport;bt?.({LitElement:E});(globalThis.litElementVersions??=[]).push("4.1.0");var Jt=z` @font-face { font-family: 'Material Symbols Outlined'; From b87f39d5cc68c2f8bb02ce8b35757c75c916fd14 Mon Sep 17 00:00:00 2001 From: Nathaniel Schmitz Date: Mon, 14 Oct 2024 14:43:04 -0400 Subject: [PATCH 05/57] Use non-minified JS files to work around property renaming issue --- geemap/static/ipywidgets_styles.js | 555 +++++++++++++++++++++- geemap/static/layer_manager.css | 5 +- geemap/static/layer_manager.js | 684 +++++++++++++++++++++++++- geemap/static/layer_manager_row.css | 5 +- geemap/static/layer_manager_row.js | 712 +++++++++++++++++++++++++++- geemap/static/material_styles.js | 555 +++++++++++++++++++++- geemap/static/utils.js | 22 +- package.json | 2 +- 8 files changed, 2513 insertions(+), 27 deletions(-) diff --git a/geemap/static/ipywidgets_styles.js b/geemap/static/ipywidgets_styles.js index 4b907e8604..7e6805d52e 100644 --- a/geemap/static/ipywidgets_styles.js +++ b/geemap/static/ipywidgets_styles.js @@ -1,6 +1,549 @@ -var R=globalThis,N=R.ShadowRoot&&(R.ShadyCSS===void 0||R.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,k=Symbol(),Z=new WeakMap,E=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==k)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(N&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=Z.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Z.set(e,t))}return t}toString(){return this.cssText}},X=r=>new E(typeof r=="string"?r:r+"",void 0,k),z=(r,...t)=>{let e=r.length===1?r[0]:t.reduce((s,i,o)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[o+1],r[0]);return new E(e,r,k)},L=(r,t)=>{if(N)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=R.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s)}},T=N?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return X(e)})(r):r;var{is:pt,defineProperty:ut,getOwnPropertyDescriptor:$t,getOwnPropertyNames:ft,getOwnPropertySymbols:_t,getPrototypeOf:gt}=Object,M=globalThis,G=M.trustedTypes,mt=G?G.emptyScript:"",At=M.reactiveElementPolyfillSupport,w=(r,t)=>r,I={toAttribute(r,t){switch(t){case Boolean:r=r?mt:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},tt=(r,t)=>!pt(r,t),Y={attribute:!0,type:String,converter:I,reflect:!1,hasChanged:tt};Symbol.metadata??=Symbol("metadata"),M.litPropertyMetadata??=new WeakMap;var $=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Y){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&ut(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:o}=$t(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i?.call(this)},set(n){let p=i?.call(this);o.call(this,n),this.requestUpdate(t,p,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Y}static _$Ei(){if(this.hasOwnProperty(w("elementProperties")))return;let t=gt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(w("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(w("properties"))){let e=this.properties,s=[...ft(e),..._t(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(T(i))}else t!==void 0&&e.push(T(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return L(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let o=(s.converter?.toAttribute!==void 0?s.converter:I).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let o=s.getPropertyOptions(i),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:I;this._$Em=i,this[i]=n.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??tt)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,o]of this._$Ep)this[i]=o;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,o]of s)o.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],o)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[w("elementProperties")]=new Map,$[w("finalized")]=new Map,At?.({ReactiveElement:$}),(M.reactiveElementVersions??=[]).push("2.0.4");var J=globalThis,j=J.trustedTypes,et=j?j.createPolicy("lit-html",{createHTML:r=>r}):void 0,ht="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,at="?"+_,yt=`<${at}>`,A=document,C=()=>A.createComment(""),P=r=>r===null||typeof r!="object"&&typeof r!="function",F=Array.isArray,vt=r=>F(r)||typeof r?.[Symbol.iterator]=="function",B=`[ -\f\r]`,x=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,st=/-->/g,it=/>/g,g=RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^ -\f\r"'\`<>=]|("|')|))|$)`,"g"),rt=/'/g,ot=/"/g,lt=/^(?:script|style|textarea|title)$/i,Q=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),Ut=Q(1),Ht=Q(2),Ot=Q(3),y=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),nt=new WeakMap,m=A.createTreeWalker(A,129);function ct(r,t){if(!F(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return et!==void 0?et.createHTML(t):t}var St=(r,t)=>{let e=r.length-1,s=[],i,o=t===2?"":t===3?"":"",n=x;for(let p=0;p"?(n=i??x,a=-1):d[1]===void 0?a=-2:(a=n.lastIndex-d[2].length,l=d[1],n=d[3]===void 0?g:d[3]==='"'?ot:rt):n===ot||n===rt?n=g:n===st||n===it?n=x:(n=g,i=void 0);let f=n===g&&r[p+1].startsWith("/>")?" ":"";o+=n===x?h+yt:a>=0?(s.push(l),h.slice(0,a)+ht+h.slice(a)+_+f):h+_+(a===-2?p:f)}return[ct(r,o+(r[e]||"")+(t===2?"":t===3?"":"")),s]},U=class r{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let o=0,n=0,p=t.length-1,h=this.parts,[l,d]=St(t,e);if(this.el=r.createElement(l,s),m.currentNode=this.el.content,e===2||e===3){let a=this.el.content.firstChild;a.replaceWith(...a.childNodes)}for(;(i=m.nextNode())!==null&&h.length0){i.textContent=j?j.emptyScript:"";for(let f=0;f2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=c}_$AI(t,e=this,s,i){let o=this.strings,n=!1;if(o===void 0)t=v(this,t,e,0),n=!P(t)||t!==this._$AH&&t!==y,n&&(this._$AH=t);else{let p=t,h,l;for(t=o[0],h=0;h{let s=e?.renderBefore??t,i=s._$litPart$;if(i===void 0){let o=e?.renderBefore??null;s._$litPart$=i=new H(t.insertBefore(C(),o),o,void 0,e??{})}return i._$AI(r),i};var b=class extends ${constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=dt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return y}};b._$litElement$=!0,b.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:b});var Et=globalThis.litElementPolyfillSupport;Et?.({LitElement:b});(globalThis.litElementVersions??=[]).push("4.1.0");var qt=z` +// node_modules/@lit/reactive-element/css-tag.js +var t = globalThis; +var e = t.ShadowRoot && (void 0 === t.ShadyCSS || t.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype; +var s = Symbol(); +var o = /* @__PURE__ */ new WeakMap(); +var n = class { + constructor(t2, e3, o3) { + if (this._$cssResult$ = true, o3 !== s) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead."); + this.cssText = t2, this.t = e3; + } + get styleSheet() { + let t2 = this.o; + const s2 = this.t; + if (e && void 0 === t2) { + const e3 = void 0 !== s2 && 1 === s2.length; + e3 && (t2 = o.get(s2)), void 0 === t2 && ((this.o = t2 = new CSSStyleSheet()).replaceSync(this.cssText), e3 && o.set(s2, t2)); + } + return t2; + } + toString() { + return this.cssText; + } +}; +var r = (t2) => new n("string" == typeof t2 ? t2 : t2 + "", void 0, s); +var i = (t2, ...e3) => { + const o3 = 1 === t2.length ? t2[0] : e3.reduce((e4, s2, o4) => e4 + ((t3) => { + if (true === t3._$cssResult$) return t3.cssText; + if ("number" == typeof t3) return t3; + throw Error("Value passed to 'css' function must be a 'css' function result: " + t3 + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security."); + })(s2) + t2[o4 + 1], t2[0]); + return new n(o3, t2, s); +}; +var S = (s2, o3) => { + if (e) s2.adoptedStyleSheets = o3.map((t2) => t2 instanceof CSSStyleSheet ? t2 : t2.styleSheet); + else for (const e3 of o3) { + const o4 = document.createElement("style"), n4 = t.litNonce; + void 0 !== n4 && o4.setAttribute("nonce", n4), o4.textContent = e3.cssText, s2.appendChild(o4); + } +}; +var c = e ? (t2) => t2 : (t2) => t2 instanceof CSSStyleSheet ? ((t3) => { + let e3 = ""; + for (const s2 of t3.cssRules) e3 += s2.cssText; + return r(e3); +})(t2) : t2; + +// node_modules/@lit/reactive-element/reactive-element.js +var { is: i2, defineProperty: e2, getOwnPropertyDescriptor: r2, getOwnPropertyNames: h, getOwnPropertySymbols: o2, getPrototypeOf: n2 } = Object; +var a = globalThis; +var c2 = a.trustedTypes; +var l = c2 ? c2.emptyScript : ""; +var p = a.reactiveElementPolyfillSupport; +var d = (t2, s2) => t2; +var u = { toAttribute(t2, s2) { + switch (s2) { + case Boolean: + t2 = t2 ? l : null; + break; + case Object: + case Array: + t2 = null == t2 ? t2 : JSON.stringify(t2); + } + return t2; +}, fromAttribute(t2, s2) { + let i3 = t2; + switch (s2) { + case Boolean: + i3 = null !== t2; + break; + case Number: + i3 = null === t2 ? null : Number(t2); + break; + case Object: + case Array: + try { + i3 = JSON.parse(t2); + } catch (t3) { + i3 = null; + } + } + return i3; +} }; +var f = (t2, s2) => !i2(t2, s2); +var y = { attribute: true, type: String, converter: u, reflect: false, hasChanged: f }; +Symbol.metadata ??= Symbol("metadata"), a.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap(); +var b = class extends HTMLElement { + static addInitializer(t2) { + this._$Ei(), (this.l ??= []).push(t2); + } + static get observedAttributes() { + return this.finalize(), this._$Eh && [...this._$Eh.keys()]; + } + static createProperty(t2, s2 = y) { + if (s2.state && (s2.attribute = false), this._$Ei(), this.elementProperties.set(t2, s2), !s2.noAccessor) { + const i3 = Symbol(), r3 = this.getPropertyDescriptor(t2, i3, s2); + void 0 !== r3 && e2(this.prototype, t2, r3); + } + } + static getPropertyDescriptor(t2, s2, i3) { + const { get: e3, set: h4 } = r2(this.prototype, t2) ?? { get() { + return this[s2]; + }, set(t3) { + this[s2] = t3; + } }; + return { get() { + return e3?.call(this); + }, set(s3) { + const r3 = e3?.call(this); + h4.call(this, s3), this.requestUpdate(t2, r3, i3); + }, configurable: true, enumerable: true }; + } + static getPropertyOptions(t2) { + return this.elementProperties.get(t2) ?? y; + } + static _$Ei() { + if (this.hasOwnProperty(d("elementProperties"))) return; + const t2 = n2(this); + t2.finalize(), void 0 !== t2.l && (this.l = [...t2.l]), this.elementProperties = new Map(t2.elementProperties); + } + static finalize() { + if (this.hasOwnProperty(d("finalized"))) return; + if (this.finalized = true, this._$Ei(), this.hasOwnProperty(d("properties"))) { + const t3 = this.properties, s2 = [...h(t3), ...o2(t3)]; + for (const i3 of s2) this.createProperty(i3, t3[i3]); + } + const t2 = this[Symbol.metadata]; + if (null !== t2) { + const s2 = litPropertyMetadata.get(t2); + if (void 0 !== s2) for (const [t3, i3] of s2) this.elementProperties.set(t3, i3); + } + this._$Eh = /* @__PURE__ */ new Map(); + for (const [t3, s2] of this.elementProperties) { + const i3 = this._$Eu(t3, s2); + void 0 !== i3 && this._$Eh.set(i3, t3); + } + this.elementStyles = this.finalizeStyles(this.styles); + } + static finalizeStyles(s2) { + const i3 = []; + if (Array.isArray(s2)) { + const e3 = new Set(s2.flat(1 / 0).reverse()); + for (const s3 of e3) i3.unshift(c(s3)); + } else void 0 !== s2 && i3.push(c(s2)); + return i3; + } + static _$Eu(t2, s2) { + const i3 = s2.attribute; + return false === i3 ? void 0 : "string" == typeof i3 ? i3 : "string" == typeof t2 ? t2.toLowerCase() : void 0; + } + constructor() { + super(), this._$Ep = void 0, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev(); + } + _$Ev() { + this._$ES = new Promise((t2) => this.enableUpdating = t2), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((t2) => t2(this)); + } + addController(t2) { + (this._$EO ??= /* @__PURE__ */ new Set()).add(t2), void 0 !== this.renderRoot && this.isConnected && t2.hostConnected?.(); + } + removeController(t2) { + this._$EO?.delete(t2); + } + _$E_() { + const t2 = /* @__PURE__ */ new Map(), s2 = this.constructor.elementProperties; + for (const i3 of s2.keys()) this.hasOwnProperty(i3) && (t2.set(i3, this[i3]), delete this[i3]); + t2.size > 0 && (this._$Ep = t2); + } + createRenderRoot() { + const t2 = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions); + return S(t2, this.constructor.elementStyles), t2; + } + connectedCallback() { + this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach((t2) => t2.hostConnected?.()); + } + enableUpdating(t2) { + } + disconnectedCallback() { + this._$EO?.forEach((t2) => t2.hostDisconnected?.()); + } + attributeChangedCallback(t2, s2, i3) { + this._$AK(t2, i3); + } + _$EC(t2, s2) { + const i3 = this.constructor.elementProperties.get(t2), e3 = this.constructor._$Eu(t2, i3); + if (void 0 !== e3 && true === i3.reflect) { + const r3 = (void 0 !== i3.converter?.toAttribute ? i3.converter : u).toAttribute(s2, i3.type); + this._$Em = t2, null == r3 ? this.removeAttribute(e3) : this.setAttribute(e3, r3), this._$Em = null; + } + } + _$AK(t2, s2) { + const i3 = this.constructor, e3 = i3._$Eh.get(t2); + if (void 0 !== e3 && this._$Em !== e3) { + const t3 = i3.getPropertyOptions(e3), r3 = "function" == typeof t3.converter ? { fromAttribute: t3.converter } : void 0 !== t3.converter?.fromAttribute ? t3.converter : u; + this._$Em = e3, this[e3] = r3.fromAttribute(s2, t3.type), this._$Em = null; + } + } + requestUpdate(t2, s2, i3) { + if (void 0 !== t2) { + if (i3 ??= this.constructor.getPropertyOptions(t2), !(i3.hasChanged ?? f)(this[t2], s2)) return; + this.P(t2, s2, i3); + } + false === this.isUpdatePending && (this._$ES = this._$ET()); + } + P(t2, s2, i3) { + this._$AL.has(t2) || this._$AL.set(t2, s2), true === i3.reflect && this._$Em !== t2 && (this._$Ej ??= /* @__PURE__ */ new Set()).add(t2); + } + async _$ET() { + this.isUpdatePending = true; + try { + await this._$ES; + } catch (t3) { + Promise.reject(t3); + } + const t2 = this.scheduleUpdate(); + return null != t2 && await t2, !this.isUpdatePending; + } + scheduleUpdate() { + return this.performUpdate(); + } + performUpdate() { + if (!this.isUpdatePending) return; + if (!this.hasUpdated) { + if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) { + for (const [t4, s3] of this._$Ep) this[t4] = s3; + this._$Ep = void 0; + } + const t3 = this.constructor.elementProperties; + if (t3.size > 0) for (const [s3, i3] of t3) true !== i3.wrapped || this._$AL.has(s3) || void 0 === this[s3] || this.P(s3, this[s3], i3); + } + let t2 = false; + const s2 = this._$AL; + try { + t2 = this.shouldUpdate(s2), t2 ? (this.willUpdate(s2), this._$EO?.forEach((t3) => t3.hostUpdate?.()), this.update(s2)) : this._$EU(); + } catch (s3) { + throw t2 = false, this._$EU(), s3; + } + t2 && this._$AE(s2); + } + willUpdate(t2) { + } + _$AE(t2) { + this._$EO?.forEach((t3) => t3.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t2)), this.updated(t2); + } + _$EU() { + this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = false; + } + get updateComplete() { + return this.getUpdateComplete(); + } + getUpdateComplete() { + return this._$ES; + } + shouldUpdate(t2) { + return true; + } + update(t2) { + this._$Ej &&= this._$Ej.forEach((t3) => this._$EC(t3, this[t3])), this._$EU(); + } + updated(t2) { + } + firstUpdated(t2) { + } +}; +b.elementStyles = [], b.shadowRootOptions = { mode: "open" }, b[d("elementProperties")] = /* @__PURE__ */ new Map(), b[d("finalized")] = /* @__PURE__ */ new Map(), p?.({ ReactiveElement: b }), (a.reactiveElementVersions ??= []).push("2.0.4"); + +// node_modules/lit-html/lit-html.js +var n3 = globalThis; +var c3 = n3.trustedTypes; +var h2 = c3 ? c3.createPolicy("lit-html", { createHTML: (t2) => t2 }) : void 0; +var f2 = "$lit$"; +var v = `lit$${Math.random().toFixed(9).slice(2)}$`; +var m = "?" + v; +var _ = `<${m}>`; +var w = document; +var lt = () => w.createComment(""); +var st = (t2) => null === t2 || "object" != typeof t2 && "function" != typeof t2; +var g = Array.isArray; +var $ = (t2) => g(t2) || "function" == typeof t2?.[Symbol.iterator]; +var x = "[ \n\f\r]"; +var T = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g; +var E = /-->/g; +var k = />/g; +var O = RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`, "g"); +var S2 = /'/g; +var j = /"/g; +var M = /^(?:script|style|textarea|title)$/i; +var P = (t2) => (i3, ...s2) => ({ _$litType$: t2, strings: i3, values: s2 }); +var ke = P(1); +var Oe = P(2); +var Se = P(3); +var R = Symbol.for("lit-noChange"); +var D = Symbol.for("lit-nothing"); +var V = /* @__PURE__ */ new WeakMap(); +var I = w.createTreeWalker(w, 129); +function N(t2, i3) { + if (!g(t2) || !t2.hasOwnProperty("raw")) throw Error("invalid template strings array"); + return void 0 !== h2 ? h2.createHTML(i3) : i3; +} +var U = (t2, i3) => { + const s2 = t2.length - 1, e3 = []; + let h4, o3 = 2 === i3 ? "" : 3 === i3 ? "" : "", n4 = T; + for (let i4 = 0; i4 < s2; i4++) { + const s3 = t2[i4]; + let r3, l2, c4 = -1, a2 = 0; + for (; a2 < s3.length && (n4.lastIndex = a2, l2 = n4.exec(s3), null !== l2); ) a2 = n4.lastIndex, n4 === T ? "!--" === l2[1] ? n4 = E : void 0 !== l2[1] ? n4 = k : void 0 !== l2[2] ? (M.test(l2[2]) && (h4 = RegExp("" === l2[0] ? (n4 = h4 ?? T, c4 = -1) : void 0 === l2[1] ? c4 = -2 : (c4 = n4.lastIndex - l2[2].length, r3 = l2[1], n4 = void 0 === l2[3] ? O : '"' === l2[3] ? j : S2) : n4 === j || n4 === S2 ? n4 = O : n4 === E || n4 === k ? n4 = T : (n4 = O, h4 = void 0); + const u2 = n4 === O && t2[i4 + 1].startsWith("/>") ? " " : ""; + o3 += n4 === T ? s3 + _ : c4 >= 0 ? (e3.push(r3), s3.slice(0, c4) + f2 + s3.slice(c4) + v + u2) : s3 + v + (-2 === c4 ? i4 : u2); + } + return [N(t2, o3 + (t2[s2] || "") + (2 === i3 ? "" : 3 === i3 ? "" : "")), e3]; +}; +var B = class _B { + constructor({ strings: t2, _$litType$: i3 }, s2) { + let e3; + this.parts = []; + let h4 = 0, o3 = 0; + const n4 = t2.length - 1, r3 = this.parts, [l2, a2] = U(t2, i3); + if (this.el = _B.createElement(l2, s2), I.currentNode = this.el.content, 2 === i3 || 3 === i3) { + const t3 = this.el.content.firstChild; + t3.replaceWith(...t3.childNodes); + } + for (; null !== (e3 = I.nextNode()) && r3.length < n4; ) { + if (1 === e3.nodeType) { + if (e3.hasAttributes()) for (const t3 of e3.getAttributeNames()) if (t3.endsWith(f2)) { + const i4 = a2[o3++], s3 = e3.getAttribute(t3).split(v), n5 = /([.?@])?(.*)/.exec(i4); + r3.push({ type: 1, index: h4, name: n5[2], strings: s3, ctor: "." === n5[1] ? Y : "?" === n5[1] ? Z : "@" === n5[1] ? q : G }), e3.removeAttribute(t3); + } else t3.startsWith(v) && (r3.push({ type: 6, index: h4 }), e3.removeAttribute(t3)); + if (M.test(e3.tagName)) { + const t3 = e3.textContent.split(v), i4 = t3.length - 1; + if (i4 > 0) { + e3.textContent = c3 ? c3.emptyScript : ""; + for (let s3 = 0; s3 < i4; s3++) e3.append(t3[s3], lt()), I.nextNode(), r3.push({ type: 2, index: ++h4 }); + e3.append(t3[i4], lt()); + } + } + } else if (8 === e3.nodeType) if (e3.data === m) r3.push({ type: 2, index: h4 }); + else { + let t3 = -1; + for (; -1 !== (t3 = e3.data.indexOf(v, t3 + 1)); ) r3.push({ type: 7, index: h4 }), t3 += v.length - 1; + } + h4++; + } + } + static createElement(t2, i3) { + const s2 = w.createElement("template"); + return s2.innerHTML = t2, s2; + } +}; +function z(t2, i3, s2 = t2, e3) { + if (i3 === R) return i3; + let h4 = void 0 !== e3 ? s2.o?.[e3] : s2.l; + const o3 = st(i3) ? void 0 : i3._$litDirective$; + return h4?.constructor !== o3 && (h4?._$AO?.(false), void 0 === o3 ? h4 = void 0 : (h4 = new o3(t2), h4._$AT(t2, s2, e3)), void 0 !== e3 ? (s2.o ??= [])[e3] = h4 : s2.l = h4), void 0 !== h4 && (i3 = z(t2, h4._$AS(t2, i3.values), h4, e3)), i3; +} +var F = class { + constructor(t2, i3) { + this._$AV = [], this._$AN = void 0, this._$AD = t2, this._$AM = i3; + } + get parentNode() { + return this._$AM.parentNode; + } + get _$AU() { + return this._$AM._$AU; + } + u(t2) { + const { el: { content: i3 }, parts: s2 } = this._$AD, e3 = (t2?.creationScope ?? w).importNode(i3, true); + I.currentNode = e3; + let h4 = I.nextNode(), o3 = 0, n4 = 0, r3 = s2[0]; + for (; void 0 !== r3; ) { + if (o3 === r3.index) { + let i4; + 2 === r3.type ? i4 = new et(h4, h4.nextSibling, this, t2) : 1 === r3.type ? i4 = new r3.ctor(h4, r3.name, r3.strings, this, t2) : 6 === r3.type && (i4 = new K(h4, this, t2)), this._$AV.push(i4), r3 = s2[++n4]; + } + o3 !== r3?.index && (h4 = I.nextNode(), o3++); + } + return I.currentNode = w, e3; + } + p(t2) { + let i3 = 0; + for (const s2 of this._$AV) void 0 !== s2 && (void 0 !== s2.strings ? (s2._$AI(t2, s2, i3), i3 += s2.strings.length - 2) : s2._$AI(t2[i3])), i3++; + } +}; +var et = class _et { + get _$AU() { + return this._$AM?._$AU ?? this.v; + } + constructor(t2, i3, s2, e3) { + this.type = 2, this._$AH = D, this._$AN = void 0, this._$AA = t2, this._$AB = i3, this._$AM = s2, this.options = e3, this.v = e3?.isConnected ?? true; + } + get parentNode() { + let t2 = this._$AA.parentNode; + const i3 = this._$AM; + return void 0 !== i3 && 11 === t2?.nodeType && (t2 = i3.parentNode), t2; + } + get startNode() { + return this._$AA; + } + get endNode() { + return this._$AB; + } + _$AI(t2, i3 = this) { + t2 = z(this, t2, i3), st(t2) ? t2 === D || null == t2 || "" === t2 ? (this._$AH !== D && this._$AR(), this._$AH = D) : t2 !== this._$AH && t2 !== R && this._(t2) : void 0 !== t2._$litType$ ? this.$(t2) : void 0 !== t2.nodeType ? this.T(t2) : $(t2) ? this.k(t2) : this._(t2); + } + O(t2) { + return this._$AA.parentNode.insertBefore(t2, this._$AB); + } + T(t2) { + this._$AH !== t2 && (this._$AR(), this._$AH = this.O(t2)); + } + _(t2) { + this._$AH !== D && st(this._$AH) ? this._$AA.nextSibling.data = t2 : this.T(w.createTextNode(t2)), this._$AH = t2; + } + $(t2) { + const { values: i3, _$litType$: s2 } = t2, e3 = "number" == typeof s2 ? this._$AC(t2) : (void 0 === s2.el && (s2.el = B.createElement(N(s2.h, s2.h[0]), this.options)), s2); + if (this._$AH?._$AD === e3) this._$AH.p(i3); + else { + const t3 = new F(e3, this), s3 = t3.u(this.options); + t3.p(i3), this.T(s3), this._$AH = t3; + } + } + _$AC(t2) { + let i3 = V.get(t2.strings); + return void 0 === i3 && V.set(t2.strings, i3 = new B(t2)), i3; + } + k(t2) { + g(this._$AH) || (this._$AH = [], this._$AR()); + const i3 = this._$AH; + let s2, e3 = 0; + for (const h4 of t2) e3 === i3.length ? i3.push(s2 = new _et(this.O(lt()), this.O(lt()), this, this.options)) : s2 = i3[e3], s2._$AI(h4), e3++; + e3 < i3.length && (this._$AR(s2 && s2._$AB.nextSibling, e3), i3.length = e3); + } + _$AR(t2 = this._$AA.nextSibling, i3) { + for (this._$AP?.(false, true, i3); t2 && t2 !== this._$AB; ) { + const i4 = t2.nextSibling; + t2.remove(), t2 = i4; + } + } + setConnected(t2) { + void 0 === this._$AM && (this.v = t2, this._$AP?.(t2)); + } +}; +var G = class { + get tagName() { + return this.element.tagName; + } + get _$AU() { + return this._$AM._$AU; + } + constructor(t2, i3, s2, e3, h4) { + this.type = 1, this._$AH = D, this._$AN = void 0, this.element = t2, this.name = i3, this._$AM = e3, this.options = h4, s2.length > 2 || "" !== s2[0] || "" !== s2[1] ? (this._$AH = Array(s2.length - 1).fill(new String()), this.strings = s2) : this._$AH = D; + } + _$AI(t2, i3 = this, s2, e3) { + const h4 = this.strings; + let o3 = false; + if (void 0 === h4) t2 = z(this, t2, i3, 0), o3 = !st(t2) || t2 !== this._$AH && t2 !== R, o3 && (this._$AH = t2); + else { + const e4 = t2; + let n4, r3; + for (t2 = h4[0], n4 = 0; n4 < h4.length - 1; n4++) r3 = z(this, e4[s2 + n4], i3, n4), r3 === R && (r3 = this._$AH[n4]), o3 ||= !st(r3) || r3 !== this._$AH[n4], r3 === D ? t2 = D : t2 !== D && (t2 += (r3 ?? "") + h4[n4 + 1]), this._$AH[n4] = r3; + } + o3 && !e3 && this.j(t2); + } + j(t2) { + t2 === D ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t2 ?? ""); + } +}; +var Y = class extends G { + constructor() { + super(...arguments), this.type = 3; + } + j(t2) { + this.element[this.name] = t2 === D ? void 0 : t2; + } +}; +var Z = class extends G { + constructor() { + super(...arguments), this.type = 4; + } + j(t2) { + this.element.toggleAttribute(this.name, !!t2 && t2 !== D); + } +}; +var q = class extends G { + constructor(t2, i3, s2, e3, h4) { + super(t2, i3, s2, e3, h4), this.type = 5; + } + _$AI(t2, i3 = this) { + if ((t2 = z(this, t2, i3, 0) ?? D) === R) return; + const s2 = this._$AH, e3 = t2 === D && s2 !== D || t2.capture !== s2.capture || t2.once !== s2.once || t2.passive !== s2.passive, h4 = t2 !== D && (s2 === D || e3); + e3 && this.element.removeEventListener(this.name, this, s2), h4 && this.element.addEventListener(this.name, this, t2), this._$AH = t2; + } + handleEvent(t2) { + "function" == typeof this._$AH ? this._$AH.call(this.options?.host ?? this.element, t2) : this._$AH.handleEvent(t2); + } +}; +var K = class { + constructor(t2, i3, s2) { + this.element = t2, this.type = 6, this._$AN = void 0, this._$AM = i3, this.options = s2; + } + get _$AU() { + return this._$AM._$AU; + } + _$AI(t2) { + z(this, t2); + } +}; +var Re = n3.litHtmlPolyfillSupport; +Re?.(B, et), (n3.litHtmlVersions ??= []).push("3.2.0"); +var Q = (t2, i3, s2) => { + const e3 = s2?.renderBefore ?? i3; + let h4 = e3._$litPart$; + if (void 0 === h4) { + const t3 = s2?.renderBefore ?? null; + e3._$litPart$ = h4 = new et(i3.insertBefore(lt(), t3), t3, void 0, s2 ?? {}); + } + return h4._$AI(t2), h4; +}; + +// node_modules/lit-element/lit-element.js +var h3 = class extends b { + constructor() { + super(...arguments), this.renderOptions = { host: this }, this.o = void 0; + } + createRenderRoot() { + const t2 = super.createRenderRoot(); + return this.renderOptions.renderBefore ??= t2.firstChild, t2; + } + update(t2) { + const e3 = this.render(); + this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t2), this.o = Q(e3, this.renderRoot, this.renderOptions); + } + connectedCallback() { + super.connectedCallback(), this.o?.setConnected(true); + } + disconnectedCallback() { + super.disconnectedCallback(), this.o?.setConnected(false); + } + render() { + return R; + } +}; +h3._$litElement$ = true, h3["finalized"] = true, globalThis.litElementHydrateSupport?.({ LitElement: h3 }); +var f3 = globalThis.litElementPolyfillSupport; +f3?.({ LitElement: h3 }); +(globalThis.litElementVersions ??= []).push("4.1.0"); + +// js/ipywidgets_styles.ts +var legacyStyles = i` .legacy-button { align-items: center; background-color: var(--jp-layout-color2); @@ -53,7 +596,10 @@ var R=globalThis,N=R.ShadowRoot&&(R.ShadyCSS===void 0||R.ShadyCSS.nativeShadow)& height: var(--jp-widgets-inline-height); line-height: var(--jp-widgets-inline-height); } -`;export{qt as legacyStyles}; +`; +export { + legacyStyles +}; /*! Bundled license information: @lit/reactive-element/css-tag.js: @@ -91,3 +637,4 @@ lit-html/is-server.js: * SPDX-License-Identifier: BSD-3-Clause *) */ +//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vbm9kZV9tb2R1bGVzL0BsaXQvcmVhY3RpdmUtZWxlbWVudC9zcmMvY3NzLXRhZy50cyIsICIuLi8uLi9ub2RlX21vZHVsZXMvQGxpdC9yZWFjdGl2ZS1lbGVtZW50L3NyYy9yZWFjdGl2ZS1lbGVtZW50LnRzIiwgIi4uLy4uL25vZGVfbW9kdWxlcy9saXQtaHRtbC9zcmMvbGl0LWh0bWwudHMiLCAiLi4vLi4vbm9kZV9tb2R1bGVzL2xpdC1lbGVtZW50L3NyYy9saXQtZWxlbWVudC50cyIsICIuLi8uLi9qcy9pcHl3aWRnZXRzX3N0eWxlcy50cyJdLAogICJzb3VyY2VzQ29udGVudCI6IFsiLyoqXG4gKiBAbGljZW5zZVxuICogQ29weXJpZ2h0IDIwMTkgR29vZ2xlIExMQ1xuICogU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IEJTRC0zLUNsY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aWMgdGFnIG5hbWVzLCB3ZSBkb24ndFxuICAgICAgICAvLyBpbmNyZW1lbnQgdGhlIGJpbmRpbmdJbmRleCwgYW5kIGl0J2xsIGJlIG9mZiBieSAxIGluIHRoZSBlbGVtZW50XG4gICAgICAgIC8vIGFuZCBvZmYgYnkgdHdvIGFmdGVyIGl0LlxuICAgICAgICBpZiAoKG5vZGUgYXMgRWxlbWVudCkuaGFzQXR0cmlidXRlcygpKSB7XG4gICAgICAgICAgZm9yIChjb25zdCBuYW1lIG9mIChub2RlIGFzIEVsZW1lbnQpLmdldEF0dHJpYnV0ZU5hbWVzKCkpIHtcbiAgICAgICAgICAgIGlmIChuYW1lLmVuZHNXaXRoKGJvdW5kQXR0cmlidXRlU3VmZml4KSkge1xuICAgICAgICAgICAgICBjb25zdCByZWFsTmFtZSA9IGF0dHJOYW1lc1thdHRyTmFtZUluZGV4KytdO1xuICAgICAgICAgICAgICBjb25zdCB2YWx1ZSA9IChub2RlIGFzIEVsZW1lbnQpLmdldEF0dHJpYnV0ZShuYW1lKSE7XG4gICAgICAgICAgICAgIGNvbnN0IHN0YXRpY3MgPSB2YWx1ZS5zcGxpdChtYXJrZXIpO1xuICAgICAgICAgICAgICBjb25zdCBtID0gLyhbLj9AXSk/KC4qKS8uZXhlYyhyZWFsTmFtZSkhO1xuICAgICAgICAgICAgICBwYXJ0cy5wdXNoKHtcbiAgICAgICAgICAgICAgICB0eXBlOiBBVFRSSUJVVEVfUEFSVCxcbiAgICAgICAgICAgICAgICBpbmRleDogbm9kZUluZGV4LFxuICAgICAgICAgICAgICAgIG5hbWU6IG1bMl0sXG4gICAgICAgICAgICAgICAgc3RyaW5nczogc3RhdGljcyxcbiAgICAgICAgICAgICAgICBjdG9yOlxuICAgICAgICAgICAgICAgICAgbVsxXSA9PT0gJy4nXG4gICAgICAgICAgICAgICAgICAgID8gUHJvcGVydHlQYXJ0XG4gICAgICAgICAgICAgICAgICAgIDogbVsxXSA9PT0gJz8nXG4gICAgICAgICAgICAgICAgICAgICAgPyBCb29sZWFuQXR0cmlidXRlUGFydFxuICAgICAgICAgICAgICAgICAgICAgIDogbVsxXSA9PT0gJ0AnXG4gICAgICAgICAgICAgICAgICAgICAgICA/IEV2ZW50UGFydFxuICAgICAgICAgICAgICAgICAgICAgICAgOiBBdHRyaWJ1dGVQYXJ0LFxuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgKG5vZGUgYXMgRWxlbWVudCkucmVtb3ZlQXR0cmlidXRlKG5hbWUpO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChuYW1lLnN0YXJ0c1dpdGgobWFya2VyKSkge1xuICAgICAgICAgICAgICBwYXJ0cy5wdXNoKHtcbiAgICAgICAgICAgICAgICB0eXBlOiBFTEVNRU5UX1BBUlQsXG4gICAgICAgICAgICAgICAgaW5kZXg6IG5vZGVJbmRleCxcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgIChub2RlIGFzIEVsZW1lbnQpLnJlbW92ZUF0dHJpYnV0ZShuYW1lKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgLy8gVE9ETyAoanVzdGluZmFnbmFuaSk6IGJlbmNobWFyayB0aGUgcmVnZXggYWdhaW5zdCB0ZXN0aW5nIGZvciBlYWNoXG4gICAgICAgIC8vIG9mIHRoZSAzIHJhdyB0ZXh0IGVsZW1lbnQgbmFtZXMuXG4gICAgICAgIGlmIChyYXdUZXh0RWxlbWVudC50ZXN0KChub2RlIGFzIEVsZW1lbnQpLnRhZ05hbWUpKSB7XG4gICAgICAgICAgLy8gRm9yIHJhdyB0ZXh0IGVsZW1lbnRzIHdlIG5lZWQgdG8gc3BsaXQgdGhlIHRleHQgY29udGVudCBvblxuICAgICAgICAgIC8vIG1hcmtlcnMsIGNyZWF0ZSBhIFRleHQgbm9kZSBmb3IgZWFjaCBzZWdtZW50LCBhbmQgY3JlYXRlXG4gICAgICAgICAgLy8gYSBUZW1wbGF0ZVB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FydDogUGFydCB8IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHRlbXBsYXRlUGFydC50eXBlID09PSBDSElMRF9QQVJUKSB7XG4gICAgICAgICAgcGFydCA9IG5ldyBDaGlsZFBhcnQoXG4gICAgICAgICAgICBub2RlIGFzIEhUTUxFbGVtZW50LFxuICAgICAgICAgICAgbm9kZS5uZXh0U2libGluZyxcbiAgICAgICAgICAgIHRoaXMsXG4gICAgICAgICAgICBvcHRpb25zLFxuICAgICAgICAgICk7XG4gICAgICAgIH0gZWxzZSBpZiAodGVtcGxhdGVQYXJ0LnR5cGUgPT09IEFUVFJJQlVURV9QQVJUKSB7XG4gICAgICAgICAgcGFydCA9IG5ldyB0ZW1wbGF0ZVBhcnQuY3RvcihcbiAgICAgICAgICAgIG5vZGUgYXMgSFRNTEVsZW1lbnQsXG4gICAgICAgICAgICB0ZW1wbGF0ZVBhcnQubmFtZSxcbiAgICAgICAgICAgIHRlbXBsYXRlUGFydC5zdHJpbmdzLFxuICAgICAgICAgICAgdGhpcyxcbiAgICAgICAgICAgIG9wdGlvbnMsXG4gICAgICAgICAgKTtcbiAgICAgICAgfSBlbHNlIGlmICh0ZW1wbGF0ZVBhcnQudHlwZSA9PT0gRUxFTUVOVF9QQVJUKSB7XG4gICAgICAgICAgcGFydCA9IG5ldyBFbGVtZW50UGFydChub2RlIGFzIEhUTUxFbGVtZW50LCB0aGlzLCBvcHRpb25zKTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLl8kcGFydHMucHVzaChwYXJ0KTtcbiAgICAgICAgdGVtcGxhdGVQYXJ0ID0gcGFydHNbKytwYXJ0SW5kZXhdO1xuICAgICAgfVxuICAgICAgaWYgKG5vZGVJbmRleCAhPT0gdGVtcGxhdGVQYXJ0Py5pbmRleCkge1xuICAgICAgICBub2RlID0gd2Fsa2VyLm5leHROb2RlKCkhO1xuICAgICAgICBub2RlSW5kZXgrKztcbiAgICAgIH1cbiAgICB9XG4gICAgLy8gV2UgbmVlZCB0by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AiY2hhbmdlZFByb3BlcnRpZXMiLCAidmFsdWUiLCAicmVuZGVyIiwgImhhc1VwZGF0ZWQiLCAiaXNDb25uZWN0ZWQiLCAidXBkYXRlIiwgImNvbm5lY3RlZENhbGxiYWNrIiwgInNldENvbm5lY3RlZCIsICJkaXNjb25uZWN0ZWRDYWxsYmFjayIsICJub0NoYW5nZSIsICJnbG9iYWxUaGlzIiwgImxpdEVsZW1lbnRIeWRyYXRlU3VwcG9ydCIsICJwb2x5ZmlsbFN1cHBvcnQiLCAibGl0RWxlbWVudFBvbHlmaWxsU3VwcG9ydCIsICJnbG9iYWxUaGlzIiwgImxpdEVsZW1lbnRWZXJzaW9ucyIsICJwdXNoIl0KfQo= diff --git a/geemap/static/layer_manager.css b/geemap/static/layer_manager.css index 04ef49523b..153c430c38 100644 --- a/geemap/static/layer_manager.css +++ b/geemap/static/layer_manager.css @@ -1 +1,4 @@ -@import"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined"; +@import "https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined"; + +/* js/common.css */ +/*# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFtdLAogICJzb3VyY2VzQ29udGVudCI6IFtdLAogICJtYXBwaW5ncyI6ICIiLAogICJuYW1lcyI6IFtdCn0K */ diff --git a/geemap/static/layer_manager.js b/geemap/static/layer_manager.js index b27896c6f1..6c87933c13 100644 --- a/geemap/static/layer_manager.js +++ b/geemap/static/layer_manager.js @@ -1,6 +1,590 @@ -var At=Object.defineProperty;var vt=Object.getOwnPropertyDescriptor;var st=(r,t,e,s)=>{for(var i=s>1?void 0:s?vt(t,e):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(i=(s?n(t,e,i):n(i))||i);return s&&i&&At(t,e,i),i};var T=globalThis,k=T.ShadowRoot&&(T.ShadyCSS===void 0||T.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,V=Symbol(),it=new WeakMap,x=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==V)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(k&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=it.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&it.set(e,t))}return t}toString(){return this.cssText}},rt=r=>new x(typeof r=="string"?r:r+"",void 0,V),w=(r,...t)=>{let e=r.length===1?r[0]:t.reduce((s,i,o)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[o+1],r[0]);return new x(e,r,V)},B=(r,t)=>{if(k)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=T.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s)}},j=k?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return rt(e)})(r):r;var{is:bt,defineProperty:St,getOwnPropertyDescriptor:Et,getOwnPropertyNames:xt,getOwnPropertySymbols:wt,getPrototypeOf:Ct}=Object,L=globalThis,ot=L.trustedTypes,Pt=ot?ot.emptyScript:"",Mt=L.reactiveElementPolyfillSupport,C=(r,t)=>r,P={toAttribute(r,t){switch(t){case Boolean:r=r?Pt:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},z=(r,t)=>!bt(r,t),nt={attribute:!0,type:String,converter:P,reflect:!1,hasChanged:z};Symbol.metadata??=Symbol("metadata"),L.litPropertyMetadata??=new WeakMap;var m=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=nt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&St(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:o}=Et(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i?.call(this)},set(n){let h=i?.call(this);o.call(this,n),this.requestUpdate(t,h,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??nt}static _$Ei(){if(this.hasOwnProperty(C("elementProperties")))return;let t=Ct(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(C("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(C("properties"))){let e=this.properties,s=[...xt(e),...wt(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(j(i))}else t!==void 0&&e.push(j(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return B(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let o=(s.converter?.toAttribute!==void 0?s.converter:P).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let o=s.getPropertyOptions(i),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:P;this._$Em=i,this[i]=n.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??z)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,o]of this._$Ep)this[i]=o;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,o]of s)o.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],o)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};m.elementStyles=[],m.shadowRootOptions={mode:"open"},m[C("elementProperties")]=new Map,m[C("finalized")]=new Map,Mt?.({ReactiveElement:m}),(L.reactiveElementVersions??=[]).push("2.0.4");var X=globalThis,I=X.trustedTypes,at=I?I.createPolicy("lit-html",{createHTML:r=>r}):void 0,ut="$lit$",g=`lit$${Math.random().toFixed(9).slice(2)}$`,mt="?"+g,Ut=`<${mt}>`,A=document,U=()=>A.createComment(""),N=r=>r===null||typeof r!="object"&&typeof r!="function",Y=Array.isArray,Nt=r=>Y(r)||typeof r?.[Symbol.iterator]=="function",W=`[ -\f\r]`,M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,lt=/-->/g,ht=/>/g,$=RegExp(`>|${W}(?:([^\\s"'>=/]+)(${W}*=${W}*(?:[^ -\f\r"'\`<>=]|("|')|))|$)`,"g"),ct=/'/g,dt=/"/g,ft=/^(?:script|style|textarea|title)$/i,G=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),gt=G(1),Bt=G(2),Wt=G(3),v=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),pt=new WeakMap,_=A.createTreeWalker(A,129);function yt(r,t){if(!Y(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return at!==void 0?at.createHTML(t):t}var Ot=(r,t)=>{let e=r.length-1,s=[],i,o=t===2?"":t===3?"":"",n=M;for(let h=0;h"?(n=i??M,l=-1):p[1]===void 0?l=-2:(l=n.lastIndex-p[2].length,c=p[1],n=p[3]===void 0?$:p[3]==='"'?dt:ct):n===dt||n===ct?n=$:n===lt||n===ht?n=M:(n=$,i=void 0);let f=n===$&&r[h+1].startsWith("/>")?" ":"";o+=n===M?a+Ut:l>=0?(s.push(c),a.slice(0,l)+ut+a.slice(l)+g+f):a+g+(l===-2?h:f)}return[yt(r,o+(r[e]||"")+(t===2?"":t===3?"":"")),s]},O=class r{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let o=0,n=0,h=t.length-1,a=this.parts,[c,p]=Ot(t,e);if(this.el=r.createElement(c,s),_.currentNode=this.el.content,e===2||e===3){let l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(i=_.nextNode())!==null&&a.length0){i.textContent=I?I.emptyScript:"";for(let f=0;f2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=d}_$AI(t,e=this,s,i){let o=this.strings,n=!1;if(o===void 0)t=b(this,t,e,0),n=!N(t)||t!==this._$AH&&t!==v,n&&(this._$AH=t);else{let h=t,a,c;for(t=o[0],a=0;a{let s=e?.renderBefore??t,i=s._$litPart$;if(i===void 0){let o=e?.renderBefore??null;s._$litPart$=i=new R(t.insertBefore(U(),o),o,void 0,e??{})}return i._$AI(r),i};var y=class extends m{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=$t(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return v}};y._$litElement$=!0,y.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:y});var Ht=globalThis.litElementPolyfillSupport;Ht?.({LitElement:y});(globalThis.litElementVersions??=[]).push("4.1.0");var Tt={attribute:!0,type:String,converter:P,reflect:!1,hasChanged:z},kt=(r=Tt,t,e)=>{let{kind:s,metadata:i}=e,o=globalThis.litPropertyMetadata.get(i);if(o===void 0&&globalThis.litPropertyMetadata.set(i,o=new Map),o.set(e.name,r),s==="accessor"){let{name:n}=e;return{set(h){let a=t.get.call(this);t.set.call(this,h),this.requestUpdate(n,a,r)},init(h){return h!==void 0&&this.P(n,void 0,r),h}}}if(s==="setter"){let{name:n}=e;return function(h){let a=this[n];t.call(this,h),this.requestUpdate(n,a,r)}}throw Error("Unsupported decorator location: "+s)};function tt(r){return(t,e)=>typeof e=="object"?kt(r,t,e):((s,i,o)=>{let n=i.hasOwnProperty(o);return i.constructor.createProperty(o,n?{...s,wrapped:!0}:s),n?Object.getOwnPropertyDescriptor(i,o):void 0})(r,t,e)}var _t=w` +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __decorateClass = (decorators, target, key, kind) => { + var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target; + for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--) + if (decorator = decorators[i3]) + result = (kind ? decorator(target, key, result) : decorator(result)) || result; + if (kind && result) __defProp(target, key, result); + return result; +}; + +// node_modules/@lit/reactive-element/css-tag.js +var t = globalThis; +var e = t.ShadowRoot && (void 0 === t.ShadyCSS || t.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype; +var s = Symbol(); +var o = /* @__PURE__ */ new WeakMap(); +var n = class { + constructor(t2, e4, o4) { + if (this._$cssResult$ = true, o4 !== s) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead."); + this.cssText = t2, this.t = e4; + } + get styleSheet() { + let t2 = this.o; + const s2 = this.t; + if (e && void 0 === t2) { + const e4 = void 0 !== s2 && 1 === s2.length; + e4 && (t2 = o.get(s2)), void 0 === t2 && ((this.o = t2 = new CSSStyleSheet()).replaceSync(this.cssText), e4 && o.set(s2, t2)); + } + return t2; + } + toString() { + return this.cssText; + } +}; +var r = (t2) => new n("string" == typeof t2 ? t2 : t2 + "", void 0, s); +var i = (t2, ...e4) => { + const o4 = 1 === t2.length ? t2[0] : e4.reduce((e5, s2, o5) => e5 + ((t3) => { + if (true === t3._$cssResult$) return t3.cssText; + if ("number" == typeof t3) return t3; + throw Error("Value passed to 'css' function must be a 'css' function result: " + t3 + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security."); + })(s2) + t2[o5 + 1], t2[0]); + return new n(o4, t2, s); +}; +var S = (s2, o4) => { + if (e) s2.adoptedStyleSheets = o4.map((t2) => t2 instanceof CSSStyleSheet ? t2 : t2.styleSheet); + else for (const e4 of o4) { + const o5 = document.createElement("style"), n5 = t.litNonce; + void 0 !== n5 && o5.setAttribute("nonce", n5), o5.textContent = e4.cssText, s2.appendChild(o5); + } +}; +var c = e ? (t2) => t2 : (t2) => t2 instanceof CSSStyleSheet ? ((t3) => { + let e4 = ""; + for (const s2 of t3.cssRules) e4 += s2.cssText; + return r(e4); +})(t2) : t2; + +// node_modules/@lit/reactive-element/reactive-element.js +var { is: i2, defineProperty: e2, getOwnPropertyDescriptor: r2, getOwnPropertyNames: h, getOwnPropertySymbols: o2, getPrototypeOf: n2 } = Object; +var a = globalThis; +var c2 = a.trustedTypes; +var l = c2 ? c2.emptyScript : ""; +var p = a.reactiveElementPolyfillSupport; +var d = (t2, s2) => t2; +var u = { toAttribute(t2, s2) { + switch (s2) { + case Boolean: + t2 = t2 ? l : null; + break; + case Object: + case Array: + t2 = null == t2 ? t2 : JSON.stringify(t2); + } + return t2; +}, fromAttribute(t2, s2) { + let i3 = t2; + switch (s2) { + case Boolean: + i3 = null !== t2; + break; + case Number: + i3 = null === t2 ? null : Number(t2); + break; + case Object: + case Array: + try { + i3 = JSON.parse(t2); + } catch (t3) { + i3 = null; + } + } + return i3; +} }; +var f = (t2, s2) => !i2(t2, s2); +var y = { attribute: true, type: String, converter: u, reflect: false, hasChanged: f }; +Symbol.metadata ??= Symbol("metadata"), a.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap(); +var b = class extends HTMLElement { + static addInitializer(t2) { + this._$Ei(), (this.l ??= []).push(t2); + } + static get observedAttributes() { + return this.finalize(), this._$Eh && [...this._$Eh.keys()]; + } + static createProperty(t2, s2 = y) { + if (s2.state && (s2.attribute = false), this._$Ei(), this.elementProperties.set(t2, s2), !s2.noAccessor) { + const i3 = Symbol(), r4 = this.getPropertyDescriptor(t2, i3, s2); + void 0 !== r4 && e2(this.prototype, t2, r4); + } + } + static getPropertyDescriptor(t2, s2, i3) { + const { get: e4, set: h4 } = r2(this.prototype, t2) ?? { get() { + return this[s2]; + }, set(t3) { + this[s2] = t3; + } }; + return { get() { + return e4?.call(this); + }, set(s3) { + const r4 = e4?.call(this); + h4.call(this, s3), this.requestUpdate(t2, r4, i3); + }, configurable: true, enumerable: true }; + } + static getPropertyOptions(t2) { + return this.elementProperties.get(t2) ?? y; + } + static _$Ei() { + if (this.hasOwnProperty(d("elementProperties"))) return; + const t2 = n2(this); + t2.finalize(), void 0 !== t2.l && (this.l = [...t2.l]), this.elementProperties = new Map(t2.elementProperties); + } + static finalize() { + if (this.hasOwnProperty(d("finalized"))) return; + if (this.finalized = true, this._$Ei(), this.hasOwnProperty(d("properties"))) { + const t3 = this.properties, s2 = [...h(t3), ...o2(t3)]; + for (const i3 of s2) this.createProperty(i3, t3[i3]); + } + const t2 = this[Symbol.metadata]; + if (null !== t2) { + const s2 = litPropertyMetadata.get(t2); + if (void 0 !== s2) for (const [t3, i3] of s2) this.elementProperties.set(t3, i3); + } + this._$Eh = /* @__PURE__ */ new Map(); + for (const [t3, s2] of this.elementProperties) { + const i3 = this._$Eu(t3, s2); + void 0 !== i3 && this._$Eh.set(i3, t3); + } + this.elementStyles = this.finalizeStyles(this.styles); + } + static finalizeStyles(s2) { + const i3 = []; + if (Array.isArray(s2)) { + const e4 = new Set(s2.flat(1 / 0).reverse()); + for (const s3 of e4) i3.unshift(c(s3)); + } else void 0 !== s2 && i3.push(c(s2)); + return i3; + } + static _$Eu(t2, s2) { + const i3 = s2.attribute; + return false === i3 ? void 0 : "string" == typeof i3 ? i3 : "string" == typeof t2 ? t2.toLowerCase() : void 0; + } + constructor() { + super(), this._$Ep = void 0, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev(); + } + _$Ev() { + this._$ES = new Promise((t2) => this.enableUpdating = t2), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((t2) => t2(this)); + } + addController(t2) { + (this._$EO ??= /* @__PURE__ */ new Set()).add(t2), void 0 !== this.renderRoot && this.isConnected && t2.hostConnected?.(); + } + removeController(t2) { + this._$EO?.delete(t2); + } + _$E_() { + const t2 = /* @__PURE__ */ new Map(), s2 = this.constructor.elementProperties; + for (const i3 of s2.keys()) this.hasOwnProperty(i3) && (t2.set(i3, this[i3]), delete this[i3]); + t2.size > 0 && (this._$Ep = t2); + } + createRenderRoot() { + const t2 = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions); + return S(t2, this.constructor.elementStyles), t2; + } + connectedCallback() { + this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach((t2) => t2.hostConnected?.()); + } + enableUpdating(t2) { + } + disconnectedCallback() { + this._$EO?.forEach((t2) => t2.hostDisconnected?.()); + } + attributeChangedCallback(t2, s2, i3) { + this._$AK(t2, i3); + } + _$EC(t2, s2) { + const i3 = this.constructor.elementProperties.get(t2), e4 = this.constructor._$Eu(t2, i3); + if (void 0 !== e4 && true === i3.reflect) { + const r4 = (void 0 !== i3.converter?.toAttribute ? i3.converter : u).toAttribute(s2, i3.type); + this._$Em = t2, null == r4 ? this.removeAttribute(e4) : this.setAttribute(e4, r4), this._$Em = null; + } + } + _$AK(t2, s2) { + const i3 = this.constructor, e4 = i3._$Eh.get(t2); + if (void 0 !== e4 && this._$Em !== e4) { + const t3 = i3.getPropertyOptions(e4), r4 = "function" == typeof t3.converter ? { fromAttribute: t3.converter } : void 0 !== t3.converter?.fromAttribute ? t3.converter : u; + this._$Em = e4, this[e4] = r4.fromAttribute(s2, t3.type), this._$Em = null; + } + } + requestUpdate(t2, s2, i3) { + if (void 0 !== t2) { + if (i3 ??= this.constructor.getPropertyOptions(t2), !(i3.hasChanged ?? f)(this[t2], s2)) return; + this.P(t2, s2, i3); + } + false === this.isUpdatePending && (this._$ES = this._$ET()); + } + P(t2, s2, i3) { + this._$AL.has(t2) || this._$AL.set(t2, s2), true === i3.reflect && this._$Em !== t2 && (this._$Ej ??= /* @__PURE__ */ new Set()).add(t2); + } + async _$ET() { + this.isUpdatePending = true; + try { + await this._$ES; + } catch (t3) { + Promise.reject(t3); + } + const t2 = this.scheduleUpdate(); + return null != t2 && await t2, !this.isUpdatePending; + } + scheduleUpdate() { + return this.performUpdate(); + } + performUpdate() { + if (!this.isUpdatePending) return; + if (!this.hasUpdated) { + if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) { + for (const [t4, s3] of this._$Ep) this[t4] = s3; + this._$Ep = void 0; + } + const t3 = this.constructor.elementProperties; + if (t3.size > 0) for (const [s3, i3] of t3) true !== i3.wrapped || this._$AL.has(s3) || void 0 === this[s3] || this.P(s3, this[s3], i3); + } + let t2 = false; + const s2 = this._$AL; + try { + t2 = this.shouldUpdate(s2), t2 ? (this.willUpdate(s2), this._$EO?.forEach((t3) => t3.hostUpdate?.()), this.update(s2)) : this._$EU(); + } catch (s3) { + throw t2 = false, this._$EU(), s3; + } + t2 && this._$AE(s2); + } + willUpdate(t2) { + } + _$AE(t2) { + this._$EO?.forEach((t3) => t3.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t2)), this.updated(t2); + } + _$EU() { + this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = false; + } + get updateComplete() { + return this.getUpdateComplete(); + } + getUpdateComplete() { + return this._$ES; + } + shouldUpdate(t2) { + return true; + } + update(t2) { + this._$Ej &&= this._$Ej.forEach((t3) => this._$EC(t3, this[t3])), this._$EU(); + } + updated(t2) { + } + firstUpdated(t2) { + } +}; +b.elementStyles = [], b.shadowRootOptions = { mode: "open" }, b[d("elementProperties")] = /* @__PURE__ */ new Map(), b[d("finalized")] = /* @__PURE__ */ new Map(), p?.({ ReactiveElement: b }), (a.reactiveElementVersions ??= []).push("2.0.4"); + +// node_modules/lit-html/lit-html.js +var n3 = globalThis; +var c3 = n3.trustedTypes; +var h2 = c3 ? c3.createPolicy("lit-html", { createHTML: (t2) => t2 }) : void 0; +var f2 = "$lit$"; +var v = `lit$${Math.random().toFixed(9).slice(2)}$`; +var m = "?" + v; +var _ = `<${m}>`; +var w = document; +var lt = () => w.createComment(""); +var st = (t2) => null === t2 || "object" != typeof t2 && "function" != typeof t2; +var g = Array.isArray; +var $ = (t2) => g(t2) || "function" == typeof t2?.[Symbol.iterator]; +var x = "[ \n\f\r]"; +var T = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g; +var E = /-->/g; +var k = />/g; +var O = RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`, "g"); +var S2 = /'/g; +var j = /"/g; +var M = /^(?:script|style|textarea|title)$/i; +var P = (t2) => (i3, ...s2) => ({ _$litType$: t2, strings: i3, values: s2 }); +var ke = P(1); +var Oe = P(2); +var Se = P(3); +var R = Symbol.for("lit-noChange"); +var D = Symbol.for("lit-nothing"); +var V = /* @__PURE__ */ new WeakMap(); +var I = w.createTreeWalker(w, 129); +function N(t2, i3) { + if (!g(t2) || !t2.hasOwnProperty("raw")) throw Error("invalid template strings array"); + return void 0 !== h2 ? h2.createHTML(i3) : i3; +} +var U = (t2, i3) => { + const s2 = t2.length - 1, e4 = []; + let h4, o4 = 2 === i3 ? "" : 3 === i3 ? "" : "", n5 = T; + for (let i4 = 0; i4 < s2; i4++) { + const s3 = t2[i4]; + let r4, l2, c4 = -1, a2 = 0; + for (; a2 < s3.length && (n5.lastIndex = a2, l2 = n5.exec(s3), null !== l2); ) a2 = n5.lastIndex, n5 === T ? "!--" === l2[1] ? n5 = E : void 0 !== l2[1] ? n5 = k : void 0 !== l2[2] ? (M.test(l2[2]) && (h4 = RegExp("" === l2[0] ? (n5 = h4 ?? T, c4 = -1) : void 0 === l2[1] ? c4 = -2 : (c4 = n5.lastIndex - l2[2].length, r4 = l2[1], n5 = void 0 === l2[3] ? O : '"' === l2[3] ? j : S2) : n5 === j || n5 === S2 ? n5 = O : n5 === E || n5 === k ? n5 = T : (n5 = O, h4 = void 0); + const u2 = n5 === O && t2[i4 + 1].startsWith("/>") ? " " : ""; + o4 += n5 === T ? s3 + _ : c4 >= 0 ? (e4.push(r4), s3.slice(0, c4) + f2 + s3.slice(c4) + v + u2) : s3 + v + (-2 === c4 ? i4 : u2); + } + return [N(t2, o4 + (t2[s2] || "") + (2 === i3 ? "" : 3 === i3 ? "" : "")), e4]; +}; +var B = class _B { + constructor({ strings: t2, _$litType$: i3 }, s2) { + let e4; + this.parts = []; + let h4 = 0, o4 = 0; + const n5 = t2.length - 1, r4 = this.parts, [l2, a2] = U(t2, i3); + if (this.el = _B.createElement(l2, s2), I.currentNode = this.el.content, 2 === i3 || 3 === i3) { + const t3 = this.el.content.firstChild; + t3.replaceWith(...t3.childNodes); + } + for (; null !== (e4 = I.nextNode()) && r4.length < n5; ) { + if (1 === e4.nodeType) { + if (e4.hasAttributes()) for (const t3 of e4.getAttributeNames()) if (t3.endsWith(f2)) { + const i4 = a2[o4++], s3 = e4.getAttribute(t3).split(v), n6 = /([.?@])?(.*)/.exec(i4); + r4.push({ type: 1, index: h4, name: n6[2], strings: s3, ctor: "." === n6[1] ? Y : "?" === n6[1] ? Z : "@" === n6[1] ? q : G }), e4.removeAttribute(t3); + } else t3.startsWith(v) && (r4.push({ type: 6, index: h4 }), e4.removeAttribute(t3)); + if (M.test(e4.tagName)) { + const t3 = e4.textContent.split(v), i4 = t3.length - 1; + if (i4 > 0) { + e4.textContent = c3 ? c3.emptyScript : ""; + for (let s3 = 0; s3 < i4; s3++) e4.append(t3[s3], lt()), I.nextNode(), r4.push({ type: 2, index: ++h4 }); + e4.append(t3[i4], lt()); + } + } + } else if (8 === e4.nodeType) if (e4.data === m) r4.push({ type: 2, index: h4 }); + else { + let t3 = -1; + for (; -1 !== (t3 = e4.data.indexOf(v, t3 + 1)); ) r4.push({ type: 7, index: h4 }), t3 += v.length - 1; + } + h4++; + } + } + static createElement(t2, i3) { + const s2 = w.createElement("template"); + return s2.innerHTML = t2, s2; + } +}; +function z(t2, i3, s2 = t2, e4) { + if (i3 === R) return i3; + let h4 = void 0 !== e4 ? s2.o?.[e4] : s2.l; + const o4 = st(i3) ? void 0 : i3._$litDirective$; + return h4?.constructor !== o4 && (h4?._$AO?.(false), void 0 === o4 ? h4 = void 0 : (h4 = new o4(t2), h4._$AT(t2, s2, e4)), void 0 !== e4 ? (s2.o ??= [])[e4] = h4 : s2.l = h4), void 0 !== h4 && (i3 = z(t2, h4._$AS(t2, i3.values), h4, e4)), i3; +} +var F = class { + constructor(t2, i3) { + this._$AV = [], this._$AN = void 0, this._$AD = t2, this._$AM = i3; + } + get parentNode() { + return this._$AM.parentNode; + } + get _$AU() { + return this._$AM._$AU; + } + u(t2) { + const { el: { content: i3 }, parts: s2 } = this._$AD, e4 = (t2?.creationScope ?? w).importNode(i3, true); + I.currentNode = e4; + let h4 = I.nextNode(), o4 = 0, n5 = 0, r4 = s2[0]; + for (; void 0 !== r4; ) { + if (o4 === r4.index) { + let i4; + 2 === r4.type ? i4 = new et(h4, h4.nextSibling, this, t2) : 1 === r4.type ? i4 = new r4.ctor(h4, r4.name, r4.strings, this, t2) : 6 === r4.type && (i4 = new K(h4, this, t2)), this._$AV.push(i4), r4 = s2[++n5]; + } + o4 !== r4?.index && (h4 = I.nextNode(), o4++); + } + return I.currentNode = w, e4; + } + p(t2) { + let i3 = 0; + for (const s2 of this._$AV) void 0 !== s2 && (void 0 !== s2.strings ? (s2._$AI(t2, s2, i3), i3 += s2.strings.length - 2) : s2._$AI(t2[i3])), i3++; + } +}; +var et = class _et { + get _$AU() { + return this._$AM?._$AU ?? this.v; + } + constructor(t2, i3, s2, e4) { + this.type = 2, this._$AH = D, this._$AN = void 0, this._$AA = t2, this._$AB = i3, this._$AM = s2, this.options = e4, this.v = e4?.isConnected ?? true; + } + get parentNode() { + let t2 = this._$AA.parentNode; + const i3 = this._$AM; + return void 0 !== i3 && 11 === t2?.nodeType && (t2 = i3.parentNode), t2; + } + get startNode() { + return this._$AA; + } + get endNode() { + return this._$AB; + } + _$AI(t2, i3 = this) { + t2 = z(this, t2, i3), st(t2) ? t2 === D || null == t2 || "" === t2 ? (this._$AH !== D && this._$AR(), this._$AH = D) : t2 !== this._$AH && t2 !== R && this._(t2) : void 0 !== t2._$litType$ ? this.$(t2) : void 0 !== t2.nodeType ? this.T(t2) : $(t2) ? this.k(t2) : this._(t2); + } + O(t2) { + return this._$AA.parentNode.insertBefore(t2, this._$AB); + } + T(t2) { + this._$AH !== t2 && (this._$AR(), this._$AH = this.O(t2)); + } + _(t2) { + this._$AH !== D && st(this._$AH) ? this._$AA.nextSibling.data = t2 : this.T(w.createTextNode(t2)), this._$AH = t2; + } + $(t2) { + const { values: i3, _$litType$: s2 } = t2, e4 = "number" == typeof s2 ? this._$AC(t2) : (void 0 === s2.el && (s2.el = B.createElement(N(s2.h, s2.h[0]), this.options)), s2); + if (this._$AH?._$AD === e4) this._$AH.p(i3); + else { + const t3 = new F(e4, this), s3 = t3.u(this.options); + t3.p(i3), this.T(s3), this._$AH = t3; + } + } + _$AC(t2) { + let i3 = V.get(t2.strings); + return void 0 === i3 && V.set(t2.strings, i3 = new B(t2)), i3; + } + k(t2) { + g(this._$AH) || (this._$AH = [], this._$AR()); + const i3 = this._$AH; + let s2, e4 = 0; + for (const h4 of t2) e4 === i3.length ? i3.push(s2 = new _et(this.O(lt()), this.O(lt()), this, this.options)) : s2 = i3[e4], s2._$AI(h4), e4++; + e4 < i3.length && (this._$AR(s2 && s2._$AB.nextSibling, e4), i3.length = e4); + } + _$AR(t2 = this._$AA.nextSibling, i3) { + for (this._$AP?.(false, true, i3); t2 && t2 !== this._$AB; ) { + const i4 = t2.nextSibling; + t2.remove(), t2 = i4; + } + } + setConnected(t2) { + void 0 === this._$AM && (this.v = t2, this._$AP?.(t2)); + } +}; +var G = class { + get tagName() { + return this.element.tagName; + } + get _$AU() { + return this._$AM._$AU; + } + constructor(t2, i3, s2, e4, h4) { + this.type = 1, this._$AH = D, this._$AN = void 0, this.element = t2, this.name = i3, this._$AM = e4, this.options = h4, s2.length > 2 || "" !== s2[0] || "" !== s2[1] ? (this._$AH = Array(s2.length - 1).fill(new String()), this.strings = s2) : this._$AH = D; + } + _$AI(t2, i3 = this, s2, e4) { + const h4 = this.strings; + let o4 = false; + if (void 0 === h4) t2 = z(this, t2, i3, 0), o4 = !st(t2) || t2 !== this._$AH && t2 !== R, o4 && (this._$AH = t2); + else { + const e5 = t2; + let n5, r4; + for (t2 = h4[0], n5 = 0; n5 < h4.length - 1; n5++) r4 = z(this, e5[s2 + n5], i3, n5), r4 === R && (r4 = this._$AH[n5]), o4 ||= !st(r4) || r4 !== this._$AH[n5], r4 === D ? t2 = D : t2 !== D && (t2 += (r4 ?? "") + h4[n5 + 1]), this._$AH[n5] = r4; + } + o4 && !e4 && this.j(t2); + } + j(t2) { + t2 === D ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t2 ?? ""); + } +}; +var Y = class extends G { + constructor() { + super(...arguments), this.type = 3; + } + j(t2) { + this.element[this.name] = t2 === D ? void 0 : t2; + } +}; +var Z = class extends G { + constructor() { + super(...arguments), this.type = 4; + } + j(t2) { + this.element.toggleAttribute(this.name, !!t2 && t2 !== D); + } +}; +var q = class extends G { + constructor(t2, i3, s2, e4, h4) { + super(t2, i3, s2, e4, h4), this.type = 5; + } + _$AI(t2, i3 = this) { + if ((t2 = z(this, t2, i3, 0) ?? D) === R) return; + const s2 = this._$AH, e4 = t2 === D && s2 !== D || t2.capture !== s2.capture || t2.once !== s2.once || t2.passive !== s2.passive, h4 = t2 !== D && (s2 === D || e4); + e4 && this.element.removeEventListener(this.name, this, s2), h4 && this.element.addEventListener(this.name, this, t2), this._$AH = t2; + } + handleEvent(t2) { + "function" == typeof this._$AH ? this._$AH.call(this.options?.host ?? this.element, t2) : this._$AH.handleEvent(t2); + } +}; +var K = class { + constructor(t2, i3, s2) { + this.element = t2, this.type = 6, this._$AN = void 0, this._$AM = i3, this.options = s2; + } + get _$AU() { + return this._$AM._$AU; + } + _$AI(t2) { + z(this, t2); + } +}; +var Re = n3.litHtmlPolyfillSupport; +Re?.(B, et), (n3.litHtmlVersions ??= []).push("3.2.0"); +var Q = (t2, i3, s2) => { + const e4 = s2?.renderBefore ?? i3; + let h4 = e4._$litPart$; + if (void 0 === h4) { + const t3 = s2?.renderBefore ?? null; + e4._$litPart$ = h4 = new et(i3.insertBefore(lt(), t3), t3, void 0, s2 ?? {}); + } + return h4._$AI(t2), h4; +}; + +// node_modules/lit-element/lit-element.js +var h3 = class extends b { + constructor() { + super(...arguments), this.renderOptions = { host: this }, this.o = void 0; + } + createRenderRoot() { + const t2 = super.createRenderRoot(); + return this.renderOptions.renderBefore ??= t2.firstChild, t2; + } + update(t2) { + const e4 = this.render(); + this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t2), this.o = Q(e4, this.renderRoot, this.renderOptions); + } + connectedCallback() { + super.connectedCallback(), this.o?.setConnected(true); + } + disconnectedCallback() { + super.disconnectedCallback(), this.o?.setConnected(false); + } + render() { + return R; + } +}; +h3._$litElement$ = true, h3["finalized"] = true, globalThis.litElementHydrateSupport?.({ LitElement: h3 }); +var f3 = globalThis.litElementPolyfillSupport; +f3?.({ LitElement: h3 }); +(globalThis.litElementVersions ??= []).push("4.1.0"); + +// node_modules/@lit/reactive-element/decorators/property.js +var o3 = { attribute: true, type: String, converter: u, reflect: false, hasChanged: f }; +var r3 = (t2 = o3, e4, r4) => { + const { kind: n5, metadata: i3 } = r4; + let s2 = globalThis.litPropertyMetadata.get(i3); + if (void 0 === s2 && globalThis.litPropertyMetadata.set(i3, s2 = /* @__PURE__ */ new Map()), s2.set(r4.name, t2), "accessor" === n5) { + const { name: o4 } = r4; + return { set(r5) { + const n6 = e4.get.call(this); + e4.set.call(this, r5), this.requestUpdate(o4, n6, t2); + }, init(e5) { + return void 0 !== e5 && this.P(o4, void 0, t2), e5; + } }; + } + if ("setter" === n5) { + const { name: o4 } = r4; + return function(r5) { + const n6 = this[o4]; + e4.call(this, r5), this.requestUpdate(o4, n6, t2); + }; + } + throw Error("Unsupported decorator location: " + n5); +}; +function n4(t2) { + return (e4, o4) => "object" == typeof o4 ? r3(t2, e4, o4) : ((t3, e5, o5) => { + const r4 = e5.hasOwnProperty(o5); + return e5.constructor.createProperty(o5, r4 ? { ...t3, wrapped: true } : t3), r4 ? Object.getOwnPropertyDescriptor(e5, o5) : void 0; + })(t2, e4, o4); +} + +// js/ipywidgets_styles.ts +var legacyStyles = i` .legacy-button { align-items: center; background-color: var(--jp-layout-color2); @@ -53,7 +637,40 @@ var At=Object.defineProperty;var vt=Object.getOwnPropertyDescriptor;var st=(r,t, height: var(--jp-widgets-inline-height); line-height: var(--jp-widgets-inline-height); } -`;async function jt(r,t){return Promise.all(r.map(e=>t.get_model(e.slice(10))))}async function et(r,t){let e=t.get("children"),s=await jt(e,t.widget_manager),i=await Promise.all(s.map(o=>o.widget_manager.create_view(o)));r.innerHTML="";for(let o of i)r.appendChild(o.el)}var D=class D extends y{constructor(){super(...arguments);this._model=void 0;this.visible=!1}static get componentName(){return"layer-manager"}static{this.styles=[_t,w` +`; + +// js/utils.ts +async function unpackModels(modelIds, manager) { + return Promise.all( + modelIds.map((id) => manager.get_model(id.slice("IPY_MODEL_".length))) + ); +} +async function updateChildren(container, model) { + const children = model.get("children"); + const child_models = await unpackModels(children, model.widget_manager); + const child_views = await Promise.all( + child_models.map((model2) => model2.widget_manager.create_view(model2)) + ); + container.innerHTML = ``; + for (const child_view of child_views) { + container.appendChild(child_view.el); + } +} + +// js/layer_manager.ts +var _LayerManager = class _LayerManager extends h3 { + constructor() { + super(...arguments); + this._model = void 0; + this.visible = false; + } + static get componentName() { + return `layer-manager`; + } + static { + this.styles = [ + legacyStyles, + i` .container { padding: 0 4px 2px 4px; } @@ -68,7 +685,28 @@ var At=Object.defineProperty;var vt=Object.getOwnPropertyDescriptor;var st=(r,t, .visibility-checkbox { margin: 2px; } - `]}static{this.modelNameToViewName=new Map([["children",null],["visible","visible"]])}set model(e){this._model=e;for(let[s,i]of D.modelNameToViewName)i&&(this[i]=e.get(s),e.on(`change:${s}`,()=>{this[i]=e.get(s)}))}render(){return gt` + ` + ]; + } + static { + this.modelNameToViewName = /* @__PURE__ */ new Map([ + ["children", null], + ["visible", "visible"] + ]); + } + set model(model) { + this._model = model; + for (const [modelKey, widgetKey] of _LayerManager.modelNameToViewName) { + if (widgetKey) { + this[widgetKey] = model.get(modelKey); + model.on(`change:${modelKey}`, () => { + this[widgetKey] = model.get(modelKey); + }); + } + } + } + render() { + return ke`
- `}updated(e){for(let[s,i]of e)this._model?.set(s,this[s]);this._model?.save_changes()}onLayerVisibilityChanged(e){let s=e.target;this.visible=s.checked}};st([tt()],D.prototype,"visible",2);var E=D;customElements.get(E.componentName)||customElements.define(E.componentName,E);async function Lt({model:r,el:t}){let e=document.createElement(E.componentName);e.model=r,t.appendChild(e),et(e,r),r.on("change:children",()=>{et(e,r)})}var qe={render:Lt};export{E as LayerManager,qe as default}; + `; + } + updated(changedProperties) { + for (const [property, _2] of changedProperties) { + this._model?.set(property, this[property]); + } + this._model?.save_changes(); + } + onLayerVisibilityChanged(event) { + const target = event.target; + this.visible = target.checked; + } +}; +__decorateClass([ + n4() +], _LayerManager.prototype, "visible", 2); +var LayerManager = _LayerManager; +if (!customElements.get(LayerManager.componentName)) { + customElements.define(LayerManager.componentName, LayerManager); +} +async function render({ model, el }) { + const manager = document.createElement(LayerManager.componentName); + manager.model = model; + el.appendChild(manager); + updateChildren(manager, model); + model.on("change:children", () => { + updateChildren(manager, model); + }); +} +var layer_manager_default = { render }; +export { + LayerManager, + layer_manager_default as default +}; /*! Bundled license information: @lit/reactive-element/css-tag.js: @@ -189,3 +860,4 @@ lit-html/is-server.js: * SPDX-License-Identifier: BSD-3-Clause *) */ +//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vbm9kZV9tb2R1bGVzL0BsaXQvcmVhY3RpdmUtZWxlbWVudC9zcmMvY3NzLXRhZy50cyIsICIuLi8uLi9ub2RlX21vZHVsZXMvQGxpdC9yZWFjdGl2ZS1lbGVtZW50L3NyYy9yZWFjdGl2ZS1lbGVtZW50LnRzIiwgIi4uLy4uL25vZGVfbW9kdWxlcy9saXQtaHRtbC9zcmMvbGl0LWh0bWwudHMiLCAiLi4vLi4vbm9kZV9tb2R1bGVzL2xpdC1lbGVtZW50L3NyYy9saXQtZWxlbWVudC50cyIsICIuLi8uLi9ub2RlX21vZHVsZXMvQGxpdC9yZWFjdGl2ZS1lbGVtZW50L3NyYy9kZWNvcmF0b3JzL3Byb3BlcnR5LnRzIiwgIi4uLy4uL2pzL2lweXdpZGdldHNfc3R5bGVzLnRzIiwgIi4uLy4uL2pzL3V0aWxzLnRzIiwgIi4uLy4uL2pzL2xheWVyX21hbmFnZXIudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbIi8qKlxuICogQGxpY2Vuc2VcbiAqIENvcHlyaWdodCAyMDE5IEdvb2dsZSBMTENcbiAqIFNQRFgtTGljZW5zZS1JZGVudGlmaWVyOiBCU0QtMy1DbGF1c2VcbiAqL1xuXG5jb25zd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ZmZpeCkpIHtcbiAgICAgICAgICAgICAgY29uc3QgcmVhbE5hbWUgPSBhdHRyTmFtZXNbYXR0ck5hbWVJbmRleCsrXTtcbiAgICAgICAgICAgICAgY29uc3QgdmFsdWUgPSAobm9kZSBhcyBFbGVtZW50KS5nZXRBdHRyaWJ1dGUobmFtZSkhO1xuICAgICAgICAgICAgICBjb25zdCBzdGF0aWNzID0gdmFsdWUuc3BsaXQobWFya2VyKTtcbiAgICAgICAgICAgICAgY29uc3QgbSA9IC8oWy4/QF0pPyguKikvLmV4ZWMocmVhbE5hbWUpITtcbiAgICAgICAgICAgICAgcGFydHMucHVzaCh7XG4gICAgICAgICAgICAgICAgdHlwZTogQVRUUklCVVRFX1BBUlQsXG4gICAgICAgICAgICAgICAgaW5kZXg6IG5vZGVJbmRleCxcbiAgICAgICAgICAgICAgICBuYW1lOiBtWzJdLFxuICAgICAgICAgICAgICAgIHN0cmluZ3M6IHN0YXRpY3MsXG4gICAgICAgICAgICAgICAgY3RvcjpcbiAgICAgICAgICAgICAgICAgIG1bMV0gPT09ICcuJ1xuICAgICAgICAgICAgICAgICAgICA/IFByb3BlcnR5UGFydFxuICAgICAgICAgICAgICAgICAgICA6IG1bMV0gPT09ICc/J1xuICAgICAgICAgICAgICAgICAgICAgID8gQm9vbGVhbkF0dHJpYnV0ZVBhcnRcbiAgICAgICAgICAgICAgICAgICAgICA6IG1bMV0gPT09ICdAJ1xuICAgICAgICAgICAgICAgICAgICAgICAgPyBFdmVudFBhcnRcbiAgICAgICAgICAgICAgICAgICAgICAgIDogQXR0cmlidXRlUGFydCxcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgIChub2RlIGFzIEVsZW1lbnQpLnJlbW92ZUF0dHJpYnV0ZShuYW1lKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobmFtZS5zdGFydHNXaXRoKG1hcmtlcikpIHtcbiAgICAgICAgICAgICAgcGFydHMucHVzaCh7XG4gICAgICAgICAgICAgICAgdHlwZ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V5XSA9IG1vZGVsLmdldChtb2RlbEtleSk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBAcHJvcGVydHkoKVxuICAgIHZpc2libGU6IGJvb2xlYW4gPSBmYWxzZTtcblxuICAgIHJlbmRlcigpIHtcbiAgICAgICAgcmV0dXJuIGh0bWxgXG4gICAgICAgICAgICA8ZGl2IGNsYXNzPVwiY29udGFpbmVyXCI+XG4gICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInJvd1wiPlxuICAgICAgICAgICAgICAgICAgICA8aW5wdXRcbiAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU9XCJjaGVja2JveFwiXG4gICAgICAgICAgICAgICAgICAgICAgICBjbGFzcz1cInZpc2liaWxpdHktY2hlY2tib3hcIlxuICAgICAgICAgICAgICAgICAgICAgICAgLmNoZWNrZWQ9XCIke3RoaXMudmlzaWJsZX1cIlxuICAgICAgICAgICAgICAgICAgICAgICAgQGNoYW5nZT1cIiR7dGhpcy5vbkxheWVyVmlzaWJpbGl0eUNoYW5nZWR9XCJcbiAgICAgICAgICAgICAgICAgICAgLz5cbiAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJsZWdhY3ktdGV4dCBhbGwtbGF5ZXJzLXRleHRcIj5BbGwgbGF5ZXJzIG9uL29mZjwvc3Bhbj5cbiAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgICA8c2xvdD48L3Nsb3Q+XG4gICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgYDtcbiAgICB9XG5cbiAgICB1cGRhdGVkKGNoYW5nZWRQcm9wZXJ0aWVzOiBhbnkpIHtcbiAgICAgICAgLy8gVXBkYXRlIHRoZSBtb2RlbCBwcm9wZXJ0aWVzIHNvIHRoZXkncmUgcmVmbGVjdGVkIGluIFB5dGhvbi5cbiAgICAgICAgZm9yIChjb25zdCBbcHJvcGVydHksIF9dIG9mIG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GlzY29ubmVjdGVkQ2FsbGJhY2siLCAibm9DaGFuZ2UiLCAiZ2xvYmFsVGhpcyIsICJsaXRFbGVtZW50SHlkcmF0ZVN1cHBvcnQiLCAicG9seWZpbGxTdXBwb3J0IiwgImxpdEVsZW1lbnRQb2x5ZmlsbFN1cHBvcnQiLCAiZ2xvYmFsVGhpcyIsICJsaXRFbGVtZW50VmVyc2lvbnMiLCAicHVzaCIsICJkZWZhdWx0UHJvcGVydHlEZWNsYXJhdGlvbiIsICJhdHRyaWJ1dGUiLCAidHlwZSIsICJTdHJpbmciLCAiY29udmVydGVyIiwgImRlZmF1bHRDb252ZXJ0ZXIiLCAicmVmbGVjdCIsICJoYXNDaGFuZ2VkIiwgIm5vdEVxdWFsIiwgInN0YW5kYXJkUHJvcGVydHkiLCAib3B0aW9ucyIsICJ0YXJnZXQiLCAiY29udGV4dCIsICJraW5kIiwgIm1ldGFkYXRhIiwgInByb3BlcnRpZXMiLCAiZ2xvYmFsVGhpcyIsICJsaXRQcm9wZXJ0eU1ldGFkYXRhIiwgImdldCIsICJzZXQiLCAiTWFwIiwgIm5hbWUiLCAidiIsICJvbGRWYWx1ZSIsICJjYWxsIiwgInRoaXMiLCAicmVxdWVzdFVwZGF0ZSIsICJfJGNoYW5nZVByb3BlcnR5IiwgInZhbHVlIiwgIkVycm9yIiwgInByb3BlcnR5IiwgInByb3RvT3JUYXJnZXQiLCAibmFtZU9yQ29udGV4dCIsICJwcm90byIsICJoYXNPd25Qcm9wZXJ0eSIsICJjb25zdHJ1Y3RvciIsICJjcmVhdGVQcm9wZXJ0eSIsICJ3cmFwcGVkIiwgIk9iamVjdCIsICJnZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3IiLCAibW9kZWwiLCAiaCIsICJfIiwgIm4iXQp9Cg== diff --git a/geemap/static/layer_manager_row.css b/geemap/static/layer_manager_row.css index 04ef49523b..153c430c38 100644 --- a/geemap/static/layer_manager_row.css +++ b/geemap/static/layer_manager_row.css @@ -1 +1,4 @@ -@import"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined"; +@import "https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined"; + +/* js/common.css */ +/*# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFtdLAogICJzb3VyY2VzQ29udGVudCI6IFtdLAogICJtYXBwaW5ncyI6ICIiLAogICJuYW1lcyI6IFtdCn0K */ diff --git a/geemap/static/layer_manager_row.js b/geemap/static/layer_manager_row.js index 118f9692ca..60c628695c 100644 --- a/geemap/static/layer_manager_row.js +++ b/geemap/static/layer_manager_row.js @@ -1,6 +1,590 @@ -var _t=Object.defineProperty;var bt=Object.getOwnPropertyDescriptor;var w=(o,t,e,s)=>{for(var i=s>1?void 0:s?bt(t,e):t,n=o.length-1,r;n>=0;n--)(r=o[n])&&(i=(s?r(t,e,i):r(i))||i);return s&&i&&_t(t,e,i),i};var L=globalThis,z=L.ShadowRoot&&(L.ShadyCSS===void 0||L.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,W=Symbol(),it=new WeakMap,k=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==W)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(z&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=it.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&it.set(e,t))}return t}toString(){return this.cssText}},ot=o=>new k(typeof o=="string"?o:o+"",void 0,W),v=(o,...t)=>{let e=o.length===1?o[0]:t.reduce((s,i,n)=>s+(r=>{if(r._$cssResult$===!0)return r.cssText;if(typeof r=="number")return r;throw Error("Value passed to 'css' function must be a 'css' function result: "+r+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+o[n+1],o[0]);return new k(e,o,W)},J=(o,t)=>{if(z)o.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=L.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,o.appendChild(s)}},D=z?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return ot(e)})(o):o;var{is:At,defineProperty:xt,getOwnPropertyDescriptor:St,getOwnPropertyNames:wt,getOwnPropertySymbols:Et,getPrototypeOf:Ct}=Object,I=globalThis,nt=I.trustedTypes,Pt=nt?nt.emptyScript:"",kt=I.reactiveElementPolyfillSupport,R=(o,t)=>o,U={toAttribute(o,t){switch(t){case Boolean:o=o?Pt:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},V=(o,t)=>!At(o,t),rt={attribute:!0,type:String,converter:U,reflect:!1,hasChanged:V};Symbol.metadata??=Symbol("metadata"),I.litPropertyMetadata??=new WeakMap;var m=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=rt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&xt(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:n}=St(this.prototype,t)??{get(){return this[e]},set(r){this[e]=r}};return{get(){return i?.call(this)},set(r){let h=i?.call(this);n.call(this,r),this.requestUpdate(t,h,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??rt}static _$Ei(){if(this.hasOwnProperty(R("elementProperties")))return;let t=Ct(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(R("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(R("properties"))){let e=this.properties,s=[...wt(e),...Et(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(D(i))}else t!==void 0&&e.push(D(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return J(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let n=(s.converter?.toAttribute!==void 0?s.converter:U).toAttribute(e,s.type);this._$Em=t,n==null?this.removeAttribute(i):this.setAttribute(i,n),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let n=s.getPropertyOptions(i),r=typeof n.converter=="function"?{fromAttribute:n.converter}:n.converter?.fromAttribute!==void 0?n.converter:U;this._$Em=i,this[i]=r.fromAttribute(e,n.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??V)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,n]of this._$Ep)this[i]=n;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,n]of s)n.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],n)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};m.elementStyles=[],m.shadowRootOptions={mode:"open"},m[R("elementProperties")]=new Map,m[R("finalized")]=new Map,kt?.({ReactiveElement:m}),(I.reactiveElementVersions??=[]).push("2.0.4");var G=globalThis,q=G.trustedTypes,at=q?q.createPolicy("lit-html",{createHTML:o=>o}):void 0,ut="$lit$",g=`lit$${Math.random().toFixed(9).slice(2)}$`,mt="?"+g,Rt=`<${mt}>`,A=document,O=()=>A.createComment(""),N=o=>o===null||typeof o!="object"&&typeof o!="function",tt=Array.isArray,Ut=o=>tt(o)||typeof o?.[Symbol.iterator]=="function",K=`[ -\f\r]`,M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,lt=/-->/g,ht=/>/g,_=RegExp(`>|${K}(?:([^\\s"'>=/]+)(${K}*=${K}*(?:[^ -\f\r"'\`<>=]|("|')|))|$)`,"g"),ct=/'/g,dt=/"/g,ft=/^(?:script|style|textarea|title)$/i,et=o=>(t,...e)=>({_$litType$:o,strings:t,values:e}),st=et(1),qt=et(2),Bt=et(3),x=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),pt=new WeakMap,b=A.createTreeWalker(A,129);function gt(o,t){if(!tt(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return at!==void 0?at.createHTML(t):t}var Mt=(o,t)=>{let e=o.length-1,s=[],i,n=t===2?"":t===3?"":"",r=M;for(let h=0;h"?(r=i??M,l=-1):p[1]===void 0?l=-2:(l=r.lastIndex-p[2].length,d=p[1],r=p[3]===void 0?_:p[3]==='"'?dt:ct):r===dt||r===ct?r=_:r===lt||r===ht?r=M:(r=_,i=void 0);let f=r===_&&o[h+1].startsWith("/>")?" ":"";n+=r===M?a+Rt:l>=0?(s.push(d),a.slice(0,l)+ut+a.slice(l)+g+f):a+g+(l===-2?h:f)}return[gt(o,n+(o[e]||"")+(t===2?"":t===3?"":"")),s]},H=class o{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let n=0,r=0,h=t.length-1,a=this.parts,[d,p]=Mt(t,e);if(this.el=o.createElement(d,s),b.currentNode=this.el.content,e===2||e===3){let l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(i=b.nextNode())!==null&&a.length0){i.textContent=q?q.emptyScript:"";for(let f=0;f2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=c}_$AI(t,e=this,s,i){let n=this.strings,r=!1;if(n===void 0)t=E(this,t,e,0),r=!N(t)||t!==this._$AH&&t!==x,r&&(this._$AH=t);else{let h=t,a,d;for(t=n[0],a=0;a{let s=e?.renderBefore??t,i=s._$litPart$;if(i===void 0){let n=e?.renderBefore??null;s._$litPart$=i=new T(t.insertBefore(O(),n),n,void 0,e??{})}return i._$AI(o),i};var y=class extends m{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=yt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return x}};y._$litElement$=!0,y.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:y});var Nt=globalThis.litElementPolyfillSupport;Nt?.({LitElement:y});(globalThis.litElementVersions??=[]).push("4.1.0");var Ht={attribute:!0,type:String,converter:U,reflect:!1,hasChanged:V},Tt=(o=Ht,t,e)=>{let{kind:s,metadata:i}=e,n=globalThis.litPropertyMetadata.get(i);if(n===void 0&&globalThis.litPropertyMetadata.set(i,n=new Map),n.set(e.name,o),s==="accessor"){let{name:r}=e;return{set(h){let a=t.get.call(this);t.set.call(this,h),this.requestUpdate(r,a,o)},init(h){return h!==void 0&&this.P(r,void 0,o),h}}}if(s==="setter"){let{name:r}=e;return function(h){let a=this[r];t.call(this,h),this.requestUpdate(r,a,o)}}throw Error("Unsupported decorator location: "+s)};function S(o){return(t,e)=>typeof e=="object"?Tt(o,t,e):((s,i,n)=>{let r=i.hasOwnProperty(n);return i.constructor.createProperty(n,r?{...s,wrapped:!0}:s),r?Object.getOwnPropertyDescriptor(i,n):void 0})(o,t,e)}var $t=v` +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __decorateClass = (decorators, target, key, kind) => { + var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target; + for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--) + if (decorator = decorators[i3]) + result = (kind ? decorator(target, key, result) : decorator(result)) || result; + if (kind && result) __defProp(target, key, result); + return result; +}; + +// node_modules/@lit/reactive-element/css-tag.js +var t = globalThis; +var e = t.ShadowRoot && (void 0 === t.ShadyCSS || t.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype; +var s = Symbol(); +var o = /* @__PURE__ */ new WeakMap(); +var n = class { + constructor(t2, e4, o4) { + if (this._$cssResult$ = true, o4 !== s) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead."); + this.cssText = t2, this.t = e4; + } + get styleSheet() { + let t2 = this.o; + const s2 = this.t; + if (e && void 0 === t2) { + const e4 = void 0 !== s2 && 1 === s2.length; + e4 && (t2 = o.get(s2)), void 0 === t2 && ((this.o = t2 = new CSSStyleSheet()).replaceSync(this.cssText), e4 && o.set(s2, t2)); + } + return t2; + } + toString() { + return this.cssText; + } +}; +var r = (t2) => new n("string" == typeof t2 ? t2 : t2 + "", void 0, s); +var i = (t2, ...e4) => { + const o4 = 1 === t2.length ? t2[0] : e4.reduce((e5, s2, o5) => e5 + ((t3) => { + if (true === t3._$cssResult$) return t3.cssText; + if ("number" == typeof t3) return t3; + throw Error("Value passed to 'css' function must be a 'css' function result: " + t3 + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security."); + })(s2) + t2[o5 + 1], t2[0]); + return new n(o4, t2, s); +}; +var S = (s2, o4) => { + if (e) s2.adoptedStyleSheets = o4.map((t2) => t2 instanceof CSSStyleSheet ? t2 : t2.styleSheet); + else for (const e4 of o4) { + const o5 = document.createElement("style"), n5 = t.litNonce; + void 0 !== n5 && o5.setAttribute("nonce", n5), o5.textContent = e4.cssText, s2.appendChild(o5); + } +}; +var c = e ? (t2) => t2 : (t2) => t2 instanceof CSSStyleSheet ? ((t3) => { + let e4 = ""; + for (const s2 of t3.cssRules) e4 += s2.cssText; + return r(e4); +})(t2) : t2; + +// node_modules/@lit/reactive-element/reactive-element.js +var { is: i2, defineProperty: e2, getOwnPropertyDescriptor: r2, getOwnPropertyNames: h, getOwnPropertySymbols: o2, getPrototypeOf: n2 } = Object; +var a = globalThis; +var c2 = a.trustedTypes; +var l = c2 ? c2.emptyScript : ""; +var p = a.reactiveElementPolyfillSupport; +var d = (t2, s2) => t2; +var u = { toAttribute(t2, s2) { + switch (s2) { + case Boolean: + t2 = t2 ? l : null; + break; + case Object: + case Array: + t2 = null == t2 ? t2 : JSON.stringify(t2); + } + return t2; +}, fromAttribute(t2, s2) { + let i3 = t2; + switch (s2) { + case Boolean: + i3 = null !== t2; + break; + case Number: + i3 = null === t2 ? null : Number(t2); + break; + case Object: + case Array: + try { + i3 = JSON.parse(t2); + } catch (t3) { + i3 = null; + } + } + return i3; +} }; +var f = (t2, s2) => !i2(t2, s2); +var y = { attribute: true, type: String, converter: u, reflect: false, hasChanged: f }; +Symbol.metadata ??= Symbol("metadata"), a.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap(); +var b = class extends HTMLElement { + static addInitializer(t2) { + this._$Ei(), (this.l ??= []).push(t2); + } + static get observedAttributes() { + return this.finalize(), this._$Eh && [...this._$Eh.keys()]; + } + static createProperty(t2, s2 = y) { + if (s2.state && (s2.attribute = false), this._$Ei(), this.elementProperties.set(t2, s2), !s2.noAccessor) { + const i3 = Symbol(), r4 = this.getPropertyDescriptor(t2, i3, s2); + void 0 !== r4 && e2(this.prototype, t2, r4); + } + } + static getPropertyDescriptor(t2, s2, i3) { + const { get: e4, set: h4 } = r2(this.prototype, t2) ?? { get() { + return this[s2]; + }, set(t3) { + this[s2] = t3; + } }; + return { get() { + return e4?.call(this); + }, set(s3) { + const r4 = e4?.call(this); + h4.call(this, s3), this.requestUpdate(t2, r4, i3); + }, configurable: true, enumerable: true }; + } + static getPropertyOptions(t2) { + return this.elementProperties.get(t2) ?? y; + } + static _$Ei() { + if (this.hasOwnProperty(d("elementProperties"))) return; + const t2 = n2(this); + t2.finalize(), void 0 !== t2.l && (this.l = [...t2.l]), this.elementProperties = new Map(t2.elementProperties); + } + static finalize() { + if (this.hasOwnProperty(d("finalized"))) return; + if (this.finalized = true, this._$Ei(), this.hasOwnProperty(d("properties"))) { + const t3 = this.properties, s2 = [...h(t3), ...o2(t3)]; + for (const i3 of s2) this.createProperty(i3, t3[i3]); + } + const t2 = this[Symbol.metadata]; + if (null !== t2) { + const s2 = litPropertyMetadata.get(t2); + if (void 0 !== s2) for (const [t3, i3] of s2) this.elementProperties.set(t3, i3); + } + this._$Eh = /* @__PURE__ */ new Map(); + for (const [t3, s2] of this.elementProperties) { + const i3 = this._$Eu(t3, s2); + void 0 !== i3 && this._$Eh.set(i3, t3); + } + this.elementStyles = this.finalizeStyles(this.styles); + } + static finalizeStyles(s2) { + const i3 = []; + if (Array.isArray(s2)) { + const e4 = new Set(s2.flat(1 / 0).reverse()); + for (const s3 of e4) i3.unshift(c(s3)); + } else void 0 !== s2 && i3.push(c(s2)); + return i3; + } + static _$Eu(t2, s2) { + const i3 = s2.attribute; + return false === i3 ? void 0 : "string" == typeof i3 ? i3 : "string" == typeof t2 ? t2.toLowerCase() : void 0; + } + constructor() { + super(), this._$Ep = void 0, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev(); + } + _$Ev() { + this._$ES = new Promise((t2) => this.enableUpdating = t2), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((t2) => t2(this)); + } + addController(t2) { + (this._$EO ??= /* @__PURE__ */ new Set()).add(t2), void 0 !== this.renderRoot && this.isConnected && t2.hostConnected?.(); + } + removeController(t2) { + this._$EO?.delete(t2); + } + _$E_() { + const t2 = /* @__PURE__ */ new Map(), s2 = this.constructor.elementProperties; + for (const i3 of s2.keys()) this.hasOwnProperty(i3) && (t2.set(i3, this[i3]), delete this[i3]); + t2.size > 0 && (this._$Ep = t2); + } + createRenderRoot() { + const t2 = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions); + return S(t2, this.constructor.elementStyles), t2; + } + connectedCallback() { + this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach((t2) => t2.hostConnected?.()); + } + enableUpdating(t2) { + } + disconnectedCallback() { + this._$EO?.forEach((t2) => t2.hostDisconnected?.()); + } + attributeChangedCallback(t2, s2, i3) { + this._$AK(t2, i3); + } + _$EC(t2, s2) { + const i3 = this.constructor.elementProperties.get(t2), e4 = this.constructor._$Eu(t2, i3); + if (void 0 !== e4 && true === i3.reflect) { + const r4 = (void 0 !== i3.converter?.toAttribute ? i3.converter : u).toAttribute(s2, i3.type); + this._$Em = t2, null == r4 ? this.removeAttribute(e4) : this.setAttribute(e4, r4), this._$Em = null; + } + } + _$AK(t2, s2) { + const i3 = this.constructor, e4 = i3._$Eh.get(t2); + if (void 0 !== e4 && this._$Em !== e4) { + const t3 = i3.getPropertyOptions(e4), r4 = "function" == typeof t3.converter ? { fromAttribute: t3.converter } : void 0 !== t3.converter?.fromAttribute ? t3.converter : u; + this._$Em = e4, this[e4] = r4.fromAttribute(s2, t3.type), this._$Em = null; + } + } + requestUpdate(t2, s2, i3) { + if (void 0 !== t2) { + if (i3 ??= this.constructor.getPropertyOptions(t2), !(i3.hasChanged ?? f)(this[t2], s2)) return; + this.P(t2, s2, i3); + } + false === this.isUpdatePending && (this._$ES = this._$ET()); + } + P(t2, s2, i3) { + this._$AL.has(t2) || this._$AL.set(t2, s2), true === i3.reflect && this._$Em !== t2 && (this._$Ej ??= /* @__PURE__ */ new Set()).add(t2); + } + async _$ET() { + this.isUpdatePending = true; + try { + await this._$ES; + } catch (t3) { + Promise.reject(t3); + } + const t2 = this.scheduleUpdate(); + return null != t2 && await t2, !this.isUpdatePending; + } + scheduleUpdate() { + return this.performUpdate(); + } + performUpdate() { + if (!this.isUpdatePending) return; + if (!this.hasUpdated) { + if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) { + for (const [t4, s3] of this._$Ep) this[t4] = s3; + this._$Ep = void 0; + } + const t3 = this.constructor.elementProperties; + if (t3.size > 0) for (const [s3, i3] of t3) true !== i3.wrapped || this._$AL.has(s3) || void 0 === this[s3] || this.P(s3, this[s3], i3); + } + let t2 = false; + const s2 = this._$AL; + try { + t2 = this.shouldUpdate(s2), t2 ? (this.willUpdate(s2), this._$EO?.forEach((t3) => t3.hostUpdate?.()), this.update(s2)) : this._$EU(); + } catch (s3) { + throw t2 = false, this._$EU(), s3; + } + t2 && this._$AE(s2); + } + willUpdate(t2) { + } + _$AE(t2) { + this._$EO?.forEach((t3) => t3.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t2)), this.updated(t2); + } + _$EU() { + this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = false; + } + get updateComplete() { + return this.getUpdateComplete(); + } + getUpdateComplete() { + return this._$ES; + } + shouldUpdate(t2) { + return true; + } + update(t2) { + this._$Ej &&= this._$Ej.forEach((t3) => this._$EC(t3, this[t3])), this._$EU(); + } + updated(t2) { + } + firstUpdated(t2) { + } +}; +b.elementStyles = [], b.shadowRootOptions = { mode: "open" }, b[d("elementProperties")] = /* @__PURE__ */ new Map(), b[d("finalized")] = /* @__PURE__ */ new Map(), p?.({ ReactiveElement: b }), (a.reactiveElementVersions ??= []).push("2.0.4"); + +// node_modules/lit-html/lit-html.js +var n3 = globalThis; +var c3 = n3.trustedTypes; +var h2 = c3 ? c3.createPolicy("lit-html", { createHTML: (t2) => t2 }) : void 0; +var f2 = "$lit$"; +var v = `lit$${Math.random().toFixed(9).slice(2)}$`; +var m = "?" + v; +var _ = `<${m}>`; +var w = document; +var lt = () => w.createComment(""); +var st = (t2) => null === t2 || "object" != typeof t2 && "function" != typeof t2; +var g = Array.isArray; +var $ = (t2) => g(t2) || "function" == typeof t2?.[Symbol.iterator]; +var x = "[ \n\f\r]"; +var T = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g; +var E = /-->/g; +var k = />/g; +var O = RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`, "g"); +var S2 = /'/g; +var j = /"/g; +var M = /^(?:script|style|textarea|title)$/i; +var P = (t2) => (i3, ...s2) => ({ _$litType$: t2, strings: i3, values: s2 }); +var ke = P(1); +var Oe = P(2); +var Se = P(3); +var R = Symbol.for("lit-noChange"); +var D = Symbol.for("lit-nothing"); +var V = /* @__PURE__ */ new WeakMap(); +var I = w.createTreeWalker(w, 129); +function N(t2, i3) { + if (!g(t2) || !t2.hasOwnProperty("raw")) throw Error("invalid template strings array"); + return void 0 !== h2 ? h2.createHTML(i3) : i3; +} +var U = (t2, i3) => { + const s2 = t2.length - 1, e4 = []; + let h4, o4 = 2 === i3 ? "" : 3 === i3 ? "" : "", n5 = T; + for (let i4 = 0; i4 < s2; i4++) { + const s3 = t2[i4]; + let r4, l2, c4 = -1, a2 = 0; + for (; a2 < s3.length && (n5.lastIndex = a2, l2 = n5.exec(s3), null !== l2); ) a2 = n5.lastIndex, n5 === T ? "!--" === l2[1] ? n5 = E : void 0 !== l2[1] ? n5 = k : void 0 !== l2[2] ? (M.test(l2[2]) && (h4 = RegExp("" === l2[0] ? (n5 = h4 ?? T, c4 = -1) : void 0 === l2[1] ? c4 = -2 : (c4 = n5.lastIndex - l2[2].length, r4 = l2[1], n5 = void 0 === l2[3] ? O : '"' === l2[3] ? j : S2) : n5 === j || n5 === S2 ? n5 = O : n5 === E || n5 === k ? n5 = T : (n5 = O, h4 = void 0); + const u2 = n5 === O && t2[i4 + 1].startsWith("/>") ? " " : ""; + o4 += n5 === T ? s3 + _ : c4 >= 0 ? (e4.push(r4), s3.slice(0, c4) + f2 + s3.slice(c4) + v + u2) : s3 + v + (-2 === c4 ? i4 : u2); + } + return [N(t2, o4 + (t2[s2] || "") + (2 === i3 ? "" : 3 === i3 ? "" : "")), e4]; +}; +var B = class _B { + constructor({ strings: t2, _$litType$: i3 }, s2) { + let e4; + this.parts = []; + let h4 = 0, o4 = 0; + const n5 = t2.length - 1, r4 = this.parts, [l2, a2] = U(t2, i3); + if (this.el = _B.createElement(l2, s2), I.currentNode = this.el.content, 2 === i3 || 3 === i3) { + const t3 = this.el.content.firstChild; + t3.replaceWith(...t3.childNodes); + } + for (; null !== (e4 = I.nextNode()) && r4.length < n5; ) { + if (1 === e4.nodeType) { + if (e4.hasAttributes()) for (const t3 of e4.getAttributeNames()) if (t3.endsWith(f2)) { + const i4 = a2[o4++], s3 = e4.getAttribute(t3).split(v), n6 = /([.?@])?(.*)/.exec(i4); + r4.push({ type: 1, index: h4, name: n6[2], strings: s3, ctor: "." === n6[1] ? Y : "?" === n6[1] ? Z : "@" === n6[1] ? q : G }), e4.removeAttribute(t3); + } else t3.startsWith(v) && (r4.push({ type: 6, index: h4 }), e4.removeAttribute(t3)); + if (M.test(e4.tagName)) { + const t3 = e4.textContent.split(v), i4 = t3.length - 1; + if (i4 > 0) { + e4.textContent = c3 ? c3.emptyScript : ""; + for (let s3 = 0; s3 < i4; s3++) e4.append(t3[s3], lt()), I.nextNode(), r4.push({ type: 2, index: ++h4 }); + e4.append(t3[i4], lt()); + } + } + } else if (8 === e4.nodeType) if (e4.data === m) r4.push({ type: 2, index: h4 }); + else { + let t3 = -1; + for (; -1 !== (t3 = e4.data.indexOf(v, t3 + 1)); ) r4.push({ type: 7, index: h4 }), t3 += v.length - 1; + } + h4++; + } + } + static createElement(t2, i3) { + const s2 = w.createElement("template"); + return s2.innerHTML = t2, s2; + } +}; +function z(t2, i3, s2 = t2, e4) { + if (i3 === R) return i3; + let h4 = void 0 !== e4 ? s2.o?.[e4] : s2.l; + const o4 = st(i3) ? void 0 : i3._$litDirective$; + return h4?.constructor !== o4 && (h4?._$AO?.(false), void 0 === o4 ? h4 = void 0 : (h4 = new o4(t2), h4._$AT(t2, s2, e4)), void 0 !== e4 ? (s2.o ??= [])[e4] = h4 : s2.l = h4), void 0 !== h4 && (i3 = z(t2, h4._$AS(t2, i3.values), h4, e4)), i3; +} +var F = class { + constructor(t2, i3) { + this._$AV = [], this._$AN = void 0, this._$AD = t2, this._$AM = i3; + } + get parentNode() { + return this._$AM.parentNode; + } + get _$AU() { + return this._$AM._$AU; + } + u(t2) { + const { el: { content: i3 }, parts: s2 } = this._$AD, e4 = (t2?.creationScope ?? w).importNode(i3, true); + I.currentNode = e4; + let h4 = I.nextNode(), o4 = 0, n5 = 0, r4 = s2[0]; + for (; void 0 !== r4; ) { + if (o4 === r4.index) { + let i4; + 2 === r4.type ? i4 = new et(h4, h4.nextSibling, this, t2) : 1 === r4.type ? i4 = new r4.ctor(h4, r4.name, r4.strings, this, t2) : 6 === r4.type && (i4 = new K(h4, this, t2)), this._$AV.push(i4), r4 = s2[++n5]; + } + o4 !== r4?.index && (h4 = I.nextNode(), o4++); + } + return I.currentNode = w, e4; + } + p(t2) { + let i3 = 0; + for (const s2 of this._$AV) void 0 !== s2 && (void 0 !== s2.strings ? (s2._$AI(t2, s2, i3), i3 += s2.strings.length - 2) : s2._$AI(t2[i3])), i3++; + } +}; +var et = class _et { + get _$AU() { + return this._$AM?._$AU ?? this.v; + } + constructor(t2, i3, s2, e4) { + this.type = 2, this._$AH = D, this._$AN = void 0, this._$AA = t2, this._$AB = i3, this._$AM = s2, this.options = e4, this.v = e4?.isConnected ?? true; + } + get parentNode() { + let t2 = this._$AA.parentNode; + const i3 = this._$AM; + return void 0 !== i3 && 11 === t2?.nodeType && (t2 = i3.parentNode), t2; + } + get startNode() { + return this._$AA; + } + get endNode() { + return this._$AB; + } + _$AI(t2, i3 = this) { + t2 = z(this, t2, i3), st(t2) ? t2 === D || null == t2 || "" === t2 ? (this._$AH !== D && this._$AR(), this._$AH = D) : t2 !== this._$AH && t2 !== R && this._(t2) : void 0 !== t2._$litType$ ? this.$(t2) : void 0 !== t2.nodeType ? this.T(t2) : $(t2) ? this.k(t2) : this._(t2); + } + O(t2) { + return this._$AA.parentNode.insertBefore(t2, this._$AB); + } + T(t2) { + this._$AH !== t2 && (this._$AR(), this._$AH = this.O(t2)); + } + _(t2) { + this._$AH !== D && st(this._$AH) ? this._$AA.nextSibling.data = t2 : this.T(w.createTextNode(t2)), this._$AH = t2; + } + $(t2) { + const { values: i3, _$litType$: s2 } = t2, e4 = "number" == typeof s2 ? this._$AC(t2) : (void 0 === s2.el && (s2.el = B.createElement(N(s2.h, s2.h[0]), this.options)), s2); + if (this._$AH?._$AD === e4) this._$AH.p(i3); + else { + const t3 = new F(e4, this), s3 = t3.u(this.options); + t3.p(i3), this.T(s3), this._$AH = t3; + } + } + _$AC(t2) { + let i3 = V.get(t2.strings); + return void 0 === i3 && V.set(t2.strings, i3 = new B(t2)), i3; + } + k(t2) { + g(this._$AH) || (this._$AH = [], this._$AR()); + const i3 = this._$AH; + let s2, e4 = 0; + for (const h4 of t2) e4 === i3.length ? i3.push(s2 = new _et(this.O(lt()), this.O(lt()), this, this.options)) : s2 = i3[e4], s2._$AI(h4), e4++; + e4 < i3.length && (this._$AR(s2 && s2._$AB.nextSibling, e4), i3.length = e4); + } + _$AR(t2 = this._$AA.nextSibling, i3) { + for (this._$AP?.(false, true, i3); t2 && t2 !== this._$AB; ) { + const i4 = t2.nextSibling; + t2.remove(), t2 = i4; + } + } + setConnected(t2) { + void 0 === this._$AM && (this.v = t2, this._$AP?.(t2)); + } +}; +var G = class { + get tagName() { + return this.element.tagName; + } + get _$AU() { + return this._$AM._$AU; + } + constructor(t2, i3, s2, e4, h4) { + this.type = 1, this._$AH = D, this._$AN = void 0, this.element = t2, this.name = i3, this._$AM = e4, this.options = h4, s2.length > 2 || "" !== s2[0] || "" !== s2[1] ? (this._$AH = Array(s2.length - 1).fill(new String()), this.strings = s2) : this._$AH = D; + } + _$AI(t2, i3 = this, s2, e4) { + const h4 = this.strings; + let o4 = false; + if (void 0 === h4) t2 = z(this, t2, i3, 0), o4 = !st(t2) || t2 !== this._$AH && t2 !== R, o4 && (this._$AH = t2); + else { + const e5 = t2; + let n5, r4; + for (t2 = h4[0], n5 = 0; n5 < h4.length - 1; n5++) r4 = z(this, e5[s2 + n5], i3, n5), r4 === R && (r4 = this._$AH[n5]), o4 ||= !st(r4) || r4 !== this._$AH[n5], r4 === D ? t2 = D : t2 !== D && (t2 += (r4 ?? "") + h4[n5 + 1]), this._$AH[n5] = r4; + } + o4 && !e4 && this.j(t2); + } + j(t2) { + t2 === D ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t2 ?? ""); + } +}; +var Y = class extends G { + constructor() { + super(...arguments), this.type = 3; + } + j(t2) { + this.element[this.name] = t2 === D ? void 0 : t2; + } +}; +var Z = class extends G { + constructor() { + super(...arguments), this.type = 4; + } + j(t2) { + this.element.toggleAttribute(this.name, !!t2 && t2 !== D); + } +}; +var q = class extends G { + constructor(t2, i3, s2, e4, h4) { + super(t2, i3, s2, e4, h4), this.type = 5; + } + _$AI(t2, i3 = this) { + if ((t2 = z(this, t2, i3, 0) ?? D) === R) return; + const s2 = this._$AH, e4 = t2 === D && s2 !== D || t2.capture !== s2.capture || t2.once !== s2.once || t2.passive !== s2.passive, h4 = t2 !== D && (s2 === D || e4); + e4 && this.element.removeEventListener(this.name, this, s2), h4 && this.element.addEventListener(this.name, this, t2), this._$AH = t2; + } + handleEvent(t2) { + "function" == typeof this._$AH ? this._$AH.call(this.options?.host ?? this.element, t2) : this._$AH.handleEvent(t2); + } +}; +var K = class { + constructor(t2, i3, s2) { + this.element = t2, this.type = 6, this._$AN = void 0, this._$AM = i3, this.options = s2; + } + get _$AU() { + return this._$AM._$AU; + } + _$AI(t2) { + z(this, t2); + } +}; +var Re = n3.litHtmlPolyfillSupport; +Re?.(B, et), (n3.litHtmlVersions ??= []).push("3.2.0"); +var Q = (t2, i3, s2) => { + const e4 = s2?.renderBefore ?? i3; + let h4 = e4._$litPart$; + if (void 0 === h4) { + const t3 = s2?.renderBefore ?? null; + e4._$litPart$ = h4 = new et(i3.insertBefore(lt(), t3), t3, void 0, s2 ?? {}); + } + return h4._$AI(t2), h4; +}; + +// node_modules/lit-element/lit-element.js +var h3 = class extends b { + constructor() { + super(...arguments), this.renderOptions = { host: this }, this.o = void 0; + } + createRenderRoot() { + const t2 = super.createRenderRoot(); + return this.renderOptions.renderBefore ??= t2.firstChild, t2; + } + update(t2) { + const e4 = this.render(); + this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t2), this.o = Q(e4, this.renderRoot, this.renderOptions); + } + connectedCallback() { + super.connectedCallback(), this.o?.setConnected(true); + } + disconnectedCallback() { + super.disconnectedCallback(), this.o?.setConnected(false); + } + render() { + return R; + } +}; +h3._$litElement$ = true, h3["finalized"] = true, globalThis.litElementHydrateSupport?.({ LitElement: h3 }); +var f3 = globalThis.litElementPolyfillSupport; +f3?.({ LitElement: h3 }); +(globalThis.litElementVersions ??= []).push("4.1.0"); + +// node_modules/@lit/reactive-element/decorators/property.js +var o3 = { attribute: true, type: String, converter: u, reflect: false, hasChanged: f }; +var r3 = (t2 = o3, e4, r4) => { + const { kind: n5, metadata: i3 } = r4; + let s2 = globalThis.litPropertyMetadata.get(i3); + if (void 0 === s2 && globalThis.litPropertyMetadata.set(i3, s2 = /* @__PURE__ */ new Map()), s2.set(r4.name, t2), "accessor" === n5) { + const { name: o4 } = r4; + return { set(r5) { + const n6 = e4.get.call(this); + e4.set.call(this, r5), this.requestUpdate(o4, n6, t2); + }, init(e5) { + return void 0 !== e5 && this.P(o4, void 0, t2), e5; + } }; + } + if ("setter" === n5) { + const { name: o4 } = r4; + return function(r5) { + const n6 = this[o4]; + e4.call(this, r5), this.requestUpdate(o4, n6, t2); + }; + } + throw Error("Unsupported decorator location: " + n5); +}; +function n4(t2) { + return (e4, o4) => "object" == typeof o4 ? r3(t2, e4, o4) : ((t3, e5, o5) => { + const r4 = e5.hasOwnProperty(o5); + return e5.constructor.createProperty(o5, r4 ? { ...t3, wrapped: true } : t3), r4 ? Object.getOwnPropertyDescriptor(e5, o5) : void 0; + })(t2, e4, o4); +} + +// js/ipywidgets_styles.ts +var legacyStyles = i` .legacy-button { align-items: center; background-color: var(--jp-layout-color2); @@ -53,7 +637,10 @@ var _t=Object.defineProperty;var bt=Object.getOwnPropertyDescriptor;var w=(o,t,e height: var(--jp-widgets-inline-height); line-height: var(--jp-widgets-inline-height); } -`;var vt=v` +`; + +// js/material_styles.ts +var materialStyles = i` @font-face { font-family: 'Material Symbols Outlined'; font-style: normal; @@ -75,7 +662,27 @@ var _t=Object.defineProperty;var bt=Object.getOwnPropertyDescriptor;var w=(o,t,e white-space: nowrap; word-wrap: normal; } -`;var $=class $ extends y{constructor(){super(...arguments);this._model=void 0;this.name="";this.visible=!0;this.opacity=0;this.isLoading=!1;this.isConfirmDialogVisible=!1}static get componentName(){return"layer-manager-row"}static{this.styles=[$t,vt,v` +`; + +// js/layer_manager_row.ts +var _LayerManagerRow = class _LayerManagerRow extends h3 { + constructor() { + super(...arguments); + this._model = void 0; + this.name = ""; + this.visible = true; + this.opacity = 0; + this.isLoading = false; + this.isConfirmDialogVisible = false; + } + static get componentName() { + return `layer-manager-row`; + } + static { + this.styles = [ + legacyStyles, + materialStyles, + i` .row { align-items: center; display: flex; @@ -144,7 +751,30 @@ var _t=Object.defineProperty;var bt=Object.getOwnPropertyDescriptor;var w=(o,t,e height: 26px; width: 70px; } - `]}static{this.modelNameToViewName=new Map([["name","name"],["visible","visible"],["opacity","opacity"],["is_loading","isLoading"]])}set model(e){this._model=e;for(let[s,i]of $.modelNameToViewName)i&&(this[i]=e.get(s),e.on(`change:${s}`,()=>{this[i]=e.get(s)}))}render(){return st` + ` + ]; + } + static { + this.modelNameToViewName = /* @__PURE__ */ new Map([ + ["name", "name"], + ["visible", "visible"], + ["opacity", "opacity"], + ["is_loading", "isLoading"] + ]); + } + set model(model) { + this._model = model; + for (const [modelKey, widgetKey] of _LayerManagerRow.modelNameToViewName) { + if (widgetKey) { + this[widgetKey] = model.get(modelKey); + model.on(`change:${modelKey}`, () => { + this[widgetKey] = model.get(modelKey); + }); + } + } + } + render() { + return ke`
${this.renderConfirmDialog()} - `}renderConfirmDialog(){return this.isConfirmDialogVisible?st` + `; + } + renderConfirmDialog() { + if (!this.isConfirmDialogVisible) { + return D; + } + return ke`
Remove layer?
- `:c}updated(e){for(let[s,i]of e)this._model?.set(s,this[s]);this._model?.save_changes()}onLayerVisibilityChanged(e){let s=e.target;this.visible=s.checked}onLayerOpacityChanged(e){let s=e.target;this.opacity=parseFloat(s.value)}onSettingsClicked(e){this._model?.send({type:"click",id:"settings"})}onDeleteClicked(e){this.isConfirmDialogVisible=!0}confirmDeletion(e){this._model?.send({type:"click",id:"delete"})}cancelDeletion(e){this.isConfirmDialogVisible=!1}};w([S()],$.prototype,"name",2),w([S()],$.prototype,"visible",2),w([S()],$.prototype,"opacity",2),w([S()],$.prototype,"isLoading",2),w([S()],$.prototype,"isConfirmDialogVisible",2);var P=$;customElements.get(P.componentName)||customElements.define(P.componentName,P);function jt({model:o,el:t}){let e=document.createElement(P.componentName);e.model=o,t.appendChild(e)}var Ve={render:jt};export{P as LayerManagerRow,Ve as default}; + `; + } + updated(changedProperties) { + for (const [property, _2] of changedProperties) { + this._model?.set(property, this[property]); + } + this._model?.save_changes(); + } + onLayerVisibilityChanged(event) { + const target = event.target; + this.visible = target.checked; + } + onLayerOpacityChanged(event) { + const target = event.target; + this.opacity = parseFloat(target.value); + } + onSettingsClicked(_2) { + this._model?.send({ "type": "click", "id": "settings" }); + } + onDeleteClicked(_2) { + this.isConfirmDialogVisible = true; + } + confirmDeletion(_2) { + this._model?.send({ "type": "click", "id": "delete" }); + } + cancelDeletion(_2) { + this.isConfirmDialogVisible = false; + } +}; +__decorateClass([ + n4() +], _LayerManagerRow.prototype, "name", 2); +__decorateClass([ + n4() +], _LayerManagerRow.prototype, "visible", 2); +__decorateClass([ + n4() +], _LayerManagerRow.prototype, "opacity", 2); +__decorateClass([ + n4() +], _LayerManagerRow.prototype, "isLoading", 2); +__decorateClass([ + n4() +], _LayerManagerRow.prototype, "isConfirmDialogVisible", 2); +var LayerManagerRow = _LayerManagerRow; +if (!customElements.get(LayerManagerRow.componentName)) { + customElements.define(LayerManagerRow.componentName, LayerManagerRow); +} +function render({ model, el }) { + const row = document.createElement(LayerManagerRow.componentName); + row.model = model; + el.appendChild(row); +} +var layer_manager_row_default = { render }; +export { + LayerManagerRow, + layer_manager_row_default as default +}; /*! Bundled license information: @lit/reactive-element/css-tag.js: @@ -301,3 +994,4 @@ lit-html/is-server.js: * SPDX-License-Identifier: BSD-3-Clause *) */ +//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vbm9kZV9tb2R1bGVzL0BsaXQvcmVhY3RpdmUtZWxlbWVudC9zcmMvY3NzLXRhZy50cyIsICIuLi8uLi9ub2RlX21vZHVsZXMvQGxpdC9yZWFjdGl2ZS1lbGVtZW50L3NyYy9yZWFjdGl2ZS1lbGVtZW50LnRzIiwgIi4uLy4uL25vZGVfbW9kdWxlcy9saXQtaHRtbC9zcmMvbGl0LWh0bWwudHMiLCAiLi4vLi4vbm9kZV9tb2R1bGVzL2xpdC1lbGVtZW50L3NyYy9saXQtZWxlbWVudC50cyIsICIuLi8uLi9ub2RlX21vZHVsZXMvQGxpdC9yZWFjdGl2ZS1lbGVtZW50L3NyYy9kZWNvcmF0b3JzL3Byb3BlcnR5LnRzIiwgIi4uLy4uL2pzL2lweXdpZGdldHNfc3R5bGVzLnRzIiwgIi4uLy4uL2pzL21hdGVyaWFsX3N0eWxlcy50cyIsICIuLi8uLi9qcy9sYXllcl9tYW5hZ2VyX3Jvdy50cyJdLAogICJ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gfSBlbHNlIGlzc3VlV2FybmluZygnJywgbSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIC8vIFRPRE8gKGp1c3RpbmZhZ25hbmkpOiBmb3IgYXR0ZW1wdGVkIGR5bmFtaWMgdGFnIG5hbWVzLCB3ZSBkb24ndFxuICAgICAgICAvLyBpbmNyZW1lbnQgdGhlIGJpbmRpbmdJbmRleCwgYW5kIGl0J2xsIGJlIG9mZiBieSAxIGluIHRoZSBlbGVtZW50XG4gICAgICAgIC8vIGFuZCBvZmYgYnkgdHdvIGFmdGVyIGl0LlxuICAgICAgICBpZiAoKG5vZGUgYXMgRWxlbWVudCkuaGFzQXR0cmlidXRlcygpKSB7XG4gICAgICAgICAgZm9yIChjb25zdCBuYW1lIG9mIChub2RlIGFzIEVsZW1lbnQpLmdldEF0dHJpYnV0ZU5hbWVzKCkpIHtcbiAgICAgICAgICAgIGlmIChuYW1lLmVuZHNXaXRoKGJvdW5kQXR0cmlidXRlU3VmZml4KSkge1xuICAgICAgICAgICAgICBjb25zdCByZWFsTmFtZSA9IGF0dHJOYW1lc1thdHRyTmFtZUluZGV4KytdO1xuICAgICAgICAgICAgICBjb25zdCB2YWx1ZSA9IChub2RlIGFzIEVsZW1lbnQpLmdldEF0dHJpYnV0ZShuYW1lKSE7XG4gICAgICAgICAgICAgIGNvbnN0IHN0YXRpY3MgPSB2YWx1ZS5zcGxpdChtYXJrZXIpO1xuICAgICAgICAgICAgICBjb25zdCBtID0gLyhbLj9AXSk/KC4qKS8uZXhlYyhyZWFsTmFtZSkhO1xuICAgICAgICAgICAgICBwYXJ0cy5wdXNoKHtcbiAgICAgICAgICAgICAgICB0eXBlOiBBVFRSSUJVVEVfUEFSVCxcbiAgICAgICAgICAgICAgICBpbmRleDogbm9kZUluZGV4LFxuICAgICAgICAgICAgICAgIG5hbWU6IG1bMl0sXG4gICAgICAgICAgICAgICAgc3RyaW5nczogc3RhdGljcyxcbiAgICAgICAgICAgICAgICBjdG9yOlxuICAgICAgICAgICAgICAgICAgbVsxXSA9PT0gJy4nXG4gICAgICAgICAgICAgICAgICAgID8gUHJvcGVydHlQYXJ0XG4gICAgICAgICAgICAgICAgICAgIDogbVsxXSA9PT0gJz8nXG4gICAgICAgICAgICAgICAgICAgICAgPyBCb29sZWFuQXR0cmlidXRlUGFydFxuICAgICAgICAgICAgICAgICAgICAgIDogbVsxXSA9PT0gJ0AnXG4gICAgICAgICAgICAgICAgICAgICAgICA/IEV2ZW50UGFydFxuICAgICAgICAgICAgICAgICAgICAgICAgOiBBdHRyaWJ1dGVQYXJ0LFxuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgKG5vZGUgYXMgRWxlbWVudCkucmVtb3ZlQXR0cmlidXRlKG5hbWUpO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChuYW1lLnN0YXJ0c1dpdGgobWFya2VyKSkge1xuICAgICAgICAgICAgICBwYXJ0cy5wdXNoKHtcbiAgICAgICAgICAgICAgICB0eXBlOiBFTEVNRU5UX1BBUlQsXG4gICAgICAgICAgICAgICAgaW5kZXg6IG5vZGVJbmRleCxcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgIChub2RlIGFzIEVsZW1lbnQpLnJlbW92ZUF0dHJpYnV0ZShuYW1lKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgLy8gVE9ETyAoanVzdGluZmFnbmFuaSk6IGJlbmNobWFyayB0aGUgcmVnZXggYWdhaW5zdCB0ZXN0aW5nIGZvciBlYWNoXG4gICAgICAgIC8vIG9mIHRoZSAzIHJhdyB0ZXh0IGVsZW1lbnQgbmFtZXMuXG4gICAgICAgIGlmIChyYXdUZXh0RWxlbWVudC50ZXN0KChub2RlIGFzIEVsZW1lbnQpLnRhZ05hbWUpKSB7XG4gICAgICAgICAgLy8gRm9yIHJhdyB0ZXh0IGVsZW1lbnRzIHdlIG5lZWQgdG8gc3BsaXQgdGhlIHRleHQgY29ud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07XG5cbiAgICB3aGlsZSAodGVtcGxhdGVQYXJ0ICE9PSB1bmRlZmluZWQpIHtcbiAgICAgIGlmIChub2RlSW5kZXggPT09IHRlbXBsYXRlUGFydC5pbmRleCkge1xuICAgICAgICBsZXQgcGFydDogUGFydCB8IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHRlbXBsYXRlUGFydC50eXBlID09PSBDSElMRF9QQVJUKSB7XG4gICAgICAgICAgcGFydCA9IG5ldyBDaGlsZFBhcnQoXG4gICAgICAgICAgICBub2RlIGFzIEhUTUxFbGVtZW50LFxuICAgICAgICAgICAgbm9kZS5uZXh0U2libGluZyxcbiAgICAgICAgICAgIHRoaXMsXG4gICAgICAgICAgICBvcHRpb25zLFxuICAgICAgICAgICk7XG4gICAgICAgIH0gZWxzZSBpZiAodGVtcGxhdGVQYXJ0LnR5cGUgPT09IEFUVFJJQlVURV9QQVJUKSB7XG4gICAgICAgICAgcGFydCA9IG5ldyB0ZW1wbGF0ZVBhcnQuY3RvcihcbiAgICAgICAgICAgIG5vZGUgYXMgSFRNTEVsZW1lbnQsXG4gICAgICAgICAgICB0ZW1wbGF0ZVBhcnQubmFtZSxcbiAgICAgICAgICAgIHRlbXBsYXRlUGFydC5zdHJpbmdzLFxuICAgICAgICAgICAgdGhpcyxcbiAgICAgICAgICAgIG9wdGlvbnMsXG4gICAgICAgICAgKTtcbiAgICAgICAgfSBlbHNlIGlmICh0ZW1wbGF0ZVBhcnQudHlwZSA9PT0gRUxFTUVOVF9QQVJUKSB7XG4gICAgICAgICAgcGFydCA9IG5ldyBFbGVtZW50UGFydChub2RlIGFzIEhUTUxFbGVtZW50LCB0aGlzLCBvcHRpb25zKTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLl8kcGFydHMucHVzaChwYXJ0KTtcbiAgICAgICAgdGVtcGxhdGVQYXJ0ID0gcGFydHNbKytwYXJ0SW5kZXhdO1xuICAgICAgfVxuICAgICAgaWYgKG5vZGVJbmRleCAhPT0gdGVtcGxh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blxuICAgIHN0YXRpYyBzdHlsZXMgPSBbXG4gICAgICAgIGxlZ2FjeVN0eWxlcyxcbiAgICAgICAgbWF0ZXJpYWxTdHlsZXMsXG4gICAgICAgIGNzc2BcbiAgICAgICAgICAgIC5yb3cge1xuICAgICAgICAgICAgICAgIGFsaWduLWl0ZW1zOiBjZW50ZXI7XG4gICAgICAgICAgICAgICAgZGlzcGxheTogZmxleDtcbiAgICAgICAgICAgICAgICBnYXA6IDRweDtcbiAgICAgICAgICAgICAgICBoZWlnaHQ6IDMwcHg7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC5sYXllci1uYW1lIHtcbiAgICAgICAgICAgICAgICBmbGV4LWdyb3c6IDE7XG4gICAgICAgICAgICAgICAgbWF4LXdpZHRoOiAxNTBweDtcbiAgICAgICAgICAgICAgICBvdmVyZmxvdzogaGlkZGVuO1xuICAgICAgICAgICAgICAgIHRleHQtb3ZlcmZsb3c6IGVsbGlwc2lzO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAuc2V0dGluZ3MtZGVsZXRlLWJ1dHRvbiB7XG4gICAgICAgICAgICAgICAgZm9udC1zaXplOiAxNHB4O1xuICAgICAgICAgICAgICAgIGhlaWdodDogMjZweDtcbiAgICAgICAgICAgICAgICB3aWR0aDogMjZweDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLmxheWVyLW9wYWNpdHktc2xpZGVyIHtcbiAgICAgICAgICAgICAgICB3aWR0aDogNzBweDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLmxheWVyLXZpc2liaWxpdHktY2hlY2tib3gge1xuICAgICAgICAgICAgICAgIG1hcmdpbjogMnB4O1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAuc3Bpbm5lciB7XG4gICAgICAgICAgICAgICAgLXdlYmtpdC1hbmltYXRpb246IHNwaW4gMnMgbGluZWFyIGluZmluaXRlO1xuICAgICAgICAgICAgICAgIGFuaW1hdGlvbjogc3BpbiAycyBsaW5lYXIgaW5maW5pdGU7XG4gICAgICAgICAgICAgICAgYm9yZGVyLXJhZGl1czogNTAlO1xuICAgICAgICAgICAgICAgIGJvcmRlcjogNHB4IHNvbGlkIHZhcigtLWpwLXdpZGdldHMtaW5wdXQtYm9yZGVyLWNvbG9yKTtcbiAgICAgICAgICAgICAgICBib3JkZXItdG9wOiA0cHggc29saWQgdmFyKC0tanAtd2lkZ2V0cy1jb2xvcik7XG4gICAgICAgICAgICAgICAgaGVpZ2h0OiAxMnB4O1xuICAgICAgICAgICAgICAgIHdpZHRoOiAxMnB4O1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBALXdlYmtpdC1rZXlmcmFtZXMgc3BpbiB7XG4gICAgICAgICAgICAgICAgMCUgeyAtd2Via2l0LXRyYW5zZm9ybTogcm90YXRlKDBkZWcpOyB9XG4gICAgICAgICAgICAgICAgMTAwJSB7IC13ZWJraXQtdHJhbnNmb3JtOiByb3RhdGUoMzYwZGVnKTsgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBAa2V5ZnJhbWVzIHNwaW4ge1xuICAgICAgICAgICAgICAgIDAlIHsgdHJhbnNmb3JtOiByb3RhdGUoMGRlZyk7IH1cbiAgICAgICAgICAgICAgICAxMDAlIHsgdHJhbnNmb3JtOiByb3RhdGUoMzYwZGVnKTsgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBidXR0b24ubG9hZGluZyAuc3Bpbm5lcixcbiAgICAgICAgICAgIGJ1dHRvbi5sb2FkaW5nOmhvdmVyIC5jbG9zZS1pY29uLFxuICAgICAgICAgICAgYnV0dG9uLmRvbmUtbG9hZGluZyAuY2xvc2UtaWNvbiB7XG4gICAgICAgICAgICAgICAgZGlzcGxheTogYmxvY2s7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGJ1dHRvbi5sb2FkaW5nIC5jbG9zZS1pY29uLFxuICAgICAgICAgICAgYnV0dG9uLmxvYWRpbmc6aG92ZXIgLnNwaW5uZXIsXG4gICAgICAgICAgICBidXR0b24uZG9uZS1sb2FkaW5nIC5zcGlubmVyIHtcbiAgICAgICAgICAgICAgICBkaXNwbGF5OiBub25lO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAucmVtb3ZlLWxheWVyLXRleHQge1xuICAgICAgICAgICAgICAgIGZsZXgtZ3JvdzogMTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLmNvbmZpcm0tZGVueS1idXR0b24ge1xuICAgICAgICAgICAgICAgIGhlaWdodDogMjZweDtcbiAgICAgICAgICAgICAgICB3aWR0aDogNzBweDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgYCxcbiAgICBdO1xuXG4gICAgcHJpdmF0ZSBfbW9kZWw6IEFueU1vZGVsPExheWVyTWFuYWdlclJvd01vZGVsPiB8IHVuZGVmaW5lZCA9IHVuZGVmaW5lZDtcbiAgICBwcml2YXRlIHN0YXRpYyBtb2RlbE5hbWVUb1ZpZXdOYW1lID0gbmV3IE1hcDxrZXlvZiBMYXllck1hbmFnZXJSb3dNb2RlbCwga2V5b2YgTGF5ZXJNYW5hZ2VyUm93IHwgbnVsbD4oW1xuICAgICAgICBbXCJuYW1lXCIsIFwibmFtZVwiXSxcbiAgICAgICAgW1widmlzaWJsZVwiLCBcInZpc2libGVcIl0sXG4gICAgICAgIFtcIm9wYWNpdHlcIiwgXCJvcGFjaXR5XCJdLFxuICAgICAgICBbXCJpc19sb2FkaW5nXCIsIFwiaXNMb2FkaW5nXCJdLFxuICAgIF0pO1xuXG4gICAgc2V0IG1vZGVsKG1vZGVsOiBBbnlNb2RlbDxMYXllck1hbmFnZXJSb3dNb2RlbD4pIHtcbiAgICAgICAgdGhpcy5fbW9kZWwgPSBtb2RlbDtcbiAgICAgICAgZm9yIChjb25zdCBbbW9kZWxLZXksIHdpZGdldEtleV0gb2YgTGF5ZXJNYW5hZ2VyUm93Lm1vZGVsTmFtZVRvVmlld05hbWUpIHtcbiAgICAgICAgICAgIGlmICh3aWRnZXRLZXkpIHtcbiAgICAgICAgICAgICAgICAvLyBHZXQgaW5pdGlhbCB2YWx1ZXMgZnJvbSB0aGUgUHl0aG9uIG1vZGVsLlxuICAgICAgICAgICAgICAgICh0aGlzIGFzIGFueSlbd2lkZ2V0S2V5XSA9IG1vZGVsLmdldChtb2RlbEtleSk7XG4gICAgICAgICAgICAgICAgLy8gTGlzdGVuIGZvciB1cGRhdGVzIHRvIHRoZSBtb2RlbC5cbiAgICAgICAgICAgICAgICBtb2RlbC5vbihgY2hhbmdlOiR7bW9kZWxLZXl9YCwgKCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAodGhpcyBhcyBhbnkpW3dpZGdldEtleV0gPSBtb2RlbC5nZXQobW9kZWxLZXkpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgQHByb3BlcnR5KClcbiAgICBuYW1lOiBzdHJpbmcgPSBcIlwiO1xuXG4gICAgQHByb3BlcnR5KClcbiAgICB2aXNpYmxlOiBib29sZWFuID0gdHJ1ZTtcblxuICAgIEBwcm9wZXJ0eSgpXG4gICAgb3BhY2l0eTogbnVtYmVyID0gMDtcblxuICAgIEBwcm9wZXJ0eSgpXG4gICAgaXNMb2FkaW5nOiBib29sZWFuID0gZmFsc2U7XG5cbiAgICBAcHJvcGVydHkoKVxuICAgIGlzQ29uZmlybURpYWxvZ1Zpc2libGU6IGJvb2xlYW4gPSBmYWxzZTtcblxuICAgIHJlbmRlcigpOiBUZW1wbGF0ZVJlc3VsdCB7XG4gICAgICAgIHJldHVybiBodG1sYFxuICAgICAgICAgICAgPGRpdiBjbGFzcz1cInJvd1wiPlxuICAgICAgICAgICAgICAgIDxpbnB1dFxuICAgICAgICAgICAgICAgICAgICB0eXBlPVwiY2hlY2tib3hcIlxuICAgICAgICAgICAgICAgICAgICBjbGFzcz1cImxheWVyLXZpc2liaWxpdHktY2hlY2tib3hcIlxuICAgICAgICAgICAgICAgICAgICAuY2hlY2tlZD1cIiR7dGhpcy52aXNpYmxlfVwiXG4gICAgICAgICAgICAgICAgICAgIEBjaGFuZ2U9XCIke3RoaXMub25MYXllclZpc2liaWxpdHlDaGFuZ2VkfVwiXG4gICAgICAgICAgICAgICAgLz5cbiAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cImxlZ2FjeS10ZXh0IGxheWVyLW5hbWVcIj4ke3RoaXMubmFtZX08L3NwYW4+XG4gICAgICAgICAgICAgICAgPGlucHV0XG4gICAgICAgICAgICAgICAgICAgIHR5cGU9XCJyYW5nZVwiXG4gICAgICAgICAgICAgICAgICAgIGNsYXNzPVwibGVnYWN5LXNsaWRlciBsYXllci1vcGFjaXR5LXNsaWRlclwiXG4gICAgICAgICAgICAgICAgICAgIG1pbj1cIjBcIlxuICAgICAgICAgICAgICAgICAgICBtYXg9XCIxXCJcbiAgICAgICAgICAgICAgICAgICAgc3RlcD1cIjAuMDFcIlxuICAgICAgICAgICAgICAgICAgICAudmFsdWU9XCIke3RoaXMub3BhY2l0eX1cIlxuICAgICAgICAgICAgICAgICAgICBAaW5wdXQ9XCIke3RoaXMub25MYXllck9wYWNpdHlDaGFuZ2VkfVwiXG4gICAgICAgICAgICAgICAgLz5cbiAgICAgICAgICAgICAgICA8YnV0dG9uXG4gICAgICAgICAgICAgICAgICAgIGNsYXNzPVwibGVnYWN5LWJ1dHRvbiBzZXR0aW5ncy1kZWxldGUtYnV0dG9uXCJcbiAgICAgICAgICAgICAgICAgICAgQGNsaWNrPVwiJHt0aGlzLm9uU2V0dGluZ3NDbGlja2VkfVwiXG4gICAgICAgICAgICAgICAgPlxuICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cIm1hdGVyaWFsLXN5bWJvbHMtb3V0bGluZWRcIj4mI3hlOGI4Ozwvc3Bhbj5cbiAgICAgICAgICAgICAgICA8L2J1dHRvbj5cbiAgICAgICAgICAgICAgICA8YnV0dG9uXG4gICAgICAgICAgICAgICAgICAgIGNsYXNzPVwibGVnYWN5LWJ1dHRvbiBzZXR0aW5ncy1kZWxldGUtYnV0dG9uICR7dGhpcy5pc0xvYWRpbmcgPyAnbG9hZGluZycgOiAnZG9uZS1sb2FkaW5nJ31cIlxuICAgICAgICAgICAgICAgICAgICBAY2xpY2s9XCIke3RoaXMub25EZWxldGVDbGlja2VkfVwiXG4gICAgICAgICAgICAgICAgPlxuICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwic3Bpbm5lclwiPjwvZGl2PlxuICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cImNsb3NlLWljb24gbWF0ZXJpYWwtc3ltYm9scy1vdXRsaW5lZFwiPiYjeGU1Y2Q7PC9zcGFuPlxuICAgICAgICAgICAgICAgIDwvYnV0dG9uPlxuICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICAke3RoaXMucmVuZGVyQ29uZmlybURpYWxvZygpfVxuICAgICAgICBgO1xuICAgIH1cblxuICAgIHByaXZhdGUgcmVuZGVyQ29uZmlybURpYWxvZygpOiBUZW1wbGF0ZVJlc3VsdCB8IHZvaWQge1xuICAgICAgICBpZiAoIXRoaXMuaXNDb25maXJtRGlhbG9nVmlzaWJsZSkge1xuICAgICAgICAgICAgcmV0dXJuIG5vdGhpbmc7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGh0bWxgXG4gICAgICAgICAgICA8ZGl2IGNsYXNzPVwicm93XCI+XG4gICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJsZWdhY3ktdGV4dCByZW1vdmUtbGF5ZXItdGV4dFwiPlJlbW92ZSBsYXllcj88L3NwYW4+XG4gICAgICAgICAgICAgICAgICAgIDxidXR0b25cbiAgICAgICAgICAgICAgICAgICAgICAgIGNsYXNzPVwibGVnYWN5LWJ1dHRvbiBwcmltYXJ5IGNvbmZpcm0tZGVueS1idXR0b25cIlxuICAgICAgICAgICAgICAgICAgICAgICAgQGNsaWNrPVwiJHt0aGlzLmNvbmZpcm1EZWxldGlvbn1cIlxuICAgICAgICAgICAgICAgICAgICA+XG4gICAgICAgICAgICAgICAgICAgICAgICBZZXNcbiAgICAgICAgICAgICAgICAgICAgPC9idXR0b24+XG4gICAgICAgICAgICAgICAgICAgIDxidXR0b25cbiAgICAgICAgICAgICAgICAgICAgICAgIGNsYXNzPVwibGVnYWN5LWJ1dHRvbiBwcmltYXJ5IGNvbmZpcm0tZGVueS1idXR0b25cIlxuICAgICAgICAgICAgICAgICAgICAgICAgQGNsaWNrPVwiJHt0aGlzLmNhbmNlbERlbGV0aW9ufVwiXG4gICAgICAgICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICAgICAgICAgIE5vXG4gICAgICAgICAgICAgICAgICAgIDwvYnV0dG9uPlxuICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgIGA7XG4gICAgfVxuXG4gICAgdXBkYXRlZChjaGFuZ2VkUHJvcGVydGllczogYW55KSB7XG4gICAgICAgIC8vIFVwZGF0ZSB0aGUgbW9kZWwgcHJvcGVydGllcyBzbyB0aGV5J3JlIHJlZmxlY3RlZCBpbiBQeXRob24uXG4gICAgICAgIGZvciAoY29uc3QgW3Byb3BlcnR5LCBfXSBvZiBjaGFuZ2VkUHJvcGVydGllcykge1xuICAgICAgICAgICAgdGhpcy5fbW9kZWw/LnNldChwcm9wZXJ0eSwgdGhpc1twcm9wZXJ0eSBhcyBrZXlvZiBMYXllck1hbmFnZXJSb3ddKTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLl9tb2RlbD8uc2F2ZV9jaGFuZ2VzKCk7XG4gICAgfVxuXG4gICAgcHJpdmF0ZSBvbkxheWVyVmlzaWJpbGl0eUNoYW5nZWQoZXZlbnQ6IEV2ZW50KSB7XG4gICAgICAgIGNvbnN0IHRhcmdldCA9IGV2ZW50LnRhcmdldCBhcyBIVE1MSW5wdXRFbGVtZW50O1xuICAgICAgICB0aGlzLnZpc2libGUgPSB0YXJnZXQuY2hlY2tlZDtcbiAgICB9XG5cbiAg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9sZFZhbHVlIiwgImNhbGwiLCAidGhpcyIsICJyZXF1ZXN0VXBkYXRlIiwgIl8kY2hhbmdlUHJvcGVydHkiLCAidmFsdWUiLCAiRXJyb3IiLCAicHJvcGVydHkiLCAicHJvdG9PclRhcmdldCIsICJuYW1lT3JDb250ZXh0IiwgInByb3RvIiwgImhhc093blByb3BlcnR5IiwgImNvbnN0cnVjdG9yIiwgImNyZWF0ZVByb3BlcnR5IiwgIndyYXBwZWQiLCAiT2JqZWN0IiwgImdldE93blByb3BlcnR5RGVzY3JpcHRvciIsICJoIiwgIl8iLCAibiJdCn0K diff --git a/geemap/static/material_styles.js b/geemap/static/material_styles.js index d5a7762b34..2e561ad473 100644 --- a/geemap/static/material_styles.js +++ b/geemap/static/material_styles.js @@ -1,6 +1,549 @@ -var R=globalThis,T=R.ShadowRoot&&(R.ShadyCSS===void 0||R.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,L=Symbol(),F=new WeakMap,b=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==L)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(T&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=F.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&F.set(e,t))}return t}toString(){return this.cssText}},Q=o=>new b(typeof o=="string"?o:o+"",void 0,L),z=(o,...t)=>{let e=o.length===1?o[0]:t.reduce((s,i,r)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+o[r+1],o[0]);return new b(e,o,L)},I=(o,t)=>{if(T)o.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=R.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,o.appendChild(s)}},M=T?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return Q(e)})(o):o;var{is:pt,defineProperty:ut,getOwnPropertyDescriptor:$t,getOwnPropertyNames:ft,getOwnPropertySymbols:_t,getPrototypeOf:mt}=Object,N=globalThis,Y=N.trustedTypes,At=Y?Y.emptyScript:"",gt=N.reactiveElementPolyfillSupport,w=(o,t)=>o,j={toAttribute(o,t){switch(t){case Boolean:o=o?At:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},tt=(o,t)=>!pt(o,t),G={attribute:!0,type:String,converter:j,reflect:!1,hasChanged:tt};Symbol.metadata??=Symbol("metadata"),N.litPropertyMetadata??=new WeakMap;var $=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=G){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&ut(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:r}=$t(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i?.call(this)},set(n){let p=i?.call(this);r.call(this,n),this.requestUpdate(t,p,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??G}static _$Ei(){if(this.hasOwnProperty(w("elementProperties")))return;let t=mt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(w("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(w("properties"))){let e=this.properties,s=[...ft(e),..._t(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(M(i))}else t!==void 0&&e.push(M(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return I(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let r=(s.converter?.toAttribute!==void 0?s.converter:j).toAttribute(e,s.type);this._$Em=t,r==null?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let r=s.getPropertyOptions(i),n=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute!==void 0?r.converter:j;this._$Em=i,this[i]=n.fromAttribute(e,r.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??tt)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,r]of this._$Ep)this[i]=r;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,r]of s)r.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],r)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[w("elementProperties")]=new Map,$[w("finalized")]=new Map,gt?.({ReactiveElement:$}),(N.reactiveElementVersions??=[]).push("2.0.4");var K=globalThis,k=K.trustedTypes,et=k?k.createPolicy("lit-html",{createHTML:o=>o}):void 0,ht="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,at="?"+_,yt=`<${at}>`,g=document,x=()=>g.createComment(""),P=o=>o===null||typeof o!="object"&&typeof o!="function",X=Array.isArray,vt=o=>X(o)||typeof o?.[Symbol.iterator]=="function",B=`[ -\f\r]`,C=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,st=/-->/g,it=/>/g,m=RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^ -\f\r"'\`<>=]|("|')|))|$)`,"g"),ot=/'/g,rt=/"/g,lt=/^(?:script|style|textarea|title)$/i,Z=o=>(t,...e)=>({_$litType$:o,strings:t,values:e}),Ut=Z(1),Ht=Z(2),Ot=Z(3),y=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),nt=new WeakMap,A=g.createTreeWalker(g,129);function ct(o,t){if(!X(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return et!==void 0?et.createHTML(t):t}var St=(o,t)=>{let e=o.length-1,s=[],i,r=t===2?"":t===3?"":"",n=C;for(let p=0;p"?(n=i??C,a=-1):d[1]===void 0?a=-2:(a=n.lastIndex-d[2].length,l=d[1],n=d[3]===void 0?m:d[3]==='"'?rt:ot):n===rt||n===ot?n=m:n===st||n===it?n=C:(n=m,i=void 0);let f=n===m&&o[p+1].startsWith("/>")?" ":"";r+=n===C?h+yt:a>=0?(s.push(l),h.slice(0,a)+ht+h.slice(a)+_+f):h+_+(a===-2?p:f)}return[ct(o,r+(o[e]||"")+(t===2?"":t===3?"":"")),s]},U=class o{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let r=0,n=0,p=t.length-1,h=this.parts,[l,d]=St(t,e);if(this.el=o.createElement(l,s),A.currentNode=this.el.content,e===2||e===3){let a=this.el.content.firstChild;a.replaceWith(...a.childNodes)}for(;(i=A.nextNode())!==null&&h.length0){i.textContent=k?k.emptyScript:"";for(let f=0;f2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=c}_$AI(t,e=this,s,i){let r=this.strings,n=!1;if(r===void 0)t=v(this,t,e,0),n=!P(t)||t!==this._$AH&&t!==y,n&&(this._$AH=t);else{let p=t,h,l;for(t=r[0],h=0;h{let s=e?.renderBefore??t,i=s._$litPart$;if(i===void 0){let r=e?.renderBefore??null;s._$litPart$=i=new H(t.insertBefore(x(),r),r,void 0,e??{})}return i._$AI(o),i};var E=class extends ${constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=dt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return y}};E._$litElement$=!0,E.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:E});var bt=globalThis.litElementPolyfillSupport;bt?.({LitElement:E});(globalThis.litElementVersions??=[]).push("4.1.0");var Jt=z` +// node_modules/@lit/reactive-element/css-tag.js +var t = globalThis; +var e = t.ShadowRoot && (void 0 === t.ShadyCSS || t.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype; +var s = Symbol(); +var o = /* @__PURE__ */ new WeakMap(); +var n = class { + constructor(t2, e3, o3) { + if (this._$cssResult$ = true, o3 !== s) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead."); + this.cssText = t2, this.t = e3; + } + get styleSheet() { + let t2 = this.o; + const s2 = this.t; + if (e && void 0 === t2) { + const e3 = void 0 !== s2 && 1 === s2.length; + e3 && (t2 = o.get(s2)), void 0 === t2 && ((this.o = t2 = new CSSStyleSheet()).replaceSync(this.cssText), e3 && o.set(s2, t2)); + } + return t2; + } + toString() { + return this.cssText; + } +}; +var r = (t2) => new n("string" == typeof t2 ? t2 : t2 + "", void 0, s); +var i = (t2, ...e3) => { + const o3 = 1 === t2.length ? t2[0] : e3.reduce((e4, s2, o4) => e4 + ((t3) => { + if (true === t3._$cssResult$) return t3.cssText; + if ("number" == typeof t3) return t3; + throw Error("Value passed to 'css' function must be a 'css' function result: " + t3 + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security."); + })(s2) + t2[o4 + 1], t2[0]); + return new n(o3, t2, s); +}; +var S = (s2, o3) => { + if (e) s2.adoptedStyleSheets = o3.map((t2) => t2 instanceof CSSStyleSheet ? t2 : t2.styleSheet); + else for (const e3 of o3) { + const o4 = document.createElement("style"), n4 = t.litNonce; + void 0 !== n4 && o4.setAttribute("nonce", n4), o4.textContent = e3.cssText, s2.appendChild(o4); + } +}; +var c = e ? (t2) => t2 : (t2) => t2 instanceof CSSStyleSheet ? ((t3) => { + let e3 = ""; + for (const s2 of t3.cssRules) e3 += s2.cssText; + return r(e3); +})(t2) : t2; + +// node_modules/@lit/reactive-element/reactive-element.js +var { is: i2, defineProperty: e2, getOwnPropertyDescriptor: r2, getOwnPropertyNames: h, getOwnPropertySymbols: o2, getPrototypeOf: n2 } = Object; +var a = globalThis; +var c2 = a.trustedTypes; +var l = c2 ? c2.emptyScript : ""; +var p = a.reactiveElementPolyfillSupport; +var d = (t2, s2) => t2; +var u = { toAttribute(t2, s2) { + switch (s2) { + case Boolean: + t2 = t2 ? l : null; + break; + case Object: + case Array: + t2 = null == t2 ? t2 : JSON.stringify(t2); + } + return t2; +}, fromAttribute(t2, s2) { + let i3 = t2; + switch (s2) { + case Boolean: + i3 = null !== t2; + break; + case Number: + i3 = null === t2 ? null : Number(t2); + break; + case Object: + case Array: + try { + i3 = JSON.parse(t2); + } catch (t3) { + i3 = null; + } + } + return i3; +} }; +var f = (t2, s2) => !i2(t2, s2); +var y = { attribute: true, type: String, converter: u, reflect: false, hasChanged: f }; +Symbol.metadata ??= Symbol("metadata"), a.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap(); +var b = class extends HTMLElement { + static addInitializer(t2) { + this._$Ei(), (this.l ??= []).push(t2); + } + static get observedAttributes() { + return this.finalize(), this._$Eh && [...this._$Eh.keys()]; + } + static createProperty(t2, s2 = y) { + if (s2.state && (s2.attribute = false), this._$Ei(), this.elementProperties.set(t2, s2), !s2.noAccessor) { + const i3 = Symbol(), r3 = this.getPropertyDescriptor(t2, i3, s2); + void 0 !== r3 && e2(this.prototype, t2, r3); + } + } + static getPropertyDescriptor(t2, s2, i3) { + const { get: e3, set: h4 } = r2(this.prototype, t2) ?? { get() { + return this[s2]; + }, set(t3) { + this[s2] = t3; + } }; + return { get() { + return e3?.call(this); + }, set(s3) { + const r3 = e3?.call(this); + h4.call(this, s3), this.requestUpdate(t2, r3, i3); + }, configurable: true, enumerable: true }; + } + static getPropertyOptions(t2) { + return this.elementProperties.get(t2) ?? y; + } + static _$Ei() { + if (this.hasOwnProperty(d("elementProperties"))) return; + const t2 = n2(this); + t2.finalize(), void 0 !== t2.l && (this.l = [...t2.l]), this.elementProperties = new Map(t2.elementProperties); + } + static finalize() { + if (this.hasOwnProperty(d("finalized"))) return; + if (this.finalized = true, this._$Ei(), this.hasOwnProperty(d("properties"))) { + const t3 = this.properties, s2 = [...h(t3), ...o2(t3)]; + for (const i3 of s2) this.createProperty(i3, t3[i3]); + } + const t2 = this[Symbol.metadata]; + if (null !== t2) { + const s2 = litPropertyMetadata.get(t2); + if (void 0 !== s2) for (const [t3, i3] of s2) this.elementProperties.set(t3, i3); + } + this._$Eh = /* @__PURE__ */ new Map(); + for (const [t3, s2] of this.elementProperties) { + const i3 = this._$Eu(t3, s2); + void 0 !== i3 && this._$Eh.set(i3, t3); + } + this.elementStyles = this.finalizeStyles(this.styles); + } + static finalizeStyles(s2) { + const i3 = []; + if (Array.isArray(s2)) { + const e3 = new Set(s2.flat(1 / 0).reverse()); + for (const s3 of e3) i3.unshift(c(s3)); + } else void 0 !== s2 && i3.push(c(s2)); + return i3; + } + static _$Eu(t2, s2) { + const i3 = s2.attribute; + return false === i3 ? void 0 : "string" == typeof i3 ? i3 : "string" == typeof t2 ? t2.toLowerCase() : void 0; + } + constructor() { + super(), this._$Ep = void 0, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev(); + } + _$Ev() { + this._$ES = new Promise((t2) => this.enableUpdating = t2), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((t2) => t2(this)); + } + addController(t2) { + (this._$EO ??= /* @__PURE__ */ new Set()).add(t2), void 0 !== this.renderRoot && this.isConnected && t2.hostConnected?.(); + } + removeController(t2) { + this._$EO?.delete(t2); + } + _$E_() { + const t2 = /* @__PURE__ */ new Map(), s2 = this.constructor.elementProperties; + for (const i3 of s2.keys()) this.hasOwnProperty(i3) && (t2.set(i3, this[i3]), delete this[i3]); + t2.size > 0 && (this._$Ep = t2); + } + createRenderRoot() { + const t2 = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions); + return S(t2, this.constructor.elementStyles), t2; + } + connectedCallback() { + this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach((t2) => t2.hostConnected?.()); + } + enableUpdating(t2) { + } + disconnectedCallback() { + this._$EO?.forEach((t2) => t2.hostDisconnected?.()); + } + attributeChangedCallback(t2, s2, i3) { + this._$AK(t2, i3); + } + _$EC(t2, s2) { + const i3 = this.constructor.elementProperties.get(t2), e3 = this.constructor._$Eu(t2, i3); + if (void 0 !== e3 && true === i3.reflect) { + const r3 = (void 0 !== i3.converter?.toAttribute ? i3.converter : u).toAttribute(s2, i3.type); + this._$Em = t2, null == r3 ? this.removeAttribute(e3) : this.setAttribute(e3, r3), this._$Em = null; + } + } + _$AK(t2, s2) { + const i3 = this.constructor, e3 = i3._$Eh.get(t2); + if (void 0 !== e3 && this._$Em !== e3) { + const t3 = i3.getPropertyOptions(e3), r3 = "function" == typeof t3.converter ? { fromAttribute: t3.converter } : void 0 !== t3.converter?.fromAttribute ? t3.converter : u; + this._$Em = e3, this[e3] = r3.fromAttribute(s2, t3.type), this._$Em = null; + } + } + requestUpdate(t2, s2, i3) { + if (void 0 !== t2) { + if (i3 ??= this.constructor.getPropertyOptions(t2), !(i3.hasChanged ?? f)(this[t2], s2)) return; + this.P(t2, s2, i3); + } + false === this.isUpdatePending && (this._$ES = this._$ET()); + } + P(t2, s2, i3) { + this._$AL.has(t2) || this._$AL.set(t2, s2), true === i3.reflect && this._$Em !== t2 && (this._$Ej ??= /* @__PURE__ */ new Set()).add(t2); + } + async _$ET() { + this.isUpdatePending = true; + try { + await this._$ES; + } catch (t3) { + Promise.reject(t3); + } + const t2 = this.scheduleUpdate(); + return null != t2 && await t2, !this.isUpdatePending; + } + scheduleUpdate() { + return this.performUpdate(); + } + performUpdate() { + if (!this.isUpdatePending) return; + if (!this.hasUpdated) { + if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) { + for (const [t4, s3] of this._$Ep) this[t4] = s3; + this._$Ep = void 0; + } + const t3 = this.constructor.elementProperties; + if (t3.size > 0) for (const [s3, i3] of t3) true !== i3.wrapped || this._$AL.has(s3) || void 0 === this[s3] || this.P(s3, this[s3], i3); + } + let t2 = false; + const s2 = this._$AL; + try { + t2 = this.shouldUpdate(s2), t2 ? (this.willUpdate(s2), this._$EO?.forEach((t3) => t3.hostUpdate?.()), this.update(s2)) : this._$EU(); + } catch (s3) { + throw t2 = false, this._$EU(), s3; + } + t2 && this._$AE(s2); + } + willUpdate(t2) { + } + _$AE(t2) { + this._$EO?.forEach((t3) => t3.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t2)), this.updated(t2); + } + _$EU() { + this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = false; + } + get updateComplete() { + return this.getUpdateComplete(); + } + getUpdateComplete() { + return this._$ES; + } + shouldUpdate(t2) { + return true; + } + update(t2) { + this._$Ej &&= this._$Ej.forEach((t3) => this._$EC(t3, this[t3])), this._$EU(); + } + updated(t2) { + } + firstUpdated(t2) { + } +}; +b.elementStyles = [], b.shadowRootOptions = { mode: "open" }, b[d("elementProperties")] = /* @__PURE__ */ new Map(), b[d("finalized")] = /* @__PURE__ */ new Map(), p?.({ ReactiveElement: b }), (a.reactiveElementVersions ??= []).push("2.0.4"); + +// node_modules/lit-html/lit-html.js +var n3 = globalThis; +var c3 = n3.trustedTypes; +var h2 = c3 ? c3.createPolicy("lit-html", { createHTML: (t2) => t2 }) : void 0; +var f2 = "$lit$"; +var v = `lit$${Math.random().toFixed(9).slice(2)}$`; +var m = "?" + v; +var _ = `<${m}>`; +var w = document; +var lt = () => w.createComment(""); +var st = (t2) => null === t2 || "object" != typeof t2 && "function" != typeof t2; +var g = Array.isArray; +var $ = (t2) => g(t2) || "function" == typeof t2?.[Symbol.iterator]; +var x = "[ \n\f\r]"; +var T = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g; +var E = /-->/g; +var k = />/g; +var O = RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`, "g"); +var S2 = /'/g; +var j = /"/g; +var M = /^(?:script|style|textarea|title)$/i; +var P = (t2) => (i3, ...s2) => ({ _$litType$: t2, strings: i3, values: s2 }); +var ke = P(1); +var Oe = P(2); +var Se = P(3); +var R = Symbol.for("lit-noChange"); +var D = Symbol.for("lit-nothing"); +var V = /* @__PURE__ */ new WeakMap(); +var I = w.createTreeWalker(w, 129); +function N(t2, i3) { + if (!g(t2) || !t2.hasOwnProperty("raw")) throw Error("invalid template strings array"); + return void 0 !== h2 ? h2.createHTML(i3) : i3; +} +var U = (t2, i3) => { + const s2 = t2.length - 1, e3 = []; + let h4, o3 = 2 === i3 ? "" : 3 === i3 ? "" : "", n4 = T; + for (let i4 = 0; i4 < s2; i4++) { + const s3 = t2[i4]; + let r3, l2, c4 = -1, a2 = 0; + for (; a2 < s3.length && (n4.lastIndex = a2, l2 = n4.exec(s3), null !== l2); ) a2 = n4.lastIndex, n4 === T ? "!--" === l2[1] ? n4 = E : void 0 !== l2[1] ? n4 = k : void 0 !== l2[2] ? (M.test(l2[2]) && (h4 = RegExp("" === l2[0] ? (n4 = h4 ?? T, c4 = -1) : void 0 === l2[1] ? c4 = -2 : (c4 = n4.lastIndex - l2[2].length, r3 = l2[1], n4 = void 0 === l2[3] ? O : '"' === l2[3] ? j : S2) : n4 === j || n4 === S2 ? n4 = O : n4 === E || n4 === k ? n4 = T : (n4 = O, h4 = void 0); + const u2 = n4 === O && t2[i4 + 1].startsWith("/>") ? " " : ""; + o3 += n4 === T ? s3 + _ : c4 >= 0 ? (e3.push(r3), s3.slice(0, c4) + f2 + s3.slice(c4) + v + u2) : s3 + v + (-2 === c4 ? i4 : u2); + } + return [N(t2, o3 + (t2[s2] || "") + (2 === i3 ? "" : 3 === i3 ? "" : "")), e3]; +}; +var B = class _B { + constructor({ strings: t2, _$litType$: i3 }, s2) { + let e3; + this.parts = []; + let h4 = 0, o3 = 0; + const n4 = t2.length - 1, r3 = this.parts, [l2, a2] = U(t2, i3); + if (this.el = _B.createElement(l2, s2), I.currentNode = this.el.content, 2 === i3 || 3 === i3) { + const t3 = this.el.content.firstChild; + t3.replaceWith(...t3.childNodes); + } + for (; null !== (e3 = I.nextNode()) && r3.length < n4; ) { + if (1 === e3.nodeType) { + if (e3.hasAttributes()) for (const t3 of e3.getAttributeNames()) if (t3.endsWith(f2)) { + const i4 = a2[o3++], s3 = e3.getAttribute(t3).split(v), n5 = /([.?@])?(.*)/.exec(i4); + r3.push({ type: 1, index: h4, name: n5[2], strings: s3, ctor: "." === n5[1] ? Y : "?" === n5[1] ? Z : "@" === n5[1] ? q : G }), e3.removeAttribute(t3); + } else t3.startsWith(v) && (r3.push({ type: 6, index: h4 }), e3.removeAttribute(t3)); + if (M.test(e3.tagName)) { + const t3 = e3.textContent.split(v), i4 = t3.length - 1; + if (i4 > 0) { + e3.textContent = c3 ? c3.emptyScript : ""; + for (let s3 = 0; s3 < i4; s3++) e3.append(t3[s3], lt()), I.nextNode(), r3.push({ type: 2, index: ++h4 }); + e3.append(t3[i4], lt()); + } + } + } else if (8 === e3.nodeType) if (e3.data === m) r3.push({ type: 2, index: h4 }); + else { + let t3 = -1; + for (; -1 !== (t3 = e3.data.indexOf(v, t3 + 1)); ) r3.push({ type: 7, index: h4 }), t3 += v.length - 1; + } + h4++; + } + } + static createElement(t2, i3) { + const s2 = w.createElement("template"); + return s2.innerHTML = t2, s2; + } +}; +function z(t2, i3, s2 = t2, e3) { + if (i3 === R) return i3; + let h4 = void 0 !== e3 ? s2.o?.[e3] : s2.l; + const o3 = st(i3) ? void 0 : i3._$litDirective$; + return h4?.constructor !== o3 && (h4?._$AO?.(false), void 0 === o3 ? h4 = void 0 : (h4 = new o3(t2), h4._$AT(t2, s2, e3)), void 0 !== e3 ? (s2.o ??= [])[e3] = h4 : s2.l = h4), void 0 !== h4 && (i3 = z(t2, h4._$AS(t2, i3.values), h4, e3)), i3; +} +var F = class { + constructor(t2, i3) { + this._$AV = [], this._$AN = void 0, this._$AD = t2, this._$AM = i3; + } + get parentNode() { + return this._$AM.parentNode; + } + get _$AU() { + return this._$AM._$AU; + } + u(t2) { + const { el: { content: i3 }, parts: s2 } = this._$AD, e3 = (t2?.creationScope ?? w).importNode(i3, true); + I.currentNode = e3; + let h4 = I.nextNode(), o3 = 0, n4 = 0, r3 = s2[0]; + for (; void 0 !== r3; ) { + if (o3 === r3.index) { + let i4; + 2 === r3.type ? i4 = new et(h4, h4.nextSibling, this, t2) : 1 === r3.type ? i4 = new r3.ctor(h4, r3.name, r3.strings, this, t2) : 6 === r3.type && (i4 = new K(h4, this, t2)), this._$AV.push(i4), r3 = s2[++n4]; + } + o3 !== r3?.index && (h4 = I.nextNode(), o3++); + } + return I.currentNode = w, e3; + } + p(t2) { + let i3 = 0; + for (const s2 of this._$AV) void 0 !== s2 && (void 0 !== s2.strings ? (s2._$AI(t2, s2, i3), i3 += s2.strings.length - 2) : s2._$AI(t2[i3])), i3++; + } +}; +var et = class _et { + get _$AU() { + return this._$AM?._$AU ?? this.v; + } + constructor(t2, i3, s2, e3) { + this.type = 2, this._$AH = D, this._$AN = void 0, this._$AA = t2, this._$AB = i3, this._$AM = s2, this.options = e3, this.v = e3?.isConnected ?? true; + } + get parentNode() { + let t2 = this._$AA.parentNode; + const i3 = this._$AM; + return void 0 !== i3 && 11 === t2?.nodeType && (t2 = i3.parentNode), t2; + } + get startNode() { + return this._$AA; + } + get endNode() { + return this._$AB; + } + _$AI(t2, i3 = this) { + t2 = z(this, t2, i3), st(t2) ? t2 === D || null == t2 || "" === t2 ? (this._$AH !== D && this._$AR(), this._$AH = D) : t2 !== this._$AH && t2 !== R && this._(t2) : void 0 !== t2._$litType$ ? this.$(t2) : void 0 !== t2.nodeType ? this.T(t2) : $(t2) ? this.k(t2) : this._(t2); + } + O(t2) { + return this._$AA.parentNode.insertBefore(t2, this._$AB); + } + T(t2) { + this._$AH !== t2 && (this._$AR(), this._$AH = this.O(t2)); + } + _(t2) { + this._$AH !== D && st(this._$AH) ? this._$AA.nextSibling.data = t2 : this.T(w.createTextNode(t2)), this._$AH = t2; + } + $(t2) { + const { values: i3, _$litType$: s2 } = t2, e3 = "number" == typeof s2 ? this._$AC(t2) : (void 0 === s2.el && (s2.el = B.createElement(N(s2.h, s2.h[0]), this.options)), s2); + if (this._$AH?._$AD === e3) this._$AH.p(i3); + else { + const t3 = new F(e3, this), s3 = t3.u(this.options); + t3.p(i3), this.T(s3), this._$AH = t3; + } + } + _$AC(t2) { + let i3 = V.get(t2.strings); + return void 0 === i3 && V.set(t2.strings, i3 = new B(t2)), i3; + } + k(t2) { + g(this._$AH) || (this._$AH = [], this._$AR()); + const i3 = this._$AH; + let s2, e3 = 0; + for (const h4 of t2) e3 === i3.length ? i3.push(s2 = new _et(this.O(lt()), this.O(lt()), this, this.options)) : s2 = i3[e3], s2._$AI(h4), e3++; + e3 < i3.length && (this._$AR(s2 && s2._$AB.nextSibling, e3), i3.length = e3); + } + _$AR(t2 = this._$AA.nextSibling, i3) { + for (this._$AP?.(false, true, i3); t2 && t2 !== this._$AB; ) { + const i4 = t2.nextSibling; + t2.remove(), t2 = i4; + } + } + setConnected(t2) { + void 0 === this._$AM && (this.v = t2, this._$AP?.(t2)); + } +}; +var G = class { + get tagName() { + return this.element.tagName; + } + get _$AU() { + return this._$AM._$AU; + } + constructor(t2, i3, s2, e3, h4) { + this.type = 1, this._$AH = D, this._$AN = void 0, this.element = t2, this.name = i3, this._$AM = e3, this.options = h4, s2.length > 2 || "" !== s2[0] || "" !== s2[1] ? (this._$AH = Array(s2.length - 1).fill(new String()), this.strings = s2) : this._$AH = D; + } + _$AI(t2, i3 = this, s2, e3) { + const h4 = this.strings; + let o3 = false; + if (void 0 === h4) t2 = z(this, t2, i3, 0), o3 = !st(t2) || t2 !== this._$AH && t2 !== R, o3 && (this._$AH = t2); + else { + const e4 = t2; + let n4, r3; + for (t2 = h4[0], n4 = 0; n4 < h4.length - 1; n4++) r3 = z(this, e4[s2 + n4], i3, n4), r3 === R && (r3 = this._$AH[n4]), o3 ||= !st(r3) || r3 !== this._$AH[n4], r3 === D ? t2 = D : t2 !== D && (t2 += (r3 ?? "") + h4[n4 + 1]), this._$AH[n4] = r3; + } + o3 && !e3 && this.j(t2); + } + j(t2) { + t2 === D ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t2 ?? ""); + } +}; +var Y = class extends G { + constructor() { + super(...arguments), this.type = 3; + } + j(t2) { + this.element[this.name] = t2 === D ? void 0 : t2; + } +}; +var Z = class extends G { + constructor() { + super(...arguments), this.type = 4; + } + j(t2) { + this.element.toggleAttribute(this.name, !!t2 && t2 !== D); + } +}; +var q = class extends G { + constructor(t2, i3, s2, e3, h4) { + super(t2, i3, s2, e3, h4), this.type = 5; + } + _$AI(t2, i3 = this) { + if ((t2 = z(this, t2, i3, 0) ?? D) === R) return; + const s2 = this._$AH, e3 = t2 === D && s2 !== D || t2.capture !== s2.capture || t2.once !== s2.once || t2.passive !== s2.passive, h4 = t2 !== D && (s2 === D || e3); + e3 && this.element.removeEventListener(this.name, this, s2), h4 && this.element.addEventListener(this.name, this, t2), this._$AH = t2; + } + handleEvent(t2) { + "function" == typeof this._$AH ? this._$AH.call(this.options?.host ?? this.element, t2) : this._$AH.handleEvent(t2); + } +}; +var K = class { + constructor(t2, i3, s2) { + this.element = t2, this.type = 6, this._$AN = void 0, this._$AM = i3, this.options = s2; + } + get _$AU() { + return this._$AM._$AU; + } + _$AI(t2) { + z(this, t2); + } +}; +var Re = n3.litHtmlPolyfillSupport; +Re?.(B, et), (n3.litHtmlVersions ??= []).push("3.2.0"); +var Q = (t2, i3, s2) => { + const e3 = s2?.renderBefore ?? i3; + let h4 = e3._$litPart$; + if (void 0 === h4) { + const t3 = s2?.renderBefore ?? null; + e3._$litPart$ = h4 = new et(i3.insertBefore(lt(), t3), t3, void 0, s2 ?? {}); + } + return h4._$AI(t2), h4; +}; + +// node_modules/lit-element/lit-element.js +var h3 = class extends b { + constructor() { + super(...arguments), this.renderOptions = { host: this }, this.o = void 0; + } + createRenderRoot() { + const t2 = super.createRenderRoot(); + return this.renderOptions.renderBefore ??= t2.firstChild, t2; + } + update(t2) { + const e3 = this.render(); + this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t2), this.o = Q(e3, this.renderRoot, this.renderOptions); + } + connectedCallback() { + super.connectedCallback(), this.o?.setConnected(true); + } + disconnectedCallback() { + super.disconnectedCallback(), this.o?.setConnected(false); + } + render() { + return R; + } +}; +h3._$litElement$ = true, h3["finalized"] = true, globalThis.litElementHydrateSupport?.({ LitElement: h3 }); +var f3 = globalThis.litElementPolyfillSupport; +f3?.({ LitElement: h3 }); +(globalThis.litElementVersions ??= []).push("4.1.0"); + +// js/material_styles.ts +var materialStyles = i` @font-face { font-family: 'Material Symbols Outlined'; font-style: normal; @@ -22,7 +565,10 @@ var R=globalThis,T=R.ShadowRoot&&(R.ShadyCSS===void 0||R.ShadyCSS.nativeShadow)& white-space: nowrap; word-wrap: normal; } -`;export{Jt as materialStyles}; +`; +export { + materialStyles +}; /*! Bundled license information: @lit/reactive-element/css-tag.js: @@ -60,3 +606,4 @@ lit-html/is-server.js: * SPDX-License-Identifier: BSD-3-Clause *) */ +//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vbm9kZV9tb2R1bGVzL0BsaXQvcmVhY3RpdmUtZWxlbWVudC9zcmMvY3NzLXRhZy50cyIsICIuLi8uLi9ub2RlX21vZHVsZXMvQGxpdC9yZWFjdGl2ZS1lbGVtZW50L3NyYy9yZWFjdGl2ZS1lbGVtZW50LnRzIiwgIi4uLy4uL25vZGVfbW9kdWxlcy9saXQtaHRtbC9zcmMvbGl0LWh0bWwudHMiLCAiLi4vLi4vbm9kZV9tb2R1bGVzL2xpdC1lbGVtZW50L3NyYy9saXQtZWxlbWVudC50cyIsICIuLi8uLi9qcy9tYXRlcmlhbF9zdHlsZXMudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbIi8qKlxuICogQGxpY2Vuc2VcbiAqIENvcHlyaWdodCAyMDE5IEdvb2dsZSBMTENcbiAqIFNQRFgtTGljZW5zZS1JZGVudGlmaWVyOiBCU0QtMy1DbGF1c2VcbiAqL1xuXG5jb25zdCBOT0RFX01PREUgPSBmYWxzZTtcblxuLy8gQWxsb3dzIG1pbmlmaWVycyB0byByZW5hbWUgcmVmZXJlbmNlcyB0byBnbG9iYWxUaGlzXG5jb25zdCBnbG9iYWwgPSBnbG9iYWxUaGlzO1xuXG4vKipcbiAqIFdoZXRoZXIgdGhlIGN1cnJlbnQgYnJvd3NlciBzdXBwb3J0cyBgYWRvcHRlZFN0eWxlU2hlZXRzYC5cbiAqL1xuZXhwb3J0IGNvbnN0IHN1cHBvcnRzQWRvcHRpbmdTdHlsZVNoZWV0czogYm9vbGVhbiA9XG4gIGdsb2J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AgICAgcGFydHMucHVzaCh7XG4gICAgICAgICAgICAgICAgdHlwZTogQVRUUklCVVRFX1BBUlQsXG4gICAgICAgICAgICAgICAgaW5kZXg6IG5vZGVJbmRleCxcbiAgICAgICAgICAgICAgICBuYW1lOiBtWzJdLFxuICAgICAgICAgICAgICAgIHN0cmluZ3M6IHN0YXRpY3MsXG4gICAgICAgICAgICAgICAgY3RvcjpcbiAgICAgICAgICAgICAgICAgIG1bMV0gPT09ICcuJ1xuICAgICAgICAgICAgICAgICAgICA/IFByb3BlcnR5UGFydFxuICAgICAgICAgICAgICAgICAgICA6IG1bMV0gPT09ICc/J1xuICAgICAgICAgICAgICAgICAgICAgID8gQm9vbGVhbkF0dHJpYnV0ZVBhcnRcbiAgICAgICAgICAgICAgICAgICAgICA6IG1bMV0gPT09ICdAJ1xuICAgICAgICAgICAgICAgICAgICAgICAgPyBFdmVudFBhcnRcbiAgICAgICAgICAgICAgICAgICAgICAgIDogQXR0cmlidXRlUGFydCxcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgIChub2RlIGFzIEVsZW1lbnQpLnJlbW92ZUF0dHJpYnV0ZShuYW1lKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobmFtZS5zdGFydHNXaXRoKG1hcmtlcikpIHtcbiAgICAgICAgICAgICAgcGFydHMucHVzaCh7XG4gICAgICAgICAgICAgICAgdHlwZTogRUxFTUVOVF9QQVJULFxuICAgICAgICAgICAgICAgIGluZGV4OiBub2RlSW5kZXgsXG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAobm9kZSBhcyBFbGVtZW50KS5yZW1vdmVBdHRyaWJ1dGUobmFtZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIC8vIFRPRE8gKGp1c3RpbmZhZ25hbmkpOiBiZW5jaG1hcmsgdGhlIHJlZ2V4IGFnYWluc3QgdGVzdGluZyBmb3IgZWFjaFxuICAgICAgICAvLyBvZiB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zdHlsZSBub2Rlcy4gYCArXG4gICAgICAgICAgICAgICAgYFRoaXMgaXMgYSBzZWN1cml0eSByaXNrLCBhcyBzdHlsZSBpbmplY3Rpb24gYXR0YWNrcyBjYW4gYCArXG4gICAgICAgICAgICAgICAgYGV4ZmlsdHJhdGUgZGF0YSBhbmQgc3Bvb2YgVUlzLiBgICtcbiAgICAgICAgICAgICAgICBgQ29uc2lkZXIgaW5zdGVhZCB1c2luZyBjc3NcXGAuLi5cXGAgbGl0ZXJhbHMgYCArXG4gICAgICAgICAgICAgICAgYHRvIGNvbXBvc2Ugc3R5bGVzLCBhbmQgZG8gZHluYW1pYyBzdHlsaW5nIHdpdGggYCArXG4gICAgICAgICAgICAgICAgYGNzcyBjdXN0b20gcHJvcGVydGllcywgOjpwYXJ0cywgPHNsb3Q+cywgYCArXG4gICAgICAgICAgICAgICAgYGFuZCBieSBtdXRhdGluZyB0aGUgRE9NIHJhdGhlciB0aGFuIHN0eWxlc2hlZXRzLmA7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBtZXNzYWdlID1cbiAgICAgICAgICAgICAgICBgTGl0IGRvZXMgbm90IHN1cHBvcnQgYmluZGluZyBpbnNpZGUgc2NyaXB0IG5vZGVzLiBgICtcbiAgICAgICAgICAgICAgICBgVGhpcyBpcyBhIHNlY3VyaXR5IHJpc2ssIGFzIGl0IGNvdWxkIGFsbG93IGFyYml0cmFyeSBgICtcbiAgICAgICAgICAgICAgICBgY29kZSBleGVjdXRpb24uYDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgdGhyb3cgbmV3IEVycm9yKG1lc3NhZ2UpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBkZWJ1Z0xvZ0V2ZW50ICYmXG4gICAgICAgIGRlYnVnTG9nRXZlbnQoe1xuICAgICAgICAgIGtpbmQ6ICdjb21taXQgbm9kZScsXG4gICAgICAgICAgc3RhcnQ6IHRoaXMuXyRzdGFydE5vZG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IsICJUZW1wbGF0ZSIsICJDaGlsZFBhcnQiLCAibGl0SHRtbFZlcnNpb25zIiwgInB1c2giLCAicmVuZGVyIiwgInZhbHVlIiwgImNvbnRhaW5lciIsICJvcHRpb25zIiwgInBhcnRPd25lck5vZGUiLCAicmVuZGVyQmVmb3JlIiwgInBhcnQiLCAiZW5kTm9kZSIsICJpbnNlcnRCZWZvcmUiLCAiY3JlYXRlTWFya2VyIiwgIl8kc2V0VmFsdWUiLCAiTGl0RWxlbWVudCIsICJSZWFjdGl2ZUVsZW1lbnQiLCAiY29uc3RydWN0b3IiLCAidGhpcyIsICJyZW5kZXJPcHRpb25zIiwgImhvc3QiLCAiX19jaGlsZFBhcnQiLCAiY3JlYXRlUmVuZGVyUm9vdCIsICJyZW5kZXJSb290IiwgInN1cGVyIiwgInJlbmRlckJlZm9yZSIsICJmaXJzdENoaWxkIiwgImNoYW5nZWRQcm9wZXJ0aWVzIiwgInZhbHVlIiwgInJlbmRlciIsICJoYXNVcGRhdGVkIiwgImlzQ29ubmVjdGVkIiwgInVwZGF0ZSIsICJjb25uZWN0ZWRDYWxsYmFjayIsICJzZXRDb25uZWN0ZWQiLCAiZGlzY29ubmVjdGVkQ2FsbGJhY2siLCAibm9DaGFuZ2UiLCAiZ2xvYmFsVGhpcyIsICJsaXRFbGVtZW50SHlkcmF0ZVN1cHBvcnQiLCAicG9seWZpbGxTdXBwb3J0IiwgImxpdEVsZW1lbnRQb2x5ZmlsbFN1cHBvcnQiLCAiZ2xvYmFsVGhpcyIsICJsaXRFbGVtZW50VmVyc2lvbnMiLCAicHVzaCJdCn0K diff --git a/geemap/static/utils.js b/geemap/static/utils.js index 2704aeeb1f..48c0be3026 100644 --- a/geemap/static/utils.js +++ b/geemap/static/utils.js @@ -1 +1,21 @@ -async function d(e,i){return Promise.all(e.map(t=>i.get_model(t.slice(10))))}async function l(e,i){let t=i.get("children"),a=await d(t,i.widget_manager),r=await Promise.all(a.map(n=>n.widget_manager.create_view(n)));e.innerHTML="";for(let n of r)e.appendChild(n.el)}export{l as updateChildren}; +// js/utils.ts +async function unpackModels(modelIds, manager) { + return Promise.all( + modelIds.map((id) => manager.get_model(id.slice("IPY_MODEL_".length))) + ); +} +async function updateChildren(container, model) { + const children = model.get("children"); + const child_models = await unpackModels(children, model.widget_manager); + const child_views = await Promise.all( + child_models.map((model2) => model2.widget_manager.create_view(model2)) + ); + container.innerHTML = ``; + for (const child_view of child_views) { + container.appendChild(child_view.el); + } +} +export { + updateChildren +}; +//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vanMvdXRpbHMudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImltcG9ydCB0eXBlIHsgQW55TW9kZWwgfSBmcm9tIFwiQGFueXdpZGdldC90eXBlc1wiO1xuaW1wb3J0IHsgSVdpZGdldE1hbmFnZXIsIFdpZGdldE1vZGVsIH0gZnJvbSBcIkBqdXB5dGVyLXdpZGdldHMvYmFzZVwiO1xuXG5hc3luYyBmdW5jdGlvbiB1bnBhY2tNb2RlbHMobW9kZWxJZHM6IEFycmF5PHN0cmluZz4sIG1hbmFnZXI6IElXaWRnZXRNYW5hZ2VyKTogUHJvbWlzZTxBcnJheTxXaWRnZXRNb2RlbD4+IHtcbiAgICByZXR1cm4gUHJvbWlzZS5hbGwoXG4gICAgICAgIG1vZGVsSWRzLm1hcChpZCA9PiBtYW5hZ2VyLmdldF9tb2RlbChpZC5zbGljZShcIklQWV9NT0RFTF9cIi5sZW5ndGgpKSlcbiAgICApO1xufVxuXG5leHBvcnQgYXN5bmMgZnVuY3Rpb24gdXBkYXRlQ2hpbGRyZW4oY29udGFpbmVyOiBIVE1MRWxlbWVudCwgbW9kZWw6IEFueU1vZGVsPGFueT4pIHtcbiAgICBjb25zdCBjaGlsZHJlbiA9IG1vZGVsLmdldChcImNoaWxkcmVuXCIpO1xuICAgIGNvbnN0IGNoaWxkX21vZGVscyA9IGF3YWl0IHVucGFja01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 { "scripts": { "dev": "npm run build -- --sourcemap=inline --watch", - "build": "esbuild js/*.ts --minify --format=esm --bundle --outdir=geemap/static", + "build": "esbuild js/*.ts --format=esm --bundle --outdir=geemap/static", "typecheck": "tsc --noEmit" }, "dependencies": { From 6381d4621119c25ed7dfe6b391bff583f5906b36 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2024 18:43:41 +0000 Subject: [PATCH 06/57] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- geemap/static/ipywidgets_styles.js | 2 +- geemap/static/layer_manager.js | 2 +- geemap/static/layer_manager_row.js | 2 +- geemap/static/material_styles.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/geemap/static/ipywidgets_styles.js b/geemap/static/ipywidgets_styles.js index 7e6805d52e..291aa0f8a3 100644 --- a/geemap/static/ipywidgets_styles.js +++ b/geemap/static/ipywidgets_styles.js @@ -278,7 +278,7 @@ var x = "[ \n\f\r]"; var T = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g; var E = /-->/g; var k = />/g; -var O = RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ +var O = RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`, "g"); var S2 = /'/g; var j = /"/g; diff --git a/geemap/static/layer_manager.js b/geemap/static/layer_manager.js index 6c87933c13..eb43afe817 100644 --- a/geemap/static/layer_manager.js +++ b/geemap/static/layer_manager.js @@ -289,7 +289,7 @@ var x = "[ \n\f\r]"; var T = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g; var E = /-->/g; var k = />/g; -var O = RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ +var O = RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`, "g"); var S2 = /'/g; var j = /"/g; diff --git a/geemap/static/layer_manager_row.js b/geemap/static/layer_manager_row.js index 60c628695c..885c2fc008 100644 --- a/geemap/static/layer_manager_row.js +++ b/geemap/static/layer_manager_row.js @@ -289,7 +289,7 @@ var x = "[ \n\f\r]"; var T = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g; var E = /-->/g; var k = />/g; -var O = RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ +var O = RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`, "g"); var S2 = /'/g; var j = /"/g; diff --git a/geemap/static/material_styles.js b/geemap/static/material_styles.js index 2e561ad473..25260356ae 100644 --- a/geemap/static/material_styles.js +++ b/geemap/static/material_styles.js @@ -278,7 +278,7 @@ var x = "[ \n\f\r]"; var T = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g; var E = /-->/g; var k = />/g; -var O = RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ +var O = RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`, "g"); var S2 = /'/g; var j = /"/g; From c31d5a9df9b571275b444119a5a86ddaf1214611 Mon Sep 17 00:00:00 2001 From: Sufyan Abbasi Date: Tue, 15 Oct 2024 01:52:19 +0000 Subject: [PATCH 07/57] Set up tests for layer_manager_row --- karma.conf.js | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 karma.conf.js diff --git a/karma.conf.js b/karma.conf.js new file mode 100644 index 0000000000..31a3e75068 --- /dev/null +++ b/karma.conf.js @@ -0,0 +1,48 @@ +// Karma configuration file, see link for more information +// https://karma-runner.github.io/1.0/config/configuration-file.html + +process.env.CHROME_BIN = require('puppeteer').executablePath(); + +module.exports = function (config) { + config.set({ + basePath: '', + frameworks: [ + 'jasmine', + 'karma-typescript', + ], + files: [ + { pattern: 'tests/**/*.spec.ts', watched: true } + ], + preprocessors: { + "**/*.ts": "karma-typescript", + }, + plugins: [ + 'karma-jasmine', + 'karma-chrome-launcher', + 'karma-jasmine-html-reporter', + 'karma-typescript', + ], + client: { + clearContext: false, // leave Jasmine Spec Runner output visible in browser + jasmine: { + "helpers": ["./node_modules/jasmine-expect/index.js"], + "stopSpecOnExpectationFailure": false, + "random": true + } + }, + reporters: ['progress', 'kjhtml'], + port: 9876, + colors: true, + logLevel: config.LOG_INFO, + autoWatch: true, + browsers: ['Chrome'], + singleRun: false, + restartOnFileChange: true, + customLaunchers: { + ChromeHeadlessNoSandbox: { + base: 'ChromeHeadless', + flags: ['--no-sandbox'], + }, + }, + }); +}; \ No newline at end of file From 51a8556f44f0a9fdc95811e0cea5c25f9f0b27db Mon Sep 17 00:00:00 2001 From: Sufyan Abbasi Date: Tue, 15 Oct 2024 01:54:06 +0000 Subject: [PATCH 08/57] Set up layer_manager_row test --- js/layer_manager.ts | 4 +- js/layer_manager_row.ts | 6 +- package-lock.json | 6083 +++++++++++++++++++++++++++++-- package.json | 18 +- tests/layer_manager_row.spec.ts | 23 + 5 files changed, 5879 insertions(+), 255 deletions(-) create mode 100644 tests/layer_manager_row.spec.ts diff --git a/js/layer_manager.ts b/js/layer_manager.ts index 842c251466..de25ac8d24 100644 --- a/js/layer_manager.ts +++ b/js/layer_manager.ts @@ -1,4 +1,4 @@ -import type { AnyModel, RenderContext } from "@anywidget/types"; +import type { AnyModel, RenderProps } from "@anywidget/types"; import { html, css, LitElement } from "lit"; import { property } from "lit/decorators.js"; import { legacyStyles } from './ipywidgets_styles'; @@ -94,7 +94,7 @@ if (!customElements.get(LayerManager.componentName)) { customElements.define(LayerManager.componentName, LayerManager); } -async function render({ model, el }: RenderContext) { +async function render({ model, el }: RenderProps) { const manager = document.createElement(LayerManager.componentName); manager.model = model; el.appendChild(manager); diff --git a/js/layer_manager_row.ts b/js/layer_manager_row.ts index e760f0105f..6a977792e9 100644 --- a/js/layer_manager_row.ts +++ b/js/layer_manager_row.ts @@ -1,4 +1,4 @@ -import type { AnyModel, RenderContext } from "@anywidget/types"; +import type { AnyModel, RenderProps } from "@anywidget/types"; import { html, css, LitElement, TemplateResult, nothing } from "lit"; import { property } from "lit/decorators.js"; @@ -6,7 +6,7 @@ import "./common.css"; import { legacyStyles } from './ipywidgets_styles'; import { materialStyles } from "./material_styles"; -interface LayerManagerRowModel { +export interface LayerManagerRowModel { name: string; visible: boolean; opacity: number; @@ -229,7 +229,7 @@ if (!customElements.get(LayerManagerRow.componentName)) { customElements.define(LayerManagerRow.componentName, LayerManagerRow); } -function render({ model, el }: RenderContext) { +function render({ model, el }: RenderProps) { const row = document.createElement(LayerManagerRow.componentName); row.model = model; el.appendChild(row); diff --git a/package-lock.json b/package-lock.json index cab1fced92..8dfd751689 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,10 +9,35 @@ }, "devDependencies": { "@anywidget/types": "^0.1.9", + "@types/jasmine": "^5.1.4", + "@types/jasmine-expect": "^3.8.1", "esbuild": "^0.23.0", + "jasmine": "^5.4.0", + "jasmine-core": "^5.4.0", + "jasmine-spec-reporter": "^7.0.0", + "karma": "^6.4.4", + "karma-chrome-launcher": "^3.2.0", + "karma-jasmine": "^5.1.0", + "karma-jasmine-html-reporter": "^2.1.0", + "karma-typescript": "^5.5.4", + "puppeteer": "^23.5.3", + "puppeteer-core": "^23.5.3", "typescript": "^5.5.3" } }, + "node_modules/@ampproject/remapping": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", + "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", + "dev": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/@anywidget/types": { "version": "0.1.9", "resolved": "https://registry.npmjs.org/@anywidget/types/-/types-0.1.9.tgz", @@ -22,6 +47,310 @@ "@jupyter-widgets/base": "^6.0.7" } }, + "node_modules/@babel/code-frame": { + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.25.7.tgz", + "integrity": "sha512-0xZJFNE5XMpENsgfHYTw8FbX4kv53mFLn2i3XPoq69LyhYSCBJtitaHx9QnsVTrsogI4Z3+HtEfZ2/GFPOtf5g==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.25.7", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.25.8", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.25.8.tgz", + "integrity": "sha512-ZsysZyXY4Tlx+Q53XdnOFmqwfB9QDTHYxaZYajWRoBLuLEAwI2UIbtxOjWh/cFaa9IKUlcB+DDuoskLuKu56JA==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.25.8", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.25.8.tgz", + "integrity": "sha512-Oixnb+DzmRT30qu9d3tJSQkxuygWm32DFykT4bRoORPa9hZ/L4KhVB/XiRm6KG+roIEM7DBQlmg27kw2HZkdZg==", + "dev": true, + "dependencies": { + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.25.7", + "@babel/generator": "^7.25.7", + "@babel/helper-compilation-targets": "^7.25.7", + "@babel/helper-module-transforms": "^7.25.7", + "@babel/helpers": "^7.25.7", + "@babel/parser": "^7.25.8", + "@babel/template": "^7.25.7", + "@babel/traverse": "^7.25.7", + "@babel/types": "^7.25.8", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/core/node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true + }, + "node_modules/@babel/core/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@babel/core/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "node_modules/@babel/generator": { + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.25.7.tgz", + "integrity": "sha512-5Dqpl5fyV9pIAD62yK9P7fcA768uVPUyrQmqpqstHWgMma4feF1x/oFysBCVZLY5wJ2GkMUCdsNDnGZrPoR6rA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.25.7", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", + "jsesc": "^3.0.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.7.tgz", + "integrity": "sha512-DniTEax0sv6isaw6qSQSfV4gVRNtw2rte8HHM45t9ZR0xILaufBRNkpMifCRiAPyvL4ACD6v0gfCwCmtOQaV4A==", + "dev": true, + "dependencies": { + "@babel/compat-data": "^7.25.7", + "@babel/helper-validator-option": "^7.25.7", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.25.7.tgz", + "integrity": "sha512-o0xCgpNmRohmnoWKQ0Ij8IdddjyBFE4T2kagL/x6M3+4zUgc+4qTOUBoNe4XxDskt1HPKO007ZPiMgLDq2s7Kw==", + "dev": true, + "dependencies": { + "@babel/traverse": "^7.25.7", + "@babel/types": "^7.25.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.25.7.tgz", + "integrity": "sha512-k/6f8dKG3yDz/qCwSM+RKovjMix563SLxQFo0UhRNo239SP6n9u5/eLtKD6EAjwta2JHJ49CsD8pms2HdNiMMQ==", + "dev": true, + "dependencies": { + "@babel/helper-module-imports": "^7.25.7", + "@babel/helper-simple-access": "^7.25.7", + "@babel/helper-validator-identifier": "^7.25.7", + "@babel/traverse": "^7.25.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-simple-access": { + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.25.7.tgz", + "integrity": "sha512-FPGAkJmyoChQeM+ruBGIDyrT2tKfZJO8NcxdC+CWNJi7N8/rZpSxK7yvBJ5O/nF1gfu5KzN7VKG3YVSLFfRSxQ==", + "dev": true, + "dependencies": { + "@babel/traverse": "^7.25.7", + "@babel/types": "^7.25.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.7.tgz", + "integrity": "sha512-CbkjYdsJNHFk8uqpEkpCvRs3YRp9tY6FmFY7wLMSYuGYkrdUi7r2lc4/wqsvlHoMznX3WJ9IP8giGPq68T/Y6g==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.7.tgz", + "integrity": "sha512-AM6TzwYqGChO45oiuPqwL2t20/HdMC1rTPAesnBCgPCSF1x3oN9MVUwQV2iyz4xqWrctwK5RNC8LV22kaQCNYg==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.25.7.tgz", + "integrity": "sha512-ytbPLsm+GjArDYXJ8Ydr1c/KJuutjF2besPNbIZnZ6MKUxi/uTA22t2ymmA4WFjZFpjiAMO0xuuJPqK2nvDVfQ==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.25.7.tgz", + "integrity": "sha512-Sv6pASx7Esm38KQpF/U/OXLwPPrdGHNKoeblRxgZRLXnAtnkEe4ptJPDtAZM7fBLadbc1Q07kQpSiGQ0Jg6tRA==", + "dev": true, + "dependencies": { + "@babel/template": "^7.25.7", + "@babel/types": "^7.25.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight": { + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.25.7.tgz", + "integrity": "sha512-iYyACpW3iW8Fw+ZybQK+drQre+ns/tKpXbNESfrhNnPLIklLbXr7MYJ6gPEd0iETGLOK+SxMjVvKb/ffmk+FEw==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.25.7", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.25.8", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.8.tgz", + "integrity": "sha512-HcttkxzdPucv3nNFmfOOMfFf64KgdJVqm1KaCm25dPGMLElo9nsLvXeJECQg8UzPuBGLyTSA0ZzqCtDSzKTEoQ==", + "dev": true, + "dependencies": { + "@babel/types": "^7.25.8" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/template": { + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.7.tgz", + "integrity": "sha512-wRwtAgI3bAS+JGU2upWNL9lSlDcRCqD05BZ1n3X2ONLH1WilFP6O1otQjeMK/1g0pvYcXC7b/qVUB1keofjtZA==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.25.7", + "@babel/parser": "^7.25.7", + "@babel/types": "^7.25.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.7.tgz", + "integrity": "sha512-jatJPT1Zjqvh/1FyJs6qAHL+Dzb7sTb+xr7Q+gM1b+1oBsMsQQ4FkVKb6dFlJvLlVssqkRzV05Jzervt9yhnzg==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.25.7", + "@babel/generator": "^7.25.7", + "@babel/parser": "^7.25.7", + "@babel/template": "^7.25.7", + "@babel/types": "^7.25.7", + "debug": "^4.3.1", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@babel/traverse/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "node_modules/@babel/types": { + "version": "7.25.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.8.tgz", + "integrity": "sha512-JWtuCu8VQsMladxVz/P4HzHUGCAwpuqacmowgXFs5XjxIgKuNjnLokQzuVjlTvIzODaDmpjT3oxcC48vyk9EWg==", + "dev": true, + "dependencies": { + "@babel/helper-string-parser": "^7.25.7", + "@babel/helper-validator-identifier": "^7.25.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@colors/colors": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", + "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", + "dev": true, + "engines": { + "node": ">=0.1.90" + } + }, "node_modules/@esbuild/aix-ppc64": { "version": "0.23.1", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.23.1.tgz", @@ -406,6 +735,80 @@ "node": ">=18" } }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", + "dev": true, + "dependencies": { + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", + "dev": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, "node_modules/@jupyter-widgets/base": { "version": "6.0.10", "resolved": "https://registry.npmjs.org/@jupyter-widgets/base/-/base-6.0.10.tgz", @@ -691,366 +1094,5108 @@ "@lumino/collections": "^2.0.2" } }, - "node_modules/@rjsf/utils": { - "version": "5.21.1", - "resolved": "https://registry.npmjs.org/@rjsf/utils/-/utils-5.21.1.tgz", - "integrity": "sha512-KEwEtIswzKE2WTLRxvh5vwMwvNMTHnRSxwaRlz3QKz5/iQr9XGJTWcmArjIN3y0ypfLk+X6qZsboamQBIhTV3w==", + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", "dev": true, - "dependencies": { - "json-schema-merge-allof": "^0.8.1", - "jsonpointer": "^5.0.1", - "lodash": "^4.17.21", - "lodash-es": "^4.17.21", - "react-is": "^18.2.0" - }, + "optional": true, "engines": { "node": ">=14" - }, - "peerDependencies": { - "react": "^16.14.0 || >=17" } }, - "node_modules/@types/backbone": { - "version": "1.4.14", - "resolved": "https://registry.npmjs.org/@types/backbone/-/backbone-1.4.14.tgz", - "integrity": "sha512-85ldQ99fiYTJFBlZuAJRaCdvTZKZ2p1fSs3fVf+6Ub6k1X0g0hNJ0qJ/2FOByyyAQYLtbEz3shX5taKQfBKBDw==", + "node_modules/@puppeteer/browsers": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-2.4.0.tgz", + "integrity": "sha512-x8J1csfIygOwf6D6qUAZ0ASk3z63zPb7wkNeHRerCMh82qWKUrOgkuP005AJC8lDL6/evtXETGEJVcwykKT4/g==", "dev": true, "dependencies": { - "@types/jquery": "*", - "@types/underscore": "*" + "debug": "^4.3.6", + "extract-zip": "^2.0.1", + "progress": "^2.0.3", + "proxy-agent": "^6.4.0", + "semver": "^7.6.3", + "tar-fs": "^3.0.6", + "unbzip2-stream": "^1.4.3", + "yargs": "^17.7.2" + }, + "bin": { + "browsers": "lib/cjs/main-cli.js" + }, + "engines": { + "node": ">=18" } }, - "node_modules/@types/jquery": { - "version": "3.5.30", - "resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-3.5.30.tgz", - "integrity": "sha512-nbWKkkyb919DOUxjmRVk8vwtDb0/k8FKncmUKFi+NY+QXqWltooxTrswvz4LspQwxvLdvzBN1TImr6cw3aQx2A==", + "node_modules/@puppeteer/browsers/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, - "dependencies": { - "@types/sizzle": "*" + "engines": { + "node": ">=8" } }, - "node_modules/@types/lodash": { - "version": "4.17.9", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.9.tgz", - "integrity": "sha512-w9iWudx1XWOHW5lQRS9iKpK/XuRhnN+0T7HvdCCd802FYkT1AMTnxndJHGrNJwRoRHkslGr4S29tjm1cT7x/7w==", - "dev": true - }, - "node_modules/@types/sizzle": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.8.tgz", - "integrity": "sha512-0vWLNK2D5MT9dg0iOo8GlKguPAU02QjmZitPEsXRuJXU/OGIOt9vT9Fc26wtYuavLxtO45v9PGleoL9Z0k1LHg==", - "dev": true - }, - "node_modules/@types/trusted-types": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz", - "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==" - }, - "node_modules/@types/underscore": { - "version": "1.11.15", - "resolved": "https://registry.npmjs.org/@types/underscore/-/underscore-1.11.15.tgz", - "integrity": "sha512-HP38xE+GuWGlbSRq9WrZkousaQ7dragtZCruBVMi0oX1migFZavZ3OROKHSkNp/9ouq82zrWtZpg18jFnVN96g==", - "dev": true - }, - "node_modules/ajv": { - "version": "8.17.1", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", - "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", + "node_modules/@puppeteer/browsers/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "dependencies": { - "fast-deep-equal": "^3.1.3", - "fast-uri": "^3.0.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2" + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" }, "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/backbone": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/backbone/-/backbone-1.4.0.tgz", - "integrity": "sha512-RLmDrRXkVdouTg38jcgHhyQ/2zjg7a8E6sz2zxfz21Hh17xDJYUHBZimVIt5fUyS8vbfpeSmTL3gUjTEvUV3qQ==", + "node_modules/@puppeteer/browsers/node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", "dev": true, "dependencies": { - "underscore": ">=1.8.3" + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" } }, - "node_modules/compute-gcd": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/compute-gcd/-/compute-gcd-1.2.1.tgz", - "integrity": "sha512-TwMbxBNz0l71+8Sc4czv13h4kEqnchV9igQZBi6QUaz09dnz13juGnnaWWJTRsP3brxOoxeB4SA2WELLw1hCtg==", + "node_modules/@puppeteer/browsers/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "dependencies": { - "validate.io-array": "^1.0.3", - "validate.io-function": "^1.0.2", - "validate.io-integer-array": "^1.0.0" + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" } }, - "node_modules/compute-lcm": { - "version": "1.1.2", + "node_modules/@puppeteer/browsers/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/@puppeteer/browsers/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@puppeteer/browsers/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/@puppeteer/browsers/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "node_modules/@puppeteer/browsers/node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@puppeteer/browsers/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@puppeteer/browsers/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@puppeteer/browsers/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/@puppeteer/browsers/node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@puppeteer/browsers/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/@rjsf/utils": { + "version": "5.21.1", + "resolved": "https://registry.npmjs.org/@rjsf/utils/-/utils-5.21.1.tgz", + "integrity": "sha512-KEwEtIswzKE2WTLRxvh5vwMwvNMTHnRSxwaRlz3QKz5/iQr9XGJTWcmArjIN3y0ypfLk+X6qZsboamQBIhTV3w==", + "dev": true, + "dependencies": { + "json-schema-merge-allof": "^0.8.1", + "jsonpointer": "^5.0.1", + "lodash": "^4.17.21", + "lodash-es": "^4.17.21", + "react-is": "^18.2.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "react": "^16.14.0 || >=17" + } + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.9.5.tgz", + "integrity": "sha512-Dq1bqBdLaZ1Gb/l2e5/+o3B18+8TI9ANlA1SkejZqDgdU/jK/ThYaMPMJpVMMXy2uRHvGKbkz9vheVGdq3cJfA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@socket.io/component-emitter": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.2.tgz", + "integrity": "sha512-9BCxFwvbGg/RsZK9tjXd8s4UcwR0MWeFQ1XEKIQVVvAGJyINdrqKMcTRyLoK8Rse1GjzLV9cwjWV1olXRWEXVA==", + "dev": true + }, + "node_modules/@tootallnate/quickjs-emscripten": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@tootallnate/quickjs-emscripten/-/quickjs-emscripten-0.23.0.tgz", + "integrity": "sha512-C5Mc6rdnsaJDjO3UpGW/CQTHtCKaYlScZTly4JIu97Jxo/odCiH0ITnDXSJPTOrEKk/ycSZ0AOgTmkDtkOsvIA==", + "dev": true + }, + "node_modules/@types/backbone": { + "version": "1.4.14", + "resolved": "https://registry.npmjs.org/@types/backbone/-/backbone-1.4.14.tgz", + "integrity": "sha512-85ldQ99fiYTJFBlZuAJRaCdvTZKZ2p1fSs3fVf+6Ub6k1X0g0hNJ0qJ/2FOByyyAQYLtbEz3shX5taKQfBKBDw==", + "dev": true, + "dependencies": { + "@types/jquery": "*", + "@types/underscore": "*" + } + }, + "node_modules/@types/cookie": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.4.1.tgz", + "integrity": "sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==", + "dev": true + }, + "node_modules/@types/cors": { + "version": "2.8.17", + "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.17.tgz", + "integrity": "sha512-8CGDvrBj1zgo2qE+oS3pOCyYNqCPryMWY2bGfwA0dcfopWGgxs+78df0Rs3rc9THP4JkOhLsAa+15VdpAqkcUA==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/jasmine": { + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/@types/jasmine/-/jasmine-5.1.4.tgz", + "integrity": "sha512-px7OMFO/ncXxixDe1zR13V1iycqWae0MxTaw62RpFlksUi5QuNWgQJFkTQjIOvrmutJbI7Fp2Y2N1F6D2R4G6w==", + "dev": true + }, + "node_modules/@types/jasmine-expect": { + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/@types/jasmine-expect/-/jasmine-expect-3.8.1.tgz", + "integrity": "sha512-th6GNWDqK4lFWDsJrG8KVBRNdZ9GNHFqFUAtFal110OB0ET0v+tJwJ/xHV0i4xRXmohtpcXd3X0whovgbQVteg==", + "deprecated": "This is a stub types definition for jasmine-expect (https://github.com/JamieMason/Jasmine-Matchers). jasmine-expect provides its own type definitions, so you don\\'t need @types/jasmine-expect installed!", + "dev": true, + "dependencies": { + "jasmine-expect": "*" + } + }, + "node_modules/@types/jquery": { + "version": "3.5.30", + "resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-3.5.30.tgz", + "integrity": "sha512-nbWKkkyb919DOUxjmRVk8vwtDb0/k8FKncmUKFi+NY+QXqWltooxTrswvz4LspQwxvLdvzBN1TImr6cw3aQx2A==", + "dev": true, + "dependencies": { + "@types/sizzle": "*" + } + }, + "node_modules/@types/lodash": { + "version": "4.17.9", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.9.tgz", + "integrity": "sha512-w9iWudx1XWOHW5lQRS9iKpK/XuRhnN+0T7HvdCCd802FYkT1AMTnxndJHGrNJwRoRHkslGr4S29tjm1cT7x/7w==", + "dev": true + }, + "node_modules/@types/node": { + "version": "22.7.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.5.tgz", + "integrity": "sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ==", + "dev": true, + "dependencies": { + "undici-types": "~6.19.2" + } + }, + "node_modules/@types/sizzle": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.8.tgz", + "integrity": "sha512-0vWLNK2D5MT9dg0iOo8GlKguPAU02QjmZitPEsXRuJXU/OGIOt9vT9Fc26wtYuavLxtO45v9PGleoL9Z0k1LHg==", + "dev": true + }, + "node_modules/@types/trusted-types": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz", + "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==" + }, + "node_modules/@types/underscore": { + "version": "1.11.15", + "resolved": "https://registry.npmjs.org/@types/underscore/-/underscore-1.11.15.tgz", + "integrity": "sha512-HP38xE+GuWGlbSRq9WrZkousaQ7dragtZCruBVMi0oX1migFZavZ3OROKHSkNp/9ouq82zrWtZpg18jFnVN96g==", + "dev": true + }, + "node_modules/@types/yauzl": { + "version": "2.10.3", + "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.3.tgz", + "integrity": "sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==", + "dev": true, + "optional": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "dev": true, + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/acorn": { + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", + "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-walk": { + "version": "8.3.4", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz", + "integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==", + "dev": true, + "dependencies": { + "acorn": "^8.11.0" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/add-matchers": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/add-matchers/-/add-matchers-0.6.2.tgz", + "integrity": "sha512-hVO2wodMei9RF00qe+506MoeJ/NEOdCMEkSJ12+fC3hx/5Z4zmhNiP92nJEF6XhmXokeB0hOtuQrjHCx2vmXrQ==", + "dev": true + }, + "node_modules/agent-base": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", + "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==", + "dev": true, + "dependencies": { + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/agent-base/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/agent-base/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "node_modules/ajv": { + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", + "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/asn1.js": { + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", + "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", + "dev": true, + "dependencies": { + "bn.js": "^4.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "node_modules/asn1.js/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + }, + "node_modules/assert": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/assert/-/assert-2.1.0.tgz", + "integrity": "sha512-eLHpSK/Y4nhMJ07gDaAzoX/XAKS8PSaojml3M0DM4JpV1LAi5JOJ/p6H/XWrl8L+DzVEvVCW1z3vWAaB9oTsQw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "is-nan": "^1.3.2", + "object-is": "^1.1.5", + "object.assign": "^4.1.4", + "util": "^0.12.5" + } + }, + "node_modules/ast-types": { + "version": "0.13.4", + "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.13.4.tgz", + "integrity": "sha512-x1FCFnFifvYDDzTaLII71vG5uvDwgtmDTEVWAxrgeiR8VjMONcCXJx7E+USjDtHlwFmt9MysbqgF9b9Vjr6w+w==", + "dev": true, + "dependencies": { + "tslib": "^2.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/async": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", + "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", + "dev": true + }, + "node_modules/available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dev": true, + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/b4a": { + "version": "1.6.7", + "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.7.tgz", + "integrity": "sha512-OnAYlL5b7LEkALw87fUVafQw5rVR9RjwGd4KUwNQ6DrrNmaVaUCgLipfVlzrPQ4tWOR9P0IXGNOx50jYCCdSJg==", + "dev": true + }, + "node_modules/backbone": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/backbone/-/backbone-1.4.0.tgz", + "integrity": "sha512-RLmDrRXkVdouTg38jcgHhyQ/2zjg7a8E6sz2zxfz21Hh17xDJYUHBZimVIt5fUyS8vbfpeSmTL3gUjTEvUV3qQ==", + "dev": true, + "dependencies": { + "underscore": ">=1.8.3" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/bare-events": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.5.0.tgz", + "integrity": "sha512-/E8dDe9dsbLyh2qrZ64PEPadOQ0F4gbl1sUJOrmph7xOiIxfY8vwab/4bFLh4Y88/Hk/ujKcrQKc+ps0mv873A==", + "dev": true, + "optional": true + }, + "node_modules/bare-fs": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/bare-fs/-/bare-fs-2.3.5.tgz", + "integrity": "sha512-SlE9eTxifPDJrT6YgemQ1WGFleevzwY+XAP1Xqgl56HtcrisC2CHCZ2tq6dBpcH2TnNxwUEUGhweo+lrQtYuiw==", + "dev": true, + "optional": true, + "dependencies": { + "bare-events": "^2.0.0", + "bare-path": "^2.0.0", + "bare-stream": "^2.0.0" + } + }, + "node_modules/bare-os": { + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/bare-os/-/bare-os-2.4.4.tgz", + "integrity": "sha512-z3UiI2yi1mK0sXeRdc4O1Kk8aOa/e+FNWZcTiPB/dfTWyLypuE99LibgRaQki914Jq//yAWylcAt+mknKdixRQ==", + "dev": true, + "optional": true + }, + "node_modules/bare-path": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/bare-path/-/bare-path-2.1.3.tgz", + "integrity": "sha512-lh/eITfU8hrj9Ru5quUp0Io1kJWIk1bTjzo7JH1P5dWmQ2EL4hFUlfI8FonAhSlgIfhn63p84CDY/x+PisgcXA==", + "dev": true, + "optional": true, + "dependencies": { + "bare-os": "^2.1.0" + } + }, + "node_modules/bare-stream": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/bare-stream/-/bare-stream-2.3.0.tgz", + "integrity": "sha512-pVRWciewGUeCyKEuRxwv06M079r+fRjAQjBEK2P6OYGrO43O+Z0LrPZZEjlc4mB6C2RpZ9AxJ1s7NLEtOHO6eA==", + "dev": true, + "optional": true, + "dependencies": { + "b4a": "^1.6.6", + "streamx": "^2.20.0" + } + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/base64id": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz", + "integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==", + "dev": true, + "engines": { + "node": "^4.5.0 || >= 5.9" + } + }, + "node_modules/basic-ftp": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-5.0.5.tgz", + "integrity": "sha512-4Bcg1P8xhUuqcii/S0Z9wiHIrQVPMermM1any+MX5GeGD7faD3/msQUDGLol9wOcz4/jbg/WJnGqoJF6LiBdtg==", + "dev": true, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/bn.js": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==", + "dev": true + }, + "node_modules/body-parser": { + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", + "dev": true, + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.13.0", + "raw-body": "2.5.2", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==", + "dev": true + }, + "node_modules/browser-resolve": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-2.0.0.tgz", + "integrity": "sha512-7sWsQlYL2rGLy2IWm8WL8DCTJvYLc/qlOnsakDac87SOoCd16WLsaAMdCiAqsTNHIe+SXfaqyxyo6THoWqs8WQ==", + "dev": true, + "dependencies": { + "resolve": "^1.17.0" + } + }, + "node_modules/browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "dev": true, + "dependencies": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/browserify-cipher": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", + "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", + "dev": true, + "dependencies": { + "browserify-aes": "^1.0.4", + "browserify-des": "^1.0.0", + "evp_bytestokey": "^1.0.0" + } + }, + "node_modules/browserify-des": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", + "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", + "dev": true, + "dependencies": { + "cipher-base": "^1.0.1", + "des.js": "^1.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/browserify-rsa": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.1.1.tgz", + "integrity": "sha512-YBjSAiTqM04ZVei6sXighu679a3SqWORA3qZTEqZImnlkDIFtKc6pNutpjyZ8RJTjQtuYfeetkxM11GwoYXMIQ==", + "dev": true, + "dependencies": { + "bn.js": "^5.2.1", + "randombytes": "^2.1.0", + "safe-buffer": "^5.2.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/browserify-sign": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.3.tgz", + "integrity": "sha512-JWCZW6SKhfhjJxO8Tyiiy+XYB7cqd2S5/+WeYHsKdNKFlCBhKbblba1A/HN/90YwtxKc8tCErjffZl++UNmGiw==", + "dev": true, + "dependencies": { + "bn.js": "^5.2.1", + "browserify-rsa": "^4.1.0", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "elliptic": "^6.5.5", + "hash-base": "~3.0", + "inherits": "^2.0.4", + "parse-asn1": "^5.1.7", + "readable-stream": "^2.3.8", + "safe-buffer": "^5.2.1" + }, + "engines": { + "node": ">= 0.12" + } + }, + "node_modules/browserify-sign/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/browserify-sign/node_modules/readable-stream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/browserify-sign/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/browserify-sign/node_modules/string_decoder/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/browserify-zlib": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", + "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", + "dev": true, + "dependencies": { + "pako": "~1.0.5" + } + }, + "node_modules/browserslist": { + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.0.tgz", + "integrity": "sha512-Rmb62sR1Zpjql25eSanFGEhAxcFwfA1K0GuQcLoaJBAcENegrQut3hYdhXFF1obQfiDyqIW/cLM5HSJ/9k884A==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "caniuse-lite": "^1.0.30001663", + "electron-to-chromium": "^1.5.28", + "node-releases": "^2.0.18", + "update-browserslist-db": "^1.1.0" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "node_modules/buffer-crc32": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==", + "dev": true + }, + "node_modules/builtin-status-codes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", + "integrity": "sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ==", + "dev": true + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "dev": true, + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001668", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001668.tgz", + "integrity": "sha512-nWLrdxqCdblixUO+27JtGJJE/txpJlyUy5YN1u53wLZkP0emYCo5zgS6QYft7VUYR42LGgi/S5hdLZTrnyIddw==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ] + }, + "node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dev": true, + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/chromium-bidi": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-0.8.0.tgz", + "integrity": "sha512-uJydbGdTw0DEUjhoogGveneJVWX/9YuqkWePzMmkBYwtdAqo5d3J/ovNKFr+/2hWXYmYCr6it8mSSTIj6SS6Ug==", + "dev": true, + "dependencies": { + "mitt": "3.0.1", + "urlpattern-polyfill": "10.0.0", + "zod": "3.23.8" + }, + "peerDependencies": { + "devtools-protocol": "*" + } + }, + "node_modules/cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dev": true, + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/cliui/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/cliui/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/cliui/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/cliui/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/cliui/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/clone": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", + "dev": true, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/colors": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", + "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", + "dev": true, + "engines": { + "node": ">=0.1.90" + } + }, + "node_modules/combine-source-map": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.8.0.tgz", + "integrity": "sha512-UlxQ9Vw0b/Bt/KYwCFqdEwsQ1eL8d1gibiFb7lxQJFdvTgc2hIZi6ugsg+kyhzhPV+QEpUiEIwInIAIrgoEkrg==", + "dev": true, + "dependencies": { + "convert-source-map": "~1.1.0", + "inline-source-map": "~0.6.0", + "lodash.memoize": "~3.0.3", + "source-map": "~0.5.3" + } + }, + "node_modules/combine-source-map/node_modules/convert-source-map": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz", + "integrity": "sha512-Y8L5rp6jo+g9VEPgvqNfEopjTR4OTYct8lXlS8iVQdmnjDvbdbzYe9rjtFCB9egC86JoNCU61WRY+ScjkZpnIg==", + "dev": true + }, + "node_modules/combine-source-map/node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/compute-gcd": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/compute-gcd/-/compute-gcd-1.2.1.tgz", + "integrity": "sha512-TwMbxBNz0l71+8Sc4czv13h4kEqnchV9igQZBi6QUaz09dnz13juGnnaWWJTRsP3brxOoxeB4SA2WELLw1hCtg==", + "dev": true, + "dependencies": { + "validate.io-array": "^1.0.3", + "validate.io-function": "^1.0.2", + "validate.io-integer-array": "^1.0.0" + } + }, + "node_modules/compute-lcm": { + "version": "1.1.2", "resolved": "https://registry.npmjs.org/compute-lcm/-/compute-lcm-1.1.2.tgz", "integrity": "sha512-OFNPdQAXnQhDSKioX8/XYT6sdUlXwpeMjfd6ApxMJfyZ4GxmLR1xvMERctlYhlHwIiz6CSpBc2+qYKjHGZw4TQ==", "dev": true, "dependencies": { - "compute-gcd": "^1.2.1", - "validate.io-array": "^1.0.3", - "validate.io-function": "^1.0.2", - "validate.io-integer-array": "^1.0.0" + "compute-gcd": "^1.2.1", + "validate.io-array": "^1.0.3", + "validate.io-function": "^1.0.2", + "validate.io-integer-array": "^1.0.0" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "node_modules/connect": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/connect/-/connect-3.7.0.tgz", + "integrity": "sha512-ZqRXc+tZukToSNmh5C2iWMSoV3X1YUcPbqEM4DkEG5tNQXrQUZCNVGGv3IuicnkMtPfGf3Xtp8WCXs295iQ1pQ==", + "dev": true, + "dependencies": { + "debug": "2.6.9", + "finalhandler": "1.1.2", + "parseurl": "~1.3.3", + "utils-merge": "1.0.1" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/console-browserify": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz", + "integrity": "sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==", + "dev": true + }, + "node_modules/constants-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", + "integrity": "sha512-xFxOwqIzR/e1k1gLiWEophSCMqXcwVHIH7akf7b/vxcUeGunlj3hvZaaqxwHsTgn+IndtkQJgSztIDWeumWJDQ==", + "dev": true + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/convert-source-map": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", + "dev": true + }, + "node_modules/cookie": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "dev": true + }, + "node_modules/cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "dev": true, + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/cosmiconfig": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-9.0.0.tgz", + "integrity": "sha512-itvL5h8RETACmOTFc4UfIyB2RfEHi71Ax6E/PivVxq9NseKbOWpeyHEOIbmAw1rs8Ak0VursQNww7lf7YtUwzg==", + "dev": true, + "dependencies": { + "env-paths": "^2.2.1", + "import-fresh": "^3.3.0", + "js-yaml": "^4.1.0", + "parse-json": "^5.2.0" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/d-fischer" + }, + "peerDependencies": { + "typescript": ">=4.9.5" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/create-ecdh": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz", + "integrity": "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==", + "dev": true, + "dependencies": { + "bn.js": "^4.1.0", + "elliptic": "^6.5.3" + } + }, + "node_modules/create-ecdh/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + }, + "node_modules/create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "dev": true, + "dependencies": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "node_modules/create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "dev": true, + "dependencies": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/crypto-browserify": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", + "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", + "dev": true, + "dependencies": { + "browserify-cipher": "^1.0.0", + "browserify-sign": "^4.0.0", + "create-ecdh": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.0", + "diffie-hellman": "^5.0.0", + "inherits": "^2.0.1", + "pbkdf2": "^3.0.3", + "public-encrypt": "^4.0.0", + "randombytes": "^2.0.0", + "randomfill": "^1.0.3" + }, + "engines": { + "node": "*" + } + }, + "node_modules/custom-event": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/custom-event/-/custom-event-1.0.1.tgz", + "integrity": "sha512-GAj5FOq0Hd+RsCGVJxZuKaIDXDf3h6GQoNEjFgbLLI/trgtavwUbSnZ5pVfg27DVCaWjIohryS0JFwIJyT2cMg==", + "dev": true + }, + "node_modules/data-uri-to-buffer": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-6.0.2.tgz", + "integrity": "sha512-7hvf7/GW8e86rW0ptuwS3OcBGDjIi6SZva7hCyWC0yYry2cOPmLIjXAUHI6DK2HsnwJd9ifmt57i8eV2n4YNpw==", + "dev": true, + "engines": { + "node": ">= 14" + } + }, + "node_modules/date-format": { + "version": "4.0.14", + "resolved": "https://registry.npmjs.org/date-format/-/date-format-4.0.14.tgz", + "integrity": "sha512-39BOQLs9ZjKh0/patS9nrT8wc3ioX3/eA/zgbKNopnF2wCqJEoxywwwElATYvRsXdnOxA/OQeQoFZ3rFjVajhg==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/defaults": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", + "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", + "dev": true, + "dependencies": { + "clone": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "dev": true, + "dependencies": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/degenerator": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/degenerator/-/degenerator-5.0.1.tgz", + "integrity": "sha512-TllpMR/t0M5sqCXfj85i4XaAzxmS5tVA16dqvdkMwGmzI+dXLXnw3J+3Vdv7VKw+ThlTMboK6i9rnZ6Nntj5CQ==", + "dev": true, + "dependencies": { + "ast-types": "^0.13.4", + "escodegen": "^2.1.0", + "esprima": "^4.0.1" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/des.js": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.1.0.tgz", + "integrity": "sha512-r17GxjhUCjSRy8aiJpr8/UadFIzMzJGexI3Nmz4ADi9LYSFx4gTBp80+NaX/YsXWWLhpZ7v/v/ubEc/bCNfKwg==", + "dev": true, + "dependencies": { + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "dev": true, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/devtools-protocol": { + "version": "0.0.1342118", + "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1342118.tgz", + "integrity": "sha512-75fMas7PkYNDTmDyb6PRJCH7ILmHLp+BhrZGeMsa4bCh40DTxgCz2NRy5UDzII4C5KuD0oBMZ9vXKhEl6UD/3w==", + "dev": true + }, + "node_modules/di": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/di/-/di-0.0.1.tgz", + "integrity": "sha512-uJaamHkagcZtHPqCIHZxnFrXlunQXgBOsZSUOWwFw31QJCAbyTBoHMW75YOTur5ZNx8pIeAKgf6GWIgaqqiLhA==", + "dev": true + }, + "node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/diffie-hellman": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", + "dev": true, + "dependencies": { + "bn.js": "^4.1.0", + "miller-rabin": "^4.0.0", + "randombytes": "^2.0.0" + } + }, + "node_modules/diffie-hellman/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + }, + "node_modules/dom-serialize": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/dom-serialize/-/dom-serialize-2.2.1.tgz", + "integrity": "sha512-Yra4DbvoW7/Z6LBN560ZwXMjoNOSAN2wRsKFGc4iBeso+mpIA6qj1vfdf9HpMaKAqG6wXTy+1SYEzmNpKXOSsQ==", + "dev": true, + "dependencies": { + "custom-event": "~1.0.0", + "ent": "~2.2.0", + "extend": "^3.0.0", + "void-elements": "^2.0.0" + } + }, + "node_modules/domain-browser": { + "version": "4.23.0", + "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-4.23.0.tgz", + "integrity": "sha512-ArzcM/II1wCCujdCNyQjXrAFwS4mrLh4C7DZWlaI8mdh7h3BfKdNd3bKXITfl2PT9FtfQqaGvhi1vPRQPimjGA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://bevry.me/fund" + } + }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "dev": true + }, + "node_modules/electron-to-chromium": { + "version": "1.5.37", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.37.tgz", + "integrity": "sha512-u7000ZB/X0K78TaQqXZ5ktoR7J79B9US7IkE4zyvcILYwOGY2Tx9GRPYstn7HmuPcMxZ+BDGqIsyLpZQi9ufPw==", + "dev": true + }, + "node_modules/elliptic": { + "version": "6.5.7", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.7.tgz", + "integrity": "sha512-ESVCtTwiA+XhY3wyh24QqRGBoP3rEdDUl3EDUUo9tft074fi19IrdpH7hLCMMP3CIj7jb3W96rn8lt/BqIlt5Q==", + "dev": true, + "dependencies": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/elliptic/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + }, + "node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true + }, + "node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dev": true, + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/engine.io": { + "version": "6.6.2", + "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.6.2.tgz", + "integrity": "sha512-gmNvsYi9C8iErnZdVcJnvCpSKbWTt1E8+JZo8b+daLninywUWi5NQ5STSHZ9rFjFO7imNcvb8Pc5pe/wMR5xEw==", + "dev": true, + "dependencies": { + "@types/cookie": "^0.4.1", + "@types/cors": "^2.8.12", + "@types/node": ">=10.0.0", + "accepts": "~1.3.4", + "base64id": "2.0.0", + "cookie": "~0.7.2", + "cors": "~2.8.5", + "debug": "~4.3.1", + "engine.io-parser": "~5.2.1", + "ws": "~8.17.1" + }, + "engines": { + "node": ">=10.2.0" + } + }, + "node_modules/engine.io-parser": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.2.3.tgz", + "integrity": "sha512-HqD3yTBfnBxIrbnM1DoD6Pcq8NECnh8d4As1Qgh0z5Gg3jRRIqijury0CL3ghu/edArpUYiYqQiDUQBIs4np3Q==", + "dev": true, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/engine.io/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/engine.io/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "node_modules/engine.io/node_modules/ws": { + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", + "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", + "dev": true, + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/ent": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ent/-/ent-2.2.1.tgz", + "integrity": "sha512-QHuXVeZx9d+tIQAz/XztU0ZwZf2Agg9CcXcgE1rurqvdBeDBrpSwjl8/6XUqMg7tw2Y7uAdKb2sRv+bSEFqQ5A==", + "dev": true, + "dependencies": { + "punycode": "^1.4.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/esbuild": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.23.1.tgz", + "integrity": "sha512-VVNz/9Sa0bs5SELtn3f7qhJCDPCF5oMEl5cO9/SSinpE9hbPVvxbd572HH5AKiP7WD8INO53GgfDDhRjkylHEg==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.23.1", + "@esbuild/android-arm": "0.23.1", + "@esbuild/android-arm64": "0.23.1", + "@esbuild/android-x64": "0.23.1", + "@esbuild/darwin-arm64": "0.23.1", + "@esbuild/darwin-x64": "0.23.1", + "@esbuild/freebsd-arm64": "0.23.1", + "@esbuild/freebsd-x64": "0.23.1", + "@esbuild/linux-arm": "0.23.1", + "@esbuild/linux-arm64": "0.23.1", + "@esbuild/linux-ia32": "0.23.1", + "@esbuild/linux-loong64": "0.23.1", + "@esbuild/linux-mips64el": "0.23.1", + "@esbuild/linux-ppc64": "0.23.1", + "@esbuild/linux-riscv64": "0.23.1", + "@esbuild/linux-s390x": "0.23.1", + "@esbuild/linux-x64": "0.23.1", + "@esbuild/netbsd-x64": "0.23.1", + "@esbuild/openbsd-arm64": "0.23.1", + "@esbuild/openbsd-x64": "0.23.1", + "@esbuild/sunos-x64": "0.23.1", + "@esbuild/win32-arm64": "0.23.1", + "@esbuild/win32-ia32": "0.23.1", + "@esbuild/win32-x64": "0.23.1" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "dev": true + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/escodegen": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz", + "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==", + "dev": true, + "dependencies": { + "esprima": "^4.0.1", + "estraverse": "^5.2.0", + "esutils": "^2.0.2" + }, + "bin": { + "escodegen": "bin/escodegen.js", + "esgenerate": "bin/esgenerate.js" + }, + "engines": { + "node": ">=6.0" + }, + "optionalDependencies": { + "source-map": "~0.6.1" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eventemitter3": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", + "dev": true + }, + "node_modules/events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "dev": true, + "engines": { + "node": ">=0.8.x" + } + }, + "node_modules/evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "dev": true, + "dependencies": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true + }, + "node_modules/extract-zip": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", + "integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==", + "dev": true, + "dependencies": { + "debug": "^4.1.1", + "get-stream": "^5.1.0", + "yauzl": "^2.10.0" + }, + "bin": { + "extract-zip": "cli.js" + }, + "engines": { + "node": ">= 10.17.0" + }, + "optionalDependencies": { + "@types/yauzl": "^2.9.1" + } + }, + "node_modules/extract-zip/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/extract-zip/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "node_modules/fast-fifo": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.2.tgz", + "integrity": "sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==", + "dev": true + }, + "node_modules/fast-uri": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.1.tgz", + "integrity": "sha512-MWipKbbYiYI0UC7cl8m/i/IWTqfC8YXsqjzybjddLsFjStroQzsHXkc73JutMvBiXmOvapk+axIl79ig5t55Bw==", + "dev": true + }, + "node_modules/fd-slicer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", + "integrity": "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==", + "dev": true, + "dependencies": { + "pend": "~1.2.0" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/finalhandler": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", + "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", + "dev": true, + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "statuses": "~1.5.0", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/finalhandler/node_modules/on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==", + "dev": true, + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/flatted": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", + "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", + "dev": true + }, + "node_modules/follow-redirects": { + "version": "1.15.9", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", + "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, + "dependencies": { + "is-callable": "^1.1.3" + } + }, + "node_modules/foreground-child": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz", + "integrity": "sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/fs-extra": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", + "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=14.14" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "dev": true, + "dependencies": { + "pump": "^3.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/get-uri": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/get-uri/-/get-uri-6.0.3.tgz", + "integrity": "sha512-BzUrJBS9EcUb4cFol8r4W3v1cPsSyajLSthNkz5BxbpDcHN5tIrM10E2eNvfnvBn3DaT3DUgx0OpsBKkaOpanw==", + "dev": true, + "dependencies": { + "basic-ftp": "^5.0.2", + "data-uri-to-buffer": "^6.0.2", + "debug": "^4.3.4", + "fs-extra": "^11.2.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/get-uri/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/get-uri/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "node_modules/glob": { + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "dev": true, + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "dev": true, + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hash-base": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", + "integrity": "sha512-EeeoJKjTyt868liAlVmcv2ZsUfGHlE3Q+BICOXcZiwN3osr5Q/zFGYmTJpoIzuaSTAwndFy+GqhEwlU4L3j4Ow==", + "dev": true, + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", + "dev": true, + "dependencies": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "dev": true, + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/http-errors/node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/http-proxy": { + "version": "1.18.1", + "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", + "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==", + "dev": true, + "dependencies": { + "eventemitter3": "^4.0.0", + "follow-redirects": "^1.0.0", + "requires-port": "^1.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/http-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", + "dev": true, + "dependencies": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/http-proxy-agent/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/http-proxy-agent/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "node_modules/https-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", + "integrity": "sha512-J+FkSdyD+0mA0N+81tMotaRMfSL9SGi+xpD3T6YApKsc3bGSXJlfXri3VyFOeYkfLRQisDk1W+jIFFKBeUBbBg==", + "dev": true + }, + "node_modules/https-proxy-agent": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz", + "integrity": "sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==", + "dev": true, + "dependencies": { + "agent-base": "^7.0.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/https-proxy-agent/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/https-proxy-agent/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/inline-source-map": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.6.3.tgz", + "integrity": "sha512-1aVsPEsJWMJq/pdMU61CDlm1URcW702MTB4w9/zUjMus6H/Py8o7g68Pr9D4I6QluWGt/KdmswuRhaA05xVR1w==", + "dev": true, + "dependencies": { + "source-map": "~0.5.3" + } + }, + "node_modules/inline-source-map/node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ip-address": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz", + "integrity": "sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==", + "dev": true, + "dependencies": { + "jsbn": "1.1.0", + "sprintf-js": "^1.1.3" + }, + "engines": { + "node": ">= 12" + } + }, + "node_modules/is-arguments": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", + "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-core-module": { + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.1.tgz", + "integrity": "sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==", + "dev": true, + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-generator-function": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", + "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-nan": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/is-nan/-/is-nan-1.3.2.tgz", + "integrity": "sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-typed-array": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", + "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", + "dev": true, + "dependencies": { + "which-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "dev": true + }, + "node_modules/isbinaryfile": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-4.0.10.tgz", + "integrity": "sha512-iHrqe5shvBUcFbmZq9zOQHBoeOhZJu6RQGrDpBgenUm/Am+F3JM2MgQj+rK3Z601fzrL5gLZWtAPH2OBaSVcyw==", + "dev": true, + "engines": { + "node": ">= 8.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/gjtorikian/" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/isomorphic.js": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/isomorphic.js/-/isomorphic.js-0.2.5.tgz", + "integrity": "sha512-PIeMbHqMt4DnUP3MA/Flc0HElYjMXArsw1qwJZcm9sqR8mq3l8NYizFMty0pWwE/tzIGH3EKK5+jes5mAr85yw==", + "dev": true, + "funding": { + "type": "GitHub Sponsors ❤", + "url": "https://github.com/sponsors/dmonad" + } + }, + "node_modules/istanbul-lib-coverage": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-instrument": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz", + "integrity": "sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==", + "dev": true, + "dependencies": { + "@babel/core": "^7.7.5", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.0.0", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-report": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", + "dev": true, + "dependencies": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-report/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-report/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-source-maps": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", + "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", + "dev": true, + "dependencies": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-source-maps/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/istanbul-lib-source-maps/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "node_modules/istanbul-reports": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", + "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", + "dev": true, + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "dev": true, + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/jasmine": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/jasmine/-/jasmine-5.4.0.tgz", + "integrity": "sha512-E2u4ylX5tgGYvbynImU6EUBKKrSVB1L72FEPjGh4M55ov1VsxR26RA2JU91L9YSPFgcjo4mCLyKn/QXvEYGBkA==", + "dev": true, + "dependencies": { + "glob": "^10.2.2", + "jasmine-core": "~5.4.0" + }, + "bin": { + "jasmine": "bin/jasmine.js" + } + }, + "node_modules/jasmine-core": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-5.4.0.tgz", + "integrity": "sha512-T4fio3W++llLd7LGSGsioriDHgWyhoL6YTu4k37uwJLF7DzOzspz7mNxRoM3cQdLWtL/ebazQpIf/yZGJx/gzg==", + "dev": true + }, + "node_modules/jasmine-expect": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/jasmine-expect/-/jasmine-expect-5.0.0.tgz", + "integrity": "sha512-byn1zq0EQBA9UKs5A+H6gk5TRcanV+TqQMRxrjurGuqKkclaqgjw/vV6aT/jtf5tabXGonTH6VDZJ33Z1pxSxw==", + "dev": true, + "dependencies": { + "add-matchers": "0.6.2" + } + }, + "node_modules/jasmine-spec-reporter": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/jasmine-spec-reporter/-/jasmine-spec-reporter-7.0.0.tgz", + "integrity": "sha512-OtC7JRasiTcjsaCBPtMO0Tl8glCejM4J4/dNuOJdA8lBjz4PmWjYQ6pzb0uzpBNAWJMDudYuj9OdXJWqM2QTJg==", + "dev": true, + "dependencies": { + "colors": "1.4.0" + } + }, + "node_modules/jquery": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.1.tgz", + "integrity": "sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg==", + "dev": true + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsbn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz", + "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==", + "dev": true + }, + "node_modules/jsesc": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.0.2.tgz", + "integrity": "sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==", + "dev": true, + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true + }, + "node_modules/json-schema-compare": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/json-schema-compare/-/json-schema-compare-0.2.2.tgz", + "integrity": "sha512-c4WYmDKyJXhs7WWvAWm3uIYnfyWFoIp+JEoX34rctVvEkMYCPGhXtvmFFXiffBbxfZsvQ0RNnV5H7GvDF5HCqQ==", + "dev": true, + "dependencies": { + "lodash": "^4.17.4" + } + }, + "node_modules/json-schema-merge-allof": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/json-schema-merge-allof/-/json-schema-merge-allof-0.8.1.tgz", + "integrity": "sha512-CTUKmIlPJbsWfzRRnOXz+0MjIqvnleIXwFTzz+t9T86HnYX/Rozria6ZVGLktAU9e+NygNljveP+yxqtQp/Q4w==", + "dev": true, + "dependencies": { + "compute-lcm": "^1.1.2", + "json-schema-compare": "^0.2.2", + "lodash": "^4.17.20" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + }, + "node_modules/json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", + "dev": true + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dev": true, + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/jsonpointer": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-5.0.1.tgz", + "integrity": "sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/karma": { + "version": "6.4.4", + "resolved": "https://registry.npmjs.org/karma/-/karma-6.4.4.tgz", + "integrity": "sha512-LrtUxbdvt1gOpo3gxG+VAJlJAEMhbWlM4YrFQgql98FwF7+K8K12LYO4hnDdUkNjeztYrOXEMqgTajSWgmtI/w==", + "dev": true, + "dependencies": { + "@colors/colors": "1.5.0", + "body-parser": "^1.19.0", + "braces": "^3.0.2", + "chokidar": "^3.5.1", + "connect": "^3.7.0", + "di": "^0.0.1", + "dom-serialize": "^2.2.1", + "glob": "^7.1.7", + "graceful-fs": "^4.2.6", + "http-proxy": "^1.18.1", + "isbinaryfile": "^4.0.8", + "lodash": "^4.17.21", + "log4js": "^6.4.1", + "mime": "^2.5.2", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.5", + "qjobs": "^1.2.0", + "range-parser": "^1.2.1", + "rimraf": "^3.0.2", + "socket.io": "^4.7.2", + "source-map": "^0.6.1", + "tmp": "^0.2.1", + "ua-parser-js": "^0.7.30", + "yargs": "^16.1.1" + }, + "bin": { + "karma": "bin/karma" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/karma-chrome-launcher": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/karma-chrome-launcher/-/karma-chrome-launcher-3.2.0.tgz", + "integrity": "sha512-rE9RkUPI7I9mAxByQWkGJFXfFD6lE4gC5nPuZdobf/QdTEJI6EU4yIay/cfU/xV4ZxlM5JiTv7zWYgA64NpS5Q==", + "dev": true, + "dependencies": { + "which": "^1.2.1" + } + }, + "node_modules/karma-chrome-launcher/node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, + "node_modules/karma-jasmine": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/karma-jasmine/-/karma-jasmine-5.1.0.tgz", + "integrity": "sha512-i/zQLFrfEpRyQoJF9fsCdTMOF5c2dK7C7OmsuKg2D0YSsuZSfQDiLuaiktbuio6F2wiCsZSnSnieIQ0ant/uzQ==", + "dev": true, + "dependencies": { + "jasmine-core": "^4.1.0" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "karma": "^6.0.0" + } + }, + "node_modules/karma-jasmine-html-reporter": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/karma-jasmine-html-reporter/-/karma-jasmine-html-reporter-2.1.0.tgz", + "integrity": "sha512-sPQE1+nlsn6Hwb5t+HHwyy0A1FNCVKuL1192b+XNauMYWThz2kweiBVW1DqloRpVvZIJkIoHVB7XRpK78n1xbQ==", + "dev": true, + "peerDependencies": { + "jasmine-core": "^4.0.0 || ^5.0.0", + "karma": "^6.0.0", + "karma-jasmine": "^5.0.0" + } + }, + "node_modules/karma-jasmine/node_modules/jasmine-core": { + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-4.6.1.tgz", + "integrity": "sha512-VYz/BjjmC3klLJlLwA4Kw8ytk0zDSmbbDLNs794VnWmkcCB7I9aAL/D48VNQtmITyPvea2C3jdUMfc3kAoy0PQ==", + "dev": true + }, + "node_modules/karma-typescript": { + "version": "5.5.4", + "resolved": "https://registry.npmjs.org/karma-typescript/-/karma-typescript-5.5.4.tgz", + "integrity": "sha512-D7nQ96xu/UekuqCmiPimnCuOFqp8+BxiND6MU6IJVN37E7DgXzr7SUeTzwuTHtKSYpgxKv4iOTUteYTxpeZL9A==", + "dev": true, + "dependencies": { + "acorn": "^8.1.0", + "acorn-walk": "^8.0.2", + "assert": "^2.0.0", + "async": "^3.0.1", + "browser-resolve": "^2.0.0", + "browserify-zlib": "^0.2.0", + "buffer": "^5.4.3", + "combine-source-map": "^0.8.0", + "console-browserify": "^1.2.0", + "constants-browserify": "^1.0.0", + "convert-source-map": "^1.7.0", + "crypto-browserify": "^3.12.0", + "diff": "^4.0.1", + "domain-browser": "^4.16.0", + "events": "^3.2.0", + "glob": "^7.1.6", + "https-browserify": "^1.0.0", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-instrument": "^4.0.0", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.0.0", + "json-stringify-safe": "^5.0.1", + "lodash": "^4.17.19", + "log4js": "^6.3.0", + "minimatch": "^3.0.4", + "os-browserify": "^0.3.0", + "pad": "^3.2.0", + "path-browserify": "^1.0.0", + "process": "^0.11.10", + "punycode": "^2.1.1", + "querystring-es3": "^0.2.1", + "readable-stream": "^3.1.1", + "source-map": "^0.7.3", + "stream-browserify": "^3.0.0", + "stream-http": "^3.1.0", + "string_decoder": "^1.3.0", + "timers-browserify": "^2.0.11", + "tmp": "^0.2.1", + "tty-browserify": "^0.0.1", + "url": "^0.11.0", + "util": "^0.12.1", + "vm-browserify": "^1.1.2" + }, + "peerDependencies": { + "karma": "1 || 2 || 3 || 4 || 5 || 6", + "typescript": "1 || 2 || 3 || 4 || 5" + } + }, + "node_modules/karma-typescript/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/karma-typescript/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/karma-typescript/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/karma-typescript/node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/karma-typescript/node_modules/source-map": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", + "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/karma/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/karma/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/karma/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/lib0": { + "version": "0.2.97", + "resolved": "https://registry.npmjs.org/lib0/-/lib0-0.2.97.tgz", + "integrity": "sha512-Q4d1ekgvufi9FiHkkL46AhecfNjznSL9MRNoJRQ76gBHS9OqU2ArfQK0FvBpuxgWeJeNI0LVgAYMIpsGeX4gYg==", + "dev": true, + "dependencies": { + "isomorphic.js": "^0.2.4" + }, + "bin": { + "0ecdsa-generate-keypair": "bin/0ecdsa-generate-keypair.js", + "0gentesthtml": "bin/gentesthtml.js", + "0serve": "bin/0serve.js" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "type": "GitHub Sponsors ❤", + "url": "https://github.com/sponsors/dmonad" + } + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true + }, + "node_modules/lit": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/lit/-/lit-3.2.0.tgz", + "integrity": "sha512-s6tI33Lf6VpDu7u4YqsSX78D28bYQulM+VAzsGch4fx2H0eLZnJsUBsPWmGYSGoKDNbjtRv02rio1o+UdPVwvw==", + "dependencies": { + "@lit/reactive-element": "^2.0.4", + "lit-element": "^4.1.0", + "lit-html": "^3.2.0" + } + }, + "node_modules/lit-element": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/lit-element/-/lit-element-4.1.0.tgz", + "integrity": "sha512-gSejRUQJuMQjV2Z59KAS/D4iElUhwKpIyJvZ9w+DIagIQjfJnhR20h2Q5ddpzXGS+fF0tMZ/xEYGMnKmaI/iww==", + "dependencies": { + "@lit-labs/ssr-dom-shim": "^1.2.0", + "@lit/reactive-element": "^2.0.4", + "lit-html": "^3.2.0" + } + }, + "node_modules/lit-html": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/lit-html/-/lit-html-3.2.0.tgz", + "integrity": "sha512-pwT/HwoxqI9FggTrYVarkBKFN9MlTUpLrDHubTmW4SrkL3kkqW5gxwbxMMUnbbRHBC0WTZnYHcjDSCM559VyfA==", + "dependencies": { + "@types/trusted-types": "^2.0.2" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/lodash-es": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", + "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==", + "dev": true + }, + "node_modules/lodash.memoize": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-3.0.4.tgz", + "integrity": "sha512-eDn9kqrAmVUC1wmZvlQ6Uhde44n+tXpqPrN8olQJbttgh0oKclk+SF54P47VEGE9CEiMeRwAP8BaM7UHvBkz2A==", + "dev": true + }, + "node_modules/log4js": { + "version": "6.9.1", + "resolved": "https://registry.npmjs.org/log4js/-/log4js-6.9.1.tgz", + "integrity": "sha512-1somDdy9sChrr9/f4UlzhdaGfDR2c/SaD2a4T7qEkG4jTS57/B3qmnjLYePwQ8cqWnUHZI0iAKxMBpCZICiZ2g==", + "dev": true, + "dependencies": { + "date-format": "^4.0.14", + "debug": "^4.3.4", + "flatted": "^3.2.7", + "rfdc": "^1.3.0", + "streamroller": "^3.1.5" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/log4js/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/log4js/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dev": true, + "peer": true, + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/make-dir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", + "dev": true, + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/make-dir/node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "dev": true, + "dependencies": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "dev": true, + "dependencies": { + "bn.js": "^4.0.0", + "brorand": "^1.0.1" + }, + "bin": { + "miller-rabin": "bin/miller-rabin" + } + }, + "node_modules/miller-rabin/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + }, + "node_modules/mime": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz", + "integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==", + "dev": true, + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dev": true, + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "dev": true + }, + "node_modules/minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==", + "dev": true + }, + "node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/mitt": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mitt/-/mitt-3.0.1.tgz", + "integrity": "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==", + "dev": true + }, + "node_modules/mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "dev": true, + "dependencies": { + "minimist": "^1.2.6" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/netmask": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/netmask/-/netmask-2.0.2.tgz", + "integrity": "sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==", + "dev": true, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/node-releases": { + "version": "2.0.18", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.18.tgz", + "integrity": "sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==", + "dev": true + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", + "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-is": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.6.tgz", + "integrity": "sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.assign": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", + "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "has-symbols": "^1.0.3", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "dev": true, + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/os-browserify": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", + "integrity": "sha512-gjcpUc3clBf9+210TRaDWbf+rZZZEshZ+DlXMRCeAjp0xhTrnQsKHypIy1J3d5hKdUzj69t708EHtU8P6bUn0A==", + "dev": true + }, + "node_modules/pac-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-7.0.2.tgz", + "integrity": "sha512-BFi3vZnO9X5Qt6NRz7ZOaPja3ic0PhlsmCRYLOpN11+mWBCR6XJDqW5RF3j8jm4WGGQZtBA+bTfxYzeKW73eHg==", + "dev": true, + "dependencies": { + "@tootallnate/quickjs-emscripten": "^0.23.0", + "agent-base": "^7.0.2", + "debug": "^4.3.4", + "get-uri": "^6.0.1", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.5", + "pac-resolver": "^7.0.1", + "socks-proxy-agent": "^8.0.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/pac-proxy-agent/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/pac-proxy-agent/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "node_modules/pac-resolver": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/pac-resolver/-/pac-resolver-7.0.1.tgz", + "integrity": "sha512-5NPgf87AT2STgwa2ntRMr45jTKrYBGkVU36yT0ig/n/GMAa3oPqhZfIQ2kMEimReg0+t9kZViDVZ83qfVUlckg==", + "dev": true, + "dependencies": { + "degenerator": "^5.0.0", + "netmask": "^2.0.2" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", + "dev": true + }, + "node_modules/pad": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/pad/-/pad-3.3.0.tgz", + "integrity": "sha512-2/G2Q8J/lbkJ3Zf595U9jattrUkM1rwTr3s4n9smp3+ALe66V+t3I75SG0qjWzuQgmXOgiUS0/qE97S+0hP7Cw==", + "dev": true, + "dependencies": { + "wcwidth": "^1.0.1" + }, + "engines": { + "node": ">= 4.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-linux-x64-gnu": "4.9.5" + } + }, + "node_modules/pako": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", + "dev": true + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/parse-asn1": { + "version": "5.1.7", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.7.tgz", + "integrity": "sha512-CTM5kuWR3sx9IFamcl5ErfPl6ea/N8IYwiJ+vpeB2g+1iknv7zBl5uPwbMbRVznRVbrNY6lGuDoE5b30grmbqg==", + "dev": true, + "dependencies": { + "asn1.js": "^4.10.1", + "browserify-aes": "^1.2.0", + "evp_bytestokey": "^1.0.3", + "hash-base": "~3.0", + "pbkdf2": "^3.1.2", + "safe-buffer": "^5.2.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-browserify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", + "dev": true + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dev": true, + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/path-scurry/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true + }, + "node_modules/pbkdf2": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", + "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", + "dev": true, + "dependencies": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + }, + "engines": { + "node": ">=0.12" + } + }, + "node_modules/pend": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", + "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", + "dev": true + }, + "node_modules/picocolors": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.0.tgz", + "integrity": "sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==", + "dev": true + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/possible-typed-array-names": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", + "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", + "dev": true, + "engines": { + "node": ">= 0.6.0" + } + }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true + }, + "node_modules/progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/proxy-agent": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-6.4.0.tgz", + "integrity": "sha512-u0piLU+nCOHMgGjRbimiXmA9kM/L9EHh3zL81xCdp7m+Y2pHIsnmbdDoEDoAz5geaonNR6q6+yOPQs6n4T6sBQ==", + "dev": true, + "dependencies": { + "agent-base": "^7.0.2", + "debug": "^4.3.4", + "http-proxy-agent": "^7.0.1", + "https-proxy-agent": "^7.0.3", + "lru-cache": "^7.14.1", + "pac-proxy-agent": "^7.0.1", + "proxy-from-env": "^1.1.0", + "socks-proxy-agent": "^8.0.2" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/proxy-agent/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/proxy-agent/node_modules/lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/proxy-agent/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "dev": true + }, + "node_modules/public-encrypt": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", + "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", + "dev": true, + "dependencies": { + "bn.js": "^4.1.0", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "parse-asn1": "^5.0.0", + "randombytes": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/public-encrypt/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + }, + "node_modules/pump": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.2.tgz", + "integrity": "sha512-tUPXtzlGM8FE3P0ZL6DVs/3P58k9nk8/jZeQCurTJylQA8qFYzHFfhBJkuqyE0FifOsQ0uKWekiZ5g8wtr28cw==", + "dev": true, + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==", + "dev": true + }, + "node_modules/puppeteer": { + "version": "23.5.3", + "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-23.5.3.tgz", + "integrity": "sha512-FghmfBsr/UUpe48OiCg1gV3W4vVfQJKjQehbF07SjnQvEpWcvPTah1nykfGWdOQQ1ydJPIXcajzWN7fliCU3zw==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "@puppeteer/browsers": "2.4.0", + "chromium-bidi": "0.8.0", + "cosmiconfig": "^9.0.0", + "devtools-protocol": "0.0.1342118", + "puppeteer-core": "23.5.3", + "typed-query-selector": "^2.12.0" + }, + "bin": { + "puppeteer": "lib/cjs/puppeteer/node/cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/puppeteer-core": { + "version": "23.5.3", + "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-23.5.3.tgz", + "integrity": "sha512-V58MZD/B3CwkYsqSEQlHKbavMJptF04fzhMdUpiCRCmUVhwZNwSGEPhaiZ1f8I3ABQUirg3VNhXVB6Z1ubHXtQ==", + "dev": true, + "dependencies": { + "@puppeteer/browsers": "2.4.0", + "chromium-bidi": "0.8.0", + "debug": "^4.3.7", + "devtools-protocol": "0.0.1342118", + "typed-query-selector": "^2.12.0", + "ws": "^8.18.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/puppeteer-core/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/puppeteer-core/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "node_modules/qjobs": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/qjobs/-/qjobs-1.2.0.tgz", + "integrity": "sha512-8YOJEHtxpySA3fFDyCRxA+UUV+fA+rTWnuWvylOK/NCjhY+b4ocCtmu8TtsWb+mYeU+GCHf/S66KZF/AsteKHg==", + "dev": true, + "engines": { + "node": ">=0.9" + } + }, + "node_modules/qs": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", + "dev": true, + "dependencies": { + "side-channel": "^1.0.6" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/querystring-es3": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", + "integrity": "sha512-773xhDQnZBMFobEiztv8LIl70ch5MSF/jUQVlhwFyBILqq96anmoctVIYz+ZRp0qbCKATTn6ev02M3r7Ga5vqA==", + "dev": true, + "engines": { + "node": ">=0.4.x" + } + }, + "node_modules/querystringify": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", + "dev": true + }, + "node_modules/queue-tick": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/queue-tick/-/queue-tick-1.0.1.tgz", + "integrity": "sha512-kJt5qhMxoszgU/62PLP1CJytzd2NKetjSRnyuj31fDd3Rlcz3fzlFdFLD1SItunPwyqEOkca6GbV612BWfaBag==", + "dev": true + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/randomfill": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", + "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", + "dev": true, + "dependencies": { + "randombytes": "^2.0.5", + "safe-buffer": "^5.1.0" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "dev": true, + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/react": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", + "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", + "dev": true, + "peer": true, + "dependencies": { + "loose-envify": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "dev": true + }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", + "dev": true + }, + "node_modules/resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "dev": true, + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/rfdc": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz", + "integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==", + "dev": true + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rimraf/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/rimraf/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rimraf/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "dev": true, + "dependencies": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==", + "dev": true + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "dev": true + }, + "node_modules/sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "dev": true, + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + }, + "bin": { + "sha.js": "bin.js" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/side-channel": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/smart-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "dev": true, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socket.io": { + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.8.0.tgz", + "integrity": "sha512-8U6BEgGjQOfGz3HHTYaC/L1GaxDCJ/KM0XTkJly0EhZ5U/du9uNEZy4ZgYzEzIqlx2CMm25CrCqr1ck899eLNA==", + "dev": true, + "dependencies": { + "accepts": "~1.3.4", + "base64id": "~2.0.0", + "cors": "~2.8.5", + "debug": "~4.3.2", + "engine.io": "~6.6.0", + "socket.io-adapter": "~2.5.2", + "socket.io-parser": "~4.2.4" + }, + "engines": { + "node": ">=10.2.0" + } + }, + "node_modules/socket.io-adapter": { + "version": "2.5.5", + "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.5.5.tgz", + "integrity": "sha512-eLDQas5dzPgOWCk9GuuJC2lBqItuhKI4uxGgo9aIV7MYbk2h9Q6uULEh8WBzThoI7l+qU9Ast9fVUmkqPP9wYg==", + "dev": true, + "dependencies": { + "debug": "~4.3.4", + "ws": "~8.17.1" + } + }, + "node_modules/socket.io-adapter/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/socket.io-adapter/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "node_modules/socket.io-adapter/node_modules/ws": { + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", + "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", + "dev": true, + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/socket.io-parser": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.4.tgz", + "integrity": "sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew==", + "dev": true, + "dependencies": { + "@socket.io/component-emitter": "~3.1.0", + "debug": "~4.3.1" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/socket.io-parser/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/socket.io-parser/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "node_modules/socket.io/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, - "node_modules/esbuild": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.23.1.tgz", - "integrity": "sha512-VVNz/9Sa0bs5SELtn3f7qhJCDPCF5oMEl5cO9/SSinpE9hbPVvxbd572HH5AKiP7WD8INO53GgfDDhRjkylHEg==", + "node_modules/socket.io/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "node_modules/socks": { + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.3.tgz", + "integrity": "sha512-l5x7VUUWbjVFbafGLxPWkYsHIhEvmF85tbIeFZWc8ZPtoMyybuEhL7Jye/ooC4/d48FgOjSJXgsF/AJPYCW8Zw==", "dev": true, - "hasInstallScript": true, - "bin": { - "esbuild": "bin/esbuild" + "dependencies": { + "ip-address": "^9.0.5", + "smart-buffer": "^4.2.0" }, "engines": { - "node": ">=18" + "node": ">= 10.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks-proxy-agent": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.4.tgz", + "integrity": "sha512-GNAq/eg8Udq2x0eNiFkr9gRg5bA7PXEWagQdeRX4cPSG+X/8V38v637gim9bjFptMk1QWsCTr0ttrJEiXbNnRw==", + "dev": true, + "dependencies": { + "agent-base": "^7.1.1", + "debug": "^4.3.4", + "socks": "^2.8.3" }, - "optionalDependencies": { - "@esbuild/aix-ppc64": "0.23.1", - "@esbuild/android-arm": "0.23.1", - "@esbuild/android-arm64": "0.23.1", - "@esbuild/android-x64": "0.23.1", - "@esbuild/darwin-arm64": "0.23.1", - "@esbuild/darwin-x64": "0.23.1", - "@esbuild/freebsd-arm64": "0.23.1", - "@esbuild/freebsd-x64": "0.23.1", - "@esbuild/linux-arm": "0.23.1", - "@esbuild/linux-arm64": "0.23.1", - "@esbuild/linux-ia32": "0.23.1", - "@esbuild/linux-loong64": "0.23.1", - "@esbuild/linux-mips64el": "0.23.1", - "@esbuild/linux-ppc64": "0.23.1", - "@esbuild/linux-riscv64": "0.23.1", - "@esbuild/linux-s390x": "0.23.1", - "@esbuild/linux-x64": "0.23.1", - "@esbuild/netbsd-x64": "0.23.1", - "@esbuild/openbsd-arm64": "0.23.1", - "@esbuild/openbsd-x64": "0.23.1", - "@esbuild/sunos-x64": "0.23.1", - "@esbuild/win32-arm64": "0.23.1", - "@esbuild/win32-ia32": "0.23.1", - "@esbuild/win32-x64": "0.23.1" + "engines": { + "node": ">= 14" } }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true + "node_modules/socks-proxy-agent/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } }, - "node_modules/fast-uri": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.1.tgz", - "integrity": "sha512-MWipKbbYiYI0UC7cl8m/i/IWTqfC8YXsqjzybjddLsFjStroQzsHXkc73JutMvBiXmOvapk+axIl79ig5t55Bw==", + "node_modules/socks-proxy-agent/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, - "node_modules/isomorphic.js": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/isomorphic.js/-/isomorphic.js-0.2.5.tgz", - "integrity": "sha512-PIeMbHqMt4DnUP3MA/Flc0HElYjMXArsw1qwJZcm9sqR8mq3l8NYizFMty0pWwE/tzIGH3EKK5+jes5mAr85yw==", + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, - "funding": { - "type": "GitHub Sponsors ❤", - "url": "https://github.com/sponsors/dmonad" + "engines": { + "node": ">=0.10.0" } }, - "node_modules/jquery": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.1.tgz", - "integrity": "sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg==", + "node_modules/sprintf-js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", + "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==", "dev": true }, - "node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "node_modules/statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/stream-browserify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-3.0.0.tgz", + "integrity": "sha512-H73RAHsVBapbim0tU2JwwOiXUj+fikfiaoYAKHF3VJfA0pe2BCzkhAHBlLG6REzE+2WNZcxOXjK7lkso+9euLA==", "dev": true, - "peer": true + "dependencies": { + "inherits": "~2.0.4", + "readable-stream": "^3.5.0" + } }, - "node_modules/json-schema-compare": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/json-schema-compare/-/json-schema-compare-0.2.2.tgz", - "integrity": "sha512-c4WYmDKyJXhs7WWvAWm3uIYnfyWFoIp+JEoX34rctVvEkMYCPGhXtvmFFXiffBbxfZsvQ0RNnV5H7GvDF5HCqQ==", + "node_modules/stream-http": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-3.2.0.tgz", + "integrity": "sha512-Oq1bLqisTyK3TSCXpPbT4sdeYNdmyZJv1LxpEm2vu1ZhK89kSE5YXwZc3cWk0MagGaKriBh9mCFbVGtO+vY29A==", "dev": true, "dependencies": { - "lodash": "^4.17.4" + "builtin-status-codes": "^3.0.0", + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "xtend": "^4.0.2" } }, - "node_modules/json-schema-merge-allof": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/json-schema-merge-allof/-/json-schema-merge-allof-0.8.1.tgz", - "integrity": "sha512-CTUKmIlPJbsWfzRRnOXz+0MjIqvnleIXwFTzz+t9T86HnYX/Rozria6ZVGLktAU9e+NygNljveP+yxqtQp/Q4w==", + "node_modules/streamroller": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/streamroller/-/streamroller-3.1.5.tgz", + "integrity": "sha512-KFxaM7XT+irxvdqSP1LGLgNWbYN7ay5owZ3r/8t77p+EtSUAfUgtl7be3xtqtOmGUl9K9YPO2ca8133RlTjvKw==", "dev": true, "dependencies": { - "compute-lcm": "^1.1.2", - "json-schema-compare": "^0.2.2", - "lodash": "^4.17.20" + "date-format": "^4.0.14", + "debug": "^4.3.4", + "fs-extra": "^8.1.0" }, "engines": { - "node": ">=12.0.0" + "node": ">=8.0" } }, - "node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "node_modules/streamroller/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/streamroller/node_modules/fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "engines": { + "node": ">=6 <7 || >=8" + } + }, + "node_modules/streamroller/node_modules/jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", + "dev": true, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/streamroller/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, - "node_modules/json5": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", - "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "node_modules/streamroller/node_modules/universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", "dev": true, - "bin": { - "json5": "lib/cli.js" + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/streamx": { + "version": "2.20.1", + "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.20.1.tgz", + "integrity": "sha512-uTa0mU6WUC65iUvzKH4X9hEdvSW7rbPxPtwfWiLMSj3qTdQbAiUboZTxauKfpFuGIGa1C2BYijZ7wgdUXICJhA==", + "dev": true, + "dependencies": { + "fast-fifo": "^1.3.2", + "queue-tick": "^1.0.1", + "text-decoder": "^1.1.0" + }, + "optionalDependencies": { + "bare-events": "^2.2.0" + } + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" }, "engines": { - "node": ">=6" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/jsonpointer": { + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/ansi-regex": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-5.0.1.tgz", - "integrity": "sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ==", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, - "node_modules/lib0": { - "version": "0.2.97", - "resolved": "https://registry.npmjs.org/lib0/-/lib0-0.2.97.tgz", - "integrity": "sha512-Q4d1ekgvufi9FiHkkL46AhecfNjznSL9MRNoJRQ76gBHS9OqU2ArfQK0FvBpuxgWeJeNI0LVgAYMIpsGeX4gYg==", + "node_modules/string-width-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/string-width-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "dependencies": { - "isomorphic.js": "^0.2.4" + "ansi-regex": "^5.0.1" }, - "bin": { - "0ecdsa-generate-keypair": "bin/0ecdsa-generate-keypair.js", - "0gentesthtml": "bin/gentesthtml.js", - "0serve": "bin/0serve.js" + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "dependencies": { + "ansi-regex": "^6.0.1" }, "engines": { - "node": ">=16" + "node": ">=12" }, "funding": { - "type": "GitHub Sponsors ❤", - "url": "https://github.com/sponsors/dmonad" + "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, - "node_modules/lit": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/lit/-/lit-3.2.0.tgz", - "integrity": "sha512-s6tI33Lf6VpDu7u4YqsSX78D28bYQulM+VAzsGch4fx2H0eLZnJsUBsPWmGYSGoKDNbjtRv02rio1o+UdPVwvw==", + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, "dependencies": { - "@lit/reactive-element": "^2.0.4", - "lit-element": "^4.1.0", - "lit-html": "^3.2.0" + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" } }, - "node_modules/lit-element": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/lit-element/-/lit-element-4.1.0.tgz", - "integrity": "sha512-gSejRUQJuMQjV2Z59KAS/D4iElUhwKpIyJvZ9w+DIagIQjfJnhR20h2Q5ddpzXGS+fF0tMZ/xEYGMnKmaI/iww==", + "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, "dependencies": { - "@lit-labs/ssr-dom-shim": "^1.2.0", - "@lit/reactive-element": "^2.0.4", - "lit-html": "^3.2.0" + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" } }, - "node_modules/lit-html": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/lit-html/-/lit-html-3.2.0.tgz", - "integrity": "sha512-pwT/HwoxqI9FggTrYVarkBKFN9MlTUpLrDHubTmW4SrkL3kkqW5gxwbxMMUnbbRHBC0WTZnYHcjDSCM559VyfA==", + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/tar-fs": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.0.6.tgz", + "integrity": "sha512-iokBDQQkUyeXhgPYaZxmczGPhnhXZ0CmrqI+MOb/WFGS9DW5wnfrLgtjUJBvz50vQ3qfRwJ62QVoCFu8mPVu5w==", + "dev": true, "dependencies": { - "@types/trusted-types": "^2.0.2" + "pump": "^3.0.0", + "tar-stream": "^3.1.5" + }, + "optionalDependencies": { + "bare-fs": "^2.1.1", + "bare-path": "^2.1.0" } }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true + "node_modules/tar-stream": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.7.tgz", + "integrity": "sha512-qJj60CXt7IU1Ffyc3NJMjh6EkuCFej46zUqJ4J7pqYlThyd9bO0XBTmcOIhSzZJVWfsLks0+nle/j538YAW9RQ==", + "dev": true, + "dependencies": { + "b4a": "^1.6.4", + "fast-fifo": "^1.2.0", + "streamx": "^2.15.0" + } }, - "node_modules/lodash-es": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", - "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==", + "node_modules/text-decoder": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/text-decoder/-/text-decoder-1.2.0.tgz", + "integrity": "sha512-n1yg1mOj9DNpk3NeZOx7T6jchTbyJS3i3cucbNN6FcdPriMZx7NsgrGpWWdWZZGxD7ES1XB+3uoqHMgOKaN+fg==", + "dev": true, + "dependencies": { + "b4a": "^1.6.4" + } + }, + "node_modules/through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", "dev": true }, - "node_modules/loose-envify": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", - "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "node_modules/timers-browserify": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.12.tgz", + "integrity": "sha512-9phl76Cqm6FhSX9Xe1ZUAMLtm1BLkKj2Qd5ApyWkXzsMRaA7dgr81kf4wJmQf/hAvg8EEyJxDo3du/0KlhPiKQ==", "dev": true, - "peer": true, "dependencies": { - "js-tokens": "^3.0.0 || ^4.0.0" + "setimmediate": "^1.0.4" }, - "bin": { - "loose-envify": "cli.js" + "engines": { + "node": ">=0.6.0" } }, - "node_modules/minimist": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", - "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "node_modules/tmp": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.3.tgz", + "integrity": "sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w==", "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "engines": { + "node": ">=14.14" } }, - "node_modules/path-browserify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", - "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", - "dev": true - }, - "node_modules/querystringify": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", - "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", - "dev": true + "node_modules/to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", + "dev": true, + "engines": { + "node": ">=4" + } }, - "node_modules/react": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", - "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, - "peer": true, "dependencies": { - "loose-envify": "^1.1.0" + "is-number": "^7.0.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=8.0" } }, - "node_modules/react-is": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", - "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "dev": true, + "engines": { + "node": ">=0.6" + } + }, + "node_modules/tslib": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", + "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", "dev": true }, - "node_modules/require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "node_modules/tty-browserify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.1.tgz", + "integrity": "sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw==", + "dev": true + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", "dev": true, + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, "engines": { - "node": ">=0.10.0" + "node": ">= 0.6" } }, - "node_modules/requires-port": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", + "node_modules/typed-query-selector": { + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/typed-query-selector/-/typed-query-selector-2.12.0.tgz", + "integrity": "sha512-SbklCd1F0EiZOyPiW192rrHZzZ5sBijB6xM+cpmrwDqObvdtunOHHIk9fCGsoK5JVIYXoyEp4iEdE3upFH3PAg==", "dev": true }, "node_modules/typescript": { @@ -1066,12 +6211,115 @@ "node": ">=14.17" } }, + "node_modules/ua-parser-js": { + "version": "0.7.39", + "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.39.tgz", + "integrity": "sha512-IZ6acm6RhQHNibSt7+c09hhvsKy9WUr4DVbeq9U8o71qxyYtJpQeDxQnMrVqnIFMLcQjHO0I9wgfO2vIahht4w==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/ua-parser-js" + }, + { + "type": "paypal", + "url": "https://paypal.me/faisalman" + }, + { + "type": "github", + "url": "https://github.com/sponsors/faisalman" + } + ], + "bin": { + "ua-parser-js": "script/cli.js" + }, + "engines": { + "node": "*" + } + }, + "node_modules/unbzip2-stream": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.4.3.tgz", + "integrity": "sha512-mlExGW4w71ebDJviH16lQLtZS32VKqsSfk80GCfUlwT/4/hNRFsoscrF/c++9xinkMzECL1uL9DDwXqFWkruPg==", + "dev": true, + "dependencies": { + "buffer": "^5.2.1", + "through": "^2.3.8" + } + }, "node_modules/underscore": { "version": "1.13.7", "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.7.tgz", "integrity": "sha512-GMXzWtsc57XAtguZgaQViUOzs0KTkk8ojr3/xAxXLITqf/3EMwxC0inyETfDFjH/Krbhuep0HNbbjI9i/q3F3g==", "dev": true }, + "node_modules/undici-types": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "dev": true + }, + "node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "dev": true, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.1.tgz", + "integrity": "sha512-R8UzCaa9Az+38REPiJ1tXlImTJXlVfgHZsglwBD/k6nj76ctsH1E3q4doGrukiLQd3sGQYu56r5+lo5r94l29A==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.0" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/url": { + "version": "0.11.4", + "resolved": "https://registry.npmjs.org/url/-/url-0.11.4.tgz", + "integrity": "sha512-oCwdVC7mTuWiPyjLUz/COz5TLk6wgp0RCsN+wHZ2Ekneac9w8uuV0njcbbie2ME+Vs+d6duwmYuR3HgQXs1fOg==", + "dev": true, + "dependencies": { + "punycode": "^1.4.1", + "qs": "^6.12.3" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/url-parse": { "version": "1.5.10", "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", @@ -1082,6 +6330,40 @@ "requires-port": "^1.0.0" } }, + "node_modules/urlpattern-polyfill": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/urlpattern-polyfill/-/urlpattern-polyfill-10.0.0.tgz", + "integrity": "sha512-H/A06tKD7sS1O1X2SshBVeA5FLycRpjqiBeqGKmBwBDBy28EnRjORxTNe269KSSr5un5qyWi1iL61wLxpd+ZOg==", + "dev": true + }, + "node_modules/util": { + "version": "0.12.5", + "resolved": "https://registry.npmjs.org/util/-/util-0.12.5.tgz", + "integrity": "sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==", + "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "is-arguments": "^1.0.4", + "is-generator-function": "^1.0.7", + "is-typed-array": "^1.1.3", + "which-typed-array": "^1.1.2" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "dev": true, + "engines": { + "node": ">= 0.4.0" + } + }, "node_modules/validate.io-array": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/validate.io-array/-/validate.io-array-1.0.6.tgz", @@ -1119,6 +6401,200 @@ "integrity": "sha512-kRAyotcbNaSYoDnXvb4MHg/0a1egJdLwS6oJ38TJY7aw9n93Fl/3blIXdyYvPOp55CNxywooG/3BcrwNrBpcSg==", "dev": true }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/vm-browserify": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", + "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==", + "dev": true + }, + "node_modules/void-elements": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-2.0.1.tgz", + "integrity": "sha512-qZKX4RnBzH2ugr8Lxa7x+0V6XD9Sb/ouARtiasEQCHB1EVU4NXtmHsDDrx1dO4ne5fc3J6EW05BP1Dl0z0iung==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wcwidth": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", + "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", + "dev": true, + "dependencies": { + "defaults": "^1.0.3" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/which-typed-array": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz", + "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/wrap-ansi-cjs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true + }, "node_modules/ws": { "version": "8.18.0", "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", @@ -1140,6 +6616,15 @@ } } }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true, + "engines": { + "node": ">=0.4" + } + }, "node_modules/y-protocols": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/y-protocols/-/y-protocols-1.0.6.tgz", @@ -1160,6 +6645,99 @@ "yjs": "^13.0.0" } }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true + }, + "node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/yargs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yauzl": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", + "integrity": "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==", + "dev": true, + "dependencies": { + "buffer-crc32": "~0.2.3", + "fd-slicer": "~1.1.0" + } + }, "node_modules/yjs": { "version": "13.6.19", "resolved": "https://registry.npmjs.org/yjs/-/yjs-13.6.19.tgz", @@ -1176,6 +6754,15 @@ "type": "GitHub Sponsors ❤", "url": "https://github.com/sponsors/dmonad" } + }, + "node_modules/zod": { + "version": "3.23.8", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.23.8.tgz", + "integrity": "sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } } } } diff --git a/package.json b/package.json index 3e30bd2b69..956f6a8ef4 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,29 @@ { "scripts": { "dev": "npm run build -- --sourcemap=inline --watch", - "build": "esbuild js/*.ts --format=esm --bundle --outdir=geemap/static", - "typecheck": "tsc --noEmit" + "build": "esbuild js/*.ts --minify --format=esm --bundle --outdir=geemap/static", + "typecheck": "tsc --noEmit", + "test": "karma start karma.conf.js --single-run --watch=false", + "test:debug": "karma start karma.conf.js" }, "dependencies": { "lit": "^3.2.0" }, "devDependencies": { "@anywidget/types": "^0.1.9", + "@types/jasmine": "^5.1.4", + "@types/jasmine-expect": "^3.8.1", "esbuild": "^0.23.0", + "jasmine": "^5.4.0", + "jasmine-core": "^5.4.0", + "jasmine-spec-reporter": "^7.0.0", + "karma": "^6.4.4", + "karma-chrome-launcher": "^3.2.0", + "karma-jasmine": "^5.1.0", + "karma-jasmine-html-reporter": "^2.1.0", + "karma-typescript": "^5.5.4", + "puppeteer": "^23.5.3", + "puppeteer-core": "^23.5.3", "typescript": "^5.5.3" } } diff --git a/tests/layer_manager_row.spec.ts b/tests/layer_manager_row.spec.ts new file mode 100644 index 0000000000..60dc15d506 --- /dev/null +++ b/tests/layer_manager_row.spec.ts @@ -0,0 +1,23 @@ +import '../js/layer_manager_row'; +import { default as rowRender, LayerManagerRow, LayerManagerRowModel } from '../js/layer_manager_row'; + +describe('', () => { + async function makeRow(model: LayerManagerRowModel) { + const container = document.createElement('div'); + rowRender(model, container); + const element = container.firstElementChild as LayerManagerRow; + document.body.appendChild(element); + await element.updateComplete; + return element; + } + + it('can be instantiated', async () => { + const row = await makeRow({ + name: 'Test Layer', + visible: true, + opacity: 1, + is_loading: false, + }); + expect(row.querySelector('layer-name')?.textContent).toContain('Test Row'); + }); +}); \ No newline at end of file From cdd5040f687757e409ed4eb59e49b22452ba920c Mon Sep 17 00:00:00 2001 From: Nathaniel Schmitz Date: Thu, 10 Oct 2024 13:17:53 -0400 Subject: [PATCH 09/57] Implement LayerManager using LitElement + anywidget --- .gitignore | 1 + geemap/core.py | 12 +- geemap/map_widgets.py | 463 +++-------- geemap/static/ipywidgets_styles.js | 94 +++ geemap/static/layer_manager.css | 2 + geemap/static/layer_manager.js | 192 +++++ geemap/static/layer_manager_row.css | 2 + geemap/static/layer_manager_row.js | 304 +++++++ geemap/static/material_styles.js | 63 ++ geemap/static/utils.js | 2 + js/common.css | 1 + js/ipywidgets_styles.ts | 56 ++ js/layer_manager.ts | 108 +++ js/layer_manager_row.ts | 238 ++++++ js/material_styles.ts | 25 + js/utils.ts | 20 + package-lock.json | 1181 +++++++++++++++++++++++++++ package.json | 15 + pyproject.toml | 41 +- tests/fake_map.py | 23 +- tests/test_map_widgets.py | 334 ++++---- tsconfig.json | 27 + 22 files changed, 2664 insertions(+), 540 deletions(-) create mode 100644 geemap/static/ipywidgets_styles.js create mode 100644 geemap/static/layer_manager.css create mode 100644 geemap/static/layer_manager.js create mode 100644 geemap/static/layer_manager_row.css create mode 100644 geemap/static/layer_manager_row.js create mode 100644 geemap/static/material_styles.js create mode 100644 geemap/static/utils.js create mode 100644 js/common.css create mode 100644 js/ipywidgets_styles.ts create mode 100644 js/layer_manager.ts create mode 100644 js/layer_manager_row.ts create mode 100644 js/material_styles.ts create mode 100644 js/utils.ts create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 tsconfig.json diff --git a/.gitignore b/.gitignore index ef3ab1d719..bdc8de7a19 100644 --- a/.gitignore +++ b/.gitignore @@ -38,6 +38,7 @@ eggs/ .eggs/ lib/ lib64/ +node_modules/ parts/ sdist/ var/ diff --git a/geemap/core.py b/geemap/core.py index c332882f86..28d566e18b 100644 --- a/geemap/core.py +++ b/geemap/core.py @@ -926,14 +926,10 @@ def _on_toggle_toolbar_layers(self, is_open: bool) -> None: if self._layer_manager: return - def _on_open_vis(layer_name: str) -> None: - layer = self.ee_layers.get(layer_name, None) - self._add_layer_editor(position="bottomright", layer_dict=layer) - layer_manager = map_widgets.LayerManager(self) layer_manager.header_hidden = True layer_manager.close_button_hidden = True - layer_manager.on_open_vis = _on_open_vis + layer_manager.refresh_layers() self._toolbar.accessory_widget = layer_manager else: self._toolbar.accessory_widget = None @@ -949,13 +945,9 @@ def _add_layer_manager(self, position: str, **kwargs: Any) -> None: if self._layer_manager: return - def _on_open_vis(layer_name: str) -> None: - layer = self.ee_layers.get(layer_name, None) - self._add_layer_editor(position="bottomright", layer_dict=layer) - layer_manager = map_widgets.LayerManager(self, **kwargs) layer_manager.on_close = lambda: self.remove("layer_manager") - layer_manager.on_open_vis = _on_open_vis + layer_manager.refresh_layers() layer_manager_control = ipyleaflet.WidgetControl( widget=layer_manager, position=position ) diff --git a/geemap/map_widgets.py b/geemap/map_widgets.py index eeaa3c19f2..e091466491 100644 --- a/geemap/map_widgets.py +++ b/geemap/map_widgets.py @@ -1,20 +1,28 @@ """Various ipywidgets that can be added to a map.""" import functools -from typing import Any, Dict, List, Optional, Tuple, Union - +import pathlib +from typing import Any, Callable, Dict, List, Optional, Tuple, Union import IPython from IPython.display import HTML, display +import anywidget import ee -import ipyevents import ipytree import ipywidgets +import traitlets from . import coreutils +class TypedTuple(traitlets.Container): + """A trait for a tuple of any length with type-checked elements.""" + + klass = tuple + _cast_types = (list,) + + def _set_css_in_cell_output(info: Any) -> None: """Sets CSS styles in the cell output for different themes. @@ -878,361 +886,140 @@ def _objects_info(self, latlon: List[float]) -> ipytree.Node: return self._root_node("Objects", nodes) -@Theme.apply -class LayerManager(ipywidgets.VBox): - """A layer manager widget for managing map layers.""" +class LayerManagerRow(anywidget.AnyWidget): + """A layer manager row widget for geemap.""" - def __init__(self, host_map: "geemap.Map"): - """Initializes a layer manager widget. + _esm = pathlib.Path(__file__).parent / "static" / "layer_manager_row.js" + _css = pathlib.Path(__file__).parent / "static" / "layer_manager_row.css" - Args: - host_map (geemap.Map): The geemap.Map object. - """ - self._host_map = host_map - if not host_map: - raise ValueError("Must pass a valid map when creating a layer manager.") + name = traitlets.Unicode("").tag(sync=True) + visible = traitlets.Bool(True).tag(sync=True) + opacity = traitlets.Float(1).tag(sync=True) + is_loading = traitlets.Bool(False).tag(sync=True) - self._collapse_button = ipywidgets.ToggleButton( - value=False, - tooltip="Layer Manager", - icon="server", - layout=ipywidgets.Layout( - width="28px", height="28px", padding="0px 0px 0px 4px" - ), - ) - self._close_button = ipywidgets.Button( - tooltip="Close the tool", - icon="times", - button_style="primary", - layout=ipywidgets.Layout(width="28px", height="28px", padding="0px"), - ) + def __init__(self, host_map: "core.MapInterface", layer: Any): + super().__init__() + self.host_map = host_map + self.layer = layer + if not host_map or not layer: + raise ValueError( + "Must pass a valid map and layer when creating a layer manager row." + ) - self._toolbar_header = ipywidgets.HBox( - children=[self._close_button, self._collapse_button] - ) - self._toolbar_footer = ipywidgets.VBox(children=[]) + self.name = layer.name + self.visible = self._get_layer_visibility() + self.opacity = self._get_layer_opacity() + + self.opacity_link: Optional[ipywidgets.widget_link.Link] = None + self.visibility_link: Optional[ipywidgets.widget_link.Link] = None + self._setup_event_listeners() + + def _can_set_up_jslink(self, obj: Any, trait: str) -> bool: + return isinstance(obj, ipywidgets.Widget) and hasattr(obj, trait) + + def _traitlet_link_type(self) -> Callable[..., Any]: + if coreutils.in_colab_shell(): + # TODO: jslink doesn't work in Colab before the layers are added to the map. + # A potential workaround is calling display() on the layer before jslinking. + return ipywidgets.link + return ipywidgets.jslink + + def _setup_event_listeners(self) -> None: + self.layer.observe(self._on_layer_loading_changed, "loading") + self.on_msg(self._handle_message_event) + + link_func = self._traitlet_link_type() + if self._can_set_up_jslink(self.layer, "opacity"): + self.opacity_link = link_func((self.layer, "opacity"), (self, "opacity")) + if self._can_set_up_jslink(self.layer, "visible"): + self.visibility_link = link_func((self.layer, "visible"), (self, "visible")) + + def _on_layer_loading_changed(self, change: Dict[str, Any]) -> None: + self.is_loading = change.get("new", False) + + def _handle_message_event( + self, widget: ipywidgets.Widget, content: Dict[str, Any], buffers: List[Any] + ) -> None: + del widget, buffers # Unused + if content.get("type") == "click": + self._handle_button_click(content.get("id", "")) + + @traitlets.observe("opacity") + def _on_opacity_change(self, change: Dict[str, Any]) -> None: + if self._can_set_up_jslink(self.layer, "opacity"): + return # Return if the opacity is handled by a jslink. + if opacity := change.get("new"): + if self.layer in self.host_map.geojson_layers: + # For GeoJSON layers, use style.opacity and style.fillOpacity. + self.layer.style.update({"opacity": opacity, "fillOpacity": opacity}) + + def _get_layer_opacity(self) -> float: + if hasattr(self.layer, "opacity"): + return self.layer.opacity + elif self.layer in self.host_map.geojson_layers: + opacity = self.layer.style.get("opacity", 1.0) + fill_opacity = self.layer.style.get("fillOpacity", 1.0) + return max(opacity, fill_opacity) + return 1.0 - self._collapse_button.observe(self._on_collapse_click, "value") - self._close_button.on_click(self._on_close_click) + def _get_layer_visibility(self) -> bool: + if hasattr(self.layer, "visible"): + return self.layer.visible + return True - self.on_close = None - self.on_open_vis = None + def _handle_button_click(self, msg_id: str) -> None: + if msg_id == "settings": + self._open_layer_editor() + elif msg_id == "delete": + self._delete_layer() - self.collapsed = False - self.header_hidden = False - self.close_button_hidden = False + def _open_layer_editor(self) -> None: + metadata = self.host_map.ee_layers.get(self.name, None) + self.host_map.add("layer_editor", position="bottomright", layer_dict=metadata) - super().__init__([self._toolbar_header, self._toolbar_footer]) + def _delete_layer(self) -> None: + self.host_map.remove_layer(self.layer) - @property - def collapsed(self) -> bool: - """bool: Whether the layer manager is collapsed.""" - return not self._collapse_button.value - @collapsed.setter - def collapsed(self, value: bool) -> None: - self._collapse_button.value = not value +class LayerManager(anywidget.AnyWidget): + """A layer manager widget for geemap.""" - @property - def header_hidden(self) -> bool: - """bool: Whether the header is hidden.""" - return self._toolbar_header.layout.display == "none" + _esm = pathlib.Path(__file__).parent / "static" / "layer_manager.js" + _css = pathlib.Path(__file__).parent / "static" / "layer_manager.css" - @header_hidden.setter - def header_hidden(self, value: bool) -> None: - self._toolbar_header.layout.display = "none" if value else "block" + # Whether all layers should be visible or not. Represented as a checkbox in the UI. + visible = traitlets.Bool(True).tag(sync=True) - @property - def close_button_hidden(self) -> bool: - """bool: Whether the close button is hidden.""" - return self._close_button.style.display == "none" + # Child widgets in the container. Using a tuple here to force reassignment to update + # the list. When a proper notifying-list trait exists, use that instead. + children = TypedTuple( + trait=traitlets.Instance(ipywidgets.Widget), + help="List of widget children", + ).tag(sync=True, **ipywidgets.widget_serialization) - @close_button_hidden.setter - def close_button_hidden(self, value: bool) -> None: - self._close_button.style.display = "none" if value else "inline-block" + def __init__(self, host_map: "core.MapInterface"): + super().__init__() + self.host_map = host_map + if not host_map: + raise ValueError("Must pass a valid map when creating a layer manager.") def refresh_layers(self) -> None: - """Recreates all the layer widgets.""" - toggle_all_layout = ipywidgets.Layout( - height="18px", width="30ex", padding="0px 4px 25px 4px" - ) - toggle_all_checkbox = ipywidgets.Checkbox( - value=False, - description="All layers on/off", - indent=False, - layout=toggle_all_layout, - ) - toggle_all_checkbox.observe(self._on_all_layers_visibility_toggled, "value") - - layer_rows = [] - # non_basemap_layers = self._host_map.layers[1:] # Skip the basemap. - for layer in self._host_map.layers: - layer_rows.append(self._render_layer_row(layer)) - self._toolbar_footer.children = [toggle_all_checkbox] + layer_rows + """Refresh the layers in the layer manager. - def _on_close_click(self, _) -> None: - """Handles the close button click event.""" - if self.on_close: - self.on_close() - - def _on_collapse_click(self, change: Dict[str, Any]) -> None: - """Handles the collapse button click event. - - Args: - change (Dict[str, Any]): The change event arguments. + Uses the map interface to pull active layers. This function must be called + whenever a layer is added or removed on the map. """ - if change["new"]: - self.refresh_layers() - self.children = [self._toolbar_header, self._toolbar_footer] - else: - self.children = [self._collapse_button] + self.children = list(map(self._create_row_widget, self.host_map.layers)) - def _render_layer_row(self, layer: Any) -> ipywidgets.HBox: - """Renders a row for a layer. - - Args: - layer (Any): The layer to render. - - Returns: - ipywidgets.HBox: The rendered layer row. - """ - visibility_checkbox = ipywidgets.Checkbox( - value=self._compute_layer_visibility(layer), - description=layer.name, - indent=False, - layout=ipywidgets.Layout(height="18px", width="140px"), - ) - visibility_checkbox.observe( - lambda change: self._on_layer_visibility_changed(change, layer), "value" - ) - - opacity_slider = ipywidgets.FloatSlider( - value=self._compute_layer_opacity(layer), - min=0, - max=1, - step=0.01, - readout=False, - layout=ipywidgets.Layout(width="70px", padding="0px 3px 0px 0px"), - ) - opacity_slider.observe( - lambda change: self._on_layer_opacity_changed(change, layer), "value" - ) - - settings_button = ipywidgets.Button( - icon="gear", - layout=ipywidgets.Layout(width="25px", height="25px", padding="0px"), - tooltip=layer.name, - ) - settings_button.on_click(self._on_layer_settings_click) - - spinner = ipywidgets.Button( - icon="times", - layout=ipywidgets.Layout(width="25px", height="25px", padding="0px"), - tooltip="Loaded", - ) - - def loading_change(change): - if change["new"]: - spinner.tooltip = "Loading ..." - spinner.icon = "spinner spin lg" - else: - spinner.tooltip = "Loaded" - spinner.icon = "times" - - layer.observe(loading_change, "loading") - - spinner_event = ipyevents.Event( - source=spinner, watched_events=["mouseenter", "mouseleave"] - ) - - def handle_spinner_event(event): - if event["type"] == "mouseenter": - spinner.icon = "times" - elif event["type"] == "mouseleave": - if hasattr(layer, "loading") and layer.loading: - spinner.icon = "spinner spin lg" - else: - spinner.icon = "times" - - spinner_event.on_dom_event(handle_spinner_event) - - def remove_layer_click(_): - self._on_layer_remove_click(layer) - - spinner.on_click(remove_layer_click) - - return ipywidgets.HBox( - [ - visibility_checkbox, - opacity_slider, - settings_button, - spinner, - ], - layout=ipywidgets.Layout(padding="0px 4px 0px 4px"), - ) - - def _find_layer_row_index(self, layer: Any) -> int: - """Finds the index of a layer row. - - Args: - layer (Any): The layer to find. - - Returns: - int: The index of the layer row. - """ - for index, child in enumerate(self._toolbar_footer.children[1:]): - if child.children[0].description == layer.name: - return index + 1 - return -1 - - def _remove_confirm_widget(self) -> None: - """Removes the confirm widget.""" - for index, child in enumerate(self._toolbar_footer.children[1:]): - if child.children[0].value == "Remove layer?": - self._toolbar_footer.children = ( - self._toolbar_footer.children[: index + 1] - + self._toolbar_footer.children[index + 2 :] - ) - break - - def _on_layer_remove_click(self, layer: Any) -> None: - """Handles the layer remove click event. - - Args: - layer (Any): The layer to remove. - """ - self._remove_confirm_widget() - - label = ipywidgets.Label( - "Remove layer?", - layout=ipywidgets.Layout(padding="0px 4px 0px 4px"), - ) - yes_button = ipywidgets.Button( - description="Yes", - button_style="primary", - ) - yes_button.layout.width = "86px" - no_button = ipywidgets.Button( - description="No", - button_style="primary", - ) - no_button.layout.width = "86px" - - confirm_widget = ipywidgets.HBox( - [label, yes_button, no_button], layout=ipywidgets.Layout(width="284px") - ) - - layer_row_index = self._find_layer_row_index(layer) - - self._toolbar_footer.children = ( - list(self._toolbar_footer.children[: layer_row_index + 1]) - + [confirm_widget] - + list(self._toolbar_footer.children[layer_row_index + 1 :]) - ) - - def on_yes_button_click(_): - self._host_map.remove_layer(layer) - self._remove_confirm_widget() - - yes_button.on_click(on_yes_button_click) - - def on_no_button_click(_): - self._remove_confirm_widget() - - no_button.on_click(on_no_button_click) - - def _compute_layer_opacity(self, layer: Any) -> float: - """Computes the opacity of a layer. - - Args: - layer (Any): The layer to compute the opacity for. - - Returns: - float: The opacity of the layer. - """ - if layer in self._host_map.geojson_layers: - opacity = layer.style.get("opacity", 1.0) - fill_opacity = layer.style.get("fillOpacity", 1.0) - return max(opacity, fill_opacity) - return layer.opacity if hasattr(layer, "opacity") else 1.0 - - def _compute_layer_visibility(self, layer: Any) -> bool: - """Computes the visibility of a layer. - - Args: - layer (Any): The layer to compute the visibility for. - - Returns: - bool: The visibility of the layer. - """ - return layer.visible if hasattr(layer, "visible") else True - - def _on_layer_settings_click(self, button: ipywidgets.Button) -> None: - """Handles the layer settings click event. - - Args: - button (ipywidgets.Button): The button that was clicked. - """ - if self.on_open_vis: - self.on_open_vis(button.tooltip) - - def _on_all_layers_visibility_toggled(self, change: Dict[str, Any]) -> None: - """Handles the all layers visibility toggled event. - - Args: - change (Dict[str, Any]): The change event arguments. - """ - checkboxes = [ - row.children[0] for row in self._toolbar_footer.children[1:] - ] # Skip the all on/off checkbox. - for checkbox in checkboxes: - checkbox.value = change["new"] - - def _on_layer_opacity_changed(self, change: Dict[str, Any], layer: Any) -> None: - """Handles the layer opacity changed event. - - Args: - change (Dict[str, Any]): The change event arguments. - layer (Any): The layer to change the opacity for. - """ - if layer in self._host_map.geojson_layers: - # For non-TileLayer, use layer.style.opacity and layer.style.fillOpacity. - layer.style.update({"opacity": change["new"], "fillOpacity": change["new"]}) - elif hasattr(layer, "opacity"): - layer.opacity = change["new"] - - def _on_layer_visibility_changed(self, change: Dict[str, Any], layer: Any) -> None: - """Handles the layer visibility changed event. - - Args: - change (Dict[str, Any]): The change event arguments. - layer (Any): The layer to change the visibility for. - """ - if hasattr(layer, "visible"): - layer.visible = change["new"] - - layer_name = change["owner"].description - if layer_name not in self._host_map.ee_layers: - return + def _create_row_widget(self, layer: Any) -> LayerManagerRow: + return LayerManagerRow(self.host_map, layer) - layer_dict = self._host_map.ee_layers[layer_name] - for attachment_name in ["legend", "colorbar"]: - attachment = layer_dict.get(attachment_name, None) - attachment_on_map = attachment in self._host_map.controls - if change["new"] and not attachment_on_map: - try: - self._host_map.add(attachment) - except: - from ipyleaflet import WidgetControl - - widget = attachment.widget - position = attachment.position - control = WidgetControl(widget=widget, position=position) - self._host_map.add(control) - layer_dict["colorbar"] = control - - elif not change["new"] and attachment_on_map: - self._host_map.remove_control(attachment) + @traitlets.observe("visible") + def _observe_visible(self, change: Dict[str, Any]) -> None: + # When the `visible` property changes, propagate that change to all children. + if (visible := change.get("new")) is not None: + for child in self.children: + child.visible = visible @Theme.apply diff --git a/geemap/static/ipywidgets_styles.js b/geemap/static/ipywidgets_styles.js new file mode 100644 index 0000000000..a788ad9e1b --- /dev/null +++ b/geemap/static/ipywidgets_styles.js @@ -0,0 +1,94 @@ +var R=globalThis,N=R.ShadowRoot&&(R.ShadyCSS===void 0||R.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,k=Symbol(),Z=new WeakMap,E=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==k)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(N&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=Z.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Z.set(e,t))}return t}toString(){return this.cssText}},X=r=>new E(typeof r=="string"?r:r+"",void 0,k),z=(r,...t)=>{let e=r.length===1?r[0]:t.reduce((s,i,o)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[o+1],r[0]);return new E(e,r,k)},L=(r,t)=>{if(N)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=R.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s)}},T=N?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return X(e)})(r):r;var{is:pt,defineProperty:ut,getOwnPropertyDescriptor:$t,getOwnPropertyNames:ft,getOwnPropertySymbols:_t,getPrototypeOf:gt}=Object,M=globalThis,G=M.trustedTypes,mt=G?G.emptyScript:"",At=M.reactiveElementPolyfillSupport,w=(r,t)=>r,I={toAttribute(r,t){switch(t){case Boolean:r=r?mt:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},tt=(r,t)=>!pt(r,t),Y={attribute:!0,type:String,converter:I,reflect:!1,hasChanged:tt};Symbol.metadata??=Symbol("metadata"),M.litPropertyMetadata??=new WeakMap;var $=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Y){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&ut(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:o}=$t(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i?.call(this)},set(n){let p=i?.call(this);o.call(this,n),this.requestUpdate(t,p,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Y}static _$Ei(){if(this.hasOwnProperty(w("elementProperties")))return;let t=gt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(w("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(w("properties"))){let e=this.properties,s=[...ft(e),..._t(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(T(i))}else t!==void 0&&e.push(T(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return L(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let o=(s.converter?.toAttribute!==void 0?s.converter:I).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let o=s.getPropertyOptions(i),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:I;this._$Em=i,this[i]=n.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??tt)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,o]of this._$Ep)this[i]=o;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,o]of s)o.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],o)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[w("elementProperties")]=new Map,$[w("finalized")]=new Map,At?.({ReactiveElement:$}),(M.reactiveElementVersions??=[]).push("2.0.4");var J=globalThis,j=J.trustedTypes,et=j?j.createPolicy("lit-html",{createHTML:r=>r}):void 0,ht="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,at="?"+_,yt=`<${at}>`,A=document,C=()=>A.createComment(""),P=r=>r===null||typeof r!="object"&&typeof r!="function",F=Array.isArray,vt=r=>F(r)||typeof r?.[Symbol.iterator]=="function",B=`[ +\f\r]`,x=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,st=/-->/g,it=/>/g,g=RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`,"g"),rt=/'/g,ot=/"/g,lt=/^(?:script|style|textarea|title)$/i,Q=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),Ut=Q(1),Ht=Q(2),Ot=Q(3),y=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),nt=new WeakMap,m=A.createTreeWalker(A,129);function ct(r,t){if(!F(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return et!==void 0?et.createHTML(t):t}var St=(r,t)=>{let e=r.length-1,s=[],i,o=t===2?"":t===3?"":"",n=x;for(let p=0;p"?(n=i??x,a=-1):d[1]===void 0?a=-2:(a=n.lastIndex-d[2].length,l=d[1],n=d[3]===void 0?g:d[3]==='"'?ot:rt):n===ot||n===rt?n=g:n===st||n===it?n=x:(n=g,i=void 0);let f=n===g&&r[p+1].startsWith("/>")?" ":"";o+=n===x?h+yt:a>=0?(s.push(l),h.slice(0,a)+ht+h.slice(a)+_+f):h+_+(a===-2?p:f)}return[ct(r,o+(r[e]||"")+(t===2?"":t===3?"":"")),s]},U=class r{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let o=0,n=0,p=t.length-1,h=this.parts,[l,d]=St(t,e);if(this.el=r.createElement(l,s),m.currentNode=this.el.content,e===2||e===3){let a=this.el.content.firstChild;a.replaceWith(...a.childNodes)}for(;(i=m.nextNode())!==null&&h.length0){i.textContent=j?j.emptyScript:"";for(let f=0;f2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=c}_$AI(t,e=this,s,i){let o=this.strings,n=!1;if(o===void 0)t=v(this,t,e,0),n=!P(t)||t!==this._$AH&&t!==y,n&&(this._$AH=t);else{let p=t,h,l;for(t=o[0],h=0;h{let s=e?.renderBefore??t,i=s._$litPart$;if(i===void 0){let o=e?.renderBefore??null;s._$litPart$=i=new H(t.insertBefore(C(),o),o,void 0,e??{})}return i._$AI(r),i};var b=class extends ${constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=dt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return y}};b._$litElement$=!0,b.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:b});var Et=globalThis.litElementPolyfillSupport;Et?.({LitElement:b});(globalThis.litElementVersions??=[]).push("4.1.0");var qt=z` + .legacy-button { + align-items: center; + background-color: var(--jp-layout-color2); + border-width: 0; + box-shadow: none; + color: var(--jp-ui-font-color1); + cursor: pointer; + display: flex; + font-family: "Helvetica Neue", Arial, Helvetica, sans-serif; + font-size: var(--jp-widgets-font-size); + justify-content: center; + line-height: var(--jp-widgets-inline-height); + padding: 0; + } + + .legacy-button.primary { + background-color: var(--jp-brand-color1); + color: var(--jp-ui-inverse-font-color1); + } + + .legacy-button:hover:enabled, + .legacy-button:focus:enabled { + box-shadow: var(--jp-elevation-z2); + } + + .legacy-slider { + -webkit-appearance: none; + appearance: none; + background: var(--jp-layout-color3); + border-radius: 3px; + height: 4px; + outline: none; + } + + .legacy-slider::-webkit-slider-thumb, + .legacy-slider::-moz-range-thumb { + -moz-appearance: none; + -webkit-appearance: none; + appearance: none; + border-radius: 50%; + cursor: pointer; + height: var(--jp-widgets-slider-handle-size); + width: var(--jp-widgets-slider-handle-size); + } + + .legacy-text { + color: var(--jp-widgets-label-color); + font-family: "Helvetica Neue", Arial, Helvetica, sans-serif; + font-size: var(--jp-widgets-font-size); + height: var(--jp-widgets-inline-height); + line-height: var(--jp-widgets-inline-height); + } +`;export{qt as legacyStyles}; +/*! Bundled license information: + +@lit/reactive-element/css-tag.js: + (** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/reactive-element.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +lit-html/lit-html.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +lit-element/lit-element.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +lit-html/is-server.js: + (** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) +*/ +//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vbm9kZV9tb2R1bGVzL0BsaXQvcmVhY3RpdmUtZWxlbWVudC9zcmMvY3NzLXRhZy50cyIsICIuLi8uLi9ub2RlX21vZHVsZXMvQGxpdC9yZWFjdGl2ZS1lbGVtZW50L3NyYy9yZWFjdGl2ZS1lbGVtZW50LnRzIiwgIi4uLy4uL25vZGVfbW9kdWxlcy9saXQtaHRtbC9zcmMvbGl0LWh0bWwudHMiLCAiLi4vLi4vbm9kZV9tb2R1bGVzL2xpdC1lbGVtZW50L3Ny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ICAgICAgICAgICAgICBwYXJ0cy5wdXNoKHtcbiAgICAgICAgICAgICAgICB0eXBlOiBBVFRSSUJVVEVfUEFSVCxcbiAgICAgICAgICAgICAgICBpbmRleDogbm9kZUluZGV4LFxuICAgICAgICAgICAgICAgIG5hbWU6IG1bMl0sXG4gICAgICAgICAgICAgICAgc3RyaW5nczogc3RhdGljcyxcbiAgICAgICAgICAgICAgICBjdG9yOlxuICAgICAgICAgICAgICAgICAgbVsxXSA9PT0gJy4nXG4gICAgICAgICAgICAgICAgICAgID8gUHJvcGVydHlQYXJ0XG4gICAgICAgICAgICAgICAgICAgIDogbVsxXSA9PT0gJz8nXG4gICAgICAgICAgICAgICAgICAgICAgPyBCb29sZWFuQXR0cmlidXRlUGFydFxuICAgICAgICAgICAgICAgICAgICAgIDogbVsxXSA9PT0gJ0AnXG4gICAgICAgICAgICAgICAgICAgICAgICA/IEV2ZW50UGFydFxuICAgICAgICAgICAgICAgICAgICAgICAgOiBBdHRyaWJ1dGVQYXJ0LFxuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgKG5vZGUgYXMgRWxlbWVudCkucmVtb3ZlQXR0cmlidXRlKG5hbWUpO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChuYW1lLnN0YXJ0c1dpdGgobWFya2VyKSkge1xuICAgICAgICAgICAgICBwYXJ0cy5wdXNoKHtcbiAgICAgICAgICAgICAgICB0eXBlOiBFTEVNRU5UX1BBUlQsXG4gICAgICAgICAgICAgICAgaW5kZXg6IG5vZGVJbmRleCxcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgIChub2RlIGFzIEVsZW1lbnQpLnJlbW92ZUF0dHJpYnV0ZShuYW1lKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgLy8gVE9ETyAoanVzdGluZmFnbmFuaSk6IGJlbmNobWFyayB0aGUgcmVnZXggYWdhaW5zdCB0ZXN0aW5nIGZvciBlYWNoXG4gIC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bmVyIiwgIm9wdGlvbnMiLCAicGFydE93bmVyTm9kZSIsICJyZW5kZXJCZWZvcmUiLCAicGFydCIsICJlbmROb2RlIiwgImluc2VydEJlZm9yZSIsICJjcmVhdGVNYXJrZXIiLCAiXyRzZXRWYWx1ZSIsICJMaXRFbGVtZW50IiwgIlJlYWN0aXZlRWxlbWVudCIsICJjb25zdHJ1Y3RvciIsICJ0aGlzIiwgInJlbmRlck9wdGlvbnMiLCAiaG9zdCIsICJfX2NoaWxkUGFydCIsICJjcmVhdGVSZW5kZXJSb290IiwgInJlbmRlclJvb3QiLCAic3VwZXIiLCAicmVuZGVyQmVmb3JlIiwgImZpcnN0Q2hpbGQiLCAiY2hhbmdlZFByb3BlcnRpZXMiLCAidmFsdWUiLCAicmVuZGVyIiwgImhhc1VwZGF0ZWQiLCAiaXNDb25uZWN0ZWQiLCAidXBkYXRlIiwgImNvbm5lY3RlZENhbGxiYWNrIiwgInNldENvbm5lY3RlZCIsICJkaXNjb25uZWN0ZWRDYWxsYmFjayIsICJub0NoYW5nZSIsICJnbG9iYWxUaGlzIiwgImxpdEVsZW1lbnRIeWRyYXRlU3VwcG9ydCIsICJwb2x5ZmlsbFN1cHBvcnQiLCAibGl0RWxlbWVudFBvbHlmaWxsU3VwcG9ydCIsICJnbG9iYWxUaGlzIiwgImxpdEVsZW1lbnRWZXJzaW9ucyIsICJwdXNoIiwgImxlZ2FjeVN0eWxlcyIsICJpIl0KfQo= diff --git a/geemap/static/layer_manager.css b/geemap/static/layer_manager.css new file mode 100644 index 0000000000..202059d823 --- /dev/null +++ b/geemap/static/layer_manager.css @@ -0,0 +1,2 @@ +@import"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined"; +/*# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFtdLAogICJzb3VyY2VzQ29udGVudCI6IFtdLAogICJtYXBwaW5ncyI6ICIiLAogICJuYW1lcyI6IFtdCn0K */ diff --git a/geemap/static/layer_manager.js b/geemap/static/layer_manager.js new file mode 100644 index 0000000000..79a6fd5c7c --- /dev/null +++ b/geemap/static/layer_manager.js @@ -0,0 +1,192 @@ +var At=Object.defineProperty;var vt=Object.getOwnPropertyDescriptor;var st=(r,t,e,s)=>{for(var i=s>1?void 0:s?vt(t,e):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(i=(s?n(t,e,i):n(i))||i);return s&&i&&At(t,e,i),i};var T=globalThis,k=T.ShadowRoot&&(T.ShadyCSS===void 0||T.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,V=Symbol(),it=new WeakMap,x=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==V)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(k&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=it.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&it.set(e,t))}return t}toString(){return this.cssText}},rt=r=>new x(typeof r=="string"?r:r+"",void 0,V),w=(r,...t)=>{let e=r.length===1?r[0]:t.reduce((s,i,o)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[o+1],r[0]);return new x(e,r,V)},B=(r,t)=>{if(k)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=T.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s)}},j=k?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return rt(e)})(r):r;var{is:bt,defineProperty:St,getOwnPropertyDescriptor:Et,getOwnPropertyNames:xt,getOwnPropertySymbols:wt,getPrototypeOf:Ct}=Object,L=globalThis,ot=L.trustedTypes,Pt=ot?ot.emptyScript:"",Mt=L.reactiveElementPolyfillSupport,C=(r,t)=>r,P={toAttribute(r,t){switch(t){case Boolean:r=r?Pt:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},z=(r,t)=>!bt(r,t),nt={attribute:!0,type:String,converter:P,reflect:!1,hasChanged:z};Symbol.metadata??=Symbol("metadata"),L.litPropertyMetadata??=new WeakMap;var m=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=nt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&St(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:o}=Et(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i?.call(this)},set(n){let h=i?.call(this);o.call(this,n),this.requestUpdate(t,h,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??nt}static _$Ei(){if(this.hasOwnProperty(C("elementProperties")))return;let t=Ct(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(C("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(C("properties"))){let e=this.properties,s=[...xt(e),...wt(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(j(i))}else t!==void 0&&e.push(j(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return B(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let o=(s.converter?.toAttribute!==void 0?s.converter:P).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let o=s.getPropertyOptions(i),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:P;this._$Em=i,this[i]=n.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??z)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,o]of this._$Ep)this[i]=o;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,o]of s)o.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],o)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};m.elementStyles=[],m.shadowRootOptions={mode:"open"},m[C("elementProperties")]=new Map,m[C("finalized")]=new Map,Mt?.({ReactiveElement:m}),(L.reactiveElementVersions??=[]).push("2.0.4");var X=globalThis,I=X.trustedTypes,at=I?I.createPolicy("lit-html",{createHTML:r=>r}):void 0,ut="$lit$",g=`lit$${Math.random().toFixed(9).slice(2)}$`,mt="?"+g,Ut=`<${mt}>`,A=document,U=()=>A.createComment(""),N=r=>r===null||typeof r!="object"&&typeof r!="function",Y=Array.isArray,Nt=r=>Y(r)||typeof r?.[Symbol.iterator]=="function",W=`[ +\f\r]`,M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,lt=/-->/g,ht=/>/g,$=RegExp(`>|${W}(?:([^\\s"'>=/]+)(${W}*=${W}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`,"g"),ct=/'/g,dt=/"/g,ft=/^(?:script|style|textarea|title)$/i,G=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),gt=G(1),Bt=G(2),Wt=G(3),v=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),pt=new WeakMap,_=A.createTreeWalker(A,129);function yt(r,t){if(!Y(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return at!==void 0?at.createHTML(t):t}var Ot=(r,t)=>{let e=r.length-1,s=[],i,o=t===2?"":t===3?"":"",n=M;for(let h=0;h"?(n=i??M,l=-1):p[1]===void 0?l=-2:(l=n.lastIndex-p[2].length,c=p[1],n=p[3]===void 0?$:p[3]==='"'?dt:ct):n===dt||n===ct?n=$:n===lt||n===ht?n=M:(n=$,i=void 0);let f=n===$&&r[h+1].startsWith("/>")?" ":"";o+=n===M?a+Ut:l>=0?(s.push(c),a.slice(0,l)+ut+a.slice(l)+g+f):a+g+(l===-2?h:f)}return[yt(r,o+(r[e]||"")+(t===2?"":t===3?"":"")),s]},O=class r{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let o=0,n=0,h=t.length-1,a=this.parts,[c,p]=Ot(t,e);if(this.el=r.createElement(c,s),_.currentNode=this.el.content,e===2||e===3){let l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(i=_.nextNode())!==null&&a.length0){i.textContent=I?I.emptyScript:"";for(let f=0;f2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=d}_$AI(t,e=this,s,i){let o=this.strings,n=!1;if(o===void 0)t=b(this,t,e,0),n=!N(t)||t!==this._$AH&&t!==v,n&&(this._$AH=t);else{let h=t,a,c;for(t=o[0],a=0;a{let s=e?.renderBefore??t,i=s._$litPart$;if(i===void 0){let o=e?.renderBefore??null;s._$litPart$=i=new R(t.insertBefore(U(),o),o,void 0,e??{})}return i._$AI(r),i};var y=class extends m{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=$t(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return v}};y._$litElement$=!0,y.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:y});var Ht=globalThis.litElementPolyfillSupport;Ht?.({LitElement:y});(globalThis.litElementVersions??=[]).push("4.1.0");var Tt={attribute:!0,type:String,converter:P,reflect:!1,hasChanged:z},kt=(r=Tt,t,e)=>{let{kind:s,metadata:i}=e,o=globalThis.litPropertyMetadata.get(i);if(o===void 0&&globalThis.litPropertyMetadata.set(i,o=new Map),o.set(e.name,r),s==="accessor"){let{name:n}=e;return{set(h){let a=t.get.call(this);t.set.call(this,h),this.requestUpdate(n,a,r)},init(h){return h!==void 0&&this.P(n,void 0,r),h}}}if(s==="setter"){let{name:n}=e;return function(h){let a=this[n];t.call(this,h),this.requestUpdate(n,a,r)}}throw Error("Unsupported decorator location: "+s)};function tt(r){return(t,e)=>typeof e=="object"?kt(r,t,e):((s,i,o)=>{let n=i.hasOwnProperty(o);return i.constructor.createProperty(o,n?{...s,wrapped:!0}:s),n?Object.getOwnPropertyDescriptor(i,o):void 0})(r,t,e)}var _t=w` + .legacy-button { + align-items: center; + background-color: var(--jp-layout-color2); + border-width: 0; + box-shadow: none; + color: var(--jp-ui-font-color1); + cursor: pointer; + display: flex; + font-family: "Helvetica Neue", Arial, Helvetica, sans-serif; + font-size: var(--jp-widgets-font-size); + justify-content: center; + line-height: var(--jp-widgets-inline-height); + padding: 0; + } + + .legacy-button.primary { + background-color: var(--jp-brand-color1); + color: var(--jp-ui-inverse-font-color1); + } + + .legacy-button:hover:enabled, + .legacy-button:focus:enabled { + box-shadow: var(--jp-elevation-z2); + } + + .legacy-slider { + -webkit-appearance: none; + appearance: none; + background: var(--jp-layout-color3); + border-radius: 3px; + height: 4px; + outline: none; + } + + .legacy-slider::-webkit-slider-thumb, + .legacy-slider::-moz-range-thumb { + -moz-appearance: none; + -webkit-appearance: none; + appearance: none; + border-radius: 50%; + cursor: pointer; + height: var(--jp-widgets-slider-handle-size); + width: var(--jp-widgets-slider-handle-size); + } + + .legacy-text { + color: var(--jp-widgets-label-color); + font-family: "Helvetica Neue", Arial, Helvetica, sans-serif; + font-size: var(--jp-widgets-font-size); + height: var(--jp-widgets-inline-height); + line-height: var(--jp-widgets-inline-height); + } +`;async function jt(r,t){return Promise.all(r.map(e=>t.get_model(e.slice(10))))}async function et(r,t){let e=t.get("children"),s=await jt(e,t.widget_manager),i=await Promise.all(s.map(o=>o.widget_manager.create_view(o)));r.innerHTML="";for(let o of i)r.appendChild(o.el)}var D=class D extends y{constructor(){super(...arguments);this._model=void 0;this.visible=!1}static get componentName(){return"layer-manager"}static{this.styles=[_t,w` + .container { + padding: 0 4px 2px 4px; + } + + .row { + align-items: center; + display: flex; + gap: 4px; + height: 30px; + } + + .visibility-checkbox { + margin: 2px; + } + `]}static{this.modelNameToViewName=new Map([["children",null],["visible","visible"]])}set model(e){this._model=e;for(let[s,i]of D.modelNameToViewName)i&&(this[i]=e.get(s),e.on(`change:${s}`,()=>{this[i]=e.get(s)}))}render(){return gt` +
+
+ + All layers on/off +
+ +
+ `}updated(e){for(let[s,i]of e)this._model?.set(s,this[s]);this._model?.save_changes()}onLayerVisibilityChanged(e){let s=e.target;this.visible=s.checked}};st([tt()],D.prototype,"visible",2);var E=D;customElements.get(E.componentName)||customElements.define(E.componentName,E);async function Lt({model:r,el:t}){let e=document.createElement(E.componentName);e.model=r,t.appendChild(e),et(e,r),r.on("change:children",()=>{et(e,r)})}var qe={render:Lt};export{E as LayerManager,qe as default}; +/*! Bundled license information: + +@lit/reactive-element/css-tag.js: + (** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/reactive-element.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +lit-html/lit-html.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +lit-element/lit-element.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +lit-html/is-server.js: + (** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/decorators/custom-element.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/decorators/property.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/decorators/state.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/decorators/event-options.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/decorators/base.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/decorators/query.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/decorators/query-all.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/decorators/query-async.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/decorators/query-assigned-elements.js: + (** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/decorators/query-assigned-nodes.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) +*/ +//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vbm9kZV9tb2R1bGVzL0BsaXQvcmVhY3RpdmUtZWxlbWVudC9zcmMvY3NzLXRhZy50cyIsICIuLi8uLi9ub2RlX21vZHVsZXMvQGxpdC9yZWFjdGl2ZS1lbGVtZW50L3NyYy9yZWFjdGl2ZS1lbGVtZW50LnRzIiwgIi4uLy4uL25vZGVfbW9kdWxlcy9saXQtaHRtbC9zcmMvbGl0LWh0bWwudHMiLCAiLi4vLi4vbm9kZV9tb2R1bGVzL2xpdC1lbGVtZW50L3NyYy9saXQtZWxlbWVudC50cyIsICIuLi8uLi9ub2RlX21vZHVsZXMvQGxpdC9yZWFjdGl2ZS1lbGVtZW50L3NyYy9kZWNvcmF0b3JzL3Byb3BlcnR5LnRzIiwgIi4uLy4uL2pzL2lweXdpZGdldHNfc3R5bGVzLnRzIiwgIi4uLy4uL2pzL3V0aWxzLnRzIiwgIi4uLy4uL2pzL2xheWVyX21hbmFnZXIudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbIi8qKlxuICogQGxpY2Vuc2VcbiAqIENvcHlyaWdodCAyMDE5IEdvb2dsZSBMTENcbiAqIFNQRFgtTGljZW5zZS1JZGVudGlmaWVyOiBCU0QtMy1DbGF1c2VcbiAqL1xuXG5jb25zdCBOT0RFX01PREUgPSBmYWxzZTtcblxuLy8gQWxsb3dzIG1pbmlmaWVycyB0byByZW5hbWUgcmVmZXJlbmNlcyB0byBnbG9iYWxUaGlzXG5jb25zdCBnbG9iYWwgPSBnbG9iYWxUaGlzO1xuXG4vKipcbiAqIFdoZXRoZXIgdGhlIGN1cnJlbnQgYnJvd3NlciBzdXBwb3J0cyBgYWRvcHRlZFN0eWxlU2hlZXRzYC5cbiAqL1xuZXhwb3J0IGNvbn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Y29uc3QgbSA9IC8oWy4/QF0pPyguKikvLmV4ZWMocmVhbE5hbWUpITtcbiAgICAgICAgICAgICAgcGFydHMucHVzaCh7XG4gICAgICAgICAgICAgICAgdHlwZTogQVRUUklCVVRFX1BBUlQsXG4gICAgICAgICAgICAgICAgaW5kZXg6IG5vZGVJbmRleCxcbiAgICAgICAgICAgICAgICBuYW1lOiBtWzJdLFxuICAgICAgICAgICAgICAgIHN0cmluZ3M6IHN0YXRpY3MsXG4gICAgICAgICAgICAgICAgY3RvcjpcbiAgICAgICAgICAgICAgICAgIG1bMV0gPT09ICcuJ1xuICAgICAgICAgICAgICAgICAgICA/IFByb3BlcnR5UGFydFxuICAgICAgICAgICAgICAgICAgICA6IG1bMV0gPT09ICc/J1xuICAgICAgICAgICAgICAgICAgICAgID8gQm9vbGVhbkF0dHJpYnV0ZVBhcnRcbiAgICAgICAgICAgICAgICAgICAgICA6IG1bMV0gPT09ICdAJ1xuICAgICAgICAgICAgICAgICAgICAgICAgPyBFdmVudFBhcnRcbiAgICAgICAgICAgICAgICAgICAgICAgIDogQXR0cmlidXRlUGFydCxcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgIChub2RlIGFzIEVsZW1lbnQpLnJlbW92ZUF0dHJpYnV0ZShuYW1lKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobmFtZS5zdGFydHNXaXRoKG1hcmtlcikpIHtcbiAgICAgICAgICAgICAgcGFydHMucHVzaCh7XG4gICAgICAgICAgICAgICAgdHlwZTogRUxFTUVOVF9QQVJULFxuICAgICAgICAgICAgICAgIGluZGV4OiBub2RlSW5kZXgsXG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAobm9kZSBhcyBFbGVtZW50KS5yZW1vdmVBdHRyaWJ1dGUobmFtZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIC8vIFRPRE8gKGp1c3RpbmZhZ25hbmkpOiBiZW5jaG1hcmsg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gICAgICAgICAgICAgIGBMaXQgZG9lcyBub3Qgc3VwcG9ydCBiaW5kaW5nIGluc2lkZSBzdHlsZSBub2Rlcy4gYCArXG4gICAgICAgICAgICAgICAgYFRoaXMgaXMgYSBzZWN1cml0eSByaXNrLCBhcyBzdHlsZSBpbmplY3Rpb24gYXR0YWNrcyBjYW4gYCArXG4gICAgICAgICAgICAgICAgYGV4ZmlsdHJhdGUgZGF0YSBhbmQgc3Bvb2YgVUlzLiBgICtcbiAgICAgICAgICAgICAgICBgQ29uc2lkZXIgaW5zdGVhZCB1c2luZyBjc3NcXGAuLi5cXGAgbGl0ZXJhbHMgYCArXG4gICAgICAgICAgICAgICAgYHRvIGNvbXBvc2Ugc3R5bGVzLCBhbmQgZG8gZHluYW1pYyBzdHlsaW5nIHdpdGggYCArXG4gICAgICAgICAgICAgICAgYGNzcyBjdXN0b20gcHJvcGVydGllcywgOjpwYXJ0cywgPHNsb3Q+cywgYCArXG4gICAgICAgICAgICAgICAgYGFuZCBieSBtdXRhdGluZyB0aGUgRE9NIHJhdGhlciB0aGFuIHN0eWxlc2hlZXRzLmA7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBtZXNzYWdlID1cbiAgICAgICAgICAgICAgICBgTGl0IGRvZXMgbm90IHN1cHBvcnQgYmluZGluZyBpbnNpZGUgc2NyaXB0IG5vZGVzLiBgICtcbiAgICAgICAgICAgICAgICBgVGhpcyBpcyBhIHNlY3VyaXR5IHJpc2ssIGFzIGl0IGNvdWxkIGFsbG93IGFyYml0cmFyeSBgICtcbiAgICAgICAgICAgICAgICBgY29kZSBleGVjdXRpb24uYDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgdGhyb3cgbmV3IEVycm9yKG1lc3NhZ2UpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBkZWJ1Z0xvZ0V2ZW50ICYmXG4gICAgICAgIGRlYnVnTG9nRXZlbnQoe1xuICAgICAgICAgIGtpbm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GVydGllcyIsICJnbG9iYWxUaGlzIiwgImxpdFByb3BlcnR5TWV0YWRhdGEiLCAiZ2V0IiwgInNldCIsICJNYXAiLCAibmFtZSIsICJ2IiwgIm9sZFZhbHVlIiwgImNhbGwiLCAidGhpcyIsICJyZXF1ZXN0VXBkYXRlIiwgIl8kY2hhbmdlUHJvcGVydHkiLCAidmFsdWUiLCAiRXJyb3IiLCAicHJvcGVydHkiLCAicHJvdG9PclRhcmdldCIsICJuYW1lT3JDb250ZXh0IiwgInByb3RvIiwgImhhc093blByb3BlcnR5IiwgImNvbnN0cnVjdG9yIiwgImNyZWF0ZVByb3BlcnR5IiwgIndyYXBwZWQiLCAiT2JqZWN0IiwgImdldE93blByb3BlcnR5RGVzY3JpcHRvciIsICJsZWdhY3lTdHlsZXMiLCAiaSIsICJ1bnBhY2tNb2RlbHMiLCAibW9kZWxJZHMiLCAibWFuYWdlciIsICJpZCIsICJ1cGRhdGVDaGlsZHJlbiIsICJjb250YWluZXIiLCAibW9kZWwiLCAiY2hpbGRyZW4iLCAiY2hpbGRfbW9kZWxzIiwgImNoaWxkX3ZpZXdzIiwgImNoaWxkX3ZpZXciLCAiX0xheWVyTWFuYWdlciIsICJoIiwgImxlZ2FjeVN0eWxlcyIsICJpIiwgIm1vZGVsIiwgIm1vZGVsS2V5IiwgIndpZGdldEtleSIsICJrZSIsICJjaGFuZ2VkUHJvcGVydGllcyIsICJwcm9wZXJ0eSIsICJfIiwgImV2ZW50IiwgInRhcmdldCIsICJfX2RlY29yYXRlQ2xhc3MiLCAibiIsICJMYXllck1hbmFnZXIiLCAicmVuZGVyIiwgImVsIiwgIm1hbmFnZXIiLCAidXBkYXRlQ2hpbGRyZW4iLCAibGF5ZXJfbWFuYWdlcl9kZWZhdWx0Il0KfQo= diff --git a/geemap/static/layer_manager_row.css b/geemap/static/layer_manager_row.css new file mode 100644 index 0000000000..202059d823 --- /dev/null +++ b/geemap/static/layer_manager_row.css @@ -0,0 +1,2 @@ +@import"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined"; +/*# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFtdLAogICJzb3VyY2VzQ29udGVudCI6IFtdLAogICJtYXBwaW5ncyI6ICIiLAogICJuYW1lcyI6IFtdCn0K */ diff --git a/geemap/static/layer_manager_row.js b/geemap/static/layer_manager_row.js new file mode 100644 index 0000000000..ded592464a --- /dev/null +++ b/geemap/static/layer_manager_row.js @@ -0,0 +1,304 @@ +var _t=Object.defineProperty;var bt=Object.getOwnPropertyDescriptor;var w=(o,t,e,s)=>{for(var i=s>1?void 0:s?bt(t,e):t,n=o.length-1,r;n>=0;n--)(r=o[n])&&(i=(s?r(t,e,i):r(i))||i);return s&&i&&_t(t,e,i),i};var L=globalThis,z=L.ShadowRoot&&(L.ShadyCSS===void 0||L.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,W=Symbol(),it=new WeakMap,k=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==W)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(z&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=it.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&it.set(e,t))}return t}toString(){return this.cssText}},ot=o=>new k(typeof o=="string"?o:o+"",void 0,W),v=(o,...t)=>{let e=o.length===1?o[0]:t.reduce((s,i,n)=>s+(r=>{if(r._$cssResult$===!0)return r.cssText;if(typeof r=="number")return r;throw Error("Value passed to 'css' function must be a 'css' function result: "+r+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+o[n+1],o[0]);return new k(e,o,W)},J=(o,t)=>{if(z)o.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=L.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,o.appendChild(s)}},D=z?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return ot(e)})(o):o;var{is:At,defineProperty:xt,getOwnPropertyDescriptor:St,getOwnPropertyNames:wt,getOwnPropertySymbols:Et,getPrototypeOf:Ct}=Object,I=globalThis,nt=I.trustedTypes,Pt=nt?nt.emptyScript:"",kt=I.reactiveElementPolyfillSupport,R=(o,t)=>o,U={toAttribute(o,t){switch(t){case Boolean:o=o?Pt:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},V=(o,t)=>!At(o,t),rt={attribute:!0,type:String,converter:U,reflect:!1,hasChanged:V};Symbol.metadata??=Symbol("metadata"),I.litPropertyMetadata??=new WeakMap;var m=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=rt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&xt(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:n}=St(this.prototype,t)??{get(){return this[e]},set(r){this[e]=r}};return{get(){return i?.call(this)},set(r){let h=i?.call(this);n.call(this,r),this.requestUpdate(t,h,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??rt}static _$Ei(){if(this.hasOwnProperty(R("elementProperties")))return;let t=Ct(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(R("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(R("properties"))){let e=this.properties,s=[...wt(e),...Et(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(D(i))}else t!==void 0&&e.push(D(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return J(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let n=(s.converter?.toAttribute!==void 0?s.converter:U).toAttribute(e,s.type);this._$Em=t,n==null?this.removeAttribute(i):this.setAttribute(i,n),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let n=s.getPropertyOptions(i),r=typeof n.converter=="function"?{fromAttribute:n.converter}:n.converter?.fromAttribute!==void 0?n.converter:U;this._$Em=i,this[i]=r.fromAttribute(e,n.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??V)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,n]of this._$Ep)this[i]=n;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,n]of s)n.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],n)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};m.elementStyles=[],m.shadowRootOptions={mode:"open"},m[R("elementProperties")]=new Map,m[R("finalized")]=new Map,kt?.({ReactiveElement:m}),(I.reactiveElementVersions??=[]).push("2.0.4");var G=globalThis,q=G.trustedTypes,at=q?q.createPolicy("lit-html",{createHTML:o=>o}):void 0,ut="$lit$",g=`lit$${Math.random().toFixed(9).slice(2)}$`,mt="?"+g,Rt=`<${mt}>`,A=document,O=()=>A.createComment(""),N=o=>o===null||typeof o!="object"&&typeof o!="function",tt=Array.isArray,Ut=o=>tt(o)||typeof o?.[Symbol.iterator]=="function",K=`[ +\f\r]`,M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,lt=/-->/g,ht=/>/g,_=RegExp(`>|${K}(?:([^\\s"'>=/]+)(${K}*=${K}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`,"g"),ct=/'/g,dt=/"/g,ft=/^(?:script|style|textarea|title)$/i,et=o=>(t,...e)=>({_$litType$:o,strings:t,values:e}),st=et(1),qt=et(2),Bt=et(3),x=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),pt=new WeakMap,b=A.createTreeWalker(A,129);function gt(o,t){if(!tt(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return at!==void 0?at.createHTML(t):t}var Mt=(o,t)=>{let e=o.length-1,s=[],i,n=t===2?"":t===3?"":"",r=M;for(let h=0;h"?(r=i??M,l=-1):p[1]===void 0?l=-2:(l=r.lastIndex-p[2].length,d=p[1],r=p[3]===void 0?_:p[3]==='"'?dt:ct):r===dt||r===ct?r=_:r===lt||r===ht?r=M:(r=_,i=void 0);let f=r===_&&o[h+1].startsWith("/>")?" ":"";n+=r===M?a+Rt:l>=0?(s.push(d),a.slice(0,l)+ut+a.slice(l)+g+f):a+g+(l===-2?h:f)}return[gt(o,n+(o[e]||"")+(t===2?"":t===3?"":"")),s]},H=class o{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let n=0,r=0,h=t.length-1,a=this.parts,[d,p]=Mt(t,e);if(this.el=o.createElement(d,s),b.currentNode=this.el.content,e===2||e===3){let l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(i=b.nextNode())!==null&&a.length0){i.textContent=q?q.emptyScript:"";for(let f=0;f2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=c}_$AI(t,e=this,s,i){let n=this.strings,r=!1;if(n===void 0)t=E(this,t,e,0),r=!N(t)||t!==this._$AH&&t!==x,r&&(this._$AH=t);else{let h=t,a,d;for(t=n[0],a=0;a{let s=e?.renderBefore??t,i=s._$litPart$;if(i===void 0){let n=e?.renderBefore??null;s._$litPart$=i=new T(t.insertBefore(O(),n),n,void 0,e??{})}return i._$AI(o),i};var y=class extends m{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=yt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return x}};y._$litElement$=!0,y.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:y});var Nt=globalThis.litElementPolyfillSupport;Nt?.({LitElement:y});(globalThis.litElementVersions??=[]).push("4.1.0");var Ht={attribute:!0,type:String,converter:U,reflect:!1,hasChanged:V},Tt=(o=Ht,t,e)=>{let{kind:s,metadata:i}=e,n=globalThis.litPropertyMetadata.get(i);if(n===void 0&&globalThis.litPropertyMetadata.set(i,n=new Map),n.set(e.name,o),s==="accessor"){let{name:r}=e;return{set(h){let a=t.get.call(this);t.set.call(this,h),this.requestUpdate(r,a,o)},init(h){return h!==void 0&&this.P(r,void 0,o),h}}}if(s==="setter"){let{name:r}=e;return function(h){let a=this[r];t.call(this,h),this.requestUpdate(r,a,o)}}throw Error("Unsupported decorator location: "+s)};function S(o){return(t,e)=>typeof e=="object"?Tt(o,t,e):((s,i,n)=>{let r=i.hasOwnProperty(n);return i.constructor.createProperty(n,r?{...s,wrapped:!0}:s),r?Object.getOwnPropertyDescriptor(i,n):void 0})(o,t,e)}var $t=v` + .legacy-button { + align-items: center; + background-color: var(--jp-layout-color2); + border-width: 0; + box-shadow: none; + color: var(--jp-ui-font-color1); + cursor: pointer; + display: flex; + font-family: "Helvetica Neue", Arial, Helvetica, sans-serif; + font-size: var(--jp-widgets-font-size); + justify-content: center; + line-height: var(--jp-widgets-inline-height); + padding: 0; + } + + .legacy-button.primary { + background-color: var(--jp-brand-color1); + color: var(--jp-ui-inverse-font-color1); + } + + .legacy-button:hover:enabled, + .legacy-button:focus:enabled { + box-shadow: var(--jp-elevation-z2); + } + + .legacy-slider { + -webkit-appearance: none; + appearance: none; + background: var(--jp-layout-color3); + border-radius: 3px; + height: 4px; + outline: none; + } + + .legacy-slider::-webkit-slider-thumb, + .legacy-slider::-moz-range-thumb { + -moz-appearance: none; + -webkit-appearance: none; + appearance: none; + border-radius: 50%; + cursor: pointer; + height: var(--jp-widgets-slider-handle-size); + width: var(--jp-widgets-slider-handle-size); + } + + .legacy-text { + color: var(--jp-widgets-label-color); + font-family: "Helvetica Neue", Arial, Helvetica, sans-serif; + font-size: var(--jp-widgets-font-size); + height: var(--jp-widgets-inline-height); + line-height: var(--jp-widgets-inline-height); + } +`;var vt=v` + @font-face { + font-family: 'Material Symbols Outlined'; + font-style: normal; + font-weight: 400; + src: url(https://fonts.gstatic.com/s/materialsymbolsoutlined/v205/kJF1BvYX7BgnkSrUwT8OhrdQw4oELdPIeeII9v6oDMzByHX9rA6RzaxHMPdY43zj-jCxv3fzvRNU22ZXGJpEpjC_1v-p_4MrImHCIJIZrDCvHOejbd5zrDAt.woff2) format('woff2'); + } + + .material-symbols-outlined { + -webkit-font-feature-settings: 'liga'; + -webkit-font-smoothing: antialiased; + direction: ltr; + display: inline-block; + font-family: 'Material Symbols Outlined'; + font-style: normal; + font-weight: normal; + letter-spacing: normal; + line-height: 1; + text-transform: none; + white-space: nowrap; + word-wrap: normal; + } +`;var $=class $ extends y{constructor(){super(...arguments);this._model=void 0;this.name="";this.visible=!0;this.opacity=0;this.isLoading=!1;this.isConfirmDialogVisible=!1}static get componentName(){return"layer-manager-row"}static{this.styles=[$t,vt,v` + .row { + align-items: center; + display: flex; + gap: 4px; + height: 30px; + } + + .layer-name { + flex-grow: 1; + max-width: 150px; + overflow: hidden; + text-overflow: ellipsis; + } + + .settings-delete-button { + font-size: 14px; + height: 26px; + width: 26px; + } + + .layer-opacity-slider { + width: 70px; + } + + .layer-visibility-checkbox { + margin: 2px; + } + + .spinner { + -webkit-animation: spin 2s linear infinite; + animation: spin 2s linear infinite; + border-radius: 50%; + border: 4px solid var(--jp-widgets-input-border-color); + border-top: 4px solid var(--jp-widgets-color); + height: 12px; + width: 12px; + } + + @-webkit-keyframes spin { + 0% { -webkit-transform: rotate(0deg); } + 100% { -webkit-transform: rotate(360deg); } + } + + @keyframes spin { + 0% { transform: rotate(0deg); } + 100% { transform: rotate(360deg); } + } + + button.loading .spinner, + button.loading:hover .close-icon, + button.done-loading .close-icon { + display: block; + } + + button.loading .close-icon, + button.loading:hover .spinner, + button.done-loading .spinner { + display: none; + } + + .remove-layer-text { + flex-grow: 1; + } + + .confirm-deny-button { + height: 26px; + width: 70px; + } + `]}static{this.modelNameToViewName=new Map([["name","name"],["visible","visible"],["opacity","opacity"],["is_loading","isLoading"]])}set model(e){this._model=e;for(let[s,i]of $.modelNameToViewName)i&&(this[i]=e.get(s),e.on(`change:${s}`,()=>{this[i]=e.get(s)}))}render(){return st` +
+ + ${this.name} + + + +
+ ${this.renderConfirmDialog()} + `}renderConfirmDialog(){return this.isConfirmDialogVisible?st` +
+ Remove layer? + + +
+ `:c}updated(e){for(let[s,i]of e)this._model?.set(s,this[s]);this._model?.save_changes()}onLayerVisibilityChanged(e){let s=e.target;this.visible=s.checked}onLayerOpacityChanged(e){let s=e.target;this.opacity=parseFloat(s.value)}onSettingsClicked(e){this._model?.send({type:"click",id:"settings"})}onDeleteClicked(e){this.isConfirmDialogVisible=!0}confirmDeletion(e){this._model?.send({type:"click",id:"delete"})}cancelDeletion(e){this.isConfirmDialogVisible=!1}};w([S()],$.prototype,"name",2),w([S()],$.prototype,"visible",2),w([S()],$.prototype,"opacity",2),w([S()],$.prototype,"isLoading",2),w([S()],$.prototype,"isConfirmDialogVisible",2);var P=$;customElements.get(P.componentName)||customElements.define(P.componentName,P);function jt({model:o,el:t}){let e=document.createElement(P.componentName);e.model=o,t.appendChild(e)}var Ve={render:jt};export{P as LayerManagerRow,Ve as default}; +/*! Bundled license information: + +@lit/reactive-element/css-tag.js: + (** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/reactive-element.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +lit-html/lit-html.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +lit-element/lit-element.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +lit-html/is-server.js: + (** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/decorators/custom-element.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/decorators/property.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/decorators/state.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/decorators/event-options.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/decorators/base.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/decorators/query.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/decorators/query-all.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/decorators/query-async.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/decorators/query-assigned-elements.js: + (** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/decorators/query-assigned-nodes.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) +*/ +//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vbm9kZV9tb2R1bGVzL0BsaXQvcmVhY3RpdmUtZWxlbWVudC9zcmMvY3NzLXRhZy50cyIsICIuLi8uLi9ub2RlX21vZHVsZXMvQGxpdC9yZWFjdGl2ZS1lbGVtZW50L3NyYy9yZWFjdGl2ZS1lbGVtZW50LnRzIiwgIi4uLy4uL25vZGVfbW9kdWxlcy9saXQtaHRtbC9zcmMvbGl0LWh0bWwudHMiLCAiLi4vLi4vbm9kZV9tb2R1bGVzL2xpdC1lbGVtZW50L3NyYy9saXQtZWxlbWVudC50cyIsICIuLi8uLi9ub2RlX21vZHVsZXMvQGxpdC9yZWFjdGl2ZS1lbGVtZW50L3NyYy9kZWNvcmF0b3JzL3Byb3BlcnR5LnRzIiwgIi4uLy4uL2pzL2lweXdpZGdldHNfc3R5bGVzLnRzIiwgIi4uLy4uL2pzL21hdGVyaWFsX3N0eWxlcy50cyIsICIuLi8uLi9qcy9sYXllcl9tYW5hZ2VyX3Jvdy50cyJdLAogICJzb3VyY2VzQ29udGVudCI6IFsiLyoqXG4gKiBAbGljZW5zZVxuICogQ29weXJpZ2h0IDIwMTkgR29vZ2xlIExMQ1xuICogU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IEJTRC0zLUNsYXVzZVxuICovXG5cbmNvbnN0IE5PREVfTU9ERSA9IGZhbHNlO1xuXG4vLyBBbGxvd3MgbWluaWZpZXJzIHRv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gYW5kIGl0J2xsIGJlIG9mZiBieSAxIGluIHRoZSBlbGVtZW50XG4gICAgICAgIC8vIGFuZCBvZmYgYnkgdHdvIGFmdGVyIGl0LlxuICAgICAgICBpZiAoKG5vZGUgYXMgRWxlbWVudCkuaGFzQXR0cmlidXRlcygpKSB7XG4gICAgICAgICAgZm9yIChjb25zdCBuYW1lIG9mIChub2RlIGFzIEVsZW1lbnQpLmdldEF0dHJpYnV0ZU5hbWVzKCkpIHtcbiAgICAgICAgICAgIGlmIChuYW1lLmVuZHNXaXRoKGJvdW5kQXR0cmlidXRlU3VmZml4KSkge1xuICAgICAgICAgICAgICBjb25zdCByZWFsTmFtZSA9IGF0dHJOYW1lc1thdHRyTmFtZUluZGV4KytdO1xuICAgICAgICAgICAgICBjb25zdCB2YWx1ZSA9IChub2RlIGFzIEVsZW1lbnQpLmdldEF0dHJpYnV0ZShuYW1lKSE7XG4gICAgICAgICAgICAgIGNvbnN0IHN0YXRpY3MgPSB2YWx1ZS5zcGxpdChtYXJrZXIpO1xuICAgICAgICAgICAgICBjb25zdCBtID0gLyhbLj9AXSk/KC4qKS8uZXhlYyhyZWFsTmFtZSkhO1xuICAgICAgICAgICAgICBwYXJ0cy5wdXNoKHtcbiAgICAgICAgICAgICAgICB0eXBlOiBBVFRSSUJVVEVfUEFSVCxcbiAgICAgICAgICAgICAgICBpbmRleDogbm9kZUluZGV4LFxuICAgICAgICAgICAgICAgIG5hbWU6IG1bMl0sXG4gICAgICAgICAgICAgICAgc3RyaW5nczogc3RhdGljcyxcbiAgICAgICAgICAgICAgICBjdG9yOlxuICAgICAgICAgICAgICAgICAgbVsxXSA9PT0gJy4nXG4gICAgICAgICAgICAgICAgICAgID8gUHJvcGVydHlQYXJ0XG4gICAgICAgICAgICAgICAgICAgIDogbVsxXSA9PT0gJz8nXG4gICAgICAgICAgICAgICAgICAgICAgPyBCb29sZWFuQXR0cmlidXRlUGFydFxuICAgICAgICAgICAgICAgICAgICAgIDogbVsxXSA9PT0gJ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leDtcbiAgICAgICAgICAgICAgICBnYXA6IDRweDtcbiAgICAgICAgICAgICAgICBoZWlnaHQ6IDMwcHg7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC5sYXllci1uYW1lIHtcbiAgICAgICAgICAgICAgICBmbGV4LWdyb3c6IDE7XG4gICAgICAgICAgICAgICAgbWF4LXdpZHRoOiAxNTBweDtcbiAgICAgICAgICAgICAgICBvdmVyZmxvdzogaGlkZGVuO1xuICAgICAgICAgICAgICAgIHRleHQtb3ZlcmZsb3c6IGVsbGlwc2lzO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAuc2V0dGluZ3MtZGVsZXRlLWJ1dHRvbiB7XG4gICAgICAgICAgICAgICAgZm9udC1zaXplOiAxNHB4O1xuICAgICAgICAgICAgICAgIGhlaWdodDogMjZweDtcbiAgICAgICAgICAgICAgICB3aWR0aDogMjZweDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLmxheWVyLW9wYWNpdHktc2xpZGVyIHtcbiAgICAgICAgICAgICAgICB3aWR0aDogNzBweDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLmxheWVyLXZpc2liaWxpdHktY2hlY2tib3gge1xuICAgICAgICAgICAgICAgIG1hcmdpbjogMnB4O1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAuc3Bpbm5lciB7XG4gICAgICAgICAgICAgICAgLXdlYmtpdC1hbmltYXRpb246IHNwaW4gMnMgbGluZWFyIGluZmluaXRlO1xuICAgICAgICAgICAgICAgIGFuaW1hdGlvbjogc3BpbiAycyBsaW5lYXIgaW5maW5pdGU7XG4gICAgICAgICAgICAgICAgYm9yZGVyLXJhZGl1czogNTAlO1xuICAgICAgICAgICAgICAgIGJvcmRlcjogNHB4IHNvbGlkIHZhcigtLWpwLXdpZGdldHMtaW5wdXQtYm9yZGVyLWNvbG9yKTtcbiAgICAgICAgICAgICAgICBib3JkZXItdG9wOiA0cHggc29saWQgdmFyKC0tanAtd2lkZ2V0cy1jb2xvcik7XG4gICAgICAgICAgICAgICAgaGVpZ2h0OiAxMnB4O1xuICAgICAgICAgICAgICAgIHdpZHRoOiAxMnB4O1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBALXdlYmtpdC1rZXlmcmFtZXMgc3BpbiB7XG4gICAgICAgICAgICAgICAgMCUgeyAtd2Via2l0LXRyYW5zZm9ybTogcm90YXRlKDBkZWcpOyB9XG4gICAgICAgICAgICAgICAgMTAwJSB7IC13ZWJraXQtdHJhbnNmb3JtOiByb3RhdGUoMzYwZGVnKTsgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBAa2V5ZnJhbWVzIHNwaW4ge1xuICAgICAgICAgICAgICAgIDAlIHsgdHJhbnNmb3JtOiByb3RhdGUoMGRlZyk7IH1cbiAgICAgICAgICAgICAgICAxMDAlIHsgdHJhbnNmb3JtOiByb3RhdGUoMzYwZGVnKTsgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIFxuICAgICAgICAgICAgYnV0dG9uLmxvYWRpbmcgLnNwaW5uZXIsXG4gICAgICAgICAgICBidXR0b24ubG9hZGluZzpob3ZlciAuY2xvc2UtaWNvbixcbiAgICAgICAgICAgIGJ1dHRvbi5kb25lLWxvYWRpbmcgLmNsb3NlLWljb24ge1xuICAgICAgICAgICAgICAgIGRpc3BsYXk6IGJsb2NrO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBidXR0b24ubG9hZGluZyAuY2xvc2UtaWNvbixcbiAgICAgICAgICAgIGJ1dHRvbi5sb2FkaW5nOmhvdmVyIC5zcGlubmVyLFxuICAgICAgICAgICAgYnV0dG9uLmRvbmUtbG9hZGluZyAuc3Bpbm5lciB7XG4gICAgICAgICAgICAgICAgZGlzcGxheTogbm9uZTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLnJlbW92ZS1sYXllci10ZXh0IHtcbiAgICAgICAgICAgICAgICBmbGV4LWdyb3c6IDE7XG4gICAgICA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c3RlbiBmb3IgdXBkYXRlcyB0byB0aGUgbW9kZWwuXG4gICAgICAgICAgICAgICAgbW9kZWwub24oYGNoYW5nZToke21vZGVsS2V5fWAsICgpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgKHRoaXMgYXMgYW55KVt3aWRnZXRLZXldID0gbW9kZWwuZ2V0KG1vZGVsS2V5KTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIEBwcm9wZXJ0eSgpXG4gICAgbmFtZTogc3RyaW5nID0gXCJcIjtcblxuICAgIEBwcm9wZXJ0eSgpXG4gICAgdmlzaWJsZTogYm9vbGVhbiA9IHRydWU7XG5cbiAgICBAcHJvcGVydHkoKVxuICAgIG9wYWNpdHk6IG51bWJlciA9IDA7XG5cbiAgICBAcHJvcGVydHkoKVxuICAgIGlzTG9hZGluZzogYm9vbGVhbiA9IGZhbHNlO1xuXG4gICAgQHByb3BlcnR5KClcbiAgICBpc0NvbmZpcm1EaWFsb2dWaXNpYmxlOiBib29sZWFuID0gZmFsc2U7XG5cbiAgICByZW5kZXIoKTogVGVtcGxhdGVSZXN1bHQge1xuICAgICAgICByZXR1cm4gaHRtbGBcbiAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJyb3dcIj5cbiAgICAgICAgICAgICAgICA8aW5wdXRcbiAgICAgICAgICAgICAgICAgICAgdHlwZT1cImNoZWNrYm94XCJcbiAgICAgICAgICAgICAgICAgICAgY2xhc3M9XCJsYXllci12aXNpYmlsaXR5LWNoZWNrYm94XCJcbiAgICAgICAgICAgICAgICAgICAgLmNoZWNrZWQ9XCIke3RoaXMudmlzaWJsZX1cIlxuICAgICAgICAgICAgICAgICAgICBAY2hhbmdlPVwiJHt0aGlzLm9uTGF5ZXJWaXNpYmlsaXR5Q2hhbmdlZH1cIlxuICAgICAgICAgICAgICAgIC8+XG4gICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJsZWdhY3ktdGV4dCBsYXllci1uYW1lXCI+JHt0aGlzLm5hbWV9PC9zcGFuPlxuICAgICAgICAgICAgICAgIDxpbnB1dFxuICAgICAgICAgICAgICAgICAgICB0eXBlPVwicmFuZ2VcIlxuICAgICAgICAgICAgICAgICAgICBjbGFzcz1cImxlZ2FjeS1zbGlkZXIgbGF5ZXItb3BhY2l0eS1zbGlkZXJcIlxuICAgICAgICAgICAgICAgICAgICBtaW49XCIwXCJcbiAgICAgICAgICAgICAgICAgICAgbWF4PVwiMVwiXG4gICAgICAgICAgICAgICAgICAgIHN0ZXA9XCIwLjAxXCJcbiAgICAgICAgICAgICAgICAgICAgLnZhbHVlPVwiJHt0aGlzLm9wYWNpdHl9XCJcbiAgICAgICAgICAgICAgICAgICAgQGlucHV0PVwiJHt0aGlzLm9uTGF5ZXJPcGFjaXR5Q2hhbmdlZH1cIlxuICAgICAgICAgICAgICAgIC8+XG4gICAgICAgICAgICAgICAgPGJ1dHRvblxuICAgICAgICAgICAgICAgICAgICBjbGFzcz1cImxlZ2FjeS1idXR0b24gc2V0dGluZ3MtZGVsZXRlLWJ1dHRvblwiXG4gICAgICAgICAgICAgICAgICAgIEBjbGljaz1cIiR7dGhpcy5vblNldHRpbmdzQ2xpY2tlZH1cIlxuICAgICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJtYXRlcmlhbC1zeW1ib2xzLW91dGxpbmVkXCI+JiN4ZThiODs8L3NwYW4+XG4gICAgICAgICAgICAgICAgPC9idXR0b24+XG4gICAgICAgICAgICAgICAgPGJ1dHRvblxuICAgICAgICAgICAgICAgICAgICBjbGFzcz1cImxlZ2FjeS1idXR0b24gc2V0dGluZ3MtZGVsZXRlLWJ1dHRvbiAke3RoaXMuaXNMb2FkaW5nID8gJ2xvYWRpbmcnIDogJ2RvbmUtbG9hZGluZyd9XCJcbiAgICAgICAgICAgICAgICAgICAgQGNsaWNrPVwiJHt0aGlzLm9uRGVsZXRlQ2xpY2tlZH1cIlxuICAgICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInNwaW5uZXJcIj48L2Rpdj5cbiAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJjbG9zZS1pY29uIG1hdGVyaWFsLXN5bWJvbHMtb3V0bGluZWRcIj4mI3hlNWNkOzwvc3Bhbj5cbiAgICAgICAgICAgICAgICA8L2J1dHRvbj5cbiAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgJHt0aGlzLnJlbmRlckNvbmZpcm1EaWFsb2coKX1cbiAgICAgICAgYDtcbiAgICB9XG5cbiAgICBwcml2YXRlIHJlbmRlckNvbmZpcm1EaWFsb2coKTogVGVtcGxhdGVSZXN1bHQgfCB2b2lkIHtcbiAgICAgICAgaWYgKCF0aGlzLmlzQ29uZmlybURpYWxvZ1Zpc2libGUpIHtcbiAgICAgICAgICAgIHJldHVybiBub3RoaW5nO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBodG1sYFxuICAgICAgICAgICAgPGRpdiBjbGFzcz1cInJvd1wiPlxuICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwibGVnYWN5LXRleHQgcmVtb3ZlLWxheWVyLXRleHRcIj5SZW1vdmUgbGF5ZXI/PC9zcGFuPlxuICAgICAgICAgICAgICAgICAgICA8YnV0dG9uXG4gICAgICAgICAgICAgICAgICAgICAgICBjbGFzcz1cImxlZ2FjeS1idXR0b24gcHJpbWFyeSBjb25maXJtLWRlbnktYnV0dG9uXCJcbiAgICAgICAgICAgICAgICAgICAgICAgIEBjbGljaz1cIiR7dGhpcy5jb25maXJtRGVsZXRpb259XCJcbiAgICAgICAgICAgICAgICAgICAgPlxuICAgICAgICAgICAgICAgICAgICAgICAgWWVzXG4gICAgICAgICAgICAgICAgICAgIDwvYnV0dG9uPlxuICAgICAgICAgICAgICAgICAgICA8YnV0dG9uXG4gICAgICAgICAgICAgICAgICAgICAgICBjbGFzcz1cImxlZ2F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l9fZGVjb3JhdGVDbGFzcyIsICJuIiwgIkxheWVyTWFuYWdlclJvdyIsICJyZW5kZXIiLCAiZWwiLCAicm93IiwgImxheWVyX21hbmFnZXJfcm93X2RlZmF1bHQiXQp9Cg== diff --git a/geemap/static/material_styles.js b/geemap/static/material_styles.js new file mode 100644 index 0000000000..7207557d14 --- /dev/null +++ b/geemap/static/material_styles.js @@ -0,0 +1,63 @@ +var R=globalThis,T=R.ShadowRoot&&(R.ShadyCSS===void 0||R.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,L=Symbol(),F=new WeakMap,b=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==L)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(T&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=F.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&F.set(e,t))}return t}toString(){return this.cssText}},Q=o=>new b(typeof o=="string"?o:o+"",void 0,L),z=(o,...t)=>{let e=o.length===1?o[0]:t.reduce((s,i,r)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+o[r+1],o[0]);return new b(e,o,L)},I=(o,t)=>{if(T)o.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=R.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,o.appendChild(s)}},M=T?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return Q(e)})(o):o;var{is:pt,defineProperty:ut,getOwnPropertyDescriptor:$t,getOwnPropertyNames:ft,getOwnPropertySymbols:_t,getPrototypeOf:mt}=Object,N=globalThis,Y=N.trustedTypes,At=Y?Y.emptyScript:"",gt=N.reactiveElementPolyfillSupport,w=(o,t)=>o,j={toAttribute(o,t){switch(t){case Boolean:o=o?At:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},tt=(o,t)=>!pt(o,t),G={attribute:!0,type:String,converter:j,reflect:!1,hasChanged:tt};Symbol.metadata??=Symbol("metadata"),N.litPropertyMetadata??=new WeakMap;var $=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=G){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&ut(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:r}=$t(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i?.call(this)},set(n){let p=i?.call(this);r.call(this,n),this.requestUpdate(t,p,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??G}static _$Ei(){if(this.hasOwnProperty(w("elementProperties")))return;let t=mt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(w("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(w("properties"))){let e=this.properties,s=[...ft(e),..._t(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(M(i))}else t!==void 0&&e.push(M(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return I(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let r=(s.converter?.toAttribute!==void 0?s.converter:j).toAttribute(e,s.type);this._$Em=t,r==null?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let r=s.getPropertyOptions(i),n=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute!==void 0?r.converter:j;this._$Em=i,this[i]=n.fromAttribute(e,r.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??tt)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,r]of this._$Ep)this[i]=r;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,r]of s)r.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],r)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[w("elementProperties")]=new Map,$[w("finalized")]=new Map,gt?.({ReactiveElement:$}),(N.reactiveElementVersions??=[]).push("2.0.4");var K=globalThis,k=K.trustedTypes,et=k?k.createPolicy("lit-html",{createHTML:o=>o}):void 0,ht="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,at="?"+_,yt=`<${at}>`,g=document,x=()=>g.createComment(""),P=o=>o===null||typeof o!="object"&&typeof o!="function",X=Array.isArray,vt=o=>X(o)||typeof o?.[Symbol.iterator]=="function",B=`[ +\f\r]`,C=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,st=/-->/g,it=/>/g,m=RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`,"g"),ot=/'/g,rt=/"/g,lt=/^(?:script|style|textarea|title)$/i,Z=o=>(t,...e)=>({_$litType$:o,strings:t,values:e}),Ut=Z(1),Ht=Z(2),Ot=Z(3),y=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),nt=new WeakMap,A=g.createTreeWalker(g,129);function ct(o,t){if(!X(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return et!==void 0?et.createHTML(t):t}var St=(o,t)=>{let e=o.length-1,s=[],i,r=t===2?"":t===3?"":"",n=C;for(let p=0;p"?(n=i??C,a=-1):d[1]===void 0?a=-2:(a=n.lastIndex-d[2].length,l=d[1],n=d[3]===void 0?m:d[3]==='"'?rt:ot):n===rt||n===ot?n=m:n===st||n===it?n=C:(n=m,i=void 0);let f=n===m&&o[p+1].startsWith("/>")?" ":"";r+=n===C?h+yt:a>=0?(s.push(l),h.slice(0,a)+ht+h.slice(a)+_+f):h+_+(a===-2?p:f)}return[ct(o,r+(o[e]||"")+(t===2?"":t===3?"":"")),s]},U=class o{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let r=0,n=0,p=t.length-1,h=this.parts,[l,d]=St(t,e);if(this.el=o.createElement(l,s),A.currentNode=this.el.content,e===2||e===3){let a=this.el.content.firstChild;a.replaceWith(...a.childNodes)}for(;(i=A.nextNode())!==null&&h.length0){i.textContent=k?k.emptyScript:"";for(let f=0;f2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=c}_$AI(t,e=this,s,i){let r=this.strings,n=!1;if(r===void 0)t=v(this,t,e,0),n=!P(t)||t!==this._$AH&&t!==y,n&&(this._$AH=t);else{let p=t,h,l;for(t=r[0],h=0;h{let s=e?.renderBefore??t,i=s._$litPart$;if(i===void 0){let r=e?.renderBefore??null;s._$litPart$=i=new H(t.insertBefore(x(),r),r,void 0,e??{})}return i._$AI(o),i};var E=class extends ${constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=dt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return y}};E._$litElement$=!0,E.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:E});var bt=globalThis.litElementPolyfillSupport;bt?.({LitElement:E});(globalThis.litElementVersions??=[]).push("4.1.0");var Jt=z` + @font-face { + font-family: 'Material Symbols Outlined'; + font-style: normal; + font-weight: 400; + src: url(https://fonts.gstatic.com/s/materialsymbolsoutlined/v205/kJF1BvYX7BgnkSrUwT8OhrdQw4oELdPIeeII9v6oDMzByHX9rA6RzaxHMPdY43zj-jCxv3fzvRNU22ZXGJpEpjC_1v-p_4MrImHCIJIZrDCvHOejbd5zrDAt.woff2) format('woff2'); + } + + .material-symbols-outlined { + -webkit-font-feature-settings: 'liga'; + -webkit-font-smoothing: antialiased; + direction: ltr; + display: inline-block; + font-family: 'Material Symbols Outlined'; + font-style: normal; + font-weight: normal; + letter-spacing: normal; + line-height: 1; + text-transform: none; + white-space: nowrap; + word-wrap: normal; + } +`;export{Jt as materialStyles}; +/*! Bundled license information: + +@lit/reactive-element/css-tag.js: + (** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/reactive-element.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +lit-html/lit-html.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +lit-element/lit-element.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +lit-html/is-server.js: + (** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) +*/ +//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vbm9kZV9tb2R1bGVzL0BsaXQvcmVhY3RpdmUtZWxlbWVudC9zcmMvY3NzLXRhZy50cyIsICIuLi8uLi9ub2RlX21vZHVsZXMvQGxpdC9yZWFjdGl2ZS1lbGVtZW50L3NyYy9yZWFjdGl2ZS1lbGVtZW50LnRzIiwgIi4uLy4uL25vZGVfbW9kdWxlcy9saXQtaHRtbC9zcmMvbGl0LWh0bWwudHMiLCAiLi4vLi4vbm9kZV9tb2R1bGVzL2xpdC1lbGVtZW50L3NyYy9saXQtZWxlbWVudC50cyIsICIuLi8uLi9qcy9tYXRlcmlhbF9zdHlsZXMudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbIi8qKlxuICogQGxpY2Vuc2VcbiAqIENvcHlyaWdodCAyMDE5IEdvb2dsZSBMTENcbiAqIFNQRFgtTGljZW5zZS1JZGVudGlmaWVyOiBCU0QtMy1DbGF1c2VcbiAqL1xuXG5jb25zdCBOT0RFX01PREUgPSBmYWxzZTtcblxuLy8gQWxsb3dzIG1pbmlmaWVycyB0byByZW5hbWUgcmVmZXJlbmNlcyB0byBnbG9iYWxUaGlzXG5jb25zdCBnbG9iYWwgPSBnbG9iYWxUaGlzO1xuXG4vKipcbiAqIFdoZXRoZXIgdGhlIGN1cnJlbnQgYnJvd3NlciBzdXBwb3J0cyBgYWRvcHRlZFN0eWxlU2hlZXRzYC5cbiAqL1xuZXhwb3J0IGNvbnN0IHN1cHBvcnRzQWRvcHRpbmdTdHlsZVNoZWV0czogYm9vbGVhbiA9XG4gIGdsb2JhbC5TaGFkb3dSb290ICYmXG4gIChnbG9iYWwuU2hhZHlDU1MgPT09IHVuZGVmaW5l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lQsXG4gICAgICAgICAgICAgICAgaW5kZXg6IG5vZGVJbmRleCxcbiAgICAgICAgICAgICAgICBuYW1lOiBtWzJdLFxuICAgICAgICAgICAgICAgIHN0cmluZ3M6IHN0YXRpY3MsXG4gICAgICAgICAgICAgICAgY3RvcjpcbiAgICAgICAgICAgICAgICAgIG1bMV0gPT09ICcuJ1xuICAgICAgICAgICAgICAgICAgICA/IFByb3BlcnR5UGFydFxuICAgICAgICAgICAgICAgICAgICA6IG1bMV0gPT09ICc/J1xuICAgICAgICAgICAgICAgICAgICAgID8gQm9vbGVhbkF0dHJpYnV0ZVBhcnRcbiAgICAgICAgICAgICAgICAgICAgICA6IG1bMV0gPT09ICdAJ1xuICAgICAgICAgICAgICAgICAgICAgICAgPyBFdmVudFBhcnRcbiAgICAgICAgICAgICAgICAgICAgICAgIDogQXR0cmlidXRlUGFydCxcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgIChub2RlIGFzIEVsZW1lbnQpLnJlbW92ZUF0dHJpYnV0ZShuYW1lKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobmFtZS5zdGFydHNXaXRoKG1hcmtlcikpIHtcbiAgICAgICAgICAgICAgcGFydHMucHVzaCh7XG4gICAgICAgICAgICAgICAgdHlwZTogRUxFTUVOVF9QQVJULFxuICAgICAgICAgICAgICAgIGluZGV4OiBub2RlSW5kZXgsXG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAobm9kZSBhcyBFbGVtZW50KS5yZW1vdmVBdHRyaWJ1dGUobmFtZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIC8vIFRPRE8gKGp1c3RpbmZhZ25hbmkpOiBiZW5jaG1hcmsgdGhlIHJlZ2V4IGFnYWluc3QgdGVzdGluZyBmb3IgZWFjaFxuICAgICAgICAvLyBvZiB0aGUgMyByYXcgdGV4dCBlbGVtZW50IG5hbWVzLlxuICAgICAgICBpZiAocmF3VGV4dE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0eSByaXNrLCBhcyBzdHlsZSBpbmplY3Rpb24gYXR0YWNrcyBjYW4gYCArXG4gICAgICAgICAgICAgICAgYGV4ZmlsdHJhdGUgZGF0YSBhbmQgc3Bvb2YgVUlzLiBgICtcbiAgICAgICAgICAgICAgICBgQ29uc2lkZXIgaW5zdGVhZCB1c2luZyBjc3NcXGAuLi5cXGAgbGl0ZXJhbHMgYCArXG4gICAgICAgICAgICAgICAgYHRvIGNvbXBvc2Ugc3R5bGVzLCBhbmQgZG8gZHluYW1pYyBzdHlsaW5nIHdpdGggYCArXG4gICAgICAgICAgICAgICAgYGNzcyBjdXN0b20gcHJvcGVydGllcywgOjpwYXJ0cywgPHNsb3Q+cywgYCArXG4gICAgICAgICAgICAgICAgYGFuZCBieSBtdXRhdGluZyB0aGUgRE9NIHJhdGhlciB0aGFuIHN0eWxlc2hlZXRzLmA7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBtZXNzYWdlID1cbiAgICAgICAgICAgICAgICBgTGl0IGRvZXMgbm90IHN1cHBvcnQgYmluZGluZyBpbnNpZGUgc2NyaXB0IG5vZGVzLiBgICtcbiAgICAgICAgICAgICAgICBgVGhpcyBpcyBhIHNlY3VyaXR5IHJpc2ssIGFzIGl0IGNvdWxkIGFsbG93IGFyYml0cmFyeSBgICtcbiAgICAgICAgICAgICAgICBgY29kZSBleGVjdXRpb24uYDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgdGhyb3cgbmV3IEVycm9yKG1lc3NhZ2UpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBkZWJ1Z0xvZ0V2ZW50ICYmXG4gICAgICAgIGRlYnVnTG9nRXZlbnQoe1xuICAgICAgICAgIGtpbmQ6ICdjb21taXQgbm9kZScsXG4gICAgICAgICAgc3RhcnQ6IHRoaXMuXyRzdGFydE5vZGUsXG4gICAgICAgICAgcGFyZW50OiB0aGlzLl8kcGFyZW50LFxuICAgICAgICAgIHZhbHV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oaWxkUGFydCIsICJsaXRIdG1sVmVyc2lvbnMiLCAicHVzaCIsICJyZW5kZXIiLCAidmFsdWUiLCAiY29udGFpbmVyIiwgIm9wdGlvbnMiLCAicGFydE93bmVyTm9kZSIsICJyZW5kZXJCZWZvcmUiLCAicGFydCIsICJlbmROb2RlIiwgImluc2VydEJlZm9yZSIsICJjcmVhdGVNYXJrZXIiLCAiXyRzZXRWYWx1ZSIsICJMaXRFbGVtZW50IiwgIlJlYWN0aXZlRWxlbWVudCIsICJjb25zdHJ1Y3RvciIsICJ0aGlzIiwgInJlbmRlck9wdGlvbnMiLCAiaG9zdCIsICJfX2NoaWxkUGFydCIsICJjcmVhdGVSZW5kZXJSb290IiwgInJlbmRlclJvb3QiLCAic3VwZXIiLCAicmVuZGVyQmVmb3JlIiwgImZpcnN0Q2hpbGQiLCAiY2hhbmdlZFByb3BlcnRpZXMiLCAidmFsdWUiLCAicmVuZGVyIiwgImhhc1VwZGF0ZWQiLCAiaXNDb25uZWN0ZWQiLCAidXBkYXRlIiwgImNvbm5lY3RlZENhbGxiYWNrIiwgInNldENvbm5lY3RlZCIsICJkaXNjb25uZWN0ZWRDYWxsYmFjayIsICJub0NoYW5nZSIsICJnbG9iYWxUaGlzIiwgImxpdEVsZW1lbnRIeWRyYXRlU3VwcG9ydCIsICJwb2x5ZmlsbFN1cHBvcnQiLCAibGl0RWxlbWVudFBvbHlmaWxsU3VwcG9ydCIsICJnbG9iYWxUaGlzIiwgImxpdEVsZW1lbnRWZXJzaW9ucyIsICJwdXNoIiwgIm1hdGVyaWFsU3R5bGVzIiwgImkiXQp9Cg== diff --git a/geemap/static/utils.js b/geemap/static/utils.js new file mode 100644 index 0000000000..103d8fd56d --- /dev/null +++ b/geemap/static/utils.js @@ -0,0 +1,2 @@ +async function d(e,i){return Promise.all(e.map(t=>i.get_model(t.slice(10))))}async function l(e,i){let t=i.get("children"),a=await d(t,i.widget_manager),r=await Promise.all(a.map(n=>n.widget_manager.create_view(n)));e.innerHTML="";for(let n of r)e.appendChild(n.el)}export{l as updateChildren}; +//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vanMvdXRpbHMudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImltcG9ydCB0eXBlIHsgQW55TW9kZWwgfSBmcm9tIFwiQGFueXdpZGdldC90eXBlc1wiO1xuaW1wb3J0IHsgSVdpZGdldE1hbmFnZXIsIFdpZGdldE1vZGVsIH0gZnJvbSBcIkBqdXB5dGVyLXdpZGdldHMvYmFzZVwiO1xuXG5hc3luYyBmdW5jdGlvbiB1bnBhY2tNb2RlbHMobW9kZWxJZHM6IEFycmF5PHN0cmluZz4sIG1hbmFnZXI6IElXaWRnZXRNYW5hZ2VyKTogUHJvbWlzZTxBcnJheTxXaWRnZXRNb2RlbD4+IHtcbiAgICByZXR1cm4gUHJvbWlzZS5hbGwoXG4gICAgICAgIG1vZGVsSWRzLm1hcChpZCA9PiBtYW5hZ2VyLmdldF9tb2RlbChpZC5zbGljZShcIklQWV9NT0RFTF9cIi5sZW5ndGgpKSlcbiAgICApO1xufVxuXG5leHBvcnQgYXN5bmMgZnVuY3Rpb24gdXBkYXRlQ2hpbGRyZW4oY29udGFpbmVyOiBIVE1MRWxlbWVudCwgbW9kZWw6IEFueU1vZGVsPGFueT4pIHtcbiAgICBjb25zdCBjaGlsZHJlbiA9IG1vZGVsLmdldChcImNoaWxkcmVuXCIpO1xuICAgIGNvbnN0IGNoaWxkX21vZGVscyA9IGF3YWl0IHVucGFja01vZGVscyhjaGlsZHJlbiwgbW9kZWwud2lkZ2V0X21hbmFnZXIpO1xuICAgIGNvbnN0IGNoaWxkX3ZpZXdzID0gYXdhaXQgUHJvbWlzZS5hbGwoXG4gICAgICAgIGNoaWxkX21vZGVscy5tYXAobW9kZWwgPT4gbW9kZWwud2lkZ2V0X21hbmFnZXIuY3JlYXRlX3ZpZXcobW9kZWwpKVxuICAgICk7XG4gICAgY29udGFpbmVyLmlubmVySFRNTCA9IGBgO1xuICAgIGZvciAoY29uc3QgY2hpbGRfdmlldyBvZiBjaGlsZF92aWV3cykge1xuICAgICAgICBjb250YWluZXIuYXBwZW5kQ2hpbGQoY2hpbGRfdmlldy5lbCk7XG4gICAgfVxufVxuIl0sCiAgIm1hcHBpbmdzIjogIkFBR0EsZUFBZUEsRUFBYUMsRUFBeUJDLEVBQXNELENBQ3ZHLE9BQU8sUUFBUSxJQUNYRCxFQUFTLElBQUlFLEdBQU1ELEVBQVEsVUFBVUMsRUFBRyxNQUFNLEVBQW1CLENBQUMsQ0FBQyxDQUN2RSxDQUNKLENBRUEsZUFBc0JDLEVBQWVDLEVBQXdCQyxFQUFzQixDQUMvRSxJQUFNQyxFQUFXRCxFQUFNLElBQUksVUFBVSxFQUMvQkUsRUFBZSxNQUFNUixFQUFhTyxFQUFVRCxFQUFNLGNBQWMsRUFDaEVHLEVBQWMsTUFBTSxRQUFRLElBQzlCRCxFQUFhLElBQUlGLEdBQVNBLEVBQU0sZUFBZSxZQUFZQSxDQUFLLENBQUMsQ0FDckUsRUFDQUQsRUFBVSxVQUFZLEdBQ3RCLFFBQVdLLEtBQWNELEVBQ3JCSixFQUFVLFlBQVlLLEVBQVcsRUFBRSxDQUUzQyIsCiAgIm5hbWVzIjogWyJ1bnBhY2tNb2RlbHMiLCAibW9kZWxJZHMiLCAibWFuYWdlciIsICJpZCIsICJ1cGRhdGVDaGlsZHJlbiIsICJjb250YWluZXIiLCAibW9kZWwiLCAiY2hpbGRyZW4iLCAiY2hpbGRfbW9kZWxzIiwgImNoaWxkX3ZpZXdzIiwgImNoaWxkX3ZpZXciXQp9Cg== diff --git a/js/common.css b/js/common.css new file mode 100644 index 0000000000..dcfde1b8aa --- /dev/null +++ b/js/common.css @@ -0,0 +1 @@ +@import url(https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined); \ No newline at end of file diff --git a/js/ipywidgets_styles.ts b/js/ipywidgets_styles.ts new file mode 100644 index 0000000000..79928f2624 --- /dev/null +++ b/js/ipywidgets_styles.ts @@ -0,0 +1,56 @@ +import { css } from "lit"; + +export const legacyStyles = css` + .legacy-button { + align-items: center; + background-color: var(--jp-layout-color2); + border-width: 0; + box-shadow: none; + color: var(--jp-ui-font-color1); + cursor: pointer; + display: flex; + font-family: "Helvetica Neue", Arial, Helvetica, sans-serif; + font-size: var(--jp-widgets-font-size); + justify-content: center; + line-height: var(--jp-widgets-inline-height); + padding: 0; + } + + .legacy-button.primary { + background-color: var(--jp-brand-color1); + color: var(--jp-ui-inverse-font-color1); + } + + .legacy-button:hover:enabled, + .legacy-button:focus:enabled { + box-shadow: var(--jp-elevation-z2); + } + + .legacy-slider { + -webkit-appearance: none; + appearance: none; + background: var(--jp-layout-color3); + border-radius: 3px; + height: 4px; + outline: none; + } + + .legacy-slider::-webkit-slider-thumb, + .legacy-slider::-moz-range-thumb { + -moz-appearance: none; + -webkit-appearance: none; + appearance: none; + border-radius: 50%; + cursor: pointer; + height: var(--jp-widgets-slider-handle-size); + width: var(--jp-widgets-slider-handle-size); + } + + .legacy-text { + color: var(--jp-widgets-label-color); + font-family: "Helvetica Neue", Arial, Helvetica, sans-serif; + font-size: var(--jp-widgets-font-size); + height: var(--jp-widgets-inline-height); + line-height: var(--jp-widgets-inline-height); + } +`; \ No newline at end of file diff --git a/js/layer_manager.ts b/js/layer_manager.ts new file mode 100644 index 0000000000..842c251466 --- /dev/null +++ b/js/layer_manager.ts @@ -0,0 +1,108 @@ +import type { AnyModel, RenderContext } from "@anywidget/types"; +import { html, css, LitElement } from "lit"; +import { property } from "lit/decorators.js"; +import { legacyStyles } from './ipywidgets_styles'; +import { updateChildren } from "./utils"; + +import "./common.css"; + +interface LayerManagerModel { + children: any; + visible: boolean; +} + +export class LayerManager extends LitElement { + static get componentName() { + return `layer-manager`; + } + + static styles = [ + legacyStyles, + css` + .container { + padding: 0 4px 2px 4px; + } + + .row { + align-items: center; + display: flex; + gap: 4px; + height: 30px; + } + + .visibility-checkbox { + margin: 2px; + } + `, + ]; + + private _model: AnyModel | undefined = undefined; + private static modelNameToViewName = new Map([ + ["children", null], + ["visible", "visible"], + ]); + + set model(model: AnyModel) { + this._model = model; + for (const [modelKey, widgetKey] of LayerManager.modelNameToViewName) { + if (widgetKey) { + // Get initial values from the Python model. + (this as any)[widgetKey] = model.get(modelKey); + // Listen for updates to the model. + model.on(`change:${modelKey}`, () => { + (this as any)[widgetKey] = model.get(modelKey); + }); + } + } + } + + @property() + visible: boolean = false; + + render() { + return html` +
+
+ + All layers on/off +
+ +
+ `; + } + + updated(changedProperties: any) { + // Update the model properties so they're reflected in Python. + for (const [property, _] of changedProperties) { + this._model?.set(property, this[property as keyof LayerManager]); + } + this._model?.save_changes(); + } + + private onLayerVisibilityChanged(event: Event) { + const target = event.target as HTMLInputElement; + this.visible = target.checked; + } +} + +if (!customElements.get(LayerManager.componentName)) { + customElements.define(LayerManager.componentName, LayerManager); +} + +async function render({ model, el }: RenderContext) { + const manager = document.createElement(LayerManager.componentName); + manager.model = model; + el.appendChild(manager); + + updateChildren(manager, model); + model.on("change:children", () => { + updateChildren(manager, model); + }); +} + +export default { render }; diff --git a/js/layer_manager_row.ts b/js/layer_manager_row.ts new file mode 100644 index 0000000000..0630432dd6 --- /dev/null +++ b/js/layer_manager_row.ts @@ -0,0 +1,238 @@ +import type { AnyModel, RenderContext } from "@anywidget/types"; +import { html, css, LitElement, TemplateResult, nothing } from "lit"; +import { property } from "lit/decorators.js"; + +import "./common.css"; +import { legacyStyles } from './ipywidgets_styles'; +import { materialStyles } from "./material_styles"; + +interface LayerManagerRowModel { + name: string; + visible: boolean; + opacity: number; + is_loading: boolean; +} + +export class LayerManagerRow extends LitElement { + static get componentName() { + return `layer-manager-row`; + } + + static styles = [ + legacyStyles, + materialStyles, + css` + .row { + align-items: center; + display: flex; + gap: 4px; + height: 30px; + } + + .layer-name { + flex-grow: 1; + max-width: 150px; + overflow: hidden; + text-overflow: ellipsis; + } + + .settings-delete-button { + font-size: 14px; + height: 26px; + width: 26px; + } + + .layer-opacity-slider { + width: 70px; + } + + .layer-visibility-checkbox { + margin: 2px; + } + + .spinner { + -webkit-animation: spin 2s linear infinite; + animation: spin 2s linear infinite; + border-radius: 50%; + border: 4px solid var(--jp-widgets-input-border-color); + border-top: 4px solid var(--jp-widgets-color); + height: 12px; + width: 12px; + } + + @-webkit-keyframes spin { + 0% { -webkit-transform: rotate(0deg); } + 100% { -webkit-transform: rotate(360deg); } + } + + @keyframes spin { + 0% { transform: rotate(0deg); } + 100% { transform: rotate(360deg); } + } + + button.loading .spinner, + button.loading:hover .close-icon, + button.done-loading .close-icon { + display: block; + } + + button.loading .close-icon, + button.loading:hover .spinner, + button.done-loading .spinner { + display: none; + } + + .remove-layer-text { + flex-grow: 1; + } + + .confirm-deny-button { + height: 26px; + width: 70px; + } + `, + ]; + + private _model: AnyModel | undefined = undefined; + private static modelNameToViewName = new Map([ + ["name", "name"], + ["visible", "visible"], + ["opacity", "opacity"], + ["is_loading", "isLoading"], + ]); + + set model(model: AnyModel) { + this._model = model; + for (const [modelKey, widgetKey] of LayerManagerRow.modelNameToViewName) { + if (widgetKey) { + // Get initial values from the Python model. + (this as any)[widgetKey] = model.get(modelKey); + // Listen for updates to the model. + model.on(`change:${modelKey}`, () => { + (this as any)[widgetKey] = model.get(modelKey); + }); + } + } + } + + @property() + name: string = ""; + + @property() + visible: boolean = true; + + @property() + opacity: number = 0; + + @property() + isLoading: boolean = false; + + @property() + isConfirmDialogVisible: boolean = false; + + render(): TemplateResult { + return html` +
+ + ${this.name} + + + +
+ ${this.renderConfirmDialog()} + `; + } + + private renderConfirmDialog(): TemplateResult | void { + if (!this.isConfirmDialogVisible) { + return nothing; + } + return html` +
+ Remove layer? + + +
+ `; + } + + updated(changedProperties: any) { + // Update the model properties so they're reflected in Python. + for (const [property, _] of changedProperties) { + this._model?.set(property, this[property as keyof LayerManagerRow]); + } + this._model?.save_changes(); + } + + private onLayerVisibilityChanged(event: Event) { + const target = event.target as HTMLInputElement; + this.visible = target.checked; + } + + private onLayerOpacityChanged(event: Event) { + const target = event.target as HTMLInputElement; + this.opacity = parseFloat(target.value); + } + + private onSettingsClicked(_: Event) { + this._model?.send({ "type": "click", "id": "settings" }); + } + + private onDeleteClicked(_: Event) { + this.isConfirmDialogVisible = true; + } + + private confirmDeletion(_: Event) { + this._model?.send({ "type": "click", "id": "delete" }); + } + + private cancelDeletion(_: Event) { + this.isConfirmDialogVisible = false; + } +} + +if (!customElements.get(LayerManagerRow.componentName)) { + customElements.define(LayerManagerRow.componentName, LayerManagerRow); +} + +function render({ model, el }: RenderContext) { + const row = document.createElement(LayerManagerRow.componentName); + row.model = model; + el.appendChild(row); +} + +export default { render }; diff --git a/js/material_styles.ts b/js/material_styles.ts new file mode 100644 index 0000000000..90789019cf --- /dev/null +++ b/js/material_styles.ts @@ -0,0 +1,25 @@ +import { css } from "lit"; + +export const materialStyles = css` + @font-face { + font-family: 'Material Symbols Outlined'; + font-style: normal; + font-weight: 400; + src: url(https://fonts.gstatic.com/s/materialsymbolsoutlined/v205/kJF1BvYX7BgnkSrUwT8OhrdQw4oELdPIeeII9v6oDMzByHX9rA6RzaxHMPdY43zj-jCxv3fzvRNU22ZXGJpEpjC_1v-p_4MrImHCIJIZrDCvHOejbd5zrDAt.woff2) format('woff2'); + } + + .material-symbols-outlined { + -webkit-font-feature-settings: 'liga'; + -webkit-font-smoothing: antialiased; + direction: ltr; + display: inline-block; + font-family: 'Material Symbols Outlined'; + font-style: normal; + font-weight: normal; + letter-spacing: normal; + line-height: 1; + text-transform: none; + white-space: nowrap; + word-wrap: normal; + } +`; \ No newline at end of file diff --git a/js/utils.ts b/js/utils.ts new file mode 100644 index 0000000000..bdfa64ef87 --- /dev/null +++ b/js/utils.ts @@ -0,0 +1,20 @@ +import type { AnyModel } from "@anywidget/types"; +import { IWidgetManager, WidgetModel } from "@jupyter-widgets/base"; + +async function unpackModels(modelIds: Array, manager: IWidgetManager): Promise> { + return Promise.all( + modelIds.map(id => manager.get_model(id.slice("IPY_MODEL_".length))) + ); +} + +export async function updateChildren(container: HTMLElement, model: AnyModel) { + const children = model.get("children"); + const child_models = await unpackModels(children, model.widget_manager); + const child_views = await Promise.all( + child_models.map(model => model.widget_manager.create_view(model)) + ); + container.innerHTML = ``; + for (const child_view of child_views) { + container.appendChild(child_view.el); + } +} diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000000..cab1fced92 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,1181 @@ +{ + "name": "geemap", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "dependencies": { + "lit": "^3.2.0" + }, + "devDependencies": { + "@anywidget/types": "^0.1.9", + "esbuild": "^0.23.0", + "typescript": "^5.5.3" + } + }, + "node_modules/@anywidget/types": { + "version": "0.1.9", + "resolved": "https://registry.npmjs.org/@anywidget/types/-/types-0.1.9.tgz", + "integrity": "sha512-RvPp2qEDJGdNBpA6KGEEorLBmX7HkVUR+UTWFsc8fUkhsTVEoicDPTxYdLEdt9Wt0XUvLh0QhVOheICDJpyUnA==", + "dev": true, + "dependencies": { + "@jupyter-widgets/base": "^6.0.7" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.23.1.tgz", + "integrity": "sha512-6VhYk1diRqrhBAqpJEdjASR/+WVRtfjpqKuNw11cLiaWpAT/Uu+nokB+UJnevzy/P9C/ty6AOe0dwueMrGh/iQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.23.1.tgz", + "integrity": "sha512-uz6/tEy2IFm9RYOyvKl88zdzZfwEfKZmnX9Cj1BHjeSGNuGLuMD1kR8y5bteYmwqKm1tj8m4cb/aKEorr6fHWQ==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.23.1.tgz", + "integrity": "sha512-xw50ipykXcLstLeWH7WRdQuysJqejuAGPd30vd1i5zSyKK3WE+ijzHmLKxdiCMtH1pHz78rOg0BKSYOSB/2Khw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.23.1.tgz", + "integrity": "sha512-nlN9B69St9BwUoB+jkyU090bru8L0NA3yFvAd7k8dNsVH8bi9a8cUAUSEcEEgTp2z3dbEDGJGfP6VUnkQnlReg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.23.1.tgz", + "integrity": "sha512-YsS2e3Wtgnw7Wq53XXBLcV6JhRsEq8hkfg91ESVadIrzr9wO6jJDMZnCQbHm1Guc5t/CdDiFSSfWP58FNuvT3Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.23.1.tgz", + "integrity": "sha512-aClqdgTDVPSEGgoCS8QDG37Gu8yc9lTHNAQlsztQ6ENetKEO//b8y31MMu2ZaPbn4kVsIABzVLXYLhCGekGDqw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.23.1.tgz", + "integrity": "sha512-h1k6yS8/pN/NHlMl5+v4XPfikhJulk4G+tKGFIOwURBSFzE8bixw1ebjluLOjfwtLqY0kewfjLSrO6tN2MgIhA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.23.1.tgz", + "integrity": "sha512-lK1eJeyk1ZX8UklqFd/3A60UuZ/6UVfGT2LuGo3Wp4/z7eRTRYY+0xOu2kpClP+vMTi9wKOfXi2vjUpO1Ro76g==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.23.1.tgz", + "integrity": "sha512-CXXkzgn+dXAPs3WBwE+Kvnrf4WECwBdfjfeYHpMeVxWE0EceB6vhWGShs6wi0IYEqMSIzdOF1XjQ/Mkm5d7ZdQ==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.23.1.tgz", + "integrity": "sha512-/93bf2yxencYDnItMYV/v116zff6UyTjo4EtEQjUBeGiVpMmffDNUyD9UN2zV+V3LRV3/on4xdZ26NKzn6754g==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.23.1.tgz", + "integrity": "sha512-VTN4EuOHwXEkXzX5nTvVY4s7E/Krz7COC8xkftbbKRYAl96vPiUssGkeMELQMOnLOJ8k3BY1+ZY52tttZnHcXQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.23.1.tgz", + "integrity": "sha512-Vx09LzEoBa5zDnieH8LSMRToj7ir/Jeq0Gu6qJ/1GcBq9GkfoEAoXvLiW1U9J1qE/Y/Oyaq33w5p2ZWrNNHNEw==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.23.1.tgz", + "integrity": "sha512-nrFzzMQ7W4WRLNUOU5dlWAqa6yVeI0P78WKGUo7lg2HShq/yx+UYkeNSE0SSfSure0SqgnsxPvmAUu/vu0E+3Q==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.23.1.tgz", + "integrity": "sha512-dKN8fgVqd0vUIjxuJI6P/9SSSe/mB9rvA98CSH2sJnlZ/OCZWO1DJvxj8jvKTfYUdGfcq2dDxoKaC6bHuTlgcw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.23.1.tgz", + "integrity": "sha512-5AV4Pzp80fhHL83JM6LoA6pTQVWgB1HovMBsLQ9OZWLDqVY8MVobBXNSmAJi//Csh6tcY7e7Lny2Hg1tElMjIA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.23.1.tgz", + "integrity": "sha512-9ygs73tuFCe6f6m/Tb+9LtYxWR4c9yg7zjt2cYkjDbDpV/xVn+68cQxMXCjUpYwEkze2RcU/rMnfIXNRFmSoDw==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.23.1.tgz", + "integrity": "sha512-EV6+ovTsEXCPAp58g2dD68LxoP/wK5pRvgy0J/HxPGB009omFPv3Yet0HiaqvrIrgPTBuC6wCH1LTOY91EO5hQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.23.1.tgz", + "integrity": "sha512-aevEkCNu7KlPRpYLjwmdcuNz6bDFiE7Z8XC4CPqExjTvrHugh28QzUXVOZtiYghciKUacNktqxdpymplil1beA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.23.1.tgz", + "integrity": "sha512-3x37szhLexNA4bXhLrCC/LImN/YtWis6WXr1VESlfVtVeoFJBRINPJ3f0a/6LV8zpikqoUg4hyXw0sFBt5Cr+Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.23.1.tgz", + "integrity": "sha512-aY2gMmKmPhxfU+0EdnN+XNtGbjfQgwZj43k8G3fyrDM/UdZww6xrWxmDkuz2eCZchqVeABjV5BpildOrUbBTqA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.23.1.tgz", + "integrity": "sha512-RBRT2gqEl0IKQABT4XTj78tpk9v7ehp+mazn2HbUeZl1YMdaGAQqhapjGTCe7uw7y0frDi4gS0uHzhvpFuI1sA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.23.1.tgz", + "integrity": "sha512-4O+gPR5rEBe2FpKOVyiJ7wNDPA8nGzDuJ6gN4okSA1gEOYZ67N8JPk58tkWtdtPeLz7lBnY6I5L3jdsr3S+A6A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.23.1.tgz", + "integrity": "sha512-BcaL0Vn6QwCwre3Y717nVHZbAa4UBEigzFm6VdsVdT/MbZ38xoj1X9HPkZhbmaBGUD1W8vxAfffbDe8bA6AKnQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.23.1.tgz", + "integrity": "sha512-BHpFFeslkWrXWyUPnbKm+xYYVYruCinGcftSBaa8zoF9hZO4BcSCFUvHVTtzpIY6YzUnYtuEhZ+C9iEXjxnasg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@jupyter-widgets/base": { + "version": "6.0.10", + "resolved": "https://registry.npmjs.org/@jupyter-widgets/base/-/base-6.0.10.tgz", + "integrity": "sha512-iJvBT4drhwd3kpfMXaIFoD+FZTqbm1pKNi8Gvv+Wggnefyw6SHugZ0hjHoBxZD362wEUM8fpHQmdj59KvXWg0g==", + "dev": true, + "dependencies": { + "@jupyterlab/services": "^6.0.0 || ^7.0.0", + "@lumino/coreutils": "^1.11.1 || ^2.1", + "@lumino/messaging": "^1.10.1 || ^2.1", + "@lumino/widgets": "^1.30.0 || ^2.1", + "@types/backbone": "1.4.14", + "@types/lodash": "^4.14.134", + "backbone": "1.4.0", + "jquery": "^3.1.1", + "lodash": "^4.17.4" + } + }, + "node_modules/@jupyter/ydoc": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@jupyter/ydoc/-/ydoc-2.1.1.tgz", + "integrity": "sha512-NeEwqXQ2j1OyLq4uezeQmsMiI+Qo5k7dYIMqNByOM7dJp6sHeP0jQ96w7BEc9E4SmrxwcOT4cLvcJWJE8Xun4g==", + "dev": true, + "dependencies": { + "@jupyterlab/nbformat": "^3.0.0 || ^4.0.0-alpha.21 || ^4.0.0", + "@lumino/coreutils": "^1.11.0 || ^2.0.0", + "@lumino/disposable": "^1.10.0 || ^2.0.0", + "@lumino/signaling": "^1.10.0 || ^2.0.0", + "y-protocols": "^1.0.5", + "yjs": "^13.5.40" + } + }, + "node_modules/@jupyterlab/coreutils": { + "version": "6.2.5", + "resolved": "https://registry.npmjs.org/@jupyterlab/coreutils/-/coreutils-6.2.5.tgz", + "integrity": "sha512-P3HniEv3bZ3EvV3zUwCmruR713fclGvSTfsuwFPBgI8M3rNIZYqGQ13xkTun7Zl6DUr2E8mrC/cq9jNwxW33yw==", + "dev": true, + "dependencies": { + "@lumino/coreutils": "^2.1.2", + "@lumino/disposable": "^2.1.2", + "@lumino/signaling": "^2.1.2", + "minimist": "~1.2.0", + "path-browserify": "^1.0.0", + "url-parse": "~1.5.4" + } + }, + "node_modules/@jupyterlab/nbformat": { + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/@jupyterlab/nbformat/-/nbformat-4.2.5.tgz", + "integrity": "sha512-DF8bdlsEziUR5oKUr3Mm0wUx7kHZjlAtEjD6oJ8cOogQqTrMyBnUAgVjPr9QQob5J7qiyzz9aW2DYtaX+jFhng==", + "dev": true, + "dependencies": { + "@lumino/coreutils": "^2.1.2" + } + }, + "node_modules/@jupyterlab/services": { + "version": "7.2.5", + "resolved": "https://registry.npmjs.org/@jupyterlab/services/-/services-7.2.5.tgz", + "integrity": "sha512-Ya/jA8p8WOfiPPERinZasigsfSth54nNNWBQUrT2MEitdka3jVsjC3fR9R5XBpYQ59Qkczz782jMfXvaWNfCHQ==", + "dev": true, + "dependencies": { + "@jupyter/ydoc": "^2.0.1", + "@jupyterlab/coreutils": "^6.2.5", + "@jupyterlab/nbformat": "^4.2.5", + "@jupyterlab/settingregistry": "^4.2.5", + "@jupyterlab/statedb": "^4.2.5", + "@lumino/coreutils": "^2.1.2", + "@lumino/disposable": "^2.1.2", + "@lumino/polling": "^2.1.2", + "@lumino/properties": "^2.0.1", + "@lumino/signaling": "^2.1.2", + "ws": "^8.11.0" + } + }, + "node_modules/@jupyterlab/settingregistry": { + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/@jupyterlab/settingregistry/-/settingregistry-4.2.5.tgz", + "integrity": "sha512-RTHwFoldrP8h4hMxZrKafrOt3mLYKAcmUsnExkzKCqHuc3CIOh9hj+eN3gCh1mxjabbP9QIK0/08e89Rp/EG5w==", + "dev": true, + "dependencies": { + "@jupyterlab/nbformat": "^4.2.5", + "@jupyterlab/statedb": "^4.2.5", + "@lumino/commands": "^2.3.0", + "@lumino/coreutils": "^2.1.2", + "@lumino/disposable": "^2.1.2", + "@lumino/signaling": "^2.1.2", + "@rjsf/utils": "^5.13.4", + "ajv": "^8.12.0", + "json5": "^2.2.3" + }, + "peerDependencies": { + "react": ">=16" + } + }, + "node_modules/@jupyterlab/statedb": { + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/@jupyterlab/statedb/-/statedb-4.2.5.tgz", + "integrity": "sha512-GGP4NSkVzcn/zYZyjKId8OvDxq+JQTHEmiE2ayzUvvP4BwpGJ2GafY1V+QT5Tl+4SB0AzowpNud6XHUJ28M/tA==", + "dev": true, + "dependencies": { + "@lumino/commands": "^2.3.0", + "@lumino/coreutils": "^2.1.2", + "@lumino/disposable": "^2.1.2", + "@lumino/properties": "^2.0.1", + "@lumino/signaling": "^2.1.2" + } + }, + "node_modules/@lit-labs/ssr-dom-shim": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@lit-labs/ssr-dom-shim/-/ssr-dom-shim-1.2.1.tgz", + "integrity": "sha512-wx4aBmgeGvFmOKucFKY+8VFJSYZxs9poN3SDNQFF6lT6NrQUnHiPB2PWz2sc4ieEcAaYYzN+1uWahEeTq2aRIQ==" + }, + "node_modules/@lit/reactive-element": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@lit/reactive-element/-/reactive-element-2.0.4.tgz", + "integrity": "sha512-GFn91inaUa2oHLak8awSIigYz0cU0Payr1rcFsrkf5OJ5eSPxElyZfKh0f2p9FsTiZWXQdWGJeXZICEfXXYSXQ==", + "dependencies": { + "@lit-labs/ssr-dom-shim": "^1.2.0" + } + }, + "node_modules/@lumino/algorithm": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@lumino/algorithm/-/algorithm-2.0.2.tgz", + "integrity": "sha512-cI8yJ2+QK1yM5ZRU3Kuaw9fJ/64JEDZEwWWp7+U0cd/mvcZ44BGdJJ29w+tIet1QXxPAvnsUleWyQ5qm4qUouA==", + "dev": true + }, + "node_modules/@lumino/collections": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/@lumino/collections/-/collections-1.9.3.tgz", + "integrity": "sha512-2i2Wf1xnfTgEgdyKEpqM16bcYRIhUOGCDzaVCEZACVG9R1CgYwOe3zfn71slBQOVSjjRgwYrgLXu4MBpt6YK+g==", + "dev": true, + "dependencies": { + "@lumino/algorithm": "^1.9.2" + } + }, + "node_modules/@lumino/collections/node_modules/@lumino/algorithm": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/@lumino/algorithm/-/algorithm-1.9.2.tgz", + "integrity": "sha512-Z06lp/yuhz8CtIir3PNTGnuk7909eXt4ukJsCzChsGuot2l5Fbs96RJ/FOHgwCedaX74CtxPjXHXoszFbUA+4A==", + "dev": true + }, + "node_modules/@lumino/commands": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@lumino/commands/-/commands-2.3.1.tgz", + "integrity": "sha512-DpX1kkE4PhILpvK1T4ZnaFb6UP4+YTkdZifvN3nbiomD64O2CTd+wcWIBpZMgy6MMgbVgrE8dzHxHk1EsKxNxw==", + "dev": true, + "dependencies": { + "@lumino/algorithm": "^2.0.2", + "@lumino/coreutils": "^2.2.0", + "@lumino/disposable": "^2.1.3", + "@lumino/domutils": "^2.0.2", + "@lumino/keyboard": "^2.0.2", + "@lumino/signaling": "^2.1.3", + "@lumino/virtualdom": "^2.0.2" + } + }, + "node_modules/@lumino/coreutils": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@lumino/coreutils/-/coreutils-2.2.0.tgz", + "integrity": "sha512-x5wnQ/GjWBayJ6vXVaUi6+Q6ETDdcUiH9eSfpRZFbgMQyyM6pi6baKqJBK2CHkCc/YbAEl6ipApTgm3KOJ/I3g==", + "dev": true, + "dependencies": { + "@lumino/algorithm": "^2.0.2" + } + }, + "node_modules/@lumino/disposable": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@lumino/disposable/-/disposable-2.1.3.tgz", + "integrity": "sha512-k5KXy/+T3UItiWHY4WwQawnsJnGo3aNtP5CTRKqo4+tbTNuhc3rTSvygJlNKIbEfIZXW2EWYnwfFDozkYx95eA==", + "dev": true, + "dependencies": { + "@lumino/signaling": "^2.1.3" + } + }, + "node_modules/@lumino/domutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@lumino/domutils/-/domutils-2.0.2.tgz", + "integrity": "sha512-2Kp6YHaMNI1rKB0PrALvOsZBHPy2EvVVAvJLWjlCm8MpWOVETjFp0MA9QpMubT9I76aKbaI5s1o1NJyZ8Y99pQ==", + "dev": true + }, + "node_modules/@lumino/dragdrop": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@lumino/dragdrop/-/dragdrop-2.1.5.tgz", + "integrity": "sha512-zqwR4GakrQBKZOW6S5pj2nfrQDurOErAoe9x3HS3BKLa1AzWA+t9PD5NESOKd81NqXFHjiMirSyFkTUs6pw+uA==", + "dev": true, + "dependencies": { + "@lumino/coreutils": "^2.2.0", + "@lumino/disposable": "^2.1.3" + } + }, + "node_modules/@lumino/keyboard": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@lumino/keyboard/-/keyboard-2.0.2.tgz", + "integrity": "sha512-icRUpvswDaFjqmAJNbQRb/aTu6Iugo6Y2oC08TiIwhQtLS9W+Ee9VofdqvbPSvCm6DkyP+DCWMuA3KXZ4V4g4g==", + "dev": true + }, + "node_modules/@lumino/messaging": { + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/@lumino/messaging/-/messaging-1.10.3.tgz", + "integrity": "sha512-F/KOwMCdqvdEG8CYAJcBSadzp6aI7a47Fr60zAKGqZATSRRRV41q53iXU7HjFPqQqQIvdn9Z7J32rBEAyQAzww==", + "dev": true, + "dependencies": { + "@lumino/algorithm": "^1.9.2", + "@lumino/collections": "^1.9.3" + } + }, + "node_modules/@lumino/messaging/node_modules/@lumino/algorithm": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/@lumino/algorithm/-/algorithm-1.9.2.tgz", + "integrity": "sha512-Z06lp/yuhz8CtIir3PNTGnuk7909eXt4ukJsCzChsGuot2l5Fbs96RJ/FOHgwCedaX74CtxPjXHXoszFbUA+4A==", + "dev": true + }, + "node_modules/@lumino/polling": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@lumino/polling/-/polling-2.1.3.tgz", + "integrity": "sha512-WEZk96ddK6eHEhdDkFUAAA40EOLit86QVbqQqnbPmhdGwFogek26Kq9b1U273LJeirv95zXCATOJAkjRyb7D+w==", + "dev": true, + "dependencies": { + "@lumino/coreutils": "^2.2.0", + "@lumino/disposable": "^2.1.3", + "@lumino/signaling": "^2.1.3" + } + }, + "node_modules/@lumino/properties": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@lumino/properties/-/properties-2.0.2.tgz", + "integrity": "sha512-b312oA3Bh97WFK8efXejYmC3DVJmvzJk72LQB7H3fXhfqS5jUWvL7MSnNmgcQvGzl9fIhDWDWjhtSTi0KGYYBg==", + "dev": true + }, + "node_modules/@lumino/signaling": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@lumino/signaling/-/signaling-2.1.3.tgz", + "integrity": "sha512-9Wd4iMk8F1i6pYjy65bqKuPlzQMicyL9xy1/ccS20kovPcfD074waneL/7BVe+3M8i+fGa3x2qjbWrBzOdTdNw==", + "dev": true, + "dependencies": { + "@lumino/algorithm": "^2.0.2", + "@lumino/coreutils": "^2.2.0" + } + }, + "node_modules/@lumino/virtualdom": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@lumino/virtualdom/-/virtualdom-2.0.2.tgz", + "integrity": "sha512-HYZThOtZSoknjdXA102xpy5CiXtTFCVz45EXdWeYLx3NhuEwuAIX93QBBIhupalmtFlRg1yhdDNV40HxJ4kcXg==", + "dev": true, + "dependencies": { + "@lumino/algorithm": "^2.0.2" + } + }, + "node_modules/@lumino/widgets": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@lumino/widgets/-/widgets-2.5.0.tgz", + "integrity": "sha512-RSRpc6aIEiuw79jqWUHYWXLJ2GBy7vhwuqgo94UVzg6oeh3XBECX0OvXGjK2k7N2BhmRrIs9bXky7Dm861S6mQ==", + "dev": true, + "dependencies": { + "@lumino/algorithm": "^2.0.2", + "@lumino/commands": "^2.3.1", + "@lumino/coreutils": "^2.2.0", + "@lumino/disposable": "^2.1.3", + "@lumino/domutils": "^2.0.2", + "@lumino/dragdrop": "^2.1.5", + "@lumino/keyboard": "^2.0.2", + "@lumino/messaging": "^2.0.2", + "@lumino/properties": "^2.0.2", + "@lumino/signaling": "^2.1.3", + "@lumino/virtualdom": "^2.0.2" + } + }, + "node_modules/@lumino/widgets/node_modules/@lumino/collections": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@lumino/collections/-/collections-2.0.2.tgz", + "integrity": "sha512-o0QmfV1D3WhAeA8GI1/YmEPaK89JtHVa764rQ5T0LdbDEwUtUDbjavHs1E/+y66tNTXz9RUJ4D2rcSb9tysYsg==", + "dev": true, + "dependencies": { + "@lumino/algorithm": "^2.0.2" + } + }, + "node_modules/@lumino/widgets/node_modules/@lumino/messaging": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@lumino/messaging/-/messaging-2.0.2.tgz", + "integrity": "sha512-2sUF07cYA0f3mDil41Eh5sfBk0aGAH/mOh1I4+vyRUsKyBqp4WTUtpJFd8xVJGAntygxwnebIygkIaXXTIQvxA==", + "dev": true, + "dependencies": { + "@lumino/algorithm": "^2.0.2", + "@lumino/collections": "^2.0.2" + } + }, + "node_modules/@rjsf/utils": { + "version": "5.21.1", + "resolved": "https://registry.npmjs.org/@rjsf/utils/-/utils-5.21.1.tgz", + "integrity": "sha512-KEwEtIswzKE2WTLRxvh5vwMwvNMTHnRSxwaRlz3QKz5/iQr9XGJTWcmArjIN3y0ypfLk+X6qZsboamQBIhTV3w==", + "dev": true, + "dependencies": { + "json-schema-merge-allof": "^0.8.1", + "jsonpointer": "^5.0.1", + "lodash": "^4.17.21", + "lodash-es": "^4.17.21", + "react-is": "^18.2.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "react": "^16.14.0 || >=17" + } + }, + "node_modules/@types/backbone": { + "version": "1.4.14", + "resolved": "https://registry.npmjs.org/@types/backbone/-/backbone-1.4.14.tgz", + "integrity": "sha512-85ldQ99fiYTJFBlZuAJRaCdvTZKZ2p1fSs3fVf+6Ub6k1X0g0hNJ0qJ/2FOByyyAQYLtbEz3shX5taKQfBKBDw==", + "dev": true, + "dependencies": { + "@types/jquery": "*", + "@types/underscore": "*" + } + }, + "node_modules/@types/jquery": { + "version": "3.5.30", + "resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-3.5.30.tgz", + "integrity": "sha512-nbWKkkyb919DOUxjmRVk8vwtDb0/k8FKncmUKFi+NY+QXqWltooxTrswvz4LspQwxvLdvzBN1TImr6cw3aQx2A==", + "dev": true, + "dependencies": { + "@types/sizzle": "*" + } + }, + "node_modules/@types/lodash": { + "version": "4.17.9", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.9.tgz", + "integrity": "sha512-w9iWudx1XWOHW5lQRS9iKpK/XuRhnN+0T7HvdCCd802FYkT1AMTnxndJHGrNJwRoRHkslGr4S29tjm1cT7x/7w==", + "dev": true + }, + "node_modules/@types/sizzle": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.8.tgz", + "integrity": "sha512-0vWLNK2D5MT9dg0iOo8GlKguPAU02QjmZitPEsXRuJXU/OGIOt9vT9Fc26wtYuavLxtO45v9PGleoL9Z0k1LHg==", + "dev": true + }, + "node_modules/@types/trusted-types": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz", + "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==" + }, + "node_modules/@types/underscore": { + "version": "1.11.15", + "resolved": "https://registry.npmjs.org/@types/underscore/-/underscore-1.11.15.tgz", + "integrity": "sha512-HP38xE+GuWGlbSRq9WrZkousaQ7dragtZCruBVMi0oX1migFZavZ3OROKHSkNp/9ouq82zrWtZpg18jFnVN96g==", + "dev": true + }, + "node_modules/ajv": { + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", + "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/backbone": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/backbone/-/backbone-1.4.0.tgz", + "integrity": "sha512-RLmDrRXkVdouTg38jcgHhyQ/2zjg7a8E6sz2zxfz21Hh17xDJYUHBZimVIt5fUyS8vbfpeSmTL3gUjTEvUV3qQ==", + "dev": true, + "dependencies": { + "underscore": ">=1.8.3" + } + }, + "node_modules/compute-gcd": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/compute-gcd/-/compute-gcd-1.2.1.tgz", + "integrity": "sha512-TwMbxBNz0l71+8Sc4czv13h4kEqnchV9igQZBi6QUaz09dnz13juGnnaWWJTRsP3brxOoxeB4SA2WELLw1hCtg==", + "dev": true, + "dependencies": { + "validate.io-array": "^1.0.3", + "validate.io-function": "^1.0.2", + "validate.io-integer-array": "^1.0.0" + } + }, + "node_modules/compute-lcm": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/compute-lcm/-/compute-lcm-1.1.2.tgz", + "integrity": "sha512-OFNPdQAXnQhDSKioX8/XYT6sdUlXwpeMjfd6ApxMJfyZ4GxmLR1xvMERctlYhlHwIiz6CSpBc2+qYKjHGZw4TQ==", + "dev": true, + "dependencies": { + "compute-gcd": "^1.2.1", + "validate.io-array": "^1.0.3", + "validate.io-function": "^1.0.2", + "validate.io-integer-array": "^1.0.0" + } + }, + "node_modules/esbuild": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.23.1.tgz", + "integrity": "sha512-VVNz/9Sa0bs5SELtn3f7qhJCDPCF5oMEl5cO9/SSinpE9hbPVvxbd572HH5AKiP7WD8INO53GgfDDhRjkylHEg==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.23.1", + "@esbuild/android-arm": "0.23.1", + "@esbuild/android-arm64": "0.23.1", + "@esbuild/android-x64": "0.23.1", + "@esbuild/darwin-arm64": "0.23.1", + "@esbuild/darwin-x64": "0.23.1", + "@esbuild/freebsd-arm64": "0.23.1", + "@esbuild/freebsd-x64": "0.23.1", + "@esbuild/linux-arm": "0.23.1", + "@esbuild/linux-arm64": "0.23.1", + "@esbuild/linux-ia32": "0.23.1", + "@esbuild/linux-loong64": "0.23.1", + "@esbuild/linux-mips64el": "0.23.1", + "@esbuild/linux-ppc64": "0.23.1", + "@esbuild/linux-riscv64": "0.23.1", + "@esbuild/linux-s390x": "0.23.1", + "@esbuild/linux-x64": "0.23.1", + "@esbuild/netbsd-x64": "0.23.1", + "@esbuild/openbsd-arm64": "0.23.1", + "@esbuild/openbsd-x64": "0.23.1", + "@esbuild/sunos-x64": "0.23.1", + "@esbuild/win32-arm64": "0.23.1", + "@esbuild/win32-ia32": "0.23.1", + "@esbuild/win32-x64": "0.23.1" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "node_modules/fast-uri": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.1.tgz", + "integrity": "sha512-MWipKbbYiYI0UC7cl8m/i/IWTqfC8YXsqjzybjddLsFjStroQzsHXkc73JutMvBiXmOvapk+axIl79ig5t55Bw==", + "dev": true + }, + "node_modules/isomorphic.js": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/isomorphic.js/-/isomorphic.js-0.2.5.tgz", + "integrity": "sha512-PIeMbHqMt4DnUP3MA/Flc0HElYjMXArsw1qwJZcm9sqR8mq3l8NYizFMty0pWwE/tzIGH3EKK5+jes5mAr85yw==", + "dev": true, + "funding": { + "type": "GitHub Sponsors ❤", + "url": "https://github.com/sponsors/dmonad" + } + }, + "node_modules/jquery": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.1.tgz", + "integrity": "sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg==", + "dev": true + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true, + "peer": true + }, + "node_modules/json-schema-compare": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/json-schema-compare/-/json-schema-compare-0.2.2.tgz", + "integrity": "sha512-c4WYmDKyJXhs7WWvAWm3uIYnfyWFoIp+JEoX34rctVvEkMYCPGhXtvmFFXiffBbxfZsvQ0RNnV5H7GvDF5HCqQ==", + "dev": true, + "dependencies": { + "lodash": "^4.17.4" + } + }, + "node_modules/json-schema-merge-allof": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/json-schema-merge-allof/-/json-schema-merge-allof-0.8.1.tgz", + "integrity": "sha512-CTUKmIlPJbsWfzRRnOXz+0MjIqvnleIXwFTzz+t9T86HnYX/Rozria6ZVGLktAU9e+NygNljveP+yxqtQp/Q4w==", + "dev": true, + "dependencies": { + "compute-lcm": "^1.1.2", + "json-schema-compare": "^0.2.2", + "lodash": "^4.17.20" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/jsonpointer": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-5.0.1.tgz", + "integrity": "sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/lib0": { + "version": "0.2.97", + "resolved": "https://registry.npmjs.org/lib0/-/lib0-0.2.97.tgz", + "integrity": "sha512-Q4d1ekgvufi9FiHkkL46AhecfNjznSL9MRNoJRQ76gBHS9OqU2ArfQK0FvBpuxgWeJeNI0LVgAYMIpsGeX4gYg==", + "dev": true, + "dependencies": { + "isomorphic.js": "^0.2.4" + }, + "bin": { + "0ecdsa-generate-keypair": "bin/0ecdsa-generate-keypair.js", + "0gentesthtml": "bin/gentesthtml.js", + "0serve": "bin/0serve.js" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "type": "GitHub Sponsors ❤", + "url": "https://github.com/sponsors/dmonad" + } + }, + "node_modules/lit": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/lit/-/lit-3.2.0.tgz", + "integrity": "sha512-s6tI33Lf6VpDu7u4YqsSX78D28bYQulM+VAzsGch4fx2H0eLZnJsUBsPWmGYSGoKDNbjtRv02rio1o+UdPVwvw==", + "dependencies": { + "@lit/reactive-element": "^2.0.4", + "lit-element": "^4.1.0", + "lit-html": "^3.2.0" + } + }, + "node_modules/lit-element": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/lit-element/-/lit-element-4.1.0.tgz", + "integrity": "sha512-gSejRUQJuMQjV2Z59KAS/D4iElUhwKpIyJvZ9w+DIagIQjfJnhR20h2Q5ddpzXGS+fF0tMZ/xEYGMnKmaI/iww==", + "dependencies": { + "@lit-labs/ssr-dom-shim": "^1.2.0", + "@lit/reactive-element": "^2.0.4", + "lit-html": "^3.2.0" + } + }, + "node_modules/lit-html": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/lit-html/-/lit-html-3.2.0.tgz", + "integrity": "sha512-pwT/HwoxqI9FggTrYVarkBKFN9MlTUpLrDHubTmW4SrkL3kkqW5gxwbxMMUnbbRHBC0WTZnYHcjDSCM559VyfA==", + "dependencies": { + "@types/trusted-types": "^2.0.2" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/lodash-es": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", + "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==", + "dev": true + }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dev": true, + "peer": true, + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/path-browserify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", + "dev": true + }, + "node_modules/querystringify": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", + "dev": true + }, + "node_modules/react": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", + "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", + "dev": true, + "peer": true, + "dependencies": { + "loose-envify": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "dev": true + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", + "dev": true + }, + "node_modules/typescript": { + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.2.tgz", + "integrity": "sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/underscore": { + "version": "1.13.7", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.7.tgz", + "integrity": "sha512-GMXzWtsc57XAtguZgaQViUOzs0KTkk8ojr3/xAxXLITqf/3EMwxC0inyETfDFjH/Krbhuep0HNbbjI9i/q3F3g==", + "dev": true + }, + "node_modules/url-parse": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", + "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", + "dev": true, + "dependencies": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + } + }, + "node_modules/validate.io-array": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/validate.io-array/-/validate.io-array-1.0.6.tgz", + "integrity": "sha512-DeOy7CnPEziggrOO5CZhVKJw6S3Yi7e9e65R1Nl/RTN1vTQKnzjfvks0/8kQ40FP/dsjRAOd4hxmJ7uLa6vxkg==", + "dev": true + }, + "node_modules/validate.io-function": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/validate.io-function/-/validate.io-function-1.0.2.tgz", + "integrity": "sha512-LlFybRJEriSuBnUhQyG5bwglhh50EpTL2ul23MPIuR1odjO7XaMLFV8vHGwp7AZciFxtYOeiSCT5st+XSPONiQ==", + "dev": true + }, + "node_modules/validate.io-integer": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/validate.io-integer/-/validate.io-integer-1.0.5.tgz", + "integrity": "sha512-22izsYSLojN/P6bppBqhgUDjCkr5RY2jd+N2a3DCAUey8ydvrZ/OkGvFPR7qfOpwR2LC5p4Ngzxz36g5Vgr/hQ==", + "dev": true, + "dependencies": { + "validate.io-number": "^1.0.3" + } + }, + "node_modules/validate.io-integer-array": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/validate.io-integer-array/-/validate.io-integer-array-1.0.0.tgz", + "integrity": "sha512-mTrMk/1ytQHtCY0oNO3dztafHYyGU88KL+jRxWuzfOmQb+4qqnWmI+gykvGp8usKZOM0H7keJHEbRaFiYA0VrA==", + "dev": true, + "dependencies": { + "validate.io-array": "^1.0.3", + "validate.io-integer": "^1.0.4" + } + }, + "node_modules/validate.io-number": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/validate.io-number/-/validate.io-number-1.0.3.tgz", + "integrity": "sha512-kRAyotcbNaSYoDnXvb4MHg/0a1egJdLwS6oJ38TJY7aw9n93Fl/3blIXdyYvPOp55CNxywooG/3BcrwNrBpcSg==", + "dev": true + }, + "node_modules/ws": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", + "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", + "dev": true, + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/y-protocols": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/y-protocols/-/y-protocols-1.0.6.tgz", + "integrity": "sha512-vHRF2L6iT3rwj1jub/K5tYcTT/mEYDUppgNPXwp8fmLpui9f7Yeq3OEtTLVF012j39QnV+KEQpNqoN7CWU7Y9Q==", + "dev": true, + "dependencies": { + "lib0": "^0.2.85" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=8.0.0" + }, + "funding": { + "type": "GitHub Sponsors ❤", + "url": "https://github.com/sponsors/dmonad" + }, + "peerDependencies": { + "yjs": "^13.0.0" + } + }, + "node_modules/yjs": { + "version": "13.6.19", + "resolved": "https://registry.npmjs.org/yjs/-/yjs-13.6.19.tgz", + "integrity": "sha512-GNKw4mEUn5yWU2QPHRx8jppxmCm9KzbBhB4qJLUJFiiYD0g/tDVgXQ7aPkyh01YO28kbs2J/BEbWBagjuWyejw==", + "dev": true, + "dependencies": { + "lib0": "^0.2.86" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=8.0.0" + }, + "funding": { + "type": "GitHub Sponsors ❤", + "url": "https://github.com/sponsors/dmonad" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000000..f23be7baa5 --- /dev/null +++ b/package.json @@ -0,0 +1,15 @@ +{ + "scripts": { + "dev": "npm run build -- --sourcemap=inline --watch", + "build": "esbuild js/*.ts --minify --format=esm --bundle --outdir=geemap/static", + "typecheck": "tsc --noEmit" + }, + "dependencies": { + "lit": "^3.2.0" + }, + "devDependencies": { + "@anywidget/types": "^0.1.9", + "esbuild": "^0.23.0", + "typescript": "^5.5.3" + } +} diff --git a/pyproject.toml b/pyproject.toml index 54a60bae86..26553496aa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,7 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + [project] name = "geemap" version = "0.34.5" @@ -42,9 +46,12 @@ dependencies = [ "scooby", ] +[project.scripts] +geemap = "geemap.cli:main" + [project.optional-dependencies] all = [ - "geemap[backends,extra,lidar,raster,sql,apps,vector,workshop,maplibre]", + "geemap[backends,dev,extra,lidar,raster,sql,apps,vector,workshop,maplibre]", ] ai = [ "google-api-core", @@ -55,6 +62,10 @@ backends = [ "keplergl", "pydeck", ] +dev = [ + "watchfiles", + "jupyterlab", +] extra = [ "ee_extra>=0.0.15", "ffmpeg-python", @@ -132,11 +143,9 @@ geemap = "geemap.cli:main" include = ["geemap*"] exclude = ["docs*"] - [tool.distutils.bdist_wheel] universal = true - [tool.bumpversion] current_version = "0.34.5" commit = true @@ -158,10 +167,28 @@ exclude = [ ] max-line-length = 88 +[tool.hatch.envs.default] +features = ["dev"] + +[tool.hatch.build] +only-packages = true +artifacts = ["geemap/static/*"] + +[tool.hatch.build.hooks.jupyter-builder] +build-function = "hatch_jupyter_builder.npm_builder" +ensured-targets = [ + "geemap/static/layer_manager_row.js", + "geemap/static/layer_manager.js", +] +skip-if-exists = [ + "geemap/static/layer_manager_row.js", + "geemap/static/layer_manager.js", +] +dependencies = ["hatch-jupyter-builder>=0.5.0"] + +[tool.hatch.build.hooks.jupyter-builder.build-kwargs] +npm = "npm" +build_cmd = "build" [project.urls] Homepage = "https://github.com/gee-community/geemap" - -[build-system] -requires = ["setuptools>=64", "setuptools_scm>=8"] -build-backend = "setuptools.build_meta" \ No newline at end of file diff --git a/tests/fake_map.py b/tests/fake_map.py index 9cb247422f..626adcdb62 100644 --- a/tests/fake_map.py +++ b/tests/fake_map.py @@ -1,4 +1,10 @@ +"""Fake map used for testing.""" + +import unittest + import ee +import ipywidgets +import traitlets from geemap import ee_tile_layers @@ -15,6 +21,7 @@ def __init__(self): self.ee_layers = {} self.geojson_layers = [] self.controls = [] + self.add = unittest.mock.MagicMock() self._recognized_attrs = self.__dict__.keys() @@ -79,9 +86,6 @@ def add_layer( } self.layers.append(layer) - def add(self, obj): - del obj # Unused. - def remove_layer(self, layer): if isinstance(layer, str): layer = self.ee_layers[layer]["ee_layer"] @@ -173,15 +177,20 @@ def observe(self, func, names): pass -class FakeTileLayer: +class FakeTileLayer(ipywidgets.Widget): + """A fake tile layer.""" + + name = traitlets.Unicode("").tag(sync=True) + visible = traitlets.Bool(True).tag(sync=True) + opacity = traitlets.Float(1).tag(sync=True) + loading = traitlets.Bool(False).tag(sync=True) + def __init__(self, name="test-layer", visible=True, opacity=1.0): + super().__init__() self.name = name self.visible = visible self.opacity = opacity - def observe(self, func, names): - pass - class FakeGeoJSONLayer: def __init__(self, name="test-layer", visible=True, style=None): diff --git a/tests/test_map_widgets.py b/tests/test_map_widgets.py index 385a5eaea9..446723f74c 100644 --- a/tests/test_map_widgets.py +++ b/tests/test_map_widgets.py @@ -459,82 +459,144 @@ def test_map_click_twice(self): ) -class TestLayerManager(unittest.TestCase): - """Tests for the LayerManager class in the `map_widgets` module.""" - - @property - def collapse_button(self): - """Returns the collapse button on layer_manager or None.""" - return utils.query_widget( - self.layer_manager, - ipywidgets.ToggleButton, - lambda c: c.tooltip == "Layer Manager", - ) +def _create_fake_map() -> fake_map.FakeMap: + ret = fake_map.FakeMap() + ret.layers = [ + fake_map.FakeTileLayer("OpenStreetMap"), # Basemap + fake_map.FakeTileLayer("GMaps", False, 0.5), # Extra basemap + fake_map.FakeEeTileLayer("test-layer", True, 0.8), + fake_map.FakeGeoJSONLayer( + "test-geojson-layer", + False, + {"some-style": "red", "opacity": 0.3, "fillOpacity": 0.2}, + ), + ] + ret.ee_layers = { + "test-layer": {"ee_object": None, "ee_layer": ret.layers[2], "vis_params": None} + } + ret.geojson_layers = [ret.layers[3]] + return ret + + +@unittest.mock.patch( + "geemap.map_widgets.LayerManagerRow._traitlet_link_type", + new=unittest.mock.Mock(return_value=ipywidgets.link), +) # jslink isn't supported in ipywidgets +class TestLayerManagerRow(unittest.TestCase): + """Tests for the LayerManagerRow class in the `layer_manager` module.""" - @property - def close_button(self): - """Returns the close button on layer_manager or None.""" - return utils.query_widget( - self.layer_manager, - ipywidgets.Button, - lambda c: c.tooltip == "Close the tool", - ) - - @property - def toggle_all_checkbox(self): - """Returns the toggle all checkbox on layer_manager or None.""" - return utils.query_widget( - self.layer_manager, - ipywidgets.Checkbox, - lambda c: c.description == "All layers on/off", + def setUp(self): + self.fake_map = _create_fake_map() + + def test_row_invalid_map_or_layer(self): + """Tests that a valid map and layer must be passed in.""" + with self.assertRaisesRegex(ValueError, "valid map and layer"): + map_widgets.LayerManagerRow(None, None) + + def test_row(self): + """Tests LayerManagerRow is initialized correctly for a standard layer.""" + layer = fake_map.FakeTileLayer(name="layer-name", visible=False, opacity=0.2) + row = map_widgets.LayerManagerRow(self.fake_map, layer) + + self.assertFalse(row.is_loading) + self.assertEqual(row.name, layer.name) + self.assertEqual(row.visible, layer.visible) + self.assertEqual(row.opacity, layer.opacity) + + def test_geojson_row(self): + """Tests LayerManagerRow is initialized correctly for a GeoJSON layer.""" + layer = fake_map.FakeGeoJSONLayer( + name="layer-name", visible=True, style={"opacity": 0.2, "fillOpacity": 0.4} + ) + self.fake_map.geojson_layers.append(layer) + row = map_widgets.LayerManagerRow(self.fake_map, layer) + + self.assertEqual(row.name, layer.name) + self.assertTrue(row.visible) + self.assertEqual(row.opacity, 0.4) + + def test_layer_update_row_properties(self): + """Tests layer updates update row traitlets.""" + layer = fake_map.FakeTileLayer(name="layer-name", visible=False, opacity=0.2) + row = map_widgets.LayerManagerRow(self.fake_map, layer) + + layer.loading = True + layer.opacity = 0.42 + layer.visible = True + self.assertTrue(row.is_loading) + self.assertEqual(row.opacity, 0.42) + self.assertTrue(row.visible) + + def test_row_update_layer_properties(self): + """Tests row updates update layer traitlets.""" + layer = fake_map.FakeTileLayer(name="layer-name", visible=False, opacity=0.2) + row = map_widgets.LayerManagerRow(self.fake_map, layer) + + row.opacity = 0.42 + row.visible = True + self.assertEqual(layer.opacity, 0.42) + self.assertTrue(layer.visible) + + def test_geojson_row_update_layer_properties(self): + """Tests GeoJSON row updates update layer traitlets.""" + layer = fake_map.FakeGeoJSONLayer( + name="layer-name", visible=True, style={"opacity": 0.2, "fillOpacity": 0.4} + ) + self.fake_map.geojson_layers.append(layer) + row = map_widgets.LayerManagerRow(self.fake_map, layer) + + row.opacity = 0.42 + row.visible = True + self.assertEqual(layer.style["opacity"], 0.42) + self.assertEqual(layer.style["fillOpacity"], 0.42) + self.assertTrue(layer.visible) + + def test_settings_button_clicked_non_ee_layer(self): + """Tests that the layer vis editor is opened when settings is clicked.""" + row = map_widgets.LayerManagerRow(self.fake_map, self.fake_map.layers[0]) + + msg = {"type": "click", "id": "settings"} + row._handle_custom_msg(msg, []) # pylint: disable=protected-access + + self.fake_map.add.assert_called_once_with( + "layer_editor", position="bottomright", layer_dict=None + ) + + def test_settings_button_clicked_ee_layer(self): + """Tests that the layer vis editor is opened when settings is clicked.""" + row = map_widgets.LayerManagerRow(self.fake_map, self.fake_map.layers[2]) + + msg = {"type": "click", "id": "settings"} + row._handle_custom_msg(msg, []) # pylint: disable=protected-access + + self.fake_map.add.assert_called_once_with( + "layer_editor", + position="bottomright", + layer_dict={ + "ee_object": None, + "ee_layer": self.fake_map.layers[2], + "vis_params": None, + }, ) - @property - def layer_rows(self): - """Returns the ipywidgets rows on layer_manager.""" - return utils.query_widget( - self.layer_manager, ipywidgets.VBox, lambda c: True - ).children[1:] + def test_delete_button_clicked(self): + """Tests that the layer is removed when delete is clicked.""" + row = map_widgets.LayerManagerRow(self.fake_map, self.fake_map.layers[0]) - def _query_checkbox_on_row(self, row, name): - return utils.query_widget( - row, ipywidgets.Checkbox, lambda c: c.description == name - ) + msg = {"type": "click", "id": "delete"} + row._handle_custom_msg(msg, []) # pylint: disable=protected-access - def _query_slider_on_row(self, row): - return utils.query_widget(row, ipywidgets.FloatSlider, lambda _: True) + self.assertEqual(len(self.fake_map.layers), 3) + self.assertEqual(self.fake_map.layers[0].name, "GMaps") + self.assertEqual(self.fake_map.layers[1].name, "test-layer") + self.assertEqual(self.fake_map.layers[2].name, "test-geojson-layer") - def _query_button_on_row(self, row): - return utils.query_widget(row, ipywidgets.Button, lambda _: True) - def _validate_row(self, row, name, checked, opacity): - self.assertEqual(self._query_checkbox_on_row(row, name).value, checked) - self.assertEqual(self._query_slider_on_row(row).value, opacity) - self.assertIsNotNone(self._query_button_on_row(row)) +class TestLayerManager(unittest.TestCase): + """Tests for the LayerManager class in the `layer_manager` module.""" def setUp(self): - self.fake_map = fake_map.FakeMap() - self.fake_map.layers = [ - fake_map.FakeTileLayer(name="OpenStreetMap"), # Basemap - fake_map.FakeTileLayer( - name="GMaps", visible=False, opacity=0.5 - ), # Extra basemap - fake_map.FakeEeTileLayer(name="test-layer", visible=True, opacity=0.8), - fake_map.FakeGeoJSONLayer( - name="test-geojson-layer", - visible=False, - style={"some-style": "red", "opacity": 0.3, "fillOpacity": 0.2}, - ), - ] - self.fake_map.ee_layers = { - "test-layer": { - "ee_object": None, - "ee_layer": self.fake_map.layers[2], - "vis_params": None, - }, - } - self.fake_map.geojson_layers = [self.fake_map.layers[3]] - + self.fake_map = _create_fake_map() self.layer_manager = map_widgets.LayerManager(self.fake_map) def test_layer_manager_no_map(self): @@ -542,122 +604,38 @@ def test_layer_manager_no_map(self): with self.assertRaisesRegex(ValueError, "valid map"): map_widgets.LayerManager(None) - def test_layer_manager(self): - self.assertIsNotNone(self.collapse_button) - self.assertIsNotNone(self.close_button) - self.assertIsNotNone(self.toggle_all_checkbox) - - # Verify computed properties are correct. - self.assertFalse(self.layer_manager.collapsed) - self.assertFalse(self.layer_manager.header_hidden) - self.assertFalse(self.layer_manager.close_button_hidden) - - self.assertEqual(len(self.layer_rows), 4) - self._validate_row(self.layer_rows[1], "GMaps", False, 0.5) - self._validate_row(self.layer_rows[2], "test-layer", True, 0.8) - self._validate_row(self.layer_rows[3], "test-geojson-layer", False, 0.3) - - def test_layer_manager_toggle_all_visibility(self): - """Tests that the toggle all checkbox changes visibilities.""" - # True then False because the event doesn't fire if the value doesn't change. - self.toggle_all_checkbox.value = True - self.toggle_all_checkbox.value = False - - layers = self.fake_map.layers - for layer in layers[1:]: # The base layer doesn't get toggled. - self.assertFalse(layer.visible, f"{layer.name} shouldn't be visible") - - self.toggle_all_checkbox.value = True - - for layer in self.fake_map.layers: - self.assertEqual(layer.visible, True, f"{layer.name} should be visible") - - def test_layer_manager_opacity_changed(self): - """Tests that the opacity slider changes opacities.""" - ee_layer = self.layer_rows[2] - ee_layer_slider = self._query_slider_on_row(ee_layer) - ee_layer_slider.value = 0.01 - self.assertEqual(self.fake_map.layers[2].opacity, 0.01) - - geojson_layer = self.layer_rows[3] - geojson_layer_slider = self._query_slider_on_row(geojson_layer) - geojson_layer_slider.value = 0.02 - self.assertEqual( - self.fake_map.layers[3].style, - {"some-style": "red", "opacity": 0.02, "fillOpacity": 0.02}, - ) - - def test_layer_manager_click_settings(self): - """Tests that the settings button fires an event.""" - on_open_vis_mock = Mock() - self.layer_manager.on_open_vis = on_open_vis_mock - ee_layer_button = self._query_button_on_row(self.layer_rows[1]) - - ee_layer_button.click() - - on_open_vis_mock.assert_called_once() - - def test_layer_manager_click_close(self): - """Tests that the close button fires an event.""" - on_close_mock = Mock() - self.layer_manager.on_close = on_close_mock - - self.close_button.click() - - on_close_mock.assert_called_once() - - def test_layer_manager_refresh_layers(self): - """Tests that refresh_layers refreshes the layers.""" - self.fake_map.layers = [] + def _validate_row( + self, index: int, name: str, visible: bool, opacity: float + ) -> None: + child = self.layer_manager.children[index] + self.assertEqual(child.host_map, self.fake_map) + self.assertEqual(child.layer, self.fake_map.layers[index]) + self.assertEqual(child.name, name) + self.assertEqual(child.visible, visible) + self.assertAlmostEqual(child.opacity, opacity) + + def test_refresh_layers_updates_children(self): + """Tests that refresh layers updates children.""" self.layer_manager.refresh_layers() - self.assertEqual(len(self.layer_rows), 0) - - def test_layer_manager_collapsed(self): - """Tests that setting the collapsed property collapses the widget.""" - self.layer_manager.collapsed = True - - self.assertIsNotNone(self.collapse_button) - self.assertIsNone(self.close_button) - self.assertIsNone(self.toggle_all_checkbox) - self.assertEqual(len(self.layer_rows), 0) - - self.layer_manager.collapsed = False + self.assertEqual(len(self.layer_manager.children), len(self.fake_map.layers)) + self._validate_row(0, name="OpenStreetMap", visible=True, opacity=1.0) + self._validate_row(1, name="GMaps", visible=False, opacity=0.5) + self._validate_row(2, name="test-layer", visible=True, opacity=0.8) + self._validate_row(3, name="test-geojson-layer", visible=False, opacity=0.3) - self.assertIsNotNone(self.collapse_button) - self.assertIsNotNone(self.close_button) - self.assertIsNotNone(self.toggle_all_checkbox) - self.assertEqual(len(self.layer_rows), 4) - - def test_layer_manager_header_hidden(self): - """Tests that setting the header_hidden property hides the header.""" - self.layer_manager.header_hidden = True - - self.assertIsNone(self.collapse_button) - self.assertIsNone(self.close_button) - self.assertIsNotNone(self.toggle_all_checkbox) - - self.layer_manager.header_hidden = False - - self.assertIsNotNone(self.collapse_button) - self.assertIsNotNone(self.close_button) - self.assertIsNotNone(self.toggle_all_checkbox) - - def test_layer_manager_close_button_hidden(self): - """Tests that setting the close_button_hidden property hides the close - button. - """ - self.layer_manager.close_button_hidden = True - - self.assertIsNotNone(self.collapse_button) - self.assertIsNone(self.close_button) - self.assertIsNotNone(self.toggle_all_checkbox) + def test_visibility_updates_children(self): + """Tests that tweaking the visibility updates children visibilities.""" + self.layer_manager.refresh_layers() + self.assertTrue(self.layer_manager.visible) - self.layer_manager.close_button_hidden = False + self.layer_manager.visible = False + for child in self.layer_manager.children: + self.assertFalse(child.visible) - self.assertIsNotNone(self.collapse_button) - self.assertIsNotNone(self.close_button) - self.assertIsNotNone(self.toggle_all_checkbox) + self.layer_manager.visible = True + for child in self.layer_manager.children: + self.assertTrue(child.visible) class TestBasemap(unittest.TestCase): diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000000..595c14b993 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,27 @@ +{ + "include": [ + "js" + ], + "compilerOptions": { + "target": "ES2020", + "module": "ESNext", + "lib": [ + "ES2020", + "DOM", + "DOM.Iterable" + ], + "skipLibCheck": true, + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "react", + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true, + "experimentalDecorators": true, + "emitDecoratorMetadata": true + } +} \ No newline at end of file From bbfa97dc51b8040568414d0c83f0d5ce7a84fbb8 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 10 Oct 2024 17:21:23 +0000 Subject: [PATCH 10/57] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- geemap/static/ipywidgets_styles.js | 4 ++-- geemap/static/layer_manager.js | 4 ++-- geemap/static/layer_manager_row.js | 6 +++--- geemap/static/material_styles.js | 4 ++-- js/layer_manager_row.ts | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/geemap/static/ipywidgets_styles.js b/geemap/static/ipywidgets_styles.js index a788ad9e1b..509f652597 100644 --- a/geemap/static/ipywidgets_styles.js +++ b/geemap/static/ipywidgets_styles.js @@ -1,5 +1,5 @@ -var R=globalThis,N=R.ShadowRoot&&(R.ShadyCSS===void 0||R.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,k=Symbol(),Z=new WeakMap,E=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==k)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(N&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=Z.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Z.set(e,t))}return t}toString(){return this.cssText}},X=r=>new E(typeof r=="string"?r:r+"",void 0,k),z=(r,...t)=>{let e=r.length===1?r[0]:t.reduce((s,i,o)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[o+1],r[0]);return new E(e,r,k)},L=(r,t)=>{if(N)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=R.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s)}},T=N?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return X(e)})(r):r;var{is:pt,defineProperty:ut,getOwnPropertyDescriptor:$t,getOwnPropertyNames:ft,getOwnPropertySymbols:_t,getPrototypeOf:gt}=Object,M=globalThis,G=M.trustedTypes,mt=G?G.emptyScript:"",At=M.reactiveElementPolyfillSupport,w=(r,t)=>r,I={toAttribute(r,t){switch(t){case Boolean:r=r?mt:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},tt=(r,t)=>!pt(r,t),Y={attribute:!0,type:String,converter:I,reflect:!1,hasChanged:tt};Symbol.metadata??=Symbol("metadata"),M.litPropertyMetadata??=new WeakMap;var $=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Y){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&ut(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:o}=$t(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i?.call(this)},set(n){let p=i?.call(this);o.call(this,n),this.requestUpdate(t,p,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Y}static _$Ei(){if(this.hasOwnProperty(w("elementProperties")))return;let t=gt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(w("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(w("properties"))){let e=this.properties,s=[...ft(e),..._t(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(T(i))}else t!==void 0&&e.push(T(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return L(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let o=(s.converter?.toAttribute!==void 0?s.converter:I).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let o=s.getPropertyOptions(i),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:I;this._$Em=i,this[i]=n.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??tt)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,o]of this._$Ep)this[i]=o;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,o]of s)o.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],o)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[w("elementProperties")]=new Map,$[w("finalized")]=new Map,At?.({ReactiveElement:$}),(M.reactiveElementVersions??=[]).push("2.0.4");var J=globalThis,j=J.trustedTypes,et=j?j.createPolicy("lit-html",{createHTML:r=>r}):void 0,ht="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,at="?"+_,yt=`<${at}>`,A=document,C=()=>A.createComment(""),P=r=>r===null||typeof r!="object"&&typeof r!="function",F=Array.isArray,vt=r=>F(r)||typeof r?.[Symbol.iterator]=="function",B=`[ -\f\r]`,x=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,st=/-->/g,it=/>/g,g=RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^ +var R=globalThis,N=R.ShadowRoot&&(R.ShadyCSS===void 0||R.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,k=Symbol(),Z=new WeakMap,E=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==k)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(N&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=Z.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Z.set(e,t))}return t}toString(){return this.cssText}},X=r=>new E(typeof r=="string"?r:r+"",void 0,k),z=(r,...t)=>{let e=r.length===1?r[0]:t.reduce((s,i,o)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[o+1],r[0]);return new E(e,r,k)},L=(r,t)=>{if(N)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=R.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s)}},T=N?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return X(e)})(r):r;var{is:pt,defineProperty:ut,getOwnPropertyDescriptor:$t,getOwnPropertyNames:ft,getOwnPropertySymbols:_t,getPrototypeOf:gt}=Object,M=globalThis,G=M.trustedTypes,mt=G?G.emptyScript:"",At=M.reactiveElementPolyfillSupport,w=(r,t)=>r,I={toAttribute(r,t){switch(t){case Boolean:r=r?mt:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},tt=(r,t)=>!pt(r,t),Y={attribute:!0,type:String,converter:I,reflect:!1,hasChanged:tt};Symbol.metadata??=Symbol("metadata"),M.litPropertyMetadata??=new WeakMap;var $=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Y){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&ut(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:o}=$t(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i?.call(this)},set(n){let p=i?.call(this);o.call(this,n),this.requestUpdate(t,p,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Y}static _$Ei(){if(this.hasOwnProperty(w("elementProperties")))return;let t=gt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(w("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(w("properties"))){let e=this.properties,s=[...ft(e),..._t(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(T(i))}else t!==void 0&&e.push(T(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return L(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let o=(s.converter?.toAttribute!==void 0?s.converter:I).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let o=s.getPropertyOptions(i),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:I;this._$Em=i,this[i]=n.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??tt)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,o]of this._$Ep)this[i]=o;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,o]of s)o.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],o)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[w("elementProperties")]=new Map,$[w("finalized")]=new Map,At?.({ReactiveElement:$}),(M.reactiveElementVersions??=[]).push("2.0.4");var J=globalThis,j=J.trustedTypes,et=j?j.createPolicy("lit-html",{createHTML:r=>r}):void 0,ht="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,at="?"+_,yt=`<${at}>`,A=document,C=()=>A.createComment(""),P=r=>r===null||typeof r!="object"&&typeof r!="function",F=Array.isArray,vt=r=>F(r)||typeof r?.[Symbol.iterator]=="function",B=`[ +\f\r]`,x=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,st=/-->/g,it=/>/g,g=RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`,"g"),rt=/'/g,ot=/"/g,lt=/^(?:script|style|textarea|title)$/i,Q=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),Ut=Q(1),Ht=Q(2),Ot=Q(3),y=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),nt=new WeakMap,m=A.createTreeWalker(A,129);function ct(r,t){if(!F(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return et!==void 0?et.createHTML(t):t}var St=(r,t)=>{let e=r.length-1,s=[],i,o=t===2?"":t===3?"":"",n=x;for(let p=0;p"?(n=i??x,a=-1):d[1]===void 0?a=-2:(a=n.lastIndex-d[2].length,l=d[1],n=d[3]===void 0?g:d[3]==='"'?ot:rt):n===ot||n===rt?n=g:n===st||n===it?n=x:(n=g,i=void 0);let f=n===g&&r[p+1].startsWith("/>")?" ":"";o+=n===x?h+yt:a>=0?(s.push(l),h.slice(0,a)+ht+h.slice(a)+_+f):h+_+(a===-2?p:f)}return[ct(r,o+(r[e]||"")+(t===2?"":t===3?"":"")),s]},U=class r{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let o=0,n=0,p=t.length-1,h=this.parts,[l,d]=St(t,e);if(this.el=r.createElement(l,s),m.currentNode=this.el.content,e===2||e===3){let a=this.el.content.firstChild;a.replaceWith(...a.childNodes)}for(;(i=m.nextNode())!==null&&h.length0){i.textContent=j?j.emptyScript:"";for(let f=0;f2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=c}_$AI(t,e=this,s,i){let o=this.strings,n=!1;if(o===void 0)t=v(this,t,e,0),n=!P(t)||t!==this._$AH&&t!==y,n&&(this._$AH=t);else{let p=t,h,l;for(t=o[0],h=0;h{let s=e?.renderBefore??t,i=s._$litPart$;if(i===void 0){let o=e?.renderBefore??null;s._$litPart$=i=new H(t.insertBefore(C(),o),o,void 0,e??{})}return i._$AI(r),i};var b=class extends ${constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=dt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return y}};b._$litElement$=!0,b.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:b});var Et=globalThis.litElementPolyfillSupport;Et?.({LitElement:b});(globalThis.litElementVersions??=[]).push("4.1.0");var qt=z` .legacy-button { align-items: center; diff --git a/geemap/static/layer_manager.js b/geemap/static/layer_manager.js index 79a6fd5c7c..f6c41ce8f9 100644 --- a/geemap/static/layer_manager.js +++ b/geemap/static/layer_manager.js @@ -1,5 +1,5 @@ -var At=Object.defineProperty;var vt=Object.getOwnPropertyDescriptor;var st=(r,t,e,s)=>{for(var i=s>1?void 0:s?vt(t,e):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(i=(s?n(t,e,i):n(i))||i);return s&&i&&At(t,e,i),i};var T=globalThis,k=T.ShadowRoot&&(T.ShadyCSS===void 0||T.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,V=Symbol(),it=new WeakMap,x=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==V)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(k&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=it.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&it.set(e,t))}return t}toString(){return this.cssText}},rt=r=>new x(typeof r=="string"?r:r+"",void 0,V),w=(r,...t)=>{let e=r.length===1?r[0]:t.reduce((s,i,o)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[o+1],r[0]);return new x(e,r,V)},B=(r,t)=>{if(k)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=T.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s)}},j=k?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return rt(e)})(r):r;var{is:bt,defineProperty:St,getOwnPropertyDescriptor:Et,getOwnPropertyNames:xt,getOwnPropertySymbols:wt,getPrototypeOf:Ct}=Object,L=globalThis,ot=L.trustedTypes,Pt=ot?ot.emptyScript:"",Mt=L.reactiveElementPolyfillSupport,C=(r,t)=>r,P={toAttribute(r,t){switch(t){case Boolean:r=r?Pt:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},z=(r,t)=>!bt(r,t),nt={attribute:!0,type:String,converter:P,reflect:!1,hasChanged:z};Symbol.metadata??=Symbol("metadata"),L.litPropertyMetadata??=new WeakMap;var m=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=nt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&St(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:o}=Et(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i?.call(this)},set(n){let h=i?.call(this);o.call(this,n),this.requestUpdate(t,h,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??nt}static _$Ei(){if(this.hasOwnProperty(C("elementProperties")))return;let t=Ct(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(C("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(C("properties"))){let e=this.properties,s=[...xt(e),...wt(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(j(i))}else t!==void 0&&e.push(j(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return B(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let o=(s.converter?.toAttribute!==void 0?s.converter:P).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let o=s.getPropertyOptions(i),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:P;this._$Em=i,this[i]=n.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??z)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,o]of this._$Ep)this[i]=o;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,o]of s)o.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],o)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};m.elementStyles=[],m.shadowRootOptions={mode:"open"},m[C("elementProperties")]=new Map,m[C("finalized")]=new Map,Mt?.({ReactiveElement:m}),(L.reactiveElementVersions??=[]).push("2.0.4");var X=globalThis,I=X.trustedTypes,at=I?I.createPolicy("lit-html",{createHTML:r=>r}):void 0,ut="$lit$",g=`lit$${Math.random().toFixed(9).slice(2)}$`,mt="?"+g,Ut=`<${mt}>`,A=document,U=()=>A.createComment(""),N=r=>r===null||typeof r!="object"&&typeof r!="function",Y=Array.isArray,Nt=r=>Y(r)||typeof r?.[Symbol.iterator]=="function",W=`[ -\f\r]`,M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,lt=/-->/g,ht=/>/g,$=RegExp(`>|${W}(?:([^\\s"'>=/]+)(${W}*=${W}*(?:[^ +var At=Object.defineProperty;var vt=Object.getOwnPropertyDescriptor;var st=(r,t,e,s)=>{for(var i=s>1?void 0:s?vt(t,e):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(i=(s?n(t,e,i):n(i))||i);return s&&i&&At(t,e,i),i};var T=globalThis,k=T.ShadowRoot&&(T.ShadyCSS===void 0||T.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,V=Symbol(),it=new WeakMap,x=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==V)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(k&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=it.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&it.set(e,t))}return t}toString(){return this.cssText}},rt=r=>new x(typeof r=="string"?r:r+"",void 0,V),w=(r,...t)=>{let e=r.length===1?r[0]:t.reduce((s,i,o)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[o+1],r[0]);return new x(e,r,V)},B=(r,t)=>{if(k)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=T.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s)}},j=k?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return rt(e)})(r):r;var{is:bt,defineProperty:St,getOwnPropertyDescriptor:Et,getOwnPropertyNames:xt,getOwnPropertySymbols:wt,getPrototypeOf:Ct}=Object,L=globalThis,ot=L.trustedTypes,Pt=ot?ot.emptyScript:"",Mt=L.reactiveElementPolyfillSupport,C=(r,t)=>r,P={toAttribute(r,t){switch(t){case Boolean:r=r?Pt:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},z=(r,t)=>!bt(r,t),nt={attribute:!0,type:String,converter:P,reflect:!1,hasChanged:z};Symbol.metadata??=Symbol("metadata"),L.litPropertyMetadata??=new WeakMap;var m=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=nt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&St(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:o}=Et(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i?.call(this)},set(n){let h=i?.call(this);o.call(this,n),this.requestUpdate(t,h,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??nt}static _$Ei(){if(this.hasOwnProperty(C("elementProperties")))return;let t=Ct(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(C("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(C("properties"))){let e=this.properties,s=[...xt(e),...wt(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(j(i))}else t!==void 0&&e.push(j(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return B(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let o=(s.converter?.toAttribute!==void 0?s.converter:P).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let o=s.getPropertyOptions(i),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:P;this._$Em=i,this[i]=n.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??z)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,o]of this._$Ep)this[i]=o;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,o]of s)o.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],o)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};m.elementStyles=[],m.shadowRootOptions={mode:"open"},m[C("elementProperties")]=new Map,m[C("finalized")]=new Map,Mt?.({ReactiveElement:m}),(L.reactiveElementVersions??=[]).push("2.0.4");var X=globalThis,I=X.trustedTypes,at=I?I.createPolicy("lit-html",{createHTML:r=>r}):void 0,ut="$lit$",g=`lit$${Math.random().toFixed(9).slice(2)}$`,mt="?"+g,Ut=`<${mt}>`,A=document,U=()=>A.createComment(""),N=r=>r===null||typeof r!="object"&&typeof r!="function",Y=Array.isArray,Nt=r=>Y(r)||typeof r?.[Symbol.iterator]=="function",W=`[ +\f\r]`,M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,lt=/-->/g,ht=/>/g,$=RegExp(`>|${W}(?:([^\\s"'>=/]+)(${W}*=${W}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`,"g"),ct=/'/g,dt=/"/g,ft=/^(?:script|style|textarea|title)$/i,G=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),gt=G(1),Bt=G(2),Wt=G(3),v=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),pt=new WeakMap,_=A.createTreeWalker(A,129);function yt(r,t){if(!Y(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return at!==void 0?at.createHTML(t):t}var Ot=(r,t)=>{let e=r.length-1,s=[],i,o=t===2?"":t===3?"":"",n=M;for(let h=0;h"?(n=i??M,l=-1):p[1]===void 0?l=-2:(l=n.lastIndex-p[2].length,c=p[1],n=p[3]===void 0?$:p[3]==='"'?dt:ct):n===dt||n===ct?n=$:n===lt||n===ht?n=M:(n=$,i=void 0);let f=n===$&&r[h+1].startsWith("/>")?" ":"";o+=n===M?a+Ut:l>=0?(s.push(c),a.slice(0,l)+ut+a.slice(l)+g+f):a+g+(l===-2?h:f)}return[yt(r,o+(r[e]||"")+(t===2?"":t===3?"":"")),s]},O=class r{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let o=0,n=0,h=t.length-1,a=this.parts,[c,p]=Ot(t,e);if(this.el=r.createElement(c,s),_.currentNode=this.el.content,e===2||e===3){let l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(i=_.nextNode())!==null&&a.length0){i.textContent=I?I.emptyScript:"";for(let f=0;f2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=d}_$AI(t,e=this,s,i){let o=this.strings,n=!1;if(o===void 0)t=b(this,t,e,0),n=!N(t)||t!==this._$AH&&t!==v,n&&(this._$AH=t);else{let h=t,a,c;for(t=o[0],a=0;a{let s=e?.renderBefore??t,i=s._$litPart$;if(i===void 0){let o=e?.renderBefore??null;s._$litPart$=i=new R(t.insertBefore(U(),o),o,void 0,e??{})}return i._$AI(r),i};var y=class extends m{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=$t(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return v}};y._$litElement$=!0,y.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:y});var Ht=globalThis.litElementPolyfillSupport;Ht?.({LitElement:y});(globalThis.litElementVersions??=[]).push("4.1.0");var Tt={attribute:!0,type:String,converter:P,reflect:!1,hasChanged:z},kt=(r=Tt,t,e)=>{let{kind:s,metadata:i}=e,o=globalThis.litPropertyMetadata.get(i);if(o===void 0&&globalThis.litPropertyMetadata.set(i,o=new Map),o.set(e.name,r),s==="accessor"){let{name:n}=e;return{set(h){let a=t.get.call(this);t.set.call(this,h),this.requestUpdate(n,a,r)},init(h){return h!==void 0&&this.P(n,void 0,r),h}}}if(s==="setter"){let{name:n}=e;return function(h){let a=this[n];t.call(this,h),this.requestUpdate(n,a,r)}}throw Error("Unsupported decorator location: "+s)};function tt(r){return(t,e)=>typeof e=="object"?kt(r,t,e):((s,i,o)=>{let n=i.hasOwnProperty(o);return i.constructor.createProperty(o,n?{...s,wrapped:!0}:s),n?Object.getOwnPropertyDescriptor(i,o):void 0})(r,t,e)}var _t=w` .legacy-button { align-items: center; diff --git a/geemap/static/layer_manager_row.js b/geemap/static/layer_manager_row.js index ded592464a..b12f1ad61f 100644 --- a/geemap/static/layer_manager_row.js +++ b/geemap/static/layer_manager_row.js @@ -1,5 +1,5 @@ -var _t=Object.defineProperty;var bt=Object.getOwnPropertyDescriptor;var w=(o,t,e,s)=>{for(var i=s>1?void 0:s?bt(t,e):t,n=o.length-1,r;n>=0;n--)(r=o[n])&&(i=(s?r(t,e,i):r(i))||i);return s&&i&&_t(t,e,i),i};var L=globalThis,z=L.ShadowRoot&&(L.ShadyCSS===void 0||L.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,W=Symbol(),it=new WeakMap,k=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==W)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(z&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=it.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&it.set(e,t))}return t}toString(){return this.cssText}},ot=o=>new k(typeof o=="string"?o:o+"",void 0,W),v=(o,...t)=>{let e=o.length===1?o[0]:t.reduce((s,i,n)=>s+(r=>{if(r._$cssResult$===!0)return r.cssText;if(typeof r=="number")return r;throw Error("Value passed to 'css' function must be a 'css' function result: "+r+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+o[n+1],o[0]);return new k(e,o,W)},J=(o,t)=>{if(z)o.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=L.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,o.appendChild(s)}},D=z?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return ot(e)})(o):o;var{is:At,defineProperty:xt,getOwnPropertyDescriptor:St,getOwnPropertyNames:wt,getOwnPropertySymbols:Et,getPrototypeOf:Ct}=Object,I=globalThis,nt=I.trustedTypes,Pt=nt?nt.emptyScript:"",kt=I.reactiveElementPolyfillSupport,R=(o,t)=>o,U={toAttribute(o,t){switch(t){case Boolean:o=o?Pt:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},V=(o,t)=>!At(o,t),rt={attribute:!0,type:String,converter:U,reflect:!1,hasChanged:V};Symbol.metadata??=Symbol("metadata"),I.litPropertyMetadata??=new WeakMap;var m=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=rt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&xt(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:n}=St(this.prototype,t)??{get(){return this[e]},set(r){this[e]=r}};return{get(){return i?.call(this)},set(r){let h=i?.call(this);n.call(this,r),this.requestUpdate(t,h,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??rt}static _$Ei(){if(this.hasOwnProperty(R("elementProperties")))return;let t=Ct(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(R("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(R("properties"))){let e=this.properties,s=[...wt(e),...Et(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(D(i))}else t!==void 0&&e.push(D(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return J(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let n=(s.converter?.toAttribute!==void 0?s.converter:U).toAttribute(e,s.type);this._$Em=t,n==null?this.removeAttribute(i):this.setAttribute(i,n),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let n=s.getPropertyOptions(i),r=typeof n.converter=="function"?{fromAttribute:n.converter}:n.converter?.fromAttribute!==void 0?n.converter:U;this._$Em=i,this[i]=r.fromAttribute(e,n.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??V)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,n]of this._$Ep)this[i]=n;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,n]of s)n.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],n)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};m.elementStyles=[],m.shadowRootOptions={mode:"open"},m[R("elementProperties")]=new Map,m[R("finalized")]=new Map,kt?.({ReactiveElement:m}),(I.reactiveElementVersions??=[]).push("2.0.4");var G=globalThis,q=G.trustedTypes,at=q?q.createPolicy("lit-html",{createHTML:o=>o}):void 0,ut="$lit$",g=`lit$${Math.random().toFixed(9).slice(2)}$`,mt="?"+g,Rt=`<${mt}>`,A=document,O=()=>A.createComment(""),N=o=>o===null||typeof o!="object"&&typeof o!="function",tt=Array.isArray,Ut=o=>tt(o)||typeof o?.[Symbol.iterator]=="function",K=`[ -\f\r]`,M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,lt=/-->/g,ht=/>/g,_=RegExp(`>|${K}(?:([^\\s"'>=/]+)(${K}*=${K}*(?:[^ +var _t=Object.defineProperty;var bt=Object.getOwnPropertyDescriptor;var w=(o,t,e,s)=>{for(var i=s>1?void 0:s?bt(t,e):t,n=o.length-1,r;n>=0;n--)(r=o[n])&&(i=(s?r(t,e,i):r(i))||i);return s&&i&&_t(t,e,i),i};var L=globalThis,z=L.ShadowRoot&&(L.ShadyCSS===void 0||L.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,W=Symbol(),it=new WeakMap,k=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==W)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(z&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=it.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&it.set(e,t))}return t}toString(){return this.cssText}},ot=o=>new k(typeof o=="string"?o:o+"",void 0,W),v=(o,...t)=>{let e=o.length===1?o[0]:t.reduce((s,i,n)=>s+(r=>{if(r._$cssResult$===!0)return r.cssText;if(typeof r=="number")return r;throw Error("Value passed to 'css' function must be a 'css' function result: "+r+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+o[n+1],o[0]);return new k(e,o,W)},J=(o,t)=>{if(z)o.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=L.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,o.appendChild(s)}},D=z?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return ot(e)})(o):o;var{is:At,defineProperty:xt,getOwnPropertyDescriptor:St,getOwnPropertyNames:wt,getOwnPropertySymbols:Et,getPrototypeOf:Ct}=Object,I=globalThis,nt=I.trustedTypes,Pt=nt?nt.emptyScript:"",kt=I.reactiveElementPolyfillSupport,R=(o,t)=>o,U={toAttribute(o,t){switch(t){case Boolean:o=o?Pt:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},V=(o,t)=>!At(o,t),rt={attribute:!0,type:String,converter:U,reflect:!1,hasChanged:V};Symbol.metadata??=Symbol("metadata"),I.litPropertyMetadata??=new WeakMap;var m=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=rt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&xt(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:n}=St(this.prototype,t)??{get(){return this[e]},set(r){this[e]=r}};return{get(){return i?.call(this)},set(r){let h=i?.call(this);n.call(this,r),this.requestUpdate(t,h,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??rt}static _$Ei(){if(this.hasOwnProperty(R("elementProperties")))return;let t=Ct(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(R("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(R("properties"))){let e=this.properties,s=[...wt(e),...Et(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(D(i))}else t!==void 0&&e.push(D(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return J(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let n=(s.converter?.toAttribute!==void 0?s.converter:U).toAttribute(e,s.type);this._$Em=t,n==null?this.removeAttribute(i):this.setAttribute(i,n),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let n=s.getPropertyOptions(i),r=typeof n.converter=="function"?{fromAttribute:n.converter}:n.converter?.fromAttribute!==void 0?n.converter:U;this._$Em=i,this[i]=r.fromAttribute(e,n.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??V)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,n]of this._$Ep)this[i]=n;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,n]of s)n.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],n)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};m.elementStyles=[],m.shadowRootOptions={mode:"open"},m[R("elementProperties")]=new Map,m[R("finalized")]=new Map,kt?.({ReactiveElement:m}),(I.reactiveElementVersions??=[]).push("2.0.4");var G=globalThis,q=G.trustedTypes,at=q?q.createPolicy("lit-html",{createHTML:o=>o}):void 0,ut="$lit$",g=`lit$${Math.random().toFixed(9).slice(2)}$`,mt="?"+g,Rt=`<${mt}>`,A=document,O=()=>A.createComment(""),N=o=>o===null||typeof o!="object"&&typeof o!="function",tt=Array.isArray,Ut=o=>tt(o)||typeof o?.[Symbol.iterator]=="function",K=`[ +\f\r]`,M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,lt=/-->/g,ht=/>/g,_=RegExp(`>|${K}(?:([^\\s"'>=/]+)(${K}*=${K}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`,"g"),ct=/'/g,dt=/"/g,ft=/^(?:script|style|textarea|title)$/i,et=o=>(t,...e)=>({_$litType$:o,strings:t,values:e}),st=et(1),qt=et(2),Bt=et(3),x=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),pt=new WeakMap,b=A.createTreeWalker(A,129);function gt(o,t){if(!tt(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return at!==void 0?at.createHTML(t):t}var Mt=(o,t)=>{let e=o.length-1,s=[],i,n=t===2?"":t===3?"":"",r=M;for(let h=0;h"?(r=i??M,l=-1):p[1]===void 0?l=-2:(l=r.lastIndex-p[2].length,d=p[1],r=p[3]===void 0?_:p[3]==='"'?dt:ct):r===dt||r===ct?r=_:r===lt||r===ht?r=M:(r=_,i=void 0);let f=r===_&&o[h+1].startsWith("/>")?" ":"";n+=r===M?a+Rt:l>=0?(s.push(d),a.slice(0,l)+ut+a.slice(l)+g+f):a+g+(l===-2?h:f)}return[gt(o,n+(o[e]||"")+(t===2?"":t===3?"":"")),s]},H=class o{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let n=0,r=0,h=t.length-1,a=this.parts,[d,p]=Mt(t,e);if(this.el=o.createElement(d,s),b.currentNode=this.el.content,e===2||e===3){let l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(i=b.nextNode())!==null&&a.length0){i.textContent=q?q.emptyScript:"";for(let f=0;f2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=c}_$AI(t,e=this,s,i){let n=this.strings,r=!1;if(n===void 0)t=E(this,t,e,0),r=!N(t)||t!==this._$AH&&t!==x,r&&(this._$AH=t);else{let h=t,a,d;for(t=n[0],a=0;a{let s=e?.renderBefore??t,i=s._$litPart$;if(i===void 0){let n=e?.renderBefore??null;s._$litPart$=i=new T(t.insertBefore(O(),n),n,void 0,e??{})}return i._$AI(o),i};var y=class extends m{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=yt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return x}};y._$litElement$=!0,y.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:y});var Nt=globalThis.litElementPolyfillSupport;Nt?.({LitElement:y});(globalThis.litElementVersions??=[]).push("4.1.0");var Ht={attribute:!0,type:String,converter:U,reflect:!1,hasChanged:V},Tt=(o=Ht,t,e)=>{let{kind:s,metadata:i}=e,n=globalThis.litPropertyMetadata.get(i);if(n===void 0&&globalThis.litPropertyMetadata.set(i,n=new Map),n.set(e.name,o),s==="accessor"){let{name:r}=e;return{set(h){let a=t.get.call(this);t.set.call(this,h),this.requestUpdate(r,a,o)},init(h){return h!==void 0&&this.P(r,void 0,o),h}}}if(s==="setter"){let{name:r}=e;return function(h){let a=this[r];t.call(this,h),this.requestUpdate(r,a,o)}}throw Error("Unsupported decorator location: "+s)};function S(o){return(t,e)=>typeof e=="object"?Tt(o,t,e):((s,i,n)=>{let r=i.hasOwnProperty(n);return i.constructor.createProperty(n,r?{...s,wrapped:!0}:s),r?Object.getOwnPropertyDescriptor(i,n):void 0})(o,t,e)}var $t=v` .legacy-button { align-items: center; @@ -123,7 +123,7 @@ var _t=Object.defineProperty;var bt=Object.getOwnPropertyDescriptor;var w=(o,t,e 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } - + button.loading .spinner, button.loading:hover .close-icon, button.done-loading .close-icon { diff --git a/geemap/static/material_styles.js b/geemap/static/material_styles.js index 7207557d14..bedb21f150 100644 --- a/geemap/static/material_styles.js +++ b/geemap/static/material_styles.js @@ -1,5 +1,5 @@ -var R=globalThis,T=R.ShadowRoot&&(R.ShadyCSS===void 0||R.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,L=Symbol(),F=new WeakMap,b=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==L)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(T&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=F.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&F.set(e,t))}return t}toString(){return this.cssText}},Q=o=>new b(typeof o=="string"?o:o+"",void 0,L),z=(o,...t)=>{let e=o.length===1?o[0]:t.reduce((s,i,r)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+o[r+1],o[0]);return new b(e,o,L)},I=(o,t)=>{if(T)o.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=R.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,o.appendChild(s)}},M=T?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return Q(e)})(o):o;var{is:pt,defineProperty:ut,getOwnPropertyDescriptor:$t,getOwnPropertyNames:ft,getOwnPropertySymbols:_t,getPrototypeOf:mt}=Object,N=globalThis,Y=N.trustedTypes,At=Y?Y.emptyScript:"",gt=N.reactiveElementPolyfillSupport,w=(o,t)=>o,j={toAttribute(o,t){switch(t){case Boolean:o=o?At:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},tt=(o,t)=>!pt(o,t),G={attribute:!0,type:String,converter:j,reflect:!1,hasChanged:tt};Symbol.metadata??=Symbol("metadata"),N.litPropertyMetadata??=new WeakMap;var $=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=G){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&ut(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:r}=$t(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i?.call(this)},set(n){let p=i?.call(this);r.call(this,n),this.requestUpdate(t,p,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??G}static _$Ei(){if(this.hasOwnProperty(w("elementProperties")))return;let t=mt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(w("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(w("properties"))){let e=this.properties,s=[...ft(e),..._t(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(M(i))}else t!==void 0&&e.push(M(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return I(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let r=(s.converter?.toAttribute!==void 0?s.converter:j).toAttribute(e,s.type);this._$Em=t,r==null?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let r=s.getPropertyOptions(i),n=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute!==void 0?r.converter:j;this._$Em=i,this[i]=n.fromAttribute(e,r.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??tt)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,r]of this._$Ep)this[i]=r;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,r]of s)r.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],r)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[w("elementProperties")]=new Map,$[w("finalized")]=new Map,gt?.({ReactiveElement:$}),(N.reactiveElementVersions??=[]).push("2.0.4");var K=globalThis,k=K.trustedTypes,et=k?k.createPolicy("lit-html",{createHTML:o=>o}):void 0,ht="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,at="?"+_,yt=`<${at}>`,g=document,x=()=>g.createComment(""),P=o=>o===null||typeof o!="object"&&typeof o!="function",X=Array.isArray,vt=o=>X(o)||typeof o?.[Symbol.iterator]=="function",B=`[ -\f\r]`,C=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,st=/-->/g,it=/>/g,m=RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^ +var R=globalThis,T=R.ShadowRoot&&(R.ShadyCSS===void 0||R.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,L=Symbol(),F=new WeakMap,b=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==L)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(T&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=F.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&F.set(e,t))}return t}toString(){return this.cssText}},Q=o=>new b(typeof o=="string"?o:o+"",void 0,L),z=(o,...t)=>{let e=o.length===1?o[0]:t.reduce((s,i,r)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+o[r+1],o[0]);return new b(e,o,L)},I=(o,t)=>{if(T)o.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=R.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,o.appendChild(s)}},M=T?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return Q(e)})(o):o;var{is:pt,defineProperty:ut,getOwnPropertyDescriptor:$t,getOwnPropertyNames:ft,getOwnPropertySymbols:_t,getPrototypeOf:mt}=Object,N=globalThis,Y=N.trustedTypes,At=Y?Y.emptyScript:"",gt=N.reactiveElementPolyfillSupport,w=(o,t)=>o,j={toAttribute(o,t){switch(t){case Boolean:o=o?At:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},tt=(o,t)=>!pt(o,t),G={attribute:!0,type:String,converter:j,reflect:!1,hasChanged:tt};Symbol.metadata??=Symbol("metadata"),N.litPropertyMetadata??=new WeakMap;var $=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=G){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&ut(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:r}=$t(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i?.call(this)},set(n){let p=i?.call(this);r.call(this,n),this.requestUpdate(t,p,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??G}static _$Ei(){if(this.hasOwnProperty(w("elementProperties")))return;let t=mt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(w("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(w("properties"))){let e=this.properties,s=[...ft(e),..._t(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(M(i))}else t!==void 0&&e.push(M(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return I(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let r=(s.converter?.toAttribute!==void 0?s.converter:j).toAttribute(e,s.type);this._$Em=t,r==null?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let r=s.getPropertyOptions(i),n=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute!==void 0?r.converter:j;this._$Em=i,this[i]=n.fromAttribute(e,r.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??tt)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,r]of this._$Ep)this[i]=r;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,r]of s)r.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],r)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[w("elementProperties")]=new Map,$[w("finalized")]=new Map,gt?.({ReactiveElement:$}),(N.reactiveElementVersions??=[]).push("2.0.4");var K=globalThis,k=K.trustedTypes,et=k?k.createPolicy("lit-html",{createHTML:o=>o}):void 0,ht="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,at="?"+_,yt=`<${at}>`,g=document,x=()=>g.createComment(""),P=o=>o===null||typeof o!="object"&&typeof o!="function",X=Array.isArray,vt=o=>X(o)||typeof o?.[Symbol.iterator]=="function",B=`[ +\f\r]`,C=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,st=/-->/g,it=/>/g,m=RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`,"g"),ot=/'/g,rt=/"/g,lt=/^(?:script|style|textarea|title)$/i,Z=o=>(t,...e)=>({_$litType$:o,strings:t,values:e}),Ut=Z(1),Ht=Z(2),Ot=Z(3),y=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),nt=new WeakMap,A=g.createTreeWalker(g,129);function ct(o,t){if(!X(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return et!==void 0?et.createHTML(t):t}var St=(o,t)=>{let e=o.length-1,s=[],i,r=t===2?"":t===3?"":"",n=C;for(let p=0;p"?(n=i??C,a=-1):d[1]===void 0?a=-2:(a=n.lastIndex-d[2].length,l=d[1],n=d[3]===void 0?m:d[3]==='"'?rt:ot):n===rt||n===ot?n=m:n===st||n===it?n=C:(n=m,i=void 0);let f=n===m&&o[p+1].startsWith("/>")?" ":"";r+=n===C?h+yt:a>=0?(s.push(l),h.slice(0,a)+ht+h.slice(a)+_+f):h+_+(a===-2?p:f)}return[ct(o,r+(o[e]||"")+(t===2?"":t===3?"":"")),s]},U=class o{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let r=0,n=0,p=t.length-1,h=this.parts,[l,d]=St(t,e);if(this.el=o.createElement(l,s),A.currentNode=this.el.content,e===2||e===3){let a=this.el.content.firstChild;a.replaceWith(...a.childNodes)}for(;(i=A.nextNode())!==null&&h.length0){i.textContent=k?k.emptyScript:"";for(let f=0;f2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=c}_$AI(t,e=this,s,i){let r=this.strings,n=!1;if(r===void 0)t=v(this,t,e,0),n=!P(t)||t!==this._$AH&&t!==y,n&&(this._$AH=t);else{let p=t,h,l;for(t=r[0],h=0;h{let s=e?.renderBefore??t,i=s._$litPart$;if(i===void 0){let r=e?.renderBefore??null;s._$litPart$=i=new H(t.insertBefore(x(),r),r,void 0,e??{})}return i._$AI(o),i};var E=class extends ${constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=dt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return y}};E._$litElement$=!0,E.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:E});var bt=globalThis.litElementPolyfillSupport;bt?.({LitElement:E});(globalThis.litElementVersions??=[]).push("4.1.0");var Jt=z` @font-face { font-family: 'Material Symbols Outlined'; diff --git a/js/layer_manager_row.ts b/js/layer_manager_row.ts index 0630432dd6..e760f0105f 100644 --- a/js/layer_manager_row.ts +++ b/js/layer_manager_row.ts @@ -69,7 +69,7 @@ export class LayerManagerRow extends LitElement { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } - + button.loading .spinner, button.loading:hover .close-icon, button.done-loading .close-icon { From 5fa9733dafef6f8973cfa56ac282fc37915ce092 Mon Sep 17 00:00:00 2001 From: Nathaniel Schmitz Date: Fri, 11 Oct 2024 16:43:43 -0400 Subject: [PATCH 11/57] Update static files --- geemap/static/ipywidgets_styles.js | 5 ++--- geemap/static/layer_manager.css | 1 - geemap/static/layer_manager.js | 5 ++--- geemap/static/layer_manager_row.css | 1 - geemap/static/layer_manager_row.js | 5 ++--- geemap/static/material_styles.js | 5 ++--- geemap/static/utils.js | 1 - 7 files changed, 8 insertions(+), 15 deletions(-) diff --git a/geemap/static/ipywidgets_styles.js b/geemap/static/ipywidgets_styles.js index 509f652597..5af999a37d 100644 --- a/geemap/static/ipywidgets_styles.js +++ b/geemap/static/ipywidgets_styles.js @@ -1,5 +1,5 @@ -var R=globalThis,N=R.ShadowRoot&&(R.ShadyCSS===void 0||R.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,k=Symbol(),Z=new WeakMap,E=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==k)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(N&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=Z.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Z.set(e,t))}return t}toString(){return this.cssText}},X=r=>new E(typeof r=="string"?r:r+"",void 0,k),z=(r,...t)=>{let e=r.length===1?r[0]:t.reduce((s,i,o)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[o+1],r[0]);return new E(e,r,k)},L=(r,t)=>{if(N)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=R.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s)}},T=N?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return X(e)})(r):r;var{is:pt,defineProperty:ut,getOwnPropertyDescriptor:$t,getOwnPropertyNames:ft,getOwnPropertySymbols:_t,getPrototypeOf:gt}=Object,M=globalThis,G=M.trustedTypes,mt=G?G.emptyScript:"",At=M.reactiveElementPolyfillSupport,w=(r,t)=>r,I={toAttribute(r,t){switch(t){case Boolean:r=r?mt:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},tt=(r,t)=>!pt(r,t),Y={attribute:!0,type:String,converter:I,reflect:!1,hasChanged:tt};Symbol.metadata??=Symbol("metadata"),M.litPropertyMetadata??=new WeakMap;var $=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Y){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&ut(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:o}=$t(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i?.call(this)},set(n){let p=i?.call(this);o.call(this,n),this.requestUpdate(t,p,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Y}static _$Ei(){if(this.hasOwnProperty(w("elementProperties")))return;let t=gt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(w("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(w("properties"))){let e=this.properties,s=[...ft(e),..._t(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(T(i))}else t!==void 0&&e.push(T(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return L(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let o=(s.converter?.toAttribute!==void 0?s.converter:I).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let o=s.getPropertyOptions(i),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:I;this._$Em=i,this[i]=n.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??tt)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,o]of this._$Ep)this[i]=o;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,o]of s)o.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],o)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[w("elementProperties")]=new Map,$[w("finalized")]=new Map,At?.({ReactiveElement:$}),(M.reactiveElementVersions??=[]).push("2.0.4");var J=globalThis,j=J.trustedTypes,et=j?j.createPolicy("lit-html",{createHTML:r=>r}):void 0,ht="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,at="?"+_,yt=`<${at}>`,A=document,C=()=>A.createComment(""),P=r=>r===null||typeof r!="object"&&typeof r!="function",F=Array.isArray,vt=r=>F(r)||typeof r?.[Symbol.iterator]=="function",B=`[ -\f\r]`,x=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,st=/-->/g,it=/>/g,g=RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^ +var R=globalThis,N=R.ShadowRoot&&(R.ShadyCSS===void 0||R.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,k=Symbol(),Z=new WeakMap,E=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==k)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(N&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=Z.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Z.set(e,t))}return t}toString(){return this.cssText}},X=r=>new E(typeof r=="string"?r:r+"",void 0,k),z=(r,...t)=>{let e=r.length===1?r[0]:t.reduce((s,i,o)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[o+1],r[0]);return new E(e,r,k)},L=(r,t)=>{if(N)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=R.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s)}},T=N?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return X(e)})(r):r;var{is:pt,defineProperty:ut,getOwnPropertyDescriptor:$t,getOwnPropertyNames:ft,getOwnPropertySymbols:_t,getPrototypeOf:gt}=Object,M=globalThis,G=M.trustedTypes,mt=G?G.emptyScript:"",At=M.reactiveElementPolyfillSupport,w=(r,t)=>r,I={toAttribute(r,t){switch(t){case Boolean:r=r?mt:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},tt=(r,t)=>!pt(r,t),Y={attribute:!0,type:String,converter:I,reflect:!1,hasChanged:tt};Symbol.metadata??=Symbol("metadata"),M.litPropertyMetadata??=new WeakMap;var $=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Y){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&ut(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:o}=$t(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i?.call(this)},set(n){let p=i?.call(this);o.call(this,n),this.requestUpdate(t,p,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Y}static _$Ei(){if(this.hasOwnProperty(w("elementProperties")))return;let t=gt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(w("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(w("properties"))){let e=this.properties,s=[...ft(e),..._t(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(T(i))}else t!==void 0&&e.push(T(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return L(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let o=(s.converter?.toAttribute!==void 0?s.converter:I).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let o=s.getPropertyOptions(i),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:I;this._$Em=i,this[i]=n.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??tt)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,o]of this._$Ep)this[i]=o;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,o]of s)o.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],o)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[w("elementProperties")]=new Map,$[w("finalized")]=new Map,At?.({ReactiveElement:$}),(M.reactiveElementVersions??=[]).push("2.0.4");var J=globalThis,j=J.trustedTypes,et=j?j.createPolicy("lit-html",{createHTML:r=>r}):void 0,ht="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,at="?"+_,yt=`<${at}>`,A=document,C=()=>A.createComment(""),P=r=>r===null||typeof r!="object"&&typeof r!="function",F=Array.isArray,vt=r=>F(r)||typeof r?.[Symbol.iterator]=="function",B=`[ +\f\r]`,x=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,st=/-->/g,it=/>/g,g=RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`,"g"),rt=/'/g,ot=/"/g,lt=/^(?:script|style|textarea|title)$/i,Q=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),Ut=Q(1),Ht=Q(2),Ot=Q(3),y=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),nt=new WeakMap,m=A.createTreeWalker(A,129);function ct(r,t){if(!F(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return et!==void 0?et.createHTML(t):t}var St=(r,t)=>{let e=r.length-1,s=[],i,o=t===2?"":t===3?"":"",n=x;for(let p=0;p"?(n=i??x,a=-1):d[1]===void 0?a=-2:(a=n.lastIndex-d[2].length,l=d[1],n=d[3]===void 0?g:d[3]==='"'?ot:rt):n===ot||n===rt?n=g:n===st||n===it?n=x:(n=g,i=void 0);let f=n===g&&r[p+1].startsWith("/>")?" ":"";o+=n===x?h+yt:a>=0?(s.push(l),h.slice(0,a)+ht+h.slice(a)+_+f):h+_+(a===-2?p:f)}return[ct(r,o+(r[e]||"")+(t===2?"":t===3?"":"")),s]},U=class r{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let o=0,n=0,p=t.length-1,h=this.parts,[l,d]=St(t,e);if(this.el=r.createElement(l,s),m.currentNode=this.el.content,e===2||e===3){let a=this.el.content.firstChild;a.replaceWith(...a.childNodes)}for(;(i=m.nextNode())!==null&&h.length0){i.textContent=j?j.emptyScript:"";for(let f=0;f2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=c}_$AI(t,e=this,s,i){let o=this.strings,n=!1;if(o===void 0)t=v(this,t,e,0),n=!P(t)||t!==this._$AH&&t!==y,n&&(this._$AH=t);else{let p=t,h,l;for(t=o[0],h=0;h{let s=e?.renderBefore??t,i=s._$litPart$;if(i===void 0){let o=e?.renderBefore??null;s._$litPart$=i=new H(t.insertBefore(C(),o),o,void 0,e??{})}return i._$AI(r),i};var b=class extends ${constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=dt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return y}};b._$litElement$=!0,b.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:b});var Et=globalThis.litElementPolyfillSupport;Et?.({LitElement:b});(globalThis.litElementVersions??=[]).push("4.1.0");var qt=z` .legacy-button { align-items: center; @@ -91,4 +91,3 @@ lit-html/is-server.js: * SPDX-License-Identifier: BSD-3-Clause *) */ -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vbm9kZV9tb2R1bGVzL0BsaXQvcmVhY3RpdmUtZWxlbWVudC9zcmMvY3NzLXRhZy50cyIsICIuLi8uLi9ub2RlX21vZHVsZXMvQGxpdC9yZWFjdGl2ZS1lbGVtZW50L3NyYy9yZWFjdGl2ZS1lbGVtZW50LnRzIiwgIi4uLy4uL25vZGVfbW9kdWxlcy9saXQtaHRtbC9zcmMvbGl0LWh0bWwudHMiLCAiLi4vLi4vbm9kZV9tb2R1bGVzL2xpdC1lbGVtZW50L3NyYy9saXQtZWxlbWVudC50cyIsICIuLi8uLi9qcy9pcHl3aWRnZXRzX3N0eWxlcy50cyJdLAogICJzb3VyY2VzQ29udGVudCI6IFsiLyoqXG4gKiBAbGljZW5zZVxuICogQ29weXJpZ2h0IDIwMTkgR29vZ2xlIExMQ1xuICogU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IEJTRC0zLUNsYXVzZVxuICovXG5cbmNvbnN0IE5PREVfTU9ERSA9IGZhbHNlO1xuXG4vLyBBbGxvd3MgbWluaWZpZXJzIHRvIHJlbmFtZSByZWZlcmVuY2VzIHRvIGdsb2JhbFRoaXNcbmNvbnN0IGdsb2JhbCA9IGdsb2JhbFRoaXM7XG5cbi8qKlxuICogV2hldGhlciB0aGUgY3VycmVudCBicm93c2VyIHN1cHBvcnRzIGBhZG9wdGVkU3R5bGVTaGVldHNgLlxuICovXG5leHBvcnQgY29uc3Qgc3VwcG9ydHNBZG9wdGluZ1N0eWxlU2hlZXRzOiBib29sZWFuID1cbiAgZ2xvYmFsLlNoYWRvd1Jvb3QgJiZcbiAgKGdsb2JhbC5TaGFkeUNTUyA9PT0gdW5kZWZpbmVkIHx8IGdsb2JhbC5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ICAvXig/OnRleHRhcmVhfHRlbXBsYXRlKSQvaSEudGVzdCh0YWcpICYmXG4gICAgICAgICAgICAobm9kZSBhcyBFbGVtZW50KS5pbm5lckhUTUwuaW5jbHVkZXMobWFya2VyKVxuICAgICAgICAgICkge1xuICAgICAgICAgICAgY29uc3QgbSA9XG4gICAgICAgICAgICAgIGBFeHByZXNzaW9ucyBhcmUgbm90IHN1cHBvcnRlZCBpbnNpZGUgXFxgJHt0YWd9XFxgIGAgK1xuICAgICAgICAgICAgICBgZWxlbWVudHMuIFNlZSBodHRwczovL2xpdC5kZXYvbXNnL2V4cHJlc3Npb24taW4tJHt0YWd9IGZvciBtb3JlIGAgK1xuICAgICAgICAgICAgICBgaW5mb3JtYXRpb24uYDtcbiAgICAgICAgICAgIGlmICh0YWcgPT09ICd0ZW1wbGF0ZScpIHtcbiAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKG0pO1xuICAgICAgICAgICAgfSBlbHNlIGlzc3VlV2FybmluZygnJywgbSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIC8vIFRPRE8gKGp1c3RpbmZhZ25hbmkpOiBmb3IgYXR0ZW1wdGVkIGR5bmFtaWMgdGFnIG5hbWVzLCB3ZSBkb24ndFxuICAgICAgICAvLyBpbmNyZW1lbnQgdGhlIGJpbmRpbmdJbmRleCwgYW5kIGl0J2xsIGJlIG9mZiBieSAxIGluIHRoZSBlbGVtZW50XG4gICAgICAgIC8vIGFuZCBvZmYgYnkgdHdvIGFmdGVyIGl0LlxuICAgICAgICBpZiAoKG5vZGUgYXMgRWxlbWVudCkuaGFzQXR0cmlidXRlcygpKSB7XG4gICAgICAgICAgZm9yIChjb25zdCBuYW1lIG9mIChub2RlIGFzIEVsZW1lbnQpLmdldEF0dHJpYnV0ZU5hbWVzKCkpIHtcbiAgICAgICAgICAgIGlmIChuYW1lLmVuZHNXaXRoKGJvdW5kQXR0cmlidXRlU3VmZml4KSkge1xuICAgICAgICAgICAgICBjb25zdCByZWFsTmFtZSA9IGF0dHJOYW1lc1thdHRyTmFtZUluZGV4KytdO1xuICAgICAgICAgICAgICBjb25zdCB2YWx1ZSA9IChub2RlIGFzIEVsZW1lbnQpLmdldEF0dHJpYnV0ZShuYW1lKSE7XG4gICAgICAgICAgICAgIGNvbnN0IHN0YXRpY3MgPSB2YWx1ZS5zcGxpdChtYXJrZXIpO1xuICAgICAgICAgICAgICBjb25zdCBtID0gLyhbLj9AXSk/KC4qKS8uZXhlYyhyZWFsTmFtZSkhO1xuICAgICAgICAgICAgICBwYXJ0cy5wdXNoKHtcbiAgICAgICAgICAgICAgICB0eXBlOiBBVFRSSUJVVEVfUEFSVCxcbiAgICAgICAgICAgICAgICBpbmRleDogbm9kZUluZGV4LFxuICAgICAgICAgICAgICAgIG5hbWU6IG1bMl0sXG4gICAgICAgICAgICAgICAgc3RyaW5nczogc3RhdGljcyxcbiAgICAgICAgICAgICAgICBjdG9yOlxuICAgICAgICAgICAgICAgICAgbVsxXSA9PT0gJy4nXG4gICAgICAgICAgICAgICAgICAgID8gUHJvcGVydHlQYXJ0XG4gICAgICAgICAgICAgICAgICAgIDogbVsxXSA9PT0gJz8nXG4gICAgICAgICAgICAgICAgICAgICAgPyBCb29sZWFuQXR0cmlidXRlUGFydFxuICAgICAgICAgICAgICAgICAgICAgIDogbVsxXSA9PT0gJ0AnXG4gICAgICAgICAgICAgICAgICAgICAgICA/IEV2ZW50UGFydFxuICAgICAgICAgICAgICAgICAgICAgICAgOiBBdHRyaWJ1dGVQYXJ0LFxuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgKG5vZGUgYXMgRWxlbWVudCkucmVtb3ZlQXR0cmlidXRlKG5hbWUpO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChuYW1lLnN0YXJ0c1dpdGgobWFya2VyKSkge1xuICAgICAgICAgICAgICBwYXJ0cy5wdXNoKHtcbiAgICAgICAgICAgICAgICB0eXBlOiBFTEVNRU5UX1BBUlQsXG4gICAgIC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QpIHtcbiAgICAgIHRoaXMuX2NvbW1pdFZhbHVlKHZhbHVlKTtcbiAgICB9XG4gIH1cblxuICAvKiogQGludGVybmFsICovXG4gIF9jb21taXRWYWx1ZSh2YWx1ZTogdW5rbm93bikge1xuICAgIGlmICh2YWx1ZSA9PT0gbm90aGluZykge1xuICAgICAgKHdyYXAodGhpcy5lbGVtZW50KSBhcyBFbGVtZW50KS5yZW1vdmVBdHRyaWJ1dGUodGhpcy5uYW1lKTtcbiAgICB9IGVsc2Uge1xuICAgICAgaWYgKEVOQUJMRV9FWFRSQV9TRUNVUklUWV9IT09LUykge1xuICAgICAgICBpZiAodGhpcy5fc2FuaXRpemVyID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICB0aGlzLl9zYW5pdGl6ZXIgPSBzYW5pdGl6ZXJGYWN0b3J5SW50ZXJuYWwoXG4gICAgICAgICAgICB0aGlzLmVsZW1lbnQsXG4gICAgICAgICAgICB0aGlzLm5hbWUsXG4gICAgICAgICAgICAnYXR0cmlidXRlJyxcbiAgICAgICAgICApO1xuICAgICAgICB9XG4gICAgICAgIHZhbHVlID0gdGhpcy5fc2FuaXRpemVyKHZhbHVlID8/ICcnKTtcbiAgICAgIH1cbiAgICAgIGRlYnVnTG9nRXZlbnQgJiZcbiAgICAgICAgZGVidWdMb2dFdmVudCh7XG4gICAgICAgICAga2luZDogJ2NvbW1pdCBhdHRyaWJ1dGUnLFxuICAgICAgICAgIGVsZW1lbnQ6IHRoaXMuZWxlbWVudCxcbiAgICAgICAgICBuYW1lOiB0aGlzLm5hbWUsXG4gICAgICAgICAgdmFsdWUsXG4gICAgICAgICAgb3B0aW9uczogdGhpcy5vcHRpb25zLFxuICAgICAgICB9KTtcbiAgICAgICh3cmFwKHRoaXMuZWxlbWVudCkgYXMgRWxlbWVudCkuc2V0QXR0cmlidXRlKFxuICAgICAgICB0aGlzLm5hbWUsXG4gICAgICAgICh2YWx1ZSA/PyAnJykgYXMgc3RyaW5nLFxuICAgICAgKTtc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/static/layer_manager.css b/geemap/static/layer_manager.css index 202059d823..04ef49523b 100644 --- a/geemap/static/layer_manager.css +++ b/geemap/static/layer_manager.css @@ -1,2 +1 @@ @import"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined"; -/*# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFtdLAogICJzb3VyY2VzQ29udGVudCI6IFtdLAogICJtYXBwaW5ncyI6ICIiLAogICJuYW1lcyI6IFtdCn0K */ diff --git a/geemap/static/layer_manager.js b/geemap/static/layer_manager.js index f6c41ce8f9..a8f4001eba 100644 --- a/geemap/static/layer_manager.js +++ b/geemap/static/layer_manager.js @@ -1,5 +1,5 @@ -var At=Object.defineProperty;var vt=Object.getOwnPropertyDescriptor;var st=(r,t,e,s)=>{for(var i=s>1?void 0:s?vt(t,e):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(i=(s?n(t,e,i):n(i))||i);return s&&i&&At(t,e,i),i};var T=globalThis,k=T.ShadowRoot&&(T.ShadyCSS===void 0||T.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,V=Symbol(),it=new WeakMap,x=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==V)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(k&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=it.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&it.set(e,t))}return t}toString(){return this.cssText}},rt=r=>new x(typeof r=="string"?r:r+"",void 0,V),w=(r,...t)=>{let e=r.length===1?r[0]:t.reduce((s,i,o)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[o+1],r[0]);return new x(e,r,V)},B=(r,t)=>{if(k)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=T.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s)}},j=k?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return rt(e)})(r):r;var{is:bt,defineProperty:St,getOwnPropertyDescriptor:Et,getOwnPropertyNames:xt,getOwnPropertySymbols:wt,getPrototypeOf:Ct}=Object,L=globalThis,ot=L.trustedTypes,Pt=ot?ot.emptyScript:"",Mt=L.reactiveElementPolyfillSupport,C=(r,t)=>r,P={toAttribute(r,t){switch(t){case Boolean:r=r?Pt:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},z=(r,t)=>!bt(r,t),nt={attribute:!0,type:String,converter:P,reflect:!1,hasChanged:z};Symbol.metadata??=Symbol("metadata"),L.litPropertyMetadata??=new WeakMap;var m=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=nt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&St(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:o}=Et(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i?.call(this)},set(n){let h=i?.call(this);o.call(this,n),this.requestUpdate(t,h,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??nt}static _$Ei(){if(this.hasOwnProperty(C("elementProperties")))return;let t=Ct(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(C("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(C("properties"))){let e=this.properties,s=[...xt(e),...wt(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(j(i))}else t!==void 0&&e.push(j(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return B(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let o=(s.converter?.toAttribute!==void 0?s.converter:P).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let o=s.getPropertyOptions(i),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:P;this._$Em=i,this[i]=n.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??z)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,o]of this._$Ep)this[i]=o;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,o]of s)o.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],o)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};m.elementStyles=[],m.shadowRootOptions={mode:"open"},m[C("elementProperties")]=new Map,m[C("finalized")]=new Map,Mt?.({ReactiveElement:m}),(L.reactiveElementVersions??=[]).push("2.0.4");var X=globalThis,I=X.trustedTypes,at=I?I.createPolicy("lit-html",{createHTML:r=>r}):void 0,ut="$lit$",g=`lit$${Math.random().toFixed(9).slice(2)}$`,mt="?"+g,Ut=`<${mt}>`,A=document,U=()=>A.createComment(""),N=r=>r===null||typeof r!="object"&&typeof r!="function",Y=Array.isArray,Nt=r=>Y(r)||typeof r?.[Symbol.iterator]=="function",W=`[ -\f\r]`,M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,lt=/-->/g,ht=/>/g,$=RegExp(`>|${W}(?:([^\\s"'>=/]+)(${W}*=${W}*(?:[^ +var At=Object.defineProperty;var vt=Object.getOwnPropertyDescriptor;var st=(r,t,e,s)=>{for(var i=s>1?void 0:s?vt(t,e):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(i=(s?n(t,e,i):n(i))||i);return s&&i&&At(t,e,i),i};var T=globalThis,k=T.ShadowRoot&&(T.ShadyCSS===void 0||T.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,V=Symbol(),it=new WeakMap,x=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==V)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(k&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=it.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&it.set(e,t))}return t}toString(){return this.cssText}},rt=r=>new x(typeof r=="string"?r:r+"",void 0,V),w=(r,...t)=>{let e=r.length===1?r[0]:t.reduce((s,i,o)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[o+1],r[0]);return new x(e,r,V)},B=(r,t)=>{if(k)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=T.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s)}},j=k?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return rt(e)})(r):r;var{is:bt,defineProperty:St,getOwnPropertyDescriptor:Et,getOwnPropertyNames:xt,getOwnPropertySymbols:wt,getPrototypeOf:Ct}=Object,L=globalThis,ot=L.trustedTypes,Pt=ot?ot.emptyScript:"",Mt=L.reactiveElementPolyfillSupport,C=(r,t)=>r,P={toAttribute(r,t){switch(t){case Boolean:r=r?Pt:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},z=(r,t)=>!bt(r,t),nt={attribute:!0,type:String,converter:P,reflect:!1,hasChanged:z};Symbol.metadata??=Symbol("metadata"),L.litPropertyMetadata??=new WeakMap;var m=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=nt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&St(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:o}=Et(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i?.call(this)},set(n){let h=i?.call(this);o.call(this,n),this.requestUpdate(t,h,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??nt}static _$Ei(){if(this.hasOwnProperty(C("elementProperties")))return;let t=Ct(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(C("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(C("properties"))){let e=this.properties,s=[...xt(e),...wt(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(j(i))}else t!==void 0&&e.push(j(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return B(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let o=(s.converter?.toAttribute!==void 0?s.converter:P).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let o=s.getPropertyOptions(i),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:P;this._$Em=i,this[i]=n.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??z)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,o]of this._$Ep)this[i]=o;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,o]of s)o.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],o)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};m.elementStyles=[],m.shadowRootOptions={mode:"open"},m[C("elementProperties")]=new Map,m[C("finalized")]=new Map,Mt?.({ReactiveElement:m}),(L.reactiveElementVersions??=[]).push("2.0.4");var X=globalThis,I=X.trustedTypes,at=I?I.createPolicy("lit-html",{createHTML:r=>r}):void 0,ut="$lit$",g=`lit$${Math.random().toFixed(9).slice(2)}$`,mt="?"+g,Ut=`<${mt}>`,A=document,U=()=>A.createComment(""),N=r=>r===null||typeof r!="object"&&typeof r!="function",Y=Array.isArray,Nt=r=>Y(r)||typeof r?.[Symbol.iterator]=="function",W=`[ +\f\r]`,M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,lt=/-->/g,ht=/>/g,$=RegExp(`>|${W}(?:([^\\s"'>=/]+)(${W}*=${W}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`,"g"),ct=/'/g,dt=/"/g,ft=/^(?:script|style|textarea|title)$/i,G=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),gt=G(1),Bt=G(2),Wt=G(3),v=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),pt=new WeakMap,_=A.createTreeWalker(A,129);function yt(r,t){if(!Y(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return at!==void 0?at.createHTML(t):t}var Ot=(r,t)=>{let e=r.length-1,s=[],i,o=t===2?"":t===3?"":"",n=M;for(let h=0;h"?(n=i??M,l=-1):p[1]===void 0?l=-2:(l=n.lastIndex-p[2].length,c=p[1],n=p[3]===void 0?$:p[3]==='"'?dt:ct):n===dt||n===ct?n=$:n===lt||n===ht?n=M:(n=$,i=void 0);let f=n===$&&r[h+1].startsWith("/>")?" ":"";o+=n===M?a+Ut:l>=0?(s.push(c),a.slice(0,l)+ut+a.slice(l)+g+f):a+g+(l===-2?h:f)}return[yt(r,o+(r[e]||"")+(t===2?"":t===3?"":"")),s]},O=class r{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let o=0,n=0,h=t.length-1,a=this.parts,[c,p]=Ot(t,e);if(this.el=r.createElement(c,s),_.currentNode=this.el.content,e===2||e===3){let l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(i=_.nextNode())!==null&&a.length0){i.textContent=I?I.emptyScript:"";for(let f=0;f2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=d}_$AI(t,e=this,s,i){let o=this.strings,n=!1;if(o===void 0)t=b(this,t,e,0),n=!N(t)||t!==this._$AH&&t!==v,n&&(this._$AH=t);else{let h=t,a,c;for(t=o[0],a=0;a{let s=e?.renderBefore??t,i=s._$litPart$;if(i===void 0){let o=e?.renderBefore??null;s._$litPart$=i=new R(t.insertBefore(U(),o),o,void 0,e??{})}return i._$AI(r),i};var y=class extends m{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=$t(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return v}};y._$litElement$=!0,y.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:y});var Ht=globalThis.litElementPolyfillSupport;Ht?.({LitElement:y});(globalThis.litElementVersions??=[]).push("4.1.0");var Tt={attribute:!0,type:String,converter:P,reflect:!1,hasChanged:z},kt=(r=Tt,t,e)=>{let{kind:s,metadata:i}=e,o=globalThis.litPropertyMetadata.get(i);if(o===void 0&&globalThis.litPropertyMetadata.set(i,o=new Map),o.set(e.name,r),s==="accessor"){let{name:n}=e;return{set(h){let a=t.get.call(this);t.set.call(this,h),this.requestUpdate(n,a,r)},init(h){return h!==void 0&&this.P(n,void 0,r),h}}}if(s==="setter"){let{name:n}=e;return function(h){let a=this[n];t.call(this,h),this.requestUpdate(n,a,r)}}throw Error("Unsupported decorator location: "+s)};function tt(r){return(t,e)=>typeof e=="object"?kt(r,t,e):((s,i,o)=>{let n=i.hasOwnProperty(o);return i.constructor.createProperty(o,n?{...s,wrapped:!0}:s),n?Object.getOwnPropertyDescriptor(i,o):void 0})(r,t,e)}var _t=w` .legacy-button { align-items: center; @@ -189,4 +189,3 @@ lit-html/is-server.js: * SPDX-License-Identifier: BSD-3-Clause *) */ -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vbm9kZV9tb2R1bGVzL0BsaXQvcmVhY3RpdmUtZWxlbWVudC9zcmMvY3NzLXRhZy50cyIsICIuLi8uLi9ub2RlX21vZHVsZXMvQGxpdC9yZWFjdGl2ZS1lbGVtZW50L3NyYy9yZWFjdGl2ZS1lbGVtZW50LnRzIiwgIi4uLy4uL25vZGVfbW9kdWxlcy9saXQtaHRtbC9zcmMvbGl0LWh0bWwudHMiLCAiLi4vLi4vbm9kZV9tb2R1bGVzL2xpdC1lbGVtZW50L3NyYy9saXQtZWxlbWVudC50cyIsICIuLi8uLi9ub2RlX21vZHVsZXMvQGxpdC9yZWFjdGl2ZS1lbGVtZW50L3NyYy9kZWNvcmF0b3JzL3Byb3BlcnR5LnRzIiwgIi4uLy4uL2pzL2lweXdpZGdldHNfc3R5bGVzLnRzIiwgIi4uLy4uL2pzL3V0aWxzLnRzIiwgIi4uLy4uL2pzL2xheWVyX21hbmFnZXIudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbIi8qKlxuICogQGxpY2Vuc2VcbiAqIENvcHlyaWdodCAyMDE5IEdvb2dsZSBMTENcbiAqIFNQRFgtTGljZW5zZS1JZGVudGlmaWVyOiBCU0QtMy1DbGF1c2VcbiAqL1xuXG5jb25zdCBOT0RFX01PREUgPSBmYWxzZTtcblxuLy8gQWxsb3dzIG1pbmlmaWVycyB0byByZW5hbWUgcmVmZXJlbmNl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mRleCsrXTtcbiAgICAgICAgICAgICAgY29uc3QgdmFsdWUgPSAobm9kZSBhcyBFbGVtZW50KS5nZXRBdHRyaWJ1dGUobmFtZSkhO1xuICAgICAgICAgICAgICBjb25zdCBzdGF0aWNzID0gdmFsdWUuc3BsaXQobWFya2VyKTtcbiAgICAgICAgICAgICAgY29uc3QgbSA9IC8oWy4/QF0pPyguKikvLmV4ZWMocmVhbE5hbWUpITtcbiAgICAgICAgICAgICAgcGFydHMucHVzaCh7XG4gICAgICAgICAgICAgICAgdHlwZTogQVRUUklCVVRFX1BBUlQsXG4gICAgICAgICAgICAgICAgaW5kZXg6IG5vZGVJbmRleCxcbiAgICAgICAgICAgICAgICBuYW1lOiBtWzJdLFxuICAgICAgICAgICAgICAgIHN0cmluZ3M6IHN0YXRpY3MsXG4gICAgICAgICAgICAgICAgY3RvcjpcbiAgICAgICAgICAgICAgICAgIG1bMV0gPT09ICcuJ1xuICAgICAgICAgICAgICAgICAgICA/IFByb3BlcnR5UGFydFxuICAgICAgICAgICAgICAgICAgICA6IG1bMV0gPT09ICc/J1xuICAgICAgICAgICAgICAgICAgICAgID8gQm9vbGVhbkF0dHJpYnV0ZVBhcnRcbiAgICAgICAgICAgICAgICAgICAgICA6IG1bMV0gPT09ICdAJ1xuICAgICAgICAgICAgICAgICAgICAgICAgPyBFdmVudFBhcnRcbiAgICAgICAgICAgICAgICAgICAgICAgIDogQXR0cmlidXRlUGFydCxcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgIChub2RlIGFzIEVsZW1lbnQpLnJlbW92ZUF0dHJpYnV0ZShuYW1lKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobmFtZS5zdGFydHNXaXRoKG1hcmtlcikpIHtcbiAgICAgICAgICAgICAgcGFydHMucHVzaCh7XG4gICAgICAgICAgICAgICAgdHlwZTogRUxFTUVOVF9QQVJULFxuICAgICAgICAgICAgICAgIGluZGV4OiBub2RlSW5kZXgsXG4gICAgICAgICAgICAgIH0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HtcbiAgICAgICAgICBsZXQgbWVzc2FnZSA9ICdGb3JiaWRkZW4nO1xuICAgICAgICAgIGlmIChERVZfTU9ERSkge1xuICAgICAgICAgICAgaWYgKHBhcmVudE5vZGVOYW1lID09PSAnU1RZTEUnKSB7XG4gICAgICAgICAgICAgIG1lc3NhZ2UgPVxuICAgICAgICAgICAgICAgIGBMaXQgZG9lcyBub3Qgc3VwcG9ydCBiaW5kaW5nIGluc2lkZSBzdHlsZSBub2Rlcy4gYCArXG4gICAgICAgICAgICAgICAgYFRoaXMgaXMgYSBzZWN1cml0eSByaXNrLCBhcyBzdHlsZSBpbmplY3Rpb24gYXR0YWNrcyBjYW4gYCArXG4gICAgICAgICAgICAgICAgYGV4ZmlsdHJhdGUgZGF0YSBhbmQgc3Bvb2YgVUlzLiBgICtcbiAgICAgICAgICAgICAgICBgQ29uc2lkZXIgaW5zdGVhZCB1c2luZyBjc3NcXGAuLi5cXGAgbGl0ZXJhbHMgYCArXG4gICAgICAgICAgICAgICAgYHRvIGNvbXBvc2Ugc3R5bGVzLCBhbmQgZG8gZHluYW1pYyBzdHlsaW5nIHdpdGggYCArXG4gICAgICAgICAgICAgICAgYGNzcyBjdXN0b20gcHJvcGVydGllcywgOjpwYXJ0cywgPHNsb3Q+cywgYCArXG4gICAgICAgICAgICAgICAgYGFuZCBieSBtdXRhdGluZyB0aGUgRE9NIHJhdGhlciB0aGFuIHN0eWxlc2hlZXRzLmA7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBtZXNzYWdlID1cbiAgICAgICAgICAgICAgICBgTGl0IGRvZXMgbm90IHN1cHBvcnQgYmluZGluZyBpbnNpZGUgc2NyaXB0IG5vZGVzLiBgICtcbiAgICAgICAgICAgICAgICBgVGhpcyBpcyBhIHNlY3VyaXR5IHJpc2ssIGFzIGl0IGNvdWxkIGFsbG93IGFyYml0cmFyeSBgICtcbiAgICAgICAgICAgICAgICBgY29kZSBleGVjdXRpb24uYDtcbiAgICAgICAg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ICAgIH1cbiAgICB9XG5cbiAgICBAcHJvcGVydHkoKVxuICAgIHZpc2libGU6IGJvb2xlYW4gPSBmYWxzZTtcblxuICAgIHJlbmRlcigpIHtcbiAgICAgICAgcmV0dXJuIGh0bWxgXG4gICAgICAgICAgICA8ZGl2IGNsYXNzPVwiY29udGFpbmVyXCI+XG4gICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInJvd1wiPlxuICAgICAgICAgICAgICAgICAgICA8aW5wdXRcbiAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU9XCJjaGVja2JveFwiXG4gICAgICAgICAgICAgICAgICAgICAgICBjbGFzcz1cInZpc2liaWxpdHktY2hlY2tib3hcIlxuICAgICAgICAgICAgICAgICAgICAgICAgLmNoZWNrZWQ9XCIke3RoaXMudmlzaWJsZX1cIlxuICAgICAgICAgICAgICAgICAgICAgICAgQGNoYW5nZT1cIiR7dGhpcy5vbkxheWVyVmlzaWJpbGl0eUNoYW5nZWR9XCJcbiAgICAgICAgICAgICAgICAgICAgLz5cbiAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJsZWdhY3ktdGV4dCBhbGwtbGF5ZXJzLXRleHRcIj5BbGwgbGF5ZXJzIG9uL29mZjwvc3Bhbj5cbiAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgICA8c2xvdD48L3Nsb3Q+XG4gICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgYDtcbiAgICB9XG5cbiAgICB1cGRhdGVkKGNoYW5nZWRQcm9wZXJ0aWVzOiBhbnkpIHtcbiAgICAgICAgLy8gVXBkYXRlIHRoZSBtb2RlbCBwcm9wZXJ0aWVzIHNvIHRoZXkncmUgcmVmbGVjdGVkIGluIFB5dGhvbi5cbiAgICAgICAgZm9yIChjb25zdCBbcHJvcGVydHksIF9dIG9mIGNoYW5nZWRQcm9wZXJ0aWVzKSB7XG4gICAgICAgICAgICB0aGlzLl9tb2RlbD8uc2V0KHByb3BlcnR5LCB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kYXRlQ2hpbGRyZW4iLCAibGF5ZXJfbWFuYWdlcl9kZWZhdWx0Il0KfQo= diff --git a/geemap/static/layer_manager_row.css b/geemap/static/layer_manager_row.css index 202059d823..04ef49523b 100644 --- a/geemap/static/layer_manager_row.css +++ b/geemap/static/layer_manager_row.css @@ -1,2 +1 @@ @import"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined"; -/*# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFtdLAogICJzb3VyY2VzQ29udGVudCI6IFtdLAogICJtYXBwaW5ncyI6ICIiLAogICJuYW1lcyI6IFtdCn0K */ diff --git a/geemap/static/layer_manager_row.js b/geemap/static/layer_manager_row.js index b12f1ad61f..010a3b9d5d 100644 --- a/geemap/static/layer_manager_row.js +++ b/geemap/static/layer_manager_row.js @@ -1,5 +1,5 @@ -var _t=Object.defineProperty;var bt=Object.getOwnPropertyDescriptor;var w=(o,t,e,s)=>{for(var i=s>1?void 0:s?bt(t,e):t,n=o.length-1,r;n>=0;n--)(r=o[n])&&(i=(s?r(t,e,i):r(i))||i);return s&&i&&_t(t,e,i),i};var L=globalThis,z=L.ShadowRoot&&(L.ShadyCSS===void 0||L.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,W=Symbol(),it=new WeakMap,k=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==W)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(z&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=it.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&it.set(e,t))}return t}toString(){return this.cssText}},ot=o=>new k(typeof o=="string"?o:o+"",void 0,W),v=(o,...t)=>{let e=o.length===1?o[0]:t.reduce((s,i,n)=>s+(r=>{if(r._$cssResult$===!0)return r.cssText;if(typeof r=="number")return r;throw Error("Value passed to 'css' function must be a 'css' function result: "+r+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+o[n+1],o[0]);return new k(e,o,W)},J=(o,t)=>{if(z)o.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=L.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,o.appendChild(s)}},D=z?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return ot(e)})(o):o;var{is:At,defineProperty:xt,getOwnPropertyDescriptor:St,getOwnPropertyNames:wt,getOwnPropertySymbols:Et,getPrototypeOf:Ct}=Object,I=globalThis,nt=I.trustedTypes,Pt=nt?nt.emptyScript:"",kt=I.reactiveElementPolyfillSupport,R=(o,t)=>o,U={toAttribute(o,t){switch(t){case Boolean:o=o?Pt:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},V=(o,t)=>!At(o,t),rt={attribute:!0,type:String,converter:U,reflect:!1,hasChanged:V};Symbol.metadata??=Symbol("metadata"),I.litPropertyMetadata??=new WeakMap;var m=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=rt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&xt(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:n}=St(this.prototype,t)??{get(){return this[e]},set(r){this[e]=r}};return{get(){return i?.call(this)},set(r){let h=i?.call(this);n.call(this,r),this.requestUpdate(t,h,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??rt}static _$Ei(){if(this.hasOwnProperty(R("elementProperties")))return;let t=Ct(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(R("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(R("properties"))){let e=this.properties,s=[...wt(e),...Et(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(D(i))}else t!==void 0&&e.push(D(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return J(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let n=(s.converter?.toAttribute!==void 0?s.converter:U).toAttribute(e,s.type);this._$Em=t,n==null?this.removeAttribute(i):this.setAttribute(i,n),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let n=s.getPropertyOptions(i),r=typeof n.converter=="function"?{fromAttribute:n.converter}:n.converter?.fromAttribute!==void 0?n.converter:U;this._$Em=i,this[i]=r.fromAttribute(e,n.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??V)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,n]of this._$Ep)this[i]=n;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,n]of s)n.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],n)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};m.elementStyles=[],m.shadowRootOptions={mode:"open"},m[R("elementProperties")]=new Map,m[R("finalized")]=new Map,kt?.({ReactiveElement:m}),(I.reactiveElementVersions??=[]).push("2.0.4");var G=globalThis,q=G.trustedTypes,at=q?q.createPolicy("lit-html",{createHTML:o=>o}):void 0,ut="$lit$",g=`lit$${Math.random().toFixed(9).slice(2)}$`,mt="?"+g,Rt=`<${mt}>`,A=document,O=()=>A.createComment(""),N=o=>o===null||typeof o!="object"&&typeof o!="function",tt=Array.isArray,Ut=o=>tt(o)||typeof o?.[Symbol.iterator]=="function",K=`[ -\f\r]`,M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,lt=/-->/g,ht=/>/g,_=RegExp(`>|${K}(?:([^\\s"'>=/]+)(${K}*=${K}*(?:[^ +var _t=Object.defineProperty;var bt=Object.getOwnPropertyDescriptor;var w=(o,t,e,s)=>{for(var i=s>1?void 0:s?bt(t,e):t,n=o.length-1,r;n>=0;n--)(r=o[n])&&(i=(s?r(t,e,i):r(i))||i);return s&&i&&_t(t,e,i),i};var L=globalThis,z=L.ShadowRoot&&(L.ShadyCSS===void 0||L.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,W=Symbol(),it=new WeakMap,k=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==W)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(z&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=it.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&it.set(e,t))}return t}toString(){return this.cssText}},ot=o=>new k(typeof o=="string"?o:o+"",void 0,W),v=(o,...t)=>{let e=o.length===1?o[0]:t.reduce((s,i,n)=>s+(r=>{if(r._$cssResult$===!0)return r.cssText;if(typeof r=="number")return r;throw Error("Value passed to 'css' function must be a 'css' function result: "+r+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+o[n+1],o[0]);return new k(e,o,W)},J=(o,t)=>{if(z)o.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=L.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,o.appendChild(s)}},D=z?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return ot(e)})(o):o;var{is:At,defineProperty:xt,getOwnPropertyDescriptor:St,getOwnPropertyNames:wt,getOwnPropertySymbols:Et,getPrototypeOf:Ct}=Object,I=globalThis,nt=I.trustedTypes,Pt=nt?nt.emptyScript:"",kt=I.reactiveElementPolyfillSupport,R=(o,t)=>o,U={toAttribute(o,t){switch(t){case Boolean:o=o?Pt:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},V=(o,t)=>!At(o,t),rt={attribute:!0,type:String,converter:U,reflect:!1,hasChanged:V};Symbol.metadata??=Symbol("metadata"),I.litPropertyMetadata??=new WeakMap;var m=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=rt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&xt(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:n}=St(this.prototype,t)??{get(){return this[e]},set(r){this[e]=r}};return{get(){return i?.call(this)},set(r){let h=i?.call(this);n.call(this,r),this.requestUpdate(t,h,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??rt}static _$Ei(){if(this.hasOwnProperty(R("elementProperties")))return;let t=Ct(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(R("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(R("properties"))){let e=this.properties,s=[...wt(e),...Et(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(D(i))}else t!==void 0&&e.push(D(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return J(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let n=(s.converter?.toAttribute!==void 0?s.converter:U).toAttribute(e,s.type);this._$Em=t,n==null?this.removeAttribute(i):this.setAttribute(i,n),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let n=s.getPropertyOptions(i),r=typeof n.converter=="function"?{fromAttribute:n.converter}:n.converter?.fromAttribute!==void 0?n.converter:U;this._$Em=i,this[i]=r.fromAttribute(e,n.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??V)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,n]of this._$Ep)this[i]=n;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,n]of s)n.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],n)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};m.elementStyles=[],m.shadowRootOptions={mode:"open"},m[R("elementProperties")]=new Map,m[R("finalized")]=new Map,kt?.({ReactiveElement:m}),(I.reactiveElementVersions??=[]).push("2.0.4");var G=globalThis,q=G.trustedTypes,at=q?q.createPolicy("lit-html",{createHTML:o=>o}):void 0,ut="$lit$",g=`lit$${Math.random().toFixed(9).slice(2)}$`,mt="?"+g,Rt=`<${mt}>`,A=document,O=()=>A.createComment(""),N=o=>o===null||typeof o!="object"&&typeof o!="function",tt=Array.isArray,Ut=o=>tt(o)||typeof o?.[Symbol.iterator]=="function",K=`[ +\f\r]`,M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,lt=/-->/g,ht=/>/g,_=RegExp(`>|${K}(?:([^\\s"'>=/]+)(${K}*=${K}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`,"g"),ct=/'/g,dt=/"/g,ft=/^(?:script|style|textarea|title)$/i,et=o=>(t,...e)=>({_$litType$:o,strings:t,values:e}),st=et(1),qt=et(2),Bt=et(3),x=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),pt=new WeakMap,b=A.createTreeWalker(A,129);function gt(o,t){if(!tt(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return at!==void 0?at.createHTML(t):t}var Mt=(o,t)=>{let e=o.length-1,s=[],i,n=t===2?"":t===3?"":"",r=M;for(let h=0;h"?(r=i??M,l=-1):p[1]===void 0?l=-2:(l=r.lastIndex-p[2].length,d=p[1],r=p[3]===void 0?_:p[3]==='"'?dt:ct):r===dt||r===ct?r=_:r===lt||r===ht?r=M:(r=_,i=void 0);let f=r===_&&o[h+1].startsWith("/>")?" ":"";n+=r===M?a+Rt:l>=0?(s.push(d),a.slice(0,l)+ut+a.slice(l)+g+f):a+g+(l===-2?h:f)}return[gt(o,n+(o[e]||"")+(t===2?"":t===3?"":"")),s]},H=class o{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let n=0,r=0,h=t.length-1,a=this.parts,[d,p]=Mt(t,e);if(this.el=o.createElement(d,s),b.currentNode=this.el.content,e===2||e===3){let l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(i=b.nextNode())!==null&&a.length0){i.textContent=q?q.emptyScript:"";for(let f=0;f2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=c}_$AI(t,e=this,s,i){let n=this.strings,r=!1;if(n===void 0)t=E(this,t,e,0),r=!N(t)||t!==this._$AH&&t!==x,r&&(this._$AH=t);else{let h=t,a,d;for(t=n[0],a=0;a{let s=e?.renderBefore??t,i=s._$litPart$;if(i===void 0){let n=e?.renderBefore??null;s._$litPart$=i=new T(t.insertBefore(O(),n),n,void 0,e??{})}return i._$AI(o),i};var y=class extends m{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=yt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return x}};y._$litElement$=!0,y.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:y});var Nt=globalThis.litElementPolyfillSupport;Nt?.({LitElement:y});(globalThis.litElementVersions??=[]).push("4.1.0");var Ht={attribute:!0,type:String,converter:U,reflect:!1,hasChanged:V},Tt=(o=Ht,t,e)=>{let{kind:s,metadata:i}=e,n=globalThis.litPropertyMetadata.get(i);if(n===void 0&&globalThis.litPropertyMetadata.set(i,n=new Map),n.set(e.name,o),s==="accessor"){let{name:r}=e;return{set(h){let a=t.get.call(this);t.set.call(this,h),this.requestUpdate(r,a,o)},init(h){return h!==void 0&&this.P(r,void 0,o),h}}}if(s==="setter"){let{name:r}=e;return function(h){let a=this[r];t.call(this,h),this.requestUpdate(r,a,o)}}throw Error("Unsupported decorator location: "+s)};function S(o){return(t,e)=>typeof e=="object"?Tt(o,t,e):((s,i,n)=>{let r=i.hasOwnProperty(n);return i.constructor.createProperty(n,r?{...s,wrapped:!0}:s),r?Object.getOwnPropertyDescriptor(i,n):void 0})(o,t,e)}var $t=v` .legacy-button { align-items: center; @@ -301,4 +301,3 @@ lit-html/is-server.js: * SPDX-License-Identifier: BSD-3-Clause *) */ -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vbm9kZV9tb2R1bGVzL0BsaXQvcmVhY3RpdmUtZWxlbWVudC9zcmMvY3NzLXRhZy50cyIsICIuLi8uLi9ub2RlX21vZHVsZXMvQGxpdC9yZWFjdGl2ZS1lbGVtZW50L3NyYy9yZWFjdGl2ZS1lbGVtZW50LnRzIiwgIi4uLy4uL25vZGVfbW9kdWxlcy9saXQtaHRtbC9zcmMvbGl0LWh0bWwudHMiLCAiLi4vLi4vbm9kZV9tb2R1bGVzL2xpdC1lbGVtZW50L3NyYy9saXQtZWxlbWVudC50cyIsICIuLi8uLi9ub2RlX21vZHVsZXMvQGxpdC9yZWFjdGl2ZS1lbGVtZW50L3NyYy9kZWNvcmF0b3JzL3Byb3BlcnR5LnRzIiwgIi4uLy4uL2pzL2lweXdpZGdldHNfc3R5bGVzLnRzIiwgIi4uLy4uL2pzL21hdGVyaWFsX3N0eWxlcy50cyIsICIuLi8uLi9qcy9sYXllcl9tYW5hZ2VyX3Jvdy50cyJdLAogICJzb3VyY2VzQ29udGVudCI6IFsiLyoqXG4gKiBAbGljZW5zZVxuICogQ29weXJpZ2h0IDIwMTkgR29vZ2xlIExMQ1xuICogU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IEJTRC0zLUNsYXV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MgdGFnIG5hbWVzLCB3ZSBkb24ndFxuICAgICAgICAvLyBpbmNyZW1lbnQgdGhlIGJpbmRpbmdJbmRleCwgYW5kIGl0J2xsIGJlIG9mZiBieSAxIGluIHRoZSBlbGVtZW50XG4gICAgICAgIC8vIGFuZCBvZmYgYnkgdHdvIGFmdGVyIGl0LlxuICAgICAgICBpZiAoKG5vZGUgYXMgRWxlbWVudCkuaGFzQXR0cmlidXRlcygpKSB7XG4gICAgICAgICAgZm9yIChjb25zdCBuYW1lIG9mIChub2RlIGFzIEVsZW1lbnQpLmdldEF0dHJpYnV0ZU5hbWVzKCkpIHtcbiAgICAgICAgICAgIGlmIChuYW1lLmVuZHNXaXRoKGJvdW5kQXR0cmlidXRlU3VmZml4KSkge1xuICAgICAgICAgICAgICBjb25zdCByZWFsTmFtZSA9IGF0dHJOYW1lc1thdHRyTmFtZUluZGV4KytdO1xuICAgICAgICAgICAgICBjb25zdCB2YWx1ZSA9IChub2RlIGFzIEVsZW1lbnQpLmdldEF0dHJpYnV0ZShuYW1lKSE7XG4gICAgICAgICAgICAgIGNvbnN0IHN0YXRpY3MgPSB2YWx1ZS5zcGxpdChtYXJrZXIpO1xuICAgICAgICAgICAgICBjb25zdCBtID0gLyhbLj9AXSk/KC4qKS8uZXhlYyhyZWFsTmFtZSkhO1xuICAgICAgICAgICAgICBwYXJ0cy5wdXNoKHtcbiAgICAgICAgICAgICAgICB0eXBlOiBBVFRSSUJVVEVfUEFSVCxcbiAgICAgICAgICAgICAgICBpbmRleDogbm9kZUluZGV4LFxuICAgICAgICAgICAgICAgIG5hbWU6IG1bMl0sXG4gICAgICAgICAgICAgICAgc3RyaW5nczogc3RhdGljcyxcbiAgICAgICAgICAgICAgICBjdG9yOlxuICAgICAgICAgICAgICAgICAgbVsxXSA9PT0gJy4nXG4gICAgICAgICAgICAgICAgICAgID8gUHJvcGVydHlQYXJ0XG4gICAgICAgICAgICAgICAgICAgIDogbVsxXSA9PT0gJz8nXG4gICAgICAgICAgICAgICAgICAgICAgPyBCb29sZWFuQXR0cmlidXRlUGFydFxuICAgICAgICAgICAgICAgICAgICAgIDogbVsxXSA9PT0gJ0AnXG4gICAgICAgICAgICAgICAgICAgICAgICA/IEV2ZW50UGFydFxuICAgICAgICAgICAgICAgICAgICAgICAgOiBBdHRyaWJ1dGVQYXJ0LFxuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgKG5vZGUgYXMgRWxlbWVudCkucmVtb3ZlQXR0cmlidXRlKG5hbWUpO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChuYW1lLnN0YXJ0c1dpdGgobWFya2VyKSkge1xuICAgICAgICAgICAgICBwYXJ0cy5wdXNoKHtcbiAgICAgICAgICAgICAgICB0eXBlOiBFTEVNRU5UX1BBUlQsXG4gICAgICAgICAgICAgICAgaW5kZXg6IG5vZGVJbmRleCxcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgIChub2RlIGFzIEVsZW1lbnQpLnJlbW92ZUF0dHJpYnV0ZShuYW1lKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgLy8gVE9ETyAoanVzdGluZmFnbmFuaSk6IGJlbmNobWFyayB0aGUgcmVnZXggYWdhaW5zdCB0ZXN0aW5nIGZvciBlYWNoXG4gICAgICAgIC8vIG9mIHRoZSAzIHJhdyB0ZXh0IGVsZW1lbnQgbmFtZXMuXG4gICAgICAgIGlmIChyYXdUZXh0RWxlbWVudC50ZXN0KChub2RlIGFzIEVsZW1lbnQpLnRhZ05hbWUpKSB7XG4gICAgICAgICAgLy8gRm9yIHJhdyB0ZXh0IGVsZW1lbnRzIHdlIG5lZWQgdG8gc3BsaXQgdGhlIHRleHQgY29udGVudCBvblxuICAgICAgICAgIC8vIG1hcmtlcnMsIGNyZWF0ZSBhIFRleHQgbm9kZSBmb3IgZWFjaCBzZWdtZW50LCBhbmQgY3JlYXRlXG4gICAgICAgICAgLy8gYSBUZW1wbGF0ZVBhc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DogUGFydCB8IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHRlbXBsYXRlUGFydC50eXBlID09PSBDSElMRF9QQVJUKSB7XG4gICAgICAgICAgcGFydCA9IG5ldyBDaGlsZFBhcnQoXG4gICAgICAgICAgICBub2RlIGFzIEhUTUxFbGVtZW50LFxuICAgICAgICAgICAgbm9kZS5uZXh0U2libGluZyxcbiAgICAgICAgICAgIHRoaXMsXG4gICAgICAgICAgICBvcHRpb25zLFxuICAgICAgICAgICk7XG4gICAgICAgIH0gZWxzZSBpZiAodGVtcGxhdGVQYXJ0LnR5cGUgPT09IEFUVFJJQlVURV9QQVJUKSB7XG4gICAgICAgICAgcGFydCA9IG5ldyB0ZW1wbGF0ZVBhcnQuY3RvcihcbiAgICAgICAgICAgIG5vZGUgYXMgSFRNTEVsZW1lbnQsXG4gICAgICAgICAgICB0ZW1wbGF0ZVBhcnQubmFtZSxcbiAgICAgICAgICAgIHRlbXBsYXRlUGFydC5zdHJpbmdzLFxuICAgICAgICAgICAgdGhpcyxcbiAgICAgICAgICAgIG9wdGlvbnMsXG4gICAgICAgICAgKTtcbiAgICAgICAgfSBlbHNlIGlmICh0ZW1wbGF0ZVBhcnQudHlwZSA9PT0gRUxFTUVOVF9QQVJUKSB7XG4gICAgICAgICAgcGFydCA9IG5ldyBFbGVtZW50UGFydChub2RlIGFzIEhUTUxFbGVtZW50LCB0aGlzLCBvcHRpb25zKTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLl8kcGFydHMucHVzaChwYXJ0KTtcbiAgICAgICAgdGVtcGxhdGVQYXJ0ID0gcGFydHNbKytwYXJ0SW5kZXhdO1xuICAgICAgfVxuICAgICAgaWYgKG5vZGVJbmRleCAhPT0gdGVtcGxhdGVQYXJ0Py5pbmRleCkge1xuICAgICAgICBub2RlID0gd2Fsa2VyLm5leHROb2RlKCkhO1xuICAgICAgICBub2RlSW5kZXgrKztcbiAgICAgIH1cbiAgICB9XG4gICAgLy8gV2UgbmVlZCB0byBz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xuICAgICAgICAgICAgICAgIGFsaWduLWl0ZW1zOiBjZW50ZXI7XG4gICAgICAgICAgICAgICAgZGlzcGxheTogZmxleDtcbiAgICAgICAgICAgICAgICBnYXA6IDRweDtcbiAgICAgICAgICAgICAgICBoZWlnaHQ6IDMwcHg7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC5sYXllci1uYW1lIHtcbiAgICAgICAgICAgICAgICBmbGV4LWdyb3c6IDE7XG4gICAgICAgICAgICAgICAgbWF4LXdpZHRoOiAxNTBweDtcbiAgICAgICAgICAgICAgICBvdmVyZmxvdzogaGlkZGVuO1xuICAgICAgICAgICAgICAgIHRleHQtb3ZlcmZsb3c6IGVsbGlwc2lzO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAuc2V0dGluZ3MtZGVsZXRlLWJ1dHRvbiB7XG4gICAgICAgICAgICAgICAgZm9udC1zaXplOiAxNHB4O1xuICAgICAgICAgICAgICAgIGhlaWdodDogMjZweDtcbiAgICAgICAgICAgICAgICB3aWR0aDogMjZweDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLmxheWVyLW9wYWNpdHktc2xpZGVyIHtcbiAgICAgICAgICAgICAgICB3aWR0aDogNzBweDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLmxheWVyLXZpc2liaWxpdHktY2hlY2tib3gge1xuICAgICAgICAgICAgICAgIG1hcmdpbjogMnB4O1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAuc3Bpbm5lciB7XG4gICAgICAgICAgICAgICAgLXdlYmtpdC1hbmltYXRpb246IHNwaW4gMnMgbGluZWFyIGluZmluaXRlO1xuICAgICAgICAgICAgICAgIGFuaW1hdGlvbjogc3BpbiAycyBsaW5lYXIgaW5maW5pdGU7XG4gICAgICAgICAgICAgICAgYm9yZGVyLXJhZGl1czogNTAlO1xuICAgICAgICAgICAgICAgIGJvcmRlcjogNHB4IHNvbGlkIHZhcigtLWpwLXdpZGdldHMtaW5wdXQtYm9yZGVyLWNvbG9yKTtcbiAgICAgICAgICAgICAgICBib3JkZXItdG9wOiA0cHggc29saWQgdmFyKC0tanAtd2lkZ2V0cy1jb2xvcik7XG4gICAgICAgICAgICAgICAgaGVpZ2h0OiAxMnB4O1xuICAgICAgICAgICAgICAgIHdpZHRoOiAxMnB4O1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBALXdlYmtpdC1rZXlmcmFtZXMgc3BpbiB7XG4gICAgICAgICAgICAgICAgMCUgeyAtd2Via2l0LXRyYW5zZm9ybTogcm90YXRlKDBkZWcpOyB9XG4gICAgICAgICAgICAgICAgMTAwJSB7IC13ZWJraXQtdHJhbnNmb3JtOiByb3RhdGUoMzYwZGVnKTsgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBAa2V5ZnJhbWVzIHNwaW4ge1xuICAgICAgICAgICAgICAgIDAlIHsgdHJhbnNmb3JtOiByb3RhdGUoMGRlZyk7IH1cbiAgICAgICAgICAgICAgICAxMDAlIHsgdHJhbnNmb3JtOiByb3RhdGUoMzYwZGVnKTsgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIFxuICAgICAgICAgICAgYnV0dG9uLmxvYWRpbmcgLnNwaW5uZXIsXG4gICAgICAgICAgICBidXR0b24ubG9hZGluZzpob3ZlciAuY2xvc2UtaWNvbixcbiAgICAgICAgICAgIGJ1dHRvbi5kb25lLWxvYWRpbmcgLmNsb3NlLWljb24ge1xuICAgICAgICAgICAgICAgIGRpc3BsYXk6IGJsb2NrO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBidXR0b24ubG9hZGluZyAuY2xvc2UtaWNvbixcbiAgICAgICAgICAgIGJ1dHRvbi5sb2FkaW5nOmhvdmVyIC5zcGlubmVyLFxuICAgICAgICAgICAgYnV0dG9uLmRvbmUtbG9hZGluZyAuc3Bpbm5lciB7XG4gICAgICAgICAgICAgICAgZGlzcGxheTogbm9uZTtcbiAgICAgICAgICAgIH1cblxuICAgICA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BhcyBhbnkpW3dpZGdldEtleV0gPSBtb2RlbC5nZXQobW9kZWxLZXkpO1xuICAgICAgICAgICAgICAgIC8vIExpc3RlbiBmb3IgdXBkYXRlcyB0byB0aGUgbW9kZWwuXG4gICAgICAgICAgICAgICAgbW9kZWwub24oYGNoYW5nZToke21vZGVsS2V5fWAsICgpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgKHRoaXMgYXMgYW55KVt3aWRnZXRLZXldID0gbW9kZWwuZ2V0KG1vZGVsS2V5KTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIEBwcm9wZXJ0eSgpXG4gICAgbmFtZTogc3RyaW5nID0gXCJcIjtcblxuICAgIEBwcm9wZXJ0eSgpXG4gICAgdmlzaWJsZTogYm9vbGVhbiA9IHRydWU7XG5cbiAgICBAcHJvcGVydHkoKVxuICAgIG9wYWNpdHk6IG51bWJlciA9IDA7XG5cbiAgICBAcHJvcGVydHkoKVxuICAgIGlzTG9hZGluZzogYm9vbGVhbiA9IGZhbHNlO1xuXG4gICAgQHByb3BlcnR5KClcbiAgICBpc0NvbmZpcm1EaWFsb2dWaXNpYmxlOiBib29sZWFuID0gZmFsc2U7XG5cbiAgICByZW5kZXIoKTogVGVtcGxhdGVSZXN1bHQge1xuICAgICAgICByZXR1cm4gaHRtbGBcbiAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJyb3dcIj5cbiAgICAgICAgICAgICAgICA8aW5wdXRcbiAgICAgICAgICAgICAgICAgICAgdHlwZT1cImNoZWNrYm94XCJcbiAgICAgICAgICAgICAgICAgICAgY2xhc3M9XCJsYXllci12aXNpYmlsaXR5LWNoZWNrYm94XCJcbiAgICAgICAgICAgICAgICAgICAgLmNoZWNrZWQ9XCIke3RoaXMudmlzaWJsZX1cIlxuICAgICAgICAgICAgICAgICAgICBAY2hhbmdlPVwiJHt0aGlzLm9uTGF5ZXJWaXNpYmlsaXR5Q2hhbmdlZH1cIlxuICAgICAgICAgICAgICAgIC8+XG4gICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJsZWdhY3ktdGV4dCBsYXllci1uYW1lXCI+JHt0aGlzLm5hbWV9PC9zcGFuPlxuICAgICAgICAgICAgICAgIDxpbnB1dFxuICAgICAgICAgICAgICAgICAgICB0eXBlPVwicmFuZ2VcIlxuICAgICAgICAgICAgICAgICAgICBjbGFzcz1cImxlZ2FjeS1zbGlkZXIgbGF5ZXItb3BhY2l0eS1zbGlkZXJcIlxuICAgICAgICAgICAgICAgICAgICBtaW49XCIwXCJcbiAgICAgICAgICAgICAgICAgICAgbWF4PVwiMVwiXG4gICAgICAgICAgICAgICAgICAgIHN0ZXA9XCIwLjAxXCJcbiAgICAgICAgICAgICAgICAgICAgLnZhbHVlPVwiJHt0aGlzLm9wYWNpdHl9XCJcbiAgICAgICAgICAgICAgICAgICAgQGlucHV0PVwiJHt0aGlzLm9uTGF5ZXJPcGFjaXR5Q2hhbmdlZH1cIlxuICAgICAgICAgICAgICAgIC8+XG4gICAgICAgICAgICAgICAgPGJ1dHRvblxuICAgICAgICAgICAgICAgICAgICBjbGFzcz1cImxlZ2FjeS1idXR0b24gc2V0dGluZ3MtZGVsZXRlLWJ1dHRvblwiXG4gICAgICAgICAgICAgICAgICAgIEBjbGljaz1cIiR7dGhpcy5vblNldHRpbmdzQ2xpY2tlZH1cIlxuICAgICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJtYXRlcmlhbC1zeW1ib2xzLW91dGxpbmVkXCI+JiN4ZThiODs8L3NwYW4+XG4gICAgICAgICAgICAgICAgPC9idXR0b24+XG4gICAgICAgICAgICAgICAgPGJ1dHRvblxuICAgICAgICAgICAgICAgICAgICBjbGFzcz1cImxlZ2FjeS1idXR0b24gc2V0dGluZ3MtZGVsZXRlLWJ1dHRvbiAke3RoaXMuaXNMb2FkaW5nID8gJ2xvYWRpbmcnIDogJ2RvbmUtbG9hZGluZyd9XCJcbiAgICAgICAgICAgICAgICAgICAgQGNsaWNrPVwiJHt0aGlzLm9uRGVsZXRlQ2xpY2tlZH1cIlxuICAgICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInNwaW5uZXJcIj48L2Rpdj5cbiAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJjbG9zZS1pY29uIG1hdGVyaWFsLXN5bWJvbHMtb3V0bGluZWRcIj4mI3hlNWNkOzwvc3Bhbj5cbiAgICAgICAgICAgICAgICA8L2J1dHRvbj5cbiAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgJHt0aGlzLnJlbmRlckNvbmZpcm1EaWFsb2coKX1cbiAgICAgICAgYDtcbiAgICB9XG5cbiAgICBwcml2YXRlIHJlbmRlckNvbmZpcm1EaWFsb2coKTogVGVtcGxhdGVSZXN1bHQgfCB2b2lkIHtcbiAgICAgICAgaWYgKCF0aGlzLmlzQ29uZmlybURpYWxvZ1Zpc2libGUpIHtcbiAgICAgICAgICAgIHJldHVybiBub3RoaW5nO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBodG1sYFxuICAgICAgICAgICAgPGRpdiBjbGFzcz1cInJvd1wiPlxuICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwibGVnYWN5LXRleHQgcmVtb3ZlLWxheWVyLXRleHRcIj5SZW1vdmUgbGF5ZXI/PC9zcGFuPlxuICAgICAgICAgICAgICAgICAgICA8YnV0dG9uXG4gICAgICAgICAgICAgICAgICAgICAgICBjbGFzcz1cImxlZ2FjeS1idXR0b24gcHJpbWFyeSBjb25maXJtLWRlbnktYnV0dG9uXCJcbiAgICAgICAgICAgICAgICAgICAgICAgIEBjbGljaz1cIiR7dGhpcy5jb25maXJtRGVsZXRpb259XCJcbiAgICAgICAgICAgICAgICAgICAgPlxuICAgICAgICAgICAgICAgICAgICAgICAgWWVzXG4gICAgICAgICAgICAgICAgICAgIDwvYnV0dG9uPlxuICAgICAgICAgICAgICAgICAgICA8YnV0dG9uXG4gICAgICAgICAgICAgICAgICAgICAgICBjbGFzcz1cImxlZ2FjeS1idXR0b24gcHJpbWFyeSBjb25maXJtLWRlbnktYnV0dG9uXCJcbiAgICAgICAgICAgICAgICAgICAgICAgIEBjbGljaz1cIiR7dGhpcy5jYW5jZWxEZWxldGlvbn1cIlxuICAgICAgICAgICAgICAgICAgICA+XG4gICAgICAgICAgICAgICAgICAgICAgICBOb1xuICAgICAgICAgICAgICAgICAgICA8L2J1dHRvbj5cbiAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICBgO1xuICAgIH1cblxuICAgIHVwZGF0ZWQoY2hhbmdlZFByb3BlcnRpZXM6IGFueSkge1xuICAgICAgICAvLyBVcGRhdGUgdGhlIG1vZGVsIHByb3BlcnRpZXMgc28gdGhleSdyZSByZWZsZWN0ZWQgaW4gUHl0aG9uLlxuICAgICAgICBmb3IgKGNvbnN0IFtwcm9wZXJ0eSwgX10gb2YgY2hhbmdlZFByb3BlcnRpZXMpIHtcbiAgICAgICAgICAgIHRoaXMuX21vZGVsPy5zZXQocHJvcGVydHksIHRoaXNbcHJvcGVydHkgYXMga2V5b2YgTGF5ZXJNYW5hZ2VyUm93XSk7XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5fbW9kZWw/LnNhdmVfY2hhbmdlcygpO1xuICAgIH1cblxuICAgIHByaXZhdGUgb25MYXllclZpc2liaWxpdHlDaGFuZ2VkKGV2ZW50OiBFdmVudCkge1xuICAgICAgICBjb25zdCB0YXJnZXQgPSBldmVudC50YXJnZXQgYXMgSFRNTElucHV0RWxlbWVudDtcbiAgICAgICAgdGhpcy52aXNpYmxlID0gdGFyZ2V0LmNoZWNrZWQ7XG4gICAgfVxuXG4gICAgcHJpdmF0ZSBvbkxheWVyT3BhY2l0eUNoYW5nZWQoZXZlbnQ6IEV2ZW50KSB7XG4gICAgICAgIGNvbnN0IHRhcmdldCA9IGV2ZW50LnRhcmdldCBhcy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wgImNoYW5nZWRQcm9wZXJ0aWVzIiwgInByb3BlcnR5IiwgIl8iLCAiZXZlbnQiLCAidGFyZ2V0IiwgIl9fZGVjb3JhdGVDbGFzcyIsICJuIiwgIkxheWVyTWFuYWdlclJvdyIsICJyZW5kZXIiLCAiZWwiLCAicm93IiwgImxheWVyX21hbmFnZXJfcm93X2RlZmF1bHQiXQp9Cg== diff --git a/geemap/static/material_styles.js b/geemap/static/material_styles.js index bedb21f150..2aff906ab4 100644 --- a/geemap/static/material_styles.js +++ b/geemap/static/material_styles.js @@ -1,5 +1,5 @@ -var R=globalThis,T=R.ShadowRoot&&(R.ShadyCSS===void 0||R.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,L=Symbol(),F=new WeakMap,b=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==L)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(T&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=F.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&F.set(e,t))}return t}toString(){return this.cssText}},Q=o=>new b(typeof o=="string"?o:o+"",void 0,L),z=(o,...t)=>{let e=o.length===1?o[0]:t.reduce((s,i,r)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+o[r+1],o[0]);return new b(e,o,L)},I=(o,t)=>{if(T)o.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=R.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,o.appendChild(s)}},M=T?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return Q(e)})(o):o;var{is:pt,defineProperty:ut,getOwnPropertyDescriptor:$t,getOwnPropertyNames:ft,getOwnPropertySymbols:_t,getPrototypeOf:mt}=Object,N=globalThis,Y=N.trustedTypes,At=Y?Y.emptyScript:"",gt=N.reactiveElementPolyfillSupport,w=(o,t)=>o,j={toAttribute(o,t){switch(t){case Boolean:o=o?At:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},tt=(o,t)=>!pt(o,t),G={attribute:!0,type:String,converter:j,reflect:!1,hasChanged:tt};Symbol.metadata??=Symbol("metadata"),N.litPropertyMetadata??=new WeakMap;var $=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=G){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&ut(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:r}=$t(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i?.call(this)},set(n){let p=i?.call(this);r.call(this,n),this.requestUpdate(t,p,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??G}static _$Ei(){if(this.hasOwnProperty(w("elementProperties")))return;let t=mt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(w("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(w("properties"))){let e=this.properties,s=[...ft(e),..._t(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(M(i))}else t!==void 0&&e.push(M(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return I(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let r=(s.converter?.toAttribute!==void 0?s.converter:j).toAttribute(e,s.type);this._$Em=t,r==null?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let r=s.getPropertyOptions(i),n=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute!==void 0?r.converter:j;this._$Em=i,this[i]=n.fromAttribute(e,r.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??tt)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,r]of this._$Ep)this[i]=r;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,r]of s)r.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],r)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[w("elementProperties")]=new Map,$[w("finalized")]=new Map,gt?.({ReactiveElement:$}),(N.reactiveElementVersions??=[]).push("2.0.4");var K=globalThis,k=K.trustedTypes,et=k?k.createPolicy("lit-html",{createHTML:o=>o}):void 0,ht="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,at="?"+_,yt=`<${at}>`,g=document,x=()=>g.createComment(""),P=o=>o===null||typeof o!="object"&&typeof o!="function",X=Array.isArray,vt=o=>X(o)||typeof o?.[Symbol.iterator]=="function",B=`[ -\f\r]`,C=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,st=/-->/g,it=/>/g,m=RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^ +var R=globalThis,T=R.ShadowRoot&&(R.ShadyCSS===void 0||R.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,L=Symbol(),F=new WeakMap,b=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==L)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(T&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=F.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&F.set(e,t))}return t}toString(){return this.cssText}},Q=o=>new b(typeof o=="string"?o:o+"",void 0,L),z=(o,...t)=>{let e=o.length===1?o[0]:t.reduce((s,i,r)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+o[r+1],o[0]);return new b(e,o,L)},I=(o,t)=>{if(T)o.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=R.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,o.appendChild(s)}},M=T?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return Q(e)})(o):o;var{is:pt,defineProperty:ut,getOwnPropertyDescriptor:$t,getOwnPropertyNames:ft,getOwnPropertySymbols:_t,getPrototypeOf:mt}=Object,N=globalThis,Y=N.trustedTypes,At=Y?Y.emptyScript:"",gt=N.reactiveElementPolyfillSupport,w=(o,t)=>o,j={toAttribute(o,t){switch(t){case Boolean:o=o?At:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},tt=(o,t)=>!pt(o,t),G={attribute:!0,type:String,converter:j,reflect:!1,hasChanged:tt};Symbol.metadata??=Symbol("metadata"),N.litPropertyMetadata??=new WeakMap;var $=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=G){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&ut(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:r}=$t(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i?.call(this)},set(n){let p=i?.call(this);r.call(this,n),this.requestUpdate(t,p,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??G}static _$Ei(){if(this.hasOwnProperty(w("elementProperties")))return;let t=mt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(w("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(w("properties"))){let e=this.properties,s=[...ft(e),..._t(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(M(i))}else t!==void 0&&e.push(M(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return I(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let r=(s.converter?.toAttribute!==void 0?s.converter:j).toAttribute(e,s.type);this._$Em=t,r==null?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let r=s.getPropertyOptions(i),n=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute!==void 0?r.converter:j;this._$Em=i,this[i]=n.fromAttribute(e,r.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??tt)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,r]of this._$Ep)this[i]=r;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,r]of s)r.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],r)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[w("elementProperties")]=new Map,$[w("finalized")]=new Map,gt?.({ReactiveElement:$}),(N.reactiveElementVersions??=[]).push("2.0.4");var K=globalThis,k=K.trustedTypes,et=k?k.createPolicy("lit-html",{createHTML:o=>o}):void 0,ht="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,at="?"+_,yt=`<${at}>`,g=document,x=()=>g.createComment(""),P=o=>o===null||typeof o!="object"&&typeof o!="function",X=Array.isArray,vt=o=>X(o)||typeof o?.[Symbol.iterator]=="function",B=`[ +\f\r]`,C=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,st=/-->/g,it=/>/g,m=RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`,"g"),ot=/'/g,rt=/"/g,lt=/^(?:script|style|textarea|title)$/i,Z=o=>(t,...e)=>({_$litType$:o,strings:t,values:e}),Ut=Z(1),Ht=Z(2),Ot=Z(3),y=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),nt=new WeakMap,A=g.createTreeWalker(g,129);function ct(o,t){if(!X(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return et!==void 0?et.createHTML(t):t}var St=(o,t)=>{let e=o.length-1,s=[],i,r=t===2?"":t===3?"":"",n=C;for(let p=0;p"?(n=i??C,a=-1):d[1]===void 0?a=-2:(a=n.lastIndex-d[2].length,l=d[1],n=d[3]===void 0?m:d[3]==='"'?rt:ot):n===rt||n===ot?n=m:n===st||n===it?n=C:(n=m,i=void 0);let f=n===m&&o[p+1].startsWith("/>")?" ":"";r+=n===C?h+yt:a>=0?(s.push(l),h.slice(0,a)+ht+h.slice(a)+_+f):h+_+(a===-2?p:f)}return[ct(o,r+(o[e]||"")+(t===2?"":t===3?"":"")),s]},U=class o{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let r=0,n=0,p=t.length-1,h=this.parts,[l,d]=St(t,e);if(this.el=o.createElement(l,s),A.currentNode=this.el.content,e===2||e===3){let a=this.el.content.firstChild;a.replaceWith(...a.childNodes)}for(;(i=A.nextNode())!==null&&h.length0){i.textContent=k?k.emptyScript:"";for(let f=0;f2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=c}_$AI(t,e=this,s,i){let r=this.strings,n=!1;if(r===void 0)t=v(this,t,e,0),n=!P(t)||t!==this._$AH&&t!==y,n&&(this._$AH=t);else{let p=t,h,l;for(t=r[0],h=0;h{let s=e?.renderBefore??t,i=s._$litPart$;if(i===void 0){let r=e?.renderBefore??null;s._$litPart$=i=new H(t.insertBefore(x(),r),r,void 0,e??{})}return i._$AI(o),i};var E=class extends ${constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=dt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return y}};E._$litElement$=!0,E.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:E});var bt=globalThis.litElementPolyfillSupport;bt?.({LitElement:E});(globalThis.litElementVersions??=[]).push("4.1.0");var Jt=z` @font-face { font-family: 'Material Symbols Outlined'; @@ -60,4 +60,3 @@ lit-html/is-server.js: * SPDX-License-Identifier: BSD-3-Clause *) */ -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vbm9kZV9tb2R1bGVzL0BsaXQvcmVhY3RpdmUtZWxlbWVudC9zcmMvY3NzLXRhZy50cyIsICIuLi8uLi9ub2RlX21vZHVsZXMvQGxpdC9yZWFjdGl2ZS1lbGVtZW50L3NyYy9yZWFjdGl2ZS1lbGVtZW50LnRzIiwgIi4uLy4uL25vZGVfbW9kdWxlcy9saXQtaHRtbC9zcmMvbGl0LWh0bWwudHMiLCAiLi4vLi4vbm9kZV9tb2R1bGVzL2xpdC1lbGVtZW50L3NyYy9saXQtZWxlbWVudC50cyIsICIuLi8uLi9qcy9tYXRlcmlhbF9zdHlsZXMudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbIi8qKlxuICogQGxpY2Vuc2VcbiAqIENvcHlyaWdodCAyMDE5IEdvb2dsZSBMTENcbiAqIFNQRFgtTGljZW5zZS1JZGVudGlmaWVyOiBCU0QtMy1DbGF1c2VcbiAqL1xuXG5jb25z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1ZmZpeCkpIHtcbiAgICAgICAgICAgICAgY29uc3QgcmVhbE5hbWUgPSBhdHRyTmFtZXNbYXR0ck5hbWVJbmRleCsrXTtcbiAgICAgICAgICAgICAgY29uc3QgdmFsdWUgPSAobm9kZSBhcyBFbGVtZW50KS5nZXRBdHRyaWJ1dGUobmFtZSkhO1xuICAgICAgICAgICAgICBjb25zdCBzdGF0aWNzID0gdmFsdWUuc3BsaXQobWFya2VyKTtcbiAgICAgICAgICAgICAgY29uc3QgbSA9IC8oWy4/QF0pPyguKikvLmV4ZWMocmVhbE5hbWUpITtcbiAgICAgICAgICAgICAgcGFydHMucHVzaCh7XG4gICAgICAgICAgICAgICAgdHlwZTogQVRUUklCVVRFX1BBUlQsXG4gICAgICAgICAgICAgICAgaW5kZXg6IG5vZGVJbmRleCxcbiAgICAgICAgICAgICAgICBuYW1lOiBtWzJdLFxuICAgICAgICAgICAgICAgIHN0cmluZ3M6IHN0YXRpY3MsXG4gICAgICAgICAgICAgICAgY3RvcjpcbiAgICAgICAgICAgICAgICAgIG1bMV0gPT09ICcuJ1xuICAgICAgICAgICAgICAgICAgICA/IFByb3BlcnR5UGFydFxuICAgICAgICAgICAgICAgICAgICA6IG1bMV0gPT09ICc/J1xuICAgICAgICAgICAgICAgICAgICAgID8gQm9vbGVhbkF0dHJpYnV0ZVBhcnRcbiAgICAgICAgICAgICAgICAgICAgICA6IG1bMV0gPT09ICdAJ1xuICAgICAgICAgICAgICAgICAgICAgICAgPyBFdmVudFBhcnRcbiAgICAgICAgICAgICAgICAgICAgICAgIDogQXR0cmlidXRlUGFydCxcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgIChub2RlIGFzIEVsZW1lbnQpLnJlbW92ZUF0dHJpYnV0ZShuYW1lKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobmFtZS5zdGFydHNXaXRoKG1hcmtlcikpIHtcbiAgICAgICAgICAgICAgcGFydHMucHVzaCh7XG4gICAgICAgICAgICAgICAgdHlw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IeWRyYXRlU3VwcG9ydCIsICJwb2x5ZmlsbFN1cHBvcnQiLCAibGl0RWxlbWVudFBvbHlmaWxsU3VwcG9ydCIsICJnbG9iYWxUaGlzIiwgImxpdEVsZW1lbnRWZXJzaW9ucyIsICJwdXNoIiwgIm1hdGVyaWFsU3R5bGVzIiwgImkiXQp9Cg== diff --git a/geemap/static/utils.js b/geemap/static/utils.js index 103d8fd56d..2704aeeb1f 100644 --- a/geemap/static/utils.js +++ b/geemap/static/utils.js @@ -1,2 +1 @@ async function d(e,i){return Promise.all(e.map(t=>i.get_model(t.slice(10))))}async function l(e,i){let t=i.get("children"),a=await d(t,i.widget_manager),r=await Promise.all(a.map(n=>n.widget_manager.create_view(n)));e.innerHTML="";for(let n of r)e.appendChild(n.el)}export{l as updateChildren}; -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vanMvdXRpbHMudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImltcG9ydCB0eXBlIHsgQW55TW9kZWwgfSBmcm9tIFwiQGFueXdpZGdldC90eXBlc1wiO1xuaW1wb3J0IHsgSVdpZGdldE1hbmFnZXIsIFdpZGdldE1vZGVsIH0gZnJvbSBcIkBqdXB5dGVyLXdpZGdldHMvYmFzZVwiO1xuXG5hc3luYyBmdW5jdGlvbiB1bnBhY2tNb2RlbHMobW9kZWxJZHM6IEFycmF5PHN0cmluZz4sIG1hbmFnZXI6IElXaWRnZXRNYW5hZ2VyKTogUHJvbWlzZTxBcnJheTxXaWRnZXRNb2RlbD4+IHtcbiAgICByZXR1cm4gUHJvbWlzZS5hbGwoXG4gICAgICAgIG1vZGVsSWRzLm1hcChpZCA9PiBtYW5hZ2VyLmdldF9tb2RlbChpZC5zbGljZShcIklQWV9NT0RFTF9cIi5sZW5ndGgpKSlcbiAgICApO1xufVxuXG5leHBvcnQgYXN5bmMgZnVuY3Rpb24gdXBkYXRlQ2hpbGRyZW4oY29udGFpbmVy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zQyIsCiAgIm5hbWVzIjogWyJ1bnBhY2tNb2RlbHMiLCAibW9kZWxJZHMiLCAibWFuYWdlciIsICJpZCIsICJ1cGRhdGVDaGlsZHJlbiIsICJjb250YWluZXIiLCAibW9kZWwiLCAiY2hpbGRyZW4iLCAiY2hpbGRfbW9kZWxzIiwgImNoaWxkX3ZpZXdzIiwgImNoaWxkX3ZpZXciXQp9Cg== From 98ef790267880ce2eed8a8a4b8b38dee0ede2c6e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 11 Oct 2024 20:44:30 +0000 Subject: [PATCH 12/57] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- geemap/static/ipywidgets_styles.js | 4 ++-- geemap/static/layer_manager.js | 4 ++-- geemap/static/layer_manager_row.js | 4 ++-- geemap/static/material_styles.js | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/geemap/static/ipywidgets_styles.js b/geemap/static/ipywidgets_styles.js index 5af999a37d..4b907e8604 100644 --- a/geemap/static/ipywidgets_styles.js +++ b/geemap/static/ipywidgets_styles.js @@ -1,5 +1,5 @@ -var R=globalThis,N=R.ShadowRoot&&(R.ShadyCSS===void 0||R.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,k=Symbol(),Z=new WeakMap,E=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==k)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(N&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=Z.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Z.set(e,t))}return t}toString(){return this.cssText}},X=r=>new E(typeof r=="string"?r:r+"",void 0,k),z=(r,...t)=>{let e=r.length===1?r[0]:t.reduce((s,i,o)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[o+1],r[0]);return new E(e,r,k)},L=(r,t)=>{if(N)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=R.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s)}},T=N?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return X(e)})(r):r;var{is:pt,defineProperty:ut,getOwnPropertyDescriptor:$t,getOwnPropertyNames:ft,getOwnPropertySymbols:_t,getPrototypeOf:gt}=Object,M=globalThis,G=M.trustedTypes,mt=G?G.emptyScript:"",At=M.reactiveElementPolyfillSupport,w=(r,t)=>r,I={toAttribute(r,t){switch(t){case Boolean:r=r?mt:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},tt=(r,t)=>!pt(r,t),Y={attribute:!0,type:String,converter:I,reflect:!1,hasChanged:tt};Symbol.metadata??=Symbol("metadata"),M.litPropertyMetadata??=new WeakMap;var $=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Y){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&ut(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:o}=$t(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i?.call(this)},set(n){let p=i?.call(this);o.call(this,n),this.requestUpdate(t,p,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Y}static _$Ei(){if(this.hasOwnProperty(w("elementProperties")))return;let t=gt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(w("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(w("properties"))){let e=this.properties,s=[...ft(e),..._t(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(T(i))}else t!==void 0&&e.push(T(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return L(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let o=(s.converter?.toAttribute!==void 0?s.converter:I).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let o=s.getPropertyOptions(i),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:I;this._$Em=i,this[i]=n.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??tt)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,o]of this._$Ep)this[i]=o;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,o]of s)o.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],o)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[w("elementProperties")]=new Map,$[w("finalized")]=new Map,At?.({ReactiveElement:$}),(M.reactiveElementVersions??=[]).push("2.0.4");var J=globalThis,j=J.trustedTypes,et=j?j.createPolicy("lit-html",{createHTML:r=>r}):void 0,ht="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,at="?"+_,yt=`<${at}>`,A=document,C=()=>A.createComment(""),P=r=>r===null||typeof r!="object"&&typeof r!="function",F=Array.isArray,vt=r=>F(r)||typeof r?.[Symbol.iterator]=="function",B=`[ -\f\r]`,x=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,st=/-->/g,it=/>/g,g=RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^ +var R=globalThis,N=R.ShadowRoot&&(R.ShadyCSS===void 0||R.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,k=Symbol(),Z=new WeakMap,E=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==k)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(N&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=Z.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Z.set(e,t))}return t}toString(){return this.cssText}},X=r=>new E(typeof r=="string"?r:r+"",void 0,k),z=(r,...t)=>{let e=r.length===1?r[0]:t.reduce((s,i,o)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[o+1],r[0]);return new E(e,r,k)},L=(r,t)=>{if(N)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=R.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s)}},T=N?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return X(e)})(r):r;var{is:pt,defineProperty:ut,getOwnPropertyDescriptor:$t,getOwnPropertyNames:ft,getOwnPropertySymbols:_t,getPrototypeOf:gt}=Object,M=globalThis,G=M.trustedTypes,mt=G?G.emptyScript:"",At=M.reactiveElementPolyfillSupport,w=(r,t)=>r,I={toAttribute(r,t){switch(t){case Boolean:r=r?mt:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},tt=(r,t)=>!pt(r,t),Y={attribute:!0,type:String,converter:I,reflect:!1,hasChanged:tt};Symbol.metadata??=Symbol("metadata"),M.litPropertyMetadata??=new WeakMap;var $=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Y){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&ut(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:o}=$t(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i?.call(this)},set(n){let p=i?.call(this);o.call(this,n),this.requestUpdate(t,p,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Y}static _$Ei(){if(this.hasOwnProperty(w("elementProperties")))return;let t=gt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(w("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(w("properties"))){let e=this.properties,s=[...ft(e),..._t(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(T(i))}else t!==void 0&&e.push(T(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return L(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let o=(s.converter?.toAttribute!==void 0?s.converter:I).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let o=s.getPropertyOptions(i),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:I;this._$Em=i,this[i]=n.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??tt)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,o]of this._$Ep)this[i]=o;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,o]of s)o.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],o)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[w("elementProperties")]=new Map,$[w("finalized")]=new Map,At?.({ReactiveElement:$}),(M.reactiveElementVersions??=[]).push("2.0.4");var J=globalThis,j=J.trustedTypes,et=j?j.createPolicy("lit-html",{createHTML:r=>r}):void 0,ht="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,at="?"+_,yt=`<${at}>`,A=document,C=()=>A.createComment(""),P=r=>r===null||typeof r!="object"&&typeof r!="function",F=Array.isArray,vt=r=>F(r)||typeof r?.[Symbol.iterator]=="function",B=`[ +\f\r]`,x=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,st=/-->/g,it=/>/g,g=RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`,"g"),rt=/'/g,ot=/"/g,lt=/^(?:script|style|textarea|title)$/i,Q=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),Ut=Q(1),Ht=Q(2),Ot=Q(3),y=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),nt=new WeakMap,m=A.createTreeWalker(A,129);function ct(r,t){if(!F(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return et!==void 0?et.createHTML(t):t}var St=(r,t)=>{let e=r.length-1,s=[],i,o=t===2?"":t===3?"":"",n=x;for(let p=0;p"?(n=i??x,a=-1):d[1]===void 0?a=-2:(a=n.lastIndex-d[2].length,l=d[1],n=d[3]===void 0?g:d[3]==='"'?ot:rt):n===ot||n===rt?n=g:n===st||n===it?n=x:(n=g,i=void 0);let f=n===g&&r[p+1].startsWith("/>")?" ":"";o+=n===x?h+yt:a>=0?(s.push(l),h.slice(0,a)+ht+h.slice(a)+_+f):h+_+(a===-2?p:f)}return[ct(r,o+(r[e]||"")+(t===2?"":t===3?"":"")),s]},U=class r{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let o=0,n=0,p=t.length-1,h=this.parts,[l,d]=St(t,e);if(this.el=r.createElement(l,s),m.currentNode=this.el.content,e===2||e===3){let a=this.el.content.firstChild;a.replaceWith(...a.childNodes)}for(;(i=m.nextNode())!==null&&h.length0){i.textContent=j?j.emptyScript:"";for(let f=0;f2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=c}_$AI(t,e=this,s,i){let o=this.strings,n=!1;if(o===void 0)t=v(this,t,e,0),n=!P(t)||t!==this._$AH&&t!==y,n&&(this._$AH=t);else{let p=t,h,l;for(t=o[0],h=0;h{let s=e?.renderBefore??t,i=s._$litPart$;if(i===void 0){let o=e?.renderBefore??null;s._$litPart$=i=new H(t.insertBefore(C(),o),o,void 0,e??{})}return i._$AI(r),i};var b=class extends ${constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=dt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return y}};b._$litElement$=!0,b.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:b});var Et=globalThis.litElementPolyfillSupport;Et?.({LitElement:b});(globalThis.litElementVersions??=[]).push("4.1.0");var qt=z` .legacy-button { align-items: center; diff --git a/geemap/static/layer_manager.js b/geemap/static/layer_manager.js index a8f4001eba..b27896c6f1 100644 --- a/geemap/static/layer_manager.js +++ b/geemap/static/layer_manager.js @@ -1,5 +1,5 @@ -var At=Object.defineProperty;var vt=Object.getOwnPropertyDescriptor;var st=(r,t,e,s)=>{for(var i=s>1?void 0:s?vt(t,e):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(i=(s?n(t,e,i):n(i))||i);return s&&i&&At(t,e,i),i};var T=globalThis,k=T.ShadowRoot&&(T.ShadyCSS===void 0||T.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,V=Symbol(),it=new WeakMap,x=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==V)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(k&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=it.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&it.set(e,t))}return t}toString(){return this.cssText}},rt=r=>new x(typeof r=="string"?r:r+"",void 0,V),w=(r,...t)=>{let e=r.length===1?r[0]:t.reduce((s,i,o)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[o+1],r[0]);return new x(e,r,V)},B=(r,t)=>{if(k)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=T.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s)}},j=k?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return rt(e)})(r):r;var{is:bt,defineProperty:St,getOwnPropertyDescriptor:Et,getOwnPropertyNames:xt,getOwnPropertySymbols:wt,getPrototypeOf:Ct}=Object,L=globalThis,ot=L.trustedTypes,Pt=ot?ot.emptyScript:"",Mt=L.reactiveElementPolyfillSupport,C=(r,t)=>r,P={toAttribute(r,t){switch(t){case Boolean:r=r?Pt:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},z=(r,t)=>!bt(r,t),nt={attribute:!0,type:String,converter:P,reflect:!1,hasChanged:z};Symbol.metadata??=Symbol("metadata"),L.litPropertyMetadata??=new WeakMap;var m=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=nt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&St(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:o}=Et(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i?.call(this)},set(n){let h=i?.call(this);o.call(this,n),this.requestUpdate(t,h,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??nt}static _$Ei(){if(this.hasOwnProperty(C("elementProperties")))return;let t=Ct(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(C("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(C("properties"))){let e=this.properties,s=[...xt(e),...wt(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(j(i))}else t!==void 0&&e.push(j(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return B(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let o=(s.converter?.toAttribute!==void 0?s.converter:P).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let o=s.getPropertyOptions(i),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:P;this._$Em=i,this[i]=n.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??z)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,o]of this._$Ep)this[i]=o;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,o]of s)o.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],o)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};m.elementStyles=[],m.shadowRootOptions={mode:"open"},m[C("elementProperties")]=new Map,m[C("finalized")]=new Map,Mt?.({ReactiveElement:m}),(L.reactiveElementVersions??=[]).push("2.0.4");var X=globalThis,I=X.trustedTypes,at=I?I.createPolicy("lit-html",{createHTML:r=>r}):void 0,ut="$lit$",g=`lit$${Math.random().toFixed(9).slice(2)}$`,mt="?"+g,Ut=`<${mt}>`,A=document,U=()=>A.createComment(""),N=r=>r===null||typeof r!="object"&&typeof r!="function",Y=Array.isArray,Nt=r=>Y(r)||typeof r?.[Symbol.iterator]=="function",W=`[ -\f\r]`,M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,lt=/-->/g,ht=/>/g,$=RegExp(`>|${W}(?:([^\\s"'>=/]+)(${W}*=${W}*(?:[^ +var At=Object.defineProperty;var vt=Object.getOwnPropertyDescriptor;var st=(r,t,e,s)=>{for(var i=s>1?void 0:s?vt(t,e):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(i=(s?n(t,e,i):n(i))||i);return s&&i&&At(t,e,i),i};var T=globalThis,k=T.ShadowRoot&&(T.ShadyCSS===void 0||T.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,V=Symbol(),it=new WeakMap,x=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==V)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(k&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=it.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&it.set(e,t))}return t}toString(){return this.cssText}},rt=r=>new x(typeof r=="string"?r:r+"",void 0,V),w=(r,...t)=>{let e=r.length===1?r[0]:t.reduce((s,i,o)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[o+1],r[0]);return new x(e,r,V)},B=(r,t)=>{if(k)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=T.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s)}},j=k?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return rt(e)})(r):r;var{is:bt,defineProperty:St,getOwnPropertyDescriptor:Et,getOwnPropertyNames:xt,getOwnPropertySymbols:wt,getPrototypeOf:Ct}=Object,L=globalThis,ot=L.trustedTypes,Pt=ot?ot.emptyScript:"",Mt=L.reactiveElementPolyfillSupport,C=(r,t)=>r,P={toAttribute(r,t){switch(t){case Boolean:r=r?Pt:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},z=(r,t)=>!bt(r,t),nt={attribute:!0,type:String,converter:P,reflect:!1,hasChanged:z};Symbol.metadata??=Symbol("metadata"),L.litPropertyMetadata??=new WeakMap;var m=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=nt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&St(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:o}=Et(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i?.call(this)},set(n){let h=i?.call(this);o.call(this,n),this.requestUpdate(t,h,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??nt}static _$Ei(){if(this.hasOwnProperty(C("elementProperties")))return;let t=Ct(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(C("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(C("properties"))){let e=this.properties,s=[...xt(e),...wt(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(j(i))}else t!==void 0&&e.push(j(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return B(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let o=(s.converter?.toAttribute!==void 0?s.converter:P).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let o=s.getPropertyOptions(i),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:P;this._$Em=i,this[i]=n.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??z)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,o]of this._$Ep)this[i]=o;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,o]of s)o.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],o)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};m.elementStyles=[],m.shadowRootOptions={mode:"open"},m[C("elementProperties")]=new Map,m[C("finalized")]=new Map,Mt?.({ReactiveElement:m}),(L.reactiveElementVersions??=[]).push("2.0.4");var X=globalThis,I=X.trustedTypes,at=I?I.createPolicy("lit-html",{createHTML:r=>r}):void 0,ut="$lit$",g=`lit$${Math.random().toFixed(9).slice(2)}$`,mt="?"+g,Ut=`<${mt}>`,A=document,U=()=>A.createComment(""),N=r=>r===null||typeof r!="object"&&typeof r!="function",Y=Array.isArray,Nt=r=>Y(r)||typeof r?.[Symbol.iterator]=="function",W=`[ +\f\r]`,M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,lt=/-->/g,ht=/>/g,$=RegExp(`>|${W}(?:([^\\s"'>=/]+)(${W}*=${W}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`,"g"),ct=/'/g,dt=/"/g,ft=/^(?:script|style|textarea|title)$/i,G=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),gt=G(1),Bt=G(2),Wt=G(3),v=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),pt=new WeakMap,_=A.createTreeWalker(A,129);function yt(r,t){if(!Y(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return at!==void 0?at.createHTML(t):t}var Ot=(r,t)=>{let e=r.length-1,s=[],i,o=t===2?"":t===3?"":"",n=M;for(let h=0;h"?(n=i??M,l=-1):p[1]===void 0?l=-2:(l=n.lastIndex-p[2].length,c=p[1],n=p[3]===void 0?$:p[3]==='"'?dt:ct):n===dt||n===ct?n=$:n===lt||n===ht?n=M:(n=$,i=void 0);let f=n===$&&r[h+1].startsWith("/>")?" ":"";o+=n===M?a+Ut:l>=0?(s.push(c),a.slice(0,l)+ut+a.slice(l)+g+f):a+g+(l===-2?h:f)}return[yt(r,o+(r[e]||"")+(t===2?"":t===3?"":"")),s]},O=class r{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let o=0,n=0,h=t.length-1,a=this.parts,[c,p]=Ot(t,e);if(this.el=r.createElement(c,s),_.currentNode=this.el.content,e===2||e===3){let l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(i=_.nextNode())!==null&&a.length0){i.textContent=I?I.emptyScript:"";for(let f=0;f2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=d}_$AI(t,e=this,s,i){let o=this.strings,n=!1;if(o===void 0)t=b(this,t,e,0),n=!N(t)||t!==this._$AH&&t!==v,n&&(this._$AH=t);else{let h=t,a,c;for(t=o[0],a=0;a{let s=e?.renderBefore??t,i=s._$litPart$;if(i===void 0){let o=e?.renderBefore??null;s._$litPart$=i=new R(t.insertBefore(U(),o),o,void 0,e??{})}return i._$AI(r),i};var y=class extends m{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=$t(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return v}};y._$litElement$=!0,y.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:y});var Ht=globalThis.litElementPolyfillSupport;Ht?.({LitElement:y});(globalThis.litElementVersions??=[]).push("4.1.0");var Tt={attribute:!0,type:String,converter:P,reflect:!1,hasChanged:z},kt=(r=Tt,t,e)=>{let{kind:s,metadata:i}=e,o=globalThis.litPropertyMetadata.get(i);if(o===void 0&&globalThis.litPropertyMetadata.set(i,o=new Map),o.set(e.name,r),s==="accessor"){let{name:n}=e;return{set(h){let a=t.get.call(this);t.set.call(this,h),this.requestUpdate(n,a,r)},init(h){return h!==void 0&&this.P(n,void 0,r),h}}}if(s==="setter"){let{name:n}=e;return function(h){let a=this[n];t.call(this,h),this.requestUpdate(n,a,r)}}throw Error("Unsupported decorator location: "+s)};function tt(r){return(t,e)=>typeof e=="object"?kt(r,t,e):((s,i,o)=>{let n=i.hasOwnProperty(o);return i.constructor.createProperty(o,n?{...s,wrapped:!0}:s),n?Object.getOwnPropertyDescriptor(i,o):void 0})(r,t,e)}var _t=w` .legacy-button { align-items: center; diff --git a/geemap/static/layer_manager_row.js b/geemap/static/layer_manager_row.js index 010a3b9d5d..118f9692ca 100644 --- a/geemap/static/layer_manager_row.js +++ b/geemap/static/layer_manager_row.js @@ -1,5 +1,5 @@ -var _t=Object.defineProperty;var bt=Object.getOwnPropertyDescriptor;var w=(o,t,e,s)=>{for(var i=s>1?void 0:s?bt(t,e):t,n=o.length-1,r;n>=0;n--)(r=o[n])&&(i=(s?r(t,e,i):r(i))||i);return s&&i&&_t(t,e,i),i};var L=globalThis,z=L.ShadowRoot&&(L.ShadyCSS===void 0||L.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,W=Symbol(),it=new WeakMap,k=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==W)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(z&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=it.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&it.set(e,t))}return t}toString(){return this.cssText}},ot=o=>new k(typeof o=="string"?o:o+"",void 0,W),v=(o,...t)=>{let e=o.length===1?o[0]:t.reduce((s,i,n)=>s+(r=>{if(r._$cssResult$===!0)return r.cssText;if(typeof r=="number")return r;throw Error("Value passed to 'css' function must be a 'css' function result: "+r+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+o[n+1],o[0]);return new k(e,o,W)},J=(o,t)=>{if(z)o.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=L.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,o.appendChild(s)}},D=z?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return ot(e)})(o):o;var{is:At,defineProperty:xt,getOwnPropertyDescriptor:St,getOwnPropertyNames:wt,getOwnPropertySymbols:Et,getPrototypeOf:Ct}=Object,I=globalThis,nt=I.trustedTypes,Pt=nt?nt.emptyScript:"",kt=I.reactiveElementPolyfillSupport,R=(o,t)=>o,U={toAttribute(o,t){switch(t){case Boolean:o=o?Pt:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},V=(o,t)=>!At(o,t),rt={attribute:!0,type:String,converter:U,reflect:!1,hasChanged:V};Symbol.metadata??=Symbol("metadata"),I.litPropertyMetadata??=new WeakMap;var m=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=rt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&xt(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:n}=St(this.prototype,t)??{get(){return this[e]},set(r){this[e]=r}};return{get(){return i?.call(this)},set(r){let h=i?.call(this);n.call(this,r),this.requestUpdate(t,h,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??rt}static _$Ei(){if(this.hasOwnProperty(R("elementProperties")))return;let t=Ct(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(R("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(R("properties"))){let e=this.properties,s=[...wt(e),...Et(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(D(i))}else t!==void 0&&e.push(D(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return J(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let n=(s.converter?.toAttribute!==void 0?s.converter:U).toAttribute(e,s.type);this._$Em=t,n==null?this.removeAttribute(i):this.setAttribute(i,n),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let n=s.getPropertyOptions(i),r=typeof n.converter=="function"?{fromAttribute:n.converter}:n.converter?.fromAttribute!==void 0?n.converter:U;this._$Em=i,this[i]=r.fromAttribute(e,n.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??V)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,n]of this._$Ep)this[i]=n;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,n]of s)n.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],n)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};m.elementStyles=[],m.shadowRootOptions={mode:"open"},m[R("elementProperties")]=new Map,m[R("finalized")]=new Map,kt?.({ReactiveElement:m}),(I.reactiveElementVersions??=[]).push("2.0.4");var G=globalThis,q=G.trustedTypes,at=q?q.createPolicy("lit-html",{createHTML:o=>o}):void 0,ut="$lit$",g=`lit$${Math.random().toFixed(9).slice(2)}$`,mt="?"+g,Rt=`<${mt}>`,A=document,O=()=>A.createComment(""),N=o=>o===null||typeof o!="object"&&typeof o!="function",tt=Array.isArray,Ut=o=>tt(o)||typeof o?.[Symbol.iterator]=="function",K=`[ -\f\r]`,M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,lt=/-->/g,ht=/>/g,_=RegExp(`>|${K}(?:([^\\s"'>=/]+)(${K}*=${K}*(?:[^ +var _t=Object.defineProperty;var bt=Object.getOwnPropertyDescriptor;var w=(o,t,e,s)=>{for(var i=s>1?void 0:s?bt(t,e):t,n=o.length-1,r;n>=0;n--)(r=o[n])&&(i=(s?r(t,e,i):r(i))||i);return s&&i&&_t(t,e,i),i};var L=globalThis,z=L.ShadowRoot&&(L.ShadyCSS===void 0||L.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,W=Symbol(),it=new WeakMap,k=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==W)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(z&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=it.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&it.set(e,t))}return t}toString(){return this.cssText}},ot=o=>new k(typeof o=="string"?o:o+"",void 0,W),v=(o,...t)=>{let e=o.length===1?o[0]:t.reduce((s,i,n)=>s+(r=>{if(r._$cssResult$===!0)return r.cssText;if(typeof r=="number")return r;throw Error("Value passed to 'css' function must be a 'css' function result: "+r+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+o[n+1],o[0]);return new k(e,o,W)},J=(o,t)=>{if(z)o.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=L.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,o.appendChild(s)}},D=z?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return ot(e)})(o):o;var{is:At,defineProperty:xt,getOwnPropertyDescriptor:St,getOwnPropertyNames:wt,getOwnPropertySymbols:Et,getPrototypeOf:Ct}=Object,I=globalThis,nt=I.trustedTypes,Pt=nt?nt.emptyScript:"",kt=I.reactiveElementPolyfillSupport,R=(o,t)=>o,U={toAttribute(o,t){switch(t){case Boolean:o=o?Pt:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},V=(o,t)=>!At(o,t),rt={attribute:!0,type:String,converter:U,reflect:!1,hasChanged:V};Symbol.metadata??=Symbol("metadata"),I.litPropertyMetadata??=new WeakMap;var m=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=rt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&xt(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:n}=St(this.prototype,t)??{get(){return this[e]},set(r){this[e]=r}};return{get(){return i?.call(this)},set(r){let h=i?.call(this);n.call(this,r),this.requestUpdate(t,h,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??rt}static _$Ei(){if(this.hasOwnProperty(R("elementProperties")))return;let t=Ct(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(R("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(R("properties"))){let e=this.properties,s=[...wt(e),...Et(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(D(i))}else t!==void 0&&e.push(D(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return J(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let n=(s.converter?.toAttribute!==void 0?s.converter:U).toAttribute(e,s.type);this._$Em=t,n==null?this.removeAttribute(i):this.setAttribute(i,n),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let n=s.getPropertyOptions(i),r=typeof n.converter=="function"?{fromAttribute:n.converter}:n.converter?.fromAttribute!==void 0?n.converter:U;this._$Em=i,this[i]=r.fromAttribute(e,n.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??V)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,n]of this._$Ep)this[i]=n;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,n]of s)n.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],n)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};m.elementStyles=[],m.shadowRootOptions={mode:"open"},m[R("elementProperties")]=new Map,m[R("finalized")]=new Map,kt?.({ReactiveElement:m}),(I.reactiveElementVersions??=[]).push("2.0.4");var G=globalThis,q=G.trustedTypes,at=q?q.createPolicy("lit-html",{createHTML:o=>o}):void 0,ut="$lit$",g=`lit$${Math.random().toFixed(9).slice(2)}$`,mt="?"+g,Rt=`<${mt}>`,A=document,O=()=>A.createComment(""),N=o=>o===null||typeof o!="object"&&typeof o!="function",tt=Array.isArray,Ut=o=>tt(o)||typeof o?.[Symbol.iterator]=="function",K=`[ +\f\r]`,M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,lt=/-->/g,ht=/>/g,_=RegExp(`>|${K}(?:([^\\s"'>=/]+)(${K}*=${K}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`,"g"),ct=/'/g,dt=/"/g,ft=/^(?:script|style|textarea|title)$/i,et=o=>(t,...e)=>({_$litType$:o,strings:t,values:e}),st=et(1),qt=et(2),Bt=et(3),x=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),pt=new WeakMap,b=A.createTreeWalker(A,129);function gt(o,t){if(!tt(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return at!==void 0?at.createHTML(t):t}var Mt=(o,t)=>{let e=o.length-1,s=[],i,n=t===2?"":t===3?"":"",r=M;for(let h=0;h"?(r=i??M,l=-1):p[1]===void 0?l=-2:(l=r.lastIndex-p[2].length,d=p[1],r=p[3]===void 0?_:p[3]==='"'?dt:ct):r===dt||r===ct?r=_:r===lt||r===ht?r=M:(r=_,i=void 0);let f=r===_&&o[h+1].startsWith("/>")?" ":"";n+=r===M?a+Rt:l>=0?(s.push(d),a.slice(0,l)+ut+a.slice(l)+g+f):a+g+(l===-2?h:f)}return[gt(o,n+(o[e]||"")+(t===2?"":t===3?"":"")),s]},H=class o{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let n=0,r=0,h=t.length-1,a=this.parts,[d,p]=Mt(t,e);if(this.el=o.createElement(d,s),b.currentNode=this.el.content,e===2||e===3){let l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(i=b.nextNode())!==null&&a.length0){i.textContent=q?q.emptyScript:"";for(let f=0;f2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=c}_$AI(t,e=this,s,i){let n=this.strings,r=!1;if(n===void 0)t=E(this,t,e,0),r=!N(t)||t!==this._$AH&&t!==x,r&&(this._$AH=t);else{let h=t,a,d;for(t=n[0],a=0;a{let s=e?.renderBefore??t,i=s._$litPart$;if(i===void 0){let n=e?.renderBefore??null;s._$litPart$=i=new T(t.insertBefore(O(),n),n,void 0,e??{})}return i._$AI(o),i};var y=class extends m{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=yt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return x}};y._$litElement$=!0,y.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:y});var Nt=globalThis.litElementPolyfillSupport;Nt?.({LitElement:y});(globalThis.litElementVersions??=[]).push("4.1.0");var Ht={attribute:!0,type:String,converter:U,reflect:!1,hasChanged:V},Tt=(o=Ht,t,e)=>{let{kind:s,metadata:i}=e,n=globalThis.litPropertyMetadata.get(i);if(n===void 0&&globalThis.litPropertyMetadata.set(i,n=new Map),n.set(e.name,o),s==="accessor"){let{name:r}=e;return{set(h){let a=t.get.call(this);t.set.call(this,h),this.requestUpdate(r,a,o)},init(h){return h!==void 0&&this.P(r,void 0,o),h}}}if(s==="setter"){let{name:r}=e;return function(h){let a=this[r];t.call(this,h),this.requestUpdate(r,a,o)}}throw Error("Unsupported decorator location: "+s)};function S(o){return(t,e)=>typeof e=="object"?Tt(o,t,e):((s,i,n)=>{let r=i.hasOwnProperty(n);return i.constructor.createProperty(n,r?{...s,wrapped:!0}:s),r?Object.getOwnPropertyDescriptor(i,n):void 0})(o,t,e)}var $t=v` .legacy-button { align-items: center; diff --git a/geemap/static/material_styles.js b/geemap/static/material_styles.js index 2aff906ab4..d5a7762b34 100644 --- a/geemap/static/material_styles.js +++ b/geemap/static/material_styles.js @@ -1,5 +1,5 @@ -var R=globalThis,T=R.ShadowRoot&&(R.ShadyCSS===void 0||R.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,L=Symbol(),F=new WeakMap,b=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==L)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(T&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=F.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&F.set(e,t))}return t}toString(){return this.cssText}},Q=o=>new b(typeof o=="string"?o:o+"",void 0,L),z=(o,...t)=>{let e=o.length===1?o[0]:t.reduce((s,i,r)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+o[r+1],o[0]);return new b(e,o,L)},I=(o,t)=>{if(T)o.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=R.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,o.appendChild(s)}},M=T?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return Q(e)})(o):o;var{is:pt,defineProperty:ut,getOwnPropertyDescriptor:$t,getOwnPropertyNames:ft,getOwnPropertySymbols:_t,getPrototypeOf:mt}=Object,N=globalThis,Y=N.trustedTypes,At=Y?Y.emptyScript:"",gt=N.reactiveElementPolyfillSupport,w=(o,t)=>o,j={toAttribute(o,t){switch(t){case Boolean:o=o?At:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},tt=(o,t)=>!pt(o,t),G={attribute:!0,type:String,converter:j,reflect:!1,hasChanged:tt};Symbol.metadata??=Symbol("metadata"),N.litPropertyMetadata??=new WeakMap;var $=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=G){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&ut(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:r}=$t(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i?.call(this)},set(n){let p=i?.call(this);r.call(this,n),this.requestUpdate(t,p,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??G}static _$Ei(){if(this.hasOwnProperty(w("elementProperties")))return;let t=mt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(w("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(w("properties"))){let e=this.properties,s=[...ft(e),..._t(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(M(i))}else t!==void 0&&e.push(M(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return I(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let r=(s.converter?.toAttribute!==void 0?s.converter:j).toAttribute(e,s.type);this._$Em=t,r==null?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let r=s.getPropertyOptions(i),n=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute!==void 0?r.converter:j;this._$Em=i,this[i]=n.fromAttribute(e,r.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??tt)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,r]of this._$Ep)this[i]=r;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,r]of s)r.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],r)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[w("elementProperties")]=new Map,$[w("finalized")]=new Map,gt?.({ReactiveElement:$}),(N.reactiveElementVersions??=[]).push("2.0.4");var K=globalThis,k=K.trustedTypes,et=k?k.createPolicy("lit-html",{createHTML:o=>o}):void 0,ht="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,at="?"+_,yt=`<${at}>`,g=document,x=()=>g.createComment(""),P=o=>o===null||typeof o!="object"&&typeof o!="function",X=Array.isArray,vt=o=>X(o)||typeof o?.[Symbol.iterator]=="function",B=`[ -\f\r]`,C=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,st=/-->/g,it=/>/g,m=RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^ +var R=globalThis,T=R.ShadowRoot&&(R.ShadyCSS===void 0||R.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,L=Symbol(),F=new WeakMap,b=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==L)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(T&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=F.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&F.set(e,t))}return t}toString(){return this.cssText}},Q=o=>new b(typeof o=="string"?o:o+"",void 0,L),z=(o,...t)=>{let e=o.length===1?o[0]:t.reduce((s,i,r)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+o[r+1],o[0]);return new b(e,o,L)},I=(o,t)=>{if(T)o.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=R.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,o.appendChild(s)}},M=T?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return Q(e)})(o):o;var{is:pt,defineProperty:ut,getOwnPropertyDescriptor:$t,getOwnPropertyNames:ft,getOwnPropertySymbols:_t,getPrototypeOf:mt}=Object,N=globalThis,Y=N.trustedTypes,At=Y?Y.emptyScript:"",gt=N.reactiveElementPolyfillSupport,w=(o,t)=>o,j={toAttribute(o,t){switch(t){case Boolean:o=o?At:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},tt=(o,t)=>!pt(o,t),G={attribute:!0,type:String,converter:j,reflect:!1,hasChanged:tt};Symbol.metadata??=Symbol("metadata"),N.litPropertyMetadata??=new WeakMap;var $=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=G){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&ut(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:r}=$t(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i?.call(this)},set(n){let p=i?.call(this);r.call(this,n),this.requestUpdate(t,p,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??G}static _$Ei(){if(this.hasOwnProperty(w("elementProperties")))return;let t=mt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(w("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(w("properties"))){let e=this.properties,s=[...ft(e),..._t(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(M(i))}else t!==void 0&&e.push(M(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return I(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let r=(s.converter?.toAttribute!==void 0?s.converter:j).toAttribute(e,s.type);this._$Em=t,r==null?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let r=s.getPropertyOptions(i),n=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute!==void 0?r.converter:j;this._$Em=i,this[i]=n.fromAttribute(e,r.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??tt)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,r]of this._$Ep)this[i]=r;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,r]of s)r.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],r)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[w("elementProperties")]=new Map,$[w("finalized")]=new Map,gt?.({ReactiveElement:$}),(N.reactiveElementVersions??=[]).push("2.0.4");var K=globalThis,k=K.trustedTypes,et=k?k.createPolicy("lit-html",{createHTML:o=>o}):void 0,ht="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,at="?"+_,yt=`<${at}>`,g=document,x=()=>g.createComment(""),P=o=>o===null||typeof o!="object"&&typeof o!="function",X=Array.isArray,vt=o=>X(o)||typeof o?.[Symbol.iterator]=="function",B=`[ +\f\r]`,C=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,st=/-->/g,it=/>/g,m=RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`,"g"),ot=/'/g,rt=/"/g,lt=/^(?:script|style|textarea|title)$/i,Z=o=>(t,...e)=>({_$litType$:o,strings:t,values:e}),Ut=Z(1),Ht=Z(2),Ot=Z(3),y=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),nt=new WeakMap,A=g.createTreeWalker(g,129);function ct(o,t){if(!X(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return et!==void 0?et.createHTML(t):t}var St=(o,t)=>{let e=o.length-1,s=[],i,r=t===2?"":t===3?"":"",n=C;for(let p=0;p"?(n=i??C,a=-1):d[1]===void 0?a=-2:(a=n.lastIndex-d[2].length,l=d[1],n=d[3]===void 0?m:d[3]==='"'?rt:ot):n===rt||n===ot?n=m:n===st||n===it?n=C:(n=m,i=void 0);let f=n===m&&o[p+1].startsWith("/>")?" ":"";r+=n===C?h+yt:a>=0?(s.push(l),h.slice(0,a)+ht+h.slice(a)+_+f):h+_+(a===-2?p:f)}return[ct(o,r+(o[e]||"")+(t===2?"":t===3?"":"")),s]},U=class o{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let r=0,n=0,p=t.length-1,h=this.parts,[l,d]=St(t,e);if(this.el=o.createElement(l,s),A.currentNode=this.el.content,e===2||e===3){let a=this.el.content.firstChild;a.replaceWith(...a.childNodes)}for(;(i=A.nextNode())!==null&&h.length0){i.textContent=k?k.emptyScript:"";for(let f=0;f2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=c}_$AI(t,e=this,s,i){let r=this.strings,n=!1;if(r===void 0)t=v(this,t,e,0),n=!P(t)||t!==this._$AH&&t!==y,n&&(this._$AH=t);else{let p=t,h,l;for(t=r[0],h=0;h{let s=e?.renderBefore??t,i=s._$litPart$;if(i===void 0){let r=e?.renderBefore??null;s._$litPart$=i=new H(t.insertBefore(x(),r),r,void 0,e??{})}return i._$AI(o),i};var E=class extends ${constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=dt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return y}};E._$litElement$=!0,E.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:E});var bt=globalThis.litElementPolyfillSupport;bt?.({LitElement:E});(globalThis.litElementVersions??=[]).push("4.1.0");var Jt=z` @font-face { font-family: 'Material Symbols Outlined'; From 0729c3d83645be186da9ce17d8b13ca929f01a0f Mon Sep 17 00:00:00 2001 From: Nathaniel Schmitz Date: Mon, 14 Oct 2024 14:43:04 -0400 Subject: [PATCH 13/57] Use non-minified JS files to work around property renaming issue --- geemap/static/ipywidgets_styles.js | 555 +++++++++++++++++++++- geemap/static/layer_manager.css | 5 +- geemap/static/layer_manager.js | 684 +++++++++++++++++++++++++- geemap/static/layer_manager_row.css | 5 +- geemap/static/layer_manager_row.js | 712 +++++++++++++++++++++++++++- geemap/static/material_styles.js | 555 +++++++++++++++++++++- geemap/static/utils.js | 22 +- package.json | 2 +- 8 files changed, 2513 insertions(+), 27 deletions(-) diff --git a/geemap/static/ipywidgets_styles.js b/geemap/static/ipywidgets_styles.js index 4b907e8604..7e6805d52e 100644 --- a/geemap/static/ipywidgets_styles.js +++ b/geemap/static/ipywidgets_styles.js @@ -1,6 +1,549 @@ -var R=globalThis,N=R.ShadowRoot&&(R.ShadyCSS===void 0||R.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,k=Symbol(),Z=new WeakMap,E=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==k)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(N&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=Z.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Z.set(e,t))}return t}toString(){return this.cssText}},X=r=>new E(typeof r=="string"?r:r+"",void 0,k),z=(r,...t)=>{let e=r.length===1?r[0]:t.reduce((s,i,o)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[o+1],r[0]);return new E(e,r,k)},L=(r,t)=>{if(N)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=R.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s)}},T=N?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return X(e)})(r):r;var{is:pt,defineProperty:ut,getOwnPropertyDescriptor:$t,getOwnPropertyNames:ft,getOwnPropertySymbols:_t,getPrototypeOf:gt}=Object,M=globalThis,G=M.trustedTypes,mt=G?G.emptyScript:"",At=M.reactiveElementPolyfillSupport,w=(r,t)=>r,I={toAttribute(r,t){switch(t){case Boolean:r=r?mt:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},tt=(r,t)=>!pt(r,t),Y={attribute:!0,type:String,converter:I,reflect:!1,hasChanged:tt};Symbol.metadata??=Symbol("metadata"),M.litPropertyMetadata??=new WeakMap;var $=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Y){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&ut(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:o}=$t(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i?.call(this)},set(n){let p=i?.call(this);o.call(this,n),this.requestUpdate(t,p,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Y}static _$Ei(){if(this.hasOwnProperty(w("elementProperties")))return;let t=gt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(w("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(w("properties"))){let e=this.properties,s=[...ft(e),..._t(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(T(i))}else t!==void 0&&e.push(T(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return L(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let o=(s.converter?.toAttribute!==void 0?s.converter:I).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let o=s.getPropertyOptions(i),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:I;this._$Em=i,this[i]=n.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??tt)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,o]of this._$Ep)this[i]=o;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,o]of s)o.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],o)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[w("elementProperties")]=new Map,$[w("finalized")]=new Map,At?.({ReactiveElement:$}),(M.reactiveElementVersions??=[]).push("2.0.4");var J=globalThis,j=J.trustedTypes,et=j?j.createPolicy("lit-html",{createHTML:r=>r}):void 0,ht="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,at="?"+_,yt=`<${at}>`,A=document,C=()=>A.createComment(""),P=r=>r===null||typeof r!="object"&&typeof r!="function",F=Array.isArray,vt=r=>F(r)||typeof r?.[Symbol.iterator]=="function",B=`[ -\f\r]`,x=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,st=/-->/g,it=/>/g,g=RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^ -\f\r"'\`<>=]|("|')|))|$)`,"g"),rt=/'/g,ot=/"/g,lt=/^(?:script|style|textarea|title)$/i,Q=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),Ut=Q(1),Ht=Q(2),Ot=Q(3),y=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),nt=new WeakMap,m=A.createTreeWalker(A,129);function ct(r,t){if(!F(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return et!==void 0?et.createHTML(t):t}var St=(r,t)=>{let e=r.length-1,s=[],i,o=t===2?"":t===3?"":"",n=x;for(let p=0;p"?(n=i??x,a=-1):d[1]===void 0?a=-2:(a=n.lastIndex-d[2].length,l=d[1],n=d[3]===void 0?g:d[3]==='"'?ot:rt):n===ot||n===rt?n=g:n===st||n===it?n=x:(n=g,i=void 0);let f=n===g&&r[p+1].startsWith("/>")?" ":"";o+=n===x?h+yt:a>=0?(s.push(l),h.slice(0,a)+ht+h.slice(a)+_+f):h+_+(a===-2?p:f)}return[ct(r,o+(r[e]||"")+(t===2?"":t===3?"":"")),s]},U=class r{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let o=0,n=0,p=t.length-1,h=this.parts,[l,d]=St(t,e);if(this.el=r.createElement(l,s),m.currentNode=this.el.content,e===2||e===3){let a=this.el.content.firstChild;a.replaceWith(...a.childNodes)}for(;(i=m.nextNode())!==null&&h.length0){i.textContent=j?j.emptyScript:"";for(let f=0;f2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=c}_$AI(t,e=this,s,i){let o=this.strings,n=!1;if(o===void 0)t=v(this,t,e,0),n=!P(t)||t!==this._$AH&&t!==y,n&&(this._$AH=t);else{let p=t,h,l;for(t=o[0],h=0;h{let s=e?.renderBefore??t,i=s._$litPart$;if(i===void 0){let o=e?.renderBefore??null;s._$litPart$=i=new H(t.insertBefore(C(),o),o,void 0,e??{})}return i._$AI(r),i};var b=class extends ${constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=dt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return y}};b._$litElement$=!0,b.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:b});var Et=globalThis.litElementPolyfillSupport;Et?.({LitElement:b});(globalThis.litElementVersions??=[]).push("4.1.0");var qt=z` +// node_modules/@lit/reactive-element/css-tag.js +var t = globalThis; +var e = t.ShadowRoot && (void 0 === t.ShadyCSS || t.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype; +var s = Symbol(); +var o = /* @__PURE__ */ new WeakMap(); +var n = class { + constructor(t2, e3, o3) { + if (this._$cssResult$ = true, o3 !== s) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead."); + this.cssText = t2, this.t = e3; + } + get styleSheet() { + let t2 = this.o; + const s2 = this.t; + if (e && void 0 === t2) { + const e3 = void 0 !== s2 && 1 === s2.length; + e3 && (t2 = o.get(s2)), void 0 === t2 && ((this.o = t2 = new CSSStyleSheet()).replaceSync(this.cssText), e3 && o.set(s2, t2)); + } + return t2; + } + toString() { + return this.cssText; + } +}; +var r = (t2) => new n("string" == typeof t2 ? t2 : t2 + "", void 0, s); +var i = (t2, ...e3) => { + const o3 = 1 === t2.length ? t2[0] : e3.reduce((e4, s2, o4) => e4 + ((t3) => { + if (true === t3._$cssResult$) return t3.cssText; + if ("number" == typeof t3) return t3; + throw Error("Value passed to 'css' function must be a 'css' function result: " + t3 + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security."); + })(s2) + t2[o4 + 1], t2[0]); + return new n(o3, t2, s); +}; +var S = (s2, o3) => { + if (e) s2.adoptedStyleSheets = o3.map((t2) => t2 instanceof CSSStyleSheet ? t2 : t2.styleSheet); + else for (const e3 of o3) { + const o4 = document.createElement("style"), n4 = t.litNonce; + void 0 !== n4 && o4.setAttribute("nonce", n4), o4.textContent = e3.cssText, s2.appendChild(o4); + } +}; +var c = e ? (t2) => t2 : (t2) => t2 instanceof CSSStyleSheet ? ((t3) => { + let e3 = ""; + for (const s2 of t3.cssRules) e3 += s2.cssText; + return r(e3); +})(t2) : t2; + +// node_modules/@lit/reactive-element/reactive-element.js +var { is: i2, defineProperty: e2, getOwnPropertyDescriptor: r2, getOwnPropertyNames: h, getOwnPropertySymbols: o2, getPrototypeOf: n2 } = Object; +var a = globalThis; +var c2 = a.trustedTypes; +var l = c2 ? c2.emptyScript : ""; +var p = a.reactiveElementPolyfillSupport; +var d = (t2, s2) => t2; +var u = { toAttribute(t2, s2) { + switch (s2) { + case Boolean: + t2 = t2 ? l : null; + break; + case Object: + case Array: + t2 = null == t2 ? t2 : JSON.stringify(t2); + } + return t2; +}, fromAttribute(t2, s2) { + let i3 = t2; + switch (s2) { + case Boolean: + i3 = null !== t2; + break; + case Number: + i3 = null === t2 ? null : Number(t2); + break; + case Object: + case Array: + try { + i3 = JSON.parse(t2); + } catch (t3) { + i3 = null; + } + } + return i3; +} }; +var f = (t2, s2) => !i2(t2, s2); +var y = { attribute: true, type: String, converter: u, reflect: false, hasChanged: f }; +Symbol.metadata ??= Symbol("metadata"), a.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap(); +var b = class extends HTMLElement { + static addInitializer(t2) { + this._$Ei(), (this.l ??= []).push(t2); + } + static get observedAttributes() { + return this.finalize(), this._$Eh && [...this._$Eh.keys()]; + } + static createProperty(t2, s2 = y) { + if (s2.state && (s2.attribute = false), this._$Ei(), this.elementProperties.set(t2, s2), !s2.noAccessor) { + const i3 = Symbol(), r3 = this.getPropertyDescriptor(t2, i3, s2); + void 0 !== r3 && e2(this.prototype, t2, r3); + } + } + static getPropertyDescriptor(t2, s2, i3) { + const { get: e3, set: h4 } = r2(this.prototype, t2) ?? { get() { + return this[s2]; + }, set(t3) { + this[s2] = t3; + } }; + return { get() { + return e3?.call(this); + }, set(s3) { + const r3 = e3?.call(this); + h4.call(this, s3), this.requestUpdate(t2, r3, i3); + }, configurable: true, enumerable: true }; + } + static getPropertyOptions(t2) { + return this.elementProperties.get(t2) ?? y; + } + static _$Ei() { + if (this.hasOwnProperty(d("elementProperties"))) return; + const t2 = n2(this); + t2.finalize(), void 0 !== t2.l && (this.l = [...t2.l]), this.elementProperties = new Map(t2.elementProperties); + } + static finalize() { + if (this.hasOwnProperty(d("finalized"))) return; + if (this.finalized = true, this._$Ei(), this.hasOwnProperty(d("properties"))) { + const t3 = this.properties, s2 = [...h(t3), ...o2(t3)]; + for (const i3 of s2) this.createProperty(i3, t3[i3]); + } + const t2 = this[Symbol.metadata]; + if (null !== t2) { + const s2 = litPropertyMetadata.get(t2); + if (void 0 !== s2) for (const [t3, i3] of s2) this.elementProperties.set(t3, i3); + } + this._$Eh = /* @__PURE__ */ new Map(); + for (const [t3, s2] of this.elementProperties) { + const i3 = this._$Eu(t3, s2); + void 0 !== i3 && this._$Eh.set(i3, t3); + } + this.elementStyles = this.finalizeStyles(this.styles); + } + static finalizeStyles(s2) { + const i3 = []; + if (Array.isArray(s2)) { + const e3 = new Set(s2.flat(1 / 0).reverse()); + for (const s3 of e3) i3.unshift(c(s3)); + } else void 0 !== s2 && i3.push(c(s2)); + return i3; + } + static _$Eu(t2, s2) { + const i3 = s2.attribute; + return false === i3 ? void 0 : "string" == typeof i3 ? i3 : "string" == typeof t2 ? t2.toLowerCase() : void 0; + } + constructor() { + super(), this._$Ep = void 0, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev(); + } + _$Ev() { + this._$ES = new Promise((t2) => this.enableUpdating = t2), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((t2) => t2(this)); + } + addController(t2) { + (this._$EO ??= /* @__PURE__ */ new Set()).add(t2), void 0 !== this.renderRoot && this.isConnected && t2.hostConnected?.(); + } + removeController(t2) { + this._$EO?.delete(t2); + } + _$E_() { + const t2 = /* @__PURE__ */ new Map(), s2 = this.constructor.elementProperties; + for (const i3 of s2.keys()) this.hasOwnProperty(i3) && (t2.set(i3, this[i3]), delete this[i3]); + t2.size > 0 && (this._$Ep = t2); + } + createRenderRoot() { + const t2 = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions); + return S(t2, this.constructor.elementStyles), t2; + } + connectedCallback() { + this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach((t2) => t2.hostConnected?.()); + } + enableUpdating(t2) { + } + disconnectedCallback() { + this._$EO?.forEach((t2) => t2.hostDisconnected?.()); + } + attributeChangedCallback(t2, s2, i3) { + this._$AK(t2, i3); + } + _$EC(t2, s2) { + const i3 = this.constructor.elementProperties.get(t2), e3 = this.constructor._$Eu(t2, i3); + if (void 0 !== e3 && true === i3.reflect) { + const r3 = (void 0 !== i3.converter?.toAttribute ? i3.converter : u).toAttribute(s2, i3.type); + this._$Em = t2, null == r3 ? this.removeAttribute(e3) : this.setAttribute(e3, r3), this._$Em = null; + } + } + _$AK(t2, s2) { + const i3 = this.constructor, e3 = i3._$Eh.get(t2); + if (void 0 !== e3 && this._$Em !== e3) { + const t3 = i3.getPropertyOptions(e3), r3 = "function" == typeof t3.converter ? { fromAttribute: t3.converter } : void 0 !== t3.converter?.fromAttribute ? t3.converter : u; + this._$Em = e3, this[e3] = r3.fromAttribute(s2, t3.type), this._$Em = null; + } + } + requestUpdate(t2, s2, i3) { + if (void 0 !== t2) { + if (i3 ??= this.constructor.getPropertyOptions(t2), !(i3.hasChanged ?? f)(this[t2], s2)) return; + this.P(t2, s2, i3); + } + false === this.isUpdatePending && (this._$ES = this._$ET()); + } + P(t2, s2, i3) { + this._$AL.has(t2) || this._$AL.set(t2, s2), true === i3.reflect && this._$Em !== t2 && (this._$Ej ??= /* @__PURE__ */ new Set()).add(t2); + } + async _$ET() { + this.isUpdatePending = true; + try { + await this._$ES; + } catch (t3) { + Promise.reject(t3); + } + const t2 = this.scheduleUpdate(); + return null != t2 && await t2, !this.isUpdatePending; + } + scheduleUpdate() { + return this.performUpdate(); + } + performUpdate() { + if (!this.isUpdatePending) return; + if (!this.hasUpdated) { + if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) { + for (const [t4, s3] of this._$Ep) this[t4] = s3; + this._$Ep = void 0; + } + const t3 = this.constructor.elementProperties; + if (t3.size > 0) for (const [s3, i3] of t3) true !== i3.wrapped || this._$AL.has(s3) || void 0 === this[s3] || this.P(s3, this[s3], i3); + } + let t2 = false; + const s2 = this._$AL; + try { + t2 = this.shouldUpdate(s2), t2 ? (this.willUpdate(s2), this._$EO?.forEach((t3) => t3.hostUpdate?.()), this.update(s2)) : this._$EU(); + } catch (s3) { + throw t2 = false, this._$EU(), s3; + } + t2 && this._$AE(s2); + } + willUpdate(t2) { + } + _$AE(t2) { + this._$EO?.forEach((t3) => t3.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t2)), this.updated(t2); + } + _$EU() { + this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = false; + } + get updateComplete() { + return this.getUpdateComplete(); + } + getUpdateComplete() { + return this._$ES; + } + shouldUpdate(t2) { + return true; + } + update(t2) { + this._$Ej &&= this._$Ej.forEach((t3) => this._$EC(t3, this[t3])), this._$EU(); + } + updated(t2) { + } + firstUpdated(t2) { + } +}; +b.elementStyles = [], b.shadowRootOptions = { mode: "open" }, b[d("elementProperties")] = /* @__PURE__ */ new Map(), b[d("finalized")] = /* @__PURE__ */ new Map(), p?.({ ReactiveElement: b }), (a.reactiveElementVersions ??= []).push("2.0.4"); + +// node_modules/lit-html/lit-html.js +var n3 = globalThis; +var c3 = n3.trustedTypes; +var h2 = c3 ? c3.createPolicy("lit-html", { createHTML: (t2) => t2 }) : void 0; +var f2 = "$lit$"; +var v = `lit$${Math.random().toFixed(9).slice(2)}$`; +var m = "?" + v; +var _ = `<${m}>`; +var w = document; +var lt = () => w.createComment(""); +var st = (t2) => null === t2 || "object" != typeof t2 && "function" != typeof t2; +var g = Array.isArray; +var $ = (t2) => g(t2) || "function" == typeof t2?.[Symbol.iterator]; +var x = "[ \n\f\r]"; +var T = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g; +var E = /-->/g; +var k = />/g; +var O = RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`, "g"); +var S2 = /'/g; +var j = /"/g; +var M = /^(?:script|style|textarea|title)$/i; +var P = (t2) => (i3, ...s2) => ({ _$litType$: t2, strings: i3, values: s2 }); +var ke = P(1); +var Oe = P(2); +var Se = P(3); +var R = Symbol.for("lit-noChange"); +var D = Symbol.for("lit-nothing"); +var V = /* @__PURE__ */ new WeakMap(); +var I = w.createTreeWalker(w, 129); +function N(t2, i3) { + if (!g(t2) || !t2.hasOwnProperty("raw")) throw Error("invalid template strings array"); + return void 0 !== h2 ? h2.createHTML(i3) : i3; +} +var U = (t2, i3) => { + const s2 = t2.length - 1, e3 = []; + let h4, o3 = 2 === i3 ? "" : 3 === i3 ? "" : "", n4 = T; + for (let i4 = 0; i4 < s2; i4++) { + const s3 = t2[i4]; + let r3, l2, c4 = -1, a2 = 0; + for (; a2 < s3.length && (n4.lastIndex = a2, l2 = n4.exec(s3), null !== l2); ) a2 = n4.lastIndex, n4 === T ? "!--" === l2[1] ? n4 = E : void 0 !== l2[1] ? n4 = k : void 0 !== l2[2] ? (M.test(l2[2]) && (h4 = RegExp("" === l2[0] ? (n4 = h4 ?? T, c4 = -1) : void 0 === l2[1] ? c4 = -2 : (c4 = n4.lastIndex - l2[2].length, r3 = l2[1], n4 = void 0 === l2[3] ? O : '"' === l2[3] ? j : S2) : n4 === j || n4 === S2 ? n4 = O : n4 === E || n4 === k ? n4 = T : (n4 = O, h4 = void 0); + const u2 = n4 === O && t2[i4 + 1].startsWith("/>") ? " " : ""; + o3 += n4 === T ? s3 + _ : c4 >= 0 ? (e3.push(r3), s3.slice(0, c4) + f2 + s3.slice(c4) + v + u2) : s3 + v + (-2 === c4 ? i4 : u2); + } + return [N(t2, o3 + (t2[s2] || "") + (2 === i3 ? "" : 3 === i3 ? "" : "")), e3]; +}; +var B = class _B { + constructor({ strings: t2, _$litType$: i3 }, s2) { + let e3; + this.parts = []; + let h4 = 0, o3 = 0; + const n4 = t2.length - 1, r3 = this.parts, [l2, a2] = U(t2, i3); + if (this.el = _B.createElement(l2, s2), I.currentNode = this.el.content, 2 === i3 || 3 === i3) { + const t3 = this.el.content.firstChild; + t3.replaceWith(...t3.childNodes); + } + for (; null !== (e3 = I.nextNode()) && r3.length < n4; ) { + if (1 === e3.nodeType) { + if (e3.hasAttributes()) for (const t3 of e3.getAttributeNames()) if (t3.endsWith(f2)) { + const i4 = a2[o3++], s3 = e3.getAttribute(t3).split(v), n5 = /([.?@])?(.*)/.exec(i4); + r3.push({ type: 1, index: h4, name: n5[2], strings: s3, ctor: "." === n5[1] ? Y : "?" === n5[1] ? Z : "@" === n5[1] ? q : G }), e3.removeAttribute(t3); + } else t3.startsWith(v) && (r3.push({ type: 6, index: h4 }), e3.removeAttribute(t3)); + if (M.test(e3.tagName)) { + const t3 = e3.textContent.split(v), i4 = t3.length - 1; + if (i4 > 0) { + e3.textContent = c3 ? c3.emptyScript : ""; + for (let s3 = 0; s3 < i4; s3++) e3.append(t3[s3], lt()), I.nextNode(), r3.push({ type: 2, index: ++h4 }); + e3.append(t3[i4], lt()); + } + } + } else if (8 === e3.nodeType) if (e3.data === m) r3.push({ type: 2, index: h4 }); + else { + let t3 = -1; + for (; -1 !== (t3 = e3.data.indexOf(v, t3 + 1)); ) r3.push({ type: 7, index: h4 }), t3 += v.length - 1; + } + h4++; + } + } + static createElement(t2, i3) { + const s2 = w.createElement("template"); + return s2.innerHTML = t2, s2; + } +}; +function z(t2, i3, s2 = t2, e3) { + if (i3 === R) return i3; + let h4 = void 0 !== e3 ? s2.o?.[e3] : s2.l; + const o3 = st(i3) ? void 0 : i3._$litDirective$; + return h4?.constructor !== o3 && (h4?._$AO?.(false), void 0 === o3 ? h4 = void 0 : (h4 = new o3(t2), h4._$AT(t2, s2, e3)), void 0 !== e3 ? (s2.o ??= [])[e3] = h4 : s2.l = h4), void 0 !== h4 && (i3 = z(t2, h4._$AS(t2, i3.values), h4, e3)), i3; +} +var F = class { + constructor(t2, i3) { + this._$AV = [], this._$AN = void 0, this._$AD = t2, this._$AM = i3; + } + get parentNode() { + return this._$AM.parentNode; + } + get _$AU() { + return this._$AM._$AU; + } + u(t2) { + const { el: { content: i3 }, parts: s2 } = this._$AD, e3 = (t2?.creationScope ?? w).importNode(i3, true); + I.currentNode = e3; + let h4 = I.nextNode(), o3 = 0, n4 = 0, r3 = s2[0]; + for (; void 0 !== r3; ) { + if (o3 === r3.index) { + let i4; + 2 === r3.type ? i4 = new et(h4, h4.nextSibling, this, t2) : 1 === r3.type ? i4 = new r3.ctor(h4, r3.name, r3.strings, this, t2) : 6 === r3.type && (i4 = new K(h4, this, t2)), this._$AV.push(i4), r3 = s2[++n4]; + } + o3 !== r3?.index && (h4 = I.nextNode(), o3++); + } + return I.currentNode = w, e3; + } + p(t2) { + let i3 = 0; + for (const s2 of this._$AV) void 0 !== s2 && (void 0 !== s2.strings ? (s2._$AI(t2, s2, i3), i3 += s2.strings.length - 2) : s2._$AI(t2[i3])), i3++; + } +}; +var et = class _et { + get _$AU() { + return this._$AM?._$AU ?? this.v; + } + constructor(t2, i3, s2, e3) { + this.type = 2, this._$AH = D, this._$AN = void 0, this._$AA = t2, this._$AB = i3, this._$AM = s2, this.options = e3, this.v = e3?.isConnected ?? true; + } + get parentNode() { + let t2 = this._$AA.parentNode; + const i3 = this._$AM; + return void 0 !== i3 && 11 === t2?.nodeType && (t2 = i3.parentNode), t2; + } + get startNode() { + return this._$AA; + } + get endNode() { + return this._$AB; + } + _$AI(t2, i3 = this) { + t2 = z(this, t2, i3), st(t2) ? t2 === D || null == t2 || "" === t2 ? (this._$AH !== D && this._$AR(), this._$AH = D) : t2 !== this._$AH && t2 !== R && this._(t2) : void 0 !== t2._$litType$ ? this.$(t2) : void 0 !== t2.nodeType ? this.T(t2) : $(t2) ? this.k(t2) : this._(t2); + } + O(t2) { + return this._$AA.parentNode.insertBefore(t2, this._$AB); + } + T(t2) { + this._$AH !== t2 && (this._$AR(), this._$AH = this.O(t2)); + } + _(t2) { + this._$AH !== D && st(this._$AH) ? this._$AA.nextSibling.data = t2 : this.T(w.createTextNode(t2)), this._$AH = t2; + } + $(t2) { + const { values: i3, _$litType$: s2 } = t2, e3 = "number" == typeof s2 ? this._$AC(t2) : (void 0 === s2.el && (s2.el = B.createElement(N(s2.h, s2.h[0]), this.options)), s2); + if (this._$AH?._$AD === e3) this._$AH.p(i3); + else { + const t3 = new F(e3, this), s3 = t3.u(this.options); + t3.p(i3), this.T(s3), this._$AH = t3; + } + } + _$AC(t2) { + let i3 = V.get(t2.strings); + return void 0 === i3 && V.set(t2.strings, i3 = new B(t2)), i3; + } + k(t2) { + g(this._$AH) || (this._$AH = [], this._$AR()); + const i3 = this._$AH; + let s2, e3 = 0; + for (const h4 of t2) e3 === i3.length ? i3.push(s2 = new _et(this.O(lt()), this.O(lt()), this, this.options)) : s2 = i3[e3], s2._$AI(h4), e3++; + e3 < i3.length && (this._$AR(s2 && s2._$AB.nextSibling, e3), i3.length = e3); + } + _$AR(t2 = this._$AA.nextSibling, i3) { + for (this._$AP?.(false, true, i3); t2 && t2 !== this._$AB; ) { + const i4 = t2.nextSibling; + t2.remove(), t2 = i4; + } + } + setConnected(t2) { + void 0 === this._$AM && (this.v = t2, this._$AP?.(t2)); + } +}; +var G = class { + get tagName() { + return this.element.tagName; + } + get _$AU() { + return this._$AM._$AU; + } + constructor(t2, i3, s2, e3, h4) { + this.type = 1, this._$AH = D, this._$AN = void 0, this.element = t2, this.name = i3, this._$AM = e3, this.options = h4, s2.length > 2 || "" !== s2[0] || "" !== s2[1] ? (this._$AH = Array(s2.length - 1).fill(new String()), this.strings = s2) : this._$AH = D; + } + _$AI(t2, i3 = this, s2, e3) { + const h4 = this.strings; + let o3 = false; + if (void 0 === h4) t2 = z(this, t2, i3, 0), o3 = !st(t2) || t2 !== this._$AH && t2 !== R, o3 && (this._$AH = t2); + else { + const e4 = t2; + let n4, r3; + for (t2 = h4[0], n4 = 0; n4 < h4.length - 1; n4++) r3 = z(this, e4[s2 + n4], i3, n4), r3 === R && (r3 = this._$AH[n4]), o3 ||= !st(r3) || r3 !== this._$AH[n4], r3 === D ? t2 = D : t2 !== D && (t2 += (r3 ?? "") + h4[n4 + 1]), this._$AH[n4] = r3; + } + o3 && !e3 && this.j(t2); + } + j(t2) { + t2 === D ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t2 ?? ""); + } +}; +var Y = class extends G { + constructor() { + super(...arguments), this.type = 3; + } + j(t2) { + this.element[this.name] = t2 === D ? void 0 : t2; + } +}; +var Z = class extends G { + constructor() { + super(...arguments), this.type = 4; + } + j(t2) { + this.element.toggleAttribute(this.name, !!t2 && t2 !== D); + } +}; +var q = class extends G { + constructor(t2, i3, s2, e3, h4) { + super(t2, i3, s2, e3, h4), this.type = 5; + } + _$AI(t2, i3 = this) { + if ((t2 = z(this, t2, i3, 0) ?? D) === R) return; + const s2 = this._$AH, e3 = t2 === D && s2 !== D || t2.capture !== s2.capture || t2.once !== s2.once || t2.passive !== s2.passive, h4 = t2 !== D && (s2 === D || e3); + e3 && this.element.removeEventListener(this.name, this, s2), h4 && this.element.addEventListener(this.name, this, t2), this._$AH = t2; + } + handleEvent(t2) { + "function" == typeof this._$AH ? this._$AH.call(this.options?.host ?? this.element, t2) : this._$AH.handleEvent(t2); + } +}; +var K = class { + constructor(t2, i3, s2) { + this.element = t2, this.type = 6, this._$AN = void 0, this._$AM = i3, this.options = s2; + } + get _$AU() { + return this._$AM._$AU; + } + _$AI(t2) { + z(this, t2); + } +}; +var Re = n3.litHtmlPolyfillSupport; +Re?.(B, et), (n3.litHtmlVersions ??= []).push("3.2.0"); +var Q = (t2, i3, s2) => { + const e3 = s2?.renderBefore ?? i3; + let h4 = e3._$litPart$; + if (void 0 === h4) { + const t3 = s2?.renderBefore ?? null; + e3._$litPart$ = h4 = new et(i3.insertBefore(lt(), t3), t3, void 0, s2 ?? {}); + } + return h4._$AI(t2), h4; +}; + +// node_modules/lit-element/lit-element.js +var h3 = class extends b { + constructor() { + super(...arguments), this.renderOptions = { host: this }, this.o = void 0; + } + createRenderRoot() { + const t2 = super.createRenderRoot(); + return this.renderOptions.renderBefore ??= t2.firstChild, t2; + } + update(t2) { + const e3 = this.render(); + this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t2), this.o = Q(e3, this.renderRoot, this.renderOptions); + } + connectedCallback() { + super.connectedCallback(), this.o?.setConnected(true); + } + disconnectedCallback() { + super.disconnectedCallback(), this.o?.setConnected(false); + } + render() { + return R; + } +}; +h3._$litElement$ = true, h3["finalized"] = true, globalThis.litElementHydrateSupport?.({ LitElement: h3 }); +var f3 = globalThis.litElementPolyfillSupport; +f3?.({ LitElement: h3 }); +(globalThis.litElementVersions ??= []).push("4.1.0"); + +// js/ipywidgets_styles.ts +var legacyStyles = i` .legacy-button { align-items: center; background-color: var(--jp-layout-color2); @@ -53,7 +596,10 @@ var R=globalThis,N=R.ShadowRoot&&(R.ShadyCSS===void 0||R.ShadyCSS.nativeShadow)& height: var(--jp-widgets-inline-height); line-height: var(--jp-widgets-inline-height); } -`;export{qt as legacyStyles}; +`; +export { + legacyStyles +}; /*! Bundled license information: @lit/reactive-element/css-tag.js: @@ -91,3 +637,4 @@ lit-html/is-server.js: * SPDX-License-Identifier: BSD-3-Clause *) */ +//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vbm9kZV9tb2R1bGVzL0BsaXQvcmVhY3RpdmUtZWxlbWVudC9zcmMvY3NzLXRhZy50cyIsICIuLi8uLi9ub2RlX21vZHVsZXMvQGxpdC9yZWFjdGl2ZS1lbGVtZW50L3NyYy9yZWFjdGl2ZS1lbGVtZW50LnRzIiwgIi4uLy4uL25vZGVfbW9kdWxlcy9saXQtaHRtbC9zcmMvbGl0LWh0bWwudHMiLCAiLi4vLi4vbm9kZV9tb2R1bGVzL2xpdC1lbGVtZW50L3NyYy9saXQtZWxlbWVudC50cyIsICIuLi8uLi9qcy9pcHl3aWRnZXRzX3N0eWxlcy50cyJdLAogICJzb3VyY2VzQ29udGVudCI6IFsiLyoqXG4gKiBAbGljZW5zZVxuICogQ29weXJpZ2h0IDIwMTkgR29vZ2xlIExMQ1xuICogU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IEJTRC0zLUNsYXVzZVxuICovXG5cbmNvbnN0IE5PREVfTU9ERSA9IGZhbHNlO1xuXG4vLyBBbGxvd3MgbWluaWZpZXJzIHRvIHJlbmFtZSByZWZlcmVuY2VzIHRvIGdsb2JhbFRoaXNcbmNvbnN0IGdsb2JhbCA9IGdsb2JhbFRoaXM7XG5cbi8qKlxuICogV2hldGhlciB0aGUgY3VycmVudCBicm93c2VyIHN1cHBvcnRzIGBhZG9wdGVkU3R5bGVTaGVldHNgLlxuICovXG5leHBvcnQgY29uc3Qgc3VwcG9ydHNBZG9wdGluZ1N0eWxlU2hlZXRzOiBib29sZWFuID1cbiAgZ2xvYmFsLlNoYWRvd1Jvb3QgJiZcbiAgKGdsb2JhbC5TaGFkeUNTUyA9PT0gdW5kZWZpbmVkIHx8IGdsb2JhbC5TaGFkeUNTUy5uYXRpdmVTaGFkb3cpICYmXG4gICdh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zdCh0YWcpICYmXG4gICAgICAgICAgICAobm9kZSBhcyBFbGVtZW50KS5pbm5lckhUTUwuaW5jbHVkZXMobWFya2VyKVxuICAgICAgICAgICkge1xuICAgICAgICAgICAgY29uc3QgbSA9XG4gICAgICAgICAgICAgIGBFeHByZXNzaW9ucyBhcmUgbm90IHN1cHBvcnRlZCBpbnNpZGUgXFxgJHt0YWd9XFxgIGAgK1xuICAgICAgICAgICAgICBgZWxlbWVudHMuIFNlZSBodHRwczovL2xpdC5kZXYvbXNnL2V4cHJlc3Npb24taW4tJHt0YWd9IGZvciBtb3JlIGAgK1xuICAgICAgICAgICAgICBgaW5mb3JtYXRpb24uYDtcbiAgICAgICAgICAgIGlmICh0YWcgPT09ICd0ZW1wbGF0ZScpIHtcbiAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKG0pO1xuICAgICAgICAgICAgfSBlbHNlIGlzc3VlV2FybmluZygnJywgbSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIC8vIFRPRE8gKGp1c3RpbmZhZ25hbmkpOiBmb3IgYXR0ZW1wdGVkIGR5bmFtaWMgdGFnIG5hbWVzLCB3ZSBkb24ndFxuICAgICAgICAvLyBpbmNyZW1lbnQgdGhlIGJpbmRpbmdJbmRleCwgYW5kIGl0J2xsIGJlIG9mZiBieSAxIGluIHRoZSBlbGVtZW50XG4gICAgICAgIC8vIGFuZCBvZmYgYnkgdHdvIGFmdGVyIGl0LlxuICAgICAgICBpZiAoKG5vZGUgYXMgRWxlbWVudCkuaGFzQXR0cmlidXRlcygpKSB7XG4gICAgICAgICAgZm9yIChjb25zdCBuYW1lIG9mIChub2RlIGFzIEVsZW1lbnQpLmdldEF0dHJpYnV0ZU5hbWVzKCkpIHtcbiAgICAgICAgICAgIGlmIChuYW1lLmVuZHNXaXRoKGJvdW5kQXR0cmlidXRlU3VmZml4KSkge1xuICAgICAgICAgICAgICBjb25zdCByZWFsTmFtZSA9IGF0dHJOYW1lc1thdHRyTmFtZUluZGV4KytdO1xuICAgICAgICAgICAgICBjb25zdCB2YWx1ZSA9IChub2RlIGFzIEVsZW1lbnQpLmdldEF0dHJpYnV0ZShuYW1lKSE7XG4gICAgICAgICAgICAgIGNvbnN0IHN0YXRpY3MgPSB2YWx1ZS5zcGxpdChtYXJrZXIpO1xuICAgICAgICAgICAgICBjb25zdCBtID0gLyhbLj9AXSk/KC4qKS8uZXhlYyhyZWFsTmFtZSkhO1xuICAgICAgICAgICAgICBwYXJ0cy5wdXNoKHtcbiAgICAgICAgICAgICAgICB0eXBlOiBBVFRSSUJVVEVfUEFSVCxcbiAgICAgICAgICAgICAgICBpbmRleDogbm9kZUluZGV4LFxuICAgICAgICAgICAgICAgIG5hbWU6IG1bMl0sXG4gICAgICAgICAgICAgICAgc3RyaW5nczogc3RhdGljcyxcbiAgICAgICAgICAgICAgICBjdG9yOlxuICAgICAgICAgICAgICAgICAgbVsxXSA9PT0gJy4nXG4gICAgICAgICAgICAgICAgICAgID8gUHJvcGVydHlQYXJ0XG4gICAgICAgICAgICAgICAgICAgIDogbVsxXSA9PT0gJz8nXG4gICAgICAgICAgICAgICAgICAgICAgPyBCb29sZWFuQXR0cmlidXRlUGFydFxuICAgICAgICAgICAgICAgICAgICAgIDogbVsxXSA9PT0gJ0AnXG4gICAgICAgICAgICAgICAgICAgICAgICA/IEV2ZW50UGFydFxuICAgICAgICAgICAgICAgICAgICAgICAgOiBBdHRyaWJ1dGVQYXJ0LFxuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgKG5vZGUgYXMgRWxlbWVudCkucmVtb3ZlQXR0cmlidXRlKG5hbWUpO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChuYW1lLnN0YXJ0c1dpdGgobWFya2VyKSkge1xuICAgICAgICAgICAgICBwYXJ0cy5wdXNoKHtcbiAgICAgICAgICAgICAgICB0eXBlOiBFTEVNRU5UX1BBUlQsXG4gICAgICAgICAgICAgICAgaW5kZXg6IG5vZGVJbmRleCxcbiAgIC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ZhbHVlKTtcbiAgICB9XG4gIH1cblxuICAvKiogQGludGVybmFsICovXG4gIF9jb21taXRWYWx1ZSh2YWx1ZTogdW5rbm93bikge1xuICAgIGlmICh2YWx1ZSA9PT0gbm90aGluZykge1xuICAgICAgKHdyYXAodGhpcy5lbGVtZW50KSBhcyBFbGVtZW50KS5yZW1vdmVBdHRyaWJ1dGUodGhpcy5uYW1lKTtcbiAgICB9IGVsc2Uge1xuICAgICAgaWYgKEVOQUJMRV9FWFRSQV9TRUNVUklUWV9IT09LUykge1xuICAgICAgICBpZiAodGhpcy5fc2FuaXRpemVyID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICB0aGlzLl9zYW5pdGl6ZXIgPSBzYW5pdGl6ZXJGYWN0b3J5SW50ZXJuYWwoXG4gICAgICAgICAgICB0aGlzLmVsZW1lbnQsXG4gICAgICAgICAgICB0aGlzLm5hbWUsXG4gICAgICAgICAgICAnYXR0cmlidXRlJyxcbiAgICAgICAgICApO1xuICAgICAgICB9XG4gICAgICAgIHZhbHVlID0gdGhpcy5fc2FuaXRpemVyKHZhbHVlID8/ICcnKTtcbiAgICAgIH1cbiAgICAgIGRlYnVnTG9nRXZlbnQgJiZcbiAgICAgICAgZGVidWdMb2dFdmVudCh7XG4gICAgICAgICAga2luZDogJ2NvbW1pdCBhdHRyaWJ1dGUnLFxuICAgICAgICAgIGVsZW1lbnQ6IHRoaXMuZWxlbWVudCxcbiAgICAgICAgICBuYW1lOiB0aGlzLm5hbWUsXG4gICAgICAgICAgdmFsdWUsXG4gICAgICAgICAgb3B0aW9uczogdGhpcy5vcHRpb25zLFxuICAgICAgICB9KTtcbiAgICAgICh3cmFwKHRoaXMuZWxlbWVudCkgYXMgRWxlbWVudCkuc2V0QXR0cmlidXRlKFxuICAgICAgICB0aGlzLm5hbWUsXG4gICAgICAgICh2YWx1ZSA/PyAnJykgYXMgc3RyaW5nLFxuICAgICAgKTtcbiAgICB9XG4gIH1cbn1cblxuZXhwb3J0IHR5cGUge1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N0ZW5lciIsICJldmVudCIsICJjYWxsIiwgImhvc3QiLCAiaGFuZGxlRXZlbnQiLCAicG9seWZpbGxTdXBwb3J0IiwgImdsb2JhbCIsICJsaXRIdG1sUG9seWZpbGxTdXBwb3J0IiwgIlRlbXBsYXRlIiwgIkNoaWxkUGFydCIsICJsaXRIdG1sVmVyc2lvbnMiLCAicHVzaCIsICJyZW5kZXIiLCAidmFsdWUiLCAiY29udGFpbmVyIiwgIm9wdGlvbnMiLCAicGFydE93bmVyTm9kZSIsICJyZW5kZXJCZWZvcmUiLCAicGFydCIsICJlbmROb2RlIiwgImluc2VydEJlZm9yZSIsICJjcmVhdGVNYXJrZXIiLCAiXyRzZXRWYWx1ZSIsICJMaXRFbGVtZW50IiwgIlJlYWN0aXZlRWxlbWVudCIsICJjb25zdHJ1Y3RvciIsICJ0aGlzIiwgInJlbmRlck9wdGlvbnMiLCAiaG9zdCIsICJfX2NoaWxkUGFydCIsICJjcmVhdGVSZW5kZXJSb290IiwgInJlbmRlclJvb3QiLCAic3VwZXIiLCAicmVuZGVyQmVmb3JlIiwgImZpcnN0Q2hpbGQiLCAiY2hhbmdlZFByb3BlcnRpZXMiLCAidmFsdWUiLCAicmVuZGVyIiwgImhhc1VwZGF0ZWQiLCAiaXNDb25uZWN0ZWQiLCAidXBkYXRlIiwgImNvbm5lY3RlZENhbGxiYWNrIiwgInNldENvbm5lY3RlZCIsICJkaXNjb25uZWN0ZWRDYWxsYmFjayIsICJub0NoYW5nZSIsICJnbG9iYWxUaGlzIiwgImxpdEVsZW1lbnRIeWRyYXRlU3VwcG9ydCIsICJwb2x5ZmlsbFN1cHBvcnQiLCAibGl0RWxlbWVudFBvbHlmaWxsU3VwcG9ydCIsICJnbG9iYWxUaGlzIiwgImxpdEVsZW1lbnRWZXJzaW9ucyIsICJwdXNoIl0KfQo= diff --git a/geemap/static/layer_manager.css b/geemap/static/layer_manager.css index 04ef49523b..153c430c38 100644 --- a/geemap/static/layer_manager.css +++ b/geemap/static/layer_manager.css @@ -1 +1,4 @@ -@import"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined"; +@import "https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined"; + +/* js/common.css */ +/*# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFtdLAogICJzb3VyY2VzQ29udGVudCI6IFtdLAogICJtYXBwaW5ncyI6ICIiLAogICJuYW1lcyI6IFtdCn0K */ diff --git a/geemap/static/layer_manager.js b/geemap/static/layer_manager.js index b27896c6f1..6c87933c13 100644 --- a/geemap/static/layer_manager.js +++ b/geemap/static/layer_manager.js @@ -1,6 +1,590 @@ -var At=Object.defineProperty;var vt=Object.getOwnPropertyDescriptor;var st=(r,t,e,s)=>{for(var i=s>1?void 0:s?vt(t,e):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(i=(s?n(t,e,i):n(i))||i);return s&&i&&At(t,e,i),i};var T=globalThis,k=T.ShadowRoot&&(T.ShadyCSS===void 0||T.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,V=Symbol(),it=new WeakMap,x=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==V)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(k&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=it.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&it.set(e,t))}return t}toString(){return this.cssText}},rt=r=>new x(typeof r=="string"?r:r+"",void 0,V),w=(r,...t)=>{let e=r.length===1?r[0]:t.reduce((s,i,o)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[o+1],r[0]);return new x(e,r,V)},B=(r,t)=>{if(k)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=T.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s)}},j=k?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return rt(e)})(r):r;var{is:bt,defineProperty:St,getOwnPropertyDescriptor:Et,getOwnPropertyNames:xt,getOwnPropertySymbols:wt,getPrototypeOf:Ct}=Object,L=globalThis,ot=L.trustedTypes,Pt=ot?ot.emptyScript:"",Mt=L.reactiveElementPolyfillSupport,C=(r,t)=>r,P={toAttribute(r,t){switch(t){case Boolean:r=r?Pt:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},z=(r,t)=>!bt(r,t),nt={attribute:!0,type:String,converter:P,reflect:!1,hasChanged:z};Symbol.metadata??=Symbol("metadata"),L.litPropertyMetadata??=new WeakMap;var m=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=nt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&St(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:o}=Et(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i?.call(this)},set(n){let h=i?.call(this);o.call(this,n),this.requestUpdate(t,h,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??nt}static _$Ei(){if(this.hasOwnProperty(C("elementProperties")))return;let t=Ct(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(C("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(C("properties"))){let e=this.properties,s=[...xt(e),...wt(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(j(i))}else t!==void 0&&e.push(j(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return B(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let o=(s.converter?.toAttribute!==void 0?s.converter:P).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let o=s.getPropertyOptions(i),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:P;this._$Em=i,this[i]=n.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??z)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,o]of this._$Ep)this[i]=o;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,o]of s)o.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],o)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};m.elementStyles=[],m.shadowRootOptions={mode:"open"},m[C("elementProperties")]=new Map,m[C("finalized")]=new Map,Mt?.({ReactiveElement:m}),(L.reactiveElementVersions??=[]).push("2.0.4");var X=globalThis,I=X.trustedTypes,at=I?I.createPolicy("lit-html",{createHTML:r=>r}):void 0,ut="$lit$",g=`lit$${Math.random().toFixed(9).slice(2)}$`,mt="?"+g,Ut=`<${mt}>`,A=document,U=()=>A.createComment(""),N=r=>r===null||typeof r!="object"&&typeof r!="function",Y=Array.isArray,Nt=r=>Y(r)||typeof r?.[Symbol.iterator]=="function",W=`[ -\f\r]`,M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,lt=/-->/g,ht=/>/g,$=RegExp(`>|${W}(?:([^\\s"'>=/]+)(${W}*=${W}*(?:[^ -\f\r"'\`<>=]|("|')|))|$)`,"g"),ct=/'/g,dt=/"/g,ft=/^(?:script|style|textarea|title)$/i,G=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),gt=G(1),Bt=G(2),Wt=G(3),v=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),pt=new WeakMap,_=A.createTreeWalker(A,129);function yt(r,t){if(!Y(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return at!==void 0?at.createHTML(t):t}var Ot=(r,t)=>{let e=r.length-1,s=[],i,o=t===2?"":t===3?"":"",n=M;for(let h=0;h"?(n=i??M,l=-1):p[1]===void 0?l=-2:(l=n.lastIndex-p[2].length,c=p[1],n=p[3]===void 0?$:p[3]==='"'?dt:ct):n===dt||n===ct?n=$:n===lt||n===ht?n=M:(n=$,i=void 0);let f=n===$&&r[h+1].startsWith("/>")?" ":"";o+=n===M?a+Ut:l>=0?(s.push(c),a.slice(0,l)+ut+a.slice(l)+g+f):a+g+(l===-2?h:f)}return[yt(r,o+(r[e]||"")+(t===2?"":t===3?"":"")),s]},O=class r{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let o=0,n=0,h=t.length-1,a=this.parts,[c,p]=Ot(t,e);if(this.el=r.createElement(c,s),_.currentNode=this.el.content,e===2||e===3){let l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(i=_.nextNode())!==null&&a.length0){i.textContent=I?I.emptyScript:"";for(let f=0;f2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=d}_$AI(t,e=this,s,i){let o=this.strings,n=!1;if(o===void 0)t=b(this,t,e,0),n=!N(t)||t!==this._$AH&&t!==v,n&&(this._$AH=t);else{let h=t,a,c;for(t=o[0],a=0;a{let s=e?.renderBefore??t,i=s._$litPart$;if(i===void 0){let o=e?.renderBefore??null;s._$litPart$=i=new R(t.insertBefore(U(),o),o,void 0,e??{})}return i._$AI(r),i};var y=class extends m{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=$t(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return v}};y._$litElement$=!0,y.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:y});var Ht=globalThis.litElementPolyfillSupport;Ht?.({LitElement:y});(globalThis.litElementVersions??=[]).push("4.1.0");var Tt={attribute:!0,type:String,converter:P,reflect:!1,hasChanged:z},kt=(r=Tt,t,e)=>{let{kind:s,metadata:i}=e,o=globalThis.litPropertyMetadata.get(i);if(o===void 0&&globalThis.litPropertyMetadata.set(i,o=new Map),o.set(e.name,r),s==="accessor"){let{name:n}=e;return{set(h){let a=t.get.call(this);t.set.call(this,h),this.requestUpdate(n,a,r)},init(h){return h!==void 0&&this.P(n,void 0,r),h}}}if(s==="setter"){let{name:n}=e;return function(h){let a=this[n];t.call(this,h),this.requestUpdate(n,a,r)}}throw Error("Unsupported decorator location: "+s)};function tt(r){return(t,e)=>typeof e=="object"?kt(r,t,e):((s,i,o)=>{let n=i.hasOwnProperty(o);return i.constructor.createProperty(o,n?{...s,wrapped:!0}:s),n?Object.getOwnPropertyDescriptor(i,o):void 0})(r,t,e)}var _t=w` +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __decorateClass = (decorators, target, key, kind) => { + var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target; + for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--) + if (decorator = decorators[i3]) + result = (kind ? decorator(target, key, result) : decorator(result)) || result; + if (kind && result) __defProp(target, key, result); + return result; +}; + +// node_modules/@lit/reactive-element/css-tag.js +var t = globalThis; +var e = t.ShadowRoot && (void 0 === t.ShadyCSS || t.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype; +var s = Symbol(); +var o = /* @__PURE__ */ new WeakMap(); +var n = class { + constructor(t2, e4, o4) { + if (this._$cssResult$ = true, o4 !== s) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead."); + this.cssText = t2, this.t = e4; + } + get styleSheet() { + let t2 = this.o; + const s2 = this.t; + if (e && void 0 === t2) { + const e4 = void 0 !== s2 && 1 === s2.length; + e4 && (t2 = o.get(s2)), void 0 === t2 && ((this.o = t2 = new CSSStyleSheet()).replaceSync(this.cssText), e4 && o.set(s2, t2)); + } + return t2; + } + toString() { + return this.cssText; + } +}; +var r = (t2) => new n("string" == typeof t2 ? t2 : t2 + "", void 0, s); +var i = (t2, ...e4) => { + const o4 = 1 === t2.length ? t2[0] : e4.reduce((e5, s2, o5) => e5 + ((t3) => { + if (true === t3._$cssResult$) return t3.cssText; + if ("number" == typeof t3) return t3; + throw Error("Value passed to 'css' function must be a 'css' function result: " + t3 + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security."); + })(s2) + t2[o5 + 1], t2[0]); + return new n(o4, t2, s); +}; +var S = (s2, o4) => { + if (e) s2.adoptedStyleSheets = o4.map((t2) => t2 instanceof CSSStyleSheet ? t2 : t2.styleSheet); + else for (const e4 of o4) { + const o5 = document.createElement("style"), n5 = t.litNonce; + void 0 !== n5 && o5.setAttribute("nonce", n5), o5.textContent = e4.cssText, s2.appendChild(o5); + } +}; +var c = e ? (t2) => t2 : (t2) => t2 instanceof CSSStyleSheet ? ((t3) => { + let e4 = ""; + for (const s2 of t3.cssRules) e4 += s2.cssText; + return r(e4); +})(t2) : t2; + +// node_modules/@lit/reactive-element/reactive-element.js +var { is: i2, defineProperty: e2, getOwnPropertyDescriptor: r2, getOwnPropertyNames: h, getOwnPropertySymbols: o2, getPrototypeOf: n2 } = Object; +var a = globalThis; +var c2 = a.trustedTypes; +var l = c2 ? c2.emptyScript : ""; +var p = a.reactiveElementPolyfillSupport; +var d = (t2, s2) => t2; +var u = { toAttribute(t2, s2) { + switch (s2) { + case Boolean: + t2 = t2 ? l : null; + break; + case Object: + case Array: + t2 = null == t2 ? t2 : JSON.stringify(t2); + } + return t2; +}, fromAttribute(t2, s2) { + let i3 = t2; + switch (s2) { + case Boolean: + i3 = null !== t2; + break; + case Number: + i3 = null === t2 ? null : Number(t2); + break; + case Object: + case Array: + try { + i3 = JSON.parse(t2); + } catch (t3) { + i3 = null; + } + } + return i3; +} }; +var f = (t2, s2) => !i2(t2, s2); +var y = { attribute: true, type: String, converter: u, reflect: false, hasChanged: f }; +Symbol.metadata ??= Symbol("metadata"), a.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap(); +var b = class extends HTMLElement { + static addInitializer(t2) { + this._$Ei(), (this.l ??= []).push(t2); + } + static get observedAttributes() { + return this.finalize(), this._$Eh && [...this._$Eh.keys()]; + } + static createProperty(t2, s2 = y) { + if (s2.state && (s2.attribute = false), this._$Ei(), this.elementProperties.set(t2, s2), !s2.noAccessor) { + const i3 = Symbol(), r4 = this.getPropertyDescriptor(t2, i3, s2); + void 0 !== r4 && e2(this.prototype, t2, r4); + } + } + static getPropertyDescriptor(t2, s2, i3) { + const { get: e4, set: h4 } = r2(this.prototype, t2) ?? { get() { + return this[s2]; + }, set(t3) { + this[s2] = t3; + } }; + return { get() { + return e4?.call(this); + }, set(s3) { + const r4 = e4?.call(this); + h4.call(this, s3), this.requestUpdate(t2, r4, i3); + }, configurable: true, enumerable: true }; + } + static getPropertyOptions(t2) { + return this.elementProperties.get(t2) ?? y; + } + static _$Ei() { + if (this.hasOwnProperty(d("elementProperties"))) return; + const t2 = n2(this); + t2.finalize(), void 0 !== t2.l && (this.l = [...t2.l]), this.elementProperties = new Map(t2.elementProperties); + } + static finalize() { + if (this.hasOwnProperty(d("finalized"))) return; + if (this.finalized = true, this._$Ei(), this.hasOwnProperty(d("properties"))) { + const t3 = this.properties, s2 = [...h(t3), ...o2(t3)]; + for (const i3 of s2) this.createProperty(i3, t3[i3]); + } + const t2 = this[Symbol.metadata]; + if (null !== t2) { + const s2 = litPropertyMetadata.get(t2); + if (void 0 !== s2) for (const [t3, i3] of s2) this.elementProperties.set(t3, i3); + } + this._$Eh = /* @__PURE__ */ new Map(); + for (const [t3, s2] of this.elementProperties) { + const i3 = this._$Eu(t3, s2); + void 0 !== i3 && this._$Eh.set(i3, t3); + } + this.elementStyles = this.finalizeStyles(this.styles); + } + static finalizeStyles(s2) { + const i3 = []; + if (Array.isArray(s2)) { + const e4 = new Set(s2.flat(1 / 0).reverse()); + for (const s3 of e4) i3.unshift(c(s3)); + } else void 0 !== s2 && i3.push(c(s2)); + return i3; + } + static _$Eu(t2, s2) { + const i3 = s2.attribute; + return false === i3 ? void 0 : "string" == typeof i3 ? i3 : "string" == typeof t2 ? t2.toLowerCase() : void 0; + } + constructor() { + super(), this._$Ep = void 0, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev(); + } + _$Ev() { + this._$ES = new Promise((t2) => this.enableUpdating = t2), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((t2) => t2(this)); + } + addController(t2) { + (this._$EO ??= /* @__PURE__ */ new Set()).add(t2), void 0 !== this.renderRoot && this.isConnected && t2.hostConnected?.(); + } + removeController(t2) { + this._$EO?.delete(t2); + } + _$E_() { + const t2 = /* @__PURE__ */ new Map(), s2 = this.constructor.elementProperties; + for (const i3 of s2.keys()) this.hasOwnProperty(i3) && (t2.set(i3, this[i3]), delete this[i3]); + t2.size > 0 && (this._$Ep = t2); + } + createRenderRoot() { + const t2 = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions); + return S(t2, this.constructor.elementStyles), t2; + } + connectedCallback() { + this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach((t2) => t2.hostConnected?.()); + } + enableUpdating(t2) { + } + disconnectedCallback() { + this._$EO?.forEach((t2) => t2.hostDisconnected?.()); + } + attributeChangedCallback(t2, s2, i3) { + this._$AK(t2, i3); + } + _$EC(t2, s2) { + const i3 = this.constructor.elementProperties.get(t2), e4 = this.constructor._$Eu(t2, i3); + if (void 0 !== e4 && true === i3.reflect) { + const r4 = (void 0 !== i3.converter?.toAttribute ? i3.converter : u).toAttribute(s2, i3.type); + this._$Em = t2, null == r4 ? this.removeAttribute(e4) : this.setAttribute(e4, r4), this._$Em = null; + } + } + _$AK(t2, s2) { + const i3 = this.constructor, e4 = i3._$Eh.get(t2); + if (void 0 !== e4 && this._$Em !== e4) { + const t3 = i3.getPropertyOptions(e4), r4 = "function" == typeof t3.converter ? { fromAttribute: t3.converter } : void 0 !== t3.converter?.fromAttribute ? t3.converter : u; + this._$Em = e4, this[e4] = r4.fromAttribute(s2, t3.type), this._$Em = null; + } + } + requestUpdate(t2, s2, i3) { + if (void 0 !== t2) { + if (i3 ??= this.constructor.getPropertyOptions(t2), !(i3.hasChanged ?? f)(this[t2], s2)) return; + this.P(t2, s2, i3); + } + false === this.isUpdatePending && (this._$ES = this._$ET()); + } + P(t2, s2, i3) { + this._$AL.has(t2) || this._$AL.set(t2, s2), true === i3.reflect && this._$Em !== t2 && (this._$Ej ??= /* @__PURE__ */ new Set()).add(t2); + } + async _$ET() { + this.isUpdatePending = true; + try { + await this._$ES; + } catch (t3) { + Promise.reject(t3); + } + const t2 = this.scheduleUpdate(); + return null != t2 && await t2, !this.isUpdatePending; + } + scheduleUpdate() { + return this.performUpdate(); + } + performUpdate() { + if (!this.isUpdatePending) return; + if (!this.hasUpdated) { + if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) { + for (const [t4, s3] of this._$Ep) this[t4] = s3; + this._$Ep = void 0; + } + const t3 = this.constructor.elementProperties; + if (t3.size > 0) for (const [s3, i3] of t3) true !== i3.wrapped || this._$AL.has(s3) || void 0 === this[s3] || this.P(s3, this[s3], i3); + } + let t2 = false; + const s2 = this._$AL; + try { + t2 = this.shouldUpdate(s2), t2 ? (this.willUpdate(s2), this._$EO?.forEach((t3) => t3.hostUpdate?.()), this.update(s2)) : this._$EU(); + } catch (s3) { + throw t2 = false, this._$EU(), s3; + } + t2 && this._$AE(s2); + } + willUpdate(t2) { + } + _$AE(t2) { + this._$EO?.forEach((t3) => t3.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t2)), this.updated(t2); + } + _$EU() { + this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = false; + } + get updateComplete() { + return this.getUpdateComplete(); + } + getUpdateComplete() { + return this._$ES; + } + shouldUpdate(t2) { + return true; + } + update(t2) { + this._$Ej &&= this._$Ej.forEach((t3) => this._$EC(t3, this[t3])), this._$EU(); + } + updated(t2) { + } + firstUpdated(t2) { + } +}; +b.elementStyles = [], b.shadowRootOptions = { mode: "open" }, b[d("elementProperties")] = /* @__PURE__ */ new Map(), b[d("finalized")] = /* @__PURE__ */ new Map(), p?.({ ReactiveElement: b }), (a.reactiveElementVersions ??= []).push("2.0.4"); + +// node_modules/lit-html/lit-html.js +var n3 = globalThis; +var c3 = n3.trustedTypes; +var h2 = c3 ? c3.createPolicy("lit-html", { createHTML: (t2) => t2 }) : void 0; +var f2 = "$lit$"; +var v = `lit$${Math.random().toFixed(9).slice(2)}$`; +var m = "?" + v; +var _ = `<${m}>`; +var w = document; +var lt = () => w.createComment(""); +var st = (t2) => null === t2 || "object" != typeof t2 && "function" != typeof t2; +var g = Array.isArray; +var $ = (t2) => g(t2) || "function" == typeof t2?.[Symbol.iterator]; +var x = "[ \n\f\r]"; +var T = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g; +var E = /-->/g; +var k = />/g; +var O = RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`, "g"); +var S2 = /'/g; +var j = /"/g; +var M = /^(?:script|style|textarea|title)$/i; +var P = (t2) => (i3, ...s2) => ({ _$litType$: t2, strings: i3, values: s2 }); +var ke = P(1); +var Oe = P(2); +var Se = P(3); +var R = Symbol.for("lit-noChange"); +var D = Symbol.for("lit-nothing"); +var V = /* @__PURE__ */ new WeakMap(); +var I = w.createTreeWalker(w, 129); +function N(t2, i3) { + if (!g(t2) || !t2.hasOwnProperty("raw")) throw Error("invalid template strings array"); + return void 0 !== h2 ? h2.createHTML(i3) : i3; +} +var U = (t2, i3) => { + const s2 = t2.length - 1, e4 = []; + let h4, o4 = 2 === i3 ? "" : 3 === i3 ? "" : "", n5 = T; + for (let i4 = 0; i4 < s2; i4++) { + const s3 = t2[i4]; + let r4, l2, c4 = -1, a2 = 0; + for (; a2 < s3.length && (n5.lastIndex = a2, l2 = n5.exec(s3), null !== l2); ) a2 = n5.lastIndex, n5 === T ? "!--" === l2[1] ? n5 = E : void 0 !== l2[1] ? n5 = k : void 0 !== l2[2] ? (M.test(l2[2]) && (h4 = RegExp("" === l2[0] ? (n5 = h4 ?? T, c4 = -1) : void 0 === l2[1] ? c4 = -2 : (c4 = n5.lastIndex - l2[2].length, r4 = l2[1], n5 = void 0 === l2[3] ? O : '"' === l2[3] ? j : S2) : n5 === j || n5 === S2 ? n5 = O : n5 === E || n5 === k ? n5 = T : (n5 = O, h4 = void 0); + const u2 = n5 === O && t2[i4 + 1].startsWith("/>") ? " " : ""; + o4 += n5 === T ? s3 + _ : c4 >= 0 ? (e4.push(r4), s3.slice(0, c4) + f2 + s3.slice(c4) + v + u2) : s3 + v + (-2 === c4 ? i4 : u2); + } + return [N(t2, o4 + (t2[s2] || "") + (2 === i3 ? "" : 3 === i3 ? "" : "")), e4]; +}; +var B = class _B { + constructor({ strings: t2, _$litType$: i3 }, s2) { + let e4; + this.parts = []; + let h4 = 0, o4 = 0; + const n5 = t2.length - 1, r4 = this.parts, [l2, a2] = U(t2, i3); + if (this.el = _B.createElement(l2, s2), I.currentNode = this.el.content, 2 === i3 || 3 === i3) { + const t3 = this.el.content.firstChild; + t3.replaceWith(...t3.childNodes); + } + for (; null !== (e4 = I.nextNode()) && r4.length < n5; ) { + if (1 === e4.nodeType) { + if (e4.hasAttributes()) for (const t3 of e4.getAttributeNames()) if (t3.endsWith(f2)) { + const i4 = a2[o4++], s3 = e4.getAttribute(t3).split(v), n6 = /([.?@])?(.*)/.exec(i4); + r4.push({ type: 1, index: h4, name: n6[2], strings: s3, ctor: "." === n6[1] ? Y : "?" === n6[1] ? Z : "@" === n6[1] ? q : G }), e4.removeAttribute(t3); + } else t3.startsWith(v) && (r4.push({ type: 6, index: h4 }), e4.removeAttribute(t3)); + if (M.test(e4.tagName)) { + const t3 = e4.textContent.split(v), i4 = t3.length - 1; + if (i4 > 0) { + e4.textContent = c3 ? c3.emptyScript : ""; + for (let s3 = 0; s3 < i4; s3++) e4.append(t3[s3], lt()), I.nextNode(), r4.push({ type: 2, index: ++h4 }); + e4.append(t3[i4], lt()); + } + } + } else if (8 === e4.nodeType) if (e4.data === m) r4.push({ type: 2, index: h4 }); + else { + let t3 = -1; + for (; -1 !== (t3 = e4.data.indexOf(v, t3 + 1)); ) r4.push({ type: 7, index: h4 }), t3 += v.length - 1; + } + h4++; + } + } + static createElement(t2, i3) { + const s2 = w.createElement("template"); + return s2.innerHTML = t2, s2; + } +}; +function z(t2, i3, s2 = t2, e4) { + if (i3 === R) return i3; + let h4 = void 0 !== e4 ? s2.o?.[e4] : s2.l; + const o4 = st(i3) ? void 0 : i3._$litDirective$; + return h4?.constructor !== o4 && (h4?._$AO?.(false), void 0 === o4 ? h4 = void 0 : (h4 = new o4(t2), h4._$AT(t2, s2, e4)), void 0 !== e4 ? (s2.o ??= [])[e4] = h4 : s2.l = h4), void 0 !== h4 && (i3 = z(t2, h4._$AS(t2, i3.values), h4, e4)), i3; +} +var F = class { + constructor(t2, i3) { + this._$AV = [], this._$AN = void 0, this._$AD = t2, this._$AM = i3; + } + get parentNode() { + return this._$AM.parentNode; + } + get _$AU() { + return this._$AM._$AU; + } + u(t2) { + const { el: { content: i3 }, parts: s2 } = this._$AD, e4 = (t2?.creationScope ?? w).importNode(i3, true); + I.currentNode = e4; + let h4 = I.nextNode(), o4 = 0, n5 = 0, r4 = s2[0]; + for (; void 0 !== r4; ) { + if (o4 === r4.index) { + let i4; + 2 === r4.type ? i4 = new et(h4, h4.nextSibling, this, t2) : 1 === r4.type ? i4 = new r4.ctor(h4, r4.name, r4.strings, this, t2) : 6 === r4.type && (i4 = new K(h4, this, t2)), this._$AV.push(i4), r4 = s2[++n5]; + } + o4 !== r4?.index && (h4 = I.nextNode(), o4++); + } + return I.currentNode = w, e4; + } + p(t2) { + let i3 = 0; + for (const s2 of this._$AV) void 0 !== s2 && (void 0 !== s2.strings ? (s2._$AI(t2, s2, i3), i3 += s2.strings.length - 2) : s2._$AI(t2[i3])), i3++; + } +}; +var et = class _et { + get _$AU() { + return this._$AM?._$AU ?? this.v; + } + constructor(t2, i3, s2, e4) { + this.type = 2, this._$AH = D, this._$AN = void 0, this._$AA = t2, this._$AB = i3, this._$AM = s2, this.options = e4, this.v = e4?.isConnected ?? true; + } + get parentNode() { + let t2 = this._$AA.parentNode; + const i3 = this._$AM; + return void 0 !== i3 && 11 === t2?.nodeType && (t2 = i3.parentNode), t2; + } + get startNode() { + return this._$AA; + } + get endNode() { + return this._$AB; + } + _$AI(t2, i3 = this) { + t2 = z(this, t2, i3), st(t2) ? t2 === D || null == t2 || "" === t2 ? (this._$AH !== D && this._$AR(), this._$AH = D) : t2 !== this._$AH && t2 !== R && this._(t2) : void 0 !== t2._$litType$ ? this.$(t2) : void 0 !== t2.nodeType ? this.T(t2) : $(t2) ? this.k(t2) : this._(t2); + } + O(t2) { + return this._$AA.parentNode.insertBefore(t2, this._$AB); + } + T(t2) { + this._$AH !== t2 && (this._$AR(), this._$AH = this.O(t2)); + } + _(t2) { + this._$AH !== D && st(this._$AH) ? this._$AA.nextSibling.data = t2 : this.T(w.createTextNode(t2)), this._$AH = t2; + } + $(t2) { + const { values: i3, _$litType$: s2 } = t2, e4 = "number" == typeof s2 ? this._$AC(t2) : (void 0 === s2.el && (s2.el = B.createElement(N(s2.h, s2.h[0]), this.options)), s2); + if (this._$AH?._$AD === e4) this._$AH.p(i3); + else { + const t3 = new F(e4, this), s3 = t3.u(this.options); + t3.p(i3), this.T(s3), this._$AH = t3; + } + } + _$AC(t2) { + let i3 = V.get(t2.strings); + return void 0 === i3 && V.set(t2.strings, i3 = new B(t2)), i3; + } + k(t2) { + g(this._$AH) || (this._$AH = [], this._$AR()); + const i3 = this._$AH; + let s2, e4 = 0; + for (const h4 of t2) e4 === i3.length ? i3.push(s2 = new _et(this.O(lt()), this.O(lt()), this, this.options)) : s2 = i3[e4], s2._$AI(h4), e4++; + e4 < i3.length && (this._$AR(s2 && s2._$AB.nextSibling, e4), i3.length = e4); + } + _$AR(t2 = this._$AA.nextSibling, i3) { + for (this._$AP?.(false, true, i3); t2 && t2 !== this._$AB; ) { + const i4 = t2.nextSibling; + t2.remove(), t2 = i4; + } + } + setConnected(t2) { + void 0 === this._$AM && (this.v = t2, this._$AP?.(t2)); + } +}; +var G = class { + get tagName() { + return this.element.tagName; + } + get _$AU() { + return this._$AM._$AU; + } + constructor(t2, i3, s2, e4, h4) { + this.type = 1, this._$AH = D, this._$AN = void 0, this.element = t2, this.name = i3, this._$AM = e4, this.options = h4, s2.length > 2 || "" !== s2[0] || "" !== s2[1] ? (this._$AH = Array(s2.length - 1).fill(new String()), this.strings = s2) : this._$AH = D; + } + _$AI(t2, i3 = this, s2, e4) { + const h4 = this.strings; + let o4 = false; + if (void 0 === h4) t2 = z(this, t2, i3, 0), o4 = !st(t2) || t2 !== this._$AH && t2 !== R, o4 && (this._$AH = t2); + else { + const e5 = t2; + let n5, r4; + for (t2 = h4[0], n5 = 0; n5 < h4.length - 1; n5++) r4 = z(this, e5[s2 + n5], i3, n5), r4 === R && (r4 = this._$AH[n5]), o4 ||= !st(r4) || r4 !== this._$AH[n5], r4 === D ? t2 = D : t2 !== D && (t2 += (r4 ?? "") + h4[n5 + 1]), this._$AH[n5] = r4; + } + o4 && !e4 && this.j(t2); + } + j(t2) { + t2 === D ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t2 ?? ""); + } +}; +var Y = class extends G { + constructor() { + super(...arguments), this.type = 3; + } + j(t2) { + this.element[this.name] = t2 === D ? void 0 : t2; + } +}; +var Z = class extends G { + constructor() { + super(...arguments), this.type = 4; + } + j(t2) { + this.element.toggleAttribute(this.name, !!t2 && t2 !== D); + } +}; +var q = class extends G { + constructor(t2, i3, s2, e4, h4) { + super(t2, i3, s2, e4, h4), this.type = 5; + } + _$AI(t2, i3 = this) { + if ((t2 = z(this, t2, i3, 0) ?? D) === R) return; + const s2 = this._$AH, e4 = t2 === D && s2 !== D || t2.capture !== s2.capture || t2.once !== s2.once || t2.passive !== s2.passive, h4 = t2 !== D && (s2 === D || e4); + e4 && this.element.removeEventListener(this.name, this, s2), h4 && this.element.addEventListener(this.name, this, t2), this._$AH = t2; + } + handleEvent(t2) { + "function" == typeof this._$AH ? this._$AH.call(this.options?.host ?? this.element, t2) : this._$AH.handleEvent(t2); + } +}; +var K = class { + constructor(t2, i3, s2) { + this.element = t2, this.type = 6, this._$AN = void 0, this._$AM = i3, this.options = s2; + } + get _$AU() { + return this._$AM._$AU; + } + _$AI(t2) { + z(this, t2); + } +}; +var Re = n3.litHtmlPolyfillSupport; +Re?.(B, et), (n3.litHtmlVersions ??= []).push("3.2.0"); +var Q = (t2, i3, s2) => { + const e4 = s2?.renderBefore ?? i3; + let h4 = e4._$litPart$; + if (void 0 === h4) { + const t3 = s2?.renderBefore ?? null; + e4._$litPart$ = h4 = new et(i3.insertBefore(lt(), t3), t3, void 0, s2 ?? {}); + } + return h4._$AI(t2), h4; +}; + +// node_modules/lit-element/lit-element.js +var h3 = class extends b { + constructor() { + super(...arguments), this.renderOptions = { host: this }, this.o = void 0; + } + createRenderRoot() { + const t2 = super.createRenderRoot(); + return this.renderOptions.renderBefore ??= t2.firstChild, t2; + } + update(t2) { + const e4 = this.render(); + this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t2), this.o = Q(e4, this.renderRoot, this.renderOptions); + } + connectedCallback() { + super.connectedCallback(), this.o?.setConnected(true); + } + disconnectedCallback() { + super.disconnectedCallback(), this.o?.setConnected(false); + } + render() { + return R; + } +}; +h3._$litElement$ = true, h3["finalized"] = true, globalThis.litElementHydrateSupport?.({ LitElement: h3 }); +var f3 = globalThis.litElementPolyfillSupport; +f3?.({ LitElement: h3 }); +(globalThis.litElementVersions ??= []).push("4.1.0"); + +// node_modules/@lit/reactive-element/decorators/property.js +var o3 = { attribute: true, type: String, converter: u, reflect: false, hasChanged: f }; +var r3 = (t2 = o3, e4, r4) => { + const { kind: n5, metadata: i3 } = r4; + let s2 = globalThis.litPropertyMetadata.get(i3); + if (void 0 === s2 && globalThis.litPropertyMetadata.set(i3, s2 = /* @__PURE__ */ new Map()), s2.set(r4.name, t2), "accessor" === n5) { + const { name: o4 } = r4; + return { set(r5) { + const n6 = e4.get.call(this); + e4.set.call(this, r5), this.requestUpdate(o4, n6, t2); + }, init(e5) { + return void 0 !== e5 && this.P(o4, void 0, t2), e5; + } }; + } + if ("setter" === n5) { + const { name: o4 } = r4; + return function(r5) { + const n6 = this[o4]; + e4.call(this, r5), this.requestUpdate(o4, n6, t2); + }; + } + throw Error("Unsupported decorator location: " + n5); +}; +function n4(t2) { + return (e4, o4) => "object" == typeof o4 ? r3(t2, e4, o4) : ((t3, e5, o5) => { + const r4 = e5.hasOwnProperty(o5); + return e5.constructor.createProperty(o5, r4 ? { ...t3, wrapped: true } : t3), r4 ? Object.getOwnPropertyDescriptor(e5, o5) : void 0; + })(t2, e4, o4); +} + +// js/ipywidgets_styles.ts +var legacyStyles = i` .legacy-button { align-items: center; background-color: var(--jp-layout-color2); @@ -53,7 +637,40 @@ var At=Object.defineProperty;var vt=Object.getOwnPropertyDescriptor;var st=(r,t, height: var(--jp-widgets-inline-height); line-height: var(--jp-widgets-inline-height); } -`;async function jt(r,t){return Promise.all(r.map(e=>t.get_model(e.slice(10))))}async function et(r,t){let e=t.get("children"),s=await jt(e,t.widget_manager),i=await Promise.all(s.map(o=>o.widget_manager.create_view(o)));r.innerHTML="";for(let o of i)r.appendChild(o.el)}var D=class D extends y{constructor(){super(...arguments);this._model=void 0;this.visible=!1}static get componentName(){return"layer-manager"}static{this.styles=[_t,w` +`; + +// js/utils.ts +async function unpackModels(modelIds, manager) { + return Promise.all( + modelIds.map((id) => manager.get_model(id.slice("IPY_MODEL_".length))) + ); +} +async function updateChildren(container, model) { + const children = model.get("children"); + const child_models = await unpackModels(children, model.widget_manager); + const child_views = await Promise.all( + child_models.map((model2) => model2.widget_manager.create_view(model2)) + ); + container.innerHTML = ``; + for (const child_view of child_views) { + container.appendChild(child_view.el); + } +} + +// js/layer_manager.ts +var _LayerManager = class _LayerManager extends h3 { + constructor() { + super(...arguments); + this._model = void 0; + this.visible = false; + } + static get componentName() { + return `layer-manager`; + } + static { + this.styles = [ + legacyStyles, + i` .container { padding: 0 4px 2px 4px; } @@ -68,7 +685,28 @@ var At=Object.defineProperty;var vt=Object.getOwnPropertyDescriptor;var st=(r,t, .visibility-checkbox { margin: 2px; } - `]}static{this.modelNameToViewName=new Map([["children",null],["visible","visible"]])}set model(e){this._model=e;for(let[s,i]of D.modelNameToViewName)i&&(this[i]=e.get(s),e.on(`change:${s}`,()=>{this[i]=e.get(s)}))}render(){return gt` + ` + ]; + } + static { + this.modelNameToViewName = /* @__PURE__ */ new Map([ + ["children", null], + ["visible", "visible"] + ]); + } + set model(model) { + this._model = model; + for (const [modelKey, widgetKey] of _LayerManager.modelNameToViewName) { + if (widgetKey) { + this[widgetKey] = model.get(modelKey); + model.on(`change:${modelKey}`, () => { + this[widgetKey] = model.get(modelKey); + }); + } + } + } + render() { + return ke`
- `}updated(e){for(let[s,i]of e)this._model?.set(s,this[s]);this._model?.save_changes()}onLayerVisibilityChanged(e){let s=e.target;this.visible=s.checked}};st([tt()],D.prototype,"visible",2);var E=D;customElements.get(E.componentName)||customElements.define(E.componentName,E);async function Lt({model:r,el:t}){let e=document.createElement(E.componentName);e.model=r,t.appendChild(e),et(e,r),r.on("change:children",()=>{et(e,r)})}var qe={render:Lt};export{E as LayerManager,qe as default}; + `; + } + updated(changedProperties) { + for (const [property, _2] of changedProperties) { + this._model?.set(property, this[property]); + } + this._model?.save_changes(); + } + onLayerVisibilityChanged(event) { + const target = event.target; + this.visible = target.checked; + } +}; +__decorateClass([ + n4() +], _LayerManager.prototype, "visible", 2); +var LayerManager = _LayerManager; +if (!customElements.get(LayerManager.componentName)) { + customElements.define(LayerManager.componentName, LayerManager); +} +async function render({ model, el }) { + const manager = document.createElement(LayerManager.componentName); + manager.model = model; + el.appendChild(manager); + updateChildren(manager, model); + model.on("change:children", () => { + updateChildren(manager, model); + }); +} +var layer_manager_default = { render }; +export { + LayerManager, + layer_manager_default as default +}; /*! Bundled license information: @lit/reactive-element/css-tag.js: @@ -189,3 +860,4 @@ lit-html/is-server.js: * SPDX-License-Identifier: BSD-3-Clause *) */ +//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vbm9kZV9tb2R1bGVzL0BsaXQvcmVhY3RpdmUtZWxlbWVudC9zcmMvY3NzLXRh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LFxuICAgICAgICAgICAgICAgIHN0cmluZ3M6IHN0YXRpY3MsXG4gICAgICAgICAgICAgICAgY3RvcjpcbiAgICAgICAgICAgICAgICAgIG1bMV0gPT09ICcuJ1xuICAgICAgICAgICAgICAgICAgICA/IFByb3BlcnR5UGFydFxuICAgICAgICAgICAgICAgICAgICA6IG1bMV0gPT09ICc/J1xuICAgICAgICAgICAgICAgICAgICAgID8gQm9vbGVhbkF0dHJpYnV0ZVBhcnRcbiAgICAgICAgICAgICAgICAgICAgICA6IG1bMV0gPT09ICdAJ1xuICAgICAgICAgICAgICAgICAgICAgICAgPyBFdmVudFBhcnRcbiAgICAgICAgICAgICAgICAgICAgICAgIDogQXR0cmlidXRlUGFydCxcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgIChub2RlIGFzIEVsZW1lbnQpLnJlbW92ZUF0dHJpYnV0ZShuYW1lKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobmFtZS5zdGFydHNXaXRoKG1hcmtlcikpIHtcbiAgICAgICAgICAgICAgcGFydHMucHVzaCh7XG4gICAgICAgICAgICAgICAgdHlwZTogRUxFTUVOVF9QQVJULFxuICAgICAgICAgICAgICAgIGluZGV4OiBub2RlSW5kZXgsXG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAobm9kZSBhcyBFbGVtZW50KS5yZW1vdmVBdHRyaWJ1dGUobmFtZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIC8vIFRPRE8gKGp1c3RpbmZhZ25hbmkpOiBiZW5jaG1hcmsgdGhlIHJlZ2V4IGFnYWluc3QgdGVzdGluZyBmb3IgZWFjaFxuICAgICAgICAvLyBvZiB0aGUgMyByYXcgdGV4dCBlbGVtZW50IG5hbWVzLlxuICAgICAgICBpZiAocmF3VGV4dEVsZW1lbnQudGVzdCgobm9kZSBhcyBFbGVtZW50KS50YWdOYW1lKSkge1xuICAgICAgICAgIC8vIEZvciByYXcg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4ZmlsdHJhdGUgZGF0YSBhbmQgc3Bvb2YgVUlzLiBgICtcbiAgICAgICAgICAgICAgICBgQ29uc2lkZXIgaW5zdGVhZCB1c2luZyBjc3NcXGAuLi5cXGAgbGl0ZXJhbHMgYCArXG4gICAgICAgICAgICAgICAgYHRvIGNvbXBvc2Ugc3R5bGVzLCBhbmQgZG8gZHluYW1pYyBzdHlsaW5nIHdpdGggYCArXG4gICAgICAgICAgICAgICAgYGNzcyBjdXN0b20gcHJvcGVydGllcywgOjpwYXJ0cywgPHNsb3Q+cywgYCArXG4gICAgICAgICAgICAgICAgYGFuZCBieSBtdXRhdGluZyB0aGUgRE9NIHJhdGhlciB0aGFuIHN0eWxlc2hlZXRzLmA7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBtZXNzYWdlID1cbiAgICAgICAgICAgICAgICBgTGl0IGRvZXMgbm90IHN1cHBvcnQgYmluZGluZyBpbnNpZGUgc2NyaXB0IG5vZGVzLiBgICtcbiAgICAgICAgICAgICAgICBgVGhpcyBpcyBhIHNlY3VyaXR5IHJpc2ssIGFzIGl0IGNvdWxkIGFsbG93IGFyYml0cmFyeSBgICtcbiAgICAgICAgICAgICAgICBgY29kZSBleGVjdXRpb24uYDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgdGhyb3cgbmV3IEVycm9yKG1lc3NhZ2UpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBkZWJ1Z0xvZ0V2ZW50ICYmXG4gICAgICAgIGRlYnVnTG9nRXZlbnQoe1xuICAgICAgICAgIGtpbmQ6ICdjb21taXQgbm9kZScsXG4gICAgICAgICAgc3RhcnQ6IHRoaXMuXyRzdGFydE5vZGUsXG4gICAgICAgICAgcGFyZW50OiB0aGlzLl8kcGFyZW50LFxuICAgICAgICAgIHZhbHVlOiB2YWx1ZSxcbiAgICAgICAgICBvcHRpb25zOiB0aGlzLm9wdGlvbnMsXG4gICAgICAgIH0pO1xuICAgIC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W5hZ2VyTW9kZWwge1xuICAgIGNoaWxkcmVuOiBhbnk7XG4gICAgdmlzaWJsZTogYm9vbGVhbjtcbn1cblxuZXhwb3J0IGNsYXNzIExheWVyTWFuYWdlciBleHRlbmRzIExpdEVsZW1lbnQge1xuICAgIHN0YXRpYyBnZXQgY29tcG9uZW50TmFtZSgpIHtcbiAgICAgICAgcmV0dXJuIGBsYXllci1tYW5hZ2VyYDtcbiAgICB9XG5cbiAgICBzdGF0aWMgc3R5bGVzID0gW1xuICAgICAgICBsZWdhY3lTdHlsZXMsXG4gICAgICAgIGNzc2BcbiAgICAgICAgICAgIC5jb250YWluZXIge1xuICAgICAgICAgICAgICAgIHBhZGRpbmc6IDAgNHB4IDJweCA0cHg7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC5yb3cge1xuICAgICAgICAgICAgICAgIGFsaWduLWl0ZW1zOiBjZW50ZXI7XG4gICAgICAgICAgICAgICAgZGlzcGxheTogZmxleDtcbiAgICAgICAgICAgICAgICBnYXA6IDRweDtcbiAgICAgICAgICAgICAgICBoZWlnaHQ6IDMwcHg7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC52aXNpYmlsaXR5LWNoZWNrYm94IHtcbiAgICAgICAgICAgICAgICBtYXJnaW46IDJweDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgYCxcbiAgICBdO1xuXG4gICAgcHJpdmF0ZSBfbW9kZWw6IEFueU1vZGVsPExheWVyTWFuYWdlck1vZGVsPiB8IHVuZGVmaW5lZCA9IHVuZGVmaW5lZDtcbiAgICBwcml2YXRlIHN0YXRpYyBtb2RlbE5hbWVUb1ZpZXdOYW1lID0gbmV3IE1hcDxrZXlvZiBMYXllck1hbmFnZXJNb2RlbCwga2V5b2YgTGF5ZXJNYW5hZ2VyIHwgbnVsbD4oW1xuICAgICAgICBbXCJjaGlsZHJlblwiLCBudWxsXSxcbiAgICAgICAgW1widmlzaWJsZVwiLCBcInZpc2libGVcIl0sXG4gICAgXSk7XG5cbiAgICBzZXQgbW9kZWwobW9kZWw6IEFueU1vZGVsPExheWVyTWFuYWdlck1vZGVsPikge1xuICAgICAgICB0aGlzLl9tb2RlbCA9IG1vZGVsO1xuICAgICAgICBmb3IgKGNvbnN0IFttb2RlbEtleSwgd2lkZ2V0S2V5XSBvZiBMYXllck1hbmFnZXIubW9kZWxOYW1lVG9WaWV3TmFtZSkge1xuICAgICAgICAgICAgaWYgKHdpZGdldEtleSkge1xuICAgICAgICAgICAgICAgIC8vIEdldCBpbml0aWFsIHZhbHVlcyBmcm9tIHRoZSBQeXRob24gbW9kZWwuXG4gICAgICAgICAgICAgICAgKHRoaXMgYXMgYW55KVt3aWRnZXRLZXldID0gbW9kZWwuZ2V0KG1vZGVsS2V5KTtcbiAgICAgICAgICAgICAgICAvLyBMaXN0ZW4gZm9yIHVwZGF0ZXMgdG8gdGhlIG1vZGVsLlxuICAgICAgICAgICAgICAgIG1vZGVsLm9uKGBjaGFuZ2U6JHttb2RlbEtleX1gLCAoKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICh0aGlzIGFzIGFueSlbd2lkZ2V0S2V5XSA9IG1vZGVsLmdldChtb2RlbEtleSk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBAcHJvcGVydHkoKVxuICAgIHZpc2libGU6IGJvb2xlYW4gPSBmYWxzZTtcblxuICAgIHJlbmRlcigpIHtcbiAgICAgICAgcmV0dXJuIGh0bWxgXG4gICAgICAgICAgICA8ZGl2IGNsYXNzPVwiY29udGFpbmVyXCI+XG4gICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInJvd1wiPlxuICAgICAgICAgICAgICAgICAgICA8aW5wdXRcbiAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU9XCJjaGVja2JveFwiXG4gICAgICAgICAgICAgICAgICAgICAgICBjbGFzcz1cInZpc2liaWxpdHktY2hlY2tib3hcIlxuICAgICAgICAgICAgIC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sICJraW5kIiwgIm1ldGFkYXRhIiwgInByb3BlcnRpZXMiLCAiZ2xvYmFsVGhpcyIsICJsaXRQcm9wZXJ0eU1ldGFkYXRhIiwgImdldCIsICJzZXQiLCAiTWFwIiwgIm5hbWUiLCAidiIsICJvbGRWYWx1ZSIsICJjYWxsIiwgInRoaXMiLCAicmVxdWVzdFVwZGF0ZSIsICJfJGNoYW5nZVByb3BlcnR5IiwgInZhbHVlIiwgIkVycm9yIiwgInByb3BlcnR5IiwgInByb3RvT3JUYXJnZXQiLCAibmFtZU9yQ29udGV4dCIsICJwcm90byIsICJoYXNPd25Qcm9wZXJ0eSIsICJjb25zdHJ1Y3RvciIsICJjcmVhdGVQcm9wZXJ0eSIsICJ3cmFwcGVkIiwgIk9iamVjdCIsICJnZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3IiLCAibW9kZWwiLCAiaCIsICJfIiwgIm4iXQp9Cg== diff --git a/geemap/static/layer_manager_row.css b/geemap/static/layer_manager_row.css index 04ef49523b..153c430c38 100644 --- a/geemap/static/layer_manager_row.css +++ b/geemap/static/layer_manager_row.css @@ -1 +1,4 @@ -@import"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined"; +@import "https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined"; + +/* js/common.css */ +/*# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFtdLAogICJzb3VyY2VzQ29udGVudCI6IFtdLAogICJtYXBwaW5ncyI6ICIiLAogICJuYW1lcyI6IFtdCn0K */ diff --git a/geemap/static/layer_manager_row.js b/geemap/static/layer_manager_row.js index 118f9692ca..60c628695c 100644 --- a/geemap/static/layer_manager_row.js +++ b/geemap/static/layer_manager_row.js @@ -1,6 +1,590 @@ -var _t=Object.defineProperty;var bt=Object.getOwnPropertyDescriptor;var w=(o,t,e,s)=>{for(var i=s>1?void 0:s?bt(t,e):t,n=o.length-1,r;n>=0;n--)(r=o[n])&&(i=(s?r(t,e,i):r(i))||i);return s&&i&&_t(t,e,i),i};var L=globalThis,z=L.ShadowRoot&&(L.ShadyCSS===void 0||L.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,W=Symbol(),it=new WeakMap,k=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==W)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(z&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=it.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&it.set(e,t))}return t}toString(){return this.cssText}},ot=o=>new k(typeof o=="string"?o:o+"",void 0,W),v=(o,...t)=>{let e=o.length===1?o[0]:t.reduce((s,i,n)=>s+(r=>{if(r._$cssResult$===!0)return r.cssText;if(typeof r=="number")return r;throw Error("Value passed to 'css' function must be a 'css' function result: "+r+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+o[n+1],o[0]);return new k(e,o,W)},J=(o,t)=>{if(z)o.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=L.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,o.appendChild(s)}},D=z?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return ot(e)})(o):o;var{is:At,defineProperty:xt,getOwnPropertyDescriptor:St,getOwnPropertyNames:wt,getOwnPropertySymbols:Et,getPrototypeOf:Ct}=Object,I=globalThis,nt=I.trustedTypes,Pt=nt?nt.emptyScript:"",kt=I.reactiveElementPolyfillSupport,R=(o,t)=>o,U={toAttribute(o,t){switch(t){case Boolean:o=o?Pt:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},V=(o,t)=>!At(o,t),rt={attribute:!0,type:String,converter:U,reflect:!1,hasChanged:V};Symbol.metadata??=Symbol("metadata"),I.litPropertyMetadata??=new WeakMap;var m=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=rt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&xt(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:n}=St(this.prototype,t)??{get(){return this[e]},set(r){this[e]=r}};return{get(){return i?.call(this)},set(r){let h=i?.call(this);n.call(this,r),this.requestUpdate(t,h,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??rt}static _$Ei(){if(this.hasOwnProperty(R("elementProperties")))return;let t=Ct(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(R("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(R("properties"))){let e=this.properties,s=[...wt(e),...Et(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(D(i))}else t!==void 0&&e.push(D(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return J(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let n=(s.converter?.toAttribute!==void 0?s.converter:U).toAttribute(e,s.type);this._$Em=t,n==null?this.removeAttribute(i):this.setAttribute(i,n),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let n=s.getPropertyOptions(i),r=typeof n.converter=="function"?{fromAttribute:n.converter}:n.converter?.fromAttribute!==void 0?n.converter:U;this._$Em=i,this[i]=r.fromAttribute(e,n.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??V)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,n]of this._$Ep)this[i]=n;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,n]of s)n.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],n)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};m.elementStyles=[],m.shadowRootOptions={mode:"open"},m[R("elementProperties")]=new Map,m[R("finalized")]=new Map,kt?.({ReactiveElement:m}),(I.reactiveElementVersions??=[]).push("2.0.4");var G=globalThis,q=G.trustedTypes,at=q?q.createPolicy("lit-html",{createHTML:o=>o}):void 0,ut="$lit$",g=`lit$${Math.random().toFixed(9).slice(2)}$`,mt="?"+g,Rt=`<${mt}>`,A=document,O=()=>A.createComment(""),N=o=>o===null||typeof o!="object"&&typeof o!="function",tt=Array.isArray,Ut=o=>tt(o)||typeof o?.[Symbol.iterator]=="function",K=`[ -\f\r]`,M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,lt=/-->/g,ht=/>/g,_=RegExp(`>|${K}(?:([^\\s"'>=/]+)(${K}*=${K}*(?:[^ -\f\r"'\`<>=]|("|')|))|$)`,"g"),ct=/'/g,dt=/"/g,ft=/^(?:script|style|textarea|title)$/i,et=o=>(t,...e)=>({_$litType$:o,strings:t,values:e}),st=et(1),qt=et(2),Bt=et(3),x=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),pt=new WeakMap,b=A.createTreeWalker(A,129);function gt(o,t){if(!tt(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return at!==void 0?at.createHTML(t):t}var Mt=(o,t)=>{let e=o.length-1,s=[],i,n=t===2?"":t===3?"":"",r=M;for(let h=0;h"?(r=i??M,l=-1):p[1]===void 0?l=-2:(l=r.lastIndex-p[2].length,d=p[1],r=p[3]===void 0?_:p[3]==='"'?dt:ct):r===dt||r===ct?r=_:r===lt||r===ht?r=M:(r=_,i=void 0);let f=r===_&&o[h+1].startsWith("/>")?" ":"";n+=r===M?a+Rt:l>=0?(s.push(d),a.slice(0,l)+ut+a.slice(l)+g+f):a+g+(l===-2?h:f)}return[gt(o,n+(o[e]||"")+(t===2?"":t===3?"":"")),s]},H=class o{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let n=0,r=0,h=t.length-1,a=this.parts,[d,p]=Mt(t,e);if(this.el=o.createElement(d,s),b.currentNode=this.el.content,e===2||e===3){let l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(i=b.nextNode())!==null&&a.length0){i.textContent=q?q.emptyScript:"";for(let f=0;f2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=c}_$AI(t,e=this,s,i){let n=this.strings,r=!1;if(n===void 0)t=E(this,t,e,0),r=!N(t)||t!==this._$AH&&t!==x,r&&(this._$AH=t);else{let h=t,a,d;for(t=n[0],a=0;a{let s=e?.renderBefore??t,i=s._$litPart$;if(i===void 0){let n=e?.renderBefore??null;s._$litPart$=i=new T(t.insertBefore(O(),n),n,void 0,e??{})}return i._$AI(o),i};var y=class extends m{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=yt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return x}};y._$litElement$=!0,y.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:y});var Nt=globalThis.litElementPolyfillSupport;Nt?.({LitElement:y});(globalThis.litElementVersions??=[]).push("4.1.0");var Ht={attribute:!0,type:String,converter:U,reflect:!1,hasChanged:V},Tt=(o=Ht,t,e)=>{let{kind:s,metadata:i}=e,n=globalThis.litPropertyMetadata.get(i);if(n===void 0&&globalThis.litPropertyMetadata.set(i,n=new Map),n.set(e.name,o),s==="accessor"){let{name:r}=e;return{set(h){let a=t.get.call(this);t.set.call(this,h),this.requestUpdate(r,a,o)},init(h){return h!==void 0&&this.P(r,void 0,o),h}}}if(s==="setter"){let{name:r}=e;return function(h){let a=this[r];t.call(this,h),this.requestUpdate(r,a,o)}}throw Error("Unsupported decorator location: "+s)};function S(o){return(t,e)=>typeof e=="object"?Tt(o,t,e):((s,i,n)=>{let r=i.hasOwnProperty(n);return i.constructor.createProperty(n,r?{...s,wrapped:!0}:s),r?Object.getOwnPropertyDescriptor(i,n):void 0})(o,t,e)}var $t=v` +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __decorateClass = (decorators, target, key, kind) => { + var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target; + for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--) + if (decorator = decorators[i3]) + result = (kind ? decorator(target, key, result) : decorator(result)) || result; + if (kind && result) __defProp(target, key, result); + return result; +}; + +// node_modules/@lit/reactive-element/css-tag.js +var t = globalThis; +var e = t.ShadowRoot && (void 0 === t.ShadyCSS || t.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype; +var s = Symbol(); +var o = /* @__PURE__ */ new WeakMap(); +var n = class { + constructor(t2, e4, o4) { + if (this._$cssResult$ = true, o4 !== s) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead."); + this.cssText = t2, this.t = e4; + } + get styleSheet() { + let t2 = this.o; + const s2 = this.t; + if (e && void 0 === t2) { + const e4 = void 0 !== s2 && 1 === s2.length; + e4 && (t2 = o.get(s2)), void 0 === t2 && ((this.o = t2 = new CSSStyleSheet()).replaceSync(this.cssText), e4 && o.set(s2, t2)); + } + return t2; + } + toString() { + return this.cssText; + } +}; +var r = (t2) => new n("string" == typeof t2 ? t2 : t2 + "", void 0, s); +var i = (t2, ...e4) => { + const o4 = 1 === t2.length ? t2[0] : e4.reduce((e5, s2, o5) => e5 + ((t3) => { + if (true === t3._$cssResult$) return t3.cssText; + if ("number" == typeof t3) return t3; + throw Error("Value passed to 'css' function must be a 'css' function result: " + t3 + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security."); + })(s2) + t2[o5 + 1], t2[0]); + return new n(o4, t2, s); +}; +var S = (s2, o4) => { + if (e) s2.adoptedStyleSheets = o4.map((t2) => t2 instanceof CSSStyleSheet ? t2 : t2.styleSheet); + else for (const e4 of o4) { + const o5 = document.createElement("style"), n5 = t.litNonce; + void 0 !== n5 && o5.setAttribute("nonce", n5), o5.textContent = e4.cssText, s2.appendChild(o5); + } +}; +var c = e ? (t2) => t2 : (t2) => t2 instanceof CSSStyleSheet ? ((t3) => { + let e4 = ""; + for (const s2 of t3.cssRules) e4 += s2.cssText; + return r(e4); +})(t2) : t2; + +// node_modules/@lit/reactive-element/reactive-element.js +var { is: i2, defineProperty: e2, getOwnPropertyDescriptor: r2, getOwnPropertyNames: h, getOwnPropertySymbols: o2, getPrototypeOf: n2 } = Object; +var a = globalThis; +var c2 = a.trustedTypes; +var l = c2 ? c2.emptyScript : ""; +var p = a.reactiveElementPolyfillSupport; +var d = (t2, s2) => t2; +var u = { toAttribute(t2, s2) { + switch (s2) { + case Boolean: + t2 = t2 ? l : null; + break; + case Object: + case Array: + t2 = null == t2 ? t2 : JSON.stringify(t2); + } + return t2; +}, fromAttribute(t2, s2) { + let i3 = t2; + switch (s2) { + case Boolean: + i3 = null !== t2; + break; + case Number: + i3 = null === t2 ? null : Number(t2); + break; + case Object: + case Array: + try { + i3 = JSON.parse(t2); + } catch (t3) { + i3 = null; + } + } + return i3; +} }; +var f = (t2, s2) => !i2(t2, s2); +var y = { attribute: true, type: String, converter: u, reflect: false, hasChanged: f }; +Symbol.metadata ??= Symbol("metadata"), a.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap(); +var b = class extends HTMLElement { + static addInitializer(t2) { + this._$Ei(), (this.l ??= []).push(t2); + } + static get observedAttributes() { + return this.finalize(), this._$Eh && [...this._$Eh.keys()]; + } + static createProperty(t2, s2 = y) { + if (s2.state && (s2.attribute = false), this._$Ei(), this.elementProperties.set(t2, s2), !s2.noAccessor) { + const i3 = Symbol(), r4 = this.getPropertyDescriptor(t2, i3, s2); + void 0 !== r4 && e2(this.prototype, t2, r4); + } + } + static getPropertyDescriptor(t2, s2, i3) { + const { get: e4, set: h4 } = r2(this.prototype, t2) ?? { get() { + return this[s2]; + }, set(t3) { + this[s2] = t3; + } }; + return { get() { + return e4?.call(this); + }, set(s3) { + const r4 = e4?.call(this); + h4.call(this, s3), this.requestUpdate(t2, r4, i3); + }, configurable: true, enumerable: true }; + } + static getPropertyOptions(t2) { + return this.elementProperties.get(t2) ?? y; + } + static _$Ei() { + if (this.hasOwnProperty(d("elementProperties"))) return; + const t2 = n2(this); + t2.finalize(), void 0 !== t2.l && (this.l = [...t2.l]), this.elementProperties = new Map(t2.elementProperties); + } + static finalize() { + if (this.hasOwnProperty(d("finalized"))) return; + if (this.finalized = true, this._$Ei(), this.hasOwnProperty(d("properties"))) { + const t3 = this.properties, s2 = [...h(t3), ...o2(t3)]; + for (const i3 of s2) this.createProperty(i3, t3[i3]); + } + const t2 = this[Symbol.metadata]; + if (null !== t2) { + const s2 = litPropertyMetadata.get(t2); + if (void 0 !== s2) for (const [t3, i3] of s2) this.elementProperties.set(t3, i3); + } + this._$Eh = /* @__PURE__ */ new Map(); + for (const [t3, s2] of this.elementProperties) { + const i3 = this._$Eu(t3, s2); + void 0 !== i3 && this._$Eh.set(i3, t3); + } + this.elementStyles = this.finalizeStyles(this.styles); + } + static finalizeStyles(s2) { + const i3 = []; + if (Array.isArray(s2)) { + const e4 = new Set(s2.flat(1 / 0).reverse()); + for (const s3 of e4) i3.unshift(c(s3)); + } else void 0 !== s2 && i3.push(c(s2)); + return i3; + } + static _$Eu(t2, s2) { + const i3 = s2.attribute; + return false === i3 ? void 0 : "string" == typeof i3 ? i3 : "string" == typeof t2 ? t2.toLowerCase() : void 0; + } + constructor() { + super(), this._$Ep = void 0, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev(); + } + _$Ev() { + this._$ES = new Promise((t2) => this.enableUpdating = t2), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((t2) => t2(this)); + } + addController(t2) { + (this._$EO ??= /* @__PURE__ */ new Set()).add(t2), void 0 !== this.renderRoot && this.isConnected && t2.hostConnected?.(); + } + removeController(t2) { + this._$EO?.delete(t2); + } + _$E_() { + const t2 = /* @__PURE__ */ new Map(), s2 = this.constructor.elementProperties; + for (const i3 of s2.keys()) this.hasOwnProperty(i3) && (t2.set(i3, this[i3]), delete this[i3]); + t2.size > 0 && (this._$Ep = t2); + } + createRenderRoot() { + const t2 = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions); + return S(t2, this.constructor.elementStyles), t2; + } + connectedCallback() { + this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach((t2) => t2.hostConnected?.()); + } + enableUpdating(t2) { + } + disconnectedCallback() { + this._$EO?.forEach((t2) => t2.hostDisconnected?.()); + } + attributeChangedCallback(t2, s2, i3) { + this._$AK(t2, i3); + } + _$EC(t2, s2) { + const i3 = this.constructor.elementProperties.get(t2), e4 = this.constructor._$Eu(t2, i3); + if (void 0 !== e4 && true === i3.reflect) { + const r4 = (void 0 !== i3.converter?.toAttribute ? i3.converter : u).toAttribute(s2, i3.type); + this._$Em = t2, null == r4 ? this.removeAttribute(e4) : this.setAttribute(e4, r4), this._$Em = null; + } + } + _$AK(t2, s2) { + const i3 = this.constructor, e4 = i3._$Eh.get(t2); + if (void 0 !== e4 && this._$Em !== e4) { + const t3 = i3.getPropertyOptions(e4), r4 = "function" == typeof t3.converter ? { fromAttribute: t3.converter } : void 0 !== t3.converter?.fromAttribute ? t3.converter : u; + this._$Em = e4, this[e4] = r4.fromAttribute(s2, t3.type), this._$Em = null; + } + } + requestUpdate(t2, s2, i3) { + if (void 0 !== t2) { + if (i3 ??= this.constructor.getPropertyOptions(t2), !(i3.hasChanged ?? f)(this[t2], s2)) return; + this.P(t2, s2, i3); + } + false === this.isUpdatePending && (this._$ES = this._$ET()); + } + P(t2, s2, i3) { + this._$AL.has(t2) || this._$AL.set(t2, s2), true === i3.reflect && this._$Em !== t2 && (this._$Ej ??= /* @__PURE__ */ new Set()).add(t2); + } + async _$ET() { + this.isUpdatePending = true; + try { + await this._$ES; + } catch (t3) { + Promise.reject(t3); + } + const t2 = this.scheduleUpdate(); + return null != t2 && await t2, !this.isUpdatePending; + } + scheduleUpdate() { + return this.performUpdate(); + } + performUpdate() { + if (!this.isUpdatePending) return; + if (!this.hasUpdated) { + if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) { + for (const [t4, s3] of this._$Ep) this[t4] = s3; + this._$Ep = void 0; + } + const t3 = this.constructor.elementProperties; + if (t3.size > 0) for (const [s3, i3] of t3) true !== i3.wrapped || this._$AL.has(s3) || void 0 === this[s3] || this.P(s3, this[s3], i3); + } + let t2 = false; + const s2 = this._$AL; + try { + t2 = this.shouldUpdate(s2), t2 ? (this.willUpdate(s2), this._$EO?.forEach((t3) => t3.hostUpdate?.()), this.update(s2)) : this._$EU(); + } catch (s3) { + throw t2 = false, this._$EU(), s3; + } + t2 && this._$AE(s2); + } + willUpdate(t2) { + } + _$AE(t2) { + this._$EO?.forEach((t3) => t3.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t2)), this.updated(t2); + } + _$EU() { + this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = false; + } + get updateComplete() { + return this.getUpdateComplete(); + } + getUpdateComplete() { + return this._$ES; + } + shouldUpdate(t2) { + return true; + } + update(t2) { + this._$Ej &&= this._$Ej.forEach((t3) => this._$EC(t3, this[t3])), this._$EU(); + } + updated(t2) { + } + firstUpdated(t2) { + } +}; +b.elementStyles = [], b.shadowRootOptions = { mode: "open" }, b[d("elementProperties")] = /* @__PURE__ */ new Map(), b[d("finalized")] = /* @__PURE__ */ new Map(), p?.({ ReactiveElement: b }), (a.reactiveElementVersions ??= []).push("2.0.4"); + +// node_modules/lit-html/lit-html.js +var n3 = globalThis; +var c3 = n3.trustedTypes; +var h2 = c3 ? c3.createPolicy("lit-html", { createHTML: (t2) => t2 }) : void 0; +var f2 = "$lit$"; +var v = `lit$${Math.random().toFixed(9).slice(2)}$`; +var m = "?" + v; +var _ = `<${m}>`; +var w = document; +var lt = () => w.createComment(""); +var st = (t2) => null === t2 || "object" != typeof t2 && "function" != typeof t2; +var g = Array.isArray; +var $ = (t2) => g(t2) || "function" == typeof t2?.[Symbol.iterator]; +var x = "[ \n\f\r]"; +var T = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g; +var E = /-->/g; +var k = />/g; +var O = RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`, "g"); +var S2 = /'/g; +var j = /"/g; +var M = /^(?:script|style|textarea|title)$/i; +var P = (t2) => (i3, ...s2) => ({ _$litType$: t2, strings: i3, values: s2 }); +var ke = P(1); +var Oe = P(2); +var Se = P(3); +var R = Symbol.for("lit-noChange"); +var D = Symbol.for("lit-nothing"); +var V = /* @__PURE__ */ new WeakMap(); +var I = w.createTreeWalker(w, 129); +function N(t2, i3) { + if (!g(t2) || !t2.hasOwnProperty("raw")) throw Error("invalid template strings array"); + return void 0 !== h2 ? h2.createHTML(i3) : i3; +} +var U = (t2, i3) => { + const s2 = t2.length - 1, e4 = []; + let h4, o4 = 2 === i3 ? "" : 3 === i3 ? "" : "", n5 = T; + for (let i4 = 0; i4 < s2; i4++) { + const s3 = t2[i4]; + let r4, l2, c4 = -1, a2 = 0; + for (; a2 < s3.length && (n5.lastIndex = a2, l2 = n5.exec(s3), null !== l2); ) a2 = n5.lastIndex, n5 === T ? "!--" === l2[1] ? n5 = E : void 0 !== l2[1] ? n5 = k : void 0 !== l2[2] ? (M.test(l2[2]) && (h4 = RegExp("" === l2[0] ? (n5 = h4 ?? T, c4 = -1) : void 0 === l2[1] ? c4 = -2 : (c4 = n5.lastIndex - l2[2].length, r4 = l2[1], n5 = void 0 === l2[3] ? O : '"' === l2[3] ? j : S2) : n5 === j || n5 === S2 ? n5 = O : n5 === E || n5 === k ? n5 = T : (n5 = O, h4 = void 0); + const u2 = n5 === O && t2[i4 + 1].startsWith("/>") ? " " : ""; + o4 += n5 === T ? s3 + _ : c4 >= 0 ? (e4.push(r4), s3.slice(0, c4) + f2 + s3.slice(c4) + v + u2) : s3 + v + (-2 === c4 ? i4 : u2); + } + return [N(t2, o4 + (t2[s2] || "") + (2 === i3 ? "" : 3 === i3 ? "" : "")), e4]; +}; +var B = class _B { + constructor({ strings: t2, _$litType$: i3 }, s2) { + let e4; + this.parts = []; + let h4 = 0, o4 = 0; + const n5 = t2.length - 1, r4 = this.parts, [l2, a2] = U(t2, i3); + if (this.el = _B.createElement(l2, s2), I.currentNode = this.el.content, 2 === i3 || 3 === i3) { + const t3 = this.el.content.firstChild; + t3.replaceWith(...t3.childNodes); + } + for (; null !== (e4 = I.nextNode()) && r4.length < n5; ) { + if (1 === e4.nodeType) { + if (e4.hasAttributes()) for (const t3 of e4.getAttributeNames()) if (t3.endsWith(f2)) { + const i4 = a2[o4++], s3 = e4.getAttribute(t3).split(v), n6 = /([.?@])?(.*)/.exec(i4); + r4.push({ type: 1, index: h4, name: n6[2], strings: s3, ctor: "." === n6[1] ? Y : "?" === n6[1] ? Z : "@" === n6[1] ? q : G }), e4.removeAttribute(t3); + } else t3.startsWith(v) && (r4.push({ type: 6, index: h4 }), e4.removeAttribute(t3)); + if (M.test(e4.tagName)) { + const t3 = e4.textContent.split(v), i4 = t3.length - 1; + if (i4 > 0) { + e4.textContent = c3 ? c3.emptyScript : ""; + for (let s3 = 0; s3 < i4; s3++) e4.append(t3[s3], lt()), I.nextNode(), r4.push({ type: 2, index: ++h4 }); + e4.append(t3[i4], lt()); + } + } + } else if (8 === e4.nodeType) if (e4.data === m) r4.push({ type: 2, index: h4 }); + else { + let t3 = -1; + for (; -1 !== (t3 = e4.data.indexOf(v, t3 + 1)); ) r4.push({ type: 7, index: h4 }), t3 += v.length - 1; + } + h4++; + } + } + static createElement(t2, i3) { + const s2 = w.createElement("template"); + return s2.innerHTML = t2, s2; + } +}; +function z(t2, i3, s2 = t2, e4) { + if (i3 === R) return i3; + let h4 = void 0 !== e4 ? s2.o?.[e4] : s2.l; + const o4 = st(i3) ? void 0 : i3._$litDirective$; + return h4?.constructor !== o4 && (h4?._$AO?.(false), void 0 === o4 ? h4 = void 0 : (h4 = new o4(t2), h4._$AT(t2, s2, e4)), void 0 !== e4 ? (s2.o ??= [])[e4] = h4 : s2.l = h4), void 0 !== h4 && (i3 = z(t2, h4._$AS(t2, i3.values), h4, e4)), i3; +} +var F = class { + constructor(t2, i3) { + this._$AV = [], this._$AN = void 0, this._$AD = t2, this._$AM = i3; + } + get parentNode() { + return this._$AM.parentNode; + } + get _$AU() { + return this._$AM._$AU; + } + u(t2) { + const { el: { content: i3 }, parts: s2 } = this._$AD, e4 = (t2?.creationScope ?? w).importNode(i3, true); + I.currentNode = e4; + let h4 = I.nextNode(), o4 = 0, n5 = 0, r4 = s2[0]; + for (; void 0 !== r4; ) { + if (o4 === r4.index) { + let i4; + 2 === r4.type ? i4 = new et(h4, h4.nextSibling, this, t2) : 1 === r4.type ? i4 = new r4.ctor(h4, r4.name, r4.strings, this, t2) : 6 === r4.type && (i4 = new K(h4, this, t2)), this._$AV.push(i4), r4 = s2[++n5]; + } + o4 !== r4?.index && (h4 = I.nextNode(), o4++); + } + return I.currentNode = w, e4; + } + p(t2) { + let i3 = 0; + for (const s2 of this._$AV) void 0 !== s2 && (void 0 !== s2.strings ? (s2._$AI(t2, s2, i3), i3 += s2.strings.length - 2) : s2._$AI(t2[i3])), i3++; + } +}; +var et = class _et { + get _$AU() { + return this._$AM?._$AU ?? this.v; + } + constructor(t2, i3, s2, e4) { + this.type = 2, this._$AH = D, this._$AN = void 0, this._$AA = t2, this._$AB = i3, this._$AM = s2, this.options = e4, this.v = e4?.isConnected ?? true; + } + get parentNode() { + let t2 = this._$AA.parentNode; + const i3 = this._$AM; + return void 0 !== i3 && 11 === t2?.nodeType && (t2 = i3.parentNode), t2; + } + get startNode() { + return this._$AA; + } + get endNode() { + return this._$AB; + } + _$AI(t2, i3 = this) { + t2 = z(this, t2, i3), st(t2) ? t2 === D || null == t2 || "" === t2 ? (this._$AH !== D && this._$AR(), this._$AH = D) : t2 !== this._$AH && t2 !== R && this._(t2) : void 0 !== t2._$litType$ ? this.$(t2) : void 0 !== t2.nodeType ? this.T(t2) : $(t2) ? this.k(t2) : this._(t2); + } + O(t2) { + return this._$AA.parentNode.insertBefore(t2, this._$AB); + } + T(t2) { + this._$AH !== t2 && (this._$AR(), this._$AH = this.O(t2)); + } + _(t2) { + this._$AH !== D && st(this._$AH) ? this._$AA.nextSibling.data = t2 : this.T(w.createTextNode(t2)), this._$AH = t2; + } + $(t2) { + const { values: i3, _$litType$: s2 } = t2, e4 = "number" == typeof s2 ? this._$AC(t2) : (void 0 === s2.el && (s2.el = B.createElement(N(s2.h, s2.h[0]), this.options)), s2); + if (this._$AH?._$AD === e4) this._$AH.p(i3); + else { + const t3 = new F(e4, this), s3 = t3.u(this.options); + t3.p(i3), this.T(s3), this._$AH = t3; + } + } + _$AC(t2) { + let i3 = V.get(t2.strings); + return void 0 === i3 && V.set(t2.strings, i3 = new B(t2)), i3; + } + k(t2) { + g(this._$AH) || (this._$AH = [], this._$AR()); + const i3 = this._$AH; + let s2, e4 = 0; + for (const h4 of t2) e4 === i3.length ? i3.push(s2 = new _et(this.O(lt()), this.O(lt()), this, this.options)) : s2 = i3[e4], s2._$AI(h4), e4++; + e4 < i3.length && (this._$AR(s2 && s2._$AB.nextSibling, e4), i3.length = e4); + } + _$AR(t2 = this._$AA.nextSibling, i3) { + for (this._$AP?.(false, true, i3); t2 && t2 !== this._$AB; ) { + const i4 = t2.nextSibling; + t2.remove(), t2 = i4; + } + } + setConnected(t2) { + void 0 === this._$AM && (this.v = t2, this._$AP?.(t2)); + } +}; +var G = class { + get tagName() { + return this.element.tagName; + } + get _$AU() { + return this._$AM._$AU; + } + constructor(t2, i3, s2, e4, h4) { + this.type = 1, this._$AH = D, this._$AN = void 0, this.element = t2, this.name = i3, this._$AM = e4, this.options = h4, s2.length > 2 || "" !== s2[0] || "" !== s2[1] ? (this._$AH = Array(s2.length - 1).fill(new String()), this.strings = s2) : this._$AH = D; + } + _$AI(t2, i3 = this, s2, e4) { + const h4 = this.strings; + let o4 = false; + if (void 0 === h4) t2 = z(this, t2, i3, 0), o4 = !st(t2) || t2 !== this._$AH && t2 !== R, o4 && (this._$AH = t2); + else { + const e5 = t2; + let n5, r4; + for (t2 = h4[0], n5 = 0; n5 < h4.length - 1; n5++) r4 = z(this, e5[s2 + n5], i3, n5), r4 === R && (r4 = this._$AH[n5]), o4 ||= !st(r4) || r4 !== this._$AH[n5], r4 === D ? t2 = D : t2 !== D && (t2 += (r4 ?? "") + h4[n5 + 1]), this._$AH[n5] = r4; + } + o4 && !e4 && this.j(t2); + } + j(t2) { + t2 === D ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t2 ?? ""); + } +}; +var Y = class extends G { + constructor() { + super(...arguments), this.type = 3; + } + j(t2) { + this.element[this.name] = t2 === D ? void 0 : t2; + } +}; +var Z = class extends G { + constructor() { + super(...arguments), this.type = 4; + } + j(t2) { + this.element.toggleAttribute(this.name, !!t2 && t2 !== D); + } +}; +var q = class extends G { + constructor(t2, i3, s2, e4, h4) { + super(t2, i3, s2, e4, h4), this.type = 5; + } + _$AI(t2, i3 = this) { + if ((t2 = z(this, t2, i3, 0) ?? D) === R) return; + const s2 = this._$AH, e4 = t2 === D && s2 !== D || t2.capture !== s2.capture || t2.once !== s2.once || t2.passive !== s2.passive, h4 = t2 !== D && (s2 === D || e4); + e4 && this.element.removeEventListener(this.name, this, s2), h4 && this.element.addEventListener(this.name, this, t2), this._$AH = t2; + } + handleEvent(t2) { + "function" == typeof this._$AH ? this._$AH.call(this.options?.host ?? this.element, t2) : this._$AH.handleEvent(t2); + } +}; +var K = class { + constructor(t2, i3, s2) { + this.element = t2, this.type = 6, this._$AN = void 0, this._$AM = i3, this.options = s2; + } + get _$AU() { + return this._$AM._$AU; + } + _$AI(t2) { + z(this, t2); + } +}; +var Re = n3.litHtmlPolyfillSupport; +Re?.(B, et), (n3.litHtmlVersions ??= []).push("3.2.0"); +var Q = (t2, i3, s2) => { + const e4 = s2?.renderBefore ?? i3; + let h4 = e4._$litPart$; + if (void 0 === h4) { + const t3 = s2?.renderBefore ?? null; + e4._$litPart$ = h4 = new et(i3.insertBefore(lt(), t3), t3, void 0, s2 ?? {}); + } + return h4._$AI(t2), h4; +}; + +// node_modules/lit-element/lit-element.js +var h3 = class extends b { + constructor() { + super(...arguments), this.renderOptions = { host: this }, this.o = void 0; + } + createRenderRoot() { + const t2 = super.createRenderRoot(); + return this.renderOptions.renderBefore ??= t2.firstChild, t2; + } + update(t2) { + const e4 = this.render(); + this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t2), this.o = Q(e4, this.renderRoot, this.renderOptions); + } + connectedCallback() { + super.connectedCallback(), this.o?.setConnected(true); + } + disconnectedCallback() { + super.disconnectedCallback(), this.o?.setConnected(false); + } + render() { + return R; + } +}; +h3._$litElement$ = true, h3["finalized"] = true, globalThis.litElementHydrateSupport?.({ LitElement: h3 }); +var f3 = globalThis.litElementPolyfillSupport; +f3?.({ LitElement: h3 }); +(globalThis.litElementVersions ??= []).push("4.1.0"); + +// node_modules/@lit/reactive-element/decorators/property.js +var o3 = { attribute: true, type: String, converter: u, reflect: false, hasChanged: f }; +var r3 = (t2 = o3, e4, r4) => { + const { kind: n5, metadata: i3 } = r4; + let s2 = globalThis.litPropertyMetadata.get(i3); + if (void 0 === s2 && globalThis.litPropertyMetadata.set(i3, s2 = /* @__PURE__ */ new Map()), s2.set(r4.name, t2), "accessor" === n5) { + const { name: o4 } = r4; + return { set(r5) { + const n6 = e4.get.call(this); + e4.set.call(this, r5), this.requestUpdate(o4, n6, t2); + }, init(e5) { + return void 0 !== e5 && this.P(o4, void 0, t2), e5; + } }; + } + if ("setter" === n5) { + const { name: o4 } = r4; + return function(r5) { + const n6 = this[o4]; + e4.call(this, r5), this.requestUpdate(o4, n6, t2); + }; + } + throw Error("Unsupported decorator location: " + n5); +}; +function n4(t2) { + return (e4, o4) => "object" == typeof o4 ? r3(t2, e4, o4) : ((t3, e5, o5) => { + const r4 = e5.hasOwnProperty(o5); + return e5.constructor.createProperty(o5, r4 ? { ...t3, wrapped: true } : t3), r4 ? Object.getOwnPropertyDescriptor(e5, o5) : void 0; + })(t2, e4, o4); +} + +// js/ipywidgets_styles.ts +var legacyStyles = i` .legacy-button { align-items: center; background-color: var(--jp-layout-color2); @@ -53,7 +637,10 @@ var _t=Object.defineProperty;var bt=Object.getOwnPropertyDescriptor;var w=(o,t,e height: var(--jp-widgets-inline-height); line-height: var(--jp-widgets-inline-height); } -`;var vt=v` +`; + +// js/material_styles.ts +var materialStyles = i` @font-face { font-family: 'Material Symbols Outlined'; font-style: normal; @@ -75,7 +662,27 @@ var _t=Object.defineProperty;var bt=Object.getOwnPropertyDescriptor;var w=(o,t,e white-space: nowrap; word-wrap: normal; } -`;var $=class $ extends y{constructor(){super(...arguments);this._model=void 0;this.name="";this.visible=!0;this.opacity=0;this.isLoading=!1;this.isConfirmDialogVisible=!1}static get componentName(){return"layer-manager-row"}static{this.styles=[$t,vt,v` +`; + +// js/layer_manager_row.ts +var _LayerManagerRow = class _LayerManagerRow extends h3 { + constructor() { + super(...arguments); + this._model = void 0; + this.name = ""; + this.visible = true; + this.opacity = 0; + this.isLoading = false; + this.isConfirmDialogVisible = false; + } + static get componentName() { + return `layer-manager-row`; + } + static { + this.styles = [ + legacyStyles, + materialStyles, + i` .row { align-items: center; display: flex; @@ -144,7 +751,30 @@ var _t=Object.defineProperty;var bt=Object.getOwnPropertyDescriptor;var w=(o,t,e height: 26px; width: 70px; } - `]}static{this.modelNameToViewName=new Map([["name","name"],["visible","visible"],["opacity","opacity"],["is_loading","isLoading"]])}set model(e){this._model=e;for(let[s,i]of $.modelNameToViewName)i&&(this[i]=e.get(s),e.on(`change:${s}`,()=>{this[i]=e.get(s)}))}render(){return st` + ` + ]; + } + static { + this.modelNameToViewName = /* @__PURE__ */ new Map([ + ["name", "name"], + ["visible", "visible"], + ["opacity", "opacity"], + ["is_loading", "isLoading"] + ]); + } + set model(model) { + this._model = model; + for (const [modelKey, widgetKey] of _LayerManagerRow.modelNameToViewName) { + if (widgetKey) { + this[widgetKey] = model.get(modelKey); + model.on(`change:${modelKey}`, () => { + this[widgetKey] = model.get(modelKey); + }); + } + } + } + render() { + return ke`
${this.renderConfirmDialog()} - `}renderConfirmDialog(){return this.isConfirmDialogVisible?st` + `; + } + renderConfirmDialog() { + if (!this.isConfirmDialogVisible) { + return D; + } + return ke`
Remove layer?
- `:c}updated(e){for(let[s,i]of e)this._model?.set(s,this[s]);this._model?.save_changes()}onLayerVisibilityChanged(e){let s=e.target;this.visible=s.checked}onLayerOpacityChanged(e){let s=e.target;this.opacity=parseFloat(s.value)}onSettingsClicked(e){this._model?.send({type:"click",id:"settings"})}onDeleteClicked(e){this.isConfirmDialogVisible=!0}confirmDeletion(e){this._model?.send({type:"click",id:"delete"})}cancelDeletion(e){this.isConfirmDialogVisible=!1}};w([S()],$.prototype,"name",2),w([S()],$.prototype,"visible",2),w([S()],$.prototype,"opacity",2),w([S()],$.prototype,"isLoading",2),w([S()],$.prototype,"isConfirmDialogVisible",2);var P=$;customElements.get(P.componentName)||customElements.define(P.componentName,P);function jt({model:o,el:t}){let e=document.createElement(P.componentName);e.model=o,t.appendChild(e)}var Ve={render:jt};export{P as LayerManagerRow,Ve as default}; + `; + } + updated(changedProperties) { + for (const [property, _2] of changedProperties) { + this._model?.set(property, this[property]); + } + this._model?.save_changes(); + } + onLayerVisibilityChanged(event) { + const target = event.target; + this.visible = target.checked; + } + onLayerOpacityChanged(event) { + const target = event.target; + this.opacity = parseFloat(target.value); + } + onSettingsClicked(_2) { + this._model?.send({ "type": "click", "id": "settings" }); + } + onDeleteClicked(_2) { + this.isConfirmDialogVisible = true; + } + confirmDeletion(_2) { + this._model?.send({ "type": "click", "id": "delete" }); + } + cancelDeletion(_2) { + this.isConfirmDialogVisible = false; + } +}; +__decorateClass([ + n4() +], _LayerManagerRow.prototype, "name", 2); +__decorateClass([ + n4() +], _LayerManagerRow.prototype, "visible", 2); +__decorateClass([ + n4() +], _LayerManagerRow.prototype, "opacity", 2); +__decorateClass([ + n4() +], _LayerManagerRow.prototype, "isLoading", 2); +__decorateClass([ + n4() +], _LayerManagerRow.prototype, "isConfirmDialogVisible", 2); +var LayerManagerRow = _LayerManagerRow; +if (!customElements.get(LayerManagerRow.componentName)) { + customElements.define(LayerManagerRow.componentName, LayerManagerRow); +} +function render({ model, el }) { + const row = document.createElement(LayerManagerRow.componentName); + row.model = model; + el.appendChild(row); +} +var layer_manager_row_default = { render }; +export { + LayerManagerRow, + layer_manager_row_default as default +}; /*! Bundled license information: @lit/reactive-element/css-tag.js: @@ -301,3 +994,4 @@ lit-html/is-server.js: * SPDX-License-Identifier: BSD-3-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gaW4gdGV4dGFyZWEgdGhlcmUgbWFya2VycyB0dXJuIGludG8gdGV4dCBub2Rlcy5cbiAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAvXig/OnRleHRhcmVhfHRlbXBsYXRlKSQvaSEudGVzdCh0YWcpICYmXG4gICAgICAgICAgICAobm9kZSBhcyBFbGVtZW50KS5pbm5lckhUTUwuaW5jbHVkZXMobWFya2VyKVxuICAgICAgICAgICkge1xuICAgICAgICAgICAgY29uc3QgbSA9XG4gICAgICAgICAgICAgIGBFeHByZXNzaW9ucyBhcmUgbm90IHN1cHBvcnRlZCBpbnNpZGUgXFxgJHt0YWd9XFxgIGAgK1xuICAgICAgICAgICAgICBgZWxlbWVudHMuIFNlZSBodHRwczovL2xpdC5kZXYvbXNnL2V4cHJlc3Npb24taW4tJHt0YWd9IGZvciBtb3JlIGAgK1xuICAgICAgICAgICAgICBgaW5mb3JtYXRpb24uYDtcbiAgICAgICAgICAgIGlmICh0YWcgPT09ICd0ZW1wbGF0ZScpIHtcbiAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKG0pO1xuICAgICAgICAgICAgfSBlbHNlIGlzc3VlV2FybmluZygnJywgbSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIC8vIFRPRE8gKGp1c3RpbmZhZ25hbmkpOiBmb3IgYXR0ZW1wdGVkIGR5bmFtaWMgdGFnIG5hbWVzLCB3ZSBkb24ndFxuICAgICAgICAvLyBpbmNyZW1lbnQgdGhlIGJpbmRpbmdJbmRleCwgYW5kIGl0J2xsIGJlIG9mZiBieSAxIGluIHRoZSBlbGVtZW50XG4gICAgICAgIC8vIGFuZCBvZmYgYnkgdHdvIGFmdGVyIGl0LlxuICAgICAgICBpZiAoKG5vZGUgYXMgRWxlbWVudCkuaGFzQXR0cmlidXRlcygpKSB7XG4gICAgICAgICAgZm9yIChjb25zdCBuYW1lIG9mIChub2RlIGFzIEVsZW1lbnQpLmdldEF0dHJpYnV0ZU5hbWVzKCkpIHtcbiAgICAgICAgICAgIGlmIChuYW1lLmVuZHNXaXRoKGJvdW5kQXR0cmlidXRlU3VmZml4KSkge1xuICAgICAgICAgICAgICBjb25zdCByZWFsTmFtZSA9IGF0dHJOYW1lc1thdHRyTmFtZUluZGV4KytdO1xuICAgICAgICAgICAgICBjb25zdCB2YWx1ZSA9IChub2RlIGFzIEVsZW1lbnQpLmdldEF0dHJpYnV0ZShuYW1lKSE7XG4gICAgICAgICAgICAgIGNvbnN0IHN0YXRpY3MgPSB2YWx1ZS5zcGxpdChtYXJrZXIpO1xuICAgICAgICAgICAgICBjb25zdCBtID0gLyhbLj9AXSk/KC4qKS8uZXhlYyhyZWFsTmFtZSkhO1xuICAgICAgICAgICAgICBwYXJ0cy5wdXNoKHtcbiAgICAgICAgICAgICAgICB0eXBlOiBBVFRSSUJVVEVfUEFSVCxcbiAgICAgICAgICAgICAgICBpbmRleDogbm9kZUluZGV4LFxuICAgICAgICAgICAgICAgIG5hbWU6IG1bMl0sXG4gICAgICAgICAgICAgICAgc3RyaW5nczogc3RhdGljcyxcbiAgICAgICAgICAgICAgICBjdG9yOlxuICAgICAgICAgICAgICAgICAgbVsxXSA9PT0gJy4nXG4gICAgICAgICAgICAgICAgICAgID8gUHJvcGVydHlQYXJ0XG4gICAgICAgICAgICAgICAgICAgIDogbVsxXSA9PT0gJz8nXG4gICAgICAgICAgICAgICAgICAgICAgPyBCb29sZWFuQXR0cmlidXRlUGFydFxuICAgICAgICAgICAgICAgICAgICAgIDogbVsxXSA9PT0gJ0AnXG4gICAgICAgICAgICAgICAgICAgICAgICA/IEV2ZW50UGFydFxuICAgICAgICAgICAgICAgICAgICAgICAgOiBBdHRyaWJ1dGVQYXJ0LFxuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgKG5vZGUgYXMgRWxlbWVudCkucmVtb3ZlQXR0cmlidXRlKG5hbWUpO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChuYW1lLnN0YXJ0c1dpdGgobWFya2V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dWUgYXMgQXJyYXk8dW5rbm93bj4pW2ldID0gdjtcbiAgICAgIH1cbiAgICB9XG4gICAgaWYgKGNoYW5nZSAmJiAhbm9Db21taXQpIHtcbiAgICAgIHRoaXMuX2NvbW1pdFZhbHVlKHZhbHVlKTtcbiAgICB9XG4gIH1cblxuICAvKiogQGludGVybmFsICovXG4gIF9jb21taXRWYWx1ZSh2YWx1ZTogdW5rbm93bikge1xuICAgIGlmICh2YWx1ZSA9PT0gbm90aGluZykge1xuICAgICAgKHdyYXAodGhpcy5lbGVtZW50KSBhcyBFbGVtZW50KS5yZW1vdmVBdHRyaWJ1dGUodGhpcy5uYW1lKTtcbiAgICB9IGVsc2Uge1xuICAgICAgaWYgKEVOQUJMRV9FWFRSQV9TRUNVUklUWV9IT09LUykge1xuICAgICAgICBpZiAodGhpcy5fc2FuaXRpemVyID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICB0aGlzLl9zYW5pdGl6ZXIgPSBzYW5pdGl6ZXJGYWN0b3J5SW50ZXJuYWwoXG4gICAgICAgICAgICB0aGlzLmVsZW1lbnQsXG4gICAgICAgICAgICB0aGlzLm5hbWUsXG4gICAgICAgICAgICAnYXR0cmlidXRlJyxcbiAgICAgICAgICApO1xuICAgICAgICB9XG4gICAgICAgIHZhbHVlID0gdGhpcy5fc2FuaXRpemVyKHZhbHVlID8/ICcnKTtcbiAgICAgIH1cbiAgICAgIGRlYnVnTG9nRXZlbnQgJiZcbiAgICAgICAgZGVidWdMb2dFdmVudCh7XG4gICAgICAgICAga2luZDogJ2NvbW1pdCBhdHRyaWJ1dGUnLFxuICAgICAgICAgIGVsZW1lbnQ6IHRoaXMuZWxlbWVudCxcbiAgICAgICAgICBuYW1lOiB0aGlzLm5hbWUsXG4gICAgICAgICAgdmFsdWUsXG4gICAgICAgICAgb3B0aW9uczogdGhpcy5vcHRpb25zLFxuICAgICAgICB9KTtcbiAgICAgICh3cmFwKHRoaXMuZWxlbWVudCkgYXMgRWxlbWVudCkuc2V0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xuICAgICAgICAgICAgICAgIHRleHQtb3ZlcmZsb3c6IGVsbGlwc2lzO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAuc2V0dGluZ3MtZGVsZXRlLWJ1dHRvbiB7XG4gICAgICAgICAgICAgICAgZm9udC1zaXplOiAxNHB4O1xuICAgICAgICAgICAgICAgIGhlaWdodDogMjZweDtcbiAgICAgICAgICAgICAgICB3aWR0aDogMjZweDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLmxheWVyLW9wYWNpdHktc2xpZGVyIHtcbiAgICAgICAgICAgICAgICB3aWR0aDogNzBweDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLmxheWVyLXZpc2liaWxpdHktY2hlY2tib3gge1xuICAgICAgICAgICAgICAgIG1hcmdpbjogMnB4O1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAuc3Bpbm5lciB7XG4gICAgICAgICAgICAgICAgLXdlYmtpdC1hbmltYXRpb246IHNwaW4gMnMgbGluZWFyIGluZmluaXRlO1xuICAgICAgICAgICAgICAgIGFuaW1hdGlvbjogc3BpbiAycyBsaW5lYXIgaW5maW5pdGU7XG4gICAgICAgICAgICAgICAgYm9yZGVyLXJhZGl1czogNTAlO1xuICAgICAgICAgICAgICAgIGJvcmRlcjogNHB4IHNvbGlkIHZhcigtLWpwLXdpZGdldHMtaW5wdXQtYm9yZGVyLWNvbG9yKTtcbiAgICAgICAgICAgICAgICBib3JkZXItdG9wOiA0cHggc29saWQgdmFyKC0tanAtd2lkZ2V0cy1jb2xvcik7XG4gICAgICAgICAgICAgICAgaGVpZ2h0OiAxMnB4O1xuICAgICAgICAgICAgICAgIHdpZHRoOiAxMnB4O1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBALXdlYmtpdC1rZXlmcmFtZXMgc3BpbiB7XG4gICAgICAgICAgICAgICAgMCUgeyAtd2Via2l0LXRyYW5zZm9ybTogcm90YXRlKDBkZWcpOyB9XG4gICAgICAgICAgICAgICAgMTAwJSB7IC13ZWJraXQtdHJhbnNmb3JtOiByb3RhdGUoMzYwZGVnKTsgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBAa2V5ZnJhbWVzIHNwaW4ge1xuICAgICAgICAgICAgICAgIDAlIHsgdHJhbnNmb3JtOiByb3RhdGUoMGRlZyk7IH1cbiAgICAgICAgICAgICAgICAxMDAlIHsgdHJhbnNmb3JtOiByb3RhdGUoMzYwZGVnKTsgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBidXR0b24ubG9hZGluZyAuc3Bpbm5lcixcbiAgICAgICAgICAgIGJ1dHRvbi5sb2FkaW5nOmhvdmVyIC5jbG9zZS1pY29uLFxuICAgICAgICAgICAgYnV0dG9uLmRvbmUtbG9hZGluZyAuY2xvc2UtaWNvbiB7XG4gICAgICAgICAgICAgICAgZGlzcGxheTogYmxvY2s7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGJ1dHRvbi5sb2FkaW5nIC5jbG9zZS1pY29uLFxuICAgICAgICAgICAgYnV0dG9uLmxvYWRpbmc6aG92ZXIgLnNwaW5uZXIsXG4gICAgICAgICAgICBidXR0b24uZG9uZS1sb2FkaW5nIC5zcGlubmVyIHtcbiAgICAgICAgICAgICAgICBkaXNwbGF5OiBub25lO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAucmVtb3ZlLWxheWVyLXRleHQge1xuICAgICAgICAgICAgICAgIGZsZXgtZ3JvdzogMTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLmNvbmZpcm0tZGVueS1idXR0b24ge1xuICAgICAgICAgICAgICAgIGhlaWdodDogMjZweDtcbiAgICAgICAgICAgICAgICB3aWR0aDogNzBweDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgYCxcbiAgICBdO1xuXG4gICAgcHJpdmF0ZSBfbW9kZWw6IEFueU1vZGVsPExheWVyTWFuYWdlclJvd01vZGVsPiB8IHVuZGVmaW5lZCA9IHVuZGVma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XG4gICAgQHByb3BlcnR5KClcbiAgICBuYW1lOiBzdHJpbmcgPSBcIlwiO1xuXG4gICAgQHByb3BlcnR5KClcbiAgICB2aXNpYmxlOiBib29sZWFuID0gdHJ1ZTtcblxuICAgIEBwcm9wZXJ0eSgpXG4gICAgb3BhY2l0eTogbnVtYmVyID0gMDtcblxuICAgIEBwcm9wZXJ0eSgpXG4gICAgaXNMb2FkaW5nOiBib29sZWFuID0gZmFsc2U7XG5cbiAgICBAcHJvcGVydHkoKVxuICAgIGlzQ29uZmlybURpYWxvZ1Zpc2libGU6IGJvb2xlYW4gPSBmYWxzZTtcblxuICAgIHJlbmRlcigpOiBUZW1wbGF0ZVJlc3VsdCB7XG4gICAgICAgIHJldHVybiBodG1sYFxuICAgICAgICAgICAgPGRpdiBjbGFzcz1cInJvd1wiPlxuICAgICAgICAgICAgICAgIDxpbnB1dFxuICAgICAgICAgICAgICAgICAgICB0eXBlPVwiY2hlY2tib3hcIlxuICAgICAgICAgICAgICAgICAgICBjbGFzcz1cImxheWVyLXZpc2liaWxpdHktY2hlY2tib3hcIlxuICAgICAgICAgICAgICAgICAgICAuY2hlY2tlZD1cIiR7dGhpcy52aXNpYmxlfVwiXG4gICAgICAgICAgICAgICAgICAgIEBjaGFuZ2U9XCIke3RoaXMub25MYXllclZpc2liaWxpdHlDaGFuZ2VkfVwiXG4gICAgICAgICAgICAgICAgLz5cbiAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cImxlZ2FjeS10ZXh0IGxheWVyLW5hbWVcIj4ke3RoaXMubmFtZX08L3NwYW4+XG4gICAgICAgICAgICAgICAgPGlucHV0XG4gICAgICAgICAgICAgICAgICAgIHR5cGU9XCJyYW5nZVwiXG4gICAgICAgICAgICAgICAgICAgIGNsYXNzPVwibGVnYWN5LXNsaWRlciBsYXllci1vcGFjaXR5LXNsaWRlclwiXG4gICAgICAgICAgICAgICAgICAgIG1pbj1cIjBcIlxuICAgICAgICAgICAgICAgICAgICBtYXg9XCIxXCJcbiAgICAgICAgICAgICAgICAgICAgc3RlcD1cIjAuMDFcIlxuICAgICAgICAgICAgICAgICAgICAudmFsdWU9XCIke3RoaXMub3BhY2l0eX1cIlxuICAgICAgICAgICAgICAgICAgICBAaW5wdXQ9XCIke3RoaXMub25MYXllck9wYWNpdHlDaGFuZ2VkfVwiXG4gICAgICAgICAgICAgICAgLz5cbiAgICAgICAgICAgICAgICA8YnV0dG9uXG4gICAgICAgICAgICAgICAgICAgIGNsYXNzPVwibGVnYWN5LWJ1dHRvbiBzZXR0aW5ncy1kZWxldGUtYnV0dG9uXCJcbiAgICAgICAgICAgICAgICAgICAgQGNsaWNrPVwiJHt0aGlzLm9uU2V0dGluZ3NDbGlja2VkfVwiXG4gICAgICAgICAgICAgICAgPlxuICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cIm1hdGVyaWFsLXN5bWJvbHMtb3V0bGluZWRcIj4mI3hlOGI4Ozwvc3Bhbj5cbiAgICAgICAgICAgICAgICA8L2J1dHRvbj5cbiAgICAgICAgICAgICAgICA8YnV0dG9uXG4gICAgICAgICAgICAgICAgICAgIGNsYXNzPVwibGVnYWN5LWJ1dHRvbiBzZXR0aW5ncy1kZWxldGUtYnV0dG9uICR7dGhpcy5pc0xvYWRpbmcgPyAnbG9hZGluZycgOiAnZG9uZS1sb2FkaW5nJ31cIlxuICAgICAgICAgICAgICAgICAgICBAY2xpY2s9XCIke3RoaXMub25EZWxldGVDbGlja2VkfVwiXG4gICAgICAgICAgICAgICAgPlxuICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwic3Bpbm5lclwiPjwvZGl2PlxuICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cImNsb3NlLWljb24gbWF0ZXJpYWwtc3ltYm9scy1vdXRsaW5lZFwiPiYjeGU1Y2Q7PC9zcGFuPlxuICAgICAgICAgICAgICAgIDwvYnV0dG9uPlxuICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICAke3RoaXMucmVuZGVyQ29uZmlybURpYWxvZygpfVxuICAgICAgICBgO1xuICAgIH1cblxuICAgIHByaXZhdGUgcmVuZGVyQ29uZmlybURpYWxvZygpOiBUZW1wbGF0ZVJlc3VsdCB8IHZvaWQge1xuICAgICAgICBpZiAoIXRoaXMuaXNDb25maXJtRGlhbG9nVmlzaWJsZSkge1xuICAgICAgICAgICAgcmV0dXJuIG5vdGhpbmc7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGh0bWxgXG4gICAgICAgICAgICA8ZGl2IGNsYXNzPVwicm93XCI+XG4gICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJsZWdhY3ktdGV4dCByZW1vdmUtbGF5ZXItdGV4dFwiPlJlbW92ZSBsYXllcj88L3NwYW4+XG4gICAgICAgICAgICAgICAgICAgIDxidXR0b25cbiAgICAgICAgICAgICAgICAgICAgICAgIGNsYXNzPVwibGVnYWN5LWJ1dHRvbiBwcmltYXJ5IGNvbmZpcm0tZGVueS1idXR0b25cIlxuICAgICAgICAgICAgICAgICAgICAgICAgQGNsaWNrPVwiJHt0aGlzLmNvbmZpcm1EZWxldGlvbn1cIlxuICAgICAgICAgICAgICAgICAgICA+XG4gICAgICAgICAgICAgICAgICAgICAgICBZZXNcbiAgICAgICAgICAgICAgICAgICAgPC9idXR0b24+XG4gICAgICAgICAgICAgICAgICAgIDxidXR0b25cbiAgICAgICAgICAgICAgICAgICAgICAgIGNsYXNzPVwibGVnYWN5LWJ1dHRvbiBwcmltYXJ5IGNvbmZpcm0tZGVueS1idXR0b25cIlxuICAgICAgICAgICAgICAgICAgICAgICAgQGNsaWNrPVwiJHt0aGlzLmNhbmNlbERlbGV0aW9ufVwiXG4gICAgICAgICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICAgICAgICAgIE5vXG4gICAgICAgICAgICAgICAgICAgIDwvYnV0dG9uPlxuICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgIGA7XG4gICAgfVxuXG4gICAgdXBkYXRl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JkaXNjb25uZWN0ZWRDYWxsYmFjayIsICJub0NoYW5nZSIsICJnbG9iYWxUaGlzIiwgImxpdEVsZW1lbnRIeWRyYXRlU3VwcG9ydCIsICJwb2x5ZmlsbFN1cHBvcnQiLCAibGl0RWxlbWVudFBvbHlmaWxsU3VwcG9ydCIsICJnbG9iYWxUaGlzIiwgImxpdEVsZW1lbnRWZXJzaW9ucyIsICJwdXNoIiwgImRlZmF1bHRQcm9wZXJ0eURlY2xhcmF0aW9uIiwgImF0dHJpYnV0ZSIsICJ0eXBlIiwgIlN0cmluZyIsICJjb252ZXJ0ZXIiLCAiZGVmYXVsdENvbnZlcnRlciIsICJyZWZsZWN0IiwgImhhc0NoYW5nZWQiLCAibm90RXF1YWwiLCAic3RhbmRhcmRQcm9wZXJ0eSIsICJvcHRpb25zIiwgInRhcmdldCIsICJjb250ZXh0IiwgImtpbmQiLCAibWV0YWRhdGEiLCAicHJvcGVydGllcyIsICJnbG9iYWxUaGlzIiwgImxpdFByb3BlcnR5TWV0YWRhdGEiLCAiZ2V0IiwgInNldCIsICJNYXAiLCAibmFtZSIsICJ2IiwgIm9sZFZhbHVlIiwgImNhbGwiLCAidGhpcyIsICJyZXF1ZXN0VXBkYXRlIiwgIl8kY2hhbmdlUHJvcGVydHkiLCAidmFsdWUiLCAiRXJyb3IiLCAicHJvcGVydHkiLCAicHJvdG9PclRhcmdldCIsICJuYW1lT3JDb250ZXh0IiwgInByb3RvIiwgImhhc093blByb3BlcnR5IiwgImNvbnN0cnVjdG9yIiwgImNyZWF0ZVByb3BlcnR5IiwgIndyYXBwZWQiLCAiT2JqZWN0IiwgImdldE93blByb3BlcnR5RGVzY3JpcHRvciIsICJoIiwgIl8iLCAibiJdCn0K diff --git a/geemap/static/material_styles.js b/geemap/static/material_styles.js index d5a7762b34..2e561ad473 100644 --- a/geemap/static/material_styles.js +++ b/geemap/static/material_styles.js @@ -1,6 +1,549 @@ -var R=globalThis,T=R.ShadowRoot&&(R.ShadyCSS===void 0||R.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,L=Symbol(),F=new WeakMap,b=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==L)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(T&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=F.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&F.set(e,t))}return t}toString(){return this.cssText}},Q=o=>new b(typeof o=="string"?o:o+"",void 0,L),z=(o,...t)=>{let e=o.length===1?o[0]:t.reduce((s,i,r)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+o[r+1],o[0]);return new b(e,o,L)},I=(o,t)=>{if(T)o.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=R.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,o.appendChild(s)}},M=T?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return Q(e)})(o):o;var{is:pt,defineProperty:ut,getOwnPropertyDescriptor:$t,getOwnPropertyNames:ft,getOwnPropertySymbols:_t,getPrototypeOf:mt}=Object,N=globalThis,Y=N.trustedTypes,At=Y?Y.emptyScript:"",gt=N.reactiveElementPolyfillSupport,w=(o,t)=>o,j={toAttribute(o,t){switch(t){case Boolean:o=o?At:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},tt=(o,t)=>!pt(o,t),G={attribute:!0,type:String,converter:j,reflect:!1,hasChanged:tt};Symbol.metadata??=Symbol("metadata"),N.litPropertyMetadata??=new WeakMap;var $=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=G){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&ut(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:r}=$t(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i?.call(this)},set(n){let p=i?.call(this);r.call(this,n),this.requestUpdate(t,p,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??G}static _$Ei(){if(this.hasOwnProperty(w("elementProperties")))return;let t=mt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(w("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(w("properties"))){let e=this.properties,s=[...ft(e),..._t(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(M(i))}else t!==void 0&&e.push(M(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return I(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let r=(s.converter?.toAttribute!==void 0?s.converter:j).toAttribute(e,s.type);this._$Em=t,r==null?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let r=s.getPropertyOptions(i),n=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute!==void 0?r.converter:j;this._$Em=i,this[i]=n.fromAttribute(e,r.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??tt)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,r]of this._$Ep)this[i]=r;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,r]of s)r.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],r)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[w("elementProperties")]=new Map,$[w("finalized")]=new Map,gt?.({ReactiveElement:$}),(N.reactiveElementVersions??=[]).push("2.0.4");var K=globalThis,k=K.trustedTypes,et=k?k.createPolicy("lit-html",{createHTML:o=>o}):void 0,ht="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,at="?"+_,yt=`<${at}>`,g=document,x=()=>g.createComment(""),P=o=>o===null||typeof o!="object"&&typeof o!="function",X=Array.isArray,vt=o=>X(o)||typeof o?.[Symbol.iterator]=="function",B=`[ -\f\r]`,C=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,st=/-->/g,it=/>/g,m=RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^ -\f\r"'\`<>=]|("|')|))|$)`,"g"),ot=/'/g,rt=/"/g,lt=/^(?:script|style|textarea|title)$/i,Z=o=>(t,...e)=>({_$litType$:o,strings:t,values:e}),Ut=Z(1),Ht=Z(2),Ot=Z(3),y=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),nt=new WeakMap,A=g.createTreeWalker(g,129);function ct(o,t){if(!X(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return et!==void 0?et.createHTML(t):t}var St=(o,t)=>{let e=o.length-1,s=[],i,r=t===2?"":t===3?"":"",n=C;for(let p=0;p"?(n=i??C,a=-1):d[1]===void 0?a=-2:(a=n.lastIndex-d[2].length,l=d[1],n=d[3]===void 0?m:d[3]==='"'?rt:ot):n===rt||n===ot?n=m:n===st||n===it?n=C:(n=m,i=void 0);let f=n===m&&o[p+1].startsWith("/>")?" ":"";r+=n===C?h+yt:a>=0?(s.push(l),h.slice(0,a)+ht+h.slice(a)+_+f):h+_+(a===-2?p:f)}return[ct(o,r+(o[e]||"")+(t===2?"":t===3?"":"")),s]},U=class o{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let r=0,n=0,p=t.length-1,h=this.parts,[l,d]=St(t,e);if(this.el=o.createElement(l,s),A.currentNode=this.el.content,e===2||e===3){let a=this.el.content.firstChild;a.replaceWith(...a.childNodes)}for(;(i=A.nextNode())!==null&&h.length0){i.textContent=k?k.emptyScript:"";for(let f=0;f2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=c}_$AI(t,e=this,s,i){let r=this.strings,n=!1;if(r===void 0)t=v(this,t,e,0),n=!P(t)||t!==this._$AH&&t!==y,n&&(this._$AH=t);else{let p=t,h,l;for(t=r[0],h=0;h{let s=e?.renderBefore??t,i=s._$litPart$;if(i===void 0){let r=e?.renderBefore??null;s._$litPart$=i=new H(t.insertBefore(x(),r),r,void 0,e??{})}return i._$AI(o),i};var E=class extends ${constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=dt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return y}};E._$litElement$=!0,E.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:E});var bt=globalThis.litElementPolyfillSupport;bt?.({LitElement:E});(globalThis.litElementVersions??=[]).push("4.1.0");var Jt=z` +// node_modules/@lit/reactive-element/css-tag.js +var t = globalThis; +var e = t.ShadowRoot && (void 0 === t.ShadyCSS || t.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype; +var s = Symbol(); +var o = /* @__PURE__ */ new WeakMap(); +var n = class { + constructor(t2, e3, o3) { + if (this._$cssResult$ = true, o3 !== s) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead."); + this.cssText = t2, this.t = e3; + } + get styleSheet() { + let t2 = this.o; + const s2 = this.t; + if (e && void 0 === t2) { + const e3 = void 0 !== s2 && 1 === s2.length; + e3 && (t2 = o.get(s2)), void 0 === t2 && ((this.o = t2 = new CSSStyleSheet()).replaceSync(this.cssText), e3 && o.set(s2, t2)); + } + return t2; + } + toString() { + return this.cssText; + } +}; +var r = (t2) => new n("string" == typeof t2 ? t2 : t2 + "", void 0, s); +var i = (t2, ...e3) => { + const o3 = 1 === t2.length ? t2[0] : e3.reduce((e4, s2, o4) => e4 + ((t3) => { + if (true === t3._$cssResult$) return t3.cssText; + if ("number" == typeof t3) return t3; + throw Error("Value passed to 'css' function must be a 'css' function result: " + t3 + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security."); + })(s2) + t2[o4 + 1], t2[0]); + return new n(o3, t2, s); +}; +var S = (s2, o3) => { + if (e) s2.adoptedStyleSheets = o3.map((t2) => t2 instanceof CSSStyleSheet ? t2 : t2.styleSheet); + else for (const e3 of o3) { + const o4 = document.createElement("style"), n4 = t.litNonce; + void 0 !== n4 && o4.setAttribute("nonce", n4), o4.textContent = e3.cssText, s2.appendChild(o4); + } +}; +var c = e ? (t2) => t2 : (t2) => t2 instanceof CSSStyleSheet ? ((t3) => { + let e3 = ""; + for (const s2 of t3.cssRules) e3 += s2.cssText; + return r(e3); +})(t2) : t2; + +// node_modules/@lit/reactive-element/reactive-element.js +var { is: i2, defineProperty: e2, getOwnPropertyDescriptor: r2, getOwnPropertyNames: h, getOwnPropertySymbols: o2, getPrototypeOf: n2 } = Object; +var a = globalThis; +var c2 = a.trustedTypes; +var l = c2 ? c2.emptyScript : ""; +var p = a.reactiveElementPolyfillSupport; +var d = (t2, s2) => t2; +var u = { toAttribute(t2, s2) { + switch (s2) { + case Boolean: + t2 = t2 ? l : null; + break; + case Object: + case Array: + t2 = null == t2 ? t2 : JSON.stringify(t2); + } + return t2; +}, fromAttribute(t2, s2) { + let i3 = t2; + switch (s2) { + case Boolean: + i3 = null !== t2; + break; + case Number: + i3 = null === t2 ? null : Number(t2); + break; + case Object: + case Array: + try { + i3 = JSON.parse(t2); + } catch (t3) { + i3 = null; + } + } + return i3; +} }; +var f = (t2, s2) => !i2(t2, s2); +var y = { attribute: true, type: String, converter: u, reflect: false, hasChanged: f }; +Symbol.metadata ??= Symbol("metadata"), a.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap(); +var b = class extends HTMLElement { + static addInitializer(t2) { + this._$Ei(), (this.l ??= []).push(t2); + } + static get observedAttributes() { + return this.finalize(), this._$Eh && [...this._$Eh.keys()]; + } + static createProperty(t2, s2 = y) { + if (s2.state && (s2.attribute = false), this._$Ei(), this.elementProperties.set(t2, s2), !s2.noAccessor) { + const i3 = Symbol(), r3 = this.getPropertyDescriptor(t2, i3, s2); + void 0 !== r3 && e2(this.prototype, t2, r3); + } + } + static getPropertyDescriptor(t2, s2, i3) { + const { get: e3, set: h4 } = r2(this.prototype, t2) ?? { get() { + return this[s2]; + }, set(t3) { + this[s2] = t3; + } }; + return { get() { + return e3?.call(this); + }, set(s3) { + const r3 = e3?.call(this); + h4.call(this, s3), this.requestUpdate(t2, r3, i3); + }, configurable: true, enumerable: true }; + } + static getPropertyOptions(t2) { + return this.elementProperties.get(t2) ?? y; + } + static _$Ei() { + if (this.hasOwnProperty(d("elementProperties"))) return; + const t2 = n2(this); + t2.finalize(), void 0 !== t2.l && (this.l = [...t2.l]), this.elementProperties = new Map(t2.elementProperties); + } + static finalize() { + if (this.hasOwnProperty(d("finalized"))) return; + if (this.finalized = true, this._$Ei(), this.hasOwnProperty(d("properties"))) { + const t3 = this.properties, s2 = [...h(t3), ...o2(t3)]; + for (const i3 of s2) this.createProperty(i3, t3[i3]); + } + const t2 = this[Symbol.metadata]; + if (null !== t2) { + const s2 = litPropertyMetadata.get(t2); + if (void 0 !== s2) for (const [t3, i3] of s2) this.elementProperties.set(t3, i3); + } + this._$Eh = /* @__PURE__ */ new Map(); + for (const [t3, s2] of this.elementProperties) { + const i3 = this._$Eu(t3, s2); + void 0 !== i3 && this._$Eh.set(i3, t3); + } + this.elementStyles = this.finalizeStyles(this.styles); + } + static finalizeStyles(s2) { + const i3 = []; + if (Array.isArray(s2)) { + const e3 = new Set(s2.flat(1 / 0).reverse()); + for (const s3 of e3) i3.unshift(c(s3)); + } else void 0 !== s2 && i3.push(c(s2)); + return i3; + } + static _$Eu(t2, s2) { + const i3 = s2.attribute; + return false === i3 ? void 0 : "string" == typeof i3 ? i3 : "string" == typeof t2 ? t2.toLowerCase() : void 0; + } + constructor() { + super(), this._$Ep = void 0, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev(); + } + _$Ev() { + this._$ES = new Promise((t2) => this.enableUpdating = t2), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((t2) => t2(this)); + } + addController(t2) { + (this._$EO ??= /* @__PURE__ */ new Set()).add(t2), void 0 !== this.renderRoot && this.isConnected && t2.hostConnected?.(); + } + removeController(t2) { + this._$EO?.delete(t2); + } + _$E_() { + const t2 = /* @__PURE__ */ new Map(), s2 = this.constructor.elementProperties; + for (const i3 of s2.keys()) this.hasOwnProperty(i3) && (t2.set(i3, this[i3]), delete this[i3]); + t2.size > 0 && (this._$Ep = t2); + } + createRenderRoot() { + const t2 = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions); + return S(t2, this.constructor.elementStyles), t2; + } + connectedCallback() { + this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach((t2) => t2.hostConnected?.()); + } + enableUpdating(t2) { + } + disconnectedCallback() { + this._$EO?.forEach((t2) => t2.hostDisconnected?.()); + } + attributeChangedCallback(t2, s2, i3) { + this._$AK(t2, i3); + } + _$EC(t2, s2) { + const i3 = this.constructor.elementProperties.get(t2), e3 = this.constructor._$Eu(t2, i3); + if (void 0 !== e3 && true === i3.reflect) { + const r3 = (void 0 !== i3.converter?.toAttribute ? i3.converter : u).toAttribute(s2, i3.type); + this._$Em = t2, null == r3 ? this.removeAttribute(e3) : this.setAttribute(e3, r3), this._$Em = null; + } + } + _$AK(t2, s2) { + const i3 = this.constructor, e3 = i3._$Eh.get(t2); + if (void 0 !== e3 && this._$Em !== e3) { + const t3 = i3.getPropertyOptions(e3), r3 = "function" == typeof t3.converter ? { fromAttribute: t3.converter } : void 0 !== t3.converter?.fromAttribute ? t3.converter : u; + this._$Em = e3, this[e3] = r3.fromAttribute(s2, t3.type), this._$Em = null; + } + } + requestUpdate(t2, s2, i3) { + if (void 0 !== t2) { + if (i3 ??= this.constructor.getPropertyOptions(t2), !(i3.hasChanged ?? f)(this[t2], s2)) return; + this.P(t2, s2, i3); + } + false === this.isUpdatePending && (this._$ES = this._$ET()); + } + P(t2, s2, i3) { + this._$AL.has(t2) || this._$AL.set(t2, s2), true === i3.reflect && this._$Em !== t2 && (this._$Ej ??= /* @__PURE__ */ new Set()).add(t2); + } + async _$ET() { + this.isUpdatePending = true; + try { + await this._$ES; + } catch (t3) { + Promise.reject(t3); + } + const t2 = this.scheduleUpdate(); + return null != t2 && await t2, !this.isUpdatePending; + } + scheduleUpdate() { + return this.performUpdate(); + } + performUpdate() { + if (!this.isUpdatePending) return; + if (!this.hasUpdated) { + if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) { + for (const [t4, s3] of this._$Ep) this[t4] = s3; + this._$Ep = void 0; + } + const t3 = this.constructor.elementProperties; + if (t3.size > 0) for (const [s3, i3] of t3) true !== i3.wrapped || this._$AL.has(s3) || void 0 === this[s3] || this.P(s3, this[s3], i3); + } + let t2 = false; + const s2 = this._$AL; + try { + t2 = this.shouldUpdate(s2), t2 ? (this.willUpdate(s2), this._$EO?.forEach((t3) => t3.hostUpdate?.()), this.update(s2)) : this._$EU(); + } catch (s3) { + throw t2 = false, this._$EU(), s3; + } + t2 && this._$AE(s2); + } + willUpdate(t2) { + } + _$AE(t2) { + this._$EO?.forEach((t3) => t3.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t2)), this.updated(t2); + } + _$EU() { + this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = false; + } + get updateComplete() { + return this.getUpdateComplete(); + } + getUpdateComplete() { + return this._$ES; + } + shouldUpdate(t2) { + return true; + } + update(t2) { + this._$Ej &&= this._$Ej.forEach((t3) => this._$EC(t3, this[t3])), this._$EU(); + } + updated(t2) { + } + firstUpdated(t2) { + } +}; +b.elementStyles = [], b.shadowRootOptions = { mode: "open" }, b[d("elementProperties")] = /* @__PURE__ */ new Map(), b[d("finalized")] = /* @__PURE__ */ new Map(), p?.({ ReactiveElement: b }), (a.reactiveElementVersions ??= []).push("2.0.4"); + +// node_modules/lit-html/lit-html.js +var n3 = globalThis; +var c3 = n3.trustedTypes; +var h2 = c3 ? c3.createPolicy("lit-html", { createHTML: (t2) => t2 }) : void 0; +var f2 = "$lit$"; +var v = `lit$${Math.random().toFixed(9).slice(2)}$`; +var m = "?" + v; +var _ = `<${m}>`; +var w = document; +var lt = () => w.createComment(""); +var st = (t2) => null === t2 || "object" != typeof t2 && "function" != typeof t2; +var g = Array.isArray; +var $ = (t2) => g(t2) || "function" == typeof t2?.[Symbol.iterator]; +var x = "[ \n\f\r]"; +var T = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g; +var E = /-->/g; +var k = />/g; +var O = RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`, "g"); +var S2 = /'/g; +var j = /"/g; +var M = /^(?:script|style|textarea|title)$/i; +var P = (t2) => (i3, ...s2) => ({ _$litType$: t2, strings: i3, values: s2 }); +var ke = P(1); +var Oe = P(2); +var Se = P(3); +var R = Symbol.for("lit-noChange"); +var D = Symbol.for("lit-nothing"); +var V = /* @__PURE__ */ new WeakMap(); +var I = w.createTreeWalker(w, 129); +function N(t2, i3) { + if (!g(t2) || !t2.hasOwnProperty("raw")) throw Error("invalid template strings array"); + return void 0 !== h2 ? h2.createHTML(i3) : i3; +} +var U = (t2, i3) => { + const s2 = t2.length - 1, e3 = []; + let h4, o3 = 2 === i3 ? "" : 3 === i3 ? "" : "", n4 = T; + for (let i4 = 0; i4 < s2; i4++) { + const s3 = t2[i4]; + let r3, l2, c4 = -1, a2 = 0; + for (; a2 < s3.length && (n4.lastIndex = a2, l2 = n4.exec(s3), null !== l2); ) a2 = n4.lastIndex, n4 === T ? "!--" === l2[1] ? n4 = E : void 0 !== l2[1] ? n4 = k : void 0 !== l2[2] ? (M.test(l2[2]) && (h4 = RegExp("" === l2[0] ? (n4 = h4 ?? T, c4 = -1) : void 0 === l2[1] ? c4 = -2 : (c4 = n4.lastIndex - l2[2].length, r3 = l2[1], n4 = void 0 === l2[3] ? O : '"' === l2[3] ? j : S2) : n4 === j || n4 === S2 ? n4 = O : n4 === E || n4 === k ? n4 = T : (n4 = O, h4 = void 0); + const u2 = n4 === O && t2[i4 + 1].startsWith("/>") ? " " : ""; + o3 += n4 === T ? s3 + _ : c4 >= 0 ? (e3.push(r3), s3.slice(0, c4) + f2 + s3.slice(c4) + v + u2) : s3 + v + (-2 === c4 ? i4 : u2); + } + return [N(t2, o3 + (t2[s2] || "") + (2 === i3 ? "" : 3 === i3 ? "" : "")), e3]; +}; +var B = class _B { + constructor({ strings: t2, _$litType$: i3 }, s2) { + let e3; + this.parts = []; + let h4 = 0, o3 = 0; + const n4 = t2.length - 1, r3 = this.parts, [l2, a2] = U(t2, i3); + if (this.el = _B.createElement(l2, s2), I.currentNode = this.el.content, 2 === i3 || 3 === i3) { + const t3 = this.el.content.firstChild; + t3.replaceWith(...t3.childNodes); + } + for (; null !== (e3 = I.nextNode()) && r3.length < n4; ) { + if (1 === e3.nodeType) { + if (e3.hasAttributes()) for (const t3 of e3.getAttributeNames()) if (t3.endsWith(f2)) { + const i4 = a2[o3++], s3 = e3.getAttribute(t3).split(v), n5 = /([.?@])?(.*)/.exec(i4); + r3.push({ type: 1, index: h4, name: n5[2], strings: s3, ctor: "." === n5[1] ? Y : "?" === n5[1] ? Z : "@" === n5[1] ? q : G }), e3.removeAttribute(t3); + } else t3.startsWith(v) && (r3.push({ type: 6, index: h4 }), e3.removeAttribute(t3)); + if (M.test(e3.tagName)) { + const t3 = e3.textContent.split(v), i4 = t3.length - 1; + if (i4 > 0) { + e3.textContent = c3 ? c3.emptyScript : ""; + for (let s3 = 0; s3 < i4; s3++) e3.append(t3[s3], lt()), I.nextNode(), r3.push({ type: 2, index: ++h4 }); + e3.append(t3[i4], lt()); + } + } + } else if (8 === e3.nodeType) if (e3.data === m) r3.push({ type: 2, index: h4 }); + else { + let t3 = -1; + for (; -1 !== (t3 = e3.data.indexOf(v, t3 + 1)); ) r3.push({ type: 7, index: h4 }), t3 += v.length - 1; + } + h4++; + } + } + static createElement(t2, i3) { + const s2 = w.createElement("template"); + return s2.innerHTML = t2, s2; + } +}; +function z(t2, i3, s2 = t2, e3) { + if (i3 === R) return i3; + let h4 = void 0 !== e3 ? s2.o?.[e3] : s2.l; + const o3 = st(i3) ? void 0 : i3._$litDirective$; + return h4?.constructor !== o3 && (h4?._$AO?.(false), void 0 === o3 ? h4 = void 0 : (h4 = new o3(t2), h4._$AT(t2, s2, e3)), void 0 !== e3 ? (s2.o ??= [])[e3] = h4 : s2.l = h4), void 0 !== h4 && (i3 = z(t2, h4._$AS(t2, i3.values), h4, e3)), i3; +} +var F = class { + constructor(t2, i3) { + this._$AV = [], this._$AN = void 0, this._$AD = t2, this._$AM = i3; + } + get parentNode() { + return this._$AM.parentNode; + } + get _$AU() { + return this._$AM._$AU; + } + u(t2) { + const { el: { content: i3 }, parts: s2 } = this._$AD, e3 = (t2?.creationScope ?? w).importNode(i3, true); + I.currentNode = e3; + let h4 = I.nextNode(), o3 = 0, n4 = 0, r3 = s2[0]; + for (; void 0 !== r3; ) { + if (o3 === r3.index) { + let i4; + 2 === r3.type ? i4 = new et(h4, h4.nextSibling, this, t2) : 1 === r3.type ? i4 = new r3.ctor(h4, r3.name, r3.strings, this, t2) : 6 === r3.type && (i4 = new K(h4, this, t2)), this._$AV.push(i4), r3 = s2[++n4]; + } + o3 !== r3?.index && (h4 = I.nextNode(), o3++); + } + return I.currentNode = w, e3; + } + p(t2) { + let i3 = 0; + for (const s2 of this._$AV) void 0 !== s2 && (void 0 !== s2.strings ? (s2._$AI(t2, s2, i3), i3 += s2.strings.length - 2) : s2._$AI(t2[i3])), i3++; + } +}; +var et = class _et { + get _$AU() { + return this._$AM?._$AU ?? this.v; + } + constructor(t2, i3, s2, e3) { + this.type = 2, this._$AH = D, this._$AN = void 0, this._$AA = t2, this._$AB = i3, this._$AM = s2, this.options = e3, this.v = e3?.isConnected ?? true; + } + get parentNode() { + let t2 = this._$AA.parentNode; + const i3 = this._$AM; + return void 0 !== i3 && 11 === t2?.nodeType && (t2 = i3.parentNode), t2; + } + get startNode() { + return this._$AA; + } + get endNode() { + return this._$AB; + } + _$AI(t2, i3 = this) { + t2 = z(this, t2, i3), st(t2) ? t2 === D || null == t2 || "" === t2 ? (this._$AH !== D && this._$AR(), this._$AH = D) : t2 !== this._$AH && t2 !== R && this._(t2) : void 0 !== t2._$litType$ ? this.$(t2) : void 0 !== t2.nodeType ? this.T(t2) : $(t2) ? this.k(t2) : this._(t2); + } + O(t2) { + return this._$AA.parentNode.insertBefore(t2, this._$AB); + } + T(t2) { + this._$AH !== t2 && (this._$AR(), this._$AH = this.O(t2)); + } + _(t2) { + this._$AH !== D && st(this._$AH) ? this._$AA.nextSibling.data = t2 : this.T(w.createTextNode(t2)), this._$AH = t2; + } + $(t2) { + const { values: i3, _$litType$: s2 } = t2, e3 = "number" == typeof s2 ? this._$AC(t2) : (void 0 === s2.el && (s2.el = B.createElement(N(s2.h, s2.h[0]), this.options)), s2); + if (this._$AH?._$AD === e3) this._$AH.p(i3); + else { + const t3 = new F(e3, this), s3 = t3.u(this.options); + t3.p(i3), this.T(s3), this._$AH = t3; + } + } + _$AC(t2) { + let i3 = V.get(t2.strings); + return void 0 === i3 && V.set(t2.strings, i3 = new B(t2)), i3; + } + k(t2) { + g(this._$AH) || (this._$AH = [], this._$AR()); + const i3 = this._$AH; + let s2, e3 = 0; + for (const h4 of t2) e3 === i3.length ? i3.push(s2 = new _et(this.O(lt()), this.O(lt()), this, this.options)) : s2 = i3[e3], s2._$AI(h4), e3++; + e3 < i3.length && (this._$AR(s2 && s2._$AB.nextSibling, e3), i3.length = e3); + } + _$AR(t2 = this._$AA.nextSibling, i3) { + for (this._$AP?.(false, true, i3); t2 && t2 !== this._$AB; ) { + const i4 = t2.nextSibling; + t2.remove(), t2 = i4; + } + } + setConnected(t2) { + void 0 === this._$AM && (this.v = t2, this._$AP?.(t2)); + } +}; +var G = class { + get tagName() { + return this.element.tagName; + } + get _$AU() { + return this._$AM._$AU; + } + constructor(t2, i3, s2, e3, h4) { + this.type = 1, this._$AH = D, this._$AN = void 0, this.element = t2, this.name = i3, this._$AM = e3, this.options = h4, s2.length > 2 || "" !== s2[0] || "" !== s2[1] ? (this._$AH = Array(s2.length - 1).fill(new String()), this.strings = s2) : this._$AH = D; + } + _$AI(t2, i3 = this, s2, e3) { + const h4 = this.strings; + let o3 = false; + if (void 0 === h4) t2 = z(this, t2, i3, 0), o3 = !st(t2) || t2 !== this._$AH && t2 !== R, o3 && (this._$AH = t2); + else { + const e4 = t2; + let n4, r3; + for (t2 = h4[0], n4 = 0; n4 < h4.length - 1; n4++) r3 = z(this, e4[s2 + n4], i3, n4), r3 === R && (r3 = this._$AH[n4]), o3 ||= !st(r3) || r3 !== this._$AH[n4], r3 === D ? t2 = D : t2 !== D && (t2 += (r3 ?? "") + h4[n4 + 1]), this._$AH[n4] = r3; + } + o3 && !e3 && this.j(t2); + } + j(t2) { + t2 === D ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t2 ?? ""); + } +}; +var Y = class extends G { + constructor() { + super(...arguments), this.type = 3; + } + j(t2) { + this.element[this.name] = t2 === D ? void 0 : t2; + } +}; +var Z = class extends G { + constructor() { + super(...arguments), this.type = 4; + } + j(t2) { + this.element.toggleAttribute(this.name, !!t2 && t2 !== D); + } +}; +var q = class extends G { + constructor(t2, i3, s2, e3, h4) { + super(t2, i3, s2, e3, h4), this.type = 5; + } + _$AI(t2, i3 = this) { + if ((t2 = z(this, t2, i3, 0) ?? D) === R) return; + const s2 = this._$AH, e3 = t2 === D && s2 !== D || t2.capture !== s2.capture || t2.once !== s2.once || t2.passive !== s2.passive, h4 = t2 !== D && (s2 === D || e3); + e3 && this.element.removeEventListener(this.name, this, s2), h4 && this.element.addEventListener(this.name, this, t2), this._$AH = t2; + } + handleEvent(t2) { + "function" == typeof this._$AH ? this._$AH.call(this.options?.host ?? this.element, t2) : this._$AH.handleEvent(t2); + } +}; +var K = class { + constructor(t2, i3, s2) { + this.element = t2, this.type = 6, this._$AN = void 0, this._$AM = i3, this.options = s2; + } + get _$AU() { + return this._$AM._$AU; + } + _$AI(t2) { + z(this, t2); + } +}; +var Re = n3.litHtmlPolyfillSupport; +Re?.(B, et), (n3.litHtmlVersions ??= []).push("3.2.0"); +var Q = (t2, i3, s2) => { + const e3 = s2?.renderBefore ?? i3; + let h4 = e3._$litPart$; + if (void 0 === h4) { + const t3 = s2?.renderBefore ?? null; + e3._$litPart$ = h4 = new et(i3.insertBefore(lt(), t3), t3, void 0, s2 ?? {}); + } + return h4._$AI(t2), h4; +}; + +// node_modules/lit-element/lit-element.js +var h3 = class extends b { + constructor() { + super(...arguments), this.renderOptions = { host: this }, this.o = void 0; + } + createRenderRoot() { + const t2 = super.createRenderRoot(); + return this.renderOptions.renderBefore ??= t2.firstChild, t2; + } + update(t2) { + const e3 = this.render(); + this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t2), this.o = Q(e3, this.renderRoot, this.renderOptions); + } + connectedCallback() { + super.connectedCallback(), this.o?.setConnected(true); + } + disconnectedCallback() { + super.disconnectedCallback(), this.o?.setConnected(false); + } + render() { + return R; + } +}; +h3._$litElement$ = true, h3["finalized"] = true, globalThis.litElementHydrateSupport?.({ LitElement: h3 }); +var f3 = globalThis.litElementPolyfillSupport; +f3?.({ LitElement: h3 }); +(globalThis.litElementVersions ??= []).push("4.1.0"); + +// js/material_styles.ts +var materialStyles = i` @font-face { font-family: 'Material Symbols Outlined'; font-style: normal; @@ -22,7 +565,10 @@ var R=globalThis,T=R.ShadowRoot&&(R.ShadyCSS===void 0||R.ShadyCSS.nativeShadow)& white-space: nowrap; word-wrap: normal; } -`;export{Jt as materialStyles}; +`; +export { + materialStyles +}; /*! Bundled license information: @lit/reactive-element/css-tag.js: @@ -60,3 +606,4 @@ lit-html/is-server.js: * SPDX-License-Identifier: BSD-3-Clause *) */ +//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vbm9kZV9tb2R1bGVzL0BsaXQvcmVhY3RpdmUtZWxlbWVudC9zcmMvY3NzLXRhZy50cyIsICIuLi8uLi9ub2RlX21vZHVsZXMvQGxpdC9yZWFjdGl2ZS1lbGVtZW50L3NyYy9yZWFjdGl2ZS1lbGVtZW50LnRzIiwgIi4uLy4uL25vZGVfbW9kdWxlcy9saXQtaHRtbC9zcmMvbGl0LWh0bWwud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aGUgZWxlbWVudFxuICAgICAgICAvLyBhbmQgb2ZmIGJ5IHR3byBhZnRlciBpdC5cbiAgICAgICAgaWYgKChub2RlIGFzIEVsZW1lbnQpLmhhc0F0dHJpYnV0ZXMoKSkge1xuICAgICAgICAgIGZvciAoY29uc3QgbmFtZSBvZiAobm9kZSBhcyBFbGVtZW50KS5nZXRBdHRyaWJ1dGVOYW1lcygpKSB7XG4gICAgICAgICAgICBpZiAobmFtZS5lbmRzV2l0aChib3VuZEF0dHJpYnV0ZVN1ZmZpeCkpIHtcbiAgICAgICAgICAgICAgY29uc3QgcmVhbE5hbWUgPSBhdHRyTmFtZXNbYXR0ck5hbWVJbmRleCsrXTtcbiAgICAgICAgICAgICAgY29uc3QgdmFsdWUgPSAobm9kZSBhcyBFbGVtZW50KS5nZXRBdHRyaWJ1dGUobmFtZSkhO1xuICAgICAgICAgICAgICBjb25zdCBzdGF0aWNzID0gdmFsdWUuc3BsaXQobWFya2VyKTtcbiAgICAgICAgICAgICAgY29uc3QgbSA9IC8oWy4/QF0pPyguKikvLmV4ZWMocmVhbE5hbWUpITtcbiAgICAgICAgICAgICAgcGFydHMucHVzaCh7XG4gICAgICAgICAgICAgICAgdHlwZTogQVRUUklCVVRFX1BBUlQsXG4gICAgICAgICAgICAgICAgaW5kZXg6IG5vZGVJbmRleCxcbiAgICAgICAgICAgICAgICBuYW1lOiBtWzJdLFxuICAgICAgICAgICAgICAgIHN0cmluZ3M6IHN0YXRpY3MsXG4gICAgICAgICAgICAgICAgY3RvcjpcbiAgICAgICAgICAgICAgICAgIG1bMV0gPT09ICcuJ1xuICAgICAgICAgICAgICAgICAgICA/IFByb3BlcnR5UGFydFxuICAgICAgICAgICAgICAgICAgICA6IG1bMV0gPT09ICc/J1xuICAgICAgICAgICAgICAgICAgICAgID8gQm9vbGVhbkF0dHJpYnV0ZVBhcnRcbiAgICAgICAgICAgICAgICAgICAgICA6IG1bMV0gPT09ICdAJ1xuICAgICAgICAgICAgICAgICAgICAgICAgPyBFdmVudFBhcnRcbiAgICAgICAgICAgICAgICAgICAgICAgIDogQXR0cmlidXRlUGFydCxcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgIChub2RlIGFzIEVsZW1lbnQpLnJlbW92ZUF0dHJpYnV0ZShuYW1lKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobmFtZS5zdGFydHNXaXRoKG1hcmtlcikpIHtcbiAgICAgICAgICAgICAgcGFydHMucHVzaCh7XG4gICAgICAgICAgICAgICAgdHlwZTogRUxFTUVOVF9QQVJULFxuICAgICAgICAgICAgICAgIGluZGV4OiBub2RlSW5kZXgsXG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAobm9kZSBhcyBFbGVtZW50KS5yZW1vdmVBdHRyaWJ1dGUobmFtZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIC8vIFRPRE8gKGp1c3RpbmZhZ25hbmkpOiBiZW5jaG1hcmsgdGhlIHJlZ2V4IGFnYWluc3QgdGVzdGluZyBmb3IgZWFjaFxuICAgICAgICAvLyBvZiB0aGUgMyByYXcgdGV4dCBlbGVtZW50IG5hbWVzLlxuICAgICAgICBpZiAocmF3VGV4dEVsZW1lbnQudGVzdCgobm9kZSBhcyBFbGVtZW50KS50YWdOYW1lKSkge1xuICAgICAgICAgIC8vIEZvciByYXcgdGV4dCBlbGVtZW50cyB3ZSBuZWVkIHRvIHNwbGl0IHRoZSB0ZXh0IGNvbnRlbnQgb25cbiAgICAgICAgICAvLyBtYXJrZXJzLCBjcmVhdGUgYSBUZXh0IG5vZGUgZm9yIGVhY2ggc2VnbWVudCwgYW5kIGNyZWF0ZVxuICAgICAgICAgIC8vIGEgVGVtcGxhdGVQYXJ0IGZvciBlYWNoIG1hcmtlci5cbiAgICAgICAgICBjb25zdCBzdHJpbmdzID0gKG5vZGUgYXMgRWxlbWVudCkudGV4dENvbnRlbnQhLnNwbGl0KG1hcmtlcik7XG4gICA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kIiwgImNoYW5nZWRQcm9wZXJ0aWVzIiwgInZhbHVlIiwgInJlbmRlciIsICJoYXNVcGRhdGVkIiwgImlzQ29ubmVjdGVkIiwgInVwZGF0ZSIsICJjb25uZWN0ZWRDYWxsYmFjayIsICJzZXRDb25uZWN0ZWQiLCAiZGlzY29ubmVjdGVkQ2FsbGJhY2siLCAibm9DaGFuZ2UiLCAiZ2xvYmFsVGhpcyIsICJsaXRFbGVtZW50SHlkcmF0ZVN1cHBvcnQiLCAicG9seWZpbGxTdXBwb3J0IiwgImxpdEVsZW1lbnRQb2x5ZmlsbFN1cHBvcnQiLCAiZ2xvYmFsVGhpcyIsICJsaXRFbGVtZW50VmVyc2lvbnMiLCAicHVzaCJdCn0K diff --git a/geemap/static/utils.js b/geemap/static/utils.js index 2704aeeb1f..48c0be3026 100644 --- a/geemap/static/utils.js +++ b/geemap/static/utils.js @@ -1 +1,21 @@ -async function d(e,i){return Promise.all(e.map(t=>i.get_model(t.slice(10))))}async function l(e,i){let t=i.get("children"),a=await d(t,i.widget_manager),r=await Promise.all(a.map(n=>n.widget_manager.create_view(n)));e.innerHTML="";for(let n of r)e.appendChild(n.el)}export{l as updateChildren}; +// js/utils.ts +async function unpackModels(modelIds, manager) { + return Promise.all( + modelIds.map((id) => manager.get_model(id.slice("IPY_MODEL_".length))) + ); +} +async function updateChildren(container, model) { + const children = model.get("children"); + const child_models = await unpackModels(children, model.widget_manager); + const child_views = await Promise.all( + child_models.map((model2) => model2.widget_manager.create_view(model2)) + ); + container.innerHTML = ``; + for (const child_view of child_views) { + container.appendChild(child_view.el); + } +} +export { + updateChildren +}; +//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vanMvdXRpbHMudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImltcG9ydCB0eXBlIHsgQW55TW9kZWwgfSBmcm9tIFwiQGFueXdpZGdldC90eXBlc1wiO1xuaW1wb3J0IHsgSVdpZ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BQVE7QUFBQSxJQUNYLFNBQVMsSUFBSSxRQUFNLFFBQVEsVUFBVSxHQUFHLE1BQU0sYUFBYSxNQUFNLENBQUMsQ0FBQztBQUFBLEVBQ3ZFO0FBQ0o7QUFFQSxlQUFzQixlQUFlLFdBQXdCLE9BQXNCO0FBQy9FLFFBQU0sV0FBVyxNQUFNLElBQUksVUFBVTtBQUNyQyxRQUFNLGVBQWUsTUFBTSxhQUFhLFVBQVUsTUFBTSxjQUFjO0FBQ3RFLFFBQU0sY0FBYyxNQUFNLFFBQVE7QUFBQSxJQUM5QixhQUFhLElBQUksQ0FBQUEsV0FBU0EsT0FBTSxlQUFlLFlBQVlBLE1BQUssQ0FBQztBQUFBLEVBQ3JFO0FBQ0EsWUFBVSxZQUFZO0FBQ3RCLGFBQVcsY0FBYyxhQUFhO0FBQ2xDLGNBQVUsWUFBWSxXQUFXLEVBQUU7QUFBQSxFQUN2QztBQUNKOyIsCiAgIm5hbWVzIjogWyJtb2RlbCJdCn0K diff --git a/package.json b/package.json index f23be7baa5..3e30bd2b69 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "scripts": { "dev": "npm run build -- --sourcemap=inline --watch", - "build": "esbuild js/*.ts --minify --format=esm --bundle --outdir=geemap/static", + "build": "esbuild js/*.ts --format=esm --bundle --outdir=geemap/static", "typecheck": "tsc --noEmit" }, "dependencies": { From b9e0d69fbc1252481c446f757f1a057a2c99eae5 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2024 18:43:41 +0000 Subject: [PATCH 14/57] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- geemap/static/ipywidgets_styles.js | 2 +- geemap/static/layer_manager.js | 2 +- geemap/static/layer_manager_row.js | 2 +- geemap/static/material_styles.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/geemap/static/ipywidgets_styles.js b/geemap/static/ipywidgets_styles.js index 7e6805d52e..291aa0f8a3 100644 --- a/geemap/static/ipywidgets_styles.js +++ b/geemap/static/ipywidgets_styles.js @@ -278,7 +278,7 @@ var x = "[ \n\f\r]"; var T = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g; var E = /-->/g; var k = />/g; -var O = RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ +var O = RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`, "g"); var S2 = /'/g; var j = /"/g; diff --git a/geemap/static/layer_manager.js b/geemap/static/layer_manager.js index 6c87933c13..eb43afe817 100644 --- a/geemap/static/layer_manager.js +++ b/geemap/static/layer_manager.js @@ -289,7 +289,7 @@ var x = "[ \n\f\r]"; var T = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g; var E = /-->/g; var k = />/g; -var O = RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ +var O = RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`, "g"); var S2 = /'/g; var j = /"/g; diff --git a/geemap/static/layer_manager_row.js b/geemap/static/layer_manager_row.js index 60c628695c..885c2fc008 100644 --- a/geemap/static/layer_manager_row.js +++ b/geemap/static/layer_manager_row.js @@ -289,7 +289,7 @@ var x = "[ \n\f\r]"; var T = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g; var E = /-->/g; var k = />/g; -var O = RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ +var O = RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`, "g"); var S2 = /'/g; var j = /"/g; diff --git a/geemap/static/material_styles.js b/geemap/static/material_styles.js index 2e561ad473..25260356ae 100644 --- a/geemap/static/material_styles.js +++ b/geemap/static/material_styles.js @@ -278,7 +278,7 @@ var x = "[ \n\f\r]"; var T = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g; var E = /-->/g; var k = />/g; -var O = RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ +var O = RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`, "g"); var S2 = /'/g; var j = /"/g; From 7195ac849acc46d129ea2a371103e9116ec26bfd Mon Sep 17 00:00:00 2001 From: Nathaniel Schmitz Date: Mon, 14 Oct 2024 17:31:33 -0400 Subject: [PATCH 15/57] Clean up setuptools references in pyproject.toml --- pyproject.toml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 26553496aa..8b6f05cf79 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,6 +26,7 @@ classifiers = [ "Programming Language :: Python :: 3.13", ] dependencies = [ + "anywidget", "bqplot", "colour", "earthengine-api>=1.0.0", @@ -139,8 +140,8 @@ maplibre = [ geemap = "geemap.cli:main" [tool] -[tool.setuptools.packages.find] -include = ["geemap*"] +[tool.hatch.build.targets.sdist] +packages = ["geemap"] exclude = ["docs*"] [tool.distutils.bdist_wheel] From ce4c34d65dc4e0d69361e632db8055debc9d3d3b Mon Sep 17 00:00:00 2001 From: Nathaniel Schmitz Date: Tue, 15 Oct 2024 15:05:12 -0400 Subject: [PATCH 16/57] Clean up setuptools references in pyproject.toml --- pyproject.toml | 23 ++++++++++------------- uv.lock | 25 ++++++++++++++++--------- 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8b6f05cf79..3e48f7144a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -125,19 +125,16 @@ workshop = [ "gdown", ] maplibre = [ - "geopandas", - "h3", - "ipyvuetify", - "localtileserver", - "mapclassify", - "maplibre", - "pmtiles", - "rioxarray", - "xarray", - ] - -[project.entry-points."console_scripts"] -geemap = "geemap.cli:main" + "geopandas", + "h3", + "ipyvuetify", + "localtileserver", + "mapclassify", + "maplibre", + "pmtiles", + "rioxarray", + "xarray", +] [tool] [tool.hatch.build.targets.sdist] diff --git a/uv.lock b/uv.lock index 57b9127ccb..39e7b74ebe 100644 --- a/uv.lock +++ b/uv.lock @@ -1110,9 +1110,10 @@ wheels = [ [[package]] name = "geemap" -version = "0.34.3" +version = "0.34.5" source = { editable = "." } dependencies = [ + { name = "anywidget" }, { name = "bqplot" }, { name = "colour" }, { name = "earthengine-api" }, @@ -1131,7 +1132,6 @@ dependencies = [ { name = "pyshp" }, { name = "python-box" }, { name = "scooby" }, - { name = "setuptools" }, ] [package.optional-dependencies] @@ -1167,7 +1167,6 @@ all = [ { name = "owslib" }, { name = "palettable" }, { name = "panel" }, - { name = "plotly" }, { name = "pmtiles" }, { name = "psycopg2" }, { name = "pycrs" }, @@ -1182,6 +1181,7 @@ all = [ { name = "sqlalchemy" }, { name = "streamlit-folium" }, { name = "voila" }, + { name = "watchfiles" }, { name = "whiteboxgui" }, { name = "xarray" }, { name = "xee" }, @@ -1194,9 +1194,12 @@ apps = [ ] backends = [ { name = "keplergl" }, - { name = "plotly" }, { name = "pydeck" }, ] +dev = [ + { name = "jupyterlab" }, + { name = "watchfiles" }, +] extra = [ { name = "ee-extra" }, { name = "ffmpeg-python" }, @@ -1262,6 +1265,7 @@ workshop = [ [package.metadata] requires-dist = [ + { name = "anywidget" }, { name = "bqplot" }, { name = "colour" }, { name = "earthengine-api", specifier = ">=1.0.0" }, @@ -1275,7 +1279,7 @@ requires-dist = [ { name = "geeadd", marker = "extra == 'extra'", specifier = ">=0.5.1" }, { name = "geedim", marker = "extra == 'raster'" }, { name = "geedim", marker = "extra == 'workshop'" }, - { name = "geemap", extras = ["apps", "backends", "extra", "lidar", "maplibre", "raster", "sql", "vector", "workshop"], marker = "extra == 'all'" }, + { name = "geemap", extras = ["backends", "dev", "extra", "lidar", "raster", "sql", "apps", "vector", "workshop", "maplibre"], marker = "extra == 'all'" }, { name = "geocoder" }, { name = "geojson", marker = "extra == 'extra'" }, { name = "geopandas", marker = "extra == 'extra'" }, @@ -1295,6 +1299,7 @@ requires-dist = [ { name = "ipytree" }, { name = "ipyvtklink", marker = "extra == 'lidar'" }, { name = "ipyvuetify", marker = "extra == 'maplibre'" }, + { name = "jupyterlab", marker = "extra == 'dev'" }, { name = "jupyterlab", marker = "extra == 'extra'", specifier = ">=3" }, { name = "keplergl", marker = "extra == 'backends'" }, { name = "laspy", extras = ["lazrs"], marker = "extra == 'lidar'" }, @@ -1314,7 +1319,6 @@ requires-dist = [ { name = "pandas" }, { name = "panel", marker = "extra == 'lidar'" }, { name = "plotly" }, - { name = "plotly", marker = "extra == 'backends'" }, { name = "pmtiles", marker = "extra == 'maplibre'" }, { name = "psycopg2", marker = "extra == 'sql'" }, { name = "pycrs", marker = "extra == 'extra'" }, @@ -1332,11 +1336,11 @@ requires-dist = [ { name = "rioxarray", marker = "extra == 'raster'" }, { name = "sankee", marker = "extra == 'extra'", specifier = ">=0.1.0" }, { name = "scooby" }, - { name = "setuptools" }, { name = "solara", marker = "extra == 'apps'" }, { name = "sqlalchemy", marker = "extra == 'sql'" }, { name = "streamlit-folium", marker = "extra == 'apps'" }, { name = "voila", marker = "extra == 'apps'" }, + { name = "watchfiles", marker = "extra == 'dev'" }, { name = "whiteboxgui", marker = "extra == 'extra'", specifier = ">=0.6.0" }, { name = "xarray", marker = "extra == 'maplibre'" }, { name = "xee", marker = "extra == 'extra'" }, @@ -3794,8 +3798,6 @@ version = "6.0.0" source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/18/c7/8c6872f7372eb6a6b2e4708b88419fb46b857f7a2e1892966b851cc79fc9/psutil-6.0.0.tar.gz", hash = "sha256:8faae4f310b6d969fa26ca0545338b21f73c6b15db7c4a8d934a5482faa818f2", size = 508067 } wheels = [ - { url = "https://files.pythonhosted.org/packages/c5/66/78c9c3020f573c58101dc43a44f6855d01bbbd747e24da2f0c4491200ea3/psutil-6.0.0-cp27-none-win32.whl", hash = "sha256:02b69001f44cc73c1c5279d02b30a817e339ceb258ad75997325e0e6169d8b35", size = 249766 }, - { url = "https://files.pythonhosted.org/packages/e1/3f/2403aa9558bea4d3854b0e5e567bc3dd8e9fbc1fc4453c0aa9aafeb75467/psutil-6.0.0-cp27-none-win_amd64.whl", hash = "sha256:21f1fb635deccd510f69f485b87433460a603919b45e2a324ad65b0cc74f8fb1", size = 253024 }, { url = "https://files.pythonhosted.org/packages/0b/37/f8da2fbd29690b3557cca414c1949f92162981920699cd62095a984983bf/psutil-6.0.0-cp36-abi3-macosx_10_9_x86_64.whl", hash = "sha256:c588a7e9b1173b6e866756dde596fd4cad94f9399daf99ad8c3258b3cb2b47a0", size = 250961 }, { url = "https://files.pythonhosted.org/packages/35/56/72f86175e81c656a01c4401cd3b1c923f891b31fbcebe98985894176d7c9/psutil-6.0.0-cp36-abi3-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6ed2440ada7ef7d0d608f20ad89a04ec47d2d3ab7190896cd62ca5fc4fe08bf0", size = 287478 }, { url = "https://files.pythonhosted.org/packages/19/74/f59e7e0d392bc1070e9a70e2f9190d652487ac115bb16e2eff6b22ad1d24/psutil-6.0.0-cp36-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5fd9a97c8e94059b0ef54a7d4baf13b405011176c3b6ff257c247cae0d560ecd", size = 290455 }, @@ -4903,6 +4905,11 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/a1/32/4a7a205b14c11225609b75b28402c196e4396ac754dab6a81971b811781c/scikit_learn-1.5.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f60021ec1574e56632be2a36b946f8143bf4e5e6af4a06d85281adc22938e0dd", size = 12085794 }, { url = "https://files.pythonhosted.org/packages/c6/29/044048c5e911373827c0e1d3051321b9183b2a4f8d4e2f11c08fcff83f13/scikit_learn-1.5.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:394397841449853c2290a32050382edaec3da89e35b3e03d6cc966aebc6a8ae6", size = 12945797 }, { url = "https://files.pythonhosted.org/packages/aa/ce/c0b912f2f31aeb1b756a6ba56bcd84dd1f8a148470526a48515a3f4d48cd/scikit_learn-1.5.2-cp312-cp312-win_amd64.whl", hash = "sha256:57cc1786cfd6bd118220a92ede80270132aa353647684efa385a74244a41e3b1", size = 10985467 }, + { url = "https://files.pythonhosted.org/packages/a4/50/8891028437858cc510e13578fe7046574a60c2aaaa92b02d64aac5b1b412/scikit_learn-1.5.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:e9a702e2de732bbb20d3bad29ebd77fc05a6b427dc49964300340e4c9328b3f5", size = 12025584 }, + { url = "https://files.pythonhosted.org/packages/d2/79/17feef8a1c14149436083bec0e61d7befb4812e272d5b20f9d79ea3e9ab1/scikit_learn-1.5.2-cp313-cp313-macosx_12_0_arm64.whl", hash = "sha256:b0768ad641981f5d3a198430a1d31c3e044ed2e8a6f22166b4d546a5116d7908", size = 10959795 }, + { url = "https://files.pythonhosted.org/packages/b1/c8/f08313f9e2e656bd0905930ae8bf99a573ea21c34666a813b749c338202f/scikit_learn-1.5.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:178ddd0a5cb0044464fc1bfc4cca5b1833bfc7bb022d70b05db8530da4bb3dd3", size = 12077302 }, + { url = "https://files.pythonhosted.org/packages/a7/48/fbfb4dc72bed0fe31fe045fb30e924909ad03f717c36694351612973b1a9/scikit_learn-1.5.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f7284ade780084d94505632241bf78c44ab3b6f1e8ccab3d2af58e0e950f9c12", size = 13002811 }, + { url = "https://files.pythonhosted.org/packages/a5/e7/0c869f9e60d225a77af90d2aefa7a4a4c0e745b149325d1450f0f0ce5399/scikit_learn-1.5.2-cp313-cp313-win_amd64.whl", hash = "sha256:b7b0f9a0b1040830d38c39b91b3a44e1b643f4b36e36567b80b7c6bd2202a27f", size = 10951354 }, { url = "https://files.pythonhosted.org/packages/db/a0/e92af06a9fddd1fafbbf39cd32cbed5929b63cf99e03a438f838987e265d/scikit_learn-1.5.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:757c7d514ddb00ae249832fe87100d9c73c6ea91423802872d9e74970a0e40b9", size = 12142022 }, { url = "https://files.pythonhosted.org/packages/1b/be/386ef63d9d5e2ddf8308f6a164e4b388d5c5aecc0504d25acc6b33d8b09e/scikit_learn-1.5.2-cp39-cp39-macosx_12_0_arm64.whl", hash = "sha256:52788f48b5d8bca5c0736c175fa6bdaab2ef00a8f536cda698db61bd89c551c1", size = 11002839 }, { url = "https://files.pythonhosted.org/packages/12/0d/94a03c006b01c1de27518d393f52ad3639705cd70184e106d24ffb3f28f6/scikit_learn-1.5.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:643964678f4b5fbdc95cbf8aec638acc7aa70f5f79ee2cdad1eec3df4ba6ead8", size = 12546017 }, From 28092e7f095f32f0ba20c3e6277f338276a47d6a Mon Sep 17 00:00:00 2001 From: Nathaniel Schmitz Date: Tue, 15 Oct 2024 16:03:20 -0400 Subject: [PATCH 17/57] Fix dark mode and drop shadow issues in Colab --- geemap/map_widgets.py | 2 ++ js/ipywidgets_styles.ts | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/geemap/map_widgets.py b/geemap/map_widgets.py index e091466491..bf007ce59c 100644 --- a/geemap/map_widgets.py +++ b/geemap/map_widgets.py @@ -886,6 +886,7 @@ def _objects_info(self, latlon: List[float]) -> ipytree.Node: return self._root_node("Objects", nodes) +@Theme.apply class LayerManagerRow(anywidget.AnyWidget): """A layer manager row widget for geemap.""" @@ -981,6 +982,7 @@ def _delete_layer(self) -> None: self.host_map.remove_layer(self.layer) +@Theme.apply class LayerManager(anywidget.AnyWidget): """A layer manager widget for geemap.""" diff --git a/js/ipywidgets_styles.ts b/js/ipywidgets_styles.ts index 79928f2624..15ea92d081 100644 --- a/js/ipywidgets_styles.ts +++ b/js/ipywidgets_styles.ts @@ -23,7 +23,9 @@ export const legacyStyles = css` .legacy-button:hover:enabled, .legacy-button:focus:enabled { - box-shadow: var(--jp-elevation-z2); + box-shadow: 0 2px 2px 0 rgba(0, 0, 0, var(--md-shadow-key-penumbra-opacity)), + 0 3px 1px -2px rgba(0, 0, 0, var(--md-shadow-key-umbra-opacity)), + 0 1px 5px 0 rgba(0, 0, 0, var(--md-shadow-ambient-shadow-opacity)); } .legacy-slider { From 78e0021705b01eb9237178f9d6be685ac5967f2f Mon Sep 17 00:00:00 2001 From: Sufyan Abbasi Date: Wed, 16 Oct 2024 01:17:15 +0000 Subject: [PATCH 18/57] Remove common.css, load fonts using JS instead. --- geemap/map_widgets.py | 3 --- geemap/static/ipywidgets_styles.js | 7 ++++--- geemap/static/layer_manager.css | 4 ---- geemap/static/layer_manager.js | 16 +++++++++++++--- geemap/static/layer_manager_row.css | 4 ---- geemap/static/layer_manager_row.js | 18 +++++++++++++++--- geemap/static/material_styles.js | 3 +-- geemap/static/utils.js | 10 +++++++++- js/common.css | 1 - js/layer_manager.ts | 5 ++--- js/layer_manager_row.ts | 3 ++- js/utils.ts | 9 +++++++++ 12 files changed, 55 insertions(+), 28 deletions(-) delete mode 100644 geemap/static/layer_manager.css delete mode 100644 geemap/static/layer_manager_row.css delete mode 100644 js/common.css diff --git a/geemap/map_widgets.py b/geemap/map_widgets.py index bf007ce59c..e16b39d4f8 100644 --- a/geemap/map_widgets.py +++ b/geemap/map_widgets.py @@ -891,8 +891,6 @@ class LayerManagerRow(anywidget.AnyWidget): """A layer manager row widget for geemap.""" _esm = pathlib.Path(__file__).parent / "static" / "layer_manager_row.js" - _css = pathlib.Path(__file__).parent / "static" / "layer_manager_row.css" - name = traitlets.Unicode("").tag(sync=True) visible = traitlets.Bool(True).tag(sync=True) opacity = traitlets.Float(1).tag(sync=True) @@ -987,7 +985,6 @@ class LayerManager(anywidget.AnyWidget): """A layer manager widget for geemap.""" _esm = pathlib.Path(__file__).parent / "static" / "layer_manager.js" - _css = pathlib.Path(__file__).parent / "static" / "layer_manager.css" # Whether all layers should be visible or not. Represented as a checkbox in the UI. visible = traitlets.Bool(True).tag(sync=True) diff --git a/geemap/static/ipywidgets_styles.js b/geemap/static/ipywidgets_styles.js index 291aa0f8a3..5ddee3c553 100644 --- a/geemap/static/ipywidgets_styles.js +++ b/geemap/static/ipywidgets_styles.js @@ -278,7 +278,7 @@ var x = "[ \n\f\r]"; var T = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g; var E = /-->/g; var k = />/g; -var O = RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ +var O = RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`, "g"); var S2 = /'/g; var j = /"/g; @@ -566,7 +566,9 @@ var legacyStyles = i` .legacy-button:hover:enabled, .legacy-button:focus:enabled { - box-shadow: var(--jp-elevation-z2); + box-shadow: 0 2px 2px 0 rgba(0, 0, 0, var(--md-shadow-key-penumbra-opacity)), + 0 3px 1px -2px rgba(0, 0, 0, var(--md-shadow-key-umbra-opacity)), + 0 1px 5px 0 rgba(0, 0, 0, var(--md-shadow-ambient-shadow-opacity)); } .legacy-slider { @@ -637,4 +639,3 @@ lit-html/is-server.js: * SPDX-License-Identifier: BSD-3-Clause *) */ -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vbm9kZV9tb2R1bGVzL0BsaXQvcmVhY3RpdmUtZWxlbWVudC9zcmMvY3NzL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Bjb25zdCBtID0gLyhbLj9AXSk/KC4qKS8uZXhlYyhyZWFsTmFtZSkhO1xuICAgICAgICAgICAgICBwYXJ0cy5wdXNoKHtcbiAgICAgICAgICAgICAgICB0eXBlOiBBVFRSSUJVVEVfUEFSVCxcbiAgICAgICAgICAgICAgICBpbmRleDogbm9kZUluZGV4LFxuICAgICAgICAgICAgICAgIG5hbWU6IG1bMl0sXG4gICAgICAgICAgICAgICAgc3RyaW5nczogc3RhdGljcyxcbiAgICAgICAgICAgICAgICBjdG9yOlxuICAgICAgICAgICAgICAgICAgbVsxXSA9PT0gJy4nXG4gICAgICAgICAgICAgICAgICAgID8gUHJvcGVydHlQYXJ0XG4gICAgICAgICAgICAgICAgICAgIDogbVsxXSA9PT0gJz8nXG4gICAgICAgICAgICAgICAgICAgICAgPyBCb29sZWFuQXR0cmlidXRlUGFydFxuICAgICAgICAgICAgICAgICAgICAgIDogbVsxXSA9PT0gJ0AnXG4gICAgICAgICAgICAgICAgICAgICAgICA/IEV2ZW50UGFydFxuICAgICAgICAgICAgICAgICAgICAgICAgOiBBdHRyaWJ1dGVQYXJ0LFxuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgKG5vZGUgYXMgRWxlbWVudCkucmVtb3ZlQXR0cmlidXRlKG5hbWUpO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChuYW1lLnN0YXJ0c1dpdGgobWFya2VyKSkge1xuICAgICAgICAgICAgICBwYXJ0cy5wdXNoKHtcbiAgICAgICAgICAgICAgICB0eXBlOiBFTEVNRU5UX1BBUlQsXG4gICAgICAgICAgICAgICAgaW5kZXg6IG5vZGVJbmRleCxcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgIChub2RlIGFzIEVsZW1lbnQpLnJlbW92ZUF0dHJpYnV0ZShuYW1lKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgLy8gVE9ETyAoanVzdGluZmFnbmFuaSk6IGJlbm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2lvbnMiLCAicHVzaCIsICJyZW5kZXIiLCAidmFsdWUiLCAiY29udGFpbmVyIiwgIm9wdGlvbnMiLCAicGFydE93bmVyTm9kZSIsICJyZW5kZXJCZWZvcmUiLCAicGFydCIsICJlbmROb2RlIiwgImluc2VydEJlZm9yZSIsICJjcmVhdGVNYXJrZXIiLCAiXyRzZXRWYWx1ZSIsICJMaXRFbGVtZW50IiwgIlJlYWN0aXZlRWxlbWVudCIsICJjb25zdHJ1Y3RvciIsICJ0aGlzIiwgInJlbmRlck9wdGlvbnMiLCAiaG9zdCIsICJfX2NoaWxkUGFydCIsICJjcmVhdGVSZW5kZXJSb290IiwgInJlbmRlclJvb3QiLCAic3VwZXIiLCAicmVuZGVyQmVmb3JlIiwgImZpcnN0Q2hpbGQiLCAiY2hhbmdlZFByb3BlcnRpZXMiLCAidmFsdWUiLCAicmVuZGVyIiwgImhhc1VwZGF0ZWQiLCAiaXNDb25uZWN0ZWQiLCAidXBkYXRlIiwgImNvbm5lY3RlZENhbGxiYWNrIiwgInNldENvbm5lY3RlZCIsICJkaXNjb25uZWN0ZWRDYWxsYmFjayIsICJub0NoYW5nZSIsICJnbG9iYWxUaGlzIiwgImxpdEVsZW1lbnRIeWRyYXRlU3VwcG9ydCIsICJwb2x5ZmlsbFN1cHBvcnQiLCAibGl0RWxlbWVudFBvbHlmaWxsU3VwcG9ydCIsICJnbG9iYWxUaGlzIiwgImxpdEVsZW1lbnRWZXJzaW9ucyIsICJwdXNoIl0KfQo= diff --git a/geemap/static/layer_manager.css b/geemap/static/layer_manager.css deleted file mode 100644 index 153c430c38..0000000000 --- a/geemap/static/layer_manager.css +++ /dev/null @@ -1,4 +0,0 @@ -@import "https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined"; - -/* js/common.css */ -/*# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFtdLAogICJzb3VyY2VzQ29udGVudCI6IFtdLAogICJtYXBwaW5ncyI6ICIiLAogICJuYW1lcyI6IFtdCn0K */ diff --git a/geemap/static/layer_manager.js b/geemap/static/layer_manager.js index eb43afe817..bba41a5949 100644 --- a/geemap/static/layer_manager.js +++ b/geemap/static/layer_manager.js @@ -289,7 +289,7 @@ var x = "[ \n\f\r]"; var T = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g; var E = /-->/g; var k = />/g; -var O = RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ +var O = RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`, "g"); var S2 = /'/g; var j = /"/g; @@ -607,7 +607,9 @@ var legacyStyles = i` .legacy-button:hover:enabled, .legacy-button:focus:enabled { - box-shadow: var(--jp-elevation-z2); + box-shadow: 0 2px 2px 0 rgba(0, 0, 0, var(--md-shadow-key-penumbra-opacity)), + 0 3px 1px -2px rgba(0, 0, 0, var(--md-shadow-key-umbra-opacity)), + 0 1px 5px 0 rgba(0, 0, 0, var(--md-shadow-ambient-shadow-opacity)); } .legacy-slider { @@ -645,6 +647,14 @@ async function unpackModels(modelIds, manager) { modelIds.map((id) => manager.get_model(id.slice("IPY_MODEL_".length))) ); } +function loadFonts() { + if (!document.querySelector(".custom-fonts")) { + const styleElement = document.createElement("style"); + styleElement.classList.add("custom-fonts"); + styleElement.textContent = '@import "https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined";'; + document.body.appendChild(styleElement); + } +} async function updateChildren(container, model) { const children = model.get("children"); const child_models = await unpackModels(children, model.widget_manager); @@ -740,6 +750,7 @@ if (!customElements.get(LayerManager.componentName)) { customElements.define(LayerManager.componentName, LayerManager); } async function render({ model, el }) { + loadFonts(); const manager = document.createElement(LayerManager.componentName); manager.model = model; el.appendChild(manager); @@ -860,4 +871,3 @@ lit-html/is-server.js: * SPDX-License-Identifier: BSD-3-Clause *) */ -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJz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tZXNbYXR0ck5hbWVJbmRleCsrXTtcbiAgICAgICAgICAgICAgY29uc3QgdmFsdWUgPSAobm9kZSBhcyBFbGVtZW50KS5nZXRBdHRyaWJ1dGUobmFtZSkhO1xuICAgICAgICAgICAgICBjb25zdCBzdGF0aWNzID0gdmFsdWUuc3BsaXQobWFya2VyKTtcbiAgICAgICAgICAgICAgY29uc3QgbSA9IC8oWy4/QF0pPyguKikvLmV4ZWMocmVhbE5hbWUpITtcbiAgICAgICAgICAgICAgcGFydHMucHVzaCh7XG4gICAgICAgICAgICAgICAgdHlwZTogQVRUUklCVVRFX1BBUlQsXG4gICAgICAgICAgICAgICAgaW5kZXg6IG5vZGVJbmRleCxcbiAgICAgICAgICAgICAgICBuYW1lOiBtWzJdLFxuICAgICAgICAgICAgICAgIHN0cmluZ3M6IHN0YXRpY3MsXG4gICAgICAgICAgICAgICAgY3RvcjpcbiAgICAgICAgICAgICAgICAgIG1bMV0gPT09ICcuJ1xuICAgICAgICAgICAgICAgICAgICA/IFByb3BlcnR5UGFydFxuICAgICAgICAgICAgICAgICAgICA6IG1bMV0gPT09ICc/J1xuICAgICAgICAgICAgICAgICAgICAgID8gQm9vbGVhbkF0dHJpYnV0ZVBhcnRcbiAgICAgICAgICAgICAgICAgICAgICA6IG1bMV0gPT09ICdAJ1xuICAgICAgICAgICAgICAgICAgICAgICAgPyBFdmVudFBhcnRcbiAgICAgICAgICAgICAgICAgICAgICAgIDogQXR0cmlidXRlUGFydCxcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgIChub2RlIGFzIEVsZW1lbnQpLnJlbW92ZUF0dHJpYnV0ZShuYW1lKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobmFtZS5zdGFydHNXaXRoKG1hcmtlcikpIHtcbiAgICAgICAgICAgICAgcGFydHMucHVzaCh7XG4gICAgICAgICAgICAgICAgdHlwZTogRUxFTUVOVF9QQVJULFxuICAgICAgICAgICAgICAgIGluZGV4OiBub2RlSW5kZXgsX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9PT0gJ1NDUklQVCcpIHtcbiAgICAgICAgICBsZXQgbWVzc2FnZSA9ICdGb3JiaWRkZW4nO1xuICAgICAgICAgIGlmIChERVZfTU9ERSkge1xuICAgICAgICAgICAgaWYgKHBhcmVudE5vZGVOYW1lID09PSAnU1RZTEUnKSB7XG4gICAgICAgICAgICAgIG1lc3NhZ2UgPVxuICAgICAgICAgICAgICAgIGBMaXQgZG9lcyBub3Qgc3VwcG9ydCBiaW5kaW5nIGluc2lkZSBzdHlsZSBub2Rlcy4gYCArXG4gICAgICAgICAgICAgICAgYFRoaXMgaXMgYSBzZWN1cml0eSByaXNrLCBhcyBzdHlsZSBpbmplY3Rpb24gYXR0YWNrcyBjYW4gYCArXG4gICAgICAgICAgICAgICAgYGV4ZmlsdHJhdGUgZGF0YSBhbmQgc3Bvb2YgVUlzLiBgICtcbiAgICAgICAgICAgICAgICBgQ29uc2lkZXIgaW5zdGVhZCB1c2luZyBjc3NcXGAuLi5cXGAgbGl0ZXJhbHMgYCArXG4gICAgICAgICAgICAgICAgYHRvIGNvbXBvc2Ugc3R5bGVzLCBhbmQgZG8gZHluYW1pYyBzdHlsaW5nIHdpdGggYCArXG4gICAgICAgICAgICAgICAgYGNzcyBjdXN0b20gcHJvcGVydGllcywgOjpwYXJ0cywgPHNsb3Q+cywgYCArXG4gICAgICAgICAgICAgICAgYGFuZCBieSBtdXRhdGluZyB0aGUgRE9NIHJhdGhlciB0aGFuIHN0eWxlc2hlZXRzLmA7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBtZXNzYWdlID1cbiAgICAgICAgICAgICAgICBgTGl0IGRvZXMgbm90IHN1cHBvcnQgYmluZGluZyBpbnNpZGUgc2NyaXB0IG5vZGVzLiBgICtcbiAgICAgICAgICAgICAgICBgVGhpcyBpcyBhIHNlY3VyaXR5IHJpc2ssIGFzIGl0IGNvdWxkIGFsbG93IGFyYml0cmFyeSBgICtcbiAgICAgICAgICAgICAgICBgY29kZSBleGVjdXR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AgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBAcHJvcGVydHkoKVxuICAgIHZpc2libGU6IGJvb2xlYW4gPSBmYWxzZTtcblxuICAgIHJlbmRlcigpIHtcbiAgICAgICAgcmV0dXJuIGh0bWxgXG4gICAgICAgICAgICA8ZGl2IGNsYXNzPVwiY29udGFpbmVyXCI+XG4gICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInJvd1wiPlxuICAgICAgICAgICAgICAgICAgICA8aW5wdXRcbiAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU9XCJjaGVja2JveFwiXG4gICAgICAgICAgICAgICAgICAgICAgICBjbGFzcz1cInZpc2liaWxpdHktY2hlY2tib3hcIlxuICAgICAgICAgICAgICAgICAgICAgICAgLmNoZWNrZWQ9XCIke3RoaXMudmlzaWJsZX1cIlxuICAgICAgICAgICAgICAgICAgICAgICAgQGNoYW5nZT1cIiR7dGhpcy5vbkxheWVyVmlzaWJpbGl0eUNoYW5nZWR9XCJcbiAgICAgICAgICAgICAgICAgICAgLz5cbiAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJsZWdhY3ktdGV4dCBhbGwtbGF5ZXJzLXRleHRcIj5BbGwgbGF5ZXJzIG9uL29mZjwvc3Bhbj5cbiAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgICA8c2xvdD48L3Nsb3Q+XG4gICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgYDtcbiAgICB9XG5cbiAgICB1cGRhdGVkKGNoYW5nZWRQcm9wZXJ0aWVzOiBhbnkpIHtcbiAgICAgICAgLy8gVXBkYXRlIHRoZSBtb2RlbCBwcm9wZXJ0aWVzIHNvIHRoZXkncmUgcmVmbGVjdGVkIGluIFB5dGhvbi5cbiAgICAgICAgZm9yIChjb25zdCBbcHJvcGVydHksIF9dIG9mIGNoYW5nZWRQcm9wZXJ0aWVzKSB7XG4gICAgICAgICAgICB0aGlzLl9tb2RlbD8u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cyIsICJsaXRFbGVtZW50SHlkcmF0ZVN1cHBvcnQiLCAicG9seWZpbGxTdXBwb3J0IiwgImxpdEVsZW1lbnRQb2x5ZmlsbFN1cHBvcnQiLCAiZ2xvYmFsVGhpcyIsICJsaXRFbGVtZW50VmVyc2lvbnMiLCAicHVzaCIsICJkZWZhdWx0UHJvcGVydHlEZWNsYXJhdGlvbiIsICJhdHRyaWJ1dGUiLCAidHlwZSIsICJTdHJpbmciLCAiY29udmVydGVyIiwgImRlZmF1bHRDb252ZXJ0ZXIiLCAicmVmbGVjdCIsICJoYXNDaGFuZ2VkIiwgIm5vdEVxdWFsIiwgInN0YW5kYXJkUHJvcGVydHkiLCAib3B0aW9ucyIsICJ0YXJnZXQiLCAiY29udGV4dCIsICJraW5kIiwgIm1ldGFkYXRhIiwgInByb3BlcnRpZXMiLCAiZ2xvYmFsVGhpcyIsICJsaXRQcm9wZXJ0eU1ldGFkYXRhIiwgImdldCIsICJzZXQiLCAiTWFwIiwgIm5hbWUiLCAidiIsICJvbGRWYWx1ZSIsICJjYWxsIiwgInRoaXMiLCAicmVxdWVzdFVwZGF0ZSIsICJfJGNoYW5nZVByb3BlcnR5IiwgInZhbHVlIiwgIkVycm9yIiwgInByb3BlcnR5IiwgInByb3RvT3JUYXJnZXQiLCAibmFtZU9yQ29udGV4dCIsICJwcm90byIsICJoYXNPd25Qcm9wZXJ0eSIsICJjb25zdHJ1Y3RvciIsICJjcmVhdGVQcm9wZXJ0eSIsICJ3cmFwcGVkIiwgIk9iamVjdCIsICJnZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3IiLCAibW9kZWwiLCAiaCIsICJfIiwgIm4iXQp9Cg== diff --git a/geemap/static/layer_manager_row.css b/geemap/static/layer_manager_row.css deleted file mode 100644 index 153c430c38..0000000000 --- a/geemap/static/layer_manager_row.css +++ /dev/null @@ -1,4 +0,0 @@ -@import "https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined"; - -/* js/common.css */ -/*# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFtdLAogICJzb3VyY2VzQ29udGVudCI6IFtdLAogICJtYXBwaW5ncyI6ICIiLAogICJuYW1lcyI6IFtdCn0K */ diff --git a/geemap/static/layer_manager_row.js b/geemap/static/layer_manager_row.js index 885c2fc008..78b080e9e0 100644 --- a/geemap/static/layer_manager_row.js +++ b/geemap/static/layer_manager_row.js @@ -289,7 +289,7 @@ var x = "[ \n\f\r]"; var T = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g; var E = /-->/g; var k = />/g; -var O = RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ +var O = RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`, "g"); var S2 = /'/g; var j = /"/g; @@ -607,7 +607,9 @@ var legacyStyles = i` .legacy-button:hover:enabled, .legacy-button:focus:enabled { - box-shadow: var(--jp-elevation-z2); + box-shadow: 0 2px 2px 0 rgba(0, 0, 0, var(--md-shadow-key-penumbra-opacity)), + 0 3px 1px -2px rgba(0, 0, 0, var(--md-shadow-key-umbra-opacity)), + 0 1px 5px 0 rgba(0, 0, 0, var(--md-shadow-ambient-shadow-opacity)); } .legacy-slider { @@ -664,6 +666,16 @@ var materialStyles = i` } `; +// js/utils.ts +function loadFonts() { + if (!document.querySelector(".custom-fonts")) { + const styleElement = document.createElement("style"); + styleElement.classList.add("custom-fonts"); + styleElement.textContent = '@import "https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined";'; + document.body.appendChild(styleElement); + } +} + // js/layer_manager_row.ts var _LayerManagerRow = class _LayerManagerRow extends h3 { constructor() { @@ -878,6 +890,7 @@ if (!customElements.get(LayerManagerRow.componentName)) { customElements.define(LayerManagerRow.componentName, LayerManagerRow); } function render({ model, el }) { + loadFonts(); const row = document.createElement(LayerManagerRow.componentName); row.model = model; el.appendChild(row); @@ -994,4 +1007,3 @@ lit-html/is-server.js: * SPDX-License-Identifier: BSD-3-Clause *) */ -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vbm9kZV9tb2R1bGVzL0BsaXQvcmVhY3RpdmUtZWxlbWVudC9zcmMvY3NzLXRhZy50cyIsICIuLi8uLi9ub2RlX21vZHVsZXMvQGxpdC9yZWFjdGl2ZS1lbGVtZW50L3NyYy9yZWFjdGl2ZS1lbGVtZW50LnRzIiwgIi4uLy4uL25vZGVfbW9kdWxlcy9saXQtaHRtbC9zcmMvbGl0LWh0bWwudHMiLCAiLi4vLi4vbm9kZV9tb2R1bGVzL2xpdC1lbGVtZW50L3NyYy9saXQtZWxlbWVudC50cyIsICIuLi8uLi9ub2RlX21vZHVsZXMvQGxpdC9yZWFjdGl2ZS1lbGVtZW50L3NyYy9kZWNvcmF0b3JzL3Byb3BlcnR5LnRzIiwgIi4uLy4uL2pzL2lweXdpZGdldHNfc3R5bGVzLnRzIiwgIi4uLy4uL2pzL21hdGVyaWFsX3N0eWxlcy50cyIsICIuLi8uLi9qcy9sYXllcl9tYW5hZ2VyX3Jvdy50cyJdLAogICJzb3VyY2VzQ29udGVudCI6IFsiLyoqXG4gKiBAbGljZW5zZVxuICogQ29weXJpZ2h0IDIwMTkgR29vZ2xlIExMQ1xuICogU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IEJTRC0zLUNsYXVzZVxuICovXG5cbmNvbnN0IE5PREVfTU9ERSA9IGZhbHNlO1xuXG4vLyBBbGxvd3MgbWluaWZpZXJzIHRvIHJlbmFtZSByZWZlcmVuY2VzIHRvIGdsb2JhbFRoaXNcbmNvbnN0IGdsb2JhbCA9IGdsb2JhbFRoaXM7XG5cbi8qKlxuICogV2hldGhlciB0aGUgY3VycmVudCBicm93c2VyIHN1cHBvcnRzIGBhZG9wdGVkU3R5bGVTaGVldHNgLlxuICovXG5leHBvcnQgY29uc3Qgc3VwcG9yd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1xuICAgICAgICAgIC8vIGNhc2VzIGxpa2UgYmluZGluZ3MgaW4gdGV4dGFyZWEgdGhlcmUgbWFya2VycyB0dXJuIGludG8gdGV4dCBub2Rlcy5cbiAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAvXig/OnRleHRhcmVhfHRlbXBsYXRlKSQvaSEudGVzdCh0YWcpICYmXG4gICAgICAgICAgICAobm9kZSBhcyBFbGVtZW50KS5pbm5lckhUTUwuaW5jbHVkZXMobWFya2VyKVxuICAgICAgICAgICkge1xuICAgICAgICAgICAgY29uc3QgbSA9XG4gICAgICAgICAgICAgIGBFeHByZXNzaW9ucyBhcmUgbm90IHN1cHBvcnRlZCBpbnNpZGUgXFxgJHt0YWd9XFxgIGAgK1xuICAgICAgICAgICAgICBgZWxlbWVudHMuIFNlZSBodHRwczovL2xpdC5kZXYvbXNnL2V4cHJlc3Npb24taW4tJHt0YWd9IGZvciBtb3JlIGAgK1xuICAgICAgICAgICAgICBgaW5mb3JtYXRpb24uYDtcbiAgICAgICAgICAgIGlmICh0YWcgPT09ICd0ZW1wbGF0ZScpIHtcbiAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKG0pO1xuICAgICAgICAgICAgfSBlbHNlIGlzc3VlV2FybmluZygnJywgbSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIC8vIFRPRE8gKGp1c3RpbmZhZ25hbmkpOiBmb3IgYXR0ZW1wdGVkIGR5bmFtaWMgdGFnIG5hbWVzLCB3ZSBkb24ndFxuICAgICAgICAvLyBpbmNyZW1lbnQgdGhlIGJpbmRpbmdJbmRleCwgYW5kIGl0J2xsIGJlIG9mZiBieSAxIGluIHRoZSBlbGVtZW50XG4gICAgICAgIC8vIGFuZCBvZmYgYnkgdHdvIGFmdGVyIGl0LlxuICAgICAgICBpZiAoKG5vZGUgYXMgRWxlbWVudCkuaGFzQXR0cmlidXRlcygpKSB7XG4gICAgICAgICAgZm9yIChjb25zdCBuYW1lIG9mIChub2RlIGFzIEVsZW1lbnQpLmdldEF0dHJpYnV0ZU5hbWVzKCkpIHtcbiAgICAgICAgICAgIGlmIChuYW1lLmVuZHNXaXRoKGJvdW5kQXR0cmlidXRlU3VmZml4KSkge1xuICAgICAgICAgICAgICBjb25zdCByZWFsTmFtZSA9IGF0dHJOYW1lc1thdHRyTmFtZUluZGV4KytdO1xuICAgICAgICAgICAgICBjb25zdCB2YWx1ZSA9IChub2RlIGFzIEVsZW1lbnQpLmdldEF0dHJpYnV0ZShuYW1lKSE7XG4gICAgICAgICAgICAgIGNvbnN0IHN0YXRpY3MgPSB2YWx1ZS5zcGxpdChtYXJrZXIpO1xuICAgICAgICAgICAgICBjb25zdCBtID0gLyhbLj9AXSk/KC4qKS8uZXhlYyhyZWFsTmFtZSkhO1xuICAgICAgICAgICAgICBwYXJ0cy5wdXNoKHtcbiAgICAgICAgICAgICAgICB0eXBlOiBBVFRSSUJVVEVfUEFSVCxcbiAgICAgICAgICAgICAgICBpbmRleDogbm9kZUluZGV4LFxuICAgICAgICAgICAgICAgIG5hbWU6IG1bMl0sXG4gICAgICAgICAgICAgICAgc3RyaW5nczogc3RhdGljcyxcbiAgICAgICAgICAgICAgICBjdG9yOlxuICAgICAgICAgICAgICAgICAgbVsxXSA9PT0gJy4nXG4gICAgICAgICAgICAgICAgICAgID8gUHJvcGVydHlQYXJ0XG4gICAgICAgICAgICAgICAgICAgIDogbVsxXSA9PT0gJz8nXG4gICAgICAgICAgICAgICAgICAgICAgPyBCb29sZWFuQXR0cmlidXRlUGFydFxuICAgICAgICAgICAgICAgICAgICAgIDogbVsxXSA9PT0gJ0AnXG4gICAgICAgICAgICAgICAgICAgICAgICA/IEV2ZW50UGFydFxuICAgICAgICAgICAgICAgICAgICAgICAgOiBBdHRyaWJ1dGVQYXJ0LFxuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgKG5vZGUgYXMgRWxlbWVudCkucmVtb3ZlQXR0cmlidXRlKG5hbWUpO1xuICAgICAgICAgICA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Rpb24uXG4gICAgICAgICh0aGlzLl8kY29tbWl0dGVkVmFsdWUgYXMgQXJyYXk8dW5rbm93bj4pW2ldID0gdjtcbiAgICAgIH1cbiAgICB9XG4gICAgaWYgKGNoYW5nZSAmJiAhbm9Db21taXQpIHtcbiAgICAgIHRoaXMuX2NvbW1pdFZhbHVlKHZhbHVlKTtcbiAgICB9XG4gIH1cblxuICAvKiogQGludGVybmFsICovXG4gIF9jb21taXRWYWx1ZSh2YWx1ZTogdW5rbm93bikge1xuICAgIGlmICh2YWx1ZSA9PT0gbm90aGluZykge1xuICAgICAgKHdyYXAodGhpcy5lbGVtZW50KSBhcyBFbGVtZW50KS5yZW1vdmVBdHRyaWJ1dGUodGhpcy5uYW1lKTtcbiAgICB9IGVsc2Uge1xuICAgICAgaWYgKEVOQUJMRV9FWFRSQV9TRUNVUklUWV9IT09LUykge1xuICAgICAgICBpZiAodGhpcy5fc2FuaXRpemVyID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICB0aGlzLl9zYW5pdGl6ZXIgPSBzYW5pdGl6ZXJGYWN0b3J5SW50ZXJuYWwoXG4gICAgICAgICAgICB0aGlzLmVsZW1lbnQsXG4gICAgICAgICAgICB0aGlzLm5hbWUsXG4gICAgICAgICAgICAnYXR0cmlidXRlJyxcbiAgICAgICAgICApO1xuICAgICAgICB9XG4gICAgICAgIHZhbHVlID0gdGhpcy5fc2FuaXRpemVyKHZhbHVlID8/ICcnKTtcbiAgICAgIH1cbiAgICAgIGRlYnVnTG9nRXZlbnQgJiZcbiAgICAgICAgZGVidWdMb2dFdmVudCh7XG4gICAgICAgICAga2luZDogJ2NvbW1pdCBhdHRyaWJ1dGUnLFxuICAgICAgICAgIGVsZW1lbnQ6IHRoaXMuZWxlbWVudCxcbiAgICAgICAgICBuYW1lOiB0aGlzLm5hbWUsXG4gICAgICAgICAgdmFsdWUsXG4gICAgICAgICAgb3B0aW9uczogdGhpcy5vcHRpb25zLFxuICAgICAgICB9KTtcbiAgICAgICh3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tcbiAgICAgICAgICAgICAgICBvdmVyZmxvdzogaGlkZGVuO1xuICAgICAgICAgICAgICAgIHRleHQtb3ZlcmZsb3c6IGVsbGlwc2lzO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAuc2V0dGluZ3MtZGVsZXRlLWJ1dHRvbiB7XG4gICAgICAgICAgICAgICAgZm9udC1zaXplOiAxNHB4O1xuICAgICAgICAgICAgICAgIGhlaWdodDogMjZweDtcbiAgICAgICAgICAgICAgICB3aWR0aDogMjZweDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLmxheWVyLW9wYWNpdHktc2xpZGVyIHtcbiAgICAgICAgICAgICAgICB3aWR0aDogNzBweDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLmxheWVyLXZpc2liaWxpdHktY2hlY2tib3gge1xuICAgICAgICAgICAgICAgIG1hcmdpbjogMnB4O1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAuc3Bpbm5lciB7XG4gICAgICAgICAgICAgICAgLXdlYmtpdC1hbmltYXRpb246IHNwaW4gMnMgbGluZWFyIGluZmluaXRlO1xuICAgICAgICAgICAgICAgIGFuaW1hdGlvbjogc3BpbiAycyBsaW5lYXIgaW5maW5pdGU7XG4gICAgICAgICAgICAgICAgYm9yZGVyLXJhZGl1czogNTAlO1xuICAgICAgICAgICAgICAgIGJvcmRlcjogNHB4IHNvbGlkIHZhcigtLWpwLXdpZGdldHMtaW5wdXQtYm9yZGVyLWNvbG9yKTtcbiAgICAgICAgICAgICAgICBib3JkZXItdG9wOiA0cHggc29saWQgdmFyKC0tanAtd2lkZ2V0cy1jb2xvcik7XG4gICAgICAgICAgICAgICAgaGVpZ2h0OiAxMnB4O1xuICAgICAgICAgICAgICAgIHdpZHRoOiAxMnB4O1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBALXdlYmtpdC1rZXlmcmFtZXMgc3BpbiB7XG4gICAgICAgICAgICAgICAgMCUgeyAtd2Via2l0LXRyYW5zZm9ybTogcm90YXRlKDBkZWcpOyB9XG4gICAgICAgICAgICAgICAgMTAwJSB7IC13ZWJraXQtdHJhbnNmb3JtOiByb3RhdGUoMzYwZGVnKTsgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBAa2V5ZnJhbWVzIHNwaW4ge1xuICAgICAgICAgICAgICAgIDAlIHsgdHJhbnNmb3JtOiByb3RhdGUoMGRlZyk7IH1cbiAgICAgICAgICAgICAgICAxMDAlIHsgdHJhbnNmb3JtOiByb3RhdGUoMzYwZGVnKTsgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBidXR0b24ubG9hZGluZyAuc3Bpbm5lcixcbiAgICAgICAgICAgIGJ1dHRvbi5sb2FkaW5nOmhvdmVyIC5jbG9zZS1pY29uLFxuICAgICAgICAgICAgYnV0dG9uLmRvbmUtbG9hZGluZyAuY2xvc2UtaWNvbiB7XG4gICAgICAgICAgICAgICAgZGlzcGxheTogYmxvY2s7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGJ1dHRvbi5sb2FkaW5nIC5jbG9zZS1pY29uLFxuICAgICAgICAgICAgYnV0dG9uLmxvYWRpbmc6aG92ZXIgLnNwaW5uZXIsXG4gICAgICAgICAgICBidXR0b24uZG9uZS1sb2FkaW5nIC5zcGlubmVyIHtcbiAgICAgICAgICAgICAgICBkaXNwbGF5OiBub25lO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAucmVtb3ZlLWxheWVyLXRleHQge1xuICAgICAgICAgICAgICAgIGZsZXgtZ3JvdzogMTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLmNvbmZpcm0tZGVueS1idXR0b24ge1xuICAgICAgICAgICAgICAgIGhlaWdodDogMjZweDtcbiAgICAgICAgICAgICAgICB3aWR0aDogNzBweDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgYCxcbiAgICBdO1xuXG4gICAgcHJpdmF0ZSBfbW9kZWw6IEFueU1vZGVsPExheWVyTWFuY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0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgQHByb3BlcnR5KClcbiAgICBuYW1lOiBzdHJpbmcgPSBcIlwiO1xuXG4gICAgQHByb3BlcnR5KClcbiAgICB2aXNpYmxlOiBib29sZWFuID0gdHJ1ZTtcblxuICAgIEBwcm9wZXJ0eSgpXG4gICAgb3BhY2l0eTogbnVtYmVyID0gMDtcblxuICAgIEBwcm9wZXJ0eSgpXG4gICAgaXNMb2FkaW5nOiBib29sZWFuID0gZmFsc2U7XG5cbiAgICBAcHJvcGVydHkoKVxuICAgIGlzQ29uZmlybURpYWxvZ1Zpc2libGU6IGJvb2xlYW4gPSBmYWxzZTtcblxuICAgIHJlbmRlcigpOiBUZW1wbGF0ZVJlc3VsdCB7XG4gICAgICAgIHJldHVybiBodG1sYFxuICAgICAgICAgICAgPGRpdiBjbGFzcz1cInJvd1wiPlxuICAgICAgICAgICAgICAgIDxpbnB1dFxuICAgICAgICAgICAgICAgICAgICB0eXBlPVwiY2hlY2tib3hcIlxuICAgICAgICAgICAgICAgICAgICBjbGFzcz1cImxheWVyLXZpc2liaWxpdHktY2hlY2tib3hcIlxuICAgICAgICAgICAgICAgICAgICAuY2hlY2tlZD1cIiR7dGhpcy52aXNpYmxlfVwiXG4gICAgICAgICAgICAgICAgICAgIEBjaGFuZ2U9XCIke3RoaXMub25MYXllclZpc2liaWxpdHlDaGFuZ2VkfVwiXG4gICAgICAgICAgICAgICAgLz5cbiAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cImxlZ2FjeS10ZXh0IGxheWVyLW5hbWVcIj4ke3RoaXMubmFtZX08L3NwYW4+XG4gICAgICAgICAgICAgICAgPGlucHV0XG4gICAgICAgICAgICAgICAgICAgIHR5cGU9XCJyYW5nZVwiXG4gICAgICAgICAgICAgICAgICAgIGNsYXNzPVwibGVnYWN5LXNsaWRlciBsYXllci1vcGFjaXR5LXNsaWRlclwiXG4gICAgICAgICAgICAgICAgICAgIG1pbj1cIjBcIlxuICAgICAgICAgICAgICAgICAgICBtYXg9XCIxXCJcbiAgICAgICAgICAgICAgICAgICAgc3RlcD1cIjAuMDFcIlxuICAgICAgICAgICAgICAgICAgICAudmFsdWU9XCIke3RoaXMub3BhY2l0eX1cIlxuICAgICAgICAgICAgICAgICAgICBAaW5wdXQ9XCIke3RoaXMub25MYXllck9wYWNpdHlDaGFuZ2VkfVwiXG4gICAgICAgICAgICAgICAgLz5cbiAgICAgICAgICAgICAgICA8YnV0dG9uXG4gICAgICAgICAgICAgICAgICAgIGNsYXNzPVwibGVnYWN5LWJ1dHRvbiBzZXR0aW5ncy1kZWxldGUtYnV0dG9uXCJcbiAgICAgICAgICAgICAgICAgICAgQGNsaWNrPVwiJHt0aGlzLm9uU2V0dGluZ3NDbGlja2VkfVwiXG4gICAgICAgICAgICAgICAgPlxuICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cIm1hdGVyaWFsLXN5bWJvbHMtb3V0bGluZWRcIj4mI3hlOGI4Ozwvc3Bhbj5cbiAgICAgICAgICAgICAgICA8L2J1dHRvbj5cbiAgICAgICAgICAgICAgICA8YnV0dG9uXG4gICAgICAgICAgICAgICAgICAgIGNsYXNzPVwibGVnYWN5LWJ1dHRvbiBzZXR0aW5ncy1kZWxldGUtYnV0dG9uICR7dGhpcy5pc0xvYWRpbmcgPyAnbG9hZGluZycgOiAnZG9uZS1sb2FkaW5nJ31cIlxuICAgICAgICAgICAgICAgICAgICBAY2xpY2s9XCIke3RoaXMub25EZWxldGVDbGlja2VkfVwiXG4gICAgICAgICAgICAgICAgPlxuICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwic3Bpbm5lclwiPjwvZGl2PlxuICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cImNsb3NlLWljb24gbWF0ZXJpYWwtc3ltYm9scy1vdXRsaW5lZFwiPiYjeGU1Y2Q7PC9zcGFuPlxuICAgICAgICAgICAgICAgIDwvYnV0dG9uPlxuICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICAke3RoaXMucmVuZGVyQ29uZmlybURpYWxvZygpfVxuICAgICAgICBgO1xuICAgIH1cblxuICAgIHByaXZhdGUgcmVuZGVyQ29uZmlybURpYWxvZygpOiBUZW1wbGF0ZVJlc3VsdCB8IHZvaWQge1xuICAgICAgICBpZiAoIXRoaXMuaXNDb25maXJtRGlhbG9nVmlzaWJsZSkge1xuICAgICAgICAgICAgcmV0dXJuIG5vdGhpbmc7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGh0bWxgXG4gICAgICAgICAgICA8ZGl2IGNsYXNzPVwicm93XCI+XG4gICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJsZWdhY3ktdGV4dCByZW1vdmUtbGF5ZXItdGV4dFwiPlJlbW92ZSBsYXllcj88L3NwYW4+XG4gICAgICAgICAgICAgICAgICAgIDxidXR0b25cbiAgICAgICAgICAgICAgICAgICAgICAgIGNsYXNzPVwibGVnYWN5LWJ1dHRvbiBwcmltYXJ5IGNvbmZpcm0tZGVueS1idXR0b25cIlxuICAgICAgICAgICAgICAgICAgICAgICAgQGNsaWNrPVwiJHt0aGlzLmNvbmZpcm1EZWxldGlvbn1cIlxuICAgICAgICAgICAgICAgICAgICA+XG4gICAgICAgICAgICAgICAgICAgICAgICBZZXNcbiAgICAgICAgICAgICAgICAgICAgPC9idXR0b24+XG4gICAgICAgICAgICAgICAgICAgIDxidXR0b25cbiAgICAgICAgICAgICAgICAgICAgICAgIGNsYXNzPVwibGVnYWN5LWJ1dHRvbiBwcmltYXJ5IGNvbmZpcm0tZGVueS1idXR0b25cIlxuICAgICAgICAgICAgICAgICAgICAgICAgQGNsaWNrPVwiJHt0aGlzLmNhbmNlbERlbGV0aW9ufVwiXG4gICAgICAgICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICAgICAgICAgIE5vXG4gICAgICAgICAgICAgICAgICAgIDwvYnV0dG9uPlxuICAgICAgICAgICAgPC9kaX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vbm5lY3RlZENhbGxiYWNrIiwgInNldENvbm5lY3RlZCIsICJkaXNjb25uZWN0ZWRDYWxsYmFjayIsICJub0NoYW5nZSIsICJnbG9iYWxUaGlzIiwgImxpdEVsZW1lbnRIeWRyYXRlU3VwcG9ydCIsICJwb2x5ZmlsbFN1cHBvcnQiLCAibGl0RWxlbWVudFBvbHlmaWxsU3VwcG9ydCIsICJnbG9iYWxUaGlzIiwgImxpdEVsZW1lbnRWZXJzaW9ucyIsICJwdXNoIiwgImRlZmF1bHRQcm9wZXJ0eURlY2xhcmF0aW9uIiwgImF0dHJpYnV0ZSIsICJ0eXBlIiwgIlN0cmluZyIsICJjb252ZXJ0ZXIiLCAiZGVmYXVsdENvbnZlcnRlciIsICJyZWZsZWN0IiwgImhhc0NoYW5nZWQiLCAibm90RXF1YWwiLCAic3RhbmRhcmRQcm9wZXJ0eSIsICJvcHRpb25zIiwgInRhcmdldCIsICJjb250ZXh0IiwgImtpbmQiLCAibWV0YWRhdGEiLCAicHJvcGVydGllcyIsICJnbG9iYWxUaGlzIiwgImxpdFByb3BlcnR5TWV0YWRhdGEiLCAiZ2V0IiwgInNldCIsICJNYXAiLCAibmFtZSIsICJ2IiwgIm9sZFZhbHVlIiwgImNhbGwiLCAidGhpcyIsICJyZXF1ZXN0VXBkYXRlIiwgIl8kY2hhbmdlUHJvcGVydHkiLCAidmFsdWUiLCAiRXJyb3IiLCAicHJvcGVydHkiLCAicHJvdG9PclRhcmdldCIsICJuYW1lT3JDb250ZXh0IiwgInByb3RvIiwgImhhc093blByb3BlcnR5IiwgImNvbnN0cnVjdG9yIiwgImNyZWF0ZVByb3BlcnR5IiwgIndyYXBwZWQiLCAiT2JqZWN0IiwgImdldE93blByb3BlcnR5RGVzY3JpcHRvciIsICJoIiwgIl8iLCAibiJdCn0K diff --git a/geemap/static/material_styles.js b/geemap/static/material_styles.js index 25260356ae..bf2fa93395 100644 --- a/geemap/static/material_styles.js +++ b/geemap/static/material_styles.js @@ -278,7 +278,7 @@ var x = "[ \n\f\r]"; var T = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g; var E = /-->/g; var k = />/g; -var O = RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ +var O = RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`, "g"); var S2 = /'/g; var j = /"/g; @@ -606,4 +606,3 @@ lit-html/is-server.js: * SPDX-License-Identifier: BSD-3-Clause *) */ -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vbm9kZV9tb2R1bGVzL0BsaXQvcmVhY3RpdmUtZWxlbWVudC9zcmMvY3NzLXRhZy50cyIsICIuLi8uLi9ub2RlX21vZHVsZXMvQGxpdC9yZWFjdGl2ZS1lbGVtZW50L3NyYy9yZWFjdGl2ZS1lbGVtZW50LnRzIiwgIi4uLy4uL25vZGVfbW9kdWxlcy9saXQtaHRtbC9zcmMvbGl0LWh0bWwudHMiLCAiLi4vLi4vbm9kZV9tb2R1bGVzL2xpdC1lbGVtZW50L3NyYy9saXQtZWxlbWVudC50cyIsICIuLi8uLi9qcy9tYXRlcmlhbF9zdHlsZXMudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbIi8qKlxuICogQGxpY2Vuc2VcbiAqIENvcHlyaWdodCAyMDE5IEdvb2dsZSBMTENcbiAqIFNQRFgtTGljZW5zZS1JZGVudGlmaWVyOiBCU0QtMy1DbGF1c2VcbiAqL1xuXG5jb25zdCBOT0RFX01PREUgPSBmYWxzZTtcblxuLy8gQWxsb3dzIG1pbmlmaWVycyB0byByZW5hbWUgcmVmZXJlbmNlcyB0byBnbG9iYWxUaGlzXG5jb25zdCBnbG9iYWwgPSBnbG9iYWxUaGlzO1xuXG4vKipcbiAqIFdoZXRoZXIgdGhlIGN1cnJlbnQgYnJvd3NlciBzdXBwb3J0cyBgY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aWNzID0gdmFsdWUuc3BsaXQobWFya2VyKTtcbiAgICAgICAgICAgICAgY29uc3QgbSA9IC8oWy4/QF0pPyguKikvLmV4ZWMocmVhbE5hbWUpITtcbiAgICAgICAgICAgICAgcGFydHMucHVzaCh7XG4gICAgICAgICAgICAgICAgdHlwZTogQVRUUklCVVRFX1BBUlQsXG4gICAgICAgICAgICAgICAgaW5kZXg6IG5vZGVJbmRleCxcbiAgICAgICAgICAgICAgICBuYW1lOiBtWzJdLFxuICAgICAgICAgICAgICAgIHN0cmluZ3M6IHN0YXRpY3MsXG4gICAgICAgICAgICAgICAgY3RvcjpcbiAgICAgICAgICAgICAgICAgIG1bMV0gPT09ICcuJ1xuICAgICAgICAgICAgICAgICAgICA/IFByb3BlcnR5UGFydFxuICAgICAgICAgICAgICAgICAgICA6IG1bMV0gPT09ICc/J1xuICAgICAgICAgICAgICAgICAgICAgID8gQm9vbGVhbkF0dHJpYnV0ZVBhcnRcbiAgICAgICAgICAgICAgICAgICAgICA6IG1bMV0gPT09ICdAJ1xuICAgICAgICAgICAgICAgICAgICAgICAgPyBFdmVudFBhcnRcbiAgICAgICAgICAgICAgICAgICAgICAgIDogQXR0cmlidXRlUGFydCxcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgIChub2RlIGFzIEVsZW1lbnQpLnJlbW92ZUF0dHJpYnV0ZShuYW1lKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobmFtZS5zdGFydHNXaXRoKG1hcmtlcikpIHtcbiAgICAgICAgICAgICAgcGFydHMucHVzaCh7XG4gICAgICAgICAgICAgICAgdHlwZTogRUxFTUVOVF9QQVJULFxuICAgICAgICAgICAgICAgIGluZGV4OiBub2RlSW5kZXgsXG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAobm9kZSBhcyBFbGVtZW50KS5yZW1vdmVBdHRyaWJ1dGUobmFtZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICA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bnQiLCAiY2FsbCIsICJob3N0IiwgImhhbmRsZUV2ZW50IiwgInBvbHlmaWxsU3VwcG9ydCIsICJnbG9iYWwiLCAibGl0SHRtbFBvbHlmaWxsU3VwcG9ydCIsICJUZW1wbGF0ZSIsICJDaGlsZFBhcnQiLCAibGl0SHRtbFZlcnNpb25zIiwgInB1c2giLCAicmVuZGVyIiwgInZhbHVlIiwgImNvbnRhaW5lciIsICJvcHRpb25zIiwgInBhcnRPd25lck5vZGUiLCAicmVuZGVyQmVmb3JlIiwgInBhcnQiLCAiZW5kTm9kZSIsICJpbnNlcnRCZWZvcmUiLCAiY3JlYXRlTWFya2VyIiwgIl8kc2V0VmFsdWUiLCAiTGl0RWxlbWVudCIsICJSZWFjdGl2ZUVsZW1lbnQiLCAiY29uc3RydWN0b3IiLCAidGhpcyIsICJyZW5kZXJPcHRpb25zIiwgImhvc3QiLCAiX19jaGlsZFBhcnQiLCAiY3JlYXRlUmVuZGVyUm9vdCIsICJyZW5kZXJSb290IiwgInN1cGVyIiwgInJlbmRlckJlZm9yZSIsICJmaXJzdENoaWxkIiwgImNoYW5nZWRQcm9wZXJ0aWVzIiwgInZhbHVlIiwgInJlbmRlciIsICJoYXNVcGRhdGVkIiwgImlzQ29ubmVjdGVkIiwgInVwZGF0ZSIsICJjb25uZWN0ZWRDYWxsYmFjayIsICJzZXRDb25uZWN0ZWQiLCAiZGlzY29ubmVjdGVkQ2FsbGJhY2siLCAibm9DaGFuZ2UiLCAiZ2xvYmFsVGhpcyIsICJsaXRFbGVtZW50SHlkcmF0ZVN1cHBvcnQiLCAicG9seWZpbGxTdXBwb3J0IiwgImxpdEVsZW1lbnRQb2x5ZmlsbFN1cHBvcnQiLCAiZ2xvYmFsVGhpcyIsICJsaXRFbGVtZW50VmVyc2lvbnMiLCAicHVzaCJdCn0K diff --git a/geemap/static/utils.js b/geemap/static/utils.js index 48c0be3026..6afc8f4c75 100644 --- a/geemap/static/utils.js +++ b/geemap/static/utils.js @@ -4,6 +4,14 @@ async function unpackModels(modelIds, manager) { modelIds.map((id) => manager.get_model(id.slice("IPY_MODEL_".length))) ); } +function loadFonts() { + if (!document.querySelector(".custom-fonts")) { + const styleElement = document.createElement("style"); + styleElement.classList.add("custom-fonts"); + styleElement.textContent = '@import "https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined";'; + document.body.appendChild(styleElement); + } +} async function updateChildren(container, model) { const children = model.get("children"); const child_models = await unpackModels(children, model.widget_manager); @@ -16,6 +24,6 @@ async function updateChildren(container, model) { } } export { + loadFonts, updateChildren }; -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vanMvdXRpbHMudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImltcG9ydCB0eXBlIHsgQW55TW9kZWwgfSBmcm9tIFwiQGFueXdpZGdldC90eXBlc1wiO1xuaW1wb3J0IHsgSVdpZGdldE1hbmFnZXIsIFdpZGdldE1vZGVsIH0gZnJvbSBcIkBqdXB5dGVyLXdpZGdldHMvYmFzZVwiO1xuXG5hc3luYyBmdW5jdGlvbiB1bnBhY2tNb2RlbHMobW9kZWxJZHM6IEFycmF5PHN0cmluZz4sIG1hbmFnZXI6IElXaWRnZXRNYW5hZ2VyKTogUHJvbWlzZTxBcnJheTxXaWRnZXRNb2RlbD4+IHtcbiAgICByZXR1cm4gUHJvbWlzZS5hbGwoXG4gICAgICAgIG1vZGVsSWRzLm1hcChpZCA9PiBtYW5hZ2VyLmdldF9tb2RlbChpZC5zbGljZShcIklQWV9NT0RFTF9cIi5sZW5ndGgpKSlcbiAgICApO1xufVxuXG5leHBvcnQgYXN5bmMgZnVuY3Rpb24gdXBkYXRlQ2hpbGRyZW4oY29udGFpbmVyOiBIVE1MRWxlbWVudCwgbW9kZWw6IEFueU1vZGVsPGFueT4pIHtcbiAgICBjb25zdCBjaGlsZHJlbiA9IG1vZGVsLmdldChcImNoaWxkcmVuXCIpO1xuICAgIGNvbnN0IGNoaW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a..0000000000 --- a/js/common.css +++ /dev/null @@ -1 +0,0 @@ -@import url(https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined); \ No newline at end of file diff --git a/js/layer_manager.ts b/js/layer_manager.ts index 842c251466..c7540b3dfa 100644 --- a/js/layer_manager.ts +++ b/js/layer_manager.ts @@ -2,9 +2,7 @@ import type { AnyModel, RenderContext } from "@anywidget/types"; import { html, css, LitElement } from "lit"; import { property } from "lit/decorators.js"; import { legacyStyles } from './ipywidgets_styles'; -import { updateChildren } from "./utils"; - -import "./common.css"; +import { loadFonts, updateChildren } from "./utils"; interface LayerManagerModel { children: any; @@ -95,6 +93,7 @@ if (!customElements.get(LayerManager.componentName)) { } async function render({ model, el }: RenderContext) { + loadFonts(); const manager = document.createElement(LayerManager.componentName); manager.model = model; el.appendChild(manager); diff --git a/js/layer_manager_row.ts b/js/layer_manager_row.ts index e760f0105f..29dbbfcfb4 100644 --- a/js/layer_manager_row.ts +++ b/js/layer_manager_row.ts @@ -2,9 +2,9 @@ import type { AnyModel, RenderContext } from "@anywidget/types"; import { html, css, LitElement, TemplateResult, nothing } from "lit"; import { property } from "lit/decorators.js"; -import "./common.css"; import { legacyStyles } from './ipywidgets_styles'; import { materialStyles } from "./material_styles"; +import { loadFonts } from "./utils"; interface LayerManagerRowModel { name: string; @@ -230,6 +230,7 @@ if (!customElements.get(LayerManagerRow.componentName)) { } function render({ model, el }: RenderContext) { + loadFonts(); const row = document.createElement(LayerManagerRow.componentName); row.model = model; el.appendChild(row); diff --git a/js/utils.ts b/js/utils.ts index bdfa64ef87..26d0a7b76b 100644 --- a/js/utils.ts +++ b/js/utils.ts @@ -7,6 +7,15 @@ async function unpackModels(modelIds: Array, manager: IWidgetManager): P ); } +export function loadFonts() { + if (!document.querySelector('.custom-fonts')) { + const styleElement = document.createElement('style'); + styleElement.classList.add('custom-fonts'); + styleElement.textContent = '@import "https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined";' + document.body.appendChild(styleElement); + } +} + export async function updateChildren(container: HTMLElement, model: AnyModel) { const children = model.get("children"); const child_models = await unpackModels(children, model.widget_manager); From 9d359bc7b47ddc30e6a7afe9dcf39bf75cd213fa Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 16 Oct 2024 01:19:23 +0000 Subject: [PATCH 19/57] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- geemap/static/ipywidgets_styles.js | 2 +- geemap/static/layer_manager.js | 2 +- geemap/static/layer_manager_row.js | 2 +- geemap/static/material_styles.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/geemap/static/ipywidgets_styles.js b/geemap/static/ipywidgets_styles.js index 5ddee3c553..574f105dc5 100644 --- a/geemap/static/ipywidgets_styles.js +++ b/geemap/static/ipywidgets_styles.js @@ -278,7 +278,7 @@ var x = "[ \n\f\r]"; var T = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g; var E = /-->/g; var k = />/g; -var O = RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ +var O = RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`, "g"); var S2 = /'/g; var j = /"/g; diff --git a/geemap/static/layer_manager.js b/geemap/static/layer_manager.js index bba41a5949..e098a78d10 100644 --- a/geemap/static/layer_manager.js +++ b/geemap/static/layer_manager.js @@ -289,7 +289,7 @@ var x = "[ \n\f\r]"; var T = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g; var E = /-->/g; var k = />/g; -var O = RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ +var O = RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`, "g"); var S2 = /'/g; var j = /"/g; diff --git a/geemap/static/layer_manager_row.js b/geemap/static/layer_manager_row.js index 78b080e9e0..3cc458fa32 100644 --- a/geemap/static/layer_manager_row.js +++ b/geemap/static/layer_manager_row.js @@ -289,7 +289,7 @@ var x = "[ \n\f\r]"; var T = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g; var E = /-->/g; var k = />/g; -var O = RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ +var O = RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`, "g"); var S2 = /'/g; var j = /"/g; diff --git a/geemap/static/material_styles.js b/geemap/static/material_styles.js index bf2fa93395..a2a9f007ca 100644 --- a/geemap/static/material_styles.js +++ b/geemap/static/material_styles.js @@ -278,7 +278,7 @@ var x = "[ \n\f\r]"; var T = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g; var E = /-->/g; var k = />/g; -var O = RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ +var O = RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`, "g"); var S2 = /'/g; var j = /"/g; From 301d2547e491332c6bc14b230b43be68255038dd Mon Sep 17 00:00:00 2001 From: Sufyan Abbasi Date: Wed, 16 Oct 2024 01:35:55 +0000 Subject: [PATCH 20/57] Rebuild --- geemap/static/ipywidgets_styles.js | 554 +--------------------- geemap/static/layer_manager.js | 692 +-------------------------- geemap/static/layer_manager_row.js | 722 +---------------------------- geemap/static/material_styles.js | 554 +--------------------- geemap/static/utils.js | 30 +- 5 files changed, 24 insertions(+), 2528 deletions(-) diff --git a/geemap/static/ipywidgets_styles.js b/geemap/static/ipywidgets_styles.js index 574f105dc5..1e59b17fbe 100644 --- a/geemap/static/ipywidgets_styles.js +++ b/geemap/static/ipywidgets_styles.js @@ -1,549 +1,6 @@ -// node_modules/@lit/reactive-element/css-tag.js -var t = globalThis; -var e = t.ShadowRoot && (void 0 === t.ShadyCSS || t.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype; -var s = Symbol(); -var o = /* @__PURE__ */ new WeakMap(); -var n = class { - constructor(t2, e3, o3) { - if (this._$cssResult$ = true, o3 !== s) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead."); - this.cssText = t2, this.t = e3; - } - get styleSheet() { - let t2 = this.o; - const s2 = this.t; - if (e && void 0 === t2) { - const e3 = void 0 !== s2 && 1 === s2.length; - e3 && (t2 = o.get(s2)), void 0 === t2 && ((this.o = t2 = new CSSStyleSheet()).replaceSync(this.cssText), e3 && o.set(s2, t2)); - } - return t2; - } - toString() { - return this.cssText; - } -}; -var r = (t2) => new n("string" == typeof t2 ? t2 : t2 + "", void 0, s); -var i = (t2, ...e3) => { - const o3 = 1 === t2.length ? t2[0] : e3.reduce((e4, s2, o4) => e4 + ((t3) => { - if (true === t3._$cssResult$) return t3.cssText; - if ("number" == typeof t3) return t3; - throw Error("Value passed to 'css' function must be a 'css' function result: " + t3 + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security."); - })(s2) + t2[o4 + 1], t2[0]); - return new n(o3, t2, s); -}; -var S = (s2, o3) => { - if (e) s2.adoptedStyleSheets = o3.map((t2) => t2 instanceof CSSStyleSheet ? t2 : t2.styleSheet); - else for (const e3 of o3) { - const o4 = document.createElement("style"), n4 = t.litNonce; - void 0 !== n4 && o4.setAttribute("nonce", n4), o4.textContent = e3.cssText, s2.appendChild(o4); - } -}; -var c = e ? (t2) => t2 : (t2) => t2 instanceof CSSStyleSheet ? ((t3) => { - let e3 = ""; - for (const s2 of t3.cssRules) e3 += s2.cssText; - return r(e3); -})(t2) : t2; - -// node_modules/@lit/reactive-element/reactive-element.js -var { is: i2, defineProperty: e2, getOwnPropertyDescriptor: r2, getOwnPropertyNames: h, getOwnPropertySymbols: o2, getPrototypeOf: n2 } = Object; -var a = globalThis; -var c2 = a.trustedTypes; -var l = c2 ? c2.emptyScript : ""; -var p = a.reactiveElementPolyfillSupport; -var d = (t2, s2) => t2; -var u = { toAttribute(t2, s2) { - switch (s2) { - case Boolean: - t2 = t2 ? l : null; - break; - case Object: - case Array: - t2 = null == t2 ? t2 : JSON.stringify(t2); - } - return t2; -}, fromAttribute(t2, s2) { - let i3 = t2; - switch (s2) { - case Boolean: - i3 = null !== t2; - break; - case Number: - i3 = null === t2 ? null : Number(t2); - break; - case Object: - case Array: - try { - i3 = JSON.parse(t2); - } catch (t3) { - i3 = null; - } - } - return i3; -} }; -var f = (t2, s2) => !i2(t2, s2); -var y = { attribute: true, type: String, converter: u, reflect: false, hasChanged: f }; -Symbol.metadata ??= Symbol("metadata"), a.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap(); -var b = class extends HTMLElement { - static addInitializer(t2) { - this._$Ei(), (this.l ??= []).push(t2); - } - static get observedAttributes() { - return this.finalize(), this._$Eh && [...this._$Eh.keys()]; - } - static createProperty(t2, s2 = y) { - if (s2.state && (s2.attribute = false), this._$Ei(), this.elementProperties.set(t2, s2), !s2.noAccessor) { - const i3 = Symbol(), r3 = this.getPropertyDescriptor(t2, i3, s2); - void 0 !== r3 && e2(this.prototype, t2, r3); - } - } - static getPropertyDescriptor(t2, s2, i3) { - const { get: e3, set: h4 } = r2(this.prototype, t2) ?? { get() { - return this[s2]; - }, set(t3) { - this[s2] = t3; - } }; - return { get() { - return e3?.call(this); - }, set(s3) { - const r3 = e3?.call(this); - h4.call(this, s3), this.requestUpdate(t2, r3, i3); - }, configurable: true, enumerable: true }; - } - static getPropertyOptions(t2) { - return this.elementProperties.get(t2) ?? y; - } - static _$Ei() { - if (this.hasOwnProperty(d("elementProperties"))) return; - const t2 = n2(this); - t2.finalize(), void 0 !== t2.l && (this.l = [...t2.l]), this.elementProperties = new Map(t2.elementProperties); - } - static finalize() { - if (this.hasOwnProperty(d("finalized"))) return; - if (this.finalized = true, this._$Ei(), this.hasOwnProperty(d("properties"))) { - const t3 = this.properties, s2 = [...h(t3), ...o2(t3)]; - for (const i3 of s2) this.createProperty(i3, t3[i3]); - } - const t2 = this[Symbol.metadata]; - if (null !== t2) { - const s2 = litPropertyMetadata.get(t2); - if (void 0 !== s2) for (const [t3, i3] of s2) this.elementProperties.set(t3, i3); - } - this._$Eh = /* @__PURE__ */ new Map(); - for (const [t3, s2] of this.elementProperties) { - const i3 = this._$Eu(t3, s2); - void 0 !== i3 && this._$Eh.set(i3, t3); - } - this.elementStyles = this.finalizeStyles(this.styles); - } - static finalizeStyles(s2) { - const i3 = []; - if (Array.isArray(s2)) { - const e3 = new Set(s2.flat(1 / 0).reverse()); - for (const s3 of e3) i3.unshift(c(s3)); - } else void 0 !== s2 && i3.push(c(s2)); - return i3; - } - static _$Eu(t2, s2) { - const i3 = s2.attribute; - return false === i3 ? void 0 : "string" == typeof i3 ? i3 : "string" == typeof t2 ? t2.toLowerCase() : void 0; - } - constructor() { - super(), this._$Ep = void 0, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev(); - } - _$Ev() { - this._$ES = new Promise((t2) => this.enableUpdating = t2), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((t2) => t2(this)); - } - addController(t2) { - (this._$EO ??= /* @__PURE__ */ new Set()).add(t2), void 0 !== this.renderRoot && this.isConnected && t2.hostConnected?.(); - } - removeController(t2) { - this._$EO?.delete(t2); - } - _$E_() { - const t2 = /* @__PURE__ */ new Map(), s2 = this.constructor.elementProperties; - for (const i3 of s2.keys()) this.hasOwnProperty(i3) && (t2.set(i3, this[i3]), delete this[i3]); - t2.size > 0 && (this._$Ep = t2); - } - createRenderRoot() { - const t2 = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions); - return S(t2, this.constructor.elementStyles), t2; - } - connectedCallback() { - this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach((t2) => t2.hostConnected?.()); - } - enableUpdating(t2) { - } - disconnectedCallback() { - this._$EO?.forEach((t2) => t2.hostDisconnected?.()); - } - attributeChangedCallback(t2, s2, i3) { - this._$AK(t2, i3); - } - _$EC(t2, s2) { - const i3 = this.constructor.elementProperties.get(t2), e3 = this.constructor._$Eu(t2, i3); - if (void 0 !== e3 && true === i3.reflect) { - const r3 = (void 0 !== i3.converter?.toAttribute ? i3.converter : u).toAttribute(s2, i3.type); - this._$Em = t2, null == r3 ? this.removeAttribute(e3) : this.setAttribute(e3, r3), this._$Em = null; - } - } - _$AK(t2, s2) { - const i3 = this.constructor, e3 = i3._$Eh.get(t2); - if (void 0 !== e3 && this._$Em !== e3) { - const t3 = i3.getPropertyOptions(e3), r3 = "function" == typeof t3.converter ? { fromAttribute: t3.converter } : void 0 !== t3.converter?.fromAttribute ? t3.converter : u; - this._$Em = e3, this[e3] = r3.fromAttribute(s2, t3.type), this._$Em = null; - } - } - requestUpdate(t2, s2, i3) { - if (void 0 !== t2) { - if (i3 ??= this.constructor.getPropertyOptions(t2), !(i3.hasChanged ?? f)(this[t2], s2)) return; - this.P(t2, s2, i3); - } - false === this.isUpdatePending && (this._$ES = this._$ET()); - } - P(t2, s2, i3) { - this._$AL.has(t2) || this._$AL.set(t2, s2), true === i3.reflect && this._$Em !== t2 && (this._$Ej ??= /* @__PURE__ */ new Set()).add(t2); - } - async _$ET() { - this.isUpdatePending = true; - try { - await this._$ES; - } catch (t3) { - Promise.reject(t3); - } - const t2 = this.scheduleUpdate(); - return null != t2 && await t2, !this.isUpdatePending; - } - scheduleUpdate() { - return this.performUpdate(); - } - performUpdate() { - if (!this.isUpdatePending) return; - if (!this.hasUpdated) { - if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) { - for (const [t4, s3] of this._$Ep) this[t4] = s3; - this._$Ep = void 0; - } - const t3 = this.constructor.elementProperties; - if (t3.size > 0) for (const [s3, i3] of t3) true !== i3.wrapped || this._$AL.has(s3) || void 0 === this[s3] || this.P(s3, this[s3], i3); - } - let t2 = false; - const s2 = this._$AL; - try { - t2 = this.shouldUpdate(s2), t2 ? (this.willUpdate(s2), this._$EO?.forEach((t3) => t3.hostUpdate?.()), this.update(s2)) : this._$EU(); - } catch (s3) { - throw t2 = false, this._$EU(), s3; - } - t2 && this._$AE(s2); - } - willUpdate(t2) { - } - _$AE(t2) { - this._$EO?.forEach((t3) => t3.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t2)), this.updated(t2); - } - _$EU() { - this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = false; - } - get updateComplete() { - return this.getUpdateComplete(); - } - getUpdateComplete() { - return this._$ES; - } - shouldUpdate(t2) { - return true; - } - update(t2) { - this._$Ej &&= this._$Ej.forEach((t3) => this._$EC(t3, this[t3])), this._$EU(); - } - updated(t2) { - } - firstUpdated(t2) { - } -}; -b.elementStyles = [], b.shadowRootOptions = { mode: "open" }, b[d("elementProperties")] = /* @__PURE__ */ new Map(), b[d("finalized")] = /* @__PURE__ */ new Map(), p?.({ ReactiveElement: b }), (a.reactiveElementVersions ??= []).push("2.0.4"); - -// node_modules/lit-html/lit-html.js -var n3 = globalThis; -var c3 = n3.trustedTypes; -var h2 = c3 ? c3.createPolicy("lit-html", { createHTML: (t2) => t2 }) : void 0; -var f2 = "$lit$"; -var v = `lit$${Math.random().toFixed(9).slice(2)}$`; -var m = "?" + v; -var _ = `<${m}>`; -var w = document; -var lt = () => w.createComment(""); -var st = (t2) => null === t2 || "object" != typeof t2 && "function" != typeof t2; -var g = Array.isArray; -var $ = (t2) => g(t2) || "function" == typeof t2?.[Symbol.iterator]; -var x = "[ \n\f\r]"; -var T = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g; -var E = /-->/g; -var k = />/g; -var O = RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ -\f\r"'\`<>=]|("|')|))|$)`, "g"); -var S2 = /'/g; -var j = /"/g; -var M = /^(?:script|style|textarea|title)$/i; -var P = (t2) => (i3, ...s2) => ({ _$litType$: t2, strings: i3, values: s2 }); -var ke = P(1); -var Oe = P(2); -var Se = P(3); -var R = Symbol.for("lit-noChange"); -var D = Symbol.for("lit-nothing"); -var V = /* @__PURE__ */ new WeakMap(); -var I = w.createTreeWalker(w, 129); -function N(t2, i3) { - if (!g(t2) || !t2.hasOwnProperty("raw")) throw Error("invalid template strings array"); - return void 0 !== h2 ? h2.createHTML(i3) : i3; -} -var U = (t2, i3) => { - const s2 = t2.length - 1, e3 = []; - let h4, o3 = 2 === i3 ? "" : 3 === i3 ? "" : "", n4 = T; - for (let i4 = 0; i4 < s2; i4++) { - const s3 = t2[i4]; - let r3, l2, c4 = -1, a2 = 0; - for (; a2 < s3.length && (n4.lastIndex = a2, l2 = n4.exec(s3), null !== l2); ) a2 = n4.lastIndex, n4 === T ? "!--" === l2[1] ? n4 = E : void 0 !== l2[1] ? n4 = k : void 0 !== l2[2] ? (M.test(l2[2]) && (h4 = RegExp("" === l2[0] ? (n4 = h4 ?? T, c4 = -1) : void 0 === l2[1] ? c4 = -2 : (c4 = n4.lastIndex - l2[2].length, r3 = l2[1], n4 = void 0 === l2[3] ? O : '"' === l2[3] ? j : S2) : n4 === j || n4 === S2 ? n4 = O : n4 === E || n4 === k ? n4 = T : (n4 = O, h4 = void 0); - const u2 = n4 === O && t2[i4 + 1].startsWith("/>") ? " " : ""; - o3 += n4 === T ? s3 + _ : c4 >= 0 ? (e3.push(r3), s3.slice(0, c4) + f2 + s3.slice(c4) + v + u2) : s3 + v + (-2 === c4 ? i4 : u2); - } - return [N(t2, o3 + (t2[s2] || "") + (2 === i3 ? "" : 3 === i3 ? "" : "")), e3]; -}; -var B = class _B { - constructor({ strings: t2, _$litType$: i3 }, s2) { - let e3; - this.parts = []; - let h4 = 0, o3 = 0; - const n4 = t2.length - 1, r3 = this.parts, [l2, a2] = U(t2, i3); - if (this.el = _B.createElement(l2, s2), I.currentNode = this.el.content, 2 === i3 || 3 === i3) { - const t3 = this.el.content.firstChild; - t3.replaceWith(...t3.childNodes); - } - for (; null !== (e3 = I.nextNode()) && r3.length < n4; ) { - if (1 === e3.nodeType) { - if (e3.hasAttributes()) for (const t3 of e3.getAttributeNames()) if (t3.endsWith(f2)) { - const i4 = a2[o3++], s3 = e3.getAttribute(t3).split(v), n5 = /([.?@])?(.*)/.exec(i4); - r3.push({ type: 1, index: h4, name: n5[2], strings: s3, ctor: "." === n5[1] ? Y : "?" === n5[1] ? Z : "@" === n5[1] ? q : G }), e3.removeAttribute(t3); - } else t3.startsWith(v) && (r3.push({ type: 6, index: h4 }), e3.removeAttribute(t3)); - if (M.test(e3.tagName)) { - const t3 = e3.textContent.split(v), i4 = t3.length - 1; - if (i4 > 0) { - e3.textContent = c3 ? c3.emptyScript : ""; - for (let s3 = 0; s3 < i4; s3++) e3.append(t3[s3], lt()), I.nextNode(), r3.push({ type: 2, index: ++h4 }); - e3.append(t3[i4], lt()); - } - } - } else if (8 === e3.nodeType) if (e3.data === m) r3.push({ type: 2, index: h4 }); - else { - let t3 = -1; - for (; -1 !== (t3 = e3.data.indexOf(v, t3 + 1)); ) r3.push({ type: 7, index: h4 }), t3 += v.length - 1; - } - h4++; - } - } - static createElement(t2, i3) { - const s2 = w.createElement("template"); - return s2.innerHTML = t2, s2; - } -}; -function z(t2, i3, s2 = t2, e3) { - if (i3 === R) return i3; - let h4 = void 0 !== e3 ? s2.o?.[e3] : s2.l; - const o3 = st(i3) ? void 0 : i3._$litDirective$; - return h4?.constructor !== o3 && (h4?._$AO?.(false), void 0 === o3 ? h4 = void 0 : (h4 = new o3(t2), h4._$AT(t2, s2, e3)), void 0 !== e3 ? (s2.o ??= [])[e3] = h4 : s2.l = h4), void 0 !== h4 && (i3 = z(t2, h4._$AS(t2, i3.values), h4, e3)), i3; -} -var F = class { - constructor(t2, i3) { - this._$AV = [], this._$AN = void 0, this._$AD = t2, this._$AM = i3; - } - get parentNode() { - return this._$AM.parentNode; - } - get _$AU() { - return this._$AM._$AU; - } - u(t2) { - const { el: { content: i3 }, parts: s2 } = this._$AD, e3 = (t2?.creationScope ?? w).importNode(i3, true); - I.currentNode = e3; - let h4 = I.nextNode(), o3 = 0, n4 = 0, r3 = s2[0]; - for (; void 0 !== r3; ) { - if (o3 === r3.index) { - let i4; - 2 === r3.type ? i4 = new et(h4, h4.nextSibling, this, t2) : 1 === r3.type ? i4 = new r3.ctor(h4, r3.name, r3.strings, this, t2) : 6 === r3.type && (i4 = new K(h4, this, t2)), this._$AV.push(i4), r3 = s2[++n4]; - } - o3 !== r3?.index && (h4 = I.nextNode(), o3++); - } - return I.currentNode = w, e3; - } - p(t2) { - let i3 = 0; - for (const s2 of this._$AV) void 0 !== s2 && (void 0 !== s2.strings ? (s2._$AI(t2, s2, i3), i3 += s2.strings.length - 2) : s2._$AI(t2[i3])), i3++; - } -}; -var et = class _et { - get _$AU() { - return this._$AM?._$AU ?? this.v; - } - constructor(t2, i3, s2, e3) { - this.type = 2, this._$AH = D, this._$AN = void 0, this._$AA = t2, this._$AB = i3, this._$AM = s2, this.options = e3, this.v = e3?.isConnected ?? true; - } - get parentNode() { - let t2 = this._$AA.parentNode; - const i3 = this._$AM; - return void 0 !== i3 && 11 === t2?.nodeType && (t2 = i3.parentNode), t2; - } - get startNode() { - return this._$AA; - } - get endNode() { - return this._$AB; - } - _$AI(t2, i3 = this) { - t2 = z(this, t2, i3), st(t2) ? t2 === D || null == t2 || "" === t2 ? (this._$AH !== D && this._$AR(), this._$AH = D) : t2 !== this._$AH && t2 !== R && this._(t2) : void 0 !== t2._$litType$ ? this.$(t2) : void 0 !== t2.nodeType ? this.T(t2) : $(t2) ? this.k(t2) : this._(t2); - } - O(t2) { - return this._$AA.parentNode.insertBefore(t2, this._$AB); - } - T(t2) { - this._$AH !== t2 && (this._$AR(), this._$AH = this.O(t2)); - } - _(t2) { - this._$AH !== D && st(this._$AH) ? this._$AA.nextSibling.data = t2 : this.T(w.createTextNode(t2)), this._$AH = t2; - } - $(t2) { - const { values: i3, _$litType$: s2 } = t2, e3 = "number" == typeof s2 ? this._$AC(t2) : (void 0 === s2.el && (s2.el = B.createElement(N(s2.h, s2.h[0]), this.options)), s2); - if (this._$AH?._$AD === e3) this._$AH.p(i3); - else { - const t3 = new F(e3, this), s3 = t3.u(this.options); - t3.p(i3), this.T(s3), this._$AH = t3; - } - } - _$AC(t2) { - let i3 = V.get(t2.strings); - return void 0 === i3 && V.set(t2.strings, i3 = new B(t2)), i3; - } - k(t2) { - g(this._$AH) || (this._$AH = [], this._$AR()); - const i3 = this._$AH; - let s2, e3 = 0; - for (const h4 of t2) e3 === i3.length ? i3.push(s2 = new _et(this.O(lt()), this.O(lt()), this, this.options)) : s2 = i3[e3], s2._$AI(h4), e3++; - e3 < i3.length && (this._$AR(s2 && s2._$AB.nextSibling, e3), i3.length = e3); - } - _$AR(t2 = this._$AA.nextSibling, i3) { - for (this._$AP?.(false, true, i3); t2 && t2 !== this._$AB; ) { - const i4 = t2.nextSibling; - t2.remove(), t2 = i4; - } - } - setConnected(t2) { - void 0 === this._$AM && (this.v = t2, this._$AP?.(t2)); - } -}; -var G = class { - get tagName() { - return this.element.tagName; - } - get _$AU() { - return this._$AM._$AU; - } - constructor(t2, i3, s2, e3, h4) { - this.type = 1, this._$AH = D, this._$AN = void 0, this.element = t2, this.name = i3, this._$AM = e3, this.options = h4, s2.length > 2 || "" !== s2[0] || "" !== s2[1] ? (this._$AH = Array(s2.length - 1).fill(new String()), this.strings = s2) : this._$AH = D; - } - _$AI(t2, i3 = this, s2, e3) { - const h4 = this.strings; - let o3 = false; - if (void 0 === h4) t2 = z(this, t2, i3, 0), o3 = !st(t2) || t2 !== this._$AH && t2 !== R, o3 && (this._$AH = t2); - else { - const e4 = t2; - let n4, r3; - for (t2 = h4[0], n4 = 0; n4 < h4.length - 1; n4++) r3 = z(this, e4[s2 + n4], i3, n4), r3 === R && (r3 = this._$AH[n4]), o3 ||= !st(r3) || r3 !== this._$AH[n4], r3 === D ? t2 = D : t2 !== D && (t2 += (r3 ?? "") + h4[n4 + 1]), this._$AH[n4] = r3; - } - o3 && !e3 && this.j(t2); - } - j(t2) { - t2 === D ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t2 ?? ""); - } -}; -var Y = class extends G { - constructor() { - super(...arguments), this.type = 3; - } - j(t2) { - this.element[this.name] = t2 === D ? void 0 : t2; - } -}; -var Z = class extends G { - constructor() { - super(...arguments), this.type = 4; - } - j(t2) { - this.element.toggleAttribute(this.name, !!t2 && t2 !== D); - } -}; -var q = class extends G { - constructor(t2, i3, s2, e3, h4) { - super(t2, i3, s2, e3, h4), this.type = 5; - } - _$AI(t2, i3 = this) { - if ((t2 = z(this, t2, i3, 0) ?? D) === R) return; - const s2 = this._$AH, e3 = t2 === D && s2 !== D || t2.capture !== s2.capture || t2.once !== s2.once || t2.passive !== s2.passive, h4 = t2 !== D && (s2 === D || e3); - e3 && this.element.removeEventListener(this.name, this, s2), h4 && this.element.addEventListener(this.name, this, t2), this._$AH = t2; - } - handleEvent(t2) { - "function" == typeof this._$AH ? this._$AH.call(this.options?.host ?? this.element, t2) : this._$AH.handleEvent(t2); - } -}; -var K = class { - constructor(t2, i3, s2) { - this.element = t2, this.type = 6, this._$AN = void 0, this._$AM = i3, this.options = s2; - } - get _$AU() { - return this._$AM._$AU; - } - _$AI(t2) { - z(this, t2); - } -}; -var Re = n3.litHtmlPolyfillSupport; -Re?.(B, et), (n3.litHtmlVersions ??= []).push("3.2.0"); -var Q = (t2, i3, s2) => { - const e3 = s2?.renderBefore ?? i3; - let h4 = e3._$litPart$; - if (void 0 === h4) { - const t3 = s2?.renderBefore ?? null; - e3._$litPart$ = h4 = new et(i3.insertBefore(lt(), t3), t3, void 0, s2 ?? {}); - } - return h4._$AI(t2), h4; -}; - -// node_modules/lit-element/lit-element.js -var h3 = class extends b { - constructor() { - super(...arguments), this.renderOptions = { host: this }, this.o = void 0; - } - createRenderRoot() { - const t2 = super.createRenderRoot(); - return this.renderOptions.renderBefore ??= t2.firstChild, t2; - } - update(t2) { - const e3 = this.render(); - this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t2), this.o = Q(e3, this.renderRoot, this.renderOptions); - } - connectedCallback() { - super.connectedCallback(), this.o?.setConnected(true); - } - disconnectedCallback() { - super.disconnectedCallback(), this.o?.setConnected(false); - } - render() { - return R; - } -}; -h3._$litElement$ = true, h3["finalized"] = true, globalThis.litElementHydrateSupport?.({ LitElement: h3 }); -var f3 = globalThis.litElementPolyfillSupport; -f3?.({ LitElement: h3 }); -(globalThis.litElementVersions ??= []).push("4.1.0"); - -// js/ipywidgets_styles.ts -var legacyStyles = i` +var R=globalThis,N=R.ShadowRoot&&(R.ShadyCSS===void 0||R.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,j=Symbol(),Z=new WeakMap,E=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==j)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(N&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=Z.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Z.set(e,t))}return t}toString(){return this.cssText}},X=r=>new E(typeof r=="string"?r:r+"",void 0,j),z=(r,...t)=>{let e=r.length===1?r[0]:t.reduce((s,i,o)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[o+1],r[0]);return new E(e,r,j)},L=(r,t)=>{if(N)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=R.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s)}},T=N?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return X(e)})(r):r;var{is:dt,defineProperty:ut,getOwnPropertyDescriptor:$t,getOwnPropertyNames:ft,getOwnPropertySymbols:_t,getPrototypeOf:gt}=Object,M=globalThis,G=M.trustedTypes,mt=G?G.emptyScript:"",yt=M.reactiveElementPolyfillSupport,w=(r,t)=>r,I={toAttribute(r,t){switch(t){case Boolean:r=r?mt:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},tt=(r,t)=>!dt(r,t),Y={attribute:!0,type:String,converter:I,reflect:!1,hasChanged:tt};Symbol.metadata??=Symbol("metadata"),M.litPropertyMetadata??=new WeakMap;var $=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Y){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&ut(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:o}=$t(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i?.call(this)},set(n){let d=i?.call(this);o.call(this,n),this.requestUpdate(t,d,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Y}static _$Ei(){if(this.hasOwnProperty(w("elementProperties")))return;let t=gt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(w("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(w("properties"))){let e=this.properties,s=[...ft(e),..._t(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(T(i))}else t!==void 0&&e.push(T(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return L(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let o=(s.converter?.toAttribute!==void 0?s.converter:I).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let o=s.getPropertyOptions(i),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:I;this._$Em=i,this[i]=n.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??tt)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,o]of this._$Ep)this[i]=o;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,o]of s)o.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],o)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[w("elementProperties")]=new Map,$[w("finalized")]=new Map,yt?.({ReactiveElement:$}),(M.reactiveElementVersions??=[]).push("2.0.4");var J=globalThis,k=J.trustedTypes,et=k?k.createPolicy("lit-html",{createHTML:r=>r}):void 0,ht="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,at="?"+_,At=`<${at}>`,y=document,C=()=>y.createComment(""),P=r=>r===null||typeof r!="object"&&typeof r!="function",F=Array.isArray,vt=r=>F(r)||typeof r?.[Symbol.iterator]=="function",B=`[ +\f\r]`,x=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,st=/-->/g,it=/>/g,g=RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`,"g"),rt=/'/g,ot=/"/g,lt=/^(?:script|style|textarea|title)$/i,Q=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),Ut=Q(1),Ht=Q(2),Ot=Q(3),A=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),nt=new WeakMap,m=y.createTreeWalker(y,129);function ct(r,t){if(!F(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return et!==void 0?et.createHTML(t):t}var St=(r,t)=>{let e=r.length-1,s=[],i,o=t===2?"":t===3?"":"",n=x;for(let d=0;d"?(n=i??x,a=-1):p[1]===void 0?a=-2:(a=n.lastIndex-p[2].length,l=p[1],n=p[3]===void 0?g:p[3]==='"'?ot:rt):n===ot||n===rt?n=g:n===st||n===it?n=x:(n=g,i=void 0);let f=n===g&&r[d+1].startsWith("/>")?" ":"";o+=n===x?h+At:a>=0?(s.push(l),h.slice(0,a)+ht+h.slice(a)+_+f):h+_+(a===-2?d:f)}return[ct(r,o+(r[e]||"")+(t===2?"":t===3?"":"")),s]},U=class r{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let o=0,n=0,d=t.length-1,h=this.parts,[l,p]=St(t,e);if(this.el=r.createElement(l,s),m.currentNode=this.el.content,e===2||e===3){let a=this.el.content.firstChild;a.replaceWith(...a.childNodes)}for(;(i=m.nextNode())!==null&&h.length0){i.textContent=k?k.emptyScript:"";for(let f=0;f2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=c}_$AI(t,e=this,s,i){let o=this.strings,n=!1;if(o===void 0)t=v(this,t,e,0),n=!P(t)||t!==this._$AH&&t!==A,n&&(this._$AH=t);else{let d=t,h,l;for(t=o[0],h=0;h{let s=e?.renderBefore??t,i=s._$litPart$;if(i===void 0){let o=e?.renderBefore??null;s._$litPart$=i=new H(t.insertBefore(C(),o),o,void 0,e??{})}return i._$AI(r),i};var b=class extends ${constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=pt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return A}};b._$litElement$=!0,b.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:b});var Et=globalThis.litElementPolyfillSupport;Et?.({LitElement:b});(globalThis.litElementVersions??=[]).push("4.1.0");var qt=z` .legacy-button { align-items: center; background-color: var(--jp-layout-color2); @@ -598,10 +55,7 @@ var legacyStyles = i` height: var(--jp-widgets-inline-height); line-height: var(--jp-widgets-inline-height); } -`; -export { - legacyStyles -}; +`;export{qt as legacyStyles}; /*! Bundled license information: @lit/reactive-element/css-tag.js: diff --git a/geemap/static/layer_manager.js b/geemap/static/layer_manager.js index e098a78d10..609dea6a1d 100644 --- a/geemap/static/layer_manager.js +++ b/geemap/static/layer_manager.js @@ -1,590 +1,6 @@ -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __decorateClass = (decorators, target, key, kind) => { - var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target; - for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--) - if (decorator = decorators[i3]) - result = (kind ? decorator(target, key, result) : decorator(result)) || result; - if (kind && result) __defProp(target, key, result); - return result; -}; - -// node_modules/@lit/reactive-element/css-tag.js -var t = globalThis; -var e = t.ShadowRoot && (void 0 === t.ShadyCSS || t.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype; -var s = Symbol(); -var o = /* @__PURE__ */ new WeakMap(); -var n = class { - constructor(t2, e4, o4) { - if (this._$cssResult$ = true, o4 !== s) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead."); - this.cssText = t2, this.t = e4; - } - get styleSheet() { - let t2 = this.o; - const s2 = this.t; - if (e && void 0 === t2) { - const e4 = void 0 !== s2 && 1 === s2.length; - e4 && (t2 = o.get(s2)), void 0 === t2 && ((this.o = t2 = new CSSStyleSheet()).replaceSync(this.cssText), e4 && o.set(s2, t2)); - } - return t2; - } - toString() { - return this.cssText; - } -}; -var r = (t2) => new n("string" == typeof t2 ? t2 : t2 + "", void 0, s); -var i = (t2, ...e4) => { - const o4 = 1 === t2.length ? t2[0] : e4.reduce((e5, s2, o5) => e5 + ((t3) => { - if (true === t3._$cssResult$) return t3.cssText; - if ("number" == typeof t3) return t3; - throw Error("Value passed to 'css' function must be a 'css' function result: " + t3 + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security."); - })(s2) + t2[o5 + 1], t2[0]); - return new n(o4, t2, s); -}; -var S = (s2, o4) => { - if (e) s2.adoptedStyleSheets = o4.map((t2) => t2 instanceof CSSStyleSheet ? t2 : t2.styleSheet); - else for (const e4 of o4) { - const o5 = document.createElement("style"), n5 = t.litNonce; - void 0 !== n5 && o5.setAttribute("nonce", n5), o5.textContent = e4.cssText, s2.appendChild(o5); - } -}; -var c = e ? (t2) => t2 : (t2) => t2 instanceof CSSStyleSheet ? ((t3) => { - let e4 = ""; - for (const s2 of t3.cssRules) e4 += s2.cssText; - return r(e4); -})(t2) : t2; - -// node_modules/@lit/reactive-element/reactive-element.js -var { is: i2, defineProperty: e2, getOwnPropertyDescriptor: r2, getOwnPropertyNames: h, getOwnPropertySymbols: o2, getPrototypeOf: n2 } = Object; -var a = globalThis; -var c2 = a.trustedTypes; -var l = c2 ? c2.emptyScript : ""; -var p = a.reactiveElementPolyfillSupport; -var d = (t2, s2) => t2; -var u = { toAttribute(t2, s2) { - switch (s2) { - case Boolean: - t2 = t2 ? l : null; - break; - case Object: - case Array: - t2 = null == t2 ? t2 : JSON.stringify(t2); - } - return t2; -}, fromAttribute(t2, s2) { - let i3 = t2; - switch (s2) { - case Boolean: - i3 = null !== t2; - break; - case Number: - i3 = null === t2 ? null : Number(t2); - break; - case Object: - case Array: - try { - i3 = JSON.parse(t2); - } catch (t3) { - i3 = null; - } - } - return i3; -} }; -var f = (t2, s2) => !i2(t2, s2); -var y = { attribute: true, type: String, converter: u, reflect: false, hasChanged: f }; -Symbol.metadata ??= Symbol("metadata"), a.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap(); -var b = class extends HTMLElement { - static addInitializer(t2) { - this._$Ei(), (this.l ??= []).push(t2); - } - static get observedAttributes() { - return this.finalize(), this._$Eh && [...this._$Eh.keys()]; - } - static createProperty(t2, s2 = y) { - if (s2.state && (s2.attribute = false), this._$Ei(), this.elementProperties.set(t2, s2), !s2.noAccessor) { - const i3 = Symbol(), r4 = this.getPropertyDescriptor(t2, i3, s2); - void 0 !== r4 && e2(this.prototype, t2, r4); - } - } - static getPropertyDescriptor(t2, s2, i3) { - const { get: e4, set: h4 } = r2(this.prototype, t2) ?? { get() { - return this[s2]; - }, set(t3) { - this[s2] = t3; - } }; - return { get() { - return e4?.call(this); - }, set(s3) { - const r4 = e4?.call(this); - h4.call(this, s3), this.requestUpdate(t2, r4, i3); - }, configurable: true, enumerable: true }; - } - static getPropertyOptions(t2) { - return this.elementProperties.get(t2) ?? y; - } - static _$Ei() { - if (this.hasOwnProperty(d("elementProperties"))) return; - const t2 = n2(this); - t2.finalize(), void 0 !== t2.l && (this.l = [...t2.l]), this.elementProperties = new Map(t2.elementProperties); - } - static finalize() { - if (this.hasOwnProperty(d("finalized"))) return; - if (this.finalized = true, this._$Ei(), this.hasOwnProperty(d("properties"))) { - const t3 = this.properties, s2 = [...h(t3), ...o2(t3)]; - for (const i3 of s2) this.createProperty(i3, t3[i3]); - } - const t2 = this[Symbol.metadata]; - if (null !== t2) { - const s2 = litPropertyMetadata.get(t2); - if (void 0 !== s2) for (const [t3, i3] of s2) this.elementProperties.set(t3, i3); - } - this._$Eh = /* @__PURE__ */ new Map(); - for (const [t3, s2] of this.elementProperties) { - const i3 = this._$Eu(t3, s2); - void 0 !== i3 && this._$Eh.set(i3, t3); - } - this.elementStyles = this.finalizeStyles(this.styles); - } - static finalizeStyles(s2) { - const i3 = []; - if (Array.isArray(s2)) { - const e4 = new Set(s2.flat(1 / 0).reverse()); - for (const s3 of e4) i3.unshift(c(s3)); - } else void 0 !== s2 && i3.push(c(s2)); - return i3; - } - static _$Eu(t2, s2) { - const i3 = s2.attribute; - return false === i3 ? void 0 : "string" == typeof i3 ? i3 : "string" == typeof t2 ? t2.toLowerCase() : void 0; - } - constructor() { - super(), this._$Ep = void 0, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev(); - } - _$Ev() { - this._$ES = new Promise((t2) => this.enableUpdating = t2), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((t2) => t2(this)); - } - addController(t2) { - (this._$EO ??= /* @__PURE__ */ new Set()).add(t2), void 0 !== this.renderRoot && this.isConnected && t2.hostConnected?.(); - } - removeController(t2) { - this._$EO?.delete(t2); - } - _$E_() { - const t2 = /* @__PURE__ */ new Map(), s2 = this.constructor.elementProperties; - for (const i3 of s2.keys()) this.hasOwnProperty(i3) && (t2.set(i3, this[i3]), delete this[i3]); - t2.size > 0 && (this._$Ep = t2); - } - createRenderRoot() { - const t2 = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions); - return S(t2, this.constructor.elementStyles), t2; - } - connectedCallback() { - this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach((t2) => t2.hostConnected?.()); - } - enableUpdating(t2) { - } - disconnectedCallback() { - this._$EO?.forEach((t2) => t2.hostDisconnected?.()); - } - attributeChangedCallback(t2, s2, i3) { - this._$AK(t2, i3); - } - _$EC(t2, s2) { - const i3 = this.constructor.elementProperties.get(t2), e4 = this.constructor._$Eu(t2, i3); - if (void 0 !== e4 && true === i3.reflect) { - const r4 = (void 0 !== i3.converter?.toAttribute ? i3.converter : u).toAttribute(s2, i3.type); - this._$Em = t2, null == r4 ? this.removeAttribute(e4) : this.setAttribute(e4, r4), this._$Em = null; - } - } - _$AK(t2, s2) { - const i3 = this.constructor, e4 = i3._$Eh.get(t2); - if (void 0 !== e4 && this._$Em !== e4) { - const t3 = i3.getPropertyOptions(e4), r4 = "function" == typeof t3.converter ? { fromAttribute: t3.converter } : void 0 !== t3.converter?.fromAttribute ? t3.converter : u; - this._$Em = e4, this[e4] = r4.fromAttribute(s2, t3.type), this._$Em = null; - } - } - requestUpdate(t2, s2, i3) { - if (void 0 !== t2) { - if (i3 ??= this.constructor.getPropertyOptions(t2), !(i3.hasChanged ?? f)(this[t2], s2)) return; - this.P(t2, s2, i3); - } - false === this.isUpdatePending && (this._$ES = this._$ET()); - } - P(t2, s2, i3) { - this._$AL.has(t2) || this._$AL.set(t2, s2), true === i3.reflect && this._$Em !== t2 && (this._$Ej ??= /* @__PURE__ */ new Set()).add(t2); - } - async _$ET() { - this.isUpdatePending = true; - try { - await this._$ES; - } catch (t3) { - Promise.reject(t3); - } - const t2 = this.scheduleUpdate(); - return null != t2 && await t2, !this.isUpdatePending; - } - scheduleUpdate() { - return this.performUpdate(); - } - performUpdate() { - if (!this.isUpdatePending) return; - if (!this.hasUpdated) { - if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) { - for (const [t4, s3] of this._$Ep) this[t4] = s3; - this._$Ep = void 0; - } - const t3 = this.constructor.elementProperties; - if (t3.size > 0) for (const [s3, i3] of t3) true !== i3.wrapped || this._$AL.has(s3) || void 0 === this[s3] || this.P(s3, this[s3], i3); - } - let t2 = false; - const s2 = this._$AL; - try { - t2 = this.shouldUpdate(s2), t2 ? (this.willUpdate(s2), this._$EO?.forEach((t3) => t3.hostUpdate?.()), this.update(s2)) : this._$EU(); - } catch (s3) { - throw t2 = false, this._$EU(), s3; - } - t2 && this._$AE(s2); - } - willUpdate(t2) { - } - _$AE(t2) { - this._$EO?.forEach((t3) => t3.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t2)), this.updated(t2); - } - _$EU() { - this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = false; - } - get updateComplete() { - return this.getUpdateComplete(); - } - getUpdateComplete() { - return this._$ES; - } - shouldUpdate(t2) { - return true; - } - update(t2) { - this._$Ej &&= this._$Ej.forEach((t3) => this._$EC(t3, this[t3])), this._$EU(); - } - updated(t2) { - } - firstUpdated(t2) { - } -}; -b.elementStyles = [], b.shadowRootOptions = { mode: "open" }, b[d("elementProperties")] = /* @__PURE__ */ new Map(), b[d("finalized")] = /* @__PURE__ */ new Map(), p?.({ ReactiveElement: b }), (a.reactiveElementVersions ??= []).push("2.0.4"); - -// node_modules/lit-html/lit-html.js -var n3 = globalThis; -var c3 = n3.trustedTypes; -var h2 = c3 ? c3.createPolicy("lit-html", { createHTML: (t2) => t2 }) : void 0; -var f2 = "$lit$"; -var v = `lit$${Math.random().toFixed(9).slice(2)}$`; -var m = "?" + v; -var _ = `<${m}>`; -var w = document; -var lt = () => w.createComment(""); -var st = (t2) => null === t2 || "object" != typeof t2 && "function" != typeof t2; -var g = Array.isArray; -var $ = (t2) => g(t2) || "function" == typeof t2?.[Symbol.iterator]; -var x = "[ \n\f\r]"; -var T = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g; -var E = /-->/g; -var k = />/g; -var O = RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ -\f\r"'\`<>=]|("|')|))|$)`, "g"); -var S2 = /'/g; -var j = /"/g; -var M = /^(?:script|style|textarea|title)$/i; -var P = (t2) => (i3, ...s2) => ({ _$litType$: t2, strings: i3, values: s2 }); -var ke = P(1); -var Oe = P(2); -var Se = P(3); -var R = Symbol.for("lit-noChange"); -var D = Symbol.for("lit-nothing"); -var V = /* @__PURE__ */ new WeakMap(); -var I = w.createTreeWalker(w, 129); -function N(t2, i3) { - if (!g(t2) || !t2.hasOwnProperty("raw")) throw Error("invalid template strings array"); - return void 0 !== h2 ? h2.createHTML(i3) : i3; -} -var U = (t2, i3) => { - const s2 = t2.length - 1, e4 = []; - let h4, o4 = 2 === i3 ? "" : 3 === i3 ? "" : "", n5 = T; - for (let i4 = 0; i4 < s2; i4++) { - const s3 = t2[i4]; - let r4, l2, c4 = -1, a2 = 0; - for (; a2 < s3.length && (n5.lastIndex = a2, l2 = n5.exec(s3), null !== l2); ) a2 = n5.lastIndex, n5 === T ? "!--" === l2[1] ? n5 = E : void 0 !== l2[1] ? n5 = k : void 0 !== l2[2] ? (M.test(l2[2]) && (h4 = RegExp("" === l2[0] ? (n5 = h4 ?? T, c4 = -1) : void 0 === l2[1] ? c4 = -2 : (c4 = n5.lastIndex - l2[2].length, r4 = l2[1], n5 = void 0 === l2[3] ? O : '"' === l2[3] ? j : S2) : n5 === j || n5 === S2 ? n5 = O : n5 === E || n5 === k ? n5 = T : (n5 = O, h4 = void 0); - const u2 = n5 === O && t2[i4 + 1].startsWith("/>") ? " " : ""; - o4 += n5 === T ? s3 + _ : c4 >= 0 ? (e4.push(r4), s3.slice(0, c4) + f2 + s3.slice(c4) + v + u2) : s3 + v + (-2 === c4 ? i4 : u2); - } - return [N(t2, o4 + (t2[s2] || "") + (2 === i3 ? "" : 3 === i3 ? "" : "")), e4]; -}; -var B = class _B { - constructor({ strings: t2, _$litType$: i3 }, s2) { - let e4; - this.parts = []; - let h4 = 0, o4 = 0; - const n5 = t2.length - 1, r4 = this.parts, [l2, a2] = U(t2, i3); - if (this.el = _B.createElement(l2, s2), I.currentNode = this.el.content, 2 === i3 || 3 === i3) { - const t3 = this.el.content.firstChild; - t3.replaceWith(...t3.childNodes); - } - for (; null !== (e4 = I.nextNode()) && r4.length < n5; ) { - if (1 === e4.nodeType) { - if (e4.hasAttributes()) for (const t3 of e4.getAttributeNames()) if (t3.endsWith(f2)) { - const i4 = a2[o4++], s3 = e4.getAttribute(t3).split(v), n6 = /([.?@])?(.*)/.exec(i4); - r4.push({ type: 1, index: h4, name: n6[2], strings: s3, ctor: "." === n6[1] ? Y : "?" === n6[1] ? Z : "@" === n6[1] ? q : G }), e4.removeAttribute(t3); - } else t3.startsWith(v) && (r4.push({ type: 6, index: h4 }), e4.removeAttribute(t3)); - if (M.test(e4.tagName)) { - const t3 = e4.textContent.split(v), i4 = t3.length - 1; - if (i4 > 0) { - e4.textContent = c3 ? c3.emptyScript : ""; - for (let s3 = 0; s3 < i4; s3++) e4.append(t3[s3], lt()), I.nextNode(), r4.push({ type: 2, index: ++h4 }); - e4.append(t3[i4], lt()); - } - } - } else if (8 === e4.nodeType) if (e4.data === m) r4.push({ type: 2, index: h4 }); - else { - let t3 = -1; - for (; -1 !== (t3 = e4.data.indexOf(v, t3 + 1)); ) r4.push({ type: 7, index: h4 }), t3 += v.length - 1; - } - h4++; - } - } - static createElement(t2, i3) { - const s2 = w.createElement("template"); - return s2.innerHTML = t2, s2; - } -}; -function z(t2, i3, s2 = t2, e4) { - if (i3 === R) return i3; - let h4 = void 0 !== e4 ? s2.o?.[e4] : s2.l; - const o4 = st(i3) ? void 0 : i3._$litDirective$; - return h4?.constructor !== o4 && (h4?._$AO?.(false), void 0 === o4 ? h4 = void 0 : (h4 = new o4(t2), h4._$AT(t2, s2, e4)), void 0 !== e4 ? (s2.o ??= [])[e4] = h4 : s2.l = h4), void 0 !== h4 && (i3 = z(t2, h4._$AS(t2, i3.values), h4, e4)), i3; -} -var F = class { - constructor(t2, i3) { - this._$AV = [], this._$AN = void 0, this._$AD = t2, this._$AM = i3; - } - get parentNode() { - return this._$AM.parentNode; - } - get _$AU() { - return this._$AM._$AU; - } - u(t2) { - const { el: { content: i3 }, parts: s2 } = this._$AD, e4 = (t2?.creationScope ?? w).importNode(i3, true); - I.currentNode = e4; - let h4 = I.nextNode(), o4 = 0, n5 = 0, r4 = s2[0]; - for (; void 0 !== r4; ) { - if (o4 === r4.index) { - let i4; - 2 === r4.type ? i4 = new et(h4, h4.nextSibling, this, t2) : 1 === r4.type ? i4 = new r4.ctor(h4, r4.name, r4.strings, this, t2) : 6 === r4.type && (i4 = new K(h4, this, t2)), this._$AV.push(i4), r4 = s2[++n5]; - } - o4 !== r4?.index && (h4 = I.nextNode(), o4++); - } - return I.currentNode = w, e4; - } - p(t2) { - let i3 = 0; - for (const s2 of this._$AV) void 0 !== s2 && (void 0 !== s2.strings ? (s2._$AI(t2, s2, i3), i3 += s2.strings.length - 2) : s2._$AI(t2[i3])), i3++; - } -}; -var et = class _et { - get _$AU() { - return this._$AM?._$AU ?? this.v; - } - constructor(t2, i3, s2, e4) { - this.type = 2, this._$AH = D, this._$AN = void 0, this._$AA = t2, this._$AB = i3, this._$AM = s2, this.options = e4, this.v = e4?.isConnected ?? true; - } - get parentNode() { - let t2 = this._$AA.parentNode; - const i3 = this._$AM; - return void 0 !== i3 && 11 === t2?.nodeType && (t2 = i3.parentNode), t2; - } - get startNode() { - return this._$AA; - } - get endNode() { - return this._$AB; - } - _$AI(t2, i3 = this) { - t2 = z(this, t2, i3), st(t2) ? t2 === D || null == t2 || "" === t2 ? (this._$AH !== D && this._$AR(), this._$AH = D) : t2 !== this._$AH && t2 !== R && this._(t2) : void 0 !== t2._$litType$ ? this.$(t2) : void 0 !== t2.nodeType ? this.T(t2) : $(t2) ? this.k(t2) : this._(t2); - } - O(t2) { - return this._$AA.parentNode.insertBefore(t2, this._$AB); - } - T(t2) { - this._$AH !== t2 && (this._$AR(), this._$AH = this.O(t2)); - } - _(t2) { - this._$AH !== D && st(this._$AH) ? this._$AA.nextSibling.data = t2 : this.T(w.createTextNode(t2)), this._$AH = t2; - } - $(t2) { - const { values: i3, _$litType$: s2 } = t2, e4 = "number" == typeof s2 ? this._$AC(t2) : (void 0 === s2.el && (s2.el = B.createElement(N(s2.h, s2.h[0]), this.options)), s2); - if (this._$AH?._$AD === e4) this._$AH.p(i3); - else { - const t3 = new F(e4, this), s3 = t3.u(this.options); - t3.p(i3), this.T(s3), this._$AH = t3; - } - } - _$AC(t2) { - let i3 = V.get(t2.strings); - return void 0 === i3 && V.set(t2.strings, i3 = new B(t2)), i3; - } - k(t2) { - g(this._$AH) || (this._$AH = [], this._$AR()); - const i3 = this._$AH; - let s2, e4 = 0; - for (const h4 of t2) e4 === i3.length ? i3.push(s2 = new _et(this.O(lt()), this.O(lt()), this, this.options)) : s2 = i3[e4], s2._$AI(h4), e4++; - e4 < i3.length && (this._$AR(s2 && s2._$AB.nextSibling, e4), i3.length = e4); - } - _$AR(t2 = this._$AA.nextSibling, i3) { - for (this._$AP?.(false, true, i3); t2 && t2 !== this._$AB; ) { - const i4 = t2.nextSibling; - t2.remove(), t2 = i4; - } - } - setConnected(t2) { - void 0 === this._$AM && (this.v = t2, this._$AP?.(t2)); - } -}; -var G = class { - get tagName() { - return this.element.tagName; - } - get _$AU() { - return this._$AM._$AU; - } - constructor(t2, i3, s2, e4, h4) { - this.type = 1, this._$AH = D, this._$AN = void 0, this.element = t2, this.name = i3, this._$AM = e4, this.options = h4, s2.length > 2 || "" !== s2[0] || "" !== s2[1] ? (this._$AH = Array(s2.length - 1).fill(new String()), this.strings = s2) : this._$AH = D; - } - _$AI(t2, i3 = this, s2, e4) { - const h4 = this.strings; - let o4 = false; - if (void 0 === h4) t2 = z(this, t2, i3, 0), o4 = !st(t2) || t2 !== this._$AH && t2 !== R, o4 && (this._$AH = t2); - else { - const e5 = t2; - let n5, r4; - for (t2 = h4[0], n5 = 0; n5 < h4.length - 1; n5++) r4 = z(this, e5[s2 + n5], i3, n5), r4 === R && (r4 = this._$AH[n5]), o4 ||= !st(r4) || r4 !== this._$AH[n5], r4 === D ? t2 = D : t2 !== D && (t2 += (r4 ?? "") + h4[n5 + 1]), this._$AH[n5] = r4; - } - o4 && !e4 && this.j(t2); - } - j(t2) { - t2 === D ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t2 ?? ""); - } -}; -var Y = class extends G { - constructor() { - super(...arguments), this.type = 3; - } - j(t2) { - this.element[this.name] = t2 === D ? void 0 : t2; - } -}; -var Z = class extends G { - constructor() { - super(...arguments), this.type = 4; - } - j(t2) { - this.element.toggleAttribute(this.name, !!t2 && t2 !== D); - } -}; -var q = class extends G { - constructor(t2, i3, s2, e4, h4) { - super(t2, i3, s2, e4, h4), this.type = 5; - } - _$AI(t2, i3 = this) { - if ((t2 = z(this, t2, i3, 0) ?? D) === R) return; - const s2 = this._$AH, e4 = t2 === D && s2 !== D || t2.capture !== s2.capture || t2.once !== s2.once || t2.passive !== s2.passive, h4 = t2 !== D && (s2 === D || e4); - e4 && this.element.removeEventListener(this.name, this, s2), h4 && this.element.addEventListener(this.name, this, t2), this._$AH = t2; - } - handleEvent(t2) { - "function" == typeof this._$AH ? this._$AH.call(this.options?.host ?? this.element, t2) : this._$AH.handleEvent(t2); - } -}; -var K = class { - constructor(t2, i3, s2) { - this.element = t2, this.type = 6, this._$AN = void 0, this._$AM = i3, this.options = s2; - } - get _$AU() { - return this._$AM._$AU; - } - _$AI(t2) { - z(this, t2); - } -}; -var Re = n3.litHtmlPolyfillSupport; -Re?.(B, et), (n3.litHtmlVersions ??= []).push("3.2.0"); -var Q = (t2, i3, s2) => { - const e4 = s2?.renderBefore ?? i3; - let h4 = e4._$litPart$; - if (void 0 === h4) { - const t3 = s2?.renderBefore ?? null; - e4._$litPart$ = h4 = new et(i3.insertBefore(lt(), t3), t3, void 0, s2 ?? {}); - } - return h4._$AI(t2), h4; -}; - -// node_modules/lit-element/lit-element.js -var h3 = class extends b { - constructor() { - super(...arguments), this.renderOptions = { host: this }, this.o = void 0; - } - createRenderRoot() { - const t2 = super.createRenderRoot(); - return this.renderOptions.renderBefore ??= t2.firstChild, t2; - } - update(t2) { - const e4 = this.render(); - this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t2), this.o = Q(e4, this.renderRoot, this.renderOptions); - } - connectedCallback() { - super.connectedCallback(), this.o?.setConnected(true); - } - disconnectedCallback() { - super.disconnectedCallback(), this.o?.setConnected(false); - } - render() { - return R; - } -}; -h3._$litElement$ = true, h3["finalized"] = true, globalThis.litElementHydrateSupport?.({ LitElement: h3 }); -var f3 = globalThis.litElementPolyfillSupport; -f3?.({ LitElement: h3 }); -(globalThis.litElementVersions ??= []).push("4.1.0"); - -// node_modules/@lit/reactive-element/decorators/property.js -var o3 = { attribute: true, type: String, converter: u, reflect: false, hasChanged: f }; -var r3 = (t2 = o3, e4, r4) => { - const { kind: n5, metadata: i3 } = r4; - let s2 = globalThis.litPropertyMetadata.get(i3); - if (void 0 === s2 && globalThis.litPropertyMetadata.set(i3, s2 = /* @__PURE__ */ new Map()), s2.set(r4.name, t2), "accessor" === n5) { - const { name: o4 } = r4; - return { set(r5) { - const n6 = e4.get.call(this); - e4.set.call(this, r5), this.requestUpdate(o4, n6, t2); - }, init(e5) { - return void 0 !== e5 && this.P(o4, void 0, t2), e5; - } }; - } - if ("setter" === n5) { - const { name: o4 } = r4; - return function(r5) { - const n6 = this[o4]; - e4.call(this, r5), this.requestUpdate(o4, n6, t2); - }; - } - throw Error("Unsupported decorator location: " + n5); -}; -function n4(t2) { - return (e4, o4) => "object" == typeof o4 ? r3(t2, e4, o4) : ((t3, e5, o5) => { - const r4 = e5.hasOwnProperty(o5); - return e5.constructor.createProperty(o5, r4 ? { ...t3, wrapped: true } : t3), r4 ? Object.getOwnPropertyDescriptor(e5, o5) : void 0; - })(t2, e4, o4); -} - -// js/ipywidgets_styles.ts -var legacyStyles = i` +var vt=Object.defineProperty;var bt=Object.getOwnPropertyDescriptor;var st=(r,t,e,s)=>{for(var i=s>1?void 0:s?bt(t,e):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(i=(s?n(t,e,i):n(i))||i);return s&&i&&vt(t,e,i),i};var T=globalThis,k=T.ShadowRoot&&(T.ShadyCSS===void 0||T.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,V=Symbol(),it=new WeakMap,E=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==V)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(k&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=it.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&it.set(e,t))}return t}toString(){return this.cssText}},rt=r=>new E(typeof r=="string"?r:r+"",void 0,V),w=(r,...t)=>{let e=r.length===1?r[0]:t.reduce((s,i,o)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[o+1],r[0]);return new E(e,r,V)},B=(r,t)=>{if(k)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=T.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s)}},L=k?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return rt(e)})(r):r;var{is:St,defineProperty:xt,getOwnPropertyDescriptor:Et,getOwnPropertyNames:wt,getOwnPropertySymbols:Ct,getPrototypeOf:Pt}=Object,j=globalThis,ot=j.trustedTypes,Mt=ot?ot.emptyScript:"",Ut=j.reactiveElementPolyfillSupport,C=(r,t)=>r,P={toAttribute(r,t){switch(t){case Boolean:r=r?Mt:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},z=(r,t)=>!St(r,t),nt={attribute:!0,type:String,converter:P,reflect:!1,hasChanged:z};Symbol.metadata??=Symbol("metadata"),j.litPropertyMetadata??=new WeakMap;var m=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=nt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&xt(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:o}=Et(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i?.call(this)},set(n){let h=i?.call(this);o.call(this,n),this.requestUpdate(t,h,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??nt}static _$Ei(){if(this.hasOwnProperty(C("elementProperties")))return;let t=Pt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(C("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(C("properties"))){let e=this.properties,s=[...wt(e),...Ct(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(L(i))}else t!==void 0&&e.push(L(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return B(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let o=(s.converter?.toAttribute!==void 0?s.converter:P).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let o=s.getPropertyOptions(i),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:P;this._$Em=i,this[i]=n.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??z)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,o]of this._$Ep)this[i]=o;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,o]of s)o.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],o)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};m.elementStyles=[],m.shadowRootOptions={mode:"open"},m[C("elementProperties")]=new Map,m[C("finalized")]=new Map,Ut?.({ReactiveElement:m}),(j.reactiveElementVersions??=[]).push("2.0.4");var X=globalThis,I=X.trustedTypes,at=I?I.createPolicy("lit-html",{createHTML:r=>r}):void 0,ut="$lit$",g=`lit$${Math.random().toFixed(9).slice(2)}$`,mt="?"+g,Nt=`<${mt}>`,A=document,U=()=>A.createComment(""),N=r=>r===null||typeof r!="object"&&typeof r!="function",Y=Array.isArray,Ot=r=>Y(r)||typeof r?.[Symbol.iterator]=="function",W=`[ +\f\r]`,M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,lt=/-->/g,ht=/>/g,$=RegExp(`>|${W}(?:([^\\s"'>=/]+)(${W}*=${W}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`,"g"),ct=/'/g,dt=/"/g,ft=/^(?:script|style|textarea|title)$/i,G=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),gt=G(1),Wt=G(2),Kt=G(3),v=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),pt=new WeakMap,_=A.createTreeWalker(A,129);function yt(r,t){if(!Y(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return at!==void 0?at.createHTML(t):t}var Rt=(r,t)=>{let e=r.length-1,s=[],i,o=t===2?"":t===3?"":"",n=M;for(let h=0;h"?(n=i??M,l=-1):p[1]===void 0?l=-2:(l=n.lastIndex-p[2].length,c=p[1],n=p[3]===void 0?$:p[3]==='"'?dt:ct):n===dt||n===ct?n=$:n===lt||n===ht?n=M:(n=$,i=void 0);let f=n===$&&r[h+1].startsWith("/>")?" ":"";o+=n===M?a+Nt:l>=0?(s.push(c),a.slice(0,l)+ut+a.slice(l)+g+f):a+g+(l===-2?h:f)}return[yt(r,o+(r[e]||"")+(t===2?"":t===3?"":"")),s]},O=class r{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let o=0,n=0,h=t.length-1,a=this.parts,[c,p]=Rt(t,e);if(this.el=r.createElement(c,s),_.currentNode=this.el.content,e===2||e===3){let l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(i=_.nextNode())!==null&&a.length0){i.textContent=I?I.emptyScript:"";for(let f=0;f2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=d}_$AI(t,e=this,s,i){let o=this.strings,n=!1;if(o===void 0)t=b(this,t,e,0),n=!N(t)||t!==this._$AH&&t!==v,n&&(this._$AH=t);else{let h=t,a,c;for(t=o[0],a=0;a{let s=e?.renderBefore??t,i=s._$litPart$;if(i===void 0){let o=e?.renderBefore??null;s._$litPart$=i=new R(t.insertBefore(U(),o),o,void 0,e??{})}return i._$AI(r),i};var y=class extends m{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=$t(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return v}};y._$litElement$=!0,y.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:y});var Tt=globalThis.litElementPolyfillSupport;Tt?.({LitElement:y});(globalThis.litElementVersions??=[]).push("4.1.0");var kt={attribute:!0,type:String,converter:P,reflect:!1,hasChanged:z},Lt=(r=kt,t,e)=>{let{kind:s,metadata:i}=e,o=globalThis.litPropertyMetadata.get(i);if(o===void 0&&globalThis.litPropertyMetadata.set(i,o=new Map),o.set(e.name,r),s==="accessor"){let{name:n}=e;return{set(h){let a=t.get.call(this);t.set.call(this,h),this.requestUpdate(n,a,r)},init(h){return h!==void 0&&this.P(n,void 0,r),h}}}if(s==="setter"){let{name:n}=e;return function(h){let a=this[n];t.call(this,h),this.requestUpdate(n,a,r)}}throw Error("Unsupported decorator location: "+s)};function tt(r){return(t,e)=>typeof e=="object"?Lt(r,t,e):((s,i,o)=>{let n=i.hasOwnProperty(o);return i.constructor.createProperty(o,n?{...s,wrapped:!0}:s),n?Object.getOwnPropertyDescriptor(i,o):void 0})(r,t,e)}var _t=w` .legacy-button { align-items: center; background-color: var(--jp-layout-color2); @@ -639,48 +55,7 @@ var legacyStyles = i` height: var(--jp-widgets-inline-height); line-height: var(--jp-widgets-inline-height); } -`; - -// js/utils.ts -async function unpackModels(modelIds, manager) { - return Promise.all( - modelIds.map((id) => manager.get_model(id.slice("IPY_MODEL_".length))) - ); -} -function loadFonts() { - if (!document.querySelector(".custom-fonts")) { - const styleElement = document.createElement("style"); - styleElement.classList.add("custom-fonts"); - styleElement.textContent = '@import "https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined";'; - document.body.appendChild(styleElement); - } -} -async function updateChildren(container, model) { - const children = model.get("children"); - const child_models = await unpackModels(children, model.widget_manager); - const child_views = await Promise.all( - child_models.map((model2) => model2.widget_manager.create_view(model2)) - ); - container.innerHTML = ``; - for (const child_view of child_views) { - container.appendChild(child_view.el); - } -} - -// js/layer_manager.ts -var _LayerManager = class _LayerManager extends h3 { - constructor() { - super(...arguments); - this._model = void 0; - this.visible = false; - } - static get componentName() { - return `layer-manager`; - } - static { - this.styles = [ - legacyStyles, - i` +`;async function jt(r,t){return Promise.all(r.map(e=>t.get_model(e.slice(10))))}function At(){if(!document.querySelector(".custom-fonts")){let r=document.createElement("style");r.classList.add("custom-fonts"),r.textContent='@import "https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined";',document.body.appendChild(r)}}async function et(r,t){let e=t.get("children"),s=await jt(e,t.widget_manager),i=await Promise.all(s.map(o=>o.widget_manager.create_view(o)));r.innerHTML="";for(let o of i)r.appendChild(o.el)}var D=class D extends y{constructor(){super(...arguments);this._model=void 0;this.visible=!1}static get componentName(){return"layer-manager"}static{this.styles=[_t,w` .container { padding: 0 4px 2px 4px; } @@ -695,28 +70,7 @@ var _LayerManager = class _LayerManager extends h3 { .visibility-checkbox { margin: 2px; } - ` - ]; - } - static { - this.modelNameToViewName = /* @__PURE__ */ new Map([ - ["children", null], - ["visible", "visible"] - ]); - } - set model(model) { - this._model = model; - for (const [modelKey, widgetKey] of _LayerManager.modelNameToViewName) { - if (widgetKey) { - this[widgetKey] = model.get(modelKey); - model.on(`change:${modelKey}`, () => { - this[widgetKey] = model.get(modelKey); - }); - } - } - } - render() { - return ke` + `]}static{this.modelNameToViewName=new Map([["children",null],["visible","visible"]])}set model(e){this._model=e;for(let[s,i]of D.modelNameToViewName)i&&(this[i]=e.get(s),e.on(`change:${s}`,()=>{this[i]=e.get(s)}))}render(){return gt`
- `; - } - updated(changedProperties) { - for (const [property, _2] of changedProperties) { - this._model?.set(property, this[property]); - } - this._model?.save_changes(); - } - onLayerVisibilityChanged(event) { - const target = event.target; - this.visible = target.checked; - } -}; -__decorateClass([ - n4() -], _LayerManager.prototype, "visible", 2); -var LayerManager = _LayerManager; -if (!customElements.get(LayerManager.componentName)) { - customElements.define(LayerManager.componentName, LayerManager); -} -async function render({ model, el }) { - loadFonts(); - const manager = document.createElement(LayerManager.componentName); - manager.model = model; - el.appendChild(manager); - updateChildren(manager, model); - model.on("change:children", () => { - updateChildren(manager, model); - }); -} -var layer_manager_default = { render }; -export { - LayerManager, - layer_manager_default as default -}; + `}updated(e){for(let[s,i]of e)this._model?.set(s,this[s]);this._model?.save_changes()}onLayerVisibilityChanged(e){let s=e.target;this.visible=s.checked}};st([tt()],D.prototype,"visible",2);var x=D;customElements.get(x.componentName)||customElements.define(x.componentName,x);async function zt({model:r,el:t}){At();let e=document.createElement(x.componentName);e.model=r,t.appendChild(e),et(e,r),r.on("change:children",()=>{et(e,r)})}var ze={render:zt};export{x as LayerManager,ze as default}; /*! Bundled license information: @lit/reactive-element/css-tag.js: diff --git a/geemap/static/layer_manager_row.js b/geemap/static/layer_manager_row.js index 3cc458fa32..c9ed18ab60 100644 --- a/geemap/static/layer_manager_row.js +++ b/geemap/static/layer_manager_row.js @@ -1,590 +1,6 @@ -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __decorateClass = (decorators, target, key, kind) => { - var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target; - for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--) - if (decorator = decorators[i3]) - result = (kind ? decorator(target, key, result) : decorator(result)) || result; - if (kind && result) __defProp(target, key, result); - return result; -}; - -// node_modules/@lit/reactive-element/css-tag.js -var t = globalThis; -var e = t.ShadowRoot && (void 0 === t.ShadyCSS || t.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype; -var s = Symbol(); -var o = /* @__PURE__ */ new WeakMap(); -var n = class { - constructor(t2, e4, o4) { - if (this._$cssResult$ = true, o4 !== s) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead."); - this.cssText = t2, this.t = e4; - } - get styleSheet() { - let t2 = this.o; - const s2 = this.t; - if (e && void 0 === t2) { - const e4 = void 0 !== s2 && 1 === s2.length; - e4 && (t2 = o.get(s2)), void 0 === t2 && ((this.o = t2 = new CSSStyleSheet()).replaceSync(this.cssText), e4 && o.set(s2, t2)); - } - return t2; - } - toString() { - return this.cssText; - } -}; -var r = (t2) => new n("string" == typeof t2 ? t2 : t2 + "", void 0, s); -var i = (t2, ...e4) => { - const o4 = 1 === t2.length ? t2[0] : e4.reduce((e5, s2, o5) => e5 + ((t3) => { - if (true === t3._$cssResult$) return t3.cssText; - if ("number" == typeof t3) return t3; - throw Error("Value passed to 'css' function must be a 'css' function result: " + t3 + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security."); - })(s2) + t2[o5 + 1], t2[0]); - return new n(o4, t2, s); -}; -var S = (s2, o4) => { - if (e) s2.adoptedStyleSheets = o4.map((t2) => t2 instanceof CSSStyleSheet ? t2 : t2.styleSheet); - else for (const e4 of o4) { - const o5 = document.createElement("style"), n5 = t.litNonce; - void 0 !== n5 && o5.setAttribute("nonce", n5), o5.textContent = e4.cssText, s2.appendChild(o5); - } -}; -var c = e ? (t2) => t2 : (t2) => t2 instanceof CSSStyleSheet ? ((t3) => { - let e4 = ""; - for (const s2 of t3.cssRules) e4 += s2.cssText; - return r(e4); -})(t2) : t2; - -// node_modules/@lit/reactive-element/reactive-element.js -var { is: i2, defineProperty: e2, getOwnPropertyDescriptor: r2, getOwnPropertyNames: h, getOwnPropertySymbols: o2, getPrototypeOf: n2 } = Object; -var a = globalThis; -var c2 = a.trustedTypes; -var l = c2 ? c2.emptyScript : ""; -var p = a.reactiveElementPolyfillSupport; -var d = (t2, s2) => t2; -var u = { toAttribute(t2, s2) { - switch (s2) { - case Boolean: - t2 = t2 ? l : null; - break; - case Object: - case Array: - t2 = null == t2 ? t2 : JSON.stringify(t2); - } - return t2; -}, fromAttribute(t2, s2) { - let i3 = t2; - switch (s2) { - case Boolean: - i3 = null !== t2; - break; - case Number: - i3 = null === t2 ? null : Number(t2); - break; - case Object: - case Array: - try { - i3 = JSON.parse(t2); - } catch (t3) { - i3 = null; - } - } - return i3; -} }; -var f = (t2, s2) => !i2(t2, s2); -var y = { attribute: true, type: String, converter: u, reflect: false, hasChanged: f }; -Symbol.metadata ??= Symbol("metadata"), a.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap(); -var b = class extends HTMLElement { - static addInitializer(t2) { - this._$Ei(), (this.l ??= []).push(t2); - } - static get observedAttributes() { - return this.finalize(), this._$Eh && [...this._$Eh.keys()]; - } - static createProperty(t2, s2 = y) { - if (s2.state && (s2.attribute = false), this._$Ei(), this.elementProperties.set(t2, s2), !s2.noAccessor) { - const i3 = Symbol(), r4 = this.getPropertyDescriptor(t2, i3, s2); - void 0 !== r4 && e2(this.prototype, t2, r4); - } - } - static getPropertyDescriptor(t2, s2, i3) { - const { get: e4, set: h4 } = r2(this.prototype, t2) ?? { get() { - return this[s2]; - }, set(t3) { - this[s2] = t3; - } }; - return { get() { - return e4?.call(this); - }, set(s3) { - const r4 = e4?.call(this); - h4.call(this, s3), this.requestUpdate(t2, r4, i3); - }, configurable: true, enumerable: true }; - } - static getPropertyOptions(t2) { - return this.elementProperties.get(t2) ?? y; - } - static _$Ei() { - if (this.hasOwnProperty(d("elementProperties"))) return; - const t2 = n2(this); - t2.finalize(), void 0 !== t2.l && (this.l = [...t2.l]), this.elementProperties = new Map(t2.elementProperties); - } - static finalize() { - if (this.hasOwnProperty(d("finalized"))) return; - if (this.finalized = true, this._$Ei(), this.hasOwnProperty(d("properties"))) { - const t3 = this.properties, s2 = [...h(t3), ...o2(t3)]; - for (const i3 of s2) this.createProperty(i3, t3[i3]); - } - const t2 = this[Symbol.metadata]; - if (null !== t2) { - const s2 = litPropertyMetadata.get(t2); - if (void 0 !== s2) for (const [t3, i3] of s2) this.elementProperties.set(t3, i3); - } - this._$Eh = /* @__PURE__ */ new Map(); - for (const [t3, s2] of this.elementProperties) { - const i3 = this._$Eu(t3, s2); - void 0 !== i3 && this._$Eh.set(i3, t3); - } - this.elementStyles = this.finalizeStyles(this.styles); - } - static finalizeStyles(s2) { - const i3 = []; - if (Array.isArray(s2)) { - const e4 = new Set(s2.flat(1 / 0).reverse()); - for (const s3 of e4) i3.unshift(c(s3)); - } else void 0 !== s2 && i3.push(c(s2)); - return i3; - } - static _$Eu(t2, s2) { - const i3 = s2.attribute; - return false === i3 ? void 0 : "string" == typeof i3 ? i3 : "string" == typeof t2 ? t2.toLowerCase() : void 0; - } - constructor() { - super(), this._$Ep = void 0, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev(); - } - _$Ev() { - this._$ES = new Promise((t2) => this.enableUpdating = t2), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((t2) => t2(this)); - } - addController(t2) { - (this._$EO ??= /* @__PURE__ */ new Set()).add(t2), void 0 !== this.renderRoot && this.isConnected && t2.hostConnected?.(); - } - removeController(t2) { - this._$EO?.delete(t2); - } - _$E_() { - const t2 = /* @__PURE__ */ new Map(), s2 = this.constructor.elementProperties; - for (const i3 of s2.keys()) this.hasOwnProperty(i3) && (t2.set(i3, this[i3]), delete this[i3]); - t2.size > 0 && (this._$Ep = t2); - } - createRenderRoot() { - const t2 = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions); - return S(t2, this.constructor.elementStyles), t2; - } - connectedCallback() { - this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach((t2) => t2.hostConnected?.()); - } - enableUpdating(t2) { - } - disconnectedCallback() { - this._$EO?.forEach((t2) => t2.hostDisconnected?.()); - } - attributeChangedCallback(t2, s2, i3) { - this._$AK(t2, i3); - } - _$EC(t2, s2) { - const i3 = this.constructor.elementProperties.get(t2), e4 = this.constructor._$Eu(t2, i3); - if (void 0 !== e4 && true === i3.reflect) { - const r4 = (void 0 !== i3.converter?.toAttribute ? i3.converter : u).toAttribute(s2, i3.type); - this._$Em = t2, null == r4 ? this.removeAttribute(e4) : this.setAttribute(e4, r4), this._$Em = null; - } - } - _$AK(t2, s2) { - const i3 = this.constructor, e4 = i3._$Eh.get(t2); - if (void 0 !== e4 && this._$Em !== e4) { - const t3 = i3.getPropertyOptions(e4), r4 = "function" == typeof t3.converter ? { fromAttribute: t3.converter } : void 0 !== t3.converter?.fromAttribute ? t3.converter : u; - this._$Em = e4, this[e4] = r4.fromAttribute(s2, t3.type), this._$Em = null; - } - } - requestUpdate(t2, s2, i3) { - if (void 0 !== t2) { - if (i3 ??= this.constructor.getPropertyOptions(t2), !(i3.hasChanged ?? f)(this[t2], s2)) return; - this.P(t2, s2, i3); - } - false === this.isUpdatePending && (this._$ES = this._$ET()); - } - P(t2, s2, i3) { - this._$AL.has(t2) || this._$AL.set(t2, s2), true === i3.reflect && this._$Em !== t2 && (this._$Ej ??= /* @__PURE__ */ new Set()).add(t2); - } - async _$ET() { - this.isUpdatePending = true; - try { - await this._$ES; - } catch (t3) { - Promise.reject(t3); - } - const t2 = this.scheduleUpdate(); - return null != t2 && await t2, !this.isUpdatePending; - } - scheduleUpdate() { - return this.performUpdate(); - } - performUpdate() { - if (!this.isUpdatePending) return; - if (!this.hasUpdated) { - if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) { - for (const [t4, s3] of this._$Ep) this[t4] = s3; - this._$Ep = void 0; - } - const t3 = this.constructor.elementProperties; - if (t3.size > 0) for (const [s3, i3] of t3) true !== i3.wrapped || this._$AL.has(s3) || void 0 === this[s3] || this.P(s3, this[s3], i3); - } - let t2 = false; - const s2 = this._$AL; - try { - t2 = this.shouldUpdate(s2), t2 ? (this.willUpdate(s2), this._$EO?.forEach((t3) => t3.hostUpdate?.()), this.update(s2)) : this._$EU(); - } catch (s3) { - throw t2 = false, this._$EU(), s3; - } - t2 && this._$AE(s2); - } - willUpdate(t2) { - } - _$AE(t2) { - this._$EO?.forEach((t3) => t3.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t2)), this.updated(t2); - } - _$EU() { - this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = false; - } - get updateComplete() { - return this.getUpdateComplete(); - } - getUpdateComplete() { - return this._$ES; - } - shouldUpdate(t2) { - return true; - } - update(t2) { - this._$Ej &&= this._$Ej.forEach((t3) => this._$EC(t3, this[t3])), this._$EU(); - } - updated(t2) { - } - firstUpdated(t2) { - } -}; -b.elementStyles = [], b.shadowRootOptions = { mode: "open" }, b[d("elementProperties")] = /* @__PURE__ */ new Map(), b[d("finalized")] = /* @__PURE__ */ new Map(), p?.({ ReactiveElement: b }), (a.reactiveElementVersions ??= []).push("2.0.4"); - -// node_modules/lit-html/lit-html.js -var n3 = globalThis; -var c3 = n3.trustedTypes; -var h2 = c3 ? c3.createPolicy("lit-html", { createHTML: (t2) => t2 }) : void 0; -var f2 = "$lit$"; -var v = `lit$${Math.random().toFixed(9).slice(2)}$`; -var m = "?" + v; -var _ = `<${m}>`; -var w = document; -var lt = () => w.createComment(""); -var st = (t2) => null === t2 || "object" != typeof t2 && "function" != typeof t2; -var g = Array.isArray; -var $ = (t2) => g(t2) || "function" == typeof t2?.[Symbol.iterator]; -var x = "[ \n\f\r]"; -var T = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g; -var E = /-->/g; -var k = />/g; -var O = RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ -\f\r"'\`<>=]|("|')|))|$)`, "g"); -var S2 = /'/g; -var j = /"/g; -var M = /^(?:script|style|textarea|title)$/i; -var P = (t2) => (i3, ...s2) => ({ _$litType$: t2, strings: i3, values: s2 }); -var ke = P(1); -var Oe = P(2); -var Se = P(3); -var R = Symbol.for("lit-noChange"); -var D = Symbol.for("lit-nothing"); -var V = /* @__PURE__ */ new WeakMap(); -var I = w.createTreeWalker(w, 129); -function N(t2, i3) { - if (!g(t2) || !t2.hasOwnProperty("raw")) throw Error("invalid template strings array"); - return void 0 !== h2 ? h2.createHTML(i3) : i3; -} -var U = (t2, i3) => { - const s2 = t2.length - 1, e4 = []; - let h4, o4 = 2 === i3 ? "" : 3 === i3 ? "" : "", n5 = T; - for (let i4 = 0; i4 < s2; i4++) { - const s3 = t2[i4]; - let r4, l2, c4 = -1, a2 = 0; - for (; a2 < s3.length && (n5.lastIndex = a2, l2 = n5.exec(s3), null !== l2); ) a2 = n5.lastIndex, n5 === T ? "!--" === l2[1] ? n5 = E : void 0 !== l2[1] ? n5 = k : void 0 !== l2[2] ? (M.test(l2[2]) && (h4 = RegExp("" === l2[0] ? (n5 = h4 ?? T, c4 = -1) : void 0 === l2[1] ? c4 = -2 : (c4 = n5.lastIndex - l2[2].length, r4 = l2[1], n5 = void 0 === l2[3] ? O : '"' === l2[3] ? j : S2) : n5 === j || n5 === S2 ? n5 = O : n5 === E || n5 === k ? n5 = T : (n5 = O, h4 = void 0); - const u2 = n5 === O && t2[i4 + 1].startsWith("/>") ? " " : ""; - o4 += n5 === T ? s3 + _ : c4 >= 0 ? (e4.push(r4), s3.slice(0, c4) + f2 + s3.slice(c4) + v + u2) : s3 + v + (-2 === c4 ? i4 : u2); - } - return [N(t2, o4 + (t2[s2] || "") + (2 === i3 ? "" : 3 === i3 ? "" : "")), e4]; -}; -var B = class _B { - constructor({ strings: t2, _$litType$: i3 }, s2) { - let e4; - this.parts = []; - let h4 = 0, o4 = 0; - const n5 = t2.length - 1, r4 = this.parts, [l2, a2] = U(t2, i3); - if (this.el = _B.createElement(l2, s2), I.currentNode = this.el.content, 2 === i3 || 3 === i3) { - const t3 = this.el.content.firstChild; - t3.replaceWith(...t3.childNodes); - } - for (; null !== (e4 = I.nextNode()) && r4.length < n5; ) { - if (1 === e4.nodeType) { - if (e4.hasAttributes()) for (const t3 of e4.getAttributeNames()) if (t3.endsWith(f2)) { - const i4 = a2[o4++], s3 = e4.getAttribute(t3).split(v), n6 = /([.?@])?(.*)/.exec(i4); - r4.push({ type: 1, index: h4, name: n6[2], strings: s3, ctor: "." === n6[1] ? Y : "?" === n6[1] ? Z : "@" === n6[1] ? q : G }), e4.removeAttribute(t3); - } else t3.startsWith(v) && (r4.push({ type: 6, index: h4 }), e4.removeAttribute(t3)); - if (M.test(e4.tagName)) { - const t3 = e4.textContent.split(v), i4 = t3.length - 1; - if (i4 > 0) { - e4.textContent = c3 ? c3.emptyScript : ""; - for (let s3 = 0; s3 < i4; s3++) e4.append(t3[s3], lt()), I.nextNode(), r4.push({ type: 2, index: ++h4 }); - e4.append(t3[i4], lt()); - } - } - } else if (8 === e4.nodeType) if (e4.data === m) r4.push({ type: 2, index: h4 }); - else { - let t3 = -1; - for (; -1 !== (t3 = e4.data.indexOf(v, t3 + 1)); ) r4.push({ type: 7, index: h4 }), t3 += v.length - 1; - } - h4++; - } - } - static createElement(t2, i3) { - const s2 = w.createElement("template"); - return s2.innerHTML = t2, s2; - } -}; -function z(t2, i3, s2 = t2, e4) { - if (i3 === R) return i3; - let h4 = void 0 !== e4 ? s2.o?.[e4] : s2.l; - const o4 = st(i3) ? void 0 : i3._$litDirective$; - return h4?.constructor !== o4 && (h4?._$AO?.(false), void 0 === o4 ? h4 = void 0 : (h4 = new o4(t2), h4._$AT(t2, s2, e4)), void 0 !== e4 ? (s2.o ??= [])[e4] = h4 : s2.l = h4), void 0 !== h4 && (i3 = z(t2, h4._$AS(t2, i3.values), h4, e4)), i3; -} -var F = class { - constructor(t2, i3) { - this._$AV = [], this._$AN = void 0, this._$AD = t2, this._$AM = i3; - } - get parentNode() { - return this._$AM.parentNode; - } - get _$AU() { - return this._$AM._$AU; - } - u(t2) { - const { el: { content: i3 }, parts: s2 } = this._$AD, e4 = (t2?.creationScope ?? w).importNode(i3, true); - I.currentNode = e4; - let h4 = I.nextNode(), o4 = 0, n5 = 0, r4 = s2[0]; - for (; void 0 !== r4; ) { - if (o4 === r4.index) { - let i4; - 2 === r4.type ? i4 = new et(h4, h4.nextSibling, this, t2) : 1 === r4.type ? i4 = new r4.ctor(h4, r4.name, r4.strings, this, t2) : 6 === r4.type && (i4 = new K(h4, this, t2)), this._$AV.push(i4), r4 = s2[++n5]; - } - o4 !== r4?.index && (h4 = I.nextNode(), o4++); - } - return I.currentNode = w, e4; - } - p(t2) { - let i3 = 0; - for (const s2 of this._$AV) void 0 !== s2 && (void 0 !== s2.strings ? (s2._$AI(t2, s2, i3), i3 += s2.strings.length - 2) : s2._$AI(t2[i3])), i3++; - } -}; -var et = class _et { - get _$AU() { - return this._$AM?._$AU ?? this.v; - } - constructor(t2, i3, s2, e4) { - this.type = 2, this._$AH = D, this._$AN = void 0, this._$AA = t2, this._$AB = i3, this._$AM = s2, this.options = e4, this.v = e4?.isConnected ?? true; - } - get parentNode() { - let t2 = this._$AA.parentNode; - const i3 = this._$AM; - return void 0 !== i3 && 11 === t2?.nodeType && (t2 = i3.parentNode), t2; - } - get startNode() { - return this._$AA; - } - get endNode() { - return this._$AB; - } - _$AI(t2, i3 = this) { - t2 = z(this, t2, i3), st(t2) ? t2 === D || null == t2 || "" === t2 ? (this._$AH !== D && this._$AR(), this._$AH = D) : t2 !== this._$AH && t2 !== R && this._(t2) : void 0 !== t2._$litType$ ? this.$(t2) : void 0 !== t2.nodeType ? this.T(t2) : $(t2) ? this.k(t2) : this._(t2); - } - O(t2) { - return this._$AA.parentNode.insertBefore(t2, this._$AB); - } - T(t2) { - this._$AH !== t2 && (this._$AR(), this._$AH = this.O(t2)); - } - _(t2) { - this._$AH !== D && st(this._$AH) ? this._$AA.nextSibling.data = t2 : this.T(w.createTextNode(t2)), this._$AH = t2; - } - $(t2) { - const { values: i3, _$litType$: s2 } = t2, e4 = "number" == typeof s2 ? this._$AC(t2) : (void 0 === s2.el && (s2.el = B.createElement(N(s2.h, s2.h[0]), this.options)), s2); - if (this._$AH?._$AD === e4) this._$AH.p(i3); - else { - const t3 = new F(e4, this), s3 = t3.u(this.options); - t3.p(i3), this.T(s3), this._$AH = t3; - } - } - _$AC(t2) { - let i3 = V.get(t2.strings); - return void 0 === i3 && V.set(t2.strings, i3 = new B(t2)), i3; - } - k(t2) { - g(this._$AH) || (this._$AH = [], this._$AR()); - const i3 = this._$AH; - let s2, e4 = 0; - for (const h4 of t2) e4 === i3.length ? i3.push(s2 = new _et(this.O(lt()), this.O(lt()), this, this.options)) : s2 = i3[e4], s2._$AI(h4), e4++; - e4 < i3.length && (this._$AR(s2 && s2._$AB.nextSibling, e4), i3.length = e4); - } - _$AR(t2 = this._$AA.nextSibling, i3) { - for (this._$AP?.(false, true, i3); t2 && t2 !== this._$AB; ) { - const i4 = t2.nextSibling; - t2.remove(), t2 = i4; - } - } - setConnected(t2) { - void 0 === this._$AM && (this.v = t2, this._$AP?.(t2)); - } -}; -var G = class { - get tagName() { - return this.element.tagName; - } - get _$AU() { - return this._$AM._$AU; - } - constructor(t2, i3, s2, e4, h4) { - this.type = 1, this._$AH = D, this._$AN = void 0, this.element = t2, this.name = i3, this._$AM = e4, this.options = h4, s2.length > 2 || "" !== s2[0] || "" !== s2[1] ? (this._$AH = Array(s2.length - 1).fill(new String()), this.strings = s2) : this._$AH = D; - } - _$AI(t2, i3 = this, s2, e4) { - const h4 = this.strings; - let o4 = false; - if (void 0 === h4) t2 = z(this, t2, i3, 0), o4 = !st(t2) || t2 !== this._$AH && t2 !== R, o4 && (this._$AH = t2); - else { - const e5 = t2; - let n5, r4; - for (t2 = h4[0], n5 = 0; n5 < h4.length - 1; n5++) r4 = z(this, e5[s2 + n5], i3, n5), r4 === R && (r4 = this._$AH[n5]), o4 ||= !st(r4) || r4 !== this._$AH[n5], r4 === D ? t2 = D : t2 !== D && (t2 += (r4 ?? "") + h4[n5 + 1]), this._$AH[n5] = r4; - } - o4 && !e4 && this.j(t2); - } - j(t2) { - t2 === D ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t2 ?? ""); - } -}; -var Y = class extends G { - constructor() { - super(...arguments), this.type = 3; - } - j(t2) { - this.element[this.name] = t2 === D ? void 0 : t2; - } -}; -var Z = class extends G { - constructor() { - super(...arguments), this.type = 4; - } - j(t2) { - this.element.toggleAttribute(this.name, !!t2 && t2 !== D); - } -}; -var q = class extends G { - constructor(t2, i3, s2, e4, h4) { - super(t2, i3, s2, e4, h4), this.type = 5; - } - _$AI(t2, i3 = this) { - if ((t2 = z(this, t2, i3, 0) ?? D) === R) return; - const s2 = this._$AH, e4 = t2 === D && s2 !== D || t2.capture !== s2.capture || t2.once !== s2.once || t2.passive !== s2.passive, h4 = t2 !== D && (s2 === D || e4); - e4 && this.element.removeEventListener(this.name, this, s2), h4 && this.element.addEventListener(this.name, this, t2), this._$AH = t2; - } - handleEvent(t2) { - "function" == typeof this._$AH ? this._$AH.call(this.options?.host ?? this.element, t2) : this._$AH.handleEvent(t2); - } -}; -var K = class { - constructor(t2, i3, s2) { - this.element = t2, this.type = 6, this._$AN = void 0, this._$AM = i3, this.options = s2; - } - get _$AU() { - return this._$AM._$AU; - } - _$AI(t2) { - z(this, t2); - } -}; -var Re = n3.litHtmlPolyfillSupport; -Re?.(B, et), (n3.litHtmlVersions ??= []).push("3.2.0"); -var Q = (t2, i3, s2) => { - const e4 = s2?.renderBefore ?? i3; - let h4 = e4._$litPart$; - if (void 0 === h4) { - const t3 = s2?.renderBefore ?? null; - e4._$litPart$ = h4 = new et(i3.insertBefore(lt(), t3), t3, void 0, s2 ?? {}); - } - return h4._$AI(t2), h4; -}; - -// node_modules/lit-element/lit-element.js -var h3 = class extends b { - constructor() { - super(...arguments), this.renderOptions = { host: this }, this.o = void 0; - } - createRenderRoot() { - const t2 = super.createRenderRoot(); - return this.renderOptions.renderBefore ??= t2.firstChild, t2; - } - update(t2) { - const e4 = this.render(); - this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t2), this.o = Q(e4, this.renderRoot, this.renderOptions); - } - connectedCallback() { - super.connectedCallback(), this.o?.setConnected(true); - } - disconnectedCallback() { - super.disconnectedCallback(), this.o?.setConnected(false); - } - render() { - return R; - } -}; -h3._$litElement$ = true, h3["finalized"] = true, globalThis.litElementHydrateSupport?.({ LitElement: h3 }); -var f3 = globalThis.litElementPolyfillSupport; -f3?.({ LitElement: h3 }); -(globalThis.litElementVersions ??= []).push("4.1.0"); - -// node_modules/@lit/reactive-element/decorators/property.js -var o3 = { attribute: true, type: String, converter: u, reflect: false, hasChanged: f }; -var r3 = (t2 = o3, e4, r4) => { - const { kind: n5, metadata: i3 } = r4; - let s2 = globalThis.litPropertyMetadata.get(i3); - if (void 0 === s2 && globalThis.litPropertyMetadata.set(i3, s2 = /* @__PURE__ */ new Map()), s2.set(r4.name, t2), "accessor" === n5) { - const { name: o4 } = r4; - return { set(r5) { - const n6 = e4.get.call(this); - e4.set.call(this, r5), this.requestUpdate(o4, n6, t2); - }, init(e5) { - return void 0 !== e5 && this.P(o4, void 0, t2), e5; - } }; - } - if ("setter" === n5) { - const { name: o4 } = r4; - return function(r5) { - const n6 = this[o4]; - e4.call(this, r5), this.requestUpdate(o4, n6, t2); - }; - } - throw Error("Unsupported decorator location: " + n5); -}; -function n4(t2) { - return (e4, o4) => "object" == typeof o4 ? r3(t2, e4, o4) : ((t3, e5, o5) => { - const r4 = e5.hasOwnProperty(o5); - return e5.constructor.createProperty(o5, r4 ? { ...t3, wrapped: true } : t3), r4 ? Object.getOwnPropertyDescriptor(e5, o5) : void 0; - })(t2, e4, o4); -} - -// js/ipywidgets_styles.ts -var legacyStyles = i` +var bt=Object.defineProperty;var At=Object.getOwnPropertyDescriptor;var S=(o,t,e,s)=>{for(var i=s>1?void 0:s?At(t,e):t,n=o.length-1,r;n>=0;n--)(r=o[n])&&(i=(s?r(t,e,i):r(i))||i);return s&&i&&bt(t,e,i),i};var L=globalThis,z=L.ShadowRoot&&(L.ShadyCSS===void 0||L.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,W=Symbol(),it=new WeakMap,M=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==W)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(z&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=it.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&it.set(e,t))}return t}toString(){return this.cssText}},ot=o=>new M(typeof o=="string"?o:o+"",void 0,W),_=(o,...t)=>{let e=o.length===1?o[0]:t.reduce((s,i,n)=>s+(r=>{if(r._$cssResult$===!0)return r.cssText;if(typeof r=="number")return r;throw Error("Value passed to 'css' function must be a 'css' function result: "+r+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+o[n+1],o[0]);return new M(e,o,W)},F=(o,t)=>{if(z)o.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=L.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,o.appendChild(s)}},D=z?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return ot(e)})(o):o;var{is:wt,defineProperty:xt,getOwnPropertyDescriptor:St,getOwnPropertyNames:Et,getOwnPropertySymbols:Ct,getPrototypeOf:Pt}=Object,I=globalThis,nt=I.trustedTypes,Mt=nt?nt.emptyScript:"",kt=I.reactiveElementPolyfillSupport,k=(o,t)=>o,R={toAttribute(o,t){switch(t){case Boolean:o=o?Mt:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},q=(o,t)=>!wt(o,t),rt={attribute:!0,type:String,converter:R,reflect:!1,hasChanged:q};Symbol.metadata??=Symbol("metadata"),I.litPropertyMetadata??=new WeakMap;var m=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=rt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&xt(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:n}=St(this.prototype,t)??{get(){return this[e]},set(r){this[e]=r}};return{get(){return i?.call(this)},set(r){let c=i?.call(this);n.call(this,r),this.requestUpdate(t,c,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??rt}static _$Ei(){if(this.hasOwnProperty(k("elementProperties")))return;let t=Pt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(k("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(k("properties"))){let e=this.properties,s=[...Et(e),...Ct(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(D(i))}else t!==void 0&&e.push(D(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return F(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let n=(s.converter?.toAttribute!==void 0?s.converter:R).toAttribute(e,s.type);this._$Em=t,n==null?this.removeAttribute(i):this.setAttribute(i,n),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let n=s.getPropertyOptions(i),r=typeof n.converter=="function"?{fromAttribute:n.converter}:n.converter?.fromAttribute!==void 0?n.converter:R;this._$Em=i,this[i]=r.fromAttribute(e,n.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??q)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,n]of this._$Ep)this[i]=n;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,n]of s)n.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],n)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};m.elementStyles=[],m.shadowRootOptions={mode:"open"},m[k("elementProperties")]=new Map,m[k("finalized")]=new Map,kt?.({ReactiveElement:m}),(I.reactiveElementVersions??=[]).push("2.0.4");var G=globalThis,V=G.trustedTypes,at=V?V.createPolicy("lit-html",{createHTML:o=>o}):void 0,ut="$lit$",g=`lit$${Math.random().toFixed(9).slice(2)}$`,mt="?"+g,Rt=`<${mt}>`,A=document,O=()=>A.createComment(""),H=o=>o===null||typeof o!="object"&&typeof o!="function",tt=Array.isArray,Ut=o=>tt(o)||typeof o?.[Symbol.iterator]=="function",J=`[ +\f\r]`,U=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,lt=/-->/g,ct=/>/g,v=RegExp(`>|${J}(?:([^\\s"'>=/]+)(${J}*=${J}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`,"g"),ht=/'/g,dt=/"/g,ft=/^(?:script|style|textarea|title)$/i,et=o=>(t,...e)=>({_$litType$:o,strings:t,values:e}),st=et(1),Bt=et(2),Wt=et(3),w=Symbol.for("lit-noChange"),h=Symbol.for("lit-nothing"),pt=new WeakMap,b=A.createTreeWalker(A,129);function gt(o,t){if(!tt(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return at!==void 0?at.createHTML(t):t}var Ot=(o,t)=>{let e=o.length-1,s=[],i,n=t===2?"":t===3?"":"",r=U;for(let c=0;c"?(r=i??U,l=-1):p[1]===void 0?l=-2:(l=r.lastIndex-p[2].length,d=p[1],r=p[3]===void 0?v:p[3]==='"'?dt:ht):r===dt||r===ht?r=v:r===lt||r===ct?r=U:(r=v,i=void 0);let f=r===v&&o[c+1].startsWith("/>")?" ":"";n+=r===U?a+Rt:l>=0?(s.push(d),a.slice(0,l)+ut+a.slice(l)+g+f):a+g+(l===-2?c:f)}return[gt(o,n+(o[e]||"")+(t===2?"":t===3?"":"")),s]},N=class o{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let n=0,r=0,c=t.length-1,a=this.parts,[d,p]=Ot(t,e);if(this.el=o.createElement(d,s),b.currentNode=this.el.content,e===2||e===3){let l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(i=b.nextNode())!==null&&a.length0){i.textContent=V?V.emptyScript:"";for(let f=0;f2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=h}_$AI(t,e=this,s,i){let n=this.strings,r=!1;if(n===void 0)t=E(this,t,e,0),r=!H(t)||t!==this._$AH&&t!==w,r&&(this._$AH=t);else{let c=t,a,d;for(t=n[0],a=0;a{let s=e?.renderBefore??t,i=s._$litPart$;if(i===void 0){let n=e?.renderBefore??null;s._$litPart$=i=new T(t.insertBefore(O(),n),n,void 0,e??{})}return i._$AI(o),i};var y=class extends m{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=yt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return w}};y._$litElement$=!0,y.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:y});var Nt=globalThis.litElementPolyfillSupport;Nt?.({LitElement:y});(globalThis.litElementVersions??=[]).push("4.1.0");var Tt={attribute:!0,type:String,converter:R,reflect:!1,hasChanged:q},jt=(o=Tt,t,e)=>{let{kind:s,metadata:i}=e,n=globalThis.litPropertyMetadata.get(i);if(n===void 0&&globalThis.litPropertyMetadata.set(i,n=new Map),n.set(e.name,o),s==="accessor"){let{name:r}=e;return{set(c){let a=t.get.call(this);t.set.call(this,c),this.requestUpdate(r,a,o)},init(c){return c!==void 0&&this.P(r,void 0,o),c}}}if(s==="setter"){let{name:r}=e;return function(c){let a=this[r];t.call(this,c),this.requestUpdate(r,a,o)}}throw Error("Unsupported decorator location: "+s)};function x(o){return(t,e)=>typeof e=="object"?jt(o,t,e):((s,i,n)=>{let r=i.hasOwnProperty(n);return i.constructor.createProperty(n,r?{...s,wrapped:!0}:s),r?Object.getOwnPropertyDescriptor(i,n):void 0})(o,t,e)}var $t=_` .legacy-button { align-items: center; background-color: var(--jp-layout-color2); @@ -639,10 +55,7 @@ var legacyStyles = i` height: var(--jp-widgets-inline-height); line-height: var(--jp-widgets-inline-height); } -`; - -// js/material_styles.ts -var materialStyles = i` +`;var _t=_` @font-face { font-family: 'Material Symbols Outlined'; font-style: normal; @@ -664,37 +77,7 @@ var materialStyles = i` white-space: nowrap; word-wrap: normal; } -`; - -// js/utils.ts -function loadFonts() { - if (!document.querySelector(".custom-fonts")) { - const styleElement = document.createElement("style"); - styleElement.classList.add("custom-fonts"); - styleElement.textContent = '@import "https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined";'; - document.body.appendChild(styleElement); - } -} - -// js/layer_manager_row.ts -var _LayerManagerRow = class _LayerManagerRow extends h3 { - constructor() { - super(...arguments); - this._model = void 0; - this.name = ""; - this.visible = true; - this.opacity = 0; - this.isLoading = false; - this.isConfirmDialogVisible = false; - } - static get componentName() { - return `layer-manager-row`; - } - static { - this.styles = [ - legacyStyles, - materialStyles, - i` +`;function vt(){if(!document.querySelector(".custom-fonts")){let o=document.createElement("style");o.classList.add("custom-fonts"),o.textContent='@import "https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined";',document.body.appendChild(o)}}var $=class $ extends y{constructor(){super(...arguments);this._model=void 0;this.name="";this.visible=!0;this.opacity=0;this.isLoading=!1;this.isConfirmDialogVisible=!1}static get componentName(){return"layer-manager-row"}static{this.styles=[$t,_t,_` .row { align-items: center; display: flex; @@ -763,30 +146,7 @@ var _LayerManagerRow = class _LayerManagerRow extends h3 { height: 26px; width: 70px; } - ` - ]; - } - static { - this.modelNameToViewName = /* @__PURE__ */ new Map([ - ["name", "name"], - ["visible", "visible"], - ["opacity", "opacity"], - ["is_loading", "isLoading"] - ]); - } - set model(model) { - this._model = model; - for (const [modelKey, widgetKey] of _LayerManagerRow.modelNameToViewName) { - if (widgetKey) { - this[widgetKey] = model.get(modelKey); - model.on(`change:${modelKey}`, () => { - this[widgetKey] = model.get(modelKey); - }); - } - } - } - render() { - return ke` + `]}static{this.modelNameToViewName=new Map([["name","name"],["visible","visible"],["opacity","opacity"],["is_loading","isLoading"]])}set model(e){this._model=e;for(let[s,i]of $.modelNameToViewName)i&&(this[i]=e.get(s),e.on(`change:${s}`,()=>{this[i]=e.get(s)}))}render(){return st`
${this.renderConfirmDialog()} - `; - } - renderConfirmDialog() { - if (!this.isConfirmDialogVisible) { - return D; - } - return ke` + `}renderConfirmDialog(){return this.isConfirmDialogVisible?st`
Remove layer?
- `; - } - updated(changedProperties) { - for (const [property, _2] of changedProperties) { - this._model?.set(property, this[property]); - } - this._model?.save_changes(); - } - onLayerVisibilityChanged(event) { - const target = event.target; - this.visible = target.checked; - } - onLayerOpacityChanged(event) { - const target = event.target; - this.opacity = parseFloat(target.value); - } - onSettingsClicked(_2) { - this._model?.send({ "type": "click", "id": "settings" }); - } - onDeleteClicked(_2) { - this.isConfirmDialogVisible = true; - } - confirmDeletion(_2) { - this._model?.send({ "type": "click", "id": "delete" }); - } - cancelDeletion(_2) { - this.isConfirmDialogVisible = false; - } -}; -__decorateClass([ - n4() -], _LayerManagerRow.prototype, "name", 2); -__decorateClass([ - n4() -], _LayerManagerRow.prototype, "visible", 2); -__decorateClass([ - n4() -], _LayerManagerRow.prototype, "opacity", 2); -__decorateClass([ - n4() -], _LayerManagerRow.prototype, "isLoading", 2); -__decorateClass([ - n4() -], _LayerManagerRow.prototype, "isConfirmDialogVisible", 2); -var LayerManagerRow = _LayerManagerRow; -if (!customElements.get(LayerManagerRow.componentName)) { - customElements.define(LayerManagerRow.componentName, LayerManagerRow); -} -function render({ model, el }) { - loadFonts(); - const row = document.createElement(LayerManagerRow.componentName); - row.model = model; - el.appendChild(row); -} -var layer_manager_row_default = { render }; -export { - LayerManagerRow, - layer_manager_row_default as default -}; + `:h}updated(e){for(let[s,i]of e)this._model?.set(s,this[s]);this._model?.save_changes()}onLayerVisibilityChanged(e){let s=e.target;this.visible=s.checked}onLayerOpacityChanged(e){let s=e.target;this.opacity=parseFloat(s.value)}onSettingsClicked(e){this._model?.send({type:"click",id:"settings"})}onDeleteClicked(e){this.isConfirmDialogVisible=!0}confirmDeletion(e){this._model?.send({type:"click",id:"delete"})}cancelDeletion(e){this.isConfirmDialogVisible=!1}};S([x()],$.prototype,"name",2),S([x()],$.prototype,"visible",2),S([x()],$.prototype,"opacity",2),S([x()],$.prototype,"isLoading",2),S([x()],$.prototype,"isConfirmDialogVisible",2);var P=$;customElements.get(P.componentName)||customElements.define(P.componentName,P);function Lt({model:o,el:t}){vt();let e=document.createElement(P.componentName);e.model=o,t.appendChild(e)}var qe={render:Lt};export{P as LayerManagerRow,qe as default}; /*! Bundled license information: @lit/reactive-element/css-tag.js: diff --git a/geemap/static/material_styles.js b/geemap/static/material_styles.js index a2a9f007ca..2aff906ab4 100644 --- a/geemap/static/material_styles.js +++ b/geemap/static/material_styles.js @@ -1,549 +1,6 @@ -// node_modules/@lit/reactive-element/css-tag.js -var t = globalThis; -var e = t.ShadowRoot && (void 0 === t.ShadyCSS || t.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype; -var s = Symbol(); -var o = /* @__PURE__ */ new WeakMap(); -var n = class { - constructor(t2, e3, o3) { - if (this._$cssResult$ = true, o3 !== s) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead."); - this.cssText = t2, this.t = e3; - } - get styleSheet() { - let t2 = this.o; - const s2 = this.t; - if (e && void 0 === t2) { - const e3 = void 0 !== s2 && 1 === s2.length; - e3 && (t2 = o.get(s2)), void 0 === t2 && ((this.o = t2 = new CSSStyleSheet()).replaceSync(this.cssText), e3 && o.set(s2, t2)); - } - return t2; - } - toString() { - return this.cssText; - } -}; -var r = (t2) => new n("string" == typeof t2 ? t2 : t2 + "", void 0, s); -var i = (t2, ...e3) => { - const o3 = 1 === t2.length ? t2[0] : e3.reduce((e4, s2, o4) => e4 + ((t3) => { - if (true === t3._$cssResult$) return t3.cssText; - if ("number" == typeof t3) return t3; - throw Error("Value passed to 'css' function must be a 'css' function result: " + t3 + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security."); - })(s2) + t2[o4 + 1], t2[0]); - return new n(o3, t2, s); -}; -var S = (s2, o3) => { - if (e) s2.adoptedStyleSheets = o3.map((t2) => t2 instanceof CSSStyleSheet ? t2 : t2.styleSheet); - else for (const e3 of o3) { - const o4 = document.createElement("style"), n4 = t.litNonce; - void 0 !== n4 && o4.setAttribute("nonce", n4), o4.textContent = e3.cssText, s2.appendChild(o4); - } -}; -var c = e ? (t2) => t2 : (t2) => t2 instanceof CSSStyleSheet ? ((t3) => { - let e3 = ""; - for (const s2 of t3.cssRules) e3 += s2.cssText; - return r(e3); -})(t2) : t2; - -// node_modules/@lit/reactive-element/reactive-element.js -var { is: i2, defineProperty: e2, getOwnPropertyDescriptor: r2, getOwnPropertyNames: h, getOwnPropertySymbols: o2, getPrototypeOf: n2 } = Object; -var a = globalThis; -var c2 = a.trustedTypes; -var l = c2 ? c2.emptyScript : ""; -var p = a.reactiveElementPolyfillSupport; -var d = (t2, s2) => t2; -var u = { toAttribute(t2, s2) { - switch (s2) { - case Boolean: - t2 = t2 ? l : null; - break; - case Object: - case Array: - t2 = null == t2 ? t2 : JSON.stringify(t2); - } - return t2; -}, fromAttribute(t2, s2) { - let i3 = t2; - switch (s2) { - case Boolean: - i3 = null !== t2; - break; - case Number: - i3 = null === t2 ? null : Number(t2); - break; - case Object: - case Array: - try { - i3 = JSON.parse(t2); - } catch (t3) { - i3 = null; - } - } - return i3; -} }; -var f = (t2, s2) => !i2(t2, s2); -var y = { attribute: true, type: String, converter: u, reflect: false, hasChanged: f }; -Symbol.metadata ??= Symbol("metadata"), a.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap(); -var b = class extends HTMLElement { - static addInitializer(t2) { - this._$Ei(), (this.l ??= []).push(t2); - } - static get observedAttributes() { - return this.finalize(), this._$Eh && [...this._$Eh.keys()]; - } - static createProperty(t2, s2 = y) { - if (s2.state && (s2.attribute = false), this._$Ei(), this.elementProperties.set(t2, s2), !s2.noAccessor) { - const i3 = Symbol(), r3 = this.getPropertyDescriptor(t2, i3, s2); - void 0 !== r3 && e2(this.prototype, t2, r3); - } - } - static getPropertyDescriptor(t2, s2, i3) { - const { get: e3, set: h4 } = r2(this.prototype, t2) ?? { get() { - return this[s2]; - }, set(t3) { - this[s2] = t3; - } }; - return { get() { - return e3?.call(this); - }, set(s3) { - const r3 = e3?.call(this); - h4.call(this, s3), this.requestUpdate(t2, r3, i3); - }, configurable: true, enumerable: true }; - } - static getPropertyOptions(t2) { - return this.elementProperties.get(t2) ?? y; - } - static _$Ei() { - if (this.hasOwnProperty(d("elementProperties"))) return; - const t2 = n2(this); - t2.finalize(), void 0 !== t2.l && (this.l = [...t2.l]), this.elementProperties = new Map(t2.elementProperties); - } - static finalize() { - if (this.hasOwnProperty(d("finalized"))) return; - if (this.finalized = true, this._$Ei(), this.hasOwnProperty(d("properties"))) { - const t3 = this.properties, s2 = [...h(t3), ...o2(t3)]; - for (const i3 of s2) this.createProperty(i3, t3[i3]); - } - const t2 = this[Symbol.metadata]; - if (null !== t2) { - const s2 = litPropertyMetadata.get(t2); - if (void 0 !== s2) for (const [t3, i3] of s2) this.elementProperties.set(t3, i3); - } - this._$Eh = /* @__PURE__ */ new Map(); - for (const [t3, s2] of this.elementProperties) { - const i3 = this._$Eu(t3, s2); - void 0 !== i3 && this._$Eh.set(i3, t3); - } - this.elementStyles = this.finalizeStyles(this.styles); - } - static finalizeStyles(s2) { - const i3 = []; - if (Array.isArray(s2)) { - const e3 = new Set(s2.flat(1 / 0).reverse()); - for (const s3 of e3) i3.unshift(c(s3)); - } else void 0 !== s2 && i3.push(c(s2)); - return i3; - } - static _$Eu(t2, s2) { - const i3 = s2.attribute; - return false === i3 ? void 0 : "string" == typeof i3 ? i3 : "string" == typeof t2 ? t2.toLowerCase() : void 0; - } - constructor() { - super(), this._$Ep = void 0, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev(); - } - _$Ev() { - this._$ES = new Promise((t2) => this.enableUpdating = t2), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((t2) => t2(this)); - } - addController(t2) { - (this._$EO ??= /* @__PURE__ */ new Set()).add(t2), void 0 !== this.renderRoot && this.isConnected && t2.hostConnected?.(); - } - removeController(t2) { - this._$EO?.delete(t2); - } - _$E_() { - const t2 = /* @__PURE__ */ new Map(), s2 = this.constructor.elementProperties; - for (const i3 of s2.keys()) this.hasOwnProperty(i3) && (t2.set(i3, this[i3]), delete this[i3]); - t2.size > 0 && (this._$Ep = t2); - } - createRenderRoot() { - const t2 = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions); - return S(t2, this.constructor.elementStyles), t2; - } - connectedCallback() { - this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach((t2) => t2.hostConnected?.()); - } - enableUpdating(t2) { - } - disconnectedCallback() { - this._$EO?.forEach((t2) => t2.hostDisconnected?.()); - } - attributeChangedCallback(t2, s2, i3) { - this._$AK(t2, i3); - } - _$EC(t2, s2) { - const i3 = this.constructor.elementProperties.get(t2), e3 = this.constructor._$Eu(t2, i3); - if (void 0 !== e3 && true === i3.reflect) { - const r3 = (void 0 !== i3.converter?.toAttribute ? i3.converter : u).toAttribute(s2, i3.type); - this._$Em = t2, null == r3 ? this.removeAttribute(e3) : this.setAttribute(e3, r3), this._$Em = null; - } - } - _$AK(t2, s2) { - const i3 = this.constructor, e3 = i3._$Eh.get(t2); - if (void 0 !== e3 && this._$Em !== e3) { - const t3 = i3.getPropertyOptions(e3), r3 = "function" == typeof t3.converter ? { fromAttribute: t3.converter } : void 0 !== t3.converter?.fromAttribute ? t3.converter : u; - this._$Em = e3, this[e3] = r3.fromAttribute(s2, t3.type), this._$Em = null; - } - } - requestUpdate(t2, s2, i3) { - if (void 0 !== t2) { - if (i3 ??= this.constructor.getPropertyOptions(t2), !(i3.hasChanged ?? f)(this[t2], s2)) return; - this.P(t2, s2, i3); - } - false === this.isUpdatePending && (this._$ES = this._$ET()); - } - P(t2, s2, i3) { - this._$AL.has(t2) || this._$AL.set(t2, s2), true === i3.reflect && this._$Em !== t2 && (this._$Ej ??= /* @__PURE__ */ new Set()).add(t2); - } - async _$ET() { - this.isUpdatePending = true; - try { - await this._$ES; - } catch (t3) { - Promise.reject(t3); - } - const t2 = this.scheduleUpdate(); - return null != t2 && await t2, !this.isUpdatePending; - } - scheduleUpdate() { - return this.performUpdate(); - } - performUpdate() { - if (!this.isUpdatePending) return; - if (!this.hasUpdated) { - if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) { - for (const [t4, s3] of this._$Ep) this[t4] = s3; - this._$Ep = void 0; - } - const t3 = this.constructor.elementProperties; - if (t3.size > 0) for (const [s3, i3] of t3) true !== i3.wrapped || this._$AL.has(s3) || void 0 === this[s3] || this.P(s3, this[s3], i3); - } - let t2 = false; - const s2 = this._$AL; - try { - t2 = this.shouldUpdate(s2), t2 ? (this.willUpdate(s2), this._$EO?.forEach((t3) => t3.hostUpdate?.()), this.update(s2)) : this._$EU(); - } catch (s3) { - throw t2 = false, this._$EU(), s3; - } - t2 && this._$AE(s2); - } - willUpdate(t2) { - } - _$AE(t2) { - this._$EO?.forEach((t3) => t3.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t2)), this.updated(t2); - } - _$EU() { - this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = false; - } - get updateComplete() { - return this.getUpdateComplete(); - } - getUpdateComplete() { - return this._$ES; - } - shouldUpdate(t2) { - return true; - } - update(t2) { - this._$Ej &&= this._$Ej.forEach((t3) => this._$EC(t3, this[t3])), this._$EU(); - } - updated(t2) { - } - firstUpdated(t2) { - } -}; -b.elementStyles = [], b.shadowRootOptions = { mode: "open" }, b[d("elementProperties")] = /* @__PURE__ */ new Map(), b[d("finalized")] = /* @__PURE__ */ new Map(), p?.({ ReactiveElement: b }), (a.reactiveElementVersions ??= []).push("2.0.4"); - -// node_modules/lit-html/lit-html.js -var n3 = globalThis; -var c3 = n3.trustedTypes; -var h2 = c3 ? c3.createPolicy("lit-html", { createHTML: (t2) => t2 }) : void 0; -var f2 = "$lit$"; -var v = `lit$${Math.random().toFixed(9).slice(2)}$`; -var m = "?" + v; -var _ = `<${m}>`; -var w = document; -var lt = () => w.createComment(""); -var st = (t2) => null === t2 || "object" != typeof t2 && "function" != typeof t2; -var g = Array.isArray; -var $ = (t2) => g(t2) || "function" == typeof t2?.[Symbol.iterator]; -var x = "[ \n\f\r]"; -var T = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g; -var E = /-->/g; -var k = />/g; -var O = RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ -\f\r"'\`<>=]|("|')|))|$)`, "g"); -var S2 = /'/g; -var j = /"/g; -var M = /^(?:script|style|textarea|title)$/i; -var P = (t2) => (i3, ...s2) => ({ _$litType$: t2, strings: i3, values: s2 }); -var ke = P(1); -var Oe = P(2); -var Se = P(3); -var R = Symbol.for("lit-noChange"); -var D = Symbol.for("lit-nothing"); -var V = /* @__PURE__ */ new WeakMap(); -var I = w.createTreeWalker(w, 129); -function N(t2, i3) { - if (!g(t2) || !t2.hasOwnProperty("raw")) throw Error("invalid template strings array"); - return void 0 !== h2 ? h2.createHTML(i3) : i3; -} -var U = (t2, i3) => { - const s2 = t2.length - 1, e3 = []; - let h4, o3 = 2 === i3 ? "" : 3 === i3 ? "" : "", n4 = T; - for (let i4 = 0; i4 < s2; i4++) { - const s3 = t2[i4]; - let r3, l2, c4 = -1, a2 = 0; - for (; a2 < s3.length && (n4.lastIndex = a2, l2 = n4.exec(s3), null !== l2); ) a2 = n4.lastIndex, n4 === T ? "!--" === l2[1] ? n4 = E : void 0 !== l2[1] ? n4 = k : void 0 !== l2[2] ? (M.test(l2[2]) && (h4 = RegExp("" === l2[0] ? (n4 = h4 ?? T, c4 = -1) : void 0 === l2[1] ? c4 = -2 : (c4 = n4.lastIndex - l2[2].length, r3 = l2[1], n4 = void 0 === l2[3] ? O : '"' === l2[3] ? j : S2) : n4 === j || n4 === S2 ? n4 = O : n4 === E || n4 === k ? n4 = T : (n4 = O, h4 = void 0); - const u2 = n4 === O && t2[i4 + 1].startsWith("/>") ? " " : ""; - o3 += n4 === T ? s3 + _ : c4 >= 0 ? (e3.push(r3), s3.slice(0, c4) + f2 + s3.slice(c4) + v + u2) : s3 + v + (-2 === c4 ? i4 : u2); - } - return [N(t2, o3 + (t2[s2] || "") + (2 === i3 ? "" : 3 === i3 ? "" : "")), e3]; -}; -var B = class _B { - constructor({ strings: t2, _$litType$: i3 }, s2) { - let e3; - this.parts = []; - let h4 = 0, o3 = 0; - const n4 = t2.length - 1, r3 = this.parts, [l2, a2] = U(t2, i3); - if (this.el = _B.createElement(l2, s2), I.currentNode = this.el.content, 2 === i3 || 3 === i3) { - const t3 = this.el.content.firstChild; - t3.replaceWith(...t3.childNodes); - } - for (; null !== (e3 = I.nextNode()) && r3.length < n4; ) { - if (1 === e3.nodeType) { - if (e3.hasAttributes()) for (const t3 of e3.getAttributeNames()) if (t3.endsWith(f2)) { - const i4 = a2[o3++], s3 = e3.getAttribute(t3).split(v), n5 = /([.?@])?(.*)/.exec(i4); - r3.push({ type: 1, index: h4, name: n5[2], strings: s3, ctor: "." === n5[1] ? Y : "?" === n5[1] ? Z : "@" === n5[1] ? q : G }), e3.removeAttribute(t3); - } else t3.startsWith(v) && (r3.push({ type: 6, index: h4 }), e3.removeAttribute(t3)); - if (M.test(e3.tagName)) { - const t3 = e3.textContent.split(v), i4 = t3.length - 1; - if (i4 > 0) { - e3.textContent = c3 ? c3.emptyScript : ""; - for (let s3 = 0; s3 < i4; s3++) e3.append(t3[s3], lt()), I.nextNode(), r3.push({ type: 2, index: ++h4 }); - e3.append(t3[i4], lt()); - } - } - } else if (8 === e3.nodeType) if (e3.data === m) r3.push({ type: 2, index: h4 }); - else { - let t3 = -1; - for (; -1 !== (t3 = e3.data.indexOf(v, t3 + 1)); ) r3.push({ type: 7, index: h4 }), t3 += v.length - 1; - } - h4++; - } - } - static createElement(t2, i3) { - const s2 = w.createElement("template"); - return s2.innerHTML = t2, s2; - } -}; -function z(t2, i3, s2 = t2, e3) { - if (i3 === R) return i3; - let h4 = void 0 !== e3 ? s2.o?.[e3] : s2.l; - const o3 = st(i3) ? void 0 : i3._$litDirective$; - return h4?.constructor !== o3 && (h4?._$AO?.(false), void 0 === o3 ? h4 = void 0 : (h4 = new o3(t2), h4._$AT(t2, s2, e3)), void 0 !== e3 ? (s2.o ??= [])[e3] = h4 : s2.l = h4), void 0 !== h4 && (i3 = z(t2, h4._$AS(t2, i3.values), h4, e3)), i3; -} -var F = class { - constructor(t2, i3) { - this._$AV = [], this._$AN = void 0, this._$AD = t2, this._$AM = i3; - } - get parentNode() { - return this._$AM.parentNode; - } - get _$AU() { - return this._$AM._$AU; - } - u(t2) { - const { el: { content: i3 }, parts: s2 } = this._$AD, e3 = (t2?.creationScope ?? w).importNode(i3, true); - I.currentNode = e3; - let h4 = I.nextNode(), o3 = 0, n4 = 0, r3 = s2[0]; - for (; void 0 !== r3; ) { - if (o3 === r3.index) { - let i4; - 2 === r3.type ? i4 = new et(h4, h4.nextSibling, this, t2) : 1 === r3.type ? i4 = new r3.ctor(h4, r3.name, r3.strings, this, t2) : 6 === r3.type && (i4 = new K(h4, this, t2)), this._$AV.push(i4), r3 = s2[++n4]; - } - o3 !== r3?.index && (h4 = I.nextNode(), o3++); - } - return I.currentNode = w, e3; - } - p(t2) { - let i3 = 0; - for (const s2 of this._$AV) void 0 !== s2 && (void 0 !== s2.strings ? (s2._$AI(t2, s2, i3), i3 += s2.strings.length - 2) : s2._$AI(t2[i3])), i3++; - } -}; -var et = class _et { - get _$AU() { - return this._$AM?._$AU ?? this.v; - } - constructor(t2, i3, s2, e3) { - this.type = 2, this._$AH = D, this._$AN = void 0, this._$AA = t2, this._$AB = i3, this._$AM = s2, this.options = e3, this.v = e3?.isConnected ?? true; - } - get parentNode() { - let t2 = this._$AA.parentNode; - const i3 = this._$AM; - return void 0 !== i3 && 11 === t2?.nodeType && (t2 = i3.parentNode), t2; - } - get startNode() { - return this._$AA; - } - get endNode() { - return this._$AB; - } - _$AI(t2, i3 = this) { - t2 = z(this, t2, i3), st(t2) ? t2 === D || null == t2 || "" === t2 ? (this._$AH !== D && this._$AR(), this._$AH = D) : t2 !== this._$AH && t2 !== R && this._(t2) : void 0 !== t2._$litType$ ? this.$(t2) : void 0 !== t2.nodeType ? this.T(t2) : $(t2) ? this.k(t2) : this._(t2); - } - O(t2) { - return this._$AA.parentNode.insertBefore(t2, this._$AB); - } - T(t2) { - this._$AH !== t2 && (this._$AR(), this._$AH = this.O(t2)); - } - _(t2) { - this._$AH !== D && st(this._$AH) ? this._$AA.nextSibling.data = t2 : this.T(w.createTextNode(t2)), this._$AH = t2; - } - $(t2) { - const { values: i3, _$litType$: s2 } = t2, e3 = "number" == typeof s2 ? this._$AC(t2) : (void 0 === s2.el && (s2.el = B.createElement(N(s2.h, s2.h[0]), this.options)), s2); - if (this._$AH?._$AD === e3) this._$AH.p(i3); - else { - const t3 = new F(e3, this), s3 = t3.u(this.options); - t3.p(i3), this.T(s3), this._$AH = t3; - } - } - _$AC(t2) { - let i3 = V.get(t2.strings); - return void 0 === i3 && V.set(t2.strings, i3 = new B(t2)), i3; - } - k(t2) { - g(this._$AH) || (this._$AH = [], this._$AR()); - const i3 = this._$AH; - let s2, e3 = 0; - for (const h4 of t2) e3 === i3.length ? i3.push(s2 = new _et(this.O(lt()), this.O(lt()), this, this.options)) : s2 = i3[e3], s2._$AI(h4), e3++; - e3 < i3.length && (this._$AR(s2 && s2._$AB.nextSibling, e3), i3.length = e3); - } - _$AR(t2 = this._$AA.nextSibling, i3) { - for (this._$AP?.(false, true, i3); t2 && t2 !== this._$AB; ) { - const i4 = t2.nextSibling; - t2.remove(), t2 = i4; - } - } - setConnected(t2) { - void 0 === this._$AM && (this.v = t2, this._$AP?.(t2)); - } -}; -var G = class { - get tagName() { - return this.element.tagName; - } - get _$AU() { - return this._$AM._$AU; - } - constructor(t2, i3, s2, e3, h4) { - this.type = 1, this._$AH = D, this._$AN = void 0, this.element = t2, this.name = i3, this._$AM = e3, this.options = h4, s2.length > 2 || "" !== s2[0] || "" !== s2[1] ? (this._$AH = Array(s2.length - 1).fill(new String()), this.strings = s2) : this._$AH = D; - } - _$AI(t2, i3 = this, s2, e3) { - const h4 = this.strings; - let o3 = false; - if (void 0 === h4) t2 = z(this, t2, i3, 0), o3 = !st(t2) || t2 !== this._$AH && t2 !== R, o3 && (this._$AH = t2); - else { - const e4 = t2; - let n4, r3; - for (t2 = h4[0], n4 = 0; n4 < h4.length - 1; n4++) r3 = z(this, e4[s2 + n4], i3, n4), r3 === R && (r3 = this._$AH[n4]), o3 ||= !st(r3) || r3 !== this._$AH[n4], r3 === D ? t2 = D : t2 !== D && (t2 += (r3 ?? "") + h4[n4 + 1]), this._$AH[n4] = r3; - } - o3 && !e3 && this.j(t2); - } - j(t2) { - t2 === D ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t2 ?? ""); - } -}; -var Y = class extends G { - constructor() { - super(...arguments), this.type = 3; - } - j(t2) { - this.element[this.name] = t2 === D ? void 0 : t2; - } -}; -var Z = class extends G { - constructor() { - super(...arguments), this.type = 4; - } - j(t2) { - this.element.toggleAttribute(this.name, !!t2 && t2 !== D); - } -}; -var q = class extends G { - constructor(t2, i3, s2, e3, h4) { - super(t2, i3, s2, e3, h4), this.type = 5; - } - _$AI(t2, i3 = this) { - if ((t2 = z(this, t2, i3, 0) ?? D) === R) return; - const s2 = this._$AH, e3 = t2 === D && s2 !== D || t2.capture !== s2.capture || t2.once !== s2.once || t2.passive !== s2.passive, h4 = t2 !== D && (s2 === D || e3); - e3 && this.element.removeEventListener(this.name, this, s2), h4 && this.element.addEventListener(this.name, this, t2), this._$AH = t2; - } - handleEvent(t2) { - "function" == typeof this._$AH ? this._$AH.call(this.options?.host ?? this.element, t2) : this._$AH.handleEvent(t2); - } -}; -var K = class { - constructor(t2, i3, s2) { - this.element = t2, this.type = 6, this._$AN = void 0, this._$AM = i3, this.options = s2; - } - get _$AU() { - return this._$AM._$AU; - } - _$AI(t2) { - z(this, t2); - } -}; -var Re = n3.litHtmlPolyfillSupport; -Re?.(B, et), (n3.litHtmlVersions ??= []).push("3.2.0"); -var Q = (t2, i3, s2) => { - const e3 = s2?.renderBefore ?? i3; - let h4 = e3._$litPart$; - if (void 0 === h4) { - const t3 = s2?.renderBefore ?? null; - e3._$litPart$ = h4 = new et(i3.insertBefore(lt(), t3), t3, void 0, s2 ?? {}); - } - return h4._$AI(t2), h4; -}; - -// node_modules/lit-element/lit-element.js -var h3 = class extends b { - constructor() { - super(...arguments), this.renderOptions = { host: this }, this.o = void 0; - } - createRenderRoot() { - const t2 = super.createRenderRoot(); - return this.renderOptions.renderBefore ??= t2.firstChild, t2; - } - update(t2) { - const e3 = this.render(); - this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t2), this.o = Q(e3, this.renderRoot, this.renderOptions); - } - connectedCallback() { - super.connectedCallback(), this.o?.setConnected(true); - } - disconnectedCallback() { - super.disconnectedCallback(), this.o?.setConnected(false); - } - render() { - return R; - } -}; -h3._$litElement$ = true, h3["finalized"] = true, globalThis.litElementHydrateSupport?.({ LitElement: h3 }); -var f3 = globalThis.litElementPolyfillSupport; -f3?.({ LitElement: h3 }); -(globalThis.litElementVersions ??= []).push("4.1.0"); - -// js/material_styles.ts -var materialStyles = i` +var R=globalThis,T=R.ShadowRoot&&(R.ShadyCSS===void 0||R.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,L=Symbol(),F=new WeakMap,b=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==L)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(T&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=F.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&F.set(e,t))}return t}toString(){return this.cssText}},Q=o=>new b(typeof o=="string"?o:o+"",void 0,L),z=(o,...t)=>{let e=o.length===1?o[0]:t.reduce((s,i,r)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+o[r+1],o[0]);return new b(e,o,L)},I=(o,t)=>{if(T)o.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=R.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,o.appendChild(s)}},M=T?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return Q(e)})(o):o;var{is:pt,defineProperty:ut,getOwnPropertyDescriptor:$t,getOwnPropertyNames:ft,getOwnPropertySymbols:_t,getPrototypeOf:mt}=Object,N=globalThis,Y=N.trustedTypes,At=Y?Y.emptyScript:"",gt=N.reactiveElementPolyfillSupport,w=(o,t)=>o,j={toAttribute(o,t){switch(t){case Boolean:o=o?At:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},tt=(o,t)=>!pt(o,t),G={attribute:!0,type:String,converter:j,reflect:!1,hasChanged:tt};Symbol.metadata??=Symbol("metadata"),N.litPropertyMetadata??=new WeakMap;var $=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=G){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&ut(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:r}=$t(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i?.call(this)},set(n){let p=i?.call(this);r.call(this,n),this.requestUpdate(t,p,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??G}static _$Ei(){if(this.hasOwnProperty(w("elementProperties")))return;let t=mt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(w("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(w("properties"))){let e=this.properties,s=[...ft(e),..._t(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(M(i))}else t!==void 0&&e.push(M(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return I(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let r=(s.converter?.toAttribute!==void 0?s.converter:j).toAttribute(e,s.type);this._$Em=t,r==null?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let r=s.getPropertyOptions(i),n=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute!==void 0?r.converter:j;this._$Em=i,this[i]=n.fromAttribute(e,r.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??tt)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,r]of this._$Ep)this[i]=r;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,r]of s)r.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],r)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[w("elementProperties")]=new Map,$[w("finalized")]=new Map,gt?.({ReactiveElement:$}),(N.reactiveElementVersions??=[]).push("2.0.4");var K=globalThis,k=K.trustedTypes,et=k?k.createPolicy("lit-html",{createHTML:o=>o}):void 0,ht="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,at="?"+_,yt=`<${at}>`,g=document,x=()=>g.createComment(""),P=o=>o===null||typeof o!="object"&&typeof o!="function",X=Array.isArray,vt=o=>X(o)||typeof o?.[Symbol.iterator]=="function",B=`[ +\f\r]`,C=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,st=/-->/g,it=/>/g,m=RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`,"g"),ot=/'/g,rt=/"/g,lt=/^(?:script|style|textarea|title)$/i,Z=o=>(t,...e)=>({_$litType$:o,strings:t,values:e}),Ut=Z(1),Ht=Z(2),Ot=Z(3),y=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),nt=new WeakMap,A=g.createTreeWalker(g,129);function ct(o,t){if(!X(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return et!==void 0?et.createHTML(t):t}var St=(o,t)=>{let e=o.length-1,s=[],i,r=t===2?"":t===3?"":"",n=C;for(let p=0;p"?(n=i??C,a=-1):d[1]===void 0?a=-2:(a=n.lastIndex-d[2].length,l=d[1],n=d[3]===void 0?m:d[3]==='"'?rt:ot):n===rt||n===ot?n=m:n===st||n===it?n=C:(n=m,i=void 0);let f=n===m&&o[p+1].startsWith("/>")?" ":"";r+=n===C?h+yt:a>=0?(s.push(l),h.slice(0,a)+ht+h.slice(a)+_+f):h+_+(a===-2?p:f)}return[ct(o,r+(o[e]||"")+(t===2?"":t===3?"":"")),s]},U=class o{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let r=0,n=0,p=t.length-1,h=this.parts,[l,d]=St(t,e);if(this.el=o.createElement(l,s),A.currentNode=this.el.content,e===2||e===3){let a=this.el.content.firstChild;a.replaceWith(...a.childNodes)}for(;(i=A.nextNode())!==null&&h.length0){i.textContent=k?k.emptyScript:"";for(let f=0;f2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=c}_$AI(t,e=this,s,i){let r=this.strings,n=!1;if(r===void 0)t=v(this,t,e,0),n=!P(t)||t!==this._$AH&&t!==y,n&&(this._$AH=t);else{let p=t,h,l;for(t=r[0],h=0;h{let s=e?.renderBefore??t,i=s._$litPart$;if(i===void 0){let r=e?.renderBefore??null;s._$litPart$=i=new H(t.insertBefore(x(),r),r,void 0,e??{})}return i._$AI(o),i};var E=class extends ${constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=dt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return y}};E._$litElement$=!0,E.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:E});var bt=globalThis.litElementPolyfillSupport;bt?.({LitElement:E});(globalThis.litElementVersions??=[]).push("4.1.0");var Jt=z` @font-face { font-family: 'Material Symbols Outlined'; font-style: normal; @@ -565,10 +22,7 @@ var materialStyles = i` white-space: nowrap; word-wrap: normal; } -`; -export { - materialStyles -}; +`;export{Jt as materialStyles}; /*! Bundled license information: @lit/reactive-element/css-tag.js: diff --git a/geemap/static/utils.js b/geemap/static/utils.js index 6afc8f4c75..ce66ad6cb2 100644 --- a/geemap/static/utils.js +++ b/geemap/static/utils.js @@ -1,29 +1 @@ -// js/utils.ts -async function unpackModels(modelIds, manager) { - return Promise.all( - modelIds.map((id) => manager.get_model(id.slice("IPY_MODEL_".length))) - ); -} -function loadFonts() { - if (!document.querySelector(".custom-fonts")) { - const styleElement = document.createElement("style"); - styleElement.classList.add("custom-fonts"); - styleElement.textContent = '@import "https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined";'; - document.body.appendChild(styleElement); - } -} -async function updateChildren(container, model) { - const children = model.get("children"); - const child_models = await unpackModels(children, model.widget_manager); - const child_views = await Promise.all( - child_models.map((model2) => model2.widget_manager.create_view(model2)) - ); - container.innerHTML = ``; - for (const child_view of child_views) { - container.appendChild(child_view.el); - } -} -export { - loadFonts, - updateChildren -}; +async function l(e,t){return Promise.all(e.map(o=>t.get_model(o.slice(10))))}function s(){if(!document.querySelector(".custom-fonts")){let e=document.createElement("style");e.classList.add("custom-fonts"),e.textContent='@import "https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined";',document.body.appendChild(e)}}async function d(e,t){let o=t.get("children"),i=await l(o,t.widget_manager),a=await Promise.all(i.map(n=>n.widget_manager.create_view(n)));e.innerHTML="";for(let n of a)e.appendChild(n.el)}export{s as loadFonts,d as updateChildren}; From 0d2064176f42651bdd961e756b2f99cda32f3d4c Mon Sep 17 00:00:00 2001 From: Sufyan Abbasi Date: Wed, 16 Oct 2024 01:39:00 +0000 Subject: [PATCH 21/57] Remove extraneous files --- geemap/static/layer_manager.css | 4 ---- geemap/static/layer_manager_row.css | 4 ---- js/common.css | 1 - 3 files changed, 9 deletions(-) delete mode 100644 geemap/static/layer_manager.css delete mode 100644 geemap/static/layer_manager_row.css delete mode 100644 js/common.css diff --git a/geemap/static/layer_manager.css b/geemap/static/layer_manager.css deleted file mode 100644 index 153c430c38..0000000000 --- a/geemap/static/layer_manager.css +++ /dev/null @@ -1,4 +0,0 @@ -@import "https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined"; - -/* js/common.css */ -/*# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFtdLAogICJzb3VyY2VzQ29udGVudCI6IFtdLAogICJtYXBwaW5ncyI6ICIiLAogICJuYW1lcyI6IFtdCn0K */ diff --git a/geemap/static/layer_manager_row.css b/geemap/static/layer_manager_row.css deleted file mode 100644 index 153c430c38..0000000000 --- a/geemap/static/layer_manager_row.css +++ /dev/null @@ -1,4 +0,0 @@ -@import "https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined"; - -/* js/common.css */ -/*# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFtdLAogICJzb3VyY2VzQ29udGVudCI6IFtdLAogICJtYXBwaW5ncyI6ICIiLAogICJuYW1lcyI6IFtdCn0K */ diff --git a/js/common.css b/js/common.css deleted file mode 100644 index dcfde1b8aa..0000000000 --- a/js/common.css +++ /dev/null @@ -1 +0,0 @@ -@import url(https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined); \ No newline at end of file From 84f266138b6046fc7bdeb4d0df962977f9e3f3a3 Mon Sep 17 00:00:00 2001 From: Nathaniel Schmitz Date: Wed, 16 Oct 2024 13:07:42 -0400 Subject: [PATCH 22/57] Address comments from initial review --- geemap/static/ipywidgets_styles.js | 3 +- geemap/static/layer_manager.js | 3 +- geemap/static/layer_manager_row.js | 590 ++++++++++++++++------------- geemap/static/material_styles.js | 3 +- geemap/static/utils.js | 1 + js/layer_manager.ts | 5 +- js/layer_manager_row.ts | 17 +- tsconfig.json | 2 +- 8 files changed, 350 insertions(+), 274 deletions(-) diff --git a/geemap/static/ipywidgets_styles.js b/geemap/static/ipywidgets_styles.js index 574f105dc5..8864cc4619 100644 --- a/geemap/static/ipywidgets_styles.js +++ b/geemap/static/ipywidgets_styles.js @@ -278,7 +278,7 @@ var x = "[ \n\f\r]"; var T = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g; var E = /-->/g; var k = />/g; -var O = RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ +var O = RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`, "g"); var S2 = /'/g; var j = /"/g; @@ -639,3 +639,4 @@ lit-html/is-server.js: * SPDX-License-Identifier: BSD-3-Clause *) */ +//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vbm9kZV9tb2R1bGVzL0BsaXQvcmVhY3RpdmUtZWxlbWVudC9zcmMvY3NzLXRhZy50cyIsICIuLi8uLi9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Sk/KC4qKS8uZXhlYyhyZWFsTmFtZSkhO1xuICAgICAgICAgICAgICBwYXJ0cy5wdXNoKHtcbiAgICAgICAgICAgICAgICB0eXBlOiBBVFRSSUJVVEVfUEFSVCxcbiAgICAgICAgICAgICAgICBpbmRleDogbm9kZUluZGV4LFxuICAgICAgICAgICAgICAgIG5hbWU6IG1bMl0sXG4gICAgICAgICAgICAgICAgc3RyaW5nczogc3RhdGljcyxcbiAgICAgICAgICAgICAgICBjdG9yOlxuICAgICAgICAgICAgICAgICAgbVsxXSA9PT0gJy4nXG4gICAgICAgICAgICAgICAgICAgID8gUHJvcGVydHlQYXJ0XG4gICAgICAgICAgICAgICAgICAgIDogbVsxXSA9PT0gJz8nXG4gICAgICAgICAgICAgICAgICAgICAgPyBCb29sZWFuQXR0cmlidXRlUGFydFxuICAgICAgICAgICAgICAgICAgICAgIDogbVsxXSA9PT0gJ0AnXG4gICAgICAgICAgICAgICAgICAgICAgICA/IEV2ZW50UGFydFxuICAgICAgICAgICAgICAgICAgICAgICAgOiBBdHRyaWJ1dGVQYXJ0LFxuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgKG5vZGUgYXMgRWxlbWVudCkucmVtb3ZlQXR0cmlidXRlKG5hbWUpO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChuYW1lLnN0YXJ0c1dpdGgobWFya2VyKSkge1xuICAgICAgICAgICAgICBwYXJ0cy5wdXNoKHtcbiAgICAgICAgICAgICAgICB0eXBlOiBFTEVNRU5UX1BBUlQsXG4gICAgICAgICAgICAgICAgaW5kZXg6IG5vZGVJbmRleCxcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgIChub2RlIGFzIEVsZW1lbnQpLnJlbW92ZUF0dHJpYnV0ZShuYW1lKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgLy8gVE9ETyAoanVzdGluZmFnbmFuaSk6IGJlbmNobWFyayB0aGUgcmVnZXggYW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XIiLCAiYWRkRXZlbnRMaXN0ZW5lciIsICJldmVudCIsICJjYWxsIiwgImhvc3QiLCAiaGFuZGxlRXZlbnQiLCAicG9seWZpbGxTdXBwb3J0IiwgImdsb2JhbCIsICJsaXRIdG1sUG9seWZpbGxTdXBwb3J0IiwgIlRlbXBsYXRlIiwgIkNoaWxkUGFydCIsICJsaXRIdG1sVmVyc2lvbnMiLCAicHVzaCIsICJyZW5kZXIiLCAidmFsdWUiLCAiY29udGFpbmVyIiwgIm9wdGlvbnMiLCAicGFydE93bmVyTm9kZSIsICJyZW5kZXJCZWZvcmUiLCAicGFydCIsICJlbmROb2RlIiwgImluc2VydEJlZm9yZSIsICJjcmVhdGVNYXJrZXIiLCAiXyRzZXRWYWx1ZSIsICJMaXRFbGVtZW50IiwgIlJlYWN0aXZlRWxlbWVudCIsICJjb25zdHJ1Y3RvciIsICJ0aGlzIiwgInJlbmRlck9wdGlvbnMiLCAiaG9zdCIsICJfX2NoaWxkUGFydCIsICJjcmVhdGVSZW5kZXJSb290IiwgInJlbmRlclJvb3QiLCAic3VwZXIiLCAicmVuZGVyQmVmb3JlIiwgImZpcnN0Q2hpbGQiLCAiY2hhbmdlZFByb3BlcnRpZXMiLCAidmFsdWUiLCAicmVuZGVyIiwgImhhc1VwZGF0ZWQiLCAiaXNDb25uZWN0ZWQiLCAidXBkYXRlIiwgImNvbm5lY3RlZENhbGxiYWNrIiwgInNldENvbm5lY3RlZCIsICJkaXNjb25uZWN0ZWRDYWxsYmFjayIsICJub0NoYW5nZSIsICJnbG9iYWxUaGlzIiwgImxpdEVsZW1lbnRIeWRyYXRlU3VwcG9ydCIsICJwb2x5ZmlsbFN1cHBvcnQiLCAibGl0RWxlbWVudFBvbHlmaWxsU3VwcG9ydCIsICJnbG9iYWxUaGlzIiwgImxpdEVsZW1lbnRWZXJzaW9ucyIsICJwdXNoIl0KfQo= diff --git a/geemap/static/layer_manager.js b/geemap/static/layer_manager.js index e098a78d10..175474a5ff 100644 --- a/geemap/static/layer_manager.js +++ b/geemap/static/layer_manager.js @@ -289,7 +289,7 @@ var x = "[ \n\f\r]"; var T = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g; var E = /-->/g; var k = />/g; -var O = RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ +var O = RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`, "g"); var S2 = /'/g; var j = /"/g; @@ -871,3 +871,4 @@ lit-html/is-server.js: * SPDX-License-Identifier: BSD-3-Clause *) */ +//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vbm9kZV9tb2R1bGVzL0BsaXQvcmVhY3RpdmUtZWxlbWVudC9zcmMvY3NzLXRhZy50cyIsICIuLi8uLi9ub2RlX21vZHVsZXMvQGxpdC9yZWFjdGl2ZS1lbGVtZW50L3NyYy9yZWFjdGl2ZS1lbGVtZW50LnRzIiwgIi4uLy4uL25vZGVfbW9kdWxlcy9saXQtaHRtbC9zcmMvbGl0LWh0bWwudHMiLCAiLi4vLi4vbm9kZV9tb2R1bGVzL2xpdC1lbGVtZW50L3NyYy9saXQtZWxlbWVudC50cyIsICIuLi8uLi9ub2RlX21vZHVsZXMvQGxpdC9yZWFjdGl2ZS1lbGVtZW50L3NyYy9kZWNvcmF0b3JzL3Byb3BlcnR5LnRzIiwgIi4uLy4uL2pzL2lweXdpZGdldHNfc3R5bGVzLnRzIiwgIi4uLy4uL2pzL3V0aWxzLnRzIiwgIi4uLy4uL2pzL2xheWVyX21hbmFnZXIudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbIi8qKlxuICogQGxpY2Vuc2VcbiAqIENvcHlyaWdodCAyMDE5IEdvb2dsZSBMTENcbiAqIFNQRFgtTGljZW5zZS1JZGVudGlmaWVyOiBCU0QtMy1DbGF1c2VcbiAqL1xuXG5jb25zd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ZmZpeCkpIHtcbiAgICAgICAgICAgICAgY29uc3QgcmVhbE5hbWUgPSBhdHRyTmFtZXNbYXR0ck5hbWVJbmRleCsrXTtcbiAgICAgICAgICAgICAgY29uc3QgdmFsdWUgPSAobm9kZSBhcyBFbGVtZW50KS5nZXRBdHRyaWJ1dGUobmFtZSkhO1xuICAgICAgICAgICAgICBjb25zdCBzdGF0aWNzID0gdmFsdWUuc3BsaXQobWFya2VyKTtcbiAgICAgICAgICAgICAgY29uc3QgbSA9IC8oWy4/QF0pPyguKikvLmV4ZWMocmVhbE5hbWUpITtcbiAgICAgICAgICAgICAgcGFydHMucHVzaCh7XG4gICAgICAgICAgICAgICAgdHlwZTogQVRUUklCVVRFX1BBUlQsXG4gICAgICAgICAgICAgICAgaW5kZXg6IG5vZGVJbmRleCxcbiAgICAgICAgICAgICAgICBuYW1lOiBtWzJdLFxuICAgICAgICAgICAgICAgIHN0cmluZ3M6IHN0YXRpY3MsXG4gICAgICAgICAgICAgICAgY3RvcjpcbiAgICAgICAgICAgICAgICAgIG1bMV0gPT09ICcuJ1xuICAgICAgICAgICAgICAgICAgICA/IFByb3BlcnR5UGFydFxuICAgICAgICAgICAgICAgICAgICA6IG1bMV0gPT09ICc/J1xuICAgICAgICAgICAgICAgICAgICAgID8gQm9vbGVhbkF0dHJpYnV0ZVBhcnRcbiAgICAgICAgICAgICAgICAgICAgICA6IG1bMV0gPT09ICdAJ1xuICAgICAgICAgICAgICAgICAgICAgICAgPyBFdmVudFBhcnRcbiAgICAgICAgICAgICAgICAgICAgICAgIDogQXR0cmlidXRlUGFydCxcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgIChub2RlIGFzIEVsZW1lbnQpLnJlbW92ZUF0dHJpYnV0ZShuYW1lKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobmFtZS5zdGFydHNXaXRoKG1hcmtlcikpIHtcbiAgICAgICAgICAgICAgcGFydHMucHVzaCh7XG4gICAgICAgICAgICAgICAgdHlwZ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hY2l0eSkpLFxuICAgICAgICAgICAgICAgICAgICAwIDNweCAxcHggLTJweCByZ2JhKDAsIDAsIDAsIHZhcigtLW1kLXNoYWRvdy1rZXktdW1icmEtb3BhY2l0eSkpLFxuICAgICAgICAgICAgICAgICAgICAwIDFweCA1cHggMCByZ2JhKDAsIDAsIDAsIHZhcigtLW1kLXNoYWRvdy1hbWJpZW50LXNoYWRvdy1vcGFjaXR5KSk7XG4gICAgfVxuXG4gICAgLmxlZ2FjeS1zbGlkZXIge1xuICAgICAgICAtd2Via2l0LWFwcGVhcmFuY2U6IG5vbmU7XG4gICAgICAgIGFwcGVhcmFuY2U6IG5vbmU7XG4gICAgICAgIGJhY2tncm91bmQ6IHZhcigtLWpwLWxheW91dC1jb2xvcjMpO1xuICAgICAgICBib3JkZXItcmFkaXVzOiAzcHg7XG4gICAgICAgIGhlaWdodDogNHB4O1xuICAgICAgICBvdXRsaW5lOiBub25lO1xuICAgIH1cblxuICAgIC5sZWdhY3ktc2xpZGVyOjotd2Via2l0LXNsaWRlci10aHVtYixcbiAgICAubGVnYWN5LXNsaWRlcjo6LW1vei1yYW5nZS10aHVtYiB7XG4gICAgICAgIC1tb3otYXBwZWFyYW5jZTogbm9uZTtcbiAgICAgICAgLXdlYmtpdC1hcHBlYXJhbmNlOiBub25lO1xuICAgICAgICBhcHBlYXJhbmNlOiBub25lO1xuICAgICAgICBib3JkZXItcmFkaXVzOiA1MCU7XG4gICAgICAgIGN1cnNvcjogcG9pbnRlcjtcbiAgICAgICAgaGVpZ2h0OiB2YXIoLS1qcC13aWRnZXRzLXNsaWRlci1oYW5kbGUtc2l6ZSk7XG4gICAgICAgIHdpZHRoOiB2YXIoLS1qcC13aWRnZXRzLXNsaWRlci1oYW5kbGUtc2l6ZSk7XG4gICAgfVxuXG4gICAgLmxlZ2FjeS10ZXh0IHtcbiAgICAgICAgY29sb3I6IHZhcigtLWpwLXdpZGdldHMtbGFiZWwtY29sb3IpO1xuICAgICAgICBmb250LWZhbWlseT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NYW5hZ2VyIHwgbnVsbD4oW1xuICAgICAgICBbXCJjaGlsZHJlblwiLCBudWxsXSxcbiAgICAgICAgW1widmlzaWJsZVwiLCBcInZpc2libGVcIl0sXG4gICAgXSk7XG5cbiAgICBzZXQgbW9kZWwobW9kZWw6IEFueU1vZGVsPExheWVyTWFuYWdlck1vZGVsPikge1xuICAgICAgICB0aGlzLl9tb2RlbCA9IG1vZGVsO1xuICAgICAgICBmb3IgKGNvbnN0IFttb2RlbEtleSwgd2lkZ2V0S2V5XSBvZiBMYXllck1hbmFnZXIubW9kZWxOYW1lVG9WaWV3TmFtZSkge1xuICAgICAgICAgICAgaWYgKHdpZGdldEtleSkge1xuICAgICAgICAgICAgICAgIC8vIEdldCBpbml0aWFsIHZhbHVlcyBmcm9tIHRoZSBQeXRob24gbW9kZWwuXG4gICAgICAgICAgICAgICAgKHRoaXMgYXMgYW55KVt3aWRnZXRLZXldID0gbW9kZWwuZ2V0KG1vZGVsS2V5KTtcbiAgICAgICAgICAgICAgICAvLyBMaXN0ZW4gZm9yIHVwZGF0ZXMgdG8gdGhlIG1vZGVsLlxuICAgICAgICAgICAgICAgIG1vZGVsLm9uKGBjaGFuZ2U6JHttb2RlbEtleX1gLCAoKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICh0aGlzIGFzIGFueSlbd2lkZ2V0S2V5XSA9IG1vZGVsLmdldChtb2RlbEtleSk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBAcHJvcGVydHkoKVxuICAgIHZpc2libGU6IGJvb2xlYW4gPSBmYWxzZTtcblxuICAgIHJlbmRlcigpIHtcbiAgICAgICAgcmV0dXJuIGh0bWxgXG4gICAgICAgICAgICA8ZGl2IGNsYXNzPVwiY29udGFpbmVyXCI+XG4gICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInJvd1wiPlxuICAgICAgICAgICAgICAgICAgICA8aW5wdXRcbiAgICAgICAgICA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er_manager_row.js b/geemap/static/layer_manager_row.js index 3cc458fa32..fc8fc104f4 100644 --- a/geemap/static/layer_manager_row.js +++ b/geemap/static/layer_manager_row.js @@ -2,8 +2,8 @@ var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __decorateClass = (decorators, target, key, kind) => { var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target; - for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--) - if (decorator = decorators[i3]) + for (var i4 = decorators.length - 1, decorator; i4 >= 0; i4--) + if (decorator = decorators[i4]) result = (kind ? decorator(target, key, result) : decorator(result)) || result; if (kind && result) __defProp(target, key, result); return result; @@ -15,44 +15,44 @@ var e = t.ShadowRoot && (void 0 === t.ShadyCSS || t.ShadyCSS.nativeShadow) && "a var s = Symbol(); var o = /* @__PURE__ */ new WeakMap(); var n = class { - constructor(t2, e4, o4) { + constructor(t3, e5, o4) { if (this._$cssResult$ = true, o4 !== s) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead."); - this.cssText = t2, this.t = e4; + this.cssText = t3, this.t = e5; } get styleSheet() { - let t2 = this.o; + let t3 = this.o; const s2 = this.t; - if (e && void 0 === t2) { - const e4 = void 0 !== s2 && 1 === s2.length; - e4 && (t2 = o.get(s2)), void 0 === t2 && ((this.o = t2 = new CSSStyleSheet()).replaceSync(this.cssText), e4 && o.set(s2, t2)); + if (e && void 0 === t3) { + const e5 = void 0 !== s2 && 1 === s2.length; + e5 && (t3 = o.get(s2)), void 0 === t3 && ((this.o = t3 = new CSSStyleSheet()).replaceSync(this.cssText), e5 && o.set(s2, t3)); } - return t2; + return t3; } toString() { return this.cssText; } }; -var r = (t2) => new n("string" == typeof t2 ? t2 : t2 + "", void 0, s); -var i = (t2, ...e4) => { - const o4 = 1 === t2.length ? t2[0] : e4.reduce((e5, s2, o5) => e5 + ((t3) => { - if (true === t3._$cssResult$) return t3.cssText; - if ("number" == typeof t3) return t3; - throw Error("Value passed to 'css' function must be a 'css' function result: " + t3 + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security."); - })(s2) + t2[o5 + 1], t2[0]); - return new n(o4, t2, s); +var r = (t3) => new n("string" == typeof t3 ? t3 : t3 + "", void 0, s); +var i = (t3, ...e5) => { + const o4 = 1 === t3.length ? t3[0] : e5.reduce((e6, s2, o5) => e6 + ((t4) => { + if (true === t4._$cssResult$) return t4.cssText; + if ("number" == typeof t4) return t4; + throw Error("Value passed to 'css' function must be a 'css' function result: " + t4 + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security."); + })(s2) + t3[o5 + 1], t3[0]); + return new n(o4, t3, s); }; var S = (s2, o4) => { - if (e) s2.adoptedStyleSheets = o4.map((t2) => t2 instanceof CSSStyleSheet ? t2 : t2.styleSheet); - else for (const e4 of o4) { + if (e) s2.adoptedStyleSheets = o4.map((t3) => t3 instanceof CSSStyleSheet ? t3 : t3.styleSheet); + else for (const e5 of o4) { const o5 = document.createElement("style"), n5 = t.litNonce; - void 0 !== n5 && o5.setAttribute("nonce", n5), o5.textContent = e4.cssText, s2.appendChild(o5); + void 0 !== n5 && o5.setAttribute("nonce", n5), o5.textContent = e5.cssText, s2.appendChild(o5); } }; -var c = e ? (t2) => t2 : (t2) => t2 instanceof CSSStyleSheet ? ((t3) => { - let e4 = ""; - for (const s2 of t3.cssRules) e4 += s2.cssText; - return r(e4); -})(t2) : t2; +var c = e ? (t3) => t3 : (t3) => t3 instanceof CSSStyleSheet ? ((t4) => { + let e5 = ""; + for (const s2 of t4.cssRules) e5 += s2.cssText; + return r(e5); +})(t3) : t3; // node_modules/@lit/reactive-element/reactive-element.js var { is: i2, defineProperty: e2, getOwnPropertyDescriptor: r2, getOwnPropertyNames: h, getOwnPropertySymbols: o2, getPrototypeOf: n2 } = Object; @@ -60,168 +60,168 @@ var a = globalThis; var c2 = a.trustedTypes; var l = c2 ? c2.emptyScript : ""; var p = a.reactiveElementPolyfillSupport; -var d = (t2, s2) => t2; -var u = { toAttribute(t2, s2) { +var d = (t3, s2) => t3; +var u = { toAttribute(t3, s2) { switch (s2) { case Boolean: - t2 = t2 ? l : null; + t3 = t3 ? l : null; break; case Object: case Array: - t2 = null == t2 ? t2 : JSON.stringify(t2); + t3 = null == t3 ? t3 : JSON.stringify(t3); } - return t2; -}, fromAttribute(t2, s2) { - let i3 = t2; + return t3; +}, fromAttribute(t3, s2) { + let i4 = t3; switch (s2) { case Boolean: - i3 = null !== t2; + i4 = null !== t3; break; case Number: - i3 = null === t2 ? null : Number(t2); + i4 = null === t3 ? null : Number(t3); break; case Object: case Array: try { - i3 = JSON.parse(t2); - } catch (t3) { - i3 = null; + i4 = JSON.parse(t3); + } catch (t4) { + i4 = null; } } - return i3; + return i4; } }; -var f = (t2, s2) => !i2(t2, s2); +var f = (t3, s2) => !i2(t3, s2); var y = { attribute: true, type: String, converter: u, reflect: false, hasChanged: f }; Symbol.metadata ??= Symbol("metadata"), a.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap(); var b = class extends HTMLElement { - static addInitializer(t2) { - this._$Ei(), (this.l ??= []).push(t2); + static addInitializer(t3) { + this._$Ei(), (this.l ??= []).push(t3); } static get observedAttributes() { return this.finalize(), this._$Eh && [...this._$Eh.keys()]; } - static createProperty(t2, s2 = y) { - if (s2.state && (s2.attribute = false), this._$Ei(), this.elementProperties.set(t2, s2), !s2.noAccessor) { - const i3 = Symbol(), r4 = this.getPropertyDescriptor(t2, i3, s2); - void 0 !== r4 && e2(this.prototype, t2, r4); + static createProperty(t3, s2 = y) { + if (s2.state && (s2.attribute = false), this._$Ei(), this.elementProperties.set(t3, s2), !s2.noAccessor) { + const i4 = Symbol(), r4 = this.getPropertyDescriptor(t3, i4, s2); + void 0 !== r4 && e2(this.prototype, t3, r4); } } - static getPropertyDescriptor(t2, s2, i3) { - const { get: e4, set: h4 } = r2(this.prototype, t2) ?? { get() { + static getPropertyDescriptor(t3, s2, i4) { + const { get: e5, set: h4 } = r2(this.prototype, t3) ?? { get() { return this[s2]; - }, set(t3) { - this[s2] = t3; + }, set(t4) { + this[s2] = t4; } }; return { get() { - return e4?.call(this); + return e5?.call(this); }, set(s3) { - const r4 = e4?.call(this); - h4.call(this, s3), this.requestUpdate(t2, r4, i3); + const r4 = e5?.call(this); + h4.call(this, s3), this.requestUpdate(t3, r4, i4); }, configurable: true, enumerable: true }; } - static getPropertyOptions(t2) { - return this.elementProperties.get(t2) ?? y; + static getPropertyOptions(t3) { + return this.elementProperties.get(t3) ?? y; } static _$Ei() { if (this.hasOwnProperty(d("elementProperties"))) return; - const t2 = n2(this); - t2.finalize(), void 0 !== t2.l && (this.l = [...t2.l]), this.elementProperties = new Map(t2.elementProperties); + const t3 = n2(this); + t3.finalize(), void 0 !== t3.l && (this.l = [...t3.l]), this.elementProperties = new Map(t3.elementProperties); } static finalize() { if (this.hasOwnProperty(d("finalized"))) return; if (this.finalized = true, this._$Ei(), this.hasOwnProperty(d("properties"))) { - const t3 = this.properties, s2 = [...h(t3), ...o2(t3)]; - for (const i3 of s2) this.createProperty(i3, t3[i3]); + const t4 = this.properties, s2 = [...h(t4), ...o2(t4)]; + for (const i4 of s2) this.createProperty(i4, t4[i4]); } - const t2 = this[Symbol.metadata]; - if (null !== t2) { - const s2 = litPropertyMetadata.get(t2); - if (void 0 !== s2) for (const [t3, i3] of s2) this.elementProperties.set(t3, i3); + const t3 = this[Symbol.metadata]; + if (null !== t3) { + const s2 = litPropertyMetadata.get(t3); + if (void 0 !== s2) for (const [t4, i4] of s2) this.elementProperties.set(t4, i4); } this._$Eh = /* @__PURE__ */ new Map(); - for (const [t3, s2] of this.elementProperties) { - const i3 = this._$Eu(t3, s2); - void 0 !== i3 && this._$Eh.set(i3, t3); + for (const [t4, s2] of this.elementProperties) { + const i4 = this._$Eu(t4, s2); + void 0 !== i4 && this._$Eh.set(i4, t4); } this.elementStyles = this.finalizeStyles(this.styles); } static finalizeStyles(s2) { - const i3 = []; + const i4 = []; if (Array.isArray(s2)) { - const e4 = new Set(s2.flat(1 / 0).reverse()); - for (const s3 of e4) i3.unshift(c(s3)); - } else void 0 !== s2 && i3.push(c(s2)); - return i3; + const e5 = new Set(s2.flat(1 / 0).reverse()); + for (const s3 of e5) i4.unshift(c(s3)); + } else void 0 !== s2 && i4.push(c(s2)); + return i4; } - static _$Eu(t2, s2) { - const i3 = s2.attribute; - return false === i3 ? void 0 : "string" == typeof i3 ? i3 : "string" == typeof t2 ? t2.toLowerCase() : void 0; + static _$Eu(t3, s2) { + const i4 = s2.attribute; + return false === i4 ? void 0 : "string" == typeof i4 ? i4 : "string" == typeof t3 ? t3.toLowerCase() : void 0; } constructor() { super(), this._$Ep = void 0, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev(); } _$Ev() { - this._$ES = new Promise((t2) => this.enableUpdating = t2), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((t2) => t2(this)); + this._$ES = new Promise((t3) => this.enableUpdating = t3), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((t3) => t3(this)); } - addController(t2) { - (this._$EO ??= /* @__PURE__ */ new Set()).add(t2), void 0 !== this.renderRoot && this.isConnected && t2.hostConnected?.(); + addController(t3) { + (this._$EO ??= /* @__PURE__ */ new Set()).add(t3), void 0 !== this.renderRoot && this.isConnected && t3.hostConnected?.(); } - removeController(t2) { - this._$EO?.delete(t2); + removeController(t3) { + this._$EO?.delete(t3); } _$E_() { - const t2 = /* @__PURE__ */ new Map(), s2 = this.constructor.elementProperties; - for (const i3 of s2.keys()) this.hasOwnProperty(i3) && (t2.set(i3, this[i3]), delete this[i3]); - t2.size > 0 && (this._$Ep = t2); + const t3 = /* @__PURE__ */ new Map(), s2 = this.constructor.elementProperties; + for (const i4 of s2.keys()) this.hasOwnProperty(i4) && (t3.set(i4, this[i4]), delete this[i4]); + t3.size > 0 && (this._$Ep = t3); } createRenderRoot() { - const t2 = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions); - return S(t2, this.constructor.elementStyles), t2; + const t3 = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions); + return S(t3, this.constructor.elementStyles), t3; } connectedCallback() { - this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach((t2) => t2.hostConnected?.()); + this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach((t3) => t3.hostConnected?.()); } - enableUpdating(t2) { + enableUpdating(t3) { } disconnectedCallback() { - this._$EO?.forEach((t2) => t2.hostDisconnected?.()); + this._$EO?.forEach((t3) => t3.hostDisconnected?.()); } - attributeChangedCallback(t2, s2, i3) { - this._$AK(t2, i3); + attributeChangedCallback(t3, s2, i4) { + this._$AK(t3, i4); } - _$EC(t2, s2) { - const i3 = this.constructor.elementProperties.get(t2), e4 = this.constructor._$Eu(t2, i3); - if (void 0 !== e4 && true === i3.reflect) { - const r4 = (void 0 !== i3.converter?.toAttribute ? i3.converter : u).toAttribute(s2, i3.type); - this._$Em = t2, null == r4 ? this.removeAttribute(e4) : this.setAttribute(e4, r4), this._$Em = null; + _$EC(t3, s2) { + const i4 = this.constructor.elementProperties.get(t3), e5 = this.constructor._$Eu(t3, i4); + if (void 0 !== e5 && true === i4.reflect) { + const r4 = (void 0 !== i4.converter?.toAttribute ? i4.converter : u).toAttribute(s2, i4.type); + this._$Em = t3, null == r4 ? this.removeAttribute(e5) : this.setAttribute(e5, r4), this._$Em = null; } } - _$AK(t2, s2) { - const i3 = this.constructor, e4 = i3._$Eh.get(t2); - if (void 0 !== e4 && this._$Em !== e4) { - const t3 = i3.getPropertyOptions(e4), r4 = "function" == typeof t3.converter ? { fromAttribute: t3.converter } : void 0 !== t3.converter?.fromAttribute ? t3.converter : u; - this._$Em = e4, this[e4] = r4.fromAttribute(s2, t3.type), this._$Em = null; + _$AK(t3, s2) { + const i4 = this.constructor, e5 = i4._$Eh.get(t3); + if (void 0 !== e5 && this._$Em !== e5) { + const t4 = i4.getPropertyOptions(e5), r4 = "function" == typeof t4.converter ? { fromAttribute: t4.converter } : void 0 !== t4.converter?.fromAttribute ? t4.converter : u; + this._$Em = e5, this[e5] = r4.fromAttribute(s2, t4.type), this._$Em = null; } } - requestUpdate(t2, s2, i3) { - if (void 0 !== t2) { - if (i3 ??= this.constructor.getPropertyOptions(t2), !(i3.hasChanged ?? f)(this[t2], s2)) return; - this.P(t2, s2, i3); + requestUpdate(t3, s2, i4) { + if (void 0 !== t3) { + if (i4 ??= this.constructor.getPropertyOptions(t3), !(i4.hasChanged ?? f)(this[t3], s2)) return; + this.P(t3, s2, i4); } false === this.isUpdatePending && (this._$ES = this._$ET()); } - P(t2, s2, i3) { - this._$AL.has(t2) || this._$AL.set(t2, s2), true === i3.reflect && this._$Em !== t2 && (this._$Ej ??= /* @__PURE__ */ new Set()).add(t2); + P(t3, s2, i4) { + this._$AL.has(t3) || this._$AL.set(t3, s2), true === i4.reflect && this._$Em !== t3 && (this._$Ej ??= /* @__PURE__ */ new Set()).add(t3); } async _$ET() { this.isUpdatePending = true; try { await this._$ES; - } catch (t3) { - Promise.reject(t3); + } catch (t4) { + Promise.reject(t4); } - const t2 = this.scheduleUpdate(); - return null != t2 && await t2, !this.isUpdatePending; + const t3 = this.scheduleUpdate(); + return null != t3 && await t3, !this.isUpdatePending; } scheduleUpdate() { return this.performUpdate(); @@ -230,25 +230,25 @@ var b = class extends HTMLElement { if (!this.isUpdatePending) return; if (!this.hasUpdated) { if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) { - for (const [t4, s3] of this._$Ep) this[t4] = s3; + for (const [t5, s3] of this._$Ep) this[t5] = s3; this._$Ep = void 0; } - const t3 = this.constructor.elementProperties; - if (t3.size > 0) for (const [s3, i3] of t3) true !== i3.wrapped || this._$AL.has(s3) || void 0 === this[s3] || this.P(s3, this[s3], i3); + const t4 = this.constructor.elementProperties; + if (t4.size > 0) for (const [s3, i4] of t4) true !== i4.wrapped || this._$AL.has(s3) || void 0 === this[s3] || this.P(s3, this[s3], i4); } - let t2 = false; + let t3 = false; const s2 = this._$AL; try { - t2 = this.shouldUpdate(s2), t2 ? (this.willUpdate(s2), this._$EO?.forEach((t3) => t3.hostUpdate?.()), this.update(s2)) : this._$EU(); + t3 = this.shouldUpdate(s2), t3 ? (this.willUpdate(s2), this._$EO?.forEach((t4) => t4.hostUpdate?.()), this.update(s2)) : this._$EU(); } catch (s3) { - throw t2 = false, this._$EU(), s3; + throw t3 = false, this._$EU(), s3; } - t2 && this._$AE(s2); + t3 && this._$AE(s2); } - willUpdate(t2) { + willUpdate(t3) { } - _$AE(t2) { - this._$EO?.forEach((t3) => t3.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t2)), this.updated(t2); + _$AE(t3) { + this._$EO?.forEach((t4) => t4.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t3)), this.updated(t3); } _$EU() { this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = false; @@ -259,15 +259,15 @@ var b = class extends HTMLElement { getUpdateComplete() { return this._$ES; } - shouldUpdate(t2) { + shouldUpdate(t3) { return true; } - update(t2) { - this._$Ej &&= this._$Ej.forEach((t3) => this._$EC(t3, this[t3])), this._$EU(); + update(t3) { + this._$Ej &&= this._$Ej.forEach((t4) => this._$EC(t4, this[t4])), this._$EU(); } - updated(t2) { + updated(t3) { } - firstUpdated(t2) { + firstUpdated(t3) { } }; b.elementStyles = [], b.shadowRootOptions = { mode: "open" }, b[d("elementProperties")] = /* @__PURE__ */ new Map(), b[d("finalized")] = /* @__PURE__ */ new Map(), p?.({ ReactiveElement: b }), (a.reactiveElementVersions ??= []).push("2.0.4"); @@ -275,26 +275,26 @@ b.elementStyles = [], b.shadowRootOptions = { mode: "open" }, b[d("elementProper // node_modules/lit-html/lit-html.js var n3 = globalThis; var c3 = n3.trustedTypes; -var h2 = c3 ? c3.createPolicy("lit-html", { createHTML: (t2) => t2 }) : void 0; +var h2 = c3 ? c3.createPolicy("lit-html", { createHTML: (t3) => t3 }) : void 0; var f2 = "$lit$"; var v = `lit$${Math.random().toFixed(9).slice(2)}$`; var m = "?" + v; var _ = `<${m}>`; var w = document; var lt = () => w.createComment(""); -var st = (t2) => null === t2 || "object" != typeof t2 && "function" != typeof t2; +var st = (t3) => null === t3 || "object" != typeof t3 && "function" != typeof t3; var g = Array.isArray; -var $ = (t2) => g(t2) || "function" == typeof t2?.[Symbol.iterator]; +var $ = (t3) => g(t3) || "function" == typeof t3?.[Symbol.iterator]; var x = "[ \n\f\r]"; var T = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g; var E = /-->/g; var k = />/g; -var O = RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ +var O = RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`, "g"); var S2 = /'/g; var j = /"/g; var M = /^(?:script|style|textarea|title)$/i; -var P = (t2) => (i3, ...s2) => ({ _$litType$: t2, strings: i3, values: s2 }); +var P = (t3) => (i4, ...s2) => ({ _$litType$: t3, strings: i4, values: s2 }); var ke = P(1); var Oe = P(2); var Se = P(3); @@ -302,68 +302,68 @@ var R = Symbol.for("lit-noChange"); var D = Symbol.for("lit-nothing"); var V = /* @__PURE__ */ new WeakMap(); var I = w.createTreeWalker(w, 129); -function N(t2, i3) { - if (!g(t2) || !t2.hasOwnProperty("raw")) throw Error("invalid template strings array"); - return void 0 !== h2 ? h2.createHTML(i3) : i3; +function N(t3, i4) { + if (!g(t3) || !t3.hasOwnProperty("raw")) throw Error("invalid template strings array"); + return void 0 !== h2 ? h2.createHTML(i4) : i4; } -var U = (t2, i3) => { - const s2 = t2.length - 1, e4 = []; - let h4, o4 = 2 === i3 ? "" : 3 === i3 ? "" : "", n5 = T; - for (let i4 = 0; i4 < s2; i4++) { - const s3 = t2[i4]; +var U = (t3, i4) => { + const s2 = t3.length - 1, e5 = []; + let h4, o4 = 2 === i4 ? "" : 3 === i4 ? "" : "", n5 = T; + for (let i5 = 0; i5 < s2; i5++) { + const s3 = t3[i5]; let r4, l2, c4 = -1, a2 = 0; for (; a2 < s3.length && (n5.lastIndex = a2, l2 = n5.exec(s3), null !== l2); ) a2 = n5.lastIndex, n5 === T ? "!--" === l2[1] ? n5 = E : void 0 !== l2[1] ? n5 = k : void 0 !== l2[2] ? (M.test(l2[2]) && (h4 = RegExp("" === l2[0] ? (n5 = h4 ?? T, c4 = -1) : void 0 === l2[1] ? c4 = -2 : (c4 = n5.lastIndex - l2[2].length, r4 = l2[1], n5 = void 0 === l2[3] ? O : '"' === l2[3] ? j : S2) : n5 === j || n5 === S2 ? n5 = O : n5 === E || n5 === k ? n5 = T : (n5 = O, h4 = void 0); - const u2 = n5 === O && t2[i4 + 1].startsWith("/>") ? " " : ""; - o4 += n5 === T ? s3 + _ : c4 >= 0 ? (e4.push(r4), s3.slice(0, c4) + f2 + s3.slice(c4) + v + u2) : s3 + v + (-2 === c4 ? i4 : u2); + const u2 = n5 === O && t3[i5 + 1].startsWith("/>") ? " " : ""; + o4 += n5 === T ? s3 + _ : c4 >= 0 ? (e5.push(r4), s3.slice(0, c4) + f2 + s3.slice(c4) + v + u2) : s3 + v + (-2 === c4 ? i5 : u2); } - return [N(t2, o4 + (t2[s2] || "") + (2 === i3 ? "" : 3 === i3 ? "" : "")), e4]; + return [N(t3, o4 + (t3[s2] || "") + (2 === i4 ? "" : 3 === i4 ? "" : "")), e5]; }; var B = class _B { - constructor({ strings: t2, _$litType$: i3 }, s2) { - let e4; + constructor({ strings: t3, _$litType$: i4 }, s2) { + let e5; this.parts = []; let h4 = 0, o4 = 0; - const n5 = t2.length - 1, r4 = this.parts, [l2, a2] = U(t2, i3); - if (this.el = _B.createElement(l2, s2), I.currentNode = this.el.content, 2 === i3 || 3 === i3) { - const t3 = this.el.content.firstChild; - t3.replaceWith(...t3.childNodes); + const n5 = t3.length - 1, r4 = this.parts, [l2, a2] = U(t3, i4); + if (this.el = _B.createElement(l2, s2), I.currentNode = this.el.content, 2 === i4 || 3 === i4) { + const t4 = this.el.content.firstChild; + t4.replaceWith(...t4.childNodes); } - for (; null !== (e4 = I.nextNode()) && r4.length < n5; ) { - if (1 === e4.nodeType) { - if (e4.hasAttributes()) for (const t3 of e4.getAttributeNames()) if (t3.endsWith(f2)) { - const i4 = a2[o4++], s3 = e4.getAttribute(t3).split(v), n6 = /([.?@])?(.*)/.exec(i4); - r4.push({ type: 1, index: h4, name: n6[2], strings: s3, ctor: "." === n6[1] ? Y : "?" === n6[1] ? Z : "@" === n6[1] ? q : G }), e4.removeAttribute(t3); - } else t3.startsWith(v) && (r4.push({ type: 6, index: h4 }), e4.removeAttribute(t3)); - if (M.test(e4.tagName)) { - const t3 = e4.textContent.split(v), i4 = t3.length - 1; - if (i4 > 0) { - e4.textContent = c3 ? c3.emptyScript : ""; - for (let s3 = 0; s3 < i4; s3++) e4.append(t3[s3], lt()), I.nextNode(), r4.push({ type: 2, index: ++h4 }); - e4.append(t3[i4], lt()); + for (; null !== (e5 = I.nextNode()) && r4.length < n5; ) { + if (1 === e5.nodeType) { + if (e5.hasAttributes()) for (const t4 of e5.getAttributeNames()) if (t4.endsWith(f2)) { + const i5 = a2[o4++], s3 = e5.getAttribute(t4).split(v), n6 = /([.?@])?(.*)/.exec(i5); + r4.push({ type: 1, index: h4, name: n6[2], strings: s3, ctor: "." === n6[1] ? Y : "?" === n6[1] ? Z : "@" === n6[1] ? q : G }), e5.removeAttribute(t4); + } else t4.startsWith(v) && (r4.push({ type: 6, index: h4 }), e5.removeAttribute(t4)); + if (M.test(e5.tagName)) { + const t4 = e5.textContent.split(v), i5 = t4.length - 1; + if (i5 > 0) { + e5.textContent = c3 ? c3.emptyScript : ""; + for (let s3 = 0; s3 < i5; s3++) e5.append(t4[s3], lt()), I.nextNode(), r4.push({ type: 2, index: ++h4 }); + e5.append(t4[i5], lt()); } } - } else if (8 === e4.nodeType) if (e4.data === m) r4.push({ type: 2, index: h4 }); + } else if (8 === e5.nodeType) if (e5.data === m) r4.push({ type: 2, index: h4 }); else { - let t3 = -1; - for (; -1 !== (t3 = e4.data.indexOf(v, t3 + 1)); ) r4.push({ type: 7, index: h4 }), t3 += v.length - 1; + let t4 = -1; + for (; -1 !== (t4 = e5.data.indexOf(v, t4 + 1)); ) r4.push({ type: 7, index: h4 }), t4 += v.length - 1; } h4++; } } - static createElement(t2, i3) { + static createElement(t3, i4) { const s2 = w.createElement("template"); - return s2.innerHTML = t2, s2; + return s2.innerHTML = t3, s2; } }; -function z(t2, i3, s2 = t2, e4) { - if (i3 === R) return i3; - let h4 = void 0 !== e4 ? s2.o?.[e4] : s2.l; - const o4 = st(i3) ? void 0 : i3._$litDirective$; - return h4?.constructor !== o4 && (h4?._$AO?.(false), void 0 === o4 ? h4 = void 0 : (h4 = new o4(t2), h4._$AT(t2, s2, e4)), void 0 !== e4 ? (s2.o ??= [])[e4] = h4 : s2.l = h4), void 0 !== h4 && (i3 = z(t2, h4._$AS(t2, i3.values), h4, e4)), i3; +function z(t3, i4, s2 = t3, e5) { + if (i4 === R) return i4; + let h4 = void 0 !== e5 ? s2.o?.[e5] : s2.l; + const o4 = st(i4) ? void 0 : i4._$litDirective$; + return h4?.constructor !== o4 && (h4?._$AO?.(false), void 0 === o4 ? h4 = void 0 : (h4 = new o4(t3), h4._$AT(t3, s2, e5)), void 0 !== e5 ? (s2.o ??= [])[e5] = h4 : s2.l = h4), void 0 !== h4 && (i4 = z(t3, h4._$AS(t3, i4.values), h4, e5)), i4; } var F = class { - constructor(t2, i3) { - this._$AV = [], this._$AN = void 0, this._$AD = t2, this._$AM = i3; + constructor(t3, i4) { + this._$AV = [], this._$AN = void 0, this._$AD = t3, this._$AM = i4; } get parentNode() { return this._$AM.parentNode; @@ -371,35 +371,35 @@ var F = class { get _$AU() { return this._$AM._$AU; } - u(t2) { - const { el: { content: i3 }, parts: s2 } = this._$AD, e4 = (t2?.creationScope ?? w).importNode(i3, true); - I.currentNode = e4; + u(t3) { + const { el: { content: i4 }, parts: s2 } = this._$AD, e5 = (t3?.creationScope ?? w).importNode(i4, true); + I.currentNode = e5; let h4 = I.nextNode(), o4 = 0, n5 = 0, r4 = s2[0]; for (; void 0 !== r4; ) { if (o4 === r4.index) { - let i4; - 2 === r4.type ? i4 = new et(h4, h4.nextSibling, this, t2) : 1 === r4.type ? i4 = new r4.ctor(h4, r4.name, r4.strings, this, t2) : 6 === r4.type && (i4 = new K(h4, this, t2)), this._$AV.push(i4), r4 = s2[++n5]; + let i5; + 2 === r4.type ? i5 = new et(h4, h4.nextSibling, this, t3) : 1 === r4.type ? i5 = new r4.ctor(h4, r4.name, r4.strings, this, t3) : 6 === r4.type && (i5 = new K(h4, this, t3)), this._$AV.push(i5), r4 = s2[++n5]; } o4 !== r4?.index && (h4 = I.nextNode(), o4++); } - return I.currentNode = w, e4; + return I.currentNode = w, e5; } - p(t2) { - let i3 = 0; - for (const s2 of this._$AV) void 0 !== s2 && (void 0 !== s2.strings ? (s2._$AI(t2, s2, i3), i3 += s2.strings.length - 2) : s2._$AI(t2[i3])), i3++; + p(t3) { + let i4 = 0; + for (const s2 of this._$AV) void 0 !== s2 && (void 0 !== s2.strings ? (s2._$AI(t3, s2, i4), i4 += s2.strings.length - 2) : s2._$AI(t3[i4])), i4++; } }; var et = class _et { get _$AU() { return this._$AM?._$AU ?? this.v; } - constructor(t2, i3, s2, e4) { - this.type = 2, this._$AH = D, this._$AN = void 0, this._$AA = t2, this._$AB = i3, this._$AM = s2, this.options = e4, this.v = e4?.isConnected ?? true; + constructor(t3, i4, s2, e5) { + this.type = 2, this._$AH = D, this._$AN = void 0, this._$AA = t3, this._$AB = i4, this._$AM = s2, this.options = e5, this.v = e5?.isConnected ?? true; } get parentNode() { - let t2 = this._$AA.parentNode; - const i3 = this._$AM; - return void 0 !== i3 && 11 === t2?.nodeType && (t2 = i3.parentNode), t2; + let t3 = this._$AA.parentNode; + const i4 = this._$AM; + return void 0 !== i4 && 11 === t3?.nodeType && (t3 = i4.parentNode), t3; } get startNode() { return this._$AA; @@ -407,45 +407,45 @@ var et = class _et { get endNode() { return this._$AB; } - _$AI(t2, i3 = this) { - t2 = z(this, t2, i3), st(t2) ? t2 === D || null == t2 || "" === t2 ? (this._$AH !== D && this._$AR(), this._$AH = D) : t2 !== this._$AH && t2 !== R && this._(t2) : void 0 !== t2._$litType$ ? this.$(t2) : void 0 !== t2.nodeType ? this.T(t2) : $(t2) ? this.k(t2) : this._(t2); + _$AI(t3, i4 = this) { + t3 = z(this, t3, i4), st(t3) ? t3 === D || null == t3 || "" === t3 ? (this._$AH !== D && this._$AR(), this._$AH = D) : t3 !== this._$AH && t3 !== R && this._(t3) : void 0 !== t3._$litType$ ? this.$(t3) : void 0 !== t3.nodeType ? this.T(t3) : $(t3) ? this.k(t3) : this._(t3); } - O(t2) { - return this._$AA.parentNode.insertBefore(t2, this._$AB); + O(t3) { + return this._$AA.parentNode.insertBefore(t3, this._$AB); } - T(t2) { - this._$AH !== t2 && (this._$AR(), this._$AH = this.O(t2)); + T(t3) { + this._$AH !== t3 && (this._$AR(), this._$AH = this.O(t3)); } - _(t2) { - this._$AH !== D && st(this._$AH) ? this._$AA.nextSibling.data = t2 : this.T(w.createTextNode(t2)), this._$AH = t2; + _(t3) { + this._$AH !== D && st(this._$AH) ? this._$AA.nextSibling.data = t3 : this.T(w.createTextNode(t3)), this._$AH = t3; } - $(t2) { - const { values: i3, _$litType$: s2 } = t2, e4 = "number" == typeof s2 ? this._$AC(t2) : (void 0 === s2.el && (s2.el = B.createElement(N(s2.h, s2.h[0]), this.options)), s2); - if (this._$AH?._$AD === e4) this._$AH.p(i3); + $(t3) { + const { values: i4, _$litType$: s2 } = t3, e5 = "number" == typeof s2 ? this._$AC(t3) : (void 0 === s2.el && (s2.el = B.createElement(N(s2.h, s2.h[0]), this.options)), s2); + if (this._$AH?._$AD === e5) this._$AH.p(i4); else { - const t3 = new F(e4, this), s3 = t3.u(this.options); - t3.p(i3), this.T(s3), this._$AH = t3; + const t4 = new F(e5, this), s3 = t4.u(this.options); + t4.p(i4), this.T(s3), this._$AH = t4; } } - _$AC(t2) { - let i3 = V.get(t2.strings); - return void 0 === i3 && V.set(t2.strings, i3 = new B(t2)), i3; + _$AC(t3) { + let i4 = V.get(t3.strings); + return void 0 === i4 && V.set(t3.strings, i4 = new B(t3)), i4; } - k(t2) { + k(t3) { g(this._$AH) || (this._$AH = [], this._$AR()); - const i3 = this._$AH; - let s2, e4 = 0; - for (const h4 of t2) e4 === i3.length ? i3.push(s2 = new _et(this.O(lt()), this.O(lt()), this, this.options)) : s2 = i3[e4], s2._$AI(h4), e4++; - e4 < i3.length && (this._$AR(s2 && s2._$AB.nextSibling, e4), i3.length = e4); - } - _$AR(t2 = this._$AA.nextSibling, i3) { - for (this._$AP?.(false, true, i3); t2 && t2 !== this._$AB; ) { - const i4 = t2.nextSibling; - t2.remove(), t2 = i4; + const i4 = this._$AH; + let s2, e5 = 0; + for (const h4 of t3) e5 === i4.length ? i4.push(s2 = new _et(this.O(lt()), this.O(lt()), this, this.options)) : s2 = i4[e5], s2._$AI(h4), e5++; + e5 < i4.length && (this._$AR(s2 && s2._$AB.nextSibling, e5), i4.length = e5); + } + _$AR(t3 = this._$AA.nextSibling, i4) { + for (this._$AP?.(false, true, i4); t3 && t3 !== this._$AB; ) { + const i5 = t3.nextSibling; + t3.remove(), t3 = i5; } } - setConnected(t2) { - void 0 === this._$AM && (this.v = t2, this._$AP?.(t2)); + setConnected(t3) { + void 0 === this._$AM && (this.v = t3, this._$AP?.(t3)); } }; var G = class { @@ -455,74 +455,74 @@ var G = class { get _$AU() { return this._$AM._$AU; } - constructor(t2, i3, s2, e4, h4) { - this.type = 1, this._$AH = D, this._$AN = void 0, this.element = t2, this.name = i3, this._$AM = e4, this.options = h4, s2.length > 2 || "" !== s2[0] || "" !== s2[1] ? (this._$AH = Array(s2.length - 1).fill(new String()), this.strings = s2) : this._$AH = D; + constructor(t3, i4, s2, e5, h4) { + this.type = 1, this._$AH = D, this._$AN = void 0, this.element = t3, this.name = i4, this._$AM = e5, this.options = h4, s2.length > 2 || "" !== s2[0] || "" !== s2[1] ? (this._$AH = Array(s2.length - 1).fill(new String()), this.strings = s2) : this._$AH = D; } - _$AI(t2, i3 = this, s2, e4) { + _$AI(t3, i4 = this, s2, e5) { const h4 = this.strings; let o4 = false; - if (void 0 === h4) t2 = z(this, t2, i3, 0), o4 = !st(t2) || t2 !== this._$AH && t2 !== R, o4 && (this._$AH = t2); + if (void 0 === h4) t3 = z(this, t3, i4, 0), o4 = !st(t3) || t3 !== this._$AH && t3 !== R, o4 && (this._$AH = t3); else { - const e5 = t2; + const e6 = t3; let n5, r4; - for (t2 = h4[0], n5 = 0; n5 < h4.length - 1; n5++) r4 = z(this, e5[s2 + n5], i3, n5), r4 === R && (r4 = this._$AH[n5]), o4 ||= !st(r4) || r4 !== this._$AH[n5], r4 === D ? t2 = D : t2 !== D && (t2 += (r4 ?? "") + h4[n5 + 1]), this._$AH[n5] = r4; + for (t3 = h4[0], n5 = 0; n5 < h4.length - 1; n5++) r4 = z(this, e6[s2 + n5], i4, n5), r4 === R && (r4 = this._$AH[n5]), o4 ||= !st(r4) || r4 !== this._$AH[n5], r4 === D ? t3 = D : t3 !== D && (t3 += (r4 ?? "") + h4[n5 + 1]), this._$AH[n5] = r4; } - o4 && !e4 && this.j(t2); + o4 && !e5 && this.j(t3); } - j(t2) { - t2 === D ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t2 ?? ""); + j(t3) { + t3 === D ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t3 ?? ""); } }; var Y = class extends G { constructor() { super(...arguments), this.type = 3; } - j(t2) { - this.element[this.name] = t2 === D ? void 0 : t2; + j(t3) { + this.element[this.name] = t3 === D ? void 0 : t3; } }; var Z = class extends G { constructor() { super(...arguments), this.type = 4; } - j(t2) { - this.element.toggleAttribute(this.name, !!t2 && t2 !== D); + j(t3) { + this.element.toggleAttribute(this.name, !!t3 && t3 !== D); } }; var q = class extends G { - constructor(t2, i3, s2, e4, h4) { - super(t2, i3, s2, e4, h4), this.type = 5; + constructor(t3, i4, s2, e5, h4) { + super(t3, i4, s2, e5, h4), this.type = 5; } - _$AI(t2, i3 = this) { - if ((t2 = z(this, t2, i3, 0) ?? D) === R) return; - const s2 = this._$AH, e4 = t2 === D && s2 !== D || t2.capture !== s2.capture || t2.once !== s2.once || t2.passive !== s2.passive, h4 = t2 !== D && (s2 === D || e4); - e4 && this.element.removeEventListener(this.name, this, s2), h4 && this.element.addEventListener(this.name, this, t2), this._$AH = t2; + _$AI(t3, i4 = this) { + if ((t3 = z(this, t3, i4, 0) ?? D) === R) return; + const s2 = this._$AH, e5 = t3 === D && s2 !== D || t3.capture !== s2.capture || t3.once !== s2.once || t3.passive !== s2.passive, h4 = t3 !== D && (s2 === D || e5); + e5 && this.element.removeEventListener(this.name, this, s2), h4 && this.element.addEventListener(this.name, this, t3), this._$AH = t3; } - handleEvent(t2) { - "function" == typeof this._$AH ? this._$AH.call(this.options?.host ?? this.element, t2) : this._$AH.handleEvent(t2); + handleEvent(t3) { + "function" == typeof this._$AH ? this._$AH.call(this.options?.host ?? this.element, t3) : this._$AH.handleEvent(t3); } }; var K = class { - constructor(t2, i3, s2) { - this.element = t2, this.type = 6, this._$AN = void 0, this._$AM = i3, this.options = s2; + constructor(t3, i4, s2) { + this.element = t3, this.type = 6, this._$AN = void 0, this._$AM = i4, this.options = s2; } get _$AU() { return this._$AM._$AU; } - _$AI(t2) { - z(this, t2); + _$AI(t3) { + z(this, t3); } }; var Re = n3.litHtmlPolyfillSupport; Re?.(B, et), (n3.litHtmlVersions ??= []).push("3.2.0"); -var Q = (t2, i3, s2) => { - const e4 = s2?.renderBefore ?? i3; - let h4 = e4._$litPart$; +var Q = (t3, i4, s2) => { + const e5 = s2?.renderBefore ?? i4; + let h4 = e5._$litPart$; if (void 0 === h4) { - const t3 = s2?.renderBefore ?? null; - e4._$litPart$ = h4 = new et(i3.insertBefore(lt(), t3), t3, void 0, s2 ?? {}); + const t4 = s2?.renderBefore ?? null; + e5._$litPart$ = h4 = new et(i4.insertBefore(lt(), t4), t4, void 0, s2 ?? {}); } - return h4._$AI(t2), h4; + return h4._$AI(t3), h4; }; // node_modules/lit-element/lit-element.js @@ -531,12 +531,12 @@ var h3 = class extends b { super(...arguments), this.renderOptions = { host: this }, this.o = void 0; } createRenderRoot() { - const t2 = super.createRenderRoot(); - return this.renderOptions.renderBefore ??= t2.firstChild, t2; + const t3 = super.createRenderRoot(); + return this.renderOptions.renderBefore ??= t3.firstChild, t3; } - update(t2) { - const e4 = this.render(); - this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t2), this.o = Q(e4, this.renderRoot, this.renderOptions); + update(t3) { + const e5 = this.render(); + this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t3), this.o = Q(e5, this.renderRoot, this.renderOptions); } connectedCallback() { super.connectedCallback(), this.o?.setConnected(true); @@ -555,34 +555,78 @@ f3?.({ LitElement: h3 }); // node_modules/@lit/reactive-element/decorators/property.js var o3 = { attribute: true, type: String, converter: u, reflect: false, hasChanged: f }; -var r3 = (t2 = o3, e4, r4) => { - const { kind: n5, metadata: i3 } = r4; - let s2 = globalThis.litPropertyMetadata.get(i3); - if (void 0 === s2 && globalThis.litPropertyMetadata.set(i3, s2 = /* @__PURE__ */ new Map()), s2.set(r4.name, t2), "accessor" === n5) { +var r3 = (t3 = o3, e5, r4) => { + const { kind: n5, metadata: i4 } = r4; + let s2 = globalThis.litPropertyMetadata.get(i4); + if (void 0 === s2 && globalThis.litPropertyMetadata.set(i4, s2 = /* @__PURE__ */ new Map()), s2.set(r4.name, t3), "accessor" === n5) { const { name: o4 } = r4; return { set(r5) { - const n6 = e4.get.call(this); - e4.set.call(this, r5), this.requestUpdate(o4, n6, t2); - }, init(e5) { - return void 0 !== e5 && this.P(o4, void 0, t2), e5; + const n6 = e5.get.call(this); + e5.set.call(this, r5), this.requestUpdate(o4, n6, t3); + }, init(e6) { + return void 0 !== e6 && this.P(o4, void 0, t3), e6; } }; } if ("setter" === n5) { const { name: o4 } = r4; return function(r5) { const n6 = this[o4]; - e4.call(this, r5), this.requestUpdate(o4, n6, t2); + e5.call(this, r5), this.requestUpdate(o4, n6, t3); }; } throw Error("Unsupported decorator location: " + n5); }; -function n4(t2) { - return (e4, o4) => "object" == typeof o4 ? r3(t2, e4, o4) : ((t3, e5, o5) => { - const r4 = e5.hasOwnProperty(o5); - return e5.constructor.createProperty(o5, r4 ? { ...t3, wrapped: true } : t3), r4 ? Object.getOwnPropertyDescriptor(e5, o5) : void 0; - })(t2, e4, o4); +function n4(t3) { + return (e5, o4) => "object" == typeof o4 ? r3(t3, e5, o4) : ((t4, e6, o5) => { + const r4 = e6.hasOwnProperty(o5); + return e6.constructor.createProperty(o5, r4 ? { ...t4, wrapped: true } : t4), r4 ? Object.getOwnPropertyDescriptor(e6, o5) : void 0; + })(t3, e5, o4); } +// node_modules/lit-html/directive.js +var t2 = { ATTRIBUTE: 1, CHILD: 2, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4, EVENT: 5, ELEMENT: 6 }; +var e4 = (t3) => (...e5) => ({ _$litDirective$: t3, values: e5 }); +var i3 = class { + constructor(t3) { + } + get _$AU() { + return this._$AM._$AU; + } + _$AT(t3, e5, i4) { + this.t = t3, this._$AM = e5, this.i = i4; + } + _$AS(t3, e5) { + return this.update(t3, e5); + } + update(t3, e5) { + return this.render(...e5); + } +}; + +// node_modules/lit-html/directives/class-map.js +var Rt = e4(class extends i3 { + constructor(s2) { + if (super(s2), s2.type !== t2.ATTRIBUTE || "class" !== s2.name || s2.strings?.length > 2) throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute."); + } + render(t3) { + return " " + Object.keys(t3).filter((s2) => t3[s2]).join(" ") + " "; + } + update(t3, [s2]) { + if (void 0 === this.st) { + this.st = /* @__PURE__ */ new Set(), void 0 !== t3.strings && (this.nt = new Set(t3.strings.join(" ").split(/\s/).filter((t4) => "" !== t4))); + for (const t4 in s2) s2[t4] && !this.nt?.has(t4) && this.st.add(t4); + return this.render(s2); + } + const i4 = t3.element.classList; + for (const t4 of this.st) t4 in s2 || (i4.remove(t4), this.st.delete(t4)); + for (const t4 in s2) { + const r4 = !!s2[t4]; + r4 === this.st.has(t4) || this.nt?.has(t4) || (r4 ? (i4.add(t4), this.st.add(t4)) : (i4.remove(t4), this.st.delete(t4))); + } + return R; + } +}); + // js/ipywidgets_styles.ts var legacyStyles = i` .legacy-button { @@ -683,7 +727,7 @@ var _LayerManagerRow = class _LayerManagerRow extends h3 { this._model = void 0; this.name = ""; this.visible = true; - this.opacity = 0; + this.opacity = 1; this.isLoading = false; this.isConfirmDialogVisible = false; } @@ -811,7 +855,12 @@ var _LayerManagerRow = class _LayerManagerRow extends h3 { - -
- ${this.renderConfirmDialog()} - `; - } - renderConfirmDialog() { - if (!this.isConfirmDialogVisible) { - return D; - } - return ke` -
- Remove layer? - - -
- `; - } - updated(changedProperties) { - for (const [property, _2] of changedProperties) { - this._model?.set(property, this[property]); - } - this._model?.save_changes(); - } - onLayerVisibilityChanged(event) { - const target = event.target; - this.visible = target.checked; - } - onLayerOpacityChanged(event) { - const target = event.target; - this.opacity = parseFloat(target.value); - } - onSettingsClicked(_2) { - this._model?.send({ "type": "click", "id": "settings" }); - } - onDeleteClicked(_2) { - this.isConfirmDialogVisible = true; - } - confirmDeletion(_2) { - this._model?.send({ "type": "click", "id": "delete" }); - } - cancelDeletion(_2) { - this.isConfirmDialogVisible = false; - } -}; -__decorateClass([ - n4() -], _LayerManagerRow.prototype, "name", 2); -__decorateClass([ - n4() -], _LayerManagerRow.prototype, "visible", 2); -__decorateClass([ - n4() -], _LayerManagerRow.prototype, "opacity", 2); -__decorateClass([ - n4() -], _LayerManagerRow.prototype, "isLoading", 2); -__decorateClass([ - n4() -], _LayerManagerRow.prototype, "isConfirmDialogVisible", 2); -var LayerManagerRow = _LayerManagerRow; -if (!customElements.get(LayerManagerRow.componentName)) { - customElements.define(LayerManagerRow.componentName, LayerManagerRow); -} -function render({ model, el }) { - loadFonts(); - const row = document.createElement(LayerManagerRow.componentName); - row.model = model; - el.appendChild(row); -} -var layer_manager_row_default = { render }; -export { - LayerManagerRow, - layer_manager_row_default as default -}; -/*! Bundled license information: - -@lit/reactive-element/css-tag.js: - (** - * @license - * Copyright 2019 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - *) - -@lit/reactive-element/reactive-element.js: - (** - * @license - * Copyright 2017 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - *) - -lit-html/lit-html.js: - (** - * @license - * Copyright 2017 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - *) - -lit-element/lit-element.js: - (** - * @license - * Copyright 2017 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - *) - -lit-html/is-server.js: - (** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - *) - -@lit/reactive-element/decorators/custom-element.js: - (** - * @license - * Copyright 2017 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - *) - -@lit/reactive-element/decorators/property.js: - (** - * @license - * Copyright 2017 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - *) - -@lit/reactive-element/decorators/state.js: - (** - * @license - * Copyright 2017 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - *) - -@lit/reactive-element/decorators/event-options.js: - (** - * @license - * Copyright 2017 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - *) - -@lit/reactive-element/decorators/base.js: - (** - * @license - * Copyright 2017 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - *) - -@lit/reactive-element/decorators/query.js: - (** - * @license - * Copyright 2017 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - *) - -@lit/reactive-element/decorators/query-all.js: - (** - * @license - * Copyright 2017 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - *) - -@lit/reactive-element/decorators/query-async.js: - (** - * @license - * Copyright 2017 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - *) - -@lit/reactive-element/decorators/query-assigned-elements.js: - (** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - *) - -@lit/reactive-element/decorators/query-assigned-nodes.js: - (** - * @license - * Copyright 2017 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - *) - -lit-html/directive.js: - (** - * @license - * Copyright 2017 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - *) - -lit-html/directives/class-map.js: - (** - * @license - * Copyright 2018 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - *) -*/ -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vbm9kZV9tb2R1bGVzL0BsaXQvcmVhY3RpdmUtZWxlbWVudC9zcmMvY3NzLXRhZy50cyIsICIuLi8uLi9ub2RlX21vZHVsZXMvQGxpdC9yZWFjdGl2ZS1lbGVtZW50L3NyYy9yZWFjdGl2ZS1lbGVtZW50LnRzIiwgIi4uLy4uL25vZGVfbW9kdWxlcy9saXQtaHRtbC9zcmMvbGl0LWh0bWwudHMiLCAiLi4vLi4vbm9kZV9tb2R1bGVzL2xpdC1lbGVtZW50L3NyYy9saXQtZWxlbWVudC50cyIsICIuLi8uLi9ub2RlX21vZHVsZXMvQGxpdC9yZWFjdGl2ZS1lbGVtZW50L3NyYy9kZWNvcmF0b3JzL3Byb3BlcnR5LnRzIiwgIi4uLy4uL25vZGVfbW9kdWxlcy9saXQtaHRtbC9zcmMvZGlyZWN0aXZlLnRzIiwgIi4uLy4uL25vZGVfbW9kdWxlcy9saXQtaHRtbC9zcmMvZGlyZWN0aXZlcy9jbGFzcy1tYXAudHMiLCAiLi4vLi4vanMvaXB5d2lkZ2V0c19zdHlsZXMudHMiLCAiLi4vLi4vanMvbWF0ZXJpYWxfc3R5bGVzLnRzIiwgIi4uLy4uL2pzL3V0aWxzLnRzIiwgIi4uLy4uL2pzL2xheWVyX21hbmFnZXJfcm93LnRzIl0sCi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luZ0luZGV4LCBhbmQgaXQnbGwgYmUgb2ZmIGJ5IDEgaW4gdGhlIGVsZW1lbnRcbiAgICAgICAgLy8gYW5kIG9mZiBieSB0d28gYWZ0ZXIgaXQuXG4gICAgICAgIGlmICgobm9kZSBhcyBFbGVtZW50KS5oYXNBdHRyaWJ1dGVzKCkpIHtcbiAgICAgICAgICBmb3IgKGNvbnN0IG5hbWUgb2YgKG5vZGUgYXMgRWxlbWVudCkuZ2V0QXR0cmlidXRlTmFtZXMoKSkge1xuICAgICAgICAgICAgaWYgKG5hbWUuZW5kc1dpdGgoYm91bmRBdHRyaWJ1dGVTdWZmaXgpKSB7XG4gICAgICAgICAgICAgIGNvbnN0IHJlYWxOYW1lID0gYXR0ck5hbWVzW2F0dHJOYW1lSW5kZXgrK107XG4gICAgICAgICAgICAgIGNvbnN0IHZhbHVlID0gKG5vZGUgYXMgRWxlbWVudCkuZ2V0QXR0cmlidXRlKG5hbWUpITtcbiAgICAgICAgICAgICAgY29uc3Qgc3RhdGljcyA9IHZhbHVlLnNwbGl0KG1hcmtlcik7XG4gICAgICAgICAgICAgIGNvbnN0IG0gPSAvKFsuP0BdKT8oLiopLy5leGVjKHJlYWxOYW1lKSE7XG4gICAgICAgICAgICAgIHBhcnRzLnB1c2goe1xuICAgICAgICAgICAgICAgIHR5cGU6IEFUVFJJQlVURV9QQVJULFxuICAgICAgICAgICAgICAgIGluZGV4OiBub2RlSW5kZXgsXG4gICAgICAgICAgICAgICAgbmFtZTogbVsyXSxcbiAgICAgICAgICAgICAgICBzdHJpbmdzOiBzdGF0aWNzLFxuICAgICAgICAgICAgICAgIGN0b3I6XG4gICAgICAgICAgICAgICAgICBtWzFdID09PSAnLidcbiAgICAgICAgICAgICAgICAgICAgPyBQcm9wZXJ0eVBhcnRcbiAgICAgICAgICAgICAgICAgICAgOiBtWzFdID09PSAnPydcbiAgICAgICAgICAgICAgICAgICAgICA/IEJvb2xlYW5BdHRyaWJ1dGVQYXJ0XG4gICAgICAgICAgICAgICAgICAgICAgOiBtWzFdID09PSAnQCdcbiAgICAgICAgICAgICAgICAgICAgICAgID8gRXZlbnRQYXJ0XG4gICAgICAgICAgICAgICAgICAgICAgICA6IEF0dHJpYnV0ZVBhcnQsXG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAobm9kZSBhcyBFbGVtZW50KS5yZW1vdmVBdHRyaWJ1dGUobmFtZSk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG5hbWUuc3RhcnRzV2l0aChtYXJrZXIpKSB7XG4gICAgICAgICAgICAgIHBhcnRzLnB1c2goe1xuICAgICAgICAgICAgICAgIHR5cGU6IEVMRU1FTlRfUEFSVCxcbiAgICAgICAgICAgICAgICBpbmRleDogbm9kZUluZGV4LFxuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgKG5vZGUgYXMgRWxlbWVudCkucmVtb3ZlQXR0cmlidXRlKG5hbWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICAvLyBUT0RPIChqdXN0aW5mYWduYW5pKTogYmVuY2htYXJrIHRoZSByZWdleCBhZ2FpbnN0IHRlc3RpbmcgZm9yIGVhY2hcbiAgICAgICAgLy8gb2YgdGhlIDMgcmF3IHRleHQgZWxlbWVudCBuYW1lcy5cbiAgICAgICAgaWYgKHJhd1RleHRFbGVtZW50LnRlc3QoKG5vZGUgYXMgRWxlbWVudCkudGFnTmFtZSkpIHtcbiAgICAgICAgICAvLyBGb3IgcmF3IHRleHQgZWxlbWVudHMgd2UgbmVlZCB0byBzcGxpdCB0aGUgdGV4dCBjb250ZW50IG9uXG4gICAgICAgICAgLy8gbWFya2VycywgY3JlYXRlIGEgVGV4dCBub2RlIGZvciBlYWNoIHNlZ21lbnQsIGFuZCBjcmVhdGVcbiAgICAgICAgICAvLyBhIFRlbXBsYXRlUGFydCBmb3IgZWFjaCBtYXJrZXIuXG4gICAgICAgICAgY29uc3Qgc3RyaW5ncyA9IChub2RlI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G9hZGluZzogYm9vbGVhbjtcbn1cblxuZXhwb3J0IGNsYXNzIExheWVyTWFuYWdlclJvdyBleHRlbmRzIExpdEVsZW1lbnQge1xuICAgIHN0YXRpYyBnZXQgY29tcG9uZW50TmFtZSgpIHtcbiAgICAgICAgcmV0dXJuIGBsYXllci1tYW5hZ2VyLXJvd2A7XG4gICAgfVxuXG4gICAgc3RhdGljIHN0eWxlcyA9IFtcbiAgICAgICAgbGVnYWN5U3R5bGVzLFxuICAgICAgICBtYXRlcmlhbFN0eWxlcyxcbiAgICAgICAgY3NzYFxuICAgICAgICAgICAgLnJvdyB7XG4gICAgICAgICAgICAgICAgYWxpZ24taXRlbXM6IGNlbnRlcjtcbiAgICAgICAgICAgICAgICBkaXNwbGF5OiBmbGV4O1xuICAgICAgICAgICAgICAgIGdhcDogNHB4O1xuICAgICAgICAgICAgICAgIGhlaWdodDogMzBweDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLmxheWVyLW5hbWUge1xuICAgICAgICAgICAgICAgIGZsZXgtZ3JvdzogMTtcbiAgICAgICAgICAgICAgICBtYXgtd2lkdGg6IDE1MHB4O1xuICAgICAgICAgICAgICAgIG92ZXJmbG93OiBoaWRkZW47XG4gICAgICAgICAgICAgICAgdGV4dC1vdmVyZmxvdzogZWxsaXBzaXM7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC5zZXR0aW5ncy1kZWxldGUtYnV0dG9uIHtcbiAgICAgICAgICAgICAgICBmb250LXNpemU6IDE0cHg7XG4gICAgICAgICAgICAgICAgaGVpZ2h0OiAyNnB4O1xuICAgICAgICAgICAgICAgIHdpZHRoOiAyNnB4O1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAubGF5ZXItb3BhY2l0eS1zbGlkZXIge1xuICAgICAgICAgICAgICAgIHdpZHRoOiA3MHB4O1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAubGF5ZXItdmlzaWJpbGl0eS1jaGVja2JveCB7XG4gICAgICAgICAgICAgICAgbWFyZ2luOiAycHg7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC5zcGlubmVyIHtcbiAgICAgICAgICAgICAgICAtd2Via2l0LWFuaW1hdGlvbjogc3BpbiAycyBsaW5lYXIgaW5maW5pdGU7XG4gICAgICAgICAgICAgICAgYW5pbWF0aW9uOiBzcGluIDJzIGxpbmVhciBpbmZpbml0ZTtcbiAgICAgICAgICAgICAgICBib3JkZXItcmFkaXVzOiA1MCU7XG4gICAgICAgICAgICAgICAgYm9yZGVyOiA0cHggc29saWQgdmFyKC0tanAtd2lkZ2V0cy1pbnB1dC1ib3JkZXItY29sb3IpO1xuICAgICAgICAgICAgICAgIGJvcmRlci10b3A6IDRweCBzb2xpZCB2YXIoLS1qcC13aWRnZXRzLWNvbG9yKTtcbiAgICAgICAgICAgICAgICBoZWlnaHQ6IDEycHg7XG4gICAgICAgICAgICAgICAgd2lkdGg6IDEycHg7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIEAtd2Via2l0LWtleWZyYW1lcyBzcGluIHtcbiAgICAgICAgICAgICAgICAwJSB7IC13ZWJraXQtdHJhbnNmb3JtOiByb3RhdGUoMGRlZyk7IH1cbiAgICAgICAgICAgICAgICAxMDAlIHsgLXdlYmtpdC10cmFuc2Zvcm06IHJvdGF0ZSgzNjBkZWcpOyB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIEBrZXlmcmFtZXMgc3BpbiB7XG4gICAgICAgICAgICAgICAgMCUgeyB0cmFuc2Zvcm06IHJvdGF0ZSgwZGVnKTsgfVxuICAgICAgICAgICAgICAgIDEwMCUgeyB0cmFuc2Zvcm06IHJvdGF0ZSgzNjBkZWcpOyB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGJ1dHRvbi5sb2FkaW5nIC5zcGlubmVyLFxuICAgICAgICAgICAgYnV0dG9uLmxvYWRpbmc6aG92ZXIgLmNsb3NlLWljb24sXG4gICAgICAgICAgICBidXR0b24uZG9uZS1sb2FkaW5nIC5jbG9zZS1pY29uIHtcbiAgICAgICAgICAgICAgICBkaXNwbGF5OiBibG9jaztcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgYnV0dG9uLmxvYWRpbmcgLmNsb3NlLWljb24sXG4gICAgICAgICAgICBidXR0b24ubG9hZGluZzpob3ZlciAuc3Bpbm5lcixcbiAgICAgICAgICAgIGJ1dHRvbi5kb25lLWxvYWRpbmcgLnNwaW5uZXIge1xuICAgICAgICAgICAgICAgIGRpc3BsYXk6IG5vbmU7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC5yZW1vdmUtbGF5ZXItdGV4dCB7XG4gICAgICAgICAgICAgICAgZmxleC1ncm93OiAxO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAuY29uZmlybS1kZW55LWJ1dHRvbiB7XG4gICAgICAgICAgICAgICAgaGVpZ2h0OiAyNnB4O1xuICAgICAgICAgICAgICAgIHdpZHRoOiA3MHB4O1xuICAgICAgICAgICAgfVxuICAgICAgICBgLFxuICAgIF07XG5cbiAgICBwcml2YXRlIF9tb2RlbDogQW55TW9kZWw8TGF5ZXJNYW5hZ2VyUm93TW9kZWw+IHwgdW5kZWZpbmVkID0gdW5kZWZpbmVkO1xuICAgIHByaXZhdGUgc3RhdGljIG1vZGVsTmFtZVRvVmlld05hbWUgPSBuZXcgTWFwPGtleW9mIExheWVyTWFuYWdlclJvd01vZGVsLCBrZXlvZiBMYXllck1hbmFnZXJSb3cgfCBudWxsPihbXG4gICAgICAgIFtcIm5hbWVcIiwgXCJuYW1lXCJdLFxuICAgICAgICBbXCJ2aXNpYmxlXCIsIFwidmlzaWJsZVwiXSxcbiAgICAgICAgW1wib3BhY2l0eVwiLCBcIm9wYWNpdHlcIl0sXG4gICAgICAgIFtcImlzX2xvYWRpbmdcIiwgXCJpc0xvYWRpbmdcIl0sXG4gICAgXSk7XG5cbiAgICBzZXQgbW9kZWwobW9kZWw6IEFueU1vZGVsPExheW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AgICAgICAgICA8ZGl2IGNsYXNzPVwicm93XCI+XG4gICAgICAgICAgICAgICAgPGlucHV0XG4gICAgICAgICAgICAgICAgICAgIHR5cGU9XCJjaGVja2JveFwiXG4gICAgICAgICAgICAgICAgICAgIGNsYXNzPVwibGF5ZXItdmlzaWJpbGl0eS1jaGVja2JveFwiXG4gICAgICAgICAgICAgICAgICAgIC5jaGVja2VkPVwiJHt0aGlzLnZpc2libGV9XCJcbiAgICAgICAgICAgICAgICAgICAgQGNoYW5nZT1cIiR7dGhpcy5vbkxheWVyVmlzaWJpbGl0eUNoYW5nZWR9XCJcbiAgICAgICAgICAgICAgICAvPlxuICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwibGVnYWN5LXRleHQgbGF5ZXItbmFtZVwiPiR7dGhpcy5uYW1lfTwvc3Bhbj5cbiAgICAgICAgICAgICAgICA8aW5wdXRcbiAgICAgICAgICAgICAgICAgICAgdHlwZT1cInJhbmdlXCJcbiAgICAgICAgICAgICAgICAgICAgY2xhc3M9XCJsZWdhY3ktc2xpZGVyIGxheWVyLW9wYWNpdHktc2xpZGVyXCJcbiAgICAgICAgICAgICAgICAgICAgbWluPVwiMFwiXG4gICAgICAgICAgICAgICAgICAgIG1heD1cIjFcIlxuICAgICAgICAgICAgICAgICAgICBzdGVwPVwiMC4wMVwiXG4gICAgICAgICAgICAgICAgICAgIC52YWx1ZT1cIiR7dGhpcy5vcGFjaXR5fVwiXG4gICAgICAgICAgICAgICAgICAgIEBpbnB1dD1cIiR7dGhpcy5vbkxheWVyT3BhY2l0eUNoYW5nZWR9XCJcbiAgICAgICAgICAgICAgICAvPlxuICAgICAgICAgICAgICAgIDxidXR0b25cbiAgICAgICAgICAgICAgICAgICAgY2xhc3M9XCJsZWdhY3ktYnV0dG9uIHNldHRpbmdzLWRlbGV0ZS1idXR0b25cIlxuICAgICAgICAgICAgICAgICAgICBAY2xpY2s9XCIke3RoaXMub25TZXR0aW5nc0NsaWNrZWR9XCJcbiAgICAgICAgICAgICAgICA+XG4gICAgICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwibWF0ZXJpYWwtc3ltYm9scy1vdXRsaW5lZFwiPiYjeGU4Yjg7PC9zcGFuPlxuICAgICAgICAgICAgICAgIDwvYnV0dG9uPlxuICAgICAgICAgICAgICAgIDxidXR0b25cbiAgICAgICAgICAgICAgICAgICAgY2xhc3M9JHtjbGFzc01hcCh7XG4gICAgICAgICAgICAnbGVnYWN5LWJ1dHRvbic6IHRydWUsXG4gICAgICAgICAgICAnc2V0dGluZ3MtZGVsZXRlLWJ1dHRvbic6IHRydWUsXG4gICAgICAgICAgICAnbG9hZGluZyc6IHRoaXMuaXNMb2FkaW5nLFxuICAgICAgICAgICAgJ2RvbmUtbG9hZGluZyc6ICF0aGlzLmlzTG9hZGluZ1xuICAgICAgICB9KX1cbiAgICAgICAgICAgICAgICAgICAgQGNsaWNrPVwiJHt0aGlzLm9uRGVsZXRlQ2xpY2tlZH1cIlxuICAgICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInNwaW5uZXJcIj48L2Rpdj5cbiAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJjbG9zZS1pY29uIG1hdGVyaWFsLXN5bWJvbHMtb3V0bGluZWRcIj4mI3hlNWNkOzwvc3Bhbj5cbiAgICAgICAgICAgICAgICA8L2J1dHRvbj5cbiAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgJHt0aGlzLnJlbmRlckNvbmZpcm1EaWFsb2coKX1cbiAgICAgICAgYDtcbiAgICB9XG5cbiAgICBwcml2YXRlIHJlbmRlckNvbmZpcm1EaWFsb2coKTogVGVtcGxhdGVSZXN1bHQgfCB0eXBlb2Ygbm90aGluZyB7XG4gICAgICAgIGlmICghdGhpcy5pc0NvbmZpcm1EaWFsb2dWaXNpYmxlKSB7XG4gICAgICAgICAgICByZXR1cm4gbm90aGluZztcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gaHRtbGBcbiAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJyb3dcIj5cbiAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cImxlZ2FjeS10ZXh0IHJlbW92ZS1sYXllci10ZXh0XCI+UmVtb3ZlIGxheWVyPzwvc3Bhbj5cbiAgICAgICAgICAgICAgICAgICAgPGJ1dHRvblxuICAgICAgICAgICAgICAgICAgICAgICAgY2xhc3M9XCJsZWdhY3ktYnV0dG9uIHByaW1hcnkgY29uZmlybS1kZW55LWJ1dHRvblwiXG4gICAgICAgICAgICAgICAgICAgICAgICBAY2xpY2s9XCIke3RoaXMuY29uZmlybURlbGV0aW9ufVwiXG4gICAgICAgICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICAgICAgICAgIFllc1xuICAgICAgICAgICAgICAgICAgICA8L2J1dHRvbj5cbiAgICAgICAgICAgICAgICAgICAgPGJ1dHRvblxuICAgICAgICAgICAgICAgICAgICAgICAgY2xhc3M9XCJsZWdhY3ktYnV0dG9uIHByaW1hcnkgY29uZmlybS1kZW55LWJ1dHRvblwiXG4gICAgICAgICAgICAgICAgICAgICAgICBAY2xpY2s9XCIke3RoaXMuY2FuY2VsRGVsZXRpb259XCJcbiAgICAgICAgICAgICAgICAgICAgPlxuICAgICAgICAgICAgICAgICAgICAgICAgTm9cbiAgICAgICAgICAgICAgICAgICAgPC9idXR0b24+XG4gICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgYDtcbiAgICB9XG5cbiAgICB1cGRhdGVkKGNoYW5nZWRQcm9wZXJ0aWVzOiBhbnkpIHtcbiAgICAgICAgLy8gVXBkYXRlIHRoZSBtb2RlbCBwcm9wZXJ0aWVzIHNvIHRoZXkncmUgcmVmbGVjdGVkIGluIFB5dGhvbi5cbiAgICAgICAgZm9yIChjb25zdCBbcHJvcGVydHksIF9dIG9mIGNoYW5nZWRQcm9wZXJ0aWVzKSB7XG4gICAgICAgICAgICB0aGlzLl9tb2RlbD8uc2V0KHByb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RvIiwgImhhc093blByb3BlcnR5IiwgImNvbnN0cnVjdG9yIiwgImNyZWF0ZVByb3BlcnR5IiwgIndyYXBwZWQiLCAiT2JqZWN0IiwgImdldE93blByb3BlcnR5RGVzY3JpcHRvciIsICJQYXJ0VHlwZSIsICJBVFRSSUJVVEUiLCAiQ0hJTEQiLCAiUFJPUEVSVFkiLCAiQk9PTEVBTl9BVFRSSUJVVEUiLCAiRVZFTlQiLCAiRUxFTUVOVCIsICJkaXJlY3RpdmUiLCAiYyIsICJ2YWx1ZXMiLCAiXyRsaXREaXJlY3RpdmUkIiwgIkRpcmVjdGl2ZSIsICJfcGFydEluZm8iLCAiXyRpc0Nvbm5lY3RlZCIsICJ0aGlzIiwgIl8kcGFyZW50IiwgInBhcnQiLCAicGFyZW50IiwgImF0dHJpYnV0ZUluZGV4IiwgIl9fcGFydCIsICJfX2F0dHJpYnV0ZUluZGV4IiwgInByb3BzIiwgInVwZGF0ZSIsICJfcGFydCIsICJyZW5kZXIiLCAiY2xhc3NNYXAiLCAiZGlyZWN0aXZlIiwgIkRpcmVjdGl2ZSIsICJwYXJ0SW5mbyIsICJzdXBlciIsICJ0eXBlIiwgIlBhcnRUeXBlIiwgIkFUVFJJQlVURSIsICJuYW1lIiwgInN0cmluZ3MiLCAibGVuZ3RoIiwgIkVycm9yIiwgImNsYXNzSW5mbyIsICJPYmplY3QiLCAia2V5cyIsICJmaWx0ZXIiLCAia2V5IiwgImpvaW4iLCAicGFydCIsICJ0aGlzIiwgIl9wcmV2aW91c0NsYXNzZXMiLCAiU2V0IiwgIl9zdGF0aWNDbGFzc2VzIiwgInNwbGl0IiwgInMiLCAiaGFzIiwgImFkZCIsICJyZW5kZXIiLCAiY2xhc3NMaXN0IiwgImVsZW1lbnQiLCAicmVtb3ZlIiwgImRlbGV0ZSIsICJ2YWx1ZSIsICJub0NoYW5nZSIsICJoIiwgIl8iLCAibiJdCn0K diff --git a/geemap/static/material_styles.js b/geemap/static/material_styles.js deleted file mode 100644 index 25260356ae..0000000000 --- a/geemap/static/material_styles.js +++ /dev/null @@ -1,609 +0,0 @@ -// node_modules/@lit/reactive-element/css-tag.js -var t = globalThis; -var e = t.ShadowRoot && (void 0 === t.ShadyCSS || t.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype; -var s = Symbol(); -var o = /* @__PURE__ */ new WeakMap(); -var n = class { - constructor(t2, e3, o3) { - if (this._$cssResult$ = true, o3 !== s) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead."); - this.cssText = t2, this.t = e3; - } - get styleSheet() { - let t2 = this.o; - const s2 = this.t; - if (e && void 0 === t2) { - const e3 = void 0 !== s2 && 1 === s2.length; - e3 && (t2 = o.get(s2)), void 0 === t2 && ((this.o = t2 = new CSSStyleSheet()).replaceSync(this.cssText), e3 && o.set(s2, t2)); - } - return t2; - } - toString() { - return this.cssText; - } -}; -var r = (t2) => new n("string" == typeof t2 ? t2 : t2 + "", void 0, s); -var i = (t2, ...e3) => { - const o3 = 1 === t2.length ? t2[0] : e3.reduce((e4, s2, o4) => e4 + ((t3) => { - if (true === t3._$cssResult$) return t3.cssText; - if ("number" == typeof t3) return t3; - throw Error("Value passed to 'css' function must be a 'css' function result: " + t3 + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security."); - })(s2) + t2[o4 + 1], t2[0]); - return new n(o3, t2, s); -}; -var S = (s2, o3) => { - if (e) s2.adoptedStyleSheets = o3.map((t2) => t2 instanceof CSSStyleSheet ? t2 : t2.styleSheet); - else for (const e3 of o3) { - const o4 = document.createElement("style"), n4 = t.litNonce; - void 0 !== n4 && o4.setAttribute("nonce", n4), o4.textContent = e3.cssText, s2.appendChild(o4); - } -}; -var c = e ? (t2) => t2 : (t2) => t2 instanceof CSSStyleSheet ? ((t3) => { - let e3 = ""; - for (const s2 of t3.cssRules) e3 += s2.cssText; - return r(e3); -})(t2) : t2; - -// node_modules/@lit/reactive-element/reactive-element.js -var { is: i2, defineProperty: e2, getOwnPropertyDescriptor: r2, getOwnPropertyNames: h, getOwnPropertySymbols: o2, getPrototypeOf: n2 } = Object; -var a = globalThis; -var c2 = a.trustedTypes; -var l = c2 ? c2.emptyScript : ""; -var p = a.reactiveElementPolyfillSupport; -var d = (t2, s2) => t2; -var u = { toAttribute(t2, s2) { - switch (s2) { - case Boolean: - t2 = t2 ? l : null; - break; - case Object: - case Array: - t2 = null == t2 ? t2 : JSON.stringify(t2); - } - return t2; -}, fromAttribute(t2, s2) { - let i3 = t2; - switch (s2) { - case Boolean: - i3 = null !== t2; - break; - case Number: - i3 = null === t2 ? null : Number(t2); - break; - case Object: - case Array: - try { - i3 = JSON.parse(t2); - } catch (t3) { - i3 = null; - } - } - return i3; -} }; -var f = (t2, s2) => !i2(t2, s2); -var y = { attribute: true, type: String, converter: u, reflect: false, hasChanged: f }; -Symbol.metadata ??= Symbol("metadata"), a.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap(); -var b = class extends HTMLElement { - static addInitializer(t2) { - this._$Ei(), (this.l ??= []).push(t2); - } - static get observedAttributes() { - return this.finalize(), this._$Eh && [...this._$Eh.keys()]; - } - static createProperty(t2, s2 = y) { - if (s2.state && (s2.attribute = false), this._$Ei(), this.elementProperties.set(t2, s2), !s2.noAccessor) { - const i3 = Symbol(), r3 = this.getPropertyDescriptor(t2, i3, s2); - void 0 !== r3 && e2(this.prototype, t2, r3); - } - } - static getPropertyDescriptor(t2, s2, i3) { - const { get: e3, set: h4 } = r2(this.prototype, t2) ?? { get() { - return this[s2]; - }, set(t3) { - this[s2] = t3; - } }; - return { get() { - return e3?.call(this); - }, set(s3) { - const r3 = e3?.call(this); - h4.call(this, s3), this.requestUpdate(t2, r3, i3); - }, configurable: true, enumerable: true }; - } - static getPropertyOptions(t2) { - return this.elementProperties.get(t2) ?? y; - } - static _$Ei() { - if (this.hasOwnProperty(d("elementProperties"))) return; - const t2 = n2(this); - t2.finalize(), void 0 !== t2.l && (this.l = [...t2.l]), this.elementProperties = new Map(t2.elementProperties); - } - static finalize() { - if (this.hasOwnProperty(d("finalized"))) return; - if (this.finalized = true, this._$Ei(), this.hasOwnProperty(d("properties"))) { - const t3 = this.properties, s2 = [...h(t3), ...o2(t3)]; - for (const i3 of s2) this.createProperty(i3, t3[i3]); - } - const t2 = this[Symbol.metadata]; - if (null !== t2) { - const s2 = litPropertyMetadata.get(t2); - if (void 0 !== s2) for (const [t3, i3] of s2) this.elementProperties.set(t3, i3); - } - this._$Eh = /* @__PURE__ */ new Map(); - for (const [t3, s2] of this.elementProperties) { - const i3 = this._$Eu(t3, s2); - void 0 !== i3 && this._$Eh.set(i3, t3); - } - this.elementStyles = this.finalizeStyles(this.styles); - } - static finalizeStyles(s2) { - const i3 = []; - if (Array.isArray(s2)) { - const e3 = new Set(s2.flat(1 / 0).reverse()); - for (const s3 of e3) i3.unshift(c(s3)); - } else void 0 !== s2 && i3.push(c(s2)); - return i3; - } - static _$Eu(t2, s2) { - const i3 = s2.attribute; - return false === i3 ? void 0 : "string" == typeof i3 ? i3 : "string" == typeof t2 ? t2.toLowerCase() : void 0; - } - constructor() { - super(), this._$Ep = void 0, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev(); - } - _$Ev() { - this._$ES = new Promise((t2) => this.enableUpdating = t2), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((t2) => t2(this)); - } - addController(t2) { - (this._$EO ??= /* @__PURE__ */ new Set()).add(t2), void 0 !== this.renderRoot && this.isConnected && t2.hostConnected?.(); - } - removeController(t2) { - this._$EO?.delete(t2); - } - _$E_() { - const t2 = /* @__PURE__ */ new Map(), s2 = this.constructor.elementProperties; - for (const i3 of s2.keys()) this.hasOwnProperty(i3) && (t2.set(i3, this[i3]), delete this[i3]); - t2.size > 0 && (this._$Ep = t2); - } - createRenderRoot() { - const t2 = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions); - return S(t2, this.constructor.elementStyles), t2; - } - connectedCallback() { - this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach((t2) => t2.hostConnected?.()); - } - enableUpdating(t2) { - } - disconnectedCallback() { - this._$EO?.forEach((t2) => t2.hostDisconnected?.()); - } - attributeChangedCallback(t2, s2, i3) { - this._$AK(t2, i3); - } - _$EC(t2, s2) { - const i3 = this.constructor.elementProperties.get(t2), e3 = this.constructor._$Eu(t2, i3); - if (void 0 !== e3 && true === i3.reflect) { - const r3 = (void 0 !== i3.converter?.toAttribute ? i3.converter : u).toAttribute(s2, i3.type); - this._$Em = t2, null == r3 ? this.removeAttribute(e3) : this.setAttribute(e3, r3), this._$Em = null; - } - } - _$AK(t2, s2) { - const i3 = this.constructor, e3 = i3._$Eh.get(t2); - if (void 0 !== e3 && this._$Em !== e3) { - const t3 = i3.getPropertyOptions(e3), r3 = "function" == typeof t3.converter ? { fromAttribute: t3.converter } : void 0 !== t3.converter?.fromAttribute ? t3.converter : u; - this._$Em = e3, this[e3] = r3.fromAttribute(s2, t3.type), this._$Em = null; - } - } - requestUpdate(t2, s2, i3) { - if (void 0 !== t2) { - if (i3 ??= this.constructor.getPropertyOptions(t2), !(i3.hasChanged ?? f)(this[t2], s2)) return; - this.P(t2, s2, i3); - } - false === this.isUpdatePending && (this._$ES = this._$ET()); - } - P(t2, s2, i3) { - this._$AL.has(t2) || this._$AL.set(t2, s2), true === i3.reflect && this._$Em !== t2 && (this._$Ej ??= /* @__PURE__ */ new Set()).add(t2); - } - async _$ET() { - this.isUpdatePending = true; - try { - await this._$ES; - } catch (t3) { - Promise.reject(t3); - } - const t2 = this.scheduleUpdate(); - return null != t2 && await t2, !this.isUpdatePending; - } - scheduleUpdate() { - return this.performUpdate(); - } - performUpdate() { - if (!this.isUpdatePending) return; - if (!this.hasUpdated) { - if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) { - for (const [t4, s3] of this._$Ep) this[t4] = s3; - this._$Ep = void 0; - } - const t3 = this.constructor.elementProperties; - if (t3.size > 0) for (const [s3, i3] of t3) true !== i3.wrapped || this._$AL.has(s3) || void 0 === this[s3] || this.P(s3, this[s3], i3); - } - let t2 = false; - const s2 = this._$AL; - try { - t2 = this.shouldUpdate(s2), t2 ? (this.willUpdate(s2), this._$EO?.forEach((t3) => t3.hostUpdate?.()), this.update(s2)) : this._$EU(); - } catch (s3) { - throw t2 = false, this._$EU(), s3; - } - t2 && this._$AE(s2); - } - willUpdate(t2) { - } - _$AE(t2) { - this._$EO?.forEach((t3) => t3.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t2)), this.updated(t2); - } - _$EU() { - this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = false; - } - get updateComplete() { - return this.getUpdateComplete(); - } - getUpdateComplete() { - return this._$ES; - } - shouldUpdate(t2) { - return true; - } - update(t2) { - this._$Ej &&= this._$Ej.forEach((t3) => this._$EC(t3, this[t3])), this._$EU(); - } - updated(t2) { - } - firstUpdated(t2) { - } -}; -b.elementStyles = [], b.shadowRootOptions = { mode: "open" }, b[d("elementProperties")] = /* @__PURE__ */ new Map(), b[d("finalized")] = /* @__PURE__ */ new Map(), p?.({ ReactiveElement: b }), (a.reactiveElementVersions ??= []).push("2.0.4"); - -// node_modules/lit-html/lit-html.js -var n3 = globalThis; -var c3 = n3.trustedTypes; -var h2 = c3 ? c3.createPolicy("lit-html", { createHTML: (t2) => t2 }) : void 0; -var f2 = "$lit$"; -var v = `lit$${Math.random().toFixed(9).slice(2)}$`; -var m = "?" + v; -var _ = `<${m}>`; -var w = document; -var lt = () => w.createComment(""); -var st = (t2) => null === t2 || "object" != typeof t2 && "function" != typeof t2; -var g = Array.isArray; -var $ = (t2) => g(t2) || "function" == typeof t2?.[Symbol.iterator]; -var x = "[ \n\f\r]"; -var T = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g; -var E = /-->/g; -var k = />/g; -var O = RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ -\f\r"'\`<>=]|("|')|))|$)`, "g"); -var S2 = /'/g; -var j = /"/g; -var M = /^(?:script|style|textarea|title)$/i; -var P = (t2) => (i3, ...s2) => ({ _$litType$: t2, strings: i3, values: s2 }); -var ke = P(1); -var Oe = P(2); -var Se = P(3); -var R = Symbol.for("lit-noChange"); -var D = Symbol.for("lit-nothing"); -var V = /* @__PURE__ */ new WeakMap(); -var I = w.createTreeWalker(w, 129); -function N(t2, i3) { - if (!g(t2) || !t2.hasOwnProperty("raw")) throw Error("invalid template strings array"); - return void 0 !== h2 ? h2.createHTML(i3) : i3; -} -var U = (t2, i3) => { - const s2 = t2.length - 1, e3 = []; - let h4, o3 = 2 === i3 ? "" : 3 === i3 ? "" : "", n4 = T; - for (let i4 = 0; i4 < s2; i4++) { - const s3 = t2[i4]; - let r3, l2, c4 = -1, a2 = 0; - for (; a2 < s3.length && (n4.lastIndex = a2, l2 = n4.exec(s3), null !== l2); ) a2 = n4.lastIndex, n4 === T ? "!--" === l2[1] ? n4 = E : void 0 !== l2[1] ? n4 = k : void 0 !== l2[2] ? (M.test(l2[2]) && (h4 = RegExp("" === l2[0] ? (n4 = h4 ?? T, c4 = -1) : void 0 === l2[1] ? c4 = -2 : (c4 = n4.lastIndex - l2[2].length, r3 = l2[1], n4 = void 0 === l2[3] ? O : '"' === l2[3] ? j : S2) : n4 === j || n4 === S2 ? n4 = O : n4 === E || n4 === k ? n4 = T : (n4 = O, h4 = void 0); - const u2 = n4 === O && t2[i4 + 1].startsWith("/>") ? " " : ""; - o3 += n4 === T ? s3 + _ : c4 >= 0 ? (e3.push(r3), s3.slice(0, c4) + f2 + s3.slice(c4) + v + u2) : s3 + v + (-2 === c4 ? i4 : u2); - } - return [N(t2, o3 + (t2[s2] || "") + (2 === i3 ? "" : 3 === i3 ? "" : "")), e3]; -}; -var B = class _B { - constructor({ strings: t2, _$litType$: i3 }, s2) { - let e3; - this.parts = []; - let h4 = 0, o3 = 0; - const n4 = t2.length - 1, r3 = this.parts, [l2, a2] = U(t2, i3); - if (this.el = _B.createElement(l2, s2), I.currentNode = this.el.content, 2 === i3 || 3 === i3) { - const t3 = this.el.content.firstChild; - t3.replaceWith(...t3.childNodes); - } - for (; null !== (e3 = I.nextNode()) && r3.length < n4; ) { - if (1 === e3.nodeType) { - if (e3.hasAttributes()) for (const t3 of e3.getAttributeNames()) if (t3.endsWith(f2)) { - const i4 = a2[o3++], s3 = e3.getAttribute(t3).split(v), n5 = /([.?@])?(.*)/.exec(i4); - r3.push({ type: 1, index: h4, name: n5[2], strings: s3, ctor: "." === n5[1] ? Y : "?" === n5[1] ? Z : "@" === n5[1] ? q : G }), e3.removeAttribute(t3); - } else t3.startsWith(v) && (r3.push({ type: 6, index: h4 }), e3.removeAttribute(t3)); - if (M.test(e3.tagName)) { - const t3 = e3.textContent.split(v), i4 = t3.length - 1; - if (i4 > 0) { - e3.textContent = c3 ? c3.emptyScript : ""; - for (let s3 = 0; s3 < i4; s3++) e3.append(t3[s3], lt()), I.nextNode(), r3.push({ type: 2, index: ++h4 }); - e3.append(t3[i4], lt()); - } - } - } else if (8 === e3.nodeType) if (e3.data === m) r3.push({ type: 2, index: h4 }); - else { - let t3 = -1; - for (; -1 !== (t3 = e3.data.indexOf(v, t3 + 1)); ) r3.push({ type: 7, index: h4 }), t3 += v.length - 1; - } - h4++; - } - } - static createElement(t2, i3) { - const s2 = w.createElement("template"); - return s2.innerHTML = t2, s2; - } -}; -function z(t2, i3, s2 = t2, e3) { - if (i3 === R) return i3; - let h4 = void 0 !== e3 ? s2.o?.[e3] : s2.l; - const o3 = st(i3) ? void 0 : i3._$litDirective$; - return h4?.constructor !== o3 && (h4?._$AO?.(false), void 0 === o3 ? h4 = void 0 : (h4 = new o3(t2), h4._$AT(t2, s2, e3)), void 0 !== e3 ? (s2.o ??= [])[e3] = h4 : s2.l = h4), void 0 !== h4 && (i3 = z(t2, h4._$AS(t2, i3.values), h4, e3)), i3; -} -var F = class { - constructor(t2, i3) { - this._$AV = [], this._$AN = void 0, this._$AD = t2, this._$AM = i3; - } - get parentNode() { - return this._$AM.parentNode; - } - get _$AU() { - return this._$AM._$AU; - } - u(t2) { - const { el: { content: i3 }, parts: s2 } = this._$AD, e3 = (t2?.creationScope ?? w).importNode(i3, true); - I.currentNode = e3; - let h4 = I.nextNode(), o3 = 0, n4 = 0, r3 = s2[0]; - for (; void 0 !== r3; ) { - if (o3 === r3.index) { - let i4; - 2 === r3.type ? i4 = new et(h4, h4.nextSibling, this, t2) : 1 === r3.type ? i4 = new r3.ctor(h4, r3.name, r3.strings, this, t2) : 6 === r3.type && (i4 = new K(h4, this, t2)), this._$AV.push(i4), r3 = s2[++n4]; - } - o3 !== r3?.index && (h4 = I.nextNode(), o3++); - } - return I.currentNode = w, e3; - } - p(t2) { - let i3 = 0; - for (const s2 of this._$AV) void 0 !== s2 && (void 0 !== s2.strings ? (s2._$AI(t2, s2, i3), i3 += s2.strings.length - 2) : s2._$AI(t2[i3])), i3++; - } -}; -var et = class _et { - get _$AU() { - return this._$AM?._$AU ?? this.v; - } - constructor(t2, i3, s2, e3) { - this.type = 2, this._$AH = D, this._$AN = void 0, this._$AA = t2, this._$AB = i3, this._$AM = s2, this.options = e3, this.v = e3?.isConnected ?? true; - } - get parentNode() { - let t2 = this._$AA.parentNode; - const i3 = this._$AM; - return void 0 !== i3 && 11 === t2?.nodeType && (t2 = i3.parentNode), t2; - } - get startNode() { - return this._$AA; - } - get endNode() { - return this._$AB; - } - _$AI(t2, i3 = this) { - t2 = z(this, t2, i3), st(t2) ? t2 === D || null == t2 || "" === t2 ? (this._$AH !== D && this._$AR(), this._$AH = D) : t2 !== this._$AH && t2 !== R && this._(t2) : void 0 !== t2._$litType$ ? this.$(t2) : void 0 !== t2.nodeType ? this.T(t2) : $(t2) ? this.k(t2) : this._(t2); - } - O(t2) { - return this._$AA.parentNode.insertBefore(t2, this._$AB); - } - T(t2) { - this._$AH !== t2 && (this._$AR(), this._$AH = this.O(t2)); - } - _(t2) { - this._$AH !== D && st(this._$AH) ? this._$AA.nextSibling.data = t2 : this.T(w.createTextNode(t2)), this._$AH = t2; - } - $(t2) { - const { values: i3, _$litType$: s2 } = t2, e3 = "number" == typeof s2 ? this._$AC(t2) : (void 0 === s2.el && (s2.el = B.createElement(N(s2.h, s2.h[0]), this.options)), s2); - if (this._$AH?._$AD === e3) this._$AH.p(i3); - else { - const t3 = new F(e3, this), s3 = t3.u(this.options); - t3.p(i3), this.T(s3), this._$AH = t3; - } - } - _$AC(t2) { - let i3 = V.get(t2.strings); - return void 0 === i3 && V.set(t2.strings, i3 = new B(t2)), i3; - } - k(t2) { - g(this._$AH) || (this._$AH = [], this._$AR()); - const i3 = this._$AH; - let s2, e3 = 0; - for (const h4 of t2) e3 === i3.length ? i3.push(s2 = new _et(this.O(lt()), this.O(lt()), this, this.options)) : s2 = i3[e3], s2._$AI(h4), e3++; - e3 < i3.length && (this._$AR(s2 && s2._$AB.nextSibling, e3), i3.length = e3); - } - _$AR(t2 = this._$AA.nextSibling, i3) { - for (this._$AP?.(false, true, i3); t2 && t2 !== this._$AB; ) { - const i4 = t2.nextSibling; - t2.remove(), t2 = i4; - } - } - setConnected(t2) { - void 0 === this._$AM && (this.v = t2, this._$AP?.(t2)); - } -}; -var G = class { - get tagName() { - return this.element.tagName; - } - get _$AU() { - return this._$AM._$AU; - } - constructor(t2, i3, s2, e3, h4) { - this.type = 1, this._$AH = D, this._$AN = void 0, this.element = t2, this.name = i3, this._$AM = e3, this.options = h4, s2.length > 2 || "" !== s2[0] || "" !== s2[1] ? (this._$AH = Array(s2.length - 1).fill(new String()), this.strings = s2) : this._$AH = D; - } - _$AI(t2, i3 = this, s2, e3) { - const h4 = this.strings; - let o3 = false; - if (void 0 === h4) t2 = z(this, t2, i3, 0), o3 = !st(t2) || t2 !== this._$AH && t2 !== R, o3 && (this._$AH = t2); - else { - const e4 = t2; - let n4, r3; - for (t2 = h4[0], n4 = 0; n4 < h4.length - 1; n4++) r3 = z(this, e4[s2 + n4], i3, n4), r3 === R && (r3 = this._$AH[n4]), o3 ||= !st(r3) || r3 !== this._$AH[n4], r3 === D ? t2 = D : t2 !== D && (t2 += (r3 ?? "") + h4[n4 + 1]), this._$AH[n4] = r3; - } - o3 && !e3 && this.j(t2); - } - j(t2) { - t2 === D ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t2 ?? ""); - } -}; -var Y = class extends G { - constructor() { - super(...arguments), this.type = 3; - } - j(t2) { - this.element[this.name] = t2 === D ? void 0 : t2; - } -}; -var Z = class extends G { - constructor() { - super(...arguments), this.type = 4; - } - j(t2) { - this.element.toggleAttribute(this.name, !!t2 && t2 !== D); - } -}; -var q = class extends G { - constructor(t2, i3, s2, e3, h4) { - super(t2, i3, s2, e3, h4), this.type = 5; - } - _$AI(t2, i3 = this) { - if ((t2 = z(this, t2, i3, 0) ?? D) === R) return; - const s2 = this._$AH, e3 = t2 === D && s2 !== D || t2.capture !== s2.capture || t2.once !== s2.once || t2.passive !== s2.passive, h4 = t2 !== D && (s2 === D || e3); - e3 && this.element.removeEventListener(this.name, this, s2), h4 && this.element.addEventListener(this.name, this, t2), this._$AH = t2; - } - handleEvent(t2) { - "function" == typeof this._$AH ? this._$AH.call(this.options?.host ?? this.element, t2) : this._$AH.handleEvent(t2); - } -}; -var K = class { - constructor(t2, i3, s2) { - this.element = t2, this.type = 6, this._$AN = void 0, this._$AM = i3, this.options = s2; - } - get _$AU() { - return this._$AM._$AU; - } - _$AI(t2) { - z(this, t2); - } -}; -var Re = n3.litHtmlPolyfillSupport; -Re?.(B, et), (n3.litHtmlVersions ??= []).push("3.2.0"); -var Q = (t2, i3, s2) => { - const e3 = s2?.renderBefore ?? i3; - let h4 = e3._$litPart$; - if (void 0 === h4) { - const t3 = s2?.renderBefore ?? null; - e3._$litPart$ = h4 = new et(i3.insertBefore(lt(), t3), t3, void 0, s2 ?? {}); - } - return h4._$AI(t2), h4; -}; - -// node_modules/lit-element/lit-element.js -var h3 = class extends b { - constructor() { - super(...arguments), this.renderOptions = { host: this }, this.o = void 0; - } - createRenderRoot() { - const t2 = super.createRenderRoot(); - return this.renderOptions.renderBefore ??= t2.firstChild, t2; - } - update(t2) { - const e3 = this.render(); - this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t2), this.o = Q(e3, this.renderRoot, this.renderOptions); - } - connectedCallback() { - super.connectedCallback(), this.o?.setConnected(true); - } - disconnectedCallback() { - super.disconnectedCallback(), this.o?.setConnected(false); - } - render() { - return R; - } -}; -h3._$litElement$ = true, h3["finalized"] = true, globalThis.litElementHydrateSupport?.({ LitElement: h3 }); -var f3 = globalThis.litElementPolyfillSupport; -f3?.({ LitElement: h3 }); -(globalThis.litElementVersions ??= []).push("4.1.0"); - -// js/material_styles.ts -var materialStyles = i` - @font-face { - font-family: 'Material Symbols Outlined'; - font-style: normal; - font-weight: 400; - src: url(https://fonts.gstatic.com/s/materialsymbolsoutlined/v205/kJF1BvYX7BgnkSrUwT8OhrdQw4oELdPIeeII9v6oDMzByHX9rA6RzaxHMPdY43zj-jCxv3fzvRNU22ZXGJpEpjC_1v-p_4MrImHCIJIZrDCvHOejbd5zrDAt.woff2) format('woff2'); - } - - .material-symbols-outlined { - -webkit-font-feature-settings: 'liga'; - -webkit-font-smoothing: antialiased; - direction: ltr; - display: inline-block; - font-family: 'Material Symbols Outlined'; - font-style: normal; - font-weight: normal; - letter-spacing: normal; - line-height: 1; - text-transform: none; - white-space: nowrap; - word-wrap: normal; - } -`; -export { - materialStyles -}; -/*! Bundled license information: - -@lit/reactive-element/css-tag.js: - (** - * @license - * Copyright 2019 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - *) - -@lit/reactive-element/reactive-element.js: - (** - * @license - * Copyright 2017 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - *) - -lit-html/lit-html.js: - (** - * @license - * Copyright 2017 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - *) - -lit-element/lit-element.js: - (** - * @license - * Copyright 2017 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - *) - -lit-html/is-server.js: - (** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - *) -*/ -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vbm9kZV9tb2R1bGVzL0BsaXQvcmVhY3RpdmUtZWxlbWVudC9zcmMvY3NzLXRhZy50cyIsICIuLi8uLi9ub2RlX21vZHVsZXMvQGxpdC9yZWFjdGl2ZS1lbGVtZW50L3NyYy9yZWFjdGl2ZS1lbGVtZW50LnRzIiwgIi4uLy4uL25vZGVfbW9kdWxlcy9saXQtaHRtbC9zcmMvbGl0LWh0bWwudHMiLCAiLi4vLi4vbm9kZV9tb2R1bGVzL2xpdC1lbGVtZW50L3NyYy9saXQtZWxlbWVudC50cyIsICIuLi8uLi9qcy9tYXRlcmlhbF9zdHlsZXMudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbIi8qKlxuICogQGxpY2Vuc2VcbiAqIENvcHlyaWdodCAyMDE5IEdvb2dsZSBMTENcbiAqIFNQRFgtTGljZW5zZS1JZGVudGlmaWVyOiBCU0QtMy1DbGF1c2VcbiAqL1xuXG5jb25zdCBOT0RFX01PREUgPSBmYWxzZTtcblxuLy8gQWxsb3dzIG1pbmlmaWVycyB0byByZW5hbWUgcmVmZXJlbmNlcyB0byBnbG9iYWxUaGlzXG5jb25zdCBnbG9iYWwgPSBnbG9iYWxUaGlzO1xuXG4vKipcbiAqIFdoZXRoZXIgdGhlIGN1cnJlbnQgYnJvd3NlciBzdXBwb3J0cyBgYWRvcHRlZFN0eWxlU2hlZXRzYC5cbiAqL1xuZXhwb3J0IGNvbnN0IHN1cHBvcnRzQWRvcHRpbmdTdHlsZVNoZWV0czogYm9vbGVhbiA9XG4gIGdsb2JhbC5TaGFkb3dSb290ICYmXG4gIChnbG9iYWwuU2hhZHlDU1MgPT09IHVuZGVmaW5lZCB8fCBnbG9iYWwuU2hhZHlDU1MubmF0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G5vZGVJbmRleCxcbiAgICAgICAgICAgICAgICBuYW1lOiBtWzJdLFxuICAgICAgICAgICAgICAgIHN0cmluZ3M6IHN0YXRpY3MsXG4gICAgICAgICAgICAgICAgY3RvcjpcbiAgICAgICAgICAgICAgICAgIG1bMV0gPT09ICcuJ1xuICAgICAgICAgICAgICAgICAgICA/IFByb3BlcnR5UGFydFxuICAgICAgICAgICAgICAgICAgICA6IG1bMV0gPT09ICc/J1xuICAgICAgICAgICAgICAgICAgICAgID8gQm9vbGVhbkF0dHJpYnV0ZVBhcnRcbiAgICAgICAgICAgICAgICAgICAgICA6IG1bMV0gPT09ICdAJ1xuICAgICAgICAgICAgICAgICAgICAgICAgPyBFdmVudFBhcnRcbiAgICAgICAgICAgICAgICAgICAgICAgIDogQXR0cmlidXRlUGFydCxcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgIChub2RlIGFzIEVsZW1lbnQpLnJlbW92ZUF0dHJpYnV0ZShuYW1lKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobmFtZS5zdGFydHNXaXRoKG1hcmtlcikpIHtcbiAgICAgICAgICAgICAgcGFydHMucHVzaCh7XG4gICAgICAgICAgICAgICAgdHlwZTogRUxFTUVOVF9QQVJULFxuICAgICAgICAgICAgICAgIGluZGV4OiBub2RlSW5kZXgsXG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAobm9kZSBhcyBFbGVtZW50KS5yZW1vdmVBdHRyaWJ1dGUobmFtZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIC8vIFRPRE8gKGp1c3RpbmZhZ25hbmkpOiBiZW5jaG1hcmsgdGhlIHJlZ2V4IGFnYWluc3QgdGVzdGluZyBmb3IgZWFjaFxuICAgICAgICAvLyBvZiB0aGUgMyByYXcgdGV4dCBlbGVtZW50IG5hbWVzLlxuICAgICAgICBpZiAocmF3VGV4dEVsZW1lbnQudGVzdCgobm9kZSBhcyBFbGV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pb24gYXR0YWNrcyBjYW4gYCArXG4gICAgICAgICAgICAgICAgYGV4ZmlsdHJhdGUgZGF0YSBhbmQgc3Bvb2YgVUlzLiBgICtcbiAgICAgICAgICAgICAgICBgQ29uc2lkZXIgaW5zdGVhZCB1c2luZyBjc3NcXGAuLi5cXGAgbGl0ZXJhbHMgYCArXG4gICAgICAgICAgICAgICAgYHRvIGNvbXBvc2Ugc3R5bGVzLCBhbmQgZG8gZHluYW1pYyBzdHlsaW5nIHdpdGggYCArXG4gICAgICAgICAgICAgICAgYGNzcyBjdXN0b20gcHJvcGVydGllcywgOjpwYXJ0cywgPHNsb3Q+cywgYCArXG4gICAgICAgICAgICAgICAgYGFuZCBieSBtdXRhdGluZyB0aGUgRE9NIHJhdGhlciB0aGFuIHN0eWxlc2hlZXRzLmA7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBtZXNzYWdlID1cbiAgICAgICAgICAgICAgICBgTGl0IGRvZXMgbm90IHN1cHBvcnQgYmluZGluZyBpbnNpZGUgc2NyaXB0IG5vZGVzLiBgICtcbiAgICAgICAgICAgICAgICBgVGhpcyBpcyBhIHNlY3VyaXR5IHJpc2ssIGFzIGl0IGNvdWxkIGFsbG93IGFyYml0cmFyeSBgICtcbiAgICAgICAgICAgICAgICBgY29kZSBleGVjdXRpb24uYDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgdGhyb3cgbmV3IEVycm9yKG1lc3NhZ2UpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBkZWJ1Z0xvZ0V2ZW50ICYmXG4gICAgICAgIGRlYnVnTG9nRXZlbnQoe1xuICAgICAgICAgIGtpbmQ6ICdjb21taXQgbm9kZScsXG4gICAgICAgICAgc3RhcnQ6IHRoaXMuXyRzdGFydE5vZGUsXG4gICAgICAgICAgcGFyZW50OiB0aGlzLl8kcGFyZW50LFxuICAgICAgICAgIHZhbHVlOiB2YWx1ZSxcbiAgICAgICAgICBvcHRp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NvbnRhaW5lciIsICJvcHRpb25zIiwgInBhcnRPd25lck5vZGUiLCAicmVuZGVyQmVmb3JlIiwgInBhcnQiLCAiZW5kTm9kZSIsICJpbnNlcnRCZWZvcmUiLCAiY3JlYXRlTWFya2VyIiwgIl8kc2V0VmFsdWUiLCAiTGl0RWxlbWVudCIsICJSZWFjdGl2ZUVsZW1lbnQiLCAiY29uc3RydWN0b3IiLCAidGhpcyIsICJyZW5kZXJPcHRpb25zIiwgImhvc3QiLCAiX19jaGlsZFBhcnQiLCAiY3JlYXRlUmVuZGVyUm9vdCIsICJyZW5kZXJSb290IiwgInN1cGVyIiwgInJlbmRlckJlZm9yZSIsICJmaXJzdENoaWxkIiwgImNoYW5nZWRQcm9wZXJ0aWVzIiwgInZhbHVlIiwgInJlbmRlciIsICJoYXNVcGRhdGVkIiwgImlzQ29ubmVjdGVkIiwgInVwZGF0ZSIsICJjb25uZWN0ZWRDYWxsYmFjayIsICJzZXRDb25uZWN0ZWQiLCAiZGlzY29ubmVjdGVkQ2FsbGJhY2siLCAibm9DaGFuZ2UiLCAiZ2xvYmFsVGhpcyIsICJsaXRFbGVtZW50SHlkcmF0ZVN1cHBvcnQiLCAicG9seWZpbGxTdXBwb3J0IiwgImxpdEVsZW1lbnRQb2x5ZmlsbFN1cHBvcnQiLCAiZ2xvYmFsVGhpcyIsICJsaXRFbGVtZW50VmVyc2lvbnMiLCAicHVzaCJdCn0K diff --git a/geemap/static/utils.js b/geemap/static/utils.js deleted file mode 100644 index 4c4d9def56..0000000000 --- a/geemap/static/utils.js +++ /dev/null @@ -1,30 +0,0 @@ -// js/utils.ts -async function unpackModels(modelIds, manager) { - return Promise.all( - modelIds.map((id) => manager.get_model(id.slice("IPY_MODEL_".length))) - ); -} -function loadFonts() { - if (!document.querySelector(".custom-fonts")) { - const styleElement = document.createElement("style"); - styleElement.classList.add("custom-fonts"); - styleElement.textContent = '@import "https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined";'; - document.body.appendChild(styleElement); - } -} -async function updateChildren(container, model) { - const children = model.get("children"); - const child_models = await unpackModels(children, model.widget_manager); - const child_views = await Promise.all( - child_models.map((model2) => model2.widget_manager.create_view(model2)) - ); - container.innerHTML = ``; - for (const child_view of child_views) { - container.appendChild(child_view.el); - } -} -export { - loadFonts, - updateChildren -}; -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vanMvdXRpbHMudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImltcG9ydCB0eXBlIHsgQW55TW9kZWwgfSBmcm9tIFwiQGFueXdpZGdldC90eXBlc1wiO1xuaW1wb3J0IHsgSVdpZGdldE1hbmFnZXIsIFdpZGdldE1vZGVsIH0gZnJvbSBcIkBqdXB5dGVyLXdpZGdldHMvYmFzZVwiO1xuXG5hc3luYyBmdW5jdGlvbiB1bnBhY2tNb2RlbHMobW9kZWxJZHM6IEFycmF5PHN0cmluZz4sIG1hbmFnZXI6IElXaWRnZXRNYW5hZ2VyKTogUHJvbWlzZTxBcnJheTxXaWRnZXRNb2RlbD4+IHtcbiAgICByZXR1cm4gUHJvbWlzZS5hbGwoXG4gICAgICAgIG1vZGVsSWRzLm1hcChpZCA9PiBtYW5hZ2VyLmdldF9tb2RlbChpZC5zbGljZShcIklQWV9NT0RFTF9cIi5sZW5ndGgpKSlcbiAgICApO1xufVxuXG5leHBvcnQgZnVuY3Rpb24gbG9hZEZvbnRzKCkge1xuICAgIGlmICghZG9jdW1lbnQucXVlcnlTZWxlY3RvcignLmN1c3RvbS1mb250cycpKSB7XG4gICAgICAgIGNvbnN0IHN0eWxlRWxlbWVudCA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ3N0eWxlJyk7XG4gICAgICAgIHN0eWxlRWxlbWVudC5jbGFzc0xpc3QuYWRkKCdjdXN0b20tZm9udHMnKTtcbiAgICAgICAgc3R5bGVFbGVtZW50LnRleHRDb250ZW50ID0gJ0BpbXBvcnQgXCJodHR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GVBQWUsU0FBUyxjQUFjLE9BQU87QUFDbkQsaUJBQWEsVUFBVSxJQUFJLGNBQWM7QUFDekMsaUJBQWEsY0FBYztBQUMzQixhQUFTLEtBQUssWUFBWSxZQUFZO0FBQUEsRUFDMUM7QUFDSjtBQUVBLGVBQXNCLGVBQWUsV0FBd0IsT0FBc0I7QUFDL0UsUUFBTSxXQUFXLE1BQU0sSUFBSSxVQUFVO0FBQ3JDLFFBQU0sZUFBZSxNQUFNLGFBQWEsVUFBVSxNQUFNLGNBQWM7QUFDdEUsUUFBTSxjQUFjLE1BQU0sUUFBUTtBQUFBLElBQzlCLGFBQWEsSUFBSSxDQUFBQSxXQUFTQSxPQUFNLGVBQWUsWUFBWUEsTUFBSyxDQUFDO0FBQUEsRUFDckU7QUFDQSxZQUFVLFlBQVk7QUFDdEIsYUFBVyxjQUFjLGFBQWE7QUFDbEMsY0FBVSxZQUFZLFdBQVcsRUFBRTtBQUFBLEVBQ3ZDO0FBQ0o7IiwKICAibmFtZXMiOiBbIm1vZGVsIl0KfQo= From fc9952b10d03bf92e9fde1ec414bf20c98bce9da Mon Sep 17 00:00:00 2001 From: Sufyan Abbasi Date: Wed, 16 Oct 2024 17:29:52 +0000 Subject: [PATCH 25/57] Fix TS errors --- js/layer_manager_row.ts | 2 +- karma.conf.js | 3 +++ package.json | 2 +- tsconfig.json | 3 ++- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/js/layer_manager_row.ts b/js/layer_manager_row.ts index aa5aa5150f..fcb87dafc4 100644 --- a/js/layer_manager_row.ts +++ b/js/layer_manager_row.ts @@ -167,7 +167,7 @@ export class LayerManagerRow extends LitElement { `; } - private renderConfirmDialog(): TemplateResult | void { + private renderConfirmDialog(): TemplateResult | typeof nothing | void { if (!this.isConfirmDialogVisible) { return nothing; } diff --git a/karma.conf.js b/karma.conf.js index 31a3e75068..738ce342c0 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -30,6 +30,9 @@ module.exports = function (config) { "random": true } }, + karmaTypescriptConfig: { + tsconfig: './tsconfig.json' + }, reporters: ['progress', 'kjhtml'], port: 9876, colors: true, diff --git a/package.json b/package.json index 956f6a8ef4..ff35be02f1 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "scripts": { "dev": "npm run build -- --sourcemap=inline --watch", - "build": "esbuild js/*.ts --minify --format=esm --bundle --outdir=geemap/static", + "build": "esbuild js/*.ts --format=esm --bundle --outdir=geemap/static", "typecheck": "tsc --noEmit", "test": "karma start karma.conf.js --single-run --watch=false", "test:debug": "karma start karma.conf.js" diff --git a/tsconfig.json b/tsconfig.json index 595c14b993..ffbf4efdf0 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -22,6 +22,7 @@ "noUnusedParameters": true, "noFallthroughCasesInSwitch": true, "experimentalDecorators": true, - "emitDecoratorMetadata": true + "emitDecoratorMetadata": true, + "downlevelIteration": true } } \ No newline at end of file From 25817a7d96fb745746647983d6de28f77a9026a9 Mon Sep 17 00:00:00 2001 From: Nathaniel Schmitz Date: Fri, 18 Oct 2024 17:22:57 -0400 Subject: [PATCH 26/57] Convert tsconfig.json to spaces and export model interfaces --- js/layer_manager.ts | 2 +- js/layer_manager_row.ts | 2 +- tsconfig.json | 48 ++++++++++++++++++++--------------------- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/js/layer_manager.ts b/js/layer_manager.ts index 2f739d619a..9813484bd1 100644 --- a/js/layer_manager.ts +++ b/js/layer_manager.ts @@ -4,7 +4,7 @@ import { property } from "lit/decorators.js"; import { legacyStyles } from './ipywidgets_styles'; import { loadFonts, updateChildren } from "./utils"; -interface LayerManagerModel { +export interface LayerManagerModel { children: any; visible: boolean; } diff --git a/js/layer_manager_row.ts b/js/layer_manager_row.ts index 444430d1d3..8afe7c5cef 100644 --- a/js/layer_manager_row.ts +++ b/js/layer_manager_row.ts @@ -7,7 +7,7 @@ import { legacyStyles } from './ipywidgets_styles'; import { materialStyles } from "./material_styles"; import { loadFonts } from "./utils"; -interface LayerManagerRowModel { +export interface LayerManagerRowModel { name: string; visible: boolean; opacity: number; diff --git a/tsconfig.json b/tsconfig.json index ed5a1151f0..cdcd8005f6 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,27 +1,27 @@ { - "include": [ - "js" - ], - "compilerOptions": { - "target": "ES2020", - "module": "ESNext", - "lib": [ - "ES2020", - "DOM", - "DOM.Iterable" - ], - "skipLibCheck": true, - "moduleResolution": "bundler", - "allowImportingTsExtensions": true, - "resolveJsonModule": true, - "isolatedModules": true, - "noEmit": true, - "strict": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "noFallthroughCasesInSwitch": true, + "include": [ + "js" + ], + "compilerOptions": { + "target": "ES2020", + "module": "ESNext", + "lib": [ + "ES2020", + "DOM", + "DOM.Iterable" + ], + "skipLibCheck": true, + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true, "downlevelIteration": true, - "experimentalDecorators": true, - "emitDecoratorMetadata": true - } + "experimentalDecorators": true, + "emitDecoratorMetadata": true + } } \ No newline at end of file From cd6c259efef4c85eb7738369c1690aecd0dfde6c Mon Sep 17 00:00:00 2001 From: Sufyan Abbasi Date: Fri, 18 Oct 2024 22:04:06 +0000 Subject: [PATCH 27/57] Add TS tests for anywidgets --- js/layer_manager.ts | 2 +- js/layer_manager_row.ts | 9 +- karma.conf.cjs | 62 + karma.conf.js | 51 - package-lock.json | 2671 +++++++++++++------------------ package.json | 17 +- tests/fake_anywidget.ts | 21 + tests/layer_manager.spec.ts | 47 + tests/layer_manager_row.spec.ts | 57 +- tsconfig.json | 6 +- tsconfig.webpack.json | 29 + 11 files changed, 1317 insertions(+), 1655 deletions(-) create mode 100644 karma.conf.cjs delete mode 100644 karma.conf.js create mode 100644 tests/fake_anywidget.ts create mode 100644 tests/layer_manager.spec.ts create mode 100644 tsconfig.webpack.json diff --git a/js/layer_manager.ts b/js/layer_manager.ts index 2f739d619a..9813484bd1 100644 --- a/js/layer_manager.ts +++ b/js/layer_manager.ts @@ -4,7 +4,7 @@ import { property } from "lit/decorators.js"; import { legacyStyles } from './ipywidgets_styles'; import { loadFonts, updateChildren } from "./utils"; -interface LayerManagerModel { +export interface LayerManagerModel { children: any; visible: boolean; } diff --git a/js/layer_manager_row.ts b/js/layer_manager_row.ts index 444430d1d3..5bf7d1e8e8 100644 --- a/js/layer_manager_row.ts +++ b/js/layer_manager_row.ts @@ -7,7 +7,7 @@ import { legacyStyles } from './ipywidgets_styles'; import { materialStyles } from "./material_styles"; import { loadFonts } from "./utils"; -interface LayerManagerRowModel { +export interface LayerManagerRowModel { name: string; visible: boolean; opacity: number; @@ -151,7 +151,7 @@ export class LayerManagerRow extends LitElement { @input="${this.onLayerOpacityChanged}" /> `; + }); + } +} + +// Without this check, there's a component registry issue when developing locally. +if (!customElements.get(TabPanel.componentName)) { + customElements.define(TabPanel.componentName, TabPanel); +} From b79ea78f4bcda3495973df6eebafa6d17e3df390 Mon Sep 17 00:00:00 2001 From: sufyanAbbasi Date: Mon, 11 Nov 2024 10:06:32 -0800 Subject: [PATCH 29/57] clean up styles --- js/ipywidgets_styles.ts | 9 +++++---- js/material_styles.ts | 25 ------------------------- 2 files changed, 5 insertions(+), 29 deletions(-) delete mode 100644 js/material_styles.ts diff --git a/js/ipywidgets_styles.ts b/js/ipywidgets_styles.ts index 15ea92d081..0f94cdc985 100644 --- a/js/ipywidgets_styles.ts +++ b/js/ipywidgets_styles.ts @@ -23,9 +23,10 @@ export const legacyStyles = css` .legacy-button:hover:enabled, .legacy-button:focus:enabled { - box-shadow: 0 2px 2px 0 rgba(0, 0, 0, var(--md-shadow-key-penumbra-opacity)), - 0 3px 1px -2px rgba(0, 0, 0, var(--md-shadow-key-umbra-opacity)), - 0 1px 5px 0 rgba(0, 0, 0, var(--md-shadow-ambient-shadow-opacity)); + box-shadow: 0 2px 2px 0 + rgba(0, 0, 0, var(--md-shadow-key-penumbra-opacity)), + 0 3px 1px -2px rgba(0, 0, 0, var(--md-shadow-key-umbra-opacity)), + 0 1px 5px 0 rgba(0, 0, 0, var(--md-shadow-ambient-shadow-opacity)); } .legacy-slider { @@ -55,4 +56,4 @@ export const legacyStyles = css` height: var(--jp-widgets-inline-height); line-height: var(--jp-widgets-inline-height); } -`; \ No newline at end of file +`; diff --git a/js/material_styles.ts b/js/material_styles.ts deleted file mode 100644 index 90789019cf..0000000000 --- a/js/material_styles.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { css } from "lit"; - -export const materialStyles = css` - @font-face { - font-family: 'Material Symbols Outlined'; - font-style: normal; - font-weight: 400; - src: url(https://fonts.gstatic.com/s/materialsymbolsoutlined/v205/kJF1BvYX7BgnkSrUwT8OhrdQw4oELdPIeeII9v6oDMzByHX9rA6RzaxHMPdY43zj-jCxv3fzvRNU22ZXGJpEpjC_1v-p_4MrImHCIJIZrDCvHOejbd5zrDAt.woff2) format('woff2'); - } - - .material-symbols-outlined { - -webkit-font-feature-settings: 'liga'; - -webkit-font-smoothing: antialiased; - direction: ltr; - display: inline-block; - font-family: 'Material Symbols Outlined'; - font-style: normal; - font-weight: normal; - letter-spacing: normal; - line-height: 1; - text-transform: none; - white-space: nowrap; - word-wrap: normal; - } -`; \ No newline at end of file From 7ae4e23e6fc12c743437228a632bd7c82a80f475 Mon Sep 17 00:00:00 2001 From: sufyanAbbasi Date: Mon, 11 Nov 2024 10:24:33 -0800 Subject: [PATCH 30/57] Add css classes for better testability --- js/layer_manager_row.ts | 11 ++++++----- tests/layer_manager_row.spec.ts | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/js/layer_manager_row.ts b/js/layer_manager_row.ts index b9529e4b53..06faf61960 100644 --- a/js/layer_manager_row.ts +++ b/js/layer_manager_row.ts @@ -100,7 +100,7 @@ export class LayerManagerRow extends LitWidget< flex-grow: 1; } - .confirm-deny-button { + .confirm-deny button { height: 26px; width: 70px; } @@ -150,7 +150,7 @@ export class LayerManagerRow extends LitWidget< @input="${this.onLayerOpacityChanged}" /> +
`; + } + + private onBaseMapChanged(event: Event) { + const target = event.target as HTMLInputElement; + this.value = target.value; + } + + private onCloseClicked(_: Event) { + this.model?.send({ type: "click", id: "close" }); + } +} + +// Without this check, there's a component registry issue when developing locally. +if (!customElements.get(BasemapSelector.componentName)) { + customElements.define(BasemapSelector.componentName, BasemapSelector); +} + +function render({ model, el }: RenderProps) { + loadFonts(); + const row = ( + document.createElement(BasemapSelector.componentName) + ); + row.model = model; + el.appendChild(row); +} + +export default { render }; diff --git a/js/layer_manager copy.ts b/js/layer_manager copy.ts new file mode 100644 index 0000000000..4a3dd3f787 --- /dev/null +++ b/js/layer_manager copy.ts @@ -0,0 +1,98 @@ +import type { RenderProps } from "@anywidget/types"; +import { html, css, TemplateResult } from "lit"; +import { property } from "lit/decorators.js"; + +import { legacyStyles } from "./ipywidgets_styles"; +import { LitWidget } from "./lit_widget"; +import { loadFonts, updateChildren } from "./utils"; + +export interface LayerManagerModel { + children: any; + visible: boolean; +} + +export class LayerManager extends LitWidget< + LayerManagerModel, + LayerManager +> { + static get componentName() { + return `layer-manager`; + } + + static styles = [ + legacyStyles, + css` + .container { + padding: 0 4px 2px 4px; + } + + .row { + align-items: center; + display: flex; + gap: 4px; + height: 30px; + } + + .visibility-checkbox { + margin: 2px; + } + `, + ]; + + @property() visible: boolean = false; + + modelNameToViewName(): Map< + keyof LayerManagerModel, + keyof LayerManager | null + > { + return new Map([ + ["children", null], + ["visible", "visible"], + ]); + } + + render(): TemplateResult { + return html` +
+
+ + All layers on/off +
+ +
+ `; + } + + private onLayerVisibilityChanged(event: Event): void { + const target = event.target as HTMLInputElement; + this.visible = target.checked; + } +} + +// Without this check, there's a component registry issue when developing locally. +if (!customElements.get(LayerManager.componentName)) { + customElements.define(LayerManager.componentName, LayerManager); +} + +async function render({ model, el }: RenderProps) { + loadFonts(); + const manager = ( + document.createElement(LayerManager.componentName) + ); + manager.model = model; + el.appendChild(manager); + + updateChildren(manager, model); + model.on("change:children", () => { + updateChildren(manager, model); + }); +} + +export default { render }; From 1991e138219eef370b4b8765e5b640c34ddc9826 Mon Sep 17 00:00:00 2001 From: Sufyan Abbasi Date: Wed, 13 Nov 2024 02:37:32 +0000 Subject: [PATCH 34/57] Add a tab panel and rough toolbar --- geemap/toolbar.py | 21 +++++++- js/ipywidgets_styles.ts | 14 ++++++ js/layer_manager.ts | 7 +++ js/tab_panel.ts | 92 +++++++++++++++++++++++----------- js/toolbar.ts | 92 ++++++++++++++++++++++++++++++++++ js/toolbar_item.ts | 106 ++++++++++++++++++++++++++++++++++++++++ 6 files changed, 303 insertions(+), 29 deletions(-) create mode 100644 js/toolbar.ts create mode 100644 js/toolbar_item.ts diff --git a/geemap/toolbar.py b/geemap/toolbar.py index 0415ddf1ef..e2410afc62 100644 --- a/geemap/toolbar.py +++ b/geemap/toolbar.py @@ -9,12 +9,16 @@ # *******************************************************************************# import os +import pathlib from dataclasses import dataclass + +import anywidget import ee import ipyevents import ipyleaflet import ipywidgets as widgets +import traitlets from ipyfilechooser import FileChooser from IPython.core.display import display @@ -25,11 +29,26 @@ from . import map_widgets +@Theme.apply +class ToolbarItem(anywidget.AnyWidget): + """A toolbar item widget for geemap.""" + + _esm = pathlib.Path(__file__).parent / "static" / "toolbar_item.js" + active = traitlets.Bool(False).tag(sync=True) + icon = traitlets.Unicode('').tag(sync=True) + is_loading = traitlets.Bool(False).tag(sync=True) + @map_widgets.Theme.apply -class Toolbar(widgets.VBox): +class Toolbar(anywidget.AnyWidget): """A toolbar that can be added to the map.""" + + _esm = pathlib.Path(__file__).parent / "static" / "toolbar.js" + # Whether the toolbar is expanded. + expanded = traitlets.Bool(True).tag(sync=True) + + @dataclass class Item: """A representation of an item in the toolbar. diff --git a/js/ipywidgets_styles.ts b/js/ipywidgets_styles.ts index 15ea92d081..a0bd9268d2 100644 --- a/js/ipywidgets_styles.ts +++ b/js/ipywidgets_styles.ts @@ -55,4 +55,18 @@ export const legacyStyles = css` height: var(--jp-widgets-inline-height); line-height: var(--jp-widgets-inline-height); } + + .legacy-button.active { + background-color: var(--jp-layout-color3); + color: var(--jp-ui-font-color1); + } + + .legacy-button.primary { + background-color: var(--jp-brand-color1); + color: var(--jp-ui-inverse-font-color1); + } + + .legacy-button.primary.active { + background-color: var(--jp-brand-color0); } + color: var(--jp-ui-inverse-font-color0); `; \ No newline at end of file diff --git a/js/layer_manager.ts b/js/layer_manager.ts index 9813484bd1..9d1ed252ea 100644 --- a/js/layer_manager.ts +++ b/js/layer_manager.ts @@ -4,6 +4,8 @@ import { property } from "lit/decorators.js"; import { legacyStyles } from './ipywidgets_styles'; import { loadFonts, updateChildren } from "./utils"; +import './tab_panel'; + export interface LayerManagerModel { children: any; visible: boolean; @@ -70,6 +72,11 @@ export class LayerManager extends LitElement { All layers on/off
+ +
one
+
two
+
three
+
`; } diff --git a/js/tab_panel.ts b/js/tab_panel.ts index a88e9892ec..77c67d121e 100644 --- a/js/tab_panel.ts +++ b/js/tab_panel.ts @@ -1,12 +1,25 @@ -import { html, css, LitElement, PropertyValues } from "lit"; +import { html, css, nothing, LitElement, PropertyValues } from "lit"; import { property, queryAll, queryAssignedElements } from "lit/decorators.js"; import { legacyStyles } from "./ipywidgets_styles"; import { classMap } from 'lit/directives/class-map.js'; +import { unsafeHTML } from 'lit/directives/unsafe-html.js'; function convertToId(name: string | undefined): string { return (name || "").trim().replace(" ", "-").toLowerCase(); } +/** The various modes. */ +export enum TabMode { + ALWAYS_SHOW, + HIDE_ON_SECOND_CLICK, +} + +/** The tab label, as a string or Material Icon. */ +export interface TabLabel { + name: string|undefined, + icon: string|undefined, +} + /** * Defines the element which accepts N children, with a zero-based * index determining which child to show, e.g.: @@ -24,41 +37,47 @@ export class TabPanel extends LitElement { static styles = [ legacyStyles, css` + ::slotted(*) { + display: none; + } + + ::slotted(.show-tab) { + display: block; + } + .container { padding: 0; width: 100%; } - button.tab { - border: 1px solid #ddd; - border-bottom: none; - border-top-left-radius: 15px; - border-top-right-radius: 15px; - display: inline-block; - min-width: 88px; - padding: 0 10px; + .tab-container { + align-items: center; + display: flex; + flex-direction: row; + justify-content: flex-start; } - button.active { - background-color: var(--colab-primary-surface-color, --jp-layout-color2, white); + .tab-container button { + margin: 2px; + padding: 0 4px; + user-select: none; } - ::slotted(*) { - display: none; - } - - ::slotted(.show-tab) { - display: block; + .tab-container button:first-child { + margin-left: 0; } `, ]; @property({ type: Array }) - tabNames: string[] = []; + tabs: TabLabel[] = []; @property({ type: Number }) index = 0; + @property({ type: Number }) + mode: TabMode = TabMode.HIDE_ON_SECOND_CLICK; + /** * The tab elements. */ @@ -99,7 +118,7 @@ export class TabPanel extends LitElement { element.classList.remove("show-tab"); // Also add accessibility attributes. - const id = convertToId(this.tabNames[i]); + const id = convertToId(this.tabs[i].name); element.setAttribute("id", `tabpanel-${id}-${i}`); element.setAttribute("role", "tabpanel"); element.setAttribute("aria-labelledby", `tab-${id}-${i}`); @@ -108,26 +127,43 @@ export class TabPanel extends LitElement { } private renderTabs() { - return this.tabNames.map((tabName: string, i: number) => { - const id = convertToId(this.tabNames[i]); + return this.tabs.map((tab: TabLabel, i: number) => { + const id = convertToId(this.tabs[i].name); + // Strictly validate the icon, since we are using unsafeHTML + // directive to render the HTML entity directly. + if (tab.icon && !tab.icon.match(/^&#x[a-fA-F0-9]+;$/)) { + tab.icon = ''; + } return html``; }); } + + private onTabClick(index: number) { + switch (this.mode) { + case TabMode.HIDE_ON_SECOND_CLICK: + // Hide the tab panel if clicked twice. + this.index = this.index === index ? -1 : index; + break; + case TabMode.ALWAYS_SHOW: + default: + this.index = index; + } + } } // Without this check, there's a component registry issue when developing locally. diff --git a/js/toolbar.ts b/js/toolbar.ts new file mode 100644 index 0000000000..a67b21bbe9 --- /dev/null +++ b/js/toolbar.ts @@ -0,0 +1,92 @@ +import type { AnyModel, RenderProps } from "@anywidget/types"; +import { html, css, LitElement } from "lit"; +import { property } from "lit/decorators.js"; +import { legacyStyles } from './ipywidgets_styles'; +import { loadFonts, updateChildren } from "./utils"; + +import './tab_panel'; + +export interface ToolbarModel { + children: any; + expanded: boolean; +} + +export class Toolbar extends LitElement { + static get componentName() { + return `toolbar-panel`; + } + + static styles = [ + legacyStyles, + css` + .container { + padding: 0 4px 2px 4px; + }`, + ]; + + private _model: AnyModel | undefined = undefined; + private static modelNameToViewName = new Map([ + ["children", null], + ["expanded", "expanded"], + ]); + + set model(model: AnyModel) { + this._model = model; + for (const [modelKey, widgetKey] of Toolbar.modelNameToViewName) { + if (widgetKey) { + // Get initial values from the Python model. + (this as any)[widgetKey] = model.get(modelKey); + // Listen for updates to the model. + model.on(`change:${modelKey}`, () => { + (this as any)[widgetKey] = model.get(modelKey); + }); + } + } + } + + @property() + expanded: boolean = false; + + render() { + return html` +
+ + + + +
+ `; + } + + updated(changedProperties: any) { + // Update the model properties so they're reflected in Python. + for (const [property, _] of changedProperties) { + this._model?.set(property, this[property as keyof Toolbar]); + } + this._model?.save_changes(); + } + + private onLayerVisibilityChanged(event: Event) { + const target = event.target as HTMLInputElement; + this.visible = target.checked; + } +} + +// Without this check, there's a component registry issue when developing locally. +if (!customElements.get(Toolbar.componentName)) { + customElements.define(Toolbar.componentName, Toolbar); +} + +async function render({ model, el }: RenderProps) { + loadFonts(); + const manager = document.createElement(Toolbar.componentName); + manager.model = model; + el.appendChild(manager); + + updateChildren(manager, model); + model.on("change:children", () => { + updateChildren(manager, model); + }); +} + +export default { render }; diff --git a/js/toolbar_item.ts b/js/toolbar_item.ts new file mode 100644 index 0000000000..3229ae8669 --- /dev/null +++ b/js/toolbar_item.ts @@ -0,0 +1,106 @@ +import type { AnyModel, RenderProps } from "@anywidget/types"; +import { html, css, LitElement } from "lit"; +import { property } from "lit/decorators.js"; +import { classMap } from 'lit/directives/class-map.js'; +import { unsafeHTML } from 'lit/directives/unsafe-html.js'; + +import { legacyStyles } from './ipywidgets_styles'; +import { loadFonts } from "./utils"; + +export interface ToolbarItemModel { + active: boolean; + icon: string; + tooltip: string; +} + +export class ToolbarItem extends LitElement { + static get componentName() { + return `tool-button`; + } + + static styles = [ + legacyStyles, + css` + button { + height: auto; + padding: 0px 0px 0px 4px; + width: auto; + } + `, + ]; + + private _model: AnyModel | undefined = undefined; + private static modelNameToViewName = new Map([ + ["active", "active"], + ["icon", "icon"], + ["tooltip", "tooltip"], + ]); + + set model(model: AnyModel) { + this._model = model; + for (const [modelKey, widgetKey] of ToolbarItem.modelNameToViewName) { + if (widgetKey) { + // Get initial values from the Python model. + (this as any)[widgetKey] = model.get(modelKey); + // Listen for updates to the model. + model.on(`change:${modelKey}`, () => { + (this as any)[widgetKey] = model.get(modelKey); + }); + } + } + } + + @property({ type: Boolean }) + active: boolean = false; + + @property({ type: String }) + icon: string = ''; + + @property({ type: String }) + tooltip: string = ''; + + render() { + // Strictly validate the icon, since we are using unsafeHTML + // directive to render the HTML entity directly. + if (this.icon && !this.icon.match(/^&#x[a-fA-F0-9]+;$/)) { + this.icon = ''; + } + return html` + `; + } + + updated(changedProperties: any) { + // Update the model properties so they're reflected in Python. + for (const [property, _] of changedProperties) { + this._model?.set(property, this[property as keyof ToolbarItem]); + } + this._model?.save_changes(); + } + + private onClick(event: Event) { + this.active = !this.active; + } +} + +// Without this check, there's a component registry issue when developing locally. +if (!customElements.get(ToolbarItem.componentName)) { + customElements.define(ToolbarItem.componentName, ToolbarItem); +} + +async function render({ model, el }: RenderProps) { + loadFonts(); + const manager = document.createElement(ToolbarItem.componentName); + manager.model = model; + el.appendChild(manager); +} + +export default { render }; From d26c5847e62ba10be73e2a60a3f3c42678a6d76b Mon Sep 17 00:00:00 2001 From: Sufyan Abbasi Date: Wed, 13 Nov 2024 23:59:49 +0000 Subject: [PATCH 35/57] Add tests for basemap selector widget --- geemap/core.py | 10 ++--- geemap/map_widgets.py | 10 ++--- js/basemap_selector.ts | 30 +++++++++----- js/ipywidgets_styles.ts | 25 ++++++++++++ tests/basemap_selector.spec.ts | 75 ++++++++++++++++++++++++++++++++++ tests/test_map_widgets.py | 49 +++++++--------------- 6 files changed, 145 insertions(+), 54 deletions(-) create mode 100644 tests/basemap_selector.spec.ts diff --git a/geemap/core.py b/geemap/core.py index 28d566e18b..40110d26df 100644 --- a/geemap/core.py +++ b/geemap/core.py @@ -687,13 +687,13 @@ def _layer_editor(self) -> Optional[map_widgets.LayerEditor]: return self._find_widget_of_type(map_widgets.LayerEditor) @property - def _basemap_selector(self) -> Optional[map_widgets.Basemap]: + def _basemap_selector(self) -> Optional[map_widgets.BasemapSelector]: """Finds the basemap selector widget in the map controls. Returns: - Optional[map_widgets.Basemap]: The basemap selector widget if found, else None. + Optional[map_widgets.BasemapSelector]: The basemap selector widget if found, else None. """ - return self._find_widget_of_type(map_widgets.Basemap) + return self._find_widget_of_type(map_widgets.BasemapSelector) def __init__(self, **kwargs: Any) -> None: """Initialize the map with given keyword arguments. @@ -1051,7 +1051,7 @@ def _add_basemap_selector(self, position: str, **kwargs: Any) -> None: value = kwargs.pop( "value", self._get_preferred_basemap_name(self.layers[0].name) ) - basemap = map_widgets.Basemap(basemap_names, value, **kwargs) + basemap = map_widgets.BasemapSelector(basemap_names, value, **kwargs) basemap.on_close = lambda: self.remove("basemap_selector") basemap.on_basemap_changed = self._replace_basemap basemap_control = ipyleaflet.WidgetControl(widget=basemap, position=position) @@ -1073,7 +1073,7 @@ def remove(self, widget: Any) -> None: "layer_manager": map_widgets.LayerManager, "layer_editor": map_widgets.LayerEditor, "draw_control": MapDrawControl, - "basemap_selector": map_widgets.Basemap, + "basemap_selector": map_widgets.BasemapSelector, } if widget_type := basic_controls.get(widget, None): if control := self._find_widget_of_type(widget_type, return_control=True): diff --git a/geemap/map_widgets.py b/geemap/map_widgets.py index 73f751b4d4..11c22d5449 100644 --- a/geemap/map_widgets.py +++ b/geemap/map_widgets.py @@ -1022,10 +1022,10 @@ def _observe_visible(self, change: Dict[str, Any]) -> None: @Theme.apply -class Basemap(anywidget.AnyWidget): +class BasemapSelector(anywidget.AnyWidget): """Widget for selecting a basemap.""" - _esm = pathlib.Path(__file__).parent / "static" / "basemap.js" + _esm = pathlib.Path(__file__).parent / "static" / "basemap_selector.js" # The list of basemap names to make available for selection. basemaps = traitlets.List([]).tag(sync=True) @@ -1069,9 +1069,9 @@ def cleanup(self) -> None: if self.on_close: self.on_close() - def _on_close_click(self, _) -> None: - """Handles the close button click event.""" - self.cleanup() + +# Type alias for backwards compatibility. +Basemap = BasemapSelector @Theme.apply diff --git a/js/basemap_selector.ts b/js/basemap_selector.ts index 10ce47dd32..56613cc64e 100644 --- a/js/basemap_selector.ts +++ b/js/basemap_selector.ts @@ -1,6 +1,6 @@ import type { RenderProps } from "@anywidget/types"; -import { css, html, TemplateResult } from "lit"; -import { property } from "lit/decorators.js"; +import { css, html, PropertyValues, TemplateResult } from "lit"; +import { property, query } from "lit/decorators.js"; import { legacyStyles } from "./ipywidgets_styles"; import { materialStyles } from "./styles"; @@ -24,17 +24,18 @@ export class BasemapSelector extends LitWidget< legacyStyles, materialStyles, css` - .row { + .row-container { align-items: center; display: flex; - gap: 4px; - height: 30px; + gap: 2px; + height: 32px; + width: 200px; } .row-button { font-size: 14px; - height: 26px; - width: 26px; + height: 28px; + width: 28px; } `, ]; @@ -51,11 +52,12 @@ export class BasemapSelector extends LitWidget< @property({ type: Array }) basemaps: string[] = []; @property({ type: String }) value: string = ""; + @query('select') selectElement!: HTMLSelectElement; render(): TemplateResult { return html` -
- ${this.basemaps.map((basemap) => html``)}
`; } + + override update(changedProperties: PropertyValues): void { + if (changedProperties.has("value") && this.selectElement) { + this.selectElement.value = this.value; + } + super.update(changedProperties); + } + - private onBaseMapChanged(event: Event) { + private onChange(event: Event) { const target = event.target as HTMLInputElement; this.value = target.value; } diff --git a/js/ipywidgets_styles.ts b/js/ipywidgets_styles.ts index 0f94cdc985..63f0640104 100644 --- a/js/ipywidgets_styles.ts +++ b/js/ipywidgets_styles.ts @@ -56,4 +56,29 @@ export const legacyStyles = css` height: var(--jp-widgets-inline-height); line-height: var(--jp-widgets-inline-height); } + + .legacy-select { + padding-right: 20px; + border: var(--jp-widgets-input-border-width) solid var(--jp-widgets-input-border-color); + border-radius: 0; + height: inherit; + flex: 1 1 var(--jp-widgets-inline-width-short); + min-width: 0; + box-sizing: border-box; + outline: none !important; + box-shadow: none; + background-color: var(--jp-widgets-input-background-color); + color: var(--jp-widgets-input-color); + font-size: var(--jp-widgets-font-size); + vertical-align: top; + padding-left: calc(var(--jp-widgets-input-padding)* 2); + appearance: none; + -webkit-appearance: none; + -moz-appearance: none; + background-repeat: no-repeat; + background-size: 20px; + background-position: right center; + background-image: var(--jp-widgets-dropdown-arrow); +} + } `; diff --git a/tests/basemap_selector.spec.ts b/tests/basemap_selector.spec.ts new file mode 100644 index 0000000000..0b5a071af6 --- /dev/null +++ b/tests/basemap_selector.spec.ts @@ -0,0 +1,75 @@ +import { AnyModel } from "@anywidget/types"; +import "../js/basemap_selector"; +import { default as selectorRender, BasemapSelector, BasemapSelectorModel } from "../js/basemap_selector"; +import { FakeAnyModel } from "./fake_anywidget"; + +describe("", () => { + let selector: BasemapSelector; + + async function makeSelector(model: AnyModel) { + const container = document.createElement("div"); + selectorRender.render({ + model, el: container, experimental: { + invoke: () => new Promise(() => [model, []]), + } + }); + const element = container.firstElementChild as BasemapSelector; + document.body.appendChild(element); + await element.updateComplete; + return element; + } + + beforeEach(async () => { + selector = await makeSelector(new FakeAnyModel({ + basemaps: ["select", "default", "bounded"], + value: "default", + })); + }); + + afterEach(() => { + Array.from(document.querySelectorAll("basemap-selector")).forEach((el) => { + el.remove(); + }) + }); + + it("can be instantiated.", () => { + expect(selector.shadowRoot?.querySelector("select")?.textContent).toContain("bounded"); + }); + + it("renders the basemap options.", () => { + const options = selector.shadowRoot?.querySelectorAll("option")!; + expect(options.length).toBe(3); + expect(options[0].textContent).toContain("select"); + expect(options[1].textContent).toContain("default"); + expect(options[2].textContent).toContain("bounded"); + }); + + it("setting the value on model changes the value on select.", async () => { + selector.value = "select"; + await selector.updateComplete; + expect(selector.selectElement.value).toBe("select"); + }); + + it("sets value on model when option changes.", async () => { + const setSpy = spyOn(FakeAnyModel.prototype, "set"); + const saveSpy = spyOn(FakeAnyModel.prototype, "save_changes"); + + selector.selectElement.value = "select"; + selector.selectElement.dispatchEvent(new Event('change')); + + await selector.updateComplete; + expect(setSpy).toHaveBeenCalledOnceWith("value", "select"); + expect(saveSpy).toHaveBeenCalledTimes(1); + }); + + it("emits close event when clicked.", async () => { + const sendSpy = spyOn(FakeAnyModel.prototype, "send"); + // Close button emits an event. + (selector.shadowRoot?.querySelector(".close-button") as HTMLButtonElement).click(); + await selector.updateComplete; + expect(sendSpy).toHaveBeenCalledOnceWith({ + type: "click", + id: "close" + }); + }); +}); \ No newline at end of file diff --git a/tests/test_map_widgets.py b/tests/test_map_widgets.py index 4a09922f98..21ca99378c 100644 --- a/tests/test_map_widgets.py +++ b/tests/test_map_widgets.py @@ -638,51 +638,32 @@ def test_visibility_updates_children(self): self.assertTrue(child.visible) -class TestBasemap(unittest.TestCase): - """Tests for the Basemap class in the `map_widgets` module.""" +class TestBasemapSelector(unittest.TestCase): + """Tests for the BasemapSelector class in the `map_widgets` module.""" def setUp(self): self.basemaps = ["first", "default", "bounded"] self.default = "default" - self.basemap_widget = map_widgets.Basemap(self.basemaps, self.default) + self.basemap_widget = map_widgets.BasemapSelector(self.basemaps, self.default) - @property - def _close_button(self): - return utils.query_widget( - self.basemap_widget, - ipywidgets.Button, - lambda c: c.tooltip == "Close the basemap widget", - ) - - @property - def _dropdown(self): - return utils.query_widget( - self.basemap_widget, ipywidgets.Dropdown, lambda _: True - ) - - def test_basemap(self): - """Tests that the basemap's initial UI is set up properly.""" - self.assertIsNotNone(self._close_button) - self.assertIsNotNone(self._dropdown) - self.assertEqual(self._dropdown.value, "default") - self.assertEqual(len(self._dropdown.options), 3) + def test_basemap_default(self): + """Tests that the default value is set.""" + self.assertEqual(self.basemap_widget.value, "default") def test_basemap_close(self): - """Tests that triggering the closing button fires the close event.""" + """Tests that triggering the closing button fires the close callback.""" on_close_mock = Mock() self.basemap_widget.on_close = on_close_mock - self._close_button.click() - + msg = {"type": "click", "id": "close"} + self.basemap_widget._handle_custom_msg(msg, []) # pylint: disable=protected-access on_close_mock.assert_called_once() - def test_basemap_selection(self): - """Tests that a basemap selection fires the selected event.""" - on_basemap_changed_mock = Mock() - self.basemap_widget.on_basemap_changed = on_basemap_changed_mock - - self._dropdown.value = "first" - - on_basemap_changed_mock.assert_called_once() + def test_basemap_change(self): + """Tests that value change fires the basemap_changed callback.""" + on_change_mock = Mock() + self.basemap_widget.on_basemap_changed = on_change_mock + self.basemap_widget.value = "ROADMAP" + on_change_mock.assert_called_once_with("ROADMAP") class LayerEditorTestHarness: From 8058de7da8d05ab78e79f10aeb1d4a5297ec019f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 14 Nov 2024 00:05:28 +0000 Subject: [PATCH 36/57] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- js/basemap_selector.ts | 2 +- tests/test_map_widgets.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/js/basemap_selector.ts b/js/basemap_selector.ts index 56613cc64e..b69f7786fb 100644 --- a/js/basemap_selector.ts +++ b/js/basemap_selector.ts @@ -68,7 +68,7 @@ export class BasemapSelector extends LitWidget< `; } - + override update(changedProperties: PropertyValues): void { if (changedProperties.has("value") && this.selectElement) { this.selectElement.value = this.value; diff --git a/tests/test_map_widgets.py b/tests/test_map_widgets.py index 21ca99378c..2ca57a8333 100644 --- a/tests/test_map_widgets.py +++ b/tests/test_map_widgets.py @@ -655,7 +655,9 @@ def test_basemap_close(self): on_close_mock = Mock() self.basemap_widget.on_close = on_close_mock msg = {"type": "click", "id": "close"} - self.basemap_widget._handle_custom_msg(msg, []) # pylint: disable=protected-access + self.basemap_widget._handle_custom_msg( + msg, [] + ) # pylint: disable=protected-access on_close_mock.assert_called_once() def test_basemap_change(self): From 98c61bbd4949848036dc330e39dc1750ddc09ed1 Mon Sep 17 00:00:00 2001 From: Sufyan Abbasi Date: Thu, 14 Nov 2024 00:13:10 +0000 Subject: [PATCH 37/57] Increase margin to 4px --- js/basemap_selector.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/basemap_selector.ts b/js/basemap_selector.ts index 56613cc64e..0688b30252 100644 --- a/js/basemap_selector.ts +++ b/js/basemap_selector.ts @@ -27,15 +27,15 @@ export class BasemapSelector extends LitWidget< .row-container { align-items: center; display: flex; - gap: 2px; height: 32px; width: 200px; } .row-button { font-size: 14px; - height: 28px; - width: 28px; + height: 26px; + margin: 4px; + width: 26px; } `, ]; From 010d2be7582fc357991fa164c93c6af048f57e17 Mon Sep 17 00:00:00 2001 From: Sufyan Abbasi Date: Thu, 14 Nov 2024 09:04:25 +0000 Subject: [PATCH 38/57] Add working, rough toolbar (broken layer_manager) --- geemap/core.py | 63 +++----- geemap/toolbar.py | 342 +++++++++++++-------------------------- js/basemap_selector.ts | 2 +- js/layer_manager copy.ts | 98 ----------- js/layer_manager.ts | 7 - js/layer_manager_row.ts | 4 +- js/tab_panel.ts | 22 +-- js/toolbar.ts | 96 ++++++++--- js/toolbar_item.ts | 25 ++- js/utils.ts | 8 +- tests/test_toolbar.py | 24 +-- 11 files changed, 249 insertions(+), 442 deletions(-) delete mode 100644 js/layer_manager copy.ts diff --git a/geemap/core.py b/geemap/core.py index 40110d26df..254ee81c9e 100644 --- a/geemap/core.py +++ b/geemap/core.py @@ -916,25 +916,6 @@ def add(self, obj: Any, position: str = "", **kwargs: Any) -> None: else: super().add(obj) - def _on_toggle_toolbar_layers(self, is_open: bool) -> None: - """Handles the toggle event for the toolbar layers. - - Args: - is_open (bool): Whether the toolbar layers are open. - """ - if is_open: - if self._layer_manager: - return - - layer_manager = map_widgets.LayerManager(self) - layer_manager.header_hidden = True - layer_manager.close_button_hidden = True - layer_manager.refresh_layers() - self._toolbar.accessory_widget = layer_manager - else: - self._toolbar.accessory_widget = None - self.remove("layer_manager") - def _add_layer_manager(self, position: str, **kwargs: Any) -> None: """Adds a layer manager to the map. @@ -942,9 +923,6 @@ def _add_layer_manager(self, position: str, **kwargs: Any) -> None: position (str): The position to place the layer manager. **kwargs (Any): Additional keyword arguments. """ - if self._layer_manager: - return - layer_manager = map_widgets.LayerManager(self, **kwargs) layer_manager.on_close = lambda: self.remove("layer_manager") layer_manager.refresh_layers() @@ -963,16 +941,18 @@ def _add_toolbar(self, position: str, **kwargs: Any) -> None: if self._toolbar: return + layer_manager = map_widgets.LayerManager(self) + layer_manager.header_hidden = True + layer_manager.close_button_hidden = True + layer_manager.refresh_layers() + toolbar_val = toolbar.Toolbar( - self, self._toolbar_main_tools(), self._toolbar_extra_tools(), **kwargs - ) - toolbar_val.on_layers_toggled = self._on_toggle_toolbar_layers + self, self._toolbar_main_tools(), self._toolbar_extra_tools(), layer_manager + ) toolbar_control = ipyleaflet.WidgetControl( widget=toolbar_val, position=position ) super().add(toolbar_control) - # Enable the layer manager by default. - toolbar_val.toggle_layers(True) def _add_inspector(self, position: str, **kwargs: Any) -> None: """Adds an inspector to the map. @@ -1254,63 +1234,64 @@ def _add_colorbar( return control def _open_help_page( - self, host_map: "MapInterface", selected: bool, item: toolbar.Toolbar.Item + self, host_map: "MapInterface", selected: bool, item: toolbar.ToolbarItem ) -> None: """Opens the help page. Args: host_map (MapInterface): The host map. selected (bool): Whether the item is selected. - item (toolbar.Toolbar.Item): The toolbar item. + item (toolbar.ToolbarItem): The toolbar item. """ del host_map, item # Unused. if selected: coreutils.open_url("https://geemap.org") - def _toolbar_main_tools(self) -> List[toolbar.Toolbar.Item]: + def _toolbar_main_tools(self) -> List[toolbar.ToolbarItem]: """Gets the main tools for the toolbar. Returns: - List[toolbar.Toolbar.Item]: The main tools for the toolbar. + List[toolbar.ToolbarItem]: The main tools for the toolbar. """ @toolbar._cleanup_toolbar_item def inspector_tool_callback( - map: Map, selected: bool, item: toolbar.Toolbar.Item + map: Map, selected: bool, item: toolbar.ToolbarItem ): del selected, item # Unused. map.add("inspector") return map._inspector @toolbar._cleanup_toolbar_item - def basemap_tool_callback(map: Map, selected: bool, item: toolbar.Toolbar.Item): + def basemap_tool_callback(map: Map, selected: bool, item: toolbar.ToolbarItem): del selected, item # Unused. map.add("basemap_selector") return map._basemap_selector return [ - toolbar.Toolbar.Item( + toolbar.ToolbarItem( icon="map", tooltip="Basemap selector", callback=basemap_tool_callback, - reset=False, ), - toolbar.Toolbar.Item( + toolbar.ToolbarItem( icon="info", tooltip="Inspector", callback=inspector_tool_callback, - reset=False, ), - toolbar.Toolbar.Item( - icon="question", tooltip="Get help", callback=self._open_help_page + toolbar.ToolbarItem( + icon="question_mark", + tooltip="Get help", + callback=self._open_help_page, + reset=True, ), ] - def _toolbar_extra_tools(self) -> Optional[List[toolbar.Toolbar.Item]]: + def _toolbar_extra_tools(self) -> Optional[List[toolbar.ToolbarItem]]: """Gets the extra tools for the toolbar. Returns: - Optional[List[toolbar.Toolbar.Item]]: The extra tools for the toolbar. + Optional[List[toolbar.ToolbarItem]]: The extra tools for the toolbar. """ return None diff --git a/geemap/toolbar.py b/geemap/toolbar.py index e2410afc62..ef60d14406 100644 --- a/geemap/toolbar.py +++ b/geemap/toolbar.py @@ -29,228 +29,127 @@ from . import map_widgets -@Theme.apply + +@map_widgets.Theme.apply class ToolbarItem(anywidget.AnyWidget): """A toolbar item widget for geemap.""" _esm = pathlib.Path(__file__).parent / "static" / "toolbar_item.js" active = traitlets.Bool(False).tag(sync=True) - icon = traitlets.Unicode('').tag(sync=True) - is_loading = traitlets.Bool(False).tag(sync=True) - - -@map_widgets.Theme.apply -class Toolbar(anywidget.AnyWidget): - """A toolbar that can be added to the map.""" - - - _esm = pathlib.Path(__file__).parent / "static" / "toolbar.js" - # Whether the toolbar is expanded. - expanded = traitlets.Bool(True).tag(sync=True) - - - @dataclass - class Item: - """A representation of an item in the toolbar. + icon = traitlets.Unicode("").tag(sync=True) + tooltip_ = traitlets.Unicode("").tag(sync=True) + + def __init__( + self, + icon: str, + tooltip: str, + callback: Callable[[Any, bool, Any], None], + control: Optional[widgets.Widget] = None, + reset=False, + active=False, + ): + """A togglable, toolbar item. - Attributes: - icon: The icon to use for the item, from https://fontawesome.com/icons. + Args: + icon (str): The icon hexcode to use, from https://fonts.google.com/icons. tooltip: The tooltip text to show a user on hover. callback: A callback function to execute when the item icon is clicked. Its signature should be `callback(map, selected, item)`, where `map` is the host map, `selected` is a boolean indicating if the user selected or unselected the tool, and `item` is this object. - reset: Whether to reset the selection after the callback has finished. control: The control widget associated with this item. Used to cleanup state when toggled off. - toggle_button: The toggle button controlling the item. + reset: Whether to reset the selection after the callback has finished. + active: Whether the tool is currently active. """ + super().__init__() + self.icon = icon + self.tooltip_ = tooltip + self.callback = callback + self.callback_wrapper = lambda *args: None + self.control = control + self.reset = reset + self.active = active + + def toggle_off(self): + if self.active: + self.active = False + + @traitlets.observe("active") + def _observe_value(self, change: Dict[str, Any]) -> None: + if (value := change.get("new")) is not None: + self.callback_wrapper(self.callback, value, self) + if self.active and self.reset: + self.active = False + + +@map_widgets.Theme.apply +class Toolbar(anywidget.AnyWidget): + """A toolbar that can be added to the map.""" - icon: str - tooltip: str - callback: Callable[[Any, bool, Any], None] - reset: bool = True - control: Optional[widgets.Widget] = None - toggle_button: Optional[widgets.ToggleButton] = None + _esm = pathlib.Path(__file__).parent / "static" / "toolbar.js" + + # The accessory widget. + accessory_widget = map_widgets.TypedTuple( + trait=traitlets.Instance(widgets.Widget), + help="The accessory widget", + ).tag(sync=True, **widgets.widget_serialization) + + # The list of main tools. + main_tools = map_widgets.TypedTuple( + trait=traitlets.Instance(widgets.Widget), + help="List of main tools", + ).tag(sync=True, **widgets.widget_serialization) - def toggle_off(self): - if self.toggle_button: - self.toggle_button.value = False + # The list of extra tools. + extra_tools = map_widgets.TypedTuple( + trait=traitlets.Instance(widgets.Widget), + help="List of extra tools", + ).tag(sync=True, **widgets.widget_serialization) - ICON_WIDTH = "32px" - ICON_HEIGHT = "32px" - NUM_COLS = 3 + # Whether the toolbar is expanded. + expanded = traitlets.Bool(False).tag(sync=True) - _TOGGLE_TOOL_EXPAND_ICON = "plus" + _TOGGLE_TOOL_EXPAND_ICON = "add" _TOGGLE_TOOL_EXPAND_TOOLTIP = "Expand toolbar" - _TOGGLE_TOOL_COLLAPSE_ICON = "minus" + _TOGGLE_TOOL_COLLAPSE_ICON = "remove" _TOGGLE_TOOL_COLLAPSE_TOOLTIP = "Collapse toolbar" - def __init__(self, host_map, main_tools, extra_tools=None): + def __init__(self, host_map, main_tools, extra_tools, accessory_widget): """Adds a toolbar with `main_tools` and `extra_tools` to the `host_map`.""" + super().__init__() if not main_tools: raise ValueError("A toolbar cannot be initialized without `main_tools`.") self.host_map = host_map - self.toggle_tool = Toolbar.Item( + self.toggle_tool = ToolbarItem( icon=self._TOGGLE_TOOL_EXPAND_ICON, tooltip=self._TOGGLE_TOOL_EXPAND_TOOLTIP, callback=self._toggle_callback, + reset=True, ) - self.on_layers_toggled = None - self._accessory_widget = None - - if extra_tools: - all_tools = main_tools + [self.toggle_tool] + extra_tools - else: - all_tools = main_tools - icons = [tool.icon for tool in all_tools] - tooltips = [tool.tooltip for tool in all_tools] - callbacks = [tool.callback for tool in all_tools] - resets = [tool.reset for tool in all_tools] - self.num_collapsed_tools = len(main_tools) + (1 if extra_tools else 0) - # -(-a//b) is the same as math.ceil(a/b) - self.num_rows_expanded = -(-len(all_tools) // self.NUM_COLS) - self.num_rows_collapsed = -(-self.num_collapsed_tools // self.NUM_COLS) - - self.all_widgets = [ - widgets.ToggleButton( - layout=widgets.Layout( - width="auto", height="auto", padding="0px 0px 0px 4px" - ), - button_style="primary", - icon=icons[i], - tooltip=tooltips[i], - ) - for i in range(len(all_tools)) - ] - self.toggle_widget = self.all_widgets[len(main_tools)] if extra_tools else None - - # We start with a collapsed grid of just the main tools and the toggle one. - self.grid = widgets.GridBox( - children=self.all_widgets[: self.num_collapsed_tools], - layout=widgets.Layout( - width="109px", - grid_template_columns=(self.ICON_WIDTH + " ") * self.NUM_COLS, - grid_template_rows=(self.ICON_HEIGHT + " ") * self.num_rows_collapsed, - grid_gap="1px 1px", - padding="5px", - ), - ) - - def curry_callback(callback, should_reset_after, widget, item): - def returned_callback(change): - if change["type"] != "change": - return - callback(self.host_map, change["new"], item) - if should_reset_after: - widget.value = False - - return returned_callback - - for id, widget in enumerate(self.all_widgets): - all_tools[id].toggle_button = widget - widget.observe( - curry_callback(callbacks[id], resets[id], widget, all_tools[id]), - "value", - ) - - self.toolbar_button = widgets.ToggleButton( - value=False, - tooltip="Toolbar", - icon="wrench", - layout=widgets.Layout( - width="28px", height="28px", padding="0px 0px 0px 4px" - ), - ) - - self.layers_button = widgets.ToggleButton( - value=False, - tooltip="Layers", - icon="server", - layout=widgets.Layout(height="28px", width="72px"), - ) - - self.toolbar_header = widgets.HBox( - layout=widgets.Layout( - display="flex", justify_content="flex-end", align_items="center" - ) - ) - self.toolbar_header.children = [self.layers_button, self.toolbar_button] - self.toolbar_footer = widgets.VBox() - self.toolbar_footer.children = [self.grid] - - self.toolbar_button.observe(self._toolbar_btn_click, "value") - self.layers_button.observe(self._layers_btn_click, "value") - - super().__init__(children=[self.toolbar_header]) + self.main_tools = main_tools + ([self.toggle_tool] if extra_tools else []) + self.extra_tools = extra_tools + for widget in self.main_tools + self.extra_tools: + widget.callback_wrapper = lambda callback, value, tool: callback(self.host_map, value, tool) + self.accessory_widget = [accessory_widget] def reset(self): """Resets the toolbar so that no widget is selected.""" - for widget in self.all_widgets: + for widget in self.main_tools + self.extra_tools: widget.value = False - def toggle_layers(self, enabled): - self.layers_button.value = enabled - self.on_layers_toggled(enabled) - if enabled: - self.toolbar_button.value = False - - def _reset_others(self, current): - for other in self.all_widgets: - if other is not current: - other.value = False - def _toggle_callback(self, m, selected, item): del m, item # unused if not selected: return - if self.toggle_widget.icon == self._TOGGLE_TOOL_EXPAND_ICON: - self.grid.layout.grid_template_rows = ( - self.ICON_HEIGHT + " " - ) * self.num_rows_expanded - self.grid.children = self.all_widgets - self.toggle_widget.tooltip = self._TOGGLE_TOOL_COLLAPSE_TOOLTIP - self.toggle_widget.icon = self._TOGGLE_TOOL_COLLAPSE_ICON - elif self.toggle_widget.icon == self._TOGGLE_TOOL_COLLAPSE_ICON: - self.grid.layout.grid_template_rows = ( - self.ICON_HEIGHT + " " - ) * self.num_rows_collapsed - self.grid.children = self.all_widgets[: self.num_collapsed_tools] - self.toggle_widget.tooltip = self._TOGGLE_TOOL_EXPAND_TOOLTIP - self.toggle_widget.icon = self._TOGGLE_TOOL_EXPAND_ICON - - def _toolbar_btn_click(self, change): - if change["new"]: - self.layers_button.value = False - self.children = [self.toolbar_header, self.toolbar_footer] - else: - if not self.layers_button.value: - self.children = [self.toolbar_header] - - def _layers_btn_click(self, change): - # Allow callbacks to set accessory_widget to prevent flicker on click. - if self.on_layers_toggled: - self.on_layers_toggled(change["new"]) - if change["new"]: - self.toolbar_button.value = False - self.children = [self.toolbar_header, self.toolbar_footer] - else: - if not self.toolbar_button.value: - self.children = [self.toolbar_header] - - @property - def accessory_widget(self): - """A widget that temporarily replaces the tool grid.""" - return self._accessory_widget - - @accessory_widget.setter - def accessory_widget(self, value): - """Sets the widget that temporarily replaces the tool grid.""" - self._accessory_widget = value - if self._accessory_widget: - self.toolbar_footer.children = [self._accessory_widget] - else: - self.toolbar_footer.children = [self.grid] + if self.toggle_tool.icon == self._TOGGLE_TOOL_EXPAND_ICON: + self.expanded = True + self.toggle_tool.tooltip = self._TOGGLE_TOOL_COLLAPSE_TOOLTIP + self.toggle_tool.icon = self._TOGGLE_TOOL_COLLAPSE_ICON + elif self.toggle_tool.icon == self._TOGGLE_TOOL_COLLAPSE_ICON: + self.expanded = False + self.toggle_tool.tooltip = self._TOGGLE_TOOL_EXPAND_TOOLTIP + self.toggle_tool.icon = self._TOGGLE_TOOL_EXPAND_ICON def inspector_gui(m=None): @@ -4511,101 +4410,90 @@ def _cog_stac_inspector_callback(map, selected, item): main_tools = [ - Toolbar.Item( + ToolbarItem( icon="info", tooltip="Inspector", callback=_inspector_tool_callback, - reset=False, ), - Toolbar.Item( - icon="bar-chart", + ToolbarItem( + icon="bar_chart", tooltip="Plotting", callback=_plotting_tool_callback, - reset=False, ), - Toolbar.Item( - icon="globe", + ToolbarItem( + icon="history", tooltip="Create timelapse", callback=_timelapse_tool_callback, - reset=False, ), - Toolbar.Item( + ToolbarItem( icon="map", tooltip="Change basemap", callback=_basemap_tool_callback, - reset=False, ), - Toolbar.Item( - icon="retweet", + ToolbarItem( + icon="code", tooltip="Convert Earth Engine JavaScript to Python", callback=_convert_js_tool_callback, - reset=False, ), ] extra_tools = [ - Toolbar.Item( - icon="eraser", + ToolbarItem( + icon="ink_eraser", tooltip="Remove all drawn features", callback=lambda m, selected, _: m.remove_drawn_features() if selected else None, + reset=True, ), - Toolbar.Item( - icon="folder-open", + ToolbarItem( + icon="upload", tooltip="Open local vector/raster data", callback=_open_data_tool_callback, - reset=False, ), - Toolbar.Item( - icon="gears", + ToolbarItem( + icon="manufacturing", tooltip="WhiteboxTools for local geoprocessing", callback=_whitebox_tool_callback, - reset=False, ), - Toolbar.Item( - icon="google", + ToolbarItem( + icon="dns", tooltip="GEE Toolbox for cloud computing", callback=_gee_toolbox_tool_callback, - reset=False, ), - Toolbar.Item( - icon="fast-forward", + ToolbarItem( + icon="fast_forward", tooltip="Activate timeslider", callback=_time_slider_tool_callback, - reset=False, ), - Toolbar.Item( - icon="hand-o-up", + ToolbarItem( + icon="pan_tool_alt", tooltip="Collect training samples", callback=_collect_samples_tool_callback, - reset=False, ), - Toolbar.Item( - icon="line-chart", + ToolbarItem( + icon="show_chart", tooltip="Creating and plotting transects", callback=_plot_transect_tool_callback, - reset=False, ), - Toolbar.Item( - icon="random", + ToolbarItem( + icon="multiline_chart", tooltip="Sankey plots", callback=_sankee_tool_callback, - reset=False, ), - Toolbar.Item( - icon="adjust", + ToolbarItem( + icon="travel_explore", tooltip="Planet imagery", callback=_split_basemaps_tool_callback, ), - Toolbar.Item( - icon="info-circle", + ToolbarItem( + icon="target", tooltip="Get COG/STAC pixel value", callback=_cog_stac_inspector_callback, - reset=False, ), - Toolbar.Item( - icon="question", + ToolbarItem( + icon="question_mark", tooltip="Get help", callback=_open_help_page_callback, + reset=True, ), ] diff --git a/js/basemap_selector.ts b/js/basemap_selector.ts index 06c2682afa..08935f5f12 100644 --- a/js/basemap_selector.ts +++ b/js/basemap_selector.ts @@ -64,7 +64,7 @@ export class BasemapSelector extends LitWidget< class="legacy-button row-button close-button" @click="${this.onCloseClicked}" > - + close `; } diff --git a/js/layer_manager copy.ts b/js/layer_manager copy.ts deleted file mode 100644 index 4a3dd3f787..0000000000 --- a/js/layer_manager copy.ts +++ /dev/null @@ -1,98 +0,0 @@ -import type { RenderProps } from "@anywidget/types"; -import { html, css, TemplateResult } from "lit"; -import { property } from "lit/decorators.js"; - -import { legacyStyles } from "./ipywidgets_styles"; -import { LitWidget } from "./lit_widget"; -import { loadFonts, updateChildren } from "./utils"; - -export interface LayerManagerModel { - children: any; - visible: boolean; -} - -export class LayerManager extends LitWidget< - LayerManagerModel, - LayerManager -> { - static get componentName() { - return `layer-manager`; - } - - static styles = [ - legacyStyles, - css` - .container { - padding: 0 4px 2px 4px; - } - - .row { - align-items: center; - display: flex; - gap: 4px; - height: 30px; - } - - .visibility-checkbox { - margin: 2px; - } - `, - ]; - - @property() visible: boolean = false; - - modelNameToViewName(): Map< - keyof LayerManagerModel, - keyof LayerManager | null - > { - return new Map([ - ["children", null], - ["visible", "visible"], - ]); - } - - render(): TemplateResult { - return html` -
-
- - All layers on/off -
- -
- `; - } - - private onLayerVisibilityChanged(event: Event): void { - const target = event.target as HTMLInputElement; - this.visible = target.checked; - } -} - -// Without this check, there's a component registry issue when developing locally. -if (!customElements.get(LayerManager.componentName)) { - customElements.define(LayerManager.componentName, LayerManager); -} - -async function render({ model, el }: RenderProps) { - loadFonts(); - const manager = ( - document.createElement(LayerManager.componentName) - ); - manager.model = model; - el.appendChild(manager); - - updateChildren(manager, model); - model.on("change:children", () => { - updateChildren(manager, model); - }); -} - -export default { render }; diff --git a/js/layer_manager.ts b/js/layer_manager.ts index ef0e2cb57a..4a3dd3f787 100644 --- a/js/layer_manager.ts +++ b/js/layer_manager.ts @@ -6,8 +6,6 @@ import { legacyStyles } from "./ipywidgets_styles"; import { LitWidget } from "./lit_widget"; import { loadFonts, updateChildren } from "./utils"; -import './tab_panel'; - export interface LayerManagerModel { children: any; visible: boolean; @@ -68,11 +66,6 @@ export class LayerManager extends LitWidget< > - -
one
-
two
-
three
-
`; } diff --git a/js/layer_manager_row.ts b/js/layer_manager_row.ts index bc2d4dbbca..33bcae4115 100644 --- a/js/layer_manager_row.ts +++ b/js/layer_manager_row.ts @@ -153,7 +153,7 @@ export class LayerManagerRow extends LitWidget< class="legacy-button row-button settings-button" @click="${this.onSettingsClicked}" > - + settings diff --git a/js/tab_panel.ts b/js/tab_panel.ts index 77c67d121e..013735e03e 100644 --- a/js/tab_panel.ts +++ b/js/tab_panel.ts @@ -2,7 +2,7 @@ import { html, css, nothing, LitElement, PropertyValues } from "lit"; import { property, queryAll, queryAssignedElements } from "lit/decorators.js"; import { legacyStyles } from "./ipywidgets_styles"; import { classMap } from 'lit/directives/class-map.js'; -import { unsafeHTML } from 'lit/directives/unsafe-html.js'; +import { materialStyles } from "./styles"; function convertToId(name: string | undefined): string { return (name || "").trim().replace(" ", "-").toLowerCase(); @@ -36,6 +36,7 @@ export class TabPanel extends LitElement { static styles = [ legacyStyles, + materialStyles, css` ::slotted(*) { display: none; @@ -54,18 +55,24 @@ export class TabPanel extends LitElement { align-items: center; display: flex; flex-direction: row; - justify-content: flex-start; + justify-content: flex-end; } .tab-container button { - margin: 2px; - padding: 0 4px; + border-radius: 5px; + font-size: 16px; + margin-right: 2px; + padding: 5px 19px; user-select: none; } .tab-container button:first-child { margin-left: 0; } + + .tab-container button:last-child { + margin-right: 0; + } `, ]; @@ -129,11 +136,6 @@ export class TabPanel extends LitElement { private renderTabs() { return this.tabs.map((tab: TabLabel, i: number) => { const id = convertToId(this.tabs[i].name); - // Strictly validate the icon, since we are using unsafeHTML - // directive to render the HTML entity directly. - if (tab.icon && !tab.icon.match(/^&#x[a-fA-F0-9]+;$/)) { - tab.icon = ''; - } return html``; }); diff --git a/js/toolbar.ts b/js/toolbar.ts index a67b21bbe9..8e67b55510 100644 --- a/js/toolbar.ts +++ b/js/toolbar.ts @@ -1,13 +1,17 @@ import type { AnyModel, RenderProps } from "@anywidget/types"; import { html, css, LitElement } from "lit"; import { property } from "lit/decorators.js"; -import { legacyStyles } from './ipywidgets_styles'; +import { legacyStyles } from "./ipywidgets_styles"; import { loadFonts, updateChildren } from "./utils"; -import './tab_panel'; +import "./tab_panel"; +import { classMap } from "lit/directives/class-map.js"; +import { materialStyles } from "./styles"; export interface ToolbarModel { - children: any; + accessory_widget: any; + main_tools: any; + extra_tools: any expanded: boolean; } @@ -18,15 +22,40 @@ export class Toolbar extends LitElement { static styles = [ legacyStyles, + materialStyles, css` - .container { - padding: 0 4px 2px 4px; - }`, + .hide { + display: none; + } + + .expanded { + display: block; !important + } + + .tools-container { + padding: 4px; + } + + slot[name="extra-tools"] { + margin-top: 4px; + } + + ::slotted([slot="main-tools"]), + ::slotted([slot="extra-tools"]) { + align-items: center; + display: inline-grid; + grid-template-columns: auto auto auto; + grid-gap: 4px; + justify-items: center; + } + `, ]; private _model: AnyModel | undefined = undefined; private static modelNameToViewName = new Map([ - ["children", null], + ["accessory_widget", null], + ["main_tools", null], + ["extra_tools", null], ["expanded", "expanded"], ]); @@ -49,12 +78,20 @@ export class Toolbar extends LitElement { render() { return html` -
- - - - -
+ +
+ +
+
+ + +
+
`; } @@ -65,11 +102,6 @@ export class Toolbar extends LitElement { } this._model?.save_changes(); } - - private onLayerVisibilityChanged(event: Event) { - const target = event.target as HTMLInputElement; - this.visible = target.checked; - } } // Without this check, there's a component registry issue when developing locally. @@ -83,9 +115,31 @@ async function render({ model, el }: RenderProps) { manager.model = model; el.appendChild(manager); - updateChildren(manager, model); - model.on("change:children", () => { - updateChildren(manager, model); + const accessoryWidgetEl = document.createElement("div"); + accessoryWidgetEl.slot = "accessory-widget"; + manager.appendChild(accessoryWidgetEl); + + updateChildren(accessoryWidgetEl, model, "accessory_widget"); + model.on("change:accessory_widget", () => { + updateChildren(accessoryWidgetEl, model, "accessory_widget"); + }); + + const mainToolsEl = document.createElement("div"); + mainToolsEl.slot = "main-tools"; + manager.appendChild(mainToolsEl); + + updateChildren(mainToolsEl, model, "main_tools"); + model.on("change:main_tools", () => { + updateChildren(mainToolsEl, model, "main_tools"); + }); + + const extraToolsEl = document.createElement("div"); + extraToolsEl.slot = "extra-tools"; + manager.appendChild(extraToolsEl); + + updateChildren(extraToolsEl, model, "extra_tools"); + model.on("change:extra_tools", () => { + updateChildren(extraToolsEl, model, "extra_tools"); }); } diff --git a/js/toolbar_item.ts b/js/toolbar_item.ts index 3229ae8669..f331fae290 100644 --- a/js/toolbar_item.ts +++ b/js/toolbar_item.ts @@ -2,15 +2,16 @@ import type { AnyModel, RenderProps } from "@anywidget/types"; import { html, css, LitElement } from "lit"; import { property } from "lit/decorators.js"; import { classMap } from 'lit/directives/class-map.js'; -import { unsafeHTML } from 'lit/directives/unsafe-html.js'; import { legacyStyles } from './ipywidgets_styles'; import { loadFonts } from "./utils"; +import { materialStyles } from "./styles"; export interface ToolbarItemModel { active: boolean; icon: string; - tooltip: string; + // Note: "tooltip" is already used by ipywidgets. + tooltip_: string; } export class ToolbarItem extends LitElement { @@ -20,11 +21,14 @@ export class ToolbarItem extends LitElement { static styles = [ legacyStyles, + materialStyles, css` button { - height: auto; + font-size: 16px !important; + height: 32px; padding: 0px 0px 0px 4px; - width: auto; + width: 32px; + user-select: none; } `, ]; @@ -33,7 +37,7 @@ export class ToolbarItem extends LitElement { private static modelNameToViewName = new Map([ ["active", "active"], ["icon", "icon"], - ["tooltip", "tooltip"], + ["tooltip_", "tooltip_"], ]); set model(model: AnyModel) { @@ -57,14 +61,9 @@ export class ToolbarItem extends LitElement { icon: string = ''; @property({ type: String }) - tooltip: string = ''; + tooltip_: string = ''; render() { - // Strictly validate the icon, since we are using unsafeHTML - // directive to render the HTML entity directly. - if (this.icon && !this.icon.match(/^&#x[a-fA-F0-9]+;$/)) { - this.icon = ''; - } return html` `; } diff --git a/js/utils.ts b/js/utils.ts index 5431eaf7a2..c93ac022bc 100644 --- a/js/utils.ts +++ b/js/utils.ts @@ -24,9 +24,13 @@ export function loadFonts() { export async function updateChildren( container: HTMLElement, - model: AnyModel + model: AnyModel, + property = "children", ) { - const children = model.get("children"); + let children = model.get(property); + if (!Array.isArray(children)) { + children = [children] + } const child_models = await unpackModels(children, model.widget_manager); const child_views = await Promise.all( child_models.map((model) => model.widget_manager.create_view(model)) diff --git a/tests/test_toolbar.py b/tests/test_toolbar.py index aed699e1d7..74f8424b8d 100644 --- a/tests/test_toolbar.py +++ b/tests/test_toolbar.py @@ -10,7 +10,7 @@ import ipywidgets import geemap -from geemap.toolbar import Toolbar, _cleanup_toolbar_item +from geemap.toolbar import Toolbar, ToolbarItem, _cleanup_toolbar_item from tests import fake_map, utils @@ -34,10 +34,10 @@ def setUp(self) -> None: self.callback_calls = 0 self.last_called_with_selected = None self.last_called_item = None - self.item = Toolbar.Item( + self.item = ToolbarItem( icon="info", tooltip="dummy item", callback=self.dummy_callback ) - self.no_reset_item = Toolbar.Item( + self.no_reset_item = ToolbarItem( icon="question", tooltip="no reset item", callback=self.dummy_callback, @@ -145,22 +145,6 @@ def test_layers_toggle_callback(self): on_toggled_mock.assert_called_once() - def test_accessory_widget(self): - """Verifies the accessory widget replaces the tool grid.""" - map_fake = fake_map.FakeMap() - toolbar = Toolbar(map_fake, [self.item, self.no_reset_item]) - self._query_open_button(toolbar).value = True - self.assertIsNotNone(self._query_tool_grid(toolbar)) - - toolbar.accessory_widget = ipywidgets.ToggleButton(tooltip="test-button") - - self.assertIsNone(self._query_tool_grid(toolbar)) - self.assertIsNotNone( - utils.query_widget( - toolbar, ipywidgets.ToggleButton, lambda c: c.tooltip == "test-button" - ) - ) - @dataclass class TestWidget: selected_count = 0 @@ -177,7 +161,7 @@ def callback(m, selected, item): widget.selected_count += 1 return widget - item = Toolbar.Item( + item = ToolbarItem( icon="info", tooltip="dummy item", callback=callback, reset=False ) map_fake = fake_map.FakeMap() From 79202bb0106a98e7b42ce9c6cef031e8a42e444f Mon Sep 17 00:00:00 2001 From: Sufyan Abbasi Date: Thu, 14 Nov 2024 09:16:58 +0000 Subject: [PATCH 39/57] Add None check to plot tool --- geemap/toolbar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geemap/toolbar.py b/geemap/toolbar.py index ef60d14406..f0621d6bea 100644 --- a/geemap/toolbar.py +++ b/geemap/toolbar.py @@ -640,7 +640,7 @@ def handle_interaction(**kwargs): dict_values = dict(zip(b_names, [dict_values_tmp[b] for b in b_names])) generate_chart(dict_values, latlon) except Exception as e: - if hasattr(m, "_plot_widget"): + if hasattr(m, "_plot_widget") and m._plot_widget is not None: m._plot_widget.clear_output() with m._plot_widget: print("No data for the clicked location.") From 2b417ee808e6471970861840075cfd7f88f1afac Mon Sep 17 00:00:00 2001 From: Sufyan Abbasi Date: Thu, 14 Nov 2024 09:24:38 +0000 Subject: [PATCH 40/57] Return empty list for extra tools in core --- geemap/core.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/geemap/core.py b/geemap/core.py index 254ee81c9e..2f965db185 100644 --- a/geemap/core.py +++ b/geemap/core.py @@ -1287,13 +1287,13 @@ def basemap_tool_callback(map: Map, selected: bool, item: toolbar.ToolbarItem): ), ] - def _toolbar_extra_tools(self) -> Optional[List[toolbar.ToolbarItem]]: + def _toolbar_extra_tools(self) -> List[toolbar.ToolbarItem]: """Gets the extra tools for the toolbar. Returns: - Optional[List[toolbar.ToolbarItem]]: The extra tools for the toolbar. + List[toolbar.ToolbarItem]: The extra tools for the toolbar. """ - return None + return [] def _control_config(self) -> Dict[str, List[str]]: """Gets the control configuration. From f98f91a6eb4a227bde5113ba5e7a580682f06eb8 Mon Sep 17 00:00:00 2001 From: Sufyan Abbasi Date: Thu, 14 Nov 2024 09:35:42 +0000 Subject: [PATCH 41/57] Unbreak layer_manager --- geemap/core.py | 12 +++++++++--- geemap/toolbar.py | 6 +++--- js/toolbar.ts | 10 +++++----- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/geemap/core.py b/geemap/core.py index 2f965db185..be1bdd3585 100644 --- a/geemap/core.py +++ b/geemap/core.py @@ -673,8 +673,14 @@ def _layer_manager(self) -> Optional[map_widgets.LayerManager]: Optional[map_widgets.LayerManager]: The layer manager widget if found, else None. """ if toolbar_widget := self._toolbar: - if isinstance(toolbar_widget.accessory_widget, map_widgets.LayerManager): - return toolbar_widget.accessory_widget + return next( + ( + widget + for widget in toolbar_widget.accessory_widgets + if isinstance(widget, map_widgets.LayerManager) + ), + None, + ) return self._find_widget_of_type(map_widgets.LayerManager) @property @@ -948,7 +954,7 @@ def _add_toolbar(self, position: str, **kwargs: Any) -> None: toolbar_val = toolbar.Toolbar( self, self._toolbar_main_tools(), self._toolbar_extra_tools(), layer_manager - ) + ) toolbar_control = ipyleaflet.WidgetControl( widget=toolbar_val, position=position ) diff --git a/geemap/toolbar.py b/geemap/toolbar.py index f0621d6bea..653b969e2f 100644 --- a/geemap/toolbar.py +++ b/geemap/toolbar.py @@ -90,7 +90,7 @@ class Toolbar(anywidget.AnyWidget): _esm = pathlib.Path(__file__).parent / "static" / "toolbar.js" # The accessory widget. - accessory_widget = map_widgets.TypedTuple( + accessory_widgets = map_widgets.TypedTuple( trait=traitlets.Instance(widgets.Widget), help="The accessory widget", ).tag(sync=True, **widgets.widget_serialization) @@ -115,7 +115,7 @@ class Toolbar(anywidget.AnyWidget): _TOGGLE_TOOL_COLLAPSE_ICON = "remove" _TOGGLE_TOOL_COLLAPSE_TOOLTIP = "Collapse toolbar" - def __init__(self, host_map, main_tools, extra_tools, accessory_widget): + def __init__(self, host_map, main_tools, extra_tools, accessory_widgets): """Adds a toolbar with `main_tools` and `extra_tools` to the `host_map`.""" super().__init__() if not main_tools: @@ -131,7 +131,7 @@ def __init__(self, host_map, main_tools, extra_tools, accessory_widget): self.extra_tools = extra_tools for widget in self.main_tools + self.extra_tools: widget.callback_wrapper = lambda callback, value, tool: callback(self.host_map, value, tool) - self.accessory_widget = [accessory_widget] + self.accessory_widgets = [accessory_widgets] def reset(self): """Resets the toolbar so that no widget is selected.""" diff --git a/js/toolbar.ts b/js/toolbar.ts index 8e67b55510..995838b144 100644 --- a/js/toolbar.ts +++ b/js/toolbar.ts @@ -9,7 +9,7 @@ import { classMap } from "lit/directives/class-map.js"; import { materialStyles } from "./styles"; export interface ToolbarModel { - accessory_widget: any; + accessory_widgets: any; main_tools: any; extra_tools: any expanded: boolean; @@ -53,7 +53,7 @@ export class Toolbar extends LitElement { private _model: AnyModel | undefined = undefined; private static modelNameToViewName = new Map([ - ["accessory_widget", null], + ["accessory_widgets", null], ["main_tools", null], ["extra_tools", null], ["expanded", "expanded"], @@ -119,9 +119,9 @@ async function render({ model, el }: RenderProps) { accessoryWidgetEl.slot = "accessory-widget"; manager.appendChild(accessoryWidgetEl); - updateChildren(accessoryWidgetEl, model, "accessory_widget"); - model.on("change:accessory_widget", () => { - updateChildren(accessoryWidgetEl, model, "accessory_widget"); + updateChildren(accessoryWidgetEl, model, "accessory_widgets"); + model.on("change:accessory_widgets", () => { + updateChildren(accessoryWidgetEl, model, "accessory_widgets"); }); const mainToolsEl = document.createElement("div"); From 78b2066a7414e40f546ff4d538c0fa8c9b247b4a Mon Sep 17 00:00:00 2001 From: Sufyan Abbasi Date: Fri, 15 Nov 2024 01:46:20 +0000 Subject: [PATCH 42/57] Make sure rerendering preserves tab index --- geemap/toolbar.py | 4 +++- js/tab_panel.ts | 25 +++++++++++++++++-------- js/toolbar.ts | 12 +++++++++++- 3 files changed, 31 insertions(+), 10 deletions(-) diff --git a/geemap/toolbar.py b/geemap/toolbar.py index 653b969e2f..95887c3e01 100644 --- a/geemap/toolbar.py +++ b/geemap/toolbar.py @@ -110,6 +110,9 @@ class Toolbar(anywidget.AnyWidget): # Whether the toolbar is expanded. expanded = traitlets.Bool(False).tag(sync=True) + # The currently selected tab. + tabIndex = traitlets.Int(0).tag(sync=True) + _TOGGLE_TOOL_EXPAND_ICON = "add" _TOGGLE_TOOL_EXPAND_TOOLTIP = "Expand toolbar" _TOGGLE_TOOL_COLLAPSE_ICON = "remove" @@ -526,7 +529,6 @@ def ee_plot_gui(m, position="topright", **kwargs): m (object): geemap.Map. position (str, optional): Position of the widget. Defaults to "topright". """ - close_btn = widgets.Button( icon="times", tooltip="Close the plot widget", diff --git a/js/tab_panel.ts b/js/tab_panel.ts index 013735e03e..ce67a221c5 100644 --- a/js/tab_panel.ts +++ b/js/tab_panel.ts @@ -3,6 +3,7 @@ import { property, queryAll, queryAssignedElements } from "lit/decorators.js"; import { legacyStyles } from "./ipywidgets_styles"; import { classMap } from 'lit/directives/class-map.js'; import { materialStyles } from "./styles"; +import { styleMap } from "lit/directives/style-map.js"; function convertToId(name: string | undefined): string { return (name || "").trim().replace(" ", "-").toLowerCase(); @@ -14,10 +15,11 @@ export enum TabMode { HIDE_ON_SECOND_CLICK, } -/** The tab label, as a string or Material Icon. */ -export interface TabLabel { - name: string|undefined, - icon: string|undefined, +/** The tab configuration, as a string or Material Icon. */ +export interface Tab { + name: string | undefined, + icon: string | undefined, + width: number | undefined, } /** @@ -61,9 +63,10 @@ export class TabPanel extends LitElement { .tab-container button { border-radius: 5px; font-size: 16px; + height: 28px; margin-right: 2px; - padding: 5px 19px; user-select: none; + width: 28px; } .tab-container button:first-child { @@ -77,7 +80,7 @@ export class TabPanel extends LitElement { ]; @property({ type: Array }) - tabs: TabLabel[] = []; + tabs: Tab[] = []; @property({ type: Number }) index = 0; @@ -111,7 +114,7 @@ export class TabPanel extends LitElement { override update(changedProperties: PropertyValues) { super.update(changedProperties); - if (changedProperties.has("index")) { + if (changedProperties.has("index") && changedProperties.get("index") != null) { this.updateSlotChildren(); } } @@ -134,13 +137,16 @@ export class TabPanel extends LitElement { } private renderTabs() { - return this.tabs.map((tab: TabLabel, i: number) => { + return this.tabs.map((tab: Tab, i: number) => { const id = convertToId(this.tabs[i].name); return html` `; } @@ -76,7 +76,6 @@ export class BasemapSelector extends LitWidget< super.update(changedProperties); } - private onChange(event: Event) { const target = event.target as HTMLInputElement; this.value = target.value; diff --git a/js/ipywidgets_styles.ts b/js/ipywidgets_styles.ts index 63f0640104..fdb8162293 100644 --- a/js/ipywidgets_styles.ts +++ b/js/ipywidgets_styles.ts @@ -58,27 +58,27 @@ export const legacyStyles = css` } .legacy-select { - padding-right: 20px; - border: var(--jp-widgets-input-border-width) solid var(--jp-widgets-input-border-color); + -moz-appearance: none; + -webkit-appearance: none; + appearance: none; + background-color: var(--jp-widgets-input-background-color); + background-image: var(--jp-widgets-dropdown-arrow); + background-position: right center; + background-repeat: no-repeat; + background-size: 20px; border-radius: 0; - height: inherit; - flex: 1 1 var(--jp-widgets-inline-width-short); - min-width: 0; - box-sizing: border-box; - outline: none !important; + border: var(--jp-widgets-input-border-width) solid var(--jp-widgets-input-border-color); box-shadow: none; - background-color: var(--jp-widgets-input-background-color); + box-sizing: border-box; color: var(--jp-widgets-input-color); + flex: 1 1 var(--jp-widgets-inline-width-short); font-size: var(--jp-widgets-font-size); - vertical-align: top; + height: inherit; + min-width: 0; + outline: none !important; padding-left: calc(var(--jp-widgets-input-padding)* 2); - appearance: none; - -webkit-appearance: none; - -moz-appearance: none; - background-repeat: no-repeat; - background-size: 20px; - background-position: right center; - background-image: var(--jp-widgets-dropdown-arrow); + padding-right: 20px; + vertical-align: top; } } `; diff --git a/js/layer_manager copy.ts b/js/layer_manager copy.ts deleted file mode 100644 index 4a3dd3f787..0000000000 --- a/js/layer_manager copy.ts +++ /dev/null @@ -1,98 +0,0 @@ -import type { RenderProps } from "@anywidget/types"; -import { html, css, TemplateResult } from "lit"; -import { property } from "lit/decorators.js"; - -import { legacyStyles } from "./ipywidgets_styles"; -import { LitWidget } from "./lit_widget"; -import { loadFonts, updateChildren } from "./utils"; - -export interface LayerManagerModel { - children: any; - visible: boolean; -} - -export class LayerManager extends LitWidget< - LayerManagerModel, - LayerManager -> { - static get componentName() { - return `layer-manager`; - } - - static styles = [ - legacyStyles, - css` - .container { - padding: 0 4px 2px 4px; - } - - .row { - align-items: center; - display: flex; - gap: 4px; - height: 30px; - } - - .visibility-checkbox { - margin: 2px; - } - `, - ]; - - @property() visible: boolean = false; - - modelNameToViewName(): Map< - keyof LayerManagerModel, - keyof LayerManager | null - > { - return new Map([ - ["children", null], - ["visible", "visible"], - ]); - } - - render(): TemplateResult { - return html` -
-
- - All layers on/off -
- -
- `; - } - - private onLayerVisibilityChanged(event: Event): void { - const target = event.target as HTMLInputElement; - this.visible = target.checked; - } -} - -// Without this check, there's a component registry issue when developing locally. -if (!customElements.get(LayerManager.componentName)) { - customElements.define(LayerManager.componentName, LayerManager); -} - -async function render({ model, el }: RenderProps) { - loadFonts(); - const manager = ( - document.createElement(LayerManager.componentName) - ); - manager.model = model; - el.appendChild(manager); - - updateChildren(manager, model); - model.on("change:children", () => { - updateChildren(manager, model); - }); -} - -export default { render }; From c3ae62fe51183409b8b6f3c548409586e0e30445 Mon Sep 17 00:00:00 2001 From: Sufyan Abbasi Date: Fri, 15 Nov 2024 22:39:27 +0000 Subject: [PATCH 47/57] Add type annotation --- js/basemap_selector.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/basemap_selector.ts b/js/basemap_selector.ts index 9199c4cb1f..6f38f0a66e 100644 --- a/js/basemap_selector.ts +++ b/js/basemap_selector.ts @@ -16,7 +16,7 @@ export class BasemapSelector extends LitWidget< BasemapSelectorModel, BasemapSelector > { - static get componentName() { + static get componentName(): string { return `basemap-selector`; } From f589730d63f9998a3372912b4fb043e1c65ed8bc Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 15 Nov 2024 23:28:34 +0000 Subject: [PATCH 48/57] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- geemap/toolbar.py | 4 +++- js/tab_panel.ts | 2 +- js/toolbar.ts | 2 +- tests/test_toolbar.py | 3 +-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/geemap/toolbar.py b/geemap/toolbar.py index c38ce39be0..286ea215c5 100644 --- a/geemap/toolbar.py +++ b/geemap/toolbar.py @@ -133,7 +133,9 @@ def __init__(self, host_map, main_tools, extra_tools, accessory_widgets): self.main_tools = main_tools + ([self.toggle_widget] if extra_tools else []) self.extra_tools = extra_tools for widget in self.main_tools + self.extra_tools: - widget.callback_wrapper = lambda callback, value, tool: callback(self.host_map, value, tool) + widget.callback_wrapper = lambda callback, value, tool: callback( + self.host_map, value, tool + ) self.accessory_widgets = [accessory_widgets] def reset(self): diff --git a/js/tab_panel.ts b/js/tab_panel.ts index ce67a221c5..dc4e0ee8a3 100644 --- a/js/tab_panel.ts +++ b/js/tab_panel.ts @@ -43,7 +43,7 @@ export class TabPanel extends LitElement { ::slotted(*) { display: none; } - + ::slotted(.show-tab) { display: block; } diff --git a/js/toolbar.ts b/js/toolbar.ts index 5afd6ce52e..d18de986bb 100644 --- a/js/toolbar.ts +++ b/js/toolbar.ts @@ -94,7 +94,7 @@ export class Toolbar extends LitElement {
- \n", + " .geemap-dark {\n", + " --jp-widgets-color: white;\n", + " --jp-widgets-label-color: white;\n", + " --jp-ui-font-color1: white;\n", + " --jp-layout-color2: #454545;\n", + " background-color: #383838;\n", + " }\n", + "\n", + " .geemap-dark .jupyter-button {\n", + " --jp-layout-color3: #383838;\n", + " }\n", + "\n", + " .geemap-colab {\n", + " background-color: var(--colab-primary-surface-color, white);\n", + " }\n", + "\n", + " .geemap-colab .jupyter-button {\n", + " --jp-layout-color3: var(--colab-primary-surface-color, white);\n", + " }\n", + " \n", + " " + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "913e0708064244868a99be99ce8cae19", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "Map(center=[0, 0], controls=(WidgetControl(options=['position', 'transparent_bg'], widget=SearchDataGUI(childr…" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "Map = geemap.Map()\n", + "\n", + "dem = ee.Image(\"USGS/SRTMGL1_003\")\n", + "vis_params = {\n", + " \"min\": 0,\n", + " \"max\": 4000,\n", + " \"palette\": [\"006633\", \"E5FFCC\", \"662A00\", \"D8D8D8\", \"F5F5F5\"],\n", + "}\n", + "\n", + "Map.addLayer(dem, vis_params, \"SRTM DEM\")\n", + "\n", + "colors = vis_params[\"palette\"]\n", + "vmin = vis_params[\"min\"]\n", + "vmax = vis_params[\"max\"]\n", + "\n", + "Map.add_colorbar_branca(colors=colors, vmin=vmin, vmax=vmax, layer_name=\"SRTM DEM\")\n", + "\n", + "# nlcd_2016 = ee.Image('USGS/NLCD/NLCD2016').select('landcover')\n", + "# Map.addLayer(nlcd_2016, {}, \"NLCD\")\n", + "# Map.add_legend(legend_title=\"NLCD\", builtin_legend=\"NLCD\", layer_name=\"NLCD\")\n", + "\n", + "Map" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "62e9c57f-3f78-4252-830a-116c2b2d6c0e", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "\n", + " \n", + " " + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "5f9cb59f6d1340b7aa0d8b76388894b9", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "Map(center=[0, 0], controls=(WidgetControl(options=['position', 'transparent_bg'], widget=SearchDataGUI(childr…" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "Map = geemap.Map()\n", + "\n", + "dem = ee.Image(\"USGS/SRTMGL1_003\")\n", + "vis_params = {\n", + " \"min\": 0,\n", + " \"max\": 4000,\n", + " \"palette\": [\"006633\", \"E5FFCC\", \"662A00\", \"D8D8D8\", \"F5F5F5\"],\n", + "}\n", + "\n", + "Map.addLayer(dem, vis_params, \"SRTM DEM\")\n", + "\n", + "colors = vis_params[\"palette\"]\n", + "vmin = vis_params[\"min\"]\n", + "vmax = vis_params[\"max\"]\n", + "\n", + "Map.add_colorbar_branca(\n", + " colors=colors, vmin=vmin, vmax=vmax, categorical=True, step=4, layer_name=\"SRTM DEM\"\n", + ")\n", + "\n", + "Map" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "e8338c2d-ddae-477f-8687-31a6adda59a9", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.9" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/geemap/core.py b/geemap/core.py index 6aaf041e14..e649ccb4cc 100644 --- a/geemap/core.py +++ b/geemap/core.py @@ -954,7 +954,7 @@ def _add_toolbar(self, position: str, **kwargs: Any) -> None: layer_manager.refresh_layers() toolbar_val = toolbar.Toolbar( - self, self._toolbar_main_tools(), self._toolbar_extra_tools(), layer_manager + self, self._toolbar_main_tools(), self._toolbar_extra_tools(), [layer_manager] ) toolbar_control = ipyleaflet.WidgetControl( widget=toolbar_val, position=position diff --git a/geemap/toolbar.py b/geemap/toolbar.py index 286ea215c5..dda9d6f9e8 100644 --- a/geemap/toolbar.py +++ b/geemap/toolbar.py @@ -37,7 +37,8 @@ class ToolbarItem(anywidget.AnyWidget): _esm = pathlib.Path(__file__).parent / "static" / "toolbar_item.js" active = traitlets.Bool(False).tag(sync=True) icon = traitlets.Unicode("").tag(sync=True) - tooltip_ = traitlets.Unicode("").tag(sync=True) + # Unfortunately, "tooltip" is a property already defined on ipywidgets. + tooltip_text = traitlets.Unicode("").tag(sync=True) def __init__( self, @@ -51,7 +52,7 @@ def __init__( """A togglable, toolbar item. Args: - icon (str): The icon hexcode to use, from https://fonts.google.com/icons. + icon (str): The icon name to use, from https://fonts.google.com/icons. tooltip: The tooltip text to show a user on hover. callback: A callback function to execute when the item icon is clicked. Its signature should be `callback(map, selected, item)`, where @@ -64,7 +65,7 @@ def __init__( """ super().__init__() self.icon = icon - self.tooltip_ = tooltip + self.tooltip_text = tooltip self.callback = callback self.callback_wrapper = lambda *args: None self.control = control @@ -118,7 +119,13 @@ class Toolbar(anywidget.AnyWidget): _TOGGLE_COLLAPSE_ICON = "remove" _TOGGLE_COLLAPSE_TOOLTIP = "Collapse toolbar" - def __init__(self, host_map, main_tools, extra_tools, accessory_widgets): + def __init__( + self, + host_map: "geemap.Map", + main_tools: List[ToolbarItem], + extra_tools: List[ToolbarItem], + accessory_widgets: List[widgets.DOMWidget], + ): """Adds a toolbar with `main_tools` and `extra_tools` to the `host_map`.""" super().__init__() if not main_tools: @@ -136,7 +143,7 @@ def __init__(self, host_map, main_tools, extra_tools, accessory_widgets): widget.callback_wrapper = lambda callback, value, tool: callback( self.host_map, value, tool ) - self.accessory_widgets = [accessory_widgets] + self.accessory_widgets = accessory_widgets def reset(self): """Resets the toolbar so that no widget is selected.""" @@ -149,11 +156,11 @@ def _toggle_callback(self, m, selected, item): return if self.toggle_widget.icon == self._TOGGLE_EXPAND_ICON: self.expanded = True - self.toggle_widget.tooltip_ = self._TOGGLE_COLLAPSE_TOOLTIP + self.toggle_widget.tooltip_text = self._TOGGLE_COLLAPSE_TOOLTIP self.toggle_widget.icon = self._TOGGLE_COLLAPSE_ICON elif self.toggle_widget.icon == self._TOGGLE_COLLAPSE_ICON: self.expanded = False - self.toggle_widget.tooltip_ = self._TOGGLE_EXPAND_TOOLTIP + self.toggle_widget.tooltip_text = self._TOGGLE_EXPAND_TOOLTIP self.toggle_widget.icon = self._TOGGLE_EXPAND_ICON diff --git a/js/basemap_selector.ts b/js/basemap_selector.ts index 6f38f0a66e..e873749a28 100644 --- a/js/basemap_selector.ts +++ b/js/basemap_selector.ts @@ -52,7 +52,7 @@ export class BasemapSelector extends LitWidget< @property({ type: Array }) basemaps: string[] = []; @property({ type: String }) value: string = ""; - @query('select') selectElement!: HTMLSelectElement; + @query('select') selectElement!: HTMLSelectElement|null; render(): TemplateResult { return html` diff --git a/js/tab_panel.ts b/js/tab_panel.ts index dc4e0ee8a3..1532770a20 100644 --- a/js/tab_panel.ts +++ b/js/tab_panel.ts @@ -1,7 +1,7 @@ import { html, css, nothing, LitElement, PropertyValues } from "lit"; import { property, queryAll, queryAssignedElements } from "lit/decorators.js"; import { legacyStyles } from "./ipywidgets_styles"; -import { classMap } from 'lit/directives/class-map.js'; +import { classMap } from "lit/directives/class-map.js"; import { materialStyles } from "./styles"; import { styleMap } from "lit/directives/style-map.js"; @@ -100,7 +100,6 @@ export class TabPanel extends LitElement { */ @queryAssignedElements() tabContentElements!: HTMLElement[]; - render() { return html`
@@ -171,7 +170,7 @@ export class TabPanel extends LitElement { default: this.index = index; } - this.dispatchEvent(new CustomEvent('tab-clicked', { + this.dispatchEvent(new CustomEvent("tab-clicked", { detail: index, })); } diff --git a/js/toolbar.ts b/js/toolbar.ts index d18de986bb..dbcfa35ae7 100644 --- a/js/toolbar.ts +++ b/js/toolbar.ts @@ -1,12 +1,15 @@ -import type { AnyModel, RenderProps } from "@anywidget/types"; -import { html, css, LitElement } from "lit"; +import type { RenderProps } from "@anywidget/types"; +import { html, css } from "lit"; import { property } from "lit/decorators.js"; +import { classMap } from "lit/directives/class-map.js"; + import { legacyStyles } from "./ipywidgets_styles"; +import { LitWidget } from "./lit_widget"; +import { materialStyles } from "./styles"; import { loadFonts, updateChildren } from "./utils"; import "./tab_panel"; -import { classMap } from "lit/directives/class-map.js"; -import { materialStyles } from "./styles"; + export interface ToolbarModel { accessory_widgets: any; @@ -16,7 +19,10 @@ export interface ToolbarModel { tab_index: number; } -export class Toolbar extends LitElement { +export class Toolbar extends LitWidget< + ToolbarModel, + Toolbar +> { static get componentName() { return `toolbar-panel`; } @@ -52,27 +58,14 @@ export class Toolbar extends LitElement { `, ]; - private _model: AnyModel | undefined = undefined; - private static modelNameToViewName = new Map([ - ["accessory_widgets", null], - ["main_tools", null], - ["extra_tools", null], - ["expanded", "expanded"], - ["tab_index", "tab_index"], - ]); - - set model(model: AnyModel) { - this._model = model; - for (const [modelKey, widgetKey] of Toolbar.modelNameToViewName) { - if (widgetKey) { - // Get initial values from the Python model. - (this as any)[widgetKey] = model.get(modelKey); - // Listen for updates to the model. - model.on(`change:${modelKey}`, () => { - (this as any)[widgetKey] = model.get(modelKey); - }); - } - } + modelNameToViewName(): Map { + return new Map([ + ["accessory_widgets", null], + ["main_tools", null], + ["extra_tools", null], + ["expanded", "expanded"], + ["tab_index", "tab_index"], + ]); } @property() @@ -85,10 +78,10 @@ export class Toolbar extends LitElement { return html` ) => { - this.tab_index = e.detail; - }}> + this.tab_index = e.detail; + }}>
@@ -97,21 +90,13 @@ export class Toolbar extends LitElement { + hide: !this.expanded, + expanded: this.expanded, + })}">
`; } - - updated(changedProperties: any) { - // Update the model properties so they're reflected in Python. - for (const [property, _] of changedProperties) { - this._model?.set(property, this[property as keyof Toolbar]); - } - this._model?.save_changes(); - } } // Without this check, there's a component registry issue when developing locally. diff --git a/js/toolbar_item.ts b/js/toolbar_item.ts index f331fae290..1ed6b6569a 100644 --- a/js/toolbar_item.ts +++ b/js/toolbar_item.ts @@ -11,7 +11,7 @@ export interface ToolbarItemModel { active: boolean; icon: string; // Note: "tooltip" is already used by ipywidgets. - tooltip_: string; + tooltip_text: string; } export class ToolbarItem extends LitElement { @@ -37,7 +37,7 @@ export class ToolbarItem extends LitElement { private static modelNameToViewName = new Map([ ["active", "active"], ["icon", "icon"], - ["tooltip_", "tooltip_"], + ["tooltip_text", "tooltip_text"], ]); set model(model: AnyModel) { @@ -61,7 +61,7 @@ export class ToolbarItem extends LitElement { icon: string = ''; @property({ type: String }) - tooltip_: string = ''; + tooltip_text: string = ''; render() { return html` @@ -71,7 +71,7 @@ export class ToolbarItem extends LitElement { 'primary': true, 'active': this.active, })} - title="${this.tooltip_}" + title="${this.tooltip_text}" @click="${this.onClick}"> ${this.icon} `; diff --git a/tests/test_toolbar.py b/tests/test_toolbar.py index ca8c9bc725..e8d093a014 100644 --- a/tests/test_toolbar.py +++ b/tests/test_toolbar.py @@ -30,7 +30,7 @@ def setUp(self) -> None: callback=self.dummy_callback, reset=True, ) - self.accessory_widget = ipywidgets.Text() + self.accessory_widgets = [ipywidgets.Text()] return super().setUp() def tearDown(self) -> None: @@ -45,32 +45,32 @@ def dummy_callback(self, m, selected, item): def test_no_tools_throws(self): map = geemap.Map(ee_initialize=False) - self.assertRaises(ValueError, Toolbar, map, [], [], self.accessory_widget) + self.assertRaises(ValueError, Toolbar, map, [], [], self.accessory_widgets) def test_only_main_tools_exist_if_no_extra_tools(self): map = geemap.Map(ee_initialize=False) - toolbar = Toolbar(map, [self.item], [], self.accessory_widget) + toolbar = Toolbar(map, [self.item], [], self.accessory_widgets) self.assertNotIn(toolbar.toggle_widget, toolbar.main_tools) def test_all_tools_and_toggle_exist_if_extra_tools(self): map = geemap.Map(ee_initialize=False) - toolbar = Toolbar(map, [self.item], [self.reset_item], self.accessory_widget) + toolbar = Toolbar(map, [self.item], [self.reset_item], self.accessory_widgets) self.assertIsNotNone(toolbar.toggle_widget) def test_toggle_expands_and_collapses(self): map = geemap.Map(ee_initialize=False) - toolbar = Toolbar(map, [self.item], [self.reset_item], self.accessory_widget) + toolbar = Toolbar(map, [self.item], [self.reset_item], self.accessory_widgets) self.assertIsNotNone(toolbar.toggle_widget) toggle = toolbar.toggle_widget self.assertEqual(toggle.icon, "add") - self.assertEqual(toggle.tooltip_, "Expand toolbar") + self.assertEqual(toggle.tooltip_text, "Expand toolbar") self.assertFalse(toolbar.expanded) # Expand toggle.active = True self.assertTrue(toolbar.expanded) self.assertEqual(toggle.icon, "remove") - self.assertEqual(toggle.tooltip_, "Collapse toolbar") + self.assertEqual(toggle.tooltip_text, "Collapse toolbar") # After expanding, button is unselected. self.assertFalse(toggle.active) @@ -78,13 +78,13 @@ def test_toggle_expands_and_collapses(self): toggle.active = True self.assertFalse(toolbar.expanded) self.assertEqual(toggle.icon, "add") - self.assertEqual(toggle.tooltip_, "Expand toolbar") + self.assertEqual(toggle.tooltip_text, "Expand toolbar") # After collapsing, button is unselected. self.assertFalse(toggle.active) def test_triggers_callbacks(self): map = geemap.Map(ee_initialize=False) - toolbar = Toolbar(map, [self.item, self.reset_item], [], self.accessory_widget) + toolbar = Toolbar(map, [self.item, self.reset_item], [], self.accessory_widgets) self.assertIsNone(self.last_called_with_selected) self.assertIsNone(self.last_called_item) @@ -122,7 +122,7 @@ def callback(m, selected, item): icon="info", tooltip="dummy item", callback=callback, reset=False ) map_fake = fake_map.FakeMap() - toolbar = Toolbar(map_fake, [item], [], self.accessory_widget) + toolbar = Toolbar(map_fake, [item], [], self.accessory_widgets) toolbar.main_tools[0].active = True self.assertEqual(1, widget.selected_count) self.assertEqual(0, widget.cleanup_count) From 45b27970a8c4ff43914158ee31b7079dfb1d160f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 19 Nov 2024 22:23:32 +0000 Subject: [PATCH 50/57] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- Untitled.ipynb | 139 ++++--------------------------------------------- geemap/core.py | 5 +- 2 files changed, 15 insertions(+), 129 deletions(-) diff --git a/Untitled.ipynb b/Untitled.ipynb index fd863c7fa6..3dccf674c6 100644 --- a/Untitled.ipynb +++ b/Untitled.ipynb @@ -2,25 +2,10 @@ "cells": [ { "cell_type": "code", - "execution_count": 1, - "id": "1a25f9cf-af70-4a79-bad4-6aaa55e1429e", + "execution_count": null, + "id": "0", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "0.35.1\n" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "*** Earth Engine *** Share your feedback by taking our Annual Developer Satisfaction Survey: https://google.qualtrics.com/jfe/form/SV_0JLhFqfSY1uiEaW?source=Init\n" - ] - } - ], + "outputs": [], "source": [ "import ee\n", "import geemap\n", @@ -34,62 +19,10 @@ }, { "cell_type": "code", - "execution_count": 2, - "id": "3e6222df-c4af-4865-bcbe-4da605d06d1f", - "metadata": { - "scrolled": true - }, - "outputs": [ - { - "data": { - "text/html": [ - "\n", - " \n", - " " - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "913e0708064244868a99be99ce8cae19", - "version_major": 2, - "version_minor": 0 - }, - "text/plain": [ - "Map(center=[0, 0], controls=(WidgetControl(options=['position', 'transparent_bg'], widget=SearchDataGUI(childr…" - ] - }, - "execution_count": 2, - "metadata": {}, - "output_type": "execute_result" - } - ], + "execution_count": null, + "id": "1", + "metadata": {}, + "outputs": [], "source": [ "Map = geemap.Map()\n", "\n", @@ -117,60 +50,10 @@ }, { "cell_type": "code", - "execution_count": 3, - "id": "62e9c57f-3f78-4252-830a-116c2b2d6c0e", + "execution_count": null, + "id": "2", "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "\n", - " \n", - " " - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "5f9cb59f6d1340b7aa0d8b76388894b9", - "version_major": 2, - "version_minor": 0 - }, - "text/plain": [ - "Map(center=[0, 0], controls=(WidgetControl(options=['position', 'transparent_bg'], widget=SearchDataGUI(childr…" - ] - }, - "execution_count": 3, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "Map = geemap.Map()\n", "\n", @@ -197,7 +80,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e8338c2d-ddae-477f-8687-31a6adda59a9", + "id": "3", "metadata": {}, "outputs": [], "source": [] diff --git a/geemap/core.py b/geemap/core.py index e649ccb4cc..fb5599901b 100644 --- a/geemap/core.py +++ b/geemap/core.py @@ -954,7 +954,10 @@ def _add_toolbar(self, position: str, **kwargs: Any) -> None: layer_manager.refresh_layers() toolbar_val = toolbar.Toolbar( - self, self._toolbar_main_tools(), self._toolbar_extra_tools(), [layer_manager] + self, + self._toolbar_main_tools(), + self._toolbar_extra_tools(), + [layer_manager], ) toolbar_control = ipyleaflet.WidgetControl( widget=toolbar_val, position=position From bdc574ef7c5f9e6f8a1f3c1bac2f3d0c9be89021 Mon Sep 17 00:00:00 2001 From: Sufyan Abbasi Date: Tue, 19 Nov 2024 23:36:20 +0000 Subject: [PATCH 51/57] Extend LitWidget for ToolbarItem too --- js/toolbar_item.ts | 44 ++++++++++++-------------------------------- 1 file changed, 12 insertions(+), 32 deletions(-) diff --git a/js/toolbar_item.ts b/js/toolbar_item.ts index 1ed6b6569a..24e4fe3939 100644 --- a/js/toolbar_item.ts +++ b/js/toolbar_item.ts @@ -1,11 +1,12 @@ -import type { AnyModel, RenderProps } from "@anywidget/types"; -import { html, css, LitElement } from "lit"; +import type { RenderProps } from "@anywidget/types"; +import { html, css } from "lit"; import { property } from "lit/decorators.js"; import { classMap } from 'lit/directives/class-map.js'; import { legacyStyles } from './ipywidgets_styles'; -import { loadFonts } from "./utils"; +import { LitWidget } from "./lit_widget"; import { materialStyles } from "./styles"; +import { loadFonts } from "./utils"; export interface ToolbarItemModel { active: boolean; @@ -14,7 +15,7 @@ export interface ToolbarItemModel { tooltip_text: string; } -export class ToolbarItem extends LitElement { +export class ToolbarItem extends LitWidget { static get componentName() { return `tool-button`; } @@ -33,25 +34,12 @@ export class ToolbarItem extends LitElement { `, ]; - private _model: AnyModel | undefined = undefined; - private static modelNameToViewName = new Map([ - ["active", "active"], - ["icon", "icon"], - ["tooltip_text", "tooltip_text"], - ]); - - set model(model: AnyModel) { - this._model = model; - for (const [modelKey, widgetKey] of ToolbarItem.modelNameToViewName) { - if (widgetKey) { - // Get initial values from the Python model. - (this as any)[widgetKey] = model.get(modelKey); - // Listen for updates to the model. - model.on(`change:${modelKey}`, () => { - (this as any)[widgetKey] = model.get(modelKey); - }); - } - } + modelNameToViewName(): Map { + return new Map([ + ["active", "active"], + ["icon", "icon"], + ["tooltip_text", "tooltip_text"], + ]); } @property({ type: Boolean }) @@ -77,15 +65,7 @@ export class ToolbarItem extends LitElement { `; } - updated(changedProperties: any) { - // Update the model properties so they're reflected in Python. - for (const [property, _] of changedProperties) { - this._model?.set(property, this[property as keyof ToolbarItem]); - } - this._model?.save_changes(); - } - - private onClick(event: Event) { + private onClick(_: Event) { this.active = !this.active; } } From 39dd8b5ac8b3b889b91275937b36c0e91996cecf Mon Sep 17 00:00:00 2001 From: Sufyan Abbasi Date: Tue, 19 Nov 2024 23:38:11 +0000 Subject: [PATCH 52/57] Remove scratch file --- Untitled.ipynb | 110 ------------------------------------------------- 1 file changed, 110 deletions(-) delete mode 100644 Untitled.ipynb diff --git a/Untitled.ipynb b/Untitled.ipynb deleted file mode 100644 index 3dccf674c6..0000000000 --- a/Untitled.ipynb +++ /dev/null @@ -1,110 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": null, - "id": "0", - "metadata": {}, - "outputs": [], - "source": [ - "import ee\n", - "import geemap\n", - "import geemap.core as geemapCore\n", - "\n", - "print(geemap.__version__)\n", - "\n", - "ee.Authenticate()\n", - "ee.Initialize()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "1", - "metadata": {}, - "outputs": [], - "source": [ - "Map = geemap.Map()\n", - "\n", - "dem = ee.Image(\"USGS/SRTMGL1_003\")\n", - "vis_params = {\n", - " \"min\": 0,\n", - " \"max\": 4000,\n", - " \"palette\": [\"006633\", \"E5FFCC\", \"662A00\", \"D8D8D8\", \"F5F5F5\"],\n", - "}\n", - "\n", - "Map.addLayer(dem, vis_params, \"SRTM DEM\")\n", - "\n", - "colors = vis_params[\"palette\"]\n", - "vmin = vis_params[\"min\"]\n", - "vmax = vis_params[\"max\"]\n", - "\n", - "Map.add_colorbar_branca(colors=colors, vmin=vmin, vmax=vmax, layer_name=\"SRTM DEM\")\n", - "\n", - "# nlcd_2016 = ee.Image('USGS/NLCD/NLCD2016').select('landcover')\n", - "# Map.addLayer(nlcd_2016, {}, \"NLCD\")\n", - "# Map.add_legend(legend_title=\"NLCD\", builtin_legend=\"NLCD\", layer_name=\"NLCD\")\n", - "\n", - "Map" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "2", - "metadata": {}, - "outputs": [], - "source": [ - "Map = geemap.Map()\n", - "\n", - "dem = ee.Image(\"USGS/SRTMGL1_003\")\n", - "vis_params = {\n", - " \"min\": 0,\n", - " \"max\": 4000,\n", - " \"palette\": [\"006633\", \"E5FFCC\", \"662A00\", \"D8D8D8\", \"F5F5F5\"],\n", - "}\n", - "\n", - "Map.addLayer(dem, vis_params, \"SRTM DEM\")\n", - "\n", - "colors = vis_params[\"palette\"]\n", - "vmin = vis_params[\"min\"]\n", - "vmax = vis_params[\"max\"]\n", - "\n", - "Map.add_colorbar_branca(\n", - " colors=colors, vmin=vmin, vmax=vmax, categorical=True, step=4, layer_name=\"SRTM DEM\"\n", - ")\n", - "\n", - "Map" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "3", - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.11.9" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} From d50a98b95b7f8c27313bb09f1a7d938fef228ec5 Mon Sep 17 00:00:00 2001 From: Sufyan Abbasi Date: Tue, 19 Nov 2024 23:46:00 +0000 Subject: [PATCH 53/57] Fix core tests --- tests/test_core.py | 47 ++++++++++------------------------------------ 1 file changed, 10 insertions(+), 37 deletions(-) diff --git a/tests/test_core.py b/tests/test_core.py index cb1b44feb3..1d6261dae8 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -150,44 +150,17 @@ def test_add_toolbar(self): self.assertEqual(len(self.core_map.controls), 1) toolbar_control = self.core_map.controls[0].widget - # Layer manager is selected and open by default. - layer_button = utils.query_widget( - toolbar_control, ipywidgets.ToggleButton, lambda c: c.tooltip == "Layers" - ) - self.assertTrue(layer_button.value) - self.assertIsNotNone( - utils.query_widget(toolbar_control, map_widgets.LayerManager) - ) - toolbar_button = utils.query_widget( - toolbar_control, ipywidgets.ToggleButton, lambda c: c.tooltip == "Toolbar" - ) - toolbar_button.value = True # Open the grid of tools. - self.assertFalse(layer_button.value) - - tool_grid = utils.query_widget(toolbar_control, ipywidgets.GridBox).children - - self.assertEqual(len(tool_grid), 3) - self.assertEqual(tool_grid[0].tooltip, "Basemap selector") - self.assertEqual(tool_grid[1].tooltip, "Inspector") - self.assertEqual(tool_grid[2].tooltip, "Get help") - - # Closing the toolbar button shows both buttons in the header. - toolbar_button.value = False - self.assertIsNotNone( - utils.query_widget( - toolbar_control, - ipywidgets.ToggleButton, - lambda c: c.tooltip == "Toolbar", - ) - ) - self.assertIsNotNone( - utils.query_widget( - toolbar_control, - ipywidgets.ToggleButton, - lambda c: c.tooltip == "Layers", - ) - ) + # Layer manager is selected and open by default. + self.assertEqual(toolbar_control.tab_index, 0) + layer_button = toolbar_control.accessory_widgets[0] + self.assertIsInstance(layer_button, map_widgets.LayerManager) + + toolbar_control.tab_index = 1 + self.assertEqual(len(toolbar_control.main_tools), 3) + self.assertEqual(toolbar_control.main_tools[0].tooltip_text, "Basemap selector") + self.assertEqual(toolbar_control.main_tools[1].tooltip_text, "Inspector") + self.assertEqual(toolbar_control.main_tools[2].tooltip_text, "Get help") def test_add_draw_control(self): """Tests adding and getting the draw widget.""" From cef79a6d7c66dca30362d36dba36d61601d32759 Mon Sep 17 00:00:00 2001 From: Sufyan Abbasi Date: Thu, 21 Nov 2024 01:42:37 +0000 Subject: [PATCH 54/57] Adjust margins --- js/tab_panel.ts | 15 ++++++++------- js/toolbar.ts | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/js/tab_panel.ts b/js/tab_panel.ts index 1532770a20..e6458ccadf 100644 --- a/js/tab_panel.ts +++ b/js/tab_panel.ts @@ -62,19 +62,18 @@ export class TabPanel extends LitElement { .tab-container button { border-radius: 5px; - font-size: 16px; height: 28px; - margin-right: 2px; + margin: 2px; user-select: none; - width: 28px; } - .tab-container button:first-child { - margin-left: 0; + .tab-container button.icon { + font-size: 16px; + width: 28px; } - .tab-container button:last-child { - margin-right: 0; + .tab-container button.name { + padding: 0 8px; } `, ]; @@ -143,6 +142,8 @@ export class TabPanel extends LitElement { class="${classMap({ "legacy-button": true, "active": i === this.index, + "icon": !!tab.icon, + "name": !!tab.name, })}" style="${styleMap({ width: tab.width ? `${tab.width}px` : null, diff --git a/js/toolbar.ts b/js/toolbar.ts index dbcfa35ae7..7f488444be 100644 --- a/js/toolbar.ts +++ b/js/toolbar.ts @@ -78,7 +78,7 @@ export class Toolbar extends LitWidget< return html` ) => { this.tab_index = e.detail; }}> From 5489dd4eefc1d6184c63efe17edc4eb38ec74bd8 Mon Sep 17 00:00:00 2001 From: Sufyan Abbasi Date: Wed, 27 Nov 2024 02:27:03 +0000 Subject: [PATCH 55/57] tab-clicked --> tab-changed --- js/tab_panel.ts | 2 +- js/toolbar.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/tab_panel.ts b/js/tab_panel.ts index e6458ccadf..cfddc70d0b 100644 --- a/js/tab_panel.ts +++ b/js/tab_panel.ts @@ -171,7 +171,7 @@ export class TabPanel extends LitElement { default: this.index = index; } - this.dispatchEvent(new CustomEvent("tab-clicked", { + this.dispatchEvent(new CustomEvent("tab-changed", { detail: index, })); } diff --git a/js/toolbar.ts b/js/toolbar.ts index 7f488444be..7f3bd6f34d 100644 --- a/js/toolbar.ts +++ b/js/toolbar.ts @@ -79,7 +79,7 @@ export class Toolbar extends LitWidget< ) => { + @tab-changed=${(e: CustomEvent) => { this.tab_index = e.detail; }}>
From 800766e01c038c035d46072160916a3a0012eea5 Mon Sep 17 00:00:00 2001 From: Sufyan Abbasi Date: Wed, 27 Nov 2024 19:21:25 +0000 Subject: [PATCH 56/57] Change info icon to point scan (cross-hair) --- geemap/core.py | 2 +- geemap/foliumap.py | 2 +- geemap/geemap.py | 4 ++-- geemap/map_widgets.py | 4 ++-- geemap/toolbar.py | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/geemap/core.py b/geemap/core.py index fb5599901b..2eb50f200c 100644 --- a/geemap/core.py +++ b/geemap/core.py @@ -1285,7 +1285,7 @@ def basemap_tool_callback(map: Map, selected: bool, item: toolbar.ToolbarItem): callback=basemap_tool_callback, ), toolbar.ToolbarItem( - icon="info", + icon="point_scan", tooltip="Inspector", callback=inspector_tool_callback, ), diff --git a/geemap/foliumap.py b/geemap/foliumap.py index 2e7ffc263b..4348b0f681 100644 --- a/geemap/foliumap.py +++ b/geemap/foliumap.py @@ -1511,7 +1511,7 @@ def add_points_from_xy( color_column: Optional[str] = None, marker_colors: Optional[List] = None, icon_colors: Optional[List] = ["white"], - icon_names: Optional[List] = ["info"], + icon_names: Optional[List] = ["point_scan"], angle: Optional[int] = 0, prefix: Optional[str] = "fa", add_legend: Optional[bool] = True, diff --git a/geemap/geemap.py b/geemap/geemap.py index bc181ee77a..1937e33504 100644 --- a/geemap/geemap.py +++ b/geemap/geemap.py @@ -2825,7 +2825,7 @@ def random_color(feature): toolbar_button = widgets.ToggleButton( value=True, tooltip="Toolbar", - icon="info", + icon="point_scan", layout=widgets.Layout( width="28px", height="28px", padding="0px 0px 0px 4px" ), @@ -3769,7 +3769,7 @@ def add_points_from_xy( color_column=None, marker_colors=None, icon_colors=["white"], - icon_names=["info"], + icon_names=["point_scan"], spin=False, add_legend=True, **kwargs, diff --git a/geemap/map_widgets.py b/geemap/map_widgets.py index 11c22d5449..ab18f1956a 100644 --- a/geemap/map_widgets.py +++ b/geemap/map_widgets.py @@ -565,7 +565,7 @@ def __init__( ) self.toolbar_button = ipywidgets.ToggleButton( - value=opened, tooltip="Inspector", icon="info", layout=left_padded_square + value=opened, tooltip="Inspector", icon="point_scan", layout=left_padded_square ) self.toolbar_button.observe(self._on_toolbar_btn_click, "value") @@ -763,7 +763,7 @@ def _root_node( open_icon="plus-square", open_icon_style="success", close_icon="minus-square", - close_icon_style="info", + close_icon_style="point_scan", **kwargs, ) diff --git a/geemap/toolbar.py b/geemap/toolbar.py index dda9d6f9e8..970c9cb579 100644 --- a/geemap/toolbar.py +++ b/geemap/toolbar.py @@ -4422,7 +4422,7 @@ def _cog_stac_inspector_callback(map, selected, item): main_tools = [ ToolbarItem( - icon="info", + icon="point_scan", tooltip="Inspector", callback=_inspector_tool_callback, ), From 301472cdba535822d9cf9989fbc62a50ac369bcc Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 27 Nov 2024 19:22:07 +0000 Subject: [PATCH 57/57] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- geemap/map_widgets.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/geemap/map_widgets.py b/geemap/map_widgets.py index ab18f1956a..9ddc45047e 100644 --- a/geemap/map_widgets.py +++ b/geemap/map_widgets.py @@ -565,7 +565,10 @@ def __init__( ) self.toolbar_button = ipywidgets.ToggleButton( - value=opened, tooltip="Inspector", icon="point_scan", layout=left_padded_square + value=opened, + tooltip="Inspector", + icon="point_scan", + layout=left_padded_square, ) self.toolbar_button.observe(self._on_toolbar_btn_click, "value")