From 2137e6a1c69149e9e3df8754edbde2b30c56c5f0 Mon Sep 17 00:00:00 2001 From: Lloyd Date: Sat, 22 Nov 2025 22:07:46 +0000 Subject: [PATCH] Refactor code structure for improved readability and maintainability --- config.yaml.example | 6 ++ repeater/data_acquisition/rrdtool_handler.py | 32 +------ repeater/engine.py | 23 ++++- repeater/main.py | 2 - repeater/web/api_endpoints.py | 94 ++++++++++++------- .../{index-BJnLrjMq.js => index-DJUYEmmJ.js} | 22 ++--- repeater/web/html/index.html | 2 +- repeater/web/http_server.py | 60 +++++++++--- 8 files changed, 147 insertions(+), 94 deletions(-) rename repeater/web/html/assets/{index-BJnLrjMq.js => index-DJUYEmmJ.js} (97%) diff --git a/config.yaml.example b/config.yaml.example index b2f3d9f..4bd4541 100644 --- a/config.yaml.example +++ b/config.yaml.example @@ -169,3 +169,9 @@ logging: # Log format format: "%(asctime)s - %(name)s - %(levelname)s - %(message)s" + +# Web interface configuration +web: + # Enable Cross-Origin Resource Sharing (CORS) headers + # Allows web frontends from different origins to access the API + cors_enabled: false diff --git a/repeater/data_acquisition/rrdtool_handler.py b/repeater/data_acquisition/rrdtool_handler.py index e6131df..fa0753c 100644 --- a/repeater/data_acquisition/rrdtool_handler.py +++ b/repeater/data_acquisition/rrdtool_handler.py @@ -74,7 +74,6 @@ class RRDToolHandler: def update_packet_metrics(self, record: dict, cumulative_counts: dict): if not self.available or not self.rrd_path.exists(): - logger.debug("RRD not available or doesn't exist for packet metrics") return try: @@ -83,9 +82,7 @@ class RRDToolHandler: try: info = rrdtool.info(str(self.rrd_path)) last_update = int(info.get("last_update", timestamp - 60)) - logger.debug(f"RRD packet update: timestamp={timestamp}, last_update={last_update}") if timestamp <= last_update: - logger.debug(f"Skipping RRD packet update: timestamp {timestamp} <= last_update {last_update}") return except Exception as e: logger.debug(f"Failed to get RRD info for packet update: {e}") @@ -108,9 +105,7 @@ class RRDToolHandler: type_values_str = ":".join(type_values) values = f"{basic_values}:{type_values_str}" - logger.debug(f"Updating RRD with packet values: {values}") rrdtool.update(str(self.rrd_path), values) - logger.debug(f"RRD packet update successful") except Exception as e: logger.error(f"Failed to update RRD packet metrics: {e}") @@ -128,8 +123,6 @@ class RRDToolHandler: if start_time is None: start_time = end_time - (24 * 3600) - logger.debug(f"RRD fetch: start={start_time}, end={end_time}, resolution={resolution}") - fetch_result = rrdtool.fetch( str(self.rrd_path), resolution.upper(), @@ -142,13 +135,8 @@ class RRDToolHandler: return None (start, end, step), data_sources, data_points = fetch_result - logger.debug(f"RRD fetch result: start={start}, end={end}, step={step}, sources={len(data_sources)}, points={len(data_points)}") - logger.debug(f"Data sources: {data_sources}") - if data_points: - logger.debug(f"First data point: {data_points[0]}") - logger.debug(f"Last data point: {data_points[-1]}") - else: + if not data_points: logger.warning("No data points returned from RRD fetch") result = { @@ -184,13 +172,6 @@ class RRDToolHandler: current_time += step result['timestamps'] = timestamps - logger.debug(f"RRD data processed successfully: {len(timestamps)} timestamps, packet_types keys: {list(result['packet_types'].keys())}") - - for type_key in ['type_2', 'type_4', 'type_5']: - if type_key in result['packet_types']: - values = result['packet_types'][type_key] - non_none_values = [v for v in values if v is not None] - logger.debug(f"{type_key} values: count={len(values)}, non-none={len(non_none_values)}, sample={values[:3] if values else 'empty'}") return result @@ -203,15 +184,11 @@ class RRDToolHandler: end_time = int(time.time()) start_time = end_time - (hours * 3600) - logger.debug(f"Getting packet type stats for {hours} hours from {start_time} to {end_time}") - rrd_data = self.get_data(start_time, end_time) if not rrd_data or 'packet_types' not in rrd_data: logger.warning(f"No RRD data available") return None - logger.debug(f"RRD packet_types keys: {list(rrd_data['packet_types'].keys())}") - type_totals = {} packet_type_names = { 'type_0': 'Request (REQ)', @@ -244,23 +221,17 @@ class RRDToolHandler: for type_key, data_points in rrd_data['packet_types'].items(): valid_points = [p for p in data_points if p is not None] - logger.debug(f"{type_key}: total_points={len(data_points)}, valid_points={len(valid_points)}") if len(valid_points) >= 2: total = max(valid_points) - min(valid_points) - logger.debug(f"{type_key}: min={min(valid_points)}, max={max(valid_points)}, total={total}") elif len(valid_points) == 1: total = valid_points[0] - logger.debug(f"{type_key}: single value={total}") else: total = 0 - logger.debug(f"{type_key}: no valid values, total=0") type_name = packet_type_names.get(type_key, type_key) type_totals[type_name] = max(0, total or 0) - logger.debug(f"Final type_totals: {type_totals}") - result = { "hours": hours, "packet_type_totals": type_totals, @@ -269,7 +240,6 @@ class RRDToolHandler: "data_source": "rrd" } - logger.debug(f"Returning packet type stats: {result}") return result except Exception as e: diff --git a/repeater/engine.py b/repeater/engine.py index 1c972c0..f439c47 100644 --- a/repeater/engine.py +++ b/repeater/engine.py @@ -478,6 +478,7 @@ class RepeaterHandler(BaseHandler): for key_record in transport_keys: transport_key_encoded = key_record.get("transport_key") key_name = key_record.get("name", "unknown") + flood_policy = key_record.get("flood_policy", "deny") if not transport_key_encoded: continue @@ -487,8 +488,26 @@ class RepeaterHandler(BaseHandler): transport_key = base64.b64decode(transport_key_encoded) expected_code = calc_transport_code(transport_key, packet) if transport_code_0 == expected_code: - logger.debug(f"Transport code validated for key '{key_name}'") - return True, "" + logger.debug(f"Transport code validated for key '{key_name}' with policy '{flood_policy}'") + + # Update last_used timestamp for this key + try: + key_id = key_record.get("id") + if key_id: + self.storage.update_transport_key( + key_id=key_id, + last_used=time.time() + ) + logger.debug(f"Updated last_used timestamp for transport key '{key_name}'") + except Exception as e: + logger.warning(f"Failed to update last_used for transport key '{key_name}': {e}") + + # Check flood policy for this key + if flood_policy == "allow": + return True, "" + else: + return False, f"Transport key '{key_name}' flood policy denied" + except Exception as e: logger.warning(f"Error checking transport key '{key_name}': {e}") diff --git a/repeater/main.py b/repeater/main.py index 0b45a45..c979518 100644 --- a/repeater/main.py +++ b/repeater/main.py @@ -351,7 +351,6 @@ class RepeaterDaemon: http_port = self.config.get("http", {}).get("port", 8000) http_host = self.config.get("http", {}).get("host", "0.0.0.0") - template_dir = os.path.join(os.path.dirname(__file__), "templates") node_name = self.config.get("repeater", {}).get("node_name", "Repeater") # Format public key for display @@ -370,7 +369,6 @@ class RepeaterDaemon: host=http_host, port=http_port, stats_getter=self.get_stats, - template_dir=template_dir, node_name=node_name, pub_key=pub_key_formatted, send_advert_func=self.send_advert, diff --git a/repeater/web/api_endpoints.py b/repeater/web/api_endpoints.py index c29d98d..f815ff5 100644 --- a/repeater/web/api_endpoints.py +++ b/repeater/web/api_endpoints.py @@ -1,5 +1,6 @@ import json import logging +import os import time from datetime import datetime from typing import Callable, Optional @@ -11,6 +12,11 @@ from .cad_calibration_engine import CADCalibrationEngine logger = logging.getLogger("HTTPServer") +def is_cors_enabled(config: dict) -> bool: + """Check if CORS is enabled in the configuration""" + return config.get("web", {}).get("cors_enabled", False) + + def add_cors_headers(): """Add CORS headers to allow cross-origin requests""" cherrypy.response.headers['Access-Control-Allow-Origin'] = '*' @@ -18,14 +24,6 @@ def add_cors_headers(): cherrypy.response.headers['Access-Control-Allow-Headers'] = 'Content-Type, Authorization' -def cors_enabled(func): - """Decorator to enable CORS for API endpoints""" - def wrapper(*args, **kwargs): - add_cors_headers() - return func(*args, **kwargs) - return wrapper - - # system systems # GET /api/stats # GET /api/logs @@ -77,12 +75,25 @@ class APIEndpoints: self.daemon_instance = daemon_instance self._config_path = config_path or '/etc/pymc_repeater/config.yaml' self.cad_calibration = CADCalibrationEngine(daemon_instance, event_loop) + + # CORS check from config + self._cors_enabled = is_cors_enabled(self.config) + + # Log the CORS status + logger.info(f"CORS {'enabled' if self._cors_enabled else 'disabled'} (config: web.cors_enabled={self._cors_enabled})") + + # Set up automatic CORS for all responses if enabled + if self._cors_enabled: + cherrypy.engine.subscribe('before_finalize', self._add_cors_headers) + + def _add_cors_headers(self): + """Automatically add CORS headers to all responses""" + add_cors_headers() @cherrypy.expose def default(self, *args, **kwargs): """Handle OPTIONS requests for CORS preflight""" if cherrypy.request.method == "OPTIONS": - add_cors_headers() return "" # For non-OPTIONS requests, return 404 raise cherrypy.HTTPError(404) @@ -122,7 +133,9 @@ class APIEndpoints: def _require_post(self): if cherrypy.request.method != "POST": - raise Exception("Method not allowed") + cherrypy.response.status = 405 # Method Not Allowed + cherrypy.response.headers['Allow'] = 'POST' + raise cherrypy.HTTPError(405, "Method not allowed. This endpoint requires POST.") def _get_time_range(self, hours): end_time = int(time.time()) @@ -147,7 +160,6 @@ class APIEndpoints: @cherrypy.expose @cherrypy.tools.json_out() - @cors_enabled def stats(self): try: stats = self.stats_getter() if self.stats_getter else {} @@ -164,7 +176,6 @@ class APIEndpoints: @cherrypy.expose @cherrypy.tools.json_out() - @cors_enabled def send_advert(self): try: self._require_post() @@ -176,6 +187,9 @@ class APIEndpoints: future = asyncio.run_coroutine_threadsafe(self.send_advert_func(), self.event_loop) result = future.result(timeout=10) return self._success("Advert sent successfully") if result else self._error("Failed to send advert") + except cherrypy.HTTPError: + # Re-raise HTTP errors (like 405 Method Not Allowed) without logging + raise except Exception as e: logger.error(f"Error sending advert: {e}", exc_info=True) return self._error(e) @@ -183,7 +197,6 @@ class APIEndpoints: @cherrypy.expose @cherrypy.tools.json_out() @cherrypy.tools.json_in() - @cors_enabled def set_mode(self): try: self._require_post() @@ -196,6 +209,9 @@ class APIEndpoints: self.config["repeater"]["mode"] = new_mode logger.info(f"Mode changed to: {new_mode}") return {"success": True, "mode": new_mode} + except cherrypy.HTTPError: + # Re-raise HTTP errors (like 405 Method Not Allowed) without logging + raise except Exception as e: logger.error(f"Error setting mode: {e}", exc_info=True) return self._error(e) @@ -203,7 +219,6 @@ class APIEndpoints: @cherrypy.expose @cherrypy.tools.json_out() @cherrypy.tools.json_in() - @cors_enabled def set_duty_cycle(self): try: self._require_post() @@ -214,13 +229,15 @@ class APIEndpoints: self.config["duty_cycle"]["enforcement_enabled"] = enabled logger.info(f"Duty cycle enforcement {'enabled' if enabled else 'disabled'}") return {"success": True, "enabled": enabled} + except cherrypy.HTTPError: + # Re-raise HTTP errors (like 405 Method Not Allowed) without logging + raise except Exception as e: logger.error(f"Error setting duty cycle: {e}", exc_info=True) return self._error(e) @cherrypy.expose @cherrypy.tools.json_out() - @cors_enabled def logs(self): from .http_server import _log_buffer try: @@ -244,8 +261,8 @@ class APIEndpoints: @cherrypy.expose @cherrypy.tools.json_out() - @cors_enabled def packet_stats(self, hours=24): + try: hours = int(hours) stats = self._get_storage().get_packet_stats(hours=hours) @@ -256,8 +273,8 @@ class APIEndpoints: @cherrypy.expose @cherrypy.tools.json_out() - @cors_enabled def packet_type_stats(self, hours=24): + try: hours = int(hours) stats = self._get_storage().get_packet_type_stats(hours=hours) @@ -268,8 +285,8 @@ class APIEndpoints: @cherrypy.expose @cherrypy.tools.json_out() - @cors_enabled def route_stats(self, hours=24): + try: hours = int(hours) stats = self._get_storage().get_route_stats(hours=hours) @@ -280,8 +297,8 @@ class APIEndpoints: @cherrypy.expose @cherrypy.tools.json_out() - @cors_enabled def recent_packets(self, limit=100): + try: limit = int(limit) packets = self._get_storage().get_recent_packets(limit=limit) @@ -351,8 +368,8 @@ class APIEndpoints: @cherrypy.expose @cherrypy.tools.json_out() - @cors_enabled def packet_type_graph_data(self, hours=24, resolution='average', types='all'): + try: hours = int(hours) start_time, end_time = self._get_time_range(hours) @@ -398,8 +415,8 @@ class APIEndpoints: @cherrypy.expose @cherrypy.tools.json_out() - @cors_enabled def metrics_graph_data(self, hours=24, resolution='average', metrics='all'): + try: hours = int(hours) start_time, end_time = self._get_time_range(hours) @@ -460,8 +477,8 @@ class APIEndpoints: @cherrypy.expose @cherrypy.tools.json_out() @cherrypy.tools.json_in() - @cors_enabled def cad_calibration_start(self): + try: self._require_post() data = cherrypy.request.json or {} @@ -471,18 +488,24 @@ class APIEndpoints: return self._success("Calibration started") else: return self._error("Calibration already running") + except cherrypy.HTTPError: + # Re-raise HTTP errors (like 405 Method Not Allowed) without logging + raise except Exception as e: logger.error(f"Error starting CAD calibration: {e}") return self._error(e) @cherrypy.expose @cherrypy.tools.json_out() - @cors_enabled def cad_calibration_stop(self): + try: self._require_post() self.cad_calibration.stop_calibration() return self._success("Calibration stopped") + except cherrypy.HTTPError: + # Re-raise HTTP errors (like 405 Method Not Allowed) without logging + raise except Exception as e: logger.error(f"Error stopping CAD calibration: {e}") return self._error(e) @@ -490,8 +513,8 @@ class APIEndpoints: @cherrypy.expose @cherrypy.tools.json_out() @cherrypy.tools.json_in() - @cors_enabled def save_cad_settings(self): + try: self._require_post() data = cherrypy.request.json or {} @@ -524,6 +547,9 @@ class APIEndpoints: "message": f"CAD settings saved: peak={peak}, min={min_val}", "settings": {"peak": peak, "min_val": min_val, "detection_rate": detection_rate} } + except cherrypy.HTTPError: + # Re-raise HTTP errors (like 405 Method Not Allowed) without logging + raise except Exception as e: logger.error(f"Error saving CAD settings: {e}") return self._error(e) @@ -542,8 +568,8 @@ class APIEndpoints: @cherrypy.expose @cherrypy.tools.json_out() - @cors_enabled def noise_floor_history(self, hours: int = 24): + try: storage = self._get_storage() hours = int(hours) @@ -560,8 +586,8 @@ class APIEndpoints: @cherrypy.expose @cherrypy.tools.json_out() - @cors_enabled def noise_floor_stats(self, hours: int = 24): + try: storage = self._get_storage() hours = int(hours) @@ -577,8 +603,8 @@ class APIEndpoints: @cherrypy.expose @cherrypy.tools.json_out() - @cors_enabled def noise_floor_chart_data(self, hours: int = 24): + try: storage = self._get_storage() hours = int(hours) @@ -597,7 +623,10 @@ class APIEndpoints: cherrypy.response.headers['Content-Type'] = 'text/event-stream' cherrypy.response.headers['Cache-Control'] = 'no-cache' cherrypy.response.headers['Connection'] = 'keep-alive' - cherrypy.response.headers['Access-Control-Allow-Origin'] = '*' + + # Add CORS headers conditionally for SSE endpoint + if self._cors_enabled: + cherrypy.response.headers['Access-Control-Allow-Origin'] = '*' if not hasattr(self.cad_calibration, 'message_queue'): self.cad_calibration.message_queue = [] @@ -651,9 +680,8 @@ class APIEndpoints: @cherrypy.expose @cherrypy.tools.json_out() - @cors_enabled def adverts_by_contact_type(self, contact_type=None, limit=None, hours=None): - + try: if not contact_type: return self._error("contact_type parameter is required") @@ -686,8 +714,8 @@ class APIEndpoints: @cherrypy.expose @cherrypy.tools.json_out() @cherrypy.tools.json_in() - @cors_enabled def transport_keys(self): + if cherrypy.request.method == "GET": try: storage = self._get_storage() @@ -738,8 +766,8 @@ class APIEndpoints: @cherrypy.expose @cherrypy.tools.json_out() @cherrypy.tools.json_in() - @cors_enabled def transport_key(self, key_id): + if cherrypy.request.method == "GET": try: key_id = int(key_id) @@ -810,8 +838,8 @@ class APIEndpoints: @cherrypy.expose @cherrypy.tools.json_out() @cherrypy.tools.json_in() - @cors_enabled def global_flood_policy(self): + """ Update global flood policy configuration diff --git a/repeater/web/html/assets/index-BJnLrjMq.js b/repeater/web/html/assets/index-DJUYEmmJ.js similarity index 97% rename from repeater/web/html/assets/index-BJnLrjMq.js rename to repeater/web/html/assets/index-DJUYEmmJ.js index fdcb01f..7e5e248 100644 --- a/repeater/web/html/assets/index-BJnLrjMq.js +++ b/repeater/web/html/assets/index-DJUYEmmJ.js @@ -31,7 +31,7 @@ `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(l){return l instanceof this?l:new this(l)}static concat(l,...z){const j=new this(l);return z.forEach(J=>j.set(J)),j}static accessor(l){const j=(this[EL]=this[EL]={accessors:{}}).accessors,J=this.prototype;function mt(kt){const Dt=Qb(kt);j[Dt]||(OJ(J,kt),j[Dt]=!0)}return to.isArray(l)?l.forEach(mt):mt(l),this}};E0.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);to.reduceDescriptors(E0.prototype,({value:d},l)=>{let z=l[0].toUpperCase()+l.slice(1);return{get:()=>d,set(j){this[z]=j}}});to.freezeMethods(E0);function E8(d,l){const z=this||ew,j=l||z,J=E0.from(j.headers);let mt=j.data;return to.forEach(d,function(Dt){mt=Dt.call(z,mt,J.normalize(),l?l.status:void 0)}),J.normalize(),mt}function mO(d){return!!(d&&d.__CANCEL__)}function x_(d,l,z){Qu.call(this,d??"canceled",Qu.ERR_CANCELED,l,z),this.name="CanceledError"}to.inherits(x_,Qu,{__CANCEL__:!0});function gO(d,l,z){const j=z.config.validateStatus;!z.status||!j||j(z.status)?d(z):l(new Qu("Request failed with status code "+z.status,[Qu.ERR_BAD_REQUEST,Qu.ERR_BAD_RESPONSE][Math.floor(z.status/100)-4],z.config,z.request,z))}function DJ(d){const l=/^([-+\w]{1,25})(:?\/\/|:)/.exec(d);return l&&l[1]||""}function FJ(d,l){d=d||10;const z=new Array(d),j=new Array(d);let J=0,mt=0,kt;return l=l!==void 0?l:1e3,function(Gt){const re=Date.now(),pe=j[mt];kt||(kt=re),z[J]=Gt,j[J]=re;let Ne=mt,or=0;for(;Ne!==J;)or+=z[Ne++],Ne=Ne%d;if(J=(J+1)%d,J===mt&&(mt=(mt+1)%d),re-kt{z=pe,J=null,mt&&(clearTimeout(mt),mt=null),d(...re)};return[(...re)=>{const pe=Date.now(),Ne=pe-z;Ne>=j?kt(re,pe):(J=re,mt||(mt=setTimeout(()=>{mt=null,kt(J)},j-Ne)))},()=>J&&kt(J)]}const c4=(d,l,z=3)=>{let j=0;const J=FJ(50,250);return RJ(mt=>{const kt=mt.loaded,Dt=mt.lengthComputable?mt.total:void 0,Gt=kt-j,re=J(Gt),pe=kt<=Dt;j=kt;const Ne={loaded:kt,total:Dt,progress:Dt?kt/Dt:void 0,bytes:Gt,rate:re||void 0,estimated:re&&Dt&&pe?(Dt-kt)/re:void 0,event:mt,lengthComputable:Dt!=null,[l?"download":"upload"]:!0};d(Ne)},z)},CL=(d,l)=>{const z=d!=null;return[j=>l[0]({lengthComputable:z,total:d,loaded:j}),l[1]]},LL=d=>(...l)=>to.asap(()=>d(...l)),BJ=Kp.hasStandardBrowserEnv?((d,l)=>z=>(z=new URL(z,Kp.origin),d.protocol===z.protocol&&d.host===z.host&&(l||d.port===z.port)))(new URL(Kp.origin),Kp.navigator&&/(msie|trident)/i.test(Kp.navigator.userAgent)):()=>!0,NJ=Kp.hasStandardBrowserEnv?{write(d,l,z,j,J,mt,kt){if(typeof document>"u")return;const Dt=[`${d}=${encodeURIComponent(l)}`];to.isNumber(z)&&Dt.push(`expires=${new Date(z).toUTCString()}`),to.isString(j)&&Dt.push(`path=${j}`),to.isString(J)&&Dt.push(`domain=${J}`),mt===!0&&Dt.push("secure"),to.isString(kt)&&Dt.push(`SameSite=${kt}`),document.cookie=Dt.join("; ")},read(d){if(typeof document>"u")return null;const l=document.cookie.match(new RegExp("(?:^|; )"+d+"=([^;]*)"));return l?decodeURIComponent(l[1]):null},remove(d){this.write(d,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function jJ(d){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(d)}function UJ(d,l){return l?d.replace(/\/?\/$/,"")+"/"+l.replace(/^\/+/,""):d}function vO(d,l,z){let j=!jJ(l);return d&&(j||z==!1)?UJ(d,l):l}const PL=d=>d instanceof E0?{...d}:d;function Ay(d,l){l=l||{};const z={};function j(re,pe,Ne,or){return to.isPlainObject(re)&&to.isPlainObject(pe)?to.merge.call({caseless:or},re,pe):to.isPlainObject(pe)?to.merge({},pe):to.isArray(pe)?pe.slice():pe}function J(re,pe,Ne,or){if(to.isUndefined(pe)){if(!to.isUndefined(re))return j(void 0,re,Ne,or)}else return j(re,pe,Ne,or)}function mt(re,pe){if(!to.isUndefined(pe))return j(void 0,pe)}function kt(re,pe){if(to.isUndefined(pe)){if(!to.isUndefined(re))return j(void 0,re)}else return j(void 0,pe)}function Dt(re,pe,Ne){if(Ne in l)return j(re,pe);if(Ne in d)return j(void 0,re)}const Gt={url:mt,method:mt,data:mt,baseURL:kt,transformRequest:kt,transformResponse:kt,paramsSerializer:kt,timeout:kt,timeoutMessage:kt,withCredentials:kt,withXSRFToken:kt,adapter:kt,responseType:kt,xsrfCookieName:kt,xsrfHeaderName:kt,onUploadProgress:kt,onDownloadProgress:kt,decompress:kt,maxContentLength:kt,maxBodyLength:kt,beforeRedirect:kt,transport:kt,httpAgent:kt,httpsAgent:kt,cancelToken:kt,socketPath:kt,responseEncoding:kt,validateStatus:Dt,headers:(re,pe,Ne)=>J(PL(re),PL(pe),Ne,!0)};return to.forEach(Object.keys({...d,...l}),function(pe){const Ne=Gt[pe]||J,or=Ne(d[pe],l[pe],pe);to.isUndefined(or)&&Ne!==Dt||(z[pe]=or)}),z}const yO=d=>{const l=Ay({},d);let{data:z,withXSRFToken:j,xsrfHeaderName:J,xsrfCookieName:mt,headers:kt,auth:Dt}=l;if(l.headers=kt=E0.from(kt),l.url=fO(vO(l.baseURL,l.url,l.allowAbsoluteUrls),d.params,d.paramsSerializer),Dt&&kt.set("Authorization","Basic "+btoa((Dt.username||"")+":"+(Dt.password?unescape(encodeURIComponent(Dt.password)):""))),to.isFormData(z)){if(Kp.hasStandardBrowserEnv||Kp.hasStandardBrowserWebWorkerEnv)kt.setContentType(void 0);else if(to.isFunction(z.getHeaders)){const Gt=z.getHeaders(),re=["content-type","content-length"];Object.entries(Gt).forEach(([pe,Ne])=>{re.includes(pe.toLowerCase())&&kt.set(pe,Ne)})}}if(Kp.hasStandardBrowserEnv&&(j&&to.isFunction(j)&&(j=j(l)),j||j!==!1&&BJ(l.url))){const Gt=J&&mt&&NJ.read(mt);Gt&&kt.set(J,Gt)}return l},VJ=typeof XMLHttpRequest<"u",HJ=VJ&&function(d){return new Promise(function(z,j){const J=yO(d);let mt=J.data;const kt=E0.from(J.headers).normalize();let{responseType:Dt,onUploadProgress:Gt,onDownloadProgress:re}=J,pe,Ne,or,_r,Fr;function zr(){_r&&_r(),Fr&&Fr(),J.cancelToken&&J.cancelToken.unsubscribe(pe),J.signal&&J.signal.removeEventListener("abort",pe)}let Wr=new XMLHttpRequest;Wr.open(J.method.toUpperCase(),J.url,!0),Wr.timeout=J.timeout;function An(){if(!Wr)return;const kn=E0.from("getAllResponseHeaders"in Wr&&Wr.getAllResponseHeaders()),jn={data:!Dt||Dt==="text"||Dt==="json"?Wr.responseText:Wr.response,status:Wr.status,statusText:Wr.statusText,headers:kn,config:d,request:Wr};gO(function(Qi){z(Qi),zr()},function(Qi){j(Qi),zr()},jn),Wr=null}"onloadend"in Wr?Wr.onloadend=An:Wr.onreadystatechange=function(){!Wr||Wr.readyState!==4||Wr.status===0&&!(Wr.responseURL&&Wr.responseURL.indexOf("file:")===0)||setTimeout(An)},Wr.onabort=function(){Wr&&(j(new Qu("Request aborted",Qu.ECONNABORTED,d,Wr)),Wr=null)},Wr.onerror=function(ei){const jn=ei&&ei.message?ei.message:"Network Error",ai=new Qu(jn,Qu.ERR_NETWORK,d,Wr);ai.event=ei||null,j(ai),Wr=null},Wr.ontimeout=function(){let ei=J.timeout?"timeout of "+J.timeout+"ms exceeded":"timeout exceeded";const jn=J.transitional||dO;J.timeoutErrorMessage&&(ei=J.timeoutErrorMessage),j(new Qu(ei,jn.clarifyTimeoutError?Qu.ETIMEDOUT:Qu.ECONNABORTED,d,Wr)),Wr=null},mt===void 0&&kt.setContentType(null),"setRequestHeader"in Wr&&to.forEach(kt.toJSON(),function(ei,jn){Wr.setRequestHeader(jn,ei)}),to.isUndefined(J.withCredentials)||(Wr.withCredentials=!!J.withCredentials),Dt&&Dt!=="json"&&(Wr.responseType=J.responseType),re&&([or,Fr]=c4(re,!0),Wr.addEventListener("progress",or)),Gt&&Wr.upload&&([Ne,_r]=c4(Gt),Wr.upload.addEventListener("progress",Ne),Wr.upload.addEventListener("loadend",_r)),(J.cancelToken||J.signal)&&(pe=kn=>{Wr&&(j(!kn||kn.type?new x_(null,d,Wr):kn),Wr.abort(),Wr=null)},J.cancelToken&&J.cancelToken.subscribe(pe),J.signal&&(J.signal.aborted?pe():J.signal.addEventListener("abort",pe)));const Ft=DJ(J.url);if(Ft&&Kp.protocols.indexOf(Ft)===-1){j(new Qu("Unsupported protocol "+Ft+":",Qu.ERR_BAD_REQUEST,d));return}Wr.send(mt||null)})},WJ=(d,l)=>{const{length:z}=d=d?d.filter(Boolean):[];if(l||z){let j=new AbortController,J;const mt=function(re){if(!J){J=!0,Dt();const pe=re instanceof Error?re:this.reason;j.abort(pe instanceof Qu?pe:new x_(pe instanceof Error?pe.message:pe))}};let kt=l&&setTimeout(()=>{kt=null,mt(new Qu(`timeout ${l} of ms exceeded`,Qu.ETIMEDOUT))},l);const Dt=()=>{d&&(kt&&clearTimeout(kt),kt=null,d.forEach(re=>{re.unsubscribe?re.unsubscribe(mt):re.removeEventListener("abort",mt)}),d=null)};d.forEach(re=>re.addEventListener("abort",mt));const{signal:Gt}=j;return Gt.unsubscribe=()=>to.asap(Dt),Gt}},qJ=function*(d,l){let z=d.byteLength;if(z{const J=ZJ(d,l);let mt=0,kt,Dt=Gt=>{kt||(kt=!0,j&&j(Gt))};return new ReadableStream({async pull(Gt){try{const{done:re,value:pe}=await J.next();if(re){Dt(),Gt.close();return}let Ne=pe.byteLength;if(z){let or=mt+=Ne;z(or)}Gt.enqueue(new Uint8Array(pe))}catch(re){throw Dt(re),re}},cancel(Gt){return Dt(Gt),J.return()}},{highWaterMark:2})},IL=64*1024,{isFunction:M5}=to,GJ=(({Request:d,Response:l})=>({Request:d,Response:l}))(to.global),{ReadableStream:OL,TextEncoder:DL}=to.global,FL=(d,...l)=>{try{return!!d(...l)}catch{return!1}},YJ=d=>{d=to.merge.call({skipUndefined:!0},GJ,d);const{fetch:l,Request:z,Response:j}=d,J=l?M5(l):typeof fetch=="function",mt=M5(z),kt=M5(j);if(!J)return!1;const Dt=J&&M5(OL),Gt=J&&(typeof DL=="function"?(Fr=>zr=>Fr.encode(zr))(new DL):async Fr=>new Uint8Array(await new z(Fr).arrayBuffer())),re=mt&&Dt&&FL(()=>{let Fr=!1;const zr=new z(Kp.origin,{body:new OL,method:"POST",get duplex(){return Fr=!0,"half"}}).headers.has("Content-Type");return Fr&&!zr}),pe=kt&&Dt&&FL(()=>to.isReadableStream(new j("").body)),Ne={stream:pe&&(Fr=>Fr.body)};J&&["text","arrayBuffer","blob","formData","stream"].forEach(Fr=>{!Ne[Fr]&&(Ne[Fr]=(zr,Wr)=>{let An=zr&&zr[Fr];if(An)return An.call(zr);throw new Qu(`Response type '${Fr}' is not supported`,Qu.ERR_NOT_SUPPORT,Wr)})});const or=async Fr=>{if(Fr==null)return 0;if(to.isBlob(Fr))return Fr.size;if(to.isSpecCompliantForm(Fr))return(await new z(Kp.origin,{method:"POST",body:Fr}).arrayBuffer()).byteLength;if(to.isArrayBufferView(Fr)||to.isArrayBuffer(Fr))return Fr.byteLength;if(to.isURLSearchParams(Fr)&&(Fr=Fr+""),to.isString(Fr))return(await Gt(Fr)).byteLength},_r=async(Fr,zr)=>{const Wr=to.toFiniteNumber(Fr.getContentLength());return Wr??or(zr)};return async Fr=>{let{url:zr,method:Wr,data:An,signal:Ft,cancelToken:kn,timeout:ei,onDownloadProgress:jn,onUploadProgress:ai,responseType:Qi,headers:Gi,withCredentials:un="same-origin",fetchOptions:ia}=yO(Fr),fa=l||fetch;Qi=Qi?(Qi+"").toLowerCase():"text";let Li=WJ([Ft,kn&&kn.toAbortSignal()],ei),yi=null;const ra=Li&&Li.unsubscribe&&(()=>{Li.unsubscribe()});let Da;try{if(ai&&re&&Wr!=="get"&&Wr!=="head"&&(Da=await _r(Gi,An))!==0){let ko=new z(zr,{method:"POST",body:An,duplex:"half"}),pl;if(to.isFormData(An)&&(pl=ko.headers.get("content-type"))&&Gi.setContentType(pl),ko.body){const[fu,qo]=CL(Da,c4(LL(ai)));An=zL(ko.body,IL,fu,qo)}}to.isString(un)||(un=un?"include":"omit");const Ni=mt&&"credentials"in z.prototype,Ei={...ia,signal:Li,method:Wr.toUpperCase(),headers:Gi.normalize().toJSON(),body:An,duplex:"half",credentials:Ni?un:void 0};yi=mt&&new z(zr,Ei);let Va=await(mt?fa(yi,ia):fa(zr,Ei));const ss=pe&&(Qi==="stream"||Qi==="response");if(pe&&(jn||ss&&ra)){const ko={};["status","statusText","headers"].forEach(fo=>{ko[fo]=Va[fo]});const pl=to.toFiniteNumber(Va.headers.get("content-length")),[fu,qo]=jn&&CL(pl,c4(LL(jn),!0))||[];Va=new j(zL(Va.body,IL,fu,()=>{qo&&qo(),ra&&ra()}),ko)}Qi=Qi||"text";let mo=await Ne[to.findKey(Ne,Qi)||"text"](Va,Fr);return!ss&&ra&&ra(),await new Promise((ko,pl)=>{gO(ko,pl,{data:mo,headers:E0.from(Va.headers),status:Va.status,statusText:Va.statusText,config:Fr,request:yi})})}catch(Ni){throw ra&&ra(),Ni&&Ni.name==="TypeError"&&/Load failed|fetch/i.test(Ni.message)?Object.assign(new Qu("Network Error",Qu.ERR_NETWORK,Fr,yi),{cause:Ni.cause||Ni}):Qu.from(Ni,Ni&&Ni.code,Fr,yi)}}},KJ=new Map,xO=d=>{let l=d&&d.env||{};const{fetch:z,Request:j,Response:J}=l,mt=[j,J,z];let kt=mt.length,Dt=kt,Gt,re,pe=KJ;for(;Dt--;)Gt=mt[Dt],re=pe.get(Gt),re===void 0&&pe.set(Gt,re=Dt?new Map:YJ(l)),pe=re;return re};xO();const tM={http:dJ,xhr:HJ,fetch:{get:xO}};to.forEach(tM,(d,l)=>{if(d){try{Object.defineProperty(d,"name",{value:l})}catch{}Object.defineProperty(d,"adapterName",{value:l})}});const RL=d=>`- ${d}`,XJ=d=>to.isFunction(d)||d===null||d===!1;function JJ(d,l){d=to.isArray(d)?d:[d];const{length:z}=d;let j,J;const mt={};for(let kt=0;kt`adapter ${Gt} `+(re===!1?"is not supported by the environment":"is not available in the build"));let Dt=z?kt.length>1?`since : `+kt.map(RL).join(` `):" "+RL(kt[0]):"as no adapter specified";throw new Qu("There is no suitable adapter to dispatch the request "+Dt,"ERR_NOT_SUPPORT")}return J}const _O={getAdapter:JJ,adapters:tM};function C8(d){if(d.cancelToken&&d.cancelToken.throwIfRequested(),d.signal&&d.signal.aborted)throw new x_(null,d)}function BL(d){return C8(d),d.headers=E0.from(d.headers),d.data=E8.call(d,d.transformRequest),["post","put","patch"].indexOf(d.method)!==-1&&d.headers.setContentType("application/x-www-form-urlencoded",!1),_O.getAdapter(d.adapter||ew.adapter,d)(d).then(function(j){return C8(d),j.data=E8.call(d,d.transformResponse,j),j.headers=E0.from(j.headers),j},function(j){return mO(j)||(C8(d),j&&j.response&&(j.response.data=E8.call(d,d.transformResponse,j.response),j.response.headers=E0.from(j.response.headers))),Promise.reject(j)})}const bO="1.13.2",j4={};["object","boolean","number","function","string","symbol"].forEach((d,l)=>{j4[d]=function(j){return typeof j===d||"a"+(l<1?"n ":" ")+d}});const NL={};j4.transitional=function(l,z,j){function J(mt,kt){return"[Axios v"+bO+"] Transitional option '"+mt+"'"+kt+(j?". "+j:"")}return(mt,kt,Dt)=>{if(l===!1)throw new Qu(J(kt," has been removed"+(z?" in "+z:"")),Qu.ERR_DEPRECATED);return z&&!NL[kt]&&(NL[kt]=!0,console.warn(J(kt," has been deprecated since v"+z+" and will be removed in the near future"))),l?l(mt,kt,Dt):!0}};j4.spelling=function(l){return(z,j)=>(console.warn(`${j} is likely a misspelling of ${l}`),!0)};function QJ(d,l,z){if(typeof d!="object")throw new Qu("options must be an object",Qu.ERR_BAD_OPTION_VALUE);const j=Object.keys(d);let J=j.length;for(;J-- >0;){const mt=j[J],kt=l[mt];if(kt){const Dt=d[mt],Gt=Dt===void 0||kt(Dt,mt,d);if(Gt!==!0)throw new Qu("option "+mt+" must be "+Gt,Qu.ERR_BAD_OPTION_VALUE);continue}if(z!==!0)throw new Qu("Unknown option "+mt,Qu.ERR_BAD_OPTION)}}const Y5={assertOptions:QJ,validators:j4},tg=Y5.validators;let by=class{constructor(l){this.defaults=l||{},this.interceptors={request:new SL,response:new SL}}async request(l,z){try{return await this._request(l,z)}catch(j){if(j instanceof Error){let J={};Error.captureStackTrace?Error.captureStackTrace(J):J=new Error;const mt=J.stack?J.stack.replace(/^.+\n/,""):"";try{j.stack?mt&&!String(j.stack).endsWith(mt.replace(/^.+\n.+\n/,""))&&(j.stack+=` -`+mt):j.stack=mt}catch{}}throw j}}_request(l,z){typeof l=="string"?(z=z||{},z.url=l):z=l||{},z=Ay(this.defaults,z);const{transitional:j,paramsSerializer:J,headers:mt}=z;j!==void 0&&Y5.assertOptions(j,{silentJSONParsing:tg.transitional(tg.boolean),forcedJSONParsing:tg.transitional(tg.boolean),clarifyTimeoutError:tg.transitional(tg.boolean)},!1),J!=null&&(to.isFunction(J)?z.paramsSerializer={serialize:J}:Y5.assertOptions(J,{encode:tg.function,serialize:tg.function},!0)),z.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?z.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:z.allowAbsoluteUrls=!0),Y5.assertOptions(z,{baseUrl:tg.spelling("baseURL"),withXsrfToken:tg.spelling("withXSRFToken")},!0),z.method=(z.method||this.defaults.method||"get").toLowerCase();let kt=mt&&to.merge(mt.common,mt[z.method]);mt&&to.forEach(["delete","get","head","post","put","patch","common"],Fr=>{delete mt[Fr]}),z.headers=E0.concat(kt,mt);const Dt=[];let Gt=!0;this.interceptors.request.forEach(function(zr){typeof zr.runWhen=="function"&&zr.runWhen(z)===!1||(Gt=Gt&&zr.synchronous,Dt.unshift(zr.fulfilled,zr.rejected))});const re=[];this.interceptors.response.forEach(function(zr){re.push(zr.fulfilled,zr.rejected)});let pe,Ne=0,or;if(!Gt){const Fr=[BL.bind(this),void 0];for(Fr.unshift(...Dt),Fr.push(...re),or=Fr.length,pe=Promise.resolve(z);Ne{if(!j._listeners)return;let mt=j._listeners.length;for(;mt-- >0;)j._listeners[mt](J);j._listeners=null}),this.promise.then=J=>{let mt;const kt=new Promise(Dt=>{j.subscribe(Dt),mt=Dt}).then(J);return kt.cancel=function(){j.unsubscribe(mt)},kt},l(function(mt,kt,Dt){j.reason||(j.reason=new x_(mt,kt,Dt),z(j.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(l){if(this.reason){l(this.reason);return}this._listeners?this._listeners.push(l):this._listeners=[l]}unsubscribe(l){if(!this._listeners)return;const z=this._listeners.indexOf(l);z!==-1&&this._listeners.splice(z,1)}toAbortSignal(){const l=new AbortController,z=j=>{l.abort(j)};return this.subscribe(z),l.signal.unsubscribe=()=>this.unsubscribe(z),l.signal}static source(){let l;return{token:new wO(function(J){l=J}),cancel:l}}};function eQ(d){return function(z){return d.apply(null,z)}}function rQ(d){return to.isObject(d)&&d.isAxiosError===!0}const pA={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(pA).forEach(([d,l])=>{pA[l]=d});function kO(d){const l=new by(d),z=tO(by.prototype.request,l);return to.extend(z,by.prototype,l,{allOwnKeys:!0}),to.extend(z,l,null,{allOwnKeys:!0}),z.create=function(J){return kO(Ay(d,J))},z}const _d=kO(ew);_d.Axios=by;_d.CanceledError=x_;_d.CancelToken=tQ;_d.isCancel=mO;_d.VERSION=bO;_d.toFormData=N4;_d.AxiosError=Qu;_d.Cancel=_d.CanceledError;_d.all=function(l){return Promise.all(l)};_d.spread=eQ;_d.isAxiosError=rQ;_d.mergeConfig=Ay;_d.AxiosHeaders=E0;_d.formToJSON=d=>pO(to.isHTMLForm(d)?new FormData(d):d);_d.getAdapter=_O.getAdapter;_d.HttpStatusCode=pA;_d.default=_d;const{Axios:yvt,AxiosError:xvt,CanceledError:_vt,isCancel:bvt,CancelToken:wvt,VERSION:kvt,all:Tvt,Cancel:Avt,isAxiosError:Mvt,spread:Svt,toFormData:Evt,AxiosHeaders:Cvt,HttpStatusCode:Lvt,formToJSON:Pvt,getAdapter:zvt,mergeConfig:Ivt}=_d,nQ="http://192.168.0.59:8000/api",iQ="http://192.168.0.59:8000",my=_d.create({baseURL:nQ,timeout:5e3,headers:{"Content-Type":"application/json"}});my.interceptors.request.use(d=>d,d=>(console.error("API Request Error:",d),Promise.reject(d)));my.interceptors.response.use(d=>d,d=>(console.error("API Response Error:",d.response?.data||d.message),Promise.reject(d)));class Xh{static async get(l,z){try{return(await my.get(l,{params:z})).data}catch(j){throw this.handleError(j)}}static async post(l,z,j){try{return(await my.post(l,z,j)).data}catch(J){throw this.handleError(J)}}static async put(l,z,j){try{return(await my.put(l,z,j)).data}catch(J){throw this.handleError(J)}}static async delete(l,z){try{return(await my.delete(l,z)).data}catch(j){throw this.handleError(j)}}static async getTransportKeys(){return this.get("transport_keys")}static async createTransportKey(l,z,j,J,mt){const kt={name:l,flood_policy:z,parent_id:J,last_used:mt};return j!==void 0&&(kt.transport_key=j),this.post("transport_keys",kt)}static async getTransportKey(l){return this.get(`transport_key/${l}`)}static async updateTransportKey(l,z,j,J,mt,kt){return this.put(`transport_key/${l}`,{name:z,flood_policy:j,transport_key:J,parent_id:mt,last_used:kt})}static async deleteTransportKey(l){return this.delete(`transport_key/${l}`)}static async updateGlobalFloodPolicy(l){return this.post("global_flood_policy",{global_flood_allow:l})}static async getLogs(){try{return(await my.get("logs")).data}catch(l){throw this.handleError(l)}}static handleError(l){if(_d.isAxiosError(l)){if(l.response){const z=l.response.data?.error||l.response.data?.message||`HTTP ${l.response.status}`;return new Error(z)}else if(l.request)return new Error("Network error - no response received")}return new Error(l instanceof Error?l.message:"Unknown error occurred")}}const sv=GA("system",()=>{const d=lo(null),l=lo(!1),z=lo(null),j=lo(null),J=lo("forward"),mt=lo(!0),kt=lo(0),Dt=lo(10),Gt=lo(!1),re=Yo(()=>d.value?.config?.node_name??"Unknown"),pe=Yo(()=>{const yi=d.value?.public_key;return!yi||yi==="Unknown"?"Unknown":yi.length>=16?`${yi.slice(0,8)} ... ${yi.slice(-8)}`:`${yi}`}),Ne=Yo(()=>d.value!==null),or=Yo(()=>d.value?.version??"Unknown"),_r=Yo(()=>d.value?.core_version??"Unknown"),Fr=Yo(()=>d.value?.noise_floor_dbm??null),zr=Yo(()=>Dt.value>0?Math.min(kt.value/Dt.value*100,100):0),Wr=Yo(()=>J.value==="monitor"?{text:"Monitor Mode",title:"Monitoring only - not forwarding packets"}:mt.value?{text:"Active",title:"Forwarding with duty cycle enforcement"}:{text:"No Limits",title:"Forwarding without duty cycle enforcement"}),An=Yo(()=>J.value==="monitor"?{active:!1,warning:!0}:{active:!0,warning:!1}),Ft=Yo(()=>mt.value?{active:!0,warning:!1}:{active:!1,warning:!0}),kn=yi=>{Gt.value=yi};async function ei(){try{l.value=!0,z.value=null;const yi=await Xh.get("/stats");if(yi.success&&yi.data)return d.value=yi.data,j.value=new Date,jn(yi.data),yi.data;if(yi&&"version"in yi){const ra=yi;return d.value=ra,j.value=new Date,jn(ra),ra}else throw new Error(yi.error||"Failed to fetch stats")}catch(yi){throw z.value=yi instanceof Error?yi.message:"Unknown error occurred",console.error("Error fetching stats:",yi),yi}finally{l.value=!1}}function jn(yi){if(yi.config){const Da=yi.config.repeater?.mode;(Da==="forward"||Da==="monitor")&&(J.value=Da);const Ni=yi.config.duty_cycle;if(Ni){mt.value=Ni.enforcement_enabled!==!1;const Ei=Ni.max_airtime_percent;typeof Ei=="number"?Dt.value=Ei:Ei&&typeof Ei=="object"&&"parsedValue"in Ei&&(Dt.value=Ei.parsedValue||10)}}const ra=yi.utilization_percent;typeof ra=="number"?kt.value=ra:ra&&typeof ra=="object"&&"parsedValue"in ra&&(kt.value=ra.parsedValue||0)}async function ai(yi){try{const ra=await Xh.post("/set_mode",{mode:yi});if(ra.success)return J.value=yi,!0;throw new Error(ra.error||"Failed to set mode")}catch(ra){throw z.value=ra instanceof Error?ra.message:"Unknown error occurred",console.error("Error setting mode:",ra),ra}}async function Qi(yi){try{const ra=await Xh.post("/set_duty_cycle",{enabled:yi});if(ra.success)return mt.value=yi,!0;throw new Error(ra.error||"Failed to set duty cycle")}catch(ra){throw z.value=ra instanceof Error?ra.message:"Unknown error occurred",console.error("Error setting duty cycle:",ra),ra}}async function Gi(){try{const yi=await Xh.post("/send_advert",{},{timeout:1e4});if(yi.success)return console.log("Advertisement sent successfully:",yi.data),!0;throw new Error(yi.error||"Failed to send advert")}catch(yi){throw z.value=yi instanceof Error?yi.message:"Unknown error occurred",console.error("Error sending advert:",yi),yi}}async function un(){const yi=J.value==="forward"?"monitor":"forward";return await ai(yi)}async function ia(){return await Qi(!mt.value)}async function fa(yi=5e3){await ei();const ra=setInterval(async()=>{try{await ei()}catch(Da){console.error("Auto-refresh error:",Da)}},yi);return()=>clearInterval(ra)}function Li(){d.value=null,z.value=null,j.value=null,l.value=!1,J.value="forward",mt.value=!0,kt.value=0,Dt.value=10}return{stats:d,isLoading:l,error:z,lastUpdated:j,currentMode:J,dutyCycleEnabled:mt,dutyCycleUtilization:kt,dutyCycleMax:Dt,cadCalibrationRunning:Gt,nodeName:re,pubKey:pe,hasStats:Ne,version:or,coreVersion:_r,noiseFloorDbm:Fr,dutyCyclePercentage:zr,statusBadge:Wr,modeButtonState:An,dutyCycleButtonState:Ft,fetchStats:ei,setMode:ai,setDutyCycle:Qi,sendAdvert:Gi,toggleMode:un,toggleDutyCycle:ia,startAutoRefresh:fa,reset:Li,setCadCalibrationRunning:kn}}),ld=(d,l)=>{const z=d.__vccOpts||d;for(const[j,J]of l)z[j]=J;return z},aQ={},oQ={width:"23",height:"25",viewBox:"0 0 23 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function sQ(d,l){return zi(),Vi("svg",oQ,l[0]||(l[0]=[Re("path",{d:"M2.84279 2.25795C2.90709 1.12053 3.17879 0.625914 3.95795 0.228723C4.79631 -0.198778 6.11858 0.000168182 7.67449 0.788054C8.34465 1.12757 8.41289 1.13448 9.58736 0.983905C11.1485 0.783681 13.1582 0.784388 14.5991 0.985738C15.6887 1.13801 15.7603 1.1304 16.4321 0.790174C18.6406 -0.328212 20.3842 -0.255036 21.0156 0.982491C21.3308 1.6002 21.3893 3.20304 21.1449 4.52503C21.0094 5.25793 21.0238 5.34943 21.3502 5.83037C23.6466 9.21443 21.9919 14.6998 18.0569 16.7469C17.7558 16.9036 17.502 17.0005 17.2952 17.0795C16.6602 17.3219 16.4674 17.3956 16.7008 18.5117C16.8132 19.0486 16.9486 20.3833 17.0018 21.478C17.098 23.4567 17.0966 23.4705 16.7495 23.8742C16.2772 24.4233 15.5963 24.4326 15.135 23.8962C14.8341 23.5464 14.8047 23.3812 14.8047 22.0315C14.8047 20.037 14.5861 18.7113 14.0695 17.5753C13.4553 16.2235 13.9106 15.7194 15.3154 15.4173C17.268 14.9973 18.793 13.7923 19.643 11.9978C20.4511 10.2921 20.5729 7.93485 19.1119 6.50124C18.6964 6.00746 18.6674 5.56022 18.9641 4.21159C19.075 3.70754 19.168 3.05725 19.1707 2.76637C19.1749 2.30701 19.1331 2.23764 18.8509 2.23764C18.6724 2.23764 17.9902 2.49736 17.3352 2.81474L16.2897 3.32145C16.1947 3.36751 16.0883 3.38522 15.9834 3.37318C13.3251 3.06805 10.7991 3.06334 8.12774 3.37438C8.02244 3.38663 7.91563 3.36892 7.82025 3.32263L6.77535 2.81559C6.12027 2.49764 5.43813 2.23764 5.25963 2.23764C4.84693 2.23764 4.84072 2.54233 5.2169 4.35258C5.44669 5.45816 5.60133 5.70451 4.93703 6.58851C3.94131 7.91359 3.69258 9.55902 4.22654 11.2878C4.89952 13.4664 6.54749 14.9382 8.86436 15.4292C10.261 15.7253 10.6261 16.1115 10.0928 17.713C9.67293 18.9734 9.40748 19.2982 8.79738 19.2982C7.97649 19.2982 7.46228 18.5871 7.74527 17.843C7.86991 17.5151 7.83283 17.4801 7.06383 17.1996C4.71637 16.3437 2.9209 14.4254 2.10002 11.8959C1.46553 9.94098 1.74471 7.39642 2.76257 5.85843C3.10914 5.33477 3.1145 5.29036 2.95277 4.28787C2.86126 3.72037 2.81177 2.80699 2.84279 2.25795Z",fill:"white"},null,-1),Re("path",{d:"M2.02306 16.5589C1.68479 16.0516 0.999227 15.9144 0.491814 16.2527C-0.0155884 16.591 -0.152708 17.2765 0.185564 17.7839C0.435301 18.1586 0.734065 18.4663 0.987777 18.72C1.03455 18.7668 1.08 18.8119 1.12438 18.856C1.3369 19.0671 1.52455 19.2535 1.71302 19.4748C2.12986 19.964 2.54572 20.623 2.78206 21.8047C2.88733 22.3311 3.26569 22.6147 3.47533 22.7386C3.70269 22.8728 3.9511 22.952 4.15552 23.0036C4.57369 23.109 5.08133 23.1638 5.56309 23.1957C6.09196 23.2308 6.665 23.2422 7.17743 23.2453C7.1778 23.8547 7.67202 24.3487 8.28162 24.3487C8.89146 24.3487 9.38582 23.8543 9.38582 23.2445V22.1403C9.38582 21.5305 8.89146 21.0361 8.28162 21.0361C8.17753 21.0361 8.06491 21.0364 7.94562 21.0369C7.29761 21.0389 6.45295 21.0414 5.70905 20.9922C5.35033 20.9684 5.05544 20.9347 4.8392 20.8936C4.50619 19.5863 3.96821 18.7165 3.39415 18.0426C3.14038 17.7448 2.87761 17.4842 2.66387 17.2722C2.62385 17.2326 2.58556 17.1946 2.54935 17.1584C2.30273 16.9118 2.1414 16.7365 2.02306 16.5589Z",fill:"white"},null,-1)]))}const lQ=ld(aQ,[["render",sQ]]),uQ={},cQ={width:"17",height:"24",viewBox:"0 0 17 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function hQ(d,l){return zi(),Vi("svg",cQ,l[0]||(l[0]=[Ff('',12)]))}const fQ=ld(uQ,[["render",hQ]]),rw=GA("packets",()=>{const d=lo(null),l=lo(null),z=lo([]),j=lo([]),J=lo(null),mt=lo(!1),kt=lo(null),Dt=lo(null),Gt=lo([]),re=lo([]),pe=Yo(()=>d.value!==null),Ne=Yo(()=>l.value!==null),or=Yo(()=>z.value.length>0),_r=Yo(()=>j.value.length>0),Fr=Yo(()=>J.value?.avg_noise_floor??0),zr=Yo(()=>d.value?.total_packets??0),Wr=Yo(()=>d.value?.avg_rssi??0),An=Yo(()=>d.value?.avg_snr??0),Ft=Yo(()=>l.value?.uptime_seconds??0),kn=Yo(()=>{if(!d.value?.packet_types)return[];const Ni=d.value.packet_types,Ei=Ni.reduce((Va,ss)=>Va+ss.count,0);return Ni.map(Va=>({type:Va.type.toString(),count:Va.count,percentage:Ei>0?Va.count/Ei*100:0}))}),ei=Yo(()=>{const Ni={};return z.value.forEach(Ei=>{Ni[Ei.type]||(Ni[Ei.type]=[]),Ni[Ei.type].push(Ei)}),Ni});async function jn(){try{const Ni=await Xh.get("/stats");if(Ni.success&&Ni.data){l.value=Ni.data;const Ei=new Date;return re.value.push({timestamp:Ei,stats:Ni.data}),re.value.length>50&&(re.value=re.value.slice(-50)),Ni.data}else if(Ni&&"version"in Ni){const Ei=Ni;l.value=Ei;const Va=new Date;return re.value.push({timestamp:Va,stats:Ei}),re.value.length>50&&(re.value=re.value.slice(-50)),Ei}else throw new Error(Ni.error||"Failed to fetch system stats")}catch(Ni){throw kt.value=Ni instanceof Error?Ni.message:"Unknown error occurred",console.error("Error fetching system stats:",Ni),Ni}}async function ai(Ni={hours:24}){try{const Ei=await Xh.get("/noise_floor_history",Ni);if(Ei.success&&Ei.data&&Ei.data.history)return j.value=Ei.data.history,Dt.value=new Date,Ei.data.history;throw new Error(Ei.error||"Failed to fetch noise floor history")}catch(Ei){throw kt.value=Ei instanceof Error?Ei.message:"Unknown error occurred",console.error("Error fetching noise floor history:",Ei),Ei}}async function Qi(Ni={hours:24}){try{const Ei=await Xh.get("/noise_floor_stats",Ni);if(Ei.success&&Ei.data&&Ei.data.stats)return J.value=Ei.data.stats,Dt.value=new Date,Ei.data.stats;throw new Error(Ei.error||"Failed to fetch noise floor stats")}catch(Ei){throw kt.value=Ei instanceof Error?Ei.message:"Unknown error occurred",console.error("Error fetching noise floor stats:",Ei),Ei}}const Gi=Yo(()=>!j.value||!Array.isArray(j.value)?[]:j.value.slice(-50).map(Ni=>Ni.noise_floor_dbm));async function un(Ni={hours:24}){try{mt.value=!0,kt.value=null;const Ei=await Xh.get("/packet_stats",Ni);if(Ei.success&&Ei.data){d.value=Ei.data;const Va=new Date;Gt.value.push({timestamp:Va,stats:Ei.data}),Gt.value.length>50&&(Gt.value=Gt.value.slice(-50)),Dt.value=Va}else throw new Error(Ei.error||"Failed to fetch packet stats")}catch(Ei){kt.value=Ei instanceof Error?Ei.message:"Unknown error occurred",console.error("Error fetching packet stats:",Ei)}finally{mt.value=!1}}async function ia(Ni={limit:100}){try{mt.value=!0,kt.value=null;const Ei=await Xh.get("/recent_packets",Ni);if(Ei.success&&Ei.data)z.value=Ei.data,Dt.value=new Date;else throw new Error(Ei.error||"Failed to fetch recent packets")}catch(Ei){kt.value=Ei instanceof Error?Ei.message:"Unknown error occurred",console.error("Error fetching recent packets:",Ei)}finally{mt.value=!1}}async function fa(Ni){try{mt.value=!0,kt.value=null;const Ei=await Xh.get("/filtered_packets",Ni);if(Ei.success&&Ei.data)return z.value=Ei.data,Dt.value=new Date,Ei.data;throw new Error(Ei.error||"Failed to fetch filtered packets")}catch(Ei){throw kt.value=Ei instanceof Error?Ei.message:"Unknown error occurred",console.error("Error fetching filtered packets:",Ei),Ei}finally{mt.value=!1}}async function Li(Ni){try{mt.value=!0,kt.value=null;const Ei=await Xh.get("/packet_by_hash",{packet_hash:Ni});if(Ei.success&&Ei.data)return Ei.data;throw new Error(Ei.error||"Packet not found")}catch(Ei){throw kt.value=Ei instanceof Error?Ei.message:"Unknown error occurred",console.error("Error fetching packet by hash:",Ei),Ei}finally{mt.value=!1}}const yi=Yo(()=>{const Ni=Gt.value,Ei=re.value;return{totalPackets:Ni.map(Va=>Va.stats.total_packets),transmittedPackets:Ni.map(Va=>Va.stats.transmitted_packets),droppedPackets:Ni.map(Va=>Va.stats.dropped_packets),avgRssi:Ni.map(Va=>Va.stats.avg_rssi),uptimeHours:Ei.map(Va=>Math.floor((Va.stats.uptime_seconds||0)/3600))}});async function ra(Ni=3e4){await Promise.all([jn(),un(),ia(),ai({hours:1}),Qi({hours:1})]);const Ei=setInterval(async()=>{try{await Promise.all([jn(),un(),ia(),ai({hours:1}),Qi({hours:1})])}catch(Va){console.error("Auto-refresh error:",Va)}},Ni);return()=>clearInterval(Ei)}function Da(){d.value=null,l.value=null,z.value=[],j.value=[],J.value=null,Gt.value=[],re.value=[],kt.value=null,Dt.value=null,mt.value=!1}return{packetStats:d,systemStats:l,recentPackets:z,noiseFloorHistory:j,noiseFloorStats:J,packetStatsHistory:Gt,systemStatsHistory:re,isLoading:mt,error:kt,lastUpdated:Dt,hasPacketStats:pe,hasSystemStats:Ne,hasRecentPackets:or,hasNoiseFloorData:_r,currentNoiseFloor:Fr,totalPackets:zr,averageRSSI:Wr,averageSNR:An,uptime:Ft,packetTypeBreakdown:kn,recentPacketsByType:ei,sparklineData:yi,noiseFloorSparklineData:Gi,fetchSystemStats:jn,fetchPacketStats:un,fetchRecentPackets:ia,fetchFilteredPackets:fa,getPacketByHash:Li,fetchNoiseFloorHistory:ai,fetchNoiseFloorStats:Qi,startAutoRefresh:ra,reset:Da}}),dQ={class:"glass-card-green p-5 relative overflow-hidden"},pQ={key:0,class:"absolute inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-10 rounded-lg"},mQ={class:"flex items-baseline gap-2 mb-8"},gQ={class:"text-primary text-2xl font-medium"},vQ={class:"absolute bottom-0 left-5 w-[196px] h-[30px]",viewBox:"0 0 196 30",fill:"none",xmlns:"http://www.w3.org/2000/svg"},yQ=["d"],xQ=["d"],_Q=["cy"],bQ=Th({__name:"RFNoiseFloor",setup(d){const l=rw(),z=sv(),j=lo(null),J=pe=>{if(pe.length<2)return"";const Ne=196,or=30,_r=4,Fr=-125,Wr=-105-Fr;let An="";return pe.forEach((Ft,kn)=>{const ei=kn/(pe.length-1)*Ne,jn=(Ft-Fr)/Wr,ai=or-jn*(or-_r*2)-_r;if(kn===0)An+=`M ${ei} ${ai}`;else{const Gi=((kn-1)/(pe.length-1)*Ne+ei)/2;An+=` Q ${Gi} ${ai} ${ei} ${ai}`}}),An},mt=async()=>{try{await Promise.all([l.fetchNoiseFloorHistory({hours:1}),l.fetchNoiseFloorStats({hours:1})])}catch(pe){console.error("Error fetching noise floor data:",pe)}};t0(()=>{mt(),j.value=window.setInterval(mt,5e3)}),dg(()=>{j.value&&clearInterval(j.value)});const kt=Yo(()=>{const pe=l.noiseFloorSparklineData;return pe&&pe.length>0?pe[pe.length-1]:l.noiseFloorStats?.avg_noise_floor??-116}),Dt=Yo(()=>l.noiseFloorSparklineData),Gt=Yo(()=>J(Dt.value)),re=Yo(()=>{if(Dt.value.length===0)return 15;const pe=Dt.value[Dt.value.length-1],Ne=-125,_r=-105-Ne;return 30-(pe-Ne)/_r*22-4});return(pe,Ne)=>(zi(),Vi("div",dQ,[Ju(z).cadCalibrationRunning?(zi(),Vi("div",pQ,Ne[0]||(Ne[0]=[Ff('
CAD Calibration

In Progress

',1)]))):bs("",!0),Ne[4]||(Ne[4]=Re("p",{class:"text-dark-text text-xs uppercase mb-2"},"RF NOISE FLOOR",-1)),Re("div",mQ,[Re("span",gQ,aa(kt.value),1),Ne[1]||(Ne[1]=Re("span",{class:"text-dark-text text-xs uppercase"},"dBm",-1))]),(zi(),Vi("svg",vQ,[Ne[3]||(Ne[3]=Ff('',1)),Dt.value.length>1?(zi(),Vi("path",{key:0,d:`${Gt.value} L 196 30 L 0 30 Z`,fill:"url(#rf-noise-gradient)",class:"transition-all duration-500 ease-out"},null,8,yQ)):bs("",!0),Dt.value.length>1?(zi(),Vi("path",{key:1,d:Gt.value,stroke:"#B1FFFF","stroke-width":"2",fill:"none",filter:"url(#line-glow)",class:"transition-all duration-500 ease-out"},null,8,xQ)):bs("",!0),Dt.value.length>0?(zi(),Vi("circle",{key:2,cx:196,cy:re.value,r:"2",fill:"#B1FFFF",class:"animate-pulse"},Ne[2]||(Ne[2]=[Re("animate",{attributeName:"r",values:"2;3;2",dur:"2s",repeatCount:"indefinite"},null,-1)]),8,_Q)):bs("",!0)]))]))}}),wQ=ld(bQ,[["__scopeId","data-v-ad12b3cb"]]),kQ={},TQ={width:"800px",height:"800px",viewBox:"0 -1.5 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",class:"w-full h-full"};function AQ(d,l){return zi(),Vi("svg",TQ,l[0]||(l[0]=[Re("g",{id:"Page-1",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[Re("g",{transform:"translate(-420.000000, -3641.000000)",fill:"currentColor"},[Re("g",{id:"icons",transform:"translate(56.000000, 160.000000)"},[Re("path",{d:"M378.195439,3483.828 L376.781439,3485.242 C378.195439,3486.656 378.294439,3489.588 376.880439,3491.002 L378.294439,3492.417 C380.415439,3490.295 380.316439,3485.949 378.195439,3483.828 M381.023439,3481 L379.609439,3482.414 C382.438439,3485.242 382.537439,3491.002 379.708439,3493.831 L381.122439,3495.245 C385.365439,3491.002 384.559439,3484.535 381.023439,3481 M375.432439,3486.737 C375.409439,3486.711 375.392439,3486.682 375.367439,3486.656 L375.363439,3486.66 C374.582439,3485.879 373.243439,3485.952 372.536439,3486.659 C371.829439,3487.366 371.831439,3488.778 372.538439,3489.485 C372.547439,3489.494 372.558439,3489.499 372.567439,3489.508 C372.590439,3489.534 372.607439,3489.563 372.632439,3489.588 L372.636439,3489.585 C373.201439,3490.15 373.000439,3488.284 373.000439,3498 L375.000439,3498 C375.000439,3488.058 374.753439,3490.296 375.463439,3489.586 C376.170439,3488.879 376.168439,3487.467 375.461439,3486.76 C375.452439,3486.751 375.441439,3486.746 375.432439,3486.737 M371.119439,3485.242 L369.705439,3483.828 C367.584439,3485.949 367.683439,3490.295 369.804439,3492.417 L371.218439,3491.002 C369.804439,3489.588 369.705439,3486.656 371.119439,3485.242 M368.390439,3493.831 L366.976439,3495.245 C363.440439,3491.709 362.634439,3485.242 366.877439,3481 L368.291439,3482.414 C365.462439,3485.242 365.561439,3491.002 368.390439,3493.831",id:"radio_tower-[#1019]"})])])],-1)]))}const MQ=ld(kQ,[["render",AQ]]),SQ={class:"text-center"},EQ={class:"relative flex items-center justify-center mb-8"},CQ={class:"relative w-32 h-32"},LQ={class:"absolute left-1/2 top-1/2 transform -translate-x-1/2 -translate-y-1/2"},PQ={key:0,class:"absolute inset-0 flex items-center justify-center"},zQ={key:1,class:"absolute inset-0 flex items-center justify-center"},IQ={key:2,class:"absolute inset-0"},OQ={class:"mb-6"},DQ={key:0,class:"text-white text-lg"},FQ={key:1,class:"text-accent-green text-lg font-medium"},RQ={key:2,class:"text-secondary text-lg"},BQ={key:3,class:"text-accent-red text-lg"},NQ={key:4,class:"text-dark-text"},jQ={key:5,class:"mt-3"},UQ={key:0,class:"text-secondary text-sm"},VQ={key:1,class:"text-accent-red text-sm"},HQ={key:0,class:"flex gap-3"},WQ={key:1,class:"text-dark-text text-sm"},qQ=Th({name:"AdvertModal",__name:"AdvertModal",props:{isOpen:{type:Boolean},isLoading:{type:Boolean},isSuccess:{type:Boolean},error:{default:null}},emits:["close","send"],setup(d,{emit:l}){const z=d,j=l,J=lo(!1),mt=lo(!1),kt=lo(!1);um(()=>z.isOpen,pe=>{pe?(J.value=!0,setTimeout(()=>{mt.value=!0},50)):(mt.value=!1,kt.value=!1,setTimeout(()=>{J.value=!1},300))},{immediate:!0}),um(()=>z.isLoading,pe=>{pe||setTimeout(()=>{kt.value=!1},1e3)});const Dt=()=>{z.isLoading||j("close")},Gt=()=>{z.isLoading||(kt.value=!0,j("send"))},re=pe=>pe?.includes("Network error - no response received")||pe?.includes("timeout");return(pe,Ne)=>(zi(),hm($z,{to:"body"},[J.value?(zi(),Vi("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4",onClick:hg(Dt,["self"])},[Re("div",{class:Xs(["absolute inset-0 bg-black/60 backdrop-blur-sm transition-opacity duration-300",mt.value?"opacity-100":"opacity-0"])},null,2),Re("div",{class:Xs(["relative glass-card rounded-[20px] p-8 max-w-md w-full transform transition-all duration-300",mt.value?"scale-100 opacity-100":"scale-95 opacity-0"])},[pe.isLoading?bs("",!0):(zi(),Vi("button",{key:0,onClick:Dt,class:"absolute top-4 right-4 text-dark-text hover:text-white transition-colors p-2"},Ne[0]||(Ne[0]=[Re("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))),Re("div",SQ,[Ne[6]||(Ne[6]=Re("h2",{class:"text-white text-xl font-semibold mb-6"},"Send Advertisement",-1)),Re("div",EQ,[Re("div",CQ,[Re("div",LQ,[gu(MQ,{class:Xs(["w-16 h-16 transition-all duration-500",[pe.isLoading?"animate-pulse":"",pe.isSuccess?"text-accent-green":pe.error&&!re(pe.error)?"text-accent-red":"text-primary"]]),style:av({filter:pe.isLoading?"drop-shadow(0 0 8px currentColor)":pe.isSuccess?"drop-shadow(0 0 8px #A5E5B6)":pe.error&&!re(pe.error)?"drop-shadow(0 0 8px #FB787B)":"drop-shadow(0 0 4px #AAE8E8)"})},null,8,["class","style"])]),pe.isLoading||pe.isSuccess?(zi(),Vi("div",PQ,[Re("div",{class:Xs(["absolute w-16 h-16 rounded-full border-2 animate-ping",[pe.isSuccess?"border-accent-green/60":"border-primary/60"]]),style:{"animation-duration":"1.5s"}},null,2),Re("div",{class:Xs(["absolute w-24 h-24 rounded-full border-2 animate-ping",[pe.isSuccess?"border-accent-green/40":"border-primary/40"]]),style:{"animation-duration":"2s","animation-delay":"0.3s"}},null,2),Re("div",{class:Xs(["absolute w-32 h-32 rounded-full border-2 animate-ping",[pe.isSuccess?"border-accent-green/20":"border-primary/20"]]),style:{"animation-duration":"2.5s","animation-delay":"0.6s"}},null,2)])):bs("",!0),kt.value?(zi(),Vi("div",zQ,Ne[1]||(Ne[1]=[Re("div",{class:"absolute w-8 h-8 rounded-full border-4 border-secondary animate-ping-fast"},null,-1),Re("div",{class:"absolute w-16 h-16 rounded-full border-3 border-secondary/70 animate-ping-fast",style:{"animation-delay":"0.1s"}},null,-1),Re("div",{class:"absolute w-24 h-24 rounded-full border-2 border-secondary/50 animate-ping-fast",style:{"animation-delay":"0.2s"}},null,-1),Re("div",{class:"absolute w-32 h-32 rounded-full border-2 border-secondary/30 animate-ping-fast",style:{"animation-delay":"0.3s"}},null,-1)]))):bs("",!0),pe.isLoading||pe.isSuccess?(zi(),Vi("div",IQ,[Re("div",{class:Xs(["absolute top-2 right-2 w-4 h-4 rounded-full transition-all duration-500 animate-pulse",[pe.isSuccess?"bg-accent-green shadow-lg shadow-accent-green/50":"bg-primary/70 shadow-lg shadow-primary/30"]]),style:{"animation-delay":"0.5s"}},Ne[2]||(Ne[2]=[Re("div",{class:"w-2 h-2 bg-white rounded-full mx-auto mt-1"},null,-1)]),2),Re("div",{class:Xs(["absolute bottom-2 left-2 w-4 h-4 rounded-full transition-all duration-500 animate-pulse",[pe.isSuccess?"bg-accent-green shadow-lg shadow-accent-green/50":"bg-primary/70 shadow-lg shadow-primary/30"]]),style:{"animation-delay":"1s"}},Ne[3]||(Ne[3]=[Re("div",{class:"w-2 h-2 bg-white rounded-full mx-auto mt-1"},null,-1)]),2),Re("div",{class:Xs(["absolute top-1/2 right-1 w-4 h-4 rounded-full transition-all duration-500 animate-pulse",[pe.isSuccess?"bg-accent-green shadow-lg shadow-accent-green/50":"bg-primary/70 shadow-lg shadow-primary/30"]]),style:{"animation-delay":"1.5s",transform:"translateY(-50%)"}},Ne[4]||(Ne[4]=[Re("div",{class:"w-2 h-2 bg-white rounded-full mx-auto mt-1"},null,-1)]),2),Re("div",{class:Xs(["absolute top-3 left-3 w-4 h-4 rounded-full transition-all duration-500 animate-pulse",[pe.isSuccess?"bg-accent-green shadow-lg shadow-accent-green/50":"bg-primary/70 shadow-lg shadow-primary/30"]]),style:{"animation-delay":"2s"}},Ne[5]||(Ne[5]=[Re("div",{class:"w-2 h-2 bg-white rounded-full mx-auto mt-1"},null,-1)]),2)])):bs("",!0)])]),Re("div",OQ,[pe.isLoading?(zi(),Vi("p",DQ," Broadcasting advertisement... ")):pe.isSuccess?(zi(),Vi("p",FQ," Advertisement sent successfully! ")):pe.error&&re(pe.error)?(zi(),Vi("p",RQ," Advertisement likely sent ")):pe.error?(zi(),Vi("p",BQ," Failed to send advertisement ")):(zi(),Vi("p",NQ," This will broadcast your node's presence to nearby nodes. ")),pe.error?(zi(),Vi("div",jQ,[re(pe.error)?(zi(),Vi("p",UQ," Network timeout occurred, but the advertisement may have been successfully transmitted to nearby nodes. ")):(zi(),Vi("p",VQ,aa(pe.error),1))])):bs("",!0)]),!pe.isLoading&&!pe.isSuccess?(zi(),Vi("div",HQ,[Re("button",{onClick:Dt,class:"flex-1 glass-card border border-dark-border hover:border-primary rounded-[10px] px-6 py-3 text-dark-text hover:text-white transition-all duration-200"}," Cancel "),Re("button",{onClick:Gt,class:Xs(["flex-1 rounded-[10px] px-6 py-3 font-medium transition-all duration-200 shadow-lg",[pe.error&&re(pe.error)?"bg-secondary hover:bg-secondary/90 text-dark-bg hover:shadow-secondary/20":"bg-primary hover:bg-primary/90 text-dark-bg hover:shadow-primary/20"]])},aa(pe.error&&re(pe.error)?"Try Again":"Send Advertisement"),3)])):bs("",!0),pe.isSuccess?(zi(),Vi("div",WQ," Closing automatically... ")):bs("",!0)])],2)])):bs("",!0)]))}}),ZQ=ld(qQ,[["__scopeId","data-v-a5eb8c7f"]]),$Q={},GQ={width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function YQ(d,l){return zi(),Vi("svg",GQ,l[0]||(l[0]=[Ff('',2)]))}const TO=ld($Q,[["render",YQ]]),KQ={},XQ={width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function JQ(d,l){return zi(),Vi("svg",XQ,l[0]||(l[0]=[Ff('',9)]))}const AO=ld(KQ,[["render",JQ]]),QQ={},ttt={width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function ett(d,l){return zi(),Vi("svg",ttt,l[0]||(l[0]=[Ff('',2)]))}const MO=ld(QQ,[["render",ett]]),rtt={},ntt={width:"11",height:"14",viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function itt(d,l){return zi(),Vi("svg",ntt,l[0]||(l[0]=[Re("path",{d:"M9.81633 1.99133L8.5085 0.683492C8.29229 0.466088 8.03511 0.293723 7.75185 0.176372C7.46859 0.059021 7.16486 -0.000985579 6.85825 -0.000175002H1.75C1.28587 -0.000175002 0.840752 0.184199 0.512563 0.512388C0.184375 0.840577 0 1.2857 0 1.74983V13.9998H10.5V3.64099C10.4985 3.02248 10.2528 2.4296 9.81633 1.99133ZM8.9915 2.81616C9.02083 2.84799 9.04829 2.88149 9.07375 2.91649H7.58333V1.42608C7.61834 1.45153 7.65184 1.479 7.68367 1.50833L8.9915 2.81616ZM1.16667 12.8332V1.74983C1.16667 1.59512 1.22812 1.44674 1.33752 1.33735C1.44692 1.22795 1.59529 1.16649 1.75 1.16649H6.41667V4.08316H9.33333V12.8332H1.16667ZM2.33333 9.33316H8.16667V5.83316H2.33333V9.33316ZM3.5 6.99983H7V8.16649H3.5V6.99983ZM2.33333 10.4998H8.16667V11.6665H2.33333V10.4998Z",fill:"white"},null,-1)]))}const SO=ld(rtt,[["render",itt]]),att={},ott={width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function stt(d,l){return zi(),Vi("svg",ott,l[0]||(l[0]=[Ff('',2)]))}const EO=ld(att,[["render",stt]]),ltt={},utt={width:"11",height:"14",viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function ctt(d,l){return zi(),Vi("svg",utt,l[0]||(l[0]=[Re("path",{d:"M10.5 14.0004H9.33333V11.0586C9.33287 10.6013 9.15099 10.1628 8.82761 9.83942C8.50422 9.51603 8.06575 9.33415 7.60842 9.33369H2.89158C2.43425 9.33415 1.99578 9.51603 1.67239 9.83942C1.34901 10.1628 1.16713 10.6013 1.16667 11.0586V14.0004H0V11.0586C0.000926233 10.292 0.305872 9.55705 0.847948 9.01497C1.39002 8.47289 2.12497 8.16795 2.89158 8.16702H7.60842C8.37503 8.16795 9.10998 8.47289 9.65205 9.01497C10.1941 9.55705 10.4991 10.292 10.5 11.0586V14.0004Z",fill:"white"},null,-1),Re("path",{d:"M5.25 6.99997C4.55777 6.99997 3.88108 6.7947 3.30551 6.41011C2.72993 6.02553 2.28133 5.4789 2.01642 4.83936C1.75152 4.19982 1.6822 3.49609 1.81725 2.81716C1.9523 2.13822 2.28564 1.51458 2.77513 1.0251C3.26461 0.535614 3.88825 0.202271 4.56719 0.0672226C5.24612 -0.0678257 5.94985 0.00148598 6.58939 0.266393C7.22894 0.531299 7.77556 0.979903 8.16015 1.55548C8.54473 2.13105 8.75 2.80774 8.75 3.49997C8.74908 4.42794 8.38003 5.31765 7.72385 5.97382C7.06768 6.63 6.17798 6.99904 5.25 6.99997ZM5.25 1.16664C4.78851 1.16664 4.33739 1.30349 3.95367 1.55988C3.56996 1.81627 3.27089 2.18068 3.09428 2.60704C2.91768 3.0334 2.87147 3.50256 2.9615 3.95518C3.05153 4.4078 3.27376 4.82357 3.60009 5.14989C3.92641 5.47621 4.34217 5.69844 4.79479 5.78847C5.24741 5.8785 5.71657 5.83229 6.14293 5.65569C6.56929 5.47909 6.93371 5.18002 7.1901 4.7963C7.44649 4.41259 7.58334 3.96146 7.58334 3.49997C7.58334 2.88113 7.3375 2.28764 6.89992 1.85006C6.46233 1.41247 5.86884 1.16664 5.25 1.16664Z",fill:"white"},null,-1)]))}const CO=ld(ltt,[["render",ctt]]),htt={},ftt={width:"11",height:"13",viewBox:"0 0 11 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function dtt(d,l){return zi(),Vi("svg",ftt,l[0]||(l[0]=[Re("path",{d:"M6.77889 9.16667H10.1122V12.5M4.11222 3.83333H0.77889V0.5M10.3906 4.50227C10.0168 3.57711 9.39097 2.77536 8.58423 2.18815C7.77749 1.60094 6.82233 1.25168 5.82707 1.18034C4.8318 1.109 3.83627 1.31827 2.95402 1.78441C2.07177 2.25055 1.3381 2.95503 0.836182 3.81742M0.500244 8.49805C0.874034 9.42321 1.49986 10.225 2.30661 10.8122C3.11335 11.3994 4.06948 11.7482 5.06474 11.8195C6.06001 11.8909 7.05473 11.6816 7.93697 11.2155C8.81922 10.7494 9.55239 10.045 10.0543 9.18262",stroke:"white","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]))}const ptt=ld(htt,[["render",dtt]]),mtt={},gtt={width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function vtt(d,l){return zi(),Vi("svg",gtt,l[0]||(l[0]=[Ff('',2)]))}const ytt=ld(mtt,[["render",vtt]]),xtt={class:"w-[285px] flex-shrink-0 p-[15px] hidden lg:block"},_tt={class:"glass-card h-full p-6"},btt={class:"mb-12"},wtt={class:"text-[#C3C3C3] text-sm"},ktt=["title"],Ttt={class:"text-[#C3C3C3] text-sm mt-1"},Att={class:"mb-8"},Mtt={class:"mb-8"},Stt={class:"space-y-2"},Ett=["onClick"],Ctt={class:"mb-8"},Ltt={class:"space-y-2"},Ptt=["onClick"],ztt=["disabled"],Itt={class:"flex items-center gap-3"},Ott=["disabled"],Dtt={class:"flex items-center gap-3"},Ftt={class:"mb-4"},Rtt={class:"flex items-center gap-2"},Btt={class:"glass-card px-2 py-1 text-dark-text text-xs font-medium rounded border border-dark-border"},Ntt={class:"glass-card px-2 py-1 text-dark-text text-xs font-medium rounded border border-dark-border"},jtt={key:0,class:"mb-4"},Utt={class:"text-dark-text text-xs mb-2"},Vtt={class:"text-white"},Htt={class:"w-full h-1 bg-white/10 rounded-full overflow-hidden"},Wtt={class:"flex items-center justify-between"},qtt={class:"flex items-center gap-2 text-dark-text text-xs"},Ztt={class:"flex items-center gap-2"},$tt={href:"https://github.com/rightup",target:"_blank",class:"inline-block"},Gtt={href:"https://buymeacoffee.com/rightup",target:"_blank",class:"inline-block"},Ytt=Th({name:"SidebarNav",__name:"Sidebar",setup(d){const l=JI(),z=QI(),j=sv(),J=lo(!1),mt=lo(!1),kt=lo(!1),Dt=lo(!1),Gt=lo(!1),re=lo(null);let pe=null;t0(async()=>{pe=await j.startAutoRefresh(5e3)}),K2(()=>{pe&&pe()});const Ne={dashboard:AO,neighbors:CO,statistics:EO,configuration:TO,logs:SO,help:MO},or=[{name:"Dashboard",icon:"dashboard",route:"/"},{name:"Neighbors",icon:"neighbors",route:"/neighbors"},{name:"Statistics",icon:"statistics",route:"/statistics"},{name:"Configuration",icon:"configuration",route:"/configuration"},{name:"Logs",icon:"logs",route:"/logs"},{name:"Help",icon:"help",route:"/help"}],_r=Yo(()=>jn=>z.path===jn),Fr=jn=>{l.push(jn)},zr=async()=>{J.value=!0,re.value=null;try{await j.sendAdvert(),Gt.value=!0,setTimeout(()=>{Wr()},2e3)}catch(jn){re.value=jn instanceof Error?jn.message:"Unknown error occurred",console.error("Failed to send advert:",jn)}finally{J.value=!1}},Wr=()=>{Dt.value=!1,Gt.value=!1,re.value=null,J.value=!1},An=async()=>{if(!mt.value){mt.value=!0;try{await j.toggleMode()}catch(jn){console.error("Failed to toggle mode:",jn)}finally{mt.value=!1}}},Ft=async()=>{if(!kt.value){kt.value=!0;try{await j.toggleDutyCycle()}catch(jn){console.error("Failed to toggle duty cycle:",jn)}finally{kt.value=!1}}},kn=lo(new Date().toLocaleTimeString());setInterval(()=>{kn.value=new Date().toLocaleTimeString()},1e3);const ei=Yo(()=>{const jn=j.dutyCyclePercentage;let ai="#A5E5B6";return jn>90?ai="#FB787B":jn>70&&(ai="#FFC246"),{width:jn===0?"2px":`${Math.max(jn,2)}%`,backgroundColor:ai}});return(jn,ai)=>(zi(),Vi(Ou,null,[Re("aside",xtt,[Re("div",_tt,[Re("div",btt,[ai[1]||(ai[1]=Re("h1",{class:"text-white text-[22px] font-bold mb-2"},"pyMC Repeater",-1)),Re("p",wtt,[nc(aa(Ju(j).nodeName)+" ",1),Re("span",{class:Xs(["inline-block w-2 h-2 rounded-full ml-2",Ju(j).statusBadge.text==="Active"?"bg-accent-green":Ju(j).statusBadge.text==="Monitor Mode"?"bg-secondary":"bg-accent-red"]),title:Ju(j).statusBadge.title},null,10,ktt)]),Re("p",Ttt,"<"+aa(Ju(j).pubKey)+">",1)]),ai[10]||(ai[10]=Re("div",{class:"border-t border-dark-border mb-6"},null,-1)),Re("div",Att,[ai[3]||(ai[3]=Re("p",{class:"text-dark-text text-xs uppercase mb-4"},"Actions",-1)),Re("button",{onClick:ai[0]||(ai[0]=Qi=>Dt.value=!0),class:"w-full bg-white rounded-[10px] py-3 px-4 flex items-center gap-2 text-sm font-medium text-[#212122] hover:bg-gray-100 transition-colors"},ai[2]||(ai[2]=[Re("svg",{class:"w-3.5 h-3.5",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[Re("path",{d:"M7 0C5.61553 0 4.26216 0.410543 3.11101 1.17971C1.95987 1.94888 1.06266 3.04213 0.532846 4.32122C0.003033 5.6003 -0.13559 7.00777 0.134506 8.36563C0.404603 9.7235 1.07129 10.9708 2.05026 11.9497C3.02922 12.9287 4.2765 13.5954 5.63437 13.8655C6.99224 14.1356 8.3997 13.997 9.67879 13.4672C10.9579 12.9373 12.0511 12.0401 12.8203 10.889C13.5895 9.73785 14 8.38447 14 7C13.998 5.1441 13.2599 3.36479 11.9475 2.05247C10.6352 0.74015 8.8559 0.0020073 7 0V0ZM7 12.8333C5.84628 12.8333 4.71846 12.4912 3.75918 11.8502C2.79989 11.2093 2.05222 10.2982 1.61071 9.23232C1.16919 8.16642 1.05368 6.99353 1.27876 5.86197C1.50384 4.73042 2.05941 3.69102 2.87521 2.87521C3.69102 2.0594 4.73042 1.50383 5.86198 1.27875C6.99353 1.05367 8.16642 1.16919 9.23232 1.6107C10.2982 2.05221 11.2093 2.79989 11.8502 3.75917C12.4912 4.71846 12.8333 5.84628 12.8333 7C12.8316 8.54658 12.2165 10.0293 11.1229 11.1229C10.0293 12.2165 8.54658 12.8316 7 12.8333ZM8.16667 7C8.1676 7.20501 8.11448 7.40665 8.01268 7.58461C7.91087 7.76256 7.76397 7.91054 7.58677 8.01365C7.40957 8.11676 7.20833 8.17136 7.00332 8.17194C6.7983 8.17252 6.59675 8.11906 6.41897 8.01696C6.24119 7.91485 6.09346 7.7677 5.99065 7.59033C5.88784 7.41295 5.83358 7.21162 5.83335 7.0066C5.83312 6.80159 5.88691 6.60013 5.98932 6.42252C6.09172 6.24491 6.23912 6.09743 6.41667 5.99492V3.5H7.58334V5.99492C7.76016 6.09659 7.90713 6.24298 8.00952 6.41939C8.1119 6.5958 8.1661 6.79603 8.16667 7Z",fill:"#212122"})],-1),nc(" Send Advert ",-1)]))]),Re("div",Mtt,[ai[4]||(ai[4]=Re("p",{class:"text-dark-text text-xs uppercase mb-4"},"Monitoring",-1)),Re("div",Stt,[(zi(!0),Vi(Ou,null,sf(or.slice(0,3),Qi=>(zi(),Vi("button",{key:Qi.name,onClick:Gi=>Fr(Qi.route),class:Xs([_r.value(Qi.route)?"bg-primary/20 shadow-[0_0_6px_0_rgba(170,232,232,0.20)] text-primary":"text-white hover:bg-white/5","w-full rounded-[10px] py-3 px-4 flex items-center gap-3 text-sm transition-all"])},[(zi(),hm(a4(Ne[Qi.icon]),{class:"w-3.5 h-3.5"})),nc(" "+aa(Qi.name),1)],10,Ett))),128))])]),Re("div",Ctt,[ai[5]||(ai[5]=Re("p",{class:"text-dark-text text-xs uppercase mb-4"},"System",-1)),Re("div",Ltt,[(zi(!0),Vi(Ou,null,sf(or.slice(3),Qi=>(zi(),Vi("button",{key:Qi.name,onClick:Gi=>Fr(Qi.route),class:Xs([_r.value(Qi.route)?"bg-primary/20 shadow-[0_0_6px_0_rgba(170,232,232,0.20)] text-primary":"text-white hover:bg-white/5","w-full rounded-[10px] py-3 px-4 flex items-center gap-3 text-sm transition-all"])},[(zi(),hm(a4(Ne[Qi.icon]),{class:"w-3.5 h-3.5"})),nc(" "+aa(Qi.name),1)],10,Ptt))),128))])]),gu(wQ,{"current-value":Ju(j).noiseFloorDbm||-116,"update-interval":3e3,class:"mb-6"},null,8,["current-value"]),Re("button",{onClick:An,disabled:mt.value,class:Xs(["p-4 flex items-center justify-between mb-4 w-full transition-all duration-200 cursor-pointer group",Ju(j).modeButtonState.warning?"glass-card-orange hover:bg-accent-red/10":"glass-card-green hover:bg-accent-green/10"])},[Re("div",Itt,[gu(ptt,{class:"w-4 h-4 text-white group-hover:text-primary transition-colors"}),ai[6]||(ai[6]=Re("span",{class:"text-white text-sm group-hover:text-primary transition-colors"},"Mode",-1))]),Re("span",{class:Xs(["text-xs font-medium group-hover:text-white transition-colors",Ju(j).modeButtonState.warning?"text-accent-red":"text-accent-green"])},aa(mt.value?"Changing...":Ju(j).currentMode.charAt(0).toUpperCase()+Ju(j).currentMode.slice(1)),3)],10,ztt),Re("button",{onClick:Ft,disabled:kt.value,class:Xs(["p-4 flex items-center justify-between mb-4 w-full transition-all duration-200 cursor-pointer group",Ju(j).dutyCycleButtonState.warning?"glass-card-orange hover:bg-accent-red/10":"glass-card-green hover:bg-accent-green/10"])},[Re("div",Dtt,[gu(ytt,{class:"w-3.5 h-3.5 text-white group-hover:text-primary transition-colors"}),ai[7]||(ai[7]=Re("span",{class:"text-white text-sm group-hover:text-primary transition-colors"},"Duty Cycle",-1))]),Re("span",{class:Xs(["text-xs font-medium group-hover:text-white transition-colors",Ju(j).dutyCycleButtonState.warning?"text-accent-red":"text-primary"])},aa(kt.value?"Changing...":Ju(j).dutyCycleEnabled?"Enabled":"Disabled"),3)],10,Ott),Re("div",Ftt,[Re("div",Rtt,[Re("span",Btt," R:v"+aa(Ju(j).version),1),Re("span",Ntt," C:v"+aa(Ju(j).coreVersion),1)])]),ai[11]||(ai[11]=Re("div",{class:"border-t border-accent-green mb-4"},null,-1)),Ju(j).dutyCycleEnabled?(zi(),Vi("div",jtt,[Re("p",Utt,[ai[8]||(ai[8]=nc(" Duty Cycle: ",-1)),Re("span",Vtt,aa(Ju(j).dutyCycleUtilization.toFixed(1))+"% / "+aa(Ju(j).dutyCycleMax.toFixed(1))+"%",1)]),Re("div",Htt,[Re("div",{class:"h-full rounded-full transition-all duration-300",style:av(ei.value)},null,4)])])):bs("",!0),Re("div",Wtt,[Re("div",qtt,[ai[9]||(ai[9]=Re("svg",{class:"w-3 h-3",viewBox:"0 0 13 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[Re("path",{d:"M6.5 13C5.59722 13 4.75174 12.8286 3.96355 12.4858C3.17537 12.143 2.48926 11.6795 1.90522 11.0955C1.32119 10.5115 0.85776 9.82535 0.514945 9.03717C0.172131 8.24898 0.000482491 7.40326 1.0101e-06 6.5C-0.000480471 5.59674 0.171168 4.75126 0.514945 3.96356C0.858723 3.17585 1.32191 2.48974 1.9045 1.90522C2.48709 1.3207 3.1732 0.857278 3.96283 0.514944C4.75246 0.172611 5.59818 0.000962963 6.5 0C7.48703 0 8.42303 0.210648 9.30799 0.631944C10.193 1.05324 10.9421 1.64907 11.5555 2.41944V1.44444C11.5555 1.23981 11.6249 1.06841 11.7635 0.930222C11.9022 0.792037 12.0736 0.722704 12.2778 0.722222C12.4819 0.721741 12.6536 0.791074 12.7927 0.930222C12.9319 1.06937 13.001 1.24078 13 1.44444V4.33333C13 4.53796 12.9307 4.70961 12.792 4.84828C12.6533 4.98694 12.4819 5.05604 12.2778 5.05556H9.38888C9.18425 5.05556 9.01285 4.98622 8.87466 4.84756C8.73647 4.70889 8.66714 4.53748 8.66666 4.33333C8.66618 4.12919 8.73551 3.95778 8.87466 3.81911C9.01381 3.68044 9.18521 3.61111 9.38888 3.61111H10.6528C10.1593 2.93704 9.55138 2.40741 8.82916 2.02222C8.10694 1.63704 7.33055 1.44444 6.5 1.44444C5.09166 1.44444 3.89711 1.93507 2.91633 2.91633C1.93555 3.89759 1.44493 5.09215 1.44444 6.5C1.44396 7.90785 1.93459 9.10265 2.91633 10.0844C3.89807 11.0661 5.09263 11.5565 6.5 11.5556C7.64351 11.5556 8.66666 11.2125 9.56944 10.5264C10.4722 9.84028 11.068 8.95555 11.3569 7.87222C11.4171 7.67963 11.5255 7.53519 11.6819 7.43889C11.8384 7.34259 12.013 7.30648 12.2055 7.33055C12.4102 7.35463 12.5727 7.44178 12.693 7.592C12.8134 7.74222 12.8495 7.90785 12.8014 8.08889C12.4523 9.5213 11.694 10.698 10.5264 11.6191C9.35879 12.5402 8.01666 13.0005 6.5 13ZM7.22222 6.21111L9.02777 8.01667C9.16018 8.14907 9.22638 8.31759 9.22638 8.52222C9.22638 8.72685 9.16018 8.89537 9.02777 9.02778C8.89536 9.16018 8.72685 9.22639 8.52222 9.22639C8.31759 9.22639 8.14907 9.16018 8.01666 9.02778L5.99444 7.00556C5.92222 6.93333 5.86805 6.8522 5.83194 6.76217C5.79583 6.67213 5.77777 6.57872 5.77777 6.48194V3.61111C5.77777 3.40648 5.84711 3.23507 5.98577 3.09689C6.12444 2.9587 6.29585 2.88937 6.5 2.88889C6.70414 2.88841 6.87579 2.95774 7.01494 3.09689C7.15409 3.23604 7.22318 3.40744 7.22222 3.61111V6.21111Z",fill:"currentColor"})],-1)),nc(" Last Updated: "+aa(kn.value),1)]),Re("div",Ztt,[Re("a",$tt,[gu(lQ,{class:"w-4 h-4 text-dark-text hover:text-white transition-colors"})]),Re("a",Gtt,[gu(fQ,{class:"w-4 h-4 text-dark-text hover:text-white transition-colors"})])])])])]),gu(ZQ,{isOpen:Dt.value,isLoading:J.value,isSuccess:Gt.value,error:re.value,onClose:Wr,onSend:zr},null,8,["isOpen","isLoading","isSuccess","error"])],64))}}),Ktt={key:0,class:"fixed inset-0 z-40 lg:hidden"},Xtt={class:"absolute left-0 top-0 bottom-0 w-72 p-4"},Jtt={class:"glass-card h-full p-6 overflow-auto"},Qtt={class:"mb-4"},tet={class:"space-y-2 mb-3"},eet=["onClick"],ret={class:"mb-4"},net={class:"space-y-2 mb-3"},iet=["onClick"],aet=Th({name:"MobileSidebar",__name:"MobileSidebar",props:{showMobileSidebar:{type:Boolean}},emits:["update:showMobileSidebar"],setup(d,{emit:l}){const z=l,j=JI(),J=QI(),mt={dashboard:AO,neighbors:CO,statistics:EO,configuration:TO,logs:SO,help:MO},kt=[{name:"Dashboard",icon:"dashboard",route:"/"},{name:"Neighbors",icon:"neighbors",route:"/neighbors"},{name:"Statistics",icon:"statistics",route:"/statistics"},{name:"Configuration",icon:"configuration",route:"/configuration"},{name:"Logs",icon:"logs",route:"/logs"},{name:"Help",icon:"help",route:"/help"}],Dt=pe=>J.path===pe,Gt=pe=>{j.push(pe),re()},re=()=>{z("update:showMobileSidebar",!1)};return(pe,Ne)=>pe.showMobileSidebar?(zi(),Vi("div",Ktt,[Re("div",{class:"absolute inset-0 bg-black/50",onClick:re}),Re("div",Xtt,[Re("div",Jtt,[Re("div",{class:"mb-6 flex items-center justify-between"},[Ne[0]||(Ne[0]=Re("div",null,[Re("h1",{class:"text-white text-[20px] font-bold"},"pyMC Repeater"),Re("p",{class:"text-[#C3C3C3] text-sm"},[nc("phenix-rep56 "),Re("span",{class:"inline-block w-2 h-2 rounded-full bg-[#95F3AE] ml-2"})])],-1)),Re("button",{onClick:re,class:"text-dark-text"},"✕")]),Ne[5]||(Ne[5]=Re("div",{class:"border-t border-dark-border mb-4"},null,-1)),Re("div",null,[Ne[3]||(Ne[3]=Ff('

pyMC Repeater

phenix-rep56

<94eib04...4563ghbjbjn>

Actions

',3)),Re("div",Qtt,[Ne[1]||(Ne[1]=Re("p",{class:"text-dark-text text-xs uppercase mb-2"},"Monitoring",-1)),Re("div",tet,[(zi(!0),Vi(Ou,null,sf(kt.slice(0,3),or=>(zi(),Vi("button",{key:or.name,onClick:_r=>Gt(or.route),class:Xs([Dt(or.route)?"bg-primary/20 shadow-[0_0_6px_0_rgba(170,232,232,0.20)] text-primary":"text-white hover:bg-white/5","w-full rounded-[10px] py-3 px-4 flex items-center gap-3 text-sm transition-all"])},[(zi(),hm(a4(mt[or.icon]),{class:"w-3.5 h-3.5"})),nc(" "+aa(or.name),1)],10,eet))),128))])]),Re("div",ret,[Ne[2]||(Ne[2]=Re("p",{class:"text-dark-text text-xs uppercase mb-2"},"System",-1)),Re("div",net,[(zi(!0),Vi(Ou,null,sf(kt.slice(3),or=>(zi(),Vi("button",{key:or.name,onClick:_r=>Gt(or.route),class:Xs([Dt(or.route)?"bg-primary/20 shadow-[0_0_6px_0_rgba(170,232,232,0.20)] text-primary":"text-white hover:bg-white/5","w-full rounded-[10px] py-3 px-4 flex items-center gap-3 text-sm transition-all"])},[(zi(),hm(a4(mt[or.icon]),{class:"w-3.5 h-3.5"})),nc(" "+aa(or.name),1)],10,iet))),128))])]),Ne[4]||(Ne[4]=Ff('

RF NOISE FLOOR

-116.0dbm
Mode
Forward
Duty Cycle
Enabled
ActiveVl.0.2

Duty Cycle: 0.0% / 6.0%

Last Updated: 18:55:24

',7))])])])])):bs("",!0)}}),oet={class:"glass-card p-6 mb-5 rounded-[20px] relative z-10"},set={class:"flex flex-col lg:flex-row lg:items-center lg:justify-between gap-4"},uet={class:"flex items-center gap-3"},cet={class:"text-right mr-4"},het={key:0,class:"flex items-center gap-2"},fet={key:1,class:"space-y-1"},det={class:"text-dark-text text-sm"},pet={class:"text-primary font-medium"},met={key:0,class:"text-xs text-dark-text/80"},get={key:0},vet={key:1,class:"text-xs text-dark-text/60"},yet={key:2},xet={key:0,class:"text-xs text-dark-text/60"},_et=["disabled"],bet={class:"flex items-center justify-between mb-3"},wet={class:"flex items-center gap-2"},ket=["disabled"],Tet=["disabled"],Aet={class:"space-y-3 text-sm"},Met={key:0,class:"bg-[#0B1014] p-3 rounded-lg border border-accent-red/30 border-l-2 border-l-accent-red"},Eet={class:"flex items-center justify-between"},Cet={class:"text-accent-red font-bold"},Let={class:"text-xs text-gray-400 mt-1"},Pet={key:1,class:"bg-[#0B1014] p-3 rounded-lg border border-white/10 border-l-2 border-l-accent-green"},zet={class:"flex items-center justify-between"},Iet={class:"text-accent-green font-bold"},Oet={key:0,class:"text-xs text-gray-400 mt-1"},Det={key:2,class:"bg-[#0B1014] p-3 rounded-lg border border-white/10"},Fet={key:3,class:"bg-[#0B1014] p-3 rounded-lg border border-accent-red/30 border-l-2 border-l-accent-red"},Ret={class:"text-xs text-gray-400"},Bet={class:"bg-[#0B1014] p-3 rounded-lg border border-white/10 border-l-2 border-l-primary"},Net={class:"flex items-center justify-between"},jet={class:"text-primary font-bold"},Uet={key:0,class:"text-xs text-gray-400 mt-1"},Vet={class:"flex items-center justify-between"},Het={class:"text-white font-medium"},Wet={key:0,class:"mt-2"},qet={class:"text-xs text-gray-400"},Zet={class:"text-gray-300"},$et={key:4,class:"bg-[#0B1014] p-4 rounded-lg border border-white/10 text-center"},Get={key:5,class:"bg-[#0B1014] p-3 rounded-lg border border-white/10 text-center"},Yet=Th({name:"TopBar",__name:"TopBar",emits:["toggleMobileSidebar"],setup(d,{emit:l}){const z=l,j=sv(),J=lo(!1),mt=lo(null),kt=lo({hasUpdate:!1,currentVersion:"",latestVersion:"",isChecking:!1,lastChecked:null,error:null}),Dt=lo({}),Gt=lo(!0),re=lo(null),pe=["Chat Node","Repeater","Room Server"];function Ne(Gi){const un=Gi.target;mt.value&&!mt.value.contains(un)&&(J.value=!1)}const or=async()=>{try{Gt.value=!0;const Gi={};for(const un of pe)try{const ia=await Xh.get(`/adverts_by_contact_type?contact_type=${encodeURIComponent(un)}&hours=168`);ia.success&&Array.isArray(ia.data)?Gi[un]=ia.data:Gi[un]=[]}catch(ia){console.error(`Error fetching ${un} nodes:`,ia),Gi[un]=[]}Dt.value=Gi,re.value=new Date}catch(Gi){console.error("Error updating tracked nodes:",Gi)}finally{Gt.value=!1}},_r=async()=>{if(!kt.value.isChecking)try{kt.value.isChecking=!0,kt.value.error=null,await j.fetchStats();const Gi=j.version;if(!Gi||Gi==="Unknown"){kt.value.error="Unable to determine current version";return}const ia=await fetch("https://raw.githubusercontent.com/rightup/pyMC_Repeater/main/repeater/__init__.py");if(!ia.ok)throw new Error(`GitHub request failed: ${ia.status}`);const Li=(await ia.text()).match(/__version__\s*=\s*["']([^"']+)["']/);if(!Li)throw new Error("Could not parse version from GitHub file");const yi=Li[1];kt.value.currentVersion=Gi,kt.value.latestVersion=yi,kt.value.lastChecked=new Date,kt.value.hasUpdate=Gi!==yi}catch(Gi){console.error("Error checking for updates:",Gi),kt.value.error=Gi instanceof Error?Gi.message:"Failed to check for updates"}finally{kt.value.isChecking=!1}},Fr=Yo(()=>Object.values(Dt.value).reduce((un,ia)=>un+ia.length,0)),zr=Yo(()=>pe.map(un=>({type:un,count:Dt.value[un]?.length||0})).filter(un=>un.count>0)),Wr=Yo(()=>kt.value.hasUpdate||Fr.value>0),An=Gi=>({"Chat Node":"text-blue-400",Repeater:"text-accent-green","Room Server":"text-accent-purple"})[Gi]||"text-gray-400",Ft=Gi=>{const un=Dt.value[Gi]||[];return un.length===0?"None":un.reduce((fa,Li)=>Li.last_seen>fa.last_seen?Li:fa,un[0]).node_name||"Unknown Node"};let kn=null,ei=null;const jn=()=>{kn&&clearInterval(kn),kn=setInterval(()=>{or()},3e4),ei&&clearInterval(ei),ei=setInterval(()=>{_r()},6e5)},ai=()=>{kn&&(clearInterval(kn),kn=null),ei&&(clearInterval(ei),ei=null)};t0(()=>{document.addEventListener("click",Ne),or(),_r(),jn()}),dg(()=>{document.removeEventListener("click",Ne),ai()});const Qi=()=>{z("toggleMobileSidebar")};return(Gi,un)=>(zi(),Vi("div",oet,[Re("div",set,[Re("div",{class:"flex items-center gap-3"},[Re("button",{onClick:Qi,class:"lg:hidden w-10 h-10 rounded bg-[#1A1E1F] flex items-center justify-center hover:bg-[#2A2E2F] transition-colors"},un[2]||(un[2]=[Re("svg",{class:"w-5 h-5 text-white",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[Re("path",{d:"M3 6h14M3 10h14M3 14h14",stroke:"white","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])),un[3]||(un[3]=Re("div",null,[Re("h1",{class:"text-white text-[35px] font-bold mb-2"},"Welcome👋")],-1))]),Re("div",uet,[Re("div",cet,[Gt.value?(zi(),Vi("div",het,un[4]||(un[4]=[Re("div",{class:"animate-spin rounded-full h-3 w-3 border-b-2 border-primary"},null,-1),Re("p",{class:"text-dark-text text-sm"},"Loading tracking data...",-1)]))):Fr.value>0?(zi(),Vi("div",fet,[Re("p",det,[un[5]||(un[5]=nc(" Tracking: ",-1)),Re("span",pet,aa(Fr.value)+" node"+aa(Fr.value===1?"":"s"),1)]),zr.value.length>1?(zi(),Vi("div",met,[(zi(!0),Vi(Ou,null,sf(zr.value,(ia,fa)=>(zi(),Vi("span",{key:ia.type,class:"inline"},[nc(aa(ia.count)+" "+aa(ia.type)+aa(ia.count===1?"":"s"),1),faJ.value=!J.value,["stop"])),class:"w-[35px] h-[35px] rounded bg-[#1A1E1F] flex items-center justify-center hover:bg-[#2A2E2F] transition-colors relative"},[un[8]||(un[8]=Re("svg",{class:"w-5 h-5",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[Re("path",{d:"M12.5 14.1667V15C12.5 16.3807 11.3807 17.5 9.99998 17.5C8.61927 17.5 7.49998 16.3807 7.49998 15V14.1667M12.5 14.1667L7.49998 14.1667M12.5 14.1667H15.8333C16.2936 14.1667 16.6666 13.7936 16.6666 13.3333V12.845C16.6666 12.624 16.5788 12.4122 16.4225 12.2559L15.9969 11.8302C15.8921 11.7255 15.8333 11.5833 15.8333 11.4351V8.33333C15.8333 8.1863 15.828 8.04045 15.817 7.89674M7.49998 14.1667L4.16665 14.1668C3.70641 14.1668 3.33331 13.7934 3.33331 13.3332V12.8451C3.33331 12.6241 3.42118 12.4124 3.57745 12.2561L4.00307 11.8299C4.10781 11.7251 4.16665 11.5835 4.16665 11.4353V8.33331C4.16665 5.11167 6.77831 2.5 9.99998 2.5C10.593 2.5 11.1653 2.58848 11.7045 2.75297M15.817 7.89674C16.8223 7.32275 17.5 6.24051 17.5 5C17.5 3.15905 16.0076 1.66666 14.1666 1.66666C13.1914 1.66666 12.3141 2.08544 11.7045 2.75297M15.817 7.89674C15.3304 8.17457 14.7671 8.33333 14.1666 8.33333C12.3257 8.33333 10.8333 6.84095 10.8333 5C10.8333 4.13425 11.1634 3.34558 11.7045 2.75297M15.817 7.89674C15.817 7.89674 15.817 7.89675 15.817 7.89674ZM11.7045 2.75297C11.7049 2.75309 11.7053 2.75321 11.7057 2.75333",stroke:"white","stroke-linecap":"round","stroke-linejoin":"round"})],-1)),Wr.value?(zi(),Vi("span",{key:0,class:Xs(["absolute top-2 right-2 w-2 h-2 rounded-full",kt.value.hasUpdate?"bg-accent-red animate-pulse":"bg-primary"])},null,2)):bs("",!0)]),J.value?(zi(),Vi("div",{key:0,ref_key:"notifRef",ref:mt,class:"absolute right-6 top-14 z-[100] w-80 bg-[#1A1E1F] border border-white/20 rounded-[15px] p-4 shadow-2xl backdrop-blur-sm",onClick:un[1]||(un[1]=hg(()=>{},["stop"]))},[Re("div",bet,[un[10]||(un[10]=Re("p",{class:"text-white font-semibold"},"System Status",-1)),Re("div",wet,[Re("button",{onClick:_r,disabled:kt.value.isChecking,class:"text-xs text-primary hover:text-primary/80 disabled:opacity-50",title:"Check for updates"},aa(kt.value.isChecking?"Checking...":"Check Updates"),9,ket),un[9]||(un[9]=Re("span",{class:"text-dark-text text-xs"},"•",-1)),Re("button",{onClick:or,disabled:Gt.value,class:"text-xs text-primary hover:text-primary/80 disabled:opacity-50"},aa(Gt.value?"Updating...":"Refresh"),9,Tet)])]),Re("div",Aet,[kt.value.hasUpdate?(zi(),Vi("div",Met,[Re("div",Eet,[un[11]||(un[11]=Re("span",{class:"text-white font-medium"},"Update Available",-1)),Re("span",Cet,aa(kt.value.latestVersion),1)]),Re("div",Let," Current: "+aa(kt.value.currentVersion),1),un[12]||(un[12]=Re("div",{class:"text-xs text-gray-300 mt-2"},[Re("a",{href:"https://github.com/rightup/pyMC_Repeater",target:"_blank",class:"text-accent-red hover:text-accent-red/80 underline"}," Goto Github→ ")],-1))])):kt.value.currentVersion&&!kt.value.isChecking?(zi(),Vi("div",Pet,[Re("div",zet,[un[13]||(un[13]=Re("span",{class:"text-white font-medium"},"Up to Date",-1)),Re("span",Iet,aa(kt.value.currentVersion),1)]),kt.value.lastChecked?(zi(),Vi("div",Oet," Last checked: "+aa(kt.value.lastChecked.toLocaleTimeString()),1)):bs("",!0)])):kt.value.isChecking?(zi(),Vi("div",Det,un[14]||(un[14]=[Re("div",{class:"flex items-center justify-center gap-2"},[Re("div",{class:"animate-spin rounded-full h-4 w-4 border-b-2 border-primary"}),Re("span",{class:"text-gray-300"},"Checking for updates...")],-1)]))):kt.value.error?(zi(),Vi("div",Fet,[un[15]||(un[15]=Re("div",{class:"text-white font-medium mb-1"},"Update Check Failed",-1)),Re("div",Ret,aa(kt.value.error),1)])):bs("",!0),un[20]||(un[20]=Re("div",{class:"border-t border-white/10"},null,-1)),un[21]||(un[21]=Re("div",{class:"text-white font-medium text-sm mb-2"},"Mesh Network Status",-1)),Re("div",Bet,[Re("div",Net,[un[16]||(un[16]=Re("span",{class:"text-white font-medium"},"Total Tracked Nodes",-1)),Re("span",jet,aa(Fr.value),1)]),re.value?(zi(),Vi("div",Uet," Last updated: "+aa(re.value.toLocaleString()),1)):bs("",!0)]),(zi(!0),Vi(Ou,null,sf(zr.value,ia=>(zi(),Vi("div",{key:ia.type,class:"bg-[#0B1014] p-3 rounded-lg border border-white/10"},[Re("div",Vet,[Re("span",Het,aa(ia.type)+aa(ia.count===1?"":"s"),1),Re("span",{class:Xs([An(ia.type),"font-bold"])},aa(ia.count),3)]),Dt.value[ia.type]?.length>0?(zi(),Vi("div",Wet,[Re("div",qet,[un[17]||(un[17]=nc(" Latest: ",-1)),Re("span",Zet,aa(Ft(ia.type)),1)])])):bs("",!0)]))),128)),Fr.value===0&&!Gt.value?(zi(),Vi("div",$et,un[18]||(un[18]=[Re("div",{class:"text-gray-400"},[Re("svg",{class:"w-8 h-8 mx-auto mb-2 opacity-50",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9.172 16.172a4 4 0 015.656 0M9 12h6m-6-4h6m2 5.291A7.962 7.962 0 0112 15c-2.034 0-3.9.785-5.291 2.09M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]),Re("span",null,"No mesh nodes detected")],-1)]))):bs("",!0),Gt.value?(zi(),Vi("div",Get,un[19]||(un[19]=[Re("div",{class:"flex items-center justify-center gap-2"},[Re("div",{class:"animate-spin rounded-full h-4 w-4 border-b-2 border-primary"}),Re("span",{class:"text-gray-300"},"Scanning mesh network...")],-1)]))):bs("",!0)])],512)):bs("",!0)])])]))}}),Ket=ld(Yet,[["__scopeId","data-v-0a06f286"]]),Xet={class:"min-h-screen bg-dark-bg overflow-hidden relative font-sans"},Jet={class:"relative flex min-h-screen"},Qet={class:"flex-1 p-4 lg:p-[15px] overflow-y-auto"},trt=Th({name:"DashboardLayout",__name:"DashboardLayout",setup(d){const l=lo(!1),z=()=>{l.value=!l.value},j=()=>{l.value=!1};return(J,mt)=>{const kt=UA("router-view");return zi(),Vi("div",Xet,[mt[1]||(mt[1]=Re("div",{class:"absolute rounded-full -rotate-[24.22deg] w-[705px] h-[512px] bg-gradient-to-b from-cyan-400/25 to-cyan-200/10 blur-[120px] opacity-80 -top-[79px] left-[575px] mix-blend-screen pointer-events-none"},null,-1)),mt[2]||(mt[2]=Re("div",{class:"absolute rounded-full -rotate-[24.22deg] w-[705px] h-[512px] bg-gradient-to-b from-cyan-400/25 to-cyan-200/10 blur-[120px] opacity-75 -top-[94px] -left-[92px] mix-blend-screen pointer-events-none"},null,-1)),mt[3]||(mt[3]=Re("div",{class:"absolute rounded-full -rotate-[24.22deg] w-[705px] h-[512px] bg-gradient-to-b from-cyan-400/25 to-cyan-200/10 blur-[120px] opacity-80 top-[373px] left-[246px] mix-blend-screen pointer-events-none"},null,-1)),Re("div",Jet,[gu(Ytt,{class:"hidden lg:block"}),gu(aet,{showMobileSidebar:l.value,"onUpdate:showMobileSidebar":mt[0]||(mt[0]=Dt=>l.value=Dt),onClose:j},null,8,["showMobileSidebar"]),Re("main",Qet,[gu(Ket,{onToggleMobileSidebar:z}),gu(kt)])])])}}}),ert=Th({__name:"App",setup(d){return(l,z)=>(zi(),hm(trt))}}),rrt={class:"sparkline-container"},nrt={class:"text-white text-sm font-semibold mb-4"},irt={class:"flex items-end gap-4"},art=["id","width","height","viewBox"],ort=["id"],srt=["stop-color"],lrt=["stop-color"],urt=["d","fill"],crt=["d","stroke"],hrt=["cx","cy","fill"],frt=Th({name:"SparklineChart",__name:"Sparkline",props:{title:{},value:{},color:{},data:{default:()=>[]},width:{default:131},height:{default:37},animate:{type:Boolean,default:!0},showChart:{type:Boolean,default:!0}},setup(d){const l=d,z=Yo(()=>{if(l.data&&l.data.length>0)return l.data;const kt=typeof l.value=="number"?l.value:10,Dt=20,Gt=kt*.3;return Array.from({length:Dt},(re,pe)=>{const Ne=Math.sin(pe/Dt*Math.PI*2)*Gt*.5,or=(Math.random()-.5)*Gt*.3;return Math.max(0,kt+Ne+or)})}),j=Yo(()=>{const kt=z.value;if(kt.length<2)return"";const Dt=Math.max(...kt),Gt=Math.min(...kt),re=Dt-Gt||1,pe=l.width/(kt.length-1);let Ne="";return kt.forEach((or,_r)=>{const Fr=_r*pe,zr=l.height-(or-Gt)/re*l.height;if(_r===0)Ne+=`M ${Fr} ${zr}`;else{const An=((_r-1)*pe+Fr)/2;Ne+=` Q ${An} ${zr} ${Fr} ${zr}`}}),Ne}),J=lo("");t0(()=>{J.value=j.value}),um(()=>l.data,(kt,Dt)=>{const Gt=!Dt||kt.length!==Dt.length||Math.abs(kt.length-Dt.length)>5;l.animate&&Gt?(J.value="",setTimeout(()=>{J.value=j.value},50)):J.value=j.value});const mt=Yo(()=>`sparkline-${l.title.replace(/\s+/g,"-").toLowerCase()}`);return(kt,Dt)=>(zi(),Vi("div",rrt,[Re("p",nrt,aa(kt.title),1),Re("div",irt,[Re("span",{class:"text-[30px] font-bold",style:av({color:kt.color})},[nc(aa(kt.value),1),qG(kt.$slots,"unit",{},void 0)],4),kt.showChart?(zi(),Vi("svg",{key:0,id:mt.value,class:"mb-3 sparkline-svg",width:kt.width,height:kt.height,viewBox:`0 0 ${kt.width} ${kt.height}`,fill:"none",xmlns:"http://www.w3.org/2000/svg"},[Re("defs",null,[Re("linearGradient",{id:`gradient-${mt.value}`,x1:"0%",y1:"0%",x2:"0%",y2:"100%"},[Re("stop",{offset:"0%","stop-color":kt.color,"stop-opacity":"0.3"},null,8,srt),Re("stop",{offset:"100%","stop-color":kt.color,"stop-opacity":"0.1"},null,8,lrt)],8,ort)]),Re("path",{d:`${J.value} L ${kt.width} ${kt.height} L 0 ${kt.height} Z`,fill:`url(#gradient-${mt.value})`,class:"sparkline-fill"},null,8,urt),Re("path",{d:J.value,stroke:kt.color,"stroke-width":"2",fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:Xs(["sparkline-path",{"animate-draw":kt.animate}])},null,10,crt),z.value.length>0?(zi(),Vi("circle",{key:0,cx:kt.width,cy:kt.height-(z.value[z.value.length-1]-Math.min(...z.value))/(Math.max(...z.value)-Math.min(...z.value)||1)*kt.height,r:"2",fill:kt.color,class:Xs(["sparkline-dot",{"animate-pulse":kt.animate}])},null,10,hrt)):bs("",!0)],8,art)):bs("",!0)])]))}}),r_=ld(frt,[["__scopeId","data-v-574bf55e"]]),drt={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-5"},prt=Th({name:"StatsCards",__name:"StatsCards",setup(d){const l=rw(),z=lo(null),j=Yo(()=>{const kt=l.packetStats,Dt=l.systemStats,Gt=re=>{const pe=Math.floor(re/86400),Ne=Math.floor(re%86400/3600),or=Math.floor(re%3600/60);return pe>0?`${pe}d ${Ne}h`:Ne>0?`${Ne}h ${or}m`:`${or}m`};return{packetsReceived:kt?.total_packets||0,packetsForwarded:kt?.transmitted_packets||0,uptimeFormatted:Dt?Gt(Dt.uptime_seconds||0):"0m",uptimeHours:Dt?Math.floor((Dt.uptime_seconds||0)/3600):0,droppedPackets:kt?.dropped_packets||0,signalQuality:Math.round((kt?.avg_rssi||0)+120)}}),J=Yo(()=>l.sparklineData),mt=async()=>{try{await Promise.all([l.fetchSystemStats(),l.fetchPacketStats({hours:24})])}catch(kt){console.error("Error fetching stats:",kt)}};return t0(()=>{mt(),z.value=window.setInterval(mt,5e3)}),dg(()=>{z.value&&clearInterval(z.value)}),(kt,Dt)=>(zi(),Vi("div",drt,[gu(r_,{title:"RX Packets",value:j.value.packetsReceived,color:"#AAE8E8",data:J.value.totalPackets},null,8,["value","data"]),gu(r_,{title:"Forward",value:j.value.packetsForwarded,color:"#FFC246",data:J.value.transmittedPackets},null,8,["value","data"]),gu(r_,{title:"Up Time",value:j.value.uptimeFormatted,color:"#EBA0FC",data:[],showChart:!1},null,8,["value"]),gu(r_,{title:"Dropped",value:j.value.droppedPackets,color:"#FB787B",data:J.value.droppedPackets},null,8,["value","data"])]))}}),mrt={class:"glass-card rounded-[10px] p-6"},grt={class:"h-80 relative"},vrt={key:0,class:"absolute inset-0 flex items-center justify-center"},yrt={key:1,class:"absolute inset-0 flex items-center justify-center"},xrt={class:"text-red-400"},_rt={key:2,class:"absolute inset-0 flex items-center justify-center"},brt={key:3,class:"h-full flex items-end justify-around gap-2 px-4"},wrt={class:"relative w-full h-64 flex flex-col justify-end"},krt={class:"text-white text-xs font-semibold drop-shadow-lg backdrop-blur-sm bg-black/20 px-2 py-0.5 rounded-md border border-white/10"},Trt={class:"mt-2 text-center"},Art={class:"text-white text-xs font-medium leading-tight"},Mrt={key:0,class:"mt-4 text-sm text-white text-center"},Srt=Th({name:"SignalQualityChart",__name:"SignalQualityChart",setup(d){const l=lo([]),z=lo(null),j=lo(!0),J=lo(null),mt=["rgba(59, 130, 246, 0.8)","rgba(16, 185, 129, 0.8)","rgba(139, 92, 246, 0.8)","rgba(245, 158, 11, 0.8)","rgba(239, 68, 68, 0.8)","rgba(6, 182, 212, 0.8)","rgba(249, 115, 22, 0.8)","rgba(132, 204, 22, 0.8)","rgba(236, 72, 153, 0.8)","rgba(107, 114, 128, 0.8)"],kt=async()=>{try{J.value=null;const Gt=await Xh.get("/packet_type_graph_data");if(Gt?.success&&Gt?.data){const re=Gt.data;if(re?.series){const pe=[];re.series.forEach((Ne,or)=>{let _r=0;Ne.data&&Array.isArray(Ne.data)&&(_r=Ne.data.reduce((Fr,zr)=>Fr+(zr[1]||0),0)),_r>0&&pe.push({name:Ne.name||`Type ${Ne.type}`,type:Ne.type,count:_r,color:mt[or%mt.length]})}),pe.sort((Ne,or)=>or.count-Ne.count),l.value=pe,j.value=!1}else console.error("No series data found in response"),J.value="No series data in server response",j.value=!1}else console.error("Invalid API response structure:",Gt),J.value="Invalid response from server",j.value=!1}catch(Gt){console.error("Failed to fetch packet type data:",Gt),J.value=Gt instanceof Error?Gt.message:"Failed to load data",j.value=!1}},Dt=Gt=>{if(l.value.length===0)return 0;const re=Math.max(...l.value.map(pe=>pe.count));return Math.max(Gt/re*100,2)};return t0(()=>{kt(),z.value=setInterval(()=>{kt()},3e4)}),dg(()=>{z.value&&clearInterval(z.value)}),(Gt,re)=>(zi(),Vi("div",mrt,[re[2]||(re[2]=Re("h3",{class:"text-white text-xl font-semibold mb-4"},"Packet Types",-1)),re[3]||(re[3]=Re("p",{class:"text-white text-sm uppercase mb-4"},"Distribution by Type",-1)),Re("div",grt,[j.value?(zi(),Vi("div",vrt,re[0]||(re[0]=[Re("div",{class:"text-white"},"Loading packet types...",-1)]))):J.value?(zi(),Vi("div",yrt,[Re("div",xrt,aa(J.value),1)])):l.value.length===0?(zi(),Vi("div",_rt,re[1]||(re[1]=[Re("div",{class:"text-white"},"No packet data available",-1)]))):(zi(),Vi("div",brt,[(zi(!0),Vi(Ou,null,sf(l.value,pe=>(zi(),Vi("div",{key:pe.type,class:"flex flex-col items-center flex-1 max-w-20 h-full"},[Re("div",wrt,[Re("div",{class:"w-full rounded-t-[10px] transition-all duration-500 ease-out flex items-end justify-center pb-1 backdrop-blur-[50px] shadow-lg border border-white/20 hover:border-white/30",style:av({height:Dt(pe.count)+"%",background:`linear-gradient(135deg, +`+mt):j.stack=mt}catch{}}throw j}}_request(l,z){typeof l=="string"?(z=z||{},z.url=l):z=l||{},z=Ay(this.defaults,z);const{transitional:j,paramsSerializer:J,headers:mt}=z;j!==void 0&&Y5.assertOptions(j,{silentJSONParsing:tg.transitional(tg.boolean),forcedJSONParsing:tg.transitional(tg.boolean),clarifyTimeoutError:tg.transitional(tg.boolean)},!1),J!=null&&(to.isFunction(J)?z.paramsSerializer={serialize:J}:Y5.assertOptions(J,{encode:tg.function,serialize:tg.function},!0)),z.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?z.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:z.allowAbsoluteUrls=!0),Y5.assertOptions(z,{baseUrl:tg.spelling("baseURL"),withXsrfToken:tg.spelling("withXSRFToken")},!0),z.method=(z.method||this.defaults.method||"get").toLowerCase();let kt=mt&&to.merge(mt.common,mt[z.method]);mt&&to.forEach(["delete","get","head","post","put","patch","common"],Fr=>{delete mt[Fr]}),z.headers=E0.concat(kt,mt);const Dt=[];let Gt=!0;this.interceptors.request.forEach(function(zr){typeof zr.runWhen=="function"&&zr.runWhen(z)===!1||(Gt=Gt&&zr.synchronous,Dt.unshift(zr.fulfilled,zr.rejected))});const re=[];this.interceptors.response.forEach(function(zr){re.push(zr.fulfilled,zr.rejected)});let pe,Ne=0,or;if(!Gt){const Fr=[BL.bind(this),void 0];for(Fr.unshift(...Dt),Fr.push(...re),or=Fr.length,pe=Promise.resolve(z);Ne{if(!j._listeners)return;let mt=j._listeners.length;for(;mt-- >0;)j._listeners[mt](J);j._listeners=null}),this.promise.then=J=>{let mt;const kt=new Promise(Dt=>{j.subscribe(Dt),mt=Dt}).then(J);return kt.cancel=function(){j.unsubscribe(mt)},kt},l(function(mt,kt,Dt){j.reason||(j.reason=new x_(mt,kt,Dt),z(j.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(l){if(this.reason){l(this.reason);return}this._listeners?this._listeners.push(l):this._listeners=[l]}unsubscribe(l){if(!this._listeners)return;const z=this._listeners.indexOf(l);z!==-1&&this._listeners.splice(z,1)}toAbortSignal(){const l=new AbortController,z=j=>{l.abort(j)};return this.subscribe(z),l.signal.unsubscribe=()=>this.unsubscribe(z),l.signal}static source(){let l;return{token:new wO(function(J){l=J}),cancel:l}}};function eQ(d){return function(z){return d.apply(null,z)}}function rQ(d){return to.isObject(d)&&d.isAxiosError===!0}const pA={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(pA).forEach(([d,l])=>{pA[l]=d});function kO(d){const l=new by(d),z=tO(by.prototype.request,l);return to.extend(z,by.prototype,l,{allOwnKeys:!0}),to.extend(z,l,null,{allOwnKeys:!0}),z.create=function(J){return kO(Ay(d,J))},z}const _d=kO(ew);_d.Axios=by;_d.CanceledError=x_;_d.CancelToken=tQ;_d.isCancel=mO;_d.VERSION=bO;_d.toFormData=N4;_d.AxiosError=Qu;_d.Cancel=_d.CanceledError;_d.all=function(l){return Promise.all(l)};_d.spread=eQ;_d.isAxiosError=rQ;_d.mergeConfig=Ay;_d.AxiosHeaders=E0;_d.formToJSON=d=>pO(to.isHTMLForm(d)?new FormData(d):d);_d.getAdapter=_O.getAdapter;_d.HttpStatusCode=pA;_d.default=_d;const{Axios:_vt,AxiosError:bvt,CanceledError:wvt,isCancel:kvt,CancelToken:Tvt,VERSION:Avt,all:Mvt,Cancel:Svt,isAxiosError:Evt,spread:Cvt,toFormData:Lvt,AxiosHeaders:Pvt,HttpStatusCode:zvt,formToJSON:Ivt,getAdapter:Ovt,mergeConfig:Dvt}=_d,nQ="/api",iQ="",aQ=nQ,oQ=iQ,my=_d.create({baseURL:aQ,timeout:5e3,headers:{"Content-Type":"application/json"}});my.interceptors.request.use(d=>d,d=>(console.error("API Request Error:",d),Promise.reject(d)));my.interceptors.response.use(d=>d,d=>(console.error("API Response Error:",d.response?.data||d.message),Promise.reject(d)));class Xh{static async get(l,z){try{return(await my.get(l,{params:z})).data}catch(j){throw this.handleError(j)}}static async post(l,z,j){try{return(await my.post(l,z,j)).data}catch(J){throw this.handleError(J)}}static async put(l,z,j){try{return(await my.put(l,z,j)).data}catch(J){throw this.handleError(J)}}static async delete(l,z){try{return(await my.delete(l,z)).data}catch(j){throw this.handleError(j)}}static async getTransportKeys(){return this.get("transport_keys")}static async createTransportKey(l,z,j,J,mt){const kt={name:l,flood_policy:z,parent_id:J,last_used:mt};return j!==void 0&&(kt.transport_key=j),this.post("transport_keys",kt)}static async getTransportKey(l){return this.get(`transport_key/${l}`)}static async updateTransportKey(l,z,j,J,mt,kt){return this.put(`transport_key/${l}`,{name:z,flood_policy:j,transport_key:J,parent_id:mt,last_used:kt})}static async deleteTransportKey(l){return this.delete(`transport_key/${l}`)}static async updateGlobalFloodPolicy(l){return this.post("global_flood_policy",{global_flood_allow:l})}static async getLogs(){try{return(await my.get("logs")).data}catch(l){throw this.handleError(l)}}static handleError(l){if(_d.isAxiosError(l)){if(l.response){const z=l.response.data?.error||l.response.data?.message||`HTTP ${l.response.status}`;return new Error(z)}else if(l.request)return new Error("Network error - no response received")}return new Error(l instanceof Error?l.message:"Unknown error occurred")}}const sv=GA("system",()=>{const d=lo(null),l=lo(!1),z=lo(null),j=lo(null),J=lo("forward"),mt=lo(!0),kt=lo(0),Dt=lo(10),Gt=lo(!1),re=Yo(()=>d.value?.config?.node_name??"Unknown"),pe=Yo(()=>{const yi=d.value?.public_key;return!yi||yi==="Unknown"?"Unknown":yi.length>=16?`${yi.slice(0,8)} ... ${yi.slice(-8)}`:`${yi}`}),Ne=Yo(()=>d.value!==null),or=Yo(()=>d.value?.version??"Unknown"),_r=Yo(()=>d.value?.core_version??"Unknown"),Fr=Yo(()=>d.value?.noise_floor_dbm??null),zr=Yo(()=>Dt.value>0?Math.min(kt.value/Dt.value*100,100):0),Wr=Yo(()=>J.value==="monitor"?{text:"Monitor Mode",title:"Monitoring only - not forwarding packets"}:mt.value?{text:"Active",title:"Forwarding with duty cycle enforcement"}:{text:"No Limits",title:"Forwarding without duty cycle enforcement"}),An=Yo(()=>J.value==="monitor"?{active:!1,warning:!0}:{active:!0,warning:!1}),Ft=Yo(()=>mt.value?{active:!0,warning:!1}:{active:!1,warning:!0}),kn=yi=>{Gt.value=yi};async function ei(){try{l.value=!0,z.value=null;const yi=await Xh.get("/stats");if(yi.success&&yi.data)return d.value=yi.data,j.value=new Date,jn(yi.data),yi.data;if(yi&&"version"in yi){const ra=yi;return d.value=ra,j.value=new Date,jn(ra),ra}else throw new Error(yi.error||"Failed to fetch stats")}catch(yi){throw z.value=yi instanceof Error?yi.message:"Unknown error occurred",console.error("Error fetching stats:",yi),yi}finally{l.value=!1}}function jn(yi){if(yi.config){const Da=yi.config.repeater?.mode;(Da==="forward"||Da==="monitor")&&(J.value=Da);const Ni=yi.config.duty_cycle;if(Ni){mt.value=Ni.enforcement_enabled!==!1;const Ei=Ni.max_airtime_percent;typeof Ei=="number"?Dt.value=Ei:Ei&&typeof Ei=="object"&&"parsedValue"in Ei&&(Dt.value=Ei.parsedValue||10)}}const ra=yi.utilization_percent;typeof ra=="number"?kt.value=ra:ra&&typeof ra=="object"&&"parsedValue"in ra&&(kt.value=ra.parsedValue||0)}async function ai(yi){try{const ra=await Xh.post("/set_mode",{mode:yi});if(ra.success)return J.value=yi,!0;throw new Error(ra.error||"Failed to set mode")}catch(ra){throw z.value=ra instanceof Error?ra.message:"Unknown error occurred",console.error("Error setting mode:",ra),ra}}async function Qi(yi){try{const ra=await Xh.post("/set_duty_cycle",{enabled:yi});if(ra.success)return mt.value=yi,!0;throw new Error(ra.error||"Failed to set duty cycle")}catch(ra){throw z.value=ra instanceof Error?ra.message:"Unknown error occurred",console.error("Error setting duty cycle:",ra),ra}}async function Gi(){try{const yi=await Xh.post("/send_advert",{},{timeout:1e4});if(yi.success)return console.log("Advertisement sent successfully:",yi.data),!0;throw new Error(yi.error||"Failed to send advert")}catch(yi){throw z.value=yi instanceof Error?yi.message:"Unknown error occurred",console.error("Error sending advert:",yi),yi}}async function un(){const yi=J.value==="forward"?"monitor":"forward";return await ai(yi)}async function ia(){return await Qi(!mt.value)}async function fa(yi=5e3){await ei();const ra=setInterval(async()=>{try{await ei()}catch(Da){console.error("Auto-refresh error:",Da)}},yi);return()=>clearInterval(ra)}function Li(){d.value=null,z.value=null,j.value=null,l.value=!1,J.value="forward",mt.value=!0,kt.value=0,Dt.value=10}return{stats:d,isLoading:l,error:z,lastUpdated:j,currentMode:J,dutyCycleEnabled:mt,dutyCycleUtilization:kt,dutyCycleMax:Dt,cadCalibrationRunning:Gt,nodeName:re,pubKey:pe,hasStats:Ne,version:or,coreVersion:_r,noiseFloorDbm:Fr,dutyCyclePercentage:zr,statusBadge:Wr,modeButtonState:An,dutyCycleButtonState:Ft,fetchStats:ei,setMode:ai,setDutyCycle:Qi,sendAdvert:Gi,toggleMode:un,toggleDutyCycle:ia,startAutoRefresh:fa,reset:Li,setCadCalibrationRunning:kn}}),ld=(d,l)=>{const z=d.__vccOpts||d;for(const[j,J]of l)z[j]=J;return z},sQ={},lQ={width:"23",height:"25",viewBox:"0 0 23 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function uQ(d,l){return zi(),Vi("svg",lQ,l[0]||(l[0]=[Re("path",{d:"M2.84279 2.25795C2.90709 1.12053 3.17879 0.625914 3.95795 0.228723C4.79631 -0.198778 6.11858 0.000168182 7.67449 0.788054C8.34465 1.12757 8.41289 1.13448 9.58736 0.983905C11.1485 0.783681 13.1582 0.784388 14.5991 0.985738C15.6887 1.13801 15.7603 1.1304 16.4321 0.790174C18.6406 -0.328212 20.3842 -0.255036 21.0156 0.982491C21.3308 1.6002 21.3893 3.20304 21.1449 4.52503C21.0094 5.25793 21.0238 5.34943 21.3502 5.83037C23.6466 9.21443 21.9919 14.6998 18.0569 16.7469C17.7558 16.9036 17.502 17.0005 17.2952 17.0795C16.6602 17.3219 16.4674 17.3956 16.7008 18.5117C16.8132 19.0486 16.9486 20.3833 17.0018 21.478C17.098 23.4567 17.0966 23.4705 16.7495 23.8742C16.2772 24.4233 15.5963 24.4326 15.135 23.8962C14.8341 23.5464 14.8047 23.3812 14.8047 22.0315C14.8047 20.037 14.5861 18.7113 14.0695 17.5753C13.4553 16.2235 13.9106 15.7194 15.3154 15.4173C17.268 14.9973 18.793 13.7923 19.643 11.9978C20.4511 10.2921 20.5729 7.93485 19.1119 6.50124C18.6964 6.00746 18.6674 5.56022 18.9641 4.21159C19.075 3.70754 19.168 3.05725 19.1707 2.76637C19.1749 2.30701 19.1331 2.23764 18.8509 2.23764C18.6724 2.23764 17.9902 2.49736 17.3352 2.81474L16.2897 3.32145C16.1947 3.36751 16.0883 3.38522 15.9834 3.37318C13.3251 3.06805 10.7991 3.06334 8.12774 3.37438C8.02244 3.38663 7.91563 3.36892 7.82025 3.32263L6.77535 2.81559C6.12027 2.49764 5.43813 2.23764 5.25963 2.23764C4.84693 2.23764 4.84072 2.54233 5.2169 4.35258C5.44669 5.45816 5.60133 5.70451 4.93703 6.58851C3.94131 7.91359 3.69258 9.55902 4.22654 11.2878C4.89952 13.4664 6.54749 14.9382 8.86436 15.4292C10.261 15.7253 10.6261 16.1115 10.0928 17.713C9.67293 18.9734 9.40748 19.2982 8.79738 19.2982C7.97649 19.2982 7.46228 18.5871 7.74527 17.843C7.86991 17.5151 7.83283 17.4801 7.06383 17.1996C4.71637 16.3437 2.9209 14.4254 2.10002 11.8959C1.46553 9.94098 1.74471 7.39642 2.76257 5.85843C3.10914 5.33477 3.1145 5.29036 2.95277 4.28787C2.86126 3.72037 2.81177 2.80699 2.84279 2.25795Z",fill:"white"},null,-1),Re("path",{d:"M2.02306 16.5589C1.68479 16.0516 0.999227 15.9144 0.491814 16.2527C-0.0155884 16.591 -0.152708 17.2765 0.185564 17.7839C0.435301 18.1586 0.734065 18.4663 0.987777 18.72C1.03455 18.7668 1.08 18.8119 1.12438 18.856C1.3369 19.0671 1.52455 19.2535 1.71302 19.4748C2.12986 19.964 2.54572 20.623 2.78206 21.8047C2.88733 22.3311 3.26569 22.6147 3.47533 22.7386C3.70269 22.8728 3.9511 22.952 4.15552 23.0036C4.57369 23.109 5.08133 23.1638 5.56309 23.1957C6.09196 23.2308 6.665 23.2422 7.17743 23.2453C7.1778 23.8547 7.67202 24.3487 8.28162 24.3487C8.89146 24.3487 9.38582 23.8543 9.38582 23.2445V22.1403C9.38582 21.5305 8.89146 21.0361 8.28162 21.0361C8.17753 21.0361 8.06491 21.0364 7.94562 21.0369C7.29761 21.0389 6.45295 21.0414 5.70905 20.9922C5.35033 20.9684 5.05544 20.9347 4.8392 20.8936C4.50619 19.5863 3.96821 18.7165 3.39415 18.0426C3.14038 17.7448 2.87761 17.4842 2.66387 17.2722C2.62385 17.2326 2.58556 17.1946 2.54935 17.1584C2.30273 16.9118 2.1414 16.7365 2.02306 16.5589Z",fill:"white"},null,-1)]))}const cQ=ld(sQ,[["render",uQ]]),hQ={},fQ={width:"17",height:"24",viewBox:"0 0 17 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function dQ(d,l){return zi(),Vi("svg",fQ,l[0]||(l[0]=[Ff('',12)]))}const pQ=ld(hQ,[["render",dQ]]),rw=GA("packets",()=>{const d=lo(null),l=lo(null),z=lo([]),j=lo([]),J=lo(null),mt=lo(!1),kt=lo(null),Dt=lo(null),Gt=lo([]),re=lo([]),pe=Yo(()=>d.value!==null),Ne=Yo(()=>l.value!==null),or=Yo(()=>z.value.length>0),_r=Yo(()=>j.value.length>0),Fr=Yo(()=>J.value?.avg_noise_floor??0),zr=Yo(()=>d.value?.total_packets??0),Wr=Yo(()=>d.value?.avg_rssi??0),An=Yo(()=>d.value?.avg_snr??0),Ft=Yo(()=>l.value?.uptime_seconds??0),kn=Yo(()=>{if(!d.value?.packet_types)return[];const Ni=d.value.packet_types,Ei=Ni.reduce((Va,ss)=>Va+ss.count,0);return Ni.map(Va=>({type:Va.type.toString(),count:Va.count,percentage:Ei>0?Va.count/Ei*100:0}))}),ei=Yo(()=>{const Ni={};return z.value.forEach(Ei=>{Ni[Ei.type]||(Ni[Ei.type]=[]),Ni[Ei.type].push(Ei)}),Ni});async function jn(){try{const Ni=await Xh.get("/stats");if(Ni.success&&Ni.data){l.value=Ni.data;const Ei=new Date;return re.value.push({timestamp:Ei,stats:Ni.data}),re.value.length>50&&(re.value=re.value.slice(-50)),Ni.data}else if(Ni&&"version"in Ni){const Ei=Ni;l.value=Ei;const Va=new Date;return re.value.push({timestamp:Va,stats:Ei}),re.value.length>50&&(re.value=re.value.slice(-50)),Ei}else throw new Error(Ni.error||"Failed to fetch system stats")}catch(Ni){throw kt.value=Ni instanceof Error?Ni.message:"Unknown error occurred",console.error("Error fetching system stats:",Ni),Ni}}async function ai(Ni={hours:24}){try{const Ei=await Xh.get("/noise_floor_history",Ni);if(Ei.success&&Ei.data&&Ei.data.history)return j.value=Ei.data.history,Dt.value=new Date,Ei.data.history;throw new Error(Ei.error||"Failed to fetch noise floor history")}catch(Ei){throw kt.value=Ei instanceof Error?Ei.message:"Unknown error occurred",console.error("Error fetching noise floor history:",Ei),Ei}}async function Qi(Ni={hours:24}){try{const Ei=await Xh.get("/noise_floor_stats",Ni);if(Ei.success&&Ei.data&&Ei.data.stats)return J.value=Ei.data.stats,Dt.value=new Date,Ei.data.stats;throw new Error(Ei.error||"Failed to fetch noise floor stats")}catch(Ei){throw kt.value=Ei instanceof Error?Ei.message:"Unknown error occurred",console.error("Error fetching noise floor stats:",Ei),Ei}}const Gi=Yo(()=>!j.value||!Array.isArray(j.value)?[]:j.value.slice(-50).map(Ni=>Ni.noise_floor_dbm));async function un(Ni={hours:24}){try{mt.value=!0,kt.value=null;const Ei=await Xh.get("/packet_stats",Ni);if(Ei.success&&Ei.data){d.value=Ei.data;const Va=new Date;Gt.value.push({timestamp:Va,stats:Ei.data}),Gt.value.length>50&&(Gt.value=Gt.value.slice(-50)),Dt.value=Va}else throw new Error(Ei.error||"Failed to fetch packet stats")}catch(Ei){kt.value=Ei instanceof Error?Ei.message:"Unknown error occurred",console.error("Error fetching packet stats:",Ei)}finally{mt.value=!1}}async function ia(Ni={limit:100}){try{mt.value=!0,kt.value=null;const Ei=await Xh.get("/recent_packets",Ni);if(Ei.success&&Ei.data)z.value=Ei.data,Dt.value=new Date;else throw new Error(Ei.error||"Failed to fetch recent packets")}catch(Ei){kt.value=Ei instanceof Error?Ei.message:"Unknown error occurred",console.error("Error fetching recent packets:",Ei)}finally{mt.value=!1}}async function fa(Ni){try{mt.value=!0,kt.value=null;const Ei=await Xh.get("/filtered_packets",Ni);if(Ei.success&&Ei.data)return z.value=Ei.data,Dt.value=new Date,Ei.data;throw new Error(Ei.error||"Failed to fetch filtered packets")}catch(Ei){throw kt.value=Ei instanceof Error?Ei.message:"Unknown error occurred",console.error("Error fetching filtered packets:",Ei),Ei}finally{mt.value=!1}}async function Li(Ni){try{mt.value=!0,kt.value=null;const Ei=await Xh.get("/packet_by_hash",{packet_hash:Ni});if(Ei.success&&Ei.data)return Ei.data;throw new Error(Ei.error||"Packet not found")}catch(Ei){throw kt.value=Ei instanceof Error?Ei.message:"Unknown error occurred",console.error("Error fetching packet by hash:",Ei),Ei}finally{mt.value=!1}}const yi=Yo(()=>{const Ni=Gt.value,Ei=re.value;return{totalPackets:Ni.map(Va=>Va.stats.total_packets),transmittedPackets:Ni.map(Va=>Va.stats.transmitted_packets),droppedPackets:Ni.map(Va=>Va.stats.dropped_packets),avgRssi:Ni.map(Va=>Va.stats.avg_rssi),uptimeHours:Ei.map(Va=>Math.floor((Va.stats.uptime_seconds||0)/3600))}});async function ra(Ni=3e4){await Promise.all([jn(),un(),ia(),ai({hours:1}),Qi({hours:1})]);const Ei=setInterval(async()=>{try{await Promise.all([jn(),un(),ia(),ai({hours:1}),Qi({hours:1})])}catch(Va){console.error("Auto-refresh error:",Va)}},Ni);return()=>clearInterval(Ei)}function Da(){d.value=null,l.value=null,z.value=[],j.value=[],J.value=null,Gt.value=[],re.value=[],kt.value=null,Dt.value=null,mt.value=!1}return{packetStats:d,systemStats:l,recentPackets:z,noiseFloorHistory:j,noiseFloorStats:J,packetStatsHistory:Gt,systemStatsHistory:re,isLoading:mt,error:kt,lastUpdated:Dt,hasPacketStats:pe,hasSystemStats:Ne,hasRecentPackets:or,hasNoiseFloorData:_r,currentNoiseFloor:Fr,totalPackets:zr,averageRSSI:Wr,averageSNR:An,uptime:Ft,packetTypeBreakdown:kn,recentPacketsByType:ei,sparklineData:yi,noiseFloorSparklineData:Gi,fetchSystemStats:jn,fetchPacketStats:un,fetchRecentPackets:ia,fetchFilteredPackets:fa,getPacketByHash:Li,fetchNoiseFloorHistory:ai,fetchNoiseFloorStats:Qi,startAutoRefresh:ra,reset:Da}}),mQ={class:"glass-card-green p-5 relative overflow-hidden"},gQ={key:0,class:"absolute inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-10 rounded-lg"},vQ={class:"flex items-baseline gap-2 mb-8"},yQ={class:"text-primary text-2xl font-medium"},xQ={class:"absolute bottom-0 left-5 w-[196px] h-[30px]",viewBox:"0 0 196 30",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_Q=["d"],bQ=["d"],wQ=["cy"],kQ=Th({__name:"RFNoiseFloor",setup(d){const l=rw(),z=sv(),j=lo(null),J=pe=>{if(pe.length<2)return"";const Ne=196,or=30,_r=4,Fr=-125,Wr=-105-Fr;let An="";return pe.forEach((Ft,kn)=>{const ei=kn/(pe.length-1)*Ne,jn=(Ft-Fr)/Wr,ai=or-jn*(or-_r*2)-_r;if(kn===0)An+=`M ${ei} ${ai}`;else{const Gi=((kn-1)/(pe.length-1)*Ne+ei)/2;An+=` Q ${Gi} ${ai} ${ei} ${ai}`}}),An},mt=async()=>{try{await Promise.all([l.fetchNoiseFloorHistory({hours:1}),l.fetchNoiseFloorStats({hours:1})])}catch(pe){console.error("Error fetching noise floor data:",pe)}};t0(()=>{mt(),j.value=window.setInterval(mt,5e3)}),dg(()=>{j.value&&clearInterval(j.value)});const kt=Yo(()=>{const pe=l.noiseFloorSparklineData;return pe&&pe.length>0?pe[pe.length-1]:l.noiseFloorStats?.avg_noise_floor??-116}),Dt=Yo(()=>l.noiseFloorSparklineData),Gt=Yo(()=>J(Dt.value)),re=Yo(()=>{if(Dt.value.length===0)return 15;const pe=Dt.value[Dt.value.length-1],Ne=-125,_r=-105-Ne;return 30-(pe-Ne)/_r*22-4});return(pe,Ne)=>(zi(),Vi("div",mQ,[Ju(z).cadCalibrationRunning?(zi(),Vi("div",gQ,Ne[0]||(Ne[0]=[Ff('
CAD Calibration

In Progress

',1)]))):bs("",!0),Ne[4]||(Ne[4]=Re("p",{class:"text-dark-text text-xs uppercase mb-2"},"RF NOISE FLOOR",-1)),Re("div",vQ,[Re("span",yQ,aa(kt.value),1),Ne[1]||(Ne[1]=Re("span",{class:"text-dark-text text-xs uppercase"},"dBm",-1))]),(zi(),Vi("svg",xQ,[Ne[3]||(Ne[3]=Ff('',1)),Dt.value.length>1?(zi(),Vi("path",{key:0,d:`${Gt.value} L 196 30 L 0 30 Z`,fill:"url(#rf-noise-gradient)",class:"transition-all duration-500 ease-out"},null,8,_Q)):bs("",!0),Dt.value.length>1?(zi(),Vi("path",{key:1,d:Gt.value,stroke:"#B1FFFF","stroke-width":"2",fill:"none",filter:"url(#line-glow)",class:"transition-all duration-500 ease-out"},null,8,bQ)):bs("",!0),Dt.value.length>0?(zi(),Vi("circle",{key:2,cx:196,cy:re.value,r:"2",fill:"#B1FFFF",class:"animate-pulse"},Ne[2]||(Ne[2]=[Re("animate",{attributeName:"r",values:"2;3;2",dur:"2s",repeatCount:"indefinite"},null,-1)]),8,wQ)):bs("",!0)]))]))}}),TQ=ld(kQ,[["__scopeId","data-v-ad12b3cb"]]),AQ={},MQ={width:"800px",height:"800px",viewBox:"0 -1.5 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",class:"w-full h-full"};function SQ(d,l){return zi(),Vi("svg",MQ,l[0]||(l[0]=[Re("g",{id:"Page-1",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[Re("g",{transform:"translate(-420.000000, -3641.000000)",fill:"currentColor"},[Re("g",{id:"icons",transform:"translate(56.000000, 160.000000)"},[Re("path",{d:"M378.195439,3483.828 L376.781439,3485.242 C378.195439,3486.656 378.294439,3489.588 376.880439,3491.002 L378.294439,3492.417 C380.415439,3490.295 380.316439,3485.949 378.195439,3483.828 M381.023439,3481 L379.609439,3482.414 C382.438439,3485.242 382.537439,3491.002 379.708439,3493.831 L381.122439,3495.245 C385.365439,3491.002 384.559439,3484.535 381.023439,3481 M375.432439,3486.737 C375.409439,3486.711 375.392439,3486.682 375.367439,3486.656 L375.363439,3486.66 C374.582439,3485.879 373.243439,3485.952 372.536439,3486.659 C371.829439,3487.366 371.831439,3488.778 372.538439,3489.485 C372.547439,3489.494 372.558439,3489.499 372.567439,3489.508 C372.590439,3489.534 372.607439,3489.563 372.632439,3489.588 L372.636439,3489.585 C373.201439,3490.15 373.000439,3488.284 373.000439,3498 L375.000439,3498 C375.000439,3488.058 374.753439,3490.296 375.463439,3489.586 C376.170439,3488.879 376.168439,3487.467 375.461439,3486.76 C375.452439,3486.751 375.441439,3486.746 375.432439,3486.737 M371.119439,3485.242 L369.705439,3483.828 C367.584439,3485.949 367.683439,3490.295 369.804439,3492.417 L371.218439,3491.002 C369.804439,3489.588 369.705439,3486.656 371.119439,3485.242 M368.390439,3493.831 L366.976439,3495.245 C363.440439,3491.709 362.634439,3485.242 366.877439,3481 L368.291439,3482.414 C365.462439,3485.242 365.561439,3491.002 368.390439,3493.831",id:"radio_tower-[#1019]"})])])],-1)]))}const EQ=ld(AQ,[["render",SQ]]),CQ={class:"text-center"},LQ={class:"relative flex items-center justify-center mb-8"},PQ={class:"relative w-32 h-32"},zQ={class:"absolute left-1/2 top-1/2 transform -translate-x-1/2 -translate-y-1/2"},IQ={key:0,class:"absolute inset-0 flex items-center justify-center"},OQ={key:1,class:"absolute inset-0 flex items-center justify-center"},DQ={key:2,class:"absolute inset-0"},FQ={class:"mb-6"},RQ={key:0,class:"text-white text-lg"},BQ={key:1,class:"text-accent-green text-lg font-medium"},NQ={key:2,class:"text-secondary text-lg"},jQ={key:3,class:"text-accent-red text-lg"},UQ={key:4,class:"text-dark-text"},VQ={key:5,class:"mt-3"},HQ={key:0,class:"text-secondary text-sm"},WQ={key:1,class:"text-accent-red text-sm"},qQ={key:0,class:"flex gap-3"},ZQ={key:1,class:"text-dark-text text-sm"},$Q=Th({name:"AdvertModal",__name:"AdvertModal",props:{isOpen:{type:Boolean},isLoading:{type:Boolean},isSuccess:{type:Boolean},error:{default:null}},emits:["close","send"],setup(d,{emit:l}){const z=d,j=l,J=lo(!1),mt=lo(!1),kt=lo(!1);um(()=>z.isOpen,pe=>{pe?(J.value=!0,setTimeout(()=>{mt.value=!0},50)):(mt.value=!1,kt.value=!1,setTimeout(()=>{J.value=!1},300))},{immediate:!0}),um(()=>z.isLoading,pe=>{pe||setTimeout(()=>{kt.value=!1},1e3)});const Dt=()=>{z.isLoading||j("close")},Gt=()=>{z.isLoading||(kt.value=!0,j("send"))},re=pe=>pe?.includes("Network error - no response received")||pe?.includes("timeout");return(pe,Ne)=>(zi(),hm($z,{to:"body"},[J.value?(zi(),Vi("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4",onClick:hg(Dt,["self"])},[Re("div",{class:Xs(["absolute inset-0 bg-black/60 backdrop-blur-sm transition-opacity duration-300",mt.value?"opacity-100":"opacity-0"])},null,2),Re("div",{class:Xs(["relative glass-card rounded-[20px] p-8 max-w-md w-full transform transition-all duration-300",mt.value?"scale-100 opacity-100":"scale-95 opacity-0"])},[pe.isLoading?bs("",!0):(zi(),Vi("button",{key:0,onClick:Dt,class:"absolute top-4 right-4 text-dark-text hover:text-white transition-colors p-2"},Ne[0]||(Ne[0]=[Re("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))),Re("div",CQ,[Ne[6]||(Ne[6]=Re("h2",{class:"text-white text-xl font-semibold mb-6"},"Send Advertisement",-1)),Re("div",LQ,[Re("div",PQ,[Re("div",zQ,[gu(EQ,{class:Xs(["w-16 h-16 transition-all duration-500",[pe.isLoading?"animate-pulse":"",pe.isSuccess?"text-accent-green":pe.error&&!re(pe.error)?"text-accent-red":"text-primary"]]),style:av({filter:pe.isLoading?"drop-shadow(0 0 8px currentColor)":pe.isSuccess?"drop-shadow(0 0 8px #A5E5B6)":pe.error&&!re(pe.error)?"drop-shadow(0 0 8px #FB787B)":"drop-shadow(0 0 4px #AAE8E8)"})},null,8,["class","style"])]),pe.isLoading||pe.isSuccess?(zi(),Vi("div",IQ,[Re("div",{class:Xs(["absolute w-16 h-16 rounded-full border-2 animate-ping",[pe.isSuccess?"border-accent-green/60":"border-primary/60"]]),style:{"animation-duration":"1.5s"}},null,2),Re("div",{class:Xs(["absolute w-24 h-24 rounded-full border-2 animate-ping",[pe.isSuccess?"border-accent-green/40":"border-primary/40"]]),style:{"animation-duration":"2s","animation-delay":"0.3s"}},null,2),Re("div",{class:Xs(["absolute w-32 h-32 rounded-full border-2 animate-ping",[pe.isSuccess?"border-accent-green/20":"border-primary/20"]]),style:{"animation-duration":"2.5s","animation-delay":"0.6s"}},null,2)])):bs("",!0),kt.value?(zi(),Vi("div",OQ,Ne[1]||(Ne[1]=[Re("div",{class:"absolute w-8 h-8 rounded-full border-4 border-secondary animate-ping-fast"},null,-1),Re("div",{class:"absolute w-16 h-16 rounded-full border-3 border-secondary/70 animate-ping-fast",style:{"animation-delay":"0.1s"}},null,-1),Re("div",{class:"absolute w-24 h-24 rounded-full border-2 border-secondary/50 animate-ping-fast",style:{"animation-delay":"0.2s"}},null,-1),Re("div",{class:"absolute w-32 h-32 rounded-full border-2 border-secondary/30 animate-ping-fast",style:{"animation-delay":"0.3s"}},null,-1)]))):bs("",!0),pe.isLoading||pe.isSuccess?(zi(),Vi("div",DQ,[Re("div",{class:Xs(["absolute top-2 right-2 w-4 h-4 rounded-full transition-all duration-500 animate-pulse",[pe.isSuccess?"bg-accent-green shadow-lg shadow-accent-green/50":"bg-primary/70 shadow-lg shadow-primary/30"]]),style:{"animation-delay":"0.5s"}},Ne[2]||(Ne[2]=[Re("div",{class:"w-2 h-2 bg-white rounded-full mx-auto mt-1"},null,-1)]),2),Re("div",{class:Xs(["absolute bottom-2 left-2 w-4 h-4 rounded-full transition-all duration-500 animate-pulse",[pe.isSuccess?"bg-accent-green shadow-lg shadow-accent-green/50":"bg-primary/70 shadow-lg shadow-primary/30"]]),style:{"animation-delay":"1s"}},Ne[3]||(Ne[3]=[Re("div",{class:"w-2 h-2 bg-white rounded-full mx-auto mt-1"},null,-1)]),2),Re("div",{class:Xs(["absolute top-1/2 right-1 w-4 h-4 rounded-full transition-all duration-500 animate-pulse",[pe.isSuccess?"bg-accent-green shadow-lg shadow-accent-green/50":"bg-primary/70 shadow-lg shadow-primary/30"]]),style:{"animation-delay":"1.5s",transform:"translateY(-50%)"}},Ne[4]||(Ne[4]=[Re("div",{class:"w-2 h-2 bg-white rounded-full mx-auto mt-1"},null,-1)]),2),Re("div",{class:Xs(["absolute top-3 left-3 w-4 h-4 rounded-full transition-all duration-500 animate-pulse",[pe.isSuccess?"bg-accent-green shadow-lg shadow-accent-green/50":"bg-primary/70 shadow-lg shadow-primary/30"]]),style:{"animation-delay":"2s"}},Ne[5]||(Ne[5]=[Re("div",{class:"w-2 h-2 bg-white rounded-full mx-auto mt-1"},null,-1)]),2)])):bs("",!0)])]),Re("div",FQ,[pe.isLoading?(zi(),Vi("p",RQ," Broadcasting advertisement... ")):pe.isSuccess?(zi(),Vi("p",BQ," Advertisement sent successfully! ")):pe.error&&re(pe.error)?(zi(),Vi("p",NQ," Advertisement likely sent ")):pe.error?(zi(),Vi("p",jQ," Failed to send advertisement ")):(zi(),Vi("p",UQ," This will broadcast your node's presence to nearby nodes. ")),pe.error?(zi(),Vi("div",VQ,[re(pe.error)?(zi(),Vi("p",HQ," Network timeout occurred, but the advertisement may have been successfully transmitted to nearby nodes. ")):(zi(),Vi("p",WQ,aa(pe.error),1))])):bs("",!0)]),!pe.isLoading&&!pe.isSuccess?(zi(),Vi("div",qQ,[Re("button",{onClick:Dt,class:"flex-1 glass-card border border-dark-border hover:border-primary rounded-[10px] px-6 py-3 text-dark-text hover:text-white transition-all duration-200"}," Cancel "),Re("button",{onClick:Gt,class:Xs(["flex-1 rounded-[10px] px-6 py-3 font-medium transition-all duration-200 shadow-lg",[pe.error&&re(pe.error)?"bg-secondary hover:bg-secondary/90 text-dark-bg hover:shadow-secondary/20":"bg-primary hover:bg-primary/90 text-dark-bg hover:shadow-primary/20"]])},aa(pe.error&&re(pe.error)?"Try Again":"Send Advertisement"),3)])):bs("",!0),pe.isSuccess?(zi(),Vi("div",ZQ," Closing automatically... ")):bs("",!0)])],2)])):bs("",!0)]))}}),GQ=ld($Q,[["__scopeId","data-v-a5eb8c7f"]]),YQ={},KQ={width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function XQ(d,l){return zi(),Vi("svg",KQ,l[0]||(l[0]=[Ff('',2)]))}const TO=ld(YQ,[["render",XQ]]),JQ={},QQ={width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function ttt(d,l){return zi(),Vi("svg",QQ,l[0]||(l[0]=[Ff('',9)]))}const AO=ld(JQ,[["render",ttt]]),ett={},rtt={width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function ntt(d,l){return zi(),Vi("svg",rtt,l[0]||(l[0]=[Ff('',2)]))}const MO=ld(ett,[["render",ntt]]),itt={},att={width:"11",height:"14",viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function ott(d,l){return zi(),Vi("svg",att,l[0]||(l[0]=[Re("path",{d:"M9.81633 1.99133L8.5085 0.683492C8.29229 0.466088 8.03511 0.293723 7.75185 0.176372C7.46859 0.059021 7.16486 -0.000985579 6.85825 -0.000175002H1.75C1.28587 -0.000175002 0.840752 0.184199 0.512563 0.512388C0.184375 0.840577 0 1.2857 0 1.74983V13.9998H10.5V3.64099C10.4985 3.02248 10.2528 2.4296 9.81633 1.99133ZM8.9915 2.81616C9.02083 2.84799 9.04829 2.88149 9.07375 2.91649H7.58333V1.42608C7.61834 1.45153 7.65184 1.479 7.68367 1.50833L8.9915 2.81616ZM1.16667 12.8332V1.74983C1.16667 1.59512 1.22812 1.44674 1.33752 1.33735C1.44692 1.22795 1.59529 1.16649 1.75 1.16649H6.41667V4.08316H9.33333V12.8332H1.16667ZM2.33333 9.33316H8.16667V5.83316H2.33333V9.33316ZM3.5 6.99983H7V8.16649H3.5V6.99983ZM2.33333 10.4998H8.16667V11.6665H2.33333V10.4998Z",fill:"white"},null,-1)]))}const SO=ld(itt,[["render",ott]]),stt={},ltt={width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function utt(d,l){return zi(),Vi("svg",ltt,l[0]||(l[0]=[Ff('',2)]))}const EO=ld(stt,[["render",utt]]),ctt={},htt={width:"11",height:"14",viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function ftt(d,l){return zi(),Vi("svg",htt,l[0]||(l[0]=[Re("path",{d:"M10.5 14.0004H9.33333V11.0586C9.33287 10.6013 9.15099 10.1628 8.82761 9.83942C8.50422 9.51603 8.06575 9.33415 7.60842 9.33369H2.89158C2.43425 9.33415 1.99578 9.51603 1.67239 9.83942C1.34901 10.1628 1.16713 10.6013 1.16667 11.0586V14.0004H0V11.0586C0.000926233 10.292 0.305872 9.55705 0.847948 9.01497C1.39002 8.47289 2.12497 8.16795 2.89158 8.16702H7.60842C8.37503 8.16795 9.10998 8.47289 9.65205 9.01497C10.1941 9.55705 10.4991 10.292 10.5 11.0586V14.0004Z",fill:"white"},null,-1),Re("path",{d:"M5.25 6.99997C4.55777 6.99997 3.88108 6.7947 3.30551 6.41011C2.72993 6.02553 2.28133 5.4789 2.01642 4.83936C1.75152 4.19982 1.6822 3.49609 1.81725 2.81716C1.9523 2.13822 2.28564 1.51458 2.77513 1.0251C3.26461 0.535614 3.88825 0.202271 4.56719 0.0672226C5.24612 -0.0678257 5.94985 0.00148598 6.58939 0.266393C7.22894 0.531299 7.77556 0.979903 8.16015 1.55548C8.54473 2.13105 8.75 2.80774 8.75 3.49997C8.74908 4.42794 8.38003 5.31765 7.72385 5.97382C7.06768 6.63 6.17798 6.99904 5.25 6.99997ZM5.25 1.16664C4.78851 1.16664 4.33739 1.30349 3.95367 1.55988C3.56996 1.81627 3.27089 2.18068 3.09428 2.60704C2.91768 3.0334 2.87147 3.50256 2.9615 3.95518C3.05153 4.4078 3.27376 4.82357 3.60009 5.14989C3.92641 5.47621 4.34217 5.69844 4.79479 5.78847C5.24741 5.8785 5.71657 5.83229 6.14293 5.65569C6.56929 5.47909 6.93371 5.18002 7.1901 4.7963C7.44649 4.41259 7.58334 3.96146 7.58334 3.49997C7.58334 2.88113 7.3375 2.28764 6.89992 1.85006C6.46233 1.41247 5.86884 1.16664 5.25 1.16664Z",fill:"white"},null,-1)]))}const CO=ld(ctt,[["render",ftt]]),dtt={},ptt={width:"11",height:"13",viewBox:"0 0 11 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function mtt(d,l){return zi(),Vi("svg",ptt,l[0]||(l[0]=[Re("path",{d:"M6.77889 9.16667H10.1122V12.5M4.11222 3.83333H0.77889V0.5M10.3906 4.50227C10.0168 3.57711 9.39097 2.77536 8.58423 2.18815C7.77749 1.60094 6.82233 1.25168 5.82707 1.18034C4.8318 1.109 3.83627 1.31827 2.95402 1.78441C2.07177 2.25055 1.3381 2.95503 0.836182 3.81742M0.500244 8.49805C0.874034 9.42321 1.49986 10.225 2.30661 10.8122C3.11335 11.3994 4.06948 11.7482 5.06474 11.8195C6.06001 11.8909 7.05473 11.6816 7.93697 11.2155C8.81922 10.7494 9.55239 10.045 10.0543 9.18262",stroke:"white","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]))}const gtt=ld(dtt,[["render",mtt]]),vtt={},ytt={width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function xtt(d,l){return zi(),Vi("svg",ytt,l[0]||(l[0]=[Ff('',2)]))}const _tt=ld(vtt,[["render",xtt]]),btt={class:"w-[285px] flex-shrink-0 p-[15px] hidden lg:block"},wtt={class:"glass-card h-full p-6"},ktt={class:"mb-12"},Ttt={class:"text-[#C3C3C3] text-sm"},Att=["title"],Mtt={class:"text-[#C3C3C3] text-sm mt-1"},Stt={class:"mb-8"},Ett={class:"mb-8"},Ctt={class:"space-y-2"},Ltt=["onClick"],Ptt={class:"mb-8"},ztt={class:"space-y-2"},Itt=["onClick"],Ott=["disabled"],Dtt={class:"flex items-center gap-3"},Ftt=["disabled"],Rtt={class:"flex items-center gap-3"},Btt={class:"mb-4"},Ntt={class:"flex items-center gap-2"},jtt={class:"glass-card px-2 py-1 text-dark-text text-xs font-medium rounded border border-dark-border"},Utt={class:"glass-card px-2 py-1 text-dark-text text-xs font-medium rounded border border-dark-border"},Vtt={key:0,class:"mb-4"},Htt={class:"text-dark-text text-xs mb-2"},Wtt={class:"text-white"},qtt={class:"w-full h-1 bg-white/10 rounded-full overflow-hidden"},Ztt={class:"flex items-center justify-between"},$tt={class:"flex items-center gap-2 text-dark-text text-xs"},Gtt={class:"flex items-center gap-2"},Ytt={href:"https://github.com/rightup",target:"_blank",class:"inline-block"},Ktt={href:"https://buymeacoffee.com/rightup",target:"_blank",class:"inline-block"},Xtt=Th({name:"SidebarNav",__name:"Sidebar",setup(d){const l=JI(),z=QI(),j=sv(),J=lo(!1),mt=lo(!1),kt=lo(!1),Dt=lo(!1),Gt=lo(!1),re=lo(null);let pe=null;t0(async()=>{pe=await j.startAutoRefresh(5e3)}),K2(()=>{pe&&pe()});const Ne={dashboard:AO,neighbors:CO,statistics:EO,configuration:TO,logs:SO,help:MO},or=[{name:"Dashboard",icon:"dashboard",route:"/"},{name:"Neighbors",icon:"neighbors",route:"/neighbors"},{name:"Statistics",icon:"statistics",route:"/statistics"},{name:"Configuration",icon:"configuration",route:"/configuration"},{name:"Logs",icon:"logs",route:"/logs"},{name:"Help",icon:"help",route:"/help"}],_r=Yo(()=>jn=>z.path===jn),Fr=jn=>{l.push(jn)},zr=async()=>{J.value=!0,re.value=null;try{await j.sendAdvert(),Gt.value=!0,setTimeout(()=>{Wr()},2e3)}catch(jn){re.value=jn instanceof Error?jn.message:"Unknown error occurred",console.error("Failed to send advert:",jn)}finally{J.value=!1}},Wr=()=>{Dt.value=!1,Gt.value=!1,re.value=null,J.value=!1},An=async()=>{if(!mt.value){mt.value=!0;try{await j.toggleMode()}catch(jn){console.error("Failed to toggle mode:",jn)}finally{mt.value=!1}}},Ft=async()=>{if(!kt.value){kt.value=!0;try{await j.toggleDutyCycle()}catch(jn){console.error("Failed to toggle duty cycle:",jn)}finally{kt.value=!1}}},kn=lo(new Date().toLocaleTimeString());setInterval(()=>{kn.value=new Date().toLocaleTimeString()},1e3);const ei=Yo(()=>{const jn=j.dutyCyclePercentage;let ai="#A5E5B6";return jn>90?ai="#FB787B":jn>70&&(ai="#FFC246"),{width:jn===0?"2px":`${Math.max(jn,2)}%`,backgroundColor:ai}});return(jn,ai)=>(zi(),Vi(Ou,null,[Re("aside",btt,[Re("div",wtt,[Re("div",ktt,[ai[1]||(ai[1]=Re("h1",{class:"text-white text-[22px] font-bold mb-2"},"pyMC Repeater",-1)),Re("p",Ttt,[nc(aa(Ju(j).nodeName)+" ",1),Re("span",{class:Xs(["inline-block w-2 h-2 rounded-full ml-2",Ju(j).statusBadge.text==="Active"?"bg-accent-green":Ju(j).statusBadge.text==="Monitor Mode"?"bg-secondary":"bg-accent-red"]),title:Ju(j).statusBadge.title},null,10,Att)]),Re("p",Mtt,"<"+aa(Ju(j).pubKey)+">",1)]),ai[10]||(ai[10]=Re("div",{class:"border-t border-dark-border mb-6"},null,-1)),Re("div",Stt,[ai[3]||(ai[3]=Re("p",{class:"text-dark-text text-xs uppercase mb-4"},"Actions",-1)),Re("button",{onClick:ai[0]||(ai[0]=Qi=>Dt.value=!0),class:"w-full bg-white rounded-[10px] py-3 px-4 flex items-center gap-2 text-sm font-medium text-[#212122] hover:bg-gray-100 transition-colors"},ai[2]||(ai[2]=[Re("svg",{class:"w-3.5 h-3.5",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[Re("path",{d:"M7 0C5.61553 0 4.26216 0.410543 3.11101 1.17971C1.95987 1.94888 1.06266 3.04213 0.532846 4.32122C0.003033 5.6003 -0.13559 7.00777 0.134506 8.36563C0.404603 9.7235 1.07129 10.9708 2.05026 11.9497C3.02922 12.9287 4.2765 13.5954 5.63437 13.8655C6.99224 14.1356 8.3997 13.997 9.67879 13.4672C10.9579 12.9373 12.0511 12.0401 12.8203 10.889C13.5895 9.73785 14 8.38447 14 7C13.998 5.1441 13.2599 3.36479 11.9475 2.05247C10.6352 0.74015 8.8559 0.0020073 7 0V0ZM7 12.8333C5.84628 12.8333 4.71846 12.4912 3.75918 11.8502C2.79989 11.2093 2.05222 10.2982 1.61071 9.23232C1.16919 8.16642 1.05368 6.99353 1.27876 5.86197C1.50384 4.73042 2.05941 3.69102 2.87521 2.87521C3.69102 2.0594 4.73042 1.50383 5.86198 1.27875C6.99353 1.05367 8.16642 1.16919 9.23232 1.6107C10.2982 2.05221 11.2093 2.79989 11.8502 3.75917C12.4912 4.71846 12.8333 5.84628 12.8333 7C12.8316 8.54658 12.2165 10.0293 11.1229 11.1229C10.0293 12.2165 8.54658 12.8316 7 12.8333ZM8.16667 7C8.1676 7.20501 8.11448 7.40665 8.01268 7.58461C7.91087 7.76256 7.76397 7.91054 7.58677 8.01365C7.40957 8.11676 7.20833 8.17136 7.00332 8.17194C6.7983 8.17252 6.59675 8.11906 6.41897 8.01696C6.24119 7.91485 6.09346 7.7677 5.99065 7.59033C5.88784 7.41295 5.83358 7.21162 5.83335 7.0066C5.83312 6.80159 5.88691 6.60013 5.98932 6.42252C6.09172 6.24491 6.23912 6.09743 6.41667 5.99492V3.5H7.58334V5.99492C7.76016 6.09659 7.90713 6.24298 8.00952 6.41939C8.1119 6.5958 8.1661 6.79603 8.16667 7Z",fill:"#212122"})],-1),nc(" Send Advert ",-1)]))]),Re("div",Ett,[ai[4]||(ai[4]=Re("p",{class:"text-dark-text text-xs uppercase mb-4"},"Monitoring",-1)),Re("div",Ctt,[(zi(!0),Vi(Ou,null,sf(or.slice(0,3),Qi=>(zi(),Vi("button",{key:Qi.name,onClick:Gi=>Fr(Qi.route),class:Xs([_r.value(Qi.route)?"bg-primary/20 shadow-[0_0_6px_0_rgba(170,232,232,0.20)] text-primary":"text-white hover:bg-white/5","w-full rounded-[10px] py-3 px-4 flex items-center gap-3 text-sm transition-all"])},[(zi(),hm(a4(Ne[Qi.icon]),{class:"w-3.5 h-3.5"})),nc(" "+aa(Qi.name),1)],10,Ltt))),128))])]),Re("div",Ptt,[ai[5]||(ai[5]=Re("p",{class:"text-dark-text text-xs uppercase mb-4"},"System",-1)),Re("div",ztt,[(zi(!0),Vi(Ou,null,sf(or.slice(3),Qi=>(zi(),Vi("button",{key:Qi.name,onClick:Gi=>Fr(Qi.route),class:Xs([_r.value(Qi.route)?"bg-primary/20 shadow-[0_0_6px_0_rgba(170,232,232,0.20)] text-primary":"text-white hover:bg-white/5","w-full rounded-[10px] py-3 px-4 flex items-center gap-3 text-sm transition-all"])},[(zi(),hm(a4(Ne[Qi.icon]),{class:"w-3.5 h-3.5"})),nc(" "+aa(Qi.name),1)],10,Itt))),128))])]),gu(TQ,{"current-value":Ju(j).noiseFloorDbm||-116,"update-interval":3e3,class:"mb-6"},null,8,["current-value"]),Re("button",{onClick:An,disabled:mt.value,class:Xs(["p-4 flex items-center justify-between mb-4 w-full transition-all duration-200 cursor-pointer group",Ju(j).modeButtonState.warning?"glass-card-orange hover:bg-accent-red/10":"glass-card-green hover:bg-accent-green/10"])},[Re("div",Dtt,[gu(gtt,{class:"w-4 h-4 text-white group-hover:text-primary transition-colors"}),ai[6]||(ai[6]=Re("span",{class:"text-white text-sm group-hover:text-primary transition-colors"},"Mode",-1))]),Re("span",{class:Xs(["text-xs font-medium group-hover:text-white transition-colors",Ju(j).modeButtonState.warning?"text-accent-red":"text-accent-green"])},aa(mt.value?"Changing...":Ju(j).currentMode.charAt(0).toUpperCase()+Ju(j).currentMode.slice(1)),3)],10,Ott),Re("button",{onClick:Ft,disabled:kt.value,class:Xs(["p-4 flex items-center justify-between mb-4 w-full transition-all duration-200 cursor-pointer group",Ju(j).dutyCycleButtonState.warning?"glass-card-orange hover:bg-accent-red/10":"glass-card-green hover:bg-accent-green/10"])},[Re("div",Rtt,[gu(_tt,{class:"w-3.5 h-3.5 text-white group-hover:text-primary transition-colors"}),ai[7]||(ai[7]=Re("span",{class:"text-white text-sm group-hover:text-primary transition-colors"},"Duty Cycle",-1))]),Re("span",{class:Xs(["text-xs font-medium group-hover:text-white transition-colors",Ju(j).dutyCycleButtonState.warning?"text-accent-red":"text-primary"])},aa(kt.value?"Changing...":Ju(j).dutyCycleEnabled?"Enabled":"Disabled"),3)],10,Ftt),Re("div",Btt,[Re("div",Ntt,[Re("span",jtt," R:v"+aa(Ju(j).version),1),Re("span",Utt," C:v"+aa(Ju(j).coreVersion),1)])]),ai[11]||(ai[11]=Re("div",{class:"border-t border-accent-green mb-4"},null,-1)),Ju(j).dutyCycleEnabled?(zi(),Vi("div",Vtt,[Re("p",Htt,[ai[8]||(ai[8]=nc(" Duty Cycle: ",-1)),Re("span",Wtt,aa(Ju(j).dutyCycleUtilization.toFixed(1))+"% / "+aa(Ju(j).dutyCycleMax.toFixed(1))+"%",1)]),Re("div",qtt,[Re("div",{class:"h-full rounded-full transition-all duration-300",style:av(ei.value)},null,4)])])):bs("",!0),Re("div",Ztt,[Re("div",$tt,[ai[9]||(ai[9]=Re("svg",{class:"w-3 h-3",viewBox:"0 0 13 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[Re("path",{d:"M6.5 13C5.59722 13 4.75174 12.8286 3.96355 12.4858C3.17537 12.143 2.48926 11.6795 1.90522 11.0955C1.32119 10.5115 0.85776 9.82535 0.514945 9.03717C0.172131 8.24898 0.000482491 7.40326 1.0101e-06 6.5C-0.000480471 5.59674 0.171168 4.75126 0.514945 3.96356C0.858723 3.17585 1.32191 2.48974 1.9045 1.90522C2.48709 1.3207 3.1732 0.857278 3.96283 0.514944C4.75246 0.172611 5.59818 0.000962963 6.5 0C7.48703 0 8.42303 0.210648 9.30799 0.631944C10.193 1.05324 10.9421 1.64907 11.5555 2.41944V1.44444C11.5555 1.23981 11.6249 1.06841 11.7635 0.930222C11.9022 0.792037 12.0736 0.722704 12.2778 0.722222C12.4819 0.721741 12.6536 0.791074 12.7927 0.930222C12.9319 1.06937 13.001 1.24078 13 1.44444V4.33333C13 4.53796 12.9307 4.70961 12.792 4.84828C12.6533 4.98694 12.4819 5.05604 12.2778 5.05556H9.38888C9.18425 5.05556 9.01285 4.98622 8.87466 4.84756C8.73647 4.70889 8.66714 4.53748 8.66666 4.33333C8.66618 4.12919 8.73551 3.95778 8.87466 3.81911C9.01381 3.68044 9.18521 3.61111 9.38888 3.61111H10.6528C10.1593 2.93704 9.55138 2.40741 8.82916 2.02222C8.10694 1.63704 7.33055 1.44444 6.5 1.44444C5.09166 1.44444 3.89711 1.93507 2.91633 2.91633C1.93555 3.89759 1.44493 5.09215 1.44444 6.5C1.44396 7.90785 1.93459 9.10265 2.91633 10.0844C3.89807 11.0661 5.09263 11.5565 6.5 11.5556C7.64351 11.5556 8.66666 11.2125 9.56944 10.5264C10.4722 9.84028 11.068 8.95555 11.3569 7.87222C11.4171 7.67963 11.5255 7.53519 11.6819 7.43889C11.8384 7.34259 12.013 7.30648 12.2055 7.33055C12.4102 7.35463 12.5727 7.44178 12.693 7.592C12.8134 7.74222 12.8495 7.90785 12.8014 8.08889C12.4523 9.5213 11.694 10.698 10.5264 11.6191C9.35879 12.5402 8.01666 13.0005 6.5 13ZM7.22222 6.21111L9.02777 8.01667C9.16018 8.14907 9.22638 8.31759 9.22638 8.52222C9.22638 8.72685 9.16018 8.89537 9.02777 9.02778C8.89536 9.16018 8.72685 9.22639 8.52222 9.22639C8.31759 9.22639 8.14907 9.16018 8.01666 9.02778L5.99444 7.00556C5.92222 6.93333 5.86805 6.8522 5.83194 6.76217C5.79583 6.67213 5.77777 6.57872 5.77777 6.48194V3.61111C5.77777 3.40648 5.84711 3.23507 5.98577 3.09689C6.12444 2.9587 6.29585 2.88937 6.5 2.88889C6.70414 2.88841 6.87579 2.95774 7.01494 3.09689C7.15409 3.23604 7.22318 3.40744 7.22222 3.61111V6.21111Z",fill:"currentColor"})],-1)),nc(" Last Updated: "+aa(kn.value),1)]),Re("div",Gtt,[Re("a",Ytt,[gu(cQ,{class:"w-4 h-4 text-dark-text hover:text-white transition-colors"})]),Re("a",Ktt,[gu(pQ,{class:"w-4 h-4 text-dark-text hover:text-white transition-colors"})])])])])]),gu(GQ,{isOpen:Dt.value,isLoading:J.value,isSuccess:Gt.value,error:re.value,onClose:Wr,onSend:zr},null,8,["isOpen","isLoading","isSuccess","error"])],64))}}),Jtt={key:0,class:"fixed inset-0 z-40 lg:hidden"},Qtt={class:"absolute left-0 top-0 bottom-0 w-72 p-4"},tet={class:"glass-card h-full p-6 overflow-auto"},eet={class:"mb-4"},ret={class:"space-y-2 mb-3"},net=["onClick"],iet={class:"mb-4"},aet={class:"space-y-2 mb-3"},oet=["onClick"],set=Th({name:"MobileSidebar",__name:"MobileSidebar",props:{showMobileSidebar:{type:Boolean}},emits:["update:showMobileSidebar"],setup(d,{emit:l}){const z=l,j=JI(),J=QI(),mt={dashboard:AO,neighbors:CO,statistics:EO,configuration:TO,logs:SO,help:MO},kt=[{name:"Dashboard",icon:"dashboard",route:"/"},{name:"Neighbors",icon:"neighbors",route:"/neighbors"},{name:"Statistics",icon:"statistics",route:"/statistics"},{name:"Configuration",icon:"configuration",route:"/configuration"},{name:"Logs",icon:"logs",route:"/logs"},{name:"Help",icon:"help",route:"/help"}],Dt=pe=>J.path===pe,Gt=pe=>{j.push(pe),re()},re=()=>{z("update:showMobileSidebar",!1)};return(pe,Ne)=>pe.showMobileSidebar?(zi(),Vi("div",Jtt,[Re("div",{class:"absolute inset-0 bg-black/50",onClick:re}),Re("div",Qtt,[Re("div",tet,[Re("div",{class:"mb-6 flex items-center justify-between"},[Ne[0]||(Ne[0]=Re("div",null,[Re("h1",{class:"text-white text-[20px] font-bold"},"pyMC Repeater"),Re("p",{class:"text-[#C3C3C3] text-sm"},[nc("phenix-rep56 "),Re("span",{class:"inline-block w-2 h-2 rounded-full bg-[#95F3AE] ml-2"})])],-1)),Re("button",{onClick:re,class:"text-dark-text"},"✕")]),Ne[5]||(Ne[5]=Re("div",{class:"border-t border-dark-border mb-4"},null,-1)),Re("div",null,[Ne[3]||(Ne[3]=Ff('

pyMC Repeater

phenix-rep56

<94eib04...4563ghbjbjn>

Actions

',3)),Re("div",eet,[Ne[1]||(Ne[1]=Re("p",{class:"text-dark-text text-xs uppercase mb-2"},"Monitoring",-1)),Re("div",ret,[(zi(!0),Vi(Ou,null,sf(kt.slice(0,3),or=>(zi(),Vi("button",{key:or.name,onClick:_r=>Gt(or.route),class:Xs([Dt(or.route)?"bg-primary/20 shadow-[0_0_6px_0_rgba(170,232,232,0.20)] text-primary":"text-white hover:bg-white/5","w-full rounded-[10px] py-3 px-4 flex items-center gap-3 text-sm transition-all"])},[(zi(),hm(a4(mt[or.icon]),{class:"w-3.5 h-3.5"})),nc(" "+aa(or.name),1)],10,net))),128))])]),Re("div",iet,[Ne[2]||(Ne[2]=Re("p",{class:"text-dark-text text-xs uppercase mb-2"},"System",-1)),Re("div",aet,[(zi(!0),Vi(Ou,null,sf(kt.slice(3),or=>(zi(),Vi("button",{key:or.name,onClick:_r=>Gt(or.route),class:Xs([Dt(or.route)?"bg-primary/20 shadow-[0_0_6px_0_rgba(170,232,232,0.20)] text-primary":"text-white hover:bg-white/5","w-full rounded-[10px] py-3 px-4 flex items-center gap-3 text-sm transition-all"])},[(zi(),hm(a4(mt[or.icon]),{class:"w-3.5 h-3.5"})),nc(" "+aa(or.name),1)],10,oet))),128))])]),Ne[4]||(Ne[4]=Ff('

RF NOISE FLOOR

-116.0dbm
Mode
Forward
Duty Cycle
Enabled
ActiveVl.0.2

Duty Cycle: 0.0% / 6.0%

Last Updated: 18:55:24

',7))])])])])):bs("",!0)}}),uet={class:"glass-card p-6 mb-5 rounded-[20px] relative z-10"},cet={class:"flex flex-col lg:flex-row lg:items-center lg:justify-between gap-4"},het={class:"flex items-center gap-3"},fet={class:"text-right mr-4"},det={key:0,class:"flex items-center gap-2"},pet={key:1,class:"space-y-1"},met={class:"text-dark-text text-sm"},get={class:"text-primary font-medium"},vet={key:0,class:"text-xs text-dark-text/80"},yet={key:0},xet={key:1,class:"text-xs text-dark-text/60"},_et={key:2},bet={key:0,class:"text-xs text-dark-text/60"},wet=["disabled"],ket={class:"flex items-center justify-between mb-3"},Tet={class:"flex items-center gap-2"},Aet=["disabled"],Met=["disabled"],Eet={class:"space-y-3 text-sm"},Cet={key:0,class:"bg-[#0B1014] p-3 rounded-lg border border-accent-red/30 border-l-2 border-l-accent-red"},Let={class:"flex items-center justify-between"},Pet={class:"text-accent-red font-bold"},zet={class:"text-xs text-gray-400 mt-1"},Iet={key:1,class:"bg-[#0B1014] p-3 rounded-lg border border-white/10 border-l-2 border-l-accent-green"},Oet={class:"flex items-center justify-between"},Det={class:"text-accent-green font-bold"},Fet={key:0,class:"text-xs text-gray-400 mt-1"},Ret={key:2,class:"bg-[#0B1014] p-3 rounded-lg border border-white/10"},Bet={key:3,class:"bg-[#0B1014] p-3 rounded-lg border border-accent-red/30 border-l-2 border-l-accent-red"},Net={class:"text-xs text-gray-400"},jet={class:"bg-[#0B1014] p-3 rounded-lg border border-white/10 border-l-2 border-l-primary"},Uet={class:"flex items-center justify-between"},Vet={class:"text-primary font-bold"},Het={key:0,class:"text-xs text-gray-400 mt-1"},Wet={class:"flex items-center justify-between"},qet={class:"text-white font-medium"},Zet={key:0,class:"mt-2"},$et={class:"text-xs text-gray-400"},Get={class:"text-gray-300"},Yet={key:4,class:"bg-[#0B1014] p-4 rounded-lg border border-white/10 text-center"},Ket={key:5,class:"bg-[#0B1014] p-3 rounded-lg border border-white/10 text-center"},Xet=Th({name:"TopBar",__name:"TopBar",emits:["toggleMobileSidebar"],setup(d,{emit:l}){const z=l,j=sv(),J=lo(!1),mt=lo(null),kt=lo({hasUpdate:!1,currentVersion:"",latestVersion:"",isChecking:!1,lastChecked:null,error:null}),Dt=lo({}),Gt=lo(!0),re=lo(null),pe=["Chat Node","Repeater","Room Server"];function Ne(Gi){const un=Gi.target;mt.value&&!mt.value.contains(un)&&(J.value=!1)}const or=async()=>{try{Gt.value=!0;const Gi={};for(const un of pe)try{const ia=await Xh.get(`/adverts_by_contact_type?contact_type=${encodeURIComponent(un)}&hours=168`);ia.success&&Array.isArray(ia.data)?Gi[un]=ia.data:Gi[un]=[]}catch(ia){console.error(`Error fetching ${un} nodes:`,ia),Gi[un]=[]}Dt.value=Gi,re.value=new Date}catch(Gi){console.error("Error updating tracked nodes:",Gi)}finally{Gt.value=!1}},_r=async()=>{if(!kt.value.isChecking)try{kt.value.isChecking=!0,kt.value.error=null,await j.fetchStats();const Gi=j.version;if(!Gi||Gi==="Unknown"){kt.value.error="Unable to determine current version";return}const ia=await fetch("https://raw.githubusercontent.com/rightup/pyMC_Repeater/main/repeater/__init__.py");if(!ia.ok)throw new Error(`GitHub request failed: ${ia.status}`);const Li=(await ia.text()).match(/__version__\s*=\s*["']([^"']+)["']/);if(!Li)throw new Error("Could not parse version from GitHub file");const yi=Li[1];kt.value.currentVersion=Gi,kt.value.latestVersion=yi,kt.value.lastChecked=new Date,kt.value.hasUpdate=Gi!==yi}catch(Gi){console.error("Error checking for updates:",Gi),kt.value.error=Gi instanceof Error?Gi.message:"Failed to check for updates"}finally{kt.value.isChecking=!1}},Fr=Yo(()=>Object.values(Dt.value).reduce((un,ia)=>un+ia.length,0)),zr=Yo(()=>pe.map(un=>({type:un,count:Dt.value[un]?.length||0})).filter(un=>un.count>0)),Wr=Yo(()=>kt.value.hasUpdate||Fr.value>0),An=Gi=>({"Chat Node":"text-blue-400",Repeater:"text-accent-green","Room Server":"text-accent-purple"})[Gi]||"text-gray-400",Ft=Gi=>{const un=Dt.value[Gi]||[];return un.length===0?"None":un.reduce((fa,Li)=>Li.last_seen>fa.last_seen?Li:fa,un[0]).node_name||"Unknown Node"};let kn=null,ei=null;const jn=()=>{kn&&clearInterval(kn),kn=setInterval(()=>{or()},3e4),ei&&clearInterval(ei),ei=setInterval(()=>{_r()},6e5)},ai=()=>{kn&&(clearInterval(kn),kn=null),ei&&(clearInterval(ei),ei=null)};t0(()=>{document.addEventListener("click",Ne),or(),_r(),jn()}),dg(()=>{document.removeEventListener("click",Ne),ai()});const Qi=()=>{z("toggleMobileSidebar")};return(Gi,un)=>(zi(),Vi("div",uet,[Re("div",cet,[Re("div",{class:"flex items-center gap-3"},[Re("button",{onClick:Qi,class:"lg:hidden w-10 h-10 rounded bg-[#1A1E1F] flex items-center justify-center hover:bg-[#2A2E2F] transition-colors"},un[2]||(un[2]=[Re("svg",{class:"w-5 h-5 text-white",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[Re("path",{d:"M3 6h14M3 10h14M3 14h14",stroke:"white","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])),un[3]||(un[3]=Re("div",null,[Re("h1",{class:"text-white text-[35px] font-bold mb-2"},"Welcome👋")],-1))]),Re("div",het,[Re("div",fet,[Gt.value?(zi(),Vi("div",det,un[4]||(un[4]=[Re("div",{class:"animate-spin rounded-full h-3 w-3 border-b-2 border-primary"},null,-1),Re("p",{class:"text-dark-text text-sm"},"Loading tracking data...",-1)]))):Fr.value>0?(zi(),Vi("div",pet,[Re("p",met,[un[5]||(un[5]=nc(" Tracking: ",-1)),Re("span",get,aa(Fr.value)+" node"+aa(Fr.value===1?"":"s"),1)]),zr.value.length>1?(zi(),Vi("div",vet,[(zi(!0),Vi(Ou,null,sf(zr.value,(ia,fa)=>(zi(),Vi("span",{key:ia.type,class:"inline"},[nc(aa(ia.count)+" "+aa(ia.type)+aa(ia.count===1?"":"s"),1),faJ.value=!J.value,["stop"])),class:"w-[35px] h-[35px] rounded bg-[#1A1E1F] flex items-center justify-center hover:bg-[#2A2E2F] transition-colors relative"},[un[8]||(un[8]=Re("svg",{class:"w-5 h-5",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[Re("path",{d:"M12.5 14.1667V15C12.5 16.3807 11.3807 17.5 9.99998 17.5C8.61927 17.5 7.49998 16.3807 7.49998 15V14.1667M12.5 14.1667L7.49998 14.1667M12.5 14.1667H15.8333C16.2936 14.1667 16.6666 13.7936 16.6666 13.3333V12.845C16.6666 12.624 16.5788 12.4122 16.4225 12.2559L15.9969 11.8302C15.8921 11.7255 15.8333 11.5833 15.8333 11.4351V8.33333C15.8333 8.1863 15.828 8.04045 15.817 7.89674M7.49998 14.1667L4.16665 14.1668C3.70641 14.1668 3.33331 13.7934 3.33331 13.3332V12.8451C3.33331 12.6241 3.42118 12.4124 3.57745 12.2561L4.00307 11.8299C4.10781 11.7251 4.16665 11.5835 4.16665 11.4353V8.33331C4.16665 5.11167 6.77831 2.5 9.99998 2.5C10.593 2.5 11.1653 2.58848 11.7045 2.75297M15.817 7.89674C16.8223 7.32275 17.5 6.24051 17.5 5C17.5 3.15905 16.0076 1.66666 14.1666 1.66666C13.1914 1.66666 12.3141 2.08544 11.7045 2.75297M15.817 7.89674C15.3304 8.17457 14.7671 8.33333 14.1666 8.33333C12.3257 8.33333 10.8333 6.84095 10.8333 5C10.8333 4.13425 11.1634 3.34558 11.7045 2.75297M15.817 7.89674C15.817 7.89674 15.817 7.89675 15.817 7.89674ZM11.7045 2.75297C11.7049 2.75309 11.7053 2.75321 11.7057 2.75333",stroke:"white","stroke-linecap":"round","stroke-linejoin":"round"})],-1)),Wr.value?(zi(),Vi("span",{key:0,class:Xs(["absolute top-2 right-2 w-2 h-2 rounded-full",kt.value.hasUpdate?"bg-accent-red animate-pulse":"bg-primary"])},null,2)):bs("",!0)]),J.value?(zi(),Vi("div",{key:0,ref_key:"notifRef",ref:mt,class:"absolute right-6 top-14 z-[100] w-80 bg-[#1A1E1F] border border-white/20 rounded-[15px] p-4 shadow-2xl backdrop-blur-sm",onClick:un[1]||(un[1]=hg(()=>{},["stop"]))},[Re("div",ket,[un[10]||(un[10]=Re("p",{class:"text-white font-semibold"},"System Status",-1)),Re("div",Tet,[Re("button",{onClick:_r,disabled:kt.value.isChecking,class:"text-xs text-primary hover:text-primary/80 disabled:opacity-50",title:"Check for updates"},aa(kt.value.isChecking?"Checking...":"Check Updates"),9,Aet),un[9]||(un[9]=Re("span",{class:"text-dark-text text-xs"},"•",-1)),Re("button",{onClick:or,disabled:Gt.value,class:"text-xs text-primary hover:text-primary/80 disabled:opacity-50"},aa(Gt.value?"Updating...":"Refresh"),9,Met)])]),Re("div",Eet,[kt.value.hasUpdate?(zi(),Vi("div",Cet,[Re("div",Let,[un[11]||(un[11]=Re("span",{class:"text-white font-medium"},"Update Available",-1)),Re("span",Pet,aa(kt.value.latestVersion),1)]),Re("div",zet," Current: "+aa(kt.value.currentVersion),1),un[12]||(un[12]=Re("div",{class:"text-xs text-gray-300 mt-2"},[Re("a",{href:"https://github.com/rightup/pyMC_Repeater",target:"_blank",class:"text-accent-red hover:text-accent-red/80 underline"}," Goto Github→ ")],-1))])):kt.value.currentVersion&&!kt.value.isChecking?(zi(),Vi("div",Iet,[Re("div",Oet,[un[13]||(un[13]=Re("span",{class:"text-white font-medium"},"Up to Date",-1)),Re("span",Det,aa(kt.value.currentVersion),1)]),kt.value.lastChecked?(zi(),Vi("div",Fet," Last checked: "+aa(kt.value.lastChecked.toLocaleTimeString()),1)):bs("",!0)])):kt.value.isChecking?(zi(),Vi("div",Ret,un[14]||(un[14]=[Re("div",{class:"flex items-center justify-center gap-2"},[Re("div",{class:"animate-spin rounded-full h-4 w-4 border-b-2 border-primary"}),Re("span",{class:"text-gray-300"},"Checking for updates...")],-1)]))):kt.value.error?(zi(),Vi("div",Bet,[un[15]||(un[15]=Re("div",{class:"text-white font-medium mb-1"},"Update Check Failed",-1)),Re("div",Net,aa(kt.value.error),1)])):bs("",!0),un[20]||(un[20]=Re("div",{class:"border-t border-white/10"},null,-1)),un[21]||(un[21]=Re("div",{class:"text-white font-medium text-sm mb-2"},"Mesh Network Status",-1)),Re("div",jet,[Re("div",Uet,[un[16]||(un[16]=Re("span",{class:"text-white font-medium"},"Total Tracked Nodes",-1)),Re("span",Vet,aa(Fr.value),1)]),re.value?(zi(),Vi("div",Het," Last updated: "+aa(re.value.toLocaleString()),1)):bs("",!0)]),(zi(!0),Vi(Ou,null,sf(zr.value,ia=>(zi(),Vi("div",{key:ia.type,class:"bg-[#0B1014] p-3 rounded-lg border border-white/10"},[Re("div",Wet,[Re("span",qet,aa(ia.type)+aa(ia.count===1?"":"s"),1),Re("span",{class:Xs([An(ia.type),"font-bold"])},aa(ia.count),3)]),Dt.value[ia.type]?.length>0?(zi(),Vi("div",Zet,[Re("div",$et,[un[17]||(un[17]=nc(" Latest: ",-1)),Re("span",Get,aa(Ft(ia.type)),1)])])):bs("",!0)]))),128)),Fr.value===0&&!Gt.value?(zi(),Vi("div",Yet,un[18]||(un[18]=[Re("div",{class:"text-gray-400"},[Re("svg",{class:"w-8 h-8 mx-auto mb-2 opacity-50",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9.172 16.172a4 4 0 015.656 0M9 12h6m-6-4h6m2 5.291A7.962 7.962 0 0112 15c-2.034 0-3.9.785-5.291 2.09M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]),Re("span",null,"No mesh nodes detected")],-1)]))):bs("",!0),Gt.value?(zi(),Vi("div",Ket,un[19]||(un[19]=[Re("div",{class:"flex items-center justify-center gap-2"},[Re("div",{class:"animate-spin rounded-full h-4 w-4 border-b-2 border-primary"}),Re("span",{class:"text-gray-300"},"Scanning mesh network...")],-1)]))):bs("",!0)])],512)):bs("",!0)])])]))}}),Jet=ld(Xet,[["__scopeId","data-v-0a06f286"]]),Qet={class:"min-h-screen bg-dark-bg overflow-hidden relative font-sans"},trt={class:"relative flex min-h-screen"},ert={class:"flex-1 p-4 lg:p-[15px] overflow-y-auto"},rrt=Th({name:"DashboardLayout",__name:"DashboardLayout",setup(d){const l=lo(!1),z=()=>{l.value=!l.value},j=()=>{l.value=!1};return(J,mt)=>{const kt=UA("router-view");return zi(),Vi("div",Qet,[mt[1]||(mt[1]=Re("div",{class:"absolute rounded-full -rotate-[24.22deg] w-[705px] h-[512px] bg-gradient-to-b from-cyan-400/25 to-cyan-200/10 blur-[120px] opacity-80 -top-[79px] left-[575px] mix-blend-screen pointer-events-none"},null,-1)),mt[2]||(mt[2]=Re("div",{class:"absolute rounded-full -rotate-[24.22deg] w-[705px] h-[512px] bg-gradient-to-b from-cyan-400/25 to-cyan-200/10 blur-[120px] opacity-75 -top-[94px] -left-[92px] mix-blend-screen pointer-events-none"},null,-1)),mt[3]||(mt[3]=Re("div",{class:"absolute rounded-full -rotate-[24.22deg] w-[705px] h-[512px] bg-gradient-to-b from-cyan-400/25 to-cyan-200/10 blur-[120px] opacity-80 top-[373px] left-[246px] mix-blend-screen pointer-events-none"},null,-1)),Re("div",trt,[gu(Xtt,{class:"hidden lg:block"}),gu(set,{showMobileSidebar:l.value,"onUpdate:showMobileSidebar":mt[0]||(mt[0]=Dt=>l.value=Dt),onClose:j},null,8,["showMobileSidebar"]),Re("main",ert,[gu(Jet,{onToggleMobileSidebar:z}),gu(kt)])])])}}}),nrt=Th({__name:"App",setup(d){return(l,z)=>(zi(),hm(rrt))}}),irt={class:"sparkline-container"},art={class:"text-white text-sm font-semibold mb-4"},ort={class:"flex items-end gap-4"},srt=["id","width","height","viewBox"],lrt=["id"],urt=["stop-color"],crt=["stop-color"],hrt=["d","fill"],frt=["d","stroke"],drt=["cx","cy","fill"],prt=Th({name:"SparklineChart",__name:"Sparkline",props:{title:{},value:{},color:{},data:{default:()=>[]},width:{default:131},height:{default:37},animate:{type:Boolean,default:!0},showChart:{type:Boolean,default:!0}},setup(d){const l=d,z=Yo(()=>{if(l.data&&l.data.length>0)return l.data;const kt=typeof l.value=="number"?l.value:10,Dt=20,Gt=kt*.3;return Array.from({length:Dt},(re,pe)=>{const Ne=Math.sin(pe/Dt*Math.PI*2)*Gt*.5,or=(Math.random()-.5)*Gt*.3;return Math.max(0,kt+Ne+or)})}),j=Yo(()=>{const kt=z.value;if(kt.length<2)return"";const Dt=Math.max(...kt),Gt=Math.min(...kt),re=Dt-Gt||1,pe=l.width/(kt.length-1);let Ne="";return kt.forEach((or,_r)=>{const Fr=_r*pe,zr=l.height-(or-Gt)/re*l.height;if(_r===0)Ne+=`M ${Fr} ${zr}`;else{const An=((_r-1)*pe+Fr)/2;Ne+=` Q ${An} ${zr} ${Fr} ${zr}`}}),Ne}),J=lo("");t0(()=>{J.value=j.value}),um(()=>l.data,(kt,Dt)=>{const Gt=!Dt||kt.length!==Dt.length||Math.abs(kt.length-Dt.length)>5;l.animate&&Gt?(J.value="",setTimeout(()=>{J.value=j.value},50)):J.value=j.value});const mt=Yo(()=>`sparkline-${l.title.replace(/\s+/g,"-").toLowerCase()}`);return(kt,Dt)=>(zi(),Vi("div",irt,[Re("p",art,aa(kt.title),1),Re("div",ort,[Re("span",{class:"text-[30px] font-bold",style:av({color:kt.color})},[nc(aa(kt.value),1),qG(kt.$slots,"unit",{},void 0)],4),kt.showChart?(zi(),Vi("svg",{key:0,id:mt.value,class:"mb-3 sparkline-svg",width:kt.width,height:kt.height,viewBox:`0 0 ${kt.width} ${kt.height}`,fill:"none",xmlns:"http://www.w3.org/2000/svg"},[Re("defs",null,[Re("linearGradient",{id:`gradient-${mt.value}`,x1:"0%",y1:"0%",x2:"0%",y2:"100%"},[Re("stop",{offset:"0%","stop-color":kt.color,"stop-opacity":"0.3"},null,8,urt),Re("stop",{offset:"100%","stop-color":kt.color,"stop-opacity":"0.1"},null,8,crt)],8,lrt)]),Re("path",{d:`${J.value} L ${kt.width} ${kt.height} L 0 ${kt.height} Z`,fill:`url(#gradient-${mt.value})`,class:"sparkline-fill"},null,8,hrt),Re("path",{d:J.value,stroke:kt.color,"stroke-width":"2",fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:Xs(["sparkline-path",{"animate-draw":kt.animate}])},null,10,frt),z.value.length>0?(zi(),Vi("circle",{key:0,cx:kt.width,cy:kt.height-(z.value[z.value.length-1]-Math.min(...z.value))/(Math.max(...z.value)-Math.min(...z.value)||1)*kt.height,r:"2",fill:kt.color,class:Xs(["sparkline-dot",{"animate-pulse":kt.animate}])},null,10,drt)):bs("",!0)],8,srt)):bs("",!0)])]))}}),r_=ld(prt,[["__scopeId","data-v-574bf55e"]]),mrt={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-5"},grt=Th({name:"StatsCards",__name:"StatsCards",setup(d){const l=rw(),z=lo(null),j=Yo(()=>{const kt=l.packetStats,Dt=l.systemStats,Gt=re=>{const pe=Math.floor(re/86400),Ne=Math.floor(re%86400/3600),or=Math.floor(re%3600/60);return pe>0?`${pe}d ${Ne}h`:Ne>0?`${Ne}h ${or}m`:`${or}m`};return{packetsReceived:kt?.total_packets||0,packetsForwarded:kt?.transmitted_packets||0,uptimeFormatted:Dt?Gt(Dt.uptime_seconds||0):"0m",uptimeHours:Dt?Math.floor((Dt.uptime_seconds||0)/3600):0,droppedPackets:kt?.dropped_packets||0,signalQuality:Math.round((kt?.avg_rssi||0)+120)}}),J=Yo(()=>l.sparklineData),mt=async()=>{try{await Promise.all([l.fetchSystemStats(),l.fetchPacketStats({hours:24})])}catch(kt){console.error("Error fetching stats:",kt)}};return t0(()=>{mt(),z.value=window.setInterval(mt,5e3)}),dg(()=>{z.value&&clearInterval(z.value)}),(kt,Dt)=>(zi(),Vi("div",mrt,[gu(r_,{title:"RX Packets",value:j.value.packetsReceived,color:"#AAE8E8",data:J.value.totalPackets},null,8,["value","data"]),gu(r_,{title:"Forward",value:j.value.packetsForwarded,color:"#FFC246",data:J.value.transmittedPackets},null,8,["value","data"]),gu(r_,{title:"Up Time",value:j.value.uptimeFormatted,color:"#EBA0FC",data:[],showChart:!1},null,8,["value"]),gu(r_,{title:"Dropped",value:j.value.droppedPackets,color:"#FB787B",data:J.value.droppedPackets},null,8,["value","data"])]))}}),vrt={class:"glass-card rounded-[10px] p-6"},yrt={class:"h-80 relative"},xrt={key:0,class:"absolute inset-0 flex items-center justify-center"},_rt={key:1,class:"absolute inset-0 flex items-center justify-center"},brt={class:"text-red-400"},wrt={key:2,class:"absolute inset-0 flex items-center justify-center"},krt={key:3,class:"h-full flex items-end justify-around gap-2 px-4"},Trt={class:"relative w-full h-64 flex flex-col justify-end"},Art={class:"text-white text-xs font-semibold drop-shadow-lg backdrop-blur-sm bg-black/20 px-2 py-0.5 rounded-md border border-white/10"},Mrt={class:"mt-2 text-center"},Srt={class:"text-white text-xs font-medium leading-tight"},Ert={key:0,class:"mt-4 text-sm text-white text-center"},Crt=Th({name:"SignalQualityChart",__name:"SignalQualityChart",setup(d){const l=lo([]),z=lo(null),j=lo(!0),J=lo(null),mt=["rgba(59, 130, 246, 0.8)","rgba(16, 185, 129, 0.8)","rgba(139, 92, 246, 0.8)","rgba(245, 158, 11, 0.8)","rgba(239, 68, 68, 0.8)","rgba(6, 182, 212, 0.8)","rgba(249, 115, 22, 0.8)","rgba(132, 204, 22, 0.8)","rgba(236, 72, 153, 0.8)","rgba(107, 114, 128, 0.8)"],kt=async()=>{try{J.value=null;const Gt=await Xh.get("/packet_type_graph_data");if(Gt?.success&&Gt?.data){const re=Gt.data;if(re?.series){const pe=[];re.series.forEach((Ne,or)=>{let _r=0;Ne.data&&Array.isArray(Ne.data)&&(_r=Ne.data.reduce((Fr,zr)=>Fr+(zr[1]||0),0)),_r>0&&pe.push({name:Ne.name||`Type ${Ne.type}`,type:Ne.type,count:_r,color:mt[or%mt.length]})}),pe.sort((Ne,or)=>or.count-Ne.count),l.value=pe,j.value=!1}else console.error("No series data found in response"),J.value="No series data in server response",j.value=!1}else console.error("Invalid API response structure:",Gt),J.value="Invalid response from server",j.value=!1}catch(Gt){console.error("Failed to fetch packet type data:",Gt),J.value=Gt instanceof Error?Gt.message:"Failed to load data",j.value=!1}},Dt=Gt=>{if(l.value.length===0)return 0;const re=Math.max(...l.value.map(pe=>pe.count));return Math.max(Gt/re*100,2)};return t0(()=>{kt(),z.value=setInterval(()=>{kt()},3e4)}),dg(()=>{z.value&&clearInterval(z.value)}),(Gt,re)=>(zi(),Vi("div",vrt,[re[2]||(re[2]=Re("h3",{class:"text-white text-xl font-semibold mb-4"},"Packet Types",-1)),re[3]||(re[3]=Re("p",{class:"text-white text-sm uppercase mb-4"},"Distribution by Type",-1)),Re("div",yrt,[j.value?(zi(),Vi("div",xrt,re[0]||(re[0]=[Re("div",{class:"text-white"},"Loading packet types...",-1)]))):J.value?(zi(),Vi("div",_rt,[Re("div",brt,aa(J.value),1)])):l.value.length===0?(zi(),Vi("div",wrt,re[1]||(re[1]=[Re("div",{class:"text-white"},"No packet data available",-1)]))):(zi(),Vi("div",krt,[(zi(!0),Vi(Ou,null,sf(l.value,pe=>(zi(),Vi("div",{key:pe.type,class:"flex flex-col items-center flex-1 max-w-20 h-full"},[Re("div",Trt,[Re("div",{class:"w-full rounded-t-[10px] transition-all duration-500 ease-out flex items-end justify-center pb-1 backdrop-blur-[50px] shadow-lg border border-white/20 hover:border-white/30",style:av({height:Dt(pe.count)+"%",background:`linear-gradient(135deg, ${pe.color} 0%, ${pe.color.replace("0.8","0.6")} 30%, ${pe.color.replace("0.8","0.4")} 70%, @@ -41,11 +41,11 @@ 0 4px 15px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3), inset 0 -1px 0 rgba(0, 0, 0, 0.2) - `})},[Re("span",krt,aa(pe.count),1)],4)]),Re("div",Trt,[Re("div",Art,aa(pe.name.replace(/\([^)]*\)/g,"").trim()),1)])]))),128))]))]),l.value.length>0?(zi(),Vi("div",Mrt," Total packet types: "+aa(l.value.length)+" | Total packets: "+aa(l.value.reduce((pe,Ne)=>pe+Ne.count,0)),1)):bs("",!0)]))}}),Ert=ld(Srt,[["__scopeId","data-v-dc58fd68"]]),Crt={class:"glass-card rounded-[10px] p-6"},Lrt={class:"relative h-48"},Prt={class:"mt-4 grid grid-cols-2 gap-4"},zrt={class:"text-center"},Irt={class:"text-2xl font-bold text-white"},Ort={class:"text-center"},Drt={class:"text-2xl font-bold text-white"},Frt={class:"mt-3 grid grid-cols-3 gap-3 text-center"},Rrt={class:"text-sm font-semibold text-accent-purple"},Brt={class:"text-sm font-semibold text-accent-red"},Nrt={class:"text-sm font-semibold text-white"},jrt=Th({name:"PerformanceChart",__name:"PerformanceChart",setup(d){const l=rw(),z=lo(null),j=lo([]),J=lo(null),mt=lo(!0),kt=async()=>{try{mt.value=!0;const Gt=await Xh.get("/recent_packets",{limit:50});if(!Gt.success){j.value=[],mt.value=!1,Z0(()=>{Dt()});return}const re=Gt.data||[],pe=Date.now(),Ne=24,or=12,_r=Ne*60*60*1e3/or,Fr=[];for(let zr=0;zr{const ai=jn.timestamp*1e3;return ai>=Wr&&ai!jn.transmitted).length,ei=Ft.filter(jn=>jn.transmitted).length;Fr.push({time:new Date(Wr+_r/2).toISOString(),rxPackets:kn,txPackets:ei})}j.value=Fr,mt.value=!1,Z0(()=>{Dt()})}catch{j.value=[],mt.value=!1,Z0(()=>{Dt()})}},Dt=()=>{if(!z.value)return;const Gt=z.value,re=Gt.getContext("2d");if(!re)return;const pe=Gt.parentElement;if(!pe)return;const Ne=pe.getBoundingClientRect(),or=Ne.width,_r=Ne.height;Gt.width=or*window.devicePixelRatio,Gt.height=_r*window.devicePixelRatio,Gt.style.width=or+"px",Gt.style.height=_r+"px",re.scale(window.devicePixelRatio,window.devicePixelRatio);const Fr=20;if(re.clearRect(0,0,or,_r),mt.value){re.fillStyle="#666",re.font="16px sans-serif",re.textAlign="center",re.fillText("Loading chart data...",or/2,_r/2);return}if(j.value.length===0){re.fillStyle="#666",re.font="16px sans-serif",re.textAlign="center",re.fillText("No data available",or/2,_r/2);return}const zr=j.value.every(Gi=>Gi.rxPackets===0&&Gi.txPackets===0),Wr=or-Fr*2,An=_r-Fr*2,Ft=j.value.flatMap(Gi=>[Gi.rxPackets,Gi.txPackets]),kn=Math.min(...Ft),ei=Math.max(...Ft),jn=kn,ai=ei,Qi=Math.max(ai-jn,1);if(re.strokeStyle="rgba(255, 255, 255, 0.1)",re.lineWidth=1,jn<=0&&ai>=0){re.strokeStyle="rgba(255, 255, 255, 0.3)",re.lineWidth=2;const Gi=_r-Fr-(0-jn)/Qi*An;re.beginPath(),re.moveTo(Fr,Gi),re.lineTo(or-Fr,Gi),re.stroke(),Gi>20&&Gi<_r-20&&(re.fillStyle="rgba(255, 255, 255, 0.7)",re.font="10px system-ui",re.textAlign="left",re.fillText("0",Fr+2,Gi-2)),re.strokeStyle="rgba(255, 255, 255, 0.1)",re.lineWidth=1}for(let Gi=0;Gi<=5;Gi++){const un=Fr+An*Gi/5;re.beginPath(),re.moveTo(Fr,un),re.lineTo(or-Fr,un),re.stroke()}for(let Gi=0;Gi<=6;Gi++){const un=Fr+Wr*Gi/6;re.beginPath(),re.moveTo(un,Fr),re.lineTo(un,_r-Fr),re.stroke()}j.value.length>1&&(re.strokeStyle="#EBA0FC",re.lineWidth=2,re.beginPath(),j.value.forEach((Gi,un)=>{const ia=Fr+Wr*un/(j.value.length-1),fa=_r-Fr-(Gi.rxPackets-jn)/Qi*An;un===0?re.moveTo(ia,fa):re.lineTo(ia,fa)}),re.stroke(),re.fillStyle="#EBA0FC",j.value.forEach((Gi,un)=>{const ia=Fr+Wr*un/(j.value.length-1),fa=_r-Fr-(Gi.rxPackets-jn)/Qi*An;re.beginPath(),re.arc(ia,fa,2,0,2*Math.PI),re.fill()})),j.value.length>1&&(re.strokeStyle="#FB787B",re.lineWidth=2,re.beginPath(),j.value.forEach((Gi,un)=>{const ia=Fr+Wr*un/(j.value.length-1),fa=_r-Fr-(Gi.txPackets-jn)/Qi*An;un===0?re.moveTo(ia,fa):re.lineTo(ia,fa)}),re.stroke(),re.fillStyle="#FB787B",j.value.forEach((Gi,un)=>{const ia=Fr+Wr*un/(j.value.length-1),fa=_r-Fr-(Gi.txPackets-jn)/Qi*An;re.beginPath(),re.arc(ia,fa,2,0,2*Math.PI),re.fill()})),re.fillStyle="rgba(255, 255, 255, 0.6)",re.font="12px system-ui",re.textAlign="center",zr&&(re.fillStyle="rgba(255, 255, 255, 0.6)",re.font="14px system-ui",re.textAlign="center",re.fillText("No packet activity in last 24 hours",or/2,_r-15))};return t0(()=>{kt(),J.value=window.setInterval(kt,3e4),Z0(()=>{Dt(),setTimeout(()=>{Dt()},100)}),window.addEventListener("resize",Dt)}),dg(()=>{J.value&&clearInterval(J.value),window.removeEventListener("resize",Dt)}),(Gt,re)=>(zi(),Vi("div",Crt,[re[5]||(re[5]=Ff('

Performance Metrics

Packet Activity (Last 24 Hours)

Received
Transmitted
',3)),Re("div",Lrt,[Re("canvas",{ref_key:"chartRef",ref:z,class:"absolute inset-0 w-full h-full"},null,512)]),Re("div",Prt,[Re("div",zrt,[Re("div",Irt,aa(Ju(l).packetStats?.total_packets||0),1),re[0]||(re[0]=Re("div",{class:"text-xs text-white/70 uppercase tracking-wide"},"Total Received",-1))]),Re("div",Ort,[Re("div",Drt,aa(Ju(l).packetStats?.transmitted_packets||0),1),re[1]||(re[1]=Re("div",{class:"text-xs text-white/70 uppercase tracking-wide"},"Total Transmitted",-1))])]),Re("div",Frt,[Re("div",null,[Re("div",Rrt,aa(j.value.length>0?Math.round(j.value.reduce((pe,Ne)=>pe+Ne.rxPackets,0)/j.value.length*100)/100:0),1),re[2]||(re[2]=Re("div",{class:"text-xs text-white/60"},"Avg RX/hr",-1))]),Re("div",null,[Re("div",Brt,aa(j.value.length>0?Math.round(j.value.reduce((pe,Ne)=>pe+Ne.txPackets,0)/j.value.length*100)/100:0),1),re[3]||(re[3]=Re("div",{class:"text-xs text-white/60"},"Avg TX/hr",-1))]),Re("div",null,[Re("div",Nrt,aa(Ju(l).packetStats?.dropped_packets||0),1),re[4]||(re[4]=Re("div",{class:"text-xs text-white/60"},"Dropped",-1))])])]))}}),Urt=ld(jrt,[["__scopeId","data-v-2ece57e8"]]),Vrt={class:"relative w-full max-w-4xl max-h-[90vh] overflow-hidden"},Hrt={class:"glass-card rounded-[20px] p-8 backdrop-blur-[50px] shadow-2xl border border-white/20"},Wrt={class:"flex items-center justify-between mb-6"},qrt={class:"text-white/70 text-sm"},Zrt={class:"max-h-[70vh] overflow-y-auto custom-scrollbar"},$rt={class:"mb-6"},Grt={class:"glass-card bg-white/5 rounded-[15px] p-4"},Yrt={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},Krt={class:"space-y-3"},Xrt={class:"flex justify-between py-2 border-b border-white/10"},Jrt={class:"text-white font-mono text-sm"},Qrt={class:"flex justify-between py-2 border-b border-white/10"},tnt={class:"text-white font-mono text-xs break-all"},ent={key:0,class:"flex justify-between py-2 border-b border-white/10"},rnt={class:"text-white font-mono text-xs"},nnt={class:"space-y-3"},int={class:"flex justify-between py-2 border-b border-white/10"},ant={class:"text-white font-semibold"},ont={class:"flex justify-between py-2 border-b border-white/10"},snt={class:"text-white font-semibold"},lnt={class:"flex justify-between py-2 border-b border-white/10"},unt={class:"mb-6"},cnt={class:"glass-card bg-white/5 rounded-[15px] p-4"},hnt={class:"space-y-3"},fnt={class:"flex justify-between py-2 border-b border-white/10"},dnt={class:"text-white"},pnt={key:0,class:"pt-2"},mnt={class:"glass-card bg-black/30 rounded-[10px] p-4 mb-4"},gnt={class:"w-full overflow-x-auto"},vnt={class:"text-white/90 text-xs font-mono whitespace-pre leading-relaxed min-w-full"},ynt={class:"flex items-center justify-between mb-3"},xnt={class:"text-white/80 text-sm font-semibold"},_nt={class:"text-white/60 text-xs"},bnt={class:"glass-card bg-black/40 rounded-[8px] p-3 mb-3 overflow-x-auto"},wnt={class:"font-mono text-sm text-white whitespace-pre min-w-full"},knt={class:"glass-card bg-white/5 rounded-[10px] overflow-hidden"},Tnt={class:"text-cyan-400 text-sm font-mono"},Ant={class:"text-white text-sm"},Mnt={class:"text-white text-sm font-semibold"},Snt={class:"text-orange-400 text-sm font-mono"},Ent={key:0,class:"text-white/60 text-xs italic mt-2 px-1"},Cnt={key:1,class:"py-2"},Lnt={class:"mb-6"},Pnt={class:"glass-card bg-white/5 rounded-[15px] p-4"},znt={class:"space-y-4"},Int={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},Ont={class:"flex justify-between py-2 border-b border-white/10"},Dnt={class:"flex justify-between py-2 border-b border-white/10"},Fnt={key:0,class:"py-2"},Rnt={class:"glass-card bg-black/20 rounded-[10px] p-4"},Bnt={class:"flex items-center flex-wrap gap-2"},Nnt={class:"relative group"},jnt={class:"relative px-3 py-2 bg-gradient-to-br from-blue-500/20 to-cyan-500/20 border border-cyan-400/40 rounded-lg transform transition-all hover:scale-105"},Unt={class:"font-mono text-xs font-semibold text-white/90"},Vnt={class:"absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 px-2 py-1 bg-black/90 text-white text-xs rounded opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none whitespace-nowrap z-10"},Hnt={key:0,class:"mx-2 text-cyan-400/60"},Wnt={key:1,class:"py-2"},qnt={class:"text-white/70 text-sm mb-2 flex items-center"},Znt={key:0,class:"w-4 h-4 ml-2 text-yellow-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},$nt={key:1,class:"text-yellow-400 text-xs ml-1"},Gnt={class:"glass-card bg-black/20 rounded-[10px] p-4"},Ynt={class:"flex items-center flex-wrap gap-2"},Knt={class:"relative group"},Xnt={key:0,class:"absolute -top-1 -right-1 w-2 h-2 bg-yellow-400 rounded-full animate-pulse"},Jnt={class:"absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 px-2 py-1 bg-black/90 text-white text-xs rounded opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none whitespace-nowrap z-10"},Qnt={key:0,class:"mx-1 text-orange-400/60"},tit={class:"mb-6"},eit={class:"glass-card bg-white/5 rounded-[15px] p-4"},rit={class:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-4"},nit={class:"text-center p-3 glass-card bg-black/20 rounded-[10px]"},iit={class:"text-lg font-bold text-white"},ait={class:"text-center p-3 glass-card bg-black/20 rounded-[10px]"},oit={class:"text-center p-3 glass-card bg-black/20 rounded-[10px]"},sit={class:"text-lg font-bold text-white"},lit={class:"mb-4"},uit={class:"flex items-center gap-3"},cit={class:"flex gap-1"},hit={class:"text-white/80 text-sm capitalize"},fit={key:0,class:"mb-4"},dit={class:"text-white/70 text-sm mb-3"},pit={class:"space-y-2"},mit={class:"flex items-center gap-3"},git={class:"text-white/60 text-sm"},vit={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},yit={class:"space-y-2"},xit={class:"flex justify-between py-2 border-b border-white/10"},_it={class:"text-white"},bit={class:"flex justify-between py-2 border-b border-white/10"},wit={class:"space-y-2"},kit={class:"flex justify-between py-2 border-b border-white/10"},Tit={key:0,class:"flex justify-between py-2 border-b border-white/10"},Ait={class:"text-red-400 text-sm"},Mit={class:"mt-6 pt-4 border-t border-white/10 flex justify-end"},Sit=Th({name:"PacketDetailsModal",__name:"PacketDetailsModal",props:{packet:{},isOpen:{type:Boolean},localHash:{}},emits:["close"],setup(d,{emit:l}){const z=d,j=l,J=Ft=>new Date(Ft*1e3).toLocaleString(),mt=Ft=>Ft.transmitted?Ft.is_duplicate?"text-amber-400":Ft.drop_reason?"text-red-400":"text-green-400":"text-red-400",kt=Ft=>Ft.transmitted?Ft.is_duplicate?"Duplicate":Ft.drop_reason?"Dropped":"Forwarded":"Dropped",Dt=Ft=>({0:"Request",1:"Response",2:"Plain Text Message",3:"Acknowledgment",4:"Node Advertisement",5:"Group Text Message",6:"Group Datagram",7:"Anonymous Request",8:"Returned Path",9:"Trace",10:"Multi-part Packet",15:"Custom Packet"})[Ft]||`Unknown Type (${Ft})`,Gt=Ft=>({0:"Transport Flood",1:"Flood",2:"Direct",3:"Transport Direct"})[Ft]||`Unknown Route (${Ft})`,re=Ft=>{if(!Ft)return"None";const ei=Ft.replace(/\s+/g,"").toUpperCase().match(/.{2}/g)||[],jn=[];for(let ai=0;ai{try{let jn=0;const ai=kn.length/2;if(ai>=100){if(kn.length>=jn+64){const Qi=kn.slice(jn,jn+64);Ft.push({name:"Public Key",byteRange:`${(ei+jn)/2}-${(ei+jn+63)/2}`,hexData:Qi.match(/.{8}/g)?.join(" ")||Qi,description:"Ed25519 public key of the node (32 bytes)",fields:[{bits:"0-255",name:"Ed25519 Public Key",value:`${Qi.slice(0,16)}...${Qi.slice(-16)}`,binary:"32 bytes (256 bits)"}]}),jn+=64}if(kn.length>=jn+8){const Qi=kn.slice(jn,jn+8),Gi=parseInt(Qi,16),un=new Date(Gi*1e3);Ft.push({name:"Timestamp",byteRange:`${(ei+jn)/2}-${(ei+jn+7)/2}`,hexData:Qi.match(/.{2}/g)?.join(" ")||Qi,description:"Unix timestamp of advertisement",fields:[{bits:"0-31",name:"Unix Timestamp",value:`${Gi} (${un.toLocaleString()})`,binary:Gi.toString(2).padStart(32,"0")}]}),jn+=8}if(kn.length>=jn+128){const Qi=kn.slice(jn,jn+128);Ft.push({name:"Signature",byteRange:`${(ei+jn)/2}-${(ei+jn+127)/2}`,hexData:Qi.match(/.{8}/g)?.join(" ")||Qi,description:"Ed25519 signature of public key, timestamp, and appdata",fields:[{bits:"0-511",name:"Ed25519 Signature",value:`${Qi.slice(0,16)}...${Qi.slice(-16)}`,binary:"64 bytes (512 bits)"}]}),jn+=128}if(kn.length>jn){const Qi=kn.slice(jn);Ne(Ft,Qi,ei+jn)}}else Ft.push({name:"ADVERT AppData (Partial)",byteRange:`${ei/2}-${ei/2+ai-1}`,hexData:kn.match(/.{2}/g)?.join(" ")||kn,description:`Partial ADVERT data - appears to be just AppData portion (${ai} bytes)`,fields:[{bits:`0-${ai*8-1}`,name:"Partial Data",value:`${ai} bytes - attempting to decode as AppData`,binary:`${ai} bytes (${ai*8} bits)`}]}),Ne(Ft,kn,ei)}catch(jn){Ft.push({name:"ADVERT Parse Error",byteRange:"N/A",hexData:kn.slice(0,32)+"...",description:"Failed to parse ADVERT payload structure",fields:[{bits:"N/A",name:"Error",value:`Parse error: ${jn instanceof Error?jn.message:"Unknown error"}`,binary:"Invalid"}]})}},Ne=(Ft,kn,ei)=>{try{const jn=kn.length/2;Ft.push({name:"AppData",byteRange:`${ei/2}-${ei/2+jn-1}`,hexData:kn.match(/.{2}/g)?.join(" ")||kn,description:`Node advertisement application data (${jn} bytes)`,fields:[{bits:`0-${jn*8-1}`,name:"Application Data",value:`${jn} bytes (contains flags, location, name, etc.)`,binary:`${jn} bytes (${jn*8} bits)`}]});let ai=0;if(kn.length>=2){const Qi=parseInt(kn.slice(ai,ai+2),16),Gi=[],un=!!(Qi&16),ia=!!(Qi&32),fa=!!(Qi&64),Li=!!(Qi&128);if(Qi&1&&Gi.push("is chat node"),Qi&2&&Gi.push("is repeater"),Qi&4&&Gi.push("is room server"),Qi&8&&Gi.push("is sensor"),un&&Gi.push("has location"),ia&&Gi.push("has feature 1"),fa&&Gi.push("has feature 2"),Li&&Gi.push("has name"),Ft.push({name:"AppData Flags",byteRange:`${(ei+ai)/2}`,hexData:`0x${kn.slice(ai,ai+2)}`,description:"Flags indicating which optional fields are present",fields:[{bits:"0-7",name:"Flags",value:Gi.join(", ")||"none",binary:Qi.toString(2).padStart(8,"0")}]}),ai+=2,un&&kn.length>=ai+16){const yi=kn.slice(ai,ai+8),ra=[];for(let fu=6;fu>=0;fu-=2)ra.push(yi.slice(fu,fu+2));const Da=parseInt(ra.join(""),16),Ni=Da>2147483647?Da-4294967296:Da,Ei=Ni/1e6,Va=kn.slice(ai+8,ai+16),ss=[];for(let fu=6;fu>=0;fu-=2)ss.push(Va.slice(fu,fu+2));const mo=parseInt(ss.join(""),16),ko=mo>2147483647?mo-4294967296:mo,pl=ko/1e6;Ft.push({name:"Location Data",byteRange:`${(ei+ai)/2}-${(ei+ai+15)/2}`,hexData:`${yi.match(/.{2}/g)?.join(" ")||yi} ${Va.match(/.{2}/g)?.join(" ")||Va}`,description:"GPS coordinates (latitude and longitude)",fields:[{bits:"0-31",name:"Latitude",value:`${Ei.toFixed(6)}° (raw: ${Ni})`,binary:Ni.toString(2).padStart(32,"0")},{bits:"32-63",name:"Longitude",value:`${pl.toFixed(6)}° (raw: ${ko})`,binary:ko.toString(2).padStart(32,"0")}]}),ai+=16}if(ia&&kn.length>=ai+4){const yi=kn.slice(ai,ai+4),ra=parseInt(yi,16);Ft.push({name:"Feature 1",byteRange:`${(ei+ai)/2}-${(ei+ai+3)/2}`,hexData:yi.match(/.{2}/g)?.join(" ")||yi,description:"Reserved feature 1 (2 bytes)",fields:[{bits:"0-15",name:"Feature 1 Value",value:`${ra}`,binary:ra.toString(2).padStart(16,"0")}]}),ai+=4}if(fa&&kn.length>=ai+4){const yi=kn.slice(ai,ai+4),ra=parseInt(yi,16);Ft.push({name:"Feature 2",byteRange:`${(ei+ai)/2}-${(ei+ai+3)/2}`,hexData:yi.match(/.{2}/g)?.join(" ")||yi,description:"Reserved feature 2 (2 bytes)",fields:[{bits:"0-15",name:"Feature 2 Value",value:`${ra}`,binary:ra.toString(2).padStart(16,"0")}]}),ai+=4}if(Li&&kn.length>ai){const yi=kn.slice(ai),ra=yi.match(/.{2}/g)||[],Da=ra.map(Ni=>{const Ei=parseInt(Ni,16);return Ei>=32&&Ei<=126?String.fromCharCode(Ei):"."}).join("").replace(/\.+$/,"");Ft.push({name:"Node Name",byteRange:`${(ei+ai)/2}-${(ei+kn.length-1)/2}`,hexData:yi.match(/.{2}/g)?.join(" ")||yi,description:`Node name string (${ra.length} bytes)`,fields:[{bits:`0-${ra.length*8-1}`,name:"Node Name",value:`"${Da}"`,binary:`ASCII text (${ra.length} bytes)`}]})}}}catch(jn){Ft.push({name:"AppData Parse Error",byteRange:"N/A",hexData:kn.slice(0,Math.min(32,kn.length)),description:"Failed to parse AppData structure",fields:[{bits:"N/A",name:"Error",value:`Parse error: ${jn instanceof Error?jn.message:"Unknown error"}`,binary:"Invalid"}]})}},or=Ft=>{if(!Ft)return[];if(Array.isArray(Ft))return Ft;if(typeof Ft=="string")try{return JSON.parse(Ft)}catch{return[]}return[]},_r=Ft=>{const kn=[];if(!Ft)return kn;try{const ei=Ft.raw_packet;if(ei){const jn=ei.replace(/\s+/g,"").toUpperCase();let ai=0;if(jn.length>=2){const Qi=jn.slice(ai,ai+2),Gi=parseInt(Qi,16),un=Gi&3,ia=(Gi&60)>>2,fa=(Gi&192)>>6,Li={0:"Transport Flood",1:"Flood",2:"Direct",3:"Transport Direct"},yi={0:"REQ",1:"RESPONSE",2:"TXT_MSG",3:"ACK",4:"ADVERT",5:"GRP_TXT",6:"GRP_DATA",7:"ANON_REQ",8:"PATH",9:"TRACE",10:"MULTIPART",15:"RAW_CUSTOM"};if(kn.push({name:"Header",byteRange:"0",hexData:`0x${Qi}`,description:"Contains routing type, payload type, and payload version",fields:[{bits:"0-1",name:"Route Type",value:Li[un]||"Unknown",binary:un.toString(2).padStart(2,"0")},{bits:"2-5",name:"Payload Type",value:yi[ia]||"Unknown",binary:ia.toString(2).padStart(4,"0")},{bits:"6-7",name:"Version",value:fa.toString(),binary:fa.toString(2).padStart(2,"0")}]}),ai+=2,(un===0||un===3)&&jn.length>=ai+8){const Da=jn.slice(ai,ai+8),Ni=parseInt(Da.slice(0,4),16),Ei=parseInt(Da.slice(4,8),16);kn.push({name:"Transport Codes",byteRange:"1-4",hexData:`${Da.slice(0,4)} ${Da.slice(4,8)}`,description:"2x 16-bit transport codes for routing optimization",fields:[{bits:"0-15",name:"Code 1",value:Ni.toString(),binary:Ni.toString(2).padStart(16,"0")},{bits:"16-31",name:"Code 2",value:Ei.toString(),binary:Ei.toString(2).padStart(16,"0")}]}),ai+=8}if(jn.length>=ai+2){const Da=jn.slice(ai,ai+2),Ni=parseInt(Da,16);if(kn.push({name:"Path Length",byteRange:`${ai/2}`,hexData:`0x${Da}`,description:`${Ni} bytes of path data`,fields:[{bits:"0-7",name:"Path Length",value:`${Ni} bytes`,binary:Ni.toString(2).padStart(8,"0")}]}),ai+=2,Ni>0&&jn.length>=ai+Ni*2){const Ei=jn.slice(ai,ai+Ni*2);kn.push({name:"Path Data",byteRange:`${ai/2}-${(ai+Ni*2-2)/2}`,hexData:Ei.match(/.{2}/g)?.join(" ")||Ei,description:"Routing path information",fields:[{bits:`0-${Ni*8-1}`,name:"Route Path",value:`${Ni} bytes of routing data`,binary:`${Ni} bytes (${Ni*8} bits)`}]}),ai+=Ni*2}}if(jn.length>ai){const Da=jn.slice(ai),Ni=Da.length/2;ia===4?pe(kn,Da,ai):kn.push({name:"Payload Data",byteRange:`${ai/2}-${ai/2+Ni-1}`,hexData:Da.match(/.{2}/g)?.join(" ")||Da,description:"Application data content",fields:[{bits:`0-${Ni*8-1}`,name:"Application Data",value:`${Ni} bytes`,binary:`${Ni} bytes (${Ni*8} bits)`}]})}}}else{if(Ft.header){const jn=Ft.header.replace(/0x/gi,"").replace(/\s+/g,"").toUpperCase(),ai=parseInt(jn,16),Qi=ai&3,Gi=(ai&60)>>2,un=(ai&192)>>6,ia={0:"Transport Flood",1:"Flood",2:"Direct",3:"Transport Direct"},fa={0:"REQ",1:"RESPONSE",2:"TXT_MSG",3:"ACK",4:"ADVERT",5:"GRP_TXT",6:"GRP_DATA",7:"ANON_REQ",8:"PATH",9:"TRACE",10:"MULTIPART",15:"RAW_CUSTOM"};kn.push({name:"Header",byteRange:"0",hexData:`0x${jn}`,description:"Contains routing type, payload type, and payload version",fields:[{bits:"0-1",name:"Route Type",value:ia[Qi]||"Unknown",binary:Qi.toString(2).padStart(2,"0")},{bits:"2-5",name:"Payload Type",value:fa[Gi]||"Unknown",binary:Gi.toString(2).padStart(4,"0")},{bits:"6-7",name:"Version",value:un.toString(),binary:un.toString(2).padStart(2,"0")}]}),Ft.transport_codes&&kn.push({name:"Transport Codes",byteRange:"1-4",hexData:Ft.transport_codes,description:"2x 16-bit transport codes for routing optimization",fields:[{bits:"0-31",name:"Transport Codes",value:Ft.transport_codes,binary:"Available in separate field"}]}),Ft.original_path&&Ft.original_path.length>0&&kn.push({name:"Original Path",byteRange:"?",hexData:Ft.original_path.join(" "),description:`Original routing path (${Ft.original_path.length} nodes)`,fields:[{bits:"0-?",name:"Path Nodes",value:`${Ft.original_path.length} nodes`,binary:"Available as node list"}]}),Ft.forwarded_path&&Ft.forwarded_path.length>0&&kn.push({name:"Forwarded Path",byteRange:"?",hexData:Ft.forwarded_path.join(" "),description:`Forwarded routing path (${Ft.forwarded_path.length} nodes)`,fields:[{bits:"0-?",name:"Path Nodes",value:`${Ft.forwarded_path.length} nodes`,binary:"Available as node list"}]})}if(Ft.payload){const jn=Ft.payload.replace(/\s+/g,"").toUpperCase(),ai=jn.length/2;Ft.type===4?pe(kn,jn,0):kn.push({name:"Payload Data",byteRange:`0-${ai-1}`,hexData:jn.match(/.{2}/g)?.join(" ")||jn,description:`Application data content (${ai} bytes)`,fields:[{bits:`0-${ai*8-1}`,name:"Application Data",value:`${ai} bytes`,binary:`${ai} bytes (${ai*8} bits)`}]})}}}catch{kn.push({name:"Parse Error",byteRange:"N/A",hexData:"Error",description:"Unable to parse packet structure",fields:[{bits:"N/A",name:"Error",value:"Parse failed",binary:"Invalid"}]})}return kn},Fr=Ft=>Ft>=10?"text-green-400":Ft>=5?"text-cyan-400":Ft>=0?"text-yellow-400":"text-red-400",zr=(Ft,kn=8)=>{const jn={7:-7.5,8:-10,9:-12.5,10:-15,11:-17.5,12:-20}[kn]||-10;let ai,Qi;return Ft>=jn+10?(ai=4,Qi="signal-excellent"):Ft>=jn+5?(ai=3,Qi="signal-good"):Ft>=jn?(ai=2,Qi="signal-fair"):(ai=1,Qi="signal-poor"),{level:ai,className:Qi}},Wr=Ft=>{Ft.key==="Escape"&&j("close")},An=Ft=>{Ft.target===Ft.currentTarget&&j("close")};return(Ft,kn)=>(zi(),hm($z,{to:"body"},[gu(LI,{name:"modal",appear:""},{default:Y2(()=>[Ft.isOpen&&Ft.packet?(zi(),Vi("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4",onClick:An,onKeydown:Wr,tabindex:"0"},[kn[36]||(kn[36]=Re("div",{class:"absolute inset-0 bg-black/60 backdrop-blur-md"},null,-1)),Re("div",Vrt,[Re("div",Hrt,[Re("div",Wrt,[Re("div",null,[kn[2]||(kn[2]=Re("h2",{class:"text-2xl font-bold text-white mb-1"},"Packet Details",-1)),Re("p",qrt,aa(Dt(Ft.packet.type))+" - "+aa(Gt(Ft.packet.route)),1)]),Re("button",{onClick:kn[0]||(kn[0]=ei=>j("close")),class:"w-8 h-8 flex items-center justify-center rounded-full bg-white/10 hover:bg-white/20 transition-colors duration-200 text-white/70 hover:text-white"},kn[3]||(kn[3]=[Re("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),Re("div",Zrt,[Re("div",$rt,[kn[10]||(kn[10]=Re("h3",{class:"text-lg font-semibold text-white mb-4 flex items-center"},[Re("div",{class:"w-2 h-2 rounded-full bg-cyan-400 mr-3"}),nc(" Basic Information ")],-1)),Re("div",Grt,[Re("div",Yrt,[Re("div",Krt,[Re("div",Xrt,[kn[4]||(kn[4]=Re("span",{class:"text-white/70 text-sm"},"Timestamp",-1)),Re("span",Jrt,aa(J(Ft.packet.timestamp)),1)]),Re("div",Qrt,[kn[5]||(kn[5]=Re("span",{class:"text-white/70 text-sm"},"Packet Hash",-1)),Re("span",tnt,aa(Ft.packet.packet_hash),1)]),Ft.packet.header?(zi(),Vi("div",ent,[kn[6]||(kn[6]=Re("span",{class:"text-white/70 text-sm"},"Header",-1)),Re("span",rnt,aa(Ft.packet.header),1)])):bs("",!0)]),Re("div",nnt,[Re("div",int,[kn[7]||(kn[7]=Re("span",{class:"text-white/70 text-sm"},"Type",-1)),Re("span",ant,aa(Ft.packet.type)+" ("+aa(Dt(Ft.packet.type))+")",1)]),Re("div",ont,[kn[8]||(kn[8]=Re("span",{class:"text-white/70 text-sm"},"Route",-1)),Re("span",snt,aa(Ft.packet.route)+" ("+aa(Gt(Ft.packet.route))+")",1)]),Re("div",lnt,[kn[9]||(kn[9]=Re("span",{class:"text-white/70 text-sm"},"Status",-1)),Re("span",{class:Xs(["font-semibold",mt(Ft.packet)])},aa(kt(Ft.packet)),3)])])])])]),Re("div",unt,[kn[16]||(kn[16]=Re("h3",{class:"text-lg font-semibold text-white mb-4 flex items-center"},[Re("div",{class:"w-2 h-2 rounded-full bg-orange-400 mr-3"}),nc(" Payload Data ")],-1)),Re("div",cnt,[Re("div",hnt,[Re("div",fnt,[kn[11]||(kn[11]=Re("span",{class:"text-white/70 text-sm"},"Payload Length",-1)),Re("span",dnt,aa(Ft.packet.payload_length||Ft.packet.length)+" bytes",1)]),Ft.packet.payload?(zi(),Vi("div",pnt,[kn[14]||(kn[14]=Re("div",{class:"text-white/70 text-sm mb-3"},"Payload Analysis",-1)),Re("div",mnt,[kn[12]||(kn[12]=Re("div",{class:"text-white/70 text-xs mb-2 font-semibold"},"Raw Hex Data",-1)),Re("div",gnt,[Re("pre",vnt,aa(re(Ft.packet.payload)),1)])]),(zi(!0),Vi(Ou,null,sf(_r(Ft.packet).filter(ei=>!ei.name.includes("Parse Error")),(ei,jn)=>(zi(),Vi("div",{key:jn,class:"mb-4"},[Re("div",ynt,[Re("h4",xnt,aa(ei.name),1),Re("span",_nt,"Bytes "+aa(ei.byteRange),1)]),Re("div",bnt,[Re("div",wnt,aa(ei.hexData),1)]),Re("div",knt,[kn[13]||(kn[13]=Re("div",{class:"grid grid-cols-4 gap-4 p-3 bg-white/10 text-white/70 text-xs font-semibold uppercase tracking-wide"},[Re("div",null,"Bits"),Re("div",null,"Field"),Re("div",null,"Value"),Re("div",null,"Binary")],-1)),(zi(!0),Vi(Ou,null,sf(ei.fields,(ai,Qi)=>(zi(),Vi("div",{key:Qi,class:"grid grid-cols-4 gap-4 p-3 border-b border-white/5 last:border-b-0 hover:bg-white/5 transition-colors"},[Re("div",Tnt,aa(ai.bits),1),Re("div",Ant,aa(ai.name),1),Re("div",Mnt,aa(ai.value),1),Re("div",Snt,aa(ai.binary),1)]))),128))]),ei.description?(zi(),Vi("div",Ent,aa(ei.description),1)):bs("",!0)]))),128))])):(zi(),Vi("div",Cnt,kn[15]||(kn[15]=[Re("span",{class:"text-white/70 text-sm"},"Payload:",-1),Re("span",{class:"text-white/50 ml-2"},"None",-1)])))])])]),Re("div",Lnt,[kn[24]||(kn[24]=Re("h3",{class:"text-lg font-semibold text-white mb-4 flex items-center"},[Re("div",{class:"w-2 h-2 rounded-full bg-purple-400 mr-3"}),nc(" Path Information ")],-1)),Re("div",Pnt,[Re("div",znt,[Re("div",Int,[Re("div",Ont,[kn[17]||(kn[17]=Re("span",{class:"text-white/70 text-sm"},"Source Hash",-1)),Re("span",{class:Xs(["text-white font-mono text-xs",z.localHash&&Ft.packet.src_hash===z.localHash?"bg-cyan-400/20 text-cyan-300 px-1 rounded":""])},aa(Ft.packet.src_hash||"Unknown"),3)]),Re("div",Dnt,[kn[18]||(kn[18]=Re("span",{class:"text-white/70 text-sm"},"Destination Hash",-1)),Re("span",{class:Xs(["text-white font-mono text-xs",z.localHash&&Ft.packet.dst_hash===z.localHash?"bg-cyan-400/20 text-cyan-300 px-1 rounded":""])},aa(Ft.packet.dst_hash||"Broadcast"),3)])]),or(Ft.packet.original_path).length>0?(zi(),Vi("div",Fnt,[kn[20]||(kn[20]=Re("div",{class:"text-white/70 text-sm mb-2"},"Original Path",-1)),Re("div",Rnt,[Re("div",Bnt,[(zi(!0),Vi(Ou,null,sf(or(Ft.packet.original_path),(ei,jn)=>(zi(),Vi("div",{key:jn,class:"flex items-center"},[Re("div",Nnt,[Re("div",jnt,[Re("div",Unt,aa(ei.length<=2?ei.toUpperCase():ei.slice(0,2).toUpperCase()),1)]),Re("div",Vnt," Node: "+aa(ei),1)]),jn0?(zi(),Vi("div",Wnt,[Re("div",qnt,[kn[22]||(kn[22]=nc(" Forwarded Path ",-1)),JSON.stringify(or(Ft.packet.original_path))!==JSON.stringify(or(Ft.packet.forwarded_path))?(zi(),Vi("svg",Znt,kn[21]||(kn[21]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)]))):bs("",!0),JSON.stringify(or(Ft.packet.original_path))!==JSON.stringify(or(Ft.packet.forwarded_path))?(zi(),Vi("span",$nt,"(Modified)")):bs("",!0)]),Re("div",Gnt,[Re("div",Ynt,[(zi(!0),Vi(Ou,null,sf(or(Ft.packet.forwarded_path),(ei,jn)=>(zi(),Vi("div",{key:jn,class:"flex items-center"},[Re("div",Knt,[Re("div",{class:Xs(["relative px-3 py-2 bg-gradient-to-br from-orange-500/20 to-yellow-500/20 border border-orange-400/40 rounded-lg transform transition-all hover:scale-105",z.localHash&&ei===z.localHash?"bg-gradient-to-br from-yellow-400/30 to-orange-400/30 border-yellow-300 shadow-yellow-400/20 shadow-lg":"hover:border-orange-400/60"])},[Re("div",{class:Xs(["font-mono text-xs font-semibold",z.localHash&&ei===z.localHash?"text-yellow-200":"text-white/90"])},aa(ei.slice(0,2).toUpperCase()),3),z.localHash&&ei===z.localHash?(zi(),Vi("div",Xnt)):bs("",!0)],2),Re("div",Jnt,aa(ei),1)]),jnRe("div",{key:ei,class:Xs(["w-2 h-6 rounded-sm transition-all duration-300",ei<=zr(Ft.packet.snr).level?{"signal-excellent":"bg-green-400","signal-good":"bg-cyan-400","signal-fair":"bg-yellow-400","signal-poor":"bg-red-400"}[zr(Ft.packet.snr).className]:"bg-white/10"])},null,2)),64))]),Re("span",hit,aa(zr(Ft.packet.snr).className.replace("signal-","")),1)])]),Ft.packet.is_trace&&Ft.packet.path_snr_details&&Ft.packet.path_snr_details.length>0?(zi(),Vi("div",fit,[Re("div",dit,"Path SNR Details ("+aa(Ft.packet.path_snr_details.length)+" hops)",1),Re("div",pit,[(zi(!0),Vi(Ou,null,sf(Ft.packet.path_snr_details,(ei,jn)=>(zi(),Vi("div",{key:jn,class:"flex items-center justify-between p-2 glass-card bg-black/20 rounded-[8px]"},[Re("div",mit,[Re("span",git,aa(jn+1)+".",1),Re("span",{class:Xs(["font-mono text-xs text-white",z.localHash&&ei.hash===z.localHash?"bg-cyan-400/20 text-cyan-300 px-1 rounded":""])},aa(ei.hash),3)]),Re("span",{class:Xs(["text-sm font-bold",Fr(ei.snr_db)])},aa(ei.snr_db.toFixed(1))+"dB ",3)]))),128))])])):bs("",!0),Re("div",vit,[Re("div",yit,[Re("div",xit,[kn[31]||(kn[31]=Re("span",{class:"text-white/70 text-sm"},"TX Delay",-1)),Re("span",_it,aa(Number(Ft.packet.tx_delay_ms)>0?Number(Ft.packet.tx_delay_ms).toFixed(1)+"ms":"-"),1)]),Re("div",bit,[kn[32]||(kn[32]=Re("span",{class:"text-white/70 text-sm"},"Transmitted",-1)),Re("span",{class:Xs(Ft.packet.transmitted?"text-green-400":"text-red-400")},aa(Ft.packet.transmitted?"Yes":"No"),3)])]),Re("div",wit,[Re("div",kit,[kn[33]||(kn[33]=Re("span",{class:"text-white/70 text-sm"},"Is Duplicate",-1)),Re("span",{class:Xs(Ft.packet.is_duplicate?"text-amber-400":"text-white/60")},aa(Ft.packet.is_duplicate?"Yes":"No"),3)]),Ft.packet.drop_reason?(zi(),Vi("div",Tit,[kn[34]||(kn[34]=Re("span",{class:"text-white/70 text-sm"},"Drop Reason",-1)),Re("span",Ait,aa(Ft.packet.drop_reason),1)])):bs("",!0)])])])])]),Re("div",Mit,[Re("button",{onClick:kn[1]||(kn[1]=ei=>j("close")),class:"px-6 py-2 bg-gradient-to-r from-cyan-500/20 to-cyan-400/20 hover:from-cyan-500/30 hover:to-cyan-400/30 border border-cyan-400/30 rounded-[10px] text-white transition-all duration-200 backdrop-blur-sm"}," Close ")])])])],32)):bs("",!0)]),_:1})]))}}),Eit=ld(Sit,[["__scopeId","data-v-3b73bfd6"]]),Cit={class:"glass-card rounded-[20px] p-6"},Lit={class:"flex justify-between items-center mb-6"},Pit={class:"flex items-center gap-3"},zit={class:"text-dark-text text-sm"},Iit=["title"],Oit={key:1,class:"text-primary text-sm"},Dit={key:2,class:"text-accent-red text-sm"},Fit={class:"flex items-center gap-3"},Rit={class:"flex flex-col"},Bit=["value"],Nit={class:"flex flex-col"},jit=["value"],Uit={class:"flex flex-col"},Vit={class:"flex flex-col"},Hit=["disabled"],Wit={class:"space-y-4 overflow-hidden"},qit=["onClick"],Zit={class:"grid grid-cols-12 gap-2 items-center"},$it={class:"col-span-1 text-white text-sm"},Git={class:"col-span-1 flex items-center gap-2"},Yit={class:"text-white text-xs"},Kit={class:"col-span-2"},Xit={class:"col-span-1 text-white text-xs"},Jit={class:"col-span-2"},Qit={class:"space-y-1"},tat={class:"inline-block px-2 py-0.5 rounded bg-[#588187] text-accent-cyan text-xs"},eat={class:"col-span-1 text-white text-xs"},rat={class:"col-span-1 text-white text-xs"},nat={class:"col-span-1 text-white text-xs"},iat={class:"col-span-1 text-white text-xs"},aat={class:"col-span-1"},oat={key:0,class:"text-accent-red text-[8px] italic truncate"},sat={key:0,class:"flex justify-between items-center mt-6 pt-4 border-t border-dark-border"},lat={class:"flex items-center gap-4"},uat={class:"text-dark-text text-sm"},cat={key:0,class:"flex items-center gap-2"},hat=["disabled"],fat={class:"text-dark-text text-xs"},dat={class:"flex items-center gap-2"},pat=["disabled"],mat={class:"flex items-center gap-1"},gat={key:1,class:"text-dark-text text-sm px-2"},vat=["onClick"],yat={key:2,class:"text-dark-text text-sm px-2"},xat=["disabled"],_at={key:1,class:"flex justify-center mt-6 pt-4 border-t border-dark-border"},bat={class:"flex items-center gap-4"},wat={class:"text-dark-text text-sm"},kat={class:"text-dark-text text-xs"},Tat={key:2,class:"flex justify-center mt-6 pt-4 border-t border-dark-border"},t2=10,oy=1e3,Aat=Th({name:"PacketTable",__name:"PacketTable",setup(d){const l=rw(),z=lo(1),j=lo(null),J=lo(100),mt=lo(!1),kt=lo(null),Dt=lo(!1),Gt=ss=>{kt.value=ss,Dt.value=!0},re=()=>{Dt.value=!1,kt.value=null},pe=lo("all"),Ne=lo("all"),or=lo(!1),_r=lo(null),Fr=["all","0","1","2","3","4","5","6","7","8","9"],zr=["all","1","2"],Wr=Yo(()=>{let ss=l.recentPackets;if(pe.value!=="all"){const mo=parseInt(pe.value);ss=ss.filter(ko=>ko.type===mo)}if(Ne.value!=="all"){const mo=parseInt(Ne.value);ss=ss.filter(ko=>ko.route===mo)}return or.value&&_r.value!==null&&(ss=ss.filter(mo=>mo.timestamp>=_r.value)),ss}),An=Yo(()=>{const ss=(z.value-1)*t2,mo=ss+t2;return Wr.value.slice(ss,mo)}),Ft=Yo(()=>Math.ceil(Wr.value.length/t2)),kn=Yo(()=>z.value===Ft.value),ei=Yo(()=>l.recentPackets.length>=J.value&&J.valuekn.value&&ei.value&&!mt.value),ai=ss=>new Date(ss*1e3).toLocaleTimeString("en-US",{hour12:!1}),Qi=ss=>({0:"REQ",1:"RESPONSE",2:"TXT_MSG",3:"ACK",4:"ADVERT",5:"GRP_TXT",6:"GRP_DATA",7:"ANON_REQ",8:"PATH",9:"TRACE"})[ss]||`TYPE_${ss}`,Gi=ss=>({0:"T-Flood",1:"Flood",2:"Direct",3:"T-Direct"})[ss]||`Route ${ss}`,un=ss=>ss.transmitted?"text-accent-green":"text-primary",ia=ss=>ss.drop_reason?"Dropped":ss.transmitted?"Forward":"Received",fa=ss=>ss===1?"bg-[#223231] text-accent-cyan":"bg-secondary/30 text-secondary",Li=ss=>({0:"bg-primary",1:"bg-accent-green",2:"bg-secondary",3:"bg-accent-purple",4:"bg-accent-red",5:"bg-accent-cyan",6:"bg-primary",7:"bg-accent-purple",8:"bg-accent-green",9:"bg-secondary"})[ss]||"bg-gray-500",yi=ss=>({0:"border-l-primary",1:"border-l-accent-green",2:"border-l-secondary",3:"border-l-accent-purple",4:"border-l-accent-red",5:"border-l-accent-cyan",6:"border-l-primary",7:"border-l-accent-purple",8:"border-l-accent-green",9:"border-l-secondary"})[ss]||"border-l-gray-500",ra=()=>{pe.value="all",Ne.value="all",or.value=!1,_r.value=null,z.value=1},Da=()=>{or.value?(or.value=!1,_r.value=null):(or.value=!0,_r.value=Date.now()/1e3),z.value=1},Ni=Yo(()=>_r.value?new Date(_r.value*1e3).toLocaleTimeString():""),Ei=async ss=>{try{const mo=ss||J.value;await l.fetchRecentPackets({limit:mo})}catch(mo){console.error("Error fetching packet data:",mo)}},Va=async()=>{if(!(mt.value||J.value>=oy)){mt.value=!0;try{const ss=Math.min(J.value+200,oy);J.value=ss,await Ei(ss)}catch(ss){console.error("Error loading more records:",ss)}finally{mt.value=!1}}};return t0(async()=>{await Ei(),j.value=window.setInterval(Ei,5e3)}),dg(()=>{j.value&&clearInterval(j.value)}),(ss,mo)=>(zi(),Vi(Ou,null,[Re("div",Cit,[Re("div",Lit,[Re("div",Pit,[mo[6]||(mo[6]=Re("h3",{class:"text-white text-xl font-semibold"},"Recent Packets",-1)),Re("span",zit," ("+aa(Wr.value.length)+" of "+aa(Ju(l).recentPackets.length)+") ",1),or.value?(zi(),Vi("span",{key:0,class:"text-primary text-sm bg-primary/10 px-2 py-1 rounded-md border border-primary/20",title:`Filter activated at ${Ni.value}`}," Live Mode (since "+aa(Ni.value)+") ",9,Iit)):bs("",!0),Ju(l).isLoading?(zi(),Vi("span",Oit,"Loading...")):bs("",!0),Ju(l).error?(zi(),Vi("span",Dit,aa(Ju(l).error),1)):bs("",!0)]),Re("div",Fit,[Re("div",Rit,[mo[7]||(mo[7]=Re("label",{class:"text-dark-text text-xs mb-1"},"Type",-1)),$p(Re("select",{"onUpdate:modelValue":mo[0]||(mo[0]=ko=>pe.value=ko),class:"glass-card border border-dark-border rounded-[10px] px-3 py-2 text-white text-sm focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary/20 transition-all duration-200 min-w-[120px] cursor-pointer hover:border-primary/50"},[(zi(),Vi(Ou,null,sf(Fr,ko=>Re("option",{key:ko,value:ko,class:"bg-[#1A1E1F] text-white"},aa(ko==="all"?"All Types":`Type ${ko} (${Qi(parseInt(ko))})`),9,Bit)),64))],512),[[iA,pe.value]])]),Re("div",Nit,[mo[8]||(mo[8]=Re("label",{class:"text-dark-text text-xs mb-1"},"Route",-1)),$p(Re("select",{"onUpdate:modelValue":mo[1]||(mo[1]=ko=>Ne.value=ko),class:"glass-card border border-dark-border rounded-[10px] px-3 py-2 text-white text-sm focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary/20 transition-all duration-200 min-w-[120px] cursor-pointer hover:border-primary/50"},[(zi(),Vi(Ou,null,sf(zr,ko=>Re("option",{key:ko,value:ko,class:"bg-[#1A1E1F] text-white"},aa(ko==="all"?"All Routes":`Route ${ko} (${Gi(parseInt(ko))})`),9,jit)),64))],512),[[iA,Ne.value]])]),Re("div",Uit,[mo[9]||(mo[9]=Re("label",{class:"text-dark-text text-xs mb-1"},"Filter",-1)),Re("button",{onClick:Da,class:Xs(["glass-card border rounded-[10px] px-4 py-2 text-sm transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20 min-w-[120px]",{"border-primary bg-primary/10 text-primary":or.value,"border-dark-border text-dark-text hover:border-primary hover:text-white hover:bg-primary/5":!or.value}])},aa(or.value?"New Only":"Show New"),3)]),Re("div",Vit,[mo[10]||(mo[10]=Re("label",{class:"text-transparent text-xs mb-1"},".",-1)),Re("button",{onClick:ra,class:Xs(["glass-card border border-dark-border hover:border-primary rounded-[10px] px-4 py-2 text-dark-text hover:text-white text-sm transition-all duration-200 focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary/20",{"opacity-50 cursor-not-allowed hover:border-dark-border hover:text-dark-text":pe.value==="all"&&Ne.value==="all"&&!or.value,"hover:bg-primary/10":pe.value!=="all"||Ne.value!=="all"||or.value}]),disabled:pe.value==="all"&&Ne.value==="all"&&!or.value}," Reset ",10,Hit)])])]),mo[14]||(mo[14]=Ff('
Time
Type
Route
LEN
Path/Hashes
RSSI
SNR
Score
TX Delay
Status
',1)),Re("div",Wit,[gu(nK,{name:"packet-list",tag:"div",class:"space-y-4",appear:""},{default:Y2(()=>[(zi(!0),Vi(Ou,null,sf(An.value,(ko,pl)=>(zi(),Vi("div",{key:`${ko.packet_hash}_${ko.timestamp}_${pl}`,class:Xs(["packet-row border-b border-dark-border/50 pb-4 hover:bg-white/5 transition-colors duration-200 cursor-pointer rounded-[10px] p-2 border-l-4",yi(ko.type)]),onClick:fu=>Gt(ko)},[Re("div",Zit,[Re("div",$it,aa(ai(ko.timestamp)),1),Re("div",Git,[Re("div",{class:Xs(["w-2 h-2 rounded-full",Li(ko.type)])},null,2),Re("span",Yit,aa(Qi(ko.type)),1)]),Re("div",Kit,[Re("span",{class:Xs(["inline-block px-2 py-1 rounded text-xs font-medium",fa(ko.route)])},aa(Gi(ko.route)),3)]),Re("div",Xit,aa(ko.length)+"B",1),Re("div",Jit,[Re("div",Qit,[Re("span",tat,aa(ko.src_hash?.slice(-4)||"????")+" → "+aa(ko.dst_hash?.slice(-4)||"????"),1)])]),Re("div",eat,aa(ko.rssi.toFixed(0)),1),Re("div",rat,aa(ko.snr.toFixed(1))+"dB",1),Re("div",nat,aa(ko.score.toFixed(2)),1),Re("div",iat,aa(Number(ko.tx_delay_ms)>0?Number(ko.tx_delay_ms).toFixed(1)+"ms":""),1),Re("div",aat,[Re("div",null,[Re("span",{class:Xs(["text-xs font-medium",un(ko)])},aa(ia(ko)),3),ko.drop_reason?(zi(),Vi("p",oat,aa(ko.drop_reason),1)):bs("",!0)])])])],10,qit))),128))]),_:1})]),Ft.value>1?(zi(),Vi("div",sat,[Re("div",lat,[Re("span",uat," Showing "+aa((z.value-1)*t2+1)+" - "+aa(Math.min(z.value*t2,Wr.value.length))+" of "+aa(Wr.value.length)+" packets ",1),jn.value?(zi(),Vi("div",cat,[mo[11]||(mo[11]=Re("span",{class:"text-dark-text text-xs"},"•",-1)),Re("button",{onClick:Va,disabled:mt.value,class:Xs(["glass-card border border-primary rounded-[8px] px-3 py-1.5 text-xs transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20 hover:bg-primary/5",{"text-primary border-primary cursor-pointer":!mt.value,"text-dark-text border-dark-border cursor-not-allowed opacity-50":mt.value}])},aa(mt.value?"Loading...":`Load ${Math.min(200,oy-J.value)} more`),11,hat),Re("span",fat,"("+aa(J.value)+"/"+aa(oy)+" max)",1)])):bs("",!0)]),Re("div",dat,[Re("button",{onClick:mo[2]||(mo[2]=ko=>z.value=z.value-1),disabled:z.value<=1,class:Xs(["glass-card border rounded-[10px] px-3 py-2 text-sm transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20",{"border-dark-border text-dark-text cursor-not-allowed opacity-50":z.value<=1,"border-dark-border text-white hover:border-primary hover:text-primary hover:bg-primary/5":z.value>1}])}," Previous ",10,pat),Re("div",mat,[z.value>3?(zi(),Vi("button",{key:0,onClick:mo[3]||(mo[3]=ko=>z.value=1),class:"glass-card border border-dark-border hover:border-primary rounded-[8px] px-3 py-2 text-sm text-white hover:text-primary hover:bg-primary/5 transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20"}," 1 ")):bs("",!0),z.value>4?(zi(),Vi("span",gat,"...")):bs("",!0),(zi(!0),Vi(Ou,null,sf(Array.from({length:Math.min(5,Ft.value)},(ko,pl)=>Math.max(1,Math.min(z.value-2,Ft.value-4))+pl).filter(ko=>ko<=Ft.value),ko=>(zi(),Vi("button",{key:ko,onClick:pl=>z.value=ko,class:Xs(["glass-card border rounded-[8px] px-3 py-2 text-sm transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20",{"border-primary bg-primary/10 text-primary":z.value===ko,"border-dark-border text-white hover:border-primary hover:text-primary hover:bg-primary/5":z.value!==ko}])},aa(ko),11,vat))),128)),z.valuez.value=Ft.value),class:"glass-card border border-dark-border hover:border-primary rounded-[8px] px-3 py-2 text-sm text-white hover:text-primary hover:bg-primary/5 transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20"},aa(Ft.value),1)):bs("",!0)]),Re("button",{onClick:mo[5]||(mo[5]=ko=>z.value=z.value+1),disabled:z.value>=Ft.value,class:Xs(["glass-card border rounded-[10px] px-3 py-2 text-sm transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20",{"border-dark-border text-dark-text cursor-not-allowed opacity-50":z.value>=Ft.value,"border-dark-border text-white hover:border-primary hover:text-primary hover:bg-primary/5":z.value(zi(),Vi("div",null,[gu(prt),Re("div",Sat,[gu(Urt),gu(Ert)]),gu(Mat)]))}});function LO(d){return d&&d.__esModule&&Object.prototype.hasOwnProperty.call(d,"default")?d.default:d}var c2={exports:{}};/* @preserve + `})},[Re("span",Art,aa(pe.count),1)],4)]),Re("div",Mrt,[Re("div",Srt,aa(pe.name.replace(/\([^)]*\)/g,"").trim()),1)])]))),128))]))]),l.value.length>0?(zi(),Vi("div",Ert," Total packet types: "+aa(l.value.length)+" | Total packets: "+aa(l.value.reduce((pe,Ne)=>pe+Ne.count,0)),1)):bs("",!0)]))}}),Lrt=ld(Crt,[["__scopeId","data-v-dc58fd68"]]),Prt={class:"glass-card rounded-[10px] p-6"},zrt={class:"relative h-48"},Irt={class:"mt-4 grid grid-cols-2 gap-4"},Ort={class:"text-center"},Drt={class:"text-2xl font-bold text-white"},Frt={class:"text-center"},Rrt={class:"text-2xl font-bold text-white"},Brt={class:"mt-3 grid grid-cols-3 gap-3 text-center"},Nrt={class:"text-sm font-semibold text-accent-purple"},jrt={class:"text-sm font-semibold text-accent-red"},Urt={class:"text-sm font-semibold text-white"},Vrt=Th({name:"PerformanceChart",__name:"PerformanceChart",setup(d){const l=rw(),z=lo(null),j=lo([]),J=lo(null),mt=lo(!0),kt=async()=>{try{mt.value=!0;const Gt=await Xh.get("/recent_packets",{limit:50});if(!Gt.success){j.value=[],mt.value=!1,Z0(()=>{Dt()});return}const re=Gt.data||[],pe=Date.now(),Ne=24,or=12,_r=Ne*60*60*1e3/or,Fr=[];for(let zr=0;zr{const ai=jn.timestamp*1e3;return ai>=Wr&&ai!jn.transmitted).length,ei=Ft.filter(jn=>jn.transmitted).length;Fr.push({time:new Date(Wr+_r/2).toISOString(),rxPackets:kn,txPackets:ei})}j.value=Fr,mt.value=!1,Z0(()=>{Dt()})}catch{j.value=[],mt.value=!1,Z0(()=>{Dt()})}},Dt=()=>{if(!z.value)return;const Gt=z.value,re=Gt.getContext("2d");if(!re)return;const pe=Gt.parentElement;if(!pe)return;const Ne=pe.getBoundingClientRect(),or=Ne.width,_r=Ne.height;Gt.width=or*window.devicePixelRatio,Gt.height=_r*window.devicePixelRatio,Gt.style.width=or+"px",Gt.style.height=_r+"px",re.scale(window.devicePixelRatio,window.devicePixelRatio);const Fr=20;if(re.clearRect(0,0,or,_r),mt.value){re.fillStyle="#666",re.font="16px sans-serif",re.textAlign="center",re.fillText("Loading chart data...",or/2,_r/2);return}if(j.value.length===0){re.fillStyle="#666",re.font="16px sans-serif",re.textAlign="center",re.fillText("No data available",or/2,_r/2);return}const zr=j.value.every(Gi=>Gi.rxPackets===0&&Gi.txPackets===0),Wr=or-Fr*2,An=_r-Fr*2,Ft=j.value.flatMap(Gi=>[Gi.rxPackets,Gi.txPackets]),kn=Math.min(...Ft),ei=Math.max(...Ft),jn=kn,ai=ei,Qi=Math.max(ai-jn,1);if(re.strokeStyle="rgba(255, 255, 255, 0.1)",re.lineWidth=1,jn<=0&&ai>=0){re.strokeStyle="rgba(255, 255, 255, 0.3)",re.lineWidth=2;const Gi=_r-Fr-(0-jn)/Qi*An;re.beginPath(),re.moveTo(Fr,Gi),re.lineTo(or-Fr,Gi),re.stroke(),Gi>20&&Gi<_r-20&&(re.fillStyle="rgba(255, 255, 255, 0.7)",re.font="10px system-ui",re.textAlign="left",re.fillText("0",Fr+2,Gi-2)),re.strokeStyle="rgba(255, 255, 255, 0.1)",re.lineWidth=1}for(let Gi=0;Gi<=5;Gi++){const un=Fr+An*Gi/5;re.beginPath(),re.moveTo(Fr,un),re.lineTo(or-Fr,un),re.stroke()}for(let Gi=0;Gi<=6;Gi++){const un=Fr+Wr*Gi/6;re.beginPath(),re.moveTo(un,Fr),re.lineTo(un,_r-Fr),re.stroke()}j.value.length>1&&(re.strokeStyle="#EBA0FC",re.lineWidth=2,re.beginPath(),j.value.forEach((Gi,un)=>{const ia=Fr+Wr*un/(j.value.length-1),fa=_r-Fr-(Gi.rxPackets-jn)/Qi*An;un===0?re.moveTo(ia,fa):re.lineTo(ia,fa)}),re.stroke(),re.fillStyle="#EBA0FC",j.value.forEach((Gi,un)=>{const ia=Fr+Wr*un/(j.value.length-1),fa=_r-Fr-(Gi.rxPackets-jn)/Qi*An;re.beginPath(),re.arc(ia,fa,2,0,2*Math.PI),re.fill()})),j.value.length>1&&(re.strokeStyle="#FB787B",re.lineWidth=2,re.beginPath(),j.value.forEach((Gi,un)=>{const ia=Fr+Wr*un/(j.value.length-1),fa=_r-Fr-(Gi.txPackets-jn)/Qi*An;un===0?re.moveTo(ia,fa):re.lineTo(ia,fa)}),re.stroke(),re.fillStyle="#FB787B",j.value.forEach((Gi,un)=>{const ia=Fr+Wr*un/(j.value.length-1),fa=_r-Fr-(Gi.txPackets-jn)/Qi*An;re.beginPath(),re.arc(ia,fa,2,0,2*Math.PI),re.fill()})),re.fillStyle="rgba(255, 255, 255, 0.6)",re.font="12px system-ui",re.textAlign="center",zr&&(re.fillStyle="rgba(255, 255, 255, 0.6)",re.font="14px system-ui",re.textAlign="center",re.fillText("No packet activity in last 24 hours",or/2,_r-15))};return t0(()=>{kt(),J.value=window.setInterval(kt,3e4),Z0(()=>{Dt(),setTimeout(()=>{Dt()},100)}),window.addEventListener("resize",Dt)}),dg(()=>{J.value&&clearInterval(J.value),window.removeEventListener("resize",Dt)}),(Gt,re)=>(zi(),Vi("div",Prt,[re[5]||(re[5]=Ff('

Performance Metrics

Packet Activity (Last 24 Hours)

Received
Transmitted
',3)),Re("div",zrt,[Re("canvas",{ref_key:"chartRef",ref:z,class:"absolute inset-0 w-full h-full"},null,512)]),Re("div",Irt,[Re("div",Ort,[Re("div",Drt,aa(Ju(l).packetStats?.total_packets||0),1),re[0]||(re[0]=Re("div",{class:"text-xs text-white/70 uppercase tracking-wide"},"Total Received",-1))]),Re("div",Frt,[Re("div",Rrt,aa(Ju(l).packetStats?.transmitted_packets||0),1),re[1]||(re[1]=Re("div",{class:"text-xs text-white/70 uppercase tracking-wide"},"Total Transmitted",-1))])]),Re("div",Brt,[Re("div",null,[Re("div",Nrt,aa(j.value.length>0?Math.round(j.value.reduce((pe,Ne)=>pe+Ne.rxPackets,0)/j.value.length*100)/100:0),1),re[2]||(re[2]=Re("div",{class:"text-xs text-white/60"},"Avg RX/hr",-1))]),Re("div",null,[Re("div",jrt,aa(j.value.length>0?Math.round(j.value.reduce((pe,Ne)=>pe+Ne.txPackets,0)/j.value.length*100)/100:0),1),re[3]||(re[3]=Re("div",{class:"text-xs text-white/60"},"Avg TX/hr",-1))]),Re("div",null,[Re("div",Urt,aa(Ju(l).packetStats?.dropped_packets||0),1),re[4]||(re[4]=Re("div",{class:"text-xs text-white/60"},"Dropped",-1))])])]))}}),Hrt=ld(Vrt,[["__scopeId","data-v-2ece57e8"]]),Wrt={class:"relative w-full max-w-4xl max-h-[90vh] overflow-hidden"},qrt={class:"glass-card rounded-[20px] p-8 backdrop-blur-[50px] shadow-2xl border border-white/20"},Zrt={class:"flex items-center justify-between mb-6"},$rt={class:"text-white/70 text-sm"},Grt={class:"max-h-[70vh] overflow-y-auto custom-scrollbar"},Yrt={class:"mb-6"},Krt={class:"glass-card bg-white/5 rounded-[15px] p-4"},Xrt={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},Jrt={class:"space-y-3"},Qrt={class:"flex justify-between py-2 border-b border-white/10"},tnt={class:"text-white font-mono text-sm"},ent={class:"flex justify-between py-2 border-b border-white/10"},rnt={class:"text-white font-mono text-xs break-all"},nnt={key:0,class:"flex justify-between py-2 border-b border-white/10"},int={class:"text-white font-mono text-xs"},ant={class:"space-y-3"},ont={class:"flex justify-between py-2 border-b border-white/10"},snt={class:"text-white font-semibold"},lnt={class:"flex justify-between py-2 border-b border-white/10"},unt={class:"text-white font-semibold"},cnt={class:"flex justify-between py-2 border-b border-white/10"},hnt={class:"mb-6"},fnt={class:"glass-card bg-white/5 rounded-[15px] p-4"},dnt={class:"space-y-3"},pnt={class:"flex justify-between py-2 border-b border-white/10"},mnt={class:"text-white"},gnt={key:0,class:"pt-2"},vnt={class:"glass-card bg-black/30 rounded-[10px] p-4 mb-4"},ynt={class:"w-full overflow-x-auto"},xnt={class:"text-white/90 text-xs font-mono whitespace-pre leading-relaxed min-w-full"},_nt={class:"flex items-center justify-between mb-3"},bnt={class:"text-white/80 text-sm font-semibold"},wnt={class:"text-white/60 text-xs"},knt={class:"glass-card bg-black/40 rounded-[8px] p-3 mb-3 overflow-x-auto"},Tnt={class:"font-mono text-sm text-white whitespace-pre min-w-full"},Ant={class:"glass-card bg-white/5 rounded-[10px] overflow-hidden"},Mnt={class:"text-cyan-400 text-sm font-mono"},Snt={class:"text-white text-sm"},Ent={class:"text-white text-sm font-semibold"},Cnt={class:"text-orange-400 text-sm font-mono"},Lnt={key:0,class:"text-white/60 text-xs italic mt-2 px-1"},Pnt={key:1,class:"py-2"},znt={class:"mb-6"},Int={class:"glass-card bg-white/5 rounded-[15px] p-4"},Ont={class:"space-y-4"},Dnt={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},Fnt={class:"flex justify-between py-2 border-b border-white/10"},Rnt={class:"flex justify-between py-2 border-b border-white/10"},Bnt={key:0,class:"py-2"},Nnt={class:"glass-card bg-black/20 rounded-[10px] p-4"},jnt={class:"flex items-center flex-wrap gap-2"},Unt={class:"relative group"},Vnt={class:"relative px-3 py-2 bg-gradient-to-br from-blue-500/20 to-cyan-500/20 border border-cyan-400/40 rounded-lg transform transition-all hover:scale-105"},Hnt={class:"font-mono text-xs font-semibold text-white/90"},Wnt={class:"absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 px-2 py-1 bg-black/90 text-white text-xs rounded opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none whitespace-nowrap z-10"},qnt={key:0,class:"mx-2 text-cyan-400/60"},Znt={key:1,class:"py-2"},$nt={class:"text-white/70 text-sm mb-2 flex items-center"},Gnt={key:0,class:"w-4 h-4 ml-2 text-yellow-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Ynt={key:1,class:"text-yellow-400 text-xs ml-1"},Knt={class:"glass-card bg-black/20 rounded-[10px] p-4"},Xnt={class:"flex items-center flex-wrap gap-2"},Jnt={class:"relative group"},Qnt={key:0,class:"absolute -top-1 -right-1 w-2 h-2 bg-yellow-400 rounded-full animate-pulse"},tit={class:"absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 px-2 py-1 bg-black/90 text-white text-xs rounded opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none whitespace-nowrap z-10"},eit={key:0,class:"mx-1 text-orange-400/60"},rit={class:"mb-6"},nit={class:"glass-card bg-white/5 rounded-[15px] p-4"},iit={class:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-4"},ait={class:"text-center p-3 glass-card bg-black/20 rounded-[10px]"},oit={class:"text-lg font-bold text-white"},sit={class:"text-center p-3 glass-card bg-black/20 rounded-[10px]"},lit={class:"text-center p-3 glass-card bg-black/20 rounded-[10px]"},uit={class:"text-lg font-bold text-white"},cit={class:"mb-4"},hit={class:"flex items-center gap-3"},fit={class:"flex gap-1"},dit={class:"text-white/80 text-sm capitalize"},pit={key:0,class:"mb-4"},mit={class:"text-white/70 text-sm mb-3"},git={class:"space-y-2"},vit={class:"flex items-center gap-3"},yit={class:"text-white/60 text-sm"},xit={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},_it={class:"space-y-2"},bit={class:"flex justify-between py-2 border-b border-white/10"},wit={class:"text-white"},kit={class:"flex justify-between py-2 border-b border-white/10"},Tit={class:"space-y-2"},Ait={class:"flex justify-between py-2 border-b border-white/10"},Mit={key:0,class:"flex justify-between py-2 border-b border-white/10"},Sit={class:"text-red-400 text-sm"},Eit={class:"mt-6 pt-4 border-t border-white/10 flex justify-end"},Cit=Th({name:"PacketDetailsModal",__name:"PacketDetailsModal",props:{packet:{},isOpen:{type:Boolean},localHash:{}},emits:["close"],setup(d,{emit:l}){const z=d,j=l,J=Ft=>new Date(Ft*1e3).toLocaleString(),mt=Ft=>Ft.transmitted?Ft.is_duplicate?"text-amber-400":Ft.drop_reason?"text-red-400":"text-green-400":"text-red-400",kt=Ft=>Ft.transmitted?Ft.is_duplicate?"Duplicate":Ft.drop_reason?"Dropped":"Forwarded":"Dropped",Dt=Ft=>({0:"Request",1:"Response",2:"Plain Text Message",3:"Acknowledgment",4:"Node Advertisement",5:"Group Text Message",6:"Group Datagram",7:"Anonymous Request",8:"Returned Path",9:"Trace",10:"Multi-part Packet",15:"Custom Packet"})[Ft]||`Unknown Type (${Ft})`,Gt=Ft=>({0:"Transport Flood",1:"Flood",2:"Direct",3:"Transport Direct"})[Ft]||`Unknown Route (${Ft})`,re=Ft=>{if(!Ft)return"None";const ei=Ft.replace(/\s+/g,"").toUpperCase().match(/.{2}/g)||[],jn=[];for(let ai=0;ai{try{let jn=0;const ai=kn.length/2;if(ai>=100){if(kn.length>=jn+64){const Qi=kn.slice(jn,jn+64);Ft.push({name:"Public Key",byteRange:`${(ei+jn)/2}-${(ei+jn+63)/2}`,hexData:Qi.match(/.{8}/g)?.join(" ")||Qi,description:"Ed25519 public key of the node (32 bytes)",fields:[{bits:"0-255",name:"Ed25519 Public Key",value:`${Qi.slice(0,16)}...${Qi.slice(-16)}`,binary:"32 bytes (256 bits)"}]}),jn+=64}if(kn.length>=jn+8){const Qi=kn.slice(jn,jn+8),Gi=parseInt(Qi,16),un=new Date(Gi*1e3);Ft.push({name:"Timestamp",byteRange:`${(ei+jn)/2}-${(ei+jn+7)/2}`,hexData:Qi.match(/.{2}/g)?.join(" ")||Qi,description:"Unix timestamp of advertisement",fields:[{bits:"0-31",name:"Unix Timestamp",value:`${Gi} (${un.toLocaleString()})`,binary:Gi.toString(2).padStart(32,"0")}]}),jn+=8}if(kn.length>=jn+128){const Qi=kn.slice(jn,jn+128);Ft.push({name:"Signature",byteRange:`${(ei+jn)/2}-${(ei+jn+127)/2}`,hexData:Qi.match(/.{8}/g)?.join(" ")||Qi,description:"Ed25519 signature of public key, timestamp, and appdata",fields:[{bits:"0-511",name:"Ed25519 Signature",value:`${Qi.slice(0,16)}...${Qi.slice(-16)}`,binary:"64 bytes (512 bits)"}]}),jn+=128}if(kn.length>jn){const Qi=kn.slice(jn);Ne(Ft,Qi,ei+jn)}}else Ft.push({name:"ADVERT AppData (Partial)",byteRange:`${ei/2}-${ei/2+ai-1}`,hexData:kn.match(/.{2}/g)?.join(" ")||kn,description:`Partial ADVERT data - appears to be just AppData portion (${ai} bytes)`,fields:[{bits:`0-${ai*8-1}`,name:"Partial Data",value:`${ai} bytes - attempting to decode as AppData`,binary:`${ai} bytes (${ai*8} bits)`}]}),Ne(Ft,kn,ei)}catch(jn){Ft.push({name:"ADVERT Parse Error",byteRange:"N/A",hexData:kn.slice(0,32)+"...",description:"Failed to parse ADVERT payload structure",fields:[{bits:"N/A",name:"Error",value:`Parse error: ${jn instanceof Error?jn.message:"Unknown error"}`,binary:"Invalid"}]})}},Ne=(Ft,kn,ei)=>{try{const jn=kn.length/2;Ft.push({name:"AppData",byteRange:`${ei/2}-${ei/2+jn-1}`,hexData:kn.match(/.{2}/g)?.join(" ")||kn,description:`Node advertisement application data (${jn} bytes)`,fields:[{bits:`0-${jn*8-1}`,name:"Application Data",value:`${jn} bytes (contains flags, location, name, etc.)`,binary:`${jn} bytes (${jn*8} bits)`}]});let ai=0;if(kn.length>=2){const Qi=parseInt(kn.slice(ai,ai+2),16),Gi=[],un=!!(Qi&16),ia=!!(Qi&32),fa=!!(Qi&64),Li=!!(Qi&128);if(Qi&1&&Gi.push("is chat node"),Qi&2&&Gi.push("is repeater"),Qi&4&&Gi.push("is room server"),Qi&8&&Gi.push("is sensor"),un&&Gi.push("has location"),ia&&Gi.push("has feature 1"),fa&&Gi.push("has feature 2"),Li&&Gi.push("has name"),Ft.push({name:"AppData Flags",byteRange:`${(ei+ai)/2}`,hexData:`0x${kn.slice(ai,ai+2)}`,description:"Flags indicating which optional fields are present",fields:[{bits:"0-7",name:"Flags",value:Gi.join(", ")||"none",binary:Qi.toString(2).padStart(8,"0")}]}),ai+=2,un&&kn.length>=ai+16){const yi=kn.slice(ai,ai+8),ra=[];for(let fu=6;fu>=0;fu-=2)ra.push(yi.slice(fu,fu+2));const Da=parseInt(ra.join(""),16),Ni=Da>2147483647?Da-4294967296:Da,Ei=Ni/1e6,Va=kn.slice(ai+8,ai+16),ss=[];for(let fu=6;fu>=0;fu-=2)ss.push(Va.slice(fu,fu+2));const mo=parseInt(ss.join(""),16),ko=mo>2147483647?mo-4294967296:mo,pl=ko/1e6;Ft.push({name:"Location Data",byteRange:`${(ei+ai)/2}-${(ei+ai+15)/2}`,hexData:`${yi.match(/.{2}/g)?.join(" ")||yi} ${Va.match(/.{2}/g)?.join(" ")||Va}`,description:"GPS coordinates (latitude and longitude)",fields:[{bits:"0-31",name:"Latitude",value:`${Ei.toFixed(6)}° (raw: ${Ni})`,binary:Ni.toString(2).padStart(32,"0")},{bits:"32-63",name:"Longitude",value:`${pl.toFixed(6)}° (raw: ${ko})`,binary:ko.toString(2).padStart(32,"0")}]}),ai+=16}if(ia&&kn.length>=ai+4){const yi=kn.slice(ai,ai+4),ra=parseInt(yi,16);Ft.push({name:"Feature 1",byteRange:`${(ei+ai)/2}-${(ei+ai+3)/2}`,hexData:yi.match(/.{2}/g)?.join(" ")||yi,description:"Reserved feature 1 (2 bytes)",fields:[{bits:"0-15",name:"Feature 1 Value",value:`${ra}`,binary:ra.toString(2).padStart(16,"0")}]}),ai+=4}if(fa&&kn.length>=ai+4){const yi=kn.slice(ai,ai+4),ra=parseInt(yi,16);Ft.push({name:"Feature 2",byteRange:`${(ei+ai)/2}-${(ei+ai+3)/2}`,hexData:yi.match(/.{2}/g)?.join(" ")||yi,description:"Reserved feature 2 (2 bytes)",fields:[{bits:"0-15",name:"Feature 2 Value",value:`${ra}`,binary:ra.toString(2).padStart(16,"0")}]}),ai+=4}if(Li&&kn.length>ai){const yi=kn.slice(ai),ra=yi.match(/.{2}/g)||[],Da=ra.map(Ni=>{const Ei=parseInt(Ni,16);return Ei>=32&&Ei<=126?String.fromCharCode(Ei):"."}).join("").replace(/\.+$/,"");Ft.push({name:"Node Name",byteRange:`${(ei+ai)/2}-${(ei+kn.length-1)/2}`,hexData:yi.match(/.{2}/g)?.join(" ")||yi,description:`Node name string (${ra.length} bytes)`,fields:[{bits:`0-${ra.length*8-1}`,name:"Node Name",value:`"${Da}"`,binary:`ASCII text (${ra.length} bytes)`}]})}}}catch(jn){Ft.push({name:"AppData Parse Error",byteRange:"N/A",hexData:kn.slice(0,Math.min(32,kn.length)),description:"Failed to parse AppData structure",fields:[{bits:"N/A",name:"Error",value:`Parse error: ${jn instanceof Error?jn.message:"Unknown error"}`,binary:"Invalid"}]})}},or=Ft=>{if(!Ft)return[];if(Array.isArray(Ft))return Ft;if(typeof Ft=="string")try{return JSON.parse(Ft)}catch{return[]}return[]},_r=Ft=>{const kn=[];if(!Ft)return kn;try{const ei=Ft.raw_packet;if(ei){const jn=ei.replace(/\s+/g,"").toUpperCase();let ai=0;if(jn.length>=2){const Qi=jn.slice(ai,ai+2),Gi=parseInt(Qi,16),un=Gi&3,ia=(Gi&60)>>2,fa=(Gi&192)>>6,Li={0:"Transport Flood",1:"Flood",2:"Direct",3:"Transport Direct"},yi={0:"REQ",1:"RESPONSE",2:"TXT_MSG",3:"ACK",4:"ADVERT",5:"GRP_TXT",6:"GRP_DATA",7:"ANON_REQ",8:"PATH",9:"TRACE",10:"MULTIPART",15:"RAW_CUSTOM"};if(kn.push({name:"Header",byteRange:"0",hexData:`0x${Qi}`,description:"Contains routing type, payload type, and payload version",fields:[{bits:"0-1",name:"Route Type",value:Li[un]||"Unknown",binary:un.toString(2).padStart(2,"0")},{bits:"2-5",name:"Payload Type",value:yi[ia]||"Unknown",binary:ia.toString(2).padStart(4,"0")},{bits:"6-7",name:"Version",value:fa.toString(),binary:fa.toString(2).padStart(2,"0")}]}),ai+=2,(un===0||un===3)&&jn.length>=ai+8){const Da=jn.slice(ai,ai+8),Ni=parseInt(Da.slice(0,4),16),Ei=parseInt(Da.slice(4,8),16);kn.push({name:"Transport Codes",byteRange:"1-4",hexData:`${Da.slice(0,4)} ${Da.slice(4,8)}`,description:"2x 16-bit transport codes for routing optimization",fields:[{bits:"0-15",name:"Code 1",value:Ni.toString(),binary:Ni.toString(2).padStart(16,"0")},{bits:"16-31",name:"Code 2",value:Ei.toString(),binary:Ei.toString(2).padStart(16,"0")}]}),ai+=8}if(jn.length>=ai+2){const Da=jn.slice(ai,ai+2),Ni=parseInt(Da,16);if(kn.push({name:"Path Length",byteRange:`${ai/2}`,hexData:`0x${Da}`,description:`${Ni} bytes of path data`,fields:[{bits:"0-7",name:"Path Length",value:`${Ni} bytes`,binary:Ni.toString(2).padStart(8,"0")}]}),ai+=2,Ni>0&&jn.length>=ai+Ni*2){const Ei=jn.slice(ai,ai+Ni*2);kn.push({name:"Path Data",byteRange:`${ai/2}-${(ai+Ni*2-2)/2}`,hexData:Ei.match(/.{2}/g)?.join(" ")||Ei,description:"Routing path information",fields:[{bits:`0-${Ni*8-1}`,name:"Route Path",value:`${Ni} bytes of routing data`,binary:`${Ni} bytes (${Ni*8} bits)`}]}),ai+=Ni*2}}if(jn.length>ai){const Da=jn.slice(ai),Ni=Da.length/2;ia===4?pe(kn,Da,ai):kn.push({name:"Payload Data",byteRange:`${ai/2}-${ai/2+Ni-1}`,hexData:Da.match(/.{2}/g)?.join(" ")||Da,description:"Application data content",fields:[{bits:`0-${Ni*8-1}`,name:"Application Data",value:`${Ni} bytes`,binary:`${Ni} bytes (${Ni*8} bits)`}]})}}}else{if(Ft.header){const jn=Ft.header.replace(/0x/gi,"").replace(/\s+/g,"").toUpperCase(),ai=parseInt(jn,16),Qi=ai&3,Gi=(ai&60)>>2,un=(ai&192)>>6,ia={0:"Transport Flood",1:"Flood",2:"Direct",3:"Transport Direct"},fa={0:"REQ",1:"RESPONSE",2:"TXT_MSG",3:"ACK",4:"ADVERT",5:"GRP_TXT",6:"GRP_DATA",7:"ANON_REQ",8:"PATH",9:"TRACE",10:"MULTIPART",15:"RAW_CUSTOM"};kn.push({name:"Header",byteRange:"0",hexData:`0x${jn}`,description:"Contains routing type, payload type, and payload version",fields:[{bits:"0-1",name:"Route Type",value:ia[Qi]||"Unknown",binary:Qi.toString(2).padStart(2,"0")},{bits:"2-5",name:"Payload Type",value:fa[Gi]||"Unknown",binary:Gi.toString(2).padStart(4,"0")},{bits:"6-7",name:"Version",value:un.toString(),binary:un.toString(2).padStart(2,"0")}]}),Ft.transport_codes&&kn.push({name:"Transport Codes",byteRange:"1-4",hexData:Ft.transport_codes,description:"2x 16-bit transport codes for routing optimization",fields:[{bits:"0-31",name:"Transport Codes",value:Ft.transport_codes,binary:"Available in separate field"}]}),Ft.original_path&&Ft.original_path.length>0&&kn.push({name:"Original Path",byteRange:"?",hexData:Ft.original_path.join(" "),description:`Original routing path (${Ft.original_path.length} nodes)`,fields:[{bits:"0-?",name:"Path Nodes",value:`${Ft.original_path.length} nodes`,binary:"Available as node list"}]}),Ft.forwarded_path&&Ft.forwarded_path.length>0&&kn.push({name:"Forwarded Path",byteRange:"?",hexData:Ft.forwarded_path.join(" "),description:`Forwarded routing path (${Ft.forwarded_path.length} nodes)`,fields:[{bits:"0-?",name:"Path Nodes",value:`${Ft.forwarded_path.length} nodes`,binary:"Available as node list"}]})}if(Ft.payload){const jn=Ft.payload.replace(/\s+/g,"").toUpperCase(),ai=jn.length/2;Ft.type===4?pe(kn,jn,0):kn.push({name:"Payload Data",byteRange:`0-${ai-1}`,hexData:jn.match(/.{2}/g)?.join(" ")||jn,description:`Application data content (${ai} bytes)`,fields:[{bits:`0-${ai*8-1}`,name:"Application Data",value:`${ai} bytes`,binary:`${ai} bytes (${ai*8} bits)`}]})}}}catch{kn.push({name:"Parse Error",byteRange:"N/A",hexData:"Error",description:"Unable to parse packet structure",fields:[{bits:"N/A",name:"Error",value:"Parse failed",binary:"Invalid"}]})}return kn},Fr=Ft=>Ft>=10?"text-green-400":Ft>=5?"text-cyan-400":Ft>=0?"text-yellow-400":"text-red-400",zr=(Ft,kn=8)=>{const jn={7:-7.5,8:-10,9:-12.5,10:-15,11:-17.5,12:-20}[kn]||-10;let ai,Qi;return Ft>=jn+10?(ai=4,Qi="signal-excellent"):Ft>=jn+5?(ai=3,Qi="signal-good"):Ft>=jn?(ai=2,Qi="signal-fair"):(ai=1,Qi="signal-poor"),{level:ai,className:Qi}},Wr=Ft=>{Ft.key==="Escape"&&j("close")},An=Ft=>{Ft.target===Ft.currentTarget&&j("close")};return(Ft,kn)=>(zi(),hm($z,{to:"body"},[gu(LI,{name:"modal",appear:""},{default:Y2(()=>[Ft.isOpen&&Ft.packet?(zi(),Vi("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4",onClick:An,onKeydown:Wr,tabindex:"0"},[kn[36]||(kn[36]=Re("div",{class:"absolute inset-0 bg-black/60 backdrop-blur-md"},null,-1)),Re("div",Wrt,[Re("div",qrt,[Re("div",Zrt,[Re("div",null,[kn[2]||(kn[2]=Re("h2",{class:"text-2xl font-bold text-white mb-1"},"Packet Details",-1)),Re("p",$rt,aa(Dt(Ft.packet.type))+" - "+aa(Gt(Ft.packet.route)),1)]),Re("button",{onClick:kn[0]||(kn[0]=ei=>j("close")),class:"w-8 h-8 flex items-center justify-center rounded-full bg-white/10 hover:bg-white/20 transition-colors duration-200 text-white/70 hover:text-white"},kn[3]||(kn[3]=[Re("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),Re("div",Grt,[Re("div",Yrt,[kn[10]||(kn[10]=Re("h3",{class:"text-lg font-semibold text-white mb-4 flex items-center"},[Re("div",{class:"w-2 h-2 rounded-full bg-cyan-400 mr-3"}),nc(" Basic Information ")],-1)),Re("div",Krt,[Re("div",Xrt,[Re("div",Jrt,[Re("div",Qrt,[kn[4]||(kn[4]=Re("span",{class:"text-white/70 text-sm"},"Timestamp",-1)),Re("span",tnt,aa(J(Ft.packet.timestamp)),1)]),Re("div",ent,[kn[5]||(kn[5]=Re("span",{class:"text-white/70 text-sm"},"Packet Hash",-1)),Re("span",rnt,aa(Ft.packet.packet_hash),1)]),Ft.packet.header?(zi(),Vi("div",nnt,[kn[6]||(kn[6]=Re("span",{class:"text-white/70 text-sm"},"Header",-1)),Re("span",int,aa(Ft.packet.header),1)])):bs("",!0)]),Re("div",ant,[Re("div",ont,[kn[7]||(kn[7]=Re("span",{class:"text-white/70 text-sm"},"Type",-1)),Re("span",snt,aa(Ft.packet.type)+" ("+aa(Dt(Ft.packet.type))+")",1)]),Re("div",lnt,[kn[8]||(kn[8]=Re("span",{class:"text-white/70 text-sm"},"Route",-1)),Re("span",unt,aa(Ft.packet.route)+" ("+aa(Gt(Ft.packet.route))+")",1)]),Re("div",cnt,[kn[9]||(kn[9]=Re("span",{class:"text-white/70 text-sm"},"Status",-1)),Re("span",{class:Xs(["font-semibold",mt(Ft.packet)])},aa(kt(Ft.packet)),3)])])])])]),Re("div",hnt,[kn[16]||(kn[16]=Re("h3",{class:"text-lg font-semibold text-white mb-4 flex items-center"},[Re("div",{class:"w-2 h-2 rounded-full bg-orange-400 mr-3"}),nc(" Payload Data ")],-1)),Re("div",fnt,[Re("div",dnt,[Re("div",pnt,[kn[11]||(kn[11]=Re("span",{class:"text-white/70 text-sm"},"Payload Length",-1)),Re("span",mnt,aa(Ft.packet.payload_length||Ft.packet.length)+" bytes",1)]),Ft.packet.payload?(zi(),Vi("div",gnt,[kn[14]||(kn[14]=Re("div",{class:"text-white/70 text-sm mb-3"},"Payload Analysis",-1)),Re("div",vnt,[kn[12]||(kn[12]=Re("div",{class:"text-white/70 text-xs mb-2 font-semibold"},"Raw Hex Data",-1)),Re("div",ynt,[Re("pre",xnt,aa(re(Ft.packet.payload)),1)])]),(zi(!0),Vi(Ou,null,sf(_r(Ft.packet).filter(ei=>!ei.name.includes("Parse Error")),(ei,jn)=>(zi(),Vi("div",{key:jn,class:"mb-4"},[Re("div",_nt,[Re("h4",bnt,aa(ei.name),1),Re("span",wnt,"Bytes "+aa(ei.byteRange),1)]),Re("div",knt,[Re("div",Tnt,aa(ei.hexData),1)]),Re("div",Ant,[kn[13]||(kn[13]=Re("div",{class:"grid grid-cols-4 gap-4 p-3 bg-white/10 text-white/70 text-xs font-semibold uppercase tracking-wide"},[Re("div",null,"Bits"),Re("div",null,"Field"),Re("div",null,"Value"),Re("div",null,"Binary")],-1)),(zi(!0),Vi(Ou,null,sf(ei.fields,(ai,Qi)=>(zi(),Vi("div",{key:Qi,class:"grid grid-cols-4 gap-4 p-3 border-b border-white/5 last:border-b-0 hover:bg-white/5 transition-colors"},[Re("div",Mnt,aa(ai.bits),1),Re("div",Snt,aa(ai.name),1),Re("div",Ent,aa(ai.value),1),Re("div",Cnt,aa(ai.binary),1)]))),128))]),ei.description?(zi(),Vi("div",Lnt,aa(ei.description),1)):bs("",!0)]))),128))])):(zi(),Vi("div",Pnt,kn[15]||(kn[15]=[Re("span",{class:"text-white/70 text-sm"},"Payload:",-1),Re("span",{class:"text-white/50 ml-2"},"None",-1)])))])])]),Re("div",znt,[kn[24]||(kn[24]=Re("h3",{class:"text-lg font-semibold text-white mb-4 flex items-center"},[Re("div",{class:"w-2 h-2 rounded-full bg-purple-400 mr-3"}),nc(" Path Information ")],-1)),Re("div",Int,[Re("div",Ont,[Re("div",Dnt,[Re("div",Fnt,[kn[17]||(kn[17]=Re("span",{class:"text-white/70 text-sm"},"Source Hash",-1)),Re("span",{class:Xs(["text-white font-mono text-xs",z.localHash&&Ft.packet.src_hash===z.localHash?"bg-cyan-400/20 text-cyan-300 px-1 rounded":""])},aa(Ft.packet.src_hash||"Unknown"),3)]),Re("div",Rnt,[kn[18]||(kn[18]=Re("span",{class:"text-white/70 text-sm"},"Destination Hash",-1)),Re("span",{class:Xs(["text-white font-mono text-xs",z.localHash&&Ft.packet.dst_hash===z.localHash?"bg-cyan-400/20 text-cyan-300 px-1 rounded":""])},aa(Ft.packet.dst_hash||"Broadcast"),3)])]),or(Ft.packet.original_path).length>0?(zi(),Vi("div",Bnt,[kn[20]||(kn[20]=Re("div",{class:"text-white/70 text-sm mb-2"},"Original Path",-1)),Re("div",Nnt,[Re("div",jnt,[(zi(!0),Vi(Ou,null,sf(or(Ft.packet.original_path),(ei,jn)=>(zi(),Vi("div",{key:jn,class:"flex items-center"},[Re("div",Unt,[Re("div",Vnt,[Re("div",Hnt,aa(ei.length<=2?ei.toUpperCase():ei.slice(0,2).toUpperCase()),1)]),Re("div",Wnt," Node: "+aa(ei),1)]),jn0?(zi(),Vi("div",Znt,[Re("div",$nt,[kn[22]||(kn[22]=nc(" Forwarded Path ",-1)),JSON.stringify(or(Ft.packet.original_path))!==JSON.stringify(or(Ft.packet.forwarded_path))?(zi(),Vi("svg",Gnt,kn[21]||(kn[21]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)]))):bs("",!0),JSON.stringify(or(Ft.packet.original_path))!==JSON.stringify(or(Ft.packet.forwarded_path))?(zi(),Vi("span",Ynt,"(Modified)")):bs("",!0)]),Re("div",Knt,[Re("div",Xnt,[(zi(!0),Vi(Ou,null,sf(or(Ft.packet.forwarded_path),(ei,jn)=>(zi(),Vi("div",{key:jn,class:"flex items-center"},[Re("div",Jnt,[Re("div",{class:Xs(["relative px-3 py-2 bg-gradient-to-br from-orange-500/20 to-yellow-500/20 border border-orange-400/40 rounded-lg transform transition-all hover:scale-105",z.localHash&&ei===z.localHash?"bg-gradient-to-br from-yellow-400/30 to-orange-400/30 border-yellow-300 shadow-yellow-400/20 shadow-lg":"hover:border-orange-400/60"])},[Re("div",{class:Xs(["font-mono text-xs font-semibold",z.localHash&&ei===z.localHash?"text-yellow-200":"text-white/90"])},aa(ei.slice(0,2).toUpperCase()),3),z.localHash&&ei===z.localHash?(zi(),Vi("div",Qnt)):bs("",!0)],2),Re("div",tit,aa(ei),1)]),jnRe("div",{key:ei,class:Xs(["w-2 h-6 rounded-sm transition-all duration-300",ei<=zr(Ft.packet.snr).level?{"signal-excellent":"bg-green-400","signal-good":"bg-cyan-400","signal-fair":"bg-yellow-400","signal-poor":"bg-red-400"}[zr(Ft.packet.snr).className]:"bg-white/10"])},null,2)),64))]),Re("span",dit,aa(zr(Ft.packet.snr).className.replace("signal-","")),1)])]),Ft.packet.is_trace&&Ft.packet.path_snr_details&&Ft.packet.path_snr_details.length>0?(zi(),Vi("div",pit,[Re("div",mit,"Path SNR Details ("+aa(Ft.packet.path_snr_details.length)+" hops)",1),Re("div",git,[(zi(!0),Vi(Ou,null,sf(Ft.packet.path_snr_details,(ei,jn)=>(zi(),Vi("div",{key:jn,class:"flex items-center justify-between p-2 glass-card bg-black/20 rounded-[8px]"},[Re("div",vit,[Re("span",yit,aa(jn+1)+".",1),Re("span",{class:Xs(["font-mono text-xs text-white",z.localHash&&ei.hash===z.localHash?"bg-cyan-400/20 text-cyan-300 px-1 rounded":""])},aa(ei.hash),3)]),Re("span",{class:Xs(["text-sm font-bold",Fr(ei.snr_db)])},aa(ei.snr_db.toFixed(1))+"dB ",3)]))),128))])])):bs("",!0),Re("div",xit,[Re("div",_it,[Re("div",bit,[kn[31]||(kn[31]=Re("span",{class:"text-white/70 text-sm"},"TX Delay",-1)),Re("span",wit,aa(Number(Ft.packet.tx_delay_ms)>0?Number(Ft.packet.tx_delay_ms).toFixed(1)+"ms":"-"),1)]),Re("div",kit,[kn[32]||(kn[32]=Re("span",{class:"text-white/70 text-sm"},"Transmitted",-1)),Re("span",{class:Xs(Ft.packet.transmitted?"text-green-400":"text-red-400")},aa(Ft.packet.transmitted?"Yes":"No"),3)])]),Re("div",Tit,[Re("div",Ait,[kn[33]||(kn[33]=Re("span",{class:"text-white/70 text-sm"},"Is Duplicate",-1)),Re("span",{class:Xs(Ft.packet.is_duplicate?"text-amber-400":"text-white/60")},aa(Ft.packet.is_duplicate?"Yes":"No"),3)]),Ft.packet.drop_reason?(zi(),Vi("div",Mit,[kn[34]||(kn[34]=Re("span",{class:"text-white/70 text-sm"},"Drop Reason",-1)),Re("span",Sit,aa(Ft.packet.drop_reason),1)])):bs("",!0)])])])])]),Re("div",Eit,[Re("button",{onClick:kn[1]||(kn[1]=ei=>j("close")),class:"px-6 py-2 bg-gradient-to-r from-cyan-500/20 to-cyan-400/20 hover:from-cyan-500/30 hover:to-cyan-400/30 border border-cyan-400/30 rounded-[10px] text-white transition-all duration-200 backdrop-blur-sm"}," Close ")])])])],32)):bs("",!0)]),_:1})]))}}),Lit=ld(Cit,[["__scopeId","data-v-3b73bfd6"]]),Pit={class:"glass-card rounded-[20px] p-6"},zit={class:"flex justify-between items-center mb-6"},Iit={class:"flex items-center gap-3"},Oit={class:"text-dark-text text-sm"},Dit=["title"],Fit={key:1,class:"text-primary text-sm"},Rit={key:2,class:"text-accent-red text-sm"},Bit={class:"flex items-center gap-3"},Nit={class:"flex flex-col"},jit=["value"],Uit={class:"flex flex-col"},Vit=["value"],Hit={class:"flex flex-col"},Wit={class:"flex flex-col"},qit=["disabled"],Zit={class:"space-y-4 overflow-hidden"},$it=["onClick"],Git={class:"grid grid-cols-12 gap-2 items-center"},Yit={class:"col-span-1 text-white text-sm"},Kit={class:"col-span-1 flex items-center gap-2"},Xit={class:"text-white text-xs"},Jit={class:"col-span-2"},Qit={class:"col-span-1 text-white text-xs"},tat={class:"col-span-2"},eat={class:"space-y-1"},rat={class:"inline-block px-2 py-0.5 rounded bg-[#588187] text-accent-cyan text-xs"},nat={class:"col-span-1 text-white text-xs"},iat={class:"col-span-1 text-white text-xs"},aat={class:"col-span-1 text-white text-xs"},oat={class:"col-span-1 text-white text-xs"},sat={class:"col-span-1"},lat={key:0,class:"text-accent-red text-[8px] italic truncate"},uat={key:0,class:"flex justify-between items-center mt-6 pt-4 border-t border-dark-border"},cat={class:"flex items-center gap-4"},hat={class:"text-dark-text text-sm"},fat={key:0,class:"flex items-center gap-2"},dat=["disabled"],pat={class:"text-dark-text text-xs"},mat={class:"flex items-center gap-2"},gat=["disabled"],vat={class:"flex items-center gap-1"},yat={key:1,class:"text-dark-text text-sm px-2"},xat=["onClick"],_at={key:2,class:"text-dark-text text-sm px-2"},bat=["disabled"],wat={key:1,class:"flex justify-center mt-6 pt-4 border-t border-dark-border"},kat={class:"flex items-center gap-4"},Tat={class:"text-dark-text text-sm"},Aat={class:"text-dark-text text-xs"},Mat={key:2,class:"flex justify-center mt-6 pt-4 border-t border-dark-border"},t2=10,oy=1e3,Sat=Th({name:"PacketTable",__name:"PacketTable",setup(d){const l=rw(),z=lo(1),j=lo(null),J=lo(100),mt=lo(!1),kt=lo(null),Dt=lo(!1),Gt=ss=>{kt.value=ss,Dt.value=!0},re=()=>{Dt.value=!1,kt.value=null},pe=lo("all"),Ne=lo("all"),or=lo(!1),_r=lo(null),Fr=["all","0","1","2","3","4","5","6","7","8","9"],zr=["all","1","2"],Wr=Yo(()=>{let ss=l.recentPackets;if(pe.value!=="all"){const mo=parseInt(pe.value);ss=ss.filter(ko=>ko.type===mo)}if(Ne.value!=="all"){const mo=parseInt(Ne.value);ss=ss.filter(ko=>ko.route===mo)}return or.value&&_r.value!==null&&(ss=ss.filter(mo=>mo.timestamp>=_r.value)),ss}),An=Yo(()=>{const ss=(z.value-1)*t2,mo=ss+t2;return Wr.value.slice(ss,mo)}),Ft=Yo(()=>Math.ceil(Wr.value.length/t2)),kn=Yo(()=>z.value===Ft.value),ei=Yo(()=>l.recentPackets.length>=J.value&&J.valuekn.value&&ei.value&&!mt.value),ai=ss=>new Date(ss*1e3).toLocaleTimeString("en-US",{hour12:!1}),Qi=ss=>({0:"REQ",1:"RESPONSE",2:"TXT_MSG",3:"ACK",4:"ADVERT",5:"GRP_TXT",6:"GRP_DATA",7:"ANON_REQ",8:"PATH",9:"TRACE"})[ss]||`TYPE_${ss}`,Gi=ss=>({0:"T-Flood",1:"Flood",2:"Direct",3:"T-Direct"})[ss]||`Route ${ss}`,un=ss=>ss.transmitted?"text-accent-green":"text-primary",ia=ss=>ss.drop_reason?"Dropped":ss.transmitted?"Forward":"Received",fa=ss=>ss===1?"bg-[#223231] text-accent-cyan":"bg-secondary/30 text-secondary",Li=ss=>({0:"bg-primary",1:"bg-accent-green",2:"bg-secondary",3:"bg-accent-purple",4:"bg-accent-red",5:"bg-accent-cyan",6:"bg-primary",7:"bg-accent-purple",8:"bg-accent-green",9:"bg-secondary"})[ss]||"bg-gray-500",yi=ss=>({0:"border-l-primary",1:"border-l-accent-green",2:"border-l-secondary",3:"border-l-accent-purple",4:"border-l-accent-red",5:"border-l-accent-cyan",6:"border-l-primary",7:"border-l-accent-purple",8:"border-l-accent-green",9:"border-l-secondary"})[ss]||"border-l-gray-500",ra=()=>{pe.value="all",Ne.value="all",or.value=!1,_r.value=null,z.value=1},Da=()=>{or.value?(or.value=!1,_r.value=null):(or.value=!0,_r.value=Date.now()/1e3),z.value=1},Ni=Yo(()=>_r.value?new Date(_r.value*1e3).toLocaleTimeString():""),Ei=async ss=>{try{const mo=ss||J.value;await l.fetchRecentPackets({limit:mo})}catch(mo){console.error("Error fetching packet data:",mo)}},Va=async()=>{if(!(mt.value||J.value>=oy)){mt.value=!0;try{const ss=Math.min(J.value+200,oy);J.value=ss,await Ei(ss)}catch(ss){console.error("Error loading more records:",ss)}finally{mt.value=!1}}};return t0(async()=>{await Ei(),j.value=window.setInterval(Ei,5e3)}),dg(()=>{j.value&&clearInterval(j.value)}),(ss,mo)=>(zi(),Vi(Ou,null,[Re("div",Pit,[Re("div",zit,[Re("div",Iit,[mo[6]||(mo[6]=Re("h3",{class:"text-white text-xl font-semibold"},"Recent Packets",-1)),Re("span",Oit," ("+aa(Wr.value.length)+" of "+aa(Ju(l).recentPackets.length)+") ",1),or.value?(zi(),Vi("span",{key:0,class:"text-primary text-sm bg-primary/10 px-2 py-1 rounded-md border border-primary/20",title:`Filter activated at ${Ni.value}`}," Live Mode (since "+aa(Ni.value)+") ",9,Dit)):bs("",!0),Ju(l).isLoading?(zi(),Vi("span",Fit,"Loading...")):bs("",!0),Ju(l).error?(zi(),Vi("span",Rit,aa(Ju(l).error),1)):bs("",!0)]),Re("div",Bit,[Re("div",Nit,[mo[7]||(mo[7]=Re("label",{class:"text-dark-text text-xs mb-1"},"Type",-1)),$p(Re("select",{"onUpdate:modelValue":mo[0]||(mo[0]=ko=>pe.value=ko),class:"glass-card border border-dark-border rounded-[10px] px-3 py-2 text-white text-sm focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary/20 transition-all duration-200 min-w-[120px] cursor-pointer hover:border-primary/50"},[(zi(),Vi(Ou,null,sf(Fr,ko=>Re("option",{key:ko,value:ko,class:"bg-[#1A1E1F] text-white"},aa(ko==="all"?"All Types":`Type ${ko} (${Qi(parseInt(ko))})`),9,jit)),64))],512),[[iA,pe.value]])]),Re("div",Uit,[mo[8]||(mo[8]=Re("label",{class:"text-dark-text text-xs mb-1"},"Route",-1)),$p(Re("select",{"onUpdate:modelValue":mo[1]||(mo[1]=ko=>Ne.value=ko),class:"glass-card border border-dark-border rounded-[10px] px-3 py-2 text-white text-sm focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary/20 transition-all duration-200 min-w-[120px] cursor-pointer hover:border-primary/50"},[(zi(),Vi(Ou,null,sf(zr,ko=>Re("option",{key:ko,value:ko,class:"bg-[#1A1E1F] text-white"},aa(ko==="all"?"All Routes":`Route ${ko} (${Gi(parseInt(ko))})`),9,Vit)),64))],512),[[iA,Ne.value]])]),Re("div",Hit,[mo[9]||(mo[9]=Re("label",{class:"text-dark-text text-xs mb-1"},"Filter",-1)),Re("button",{onClick:Da,class:Xs(["glass-card border rounded-[10px] px-4 py-2 text-sm transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20 min-w-[120px]",{"border-primary bg-primary/10 text-primary":or.value,"border-dark-border text-dark-text hover:border-primary hover:text-white hover:bg-primary/5":!or.value}])},aa(or.value?"New Only":"Show New"),3)]),Re("div",Wit,[mo[10]||(mo[10]=Re("label",{class:"text-transparent text-xs mb-1"},".",-1)),Re("button",{onClick:ra,class:Xs(["glass-card border border-dark-border hover:border-primary rounded-[10px] px-4 py-2 text-dark-text hover:text-white text-sm transition-all duration-200 focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary/20",{"opacity-50 cursor-not-allowed hover:border-dark-border hover:text-dark-text":pe.value==="all"&&Ne.value==="all"&&!or.value,"hover:bg-primary/10":pe.value!=="all"||Ne.value!=="all"||or.value}]),disabled:pe.value==="all"&&Ne.value==="all"&&!or.value}," Reset ",10,qit)])])]),mo[14]||(mo[14]=Ff('
Time
Type
Route
LEN
Path/Hashes
RSSI
SNR
Score
TX Delay
Status
',1)),Re("div",Zit,[gu(nK,{name:"packet-list",tag:"div",class:"space-y-4",appear:""},{default:Y2(()=>[(zi(!0),Vi(Ou,null,sf(An.value,(ko,pl)=>(zi(),Vi("div",{key:`${ko.packet_hash}_${ko.timestamp}_${pl}`,class:Xs(["packet-row border-b border-dark-border/50 pb-4 hover:bg-white/5 transition-colors duration-200 cursor-pointer rounded-[10px] p-2 border-l-4",yi(ko.type)]),onClick:fu=>Gt(ko)},[Re("div",Git,[Re("div",Yit,aa(ai(ko.timestamp)),1),Re("div",Kit,[Re("div",{class:Xs(["w-2 h-2 rounded-full",Li(ko.type)])},null,2),Re("span",Xit,aa(Qi(ko.type)),1)]),Re("div",Jit,[Re("span",{class:Xs(["inline-block px-2 py-1 rounded text-xs font-medium",fa(ko.route)])},aa(Gi(ko.route)),3)]),Re("div",Qit,aa(ko.length)+"B",1),Re("div",tat,[Re("div",eat,[Re("span",rat,aa(ko.src_hash?.slice(-4)||"????")+" → "+aa(ko.dst_hash?.slice(-4)||"????"),1)])]),Re("div",nat,aa(ko.rssi.toFixed(0)),1),Re("div",iat,aa(ko.snr.toFixed(1))+"dB",1),Re("div",aat,aa(ko.score.toFixed(2)),1),Re("div",oat,aa(Number(ko.tx_delay_ms)>0?Number(ko.tx_delay_ms).toFixed(1)+"ms":""),1),Re("div",sat,[Re("div",null,[Re("span",{class:Xs(["text-xs font-medium",un(ko)])},aa(ia(ko)),3),ko.drop_reason?(zi(),Vi("p",lat,aa(ko.drop_reason),1)):bs("",!0)])])])],10,$it))),128))]),_:1})]),Ft.value>1?(zi(),Vi("div",uat,[Re("div",cat,[Re("span",hat," Showing "+aa((z.value-1)*t2+1)+" - "+aa(Math.min(z.value*t2,Wr.value.length))+" of "+aa(Wr.value.length)+" packets ",1),jn.value?(zi(),Vi("div",fat,[mo[11]||(mo[11]=Re("span",{class:"text-dark-text text-xs"},"•",-1)),Re("button",{onClick:Va,disabled:mt.value,class:Xs(["glass-card border border-primary rounded-[8px] px-3 py-1.5 text-xs transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20 hover:bg-primary/5",{"text-primary border-primary cursor-pointer":!mt.value,"text-dark-text border-dark-border cursor-not-allowed opacity-50":mt.value}])},aa(mt.value?"Loading...":`Load ${Math.min(200,oy-J.value)} more`),11,dat),Re("span",pat,"("+aa(J.value)+"/"+aa(oy)+" max)",1)])):bs("",!0)]),Re("div",mat,[Re("button",{onClick:mo[2]||(mo[2]=ko=>z.value=z.value-1),disabled:z.value<=1,class:Xs(["glass-card border rounded-[10px] px-3 py-2 text-sm transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20",{"border-dark-border text-dark-text cursor-not-allowed opacity-50":z.value<=1,"border-dark-border text-white hover:border-primary hover:text-primary hover:bg-primary/5":z.value>1}])}," Previous ",10,gat),Re("div",vat,[z.value>3?(zi(),Vi("button",{key:0,onClick:mo[3]||(mo[3]=ko=>z.value=1),class:"glass-card border border-dark-border hover:border-primary rounded-[8px] px-3 py-2 text-sm text-white hover:text-primary hover:bg-primary/5 transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20"}," 1 ")):bs("",!0),z.value>4?(zi(),Vi("span",yat,"...")):bs("",!0),(zi(!0),Vi(Ou,null,sf(Array.from({length:Math.min(5,Ft.value)},(ko,pl)=>Math.max(1,Math.min(z.value-2,Ft.value-4))+pl).filter(ko=>ko<=Ft.value),ko=>(zi(),Vi("button",{key:ko,onClick:pl=>z.value=ko,class:Xs(["glass-card border rounded-[8px] px-3 py-2 text-sm transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20",{"border-primary bg-primary/10 text-primary":z.value===ko,"border-dark-border text-white hover:border-primary hover:text-primary hover:bg-primary/5":z.value!==ko}])},aa(ko),11,xat))),128)),z.valuez.value=Ft.value),class:"glass-card border border-dark-border hover:border-primary rounded-[8px] px-3 py-2 text-sm text-white hover:text-primary hover:bg-primary/5 transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20"},aa(Ft.value),1)):bs("",!0)]),Re("button",{onClick:mo[5]||(mo[5]=ko=>z.value=z.value+1),disabled:z.value>=Ft.value,class:Xs(["glass-card border rounded-[10px] px-3 py-2 text-sm transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20",{"border-dark-border text-dark-text cursor-not-allowed opacity-50":z.value>=Ft.value,"border-dark-border text-white hover:border-primary hover:text-primary hover:bg-primary/5":z.value(zi(),Vi("div",null,[gu(grt),Re("div",Cat,[gu(Hrt),gu(Lrt)]),gu(Eat)]))}});function LO(d){return d&&d.__esModule&&Object.prototype.hasOwnProperty.call(d,"default")?d.default:d}var c2={exports:{}};/* @preserve * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade - */var Cat=c2.exports,jL;function Lat(){return jL||(jL=1,function(d,l){(function(z,j){j(l)})(Cat,function(z){var j="1.9.4";function J(ct){var Bt,me,Qe,Pr;for(me=1,Qe=arguments.length;me"u"||!L||!L.Mixin)){ct=kn(ct)?ct:[ct];for(var Bt=0;Bt0?Math.floor(ct):Math.ceil(ct)};Va.prototype={clone:function(){return new Va(this.x,this.y)},add:function(ct){return this.clone()._add(mo(ct))},_add:function(ct){return this.x+=ct.x,this.y+=ct.y,this},subtract:function(ct){return this.clone()._subtract(mo(ct))},_subtract:function(ct){return this.x-=ct.x,this.y-=ct.y,this},divideBy:function(ct){return this.clone()._divideBy(ct)},_divideBy:function(ct){return this.x/=ct,this.y/=ct,this},multiplyBy:function(ct){return this.clone()._multiplyBy(ct)},_multiplyBy:function(ct){return this.x*=ct,this.y*=ct,this},scaleBy:function(ct){return new Va(this.x*ct.x,this.y*ct.y)},unscaleBy:function(ct){return new Va(this.x/ct.x,this.y/ct.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=ss(this.x),this.y=ss(this.y),this},distanceTo:function(ct){ct=mo(ct);var Bt=ct.x-this.x,me=ct.y-this.y;return Math.sqrt(Bt*Bt+me*me)},equals:function(ct){return ct=mo(ct),ct.x===this.x&&ct.y===this.y},contains:function(ct){return ct=mo(ct),Math.abs(ct.x)<=Math.abs(this.x)&&Math.abs(ct.y)<=Math.abs(this.y)},toString:function(){return"Point("+or(this.x)+", "+or(this.y)+")"}};function mo(ct,Bt,me){return ct instanceof Va?ct:kn(ct)?new Va(ct[0],ct[1]):ct==null?ct:typeof ct=="object"&&"x"in ct&&"y"in ct?new Va(ct.x,ct.y):new Va(ct,Bt,me)}function ko(ct,Bt){if(ct)for(var me=Bt?[ct,Bt]:ct,Qe=0,Pr=me.length;Qe=this.min.x&&me.x<=this.max.x&&Bt.y>=this.min.y&&me.y<=this.max.y},intersects:function(ct){ct=pl(ct);var Bt=this.min,me=this.max,Qe=ct.min,Pr=ct.max,Tn=Pr.x>=Bt.x&&Qe.x<=me.x,ji=Pr.y>=Bt.y&&Qe.y<=me.y;return Tn&&ji},overlaps:function(ct){ct=pl(ct);var Bt=this.min,me=this.max,Qe=ct.min,Pr=ct.max,Tn=Pr.x>Bt.x&&Qe.xBt.y&&Qe.y=Bt.lat&&Pr.lat<=me.lat&&Qe.lng>=Bt.lng&&Pr.lng<=me.lng},intersects:function(ct){ct=qo(ct);var Bt=this._southWest,me=this._northEast,Qe=ct.getSouthWest(),Pr=ct.getNorthEast(),Tn=Pr.lat>=Bt.lat&&Qe.lat<=me.lat,ji=Pr.lng>=Bt.lng&&Qe.lng<=me.lng;return Tn&&ji},overlaps:function(ct){ct=qo(ct);var Bt=this._southWest,me=this._northEast,Qe=ct.getSouthWest(),Pr=ct.getNorthEast(),Tn=Pr.lat>Bt.lat&&Qe.latBt.lng&&Qe.lng1,e6=function(){var ct=!1;try{var Bt=Object.defineProperty({},"passive",{get:function(){ct=!0}});window.addEventListener("testPassiveEventSupport",Ne,Bt),window.removeEventListener("testPassiveEventSupport",Ne,Bt)}catch{}return ct}(),r6=function(){return!!document.createElement("canvas").getContext}(),b_=!!(document.createElementNS&&co("svg").createSVGRect),n6=!!b_&&function(){var ct=document.createElement("div");return ct.innerHTML="",(ct.firstChild&&ct.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),i6=!b_&&function(){try{var ct=document.createElement("div");ct.innerHTML='';var Bt=ct.firstChild;return Bt.style.behavior="url(#default#VML)",Bt&&typeof Bt.adj=="object"}catch{return!1}}(),cw=navigator.platform.indexOf("Mac")===0,w_=navigator.platform.indexOf("Linux")===0;function r0(ct){return navigator.userAgent.toLowerCase().indexOf(ct)>=0}var El={ie:ms,ielt9:ns,edge:Ko,webkit:Oo,android:wl,android23:ws,androidStock:du,opera:Hu,chrome:Fc,gecko:kc,safari:Vd,phantom:kd,opera12:e0,win:d0,ie3d:Pm,webkit3d:uv,gecko3d:sp,any3d:p0,mobile:zm,mobileWebkit:zy,mobileWebkit3d:K4,msPointer:sw,pointer:lw,touch:X4,touchNative:uw,mobileOpera:J4,mobileGecko:Q4,retina:t6,passiveEvents:e6,canvas:r6,svg:b_,vml:i6,inlineSvg:n6,mac:cw,linux:w_},Yc=El.msPointer?"MSPointerDown":"pointerdown",Td=El.msPointer?"MSPointerMove":"pointermove",k_=El.msPointer?"MSPointerUp":"pointerup",$u=El.msPointer?"MSPointerCancel":"pointercancel",y1={touchstart:Yc,touchmove:Td,touchend:k_,touchcancel:$u},hw={touchstart:s6,touchmove:G0,touchend:G0,touchcancel:G0},cv={},Iy=!1;function x1(ct,Bt,me){return Bt==="touchstart"&&T_(),hw[Bt]?(me=hw[Bt].bind(this,me),ct.addEventListener(y1[Bt],me,!1),me):(console.warn("wrong event specified:",Bt),Ne)}function a6(ct,Bt,me){if(!y1[Bt]){console.warn("wrong event specified:",Bt);return}ct.removeEventListener(y1[Bt],me,!1)}function Xo(ct){cv[ct.pointerId]=ct}function o6(ct){cv[ct.pointerId]&&(cv[ct.pointerId]=ct)}function _1(ct){delete cv[ct.pointerId]}function T_(){Iy||(document.addEventListener(Yc,Xo,!0),document.addEventListener(Td,o6,!0),document.addEventListener(k_,_1,!0),document.addEventListener($u,_1,!0),Iy=!0)}function G0(ct,Bt){if(Bt.pointerType!==(Bt.MSPOINTER_TYPE_MOUSE||"mouse")){Bt.touches=[];for(var me in cv)Bt.touches.push(cv[me]);Bt.changedTouches=[Bt],ct(Bt)}}function s6(ct,Bt){Bt.MSPOINTER_TYPE_TOUCH&&Bt.pointerType===Bt.MSPOINTER_TYPE_TOUCH&&mc(Bt),G0(ct,Bt)}function l6(ct){var Bt={},me,Qe;for(Qe in ct)me=ct[Qe],Bt[Qe]=me&&me.bind?me.bind(ct):me;return ct=Bt,Bt.type="dblclick",Bt.detail=2,Bt.isTrusted=!1,Bt._simulated=!0,Bt}var u6=200;function c6(ct,Bt){ct.addEventListener("dblclick",Bt);var me=0,Qe;function Pr(Tn){if(Tn.detail!==1){Qe=Tn.detail;return}if(!(Tn.pointerType==="mouse"||Tn.sourceCapabilities&&!Tn.sourceCapabilities.firesTouchEvents)){var ji=mw(Tn);if(!(ji.some(function(Ya){return Ya instanceof HTMLLabelElement&&Ya.attributes.for})&&!ji.some(function(Ya){return Ya instanceof HTMLInputElement||Ya instanceof HTMLSelectElement}))){var Na=Date.now();Na-me<=u6?(Qe++,Qe===2&&Bt(l6(Tn))):Qe=1,me=Na}}}return ct.addEventListener("click",Pr),{dblclick:Bt,simDblclick:Pr}}function A_(ct,Bt){ct.removeEventListener("dblclick",Bt.dblclick),ct.removeEventListener("click",Bt.simDblclick)}var M_=Dm(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),b1=Dm(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),fw=b1==="webkitTransition"||b1==="OTransition"?b1+"End":"transitionend";function dw(ct){return typeof ct=="string"?document.getElementById(ct):ct}function w1(ct,Bt){var me=ct.style[Bt]||ct.currentStyle&&ct.currentStyle[Bt];if((!me||me==="auto")&&document.defaultView){var Qe=document.defaultView.getComputedStyle(ct,null);me=Qe?Qe[Bt]:null}return me==="auto"?null:me}function Cc(ct,Bt,me){var Qe=document.createElement(ct);return Qe.className=Bt||"",me&&me.appendChild(Qe),Qe}function Tf(ct){var Bt=ct.parentNode;Bt&&Bt.removeChild(ct)}function Oy(ct){for(;ct.firstChild;)ct.removeChild(ct.firstChild)}function hv(ct){var Bt=ct.parentNode;Bt&&Bt.lastChild!==ct&&Bt.appendChild(ct)}function bn(ct){var Bt=ct.parentNode;Bt&&Bt.firstChild!==ct&&Bt.insertBefore(ct,Bt.firstChild)}function S_(ct,Bt){if(ct.classList!==void 0)return ct.classList.contains(Bt);var me=Om(ct);return me.length>0&&new RegExp("(^|\\s)"+Bt+"(\\s|$)").test(me)}function Wu(ct,Bt){if(ct.classList!==void 0)for(var me=Fr(Bt),Qe=0,Pr=me.length;Qe0?2*window.devicePixelRatio:1;function Ac(ct){return El.edge?ct.wheelDeltaY/2:ct.deltaY&&ct.deltaMode===0?-ct.deltaY/Xc:ct.deltaY&&ct.deltaMode===1?-ct.deltaY*20:ct.deltaY&&ct.deltaMode===2?-ct.deltaY*60:ct.deltaX||ct.deltaZ?0:ct.wheelDelta?(ct.wheelDeltaY||ct.wheelDelta)/2:ct.detail&&Math.abs(ct.detail)<32765?-ct.detail*20:ct.detail?ct.detail/-32765*60:0}function yg(ct,Bt){var me=Bt.relatedTarget;if(!me)return!0;try{for(;me&&me!==ct;)me=me.parentNode}catch{return!1}return me!==ct}var Dp={__proto__:null,on:Pu,off:Bh,stopPropagation:n0,disableScrollPropagation:dm,disableClickPropagation:fv,preventDefault:mc,stop:vg,getPropagationPath:mw,getMousePosition:Jd,getWheelDelta:Ac,isExternalTarget:yg,addListener:Pu,removeListener:Bh},A1=Ei.extend({run:function(ct,Bt,me,Qe){this.stop(),this._el=ct,this._inProgress=!0,this._duration=me||.25,this._easeOutPower=1/Math.max(Qe||.5,.2),this._startPos=Rc(ct),this._offset=Bt.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=fa(this._animate,this),this._step()},_step:function(ct){var Bt=+new Date-this._startTime,me=this._duration*1e3;Btthis.options.maxZoom)?this.setZoom(ct):this},panInsideBounds:function(ct,Bt){this._enforcingBounds=!0;var me=this.getCenter(),Qe=this._limitCenter(me,this._zoom,qo(ct));return me.equals(Qe)||this.panTo(Qe,Bt),this._enforcingBounds=!1,this},panInside:function(ct,Bt){Bt=Bt||{};var me=mo(Bt.paddingTopLeft||Bt.padding||[0,0]),Qe=mo(Bt.paddingBottomRight||Bt.padding||[0,0]),Pr=this.project(this.getCenter()),Tn=this.project(ct),ji=this.getPixelBounds(),Na=pl([ji.min.add(me),ji.max.subtract(Qe)]),Ya=Na.getSize();if(!Na.contains(Tn)){this._enforcingBounds=!0;var xo=Tn.subtract(Na.getCenter()),Vs=Na.extend(Tn).getSize().subtract(Ya);Pr.x+=xo.x<0?-Vs.x:Vs.x,Pr.y+=xo.y<0?-Vs.y:Vs.y,this.panTo(this.unproject(Pr),Bt),this._enforcingBounds=!1}return this},invalidateSize:function(ct){if(!this._loaded)return this;ct=J({animate:!1,pan:!0},ct===!0?{animate:!0}:ct);var Bt=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var me=this.getSize(),Qe=Bt.divideBy(2).round(),Pr=me.divideBy(2).round(),Tn=Qe.subtract(Pr);return!Tn.x&&!Tn.y?this:(ct.animate&&ct.pan?this.panBy(Tn):(ct.pan&&this._rawPanBy(Tn),this.fire("move"),ct.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(kt(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:Bt,newSize:me}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(ct){if(ct=this._locateOptions=J({timeout:1e4,watch:!1},ct),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var Bt=kt(this._handleGeolocationResponse,this),me=kt(this._handleGeolocationError,this);return ct.watch?this._locationWatchId=navigator.geolocation.watchPosition(Bt,me,ct):navigator.geolocation.getCurrentPosition(Bt,me,ct),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(ct){if(this._container._leaflet_id){var Bt=ct.code,me=ct.message||(Bt===1?"permission denied":Bt===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:Bt,message:"Geolocation error: "+me+"."})}},_handleGeolocationResponse:function(ct){if(this._container._leaflet_id){var Bt=ct.coords.latitude,me=ct.coords.longitude,Qe=new fo(Bt,me),Pr=Qe.toBounds(ct.coords.accuracy*2),Tn=this._locateOptions;if(Tn.setView){var ji=this.getBoundsZoom(Pr);this.setView(Qe,Tn.maxZoom?Math.min(ji,Tn.maxZoom):ji)}var Na={latlng:Qe,bounds:Pr,timestamp:ct.timestamp};for(var Ya in ct.coords)typeof ct.coords[Ya]=="number"&&(Na[Ya]=ct.coords[Ya]);this.fire("locationfound",Na)}},addHandler:function(ct,Bt){if(!Bt)return this;var me=this[ct]=new Bt(this);return this._handlers.push(me),this.options[ct]&&me.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),Tf(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(Li(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var ct;for(ct in this._layers)this._layers[ct].remove();for(ct in this._panes)Tf(this._panes[ct]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(ct,Bt){var me="leaflet-pane"+(ct?" leaflet-"+ct.replace("Pane","")+"-pane":""),Qe=Cc("div",me,Bt||this._mapPane);return ct&&(this._panes[ct]=Qe),Qe},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var ct=this.getPixelBounds(),Bt=this.unproject(ct.getBottomLeft()),me=this.unproject(ct.getTopRight());return new fu(Bt,me)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(ct,Bt,me){ct=qo(ct),me=mo(me||[0,0]);var Qe=this.getZoom()||0,Pr=this.getMinZoom(),Tn=this.getMaxZoom(),ji=ct.getNorthWest(),Na=ct.getSouthEast(),Ya=this.getSize().subtract(me),xo=pl(this.project(Na,Qe),this.project(ji,Qe)).getSize(),Vs=El.any3d?this.options.zoomSnap:1,xl=Ya.x/xo.x,Du=Ya.y/xo.y,Sd=Bt?Math.max(xl,Du):Math.min(xl,Du);return Qe=this.getScaleZoom(Sd,Qe),Vs&&(Qe=Math.round(Qe/(Vs/100))*(Vs/100),Qe=Bt?Math.ceil(Qe/Vs)*Vs:Math.floor(Qe/Vs)*Vs),Math.max(Pr,Math.min(Tn,Qe))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new Va(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(ct,Bt){var me=this._getTopLeftPoint(ct,Bt);return new ko(me,me.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(ct){return this.options.crs.getProjectedBounds(ct===void 0?this.getZoom():ct)},getPane:function(ct){return typeof ct=="string"?this._panes[ct]:ct},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(ct,Bt){var me=this.options.crs;return Bt=Bt===void 0?this._zoom:Bt,me.scale(ct)/me.scale(Bt)},getScaleZoom:function(ct,Bt){var me=this.options.crs;Bt=Bt===void 0?this._zoom:Bt;var Qe=me.zoom(ct*me.scale(Bt));return isNaN(Qe)?1/0:Qe},project:function(ct,Bt){return Bt=Bt===void 0?this._zoom:Bt,this.options.crs.latLngToPoint(Ta(ct),Bt)},unproject:function(ct,Bt){return Bt=Bt===void 0?this._zoom:Bt,this.options.crs.pointToLatLng(mo(ct),Bt)},layerPointToLatLng:function(ct){var Bt=mo(ct).add(this.getPixelOrigin());return this.unproject(Bt)},latLngToLayerPoint:function(ct){var Bt=this.project(Ta(ct))._round();return Bt._subtract(this.getPixelOrigin())},wrapLatLng:function(ct){return this.options.crs.wrapLatLng(Ta(ct))},wrapLatLngBounds:function(ct){return this.options.crs.wrapLatLngBounds(qo(ct))},distance:function(ct,Bt){return this.options.crs.distance(Ta(ct),Ta(Bt))},containerPointToLayerPoint:function(ct){return mo(ct).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(ct){return mo(ct).add(this._getMapPanePos())},containerPointToLatLng:function(ct){var Bt=this.containerPointToLayerPoint(mo(ct));return this.layerPointToLatLng(Bt)},latLngToContainerPoint:function(ct){return this.layerPointToContainerPoint(this.latLngToLayerPoint(Ta(ct)))},mouseEventToContainerPoint:function(ct){return Jd(ct,this._container)},mouseEventToLayerPoint:function(ct){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(ct))},mouseEventToLatLng:function(ct){return this.layerPointToLatLng(this.mouseEventToLayerPoint(ct))},_initContainer:function(ct){var Bt=this._container=dw(ct);if(Bt){if(Bt._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");Pu(Bt,"scroll",this._onScroll,this),this._containerId=Gt(Bt)},_initLayout:function(){var ct=this._container;this._fadeAnimated=this.options.fadeAnimation&&El.any3d,Wu(ct,"leaflet-container"+(El.touch?" leaflet-touch":"")+(El.retina?" leaflet-retina":"")+(El.ielt9?" leaflet-oldie":"")+(El.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var Bt=w1(ct,"position");Bt!=="absolute"&&Bt!=="relative"&&Bt!=="fixed"&&Bt!=="sticky"&&(ct.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var ct=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),ic(this._mapPane,new Va(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(Wu(ct.markerPane,"leaflet-zoom-hide"),Wu(ct.shadowPane,"leaflet-zoom-hide"))},_resetView:function(ct,Bt,me){ic(this._mapPane,new Va(0,0));var Qe=!this._loaded;this._loaded=!0,Bt=this._limitZoom(Bt),this.fire("viewprereset");var Pr=this._zoom!==Bt;this._moveStart(Pr,me)._move(ct,Bt)._moveEnd(Pr),this.fire("viewreset"),Qe&&this.fire("load")},_moveStart:function(ct,Bt){return ct&&this.fire("zoomstart"),Bt||this.fire("movestart"),this},_move:function(ct,Bt,me,Qe){Bt===void 0&&(Bt=this._zoom);var Pr=this._zoom!==Bt;return this._zoom=Bt,this._lastCenter=ct,this._pixelOrigin=this._getNewPixelOrigin(ct),Qe?me&&me.pinch&&this.fire("zoom",me):((Pr||me&&me.pinch)&&this.fire("zoom",me),this.fire("move",me)),this},_moveEnd:function(ct){return ct&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return Li(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(ct){ic(this._mapPane,this._getMapPanePos().subtract(ct))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(ct){this._targets={},this._targets[Gt(this._container)]=this;var Bt=ct?Bh:Pu;Bt(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&Bt(window,"resize",this._onResize,this),El.any3d&&this.options.transform3DLimit&&(ct?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){Li(this._resizeRequest),this._resizeRequest=fa(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var ct=this._getMapPanePos();Math.max(Math.abs(ct.x),Math.abs(ct.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(ct,Bt){for(var me=[],Qe,Pr=Bt==="mouseout"||Bt==="mouseover",Tn=ct.target||ct.srcElement,ji=!1;Tn;){if(Qe=this._targets[Gt(Tn)],Qe&&(Bt==="click"||Bt==="preclick")&&this._draggableMoved(Qe)){ji=!0;break}if(Qe&&Qe.listens(Bt,!0)&&(Pr&&!yg(Tn,ct)||(me.push(Qe),Pr))||Tn===this._container)break;Tn=Tn.parentNode}return!me.length&&!ji&&!Pr&&this.listens(Bt,!0)&&(me=[this]),me},_isClickDisabled:function(ct){for(;ct&&ct!==this._container;){if(ct._leaflet_disable_click)return!0;ct=ct.parentNode}},_handleDOMEvent:function(ct){var Bt=ct.target||ct.srcElement;if(!(!this._loaded||Bt._leaflet_disable_events||ct.type==="click"&&this._isClickDisabled(Bt))){var me=ct.type;me==="mousedown"&&Hd(Bt),this._fireDOMEvent(ct,me)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(ct,Bt,me){if(ct.type==="click"){var Qe=J({},ct);Qe.type="preclick",this._fireDOMEvent(Qe,Qe.type,me)}var Pr=this._findEventTargets(ct,Bt);if(me){for(var Tn=[],ji=0;ji0?Math.round(ct-Bt)/2:Math.max(0,Math.ceil(ct))-Math.max(0,Math.floor(Bt))},_limitZoom:function(ct){var Bt=this.getMinZoom(),me=this.getMaxZoom(),Qe=El.any3d?this.options.zoomSnap:1;return Qe&&(ct=Math.round(ct/Qe)*Qe),Math.max(Bt,Math.min(me,ct))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){Rf(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(ct,Bt){var me=this._getCenterOffset(ct)._trunc();return(Bt&&Bt.animate)!==!0&&!this.getSize().contains(me)?!1:(this.panBy(me,Bt),!0)},_createAnimProxy:function(){var ct=this._proxy=Cc("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(ct),this.on("zoomanim",function(Bt){var me=M_,Qe=this._proxy.style[me];pu(this._proxy,this.project(Bt.center,Bt.zoom),this.getZoomScale(Bt.zoom,1)),Qe===this._proxy.style[me]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){Tf(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var ct=this.getCenter(),Bt=this.getZoom();pu(this._proxy,this.project(ct,Bt),this.getZoomScale(Bt,1))},_catchTransitionEnd:function(ct){this._animatingZoom&&ct.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(ct,Bt,me){if(this._animatingZoom)return!0;if(me=me||{},!this._zoomAnimated||me.animate===!1||this._nothingToAnimate()||Math.abs(Bt-this._zoom)>this.options.zoomAnimationThreshold)return!1;var Qe=this.getZoomScale(Bt),Pr=this._getCenterOffset(ct)._divideBy(1-1/Qe);return me.animate!==!0&&!this.getSize().contains(Pr)?!1:(fa(function(){this._moveStart(!0,me.noMoveStart||!1)._animateZoom(ct,Bt,!0)},this),!0)},_animateZoom:function(ct,Bt,me,Qe){this._mapPane&&(me&&(this._animatingZoom=!0,this._animateToCenter=ct,this._animateToZoom=Bt,Wu(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:ct,zoom:Bt,noUpdate:Qe}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(kt(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&Rf(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function js(ct,Bt){return new Mc(ct,Bt)}var lp=ra.extend({options:{position:"topright"},initialize:function(ct){zr(this,ct)},getPosition:function(){return this.options.position},setPosition:function(ct){var Bt=this._map;return Bt&&Bt.removeControl(this),this.options.position=ct,Bt&&Bt.addControl(this),this},getContainer:function(){return this._container},addTo:function(ct){this.remove(),this._map=ct;var Bt=this._container=this.onAdd(ct),me=this.getPosition(),Qe=ct._controlCorners[me];return Wu(Bt,"leaflet-control"),me.indexOf("bottom")!==-1?Qe.insertBefore(Bt,Qe.firstChild):Qe.appendChild(Bt),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(Tf(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(ct){this._map&&ct&&ct.screenX>0&&ct.screenY>0&&this._map.getContainer().focus()}}),i0=function(ct){return new lp(ct)};Mc.include({addControl:function(ct){return ct.addTo(this),this},removeControl:function(ct){return ct.remove(),this},_initControlPos:function(){var ct=this._controlCorners={},Bt="leaflet-",me=this._controlContainer=Cc("div",Bt+"control-container",this._container);function Qe(Pr,Tn){var ji=Bt+Pr+" "+Bt+Tn;ct[Pr+Tn]=Cc("div",ji,me)}Qe("top","left"),Qe("top","right"),Qe("bottom","left"),Qe("bottom","right")},_clearControlPos:function(){for(var ct in this._controlCorners)Tf(this._controlCorners[ct]);Tf(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var dv=lp.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(ct,Bt,me,Qe){return me1,this._baseLayersList.style.display=ct?"":"none"),this._separator.style.display=Bt&&ct?"":"none",this},_onLayerChange:function(ct){this._handlingClick||this._update();var Bt=this._getLayer(Gt(ct.target)),me=Bt.overlay?ct.type==="add"?"overlayadd":"overlayremove":ct.type==="add"?"baselayerchange":null;me&&this._map.fire(me,Bt)},_createRadioElement:function(ct,Bt){var me='",Qe=document.createElement("div");return Qe.innerHTML=me,Qe.firstChild},_addItem:function(ct){var Bt=document.createElement("label"),me=this._map.hasLayer(ct.layer),Qe;ct.overlay?(Qe=document.createElement("input"),Qe.type="checkbox",Qe.className="leaflet-control-layers-selector",Qe.defaultChecked=me):Qe=this._createRadioElement("leaflet-base-layers_"+Gt(this),me),this._layerControlInputs.push(Qe),Qe.layerId=Gt(ct.layer),Pu(Qe,"click",this._onInputClick,this);var Pr=document.createElement("span");Pr.innerHTML=" "+ct.name;var Tn=document.createElement("span");Bt.appendChild(Tn),Tn.appendChild(Qe),Tn.appendChild(Pr);var ji=ct.overlay?this._overlaysList:this._baseLayersList;return ji.appendChild(Bt),this._checkDisabledLayers(),Bt},_onInputClick:function(){if(!this._preventClick){var ct=this._layerControlInputs,Bt,me,Qe=[],Pr=[];this._handlingClick=!0;for(var Tn=ct.length-1;Tn>=0;Tn--)Bt=ct[Tn],me=this._getLayer(Bt.layerId).layer,Bt.checked?Qe.push(me):Bt.checked||Pr.push(me);for(Tn=0;Tn=0;Pr--)Bt=ct[Pr],me=this._getLayer(Bt.layerId).layer,Bt.disabled=me.options.minZoom!==void 0&&Qeme.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var ct=this._section;this._preventClick=!0,Pu(ct,"click",mc),this.expand();var Bt=this;setTimeout(function(){Bh(ct,"click",mc),Bt._preventClick=!1})}}),Y0=function(ct,Bt,me){return new dv(ct,Bt,me)},Es=lp.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(ct){var Bt="leaflet-control-zoom",me=Cc("div",Bt+" leaflet-bar"),Qe=this.options;return this._zoomInButton=this._createButton(Qe.zoomInText,Qe.zoomInTitle,Bt+"-in",me,this._zoomIn),this._zoomOutButton=this._createButton(Qe.zoomOutText,Qe.zoomOutTitle,Bt+"-out",me,this._zoomOut),this._updateDisabled(),ct.on("zoomend zoomlevelschange",this._updateDisabled,this),me},onRemove:function(ct){ct.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(ct){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(ct.shiftKey?3:1))},_createButton:function(ct,Bt,me,Qe,Pr){var Tn=Cc("a",me,Qe);return Tn.innerHTML=ct,Tn.href="#",Tn.title=Bt,Tn.setAttribute("role","button"),Tn.setAttribute("aria-label",Bt),fv(Tn),Pu(Tn,"click",vg),Pu(Tn,"click",Pr,this),Pu(Tn,"click",this._refocusOnMap,this),Tn},_updateDisabled:function(){var ct=this._map,Bt="leaflet-disabled";Rf(this._zoomInButton,Bt),Rf(this._zoomOutButton,Bt),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||ct._zoom===ct.getMinZoom())&&(Wu(this._zoomOutButton,Bt),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||ct._zoom===ct.getMaxZoom())&&(Wu(this._zoomInButton,Bt),this._zoomInButton.setAttribute("aria-disabled","true"))}});Mc.mergeOptions({zoomControl:!0}),Mc.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Es,this.addControl(this.zoomControl))});var gw=function(ct){return new Es(ct)},E_=lp.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(ct){var Bt="leaflet-control-scale",me=Cc("div",Bt),Qe=this.options;return this._addScales(Qe,Bt+"-line",me),ct.on(Qe.updateWhenIdle?"moveend":"move",this._update,this),ct.whenReady(this._update,this),me},onRemove:function(ct){ct.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(ct,Bt,me){ct.metric&&(this._mScale=Cc("div",Bt,me)),ct.imperial&&(this._iScale=Cc("div",Bt,me))},_update:function(){var ct=this._map,Bt=ct.getSize().y/2,me=ct.distance(ct.containerPointToLatLng([0,Bt]),ct.containerPointToLatLng([this.options.maxWidth,Bt]));this._updateScales(me)},_updateScales:function(ct){this.options.metric&&ct&&this._updateMetric(ct),this.options.imperial&&ct&&this._updateImperial(ct)},_updateMetric:function(ct){var Bt=this._getRoundNum(ct),me=Bt<1e3?Bt+" m":Bt/1e3+" km";this._updateScale(this._mScale,me,Bt/ct)},_updateImperial:function(ct){var Bt=ct*3.2808399,me,Qe,Pr;Bt>5280?(me=Bt/5280,Qe=this._getRoundNum(me),this._updateScale(this._iScale,Qe+" mi",Qe/me)):(Pr=this._getRoundNum(Bt),this._updateScale(this._iScale,Pr+" ft",Pr/Bt))},_updateScale:function(ct,Bt,me){ct.style.width=Math.round(this.options.maxWidth*me)+"px",ct.innerHTML=Bt},_getRoundNum:function(ct){var Bt=Math.pow(10,(Math.floor(ct)+"").length-1),me=ct/Bt;return me=me>=10?10:me>=5?5:me>=3?3:me>=2?2:1,Bt*me}}),h6=function(ct){return new E_(ct)},C_='',L_=lp.extend({options:{position:"bottomright",prefix:''+(El.inlineSvg?C_+" ":"")+"Leaflet"},initialize:function(ct){zr(this,ct),this._attributions={}},onAdd:function(ct){ct.attributionControl=this,this._container=Cc("div","leaflet-control-attribution"),fv(this._container);for(var Bt in ct._layers)ct._layers[Bt].getAttribution&&this.addAttribution(ct._layers[Bt].getAttribution());return this._update(),ct.on("layeradd",this._addAttribution,this),this._container},onRemove:function(ct){ct.off("layeradd",this._addAttribution,this)},_addAttribution:function(ct){ct.layer.getAttribution&&(this.addAttribution(ct.layer.getAttribution()),ct.layer.once("remove",function(){this.removeAttribution(ct.layer.getAttribution())},this))},setPrefix:function(ct){return this.options.prefix=ct,this._update(),this},addAttribution:function(ct){return ct?(this._attributions[ct]||(this._attributions[ct]=0),this._attributions[ct]++,this._update(),this):this},removeAttribution:function(ct){return ct?(this._attributions[ct]&&(this._attributions[ct]--,this._update()),this):this},_update:function(){if(this._map){var ct=[];for(var Bt in this._attributions)this._attributions[Bt]&&ct.push(Bt);var me=[];this.options.prefix&&me.push(this.options.prefix),ct.length&&me.push(ct.join(", ")),this._container.innerHTML=me.join(' ')}}});Mc.mergeOptions({attributionControl:!0}),Mc.addInitHook(function(){this.options.attributionControl&&new L_().addTo(this)});var f6=function(ct){return new L_(ct)};lp.Layers=dv,lp.Zoom=Es,lp.Scale=E_,lp.Attribution=L_,i0.layers=Y0,i0.zoom=gw,i0.scale=h6,i0.attribution=f6;var K0=ra.extend({initialize:function(ct){this._map=ct},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});K0.addTo=function(ct,Bt){return ct.addHandler(Bt,this),this};var up={Events:Ni},P0=El.touch?"touchstart mousedown":"mousedown",Fm=Ei.extend({options:{clickTolerance:3},initialize:function(ct,Bt,me,Qe){zr(this,Qe),this._element=ct,this._dragStartTarget=Bt||ct,this._preventOutline=me},enable:function(){this._enabled||(Pu(this._dragStartTarget,P0,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Fm._dragging===this&&this.finishDrag(!0),Bh(this._dragStartTarget,P0,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(ct){if(this._enabled&&(this._moved=!1,!S_(this._element,"leaflet-zoom-anim"))){if(ct.touches&&ct.touches.length!==1){Fm._dragging===this&&this.finishDrag();return}if(!(Fm._dragging||ct.shiftKey||ct.which!==1&&ct.button!==1&&!ct.touches)&&(Fm._dragging=this,this._preventOutline&&Hd(this._element),Kc(),C0(),!this._moving)){this.fire("down");var Bt=ct.touches?ct.touches[0]:ct,me=Ad(this._element);this._startPoint=new Va(Bt.clientX,Bt.clientY),this._startPos=Rc(this._element),this._parentScale=T1(me);var Qe=ct.type==="mousedown";Pu(document,Qe?"mousemove":"touchmove",this._onMove,this),Pu(document,Qe?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(ct){if(this._enabled){if(ct.touches&&ct.touches.length>1){this._moved=!0;return}var Bt=ct.touches&&ct.touches.length===1?ct.touches[0]:ct,me=new Va(Bt.clientX,Bt.clientY)._subtract(this._startPoint);!me.x&&!me.y||Math.abs(me.x)+Math.abs(me.y)Tn&&(ji=Na,Tn=Ya);Tn>me&&(Bt[ji]=1,_g(ct,Bt,me,Qe,ji),_g(ct,Bt,me,ji,Pr))}function yw(ct,Bt){for(var me=[ct[0]],Qe=1,Pr=0,Tn=ct.length;QeBt&&(me.push(ct[Qe]),Pr=Qe);return PrBt.max.x&&(me|=2),ct.yBt.max.y&&(me|=8),me}function m6(ct,Bt){var me=Bt.x-ct.x,Qe=Bt.y-ct.y;return me*me+Qe*Qe}function pv(ct,Bt,me,Qe){var Pr=Bt.x,Tn=Bt.y,ji=me.x-Pr,Na=me.y-Tn,Ya=ji*ji+Na*Na,xo;return Ya>0&&(xo=((ct.x-Pr)*ji+(ct.y-Tn)*Na)/Ya,xo>1?(Pr=me.x,Tn=me.y):xo>0&&(Pr+=ji*xo,Tn+=Na*xo)),ji=ct.x-Pr,Na=ct.y-Tn,Qe?ji*ji+Na*Na:new Va(Pr,Tn)}function g0(ct){return!kn(ct[0])||typeof ct[0][0]!="object"&&typeof ct[0][0]<"u"}function xw(ct){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),g0(ct)}function _w(ct,Bt){var me,Qe,Pr,Tn,ji,Na,Ya,xo;if(!ct||ct.length===0)throw new Error("latlngs not passed");g0(ct)||(console.warn("latlngs are not flat! Only the first ring will be used"),ct=ct[0]);var Vs=Ta([0,0]),xl=qo(ct),Du=xl.getNorthWest().distanceTo(xl.getSouthWest())*xl.getNorthEast().distanceTo(xl.getNorthWest());Du<1700&&(Vs=Ry(ct));var Sd=ct.length,Bf=[];for(me=0;meQe){Ya=(Tn-Qe)/Pr,xo=[Na.x-Ya*(Na.x-ji.x),Na.y-Ya*(Na.y-ji.y)];break}var wp=Bt.unproject(mo(xo));return Ta([wp.lat+Vs.lat,wp.lng+Vs.lng])}var Qh={__proto__:null,simplify:z_,pointToSegmentDistance:vw,closestPointOnSegment:xg,clipSegment:O_,_getEdgeIntersection:bg,_getBitCode:wg,_sqClosestPointOnSegment:pv,isFlat:g0,_flat:xw,polylineCenter:_w},v0={project:function(ct){return new Va(ct.lng,ct.lat)},unproject:function(ct){return new fo(ct.y,ct.x)},bounds:new ko([-180,-90],[180,90])},mv={R:6378137,R_MINOR:6356752314245179e-9,bounds:new ko([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(ct){var Bt=Math.PI/180,me=this.R,Qe=ct.lat*Bt,Pr=this.R_MINOR/me,Tn=Math.sqrt(1-Pr*Pr),ji=Tn*Math.sin(Qe),Na=Math.tan(Math.PI/4-Qe/2)/Math.pow((1-ji)/(1+ji),Tn/2);return Qe=-me*Math.log(Math.max(Na,1e-10)),new Va(ct.lng*Bt*me,Qe)},unproject:function(ct){for(var Bt=180/Math.PI,me=this.R,Qe=this.R_MINOR/me,Pr=Math.sqrt(1-Qe*Qe),Tn=Math.exp(-ct.y/me),ji=Math.PI/2-2*Math.atan(Tn),Na=0,Ya=.1,xo;Na<15&&Math.abs(Ya)>1e-7;Na++)xo=Pr*Math.sin(ji),xo=Math.pow((1-xo)/(1+xo),Pr/2),Ya=Math.PI/2-2*Math.atan(Tn*xo)-ji,ji+=Ya;return new fo(ji*Bt,ct.x*Bt/me)}},D_={__proto__:null,LonLat:v0,Mercator:mv,SphericalMercator:Ps},F_=J({},go,{code:"EPSG:3395",projection:mv,transformation:function(){var ct=.5/(Math.PI*mv.R);return gi(ct,.5,-ct,.5)}()}),By=J({},go,{code:"EPSG:4326",projection:v0,transformation:gi(1/180,1,-1/180,.5)}),kg=J({},Ea,{projection:v0,transformation:gi(1,0,-1,0),scale:function(ct){return Math.pow(2,ct)},zoom:function(ct){return Math.log(ct)/Math.LN2},distance:function(ct,Bt){var me=Bt.lng-ct.lng,Qe=Bt.lat-ct.lat;return Math.sqrt(me*me+Qe*Qe)},infinite:!0});Ea.Earth=go,Ea.EPSG3395=F_,Ea.EPSG3857=bi,Ea.EPSG900913=li,Ea.EPSG4326=By,Ea.Simple=kg;var a0=Ei.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(ct){return ct.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(ct){return ct&&ct.removeLayer(this),this},getPane:function(ct){return this._map.getPane(ct?this.options[ct]||ct:this.options.pane)},addInteractiveTarget:function(ct){return this._map._targets[Gt(ct)]=this,this},removeInteractiveTarget:function(ct){return delete this._map._targets[Gt(ct)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(ct){var Bt=ct.target;if(Bt.hasLayer(this)){if(this._map=Bt,this._zoomAnimated=Bt._zoomAnimated,this.getEvents){var me=this.getEvents();Bt.on(me,this),this.once("remove",function(){Bt.off(me,this)},this)}this.onAdd(Bt),this.fire("add"),Bt.fire("layeradd",{layer:this})}}});Mc.include({addLayer:function(ct){if(!ct._layerAdd)throw new Error("The provided object is not a Layer.");var Bt=Gt(ct);return this._layers[Bt]?this:(this._layers[Bt]=ct,ct._mapToAdd=this,ct.beforeAdd&&ct.beforeAdd(this),this.whenReady(ct._layerAdd,ct),this)},removeLayer:function(ct){var Bt=Gt(ct);return this._layers[Bt]?(this._loaded&&ct.onRemove(this),delete this._layers[Bt],this._loaded&&(this.fire("layerremove",{layer:ct}),ct.fire("remove")),ct._map=ct._mapToAdd=null,this):this},hasLayer:function(ct){return Gt(ct)in this._layers},eachLayer:function(ct,Bt){for(var me in this._layers)ct.call(Bt,this._layers[me]);return this},_addLayers:function(ct){ct=ct?kn(ct)?ct:[ct]:[];for(var Bt=0,me=ct.length;Btthis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()=2&&Bt[0]instanceof fo&&Bt[0].equals(Bt[me-1])&&Bt.pop(),Bt},_setLatLngs:function(ct){y0.prototype._setLatLngs.call(this,ct),g0(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return g0(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var ct=this._renderer._bounds,Bt=this.options.weight,me=new Va(Bt,Bt);if(ct=new ko(ct.min.subtract(me),ct.max.add(me)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(ct))){if(this.options.noClip){this._parts=this._rings;return}for(var Qe=0,Pr=this._rings.length,Tn;Qect.y!=Pr.y>ct.y&&ct.x<(Pr.x-Qe.x)*(ct.y-Qe.y)/(Pr.y-Qe.y)+Qe.x&&(Bt=!Bt);return Bt||y0.prototype._containsPoint.call(this,ct,!0)}});function v6(ct,Bt){return new yv(ct,Bt)}var pm=bp.extend({initialize:function(ct,Bt){zr(this,Bt),this._layers={},ct&&this.addData(ct)},addData:function(ct){var Bt=kn(ct)?ct:ct.features,me,Qe,Pr;if(Bt){for(me=0,Qe=Bt.length;me0&&Pr.push(Pr[0].slice()),Pr}function mm(ct,Bt){return ct.feature?J({},ct.feature,{geometry:Bt}):qy(Bt)}function qy(ct){return ct.type==="Feature"||ct.type==="FeatureCollection"?ct:{type:"Feature",properties:{},geometry:ct}}var U_={toGeoJSON:function(ct){return mm(this,{type:"Point",coordinates:j_(this.getLatLng(),ct)})}};M1.include(U_),Uy.include(U_),jy.include(U_),y0.include({toGeoJSON:function(ct){var Bt=!g0(this._latlngs),me=Wy(this._latlngs,Bt?1:0,!1,ct);return mm(this,{type:(Bt?"Multi":"")+"LineString",coordinates:me})}}),yv.include({toGeoJSON:function(ct){var Bt=!g0(this._latlngs),me=Bt&&!g0(this._latlngs[0]),Qe=Wy(this._latlngs,me?2:Bt?1:0,!0,ct);return Bt||(Qe=[Qe]),mm(this,{type:(me?"Multi":"")+"Polygon",coordinates:Qe})}}),Tg.include({toMultiPoint:function(ct){var Bt=[];return this.eachLayer(function(me){Bt.push(me.toGeoJSON(ct).geometry.coordinates)}),mm(this,{type:"MultiPoint",coordinates:Bt})},toGeoJSON:function(ct){var Bt=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(Bt==="MultiPoint")return this.toMultiPoint(ct);var me=Bt==="GeometryCollection",Qe=[];return this.eachLayer(function(Pr){if(Pr.toGeoJSON){var Tn=Pr.toGeoJSON(ct);if(me)Qe.push(Tn.geometry);else{var ji=qy(Tn);ji.type==="FeatureCollection"?Qe.push.apply(Qe,ji.features):Qe.push(ji)}}}),me?mm(this,{geometries:Qe,type:"GeometryCollection"}):{type:"FeatureCollection",features:Qe}}});function V_(ct,Bt){return new pm(ct,Bt)}var Zy=V_,gm=a0.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(ct,Bt,me){this._url=ct,this._bounds=qo(Bt),zr(this,me)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(Wu(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){Tf(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(ct){return this.options.opacity=ct,this._image&&this._updateOpacity(),this},setStyle:function(ct){return ct.opacity&&this.setOpacity(ct.opacity),this},bringToFront:function(){return this._map&&hv(this._image),this},bringToBack:function(){return this._map&&bn(this._image),this},setUrl:function(ct){return this._url=ct,this._image&&(this._image.src=ct),this},setBounds:function(ct){return this._bounds=qo(ct),this._map&&this._reset(),this},getEvents:function(){var ct={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(ct.zoomanim=this._animateZoom),ct},setZIndex:function(ct){return this.options.zIndex=ct,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var ct=this._url.tagName==="IMG",Bt=this._image=ct?this._url:Cc("img");if(Wu(Bt,"leaflet-image-layer"),this._zoomAnimated&&Wu(Bt,"leaflet-zoom-animated"),this.options.className&&Wu(Bt,this.options.className),Bt.onselectstart=Ne,Bt.onmousemove=Ne,Bt.onload=kt(this.fire,this,"load"),Bt.onerror=kt(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(Bt.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),ct){this._url=Bt.src;return}Bt.src=this._url,Bt.alt=this.options.alt},_animateZoom:function(ct){var Bt=this._map.getZoomScale(ct.zoom),me=this._map._latLngBoundsToNewLayerBounds(this._bounds,ct.zoom,ct.center).min;pu(this._image,me,Bt)},_reset:function(){var ct=this._image,Bt=new ko(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),me=Bt.getSize();ic(ct,Bt.min),ct.style.width=me.x+"px",ct.style.height=me.y+"px"},_updateOpacity:function(){m0(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var ct=this.options.errorOverlayUrl;ct&&this._url!==ct&&(this._url=ct,this._image.src=ct)},getCenter:function(){return this._bounds.getCenter()}}),vm=function(ct,Bt,me){return new gm(ct,Bt,me)},z0=gm.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var ct=this._url.tagName==="VIDEO",Bt=this._image=ct?this._url:Cc("video");if(Wu(Bt,"leaflet-image-layer"),this._zoomAnimated&&Wu(Bt,"leaflet-zoom-animated"),this.options.className&&Wu(Bt,this.options.className),Bt.onselectstart=Ne,Bt.onmousemove=Ne,Bt.onloadeddata=kt(this.fire,this,"load"),ct){for(var me=Bt.getElementsByTagName("source"),Qe=[],Pr=0;Pr0?Qe:[Bt.src];return}kn(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(Bt.style,"objectFit")&&(Bt.style.objectFit="fill"),Bt.autoplay=!!this.options.autoplay,Bt.loop=!!this.options.loop,Bt.muted=!!this.options.muted,Bt.playsInline=!!this.options.playsInline;for(var Tn=0;TnPr?(Bt.height=Pr+"px",Wu(ct,Tn)):Rf(ct,Tn),this._containerWidth=this._container.offsetWidth},_animateZoom:function(ct){var Bt=this._map._latLngToNewLayerPoint(this._latlng,ct.zoom,ct.center),me=this._getAnchor();ic(this._container,Bt.add(me))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var ct=this._map,Bt=parseInt(w1(this._container,"marginBottom"),10)||0,me=this._container.offsetHeight+Bt,Qe=this._containerWidth,Pr=new Va(this._containerLeft,-me-this._containerBottom);Pr._add(Rc(this._container));var Tn=ct.layerPointToContainerPoint(Pr),ji=mo(this.options.autoPanPadding),Na=mo(this.options.autoPanPaddingTopLeft||ji),Ya=mo(this.options.autoPanPaddingBottomRight||ji),xo=ct.getSize(),Vs=0,xl=0;Tn.x+Qe+Ya.x>xo.x&&(Vs=Tn.x+Qe-xo.x+Ya.x),Tn.x-Vs-Na.x<0&&(Vs=Tn.x-Na.x),Tn.y+me+Ya.y>xo.y&&(xl=Tn.y+me-xo.y+Ya.y),Tn.y-xl-Na.y<0&&(xl=Tn.y-Na.y),(Vs||xl)&&(this.options.keepInView&&(this._autopanning=!0),ct.fire("autopanstart").panBy([Vs,xl]))}},_getAnchor:function(){return mo(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),vf=function(ct,Bt){return new Ag(ct,Bt)};Mc.mergeOptions({closePopupOnClick:!0}),Mc.include({openPopup:function(ct,Bt,me){return this._initOverlay(Ag,ct,Bt,me).openOn(this),this},closePopup:function(ct){return ct=arguments.length?ct:this._popup,ct&&ct.close(),this}}),a0.include({bindPopup:function(ct,Bt){return this._popup=this._initOverlay(Ag,this._popup,ct,Bt),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(ct){return this._popup&&(this instanceof bp||(this._popup._source=this),this._popup._prepareOpen(ct||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(ct){return this._popup&&this._popup.setContent(ct),this},getPopup:function(){return this._popup},_openPopup:function(ct){if(!(!this._popup||!this._map)){vg(ct);var Bt=ct.layer||ct.target;if(this._popup._source===Bt&&!(Bt instanceof Bm)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(ct.latlng);return}this._popup._source=Bt,this.openPopup(ct.latlng)}},_movePopup:function(ct){this._popup.setLatLng(ct.latlng)},_onKeyPress:function(ct){ct.originalEvent.keyCode===13&&this._openPopup(ct)}});var S1=X0.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(ct){X0.prototype.onAdd.call(this,ct),this.setOpacity(this.options.opacity),ct.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(ct){X0.prototype.onRemove.call(this,ct),ct.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var ct=X0.prototype.getEvents.call(this);return this.options.permanent||(ct.preclick=this.close),ct},_initLayout:function(){var ct="leaflet-tooltip",Bt=ct+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=Cc("div",Bt),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+Gt(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(ct){var Bt,me,Qe=this._map,Pr=this._container,Tn=Qe.latLngToContainerPoint(Qe.getCenter()),ji=Qe.layerPointToContainerPoint(ct),Na=this.options.direction,Ya=Pr.offsetWidth,xo=Pr.offsetHeight,Vs=mo(this.options.offset),xl=this._getAnchor();Na==="top"?(Bt=Ya/2,me=xo):Na==="bottom"?(Bt=Ya/2,me=0):Na==="center"?(Bt=Ya/2,me=xo/2):Na==="right"?(Bt=0,me=xo/2):Na==="left"?(Bt=Ya,me=xo/2):ji.xthis.options.maxZoom||meQe?this._retainParent(Pr,Tn,ji,Qe):!1)},_retainChildren:function(ct,Bt,me,Qe){for(var Pr=2*ct;Pr<2*ct+2;Pr++)for(var Tn=2*Bt;Tn<2*Bt+2;Tn++){var ji=new Va(Pr,Tn);ji.z=me+1;var Na=this._tileCoordsToKey(ji),Ya=this._tiles[Na];if(Ya&&Ya.active){Ya.retain=!0;continue}else Ya&&Ya.loaded&&(Ya.retain=!0);me+1this.options.maxZoom||this.options.minZoom!==void 0&&Pr1){this._setView(ct,me);return}for(var xl=Pr.min.y;xl<=Pr.max.y;xl++)for(var Du=Pr.min.x;Du<=Pr.max.x;Du++){var Sd=new Va(Du,xl);if(Sd.z=this._tileZoom,!!this._isValidTile(Sd)){var Bf=this._tiles[this._tileCoordsToKey(Sd)];Bf?Bf.current=!0:ji.push(Sd)}}if(ji.sort(function(wp,jm){return wp.distanceTo(Tn)-jm.distanceTo(Tn)}),ji.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var _0=document.createDocumentFragment();for(Du=0;Dume.max.x)||!Bt.wrapLat&&(ct.yme.max.y))return!1}if(!this.options.bounds)return!0;var Qe=this._tileCoordsToBounds(ct);return qo(this.options.bounds).overlaps(Qe)},_keyToBounds:function(ct){return this._tileCoordsToBounds(this._keyToTileCoords(ct))},_tileCoordsToNwSe:function(ct){var Bt=this._map,me=this.getTileSize(),Qe=ct.scaleBy(me),Pr=Qe.add(me),Tn=Bt.unproject(Qe,ct.z),ji=Bt.unproject(Pr,ct.z);return[Tn,ji]},_tileCoordsToBounds:function(ct){var Bt=this._tileCoordsToNwSe(ct),me=new fu(Bt[0],Bt[1]);return this.options.noWrap||(me=this._map.wrapLatLngBounds(me)),me},_tileCoordsToKey:function(ct){return ct.x+":"+ct.y+":"+ct.z},_keyToTileCoords:function(ct){var Bt=ct.split(":"),me=new Va(+Bt[0],+Bt[1]);return me.z=+Bt[2],me},_removeTile:function(ct){var Bt=this._tiles[ct];Bt&&(Tf(Bt.el),delete this._tiles[ct],this.fire("tileunload",{tile:Bt.el,coords:this._keyToTileCoords(ct)}))},_initTile:function(ct){Wu(ct,"leaflet-tile");var Bt=this.getTileSize();ct.style.width=Bt.x+"px",ct.style.height=Bt.y+"px",ct.onselectstart=Ne,ct.onmousemove=Ne,El.ielt9&&this.options.opacity<1&&m0(ct,this.options.opacity)},_addTile:function(ct,Bt){var me=this._getTilePos(ct),Qe=this._tileCoordsToKey(ct),Pr=this.createTile(this._wrapCoords(ct),kt(this._tileReady,this,ct));this._initTile(Pr),this.createTile.length<2&&fa(kt(this._tileReady,this,ct,null,Pr)),ic(Pr,me),this._tiles[Qe]={el:Pr,coords:ct,current:!0},Bt.appendChild(Pr),this.fire("tileloadstart",{tile:Pr,coords:ct})},_tileReady:function(ct,Bt,me){Bt&&this.fire("tileerror",{error:Bt,tile:me,coords:ct});var Qe=this._tileCoordsToKey(ct);me=this._tiles[Qe],me&&(me.loaded=+new Date,this._map._fadeAnimated?(m0(me.el,0),Li(this._fadeFrame),this._fadeFrame=fa(this._updateOpacity,this)):(me.active=!0,this._pruneTiles()),Bt||(Wu(me.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:me.el,coords:ct})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),El.ielt9||!this._map._fadeAnimated?fa(this._pruneTiles,this):setTimeout(kt(this._pruneTiles,this),250)))},_getTilePos:function(ct){return ct.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(ct){var Bt=new Va(this._wrapX?pe(ct.x,this._wrapX):ct.x,this._wrapY?pe(ct.y,this._wrapY):ct.y);return Bt.z=ct.z,Bt},_pxBoundsToTileRange:function(ct){var Bt=this.getTileSize();return new ko(ct.min.unscaleBy(Bt).floor(),ct.max.unscaleBy(Bt).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var ct in this._tiles)if(!this._tiles[ct].loaded)return!1;return!0}});function W_(ct){return new E1(ct)}var o0=E1.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(ct,Bt){this._url=ct,Bt=zr(this,Bt),Bt.detectRetina&&El.retina&&Bt.maxZoom>0?(Bt.tileSize=Math.floor(Bt.tileSize/2),Bt.zoomReverse?(Bt.zoomOffset--,Bt.minZoom=Math.min(Bt.maxZoom,Bt.minZoom+1)):(Bt.zoomOffset++,Bt.maxZoom=Math.max(Bt.minZoom,Bt.maxZoom-1)),Bt.minZoom=Math.max(0,Bt.minZoom)):Bt.zoomReverse?Bt.minZoom=Math.min(Bt.maxZoom,Bt.minZoom):Bt.maxZoom=Math.max(Bt.minZoom,Bt.maxZoom),typeof Bt.subdomains=="string"&&(Bt.subdomains=Bt.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(ct,Bt){return this._url===ct&&Bt===void 0&&(Bt=!0),this._url=ct,Bt||this.redraw(),this},createTile:function(ct,Bt){var me=document.createElement("img");return Pu(me,"load",kt(this._tileOnLoad,this,Bt,me)),Pu(me,"error",kt(this._tileOnError,this,Bt,me)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(me.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(me.referrerPolicy=this.options.referrerPolicy),me.alt="",me.src=this.getTileUrl(ct),me},getTileUrl:function(ct){var Bt={r:El.retina?"@2x":"",s:this._getSubdomain(ct),x:ct.x,y:ct.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var me=this._globalTileRange.max.y-ct.y;this.options.tms&&(Bt.y=me),Bt["-y"]=me}return Ft(this._url,J(Bt,this.options))},_tileOnLoad:function(ct,Bt){El.ielt9?setTimeout(kt(ct,this,null,Bt),0):ct(null,Bt)},_tileOnError:function(ct,Bt,me){var Qe=this.options.errorTileUrl;Qe&&Bt.getAttribute("src")!==Qe&&(Bt.src=Qe),ct(me,Bt)},_onTileRemove:function(ct){ct.tile.onload=null},_getZoomForUrl:function(){var ct=this._tileZoom,Bt=this.options.maxZoom,me=this.options.zoomReverse,Qe=this.options.zoomOffset;return me&&(ct=Bt-ct),ct+Qe},_getSubdomain:function(ct){var Bt=Math.abs(ct.x+ct.y)%this.options.subdomains.length;return this.options.subdomains[Bt]},_abortLoading:function(){var ct,Bt;for(ct in this._tiles)if(this._tiles[ct].coords.z!==this._tileZoom&&(Bt=this._tiles[ct].el,Bt.onload=Ne,Bt.onerror=Ne,!Bt.complete)){Bt.src=jn;var me=this._tiles[ct].coords;Tf(Bt),delete this._tiles[ct],this.fire("tileabort",{tile:Bt,coords:me})}},_removeTile:function(ct){var Bt=this._tiles[ct];if(Bt)return Bt.el.setAttribute("src",jn),E1.prototype._removeTile.call(this,ct)},_tileReady:function(ct,Bt,me){if(!(!this._map||me&&me.getAttribute("src")===jn))return E1.prototype._tileReady.call(this,ct,Bt,me)}});function $y(ct,Bt){return new o0(ct,Bt)}var Gy=o0.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(ct,Bt){this._url=ct;var me=J({},this.defaultWmsParams);for(var Qe in Bt)Qe in this.options||(me[Qe]=Bt[Qe]);Bt=zr(this,Bt);var Pr=Bt.detectRetina&&El.retina?2:1,Tn=this.getTileSize();me.width=Tn.x*Pr,me.height=Tn.y*Pr,this.wmsParams=me},onAdd:function(ct){this._crs=this.options.crs||ct.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var Bt=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[Bt]=this._crs.code,o0.prototype.onAdd.call(this,ct)},getTileUrl:function(ct){var Bt=this._tileCoordsToNwSe(ct),me=this._crs,Qe=pl(me.project(Bt[0]),me.project(Bt[1])),Pr=Qe.min,Tn=Qe.max,ji=(this._wmsVersion>=1.3&&this._crs===By?[Pr.y,Pr.x,Tn.y,Tn.x]:[Pr.x,Pr.y,Tn.x,Tn.y]).join(","),Na=o0.prototype.getTileUrl.call(this,ct);return Na+Wr(this.wmsParams,Na,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+ji},setParams:function(ct,Bt){return J(this.wmsParams,ct),Bt||this.redraw(),this}});function Sw(ct,Bt){return new Gy(ct,Bt)}o0.WMS=Gy,$y.wms=Sw;var ym=a0.extend({options:{padding:.1},initialize:function(ct){zr(this,ct),Gt(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),Wu(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var ct={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(ct.zoomanim=this._onAnimZoom),ct},_onAnimZoom:function(ct){this._updateTransform(ct.center,ct.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(ct,Bt){var me=this._map.getZoomScale(Bt,this._zoom),Qe=this._map.getSize().multiplyBy(.5+this.options.padding),Pr=this._map.project(this._center,Bt),Tn=Qe.multiplyBy(-me).add(Pr).subtract(this._map._getNewPixelOrigin(ct,Bt));El.any3d?pu(this._container,Tn,me):ic(this._container,Tn)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var ct in this._layers)this._layers[ct]._reset()},_onZoomEnd:function(){for(var ct in this._layers)this._layers[ct]._project()},_updatePaths:function(){for(var ct in this._layers)this._layers[ct]._update()},_update:function(){var ct=this.options.padding,Bt=this._map.getSize(),me=this._map.containerPointToLayerPoint(Bt.multiplyBy(-ct)).round();this._bounds=new ko(me,me.add(Bt.multiplyBy(1+ct*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Ew=ym.extend({options:{tolerance:0},getEvents:function(){var ct=ym.prototype.getEvents.call(this);return ct.viewprereset=this._onViewPreReset,ct},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){ym.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var ct=this._container=document.createElement("canvas");Pu(ct,"mousemove",this._onMouseMove,this),Pu(ct,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Pu(ct,"mouseout",this._handleMouseOut,this),ct._leaflet_disable_events=!0,this._ctx=ct.getContext("2d")},_destroyContainer:function(){Li(this._redrawRequest),delete this._ctx,Tf(this._container),Bh(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var ct;this._redrawBounds=null;for(var Bt in this._layers)ct=this._layers[Bt],ct._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){ym.prototype._update.call(this);var ct=this._bounds,Bt=this._container,me=ct.getSize(),Qe=El.retina?2:1;ic(Bt,ct.min),Bt.width=Qe*me.x,Bt.height=Qe*me.y,Bt.style.width=me.x+"px",Bt.style.height=me.y+"px",El.retina&&this._ctx.scale(2,2),this._ctx.translate(-ct.min.x,-ct.min.y),this.fire("update")}},_reset:function(){ym.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(ct){this._updateDashArray(ct),this._layers[Gt(ct)]=ct;var Bt=ct._order={layer:ct,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=Bt),this._drawLast=Bt,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(ct){this._requestRedraw(ct)},_removePath:function(ct){var Bt=ct._order,me=Bt.next,Qe=Bt.prev;me?me.prev=Qe:this._drawLast=Qe,Qe?Qe.next=me:this._drawFirst=me,delete ct._order,delete this._layers[Gt(ct)],this._requestRedraw(ct)},_updatePath:function(ct){this._extendRedrawBounds(ct),ct._project(),ct._update(),this._requestRedraw(ct)},_updateStyle:function(ct){this._updateDashArray(ct),this._requestRedraw(ct)},_updateDashArray:function(ct){if(typeof ct.options.dashArray=="string"){var Bt=ct.options.dashArray.split(/[, ]+/),me=[],Qe,Pr;for(Pr=0;Pr')}}catch{}return function(ct){return document.createElement("<"+ct+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),_6={_initContainer:function(){this._container=Cc("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(ym.prototype._update.call(this),this.fire("update"))},_initPath:function(ct){var Bt=ct._container=C1("shape");Wu(Bt,"leaflet-vml-shape "+(this.options.className||"")),Bt.coordsize="1 1",ct._path=C1("path"),Bt.appendChild(ct._path),this._updateStyle(ct),this._layers[Gt(ct)]=ct},_addPath:function(ct){var Bt=ct._container;this._container.appendChild(Bt),ct.options.interactive&&ct.addInteractiveTarget(Bt)},_removePath:function(ct){var Bt=ct._container;Tf(Bt),ct.removeInteractiveTarget(Bt),delete this._layers[Gt(ct)]},_updateStyle:function(ct){var Bt=ct._stroke,me=ct._fill,Qe=ct.options,Pr=ct._container;Pr.stroked=!!Qe.stroke,Pr.filled=!!Qe.fill,Qe.stroke?(Bt||(Bt=ct._stroke=C1("stroke")),Pr.appendChild(Bt),Bt.weight=Qe.weight+"px",Bt.color=Qe.color,Bt.opacity=Qe.opacity,Qe.dashArray?Bt.dashStyle=kn(Qe.dashArray)?Qe.dashArray.join(" "):Qe.dashArray.replace(/( *, *)/g," "):Bt.dashStyle="",Bt.endcap=Qe.lineCap.replace("butt","flat"),Bt.joinstyle=Qe.lineJoin):Bt&&(Pr.removeChild(Bt),ct._stroke=null),Qe.fill?(me||(me=ct._fill=C1("fill")),Pr.appendChild(me),me.color=Qe.fillColor||Qe.color,me.opacity=Qe.fillOpacity):me&&(Pr.removeChild(me),ct._fill=null)},_updateCircle:function(ct){var Bt=ct._point.round(),me=Math.round(ct._radius),Qe=Math.round(ct._radiusY||me);this._setPath(ct,ct._empty()?"M0 0":"AL "+Bt.x+","+Bt.y+" "+me+","+Qe+" 0,"+65535*360)},_setPath:function(ct,Bt){ct._path.v=Bt},_bringToFront:function(ct){hv(ct._container)},_bringToBack:function(ct){bn(ct._container)}},Nm=El.vml?C1:co,Fp=ym.extend({_initContainer:function(){this._container=Nm("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Nm("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){Tf(this._container),Bh(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){ym.prototype._update.call(this);var ct=this._bounds,Bt=ct.getSize(),me=this._container;(!this._svgSize||!this._svgSize.equals(Bt))&&(this._svgSize=Bt,me.setAttribute("width",Bt.x),me.setAttribute("height",Bt.y)),ic(me,ct.min),me.setAttribute("viewBox",[ct.min.x,ct.min.y,Bt.x,Bt.y].join(" ")),this.fire("update")}},_initPath:function(ct){var Bt=ct._path=Nm("path");ct.options.className&&Wu(Bt,ct.options.className),ct.options.interactive&&Wu(Bt,"leaflet-interactive"),this._updateStyle(ct),this._layers[Gt(ct)]=ct},_addPath:function(ct){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(ct._path),ct.addInteractiveTarget(ct._path)},_removePath:function(ct){Tf(ct._path),ct.removeInteractiveTarget(ct._path),delete this._layers[Gt(ct)]},_updatePath:function(ct){ct._project(),ct._update()},_updateStyle:function(ct){var Bt=ct._path,me=ct.options;Bt&&(me.stroke?(Bt.setAttribute("stroke",me.color),Bt.setAttribute("stroke-opacity",me.opacity),Bt.setAttribute("stroke-width",me.weight),Bt.setAttribute("stroke-linecap",me.lineCap),Bt.setAttribute("stroke-linejoin",me.lineJoin),me.dashArray?Bt.setAttribute("stroke-dasharray",me.dashArray):Bt.removeAttribute("stroke-dasharray"),me.dashOffset?Bt.setAttribute("stroke-dashoffset",me.dashOffset):Bt.removeAttribute("stroke-dashoffset")):Bt.setAttribute("stroke","none"),me.fill?(Bt.setAttribute("fill",me.fillColor||me.color),Bt.setAttribute("fill-opacity",me.fillOpacity),Bt.setAttribute("fill-rule",me.fillRule||"evenodd")):Bt.setAttribute("fill","none"))},_updatePoly:function(ct,Bt){this._setPath(ct,vo(ct._parts,Bt))},_updateCircle:function(ct){var Bt=ct._point,me=Math.max(Math.round(ct._radius),1),Qe=Math.max(Math.round(ct._radiusY),1)||me,Pr="a"+me+","+Qe+" 0 1,0 ",Tn=ct._empty()?"M0 0":"M"+(Bt.x-me)+","+Bt.y+Pr+me*2+",0 "+Pr+-me*2+",0 ";this._setPath(ct,Tn)},_setPath:function(ct,Bt){ct._path.setAttribute("d",Bt)},_bringToFront:function(ct){hv(ct._path)},_bringToBack:function(ct){bn(ct._path)}});El.vml&&Fp.include(_6);function Cw(ct){return El.svg||El.vml?new Fp(ct):null}Mc.include({getRenderer:function(ct){var Bt=ct.options.renderer||this._getPaneRenderer(ct.options.pane)||this.options.renderer||this._renderer;return Bt||(Bt=this._renderer=this._createRenderer()),this.hasLayer(Bt)||this.addLayer(Bt),Bt},_getPaneRenderer:function(ct){if(ct==="overlayPane"||ct===void 0)return!1;var Bt=this._paneRenderers[ct];return Bt===void 0&&(Bt=this._createRenderer({pane:ct}),this._paneRenderers[ct]=Bt),Bt},_createRenderer:function(ct){return this.options.preferCanvas&&q_(ct)||Cw(ct)}});var s0=yv.extend({initialize:function(ct,Bt){yv.prototype.initialize.call(this,this._boundsToLatLngs(ct),Bt)},setBounds:function(ct){return this.setLatLngs(this._boundsToLatLngs(ct))},_boundsToLatLngs:function(ct){return ct=qo(ct),[ct.getSouthWest(),ct.getNorthWest(),ct.getNorthEast(),ct.getSouthEast()]}});function I0(ct,Bt){return new s0(ct,Bt)}Fp.create=Nm,Fp.pointsToPath=vo,pm.geometryToLayer=Vy,pm.coordsToLatLng=N_,pm.coordsToLatLngs=Hy,pm.latLngToCoords=j_,pm.latLngsToCoords=Wy,pm.getFeature=mm,pm.asFeature=qy,Mc.mergeOptions({boxZoom:!0});var xv=K0.extend({initialize:function(ct){this._map=ct,this._container=ct._container,this._pane=ct._panes.overlayPane,this._resetStateTimeout=0,ct.on("unload",this._destroy,this)},addHooks:function(){Pu(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Bh(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){Tf(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(ct){if(!ct.shiftKey||ct.which!==1&&ct.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),C0(),Kc(),this._startPoint=this._map.mouseEventToContainerPoint(ct),Pu(document,{contextmenu:vg,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(ct){this._moved||(this._moved=!0,this._box=Cc("div","leaflet-zoom-box",this._container),Wu(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(ct);var Bt=new ko(this._point,this._startPoint),me=Bt.getSize();ic(this._box,Bt.min),this._box.style.width=me.x+"px",this._box.style.height=me.y+"px"},_finish:function(){this._moved&&(Tf(this._box),Rf(this._container,"leaflet-crosshair")),pg(),Op(),Bh(document,{contextmenu:vg,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(ct){if(!(ct.which!==1&&ct.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(kt(this._resetState,this),0);var Bt=new fu(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(Bt).fire("boxzoomend",{boxZoomBounds:Bt})}},_onKeyDown:function(ct){ct.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});Mc.addInitHook("addHandler","boxZoom",xv),Mc.mergeOptions({doubleClickZoom:!0});var x0=K0.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(ct){var Bt=this._map,me=Bt.getZoom(),Qe=Bt.options.zoomDelta,Pr=ct.originalEvent.shiftKey?me-Qe:me+Qe;Bt.options.doubleClickZoom==="center"?Bt.setZoom(Pr):Bt.setZoomAround(ct.containerPoint,Pr)}});Mc.addInitHook("addHandler","doubleClickZoom",x0),Mc.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var O0=K0.extend({addHooks:function(){if(!this._draggable){var ct=this._map;this._draggable=new Fm(ct._mapPane,ct._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),ct.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),ct.on("zoomend",this._onZoomEnd,this),ct.whenReady(this._onZoomEnd,this))}Wu(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){Rf(this._map._container,"leaflet-grab"),Rf(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var ct=this._map;if(ct._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var Bt=qo(this._map.options.maxBounds);this._offsetLimit=pl(this._map.latLngToContainerPoint(Bt.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(Bt.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;ct.fire("movestart").fire("dragstart"),ct.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(ct){if(this._map.options.inertia){var Bt=this._lastTime=+new Date,me=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(me),this._times.push(Bt),this._prunePositions(Bt)}this._map.fire("move",ct).fire("drag",ct)},_prunePositions:function(ct){for(;this._positions.length>1&&ct-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var ct=this._map.getSize().divideBy(2),Bt=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=Bt.subtract(ct).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(ct,Bt){return ct-(ct-Bt)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var ct=this._draggable._newPos.subtract(this._draggable._startPos),Bt=this._offsetLimit;ct.xBt.max.x&&(ct.x=this._viscousLimit(ct.x,Bt.max.x)),ct.y>Bt.max.y&&(ct.y=this._viscousLimit(ct.y,Bt.max.y)),this._draggable._newPos=this._draggable._startPos.add(ct)}},_onPreDragWrap:function(){var ct=this._worldWidth,Bt=Math.round(ct/2),me=this._initialWorldOffset,Qe=this._draggable._newPos.x,Pr=(Qe-Bt+me)%ct+Bt-me,Tn=(Qe+Bt+me)%ct-Bt-me,ji=Math.abs(Pr+me)0?Tn:-Tn))-Bt;this._delta=0,this._startTime=null,ji&&(ct.options.scrollWheelZoom==="center"?ct.setZoom(Bt+ji):ct.setZoomAround(this._lastMousePos,Bt+ji))}});Mc.addInitHook("addHandler","scrollWheelZoom",Mg);var Pw=600;Mc.mergeOptions({tapHold:El.touchNative&&El.safari&&El.mobile,tapTolerance:15});var zw=K0.extend({addHooks:function(){Pu(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Bh(this._map._container,"touchstart",this._onDown,this)},_onDown:function(ct){if(clearTimeout(this._holdTimeout),ct.touches.length===1){var Bt=ct.touches[0];this._startPos=this._newPos=new Va(Bt.clientX,Bt.clientY),this._holdTimeout=setTimeout(kt(function(){this._cancel(),this._isTapValid()&&(Pu(document,"touchend",mc),Pu(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",Bt))},this),Pw),Pu(document,"touchend touchcancel contextmenu",this._cancel,this),Pu(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function ct(){Bh(document,"touchend",mc),Bh(document,"touchend touchcancel",ct)},_cancel:function(){clearTimeout(this._holdTimeout),Bh(document,"touchend touchcancel contextmenu",this._cancel,this),Bh(document,"touchmove",this._onMove,this)},_onMove:function(ct){var Bt=ct.touches[0];this._newPos=new Va(Bt.clientX,Bt.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(ct,Bt){var me=new MouseEvent(ct,{bubbles:!0,cancelable:!0,view:window,screenX:Bt.screenX,screenY:Bt.screenY,clientX:Bt.clientX,clientY:Bt.clientY});me._simulated=!0,Bt.target.dispatchEvent(me)}});Mc.addInitHook("addHandler","tapHold",zw),Mc.mergeOptions({touchZoom:El.touch,bounceAtZoomLimits:!0});var D0=K0.extend({addHooks:function(){Wu(this._map._container,"leaflet-touch-zoom"),Pu(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){Rf(this._map._container,"leaflet-touch-zoom"),Bh(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(ct){var Bt=this._map;if(!(!ct.touches||ct.touches.length!==2||Bt._animatingZoom||this._zooming)){var me=Bt.mouseEventToContainerPoint(ct.touches[0]),Qe=Bt.mouseEventToContainerPoint(ct.touches[1]);this._centerPoint=Bt.getSize()._divideBy(2),this._startLatLng=Bt.containerPointToLatLng(this._centerPoint),Bt.options.touchZoom!=="center"&&(this._pinchStartLatLng=Bt.containerPointToLatLng(me.add(Qe)._divideBy(2))),this._startDist=me.distanceTo(Qe),this._startZoom=Bt.getZoom(),this._moved=!1,this._zooming=!0,Bt._stop(),Pu(document,"touchmove",this._onTouchMove,this),Pu(document,"touchend touchcancel",this._onTouchEnd,this),mc(ct)}},_onTouchMove:function(ct){if(!(!ct.touches||ct.touches.length!==2||!this._zooming)){var Bt=this._map,me=Bt.mouseEventToContainerPoint(ct.touches[0]),Qe=Bt.mouseEventToContainerPoint(ct.touches[1]),Pr=me.distanceTo(Qe)/this._startDist;if(this._zoom=Bt.getScaleZoom(Pr,this._startZoom),!Bt.options.bounceAtZoomLimits&&(this._zoomBt.getMaxZoom()&&Pr>1)&&(this._zoom=Bt._limitZoom(this._zoom)),Bt.options.touchZoom==="center"){if(this._center=this._startLatLng,Pr===1)return}else{var Tn=me._add(Qe)._divideBy(2)._subtract(this._centerPoint);if(Pr===1&&Tn.x===0&&Tn.y===0)return;this._center=Bt.unproject(Bt.project(this._pinchStartLatLng,this._zoom).subtract(Tn),this._zoom)}this._moved||(Bt._moveStart(!0,!1),this._moved=!0),Li(this._animRequest);var ji=kt(Bt._move,Bt,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=fa(ji,this,!0),mc(ct)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,Li(this._animRequest),Bh(document,"touchmove",this._onTouchMove,this),Bh(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});Mc.addInitHook("addHandler","touchZoom",D0),Mc.BoxZoom=xv,Mc.DoubleClickZoom=x0,Mc.Drag=O0,Mc.Keyboard=Lw,Mc.ScrollWheelZoom=Mg,Mc.TapHold=zw,Mc.TouchZoom=D0,z.Bounds=ko,z.Browser=El,z.CRS=Ea,z.Canvas=Ew,z.Circle=Uy,z.CircleMarker=jy,z.Class=ra,z.Control=lp,z.DivIcon=Mw,z.DivOverlay=X0,z.DomEvent=Dp,z.DomUtil=Tc,z.Draggable=Fm,z.Evented=Ei,z.FeatureGroup=bp,z.GeoJSON=pm,z.GridLayer=E1,z.Handler=K0,z.Icon=Rm,z.ImageOverlay=gm,z.LatLng=fo,z.LatLngBounds=fu,z.Layer=a0,z.LayerGroup=Tg,z.LineUtil=Qh,z.Map=Mc,z.Marker=M1,z.Mixin=up,z.Path=Bm,z.Point=Va,z.PolyUtil=d6,z.Polygon=yv,z.Polyline=y0,z.Popup=Ag,z.PosAnimation=A1,z.Projection=D_,z.Rectangle=s0,z.Renderer=ym,z.SVG=Fp,z.SVGOverlay=H_,z.TileLayer=o0,z.Tooltip=S1,z.Transformation=$o,z.Util=yi,z.VideoOverlay=z0,z.bind=kt,z.bounds=pl,z.canvas=q_,z.circle=vv,z.circleMarker=ww,z.control=i0,z.divIcon=x6,z.extend=J,z.featureGroup=bw,z.geoJSON=V_,z.geoJson=Zy,z.gridLayer=W_,z.icon=R_,z.imageOverlay=vm,z.latLng=Ta,z.latLngBounds=qo,z.layerGroup=Ny,z.map=js,z.marker=g6,z.point=mo,z.polygon=v6,z.polyline=kw,z.popup=vf,z.rectangle=I0,z.setOptions=zr,z.stamp=Gt,z.svg=Cw,z.svgOverlay=y6,z.tileLayer=$y,z.tooltip=Aw,z.transformation=gi,z.version=j,z.videoOverlay=tf;var F0=window.L;z.noConflict=function(){return window.L=F0,this},window.L=z})}(c2,c2.exports)),c2.exports}var Pat=Lat();const Zg=LO(Pat),zat={class:"space-y-6"},Iat={key:0,class:"flex items-center justify-center py-12"},Oat={key:1,class:"bg-accent-red/10 border border-accent-red/20 rounded-[15px] p-6"},Dat={class:"flex items-center gap-3"},Fat={class:"text-accent-red/80 text-sm"},Rat={key:0,class:"bg-dark-card/30 backdrop-blur border border-white/10 rounded-[15px] p-6"},Bat={class:"flex items-center justify-between p-6 pb-4"},Nat={class:"text-white text-lg font-semibold"},jat={class:"text-sm text-dark-text ml-2"},Uat={class:"overflow-x-auto"},Vat={class:"w-full"},Hat={class:"bg-dark-bg/30"},Wat=["onMouseenter","onMouseleave"],qat={class:"py-4 px-6 text-white text-sm"},Zat={class:"py-4 px-6 text-white text-sm font-mono"},$at={class:"py-4 px-6 text-white text-sm"},Gat={key:0},Yat={key:1,class:"text-dark-text"},Kat={class:"py-4 px-6 text-white text-sm"},Xat={class:"py-4 px-6 text-white text-sm"},Jat={class:"py-4 px-6 text-white text-sm"},Qat={class:"py-4 px-6 text-white text-sm"},tot={class:"py-4 px-6 text-white text-sm"},eot={class:"py-4 px-6 text-white text-sm"},rot={class:"py-4 px-6 text-white text-sm text-center"},not={key:1,class:"text-center py-12"},iot=Th({name:"NeighborsView",__name:"Neighbors",setup(d){const l={0:"Unknown",1:"Chat Node",2:"Repeater",3:"Room Server",4:"Hybrid Node"},z={0:"text-gray-400",1:"text-blue-400",2:"text-accent-green",3:"text-accent-purple",4:"text-secondary"},j=lo({}),J=lo(!0),mt=lo(null),kt=lo();let Dt=null;const Gt=lo(new Map),re=Yo(()=>Object.entries(l).filter(([un])=>j.value[un]?.length>0).sort(([un],[ia])=>parseInt(un)-parseInt(ia))),pe=Yo(()=>Object.values(j.value).flat().filter(un=>un.latitude!==null&&un.longitude!==null)),Ne=un=>new Date(un*1e3).toLocaleString(),or=un=>un.length<=16?un:`${un.slice(0,8)}...${un.slice(-8)}`,_r=un=>un!==null?`${un} dBm`:"N/A",Fr=un=>un!==null?`${un.toFixed(1)} dB`:"N/A",zr=un=>un===null?"Unknown":{0:"Unknown",1:"Flood",2:"Direct"}[un]||`Type ${un}`,Wr=(un,ia,fa,Li)=>{const ra=(fa-un)*Math.PI/180,Da=(Li-ia)*Math.PI/180,Ni=Math.sin(ra/2)*Math.sin(ra/2)+Math.cos(un*Math.PI/180)*Math.cos(fa*Math.PI/180)*Math.sin(Da/2)*Math.sin(Da/2);return 6371*(2*Math.atan2(Math.sqrt(Ni),Math.sqrt(1-Ni)))},An=un=>un.latitude!==null&&un.longitude!==null?`${Wr(50.6185,-1.7339,un.latitude,un.longitude).toFixed(2)} km`:"Unknown",Ft=un=>{const ia={0:"#9CA3AF",1:"#60A5FA",2:"#A5E5B6",3:"#EBA0FC",4:"#FFC246"};return ia[un]||ia[0]},kn=async un=>{try{const ia=await Xh.get(`/adverts_by_contact_type?contact_type=${encodeURIComponent(un)}&hours=168`);return ia.success&&Array.isArray(ia.data)?ia.data:[]}catch(ia){return console.error(`Error fetching adverts for contact type ${un}:`,ia),[]}},ei=async()=>{J.value=!0,mt.value=null;try{j.value={};for(const[un,ia]of Object.entries(l)){const fa=await kn(ia);fa.length>0&&(j.value[un]=fa)}}catch(un){console.error("Error loading adverts:",un),mt.value=un instanceof Error?un.message:"Unknown error occurred"}finally{J.value=!1}},jn=async()=>{if(ai(),await Z0(),!kt.value){setTimeout(()=>{kt.value&&jn()},500);return}setTimeout(()=>{if(!kt.value)return;if(kt.value.offsetWidth===0||kt.value.offsetHeight===0){setTimeout(()=>jn(),500);return}const un=50.6185,ia=-1.7339;let fa=null;if(pe.value.length>0){const Li=[un,...pe.value.map(Va=>Va.latitude)],yi=[ia,...pe.value.map(Va=>Va.longitude)],ra=Math.min(...Li),Da=Math.max(...Li),Ni=Math.min(...yi),Ei=Math.max(...yi);fa=[[ra,Ni],[Da,Ei]]}try{fa?Dt=Zg.map(kt.value,{zoomControl:!0,attributionControl:!0,preferCanvas:!1}).fitBounds(fa,{padding:[50,50]}):Dt=Zg.map(kt.value,{center:[un,ia],zoom:12,zoomControl:!0,attributionControl:!0,preferCanvas:!1});const Li=Zg.tileLayer("https://{s}.basemaps.cartocdn.com/dark_nolabels/{z}/{x}/{y}{r}.png",{attribution:'© OpenStreetMap contributors © CARTO',maxZoom:18,minZoom:1,crossOrigin:!0}),yi=Zg.tileLayer("https://{s}.basemaps.cartocdn.com/dark_only_labels/{z}/{x}/{y}{r}.png",{maxZoom:18,minZoom:1,crossOrigin:!0});Li.addTo(Dt),yi.addTo(Dt);let ra=!1,Da=!1;const Ni=()=>{ra&&Da&&setTimeout(()=>{ss()},1e3)};Li.on("load",()=>{ra=!0,Dt&&Dt.invalidateSize(),Ni()}),yi.on("load",()=>{Da=!0,Ni()});const Ei=(mo,ko=!1)=>{const pl=ko?12:8;return Zg.divIcon({className:"custom-div-icon",html:`
`,iconSize:[pl+4,pl+4],iconAnchor:[pl/2+2,pl/2+2]})},Va=Ei("#AAE8E8",!0);Zg.marker([un,ia],{icon:Va}).addTo(Dt).bindPopup(` + */var Pat=c2.exports,jL;function zat(){return jL||(jL=1,function(d,l){(function(z,j){j(l)})(Pat,function(z){var j="1.9.4";function J(ct){var Bt,me,Qe,Pr;for(me=1,Qe=arguments.length;me"u"||!L||!L.Mixin)){ct=kn(ct)?ct:[ct];for(var Bt=0;Bt0?Math.floor(ct):Math.ceil(ct)};Va.prototype={clone:function(){return new Va(this.x,this.y)},add:function(ct){return this.clone()._add(mo(ct))},_add:function(ct){return this.x+=ct.x,this.y+=ct.y,this},subtract:function(ct){return this.clone()._subtract(mo(ct))},_subtract:function(ct){return this.x-=ct.x,this.y-=ct.y,this},divideBy:function(ct){return this.clone()._divideBy(ct)},_divideBy:function(ct){return this.x/=ct,this.y/=ct,this},multiplyBy:function(ct){return this.clone()._multiplyBy(ct)},_multiplyBy:function(ct){return this.x*=ct,this.y*=ct,this},scaleBy:function(ct){return new Va(this.x*ct.x,this.y*ct.y)},unscaleBy:function(ct){return new Va(this.x/ct.x,this.y/ct.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=ss(this.x),this.y=ss(this.y),this},distanceTo:function(ct){ct=mo(ct);var Bt=ct.x-this.x,me=ct.y-this.y;return Math.sqrt(Bt*Bt+me*me)},equals:function(ct){return ct=mo(ct),ct.x===this.x&&ct.y===this.y},contains:function(ct){return ct=mo(ct),Math.abs(ct.x)<=Math.abs(this.x)&&Math.abs(ct.y)<=Math.abs(this.y)},toString:function(){return"Point("+or(this.x)+", "+or(this.y)+")"}};function mo(ct,Bt,me){return ct instanceof Va?ct:kn(ct)?new Va(ct[0],ct[1]):ct==null?ct:typeof ct=="object"&&"x"in ct&&"y"in ct?new Va(ct.x,ct.y):new Va(ct,Bt,me)}function ko(ct,Bt){if(ct)for(var me=Bt?[ct,Bt]:ct,Qe=0,Pr=me.length;Qe=this.min.x&&me.x<=this.max.x&&Bt.y>=this.min.y&&me.y<=this.max.y},intersects:function(ct){ct=pl(ct);var Bt=this.min,me=this.max,Qe=ct.min,Pr=ct.max,Tn=Pr.x>=Bt.x&&Qe.x<=me.x,ji=Pr.y>=Bt.y&&Qe.y<=me.y;return Tn&&ji},overlaps:function(ct){ct=pl(ct);var Bt=this.min,me=this.max,Qe=ct.min,Pr=ct.max,Tn=Pr.x>Bt.x&&Qe.xBt.y&&Qe.y=Bt.lat&&Pr.lat<=me.lat&&Qe.lng>=Bt.lng&&Pr.lng<=me.lng},intersects:function(ct){ct=qo(ct);var Bt=this._southWest,me=this._northEast,Qe=ct.getSouthWest(),Pr=ct.getNorthEast(),Tn=Pr.lat>=Bt.lat&&Qe.lat<=me.lat,ji=Pr.lng>=Bt.lng&&Qe.lng<=me.lng;return Tn&&ji},overlaps:function(ct){ct=qo(ct);var Bt=this._southWest,me=this._northEast,Qe=ct.getSouthWest(),Pr=ct.getNorthEast(),Tn=Pr.lat>Bt.lat&&Qe.latBt.lng&&Qe.lng1,e6=function(){var ct=!1;try{var Bt=Object.defineProperty({},"passive",{get:function(){ct=!0}});window.addEventListener("testPassiveEventSupport",Ne,Bt),window.removeEventListener("testPassiveEventSupport",Ne,Bt)}catch{}return ct}(),r6=function(){return!!document.createElement("canvas").getContext}(),b_=!!(document.createElementNS&&co("svg").createSVGRect),n6=!!b_&&function(){var ct=document.createElement("div");return ct.innerHTML="",(ct.firstChild&&ct.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),i6=!b_&&function(){try{var ct=document.createElement("div");ct.innerHTML='';var Bt=ct.firstChild;return Bt.style.behavior="url(#default#VML)",Bt&&typeof Bt.adj=="object"}catch{return!1}}(),cw=navigator.platform.indexOf("Mac")===0,w_=navigator.platform.indexOf("Linux")===0;function r0(ct){return navigator.userAgent.toLowerCase().indexOf(ct)>=0}var El={ie:ms,ielt9:ns,edge:Ko,webkit:Oo,android:wl,android23:ws,androidStock:du,opera:Hu,chrome:Fc,gecko:kc,safari:Vd,phantom:kd,opera12:e0,win:d0,ie3d:Pm,webkit3d:uv,gecko3d:sp,any3d:p0,mobile:zm,mobileWebkit:zy,mobileWebkit3d:K4,msPointer:sw,pointer:lw,touch:X4,touchNative:uw,mobileOpera:J4,mobileGecko:Q4,retina:t6,passiveEvents:e6,canvas:r6,svg:b_,vml:i6,inlineSvg:n6,mac:cw,linux:w_},Yc=El.msPointer?"MSPointerDown":"pointerdown",Td=El.msPointer?"MSPointerMove":"pointermove",k_=El.msPointer?"MSPointerUp":"pointerup",$u=El.msPointer?"MSPointerCancel":"pointercancel",y1={touchstart:Yc,touchmove:Td,touchend:k_,touchcancel:$u},hw={touchstart:s6,touchmove:G0,touchend:G0,touchcancel:G0},cv={},Iy=!1;function x1(ct,Bt,me){return Bt==="touchstart"&&T_(),hw[Bt]?(me=hw[Bt].bind(this,me),ct.addEventListener(y1[Bt],me,!1),me):(console.warn("wrong event specified:",Bt),Ne)}function a6(ct,Bt,me){if(!y1[Bt]){console.warn("wrong event specified:",Bt);return}ct.removeEventListener(y1[Bt],me,!1)}function Xo(ct){cv[ct.pointerId]=ct}function o6(ct){cv[ct.pointerId]&&(cv[ct.pointerId]=ct)}function _1(ct){delete cv[ct.pointerId]}function T_(){Iy||(document.addEventListener(Yc,Xo,!0),document.addEventListener(Td,o6,!0),document.addEventListener(k_,_1,!0),document.addEventListener($u,_1,!0),Iy=!0)}function G0(ct,Bt){if(Bt.pointerType!==(Bt.MSPOINTER_TYPE_MOUSE||"mouse")){Bt.touches=[];for(var me in cv)Bt.touches.push(cv[me]);Bt.changedTouches=[Bt],ct(Bt)}}function s6(ct,Bt){Bt.MSPOINTER_TYPE_TOUCH&&Bt.pointerType===Bt.MSPOINTER_TYPE_TOUCH&&mc(Bt),G0(ct,Bt)}function l6(ct){var Bt={},me,Qe;for(Qe in ct)me=ct[Qe],Bt[Qe]=me&&me.bind?me.bind(ct):me;return ct=Bt,Bt.type="dblclick",Bt.detail=2,Bt.isTrusted=!1,Bt._simulated=!0,Bt}var u6=200;function c6(ct,Bt){ct.addEventListener("dblclick",Bt);var me=0,Qe;function Pr(Tn){if(Tn.detail!==1){Qe=Tn.detail;return}if(!(Tn.pointerType==="mouse"||Tn.sourceCapabilities&&!Tn.sourceCapabilities.firesTouchEvents)){var ji=mw(Tn);if(!(ji.some(function(Ya){return Ya instanceof HTMLLabelElement&&Ya.attributes.for})&&!ji.some(function(Ya){return Ya instanceof HTMLInputElement||Ya instanceof HTMLSelectElement}))){var Na=Date.now();Na-me<=u6?(Qe++,Qe===2&&Bt(l6(Tn))):Qe=1,me=Na}}}return ct.addEventListener("click",Pr),{dblclick:Bt,simDblclick:Pr}}function A_(ct,Bt){ct.removeEventListener("dblclick",Bt.dblclick),ct.removeEventListener("click",Bt.simDblclick)}var M_=Dm(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),b1=Dm(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),fw=b1==="webkitTransition"||b1==="OTransition"?b1+"End":"transitionend";function dw(ct){return typeof ct=="string"?document.getElementById(ct):ct}function w1(ct,Bt){var me=ct.style[Bt]||ct.currentStyle&&ct.currentStyle[Bt];if((!me||me==="auto")&&document.defaultView){var Qe=document.defaultView.getComputedStyle(ct,null);me=Qe?Qe[Bt]:null}return me==="auto"?null:me}function Cc(ct,Bt,me){var Qe=document.createElement(ct);return Qe.className=Bt||"",me&&me.appendChild(Qe),Qe}function Tf(ct){var Bt=ct.parentNode;Bt&&Bt.removeChild(ct)}function Oy(ct){for(;ct.firstChild;)ct.removeChild(ct.firstChild)}function hv(ct){var Bt=ct.parentNode;Bt&&Bt.lastChild!==ct&&Bt.appendChild(ct)}function bn(ct){var Bt=ct.parentNode;Bt&&Bt.firstChild!==ct&&Bt.insertBefore(ct,Bt.firstChild)}function S_(ct,Bt){if(ct.classList!==void 0)return ct.classList.contains(Bt);var me=Om(ct);return me.length>0&&new RegExp("(^|\\s)"+Bt+"(\\s|$)").test(me)}function Wu(ct,Bt){if(ct.classList!==void 0)for(var me=Fr(Bt),Qe=0,Pr=me.length;Qe0?2*window.devicePixelRatio:1;function Ac(ct){return El.edge?ct.wheelDeltaY/2:ct.deltaY&&ct.deltaMode===0?-ct.deltaY/Xc:ct.deltaY&&ct.deltaMode===1?-ct.deltaY*20:ct.deltaY&&ct.deltaMode===2?-ct.deltaY*60:ct.deltaX||ct.deltaZ?0:ct.wheelDelta?(ct.wheelDeltaY||ct.wheelDelta)/2:ct.detail&&Math.abs(ct.detail)<32765?-ct.detail*20:ct.detail?ct.detail/-32765*60:0}function yg(ct,Bt){var me=Bt.relatedTarget;if(!me)return!0;try{for(;me&&me!==ct;)me=me.parentNode}catch{return!1}return me!==ct}var Dp={__proto__:null,on:Pu,off:Bh,stopPropagation:n0,disableScrollPropagation:dm,disableClickPropagation:fv,preventDefault:mc,stop:vg,getPropagationPath:mw,getMousePosition:Jd,getWheelDelta:Ac,isExternalTarget:yg,addListener:Pu,removeListener:Bh},A1=Ei.extend({run:function(ct,Bt,me,Qe){this.stop(),this._el=ct,this._inProgress=!0,this._duration=me||.25,this._easeOutPower=1/Math.max(Qe||.5,.2),this._startPos=Rc(ct),this._offset=Bt.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=fa(this._animate,this),this._step()},_step:function(ct){var Bt=+new Date-this._startTime,me=this._duration*1e3;Btthis.options.maxZoom)?this.setZoom(ct):this},panInsideBounds:function(ct,Bt){this._enforcingBounds=!0;var me=this.getCenter(),Qe=this._limitCenter(me,this._zoom,qo(ct));return me.equals(Qe)||this.panTo(Qe,Bt),this._enforcingBounds=!1,this},panInside:function(ct,Bt){Bt=Bt||{};var me=mo(Bt.paddingTopLeft||Bt.padding||[0,0]),Qe=mo(Bt.paddingBottomRight||Bt.padding||[0,0]),Pr=this.project(this.getCenter()),Tn=this.project(ct),ji=this.getPixelBounds(),Na=pl([ji.min.add(me),ji.max.subtract(Qe)]),Ya=Na.getSize();if(!Na.contains(Tn)){this._enforcingBounds=!0;var xo=Tn.subtract(Na.getCenter()),Vs=Na.extend(Tn).getSize().subtract(Ya);Pr.x+=xo.x<0?-Vs.x:Vs.x,Pr.y+=xo.y<0?-Vs.y:Vs.y,this.panTo(this.unproject(Pr),Bt),this._enforcingBounds=!1}return this},invalidateSize:function(ct){if(!this._loaded)return this;ct=J({animate:!1,pan:!0},ct===!0?{animate:!0}:ct);var Bt=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var me=this.getSize(),Qe=Bt.divideBy(2).round(),Pr=me.divideBy(2).round(),Tn=Qe.subtract(Pr);return!Tn.x&&!Tn.y?this:(ct.animate&&ct.pan?this.panBy(Tn):(ct.pan&&this._rawPanBy(Tn),this.fire("move"),ct.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(kt(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:Bt,newSize:me}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(ct){if(ct=this._locateOptions=J({timeout:1e4,watch:!1},ct),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var Bt=kt(this._handleGeolocationResponse,this),me=kt(this._handleGeolocationError,this);return ct.watch?this._locationWatchId=navigator.geolocation.watchPosition(Bt,me,ct):navigator.geolocation.getCurrentPosition(Bt,me,ct),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(ct){if(this._container._leaflet_id){var Bt=ct.code,me=ct.message||(Bt===1?"permission denied":Bt===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:Bt,message:"Geolocation error: "+me+"."})}},_handleGeolocationResponse:function(ct){if(this._container._leaflet_id){var Bt=ct.coords.latitude,me=ct.coords.longitude,Qe=new fo(Bt,me),Pr=Qe.toBounds(ct.coords.accuracy*2),Tn=this._locateOptions;if(Tn.setView){var ji=this.getBoundsZoom(Pr);this.setView(Qe,Tn.maxZoom?Math.min(ji,Tn.maxZoom):ji)}var Na={latlng:Qe,bounds:Pr,timestamp:ct.timestamp};for(var Ya in ct.coords)typeof ct.coords[Ya]=="number"&&(Na[Ya]=ct.coords[Ya]);this.fire("locationfound",Na)}},addHandler:function(ct,Bt){if(!Bt)return this;var me=this[ct]=new Bt(this);return this._handlers.push(me),this.options[ct]&&me.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),Tf(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(Li(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var ct;for(ct in this._layers)this._layers[ct].remove();for(ct in this._panes)Tf(this._panes[ct]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(ct,Bt){var me="leaflet-pane"+(ct?" leaflet-"+ct.replace("Pane","")+"-pane":""),Qe=Cc("div",me,Bt||this._mapPane);return ct&&(this._panes[ct]=Qe),Qe},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var ct=this.getPixelBounds(),Bt=this.unproject(ct.getBottomLeft()),me=this.unproject(ct.getTopRight());return new fu(Bt,me)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(ct,Bt,me){ct=qo(ct),me=mo(me||[0,0]);var Qe=this.getZoom()||0,Pr=this.getMinZoom(),Tn=this.getMaxZoom(),ji=ct.getNorthWest(),Na=ct.getSouthEast(),Ya=this.getSize().subtract(me),xo=pl(this.project(Na,Qe),this.project(ji,Qe)).getSize(),Vs=El.any3d?this.options.zoomSnap:1,xl=Ya.x/xo.x,Du=Ya.y/xo.y,Sd=Bt?Math.max(xl,Du):Math.min(xl,Du);return Qe=this.getScaleZoom(Sd,Qe),Vs&&(Qe=Math.round(Qe/(Vs/100))*(Vs/100),Qe=Bt?Math.ceil(Qe/Vs)*Vs:Math.floor(Qe/Vs)*Vs),Math.max(Pr,Math.min(Tn,Qe))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new Va(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(ct,Bt){var me=this._getTopLeftPoint(ct,Bt);return new ko(me,me.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(ct){return this.options.crs.getProjectedBounds(ct===void 0?this.getZoom():ct)},getPane:function(ct){return typeof ct=="string"?this._panes[ct]:ct},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(ct,Bt){var me=this.options.crs;return Bt=Bt===void 0?this._zoom:Bt,me.scale(ct)/me.scale(Bt)},getScaleZoom:function(ct,Bt){var me=this.options.crs;Bt=Bt===void 0?this._zoom:Bt;var Qe=me.zoom(ct*me.scale(Bt));return isNaN(Qe)?1/0:Qe},project:function(ct,Bt){return Bt=Bt===void 0?this._zoom:Bt,this.options.crs.latLngToPoint(Ta(ct),Bt)},unproject:function(ct,Bt){return Bt=Bt===void 0?this._zoom:Bt,this.options.crs.pointToLatLng(mo(ct),Bt)},layerPointToLatLng:function(ct){var Bt=mo(ct).add(this.getPixelOrigin());return this.unproject(Bt)},latLngToLayerPoint:function(ct){var Bt=this.project(Ta(ct))._round();return Bt._subtract(this.getPixelOrigin())},wrapLatLng:function(ct){return this.options.crs.wrapLatLng(Ta(ct))},wrapLatLngBounds:function(ct){return this.options.crs.wrapLatLngBounds(qo(ct))},distance:function(ct,Bt){return this.options.crs.distance(Ta(ct),Ta(Bt))},containerPointToLayerPoint:function(ct){return mo(ct).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(ct){return mo(ct).add(this._getMapPanePos())},containerPointToLatLng:function(ct){var Bt=this.containerPointToLayerPoint(mo(ct));return this.layerPointToLatLng(Bt)},latLngToContainerPoint:function(ct){return this.layerPointToContainerPoint(this.latLngToLayerPoint(Ta(ct)))},mouseEventToContainerPoint:function(ct){return Jd(ct,this._container)},mouseEventToLayerPoint:function(ct){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(ct))},mouseEventToLatLng:function(ct){return this.layerPointToLatLng(this.mouseEventToLayerPoint(ct))},_initContainer:function(ct){var Bt=this._container=dw(ct);if(Bt){if(Bt._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");Pu(Bt,"scroll",this._onScroll,this),this._containerId=Gt(Bt)},_initLayout:function(){var ct=this._container;this._fadeAnimated=this.options.fadeAnimation&&El.any3d,Wu(ct,"leaflet-container"+(El.touch?" leaflet-touch":"")+(El.retina?" leaflet-retina":"")+(El.ielt9?" leaflet-oldie":"")+(El.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var Bt=w1(ct,"position");Bt!=="absolute"&&Bt!=="relative"&&Bt!=="fixed"&&Bt!=="sticky"&&(ct.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var ct=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),ic(this._mapPane,new Va(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(Wu(ct.markerPane,"leaflet-zoom-hide"),Wu(ct.shadowPane,"leaflet-zoom-hide"))},_resetView:function(ct,Bt,me){ic(this._mapPane,new Va(0,0));var Qe=!this._loaded;this._loaded=!0,Bt=this._limitZoom(Bt),this.fire("viewprereset");var Pr=this._zoom!==Bt;this._moveStart(Pr,me)._move(ct,Bt)._moveEnd(Pr),this.fire("viewreset"),Qe&&this.fire("load")},_moveStart:function(ct,Bt){return ct&&this.fire("zoomstart"),Bt||this.fire("movestart"),this},_move:function(ct,Bt,me,Qe){Bt===void 0&&(Bt=this._zoom);var Pr=this._zoom!==Bt;return this._zoom=Bt,this._lastCenter=ct,this._pixelOrigin=this._getNewPixelOrigin(ct),Qe?me&&me.pinch&&this.fire("zoom",me):((Pr||me&&me.pinch)&&this.fire("zoom",me),this.fire("move",me)),this},_moveEnd:function(ct){return ct&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return Li(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(ct){ic(this._mapPane,this._getMapPanePos().subtract(ct))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(ct){this._targets={},this._targets[Gt(this._container)]=this;var Bt=ct?Bh:Pu;Bt(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&Bt(window,"resize",this._onResize,this),El.any3d&&this.options.transform3DLimit&&(ct?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){Li(this._resizeRequest),this._resizeRequest=fa(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var ct=this._getMapPanePos();Math.max(Math.abs(ct.x),Math.abs(ct.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(ct,Bt){for(var me=[],Qe,Pr=Bt==="mouseout"||Bt==="mouseover",Tn=ct.target||ct.srcElement,ji=!1;Tn;){if(Qe=this._targets[Gt(Tn)],Qe&&(Bt==="click"||Bt==="preclick")&&this._draggableMoved(Qe)){ji=!0;break}if(Qe&&Qe.listens(Bt,!0)&&(Pr&&!yg(Tn,ct)||(me.push(Qe),Pr))||Tn===this._container)break;Tn=Tn.parentNode}return!me.length&&!ji&&!Pr&&this.listens(Bt,!0)&&(me=[this]),me},_isClickDisabled:function(ct){for(;ct&&ct!==this._container;){if(ct._leaflet_disable_click)return!0;ct=ct.parentNode}},_handleDOMEvent:function(ct){var Bt=ct.target||ct.srcElement;if(!(!this._loaded||Bt._leaflet_disable_events||ct.type==="click"&&this._isClickDisabled(Bt))){var me=ct.type;me==="mousedown"&&Hd(Bt),this._fireDOMEvent(ct,me)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(ct,Bt,me){if(ct.type==="click"){var Qe=J({},ct);Qe.type="preclick",this._fireDOMEvent(Qe,Qe.type,me)}var Pr=this._findEventTargets(ct,Bt);if(me){for(var Tn=[],ji=0;ji0?Math.round(ct-Bt)/2:Math.max(0,Math.ceil(ct))-Math.max(0,Math.floor(Bt))},_limitZoom:function(ct){var Bt=this.getMinZoom(),me=this.getMaxZoom(),Qe=El.any3d?this.options.zoomSnap:1;return Qe&&(ct=Math.round(ct/Qe)*Qe),Math.max(Bt,Math.min(me,ct))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){Rf(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(ct,Bt){var me=this._getCenterOffset(ct)._trunc();return(Bt&&Bt.animate)!==!0&&!this.getSize().contains(me)?!1:(this.panBy(me,Bt),!0)},_createAnimProxy:function(){var ct=this._proxy=Cc("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(ct),this.on("zoomanim",function(Bt){var me=M_,Qe=this._proxy.style[me];pu(this._proxy,this.project(Bt.center,Bt.zoom),this.getZoomScale(Bt.zoom,1)),Qe===this._proxy.style[me]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){Tf(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var ct=this.getCenter(),Bt=this.getZoom();pu(this._proxy,this.project(ct,Bt),this.getZoomScale(Bt,1))},_catchTransitionEnd:function(ct){this._animatingZoom&&ct.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(ct,Bt,me){if(this._animatingZoom)return!0;if(me=me||{},!this._zoomAnimated||me.animate===!1||this._nothingToAnimate()||Math.abs(Bt-this._zoom)>this.options.zoomAnimationThreshold)return!1;var Qe=this.getZoomScale(Bt),Pr=this._getCenterOffset(ct)._divideBy(1-1/Qe);return me.animate!==!0&&!this.getSize().contains(Pr)?!1:(fa(function(){this._moveStart(!0,me.noMoveStart||!1)._animateZoom(ct,Bt,!0)},this),!0)},_animateZoom:function(ct,Bt,me,Qe){this._mapPane&&(me&&(this._animatingZoom=!0,this._animateToCenter=ct,this._animateToZoom=Bt,Wu(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:ct,zoom:Bt,noUpdate:Qe}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(kt(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&Rf(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function js(ct,Bt){return new Mc(ct,Bt)}var lp=ra.extend({options:{position:"topright"},initialize:function(ct){zr(this,ct)},getPosition:function(){return this.options.position},setPosition:function(ct){var Bt=this._map;return Bt&&Bt.removeControl(this),this.options.position=ct,Bt&&Bt.addControl(this),this},getContainer:function(){return this._container},addTo:function(ct){this.remove(),this._map=ct;var Bt=this._container=this.onAdd(ct),me=this.getPosition(),Qe=ct._controlCorners[me];return Wu(Bt,"leaflet-control"),me.indexOf("bottom")!==-1?Qe.insertBefore(Bt,Qe.firstChild):Qe.appendChild(Bt),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(Tf(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(ct){this._map&&ct&&ct.screenX>0&&ct.screenY>0&&this._map.getContainer().focus()}}),i0=function(ct){return new lp(ct)};Mc.include({addControl:function(ct){return ct.addTo(this),this},removeControl:function(ct){return ct.remove(),this},_initControlPos:function(){var ct=this._controlCorners={},Bt="leaflet-",me=this._controlContainer=Cc("div",Bt+"control-container",this._container);function Qe(Pr,Tn){var ji=Bt+Pr+" "+Bt+Tn;ct[Pr+Tn]=Cc("div",ji,me)}Qe("top","left"),Qe("top","right"),Qe("bottom","left"),Qe("bottom","right")},_clearControlPos:function(){for(var ct in this._controlCorners)Tf(this._controlCorners[ct]);Tf(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var dv=lp.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(ct,Bt,me,Qe){return me1,this._baseLayersList.style.display=ct?"":"none"),this._separator.style.display=Bt&&ct?"":"none",this},_onLayerChange:function(ct){this._handlingClick||this._update();var Bt=this._getLayer(Gt(ct.target)),me=Bt.overlay?ct.type==="add"?"overlayadd":"overlayremove":ct.type==="add"?"baselayerchange":null;me&&this._map.fire(me,Bt)},_createRadioElement:function(ct,Bt){var me='",Qe=document.createElement("div");return Qe.innerHTML=me,Qe.firstChild},_addItem:function(ct){var Bt=document.createElement("label"),me=this._map.hasLayer(ct.layer),Qe;ct.overlay?(Qe=document.createElement("input"),Qe.type="checkbox",Qe.className="leaflet-control-layers-selector",Qe.defaultChecked=me):Qe=this._createRadioElement("leaflet-base-layers_"+Gt(this),me),this._layerControlInputs.push(Qe),Qe.layerId=Gt(ct.layer),Pu(Qe,"click",this._onInputClick,this);var Pr=document.createElement("span");Pr.innerHTML=" "+ct.name;var Tn=document.createElement("span");Bt.appendChild(Tn),Tn.appendChild(Qe),Tn.appendChild(Pr);var ji=ct.overlay?this._overlaysList:this._baseLayersList;return ji.appendChild(Bt),this._checkDisabledLayers(),Bt},_onInputClick:function(){if(!this._preventClick){var ct=this._layerControlInputs,Bt,me,Qe=[],Pr=[];this._handlingClick=!0;for(var Tn=ct.length-1;Tn>=0;Tn--)Bt=ct[Tn],me=this._getLayer(Bt.layerId).layer,Bt.checked?Qe.push(me):Bt.checked||Pr.push(me);for(Tn=0;Tn=0;Pr--)Bt=ct[Pr],me=this._getLayer(Bt.layerId).layer,Bt.disabled=me.options.minZoom!==void 0&&Qeme.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var ct=this._section;this._preventClick=!0,Pu(ct,"click",mc),this.expand();var Bt=this;setTimeout(function(){Bh(ct,"click",mc),Bt._preventClick=!1})}}),Y0=function(ct,Bt,me){return new dv(ct,Bt,me)},Es=lp.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(ct){var Bt="leaflet-control-zoom",me=Cc("div",Bt+" leaflet-bar"),Qe=this.options;return this._zoomInButton=this._createButton(Qe.zoomInText,Qe.zoomInTitle,Bt+"-in",me,this._zoomIn),this._zoomOutButton=this._createButton(Qe.zoomOutText,Qe.zoomOutTitle,Bt+"-out",me,this._zoomOut),this._updateDisabled(),ct.on("zoomend zoomlevelschange",this._updateDisabled,this),me},onRemove:function(ct){ct.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(ct){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(ct.shiftKey?3:1))},_createButton:function(ct,Bt,me,Qe,Pr){var Tn=Cc("a",me,Qe);return Tn.innerHTML=ct,Tn.href="#",Tn.title=Bt,Tn.setAttribute("role","button"),Tn.setAttribute("aria-label",Bt),fv(Tn),Pu(Tn,"click",vg),Pu(Tn,"click",Pr,this),Pu(Tn,"click",this._refocusOnMap,this),Tn},_updateDisabled:function(){var ct=this._map,Bt="leaflet-disabled";Rf(this._zoomInButton,Bt),Rf(this._zoomOutButton,Bt),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||ct._zoom===ct.getMinZoom())&&(Wu(this._zoomOutButton,Bt),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||ct._zoom===ct.getMaxZoom())&&(Wu(this._zoomInButton,Bt),this._zoomInButton.setAttribute("aria-disabled","true"))}});Mc.mergeOptions({zoomControl:!0}),Mc.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Es,this.addControl(this.zoomControl))});var gw=function(ct){return new Es(ct)},E_=lp.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(ct){var Bt="leaflet-control-scale",me=Cc("div",Bt),Qe=this.options;return this._addScales(Qe,Bt+"-line",me),ct.on(Qe.updateWhenIdle?"moveend":"move",this._update,this),ct.whenReady(this._update,this),me},onRemove:function(ct){ct.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(ct,Bt,me){ct.metric&&(this._mScale=Cc("div",Bt,me)),ct.imperial&&(this._iScale=Cc("div",Bt,me))},_update:function(){var ct=this._map,Bt=ct.getSize().y/2,me=ct.distance(ct.containerPointToLatLng([0,Bt]),ct.containerPointToLatLng([this.options.maxWidth,Bt]));this._updateScales(me)},_updateScales:function(ct){this.options.metric&&ct&&this._updateMetric(ct),this.options.imperial&&ct&&this._updateImperial(ct)},_updateMetric:function(ct){var Bt=this._getRoundNum(ct),me=Bt<1e3?Bt+" m":Bt/1e3+" km";this._updateScale(this._mScale,me,Bt/ct)},_updateImperial:function(ct){var Bt=ct*3.2808399,me,Qe,Pr;Bt>5280?(me=Bt/5280,Qe=this._getRoundNum(me),this._updateScale(this._iScale,Qe+" mi",Qe/me)):(Pr=this._getRoundNum(Bt),this._updateScale(this._iScale,Pr+" ft",Pr/Bt))},_updateScale:function(ct,Bt,me){ct.style.width=Math.round(this.options.maxWidth*me)+"px",ct.innerHTML=Bt},_getRoundNum:function(ct){var Bt=Math.pow(10,(Math.floor(ct)+"").length-1),me=ct/Bt;return me=me>=10?10:me>=5?5:me>=3?3:me>=2?2:1,Bt*me}}),h6=function(ct){return new E_(ct)},C_='',L_=lp.extend({options:{position:"bottomright",prefix:''+(El.inlineSvg?C_+" ":"")+"Leaflet"},initialize:function(ct){zr(this,ct),this._attributions={}},onAdd:function(ct){ct.attributionControl=this,this._container=Cc("div","leaflet-control-attribution"),fv(this._container);for(var Bt in ct._layers)ct._layers[Bt].getAttribution&&this.addAttribution(ct._layers[Bt].getAttribution());return this._update(),ct.on("layeradd",this._addAttribution,this),this._container},onRemove:function(ct){ct.off("layeradd",this._addAttribution,this)},_addAttribution:function(ct){ct.layer.getAttribution&&(this.addAttribution(ct.layer.getAttribution()),ct.layer.once("remove",function(){this.removeAttribution(ct.layer.getAttribution())},this))},setPrefix:function(ct){return this.options.prefix=ct,this._update(),this},addAttribution:function(ct){return ct?(this._attributions[ct]||(this._attributions[ct]=0),this._attributions[ct]++,this._update(),this):this},removeAttribution:function(ct){return ct?(this._attributions[ct]&&(this._attributions[ct]--,this._update()),this):this},_update:function(){if(this._map){var ct=[];for(var Bt in this._attributions)this._attributions[Bt]&&ct.push(Bt);var me=[];this.options.prefix&&me.push(this.options.prefix),ct.length&&me.push(ct.join(", ")),this._container.innerHTML=me.join(' ')}}});Mc.mergeOptions({attributionControl:!0}),Mc.addInitHook(function(){this.options.attributionControl&&new L_().addTo(this)});var f6=function(ct){return new L_(ct)};lp.Layers=dv,lp.Zoom=Es,lp.Scale=E_,lp.Attribution=L_,i0.layers=Y0,i0.zoom=gw,i0.scale=h6,i0.attribution=f6;var K0=ra.extend({initialize:function(ct){this._map=ct},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});K0.addTo=function(ct,Bt){return ct.addHandler(Bt,this),this};var up={Events:Ni},P0=El.touch?"touchstart mousedown":"mousedown",Fm=Ei.extend({options:{clickTolerance:3},initialize:function(ct,Bt,me,Qe){zr(this,Qe),this._element=ct,this._dragStartTarget=Bt||ct,this._preventOutline=me},enable:function(){this._enabled||(Pu(this._dragStartTarget,P0,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Fm._dragging===this&&this.finishDrag(!0),Bh(this._dragStartTarget,P0,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(ct){if(this._enabled&&(this._moved=!1,!S_(this._element,"leaflet-zoom-anim"))){if(ct.touches&&ct.touches.length!==1){Fm._dragging===this&&this.finishDrag();return}if(!(Fm._dragging||ct.shiftKey||ct.which!==1&&ct.button!==1&&!ct.touches)&&(Fm._dragging=this,this._preventOutline&&Hd(this._element),Kc(),C0(),!this._moving)){this.fire("down");var Bt=ct.touches?ct.touches[0]:ct,me=Ad(this._element);this._startPoint=new Va(Bt.clientX,Bt.clientY),this._startPos=Rc(this._element),this._parentScale=T1(me);var Qe=ct.type==="mousedown";Pu(document,Qe?"mousemove":"touchmove",this._onMove,this),Pu(document,Qe?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(ct){if(this._enabled){if(ct.touches&&ct.touches.length>1){this._moved=!0;return}var Bt=ct.touches&&ct.touches.length===1?ct.touches[0]:ct,me=new Va(Bt.clientX,Bt.clientY)._subtract(this._startPoint);!me.x&&!me.y||Math.abs(me.x)+Math.abs(me.y)Tn&&(ji=Na,Tn=Ya);Tn>me&&(Bt[ji]=1,_g(ct,Bt,me,Qe,ji),_g(ct,Bt,me,ji,Pr))}function yw(ct,Bt){for(var me=[ct[0]],Qe=1,Pr=0,Tn=ct.length;QeBt&&(me.push(ct[Qe]),Pr=Qe);return PrBt.max.x&&(me|=2),ct.yBt.max.y&&(me|=8),me}function m6(ct,Bt){var me=Bt.x-ct.x,Qe=Bt.y-ct.y;return me*me+Qe*Qe}function pv(ct,Bt,me,Qe){var Pr=Bt.x,Tn=Bt.y,ji=me.x-Pr,Na=me.y-Tn,Ya=ji*ji+Na*Na,xo;return Ya>0&&(xo=((ct.x-Pr)*ji+(ct.y-Tn)*Na)/Ya,xo>1?(Pr=me.x,Tn=me.y):xo>0&&(Pr+=ji*xo,Tn+=Na*xo)),ji=ct.x-Pr,Na=ct.y-Tn,Qe?ji*ji+Na*Na:new Va(Pr,Tn)}function g0(ct){return!kn(ct[0])||typeof ct[0][0]!="object"&&typeof ct[0][0]<"u"}function xw(ct){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),g0(ct)}function _w(ct,Bt){var me,Qe,Pr,Tn,ji,Na,Ya,xo;if(!ct||ct.length===0)throw new Error("latlngs not passed");g0(ct)||(console.warn("latlngs are not flat! Only the first ring will be used"),ct=ct[0]);var Vs=Ta([0,0]),xl=qo(ct),Du=xl.getNorthWest().distanceTo(xl.getSouthWest())*xl.getNorthEast().distanceTo(xl.getNorthWest());Du<1700&&(Vs=Ry(ct));var Sd=ct.length,Bf=[];for(me=0;meQe){Ya=(Tn-Qe)/Pr,xo=[Na.x-Ya*(Na.x-ji.x),Na.y-Ya*(Na.y-ji.y)];break}var wp=Bt.unproject(mo(xo));return Ta([wp.lat+Vs.lat,wp.lng+Vs.lng])}var Qh={__proto__:null,simplify:z_,pointToSegmentDistance:vw,closestPointOnSegment:xg,clipSegment:O_,_getEdgeIntersection:bg,_getBitCode:wg,_sqClosestPointOnSegment:pv,isFlat:g0,_flat:xw,polylineCenter:_w},v0={project:function(ct){return new Va(ct.lng,ct.lat)},unproject:function(ct){return new fo(ct.y,ct.x)},bounds:new ko([-180,-90],[180,90])},mv={R:6378137,R_MINOR:6356752314245179e-9,bounds:new ko([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(ct){var Bt=Math.PI/180,me=this.R,Qe=ct.lat*Bt,Pr=this.R_MINOR/me,Tn=Math.sqrt(1-Pr*Pr),ji=Tn*Math.sin(Qe),Na=Math.tan(Math.PI/4-Qe/2)/Math.pow((1-ji)/(1+ji),Tn/2);return Qe=-me*Math.log(Math.max(Na,1e-10)),new Va(ct.lng*Bt*me,Qe)},unproject:function(ct){for(var Bt=180/Math.PI,me=this.R,Qe=this.R_MINOR/me,Pr=Math.sqrt(1-Qe*Qe),Tn=Math.exp(-ct.y/me),ji=Math.PI/2-2*Math.atan(Tn),Na=0,Ya=.1,xo;Na<15&&Math.abs(Ya)>1e-7;Na++)xo=Pr*Math.sin(ji),xo=Math.pow((1-xo)/(1+xo),Pr/2),Ya=Math.PI/2-2*Math.atan(Tn*xo)-ji,ji+=Ya;return new fo(ji*Bt,ct.x*Bt/me)}},D_={__proto__:null,LonLat:v0,Mercator:mv,SphericalMercator:Ps},F_=J({},go,{code:"EPSG:3395",projection:mv,transformation:function(){var ct=.5/(Math.PI*mv.R);return gi(ct,.5,-ct,.5)}()}),By=J({},go,{code:"EPSG:4326",projection:v0,transformation:gi(1/180,1,-1/180,.5)}),kg=J({},Ea,{projection:v0,transformation:gi(1,0,-1,0),scale:function(ct){return Math.pow(2,ct)},zoom:function(ct){return Math.log(ct)/Math.LN2},distance:function(ct,Bt){var me=Bt.lng-ct.lng,Qe=Bt.lat-ct.lat;return Math.sqrt(me*me+Qe*Qe)},infinite:!0});Ea.Earth=go,Ea.EPSG3395=F_,Ea.EPSG3857=bi,Ea.EPSG900913=li,Ea.EPSG4326=By,Ea.Simple=kg;var a0=Ei.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(ct){return ct.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(ct){return ct&&ct.removeLayer(this),this},getPane:function(ct){return this._map.getPane(ct?this.options[ct]||ct:this.options.pane)},addInteractiveTarget:function(ct){return this._map._targets[Gt(ct)]=this,this},removeInteractiveTarget:function(ct){return delete this._map._targets[Gt(ct)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(ct){var Bt=ct.target;if(Bt.hasLayer(this)){if(this._map=Bt,this._zoomAnimated=Bt._zoomAnimated,this.getEvents){var me=this.getEvents();Bt.on(me,this),this.once("remove",function(){Bt.off(me,this)},this)}this.onAdd(Bt),this.fire("add"),Bt.fire("layeradd",{layer:this})}}});Mc.include({addLayer:function(ct){if(!ct._layerAdd)throw new Error("The provided object is not a Layer.");var Bt=Gt(ct);return this._layers[Bt]?this:(this._layers[Bt]=ct,ct._mapToAdd=this,ct.beforeAdd&&ct.beforeAdd(this),this.whenReady(ct._layerAdd,ct),this)},removeLayer:function(ct){var Bt=Gt(ct);return this._layers[Bt]?(this._loaded&&ct.onRemove(this),delete this._layers[Bt],this._loaded&&(this.fire("layerremove",{layer:ct}),ct.fire("remove")),ct._map=ct._mapToAdd=null,this):this},hasLayer:function(ct){return Gt(ct)in this._layers},eachLayer:function(ct,Bt){for(var me in this._layers)ct.call(Bt,this._layers[me]);return this},_addLayers:function(ct){ct=ct?kn(ct)?ct:[ct]:[];for(var Bt=0,me=ct.length;Btthis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()=2&&Bt[0]instanceof fo&&Bt[0].equals(Bt[me-1])&&Bt.pop(),Bt},_setLatLngs:function(ct){y0.prototype._setLatLngs.call(this,ct),g0(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return g0(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var ct=this._renderer._bounds,Bt=this.options.weight,me=new Va(Bt,Bt);if(ct=new ko(ct.min.subtract(me),ct.max.add(me)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(ct))){if(this.options.noClip){this._parts=this._rings;return}for(var Qe=0,Pr=this._rings.length,Tn;Qect.y!=Pr.y>ct.y&&ct.x<(Pr.x-Qe.x)*(ct.y-Qe.y)/(Pr.y-Qe.y)+Qe.x&&(Bt=!Bt);return Bt||y0.prototype._containsPoint.call(this,ct,!0)}});function v6(ct,Bt){return new yv(ct,Bt)}var pm=bp.extend({initialize:function(ct,Bt){zr(this,Bt),this._layers={},ct&&this.addData(ct)},addData:function(ct){var Bt=kn(ct)?ct:ct.features,me,Qe,Pr;if(Bt){for(me=0,Qe=Bt.length;me0&&Pr.push(Pr[0].slice()),Pr}function mm(ct,Bt){return ct.feature?J({},ct.feature,{geometry:Bt}):qy(Bt)}function qy(ct){return ct.type==="Feature"||ct.type==="FeatureCollection"?ct:{type:"Feature",properties:{},geometry:ct}}var U_={toGeoJSON:function(ct){return mm(this,{type:"Point",coordinates:j_(this.getLatLng(),ct)})}};M1.include(U_),Uy.include(U_),jy.include(U_),y0.include({toGeoJSON:function(ct){var Bt=!g0(this._latlngs),me=Wy(this._latlngs,Bt?1:0,!1,ct);return mm(this,{type:(Bt?"Multi":"")+"LineString",coordinates:me})}}),yv.include({toGeoJSON:function(ct){var Bt=!g0(this._latlngs),me=Bt&&!g0(this._latlngs[0]),Qe=Wy(this._latlngs,me?2:Bt?1:0,!0,ct);return Bt||(Qe=[Qe]),mm(this,{type:(me?"Multi":"")+"Polygon",coordinates:Qe})}}),Tg.include({toMultiPoint:function(ct){var Bt=[];return this.eachLayer(function(me){Bt.push(me.toGeoJSON(ct).geometry.coordinates)}),mm(this,{type:"MultiPoint",coordinates:Bt})},toGeoJSON:function(ct){var Bt=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(Bt==="MultiPoint")return this.toMultiPoint(ct);var me=Bt==="GeometryCollection",Qe=[];return this.eachLayer(function(Pr){if(Pr.toGeoJSON){var Tn=Pr.toGeoJSON(ct);if(me)Qe.push(Tn.geometry);else{var ji=qy(Tn);ji.type==="FeatureCollection"?Qe.push.apply(Qe,ji.features):Qe.push(ji)}}}),me?mm(this,{geometries:Qe,type:"GeometryCollection"}):{type:"FeatureCollection",features:Qe}}});function V_(ct,Bt){return new pm(ct,Bt)}var Zy=V_,gm=a0.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(ct,Bt,me){this._url=ct,this._bounds=qo(Bt),zr(this,me)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(Wu(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){Tf(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(ct){return this.options.opacity=ct,this._image&&this._updateOpacity(),this},setStyle:function(ct){return ct.opacity&&this.setOpacity(ct.opacity),this},bringToFront:function(){return this._map&&hv(this._image),this},bringToBack:function(){return this._map&&bn(this._image),this},setUrl:function(ct){return this._url=ct,this._image&&(this._image.src=ct),this},setBounds:function(ct){return this._bounds=qo(ct),this._map&&this._reset(),this},getEvents:function(){var ct={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(ct.zoomanim=this._animateZoom),ct},setZIndex:function(ct){return this.options.zIndex=ct,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var ct=this._url.tagName==="IMG",Bt=this._image=ct?this._url:Cc("img");if(Wu(Bt,"leaflet-image-layer"),this._zoomAnimated&&Wu(Bt,"leaflet-zoom-animated"),this.options.className&&Wu(Bt,this.options.className),Bt.onselectstart=Ne,Bt.onmousemove=Ne,Bt.onload=kt(this.fire,this,"load"),Bt.onerror=kt(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(Bt.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),ct){this._url=Bt.src;return}Bt.src=this._url,Bt.alt=this.options.alt},_animateZoom:function(ct){var Bt=this._map.getZoomScale(ct.zoom),me=this._map._latLngBoundsToNewLayerBounds(this._bounds,ct.zoom,ct.center).min;pu(this._image,me,Bt)},_reset:function(){var ct=this._image,Bt=new ko(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),me=Bt.getSize();ic(ct,Bt.min),ct.style.width=me.x+"px",ct.style.height=me.y+"px"},_updateOpacity:function(){m0(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var ct=this.options.errorOverlayUrl;ct&&this._url!==ct&&(this._url=ct,this._image.src=ct)},getCenter:function(){return this._bounds.getCenter()}}),vm=function(ct,Bt,me){return new gm(ct,Bt,me)},z0=gm.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var ct=this._url.tagName==="VIDEO",Bt=this._image=ct?this._url:Cc("video");if(Wu(Bt,"leaflet-image-layer"),this._zoomAnimated&&Wu(Bt,"leaflet-zoom-animated"),this.options.className&&Wu(Bt,this.options.className),Bt.onselectstart=Ne,Bt.onmousemove=Ne,Bt.onloadeddata=kt(this.fire,this,"load"),ct){for(var me=Bt.getElementsByTagName("source"),Qe=[],Pr=0;Pr0?Qe:[Bt.src];return}kn(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(Bt.style,"objectFit")&&(Bt.style.objectFit="fill"),Bt.autoplay=!!this.options.autoplay,Bt.loop=!!this.options.loop,Bt.muted=!!this.options.muted,Bt.playsInline=!!this.options.playsInline;for(var Tn=0;TnPr?(Bt.height=Pr+"px",Wu(ct,Tn)):Rf(ct,Tn),this._containerWidth=this._container.offsetWidth},_animateZoom:function(ct){var Bt=this._map._latLngToNewLayerPoint(this._latlng,ct.zoom,ct.center),me=this._getAnchor();ic(this._container,Bt.add(me))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var ct=this._map,Bt=parseInt(w1(this._container,"marginBottom"),10)||0,me=this._container.offsetHeight+Bt,Qe=this._containerWidth,Pr=new Va(this._containerLeft,-me-this._containerBottom);Pr._add(Rc(this._container));var Tn=ct.layerPointToContainerPoint(Pr),ji=mo(this.options.autoPanPadding),Na=mo(this.options.autoPanPaddingTopLeft||ji),Ya=mo(this.options.autoPanPaddingBottomRight||ji),xo=ct.getSize(),Vs=0,xl=0;Tn.x+Qe+Ya.x>xo.x&&(Vs=Tn.x+Qe-xo.x+Ya.x),Tn.x-Vs-Na.x<0&&(Vs=Tn.x-Na.x),Tn.y+me+Ya.y>xo.y&&(xl=Tn.y+me-xo.y+Ya.y),Tn.y-xl-Na.y<0&&(xl=Tn.y-Na.y),(Vs||xl)&&(this.options.keepInView&&(this._autopanning=!0),ct.fire("autopanstart").panBy([Vs,xl]))}},_getAnchor:function(){return mo(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),vf=function(ct,Bt){return new Ag(ct,Bt)};Mc.mergeOptions({closePopupOnClick:!0}),Mc.include({openPopup:function(ct,Bt,me){return this._initOverlay(Ag,ct,Bt,me).openOn(this),this},closePopup:function(ct){return ct=arguments.length?ct:this._popup,ct&&ct.close(),this}}),a0.include({bindPopup:function(ct,Bt){return this._popup=this._initOverlay(Ag,this._popup,ct,Bt),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(ct){return this._popup&&(this instanceof bp||(this._popup._source=this),this._popup._prepareOpen(ct||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(ct){return this._popup&&this._popup.setContent(ct),this},getPopup:function(){return this._popup},_openPopup:function(ct){if(!(!this._popup||!this._map)){vg(ct);var Bt=ct.layer||ct.target;if(this._popup._source===Bt&&!(Bt instanceof Bm)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(ct.latlng);return}this._popup._source=Bt,this.openPopup(ct.latlng)}},_movePopup:function(ct){this._popup.setLatLng(ct.latlng)},_onKeyPress:function(ct){ct.originalEvent.keyCode===13&&this._openPopup(ct)}});var S1=X0.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(ct){X0.prototype.onAdd.call(this,ct),this.setOpacity(this.options.opacity),ct.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(ct){X0.prototype.onRemove.call(this,ct),ct.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var ct=X0.prototype.getEvents.call(this);return this.options.permanent||(ct.preclick=this.close),ct},_initLayout:function(){var ct="leaflet-tooltip",Bt=ct+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=Cc("div",Bt),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+Gt(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(ct){var Bt,me,Qe=this._map,Pr=this._container,Tn=Qe.latLngToContainerPoint(Qe.getCenter()),ji=Qe.layerPointToContainerPoint(ct),Na=this.options.direction,Ya=Pr.offsetWidth,xo=Pr.offsetHeight,Vs=mo(this.options.offset),xl=this._getAnchor();Na==="top"?(Bt=Ya/2,me=xo):Na==="bottom"?(Bt=Ya/2,me=0):Na==="center"?(Bt=Ya/2,me=xo/2):Na==="right"?(Bt=0,me=xo/2):Na==="left"?(Bt=Ya,me=xo/2):ji.xthis.options.maxZoom||meQe?this._retainParent(Pr,Tn,ji,Qe):!1)},_retainChildren:function(ct,Bt,me,Qe){for(var Pr=2*ct;Pr<2*ct+2;Pr++)for(var Tn=2*Bt;Tn<2*Bt+2;Tn++){var ji=new Va(Pr,Tn);ji.z=me+1;var Na=this._tileCoordsToKey(ji),Ya=this._tiles[Na];if(Ya&&Ya.active){Ya.retain=!0;continue}else Ya&&Ya.loaded&&(Ya.retain=!0);me+1this.options.maxZoom||this.options.minZoom!==void 0&&Pr1){this._setView(ct,me);return}for(var xl=Pr.min.y;xl<=Pr.max.y;xl++)for(var Du=Pr.min.x;Du<=Pr.max.x;Du++){var Sd=new Va(Du,xl);if(Sd.z=this._tileZoom,!!this._isValidTile(Sd)){var Bf=this._tiles[this._tileCoordsToKey(Sd)];Bf?Bf.current=!0:ji.push(Sd)}}if(ji.sort(function(wp,jm){return wp.distanceTo(Tn)-jm.distanceTo(Tn)}),ji.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var _0=document.createDocumentFragment();for(Du=0;Dume.max.x)||!Bt.wrapLat&&(ct.yme.max.y))return!1}if(!this.options.bounds)return!0;var Qe=this._tileCoordsToBounds(ct);return qo(this.options.bounds).overlaps(Qe)},_keyToBounds:function(ct){return this._tileCoordsToBounds(this._keyToTileCoords(ct))},_tileCoordsToNwSe:function(ct){var Bt=this._map,me=this.getTileSize(),Qe=ct.scaleBy(me),Pr=Qe.add(me),Tn=Bt.unproject(Qe,ct.z),ji=Bt.unproject(Pr,ct.z);return[Tn,ji]},_tileCoordsToBounds:function(ct){var Bt=this._tileCoordsToNwSe(ct),me=new fu(Bt[0],Bt[1]);return this.options.noWrap||(me=this._map.wrapLatLngBounds(me)),me},_tileCoordsToKey:function(ct){return ct.x+":"+ct.y+":"+ct.z},_keyToTileCoords:function(ct){var Bt=ct.split(":"),me=new Va(+Bt[0],+Bt[1]);return me.z=+Bt[2],me},_removeTile:function(ct){var Bt=this._tiles[ct];Bt&&(Tf(Bt.el),delete this._tiles[ct],this.fire("tileunload",{tile:Bt.el,coords:this._keyToTileCoords(ct)}))},_initTile:function(ct){Wu(ct,"leaflet-tile");var Bt=this.getTileSize();ct.style.width=Bt.x+"px",ct.style.height=Bt.y+"px",ct.onselectstart=Ne,ct.onmousemove=Ne,El.ielt9&&this.options.opacity<1&&m0(ct,this.options.opacity)},_addTile:function(ct,Bt){var me=this._getTilePos(ct),Qe=this._tileCoordsToKey(ct),Pr=this.createTile(this._wrapCoords(ct),kt(this._tileReady,this,ct));this._initTile(Pr),this.createTile.length<2&&fa(kt(this._tileReady,this,ct,null,Pr)),ic(Pr,me),this._tiles[Qe]={el:Pr,coords:ct,current:!0},Bt.appendChild(Pr),this.fire("tileloadstart",{tile:Pr,coords:ct})},_tileReady:function(ct,Bt,me){Bt&&this.fire("tileerror",{error:Bt,tile:me,coords:ct});var Qe=this._tileCoordsToKey(ct);me=this._tiles[Qe],me&&(me.loaded=+new Date,this._map._fadeAnimated?(m0(me.el,0),Li(this._fadeFrame),this._fadeFrame=fa(this._updateOpacity,this)):(me.active=!0,this._pruneTiles()),Bt||(Wu(me.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:me.el,coords:ct})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),El.ielt9||!this._map._fadeAnimated?fa(this._pruneTiles,this):setTimeout(kt(this._pruneTiles,this),250)))},_getTilePos:function(ct){return ct.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(ct){var Bt=new Va(this._wrapX?pe(ct.x,this._wrapX):ct.x,this._wrapY?pe(ct.y,this._wrapY):ct.y);return Bt.z=ct.z,Bt},_pxBoundsToTileRange:function(ct){var Bt=this.getTileSize();return new ko(ct.min.unscaleBy(Bt).floor(),ct.max.unscaleBy(Bt).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var ct in this._tiles)if(!this._tiles[ct].loaded)return!1;return!0}});function W_(ct){return new E1(ct)}var o0=E1.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(ct,Bt){this._url=ct,Bt=zr(this,Bt),Bt.detectRetina&&El.retina&&Bt.maxZoom>0?(Bt.tileSize=Math.floor(Bt.tileSize/2),Bt.zoomReverse?(Bt.zoomOffset--,Bt.minZoom=Math.min(Bt.maxZoom,Bt.minZoom+1)):(Bt.zoomOffset++,Bt.maxZoom=Math.max(Bt.minZoom,Bt.maxZoom-1)),Bt.minZoom=Math.max(0,Bt.minZoom)):Bt.zoomReverse?Bt.minZoom=Math.min(Bt.maxZoom,Bt.minZoom):Bt.maxZoom=Math.max(Bt.minZoom,Bt.maxZoom),typeof Bt.subdomains=="string"&&(Bt.subdomains=Bt.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(ct,Bt){return this._url===ct&&Bt===void 0&&(Bt=!0),this._url=ct,Bt||this.redraw(),this},createTile:function(ct,Bt){var me=document.createElement("img");return Pu(me,"load",kt(this._tileOnLoad,this,Bt,me)),Pu(me,"error",kt(this._tileOnError,this,Bt,me)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(me.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(me.referrerPolicy=this.options.referrerPolicy),me.alt="",me.src=this.getTileUrl(ct),me},getTileUrl:function(ct){var Bt={r:El.retina?"@2x":"",s:this._getSubdomain(ct),x:ct.x,y:ct.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var me=this._globalTileRange.max.y-ct.y;this.options.tms&&(Bt.y=me),Bt["-y"]=me}return Ft(this._url,J(Bt,this.options))},_tileOnLoad:function(ct,Bt){El.ielt9?setTimeout(kt(ct,this,null,Bt),0):ct(null,Bt)},_tileOnError:function(ct,Bt,me){var Qe=this.options.errorTileUrl;Qe&&Bt.getAttribute("src")!==Qe&&(Bt.src=Qe),ct(me,Bt)},_onTileRemove:function(ct){ct.tile.onload=null},_getZoomForUrl:function(){var ct=this._tileZoom,Bt=this.options.maxZoom,me=this.options.zoomReverse,Qe=this.options.zoomOffset;return me&&(ct=Bt-ct),ct+Qe},_getSubdomain:function(ct){var Bt=Math.abs(ct.x+ct.y)%this.options.subdomains.length;return this.options.subdomains[Bt]},_abortLoading:function(){var ct,Bt;for(ct in this._tiles)if(this._tiles[ct].coords.z!==this._tileZoom&&(Bt=this._tiles[ct].el,Bt.onload=Ne,Bt.onerror=Ne,!Bt.complete)){Bt.src=jn;var me=this._tiles[ct].coords;Tf(Bt),delete this._tiles[ct],this.fire("tileabort",{tile:Bt,coords:me})}},_removeTile:function(ct){var Bt=this._tiles[ct];if(Bt)return Bt.el.setAttribute("src",jn),E1.prototype._removeTile.call(this,ct)},_tileReady:function(ct,Bt,me){if(!(!this._map||me&&me.getAttribute("src")===jn))return E1.prototype._tileReady.call(this,ct,Bt,me)}});function $y(ct,Bt){return new o0(ct,Bt)}var Gy=o0.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(ct,Bt){this._url=ct;var me=J({},this.defaultWmsParams);for(var Qe in Bt)Qe in this.options||(me[Qe]=Bt[Qe]);Bt=zr(this,Bt);var Pr=Bt.detectRetina&&El.retina?2:1,Tn=this.getTileSize();me.width=Tn.x*Pr,me.height=Tn.y*Pr,this.wmsParams=me},onAdd:function(ct){this._crs=this.options.crs||ct.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var Bt=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[Bt]=this._crs.code,o0.prototype.onAdd.call(this,ct)},getTileUrl:function(ct){var Bt=this._tileCoordsToNwSe(ct),me=this._crs,Qe=pl(me.project(Bt[0]),me.project(Bt[1])),Pr=Qe.min,Tn=Qe.max,ji=(this._wmsVersion>=1.3&&this._crs===By?[Pr.y,Pr.x,Tn.y,Tn.x]:[Pr.x,Pr.y,Tn.x,Tn.y]).join(","),Na=o0.prototype.getTileUrl.call(this,ct);return Na+Wr(this.wmsParams,Na,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+ji},setParams:function(ct,Bt){return J(this.wmsParams,ct),Bt||this.redraw(),this}});function Sw(ct,Bt){return new Gy(ct,Bt)}o0.WMS=Gy,$y.wms=Sw;var ym=a0.extend({options:{padding:.1},initialize:function(ct){zr(this,ct),Gt(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),Wu(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var ct={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(ct.zoomanim=this._onAnimZoom),ct},_onAnimZoom:function(ct){this._updateTransform(ct.center,ct.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(ct,Bt){var me=this._map.getZoomScale(Bt,this._zoom),Qe=this._map.getSize().multiplyBy(.5+this.options.padding),Pr=this._map.project(this._center,Bt),Tn=Qe.multiplyBy(-me).add(Pr).subtract(this._map._getNewPixelOrigin(ct,Bt));El.any3d?pu(this._container,Tn,me):ic(this._container,Tn)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var ct in this._layers)this._layers[ct]._reset()},_onZoomEnd:function(){for(var ct in this._layers)this._layers[ct]._project()},_updatePaths:function(){for(var ct in this._layers)this._layers[ct]._update()},_update:function(){var ct=this.options.padding,Bt=this._map.getSize(),me=this._map.containerPointToLayerPoint(Bt.multiplyBy(-ct)).round();this._bounds=new ko(me,me.add(Bt.multiplyBy(1+ct*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Ew=ym.extend({options:{tolerance:0},getEvents:function(){var ct=ym.prototype.getEvents.call(this);return ct.viewprereset=this._onViewPreReset,ct},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){ym.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var ct=this._container=document.createElement("canvas");Pu(ct,"mousemove",this._onMouseMove,this),Pu(ct,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Pu(ct,"mouseout",this._handleMouseOut,this),ct._leaflet_disable_events=!0,this._ctx=ct.getContext("2d")},_destroyContainer:function(){Li(this._redrawRequest),delete this._ctx,Tf(this._container),Bh(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var ct;this._redrawBounds=null;for(var Bt in this._layers)ct=this._layers[Bt],ct._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){ym.prototype._update.call(this);var ct=this._bounds,Bt=this._container,me=ct.getSize(),Qe=El.retina?2:1;ic(Bt,ct.min),Bt.width=Qe*me.x,Bt.height=Qe*me.y,Bt.style.width=me.x+"px",Bt.style.height=me.y+"px",El.retina&&this._ctx.scale(2,2),this._ctx.translate(-ct.min.x,-ct.min.y),this.fire("update")}},_reset:function(){ym.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(ct){this._updateDashArray(ct),this._layers[Gt(ct)]=ct;var Bt=ct._order={layer:ct,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=Bt),this._drawLast=Bt,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(ct){this._requestRedraw(ct)},_removePath:function(ct){var Bt=ct._order,me=Bt.next,Qe=Bt.prev;me?me.prev=Qe:this._drawLast=Qe,Qe?Qe.next=me:this._drawFirst=me,delete ct._order,delete this._layers[Gt(ct)],this._requestRedraw(ct)},_updatePath:function(ct){this._extendRedrawBounds(ct),ct._project(),ct._update(),this._requestRedraw(ct)},_updateStyle:function(ct){this._updateDashArray(ct),this._requestRedraw(ct)},_updateDashArray:function(ct){if(typeof ct.options.dashArray=="string"){var Bt=ct.options.dashArray.split(/[, ]+/),me=[],Qe,Pr;for(Pr=0;Pr')}}catch{}return function(ct){return document.createElement("<"+ct+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),_6={_initContainer:function(){this._container=Cc("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(ym.prototype._update.call(this),this.fire("update"))},_initPath:function(ct){var Bt=ct._container=C1("shape");Wu(Bt,"leaflet-vml-shape "+(this.options.className||"")),Bt.coordsize="1 1",ct._path=C1("path"),Bt.appendChild(ct._path),this._updateStyle(ct),this._layers[Gt(ct)]=ct},_addPath:function(ct){var Bt=ct._container;this._container.appendChild(Bt),ct.options.interactive&&ct.addInteractiveTarget(Bt)},_removePath:function(ct){var Bt=ct._container;Tf(Bt),ct.removeInteractiveTarget(Bt),delete this._layers[Gt(ct)]},_updateStyle:function(ct){var Bt=ct._stroke,me=ct._fill,Qe=ct.options,Pr=ct._container;Pr.stroked=!!Qe.stroke,Pr.filled=!!Qe.fill,Qe.stroke?(Bt||(Bt=ct._stroke=C1("stroke")),Pr.appendChild(Bt),Bt.weight=Qe.weight+"px",Bt.color=Qe.color,Bt.opacity=Qe.opacity,Qe.dashArray?Bt.dashStyle=kn(Qe.dashArray)?Qe.dashArray.join(" "):Qe.dashArray.replace(/( *, *)/g," "):Bt.dashStyle="",Bt.endcap=Qe.lineCap.replace("butt","flat"),Bt.joinstyle=Qe.lineJoin):Bt&&(Pr.removeChild(Bt),ct._stroke=null),Qe.fill?(me||(me=ct._fill=C1("fill")),Pr.appendChild(me),me.color=Qe.fillColor||Qe.color,me.opacity=Qe.fillOpacity):me&&(Pr.removeChild(me),ct._fill=null)},_updateCircle:function(ct){var Bt=ct._point.round(),me=Math.round(ct._radius),Qe=Math.round(ct._radiusY||me);this._setPath(ct,ct._empty()?"M0 0":"AL "+Bt.x+","+Bt.y+" "+me+","+Qe+" 0,"+65535*360)},_setPath:function(ct,Bt){ct._path.v=Bt},_bringToFront:function(ct){hv(ct._container)},_bringToBack:function(ct){bn(ct._container)}},Nm=El.vml?C1:co,Fp=ym.extend({_initContainer:function(){this._container=Nm("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Nm("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){Tf(this._container),Bh(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){ym.prototype._update.call(this);var ct=this._bounds,Bt=ct.getSize(),me=this._container;(!this._svgSize||!this._svgSize.equals(Bt))&&(this._svgSize=Bt,me.setAttribute("width",Bt.x),me.setAttribute("height",Bt.y)),ic(me,ct.min),me.setAttribute("viewBox",[ct.min.x,ct.min.y,Bt.x,Bt.y].join(" ")),this.fire("update")}},_initPath:function(ct){var Bt=ct._path=Nm("path");ct.options.className&&Wu(Bt,ct.options.className),ct.options.interactive&&Wu(Bt,"leaflet-interactive"),this._updateStyle(ct),this._layers[Gt(ct)]=ct},_addPath:function(ct){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(ct._path),ct.addInteractiveTarget(ct._path)},_removePath:function(ct){Tf(ct._path),ct.removeInteractiveTarget(ct._path),delete this._layers[Gt(ct)]},_updatePath:function(ct){ct._project(),ct._update()},_updateStyle:function(ct){var Bt=ct._path,me=ct.options;Bt&&(me.stroke?(Bt.setAttribute("stroke",me.color),Bt.setAttribute("stroke-opacity",me.opacity),Bt.setAttribute("stroke-width",me.weight),Bt.setAttribute("stroke-linecap",me.lineCap),Bt.setAttribute("stroke-linejoin",me.lineJoin),me.dashArray?Bt.setAttribute("stroke-dasharray",me.dashArray):Bt.removeAttribute("stroke-dasharray"),me.dashOffset?Bt.setAttribute("stroke-dashoffset",me.dashOffset):Bt.removeAttribute("stroke-dashoffset")):Bt.setAttribute("stroke","none"),me.fill?(Bt.setAttribute("fill",me.fillColor||me.color),Bt.setAttribute("fill-opacity",me.fillOpacity),Bt.setAttribute("fill-rule",me.fillRule||"evenodd")):Bt.setAttribute("fill","none"))},_updatePoly:function(ct,Bt){this._setPath(ct,vo(ct._parts,Bt))},_updateCircle:function(ct){var Bt=ct._point,me=Math.max(Math.round(ct._radius),1),Qe=Math.max(Math.round(ct._radiusY),1)||me,Pr="a"+me+","+Qe+" 0 1,0 ",Tn=ct._empty()?"M0 0":"M"+(Bt.x-me)+","+Bt.y+Pr+me*2+",0 "+Pr+-me*2+",0 ";this._setPath(ct,Tn)},_setPath:function(ct,Bt){ct._path.setAttribute("d",Bt)},_bringToFront:function(ct){hv(ct._path)},_bringToBack:function(ct){bn(ct._path)}});El.vml&&Fp.include(_6);function Cw(ct){return El.svg||El.vml?new Fp(ct):null}Mc.include({getRenderer:function(ct){var Bt=ct.options.renderer||this._getPaneRenderer(ct.options.pane)||this.options.renderer||this._renderer;return Bt||(Bt=this._renderer=this._createRenderer()),this.hasLayer(Bt)||this.addLayer(Bt),Bt},_getPaneRenderer:function(ct){if(ct==="overlayPane"||ct===void 0)return!1;var Bt=this._paneRenderers[ct];return Bt===void 0&&(Bt=this._createRenderer({pane:ct}),this._paneRenderers[ct]=Bt),Bt},_createRenderer:function(ct){return this.options.preferCanvas&&q_(ct)||Cw(ct)}});var s0=yv.extend({initialize:function(ct,Bt){yv.prototype.initialize.call(this,this._boundsToLatLngs(ct),Bt)},setBounds:function(ct){return this.setLatLngs(this._boundsToLatLngs(ct))},_boundsToLatLngs:function(ct){return ct=qo(ct),[ct.getSouthWest(),ct.getNorthWest(),ct.getNorthEast(),ct.getSouthEast()]}});function I0(ct,Bt){return new s0(ct,Bt)}Fp.create=Nm,Fp.pointsToPath=vo,pm.geometryToLayer=Vy,pm.coordsToLatLng=N_,pm.coordsToLatLngs=Hy,pm.latLngToCoords=j_,pm.latLngsToCoords=Wy,pm.getFeature=mm,pm.asFeature=qy,Mc.mergeOptions({boxZoom:!0});var xv=K0.extend({initialize:function(ct){this._map=ct,this._container=ct._container,this._pane=ct._panes.overlayPane,this._resetStateTimeout=0,ct.on("unload",this._destroy,this)},addHooks:function(){Pu(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Bh(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){Tf(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(ct){if(!ct.shiftKey||ct.which!==1&&ct.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),C0(),Kc(),this._startPoint=this._map.mouseEventToContainerPoint(ct),Pu(document,{contextmenu:vg,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(ct){this._moved||(this._moved=!0,this._box=Cc("div","leaflet-zoom-box",this._container),Wu(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(ct);var Bt=new ko(this._point,this._startPoint),me=Bt.getSize();ic(this._box,Bt.min),this._box.style.width=me.x+"px",this._box.style.height=me.y+"px"},_finish:function(){this._moved&&(Tf(this._box),Rf(this._container,"leaflet-crosshair")),pg(),Op(),Bh(document,{contextmenu:vg,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(ct){if(!(ct.which!==1&&ct.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(kt(this._resetState,this),0);var Bt=new fu(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(Bt).fire("boxzoomend",{boxZoomBounds:Bt})}},_onKeyDown:function(ct){ct.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});Mc.addInitHook("addHandler","boxZoom",xv),Mc.mergeOptions({doubleClickZoom:!0});var x0=K0.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(ct){var Bt=this._map,me=Bt.getZoom(),Qe=Bt.options.zoomDelta,Pr=ct.originalEvent.shiftKey?me-Qe:me+Qe;Bt.options.doubleClickZoom==="center"?Bt.setZoom(Pr):Bt.setZoomAround(ct.containerPoint,Pr)}});Mc.addInitHook("addHandler","doubleClickZoom",x0),Mc.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var O0=K0.extend({addHooks:function(){if(!this._draggable){var ct=this._map;this._draggable=new Fm(ct._mapPane,ct._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),ct.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),ct.on("zoomend",this._onZoomEnd,this),ct.whenReady(this._onZoomEnd,this))}Wu(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){Rf(this._map._container,"leaflet-grab"),Rf(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var ct=this._map;if(ct._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var Bt=qo(this._map.options.maxBounds);this._offsetLimit=pl(this._map.latLngToContainerPoint(Bt.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(Bt.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;ct.fire("movestart").fire("dragstart"),ct.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(ct){if(this._map.options.inertia){var Bt=this._lastTime=+new Date,me=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(me),this._times.push(Bt),this._prunePositions(Bt)}this._map.fire("move",ct).fire("drag",ct)},_prunePositions:function(ct){for(;this._positions.length>1&&ct-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var ct=this._map.getSize().divideBy(2),Bt=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=Bt.subtract(ct).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(ct,Bt){return ct-(ct-Bt)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var ct=this._draggable._newPos.subtract(this._draggable._startPos),Bt=this._offsetLimit;ct.xBt.max.x&&(ct.x=this._viscousLimit(ct.x,Bt.max.x)),ct.y>Bt.max.y&&(ct.y=this._viscousLimit(ct.y,Bt.max.y)),this._draggable._newPos=this._draggable._startPos.add(ct)}},_onPreDragWrap:function(){var ct=this._worldWidth,Bt=Math.round(ct/2),me=this._initialWorldOffset,Qe=this._draggable._newPos.x,Pr=(Qe-Bt+me)%ct+Bt-me,Tn=(Qe+Bt+me)%ct-Bt-me,ji=Math.abs(Pr+me)0?Tn:-Tn))-Bt;this._delta=0,this._startTime=null,ji&&(ct.options.scrollWheelZoom==="center"?ct.setZoom(Bt+ji):ct.setZoomAround(this._lastMousePos,Bt+ji))}});Mc.addInitHook("addHandler","scrollWheelZoom",Mg);var Pw=600;Mc.mergeOptions({tapHold:El.touchNative&&El.safari&&El.mobile,tapTolerance:15});var zw=K0.extend({addHooks:function(){Pu(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Bh(this._map._container,"touchstart",this._onDown,this)},_onDown:function(ct){if(clearTimeout(this._holdTimeout),ct.touches.length===1){var Bt=ct.touches[0];this._startPos=this._newPos=new Va(Bt.clientX,Bt.clientY),this._holdTimeout=setTimeout(kt(function(){this._cancel(),this._isTapValid()&&(Pu(document,"touchend",mc),Pu(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",Bt))},this),Pw),Pu(document,"touchend touchcancel contextmenu",this._cancel,this),Pu(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function ct(){Bh(document,"touchend",mc),Bh(document,"touchend touchcancel",ct)},_cancel:function(){clearTimeout(this._holdTimeout),Bh(document,"touchend touchcancel contextmenu",this._cancel,this),Bh(document,"touchmove",this._onMove,this)},_onMove:function(ct){var Bt=ct.touches[0];this._newPos=new Va(Bt.clientX,Bt.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(ct,Bt){var me=new MouseEvent(ct,{bubbles:!0,cancelable:!0,view:window,screenX:Bt.screenX,screenY:Bt.screenY,clientX:Bt.clientX,clientY:Bt.clientY});me._simulated=!0,Bt.target.dispatchEvent(me)}});Mc.addInitHook("addHandler","tapHold",zw),Mc.mergeOptions({touchZoom:El.touch,bounceAtZoomLimits:!0});var D0=K0.extend({addHooks:function(){Wu(this._map._container,"leaflet-touch-zoom"),Pu(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){Rf(this._map._container,"leaflet-touch-zoom"),Bh(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(ct){var Bt=this._map;if(!(!ct.touches||ct.touches.length!==2||Bt._animatingZoom||this._zooming)){var me=Bt.mouseEventToContainerPoint(ct.touches[0]),Qe=Bt.mouseEventToContainerPoint(ct.touches[1]);this._centerPoint=Bt.getSize()._divideBy(2),this._startLatLng=Bt.containerPointToLatLng(this._centerPoint),Bt.options.touchZoom!=="center"&&(this._pinchStartLatLng=Bt.containerPointToLatLng(me.add(Qe)._divideBy(2))),this._startDist=me.distanceTo(Qe),this._startZoom=Bt.getZoom(),this._moved=!1,this._zooming=!0,Bt._stop(),Pu(document,"touchmove",this._onTouchMove,this),Pu(document,"touchend touchcancel",this._onTouchEnd,this),mc(ct)}},_onTouchMove:function(ct){if(!(!ct.touches||ct.touches.length!==2||!this._zooming)){var Bt=this._map,me=Bt.mouseEventToContainerPoint(ct.touches[0]),Qe=Bt.mouseEventToContainerPoint(ct.touches[1]),Pr=me.distanceTo(Qe)/this._startDist;if(this._zoom=Bt.getScaleZoom(Pr,this._startZoom),!Bt.options.bounceAtZoomLimits&&(this._zoomBt.getMaxZoom()&&Pr>1)&&(this._zoom=Bt._limitZoom(this._zoom)),Bt.options.touchZoom==="center"){if(this._center=this._startLatLng,Pr===1)return}else{var Tn=me._add(Qe)._divideBy(2)._subtract(this._centerPoint);if(Pr===1&&Tn.x===0&&Tn.y===0)return;this._center=Bt.unproject(Bt.project(this._pinchStartLatLng,this._zoom).subtract(Tn),this._zoom)}this._moved||(Bt._moveStart(!0,!1),this._moved=!0),Li(this._animRequest);var ji=kt(Bt._move,Bt,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=fa(ji,this,!0),mc(ct)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,Li(this._animRequest),Bh(document,"touchmove",this._onTouchMove,this),Bh(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});Mc.addInitHook("addHandler","touchZoom",D0),Mc.BoxZoom=xv,Mc.DoubleClickZoom=x0,Mc.Drag=O0,Mc.Keyboard=Lw,Mc.ScrollWheelZoom=Mg,Mc.TapHold=zw,Mc.TouchZoom=D0,z.Bounds=ko,z.Browser=El,z.CRS=Ea,z.Canvas=Ew,z.Circle=Uy,z.CircleMarker=jy,z.Class=ra,z.Control=lp,z.DivIcon=Mw,z.DivOverlay=X0,z.DomEvent=Dp,z.DomUtil=Tc,z.Draggable=Fm,z.Evented=Ei,z.FeatureGroup=bp,z.GeoJSON=pm,z.GridLayer=E1,z.Handler=K0,z.Icon=Rm,z.ImageOverlay=gm,z.LatLng=fo,z.LatLngBounds=fu,z.Layer=a0,z.LayerGroup=Tg,z.LineUtil=Qh,z.Map=Mc,z.Marker=M1,z.Mixin=up,z.Path=Bm,z.Point=Va,z.PolyUtil=d6,z.Polygon=yv,z.Polyline=y0,z.Popup=Ag,z.PosAnimation=A1,z.Projection=D_,z.Rectangle=s0,z.Renderer=ym,z.SVG=Fp,z.SVGOverlay=H_,z.TileLayer=o0,z.Tooltip=S1,z.Transformation=$o,z.Util=yi,z.VideoOverlay=z0,z.bind=kt,z.bounds=pl,z.canvas=q_,z.circle=vv,z.circleMarker=ww,z.control=i0,z.divIcon=x6,z.extend=J,z.featureGroup=bw,z.geoJSON=V_,z.geoJson=Zy,z.gridLayer=W_,z.icon=R_,z.imageOverlay=vm,z.latLng=Ta,z.latLngBounds=qo,z.layerGroup=Ny,z.map=js,z.marker=g6,z.point=mo,z.polygon=v6,z.polyline=kw,z.popup=vf,z.rectangle=I0,z.setOptions=zr,z.stamp=Gt,z.svg=Cw,z.svgOverlay=y6,z.tileLayer=$y,z.tooltip=Aw,z.transformation=gi,z.version=j,z.videoOverlay=tf;var F0=window.L;z.noConflict=function(){return window.L=F0,this},window.L=z})}(c2,c2.exports)),c2.exports}var Iat=zat();const Zg=LO(Iat),Oat={class:"space-y-6"},Dat={key:0,class:"flex items-center justify-center py-12"},Fat={key:1,class:"bg-accent-red/10 border border-accent-red/20 rounded-[15px] p-6"},Rat={class:"flex items-center gap-3"},Bat={class:"text-accent-red/80 text-sm"},Nat={key:0,class:"bg-dark-card/30 backdrop-blur border border-white/10 rounded-[15px] p-6"},jat={class:"flex items-center justify-between p-6 pb-4"},Uat={class:"text-white text-lg font-semibold"},Vat={class:"text-sm text-dark-text ml-2"},Hat={class:"overflow-x-auto"},Wat={class:"w-full"},qat={class:"bg-dark-bg/30"},Zat=["onMouseenter","onMouseleave"],$at={class:"py-4 px-6 text-white text-sm"},Gat={class:"py-4 px-6 text-white text-sm font-mono"},Yat={class:"py-4 px-6 text-white text-sm"},Kat={key:0},Xat={key:1,class:"text-dark-text"},Jat={class:"py-4 px-6 text-white text-sm"},Qat={class:"py-4 px-6 text-white text-sm"},tot={class:"py-4 px-6 text-white text-sm"},eot={class:"py-4 px-6 text-white text-sm"},rot={class:"py-4 px-6 text-white text-sm"},not={class:"py-4 px-6 text-white text-sm"},iot={class:"py-4 px-6 text-white text-sm text-center"},aot={key:1,class:"text-center py-12"},oot=Th({name:"NeighborsView",__name:"Neighbors",setup(d){const l={0:"Unknown",1:"Chat Node",2:"Repeater",3:"Room Server",4:"Hybrid Node"},z={0:"text-gray-400",1:"text-blue-400",2:"text-accent-green",3:"text-accent-purple",4:"text-secondary"},j=lo({}),J=lo(!0),mt=lo(null),kt=lo();let Dt=null;const Gt=lo(new Map),re=Yo(()=>Object.entries(l).filter(([un])=>j.value[un]?.length>0).sort(([un],[ia])=>parseInt(un)-parseInt(ia))),pe=Yo(()=>Object.values(j.value).flat().filter(un=>un.latitude!==null&&un.longitude!==null)),Ne=un=>new Date(un*1e3).toLocaleString(),or=un=>un.length<=16?un:`${un.slice(0,8)}...${un.slice(-8)}`,_r=un=>un!==null?`${un} dBm`:"N/A",Fr=un=>un!==null?`${un.toFixed(1)} dB`:"N/A",zr=un=>un===null?"Unknown":{0:"Unknown",1:"Flood",2:"Direct"}[un]||`Type ${un}`,Wr=(un,ia,fa,Li)=>{const ra=(fa-un)*Math.PI/180,Da=(Li-ia)*Math.PI/180,Ni=Math.sin(ra/2)*Math.sin(ra/2)+Math.cos(un*Math.PI/180)*Math.cos(fa*Math.PI/180)*Math.sin(Da/2)*Math.sin(Da/2);return 6371*(2*Math.atan2(Math.sqrt(Ni),Math.sqrt(1-Ni)))},An=un=>un.latitude!==null&&un.longitude!==null?`${Wr(50.6185,-1.7339,un.latitude,un.longitude).toFixed(2)} km`:"Unknown",Ft=un=>{const ia={0:"#9CA3AF",1:"#60A5FA",2:"#A5E5B6",3:"#EBA0FC",4:"#FFC246"};return ia[un]||ia[0]},kn=async un=>{try{const ia=await Xh.get(`/adverts_by_contact_type?contact_type=${encodeURIComponent(un)}&hours=168`);return ia.success&&Array.isArray(ia.data)?ia.data:[]}catch(ia){return console.error(`Error fetching adverts for contact type ${un}:`,ia),[]}},ei=async()=>{J.value=!0,mt.value=null;try{j.value={};for(const[un,ia]of Object.entries(l)){const fa=await kn(ia);fa.length>0&&(j.value[un]=fa)}}catch(un){console.error("Error loading adverts:",un),mt.value=un instanceof Error?un.message:"Unknown error occurred"}finally{J.value=!1}},jn=async()=>{if(ai(),await Z0(),!kt.value){setTimeout(()=>{kt.value&&jn()},500);return}setTimeout(()=>{if(!kt.value)return;if(kt.value.offsetWidth===0||kt.value.offsetHeight===0){setTimeout(()=>jn(),500);return}const un=50.6185,ia=-1.7339;let fa=null;if(pe.value.length>0){const Li=[un,...pe.value.map(Va=>Va.latitude)],yi=[ia,...pe.value.map(Va=>Va.longitude)],ra=Math.min(...Li),Da=Math.max(...Li),Ni=Math.min(...yi),Ei=Math.max(...yi);fa=[[ra,Ni],[Da,Ei]]}try{fa?Dt=Zg.map(kt.value,{zoomControl:!0,attributionControl:!0,preferCanvas:!1}).fitBounds(fa,{padding:[50,50]}):Dt=Zg.map(kt.value,{center:[un,ia],zoom:12,zoomControl:!0,attributionControl:!0,preferCanvas:!1});const Li=Zg.tileLayer("https://{s}.basemaps.cartocdn.com/dark_nolabels/{z}/{x}/{y}{r}.png",{attribution:'© OpenStreetMap contributors © CARTO',maxZoom:18,minZoom:1,crossOrigin:!0}),yi=Zg.tileLayer("https://{s}.basemaps.cartocdn.com/dark_only_labels/{z}/{x}/{y}{r}.png",{maxZoom:18,minZoom:1,crossOrigin:!0});Li.addTo(Dt),yi.addTo(Dt);let ra=!1,Da=!1;const Ni=()=>{ra&&Da&&setTimeout(()=>{ss()},1e3)};Li.on("load",()=>{ra=!0,Dt&&Dt.invalidateSize(),Ni()}),yi.on("load",()=>{Da=!0,Ni()});const Ei=(mo,ko=!1)=>{const pl=ko?12:8;return Zg.divIcon({className:"custom-div-icon",html:`
`,iconSize:[pl+4,pl+4],iconAnchor:[pl/2+2,pl/2+2]})},Va=Ei("#AAE8E8",!0);Zg.marker([un,ia],{icon:Va}).addTo(Dt).bindPopup(`
This Node
Base Station
@@ -68,29 +68,29 @@ Route: ${zr(Ta.route_type)}
Signal: ${_r(Ta.rssi)} / ${Fr(Ta.snr)}
- `),ko.push(Oo),fu++,fu===qo&&fo())};Fc()},pl)})(),pl+=300}})};setTimeout(()=>{Dt&&Dt.invalidateSize()},2e3)}catch(Li){console.error("Error initializing map:",Li)}},200)},ai=()=>{Dt&&(Dt.remove(),Dt=null),Gt.value.clear()},Qi=un=>{const ia=Gt.value.get(un);if(ia){const fa=ia.getElement();fa&&fa.classList.add("marker-highlight")}},Gi=un=>{const ia=Gt.value.get(un);if(ia){const fa=ia.getElement();fa&&fa.classList.remove("marker-highlight")}};return t0(async()=>{await ei()}),K2(()=>{ai()}),um(pe,async un=>{un.length>0&&!J.value&&(await Z0(),setTimeout(async()=>{await jn()},300))},{immediate:!1}),um(J,async un=>{!un&&pe.value.length>0&&(await Z0(),setTimeout(async()=>{await jn()},300))}),(un,ia)=>(zi(),Vi("div",zat,[J.value?(zi(),Vi("div",Iat,ia[0]||(ia[0]=[Re("div",{class:"text-center"},[Re("div",{class:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto mb-4"}),Re("p",{class:"text-dark-text"},"Loading neighbor data...")],-1)]))):mt.value?(zi(),Vi("div",Oat,[Re("div",Dat,[ia[2]||(ia[2]=Re("svg",{class:"w-5 h-5 text-accent-red",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"})],-1)),Re("div",null,[ia[1]||(ia[1]=Re("h3",{class:"text-accent-red font-medium"},"Error Loading Neighbors",-1)),Re("p",Fat,aa(mt.value),1)])])])):(zi(),Vi(Ou,{key:2},[pe.value.length>0?(zi(),Vi("div",Rat,[Re("div",{class:"flex items-center justify-between mb-4"},[ia[3]||(ia[3]=Re("h2",{class:"text-white text-lg font-semibold"},"Network Map",-1)),Re("button",{onClick:jn,class:"px-3 py-1 text-xs bg-primary/20 text-primary border border-primary/30 rounded-lg hover:bg-primary/30 transition-colors"}," Reload Map ")]),Re("div",{ref_key:"mapContainer",ref:kt,class:"w-full h-96 bg-gray-900 rounded-lg border border-gray-700/50 overflow-hidden leaflet-container shadow-xl",style:{"min-height":"384px",position:"relative",outline:"none","box-shadow":"inset 0 0 20px rgba(0,0,0,0.5)"}},null,512),ia[4]||(ia[4]=Ff('

Node Types

This Node
Repeater
Chat Node
Room Server
Hybrid Node

Connection Types

Direct Routing
Flood Routing
',1))])):bs("",!0),(zi(!0),Vi(Ou,null,sf(re.value,([fa,Li])=>(zi(),Vi("div",{key:fa,class:"bg-dark-card/30 backdrop-blur border border-white/10 rounded-[15px] overflow-hidden"},[Re("div",Bat,[Re("h2",Nat,[nc(aa(Li)+" ",1),Re("span",jat,"("+aa(j.value[fa]?.length||0)+")",1)]),Re("div",{class:Xs(["flex items-center gap-2 text-sm",z[parseInt(fa)]])},[Re("div",{class:"w-2 h-2 rounded-full",style:av(`background-color: ${Ft(parseInt(fa))}`)},null,4),nc(" "+aa(Li),1)],2)]),Re("div",Uat,[Re("table",Vat,[ia[5]||(ia[5]=Re("thead",null,[Re("tr",{class:"bg-dark-bg/50"},[Re("th",{class:"text-left text-dark-text text-xs font-medium py-3 px-6 border-b border-white/5"},"Node Name"),Re("th",{class:"text-left text-dark-text text-xs font-medium py-3 px-6 border-b border-white/5"},"Public Key"),Re("th",{class:"text-left text-dark-text text-xs font-medium py-3 px-6 border-b border-white/5"},"Location"),Re("th",{class:"text-left text-dark-text text-xs font-medium py-3 px-6 border-b border-white/5"},"Distance"),Re("th",{class:"text-left text-dark-text text-xs font-medium py-3 px-6 border-b border-white/5"},"Route Type"),Re("th",{class:"text-left text-dark-text text-xs font-medium py-3 px-6 border-b border-white/5"},"RSSI"),Re("th",{class:"text-left text-dark-text text-xs font-medium py-3 px-6 border-b border-white/5"},"SNR"),Re("th",{class:"text-left text-dark-text text-xs font-medium py-3 px-6 border-b border-white/5"},"Last Seen"),Re("th",{class:"text-left text-dark-text text-xs font-medium py-3 px-6 border-b border-white/5"},"First Seen"),Re("th",{class:"text-left text-dark-text text-xs font-medium py-3 px-6 border-b border-white/5"},"Advert Count")])],-1)),Re("tbody",Hat,[(zi(!0),Vi(Ou,null,sf(j.value[fa],yi=>(zi(),Vi("tr",{key:yi.id,class:"hover:bg-white/5 transition-colors",onMouseenter:ra=>Qi(yi.pubkey),onMouseleave:ra=>Gi(yi.pubkey)},[Re("td",qat,aa(yi.node_name||"Unknown"),1),Re("td",Zat,aa(or(yi.pubkey)),1),Re("td",$at,[yi.latitude!==null&&yi.longitude!==null?(zi(),Vi("span",Gat,aa(yi.latitude.toFixed(6))+", "+aa(yi.longitude.toFixed(6)),1)):(zi(),Vi("span",Yat,"Unknown"))]),Re("td",Kat,aa(An(yi)),1),Re("td",Xat,[Re("span",{class:Xs(yi.route_type===2?"text-accent-green":yi.route_type===1?"text-secondary":"text-gray-400")},aa(zr(yi.route_type)),3)]),Re("td",Jat,aa(_r(yi.rssi)),1),Re("td",Qat,aa(Fr(yi.snr)),1),Re("td",tot,aa(Ne(yi.last_seen)),1),Re("td",eot,aa(Ne(yi.first_seen)),1),Re("td",rot,aa(yi.advert_count),1)],40,Wat))),128))])])])]))),128)),re.value.length===0?(zi(),Vi("div",not,[ia[6]||(ia[6]=Ff('

No Neighbors Found

No mesh neighbors have been discovered in your area yet.

',3)),Re("button",{onClick:ei,class:"mt-4 px-4 py-2 bg-primary/20 text-primary border border-primary/30 rounded-lg hover:bg-primary/30 transition-colors"}," Refresh ")])):bs("",!0)],64))]))}}),aot=ld(iot,[["__scopeId","data-v-eb494437"]]);/*! + `),ko.push(Oo),fu++,fu===qo&&fo())};Fc()},pl)})(),pl+=300}})};setTimeout(()=>{Dt&&Dt.invalidateSize()},2e3)}catch(Li){console.error("Error initializing map:",Li)}},200)},ai=()=>{Dt&&(Dt.remove(),Dt=null),Gt.value.clear()},Qi=un=>{const ia=Gt.value.get(un);if(ia){const fa=ia.getElement();fa&&fa.classList.add("marker-highlight")}},Gi=un=>{const ia=Gt.value.get(un);if(ia){const fa=ia.getElement();fa&&fa.classList.remove("marker-highlight")}};return t0(async()=>{await ei()}),K2(()=>{ai()}),um(pe,async un=>{un.length>0&&!J.value&&(await Z0(),setTimeout(async()=>{await jn()},300))},{immediate:!1}),um(J,async un=>{!un&&pe.value.length>0&&(await Z0(),setTimeout(async()=>{await jn()},300))}),(un,ia)=>(zi(),Vi("div",Oat,[J.value?(zi(),Vi("div",Dat,ia[0]||(ia[0]=[Re("div",{class:"text-center"},[Re("div",{class:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto mb-4"}),Re("p",{class:"text-dark-text"},"Loading neighbor data...")],-1)]))):mt.value?(zi(),Vi("div",Fat,[Re("div",Rat,[ia[2]||(ia[2]=Re("svg",{class:"w-5 h-5 text-accent-red",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"})],-1)),Re("div",null,[ia[1]||(ia[1]=Re("h3",{class:"text-accent-red font-medium"},"Error Loading Neighbors",-1)),Re("p",Bat,aa(mt.value),1)])])])):(zi(),Vi(Ou,{key:2},[pe.value.length>0?(zi(),Vi("div",Nat,[Re("div",{class:"flex items-center justify-between mb-4"},[ia[3]||(ia[3]=Re("h2",{class:"text-white text-lg font-semibold"},"Network Map",-1)),Re("button",{onClick:jn,class:"px-3 py-1 text-xs bg-primary/20 text-primary border border-primary/30 rounded-lg hover:bg-primary/30 transition-colors"}," Reload Map ")]),Re("div",{ref_key:"mapContainer",ref:kt,class:"w-full h-96 bg-gray-900 rounded-lg border border-gray-700/50 overflow-hidden leaflet-container shadow-xl",style:{"min-height":"384px",position:"relative",outline:"none","box-shadow":"inset 0 0 20px rgba(0,0,0,0.5)"}},null,512),ia[4]||(ia[4]=Ff('

Node Types

This Node
Repeater
Chat Node
Room Server
Hybrid Node

Connection Types

Direct Routing
Flood Routing
',1))])):bs("",!0),(zi(!0),Vi(Ou,null,sf(re.value,([fa,Li])=>(zi(),Vi("div",{key:fa,class:"bg-dark-card/30 backdrop-blur border border-white/10 rounded-[15px] overflow-hidden"},[Re("div",jat,[Re("h2",Uat,[nc(aa(Li)+" ",1),Re("span",Vat,"("+aa(j.value[fa]?.length||0)+")",1)]),Re("div",{class:Xs(["flex items-center gap-2 text-sm",z[parseInt(fa)]])},[Re("div",{class:"w-2 h-2 rounded-full",style:av(`background-color: ${Ft(parseInt(fa))}`)},null,4),nc(" "+aa(Li),1)],2)]),Re("div",Hat,[Re("table",Wat,[ia[5]||(ia[5]=Re("thead",null,[Re("tr",{class:"bg-dark-bg/50"},[Re("th",{class:"text-left text-dark-text text-xs font-medium py-3 px-6 border-b border-white/5"},"Node Name"),Re("th",{class:"text-left text-dark-text text-xs font-medium py-3 px-6 border-b border-white/5"},"Public Key"),Re("th",{class:"text-left text-dark-text text-xs font-medium py-3 px-6 border-b border-white/5"},"Location"),Re("th",{class:"text-left text-dark-text text-xs font-medium py-3 px-6 border-b border-white/5"},"Distance"),Re("th",{class:"text-left text-dark-text text-xs font-medium py-3 px-6 border-b border-white/5"},"Route Type"),Re("th",{class:"text-left text-dark-text text-xs font-medium py-3 px-6 border-b border-white/5"},"RSSI"),Re("th",{class:"text-left text-dark-text text-xs font-medium py-3 px-6 border-b border-white/5"},"SNR"),Re("th",{class:"text-left text-dark-text text-xs font-medium py-3 px-6 border-b border-white/5"},"Last Seen"),Re("th",{class:"text-left text-dark-text text-xs font-medium py-3 px-6 border-b border-white/5"},"First Seen"),Re("th",{class:"text-left text-dark-text text-xs font-medium py-3 px-6 border-b border-white/5"},"Advert Count")])],-1)),Re("tbody",qat,[(zi(!0),Vi(Ou,null,sf(j.value[fa],yi=>(zi(),Vi("tr",{key:yi.id,class:"hover:bg-white/5 transition-colors",onMouseenter:ra=>Qi(yi.pubkey),onMouseleave:ra=>Gi(yi.pubkey)},[Re("td",$at,aa(yi.node_name||"Unknown"),1),Re("td",Gat,aa(or(yi.pubkey)),1),Re("td",Yat,[yi.latitude!==null&&yi.longitude!==null?(zi(),Vi("span",Kat,aa(yi.latitude.toFixed(6))+", "+aa(yi.longitude.toFixed(6)),1)):(zi(),Vi("span",Xat,"Unknown"))]),Re("td",Jat,aa(An(yi)),1),Re("td",Qat,[Re("span",{class:Xs(yi.route_type===2?"text-accent-green":yi.route_type===1?"text-secondary":"text-gray-400")},aa(zr(yi.route_type)),3)]),Re("td",tot,aa(_r(yi.rssi)),1),Re("td",eot,aa(Fr(yi.snr)),1),Re("td",rot,aa(Ne(yi.last_seen)),1),Re("td",not,aa(Ne(yi.first_seen)),1),Re("td",iot,aa(yi.advert_count),1)],40,Zat))),128))])])])]))),128)),re.value.length===0?(zi(),Vi("div",aot,[ia[6]||(ia[6]=Ff('

No Neighbors Found

No mesh neighbors have been discovered in your area yet.

',3)),Re("button",{onClick:ei,class:"mt-4 px-4 py-2 bg-primary/20 text-primary border border-primary/30 rounded-lg hover:bg-primary/30 transition-colors"}," Refresh ")])):bs("",!0)],64))]))}}),sot=ld(oot,[["__scopeId","data-v-eb494437"]]);/*! * @kurkle/color v0.3.4 * https://github.com/kurkle/color#readme * (c) 2024 Jukka Kurkela * Released under the MIT License - */function nw(d){return d+.5|0}const u1=(d,l,z)=>Math.max(Math.min(d,z),l);function h2(d){return u1(nw(d*2.55),0,255)}function p1(d){return u1(nw(d*255),0,255)}function Xg(d){return u1(nw(d/2.55)/100,0,1)}function UL(d){return u1(nw(d*100),0,100)}const am={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},mA=[..."0123456789ABCDEF"],oot=d=>mA[d&15],sot=d=>mA[(d&240)>>4]+mA[d&15],S5=d=>(d&240)>>4===(d&15),lot=d=>S5(d.r)&&S5(d.g)&&S5(d.b)&&S5(d.a);function uot(d){var l=d.length,z;return d[0]==="#"&&(l===4||l===5?z={r:255&am[d[1]]*17,g:255&am[d[2]]*17,b:255&am[d[3]]*17,a:l===5?am[d[4]]*17:255}:(l===7||l===9)&&(z={r:am[d[1]]<<4|am[d[2]],g:am[d[3]]<<4|am[d[4]],b:am[d[5]]<<4|am[d[6]],a:l===9?am[d[7]]<<4|am[d[8]]:255})),z}const cot=(d,l)=>d<255?l(d):"";function hot(d){var l=lot(d)?oot:sot;return d?"#"+l(d.r)+l(d.g)+l(d.b)+cot(d.a,l):void 0}const fot=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function PO(d,l,z){const j=l*Math.min(z,1-z),J=(mt,kt=(mt+d/30)%12)=>z-j*Math.max(Math.min(kt-3,9-kt,1),-1);return[J(0),J(8),J(4)]}function dot(d,l,z){const j=(J,mt=(J+d/60)%6)=>z-z*l*Math.max(Math.min(mt,4-mt,1),0);return[j(5),j(3),j(1)]}function pot(d,l,z){const j=PO(d,1,.5);let J;for(l+z>1&&(J=1/(l+z),l*=J,z*=J),J=0;J<3;J++)j[J]*=1-l-z,j[J]+=l;return j}function mot(d,l,z,j,J){return d===J?(l-z)/j+(l.5?pe/(2-mt-kt):pe/(mt+kt),Gt=mot(z,j,J,pe,mt),Gt=Gt*60+.5),[Gt|0,re||0,Dt]}function rM(d,l,z,j){return(Array.isArray(l)?d(l[0],l[1],l[2]):d(l,z,j)).map(p1)}function nM(d,l,z){return rM(PO,d,l,z)}function got(d,l,z){return rM(pot,d,l,z)}function vot(d,l,z){return rM(dot,d,l,z)}function zO(d){return(d%360+360)%360}function yot(d){const l=fot.exec(d);let z=255,j;if(!l)return;l[5]!==j&&(z=l[6]?h2(+l[5]):p1(+l[5]));const J=zO(+l[2]),mt=+l[3]/100,kt=+l[4]/100;return l[1]==="hwb"?j=got(J,mt,kt):l[1]==="hsv"?j=vot(J,mt,kt):j=nM(J,mt,kt),{r:j[0],g:j[1],b:j[2],a:z}}function xot(d,l){var z=eM(d);z[0]=zO(z[0]+l),z=nM(z),d.r=z[0],d.g=z[1],d.b=z[2]}function _ot(d){if(!d)return;const l=eM(d),z=l[0],j=UL(l[1]),J=UL(l[2]);return d.a<255?`hsla(${z}, ${j}%, ${J}%, ${Xg(d.a)})`:`hsl(${z}, ${j}%, ${J}%)`}const VL={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},HL={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function bot(){const d={},l=Object.keys(HL),z=Object.keys(VL);let j,J,mt,kt,Dt;for(j=0;j>16&255,mt>>8&255,mt&255]}return d}let E5;function wot(d){E5||(E5=bot(),E5.transparent=[0,0,0,0]);const l=E5[d.toLowerCase()];return l&&{r:l[0],g:l[1],b:l[2],a:l.length===4?l[3]:255}}const kot=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Tot(d){const l=kot.exec(d);let z=255,j,J,mt;if(l){if(l[7]!==j){const kt=+l[7];z=l[8]?h2(kt):u1(kt*255,0,255)}return j=+l[1],J=+l[3],mt=+l[5],j=255&(l[2]?h2(j):u1(j,0,255)),J=255&(l[4]?h2(J):u1(J,0,255)),mt=255&(l[6]?h2(mt):u1(mt,0,255)),{r:j,g:J,b:mt,a:z}}}function Aot(d){return d&&(d.a<255?`rgba(${d.r}, ${d.g}, ${d.b}, ${Xg(d.a)})`:`rgb(${d.r}, ${d.g}, ${d.b})`)}const L8=d=>d<=.0031308?d*12.92:Math.pow(d,1/2.4)*1.055-.055,Xx=d=>d<=.04045?d/12.92:Math.pow((d+.055)/1.055,2.4);function Mot(d,l,z){const j=Xx(Xg(d.r)),J=Xx(Xg(d.g)),mt=Xx(Xg(d.b));return{r:p1(L8(j+z*(Xx(Xg(l.r))-j))),g:p1(L8(J+z*(Xx(Xg(l.g))-J))),b:p1(L8(mt+z*(Xx(Xg(l.b))-mt))),a:d.a+z*(l.a-d.a)}}function C5(d,l,z){if(d){let j=eM(d);j[l]=Math.max(0,Math.min(j[l]+j[l]*z,l===0?360:1)),j=nM(j),d.r=j[0],d.g=j[1],d.b=j[2]}}function IO(d,l){return d&&Object.assign(l||{},d)}function WL(d){var l={r:0,g:0,b:0,a:255};return Array.isArray(d)?d.length>=3&&(l={r:d[0],g:d[1],b:d[2],a:255},d.length>3&&(l.a=p1(d[3]))):(l=IO(d,{r:0,g:0,b:0,a:1}),l.a=p1(l.a)),l}function Sot(d){return d.charAt(0)==="r"?Tot(d):yot(d)}class N2{constructor(l){if(l instanceof N2)return l;const z=typeof l;let j;z==="object"?j=WL(l):z==="string"&&(j=uot(l)||wot(l)||Sot(l)),this._rgb=j,this._valid=!!j}get valid(){return this._valid}get rgb(){var l=IO(this._rgb);return l&&(l.a=Xg(l.a)),l}set rgb(l){this._rgb=WL(l)}rgbString(){return this._valid?Aot(this._rgb):void 0}hexString(){return this._valid?hot(this._rgb):void 0}hslString(){return this._valid?_ot(this._rgb):void 0}mix(l,z){if(l){const j=this.rgb,J=l.rgb;let mt;const kt=z===mt?.5:z,Dt=2*kt-1,Gt=j.a-J.a,re=((Dt*Gt===-1?Dt:(Dt+Gt)/(1+Dt*Gt))+1)/2;mt=1-re,j.r=255&re*j.r+mt*J.r+.5,j.g=255&re*j.g+mt*J.g+.5,j.b=255&re*j.b+mt*J.b+.5,j.a=kt*j.a+(1-kt)*J.a,this.rgb=j}return this}interpolate(l,z){return l&&(this._rgb=Mot(this._rgb,l._rgb,z)),this}clone(){return new N2(this.rgb)}alpha(l){return this._rgb.a=p1(l),this}clearer(l){const z=this._rgb;return z.a*=1-l,this}greyscale(){const l=this._rgb,z=nw(l.r*.3+l.g*.59+l.b*.11);return l.r=l.g=l.b=z,this}opaquer(l){const z=this._rgb;return z.a*=1+l,this}negate(){const l=this._rgb;return l.r=255-l.r,l.g=255-l.g,l.b=255-l.b,this}lighten(l){return C5(this._rgb,2,l),this}darken(l){return C5(this._rgb,2,-l),this}saturate(l){return C5(this._rgb,1,l),this}desaturate(l){return C5(this._rgb,1,-l),this}rotate(l){return xot(this._rgb,l),this}}/*! + */function nw(d){return d+.5|0}const u1=(d,l,z)=>Math.max(Math.min(d,z),l);function h2(d){return u1(nw(d*2.55),0,255)}function p1(d){return u1(nw(d*255),0,255)}function Xg(d){return u1(nw(d/2.55)/100,0,1)}function UL(d){return u1(nw(d*100),0,100)}const am={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},mA=[..."0123456789ABCDEF"],lot=d=>mA[d&15],uot=d=>mA[(d&240)>>4]+mA[d&15],S5=d=>(d&240)>>4===(d&15),cot=d=>S5(d.r)&&S5(d.g)&&S5(d.b)&&S5(d.a);function hot(d){var l=d.length,z;return d[0]==="#"&&(l===4||l===5?z={r:255&am[d[1]]*17,g:255&am[d[2]]*17,b:255&am[d[3]]*17,a:l===5?am[d[4]]*17:255}:(l===7||l===9)&&(z={r:am[d[1]]<<4|am[d[2]],g:am[d[3]]<<4|am[d[4]],b:am[d[5]]<<4|am[d[6]],a:l===9?am[d[7]]<<4|am[d[8]]:255})),z}const fot=(d,l)=>d<255?l(d):"";function dot(d){var l=cot(d)?lot:uot;return d?"#"+l(d.r)+l(d.g)+l(d.b)+fot(d.a,l):void 0}const pot=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function PO(d,l,z){const j=l*Math.min(z,1-z),J=(mt,kt=(mt+d/30)%12)=>z-j*Math.max(Math.min(kt-3,9-kt,1),-1);return[J(0),J(8),J(4)]}function mot(d,l,z){const j=(J,mt=(J+d/60)%6)=>z-z*l*Math.max(Math.min(mt,4-mt,1),0);return[j(5),j(3),j(1)]}function got(d,l,z){const j=PO(d,1,.5);let J;for(l+z>1&&(J=1/(l+z),l*=J,z*=J),J=0;J<3;J++)j[J]*=1-l-z,j[J]+=l;return j}function vot(d,l,z,j,J){return d===J?(l-z)/j+(l.5?pe/(2-mt-kt):pe/(mt+kt),Gt=vot(z,j,J,pe,mt),Gt=Gt*60+.5),[Gt|0,re||0,Dt]}function rM(d,l,z,j){return(Array.isArray(l)?d(l[0],l[1],l[2]):d(l,z,j)).map(p1)}function nM(d,l,z){return rM(PO,d,l,z)}function yot(d,l,z){return rM(got,d,l,z)}function xot(d,l,z){return rM(mot,d,l,z)}function zO(d){return(d%360+360)%360}function _ot(d){const l=pot.exec(d);let z=255,j;if(!l)return;l[5]!==j&&(z=l[6]?h2(+l[5]):p1(+l[5]));const J=zO(+l[2]),mt=+l[3]/100,kt=+l[4]/100;return l[1]==="hwb"?j=yot(J,mt,kt):l[1]==="hsv"?j=xot(J,mt,kt):j=nM(J,mt,kt),{r:j[0],g:j[1],b:j[2],a:z}}function bot(d,l){var z=eM(d);z[0]=zO(z[0]+l),z=nM(z),d.r=z[0],d.g=z[1],d.b=z[2]}function wot(d){if(!d)return;const l=eM(d),z=l[0],j=UL(l[1]),J=UL(l[2]);return d.a<255?`hsla(${z}, ${j}%, ${J}%, ${Xg(d.a)})`:`hsl(${z}, ${j}%, ${J}%)`}const VL={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},HL={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function kot(){const d={},l=Object.keys(HL),z=Object.keys(VL);let j,J,mt,kt,Dt;for(j=0;j>16&255,mt>>8&255,mt&255]}return d}let E5;function Tot(d){E5||(E5=kot(),E5.transparent=[0,0,0,0]);const l=E5[d.toLowerCase()];return l&&{r:l[0],g:l[1],b:l[2],a:l.length===4?l[3]:255}}const Aot=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Mot(d){const l=Aot.exec(d);let z=255,j,J,mt;if(l){if(l[7]!==j){const kt=+l[7];z=l[8]?h2(kt):u1(kt*255,0,255)}return j=+l[1],J=+l[3],mt=+l[5],j=255&(l[2]?h2(j):u1(j,0,255)),J=255&(l[4]?h2(J):u1(J,0,255)),mt=255&(l[6]?h2(mt):u1(mt,0,255)),{r:j,g:J,b:mt,a:z}}}function Sot(d){return d&&(d.a<255?`rgba(${d.r}, ${d.g}, ${d.b}, ${Xg(d.a)})`:`rgb(${d.r}, ${d.g}, ${d.b})`)}const L8=d=>d<=.0031308?d*12.92:Math.pow(d,1/2.4)*1.055-.055,Xx=d=>d<=.04045?d/12.92:Math.pow((d+.055)/1.055,2.4);function Eot(d,l,z){const j=Xx(Xg(d.r)),J=Xx(Xg(d.g)),mt=Xx(Xg(d.b));return{r:p1(L8(j+z*(Xx(Xg(l.r))-j))),g:p1(L8(J+z*(Xx(Xg(l.g))-J))),b:p1(L8(mt+z*(Xx(Xg(l.b))-mt))),a:d.a+z*(l.a-d.a)}}function C5(d,l,z){if(d){let j=eM(d);j[l]=Math.max(0,Math.min(j[l]+j[l]*z,l===0?360:1)),j=nM(j),d.r=j[0],d.g=j[1],d.b=j[2]}}function IO(d,l){return d&&Object.assign(l||{},d)}function WL(d){var l={r:0,g:0,b:0,a:255};return Array.isArray(d)?d.length>=3&&(l={r:d[0],g:d[1],b:d[2],a:255},d.length>3&&(l.a=p1(d[3]))):(l=IO(d,{r:0,g:0,b:0,a:1}),l.a=p1(l.a)),l}function Cot(d){return d.charAt(0)==="r"?Mot(d):_ot(d)}class N2{constructor(l){if(l instanceof N2)return l;const z=typeof l;let j;z==="object"?j=WL(l):z==="string"&&(j=hot(l)||Tot(l)||Cot(l)),this._rgb=j,this._valid=!!j}get valid(){return this._valid}get rgb(){var l=IO(this._rgb);return l&&(l.a=Xg(l.a)),l}set rgb(l){this._rgb=WL(l)}rgbString(){return this._valid?Sot(this._rgb):void 0}hexString(){return this._valid?dot(this._rgb):void 0}hslString(){return this._valid?wot(this._rgb):void 0}mix(l,z){if(l){const j=this.rgb,J=l.rgb;let mt;const kt=z===mt?.5:z,Dt=2*kt-1,Gt=j.a-J.a,re=((Dt*Gt===-1?Dt:(Dt+Gt)/(1+Dt*Gt))+1)/2;mt=1-re,j.r=255&re*j.r+mt*J.r+.5,j.g=255&re*j.g+mt*J.g+.5,j.b=255&re*j.b+mt*J.b+.5,j.a=kt*j.a+(1-kt)*J.a,this.rgb=j}return this}interpolate(l,z){return l&&(this._rgb=Eot(this._rgb,l._rgb,z)),this}clone(){return new N2(this.rgb)}alpha(l){return this._rgb.a=p1(l),this}clearer(l){const z=this._rgb;return z.a*=1-l,this}greyscale(){const l=this._rgb,z=nw(l.r*.3+l.g*.59+l.b*.11);return l.r=l.g=l.b=z,this}opaquer(l){const z=this._rgb;return z.a*=1+l,this}negate(){const l=this._rgb;return l.r=255-l.r,l.g=255-l.g,l.b=255-l.b,this}lighten(l){return C5(this._rgb,2,l),this}darken(l){return C5(this._rgb,2,-l),this}saturate(l){return C5(this._rgb,1,l),this}desaturate(l){return C5(this._rgb,1,-l),this}rotate(l){return bot(this._rgb,l),this}}/*! * Chart.js v4.5.1 * https://www.chartjs.org * (c) 2025 Chart.js Contributors * Released under the MIT License - */function $g(){}const Eot=(()=>{let d=0;return()=>d++})();function Rh(d){return d==null}function Xd(d){if(Array.isArray&&Array.isArray(d))return!0;const l=Object.prototype.toString.call(d);return l.slice(0,7)==="[object"&&l.slice(-6)==="Array]"}function Ec(d){return d!==null&&Object.prototype.toString.call(d)==="[object Object]"}function Qp(d){return(typeof d=="number"||d instanceof Number)&&isFinite(+d)}function eg(d,l){return Qp(d)?d:l}function cc(d,l){return typeof d>"u"?l:d}const Cot=(d,l)=>typeof d=="string"&&d.endsWith("%")?parseFloat(d)/100:+d/l,OO=(d,l)=>typeof d=="string"&&d.endsWith("%")?parseFloat(d)/100*l:+d;function Df(d,l,z){if(d&&typeof d.call=="function")return d.apply(z,l)}function Kh(d,l,z,j){let J,mt,kt;if(Xd(d))for(mt=d.length,J=0;Jd,x:d=>d.x,y:d=>d.y};function zot(d){const l=d.split("."),z=[];let j="";for(const J of l)j+=J,j.endsWith("\\")?j=j.slice(0,-1)+".":(z.push(j),j="");return z}function Iot(d){const l=zot(d);return z=>{for(const j of l){if(j==="")break;z=z&&z[j]}return z}}function My(d,l){return(qL[l]||(qL[l]=Iot(l)))(d)}function iM(d){return d.charAt(0).toUpperCase()+d.slice(1)}const U2=d=>typeof d<"u",v1=d=>typeof d=="function",ZL=(d,l)=>{if(d.size!==l.size)return!1;for(const z of d)if(!l.has(z))return!1;return!0};function Oot(d){return d.type==="mouseup"||d.type==="click"||d.type==="contextmenu"}const Jh=Math.PI,od=2*Jh,Dot=od+Jh,d4=Number.POSITIVE_INFINITY,Fot=Jh/180,ap=Jh/2,sy=Jh/4,$L=Jh*2/3,FO=Math.log10,cg=Math.sign;function A2(d,l,z){return Math.abs(d-l)J-mt).pop(),l}function Bot(d){return typeof d=="symbol"||typeof d=="object"&&d!==null&&!(Symbol.toPrimitive in d||"toString"in d||"valueOf"in d)}function V2(d){return!Bot(d)&&!isNaN(parseFloat(d))&&isFinite(d)}function Not(d,l){const z=Math.round(d);return z-l<=d&&z+l>=d}function jot(d,l,z){let j,J,mt;for(j=0,J=d.length;jGt&&re=Math.min(l,z)-j&&d<=Math.max(l,z)+j}function aM(d,l,z){z=z||(kt=>d[kt]1;)mt=J+j>>1,z(mt)?J=mt:j=mt;return{lo:J,hi:j}}const yy=(d,l,z,j)=>aM(d,z,j?J=>{const mt=d[J][l];return mtd[J][l]aM(d,z,j=>d[j][l]>=z);function qot(d,l,z){let j=0,J=d.length;for(;jj&&d[J-1]>z;)J--;return j>0||J{const j="_onData"+iM(z),J=d[z];Object.defineProperty(d,z,{configurable:!0,enumerable:!1,value(...mt){const kt=J.apply(this,mt);return d._chartjs.listeners.forEach(Dt=>{typeof Dt[j]=="function"&&Dt[j](...mt)}),kt}})})}function KL(d,l){const z=d._chartjs;if(!z)return;const j=z.listeners,J=j.indexOf(l);J!==-1&&j.splice(J,1),!(j.length>0)&&(BO.forEach(mt=>{delete d[mt]}),delete d._chartjs)}function NO(d){const l=new Set(d);return l.size===d.length?d:Array.from(l)}const jO=function(){return typeof window>"u"?function(d){return d()}:window.requestAnimationFrame}();function UO(d,l){let z=[],j=!1;return function(...J){z=J,j||(j=!0,jO.call(window,()=>{j=!1,d.apply(l,z)}))}}function $ot(d,l){let z;return function(...j){return l?(clearTimeout(z),z=setTimeout(d,l,j)):d.apply(this,j),l}}const oM=d=>d==="start"?"left":d==="end"?"right":"center",Wp=(d,l,z)=>d==="start"?l:d==="end"?z:(l+z)/2,Got=(d,l,z,j)=>d===(j?"left":"right")?z:d==="center"?(l+z)/2:l;function Yot(d,l,z){const j=l.length;let J=0,mt=j;if(d._sorted){const{iScale:kt,vScale:Dt,_parsed:Gt}=d,re=d.dataset&&d.dataset.options?d.dataset.options.spanGaps:null,pe=kt.axis,{min:Ne,max:or,minDefined:_r,maxDefined:Fr}=kt.getUserBounds();if(_r){if(J=Math.min(yy(Gt,pe,Ne).lo,z?j:yy(l,pe,kt.getPixelForValue(Ne)).lo),re){const zr=Gt.slice(0,J+1).reverse().findIndex(Wr=>!Rh(Wr[Dt.axis]));J-=Math.max(0,zr)}J=Xp(J,0,j-1)}if(Fr){let zr=Math.max(yy(Gt,kt.axis,or,!0).hi+1,z?0:yy(l,pe,kt.getPixelForValue(or),!0).hi+1);if(re){const Wr=Gt.slice(zr-1).findIndex(An=>!Rh(An[Dt.axis]));zr+=Math.max(0,Wr)}mt=Xp(zr,J,j)-J}else mt=j-J}return{start:J,count:mt}}function Kot(d){const{xScale:l,yScale:z,_scaleRanges:j}=d,J={xmin:l.min,xmax:l.max,ymin:z.min,ymax:z.max};if(!j)return d._scaleRanges=J,!0;const mt=j.xmin!==l.min||j.xmax!==l.max||j.ymin!==z.min||j.ymax!==z.max;return Object.assign(j,J),mt}const L5=d=>d===0||d===1,XL=(d,l,z)=>-(Math.pow(2,10*(d-=1))*Math.sin((d-l)*od/z)),JL=(d,l,z)=>Math.pow(2,-10*d)*Math.sin((d-l)*od/z)+1,M2={linear:d=>d,easeInQuad:d=>d*d,easeOutQuad:d=>-d*(d-2),easeInOutQuad:d=>(d/=.5)<1?.5*d*d:-.5*(--d*(d-2)-1),easeInCubic:d=>d*d*d,easeOutCubic:d=>(d-=1)*d*d+1,easeInOutCubic:d=>(d/=.5)<1?.5*d*d*d:.5*((d-=2)*d*d+2),easeInQuart:d=>d*d*d*d,easeOutQuart:d=>-((d-=1)*d*d*d-1),easeInOutQuart:d=>(d/=.5)<1?.5*d*d*d*d:-.5*((d-=2)*d*d*d-2),easeInQuint:d=>d*d*d*d*d,easeOutQuint:d=>(d-=1)*d*d*d*d+1,easeInOutQuint:d=>(d/=.5)<1?.5*d*d*d*d*d:.5*((d-=2)*d*d*d*d+2),easeInSine:d=>-Math.cos(d*ap)+1,easeOutSine:d=>Math.sin(d*ap),easeInOutSine:d=>-.5*(Math.cos(Jh*d)-1),easeInExpo:d=>d===0?0:Math.pow(2,10*(d-1)),easeOutExpo:d=>d===1?1:-Math.pow(2,-10*d)+1,easeInOutExpo:d=>L5(d)?d:d<.5?.5*Math.pow(2,10*(d*2-1)):.5*(-Math.pow(2,-10*(d*2-1))+2),easeInCirc:d=>d>=1?d:-(Math.sqrt(1-d*d)-1),easeOutCirc:d=>Math.sqrt(1-(d-=1)*d),easeInOutCirc:d=>(d/=.5)<1?-.5*(Math.sqrt(1-d*d)-1):.5*(Math.sqrt(1-(d-=2)*d)+1),easeInElastic:d=>L5(d)?d:XL(d,.075,.3),easeOutElastic:d=>L5(d)?d:JL(d,.075,.3),easeInOutElastic(d){return L5(d)?d:d<.5?.5*XL(d*2,.1125,.45):.5+.5*JL(d*2-1,.1125,.45)},easeInBack(d){return d*d*((1.70158+1)*d-1.70158)},easeOutBack(d){return(d-=1)*d*((1.70158+1)*d+1.70158)+1},easeInOutBack(d){let l=1.70158;return(d/=.5)<1?.5*(d*d*(((l*=1.525)+1)*d-l)):.5*((d-=2)*d*(((l*=1.525)+1)*d+l)+2)},easeInBounce:d=>1-M2.easeOutBounce(1-d),easeOutBounce(d){return d<1/2.75?7.5625*d*d:d<2/2.75?7.5625*(d-=1.5/2.75)*d+.75:d<2.5/2.75?7.5625*(d-=2.25/2.75)*d+.9375:7.5625*(d-=2.625/2.75)*d+.984375},easeInOutBounce:d=>d<.5?M2.easeInBounce(d*2)*.5:M2.easeOutBounce(d*2-1)*.5+.5};function sM(d){if(d&&typeof d=="object"){const l=d.toString();return l==="[object CanvasPattern]"||l==="[object CanvasGradient]"}return!1}function QL(d){return sM(d)?d:new N2(d)}function P8(d){return sM(d)?d:new N2(d).saturate(.5).darken(.1).hexString()}const Xot=["x","y","borderWidth","radius","tension"],Jot=["color","borderColor","backgroundColor"];function Qot(d){d.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),d.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:l=>l!=="onProgress"&&l!=="onComplete"&&l!=="fn"}),d.set("animations",{colors:{type:"color",properties:Jot},numbers:{type:"number",properties:Xot}}),d.describe("animations",{_fallback:"animation"}),d.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:l=>l|0}}}})}function tst(d){d.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const tP=new Map;function est(d,l){l=l||{};const z=d+JSON.stringify(l);let j=tP.get(z);return j||(j=new Intl.NumberFormat(d,l),tP.set(z,j)),j}function lM(d,l,z){return est(l,z).format(d)}const rst={values(d){return Xd(d)?d:""+d},numeric(d,l,z){if(d===0)return"0";const j=this.chart.options.locale;let J,mt=d;if(z.length>1){const re=Math.max(Math.abs(z[0].value),Math.abs(z[z.length-1].value));(re<1e-4||re>1e15)&&(J="scientific"),mt=nst(d,z)}const kt=FO(Math.abs(mt)),Dt=isNaN(kt)?1:Math.max(Math.min(-1*Math.floor(kt),20),0),Gt={notation:J,minimumFractionDigits:Dt,maximumFractionDigits:Dt};return Object.assign(Gt,this.options.ticks.format),lM(d,j,Gt)}};function nst(d,l){let z=l.length>3?l[2].value-l[1].value:l[1].value-l[0].value;return Math.abs(z)>=1&&d!==Math.floor(d)&&(z=d-Math.floor(d)),z}var VO={formatters:rst};function ist(d){d.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(l,z)=>z.lineWidth,tickColor:(l,z)=>z.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:VO.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),d.route("scale.ticks","color","","color"),d.route("scale.grid","color","","borderColor"),d.route("scale.border","color","","borderColor"),d.route("scale.title","color","","color"),d.describe("scale",{_fallback:!1,_scriptable:l=>!l.startsWith("before")&&!l.startsWith("after")&&l!=="callback"&&l!=="parser",_indexable:l=>l!=="borderDash"&&l!=="tickBorderDash"&&l!=="dash"}),d.describe("scales",{_fallback:"scale"}),d.describe("scale.ticks",{_scriptable:l=>l!=="backdropPadding"&&l!=="callback",_indexable:l=>l!=="backdropPadding"})}const Sy=Object.create(null),vA=Object.create(null);function S2(d,l){if(!l)return d;const z=l.split(".");for(let j=0,J=z.length;jj.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(j,J)=>P8(J.backgroundColor),this.hoverBorderColor=(j,J)=>P8(J.borderColor),this.hoverColor=(j,J)=>P8(J.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(l),this.apply(z)}set(l,z){return z8(this,l,z)}get(l){return S2(this,l)}describe(l,z){return z8(vA,l,z)}override(l,z){return z8(Sy,l,z)}route(l,z,j,J){const mt=S2(this,l),kt=S2(this,j),Dt="_"+z;Object.defineProperties(mt,{[Dt]:{value:mt[z],writable:!0},[z]:{enumerable:!0,get(){const Gt=this[Dt],re=kt[J];return Ec(Gt)?Object.assign({},re,Gt):cc(Gt,re)},set(Gt){this[Dt]=Gt}}})}apply(l){l.forEach(z=>z(this))}}var Bd=new ast({_scriptable:d=>!d.startsWith("on"),_indexable:d=>d!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Qot,tst,ist]);function ost(d){return!d||Rh(d.size)||Rh(d.family)?null:(d.style?d.style+" ":"")+(d.weight?d.weight+" ":"")+d.size+"px "+d.family}function eP(d,l,z,j,J){let mt=l[J];return mt||(mt=l[J]=d.measureText(J).width,z.push(J)),mt>j&&(j=mt),j}function ly(d,l,z){const j=d.currentDevicePixelRatio,J=z!==0?Math.max(z/2,.5):0;return Math.round((l-J)*j)/j+J}function rP(d,l){!l&&!d||(l=l||d.getContext("2d"),l.save(),l.resetTransform(),l.clearRect(0,0,d.width,d.height),l.restore())}function yA(d,l,z,j){HO(d,l,z,j,null)}function HO(d,l,z,j,J){let mt,kt,Dt,Gt,re,pe,Ne,or;const _r=l.pointStyle,Fr=l.rotation,zr=l.radius;let Wr=(Fr||0)*Fot;if(_r&&typeof _r=="object"&&(mt=_r.toString(),mt==="[object HTMLImageElement]"||mt==="[object HTMLCanvasElement]")){d.save(),d.translate(z,j),d.rotate(Wr),d.drawImage(_r,-_r.width/2,-_r.height/2,_r.width,_r.height),d.restore();return}if(!(isNaN(zr)||zr<=0)){switch(d.beginPath(),_r){default:J?d.ellipse(z,j,J/2,zr,0,0,od):d.arc(z,j,zr,0,od),d.closePath();break;case"triangle":pe=J?J/2:zr,d.moveTo(z+Math.sin(Wr)*pe,j-Math.cos(Wr)*zr),Wr+=$L,d.lineTo(z+Math.sin(Wr)*pe,j-Math.cos(Wr)*zr),Wr+=$L,d.lineTo(z+Math.sin(Wr)*pe,j-Math.cos(Wr)*zr),d.closePath();break;case"rectRounded":re=zr*.516,Gt=zr-re,kt=Math.cos(Wr+sy)*Gt,Ne=Math.cos(Wr+sy)*(J?J/2-re:Gt),Dt=Math.sin(Wr+sy)*Gt,or=Math.sin(Wr+sy)*(J?J/2-re:Gt),d.arc(z-Ne,j-Dt,re,Wr-Jh,Wr-ap),d.arc(z+or,j-kt,re,Wr-ap,Wr),d.arc(z+Ne,j+Dt,re,Wr,Wr+ap),d.arc(z-or,j+kt,re,Wr+ap,Wr+Jh),d.closePath();break;case"rect":if(!Fr){Gt=Math.SQRT1_2*zr,pe=J?J/2:Gt,d.rect(z-pe,j-Gt,2*pe,2*Gt);break}Wr+=sy;case"rectRot":Ne=Math.cos(Wr)*(J?J/2:zr),kt=Math.cos(Wr)*zr,Dt=Math.sin(Wr)*zr,or=Math.sin(Wr)*(J?J/2:zr),d.moveTo(z-Ne,j-Dt),d.lineTo(z+or,j-kt),d.lineTo(z+Ne,j+Dt),d.lineTo(z-or,j+kt),d.closePath();break;case"crossRot":Wr+=sy;case"cross":Ne=Math.cos(Wr)*(J?J/2:zr),kt=Math.cos(Wr)*zr,Dt=Math.sin(Wr)*zr,or=Math.sin(Wr)*(J?J/2:zr),d.moveTo(z-Ne,j-Dt),d.lineTo(z+Ne,j+Dt),d.moveTo(z+or,j-kt),d.lineTo(z-or,j+kt);break;case"star":Ne=Math.cos(Wr)*(J?J/2:zr),kt=Math.cos(Wr)*zr,Dt=Math.sin(Wr)*zr,or=Math.sin(Wr)*(J?J/2:zr),d.moveTo(z-Ne,j-Dt),d.lineTo(z+Ne,j+Dt),d.moveTo(z+or,j-kt),d.lineTo(z-or,j+kt),Wr+=sy,Ne=Math.cos(Wr)*(J?J/2:zr),kt=Math.cos(Wr)*zr,Dt=Math.sin(Wr)*zr,or=Math.sin(Wr)*(J?J/2:zr),d.moveTo(z-Ne,j-Dt),d.lineTo(z+Ne,j+Dt),d.moveTo(z+or,j-kt),d.lineTo(z-or,j+kt);break;case"line":kt=J?J/2:Math.cos(Wr)*zr,Dt=Math.sin(Wr)*zr,d.moveTo(z-kt,j-Dt),d.lineTo(z+kt,j+Dt);break;case"dash":d.moveTo(z,j),d.lineTo(z+Math.cos(Wr)*(J?J/2:zr),j+Math.sin(Wr)*zr);break;case!1:d.closePath();break}d.fill(),l.borderWidth>0&&d.stroke()}}function W2(d,l,z){return z=z||.5,!l||d&&d.x>l.left-z&&d.xl.top-z&&d.y0&&mt.strokeColor!=="";let Gt,re;for(d.save(),d.font=J.string,ust(d,mt),Gt=0;Gt+d||0;function uM(d,l){const z={},j=Ec(l),J=j?Object.keys(l):l,mt=Ec(d)?j?kt=>cc(d[kt],d[l[kt]]):kt=>d[kt]:()=>d;for(const kt of J)z[kt]=mst(mt(kt));return z}function WO(d){return uM(d,{top:"y",right:"x",bottom:"y",left:"x"})}function s_(d){return uM(d,["topLeft","topRight","bottomLeft","bottomRight"])}function fm(d){const l=WO(d);return l.width=l.left+l.right,l.height=l.top+l.bottom,l}function Jp(d,l){d=d||{},l=l||Bd.font;let z=cc(d.size,l.size);typeof z=="string"&&(z=parseInt(z,10));let j=cc(d.style,l.style);j&&!(""+j).match(dst)&&(console.warn('Invalid font style specified: "'+j+'"'),j=void 0);const J={family:cc(d.family,l.family),lineHeight:pst(cc(d.lineHeight,l.lineHeight),z),size:z,style:j,weight:cc(d.weight,l.weight),string:""};return J.string=ost(J),J}function P5(d,l,z,j){let J,mt,kt;for(J=0,mt=d.length;Jz&&Dt===0?0:Dt+Gt;return{min:kt(j,-Math.abs(mt)),max:kt(J,mt)}}function Cy(d,l){return Object.assign(Object.create(d),l)}function cM(d,l=[""],z,j,J=()=>d[0]){const mt=z||d;typeof j>"u"&&(j=GO("_fallback",d));const kt={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:d,_rootScopes:mt,_fallback:j,_getTarget:J,override:Dt=>cM([Dt,...d],l,mt,j)};return new Proxy(kt,{deleteProperty(Dt,Gt){return delete Dt[Gt],delete Dt._keys,delete d[0][Gt],!0},get(Dt,Gt){return ZO(Dt,Gt,()=>Tst(Gt,l,d,Dt))},getOwnPropertyDescriptor(Dt,Gt){return Reflect.getOwnPropertyDescriptor(Dt._scopes[0],Gt)},getPrototypeOf(){return Reflect.getPrototypeOf(d[0])},has(Dt,Gt){return iP(Dt).includes(Gt)},ownKeys(Dt){return iP(Dt)},set(Dt,Gt,re){const pe=Dt._storage||(Dt._storage=J());return Dt[Gt]=pe[Gt]=re,delete Dt._keys,!0}})}function m_(d,l,z,j){const J={_cacheable:!1,_proxy:d,_context:l,_subProxy:z,_stack:new Set,_descriptors:qO(d,j),setContext:mt=>m_(d,mt,z,j),override:mt=>m_(d.override(mt),l,z,j)};return new Proxy(J,{deleteProperty(mt,kt){return delete mt[kt],delete d[kt],!0},get(mt,kt,Dt){return ZO(mt,kt,()=>yst(mt,kt,Dt))},getOwnPropertyDescriptor(mt,kt){return mt._descriptors.allKeys?Reflect.has(d,kt)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(d,kt)},getPrototypeOf(){return Reflect.getPrototypeOf(d)},has(mt,kt){return Reflect.has(d,kt)},ownKeys(){return Reflect.ownKeys(d)},set(mt,kt,Dt){return d[kt]=Dt,delete mt[kt],!0}})}function qO(d,l={scriptable:!0,indexable:!0}){const{_scriptable:z=l.scriptable,_indexable:j=l.indexable,_allKeys:J=l.allKeys}=d;return{allKeys:J,scriptable:z,indexable:j,isScriptable:v1(z)?z:()=>z,isIndexable:v1(j)?j:()=>j}}const vst=(d,l)=>d?d+iM(l):l,hM=(d,l)=>Ec(l)&&d!=="adapters"&&(Object.getPrototypeOf(l)===null||l.constructor===Object);function ZO(d,l,z){if(Object.prototype.hasOwnProperty.call(d,l)||l==="constructor")return d[l];const j=z();return d[l]=j,j}function yst(d,l,z){const{_proxy:j,_context:J,_subProxy:mt,_descriptors:kt}=d;let Dt=j[l];return v1(Dt)&&kt.isScriptable(l)&&(Dt=xst(l,Dt,d,z)),Xd(Dt)&&Dt.length&&(Dt=_st(l,Dt,d,kt.isIndexable)),hM(l,Dt)&&(Dt=m_(Dt,J,mt&&mt[l],kt)),Dt}function xst(d,l,z,j){const{_proxy:J,_context:mt,_subProxy:kt,_stack:Dt}=z;if(Dt.has(d))throw new Error("Recursion detected: "+Array.from(Dt).join("->")+"->"+d);Dt.add(d);let Gt=l(mt,kt||j);return Dt.delete(d),hM(d,Gt)&&(Gt=fM(J._scopes,J,d,Gt)),Gt}function _st(d,l,z,j){const{_proxy:J,_context:mt,_subProxy:kt,_descriptors:Dt}=z;if(typeof mt.index<"u"&&j(d))return l[mt.index%l.length];if(Ec(l[0])){const Gt=l,re=J._scopes.filter(pe=>pe!==Gt);l=[];for(const pe of Gt){const Ne=fM(re,J,d,pe);l.push(m_(Ne,mt,kt&&kt[d],Dt))}}return l}function $O(d,l,z){return v1(d)?d(l,z):d}const bst=(d,l)=>d===!0?l:typeof d=="string"?My(l,d):void 0;function wst(d,l,z,j,J){for(const mt of l){const kt=bst(z,mt);if(kt){d.add(kt);const Dt=$O(kt._fallback,z,J);if(typeof Dt<"u"&&Dt!==z&&Dt!==j)return Dt}else if(kt===!1&&typeof j<"u"&&z!==j)return null}return!1}function fM(d,l,z,j){const J=l._rootScopes,mt=$O(l._fallback,z,j),kt=[...d,...J],Dt=new Set;Dt.add(j);let Gt=nP(Dt,kt,z,mt||z,j);return Gt===null||typeof mt<"u"&&mt!==z&&(Gt=nP(Dt,kt,mt,Gt,j),Gt===null)?!1:cM(Array.from(Dt),[""],J,mt,()=>kst(l,z,j))}function nP(d,l,z,j,J){for(;z;)z=wst(d,l,z,j,J);return z}function kst(d,l,z){const j=d._getTarget();l in j||(j[l]={});const J=j[l];return Xd(J)&&Ec(z)?z:J||{}}function Tst(d,l,z,j){let J;for(const mt of l)if(J=GO(vst(mt,d),z),typeof J<"u")return hM(d,J)?fM(z,j,d,J):J}function GO(d,l){for(const z of l){if(!z)continue;const j=z[d];if(typeof j<"u")return j}}function iP(d){let l=d._keys;return l||(l=d._keys=Ast(d._scopes)),l}function Ast(d){const l=new Set;for(const z of d)for(const j of Object.keys(z).filter(J=>!J.startsWith("_")))l.add(j);return Array.from(l)}const Mst=Number.EPSILON||1e-14,g_=(d,l)=>ld==="x"?"y":"x";function Sst(d,l,z,j){const J=d.skip?l:d,mt=l,kt=z.skip?l:z,Dt=gA(mt,J),Gt=gA(kt,mt);let re=Dt/(Dt+Gt),pe=Gt/(Dt+Gt);re=isNaN(re)?0:re,pe=isNaN(pe)?0:pe;const Ne=j*re,or=j*pe;return{previous:{x:mt.x-Ne*(kt.x-J.x),y:mt.y-Ne*(kt.y-J.y)},next:{x:mt.x+or*(kt.x-J.x),y:mt.y+or*(kt.y-J.y)}}}function Est(d,l,z){const j=d.length;let J,mt,kt,Dt,Gt,re=g_(d,0);for(let pe=0;pe!re.skip)),l.cubicInterpolationMode==="monotone")Lst(d,J);else{let re=j?d[d.length-1]:d[0];for(mt=0,kt=d.length;mtd.ownerDocument.defaultView.getComputedStyle(d,null);function Ist(d,l){return H4(d).getPropertyValue(l)}const Ost=["top","right","bottom","left"];function wy(d,l,z){const j={};z=z?"-"+z:"";for(let J=0;J<4;J++){const mt=Ost[J];j[mt]=parseFloat(d[l+"-"+mt+z])||0}return j.width=j.left+j.right,j.height=j.top+j.bottom,j}const Dst=(d,l,z)=>(d>0||l>0)&&(!z||!z.shadowRoot);function Fst(d,l){const z=d.touches,j=z&&z.length?z[0]:d,{offsetX:J,offsetY:mt}=j;let kt=!1,Dt,Gt;if(Dst(J,mt,d.target))Dt=J,Gt=mt;else{const re=l.getBoundingClientRect();Dt=j.clientX-re.left,Gt=j.clientY-re.top,kt=!0}return{x:Dt,y:Gt,box:kt}}function hy(d,l){if("native"in d)return d;const{canvas:z,currentDevicePixelRatio:j}=l,J=H4(z),mt=J.boxSizing==="border-box",kt=wy(J,"padding"),Dt=wy(J,"border","width"),{x:Gt,y:re,box:pe}=Fst(d,z),Ne=kt.left+(pe&&Dt.left),or=kt.top+(pe&&Dt.top);let{width:_r,height:Fr}=l;return mt&&(_r-=kt.width+Dt.width,Fr-=kt.height+Dt.height),{x:Math.round((Gt-Ne)/_r*z.width/j),y:Math.round((re-or)/Fr*z.height/j)}}function Rst(d,l,z){let j,J;if(l===void 0||z===void 0){const mt=d&&pM(d);if(!mt)l=d.clientWidth,z=d.clientHeight;else{const kt=mt.getBoundingClientRect(),Dt=H4(mt),Gt=wy(Dt,"border","width"),re=wy(Dt,"padding");l=kt.width-re.width-Gt.width,z=kt.height-re.height-Gt.height,j=m4(Dt.maxWidth,mt,"clientWidth"),J=m4(Dt.maxHeight,mt,"clientHeight")}}return{width:l,height:z,maxWidth:j||d4,maxHeight:J||d4}}const c1=d=>Math.round(d*10)/10;function Bst(d,l,z,j){const J=H4(d),mt=wy(J,"margin"),kt=m4(J.maxWidth,d,"clientWidth")||d4,Dt=m4(J.maxHeight,d,"clientHeight")||d4,Gt=Rst(d,l,z);let{width:re,height:pe}=Gt;if(J.boxSizing==="content-box"){const or=wy(J,"border","width"),_r=wy(J,"padding");re-=_r.width+or.width,pe-=_r.height+or.height}return re=Math.max(0,re-mt.width),pe=Math.max(0,j?re/j:pe-mt.height),re=c1(Math.min(re,kt,Gt.maxWidth)),pe=c1(Math.min(pe,Dt,Gt.maxHeight)),re&&!pe&&(pe=c1(re/2)),(l!==void 0||z!==void 0)&&j&&Gt.height&&pe>Gt.height&&(pe=Gt.height,re=c1(Math.floor(pe*j))),{width:re,height:pe}}function aP(d,l,z){const j=l||1,J=c1(d.height*j),mt=c1(d.width*j);d.height=c1(d.height),d.width=c1(d.width);const kt=d.canvas;return kt.style&&(z||!kt.style.height&&!kt.style.width)&&(kt.style.height=`${d.height}px`,kt.style.width=`${d.width}px`),d.currentDevicePixelRatio!==j||kt.height!==J||kt.width!==mt?(d.currentDevicePixelRatio=j,kt.height=J,kt.width=mt,d.ctx.setTransform(j,0,0,j,0,0),!0):!1}const Nst=function(){let d=!1;try{const l={get passive(){return d=!0,!1}};dM()&&(window.addEventListener("test",null,l),window.removeEventListener("test",null,l))}catch{}return d}();function oP(d,l){const z=Ist(d,l),j=z&&z.match(/^(\d+)(\.\d+)?px$/);return j?+j[1]:void 0}function fy(d,l,z,j){return{x:d.x+z*(l.x-d.x),y:d.y+z*(l.y-d.y)}}function jst(d,l,z,j){return{x:d.x+z*(l.x-d.x),y:j==="middle"?z<.5?d.y:l.y:j==="after"?z<1?d.y:l.y:z>0?l.y:d.y}}function Ust(d,l,z,j){const J={x:d.cp2x,y:d.cp2y},mt={x:l.cp1x,y:l.cp1y},kt=fy(d,J,z),Dt=fy(J,mt,z),Gt=fy(mt,l,z),re=fy(kt,Dt,z),pe=fy(Dt,Gt,z);return fy(re,pe,z)}const Vst=function(d,l){return{x(z){return d+d+l-z},setWidth(z){l=z},textAlign(z){return z==="center"?z:z==="right"?"left":"right"},xPlus(z,j){return z-j},leftForLtr(z,j){return z-j}}},Hst=function(){return{x(d){return d},setWidth(d){},textAlign(d){return d},xPlus(d,l){return d+l},leftForLtr(d,l){return d}}};function l_(d,l,z){return d?Vst(l,z):Hst()}function KO(d,l){let z,j;(l==="ltr"||l==="rtl")&&(z=d.canvas.style,j=[z.getPropertyValue("direction"),z.getPropertyPriority("direction")],z.setProperty("direction",l,"important"),d.prevTextDirection=j)}function XO(d,l){l!==void 0&&(delete d.prevTextDirection,d.canvas.style.setProperty("direction",l[0],l[1]))}function JO(d){return d==="angle"?{between:H2,compare:Vot,normalize:q0}:{between:ev,compare:(l,z)=>l-z,normalize:l=>l}}function sP({start:d,end:l,count:z,loop:j,style:J}){return{start:d%z,end:l%z,loop:j&&(l-d+1)%z===0,style:J}}function Wst(d,l,z){const{property:j,start:J,end:mt}=z,{between:kt,normalize:Dt}=JO(j),Gt=l.length;let{start:re,end:pe,loop:Ne}=d,or,_r;if(Ne){for(re+=Gt,pe+=Gt,or=0,_r=Gt;or<_r&&kt(Dt(l[re%Gt][j]),J,mt);++or)re--,pe--;re%=Gt,pe%=Gt}return peGt(J,kn,An)&&Dt(J,kn)!==0,jn=()=>Dt(mt,An)===0||Gt(mt,kn,An),ai=()=>zr||ei(),Qi=()=>!zr||jn();for(let Gi=pe,un=pe;Gi<=Ne;++Gi)Ft=l[Gi%kt],!Ft.skip&&(An=re(Ft[j]),An!==kn&&(zr=Gt(An,J,mt),Wr===null&&ai()&&(Wr=Dt(An,J)===0?Gi:un),Wr!==null&&Qi()&&(Fr.push(sP({start:Wr,end:Gi,loop:or,count:kt,style:_r})),Wr=null),un=Gi,kn=An));return Wr!==null&&Fr.push(sP({start:Wr,end:Ne,loop:or,count:kt,style:_r})),Fr}function tD(d,l){const z=[],j=d.segments;for(let J=0;JJ&&d[mt%l].skip;)mt--;return mt%=l,{start:J,end:mt}}function Zst(d,l,z,j){const J=d.length,mt=[];let kt=l,Dt=d[l],Gt;for(Gt=l+1;Gt<=z;++Gt){const re=d[Gt%J];re.skip||re.stop?Dt.skip||(j=!1,mt.push({start:l%J,end:(Gt-1)%J,loop:j}),l=kt=re.stop?Gt:null):(kt=Gt,Dt.skip&&(l=Gt)),Dt=re}return kt!==null&&mt.push({start:l%J,end:kt%J,loop:j}),mt}function $st(d,l){const z=d.points,j=d.options.spanGaps,J=z.length;if(!J)return[];const mt=!!d._loop,{start:kt,end:Dt}=qst(z,J,mt,j);if(j===!0)return lP(d,[{start:kt,end:Dt,loop:mt}],z,l);const Gt=Dt{let d=0;return()=>d++})();function Rh(d){return d==null}function Xd(d){if(Array.isArray&&Array.isArray(d))return!0;const l=Object.prototype.toString.call(d);return l.slice(0,7)==="[object"&&l.slice(-6)==="Array]"}function Ec(d){return d!==null&&Object.prototype.toString.call(d)==="[object Object]"}function Qp(d){return(typeof d=="number"||d instanceof Number)&&isFinite(+d)}function eg(d,l){return Qp(d)?d:l}function cc(d,l){return typeof d>"u"?l:d}const Pot=(d,l)=>typeof d=="string"&&d.endsWith("%")?parseFloat(d)/100:+d/l,OO=(d,l)=>typeof d=="string"&&d.endsWith("%")?parseFloat(d)/100*l:+d;function Df(d,l,z){if(d&&typeof d.call=="function")return d.apply(z,l)}function Kh(d,l,z,j){let J,mt,kt;if(Xd(d))for(mt=d.length,J=0;Jd,x:d=>d.x,y:d=>d.y};function Oot(d){const l=d.split("."),z=[];let j="";for(const J of l)j+=J,j.endsWith("\\")?j=j.slice(0,-1)+".":(z.push(j),j="");return z}function Dot(d){const l=Oot(d);return z=>{for(const j of l){if(j==="")break;z=z&&z[j]}return z}}function My(d,l){return(qL[l]||(qL[l]=Dot(l)))(d)}function iM(d){return d.charAt(0).toUpperCase()+d.slice(1)}const U2=d=>typeof d<"u",v1=d=>typeof d=="function",ZL=(d,l)=>{if(d.size!==l.size)return!1;for(const z of d)if(!l.has(z))return!1;return!0};function Fot(d){return d.type==="mouseup"||d.type==="click"||d.type==="contextmenu"}const Jh=Math.PI,od=2*Jh,Rot=od+Jh,d4=Number.POSITIVE_INFINITY,Bot=Jh/180,ap=Jh/2,sy=Jh/4,$L=Jh*2/3,FO=Math.log10,cg=Math.sign;function A2(d,l,z){return Math.abs(d-l)J-mt).pop(),l}function jot(d){return typeof d=="symbol"||typeof d=="object"&&d!==null&&!(Symbol.toPrimitive in d||"toString"in d||"valueOf"in d)}function V2(d){return!jot(d)&&!isNaN(parseFloat(d))&&isFinite(d)}function Uot(d,l){const z=Math.round(d);return z-l<=d&&z+l>=d}function Vot(d,l,z){let j,J,mt;for(j=0,J=d.length;jGt&&re=Math.min(l,z)-j&&d<=Math.max(l,z)+j}function aM(d,l,z){z=z||(kt=>d[kt]1;)mt=J+j>>1,z(mt)?J=mt:j=mt;return{lo:J,hi:j}}const yy=(d,l,z,j)=>aM(d,z,j?J=>{const mt=d[J][l];return mtd[J][l]aM(d,z,j=>d[j][l]>=z);function $ot(d,l,z){let j=0,J=d.length;for(;jj&&d[J-1]>z;)J--;return j>0||J{const j="_onData"+iM(z),J=d[z];Object.defineProperty(d,z,{configurable:!0,enumerable:!1,value(...mt){const kt=J.apply(this,mt);return d._chartjs.listeners.forEach(Dt=>{typeof Dt[j]=="function"&&Dt[j](...mt)}),kt}})})}function KL(d,l){const z=d._chartjs;if(!z)return;const j=z.listeners,J=j.indexOf(l);J!==-1&&j.splice(J,1),!(j.length>0)&&(BO.forEach(mt=>{delete d[mt]}),delete d._chartjs)}function NO(d){const l=new Set(d);return l.size===d.length?d:Array.from(l)}const jO=function(){return typeof window>"u"?function(d){return d()}:window.requestAnimationFrame}();function UO(d,l){let z=[],j=!1;return function(...J){z=J,j||(j=!0,jO.call(window,()=>{j=!1,d.apply(l,z)}))}}function Yot(d,l){let z;return function(...j){return l?(clearTimeout(z),z=setTimeout(d,l,j)):d.apply(this,j),l}}const oM=d=>d==="start"?"left":d==="end"?"right":"center",Wp=(d,l,z)=>d==="start"?l:d==="end"?z:(l+z)/2,Kot=(d,l,z,j)=>d===(j?"left":"right")?z:d==="center"?(l+z)/2:l;function Xot(d,l,z){const j=l.length;let J=0,mt=j;if(d._sorted){const{iScale:kt,vScale:Dt,_parsed:Gt}=d,re=d.dataset&&d.dataset.options?d.dataset.options.spanGaps:null,pe=kt.axis,{min:Ne,max:or,minDefined:_r,maxDefined:Fr}=kt.getUserBounds();if(_r){if(J=Math.min(yy(Gt,pe,Ne).lo,z?j:yy(l,pe,kt.getPixelForValue(Ne)).lo),re){const zr=Gt.slice(0,J+1).reverse().findIndex(Wr=>!Rh(Wr[Dt.axis]));J-=Math.max(0,zr)}J=Xp(J,0,j-1)}if(Fr){let zr=Math.max(yy(Gt,kt.axis,or,!0).hi+1,z?0:yy(l,pe,kt.getPixelForValue(or),!0).hi+1);if(re){const Wr=Gt.slice(zr-1).findIndex(An=>!Rh(An[Dt.axis]));zr+=Math.max(0,Wr)}mt=Xp(zr,J,j)-J}else mt=j-J}return{start:J,count:mt}}function Jot(d){const{xScale:l,yScale:z,_scaleRanges:j}=d,J={xmin:l.min,xmax:l.max,ymin:z.min,ymax:z.max};if(!j)return d._scaleRanges=J,!0;const mt=j.xmin!==l.min||j.xmax!==l.max||j.ymin!==z.min||j.ymax!==z.max;return Object.assign(j,J),mt}const L5=d=>d===0||d===1,XL=(d,l,z)=>-(Math.pow(2,10*(d-=1))*Math.sin((d-l)*od/z)),JL=(d,l,z)=>Math.pow(2,-10*d)*Math.sin((d-l)*od/z)+1,M2={linear:d=>d,easeInQuad:d=>d*d,easeOutQuad:d=>-d*(d-2),easeInOutQuad:d=>(d/=.5)<1?.5*d*d:-.5*(--d*(d-2)-1),easeInCubic:d=>d*d*d,easeOutCubic:d=>(d-=1)*d*d+1,easeInOutCubic:d=>(d/=.5)<1?.5*d*d*d:.5*((d-=2)*d*d+2),easeInQuart:d=>d*d*d*d,easeOutQuart:d=>-((d-=1)*d*d*d-1),easeInOutQuart:d=>(d/=.5)<1?.5*d*d*d*d:-.5*((d-=2)*d*d*d-2),easeInQuint:d=>d*d*d*d*d,easeOutQuint:d=>(d-=1)*d*d*d*d+1,easeInOutQuint:d=>(d/=.5)<1?.5*d*d*d*d*d:.5*((d-=2)*d*d*d*d+2),easeInSine:d=>-Math.cos(d*ap)+1,easeOutSine:d=>Math.sin(d*ap),easeInOutSine:d=>-.5*(Math.cos(Jh*d)-1),easeInExpo:d=>d===0?0:Math.pow(2,10*(d-1)),easeOutExpo:d=>d===1?1:-Math.pow(2,-10*d)+1,easeInOutExpo:d=>L5(d)?d:d<.5?.5*Math.pow(2,10*(d*2-1)):.5*(-Math.pow(2,-10*(d*2-1))+2),easeInCirc:d=>d>=1?d:-(Math.sqrt(1-d*d)-1),easeOutCirc:d=>Math.sqrt(1-(d-=1)*d),easeInOutCirc:d=>(d/=.5)<1?-.5*(Math.sqrt(1-d*d)-1):.5*(Math.sqrt(1-(d-=2)*d)+1),easeInElastic:d=>L5(d)?d:XL(d,.075,.3),easeOutElastic:d=>L5(d)?d:JL(d,.075,.3),easeInOutElastic(d){return L5(d)?d:d<.5?.5*XL(d*2,.1125,.45):.5+.5*JL(d*2-1,.1125,.45)},easeInBack(d){return d*d*((1.70158+1)*d-1.70158)},easeOutBack(d){return(d-=1)*d*((1.70158+1)*d+1.70158)+1},easeInOutBack(d){let l=1.70158;return(d/=.5)<1?.5*(d*d*(((l*=1.525)+1)*d-l)):.5*((d-=2)*d*(((l*=1.525)+1)*d+l)+2)},easeInBounce:d=>1-M2.easeOutBounce(1-d),easeOutBounce(d){return d<1/2.75?7.5625*d*d:d<2/2.75?7.5625*(d-=1.5/2.75)*d+.75:d<2.5/2.75?7.5625*(d-=2.25/2.75)*d+.9375:7.5625*(d-=2.625/2.75)*d+.984375},easeInOutBounce:d=>d<.5?M2.easeInBounce(d*2)*.5:M2.easeOutBounce(d*2-1)*.5+.5};function sM(d){if(d&&typeof d=="object"){const l=d.toString();return l==="[object CanvasPattern]"||l==="[object CanvasGradient]"}return!1}function QL(d){return sM(d)?d:new N2(d)}function P8(d){return sM(d)?d:new N2(d).saturate(.5).darken(.1).hexString()}const Qot=["x","y","borderWidth","radius","tension"],tst=["color","borderColor","backgroundColor"];function est(d){d.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),d.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:l=>l!=="onProgress"&&l!=="onComplete"&&l!=="fn"}),d.set("animations",{colors:{type:"color",properties:tst},numbers:{type:"number",properties:Qot}}),d.describe("animations",{_fallback:"animation"}),d.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:l=>l|0}}}})}function rst(d){d.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const tP=new Map;function nst(d,l){l=l||{};const z=d+JSON.stringify(l);let j=tP.get(z);return j||(j=new Intl.NumberFormat(d,l),tP.set(z,j)),j}function lM(d,l,z){return nst(l,z).format(d)}const ist={values(d){return Xd(d)?d:""+d},numeric(d,l,z){if(d===0)return"0";const j=this.chart.options.locale;let J,mt=d;if(z.length>1){const re=Math.max(Math.abs(z[0].value),Math.abs(z[z.length-1].value));(re<1e-4||re>1e15)&&(J="scientific"),mt=ast(d,z)}const kt=FO(Math.abs(mt)),Dt=isNaN(kt)?1:Math.max(Math.min(-1*Math.floor(kt),20),0),Gt={notation:J,minimumFractionDigits:Dt,maximumFractionDigits:Dt};return Object.assign(Gt,this.options.ticks.format),lM(d,j,Gt)}};function ast(d,l){let z=l.length>3?l[2].value-l[1].value:l[1].value-l[0].value;return Math.abs(z)>=1&&d!==Math.floor(d)&&(z=d-Math.floor(d)),z}var VO={formatters:ist};function ost(d){d.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(l,z)=>z.lineWidth,tickColor:(l,z)=>z.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:VO.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),d.route("scale.ticks","color","","color"),d.route("scale.grid","color","","borderColor"),d.route("scale.border","color","","borderColor"),d.route("scale.title","color","","color"),d.describe("scale",{_fallback:!1,_scriptable:l=>!l.startsWith("before")&&!l.startsWith("after")&&l!=="callback"&&l!=="parser",_indexable:l=>l!=="borderDash"&&l!=="tickBorderDash"&&l!=="dash"}),d.describe("scales",{_fallback:"scale"}),d.describe("scale.ticks",{_scriptable:l=>l!=="backdropPadding"&&l!=="callback",_indexable:l=>l!=="backdropPadding"})}const Sy=Object.create(null),vA=Object.create(null);function S2(d,l){if(!l)return d;const z=l.split(".");for(let j=0,J=z.length;jj.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(j,J)=>P8(J.backgroundColor),this.hoverBorderColor=(j,J)=>P8(J.borderColor),this.hoverColor=(j,J)=>P8(J.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(l),this.apply(z)}set(l,z){return z8(this,l,z)}get(l){return S2(this,l)}describe(l,z){return z8(vA,l,z)}override(l,z){return z8(Sy,l,z)}route(l,z,j,J){const mt=S2(this,l),kt=S2(this,j),Dt="_"+z;Object.defineProperties(mt,{[Dt]:{value:mt[z],writable:!0},[z]:{enumerable:!0,get(){const Gt=this[Dt],re=kt[J];return Ec(Gt)?Object.assign({},re,Gt):cc(Gt,re)},set(Gt){this[Dt]=Gt}}})}apply(l){l.forEach(z=>z(this))}}var Bd=new sst({_scriptable:d=>!d.startsWith("on"),_indexable:d=>d!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[est,rst,ost]);function lst(d){return!d||Rh(d.size)||Rh(d.family)?null:(d.style?d.style+" ":"")+(d.weight?d.weight+" ":"")+d.size+"px "+d.family}function eP(d,l,z,j,J){let mt=l[J];return mt||(mt=l[J]=d.measureText(J).width,z.push(J)),mt>j&&(j=mt),j}function ly(d,l,z){const j=d.currentDevicePixelRatio,J=z!==0?Math.max(z/2,.5):0;return Math.round((l-J)*j)/j+J}function rP(d,l){!l&&!d||(l=l||d.getContext("2d"),l.save(),l.resetTransform(),l.clearRect(0,0,d.width,d.height),l.restore())}function yA(d,l,z,j){HO(d,l,z,j,null)}function HO(d,l,z,j,J){let mt,kt,Dt,Gt,re,pe,Ne,or;const _r=l.pointStyle,Fr=l.rotation,zr=l.radius;let Wr=(Fr||0)*Bot;if(_r&&typeof _r=="object"&&(mt=_r.toString(),mt==="[object HTMLImageElement]"||mt==="[object HTMLCanvasElement]")){d.save(),d.translate(z,j),d.rotate(Wr),d.drawImage(_r,-_r.width/2,-_r.height/2,_r.width,_r.height),d.restore();return}if(!(isNaN(zr)||zr<=0)){switch(d.beginPath(),_r){default:J?d.ellipse(z,j,J/2,zr,0,0,od):d.arc(z,j,zr,0,od),d.closePath();break;case"triangle":pe=J?J/2:zr,d.moveTo(z+Math.sin(Wr)*pe,j-Math.cos(Wr)*zr),Wr+=$L,d.lineTo(z+Math.sin(Wr)*pe,j-Math.cos(Wr)*zr),Wr+=$L,d.lineTo(z+Math.sin(Wr)*pe,j-Math.cos(Wr)*zr),d.closePath();break;case"rectRounded":re=zr*.516,Gt=zr-re,kt=Math.cos(Wr+sy)*Gt,Ne=Math.cos(Wr+sy)*(J?J/2-re:Gt),Dt=Math.sin(Wr+sy)*Gt,or=Math.sin(Wr+sy)*(J?J/2-re:Gt),d.arc(z-Ne,j-Dt,re,Wr-Jh,Wr-ap),d.arc(z+or,j-kt,re,Wr-ap,Wr),d.arc(z+Ne,j+Dt,re,Wr,Wr+ap),d.arc(z-or,j+kt,re,Wr+ap,Wr+Jh),d.closePath();break;case"rect":if(!Fr){Gt=Math.SQRT1_2*zr,pe=J?J/2:Gt,d.rect(z-pe,j-Gt,2*pe,2*Gt);break}Wr+=sy;case"rectRot":Ne=Math.cos(Wr)*(J?J/2:zr),kt=Math.cos(Wr)*zr,Dt=Math.sin(Wr)*zr,or=Math.sin(Wr)*(J?J/2:zr),d.moveTo(z-Ne,j-Dt),d.lineTo(z+or,j-kt),d.lineTo(z+Ne,j+Dt),d.lineTo(z-or,j+kt),d.closePath();break;case"crossRot":Wr+=sy;case"cross":Ne=Math.cos(Wr)*(J?J/2:zr),kt=Math.cos(Wr)*zr,Dt=Math.sin(Wr)*zr,or=Math.sin(Wr)*(J?J/2:zr),d.moveTo(z-Ne,j-Dt),d.lineTo(z+Ne,j+Dt),d.moveTo(z+or,j-kt),d.lineTo(z-or,j+kt);break;case"star":Ne=Math.cos(Wr)*(J?J/2:zr),kt=Math.cos(Wr)*zr,Dt=Math.sin(Wr)*zr,or=Math.sin(Wr)*(J?J/2:zr),d.moveTo(z-Ne,j-Dt),d.lineTo(z+Ne,j+Dt),d.moveTo(z+or,j-kt),d.lineTo(z-or,j+kt),Wr+=sy,Ne=Math.cos(Wr)*(J?J/2:zr),kt=Math.cos(Wr)*zr,Dt=Math.sin(Wr)*zr,or=Math.sin(Wr)*(J?J/2:zr),d.moveTo(z-Ne,j-Dt),d.lineTo(z+Ne,j+Dt),d.moveTo(z+or,j-kt),d.lineTo(z-or,j+kt);break;case"line":kt=J?J/2:Math.cos(Wr)*zr,Dt=Math.sin(Wr)*zr,d.moveTo(z-kt,j-Dt),d.lineTo(z+kt,j+Dt);break;case"dash":d.moveTo(z,j),d.lineTo(z+Math.cos(Wr)*(J?J/2:zr),j+Math.sin(Wr)*zr);break;case!1:d.closePath();break}d.fill(),l.borderWidth>0&&d.stroke()}}function W2(d,l,z){return z=z||.5,!l||d&&d.x>l.left-z&&d.xl.top-z&&d.y0&&mt.strokeColor!=="";let Gt,re;for(d.save(),d.font=J.string,hst(d,mt),Gt=0;Gt+d||0;function uM(d,l){const z={},j=Ec(l),J=j?Object.keys(l):l,mt=Ec(d)?j?kt=>cc(d[kt],d[l[kt]]):kt=>d[kt]:()=>d;for(const kt of J)z[kt]=vst(mt(kt));return z}function WO(d){return uM(d,{top:"y",right:"x",bottom:"y",left:"x"})}function s_(d){return uM(d,["topLeft","topRight","bottomLeft","bottomRight"])}function fm(d){const l=WO(d);return l.width=l.left+l.right,l.height=l.top+l.bottom,l}function Jp(d,l){d=d||{},l=l||Bd.font;let z=cc(d.size,l.size);typeof z=="string"&&(z=parseInt(z,10));let j=cc(d.style,l.style);j&&!(""+j).match(mst)&&(console.warn('Invalid font style specified: "'+j+'"'),j=void 0);const J={family:cc(d.family,l.family),lineHeight:gst(cc(d.lineHeight,l.lineHeight),z),size:z,style:j,weight:cc(d.weight,l.weight),string:""};return J.string=lst(J),J}function P5(d,l,z,j){let J,mt,kt;for(J=0,mt=d.length;Jz&&Dt===0?0:Dt+Gt;return{min:kt(j,-Math.abs(mt)),max:kt(J,mt)}}function Cy(d,l){return Object.assign(Object.create(d),l)}function cM(d,l=[""],z,j,J=()=>d[0]){const mt=z||d;typeof j>"u"&&(j=GO("_fallback",d));const kt={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:d,_rootScopes:mt,_fallback:j,_getTarget:J,override:Dt=>cM([Dt,...d],l,mt,j)};return new Proxy(kt,{deleteProperty(Dt,Gt){return delete Dt[Gt],delete Dt._keys,delete d[0][Gt],!0},get(Dt,Gt){return ZO(Dt,Gt,()=>Mst(Gt,l,d,Dt))},getOwnPropertyDescriptor(Dt,Gt){return Reflect.getOwnPropertyDescriptor(Dt._scopes[0],Gt)},getPrototypeOf(){return Reflect.getPrototypeOf(d[0])},has(Dt,Gt){return iP(Dt).includes(Gt)},ownKeys(Dt){return iP(Dt)},set(Dt,Gt,re){const pe=Dt._storage||(Dt._storage=J());return Dt[Gt]=pe[Gt]=re,delete Dt._keys,!0}})}function m_(d,l,z,j){const J={_cacheable:!1,_proxy:d,_context:l,_subProxy:z,_stack:new Set,_descriptors:qO(d,j),setContext:mt=>m_(d,mt,z,j),override:mt=>m_(d.override(mt),l,z,j)};return new Proxy(J,{deleteProperty(mt,kt){return delete mt[kt],delete d[kt],!0},get(mt,kt,Dt){return ZO(mt,kt,()=>_st(mt,kt,Dt))},getOwnPropertyDescriptor(mt,kt){return mt._descriptors.allKeys?Reflect.has(d,kt)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(d,kt)},getPrototypeOf(){return Reflect.getPrototypeOf(d)},has(mt,kt){return Reflect.has(d,kt)},ownKeys(){return Reflect.ownKeys(d)},set(mt,kt,Dt){return d[kt]=Dt,delete mt[kt],!0}})}function qO(d,l={scriptable:!0,indexable:!0}){const{_scriptable:z=l.scriptable,_indexable:j=l.indexable,_allKeys:J=l.allKeys}=d;return{allKeys:J,scriptable:z,indexable:j,isScriptable:v1(z)?z:()=>z,isIndexable:v1(j)?j:()=>j}}const xst=(d,l)=>d?d+iM(l):l,hM=(d,l)=>Ec(l)&&d!=="adapters"&&(Object.getPrototypeOf(l)===null||l.constructor===Object);function ZO(d,l,z){if(Object.prototype.hasOwnProperty.call(d,l)||l==="constructor")return d[l];const j=z();return d[l]=j,j}function _st(d,l,z){const{_proxy:j,_context:J,_subProxy:mt,_descriptors:kt}=d;let Dt=j[l];return v1(Dt)&&kt.isScriptable(l)&&(Dt=bst(l,Dt,d,z)),Xd(Dt)&&Dt.length&&(Dt=wst(l,Dt,d,kt.isIndexable)),hM(l,Dt)&&(Dt=m_(Dt,J,mt&&mt[l],kt)),Dt}function bst(d,l,z,j){const{_proxy:J,_context:mt,_subProxy:kt,_stack:Dt}=z;if(Dt.has(d))throw new Error("Recursion detected: "+Array.from(Dt).join("->")+"->"+d);Dt.add(d);let Gt=l(mt,kt||j);return Dt.delete(d),hM(d,Gt)&&(Gt=fM(J._scopes,J,d,Gt)),Gt}function wst(d,l,z,j){const{_proxy:J,_context:mt,_subProxy:kt,_descriptors:Dt}=z;if(typeof mt.index<"u"&&j(d))return l[mt.index%l.length];if(Ec(l[0])){const Gt=l,re=J._scopes.filter(pe=>pe!==Gt);l=[];for(const pe of Gt){const Ne=fM(re,J,d,pe);l.push(m_(Ne,mt,kt&&kt[d],Dt))}}return l}function $O(d,l,z){return v1(d)?d(l,z):d}const kst=(d,l)=>d===!0?l:typeof d=="string"?My(l,d):void 0;function Tst(d,l,z,j,J){for(const mt of l){const kt=kst(z,mt);if(kt){d.add(kt);const Dt=$O(kt._fallback,z,J);if(typeof Dt<"u"&&Dt!==z&&Dt!==j)return Dt}else if(kt===!1&&typeof j<"u"&&z!==j)return null}return!1}function fM(d,l,z,j){const J=l._rootScopes,mt=$O(l._fallback,z,j),kt=[...d,...J],Dt=new Set;Dt.add(j);let Gt=nP(Dt,kt,z,mt||z,j);return Gt===null||typeof mt<"u"&&mt!==z&&(Gt=nP(Dt,kt,mt,Gt,j),Gt===null)?!1:cM(Array.from(Dt),[""],J,mt,()=>Ast(l,z,j))}function nP(d,l,z,j,J){for(;z;)z=Tst(d,l,z,j,J);return z}function Ast(d,l,z){const j=d._getTarget();l in j||(j[l]={});const J=j[l];return Xd(J)&&Ec(z)?z:J||{}}function Mst(d,l,z,j){let J;for(const mt of l)if(J=GO(xst(mt,d),z),typeof J<"u")return hM(d,J)?fM(z,j,d,J):J}function GO(d,l){for(const z of l){if(!z)continue;const j=z[d];if(typeof j<"u")return j}}function iP(d){let l=d._keys;return l||(l=d._keys=Sst(d._scopes)),l}function Sst(d){const l=new Set;for(const z of d)for(const j of Object.keys(z).filter(J=>!J.startsWith("_")))l.add(j);return Array.from(l)}const Est=Number.EPSILON||1e-14,g_=(d,l)=>ld==="x"?"y":"x";function Cst(d,l,z,j){const J=d.skip?l:d,mt=l,kt=z.skip?l:z,Dt=gA(mt,J),Gt=gA(kt,mt);let re=Dt/(Dt+Gt),pe=Gt/(Dt+Gt);re=isNaN(re)?0:re,pe=isNaN(pe)?0:pe;const Ne=j*re,or=j*pe;return{previous:{x:mt.x-Ne*(kt.x-J.x),y:mt.y-Ne*(kt.y-J.y)},next:{x:mt.x+or*(kt.x-J.x),y:mt.y+or*(kt.y-J.y)}}}function Lst(d,l,z){const j=d.length;let J,mt,kt,Dt,Gt,re=g_(d,0);for(let pe=0;pe!re.skip)),l.cubicInterpolationMode==="monotone")zst(d,J);else{let re=j?d[d.length-1]:d[0];for(mt=0,kt=d.length;mtd.ownerDocument.defaultView.getComputedStyle(d,null);function Dst(d,l){return H4(d).getPropertyValue(l)}const Fst=["top","right","bottom","left"];function wy(d,l,z){const j={};z=z?"-"+z:"";for(let J=0;J<4;J++){const mt=Fst[J];j[mt]=parseFloat(d[l+"-"+mt+z])||0}return j.width=j.left+j.right,j.height=j.top+j.bottom,j}const Rst=(d,l,z)=>(d>0||l>0)&&(!z||!z.shadowRoot);function Bst(d,l){const z=d.touches,j=z&&z.length?z[0]:d,{offsetX:J,offsetY:mt}=j;let kt=!1,Dt,Gt;if(Rst(J,mt,d.target))Dt=J,Gt=mt;else{const re=l.getBoundingClientRect();Dt=j.clientX-re.left,Gt=j.clientY-re.top,kt=!0}return{x:Dt,y:Gt,box:kt}}function hy(d,l){if("native"in d)return d;const{canvas:z,currentDevicePixelRatio:j}=l,J=H4(z),mt=J.boxSizing==="border-box",kt=wy(J,"padding"),Dt=wy(J,"border","width"),{x:Gt,y:re,box:pe}=Bst(d,z),Ne=kt.left+(pe&&Dt.left),or=kt.top+(pe&&Dt.top);let{width:_r,height:Fr}=l;return mt&&(_r-=kt.width+Dt.width,Fr-=kt.height+Dt.height),{x:Math.round((Gt-Ne)/_r*z.width/j),y:Math.round((re-or)/Fr*z.height/j)}}function Nst(d,l,z){let j,J;if(l===void 0||z===void 0){const mt=d&&pM(d);if(!mt)l=d.clientWidth,z=d.clientHeight;else{const kt=mt.getBoundingClientRect(),Dt=H4(mt),Gt=wy(Dt,"border","width"),re=wy(Dt,"padding");l=kt.width-re.width-Gt.width,z=kt.height-re.height-Gt.height,j=m4(Dt.maxWidth,mt,"clientWidth"),J=m4(Dt.maxHeight,mt,"clientHeight")}}return{width:l,height:z,maxWidth:j||d4,maxHeight:J||d4}}const c1=d=>Math.round(d*10)/10;function jst(d,l,z,j){const J=H4(d),mt=wy(J,"margin"),kt=m4(J.maxWidth,d,"clientWidth")||d4,Dt=m4(J.maxHeight,d,"clientHeight")||d4,Gt=Nst(d,l,z);let{width:re,height:pe}=Gt;if(J.boxSizing==="content-box"){const or=wy(J,"border","width"),_r=wy(J,"padding");re-=_r.width+or.width,pe-=_r.height+or.height}return re=Math.max(0,re-mt.width),pe=Math.max(0,j?re/j:pe-mt.height),re=c1(Math.min(re,kt,Gt.maxWidth)),pe=c1(Math.min(pe,Dt,Gt.maxHeight)),re&&!pe&&(pe=c1(re/2)),(l!==void 0||z!==void 0)&&j&&Gt.height&&pe>Gt.height&&(pe=Gt.height,re=c1(Math.floor(pe*j))),{width:re,height:pe}}function aP(d,l,z){const j=l||1,J=c1(d.height*j),mt=c1(d.width*j);d.height=c1(d.height),d.width=c1(d.width);const kt=d.canvas;return kt.style&&(z||!kt.style.height&&!kt.style.width)&&(kt.style.height=`${d.height}px`,kt.style.width=`${d.width}px`),d.currentDevicePixelRatio!==j||kt.height!==J||kt.width!==mt?(d.currentDevicePixelRatio=j,kt.height=J,kt.width=mt,d.ctx.setTransform(j,0,0,j,0,0),!0):!1}const Ust=function(){let d=!1;try{const l={get passive(){return d=!0,!1}};dM()&&(window.addEventListener("test",null,l),window.removeEventListener("test",null,l))}catch{}return d}();function oP(d,l){const z=Dst(d,l),j=z&&z.match(/^(\d+)(\.\d+)?px$/);return j?+j[1]:void 0}function fy(d,l,z,j){return{x:d.x+z*(l.x-d.x),y:d.y+z*(l.y-d.y)}}function Vst(d,l,z,j){return{x:d.x+z*(l.x-d.x),y:j==="middle"?z<.5?d.y:l.y:j==="after"?z<1?d.y:l.y:z>0?l.y:d.y}}function Hst(d,l,z,j){const J={x:d.cp2x,y:d.cp2y},mt={x:l.cp1x,y:l.cp1y},kt=fy(d,J,z),Dt=fy(J,mt,z),Gt=fy(mt,l,z),re=fy(kt,Dt,z),pe=fy(Dt,Gt,z);return fy(re,pe,z)}const Wst=function(d,l){return{x(z){return d+d+l-z},setWidth(z){l=z},textAlign(z){return z==="center"?z:z==="right"?"left":"right"},xPlus(z,j){return z-j},leftForLtr(z,j){return z-j}}},qst=function(){return{x(d){return d},setWidth(d){},textAlign(d){return d},xPlus(d,l){return d+l},leftForLtr(d,l){return d}}};function l_(d,l,z){return d?Wst(l,z):qst()}function KO(d,l){let z,j;(l==="ltr"||l==="rtl")&&(z=d.canvas.style,j=[z.getPropertyValue("direction"),z.getPropertyPriority("direction")],z.setProperty("direction",l,"important"),d.prevTextDirection=j)}function XO(d,l){l!==void 0&&(delete d.prevTextDirection,d.canvas.style.setProperty("direction",l[0],l[1]))}function JO(d){return d==="angle"?{between:H2,compare:Wot,normalize:q0}:{between:ev,compare:(l,z)=>l-z,normalize:l=>l}}function sP({start:d,end:l,count:z,loop:j,style:J}){return{start:d%z,end:l%z,loop:j&&(l-d+1)%z===0,style:J}}function Zst(d,l,z){const{property:j,start:J,end:mt}=z,{between:kt,normalize:Dt}=JO(j),Gt=l.length;let{start:re,end:pe,loop:Ne}=d,or,_r;if(Ne){for(re+=Gt,pe+=Gt,or=0,_r=Gt;or<_r&&kt(Dt(l[re%Gt][j]),J,mt);++or)re--,pe--;re%=Gt,pe%=Gt}return peGt(J,kn,An)&&Dt(J,kn)!==0,jn=()=>Dt(mt,An)===0||Gt(mt,kn,An),ai=()=>zr||ei(),Qi=()=>!zr||jn();for(let Gi=pe,un=pe;Gi<=Ne;++Gi)Ft=l[Gi%kt],!Ft.skip&&(An=re(Ft[j]),An!==kn&&(zr=Gt(An,J,mt),Wr===null&&ai()&&(Wr=Dt(An,J)===0?Gi:un),Wr!==null&&Qi()&&(Fr.push(sP({start:Wr,end:Gi,loop:or,count:kt,style:_r})),Wr=null),un=Gi,kn=An));return Wr!==null&&Fr.push(sP({start:Wr,end:Ne,loop:or,count:kt,style:_r})),Fr}function tD(d,l){const z=[],j=d.segments;for(let J=0;JJ&&d[mt%l].skip;)mt--;return mt%=l,{start:J,end:mt}}function Gst(d,l,z,j){const J=d.length,mt=[];let kt=l,Dt=d[l],Gt;for(Gt=l+1;Gt<=z;++Gt){const re=d[Gt%J];re.skip||re.stop?Dt.skip||(j=!1,mt.push({start:l%J,end:(Gt-1)%J,loop:j}),l=kt=re.stop?Gt:null):(kt=Gt,Dt.skip&&(l=Gt)),Dt=re}return kt!==null&&mt.push({start:l%J,end:kt%J,loop:j}),mt}function Yst(d,l){const z=d.points,j=d.options.spanGaps,J=z.length;if(!J)return[];const mt=!!d._loop,{start:kt,end:Dt}=$st(z,J,mt,j);if(j===!0)return lP(d,[{start:kt,end:Dt,loop:mt}],z,l);const Gt=DtDt({chart:l,initial:z.initial,numSteps:kt,currentStep:Math.min(j-z.start,kt)}))}_refresh(){this._request||(this._running=!0,this._request=jO.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(l=Date.now()){let z=0;this._charts.forEach((j,J)=>{if(!j.running||!j.items.length)return;const mt=j.items;let kt=mt.length-1,Dt=!1,Gt;for(;kt>=0;--kt)Gt=mt[kt],Gt._active?(Gt._total>j.duration&&(j.duration=Gt._total),Gt.tick(l),Dt=!0):(mt[kt]=mt[mt.length-1],mt.pop());Dt&&(J.draw(),this._notify(J,j,l,"progress")),mt.length||(j.running=!1,this._notify(J,j,l,"complete"),j.initial=!1),z+=mt.length}),this._lastDate=l,z===0&&(this._running=!1)}_getAnims(l){const z=this._charts;let j=z.get(l);return j||(j={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},z.set(l,j)),j}listen(l,z,j){this._getAnims(l).listeners[z].push(j)}add(l,z){!z||!z.length||this._getAnims(l).items.push(...z)}has(l){return this._getAnims(l).items.length>0}start(l){const z=this._charts.get(l);z&&(z.running=!0,z.start=Date.now(),z.duration=z.items.reduce((j,J)=>Math.max(j,J._duration),0),this._refresh())}running(l){if(!this._running)return!1;const z=this._charts.get(l);return!(!z||!z.running||!z.items.length)}stop(l){const z=this._charts.get(l);if(!z||!z.items.length)return;const j=z.items;let J=j.length-1;for(;J>=0;--J)j[J].cancel();z.items=[],this._notify(l,z,Date.now(),"complete")}remove(l){return this._charts.delete(l)}}var Gg=new Xst;const cP="transparent",Jst={boolean(d,l,z){return z>.5?l:d},color(d,l,z){const j=QL(d||cP),J=j.valid&&QL(l||cP);return J&&J.valid?J.mix(j,z).hexString():l},number(d,l,z){return d+(l-d)*z}};class Qst{constructor(l,z,j,J){const mt=z[j];J=P5([l.to,J,mt,l.from]);const kt=P5([l.from,mt,J]);this._active=!0,this._fn=l.fn||Jst[l.type||typeof kt],this._easing=M2[l.easing]||M2.linear,this._start=Math.floor(Date.now()+(l.delay||0)),this._duration=this._total=Math.floor(l.duration),this._loop=!!l.loop,this._target=z,this._prop=j,this._from=kt,this._to=J,this._promises=void 0}active(){return this._active}update(l,z,j){if(this._active){this._notify(!1);const J=this._target[this._prop],mt=j-this._start,kt=this._duration-mt;this._start=j,this._duration=Math.floor(Math.max(kt,l.duration)),this._total+=mt,this._loop=!!l.loop,this._to=P5([l.to,z,J,l.from]),this._from=P5([l.from,J,z])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(l){const z=l-this._start,j=this._duration,J=this._prop,mt=this._from,kt=this._loop,Dt=this._to;let Gt;if(this._active=mt!==Dt&&(kt||z1?2-Gt:Gt,Gt=this._easing(Math.min(1,Math.max(0,Gt))),this._target[J]=this._fn(mt,Dt,Gt)}wait(){const l=this._promises||(this._promises=[]);return new Promise((z,j)=>{l.push({res:z,rej:j})})}_notify(l){const z=l?"res":"rej",j=this._promises||[];for(let J=0;J{const mt=l[J];if(!Ec(mt))return;const kt={};for(const Dt of z)kt[Dt]=mt[Dt];(Xd(mt.properties)&&mt.properties||[J]).forEach(Dt=>{(Dt===J||!j.has(Dt))&&j.set(Dt,kt)})})}_animateOptions(l,z){const j=z.options,J=elt(l,j);if(!J)return[];const mt=this._createAnimations(J,j);return j.$shared&&tlt(l.options.$animations,j).then(()=>{l.options=j},()=>{}),mt}_createAnimations(l,z){const j=this._properties,J=[],mt=l.$animations||(l.$animations={}),kt=Object.keys(z),Dt=Date.now();let Gt;for(Gt=kt.length-1;Gt>=0;--Gt){const re=kt[Gt];if(re.charAt(0)==="$")continue;if(re==="options"){J.push(...this._animateOptions(l,z));continue}const pe=z[re];let Ne=mt[re];const or=j.get(re);if(Ne)if(or&&Ne.active()){Ne.update(or,pe,Dt);continue}else Ne.cancel();if(!or||!or.duration){l[re]=pe;continue}mt[re]=Ne=new Qst(or,l,re,pe),J.push(Ne)}return J}update(l,z){if(this._properties.size===0){Object.assign(l,z);return}const j=this._createAnimations(l,z);if(j.length)return Gg.add(this._chart,j),!0}}function tlt(d,l){const z=[],j=Object.keys(l);for(let J=0;J0||!z&&mt<0)return J.index}return null}function pP(d,l){const{chart:z,_cachedMeta:j}=d,J=z._stacks||(z._stacks={}),{iScale:mt,vScale:kt,index:Dt}=j,Gt=mt.axis,re=kt.axis,pe=alt(mt,kt,j),Ne=l.length;let or;for(let _r=0;_rz[j].axis===l).shift()}function llt(d,l){return Cy(d,{active:!1,dataset:void 0,datasetIndex:l,index:l,mode:"default",type:"dataset"})}function ult(d,l,z){return Cy(d,{active:!1,dataIndex:l,parsed:void 0,raw:void 0,element:z,index:l,mode:"default",type:"data"})}function e2(d,l){const z=d.controller.index,j=d.vScale&&d.vScale.axis;if(j){l=l||d._parsed;for(const J of l){const mt=J._stacks;if(!mt||mt[j]===void 0||mt[j][z]===void 0)return;delete mt[j][z],mt[j]._visualValues!==void 0&&mt[j]._visualValues[z]!==void 0&&delete mt[j]._visualValues[z]}}}const D8=d=>d==="reset"||d==="none",mP=(d,l)=>l?d:Object.assign({},d),clt=(d,l,z)=>d&&!l.hidden&&l._stacked&&{keys:nD(z,!0),values:null};class W4{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(l,z){this.chart=l,this._ctx=l.ctx,this.index=z,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const l=this._cachedMeta;this.configure(),this.linkScales(),l._stacked=I8(l.vScale,l),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(l){this.index!==l&&e2(this._cachedMeta),this.index=l}linkScales(){const l=this.chart,z=this._cachedMeta,j=this.getDataset(),J=(Ne,or,_r,Fr)=>Ne==="x"?or:Ne==="r"?Fr:_r,mt=z.xAxisID=cc(j.xAxisID,O8(l,"x")),kt=z.yAxisID=cc(j.yAxisID,O8(l,"y")),Dt=z.rAxisID=cc(j.rAxisID,O8(l,"r")),Gt=z.indexAxis,re=z.iAxisID=J(Gt,mt,kt,Dt),pe=z.vAxisID=J(Gt,kt,mt,Dt);z.xScale=this.getScaleForId(mt),z.yScale=this.getScaleForId(kt),z.rScale=this.getScaleForId(Dt),z.iScale=this.getScaleForId(re),z.vScale=this.getScaleForId(pe)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(l){return this.chart.scales[l]}_getOtherScale(l){const z=this._cachedMeta;return l===z.iScale?z.vScale:z.iScale}reset(){this._update("reset")}_destroy(){const l=this._cachedMeta;this._data&&KL(this._data,this),l._stacked&&e2(l)}_dataCheck(){const l=this.getDataset(),z=l.data||(l.data=[]),j=this._data;if(Ec(z)){const J=this._cachedMeta;this._data=ilt(z,J)}else if(j!==z){if(j){KL(j,this);const J=this._cachedMeta;e2(J),J._parsed=[]}z&&Object.isExtensible(z)&&Zot(z,this),this._syncList=[],this._data=z}}addElements(){const l=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(l.dataset=new this.datasetElementType)}buildOrUpdateElements(l){const z=this._cachedMeta,j=this.getDataset();let J=!1;this._dataCheck();const mt=z._stacked;z._stacked=I8(z.vScale,z),z.stack!==j.stack&&(J=!0,e2(z),z.stack=j.stack),this._resyncElements(l),(J||mt!==z._stacked)&&(pP(this,z._parsed),z._stacked=I8(z.vScale,z))}configure(){const l=this.chart.config,z=l.datasetScopeKeys(this._type),j=l.getOptionScopes(this.getDataset(),z,!0);this.options=l.createResolver(j,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(l,z){const{_cachedMeta:j,_data:J}=this,{iScale:mt,_stacked:kt}=j,Dt=mt.axis;let Gt=l===0&&z===J.length?!0:j._sorted,re=l>0&&j._parsed[l-1],pe,Ne,or;if(this._parsing===!1)j._parsed=J,j._sorted=!0,or=J;else{Xd(J[l])?or=this.parseArrayData(j,J,l,z):Ec(J[l])?or=this.parseObjectData(j,J,l,z):or=this.parsePrimitiveData(j,J,l,z);const _r=()=>Ne[Dt]===null||re&&Ne[Dt]zr||Ne=0;--or)if(!Fr()){this.updateRangeFromParsed(re,l,_r,Gt);break}}return re}getAllParsedValues(l){const z=this._cachedMeta._parsed,j=[];let J,mt,kt;for(J=0,mt=z.length;J=0&&lthis.getContext(j,J,z),zr=re.resolveNamedOptions(or,_r,Fr,Ne);return zr.$shared&&(zr.$shared=Gt,mt[kt]=Object.freeze(mP(zr,Gt))),zr}_resolveAnimations(l,z,j){const J=this.chart,mt=this._cachedDataOpts,kt=`animation-${z}`,Dt=mt[kt];if(Dt)return Dt;let Gt;if(J.options.animation!==!1){const pe=this.chart.config,Ne=pe.datasetAnimationScopeKeys(this._type,z),or=pe.getOptionScopes(this.getDataset(),Ne);Gt=pe.createResolver(or,this.getContext(l,j,z))}const re=new rD(J,Gt&&Gt.animations);return Gt&&Gt._cacheable&&(mt[kt]=Object.freeze(re)),re}getSharedOptions(l){if(l.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},l))}includeOptions(l,z){return!z||D8(l)||this.chart._animationsDisabled}_getSharedOptions(l,z){const j=this.resolveDataElementOptions(l,z),J=this._sharedOptions,mt=this.getSharedOptions(j),kt=this.includeOptions(z,mt)||mt!==J;return this.updateSharedOptions(mt,z,j),{sharedOptions:mt,includeOptions:kt}}updateElement(l,z,j,J){D8(J)?Object.assign(l,j):this._resolveAnimations(z,J).update(l,j)}updateSharedOptions(l,z,j){l&&!D8(z)&&this._resolveAnimations(void 0,z).update(l,j)}_setStyle(l,z,j,J){l.active=J;const mt=this.getStyle(z,J);this._resolveAnimations(z,j,J).update(l,{options:!J&&this.getSharedOptions(mt)||mt})}removeHoverStyle(l,z,j){this._setStyle(l,j,"active",!1)}setHoverStyle(l,z,j){this._setStyle(l,j,"active",!0)}_removeDatasetHoverStyle(){const l=this._cachedMeta.dataset;l&&this._setStyle(l,void 0,"active",!1)}_setDatasetHoverStyle(){const l=this._cachedMeta.dataset;l&&this._setStyle(l,void 0,"active",!0)}_resyncElements(l){const z=this._data,j=this._cachedMeta.data;for(const[Dt,Gt,re]of this._syncList)this[Dt](Gt,re);this._syncList=[];const J=j.length,mt=z.length,kt=Math.min(mt,J);kt&&this.parse(0,kt),mt>J?this._insertElements(J,mt-J,l):mt{for(re.length+=z,Dt=re.length-1;Dt>=kt;Dt--)re[Dt]=re[Dt-z]};for(Gt(mt),Dt=l;DtJ-mt))}return d._cache.$bar}function flt(d){const l=d.iScale,z=hlt(l,d.type);let j=l._length,J,mt,kt,Dt;const Gt=()=>{kt===32767||kt===-32768||(U2(Dt)&&(j=Math.min(j,Math.abs(kt-Dt)||j)),Dt=kt)};for(J=0,mt=z.length;J0?J[d-1]:null,Dt=dMath.abs(Dt)&&(Gt=Dt,re=kt),l[z.axis]=re,l._custom={barStart:Gt,barEnd:re,start:J,end:mt,min:kt,max:Dt}}function iD(d,l,z,j){return Xd(d)?mlt(d,l,z,j):l[z.axis]=z.parse(d,j),l}function gP(d,l,z,j){const J=d.iScale,mt=d.vScale,kt=J.getLabels(),Dt=J===mt,Gt=[];let re,pe,Ne,or;for(re=z,pe=z+j;re=z?1:-1)}function vlt(d){let l,z,j,J,mt;return d.horizontal?(l=d.base>d.x,z="left",j="right"):(l=d.basepe.controller.options.grouped),mt=j.options.stacked,kt=[],Dt=this._cachedMeta.controller.getParsed(z),Gt=Dt&&Dt[j.axis],re=pe=>{const Ne=pe._parsed.find(_r=>_r[j.axis]===Gt),or=Ne&&Ne[pe.vScale.axis];if(Rh(or)||isNaN(or))return!0};for(const pe of J)if(!(z!==void 0&&re(pe))&&((mt===!1||kt.indexOf(pe.stack)===-1||mt===void 0&&pe.stack===void 0)&&kt.push(pe.stack),pe.index===l))break;return kt.length||kt.push(void 0),kt}_getStackCount(l){return this._getStacks(void 0,l).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const l=this.chart.scales,z=this.chart.options.indexAxis;return Object.keys(l).filter(j=>l[j].axis===z).shift()}_getAxis(){const l={},z=this.getFirstScaleIdForIndexAxis();for(const j of this.chart.data.datasets)l[cc(this.chart.options.indexAxis==="x"?j.xAxisID:j.yAxisID,z)]=!0;return Object.keys(l)}_getStackIndex(l,z,j){const J=this._getStacks(l,j),mt=z!==void 0?J.indexOf(z):-1;return mt===-1?J.length-1:mt}_getRuler(){const l=this.options,z=this._cachedMeta,j=z.iScale,J=[];let mt,kt;for(mt=0,kt=z.data.length;mtH2(kn,Dt,Gt,!0)?1:Math.max(ei,ei*z,jn,jn*z),Fr=(kn,ei,jn)=>H2(kn,Dt,Gt,!0)?-1:Math.min(ei,ei*z,jn,jn*z),zr=_r(0,re,Ne),Wr=_r(ap,pe,or),An=Fr(Jh,re,Ne),Ft=Fr(Jh+ap,pe,or);j=(zr-An)/2,J=(Wr-Ft)/2,mt=-(zr+An)/2,kt=-(Wr+Ft)/2}return{ratioX:j,ratioY:J,offsetX:mt,offsetY:kt}}class klt extends W4{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:l=>l!=="spacing",_indexable:l=>l!=="spacing"&&!l.startsWith("borderDash")&&!l.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(l){const z=l.data,{labels:{pointStyle:j,textAlign:J,color:mt,useBorderRadius:kt,borderRadius:Dt}}=l.legend.options;return z.labels.length&&z.datasets.length?z.labels.map((Gt,re)=>{const Ne=l.getDatasetMeta(0).controller.getStyle(re);return{text:Gt,fillStyle:Ne.backgroundColor,fontColor:mt,hidden:!l.getDataVisibility(re),lineDash:Ne.borderDash,lineDashOffset:Ne.borderDashOffset,lineJoin:Ne.borderJoinStyle,lineWidth:Ne.borderWidth,strokeStyle:Ne.borderColor,textAlign:J,pointStyle:j,borderRadius:kt&&(Dt||Ne.borderRadius),index:re}}):[]}},onClick(l,z,j){j.chart.toggleDataVisibility(z.index),j.chart.update()}}}};constructor(l,z){super(l,z),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(l,z){const j=this.getDataset().data,J=this._cachedMeta;if(this._parsing===!1)J._parsed=j;else{let mt=Gt=>+j[Gt];if(Ec(j[l])){const{key:Gt="value"}=this._parsing;mt=re=>+My(j[re],Gt)}let kt,Dt;for(kt=l,Dt=l+z;kt0&&!isNaN(l)?od*(Math.abs(l)/z):0}getLabelAndValue(l){const z=this._cachedMeta,j=this.chart,J=j.data.labels||[],mt=lM(z._parsed[l],j.options.locale);return{label:J[l]||"",value:mt}}getMaxBorderWidth(l){let z=0;const j=this.chart;let J,mt,kt,Dt,Gt;if(!l){for(J=0,mt=j.data.datasets.length;J0&&this.getParsed(z-1);for(let jn=0;jn=Ft){Qi.skip=!0;continue}const Gi=this.getParsed(jn),un=Rh(Gi[_r]),ia=Qi[or]=kt.getPixelForValue(Gi[or],jn),fa=Qi[_r]=mt||un?Dt.getBasePixel():Dt.getPixelForValue(Gt?this.applyStack(Dt,Gi,Gt):Gi[_r],jn);Qi.skip=isNaN(ia)||isNaN(fa)||un,Qi.stop=jn>0&&Math.abs(Gi[or]-ei[or])>Wr,zr&&(Qi.parsed=Gi,Qi.raw=re.data[jn]),Ne&&(Qi.options=pe||this.resolveDataElementOptions(jn,ai.active?"active":J)),An||this.updateElement(ai,jn,Qi,J),ei=Gi}}getMaxOverflow(){const l=this._cachedMeta,z=l.dataset,j=z.options&&z.options.borderWidth||0,J=l.data||[];if(!J.length)return j;const mt=J[0].size(this.resolveDataElementOptions(0)),kt=J[J.length-1].size(this.resolveDataElementOptions(J.length-1));return Math.max(j,mt,kt)/2}draw(){const l=this._cachedMeta;l.dataset.updateControlPoints(this.chart.chartArea,l.iScale.axis),super.draw()}}function uy(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class mM{static override(l){Object.assign(mM.prototype,l)}options;constructor(l){this.options=l||{}}init(){}formats(){return uy()}parse(){return uy()}format(){return uy()}add(){return uy()}diff(){return uy()}startOf(){return uy()}endOf(){return uy()}}var aD={_date:mM};function Alt(d,l,z,j){const{controller:J,data:mt,_sorted:kt}=d,Dt=J._cachedMeta.iScale,Gt=d.dataset&&d.dataset.options?d.dataset.options.spanGaps:null;if(Dt&&l===Dt.axis&&l!=="r"&&kt&&mt.length){const re=Dt._reversePixels?Wot:yy;if(j){if(J._sharedOptions){const pe=mt[0],Ne=typeof pe.getRange=="function"&&pe.getRange(l);if(Ne){const or=re(mt,l,z-Ne),_r=re(mt,l,z+Ne);return{lo:or.lo,hi:_r.hi}}}}else{const pe=re(mt,l,z);if(Gt){const{vScale:Ne}=J._cachedMeta,{_parsed:or}=d,_r=or.slice(0,pe.lo+1).reverse().findIndex(zr=>!Rh(zr[Ne.axis]));pe.lo-=Math.max(0,_r);const Fr=or.slice(pe.hi).findIndex(zr=>!Rh(zr[Ne.axis]));pe.hi+=Math.max(0,Fr)}return pe}}return{lo:0,hi:mt.length-1}}function q4(d,l,z,j,J){const mt=d.getSortedVisibleDatasetMetas(),kt=z[l];for(let Dt=0,Gt=mt.length;Dt{Gt[kt]&&Gt[kt](l[z],J)&&(mt.push({element:Gt,datasetIndex:re,index:pe}),Dt=Dt||Gt.inRange(l.x,l.y,J))}),j&&!Dt?[]:mt}var Clt={modes:{index(d,l,z,j){const J=hy(l,d),mt=z.axis||"x",kt=z.includeInvisible||!1,Dt=z.intersect?R8(d,J,mt,j,kt):B8(d,J,mt,!1,j,kt),Gt=[];return Dt.length?(d.getSortedVisibleDatasetMetas().forEach(re=>{const pe=Dt[0].index,Ne=re.data[pe];Ne&&!Ne.skip&&Gt.push({element:Ne,datasetIndex:re.index,index:pe})}),Gt):[]},dataset(d,l,z,j){const J=hy(l,d),mt=z.axis||"xy",kt=z.includeInvisible||!1;let Dt=z.intersect?R8(d,J,mt,j,kt):B8(d,J,mt,!1,j,kt);if(Dt.length>0){const Gt=Dt[0].datasetIndex,re=d.getDatasetMeta(Gt).data;Dt=[];for(let pe=0;pez.pos===l)}function _P(d,l){return d.filter(z=>oD.indexOf(z.pos)===-1&&z.box.axis===l)}function n2(d,l){return d.sort((z,j)=>{const J=l?j:z,mt=l?z:j;return J.weight===mt.weight?J.index-mt.index:J.weight-mt.weight})}function Llt(d){const l=[];let z,j,J,mt,kt,Dt;for(z=0,j=(d||[]).length;zre.box.fullSize),!0),j=n2(r2(l,"left"),!0),J=n2(r2(l,"right")),mt=n2(r2(l,"top"),!0),kt=n2(r2(l,"bottom")),Dt=_P(l,"x"),Gt=_P(l,"y");return{fullSize:z,leftAndTop:j.concat(mt),rightAndBottom:J.concat(Gt).concat(kt).concat(Dt),chartArea:r2(l,"chartArea"),vertical:j.concat(J).concat(Gt),horizontal:mt.concat(kt).concat(Dt)}}function bP(d,l,z,j){return Math.max(d[z],l[z])+Math.max(d[j],l[j])}function sD(d,l){d.top=Math.max(d.top,l.top),d.left=Math.max(d.left,l.left),d.bottom=Math.max(d.bottom,l.bottom),d.right=Math.max(d.right,l.right)}function Olt(d,l,z,j){const{pos:J,box:mt}=z,kt=d.maxPadding;if(!Ec(J)){z.size&&(d[J]-=z.size);const Ne=j[z.stack]||{size:0,count:1};Ne.size=Math.max(Ne.size,z.horizontal?mt.height:mt.width),z.size=Ne.size/Ne.count,d[J]+=z.size}mt.getPadding&&sD(kt,mt.getPadding());const Dt=Math.max(0,l.outerWidth-bP(kt,d,"left","right")),Gt=Math.max(0,l.outerHeight-bP(kt,d,"top","bottom")),re=Dt!==d.w,pe=Gt!==d.h;return d.w=Dt,d.h=Gt,z.horizontal?{same:re,other:pe}:{same:pe,other:re}}function Dlt(d){const l=d.maxPadding;function z(j){const J=Math.max(l[j]-d[j],0);return d[j]+=J,J}d.y+=z("top"),d.x+=z("left"),z("right"),z("bottom")}function Flt(d,l){const z=l.maxPadding;function j(J){const mt={left:0,top:0,right:0,bottom:0};return J.forEach(kt=>{mt[kt]=Math.max(l[kt],z[kt])}),mt}return j(d?["left","right"]:["top","bottom"])}function f2(d,l,z,j){const J=[];let mt,kt,Dt,Gt,re,pe;for(mt=0,kt=d.length,re=0;mt{typeof zr.beforeLayout=="function"&&zr.beforeLayout()});const pe=Gt.reduce((zr,Wr)=>Wr.box.options&&Wr.box.options.display===!1?zr:zr+1,0)||1,Ne=Object.freeze({outerWidth:l,outerHeight:z,padding:J,availableWidth:mt,availableHeight:kt,vBoxMaxWidth:mt/2/pe,hBoxMaxHeight:kt/2}),or=Object.assign({},J);sD(or,fm(j));const _r=Object.assign({maxPadding:or,w:mt,h:kt,x:J.left,y:J.top},J),Fr=zlt(Gt.concat(re),Ne);f2(Dt.fullSize,_r,Ne,Fr),f2(Gt,_r,Ne,Fr),f2(re,_r,Ne,Fr)&&f2(Gt,_r,Ne,Fr),Dlt(_r),wP(Dt.leftAndTop,_r,Ne,Fr),_r.x+=_r.w,_r.y+=_r.h,wP(Dt.rightAndBottom,_r,Ne,Fr),d.chartArea={left:_r.left,top:_r.top,right:_r.left+_r.w,bottom:_r.top+_r.h,height:_r.h,width:_r.w},Kh(Dt.chartArea,zr=>{const Wr=zr.box;Object.assign(Wr,d.chartArea),Wr.update(_r.w,_r.h,{left:0,top:0,right:0,bottom:0})})}};class lD{acquireContext(l,z){}releaseContext(l){return!1}addEventListener(l,z,j){}removeEventListener(l,z,j){}getDevicePixelRatio(){return 1}getMaximumSize(l,z,j,J){return z=Math.max(0,z||l.width),j=j||l.height,{width:z,height:Math.max(0,J?Math.floor(z/J):j)}}isAttached(l){return!0}updateConfig(l){}}class Rlt extends lD{acquireContext(l){return l&&l.getContext&&l.getContext("2d")||null}updateConfig(l){l.options.animation=!1}}const K5="$chartjs",Blt={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},kP=d=>d===null||d==="";function Nlt(d,l){const z=d.style,j=d.getAttribute("height"),J=d.getAttribute("width");if(d[K5]={initial:{height:j,width:J,style:{display:z.display,height:z.height,width:z.width}}},z.display=z.display||"block",z.boxSizing=z.boxSizing||"border-box",kP(J)){const mt=oP(d,"width");mt!==void 0&&(d.width=mt)}if(kP(j))if(d.style.height==="")d.height=d.width/(l||2);else{const mt=oP(d,"height");mt!==void 0&&(d.height=mt)}return d}const uD=Nst?{passive:!0}:!1;function jlt(d,l,z){d&&d.addEventListener(l,z,uD)}function Ult(d,l,z){d&&d.canvas&&d.canvas.removeEventListener(l,z,uD)}function Vlt(d,l){const z=Blt[d.type]||d.type,{x:j,y:J}=hy(d,l);return{type:z,chart:l,native:d,x:j!==void 0?j:null,y:J!==void 0?J:null}}function g4(d,l){for(const z of d)if(z===l||z.contains(l))return!0}function Hlt(d,l,z){const j=d.canvas,J=new MutationObserver(mt=>{let kt=!1;for(const Dt of mt)kt=kt||g4(Dt.addedNodes,j),kt=kt&&!g4(Dt.removedNodes,j);kt&&z()});return J.observe(document,{childList:!0,subtree:!0}),J}function Wlt(d,l,z){const j=d.canvas,J=new MutationObserver(mt=>{let kt=!1;for(const Dt of mt)kt=kt||g4(Dt.removedNodes,j),kt=kt&&!g4(Dt.addedNodes,j);kt&&z()});return J.observe(document,{childList:!0,subtree:!0}),J}const Z2=new Map;let TP=0;function cD(){const d=window.devicePixelRatio;d!==TP&&(TP=d,Z2.forEach((l,z)=>{z.currentDevicePixelRatio!==d&&l()}))}function qlt(d,l){Z2.size||window.addEventListener("resize",cD),Z2.set(d,l)}function Zlt(d){Z2.delete(d),Z2.size||window.removeEventListener("resize",cD)}function $lt(d,l,z){const j=d.canvas,J=j&&pM(j);if(!J)return;const mt=UO((Dt,Gt)=>{const re=J.clientWidth;z(Dt,Gt),re{const Gt=Dt[0],re=Gt.contentRect.width,pe=Gt.contentRect.height;re===0&&pe===0||mt(re,pe)});return kt.observe(J),qlt(d,mt),kt}function N8(d,l,z){z&&z.disconnect(),l==="resize"&&Zlt(d)}function Glt(d,l,z){const j=d.canvas,J=UO(mt=>{d.ctx!==null&&z(Vlt(mt,d))},d);return jlt(j,l,J),J}class Ylt extends lD{acquireContext(l,z){const j=l&&l.getContext&&l.getContext("2d");return j&&j.canvas===l?(Nlt(l,z),j):null}releaseContext(l){const z=l.canvas;if(!z[K5])return!1;const j=z[K5].initial;["height","width"].forEach(mt=>{const kt=j[mt];Rh(kt)?z.removeAttribute(mt):z.setAttribute(mt,kt)});const J=j.style||{};return Object.keys(J).forEach(mt=>{z.style[mt]=J[mt]}),z.width=z.width,delete z[K5],!0}addEventListener(l,z,j){this.removeEventListener(l,z);const J=l.$proxies||(l.$proxies={}),kt={attach:Hlt,detach:Wlt,resize:$lt}[z]||Glt;J[z]=kt(l,z,j)}removeEventListener(l,z){const j=l.$proxies||(l.$proxies={}),J=j[z];if(!J)return;({attach:N8,detach:N8,resize:N8}[z]||Ult)(l,z,J),j[z]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(l,z,j,J){return Bst(l,z,j,J)}isAttached(l){const z=l&&pM(l);return!!(z&&z.isConnected)}}function Klt(d){return!dM()||typeof OffscreenCanvas<"u"&&d instanceof OffscreenCanvas?Rlt:Ylt}let lv=class{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(l){const{x:z,y:j}=this.getProps(["x","y"],l);return{x:z,y:j}}hasValue(){return V2(this.x)&&V2(this.y)}getProps(l,z){const j=this.$animations;if(!z||!j)return this;const J={};return l.forEach(mt=>{J[mt]=j[mt]&&j[mt].active()?j[mt]._to:this[mt]}),J}};function Xlt(d,l){const z=d.options.ticks,j=Jlt(d),J=Math.min(z.maxTicksLimit||j,j),mt=z.major.enabled?tut(l):[],kt=mt.length,Dt=mt[0],Gt=mt[kt-1],re=[];if(kt>J)return eut(l,re,mt,kt/J),re;const pe=Qlt(mt,l,J);if(kt>0){let Ne,or;const _r=kt>1?Math.round((Gt-Dt)/(kt-1)):null;for(D5(l,re,pe,Rh(_r)?0:Dt-_r,Dt),Ne=0,or=kt-1;NeJ)return Gt}return Math.max(J,1)}function tut(d){const l=[];let z,j;for(z=0,j=d.length;zd==="left"?"right":d==="right"?"left":d,AP=(d,l,z)=>l==="top"||l==="left"?d[l]+z:d[l]-z,MP=(d,l)=>Math.min(l||d,d);function SP(d,l){const z=[],j=d.length/l,J=d.length;let mt=0;for(;mtkt+Dt)))return Gt}function aut(d,l){Kh(d,z=>{const j=z.gc,J=j.length/2;let mt;if(J>l){for(mt=0;mtj?j:z,j=J&&z>j?z:j,{min:eg(z,eg(j,z)),max:eg(j,eg(z,j))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const l=this.chart.data;return this.options.labels||(this.isHorizontal()?l.xLabels:l.yLabels)||l.labels||[]}getLabelItems(l=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(l))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Df(this.options.beforeUpdate,[this])}update(l,z,j){const{beginAtZero:J,grace:mt,ticks:kt}=this.options,Dt=kt.sampleSize;this.beforeUpdate(),this.maxWidth=l,this.maxHeight=z,this._margins=j=Object.assign({left:0,right:0,top:0,bottom:0},j),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+j.left+j.right:this.height+j.top+j.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=gst(this,mt,J),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const Gt=Dt=mt||j<=1||!this.isHorizontal()){this.labelRotation=J;return}const pe=this._getLabelSizes(),Ne=pe.widest.width,or=pe.highest.height,_r=Xp(this.chart.width-Ne,0,this.maxWidth);Dt=l.offset?this.maxWidth/j:_r/(j-1),Ne+6>Dt&&(Dt=_r/(j-(l.offset?.5:1)),Gt=this.maxHeight-i2(l.grid)-z.padding-EP(l.title,this.chart.options.font),re=Math.sqrt(Ne*Ne+or*or),kt=Uot(Math.min(Math.asin(Xp((pe.highest.height+6)/Dt,-1,1)),Math.asin(Xp(Gt/re,-1,1))-Math.asin(Xp(or/re,-1,1)))),kt=Math.max(J,Math.min(mt,kt))),this.labelRotation=kt}afterCalculateLabelRotation(){Df(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Df(this.options.beforeFit,[this])}fit(){const l={width:0,height:0},{chart:z,options:{ticks:j,title:J,grid:mt}}=this,kt=this._isVisible(),Dt=this.isHorizontal();if(kt){const Gt=EP(J,z.options.font);if(Dt?(l.width=this.maxWidth,l.height=i2(mt)+Gt):(l.height=this.maxHeight,l.width=i2(mt)+Gt),j.display&&this.ticks.length){const{first:re,last:pe,widest:Ne,highest:or}=this._getLabelSizes(),_r=j.padding*2,Fr=tv(this.labelRotation),zr=Math.cos(Fr),Wr=Math.sin(Fr);if(Dt){const An=j.mirror?0:Wr*Ne.width+zr*or.height;l.height=Math.min(this.maxHeight,l.height+An+_r)}else{const An=j.mirror?0:zr*Ne.width+Wr*or.height;l.width=Math.min(this.maxWidth,l.width+An+_r)}this._calculatePadding(re,pe,Wr,zr)}}this._handleMargins(),Dt?(this.width=this._length=z.width-this._margins.left-this._margins.right,this.height=l.height):(this.width=l.width,this.height=this._length=z.height-this._margins.top-this._margins.bottom)}_calculatePadding(l,z,j,J){const{ticks:{align:mt,padding:kt},position:Dt}=this.options,Gt=this.labelRotation!==0,re=Dt!=="top"&&this.axis==="x";if(this.isHorizontal()){const pe=this.getPixelForTick(0)-this.left,Ne=this.right-this.getPixelForTick(this.ticks.length-1);let or=0,_r=0;Gt?re?(or=J*l.width,_r=j*z.height):(or=j*l.height,_r=J*z.width):mt==="start"?_r=z.width:mt==="end"?or=l.width:mt!=="inner"&&(or=l.width/2,_r=z.width/2),this.paddingLeft=Math.max((or-pe+kt)*this.width/(this.width-pe),0),this.paddingRight=Math.max((_r-Ne+kt)*this.width/(this.width-Ne),0)}else{let pe=z.height/2,Ne=l.height/2;mt==="start"?(pe=0,Ne=l.height):mt==="end"&&(pe=z.height,Ne=0),this.paddingTop=pe+kt,this.paddingBottom=Ne+kt}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Df(this.options.afterFit,[this])}isHorizontal(){const{axis:l,position:z}=this.options;return z==="top"||z==="bottom"||l==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(l){this.beforeTickToLabelConversion(),this.generateTickLabels(l);let z,j;for(z=0,j=l.length;z({width:kt[un]||0,height:Dt[un]||0});return{first:Gi(0),last:Gi(z-1),widest:Gi(ai),highest:Gi(Qi),widths:kt,heights:Dt}}getLabelForValue(l){return l}getPixelForValue(l,z){return NaN}getValueForPixel(l){}getPixelForTick(l){const z=this.ticks;return l<0||l>z.length-1?null:this.getPixelForValue(z[l].value)}getPixelForDecimal(l){this._reversePixels&&(l=1-l);const z=this._startPixel+l*this._length;return Hot(this._alignToPixels?ly(this.chart,z,0):z)}getDecimalForPixel(l){const z=(l-this._startPixel)/this._length;return this._reversePixels?1-z:z}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:l,max:z}=this;return l<0&&z<0?z:l>0&&z>0?l:0}getContext(l){const z=this.ticks||[];if(l>=0&&lDt*J?Dt/j:Gt/J:Gt*J0}_computeGridLineItems(l){const z=this.axis,j=this.chart,J=this.options,{grid:mt,position:kt,border:Dt}=J,Gt=mt.offset,re=this.isHorizontal(),Ne=this.ticks.length+(Gt?1:0),or=i2(mt),_r=[],Fr=Dt.setContext(this.getContext()),zr=Fr.display?Fr.width:0,Wr=zr/2,An=function(Ni){return ly(j,Ni,zr)};let Ft,kn,ei,jn,ai,Qi,Gi,un,ia,fa,Li,yi;if(kt==="top")Ft=An(this.bottom),Qi=this.bottom-or,un=Ft-Wr,fa=An(l.top)+Wr,yi=l.bottom;else if(kt==="bottom")Ft=An(this.top),fa=l.top,yi=An(l.bottom)-Wr,Qi=Ft+Wr,un=this.top+or;else if(kt==="left")Ft=An(this.right),ai=this.right-or,Gi=Ft-Wr,ia=An(l.left)+Wr,Li=l.right;else if(kt==="right")Ft=An(this.left),ia=l.left,Li=An(l.right)-Wr,ai=Ft+Wr,Gi=this.left+or;else if(z==="x"){if(kt==="center")Ft=An((l.top+l.bottom)/2+.5);else if(Ec(kt)){const Ni=Object.keys(kt)[0],Ei=kt[Ni];Ft=An(this.chart.scales[Ni].getPixelForValue(Ei))}fa=l.top,yi=l.bottom,Qi=Ft+Wr,un=Qi+or}else if(z==="y"){if(kt==="center")Ft=An((l.left+l.right)/2);else if(Ec(kt)){const Ni=Object.keys(kt)[0],Ei=kt[Ni];Ft=An(this.chart.scales[Ni].getPixelForValue(Ei))}ai=Ft-Wr,Gi=ai-or,ia=l.left,Li=l.right}const ra=cc(J.ticks.maxTicksLimit,Ne),Da=Math.max(1,Math.ceil(Ne/ra));for(kn=0;kn0&&(Ta-=qo/2);break}ko={left:Ta,top:fo,width:qo+pl.width,height:fu+pl.height,color:Da.backdropColor}}Wr.push({label:ei,font:un,textOffset:Li,options:{rotation:zr,color:Ei,strokeColor:Va,strokeWidth:ss,textAlign:mo,textBaseline:yi,translation:[jn,ai],backdrop:ko}})}return Wr}_getXAxisLabelAlignment(){const{position:l,ticks:z}=this.options;if(-tv(this.labelRotation))return l==="top"?"left":"right";let J="center";return z.align==="start"?J="left":z.align==="end"?J="right":z.align==="inner"&&(J="inner"),J}_getYAxisLabelAlignment(l){const{position:z,ticks:{crossAlign:j,mirror:J,padding:mt}}=this.options,kt=this._getLabelSizes(),Dt=l+mt,Gt=kt.widest.width;let re,pe;return z==="left"?J?(pe=this.right+mt,j==="near"?re="left":j==="center"?(re="center",pe+=Gt/2):(re="right",pe+=Gt)):(pe=this.right-Dt,j==="near"?re="right":j==="center"?(re="center",pe-=Gt/2):(re="left",pe=this.left)):z==="right"?J?(pe=this.left+mt,j==="near"?re="right":j==="center"?(re="center",pe-=Gt/2):(re="left",pe-=Gt)):(pe=this.left+Dt,j==="near"?re="left":j==="center"?(re="center",pe+=Gt/2):(re="right",pe=this.right)):re="right",{textAlign:re,x:pe}}_computeLabelArea(){if(this.options.ticks.mirror)return;const l=this.chart,z=this.options.position;if(z==="left"||z==="right")return{top:0,left:this.left,bottom:l.height,right:this.right};if(z==="top"||z==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:l.width}}drawBackground(){const{ctx:l,options:{backgroundColor:z},left:j,top:J,width:mt,height:kt}=this;z&&(l.save(),l.fillStyle=z,l.fillRect(j,J,mt,kt),l.restore())}getLineWidthForValue(l){const z=this.options.grid;if(!this._isVisible()||!z.display)return 0;const J=this.ticks.findIndex(mt=>mt.value===l);return J>=0?z.setContext(this.getContext(J)).lineWidth:0}drawGrid(l){const z=this.options.grid,j=this.ctx,J=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(l));let mt,kt;const Dt=(Gt,re,pe)=>{!pe.width||!pe.color||(j.save(),j.lineWidth=pe.width,j.strokeStyle=pe.color,j.setLineDash(pe.borderDash||[]),j.lineDashOffset=pe.borderDashOffset,j.beginPath(),j.moveTo(Gt.x,Gt.y),j.lineTo(re.x,re.y),j.stroke(),j.restore())};if(z.display)for(mt=0,kt=J.length;mt{this.draw(mt)}}]:[{z:j,draw:mt=>{this.drawBackground(),this.drawGrid(mt),this.drawTitle()}},{z:J,draw:()=>{this.drawBorder()}},{z,draw:mt=>{this.drawLabels(mt)}}]}getMatchingVisibleMetas(l){const z=this.chart.getSortedVisibleDatasetMetas(),j=this.axis+"AxisID",J=[];let mt,kt;for(mt=0,kt=z.length;mt{const j=z.split("."),J=j.pop(),mt=[d].concat(j).join("."),kt=l[z].split("."),Dt=kt.pop(),Gt=kt.join(".");Bd.route(mt,J,Gt,Dt)})}function fut(d){return"id"in d&&"defaults"in d}class dut{constructor(){this.controllers=new F5(W4,"datasets",!0),this.elements=new F5(lv,"elements"),this.plugins=new F5(Object,"plugins"),this.scales=new F5(__,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...l){this._each("register",l)}remove(...l){this._each("unregister",l)}addControllers(...l){this._each("register",l,this.controllers)}addElements(...l){this._each("register",l,this.elements)}addPlugins(...l){this._each("register",l,this.plugins)}addScales(...l){this._each("register",l,this.scales)}getController(l){return this._get(l,this.controllers,"controller")}getElement(l){return this._get(l,this.elements,"element")}getPlugin(l){return this._get(l,this.plugins,"plugin")}getScale(l){return this._get(l,this.scales,"scale")}removeControllers(...l){this._each("unregister",l,this.controllers)}removeElements(...l){this._each("unregister",l,this.elements)}removePlugins(...l){this._each("unregister",l,this.plugins)}removeScales(...l){this._each("unregister",l,this.scales)}_each(l,z,j){[...z].forEach(J=>{const mt=j||this._getRegistryForType(J);j||mt.isForType(J)||mt===this.plugins&&J.id?this._exec(l,mt,J):Kh(J,kt=>{const Dt=j||this._getRegistryForType(kt);this._exec(l,Dt,kt)})})}_exec(l,z,j){const J=iM(l);Df(j["before"+J],[],j),z[l](j),Df(j["after"+J],[],j)}_getRegistryForType(l){for(let z=0;zmt.filter(Dt=>!kt.some(Gt=>Dt.plugin.id===Gt.plugin.id));this._notify(J(z,j),l,"stop"),this._notify(J(j,z),l,"start")}}function mut(d){const l={},z=[],j=Object.keys(ag.plugins.items);for(let mt=0;mt1&&CP(d[0].toLowerCase());if(j)return j}throw new Error(`Cannot determine type of '${d}' axis. Please provide 'axis' or 'position' option.`)}function LP(d,l,z){if(z[l+"AxisID"]===d)return{axis:l}}function wut(d,l){if(l.data&&l.data.datasets){const z=l.data.datasets.filter(j=>j.xAxisID===d||j.yAxisID===d);if(z.length)return LP(d,"x",z[0])||LP(d,"y",z[0])}return{}}function kut(d,l){const z=Sy[d.type]||{scales:{}},j=l.scales||{},J=xA(d.type,l),mt=Object.create(null);return Object.keys(j).forEach(kt=>{const Dt=j[kt];if(!Ec(Dt))return console.error(`Invalid scale configuration for scale: ${kt}`);if(Dt._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${kt}`);const Gt=_A(kt,Dt,wut(kt,d),Bd.scales[Dt.type]),re=_ut(Gt,J),pe=z.scales||{};mt[kt]=T2(Object.create(null),[{axis:Gt},Dt,pe[Gt],pe[re]])}),d.data.datasets.forEach(kt=>{const Dt=kt.type||d.type,Gt=kt.indexAxis||xA(Dt,l),pe=(Sy[Dt]||{}).scales||{};Object.keys(pe).forEach(Ne=>{const or=xut(Ne,Gt),_r=kt[or+"AxisID"]||or;mt[_r]=mt[_r]||Object.create(null),T2(mt[_r],[{axis:or},j[_r],pe[Ne]])})}),Object.keys(mt).forEach(kt=>{const Dt=mt[kt];T2(Dt,[Bd.scales[Dt.type],Bd.scale])}),mt}function hD(d){const l=d.options||(d.options={});l.plugins=cc(l.plugins,{}),l.scales=kut(d,l)}function fD(d){return d=d||{},d.datasets=d.datasets||[],d.labels=d.labels||[],d}function Tut(d){return d=d||{},d.data=fD(d.data),hD(d),d}const PP=new Map,dD=new Set;function R5(d,l){let z=PP.get(d);return z||(z=l(),PP.set(d,z),dD.add(z)),z}const a2=(d,l,z)=>{const j=My(l,z);j!==void 0&&d.add(j)};class Aut{constructor(l){this._config=Tut(l),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(l){this._config.type=l}get data(){return this._config.data}set data(l){this._config.data=fD(l)}get options(){return this._config.options}set options(l){this._config.options=l}get plugins(){return this._config.plugins}update(){const l=this._config;this.clearCache(),hD(l)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(l){return R5(l,()=>[[`datasets.${l}`,""]])}datasetAnimationScopeKeys(l,z){return R5(`${l}.transition.${z}`,()=>[[`datasets.${l}.transitions.${z}`,`transitions.${z}`],[`datasets.${l}`,""]])}datasetElementScopeKeys(l,z){return R5(`${l}-${z}`,()=>[[`datasets.${l}.elements.${z}`,`datasets.${l}`,`elements.${z}`,""]])}pluginScopeKeys(l){const z=l.id,j=this.type;return R5(`${j}-plugin-${z}`,()=>[[`plugins.${z}`,...l.additionalOptionScopes||[]]])}_cachedScopes(l,z){const j=this._scopeCache;let J=j.get(l);return(!J||z)&&(J=new Map,j.set(l,J)),J}getOptionScopes(l,z,j){const{options:J,type:mt}=this,kt=this._cachedScopes(l,j),Dt=kt.get(z);if(Dt)return Dt;const Gt=new Set;z.forEach(pe=>{l&&(Gt.add(l),pe.forEach(Ne=>a2(Gt,l,Ne))),pe.forEach(Ne=>a2(Gt,J,Ne)),pe.forEach(Ne=>a2(Gt,Sy[mt]||{},Ne)),pe.forEach(Ne=>a2(Gt,Bd,Ne)),pe.forEach(Ne=>a2(Gt,vA,Ne))});const re=Array.from(Gt);return re.length===0&&re.push(Object.create(null)),dD.has(z)&&kt.set(z,re),re}chartOptionScopes(){const{options:l,type:z}=this;return[l,Sy[z]||{},Bd.datasets[z]||{},{type:z},Bd,vA]}resolveNamedOptions(l,z,j,J=[""]){const mt={$shared:!0},{resolver:kt,subPrefixes:Dt}=zP(this._resolverCache,l,J);let Gt=kt;if(Sut(kt,z)){mt.$shared=!1,j=v1(j)?j():j;const re=this.createResolver(l,j,Dt);Gt=m_(kt,j,re)}for(const re of z)mt[re]=Gt[re];return mt}createResolver(l,z,j=[""],J){const{resolver:mt}=zP(this._resolverCache,l,j);return Ec(z)?m_(mt,z,void 0,J):mt}}function zP(d,l,z){let j=d.get(l);j||(j=new Map,d.set(l,j));const J=z.join();let mt=j.get(J);return mt||(mt={resolver:cM(l,z),subPrefixes:z.filter(Dt=>!Dt.toLowerCase().includes("hover"))},j.set(J,mt)),mt}const Mut=d=>Ec(d)&&Object.getOwnPropertyNames(d).some(l=>v1(d[l]));function Sut(d,l){const{isScriptable:z,isIndexable:j}=qO(d);for(const J of l){const mt=z(J),kt=j(J),Dt=(kt||mt)&&d[J];if(mt&&(v1(Dt)||Mut(Dt))||kt&&Xd(Dt))return!0}return!1}var Eut="4.5.1";const Cut=["top","bottom","left","right","chartArea"];function IP(d,l){return d==="top"||d==="bottom"||Cut.indexOf(d)===-1&&l==="x"}function OP(d,l){return function(z,j){return z[d]===j[d]?z[l]-j[l]:z[d]-j[d]}}function DP(d){const l=d.chart,z=l.options.animation;l.notifyPlugins("afterRender"),Df(z&&z.onComplete,[d],l)}function Lut(d){const l=d.chart,z=l.options.animation;Df(z&&z.onProgress,[d],l)}function pD(d){return dM()&&typeof d=="string"?d=document.getElementById(d):d&&d.length&&(d=d[0]),d&&d.canvas&&(d=d.canvas),d}const X5={},FP=d=>{const l=pD(d);return Object.values(X5).filter(z=>z.canvas===l).pop()};function Put(d,l,z){const j=Object.keys(d);for(const J of j){const mt=+J;if(mt>=l){const kt=d[J];delete d[J],(z>0||mt>l)&&(d[mt+z]=kt)}}}function zut(d,l,z,j){return!z||d.type==="mouseout"?null:j?l:d}class d2{static defaults=Bd;static instances=X5;static overrides=Sy;static registry=ag;static version=Eut;static getChart=FP;static register(...l){ag.add(...l),RP()}static unregister(...l){ag.remove(...l),RP()}constructor(l,z){const j=this.config=new Aut(z),J=pD(l),mt=FP(J);if(mt)throw new Error("Canvas is already in use. Chart with ID '"+mt.id+"' must be destroyed before the canvas with ID '"+mt.canvas.id+"' can be reused.");const kt=j.createResolver(j.chartOptionScopes(),this.getContext());this.platform=new(j.platform||Klt(J)),this.platform.updateConfig(j);const Dt=this.platform.acquireContext(J,kt.aspectRatio),Gt=Dt&&Dt.canvas,re=Gt&&Gt.height,pe=Gt&&Gt.width;if(this.id=Eot(),this.ctx=Dt,this.canvas=Gt,this.width=pe,this.height=re,this._options=kt,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new put,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=$ot(Ne=>this.update(Ne),kt.resizeDelay||0),this._dataChanges=[],X5[this.id]=this,!Dt||!Gt){console.error("Failed to create chart: can't acquire context from the given item");return}Gg.listen(this,"complete",DP),Gg.listen(this,"progress",Lut),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:l,maintainAspectRatio:z},width:j,height:J,_aspectRatio:mt}=this;return Rh(l)?z&&mt?mt:J?j/J:null:l}get data(){return this.config.data}set data(l){this.config.data=l}get options(){return this._options}set options(l){this.config.options=l}get registry(){return ag}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():aP(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return rP(this.canvas,this.ctx),this}stop(){return Gg.stop(this),this}resize(l,z){Gg.running(this)?this._resizeBeforeDraw={width:l,height:z}:this._resize(l,z)}_resize(l,z){const j=this.options,J=this.canvas,mt=j.maintainAspectRatio&&this.aspectRatio,kt=this.platform.getMaximumSize(J,l,z,mt),Dt=j.devicePixelRatio||this.platform.getDevicePixelRatio(),Gt=this.width?"resize":"attach";this.width=kt.width,this.height=kt.height,this._aspectRatio=this.aspectRatio,aP(this,Dt,!0)&&(this.notifyPlugins("resize",{size:kt}),Df(j.onResize,[this,kt],this),this.attached&&this._doResize(Gt)&&this.render())}ensureScalesHaveIDs(){const z=this.options.scales||{};Kh(z,(j,J)=>{j.id=J})}buildOrUpdateScales(){const l=this.options,z=l.scales,j=this.scales,J=Object.keys(j).reduce((kt,Dt)=>(kt[Dt]=!1,kt),{});let mt=[];z&&(mt=mt.concat(Object.keys(z).map(kt=>{const Dt=z[kt],Gt=_A(kt,Dt),re=Gt==="r",pe=Gt==="x";return{options:Dt,dposition:re?"chartArea":pe?"bottom":"left",dtype:re?"radialLinear":pe?"category":"linear"}}))),Kh(mt,kt=>{const Dt=kt.options,Gt=Dt.id,re=_A(Gt,Dt),pe=cc(Dt.type,kt.dtype);(Dt.position===void 0||IP(Dt.position,re)!==IP(kt.dposition))&&(Dt.position=kt.dposition),J[Gt]=!0;let Ne=null;if(Gt in j&&j[Gt].type===pe)Ne=j[Gt];else{const or=ag.getScale(pe);Ne=new or({id:Gt,type:pe,ctx:this.ctx,chart:this}),j[Ne.id]=Ne}Ne.init(Dt,l)}),Kh(J,(kt,Dt)=>{kt||delete j[Dt]}),Kh(j,kt=>{om.configure(this,kt,kt.options),om.addBox(this,kt)})}_updateMetasets(){const l=this._metasets,z=this.data.datasets.length,j=l.length;if(l.sort((J,mt)=>J.index-mt.index),j>z){for(let J=z;Jz.length&&delete this._stacks,l.forEach((j,J)=>{z.filter(mt=>mt===j._dataset).length===0&&this._destroyDatasetMeta(J)})}buildOrUpdateControllers(){const l=[],z=this.data.datasets;let j,J;for(this._removeUnreferencedMetasets(),j=0,J=z.length;j{this.getDatasetMeta(z).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(l){const z=this.config;z.update();const j=this._options=z.createResolver(z.chartOptionScopes(),this.getContext()),J=this._animationsDisabled=!j.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:l,cancelable:!0})===!1)return;const mt=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let kt=0;for(let re=0,pe=this.data.datasets.length;re{re.reset()}),this._updateDatasets(l),this.notifyPlugins("afterUpdate",{mode:l}),this._layers.sort(OP("z","_idx"));const{_active:Dt,_lastEvent:Gt}=this;Gt?this._eventHandler(Gt,!0):Dt.length&&this._updateHoverStyles(Dt,Dt,!0),this.render()}_updateScales(){Kh(this.scales,l=>{om.removeBox(this,l)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const l=this.options,z=new Set(Object.keys(this._listeners)),j=new Set(l.events);(!ZL(z,j)||!!this._responsiveListeners!==l.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:l}=this,z=this._getUniformDataChanges()||[];for(const{method:j,start:J,count:mt}of z){const kt=j==="_removeElements"?-mt:mt;Put(l,J,kt)}}_getUniformDataChanges(){const l=this._dataChanges;if(!l||!l.length)return;this._dataChanges=[];const z=this.data.datasets.length,j=mt=>new Set(l.filter(kt=>kt[0]===mt).map((kt,Dt)=>Dt+","+kt.splice(1).join(","))),J=j(0);for(let mt=1;mtmt.split(",")).map(mt=>({method:mt[1],start:+mt[2],count:+mt[3]}))}_updateLayout(l){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;om.update(this,this.width,this.height,l);const z=this.chartArea,j=z.width<=0||z.height<=0;this._layers=[],Kh(this.boxes,J=>{j&&J.position==="chartArea"||(J.configure&&J.configure(),this._layers.push(...J._layers()))},this),this._layers.forEach((J,mt)=>{J._idx=mt}),this.notifyPlugins("afterLayout")}_updateDatasets(l){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:l,cancelable:!0})!==!1){for(let z=0,j=this.data.datasets.length;z=0;--z)this._drawDataset(l[z]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(l){const z=this.ctx,j={meta:l,index:l.index,cancelable:!0},J=eD(this,l);this.notifyPlugins("beforeDatasetDraw",j)!==!1&&(J&&U4(z,J),l.controller.draw(),J&&V4(z),j.cancelable=!1,this.notifyPlugins("afterDatasetDraw",j))}isPointInArea(l){return W2(l,this.chartArea,this._minPadding)}getElementsAtEventForMode(l,z,j,J){const mt=Clt.modes[z];return typeof mt=="function"?mt(this,l,j,J):[]}getDatasetMeta(l){const z=this.data.datasets[l],j=this._metasets;let J=j.filter(mt=>mt&&mt._dataset===z).pop();return J||(J={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:z&&z.order||0,index:l,_dataset:z,_parsed:[],_sorted:!1},j.push(J)),J}getContext(){return this.$context||(this.$context=Cy(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(l){const z=this.data.datasets[l];if(!z)return!1;const j=this.getDatasetMeta(l);return typeof j.hidden=="boolean"?!j.hidden:!z.hidden}setDatasetVisibility(l,z){const j=this.getDatasetMeta(l);j.hidden=!z}toggleDataVisibility(l){this._hiddenIndices[l]=!this._hiddenIndices[l]}getDataVisibility(l){return!this._hiddenIndices[l]}_updateVisibility(l,z,j){const J=j?"show":"hide",mt=this.getDatasetMeta(l),kt=mt.controller._resolveAnimations(void 0,J);U2(z)?(mt.data[z].hidden=!j,this.update()):(this.setDatasetVisibility(l,j),kt.update(mt,{visible:j}),this.update(Dt=>Dt.datasetIndex===l?J:void 0))}hide(l,z){this._updateVisibility(l,z,!1)}show(l,z){this._updateVisibility(l,z,!0)}_destroyDatasetMeta(l){const z=this._metasets[l];z&&z.controller&&z.controller._destroy(),delete this._metasets[l]}_stop(){let l,z;for(this.stop(),Gg.remove(this),l=0,z=this.data.datasets.length;l{z.addEventListener(this,mt,kt),l[mt]=kt},J=(mt,kt,Dt)=>{mt.offsetX=kt,mt.offsetY=Dt,this._eventHandler(mt)};Kh(this.options.events,mt=>j(mt,J))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const l=this._responsiveListeners,z=this.platform,j=(Gt,re)=>{z.addEventListener(this,Gt,re),l[Gt]=re},J=(Gt,re)=>{l[Gt]&&(z.removeEventListener(this,Gt,re),delete l[Gt])},mt=(Gt,re)=>{this.canvas&&this.resize(Gt,re)};let kt;const Dt=()=>{J("attach",Dt),this.attached=!0,this.resize(),j("resize",mt),j("detach",kt)};kt=()=>{this.attached=!1,J("resize",mt),this._stop(),this._resize(0,0),j("attach",Dt)},z.isAttached(this.canvas)?Dt():kt()}unbindEvents(){Kh(this._listeners,(l,z)=>{this.platform.removeEventListener(this,z,l)}),this._listeners={},Kh(this._responsiveListeners,(l,z)=>{this.platform.removeEventListener(this,z,l)}),this._responsiveListeners=void 0}updateHoverStyle(l,z,j){const J=j?"set":"remove";let mt,kt,Dt,Gt;for(z==="dataset"&&(mt=this.getDatasetMeta(l[0].datasetIndex),mt.controller["_"+J+"DatasetHoverStyle"]()),Dt=0,Gt=l.length;Dt{const Dt=this.getDatasetMeta(mt);if(!Dt)throw new Error("No dataset found at index "+mt);return{datasetIndex:mt,element:Dt.data[kt],index:kt}});!h4(j,z)&&(this._active=j,this._lastEvent=null,this._updateHoverStyles(j,z))}notifyPlugins(l,z,j){return this._plugins.notify(this,l,z,j)}isPluginEnabled(l){return this._plugins._cache.filter(z=>z.plugin.id===l).length===1}_updateHoverStyles(l,z,j){const J=this.options.hover,mt=(Gt,re)=>Gt.filter(pe=>!re.some(Ne=>pe.datasetIndex===Ne.datasetIndex&&pe.index===Ne.index)),kt=mt(z,l),Dt=j?l:mt(l,z);kt.length&&this.updateHoverStyle(kt,J.mode,!1),Dt.length&&J.mode&&this.updateHoverStyle(Dt,J.mode,!0)}_eventHandler(l,z){const j={event:l,replay:z,cancelable:!0,inChartArea:this.isPointInArea(l)},J=kt=>(kt.options.events||this.options.events).includes(l.native.type);if(this.notifyPlugins("beforeEvent",j,J)===!1)return;const mt=this._handleEvent(l,z,j.inChartArea);return j.cancelable=!1,this.notifyPlugins("afterEvent",j,J),(mt||j.changed)&&this.render(),this}_handleEvent(l,z,j){const{_active:J=[],options:mt}=this,kt=z,Dt=this._getActiveElements(l,J,j,kt),Gt=Oot(l),re=zut(l,this._lastEvent,j,Gt);j&&(this._lastEvent=null,Df(mt.onHover,[l,Dt,this],this),Gt&&Df(mt.onClick,[l,Dt,this],this));const pe=!h4(Dt,J);return(pe||z)&&(this._active=Dt,this._updateHoverStyles(Dt,J,z)),this._lastEvent=re,pe}_getActiveElements(l,z,j,J){if(l.type==="mouseout")return[];if(!j)return z;const mt=this.options.hover;return this.getElementsAtEventForMode(l,mt.mode,mt,J)}}function RP(){return Kh(d2.instances,d=>d._plugins.invalidate())}function Iut(d,l,z){const{startAngle:j,x:J,y:mt,outerRadius:kt,innerRadius:Dt,options:Gt}=l,{borderWidth:re,borderJoinStyle:pe}=Gt,Ne=Math.min(re/kt,q0(j-z));if(d.beginPath(),d.arc(J,mt,kt-re/2,j+Ne/2,z-Ne/2),Dt>0){const or=Math.min(re/Dt,q0(j-z));d.arc(J,mt,Dt+re/2,z-or/2,j+or/2,!0)}else{const or=Math.min(re/2,kt*q0(j-z));if(pe==="round")d.arc(J,mt,or,z-Jh/2,j+Jh/2,!0);else if(pe==="bevel"){const _r=2*or*or,Fr=-_r*Math.cos(z+Jh/2)+J,zr=-_r*Math.sin(z+Jh/2)+mt,Wr=_r*Math.cos(j+Jh/2)+J,An=_r*Math.sin(j+Jh/2)+mt;d.lineTo(Fr,zr),d.lineTo(Wr,An)}}d.closePath(),d.moveTo(0,0),d.rect(0,0,d.canvas.width,d.canvas.height),d.clip("evenodd")}function Out(d,l,z){const{startAngle:j,pixelMargin:J,x:mt,y:kt,outerRadius:Dt,innerRadius:Gt}=l;let re=J/Dt;d.beginPath(),d.arc(mt,kt,Dt,j-re,z+re),Gt>J?(re=J/Gt,d.arc(mt,kt,Gt,z+re,j-re,!0)):d.arc(mt,kt,J,z+ap,j-ap),d.closePath(),d.clip()}function Dut(d){return uM(d,["outerStart","outerEnd","innerStart","innerEnd"])}function Fut(d,l,z,j){const J=Dut(d.options.borderRadius),mt=(z-l)/2,kt=Math.min(mt,j*l/2),Dt=Gt=>{const re=(z-Math.min(mt,Gt))*j/2;return Xp(Gt,0,Math.min(mt,re))};return{outerStart:Dt(J.outerStart),outerEnd:Dt(J.outerEnd),innerStart:Xp(J.innerStart,0,kt),innerEnd:Xp(J.innerEnd,0,kt)}}function Jx(d,l,z,j){return{x:z+d*Math.cos(l),y:j+d*Math.sin(l)}}function v4(d,l,z,j,J,mt){const{x:kt,y:Dt,startAngle:Gt,pixelMargin:re,innerRadius:pe}=l,Ne=Math.max(l.outerRadius+j+z-re,0),or=pe>0?pe+j+z+re:0;let _r=0;const Fr=J-Gt;if(j){const Da=pe>0?pe-j:0,Ni=Ne>0?Ne-j:0,Ei=(Da+Ni)/2,Va=Ei!==0?Fr*Ei/(Ei+j):Fr;_r=(Fr-Va)/2}const zr=Math.max(.001,Fr*Ne-z/Jh)/Ne,Wr=(Fr-zr)/2,An=Gt+Wr+_r,Ft=J-Wr-_r,{outerStart:kn,outerEnd:ei,innerStart:jn,innerEnd:ai}=Fut(l,or,Ne,Ft-An),Qi=Ne-kn,Gi=Ne-ei,un=An+kn/Qi,ia=Ft-ei/Gi,fa=or+jn,Li=or+ai,yi=An+jn/fa,ra=Ft-ai/Li;if(d.beginPath(),mt){const Da=(un+ia)/2;if(d.arc(kt,Dt,Ne,un,Da),d.arc(kt,Dt,Ne,Da,ia),ei>0){const ss=Jx(Gi,ia,kt,Dt);d.arc(ss.x,ss.y,ei,ia,Ft+ap)}const Ni=Jx(Li,Ft,kt,Dt);if(d.lineTo(Ni.x,Ni.y),ai>0){const ss=Jx(Li,ra,kt,Dt);d.arc(ss.x,ss.y,ai,Ft+ap,ra+Math.PI)}const Ei=(Ft-ai/or+(An+jn/or))/2;if(d.arc(kt,Dt,or,Ft-ai/or,Ei,!0),d.arc(kt,Dt,or,Ei,An+jn/or,!0),jn>0){const ss=Jx(fa,yi,kt,Dt);d.arc(ss.x,ss.y,jn,yi+Math.PI,An-ap)}const Va=Jx(Qi,An,kt,Dt);if(d.lineTo(Va.x,Va.y),kn>0){const ss=Jx(Qi,un,kt,Dt);d.arc(ss.x,ss.y,kn,An-ap,un)}}else{d.moveTo(kt,Dt);const Da=Math.cos(un)*Ne+kt,Ni=Math.sin(un)*Ne+Dt;d.lineTo(Da,Ni);const Ei=Math.cos(ia)*Ne+kt,Va=Math.sin(ia)*Ne+Dt;d.lineTo(Ei,Va)}d.closePath()}function Rut(d,l,z,j,J){const{fullCircles:mt,startAngle:kt,circumference:Dt}=l;let Gt=l.endAngle;if(mt){v4(d,l,z,j,Gt,J);for(let re=0;re=Jh&&_r===0&&pe!=="miter"&&Iut(d,l,zr),mt||(v4(d,l,z,j,zr,J),d.stroke())}class Nut extends lv{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:l=>l!=="borderDash"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(l){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,l&&Object.assign(this,l)}inRange(l,z,j){const J=this.getProps(["x","y"],j),{angle:mt,distance:kt}=RO(J,{x:l,y:z}),{startAngle:Dt,endAngle:Gt,innerRadius:re,outerRadius:pe,circumference:Ne}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],j),or=(this.options.spacing+this.options.borderWidth)/2,_r=cc(Ne,Gt-Dt),Fr=H2(mt,Dt,Gt)&&Dt!==Gt,zr=_r>=od||Fr,Wr=ev(kt,re+or,pe+or);return zr&&Wr}getCenterPoint(l){const{x:z,y:j,startAngle:J,endAngle:mt,innerRadius:kt,outerRadius:Dt}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],l),{offset:Gt,spacing:re}=this.options,pe=(J+mt)/2,Ne=(kt+Dt+re+Gt)/2;return{x:z+Math.cos(pe)*Ne,y:j+Math.sin(pe)*Ne}}tooltipPosition(l){return this.getCenterPoint(l)}draw(l){const{options:z,circumference:j}=this,J=(z.offset||0)/4,mt=(z.spacing||0)/2,kt=z.circular;if(this.pixelMargin=z.borderAlign==="inner"?.33:0,this.fullCircles=j>od?Math.floor(j/od):0,j===0||this.innerRadius<0||this.outerRadius<0)return;l.save();const Dt=(this.startAngle+this.endAngle)/2;l.translate(Math.cos(Dt)*J,Math.sin(Dt)*J);const Gt=1-Math.sin(Math.min(Jh,j||0)),re=J*Gt;l.fillStyle=z.backgroundColor,l.strokeStyle=z.borderColor,Rut(l,this,re,mt,kt),But(l,this,re,mt,kt),l.restore()}}function mD(d,l,z=l){d.lineCap=cc(z.borderCapStyle,l.borderCapStyle),d.setLineDash(cc(z.borderDash,l.borderDash)),d.lineDashOffset=cc(z.borderDashOffset,l.borderDashOffset),d.lineJoin=cc(z.borderJoinStyle,l.borderJoinStyle),d.lineWidth=cc(z.borderWidth,l.borderWidth),d.strokeStyle=cc(z.borderColor,l.borderColor)}function jut(d,l,z){d.lineTo(z.x,z.y)}function Uut(d){return d.stepped?sst:d.tension||d.cubicInterpolationMode==="monotone"?lst:jut}function gD(d,l,z={}){const j=d.length,{start:J=0,end:mt=j-1}=z,{start:kt,end:Dt}=l,Gt=Math.max(J,kt),re=Math.min(mt,Dt),pe=JDt&&mt>Dt;return{count:j,start:Gt,loop:l.loop,ilen:re(kt+(re?Dt-ei:ei))%mt,kn=()=>{zr!==Wr&&(d.lineTo(pe,Wr),d.lineTo(pe,zr),d.lineTo(pe,An))};for(Gt&&(_r=J[Ft(0)],d.moveTo(_r.x,_r.y)),or=0;or<=Dt;++or){if(_r=J[Ft(or)],_r.skip)continue;const ei=_r.x,jn=_r.y,ai=ei|0;ai===Fr?(jnWr&&(Wr=jn),pe=(Ne*pe+ei)/++Ne):(kn(),d.lineTo(ei,jn),Fr=ai,Ne=0,zr=Wr=jn),An=jn}kn()}function bA(d){const l=d.options,z=l.borderDash&&l.borderDash.length;return!d._decimated&&!d._loop&&!l.tension&&l.cubicInterpolationMode!=="monotone"&&!l.stepped&&!z?Hut:Vut}function Wut(d){return d.stepped?jst:d.tension||d.cubicInterpolationMode==="monotone"?Ust:fy}function qut(d,l,z,j){let J=l._path;J||(J=l._path=new Path2D,l.path(J,z,j)&&J.closePath()),mD(d,l.options),d.stroke(J)}function Zut(d,l,z,j){const{segments:J,options:mt}=l,kt=bA(l);for(const Dt of J)mD(d,mt,Dt.style),d.beginPath(),kt(d,l,Dt,{start:z,end:z+j-1})&&d.closePath(),d.stroke()}const $ut=typeof Path2D=="function";function Gut(d,l,z,j){$ut&&!l.options.segment?qut(d,l,z,j):Zut(d,l,z,j)}class Z4 extends lv{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:l=>l!=="borderDash"&&l!=="fill"};constructor(l){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,l&&Object.assign(this,l)}updateControlPoints(l,z){const j=this.options;if((j.tension||j.cubicInterpolationMode==="monotone")&&!j.stepped&&!this._pointsUpdated){const J=j.spanGaps?this._loop:this._fullLoop;zst(this._points,j,l,J,z),this._pointsUpdated=!0}}set points(l){this._points=l,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=$st(this,this.options.segment))}first(){const l=this.segments,z=this.points;return l.length&&z[l[0].start]}last(){const l=this.segments,z=this.points,j=l.length;return j&&z[l[j-1].end]}interpolate(l,z){const j=this.options,J=l[z],mt=this.points,kt=tD(this,{property:z,start:J,end:J});if(!kt.length)return;const Dt=[],Gt=Wut(j);let re,pe;for(re=0,pe=kt.length;re{Dt=$4(kt,Dt,J);const Gt=J[kt],re=J[Dt];j!==null?(mt.push({x:Gt.x,y:j}),mt.push({x:re.x,y:j})):z!==null&&(mt.push({x:z,y:Gt.y}),mt.push({x:z,y:re.y}))}),mt}function $4(d,l,z){for(;l>d;l--){const j=z[l];if(!isNaN(j.x)&&!isNaN(j.y))break}return l}function NP(d,l,z,j){return d&&l?j(d[z],l[z]):d?d[z]:l?l[z]:0}function yD(d,l){let z=[],j=!1;return Xd(d)?(j=!0,z=d):z=nct(d,l),z.length?new Z4({points:z,options:{tension:0},_loop:j,_fullLoop:j}):null}function jP(d){return d&&d.fill!==!1}function ict(d,l,z){let J=d[l].fill;const mt=[l];let kt;if(!z)return J;for(;J!==!1&&mt.indexOf(J)===-1;){if(!Qp(J))return J;if(kt=d[J],!kt)return!1;if(kt.visible)return J;mt.push(J),J=kt.fill}return!1}function act(d,l,z){const j=uct(d);if(Ec(j))return isNaN(j.value)?!1:j;let J=parseFloat(j);return Qp(J)&&Math.floor(J)===J?oct(j[0],l,J,z):["origin","start","end","stack","shape"].indexOf(j)>=0&&j}function oct(d,l,z,j){return(d==="-"||d==="+")&&(z=l+z),z===l||z<0||z>=j?!1:z}function sct(d,l){let z=null;return d==="start"?z=l.bottom:d==="end"?z=l.top:Ec(d)?z=l.getPixelForValue(d.value):l.getBasePixel&&(z=l.getBasePixel()),z}function lct(d,l,z){let j;return d==="start"?j=z:d==="end"?j=l.options.reverse?l.min:l.max:Ec(d)?j=d.value:j=l.getBaseValue(),j}function uct(d){const l=d.options,z=l.fill;let j=cc(z&&z.target,z);return j===void 0&&(j=!!l.backgroundColor),j===!1||j===null?!1:j===!0?"origin":j}function cct(d){const{scale:l,index:z,line:j}=d,J=[],mt=j.segments,kt=j.points,Dt=hct(l,z);Dt.push(yD({x:null,y:l.bottom},j));for(let Gt=0;Gt=0;--kt){const Dt=J[kt].$filler;Dt&&(Dt.line.updateControlPoints(mt,Dt.axis),j&&Dt.fill&&V8(d.ctx,Dt,mt))}},beforeDatasetsDraw(d,l,z){if(z.drawTime!=="beforeDatasetsDraw")return;const j=d.getSortedVisibleDatasetMetas();for(let J=j.length-1;J>=0;--J){const mt=j[J].$filler;jP(mt)&&V8(d.ctx,mt,d.chartArea)}},beforeDatasetDraw(d,l,z){const j=l.meta.$filler;!jP(j)||z.drawTime!=="beforeDatasetDraw"||V8(d.ctx,j,d.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const WP=(d,l)=>{let{boxHeight:z=l,boxWidth:j=l}=d;return d.usePointStyle&&(z=Math.min(z,l),j=d.pointStyleWidth||Math.min(j,l)),{boxWidth:j,boxHeight:z,itemHeight:Math.max(l,z)}},wct=(d,l)=>d!==null&&l!==null&&d.datasetIndex===l.datasetIndex&&d.index===l.index;class qP extends lv{constructor(l){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=l.chart,this.options=l.options,this.ctx=l.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(l,z,j){this.maxWidth=l,this.maxHeight=z,this._margins=j,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const l=this.options.labels||{};let z=Df(l.generateLabels,[this.chart],this)||[];l.filter&&(z=z.filter(j=>l.filter(j,this.chart.data))),l.sort&&(z=z.sort((j,J)=>l.sort(j,J,this.chart.data))),this.options.reverse&&z.reverse(),this.legendItems=z}fit(){const{options:l,ctx:z}=this;if(!l.display){this.width=this.height=0;return}const j=l.labels,J=Jp(j.font),mt=J.size,kt=this._computeTitleHeight(),{boxWidth:Dt,itemHeight:Gt}=WP(j,mt);let re,pe;z.font=J.string,this.isHorizontal()?(re=this.maxWidth,pe=this._fitRows(kt,mt,Dt,Gt)+10):(pe=this.maxHeight,re=this._fitCols(kt,J,Dt,Gt)+10),this.width=Math.min(re,l.maxWidth||this.maxWidth),this.height=Math.min(pe,l.maxHeight||this.maxHeight)}_fitRows(l,z,j,J){const{ctx:mt,maxWidth:kt,options:{labels:{padding:Dt}}}=this,Gt=this.legendHitBoxes=[],re=this.lineWidths=[0],pe=J+Dt;let Ne=l;mt.textAlign="left",mt.textBaseline="middle";let or=-1,_r=-pe;return this.legendItems.forEach((Fr,zr)=>{const Wr=j+z/2+mt.measureText(Fr.text).width;(zr===0||re[re.length-1]+Wr+2*Dt>kt)&&(Ne+=pe,re[re.length-(zr>0?0:1)]=0,_r+=pe,or++),Gt[zr]={left:0,top:_r,row:or,width:Wr,height:J},re[re.length-1]+=Wr+Dt}),Ne}_fitCols(l,z,j,J){const{ctx:mt,maxHeight:kt,options:{labels:{padding:Dt}}}=this,Gt=this.legendHitBoxes=[],re=this.columnSizes=[],pe=kt-l;let Ne=Dt,or=0,_r=0,Fr=0,zr=0;return this.legendItems.forEach((Wr,An)=>{const{itemWidth:Ft,itemHeight:kn}=kct(j,z,mt,Wr,J);An>0&&_r+kn+2*Dt>pe&&(Ne+=or+Dt,re.push({width:or,height:_r}),Fr+=or+Dt,zr++,or=_r=0),Gt[An]={left:Fr,top:_r,col:zr,width:Ft,height:kn},or=Math.max(or,Ft),_r+=kn+Dt}),Ne+=or,re.push({width:or,height:_r}),Ne}adjustHitBoxes(){if(!this.options.display)return;const l=this._computeTitleHeight(),{legendHitBoxes:z,options:{align:j,labels:{padding:J},rtl:mt}}=this,kt=l_(mt,this.left,this.width);if(this.isHorizontal()){let Dt=0,Gt=Wp(j,this.left+J,this.right-this.lineWidths[Dt]);for(const re of z)Dt!==re.row&&(Dt=re.row,Gt=Wp(j,this.left+J,this.right-this.lineWidths[Dt])),re.top+=this.top+l+J,re.left=kt.leftForLtr(kt.x(Gt),re.width),Gt+=re.width+J}else{let Dt=0,Gt=Wp(j,this.top+l+J,this.bottom-this.columnSizes[Dt].height);for(const re of z)re.col!==Dt&&(Dt=re.col,Gt=Wp(j,this.top+l+J,this.bottom-this.columnSizes[Dt].height)),re.top=Gt,re.left+=this.left+J,re.left=kt.leftForLtr(kt.x(re.left),re.width),Gt+=re.height+J}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const l=this.ctx;U4(l,this),this._draw(),V4(l)}}_draw(){const{options:l,columnSizes:z,lineWidths:j,ctx:J}=this,{align:mt,labels:kt}=l,Dt=Bd.color,Gt=l_(l.rtl,this.left,this.width),re=Jp(kt.font),{padding:pe}=kt,Ne=re.size,or=Ne/2;let _r;this.drawTitle(),J.textAlign=Gt.textAlign("left"),J.textBaseline="middle",J.lineWidth=.5,J.font=re.string;const{boxWidth:Fr,boxHeight:zr,itemHeight:Wr}=WP(kt,Ne),An=function(ai,Qi,Gi){if(isNaN(Fr)||Fr<=0||isNaN(zr)||zr<0)return;J.save();const un=cc(Gi.lineWidth,1);if(J.fillStyle=cc(Gi.fillStyle,Dt),J.lineCap=cc(Gi.lineCap,"butt"),J.lineDashOffset=cc(Gi.lineDashOffset,0),J.lineJoin=cc(Gi.lineJoin,"miter"),J.lineWidth=un,J.strokeStyle=cc(Gi.strokeStyle,Dt),J.setLineDash(cc(Gi.lineDash,[])),kt.usePointStyle){const ia={radius:zr*Math.SQRT2/2,pointStyle:Gi.pointStyle,rotation:Gi.rotation,borderWidth:un},fa=Gt.xPlus(ai,Fr/2),Li=Qi+or;HO(J,ia,fa,Li,kt.pointStyleWidth&&Fr)}else{const ia=Qi+Math.max((Ne-zr)/2,0),fa=Gt.leftForLtr(ai,Fr),Li=s_(Gi.borderRadius);J.beginPath(),Object.values(Li).some(yi=>yi!==0)?p4(J,{x:fa,y:ia,w:Fr,h:zr,radius:Li}):J.rect(fa,ia,Fr,zr),J.fill(),un!==0&&J.stroke()}J.restore()},Ft=function(ai,Qi,Gi){q2(J,Gi.text,ai,Qi+Wr/2,re,{strikethrough:Gi.hidden,textAlign:Gt.textAlign(Gi.textAlign)})},kn=this.isHorizontal(),ei=this._computeTitleHeight();kn?_r={x:Wp(mt,this.left+pe,this.right-j[0]),y:this.top+pe+ei,line:0}:_r={x:this.left+pe,y:Wp(mt,this.top+ei+pe,this.bottom-z[0].height),line:0},KO(this.ctx,l.textDirection);const jn=Wr+pe;this.legendItems.forEach((ai,Qi)=>{J.strokeStyle=ai.fontColor,J.fillStyle=ai.fontColor;const Gi=J.measureText(ai.text).width,un=Gt.textAlign(ai.textAlign||(ai.textAlign=kt.textAlign)),ia=Fr+or+Gi;let fa=_r.x,Li=_r.y;Gt.setWidth(this.width),kn?Qi>0&&fa+ia+pe>this.right&&(Li=_r.y+=jn,_r.line++,fa=_r.x=Wp(mt,this.left+pe,this.right-j[_r.line])):Qi>0&&Li+jn>this.bottom&&(fa=_r.x=fa+z[_r.line].width+pe,_r.line++,Li=_r.y=Wp(mt,this.top+ei+pe,this.bottom-z[_r.line].height));const yi=Gt.x(fa);if(An(yi,Li,ai),fa=Got(un,fa+Fr+or,kn?fa+ia:this.right,l.rtl),Ft(Gt.x(fa),Li,ai),kn)_r.x+=ia+pe;else if(typeof ai.text!="string"){const ra=re.lineHeight;_r.y+=_D(ai,ra)+pe}else _r.y+=jn}),XO(this.ctx,l.textDirection)}drawTitle(){const l=this.options,z=l.title,j=Jp(z.font),J=fm(z.padding);if(!z.display)return;const mt=l_(l.rtl,this.left,this.width),kt=this.ctx,Dt=z.position,Gt=j.size/2,re=J.top+Gt;let pe,Ne=this.left,or=this.width;if(this.isHorizontal())or=Math.max(...this.lineWidths),pe=this.top+re,Ne=Wp(l.align,Ne,this.right-or);else{const Fr=this.columnSizes.reduce((zr,Wr)=>Math.max(zr,Wr.height),0);pe=re+Wp(l.align,this.top,this.bottom-Fr-l.labels.padding-this._computeTitleHeight())}const _r=Wp(Dt,Ne,Ne+or);kt.textAlign=mt.textAlign(oM(Dt)),kt.textBaseline="middle",kt.strokeStyle=z.color,kt.fillStyle=z.color,kt.font=j.string,q2(kt,z.text,_r,pe,j)}_computeTitleHeight(){const l=this.options.title,z=Jp(l.font),j=fm(l.padding);return l.display?z.lineHeight+j.height:0}_getLegendItemAt(l,z){let j,J,mt;if(ev(l,this.left,this.right)&&ev(z,this.top,this.bottom)){for(mt=this.legendHitBoxes,j=0;jmt.length>kt.length?mt:kt)),l+z.size/2+j.measureText(J).width}function Act(d,l,z){let j=d;return typeof l.text!="string"&&(j=_D(l,z)),j}function _D(d,l){const z=d.text?d.text.length:0;return l*z}function Mct(d,l){return!!((d==="mousemove"||d==="mouseout")&&(l.onHover||l.onLeave)||l.onClick&&(d==="click"||d==="mouseup"))}var Sct={id:"legend",_element:qP,start(d,l,z){const j=d.legend=new qP({ctx:d.ctx,options:z,chart:d});om.configure(d,j,z),om.addBox(d,j)},stop(d){om.removeBox(d,d.legend),delete d.legend},beforeUpdate(d,l,z){const j=d.legend;om.configure(d,j,z),j.options=z},afterUpdate(d){const l=d.legend;l.buildLabels(),l.adjustHitBoxes()},afterEvent(d,l){l.replay||d.legend.handleEvent(l.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(d,l,z){const j=l.datasetIndex,J=z.chart;J.isDatasetVisible(j)?(J.hide(j),l.hidden=!0):(J.show(j),l.hidden=!1)},onHover:null,onLeave:null,labels:{color:d=>d.chart.options.color,boxWidth:40,padding:10,generateLabels(d){const l=d.data.datasets,{labels:{usePointStyle:z,pointStyle:j,textAlign:J,color:mt,useBorderRadius:kt,borderRadius:Dt}}=d.legend.options;return d._getSortedDatasetMetas().map(Gt=>{const re=Gt.controller.getStyle(z?0:void 0),pe=fm(re.borderWidth);return{text:l[Gt.index].label,fillStyle:re.backgroundColor,fontColor:mt,hidden:!Gt.visible,lineCap:re.borderCapStyle,lineDash:re.borderDash,lineDashOffset:re.borderDashOffset,lineJoin:re.borderJoinStyle,lineWidth:(pe.width+pe.height)/4,strokeStyle:re.borderColor,pointStyle:j||re.pointStyle,rotation:re.rotation,textAlign:J||re.textAlign,borderRadius:kt&&(Dt||re.borderRadius),datasetIndex:Gt.index}},this)}},title:{color:d=>d.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:d=>!d.startsWith("on"),labels:{_scriptable:d=>!["generateLabels","filter","sort"].includes(d)}}};class bD extends lv{constructor(l){super(),this.chart=l.chart,this.options=l.options,this.ctx=l.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(l,z){const j=this.options;if(this.left=0,this.top=0,!j.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=l,this.height=this.bottom=z;const J=Xd(j.text)?j.text.length:1;this._padding=fm(j.padding);const mt=J*Jp(j.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=mt:this.width=mt}isHorizontal(){const l=this.options.position;return l==="top"||l==="bottom"}_drawArgs(l){const{top:z,left:j,bottom:J,right:mt,options:kt}=this,Dt=kt.align;let Gt=0,re,pe,Ne;return this.isHorizontal()?(pe=Wp(Dt,j,mt),Ne=z+l,re=mt-j):(kt.position==="left"?(pe=j+l,Ne=Wp(Dt,J,z),Gt=Jh*-.5):(pe=mt-l,Ne=Wp(Dt,z,J),Gt=Jh*.5),re=J-z),{titleX:pe,titleY:Ne,maxWidth:re,rotation:Gt}}draw(){const l=this.ctx,z=this.options;if(!z.display)return;const j=Jp(z.font),mt=j.lineHeight/2+this._padding.top,{titleX:kt,titleY:Dt,maxWidth:Gt,rotation:re}=this._drawArgs(mt);q2(l,z.text,0,0,j,{color:z.color,maxWidth:Gt,rotation:re,textAlign:oM(z.align),textBaseline:"middle",translation:[kt,Dt]})}}function Ect(d,l){const z=new bD({ctx:d.ctx,options:l,chart:d});om.configure(d,z,l),om.addBox(d,z),d.titleBlock=z}var Cct={id:"title",_element:bD,start(d,l,z){Ect(d,z)},stop(d){const l=d.titleBlock;om.removeBox(d,l),delete d.titleBlock},beforeUpdate(d,l,z){const j=d.titleBlock;om.configure(d,j,z),j.options=z},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const p2={average(d){if(!d.length)return!1;let l,z,j=new Set,J=0,mt=0;for(l=0,z=d.length;lDt+Gt)/j.size,y:J/mt}},nearest(d,l){if(!d.length)return!1;let z=l.x,j=l.y,J=Number.POSITIVE_INFINITY,mt,kt,Dt;for(mt=0,kt=d.length;mtDt({chart:l,initial:z.initial,numSteps:kt,currentStep:Math.min(j-z.start,kt)}))}_refresh(){this._request||(this._running=!0,this._request=jO.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(l=Date.now()){let z=0;this._charts.forEach((j,J)=>{if(!j.running||!j.items.length)return;const mt=j.items;let kt=mt.length-1,Dt=!1,Gt;for(;kt>=0;--kt)Gt=mt[kt],Gt._active?(Gt._total>j.duration&&(j.duration=Gt._total),Gt.tick(l),Dt=!0):(mt[kt]=mt[mt.length-1],mt.pop());Dt&&(J.draw(),this._notify(J,j,l,"progress")),mt.length||(j.running=!1,this._notify(J,j,l,"complete"),j.initial=!1),z+=mt.length}),this._lastDate=l,z===0&&(this._running=!1)}_getAnims(l){const z=this._charts;let j=z.get(l);return j||(j={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},z.set(l,j)),j}listen(l,z,j){this._getAnims(l).listeners[z].push(j)}add(l,z){!z||!z.length||this._getAnims(l).items.push(...z)}has(l){return this._getAnims(l).items.length>0}start(l){const z=this._charts.get(l);z&&(z.running=!0,z.start=Date.now(),z.duration=z.items.reduce((j,J)=>Math.max(j,J._duration),0),this._refresh())}running(l){if(!this._running)return!1;const z=this._charts.get(l);return!(!z||!z.running||!z.items.length)}stop(l){const z=this._charts.get(l);if(!z||!z.items.length)return;const j=z.items;let J=j.length-1;for(;J>=0;--J)j[J].cancel();z.items=[],this._notify(l,z,Date.now(),"complete")}remove(l){return this._charts.delete(l)}}var Gg=new Qst;const cP="transparent",tlt={boolean(d,l,z){return z>.5?l:d},color(d,l,z){const j=QL(d||cP),J=j.valid&&QL(l||cP);return J&&J.valid?J.mix(j,z).hexString():l},number(d,l,z){return d+(l-d)*z}};class elt{constructor(l,z,j,J){const mt=z[j];J=P5([l.to,J,mt,l.from]);const kt=P5([l.from,mt,J]);this._active=!0,this._fn=l.fn||tlt[l.type||typeof kt],this._easing=M2[l.easing]||M2.linear,this._start=Math.floor(Date.now()+(l.delay||0)),this._duration=this._total=Math.floor(l.duration),this._loop=!!l.loop,this._target=z,this._prop=j,this._from=kt,this._to=J,this._promises=void 0}active(){return this._active}update(l,z,j){if(this._active){this._notify(!1);const J=this._target[this._prop],mt=j-this._start,kt=this._duration-mt;this._start=j,this._duration=Math.floor(Math.max(kt,l.duration)),this._total+=mt,this._loop=!!l.loop,this._to=P5([l.to,z,J,l.from]),this._from=P5([l.from,J,z])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(l){const z=l-this._start,j=this._duration,J=this._prop,mt=this._from,kt=this._loop,Dt=this._to;let Gt;if(this._active=mt!==Dt&&(kt||z1?2-Gt:Gt,Gt=this._easing(Math.min(1,Math.max(0,Gt))),this._target[J]=this._fn(mt,Dt,Gt)}wait(){const l=this._promises||(this._promises=[]);return new Promise((z,j)=>{l.push({res:z,rej:j})})}_notify(l){const z=l?"res":"rej",j=this._promises||[];for(let J=0;J{const mt=l[J];if(!Ec(mt))return;const kt={};for(const Dt of z)kt[Dt]=mt[Dt];(Xd(mt.properties)&&mt.properties||[J]).forEach(Dt=>{(Dt===J||!j.has(Dt))&&j.set(Dt,kt)})})}_animateOptions(l,z){const j=z.options,J=nlt(l,j);if(!J)return[];const mt=this._createAnimations(J,j);return j.$shared&&rlt(l.options.$animations,j).then(()=>{l.options=j},()=>{}),mt}_createAnimations(l,z){const j=this._properties,J=[],mt=l.$animations||(l.$animations={}),kt=Object.keys(z),Dt=Date.now();let Gt;for(Gt=kt.length-1;Gt>=0;--Gt){const re=kt[Gt];if(re.charAt(0)==="$")continue;if(re==="options"){J.push(...this._animateOptions(l,z));continue}const pe=z[re];let Ne=mt[re];const or=j.get(re);if(Ne)if(or&&Ne.active()){Ne.update(or,pe,Dt);continue}else Ne.cancel();if(!or||!or.duration){l[re]=pe;continue}mt[re]=Ne=new elt(or,l,re,pe),J.push(Ne)}return J}update(l,z){if(this._properties.size===0){Object.assign(l,z);return}const j=this._createAnimations(l,z);if(j.length)return Gg.add(this._chart,j),!0}}function rlt(d,l){const z=[],j=Object.keys(l);for(let J=0;J0||!z&&mt<0)return J.index}return null}function pP(d,l){const{chart:z,_cachedMeta:j}=d,J=z._stacks||(z._stacks={}),{iScale:mt,vScale:kt,index:Dt}=j,Gt=mt.axis,re=kt.axis,pe=slt(mt,kt,j),Ne=l.length;let or;for(let _r=0;_rz[j].axis===l).shift()}function clt(d,l){return Cy(d,{active:!1,dataset:void 0,datasetIndex:l,index:l,mode:"default",type:"dataset"})}function hlt(d,l,z){return Cy(d,{active:!1,dataIndex:l,parsed:void 0,raw:void 0,element:z,index:l,mode:"default",type:"data"})}function e2(d,l){const z=d.controller.index,j=d.vScale&&d.vScale.axis;if(j){l=l||d._parsed;for(const J of l){const mt=J._stacks;if(!mt||mt[j]===void 0||mt[j][z]===void 0)return;delete mt[j][z],mt[j]._visualValues!==void 0&&mt[j]._visualValues[z]!==void 0&&delete mt[j]._visualValues[z]}}}const D8=d=>d==="reset"||d==="none",mP=(d,l)=>l?d:Object.assign({},d),flt=(d,l,z)=>d&&!l.hidden&&l._stacked&&{keys:nD(z,!0),values:null};class W4{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(l,z){this.chart=l,this._ctx=l.ctx,this.index=z,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const l=this._cachedMeta;this.configure(),this.linkScales(),l._stacked=I8(l.vScale,l),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(l){this.index!==l&&e2(this._cachedMeta),this.index=l}linkScales(){const l=this.chart,z=this._cachedMeta,j=this.getDataset(),J=(Ne,or,_r,Fr)=>Ne==="x"?or:Ne==="r"?Fr:_r,mt=z.xAxisID=cc(j.xAxisID,O8(l,"x")),kt=z.yAxisID=cc(j.yAxisID,O8(l,"y")),Dt=z.rAxisID=cc(j.rAxisID,O8(l,"r")),Gt=z.indexAxis,re=z.iAxisID=J(Gt,mt,kt,Dt),pe=z.vAxisID=J(Gt,kt,mt,Dt);z.xScale=this.getScaleForId(mt),z.yScale=this.getScaleForId(kt),z.rScale=this.getScaleForId(Dt),z.iScale=this.getScaleForId(re),z.vScale=this.getScaleForId(pe)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(l){return this.chart.scales[l]}_getOtherScale(l){const z=this._cachedMeta;return l===z.iScale?z.vScale:z.iScale}reset(){this._update("reset")}_destroy(){const l=this._cachedMeta;this._data&&KL(this._data,this),l._stacked&&e2(l)}_dataCheck(){const l=this.getDataset(),z=l.data||(l.data=[]),j=this._data;if(Ec(z)){const J=this._cachedMeta;this._data=olt(z,J)}else if(j!==z){if(j){KL(j,this);const J=this._cachedMeta;e2(J),J._parsed=[]}z&&Object.isExtensible(z)&&Got(z,this),this._syncList=[],this._data=z}}addElements(){const l=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(l.dataset=new this.datasetElementType)}buildOrUpdateElements(l){const z=this._cachedMeta,j=this.getDataset();let J=!1;this._dataCheck();const mt=z._stacked;z._stacked=I8(z.vScale,z),z.stack!==j.stack&&(J=!0,e2(z),z.stack=j.stack),this._resyncElements(l),(J||mt!==z._stacked)&&(pP(this,z._parsed),z._stacked=I8(z.vScale,z))}configure(){const l=this.chart.config,z=l.datasetScopeKeys(this._type),j=l.getOptionScopes(this.getDataset(),z,!0);this.options=l.createResolver(j,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(l,z){const{_cachedMeta:j,_data:J}=this,{iScale:mt,_stacked:kt}=j,Dt=mt.axis;let Gt=l===0&&z===J.length?!0:j._sorted,re=l>0&&j._parsed[l-1],pe,Ne,or;if(this._parsing===!1)j._parsed=J,j._sorted=!0,or=J;else{Xd(J[l])?or=this.parseArrayData(j,J,l,z):Ec(J[l])?or=this.parseObjectData(j,J,l,z):or=this.parsePrimitiveData(j,J,l,z);const _r=()=>Ne[Dt]===null||re&&Ne[Dt]zr||Ne=0;--or)if(!Fr()){this.updateRangeFromParsed(re,l,_r,Gt);break}}return re}getAllParsedValues(l){const z=this._cachedMeta._parsed,j=[];let J,mt,kt;for(J=0,mt=z.length;J=0&&lthis.getContext(j,J,z),zr=re.resolveNamedOptions(or,_r,Fr,Ne);return zr.$shared&&(zr.$shared=Gt,mt[kt]=Object.freeze(mP(zr,Gt))),zr}_resolveAnimations(l,z,j){const J=this.chart,mt=this._cachedDataOpts,kt=`animation-${z}`,Dt=mt[kt];if(Dt)return Dt;let Gt;if(J.options.animation!==!1){const pe=this.chart.config,Ne=pe.datasetAnimationScopeKeys(this._type,z),or=pe.getOptionScopes(this.getDataset(),Ne);Gt=pe.createResolver(or,this.getContext(l,j,z))}const re=new rD(J,Gt&&Gt.animations);return Gt&&Gt._cacheable&&(mt[kt]=Object.freeze(re)),re}getSharedOptions(l){if(l.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},l))}includeOptions(l,z){return!z||D8(l)||this.chart._animationsDisabled}_getSharedOptions(l,z){const j=this.resolveDataElementOptions(l,z),J=this._sharedOptions,mt=this.getSharedOptions(j),kt=this.includeOptions(z,mt)||mt!==J;return this.updateSharedOptions(mt,z,j),{sharedOptions:mt,includeOptions:kt}}updateElement(l,z,j,J){D8(J)?Object.assign(l,j):this._resolveAnimations(z,J).update(l,j)}updateSharedOptions(l,z,j){l&&!D8(z)&&this._resolveAnimations(void 0,z).update(l,j)}_setStyle(l,z,j,J){l.active=J;const mt=this.getStyle(z,J);this._resolveAnimations(z,j,J).update(l,{options:!J&&this.getSharedOptions(mt)||mt})}removeHoverStyle(l,z,j){this._setStyle(l,j,"active",!1)}setHoverStyle(l,z,j){this._setStyle(l,j,"active",!0)}_removeDatasetHoverStyle(){const l=this._cachedMeta.dataset;l&&this._setStyle(l,void 0,"active",!1)}_setDatasetHoverStyle(){const l=this._cachedMeta.dataset;l&&this._setStyle(l,void 0,"active",!0)}_resyncElements(l){const z=this._data,j=this._cachedMeta.data;for(const[Dt,Gt,re]of this._syncList)this[Dt](Gt,re);this._syncList=[];const J=j.length,mt=z.length,kt=Math.min(mt,J);kt&&this.parse(0,kt),mt>J?this._insertElements(J,mt-J,l):mt{for(re.length+=z,Dt=re.length-1;Dt>=kt;Dt--)re[Dt]=re[Dt-z]};for(Gt(mt),Dt=l;DtJ-mt))}return d._cache.$bar}function plt(d){const l=d.iScale,z=dlt(l,d.type);let j=l._length,J,mt,kt,Dt;const Gt=()=>{kt===32767||kt===-32768||(U2(Dt)&&(j=Math.min(j,Math.abs(kt-Dt)||j)),Dt=kt)};for(J=0,mt=z.length;J0?J[d-1]:null,Dt=dMath.abs(Dt)&&(Gt=Dt,re=kt),l[z.axis]=re,l._custom={barStart:Gt,barEnd:re,start:J,end:mt,min:kt,max:Dt}}function iD(d,l,z,j){return Xd(d)?vlt(d,l,z,j):l[z.axis]=z.parse(d,j),l}function gP(d,l,z,j){const J=d.iScale,mt=d.vScale,kt=J.getLabels(),Dt=J===mt,Gt=[];let re,pe,Ne,or;for(re=z,pe=z+j;re=z?1:-1)}function xlt(d){let l,z,j,J,mt;return d.horizontal?(l=d.base>d.x,z="left",j="right"):(l=d.basepe.controller.options.grouped),mt=j.options.stacked,kt=[],Dt=this._cachedMeta.controller.getParsed(z),Gt=Dt&&Dt[j.axis],re=pe=>{const Ne=pe._parsed.find(_r=>_r[j.axis]===Gt),or=Ne&&Ne[pe.vScale.axis];if(Rh(or)||isNaN(or))return!0};for(const pe of J)if(!(z!==void 0&&re(pe))&&((mt===!1||kt.indexOf(pe.stack)===-1||mt===void 0&&pe.stack===void 0)&&kt.push(pe.stack),pe.index===l))break;return kt.length||kt.push(void 0),kt}_getStackCount(l){return this._getStacks(void 0,l).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const l=this.chart.scales,z=this.chart.options.indexAxis;return Object.keys(l).filter(j=>l[j].axis===z).shift()}_getAxis(){const l={},z=this.getFirstScaleIdForIndexAxis();for(const j of this.chart.data.datasets)l[cc(this.chart.options.indexAxis==="x"?j.xAxisID:j.yAxisID,z)]=!0;return Object.keys(l)}_getStackIndex(l,z,j){const J=this._getStacks(l,j),mt=z!==void 0?J.indexOf(z):-1;return mt===-1?J.length-1:mt}_getRuler(){const l=this.options,z=this._cachedMeta,j=z.iScale,J=[];let mt,kt;for(mt=0,kt=z.data.length;mtH2(kn,Dt,Gt,!0)?1:Math.max(ei,ei*z,jn,jn*z),Fr=(kn,ei,jn)=>H2(kn,Dt,Gt,!0)?-1:Math.min(ei,ei*z,jn,jn*z),zr=_r(0,re,Ne),Wr=_r(ap,pe,or),An=Fr(Jh,re,Ne),Ft=Fr(Jh+ap,pe,or);j=(zr-An)/2,J=(Wr-Ft)/2,mt=-(zr+An)/2,kt=-(Wr+Ft)/2}return{ratioX:j,ratioY:J,offsetX:mt,offsetY:kt}}class Alt extends W4{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:l=>l!=="spacing",_indexable:l=>l!=="spacing"&&!l.startsWith("borderDash")&&!l.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(l){const z=l.data,{labels:{pointStyle:j,textAlign:J,color:mt,useBorderRadius:kt,borderRadius:Dt}}=l.legend.options;return z.labels.length&&z.datasets.length?z.labels.map((Gt,re)=>{const Ne=l.getDatasetMeta(0).controller.getStyle(re);return{text:Gt,fillStyle:Ne.backgroundColor,fontColor:mt,hidden:!l.getDataVisibility(re),lineDash:Ne.borderDash,lineDashOffset:Ne.borderDashOffset,lineJoin:Ne.borderJoinStyle,lineWidth:Ne.borderWidth,strokeStyle:Ne.borderColor,textAlign:J,pointStyle:j,borderRadius:kt&&(Dt||Ne.borderRadius),index:re}}):[]}},onClick(l,z,j){j.chart.toggleDataVisibility(z.index),j.chart.update()}}}};constructor(l,z){super(l,z),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(l,z){const j=this.getDataset().data,J=this._cachedMeta;if(this._parsing===!1)J._parsed=j;else{let mt=Gt=>+j[Gt];if(Ec(j[l])){const{key:Gt="value"}=this._parsing;mt=re=>+My(j[re],Gt)}let kt,Dt;for(kt=l,Dt=l+z;kt0&&!isNaN(l)?od*(Math.abs(l)/z):0}getLabelAndValue(l){const z=this._cachedMeta,j=this.chart,J=j.data.labels||[],mt=lM(z._parsed[l],j.options.locale);return{label:J[l]||"",value:mt}}getMaxBorderWidth(l){let z=0;const j=this.chart;let J,mt,kt,Dt,Gt;if(!l){for(J=0,mt=j.data.datasets.length;J0&&this.getParsed(z-1);for(let jn=0;jn=Ft){Qi.skip=!0;continue}const Gi=this.getParsed(jn),un=Rh(Gi[_r]),ia=Qi[or]=kt.getPixelForValue(Gi[or],jn),fa=Qi[_r]=mt||un?Dt.getBasePixel():Dt.getPixelForValue(Gt?this.applyStack(Dt,Gi,Gt):Gi[_r],jn);Qi.skip=isNaN(ia)||isNaN(fa)||un,Qi.stop=jn>0&&Math.abs(Gi[or]-ei[or])>Wr,zr&&(Qi.parsed=Gi,Qi.raw=re.data[jn]),Ne&&(Qi.options=pe||this.resolveDataElementOptions(jn,ai.active?"active":J)),An||this.updateElement(ai,jn,Qi,J),ei=Gi}}getMaxOverflow(){const l=this._cachedMeta,z=l.dataset,j=z.options&&z.options.borderWidth||0,J=l.data||[];if(!J.length)return j;const mt=J[0].size(this.resolveDataElementOptions(0)),kt=J[J.length-1].size(this.resolveDataElementOptions(J.length-1));return Math.max(j,mt,kt)/2}draw(){const l=this._cachedMeta;l.dataset.updateControlPoints(this.chart.chartArea,l.iScale.axis),super.draw()}}function uy(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class mM{static override(l){Object.assign(mM.prototype,l)}options;constructor(l){this.options=l||{}}init(){}formats(){return uy()}parse(){return uy()}format(){return uy()}add(){return uy()}diff(){return uy()}startOf(){return uy()}endOf(){return uy()}}var aD={_date:mM};function Slt(d,l,z,j){const{controller:J,data:mt,_sorted:kt}=d,Dt=J._cachedMeta.iScale,Gt=d.dataset&&d.dataset.options?d.dataset.options.spanGaps:null;if(Dt&&l===Dt.axis&&l!=="r"&&kt&&mt.length){const re=Dt._reversePixels?Zot:yy;if(j){if(J._sharedOptions){const pe=mt[0],Ne=typeof pe.getRange=="function"&&pe.getRange(l);if(Ne){const or=re(mt,l,z-Ne),_r=re(mt,l,z+Ne);return{lo:or.lo,hi:_r.hi}}}}else{const pe=re(mt,l,z);if(Gt){const{vScale:Ne}=J._cachedMeta,{_parsed:or}=d,_r=or.slice(0,pe.lo+1).reverse().findIndex(zr=>!Rh(zr[Ne.axis]));pe.lo-=Math.max(0,_r);const Fr=or.slice(pe.hi).findIndex(zr=>!Rh(zr[Ne.axis]));pe.hi+=Math.max(0,Fr)}return pe}}return{lo:0,hi:mt.length-1}}function q4(d,l,z,j,J){const mt=d.getSortedVisibleDatasetMetas(),kt=z[l];for(let Dt=0,Gt=mt.length;Dt{Gt[kt]&&Gt[kt](l[z],J)&&(mt.push({element:Gt,datasetIndex:re,index:pe}),Dt=Dt||Gt.inRange(l.x,l.y,J))}),j&&!Dt?[]:mt}var Plt={modes:{index(d,l,z,j){const J=hy(l,d),mt=z.axis||"x",kt=z.includeInvisible||!1,Dt=z.intersect?R8(d,J,mt,j,kt):B8(d,J,mt,!1,j,kt),Gt=[];return Dt.length?(d.getSortedVisibleDatasetMetas().forEach(re=>{const pe=Dt[0].index,Ne=re.data[pe];Ne&&!Ne.skip&&Gt.push({element:Ne,datasetIndex:re.index,index:pe})}),Gt):[]},dataset(d,l,z,j){const J=hy(l,d),mt=z.axis||"xy",kt=z.includeInvisible||!1;let Dt=z.intersect?R8(d,J,mt,j,kt):B8(d,J,mt,!1,j,kt);if(Dt.length>0){const Gt=Dt[0].datasetIndex,re=d.getDatasetMeta(Gt).data;Dt=[];for(let pe=0;pez.pos===l)}function _P(d,l){return d.filter(z=>oD.indexOf(z.pos)===-1&&z.box.axis===l)}function n2(d,l){return d.sort((z,j)=>{const J=l?j:z,mt=l?z:j;return J.weight===mt.weight?J.index-mt.index:J.weight-mt.weight})}function zlt(d){const l=[];let z,j,J,mt,kt,Dt;for(z=0,j=(d||[]).length;zre.box.fullSize),!0),j=n2(r2(l,"left"),!0),J=n2(r2(l,"right")),mt=n2(r2(l,"top"),!0),kt=n2(r2(l,"bottom")),Dt=_P(l,"x"),Gt=_P(l,"y");return{fullSize:z,leftAndTop:j.concat(mt),rightAndBottom:J.concat(Gt).concat(kt).concat(Dt),chartArea:r2(l,"chartArea"),vertical:j.concat(J).concat(Gt),horizontal:mt.concat(kt).concat(Dt)}}function bP(d,l,z,j){return Math.max(d[z],l[z])+Math.max(d[j],l[j])}function sD(d,l){d.top=Math.max(d.top,l.top),d.left=Math.max(d.left,l.left),d.bottom=Math.max(d.bottom,l.bottom),d.right=Math.max(d.right,l.right)}function Flt(d,l,z,j){const{pos:J,box:mt}=z,kt=d.maxPadding;if(!Ec(J)){z.size&&(d[J]-=z.size);const Ne=j[z.stack]||{size:0,count:1};Ne.size=Math.max(Ne.size,z.horizontal?mt.height:mt.width),z.size=Ne.size/Ne.count,d[J]+=z.size}mt.getPadding&&sD(kt,mt.getPadding());const Dt=Math.max(0,l.outerWidth-bP(kt,d,"left","right")),Gt=Math.max(0,l.outerHeight-bP(kt,d,"top","bottom")),re=Dt!==d.w,pe=Gt!==d.h;return d.w=Dt,d.h=Gt,z.horizontal?{same:re,other:pe}:{same:pe,other:re}}function Rlt(d){const l=d.maxPadding;function z(j){const J=Math.max(l[j]-d[j],0);return d[j]+=J,J}d.y+=z("top"),d.x+=z("left"),z("right"),z("bottom")}function Blt(d,l){const z=l.maxPadding;function j(J){const mt={left:0,top:0,right:0,bottom:0};return J.forEach(kt=>{mt[kt]=Math.max(l[kt],z[kt])}),mt}return j(d?["left","right"]:["top","bottom"])}function f2(d,l,z,j){const J=[];let mt,kt,Dt,Gt,re,pe;for(mt=0,kt=d.length,re=0;mt{typeof zr.beforeLayout=="function"&&zr.beforeLayout()});const pe=Gt.reduce((zr,Wr)=>Wr.box.options&&Wr.box.options.display===!1?zr:zr+1,0)||1,Ne=Object.freeze({outerWidth:l,outerHeight:z,padding:J,availableWidth:mt,availableHeight:kt,vBoxMaxWidth:mt/2/pe,hBoxMaxHeight:kt/2}),or=Object.assign({},J);sD(or,fm(j));const _r=Object.assign({maxPadding:or,w:mt,h:kt,x:J.left,y:J.top},J),Fr=Olt(Gt.concat(re),Ne);f2(Dt.fullSize,_r,Ne,Fr),f2(Gt,_r,Ne,Fr),f2(re,_r,Ne,Fr)&&f2(Gt,_r,Ne,Fr),Rlt(_r),wP(Dt.leftAndTop,_r,Ne,Fr),_r.x+=_r.w,_r.y+=_r.h,wP(Dt.rightAndBottom,_r,Ne,Fr),d.chartArea={left:_r.left,top:_r.top,right:_r.left+_r.w,bottom:_r.top+_r.h,height:_r.h,width:_r.w},Kh(Dt.chartArea,zr=>{const Wr=zr.box;Object.assign(Wr,d.chartArea),Wr.update(_r.w,_r.h,{left:0,top:0,right:0,bottom:0})})}};class lD{acquireContext(l,z){}releaseContext(l){return!1}addEventListener(l,z,j){}removeEventListener(l,z,j){}getDevicePixelRatio(){return 1}getMaximumSize(l,z,j,J){return z=Math.max(0,z||l.width),j=j||l.height,{width:z,height:Math.max(0,J?Math.floor(z/J):j)}}isAttached(l){return!0}updateConfig(l){}}class Nlt extends lD{acquireContext(l){return l&&l.getContext&&l.getContext("2d")||null}updateConfig(l){l.options.animation=!1}}const K5="$chartjs",jlt={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},kP=d=>d===null||d==="";function Ult(d,l){const z=d.style,j=d.getAttribute("height"),J=d.getAttribute("width");if(d[K5]={initial:{height:j,width:J,style:{display:z.display,height:z.height,width:z.width}}},z.display=z.display||"block",z.boxSizing=z.boxSizing||"border-box",kP(J)){const mt=oP(d,"width");mt!==void 0&&(d.width=mt)}if(kP(j))if(d.style.height==="")d.height=d.width/(l||2);else{const mt=oP(d,"height");mt!==void 0&&(d.height=mt)}return d}const uD=Ust?{passive:!0}:!1;function Vlt(d,l,z){d&&d.addEventListener(l,z,uD)}function Hlt(d,l,z){d&&d.canvas&&d.canvas.removeEventListener(l,z,uD)}function Wlt(d,l){const z=jlt[d.type]||d.type,{x:j,y:J}=hy(d,l);return{type:z,chart:l,native:d,x:j!==void 0?j:null,y:J!==void 0?J:null}}function g4(d,l){for(const z of d)if(z===l||z.contains(l))return!0}function qlt(d,l,z){const j=d.canvas,J=new MutationObserver(mt=>{let kt=!1;for(const Dt of mt)kt=kt||g4(Dt.addedNodes,j),kt=kt&&!g4(Dt.removedNodes,j);kt&&z()});return J.observe(document,{childList:!0,subtree:!0}),J}function Zlt(d,l,z){const j=d.canvas,J=new MutationObserver(mt=>{let kt=!1;for(const Dt of mt)kt=kt||g4(Dt.removedNodes,j),kt=kt&&!g4(Dt.addedNodes,j);kt&&z()});return J.observe(document,{childList:!0,subtree:!0}),J}const Z2=new Map;let TP=0;function cD(){const d=window.devicePixelRatio;d!==TP&&(TP=d,Z2.forEach((l,z)=>{z.currentDevicePixelRatio!==d&&l()}))}function $lt(d,l){Z2.size||window.addEventListener("resize",cD),Z2.set(d,l)}function Glt(d){Z2.delete(d),Z2.size||window.removeEventListener("resize",cD)}function Ylt(d,l,z){const j=d.canvas,J=j&&pM(j);if(!J)return;const mt=UO((Dt,Gt)=>{const re=J.clientWidth;z(Dt,Gt),re{const Gt=Dt[0],re=Gt.contentRect.width,pe=Gt.contentRect.height;re===0&&pe===0||mt(re,pe)});return kt.observe(J),$lt(d,mt),kt}function N8(d,l,z){z&&z.disconnect(),l==="resize"&&Glt(d)}function Klt(d,l,z){const j=d.canvas,J=UO(mt=>{d.ctx!==null&&z(Wlt(mt,d))},d);return Vlt(j,l,J),J}class Xlt extends lD{acquireContext(l,z){const j=l&&l.getContext&&l.getContext("2d");return j&&j.canvas===l?(Ult(l,z),j):null}releaseContext(l){const z=l.canvas;if(!z[K5])return!1;const j=z[K5].initial;["height","width"].forEach(mt=>{const kt=j[mt];Rh(kt)?z.removeAttribute(mt):z.setAttribute(mt,kt)});const J=j.style||{};return Object.keys(J).forEach(mt=>{z.style[mt]=J[mt]}),z.width=z.width,delete z[K5],!0}addEventListener(l,z,j){this.removeEventListener(l,z);const J=l.$proxies||(l.$proxies={}),kt={attach:qlt,detach:Zlt,resize:Ylt}[z]||Klt;J[z]=kt(l,z,j)}removeEventListener(l,z){const j=l.$proxies||(l.$proxies={}),J=j[z];if(!J)return;({attach:N8,detach:N8,resize:N8}[z]||Hlt)(l,z,J),j[z]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(l,z,j,J){return jst(l,z,j,J)}isAttached(l){const z=l&&pM(l);return!!(z&&z.isConnected)}}function Jlt(d){return!dM()||typeof OffscreenCanvas<"u"&&d instanceof OffscreenCanvas?Nlt:Xlt}let lv=class{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(l){const{x:z,y:j}=this.getProps(["x","y"],l);return{x:z,y:j}}hasValue(){return V2(this.x)&&V2(this.y)}getProps(l,z){const j=this.$animations;if(!z||!j)return this;const J={};return l.forEach(mt=>{J[mt]=j[mt]&&j[mt].active()?j[mt]._to:this[mt]}),J}};function Qlt(d,l){const z=d.options.ticks,j=tut(d),J=Math.min(z.maxTicksLimit||j,j),mt=z.major.enabled?rut(l):[],kt=mt.length,Dt=mt[0],Gt=mt[kt-1],re=[];if(kt>J)return nut(l,re,mt,kt/J),re;const pe=eut(mt,l,J);if(kt>0){let Ne,or;const _r=kt>1?Math.round((Gt-Dt)/(kt-1)):null;for(D5(l,re,pe,Rh(_r)?0:Dt-_r,Dt),Ne=0,or=kt-1;NeJ)return Gt}return Math.max(J,1)}function rut(d){const l=[];let z,j;for(z=0,j=d.length;zd==="left"?"right":d==="right"?"left":d,AP=(d,l,z)=>l==="top"||l==="left"?d[l]+z:d[l]-z,MP=(d,l)=>Math.min(l||d,d);function SP(d,l){const z=[],j=d.length/l,J=d.length;let mt=0;for(;mtkt+Dt)))return Gt}function sut(d,l){Kh(d,z=>{const j=z.gc,J=j.length/2;let mt;if(J>l){for(mt=0;mtj?j:z,j=J&&z>j?z:j,{min:eg(z,eg(j,z)),max:eg(j,eg(z,j))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const l=this.chart.data;return this.options.labels||(this.isHorizontal()?l.xLabels:l.yLabels)||l.labels||[]}getLabelItems(l=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(l))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Df(this.options.beforeUpdate,[this])}update(l,z,j){const{beginAtZero:J,grace:mt,ticks:kt}=this.options,Dt=kt.sampleSize;this.beforeUpdate(),this.maxWidth=l,this.maxHeight=z,this._margins=j=Object.assign({left:0,right:0,top:0,bottom:0},j),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+j.left+j.right:this.height+j.top+j.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=yst(this,mt,J),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const Gt=Dt=mt||j<=1||!this.isHorizontal()){this.labelRotation=J;return}const pe=this._getLabelSizes(),Ne=pe.widest.width,or=pe.highest.height,_r=Xp(this.chart.width-Ne,0,this.maxWidth);Dt=l.offset?this.maxWidth/j:_r/(j-1),Ne+6>Dt&&(Dt=_r/(j-(l.offset?.5:1)),Gt=this.maxHeight-i2(l.grid)-z.padding-EP(l.title,this.chart.options.font),re=Math.sqrt(Ne*Ne+or*or),kt=Hot(Math.min(Math.asin(Xp((pe.highest.height+6)/Dt,-1,1)),Math.asin(Xp(Gt/re,-1,1))-Math.asin(Xp(or/re,-1,1)))),kt=Math.max(J,Math.min(mt,kt))),this.labelRotation=kt}afterCalculateLabelRotation(){Df(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Df(this.options.beforeFit,[this])}fit(){const l={width:0,height:0},{chart:z,options:{ticks:j,title:J,grid:mt}}=this,kt=this._isVisible(),Dt=this.isHorizontal();if(kt){const Gt=EP(J,z.options.font);if(Dt?(l.width=this.maxWidth,l.height=i2(mt)+Gt):(l.height=this.maxHeight,l.width=i2(mt)+Gt),j.display&&this.ticks.length){const{first:re,last:pe,widest:Ne,highest:or}=this._getLabelSizes(),_r=j.padding*2,Fr=tv(this.labelRotation),zr=Math.cos(Fr),Wr=Math.sin(Fr);if(Dt){const An=j.mirror?0:Wr*Ne.width+zr*or.height;l.height=Math.min(this.maxHeight,l.height+An+_r)}else{const An=j.mirror?0:zr*Ne.width+Wr*or.height;l.width=Math.min(this.maxWidth,l.width+An+_r)}this._calculatePadding(re,pe,Wr,zr)}}this._handleMargins(),Dt?(this.width=this._length=z.width-this._margins.left-this._margins.right,this.height=l.height):(this.width=l.width,this.height=this._length=z.height-this._margins.top-this._margins.bottom)}_calculatePadding(l,z,j,J){const{ticks:{align:mt,padding:kt},position:Dt}=this.options,Gt=this.labelRotation!==0,re=Dt!=="top"&&this.axis==="x";if(this.isHorizontal()){const pe=this.getPixelForTick(0)-this.left,Ne=this.right-this.getPixelForTick(this.ticks.length-1);let or=0,_r=0;Gt?re?(or=J*l.width,_r=j*z.height):(or=j*l.height,_r=J*z.width):mt==="start"?_r=z.width:mt==="end"?or=l.width:mt!=="inner"&&(or=l.width/2,_r=z.width/2),this.paddingLeft=Math.max((or-pe+kt)*this.width/(this.width-pe),0),this.paddingRight=Math.max((_r-Ne+kt)*this.width/(this.width-Ne),0)}else{let pe=z.height/2,Ne=l.height/2;mt==="start"?(pe=0,Ne=l.height):mt==="end"&&(pe=z.height,Ne=0),this.paddingTop=pe+kt,this.paddingBottom=Ne+kt}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Df(this.options.afterFit,[this])}isHorizontal(){const{axis:l,position:z}=this.options;return z==="top"||z==="bottom"||l==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(l){this.beforeTickToLabelConversion(),this.generateTickLabels(l);let z,j;for(z=0,j=l.length;z({width:kt[un]||0,height:Dt[un]||0});return{first:Gi(0),last:Gi(z-1),widest:Gi(ai),highest:Gi(Qi),widths:kt,heights:Dt}}getLabelForValue(l){return l}getPixelForValue(l,z){return NaN}getValueForPixel(l){}getPixelForTick(l){const z=this.ticks;return l<0||l>z.length-1?null:this.getPixelForValue(z[l].value)}getPixelForDecimal(l){this._reversePixels&&(l=1-l);const z=this._startPixel+l*this._length;return qot(this._alignToPixels?ly(this.chart,z,0):z)}getDecimalForPixel(l){const z=(l-this._startPixel)/this._length;return this._reversePixels?1-z:z}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:l,max:z}=this;return l<0&&z<0?z:l>0&&z>0?l:0}getContext(l){const z=this.ticks||[];if(l>=0&&lDt*J?Dt/j:Gt/J:Gt*J0}_computeGridLineItems(l){const z=this.axis,j=this.chart,J=this.options,{grid:mt,position:kt,border:Dt}=J,Gt=mt.offset,re=this.isHorizontal(),Ne=this.ticks.length+(Gt?1:0),or=i2(mt),_r=[],Fr=Dt.setContext(this.getContext()),zr=Fr.display?Fr.width:0,Wr=zr/2,An=function(Ni){return ly(j,Ni,zr)};let Ft,kn,ei,jn,ai,Qi,Gi,un,ia,fa,Li,yi;if(kt==="top")Ft=An(this.bottom),Qi=this.bottom-or,un=Ft-Wr,fa=An(l.top)+Wr,yi=l.bottom;else if(kt==="bottom")Ft=An(this.top),fa=l.top,yi=An(l.bottom)-Wr,Qi=Ft+Wr,un=this.top+or;else if(kt==="left")Ft=An(this.right),ai=this.right-or,Gi=Ft-Wr,ia=An(l.left)+Wr,Li=l.right;else if(kt==="right")Ft=An(this.left),ia=l.left,Li=An(l.right)-Wr,ai=Ft+Wr,Gi=this.left+or;else if(z==="x"){if(kt==="center")Ft=An((l.top+l.bottom)/2+.5);else if(Ec(kt)){const Ni=Object.keys(kt)[0],Ei=kt[Ni];Ft=An(this.chart.scales[Ni].getPixelForValue(Ei))}fa=l.top,yi=l.bottom,Qi=Ft+Wr,un=Qi+or}else if(z==="y"){if(kt==="center")Ft=An((l.left+l.right)/2);else if(Ec(kt)){const Ni=Object.keys(kt)[0],Ei=kt[Ni];Ft=An(this.chart.scales[Ni].getPixelForValue(Ei))}ai=Ft-Wr,Gi=ai-or,ia=l.left,Li=l.right}const ra=cc(J.ticks.maxTicksLimit,Ne),Da=Math.max(1,Math.ceil(Ne/ra));for(kn=0;kn0&&(Ta-=qo/2);break}ko={left:Ta,top:fo,width:qo+pl.width,height:fu+pl.height,color:Da.backdropColor}}Wr.push({label:ei,font:un,textOffset:Li,options:{rotation:zr,color:Ei,strokeColor:Va,strokeWidth:ss,textAlign:mo,textBaseline:yi,translation:[jn,ai],backdrop:ko}})}return Wr}_getXAxisLabelAlignment(){const{position:l,ticks:z}=this.options;if(-tv(this.labelRotation))return l==="top"?"left":"right";let J="center";return z.align==="start"?J="left":z.align==="end"?J="right":z.align==="inner"&&(J="inner"),J}_getYAxisLabelAlignment(l){const{position:z,ticks:{crossAlign:j,mirror:J,padding:mt}}=this.options,kt=this._getLabelSizes(),Dt=l+mt,Gt=kt.widest.width;let re,pe;return z==="left"?J?(pe=this.right+mt,j==="near"?re="left":j==="center"?(re="center",pe+=Gt/2):(re="right",pe+=Gt)):(pe=this.right-Dt,j==="near"?re="right":j==="center"?(re="center",pe-=Gt/2):(re="left",pe=this.left)):z==="right"?J?(pe=this.left+mt,j==="near"?re="right":j==="center"?(re="center",pe-=Gt/2):(re="left",pe-=Gt)):(pe=this.left+Dt,j==="near"?re="left":j==="center"?(re="center",pe+=Gt/2):(re="right",pe=this.right)):re="right",{textAlign:re,x:pe}}_computeLabelArea(){if(this.options.ticks.mirror)return;const l=this.chart,z=this.options.position;if(z==="left"||z==="right")return{top:0,left:this.left,bottom:l.height,right:this.right};if(z==="top"||z==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:l.width}}drawBackground(){const{ctx:l,options:{backgroundColor:z},left:j,top:J,width:mt,height:kt}=this;z&&(l.save(),l.fillStyle=z,l.fillRect(j,J,mt,kt),l.restore())}getLineWidthForValue(l){const z=this.options.grid;if(!this._isVisible()||!z.display)return 0;const J=this.ticks.findIndex(mt=>mt.value===l);return J>=0?z.setContext(this.getContext(J)).lineWidth:0}drawGrid(l){const z=this.options.grid,j=this.ctx,J=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(l));let mt,kt;const Dt=(Gt,re,pe)=>{!pe.width||!pe.color||(j.save(),j.lineWidth=pe.width,j.strokeStyle=pe.color,j.setLineDash(pe.borderDash||[]),j.lineDashOffset=pe.borderDashOffset,j.beginPath(),j.moveTo(Gt.x,Gt.y),j.lineTo(re.x,re.y),j.stroke(),j.restore())};if(z.display)for(mt=0,kt=J.length;mt{this.draw(mt)}}]:[{z:j,draw:mt=>{this.drawBackground(),this.drawGrid(mt),this.drawTitle()}},{z:J,draw:()=>{this.drawBorder()}},{z,draw:mt=>{this.drawLabels(mt)}}]}getMatchingVisibleMetas(l){const z=this.chart.getSortedVisibleDatasetMetas(),j=this.axis+"AxisID",J=[];let mt,kt;for(mt=0,kt=z.length;mt{const j=z.split("."),J=j.pop(),mt=[d].concat(j).join("."),kt=l[z].split("."),Dt=kt.pop(),Gt=kt.join(".");Bd.route(mt,J,Gt,Dt)})}function put(d){return"id"in d&&"defaults"in d}class mut{constructor(){this.controllers=new F5(W4,"datasets",!0),this.elements=new F5(lv,"elements"),this.plugins=new F5(Object,"plugins"),this.scales=new F5(__,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...l){this._each("register",l)}remove(...l){this._each("unregister",l)}addControllers(...l){this._each("register",l,this.controllers)}addElements(...l){this._each("register",l,this.elements)}addPlugins(...l){this._each("register",l,this.plugins)}addScales(...l){this._each("register",l,this.scales)}getController(l){return this._get(l,this.controllers,"controller")}getElement(l){return this._get(l,this.elements,"element")}getPlugin(l){return this._get(l,this.plugins,"plugin")}getScale(l){return this._get(l,this.scales,"scale")}removeControllers(...l){this._each("unregister",l,this.controllers)}removeElements(...l){this._each("unregister",l,this.elements)}removePlugins(...l){this._each("unregister",l,this.plugins)}removeScales(...l){this._each("unregister",l,this.scales)}_each(l,z,j){[...z].forEach(J=>{const mt=j||this._getRegistryForType(J);j||mt.isForType(J)||mt===this.plugins&&J.id?this._exec(l,mt,J):Kh(J,kt=>{const Dt=j||this._getRegistryForType(kt);this._exec(l,Dt,kt)})})}_exec(l,z,j){const J=iM(l);Df(j["before"+J],[],j),z[l](j),Df(j["after"+J],[],j)}_getRegistryForType(l){for(let z=0;zmt.filter(Dt=>!kt.some(Gt=>Dt.plugin.id===Gt.plugin.id));this._notify(J(z,j),l,"stop"),this._notify(J(j,z),l,"start")}}function vut(d){const l={},z=[],j=Object.keys(ag.plugins.items);for(let mt=0;mt1&&CP(d[0].toLowerCase());if(j)return j}throw new Error(`Cannot determine type of '${d}' axis. Please provide 'axis' or 'position' option.`)}function LP(d,l,z){if(z[l+"AxisID"]===d)return{axis:l}}function Tut(d,l){if(l.data&&l.data.datasets){const z=l.data.datasets.filter(j=>j.xAxisID===d||j.yAxisID===d);if(z.length)return LP(d,"x",z[0])||LP(d,"y",z[0])}return{}}function Aut(d,l){const z=Sy[d.type]||{scales:{}},j=l.scales||{},J=xA(d.type,l),mt=Object.create(null);return Object.keys(j).forEach(kt=>{const Dt=j[kt];if(!Ec(Dt))return console.error(`Invalid scale configuration for scale: ${kt}`);if(Dt._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${kt}`);const Gt=_A(kt,Dt,Tut(kt,d),Bd.scales[Dt.type]),re=wut(Gt,J),pe=z.scales||{};mt[kt]=T2(Object.create(null),[{axis:Gt},Dt,pe[Gt],pe[re]])}),d.data.datasets.forEach(kt=>{const Dt=kt.type||d.type,Gt=kt.indexAxis||xA(Dt,l),pe=(Sy[Dt]||{}).scales||{};Object.keys(pe).forEach(Ne=>{const or=but(Ne,Gt),_r=kt[or+"AxisID"]||or;mt[_r]=mt[_r]||Object.create(null),T2(mt[_r],[{axis:or},j[_r],pe[Ne]])})}),Object.keys(mt).forEach(kt=>{const Dt=mt[kt];T2(Dt,[Bd.scales[Dt.type],Bd.scale])}),mt}function hD(d){const l=d.options||(d.options={});l.plugins=cc(l.plugins,{}),l.scales=Aut(d,l)}function fD(d){return d=d||{},d.datasets=d.datasets||[],d.labels=d.labels||[],d}function Mut(d){return d=d||{},d.data=fD(d.data),hD(d),d}const PP=new Map,dD=new Set;function R5(d,l){let z=PP.get(d);return z||(z=l(),PP.set(d,z),dD.add(z)),z}const a2=(d,l,z)=>{const j=My(l,z);j!==void 0&&d.add(j)};class Sut{constructor(l){this._config=Mut(l),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(l){this._config.type=l}get data(){return this._config.data}set data(l){this._config.data=fD(l)}get options(){return this._config.options}set options(l){this._config.options=l}get plugins(){return this._config.plugins}update(){const l=this._config;this.clearCache(),hD(l)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(l){return R5(l,()=>[[`datasets.${l}`,""]])}datasetAnimationScopeKeys(l,z){return R5(`${l}.transition.${z}`,()=>[[`datasets.${l}.transitions.${z}`,`transitions.${z}`],[`datasets.${l}`,""]])}datasetElementScopeKeys(l,z){return R5(`${l}-${z}`,()=>[[`datasets.${l}.elements.${z}`,`datasets.${l}`,`elements.${z}`,""]])}pluginScopeKeys(l){const z=l.id,j=this.type;return R5(`${j}-plugin-${z}`,()=>[[`plugins.${z}`,...l.additionalOptionScopes||[]]])}_cachedScopes(l,z){const j=this._scopeCache;let J=j.get(l);return(!J||z)&&(J=new Map,j.set(l,J)),J}getOptionScopes(l,z,j){const{options:J,type:mt}=this,kt=this._cachedScopes(l,j),Dt=kt.get(z);if(Dt)return Dt;const Gt=new Set;z.forEach(pe=>{l&&(Gt.add(l),pe.forEach(Ne=>a2(Gt,l,Ne))),pe.forEach(Ne=>a2(Gt,J,Ne)),pe.forEach(Ne=>a2(Gt,Sy[mt]||{},Ne)),pe.forEach(Ne=>a2(Gt,Bd,Ne)),pe.forEach(Ne=>a2(Gt,vA,Ne))});const re=Array.from(Gt);return re.length===0&&re.push(Object.create(null)),dD.has(z)&&kt.set(z,re),re}chartOptionScopes(){const{options:l,type:z}=this;return[l,Sy[z]||{},Bd.datasets[z]||{},{type:z},Bd,vA]}resolveNamedOptions(l,z,j,J=[""]){const mt={$shared:!0},{resolver:kt,subPrefixes:Dt}=zP(this._resolverCache,l,J);let Gt=kt;if(Cut(kt,z)){mt.$shared=!1,j=v1(j)?j():j;const re=this.createResolver(l,j,Dt);Gt=m_(kt,j,re)}for(const re of z)mt[re]=Gt[re];return mt}createResolver(l,z,j=[""],J){const{resolver:mt}=zP(this._resolverCache,l,j);return Ec(z)?m_(mt,z,void 0,J):mt}}function zP(d,l,z){let j=d.get(l);j||(j=new Map,d.set(l,j));const J=z.join();let mt=j.get(J);return mt||(mt={resolver:cM(l,z),subPrefixes:z.filter(Dt=>!Dt.toLowerCase().includes("hover"))},j.set(J,mt)),mt}const Eut=d=>Ec(d)&&Object.getOwnPropertyNames(d).some(l=>v1(d[l]));function Cut(d,l){const{isScriptable:z,isIndexable:j}=qO(d);for(const J of l){const mt=z(J),kt=j(J),Dt=(kt||mt)&&d[J];if(mt&&(v1(Dt)||Eut(Dt))||kt&&Xd(Dt))return!0}return!1}var Lut="4.5.1";const Put=["top","bottom","left","right","chartArea"];function IP(d,l){return d==="top"||d==="bottom"||Put.indexOf(d)===-1&&l==="x"}function OP(d,l){return function(z,j){return z[d]===j[d]?z[l]-j[l]:z[d]-j[d]}}function DP(d){const l=d.chart,z=l.options.animation;l.notifyPlugins("afterRender"),Df(z&&z.onComplete,[d],l)}function zut(d){const l=d.chart,z=l.options.animation;Df(z&&z.onProgress,[d],l)}function pD(d){return dM()&&typeof d=="string"?d=document.getElementById(d):d&&d.length&&(d=d[0]),d&&d.canvas&&(d=d.canvas),d}const X5={},FP=d=>{const l=pD(d);return Object.values(X5).filter(z=>z.canvas===l).pop()};function Iut(d,l,z){const j=Object.keys(d);for(const J of j){const mt=+J;if(mt>=l){const kt=d[J];delete d[J],(z>0||mt>l)&&(d[mt+z]=kt)}}}function Out(d,l,z,j){return!z||d.type==="mouseout"?null:j?l:d}class d2{static defaults=Bd;static instances=X5;static overrides=Sy;static registry=ag;static version=Lut;static getChart=FP;static register(...l){ag.add(...l),RP()}static unregister(...l){ag.remove(...l),RP()}constructor(l,z){const j=this.config=new Sut(z),J=pD(l),mt=FP(J);if(mt)throw new Error("Canvas is already in use. Chart with ID '"+mt.id+"' must be destroyed before the canvas with ID '"+mt.canvas.id+"' can be reused.");const kt=j.createResolver(j.chartOptionScopes(),this.getContext());this.platform=new(j.platform||Jlt(J)),this.platform.updateConfig(j);const Dt=this.platform.acquireContext(J,kt.aspectRatio),Gt=Dt&&Dt.canvas,re=Gt&&Gt.height,pe=Gt&&Gt.width;if(this.id=Lot(),this.ctx=Dt,this.canvas=Gt,this.width=pe,this.height=re,this._options=kt,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new gut,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Yot(Ne=>this.update(Ne),kt.resizeDelay||0),this._dataChanges=[],X5[this.id]=this,!Dt||!Gt){console.error("Failed to create chart: can't acquire context from the given item");return}Gg.listen(this,"complete",DP),Gg.listen(this,"progress",zut),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:l,maintainAspectRatio:z},width:j,height:J,_aspectRatio:mt}=this;return Rh(l)?z&&mt?mt:J?j/J:null:l}get data(){return this.config.data}set data(l){this.config.data=l}get options(){return this._options}set options(l){this.config.options=l}get registry(){return ag}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():aP(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return rP(this.canvas,this.ctx),this}stop(){return Gg.stop(this),this}resize(l,z){Gg.running(this)?this._resizeBeforeDraw={width:l,height:z}:this._resize(l,z)}_resize(l,z){const j=this.options,J=this.canvas,mt=j.maintainAspectRatio&&this.aspectRatio,kt=this.platform.getMaximumSize(J,l,z,mt),Dt=j.devicePixelRatio||this.platform.getDevicePixelRatio(),Gt=this.width?"resize":"attach";this.width=kt.width,this.height=kt.height,this._aspectRatio=this.aspectRatio,aP(this,Dt,!0)&&(this.notifyPlugins("resize",{size:kt}),Df(j.onResize,[this,kt],this),this.attached&&this._doResize(Gt)&&this.render())}ensureScalesHaveIDs(){const z=this.options.scales||{};Kh(z,(j,J)=>{j.id=J})}buildOrUpdateScales(){const l=this.options,z=l.scales,j=this.scales,J=Object.keys(j).reduce((kt,Dt)=>(kt[Dt]=!1,kt),{});let mt=[];z&&(mt=mt.concat(Object.keys(z).map(kt=>{const Dt=z[kt],Gt=_A(kt,Dt),re=Gt==="r",pe=Gt==="x";return{options:Dt,dposition:re?"chartArea":pe?"bottom":"left",dtype:re?"radialLinear":pe?"category":"linear"}}))),Kh(mt,kt=>{const Dt=kt.options,Gt=Dt.id,re=_A(Gt,Dt),pe=cc(Dt.type,kt.dtype);(Dt.position===void 0||IP(Dt.position,re)!==IP(kt.dposition))&&(Dt.position=kt.dposition),J[Gt]=!0;let Ne=null;if(Gt in j&&j[Gt].type===pe)Ne=j[Gt];else{const or=ag.getScale(pe);Ne=new or({id:Gt,type:pe,ctx:this.ctx,chart:this}),j[Ne.id]=Ne}Ne.init(Dt,l)}),Kh(J,(kt,Dt)=>{kt||delete j[Dt]}),Kh(j,kt=>{om.configure(this,kt,kt.options),om.addBox(this,kt)})}_updateMetasets(){const l=this._metasets,z=this.data.datasets.length,j=l.length;if(l.sort((J,mt)=>J.index-mt.index),j>z){for(let J=z;Jz.length&&delete this._stacks,l.forEach((j,J)=>{z.filter(mt=>mt===j._dataset).length===0&&this._destroyDatasetMeta(J)})}buildOrUpdateControllers(){const l=[],z=this.data.datasets;let j,J;for(this._removeUnreferencedMetasets(),j=0,J=z.length;j{this.getDatasetMeta(z).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(l){const z=this.config;z.update();const j=this._options=z.createResolver(z.chartOptionScopes(),this.getContext()),J=this._animationsDisabled=!j.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:l,cancelable:!0})===!1)return;const mt=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let kt=0;for(let re=0,pe=this.data.datasets.length;re{re.reset()}),this._updateDatasets(l),this.notifyPlugins("afterUpdate",{mode:l}),this._layers.sort(OP("z","_idx"));const{_active:Dt,_lastEvent:Gt}=this;Gt?this._eventHandler(Gt,!0):Dt.length&&this._updateHoverStyles(Dt,Dt,!0),this.render()}_updateScales(){Kh(this.scales,l=>{om.removeBox(this,l)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const l=this.options,z=new Set(Object.keys(this._listeners)),j=new Set(l.events);(!ZL(z,j)||!!this._responsiveListeners!==l.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:l}=this,z=this._getUniformDataChanges()||[];for(const{method:j,start:J,count:mt}of z){const kt=j==="_removeElements"?-mt:mt;Iut(l,J,kt)}}_getUniformDataChanges(){const l=this._dataChanges;if(!l||!l.length)return;this._dataChanges=[];const z=this.data.datasets.length,j=mt=>new Set(l.filter(kt=>kt[0]===mt).map((kt,Dt)=>Dt+","+kt.splice(1).join(","))),J=j(0);for(let mt=1;mtmt.split(",")).map(mt=>({method:mt[1],start:+mt[2],count:+mt[3]}))}_updateLayout(l){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;om.update(this,this.width,this.height,l);const z=this.chartArea,j=z.width<=0||z.height<=0;this._layers=[],Kh(this.boxes,J=>{j&&J.position==="chartArea"||(J.configure&&J.configure(),this._layers.push(...J._layers()))},this),this._layers.forEach((J,mt)=>{J._idx=mt}),this.notifyPlugins("afterLayout")}_updateDatasets(l){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:l,cancelable:!0})!==!1){for(let z=0,j=this.data.datasets.length;z=0;--z)this._drawDataset(l[z]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(l){const z=this.ctx,j={meta:l,index:l.index,cancelable:!0},J=eD(this,l);this.notifyPlugins("beforeDatasetDraw",j)!==!1&&(J&&U4(z,J),l.controller.draw(),J&&V4(z),j.cancelable=!1,this.notifyPlugins("afterDatasetDraw",j))}isPointInArea(l){return W2(l,this.chartArea,this._minPadding)}getElementsAtEventForMode(l,z,j,J){const mt=Plt.modes[z];return typeof mt=="function"?mt(this,l,j,J):[]}getDatasetMeta(l){const z=this.data.datasets[l],j=this._metasets;let J=j.filter(mt=>mt&&mt._dataset===z).pop();return J||(J={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:z&&z.order||0,index:l,_dataset:z,_parsed:[],_sorted:!1},j.push(J)),J}getContext(){return this.$context||(this.$context=Cy(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(l){const z=this.data.datasets[l];if(!z)return!1;const j=this.getDatasetMeta(l);return typeof j.hidden=="boolean"?!j.hidden:!z.hidden}setDatasetVisibility(l,z){const j=this.getDatasetMeta(l);j.hidden=!z}toggleDataVisibility(l){this._hiddenIndices[l]=!this._hiddenIndices[l]}getDataVisibility(l){return!this._hiddenIndices[l]}_updateVisibility(l,z,j){const J=j?"show":"hide",mt=this.getDatasetMeta(l),kt=mt.controller._resolveAnimations(void 0,J);U2(z)?(mt.data[z].hidden=!j,this.update()):(this.setDatasetVisibility(l,j),kt.update(mt,{visible:j}),this.update(Dt=>Dt.datasetIndex===l?J:void 0))}hide(l,z){this._updateVisibility(l,z,!1)}show(l,z){this._updateVisibility(l,z,!0)}_destroyDatasetMeta(l){const z=this._metasets[l];z&&z.controller&&z.controller._destroy(),delete this._metasets[l]}_stop(){let l,z;for(this.stop(),Gg.remove(this),l=0,z=this.data.datasets.length;l{z.addEventListener(this,mt,kt),l[mt]=kt},J=(mt,kt,Dt)=>{mt.offsetX=kt,mt.offsetY=Dt,this._eventHandler(mt)};Kh(this.options.events,mt=>j(mt,J))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const l=this._responsiveListeners,z=this.platform,j=(Gt,re)=>{z.addEventListener(this,Gt,re),l[Gt]=re},J=(Gt,re)=>{l[Gt]&&(z.removeEventListener(this,Gt,re),delete l[Gt])},mt=(Gt,re)=>{this.canvas&&this.resize(Gt,re)};let kt;const Dt=()=>{J("attach",Dt),this.attached=!0,this.resize(),j("resize",mt),j("detach",kt)};kt=()=>{this.attached=!1,J("resize",mt),this._stop(),this._resize(0,0),j("attach",Dt)},z.isAttached(this.canvas)?Dt():kt()}unbindEvents(){Kh(this._listeners,(l,z)=>{this.platform.removeEventListener(this,z,l)}),this._listeners={},Kh(this._responsiveListeners,(l,z)=>{this.platform.removeEventListener(this,z,l)}),this._responsiveListeners=void 0}updateHoverStyle(l,z,j){const J=j?"set":"remove";let mt,kt,Dt,Gt;for(z==="dataset"&&(mt=this.getDatasetMeta(l[0].datasetIndex),mt.controller["_"+J+"DatasetHoverStyle"]()),Dt=0,Gt=l.length;Dt{const Dt=this.getDatasetMeta(mt);if(!Dt)throw new Error("No dataset found at index "+mt);return{datasetIndex:mt,element:Dt.data[kt],index:kt}});!h4(j,z)&&(this._active=j,this._lastEvent=null,this._updateHoverStyles(j,z))}notifyPlugins(l,z,j){return this._plugins.notify(this,l,z,j)}isPluginEnabled(l){return this._plugins._cache.filter(z=>z.plugin.id===l).length===1}_updateHoverStyles(l,z,j){const J=this.options.hover,mt=(Gt,re)=>Gt.filter(pe=>!re.some(Ne=>pe.datasetIndex===Ne.datasetIndex&&pe.index===Ne.index)),kt=mt(z,l),Dt=j?l:mt(l,z);kt.length&&this.updateHoverStyle(kt,J.mode,!1),Dt.length&&J.mode&&this.updateHoverStyle(Dt,J.mode,!0)}_eventHandler(l,z){const j={event:l,replay:z,cancelable:!0,inChartArea:this.isPointInArea(l)},J=kt=>(kt.options.events||this.options.events).includes(l.native.type);if(this.notifyPlugins("beforeEvent",j,J)===!1)return;const mt=this._handleEvent(l,z,j.inChartArea);return j.cancelable=!1,this.notifyPlugins("afterEvent",j,J),(mt||j.changed)&&this.render(),this}_handleEvent(l,z,j){const{_active:J=[],options:mt}=this,kt=z,Dt=this._getActiveElements(l,J,j,kt),Gt=Fot(l),re=Out(l,this._lastEvent,j,Gt);j&&(this._lastEvent=null,Df(mt.onHover,[l,Dt,this],this),Gt&&Df(mt.onClick,[l,Dt,this],this));const pe=!h4(Dt,J);return(pe||z)&&(this._active=Dt,this._updateHoverStyles(Dt,J,z)),this._lastEvent=re,pe}_getActiveElements(l,z,j,J){if(l.type==="mouseout")return[];if(!j)return z;const mt=this.options.hover;return this.getElementsAtEventForMode(l,mt.mode,mt,J)}}function RP(){return Kh(d2.instances,d=>d._plugins.invalidate())}function Dut(d,l,z){const{startAngle:j,x:J,y:mt,outerRadius:kt,innerRadius:Dt,options:Gt}=l,{borderWidth:re,borderJoinStyle:pe}=Gt,Ne=Math.min(re/kt,q0(j-z));if(d.beginPath(),d.arc(J,mt,kt-re/2,j+Ne/2,z-Ne/2),Dt>0){const or=Math.min(re/Dt,q0(j-z));d.arc(J,mt,Dt+re/2,z-or/2,j+or/2,!0)}else{const or=Math.min(re/2,kt*q0(j-z));if(pe==="round")d.arc(J,mt,or,z-Jh/2,j+Jh/2,!0);else if(pe==="bevel"){const _r=2*or*or,Fr=-_r*Math.cos(z+Jh/2)+J,zr=-_r*Math.sin(z+Jh/2)+mt,Wr=_r*Math.cos(j+Jh/2)+J,An=_r*Math.sin(j+Jh/2)+mt;d.lineTo(Fr,zr),d.lineTo(Wr,An)}}d.closePath(),d.moveTo(0,0),d.rect(0,0,d.canvas.width,d.canvas.height),d.clip("evenodd")}function Fut(d,l,z){const{startAngle:j,pixelMargin:J,x:mt,y:kt,outerRadius:Dt,innerRadius:Gt}=l;let re=J/Dt;d.beginPath(),d.arc(mt,kt,Dt,j-re,z+re),Gt>J?(re=J/Gt,d.arc(mt,kt,Gt,z+re,j-re,!0)):d.arc(mt,kt,J,z+ap,j-ap),d.closePath(),d.clip()}function Rut(d){return uM(d,["outerStart","outerEnd","innerStart","innerEnd"])}function But(d,l,z,j){const J=Rut(d.options.borderRadius),mt=(z-l)/2,kt=Math.min(mt,j*l/2),Dt=Gt=>{const re=(z-Math.min(mt,Gt))*j/2;return Xp(Gt,0,Math.min(mt,re))};return{outerStart:Dt(J.outerStart),outerEnd:Dt(J.outerEnd),innerStart:Xp(J.innerStart,0,kt),innerEnd:Xp(J.innerEnd,0,kt)}}function Jx(d,l,z,j){return{x:z+d*Math.cos(l),y:j+d*Math.sin(l)}}function v4(d,l,z,j,J,mt){const{x:kt,y:Dt,startAngle:Gt,pixelMargin:re,innerRadius:pe}=l,Ne=Math.max(l.outerRadius+j+z-re,0),or=pe>0?pe+j+z+re:0;let _r=0;const Fr=J-Gt;if(j){const Da=pe>0?pe-j:0,Ni=Ne>0?Ne-j:0,Ei=(Da+Ni)/2,Va=Ei!==0?Fr*Ei/(Ei+j):Fr;_r=(Fr-Va)/2}const zr=Math.max(.001,Fr*Ne-z/Jh)/Ne,Wr=(Fr-zr)/2,An=Gt+Wr+_r,Ft=J-Wr-_r,{outerStart:kn,outerEnd:ei,innerStart:jn,innerEnd:ai}=But(l,or,Ne,Ft-An),Qi=Ne-kn,Gi=Ne-ei,un=An+kn/Qi,ia=Ft-ei/Gi,fa=or+jn,Li=or+ai,yi=An+jn/fa,ra=Ft-ai/Li;if(d.beginPath(),mt){const Da=(un+ia)/2;if(d.arc(kt,Dt,Ne,un,Da),d.arc(kt,Dt,Ne,Da,ia),ei>0){const ss=Jx(Gi,ia,kt,Dt);d.arc(ss.x,ss.y,ei,ia,Ft+ap)}const Ni=Jx(Li,Ft,kt,Dt);if(d.lineTo(Ni.x,Ni.y),ai>0){const ss=Jx(Li,ra,kt,Dt);d.arc(ss.x,ss.y,ai,Ft+ap,ra+Math.PI)}const Ei=(Ft-ai/or+(An+jn/or))/2;if(d.arc(kt,Dt,or,Ft-ai/or,Ei,!0),d.arc(kt,Dt,or,Ei,An+jn/or,!0),jn>0){const ss=Jx(fa,yi,kt,Dt);d.arc(ss.x,ss.y,jn,yi+Math.PI,An-ap)}const Va=Jx(Qi,An,kt,Dt);if(d.lineTo(Va.x,Va.y),kn>0){const ss=Jx(Qi,un,kt,Dt);d.arc(ss.x,ss.y,kn,An-ap,un)}}else{d.moveTo(kt,Dt);const Da=Math.cos(un)*Ne+kt,Ni=Math.sin(un)*Ne+Dt;d.lineTo(Da,Ni);const Ei=Math.cos(ia)*Ne+kt,Va=Math.sin(ia)*Ne+Dt;d.lineTo(Ei,Va)}d.closePath()}function Nut(d,l,z,j,J){const{fullCircles:mt,startAngle:kt,circumference:Dt}=l;let Gt=l.endAngle;if(mt){v4(d,l,z,j,Gt,J);for(let re=0;re=Jh&&_r===0&&pe!=="miter"&&Dut(d,l,zr),mt||(v4(d,l,z,j,zr,J),d.stroke())}class Uut extends lv{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:l=>l!=="borderDash"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(l){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,l&&Object.assign(this,l)}inRange(l,z,j){const J=this.getProps(["x","y"],j),{angle:mt,distance:kt}=RO(J,{x:l,y:z}),{startAngle:Dt,endAngle:Gt,innerRadius:re,outerRadius:pe,circumference:Ne}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],j),or=(this.options.spacing+this.options.borderWidth)/2,_r=cc(Ne,Gt-Dt),Fr=H2(mt,Dt,Gt)&&Dt!==Gt,zr=_r>=od||Fr,Wr=ev(kt,re+or,pe+or);return zr&&Wr}getCenterPoint(l){const{x:z,y:j,startAngle:J,endAngle:mt,innerRadius:kt,outerRadius:Dt}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],l),{offset:Gt,spacing:re}=this.options,pe=(J+mt)/2,Ne=(kt+Dt+re+Gt)/2;return{x:z+Math.cos(pe)*Ne,y:j+Math.sin(pe)*Ne}}tooltipPosition(l){return this.getCenterPoint(l)}draw(l){const{options:z,circumference:j}=this,J=(z.offset||0)/4,mt=(z.spacing||0)/2,kt=z.circular;if(this.pixelMargin=z.borderAlign==="inner"?.33:0,this.fullCircles=j>od?Math.floor(j/od):0,j===0||this.innerRadius<0||this.outerRadius<0)return;l.save();const Dt=(this.startAngle+this.endAngle)/2;l.translate(Math.cos(Dt)*J,Math.sin(Dt)*J);const Gt=1-Math.sin(Math.min(Jh,j||0)),re=J*Gt;l.fillStyle=z.backgroundColor,l.strokeStyle=z.borderColor,Nut(l,this,re,mt,kt),jut(l,this,re,mt,kt),l.restore()}}function mD(d,l,z=l){d.lineCap=cc(z.borderCapStyle,l.borderCapStyle),d.setLineDash(cc(z.borderDash,l.borderDash)),d.lineDashOffset=cc(z.borderDashOffset,l.borderDashOffset),d.lineJoin=cc(z.borderJoinStyle,l.borderJoinStyle),d.lineWidth=cc(z.borderWidth,l.borderWidth),d.strokeStyle=cc(z.borderColor,l.borderColor)}function Vut(d,l,z){d.lineTo(z.x,z.y)}function Hut(d){return d.stepped?ust:d.tension||d.cubicInterpolationMode==="monotone"?cst:Vut}function gD(d,l,z={}){const j=d.length,{start:J=0,end:mt=j-1}=z,{start:kt,end:Dt}=l,Gt=Math.max(J,kt),re=Math.min(mt,Dt),pe=JDt&&mt>Dt;return{count:j,start:Gt,loop:l.loop,ilen:re(kt+(re?Dt-ei:ei))%mt,kn=()=>{zr!==Wr&&(d.lineTo(pe,Wr),d.lineTo(pe,zr),d.lineTo(pe,An))};for(Gt&&(_r=J[Ft(0)],d.moveTo(_r.x,_r.y)),or=0;or<=Dt;++or){if(_r=J[Ft(or)],_r.skip)continue;const ei=_r.x,jn=_r.y,ai=ei|0;ai===Fr?(jnWr&&(Wr=jn),pe=(Ne*pe+ei)/++Ne):(kn(),d.lineTo(ei,jn),Fr=ai,Ne=0,zr=Wr=jn),An=jn}kn()}function bA(d){const l=d.options,z=l.borderDash&&l.borderDash.length;return!d._decimated&&!d._loop&&!l.tension&&l.cubicInterpolationMode!=="monotone"&&!l.stepped&&!z?qut:Wut}function Zut(d){return d.stepped?Vst:d.tension||d.cubicInterpolationMode==="monotone"?Hst:fy}function $ut(d,l,z,j){let J=l._path;J||(J=l._path=new Path2D,l.path(J,z,j)&&J.closePath()),mD(d,l.options),d.stroke(J)}function Gut(d,l,z,j){const{segments:J,options:mt}=l,kt=bA(l);for(const Dt of J)mD(d,mt,Dt.style),d.beginPath(),kt(d,l,Dt,{start:z,end:z+j-1})&&d.closePath(),d.stroke()}const Yut=typeof Path2D=="function";function Kut(d,l,z,j){Yut&&!l.options.segment?$ut(d,l,z,j):Gut(d,l,z,j)}class Z4 extends lv{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:l=>l!=="borderDash"&&l!=="fill"};constructor(l){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,l&&Object.assign(this,l)}updateControlPoints(l,z){const j=this.options;if((j.tension||j.cubicInterpolationMode==="monotone")&&!j.stepped&&!this._pointsUpdated){const J=j.spanGaps?this._loop:this._fullLoop;Ost(this._points,j,l,J,z),this._pointsUpdated=!0}}set points(l){this._points=l,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Yst(this,this.options.segment))}first(){const l=this.segments,z=this.points;return l.length&&z[l[0].start]}last(){const l=this.segments,z=this.points,j=l.length;return j&&z[l[j-1].end]}interpolate(l,z){const j=this.options,J=l[z],mt=this.points,kt=tD(this,{property:z,start:J,end:J});if(!kt.length)return;const Dt=[],Gt=Zut(j);let re,pe;for(re=0,pe=kt.length;re{Dt=$4(kt,Dt,J);const Gt=J[kt],re=J[Dt];j!==null?(mt.push({x:Gt.x,y:j}),mt.push({x:re.x,y:j})):z!==null&&(mt.push({x:z,y:Gt.y}),mt.push({x:z,y:re.y}))}),mt}function $4(d,l,z){for(;l>d;l--){const j=z[l];if(!isNaN(j.x)&&!isNaN(j.y))break}return l}function NP(d,l,z,j){return d&&l?j(d[z],l[z]):d?d[z]:l?l[z]:0}function yD(d,l){let z=[],j=!1;return Xd(d)?(j=!0,z=d):z=act(d,l),z.length?new Z4({points:z,options:{tension:0},_loop:j,_fullLoop:j}):null}function jP(d){return d&&d.fill!==!1}function oct(d,l,z){let J=d[l].fill;const mt=[l];let kt;if(!z)return J;for(;J!==!1&&mt.indexOf(J)===-1;){if(!Qp(J))return J;if(kt=d[J],!kt)return!1;if(kt.visible)return J;mt.push(J),J=kt.fill}return!1}function sct(d,l,z){const j=hct(d);if(Ec(j))return isNaN(j.value)?!1:j;let J=parseFloat(j);return Qp(J)&&Math.floor(J)===J?lct(j[0],l,J,z):["origin","start","end","stack","shape"].indexOf(j)>=0&&j}function lct(d,l,z,j){return(d==="-"||d==="+")&&(z=l+z),z===l||z<0||z>=j?!1:z}function uct(d,l){let z=null;return d==="start"?z=l.bottom:d==="end"?z=l.top:Ec(d)?z=l.getPixelForValue(d.value):l.getBasePixel&&(z=l.getBasePixel()),z}function cct(d,l,z){let j;return d==="start"?j=z:d==="end"?j=l.options.reverse?l.min:l.max:Ec(d)?j=d.value:j=l.getBaseValue(),j}function hct(d){const l=d.options,z=l.fill;let j=cc(z&&z.target,z);return j===void 0&&(j=!!l.backgroundColor),j===!1||j===null?!1:j===!0?"origin":j}function fct(d){const{scale:l,index:z,line:j}=d,J=[],mt=j.segments,kt=j.points,Dt=dct(l,z);Dt.push(yD({x:null,y:l.bottom},j));for(let Gt=0;Gt=0;--kt){const Dt=J[kt].$filler;Dt&&(Dt.line.updateControlPoints(mt,Dt.axis),j&&Dt.fill&&V8(d.ctx,Dt,mt))}},beforeDatasetsDraw(d,l,z){if(z.drawTime!=="beforeDatasetsDraw")return;const j=d.getSortedVisibleDatasetMetas();for(let J=j.length-1;J>=0;--J){const mt=j[J].$filler;jP(mt)&&V8(d.ctx,mt,d.chartArea)}},beforeDatasetDraw(d,l,z){const j=l.meta.$filler;!jP(j)||z.drawTime!=="beforeDatasetDraw"||V8(d.ctx,j,d.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const WP=(d,l)=>{let{boxHeight:z=l,boxWidth:j=l}=d;return d.usePointStyle&&(z=Math.min(z,l),j=d.pointStyleWidth||Math.min(j,l)),{boxWidth:j,boxHeight:z,itemHeight:Math.max(l,z)}},Tct=(d,l)=>d!==null&&l!==null&&d.datasetIndex===l.datasetIndex&&d.index===l.index;class qP extends lv{constructor(l){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=l.chart,this.options=l.options,this.ctx=l.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(l,z,j){this.maxWidth=l,this.maxHeight=z,this._margins=j,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const l=this.options.labels||{};let z=Df(l.generateLabels,[this.chart],this)||[];l.filter&&(z=z.filter(j=>l.filter(j,this.chart.data))),l.sort&&(z=z.sort((j,J)=>l.sort(j,J,this.chart.data))),this.options.reverse&&z.reverse(),this.legendItems=z}fit(){const{options:l,ctx:z}=this;if(!l.display){this.width=this.height=0;return}const j=l.labels,J=Jp(j.font),mt=J.size,kt=this._computeTitleHeight(),{boxWidth:Dt,itemHeight:Gt}=WP(j,mt);let re,pe;z.font=J.string,this.isHorizontal()?(re=this.maxWidth,pe=this._fitRows(kt,mt,Dt,Gt)+10):(pe=this.maxHeight,re=this._fitCols(kt,J,Dt,Gt)+10),this.width=Math.min(re,l.maxWidth||this.maxWidth),this.height=Math.min(pe,l.maxHeight||this.maxHeight)}_fitRows(l,z,j,J){const{ctx:mt,maxWidth:kt,options:{labels:{padding:Dt}}}=this,Gt=this.legendHitBoxes=[],re=this.lineWidths=[0],pe=J+Dt;let Ne=l;mt.textAlign="left",mt.textBaseline="middle";let or=-1,_r=-pe;return this.legendItems.forEach((Fr,zr)=>{const Wr=j+z/2+mt.measureText(Fr.text).width;(zr===0||re[re.length-1]+Wr+2*Dt>kt)&&(Ne+=pe,re[re.length-(zr>0?0:1)]=0,_r+=pe,or++),Gt[zr]={left:0,top:_r,row:or,width:Wr,height:J},re[re.length-1]+=Wr+Dt}),Ne}_fitCols(l,z,j,J){const{ctx:mt,maxHeight:kt,options:{labels:{padding:Dt}}}=this,Gt=this.legendHitBoxes=[],re=this.columnSizes=[],pe=kt-l;let Ne=Dt,or=0,_r=0,Fr=0,zr=0;return this.legendItems.forEach((Wr,An)=>{const{itemWidth:Ft,itemHeight:kn}=Act(j,z,mt,Wr,J);An>0&&_r+kn+2*Dt>pe&&(Ne+=or+Dt,re.push({width:or,height:_r}),Fr+=or+Dt,zr++,or=_r=0),Gt[An]={left:Fr,top:_r,col:zr,width:Ft,height:kn},or=Math.max(or,Ft),_r+=kn+Dt}),Ne+=or,re.push({width:or,height:_r}),Ne}adjustHitBoxes(){if(!this.options.display)return;const l=this._computeTitleHeight(),{legendHitBoxes:z,options:{align:j,labels:{padding:J},rtl:mt}}=this,kt=l_(mt,this.left,this.width);if(this.isHorizontal()){let Dt=0,Gt=Wp(j,this.left+J,this.right-this.lineWidths[Dt]);for(const re of z)Dt!==re.row&&(Dt=re.row,Gt=Wp(j,this.left+J,this.right-this.lineWidths[Dt])),re.top+=this.top+l+J,re.left=kt.leftForLtr(kt.x(Gt),re.width),Gt+=re.width+J}else{let Dt=0,Gt=Wp(j,this.top+l+J,this.bottom-this.columnSizes[Dt].height);for(const re of z)re.col!==Dt&&(Dt=re.col,Gt=Wp(j,this.top+l+J,this.bottom-this.columnSizes[Dt].height)),re.top=Gt,re.left+=this.left+J,re.left=kt.leftForLtr(kt.x(re.left),re.width),Gt+=re.height+J}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const l=this.ctx;U4(l,this),this._draw(),V4(l)}}_draw(){const{options:l,columnSizes:z,lineWidths:j,ctx:J}=this,{align:mt,labels:kt}=l,Dt=Bd.color,Gt=l_(l.rtl,this.left,this.width),re=Jp(kt.font),{padding:pe}=kt,Ne=re.size,or=Ne/2;let _r;this.drawTitle(),J.textAlign=Gt.textAlign("left"),J.textBaseline="middle",J.lineWidth=.5,J.font=re.string;const{boxWidth:Fr,boxHeight:zr,itemHeight:Wr}=WP(kt,Ne),An=function(ai,Qi,Gi){if(isNaN(Fr)||Fr<=0||isNaN(zr)||zr<0)return;J.save();const un=cc(Gi.lineWidth,1);if(J.fillStyle=cc(Gi.fillStyle,Dt),J.lineCap=cc(Gi.lineCap,"butt"),J.lineDashOffset=cc(Gi.lineDashOffset,0),J.lineJoin=cc(Gi.lineJoin,"miter"),J.lineWidth=un,J.strokeStyle=cc(Gi.strokeStyle,Dt),J.setLineDash(cc(Gi.lineDash,[])),kt.usePointStyle){const ia={radius:zr*Math.SQRT2/2,pointStyle:Gi.pointStyle,rotation:Gi.rotation,borderWidth:un},fa=Gt.xPlus(ai,Fr/2),Li=Qi+or;HO(J,ia,fa,Li,kt.pointStyleWidth&&Fr)}else{const ia=Qi+Math.max((Ne-zr)/2,0),fa=Gt.leftForLtr(ai,Fr),Li=s_(Gi.borderRadius);J.beginPath(),Object.values(Li).some(yi=>yi!==0)?p4(J,{x:fa,y:ia,w:Fr,h:zr,radius:Li}):J.rect(fa,ia,Fr,zr),J.fill(),un!==0&&J.stroke()}J.restore()},Ft=function(ai,Qi,Gi){q2(J,Gi.text,ai,Qi+Wr/2,re,{strikethrough:Gi.hidden,textAlign:Gt.textAlign(Gi.textAlign)})},kn=this.isHorizontal(),ei=this._computeTitleHeight();kn?_r={x:Wp(mt,this.left+pe,this.right-j[0]),y:this.top+pe+ei,line:0}:_r={x:this.left+pe,y:Wp(mt,this.top+ei+pe,this.bottom-z[0].height),line:0},KO(this.ctx,l.textDirection);const jn=Wr+pe;this.legendItems.forEach((ai,Qi)=>{J.strokeStyle=ai.fontColor,J.fillStyle=ai.fontColor;const Gi=J.measureText(ai.text).width,un=Gt.textAlign(ai.textAlign||(ai.textAlign=kt.textAlign)),ia=Fr+or+Gi;let fa=_r.x,Li=_r.y;Gt.setWidth(this.width),kn?Qi>0&&fa+ia+pe>this.right&&(Li=_r.y+=jn,_r.line++,fa=_r.x=Wp(mt,this.left+pe,this.right-j[_r.line])):Qi>0&&Li+jn>this.bottom&&(fa=_r.x=fa+z[_r.line].width+pe,_r.line++,Li=_r.y=Wp(mt,this.top+ei+pe,this.bottom-z[_r.line].height));const yi=Gt.x(fa);if(An(yi,Li,ai),fa=Kot(un,fa+Fr+or,kn?fa+ia:this.right,l.rtl),Ft(Gt.x(fa),Li,ai),kn)_r.x+=ia+pe;else if(typeof ai.text!="string"){const ra=re.lineHeight;_r.y+=_D(ai,ra)+pe}else _r.y+=jn}),XO(this.ctx,l.textDirection)}drawTitle(){const l=this.options,z=l.title,j=Jp(z.font),J=fm(z.padding);if(!z.display)return;const mt=l_(l.rtl,this.left,this.width),kt=this.ctx,Dt=z.position,Gt=j.size/2,re=J.top+Gt;let pe,Ne=this.left,or=this.width;if(this.isHorizontal())or=Math.max(...this.lineWidths),pe=this.top+re,Ne=Wp(l.align,Ne,this.right-or);else{const Fr=this.columnSizes.reduce((zr,Wr)=>Math.max(zr,Wr.height),0);pe=re+Wp(l.align,this.top,this.bottom-Fr-l.labels.padding-this._computeTitleHeight())}const _r=Wp(Dt,Ne,Ne+or);kt.textAlign=mt.textAlign(oM(Dt)),kt.textBaseline="middle",kt.strokeStyle=z.color,kt.fillStyle=z.color,kt.font=j.string,q2(kt,z.text,_r,pe,j)}_computeTitleHeight(){const l=this.options.title,z=Jp(l.font),j=fm(l.padding);return l.display?z.lineHeight+j.height:0}_getLegendItemAt(l,z){let j,J,mt;if(ev(l,this.left,this.right)&&ev(z,this.top,this.bottom)){for(mt=this.legendHitBoxes,j=0;jmt.length>kt.length?mt:kt)),l+z.size/2+j.measureText(J).width}function Sct(d,l,z){let j=d;return typeof l.text!="string"&&(j=_D(l,z)),j}function _D(d,l){const z=d.text?d.text.length:0;return l*z}function Ect(d,l){return!!((d==="mousemove"||d==="mouseout")&&(l.onHover||l.onLeave)||l.onClick&&(d==="click"||d==="mouseup"))}var Cct={id:"legend",_element:qP,start(d,l,z){const j=d.legend=new qP({ctx:d.ctx,options:z,chart:d});om.configure(d,j,z),om.addBox(d,j)},stop(d){om.removeBox(d,d.legend),delete d.legend},beforeUpdate(d,l,z){const j=d.legend;om.configure(d,j,z),j.options=z},afterUpdate(d){const l=d.legend;l.buildLabels(),l.adjustHitBoxes()},afterEvent(d,l){l.replay||d.legend.handleEvent(l.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(d,l,z){const j=l.datasetIndex,J=z.chart;J.isDatasetVisible(j)?(J.hide(j),l.hidden=!0):(J.show(j),l.hidden=!1)},onHover:null,onLeave:null,labels:{color:d=>d.chart.options.color,boxWidth:40,padding:10,generateLabels(d){const l=d.data.datasets,{labels:{usePointStyle:z,pointStyle:j,textAlign:J,color:mt,useBorderRadius:kt,borderRadius:Dt}}=d.legend.options;return d._getSortedDatasetMetas().map(Gt=>{const re=Gt.controller.getStyle(z?0:void 0),pe=fm(re.borderWidth);return{text:l[Gt.index].label,fillStyle:re.backgroundColor,fontColor:mt,hidden:!Gt.visible,lineCap:re.borderCapStyle,lineDash:re.borderDash,lineDashOffset:re.borderDashOffset,lineJoin:re.borderJoinStyle,lineWidth:(pe.width+pe.height)/4,strokeStyle:re.borderColor,pointStyle:j||re.pointStyle,rotation:re.rotation,textAlign:J||re.textAlign,borderRadius:kt&&(Dt||re.borderRadius),datasetIndex:Gt.index}},this)}},title:{color:d=>d.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:d=>!d.startsWith("on"),labels:{_scriptable:d=>!["generateLabels","filter","sort"].includes(d)}}};class bD extends lv{constructor(l){super(),this.chart=l.chart,this.options=l.options,this.ctx=l.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(l,z){const j=this.options;if(this.left=0,this.top=0,!j.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=l,this.height=this.bottom=z;const J=Xd(j.text)?j.text.length:1;this._padding=fm(j.padding);const mt=J*Jp(j.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=mt:this.width=mt}isHorizontal(){const l=this.options.position;return l==="top"||l==="bottom"}_drawArgs(l){const{top:z,left:j,bottom:J,right:mt,options:kt}=this,Dt=kt.align;let Gt=0,re,pe,Ne;return this.isHorizontal()?(pe=Wp(Dt,j,mt),Ne=z+l,re=mt-j):(kt.position==="left"?(pe=j+l,Ne=Wp(Dt,J,z),Gt=Jh*-.5):(pe=mt-l,Ne=Wp(Dt,z,J),Gt=Jh*.5),re=J-z),{titleX:pe,titleY:Ne,maxWidth:re,rotation:Gt}}draw(){const l=this.ctx,z=this.options;if(!z.display)return;const j=Jp(z.font),mt=j.lineHeight/2+this._padding.top,{titleX:kt,titleY:Dt,maxWidth:Gt,rotation:re}=this._drawArgs(mt);q2(l,z.text,0,0,j,{color:z.color,maxWidth:Gt,rotation:re,textAlign:oM(z.align),textBaseline:"middle",translation:[kt,Dt]})}}function Lct(d,l){const z=new bD({ctx:d.ctx,options:l,chart:d});om.configure(d,z,l),om.addBox(d,z),d.titleBlock=z}var Pct={id:"title",_element:bD,start(d,l,z){Lct(d,z)},stop(d){const l=d.titleBlock;om.removeBox(d,l),delete d.titleBlock},beforeUpdate(d,l,z){const j=d.titleBlock;om.configure(d,j,z),j.options=z},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const p2={average(d){if(!d.length)return!1;let l,z,j=new Set,J=0,mt=0;for(l=0,z=d.length;lDt+Gt)/j.size,y:J/mt}},nearest(d,l){if(!d.length)return!1;let z=l.x,j=l.y,J=Number.POSITIVE_INFINITY,mt,kt,Dt;for(mt=0,kt=d.length;mt-1?d.split(` -`):d}function Lct(d,l){const{element:z,datasetIndex:j,index:J}=l,mt=d.getDatasetMeta(j).controller,{label:kt,value:Dt}=mt.getLabelAndValue(J);return{chart:d,label:kt,parsed:mt.getParsed(J),raw:d.data.datasets[j].data[J],formattedValue:Dt,dataset:mt.getDataset(),dataIndex:J,datasetIndex:j,element:z}}function ZP(d,l){const z=d.chart.ctx,{body:j,footer:J,title:mt}=d,{boxWidth:kt,boxHeight:Dt}=l,Gt=Jp(l.bodyFont),re=Jp(l.titleFont),pe=Jp(l.footerFont),Ne=mt.length,or=J.length,_r=j.length,Fr=fm(l.padding);let zr=Fr.height,Wr=0,An=j.reduce((ei,jn)=>ei+jn.before.length+jn.lines.length+jn.after.length,0);if(An+=d.beforeBody.length+d.afterBody.length,Ne&&(zr+=Ne*re.lineHeight+(Ne-1)*l.titleSpacing+l.titleMarginBottom),An){const ei=l.displayColors?Math.max(Dt,Gt.lineHeight):Gt.lineHeight;zr+=_r*ei+(An-_r)*Gt.lineHeight+(An-1)*l.bodySpacing}or&&(zr+=l.footerMarginTop+or*pe.lineHeight+(or-1)*l.footerSpacing);let Ft=0;const kn=function(ei){Wr=Math.max(Wr,z.measureText(ei).width+Ft)};return z.save(),z.font=re.string,Kh(d.title,kn),z.font=Gt.string,Kh(d.beforeBody.concat(d.afterBody),kn),Ft=l.displayColors?kt+2+l.boxPadding:0,Kh(j,ei=>{Kh(ei.before,kn),Kh(ei.lines,kn),Kh(ei.after,kn)}),Ft=0,z.font=pe.string,Kh(d.footer,kn),z.restore(),Wr+=Fr.width,{width:Wr,height:zr}}function Pct(d,l){const{y:z,height:j}=l;return zd.height-j/2?"bottom":"center"}function zct(d,l,z,j){const{x:J,width:mt}=j,kt=z.caretSize+z.caretPadding;if(d==="left"&&J+mt+kt>l.width||d==="right"&&J-mt-kt<0)return!0}function Ict(d,l,z,j){const{x:J,width:mt}=z,{width:kt,chartArea:{left:Dt,right:Gt}}=d;let re="center";return j==="center"?re=J<=(Dt+Gt)/2?"left":"right":J<=mt/2?re="left":J>=kt-mt/2&&(re="right"),zct(re,d,l,z)&&(re="center"),re}function $P(d,l,z){const j=z.yAlign||l.yAlign||Pct(d,z);return{xAlign:z.xAlign||l.xAlign||Ict(d,l,z,j),yAlign:j}}function Oct(d,l){let{x:z,width:j}=d;return l==="right"?z-=j:l==="center"&&(z-=j/2),z}function Dct(d,l,z){let{y:j,height:J}=d;return l==="top"?j+=z:l==="bottom"?j-=J+z:j-=J/2,j}function GP(d,l,z,j){const{caretSize:J,caretPadding:mt,cornerRadius:kt}=d,{xAlign:Dt,yAlign:Gt}=z,re=J+mt,{topLeft:pe,topRight:Ne,bottomLeft:or,bottomRight:_r}=s_(kt);let Fr=Oct(l,Dt);const zr=Dct(l,Gt,re);return Gt==="center"?Dt==="left"?Fr+=re:Dt==="right"&&(Fr-=re):Dt==="left"?Fr-=Math.max(pe,or)+J:Dt==="right"&&(Fr+=Math.max(Ne,_r)+J),{x:Xp(Fr,0,j.width-l.width),y:Xp(zr,0,j.height-l.height)}}function B5(d,l,z){const j=fm(z.padding);return l==="center"?d.x+d.width/2:l==="right"?d.x+d.width-j.right:d.x+j.left}function YP(d){return ng([],Yg(d))}function Fct(d,l,z){return Cy(d,{tooltip:l,tooltipItems:z,type:"tooltip"})}function KP(d,l){const z=l&&l.dataset&&l.dataset.tooltip&&l.dataset.tooltip.callbacks;return z?d.override(z):d}const wD={beforeTitle:$g,title(d){if(d.length>0){const l=d[0],z=l.chart.data.labels,j=z?z.length:0;if(this&&this.options&&this.options.mode==="dataset")return l.dataset.label||"";if(l.label)return l.label;if(j>0&&l.dataIndex"u"?wD[l].call(z,j):J}class XP extends lv{static positioners=p2;constructor(l){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=l.chart,this.options=l.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(l){this.options=l,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const l=this._cachedAnimations;if(l)return l;const z=this.chart,j=this.options.setContext(this.getContext()),J=j.enabled&&z.options.animation&&j.animations,mt=new rD(this.chart,J);return J._cacheable&&(this._cachedAnimations=Object.freeze(mt)),mt}getContext(){return this.$context||(this.$context=Fct(this.chart.getContext(),this,this._tooltipItems))}getTitle(l,z){const{callbacks:j}=z,J=A0(j,"beforeTitle",this,l),mt=A0(j,"title",this,l),kt=A0(j,"afterTitle",this,l);let Dt=[];return Dt=ng(Dt,Yg(J)),Dt=ng(Dt,Yg(mt)),Dt=ng(Dt,Yg(kt)),Dt}getBeforeBody(l,z){return YP(A0(z.callbacks,"beforeBody",this,l))}getBody(l,z){const{callbacks:j}=z,J=[];return Kh(l,mt=>{const kt={before:[],lines:[],after:[]},Dt=KP(j,mt);ng(kt.before,Yg(A0(Dt,"beforeLabel",this,mt))),ng(kt.lines,A0(Dt,"label",this,mt)),ng(kt.after,Yg(A0(Dt,"afterLabel",this,mt))),J.push(kt)}),J}getAfterBody(l,z){return YP(A0(z.callbacks,"afterBody",this,l))}getFooter(l,z){const{callbacks:j}=z,J=A0(j,"beforeFooter",this,l),mt=A0(j,"footer",this,l),kt=A0(j,"afterFooter",this,l);let Dt=[];return Dt=ng(Dt,Yg(J)),Dt=ng(Dt,Yg(mt)),Dt=ng(Dt,Yg(kt)),Dt}_createItems(l){const z=this._active,j=this.chart.data,J=[],mt=[],kt=[];let Dt=[],Gt,re;for(Gt=0,re=z.length;Gtl.filter(pe,Ne,or,j))),l.itemSort&&(Dt=Dt.sort((pe,Ne)=>l.itemSort(pe,Ne,j))),Kh(Dt,pe=>{const Ne=KP(l.callbacks,pe);J.push(A0(Ne,"labelColor",this,pe)),mt.push(A0(Ne,"labelPointStyle",this,pe)),kt.push(A0(Ne,"labelTextColor",this,pe))}),this.labelColors=J,this.labelPointStyles=mt,this.labelTextColors=kt,this.dataPoints=Dt,Dt}update(l,z){const j=this.options.setContext(this.getContext()),J=this._active;let mt,kt=[];if(!J.length)this.opacity!==0&&(mt={opacity:0});else{const Dt=p2[j.position].call(this,J,this._eventPosition);kt=this._createItems(j),this.title=this.getTitle(kt,j),this.beforeBody=this.getBeforeBody(kt,j),this.body=this.getBody(kt,j),this.afterBody=this.getAfterBody(kt,j),this.footer=this.getFooter(kt,j);const Gt=this._size=ZP(this,j),re=Object.assign({},Dt,Gt),pe=$P(this.chart,j,re),Ne=GP(j,re,pe,this.chart);this.xAlign=pe.xAlign,this.yAlign=pe.yAlign,mt={opacity:1,x:Ne.x,y:Ne.y,width:Gt.width,height:Gt.height,caretX:Dt.x,caretY:Dt.y}}this._tooltipItems=kt,this.$context=void 0,mt&&this._resolveAnimations().update(this,mt),l&&j.external&&j.external.call(this,{chart:this.chart,tooltip:this,replay:z})}drawCaret(l,z,j,J){const mt=this.getCaretPosition(l,j,J);z.lineTo(mt.x1,mt.y1),z.lineTo(mt.x2,mt.y2),z.lineTo(mt.x3,mt.y3)}getCaretPosition(l,z,j){const{xAlign:J,yAlign:mt}=this,{caretSize:kt,cornerRadius:Dt}=j,{topLeft:Gt,topRight:re,bottomLeft:pe,bottomRight:Ne}=s_(Dt),{x:or,y:_r}=l,{width:Fr,height:zr}=z;let Wr,An,Ft,kn,ei,jn;return mt==="center"?(ei=_r+zr/2,J==="left"?(Wr=or,An=Wr-kt,kn=ei+kt,jn=ei-kt):(Wr=or+Fr,An=Wr+kt,kn=ei-kt,jn=ei+kt),Ft=Wr):(J==="left"?An=or+Math.max(Gt,pe)+kt:J==="right"?An=or+Fr-Math.max(re,Ne)-kt:An=this.caretX,mt==="top"?(kn=_r,ei=kn-kt,Wr=An-kt,Ft=An+kt):(kn=_r+zr,ei=kn+kt,Wr=An+kt,Ft=An-kt),jn=kn),{x1:Wr,x2:An,x3:Ft,y1:kn,y2:ei,y3:jn}}drawTitle(l,z,j){const J=this.title,mt=J.length;let kt,Dt,Gt;if(mt){const re=l_(j.rtl,this.x,this.width);for(l.x=B5(this,j.titleAlign,j),z.textAlign=re.textAlign(j.titleAlign),z.textBaseline="middle",kt=Jp(j.titleFont),Dt=j.titleSpacing,z.fillStyle=j.titleColor,z.font=kt.string,Gt=0;GtFt!==0)?(l.beginPath(),l.fillStyle=mt.multiKeyBackground,p4(l,{x:zr,y:Fr,w:re,h:Gt,radius:An}),l.fill(),l.stroke(),l.fillStyle=kt.backgroundColor,l.beginPath(),p4(l,{x:Wr,y:Fr+1,w:re-2,h:Gt-2,radius:An}),l.fill()):(l.fillStyle=mt.multiKeyBackground,l.fillRect(zr,Fr,re,Gt),l.strokeRect(zr,Fr,re,Gt),l.fillStyle=kt.backgroundColor,l.fillRect(Wr,Fr+1,re-2,Gt-2))}l.fillStyle=this.labelTextColors[j]}drawBody(l,z,j){const{body:J}=this,{bodySpacing:mt,bodyAlign:kt,displayColors:Dt,boxHeight:Gt,boxWidth:re,boxPadding:pe}=j,Ne=Jp(j.bodyFont);let or=Ne.lineHeight,_r=0;const Fr=l_(j.rtl,this.x,this.width),zr=function(Gi){z.fillText(Gi,Fr.x(l.x+_r),l.y+or/2),l.y+=or+mt},Wr=Fr.textAlign(kt);let An,Ft,kn,ei,jn,ai,Qi;for(z.textAlign=kt,z.textBaseline="middle",z.font=Ne.string,l.x=B5(this,Wr,j),z.fillStyle=j.bodyColor,Kh(this.beforeBody,zr),_r=Dt&&Wr!=="right"?kt==="center"?re/2+pe:re+2+pe:0,ei=0,ai=J.length;ei0&&z.stroke()}_updateAnimationTarget(l){const z=this.chart,j=this.$animations,J=j&&j.x,mt=j&&j.y;if(J||mt){const kt=p2[l.position].call(this,this._active,this._eventPosition);if(!kt)return;const Dt=this._size=ZP(this,l),Gt=Object.assign({},kt,this._size),re=$P(z,l,Gt),pe=GP(l,Gt,re,z);(J._to!==pe.x||mt._to!==pe.y)&&(this.xAlign=re.xAlign,this.yAlign=re.yAlign,this.width=Dt.width,this.height=Dt.height,this.caretX=kt.x,this.caretY=kt.y,this._resolveAnimations().update(this,pe))}}_willRender(){return!!this.opacity}draw(l){const z=this.options.setContext(this.getContext());let j=this.opacity;if(!j)return;this._updateAnimationTarget(z);const J={width:this.width,height:this.height},mt={x:this.x,y:this.y};j=Math.abs(j)<.001?0:j;const kt=fm(z.padding),Dt=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;z.enabled&&Dt&&(l.save(),l.globalAlpha=j,this.drawBackground(mt,l,J,z),KO(l,z.textDirection),mt.y+=kt.top,this.drawTitle(mt,l,z),this.drawBody(mt,l,z),this.drawFooter(mt,l,z),XO(l,z.textDirection),l.restore())}getActiveElements(){return this._active||[]}setActiveElements(l,z){const j=this._active,J=l.map(({datasetIndex:Dt,index:Gt})=>{const re=this.chart.getDatasetMeta(Dt);if(!re)throw new Error("Cannot find a dataset at index "+Dt);return{datasetIndex:Dt,element:re.data[Gt],index:Gt}}),mt=!h4(j,J),kt=this._positionChanged(J,z);(mt||kt)&&(this._active=J,this._eventPosition=z,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(l,z,j=!0){if(z&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const J=this.options,mt=this._active||[],kt=this._getActiveElements(l,mt,z,j),Dt=this._positionChanged(kt,l),Gt=z||!h4(kt,mt)||Dt;return Gt&&(this._active=kt,(J.enabled||J.external)&&(this._eventPosition={x:l.x,y:l.y},this.update(!0,z))),Gt}_getActiveElements(l,z,j,J){const mt=this.options;if(l.type==="mouseout")return[];if(!J)return z.filter(Dt=>this.chart.data.datasets[Dt.datasetIndex]&&this.chart.getDatasetMeta(Dt.datasetIndex).controller.getParsed(Dt.index)!==void 0);const kt=this.chart.getElementsAtEventForMode(l,mt.mode,mt,j);return mt.reverse&&kt.reverse(),kt}_positionChanged(l,z){const{caretX:j,caretY:J,options:mt}=this,kt=p2[mt.position].call(this,l,z);return kt!==!1&&(j!==kt.x||J!==kt.y)}}var Rct={id:"tooltip",_element:XP,positioners:p2,afterInit(d,l,z){z&&(d.tooltip=new XP({chart:d,options:z}))},beforeUpdate(d,l,z){d.tooltip&&d.tooltip.initialize(z)},reset(d,l,z){d.tooltip&&d.tooltip.initialize(z)},afterDraw(d){const l=d.tooltip;if(l&&l._willRender()){const z={tooltip:l};if(d.notifyPlugins("beforeTooltipDraw",{...z,cancelable:!0})===!1)return;l.draw(d.ctx),d.notifyPlugins("afterTooltipDraw",z)}},afterEvent(d,l){if(d.tooltip){const z=l.replay;d.tooltip.handleEvent(l.event,z,l.inChartArea)&&(l.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(d,l)=>l.bodyFont.size,boxWidth:(d,l)=>l.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:wD},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:d=>d!=="filter"&&d!=="itemSort"&&d!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const Bct=(d,l,z,j)=>(typeof l=="string"?(z=d.push(l)-1,j.unshift({index:z,label:l})):isNaN(l)&&(z=null),z);function Nct(d,l,z,j){const J=d.indexOf(l);if(J===-1)return Bct(d,l,z,j);const mt=d.lastIndexOf(l);return J!==mt?z:J}const jct=(d,l)=>d===null?null:Xp(Math.round(d),0,l);function JP(d){const l=this.getLabels();return d>=0&&dz.length-1?null:this.getPixelForValue(z[l].value)}getValueForPixel(l){return Math.round(this._startValue+this.getDecimalForPixel(l)*this._valueRange)}getBasePixel(){return this.bottom}}function Vct(d,l){const z=[],{bounds:J,step:mt,min:kt,max:Dt,precision:Gt,count:re,maxTicks:pe,maxDigits:Ne,includeBounds:or}=d,_r=mt||1,Fr=pe-1,{min:zr,max:Wr}=l,An=!Rh(kt),Ft=!Rh(Dt),kn=!Rh(re),ei=(Wr-zr)/(Ne+1);let jn=GL((Wr-zr)/Fr/_r)*_r,ai,Qi,Gi,un;if(jn<1e-14&&!An&&!Ft)return[{value:zr},{value:Wr}];un=Math.ceil(Wr/jn)-Math.floor(zr/jn),un>Fr&&(jn=GL(un*jn/Fr/_r)*_r),Rh(Gt)||(ai=Math.pow(10,Gt),jn=Math.ceil(jn*ai)/ai),J==="ticks"?(Qi=Math.floor(zr/jn)*jn,Gi=Math.ceil(Wr/jn)*jn):(Qi=zr,Gi=Wr),An&&Ft&&mt&&Not((Dt-kt)/mt,jn/1e3)?(un=Math.round(Math.min((Dt-kt)/jn,pe)),jn=(Dt-kt)/un,Qi=kt,Gi=Dt):kn?(Qi=An?kt:Qi,Gi=Ft?Dt:Gi,un=re-1,jn=(Gi-Qi)/un):(un=(Gi-Qi)/jn,A2(un,Math.round(un),jn/1e3)?un=Math.round(un):un=Math.ceil(un));const ia=Math.max(YL(jn),YL(Qi));ai=Math.pow(10,Rh(Gt)?ia:Gt),Qi=Math.round(Qi*ai)/ai,Gi=Math.round(Gi*ai)/ai;let fa=0;for(An&&(or&&Qi!==kt?(z.push({value:kt}),QiDt)break;z.push({value:Li})}return Ft&&or&&Gi!==Dt?z.length&&A2(z[z.length-1].value,Dt,QP(Dt,ei,d))?z[z.length-1].value=Dt:z.push({value:Dt}):(!Ft||Gi===Dt)&&z.push({value:Gi}),z}function QP(d,l,{horizontal:z,minRotation:j}){const J=tv(j),mt=(z?Math.sin(J):Math.cos(J))||.001,kt=.75*l*(""+d).length;return Math.min(l/mt,kt)}class Hct extends __{constructor(l){super(l),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(l,z){return Rh(l)||(typeof l=="number"||l instanceof Number)&&!isFinite(+l)?null:+l}handleTickRangeOptions(){const{beginAtZero:l}=this.options,{minDefined:z,maxDefined:j}=this.getUserBounds();let{min:J,max:mt}=this;const kt=Gt=>J=z?J:Gt,Dt=Gt=>mt=j?mt:Gt;if(l){const Gt=cg(J),re=cg(mt);Gt<0&&re<0?Dt(0):Gt>0&&re>0&&kt(0)}if(J===mt){let Gt=mt===0?1:Math.abs(mt*.05);Dt(mt+Gt),l||kt(J-Gt)}this.min=J,this.max=mt}getTickLimit(){const l=this.options.ticks;let{maxTicksLimit:z,stepSize:j}=l,J;return j?(J=Math.ceil(this.max/j)-Math.floor(this.min/j)+1,J>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${j} would result generating up to ${J} ticks. Limiting to 1000.`),J=1e3)):(J=this.computeTickLimit(),z=z||11),z&&(J=Math.min(z,J)),J}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const l=this.options,z=l.ticks;let j=this.getTickLimit();j=Math.max(2,j);const J={maxTicks:j,bounds:l.bounds,min:l.min,max:l.max,precision:z.precision,step:z.stepSize,count:z.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:z.minRotation||0,includeBounds:z.includeBounds!==!1},mt=this._range||this,kt=Vct(J,mt);return l.bounds==="ticks"&&jot(kt,this,"value"),l.reverse?(kt.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),kt}configure(){const l=this.ticks;let z=this.min,j=this.max;if(super.configure(),this.options.offset&&l.length){const J=(j-z)/Math.max(l.length-1,1)/2;z-=J,j+=J}this._startValue=z,this._endValue=j,this._valueRange=j-z}getLabelForValue(l){return lM(l,this.chart.options.locale,this.options.ticks.format)}}class Wct extends Hct{static id="linear";static defaults={ticks:{callback:VO.formatters.numeric}};determineDataLimits(){const{min:l,max:z}=this.getMinMax(!0);this.min=Qp(l)?l:0,this.max=Qp(z)?z:1,this.handleTickRangeOptions()}computeTickLimit(){const l=this.isHorizontal(),z=l?this.width:this.height,j=tv(this.options.ticks.minRotation),J=(l?Math.sin(j):Math.cos(j))||.001,mt=this._resolveTickFontOptions(0);return Math.ceil(z/Math.min(40,mt.lineHeight/J))}getPixelForValue(l){return l===null?NaN:this.getPixelForDecimal((l-this._startValue)/this._valueRange)}getValueForPixel(l){return this._startValue+this.getDecimalForPixel(l)*this._valueRange}}const G4={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},M0=Object.keys(G4);function tz(d,l){return d-l}function ez(d,l){if(Rh(l))return null;const z=d._adapter,{parser:j,round:J,isoWeekday:mt}=d._parseOpts;let kt=l;return typeof j=="function"&&(kt=j(kt)),Qp(kt)||(kt=typeof j=="string"?z.parse(kt,j):z.parse(kt)),kt===null?null:(J&&(kt=J==="week"&&(V2(mt)||mt===!0)?z.startOf(kt,"isoWeek",mt):z.startOf(kt,J)),+kt)}function rz(d,l,z,j){const J=M0.length;for(let mt=M0.indexOf(d);mt=M0.indexOf(z);mt--){const kt=M0[mt];if(G4[kt].common&&d._adapter.diff(J,j,kt)>=l-1)return kt}return M0[z?M0.indexOf(z):0]}function Zct(d){for(let l=M0.indexOf(d)+1,z=M0.length;l=l?z[j]:z[J];d[mt]=!0}}function $ct(d,l,z,j){const J=d._adapter,mt=+J.startOf(l[0].value,j),kt=l[l.length-1].value;let Dt,Gt;for(Dt=mt;Dt<=kt;Dt=+J.add(Dt,1,j))Gt=z[Dt],Gt>=0&&(l[Gt].major=!0);return l}function iz(d,l,z){const j=[],J={},mt=l.length;let kt,Dt;for(kt=0;kt+l.value))}initOffsets(l=[]){let z=0,j=0,J,mt;this.options.offset&&l.length&&(J=this.getDecimalForValue(l[0]),l.length===1?z=1-J:z=(this.getDecimalForValue(l[1])-J)/2,mt=this.getDecimalForValue(l[l.length-1]),l.length===1?j=mt:j=(mt-this.getDecimalForValue(l[l.length-2]))/2);const kt=l.length<3?.5:.25;z=Xp(z,0,kt),j=Xp(j,0,kt),this._offsets={start:z,end:j,factor:1/(z+1+j)}}_generate(){const l=this._adapter,z=this.min,j=this.max,J=this.options,mt=J.time,kt=mt.unit||rz(mt.minUnit,z,j,this._getLabelCapacity(z)),Dt=cc(J.ticks.stepSize,1),Gt=kt==="week"?mt.isoWeekday:!1,re=V2(Gt)||Gt===!0,pe={};let Ne=z,or,_r;if(re&&(Ne=+l.startOf(Ne,"isoWeek",Gt)),Ne=+l.startOf(Ne,re?"day":kt),l.diff(j,z,kt)>1e5*Dt)throw new Error(z+" and "+j+" are too far apart with stepSize of "+Dt+" "+kt);const Fr=J.ticks.source==="data"&&this.getDataTimestamps();for(or=Ne,_r=0;or+zr)}getLabelForValue(l){const z=this._adapter,j=this.options.time;return j.tooltipFormat?z.format(l,j.tooltipFormat):z.format(l,j.displayFormats.datetime)}format(l,z){const J=this.options.time.displayFormats,mt=this._unit,kt=z||J[mt];return this._adapter.format(l,kt)}_tickFormatFunction(l,z,j,J){const mt=this.options,kt=mt.ticks.callback;if(kt)return Df(kt,[l,z,j],this);const Dt=mt.time.displayFormats,Gt=this._unit,re=this._majorUnit,pe=Gt&&Dt[Gt],Ne=re&&Dt[re],or=j[z],_r=re&&Ne&&or&&or.major;return this._adapter.format(l,J||(_r?Ne:pe))}generateTickLabels(l){let z,j,J;for(z=0,j=l.length;z0?Dt:1}getDataTimestamps(){let l=this._cache.data||[],z,j;if(l.length)return l;const J=this.getMatchingVisibleMetas();if(this._normalized&&J.length)return this._cache.data=J[0].controller.getAllParsedValues(this);for(z=0,j=J.length;z=d[j].pos&&l<=d[J].pos&&({lo:j,hi:J}=yy(d,"pos",l)),{pos:mt,time:Dt}=d[j],{pos:kt,time:Gt}=d[J]):(l>=d[j].time&&l<=d[J].time&&({lo:j,hi:J}=yy(d,"time",l)),{time:mt,pos:Dt}=d[j],{time:kt,pos:Gt}=d[J]);const re=kt-mt;return re?Dt+(Gt-Dt)*(l-mt)/re:Dt}class Dvt extends kA{static id="timeseries";static defaults=kA.defaults;constructor(l){super(l),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const l=this._getTimestampsForTable(),z=this._table=this.buildLookupTable(l);this._minPos=N5(z,this.min),this._tableRange=N5(z,this.max)-this._minPos,super.initOffsets(l)}buildLookupTable(l){const{min:z,max:j}=this,J=[],mt=[];let kt,Dt,Gt,re,pe;for(kt=0,Dt=l.length;kt=z&&re<=j&&J.push(re);if(J.length<2)return[{time:z,pos:0},{time:j,pos:1}];for(kt=0,Dt=J.length;ktJ-mt)}_getTimestampsForTable(){let l=this._cache.all||[];if(l.length)return l;const z=this.getDataTimestamps(),j=this.getLabelTimestamps();return z.length&&j.length?l=this.normalize(z.concat(j)):l=z.length?z:j,l=this._cache.all=l,l}getDecimalForValue(l){return(N5(this._table,l)-this._minPos)/this._tableRange}getValueForPixel(l){const z=this._offsets,j=this.getDecimalForPixel(l)/z.factor-z.end;return N5(this._table,j*this._tableRange+this._minPos,!0)}}const kD=6048e5,Gct=864e5,iw=6e4,aw=36e5,Yct=1e3,az=Symbol.for("constructDateFrom");function bd(d,l){return typeof d=="function"?d(l):d&&typeof d=="object"&&az in d?d[az](l):d instanceof Date?new d.constructor(l):new Date(l)}function Vu(d,l){return bd(l||d,d)}function Y4(d,l,z){const j=Vu(d,z?.in);return isNaN(l)?bd(z?.in||d,NaN):(l&&j.setDate(j.getDate()+l),j)}function gM(d,l,z){const j=Vu(d,z?.in);if(isNaN(l))return bd(d,NaN);if(!l)return j;const J=j.getDate(),mt=bd(d,j.getTime());mt.setMonth(j.getMonth()+l+1,0);const kt=mt.getDate();return J>=kt?mt:(j.setFullYear(mt.getFullYear(),mt.getMonth(),J),j)}function vM(d,l,z){return bd(d,+Vu(d)+l)}function Kct(d,l,z){return vM(d,l*aw)}let Xct={};function Ly(){return Xct}function fg(d,l){const z=Ly(),j=l?.weekStartsOn??l?.locale?.options?.weekStartsOn??z.weekStartsOn??z.locale?.options?.weekStartsOn??0,J=Vu(d,l?.in),mt=J.getDay(),kt=(mt=mt.getTime()?j+1:z.getTime()>=Dt.getTime()?j:j-1}function y4(d){const l=Vu(d),z=new Date(Date.UTC(l.getFullYear(),l.getMonth(),l.getDate(),l.getHours(),l.getMinutes(),l.getSeconds(),l.getMilliseconds()));return z.setUTCFullYear(l.getFullYear()),+d-+z}function Py(d,...l){const z=bd.bind(null,l.find(j=>typeof j=="object"));return l.map(z)}function TA(d,l){const z=Vu(d,l?.in);return z.setHours(0,0,0,0),z}function AD(d,l,z){const[j,J]=Py(z?.in,d,l),mt=TA(j),kt=TA(J),Dt=+mt-y4(mt),Gt=+kt-y4(kt);return Math.round((Dt-Gt)/Gct)}function Jct(d,l){const z=TD(d,l),j=bd(d,0);return j.setFullYear(z,0,4),j.setHours(0,0,0,0),v_(j)}function Qct(d,l,z){const j=Vu(d,z?.in);return j.setTime(j.getTime()+l*iw),j}function tht(d,l,z){return gM(d,l*3,z)}function eht(d,l,z){return vM(d,l*1e3)}function rht(d,l,z){return Y4(d,l*7,z)}function nht(d,l,z){return gM(d,l*12,z)}function E2(d,l){const z=+Vu(d)-+Vu(l);return z<0?-1:z>0?1:z}function iht(d){return d instanceof Date||typeof d=="object"&&Object.prototype.toString.call(d)==="[object Date]"}function MD(d){return!(!iht(d)&&typeof d!="number"||isNaN(+Vu(d)))}function aht(d,l,z){const[j,J]=Py(z?.in,d,l),mt=j.getFullYear()-J.getFullYear(),kt=j.getMonth()-J.getMonth();return mt*12+kt}function oht(d,l,z){const[j,J]=Py(z?.in,d,l);return j.getFullYear()-J.getFullYear()}function SD(d,l,z){const[j,J]=Py(z?.in,d,l),mt=oz(j,J),kt=Math.abs(AD(j,J));j.setDate(j.getDate()-mt*kt);const Dt=+(oz(j,J)===-mt),Gt=mt*(kt-Dt);return Gt===0?0:Gt}function oz(d,l){const z=d.getFullYear()-l.getFullYear()||d.getMonth()-l.getMonth()||d.getDate()-l.getDate()||d.getHours()-l.getHours()||d.getMinutes()-l.getMinutes()||d.getSeconds()-l.getSeconds()||d.getMilliseconds()-l.getMilliseconds();return z<0?-1:z>0?1:z}function ow(d){return l=>{const j=(d?Math[d]:Math.trunc)(l);return j===0?0:j}}function sht(d,l,z){const[j,J]=Py(z?.in,d,l),mt=(+j-+J)/aw;return ow(z?.roundingMethod)(mt)}function yM(d,l){return+Vu(d)-+Vu(l)}function lht(d,l,z){const j=yM(d,l)/iw;return ow(z?.roundingMethod)(j)}function ED(d,l){const z=Vu(d,l?.in);return z.setHours(23,59,59,999),z}function CD(d,l){const z=Vu(d,l?.in),j=z.getMonth();return z.setFullYear(z.getFullYear(),j+1,0),z.setHours(23,59,59,999),z}function uht(d,l){const z=Vu(d,l?.in);return+ED(z,l)==+CD(z,l)}function LD(d,l,z){const[j,J,mt]=Py(z?.in,d,d,l),kt=E2(J,mt),Dt=Math.abs(aht(J,mt));if(Dt<1)return 0;J.getMonth()===1&&J.getDate()>27&&J.setDate(30),J.setMonth(J.getMonth()-kt*Dt);let Gt=E2(J,mt)===-kt;uht(j)&&Dt===1&&E2(j,mt)===1&&(Gt=!1);const re=kt*(Dt-+Gt);return re===0?0:re}function cht(d,l,z){const j=LD(d,l,z)/3;return ow(z?.roundingMethod)(j)}function hht(d,l,z){const j=yM(d,l)/1e3;return ow(z?.roundingMethod)(j)}function fht(d,l,z){const j=SD(d,l,z)/7;return ow(z?.roundingMethod)(j)}function dht(d,l,z){const[j,J]=Py(z?.in,d,l),mt=E2(j,J),kt=Math.abs(oht(j,J));j.setFullYear(1584),J.setFullYear(1584);const Dt=E2(j,J)===-mt,Gt=mt*(kt-+Dt);return Gt===0?0:Gt}function pht(d,l){const z=Vu(d,l?.in),j=z.getMonth(),J=j-j%3;return z.setMonth(J,1),z.setHours(0,0,0,0),z}function mht(d,l){const z=Vu(d,l?.in);return z.setDate(1),z.setHours(0,0,0,0),z}function ght(d,l){const z=Vu(d,l?.in),j=z.getFullYear();return z.setFullYear(j+1,0,0),z.setHours(23,59,59,999),z}function PD(d,l){const z=Vu(d,l?.in);return z.setFullYear(z.getFullYear(),0,1),z.setHours(0,0,0,0),z}function vht(d,l){const z=Vu(d,l?.in);return z.setMinutes(59,59,999),z}function yht(d,l){const z=Ly(),j=z.weekStartsOn??z.locale?.options?.weekStartsOn??0,J=Vu(d,l?.in),mt=J.getDay(),kt=(mt{let j;const J=wht[d];return typeof J=="string"?j=J:l===1?j=J.one:j=J.other.replace("{{count}}",l.toString()),z?.addSuffix?z.comparison&&z.comparison>0?"in "+j:j+" ago":j};function W8(d){return(l={})=>{const z=l.width?String(l.width):d.defaultWidth;return d.formats[z]||d.formats[d.defaultWidth]}}const Tht={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Aht={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Mht={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Sht={date:W8({formats:Tht,defaultWidth:"full"}),time:W8({formats:Aht,defaultWidth:"full"}),dateTime:W8({formats:Mht,defaultWidth:"full"})},Eht={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Cht=(d,l,z,j)=>Eht[d];function o2(d){return(l,z)=>{const j=z?.context?String(z.context):"standalone";let J;if(j==="formatting"&&d.formattingValues){const kt=d.defaultFormattingWidth||d.defaultWidth,Dt=z?.width?String(z.width):kt;J=d.formattingValues[Dt]||d.formattingValues[kt]}else{const kt=d.defaultWidth,Dt=z?.width?String(z.width):d.defaultWidth;J=d.values[Dt]||d.values[kt]}const mt=d.argumentCallback?d.argumentCallback(l):l;return J[mt]}}const Lht={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Pht={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},zht={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Iht={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Oht={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Dht={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Fht=(d,l)=>{const z=Number(d),j=z%100;if(j>20||j<10)switch(j%10){case 1:return z+"st";case 2:return z+"nd";case 3:return z+"rd"}return z+"th"},Rht={ordinalNumber:Fht,era:o2({values:Lht,defaultWidth:"wide"}),quarter:o2({values:Pht,defaultWidth:"wide",argumentCallback:d=>d-1}),month:o2({values:zht,defaultWidth:"wide"}),day:o2({values:Iht,defaultWidth:"wide"}),dayPeriod:o2({values:Oht,defaultWidth:"wide",formattingValues:Dht,defaultFormattingWidth:"wide"})};function s2(d){return(l,z={})=>{const j=z.width,J=j&&d.matchPatterns[j]||d.matchPatterns[d.defaultMatchWidth],mt=l.match(J);if(!mt)return null;const kt=mt[0],Dt=j&&d.parsePatterns[j]||d.parsePatterns[d.defaultParseWidth],Gt=Array.isArray(Dt)?Nht(Dt,Ne=>Ne.test(kt)):Bht(Dt,Ne=>Ne.test(kt));let re;re=d.valueCallback?d.valueCallback(Gt):Gt,re=z.valueCallback?z.valueCallback(re):re;const pe=l.slice(kt.length);return{value:re,rest:pe}}}function Bht(d,l){for(const z in d)if(Object.prototype.hasOwnProperty.call(d,z)&&l(d[z]))return z}function Nht(d,l){for(let z=0;z{const j=l.match(d.matchPattern);if(!j)return null;const J=j[0],mt=l.match(d.parsePattern);if(!mt)return null;let kt=d.valueCallback?d.valueCallback(mt[0]):mt[0];kt=z.valueCallback?z.valueCallback(kt):kt;const Dt=l.slice(J.length);return{value:kt,rest:Dt}}}const Uht=/^(\d+)(th|st|nd|rd)?/i,Vht=/\d+/i,Hht={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Wht={any:[/^b/i,/^(a|c)/i]},qht={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Zht={any:[/1/i,/2/i,/3/i,/4/i]},$ht={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Ght={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Yht={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Kht={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Xht={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Jht={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Qht={ordinalNumber:jht({matchPattern:Uht,parsePattern:Vht,valueCallback:d=>parseInt(d,10)}),era:s2({matchPatterns:Hht,defaultMatchWidth:"wide",parsePatterns:Wht,defaultParseWidth:"any"}),quarter:s2({matchPatterns:qht,defaultMatchWidth:"wide",parsePatterns:Zht,defaultParseWidth:"any",valueCallback:d=>d+1}),month:s2({matchPatterns:$ht,defaultMatchWidth:"wide",parsePatterns:Ght,defaultParseWidth:"any"}),day:s2({matchPatterns:Yht,defaultMatchWidth:"wide",parsePatterns:Kht,defaultParseWidth:"any"}),dayPeriod:s2({matchPatterns:Xht,defaultMatchWidth:"any",parsePatterns:Jht,defaultParseWidth:"any"})},zD={code:"en-US",formatDistance:kht,formatLong:Sht,formatRelative:Cht,localize:Rht,match:Qht,options:{weekStartsOn:0,firstWeekContainsDate:1}};function tft(d,l){const z=Vu(d,l?.in);return AD(z,PD(z))+1}function ID(d,l){const z=Vu(d,l?.in),j=+v_(z)-+Jct(z);return Math.round(j/kD)+1}function xM(d,l){const z=Vu(d,l?.in),j=z.getFullYear(),J=Ly(),mt=l?.firstWeekContainsDate??l?.locale?.options?.firstWeekContainsDate??J.firstWeekContainsDate??J.locale?.options?.firstWeekContainsDate??1,kt=bd(l?.in||d,0);kt.setFullYear(j+1,0,mt),kt.setHours(0,0,0,0);const Dt=fg(kt,l),Gt=bd(l?.in||d,0);Gt.setFullYear(j,0,mt),Gt.setHours(0,0,0,0);const re=fg(Gt,l);return+z>=+Dt?j+1:+z>=+re?j:j-1}function eft(d,l){const z=Ly(),j=l?.firstWeekContainsDate??l?.locale?.options?.firstWeekContainsDate??z.firstWeekContainsDate??z.locale?.options?.firstWeekContainsDate??1,J=xM(d,l),mt=bd(l?.in||d,0);return mt.setFullYear(J,0,j),mt.setHours(0,0,0,0),fg(mt,l)}function OD(d,l){const z=Vu(d,l?.in),j=+fg(z,l)-+eft(z,l);return Math.round(j/kD)+1}function Yh(d,l){const z=d<0?"-":"",j=Math.abs(d).toString().padStart(l,"0");return z+j}const t1={y(d,l){const z=d.getFullYear(),j=z>0?z:1-z;return Yh(l==="yy"?j%100:j,l.length)},M(d,l){const z=d.getMonth();return l==="M"?String(z+1):Yh(z+1,2)},d(d,l){return Yh(d.getDate(),l.length)},a(d,l){const z=d.getHours()/12>=1?"pm":"am";switch(l){case"a":case"aa":return z.toUpperCase();case"aaa":return z;case"aaaaa":return z[0];case"aaaa":default:return z==="am"?"a.m.":"p.m."}},h(d,l){return Yh(d.getHours()%12||12,l.length)},H(d,l){return Yh(d.getHours(),l.length)},m(d,l){return Yh(d.getMinutes(),l.length)},s(d,l){return Yh(d.getSeconds(),l.length)},S(d,l){const z=l.length,j=d.getMilliseconds(),J=Math.trunc(j*Math.pow(10,z-3));return Yh(J,l.length)}},Qx={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},sz={G:function(d,l,z){const j=d.getFullYear()>0?1:0;switch(l){case"G":case"GG":case"GGG":return z.era(j,{width:"abbreviated"});case"GGGGG":return z.era(j,{width:"narrow"});case"GGGG":default:return z.era(j,{width:"wide"})}},y:function(d,l,z){if(l==="yo"){const j=d.getFullYear(),J=j>0?j:1-j;return z.ordinalNumber(J,{unit:"year"})}return t1.y(d,l)},Y:function(d,l,z,j){const J=xM(d,j),mt=J>0?J:1-J;if(l==="YY"){const kt=mt%100;return Yh(kt,2)}return l==="Yo"?z.ordinalNumber(mt,{unit:"year"}):Yh(mt,l.length)},R:function(d,l){const z=TD(d);return Yh(z,l.length)},u:function(d,l){const z=d.getFullYear();return Yh(z,l.length)},Q:function(d,l,z){const j=Math.ceil((d.getMonth()+1)/3);switch(l){case"Q":return String(j);case"QQ":return Yh(j,2);case"Qo":return z.ordinalNumber(j,{unit:"quarter"});case"QQQ":return z.quarter(j,{width:"abbreviated",context:"formatting"});case"QQQQQ":return z.quarter(j,{width:"narrow",context:"formatting"});case"QQQQ":default:return z.quarter(j,{width:"wide",context:"formatting"})}},q:function(d,l,z){const j=Math.ceil((d.getMonth()+1)/3);switch(l){case"q":return String(j);case"qq":return Yh(j,2);case"qo":return z.ordinalNumber(j,{unit:"quarter"});case"qqq":return z.quarter(j,{width:"abbreviated",context:"standalone"});case"qqqqq":return z.quarter(j,{width:"narrow",context:"standalone"});case"qqqq":default:return z.quarter(j,{width:"wide",context:"standalone"})}},M:function(d,l,z){const j=d.getMonth();switch(l){case"M":case"MM":return t1.M(d,l);case"Mo":return z.ordinalNumber(j+1,{unit:"month"});case"MMM":return z.month(j,{width:"abbreviated",context:"formatting"});case"MMMMM":return z.month(j,{width:"narrow",context:"formatting"});case"MMMM":default:return z.month(j,{width:"wide",context:"formatting"})}},L:function(d,l,z){const j=d.getMonth();switch(l){case"L":return String(j+1);case"LL":return Yh(j+1,2);case"Lo":return z.ordinalNumber(j+1,{unit:"month"});case"LLL":return z.month(j,{width:"abbreviated",context:"standalone"});case"LLLLL":return z.month(j,{width:"narrow",context:"standalone"});case"LLLL":default:return z.month(j,{width:"wide",context:"standalone"})}},w:function(d,l,z,j){const J=OD(d,j);return l==="wo"?z.ordinalNumber(J,{unit:"week"}):Yh(J,l.length)},I:function(d,l,z){const j=ID(d);return l==="Io"?z.ordinalNumber(j,{unit:"week"}):Yh(j,l.length)},d:function(d,l,z){return l==="do"?z.ordinalNumber(d.getDate(),{unit:"date"}):t1.d(d,l)},D:function(d,l,z){const j=tft(d);return l==="Do"?z.ordinalNumber(j,{unit:"dayOfYear"}):Yh(j,l.length)},E:function(d,l,z){const j=d.getDay();switch(l){case"E":case"EE":case"EEE":return z.day(j,{width:"abbreviated",context:"formatting"});case"EEEEE":return z.day(j,{width:"narrow",context:"formatting"});case"EEEEEE":return z.day(j,{width:"short",context:"formatting"});case"EEEE":default:return z.day(j,{width:"wide",context:"formatting"})}},e:function(d,l,z,j){const J=d.getDay(),mt=(J-j.weekStartsOn+8)%7||7;switch(l){case"e":return String(mt);case"ee":return Yh(mt,2);case"eo":return z.ordinalNumber(mt,{unit:"day"});case"eee":return z.day(J,{width:"abbreviated",context:"formatting"});case"eeeee":return z.day(J,{width:"narrow",context:"formatting"});case"eeeeee":return z.day(J,{width:"short",context:"formatting"});case"eeee":default:return z.day(J,{width:"wide",context:"formatting"})}},c:function(d,l,z,j){const J=d.getDay(),mt=(J-j.weekStartsOn+8)%7||7;switch(l){case"c":return String(mt);case"cc":return Yh(mt,l.length);case"co":return z.ordinalNumber(mt,{unit:"day"});case"ccc":return z.day(J,{width:"abbreviated",context:"standalone"});case"ccccc":return z.day(J,{width:"narrow",context:"standalone"});case"cccccc":return z.day(J,{width:"short",context:"standalone"});case"cccc":default:return z.day(J,{width:"wide",context:"standalone"})}},i:function(d,l,z){const j=d.getDay(),J=j===0?7:j;switch(l){case"i":return String(J);case"ii":return Yh(J,l.length);case"io":return z.ordinalNumber(J,{unit:"day"});case"iii":return z.day(j,{width:"abbreviated",context:"formatting"});case"iiiii":return z.day(j,{width:"narrow",context:"formatting"});case"iiiiii":return z.day(j,{width:"short",context:"formatting"});case"iiii":default:return z.day(j,{width:"wide",context:"formatting"})}},a:function(d,l,z){const J=d.getHours()/12>=1?"pm":"am";switch(l){case"a":case"aa":return z.dayPeriod(J,{width:"abbreviated",context:"formatting"});case"aaa":return z.dayPeriod(J,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return z.dayPeriod(J,{width:"narrow",context:"formatting"});case"aaaa":default:return z.dayPeriod(J,{width:"wide",context:"formatting"})}},b:function(d,l,z){const j=d.getHours();let J;switch(j===12?J=Qx.noon:j===0?J=Qx.midnight:J=j/12>=1?"pm":"am",l){case"b":case"bb":return z.dayPeriod(J,{width:"abbreviated",context:"formatting"});case"bbb":return z.dayPeriod(J,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return z.dayPeriod(J,{width:"narrow",context:"formatting"});case"bbbb":default:return z.dayPeriod(J,{width:"wide",context:"formatting"})}},B:function(d,l,z){const j=d.getHours();let J;switch(j>=17?J=Qx.evening:j>=12?J=Qx.afternoon:j>=4?J=Qx.morning:J=Qx.night,l){case"B":case"BB":case"BBB":return z.dayPeriod(J,{width:"abbreviated",context:"formatting"});case"BBBBB":return z.dayPeriod(J,{width:"narrow",context:"formatting"});case"BBBB":default:return z.dayPeriod(J,{width:"wide",context:"formatting"})}},h:function(d,l,z){if(l==="ho"){let j=d.getHours()%12;return j===0&&(j=12),z.ordinalNumber(j,{unit:"hour"})}return t1.h(d,l)},H:function(d,l,z){return l==="Ho"?z.ordinalNumber(d.getHours(),{unit:"hour"}):t1.H(d,l)},K:function(d,l,z){const j=d.getHours()%12;return l==="Ko"?z.ordinalNumber(j,{unit:"hour"}):Yh(j,l.length)},k:function(d,l,z){let j=d.getHours();return j===0&&(j=24),l==="ko"?z.ordinalNumber(j,{unit:"hour"}):Yh(j,l.length)},m:function(d,l,z){return l==="mo"?z.ordinalNumber(d.getMinutes(),{unit:"minute"}):t1.m(d,l)},s:function(d,l,z){return l==="so"?z.ordinalNumber(d.getSeconds(),{unit:"second"}):t1.s(d,l)},S:function(d,l){return t1.S(d,l)},X:function(d,l,z){const j=d.getTimezoneOffset();if(j===0)return"Z";switch(l){case"X":return uz(j);case"XXXX":case"XX":return dy(j);case"XXXXX":case"XXX":default:return dy(j,":")}},x:function(d,l,z){const j=d.getTimezoneOffset();switch(l){case"x":return uz(j);case"xxxx":case"xx":return dy(j);case"xxxxx":case"xxx":default:return dy(j,":")}},O:function(d,l,z){const j=d.getTimezoneOffset();switch(l){case"O":case"OO":case"OOO":return"GMT"+lz(j,":");case"OOOO":default:return"GMT"+dy(j,":")}},z:function(d,l,z){const j=d.getTimezoneOffset();switch(l){case"z":case"zz":case"zzz":return"GMT"+lz(j,":");case"zzzz":default:return"GMT"+dy(j,":")}},t:function(d,l,z){const j=Math.trunc(+d/1e3);return Yh(j,l.length)},T:function(d,l,z){return Yh(+d,l.length)}};function lz(d,l=""){const z=d>0?"-":"+",j=Math.abs(d),J=Math.trunc(j/60),mt=j%60;return mt===0?z+String(J):z+String(J)+l+Yh(mt,2)}function uz(d,l){return d%60===0?(d>0?"-":"+")+Yh(Math.abs(d)/60,2):dy(d,l)}function dy(d,l=""){const z=d>0?"-":"+",j=Math.abs(d),J=Yh(Math.trunc(j/60),2),mt=Yh(j%60,2);return z+J+l+mt}const cz=(d,l)=>{switch(d){case"P":return l.date({width:"short"});case"PP":return l.date({width:"medium"});case"PPP":return l.date({width:"long"});case"PPPP":default:return l.date({width:"full"})}},DD=(d,l)=>{switch(d){case"p":return l.time({width:"short"});case"pp":return l.time({width:"medium"});case"ppp":return l.time({width:"long"});case"pppp":default:return l.time({width:"full"})}},rft=(d,l)=>{const z=d.match(/(P+)(p+)?/)||[],j=z[1],J=z[2];if(!J)return cz(d,l);let mt;switch(j){case"P":mt=l.dateTime({width:"short"});break;case"PP":mt=l.dateTime({width:"medium"});break;case"PPP":mt=l.dateTime({width:"long"});break;case"PPPP":default:mt=l.dateTime({width:"full"});break}return mt.replace("{{date}}",cz(j,l)).replace("{{time}}",DD(J,l))},AA={p:DD,P:rft},nft=/^D+$/,ift=/^Y+$/,aft=["D","DD","YY","YYYY"];function FD(d){return nft.test(d)}function RD(d){return ift.test(d)}function MA(d,l,z){const j=oft(d,l,z);if(console.warn(j),aft.includes(d))throw new RangeError(j)}function oft(d,l,z){const j=d[0]==="Y"?"years":"days of the month";return`Use \`${d.toLowerCase()}\` instead of \`${d}\` (in \`${l}\`) for formatting ${j} to the input \`${z}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const sft=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,lft=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,uft=/^'([^]*?)'?$/,cft=/''/g,hft=/[a-zA-Z]/;function fft(d,l,z){const j=Ly(),J=z?.locale??j.locale??zD,mt=z?.firstWeekContainsDate??z?.locale?.options?.firstWeekContainsDate??j.firstWeekContainsDate??j.locale?.options?.firstWeekContainsDate??1,kt=z?.weekStartsOn??z?.locale?.options?.weekStartsOn??j.weekStartsOn??j.locale?.options?.weekStartsOn??0,Dt=Vu(d,z?.in);if(!MD(Dt))throw new RangeError("Invalid time value");let Gt=l.match(lft).map(pe=>{const Ne=pe[0];if(Ne==="p"||Ne==="P"){const or=AA[Ne];return or(pe,J.formatLong)}return pe}).join("").match(sft).map(pe=>{if(pe==="''")return{isToken:!1,value:"'"};const Ne=pe[0];if(Ne==="'")return{isToken:!1,value:dft(pe)};if(sz[Ne])return{isToken:!0,value:pe};if(Ne.match(hft))throw new RangeError("Format string contains an unescaped latin alphabet character `"+Ne+"`");return{isToken:!1,value:pe}});J.localize.preprocessor&&(Gt=J.localize.preprocessor(Dt,Gt));const re={firstWeekContainsDate:mt,weekStartsOn:kt,locale:J};return Gt.map(pe=>{if(!pe.isToken)return pe.value;const Ne=pe.value;(!z?.useAdditionalWeekYearTokens&&RD(Ne)||!z?.useAdditionalDayOfYearTokens&&FD(Ne))&&MA(Ne,l,String(d));const or=sz[Ne[0]];return or(Dt,Ne,J.localize,re)}).join("")}function dft(d){const l=d.match(uft);return l?l[1].replace(cft,"'"):d}function pft(){return Object.assign({},Ly())}function mft(d,l){const z=Vu(d,l?.in).getDay();return z===0?7:z}function gft(d,l){const z=vft(l)?new l(0):bd(l,0);return z.setFullYear(d.getFullYear(),d.getMonth(),d.getDate()),z.setHours(d.getHours(),d.getMinutes(),d.getSeconds(),d.getMilliseconds()),z}function vft(d){return typeof d=="function"&&d.prototype?.constructor===d}const yft=10;class BD{subPriority=0;validate(l,z){return!0}}class xft extends BD{constructor(l,z,j,J,mt){super(),this.value=l,this.validateValue=z,this.setValue=j,this.priority=J,mt&&(this.subPriority=mt)}validate(l,z){return this.validateValue(l,this.value,z)}set(l,z,j){return this.setValue(l,z,this.value,j)}}class _ft extends BD{priority=yft;subPriority=-1;constructor(l,z){super(),this.context=l||(j=>bd(z,j))}set(l,z){return z.timestampIsSet?l:bd(l,gft(l,this.context))}}class Ah{run(l,z,j,J){const mt=this.parse(l,z,j,J);return mt?{setter:new xft(mt.value,this.validate,this.set,this.priority,this.subPriority),rest:mt.rest}:null}validate(l,z,j){return!0}}class bft extends Ah{priority=140;parse(l,z,j){switch(z){case"G":case"GG":case"GGG":return j.era(l,{width:"abbreviated"})||j.era(l,{width:"narrow"});case"GGGGG":return j.era(l,{width:"narrow"});case"GGGG":default:return j.era(l,{width:"wide"})||j.era(l,{width:"abbreviated"})||j.era(l,{width:"narrow"})}}set(l,z,j){return z.era=j,l.setFullYear(j,0,1),l.setHours(0,0,0,0),l}incompatibleTokens=["R","u","t","T"]}const Nd={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},sg={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function jd(d,l){return d&&{value:l(d.value),rest:d.rest}}function ad(d,l){const z=l.match(d);return z?{value:parseInt(z[0],10),rest:l.slice(z[0].length)}:null}function lg(d,l){const z=l.match(d);if(!z)return null;if(z[0]==="Z")return{value:0,rest:l.slice(1)};const j=z[1]==="+"?1:-1,J=z[2]?parseInt(z[2],10):0,mt=z[3]?parseInt(z[3],10):0,kt=z[5]?parseInt(z[5],10):0;return{value:j*(J*aw+mt*iw+kt*Yct),rest:l.slice(z[0].length)}}function ND(d){return ad(Nd.anyDigitsSigned,d)}function wd(d,l){switch(d){case 1:return ad(Nd.singleDigit,l);case 2:return ad(Nd.twoDigits,l);case 3:return ad(Nd.threeDigits,l);case 4:return ad(Nd.fourDigits,l);default:return ad(new RegExp("^\\d{1,"+d+"}"),l)}}function x4(d,l){switch(d){case 1:return ad(Nd.singleDigitSigned,l);case 2:return ad(Nd.twoDigitsSigned,l);case 3:return ad(Nd.threeDigitsSigned,l);case 4:return ad(Nd.fourDigitsSigned,l);default:return ad(new RegExp("^-?\\d{1,"+d+"}"),l)}}function _M(d){switch(d){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function jD(d,l){const z=l>0,j=z?l:1-l;let J;if(j<=50)J=d||100;else{const mt=j+50,kt=Math.trunc(mt/100)*100,Dt=d>=mt%100;J=d+kt-(Dt?100:0)}return z?J:1-J}function UD(d){return d%400===0||d%4===0&&d%100!==0}class wft extends Ah{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(l,z,j){const J=mt=>({year:mt,isTwoDigitYear:z==="yy"});switch(z){case"y":return jd(wd(4,l),J);case"yo":return jd(j.ordinalNumber(l,{unit:"year"}),J);default:return jd(wd(z.length,l),J)}}validate(l,z){return z.isTwoDigitYear||z.year>0}set(l,z,j){const J=l.getFullYear();if(j.isTwoDigitYear){const kt=jD(j.year,J);return l.setFullYear(kt,0,1),l.setHours(0,0,0,0),l}const mt=!("era"in z)||z.era===1?j.year:1-j.year;return l.setFullYear(mt,0,1),l.setHours(0,0,0,0),l}}class kft extends Ah{priority=130;parse(l,z,j){const J=mt=>({year:mt,isTwoDigitYear:z==="YY"});switch(z){case"Y":return jd(wd(4,l),J);case"Yo":return jd(j.ordinalNumber(l,{unit:"year"}),J);default:return jd(wd(z.length,l),J)}}validate(l,z){return z.isTwoDigitYear||z.year>0}set(l,z,j,J){const mt=xM(l,J);if(j.isTwoDigitYear){const Dt=jD(j.year,mt);return l.setFullYear(Dt,0,J.firstWeekContainsDate),l.setHours(0,0,0,0),fg(l,J)}const kt=!("era"in z)||z.era===1?j.year:1-j.year;return l.setFullYear(kt,0,J.firstWeekContainsDate),l.setHours(0,0,0,0),fg(l,J)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class Tft extends Ah{priority=130;parse(l,z){return x4(z==="R"?4:z.length,l)}set(l,z,j){const J=bd(l,0);return J.setFullYear(j,0,4),J.setHours(0,0,0,0),v_(J)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class Aft extends Ah{priority=130;parse(l,z){return x4(z==="u"?4:z.length,l)}set(l,z,j){return l.setFullYear(j,0,1),l.setHours(0,0,0,0),l}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]}class Mft extends Ah{priority=120;parse(l,z,j){switch(z){case"Q":case"QQ":return wd(z.length,l);case"Qo":return j.ordinalNumber(l,{unit:"quarter"});case"QQQ":return j.quarter(l,{width:"abbreviated",context:"formatting"})||j.quarter(l,{width:"narrow",context:"formatting"});case"QQQQQ":return j.quarter(l,{width:"narrow",context:"formatting"});case"QQQQ":default:return j.quarter(l,{width:"wide",context:"formatting"})||j.quarter(l,{width:"abbreviated",context:"formatting"})||j.quarter(l,{width:"narrow",context:"formatting"})}}validate(l,z){return z>=1&&z<=4}set(l,z,j){return l.setMonth((j-1)*3,1),l.setHours(0,0,0,0),l}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]}class Sft extends Ah{priority=120;parse(l,z,j){switch(z){case"q":case"qq":return wd(z.length,l);case"qo":return j.ordinalNumber(l,{unit:"quarter"});case"qqq":return j.quarter(l,{width:"abbreviated",context:"standalone"})||j.quarter(l,{width:"narrow",context:"standalone"});case"qqqqq":return j.quarter(l,{width:"narrow",context:"standalone"});case"qqqq":default:return j.quarter(l,{width:"wide",context:"standalone"})||j.quarter(l,{width:"abbreviated",context:"standalone"})||j.quarter(l,{width:"narrow",context:"standalone"})}}validate(l,z){return z>=1&&z<=4}set(l,z,j){return l.setMonth((j-1)*3,1),l.setHours(0,0,0,0),l}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]}class Eft extends Ah{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(l,z,j){const J=mt=>mt-1;switch(z){case"M":return jd(ad(Nd.month,l),J);case"MM":return jd(wd(2,l),J);case"Mo":return jd(j.ordinalNumber(l,{unit:"month"}),J);case"MMM":return j.month(l,{width:"abbreviated",context:"formatting"})||j.month(l,{width:"narrow",context:"formatting"});case"MMMMM":return j.month(l,{width:"narrow",context:"formatting"});case"MMMM":default:return j.month(l,{width:"wide",context:"formatting"})||j.month(l,{width:"abbreviated",context:"formatting"})||j.month(l,{width:"narrow",context:"formatting"})}}validate(l,z){return z>=0&&z<=11}set(l,z,j){return l.setMonth(j,1),l.setHours(0,0,0,0),l}}class Cft extends Ah{priority=110;parse(l,z,j){const J=mt=>mt-1;switch(z){case"L":return jd(ad(Nd.month,l),J);case"LL":return jd(wd(2,l),J);case"Lo":return jd(j.ordinalNumber(l,{unit:"month"}),J);case"LLL":return j.month(l,{width:"abbreviated",context:"standalone"})||j.month(l,{width:"narrow",context:"standalone"});case"LLLLL":return j.month(l,{width:"narrow",context:"standalone"});case"LLLL":default:return j.month(l,{width:"wide",context:"standalone"})||j.month(l,{width:"abbreviated",context:"standalone"})||j.month(l,{width:"narrow",context:"standalone"})}}validate(l,z){return z>=0&&z<=11}set(l,z,j){return l.setMonth(j,1),l.setHours(0,0,0,0),l}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]}function Lft(d,l,z){const j=Vu(d,z?.in),J=OD(j,z)-l;return j.setDate(j.getDate()-J*7),Vu(j,z?.in)}class Pft extends Ah{priority=100;parse(l,z,j){switch(z){case"w":return ad(Nd.week,l);case"wo":return j.ordinalNumber(l,{unit:"week"});default:return wd(z.length,l)}}validate(l,z){return z>=1&&z<=53}set(l,z,j,J){return fg(Lft(l,j,J),J)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function zft(d,l,z){const j=Vu(d,z?.in),J=ID(j,z)-l;return j.setDate(j.getDate()-J*7),j}class Ift extends Ah{priority=100;parse(l,z,j){switch(z){case"I":return ad(Nd.week,l);case"Io":return j.ordinalNumber(l,{unit:"week"});default:return wd(z.length,l)}}validate(l,z){return z>=1&&z<=53}set(l,z,j){return v_(zft(l,j))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const Oft=[31,28,31,30,31,30,31,31,30,31,30,31],Dft=[31,29,31,30,31,30,31,31,30,31,30,31];class Fft extends Ah{priority=90;subPriority=1;parse(l,z,j){switch(z){case"d":return ad(Nd.date,l);case"do":return j.ordinalNumber(l,{unit:"date"});default:return wd(z.length,l)}}validate(l,z){const j=l.getFullYear(),J=UD(j),mt=l.getMonth();return J?z>=1&&z<=Dft[mt]:z>=1&&z<=Oft[mt]}set(l,z,j){return l.setDate(j),l.setHours(0,0,0,0),l}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]}class Rft extends Ah{priority=90;subpriority=1;parse(l,z,j){switch(z){case"D":case"DD":return ad(Nd.dayOfYear,l);case"Do":return j.ordinalNumber(l,{unit:"date"});default:return wd(z.length,l)}}validate(l,z){const j=l.getFullYear();return UD(j)?z>=1&&z<=366:z>=1&&z<=365}set(l,z,j){return l.setMonth(0,j),l.setHours(0,0,0,0),l}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]}function bM(d,l,z){const j=Ly(),J=z?.weekStartsOn??z?.locale?.options?.weekStartsOn??j.weekStartsOn??j.locale?.options?.weekStartsOn??0,mt=Vu(d,z?.in),kt=mt.getDay(),Gt=(l%7+7)%7,re=7-J,pe=l<0||l>6?l-(kt+re)%7:(Gt+re)%7-(kt+re)%7;return Y4(mt,pe,z)}class Bft extends Ah{priority=90;parse(l,z,j){switch(z){case"E":case"EE":case"EEE":return j.day(l,{width:"abbreviated",context:"formatting"})||j.day(l,{width:"short",context:"formatting"})||j.day(l,{width:"narrow",context:"formatting"});case"EEEEE":return j.day(l,{width:"narrow",context:"formatting"});case"EEEEEE":return j.day(l,{width:"short",context:"formatting"})||j.day(l,{width:"narrow",context:"formatting"});case"EEEE":default:return j.day(l,{width:"wide",context:"formatting"})||j.day(l,{width:"abbreviated",context:"formatting"})||j.day(l,{width:"short",context:"formatting"})||j.day(l,{width:"narrow",context:"formatting"})}}validate(l,z){return z>=0&&z<=6}set(l,z,j,J){return l=bM(l,j,J),l.setHours(0,0,0,0),l}incompatibleTokens=["D","i","e","c","t","T"]}class Nft extends Ah{priority=90;parse(l,z,j,J){const mt=kt=>{const Dt=Math.floor((kt-1)/7)*7;return(kt+J.weekStartsOn+6)%7+Dt};switch(z){case"e":case"ee":return jd(wd(z.length,l),mt);case"eo":return jd(j.ordinalNumber(l,{unit:"day"}),mt);case"eee":return j.day(l,{width:"abbreviated",context:"formatting"})||j.day(l,{width:"short",context:"formatting"})||j.day(l,{width:"narrow",context:"formatting"});case"eeeee":return j.day(l,{width:"narrow",context:"formatting"});case"eeeeee":return j.day(l,{width:"short",context:"formatting"})||j.day(l,{width:"narrow",context:"formatting"});case"eeee":default:return j.day(l,{width:"wide",context:"formatting"})||j.day(l,{width:"abbreviated",context:"formatting"})||j.day(l,{width:"short",context:"formatting"})||j.day(l,{width:"narrow",context:"formatting"})}}validate(l,z){return z>=0&&z<=6}set(l,z,j,J){return l=bM(l,j,J),l.setHours(0,0,0,0),l}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]}class jft extends Ah{priority=90;parse(l,z,j,J){const mt=kt=>{const Dt=Math.floor((kt-1)/7)*7;return(kt+J.weekStartsOn+6)%7+Dt};switch(z){case"c":case"cc":return jd(wd(z.length,l),mt);case"co":return jd(j.ordinalNumber(l,{unit:"day"}),mt);case"ccc":return j.day(l,{width:"abbreviated",context:"standalone"})||j.day(l,{width:"short",context:"standalone"})||j.day(l,{width:"narrow",context:"standalone"});case"ccccc":return j.day(l,{width:"narrow",context:"standalone"});case"cccccc":return j.day(l,{width:"short",context:"standalone"})||j.day(l,{width:"narrow",context:"standalone"});case"cccc":default:return j.day(l,{width:"wide",context:"standalone"})||j.day(l,{width:"abbreviated",context:"standalone"})||j.day(l,{width:"short",context:"standalone"})||j.day(l,{width:"narrow",context:"standalone"})}}validate(l,z){return z>=0&&z<=6}set(l,z,j,J){return l=bM(l,j,J),l.setHours(0,0,0,0),l}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]}function Uft(d,l,z){const j=Vu(d,z?.in),J=mft(j,z),mt=l-J;return Y4(j,mt,z)}class Vft extends Ah{priority=90;parse(l,z,j){const J=mt=>mt===0?7:mt;switch(z){case"i":case"ii":return wd(z.length,l);case"io":return j.ordinalNumber(l,{unit:"day"});case"iii":return jd(j.day(l,{width:"abbreviated",context:"formatting"})||j.day(l,{width:"short",context:"formatting"})||j.day(l,{width:"narrow",context:"formatting"}),J);case"iiiii":return jd(j.day(l,{width:"narrow",context:"formatting"}),J);case"iiiiii":return jd(j.day(l,{width:"short",context:"formatting"})||j.day(l,{width:"narrow",context:"formatting"}),J);case"iiii":default:return jd(j.day(l,{width:"wide",context:"formatting"})||j.day(l,{width:"abbreviated",context:"formatting"})||j.day(l,{width:"short",context:"formatting"})||j.day(l,{width:"narrow",context:"formatting"}),J)}}validate(l,z){return z>=1&&z<=7}set(l,z,j){return l=Uft(l,j),l.setHours(0,0,0,0),l}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]}class Hft extends Ah{priority=80;parse(l,z,j){switch(z){case"a":case"aa":case"aaa":return j.dayPeriod(l,{width:"abbreviated",context:"formatting"})||j.dayPeriod(l,{width:"narrow",context:"formatting"});case"aaaaa":return j.dayPeriod(l,{width:"narrow",context:"formatting"});case"aaaa":default:return j.dayPeriod(l,{width:"wide",context:"formatting"})||j.dayPeriod(l,{width:"abbreviated",context:"formatting"})||j.dayPeriod(l,{width:"narrow",context:"formatting"})}}set(l,z,j){return l.setHours(_M(j),0,0,0),l}incompatibleTokens=["b","B","H","k","t","T"]}class Wft extends Ah{priority=80;parse(l,z,j){switch(z){case"b":case"bb":case"bbb":return j.dayPeriod(l,{width:"abbreviated",context:"formatting"})||j.dayPeriod(l,{width:"narrow",context:"formatting"});case"bbbbb":return j.dayPeriod(l,{width:"narrow",context:"formatting"});case"bbbb":default:return j.dayPeriod(l,{width:"wide",context:"formatting"})||j.dayPeriod(l,{width:"abbreviated",context:"formatting"})||j.dayPeriod(l,{width:"narrow",context:"formatting"})}}set(l,z,j){return l.setHours(_M(j),0,0,0),l}incompatibleTokens=["a","B","H","k","t","T"]}class qft extends Ah{priority=80;parse(l,z,j){switch(z){case"B":case"BB":case"BBB":return j.dayPeriod(l,{width:"abbreviated",context:"formatting"})||j.dayPeriod(l,{width:"narrow",context:"formatting"});case"BBBBB":return j.dayPeriod(l,{width:"narrow",context:"formatting"});case"BBBB":default:return j.dayPeriod(l,{width:"wide",context:"formatting"})||j.dayPeriod(l,{width:"abbreviated",context:"formatting"})||j.dayPeriod(l,{width:"narrow",context:"formatting"})}}set(l,z,j){return l.setHours(_M(j),0,0,0),l}incompatibleTokens=["a","b","t","T"]}class Zft extends Ah{priority=70;parse(l,z,j){switch(z){case"h":return ad(Nd.hour12h,l);case"ho":return j.ordinalNumber(l,{unit:"hour"});default:return wd(z.length,l)}}validate(l,z){return z>=1&&z<=12}set(l,z,j){const J=l.getHours()>=12;return J&&j<12?l.setHours(j+12,0,0,0):!J&&j===12?l.setHours(0,0,0,0):l.setHours(j,0,0,0),l}incompatibleTokens=["H","K","k","t","T"]}class $ft extends Ah{priority=70;parse(l,z,j){switch(z){case"H":return ad(Nd.hour23h,l);case"Ho":return j.ordinalNumber(l,{unit:"hour"});default:return wd(z.length,l)}}validate(l,z){return z>=0&&z<=23}set(l,z,j){return l.setHours(j,0,0,0),l}incompatibleTokens=["a","b","h","K","k","t","T"]}class Gft extends Ah{priority=70;parse(l,z,j){switch(z){case"K":return ad(Nd.hour11h,l);case"Ko":return j.ordinalNumber(l,{unit:"hour"});default:return wd(z.length,l)}}validate(l,z){return z>=0&&z<=11}set(l,z,j){return l.getHours()>=12&&j<12?l.setHours(j+12,0,0,0):l.setHours(j,0,0,0),l}incompatibleTokens=["h","H","k","t","T"]}class Yft extends Ah{priority=70;parse(l,z,j){switch(z){case"k":return ad(Nd.hour24h,l);case"ko":return j.ordinalNumber(l,{unit:"hour"});default:return wd(z.length,l)}}validate(l,z){return z>=1&&z<=24}set(l,z,j){const J=j<=24?j%24:j;return l.setHours(J,0,0,0),l}incompatibleTokens=["a","b","h","H","K","t","T"]}class Kft extends Ah{priority=60;parse(l,z,j){switch(z){case"m":return ad(Nd.minute,l);case"mo":return j.ordinalNumber(l,{unit:"minute"});default:return wd(z.length,l)}}validate(l,z){return z>=0&&z<=59}set(l,z,j){return l.setMinutes(j,0,0),l}incompatibleTokens=["t","T"]}class Xft extends Ah{priority=50;parse(l,z,j){switch(z){case"s":return ad(Nd.second,l);case"so":return j.ordinalNumber(l,{unit:"second"});default:return wd(z.length,l)}}validate(l,z){return z>=0&&z<=59}set(l,z,j){return l.setSeconds(j,0),l}incompatibleTokens=["t","T"]}class Jft extends Ah{priority=30;parse(l,z){const j=J=>Math.trunc(J*Math.pow(10,-z.length+3));return jd(wd(z.length,l),j)}set(l,z,j){return l.setMilliseconds(j),l}incompatibleTokens=["t","T"]}class Qft extends Ah{priority=10;parse(l,z){switch(z){case"X":return lg(sg.basicOptionalMinutes,l);case"XX":return lg(sg.basic,l);case"XXXX":return lg(sg.basicOptionalSeconds,l);case"XXXXX":return lg(sg.extendedOptionalSeconds,l);case"XXX":default:return lg(sg.extended,l)}}set(l,z,j){return z.timestampIsSet?l:bd(l,l.getTime()-y4(l)-j)}incompatibleTokens=["t","T","x"]}class tdt extends Ah{priority=10;parse(l,z){switch(z){case"x":return lg(sg.basicOptionalMinutes,l);case"xx":return lg(sg.basic,l);case"xxxx":return lg(sg.basicOptionalSeconds,l);case"xxxxx":return lg(sg.extendedOptionalSeconds,l);case"xxx":default:return lg(sg.extended,l)}}set(l,z,j){return z.timestampIsSet?l:bd(l,l.getTime()-y4(l)-j)}incompatibleTokens=["t","T","X"]}class edt extends Ah{priority=40;parse(l){return ND(l)}set(l,z,j){return[bd(l,j*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class rdt extends Ah{priority=20;parse(l){return ND(l)}set(l,z,j){return[bd(l,j),{timestampIsSet:!0}]}incompatibleTokens="*"}const ndt={G:new bft,y:new wft,Y:new kft,R:new Tft,u:new Aft,Q:new Mft,q:new Sft,M:new Eft,L:new Cft,w:new Pft,I:new Ift,d:new Fft,D:new Rft,E:new Bft,e:new Nft,c:new jft,i:new Vft,a:new Hft,b:new Wft,B:new qft,h:new Zft,H:new $ft,K:new Gft,k:new Yft,m:new Kft,s:new Xft,S:new Jft,X:new Qft,x:new tdt,t:new edt,T:new rdt},idt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,adt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,odt=/^'([^]*?)'?$/,sdt=/''/g,ldt=/\S/,udt=/[a-zA-Z]/;function cdt(d,l,z,j){const J=()=>bd(j?.in||z,NaN),mt=pft(),kt=j?.locale??mt.locale??zD,Dt=j?.firstWeekContainsDate??j?.locale?.options?.firstWeekContainsDate??mt.firstWeekContainsDate??mt.locale?.options?.firstWeekContainsDate??1,Gt=j?.weekStartsOn??j?.locale?.options?.weekStartsOn??mt.weekStartsOn??mt.locale?.options?.weekStartsOn??0;if(!l)return d?J():Vu(z,j?.in);const re={firstWeekContainsDate:Dt,weekStartsOn:Gt,locale:kt},pe=[new _ft(j?.in,z)],Ne=l.match(adt).map(Wr=>{const An=Wr[0];if(An in AA){const Ft=AA[An];return Ft(Wr,kt.formatLong)}return Wr}).join("").match(idt),or=[];for(let Wr of Ne){!j?.useAdditionalWeekYearTokens&&RD(Wr)&&MA(Wr,l,d),!j?.useAdditionalDayOfYearTokens&&FD(Wr)&&MA(Wr,l,d);const An=Wr[0],Ft=ndt[An];if(Ft){const{incompatibleTokens:kn}=Ft;if(Array.isArray(kn)){const jn=or.find(ai=>kn.includes(ai.token)||ai.token===An);if(jn)throw new RangeError(`The format string mustn't contain \`${jn.fullToken}\` and \`${Wr}\` at the same time`)}else if(Ft.incompatibleTokens==="*"&&or.length>0)throw new RangeError(`The format string mustn't contain \`${Wr}\` and any other token at the same time`);or.push({token:An,fullToken:Wr});const ei=Ft.run(d,Wr,kt.match,re);if(!ei)return J();pe.push(ei.setter),d=ei.rest}else{if(An.match(udt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+An+"`");if(Wr==="''"?Wr="'":An==="'"&&(Wr=hdt(Wr)),d.indexOf(Wr)===0)d=d.slice(Wr.length);else return J()}}if(d.length>0&&ldt.test(d))return J();const _r=pe.map(Wr=>Wr.priority).sort((Wr,An)=>An-Wr).filter((Wr,An,Ft)=>Ft.indexOf(Wr)===An).map(Wr=>pe.filter(An=>An.priority===Wr).sort((An,Ft)=>Ft.subPriority-An.subPriority)).map(Wr=>Wr[0]);let Fr=Vu(z,j?.in);if(isNaN(+Fr))return J();const zr={};for(const Wr of _r){if(!Wr.validate(Fr,re))return J();const An=Wr.set(Fr,zr,re);Array.isArray(An)?(Fr=An[0],Object.assign(zr,An[1])):Fr=An}return Fr}function hdt(d){return d.match(odt)[1].replace(sdt,"'")}function fdt(d,l){const z=Vu(d,l?.in);return z.setMinutes(0,0,0),z}function ddt(d,l){const z=Vu(d,l?.in);return z.setSeconds(0,0),z}function pdt(d,l){const z=Vu(d,l?.in);return z.setMilliseconds(0),z}function mdt(d,l){const z=()=>bd(l?.in,NaN),j=l?.additionalDigits??2,J=xdt(d);let mt;if(J.date){const re=_dt(J.date,j);mt=bdt(re.restDateString,re.year)}if(!mt||isNaN(+mt))return z();const kt=+mt;let Dt=0,Gt;if(J.time&&(Dt=wdt(J.time),isNaN(Dt)))return z();if(J.timezone){if(Gt=kdt(J.timezone),isNaN(Gt))return z()}else{const re=new Date(kt+Dt),pe=Vu(0,l?.in);return pe.setFullYear(re.getUTCFullYear(),re.getUTCMonth(),re.getUTCDate()),pe.setHours(re.getUTCHours(),re.getUTCMinutes(),re.getUTCSeconds(),re.getUTCMilliseconds()),pe}return Vu(kt+Dt+Gt,l?.in)}const j5={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},gdt=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,vdt=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,ydt=/^([+-])(\d{2})(?::?(\d{2}))?$/;function xdt(d){const l={},z=d.split(j5.dateTimeDelimiter);let j;if(z.length>2)return l;if(/:/.test(z[0])?j=z[0]:(l.date=z[0],j=z[1],j5.timeZoneDelimiter.test(l.date)&&(l.date=d.split(j5.timeZoneDelimiter)[0],j=d.substr(l.date.length,d.length))),j){const J=j5.timezone.exec(j);J?(l.time=j.replace(J[1],""),l.timezone=J[1]):l.time=j}return l}function _dt(d,l){const z=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+l)+"})|(\\d{2}|[+-]\\d{"+(2+l)+"})$)"),j=d.match(z);if(!j)return{year:NaN,restDateString:""};const J=j[1]?parseInt(j[1]):null,mt=j[2]?parseInt(j[2]):null;return{year:mt===null?J:mt*100,restDateString:d.slice((j[1]||j[2]).length)}}function bdt(d,l){if(l===null)return new Date(NaN);const z=d.match(gdt);if(!z)return new Date(NaN);const j=!!z[4],J=l2(z[1]),mt=l2(z[2])-1,kt=l2(z[3]),Dt=l2(z[4]),Gt=l2(z[5])-1;if(j)return Edt(l,Dt,Gt)?Tdt(l,Dt,Gt):new Date(NaN);{const re=new Date(0);return!Mdt(l,mt,kt)||!Sdt(l,J)?new Date(NaN):(re.setUTCFullYear(l,mt,Math.max(J,kt)),re)}}function l2(d){return d?parseInt(d):1}function wdt(d){const l=d.match(vdt);if(!l)return NaN;const z=q8(l[1]),j=q8(l[2]),J=q8(l[3]);return Cdt(z,j,J)?z*aw+j*iw+J*1e3:NaN}function q8(d){return d&&parseFloat(d.replace(",","."))||0}function kdt(d){if(d==="Z")return 0;const l=d.match(ydt);if(!l)return 0;const z=l[1]==="+"?-1:1,j=parseInt(l[2]),J=l[3]&&parseInt(l[3])||0;return Ldt(j,J)?z*(j*aw+J*iw):NaN}function Tdt(d,l,z){const j=new Date(0);j.setUTCFullYear(d,0,4);const J=j.getUTCDay()||7,mt=(l-1)*7+z+1-J;return j.setUTCDate(j.getUTCDate()+mt),j}const Adt=[31,null,31,30,31,30,31,31,30,31,30,31];function VD(d){return d%400===0||d%4===0&&d%100!==0}function Mdt(d,l,z){return l>=0&&l<=11&&z>=1&&z<=(Adt[l]||(VD(d)?29:28))}function Sdt(d,l){return l>=1&&l<=(VD(d)?366:365)}function Edt(d,l,z){return l>=1&&l<=53&&z>=0&&z<=6}function Cdt(d,l,z){return d===24?l===0&&z===0:z>=0&&z<60&&l>=0&&l<60&&d>=0&&d<25}function Ldt(d,l){return l>=0&&l<=59}/*! +`):d}function zct(d,l){const{element:z,datasetIndex:j,index:J}=l,mt=d.getDatasetMeta(j).controller,{label:kt,value:Dt}=mt.getLabelAndValue(J);return{chart:d,label:kt,parsed:mt.getParsed(J),raw:d.data.datasets[j].data[J],formattedValue:Dt,dataset:mt.getDataset(),dataIndex:J,datasetIndex:j,element:z}}function ZP(d,l){const z=d.chart.ctx,{body:j,footer:J,title:mt}=d,{boxWidth:kt,boxHeight:Dt}=l,Gt=Jp(l.bodyFont),re=Jp(l.titleFont),pe=Jp(l.footerFont),Ne=mt.length,or=J.length,_r=j.length,Fr=fm(l.padding);let zr=Fr.height,Wr=0,An=j.reduce((ei,jn)=>ei+jn.before.length+jn.lines.length+jn.after.length,0);if(An+=d.beforeBody.length+d.afterBody.length,Ne&&(zr+=Ne*re.lineHeight+(Ne-1)*l.titleSpacing+l.titleMarginBottom),An){const ei=l.displayColors?Math.max(Dt,Gt.lineHeight):Gt.lineHeight;zr+=_r*ei+(An-_r)*Gt.lineHeight+(An-1)*l.bodySpacing}or&&(zr+=l.footerMarginTop+or*pe.lineHeight+(or-1)*l.footerSpacing);let Ft=0;const kn=function(ei){Wr=Math.max(Wr,z.measureText(ei).width+Ft)};return z.save(),z.font=re.string,Kh(d.title,kn),z.font=Gt.string,Kh(d.beforeBody.concat(d.afterBody),kn),Ft=l.displayColors?kt+2+l.boxPadding:0,Kh(j,ei=>{Kh(ei.before,kn),Kh(ei.lines,kn),Kh(ei.after,kn)}),Ft=0,z.font=pe.string,Kh(d.footer,kn),z.restore(),Wr+=Fr.width,{width:Wr,height:zr}}function Ict(d,l){const{y:z,height:j}=l;return zd.height-j/2?"bottom":"center"}function Oct(d,l,z,j){const{x:J,width:mt}=j,kt=z.caretSize+z.caretPadding;if(d==="left"&&J+mt+kt>l.width||d==="right"&&J-mt-kt<0)return!0}function Dct(d,l,z,j){const{x:J,width:mt}=z,{width:kt,chartArea:{left:Dt,right:Gt}}=d;let re="center";return j==="center"?re=J<=(Dt+Gt)/2?"left":"right":J<=mt/2?re="left":J>=kt-mt/2&&(re="right"),Oct(re,d,l,z)&&(re="center"),re}function $P(d,l,z){const j=z.yAlign||l.yAlign||Ict(d,z);return{xAlign:z.xAlign||l.xAlign||Dct(d,l,z,j),yAlign:j}}function Fct(d,l){let{x:z,width:j}=d;return l==="right"?z-=j:l==="center"&&(z-=j/2),z}function Rct(d,l,z){let{y:j,height:J}=d;return l==="top"?j+=z:l==="bottom"?j-=J+z:j-=J/2,j}function GP(d,l,z,j){const{caretSize:J,caretPadding:mt,cornerRadius:kt}=d,{xAlign:Dt,yAlign:Gt}=z,re=J+mt,{topLeft:pe,topRight:Ne,bottomLeft:or,bottomRight:_r}=s_(kt);let Fr=Fct(l,Dt);const zr=Rct(l,Gt,re);return Gt==="center"?Dt==="left"?Fr+=re:Dt==="right"&&(Fr-=re):Dt==="left"?Fr-=Math.max(pe,or)+J:Dt==="right"&&(Fr+=Math.max(Ne,_r)+J),{x:Xp(Fr,0,j.width-l.width),y:Xp(zr,0,j.height-l.height)}}function B5(d,l,z){const j=fm(z.padding);return l==="center"?d.x+d.width/2:l==="right"?d.x+d.width-j.right:d.x+j.left}function YP(d){return ng([],Yg(d))}function Bct(d,l,z){return Cy(d,{tooltip:l,tooltipItems:z,type:"tooltip"})}function KP(d,l){const z=l&&l.dataset&&l.dataset.tooltip&&l.dataset.tooltip.callbacks;return z?d.override(z):d}const wD={beforeTitle:$g,title(d){if(d.length>0){const l=d[0],z=l.chart.data.labels,j=z?z.length:0;if(this&&this.options&&this.options.mode==="dataset")return l.dataset.label||"";if(l.label)return l.label;if(j>0&&l.dataIndex"u"?wD[l].call(z,j):J}class XP extends lv{static positioners=p2;constructor(l){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=l.chart,this.options=l.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(l){this.options=l,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const l=this._cachedAnimations;if(l)return l;const z=this.chart,j=this.options.setContext(this.getContext()),J=j.enabled&&z.options.animation&&j.animations,mt=new rD(this.chart,J);return J._cacheable&&(this._cachedAnimations=Object.freeze(mt)),mt}getContext(){return this.$context||(this.$context=Bct(this.chart.getContext(),this,this._tooltipItems))}getTitle(l,z){const{callbacks:j}=z,J=A0(j,"beforeTitle",this,l),mt=A0(j,"title",this,l),kt=A0(j,"afterTitle",this,l);let Dt=[];return Dt=ng(Dt,Yg(J)),Dt=ng(Dt,Yg(mt)),Dt=ng(Dt,Yg(kt)),Dt}getBeforeBody(l,z){return YP(A0(z.callbacks,"beforeBody",this,l))}getBody(l,z){const{callbacks:j}=z,J=[];return Kh(l,mt=>{const kt={before:[],lines:[],after:[]},Dt=KP(j,mt);ng(kt.before,Yg(A0(Dt,"beforeLabel",this,mt))),ng(kt.lines,A0(Dt,"label",this,mt)),ng(kt.after,Yg(A0(Dt,"afterLabel",this,mt))),J.push(kt)}),J}getAfterBody(l,z){return YP(A0(z.callbacks,"afterBody",this,l))}getFooter(l,z){const{callbacks:j}=z,J=A0(j,"beforeFooter",this,l),mt=A0(j,"footer",this,l),kt=A0(j,"afterFooter",this,l);let Dt=[];return Dt=ng(Dt,Yg(J)),Dt=ng(Dt,Yg(mt)),Dt=ng(Dt,Yg(kt)),Dt}_createItems(l){const z=this._active,j=this.chart.data,J=[],mt=[],kt=[];let Dt=[],Gt,re;for(Gt=0,re=z.length;Gtl.filter(pe,Ne,or,j))),l.itemSort&&(Dt=Dt.sort((pe,Ne)=>l.itemSort(pe,Ne,j))),Kh(Dt,pe=>{const Ne=KP(l.callbacks,pe);J.push(A0(Ne,"labelColor",this,pe)),mt.push(A0(Ne,"labelPointStyle",this,pe)),kt.push(A0(Ne,"labelTextColor",this,pe))}),this.labelColors=J,this.labelPointStyles=mt,this.labelTextColors=kt,this.dataPoints=Dt,Dt}update(l,z){const j=this.options.setContext(this.getContext()),J=this._active;let mt,kt=[];if(!J.length)this.opacity!==0&&(mt={opacity:0});else{const Dt=p2[j.position].call(this,J,this._eventPosition);kt=this._createItems(j),this.title=this.getTitle(kt,j),this.beforeBody=this.getBeforeBody(kt,j),this.body=this.getBody(kt,j),this.afterBody=this.getAfterBody(kt,j),this.footer=this.getFooter(kt,j);const Gt=this._size=ZP(this,j),re=Object.assign({},Dt,Gt),pe=$P(this.chart,j,re),Ne=GP(j,re,pe,this.chart);this.xAlign=pe.xAlign,this.yAlign=pe.yAlign,mt={opacity:1,x:Ne.x,y:Ne.y,width:Gt.width,height:Gt.height,caretX:Dt.x,caretY:Dt.y}}this._tooltipItems=kt,this.$context=void 0,mt&&this._resolveAnimations().update(this,mt),l&&j.external&&j.external.call(this,{chart:this.chart,tooltip:this,replay:z})}drawCaret(l,z,j,J){const mt=this.getCaretPosition(l,j,J);z.lineTo(mt.x1,mt.y1),z.lineTo(mt.x2,mt.y2),z.lineTo(mt.x3,mt.y3)}getCaretPosition(l,z,j){const{xAlign:J,yAlign:mt}=this,{caretSize:kt,cornerRadius:Dt}=j,{topLeft:Gt,topRight:re,bottomLeft:pe,bottomRight:Ne}=s_(Dt),{x:or,y:_r}=l,{width:Fr,height:zr}=z;let Wr,An,Ft,kn,ei,jn;return mt==="center"?(ei=_r+zr/2,J==="left"?(Wr=or,An=Wr-kt,kn=ei+kt,jn=ei-kt):(Wr=or+Fr,An=Wr+kt,kn=ei-kt,jn=ei+kt),Ft=Wr):(J==="left"?An=or+Math.max(Gt,pe)+kt:J==="right"?An=or+Fr-Math.max(re,Ne)-kt:An=this.caretX,mt==="top"?(kn=_r,ei=kn-kt,Wr=An-kt,Ft=An+kt):(kn=_r+zr,ei=kn+kt,Wr=An+kt,Ft=An-kt),jn=kn),{x1:Wr,x2:An,x3:Ft,y1:kn,y2:ei,y3:jn}}drawTitle(l,z,j){const J=this.title,mt=J.length;let kt,Dt,Gt;if(mt){const re=l_(j.rtl,this.x,this.width);for(l.x=B5(this,j.titleAlign,j),z.textAlign=re.textAlign(j.titleAlign),z.textBaseline="middle",kt=Jp(j.titleFont),Dt=j.titleSpacing,z.fillStyle=j.titleColor,z.font=kt.string,Gt=0;GtFt!==0)?(l.beginPath(),l.fillStyle=mt.multiKeyBackground,p4(l,{x:zr,y:Fr,w:re,h:Gt,radius:An}),l.fill(),l.stroke(),l.fillStyle=kt.backgroundColor,l.beginPath(),p4(l,{x:Wr,y:Fr+1,w:re-2,h:Gt-2,radius:An}),l.fill()):(l.fillStyle=mt.multiKeyBackground,l.fillRect(zr,Fr,re,Gt),l.strokeRect(zr,Fr,re,Gt),l.fillStyle=kt.backgroundColor,l.fillRect(Wr,Fr+1,re-2,Gt-2))}l.fillStyle=this.labelTextColors[j]}drawBody(l,z,j){const{body:J}=this,{bodySpacing:mt,bodyAlign:kt,displayColors:Dt,boxHeight:Gt,boxWidth:re,boxPadding:pe}=j,Ne=Jp(j.bodyFont);let or=Ne.lineHeight,_r=0;const Fr=l_(j.rtl,this.x,this.width),zr=function(Gi){z.fillText(Gi,Fr.x(l.x+_r),l.y+or/2),l.y+=or+mt},Wr=Fr.textAlign(kt);let An,Ft,kn,ei,jn,ai,Qi;for(z.textAlign=kt,z.textBaseline="middle",z.font=Ne.string,l.x=B5(this,Wr,j),z.fillStyle=j.bodyColor,Kh(this.beforeBody,zr),_r=Dt&&Wr!=="right"?kt==="center"?re/2+pe:re+2+pe:0,ei=0,ai=J.length;ei0&&z.stroke()}_updateAnimationTarget(l){const z=this.chart,j=this.$animations,J=j&&j.x,mt=j&&j.y;if(J||mt){const kt=p2[l.position].call(this,this._active,this._eventPosition);if(!kt)return;const Dt=this._size=ZP(this,l),Gt=Object.assign({},kt,this._size),re=$P(z,l,Gt),pe=GP(l,Gt,re,z);(J._to!==pe.x||mt._to!==pe.y)&&(this.xAlign=re.xAlign,this.yAlign=re.yAlign,this.width=Dt.width,this.height=Dt.height,this.caretX=kt.x,this.caretY=kt.y,this._resolveAnimations().update(this,pe))}}_willRender(){return!!this.opacity}draw(l){const z=this.options.setContext(this.getContext());let j=this.opacity;if(!j)return;this._updateAnimationTarget(z);const J={width:this.width,height:this.height},mt={x:this.x,y:this.y};j=Math.abs(j)<.001?0:j;const kt=fm(z.padding),Dt=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;z.enabled&&Dt&&(l.save(),l.globalAlpha=j,this.drawBackground(mt,l,J,z),KO(l,z.textDirection),mt.y+=kt.top,this.drawTitle(mt,l,z),this.drawBody(mt,l,z),this.drawFooter(mt,l,z),XO(l,z.textDirection),l.restore())}getActiveElements(){return this._active||[]}setActiveElements(l,z){const j=this._active,J=l.map(({datasetIndex:Dt,index:Gt})=>{const re=this.chart.getDatasetMeta(Dt);if(!re)throw new Error("Cannot find a dataset at index "+Dt);return{datasetIndex:Dt,element:re.data[Gt],index:Gt}}),mt=!h4(j,J),kt=this._positionChanged(J,z);(mt||kt)&&(this._active=J,this._eventPosition=z,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(l,z,j=!0){if(z&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const J=this.options,mt=this._active||[],kt=this._getActiveElements(l,mt,z,j),Dt=this._positionChanged(kt,l),Gt=z||!h4(kt,mt)||Dt;return Gt&&(this._active=kt,(J.enabled||J.external)&&(this._eventPosition={x:l.x,y:l.y},this.update(!0,z))),Gt}_getActiveElements(l,z,j,J){const mt=this.options;if(l.type==="mouseout")return[];if(!J)return z.filter(Dt=>this.chart.data.datasets[Dt.datasetIndex]&&this.chart.getDatasetMeta(Dt.datasetIndex).controller.getParsed(Dt.index)!==void 0);const kt=this.chart.getElementsAtEventForMode(l,mt.mode,mt,j);return mt.reverse&&kt.reverse(),kt}_positionChanged(l,z){const{caretX:j,caretY:J,options:mt}=this,kt=p2[mt.position].call(this,l,z);return kt!==!1&&(j!==kt.x||J!==kt.y)}}var Nct={id:"tooltip",_element:XP,positioners:p2,afterInit(d,l,z){z&&(d.tooltip=new XP({chart:d,options:z}))},beforeUpdate(d,l,z){d.tooltip&&d.tooltip.initialize(z)},reset(d,l,z){d.tooltip&&d.tooltip.initialize(z)},afterDraw(d){const l=d.tooltip;if(l&&l._willRender()){const z={tooltip:l};if(d.notifyPlugins("beforeTooltipDraw",{...z,cancelable:!0})===!1)return;l.draw(d.ctx),d.notifyPlugins("afterTooltipDraw",z)}},afterEvent(d,l){if(d.tooltip){const z=l.replay;d.tooltip.handleEvent(l.event,z,l.inChartArea)&&(l.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(d,l)=>l.bodyFont.size,boxWidth:(d,l)=>l.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:wD},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:d=>d!=="filter"&&d!=="itemSort"&&d!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const jct=(d,l,z,j)=>(typeof l=="string"?(z=d.push(l)-1,j.unshift({index:z,label:l})):isNaN(l)&&(z=null),z);function Uct(d,l,z,j){const J=d.indexOf(l);if(J===-1)return jct(d,l,z,j);const mt=d.lastIndexOf(l);return J!==mt?z:J}const Vct=(d,l)=>d===null?null:Xp(Math.round(d),0,l);function JP(d){const l=this.getLabels();return d>=0&&dz.length-1?null:this.getPixelForValue(z[l].value)}getValueForPixel(l){return Math.round(this._startValue+this.getDecimalForPixel(l)*this._valueRange)}getBasePixel(){return this.bottom}}function Wct(d,l){const z=[],{bounds:J,step:mt,min:kt,max:Dt,precision:Gt,count:re,maxTicks:pe,maxDigits:Ne,includeBounds:or}=d,_r=mt||1,Fr=pe-1,{min:zr,max:Wr}=l,An=!Rh(kt),Ft=!Rh(Dt),kn=!Rh(re),ei=(Wr-zr)/(Ne+1);let jn=GL((Wr-zr)/Fr/_r)*_r,ai,Qi,Gi,un;if(jn<1e-14&&!An&&!Ft)return[{value:zr},{value:Wr}];un=Math.ceil(Wr/jn)-Math.floor(zr/jn),un>Fr&&(jn=GL(un*jn/Fr/_r)*_r),Rh(Gt)||(ai=Math.pow(10,Gt),jn=Math.ceil(jn*ai)/ai),J==="ticks"?(Qi=Math.floor(zr/jn)*jn,Gi=Math.ceil(Wr/jn)*jn):(Qi=zr,Gi=Wr),An&&Ft&&mt&&Uot((Dt-kt)/mt,jn/1e3)?(un=Math.round(Math.min((Dt-kt)/jn,pe)),jn=(Dt-kt)/un,Qi=kt,Gi=Dt):kn?(Qi=An?kt:Qi,Gi=Ft?Dt:Gi,un=re-1,jn=(Gi-Qi)/un):(un=(Gi-Qi)/jn,A2(un,Math.round(un),jn/1e3)?un=Math.round(un):un=Math.ceil(un));const ia=Math.max(YL(jn),YL(Qi));ai=Math.pow(10,Rh(Gt)?ia:Gt),Qi=Math.round(Qi*ai)/ai,Gi=Math.round(Gi*ai)/ai;let fa=0;for(An&&(or&&Qi!==kt?(z.push({value:kt}),QiDt)break;z.push({value:Li})}return Ft&&or&&Gi!==Dt?z.length&&A2(z[z.length-1].value,Dt,QP(Dt,ei,d))?z[z.length-1].value=Dt:z.push({value:Dt}):(!Ft||Gi===Dt)&&z.push({value:Gi}),z}function QP(d,l,{horizontal:z,minRotation:j}){const J=tv(j),mt=(z?Math.sin(J):Math.cos(J))||.001,kt=.75*l*(""+d).length;return Math.min(l/mt,kt)}class qct extends __{constructor(l){super(l),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(l,z){return Rh(l)||(typeof l=="number"||l instanceof Number)&&!isFinite(+l)?null:+l}handleTickRangeOptions(){const{beginAtZero:l}=this.options,{minDefined:z,maxDefined:j}=this.getUserBounds();let{min:J,max:mt}=this;const kt=Gt=>J=z?J:Gt,Dt=Gt=>mt=j?mt:Gt;if(l){const Gt=cg(J),re=cg(mt);Gt<0&&re<0?Dt(0):Gt>0&&re>0&&kt(0)}if(J===mt){let Gt=mt===0?1:Math.abs(mt*.05);Dt(mt+Gt),l||kt(J-Gt)}this.min=J,this.max=mt}getTickLimit(){const l=this.options.ticks;let{maxTicksLimit:z,stepSize:j}=l,J;return j?(J=Math.ceil(this.max/j)-Math.floor(this.min/j)+1,J>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${j} would result generating up to ${J} ticks. Limiting to 1000.`),J=1e3)):(J=this.computeTickLimit(),z=z||11),z&&(J=Math.min(z,J)),J}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const l=this.options,z=l.ticks;let j=this.getTickLimit();j=Math.max(2,j);const J={maxTicks:j,bounds:l.bounds,min:l.min,max:l.max,precision:z.precision,step:z.stepSize,count:z.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:z.minRotation||0,includeBounds:z.includeBounds!==!1},mt=this._range||this,kt=Wct(J,mt);return l.bounds==="ticks"&&Vot(kt,this,"value"),l.reverse?(kt.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),kt}configure(){const l=this.ticks;let z=this.min,j=this.max;if(super.configure(),this.options.offset&&l.length){const J=(j-z)/Math.max(l.length-1,1)/2;z-=J,j+=J}this._startValue=z,this._endValue=j,this._valueRange=j-z}getLabelForValue(l){return lM(l,this.chart.options.locale,this.options.ticks.format)}}class Zct extends qct{static id="linear";static defaults={ticks:{callback:VO.formatters.numeric}};determineDataLimits(){const{min:l,max:z}=this.getMinMax(!0);this.min=Qp(l)?l:0,this.max=Qp(z)?z:1,this.handleTickRangeOptions()}computeTickLimit(){const l=this.isHorizontal(),z=l?this.width:this.height,j=tv(this.options.ticks.minRotation),J=(l?Math.sin(j):Math.cos(j))||.001,mt=this._resolveTickFontOptions(0);return Math.ceil(z/Math.min(40,mt.lineHeight/J))}getPixelForValue(l){return l===null?NaN:this.getPixelForDecimal((l-this._startValue)/this._valueRange)}getValueForPixel(l){return this._startValue+this.getDecimalForPixel(l)*this._valueRange}}const G4={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},M0=Object.keys(G4);function tz(d,l){return d-l}function ez(d,l){if(Rh(l))return null;const z=d._adapter,{parser:j,round:J,isoWeekday:mt}=d._parseOpts;let kt=l;return typeof j=="function"&&(kt=j(kt)),Qp(kt)||(kt=typeof j=="string"?z.parse(kt,j):z.parse(kt)),kt===null?null:(J&&(kt=J==="week"&&(V2(mt)||mt===!0)?z.startOf(kt,"isoWeek",mt):z.startOf(kt,J)),+kt)}function rz(d,l,z,j){const J=M0.length;for(let mt=M0.indexOf(d);mt=M0.indexOf(z);mt--){const kt=M0[mt];if(G4[kt].common&&d._adapter.diff(J,j,kt)>=l-1)return kt}return M0[z?M0.indexOf(z):0]}function Gct(d){for(let l=M0.indexOf(d)+1,z=M0.length;l=l?z[j]:z[J];d[mt]=!0}}function Yct(d,l,z,j){const J=d._adapter,mt=+J.startOf(l[0].value,j),kt=l[l.length-1].value;let Dt,Gt;for(Dt=mt;Dt<=kt;Dt=+J.add(Dt,1,j))Gt=z[Dt],Gt>=0&&(l[Gt].major=!0);return l}function iz(d,l,z){const j=[],J={},mt=l.length;let kt,Dt;for(kt=0;kt+l.value))}initOffsets(l=[]){let z=0,j=0,J,mt;this.options.offset&&l.length&&(J=this.getDecimalForValue(l[0]),l.length===1?z=1-J:z=(this.getDecimalForValue(l[1])-J)/2,mt=this.getDecimalForValue(l[l.length-1]),l.length===1?j=mt:j=(mt-this.getDecimalForValue(l[l.length-2]))/2);const kt=l.length<3?.5:.25;z=Xp(z,0,kt),j=Xp(j,0,kt),this._offsets={start:z,end:j,factor:1/(z+1+j)}}_generate(){const l=this._adapter,z=this.min,j=this.max,J=this.options,mt=J.time,kt=mt.unit||rz(mt.minUnit,z,j,this._getLabelCapacity(z)),Dt=cc(J.ticks.stepSize,1),Gt=kt==="week"?mt.isoWeekday:!1,re=V2(Gt)||Gt===!0,pe={};let Ne=z,or,_r;if(re&&(Ne=+l.startOf(Ne,"isoWeek",Gt)),Ne=+l.startOf(Ne,re?"day":kt),l.diff(j,z,kt)>1e5*Dt)throw new Error(z+" and "+j+" are too far apart with stepSize of "+Dt+" "+kt);const Fr=J.ticks.source==="data"&&this.getDataTimestamps();for(or=Ne,_r=0;or+zr)}getLabelForValue(l){const z=this._adapter,j=this.options.time;return j.tooltipFormat?z.format(l,j.tooltipFormat):z.format(l,j.displayFormats.datetime)}format(l,z){const J=this.options.time.displayFormats,mt=this._unit,kt=z||J[mt];return this._adapter.format(l,kt)}_tickFormatFunction(l,z,j,J){const mt=this.options,kt=mt.ticks.callback;if(kt)return Df(kt,[l,z,j],this);const Dt=mt.time.displayFormats,Gt=this._unit,re=this._majorUnit,pe=Gt&&Dt[Gt],Ne=re&&Dt[re],or=j[z],_r=re&&Ne&&or&&or.major;return this._adapter.format(l,J||(_r?Ne:pe))}generateTickLabels(l){let z,j,J;for(z=0,j=l.length;z0?Dt:1}getDataTimestamps(){let l=this._cache.data||[],z,j;if(l.length)return l;const J=this.getMatchingVisibleMetas();if(this._normalized&&J.length)return this._cache.data=J[0].controller.getAllParsedValues(this);for(z=0,j=J.length;z=d[j].pos&&l<=d[J].pos&&({lo:j,hi:J}=yy(d,"pos",l)),{pos:mt,time:Dt}=d[j],{pos:kt,time:Gt}=d[J]):(l>=d[j].time&&l<=d[J].time&&({lo:j,hi:J}=yy(d,"time",l)),{time:mt,pos:Dt}=d[j],{time:kt,pos:Gt}=d[J]);const re=kt-mt;return re?Dt+(Gt-Dt)*(l-mt)/re:Dt}class Rvt extends kA{static id="timeseries";static defaults=kA.defaults;constructor(l){super(l),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const l=this._getTimestampsForTable(),z=this._table=this.buildLookupTable(l);this._minPos=N5(z,this.min),this._tableRange=N5(z,this.max)-this._minPos,super.initOffsets(l)}buildLookupTable(l){const{min:z,max:j}=this,J=[],mt=[];let kt,Dt,Gt,re,pe;for(kt=0,Dt=l.length;kt=z&&re<=j&&J.push(re);if(J.length<2)return[{time:z,pos:0},{time:j,pos:1}];for(kt=0,Dt=J.length;ktJ-mt)}_getTimestampsForTable(){let l=this._cache.all||[];if(l.length)return l;const z=this.getDataTimestamps(),j=this.getLabelTimestamps();return z.length&&j.length?l=this.normalize(z.concat(j)):l=z.length?z:j,l=this._cache.all=l,l}getDecimalForValue(l){return(N5(this._table,l)-this._minPos)/this._tableRange}getValueForPixel(l){const z=this._offsets,j=this.getDecimalForPixel(l)/z.factor-z.end;return N5(this._table,j*this._tableRange+this._minPos,!0)}}const kD=6048e5,Kct=864e5,iw=6e4,aw=36e5,Xct=1e3,az=Symbol.for("constructDateFrom");function bd(d,l){return typeof d=="function"?d(l):d&&typeof d=="object"&&az in d?d[az](l):d instanceof Date?new d.constructor(l):new Date(l)}function Vu(d,l){return bd(l||d,d)}function Y4(d,l,z){const j=Vu(d,z?.in);return isNaN(l)?bd(z?.in||d,NaN):(l&&j.setDate(j.getDate()+l),j)}function gM(d,l,z){const j=Vu(d,z?.in);if(isNaN(l))return bd(d,NaN);if(!l)return j;const J=j.getDate(),mt=bd(d,j.getTime());mt.setMonth(j.getMonth()+l+1,0);const kt=mt.getDate();return J>=kt?mt:(j.setFullYear(mt.getFullYear(),mt.getMonth(),J),j)}function vM(d,l,z){return bd(d,+Vu(d)+l)}function Jct(d,l,z){return vM(d,l*aw)}let Qct={};function Ly(){return Qct}function fg(d,l){const z=Ly(),j=l?.weekStartsOn??l?.locale?.options?.weekStartsOn??z.weekStartsOn??z.locale?.options?.weekStartsOn??0,J=Vu(d,l?.in),mt=J.getDay(),kt=(mt=mt.getTime()?j+1:z.getTime()>=Dt.getTime()?j:j-1}function y4(d){const l=Vu(d),z=new Date(Date.UTC(l.getFullYear(),l.getMonth(),l.getDate(),l.getHours(),l.getMinutes(),l.getSeconds(),l.getMilliseconds()));return z.setUTCFullYear(l.getFullYear()),+d-+z}function Py(d,...l){const z=bd.bind(null,l.find(j=>typeof j=="object"));return l.map(z)}function TA(d,l){const z=Vu(d,l?.in);return z.setHours(0,0,0,0),z}function AD(d,l,z){const[j,J]=Py(z?.in,d,l),mt=TA(j),kt=TA(J),Dt=+mt-y4(mt),Gt=+kt-y4(kt);return Math.round((Dt-Gt)/Kct)}function tht(d,l){const z=TD(d,l),j=bd(d,0);return j.setFullYear(z,0,4),j.setHours(0,0,0,0),v_(j)}function eht(d,l,z){const j=Vu(d,z?.in);return j.setTime(j.getTime()+l*iw),j}function rht(d,l,z){return gM(d,l*3,z)}function nht(d,l,z){return vM(d,l*1e3)}function iht(d,l,z){return Y4(d,l*7,z)}function aht(d,l,z){return gM(d,l*12,z)}function E2(d,l){const z=+Vu(d)-+Vu(l);return z<0?-1:z>0?1:z}function oht(d){return d instanceof Date||typeof d=="object"&&Object.prototype.toString.call(d)==="[object Date]"}function MD(d){return!(!oht(d)&&typeof d!="number"||isNaN(+Vu(d)))}function sht(d,l,z){const[j,J]=Py(z?.in,d,l),mt=j.getFullYear()-J.getFullYear(),kt=j.getMonth()-J.getMonth();return mt*12+kt}function lht(d,l,z){const[j,J]=Py(z?.in,d,l);return j.getFullYear()-J.getFullYear()}function SD(d,l,z){const[j,J]=Py(z?.in,d,l),mt=oz(j,J),kt=Math.abs(AD(j,J));j.setDate(j.getDate()-mt*kt);const Dt=+(oz(j,J)===-mt),Gt=mt*(kt-Dt);return Gt===0?0:Gt}function oz(d,l){const z=d.getFullYear()-l.getFullYear()||d.getMonth()-l.getMonth()||d.getDate()-l.getDate()||d.getHours()-l.getHours()||d.getMinutes()-l.getMinutes()||d.getSeconds()-l.getSeconds()||d.getMilliseconds()-l.getMilliseconds();return z<0?-1:z>0?1:z}function ow(d){return l=>{const j=(d?Math[d]:Math.trunc)(l);return j===0?0:j}}function uht(d,l,z){const[j,J]=Py(z?.in,d,l),mt=(+j-+J)/aw;return ow(z?.roundingMethod)(mt)}function yM(d,l){return+Vu(d)-+Vu(l)}function cht(d,l,z){const j=yM(d,l)/iw;return ow(z?.roundingMethod)(j)}function ED(d,l){const z=Vu(d,l?.in);return z.setHours(23,59,59,999),z}function CD(d,l){const z=Vu(d,l?.in),j=z.getMonth();return z.setFullYear(z.getFullYear(),j+1,0),z.setHours(23,59,59,999),z}function hht(d,l){const z=Vu(d,l?.in);return+ED(z,l)==+CD(z,l)}function LD(d,l,z){const[j,J,mt]=Py(z?.in,d,d,l),kt=E2(J,mt),Dt=Math.abs(sht(J,mt));if(Dt<1)return 0;J.getMonth()===1&&J.getDate()>27&&J.setDate(30),J.setMonth(J.getMonth()-kt*Dt);let Gt=E2(J,mt)===-kt;hht(j)&&Dt===1&&E2(j,mt)===1&&(Gt=!1);const re=kt*(Dt-+Gt);return re===0?0:re}function fht(d,l,z){const j=LD(d,l,z)/3;return ow(z?.roundingMethod)(j)}function dht(d,l,z){const j=yM(d,l)/1e3;return ow(z?.roundingMethod)(j)}function pht(d,l,z){const j=SD(d,l,z)/7;return ow(z?.roundingMethod)(j)}function mht(d,l,z){const[j,J]=Py(z?.in,d,l),mt=E2(j,J),kt=Math.abs(lht(j,J));j.setFullYear(1584),J.setFullYear(1584);const Dt=E2(j,J)===-mt,Gt=mt*(kt-+Dt);return Gt===0?0:Gt}function ght(d,l){const z=Vu(d,l?.in),j=z.getMonth(),J=j-j%3;return z.setMonth(J,1),z.setHours(0,0,0,0),z}function vht(d,l){const z=Vu(d,l?.in);return z.setDate(1),z.setHours(0,0,0,0),z}function yht(d,l){const z=Vu(d,l?.in),j=z.getFullYear();return z.setFullYear(j+1,0,0),z.setHours(23,59,59,999),z}function PD(d,l){const z=Vu(d,l?.in);return z.setFullYear(z.getFullYear(),0,1),z.setHours(0,0,0,0),z}function xht(d,l){const z=Vu(d,l?.in);return z.setMinutes(59,59,999),z}function _ht(d,l){const z=Ly(),j=z.weekStartsOn??z.locale?.options?.weekStartsOn??0,J=Vu(d,l?.in),mt=J.getDay(),kt=(mt{let j;const J=Tht[d];return typeof J=="string"?j=J:l===1?j=J.one:j=J.other.replace("{{count}}",l.toString()),z?.addSuffix?z.comparison&&z.comparison>0?"in "+j:j+" ago":j};function W8(d){return(l={})=>{const z=l.width?String(l.width):d.defaultWidth;return d.formats[z]||d.formats[d.defaultWidth]}}const Mht={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Sht={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Eht={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Cht={date:W8({formats:Mht,defaultWidth:"full"}),time:W8({formats:Sht,defaultWidth:"full"}),dateTime:W8({formats:Eht,defaultWidth:"full"})},Lht={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Pht=(d,l,z,j)=>Lht[d];function o2(d){return(l,z)=>{const j=z?.context?String(z.context):"standalone";let J;if(j==="formatting"&&d.formattingValues){const kt=d.defaultFormattingWidth||d.defaultWidth,Dt=z?.width?String(z.width):kt;J=d.formattingValues[Dt]||d.formattingValues[kt]}else{const kt=d.defaultWidth,Dt=z?.width?String(z.width):d.defaultWidth;J=d.values[Dt]||d.values[kt]}const mt=d.argumentCallback?d.argumentCallback(l):l;return J[mt]}}const zht={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Iht={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Oht={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Dht={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Fht={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Rht={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Bht=(d,l)=>{const z=Number(d),j=z%100;if(j>20||j<10)switch(j%10){case 1:return z+"st";case 2:return z+"nd";case 3:return z+"rd"}return z+"th"},Nht={ordinalNumber:Bht,era:o2({values:zht,defaultWidth:"wide"}),quarter:o2({values:Iht,defaultWidth:"wide",argumentCallback:d=>d-1}),month:o2({values:Oht,defaultWidth:"wide"}),day:o2({values:Dht,defaultWidth:"wide"}),dayPeriod:o2({values:Fht,defaultWidth:"wide",formattingValues:Rht,defaultFormattingWidth:"wide"})};function s2(d){return(l,z={})=>{const j=z.width,J=j&&d.matchPatterns[j]||d.matchPatterns[d.defaultMatchWidth],mt=l.match(J);if(!mt)return null;const kt=mt[0],Dt=j&&d.parsePatterns[j]||d.parsePatterns[d.defaultParseWidth],Gt=Array.isArray(Dt)?Uht(Dt,Ne=>Ne.test(kt)):jht(Dt,Ne=>Ne.test(kt));let re;re=d.valueCallback?d.valueCallback(Gt):Gt,re=z.valueCallback?z.valueCallback(re):re;const pe=l.slice(kt.length);return{value:re,rest:pe}}}function jht(d,l){for(const z in d)if(Object.prototype.hasOwnProperty.call(d,z)&&l(d[z]))return z}function Uht(d,l){for(let z=0;z{const j=l.match(d.matchPattern);if(!j)return null;const J=j[0],mt=l.match(d.parsePattern);if(!mt)return null;let kt=d.valueCallback?d.valueCallback(mt[0]):mt[0];kt=z.valueCallback?z.valueCallback(kt):kt;const Dt=l.slice(J.length);return{value:kt,rest:Dt}}}const Hht=/^(\d+)(th|st|nd|rd)?/i,Wht=/\d+/i,qht={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Zht={any:[/^b/i,/^(a|c)/i]},$ht={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ght={any:[/1/i,/2/i,/3/i,/4/i]},Yht={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Kht={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Xht={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Jht={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Qht={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},tft={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},eft={ordinalNumber:Vht({matchPattern:Hht,parsePattern:Wht,valueCallback:d=>parseInt(d,10)}),era:s2({matchPatterns:qht,defaultMatchWidth:"wide",parsePatterns:Zht,defaultParseWidth:"any"}),quarter:s2({matchPatterns:$ht,defaultMatchWidth:"wide",parsePatterns:Ght,defaultParseWidth:"any",valueCallback:d=>d+1}),month:s2({matchPatterns:Yht,defaultMatchWidth:"wide",parsePatterns:Kht,defaultParseWidth:"any"}),day:s2({matchPatterns:Xht,defaultMatchWidth:"wide",parsePatterns:Jht,defaultParseWidth:"any"}),dayPeriod:s2({matchPatterns:Qht,defaultMatchWidth:"any",parsePatterns:tft,defaultParseWidth:"any"})},zD={code:"en-US",formatDistance:Aht,formatLong:Cht,formatRelative:Pht,localize:Nht,match:eft,options:{weekStartsOn:0,firstWeekContainsDate:1}};function rft(d,l){const z=Vu(d,l?.in);return AD(z,PD(z))+1}function ID(d,l){const z=Vu(d,l?.in),j=+v_(z)-+tht(z);return Math.round(j/kD)+1}function xM(d,l){const z=Vu(d,l?.in),j=z.getFullYear(),J=Ly(),mt=l?.firstWeekContainsDate??l?.locale?.options?.firstWeekContainsDate??J.firstWeekContainsDate??J.locale?.options?.firstWeekContainsDate??1,kt=bd(l?.in||d,0);kt.setFullYear(j+1,0,mt),kt.setHours(0,0,0,0);const Dt=fg(kt,l),Gt=bd(l?.in||d,0);Gt.setFullYear(j,0,mt),Gt.setHours(0,0,0,0);const re=fg(Gt,l);return+z>=+Dt?j+1:+z>=+re?j:j-1}function nft(d,l){const z=Ly(),j=l?.firstWeekContainsDate??l?.locale?.options?.firstWeekContainsDate??z.firstWeekContainsDate??z.locale?.options?.firstWeekContainsDate??1,J=xM(d,l),mt=bd(l?.in||d,0);return mt.setFullYear(J,0,j),mt.setHours(0,0,0,0),fg(mt,l)}function OD(d,l){const z=Vu(d,l?.in),j=+fg(z,l)-+nft(z,l);return Math.round(j/kD)+1}function Yh(d,l){const z=d<0?"-":"",j=Math.abs(d).toString().padStart(l,"0");return z+j}const t1={y(d,l){const z=d.getFullYear(),j=z>0?z:1-z;return Yh(l==="yy"?j%100:j,l.length)},M(d,l){const z=d.getMonth();return l==="M"?String(z+1):Yh(z+1,2)},d(d,l){return Yh(d.getDate(),l.length)},a(d,l){const z=d.getHours()/12>=1?"pm":"am";switch(l){case"a":case"aa":return z.toUpperCase();case"aaa":return z;case"aaaaa":return z[0];case"aaaa":default:return z==="am"?"a.m.":"p.m."}},h(d,l){return Yh(d.getHours()%12||12,l.length)},H(d,l){return Yh(d.getHours(),l.length)},m(d,l){return Yh(d.getMinutes(),l.length)},s(d,l){return Yh(d.getSeconds(),l.length)},S(d,l){const z=l.length,j=d.getMilliseconds(),J=Math.trunc(j*Math.pow(10,z-3));return Yh(J,l.length)}},Qx={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},sz={G:function(d,l,z){const j=d.getFullYear()>0?1:0;switch(l){case"G":case"GG":case"GGG":return z.era(j,{width:"abbreviated"});case"GGGGG":return z.era(j,{width:"narrow"});case"GGGG":default:return z.era(j,{width:"wide"})}},y:function(d,l,z){if(l==="yo"){const j=d.getFullYear(),J=j>0?j:1-j;return z.ordinalNumber(J,{unit:"year"})}return t1.y(d,l)},Y:function(d,l,z,j){const J=xM(d,j),mt=J>0?J:1-J;if(l==="YY"){const kt=mt%100;return Yh(kt,2)}return l==="Yo"?z.ordinalNumber(mt,{unit:"year"}):Yh(mt,l.length)},R:function(d,l){const z=TD(d);return Yh(z,l.length)},u:function(d,l){const z=d.getFullYear();return Yh(z,l.length)},Q:function(d,l,z){const j=Math.ceil((d.getMonth()+1)/3);switch(l){case"Q":return String(j);case"QQ":return Yh(j,2);case"Qo":return z.ordinalNumber(j,{unit:"quarter"});case"QQQ":return z.quarter(j,{width:"abbreviated",context:"formatting"});case"QQQQQ":return z.quarter(j,{width:"narrow",context:"formatting"});case"QQQQ":default:return z.quarter(j,{width:"wide",context:"formatting"})}},q:function(d,l,z){const j=Math.ceil((d.getMonth()+1)/3);switch(l){case"q":return String(j);case"qq":return Yh(j,2);case"qo":return z.ordinalNumber(j,{unit:"quarter"});case"qqq":return z.quarter(j,{width:"abbreviated",context:"standalone"});case"qqqqq":return z.quarter(j,{width:"narrow",context:"standalone"});case"qqqq":default:return z.quarter(j,{width:"wide",context:"standalone"})}},M:function(d,l,z){const j=d.getMonth();switch(l){case"M":case"MM":return t1.M(d,l);case"Mo":return z.ordinalNumber(j+1,{unit:"month"});case"MMM":return z.month(j,{width:"abbreviated",context:"formatting"});case"MMMMM":return z.month(j,{width:"narrow",context:"formatting"});case"MMMM":default:return z.month(j,{width:"wide",context:"formatting"})}},L:function(d,l,z){const j=d.getMonth();switch(l){case"L":return String(j+1);case"LL":return Yh(j+1,2);case"Lo":return z.ordinalNumber(j+1,{unit:"month"});case"LLL":return z.month(j,{width:"abbreviated",context:"standalone"});case"LLLLL":return z.month(j,{width:"narrow",context:"standalone"});case"LLLL":default:return z.month(j,{width:"wide",context:"standalone"})}},w:function(d,l,z,j){const J=OD(d,j);return l==="wo"?z.ordinalNumber(J,{unit:"week"}):Yh(J,l.length)},I:function(d,l,z){const j=ID(d);return l==="Io"?z.ordinalNumber(j,{unit:"week"}):Yh(j,l.length)},d:function(d,l,z){return l==="do"?z.ordinalNumber(d.getDate(),{unit:"date"}):t1.d(d,l)},D:function(d,l,z){const j=rft(d);return l==="Do"?z.ordinalNumber(j,{unit:"dayOfYear"}):Yh(j,l.length)},E:function(d,l,z){const j=d.getDay();switch(l){case"E":case"EE":case"EEE":return z.day(j,{width:"abbreviated",context:"formatting"});case"EEEEE":return z.day(j,{width:"narrow",context:"formatting"});case"EEEEEE":return z.day(j,{width:"short",context:"formatting"});case"EEEE":default:return z.day(j,{width:"wide",context:"formatting"})}},e:function(d,l,z,j){const J=d.getDay(),mt=(J-j.weekStartsOn+8)%7||7;switch(l){case"e":return String(mt);case"ee":return Yh(mt,2);case"eo":return z.ordinalNumber(mt,{unit:"day"});case"eee":return z.day(J,{width:"abbreviated",context:"formatting"});case"eeeee":return z.day(J,{width:"narrow",context:"formatting"});case"eeeeee":return z.day(J,{width:"short",context:"formatting"});case"eeee":default:return z.day(J,{width:"wide",context:"formatting"})}},c:function(d,l,z,j){const J=d.getDay(),mt=(J-j.weekStartsOn+8)%7||7;switch(l){case"c":return String(mt);case"cc":return Yh(mt,l.length);case"co":return z.ordinalNumber(mt,{unit:"day"});case"ccc":return z.day(J,{width:"abbreviated",context:"standalone"});case"ccccc":return z.day(J,{width:"narrow",context:"standalone"});case"cccccc":return z.day(J,{width:"short",context:"standalone"});case"cccc":default:return z.day(J,{width:"wide",context:"standalone"})}},i:function(d,l,z){const j=d.getDay(),J=j===0?7:j;switch(l){case"i":return String(J);case"ii":return Yh(J,l.length);case"io":return z.ordinalNumber(J,{unit:"day"});case"iii":return z.day(j,{width:"abbreviated",context:"formatting"});case"iiiii":return z.day(j,{width:"narrow",context:"formatting"});case"iiiiii":return z.day(j,{width:"short",context:"formatting"});case"iiii":default:return z.day(j,{width:"wide",context:"formatting"})}},a:function(d,l,z){const J=d.getHours()/12>=1?"pm":"am";switch(l){case"a":case"aa":return z.dayPeriod(J,{width:"abbreviated",context:"formatting"});case"aaa":return z.dayPeriod(J,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return z.dayPeriod(J,{width:"narrow",context:"formatting"});case"aaaa":default:return z.dayPeriod(J,{width:"wide",context:"formatting"})}},b:function(d,l,z){const j=d.getHours();let J;switch(j===12?J=Qx.noon:j===0?J=Qx.midnight:J=j/12>=1?"pm":"am",l){case"b":case"bb":return z.dayPeriod(J,{width:"abbreviated",context:"formatting"});case"bbb":return z.dayPeriod(J,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return z.dayPeriod(J,{width:"narrow",context:"formatting"});case"bbbb":default:return z.dayPeriod(J,{width:"wide",context:"formatting"})}},B:function(d,l,z){const j=d.getHours();let J;switch(j>=17?J=Qx.evening:j>=12?J=Qx.afternoon:j>=4?J=Qx.morning:J=Qx.night,l){case"B":case"BB":case"BBB":return z.dayPeriod(J,{width:"abbreviated",context:"formatting"});case"BBBBB":return z.dayPeriod(J,{width:"narrow",context:"formatting"});case"BBBB":default:return z.dayPeriod(J,{width:"wide",context:"formatting"})}},h:function(d,l,z){if(l==="ho"){let j=d.getHours()%12;return j===0&&(j=12),z.ordinalNumber(j,{unit:"hour"})}return t1.h(d,l)},H:function(d,l,z){return l==="Ho"?z.ordinalNumber(d.getHours(),{unit:"hour"}):t1.H(d,l)},K:function(d,l,z){const j=d.getHours()%12;return l==="Ko"?z.ordinalNumber(j,{unit:"hour"}):Yh(j,l.length)},k:function(d,l,z){let j=d.getHours();return j===0&&(j=24),l==="ko"?z.ordinalNumber(j,{unit:"hour"}):Yh(j,l.length)},m:function(d,l,z){return l==="mo"?z.ordinalNumber(d.getMinutes(),{unit:"minute"}):t1.m(d,l)},s:function(d,l,z){return l==="so"?z.ordinalNumber(d.getSeconds(),{unit:"second"}):t1.s(d,l)},S:function(d,l){return t1.S(d,l)},X:function(d,l,z){const j=d.getTimezoneOffset();if(j===0)return"Z";switch(l){case"X":return uz(j);case"XXXX":case"XX":return dy(j);case"XXXXX":case"XXX":default:return dy(j,":")}},x:function(d,l,z){const j=d.getTimezoneOffset();switch(l){case"x":return uz(j);case"xxxx":case"xx":return dy(j);case"xxxxx":case"xxx":default:return dy(j,":")}},O:function(d,l,z){const j=d.getTimezoneOffset();switch(l){case"O":case"OO":case"OOO":return"GMT"+lz(j,":");case"OOOO":default:return"GMT"+dy(j,":")}},z:function(d,l,z){const j=d.getTimezoneOffset();switch(l){case"z":case"zz":case"zzz":return"GMT"+lz(j,":");case"zzzz":default:return"GMT"+dy(j,":")}},t:function(d,l,z){const j=Math.trunc(+d/1e3);return Yh(j,l.length)},T:function(d,l,z){return Yh(+d,l.length)}};function lz(d,l=""){const z=d>0?"-":"+",j=Math.abs(d),J=Math.trunc(j/60),mt=j%60;return mt===0?z+String(J):z+String(J)+l+Yh(mt,2)}function uz(d,l){return d%60===0?(d>0?"-":"+")+Yh(Math.abs(d)/60,2):dy(d,l)}function dy(d,l=""){const z=d>0?"-":"+",j=Math.abs(d),J=Yh(Math.trunc(j/60),2),mt=Yh(j%60,2);return z+J+l+mt}const cz=(d,l)=>{switch(d){case"P":return l.date({width:"short"});case"PP":return l.date({width:"medium"});case"PPP":return l.date({width:"long"});case"PPPP":default:return l.date({width:"full"})}},DD=(d,l)=>{switch(d){case"p":return l.time({width:"short"});case"pp":return l.time({width:"medium"});case"ppp":return l.time({width:"long"});case"pppp":default:return l.time({width:"full"})}},ift=(d,l)=>{const z=d.match(/(P+)(p+)?/)||[],j=z[1],J=z[2];if(!J)return cz(d,l);let mt;switch(j){case"P":mt=l.dateTime({width:"short"});break;case"PP":mt=l.dateTime({width:"medium"});break;case"PPP":mt=l.dateTime({width:"long"});break;case"PPPP":default:mt=l.dateTime({width:"full"});break}return mt.replace("{{date}}",cz(j,l)).replace("{{time}}",DD(J,l))},AA={p:DD,P:ift},aft=/^D+$/,oft=/^Y+$/,sft=["D","DD","YY","YYYY"];function FD(d){return aft.test(d)}function RD(d){return oft.test(d)}function MA(d,l,z){const j=lft(d,l,z);if(console.warn(j),sft.includes(d))throw new RangeError(j)}function lft(d,l,z){const j=d[0]==="Y"?"years":"days of the month";return`Use \`${d.toLowerCase()}\` instead of \`${d}\` (in \`${l}\`) for formatting ${j} to the input \`${z}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const uft=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,cft=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,hft=/^'([^]*?)'?$/,fft=/''/g,dft=/[a-zA-Z]/;function pft(d,l,z){const j=Ly(),J=z?.locale??j.locale??zD,mt=z?.firstWeekContainsDate??z?.locale?.options?.firstWeekContainsDate??j.firstWeekContainsDate??j.locale?.options?.firstWeekContainsDate??1,kt=z?.weekStartsOn??z?.locale?.options?.weekStartsOn??j.weekStartsOn??j.locale?.options?.weekStartsOn??0,Dt=Vu(d,z?.in);if(!MD(Dt))throw new RangeError("Invalid time value");let Gt=l.match(cft).map(pe=>{const Ne=pe[0];if(Ne==="p"||Ne==="P"){const or=AA[Ne];return or(pe,J.formatLong)}return pe}).join("").match(uft).map(pe=>{if(pe==="''")return{isToken:!1,value:"'"};const Ne=pe[0];if(Ne==="'")return{isToken:!1,value:mft(pe)};if(sz[Ne])return{isToken:!0,value:pe};if(Ne.match(dft))throw new RangeError("Format string contains an unescaped latin alphabet character `"+Ne+"`");return{isToken:!1,value:pe}});J.localize.preprocessor&&(Gt=J.localize.preprocessor(Dt,Gt));const re={firstWeekContainsDate:mt,weekStartsOn:kt,locale:J};return Gt.map(pe=>{if(!pe.isToken)return pe.value;const Ne=pe.value;(!z?.useAdditionalWeekYearTokens&&RD(Ne)||!z?.useAdditionalDayOfYearTokens&&FD(Ne))&&MA(Ne,l,String(d));const or=sz[Ne[0]];return or(Dt,Ne,J.localize,re)}).join("")}function mft(d){const l=d.match(hft);return l?l[1].replace(fft,"'"):d}function gft(){return Object.assign({},Ly())}function vft(d,l){const z=Vu(d,l?.in).getDay();return z===0?7:z}function yft(d,l){const z=xft(l)?new l(0):bd(l,0);return z.setFullYear(d.getFullYear(),d.getMonth(),d.getDate()),z.setHours(d.getHours(),d.getMinutes(),d.getSeconds(),d.getMilliseconds()),z}function xft(d){return typeof d=="function"&&d.prototype?.constructor===d}const _ft=10;class BD{subPriority=0;validate(l,z){return!0}}class bft extends BD{constructor(l,z,j,J,mt){super(),this.value=l,this.validateValue=z,this.setValue=j,this.priority=J,mt&&(this.subPriority=mt)}validate(l,z){return this.validateValue(l,this.value,z)}set(l,z,j){return this.setValue(l,z,this.value,j)}}class wft extends BD{priority=_ft;subPriority=-1;constructor(l,z){super(),this.context=l||(j=>bd(z,j))}set(l,z){return z.timestampIsSet?l:bd(l,yft(l,this.context))}}class Ah{run(l,z,j,J){const mt=this.parse(l,z,j,J);return mt?{setter:new bft(mt.value,this.validate,this.set,this.priority,this.subPriority),rest:mt.rest}:null}validate(l,z,j){return!0}}class kft extends Ah{priority=140;parse(l,z,j){switch(z){case"G":case"GG":case"GGG":return j.era(l,{width:"abbreviated"})||j.era(l,{width:"narrow"});case"GGGGG":return j.era(l,{width:"narrow"});case"GGGG":default:return j.era(l,{width:"wide"})||j.era(l,{width:"abbreviated"})||j.era(l,{width:"narrow"})}}set(l,z,j){return z.era=j,l.setFullYear(j,0,1),l.setHours(0,0,0,0),l}incompatibleTokens=["R","u","t","T"]}const Nd={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},sg={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function jd(d,l){return d&&{value:l(d.value),rest:d.rest}}function ad(d,l){const z=l.match(d);return z?{value:parseInt(z[0],10),rest:l.slice(z[0].length)}:null}function lg(d,l){const z=l.match(d);if(!z)return null;if(z[0]==="Z")return{value:0,rest:l.slice(1)};const j=z[1]==="+"?1:-1,J=z[2]?parseInt(z[2],10):0,mt=z[3]?parseInt(z[3],10):0,kt=z[5]?parseInt(z[5],10):0;return{value:j*(J*aw+mt*iw+kt*Xct),rest:l.slice(z[0].length)}}function ND(d){return ad(Nd.anyDigitsSigned,d)}function wd(d,l){switch(d){case 1:return ad(Nd.singleDigit,l);case 2:return ad(Nd.twoDigits,l);case 3:return ad(Nd.threeDigits,l);case 4:return ad(Nd.fourDigits,l);default:return ad(new RegExp("^\\d{1,"+d+"}"),l)}}function x4(d,l){switch(d){case 1:return ad(Nd.singleDigitSigned,l);case 2:return ad(Nd.twoDigitsSigned,l);case 3:return ad(Nd.threeDigitsSigned,l);case 4:return ad(Nd.fourDigitsSigned,l);default:return ad(new RegExp("^-?\\d{1,"+d+"}"),l)}}function _M(d){switch(d){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function jD(d,l){const z=l>0,j=z?l:1-l;let J;if(j<=50)J=d||100;else{const mt=j+50,kt=Math.trunc(mt/100)*100,Dt=d>=mt%100;J=d+kt-(Dt?100:0)}return z?J:1-J}function UD(d){return d%400===0||d%4===0&&d%100!==0}class Tft extends Ah{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(l,z,j){const J=mt=>({year:mt,isTwoDigitYear:z==="yy"});switch(z){case"y":return jd(wd(4,l),J);case"yo":return jd(j.ordinalNumber(l,{unit:"year"}),J);default:return jd(wd(z.length,l),J)}}validate(l,z){return z.isTwoDigitYear||z.year>0}set(l,z,j){const J=l.getFullYear();if(j.isTwoDigitYear){const kt=jD(j.year,J);return l.setFullYear(kt,0,1),l.setHours(0,0,0,0),l}const mt=!("era"in z)||z.era===1?j.year:1-j.year;return l.setFullYear(mt,0,1),l.setHours(0,0,0,0),l}}class Aft extends Ah{priority=130;parse(l,z,j){const J=mt=>({year:mt,isTwoDigitYear:z==="YY"});switch(z){case"Y":return jd(wd(4,l),J);case"Yo":return jd(j.ordinalNumber(l,{unit:"year"}),J);default:return jd(wd(z.length,l),J)}}validate(l,z){return z.isTwoDigitYear||z.year>0}set(l,z,j,J){const mt=xM(l,J);if(j.isTwoDigitYear){const Dt=jD(j.year,mt);return l.setFullYear(Dt,0,J.firstWeekContainsDate),l.setHours(0,0,0,0),fg(l,J)}const kt=!("era"in z)||z.era===1?j.year:1-j.year;return l.setFullYear(kt,0,J.firstWeekContainsDate),l.setHours(0,0,0,0),fg(l,J)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class Mft extends Ah{priority=130;parse(l,z){return x4(z==="R"?4:z.length,l)}set(l,z,j){const J=bd(l,0);return J.setFullYear(j,0,4),J.setHours(0,0,0,0),v_(J)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class Sft extends Ah{priority=130;parse(l,z){return x4(z==="u"?4:z.length,l)}set(l,z,j){return l.setFullYear(j,0,1),l.setHours(0,0,0,0),l}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]}class Eft extends Ah{priority=120;parse(l,z,j){switch(z){case"Q":case"QQ":return wd(z.length,l);case"Qo":return j.ordinalNumber(l,{unit:"quarter"});case"QQQ":return j.quarter(l,{width:"abbreviated",context:"formatting"})||j.quarter(l,{width:"narrow",context:"formatting"});case"QQQQQ":return j.quarter(l,{width:"narrow",context:"formatting"});case"QQQQ":default:return j.quarter(l,{width:"wide",context:"formatting"})||j.quarter(l,{width:"abbreviated",context:"formatting"})||j.quarter(l,{width:"narrow",context:"formatting"})}}validate(l,z){return z>=1&&z<=4}set(l,z,j){return l.setMonth((j-1)*3,1),l.setHours(0,0,0,0),l}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]}class Cft extends Ah{priority=120;parse(l,z,j){switch(z){case"q":case"qq":return wd(z.length,l);case"qo":return j.ordinalNumber(l,{unit:"quarter"});case"qqq":return j.quarter(l,{width:"abbreviated",context:"standalone"})||j.quarter(l,{width:"narrow",context:"standalone"});case"qqqqq":return j.quarter(l,{width:"narrow",context:"standalone"});case"qqqq":default:return j.quarter(l,{width:"wide",context:"standalone"})||j.quarter(l,{width:"abbreviated",context:"standalone"})||j.quarter(l,{width:"narrow",context:"standalone"})}}validate(l,z){return z>=1&&z<=4}set(l,z,j){return l.setMonth((j-1)*3,1),l.setHours(0,0,0,0),l}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]}class Lft extends Ah{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(l,z,j){const J=mt=>mt-1;switch(z){case"M":return jd(ad(Nd.month,l),J);case"MM":return jd(wd(2,l),J);case"Mo":return jd(j.ordinalNumber(l,{unit:"month"}),J);case"MMM":return j.month(l,{width:"abbreviated",context:"formatting"})||j.month(l,{width:"narrow",context:"formatting"});case"MMMMM":return j.month(l,{width:"narrow",context:"formatting"});case"MMMM":default:return j.month(l,{width:"wide",context:"formatting"})||j.month(l,{width:"abbreviated",context:"formatting"})||j.month(l,{width:"narrow",context:"formatting"})}}validate(l,z){return z>=0&&z<=11}set(l,z,j){return l.setMonth(j,1),l.setHours(0,0,0,0),l}}class Pft extends Ah{priority=110;parse(l,z,j){const J=mt=>mt-1;switch(z){case"L":return jd(ad(Nd.month,l),J);case"LL":return jd(wd(2,l),J);case"Lo":return jd(j.ordinalNumber(l,{unit:"month"}),J);case"LLL":return j.month(l,{width:"abbreviated",context:"standalone"})||j.month(l,{width:"narrow",context:"standalone"});case"LLLLL":return j.month(l,{width:"narrow",context:"standalone"});case"LLLL":default:return j.month(l,{width:"wide",context:"standalone"})||j.month(l,{width:"abbreviated",context:"standalone"})||j.month(l,{width:"narrow",context:"standalone"})}}validate(l,z){return z>=0&&z<=11}set(l,z,j){return l.setMonth(j,1),l.setHours(0,0,0,0),l}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]}function zft(d,l,z){const j=Vu(d,z?.in),J=OD(j,z)-l;return j.setDate(j.getDate()-J*7),Vu(j,z?.in)}class Ift extends Ah{priority=100;parse(l,z,j){switch(z){case"w":return ad(Nd.week,l);case"wo":return j.ordinalNumber(l,{unit:"week"});default:return wd(z.length,l)}}validate(l,z){return z>=1&&z<=53}set(l,z,j,J){return fg(zft(l,j,J),J)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function Oft(d,l,z){const j=Vu(d,z?.in),J=ID(j,z)-l;return j.setDate(j.getDate()-J*7),j}class Dft extends Ah{priority=100;parse(l,z,j){switch(z){case"I":return ad(Nd.week,l);case"Io":return j.ordinalNumber(l,{unit:"week"});default:return wd(z.length,l)}}validate(l,z){return z>=1&&z<=53}set(l,z,j){return v_(Oft(l,j))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const Fft=[31,28,31,30,31,30,31,31,30,31,30,31],Rft=[31,29,31,30,31,30,31,31,30,31,30,31];class Bft extends Ah{priority=90;subPriority=1;parse(l,z,j){switch(z){case"d":return ad(Nd.date,l);case"do":return j.ordinalNumber(l,{unit:"date"});default:return wd(z.length,l)}}validate(l,z){const j=l.getFullYear(),J=UD(j),mt=l.getMonth();return J?z>=1&&z<=Rft[mt]:z>=1&&z<=Fft[mt]}set(l,z,j){return l.setDate(j),l.setHours(0,0,0,0),l}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]}class Nft extends Ah{priority=90;subpriority=1;parse(l,z,j){switch(z){case"D":case"DD":return ad(Nd.dayOfYear,l);case"Do":return j.ordinalNumber(l,{unit:"date"});default:return wd(z.length,l)}}validate(l,z){const j=l.getFullYear();return UD(j)?z>=1&&z<=366:z>=1&&z<=365}set(l,z,j){return l.setMonth(0,j),l.setHours(0,0,0,0),l}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]}function bM(d,l,z){const j=Ly(),J=z?.weekStartsOn??z?.locale?.options?.weekStartsOn??j.weekStartsOn??j.locale?.options?.weekStartsOn??0,mt=Vu(d,z?.in),kt=mt.getDay(),Gt=(l%7+7)%7,re=7-J,pe=l<0||l>6?l-(kt+re)%7:(Gt+re)%7-(kt+re)%7;return Y4(mt,pe,z)}class jft extends Ah{priority=90;parse(l,z,j){switch(z){case"E":case"EE":case"EEE":return j.day(l,{width:"abbreviated",context:"formatting"})||j.day(l,{width:"short",context:"formatting"})||j.day(l,{width:"narrow",context:"formatting"});case"EEEEE":return j.day(l,{width:"narrow",context:"formatting"});case"EEEEEE":return j.day(l,{width:"short",context:"formatting"})||j.day(l,{width:"narrow",context:"formatting"});case"EEEE":default:return j.day(l,{width:"wide",context:"formatting"})||j.day(l,{width:"abbreviated",context:"formatting"})||j.day(l,{width:"short",context:"formatting"})||j.day(l,{width:"narrow",context:"formatting"})}}validate(l,z){return z>=0&&z<=6}set(l,z,j,J){return l=bM(l,j,J),l.setHours(0,0,0,0),l}incompatibleTokens=["D","i","e","c","t","T"]}class Uft extends Ah{priority=90;parse(l,z,j,J){const mt=kt=>{const Dt=Math.floor((kt-1)/7)*7;return(kt+J.weekStartsOn+6)%7+Dt};switch(z){case"e":case"ee":return jd(wd(z.length,l),mt);case"eo":return jd(j.ordinalNumber(l,{unit:"day"}),mt);case"eee":return j.day(l,{width:"abbreviated",context:"formatting"})||j.day(l,{width:"short",context:"formatting"})||j.day(l,{width:"narrow",context:"formatting"});case"eeeee":return j.day(l,{width:"narrow",context:"formatting"});case"eeeeee":return j.day(l,{width:"short",context:"formatting"})||j.day(l,{width:"narrow",context:"formatting"});case"eeee":default:return j.day(l,{width:"wide",context:"formatting"})||j.day(l,{width:"abbreviated",context:"formatting"})||j.day(l,{width:"short",context:"formatting"})||j.day(l,{width:"narrow",context:"formatting"})}}validate(l,z){return z>=0&&z<=6}set(l,z,j,J){return l=bM(l,j,J),l.setHours(0,0,0,0),l}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]}class Vft extends Ah{priority=90;parse(l,z,j,J){const mt=kt=>{const Dt=Math.floor((kt-1)/7)*7;return(kt+J.weekStartsOn+6)%7+Dt};switch(z){case"c":case"cc":return jd(wd(z.length,l),mt);case"co":return jd(j.ordinalNumber(l,{unit:"day"}),mt);case"ccc":return j.day(l,{width:"abbreviated",context:"standalone"})||j.day(l,{width:"short",context:"standalone"})||j.day(l,{width:"narrow",context:"standalone"});case"ccccc":return j.day(l,{width:"narrow",context:"standalone"});case"cccccc":return j.day(l,{width:"short",context:"standalone"})||j.day(l,{width:"narrow",context:"standalone"});case"cccc":default:return j.day(l,{width:"wide",context:"standalone"})||j.day(l,{width:"abbreviated",context:"standalone"})||j.day(l,{width:"short",context:"standalone"})||j.day(l,{width:"narrow",context:"standalone"})}}validate(l,z){return z>=0&&z<=6}set(l,z,j,J){return l=bM(l,j,J),l.setHours(0,0,0,0),l}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]}function Hft(d,l,z){const j=Vu(d,z?.in),J=vft(j,z),mt=l-J;return Y4(j,mt,z)}class Wft extends Ah{priority=90;parse(l,z,j){const J=mt=>mt===0?7:mt;switch(z){case"i":case"ii":return wd(z.length,l);case"io":return j.ordinalNumber(l,{unit:"day"});case"iii":return jd(j.day(l,{width:"abbreviated",context:"formatting"})||j.day(l,{width:"short",context:"formatting"})||j.day(l,{width:"narrow",context:"formatting"}),J);case"iiiii":return jd(j.day(l,{width:"narrow",context:"formatting"}),J);case"iiiiii":return jd(j.day(l,{width:"short",context:"formatting"})||j.day(l,{width:"narrow",context:"formatting"}),J);case"iiii":default:return jd(j.day(l,{width:"wide",context:"formatting"})||j.day(l,{width:"abbreviated",context:"formatting"})||j.day(l,{width:"short",context:"formatting"})||j.day(l,{width:"narrow",context:"formatting"}),J)}}validate(l,z){return z>=1&&z<=7}set(l,z,j){return l=Hft(l,j),l.setHours(0,0,0,0),l}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]}class qft extends Ah{priority=80;parse(l,z,j){switch(z){case"a":case"aa":case"aaa":return j.dayPeriod(l,{width:"abbreviated",context:"formatting"})||j.dayPeriod(l,{width:"narrow",context:"formatting"});case"aaaaa":return j.dayPeriod(l,{width:"narrow",context:"formatting"});case"aaaa":default:return j.dayPeriod(l,{width:"wide",context:"formatting"})||j.dayPeriod(l,{width:"abbreviated",context:"formatting"})||j.dayPeriod(l,{width:"narrow",context:"formatting"})}}set(l,z,j){return l.setHours(_M(j),0,0,0),l}incompatibleTokens=["b","B","H","k","t","T"]}class Zft extends Ah{priority=80;parse(l,z,j){switch(z){case"b":case"bb":case"bbb":return j.dayPeriod(l,{width:"abbreviated",context:"formatting"})||j.dayPeriod(l,{width:"narrow",context:"formatting"});case"bbbbb":return j.dayPeriod(l,{width:"narrow",context:"formatting"});case"bbbb":default:return j.dayPeriod(l,{width:"wide",context:"formatting"})||j.dayPeriod(l,{width:"abbreviated",context:"formatting"})||j.dayPeriod(l,{width:"narrow",context:"formatting"})}}set(l,z,j){return l.setHours(_M(j),0,0,0),l}incompatibleTokens=["a","B","H","k","t","T"]}class $ft extends Ah{priority=80;parse(l,z,j){switch(z){case"B":case"BB":case"BBB":return j.dayPeriod(l,{width:"abbreviated",context:"formatting"})||j.dayPeriod(l,{width:"narrow",context:"formatting"});case"BBBBB":return j.dayPeriod(l,{width:"narrow",context:"formatting"});case"BBBB":default:return j.dayPeriod(l,{width:"wide",context:"formatting"})||j.dayPeriod(l,{width:"abbreviated",context:"formatting"})||j.dayPeriod(l,{width:"narrow",context:"formatting"})}}set(l,z,j){return l.setHours(_M(j),0,0,0),l}incompatibleTokens=["a","b","t","T"]}class Gft extends Ah{priority=70;parse(l,z,j){switch(z){case"h":return ad(Nd.hour12h,l);case"ho":return j.ordinalNumber(l,{unit:"hour"});default:return wd(z.length,l)}}validate(l,z){return z>=1&&z<=12}set(l,z,j){const J=l.getHours()>=12;return J&&j<12?l.setHours(j+12,0,0,0):!J&&j===12?l.setHours(0,0,0,0):l.setHours(j,0,0,0),l}incompatibleTokens=["H","K","k","t","T"]}class Yft extends Ah{priority=70;parse(l,z,j){switch(z){case"H":return ad(Nd.hour23h,l);case"Ho":return j.ordinalNumber(l,{unit:"hour"});default:return wd(z.length,l)}}validate(l,z){return z>=0&&z<=23}set(l,z,j){return l.setHours(j,0,0,0),l}incompatibleTokens=["a","b","h","K","k","t","T"]}class Kft extends Ah{priority=70;parse(l,z,j){switch(z){case"K":return ad(Nd.hour11h,l);case"Ko":return j.ordinalNumber(l,{unit:"hour"});default:return wd(z.length,l)}}validate(l,z){return z>=0&&z<=11}set(l,z,j){return l.getHours()>=12&&j<12?l.setHours(j+12,0,0,0):l.setHours(j,0,0,0),l}incompatibleTokens=["h","H","k","t","T"]}class Xft extends Ah{priority=70;parse(l,z,j){switch(z){case"k":return ad(Nd.hour24h,l);case"ko":return j.ordinalNumber(l,{unit:"hour"});default:return wd(z.length,l)}}validate(l,z){return z>=1&&z<=24}set(l,z,j){const J=j<=24?j%24:j;return l.setHours(J,0,0,0),l}incompatibleTokens=["a","b","h","H","K","t","T"]}class Jft extends Ah{priority=60;parse(l,z,j){switch(z){case"m":return ad(Nd.minute,l);case"mo":return j.ordinalNumber(l,{unit:"minute"});default:return wd(z.length,l)}}validate(l,z){return z>=0&&z<=59}set(l,z,j){return l.setMinutes(j,0,0),l}incompatibleTokens=["t","T"]}class Qft extends Ah{priority=50;parse(l,z,j){switch(z){case"s":return ad(Nd.second,l);case"so":return j.ordinalNumber(l,{unit:"second"});default:return wd(z.length,l)}}validate(l,z){return z>=0&&z<=59}set(l,z,j){return l.setSeconds(j,0),l}incompatibleTokens=["t","T"]}class tdt extends Ah{priority=30;parse(l,z){const j=J=>Math.trunc(J*Math.pow(10,-z.length+3));return jd(wd(z.length,l),j)}set(l,z,j){return l.setMilliseconds(j),l}incompatibleTokens=["t","T"]}class edt extends Ah{priority=10;parse(l,z){switch(z){case"X":return lg(sg.basicOptionalMinutes,l);case"XX":return lg(sg.basic,l);case"XXXX":return lg(sg.basicOptionalSeconds,l);case"XXXXX":return lg(sg.extendedOptionalSeconds,l);case"XXX":default:return lg(sg.extended,l)}}set(l,z,j){return z.timestampIsSet?l:bd(l,l.getTime()-y4(l)-j)}incompatibleTokens=["t","T","x"]}class rdt extends Ah{priority=10;parse(l,z){switch(z){case"x":return lg(sg.basicOptionalMinutes,l);case"xx":return lg(sg.basic,l);case"xxxx":return lg(sg.basicOptionalSeconds,l);case"xxxxx":return lg(sg.extendedOptionalSeconds,l);case"xxx":default:return lg(sg.extended,l)}}set(l,z,j){return z.timestampIsSet?l:bd(l,l.getTime()-y4(l)-j)}incompatibleTokens=["t","T","X"]}class ndt extends Ah{priority=40;parse(l){return ND(l)}set(l,z,j){return[bd(l,j*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class idt extends Ah{priority=20;parse(l){return ND(l)}set(l,z,j){return[bd(l,j),{timestampIsSet:!0}]}incompatibleTokens="*"}const adt={G:new kft,y:new Tft,Y:new Aft,R:new Mft,u:new Sft,Q:new Eft,q:new Cft,M:new Lft,L:new Pft,w:new Ift,I:new Dft,d:new Bft,D:new Nft,E:new jft,e:new Uft,c:new Vft,i:new Wft,a:new qft,b:new Zft,B:new $ft,h:new Gft,H:new Yft,K:new Kft,k:new Xft,m:new Jft,s:new Qft,S:new tdt,X:new edt,x:new rdt,t:new ndt,T:new idt},odt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,sdt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ldt=/^'([^]*?)'?$/,udt=/''/g,cdt=/\S/,hdt=/[a-zA-Z]/;function fdt(d,l,z,j){const J=()=>bd(j?.in||z,NaN),mt=gft(),kt=j?.locale??mt.locale??zD,Dt=j?.firstWeekContainsDate??j?.locale?.options?.firstWeekContainsDate??mt.firstWeekContainsDate??mt.locale?.options?.firstWeekContainsDate??1,Gt=j?.weekStartsOn??j?.locale?.options?.weekStartsOn??mt.weekStartsOn??mt.locale?.options?.weekStartsOn??0;if(!l)return d?J():Vu(z,j?.in);const re={firstWeekContainsDate:Dt,weekStartsOn:Gt,locale:kt},pe=[new wft(j?.in,z)],Ne=l.match(sdt).map(Wr=>{const An=Wr[0];if(An in AA){const Ft=AA[An];return Ft(Wr,kt.formatLong)}return Wr}).join("").match(odt),or=[];for(let Wr of Ne){!j?.useAdditionalWeekYearTokens&&RD(Wr)&&MA(Wr,l,d),!j?.useAdditionalDayOfYearTokens&&FD(Wr)&&MA(Wr,l,d);const An=Wr[0],Ft=adt[An];if(Ft){const{incompatibleTokens:kn}=Ft;if(Array.isArray(kn)){const jn=or.find(ai=>kn.includes(ai.token)||ai.token===An);if(jn)throw new RangeError(`The format string mustn't contain \`${jn.fullToken}\` and \`${Wr}\` at the same time`)}else if(Ft.incompatibleTokens==="*"&&or.length>0)throw new RangeError(`The format string mustn't contain \`${Wr}\` and any other token at the same time`);or.push({token:An,fullToken:Wr});const ei=Ft.run(d,Wr,kt.match,re);if(!ei)return J();pe.push(ei.setter),d=ei.rest}else{if(An.match(hdt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+An+"`");if(Wr==="''"?Wr="'":An==="'"&&(Wr=ddt(Wr)),d.indexOf(Wr)===0)d=d.slice(Wr.length);else return J()}}if(d.length>0&&cdt.test(d))return J();const _r=pe.map(Wr=>Wr.priority).sort((Wr,An)=>An-Wr).filter((Wr,An,Ft)=>Ft.indexOf(Wr)===An).map(Wr=>pe.filter(An=>An.priority===Wr).sort((An,Ft)=>Ft.subPriority-An.subPriority)).map(Wr=>Wr[0]);let Fr=Vu(z,j?.in);if(isNaN(+Fr))return J();const zr={};for(const Wr of _r){if(!Wr.validate(Fr,re))return J();const An=Wr.set(Fr,zr,re);Array.isArray(An)?(Fr=An[0],Object.assign(zr,An[1])):Fr=An}return Fr}function ddt(d){return d.match(ldt)[1].replace(udt,"'")}function pdt(d,l){const z=Vu(d,l?.in);return z.setMinutes(0,0,0),z}function mdt(d,l){const z=Vu(d,l?.in);return z.setSeconds(0,0),z}function gdt(d,l){const z=Vu(d,l?.in);return z.setMilliseconds(0),z}function vdt(d,l){const z=()=>bd(l?.in,NaN),j=l?.additionalDigits??2,J=bdt(d);let mt;if(J.date){const re=wdt(J.date,j);mt=kdt(re.restDateString,re.year)}if(!mt||isNaN(+mt))return z();const kt=+mt;let Dt=0,Gt;if(J.time&&(Dt=Tdt(J.time),isNaN(Dt)))return z();if(J.timezone){if(Gt=Adt(J.timezone),isNaN(Gt))return z()}else{const re=new Date(kt+Dt),pe=Vu(0,l?.in);return pe.setFullYear(re.getUTCFullYear(),re.getUTCMonth(),re.getUTCDate()),pe.setHours(re.getUTCHours(),re.getUTCMinutes(),re.getUTCSeconds(),re.getUTCMilliseconds()),pe}return Vu(kt+Dt+Gt,l?.in)}const j5={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},ydt=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,xdt=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,_dt=/^([+-])(\d{2})(?::?(\d{2}))?$/;function bdt(d){const l={},z=d.split(j5.dateTimeDelimiter);let j;if(z.length>2)return l;if(/:/.test(z[0])?j=z[0]:(l.date=z[0],j=z[1],j5.timeZoneDelimiter.test(l.date)&&(l.date=d.split(j5.timeZoneDelimiter)[0],j=d.substr(l.date.length,d.length))),j){const J=j5.timezone.exec(j);J?(l.time=j.replace(J[1],""),l.timezone=J[1]):l.time=j}return l}function wdt(d,l){const z=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+l)+"})|(\\d{2}|[+-]\\d{"+(2+l)+"})$)"),j=d.match(z);if(!j)return{year:NaN,restDateString:""};const J=j[1]?parseInt(j[1]):null,mt=j[2]?parseInt(j[2]):null;return{year:mt===null?J:mt*100,restDateString:d.slice((j[1]||j[2]).length)}}function kdt(d,l){if(l===null)return new Date(NaN);const z=d.match(ydt);if(!z)return new Date(NaN);const j=!!z[4],J=l2(z[1]),mt=l2(z[2])-1,kt=l2(z[3]),Dt=l2(z[4]),Gt=l2(z[5])-1;if(j)return Ldt(l,Dt,Gt)?Mdt(l,Dt,Gt):new Date(NaN);{const re=new Date(0);return!Edt(l,mt,kt)||!Cdt(l,J)?new Date(NaN):(re.setUTCFullYear(l,mt,Math.max(J,kt)),re)}}function l2(d){return d?parseInt(d):1}function Tdt(d){const l=d.match(xdt);if(!l)return NaN;const z=q8(l[1]),j=q8(l[2]),J=q8(l[3]);return Pdt(z,j,J)?z*aw+j*iw+J*1e3:NaN}function q8(d){return d&&parseFloat(d.replace(",","."))||0}function Adt(d){if(d==="Z")return 0;const l=d.match(_dt);if(!l)return 0;const z=l[1]==="+"?-1:1,j=parseInt(l[2]),J=l[3]&&parseInt(l[3])||0;return zdt(j,J)?z*(j*aw+J*iw):NaN}function Mdt(d,l,z){const j=new Date(0);j.setUTCFullYear(d,0,4);const J=j.getUTCDay()||7,mt=(l-1)*7+z+1-J;return j.setUTCDate(j.getUTCDate()+mt),j}const Sdt=[31,null,31,30,31,30,31,31,30,31,30,31];function VD(d){return d%400===0||d%4===0&&d%100!==0}function Edt(d,l,z){return l>=0&&l<=11&&z>=1&&z<=(Sdt[l]||(VD(d)?29:28))}function Cdt(d,l){return l>=1&&l<=(VD(d)?366:365)}function Ldt(d,l,z){return l>=1&&l<=53&&z>=0&&z<=6}function Pdt(d,l,z){return d===24?l===0&&z===0:z>=0&&z<60&&l>=0&&l<60&&d>=0&&d<25}function zdt(d,l){return l>=0&&l<=59}/*! * chartjs-adapter-date-fns v3.0.0 * https://www.chartjs.org * (c) 2022 chartjs-adapter-date-fns Contributors * Released under the MIT license - */const Pdt={datetime:"MMM d, yyyy, h:mm:ss aaaa",millisecond:"h:mm:ss.SSS aaaa",second:"h:mm:ss aaaa",minute:"h:mm aaaa",hour:"ha",day:"MMM d",week:"PP",month:"MMM yyyy",quarter:"qqq - yyyy",year:"yyyy"};aD._date.override({_id:"date-fns",formats:function(){return Pdt},parse:function(d,l){if(d===null||typeof d>"u")return null;const z=typeof d;return z==="number"||d instanceof Date?d=Vu(d):z==="string"&&(typeof l=="string"?d=cdt(d,l,new Date,this.options):d=mdt(d,this.options)),MD(d)?d.getTime():null},format:function(d,l){return fft(d,l,this.options)},add:function(d,l,z){switch(z){case"millisecond":return vM(d,l);case"second":return eht(d,l);case"minute":return Qct(d,l);case"hour":return Kct(d,l);case"day":return Y4(d,l);case"week":return rht(d,l);case"month":return gM(d,l);case"quarter":return tht(d,l);case"year":return nht(d,l);default:return d}},diff:function(d,l,z){switch(z){case"millisecond":return yM(d,l);case"second":return hht(d,l);case"minute":return lht(d,l);case"hour":return sht(d,l);case"day":return SD(d,l);case"week":return fht(d,l);case"month":return LD(d,l);case"quarter":return cht(d,l);case"year":return dht(d,l);default:return 0}},startOf:function(d,l,z){switch(l){case"second":return pdt(d);case"minute":return ddt(d);case"hour":return fdt(d);case"day":return TA(d);case"week":return fg(d);case"isoWeek":return fg(d,{weekStartsOn:+z});case"month":return mht(d);case"quarter":return pht(d);case"year":return PD(d);default:return d}},endOf:function(d,l){switch(l){case"second":return bht(d);case"minute":return xht(d);case"hour":return vht(d);case"day":return ED(d);case"week":return yht(d);case"month":return CD(d);case"quarter":return _ht(d);case"year":return ght(d);default:return d}}});var J5={exports:{}},zdt=J5.exports,hz;function Idt(){return hz||(hz=1,function(d){var l={};(function(z,j){d.exports?d.exports=j():z.moduleName=j()})(typeof self<"u"?self:zdt,()=>{var z=(()=>{var j=Object.create,J=Object.defineProperty,mt=Object.defineProperties,kt=Object.getOwnPropertyDescriptor,Dt=Object.getOwnPropertyDescriptors,Gt=Object.getOwnPropertyNames,re=Object.getOwnPropertySymbols,pe=Object.getPrototypeOf,Ne=Object.prototype.hasOwnProperty,or=Object.prototype.propertyIsEnumerable,_r=(Q,$,c)=>$ in Q?J(Q,$,{enumerable:!0,configurable:!0,writable:!0,value:c}):Q[$]=c,Fr=(Q,$)=>{for(var c in $||($={}))Ne.call($,c)&&_r(Q,c,$[c]);if(re)for(var c of re($))or.call($,c)&&_r(Q,c,$[c]);return Q},zr=(Q,$)=>mt(Q,Dt($)),Wr=(Q,$)=>{var c={};for(var g in Q)Ne.call(Q,g)&&$.indexOf(g)<0&&(c[g]=Q[g]);if(Q!=null&&re)for(var g of re(Q))$.indexOf(g)<0&&or.call(Q,g)&&(c[g]=Q[g]);return c},An=(Q,$)=>()=>(Q&&($=Q(Q=0)),$),Ft=(Q,$)=>()=>($||Q(($={exports:{}}).exports,$),$.exports),kn=(Q,$)=>{for(var c in $)J(Q,c,{get:$[c],enumerable:!0})},ei=(Q,$,c,g)=>{if($&&typeof $=="object"||typeof $=="function")for(let P of Gt($))!Ne.call(Q,P)&&P!==c&&J(Q,P,{get:()=>$[P],enumerable:!(g=kt($,P))||g.enumerable});return Q},jn=(Q,$,c)=>(c=Q!=null?j(pe(Q)):{},ei(J(c,"default",{value:Q,enumerable:!0}),Q)),ai=Q=>ei(J({},"__esModule",{value:!0}),Q),Qi=Ft(Q=>{Q.version="3.2.0"}),Gi=Ft((Q,$)=>{(function(c,g,P){g[c]=g[c]||P(),typeof $<"u"&&$.exports&&($.exports=g[c])})("Promise",typeof window<"u"?window:Q,function(){var c,g,P,S=Object.prototype.toString,t=typeof setImmediate<"u"?function(T){return setImmediate(T)}:setTimeout;try{Object.defineProperty({},"x",{}),c=function(T,u,b,_){return Object.defineProperty(T,u,{value:b,writable:!0,configurable:_!==!1})}}catch{c=function(u,b,_){return u[b]=_,u}}P=function(){var T,u,b;function _(C,M){this.fn=C,this.self=M,this.next=void 0}return{add:function(C,M){b=new _(C,M),u?u.next=b:T=b,u=b,b=void 0},drain:function(){var C=T;for(T=u=g=void 0;C;)C.fn.call(C.self),C=C.next}}}();function e(T,u){P.add(T,u),g||(g=t(P.drain))}function r(T){var u,b=typeof T;return T!=null&&(b=="object"||b=="function")&&(u=T.then),typeof u=="function"?u:!1}function a(){for(var T=0;T0&&e(a,b))}catch(_){i.call(new f(b),_)}}}function i(T){var u=this;u.triggered||(u.triggered=!0,u.def&&(u=u.def),u.msg=T,u.state=2,u.chain.length>0&&e(a,u))}function s(T,u,b,_){for(var C=0;C{(function(){var c={version:"3.8.2"},g=[].slice,P=function(At){return g.call(At)},S=self.document;function t(At){return At&&(At.ownerDocument||At.document||At).documentElement}function e(At){return At&&(At.ownerDocument&&At.ownerDocument.defaultView||At.document&&At||At.defaultView)}if(S)try{P(S.documentElement.childNodes)[0].nodeType}catch{P=function(jt){for(var ue=jt.length,Me=new Array(ue);ue--;)Me[ue]=jt[ue];return Me}}if(Date.now||(Date.now=function(){return+new Date}),S)try{S.createElement("DIV").style.setProperty("opacity",0,"")}catch{var r=this.Element.prototype,a=r.setAttribute,n=r.setAttributeNS,o=this.CSSStyleDeclaration.prototype,i=o.setProperty;r.setAttribute=function(jt,ue){a.call(this,jt,ue+"")},r.setAttributeNS=function(jt,ue,Me){n.call(this,jt,ue,Me+"")},o.setProperty=function(jt,ue,Me){i.call(this,jt,ue+"",Me)}}c.ascending=s;function s(At,jt){return Atjt?1:At>=jt?0:NaN}c.descending=function(At,jt){return jtAt?1:jt>=At?0:NaN},c.min=function(At,jt){var ue=-1,Me=At.length,Le,Be;if(arguments.length===1){for(;++ue=Be){Le=Be;break}for(;++ueBe&&(Le=Be)}else{for(;++ue=Be){Le=Be;break}for(;++ueBe&&(Le=Be)}return Le},c.max=function(At,jt){var ue=-1,Me=At.length,Le,Be;if(arguments.length===1){for(;++ue=Be){Le=Be;break}for(;++ueLe&&(Le=Be)}else{for(;++ue=Be){Le=Be;break}for(;++ueLe&&(Le=Be)}return Le},c.extent=function(At,jt){var ue=-1,Me=At.length,Le,Be,sr;if(arguments.length===1){for(;++ue=Be){Le=sr=Be;break}for(;++ueBe&&(Le=Be),sr=Be){Le=sr=Be;break}for(;++ueBe&&(Le=Be),sr1)return sr/(Mr-1)},c.deviation=function(){var At=c.variance.apply(this,arguments);return At&&Math.sqrt(At)};function y(At){return{left:function(jt,ue,Me,Le){for(arguments.length<3&&(Me=0),arguments.length<4&&(Le=jt.length);Me>>1;At(jt[Be],ue)<0?Me=Be+1:Le=Be}return Me},right:function(jt,ue,Me,Le){for(arguments.length<3&&(Me=0),arguments.length<4&&(Le=jt.length);Me>>1;At(jt[Be],ue)>0?Le=Be:Me=Be+1}return Me}}}var v=y(s);c.bisectLeft=v.left,c.bisect=c.bisectRight=v.right,c.bisector=function(At){return y(At.length===1?function(jt,ue){return s(At(jt),ue)}:At)},c.shuffle=function(At,jt,ue){(Me=arguments.length)<3&&(ue=At.length,Me<2&&(jt=0));for(var Me=ue-jt,Le,Be;Me;)Be=Math.random()*Me--|0,Le=At[Me+jt],At[Me+jt]=At[Be+jt],At[Be+jt]=Le;return At},c.permute=function(At,jt){for(var ue=jt.length,Me=new Array(ue);ue--;)Me[ue]=At[jt[ue]];return Me},c.pairs=function(At){for(var jt=0,ue=At.length-1,Me,Le=At[0],Be=new Array(ue<0?0:ue);jt=0;)for(sr=At[jt],ue=sr.length;--ue>=0;)Be[--Le]=sr[ue];return Be};var u=Math.abs;c.range=function(At,jt,ue){if(arguments.length<3&&(ue=1,arguments.length<2&&(jt=At,At=0)),(jt-At)/ue===1/0)throw new Error("infinite range");var Me=[],Le=b(u(ue)),Be=-1,sr;if(At*=Le,jt*=Le,ue*=Le,ue<0)for(;(sr=At+ue*++Be)>jt;)Me.push(sr/Le);else for(;(sr=At+ue*++Be)=jt.length)return Le?Le.call(At,Mr):Me?Mr.sort(Me):Mr;for(var Xr=-1,vn=Mr.length,In=jt[en++],On,Bi,Un,mi=new C,Ti;++Xr=jt.length)return ir;var en=[],Xr=ue[Mr++];return ir.forEach(function(vn,In){en.push({key:vn,values:sr(In,Mr)})}),Xr?en.sort(function(vn,In){return Xr(vn.key,In.key)}):en}return At.map=function(ir,Mr){return Be(Mr,ir,0)},At.entries=function(ir){return sr(Be(c.map,ir,0),0)},At.key=function(ir){return jt.push(ir),At},At.sortKeys=function(ir){return ue[jt.length-1]=ir,At},At.sortValues=function(ir){return Me=ir,At},At.rollup=function(ir){return Le=ir,At},At},c.set=function(At){var jt=new N;if(At)for(var ue=0,Me=At.length;ue=0&&(Me=At.slice(ue+1),At=At.slice(0,ue)),At)return arguments.length<2?this[At].on(Me):this[At].on(Me,jt);if(arguments.length===2){if(jt==null)for(At in this)this.hasOwnProperty(At)&&this[At].on(Me,null);return this}};function X(At){var jt=[],ue=new C;function Me(){for(var Le=jt,Be=-1,sr=Le.length,ir;++Be=0&&(ue=At.slice(0,jt))!=="xmlns"&&(At=At.slice(jt+1)),wt.hasOwnProperty(ue)?{space:wt[ue],local:At}:At}},it.attr=function(At,jt){if(arguments.length<2){if(typeof At=="string"){var ue=this.node();return At=c.ns.qualify(At),At.local?ue.getAttributeNS(At.space,At.local):ue.getAttribute(At)}for(jt in At)this.each(zt(jt,At[jt]));return this}return this.each(zt(At,jt))};function zt(At,jt){At=c.ns.qualify(At);function ue(){this.removeAttribute(At)}function Me(){this.removeAttributeNS(At.space,At.local)}function Le(){this.setAttribute(At,jt)}function Be(){this.setAttributeNS(At.space,At.local,jt)}function sr(){var Mr=jt.apply(this,arguments);Mr==null?this.removeAttribute(At):this.setAttribute(At,Mr)}function ir(){var Mr=jt.apply(this,arguments);Mr==null?this.removeAttributeNS(At.space,At.local):this.setAttributeNS(At.space,At.local,Mr)}return jt==null?At.local?Me:ue:typeof jt=="function"?At.local?ir:sr:At.local?Be:Le}function Pt(At){return At.trim().replace(/\s+/g," ")}it.classed=function(At,jt){if(arguments.length<2){if(typeof At=="string"){var ue=this.node(),Me=(At=Ht(At)).length,Le=-1;if(jt=ue.classList){for(;++Le=0;)(Be=ue[Me])&&(Le&&Le!==Be.nextSibling&&Le.parentNode.insertBefore(Be,Le),Le=Be);return this},it.sort=function(At){At=te.apply(this,arguments);for(var jt=-1,ue=this.length;++jt=jt&&(jt=Le+1);!(Mr=sr[jt])&&++jt0&&(At=At.slice(0,Le));var sr=cr.get(At);sr&&(At=sr,Be=jr);function ir(){var Xr=this[Me];Xr&&(this.removeEventListener(At,Xr,Xr.$),delete this[Me])}function Mr(){var Xr=Be(jt,P(arguments));ir.call(this),this.addEventListener(At,this[Me]=Xr,Xr.$=ue),Xr._=jt}function en(){var Xr=new RegExp("^__on([^.]+)"+c.requote(At)+"$"),vn;for(var In in this)if(vn=In.match(Xr)){var On=this[In];this.removeEventListener(vn[1],On,On.$),delete this[In]}}return Le?jt?Mr:ir:jt?W:en}var cr=c.map({mouseenter:"mouseover",mouseleave:"mouseout"});S&&cr.forEach(function(At){"on"+At in S&&cr.remove(At)});function ur(At,jt){return function(ue){var Me=c.event;c.event=ue,jt[0]=this.__data__;try{At.apply(this,jt)}finally{c.event=Me}}}function jr(At,jt){var ue=ur(At,jt);return function(Me){var Le=this,Be=Me.relatedTarget;(!Be||Be!==Le&&!(Be.compareDocumentPosition(Le)&8))&&ue.call(Le,Me)}}var Hr,br=0;function Kr(At){var jt=".dragsuppress-"+ ++br,ue="click"+jt,Me=c.select(e(At)).on("touchmove"+jt,lt).on("dragstart"+jt,lt).on("selectstart"+jt,lt);if(Hr==null&&(Hr="onselectstart"in At?!1:F(At.style,"userSelect")),Hr){var Le=t(At).style,Be=Le[Hr];Le[Hr]="none"}return function(sr){if(Me.on(jt,null),Hr&&(Le[Hr]=Be),sr){var ir=function(){Me.on(ue,null)};Me.on(ue,function(){lt(),ir()},!0),setTimeout(ir,0)}}}c.mouse=function(At){return Ce(At,yt())};var rn=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function Ce(At,jt){jt.changedTouches&&(jt=jt.changedTouches[0]);var ue=At.ownerSVGElement||At;if(ue.createSVGPoint){var Me=ue.createSVGPoint();if(rn<0){var Le=e(At);if(Le.scrollX||Le.scrollY){ue=c.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var Be=ue[0][0].getScreenCTM();rn=!(Be.f||Be.e),ue.remove()}}return rn?(Me.x=jt.pageX,Me.y=jt.pageY):(Me.x=jt.clientX,Me.y=jt.clientY),Me=Me.matrixTransform(At.getScreenCTM().inverse()),[Me.x,Me.y]}var sr=At.getBoundingClientRect();return[jt.clientX-sr.left-At.clientLeft,jt.clientY-sr.top-At.clientTop]}c.touch=function(At,jt,ue){if(arguments.length<3&&(ue=jt,jt=yt().changedTouches),jt){for(var Me=0,Le=jt.length,Be;Me1?ee:At<-1?-ee:Math.asin(At)}function ar(At){return((At=Math.exp(At))-1/At)/2}function Ar(At){return((At=Math.exp(At))+1/At)/2}function Tr(At){return((At=Math.exp(2*At))-1)/(At+1)}var pr=Math.SQRT2,Jr=2,Vn=4;c.interpolateZoom=function(At,jt){var ue=At[0],Me=At[1],Le=At[2],Be=jt[0],sr=jt[1],ir=jt[2],Mr=Be-ue,en=sr-Me,Xr=Mr*Mr+en*en,vn,In;if(Xr0&&(_o=_o.transition().duration(sr)),_o.call(Wi.event)}function Fo(){mi&&mi.domain(Un.range().map(function(_o){return(_o-At.x)/At.k}).map(Un.invert)),Ii&&Ii.domain(Ti.range().map(function(_o){return(_o-At.y)/At.k}).map(Ti.invert))}function Uo(_o){ir++||_o({type:"zoomstart"})}function al(_o){Fo(),_o({type:"zoom",scale:At.k,translate:[At.x,At.y]})}function Wo(_o){--ir||(_o({type:"zoomend"}),ue=null)}function ps(){var _o=this,Zs=Bi.of(_o,arguments),rl=0,ou=c.select(e(_o)).on(en,Bl).on(Xr,Ql),Gl=Yn(c.mouse(_o)),rh=Kr(_o);Fi.call(_o),Uo(Zs);function Bl(){rl=1,ro(c.mouse(_o),Gl),al(Zs)}function Ql(){ou.on(en,null).on(Xr,null),rh(rl),Wo(Zs)}}function Tl(){var _o=this,Zs=Bi.of(_o,arguments),rl={},ou=0,Gl,rh=".zoom-"+c.event.changedTouches[0].identifier,Bl="touchmove"+rh,Ql="touchend"+rh,bh=[],_e=c.select(_o),kr=Kr(_o);Dn(),Uo(Zs),_e.on(Mr,null).on(In,Dn);function Lr(){var gn=c.touches(_o);return Gl=At.k,gn.forEach(function(ni){ni.identifier in rl&&(rl[ni.identifier]=Yn(ni))}),gn}function Dn(){var gn=c.event.target;c.select(gn).on(Bl,oi).on(Ql,Jn),bh.push(gn);for(var ni=c.event.changedTouches,Yi=0,Ui=ni.length;Yi1){var Ba=va[0],ta=va[1],wi=Ba[0]-ta[0],hn=Ba[1]-ta[1];ou=wi*wi+hn*hn}}function oi(){var gn=c.touches(_o),ni,Yi,Ui,va;Fi.call(_o);for(var Za=0,Ba=gn.length;Za1?1:jt,ue=ue<0?0:ue>1?1:ue,Le=ue<=.5?ue*(1+jt):ue+jt-ue*jt,Me=2*ue-Le;function Be(ir){return ir>360?ir-=360:ir<0&&(ir+=360),ir<60?Me+(Le-Me)*ir/60:ir<180?Le:ir<240?Me+(Le-Me)*(240-ir)/60:Me}function sr(ir){return Math.round(Be(ir)*255)}return new Pa(sr(At+120),sr(At),sr(At-120))}c.hcl=We;function We(At,jt,ue){return this instanceof We?(this.h=+At,this.c=+jt,void(this.l=+ue)):arguments.length<2?At instanceof We?new We(At.h,At.c,At.l):At instanceof xr?Pi(At.l,At.a,At.b):Pi((At=Br((At=c.rgb(At)).r,At.g,At.b)).l,At.a,At.b):new We(At,jt,ue)}var rr=We.prototype=new ii;rr.brighter=function(At){return new We(this.h,this.c,Math.min(100,this.l+Qr*(arguments.length?At:1)))},rr.darker=function(At){return new We(this.h,this.c,Math.max(0,this.l-Qr*(arguments.length?At:1)))},rr.rgb=function(){return fr(this.h,this.c,this.l).rgb()};function fr(At,jt,ue){return isNaN(At)&&(At=0),isNaN(jt)&&(jt=0),new xr(ue,Math.cos(At*=le)*jt,Math.sin(At)*jt)}c.lab=xr;function xr(At,jt,ue){return this instanceof xr?(this.l=+At,this.a=+jt,void(this.b=+ue)):arguments.length<2?At instanceof xr?new xr(At.l,At.a,At.b):At instanceof We?fr(At.h,At.c,At.l):Br((At=Pa(At)).r,At.g,At.b):new xr(At,jt,ue)}var Qr=18,Cn=.95047,wn=1,Mn=1.08883,ci=xr.prototype=new ii;ci.brighter=function(At){return new xr(Math.min(100,this.l+Qr*(arguments.length?At:1)),this.a,this.b)},ci.darker=function(At){return new xr(Math.max(0,this.l-Qr*(arguments.length?At:1)),this.a,this.b)},ci.rgb=function(){return xi(this.l,this.a,this.b)};function xi(At,jt,ue){var Me=(At+16)/116,Le=Me+jt/500,Be=Me-ue/200;return Le=Di(Le)*Cn,Me=Di(Me)*wn,Be=Di(Be)*Mn,new Pa(ui(3.2404542*Le-1.5371385*Me-.4985314*Be),ui(-.969266*Le+1.8760108*Me+.041556*Be),ui(.0556434*Le-.2040259*Me+1.0572252*Be))}function Pi(At,jt,ue){return At>0?new We(Math.atan2(ue,jt)*we,Math.sqrt(jt*jt+ue*ue),At):new We(NaN,NaN,At)}function Di(At){return At>.206893034?At*At*At:(At-4/29)/7.787037}function Zi(At){return At>.008856?Math.pow(At,1/3):7.787037*At+4/29}function ui(At){return Math.round(255*(At<=.00304?12.92*At:1.055*Math.pow(At,1/2.4)-.055))}c.rgb=Pa;function Pa(At,jt,ue){return this instanceof Pa?(this.r=~~At,this.g=~~jt,void(this.b=~~ue)):arguments.length<2?At instanceof Pa?new Pa(At.r,At.g,At.b):qr(""+At,Pa,Hi):new Pa(At,jt,ue)}function Wa(At){return new Pa(At>>16,At>>8&255,At&255)}function ze(At){return Wa(At)+""}var Pe=Pa.prototype=new ii;Pe.brighter=function(At){At=Math.pow(.7,arguments.length?At:1);var jt=this.r,ue=this.g,Me=this.b,Le=30;return!jt&&!ue&&!Me?new Pa(Le,Le,Le):(jt&&jt>4,Me=Me>>4|Me,Le=Mr&240,Le=Le>>4|Le,Be=Mr&15,Be=Be<<4|Be):At.length===7&&(Me=(Mr&16711680)>>16,Le=(Mr&65280)>>8,Be=Mr&255)),jt(Me,Le,Be))}function $r(At,jt,ue){var Me=Math.min(At/=255,jt/=255,ue/=255),Le=Math.max(At,jt,ue),Be=Le-Me,sr,ir,Mr=(Le+Me)/2;return Be?(ir=Mr<.5?Be/(Le+Me):Be/(2-Le-Me),At==Le?sr=(jt-ue)/Be+(jt0&&Mr<1?0:sr),new qn(sr,ir,Mr)}function Br(At,jt,ue){At=Gr(At),jt=Gr(jt),ue=Gr(ue);var Me=Zi((.4124564*At+.3575761*jt+.1804375*ue)/Cn),Le=Zi((.2126729*At+.7151522*jt+.072175*ue)/wn),Be=Zi((.0193339*At+.119192*jt+.9503041*ue)/Mn);return xr(116*Le-16,500*(Me-Le),200*(Le-Be))}function Gr(At){return(At/=255)<=.04045?At/12.92:Math.pow((At+.055)/1.055,2.4)}function dn(At){var jt=parseFloat(At);return At.charAt(At.length-1)==="%"?Math.round(jt*2.55):jt}var an=c.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});an.forEach(function(At,jt){an.set(At,Wa(jt))});function Ee(At){return typeof At=="function"?At:function(){return At}}c.functor=Ee,c.xhr=dr(V);function dr(At){return function(jt,ue,Me){return arguments.length===2&&typeof ue=="function"&&(Me=ue,ue=null),Vr(jt,ue,At,Me)}}function Vr(At,jt,ue,Me){var Le={},Be=c.dispatch("beforesend","progress","load","error"),sr={},ir=new XMLHttpRequest,Mr=null;self.XDomainRequest&&!("withCredentials"in ir)&&/^(http(s)?:)?\/\//.test(At)&&(ir=new XDomainRequest),"onload"in ir?ir.onload=ir.onerror=en:ir.onreadystatechange=function(){ir.readyState>3&&en()};function en(){var Xr=ir.status,vn;if(!Xr&&Fn(ir)||Xr>=200&&Xr<300||Xr===304){try{vn=ue.call(Le,ir)}catch(In){Be.error.call(Le,In);return}Be.load.call(Le,vn)}else Be.error.call(Le,ir)}return ir.onprogress=function(Xr){var vn=c.event;c.event=Xr;try{Be.progress.call(Le,ir)}finally{c.event=vn}},Le.header=function(Xr,vn){return Xr=(Xr+"").toLowerCase(),arguments.length<2?sr[Xr]:(vn==null?delete sr[Xr]:sr[Xr]=vn+"",Le)},Le.mimeType=function(Xr){return arguments.length?(jt=Xr==null?null:Xr+"",Le):jt},Le.responseType=function(Xr){return arguments.length?(Mr=Xr,Le):Mr},Le.response=function(Xr){return ue=Xr,Le},["get","post"].forEach(function(Xr){Le[Xr]=function(){return Le.send.apply(Le,[Xr].concat(P(arguments)))}}),Le.send=function(Xr,vn,In){if(arguments.length===2&&typeof vn=="function"&&(In=vn,vn=null),ir.open(Xr,At,!0),jt!=null&&!("accept"in sr)&&(sr.accept=jt+",*/*"),ir.setRequestHeader)for(var On in sr)ir.setRequestHeader(On,sr[On]);return jt!=null&&ir.overrideMimeType&&ir.overrideMimeType(jt),Mr!=null&&(ir.responseType=Mr),In!=null&&Le.on("error",In).on("load",function(Bi){In(null,Bi)}),Be.beforesend.call(Le,ir),ir.send(vn??null),Le},Le.abort=function(){return ir.abort(),Le},c.rebind(Le,Be,"on"),Me==null?Le:Le.get(yn(Me))}function yn(At){return At.length===1?function(jt,ue){At(jt==null?ue:null)}:At}function Fn(At){var jt=At.responseType;return jt&&jt!=="text"?At.response:At.responseText}c.dsv=function(At,jt){var ue=new RegExp('["'+At+` + */const Idt={datetime:"MMM d, yyyy, h:mm:ss aaaa",millisecond:"h:mm:ss.SSS aaaa",second:"h:mm:ss aaaa",minute:"h:mm aaaa",hour:"ha",day:"MMM d",week:"PP",month:"MMM yyyy",quarter:"qqq - yyyy",year:"yyyy"};aD._date.override({_id:"date-fns",formats:function(){return Idt},parse:function(d,l){if(d===null||typeof d>"u")return null;const z=typeof d;return z==="number"||d instanceof Date?d=Vu(d):z==="string"&&(typeof l=="string"?d=fdt(d,l,new Date,this.options):d=vdt(d,this.options)),MD(d)?d.getTime():null},format:function(d,l){return pft(d,l,this.options)},add:function(d,l,z){switch(z){case"millisecond":return vM(d,l);case"second":return nht(d,l);case"minute":return eht(d,l);case"hour":return Jct(d,l);case"day":return Y4(d,l);case"week":return iht(d,l);case"month":return gM(d,l);case"quarter":return rht(d,l);case"year":return aht(d,l);default:return d}},diff:function(d,l,z){switch(z){case"millisecond":return yM(d,l);case"second":return dht(d,l);case"minute":return cht(d,l);case"hour":return uht(d,l);case"day":return SD(d,l);case"week":return pht(d,l);case"month":return LD(d,l);case"quarter":return fht(d,l);case"year":return mht(d,l);default:return 0}},startOf:function(d,l,z){switch(l){case"second":return gdt(d);case"minute":return mdt(d);case"hour":return pdt(d);case"day":return TA(d);case"week":return fg(d);case"isoWeek":return fg(d,{weekStartsOn:+z});case"month":return vht(d);case"quarter":return ght(d);case"year":return PD(d);default:return d}},endOf:function(d,l){switch(l){case"second":return kht(d);case"minute":return bht(d);case"hour":return xht(d);case"day":return ED(d);case"week":return _ht(d);case"month":return CD(d);case"quarter":return wht(d);case"year":return yht(d);default:return d}}});var J5={exports:{}},Odt=J5.exports,hz;function Ddt(){return hz||(hz=1,function(d){var l={};(function(z,j){d.exports?d.exports=j():z.moduleName=j()})(typeof self<"u"?self:Odt,()=>{var z=(()=>{var j=Object.create,J=Object.defineProperty,mt=Object.defineProperties,kt=Object.getOwnPropertyDescriptor,Dt=Object.getOwnPropertyDescriptors,Gt=Object.getOwnPropertyNames,re=Object.getOwnPropertySymbols,pe=Object.getPrototypeOf,Ne=Object.prototype.hasOwnProperty,or=Object.prototype.propertyIsEnumerable,_r=(Q,$,c)=>$ in Q?J(Q,$,{enumerable:!0,configurable:!0,writable:!0,value:c}):Q[$]=c,Fr=(Q,$)=>{for(var c in $||($={}))Ne.call($,c)&&_r(Q,c,$[c]);if(re)for(var c of re($))or.call($,c)&&_r(Q,c,$[c]);return Q},zr=(Q,$)=>mt(Q,Dt($)),Wr=(Q,$)=>{var c={};for(var g in Q)Ne.call(Q,g)&&$.indexOf(g)<0&&(c[g]=Q[g]);if(Q!=null&&re)for(var g of re(Q))$.indexOf(g)<0&&or.call(Q,g)&&(c[g]=Q[g]);return c},An=(Q,$)=>()=>(Q&&($=Q(Q=0)),$),Ft=(Q,$)=>()=>($||Q(($={exports:{}}).exports,$),$.exports),kn=(Q,$)=>{for(var c in $)J(Q,c,{get:$[c],enumerable:!0})},ei=(Q,$,c,g)=>{if($&&typeof $=="object"||typeof $=="function")for(let P of Gt($))!Ne.call(Q,P)&&P!==c&&J(Q,P,{get:()=>$[P],enumerable:!(g=kt($,P))||g.enumerable});return Q},jn=(Q,$,c)=>(c=Q!=null?j(pe(Q)):{},ei(J(c,"default",{value:Q,enumerable:!0}),Q)),ai=Q=>ei(J({},"__esModule",{value:!0}),Q),Qi=Ft(Q=>{Q.version="3.2.0"}),Gi=Ft((Q,$)=>{(function(c,g,P){g[c]=g[c]||P(),typeof $<"u"&&$.exports&&($.exports=g[c])})("Promise",typeof window<"u"?window:Q,function(){var c,g,P,S=Object.prototype.toString,t=typeof setImmediate<"u"?function(T){return setImmediate(T)}:setTimeout;try{Object.defineProperty({},"x",{}),c=function(T,u,b,_){return Object.defineProperty(T,u,{value:b,writable:!0,configurable:_!==!1})}}catch{c=function(u,b,_){return u[b]=_,u}}P=function(){var T,u,b;function _(C,M){this.fn=C,this.self=M,this.next=void 0}return{add:function(C,M){b=new _(C,M),u?u.next=b:T=b,u=b,b=void 0},drain:function(){var C=T;for(T=u=g=void 0;C;)C.fn.call(C.self),C=C.next}}}();function e(T,u){P.add(T,u),g||(g=t(P.drain))}function r(T){var u,b=typeof T;return T!=null&&(b=="object"||b=="function")&&(u=T.then),typeof u=="function"?u:!1}function a(){for(var T=0;T0&&e(a,b))}catch(_){i.call(new f(b),_)}}}function i(T){var u=this;u.triggered||(u.triggered=!0,u.def&&(u=u.def),u.msg=T,u.state=2,u.chain.length>0&&e(a,u))}function s(T,u,b,_){for(var C=0;C{(function(){var c={version:"3.8.2"},g=[].slice,P=function(At){return g.call(At)},S=self.document;function t(At){return At&&(At.ownerDocument||At.document||At).documentElement}function e(At){return At&&(At.ownerDocument&&At.ownerDocument.defaultView||At.document&&At||At.defaultView)}if(S)try{P(S.documentElement.childNodes)[0].nodeType}catch{P=function(jt){for(var ue=jt.length,Me=new Array(ue);ue--;)Me[ue]=jt[ue];return Me}}if(Date.now||(Date.now=function(){return+new Date}),S)try{S.createElement("DIV").style.setProperty("opacity",0,"")}catch{var r=this.Element.prototype,a=r.setAttribute,n=r.setAttributeNS,o=this.CSSStyleDeclaration.prototype,i=o.setProperty;r.setAttribute=function(jt,ue){a.call(this,jt,ue+"")},r.setAttributeNS=function(jt,ue,Me){n.call(this,jt,ue,Me+"")},o.setProperty=function(jt,ue,Me){i.call(this,jt,ue+"",Me)}}c.ascending=s;function s(At,jt){return Atjt?1:At>=jt?0:NaN}c.descending=function(At,jt){return jtAt?1:jt>=At?0:NaN},c.min=function(At,jt){var ue=-1,Me=At.length,Le,Be;if(arguments.length===1){for(;++ue=Be){Le=Be;break}for(;++ueBe&&(Le=Be)}else{for(;++ue=Be){Le=Be;break}for(;++ueBe&&(Le=Be)}return Le},c.max=function(At,jt){var ue=-1,Me=At.length,Le,Be;if(arguments.length===1){for(;++ue=Be){Le=Be;break}for(;++ueLe&&(Le=Be)}else{for(;++ue=Be){Le=Be;break}for(;++ueLe&&(Le=Be)}return Le},c.extent=function(At,jt){var ue=-1,Me=At.length,Le,Be,sr;if(arguments.length===1){for(;++ue=Be){Le=sr=Be;break}for(;++ueBe&&(Le=Be),sr=Be){Le=sr=Be;break}for(;++ueBe&&(Le=Be),sr1)return sr/(Mr-1)},c.deviation=function(){var At=c.variance.apply(this,arguments);return At&&Math.sqrt(At)};function y(At){return{left:function(jt,ue,Me,Le){for(arguments.length<3&&(Me=0),arguments.length<4&&(Le=jt.length);Me>>1;At(jt[Be],ue)<0?Me=Be+1:Le=Be}return Me},right:function(jt,ue,Me,Le){for(arguments.length<3&&(Me=0),arguments.length<4&&(Le=jt.length);Me>>1;At(jt[Be],ue)>0?Le=Be:Me=Be+1}return Me}}}var v=y(s);c.bisectLeft=v.left,c.bisect=c.bisectRight=v.right,c.bisector=function(At){return y(At.length===1?function(jt,ue){return s(At(jt),ue)}:At)},c.shuffle=function(At,jt,ue){(Me=arguments.length)<3&&(ue=At.length,Me<2&&(jt=0));for(var Me=ue-jt,Le,Be;Me;)Be=Math.random()*Me--|0,Le=At[Me+jt],At[Me+jt]=At[Be+jt],At[Be+jt]=Le;return At},c.permute=function(At,jt){for(var ue=jt.length,Me=new Array(ue);ue--;)Me[ue]=At[jt[ue]];return Me},c.pairs=function(At){for(var jt=0,ue=At.length-1,Me,Le=At[0],Be=new Array(ue<0?0:ue);jt=0;)for(sr=At[jt],ue=sr.length;--ue>=0;)Be[--Le]=sr[ue];return Be};var u=Math.abs;c.range=function(At,jt,ue){if(arguments.length<3&&(ue=1,arguments.length<2&&(jt=At,At=0)),(jt-At)/ue===1/0)throw new Error("infinite range");var Me=[],Le=b(u(ue)),Be=-1,sr;if(At*=Le,jt*=Le,ue*=Le,ue<0)for(;(sr=At+ue*++Be)>jt;)Me.push(sr/Le);else for(;(sr=At+ue*++Be)=jt.length)return Le?Le.call(At,Mr):Me?Mr.sort(Me):Mr;for(var Xr=-1,vn=Mr.length,In=jt[en++],On,Bi,Un,mi=new C,Ti;++Xr=jt.length)return ir;var en=[],Xr=ue[Mr++];return ir.forEach(function(vn,In){en.push({key:vn,values:sr(In,Mr)})}),Xr?en.sort(function(vn,In){return Xr(vn.key,In.key)}):en}return At.map=function(ir,Mr){return Be(Mr,ir,0)},At.entries=function(ir){return sr(Be(c.map,ir,0),0)},At.key=function(ir){return jt.push(ir),At},At.sortKeys=function(ir){return ue[jt.length-1]=ir,At},At.sortValues=function(ir){return Me=ir,At},At.rollup=function(ir){return Le=ir,At},At},c.set=function(At){var jt=new N;if(At)for(var ue=0,Me=At.length;ue=0&&(Me=At.slice(ue+1),At=At.slice(0,ue)),At)return arguments.length<2?this[At].on(Me):this[At].on(Me,jt);if(arguments.length===2){if(jt==null)for(At in this)this.hasOwnProperty(At)&&this[At].on(Me,null);return this}};function X(At){var jt=[],ue=new C;function Me(){for(var Le=jt,Be=-1,sr=Le.length,ir;++Be=0&&(ue=At.slice(0,jt))!=="xmlns"&&(At=At.slice(jt+1)),wt.hasOwnProperty(ue)?{space:wt[ue],local:At}:At}},it.attr=function(At,jt){if(arguments.length<2){if(typeof At=="string"){var ue=this.node();return At=c.ns.qualify(At),At.local?ue.getAttributeNS(At.space,At.local):ue.getAttribute(At)}for(jt in At)this.each(zt(jt,At[jt]));return this}return this.each(zt(At,jt))};function zt(At,jt){At=c.ns.qualify(At);function ue(){this.removeAttribute(At)}function Me(){this.removeAttributeNS(At.space,At.local)}function Le(){this.setAttribute(At,jt)}function Be(){this.setAttributeNS(At.space,At.local,jt)}function sr(){var Mr=jt.apply(this,arguments);Mr==null?this.removeAttribute(At):this.setAttribute(At,Mr)}function ir(){var Mr=jt.apply(this,arguments);Mr==null?this.removeAttributeNS(At.space,At.local):this.setAttributeNS(At.space,At.local,Mr)}return jt==null?At.local?Me:ue:typeof jt=="function"?At.local?ir:sr:At.local?Be:Le}function Pt(At){return At.trim().replace(/\s+/g," ")}it.classed=function(At,jt){if(arguments.length<2){if(typeof At=="string"){var ue=this.node(),Me=(At=Ht(At)).length,Le=-1;if(jt=ue.classList){for(;++Le=0;)(Be=ue[Me])&&(Le&&Le!==Be.nextSibling&&Le.parentNode.insertBefore(Be,Le),Le=Be);return this},it.sort=function(At){At=te.apply(this,arguments);for(var jt=-1,ue=this.length;++jt=jt&&(jt=Le+1);!(Mr=sr[jt])&&++jt0&&(At=At.slice(0,Le));var sr=cr.get(At);sr&&(At=sr,Be=jr);function ir(){var Xr=this[Me];Xr&&(this.removeEventListener(At,Xr,Xr.$),delete this[Me])}function Mr(){var Xr=Be(jt,P(arguments));ir.call(this),this.addEventListener(At,this[Me]=Xr,Xr.$=ue),Xr._=jt}function en(){var Xr=new RegExp("^__on([^.]+)"+c.requote(At)+"$"),vn;for(var In in this)if(vn=In.match(Xr)){var On=this[In];this.removeEventListener(vn[1],On,On.$),delete this[In]}}return Le?jt?Mr:ir:jt?W:en}var cr=c.map({mouseenter:"mouseover",mouseleave:"mouseout"});S&&cr.forEach(function(At){"on"+At in S&&cr.remove(At)});function ur(At,jt){return function(ue){var Me=c.event;c.event=ue,jt[0]=this.__data__;try{At.apply(this,jt)}finally{c.event=Me}}}function jr(At,jt){var ue=ur(At,jt);return function(Me){var Le=this,Be=Me.relatedTarget;(!Be||Be!==Le&&!(Be.compareDocumentPosition(Le)&8))&&ue.call(Le,Me)}}var Hr,br=0;function Kr(At){var jt=".dragsuppress-"+ ++br,ue="click"+jt,Me=c.select(e(At)).on("touchmove"+jt,lt).on("dragstart"+jt,lt).on("selectstart"+jt,lt);if(Hr==null&&(Hr="onselectstart"in At?!1:F(At.style,"userSelect")),Hr){var Le=t(At).style,Be=Le[Hr];Le[Hr]="none"}return function(sr){if(Me.on(jt,null),Hr&&(Le[Hr]=Be),sr){var ir=function(){Me.on(ue,null)};Me.on(ue,function(){lt(),ir()},!0),setTimeout(ir,0)}}}c.mouse=function(At){return Ce(At,yt())};var rn=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function Ce(At,jt){jt.changedTouches&&(jt=jt.changedTouches[0]);var ue=At.ownerSVGElement||At;if(ue.createSVGPoint){var Me=ue.createSVGPoint();if(rn<0){var Le=e(At);if(Le.scrollX||Le.scrollY){ue=c.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var Be=ue[0][0].getScreenCTM();rn=!(Be.f||Be.e),ue.remove()}}return rn?(Me.x=jt.pageX,Me.y=jt.pageY):(Me.x=jt.clientX,Me.y=jt.clientY),Me=Me.matrixTransform(At.getScreenCTM().inverse()),[Me.x,Me.y]}var sr=At.getBoundingClientRect();return[jt.clientX-sr.left-At.clientLeft,jt.clientY-sr.top-At.clientTop]}c.touch=function(At,jt,ue){if(arguments.length<3&&(ue=jt,jt=yt().changedTouches),jt){for(var Me=0,Le=jt.length,Be;Me1?ee:At<-1?-ee:Math.asin(At)}function ar(At){return((At=Math.exp(At))-1/At)/2}function Ar(At){return((At=Math.exp(At))+1/At)/2}function Tr(At){return((At=Math.exp(2*At))-1)/(At+1)}var pr=Math.SQRT2,Jr=2,Vn=4;c.interpolateZoom=function(At,jt){var ue=At[0],Me=At[1],Le=At[2],Be=jt[0],sr=jt[1],ir=jt[2],Mr=Be-ue,en=sr-Me,Xr=Mr*Mr+en*en,vn,In;if(Xr0&&(_o=_o.transition().duration(sr)),_o.call(Wi.event)}function Fo(){mi&&mi.domain(Un.range().map(function(_o){return(_o-At.x)/At.k}).map(Un.invert)),Ii&&Ii.domain(Ti.range().map(function(_o){return(_o-At.y)/At.k}).map(Ti.invert))}function Uo(_o){ir++||_o({type:"zoomstart"})}function al(_o){Fo(),_o({type:"zoom",scale:At.k,translate:[At.x,At.y]})}function Wo(_o){--ir||(_o({type:"zoomend"}),ue=null)}function ps(){var _o=this,Zs=Bi.of(_o,arguments),rl=0,ou=c.select(e(_o)).on(en,Bl).on(Xr,Ql),Gl=Yn(c.mouse(_o)),rh=Kr(_o);Fi.call(_o),Uo(Zs);function Bl(){rl=1,ro(c.mouse(_o),Gl),al(Zs)}function Ql(){ou.on(en,null).on(Xr,null),rh(rl),Wo(Zs)}}function Tl(){var _o=this,Zs=Bi.of(_o,arguments),rl={},ou=0,Gl,rh=".zoom-"+c.event.changedTouches[0].identifier,Bl="touchmove"+rh,Ql="touchend"+rh,bh=[],_e=c.select(_o),kr=Kr(_o);Dn(),Uo(Zs),_e.on(Mr,null).on(In,Dn);function Lr(){var gn=c.touches(_o);return Gl=At.k,gn.forEach(function(ni){ni.identifier in rl&&(rl[ni.identifier]=Yn(ni))}),gn}function Dn(){var gn=c.event.target;c.select(gn).on(Bl,oi).on(Ql,Jn),bh.push(gn);for(var ni=c.event.changedTouches,Yi=0,Ui=ni.length;Yi1){var Ba=va[0],ta=va[1],wi=Ba[0]-ta[0],hn=Ba[1]-ta[1];ou=wi*wi+hn*hn}}function oi(){var gn=c.touches(_o),ni,Yi,Ui,va;Fi.call(_o);for(var Za=0,Ba=gn.length;Za1?1:jt,ue=ue<0?0:ue>1?1:ue,Le=ue<=.5?ue*(1+jt):ue+jt-ue*jt,Me=2*ue-Le;function Be(ir){return ir>360?ir-=360:ir<0&&(ir+=360),ir<60?Me+(Le-Me)*ir/60:ir<180?Le:ir<240?Me+(Le-Me)*(240-ir)/60:Me}function sr(ir){return Math.round(Be(ir)*255)}return new Pa(sr(At+120),sr(At),sr(At-120))}c.hcl=We;function We(At,jt,ue){return this instanceof We?(this.h=+At,this.c=+jt,void(this.l=+ue)):arguments.length<2?At instanceof We?new We(At.h,At.c,At.l):At instanceof xr?Pi(At.l,At.a,At.b):Pi((At=Br((At=c.rgb(At)).r,At.g,At.b)).l,At.a,At.b):new We(At,jt,ue)}var rr=We.prototype=new ii;rr.brighter=function(At){return new We(this.h,this.c,Math.min(100,this.l+Qr*(arguments.length?At:1)))},rr.darker=function(At){return new We(this.h,this.c,Math.max(0,this.l-Qr*(arguments.length?At:1)))},rr.rgb=function(){return fr(this.h,this.c,this.l).rgb()};function fr(At,jt,ue){return isNaN(At)&&(At=0),isNaN(jt)&&(jt=0),new xr(ue,Math.cos(At*=le)*jt,Math.sin(At)*jt)}c.lab=xr;function xr(At,jt,ue){return this instanceof xr?(this.l=+At,this.a=+jt,void(this.b=+ue)):arguments.length<2?At instanceof xr?new xr(At.l,At.a,At.b):At instanceof We?fr(At.h,At.c,At.l):Br((At=Pa(At)).r,At.g,At.b):new xr(At,jt,ue)}var Qr=18,Cn=.95047,wn=1,Mn=1.08883,ci=xr.prototype=new ii;ci.brighter=function(At){return new xr(Math.min(100,this.l+Qr*(arguments.length?At:1)),this.a,this.b)},ci.darker=function(At){return new xr(Math.max(0,this.l-Qr*(arguments.length?At:1)),this.a,this.b)},ci.rgb=function(){return xi(this.l,this.a,this.b)};function xi(At,jt,ue){var Me=(At+16)/116,Le=Me+jt/500,Be=Me-ue/200;return Le=Di(Le)*Cn,Me=Di(Me)*wn,Be=Di(Be)*Mn,new Pa(ui(3.2404542*Le-1.5371385*Me-.4985314*Be),ui(-.969266*Le+1.8760108*Me+.041556*Be),ui(.0556434*Le-.2040259*Me+1.0572252*Be))}function Pi(At,jt,ue){return At>0?new We(Math.atan2(ue,jt)*we,Math.sqrt(jt*jt+ue*ue),At):new We(NaN,NaN,At)}function Di(At){return At>.206893034?At*At*At:(At-4/29)/7.787037}function Zi(At){return At>.008856?Math.pow(At,1/3):7.787037*At+4/29}function ui(At){return Math.round(255*(At<=.00304?12.92*At:1.055*Math.pow(At,1/2.4)-.055))}c.rgb=Pa;function Pa(At,jt,ue){return this instanceof Pa?(this.r=~~At,this.g=~~jt,void(this.b=~~ue)):arguments.length<2?At instanceof Pa?new Pa(At.r,At.g,At.b):qr(""+At,Pa,Hi):new Pa(At,jt,ue)}function Wa(At){return new Pa(At>>16,At>>8&255,At&255)}function ze(At){return Wa(At)+""}var Pe=Pa.prototype=new ii;Pe.brighter=function(At){At=Math.pow(.7,arguments.length?At:1);var jt=this.r,ue=this.g,Me=this.b,Le=30;return!jt&&!ue&&!Me?new Pa(Le,Le,Le):(jt&&jt>4,Me=Me>>4|Me,Le=Mr&240,Le=Le>>4|Le,Be=Mr&15,Be=Be<<4|Be):At.length===7&&(Me=(Mr&16711680)>>16,Le=(Mr&65280)>>8,Be=Mr&255)),jt(Me,Le,Be))}function $r(At,jt,ue){var Me=Math.min(At/=255,jt/=255,ue/=255),Le=Math.max(At,jt,ue),Be=Le-Me,sr,ir,Mr=(Le+Me)/2;return Be?(ir=Mr<.5?Be/(Le+Me):Be/(2-Le-Me),At==Le?sr=(jt-ue)/Be+(jt0&&Mr<1?0:sr),new qn(sr,ir,Mr)}function Br(At,jt,ue){At=Gr(At),jt=Gr(jt),ue=Gr(ue);var Me=Zi((.4124564*At+.3575761*jt+.1804375*ue)/Cn),Le=Zi((.2126729*At+.7151522*jt+.072175*ue)/wn),Be=Zi((.0193339*At+.119192*jt+.9503041*ue)/Mn);return xr(116*Le-16,500*(Me-Le),200*(Le-Be))}function Gr(At){return(At/=255)<=.04045?At/12.92:Math.pow((At+.055)/1.055,2.4)}function dn(At){var jt=parseFloat(At);return At.charAt(At.length-1)==="%"?Math.round(jt*2.55):jt}var an=c.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});an.forEach(function(At,jt){an.set(At,Wa(jt))});function Ee(At){return typeof At=="function"?At:function(){return At}}c.functor=Ee,c.xhr=dr(V);function dr(At){return function(jt,ue,Me){return arguments.length===2&&typeof ue=="function"&&(Me=ue,ue=null),Vr(jt,ue,At,Me)}}function Vr(At,jt,ue,Me){var Le={},Be=c.dispatch("beforesend","progress","load","error"),sr={},ir=new XMLHttpRequest,Mr=null;self.XDomainRequest&&!("withCredentials"in ir)&&/^(http(s)?:)?\/\//.test(At)&&(ir=new XDomainRequest),"onload"in ir?ir.onload=ir.onerror=en:ir.onreadystatechange=function(){ir.readyState>3&&en()};function en(){var Xr=ir.status,vn;if(!Xr&&Fn(ir)||Xr>=200&&Xr<300||Xr===304){try{vn=ue.call(Le,ir)}catch(In){Be.error.call(Le,In);return}Be.load.call(Le,vn)}else Be.error.call(Le,ir)}return ir.onprogress=function(Xr){var vn=c.event;c.event=Xr;try{Be.progress.call(Le,ir)}finally{c.event=vn}},Le.header=function(Xr,vn){return Xr=(Xr+"").toLowerCase(),arguments.length<2?sr[Xr]:(vn==null?delete sr[Xr]:sr[Xr]=vn+"",Le)},Le.mimeType=function(Xr){return arguments.length?(jt=Xr==null?null:Xr+"",Le):jt},Le.responseType=function(Xr){return arguments.length?(Mr=Xr,Le):Mr},Le.response=function(Xr){return ue=Xr,Le},["get","post"].forEach(function(Xr){Le[Xr]=function(){return Le.send.apply(Le,[Xr].concat(P(arguments)))}}),Le.send=function(Xr,vn,In){if(arguments.length===2&&typeof vn=="function"&&(In=vn,vn=null),ir.open(Xr,At,!0),jt!=null&&!("accept"in sr)&&(sr.accept=jt+",*/*"),ir.setRequestHeader)for(var On in sr)ir.setRequestHeader(On,sr[On]);return jt!=null&&ir.overrideMimeType&&ir.overrideMimeType(jt),Mr!=null&&(ir.responseType=Mr),In!=null&&Le.on("error",In).on("load",function(Bi){In(null,Bi)}),Be.beforesend.call(Le,ir),ir.send(vn??null),Le},Le.abort=function(){return ir.abort(),Le},c.rebind(Le,Be,"on"),Me==null?Le:Le.get(yn(Me))}function yn(At){return At.length===1?function(jt,ue){At(jt==null?ue:null)}:At}function Fn(At){var jt=At.responseType;return jt&&jt!=="text"?At.response:At.responseText}c.dsv=function(At,jt){var ue=new RegExp('["'+At+` ]`),Me=At.charCodeAt(0);function Le(en,Xr,vn){arguments.length<3&&(vn=Xr,Xr=null);var In=Vr(en,jt,Xr==null?Be:sr(Xr),vn);return In.row=function(On){return arguments.length?In.response((Xr=On)==null?Be:sr(On)):Xr},In}function Be(en){return Le.parse(en.responseText)}function sr(en){return function(Xr){return Le.parse(Xr.responseText,en)}}Le.parse=function(en,Xr){var vn;return Le.parseRows(en,function(In,On){if(vn)return vn(In,On-1);var Bi=function(Un){for(var mi={},Ti=In.length,Ii=0;Ii=Bi)return In;if(Ii)return Ii=!1,vn;var ja=Un;if(en.charCodeAt(ja)===34){for(var Ha=ja;Ha++24?(isFinite(jt)&&(clearTimeout(Zn),Zn=setTimeout(Ja,jt)),En=0):(En=1,Ca(Ja))}c.timer.flush=function(){Xa(),Io()};function Xa(){for(var At=Date.now(),jt=Xn;jt;)At>=jt.t&&jt.c(At-jt.t)&&(jt.c=null),jt=jt.n;return At}function Io(){for(var At,jt=Xn,ue=1/0;jt;)jt.c?(jt.t=0;--ir)Un.push(Le[en[vn[ir]][2]]);for(ir=+On;ir1&&Ue(At[ue[Me-2]],At[ue[Me-1]],At[Le])<=0;)--Me;ue[Me++]=Le}return ue.slice(0,Me)}function gs(At,jt){return At[0]-jt[0]||At[1]-jt[1]}c.geom.polygon=function(At){return tt(At,is),At};var is=c.geom.polygon.prototype=[];is.area=function(){for(var At=-1,jt=this.length,ue,Me=this[jt-1],Le=0;++Atne)ir=ir.L;else if(sr=jt-uo(ir,ue),sr>ne){if(!ir.R){Me=ir;break}ir=ir.R}else{Be>-ne?(Me=ir.P,Le=ir):sr>-ne?(Me=ir,Le=ir.N):Me=Le=ir;break}var Mr=kl(At);if(Js.insert(Me,Mr),!(!Me&&!Le)){if(Me===Le){Cl(Me),Le=kl(Me.site),Js.insert(Mr,Le),Mr.edge=Le.edge=nu(Me.site,Mr.site),il(Me),il(Le);return}if(!Le){Mr.edge=nu(Me.site,Mr.site);return}Cl(Me),Cl(Le);var en=Me.site,Xr=en.x,vn=en.y,In=At.x-Xr,On=At.y-vn,Bi=Le.site,Un=Bi.x-Xr,mi=Bi.y-vn,Ti=2*(In*mi-On*Un),Ii=In*In+On*On,Wi=Un*Un+mi*mi,Yn={x:(mi*Ii-On*Wi)/Ti+Xr,y:(In*Wi-Un*Ii)/Ti+vn};Qo(Le.edge,en,Bi,Yn),Mr.edge=nu(en,At,null,Yn),Le.edge=nu(At,Bi,null,Yn),il(Me),il(Le)}}function La(At,jt){var ue=At.site,Me=ue.x,Le=ue.y,Be=Le-jt;if(!Be)return Me;var sr=At.P;if(!sr)return-1/0;ue=sr.site;var ir=ue.x,Mr=ue.y,en=Mr-jt;if(!en)return ir;var Xr=ir-Me,vn=1/Be-1/en,In=Xr/en;return vn?(-In+Math.sqrt(In*In-2*vn*(Xr*Xr/(-2*en)-Mr+en/2+Le-Be/2)))/vn+Me:(Me+ir)/2}function uo(At,jt){var ue=At.N;if(ue)return La(ue,jt);var Me=At.site;return Me.y===jt?Me.x:1/0}function Hs(At){this.site=At,this.edges=[]}Hs.prototype.prepare=function(){for(var At=this.edges,jt=At.length,ue;jt--;)ue=At[jt].edge,(!ue.b||!ue.a)&&At.splice(jt,1);return At.sort(Go),At.length};function Kl(At){for(var jt=At[0][0],ue=At[1][0],Me=At[0][1],Le=At[1][1],Be,sr,ir,Mr,en=ul,Xr=en.length,vn,In,On,Bi,Un,mi;Xr--;)if(vn=en[Xr],!(!vn||!vn.prepare()))for(On=vn.edges,Bi=On.length,In=0;Inne||u(Mr-sr)>ne)&&(On.splice(In,0,new Mu(cl(vn.site,mi,u(ir-jt)ne?{x:jt,y:u(Be-jt)ne?{x:u(sr-Le)ne?{x:ue,y:u(Be-ue)ne?{x:u(sr-Me)=-Ct)){var On=Mr*Mr+en*en,Bi=Xr*Xr+vn*vn,Un=(vn*On-en*Bi)/In,mi=(Mr*Bi-Xr*On)/In,vn=mi+ir,Ti=Co.pop()||new ql;Ti.arc=At,Ti.site=Le,Ti.x=Un+sr,Ti.y=vn+Math.sqrt(Un*Un+mi*mi),Ti.cy=vn,At.circle=Ti;for(var Ii=null,Wi=Cs._;Wi;)if(Ti.y0)){if(Un/=On,On<0){if(Un0){if(Un>In)return;Un>vn&&(vn=Un)}if(Un=ue-ir,!(!On&&Un<0)){if(Un/=On,On<0){if(Un>In)return;Un>vn&&(vn=Un)}else if(On>0){if(Un0)){if(Un/=Bi,Bi<0){if(Un0){if(Un>In)return;Un>vn&&(vn=Un)}if(Un=Me-Mr,!(!Bi&&Un<0)){if(Un/=Bi,Bi<0){if(Un>In)return;Un>vn&&(vn=Un)}else if(Bi>0){if(Un0&&(Le.a={x:ir+vn*On,y:Mr+vn*Bi}),In<1&&(Le.b={x:ir+In*On,y:Mr+In*Bi}),Le}}}}}}function ao(At){for(var jt=as,ue=Fu(At[0][0],At[0][1],At[1][0],At[1][1]),Me=jt.length,Le;Me--;)Le=jt[Me],(!Ts(Le,At)||!ue(Le)||u(Le.a.x-Le.b.x)=Be)return;if(Xr>In){if(!Me)Me={x:Bi,y:sr};else if(Me.y>=ir)return;ue={x:Bi,y:ir}}else{if(!Me)Me={x:Bi,y:ir};else if(Me.y1)if(Xr>In){if(!Me)Me={x:(sr-Ti)/mi,y:sr};else if(Me.y>=ir)return;ue={x:(ir-Ti)/mi,y:ir}}else{if(!Me)Me={x:(ir-Ti)/mi,y:ir};else if(Me.y=Be)return;ue={x:Be,y:mi*Be+Ti}}else{if(!Me)Me={x:Be,y:mi*Be+Ti};else if(Me.x=Xr&&Ti.x<=In&&Ti.y>=vn&&Ti.y<=On?[[Xr,On],[In,On],[In,vn],[Xr,vn]]:[];Ii.point=Mr[Un]}),en}function ir(Mr){return Mr.map(function(en,Xr){return{x:Math.round(Me(en,Xr)/ne)*ne,y:Math.round(Le(en,Xr)/ne)*ne,i:Xr}})}return sr.links=function(Mr){return ac(ir(Mr)).edges.filter(function(en){return en.l&&en.r}).map(function(en){return{source:Mr[en.l.i],target:Mr[en.r.i]}})},sr.triangles=function(Mr){var en=[];return ac(ir(Mr)).cells.forEach(function(Xr,vn){for(var In=Xr.site,On=Xr.edges.sort(Go),Bi=-1,Un=On.length,mi,Ti,Ii=On[Un-1].edge,Wi=Ii.l===In?Ii.r:Ii.l;++BiWi&&(Wi=Xr.x),Xr.y>Yn&&(Yn=Xr.y),On.push(Xr.x),Bi.push(Xr.y);else for(Un=0;UnWi&&(Wi=ja),Ha>Yn&&(Yn=Ha),On.push(ja),Bi.push(Ha)}var ro=Wi-Ti,Lo=Yn-Ii;ro>Lo?Yn=Ii+ro:Wi=Ti+Lo;function Fo(Wo,ps,Tl,Ku,cu,_o,Zs,rl){if(!(isNaN(Tl)||isNaN(Ku)))if(Wo.leaf){var ou=Wo.x,Gl=Wo.y;if(ou!=null)if(u(ou-Tl)+u(Gl-Ku)<.01)Uo(Wo,ps,Tl,Ku,cu,_o,Zs,rl);else{var rh=Wo.point;Wo.x=Wo.y=Wo.point=null,Uo(Wo,rh,ou,Gl,cu,_o,Zs,rl),Uo(Wo,ps,Tl,Ku,cu,_o,Zs,rl)}else Wo.x=Tl,Wo.y=Ku,Wo.point=ps}else Uo(Wo,ps,Tl,Ku,cu,_o,Zs,rl)}function Uo(Wo,ps,Tl,Ku,cu,_o,Zs,rl){var ou=(cu+Zs)*.5,Gl=(_o+rl)*.5,rh=Tl>=ou,Bl=Ku>=Gl,Ql=Bl<<1|rh;Wo.leaf=!1,Wo=Wo.nodes[Ql]||(Wo.nodes[Ql]=Dl()),rh?cu=ou:Zs=ou,Bl?_o=Gl:rl=Gl,Fo(Wo,ps,Tl,Ku,cu,_o,Zs,rl)}var al=Dl();if(al.add=function(Wo){Fo(al,Wo,+vn(Wo,++Un),+In(Wo,Un),Ti,Ii,Wi,Yn)},al.visit=function(Wo){Bc(Wo,al,Ti,Ii,Wi,Yn)},al.find=function(Wo){return jf(al,Wo[0],Wo[1],Ti,Ii,Wi,Yn)},Un=-1,jt==null){for(;++UnBe||In>sr||On=ja,Lo=ue>=Ha,Fo=Lo<<1|ro,Uo=Fo+4;Foue&&(Be=jt.slice(ue,Be),ir[sr]?ir[sr]+=Be:ir[++sr]=Be),(Me=Me[0])===(Le=Le[0])?ir[sr]?ir[sr]+=Le:ir[++sr]=Le:(ir[++sr]=null,Mr.push({i:sr,x:fc(Me,Le)})),ue=sc.lastIndex;return ue=0&&!(Me=c.interpolators[ue](At,jt)););return Me}c.interpolators=[function(At,jt){var ue=typeof jt;return(ue==="string"?an.has(jt.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(jt)?hc:oh:jt instanceof ii?hc:Array.isArray(jt)?Zl:ue==="object"&&isNaN(jt)?oc:fc)(At,jt)}],c.interpolateArray=Zl;function Zl(At,jt){var ue=[],Me=[],Le=At.length,Be=jt.length,sr=Math.min(At.length,jt.length),ir;for(ir=0;ir=0?At.slice(0,jt):At,Me=jt>=0?At.slice(jt+1):"in";return ue=Lc.get(ue)||Mh,Me=jh.get(Me)||V,xu(Me(ue.apply(null,g.call(arguments,1))))};function xu(At){return function(jt){return jt<=0?0:jt>=1?1:At(jt)}}function Cd(At){return function(jt){return 1-At(1-jt)}}function Qs(At){return function(jt){return .5*(jt<.5?At(2*jt):2-At(2-2*jt))}}function Wd(At){return At*At}function Ll(At){return At*At*At}function Jo(At){if(At<=0)return 0;if(At>=1)return 1;var jt=At*At,ue=jt*At;return 4*(At<.5?ue:3*(At-jt)+ue-.75)}function lf(At){return function(jt){return Math.pow(jt,At)}}function sh(At){return 1-Math.cos(At*ee)}function ec(At){return Math.pow(2,10*(At-1))}function Uf(At){return 1-Math.sqrt(1-At*At)}function Uh(At,jt){var ue;return arguments.length<2&&(jt=.45),arguments.length?ue=jt/St*Math.asin(1/At):(At=1,ue=jt/4),function(Me){return 1+At*Math.pow(2,-10*Me)*Math.sin((Me-ue)*St/jt)}}function yf(At){return At||(At=1.70158),function(jt){return jt*jt*((At+1)*jt-At)}}function lc(At){return At<1/2.75?7.5625*At*At:At<2/2.75?7.5625*(At-=1.5/2.75)*At+.75:At<2.5/2.75?7.5625*(At-=2.25/2.75)*At+.9375:7.5625*(At-=2.625/2.75)*At+.984375}c.interpolateHcl=hd;function hd(At,jt){At=c.hcl(At),jt=c.hcl(jt);var ue=At.h,Me=At.c,Le=At.l,Be=jt.h-ue,sr=jt.c-Me,ir=jt.l-Le;return isNaN(sr)&&(sr=0,Me=isNaN(Me)?jt.c:Me),isNaN(Be)?(Be=0,ue=isNaN(ue)?jt.h:ue):Be>180?Be-=360:Be<-180&&(Be+=360),function(Mr){return fr(ue+Be*Mr,Me+sr*Mr,Le+ir*Mr)+""}}c.interpolateHsl=$f;function $f(At,jt){At=c.hsl(At),jt=c.hsl(jt);var ue=At.h,Me=At.s,Le=At.l,Be=jt.h-ue,sr=jt.s-Me,ir=jt.l-Le;return isNaN(sr)&&(sr=0,Me=isNaN(Me)?jt.s:Me),isNaN(Be)?(Be=0,ue=isNaN(ue)?jt.h:ue):Be>180?Be-=360:Be<-180&&(Be+=360),function(Mr){return Hi(ue+Be*Mr,Me+sr*Mr,Le+ir*Mr)+""}}c.interpolateLab=xf;function xf(At,jt){At=c.lab(At),jt=c.lab(jt);var ue=At.l,Me=At.a,Le=At.b,Be=jt.l-ue,sr=jt.a-Me,ir=jt.b-Le;return function(Mr){return xi(ue+Be*Mr,Me+sr*Mr,Le+ir*Mr)+""}}c.interpolateRound=Vh;function Vh(At,jt){return jt-=At,function(ue){return Math.round(At+jt*ue)}}c.transform=function(At){var jt=S.createElementNS(c.ns.prefix.svg,"g");return(c.transform=function(ue){if(ue!=null){jt.setAttribute("transform",ue);var Me=jt.transform.baseVal.consolidate()}return new Vf(Me?Me.matrix:Sh)})(At)};function Vf(At){var jt=[At.a,At.b],ue=[At.c,At.d],Me=lh(jt),Le=Hf(jt,ue),Be=lh(Gf(ue,jt,-Le))||0;jt[0]*ue[1]180?jt+=360:jt-At>180&&(At+=360),Me.push({i:ue.push(mh(ue)+"rotate(",null,")")-2,x:fc(At,jt)})):jt&&ue.push(mh(ue)+"rotate("+jt+")")}function Wf(At,jt,ue,Me){At!==jt?Me.push({i:ue.push(mh(ue)+"skewX(",null,")")-2,x:fc(At,jt)}):jt&&ue.push(mh(ue)+"skewX("+jt+")")}function Jl(At,jt,ue,Me){if(At[0]!==jt[0]||At[1]!==jt[1]){var Le=ue.push(mh(ue)+"scale(",null,",",null,")");Me.push({i:Le-4,x:fc(At[0],jt[0])},{i:Le-2,x:fc(At[1],jt[1])})}else(jt[0]!==1||jt[1]!==1)&&ue.push(mh(ue)+"scale("+jt+")")}function Ef(At,jt){var ue=[],Me=[];return At=c.transform(At),jt=c.transform(jt),uc(At.translate,jt.translate,ue,Me),ef(At.rotate,jt.rotate,ue,Me),Wf(At.skew,jt.skew,ue,Me),Jl(At.scale,jt.scale,ue,Me),At=jt=null,function(Le){for(var Be=-1,sr=Me.length,ir;++Be0?Be=Yn:(ue.c=null,ue.t=NaN,ue=null,jt.end({type:"end",alpha:Be=0})):Yn>0&&(jt.start({type:"start",alpha:Be=Yn}),ue=Ri(At.tick)),At):Be},At.start=function(){var Yn,ja=On.length,Ha=Bi.length,ro=Me[0],Lo=Me[1],Fo,Uo;for(Yn=0;Yn=0;)Be.push(Xr=en[Mr]),Xr.parent=ir,Xr.depth=ir.depth+1;ue&&(ir.value=0),ir.children=en}else ue&&(ir.value=+ue.call(Me,ir,ir.depth)||0),delete ir.children;return gh(Le,function(vn){var In,On;At&&(In=vn.children)&&In.sort(At),ue&&(On=vn.parent)&&(On.value+=vn.value)}),sr}return Me.sort=function(Le){return arguments.length?(At=Le,Me):At},Me.children=function(Le){return arguments.length?(jt=Le,Me):jt},Me.value=function(Le){return arguments.length?(ue=Le,Me):ue},Me.revalue=function(Le){return ue&&(uf(Le,function(Be){Be.children&&(Be.value=0)}),gh(Le,function(Be){var sr;Be.children||(Be.value=+ue.call(Me,Be,Be.depth)||0),(sr=Be.parent)&&(sr.value+=Be.value)})),Le},Me};function _u(At,jt){return c.rebind(At,jt,"sort","children","value"),At.nodes=At,At.links=Qd,At}function uf(At,jt){for(var ue=[At];(At=ue.pop())!=null;)if(jt(At),(Le=At.children)&&(Me=Le.length))for(var Me,Le;--Me>=0;)ue.push(Le[Me])}function gh(At,jt){for(var ue=[At],Me=[];(At=ue.pop())!=null;)if(Me.push(At),(sr=At.children)&&(Be=sr.length))for(var Le=-1,Be,sr;++LeLe&&(Le=ir),Me.push(ir)}for(sr=0;srMe&&(ue=jt,Me=Le);return ue}function Ch(At){return At.reduce(Vc,0)}function Vc(At,jt){return At+jt[1]}c.layout.histogram=function(){var At=!0,jt=Number,ue=bf,Me=fd;function Le(Be,sr){for(var ir=[],Mr=Be.map(jt,this),en=ue.call(this,Mr,sr),Xr=Me.call(this,en,Mr,sr),vn,sr=-1,In=Mr.length,On=Xr.length-1,Bi=At?1:1/In,Un;++sr0)for(sr=-1;++sr=en[0]&&Un<=en[1]&&(vn=ir[c.bisect(Xr,Un,1,On)-1],vn.y+=Bi,vn.push(Be[sr]));return ir}return Le.value=function(Be){return arguments.length?(jt=Be,Le):jt},Le.range=function(Be){return arguments.length?(ue=Ee(Be),Le):ue},Le.bins=function(Be){return arguments.length?(Me=typeof Be=="number"?function(sr){return vu(sr,Be)}:Ee(Be),Le):Me},Le.frequency=function(Be){return arguments.length?(At=!!Be,Le):At},Le};function fd(At,jt){return vu(At,Math.ceil(Math.log(jt.length)/Math.LN2+1))}function vu(At,jt){for(var ue=-1,Me=+At[0],Le=(At[1]-Me)/jt,Be=[];++ue<=jt;)Be[ue]=Le*ue+Me;return Be}function bf(At){return[c.min(At),c.max(At)]}c.layout.pack=function(){var At=c.layout.hierarchy().sort(qh),jt=0,ue=[1,1],Me;function Le(Be,sr){var ir=At.call(this,Be,sr),Mr=ir[0],en=ue[0],Xr=ue[1],vn=Me==null?Math.sqrt:typeof Me=="function"?Me:function(){return Me};if(Mr.x=Mr.y=0,gh(Mr,function(On){On.r=+vn(On.value)}),gh(Mr,wf),jt){var In=jt*(Me?1:Math.max(2*Mr.r/en,2*Mr.r/Xr))/2;gh(Mr,function(On){On.r+=In}),gh(Mr,wf),gh(Mr,function(On){On.r-=In})}return Jf(Mr,en/2,Xr/2,Me?1:1/Math.max(2*Mr.r/en,2*Mr.r/Xr)),ir}return Le.size=function(Be){return arguments.length?(ue=Be,Le):ue},Le.radius=function(Be){return arguments.length?(Me=Be==null||typeof Be=="function"?Be:+Be,Le):Me},Le.padding=function(Be){return arguments.length?(jt=+Be,Le):jt},_u(Le,At)};function qh(At,jt){return At.value-jt.value}function th(At,jt){var ue=At._pack_next;At._pack_next=jt,jt._pack_prev=At,jt._pack_next=ue,ue._pack_prev=jt}function rf(At,jt){At._pack_next=jt,jt._pack_prev=At}function Zh(At,jt){var ue=jt.x-At.x,Me=jt.y-At.y,Le=At.r+jt.r;return .999*Le*Le>ue*ue+Me*Me}function wf(At){if(!(jt=At.children)||!(In=jt.length))return;var jt,ue=1/0,Me=-1/0,Le=1/0,Be=-1/0,sr,ir,Mr,en,Xr,vn,In;function On(Yn){ue=Math.min(Yn.x-Yn.r,ue),Me=Math.max(Yn.x+Yn.r,Me),Le=Math.min(Yn.y-Yn.r,Le),Be=Math.max(Yn.y+Yn.r,Be)}if(jt.forEach(zd),sr=jt[0],sr.x=-sr.r,sr.y=0,On(sr),In>1&&(ir=jt[1],ir.x=ir.r,ir.y=0,On(ir),In>2))for(Mr=jt[2],eh(sr,ir,Mr),On(Mr),th(sr,Mr),sr._pack_prev=Mr,th(Mr,ir),ir=sr._pack_next,en=3;enmi.x&&(mi=ja),ja.depth>Ti.depth&&(Ti=ja)});var Ii=jt(Un,mi)/2-Un.x,Wi=ue[0]/(mi.x+jt(mi,Un)/2+Ii),Yn=ue[1]/(Ti.depth||1);uf(On,function(ja){ja.x=(ja.x+Ii)*Wi,ja.y=ja.depth*Yn})}return In}function Be(Xr){for(var vn={A:null,children:[Xr]},In=[vn],On;(On=In.pop())!=null;)for(var Bi=On.children,Un,mi=0,Ti=Bi.length;mi0&&(eu(df(Un,Xr,In),Xr,ja),Ti+=ja,Ii+=ja),Wi+=Un.m,Ti+=On.m,Yn+=mi.m,Ii+=Bi.m;Un&&!Ru(Bi)&&(Bi.t=Un,Bi.m+=Wi-Ii),On&&!yh(mi)&&(mi.t=On,mi.m+=Ti-Yn,In=Xr)}return In}function en(Xr){Xr.x*=ue[0],Xr.y=Xr.depth*ue[1]}return Le.separation=function(Xr){return arguments.length?(jt=Xr,Le):jt},Le.size=function(Xr){return arguments.length?(Me=(ue=Xr)==null?en:null,Le):Me?null:ue},Le.nodeSize=function(Xr){return arguments.length?(Me=(ue=Xr)==null?null:en,Le):Me?ue:null},_u(Le,At)};function Lh(At,jt){return At.parent==jt.parent?1:2}function yh(At){var jt=At.children;return jt.length?jt[0]:At.t}function Ru(At){var jt=At.children,ue;return(ue=jt.length)?jt[ue-1]:At.t}function eu(At,jt,ue){var Me=ue/(jt.i-At.i);jt.c-=Me,jt.s+=ue,At.c+=Me,jt.z+=ue,jt.m+=ue}function xh(At){for(var jt=0,ue=0,Me=At.children,Le=Me.length,Be;--Le>=0;)Be=Me[Le],Be.z+=jt,Be.m+=jt,jt+=Be.s+(ue+=Be.c)}function df(At,jt,ue){return At.a.parent===jt.parent?At.a:ue}c.layout.cluster=function(){var At=c.layout.hierarchy().sort(null).value(null),jt=Lh,ue=[1,1],Me=!1;function Le(Be,sr){var ir=At.call(this,Be,sr),Mr=ir[0],en,Xr=0;gh(Mr,function(Un){var mi=Un.children;mi&&mi.length?(Un.x=qf(mi),Un.y=_h(mi)):(Un.x=en?Xr+=jt(Un,en):0,Un.y=0,en=Un)});var vn=mr(Mr),In=Ur(Mr),On=vn.x-jt(vn,In)/2,Bi=In.x+jt(In,vn)/2;return gh(Mr,Me?function(Un){Un.x=(Un.x-Mr.x)*ue[0],Un.y=(Mr.y-Un.y)*ue[1]}:function(Un){Un.x=(Un.x-On)/(Bi-On)*ue[0],Un.y=(1-(Mr.y?Un.y/Mr.y:1))*ue[1]}),ir}return Le.separation=function(Be){return arguments.length?(jt=Be,Le):jt},Le.size=function(Be){return arguments.length?(Me=(ue=Be)==null,Le):Me?null:ue},Le.nodeSize=function(Be){return arguments.length?(Me=(ue=Be)!=null,Le):Me?ue:null},_u(Le,At)};function _h(At){return 1+c.max(At,function(jt){return jt.y})}function qf(At){return At.reduce(function(jt,ue){return jt+ue.x},0)/At.length}function mr(At){var jt=At.children;return jt&&jt.length?mr(jt[0]):At}function Ur(At){var jt=At.children,ue;return jt&&(ue=jt.length)?Ur(jt[ue-1]):At}c.layout.treemap=function(){var At=c.layout.hierarchy(),jt=Math.round,ue=[1,1],Me=null,Le=_n,Be=!1,sr,ir="squarify",Mr=.5*(1+Math.sqrt(5));function en(Un,mi){for(var Ti=-1,Ii=Un.length,Wi,Yn;++Ti0;)Ii.push(Yn=Wi[Lo-1]),Ii.area+=Yn.area,ir!=="squarify"||(Ha=In(Ii,ro))<=ja?(Wi.pop(),ja=Ha):(Ii.area-=Ii.pop().area,On(Ii,ro,Ti,!1),ro=Math.min(Ti.dx,Ti.dy),Ii.length=Ii.area=0,ja=1/0);Ii.length&&(On(Ii,ro,Ti,!0),Ii.length=Ii.area=0),mi.forEach(Xr)}}function vn(Un){var mi=Un.children;if(mi&&mi.length){var Ti=Le(Un),Ii=mi.slice(),Wi,Yn=[];for(en(Ii,Ti.dx*Ti.dy/Un.value),Yn.area=0;Wi=Ii.pop();)Yn.push(Wi),Yn.area+=Wi.area,Wi.z!=null&&(On(Yn,Wi.z?Ti.dx:Ti.dy,Ti,!Ii.length),Yn.length=Yn.area=0);mi.forEach(vn)}}function In(Un,mi){for(var Ti=Un.area,Ii,Wi=0,Yn=1/0,ja=-1,Ha=Un.length;++jaWi&&(Wi=Ii));return Ti*=Ti,mi*=mi,Ti?Math.max(mi*Wi*Mr/Ti,Ti/(mi*Yn*Mr)):1/0}function On(Un,mi,Ti,Ii){var Wi=-1,Yn=Un.length,ja=Ti.x,Ha=Ti.y,ro=mi?jt(Un.area/mi):0,Lo;if(mi==Ti.dx){for((Ii||ro>Ti.dy)&&(ro=Ti.dy);++WiTi.dx)&&(ro=Ti.dx);++Wi1);return At+jt*Me*Math.sqrt(-2*Math.log(Be)/Be)}},logNormal:function(){var At=c.random.normal.apply(c,arguments);return function(){return Math.exp(At())}},bates:function(At){var jt=c.random.irwinHall(At);return function(){return jt()/At}},irwinHall:function(At){return function(){for(var jt=0,ue=0;ue2?ua:ea,en=Me?Yf:Ld;return Le=Mr(At,jt,en,ue),Be=Mr(jt,At,en,el),ir}function ir(Mr){return Le(Mr)}return ir.invert=function(Mr){return Be(Mr)},ir.domain=function(Mr){return arguments.length?(At=Mr.map(Number),sr()):At},ir.range=function(Mr){return arguments.length?(jt=Mr,sr()):jt},ir.rangeRound=function(Mr){return ir.range(Mr).interpolate(Vh)},ir.clamp=function(Mr){return arguments.length?(Me=Mr,sr()):Me},ir.interpolate=function(Mr){return arguments.length?(ue=Mr,sr()):ue},ir.ticks=function(Mr){return rs(At,Mr)},ir.tickFormat=function(Mr,en){return d3_scale_linearTickFormat(At,Mr,en)},ir.nice=function(Mr){return Ji(At,Mr),sr()},ir.copy=function(){return za(At,jt,ue,Me)},sr()}function wa(At,jt){return c.rebind(At,jt,"range","rangeRound","interpolate","clamp")}function Ji(At,jt){return ga(At,Ra(eo(At,jt)[2])),ga(At,Ra(eo(At,jt)[2])),At}function eo(At,jt){jt==null&&(jt=10);var ue=Wn(At),Me=ue[1]-ue[0],Le=Math.pow(10,Math.floor(Math.log(Me/jt)/Math.LN10)),Be=jt/Me*Le;return Be<=.15?Le*=10:Be<=.35?Le*=5:Be<=.75&&(Le*=2),ue[0]=Math.ceil(ue[0]/Le)*Le,ue[1]=Math.floor(ue[1]/Le)*Le+Le*.5,ue[2]=Le,ue}function rs(At,jt){return c.range.apply(c,eo(At,jt))}c.scale.log=function(){return Zo(c.scale.linear().domain([0,1]),10,!0,[1,10])};function Zo(At,jt,ue,Me){function Le(ir){return(ue?Math.log(ir<0?0:ir):-Math.log(ir>0?0:-ir))/Math.log(jt)}function Be(ir){return ue?Math.pow(jt,ir):-Math.pow(jt,-ir)}function sr(ir){return At(Le(ir))}return sr.invert=function(ir){return Be(At.invert(ir))},sr.domain=function(ir){return arguments.length?(ue=ir[0]>=0,At.domain((Me=ir.map(Number)).map(Le)),sr):Me},sr.base=function(ir){return arguments.length?(jt=+ir,At.domain(Me.map(Le)),sr):jt},sr.nice=function(){var ir=ga(Me.map(Le),ue?Math:os);return At.domain(ir),Me=ir.map(Be),sr},sr.ticks=function(){var ir=Wn(Me),Mr=[],en=ir[0],Xr=ir[1],vn=Math.floor(Le(en)),In=Math.ceil(Le(Xr)),On=jt%1?2:jt;if(isFinite(In-vn)){if(ue){for(;vn0;Bi--)Mr.push(Be(vn)*Bi);for(vn=0;Mr[vn]Xr;In--);Mr=Mr.slice(vn,In)}return Mr},sr.copy=function(){return Zo(At.copy(),jt,ue,Me)},wa(sr,At)}var os={floor:function(At){return-Math.ceil(-At)},ceil:function(At){return-Math.floor(-At)}};c.scale.pow=function(){return fs(c.scale.linear(),1,[0,1])};function fs(At,jt,ue){var Me=no(jt),Le=no(1/jt);function Be(sr){return At(Me(sr))}return Be.invert=function(sr){return Le(At.invert(sr))},Be.domain=function(sr){return arguments.length?(At.domain((ue=sr.map(Number)).map(Me)),Be):ue},Be.ticks=function(sr){return rs(ue,sr)},Be.tickFormat=function(sr,ir){return d3_scale_linearTickFormat(ue,sr,ir)},Be.nice=function(sr){return Be.domain(Ji(ue,sr))},Be.exponent=function(sr){return arguments.length?(Me=no(jt=sr),Le=no(1/jt),At.domain(ue.map(Me)),Be):jt},Be.copy=function(){return fs(At.copy(),jt,ue)},wa(Be,At)}function no(At){return function(jt){return jt<0?-Math.pow(-jt,At):Math.pow(jt,At)}}c.scale.sqrt=function(){return c.scale.pow().exponent(.5)},c.scale.ordinal=function(){return qa([],{t:"range",a:[[]]})};function qa(At,jt){var ue,Me,Le;function Be(ir){return Me[((ue.get(ir)||(jt.t==="range"?ue.set(ir,At.push(ir)):NaN))-1)%Me.length]}function sr(ir,Mr){return c.range(At.length).map(function(en){return ir+Mr*en})}return Be.domain=function(ir){if(!arguments.length)return At;At=[],ue=new C;for(var Mr=-1,en=ir.length,Xr;++Mr0?ue[Be-1]:At[0],BeIn?0:1;if(Xr=Nt)return Mr(Xr,Bi)+(en?Mr(en,1-Bi):"")+"Z";var Un,mi,Ti,Ii,Wi=0,Yn=0,ja,Ha,ro,Lo,Fo,Uo,al,Wo,ps=[];if((Ii=(+sr.apply(this,arguments)||0)/2)&&(Ti=Me===uu?Math.sqrt(en*en+Xr*Xr):+Me.apply(this,arguments),Bi||(Yn*=-1),Xr&&(Yn=qe(Ti/Xr*Math.sin(Ii))),en&&(Wi=qe(Ti/en*Math.sin(Ii)))),Xr){ja=Xr*Math.cos(vn+Yn),Ha=Xr*Math.sin(vn+Yn),ro=Xr*Math.cos(In-Yn),Lo=Xr*Math.sin(In-Yn);var Tl=Math.abs(In-vn-2*Yn)<=gt?0:1;if(Yn&&Hc(ja,Ha,ro,Lo)===Bi^Tl){var Ku=(vn+In)/2;ja=Xr*Math.cos(Ku),Ha=Xr*Math.sin(Ku),ro=Lo=null}}else ja=Ha=0;if(en){Fo=en*Math.cos(In-Wi),Uo=en*Math.sin(In-Wi),al=en*Math.cos(vn+Wi),Wo=en*Math.sin(vn+Wi);var cu=Math.abs(vn-In+2*Wi)<=gt?0:1;if(Wi&&Hc(Fo,Uo,al,Wo)===1-Bi^cu){var _o=(vn+In)/2;Fo=en*Math.cos(_o),Uo=en*Math.sin(_o),al=Wo=null}}else Fo=Uo=0;if(On>ne&&(Un=Math.min(Math.abs(Xr-en)/2,+ue.apply(this,arguments)))>.001){mi=en0?0:1}function Pc(At,jt,ue,Me,Le){var Be=At[0]-jt[0],sr=At[1]-jt[1],ir=(Le?Me:-Me)/Math.sqrt(Be*Be+sr*sr),Mr=ir*sr,en=-ir*Be,Xr=At[0]+Mr,vn=At[1]+en,In=jt[0]+Mr,On=jt[1]+en,Bi=(Xr+In)/2,Un=(vn+On)/2,mi=In-Xr,Ti=On-vn,Ii=mi*mi+Ti*Ti,Wi=ue-Me,Yn=Xr*On-In*vn,ja=(Ti<0?-1:1)*Math.sqrt(Math.max(0,Wi*Wi*Ii-Yn*Yn)),Ha=(Yn*Ti-mi*ja)/Ii,ro=(-Yn*mi-Ti*ja)/Ii,Lo=(Yn*Ti+mi*ja)/Ii,Fo=(-Yn*mi+Ti*ja)/Ii,Uo=Ha-Bi,al=ro-Un,Wo=Lo-Bi,ps=Fo-Un;return Uo*Uo+al*al>Wo*Wo+ps*ps&&(Ha=Lo,ro=Fo),[[Ha-Mr,ro-en],[Ha*ue/Wi,ro*ue/Wi]]}function Ph(){return!0}function Wc(At){var jt=po,ue=Do,Me=Ph,Le=Iu,Be=Le.key,sr=.7;function ir(Mr){var en=[],Xr=[],vn=-1,In=Mr.length,On,Bi=Ee(jt),Un=Ee(ue);function mi(){en.push("M",Le(At(Xr),sr))}for(;++vn1?At.join("L"):At+"Z"}function Ih(At){return At.join("L")+"Z"}function es(At){for(var jt=0,ue=At.length,Me=At[0],Le=[Me[0],",",Me[1]];++jt1&&Le.push("H",Me[0]),Le.join("")}function zs(At){for(var jt=0,ue=At.length,Me=At[0],Le=[Me[0],",",Me[1]];++jt1){ir=jt[1],Be=At[Mr],Mr++,Me+="C"+(Le[0]+sr[0])+","+(Le[1]+sr[1])+","+(Be[0]-ir[0])+","+(Be[1]-ir[1])+","+Be[0]+","+Be[1];for(var en=2;en9&&(Be=ue*3/Math.sqrt(Be),sr[ir]=Be*Me,sr[ir+1]=Be*Le));for(ir=-1;++ir<=Mr;)Be=(At[Math.min(Mr,ir+1)][0]-At[Math.max(0,ir-1)][0])/(6*(1+sr[ir]*sr[ir])),jt.push([Be||0,sr[ir]*Be||0]);return jt}function ae(At){return At.length<3?Iu(At):At[0]+I(At,Xt(At))}c.svg.line.radial=function(){var At=Wc(xe);return At.radius=At.x,delete At.x,At.angle=At.y,delete At.y,At};function xe(At){for(var jt,ue=-1,Me=At.length,Le,Be;++uegt)+",1 "+vn}function en(Xr,vn,In,On){return"Q 0,0 "+On}return Be.radius=function(Xr){return arguments.length?(ue=Ee(Xr),Be):ue},Be.source=function(Xr){return arguments.length?(At=Ee(Xr),Be):At},Be.target=function(Xr){return arguments.length?(jt=Ee(Xr),Be):jt},Be.startAngle=function(Xr){return arguments.length?(Me=Ee(Xr),Be):Me},Be.endAngle=function(Xr){return arguments.length?(Le=Ee(Xr),Be):Le},Be};function Ze(At){return At.radius}c.svg.diagonal=function(){var At=je,jt=Ie,ue=wr;function Me(Le,Be){var sr=At.call(this,Le,Be),ir=jt.call(this,Le,Be),Mr=(sr.y+ir.y)/2,en=[sr,{x:sr.x,y:Mr},{x:ir.x,y:Mr},ir];return en=en.map(ue),"M"+en[0]+"C"+en[1]+" "+en[2]+" "+en[3]}return Me.source=function(Le){return arguments.length?(At=Ee(Le),Me):At},Me.target=function(Le){return arguments.length?(jt=Ee(Le),Me):jt},Me.projection=function(Le){return arguments.length?(ue=Le,Me):ue},Me};function wr(At){return[At.x,At.y]}c.svg.diagonal.radial=function(){var At=c.svg.diagonal(),jt=wr,ue=At.projection;return At.projection=function(Me){return arguments.length?ue(Ir(jt=Me)):jt},At};function Ir(At){return function(){var jt=At.apply(this,arguments),ue=jt[0],Me=jt[1]-ee;return[ue*Math.cos(Me),ue*Math.sin(Me)]}}c.svg.symbol=function(){var At=tn,jt=Nr;function ue(Me,Le){return(zn.get(At.call(this,Me,Le))||mn)(jt.call(this,Me,Le))}return ue.type=function(Me){return arguments.length?(At=Ee(Me),ue):At},ue.size=function(Me){return arguments.length?(jt=Ee(Me),ue):jt},ue};function Nr(){return 64}function tn(){return"circle"}function mn(At){var jt=Math.sqrt(At/gt);return"M0,"+jt+"A"+jt+","+jt+" 0 1,1 0,"+-jt+"A"+jt+","+jt+" 0 1,1 0,"+jt+"Z"}var zn=c.map({circle:mn,cross:function(At){var jt=Math.sqrt(At/5)/2;return"M"+-3*jt+","+-jt+"H"+-jt+"V"+-3*jt+"H"+jt+"V"+-jt+"H"+3*jt+"V"+jt+"H"+jt+"V"+3*jt+"H"+-jt+"V"+jt+"H"+-3*jt+"Z"},diamond:function(At){var jt=Math.sqrt(At/(2*ri)),ue=jt*ri;return"M0,"+-jt+"L"+ue+",0 0,"+jt+" "+-ue+",0Z"},square:function(At){var jt=Math.sqrt(At)/2;return"M"+-jt+","+-jt+"L"+jt+","+-jt+" "+jt+","+jt+" "+-jt+","+jt+"Z"},"triangle-down":function(At){var jt=Math.sqrt(At/Bn),ue=jt*Bn/2;return"M0,"+ue+"L"+jt+","+-ue+" "+-jt+","+-ue+"Z"},"triangle-up":function(At){var jt=Math.sqrt(At/Bn),ue=jt*Bn/2;return"M0,"+-ue+"L"+jt+","+ue+" "+-jt+","+ue+"Z"}});c.svg.symbolTypes=zn.keys();var Bn=Math.sqrt(3),ri=Math.tan(30*le);it.transition=function(At){for(var jt=Ro||++io,ue=vl(At),Me=[],Le,Be,sr=Mo||{time:Date.now(),ease:Jo,delay:0,duration:250},ir=-1,Mr=this.length;++ir0;)vn[--Ii].call(At,Ti);if(mi>=1)return sr.event&&sr.event.end.call(At,At.__data__,jt),--Be.count?delete Be[Me]:delete At[ue],1}sr||(ir=Le.time,Mr=Ri(In,0,ir),sr=Be[Me]={tween:new C,time:ir,timer:Mr,delay:Le.delay,duration:Le.duration,ease:Le.ease,index:jt},Le=null,++Be.count)}c.svg.axis=function(){var At=c.scale.linear(),jt=bl,ue=6,Me=6,Le=3,Be=[10],sr=null,ir;function Mr(en){en.each(function(){var Xr=c.select(this),vn=this.__chart__||At,In=this.__chart__=At.copy(),On=sr??(In.ticks?In.ticks.apply(In,Be):In.domain()),Bi=ir??(In.tickFormat?In.tickFormat.apply(In,Be):V),Un=Xr.selectAll(".tick").data(On,In),mi=Un.enter().insert("g",".domain").attr("class","tick").style("opacity",ne),Ti=c.transition(Un.exit()).style("opacity",ne).remove(),Ii=c.transition(Un.order()).style("opacity",1),Wi=Math.max(ue,0)+Le,Yn,ja=hi(In),Ha=Xr.selectAll(".domain").data([0]),ro=(Ha.enter().append("path").attr("class","domain"),c.transition(Ha));mi.append("line"),mi.append("text");var Lo=mi.select("line"),Fo=Ii.select("line"),Uo=Un.select("text").text(Bi),al=mi.select("text"),Wo=Ii.select("text"),ps=jt==="top"||jt==="left"?-1:1,Tl,Ku,cu,_o;if(jt==="bottom"||jt==="top"?(Yn=mu,Tl="x",cu="y",Ku="x2",_o="y2",Uo.attr("dy",ps<0?"0em":".71em").style("text-anchor","middle"),ro.attr("d","M"+ja[0]+","+ps*Me+"V0H"+ja[1]+"V"+ps*Me)):(Yn=Ws,Tl="y",cu="x",Ku="y2",_o="x2",Uo.attr("dy",".32em").style("text-anchor",ps<0?"end":"start"),ro.attr("d","M"+ps*Me+","+ja[0]+"H0V"+ja[1]+"H"+ps*Me)),Lo.attr(_o,ps*ue),al.attr(cu,ps*Wi),Fo.attr(Ku,0).attr(_o,ps*ue),Wo.attr(Tl,0).attr(cu,ps*Wi),In.rangeBand){var Zs=In,rl=Zs.rangeBand()/2;vn=In=function(ou){return Zs(ou)+rl}}else vn.rangeBand?vn=In:Ti.call(Yn,In,vn);mi.call(Yn,vn,In),Ii.call(Yn,In,In)})}return Mr.scale=function(en){return arguments.length?(At=en,Mr):At},Mr.orient=function(en){return arguments.length?(jt=en in Su?en+"":bl,Mr):jt},Mr.ticks=function(){return arguments.length?(Be=P(arguments),Mr):Be},Mr.tickValues=function(en){return arguments.length?(sr=en,Mr):sr},Mr.tickFormat=function(en){return arguments.length?(ir=en,Mr):ir},Mr.tickSize=function(en){var Xr=arguments.length;return Xr?(ue=+en,Me=+arguments[Xr-1],Mr):ue},Mr.innerTickSize=function(en){return arguments.length?(ue=+en,Mr):ue},Mr.outerTickSize=function(en){return arguments.length?(Me=+en,Mr):Me},Mr.tickPadding=function(en){return arguments.length?(Le=+en,Mr):Le},Mr.tickSubdivide=function(){return arguments.length&&Mr},Mr};var bl="bottom",Su={top:1,right:1,bottom:1,left:1};function mu(At,jt,ue){At.attr("transform",function(Me){var Le=jt(Me);return"translate("+(isFinite(Le)?Le:ue(Me))+",0)"})}function Ws(At,jt,ue){At.attr("transform",function(Me){var Le=jt(Me);return"translate(0,"+(isFinite(Le)?Le:ue(Me))+")"})}c.svg.brush=function(){var At=pt(Xr,"brushstart","brush","brushend"),jt=null,ue=null,Me=[0,0],Le=[0,0],Be,sr,ir=!0,Mr=!0,en=Yu[0];function Xr(Un){Un.each(function(){var mi=c.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",Bi).on("touchstart.brush",Bi),Ti=mi.selectAll(".background").data([0]);Ti.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),mi.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var Ii=mi.selectAll(".resize").data(en,V);Ii.exit().remove(),Ii.enter().append("g").attr("class",function(Ha){return"resize "+Ha}).style("cursor",function(Ha){return qs[Ha]}).append("rect").attr("x",function(Ha){return/[ew]$/.test(Ha)?-3:null}).attr("y",function(Ha){return/^[ns]/.test(Ha)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),Ii.style("display",Xr.empty()?"none":null);var Wi=c.transition(mi),Yn=c.transition(Ti),ja;jt&&(ja=hi(jt),Yn.attr("x",ja[0]).attr("width",ja[1]-ja[0]),In(Wi)),ue&&(ja=hi(ue),Yn.attr("y",ja[0]).attr("height",ja[1]-ja[0]),On(Wi)),vn(Wi)})}Xr.event=function(Un){Un.each(function(){var mi=At.of(this,arguments),Ti={x:Me,y:Le,i:Be,j:sr},Ii=this.__chart__||Ti;this.__chart__=Ti,Ro?c.select(this).transition().each("start.brush",function(){Be=Ii.i,sr=Ii.j,Me=Ii.x,Le=Ii.y,mi({type:"brushstart"})}).tween("brush:brush",function(){var Wi=Zl(Me,Ti.x),Yn=Zl(Le,Ti.y);return Be=sr=null,function(ja){Me=Ti.x=Wi(ja),Le=Ti.y=Yn(ja),mi({type:"brush",mode:"resize"})}}).each("end.brush",function(){Be=Ti.i,sr=Ti.j,mi({type:"brush",mode:"resize"}),mi({type:"brushend"})}):(mi({type:"brushstart"}),mi({type:"brush",mode:"resize"}),mi({type:"brushend"}))})};function vn(Un){Un.selectAll(".resize").attr("transform",function(mi){return"translate("+Me[+/e$/.test(mi)]+","+Le[+/^s/.test(mi)]+")"})}function In(Un){Un.select(".extent").attr("x",Me[0]),Un.selectAll(".extent,.n>rect,.s>rect").attr("width",Me[1]-Me[0])}function On(Un){Un.select(".extent").attr("y",Le[0]),Un.selectAll(".extent,.e>rect,.w>rect").attr("height",Le[1]-Le[0])}function Bi(){var Un=this,mi=c.select(c.event.target),Ti=At.of(Un,arguments),Ii=c.select(Un),Wi=mi.datum(),Yn=!/^(n|s)$/.test(Wi)&&jt,ja=!/^(e|w)$/.test(Wi)&&ue,Ha=mi.classed("extent"),ro=Kr(Un),Lo,Fo=c.mouse(Un),Uo,al=c.select(e(Un)).on("keydown.brush",Tl).on("keyup.brush",Ku);if(c.event.changedTouches?al.on("touchmove.brush",cu).on("touchend.brush",Zs):al.on("mousemove.brush",cu).on("mouseup.brush",Zs),Ii.interrupt().selectAll("*").interrupt(),Ha)Fo[0]=Me[0]-Fo[0],Fo[1]=Le[0]-Fo[1];else if(Wi){var Wo=+/w$/.test(Wi),ps=+/^n/.test(Wi);Uo=[Me[1-Wo]-Fo[0],Le[1-ps]-Fo[1]],Fo[0]=Me[Wo],Fo[1]=Le[ps]}else c.event.altKey&&(Lo=Fo.slice());Ii.style("pointer-events","none").selectAll(".resize").style("display",null),c.select("body").style("cursor",mi.style("cursor")),Ti({type:"brushstart"}),cu();function Tl(){c.event.keyCode==32&&(Ha||(Lo=null,Fo[0]-=Me[1],Fo[1]-=Le[1],Ha=2),lt())}function Ku(){c.event.keyCode==32&&Ha==2&&(Fo[0]+=Me[1],Fo[1]+=Le[1],Ha=0,lt())}function cu(){var rl=c.mouse(Un),ou=!1;Uo&&(rl[0]+=Uo[0],rl[1]+=Uo[1]),Ha||(c.event.altKey?(Lo||(Lo=[(Me[0]+Me[1])/2,(Le[0]+Le[1])/2]),Fo[0]=Me[+(rl[0]{(function(c,g){typeof Q=="object"&&typeof $<"u"?g(Q):(c=c||self,g(c.d3=c.d3||{}))})(Q,function(c){var g=new Date,P=new Date;function S(Mt,te,ve,oe){function Te(He){return Mt(He=arguments.length===0?new Date:new Date(+He)),He}return Te.floor=function(He){return Mt(He=new Date(+He)),He},Te.ceil=function(He){return Mt(He=new Date(He-1)),te(He,1),Mt(He),He},Te.round=function(He){var Ge=Te(He),cr=Te.ceil(He);return He-Ge0))return ur;do ur.push(jr=new Date(+He)),te(He,cr),Mt(He);while(jr=Ge)for(;Mt(Ge),!He(Ge);)Ge.setTime(Ge-1)},function(Ge,cr){if(Ge>=Ge)if(cr<0)for(;++cr<=0;)for(;te(Ge,-1),!He(Ge););else for(;--cr>=0;)for(;te(Ge,1),!He(Ge););})},ve&&(Te.count=function(He,Ge){return g.setTime(+He),P.setTime(+Ge),Mt(g),Mt(P),Math.floor(ve(g,P))},Te.every=function(He){return He=Math.floor(He),!isFinite(He)||!(He>0)?null:He>1?Te.filter(oe?function(Ge){return oe(Ge)%He===0}:function(Ge){return Te.count(0,Ge)%He===0}):Te}),Te}var t=S(function(){},function(Mt,te){Mt.setTime(+Mt+te)},function(Mt,te){return te-Mt});t.every=function(Mt){return Mt=Math.floor(Mt),!isFinite(Mt)||!(Mt>0)?null:Mt>1?S(function(te){te.setTime(Math.floor(te/Mt)*Mt)},function(te,ve){te.setTime(+te+ve*Mt)},function(te,ve){return(ve-te)/Mt}):t};var e=t.range,r=1e3,a=6e4,n=36e5,o=864e5,i=6048e5,s=S(function(Mt){Mt.setTime(Mt-Mt.getMilliseconds())},function(Mt,te){Mt.setTime(+Mt+te*r)},function(Mt,te){return(te-Mt)/r},function(Mt){return Mt.getUTCSeconds()}),f=s.range,x=S(function(Mt){Mt.setTime(Mt-Mt.getMilliseconds()-Mt.getSeconds()*r)},function(Mt,te){Mt.setTime(+Mt+te*a)},function(Mt,te){return(te-Mt)/a},function(Mt){return Mt.getMinutes()}),y=x.range,v=S(function(Mt){Mt.setTime(Mt-Mt.getMilliseconds()-Mt.getSeconds()*r-Mt.getMinutes()*a)},function(Mt,te){Mt.setTime(+Mt+te*n)},function(Mt,te){return(te-Mt)/n},function(Mt){return Mt.getHours()}),T=v.range,u=S(function(Mt){Mt.setHours(0,0,0,0)},function(Mt,te){Mt.setDate(Mt.getDate()+te)},function(Mt,te){return(te-Mt-(te.getTimezoneOffset()-Mt.getTimezoneOffset())*a)/o},function(Mt){return Mt.getDate()-1}),b=u.range;function _(Mt){return S(function(te){te.setDate(te.getDate()-(te.getDay()+7-Mt)%7),te.setHours(0,0,0,0)},function(te,ve){te.setDate(te.getDate()+ve*7)},function(te,ve){return(ve-te-(ve.getTimezoneOffset()-te.getTimezoneOffset())*a)/i})}var C=_(0),M=_(1),E=_(2),A=_(3),h=_(4),p=_(5),k=_(6),w=C.range,R=M.range,O=E.range,N=A.range,V=h.range,H=p.range,F=k.range,U=S(function(Mt){Mt.setDate(1),Mt.setHours(0,0,0,0)},function(Mt,te){Mt.setMonth(Mt.getMonth()+te)},function(Mt,te){return te.getMonth()-Mt.getMonth()+(te.getFullYear()-Mt.getFullYear())*12},function(Mt){return Mt.getMonth()}),W=U.range,q=S(function(Mt){Mt.setMonth(0,1),Mt.setHours(0,0,0,0)},function(Mt,te){Mt.setFullYear(Mt.getFullYear()+te)},function(Mt,te){return te.getFullYear()-Mt.getFullYear()},function(Mt){return Mt.getFullYear()});q.every=function(Mt){return!isFinite(Mt=Math.floor(Mt))||!(Mt>0)?null:S(function(te){te.setFullYear(Math.floor(te.getFullYear()/Mt)*Mt),te.setMonth(0,1),te.setHours(0,0,0,0)},function(te,ve){te.setFullYear(te.getFullYear()+ve*Mt)})};var X=q.range,lt=S(function(Mt){Mt.setUTCSeconds(0,0)},function(Mt,te){Mt.setTime(+Mt+te*a)},function(Mt,te){return(te-Mt)/a},function(Mt){return Mt.getUTCMinutes()}),yt=lt.range,pt=S(function(Mt){Mt.setUTCMinutes(0,0,0)},function(Mt,te){Mt.setTime(+Mt+te*n)},function(Mt,te){return(te-Mt)/n},function(Mt){return Mt.getUTCHours()}),st=pt.range,tt=S(function(Mt){Mt.setUTCHours(0,0,0,0)},function(Mt,te){Mt.setUTCDate(Mt.getUTCDate()+te)},function(Mt,te){return(te-Mt)/o},function(Mt){return Mt.getUTCDate()-1}),dt=tt.range;function rt(Mt){return S(function(te){te.setUTCDate(te.getUTCDate()-(te.getUTCDay()+7-Mt)%7),te.setUTCHours(0,0,0,0)},function(te,ve){te.setUTCDate(te.getUTCDate()+ve*7)},function(te,ve){return(ve-te)/i})}var at=rt(0),vt=rt(1),it=rt(2),Y=rt(3),ft=rt(4),ut=rt(5),wt=rt(6),zt=at.range,Pt=vt.range,Wt=it.range,Ht=Y.range,Jt=ft.range,ge=ut.range,he=wt.range,de=S(function(Mt){Mt.setUTCDate(1),Mt.setUTCHours(0,0,0,0)},function(Mt,te){Mt.setUTCMonth(Mt.getUTCMonth()+te)},function(Mt,te){return te.getUTCMonth()-Mt.getUTCMonth()+(te.getUTCFullYear()-Mt.getUTCFullYear())*12},function(Mt){return Mt.getUTCMonth()}),se=de.range,Tt=S(function(Mt){Mt.setUTCMonth(0,1),Mt.setUTCHours(0,0,0,0)},function(Mt,te){Mt.setUTCFullYear(Mt.getUTCFullYear()+te)},function(Mt,te){return te.getUTCFullYear()-Mt.getUTCFullYear()},function(Mt){return Mt.getUTCFullYear()});Tt.every=function(Mt){return!isFinite(Mt=Math.floor(Mt))||!(Mt>0)?null:S(function(te){te.setUTCFullYear(Math.floor(te.getUTCFullYear()/Mt)*Mt),te.setUTCMonth(0,1),te.setUTCHours(0,0,0,0)},function(te,ve){te.setUTCFullYear(te.getUTCFullYear()+ve*Mt)})};var Lt=Tt.range;c.timeDay=u,c.timeDays=b,c.timeFriday=p,c.timeFridays=H,c.timeHour=v,c.timeHours=T,c.timeInterval=S,c.timeMillisecond=t,c.timeMilliseconds=e,c.timeMinute=x,c.timeMinutes=y,c.timeMonday=M,c.timeMondays=R,c.timeMonth=U,c.timeMonths=W,c.timeSaturday=k,c.timeSaturdays=F,c.timeSecond=s,c.timeSeconds=f,c.timeSunday=C,c.timeSundays=w,c.timeThursday=h,c.timeThursdays=V,c.timeTuesday=E,c.timeTuesdays=O,c.timeWednesday=A,c.timeWednesdays=N,c.timeWeek=C,c.timeWeeks=w,c.timeYear=q,c.timeYears=X,c.utcDay=tt,c.utcDays=dt,c.utcFriday=ut,c.utcFridays=ge,c.utcHour=pt,c.utcHours=st,c.utcMillisecond=t,c.utcMilliseconds=e,c.utcMinute=lt,c.utcMinutes=yt,c.utcMonday=vt,c.utcMondays=Pt,c.utcMonth=de,c.utcMonths=se,c.utcSaturday=wt,c.utcSaturdays=he,c.utcSecond=s,c.utcSeconds=f,c.utcSunday=at,c.utcSundays=zt,c.utcThursday=ft,c.utcThursdays=Jt,c.utcTuesday=it,c.utcTuesdays=Wt,c.utcWednesday=Y,c.utcWednesdays=Ht,c.utcWeek=at,c.utcWeeks=zt,c.utcYear=Tt,c.utcYears=Lt,Object.defineProperty(c,"__esModule",{value:!0})})}),fa=Ft((Q,$)=>{(function(c,g){typeof Q=="object"&&typeof $<"u"?g(Q,ia()):(c=c||self,g(c.d3=c.d3||{},c.d3))})(Q,function(c,g){function P($t){if(0<=$t.y&&$t.y<100){var ne=new Date(-1,$t.m,$t.d,$t.H,$t.M,$t.S,$t.L);return ne.setFullYear($t.y),ne}return new Date($t.y,$t.m,$t.d,$t.H,$t.M,$t.S,$t.L)}function S($t){if(0<=$t.y&&$t.y<100){var ne=new Date(Date.UTC(-1,$t.m,$t.d,$t.H,$t.M,$t.S,$t.L));return ne.setUTCFullYear($t.y),ne}return new Date(Date.UTC($t.y,$t.m,$t.d,$t.H,$t.M,$t.S,$t.L))}function t($t,ne,Ct){return{y:$t,m:ne,d:Ct,H:0,M:0,S:0,L:0}}function e($t){var ne=$t.dateTime,Ct=$t.date,gt=$t.time,St=$t.periods,Nt=$t.days,ee=$t.shortDays,le=$t.months,we=$t.shortMonths,Ue=f(St),qe=x(St),ar=f(Nt),Ar=x(Nt),Tr=f(ee),pr=x(ee),Jr=f(le),Vn=x(le),Hn=f(we),Kn=x(we),Ci={a:xi,A:Pi,b:Di,B:Zi,c:null,d:U,e:U,f:yt,H:W,I:q,j:X,L:lt,m:pt,M:st,p:ui,q:Pa,Q:Ge,s:cr,S:tt,u:dt,U:rt,V:at,w:vt,W:it,x:null,X:null,y:Y,Y:ft,Z:ut,"%":He},ii={a:Wa,A:ze,b:Pe,B:Rr,c:null,d:wt,e:wt,f:Jt,H:zt,I:Pt,j:Wt,L:Ht,m:ge,M:he,p:qr,q:$r,Q:Ge,s:cr,S:de,u:se,U:Tt,V:Lt,w:Mt,W:te,x:null,X:null,y:ve,Y:oe,Z:Te,"%":He},qn={a:fr,A:xr,b:Qr,B:Cn,c:wn,d:h,e:h,f:N,H:k,I:k,j:p,L:O,m:A,M:w,p:rr,q:E,Q:H,s:F,S:R,u:v,U:T,V:u,w:y,W:b,x:Mn,X:ci,y:C,Y:_,Z:M,"%":V};Ci.x=oa(Ct,Ci),Ci.X=oa(gt,Ci),Ci.c=oa(ne,Ci),ii.x=oa(Ct,ii),ii.X=oa(gt,ii),ii.c=oa(ne,ii);function oa(Br,Gr){return function(dn){var an=[],Ee=-1,dr=0,Vr=Br.length,yn,Fn,Xn;for(dn instanceof Date||(dn=new Date(+dn));++Ee53)return null;"w"in an||(an.w=1),"Z"in an?(dr=S(t(an.y,0,1)),Vr=dr.getUTCDay(),dr=Vr>4||Vr===0?g.utcMonday.ceil(dr):g.utcMonday(dr),dr=g.utcDay.offset(dr,(an.V-1)*7),an.y=dr.getUTCFullYear(),an.m=dr.getUTCMonth(),an.d=dr.getUTCDate()+(an.w+6)%7):(dr=P(t(an.y,0,1)),Vr=dr.getDay(),dr=Vr>4||Vr===0?g.timeMonday.ceil(dr):g.timeMonday(dr),dr=g.timeDay.offset(dr,(an.V-1)*7),an.y=dr.getFullYear(),an.m=dr.getMonth(),an.d=dr.getDate()+(an.w+6)%7)}else("W"in an||"U"in an)&&("w"in an||(an.w="u"in an?an.u%7:"W"in an?1:0),Vr="Z"in an?S(t(an.y,0,1)).getUTCDay():P(t(an.y,0,1)).getDay(),an.m=0,an.d="W"in an?(an.w+6)%7+an.W*7-(Vr+5)%7:an.w+an.U*7-(Vr+6)%7);return"Z"in an?(an.H+=an.Z/100|0,an.M+=an.Z%100,S(an)):P(an)}}function We(Br,Gr,dn,an){for(var Ee=0,dr=Gr.length,Vr=dn.length,yn,Fn;Ee=Vr)return-1;if(yn=Gr.charCodeAt(Ee++),yn===37){if(yn=Gr.charAt(Ee++),Fn=qn[yn in r?Gr.charAt(Ee++):yn],!Fn||(an=Fn(Br,dn,an))<0)return-1}else if(yn!=dn.charCodeAt(an++))return-1}return an}function rr(Br,Gr,dn){var an=Ue.exec(Gr.slice(dn));return an?(Br.p=qe[an[0].toLowerCase()],dn+an[0].length):-1}function fr(Br,Gr,dn){var an=Tr.exec(Gr.slice(dn));return an?(Br.w=pr[an[0].toLowerCase()],dn+an[0].length):-1}function xr(Br,Gr,dn){var an=ar.exec(Gr.slice(dn));return an?(Br.w=Ar[an[0].toLowerCase()],dn+an[0].length):-1}function Qr(Br,Gr,dn){var an=Hn.exec(Gr.slice(dn));return an?(Br.m=Kn[an[0].toLowerCase()],dn+an[0].length):-1}function Cn(Br,Gr,dn){var an=Jr.exec(Gr.slice(dn));return an?(Br.m=Vn[an[0].toLowerCase()],dn+an[0].length):-1}function wn(Br,Gr,dn){return We(Br,ne,Gr,dn)}function Mn(Br,Gr,dn){return We(Br,Ct,Gr,dn)}function ci(Br,Gr,dn){return We(Br,gt,Gr,dn)}function xi(Br){return ee[Br.getDay()]}function Pi(Br){return Nt[Br.getDay()]}function Di(Br){return we[Br.getMonth()]}function Zi(Br){return le[Br.getMonth()]}function ui(Br){return St[+(Br.getHours()>=12)]}function Pa(Br){return 1+~~(Br.getMonth()/3)}function Wa(Br){return ee[Br.getUTCDay()]}function ze(Br){return Nt[Br.getUTCDay()]}function Pe(Br){return we[Br.getUTCMonth()]}function Rr(Br){return le[Br.getUTCMonth()]}function qr(Br){return St[+(Br.getUTCHours()>=12)]}function $r(Br){return 1+~~(Br.getUTCMonth()/3)}return{format:function(Br){var Gr=oa(Br+="",Ci);return Gr.toString=function(){return Br},Gr},parse:function(Br){var Gr=Hi(Br+="",!1);return Gr.toString=function(){return Br},Gr},utcFormat:function(Br){var Gr=oa(Br+="",ii);return Gr.toString=function(){return Br},Gr},utcParse:function(Br){var Gr=Hi(Br+="",!0);return Gr.toString=function(){return Br},Gr}}}var r={"-":"",_:" ",0:"0"},a=/^\s*\d+/,n=/^%/,o=/[\\^$*+?|[\]().{}]/g;function i($t,ne,Ct){var gt=$t<0?"-":"",St=(gt?-$t:$t)+"",Nt=St.length;return gt+(Nt68?1900:2e3),Ct+gt[0].length):-1}function M($t,ne,Ct){var gt=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(ne.slice(Ct,Ct+6));return gt?($t.Z=gt[1]?0:-(gt[2]+(gt[3]||"00")),Ct+gt[0].length):-1}function E($t,ne,Ct){var gt=a.exec(ne.slice(Ct,Ct+1));return gt?($t.q=gt[0]*3-3,Ct+gt[0].length):-1}function A($t,ne,Ct){var gt=a.exec(ne.slice(Ct,Ct+2));return gt?($t.m=gt[0]-1,Ct+gt[0].length):-1}function h($t,ne,Ct){var gt=a.exec(ne.slice(Ct,Ct+2));return gt?($t.d=+gt[0],Ct+gt[0].length):-1}function p($t,ne,Ct){var gt=a.exec(ne.slice(Ct,Ct+3));return gt?($t.m=0,$t.d=+gt[0],Ct+gt[0].length):-1}function k($t,ne,Ct){var gt=a.exec(ne.slice(Ct,Ct+2));return gt?($t.H=+gt[0],Ct+gt[0].length):-1}function w($t,ne,Ct){var gt=a.exec(ne.slice(Ct,Ct+2));return gt?($t.M=+gt[0],Ct+gt[0].length):-1}function R($t,ne,Ct){var gt=a.exec(ne.slice(Ct,Ct+2));return gt?($t.S=+gt[0],Ct+gt[0].length):-1}function O($t,ne,Ct){var gt=a.exec(ne.slice(Ct,Ct+3));return gt?($t.L=+gt[0],Ct+gt[0].length):-1}function N($t,ne,Ct){var gt=a.exec(ne.slice(Ct,Ct+6));return gt?($t.L=Math.floor(gt[0]/1e3),Ct+gt[0].length):-1}function V($t,ne,Ct){var gt=n.exec(ne.slice(Ct,Ct+1));return gt?Ct+gt[0].length:-1}function H($t,ne,Ct){var gt=a.exec(ne.slice(Ct));return gt?($t.Q=+gt[0],Ct+gt[0].length):-1}function F($t,ne,Ct){var gt=a.exec(ne.slice(Ct));return gt?($t.s=+gt[0],Ct+gt[0].length):-1}function U($t,ne){return i($t.getDate(),ne,2)}function W($t,ne){return i($t.getHours(),ne,2)}function q($t,ne){return i($t.getHours()%12||12,ne,2)}function X($t,ne){return i(1+g.timeDay.count(g.timeYear($t),$t),ne,3)}function lt($t,ne){return i($t.getMilliseconds(),ne,3)}function yt($t,ne){return lt($t,ne)+"000"}function pt($t,ne){return i($t.getMonth()+1,ne,2)}function st($t,ne){return i($t.getMinutes(),ne,2)}function tt($t,ne){return i($t.getSeconds(),ne,2)}function dt($t){var ne=$t.getDay();return ne===0?7:ne}function rt($t,ne){return i(g.timeSunday.count(g.timeYear($t)-1,$t),ne,2)}function at($t,ne){var Ct=$t.getDay();return $t=Ct>=4||Ct===0?g.timeThursday($t):g.timeThursday.ceil($t),i(g.timeThursday.count(g.timeYear($t),$t)+(g.timeYear($t).getDay()===4),ne,2)}function vt($t){return $t.getDay()}function it($t,ne){return i(g.timeMonday.count(g.timeYear($t)-1,$t),ne,2)}function Y($t,ne){return i($t.getFullYear()%100,ne,2)}function ft($t,ne){return i($t.getFullYear()%1e4,ne,4)}function ut($t){var ne=$t.getTimezoneOffset();return(ne>0?"-":(ne*=-1,"+"))+i(ne/60|0,"0",2)+i(ne%60,"0",2)}function wt($t,ne){return i($t.getUTCDate(),ne,2)}function zt($t,ne){return i($t.getUTCHours(),ne,2)}function Pt($t,ne){return i($t.getUTCHours()%12||12,ne,2)}function Wt($t,ne){return i(1+g.utcDay.count(g.utcYear($t),$t),ne,3)}function Ht($t,ne){return i($t.getUTCMilliseconds(),ne,3)}function Jt($t,ne){return Ht($t,ne)+"000"}function ge($t,ne){return i($t.getUTCMonth()+1,ne,2)}function he($t,ne){return i($t.getUTCMinutes(),ne,2)}function de($t,ne){return i($t.getUTCSeconds(),ne,2)}function se($t){var ne=$t.getUTCDay();return ne===0?7:ne}function Tt($t,ne){return i(g.utcSunday.count(g.utcYear($t)-1,$t),ne,2)}function Lt($t,ne){var Ct=$t.getUTCDay();return $t=Ct>=4||Ct===0?g.utcThursday($t):g.utcThursday.ceil($t),i(g.utcThursday.count(g.utcYear($t),$t)+(g.utcYear($t).getUTCDay()===4),ne,2)}function Mt($t){return $t.getUTCDay()}function te($t,ne){return i(g.utcMonday.count(g.utcYear($t)-1,$t),ne,2)}function ve($t,ne){return i($t.getUTCFullYear()%100,ne,2)}function oe($t,ne){return i($t.getUTCFullYear()%1e4,ne,4)}function Te(){return"+0000"}function He(){return"%"}function Ge($t){return+$t}function cr($t){return Math.floor(+$t/1e3)}var ur;jr({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function jr($t){return ur=e($t),c.timeFormat=ur.format,c.timeParse=ur.parse,c.utcFormat=ur.utcFormat,c.utcParse=ur.utcParse,ur}var Hr="%Y-%m-%dT%H:%M:%S.%LZ";function br($t){return $t.toISOString()}var Kr=Date.prototype.toISOString?br:c.utcFormat(Hr);function rn($t){var ne=new Date($t);return isNaN(ne)?null:ne}var Ce=+new Date("2000-01-01T00:00:00.000Z")?rn:c.utcParse(Hr);c.isoFormat=Kr,c.isoParse=Ce,c.timeFormatDefaultLocale=jr,c.timeFormatLocale=e,Object.defineProperty(c,"__esModule",{value:!0})})}),Li=Ft((Q,$)=>{(function(c,g){typeof Q=="object"&&typeof $<"u"?g(Q):(c=typeof globalThis<"u"?globalThis:c||self,g(c.d3=c.d3||{}))})(Q,function(c){function g(A){return Math.abs(A=Math.round(A))>=1e21?A.toLocaleString("en").replace(/,/g,""):A.toString(10)}function P(A,h){if((p=(A=h?A.toExponential(h-1):A.toExponential()).indexOf("e"))<0)return null;var p,k=A.slice(0,p);return[k.length>1?k[0]+k.slice(2):k,+A.slice(p+1)]}function S(A){return A=P(Math.abs(A)),A?A[1]:NaN}function t(A,h){return function(p,k){for(var w=p.length,R=[],O=0,N=A[0],V=0;w>0&&N>0&&(V+N+1>k&&(N=Math.max(1,k-V)),R.push(p.substring(w-=N,w+N)),!((V+=N+1)>k));)N=A[O=(O+1)%A.length];return R.reverse().join(h)}}function e(A){return function(h){return h.replace(/[0-9]/g,function(p){return A[+p]})}}var r=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function a(A){if(!(h=r.exec(A)))throw new Error("invalid format: "+A);var h;return new n({fill:h[1],align:h[2],sign:h[3],symbol:h[4],zero:h[5],width:h[6],comma:h[7],precision:h[8]&&h[8].slice(1),trim:h[9],type:h[10]})}a.prototype=n.prototype;function n(A){this.fill=A.fill===void 0?" ":A.fill+"",this.align=A.align===void 0?">":A.align+"",this.sign=A.sign===void 0?"-":A.sign+"",this.symbol=A.symbol===void 0?"":A.symbol+"",this.zero=!!A.zero,this.width=A.width===void 0?void 0:+A.width,this.comma=!!A.comma,this.precision=A.precision===void 0?void 0:+A.precision,this.trim=!!A.trim,this.type=A.type===void 0?"":A.type+""}n.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function o(A){t:for(var h=A.length,p=1,k=-1,w;p0&&(k=0);break}return k>0?A.slice(0,k)+A.slice(w+1):A}var i;function s(A,h){var p=P(A,h);if(!p)return A+"";var k=p[0],w=p[1],R=w-(i=Math.max(-8,Math.min(8,Math.floor(w/3)))*3)+1,O=k.length;return R===O?k:R>O?k+new Array(R-O+1).join("0"):R>0?k.slice(0,R)+"."+k.slice(R):"0."+new Array(1-R).join("0")+P(A,Math.max(0,h+R-1))[0]}function f(A,h){var p=P(A,h);if(!p)return A+"";var k=p[0],w=p[1];return w<0?"0."+new Array(-w).join("0")+k:k.length>w+1?k.slice(0,w+1)+"."+k.slice(w+1):k+new Array(w-k.length+2).join("0")}var x={"%":function(A,h){return(A*100).toFixed(h)},b:function(A){return Math.round(A).toString(2)},c:function(A){return A+""},d:g,e:function(A,h){return A.toExponential(h)},f:function(A,h){return A.toFixed(h)},g:function(A,h){return A.toPrecision(h)},o:function(A){return Math.round(A).toString(8)},p:function(A,h){return f(A*100,h)},r:f,s,X:function(A){return Math.round(A).toString(16).toUpperCase()},x:function(A){return Math.round(A).toString(16)}};function y(A){return A}var v=Array.prototype.map,T=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function u(A){var h=A.grouping===void 0||A.thousands===void 0?y:t(v.call(A.grouping,Number),A.thousands+""),p=A.currency===void 0?"":A.currency[0]+"",k=A.currency===void 0?"":A.currency[1]+"",w=A.decimal===void 0?".":A.decimal+"",R=A.numerals===void 0?y:e(v.call(A.numerals,String)),O=A.percent===void 0?"%":A.percent+"",N=A.minus===void 0?"-":A.minus+"",V=A.nan===void 0?"NaN":A.nan+"";function H(U){U=a(U);var W=U.fill,q=U.align,X=U.sign,lt=U.symbol,yt=U.zero,pt=U.width,st=U.comma,tt=U.precision,dt=U.trim,rt=U.type;rt==="n"?(st=!0,rt="g"):x[rt]||(tt===void 0&&(tt=12),dt=!0,rt="g"),(yt||W==="0"&&q==="=")&&(yt=!0,W="0",q="=");var at=lt==="$"?p:lt==="#"&&/[boxX]/.test(rt)?"0"+rt.toLowerCase():"",vt=lt==="$"?k:/[%p]/.test(rt)?O:"",it=x[rt],Y=/[defgprs%]/.test(rt);tt=tt===void 0?6:/[gprs]/.test(rt)?Math.max(1,Math.min(21,tt)):Math.max(0,Math.min(20,tt));function ft(ut){var wt=at,zt=vt,Pt,Wt,Ht;if(rt==="c")zt=it(ut)+zt,ut="";else{ut=+ut;var Jt=ut<0||1/ut<0;if(ut=isNaN(ut)?V:it(Math.abs(ut),tt),dt&&(ut=o(ut)),Jt&&+ut==0&&X!=="+"&&(Jt=!1),wt=(Jt?X==="("?X:N:X==="-"||X==="("?"":X)+wt,zt=(rt==="s"?T[8+i/3]:"")+zt+(Jt&&X==="("?")":""),Y){for(Pt=-1,Wt=ut.length;++PtHt||Ht>57){zt=(Ht===46?w+ut.slice(Pt+1):ut.slice(Pt))+zt,ut=ut.slice(0,Pt);break}}}st&&!yt&&(ut=h(ut,1/0));var ge=wt.length+ut.length+zt.length,he=ge>1)+wt+ut+zt+he.slice(ge);break;default:ut=he+wt+ut+zt;break}return R(ut)}return ft.toString=function(){return U+""},ft}function F(U,W){var q=H((U=a(U),U.type="f",U)),X=Math.max(-8,Math.min(8,Math.floor(S(W)/3)))*3,lt=Math.pow(10,-X),yt=T[8+X/3];return function(pt){return q(lt*pt)+yt}}return{format:H,formatPrefix:F}}var b;_({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});function _(A){return b=u(A),c.format=b.format,c.formatPrefix=b.formatPrefix,b}function C(A){return Math.max(0,-S(Math.abs(A)))}function M(A,h){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(S(h)/3)))*3-S(Math.abs(A)))}function E(A,h){return A=Math.abs(A),h=Math.abs(h)-A,Math.max(0,S(h)-S(A))+1}c.FormatSpecifier=n,c.formatDefaultLocale=_,c.formatLocale=u,c.formatSpecifier=a,c.precisionFixed=C,c.precisionPrefix=M,c.precisionRound=E,Object.defineProperty(c,"__esModule",{value:!0})})}),yi=Ft((Q,$)=>{$.exports=function(c){for(var g=c.length,P,S=0;S13)&&P!==32&&P!==133&&P!==160&&P!==5760&&P!==6158&&(P<8192||P>8205)&&P!==8232&&P!==8233&&P!==8239&&P!==8287&&P!==8288&&P!==12288&&P!==65279)return!1;return!0}}),ra=Ft((Q,$)=>{var c=yi();$.exports=function(g){var P=typeof g;if(P==="string"){var S=g;if(g=+g,g===0&&c(S))return!1}else if(P!=="number")return!1;return g-g<1}}),Da=Ft((Q,$)=>{$.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE*1e-4,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,ONEMILLI:1,ONEMICROSEC:.001,EPOCHJD:24405875e-1,ALMOST_EQUAL:1-1e-6,LOG_CLIP:10,MINUS_SIGN:"−"}}),Ni=Ft((Q,$)=>{(function(c,g){typeof Q=="object"&&typeof $<"u"?g(Q):(c=typeof globalThis<"u"?globalThis:c||self,g(c["base64-arraybuffer"]={}))})(Q,function(c){for(var g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",P=typeof Uint8Array>"u"?[]:new Uint8Array(256),S=0;S>2],i+=g[(a[n]&3)<<4|a[n+1]>>4],i+=g[(a[n+1]&15)<<2|a[n+2]>>6],i+=g[a[n+2]&63];return o%3===2?i=i.substring(0,i.length-1)+"=":o%3===1&&(i=i.substring(0,i.length-2)+"=="),i},e=function(r){var a=r.length*.75,n=r.length,o,i=0,s,f,x,y;r[r.length-1]==="="&&(a--,r[r.length-2]==="="&&a--);var v=new ArrayBuffer(a),T=new Uint8Array(v);for(o=0;o>4,T[i++]=(f&15)<<4|x>>2,T[i++]=(x&3)<<6|y&63;return v};c.decode=e,c.encode=t,Object.defineProperty(c,"__esModule",{value:!0})})}),Ei=Ft((Q,$)=>{$.exports=function(c){return window&&window.process&&window.process.versions?Object.prototype.toString.call(c)==="[object Object]":Object.prototype.toString.call(c)==="[object Object]"&&Object.getPrototypeOf(c).hasOwnProperty("hasOwnProperty")}}),Va=Ft(Q=>{var $=Ni().decode,c=Ei(),g=Array.isArray,P=ArrayBuffer,S=DataView;function t(s){return P.isView(s)&&!(s instanceof S)}Q.isTypedArray=t;function e(s){return g(s)||t(s)}Q.isArrayOrTypedArray=e;function r(s){return!e(s[0])}Q.isArray1D=r,Q.ensureArray=function(s,f){return g(s)||(s=[]),s.length=f,s};var a={u1c:typeof Uint8ClampedArray>"u"?void 0:Uint8ClampedArray,i1:typeof Int8Array>"u"?void 0:Int8Array,u1:typeof Uint8Array>"u"?void 0:Uint8Array,i2:typeof Int16Array>"u"?void 0:Int16Array,u2:typeof Uint16Array>"u"?void 0:Uint16Array,i4:typeof Int32Array>"u"?void 0:Int32Array,u4:typeof Uint32Array>"u"?void 0:Uint32Array,f4:typeof Float32Array>"u"?void 0:Float32Array,f8:typeof Float64Array>"u"?void 0:Float64Array};a.uint8c=a.u1c,a.uint8=a.u1,a.int8=a.i1,a.uint16=a.u2,a.int16=a.i2,a.uint32=a.u4,a.int32=a.i4,a.float32=a.f4,a.float64=a.f8;function n(s){return s.constructor===ArrayBuffer}Q.isArrayBuffer=n,Q.decodeTypedArraySpec=function(s){var f=[],x=o(s),y=x.dtype,v=a[y];if(!v)throw new Error('Error in dtype: "'+y+'"');var T=v.BYTES_PER_ELEMENT,u=x.bdata;n(u)||(u=$(u));var b=x.shape===void 0?[u.byteLength/T]:(""+x.shape).split(",");b.reverse();var _=b.length,C,M,E=+b[0],A=T*E,h=0;if(_===1)f=new v(u);else if(_===2)for(C=+b[1],M=0;M{var c=ra(),g=Va().isArrayOrTypedArray;$.exports=function(i,s){if(c(s))s=String(s);else if(typeof s!="string"||s.substr(s.length-4)==="[-1]")throw"bad property string";var f=s.split("."),x,y,v,T;for(T=0;T{var c=ss(),g=/^\w*$/,P=0,S=1,t=2,e=3,r=4;$.exports=function(a,n,o,i){o=o||"name",i=i||"value";var s,f,x,y={};n&&n.length?(x=c(a,n),f=x.get()):f=a,n=n||"";var v={};if(f)for(s=0;s2)return y[_]=y[_]|t,u.set(b,null);if(T){for(s=_;s{var c=/^(.*)(\.[^\.\[\]]+|\[\d\])$/,g=/^[^\.\[\]]+$/;$.exports=function(P,S){for(;S;){var t=P.match(c);if(t)P=t[1];else if(P.match(g))P="";else throw new Error("bad relativeAttr call:"+[P,S]);if(S.charAt(0)==="^")S=S.slice(1);else break}return P&&S.charAt(0)!=="["?P+"."+S:P+S}}),pl=Ft((Q,$)=>{var c=ra();$.exports=function(g,P){if(g>0)return Math.log(g)/Math.LN10;var S=Math.log(Math.min(P[0],P[1]))/Math.LN10;return c(S)||(S=Math.log(Math.max(P[0],P[1]))/Math.LN10-6),S}}),fu=Ft((Q,$)=>{var c=Va().isArrayOrTypedArray,g=Ei();$.exports=function P(S,t){for(var e in t){var r=t[e],a=S[e];if(a!==r)if(e.charAt(0)==="_"||typeof r=="function"){if(e in S)continue;S[e]=r}else if(c(r)&&c(a)&&g(r[0])){if(e==="customdata"||e==="ids")continue;for(var n=Math.min(r.length,a.length),o=0;o{function c(P,S){var t=P%S;return t<0?t+S:t}function g(P,S){return Math.abs(P)>S/2?P-Math.round(P/S)*S:P}$.exports={mod:c,modHalf:g}}),fo=Ft((Q,$)=>{(function(c){var g=/^\s+/,P=/\s+$/,S=0,t=c.round,e=c.min,r=c.max,a=c.random;function n(Y,ft){if(Y=Y||"",ft=ft||{},Y instanceof n)return Y;if(!(this instanceof n))return new n(Y,ft);var ut=o(Y);this._originalInput=Y,this._r=ut.r,this._g=ut.g,this._b=ut.b,this._a=ut.a,this._roundA=t(100*this._a)/100,this._format=ft.format||ut.format,this._gradientType=ft.gradientType,this._r<1&&(this._r=t(this._r)),this._g<1&&(this._g=t(this._g)),this._b<1&&(this._b=t(this._b)),this._ok=ut.ok,this._tc_id=S++}n.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var Y=this.toRgb();return(Y.r*299+Y.g*587+Y.b*114)/1e3},getLuminance:function(){var Y=this.toRgb(),ft,ut,wt,zt,Pt,Wt;return ft=Y.r/255,ut=Y.g/255,wt=Y.b/255,ft<=.03928?zt=ft/12.92:zt=c.pow((ft+.055)/1.055,2.4),ut<=.03928?Pt=ut/12.92:Pt=c.pow((ut+.055)/1.055,2.4),wt<=.03928?Wt=wt/12.92:Wt=c.pow((wt+.055)/1.055,2.4),.2126*zt+.7152*Pt+.0722*Wt},setAlpha:function(Y){return this._a=U(Y),this._roundA=t(100*this._a)/100,this},toHsv:function(){var Y=x(this._r,this._g,this._b);return{h:Y.h*360,s:Y.s,v:Y.v,a:this._a}},toHsvString:function(){var Y=x(this._r,this._g,this._b),ft=t(Y.h*360),ut=t(Y.s*100),wt=t(Y.v*100);return this._a==1?"hsv("+ft+", "+ut+"%, "+wt+"%)":"hsva("+ft+", "+ut+"%, "+wt+"%, "+this._roundA+")"},toHsl:function(){var Y=s(this._r,this._g,this._b);return{h:Y.h*360,s:Y.s,l:Y.l,a:this._a}},toHslString:function(){var Y=s(this._r,this._g,this._b),ft=t(Y.h*360),ut=t(Y.s*100),wt=t(Y.l*100);return this._a==1?"hsl("+ft+", "+ut+"%, "+wt+"%)":"hsla("+ft+", "+ut+"%, "+wt+"%, "+this._roundA+")"},toHex:function(Y){return v(this._r,this._g,this._b,Y)},toHexString:function(Y){return"#"+this.toHex(Y)},toHex8:function(Y){return T(this._r,this._g,this._b,this._a,Y)},toHex8String:function(Y){return"#"+this.toHex8(Y)},toRgb:function(){return{r:t(this._r),g:t(this._g),b:t(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+t(this._r)+", "+t(this._g)+", "+t(this._b)+")":"rgba("+t(this._r)+", "+t(this._g)+", "+t(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:t(W(this._r,255)*100)+"%",g:t(W(this._g,255)*100)+"%",b:t(W(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+t(W(this._r,255)*100)+"%, "+t(W(this._g,255)*100)+"%, "+t(W(this._b,255)*100)+"%)":"rgba("+t(W(this._r,255)*100)+"%, "+t(W(this._g,255)*100)+"%, "+t(W(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:H[v(this._r,this._g,this._b,!0)]||!1},toFilter:function(Y){var ft="#"+u(this._r,this._g,this._b,this._a),ut=ft,wt=this._gradientType?"GradientType = 1, ":"";if(Y){var zt=n(Y);ut="#"+u(zt._r,zt._g,zt._b,zt._a)}return"progid:DXImageTransform.Microsoft.gradient("+wt+"startColorstr="+ft+",endColorstr="+ut+")"},toString:function(Y){var ft=!!Y;Y=Y||this._format;var ut=!1,wt=this._a<1&&this._a>=0,zt=!ft&&wt&&(Y==="hex"||Y==="hex6"||Y==="hex3"||Y==="hex4"||Y==="hex8"||Y==="name");return zt?Y==="name"&&this._a===0?this.toName():this.toRgbString():(Y==="rgb"&&(ut=this.toRgbString()),Y==="prgb"&&(ut=this.toPercentageRgbString()),(Y==="hex"||Y==="hex6")&&(ut=this.toHexString()),Y==="hex3"&&(ut=this.toHexString(!0)),Y==="hex4"&&(ut=this.toHex8String(!0)),Y==="hex8"&&(ut=this.toHex8String()),Y==="name"&&(ut=this.toName()),Y==="hsl"&&(ut=this.toHslString()),Y==="hsv"&&(ut=this.toHsvString()),ut||this.toHexString())},clone:function(){return n(this.toString())},_applyModification:function(Y,ft){var ut=Y.apply(null,[this].concat([].slice.call(ft)));return this._r=ut._r,this._g=ut._g,this._b=ut._b,this.setAlpha(ut._a),this},lighten:function(){return this._applyModification(M,arguments)},brighten:function(){return this._applyModification(E,arguments)},darken:function(){return this._applyModification(A,arguments)},desaturate:function(){return this._applyModification(b,arguments)},saturate:function(){return this._applyModification(_,arguments)},greyscale:function(){return this._applyModification(C,arguments)},spin:function(){return this._applyModification(h,arguments)},_applyCombination:function(Y,ft){return Y.apply(null,[this].concat([].slice.call(ft)))},analogous:function(){return this._applyCombination(O,arguments)},complement:function(){return this._applyCombination(p,arguments)},monochromatic:function(){return this._applyCombination(N,arguments)},splitcomplement:function(){return this._applyCombination(R,arguments)},triad:function(){return this._applyCombination(k,arguments)},tetrad:function(){return this._applyCombination(w,arguments)}},n.fromRatio=function(Y,ft){if(typeof Y=="object"){var ut={};for(var wt in Y)Y.hasOwnProperty(wt)&&(wt==="a"?ut[wt]=Y[wt]:ut[wt]=st(Y[wt]));Y=ut}return n(Y,ft)};function o(Y){var ft={r:0,g:0,b:0},ut=1,wt=null,zt=null,Pt=null,Wt=!1,Ht=!1;return typeof Y=="string"&&(Y=vt(Y)),typeof Y=="object"&&(at(Y.r)&&at(Y.g)&&at(Y.b)?(ft=i(Y.r,Y.g,Y.b),Wt=!0,Ht=String(Y.r).substr(-1)==="%"?"prgb":"rgb"):at(Y.h)&&at(Y.s)&&at(Y.v)?(wt=st(Y.s),zt=st(Y.v),ft=y(Y.h,wt,zt),Wt=!0,Ht="hsv"):at(Y.h)&&at(Y.s)&&at(Y.l)&&(wt=st(Y.s),Pt=st(Y.l),ft=f(Y.h,wt,Pt),Wt=!0,Ht="hsl"),Y.hasOwnProperty("a")&&(ut=Y.a)),ut=U(ut),{ok:Wt,format:Y.format||Ht,r:e(255,r(ft.r,0)),g:e(255,r(ft.g,0)),b:e(255,r(ft.b,0)),a:ut}}function i(Y,ft,ut){return{r:W(Y,255)*255,g:W(ft,255)*255,b:W(ut,255)*255}}function s(Y,ft,ut){Y=W(Y,255),ft=W(ft,255),ut=W(ut,255);var wt=r(Y,ft,ut),zt=e(Y,ft,ut),Pt,Wt,Ht=(wt+zt)/2;if(wt==zt)Pt=Wt=0;else{var Jt=wt-zt;switch(Wt=Ht>.5?Jt/(2-wt-zt):Jt/(wt+zt),wt){case Y:Pt=(ft-ut)/Jt+(ft1&&(de-=1),de<1/6?ge+(he-ge)*6*de:de<1/2?he:de<2/3?ge+(he-ge)*(2/3-de)*6:ge}if(ft===0)wt=zt=Pt=ut;else{var Ht=ut<.5?ut*(1+ft):ut+ft-ut*ft,Jt=2*ut-Ht;wt=Wt(Jt,Ht,Y+1/3),zt=Wt(Jt,Ht,Y),Pt=Wt(Jt,Ht,Y-1/3)}return{r:wt*255,g:zt*255,b:Pt*255}}function x(Y,ft,ut){Y=W(Y,255),ft=W(ft,255),ut=W(ut,255);var wt=r(Y,ft,ut),zt=e(Y,ft,ut),Pt,Wt,Ht=wt,Jt=wt-zt;if(Wt=wt===0?0:Jt/wt,wt==zt)Pt=0;else{switch(wt){case Y:Pt=(ft-ut)/Jt+(ft>1)+720)%360;--ft;)wt.h=(wt.h+zt)%360,Pt.push(n(wt));return Pt}function N(Y,ft){ft=ft||6;for(var ut=n(Y).toHsv(),wt=ut.h,zt=ut.s,Pt=ut.v,Wt=[],Ht=1/ft;ft--;)Wt.push(n({h:wt,s:zt,v:Pt})),Pt=(Pt+Ht)%1;return Wt}n.mix=function(Y,ft,ut){ut=ut===0?0:ut||50;var wt=n(Y).toRgb(),zt=n(ft).toRgb(),Pt=ut/100,Wt={r:(zt.r-wt.r)*Pt+wt.r,g:(zt.g-wt.g)*Pt+wt.g,b:(zt.b-wt.b)*Pt+wt.b,a:(zt.a-wt.a)*Pt+wt.a};return n(Wt)},n.readability=function(Y,ft){var ut=n(Y),wt=n(ft);return(c.max(ut.getLuminance(),wt.getLuminance())+.05)/(c.min(ut.getLuminance(),wt.getLuminance())+.05)},n.isReadable=function(Y,ft,ut){var wt=n.readability(Y,ft),zt,Pt;switch(Pt=!1,zt=it(ut),zt.level+zt.size){case"AAsmall":case"AAAlarge":Pt=wt>=4.5;break;case"AAlarge":Pt=wt>=3;break;case"AAAsmall":Pt=wt>=7;break}return Pt},n.mostReadable=function(Y,ft,ut){var wt=null,zt=0,Pt,Wt,Ht,Jt;ut=ut||{},Wt=ut.includeFallbackColors,Ht=ut.level,Jt=ut.size;for(var ge=0;gezt&&(zt=Pt,wt=n(ft[ge]));return n.isReadable(Y,wt,{level:Ht,size:Jt})||!Wt?wt:(ut.includeFallbackColors=!1,n.mostReadable(Y,["#fff","#000"],ut))};var V=n.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},H=n.hexNames=F(V);function F(Y){var ft={};for(var ut in Y)Y.hasOwnProperty(ut)&&(ft[Y[ut]]=ut);return ft}function U(Y){return Y=parseFloat(Y),(isNaN(Y)||Y<0||Y>1)&&(Y=1),Y}function W(Y,ft){lt(Y)&&(Y="100%");var ut=yt(Y);return Y=e(ft,r(0,parseFloat(Y))),ut&&(Y=parseInt(Y*ft,10)/100),c.abs(Y-ft)<1e-6?1:Y%ft/parseFloat(ft)}function q(Y){return e(1,r(0,Y))}function X(Y){return parseInt(Y,16)}function lt(Y){return typeof Y=="string"&&Y.indexOf(".")!=-1&&parseFloat(Y)===1}function yt(Y){return typeof Y=="string"&&Y.indexOf("%")!=-1}function pt(Y){return Y.length==1?"0"+Y:""+Y}function st(Y){return Y<=1&&(Y=Y*100+"%"),Y}function tt(Y){return c.round(parseFloat(Y)*255).toString(16)}function dt(Y){return X(Y)/255}var rt=function(){var Y="[-\\+]?\\d+%?",ft="[-\\+]?\\d*\\.\\d+%?",ut="(?:"+ft+")|(?:"+Y+")",wt="[\\s|\\(]+("+ut+")[,|\\s]+("+ut+")[,|\\s]+("+ut+")\\s*\\)?",zt="[\\s|\\(]+("+ut+")[,|\\s]+("+ut+")[,|\\s]+("+ut+")[,|\\s]+("+ut+")\\s*\\)?";return{CSS_UNIT:new RegExp(ut),rgb:new RegExp("rgb"+wt),rgba:new RegExp("rgba"+zt),hsl:new RegExp("hsl"+wt),hsla:new RegExp("hsla"+zt),hsv:new RegExp("hsv"+wt),hsva:new RegExp("hsva"+zt),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function at(Y){return!!rt.CSS_UNIT.exec(Y)}function vt(Y){Y=Y.replace(g,"").replace(P,"").toLowerCase();var ft=!1;if(V[Y])Y=V[Y],ft=!0;else if(Y=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var ut;return(ut=rt.rgb.exec(Y))?{r:ut[1],g:ut[2],b:ut[3]}:(ut=rt.rgba.exec(Y))?{r:ut[1],g:ut[2],b:ut[3],a:ut[4]}:(ut=rt.hsl.exec(Y))?{h:ut[1],s:ut[2],l:ut[3]}:(ut=rt.hsla.exec(Y))?{h:ut[1],s:ut[2],l:ut[3],a:ut[4]}:(ut=rt.hsv.exec(Y))?{h:ut[1],s:ut[2],v:ut[3]}:(ut=rt.hsva.exec(Y))?{h:ut[1],s:ut[2],v:ut[3],a:ut[4]}:(ut=rt.hex8.exec(Y))?{r:X(ut[1]),g:X(ut[2]),b:X(ut[3]),a:dt(ut[4]),format:ft?"name":"hex8"}:(ut=rt.hex6.exec(Y))?{r:X(ut[1]),g:X(ut[2]),b:X(ut[3]),format:ft?"name":"hex"}:(ut=rt.hex4.exec(Y))?{r:X(ut[1]+""+ut[1]),g:X(ut[2]+""+ut[2]),b:X(ut[3]+""+ut[3]),a:dt(ut[4]+""+ut[4]),format:ft?"name":"hex8"}:(ut=rt.hex3.exec(Y))?{r:X(ut[1]+""+ut[1]),g:X(ut[2]+""+ut[2]),b:X(ut[3]+""+ut[3]),format:ft?"name":"hex"}:!1}function it(Y){var ft,ut;return Y=Y||{level:"AA",size:"small"},ft=(Y.level||"AA").toUpperCase(),ut=(Y.size||"small").toLowerCase(),ft!=="AA"&&ft!=="AAA"&&(ft="AA"),ut!=="small"&&ut!=="large"&&(ut="small"),{level:ft,size:ut}}typeof $<"u"&&$.exports?$.exports=n:window.tinycolor=n})(Math)}),Ta=Ft(Q=>{var $=Ei(),c=Array.isArray;function g(S,t){var e,r;for(e=0;e{$.exports=function(c){var g=c.variantValues,P=c.editType,S=c.colorEditType;S===void 0&&(S=P);var t={editType:P,valType:"integer",min:1,max:1e3,extras:["normal","bold"],dflt:"normal"};c.noNumericWeightValues&&(t.valType="enumerated",t.values=t.extras,t.extras=void 0,t.min=void 0,t.max=void 0);var e={family:{valType:"string",noBlank:!0,strict:!0,editType:P},size:{valType:"number",min:1,editType:P},color:{valType:"color",editType:S},weight:t,style:{editType:P,valType:"enumerated",values:["normal","italic"],dflt:"normal"},variant:c.noFontVariant?void 0:{editType:P,valType:"enumerated",values:g||["normal","small-caps","all-small-caps","all-petite-caps","petite-caps","unicase"],dflt:"normal"},textcase:c.noFontTextcase?void 0:{editType:P,valType:"enumerated",values:["normal","word caps","upper","lower"],dflt:"normal"},lineposition:c.noFontLineposition?void 0:{editType:P,valType:"flaglist",flags:["under","over","through"],extras:["none"],dflt:"none"},shadow:c.noFontShadow?void 0:{editType:P,valType:"string",dflt:c.autoShadowDflt?"auto":"none"},editType:P};return c.autoSize&&(e.size.dflt="auto"),c.autoColor&&(e.color.dflt="auto"),c.arrayOk&&(e.family.arrayOk=!0,e.weight.arrayOk=!0,e.style.arrayOk=!0,c.noFontVariant||(e.variant.arrayOk=!0),c.noFontTextcase||(e.textcase.arrayOk=!0),c.noFontLineposition||(e.lineposition.arrayOk=!0),c.noFontShadow||(e.shadow.arrayOk=!0),e.size.arrayOk=!0,e.color.arrayOk=!0),e}}),go=Ft((Q,$)=>{$.exports={YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:50,HOVERID:"-hover"}}),Ao=Ft((Q,$)=>{var c=go(),g=Ea(),P=g({editType:"none"});P.family.dflt=c.HOVERFONT,P.size.dflt=c.HOVERFONTSIZE,$.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],dflt:"closest",editType:"modebar"},hoversubplots:{valType:"enumerated",values:["single","overlaying","axis"],dflt:"overlaying",editType:"none"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:P,grouptitlefont:g({editType:"none"}),align:{valType:"enumerated",values:["left","right","auto"],dflt:"auto",editType:"none"},namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},showarrow:{valType:"boolean",dflt:!0,editType:"none"},editType:"none"},selectdirection:{valType:"enumerated",values:["h","v","d","any"],dflt:"any",editType:"none"}}}),Ps=Ft((Q,$)=>{var c=Ea(),g=Ao().hoverlabel,P=Ta().extendFlat;$.exports={hoverlabel:{bgcolor:P({},g.bgcolor,{arrayOk:!0}),bordercolor:P({},g.bordercolor,{arrayOk:!0}),font:c({arrayOk:!0,editType:"none"}),align:P({},g.align,{arrayOk:!0}),namelength:P({},g.namelength,{arrayOk:!0}),showarrow:P({},g.showarrow),editType:"none"}}}),$o=Ft((Q,$)=>{var c=Ea(),g=Ps();$.exports={type:{valType:"enumerated",values:[],dflt:"scatter",editType:"calc+clearAxisTypes",_noTemplating:!0},visible:{valType:"enumerated",values:[!0,!1,"legendonly"],dflt:!0,editType:"calc"},showlegend:{valType:"boolean",dflt:!0,editType:"style"},legend:{valType:"subplotid",dflt:"legend",editType:"style"},legendgroup:{valType:"string",dflt:"",editType:"style"},legendgrouptitle:{text:{valType:"string",dflt:"",editType:"style"},font:c({editType:"style"}),editType:"style"},legendrank:{valType:"number",dflt:1e3,editType:"style"},legendwidth:{valType:"number",min:0,editType:"style"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"style"},name:{valType:"string",editType:"style"},uid:{valType:"string",editType:"plot",anim:!0},ids:{valType:"data_array",editType:"calc",anim:!0},customdata:{valType:"data_array",editType:"calc"},meta:{valType:"any",arrayOk:!0,editType:"plot"},selectedpoints:{valType:"any",editType:"calc"},hoverinfo:{valType:"flaglist",flags:["x","y","z","text","name"],extras:["all","none","skip"],arrayOk:!0,dflt:"all",editType:"none"},hoverlabel:g.hoverlabel,stream:{token:{valType:"string",noBlank:!0,strict:!0,editType:"calc"},maxpoints:{valType:"number",min:0,max:1e4,dflt:500,editType:"calc"},editType:"calc"},uirevision:{valType:"any",editType:"none"}}}),gi=Ft((Q,$)=>{var c=fo(),g={Greys:[[0,"rgb(0,0,0)"],[1,"rgb(255,255,255)"]],YlGnBu:[[0,"rgb(8,29,88)"],[.125,"rgb(37,52,148)"],[.25,"rgb(34,94,168)"],[.375,"rgb(29,145,192)"],[.5,"rgb(65,182,196)"],[.625,"rgb(127,205,187)"],[.75,"rgb(199,233,180)"],[.875,"rgb(237,248,217)"],[1,"rgb(255,255,217)"]],Greens:[[0,"rgb(0,68,27)"],[.125,"rgb(0,109,44)"],[.25,"rgb(35,139,69)"],[.375,"rgb(65,171,93)"],[.5,"rgb(116,196,118)"],[.625,"rgb(161,217,155)"],[.75,"rgb(199,233,192)"],[.875,"rgb(229,245,224)"],[1,"rgb(247,252,245)"]],YlOrRd:[[0,"rgb(128,0,38)"],[.125,"rgb(189,0,38)"],[.25,"rgb(227,26,28)"],[.375,"rgb(252,78,42)"],[.5,"rgb(253,141,60)"],[.625,"rgb(254,178,76)"],[.75,"rgb(254,217,118)"],[.875,"rgb(255,237,160)"],[1,"rgb(255,255,204)"]],Bluered:[[0,"rgb(0,0,255)"],[1,"rgb(255,0,0)"]],RdBu:[[0,"rgb(5,10,172)"],[.35,"rgb(106,137,247)"],[.5,"rgb(190,190,190)"],[.6,"rgb(220,170,132)"],[.7,"rgb(230,145,90)"],[1,"rgb(178,10,28)"]],Reds:[[0,"rgb(220,220,220)"],[.2,"rgb(245,195,157)"],[.4,"rgb(245,160,105)"],[1,"rgb(178,10,28)"]],Blues:[[0,"rgb(5,10,172)"],[.35,"rgb(40,60,190)"],[.5,"rgb(70,100,245)"],[.6,"rgb(90,120,245)"],[.7,"rgb(106,137,247)"],[1,"rgb(220,220,220)"]],Picnic:[[0,"rgb(0,0,255)"],[.1,"rgb(51,153,255)"],[.2,"rgb(102,204,255)"],[.3,"rgb(153,204,255)"],[.4,"rgb(204,204,255)"],[.5,"rgb(255,255,255)"],[.6,"rgb(255,204,255)"],[.7,"rgb(255,153,255)"],[.8,"rgb(255,102,204)"],[.9,"rgb(255,102,102)"],[1,"rgb(255,0,0)"]],Rainbow:[[0,"rgb(150,0,90)"],[.125,"rgb(0,0,200)"],[.25,"rgb(0,25,255)"],[.375,"rgb(0,152,255)"],[.5,"rgb(44,255,150)"],[.625,"rgb(151,255,0)"],[.75,"rgb(255,234,0)"],[.875,"rgb(255,111,0)"],[1,"rgb(255,0,0)"]],Portland:[[0,"rgb(12,51,131)"],[.25,"rgb(10,136,186)"],[.5,"rgb(242,211,56)"],[.75,"rgb(242,143,56)"],[1,"rgb(217,30,30)"]],Jet:[[0,"rgb(0,0,131)"],[.125,"rgb(0,60,170)"],[.375,"rgb(5,255,255)"],[.625,"rgb(255,255,0)"],[.875,"rgb(250,0,0)"],[1,"rgb(128,0,0)"]],Hot:[[0,"rgb(0,0,0)"],[.3,"rgb(230,0,0)"],[.6,"rgb(255,210,0)"],[1,"rgb(255,255,255)"]],Blackbody:[[0,"rgb(0,0,0)"],[.2,"rgb(230,0,0)"],[.4,"rgb(230,210,0)"],[.7,"rgb(255,255,255)"],[1,"rgb(160,200,255)"]],Earth:[[0,"rgb(0,0,130)"],[.1,"rgb(0,180,180)"],[.2,"rgb(40,210,40)"],[.4,"rgb(230,230,50)"],[.6,"rgb(120,70,20)"],[1,"rgb(255,255,255)"]],Electric:[[0,"rgb(0,0,0)"],[.15,"rgb(30,0,100)"],[.4,"rgb(120,0,100)"],[.6,"rgb(160,90,0)"],[.8,"rgb(230,200,0)"],[1,"rgb(255,250,220)"]],Viridis:[[0,"#440154"],[.06274509803921569,"#48186a"],[.12549019607843137,"#472d7b"],[.18823529411764706,"#424086"],[.25098039215686274,"#3b528b"],[.3137254901960784,"#33638d"],[.3764705882352941,"#2c728e"],[.4392156862745098,"#26828e"],[.5019607843137255,"#21918c"],[.5647058823529412,"#1fa088"],[.6274509803921569,"#28ae80"],[.6901960784313725,"#3fbc73"],[.7529411764705882,"#5ec962"],[.8156862745098039,"#84d44b"],[.8784313725490196,"#addc30"],[.9411764705882353,"#d8e219"],[1,"#fde725"]],Cividis:[[0,"rgb(0,32,76)"],[.058824,"rgb(0,42,102)"],[.117647,"rgb(0,52,110)"],[.176471,"rgb(39,63,108)"],[.235294,"rgb(60,74,107)"],[.294118,"rgb(76,85,107)"],[.352941,"rgb(91,95,109)"],[.411765,"rgb(104,106,112)"],[.470588,"rgb(117,117,117)"],[.529412,"rgb(131,129,120)"],[.588235,"rgb(146,140,120)"],[.647059,"rgb(161,152,118)"],[.705882,"rgb(176,165,114)"],[.764706,"rgb(192,177,109)"],[.823529,"rgb(209,191,102)"],[.882353,"rgb(225,204,92)"],[.941176,"rgb(243,219,79)"],[1,"rgb(255,233,69)"]]},P=g.RdBu;function S(r,a){if(a||(a=P),!r)return a;function n(){try{r=g[r]||JSON.parse(r)}catch{r=a}}return typeof r=="string"&&(n(),typeof r=="string"&&n()),t(r)?r:a}function t(r){var a=0;if(!Array.isArray(r)||r.length<2||!r[0]||!r[r.length-1]||+r[0][0]!=0||+r[r.length-1][0]!=1)return!1;for(var n=0;n{Q.defaults=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],Q.defaultLine="#444",Q.lightLine="#eee",Q.background="#fff",Q.borderLine="#BEC8D9",Q.lightFraction=1e3/11}),li=Ft((Q,$)=>{var c=fo(),g=ra(),P=Va().isTypedArray,S=$.exports={},t=bi();S.defaults=t.defaults;var e=S.defaultLine=t.defaultLine;S.lightLine=t.lightLine;var r=S.background=t.background;S.tinyRGB=function(n){var o=n.toRgb();return"rgb("+Math.round(o.r)+", "+Math.round(o.g)+", "+Math.round(o.b)+")"},S.rgb=function(n){return S.tinyRGB(c(n))},S.opacity=function(n){return n?c(n).getAlpha():0},S.addOpacity=function(n,o){var i=c(n).toRgb();return"rgba("+Math.round(i.r)+", "+Math.round(i.g)+", "+Math.round(i.b)+", "+o+")"},S.combine=function(n,o){var i=c(n).toRgb();if(i.a===1)return c(n).toRgbString();var s=c(o||r).toRgb(),f=s.a===1?s:{r:255*(1-s.a)+s.r*s.a,g:255*(1-s.a)+s.g*s.a,b:255*(1-s.a)+s.b*s.a},x={r:f.r*(1-i.a)+i.r*i.a,g:f.g*(1-i.a)+i.g*i.a,b:f.b*(1-i.a)+i.b*i.a};return c(x).toRgbString()},S.interpolate=function(n,o,i){var s=c(n).toRgb(),f=c(o).toRgb(),x={r:i*s.r+(1-i)*f.r,g:i*s.g+(1-i)*f.g,b:i*s.b+(1-i)*f.b};return c(x).toRgbString()},S.contrast=function(n,o,i){var s=c(n);s.getAlpha()!==1&&(s=c(S.combine(n,r)));var f=s.isDark()?o?s.lighten(o):r:i?s.darken(i):e;return f.toString()},S.stroke=function(n,o){var i=c(o);n.style({stroke:S.tinyRGB(i),"stroke-opacity":i.getAlpha()})},S.fill=function(n,o){var i=c(o);n.style({fill:S.tinyRGB(i),"fill-opacity":i.getAlpha()})},S.clean=function(n){if(!(!n||typeof n!="object")){var o=Object.keys(n),i,s,f,x;for(i=0;i=0)))return n;if(x===3)s[x]>1&&(s[x]=1);else if(s[x]>=1)return n}var y=Math.round(s[0]*255)+", "+Math.round(s[1]*255)+", "+Math.round(s[2]*255);return f?"rgba("+y+", "+s[3]+")":"rgb("+y+")"}}),co=Ft((Q,$)=>{$.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}}),vo=Ft(Q=>{Q.counter=function($,c,g,P){var S=(c||"")+(g?"":"$"),t=P===!1?"":"^";return $==="xy"?new RegExp(t+"x([2-9]|[1-9][0-9]+)?y([2-9]|[1-9][0-9]+)?"+S):new RegExp(t+$+"([2-9]|[1-9][0-9]+)?"+S)}}),yo=Ft(Q=>{var $=ra(),c=fo(),g=Ta().extendFlat,P=$o(),S=gi(),t=li(),e=co().DESELECTDIM,r=ss(),a=vo().counter,n=qo().modHalf,o=Va().isArrayOrTypedArray,i=Va().isTypedArraySpec,s=Va().decodeTypedArraySpec;Q.valObjectMeta={data_array:{coerceFunction:function(x,y,v){y.set(o(x)?x:i(x)?s(x):v)}},enumerated:{coerceFunction:function(x,y,v,T){T.coerceNumber&&(x=+x),T.values.indexOf(x)===-1?y.set(v):y.set(x)},validateFunction:function(x,y){y.coerceNumber&&(x=+x);for(var v=y.values,T=0;TT.max?y.set(v):y.set(+x)}},integer:{coerceFunction:function(x,y,v,T){if((T.extras||[]).indexOf(x)!==-1){y.set(x);return}i(x)&&(x=s(x)),x%1||!$(x)||T.min!==void 0&&xT.max?y.set(v):y.set(+x)}},string:{coerceFunction:function(x,y,v,T){if(typeof x!="string"){var u=typeof x=="number";T.strict===!0||!u?y.set(v):y.set(String(x))}else T.noBlank&&!x?y.set(v):y.set(x)}},color:{coerceFunction:function(x,y,v){i(x)&&(x=s(x)),c(x).isValid()?y.set(x):y.set(v)}},colorlist:{coerceFunction:function(x,y,v){function T(u){return c(u).isValid()}!Array.isArray(x)||!x.length?y.set(v):x.every(T)?y.set(x):y.set(v)}},colorscale:{coerceFunction:function(x,y,v){y.set(S.get(x,v))}},angle:{coerceFunction:function(x,y,v){i(x)&&(x=s(x)),x==="auto"?y.set("auto"):$(x)?y.set(n(+x,360)):y.set(v)}},subplotid:{coerceFunction:function(x,y,v,T){var u=T.regex||a(v);if(typeof x=="string"&&u.test(x)){y.set(x);return}y.set(v)},validateFunction:function(x,y){var v=y.dflt;return x===v?!0:typeof x!="string"?!1:!!a(v).test(x)}},flaglist:{coerceFunction:function(x,y,v,T){if((T.extras||[]).indexOf(x)!==-1){y.set(x);return}if(typeof x!="string"){y.set(v);return}for(var u=x.split("+"),b=0;b{var c={staticPlot:{valType:"boolean",dflt:!1},typesetMath:{valType:"boolean",dflt:!0},plotlyServerURL:{valType:"string",dflt:""},editable:{valType:"boolean",dflt:!1},edits:{annotationPosition:{valType:"boolean",dflt:!1},annotationTail:{valType:"boolean",dflt:!1},annotationText:{valType:"boolean",dflt:!1},axisTitleText:{valType:"boolean",dflt:!1},colorbarPosition:{valType:"boolean",dflt:!1},colorbarTitleText:{valType:"boolean",dflt:!1},legendPosition:{valType:"boolean",dflt:!1},legendText:{valType:"boolean",dflt:!1},shapePosition:{valType:"boolean",dflt:!1},titleText:{valType:"boolean",dflt:!1}},editSelection:{valType:"boolean",dflt:!0},autosizable:{valType:"boolean",dflt:!1},responsive:{valType:"boolean",dflt:!1},fillFrame:{valType:"boolean",dflt:!1},frameMargins:{valType:"number",dflt:0,min:0,max:.5},scrollZoom:{valType:"flaglist",flags:["cartesian","gl3d","geo","mapbox","map"],extras:[!0,!1],dflt:"gl3d+geo+map"},doubleClick:{valType:"enumerated",values:[!1,"reset","autosize","reset+autosize"],dflt:"reset+autosize"},doubleClickDelay:{valType:"number",dflt:300,min:0},showAxisDragHandles:{valType:"boolean",dflt:!0},showAxisRangeEntryBoxes:{valType:"boolean",dflt:!0},showTips:{valType:"boolean",dflt:!0},showLink:{valType:"boolean",dflt:!1},linkText:{valType:"string",dflt:"Edit chart",noBlank:!0},sendData:{valType:"boolean",dflt:!0},showSources:{valType:"any",dflt:!1},displayModeBar:{valType:"enumerated",values:["hover",!0,!1],dflt:"hover"},showSendToCloud:{valType:"boolean",dflt:!1},showEditInChartStudio:{valType:"boolean",dflt:!1},modeBarButtonsToRemove:{valType:"any",dflt:[]},modeBarButtonsToAdd:{valType:"any",dflt:[]},modeBarButtons:{valType:"any",dflt:!1},toImageButtonOptions:{valType:"any",dflt:{}},displaylogo:{valType:"boolean",dflt:!0},watermark:{valType:"boolean",dflt:!1},plotGlPixelRatio:{valType:"number",dflt:2,min:1,max:4},setBackground:{valType:"any",dflt:"transparent"},topojsonURL:{valType:"string",noBlank:!0,dflt:"https://cdn.plot.ly/un/"},mapboxAccessToken:{valType:"string",dflt:null},logging:{valType:"integer",min:0,max:2,dflt:1},notifyOnLogging:{valType:"integer",min:0,max:2,dflt:0},queueLength:{valType:"integer",min:0,dflt:0},locale:{valType:"string",dflt:"en-US"},locales:{valType:"any",dflt:{}}},g={};function P(S,t){for(var e in S){var r=S[e];r.valType?t[e]=r.dflt:(t[e]||(t[e]={}),P(r,t[e]))}}P(c,g),$.exports={configAttributes:c,dfltConfig:g}}),ns=Ft((Q,$)=>{var c=un(),g=ra(),P=[];$.exports=function(S,t){if(P.indexOf(S)!==-1)return;P.push(S);var e=1e3;g(t)?e=t:t==="long"&&(e=3e3);var r=c.select("body").selectAll(".plotly-notifier").data([0]);r.enter().append("div").classed("plotly-notifier",!0);var a=r.selectAll(".notifier-note").data(P);function n(o){o.duration(700).style("opacity",0).each("end",function(i){var s=P.indexOf(i);s!==-1&&P.splice(s,1),c.select(this).remove()})}a.enter().append("div").classed("notifier-note",!0).style("opacity",0).each(function(o){var i=c.select(this);i.append("button").classed("notifier-close",!0).html("×").on("click",function(){i.transition().call(n)});for(var s=i.append("p"),f=o.split(//g),x=0;x{var c=ms().dfltConfig,g=ns(),P=$.exports={};P.log=function(){var S;if(c.logging>1){var t=["LOG:"];for(S=0;S1){var e=[];for(S=0;S"),"long")}},P.warn=function(){var S;if(c.logging>0){var t=["WARN:"];for(S=0;S0){var e=[];for(S=0;S"),"stick")}},P.error=function(){var S;if(c.logging>0){var t=["ERROR:"];for(S=0;S0){var e=[];for(S=0;S"),"stick")}}}),Oo=Ft((Q,$)=>{$.exports=function(){}}),wl=Ft((Q,$)=>{$.exports=function(c,g){if(g instanceof RegExp){for(var P=g.toString(),S=0;S{$.exports=c;function c(){var g=new Float32Array(16);return g[0]=1,g[1]=0,g[2]=0,g[3]=0,g[4]=0,g[5]=1,g[6]=0,g[7]=0,g[8]=0,g[9]=0,g[10]=1,g[11]=0,g[12]=0,g[13]=0,g[14]=0,g[15]=1,g}}),Il=Ft((Q,$)=>{$.exports=c;function c(g){var P=new Float32Array(16);return P[0]=g[0],P[1]=g[1],P[2]=g[2],P[3]=g[3],P[4]=g[4],P[5]=g[5],P[6]=g[6],P[7]=g[7],P[8]=g[8],P[9]=g[9],P[10]=g[10],P[11]=g[11],P[12]=g[12],P[13]=g[13],P[14]=g[14],P[15]=g[15],P}}),du=Ft((Q,$)=>{$.exports=c;function c(g,P){return g[0]=P[0],g[1]=P[1],g[2]=P[2],g[3]=P[3],g[4]=P[4],g[5]=P[5],g[6]=P[6],g[7]=P[7],g[8]=P[8],g[9]=P[9],g[10]=P[10],g[11]=P[11],g[12]=P[12],g[13]=P[13],g[14]=P[14],g[15]=P[15],g}}),Hu=Ft((Q,$)=>{$.exports=c;function c(g){return g[0]=1,g[1]=0,g[2]=0,g[3]=0,g[4]=0,g[5]=1,g[6]=0,g[7]=0,g[8]=0,g[9]=0,g[10]=1,g[11]=0,g[12]=0,g[13]=0,g[14]=0,g[15]=1,g}}),Fc=Ft((Q,$)=>{$.exports=c;function c(g,P){if(g===P){var S=P[1],t=P[2],e=P[3],r=P[6],a=P[7],n=P[11];g[1]=P[4],g[2]=P[8],g[3]=P[12],g[4]=S,g[6]=P[9],g[7]=P[13],g[8]=t,g[9]=r,g[11]=P[14],g[12]=e,g[13]=a,g[14]=n}else g[0]=P[0],g[1]=P[4],g[2]=P[8],g[3]=P[12],g[4]=P[1],g[5]=P[5],g[6]=P[9],g[7]=P[13],g[8]=P[2],g[9]=P[6],g[10]=P[10],g[11]=P[14],g[12]=P[3],g[13]=P[7],g[14]=P[11],g[15]=P[15];return g}}),kc=Ft((Q,$)=>{$.exports=c;function c(g,P){var S=P[0],t=P[1],e=P[2],r=P[3],a=P[4],n=P[5],o=P[6],i=P[7],s=P[8],f=P[9],x=P[10],y=P[11],v=P[12],T=P[13],u=P[14],b=P[15],_=S*n-t*a,C=S*o-e*a,M=S*i-r*a,E=t*o-e*n,A=t*i-r*n,h=e*i-r*o,p=s*T-f*v,k=s*u-x*v,w=s*b-y*v,R=f*u-x*T,O=f*b-y*T,N=x*b-y*u,V=_*N-C*O+M*R+E*w-A*k+h*p;return V?(V=1/V,g[0]=(n*N-o*O+i*R)*V,g[1]=(e*O-t*N-r*R)*V,g[2]=(T*h-u*A+b*E)*V,g[3]=(x*A-f*h-y*E)*V,g[4]=(o*w-a*N-i*k)*V,g[5]=(S*N-e*w+r*k)*V,g[6]=(u*M-v*h-b*C)*V,g[7]=(s*h-x*M+y*C)*V,g[8]=(a*O-n*w+i*p)*V,g[9]=(t*w-S*O-r*p)*V,g[10]=(v*A-T*M+b*_)*V,g[11]=(f*M-s*A-y*_)*V,g[12]=(n*k-a*R-o*p)*V,g[13]=(S*R-t*k+e*p)*V,g[14]=(T*C-v*E-u*_)*V,g[15]=(s*E-f*C+x*_)*V,g):null}}),Vd=Ft((Q,$)=>{$.exports=c;function c(g,P){var S=P[0],t=P[1],e=P[2],r=P[3],a=P[4],n=P[5],o=P[6],i=P[7],s=P[8],f=P[9],x=P[10],y=P[11],v=P[12],T=P[13],u=P[14],b=P[15];return g[0]=n*(x*b-y*u)-f*(o*b-i*u)+T*(o*y-i*x),g[1]=-(t*(x*b-y*u)-f*(e*b-r*u)+T*(e*y-r*x)),g[2]=t*(o*b-i*u)-n*(e*b-r*u)+T*(e*i-r*o),g[3]=-(t*(o*y-i*x)-n*(e*y-r*x)+f*(e*i-r*o)),g[4]=-(a*(x*b-y*u)-s*(o*b-i*u)+v*(o*y-i*x)),g[5]=S*(x*b-y*u)-s*(e*b-r*u)+v*(e*y-r*x),g[6]=-(S*(o*b-i*u)-a*(e*b-r*u)+v*(e*i-r*o)),g[7]=S*(o*y-i*x)-a*(e*y-r*x)+s*(e*i-r*o),g[8]=a*(f*b-y*T)-s*(n*b-i*T)+v*(n*y-i*f),g[9]=-(S*(f*b-y*T)-s*(t*b-r*T)+v*(t*y-r*f)),g[10]=S*(n*b-i*T)-a*(t*b-r*T)+v*(t*i-r*n),g[11]=-(S*(n*y-i*f)-a*(t*y-r*f)+s*(t*i-r*n)),g[12]=-(a*(f*u-x*T)-s*(n*u-o*T)+v*(n*x-o*f)),g[13]=S*(f*u-x*T)-s*(t*u-e*T)+v*(t*x-e*f),g[14]=-(S*(n*u-o*T)-a*(t*u-e*T)+v*(t*o-e*n)),g[15]=S*(n*x-o*f)-a*(t*x-e*f)+s*(t*o-e*n),g}}),kd=Ft((Q,$)=>{$.exports=c;function c(g){var P=g[0],S=g[1],t=g[2],e=g[3],r=g[4],a=g[5],n=g[6],o=g[7],i=g[8],s=g[9],f=g[10],x=g[11],y=g[12],v=g[13],T=g[14],u=g[15],b=P*a-S*r,_=P*n-t*r,C=P*o-e*r,M=S*n-t*a,E=S*o-e*a,A=t*o-e*n,h=i*v-s*y,p=i*T-f*y,k=i*u-x*y,w=s*T-f*v,R=s*u-x*v,O=f*u-x*T;return b*O-_*R+C*w+M*k-E*p+A*h}}),e0=Ft((Q,$)=>{$.exports=c;function c(g,P,S){var t=P[0],e=P[1],r=P[2],a=P[3],n=P[4],o=P[5],i=P[6],s=P[7],f=P[8],x=P[9],y=P[10],v=P[11],T=P[12],u=P[13],b=P[14],_=P[15],C=S[0],M=S[1],E=S[2],A=S[3];return g[0]=C*t+M*n+E*f+A*T,g[1]=C*e+M*o+E*x+A*u,g[2]=C*r+M*i+E*y+A*b,g[3]=C*a+M*s+E*v+A*_,C=S[4],M=S[5],E=S[6],A=S[7],g[4]=C*t+M*n+E*f+A*T,g[5]=C*e+M*o+E*x+A*u,g[6]=C*r+M*i+E*y+A*b,g[7]=C*a+M*s+E*v+A*_,C=S[8],M=S[9],E=S[10],A=S[11],g[8]=C*t+M*n+E*f+A*T,g[9]=C*e+M*o+E*x+A*u,g[10]=C*r+M*i+E*y+A*b,g[11]=C*a+M*s+E*v+A*_,C=S[12],M=S[13],E=S[14],A=S[15],g[12]=C*t+M*n+E*f+A*T,g[13]=C*e+M*o+E*x+A*u,g[14]=C*r+M*i+E*y+A*b,g[15]=C*a+M*s+E*v+A*_,g}}),d0=Ft((Q,$)=>{$.exports=c;function c(g,P,S){var t=S[0],e=S[1],r=S[2],a,n,o,i,s,f,x,y,v,T,u,b;return P===g?(g[12]=P[0]*t+P[4]*e+P[8]*r+P[12],g[13]=P[1]*t+P[5]*e+P[9]*r+P[13],g[14]=P[2]*t+P[6]*e+P[10]*r+P[14],g[15]=P[3]*t+P[7]*e+P[11]*r+P[15]):(a=P[0],n=P[1],o=P[2],i=P[3],s=P[4],f=P[5],x=P[6],y=P[7],v=P[8],T=P[9],u=P[10],b=P[11],g[0]=a,g[1]=n,g[2]=o,g[3]=i,g[4]=s,g[5]=f,g[6]=x,g[7]=y,g[8]=v,g[9]=T,g[10]=u,g[11]=b,g[12]=a*t+s*e+v*r+P[12],g[13]=n*t+f*e+T*r+P[13],g[14]=o*t+x*e+u*r+P[14],g[15]=i*t+y*e+b*r+P[15]),g}}),Pm=Ft((Q,$)=>{$.exports=c;function c(g,P,S){var t=S[0],e=S[1],r=S[2];return g[0]=P[0]*t,g[1]=P[1]*t,g[2]=P[2]*t,g[3]=P[3]*t,g[4]=P[4]*e,g[5]=P[5]*e,g[6]=P[6]*e,g[7]=P[7]*e,g[8]=P[8]*r,g[9]=P[9]*r,g[10]=P[10]*r,g[11]=P[11]*r,g[12]=P[12],g[13]=P[13],g[14]=P[14],g[15]=P[15],g}}),uv=Ft((Q,$)=>{$.exports=c;function c(g,P,S,t){var e=t[0],r=t[1],a=t[2],n=Math.sqrt(e*e+r*r+a*a),o,i,s,f,x,y,v,T,u,b,_,C,M,E,A,h,p,k,w,R,O,N,V,H;return Math.abs(n)<1e-6?null:(n=1/n,e*=n,r*=n,a*=n,o=Math.sin(S),i=Math.cos(S),s=1-i,f=P[0],x=P[1],y=P[2],v=P[3],T=P[4],u=P[5],b=P[6],_=P[7],C=P[8],M=P[9],E=P[10],A=P[11],h=e*e*s+i,p=r*e*s+a*o,k=a*e*s-r*o,w=e*r*s-a*o,R=r*r*s+i,O=a*r*s+e*o,N=e*a*s+r*o,V=r*a*s-e*o,H=a*a*s+i,g[0]=f*h+T*p+C*k,g[1]=x*h+u*p+M*k,g[2]=y*h+b*p+E*k,g[3]=v*h+_*p+A*k,g[4]=f*w+T*R+C*O,g[5]=x*w+u*R+M*O,g[6]=y*w+b*R+E*O,g[7]=v*w+_*R+A*O,g[8]=f*N+T*V+C*H,g[9]=x*N+u*V+M*H,g[10]=y*N+b*V+E*H,g[11]=v*N+_*V+A*H,P!==g&&(g[12]=P[12],g[13]=P[13],g[14]=P[14],g[15]=P[15]),g)}}),sp=Ft((Q,$)=>{$.exports=c;function c(g,P,S){var t=Math.sin(S),e=Math.cos(S),r=P[4],a=P[5],n=P[6],o=P[7],i=P[8],s=P[9],f=P[10],x=P[11];return P!==g&&(g[0]=P[0],g[1]=P[1],g[2]=P[2],g[3]=P[3],g[12]=P[12],g[13]=P[13],g[14]=P[14],g[15]=P[15]),g[4]=r*e+i*t,g[5]=a*e+s*t,g[6]=n*e+f*t,g[7]=o*e+x*t,g[8]=i*e-r*t,g[9]=s*e-a*t,g[10]=f*e-n*t,g[11]=x*e-o*t,g}}),p0=Ft((Q,$)=>{$.exports=c;function c(g,P,S){var t=Math.sin(S),e=Math.cos(S),r=P[0],a=P[1],n=P[2],o=P[3],i=P[8],s=P[9],f=P[10],x=P[11];return P!==g&&(g[4]=P[4],g[5]=P[5],g[6]=P[6],g[7]=P[7],g[12]=P[12],g[13]=P[13],g[14]=P[14],g[15]=P[15]),g[0]=r*e-i*t,g[1]=a*e-s*t,g[2]=n*e-f*t,g[3]=o*e-x*t,g[8]=r*t+i*e,g[9]=a*t+s*e,g[10]=n*t+f*e,g[11]=o*t+x*e,g}}),zm=Ft((Q,$)=>{$.exports=c;function c(g,P,S){var t=Math.sin(S),e=Math.cos(S),r=P[0],a=P[1],n=P[2],o=P[3],i=P[4],s=P[5],f=P[6],x=P[7];return P!==g&&(g[8]=P[8],g[9]=P[9],g[10]=P[10],g[11]=P[11],g[12]=P[12],g[13]=P[13],g[14]=P[14],g[15]=P[15]),g[0]=r*e+i*t,g[1]=a*e+s*t,g[2]=n*e+f*t,g[3]=o*e+x*t,g[4]=i*e-r*t,g[5]=s*e-a*t,g[6]=f*e-n*t,g[7]=x*e-o*t,g}}),zy=Ft((Q,$)=>{$.exports=c;function c(g,P,S){var t,e,r,a=S[0],n=S[1],o=S[2],i=Math.sqrt(a*a+n*n+o*o);return Math.abs(i)<1e-6?null:(i=1/i,a*=i,n*=i,o*=i,t=Math.sin(P),e=Math.cos(P),r=1-e,g[0]=a*a*r+e,g[1]=n*a*r+o*t,g[2]=o*a*r-n*t,g[3]=0,g[4]=a*n*r-o*t,g[5]=n*n*r+e,g[6]=o*n*r+a*t,g[7]=0,g[8]=a*o*r+n*t,g[9]=n*o*r-a*t,g[10]=o*o*r+e,g[11]=0,g[12]=0,g[13]=0,g[14]=0,g[15]=1,g)}}),K4=Ft((Q,$)=>{$.exports=c;function c(g,P,S){var t=P[0],e=P[1],r=P[2],a=P[3],n=t+t,o=e+e,i=r+r,s=t*n,f=t*o,x=t*i,y=e*o,v=e*i,T=r*i,u=a*n,b=a*o,_=a*i;return g[0]=1-(y+T),g[1]=f+_,g[2]=x-b,g[3]=0,g[4]=f-_,g[5]=1-(s+T),g[6]=v+u,g[7]=0,g[8]=x+b,g[9]=v-u,g[10]=1-(s+y),g[11]=0,g[12]=S[0],g[13]=S[1],g[14]=S[2],g[15]=1,g}}),sw=Ft((Q,$)=>{$.exports=c;function c(g,P){return g[0]=P[0],g[1]=0,g[2]=0,g[3]=0,g[4]=0,g[5]=P[1],g[6]=0,g[7]=0,g[8]=0,g[9]=0,g[10]=P[2],g[11]=0,g[12]=0,g[13]=0,g[14]=0,g[15]=1,g}}),lw=Ft((Q,$)=>{$.exports=c;function c(g,P){return g[0]=1,g[1]=0,g[2]=0,g[3]=0,g[4]=0,g[5]=1,g[6]=0,g[7]=0,g[8]=0,g[9]=0,g[10]=1,g[11]=0,g[12]=P[0],g[13]=P[1],g[14]=P[2],g[15]=1,g}}),uw=Ft((Q,$)=>{$.exports=c;function c(g,P){var S=Math.sin(P),t=Math.cos(P);return g[0]=1,g[1]=0,g[2]=0,g[3]=0,g[4]=0,g[5]=t,g[6]=S,g[7]=0,g[8]=0,g[9]=-S,g[10]=t,g[11]=0,g[12]=0,g[13]=0,g[14]=0,g[15]=1,g}}),X4=Ft((Q,$)=>{$.exports=c;function c(g,P){var S=Math.sin(P),t=Math.cos(P);return g[0]=t,g[1]=0,g[2]=-S,g[3]=0,g[4]=0,g[5]=1,g[6]=0,g[7]=0,g[8]=S,g[9]=0,g[10]=t,g[11]=0,g[12]=0,g[13]=0,g[14]=0,g[15]=1,g}}),J4=Ft((Q,$)=>{$.exports=c;function c(g,P){var S=Math.sin(P),t=Math.cos(P);return g[0]=t,g[1]=S,g[2]=0,g[3]=0,g[4]=-S,g[5]=t,g[6]=0,g[7]=0,g[8]=0,g[9]=0,g[10]=1,g[11]=0,g[12]=0,g[13]=0,g[14]=0,g[15]=1,g}}),Q4=Ft((Q,$)=>{$.exports=c;function c(g,P){var S=P[0],t=P[1],e=P[2],r=P[3],a=S+S,n=t+t,o=e+e,i=S*a,s=t*a,f=t*n,x=e*a,y=e*n,v=e*o,T=r*a,u=r*n,b=r*o;return g[0]=1-f-v,g[1]=s+b,g[2]=x-u,g[3]=0,g[4]=s-b,g[5]=1-i-v,g[6]=y+T,g[7]=0,g[8]=x+u,g[9]=y-T,g[10]=1-i-f,g[11]=0,g[12]=0,g[13]=0,g[14]=0,g[15]=1,g}}),t6=Ft((Q,$)=>{$.exports=c;function c(g,P,S,t,e,r,a){var n=1/(S-P),o=1/(e-t),i=1/(r-a);return g[0]=r*2*n,g[1]=0,g[2]=0,g[3]=0,g[4]=0,g[5]=r*2*o,g[6]=0,g[7]=0,g[8]=(S+P)*n,g[9]=(e+t)*o,g[10]=(a+r)*i,g[11]=-1,g[12]=0,g[13]=0,g[14]=a*r*2*i,g[15]=0,g}}),e6=Ft((Q,$)=>{$.exports=c;function c(g,P,S,t,e){var r=1/Math.tan(P/2),a=1/(t-e);return g[0]=r/S,g[1]=0,g[2]=0,g[3]=0,g[4]=0,g[5]=r,g[6]=0,g[7]=0,g[8]=0,g[9]=0,g[10]=(e+t)*a,g[11]=-1,g[12]=0,g[13]=0,g[14]=2*e*t*a,g[15]=0,g}}),r6=Ft((Q,$)=>{$.exports=c;function c(g,P,S,t){var e=Math.tan(P.upDegrees*Math.PI/180),r=Math.tan(P.downDegrees*Math.PI/180),a=Math.tan(P.leftDegrees*Math.PI/180),n=Math.tan(P.rightDegrees*Math.PI/180),o=2/(a+n),i=2/(e+r);return g[0]=o,g[1]=0,g[2]=0,g[3]=0,g[4]=0,g[5]=i,g[6]=0,g[7]=0,g[8]=-((a-n)*o*.5),g[9]=(e-r)*i*.5,g[10]=t/(S-t),g[11]=-1,g[12]=0,g[13]=0,g[14]=t*S/(S-t),g[15]=0,g}}),b_=Ft((Q,$)=>{$.exports=c;function c(g,P,S,t,e,r,a){var n=1/(P-S),o=1/(t-e),i=1/(r-a);return g[0]=-2*n,g[1]=0,g[2]=0,g[3]=0,g[4]=0,g[5]=-2*o,g[6]=0,g[7]=0,g[8]=0,g[9]=0,g[10]=2*i,g[11]=0,g[12]=(P+S)*n,g[13]=(e+t)*o,g[14]=(a+r)*i,g[15]=1,g}}),n6=Ft((Q,$)=>{var c=Hu();$.exports=g;function g(P,S,t,e){var r,a,n,o,i,s,f,x,y,v,T=S[0],u=S[1],b=S[2],_=e[0],C=e[1],M=e[2],E=t[0],A=t[1],h=t[2];return Math.abs(T-E)<1e-6&&Math.abs(u-A)<1e-6&&Math.abs(b-h)<1e-6?c(P):(f=T-E,x=u-A,y=b-h,v=1/Math.sqrt(f*f+x*x+y*y),f*=v,x*=v,y*=v,r=C*y-M*x,a=M*f-_*y,n=_*x-C*f,v=Math.sqrt(r*r+a*a+n*n),v?(v=1/v,r*=v,a*=v,n*=v):(r=0,a=0,n=0),o=x*n-y*a,i=y*r-f*n,s=f*a-x*r,v=Math.sqrt(o*o+i*i+s*s),v?(v=1/v,o*=v,i*=v,s*=v):(o=0,i=0,s=0),P[0]=r,P[1]=o,P[2]=f,P[3]=0,P[4]=a,P[5]=i,P[6]=x,P[7]=0,P[8]=n,P[9]=s,P[10]=y,P[11]=0,P[12]=-(r*T+a*u+n*b),P[13]=-(o*T+i*u+s*b),P[14]=-(f*T+x*u+y*b),P[15]=1,P)}}),i6=Ft((Q,$)=>{$.exports=c;function c(g){return"mat4("+g[0]+", "+g[1]+", "+g[2]+", "+g[3]+", "+g[4]+", "+g[5]+", "+g[6]+", "+g[7]+", "+g[8]+", "+g[9]+", "+g[10]+", "+g[11]+", "+g[12]+", "+g[13]+", "+g[14]+", "+g[15]+")"}}),cw=Ft((Q,$)=>{$.exports={create:ws(),clone:Il(),copy:du(),identity:Hu(),transpose:Fc(),invert:kc(),adjoint:Vd(),determinant:kd(),multiply:e0(),translate:d0(),scale:Pm(),rotate:uv(),rotateX:sp(),rotateY:p0(),rotateZ:zm(),fromRotation:zy(),fromRotationTranslation:K4(),fromScaling:sw(),fromTranslation:lw(),fromXRotation:uw(),fromYRotation:X4(),fromZRotation:J4(),fromQuat:Q4(),frustum:t6(),perspective:e6(),perspectiveFromFieldOfView:r6(),ortho:b_(),lookAt:n6(),str:i6()}}),w_=Ft(Q=>{var $=cw();Q.init2dArray=function(c,g){for(var P=new Array(c),S=0;S{var c=un(),g=Ko(),P=w_(),S=cw();function t(T){var u;if(typeof T=="string"){if(u=document.getElementById(T),u===null)throw new Error("No DOM element with id '"+T+"' exists on the page.");return u}else if(T==null)throw new Error("DOM element provided is null or undefined");return T}function e(T){var u=c.select(T);return u.node()instanceof HTMLElement&&u.size()&&u.classed("js-plotly-plot")}function r(T){var u=T&&T.parentNode;u&&u.removeChild(T)}function a(T,u){n("global",T,u)}function n(T,u,b){var _="plotly.js-style-"+T,C=document.getElementById(_);if(!(C&&C.matches(".no-inline-styles"))){C||(C=document.createElement("style"),C.setAttribute("id",_),C.appendChild(document.createTextNode("")),document.head.appendChild(C));var M=C.sheet;M?M.insertRule?M.insertRule(u+"{"+b+"}",0):M.addRule?M.addRule(u,b,0):g.warn("addStyleRule failed"):g.warn("Cannot addRelatedStyleRule, probably due to strict CSP...")}}function o(T){var u="plotly.js-style-"+T,b=document.getElementById(u);b&&r(b)}function i(T,u,b,_,C,M){var E=_.split(":"),A=C.split(":"),h="data-btn-style-event-added";M||(M=document),M.querySelectorAll(T).forEach(function(p){p.getAttribute(h)||(p.addEventListener("mouseenter",function(){var k=this.querySelector(b);k&&(k.style[E[0]]=E[1])}),p.addEventListener("mouseleave",function(){var k=this.querySelector(b);k&&(u&&this.matches(u)?k.style[E[0]]=E[1]:k.style[A[0]]=A[1])}),p.setAttribute(h,!0))})}function s(T){var u=x(T),b=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return u.forEach(function(_){var C=f(_);if(C){var M=P.convertCssMatrix(C);b=S.multiply(b,b,M)}}),b}function f(T){var u=window.getComputedStyle(T,null),b=u.getPropertyValue("-webkit-transform")||u.getPropertyValue("-moz-transform")||u.getPropertyValue("-ms-transform")||u.getPropertyValue("-o-transform")||u.getPropertyValue("transform");return b==="none"?null:b.replace("matrix","").replace("3d","").slice(1,-1).split(",").map(function(_){return+_})}function x(T){for(var u=[];y(T);)u.push(T),T=T.parentNode,typeof ShadowRoot=="function"&&T instanceof ShadowRoot&&(T=T.host);return u}function y(T){return T&&(T instanceof Element||T instanceof HTMLElement)}function v(T,u){return T&&u&&T.top===u.top&&T.left===u.left&&T.right===u.right&&T.bottom===u.bottom}$.exports={getGraphDiv:t,isPlotDiv:e,removeElement:r,addStyleRule:a,addRelatedStyleRule:n,deleteRelatedStyleRule:o,setStyleOnHover:i,getFullTransformMatrix:s,getElementTransformMatrix:f,getElementAndAncestors:x,equalDomRects:v}}),El=Ft((Q,$)=>{$.exports={mode:{valType:"enumerated",dflt:"afterall",values:["immediate","next","afterall"]},direction:{valType:"enumerated",values:["forward","reverse"],dflt:"forward"},fromcurrent:{valType:"boolean",dflt:!1},frame:{duration:{valType:"number",min:0,dflt:500},redraw:{valType:"boolean",dflt:!0}},transition:{duration:{valType:"number",min:0,dflt:500,editType:"none"},easing:{valType:"enumerated",dflt:"cubic-in-out",values:["linear","quad","cubic","sin","exp","circle","elastic","back","bounce","linear-in","quad-in","cubic-in","sin-in","exp-in","circle-in","elastic-in","back-in","bounce-in","linear-out","quad-out","cubic-out","sin-out","exp-out","circle-out","elastic-out","back-out","bounce-out","linear-in-out","quad-in-out","cubic-in-out","sin-in-out","exp-in-out","circle-in-out","elastic-in-out","back-in-out","bounce-in-out"],editType:"none"},ordering:{valType:"enumerated",values:["layout first","traces first"],dflt:"layout first",editType:"none"}}}}),Yc=Ft((Q,$)=>{var c=Ta().extendFlat,g=Ei(),P={valType:"flaglist",extras:["none"],flags:["calc","clearAxisTypes","plot","style","markerSize","colorbars"]},S={valType:"flaglist",extras:["none"],flags:["calc","plot","legend","ticks","axrange","layoutstyle","modebar","camera","arraydraw","colorbars"]},t=P.flags.slice().concat(["fullReplot"]),e=S.flags.slice().concat("layoutReplot");$.exports={traces:P,layout:S,traceFlags:function(){return r(t)},layoutFlags:function(){return r(e)},update:function(o,i){var s=i.editType;if(s&&s!=="none")for(var f=s.split("+"),x=0;x{Q.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},Q.pattern={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},path:{valType:"string",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}}),k_=Ft((Q,$)=>{$.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}}),$u=Ft(Q=>{var{DATE_FORMAT_LINK:$,FORMAT_LINK:c}=k_(),g=["Variables that can't be found will be replaced with the specifier.",'For example, a template of "data: %{x}, %{y}" will result in a value of "data: 1, %{y}" if x is 1 and y is missing.',"Variables with an undefined value will be replaced with the fallback value."].join(" ");function P({supportOther:S}={}){return["Variables are inserted using %{variable},",'for example "y: %{y}"'+(S?" as well as %{xother}, {%_xother}, {%_xother_}, {%xother_}. When showing info for several points, *xother* will be added to those with different x positions from the first point. An underscore before or after *(x|y)other* will add a space on that side, only when this field is shown.":"."),`Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{y:$.2f}".`,c,"for details on the formatting syntax.",`Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}".`,$,"for details on the date formatting syntax.",g].join(" ")}Q.templateFormatStringDescription=P,Q.hovertemplateAttrs=({editType:S="none",arrayOk:t}={},e={})=>Fr({valType:"string",dflt:"",editType:S},t!==!1?{arrayOk:!0}:{}),Q.texttemplateAttrs=({editType:S="calc",arrayOk:t}={},e={})=>Fr({valType:"string",dflt:"",editType:S},t!==!1?{arrayOk:!0}:{}),Q.shapeTexttemplateAttrs=({editType:S="arraydraw",newshape:t}={},e={})=>({valType:"string",dflt:"",editType:S}),Q.templatefallbackAttrs=({editType:S="none"}={})=>({valType:"any",dflt:"-",editType:S})}),y1=Ft((Q,$)=>{function c(b,_){return _?_.d2l(b):b}function g(b,_){return _?_.l2d(b):b}function P(b){return b.x0}function S(b){return b.x1}function t(b){return b.y0}function e(b){return b.y1}function r(b){return b.x0shift||0}function a(b){return b.x1shift||0}function n(b){return b.y0shift||0}function o(b){return b.y1shift||0}function i(b,_){return c(b.x1,_)+a(b)-c(b.x0,_)-r(b)}function s(b,_,C){return c(b.y1,C)+o(b)-c(b.y0,C)-n(b)}function f(b,_){return Math.abs(i(b,_))}function x(b,_,C){return Math.abs(s(b,_,C))}function y(b,_,C){return b.type!=="line"?void 0:Math.sqrt(Math.pow(i(b,_),2)+Math.pow(s(b,_,C),2))}function v(b,_){return g((c(b.x1,_)+a(b)+c(b.x0,_)+r(b))/2,_)}function T(b,_,C){return g((c(b.y1,C)+o(b)+c(b.y0,C)+n(b))/2,C)}function u(b,_,C){return b.type!=="line"?void 0:s(b,_,C)/i(b,_)}$.exports={x0:P,x1:S,y0:t,y1:e,slope:u,dx:i,dy:s,width:f,height:x,length:y,xcenter:v,ycenter:T}}),hw=Ft((Q,$)=>{var c=Yc().overrideAll,g=$o(),P=Ea(),S=Td().dash,t=Ta().extendFlat,{shapeTexttemplateAttrs:e,templatefallbackAttrs:r}=$u(),a=y1();$.exports=c({newshape:{visible:t({},g.visible,{}),showlegend:{valType:"boolean",dflt:!1},legend:t({},g.legend,{}),legendgroup:t({},g.legendgroup,{}),legendgrouptitle:{text:t({},g.legendgrouptitle.text,{}),font:P({})},legendrank:t({},g.legendrank,{}),legendwidth:t({},g.legendwidth,{}),line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:4},dash:t({},S,{dflt:"solid"})},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd"},opacity:{valType:"number",min:0,max:1,dflt:1},layer:{valType:"enumerated",values:["below","above","between"],dflt:"above"},drawdirection:{valType:"enumerated",values:["ortho","horizontal","vertical","diagonal"],dflt:"diagonal"},name:t({},g.name,{}),label:{text:{valType:"string",dflt:""},texttemplate:e({newshape:!0},{keys:Object.keys(a)}),texttemplatefallback:r({editType:"arraydraw"}),font:P({}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right","start","middle","end"]},textangle:{valType:"angle",dflt:"auto"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto"},yanchor:{valType:"enumerated",values:["top","middle","bottom"]},padding:{valType:"number",dflt:3,min:0}}},activeshape:{fillcolor:{valType:"color",dflt:"rgb(255,0,255)",description:"Sets the color filling the active shape' interior."},opacity:{valType:"number",min:0,max:1,dflt:.5}}},"none","from-root")}),cv=Ft((Q,$)=>{var c=Td().dash,g=Ta().extendFlat;$.exports={newselection:{mode:{valType:"enumerated",values:["immediate","gradual"],dflt:"immediate",editType:"none"},line:{color:{valType:"color",editType:"none"},width:{valType:"number",min:1,dflt:1,editType:"none"},dash:g({},c,{dflt:"dot",editType:"none"}),editType:"none"},editType:"none"},activeselection:{fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:.5,editType:"none"},editType:"none"}}}),Iy=Ft((Q,$)=>{$.exports=function(c){var g=c.editType;return{t:{valType:"number",dflt:0,editType:g},r:{valType:"number",dflt:0,editType:g},b:{valType:"number",dflt:0,editType:g},l:{valType:"number",dflt:0,editType:g},editType:g}}}),x1=Ft((Q,$)=>{var c=Ea(),g=El(),P=bi(),S=hw(),t=cv(),e=Iy(),r=Ta().extendFlat,a=c({editType:"calc"});a.family.dflt='"Open Sans", verdana, arial, sans-serif',a.size.dflt=12,a.color.dflt=P.defaultLine,$.exports={font:a,title:{text:{valType:"string",editType:"layoutstyle"},font:c({editType:"layoutstyle"}),subtitle:{text:{valType:"string",editType:"layoutstyle"},font:c({editType:"layoutstyle"}),editType:"layoutstyle"},xref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},yref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},x:{valType:"number",min:0,max:1,dflt:.5,editType:"layoutstyle"},y:{valType:"number",min:0,max:1,dflt:"auto",editType:"layoutstyle"},xanchor:{valType:"enumerated",dflt:"auto",values:["auto","left","center","right"],editType:"layoutstyle"},yanchor:{valType:"enumerated",dflt:"auto",values:["auto","top","middle","bottom"],editType:"layoutstyle"},pad:r(e({editType:"layoutstyle"}),{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},editType:"layoutstyle"},uniformtext:{mode:{valType:"enumerated",values:[!1,"hide","show"],dflt:!1,editType:"plot"},minsize:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"plot"},autosize:{valType:"boolean",dflt:!1,editType:"none"},width:{valType:"number",min:10,dflt:700,editType:"plot"},height:{valType:"number",min:10,dflt:450,editType:"plot"},minreducedwidth:{valType:"number",min:2,dflt:64,editType:"plot"},minreducedheight:{valType:"number",min:2,dflt:64,editType:"plot"},margin:{l:{valType:"number",min:0,dflt:80,editType:"plot"},r:{valType:"number",min:0,dflt:80,editType:"plot"},t:{valType:"number",min:0,dflt:100,editType:"plot"},b:{valType:"number",min:0,dflt:80,editType:"plot"},pad:{valType:"number",min:0,dflt:0,editType:"plot"},autoexpand:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},computed:{valType:"any",editType:"none"},paper_bgcolor:{valType:"color",dflt:P.background,editType:"plot"},plot_bgcolor:{valType:"color",dflt:P.background,editType:"layoutstyle"},autotypenumbers:{valType:"enumerated",values:["convert types","strict"],dflt:"convert types",editType:"calc"},separators:{valType:"string",editType:"plot"},hidesources:{valType:"boolean",dflt:!1,editType:"plot"},showlegend:{valType:"boolean",editType:"legend"},colorway:{valType:"colorlist",dflt:P.defaults,editType:"calc"},datarevision:{valType:"any",editType:"calc"},uirevision:{valType:"any",editType:"none"},editrevision:{valType:"any",editType:"none"},selectionrevision:{valType:"any",editType:"none"},template:{valType:"any",editType:"calc"},newshape:S.newshape,activeshape:S.activeshape,newselection:t.newselection,activeselection:t.activeselection,meta:{valType:"any",arrayOk:!0,editType:"plot"},transition:r({},g.transition,{editType:"none"})}}),a6=Ft(()=>{(function(){if(!document.getElementById("8431bff7cc77ea8693f8122c6e0981316b936a0a4930625e08b1512d134062bc")){var Q=document.createElement("style");Q.id="8431bff7cc77ea8693f8122c6e0981316b936a0a4930625e08b1512d134062bc",Q.textContent=`.maplibregl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgb(0 0 0/0)}.maplibregl-canvas{left:0;position:absolute;top:0}.maplibregl-map:fullscreen{height:100%;width:100%}.maplibregl-ctrl-group button.maplibregl-ctrl-compass{touch-action:none}.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:grabbing}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.maplibregl-ctrl-top-left{left:0;top:0}.maplibregl-ctrl-top-right{right:0;top:0}.maplibregl-ctrl-bottom-left{bottom:0;left:0}.maplibregl-ctrl-bottom-right{bottom:0;right:0}.maplibregl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.maplibregl-ctrl-top-left .maplibregl-ctrl{float:left;margin:10px 0 0 10px}.maplibregl-ctrl-top-right .maplibregl-ctrl{float:right;margin:10px 10px 0 0}.maplibregl-ctrl-bottom-left .maplibregl-ctrl{float:left;margin:0 0 10px 10px}.maplibregl-ctrl-bottom-right .maplibregl-ctrl{float:right;margin:0 10px 10px 0}.maplibregl-ctrl-group{background:#fff;border-radius:4px}.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (forced-colors:active){.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.maplibregl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;padding:0;width:29px}.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.maplibregl-ctrl button .maplibregl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (forced-colors:active){.maplibregl-ctrl-icon{background-color:transparent}.maplibregl-ctrl-group button+button{border-top:1px solid ButtonText}}.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl button:disabled{cursor:not-allowed}.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}.maplibregl-ctrl button:not(:disabled):hover{background-color:rgb(0 0 0/5%)}.maplibregl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.maplibregl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.maplibregl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.maplibregl-ctrl-group button:focus:only-child{border-radius:inherit}.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%23333' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%2333b5e5' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23aaa' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{animation:maplibregl-spin 2s linear infinite}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23999' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23666' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}}@keyframes maplibregl-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.maplibregl-ctrl-logo.maplibregl-compact{width:14px}@media (forced-colors:active){a.maplibregl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E")}}.maplibregl-ctrl.maplibregl-ctrl-attrib{background-color:hsla(0,0%,100%,.5);margin:0;padding:0 5px}@media screen{.maplibregl-ctrl-attrib.maplibregl-compact{background-color:#fff;border-radius:12px;box-sizing:content-box;color:#000;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.maplibregl-ctrl-attrib-button{background-color:hsla(0,0%,100%,.5);background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;list-style:none}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker{display:none}.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button{left:0}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner{display:block}.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button{background-color:rgb(0 0 0/5%)}.maplibregl-ctrl-bottom-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;right:0}.maplibregl-ctrl-top-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{right:0;top:0}.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{left:0;top:0}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;left:0}}@media screen and (forced-colors:active){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='%23fff' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}@media screen and (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}.maplibregl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:hsla(0,0%,100%,.75);border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px}.maplibregl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{flex-direction:column}.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{flex-direction:column-reverse}.maplibregl-popup-anchor-left{flex-direction:row}.maplibregl-popup-anchor-right{flex-direction:row-reverse}.maplibregl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.maplibregl-popup-anchor-top .maplibregl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.maplibregl-popup-anchor-left .maplibregl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.maplibregl-popup-anchor-right .maplibregl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.maplibregl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.maplibregl-popup-close-button:hover{background-color:rgb(0 0 0/5%)}.maplibregl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:15px 10px;pointer-events:auto;position:relative}.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.maplibregl-popup-track-pointer{display:none}.maplibregl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.maplibregl-marker{left:0;position:absolute;top:0;transition:opacity .2s;will-change:transform}.maplibregl-user-location-dot,.maplibregl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.maplibregl-user-location-dot:before{animation:maplibregl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.maplibregl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px rgba(0,0,0,.35);box-sizing:border-box;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px}@keyframes maplibregl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.maplibregl-user-location-dot-stale{background-color:#aaa}.maplibregl-user-location-dot-stale:after{display:none}.maplibregl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.maplibregl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}.maplibregl-cooperative-gesture-screen{align-items:center;background:rgba(0,0,0,.4);color:#fff;display:flex;font-size:1.4em;inset:0;justify-content:center;line-height:1.2;opacity:0;padding:1rem;pointer-events:none;position:absolute;transition:opacity 1s ease 1s;z-index:99999}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media (hover:none),(width <= 480px){.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{display:none}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:block}}.maplibregl-pseudo-fullscreen{height:100%!important;left:0!important;position:fixed!important;top:0!important;width:100%!important;z-index:99999}`,document.head.appendChild(Q)}})()}),Xo=Ft(Q=>{var $=Ko(),c=Oo(),g=wl(),P=Ei(),S=r0().addStyleRule,t=Ta(),e=$o(),r=x1(),a=t.extendFlat,n=t.extendDeepAll;Q.modules={},Q.allCategories={},Q.allTypes=[],Q.subplotsRegistry={},Q.componentsRegistry={},Q.layoutArrayContainers=[],Q.layoutArrayRegexes=[],Q.traceLayoutAttributes={},Q.localeRegistry={},Q.apiMethodRegistry={},Q.collectableSubplotTypes=null,Q.register=function(b){if(Q.collectableSubplotTypes=null,b)b&&!Array.isArray(b)&&(b=[b]);else throw new Error("No argument passed to Plotly.register.");for(var _=0;_{var $=fa().timeFormat,c=ra(),g=Ko(),P=qo().mod,S=Da(),t=S.BADNUM,e=S.ONEDAY,r=S.ONEHOUR,a=S.ONEMIN,n=S.ONESEC,o=S.EPOCHJD,i=Xo(),s=fa().utcFormat,f=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d(:?\d\d)?)?)?)?)?)?\s*$/m,x=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d(:?\d\d)?)?)?)?)?)?\s*$/m,y=new Date().getFullYear()-70;function v(V){return V&&i.componentsRegistry.calendars&&typeof V=="string"&&V!=="gregorian"}Q.dateTick0=function(V,H){var F=T(V,!!H);if(H<2)return F;var U=Q.dateTime2ms(F,V);return U+=e*(H-1),Q.ms2DateTime(U,0,V)};function T(V,H){return v(V)?H?i.getComponentMethod("calendars","CANONICAL_SUNDAY")[V]:i.getComponentMethod("calendars","CANONICAL_TICK")[V]:H?"2000-01-02":"2000-01-01"}Q.dfltRange=function(V){return v(V)?i.getComponentMethod("calendars","DFLTRANGE")[V]:["2000-01-01","2001-01-01"]},Q.isJSDate=function(V){return typeof V=="object"&&V!==null&&typeof V.getTime=="function"};var u,b;Q.dateTime2ms=function(V,H){if(Q.isJSDate(V)){var F=V.getTimezoneOffset()*a,U=(V.getUTCMinutes()-V.getMinutes())*a+(V.getUTCSeconds()-V.getSeconds())*n+(V.getUTCMilliseconds()-V.getMilliseconds());if(U){var W=3*a;F=F-W/2+P(U-F+W/2,W)}return V=Number(V)-F,V>=u&&V<=b?V:t}if(typeof V!="string"&&typeof V!="number")return t;V=String(V);var q=v(H),X=V.charAt(0);q&&(X==="G"||X==="g")&&(V=V.substr(1),H="");var lt=q&&H.substr(0,7)==="chinese",yt=V.match(lt?x:f);if(!yt)return t;var pt=yt[1],st=yt[3]||"1",tt=Number(yt[5]||1),dt=Number(yt[7]||0),rt=Number(yt[9]||0),at=Number(yt[11]||0);if(q){if(pt.length===2)return t;pt=Number(pt);var vt;try{var it=i.getComponentMethod("calendars","getCal")(H);if(lt){var Y=st.charAt(st.length-1)==="i";st=parseInt(st,10),vt=it.newDate(pt,it.toMonthIndex(pt,st,Y),tt)}else vt=it.newDate(pt,Number(st),tt)}catch{return t}return vt?(vt.toJD()-o)*e+dt*r+rt*a+at*n:t}pt.length===2?pt=(Number(pt)+2e3-y)%100+y:pt=Number(pt),st-=1;var ft=new Date(Date.UTC(2e3,st,tt,dt,rt));return ft.setUTCFullYear(pt),ft.getUTCMonth()!==st||ft.getUTCDate()!==tt?t:ft.getTime()+at*n},u=Q.MIN_MS=Q.dateTime2ms("-9999"),b=Q.MAX_MS=Q.dateTime2ms("9999-12-31 23:59:59.9999"),Q.isDateTime=function(V,H){return Q.dateTime2ms(V,H)!==t};function _(V,H){return String(V+Math.pow(10,H)).substr(1)}var C=90*e,M=3*r,E=5*a;Q.ms2DateTime=function(V,H,F){if(typeof V!="number"||!(V>=u&&V<=b))return t;H||(H=0);var U=Math.floor(P(V+.05,1)*10),W=Math.round(V-U/10),q,X,lt,yt,pt,st;if(v(F)){var tt=Math.floor(W/e)+o,dt=Math.floor(P(V,e));try{q=i.getComponentMethod("calendars","getCal")(F).fromJD(tt).formatDate("yyyy-mm-dd")}catch{q=s("G%Y-%m-%d")(new Date(W))}if(q.charAt(0)==="-")for(;q.length<11;)q="-0"+q.substr(1);else for(;q.length<10;)q="0"+q;X=H=u+e&&V<=b-e))return t;var H=Math.floor(P(V+.05,1)*10),F=new Date(Math.round(V-H/10)),U=$("%Y-%m-%d")(F),W=F.getHours(),q=F.getMinutes(),X=F.getSeconds(),lt=F.getUTCMilliseconds()*10+H;return A(U,W,q,X,lt)};function A(V,H,F,U,W){if((H||F||U||W)&&(V+=" "+_(H,2)+":"+_(F,2),(U||W)&&(V+=":"+_(U,2),W))){for(var q=4;W%10===0;)q-=1,W/=10;V+="."+_(W,q)}return V}Q.cleanDate=function(V,H,F){if(V===t)return H;if(Q.isJSDate(V)||typeof V=="number"&&isFinite(V)){if(v(F))return g.error("JS Dates and milliseconds are incompatible with world calendars",V),H;if(V=Q.ms2DateTimeLocal(+V),!V&&H!==void 0)return H}else if(!Q.isDateTime(V,F))return g.error("unrecognized date",V),H;return V};var h=/%\d?f/g,p=/%h/g,k={1:"1",2:"1",3:"2",4:"2"};function w(V,H,F,U){V=V.replace(h,function(q){var X=Math.min(+q.charAt(1)||6,6),lt=(H/1e3%1+2).toFixed(X).substr(2).replace(/0+$/,"")||"0";return lt});var W=new Date(Math.floor(H+.05));if(V=V.replace(p,function(){return k[F("%q")(W)]}),v(U))try{V=i.getComponentMethod("calendars","worldCalFmt")(V,H,U)}catch{return"Invalid"}return F(V)(W)}var R=[59,59.9,59.99,59.999,59.9999];function O(V,H){var F=P(V+.05,e),U=_(Math.floor(F/r),2)+":"+_(P(Math.floor(F/a),60),2);if(H!=="M"){c(H)||(H=0);var W=Math.min(P(V/n,60),R[H]),q=(100+W).toFixed(H).substr(1);H>0&&(q=q.replace(/0+$/,"").replace(/[\.]$/,"")),U+=":"+q}return U}Q.formatDate=function(V,H,F,U,W,q){if(W=v(W)&&W,!H)if(F==="y")H=q.year;else if(F==="m")H=q.month;else if(F==="d")H=q.dayMonth+` @@ -3947,4 +3947,4 @@ maplibre-gl/dist/maplibre-gl.js: * MapLibre GL JS * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v4.7.1/LICENSE.txt *) -*/return window.Plotly=z,z})}(J5)),J5.exports}var Odt=Idt();const l1=LO(Odt),Ddt={class:"p-6 space-y-6"},Fdt={class:"flex justify-between items-center"},Rdt={class:"flex items-center gap-3"},Bdt=["value"],Ndt={class:"grid grid-cols-1 sm:grid-cols-2 gap-4"},jdt={class:"glass-card rounded-[15px] p-6"},Udt={class:"mb-6"},Vdt={class:"relative h-48 bg-white/5 rounded-lg p-4"},Hdt={key:0,class:"absolute inset-0 flex items-center justify-center bg-white/5 backdrop-blur-sm z-20"},Wdt={key:1,class:"absolute inset-0 flex items-center justify-center bg-white/5 z-20"},qdt={class:"mb-6"},Zdt={class:"relative h-48 bg-white/5 rounded-lg p-4"},$dt={key:0,class:"absolute inset-0 flex items-center justify-center bg-white/5 backdrop-blur-sm z-20"},Gdt={key:1,class:"absolute inset-0 flex items-center justify-center bg-white/5 z-20"},Ydt={class:"glass-card rounded-[15px] p-6"},Kdt={class:"grid grid-cols-1 lg:grid-cols-3 gap-6"},Xdt={class:"lg:col-span-2"},Jdt={class:"relative h-64 bg-white/5 rounded-lg p-4"},Qdt={class:"flex flex-col items-center justify-center"},tpt={class:"relative w-48 h-48"},ept={key:0,class:"absolute inset-0 flex items-center justify-center bg-white/5 backdrop-blur-sm rounded-full z-20"},rpt={key:1,class:"absolute inset-0 flex items-center justify-center bg-white/5 rounded-full z-20"},npt={key:0,class:"glass-card rounded-[15px] p-8 text-center"},ipt={key:1,class:"glass-card rounded-[15px] p-8 text-center"},apt={class:"text-white/60 text-sm"},opt=Th({name:"StatisticsView",__name:"Statistics",setup(d){d2.register(Uct,Wct,Yut,Z4,Tlt,blt,klt,Cct,Rct,Sct,Nut,ect,bct,kA);const l=rw(),z=lo(null),j=lo(!1),J=lo(24),mt=[{value:1,label:"1 Hour"},{value:6,label:"6 Hours"},{value:12,label:"12 Hours"},{value:24,label:"24 Hours"},{value:48,label:"2 Days"},{value:168,label:"1 Week"}],kt=lo(null),Dt=lo(null),Gt=lo([]),re=lo(null),pe=lo([]),Ne=lo(!0),or=lo(null),_r=lo({packetRate:!0,packetType:!0,noiseFloor:!1,routePie:!0}),Fr=lo(!1),zr=lo(!1),Wr=lo(!1),An=lo(null),Ft=lo(null),kn=lo(null),ei=lo(null),jn=lo(null),ai=lo(null),Qi=lo(null),Gi=Yo(()=>{const qo=l.packetStats;return qo?{totalRx:qo.total_packets||0,totalTx:qo.transmitted_packets||0}:{totalRx:0,totalTx:0}}),un=Yo(()=>{let qo=[],fo=[];if(kt.value?.series){const Ta=kt.value.series.find(go=>go.type==="rx_count"),Ea=kt.value.series.find(go=>go.type==="tx_count");Ta?.data&&(qo=Ta.data.map(([,go])=>go)),Ea?.data&&(fo=Ea.data.map(([,go])=>go))}return{totalPackets:qo,transmittedPackets:fo,droppedPackets:[]}}),ia=async()=>{try{Ne.value=!0,or.value=null,await Promise.all([l.fetchPacketStats({hours:J.value}),l.fetchSystemStats()]),Ne.value=!1,fa()}catch(qo){or.value=qo instanceof Error?qo.message:"Failed to fetch data",Ne.value=!1}},fa=async()=>{_r.value={packetRate:!0,packetType:!0,noiseFloor:!1,routePie:!0};const qo=[Li(),yi(),ra(),Da()];try{await Promise.allSettled(qo),await Z0(),!ei.value||!jn.value?setTimeout(()=>{Va()},100):Va()}catch(fo){console.error("Error loading chart data:",fo)}},Li=async()=>{_r.value.packetRate=!0;try{const qo=await Xh.get("/metrics_graph_data",{hours:J.value,resolution:"average",metrics:"rx_count,tx_count"});qo?.success&&(kt.value=qo.data)}catch{kt.value=null}},yi=async()=>{_r.value.packetType=!0;try{const qo=await Xh.get("/packet_type_graph_data",{hours:J.value,resolution:"average",types:"all"});if(qo?.success&&qo.data){const fo=qo.data;Gt.value=fo.series||[]}}catch{Gt.value=[]}},ra=async()=>{_r.value.routePie=!0;try{const qo=await Xh.get("/route_stats",{hours:J.value});qo?.success&&qo.data&&(re.value=qo.data)}catch{re.value=null}},Da=async()=>{try{const qo=await Xh.get("/noise_floor_history",{hours:J.value});if(qo.success&&qo.data){const Ta=qo.data.history||[];Array.isArray(Ta)&&Ta.length>0&&(Dt.value={chart_data:Ta.map(Ea=>({timestamp:Ea.timestamp||Date.now()/1e3,noise_floor_dbm:Ea.noise_floor_dbm||Ea.noise_floor||-120}))},Ei())}}catch{Dt.value={chart_data:[]}}},Ni=()=>{ss(),Fr.value=!1,zr.value=!1,Wr.value=!1,ia()},Ei=()=>{if(pe.value=[],Dt.value?.chart_data&&Dt.value.chart_data.length>0){const qo=Dt.value.chart_data,fo=Math.max(1,Math.floor(qo.length/100));pe.value=qo.filter((Ta,Ea)=>Ea%fo===0).map(Ta=>({timestamp:Ta.timestamp*1e3,snr:null,rssi:null,noiseFloor:Ta.noise_floor_dbm}))}},Va=()=>{if(!j.value){j.value=!0;try{mo(),ko(),pl(),fu(),setTimeout(()=>{_r.value.packetRate&&An.value&&(_r.value.packetRate=!1),_r.value.packetType&&Ft.value&&(_r.value.packetType=!1),_r.value.routePie&&Qi.value&&(_r.value.routePie=!1),_r.value.routePie&&Qi.value&&(_r.value.routePie=!1),setTimeout(()=>{const qo=ju(An.value),fo=ju(Ft.value),Ta=ju(kn.value);qo&&qo.update("none"),fo&&fo.update("none"),Ta&&Ta.update("none")},50)},100)}catch(qo){console.error("Error creating/updating charts:",qo),ss()}finally{j.value=!1}}},ss=()=>{try{An.value&&(An.value.destroy(),An.value=null),Ft.value&&(Ft.value.destroy(),Ft.value=null),kn.value&&(kn.value.destroy(),kn.value=null),Qi.value&&l1.purge(Qi.value)}catch(qo){console.error("Error destroying charts:",qo)}},mo=()=>{if(!ei.value){_r.value.packetRate=!1;return}const qo=ei.value.getContext("2d");if(!qo){_r.value.packetRate=!1;return}let fo=[],Ta=[];if(kt.value?.series){const Ea=kt.value.series.find(Ao=>Ao.type==="rx_count"),go=kt.value.series.find(Ao=>Ao.type==="tx_count");Ea?.data&&(fo=Ea.data.map(([Ao,Ps])=>{let $o=Ao;return Ao>1e15?$o=Ao/1e3:Ao>1e12?$o=Ao:Ao>1e9?$o=Ao*1e3:$o=Date.now(),{x:$o,y:Ps}})),go?.data&&(Ta=go.data.map(([Ao,Ps])=>{let $o=Ao;return Ao>1e15?$o=Ao/1e3:Ao>1e12?$o=Ao:Ao>1e9?$o=Ao*1e3:$o=Date.now(),{x:$o,y:Ps}}))}if(fo.length===0&&Ta.length===0){Fr.value=!0,_r.value.packetRate=!1;return}Fr.value=!1,An.value&&(An.value.destroy(),An.value=null);try{const Ea=JSON.parse(JSON.stringify(fo)),go=JSON.parse(JSON.stringify(Ta)),Ao=new d2(qo,{type:"line",data:{datasets:[{label:"RX/hr",data:Ea,borderColor:"#C084FC",backgroundColor:"rgba(192, 132, 252, 0.1)",borderWidth:2,fill:!0,tension:.4},{label:"TX/hr",data:go,borderColor:"#F59E0B",backgroundColor:"rgba(245, 158, 11, 0.1)",borderWidth:2,fill:!0,tension:.4}]},options:{responsive:!0,maintainAspectRatio:!1,animation:{duration:0},plugins:{legend:{display:!1},title:{display:!1}},scales:{x:{type:"time",time:{unit:"hour",displayFormats:{hour:"HH:mm"}},grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"rgba(255, 255, 255, 0.7)",maxTicksLimit:8}},y:{beginAtZero:!1,grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"rgba(255, 255, 255, 0.7)",callback:function(Ps){return typeof Ps=="number"?Ps.toFixed(3):Ps},stepSize:.002},min:0,max:.012}}}});An.value=ju(Ao),_r.value.packetRate=!1,setTimeout(()=>{_r.value.packetRate&&(_r.value.packetRate=!1)},50)}catch(Ea){console.error("Error creating packet rate chart:",Ea),Fr.value=!0,_r.value.packetRate=!1}},ko=()=>{if(!jn.value){_r.value.packetType=!1;return}const qo=jn.value.getContext("2d");if(!qo){_r.value.packetType=!1;return}const fo=[],Ta=[],Ea=["#60A5FA","#34D399","#FBBF24","#A78BFA","#F87171","#06B6D4","#84CC16","#F472B6","#10B981"];if(Gt.value.length>0)Gt.value.forEach(go=>{const Ao=go.data?go.data.reduce((Ps,$o)=>Ps+$o[1],0):0;Ao>0&&(fo.push(go.name.replace(/\([^)]*\)/g,"").trim()),Ta.push(Ao))});else{zr.value=!0,_r.value.packetType=!1;return}zr.value=!1,Ft.value&&(Ft.value.destroy(),Ft.value=null);try{const go=JSON.parse(JSON.stringify(fo)),Ao=JSON.parse(JSON.stringify(Ta)),Ps=new d2(qo,{type:"bar",data:{labels:go,datasets:[{data:Ao,backgroundColor:Ea.slice(0,Ao.length),borderRadius:8,borderSkipped:!1}]},options:{responsive:!0,maintainAspectRatio:!1,animation:{duration:0},plugins:{legend:{display:!1}},scales:{x:{grid:{display:!1},ticks:{color:"rgba(255, 255, 255, 0.7)",font:{size:10}}},y:{beginAtZero:!0,grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"rgba(255, 255, 255, 0.7)"}}}}});Ft.value=ju(Ps),_r.value.packetType=!1,setTimeout(()=>{_r.value.packetType&&(_r.value.packetType=!1)},50)}catch(go){console.error("Error creating packet type chart:",go),zr.value=!0,_r.value.packetType=!1}},pl=()=>{if(!ai.value)return;const qo=ai.value.getContext("2d");if(!qo)return;const fo=pe.value.map(go=>({x:go.timestamp,y:go.noiseFloor})).filter(go=>go.y!==null&&go.y!==void 0);if(kn.value)try{const go=ju(kn.value),Ao=JSON.parse(JSON.stringify(fo));go.data.datasets[0]&&(go.data.datasets[0].data=Ao),go.update("active");return}catch{kn.value.destroy(),kn.value=null}const Ta=JSON.parse(JSON.stringify(fo)),Ea=new d2(qo,{type:"line",data:{datasets:[{label:"Noise Floor (dBm)",data:Ta,borderColor:"#F59E0B",backgroundColor:"rgba(245, 158, 11, 0.1)",borderWidth:2,tension:.3,pointRadius:0,pointHoverRadius:3,fill:!1}]},options:{responsive:!0,maintainAspectRatio:!1,animation:{duration:0},interaction:{mode:"index",intersect:!1},plugins:{legend:{display:!0,position:"top",labels:{color:"rgba(255, 255, 255, 0.8)",usePointStyle:!0,padding:20}}},scales:{x:{type:"time",time:{unit:"hour",displayFormats:{hour:"HH:mm"}},grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"rgba(255, 255, 255, 0.7)",maxTicksLimit:8}},y:{type:"linear",display:!0,title:{display:!0,text:"Noise Floor (dBm)",color:"rgba(255, 255, 255, 0.8)"},grid:{color:"rgba(245, 158, 11, 0.2)"},ticks:{color:"#F59E0B",stepSize:.5,callback:function(go){return typeof go=="number"?go.toFixed(1):go}},min:-117,max:-113}}}});kn.value=ju(Ea)},fu=()=>{if(!Qi.value){_r.value.routePie=!1;return}if(!re.value||!re.value.route_totals){Wr.value=!0,_r.value.routePie=!1;return}Wr.value=!1;const qo=re.value.route_totals,fo=Object.keys(qo),Ta=Object.values(qo),Ea=["#3B82F6","#F87171","#10B981","#F59E0B","#A78BFA"];try{const go=JSON.parse(JSON.stringify(fo)),Ao=JSON.parse(JSON.stringify(Ta)),Ps=[{type:"pie",labels:go,values:Ao,marker:{colors:Ea.slice(0,Ao.length)},hovertemplate:"%{label}
Count: %{value}
Percentage: %{percent}",textinfo:"label+percent",textposition:"auto",pull:.1,hole:.3}],$o={title:{text:"",font:{color:"rgba(255, 255, 255, 0.8)"}},paper_bgcolor:"rgba(0,0,0,0)",plot_bgcolor:"rgba(0,0,0,0)",font:{color:"rgba(255, 255, 255, 0.8)",size:11},margin:{t:20,b:20,l:20,r:20},showlegend:!0,legend:{orientation:"h",x:0,y:-.2,font:{color:"rgba(255, 255, 255, 0.8)",size:10}}},gi={responsive:!0,displayModeBar:!1,staticPlot:!1};l1.newPlot(Qi.value,Ps,$o,gi),_r.value.routePie=!1,setTimeout(()=>{_r.value.routePie&&(_r.value.routePie=!1)},50)}catch(go){console.error("Error creating 3D route pie chart:",go),Wr.value=!0,_r.value.routePie=!1}};return t0(async()=>{await Z0(),ia(),z.value=window.setInterval(ia,3e4),window.addEventListener("resize",()=>{setTimeout(()=>{ju(An.value)?.resize(),ju(Ft.value)?.resize(),ju(kn.value)?.resize(),Qi.value&&l1.Plots&&l1.Plots.resize(Qi.value)},100)})}),dg(()=>{z.value&&clearInterval(z.value),An.value?.destroy(),Ft.value?.destroy(),kn.value?.destroy(),Qi.value&&l1.purge(Qi.value),window.removeEventListener("resize",()=>{})}),(qo,fo)=>(zi(),Vi("div",Ddt,[Re("div",Fdt,[fo[2]||(fo[2]=Re("h2",{class:"text-2xl font-bold text-white"},"Statistics",-1)),Re("div",Rdt,[fo[1]||(fo[1]=Re("label",{class:"text-white/70 text-sm"},"Time Range:",-1)),$p(Re("select",{"onUpdate:modelValue":fo[0]||(fo[0]=Ta=>J.value=Ta),onChange:Ni,class:"bg-white/10 border border-white/20 rounded-lg px-3 py-2 text-white text-sm focus:outline-none focus:border-accent-purple/50 transition-colors"},[(zi(),Vi(Ou,null,sf(mt,Ta=>Re("option",{key:Ta.value,value:Ta.value,class:"bg-gray-800 text-white"},aa(Ta.label),9,Bdt)),64))],544),[[iA,J.value]])])]),Re("div",Ndt,[gu(r_,{title:"Total RX",value:Gi.value.totalRx,color:"#AAE8E8",data:un.value.totalPackets},null,8,["value","data"]),gu(r_,{title:"Total TX",value:Gi.value.totalTx,color:"#FFC246",data:un.value.transmittedPackets},null,8,["value","data"])]),Re("div",jdt,[fo[9]||(fo[9]=Re("h3",{class:"text-white text-xl font-semibold mb-4"},"Performance Metrics",-1)),Re("div",Udt,[fo[5]||(fo[5]=Ff('

Packet Rate (RX/TX PER HOUR)

RX/hr
TX/hr
',2)),Re("div",Vdt,[Re("canvas",{ref_key:"packetRateCanvasRef",ref:ei,class:"w-full h-full relative z-10"},null,512),_r.value.packetRate?(zi(),Vi("div",Hdt,fo[3]||(fo[3]=[Re("div",{class:"text-center"},[Re("div",{class:"animate-spin w-8 h-8 border-2 border-white/20 border-t-purple-400 rounded-full mx-auto mb-2"}),Re("div",{class:"text-white/50 text-xs"},"Loading packet rate data...")],-1)]))):bs("",!0),Fr.value&&!_r.value.packetRate?(zi(),Vi("div",Wdt,fo[4]||(fo[4]=[Re("div",{class:"text-center"},[Re("div",{class:"text-red-400 text-sm mb-1"},"No Data Available"),Re("div",{class:"text-white/50 text-xs"},"Packet rate data not found")],-1)]))):bs("",!0)])]),Re("div",qdt,[fo[8]||(fo[8]=Re("p",{class:"text-white/70 text-sm uppercase tracking-wide mb-2"},"Packet Type Distribution",-1)),Re("div",Zdt,[Re("canvas",{ref_key:"packetTypeCanvasRef",ref:jn,class:"w-full h-full relative z-10"},null,512),_r.value.packetType?(zi(),Vi("div",$dt,fo[6]||(fo[6]=[Re("div",{class:"text-center"},[Re("div",{class:"animate-spin w-8 h-8 border-2 border-white/20 border-t-blue-400 rounded-full mx-auto mb-2"}),Re("div",{class:"text-white/50 text-xs"},"Loading packet type data...")],-1)]))):bs("",!0),zr.value&&!_r.value.packetType?(zi(),Vi("div",Gdt,fo[7]||(fo[7]=[Re("div",{class:"text-center"},[Re("div",{class:"text-red-400 text-sm mb-1"},"No Data Available"),Re("div",{class:"text-white/50 text-xs"},"Packet type data not found")],-1)]))):bs("",!0)])])]),Re("div",Ydt,[fo[13]||(fo[13]=Re("h3",{class:"text-white text-xl font-semibold mb-4"},"Noise Floor Over Time",-1)),Re("div",Kdt,[Re("div",Xdt,[Re("div",Jdt,[Re("canvas",{ref_key:"signalMetricsCanvasRef",ref:ai,class:"w-full h-full"},null,512)])]),Re("div",Qdt,[fo[12]||(fo[12]=Re("p",{class:"text-white/70 text-sm uppercase tracking-wide mb-2"},"Route Distribution",-1)),Re("div",tpt,[Re("div",{ref_key:"signalPie3DRef",ref:Qi,class:"w-full h-full relative z-10"},null,512),_r.value.routePie?(zi(),Vi("div",ept,fo[10]||(fo[10]=[Re("div",{class:"text-center"},[Re("div",{class:"animate-spin w-8 h-8 border-2 border-white/20 border-t-green-400 rounded-full mx-auto mb-2"}),Re("div",{class:"text-white/50 text-xs"},"Loading route data...")],-1)]))):bs("",!0),Wr.value&&!_r.value.routePie?(zi(),Vi("div",rpt,fo[11]||(fo[11]=[Re("div",{class:"text-center"},[Re("div",{class:"text-red-400 text-sm mb-1"},"No Data Available"),Re("div",{class:"text-white/50 text-xs"},"Route statistics not found")],-1)]))):bs("",!0)])])])]),Ne.value?(zi(),Vi("div",npt,fo[14]||(fo[14]=[Re("div",{class:"text-white/70 mb-2"},"Loading statistics...",-1),Re("div",{class:"animate-spin w-8 h-8 border-2 border-white/20 border-t-white/70 rounded-full mx-auto"},null,-1)]))):bs("",!0),or.value?(zi(),Vi("div",ipt,[fo[15]||(fo[15]=Re("div",{class:"text-red-400 mb-2"},"Failed to load statistics",-1)),Re("p",apt,aa(or.value),1),Re("button",{onClick:ia,class:"mt-4 px-4 py-2 bg-accent-purple/20 hover:bg-accent-purple/30 text-white rounded-lg border border-accent-purple/50 transition-colors"}," Retry ")])):bs("",!0)]))}}),spt=ld(opt,[["__scopeId","data-v-9766a4d1"]]),lpt={class:"space-y-4"},upt={class:"bg-white/5 rounded-lg p-4 space-y-3"},cpt={class:"flex justify-between items-center py-2 border-b border-white/10"},hpt={class:"text-white font-mono"},fpt={class:"flex justify-between items-center py-2 border-b border-white/10"},dpt={class:"text-white font-mono"},ppt={class:"flex justify-between items-center py-2 border-b border-white/10"},mpt={class:"text-white font-mono"},gpt={class:"flex justify-between items-center py-2 border-b border-white/10"},vpt={class:"text-white font-mono"},ypt={class:"flex justify-between items-center py-2 border-b border-white/10"},xpt={class:"text-white font-mono"},_pt={class:"flex justify-between items-center py-2"},bpt={class:"text-white font-mono"},wpt=Th({__name:"RadioSettings",setup(d){const l=sv(),z=Yo(()=>l.stats?.config?.radio||{}),j=Yo(()=>{const re=z.value.frequency;return re?(re/1e6).toFixed(3)+" MHz":"Not set"}),J=Yo(()=>{const re=z.value.bandwidth;return re?(re/1e3).toFixed(1)+" kHz":"Not set"}),mt=Yo(()=>{const re=z.value.tx_power;return re!==void 0?re+" dBm":"Not set"}),kt=Yo(()=>{const re=z.value.coding_rate;return re?"4/"+re:"Not set"}),Dt=Yo(()=>{const re=z.value.preamble_length;return re?re+" symbols":"Not set"}),Gt=Yo(()=>z.value.spreading_factor??"Not set");return(re,pe)=>(zi(),Vi("div",lpt,[Re("div",upt,[Re("div",cpt,[pe[0]||(pe[0]=Re("span",{class:"text-white/70 text-sm"},"Frequency",-1)),Re("span",hpt,aa(j.value),1)]),Re("div",fpt,[pe[1]||(pe[1]=Re("span",{class:"text-white/70 text-sm"},"Spreading Factor",-1)),Re("span",dpt,aa(Gt.value),1)]),Re("div",ppt,[pe[2]||(pe[2]=Re("span",{class:"text-white/70 text-sm"},"Bandwidth",-1)),Re("span",mpt,aa(J.value),1)]),Re("div",gpt,[pe[3]||(pe[3]=Re("span",{class:"text-white/70 text-sm"},"TX Power",-1)),Re("span",vpt,aa(mt.value),1)]),Re("div",ypt,[pe[4]||(pe[4]=Re("span",{class:"text-white/70 text-sm"},"Coding Rate",-1)),Re("span",xpt,aa(kt.value),1)]),Re("div",_pt,[pe[5]||(pe[5]=Re("span",{class:"text-white/70 text-sm"},"Preamble Length",-1)),Re("span",bpt,aa(Dt.value),1)])])]))}}),kpt={class:"space-y-4"},Tpt={class:"bg-white/5 rounded-lg p-4 space-y-3"},Apt={class:"flex justify-between items-center py-2 border-b border-white/10"},Mpt={class:"text-white font-mono"},Spt={class:"flex justify-between items-center py-2 border-b border-white/10"},Ept={class:"text-white font-mono text-xs"},Cpt={class:"flex justify-between items-start py-2 border-b border-white/10"},Lpt={class:"text-white font-mono text-xs text-right break-all max-w-xs"},Ppt={class:"flex justify-between items-center py-2 border-b border-white/10"},zpt={class:"text-white font-mono"},Ipt={class:"flex justify-between items-center py-2 border-b border-white/10"},Opt={class:"text-white font-mono"},Dpt={class:"flex justify-between items-center py-2 border-b border-white/10"},Fpt={class:"text-white font-mono"},Rpt={class:"flex justify-between items-start py-2"},Bpt={class:"text-white font-mono ml-4"},Npt=Th({__name:"RepeaterSettings",setup(d){const l=sv(),z=Yo(()=>l.stats?.config||{}),j=Yo(()=>z.value.repeater||{}),J=Yo(()=>l.stats),mt=Yo(()=>z.value.node_name||"Not set"),kt=Yo(()=>J.value?.local_hash||"Not available"),Dt=Yo(()=>{const or=J.value?.public_key;return!or||or==="Not set"?"Not set":or}),Gt=Yo(()=>{const or=j.value.latitude;return or&&or!==0?or.toFixed(6):"Not set"}),re=Yo(()=>{const or=j.value.longitude;return or&&or!==0?or.toFixed(6):"Not set"}),pe=Yo(()=>{const or=j.value.mode;return or?or.charAt(0).toUpperCase()+or.slice(1):"Not set"}),Ne=Yo(()=>{const or=j.value.send_advert_interval_hours;return or===void 0?"Not set":or===0?"Disabled":or+" hour"+(or!==1?"s":"")});return(or,_r)=>(zi(),Vi("div",kpt,[Re("div",Tpt,[Re("div",Apt,[_r[0]||(_r[0]=Re("span",{class:"text-white/70 text-sm"},"Node Name",-1)),Re("span",Mpt,aa(mt.value),1)]),Re("div",Spt,[_r[1]||(_r[1]=Re("span",{class:"text-white/70 text-sm"},"Local Hash",-1)),Re("span",Ept,aa(kt.value),1)]),Re("div",Cpt,[_r[2]||(_r[2]=Re("span",{class:"text-white/70 text-sm"},"Public Key",-1)),Re("span",Lpt,aa(Dt.value),1)]),Re("div",Ppt,[_r[3]||(_r[3]=Re("span",{class:"text-white/70 text-sm"},"Latitude",-1)),Re("span",zpt,aa(Gt.value),1)]),Re("div",Ipt,[_r[4]||(_r[4]=Re("span",{class:"text-white/70 text-sm"},"Longitude",-1)),Re("span",Opt,aa(re.value),1)]),Re("div",Dpt,[_r[5]||(_r[5]=Re("span",{class:"text-white/70 text-sm"},"Mode",-1)),Re("span",Fpt,aa(pe.value),1)]),Re("div",Rpt,[_r[6]||(_r[6]=Re("div",{class:"flex flex-col"},[Re("span",{class:"text-white/70 text-sm"},"Periodic Advertisement Interval"),Re("span",{class:"text-white/50 text-xs mt-1"},"How often the repeater sends an advertisement packet (0 = disabled)")],-1)),Re("span",Bpt,aa(Ne.value),1)])])]))}}),jpt={class:"space-y-4"},Upt={class:"bg-white/5 rounded-lg p-4 space-y-3"},Vpt={class:"flex justify-between items-center py-2 border-b border-white/10"},Hpt={class:"text-white font-mono"},Wpt={class:"flex justify-between items-center py-2"},qpt={class:"text-white font-mono"},Zpt=Th({__name:"DutyCycle",setup(d){const l=sv(),z=Yo(()=>l.stats?.config?.duty_cycle||{}),j=Yo(()=>{const mt=z.value.max_airtime_percent;return typeof mt=="number"?mt.toFixed(1)+"%":mt&&typeof mt=="object"&&"parsedValue"in mt?(mt.parsedValue||0).toFixed(1)+"%":"Not set"}),J=Yo(()=>z.value.enforcement_enabled?"Enabled":"Disabled");return(mt,kt)=>(zi(),Vi("div",jpt,[Re("div",Upt,[Re("div",Vpt,[kt[0]||(kt[0]=Re("span",{class:"text-white/70 text-sm"},"Max Airtime %",-1)),Re("span",Hpt,aa(j.value),1)]),Re("div",Wpt,[kt[1]||(kt[1]=Re("span",{class:"text-white/70 text-sm"},"Enforcement",-1)),Re("span",qpt,aa(J.value),1)])])]))}}),$pt={class:"space-y-4"},Gpt={class:"bg-white/5 rounded-lg p-4 space-y-3"},Ypt={class:"flex justify-between items-start py-2 border-b border-white/10"},Kpt={class:"text-white font-mono ml-4"},Xpt={class:"flex justify-between items-start py-2"},Jpt={class:"text-white font-mono ml-4"},Qpt=Th({__name:"TransmissionDelays",setup(d){const l=sv(),z=Yo(()=>l.stats?.config?.delays||{}),j=Yo(()=>{const mt=z.value.tx_delay_factor;if(mt&&typeof mt=="object"&&mt!==null&&"parsedValue"in mt){const kt=mt.parsedValue;if(typeof kt=="number")return kt.toFixed(2)+"x"}return"Not set"}),J=Yo(()=>{const mt=z.value.direct_tx_delay_factor;return typeof mt=="number"?mt.toFixed(2)+"s":"Not set"});return(mt,kt)=>(zi(),Vi("div",$pt,[Re("div",Gpt,[Re("div",Ypt,[kt[0]||(kt[0]=Re("div",{class:"flex flex-col"},[Re("span",{class:"text-white/70 text-sm"},"Flood TX Delay Factor"),Re("span",{class:"text-white/50 text-xs mt-1"},"Multiplier for flood packet transmission delays (collision avoidance)")],-1)),Re("span",Kpt,aa(j.value),1)]),Re("div",Xpt,[kt[1]||(kt[1]=Re("div",{class:"flex flex-col"},[Re("span",{class:"text-white/70 text-sm"},"Direct TX Delay Factor"),Re("span",{class:"text-white/50 text-xs mt-1"},"Base delay for direct-routed packet transmission (seconds)")],-1)),Re("span",Jpt,aa(J.value),1)])])]))}}),WD=GA("treeState",()=>{const d=ky(new Set),l=ky({value:null}),z=Dt=>{d.add(Dt)},j=Dt=>{d.delete(Dt)};return{expandedNodes:d,selectedNodeId:l,addExpandedNode:z,removeExpandedNode:j,isNodeExpanded:Dt=>d.has(Dt),setSelectedNode:Dt=>{l.value=Dt},toggleExpanded:Dt=>{d.has(Dt)?j(Dt):z(Dt)}}}),t0t={class:"select-none"},e0t={class:"flex-shrink-0"},r0t={key:0,class:"w-4 h-4 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},n0t={key:1,class:"w-4 h-4 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},i0t={key:0,class:"flex items-center gap-1 ml-2"},a0t={class:"relative group"},o0t=["title"],s0t={key:0,class:"text-xs font-mono text-white/50 bg-white/5 px-1.5 py-0.5 rounded border border-white/10"},l0t={class:"flex justify-between items-start mb-4"},u0t={class:"bg-black/20 border border-white/10 rounded-md p-4 mb-4"},c0t={class:"text-sm font-mono text-white/80 break-all leading-relaxed"},h0t={class:"flex items-center gap-2 ml-auto"},f0t={key:0,class:"flex items-center gap-1"},d0t=["title"],p0t={key:1,class:"flex items-center gap-1"},m0t={key:2,class:"px-2 py-1 bg-white/10 text-white/60 text-xs rounded-full ml-1"},g0t={key:0,class:"space-y-1"},v0t=Th({__name:"TreeNode",props:{node:{},selectedNodeId:{},level:{},disabled:{type:Boolean}},emits:["select"],setup(d,{emit:l}){const z=d,j=l,J=WD(),mt=lo(!1),kt=Yo({get:()=>J.isNodeExpanded(z.node.id),set:zr=>{zr?J.addExpandedNode(z.node.id):J.removeExpandedNode(z.node.id)}}),Dt=Yo(()=>z.node.children.length>0);function Gt(zr){if(!zr)return"Never";const An=new Date().getTime()-zr.getTime(),Ft=Math.floor(An/(1e3*60)),kn=Math.floor(An/(1e3*60*60)),ei=Math.floor(An/(1e3*60*60*24)),jn=Math.floor(ei/365);return Ft<60?`${Ft}m ago`:kn<24?`${kn}h ago`:ei<365?`${ei}d ago`:`${jn}y ago`}function re(zr){return zr?zr.length<=16?zr:`${zr.slice(0,8)}...${zr.slice(-8)}`:"No key"}function pe(){if(Dt.value){const zr=!kt.value;kt.value=zr}}function Ne(){j("select",z.node.id)}function or(zr){j("select",zr)}function _r(zr){zr.stopPropagation(),mt.value=!mt.value}function Fr(zr){zr.stopPropagation(),z.node.transport_key&&window.navigator?.clipboard&&window.navigator.clipboard.writeText(z.node.transport_key)}return(zr,Wr)=>{const An=UA("TreeNode",!0);return zi(),Vi("div",t0t,[Re("div",{class:Xs(["flex items-center gap-2 py-2 px-3 rounded-lg cursor-pointer transition-all duration-200",z.disabled?"opacity-50 cursor-not-allowed":"hover:bg-white/5",zr.selectedNodeId===zr.node.id&&!z.disabled?"bg-primary/20 text-primary":"text-white/80 hover:text-white",`ml-${zr.level*4}`]),onClick:Wr[3]||(Wr[3]=Ft=>!z.disabled&&Ne())},[Re("div",{class:"flex-shrink-0 w-4 h-4 flex items-center justify-center",onClick:hg(pe,["stop"])},[Dt.value?(zi(),Vi("svg",{key:0,class:Xs(["w-3 h-3 transition-transform duration-200",kt.value?"rotate-90":"rotate-0"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Wr[4]||(Wr[4]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)]),2)):bs("",!0)]),Re("div",e0t,[z.node.name.startsWith("#")?(zi(),Vi("svg",r0t,Wr[5]||(Wr[5]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"},null,-1)]))):(zi(),Vi("svg",n0t,Wr[6]||(Wr[6]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"},null,-1)])))]),Re("span",{class:Xs(["font-mono text-sm transition-colors duration-200",zr.selectedNodeId===zr.node.id?"text-primary font-medium":""])},aa(zr.node.name),3),zr.node.transport_key?(zi(),Vi("div",i0t,[Re("div",a0t,[Re("button",{onClick:_r,class:"p-1 rounded hover:bg-white/10 transition-colors",title:mt.value?"Hide full key":"Show full key"},Wr[7]||(Wr[7]=[Re("svg",{class:"w-3 h-3 text-white/60 hover:text-white/80",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})],-1)]),8,o0t),mt.value?bs("",!0):(zi(),Vi("span",s0t,aa(re(zr.node.transport_key)),1)),mt.value?(zi(),Vi("div",{key:1,class:"fixed inset-0 z-[9998] flex items-center justify-center bg-black/70 backdrop-blur-md",onClick:Wr[2]||(Wr[2]=Ft=>mt.value=!1)},[Re("div",{class:"bg-black/20 border border-white/20 rounded-lg shadow-lg p-6 max-w-2xl w-full mx-4",onClick:Wr[1]||(Wr[1]=hg(()=>{},["stop"]))},[Re("div",l0t,[Wr[9]||(Wr[9]=Re("h3",{class:"text-lg font-semibold text-white"},"Transport Key",-1)),Re("button",{onClick:Wr[0]||(Wr[0]=Ft=>mt.value=!1),class:"text-white/60 hover:text-white transition-colors"},Wr[8]||(Wr[8]=[Re("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),Re("div",u0t,[Re("div",c0t,aa(zr.node.transport_key),1)]),Re("div",{class:"flex justify-end"},[Re("button",{onClick:Fr,class:"px-4 py-2 bg-accent-green/20 hover:bg-accent-green/30 border border-accent-green/50 text-accent-green rounded-lg transition-colors flex items-center gap-2",title:"Copy to clipboard"},Wr[10]||(Wr[10]=[Re("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})],-1),nc(" Copy Key ",-1)]))])])])):bs("",!0)])])):bs("",!0),Re("div",h0t,[zr.node.last_used?(zi(),Vi("div",f0t,[Wr[11]||(Wr[11]=Re("svg",{class:"w-3 h-3 text-white/40",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),Re("span",{class:"text-xs text-white/50",title:zr.node.last_used.toLocaleString()},aa(Gt(zr.node.last_used)),9,d0t)])):(zi(),Vi("div",p0t,Wr[12]||(Wr[12]=[Re("svg",{class:"w-3 h-3 text-white/30",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})],-1),Re("span",{class:"text-xs text-white/30 italic"},"Never",-1)]))),Re("span",{class:Xs(["px-2 py-0.5 text-xs font-medium rounded-md transition-colors",zr.node.floodPolicy==="allow"?"bg-accent-green/10 text-accent-green/90 border border-accent-green/20":"bg-accent-red/10 text-accent-red/90 border border-accent-red/20"])},aa(zr.node.floodPolicy==="allow"?"FLOOD ALLOW":"FLOOD DENY"),3),Dt.value?(zi(),Vi("span",m0t,aa(zr.node.children.length),1)):bs("",!0)])],2),gu(LI,{"enter-active-class":"transition-all duration-300 ease-out","enter-from-class":"opacity-0 max-h-0 overflow-hidden","enter-to-class":"opacity-100 max-h-screen overflow-visible","leave-active-class":"transition-all duration-300 ease-in","leave-from-class":"opacity-100 max-h-screen overflow-visible","leave-to-class":"opacity-0 max-h-0 overflow-hidden"},{default:Y2(()=>[kt.value&&zr.node.children.length>0?(zi(),Vi("div",g0t,[(zi(!0),Vi(Ou,null,sf(zr.node.children,Ft=>(zi(),hm(An,{key:Ft.id,node:Ft,"selected-node-id":zr.selectedNodeId,level:zr.level+1,disabled:z.disabled,onSelect:or},null,8,["node","selected-node-id","level","disabled"]))),128))])):bs("",!0)]),_:1})])}}}),y0t=ld(v0t,[["__scopeId","data-v-4afde13e"]]),x0t={class:"flex items-center justify-between mb-6"},_0t={class:"text-white/60 text-sm mt-1"},b0t={key:0},w0t={class:"text-primary font-mono"},k0t={key:1},T0t={for:"keyName",class:"block text-sm font-medium text-white mb-2"},A0t={class:"flex items-center gap-2"},M0t={key:0,class:"w-4 h-4 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},S0t={key:1,class:"w-4 h-4 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},E0t={class:"bg-white/5 border border-white/10 rounded-lg p-4"},C0t={class:"flex items-center gap-3 mb-2"},L0t={class:"flex items-center gap-2"},P0t={key:0,class:"w-5 h-5 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},z0t={key:1,class:"w-5 h-5 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},I0t={class:"text-white/70 text-sm"},O0t={class:"grid grid-cols-2 gap-3"},D0t={class:"relative cursor-pointer group"},F0t={class:"relative cursor-pointer group"},R0t={class:"flex gap-3 pt-4"},B0t=["disabled"],N0t=Th({__name:"AddKeyModal",props:{show:{type:Boolean},selectedNodeName:{},selectedNodeId:{}},emits:["close","add"],setup(d,{emit:l}){const z=d,j=l,J=lo(""),mt=lo(""),kt=lo("allow"),Dt=Yo(()=>J.value.startsWith("#")),Gt=Yo(()=>({type:Dt.value?"Region":"Private Key",description:Dt.value?"Regional organizational key":"Individual assigned key"}));um(Dt,_r=>{_r?mt.value="This will create a new region for organizing keys":mt.value="This will create a new private key entry"},{immediate:!0});const re=Yo(()=>J.value.trim().length>0),pe=()=>{re.value&&(j("add",{name:J.value.trim(),floodPolicy:kt.value,parentId:z.selectedNodeId}),J.value="",mt.value="",kt.value="allow")},Ne=()=>{J.value="",mt.value="",kt.value="allow",j("close")},or=_r=>{_r.target===_r.currentTarget&&Ne()};return(_r,Fr)=>_r.show?(zi(),Vi("div",{key:0,onClick:or,class:"fixed inset-0 bg-black/40 backdrop-blur-lg z-[99999] flex items-center justify-center p-4",style:{"backdrop-filter":"blur(8px) saturate(180%)",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"}},[Re("div",{class:"glass-card rounded-[20px] p-6 w-full max-w-md border border-white/10",onClick:Fr[3]||(Fr[3]=hg(()=>{},["stop"]))},[Re("div",x0t,[Re("div",null,[Fr[5]||(Fr[5]=Re("h3",{class:"text-xl font-semibold text-white"},"Add New Entry",-1)),Re("p",_0t,[z.selectedNodeName?(zi(),Vi("span",b0t,[Fr[4]||(Fr[4]=nc(" Add to: ",-1)),Re("span",w0t,aa(z.selectedNodeName),1)])):(zi(),Vi("span",k0t," Add to root level (#uk) "))])]),Re("button",{onClick:Ne,class:"text-white/60 hover:text-white transition-colors"},Fr[6]||(Fr[6]=[Re("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),Re("form",{onSubmit:hg(pe,["prevent"]),class:"space-y-4"},[Re("div",null,[Re("label",T0t,[Re("div",A0t,[Dt.value?(zi(),Vi("svg",M0t,Fr[7]||(Fr[7]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"},null,-1)]))):(zi(),Vi("svg",S0t,Fr[8]||(Fr[8]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"},null,-1)]))),Fr[9]||(Fr[9]=nc(" Region/Key Name ",-1))])]),$p(Re("input",{id:"keyName","onUpdate:modelValue":Fr[0]||(Fr[0]=zr=>J.value=zr),type:"text",placeholder:"Enter name (prefix with # for regions)",class:"w-full px-4 py-3 bg-white/5 border border-white/20 rounded-lg text-white placeholder-white/50 focus:outline-none focus:border-primary focus:ring-2 focus:ring-primary/20 transition-colors",autocomplete:"off"},null,512),[[$A,J.value]])]),Re("div",E0t,[Re("div",C0t,[Re("div",L0t,[Dt.value?(zi(),Vi("svg",P0t,Fr[10]||(Fr[10]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"},null,-1)]))):(zi(),Vi("svg",z0t,Fr[11]||(Fr[11]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1221 9z"},null,-1)]))),Re("span",{class:Xs([Dt.value?"text-secondary":"text-accent-green","font-medium"])},aa(Gt.value.type),3)]),Re("div",{class:Xs(["flex-1 h-px",Dt.value?"bg-secondary/20":"bg-accent-green/20"])},null,2)]),Re("p",I0t,aa(Gt.value.description),1)]),Re("div",null,[Fr[14]||(Fr[14]=Re("label",{class:"block text-sm font-medium text-white mb-3"},[Re("div",{class:"flex items-center gap-2"},[Re("svg",{class:"w-4 h-4 text-primary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})]),nc(" Flood Policy ")])],-1)),Re("div",O0t,[Re("label",D0t,[$p(Re("input",{type:"radio","onUpdate:modelValue":Fr[1]||(Fr[1]=zr=>kt.value=zr),value:"allow",class:"sr-only"},null,512),[[F2,kt.value]]),Fr[12]||(Fr[12]=Ff('
Allow

Permit flooding

',1))]),Re("label",F0t,[$p(Re("input",{type:"radio","onUpdate:modelValue":Fr[2]||(Fr[2]=zr=>kt.value=zr),value:"deny",class:"sr-only"},null,512),[[F2,kt.value]]),Fr[13]||(Fr[13]=Ff('
Deny

Block flooding

',1))])])]),Re("div",R0t,[Re("button",{type:"button",onClick:Ne,class:"flex-1 px-4 py-3 bg-white/5 hover:bg-white/10 border border-white/20 text-white rounded-lg transition-colors"}," Cancel "),Re("button",{type:"submit",disabled:!re.value,class:Xs(["flex-1 px-4 py-3 rounded-lg transition-colors font-medium",re.value?"bg-accent-green/20 hover:bg-accent-green/30 border border-accent-green/50 text-accent-green":"bg-white/5 border border-white/20 text-white/40 cursor-not-allowed"])}," Add "+aa(Gt.value.type),11,B0t)])],32)])])):bs("",!0)}}),j0t={class:"flex bg-black items-center justify-between mb-6"},U0t={class:"text-white/60 text-sm mt-1"},V0t={class:"text-primary font-mono"},H0t={for:"keyName",class:"block text-sm font-medium text-white mb-2"},W0t={class:"flex items-center gap-2"},q0t={key:0,class:"w-4 h-4 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Z0t={key:1,class:"w-4 h-4 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},$0t={class:"bg-white/5 border border-white/10 rounded-lg p-4"},G0t={class:"flex items-center gap-3 mb-2"},Y0t={class:"flex items-center gap-2"},K0t={key:0,class:"w-5 h-5 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},X0t={key:1,class:"w-5 h-5 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},J0t={class:"text-white/70 text-sm"},Q0t={key:0,class:"space-y-4"},tmt={key:0,class:"bg-white/5 border border-white/10 rounded-lg p-4"},emt={class:"bg-black/20 border border-white/10 rounded-md p-3"},rmt={class:"text-xs font-mono text-white/80 break-all"},nmt={key:1,class:"bg-white/5 border border-white/10 rounded-lg p-4"},imt={class:"flex items-center justify-between"},amt={class:"text-sm text-white/70"},omt={class:"text-xs text-white/50"},smt={class:"grid grid-cols-2 gap-3"},lmt={class:"relative cursor-pointer group"},umt={class:"relative cursor-pointer group"},cmt={class:"flex gap-3 pt-4"},hmt=["disabled"],fmt=Th({__name:"EditKeyModal",props:{show:{type:Boolean},node:{}},emits:["close","save","request-delete"],setup(d,{emit:l}){const z=d,j=l,J=lo(""),mt=lo("allow"),kt=Yo(()=>J.value.startsWith("#")),Dt=Yo(()=>({type:kt.value?"Region":"Private Key",description:kt.value?"Regional organizational key":"Individual assigned key"}));um(()=>z.node,zr=>{zr?(J.value=zr.name,mt.value=zr.floodPolicy):(J.value="",mt.value="allow")},{immediate:!0});const Gt=Yo(()=>J.value.trim().length>0&&z.node),re=zr=>{const An=new Date().getTime()-zr.getTime(),Ft=Math.floor(An/(1e3*60)),kn=Math.floor(An/(1e3*60*60)),ei=Math.floor(An/(1e3*60*60*24)),jn=Math.floor(ei/365);return Ft<60?`${Ft}m ago`:kn<24?`${kn}h ago`:ei<365?`${ei}d ago`:`${jn}y ago`},pe=zr=>{window.navigator?.clipboard&&window.navigator.clipboard.writeText(zr)},Ne=()=>{!Gt.value||!z.node||(j("save",{id:z.node.id,name:J.value.trim(),floodPolicy:mt.value}),_r())},or=()=>{z.node&&(j("request-delete",z.node),_r())},_r=()=>{j("close")},Fr=zr=>{zr.target===zr.currentTarget&&_r()};return(zr,Wr)=>zr.show?(zi(),Vi("div",{key:0,onClick:Fr,class:"fixed inset-0 bg-black/50 backdrop-blur-lg z-[99999] flex items-center justify-center p-4",style:{"backdrop-filter":"blur(8px) saturate(180%)",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"}},[Re("div",{class:"glass-card rounded-[20px] p-6 w-full max-w-md border border-white/10",onClick:Wr[4]||(Wr[4]=hg(()=>{},["stop"]))},[Re("div",j0t,[Re("div",null,[Wr[6]||(Wr[6]=Re("h3",{class:"text-xl font-semibold text-white"},"Edit Entry",-1)),Re("p",U0t,[Wr[5]||(Wr[5]=nc(" Modify ",-1)),Re("span",V0t,aa(zr.node?.name),1)])]),Re("button",{onClick:_r,class:"text-white/60 hover:text-white transition-colors"},Wr[7]||(Wr[7]=[Re("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),Re("form",{onSubmit:hg(Ne,["prevent"]),class:"space-y-4"},[Re("div",null,[Re("label",H0t,[Re("div",W0t,[kt.value?(zi(),Vi("svg",q0t,Wr[8]||(Wr[8]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"},null,-1)]))):(zi(),Vi("svg",Z0t,Wr[9]||(Wr[9]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1721 9z"},null,-1)]))),Wr[10]||(Wr[10]=nc(" Region/Key Name ",-1))])]),$p(Re("input",{id:"keyName","onUpdate:modelValue":Wr[0]||(Wr[0]=An=>J.value=An),type:"text",placeholder:"Enter name (prefix with # for regions)",class:"w-full px-4 py-3 bg-white/5 border border-white/20 rounded-lg text-white placeholder-white/50 focus:outline-none focus:border-primary focus:ring-2 focus:ring-primary/20 transition-colors",autocomplete:"off"},null,512),[[$A,J.value]])]),Re("div",$0t,[Re("div",G0t,[Re("div",Y0t,[kt.value?(zi(),Vi("svg",K0t,Wr[11]||(Wr[11]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"},null,-1)]))):(zi(),Vi("svg",X0t,Wr[12]||(Wr[12]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1721 9z"},null,-1)]))),Re("span",{class:Xs([kt.value?"text-secondary":"text-accent-green","font-medium"])},aa(Dt.value.type),3)]),Re("div",{class:Xs(["flex-1 h-px",kt.value?"bg-secondary/20":"bg-accent-green/20"])},null,2)]),Re("p",J0t,aa(Dt.value.description),1)]),zr.node?(zi(),Vi("div",Q0t,[zr.node.transport_key?(zi(),Vi("div",tmt,[Wr[14]||(Wr[14]=Ff('
Transport Key
',1)),Re("div",emt,[Re("div",rmt,aa(zr.node.transport_key),1),Re("button",{onClick:Wr[1]||(Wr[1]=An=>pe(zr.node.transport_key||"")),class:"mt-2 text-xs text-accent-green hover:text-accent-green/80 flex items-center gap-1",title:"Copy to clipboard"},Wr[13]||(Wr[13]=[Re("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})],-1),nc(" Copy Key ",-1)]))])])):bs("",!0),zr.node.last_used?(zi(),Vi("div",nmt,[Wr[15]||(Wr[15]=Re("div",{class:"flex items-center gap-2 mb-3"},[Re("svg",{class:"w-4 h-4 text-primary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})]),Re("span",{class:"text-sm font-medium text-white"},"Last Used")],-1)),Re("div",imt,[Re("div",amt,aa(zr.node.last_used.toLocaleDateString())+" at "+aa(zr.node.last_used.toLocaleTimeString()),1),Re("div",omt,aa(re(zr.node.last_used)),1)])])):bs("",!0)])):bs("",!0),Re("div",null,[Wr[18]||(Wr[18]=Re("label",{class:"block text-sm font-medium text-white mb-3"},[Re("div",{class:"flex items-center gap-2"},[Re("svg",{class:"w-4 h-4 text-primary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})]),nc(" Flood Policy ")])],-1)),Re("div",smt,[Re("label",lmt,[$p(Re("input",{type:"radio","onUpdate:modelValue":Wr[2]||(Wr[2]=An=>mt.value=An),value:"allow",class:"sr-only"},null,512),[[F2,mt.value]]),Wr[16]||(Wr[16]=Ff('
Allow

Permit flooding

',1))]),Re("label",umt,[$p(Re("input",{type:"radio","onUpdate:modelValue":Wr[3]||(Wr[3]=An=>mt.value=An),value:"deny",class:"sr-only"},null,512),[[F2,mt.value]]),Wr[17]||(Wr[17]=Ff('
Deny

Block flooding

',1))])])]),Re("div",cmt,[Re("button",{type:"button",onClick:or,class:"px-4 py-3 bg-accent-red/20 hover:bg-accent-red/30 border border-accent-red/50 text-accent-red rounded-lg transition-colors"}," Delete "),Re("button",{type:"button",onClick:_r,class:"flex-1 px-4 py-3 bg-white/5 hover:bg-white/10 border border-white/20 text-white rounded-lg transition-colors"}," Cancel "),Re("button",{type:"submit",disabled:!Gt.value,class:Xs(["flex-1 px-4 py-3 rounded-lg transition-colors font-medium",Gt.value?"bg-accent-green/20 hover:bg-accent-green/30 border border-accent-green/50 text-accent-green":"bg-white/5 border border-white/20 text-white/40 cursor-not-allowed"])}," Save Changes ",10,hmt)])],32)])])):bs("",!0)}}),dmt={class:"flex items-center gap-3 mb-6"},pmt={class:"text-white/60 text-sm mt-1"},mmt={class:"text-accent-red font-mono"},gmt={key:0,class:"bg-accent-red/10 border border-accent-red/30 rounded-lg p-4 mb-6"},vmt={class:"flex items-start gap-3"},ymt={class:"flex-1"},xmt={class:"text-accent-red font-medium text-sm mb-2"},_mt={class:"space-y-1 max-h-32 overflow-y-auto"},bmt={key:0,class:"w-3 h-3 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},wmt={key:1,class:"w-3 h-3 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},kmt={class:"font-mono"},Tmt={key:0,class:"text-white/60 text-xs"},Amt={key:1,class:"mb-6"},Mmt={class:"mb-3"},Smt={class:"relative"},Emt={class:"space-y-2 max-h-40 overflow-y-auto border border-white/20 rounded-lg p-3 bg-white/5"},Cmt={key:0,class:"text-center py-4 text-white/60 text-sm"},Lmt={class:"relative"},Pmt=["value"],zmt={class:"flex items-center gap-2 flex-1"},Imt={class:"text-white font-mono text-sm"},Omt={key:0,class:"ml-auto px-2 py-0.5 bg-white/10 text-white/60 text-xs rounded-full"},Dmt={class:"flex gap-3"},Fmt=Th({__name:"DeleteConfirmModal",props:{show:{type:Boolean},node:{},allNodes:{}},emits:["close","delete-all","move-children"],setup(d,{emit:l}){const z=d,j=l,J=lo(null),mt=lo(""),kt=Fr=>{const zr=[],Wr=An=>{for(const Ft of An.children)zr.push(Ft),Wr(Ft)};return Wr(Fr),zr},Dt=Yo(()=>z.node?kt(z.node):[]),Gt=Yo(()=>{if(!z.node)return[];const Fr=new Set([z.node.id,...Dt.value.map(Wr=>Wr.id)]),zr=Wr=>{const An=[];for(const Ft of Wr)Ft.name.startsWith("#")&&!Fr.has(Ft.id)&&An.push(Ft),Ft.children.length>0&&An.push(...zr(Ft.children));return An};return zr(z.allNodes)}),re=Yo(()=>{if(!mt.value.trim())return Gt.value;const Fr=mt.value.toLowerCase();return Gt.value.filter(zr=>zr.name.toLowerCase().includes(Fr))}),pe=()=>{z.node&&(j("delete-all",z.node.id),or())},Ne=()=>{!z.node||!J.value||(j("move-children",{nodeId:z.node.id,targetParentId:J.value}),or())},or=()=>{J.value=null,mt.value="",j("close")},_r=Fr=>{Fr.target===Fr.currentTarget&&or()};return(Fr,zr)=>Fr.show&&Fr.node?(zi(),Vi("div",{key:0,onClick:_r,class:"fixed inset-0 bg-black/80 backdrop-blur-lg z-[99999] flex items-center justify-center p-4",style:{"backdrop-filter":"blur(8px) saturate(180%)",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"}},[Re("div",{class:"glass-card rounded-[20px] p-6 w-full max-w-lg border border-white/10",onClick:zr[2]||(zr[2]=hg(()=>{},["stop"]))},[Re("div",dmt,[zr[6]||(zr[6]=Re("svg",{class:"w-6 h-6 text-accent-red",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"})],-1)),Re("div",null,[zr[4]||(zr[4]=Re("h3",{class:"text-xl font-semibold text-white"},"Confirm Deletion",-1)),Re("p",pmt,[zr[3]||(zr[3]=nc(" Deleting ",-1)),Re("span",mmt,aa(Fr.node?.name),1)])]),Re("button",{onClick:or,class:"ml-auto text-white/60 hover:text-white transition-colors"},zr[5]||(zr[5]=[Re("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),Dt.value.length>0?(zi(),Vi("div",gmt,[Re("div",vmt,[zr[9]||(zr[9]=Re("svg",{class:"w-5 h-5 text-accent-red flex-shrink-0 mt-0.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),Re("div",ymt,[Re("h4",xmt," This will affect "+aa(Dt.value.length)+" child "+aa(Dt.value.length===1?"entry":"entries")+": ",1),Re("div",_mt,[(zi(!0),Vi(Ou,null,sf(Dt.value.slice(0,10),Wr=>(zi(),Vi("div",{key:Wr.id,class:"flex items-center gap-2 text-xs text-white/80"},[Wr.name.startsWith("#")?(zi(),Vi("svg",bmt,zr[7]||(zr[7]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"},null,-1)]))):(zi(),Vi("svg",wmt,zr[8]||(zr[8]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1721 9z"},null,-1)]))),Re("span",kmt,aa(Wr.name),1),Re("span",{class:Xs(["px-1 py-0.5 text-xs rounded",Wr.floodPolicy==="allow"?"bg-accent-green/20 text-accent-green":"bg-accent-red/20 text-accent-red"])},aa(Wr.floodPolicy),3)]))),128)),Dt.value.length>10?(zi(),Vi("div",Tmt," ...and "+aa(Dt.value.length-10)+" more ",1)):bs("",!0)])])])])):bs("",!0),Dt.value.length>0&&Gt.value.length>0?(zi(),Vi("div",Amt,[zr[13]||(zr[13]=Re("h4",{class:"text-white font-medium text-sm mb-3"},"Move children to another region:",-1)),Re("div",Mmt,[Re("div",Smt,[zr[10]||(zr[10]=Re("svg",{class:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-white/40",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1)),$p(Re("input",{"onUpdate:modelValue":zr[0]||(zr[0]=Wr=>mt.value=Wr),type:"text",placeholder:"Search regions...",class:"w-full pl-9 pr-4 py-2 bg-white/5 border border-white/20 rounded-lg text-white placeholder-white/50 focus:outline-none focus:border-primary focus:ring-2 focus:ring-primary/20 transition-colors text-sm"},null,512),[[$A,mt.value]])])]),Re("div",Emt,[re.value.length===0?(zi(),Vi("div",Cmt,aa(mt.value?"No regions match your search":"No available regions"),1)):bs("",!0),(zi(!0),Vi(Ou,null,sf(re.value,Wr=>(zi(),Vi("label",{key:Wr.id,class:"flex items-center gap-3 p-2 rounded cursor-pointer hover:bg-white/10 transition-colors group"},[Re("div",Lmt,[$p(Re("input",{type:"radio",value:Wr.id,"onUpdate:modelValue":zr[1]||(zr[1]=An=>J.value=An),class:"sr-only peer"},null,8,Pmt),[[F2,J.value]]),zr[11]||(zr[11]=Re("div",{class:"w-4 h-4 border-2 border-white/30 rounded-full group-hover:border-white/50 peer-checked:border-primary peer-checked:bg-primary/20 transition-all"},[Re("div",{class:"w-2 h-2 rounded-full bg-primary scale-0 peer-checked:scale-100 transition-transform absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2"})],-1))]),Re("div",zmt,[zr[12]||(zr[12]=Re("svg",{class:"w-4 h-4 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"})],-1)),Re("span",Imt,aa(Wr.name),1),Wr.children.length>0?(zi(),Vi("span",Omt,aa(Wr.children.length),1)):bs("",!0)])]))),128))])])):bs("",!0),Re("div",Dmt,[Re("button",{onClick:or,class:"flex-1 px-4 py-3 bg-white/5 hover:bg-white/10 border border-white/20 text-white rounded-lg transition-colors"}," Cancel "),Dt.value.length>0&&J.value?(zi(),Vi("button",{key:0,onClick:Ne,class:"flex-1 px-4 py-3 bg-primary/20 hover:bg-primary/30 border border-primary/50 text-primary rounded-lg transition-colors"}," Move & Delete ")):bs("",!0),Re("button",{onClick:pe,class:"flex-1 px-4 py-3 bg-accent-red/20 hover:bg-accent-red/30 border border-accent-red/50 text-accent-red rounded-lg transition-colors font-medium"},aa(Dt.value.length>0?"Delete All":"Delete"),1)])])])):bs("",!0)}}),Rmt={class:"space-y-6"},Bmt={class:"flex justify-between items-start"},Nmt={class:"flex gap-2"},jmt=["disabled"],Umt=["disabled"],Vmt=["disabled"],Hmt={class:"glass-card rounded-[15px] p-4 border border-white/10 bg-white/5"},Wmt={class:"flex items-center justify-between"},qmt={class:"flex items-center gap-3"},Zmt={class:"flex bg-white/5 rounded-lg border border-white/20 p-1"},$mt={class:"glass-card rounded-[15px] p-6 border border-white/10"},Gmt={key:0,class:"flex items-center justify-center py-8"},Ymt={key:1,class:"text-center py-8"},Kmt={class:"text-white/70 text-sm"},Xmt={key:2,class:"text-center py-8"},Jmt={key:3,class:"space-y-2"},Qmt=Th({name:"TransportKeys",__name:"TransportKeys",setup(d){const l=WD(),z=lo(!1),j=lo(!1),J=lo(!1),mt=lo(null),kt=lo(null),Dt=lo("deny"),Gt=lo([]),re=lo(!1),pe=lo(null),Ne=Li=>{const yi=new Map,ra=[];return Li.forEach(Da=>{const Ni={id:Da.id,name:Da.name,floodPolicy:Da.flood_policy,transport_key:Da.transport_key,last_used:Da.last_used?new Date(Da.last_used*1e3):void 0,parent_id:Da.parent_id,children:[]};yi.set(Da.id,Ni)}),yi.forEach(Da=>{Da.parent_id&&yi.has(Da.parent_id)?yi.get(Da.parent_id).children.push(Da):ra.push(Da)}),ra},or=async()=>{try{re.value=!0,pe.value=null;const Li=await Xh.getTransportKeys();Li.success&&Li.data?Gt.value=Ne(Li.data):pe.value=Li.error||"Failed to load transport keys"}catch(Li){pe.value=Li instanceof Error?Li.message:"Unknown error occurred",console.error("Error loading transport keys:",Li)}finally{re.value=!1}};t0(()=>{or()});function _r(Li,yi){for(const ra of Li){if(ra.id===yi)return ra;if(ra.children){const Da=_r(ra.children,yi);if(Da)return Da}}return null}function Fr(){const Li=l.selectedNodeId.value;return Li?_r(Gt.value,Li)?.name:void 0}function zr(Li){Dt.value==="deny"&&l.setSelectedNode(Li)}function Wr(){Dt.value==="deny"&&(z.value=!0)}function An(){if(Dt.value==="deny"&&l.selectedNodeId.value){const Li=_r(Gt.value,l.selectedNodeId.value);Li&&(kt.value=Li,J.value=!0)}}function Ft(){if(Dt.value==="deny"&&l.selectedNodeId.value){const Li=_r(Gt.value,l.selectedNodeId.value);Li&&(mt.value=Li,j.value=!0)}}const kn=async Li=>{try{const yi=await Xh.createTransportKey(Li.name,Li.floodPolicy,void 0,Li.parentId,void 0);yi.success?await or():(console.error("❌ Failed to add transport key:",yi.error),pe.value=yi.error||"Failed to add transport key")}catch(yi){console.error("❌ Error adding transport key:",yi),pe.value=yi instanceof Error?yi.message:"Unknown error occurred"}finally{z.value=!1}};function ei(){z.value=!1}async function jn(Li){try{const yi=Li==="allow",ra=await Xh.updateGlobalFloodPolicy(yi);ra.success?Dt.value=Li:(console.error("❌ Failed to update global flood policy:",ra.error),pe.value=ra.error||"Failed to update global flood policy")}catch(yi){console.error("❌ Error updating global flood policy:",yi),pe.value=yi instanceof Error?yi.message:"Failed to update global flood policy"}}function ai(){j.value=!1,mt.value=null}async function Qi(Li){try{const yi=await Xh.updateTransportKey(Li.id,Li.name,Li.floodPolicy);yi.success?await or():(console.error("❌ Failed to update transport key:",yi.error),pe.value=yi.error||"Failed to update transport key")}catch(yi){console.error("❌ Error updating transport key:",yi),pe.value=yi instanceof Error?yi.message:"Unknown error occurred"}finally{ai()}}function Gi(Li){j.value=!1,mt.value=null,kt.value=Li,J.value=!0}function un(){J.value=!1,kt.value=null}async function ia(Li){try{const yi=await Xh.deleteTransportKey(Li);yi.success?(await or(),l.setSelectedNode(null)):(console.error("❌ Failed to delete transport key:",yi.error),pe.value=yi.error||"Failed to delete transport key")}catch(yi){console.error("❌ Error deleting transport key:",yi),pe.value=yi instanceof Error?yi.message:"Unknown error occurred"}finally{un()}}async function fa(Li){try{const yi=await Xh.deleteTransportKey(Li.nodeId);yi.success?(await or(),l.setSelectedNode(null)):(console.error("❌ Failed to delete transport key:",yi.error),pe.value=yi.error||"Failed to delete transport key")}catch(yi){console.error("❌ Error deleting transport key:",yi),pe.value=yi instanceof Error?yi.message:"Unknown error occurred"}finally{un()}}return(Li,yi)=>(zi(),Vi("div",Rmt,[Re("div",Bmt,[yi[3]||(yi[3]=Re("div",null,[Re("h3",{class:"text-lg font-semibold text-white mb-2"},"Regions/Keys"),Re("p",{class:"text-white/70 text-sm"},"Manage regional key hierarchy")],-1)),Re("div",Nmt,[Re("button",{onClick:Wr,disabled:Dt.value==="allow",class:Xs(["flex items-center gap-2 px-3 py-2 rounded-lg border transition-colors text-sm",Dt.value==="allow"?"bg-white/5 text-white/40 border-white/20 cursor-not-allowed":"bg-accent-green/10 hover:bg-accent-green/20 text-accent-green border-accent-green/30"])},yi[2]||(yi[2]=[Re("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})],-1),nc(" Add ",-1)]),10,jmt),Re("button",{onClick:Ft,disabled:!Ju(l).selectedNodeId.value||Dt.value==="allow",class:Xs(["px-4 py-2 rounded-lg border transition-colors",!Ju(l).selectedNodeId.value||Dt.value==="allow"?"bg-white/10 text-white/40 border-white/20 cursor-not-allowed":"bg-accent-green/20 hover:bg-accent-green/30 text-accent-green border-accent-green/50"])}," Edit ",10,Umt),Re("button",{onClick:An,disabled:!Ju(l).selectedNodeId.value||Dt.value==="allow",class:Xs(["px-4 py-2 rounded-lg border transition-colors",!Ju(l).selectedNodeId.value||Dt.value==="allow"?"bg-white/10 text-white/40 border-white/20 cursor-not-allowed":"bg-accent-red/20 hover:bg-accent-red/30 text-accent-red border-accent-red/50"])}," Delete ",10,Vmt)])]),Re("div",Hmt,[Re("div",Wmt,[yi[4]||(yi[4]=Re("div",null,[Re("h4",{class:"text-sm font-medium text-white mb-1"},"Global Flood Policy (*)"),Re("p",{class:"text-white/60 text-xs"},"Master control for repeater flooding")],-1)),Re("div",qmt,[Re("div",Zmt,[Re("button",{onClick:yi[0]||(yi[0]=ra=>jn("deny")),class:Xs(["px-3 py-1 text-xs font-medium rounded transition-colors",Dt.value==="deny"?"bg-accent-red/20 text-accent-red border border-accent-red/50":"text-white/60 hover:text-white/80"])}," DENY ",2),Re("button",{onClick:yi[1]||(yi[1]=ra=>jn("allow")),class:Xs(["px-3 py-1 text-xs font-medium rounded transition-colors",Dt.value==="allow"?"bg-accent-green/20 text-accent-green border border-accent-green/50":"text-white/60 hover:text-white/80"])}," ALLOW ",2)])])])]),Re("div",$mt,[re.value?(zi(),Vi("div",Gmt,yi[5]||(yi[5]=[Re("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-accent-green"},null,-1),Re("span",{class:"ml-2 text-white/70"},"Loading transport keys...",-1)]))):pe.value?(zi(),Vi("div",Ymt,[yi[6]||(yi[6]=Re("div",{class:"text-accent-red mb-2"},"⚠️ Error loading transport keys",-1)),Re("div",Kmt,aa(pe.value),1),Re("button",{onClick:or,class:"mt-4 px-4 py-2 bg-accent-green/20 hover:bg-accent-green/30 text-accent-green border border-accent-green/50 rounded-lg transition-colors"}," Retry ")])):Gt.value.length===0?(zi(),Vi("div",Xmt,yi[7]||(yi[7]=[Re("div",{class:"text-white/50 mb-2"},"📝 No transport keys found",-1),Re("div",{class:"text-white/30 text-sm"},"Add your first transport key to get started",-1)]))):(zi(),Vi("div",Jmt,[(zi(!0),Vi(Ou,null,sf(Gt.value,ra=>(zi(),hm(y0t,{key:ra.id,node:ra,"selected-node-id":Ju(l).selectedNodeId.value,level:0,disabled:Dt.value==="allow",onSelect:zr},null,8,["node","selected-node-id","disabled"]))),128))]))]),gu(N0t,{show:z.value,"selected-node-name":Fr(),"selected-node-id":Ju(l).selectedNodeId.value||void 0,onClose:ei,onAdd:kn},null,8,["show","selected-node-name","selected-node-id"]),gu(fmt,{show:j.value,node:mt.value,onClose:ai,onSave:Qi,onRequestDelete:Gi},null,8,["show","node"]),gu(Fmt,{show:J.value,node:kt.value,"all-nodes":Gt.value,onClose:un,onDeleteAll:ia,onMoveChildren:fa},null,8,["show","node","all-nodes"])]))}}),tgt={class:"p-6 space-y-6"},egt={class:"glass-card rounded-[15px] z-10 p-4 border border-primary/30 bg-primary/10"},rgt={class:"text-primary"},ngt={class:"mt-2 text-primary/80"},igt={class:"glass-card rounded-[15px] p-6"},agt={class:"flex flex-wrap border-b border-white/10 mb-6"},ogt=["onClick"],sgt={class:"flex items-center gap-2"},lgt={key:0,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},ugt={key:1,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},cgt={key:2,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},hgt={key:3,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},fgt={key:4,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},dgt={class:"min-h-[400px]"},pgt={key:0,class:"flex items-center justify-center py-12"},mgt={key:1,class:"flex items-center justify-center py-12"},ggt={class:"text-center"},vgt={class:"text-white/60 text-sm mb-4"},ygt={key:2},xgt=Th({name:"ConfigurationView",__name:"Configuration",setup(d){const l=sv(),z=lo("radio"),j=lo(!1),J=[{id:"radio",label:"Radio Settings",icon:"radio"},{id:"repeater",label:"Repeater Settings",icon:"repeater"},{id:"duty",label:"Duty Cycle",icon:"duty"},{id:"delays",label:"TX Delays",icon:"delays"},{id:"transport",label:"Regions/Keys",icon:"keys"}];t0(async()=>{try{await l.fetchStats(),j.value=!0}catch(kt){console.error("Failed to load configuration data:",kt),j.value=!0}});function mt(kt){z.value=kt}return(kt,Dt)=>{const Gt=UA("router-link");return zi(),Vi("div",tgt,[Dt[11]||(Dt[11]=Re("div",null,[Re("h1",{class:"text-2xl font-bold text-white"},"Configuration"),Re("p",{class:"text-white/70 mt-2"},"System configuration and settings")],-1)),Dt[12]||(Dt[12]=Re("div",{class:"glass-card rounded-[15px] p-4 border border-blue-500/30 bg-blue-500/10"},[Re("div",{class:"text-blue-200"},[Re("strong",null,"Configuration is read-only."),nc(" To modify settings, edit the config file and restart the daemon. ")])],-1)),Re("div",egt,[Re("div",rgt,[Dt[3]||(Dt[3]=Re("strong",null,"CAD Calibration Tool Available",-1)),Re("p",ngt,[Dt[2]||(Dt[2]=nc(" Optimize your Channel Activity Detection settings. ",-1)),gu(Gt,{to:"/cad-calibration",class:"underline hover:text-primary transition-colors"},{default:Y2(()=>Dt[1]||(Dt[1]=[nc(" Launch CAD Calibration Tool → ",-1)])),_:1,__:[1]})])])]),Re("div",igt,[Re("div",agt,[(zi(),Vi(Ou,null,sf(J,re=>Re("button",{key:re.id,onClick:pe=>mt(re.id),class:Xs(["px-4 py-2 text-sm font-medium transition-colors duration-200 border-b-2 mr-6 mb-2",z.value===re.id?"text-primary border-primary":"text-white/70 border-transparent hover:text-white hover:border-white/30"])},[Re("div",sgt,[re.icon==="radio"?(zi(),Vi("svg",lgt,Dt[4]||(Dt[4]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8.111 16.404a5.5 5.5 0 017.778 0M12 20h.01m-7.08-7.071c3.904-3.905 10.236-3.905 14.141 0M1.394 9.822c5.716-5.716 14.976-5.716 20.692 0"},null,-1)]))):re.icon==="repeater"?(zi(),Vi("svg",ugt,Dt[5]||(Dt[5]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14M5 12l4-4m-4 4l4 4"},null,-1)]))):re.icon==="duty"?(zi(),Vi("svg",cgt,Dt[6]||(Dt[6]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)]))):re.icon==="delays"?(zi(),Vi("svg",hgt,Dt[7]||(Dt[7]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"},null,-1)]))):re.icon==="keys"?(zi(),Vi("svg",fgt,Dt[8]||(Dt[8]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"},null,-1)]))):bs("",!0),nc(" "+aa(re.label),1)])],10,ogt)),64))]),Re("div",dgt,[!j.value&&Ju(l).isLoading?(zi(),Vi("div",pgt,Dt[9]||(Dt[9]=[Re("div",{class:"text-center"},[Re("div",{class:"animate-spin w-8 h-8 border-2 border-white/20 border-t-primary rounded-full mx-auto mb-4"}),Re("div",{class:"text-white/70"},"Loading configuration...")],-1)]))):Ju(l).error&&!j.value?(zi(),Vi("div",mgt,[Re("div",ggt,[Dt[10]||(Dt[10]=Re("div",{class:"text-red-400 mb-2"},"Failed to load configuration",-1)),Re("div",vgt,aa(Ju(l).error),1),Re("button",{onClick:Dt[0]||(Dt[0]=re=>Ju(l).fetchStats()),class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-white rounded-lg border border-primary/50 transition-colors"}," Retry ")])])):(zi(),Vi("div",ygt,[$p(Re("div",null,[gu(wpt,{key:"radio-settings"})],512),[[Kb,z.value==="radio"]]),$p(Re("div",null,[gu(Npt,{key:"repeater-settings"})],512),[[Kb,z.value==="repeater"]]),$p(Re("div",null,[gu(Zpt,{key:"duty-cycle"})],512),[[Kb,z.value==="duty"]]),$p(Re("div",null,[gu(Qpt,{key:"transmission-delays"})],512),[[Kb,z.value==="delays"]]),$p(Re("div",null,[gu(Qmt,{key:"transport-keys"})],512),[[Kb,z.value==="transport"]])]))])])])}}}),_gt={class:"p-6 space-y-6"},bgt={class:"glass-card rounded-[15px] p-6"},wgt={class:"flex justify-center"},kgt={class:"flex gap-4"},Tgt=["disabled"],Agt=["disabled"],Mgt={class:"glass-card rounded-[15px] p-6 space-y-4"},Sgt={class:"text-white"},Egt={key:0,class:"p-4 bg-primary/10 border border-primary/30 rounded-lg"},Cgt={class:"text-primary/90"},Lgt={class:"space-y-2"},Pgt={class:"w-full bg-white/10 rounded-full h-2"},zgt={class:"text-white/70 text-sm"},Igt={class:"grid grid-cols-2 md:grid-cols-4 gap-4"},Ogt={class:"glass-card rounded-[15px] p-4 text-center"},Dgt={class:"text-2xl font-bold text-primary"},Fgt={class:"glass-card rounded-[15px] p-4 text-center"},Rgt={class:"text-2xl font-bold text-primary"},Bgt={class:"glass-card rounded-[15px] p-4 text-center"},Ngt={class:"text-2xl font-bold text-primary"},jgt={class:"glass-card rounded-[15px] p-4 text-center"},Ugt={class:"text-2xl font-bold text-primary"},Vgt={key:0,class:"glass-card rounded-[15px] p-6 space-y-4"},Hgt={key:0,class:"p-4 bg-accent-green/10 border border-accent-green/30 rounded-lg"},Wgt={class:"text-white/80 mb-4"},qgt={key:1,class:"p-4 bg-secondary/20 border border-secondary/40 rounded-lg"},Zgt=Th({name:"CADCalibrationView",__name:"CADCalibration",setup(d){const l=sv(),z=lo(!1),j=lo(null),J=lo(null),mt=lo({}),kt=lo(null),Dt=lo([]),Gt=lo({}),re=lo("Ready to start calibration"),pe=lo(0),Ne=lo(0),or=lo(0),_r=lo(0),Fr=lo(0),zr=lo(0),Wr=lo(null),An=lo(!1),Ft=lo(!1),kn=lo(!1),ei=lo(!1);let jn=null;const ai={responsive:!0,displayModeBar:!0,modeBarButtonsToRemove:["pan2d","select2d","lasso2d","autoScale2d"],displaylogo:!1,toImageButtonOptions:{format:"png",filename:"cad-calibration-heatmap",height:600,width:800,scale:2}};function Qi(){const Ni=[{x:[],y:[],z:[],mode:"markers",type:"scatter",marker:{size:12,color:[],colorscale:[[0,"rgba(75, 85, 99, 0.4)"],[.1,"rgba(6, 182, 212, 0.3)"],[.5,"rgba(6, 182, 212, 0.6)"],[1,"rgba(16, 185, 129, 0.9)"]],showscale:!0,colorbar:{title:{text:"Detection Rate (%)",font:{color:"#ffffff",size:14}},tickfont:{color:"#ffffff"},bgcolor:"rgba(0,0,0,0)",bordercolor:"rgba(255,255,255,0.2)",borderwidth:1,thickness:15},line:{color:"rgba(255,255,255,0.2)",width:1}},hovertemplate:"Peak: %{x}
Min: %{y}
Detection Rate: %{marker.color:.1f}%
",name:"Test Results"}],Ei={title:{text:'CAD Detection Rate
Channel Activity Detection Calibration',font:{color:"#ffffff",size:18},x:.5},xaxis:{title:{text:"CAD Peak Threshold",font:{color:"#cbd5e1",size:14}},tickfont:{color:"#cbd5e1"},gridcolor:"rgba(148, 163, 184, 0.1)",zerolinecolor:"rgba(148, 163, 184, 0.2)",linecolor:"rgba(148, 163, 184, 0.3)"},yaxis:{title:{text:"CAD Min Threshold",font:{color:"#cbd5e1",size:14}},tickfont:{color:"#cbd5e1"},gridcolor:"rgba(148, 163, 184, 0.1)",zerolinecolor:"rgba(148, 163, 184, 0.2)",linecolor:"rgba(148, 163, 184, 0.3)"},plot_bgcolor:"rgba(0, 0, 0, 0)",paper_bgcolor:"rgba(0, 0, 0, 0)",font:{color:"#ffffff",family:"Inter, system-ui, sans-serif"},margin:{l:80,r:80,t:100,b:80},showlegend:!1};l1.newPlot("plotly-chart",Ni,Ei,ai)}function Gi(){if(Object.keys(mt.value).length===0)return;const Ni=Object.values(mt.value),Ei=[],Va=[],ss=[];for(const ko of Ni)Ei.push(ko.det_peak),Va.push(ko.det_min),ss.push(ko.detection_rate);const mo={x:[Ei],y:[Va],"marker.color":[ss],hovertemplate:"Peak: %{x}
Min: %{y}
Detection Rate: %{marker.color:.1f}%
Status: Tested
"};l1.restyle("plotly-chart",mo,[0])}async function un(){try{const Va=await Xh.post("/cad-calibration-start",{samples:10,delay_ms:50});if(Va.success)z.value=!0,j.value=Date.now(),l.setCadCalibrationRunning(!0),mt.value={},Dt.value=[],Gt.value={},kt.value=null,An.value=!1,Ft.value=!1,kn.value=!1,ei.value=!1,or.value=0,_r.value=0,Fr.value=0,zr.value=0,pe.value=0,Ne.value=0,jn=setInterval(()=>{j.value&&(zr.value=Math.floor((Date.now()-j.value)/1e3))},1e3),fa();else throw new Error(Va.error||"Failed to start calibration")}catch(Va){re.value=`Error: ${Va instanceof Error?Va.message:"Unknown error"}`}}async function ia(){try{(await Xh.post("/cad-calibration-stop")).success&&(z.value=!1,l.setCadCalibrationRunning(!1),J.value&&(J.value.close(),J.value=null),jn&&(clearInterval(jn),jn=null))}catch(Ni){console.error("Failed to stop calibration:",Ni)}}function fa(){J.value&&J.value.close(),J.value=new EventSource(`${iQ}/api/cad-calibration-stream`),J.value.onmessage=function(Ni){try{const Ei=JSON.parse(Ni.data);Li(Ei)}catch(Ei){console.error("Failed to parse SSE data:",Ei)}},J.value.onerror=function(Ni){console.error("SSE connection error:",Ni),z.value||J.value&&(J.value.close(),J.value=null)}}function Li(Ni){switch(Ni.type){case"status":re.value=Ni.message||"Status update",Ni.test_ranges&&(Wr.value=Ni.test_ranges,An.value=!0);break;case"progress":pe.value=Ni.current||0,Ne.value=Ni.total||0,or.value=Ni.current||0;break;case"result":if(Ni.det_peak!==void 0&&Ni.det_min!==void 0&&Ni.detection_rate!==void 0&&Ni.detections!==void 0&&Ni.samples!==void 0){const Ei=`${Ni.det_peak}_${Ni.det_min}`;mt.value[Ei]={det_peak:Ni.det_peak,det_min:Ni.det_min,detection_rate:Ni.detection_rate,detections:Ni.detections,samples:Ni.samples},Gi(),yi()}break;case"complete":case"completed":z.value=!1,re.value=Ni.message||"Calibration completed",l.setCadCalibrationRunning(!1),ra(),J.value&&(J.value.close(),J.value=null),jn&&(clearInterval(jn),jn=null);break;case"error":re.value=`Error: ${Ni.message}`,l.setCadCalibrationRunning(!1),ia();break}}function yi(){const Ni=Object.values(mt.value).map(Ei=>Ei.detection_rate);Ni.length!==0&&(_r.value=Math.max(...Ni),Fr.value=Ni.reduce((Ei,Va)=>Ei+Va,0)/Ni.length)}function ra(){Ft.value=!0;let Ni=null,Ei=0;for(const Va of Object.values(mt.value))Va.detection_rate>Ei&&(Ei=Va.detection_rate,Ni=Va);kt.value=Ni,Ni&&Ei>0?(kn.value=!0,ei.value=!1):(kn.value=!1,ei.value=!0)}async function Da(){if(!kt.value){re.value="Error: No calibration results to save";return}try{const Ni=await Xh.post("/save_cad_settings",{peak:kt.value.det_peak,min_val:kt.value.det_min,detection_rate:kt.value.detection_rate});if(Ni.success)re.value=`Settings saved! Peak=${kt.value.det_peak}, Min=${kt.value.det_min} applied to configuration.`;else throw new Error(Ni.error||"Failed to save settings")}catch(Ni){re.value=`Error: Failed to save settings: ${Ni instanceof Error?Ni.message:"Unknown error"}`}}return t0(()=>{Qi()}),K2(()=>{J.value&&J.value.close(),jn&&clearInterval(jn),l.setCadCalibrationRunning(!1),document.getElementById("plotly-chart")&&l1.purge("plotly-chart")}),(Ni,Ei)=>(zi(),Vi("div",_gt,[Ei[14]||(Ei[14]=Re("div",null,[Re("h1",{class:"text-2xl font-bold text-white"},"CAD Calibration Tool"),Re("p",{class:"text-white/70 mt-2"},"Channel Activity Detection calibration")],-1)),Re("div",bgt,[Re("div",wgt,[Re("div",kgt,[Re("button",{onClick:un,disabled:z.value,class:"flex items-center gap-3 px-6 py-3 bg-accent-green/10 hover:bg-accent-green/20 disabled:bg-gray-500/10 text-accent-green disabled:text-gray-400 rounded-lg border border-accent-green/30 disabled:border-gray-500/20 transition-colors disabled:cursor-not-allowed"},Ei[0]||(Ei[0]=[Ff('
Start Calibration
Begin testing
',2)]),8,Tgt),Re("button",{onClick:ia,disabled:!z.value,class:"flex items-center gap-3 px-6 py-3 bg-accent-red/10 hover:bg-accent-red/20 disabled:bg-gray-500/10 text-accent-red disabled:text-gray-400 rounded-lg border border-accent-red/30 disabled:border-gray-500/20 transition-colors disabled:cursor-not-allowed"},Ei[1]||(Ei[1]=[Ff('
Stop
Halt calibration
',2)]),8,Agt)])])]),Re("div",Mgt,[Re("div",Sgt,aa(re.value),1),An.value&&Wr.value?(zi(),Vi("div",Egt,[Re("div",Cgt,[Ei[2]||(Ei[2]=Re("strong",null,"Configuration:",-1)),nc(" SF"+aa(Wr.value.spreading_factor)+" | Peak: "+aa(Wr.value.peak_min)+" - "+aa(Wr.value.peak_max)+" | Min: "+aa(Wr.value.min_min)+" - "+aa(Wr.value.min_max)+" | "+aa((Wr.value.peak_max-Wr.value.peak_min+1)*(Wr.value.min_max-Wr.value.min_min+1))+" tests ",1)])])):bs("",!0),Re("div",Lgt,[Re("div",Pgt,[Re("div",{class:"bg-gradient-to-r from-primary to-accent-green h-2 rounded-full transition-all duration-300",style:av({width:Ne.value>0?`${pe.value/Ne.value*100}%`:"0%"})},null,4)]),Re("div",zgt,aa(pe.value)+" / "+aa(Ne.value)+" tests completed",1)])]),Re("div",Igt,[Re("div",Ogt,[Re("div",Dgt,aa(or.value),1),Ei[3]||(Ei[3]=Re("div",{class:"text-white/70 text-sm"},"Tests Completed",-1))]),Re("div",Fgt,[Re("div",Rgt,aa(_r.value.toFixed(1))+"%",1),Ei[4]||(Ei[4]=Re("div",{class:"text-white/70 text-sm"},"Best Detection Rate",-1))]),Re("div",Bgt,[Re("div",Ngt,aa(Fr.value.toFixed(1))+"%",1),Ei[5]||(Ei[5]=Re("div",{class:"text-white/70 text-sm"},"Average Rate",-1))]),Re("div",jgt,[Re("div",Ugt,aa(zr.value)+"s",1),Ei[6]||(Ei[6]=Re("div",{class:"text-white/70 text-sm"},"Elapsed Time",-1))])]),Ei[15]||(Ei[15]=Re("div",{class:"glass-card rounded-[15px] p-6"},[Re("div",{id:"plotly-chart",class:"w-full h-96"})],-1)),Ft.value?(zi(),Vi("div",Vgt,[Ei[13]||(Ei[13]=Re("h3",{class:"text-xl font-bold text-white"},"Calibration Results",-1)),kn.value&&kt.value?(zi(),Vi("div",Hgt,[Ei[11]||(Ei[11]=Re("h4",{class:"font-medium text-accent-green mb-2"},"Optimal Settings Found:",-1)),Re("p",Wgt,[Ei[7]||(Ei[7]=nc(" Peak: ",-1)),Re("strong",null,aa(kt.value.det_peak),1),Ei[8]||(Ei[8]=nc(", Min: ",-1)),Re("strong",null,aa(kt.value.det_min),1),Ei[9]||(Ei[9]=nc(", Rate: ",-1)),Re("strong",null,aa(kt.value.detection_rate.toFixed(1))+"%",1)]),Re("div",{class:"flex justify-center"},[Re("button",{onClick:Da,class:"flex items-center gap-3 px-6 py-3 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors"},Ei[10]||(Ei[10]=[Ff('
Save Settings
Apply to configuration
',2)]))])])):bs("",!0),ei.value?(zi(),Vi("div",qgt,Ei[12]||(Ei[12]=[Re("h4",{class:"font-medium text-secondary mb-2"},"No Optimal Settings Found",-1),Re("p",{class:"text-white/70"},"All tested combinations showed low detection rates. Consider running calibration again or adjusting test parameters.",-1)]))):bs("",!0)])):bs("",!0)]))}}),$gt=ld(Zgt,[["__scopeId","data-v-854f5f55"]]),Ggt={class:"space-y-6"},Ygt={class:"bg-dark-card/30 backdrop-blur border border-white/10 rounded-[15px] p-6"},Kgt={class:"flex items-center justify-between mb-4"},Xgt=["disabled"],Jgt={class:"bg-white/5 border border-white/10 rounded-lg p-4"},Qgt={class:"flex flex-wrap gap-2"},tvt=["onClick"],evt={key:0,class:"w-px h-6 bg-white/20 mx-2 self-center"},rvt=["onClick"],nvt={class:"bg-dark-card/30 backdrop-blur border border-white/10 rounded-[15px] overflow-hidden"},ivt={key:0,class:"p-8 text-center"},avt={key:1,class:"p-8 text-center"},ovt={class:"text-dark-text mb-4"},svt={key:2,class:"max-h-[600px] overflow-y-auto"},lvt={key:0,class:"p-8 text-center"},uvt={key:1,class:"divide-y divide-white/5"},cvt={class:"flex-shrink-0 text-dark-text"},hvt={class:"flex-shrink-0 px-2 py-1 text-xs font-medium rounded bg-blue-500/20 text-blue-400"},fvt={class:"text-white flex-1 break-all"},dvt=Th({name:"LogsView",__name:"Logs",setup(d){const l=lo([]),z=lo(new Set),j=lo(new Set(["DEBUG","INFO","WARNING","ERROR"])),J=lo(new Set),mt=lo(new Set),kt=lo(!0),Dt=lo(null);let Gt=null;const re=fa=>{const Li=fa.match(/- ([^-]+) - (?:DEBUG|INFO|WARNING|ERROR) -/);return Li?Li[1].trim():"Unknown"},pe=fa=>{const Li=fa.match(/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2},\d{3} - [^-]+ - (?:DEBUG|INFO|WARNING|ERROR) - (.+)$/);return Li?Li[1]:fa},Ne=(fa,Li)=>{if(fa.size!==Li.size)return!1;for(const yi of fa)if(!Li.has(yi))return!1;return!0},or=async()=>{try{const fa=await Xh.getLogs();if(fa.logs&&fa.logs.length>0){l.value=fa.logs;const Li=new Set;l.value.forEach(Ni=>{const Ei=re(Ni.message);Li.add(Ei)});const yi=new Set;l.value.forEach(Ni=>{yi.add(Ni.level)}),z.value.size===0&&(z.value=new Set(Li));const ra=!Ne(J.value,Li),Da=!Ne(mt.value,yi);ra&&(J.value=Li),Da&&(mt.value=yi),Dt.value=null}}catch(fa){console.error("Error loading logs:",fa),Dt.value=fa instanceof Error?fa.message:"Failed to load logs"}finally{kt.value=!1}},_r=Yo(()=>l.value.filter(Li=>{const yi=re(Li.message),ra=z.value.has(yi),Da=j.value.has(Li.level);return ra&&Da})),Fr=Yo(()=>Array.from(J.value).sort()),zr=Yo(()=>{const fa=["ERROR","WARNING","WARN","INFO","DEBUG"];return Array.from(mt.value).sort((yi,ra)=>{const Da=fa.indexOf(yi),Ni=fa.indexOf(ra);return Da!==-1&&Ni!==-1?Da-Ni:yi.localeCompare(ra)})}),Wr=fa=>{j.value.has(fa)?j.value.delete(fa):j.value.add(fa),j.value=new Set(j.value)},An=fa=>new Date(fa).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}),Ft=fa=>({ERROR:"text-red-400 bg-red-900/20",WARNING:"text-yellow-400 bg-yellow-900/20",WARN:"text-yellow-400 bg-yellow-900/20",INFO:"text-blue-400 bg-blue-900/20",DEBUG:"text-gray-400 bg-gray-900/20"})[fa]||"text-gray-400 bg-gray-900/20",kn=(fa,Li)=>Li?{ERROR:"bg-red-500/20 text-red-400 border-red-500/50",WARNING:"bg-yellow-500/20 text-yellow-400 border-yellow-500/50",WARN:"bg-yellow-500/20 text-yellow-400 border-yellow-500/50",INFO:"bg-blue-500/20 text-blue-400 border-blue-500/50",DEBUG:"bg-gray-500/20 text-gray-400 border-gray-500/50"}[fa]||"bg-primary/20 text-primary border-primary/50":"bg-white/5 text-white/60 border-white/20 hover:bg-white/10",ei=fa=>{z.value.has(fa)?z.value.delete(fa):z.value.add(fa),z.value=new Set(z.value)},jn=()=>{z.value=new Set(J.value)},ai=()=>{z.value=new Set},Qi=()=>{j.value=new Set(mt.value)},Gi=()=>{j.value=new Set},un=()=>{Gt&&clearInterval(Gt),Gt=setInterval(or,5e3)},ia=()=>{Gt&&(clearInterval(Gt),Gt=null)};return t0(()=>{or(),un()}),dg(()=>{ia()}),(fa,Li)=>(zi(),Vi("div",Ggt,[Re("div",Ygt,[Re("div",Kgt,[Li[1]||(Li[1]=Re("div",null,[Re("h1",{class:"text-white text-2xl font-semibold mb-2"},"System Logs"),Re("p",{class:"text-dark-text"},"Real-time system events and diagnostics")],-1)),Re("button",{onClick:or,disabled:kt.value,class:"flex items-center gap-2 px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary border border-primary/50 rounded-lg transition-colors disabled:opacity-50"},[(zi(),Vi("svg",{class:Xs(["w-4 h-4",{"animate-spin":kt.value}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Li[0]||(Li[0]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"},null,-1)]),2)),nc(" "+aa(kt.value?"Loading...":"Refresh"),1)],8,Xgt)]),Re("div",Jgt,[Re("div",{class:"flex flex-wrap items-center gap-3 mb-4"},[Li[2]||(Li[2]=Re("span",{class:"text-white font-medium"},"Filters:",-1)),Re("button",{onClick:jn,class:"px-3 py-1 text-xs bg-accent-green/20 hover:bg-accent-green/30 text-accent-green border border-accent-green/50 rounded transition-colors"}," All Loggers "),Re("button",{onClick:ai,class:"px-3 py-1 text-xs bg-accent-red/20 hover:bg-accent-red/30 text-accent-red border border-accent-red/50 rounded transition-colors"}," Clear Loggers "),Li[3]||(Li[3]=Re("div",{class:"w-px h-4 bg-white/20 mx-1"},null,-1)),Re("button",{onClick:Qi,class:"px-3 py-1 text-xs bg-accent-green/20 hover:bg-accent-green/30 text-accent-green border border-accent-green/50 rounded transition-colors"}," All Levels "),Re("button",{onClick:Gi,class:"px-3 py-1 text-xs bg-accent-red/20 hover:bg-accent-red/30 text-accent-red border border-accent-red/50 rounded transition-colors"}," Clear Levels ")]),Re("div",Qgt,[(zi(!0),Vi(Ou,null,sf(Fr.value,yi=>(zi(),Vi("button",{key:"logger-"+yi,onClick:ra=>ei(yi),class:Xs(["px-3 py-1 text-xs border rounded-full transition-colors",z.value.has(yi)?"bg-primary/20 text-primary border-primary/50":"bg-white/5 text-white/60 border-white/20 hover:bg-white/10"])},aa(yi),11,tvt))),128)),Fr.value.length>0&&zr.value.length>0?(zi(),Vi("div",evt)):bs("",!0),(zi(!0),Vi(Ou,null,sf(zr.value,yi=>(zi(),Vi("button",{key:"level-"+yi,onClick:ra=>Wr(yi),class:Xs(["px-3 py-1 text-xs border rounded-full transition-colors font-medium",j.value.has(yi)?kn(yi,!0):kn(yi,!1)])},aa(yi),11,rvt))),128))])])]),Re("div",nvt,[kt.value&&l.value.length===0?(zi(),Vi("div",ivt,Li[4]||(Li[4]=[Re("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary mx-auto mb-4"},null,-1),Re("p",{class:"text-dark-text"},"Loading system logs...",-1)]))):Dt.value?(zi(),Vi("div",avt,[Li[5]||(Li[5]=Re("div",{class:"text-red-400 mb-4"},[Re("svg",{class:"w-12 h-12 mx-auto mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})])],-1)),Li[6]||(Li[6]=Re("h3",{class:"text-white text-lg font-medium mb-2"},"Error Loading Logs",-1)),Re("p",ovt,aa(Dt.value),1),Re("button",{onClick:or,class:"px-4 py-2 bg-red-500/20 hover:bg-red-500/30 text-red-400 border border-red-500/50 rounded-lg transition-colors"}," Try Again ")])):(zi(),Vi("div",svt,[_r.value.length===0?(zi(),Vi("div",lvt,Li[7]||(Li[7]=[Ff('

No Logs to Display

No logs match the current filter criteria.

',3)]))):(zi(),Vi("div",uvt,[(zi(!0),Vi(Ou,null,sf(_r.value,(yi,ra)=>(zi(),Vi("div",{key:ra,class:"flex items-start gap-4 p-4 hover:bg-white/5 transition-colors font-mono text-sm"},[Re("span",cvt," ["+aa(An(yi.timestamp))+"] ",1),Re("span",hvt,aa(re(yi.message)),1),Re("span",{class:Xs(["flex-shrink-0 px-2 py-1 text-xs font-medium rounded",Ft(yi.level)])},aa(yi.level),3),Re("span",fvt,aa(pe(yi.message)),1)]))),128))]))]))])]))}}),pvt=Th({name:"HelpView",__name:"Help",setup(d){return(l,z)=>(zi(),Vi("div",null,z[0]||(z[0]=[Ff('

Help

Help & Documentation

Find answers to common questions and access user guides.

',1)])))}}),mvt=SX({history:aX("/"),routes:[{path:"/",name:"dashboard",component:Eat},{path:"/neighbors",name:"neighbors",component:aot},{path:"/statistics",name:"statistics",component:spt},{path:"/configuration",name:"configuration",component:xgt},{path:"/cad-calibration",name:"cad-calibration",component:$gt},{path:"/logs",name:"logs",component:dvt},{path:"/help",name:"help",component:pvt}]}),wM=dK(ert);wM.use(gK());wM.use(mvt);wM.mount("#app"); +*/return window.Plotly=z,z})}(J5)),J5.exports}var Fdt=Ddt();const l1=LO(Fdt),Rdt={class:"p-6 space-y-6"},Bdt={class:"flex justify-between items-center"},Ndt={class:"flex items-center gap-3"},jdt=["value"],Udt={class:"grid grid-cols-1 sm:grid-cols-2 gap-4"},Vdt={class:"glass-card rounded-[15px] p-6"},Hdt={class:"mb-6"},Wdt={class:"relative h-48 bg-white/5 rounded-lg p-4"},qdt={key:0,class:"absolute inset-0 flex items-center justify-center bg-white/5 backdrop-blur-sm z-20"},Zdt={key:1,class:"absolute inset-0 flex items-center justify-center bg-white/5 z-20"},$dt={class:"mb-6"},Gdt={class:"relative h-48 bg-white/5 rounded-lg p-4"},Ydt={key:0,class:"absolute inset-0 flex items-center justify-center bg-white/5 backdrop-blur-sm z-20"},Kdt={key:1,class:"absolute inset-0 flex items-center justify-center bg-white/5 z-20"},Xdt={class:"glass-card rounded-[15px] p-6"},Jdt={class:"grid grid-cols-1 lg:grid-cols-3 gap-6"},Qdt={class:"lg:col-span-2"},tpt={class:"relative h-64 bg-white/5 rounded-lg p-4"},ept={class:"flex flex-col items-center justify-center"},rpt={class:"relative w-48 h-48"},npt={key:0,class:"absolute inset-0 flex items-center justify-center bg-white/5 backdrop-blur-sm rounded-full z-20"},ipt={key:1,class:"absolute inset-0 flex items-center justify-center bg-white/5 rounded-full z-20"},apt={key:0,class:"glass-card rounded-[15px] p-8 text-center"},opt={key:1,class:"glass-card rounded-[15px] p-8 text-center"},spt={class:"text-white/60 text-sm"},lpt=Th({name:"StatisticsView",__name:"Statistics",setup(d){d2.register(Hct,Zct,Xut,Z4,Mlt,klt,Alt,Pct,Nct,Cct,Uut,nct,kct,kA);const l=rw(),z=lo(null),j=lo(!1),J=lo(24),mt=[{value:1,label:"1 Hour"},{value:6,label:"6 Hours"},{value:12,label:"12 Hours"},{value:24,label:"24 Hours"},{value:48,label:"2 Days"},{value:168,label:"1 Week"}],kt=lo(null),Dt=lo(null),Gt=lo([]),re=lo(null),pe=lo([]),Ne=lo(!0),or=lo(null),_r=lo({packetRate:!0,packetType:!0,noiseFloor:!1,routePie:!0}),Fr=lo(!1),zr=lo(!1),Wr=lo(!1),An=lo(null),Ft=lo(null),kn=lo(null),ei=lo(null),jn=lo(null),ai=lo(null),Qi=lo(null),Gi=Yo(()=>{const qo=l.packetStats;return qo?{totalRx:qo.total_packets||0,totalTx:qo.transmitted_packets||0}:{totalRx:0,totalTx:0}}),un=Yo(()=>{let qo=[],fo=[];if(kt.value?.series){const Ta=kt.value.series.find(go=>go.type==="rx_count"),Ea=kt.value.series.find(go=>go.type==="tx_count");Ta?.data&&(qo=Ta.data.map(([,go])=>go)),Ea?.data&&(fo=Ea.data.map(([,go])=>go))}return{totalPackets:qo,transmittedPackets:fo,droppedPackets:[]}}),ia=async()=>{try{Ne.value=!0,or.value=null,await Promise.all([l.fetchPacketStats({hours:J.value}),l.fetchSystemStats()]),Ne.value=!1,fa()}catch(qo){or.value=qo instanceof Error?qo.message:"Failed to fetch data",Ne.value=!1}},fa=async()=>{_r.value={packetRate:!0,packetType:!0,noiseFloor:!1,routePie:!0};const qo=[Li(),yi(),ra(),Da()];try{await Promise.allSettled(qo),await Z0(),!ei.value||!jn.value?setTimeout(()=>{Va()},100):Va()}catch(fo){console.error("Error loading chart data:",fo)}},Li=async()=>{_r.value.packetRate=!0;try{const qo=await Xh.get("/metrics_graph_data",{hours:J.value,resolution:"average",metrics:"rx_count,tx_count"});qo?.success&&(kt.value=qo.data)}catch{kt.value=null}},yi=async()=>{_r.value.packetType=!0;try{const qo=await Xh.get("/packet_type_graph_data",{hours:J.value,resolution:"average",types:"all"});if(qo?.success&&qo.data){const fo=qo.data;Gt.value=fo.series||[]}}catch{Gt.value=[]}},ra=async()=>{_r.value.routePie=!0;try{const qo=await Xh.get("/route_stats",{hours:J.value});qo?.success&&qo.data&&(re.value=qo.data)}catch{re.value=null}},Da=async()=>{try{const qo=await Xh.get("/noise_floor_history",{hours:J.value});if(qo.success&&qo.data){const Ta=qo.data.history||[];Array.isArray(Ta)&&Ta.length>0&&(Dt.value={chart_data:Ta.map(Ea=>({timestamp:Ea.timestamp||Date.now()/1e3,noise_floor_dbm:Ea.noise_floor_dbm||Ea.noise_floor||-120}))},Ei())}}catch{Dt.value={chart_data:[]}}},Ni=()=>{ss(),Fr.value=!1,zr.value=!1,Wr.value=!1,ia()},Ei=()=>{if(pe.value=[],Dt.value?.chart_data&&Dt.value.chart_data.length>0){const qo=Dt.value.chart_data,fo=Math.max(1,Math.floor(qo.length/100));pe.value=qo.filter((Ta,Ea)=>Ea%fo===0).map(Ta=>({timestamp:Ta.timestamp*1e3,snr:null,rssi:null,noiseFloor:Ta.noise_floor_dbm}))}},Va=()=>{if(!j.value){j.value=!0;try{mo(),ko(),pl(),fu(),setTimeout(()=>{_r.value.packetRate&&An.value&&(_r.value.packetRate=!1),_r.value.packetType&&Ft.value&&(_r.value.packetType=!1),_r.value.routePie&&Qi.value&&(_r.value.routePie=!1),_r.value.routePie&&Qi.value&&(_r.value.routePie=!1),setTimeout(()=>{const qo=ju(An.value),fo=ju(Ft.value),Ta=ju(kn.value);qo&&qo.update("none"),fo&&fo.update("none"),Ta&&Ta.update("none")},50)},100)}catch(qo){console.error("Error creating/updating charts:",qo),ss()}finally{j.value=!1}}},ss=()=>{try{An.value&&(An.value.destroy(),An.value=null),Ft.value&&(Ft.value.destroy(),Ft.value=null),kn.value&&(kn.value.destroy(),kn.value=null),Qi.value&&l1.purge(Qi.value)}catch(qo){console.error("Error destroying charts:",qo)}},mo=()=>{if(!ei.value){_r.value.packetRate=!1;return}const qo=ei.value.getContext("2d");if(!qo){_r.value.packetRate=!1;return}let fo=[],Ta=[];if(kt.value?.series){const Ea=kt.value.series.find(Ao=>Ao.type==="rx_count"),go=kt.value.series.find(Ao=>Ao.type==="tx_count");Ea?.data&&(fo=Ea.data.map(([Ao,Ps])=>{let $o=Ao;return Ao>1e15?$o=Ao/1e3:Ao>1e12?$o=Ao:Ao>1e9?$o=Ao*1e3:$o=Date.now(),{x:$o,y:Ps}})),go?.data&&(Ta=go.data.map(([Ao,Ps])=>{let $o=Ao;return Ao>1e15?$o=Ao/1e3:Ao>1e12?$o=Ao:Ao>1e9?$o=Ao*1e3:$o=Date.now(),{x:$o,y:Ps}}))}if(fo.length===0&&Ta.length===0){Fr.value=!0,_r.value.packetRate=!1;return}Fr.value=!1,An.value&&(An.value.destroy(),An.value=null);try{const Ea=JSON.parse(JSON.stringify(fo)),go=JSON.parse(JSON.stringify(Ta)),Ao=new d2(qo,{type:"line",data:{datasets:[{label:"RX/hr",data:Ea,borderColor:"#C084FC",backgroundColor:"rgba(192, 132, 252, 0.1)",borderWidth:2,fill:!0,tension:.4},{label:"TX/hr",data:go,borderColor:"#F59E0B",backgroundColor:"rgba(245, 158, 11, 0.1)",borderWidth:2,fill:!0,tension:.4}]},options:{responsive:!0,maintainAspectRatio:!1,animation:{duration:0},plugins:{legend:{display:!1},title:{display:!1}},scales:{x:{type:"time",time:{unit:"hour",displayFormats:{hour:"HH:mm"}},grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"rgba(255, 255, 255, 0.7)",maxTicksLimit:8}},y:{beginAtZero:!1,grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"rgba(255, 255, 255, 0.7)",callback:function(Ps){return typeof Ps=="number"?Ps.toFixed(3):Ps},stepSize:.002},min:0,max:.012}}}});An.value=ju(Ao),_r.value.packetRate=!1,setTimeout(()=>{_r.value.packetRate&&(_r.value.packetRate=!1)},50)}catch(Ea){console.error("Error creating packet rate chart:",Ea),Fr.value=!0,_r.value.packetRate=!1}},ko=()=>{if(!jn.value){_r.value.packetType=!1;return}const qo=jn.value.getContext("2d");if(!qo){_r.value.packetType=!1;return}const fo=[],Ta=[],Ea=["#60A5FA","#34D399","#FBBF24","#A78BFA","#F87171","#06B6D4","#84CC16","#F472B6","#10B981"];if(Gt.value.length>0)Gt.value.forEach(go=>{const Ao=go.data?go.data.reduce((Ps,$o)=>Ps+$o[1],0):0;Ao>0&&(fo.push(go.name.replace(/\([^)]*\)/g,"").trim()),Ta.push(Ao))});else{zr.value=!0,_r.value.packetType=!1;return}zr.value=!1,Ft.value&&(Ft.value.destroy(),Ft.value=null);try{const go=JSON.parse(JSON.stringify(fo)),Ao=JSON.parse(JSON.stringify(Ta)),Ps=new d2(qo,{type:"bar",data:{labels:go,datasets:[{data:Ao,backgroundColor:Ea.slice(0,Ao.length),borderRadius:8,borderSkipped:!1}]},options:{responsive:!0,maintainAspectRatio:!1,animation:{duration:0},plugins:{legend:{display:!1}},scales:{x:{grid:{display:!1},ticks:{color:"rgba(255, 255, 255, 0.7)",font:{size:10}}},y:{beginAtZero:!0,grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"rgba(255, 255, 255, 0.7)"}}}}});Ft.value=ju(Ps),_r.value.packetType=!1,setTimeout(()=>{_r.value.packetType&&(_r.value.packetType=!1)},50)}catch(go){console.error("Error creating packet type chart:",go),zr.value=!0,_r.value.packetType=!1}},pl=()=>{if(!ai.value)return;const qo=ai.value.getContext("2d");if(!qo)return;const fo=pe.value.map(go=>({x:go.timestamp,y:go.noiseFloor})).filter(go=>go.y!==null&&go.y!==void 0);if(kn.value)try{const go=ju(kn.value),Ao=JSON.parse(JSON.stringify(fo));go.data.datasets[0]&&(go.data.datasets[0].data=Ao),go.update("active");return}catch{kn.value.destroy(),kn.value=null}const Ta=JSON.parse(JSON.stringify(fo)),Ea=new d2(qo,{type:"line",data:{datasets:[{label:"Noise Floor (dBm)",data:Ta,borderColor:"#F59E0B",backgroundColor:"rgba(245, 158, 11, 0.1)",borderWidth:2,tension:.3,pointRadius:0,pointHoverRadius:3,fill:!1}]},options:{responsive:!0,maintainAspectRatio:!1,animation:{duration:0},interaction:{mode:"index",intersect:!1},plugins:{legend:{display:!0,position:"top",labels:{color:"rgba(255, 255, 255, 0.8)",usePointStyle:!0,padding:20}}},scales:{x:{type:"time",time:{unit:"hour",displayFormats:{hour:"HH:mm"}},grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"rgba(255, 255, 255, 0.7)",maxTicksLimit:8}},y:{type:"linear",display:!0,title:{display:!0,text:"Noise Floor (dBm)",color:"rgba(255, 255, 255, 0.8)"},grid:{color:"rgba(245, 158, 11, 0.2)"},ticks:{color:"#F59E0B",stepSize:.5,callback:function(go){return typeof go=="number"?go.toFixed(1):go}},min:-117,max:-113}}}});kn.value=ju(Ea)},fu=()=>{if(!Qi.value){_r.value.routePie=!1;return}if(!re.value||!re.value.route_totals){Wr.value=!0,_r.value.routePie=!1;return}Wr.value=!1;const qo=re.value.route_totals,fo=Object.keys(qo),Ta=Object.values(qo),Ea=["#3B82F6","#F87171","#10B981","#F59E0B","#A78BFA"];try{const go=JSON.parse(JSON.stringify(fo)),Ao=JSON.parse(JSON.stringify(Ta)),Ps=[{type:"pie",labels:go,values:Ao,marker:{colors:Ea.slice(0,Ao.length)},hovertemplate:"%{label}
Count: %{value}
Percentage: %{percent}",textinfo:"label+percent",textposition:"auto",pull:.1,hole:.3}],$o={title:{text:"",font:{color:"rgba(255, 255, 255, 0.8)"}},paper_bgcolor:"rgba(0,0,0,0)",plot_bgcolor:"rgba(0,0,0,0)",font:{color:"rgba(255, 255, 255, 0.8)",size:11},margin:{t:20,b:20,l:20,r:20},showlegend:!0,legend:{orientation:"h",x:0,y:-.2,font:{color:"rgba(255, 255, 255, 0.8)",size:10}}},gi={responsive:!0,displayModeBar:!1,staticPlot:!1};l1.newPlot(Qi.value,Ps,$o,gi),_r.value.routePie=!1,setTimeout(()=>{_r.value.routePie&&(_r.value.routePie=!1)},50)}catch(go){console.error("Error creating 3D route pie chart:",go),Wr.value=!0,_r.value.routePie=!1}};return t0(async()=>{await Z0(),ia(),z.value=window.setInterval(ia,3e4),window.addEventListener("resize",()=>{setTimeout(()=>{ju(An.value)?.resize(),ju(Ft.value)?.resize(),ju(kn.value)?.resize(),Qi.value&&l1.Plots&&l1.Plots.resize(Qi.value)},100)})}),dg(()=>{z.value&&clearInterval(z.value),An.value?.destroy(),Ft.value?.destroy(),kn.value?.destroy(),Qi.value&&l1.purge(Qi.value),window.removeEventListener("resize",()=>{})}),(qo,fo)=>(zi(),Vi("div",Rdt,[Re("div",Bdt,[fo[2]||(fo[2]=Re("h2",{class:"text-2xl font-bold text-white"},"Statistics",-1)),Re("div",Ndt,[fo[1]||(fo[1]=Re("label",{class:"text-white/70 text-sm"},"Time Range:",-1)),$p(Re("select",{"onUpdate:modelValue":fo[0]||(fo[0]=Ta=>J.value=Ta),onChange:Ni,class:"bg-white/10 border border-white/20 rounded-lg px-3 py-2 text-white text-sm focus:outline-none focus:border-accent-purple/50 transition-colors"},[(zi(),Vi(Ou,null,sf(mt,Ta=>Re("option",{key:Ta.value,value:Ta.value,class:"bg-gray-800 text-white"},aa(Ta.label),9,jdt)),64))],544),[[iA,J.value]])])]),Re("div",Udt,[gu(r_,{title:"Total RX",value:Gi.value.totalRx,color:"#AAE8E8",data:un.value.totalPackets},null,8,["value","data"]),gu(r_,{title:"Total TX",value:Gi.value.totalTx,color:"#FFC246",data:un.value.transmittedPackets},null,8,["value","data"])]),Re("div",Vdt,[fo[9]||(fo[9]=Re("h3",{class:"text-white text-xl font-semibold mb-4"},"Performance Metrics",-1)),Re("div",Hdt,[fo[5]||(fo[5]=Ff('

Packet Rate (RX/TX PER HOUR)

RX/hr
TX/hr
',2)),Re("div",Wdt,[Re("canvas",{ref_key:"packetRateCanvasRef",ref:ei,class:"w-full h-full relative z-10"},null,512),_r.value.packetRate?(zi(),Vi("div",qdt,fo[3]||(fo[3]=[Re("div",{class:"text-center"},[Re("div",{class:"animate-spin w-8 h-8 border-2 border-white/20 border-t-purple-400 rounded-full mx-auto mb-2"}),Re("div",{class:"text-white/50 text-xs"},"Loading packet rate data...")],-1)]))):bs("",!0),Fr.value&&!_r.value.packetRate?(zi(),Vi("div",Zdt,fo[4]||(fo[4]=[Re("div",{class:"text-center"},[Re("div",{class:"text-red-400 text-sm mb-1"},"No Data Available"),Re("div",{class:"text-white/50 text-xs"},"Packet rate data not found")],-1)]))):bs("",!0)])]),Re("div",$dt,[fo[8]||(fo[8]=Re("p",{class:"text-white/70 text-sm uppercase tracking-wide mb-2"},"Packet Type Distribution",-1)),Re("div",Gdt,[Re("canvas",{ref_key:"packetTypeCanvasRef",ref:jn,class:"w-full h-full relative z-10"},null,512),_r.value.packetType?(zi(),Vi("div",Ydt,fo[6]||(fo[6]=[Re("div",{class:"text-center"},[Re("div",{class:"animate-spin w-8 h-8 border-2 border-white/20 border-t-blue-400 rounded-full mx-auto mb-2"}),Re("div",{class:"text-white/50 text-xs"},"Loading packet type data...")],-1)]))):bs("",!0),zr.value&&!_r.value.packetType?(zi(),Vi("div",Kdt,fo[7]||(fo[7]=[Re("div",{class:"text-center"},[Re("div",{class:"text-red-400 text-sm mb-1"},"No Data Available"),Re("div",{class:"text-white/50 text-xs"},"Packet type data not found")],-1)]))):bs("",!0)])])]),Re("div",Xdt,[fo[13]||(fo[13]=Re("h3",{class:"text-white text-xl font-semibold mb-4"},"Noise Floor Over Time",-1)),Re("div",Jdt,[Re("div",Qdt,[Re("div",tpt,[Re("canvas",{ref_key:"signalMetricsCanvasRef",ref:ai,class:"w-full h-full"},null,512)])]),Re("div",ept,[fo[12]||(fo[12]=Re("p",{class:"text-white/70 text-sm uppercase tracking-wide mb-2"},"Route Distribution",-1)),Re("div",rpt,[Re("div",{ref_key:"signalPie3DRef",ref:Qi,class:"w-full h-full relative z-10"},null,512),_r.value.routePie?(zi(),Vi("div",npt,fo[10]||(fo[10]=[Re("div",{class:"text-center"},[Re("div",{class:"animate-spin w-8 h-8 border-2 border-white/20 border-t-green-400 rounded-full mx-auto mb-2"}),Re("div",{class:"text-white/50 text-xs"},"Loading route data...")],-1)]))):bs("",!0),Wr.value&&!_r.value.routePie?(zi(),Vi("div",ipt,fo[11]||(fo[11]=[Re("div",{class:"text-center"},[Re("div",{class:"text-red-400 text-sm mb-1"},"No Data Available"),Re("div",{class:"text-white/50 text-xs"},"Route statistics not found")],-1)]))):bs("",!0)])])])]),Ne.value?(zi(),Vi("div",apt,fo[14]||(fo[14]=[Re("div",{class:"text-white/70 mb-2"},"Loading statistics...",-1),Re("div",{class:"animate-spin w-8 h-8 border-2 border-white/20 border-t-white/70 rounded-full mx-auto"},null,-1)]))):bs("",!0),or.value?(zi(),Vi("div",opt,[fo[15]||(fo[15]=Re("div",{class:"text-red-400 mb-2"},"Failed to load statistics",-1)),Re("p",spt,aa(or.value),1),Re("button",{onClick:ia,class:"mt-4 px-4 py-2 bg-accent-purple/20 hover:bg-accent-purple/30 text-white rounded-lg border border-accent-purple/50 transition-colors"}," Retry ")])):bs("",!0)]))}}),upt=ld(lpt,[["__scopeId","data-v-9766a4d1"]]),cpt={class:"space-y-4"},hpt={class:"bg-white/5 rounded-lg p-4 space-y-3"},fpt={class:"flex justify-between items-center py-2 border-b border-white/10"},dpt={class:"text-white font-mono"},ppt={class:"flex justify-between items-center py-2 border-b border-white/10"},mpt={class:"text-white font-mono"},gpt={class:"flex justify-between items-center py-2 border-b border-white/10"},vpt={class:"text-white font-mono"},ypt={class:"flex justify-between items-center py-2 border-b border-white/10"},xpt={class:"text-white font-mono"},_pt={class:"flex justify-between items-center py-2 border-b border-white/10"},bpt={class:"text-white font-mono"},wpt={class:"flex justify-between items-center py-2"},kpt={class:"text-white font-mono"},Tpt=Th({__name:"RadioSettings",setup(d){const l=sv(),z=Yo(()=>l.stats?.config?.radio||{}),j=Yo(()=>{const re=z.value.frequency;return re?(re/1e6).toFixed(3)+" MHz":"Not set"}),J=Yo(()=>{const re=z.value.bandwidth;return re?(re/1e3).toFixed(1)+" kHz":"Not set"}),mt=Yo(()=>{const re=z.value.tx_power;return re!==void 0?re+" dBm":"Not set"}),kt=Yo(()=>{const re=z.value.coding_rate;return re?"4/"+re:"Not set"}),Dt=Yo(()=>{const re=z.value.preamble_length;return re?re+" symbols":"Not set"}),Gt=Yo(()=>z.value.spreading_factor??"Not set");return(re,pe)=>(zi(),Vi("div",cpt,[Re("div",hpt,[Re("div",fpt,[pe[0]||(pe[0]=Re("span",{class:"text-white/70 text-sm"},"Frequency",-1)),Re("span",dpt,aa(j.value),1)]),Re("div",ppt,[pe[1]||(pe[1]=Re("span",{class:"text-white/70 text-sm"},"Spreading Factor",-1)),Re("span",mpt,aa(Gt.value),1)]),Re("div",gpt,[pe[2]||(pe[2]=Re("span",{class:"text-white/70 text-sm"},"Bandwidth",-1)),Re("span",vpt,aa(J.value),1)]),Re("div",ypt,[pe[3]||(pe[3]=Re("span",{class:"text-white/70 text-sm"},"TX Power",-1)),Re("span",xpt,aa(mt.value),1)]),Re("div",_pt,[pe[4]||(pe[4]=Re("span",{class:"text-white/70 text-sm"},"Coding Rate",-1)),Re("span",bpt,aa(kt.value),1)]),Re("div",wpt,[pe[5]||(pe[5]=Re("span",{class:"text-white/70 text-sm"},"Preamble Length",-1)),Re("span",kpt,aa(Dt.value),1)])])]))}}),Apt={class:"space-y-4"},Mpt={class:"bg-white/5 rounded-lg p-4 space-y-3"},Spt={class:"flex justify-between items-center py-2 border-b border-white/10"},Ept={class:"text-white font-mono"},Cpt={class:"flex justify-between items-center py-2 border-b border-white/10"},Lpt={class:"text-white font-mono text-xs"},Ppt={class:"flex justify-between items-start py-2 border-b border-white/10"},zpt={class:"text-white font-mono text-xs text-right break-all max-w-xs"},Ipt={class:"flex justify-between items-center py-2 border-b border-white/10"},Opt={class:"text-white font-mono"},Dpt={class:"flex justify-between items-center py-2 border-b border-white/10"},Fpt={class:"text-white font-mono"},Rpt={class:"flex justify-between items-center py-2 border-b border-white/10"},Bpt={class:"text-white font-mono"},Npt={class:"flex justify-between items-start py-2"},jpt={class:"text-white font-mono ml-4"},Upt=Th({__name:"RepeaterSettings",setup(d){const l=sv(),z=Yo(()=>l.stats?.config||{}),j=Yo(()=>z.value.repeater||{}),J=Yo(()=>l.stats),mt=Yo(()=>z.value.node_name||"Not set"),kt=Yo(()=>J.value?.local_hash||"Not available"),Dt=Yo(()=>{const or=J.value?.public_key;return!or||or==="Not set"?"Not set":or}),Gt=Yo(()=>{const or=j.value.latitude;return or&&or!==0?or.toFixed(6):"Not set"}),re=Yo(()=>{const or=j.value.longitude;return or&&or!==0?or.toFixed(6):"Not set"}),pe=Yo(()=>{const or=j.value.mode;return or?or.charAt(0).toUpperCase()+or.slice(1):"Not set"}),Ne=Yo(()=>{const or=j.value.send_advert_interval_hours;return or===void 0?"Not set":or===0?"Disabled":or+" hour"+(or!==1?"s":"")});return(or,_r)=>(zi(),Vi("div",Apt,[Re("div",Mpt,[Re("div",Spt,[_r[0]||(_r[0]=Re("span",{class:"text-white/70 text-sm"},"Node Name",-1)),Re("span",Ept,aa(mt.value),1)]),Re("div",Cpt,[_r[1]||(_r[1]=Re("span",{class:"text-white/70 text-sm"},"Local Hash",-1)),Re("span",Lpt,aa(kt.value),1)]),Re("div",Ppt,[_r[2]||(_r[2]=Re("span",{class:"text-white/70 text-sm"},"Public Key",-1)),Re("span",zpt,aa(Dt.value),1)]),Re("div",Ipt,[_r[3]||(_r[3]=Re("span",{class:"text-white/70 text-sm"},"Latitude",-1)),Re("span",Opt,aa(Gt.value),1)]),Re("div",Dpt,[_r[4]||(_r[4]=Re("span",{class:"text-white/70 text-sm"},"Longitude",-1)),Re("span",Fpt,aa(re.value),1)]),Re("div",Rpt,[_r[5]||(_r[5]=Re("span",{class:"text-white/70 text-sm"},"Mode",-1)),Re("span",Bpt,aa(pe.value),1)]),Re("div",Npt,[_r[6]||(_r[6]=Re("div",{class:"flex flex-col"},[Re("span",{class:"text-white/70 text-sm"},"Periodic Advertisement Interval"),Re("span",{class:"text-white/50 text-xs mt-1"},"How often the repeater sends an advertisement packet (0 = disabled)")],-1)),Re("span",jpt,aa(Ne.value),1)])])]))}}),Vpt={class:"space-y-4"},Hpt={class:"bg-white/5 rounded-lg p-4 space-y-3"},Wpt={class:"flex justify-between items-center py-2 border-b border-white/10"},qpt={class:"text-white font-mono"},Zpt={class:"flex justify-between items-center py-2"},$pt={class:"text-white font-mono"},Gpt=Th({__name:"DutyCycle",setup(d){const l=sv(),z=Yo(()=>l.stats?.config?.duty_cycle||{}),j=Yo(()=>{const mt=z.value.max_airtime_percent;return typeof mt=="number"?mt.toFixed(1)+"%":mt&&typeof mt=="object"&&"parsedValue"in mt?(mt.parsedValue||0).toFixed(1)+"%":"Not set"}),J=Yo(()=>z.value.enforcement_enabled?"Enabled":"Disabled");return(mt,kt)=>(zi(),Vi("div",Vpt,[Re("div",Hpt,[Re("div",Wpt,[kt[0]||(kt[0]=Re("span",{class:"text-white/70 text-sm"},"Max Airtime %",-1)),Re("span",qpt,aa(j.value),1)]),Re("div",Zpt,[kt[1]||(kt[1]=Re("span",{class:"text-white/70 text-sm"},"Enforcement",-1)),Re("span",$pt,aa(J.value),1)])])]))}}),Ypt={class:"space-y-4"},Kpt={class:"bg-white/5 rounded-lg p-4 space-y-3"},Xpt={class:"flex justify-between items-start py-2 border-b border-white/10"},Jpt={class:"text-white font-mono ml-4"},Qpt={class:"flex justify-between items-start py-2"},t0t={class:"text-white font-mono ml-4"},e0t=Th({__name:"TransmissionDelays",setup(d){const l=sv(),z=Yo(()=>l.stats?.config?.delays||{}),j=Yo(()=>{const mt=z.value.tx_delay_factor;if(mt&&typeof mt=="object"&&mt!==null&&"parsedValue"in mt){const kt=mt.parsedValue;if(typeof kt=="number")return kt.toFixed(2)+"x"}return"Not set"}),J=Yo(()=>{const mt=z.value.direct_tx_delay_factor;return typeof mt=="number"?mt.toFixed(2)+"s":"Not set"});return(mt,kt)=>(zi(),Vi("div",Ypt,[Re("div",Kpt,[Re("div",Xpt,[kt[0]||(kt[0]=Re("div",{class:"flex flex-col"},[Re("span",{class:"text-white/70 text-sm"},"Flood TX Delay Factor"),Re("span",{class:"text-white/50 text-xs mt-1"},"Multiplier for flood packet transmission delays (collision avoidance)")],-1)),Re("span",Jpt,aa(j.value),1)]),Re("div",Qpt,[kt[1]||(kt[1]=Re("div",{class:"flex flex-col"},[Re("span",{class:"text-white/70 text-sm"},"Direct TX Delay Factor"),Re("span",{class:"text-white/50 text-xs mt-1"},"Base delay for direct-routed packet transmission (seconds)")],-1)),Re("span",t0t,aa(J.value),1)])])]))}}),WD=GA("treeState",()=>{const d=ky(new Set),l=ky({value:null}),z=Dt=>{d.add(Dt)},j=Dt=>{d.delete(Dt)};return{expandedNodes:d,selectedNodeId:l,addExpandedNode:z,removeExpandedNode:j,isNodeExpanded:Dt=>d.has(Dt),setSelectedNode:Dt=>{l.value=Dt},toggleExpanded:Dt=>{d.has(Dt)?j(Dt):z(Dt)}}}),r0t={class:"select-none"},n0t={class:"flex-shrink-0"},i0t={key:0,class:"w-4 h-4 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},a0t={key:1,class:"w-4 h-4 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},o0t={key:0,class:"flex items-center gap-1 ml-2"},s0t={class:"relative group"},l0t=["title"],u0t={key:0,class:"text-xs font-mono text-white/50 bg-white/5 px-1.5 py-0.5 rounded border border-white/10"},c0t={class:"flex justify-between items-start mb-4"},h0t={class:"bg-black/20 border border-white/10 rounded-md p-4 mb-4"},f0t={class:"text-sm font-mono text-white/80 break-all leading-relaxed"},d0t={class:"flex items-center gap-2 ml-auto"},p0t={key:0,class:"flex items-center gap-1"},m0t=["title"],g0t={key:1,class:"flex items-center gap-1"},v0t={key:2,class:"px-2 py-1 bg-white/10 text-white/60 text-xs rounded-full ml-1"},y0t={key:0,class:"space-y-1"},x0t=Th({__name:"TreeNode",props:{node:{},selectedNodeId:{},level:{},disabled:{type:Boolean}},emits:["select"],setup(d,{emit:l}){const z=d,j=l,J=WD(),mt=lo(!1),kt=Yo({get:()=>J.isNodeExpanded(z.node.id),set:zr=>{zr?J.addExpandedNode(z.node.id):J.removeExpandedNode(z.node.id)}}),Dt=Yo(()=>z.node.children.length>0);function Gt(zr){if(!zr)return"Never";const An=new Date().getTime()-zr.getTime(),Ft=Math.floor(An/(1e3*60)),kn=Math.floor(An/(1e3*60*60)),ei=Math.floor(An/(1e3*60*60*24)),jn=Math.floor(ei/365);return Ft<60?`${Ft}m ago`:kn<24?`${kn}h ago`:ei<365?`${ei}d ago`:`${jn}y ago`}function re(zr){return zr?zr.length<=16?zr:`${zr.slice(0,8)}...${zr.slice(-8)}`:"No key"}function pe(){if(Dt.value){const zr=!kt.value;kt.value=zr}}function Ne(){j("select",z.node.id)}function or(zr){j("select",zr)}function _r(zr){zr.stopPropagation(),mt.value=!mt.value}function Fr(zr){zr.stopPropagation(),z.node.transport_key&&window.navigator?.clipboard&&window.navigator.clipboard.writeText(z.node.transport_key)}return(zr,Wr)=>{const An=UA("TreeNode",!0);return zi(),Vi("div",r0t,[Re("div",{class:Xs(["flex items-center gap-2 py-2 px-3 rounded-lg cursor-pointer transition-all duration-200",z.disabled?"opacity-50 cursor-not-allowed":"hover:bg-white/5",zr.selectedNodeId===zr.node.id&&!z.disabled?"bg-primary/20 text-primary":"text-white/80 hover:text-white",`ml-${zr.level*4}`]),onClick:Wr[3]||(Wr[3]=Ft=>!z.disabled&&Ne())},[Re("div",{class:"flex-shrink-0 w-4 h-4 flex items-center justify-center",onClick:hg(pe,["stop"])},[Dt.value?(zi(),Vi("svg",{key:0,class:Xs(["w-3 h-3 transition-transform duration-200",kt.value?"rotate-90":"rotate-0"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Wr[4]||(Wr[4]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)]),2)):bs("",!0)]),Re("div",n0t,[z.node.name.startsWith("#")?(zi(),Vi("svg",i0t,Wr[5]||(Wr[5]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"},null,-1)]))):(zi(),Vi("svg",a0t,Wr[6]||(Wr[6]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"},null,-1)])))]),Re("span",{class:Xs(["font-mono text-sm transition-colors duration-200",zr.selectedNodeId===zr.node.id?"text-primary font-medium":""])},aa(zr.node.name),3),zr.node.transport_key?(zi(),Vi("div",o0t,[Re("div",s0t,[Re("button",{onClick:_r,class:"p-1 rounded hover:bg-white/10 transition-colors",title:mt.value?"Hide full key":"Show full key"},Wr[7]||(Wr[7]=[Re("svg",{class:"w-3 h-3 text-white/60 hover:text-white/80",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})],-1)]),8,l0t),mt.value?bs("",!0):(zi(),Vi("span",u0t,aa(re(zr.node.transport_key)),1)),mt.value?(zi(),Vi("div",{key:1,class:"fixed inset-0 z-[9998] flex items-center justify-center bg-black/70 backdrop-blur-md",onClick:Wr[2]||(Wr[2]=Ft=>mt.value=!1)},[Re("div",{class:"bg-black/20 border border-white/20 rounded-lg shadow-lg p-6 max-w-2xl w-full mx-4",onClick:Wr[1]||(Wr[1]=hg(()=>{},["stop"]))},[Re("div",c0t,[Wr[9]||(Wr[9]=Re("h3",{class:"text-lg font-semibold text-white"},"Transport Key",-1)),Re("button",{onClick:Wr[0]||(Wr[0]=Ft=>mt.value=!1),class:"text-white/60 hover:text-white transition-colors"},Wr[8]||(Wr[8]=[Re("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),Re("div",h0t,[Re("div",f0t,aa(zr.node.transport_key),1)]),Re("div",{class:"flex justify-end"},[Re("button",{onClick:Fr,class:"px-4 py-2 bg-accent-green/20 hover:bg-accent-green/30 border border-accent-green/50 text-accent-green rounded-lg transition-colors flex items-center gap-2",title:"Copy to clipboard"},Wr[10]||(Wr[10]=[Re("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})],-1),nc(" Copy Key ",-1)]))])])])):bs("",!0)])])):bs("",!0),Re("div",d0t,[zr.node.last_used?(zi(),Vi("div",p0t,[Wr[11]||(Wr[11]=Re("svg",{class:"w-3 h-3 text-white/40",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),Re("span",{class:"text-xs text-white/50",title:zr.node.last_used.toLocaleString()},aa(Gt(zr.node.last_used)),9,m0t)])):(zi(),Vi("div",g0t,Wr[12]||(Wr[12]=[Re("svg",{class:"w-3 h-3 text-white/30",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})],-1),Re("span",{class:"text-xs text-white/30 italic"},"Never",-1)]))),Re("span",{class:Xs(["px-2 py-0.5 text-xs font-medium rounded-md transition-colors",zr.node.floodPolicy==="allow"?"bg-accent-green/10 text-accent-green/90 border border-accent-green/20":"bg-accent-red/10 text-accent-red/90 border border-accent-red/20"])},aa(zr.node.floodPolicy==="allow"?"FLOOD ALLOW":"FLOOD DENY"),3),Dt.value?(zi(),Vi("span",v0t,aa(zr.node.children.length),1)):bs("",!0)])],2),gu(LI,{"enter-active-class":"transition-all duration-300 ease-out","enter-from-class":"opacity-0 max-h-0 overflow-hidden","enter-to-class":"opacity-100 max-h-screen overflow-visible","leave-active-class":"transition-all duration-300 ease-in","leave-from-class":"opacity-100 max-h-screen overflow-visible","leave-to-class":"opacity-0 max-h-0 overflow-hidden"},{default:Y2(()=>[kt.value&&zr.node.children.length>0?(zi(),Vi("div",y0t,[(zi(!0),Vi(Ou,null,sf(zr.node.children,Ft=>(zi(),hm(An,{key:Ft.id,node:Ft,"selected-node-id":zr.selectedNodeId,level:zr.level+1,disabled:z.disabled,onSelect:or},null,8,["node","selected-node-id","level","disabled"]))),128))])):bs("",!0)]),_:1})])}}}),_0t=ld(x0t,[["__scopeId","data-v-4afde13e"]]),b0t={class:"flex items-center justify-between mb-6"},w0t={class:"text-white/60 text-sm mt-1"},k0t={key:0},T0t={class:"text-primary font-mono"},A0t={key:1},M0t={for:"keyName",class:"block text-sm font-medium text-white mb-2"},S0t={class:"flex items-center gap-2"},E0t={key:0,class:"w-4 h-4 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},C0t={key:1,class:"w-4 h-4 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},L0t={class:"bg-white/5 border border-white/10 rounded-lg p-4"},P0t={class:"flex items-center gap-3 mb-2"},z0t={class:"flex items-center gap-2"},I0t={key:0,class:"w-5 h-5 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},O0t={key:1,class:"w-5 h-5 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},D0t={class:"text-white/70 text-sm"},F0t={class:"grid grid-cols-2 gap-3"},R0t={class:"relative cursor-pointer group"},B0t={class:"relative cursor-pointer group"},N0t={class:"flex gap-3 pt-4"},j0t=["disabled"],U0t=Th({__name:"AddKeyModal",props:{show:{type:Boolean},selectedNodeName:{},selectedNodeId:{}},emits:["close","add"],setup(d,{emit:l}){const z=d,j=l,J=lo(""),mt=lo(""),kt=lo("allow"),Dt=Yo(()=>J.value.startsWith("#")),Gt=Yo(()=>({type:Dt.value?"Region":"Private Key",description:Dt.value?"Regional organizational key":"Individual assigned key"}));um(Dt,_r=>{_r?mt.value="This will create a new region for organizing keys":mt.value="This will create a new private key entry"},{immediate:!0});const re=Yo(()=>J.value.trim().length>0),pe=()=>{re.value&&(j("add",{name:J.value.trim(),floodPolicy:kt.value,parentId:z.selectedNodeId}),J.value="",mt.value="",kt.value="allow")},Ne=()=>{J.value="",mt.value="",kt.value="allow",j("close")},or=_r=>{_r.target===_r.currentTarget&&Ne()};return(_r,Fr)=>_r.show?(zi(),Vi("div",{key:0,onClick:or,class:"fixed inset-0 bg-black/40 backdrop-blur-lg z-[99999] flex items-center justify-center p-4",style:{"backdrop-filter":"blur(8px) saturate(180%)",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"}},[Re("div",{class:"glass-card rounded-[20px] p-6 w-full max-w-md border border-white/10",onClick:Fr[3]||(Fr[3]=hg(()=>{},["stop"]))},[Re("div",b0t,[Re("div",null,[Fr[5]||(Fr[5]=Re("h3",{class:"text-xl font-semibold text-white"},"Add New Entry",-1)),Re("p",w0t,[z.selectedNodeName?(zi(),Vi("span",k0t,[Fr[4]||(Fr[4]=nc(" Add to: ",-1)),Re("span",T0t,aa(z.selectedNodeName),1)])):(zi(),Vi("span",A0t," Add to root level (#uk) "))])]),Re("button",{onClick:Ne,class:"text-white/60 hover:text-white transition-colors"},Fr[6]||(Fr[6]=[Re("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),Re("form",{onSubmit:hg(pe,["prevent"]),class:"space-y-4"},[Re("div",null,[Re("label",M0t,[Re("div",S0t,[Dt.value?(zi(),Vi("svg",E0t,Fr[7]||(Fr[7]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"},null,-1)]))):(zi(),Vi("svg",C0t,Fr[8]||(Fr[8]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"},null,-1)]))),Fr[9]||(Fr[9]=nc(" Region/Key Name ",-1))])]),$p(Re("input",{id:"keyName","onUpdate:modelValue":Fr[0]||(Fr[0]=zr=>J.value=zr),type:"text",placeholder:"Enter name (prefix with # for regions)",class:"w-full px-4 py-3 bg-white/5 border border-white/20 rounded-lg text-white placeholder-white/50 focus:outline-none focus:border-primary focus:ring-2 focus:ring-primary/20 transition-colors",autocomplete:"off"},null,512),[[$A,J.value]])]),Re("div",L0t,[Re("div",P0t,[Re("div",z0t,[Dt.value?(zi(),Vi("svg",I0t,Fr[10]||(Fr[10]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"},null,-1)]))):(zi(),Vi("svg",O0t,Fr[11]||(Fr[11]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1221 9z"},null,-1)]))),Re("span",{class:Xs([Dt.value?"text-secondary":"text-accent-green","font-medium"])},aa(Gt.value.type),3)]),Re("div",{class:Xs(["flex-1 h-px",Dt.value?"bg-secondary/20":"bg-accent-green/20"])},null,2)]),Re("p",D0t,aa(Gt.value.description),1)]),Re("div",null,[Fr[14]||(Fr[14]=Re("label",{class:"block text-sm font-medium text-white mb-3"},[Re("div",{class:"flex items-center gap-2"},[Re("svg",{class:"w-4 h-4 text-primary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})]),nc(" Flood Policy ")])],-1)),Re("div",F0t,[Re("label",R0t,[$p(Re("input",{type:"radio","onUpdate:modelValue":Fr[1]||(Fr[1]=zr=>kt.value=zr),value:"allow",class:"sr-only"},null,512),[[F2,kt.value]]),Fr[12]||(Fr[12]=Ff('
Allow

Permit flooding

',1))]),Re("label",B0t,[$p(Re("input",{type:"radio","onUpdate:modelValue":Fr[2]||(Fr[2]=zr=>kt.value=zr),value:"deny",class:"sr-only"},null,512),[[F2,kt.value]]),Fr[13]||(Fr[13]=Ff('
Deny

Block flooding

',1))])])]),Re("div",N0t,[Re("button",{type:"button",onClick:Ne,class:"flex-1 px-4 py-3 bg-white/5 hover:bg-white/10 border border-white/20 text-white rounded-lg transition-colors"}," Cancel "),Re("button",{type:"submit",disabled:!re.value,class:Xs(["flex-1 px-4 py-3 rounded-lg transition-colors font-medium",re.value?"bg-accent-green/20 hover:bg-accent-green/30 border border-accent-green/50 text-accent-green":"bg-white/5 border border-white/20 text-white/40 cursor-not-allowed"])}," Add "+aa(Gt.value.type),11,j0t)])],32)])])):bs("",!0)}}),V0t={class:"flex bg-black items-center justify-between mb-6"},H0t={class:"text-white/60 text-sm mt-1"},W0t={class:"text-primary font-mono"},q0t={for:"keyName",class:"block text-sm font-medium text-white mb-2"},Z0t={class:"flex items-center gap-2"},$0t={key:0,class:"w-4 h-4 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},G0t={key:1,class:"w-4 h-4 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Y0t={class:"bg-white/5 border border-white/10 rounded-lg p-4"},K0t={class:"flex items-center gap-3 mb-2"},X0t={class:"flex items-center gap-2"},J0t={key:0,class:"w-5 h-5 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Q0t={key:1,class:"w-5 h-5 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},tmt={class:"text-white/70 text-sm"},emt={key:0,class:"space-y-4"},rmt={key:0,class:"bg-white/5 border border-white/10 rounded-lg p-4"},nmt={class:"bg-black/20 border border-white/10 rounded-md p-3"},imt={class:"text-xs font-mono text-white/80 break-all"},amt={key:1,class:"bg-white/5 border border-white/10 rounded-lg p-4"},omt={class:"flex items-center justify-between"},smt={class:"text-sm text-white/70"},lmt={class:"text-xs text-white/50"},umt={class:"grid grid-cols-2 gap-3"},cmt={class:"relative cursor-pointer group"},hmt={class:"relative cursor-pointer group"},fmt={class:"flex gap-3 pt-4"},dmt=["disabled"],pmt=Th({__name:"EditKeyModal",props:{show:{type:Boolean},node:{}},emits:["close","save","request-delete"],setup(d,{emit:l}){const z=d,j=l,J=lo(""),mt=lo("allow"),kt=Yo(()=>J.value.startsWith("#")),Dt=Yo(()=>({type:kt.value?"Region":"Private Key",description:kt.value?"Regional organizational key":"Individual assigned key"}));um(()=>z.node,zr=>{zr?(J.value=zr.name,mt.value=zr.floodPolicy):(J.value="",mt.value="allow")},{immediate:!0});const Gt=Yo(()=>J.value.trim().length>0&&z.node),re=zr=>{const An=new Date().getTime()-zr.getTime(),Ft=Math.floor(An/(1e3*60)),kn=Math.floor(An/(1e3*60*60)),ei=Math.floor(An/(1e3*60*60*24)),jn=Math.floor(ei/365);return Ft<60?`${Ft}m ago`:kn<24?`${kn}h ago`:ei<365?`${ei}d ago`:`${jn}y ago`},pe=zr=>{window.navigator?.clipboard&&window.navigator.clipboard.writeText(zr)},Ne=()=>{!Gt.value||!z.node||(j("save",{id:z.node.id,name:J.value.trim(),floodPolicy:mt.value}),_r())},or=()=>{z.node&&(j("request-delete",z.node),_r())},_r=()=>{j("close")},Fr=zr=>{zr.target===zr.currentTarget&&_r()};return(zr,Wr)=>zr.show?(zi(),Vi("div",{key:0,onClick:Fr,class:"fixed inset-0 bg-black/50 backdrop-blur-lg z-[99999] flex items-center justify-center p-4",style:{"backdrop-filter":"blur(8px) saturate(180%)",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"}},[Re("div",{class:"glass-card rounded-[20px] p-6 w-full max-w-md border border-white/10",onClick:Wr[4]||(Wr[4]=hg(()=>{},["stop"]))},[Re("div",V0t,[Re("div",null,[Wr[6]||(Wr[6]=Re("h3",{class:"text-xl font-semibold text-white"},"Edit Entry",-1)),Re("p",H0t,[Wr[5]||(Wr[5]=nc(" Modify ",-1)),Re("span",W0t,aa(zr.node?.name),1)])]),Re("button",{onClick:_r,class:"text-white/60 hover:text-white transition-colors"},Wr[7]||(Wr[7]=[Re("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),Re("form",{onSubmit:hg(Ne,["prevent"]),class:"space-y-4"},[Re("div",null,[Re("label",q0t,[Re("div",Z0t,[kt.value?(zi(),Vi("svg",$0t,Wr[8]||(Wr[8]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"},null,-1)]))):(zi(),Vi("svg",G0t,Wr[9]||(Wr[9]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1721 9z"},null,-1)]))),Wr[10]||(Wr[10]=nc(" Region/Key Name ",-1))])]),$p(Re("input",{id:"keyName","onUpdate:modelValue":Wr[0]||(Wr[0]=An=>J.value=An),type:"text",placeholder:"Enter name (prefix with # for regions)",class:"w-full px-4 py-3 bg-white/5 border border-white/20 rounded-lg text-white placeholder-white/50 focus:outline-none focus:border-primary focus:ring-2 focus:ring-primary/20 transition-colors",autocomplete:"off"},null,512),[[$A,J.value]])]),Re("div",Y0t,[Re("div",K0t,[Re("div",X0t,[kt.value?(zi(),Vi("svg",J0t,Wr[11]||(Wr[11]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"},null,-1)]))):(zi(),Vi("svg",Q0t,Wr[12]||(Wr[12]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1721 9z"},null,-1)]))),Re("span",{class:Xs([kt.value?"text-secondary":"text-accent-green","font-medium"])},aa(Dt.value.type),3)]),Re("div",{class:Xs(["flex-1 h-px",kt.value?"bg-secondary/20":"bg-accent-green/20"])},null,2)]),Re("p",tmt,aa(Dt.value.description),1)]),zr.node?(zi(),Vi("div",emt,[zr.node.transport_key?(zi(),Vi("div",rmt,[Wr[14]||(Wr[14]=Ff('
Transport Key
',1)),Re("div",nmt,[Re("div",imt,aa(zr.node.transport_key),1),Re("button",{onClick:Wr[1]||(Wr[1]=An=>pe(zr.node.transport_key||"")),class:"mt-2 text-xs text-accent-green hover:text-accent-green/80 flex items-center gap-1",title:"Copy to clipboard"},Wr[13]||(Wr[13]=[Re("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})],-1),nc(" Copy Key ",-1)]))])])):bs("",!0),zr.node.last_used?(zi(),Vi("div",amt,[Wr[15]||(Wr[15]=Re("div",{class:"flex items-center gap-2 mb-3"},[Re("svg",{class:"w-4 h-4 text-primary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})]),Re("span",{class:"text-sm font-medium text-white"},"Last Used")],-1)),Re("div",omt,[Re("div",smt,aa(zr.node.last_used.toLocaleDateString())+" at "+aa(zr.node.last_used.toLocaleTimeString()),1),Re("div",lmt,aa(re(zr.node.last_used)),1)])])):bs("",!0)])):bs("",!0),Re("div",null,[Wr[18]||(Wr[18]=Re("label",{class:"block text-sm font-medium text-white mb-3"},[Re("div",{class:"flex items-center gap-2"},[Re("svg",{class:"w-4 h-4 text-primary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})]),nc(" Flood Policy ")])],-1)),Re("div",umt,[Re("label",cmt,[$p(Re("input",{type:"radio","onUpdate:modelValue":Wr[2]||(Wr[2]=An=>mt.value=An),value:"allow",class:"sr-only"},null,512),[[F2,mt.value]]),Wr[16]||(Wr[16]=Ff('
Allow

Permit flooding

',1))]),Re("label",hmt,[$p(Re("input",{type:"radio","onUpdate:modelValue":Wr[3]||(Wr[3]=An=>mt.value=An),value:"deny",class:"sr-only"},null,512),[[F2,mt.value]]),Wr[17]||(Wr[17]=Ff('
Deny

Block flooding

',1))])])]),Re("div",fmt,[Re("button",{type:"button",onClick:or,class:"px-4 py-3 bg-accent-red/20 hover:bg-accent-red/30 border border-accent-red/50 text-accent-red rounded-lg transition-colors"}," Delete "),Re("button",{type:"button",onClick:_r,class:"flex-1 px-4 py-3 bg-white/5 hover:bg-white/10 border border-white/20 text-white rounded-lg transition-colors"}," Cancel "),Re("button",{type:"submit",disabled:!Gt.value,class:Xs(["flex-1 px-4 py-3 rounded-lg transition-colors font-medium",Gt.value?"bg-accent-green/20 hover:bg-accent-green/30 border border-accent-green/50 text-accent-green":"bg-white/5 border border-white/20 text-white/40 cursor-not-allowed"])}," Save Changes ",10,dmt)])],32)])])):bs("",!0)}}),mmt={class:"flex items-center gap-3 mb-6"},gmt={class:"text-white/60 text-sm mt-1"},vmt={class:"text-accent-red font-mono"},ymt={key:0,class:"bg-accent-red/10 border border-accent-red/30 rounded-lg p-4 mb-6"},xmt={class:"flex items-start gap-3"},_mt={class:"flex-1"},bmt={class:"text-accent-red font-medium text-sm mb-2"},wmt={class:"space-y-1 max-h-32 overflow-y-auto"},kmt={key:0,class:"w-3 h-3 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Tmt={key:1,class:"w-3 h-3 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Amt={class:"font-mono"},Mmt={key:0,class:"text-white/60 text-xs"},Smt={key:1,class:"mb-6"},Emt={class:"mb-3"},Cmt={class:"relative"},Lmt={class:"space-y-2 max-h-40 overflow-y-auto border border-white/20 rounded-lg p-3 bg-white/5"},Pmt={key:0,class:"text-center py-4 text-white/60 text-sm"},zmt={class:"relative"},Imt=["value"],Omt={class:"flex items-center gap-2 flex-1"},Dmt={class:"text-white font-mono text-sm"},Fmt={key:0,class:"ml-auto px-2 py-0.5 bg-white/10 text-white/60 text-xs rounded-full"},Rmt={class:"flex gap-3"},Bmt=Th({__name:"DeleteConfirmModal",props:{show:{type:Boolean},node:{},allNodes:{}},emits:["close","delete-all","move-children"],setup(d,{emit:l}){const z=d,j=l,J=lo(null),mt=lo(""),kt=Fr=>{const zr=[],Wr=An=>{for(const Ft of An.children)zr.push(Ft),Wr(Ft)};return Wr(Fr),zr},Dt=Yo(()=>z.node?kt(z.node):[]),Gt=Yo(()=>{if(!z.node)return[];const Fr=new Set([z.node.id,...Dt.value.map(Wr=>Wr.id)]),zr=Wr=>{const An=[];for(const Ft of Wr)Ft.name.startsWith("#")&&!Fr.has(Ft.id)&&An.push(Ft),Ft.children.length>0&&An.push(...zr(Ft.children));return An};return zr(z.allNodes)}),re=Yo(()=>{if(!mt.value.trim())return Gt.value;const Fr=mt.value.toLowerCase();return Gt.value.filter(zr=>zr.name.toLowerCase().includes(Fr))}),pe=()=>{z.node&&(j("delete-all",z.node.id),or())},Ne=()=>{!z.node||!J.value||(j("move-children",{nodeId:z.node.id,targetParentId:J.value}),or())},or=()=>{J.value=null,mt.value="",j("close")},_r=Fr=>{Fr.target===Fr.currentTarget&&or()};return(Fr,zr)=>Fr.show&&Fr.node?(zi(),Vi("div",{key:0,onClick:_r,class:"fixed inset-0 bg-black/80 backdrop-blur-lg z-[99999] flex items-center justify-center p-4",style:{"backdrop-filter":"blur(8px) saturate(180%)",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"}},[Re("div",{class:"glass-card rounded-[20px] p-6 w-full max-w-lg border border-white/10",onClick:zr[2]||(zr[2]=hg(()=>{},["stop"]))},[Re("div",mmt,[zr[6]||(zr[6]=Re("svg",{class:"w-6 h-6 text-accent-red",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"})],-1)),Re("div",null,[zr[4]||(zr[4]=Re("h3",{class:"text-xl font-semibold text-white"},"Confirm Deletion",-1)),Re("p",gmt,[zr[3]||(zr[3]=nc(" Deleting ",-1)),Re("span",vmt,aa(Fr.node?.name),1)])]),Re("button",{onClick:or,class:"ml-auto text-white/60 hover:text-white transition-colors"},zr[5]||(zr[5]=[Re("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),Dt.value.length>0?(zi(),Vi("div",ymt,[Re("div",xmt,[zr[9]||(zr[9]=Re("svg",{class:"w-5 h-5 text-accent-red flex-shrink-0 mt-0.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),Re("div",_mt,[Re("h4",bmt," This will affect "+aa(Dt.value.length)+" child "+aa(Dt.value.length===1?"entry":"entries")+": ",1),Re("div",wmt,[(zi(!0),Vi(Ou,null,sf(Dt.value.slice(0,10),Wr=>(zi(),Vi("div",{key:Wr.id,class:"flex items-center gap-2 text-xs text-white/80"},[Wr.name.startsWith("#")?(zi(),Vi("svg",kmt,zr[7]||(zr[7]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"},null,-1)]))):(zi(),Vi("svg",Tmt,zr[8]||(zr[8]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1721 9z"},null,-1)]))),Re("span",Amt,aa(Wr.name),1),Re("span",{class:Xs(["px-1 py-0.5 text-xs rounded",Wr.floodPolicy==="allow"?"bg-accent-green/20 text-accent-green":"bg-accent-red/20 text-accent-red"])},aa(Wr.floodPolicy),3)]))),128)),Dt.value.length>10?(zi(),Vi("div",Mmt," ...and "+aa(Dt.value.length-10)+" more ",1)):bs("",!0)])])])])):bs("",!0),Dt.value.length>0&&Gt.value.length>0?(zi(),Vi("div",Smt,[zr[13]||(zr[13]=Re("h4",{class:"text-white font-medium text-sm mb-3"},"Move children to another region:",-1)),Re("div",Emt,[Re("div",Cmt,[zr[10]||(zr[10]=Re("svg",{class:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-white/40",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1)),$p(Re("input",{"onUpdate:modelValue":zr[0]||(zr[0]=Wr=>mt.value=Wr),type:"text",placeholder:"Search regions...",class:"w-full pl-9 pr-4 py-2 bg-white/5 border border-white/20 rounded-lg text-white placeholder-white/50 focus:outline-none focus:border-primary focus:ring-2 focus:ring-primary/20 transition-colors text-sm"},null,512),[[$A,mt.value]])])]),Re("div",Lmt,[re.value.length===0?(zi(),Vi("div",Pmt,aa(mt.value?"No regions match your search":"No available regions"),1)):bs("",!0),(zi(!0),Vi(Ou,null,sf(re.value,Wr=>(zi(),Vi("label",{key:Wr.id,class:"flex items-center gap-3 p-2 rounded cursor-pointer hover:bg-white/10 transition-colors group"},[Re("div",zmt,[$p(Re("input",{type:"radio",value:Wr.id,"onUpdate:modelValue":zr[1]||(zr[1]=An=>J.value=An),class:"sr-only peer"},null,8,Imt),[[F2,J.value]]),zr[11]||(zr[11]=Re("div",{class:"w-4 h-4 border-2 border-white/30 rounded-full group-hover:border-white/50 peer-checked:border-primary peer-checked:bg-primary/20 transition-all"},[Re("div",{class:"w-2 h-2 rounded-full bg-primary scale-0 peer-checked:scale-100 transition-transform absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2"})],-1))]),Re("div",Omt,[zr[12]||(zr[12]=Re("svg",{class:"w-4 h-4 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"})],-1)),Re("span",Dmt,aa(Wr.name),1),Wr.children.length>0?(zi(),Vi("span",Fmt,aa(Wr.children.length),1)):bs("",!0)])]))),128))])])):bs("",!0),Re("div",Rmt,[Re("button",{onClick:or,class:"flex-1 px-4 py-3 bg-white/5 hover:bg-white/10 border border-white/20 text-white rounded-lg transition-colors"}," Cancel "),Dt.value.length>0&&J.value?(zi(),Vi("button",{key:0,onClick:Ne,class:"flex-1 px-4 py-3 bg-primary/20 hover:bg-primary/30 border border-primary/50 text-primary rounded-lg transition-colors"}," Move & Delete ")):bs("",!0),Re("button",{onClick:pe,class:"flex-1 px-4 py-3 bg-accent-red/20 hover:bg-accent-red/30 border border-accent-red/50 text-accent-red rounded-lg transition-colors font-medium"},aa(Dt.value.length>0?"Delete All":"Delete"),1)])])])):bs("",!0)}}),Nmt={class:"space-y-6"},jmt={class:"flex justify-between items-start"},Umt={class:"flex gap-2"},Vmt=["disabled"],Hmt=["disabled"],Wmt=["disabled"],qmt={class:"glass-card rounded-[15px] p-4 border border-white/10 bg-white/5"},Zmt={class:"flex items-center justify-between"},$mt={class:"flex items-center gap-3"},Gmt={class:"flex bg-white/5 rounded-lg border border-white/20 p-1"},Ymt={class:"glass-card rounded-[15px] p-6 border border-white/10"},Kmt={key:0,class:"flex items-center justify-center py-8"},Xmt={key:1,class:"text-center py-8"},Jmt={class:"text-white/70 text-sm"},Qmt={key:2,class:"text-center py-8"},tgt={key:3,class:"space-y-2"},egt=Th({name:"TransportKeys",__name:"TransportKeys",setup(d){const l=WD(),z=lo(!1),j=lo(!1),J=lo(!1),mt=lo(null),kt=lo(null),Dt=lo("deny"),Gt=lo([]),re=lo(!1),pe=lo(null),Ne=Li=>{const yi=new Map,ra=[];return Li.forEach(Da=>{const Ni={id:Da.id,name:Da.name,floodPolicy:Da.flood_policy,transport_key:Da.transport_key,last_used:Da.last_used?new Date(Da.last_used*1e3):void 0,parent_id:Da.parent_id,children:[]};yi.set(Da.id,Ni)}),yi.forEach(Da=>{Da.parent_id&&yi.has(Da.parent_id)?yi.get(Da.parent_id).children.push(Da):ra.push(Da)}),ra},or=async()=>{try{re.value=!0,pe.value=null;const Li=await Xh.getTransportKeys();Li.success&&Li.data?Gt.value=Ne(Li.data):pe.value=Li.error||"Failed to load transport keys"}catch(Li){pe.value=Li instanceof Error?Li.message:"Unknown error occurred",console.error("Error loading transport keys:",Li)}finally{re.value=!1}};t0(()=>{or()});function _r(Li,yi){for(const ra of Li){if(ra.id===yi)return ra;if(ra.children){const Da=_r(ra.children,yi);if(Da)return Da}}return null}function Fr(){const Li=l.selectedNodeId.value;return Li?_r(Gt.value,Li)?.name:void 0}function zr(Li){Dt.value==="deny"&&l.setSelectedNode(Li)}function Wr(){Dt.value==="deny"&&(z.value=!0)}function An(){if(Dt.value==="deny"&&l.selectedNodeId.value){const Li=_r(Gt.value,l.selectedNodeId.value);Li&&(kt.value=Li,J.value=!0)}}function Ft(){if(Dt.value==="deny"&&l.selectedNodeId.value){const Li=_r(Gt.value,l.selectedNodeId.value);Li&&(mt.value=Li,j.value=!0)}}const kn=async Li=>{try{const yi=await Xh.createTransportKey(Li.name,Li.floodPolicy,void 0,Li.parentId,void 0);yi.success?await or():(console.error("❌ Failed to add transport key:",yi.error),pe.value=yi.error||"Failed to add transport key")}catch(yi){console.error("❌ Error adding transport key:",yi),pe.value=yi instanceof Error?yi.message:"Unknown error occurred"}finally{z.value=!1}};function ei(){z.value=!1}async function jn(Li){try{const yi=Li==="allow",ra=await Xh.updateGlobalFloodPolicy(yi);ra.success?Dt.value=Li:(console.error("❌ Failed to update global flood policy:",ra.error),pe.value=ra.error||"Failed to update global flood policy")}catch(yi){console.error("❌ Error updating global flood policy:",yi),pe.value=yi instanceof Error?yi.message:"Failed to update global flood policy"}}function ai(){j.value=!1,mt.value=null}async function Qi(Li){try{const yi=await Xh.updateTransportKey(Li.id,Li.name,Li.floodPolicy);yi.success?await or():(console.error("❌ Failed to update transport key:",yi.error),pe.value=yi.error||"Failed to update transport key")}catch(yi){console.error("❌ Error updating transport key:",yi),pe.value=yi instanceof Error?yi.message:"Unknown error occurred"}finally{ai()}}function Gi(Li){j.value=!1,mt.value=null,kt.value=Li,J.value=!0}function un(){J.value=!1,kt.value=null}async function ia(Li){try{const yi=await Xh.deleteTransportKey(Li);yi.success?(await or(),l.setSelectedNode(null)):(console.error("❌ Failed to delete transport key:",yi.error),pe.value=yi.error||"Failed to delete transport key")}catch(yi){console.error("❌ Error deleting transport key:",yi),pe.value=yi instanceof Error?yi.message:"Unknown error occurred"}finally{un()}}async function fa(Li){try{const yi=await Xh.deleteTransportKey(Li.nodeId);yi.success?(await or(),l.setSelectedNode(null)):(console.error("❌ Failed to delete transport key:",yi.error),pe.value=yi.error||"Failed to delete transport key")}catch(yi){console.error("❌ Error deleting transport key:",yi),pe.value=yi instanceof Error?yi.message:"Unknown error occurred"}finally{un()}}return(Li,yi)=>(zi(),Vi("div",Nmt,[Re("div",jmt,[yi[3]||(yi[3]=Re("div",null,[Re("h3",{class:"text-lg font-semibold text-white mb-2"},"Regions/Keys"),Re("p",{class:"text-white/70 text-sm"},"Manage regional key hierarchy")],-1)),Re("div",Umt,[Re("button",{onClick:Wr,disabled:Dt.value==="allow",class:Xs(["flex items-center gap-2 px-3 py-2 rounded-lg border transition-colors text-sm",Dt.value==="allow"?"bg-white/5 text-white/40 border-white/20 cursor-not-allowed":"bg-accent-green/10 hover:bg-accent-green/20 text-accent-green border-accent-green/30"])},yi[2]||(yi[2]=[Re("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})],-1),nc(" Add ",-1)]),10,Vmt),Re("button",{onClick:Ft,disabled:!Ju(l).selectedNodeId.value||Dt.value==="allow",class:Xs(["px-4 py-2 rounded-lg border transition-colors",!Ju(l).selectedNodeId.value||Dt.value==="allow"?"bg-white/10 text-white/40 border-white/20 cursor-not-allowed":"bg-accent-green/20 hover:bg-accent-green/30 text-accent-green border-accent-green/50"])}," Edit ",10,Hmt),Re("button",{onClick:An,disabled:!Ju(l).selectedNodeId.value||Dt.value==="allow",class:Xs(["px-4 py-2 rounded-lg border transition-colors",!Ju(l).selectedNodeId.value||Dt.value==="allow"?"bg-white/10 text-white/40 border-white/20 cursor-not-allowed":"bg-accent-red/20 hover:bg-accent-red/30 text-accent-red border-accent-red/50"])}," Delete ",10,Wmt)])]),Re("div",qmt,[Re("div",Zmt,[yi[4]||(yi[4]=Re("div",null,[Re("h4",{class:"text-sm font-medium text-white mb-1"},"Global Flood Policy (*)"),Re("p",{class:"text-white/60 text-xs"},"Master control for repeater flooding")],-1)),Re("div",$mt,[Re("div",Gmt,[Re("button",{onClick:yi[0]||(yi[0]=ra=>jn("deny")),class:Xs(["px-3 py-1 text-xs font-medium rounded transition-colors",Dt.value==="deny"?"bg-accent-red/20 text-accent-red border border-accent-red/50":"text-white/60 hover:text-white/80"])}," DENY ",2),Re("button",{onClick:yi[1]||(yi[1]=ra=>jn("allow")),class:Xs(["px-3 py-1 text-xs font-medium rounded transition-colors",Dt.value==="allow"?"bg-accent-green/20 text-accent-green border border-accent-green/50":"text-white/60 hover:text-white/80"])}," ALLOW ",2)])])])]),Re("div",Ymt,[re.value?(zi(),Vi("div",Kmt,yi[5]||(yi[5]=[Re("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-accent-green"},null,-1),Re("span",{class:"ml-2 text-white/70"},"Loading transport keys...",-1)]))):pe.value?(zi(),Vi("div",Xmt,[yi[6]||(yi[6]=Re("div",{class:"text-accent-red mb-2"},"⚠️ Error loading transport keys",-1)),Re("div",Jmt,aa(pe.value),1),Re("button",{onClick:or,class:"mt-4 px-4 py-2 bg-accent-green/20 hover:bg-accent-green/30 text-accent-green border border-accent-green/50 rounded-lg transition-colors"}," Retry ")])):Gt.value.length===0?(zi(),Vi("div",Qmt,yi[7]||(yi[7]=[Re("div",{class:"text-white/50 mb-2"},"📝 No transport keys found",-1),Re("div",{class:"text-white/30 text-sm"},"Add your first transport key to get started",-1)]))):(zi(),Vi("div",tgt,[(zi(!0),Vi(Ou,null,sf(Gt.value,ra=>(zi(),hm(_0t,{key:ra.id,node:ra,"selected-node-id":Ju(l).selectedNodeId.value,level:0,disabled:Dt.value==="allow",onSelect:zr},null,8,["node","selected-node-id","disabled"]))),128))]))]),gu(U0t,{show:z.value,"selected-node-name":Fr(),"selected-node-id":Ju(l).selectedNodeId.value||void 0,onClose:ei,onAdd:kn},null,8,["show","selected-node-name","selected-node-id"]),gu(pmt,{show:j.value,node:mt.value,onClose:ai,onSave:Qi,onRequestDelete:Gi},null,8,["show","node"]),gu(Bmt,{show:J.value,node:kt.value,"all-nodes":Gt.value,onClose:un,onDeleteAll:ia,onMoveChildren:fa},null,8,["show","node","all-nodes"])]))}}),rgt={class:"p-6 space-y-6"},ngt={class:"glass-card rounded-[15px] z-10 p-4 border border-primary/30 bg-primary/10"},igt={class:"text-primary"},agt={class:"mt-2 text-primary/80"},ogt={class:"glass-card rounded-[15px] p-6"},sgt={class:"flex flex-wrap border-b border-white/10 mb-6"},lgt=["onClick"],ugt={class:"flex items-center gap-2"},cgt={key:0,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},hgt={key:1,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},fgt={key:2,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},dgt={key:3,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},pgt={key:4,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},mgt={class:"min-h-[400px]"},ggt={key:0,class:"flex items-center justify-center py-12"},vgt={key:1,class:"flex items-center justify-center py-12"},ygt={class:"text-center"},xgt={class:"text-white/60 text-sm mb-4"},_gt={key:2},bgt=Th({name:"ConfigurationView",__name:"Configuration",setup(d){const l=sv(),z=lo("radio"),j=lo(!1),J=[{id:"radio",label:"Radio Settings",icon:"radio"},{id:"repeater",label:"Repeater Settings",icon:"repeater"},{id:"duty",label:"Duty Cycle",icon:"duty"},{id:"delays",label:"TX Delays",icon:"delays"},{id:"transport",label:"Regions/Keys",icon:"keys"}];t0(async()=>{try{await l.fetchStats(),j.value=!0}catch(kt){console.error("Failed to load configuration data:",kt),j.value=!0}});function mt(kt){z.value=kt}return(kt,Dt)=>{const Gt=UA("router-link");return zi(),Vi("div",rgt,[Dt[11]||(Dt[11]=Re("div",null,[Re("h1",{class:"text-2xl font-bold text-white"},"Configuration"),Re("p",{class:"text-white/70 mt-2"},"System configuration and settings")],-1)),Dt[12]||(Dt[12]=Re("div",{class:"glass-card rounded-[15px] p-4 border border-blue-500/30 bg-blue-500/10"},[Re("div",{class:"text-blue-200"},[Re("strong",null,"Configuration is read-only."),nc(" To modify settings, edit the config file and restart the daemon. ")])],-1)),Re("div",ngt,[Re("div",igt,[Dt[3]||(Dt[3]=Re("strong",null,"CAD Calibration Tool Available",-1)),Re("p",agt,[Dt[2]||(Dt[2]=nc(" Optimize your Channel Activity Detection settings. ",-1)),gu(Gt,{to:"/cad-calibration",class:"underline hover:text-primary transition-colors"},{default:Y2(()=>Dt[1]||(Dt[1]=[nc(" Launch CAD Calibration Tool → ",-1)])),_:1,__:[1]})])])]),Re("div",ogt,[Re("div",sgt,[(zi(),Vi(Ou,null,sf(J,re=>Re("button",{key:re.id,onClick:pe=>mt(re.id),class:Xs(["px-4 py-2 text-sm font-medium transition-colors duration-200 border-b-2 mr-6 mb-2",z.value===re.id?"text-primary border-primary":"text-white/70 border-transparent hover:text-white hover:border-white/30"])},[Re("div",ugt,[re.icon==="radio"?(zi(),Vi("svg",cgt,Dt[4]||(Dt[4]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8.111 16.404a5.5 5.5 0 017.778 0M12 20h.01m-7.08-7.071c3.904-3.905 10.236-3.905 14.141 0M1.394 9.822c5.716-5.716 14.976-5.716 20.692 0"},null,-1)]))):re.icon==="repeater"?(zi(),Vi("svg",hgt,Dt[5]||(Dt[5]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14M5 12l4-4m-4 4l4 4"},null,-1)]))):re.icon==="duty"?(zi(),Vi("svg",fgt,Dt[6]||(Dt[6]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)]))):re.icon==="delays"?(zi(),Vi("svg",dgt,Dt[7]||(Dt[7]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"},null,-1)]))):re.icon==="keys"?(zi(),Vi("svg",pgt,Dt[8]||(Dt[8]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"},null,-1)]))):bs("",!0),nc(" "+aa(re.label),1)])],10,lgt)),64))]),Re("div",mgt,[!j.value&&Ju(l).isLoading?(zi(),Vi("div",ggt,Dt[9]||(Dt[9]=[Re("div",{class:"text-center"},[Re("div",{class:"animate-spin w-8 h-8 border-2 border-white/20 border-t-primary rounded-full mx-auto mb-4"}),Re("div",{class:"text-white/70"},"Loading configuration...")],-1)]))):Ju(l).error&&!j.value?(zi(),Vi("div",vgt,[Re("div",ygt,[Dt[10]||(Dt[10]=Re("div",{class:"text-red-400 mb-2"},"Failed to load configuration",-1)),Re("div",xgt,aa(Ju(l).error),1),Re("button",{onClick:Dt[0]||(Dt[0]=re=>Ju(l).fetchStats()),class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-white rounded-lg border border-primary/50 transition-colors"}," Retry ")])])):(zi(),Vi("div",_gt,[$p(Re("div",null,[gu(Tpt,{key:"radio-settings"})],512),[[Kb,z.value==="radio"]]),$p(Re("div",null,[gu(Upt,{key:"repeater-settings"})],512),[[Kb,z.value==="repeater"]]),$p(Re("div",null,[gu(Gpt,{key:"duty-cycle"})],512),[[Kb,z.value==="duty"]]),$p(Re("div",null,[gu(e0t,{key:"transmission-delays"})],512),[[Kb,z.value==="delays"]]),$p(Re("div",null,[gu(egt,{key:"transport-keys"})],512),[[Kb,z.value==="transport"]])]))])])])}}}),wgt={class:"p-6 space-y-6"},kgt={class:"glass-card rounded-[15px] p-6"},Tgt={class:"flex justify-center"},Agt={class:"flex gap-4"},Mgt=["disabled"],Sgt=["disabled"],Egt={class:"glass-card rounded-[15px] p-6 space-y-4"},Cgt={class:"text-white"},Lgt={key:0,class:"p-4 bg-primary/10 border border-primary/30 rounded-lg"},Pgt={class:"text-primary/90"},zgt={class:"space-y-2"},Igt={class:"w-full bg-white/10 rounded-full h-2"},Ogt={class:"text-white/70 text-sm"},Dgt={class:"grid grid-cols-2 md:grid-cols-4 gap-4"},Fgt={class:"glass-card rounded-[15px] p-4 text-center"},Rgt={class:"text-2xl font-bold text-primary"},Bgt={class:"glass-card rounded-[15px] p-4 text-center"},Ngt={class:"text-2xl font-bold text-primary"},jgt={class:"glass-card rounded-[15px] p-4 text-center"},Ugt={class:"text-2xl font-bold text-primary"},Vgt={class:"glass-card rounded-[15px] p-4 text-center"},Hgt={class:"text-2xl font-bold text-primary"},Wgt={key:0,class:"glass-card rounded-[15px] p-6 space-y-4"},qgt={key:0,class:"p-4 bg-accent-green/10 border border-accent-green/30 rounded-lg"},Zgt={class:"text-white/80 mb-4"},$gt={key:1,class:"p-4 bg-secondary/20 border border-secondary/40 rounded-lg"},Ggt=Th({name:"CADCalibrationView",__name:"CADCalibration",setup(d){const l=sv(),z=lo(!1),j=lo(null),J=lo(null),mt=lo({}),kt=lo(null),Dt=lo([]),Gt=lo({}),re=lo("Ready to start calibration"),pe=lo(0),Ne=lo(0),or=lo(0),_r=lo(0),Fr=lo(0),zr=lo(0),Wr=lo(null),An=lo(!1),Ft=lo(!1),kn=lo(!1),ei=lo(!1);let jn=null;const ai={responsive:!0,displayModeBar:!0,modeBarButtonsToRemove:["pan2d","select2d","lasso2d","autoScale2d"],displaylogo:!1,toImageButtonOptions:{format:"png",filename:"cad-calibration-heatmap",height:600,width:800,scale:2}};function Qi(){const Ni=[{x:[],y:[],z:[],mode:"markers",type:"scatter",marker:{size:12,color:[],colorscale:[[0,"rgba(75, 85, 99, 0.4)"],[.1,"rgba(6, 182, 212, 0.3)"],[.5,"rgba(6, 182, 212, 0.6)"],[1,"rgba(16, 185, 129, 0.9)"]],showscale:!0,colorbar:{title:{text:"Detection Rate (%)",font:{color:"#ffffff",size:14}},tickfont:{color:"#ffffff"},bgcolor:"rgba(0,0,0,0)",bordercolor:"rgba(255,255,255,0.2)",borderwidth:1,thickness:15},line:{color:"rgba(255,255,255,0.2)",width:1}},hovertemplate:"Peak: %{x}
Min: %{y}
Detection Rate: %{marker.color:.1f}%
",name:"Test Results"}],Ei={title:{text:'CAD Detection Rate
Channel Activity Detection Calibration',font:{color:"#ffffff",size:18},x:.5},xaxis:{title:{text:"CAD Peak Threshold",font:{color:"#cbd5e1",size:14}},tickfont:{color:"#cbd5e1"},gridcolor:"rgba(148, 163, 184, 0.1)",zerolinecolor:"rgba(148, 163, 184, 0.2)",linecolor:"rgba(148, 163, 184, 0.3)"},yaxis:{title:{text:"CAD Min Threshold",font:{color:"#cbd5e1",size:14}},tickfont:{color:"#cbd5e1"},gridcolor:"rgba(148, 163, 184, 0.1)",zerolinecolor:"rgba(148, 163, 184, 0.2)",linecolor:"rgba(148, 163, 184, 0.3)"},plot_bgcolor:"rgba(0, 0, 0, 0)",paper_bgcolor:"rgba(0, 0, 0, 0)",font:{color:"#ffffff",family:"Inter, system-ui, sans-serif"},margin:{l:80,r:80,t:100,b:80},showlegend:!1};l1.newPlot("plotly-chart",Ni,Ei,ai)}function Gi(){if(Object.keys(mt.value).length===0)return;const Ni=Object.values(mt.value),Ei=[],Va=[],ss=[];for(const ko of Ni)Ei.push(ko.det_peak),Va.push(ko.det_min),ss.push(ko.detection_rate);const mo={x:[Ei],y:[Va],"marker.color":[ss],hovertemplate:"Peak: %{x}
Min: %{y}
Detection Rate: %{marker.color:.1f}%
Status: Tested
"};l1.restyle("plotly-chart",mo,[0])}async function un(){try{const Va=await Xh.post("/cad-calibration-start",{samples:10,delay_ms:50});if(Va.success)z.value=!0,j.value=Date.now(),l.setCadCalibrationRunning(!0),mt.value={},Dt.value=[],Gt.value={},kt.value=null,An.value=!1,Ft.value=!1,kn.value=!1,ei.value=!1,or.value=0,_r.value=0,Fr.value=0,zr.value=0,pe.value=0,Ne.value=0,jn=setInterval(()=>{j.value&&(zr.value=Math.floor((Date.now()-j.value)/1e3))},1e3),fa();else throw new Error(Va.error||"Failed to start calibration")}catch(Va){re.value=`Error: ${Va instanceof Error?Va.message:"Unknown error"}`}}async function ia(){try{(await Xh.post("/cad-calibration-stop")).success&&(z.value=!1,l.setCadCalibrationRunning(!1),J.value&&(J.value.close(),J.value=null),jn&&(clearInterval(jn),jn=null))}catch(Ni){console.error("Failed to stop calibration:",Ni)}}function fa(){J.value&&J.value.close(),J.value=new EventSource(`${oQ}/api/cad-calibration-stream`),J.value.onmessage=function(Ni){try{const Ei=JSON.parse(Ni.data);Li(Ei)}catch(Ei){console.error("Failed to parse SSE data:",Ei)}},J.value.onerror=function(Ni){console.error("SSE connection error:",Ni),z.value||J.value&&(J.value.close(),J.value=null)}}function Li(Ni){switch(Ni.type){case"status":re.value=Ni.message||"Status update",Ni.test_ranges&&(Wr.value=Ni.test_ranges,An.value=!0);break;case"progress":pe.value=Ni.current||0,Ne.value=Ni.total||0,or.value=Ni.current||0;break;case"result":if(Ni.det_peak!==void 0&&Ni.det_min!==void 0&&Ni.detection_rate!==void 0&&Ni.detections!==void 0&&Ni.samples!==void 0){const Ei=`${Ni.det_peak}_${Ni.det_min}`;mt.value[Ei]={det_peak:Ni.det_peak,det_min:Ni.det_min,detection_rate:Ni.detection_rate,detections:Ni.detections,samples:Ni.samples},Gi(),yi()}break;case"complete":case"completed":z.value=!1,re.value=Ni.message||"Calibration completed",l.setCadCalibrationRunning(!1),ra(),J.value&&(J.value.close(),J.value=null),jn&&(clearInterval(jn),jn=null);break;case"error":re.value=`Error: ${Ni.message}`,l.setCadCalibrationRunning(!1),ia();break}}function yi(){const Ni=Object.values(mt.value).map(Ei=>Ei.detection_rate);Ni.length!==0&&(_r.value=Math.max(...Ni),Fr.value=Ni.reduce((Ei,Va)=>Ei+Va,0)/Ni.length)}function ra(){Ft.value=!0;let Ni=null,Ei=0;for(const Va of Object.values(mt.value))Va.detection_rate>Ei&&(Ei=Va.detection_rate,Ni=Va);kt.value=Ni,Ni&&Ei>0?(kn.value=!0,ei.value=!1):(kn.value=!1,ei.value=!0)}async function Da(){if(!kt.value){re.value="Error: No calibration results to save";return}try{const Ni=await Xh.post("/save_cad_settings",{peak:kt.value.det_peak,min_val:kt.value.det_min,detection_rate:kt.value.detection_rate});if(Ni.success)re.value=`Settings saved! Peak=${kt.value.det_peak}, Min=${kt.value.det_min} applied to configuration.`;else throw new Error(Ni.error||"Failed to save settings")}catch(Ni){re.value=`Error: Failed to save settings: ${Ni instanceof Error?Ni.message:"Unknown error"}`}}return t0(()=>{Qi()}),K2(()=>{J.value&&J.value.close(),jn&&clearInterval(jn),l.setCadCalibrationRunning(!1),document.getElementById("plotly-chart")&&l1.purge("plotly-chart")}),(Ni,Ei)=>(zi(),Vi("div",wgt,[Ei[14]||(Ei[14]=Re("div",null,[Re("h1",{class:"text-2xl font-bold text-white"},"CAD Calibration Tool"),Re("p",{class:"text-white/70 mt-2"},"Channel Activity Detection calibration")],-1)),Re("div",kgt,[Re("div",Tgt,[Re("div",Agt,[Re("button",{onClick:un,disabled:z.value,class:"flex items-center gap-3 px-6 py-3 bg-accent-green/10 hover:bg-accent-green/20 disabled:bg-gray-500/10 text-accent-green disabled:text-gray-400 rounded-lg border border-accent-green/30 disabled:border-gray-500/20 transition-colors disabled:cursor-not-allowed"},Ei[0]||(Ei[0]=[Ff('
Start Calibration
Begin testing
',2)]),8,Mgt),Re("button",{onClick:ia,disabled:!z.value,class:"flex items-center gap-3 px-6 py-3 bg-accent-red/10 hover:bg-accent-red/20 disabled:bg-gray-500/10 text-accent-red disabled:text-gray-400 rounded-lg border border-accent-red/30 disabled:border-gray-500/20 transition-colors disabled:cursor-not-allowed"},Ei[1]||(Ei[1]=[Ff('
Stop
Halt calibration
',2)]),8,Sgt)])])]),Re("div",Egt,[Re("div",Cgt,aa(re.value),1),An.value&&Wr.value?(zi(),Vi("div",Lgt,[Re("div",Pgt,[Ei[2]||(Ei[2]=Re("strong",null,"Configuration:",-1)),nc(" SF"+aa(Wr.value.spreading_factor)+" | Peak: "+aa(Wr.value.peak_min)+" - "+aa(Wr.value.peak_max)+" | Min: "+aa(Wr.value.min_min)+" - "+aa(Wr.value.min_max)+" | "+aa((Wr.value.peak_max-Wr.value.peak_min+1)*(Wr.value.min_max-Wr.value.min_min+1))+" tests ",1)])])):bs("",!0),Re("div",zgt,[Re("div",Igt,[Re("div",{class:"bg-gradient-to-r from-primary to-accent-green h-2 rounded-full transition-all duration-300",style:av({width:Ne.value>0?`${pe.value/Ne.value*100}%`:"0%"})},null,4)]),Re("div",Ogt,aa(pe.value)+" / "+aa(Ne.value)+" tests completed",1)])]),Re("div",Dgt,[Re("div",Fgt,[Re("div",Rgt,aa(or.value),1),Ei[3]||(Ei[3]=Re("div",{class:"text-white/70 text-sm"},"Tests Completed",-1))]),Re("div",Bgt,[Re("div",Ngt,aa(_r.value.toFixed(1))+"%",1),Ei[4]||(Ei[4]=Re("div",{class:"text-white/70 text-sm"},"Best Detection Rate",-1))]),Re("div",jgt,[Re("div",Ugt,aa(Fr.value.toFixed(1))+"%",1),Ei[5]||(Ei[5]=Re("div",{class:"text-white/70 text-sm"},"Average Rate",-1))]),Re("div",Vgt,[Re("div",Hgt,aa(zr.value)+"s",1),Ei[6]||(Ei[6]=Re("div",{class:"text-white/70 text-sm"},"Elapsed Time",-1))])]),Ei[15]||(Ei[15]=Re("div",{class:"glass-card rounded-[15px] p-6"},[Re("div",{id:"plotly-chart",class:"w-full h-96"})],-1)),Ft.value?(zi(),Vi("div",Wgt,[Ei[13]||(Ei[13]=Re("h3",{class:"text-xl font-bold text-white"},"Calibration Results",-1)),kn.value&&kt.value?(zi(),Vi("div",qgt,[Ei[11]||(Ei[11]=Re("h4",{class:"font-medium text-accent-green mb-2"},"Optimal Settings Found:",-1)),Re("p",Zgt,[Ei[7]||(Ei[7]=nc(" Peak: ",-1)),Re("strong",null,aa(kt.value.det_peak),1),Ei[8]||(Ei[8]=nc(", Min: ",-1)),Re("strong",null,aa(kt.value.det_min),1),Ei[9]||(Ei[9]=nc(", Rate: ",-1)),Re("strong",null,aa(kt.value.detection_rate.toFixed(1))+"%",1)]),Re("div",{class:"flex justify-center"},[Re("button",{onClick:Da,class:"flex items-center gap-3 px-6 py-3 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors"},Ei[10]||(Ei[10]=[Ff('
Save Settings
Apply to configuration
',2)]))])])):bs("",!0),ei.value?(zi(),Vi("div",$gt,Ei[12]||(Ei[12]=[Re("h4",{class:"font-medium text-secondary mb-2"},"No Optimal Settings Found",-1),Re("p",{class:"text-white/70"},"All tested combinations showed low detection rates. Consider running calibration again or adjusting test parameters.",-1)]))):bs("",!0)])):bs("",!0)]))}}),Ygt=ld(Ggt,[["__scopeId","data-v-854f5f55"]]),Kgt={class:"space-y-6"},Xgt={class:"bg-dark-card/30 backdrop-blur border border-white/10 rounded-[15px] p-6"},Jgt={class:"flex items-center justify-between mb-4"},Qgt=["disabled"],tvt={class:"bg-white/5 border border-white/10 rounded-lg p-4"},evt={class:"flex flex-wrap gap-2"},rvt=["onClick"],nvt={key:0,class:"w-px h-6 bg-white/20 mx-2 self-center"},ivt=["onClick"],avt={class:"bg-dark-card/30 backdrop-blur border border-white/10 rounded-[15px] overflow-hidden"},ovt={key:0,class:"p-8 text-center"},svt={key:1,class:"p-8 text-center"},lvt={class:"text-dark-text mb-4"},uvt={key:2,class:"max-h-[600px] overflow-y-auto"},cvt={key:0,class:"p-8 text-center"},hvt={key:1,class:"divide-y divide-white/5"},fvt={class:"flex-shrink-0 text-dark-text"},dvt={class:"flex-shrink-0 px-2 py-1 text-xs font-medium rounded bg-blue-500/20 text-blue-400"},pvt={class:"text-white flex-1 break-all"},mvt=Th({name:"LogsView",__name:"Logs",setup(d){const l=lo([]),z=lo(new Set),j=lo(new Set(["DEBUG","INFO","WARNING","ERROR"])),J=lo(new Set),mt=lo(new Set),kt=lo(!0),Dt=lo(null);let Gt=null;const re=fa=>{const Li=fa.match(/- ([^-]+) - (?:DEBUG|INFO|WARNING|ERROR) -/);return Li?Li[1].trim():"Unknown"},pe=fa=>{const Li=fa.match(/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2},\d{3} - [^-]+ - (?:DEBUG|INFO|WARNING|ERROR) - (.+)$/);return Li?Li[1]:fa},Ne=(fa,Li)=>{if(fa.size!==Li.size)return!1;for(const yi of fa)if(!Li.has(yi))return!1;return!0},or=async()=>{try{const fa=await Xh.getLogs();if(fa.logs&&fa.logs.length>0){l.value=fa.logs;const Li=new Set;l.value.forEach(Ni=>{const Ei=re(Ni.message);Li.add(Ei)});const yi=new Set;l.value.forEach(Ni=>{yi.add(Ni.level)}),z.value.size===0&&(z.value=new Set(Li));const ra=!Ne(J.value,Li),Da=!Ne(mt.value,yi);ra&&(J.value=Li),Da&&(mt.value=yi),Dt.value=null}}catch(fa){console.error("Error loading logs:",fa),Dt.value=fa instanceof Error?fa.message:"Failed to load logs"}finally{kt.value=!1}},_r=Yo(()=>l.value.filter(Li=>{const yi=re(Li.message),ra=z.value.has(yi),Da=j.value.has(Li.level);return ra&&Da})),Fr=Yo(()=>Array.from(J.value).sort()),zr=Yo(()=>{const fa=["ERROR","WARNING","WARN","INFO","DEBUG"];return Array.from(mt.value).sort((yi,ra)=>{const Da=fa.indexOf(yi),Ni=fa.indexOf(ra);return Da!==-1&&Ni!==-1?Da-Ni:yi.localeCompare(ra)})}),Wr=fa=>{j.value.has(fa)?j.value.delete(fa):j.value.add(fa),j.value=new Set(j.value)},An=fa=>new Date(fa).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}),Ft=fa=>({ERROR:"text-red-400 bg-red-900/20",WARNING:"text-yellow-400 bg-yellow-900/20",WARN:"text-yellow-400 bg-yellow-900/20",INFO:"text-blue-400 bg-blue-900/20",DEBUG:"text-gray-400 bg-gray-900/20"})[fa]||"text-gray-400 bg-gray-900/20",kn=(fa,Li)=>Li?{ERROR:"bg-red-500/20 text-red-400 border-red-500/50",WARNING:"bg-yellow-500/20 text-yellow-400 border-yellow-500/50",WARN:"bg-yellow-500/20 text-yellow-400 border-yellow-500/50",INFO:"bg-blue-500/20 text-blue-400 border-blue-500/50",DEBUG:"bg-gray-500/20 text-gray-400 border-gray-500/50"}[fa]||"bg-primary/20 text-primary border-primary/50":"bg-white/5 text-white/60 border-white/20 hover:bg-white/10",ei=fa=>{z.value.has(fa)?z.value.delete(fa):z.value.add(fa),z.value=new Set(z.value)},jn=()=>{z.value=new Set(J.value)},ai=()=>{z.value=new Set},Qi=()=>{j.value=new Set(mt.value)},Gi=()=>{j.value=new Set},un=()=>{Gt&&clearInterval(Gt),Gt=setInterval(or,5e3)},ia=()=>{Gt&&(clearInterval(Gt),Gt=null)};return t0(()=>{or(),un()}),dg(()=>{ia()}),(fa,Li)=>(zi(),Vi("div",Kgt,[Re("div",Xgt,[Re("div",Jgt,[Li[1]||(Li[1]=Re("div",null,[Re("h1",{class:"text-white text-2xl font-semibold mb-2"},"System Logs"),Re("p",{class:"text-dark-text"},"Real-time system events and diagnostics")],-1)),Re("button",{onClick:or,disabled:kt.value,class:"flex items-center gap-2 px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary border border-primary/50 rounded-lg transition-colors disabled:opacity-50"},[(zi(),Vi("svg",{class:Xs(["w-4 h-4",{"animate-spin":kt.value}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Li[0]||(Li[0]=[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"},null,-1)]),2)),nc(" "+aa(kt.value?"Loading...":"Refresh"),1)],8,Qgt)]),Re("div",tvt,[Re("div",{class:"flex flex-wrap items-center gap-3 mb-4"},[Li[2]||(Li[2]=Re("span",{class:"text-white font-medium"},"Filters:",-1)),Re("button",{onClick:jn,class:"px-3 py-1 text-xs bg-accent-green/20 hover:bg-accent-green/30 text-accent-green border border-accent-green/50 rounded transition-colors"}," All Loggers "),Re("button",{onClick:ai,class:"px-3 py-1 text-xs bg-accent-red/20 hover:bg-accent-red/30 text-accent-red border border-accent-red/50 rounded transition-colors"}," Clear Loggers "),Li[3]||(Li[3]=Re("div",{class:"w-px h-4 bg-white/20 mx-1"},null,-1)),Re("button",{onClick:Qi,class:"px-3 py-1 text-xs bg-accent-green/20 hover:bg-accent-green/30 text-accent-green border border-accent-green/50 rounded transition-colors"}," All Levels "),Re("button",{onClick:Gi,class:"px-3 py-1 text-xs bg-accent-red/20 hover:bg-accent-red/30 text-accent-red border border-accent-red/50 rounded transition-colors"}," Clear Levels ")]),Re("div",evt,[(zi(!0),Vi(Ou,null,sf(Fr.value,yi=>(zi(),Vi("button",{key:"logger-"+yi,onClick:ra=>ei(yi),class:Xs(["px-3 py-1 text-xs border rounded-full transition-colors",z.value.has(yi)?"bg-primary/20 text-primary border-primary/50":"bg-white/5 text-white/60 border-white/20 hover:bg-white/10"])},aa(yi),11,rvt))),128)),Fr.value.length>0&&zr.value.length>0?(zi(),Vi("div",nvt)):bs("",!0),(zi(!0),Vi(Ou,null,sf(zr.value,yi=>(zi(),Vi("button",{key:"level-"+yi,onClick:ra=>Wr(yi),class:Xs(["px-3 py-1 text-xs border rounded-full transition-colors font-medium",j.value.has(yi)?kn(yi,!0):kn(yi,!1)])},aa(yi),11,ivt))),128))])])]),Re("div",avt,[kt.value&&l.value.length===0?(zi(),Vi("div",ovt,Li[4]||(Li[4]=[Re("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary mx-auto mb-4"},null,-1),Re("p",{class:"text-dark-text"},"Loading system logs...",-1)]))):Dt.value?(zi(),Vi("div",svt,[Li[5]||(Li[5]=Re("div",{class:"text-red-400 mb-4"},[Re("svg",{class:"w-12 h-12 mx-auto mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Re("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})])],-1)),Li[6]||(Li[6]=Re("h3",{class:"text-white text-lg font-medium mb-2"},"Error Loading Logs",-1)),Re("p",lvt,aa(Dt.value),1),Re("button",{onClick:or,class:"px-4 py-2 bg-red-500/20 hover:bg-red-500/30 text-red-400 border border-red-500/50 rounded-lg transition-colors"}," Try Again ")])):(zi(),Vi("div",uvt,[_r.value.length===0?(zi(),Vi("div",cvt,Li[7]||(Li[7]=[Ff('

No Logs to Display

No logs match the current filter criteria.

',3)]))):(zi(),Vi("div",hvt,[(zi(!0),Vi(Ou,null,sf(_r.value,(yi,ra)=>(zi(),Vi("div",{key:ra,class:"flex items-start gap-4 p-4 hover:bg-white/5 transition-colors font-mono text-sm"},[Re("span",fvt," ["+aa(An(yi.timestamp))+"] ",1),Re("span",dvt,aa(re(yi.message)),1),Re("span",{class:Xs(["flex-shrink-0 px-2 py-1 text-xs font-medium rounded",Ft(yi.level)])},aa(yi.level),3),Re("span",pvt,aa(pe(yi.message)),1)]))),128))]))]))])]))}}),gvt=Th({name:"HelpView",__name:"Help",setup(d){return(l,z)=>(zi(),Vi("div",null,z[0]||(z[0]=[Ff('

Help

Help & Documentation

Find answers to common questions and access user guides.

',1)])))}}),vvt=SX({history:aX("/"),routes:[{path:"/",name:"dashboard",component:Lat},{path:"/neighbors",name:"neighbors",component:sot},{path:"/statistics",name:"statistics",component:upt},{path:"/configuration",name:"configuration",component:bgt},{path:"/cad-calibration",name:"cad-calibration",component:Ygt},{path:"/logs",name:"logs",component:mvt},{path:"/help",name:"help",component:gvt}]}),wM=dK(nrt);wM.use(gK());wM.use(vvt);wM.mount("#app"); diff --git a/repeater/web/html/index.html b/repeater/web/html/index.html index 3a4c491..548b7f8 100644 --- a/repeater/web/html/index.html +++ b/repeater/web/html/index.html @@ -8,7 +8,7 @@ - + diff --git a/repeater/web/http_server.py b/repeater/web/http_server.py index 817be27..9a6b4ba 100644 --- a/repeater/web/http_server.py +++ b/repeater/web/http_server.py @@ -46,7 +46,6 @@ class StatsApp: def __init__( self, stats_getter: Optional[Callable] = None, - template_dir: Optional[str] = None, node_name: str = "Repeater", pub_key: str = "", send_advert_func: Optional[Callable] = None, @@ -57,20 +56,39 @@ class StatsApp: ): self.stats_getter = stats_getter - self.template_dir = template_dir self.node_name = node_name self.pub_key = pub_key self.dashboard_template = None self.config = config or {} + + # Path to the compiled Vue.js application + self.html_dir = os.path.join(os.path.dirname(__file__), "html") # Create nested API object for routing self.api = APIEndpoints(stats_getter, send_advert_func, self.config, event_loop, daemon_instance, config_path) + @cherrypy.expose + def index(self): + """Serve the Vue.js application index.html.""" + index_path = os.path.join(self.html_dir, "index.html") + try: + with open(index_path, 'r', encoding='utf-8') as f: + return f.read() + except FileNotFoundError: + raise cherrypy.HTTPError(404, "Application not found. Please build the frontend first.") + except Exception as e: + logger.error(f"Error serving index.html: {e}") + raise cherrypy.HTTPError(500, "Internal server error") - # @cherrypy.expose - # def index(self): - # """Serve dashboard HTML.""" - # return self._serve_template("dashboard.html") + @cherrypy.expose + def default(self, *args, **kwargs): + """Handle client-side routing - serve index.html for all non-API routes.""" + # Let API routes pass through + if args and args[0] == 'api': + raise cherrypy.NotFound() + + # For all other routes, serve the Vue.js app (client-side routing) + return self.index() class HTTPStatsServer: @@ -80,7 +98,6 @@ class HTTPStatsServer: host: str = "0.0.0.0", port: int = 8000, stats_getter: Optional[Callable] = None, - template_dir: Optional[str] = None, node_name: str = "Repeater", pub_key: str = "", send_advert_func: Optional[Callable] = None, @@ -93,24 +110,39 @@ class HTTPStatsServer: self.host = host self.port = port self.app = StatsApp( - stats_getter, template_dir, node_name, pub_key, send_advert_func, config, event_loop, daemon_instance, config_path + stats_getter, node_name, pub_key, send_advert_func, config, event_loop, daemon_instance, config_path ) def start(self): try: - # Serve static files from templates directory - static_dir = ( - self.app.template_dir if self.app.template_dir else os.path.dirname(__file__) - ) + # Serve static files from the html directory (compiled Vue.js app) + html_dir = os.path.join(os.path.dirname(__file__), "html") + assets_dir = os.path.join(html_dir, "assets") config = { "/": { "tools.sessions.on": False, + # Ensure proper content types for Vue.js files + "tools.staticfile.content_types": { + 'js': 'application/javascript', + 'css': 'text/css', + 'html': 'text/html; charset=utf-8' + }, }, - "/static": { + "/assets": { "tools.staticdir.on": True, - "tools.staticdir.dir": static_dir, + "tools.staticdir.dir": assets_dir, + # Set proper content types for assets + "tools.staticdir.content_types": { + 'js': 'application/javascript', + 'css': 'text/css', + 'map': 'application/json' + }, + }, + "/favicon.ico": { + "tools.staticfile.on": True, + "tools.staticfile.filename": os.path.join(html_dir, "favicon.ico"), }, }