mirror of
https://github.com/pyMC-dev/pyMC_Repeater.git
synced 2026-11-10 20:32:27 +01:00
Merge pull request #142 from agessaman/dev-companion-v2-cleanup
Add Companion seeding from repeater advert database, add companions connection status to sessions panel
This commit is contained in:
24 files changed
+514
-3
No files matched your search
@@ -1877,6 +1877,63 @@ class SQLiteHandler:
|
||||
logger.error(f"Failed to upsert companion contact: {e}")
|
||||
return False
|
||||
|
||||
def companion_import_repeater_contacts(
|
||||
self,
|
||||
companion_hash: str,
|
||||
contact_types: Optional[List[str]] = None,
|
||||
hours: Optional[int] = None,
|
||||
limit: Optional[int] = None,
|
||||
) -> int:
|
||||
"""Import repeater adverts into a companion's contact store (one-time seed).
|
||||
|
||||
Results are ordered by last_seen DESC so the most recent contacts are
|
||||
imported first. Optional hours filters to adverts seen within the last N hours;
|
||||
optional limit caps how many contacts are imported.
|
||||
"""
|
||||
type_map = {"companion": 1, "repeater": 2, "room_server": 3, "sensor": 4}
|
||||
try:
|
||||
with sqlite3.connect(self.sqlite_path) as conn:
|
||||
conn.row_factory = sqlite3.Row
|
||||
query = (
|
||||
"SELECT pubkey, node_name, contact_type, latitude, longitude, last_seen "
|
||||
"FROM adverts WHERE pubkey IS NOT NULL"
|
||||
)
|
||||
params: list = []
|
||||
if contact_types:
|
||||
placeholders = ",".join("?" * len(contact_types))
|
||||
query += f" AND contact_type IN ({placeholders})"
|
||||
params.extend(contact_types)
|
||||
if hours is not None:
|
||||
cutoff = time.time() - (hours * 3600)
|
||||
query += " AND last_seen >= ?"
|
||||
params.append(cutoff)
|
||||
query += " ORDER BY last_seen DESC"
|
||||
if limit is not None:
|
||||
query += " LIMIT ?"
|
||||
params.append(limit)
|
||||
rows = conn.execute(query, params).fetchall()
|
||||
|
||||
count = 0
|
||||
for row in rows:
|
||||
raw_type = row["contact_type"] or ""
|
||||
normalized_type = raw_type.lower().replace(" ", "_").strip()
|
||||
adv_type = type_map.get(normalized_type, 0)
|
||||
contact = {
|
||||
"pubkey": bytes.fromhex(row["pubkey"]),
|
||||
"name": row["node_name"] or "",
|
||||
"adv_type": adv_type,
|
||||
"gps_lat": row["latitude"] or 0.0,
|
||||
"gps_lon": row["longitude"] or 0.0,
|
||||
"last_advert_timestamp": int(row["last_seen"] or 0),
|
||||
"lastmod": int(row["last_seen"] or 0),
|
||||
}
|
||||
if self.companion_upsert_contact(companion_hash, contact):
|
||||
count += 1
|
||||
return count
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to import repeater contacts: {e}")
|
||||
return 0
|
||||
|
||||
def companion_load_prefs(self, companion_hash: str) -> Optional[Dict]:
|
||||
"""Load persisted prefs for a companion. Returns parsed JSON dict or None if no row."""
|
||||
try:
|
||||
|
||||
@@ -3131,12 +3131,49 @@ class APIEndpoints:
|
||||
}
|
||||
)
|
||||
|
||||
# Add companion identities (no login/ACL fields; use registered + active for status)
|
||||
companion_bridges = getattr(self.daemon_instance, "companion_bridges", {})
|
||||
# Build hash -> active TCP connection and client IP (frame server has at most one client)
|
||||
active_by_hash = {}
|
||||
client_ip_by_hash = {}
|
||||
for fs in getattr(self.daemon_instance, "companion_frame_servers", []):
|
||||
try:
|
||||
ch = getattr(fs, "companion_hash", None)
|
||||
h = (
|
||||
int(ch, 16)
|
||||
if isinstance(ch, str) and ch.startswith("0x")
|
||||
else (int(ch) if ch is not None else None)
|
||||
)
|
||||
if h is not None:
|
||||
writer = getattr(fs, "_client_writer", None)
|
||||
active_by_hash[h] = writer is not None
|
||||
if writer is not None:
|
||||
peername = writer.get_extra_info("peername") if hasattr(writer, "get_extra_info") else None
|
||||
client_ip_by_hash[h] = str(peername[0]) if peername else None
|
||||
except (ValueError, TypeError):
|
||||
pass
|
||||
for name, identity, config in identity_manager.get_identities_by_type("companion"):
|
||||
hash_byte = identity.get_public_key()[0]
|
||||
active = active_by_hash.get(hash_byte, False)
|
||||
entry = {
|
||||
"name": name,
|
||||
"type": "companion",
|
||||
"hash": f"0x{hash_byte:02X}",
|
||||
"registered": hash_byte in companion_bridges,
|
||||
"active": active,
|
||||
}
|
||||
if active:
|
||||
entry["client_ip"] = client_ip_by_hash.get(hash_byte)
|
||||
else:
|
||||
entry["client_ip"] = None
|
||||
acl_info_list.append(entry)
|
||||
|
||||
return self._success(
|
||||
{
|
||||
"acls": acl_info_list,
|
||||
"total_identities": len(acl_info_list),
|
||||
"total_authenticated_clients": sum(
|
||||
a["authenticated_clients"] for a in acl_info_list
|
||||
a.get("authenticated_clients", 0) for a in acl_info_list
|
||||
),
|
||||
}
|
||||
)
|
||||
@@ -3198,6 +3235,15 @@ class APIEndpoints:
|
||||
"hash": self._fmt_hash(identity.get_public_key()),
|
||||
}
|
||||
|
||||
# Add companions
|
||||
for name, identity, config in identity_manager.get_identities_by_type("companion"):
|
||||
hash_byte = identity.get_public_key()[0]
|
||||
identity_map[hash_byte] = {
|
||||
"name": name,
|
||||
"type": "companion",
|
||||
"hash": f"0x{hash_byte:02X}",
|
||||
}
|
||||
|
||||
# Filter by identity if requested
|
||||
target_hash = None
|
||||
if identity_hash:
|
||||
@@ -3394,6 +3440,7 @@ class APIEndpoints:
|
||||
identity_stats = {
|
||||
"repeater": {"count": 0, "clients": 0},
|
||||
"room_server": {"count": 0, "clients": 0},
|
||||
"companion": {"count": 0, "clients": 0},
|
||||
}
|
||||
|
||||
# Count repeater
|
||||
@@ -3430,6 +3477,18 @@ class APIEndpoints:
|
||||
else:
|
||||
guest_count += 1
|
||||
|
||||
# Count companions (no admin/guest; they use frame server, not OTA login)
|
||||
companions = identity_manager.get_identities_by_type("companion")
|
||||
identity_stats["companion"]["count"] = len(companions)
|
||||
|
||||
for name, identity, config in companions:
|
||||
hash_byte = identity.get_public_key()[0]
|
||||
acl = acl_dict.get(hash_byte)
|
||||
if acl:
|
||||
clients = acl.get_all_clients()
|
||||
identity_stats["companion"]["clients"] += len(clients)
|
||||
total_clients += len(clients)
|
||||
|
||||
return self._success(
|
||||
{
|
||||
"total_identities": len(acl_dict),
|
||||
|
||||
@@ -146,6 +146,23 @@ class CompanionAPIEndpoints:
|
||||
except (ValueError, TypeError) as exc:
|
||||
raise cherrypy.HTTPError(400, f"Invalid public key: {exc}")
|
||||
|
||||
def _get_sqlite_handler(self):
|
||||
"""Return the repeater's sqlite_handler, or raise 503 if unavailable."""
|
||||
if not self.daemon_instance:
|
||||
raise cherrypy.HTTPError(503, "Daemon not initialized")
|
||||
if (
|
||||
not hasattr(self.daemon_instance, "repeater_handler")
|
||||
or not self.daemon_instance.repeater_handler
|
||||
):
|
||||
raise cherrypy.HTTPError(503, "Repeater handler not initialized")
|
||||
storage = getattr(self.daemon_instance.repeater_handler, "storage", None)
|
||||
if not storage:
|
||||
raise cherrypy.HTTPError(503, "Storage not initialized")
|
||||
sqlite_handler = getattr(storage, "sqlite_handler", None)
|
||||
if not sqlite_handler:
|
||||
raise cherrypy.HTTPError(503, "SQLite storage not available")
|
||||
return sqlite_handler
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# SSE push-event plumbing
|
||||
# ------------------------------------------------------------------
|
||||
@@ -323,6 +340,75 @@ class CompanionAPIEndpoints:
|
||||
}
|
||||
)
|
||||
|
||||
@cherrypy.expose
|
||||
@cherrypy.tools.json_out()
|
||||
@require_auth
|
||||
def import_repeater_contacts(self, **kwargs):
|
||||
"""POST /api/companion/import_repeater_contacts {companion_name, contact_types?, hours?, limit?}
|
||||
|
||||
Import repeater adverts into this companion's contact store (one-time seed).
|
||||
Optional: contact_types (list), hours (only adverts seen in last N hours),
|
||||
limit (max contacts to import, capped by companion max_contacts).
|
||||
Results are sorted by last_seen DESC. After import, contacts are hot-reloaded.
|
||||
"""
|
||||
self._require_post()
|
||||
body = self._get_json_body()
|
||||
companion_name = body.get("companion_name")
|
||||
if not companion_name:
|
||||
raise cherrypy.HTTPError(400, "companion_name required")
|
||||
contact_types = body.get("contact_types")
|
||||
if contact_types is not None:
|
||||
if not isinstance(contact_types, list):
|
||||
raise cherrypy.HTTPError(400, "contact_types must be a list")
|
||||
allowed = {"companion", "repeater", "room_server", "sensor"}
|
||||
for t in contact_types:
|
||||
if not isinstance(t, str) or t not in allowed:
|
||||
raise cherrypy.HTTPError(
|
||||
400,
|
||||
f"contact_types must contain only: companion, repeater, room_server, sensor (got {t!r})",
|
||||
)
|
||||
if not contact_types:
|
||||
contact_types = None
|
||||
hours = body.get("hours")
|
||||
if hours is not None:
|
||||
try:
|
||||
hours = int(hours)
|
||||
except (TypeError, ValueError):
|
||||
raise cherrypy.HTTPError(400, "hours must be a positive integer")
|
||||
if hours < 1:
|
||||
raise cherrypy.HTTPError(400, "hours must be a positive integer")
|
||||
limit = body.get("limit")
|
||||
if limit is not None:
|
||||
try:
|
||||
limit = int(limit)
|
||||
except (TypeError, ValueError):
|
||||
raise cherrypy.HTTPError(400, "limit must be a positive integer")
|
||||
if limit < 1:
|
||||
raise cherrypy.HTTPError(400, "limit must be a positive integer")
|
||||
bridge = self._get_bridge(**self._resolve_bridge_params(body))
|
||||
if limit is not None:
|
||||
max_contacts = getattr(bridge, "max_contacts", 1000)
|
||||
limit = min(limit, max_contacts)
|
||||
companion_hash = getattr(bridge, "_companion_hash", None)
|
||||
if not companion_hash:
|
||||
raise cherrypy.HTTPError(503, "Companion hash not available")
|
||||
sqlite_handler = self._get_sqlite_handler()
|
||||
count = sqlite_handler.companion_import_repeater_contacts(
|
||||
companion_hash,
|
||||
contact_types=contact_types,
|
||||
hours=hours,
|
||||
limit=limit,
|
||||
)
|
||||
contact_rows = sqlite_handler.companion_load_contacts(companion_hash)
|
||||
if contact_rows:
|
||||
records = []
|
||||
for row in contact_rows:
|
||||
d = dict(row)
|
||||
d["public_key"] = d.pop("pubkey", d.get("public_key", b""))
|
||||
records.append(d)
|
||||
bridge.contacts.load_from_dicts(records)
|
||||
return self._success({"imported": count})
|
||||
|
||||
# ----- Channels -----
|
||||
|
||||
@cherrypy.expose
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
import{a as G,M as K,c as Q,r as o,o as W,P as X,b as g,e as a,g as k,i as F,t as l,k as h,n as ee,L as T,Y as te,Z as ae,p as f,x as se}from"./index-D0IT5vDS.js";import{P as M}from"./plotly.min-DO11Gp-n.js";import"./_commonjsHelpers-CqkleIqs.js";const oe={class:"p-6 space-y-6"},re={class:"glass-card rounded-[15px] p-6"},le={class:"flex justify-center"},ne={class:"flex gap-4"},ie=["disabled"],ce=["disabled"],de={class:"glass-card rounded-[15px] p-6 space-y-4"},ue={class:"text-content-primary dark:text-content-primary"},ve={key:0,class:"p-4 bg-primary/10 border border-primary/30 rounded-lg"},pe={class:"text-content-primary dark:text-primary"},me={class:"space-y-2"},be={class:"w-full bg-white/10 rounded-full h-2"},ge={class:"text-content-secondary dark:text-content-muted text-sm"},fe={class:"grid grid-cols-2 md:grid-cols-4 gap-4"},xe={class:"glass-card rounded-[15px] p-4 text-center"},ye={class:"text-2xl font-bold text-primary"},_e={class:"glass-card rounded-[15px] p-4 text-center"},ke={class:"text-2xl font-bold text-primary"},he={class:"glass-card rounded-[15px] p-4 text-center"},Ce={class:"text-2xl font-bold text-primary"},we={class:"glass-card rounded-[15px] p-4 text-center"},Re={class:"text-2xl font-bold text-primary"},Se={key:0,class:"glass-card rounded-[15px] p-6 space-y-4"},De={key:0,class:"p-4 bg-accent-green/10 border border-accent-green/30 rounded-lg"},Ae={class:"text-content-primary dark:text-content-primary mb-4"},Be={key:1,class:"p-4 bg-secondary/20 border border-secondary/40 rounded-lg"},Ee=G({name:"CADCalibrationView",__name:"CADCalibration",setup(Fe){const m=K(),I=Q(()=>document.documentElement.classList.contains("dark")),P=()=>{const e=I.value;return{title:e?"#F9FAFB":"#111827",subtitle:e?"#9CA3AF":"#6B7280",axis:e?"#D1D5DB":"#374151",tick:e?"#9CA3AF":"#6B7280",grid:e?"rgba(148, 163, 184, 0.1)":"rgba(107, 114, 128, 0.15)",zeroline:e?"rgba(148, 163, 184, 0.2)":"rgba(107, 114, 128, 0.25)",line:e?"rgba(148, 163, 184, 0.3)":"rgba(107, 114, 128, 0.35)",colorbarBorder:e?"rgba(255,255,255,0.2)":"rgba(0,0,0,0.15)",markerLine:e?"rgba(255,255,255,0.2)":"rgba(0,0,0,0.15)"}},u=o(!1),C=o(null),r=o(null),v=o({}),n=o(null),$=o([]),N=o({}),d=o("Ready to start calibration"),x=o(0),b=o(0),w=o(0),R=o(0),S=o(0),D=o(0),i=o(null),A=o(!1),B=o(!1),y=o(!1),_=o(!1);let c=null;const O={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 V(){const e=P(),t=[{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:e.axis,size:14}},tickfont:{color:e.tick},bgcolor:"rgba(0,0,0,0)",bordercolor:e.colorbarBorder,borderwidth:1,thickness:15},line:{color:e.markerLine,width:1}},hovertemplate:"<b>Peak:</b> %{x}<br><b>Min:</b> %{y}<br><b>Detection Rate:</b> %{marker.color:.1f}%<br><extra></extra>",name:"Test Results"}],s={title:{text:`CAD Detection Rate<br><sub style="color: ${e.subtitle};">Channel Activity Detection Calibration</sub>`,font:{color:e.title,size:18},x:.5},xaxis:{title:{text:"CAD Peak Threshold",font:{color:e.axis,size:14}},tickfont:{color:e.tick},gridcolor:e.grid,zerolinecolor:e.zeroline,linecolor:e.line},yaxis:{title:{text:"CAD Min Threshold",font:{color:e.axis,size:14}},tickfont:{color:e.tick},gridcolor:e.grid,zerolinecolor:e.zeroline,linecolor:e.line},plot_bgcolor:"rgba(0, 0, 0, 0)",paper_bgcolor:"rgba(0, 0, 0, 0)",font:{color:e.title,family:"Inter, system-ui, sans-serif"},margin:{l:80,r:80,t:100,b:80},showlegend:!1};M.newPlot("plotly-chart",t,s,O)}function j(){if(Object.keys(v.value).length===0)return;const e=Object.values(v.value),t=[],s=[],p=[];for(const E of e)t.push(E.det_peak),s.push(E.det_min),p.push(E.detection_rate);const q={x:[t],y:[s],"marker.color":[p],hovertemplate:"<b>Peak:</b> %{x}<br><b>Min:</b> %{y}<br><b>Detection Rate:</b> %{marker.color:.1f}%<br><b>Status:</b> Tested<br><extra></extra>"};M.restyle("plotly-chart",q,[0])}async function U(){try{const s=await T.post("/cad-calibration-start",{samples:10,delay_ms:50});if(s.success)u.value=!0,C.value=Date.now(),m.setCadCalibrationRunning(!0),v.value={},$.value=[],N.value={},n.value=null,A.value=!1,B.value=!1,y.value=!1,_.value=!1,w.value=0,R.value=0,S.value=0,D.value=0,x.value=0,b.value=0,c=setInterval(()=>{C.value&&(D.value=Math.floor((Date.now()-C.value)/1e3))},1e3),L();else throw new Error(s.error||"Failed to start calibration")}catch(s){d.value=`Error: ${s instanceof Error?s.message:"Unknown error"}`}}async function z(){try{(await T.post("/cad-calibration-stop")).success&&(u.value=!1,m.setCadCalibrationRunning(!1),r.value&&(r.value.close(),r.value=null),c&&(clearInterval(c),c=null))}catch(e){console.error("Failed to stop calibration:",e)}}function L(){r.value&&r.value.cLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
import{a as ee,r as u,D as q,c as oe,b as d,g,e,k as j,t as p,w as b,$ as X,F as L,h as z,u as ne,W as G,v as _,s as se,L as A,p as i,E as Q,o as ae,f as K,i as le,j as Z}from"./index-D0IT5vDS.js";import{_ as de}from"./ConfirmDialog.vue_vue_type_script_setup_true_lang-CidOa_xU.js";import{_ as ie}from"./MessageDialog.vue_vue_type_script_setup_true_lang-C6ugQFfD.js";const ue={id:"import-modal-description",class:"text-content-secondary dark:text-content-muted text-sm mb-4"},ce={class:"mb-4"},pe={class:"flex items-center gap-2 mb-2"},me={key:0,class:"text-content-muted dark:text-content-muted text-xs mb-2"},be={key:1,class:"flex flex-wrap gap-3 ml-6"},ve=["value"],xe={class:"text-content-primary dark:text-content-primary text-sm capitalize"},ye={class:"border-t border-stroke-subtle dark:border-white/10 pt-4 mt-4 mb-4"},ke={class:"flex flex-wrap gap-3 mb-2"},ge=["value"],fe={class:"text-content-primary dark:text-content-primary text-sm"},we={class:"flex flex-wrap items-center gap-2 mt-2"},he={class:"flex items-center gap-2"},_e={key:1,class:"text-content-muted dark:text-content-muted text-sm"},Ce={class:"border-t border-stroke-subtle dark:border-white/10 pt-4 mt-4 mb-4"},$e={class:"flex flex-wrap items-center gap-2"},Ie={key:0,role:"alert",class:"mb-4 p-3 rounded-lg bg-accent-red/10 dark:bg-accent-red/20 border border-accent-red/30 text-accent-red text-sm"},Me={key:1,class:"text-content-muted dark:text-content-muted text-sm mb-4"},Ne={class:"flex justify-end gap-3"},Ee=["disabled"],Ve=["disabled"],Se=ee({name:"ImportRepeaterContactsModal",__name:"ImportRepeaterContactsModal",props:{isOpen:{type:Boolean},companionName:{}},emits:["close","imported"],setup(Y,{emit:P}){const I=["companion","repeater","room_server","sensor"],V=[{label:"All time",value:null},{label:"Last 24 hours",value:24},{label:"Last 7 days",value:168},{label:"Last 30 days",value:720},{label:"Custom",value:"custom"}].slice(0,4),N=Y,l=P,f=u(!1),v=u(null),x=u(!0),y=u([]),m=u(null),M=u(""),C=u(""),S=u(null),T=u(null);function c(){const a=m.value;if(a===null||a==="custom"){if(a==="custom"){const r=M.value;if(r===""||r===null)return;const s=Number(r);return Number.isInteger(s)&&s>=1?s:void 0}return}return a}function $(){const a=C.value;if(a===""||a===null)return;const r=Number(a);return Number.isInteger(r)&&r>=1?r:void 0}function D(){x.value=!0,y.value=[],m.value=null,M.value="",C.value="",v.value=null}q(()=>N.isOpen,a=>{a&&(D(),Q(()=>{T.value?.focus()}))}),q(m,a=>{a==="custom"&&Q(()=>{S.value?.focus()})});const O=oe(()=>{const a=x.value?"All types":y.value.map(R=>R.replace("_"," ")).join(", ");let r;const s=m.value;if(s===null)r="all time";else if(s==="custom"){const R=c();r=R!==void 0?`last ${R} hours`:"custom"}else s===24?r="last 24 hours":s===168?r="last 7 days":s===720?r="last 30 days":r="all time";const k=$(),h=k!==void 0?`max ${k} contacts`:"no limit";return`Import: ${a}, ${r}, ${h}.`});function F(){if(m.value==="custom"){const r=c();if(r===void 0||r<1)return"Custom recency must be at least 1 hour."}const a=$();if(C.value!==""&&(a===void 0||a<1))return"Limit must be at least 1.";if(!x.value&&y.value.length===0)return"Select at least one contact type or use All types.";if(!x.value){const r=y.value.filter(s=>!I.includes(s));if(r.length>0)return`Invalid contact type: ${r.join(", ")}`}return null}async function H(){v.value=null;const a=F();if(a){v.value=a;return}const r={companion_name:N.companionName};!x.value&&y.value.length>0&&(r.contact_types=[...y.value]);const s=c();s!==void 0&&(r.hours=s);const k=$();k!==void 0&&(r.limit=k),f.value=!0;try{const h=await A.importRepeaterContacts(r);h.success&&h.data?(l("imported",h.data.imported),l("close")):v.value=h.error||"Import failed."}catch(h){v.value=h instanceof Error?h.message:"Import failed."}finally{f.value=!1}}function w(a){a.target===a.currentTarget&&l("close")}function B(a){a.key==="Escape"&&l("close")}return(a,r)=>a.isOpen?(i(),d("div",{key:0,class:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",onClick:w,onKeydown:B},[e("div",{role:"dialog","aria-describedby":"import-modal-description",class:"bg-white dark:bg-surface-elevated backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-6 max-w-lg w-full max-h-[90vh] overflow-y-auto",onClick:r[7]||(r[7]=se(()=>{},["stop"]))},[r[18]||(r[18]=e("h2",{class:"text-xl font-bold text-content-primary dark:text-content-primary mb-4"}," Import repeater contacts ",-1)),e("p",ue,[r[8]||(r[8]=j(" Seed ",-1)),e("strong",null,p(a.companionName),1),r[9]||(r[9]=j(" with contacts from the repeater's adverts. Results are ordered by most recent first. ",-1))]),e("div",ce,[r[11]||(r[11]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"}," Contact types ",-1)),e("label",pe,[b(e("input",{ref_key:"firstFocusRef",ref:T,"onUpdate:modelValue":r[0]||(r[0]=s=>x.value=s),type:"checkbox",class:"rounded border-stroke-subtle dark:border-stroke/20 text-primary focus:ring-primary/50"},null,512),[[Line truncated
|
||||
@@ -0,0 +1,2 @@
|
||||
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/leaflet-src-BtisrQHC.js","assets/_commonjsHelpers-CqkleIqs.js"])))=>i.map(i=>d[i]);
|
||||
import{a as q,M as re,c as T,r as m,D as te,b as r,g as L,e,t as u,F as U,w as S,v as V,h as J,q as ee,k as H,L as K,p as o,P as we,s as G,E as ie,S as me,x as pe,f as R,y as de,d as _e,U as ce,j as D,l as ve,N as xe,V as be,T as Ce,i as W,W as ne,o as ae,u as X,X as $e,Q as Z}from"./index-D0IT5vDS.js";/* empty css */import{_ as Me}from"./ConfirmDialog.vue_vue_type_script_setup_true_lang-CidOa_xU.js";import{g as Ae,s as Se}from"./preferences-DtwbSSgO.js";const je={class:"space-y-4"},Te={key:0,class:"bg-green-100 dark:bg-green-500/20 border border-green-500/50 rounded-lg p-3"},Ne={class:"text-green-600 dark:text-green-400 text-sm"},Be={key:1,class:"bg-red-100 dark:bg-red-500/20 border border-red-500/50 rounded-lg p-3"},Ee={class:"text-red-600 dark:text-red-400 text-sm"},Le={class:"flex justify-end gap-2"},Fe=["disabled"],Pe=["disabled"],ze={class:"bg-background-mute dark:bg-white/5 rounded-lg p-3 sm:p-4 space-y-3"},Ve={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1"},De={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm"},Ie={key:1,class:"flex items-center gap-2"},He={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1"},Ue={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm"},Re={key:1},Ke=["value"],Oe={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1"},qe={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm"},We={key:1},Ge=["value"],Qe={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1"},Ye={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm"},Xe={key:1,class:"flex items-center gap-2"},Je={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1"},Ze={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm"},et={key:1},tt={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 gap-1"},ot={class:"text-content-primary dark:text-content-primary font-mono text-sm"},rt={key:2,class:"bg-yellow-500/10 dark:bg-yellow-500/10 border border-yellow-500/30 rounded-lg p-3"},st=q({__name:"RadioSettings",setup(I){const _=re(),i=T(()=>_.stats?.config?.radio||{}),x=m(!1),g=m(!1),c=m(null),p=m(null),s=m(0),v=m(0),f=m(0),h=m(0),E=m(0),A=m(0),$=[{value:7.8,label:"7.8 kHz"},{value:10.4,label:"10.4 kHz"},{value:15.6,label:"15.6 kHz"},{value:20.8,label:"20.8 kHz"},{value:31.25,label:"31.25 kHz"},{value:41.7,label:"41.7 kHz"},{value:62.5,label:"62.5 kHz"},{value:125,label:"125 kHz"},{value:250,label:"250 kHz"},{value:500,label:"500 kHz"}];te(i,C=>{C&&!x.value&&(s.value=C.frequency?Number((C.frequency/1e6).toFixed(3)):0,v.value=C.spreading_factor??0,f.value=C.bandwidth?Number((C.bandwidth/1e3).toFixed(1)):0,h.value=C.tx_power??0,E.value=C.coding_rate??0,A.value=C.preamble_length??0)},{immediate:!0});const n=T(()=>{const C=i.value.frequency;return C?(C/1e6).toFixed(3)+" MHz":"Not set"}),t=T(()=>{const C=i.value.bandwidth;return C?(C/1e3).toFixed(1)+" kHz":"Not set"}),a=T(()=>{const C=i.value.tx_power;return C!==void 0?C+" dBm":"Not set"}),j=T(()=>{const C=i.value.coding_rate;return C?"4/"+C:"Not set"}),k=T(()=>{const C=i.value.preamble_length;return C?C+" symbols":"Not set"}),b=T(()=>i.value.spreading_factor??"Not set"),y=()=>{x.value=!0,c.value=null,p.value=null},z=()=>{x.value=!1,c.value=null;const C=i.value;s.value=C.frequency?Number((C.frequency/1e6).toFixed(3)):0,v.value=C.spreading_factor??0,f.value=C.bandwidth?Number((C.bandwidth/1e3).toFixed(1)):0,h.value=C.tx_power??0,E.value=C.coding_rate??0,A.value=C.preamble_length??0},O=async()=>{g.value=!0,c.value=null,p.value=null;try{const C={};s.value&&(C.frequency=s.value*1e6),v.value&&(C.spreading_factor=v.value),f.value&&(C.bandwidth=f.value*1e3),h.value&&(C.tx_power=h.value),E.value&&(C.coding_rate=E.value);const P=(await K.post("/update_radio_config",C)).data;P.message||P.persisted?(p.value=P.message||"Settings saved successfully",x.value=!1,await _.fetchStats(),setTimeout(()=>{p.value=null},3e3)):P.error?c.value=P.error:c.value="Unknown response from server"}catch(C){console.error("Failed to update radio settings:",C);const N=C;c.value=N.response?.data?.error||"Failed to update settings"}finally{g.value=!1}};return(C,N)=>(o(),r("div",je,[p.value?(o(),r("div",Te,[e("p",Ne,u(p.value),1)])):L("",!0),c.value?(o(),r("div",Be,[e("p",Ee,u(c.value),1)])):L("",!0),e("div",Le,[x.value?(o(),r(U,{key:1},[e("button",{onClick:z,disabled:g.value,class:"px-3 sm:px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg border border-stroke-subtle darkLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
import{a as p,b as n,g as m,e as t,s as g,t as s,j as d,p as l}from"./index-D0IT5vDS.js";const f={class:"flex items-center justify-between mb-4"},w={class:"text-xl font-semibold text-content-primary dark:text-content-primary"},v={class:"mb-6"},h={key:0,class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},y={key:1,class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},C={key:2,class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},B={class:"text-content-secondary dark:text-content-primary/80 text-base leading-relaxed"},j={class:"flex gap-3"},_=p({__name:"ConfirmDialog",props:{show:{type:Boolean},title:{default:"Confirm Action"},message:{},confirmText:{default:"Confirm"},cancelText:{default:"Cancel"},variant:{default:"warning"}},emits:["close","confirm"],setup(c,{emit:b}){const o=c,r=b,u=i=>{i.target===i.currentTarget&&r("close")},k={danger:"bg-red-100 dark:bg-red-500/20 border-red-500/30 text-red-600 dark:text-red-400",warning:"bg-yellow-100 dark:bg-yellow-500/20 border-yellow-500/30 text-yellow-600 dark:text-yellow-400",info:"bg-blue-500/20 border-blue-500/30 text-blue-600 dark:text-blue-400"},x={danger:"bg-red-500 hover:bg-red-600",warning:"bg-yellow-500 hover:bg-yellow-600",info:"bg-blue-500 hover:bg-blue-600"};return(i,e)=>o.show?(l(),n("div",{key:0,onClick:u,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"}},[t("div",{class:"bg-white dark:bg-surface-elevated backdrop-blur-xl rounded-[20px] p-6 w-full max-w-md border border-stroke-subtle dark:border-white/10",onClick:e[3]||(e[3]=g(()=>{},["stop"]))},[t("div",f,[t("h3",w,s(o.title),1),t("button",{onClick:e[0]||(e[0]=a=>r("close")),class:"text-content-secondary dark:text-content-muted hover:text-content-primary dark:hover:text-content-primary transition-colors"},e[4]||(e[4]=[t("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),t("div",v,[t("div",{class:d(["inline-flex p-3 rounded-xl mb-4",k[o.variant]])},[o.variant==="danger"?(l(),n("svg",h,e[5]||(e[5]=[t("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-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"},null,-1)]))):o.variant==="warning"?(l(),n("svg",y,e[6]||(e[6]=[t("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-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"},null,-1)]))):(l(),n("svg",C,e[7]||(e[7]=[t("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)])))],2),t("p",B,s(o.message),1)]),t("div",j,[t("button",{onClick:e[1]||(e[1]=a=>r("close")),class:"flex-1 px-4 py-3 rounded-xl bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary transition-all duration-200 border border-stroke-subtle dark:border-stroke/10"},s(o.cancelText),1),t("button",{onClick:e[2]||(e[2]=a=>r("confirm")),class:d(["flex-1 px-4 py-3 rounded-xl text-white transition-all duration-200",x[o.variant]])},s(o.confirmText),3)])])])):m("",!0)}});export{_};
|
||||
@@ -0,0 +1,2 @@
|
||||
import{C as wt,a as Nt,L as Bt,P as Ft,b as Et,c as jt,i as It}from"./chart-B185MtDy.js";import{a as ct,r as B,c as Y,D as et,o as bt,E as dt,H as vt,b as l,e as t,t as n,g as k,n as ut,I as Lt,p as r,x as mt,J as gt,K as kt,f as st,F as H,h as Q,L as ft,M as Ut,i as Rt,u as pt,k as rt,N as Vt,T as Ht,l as zt,O as Xt,j as T,s as Gt,w as $t,q as Tt}from"./index-D0IT5vDS.js";import{u as Ot}from"./useSignalQuality-DvX3fQnP.js";import{g as Ct,s as St}from"./preferences-DtwbSSgO.js";const Wt={class:"sparkline-card"},Qt={class:"card-header"},qt={class:"card-title"},Kt={class:"card-values"},Jt={class:"card-chart"},Yt=ct({name:"ChartSparkline",__name:"ChartSparkline",props:{title:{},value:{},color:{},data:{default:()=>[]},showChart:{type:Boolean,default:!0},secondaryValue:{default:void 0},secondaryLabel:{default:""},secondaryColor:{default:""},secondaryData:{default:()=>[]}},setup(nt){wt.register(Nt,Bt,Ft,Et,jt,It);const _=nt,q=B(null),m=B(null),C=h=>{if(h.length<3)return h;const F=Math.min(15,Math.max(3,Math.floor(h.length*.2))),O=[];for(let S=0;S<h.length;S++){const x=Math.floor(F/2),d=Math.max(0,S-x),v=Math.min(h.length,S+x+1),g=h.slice(d,v);O.push(g.reduce((N,w)=>N+w,0)/g.length)}const G=Math.min(12,O.length),E=O.length/G,M=[];for(let S=0;S<G;S++){const x=Math.floor(S*E);M.push(O[x])}return M},$=Y(()=>!_.data||_.data.length===0?[]:C(_.data)),A=Y(()=>!_.secondaryData||_.secondaryData.length===0?[]:C(_.secondaryData)),X=()=>{if(!q.value)return;const h=q.value.getContext("2d");if(!h)return;m.value&&(m.value.destroy(),m.value=null);const F=$.value;if(F.length<2)return;const O=[{data:F,borderColor:_.color,borderWidth:2.5,fill:!1,tension:.4,pointRadius:0,pointHoverRadius:0}],G=A.value;G.length>=2&&_.secondaryColor&&O.push({data:G,borderColor:_.secondaryColor,borderWidth:2,borderDash:[4,3],fill:!1,tension:.4,pointRadius:0,pointHoverRadius:0}),m.value=Lt(new wt(h,{type:"line",data:{labels:F.map((E,M)=>M.toString()),datasets:O},options:{responsive:!0,maintainAspectRatio:!1,animation:{duration:800,easing:"easeOutQuart"},plugins:{legend:{display:!1},tooltip:{enabled:!1}},scales:{x:{display:!1,grid:{display:!1}},y:{display:!1,grid:{display:!1},grace:"10%"}},elements:{line:{capBezierPoints:!0}}}}))},D=()=>{if(!m.value){X();return}const h=$.value;if(h.length<2)return;m.value.data.labels=h.map((O,G)=>G.toString()),m.value.data.datasets[0].data=h;const F=A.value;F.length>=2&&_.secondaryColor&&(m.value.data.datasets.length<2?m.value.data.datasets.push({data:F,borderColor:_.secondaryColor,borderWidth:2,borderDash:[4,3],fill:!1,tension:.4,pointRadius:0,pointHoverRadius:0}):m.value.data.datasets[1].data=F),m.value.update("default")};return et(()=>_.data,()=>{dt(()=>D())},{deep:!0}),et(()=>_.color,()=>{m.value&&(m.value.data.datasets[0].borderColor=_.color,m.value.update("none"))}),bt(()=>{dt(()=>X())}),vt(()=>{m.value&&(m.value.destroy(),m.value=null)}),(h,F)=>(r(),l("div",Wt,[t("div",Qt,[t("p",qt,n(h.title),1),t("div",Kt,[t("span",{class:"card-value",style:ut({color:h.color})},n(typeof h.value=="number"?h.value.toLocaleString():h.value),5),h.secondaryValue!==void 0?(r(),l("span",{key:0,class:"card-secondary-value",style:ut({color:h.secondaryColor})},n(h.secondaryLabel)+n(typeof h.secondaryValue=="number"?h.secondaryValue.toLocaleString():h.secondaryValue),5)):k("",!0)])]),t("div",Jt,[h.showChart?(r(),l("canvas",{key:0,ref_key:"canvasRef",ref:q},null,512)):k("",!0)])]))}}),xt=mt(Yt,[["__scopeId","data-v-814635af"]]),Zt={class:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-3 lg:gap-4 mb-5 stats-cards-container"},te=ct({name:"StatsCards",__name:"StatsCards",setup(nt){const _=gt(),q=kt(),m=B(null),C=B(null),$=B(!1),A=Y(()=>{const h=_.packetStats,F=_.systemStats,O=S=>{const x=Math.floor(S/86400),d=Math.floor(S%86400/3600),v=Math.floor(S%3600/60);return x>0?`${x}d ${d}h`:d>0?`${d}h ${v}m`:`${v}m`},G=h?.total_packets||0,E=h?.dropped_packets||0,M=G>0?Math.round(E/G*100):0;return{packetsReceived:G,packetsForwarded:h?.transmitted_packets||0,uptimeFormatted:F?O(F.uptime_seconds||0):"0m",uptimeHours:F?Math.floor((F.uptime_seconds||0)/3600):0,droppedPackets:E,dropPercent:`${M}%`,signalQuality:Math.round((h?.avg_rssi||0)+120),crcErrorCount:_.crcErrorCount}}),X=Y(()=>_.sparklineData),D=async()=>{if(!$.value)try{$.value=!0,await Promise.all([_.fetchSystemStats(),_.fetchPacketStats({hours:24})]),await dt()}catch(h){console.error("Error fetching stats:",h)}finally{$.value=!1}};return bt(async()=>{await _.initializeSparklineHistory(),D(),q.isConnected||(m.value=window.setInterval(D,3e4)),C.value=window.setInterval(()=>{_.interpolateRates()},6e4)}),et(()=>q.isConnected,h=>{h?m.value&&(clearInterval(m.value),m.value=null):m.value||(m.value=window.setInterval(D,3e4))}),vt(()=>{m.value&&clearInterval(m.value),C.value&&clearInterval(C.value)}),(h,F)=>(r(),l("div",Zt,[st(xt,{title:"Up Time",value:A.value.uptimeFormatted,color:"#EBA0FC",data:[],showChart:!1,class:"stat-card"},null,8,["value"]),st(xt,{title:"RX Packets",value:A.value.packetsReceived,Line truncated
|
||||
`)||s},G=(s,e,u)=>{try{let i=0;const o=e.length/2;if(o>=100){if(e.length>=i+64){const y=e.slice(i,i+64);s.push({name:"Public Key",byteRange:`${(u+i)/2}-${(u+i+63)/2}`,hexData:y.match(/.{8}/g)?.join(" ")||y,description:"Ed25519 public key of the node (32 bytes)",fields:[{bits:"0-255",name:"Ed25519 Public Key",value:`${y.slice(0,16)}...${y.slice(-16)}`,binary:"32 bytes (256 bits)"}]}),i+=64}if(e.length>=i+8){const y=e.slice(i,i+8),f=parseInt(y,16),R=new Date(f*1e3);s.push({name:"Timestamp",byteRange:`${(u+i)/2}-${(u+i+7)/2}`,hexData:y.match(/.{2}/g)?.join(" ")||y,description:"Unix timestamp of advertisement",fields:[{bits:"0-31",name:"Unix Timestamp",value:`${f} (${R.toLocaleString()})`,binary:f.toString(2).padStart(32,"0")}]}),i+=8}if(e.length>=i+128){const y=e.slice(i,i+128);s.push({name:"Signature",byteRange:`${(u+i)/2}-${(u+i+127)/2}`,hexData:y.match(/.{8}/g)?.join(" ")||y,description:"Ed25519 signature of public key, timestamp, and appdata",fields:[{bits:"0-511",name:"Ed25519 Signature",value:`${y.slice(0,16)}...${y.slice(-16)}`,binary:"64 bytes (512 bits)"}]}),i+=128}if(e.length>i){const y=e.slice(i);E(s,y,u+i)}}else s.push({name:"ADVERT AppData (Partial)",byteRange:`${u/2}-${u/2+o-1}`,hexData:e.match(/.{2}/g)?.join(" ")||e,description:`Partial ADVERT data - appears to be just AppData portion (${o} bytes)`,fields:[{bits:`0-${o*8-1}`,name:"Partial Data",value:`${o} bytes - attempting to decode as AppData`,binary:`${o} bytes (${o*8} bits)`}]}),E(s,e,u)}catch(i){s.push({name:"ADVERT Parse Error",byteRange:"N/A",hexData:e.slice(0,32)+"...",description:"Failed to parse ADVERT payload structure",fields:[{bits:"N/A",name:"Error",value:`Parse error: ${i instanceof Error?i.message:"Unknown error"}`,binary:"Invalid"}]})}},E=(s,e,u)=>{try{const i=e.length/2;s.push({name:"AppData",byteRange:`${u/2}-${u/2+i-1}`,hexData:e.match(/.{2}/g)?.join(" ")||e,description:`Node advertisement application data (${i} bytes)`,fields:[{bits:`0-${i*8-1}`,name:"Application Data",value:`${i} bytes (contains flags, location, name, etc.)`,binary:`${i} bytes (${i*8} bits)`}]});let o=0;if(e.length>=2){const y=parseInt(e.slice(o,o+2),16),f=[],R=!!(y&16),j=!!(y&32),U=!!(y&64),at=!!(y&128);if(y&1&&f.push("is chat node"),y&2&&f.push("is repeater"),y&4&&f.push("is room server"),y&8&&f.push("is sensor"),R&&f.push("has location"),j&&f.push("has feature 1"),U&&f.push("has feature 2"),at&&f.push("has name"),s.push({name:"AppData Flags",byteRange:`${(u+o)/2}`,hexData:`0x${e.slice(o,o+2)}`,description:"Flags indicating which optional fields are present",fields:[{bits:"0-7",name:"Flags",value:f.join(", ")||"none",binary:y.toString(2).padStart(8,"0")}]}),o+=2,R&&e.length>=o+16){const I=e.slice(o,o+8),K=[];for(let p=6;p>=0;p-=2)K.push(I.slice(p,p+2));const V=parseInt(K.join(""),16),b=V>2147483647?V-4294967296:V,P=b/1e6,z=e.slice(o+8,o+16),L=[];for(let p=6;p>=0;p-=2)L.push(z.slice(p,p+2));const tt=parseInt(L.join(""),16),J=tt>2147483647?tt-4294967296:tt,lt=J/1e6;s.push({name:"Location Data",byteRange:`${(u+o)/2}-${(u+o+15)/2}`,hexData:`${I.match(/.{2}/g)?.join(" ")||I} ${z.match(/.{2}/g)?.join(" ")||z}`,description:"GPS coordinates (latitude and longitude)",fields:[{bits:"0-31",name:"Latitude",value:`${P.toFixed(6)}° (raw: ${b})`,binary:b.toString(2).padStart(32,"0")},{bits:"32-63",name:"Longitude",value:`${lt.toFixed(6)}° (raw: ${J})`,binary:J.toString(2).padStart(32,"0")}]}),o+=16}if(j&&e.length>=o+4){const I=e.slice(o,o+4),K=parseInt(I,16);s.push({name:"Feature 1",byteRange:`${(u+o)/2}-${(u+o+3)/2}`,hexData:I.match(/.{2}/g)?.join(" ")||I,description:"Reserved feature 1 (2 bytes)",fields:[{bits:"0-15",name:"Feature 1 Value",value:`${K}`,binary:K.toString(2).padStart(16,"0")}]}),o+=4}if(U&&e.length>=o+4){const I=e.slice(o,o+4),K=parseInt(I,16);s.push({name:"Feature 2",byteRange:`${(u+o)/2}-${(u+o+3)/2}`,hexData:I.match(/.{2}/g)?.join(" ")||I,description:"Reserved feature 2 (2 bytes)",fields:[{bits:"0-15",name:"Feature 2 Value",value:`${K}`,binary:K.toString(2).padStart(16,"0")}]}),o+=4}if(at&&e.length>o){const I=e.slice(o),K=I.match(/.{2}/g)||[],V=K.map(b=>{const P=parseInt(b,16);return P>=32&&P<=126?String.fromCharCode(P):"."}).join("").replace(/\.+$/,"");s.push({name:"Node Name",byteRange:`${(u+o)/2}-${(u+e.length-1)/2}`,hexData:I.match(/.{2}/g)?.join(" ")||I,description:`Node name string (${K.length} bytes)`,fields:[{bits:`0-${K.length*8-1}`,name:"Node Name",value:`"${V}"`,binary:`ASCII text (${K.length} bytes)`}]})}}}catch(i){s.push({name:"AppData Parse Error",byteRange:"N/A",hexData:e.slice(0,Math.min(32,e.length)),description:"Failed to parse AppData structure",fields:[{bits:"N/A",name:"Error",value:`Parse error: ${i instanceof Error?i.message:"Unknown error"}`,binary:"Invalid"}]})}},M=s=>{if(!s)return[];if(Array.isArray(s))return s;if(typeof s=="string")try{return JSON.parse(s)}catch{return[]}return[]},S=s=>{const e=[];if(!s)return e;try{const u=s.raw_packet;if(u){const i=u.replace(/\s+/g,"").toUpperCase();let o=0;if(i.length>=2){const y=i.sl
Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
import{a as e,b as r,i as o,p as n}from"./index-D0IT5vDS.js";const d=e({name:"HelpView",__name:"Help",setup(a){return(i,t)=>(n(),r("div",null,t[0]||(t[0]=[o('<div class="glass-card backdrop-blur border border-stroke-subtle dark:border-white/10 rounded-[15px] p-8"><h1 class="text-content-primary dark:text-content-primary text-2xl font-semibold mb-6">Help & Documentation</h1><div class="text-center py-12"><div class="text-primary mb-6"><svg class="w-20 h-20 mx-auto mb-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.746 0 3.332.477 4.5 1.253v13C19.832 18.477 18.246 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"></path></svg></div><h2 class="text-content-primary dark:text-content-primary text-xl font-medium mb-3">pyMC Repeater Wiki</h2><p class="text-content-secondary dark:text-content-muted mb-8 max-w-md mx-auto"> Access documentation, setup guides, troubleshooting tips, and community resources on our official wiki. </p><a href="https://github.com/rightup/pyMC_Repeater/wiki" target="_blank" rel="noopener noreferrer" class="inline-flex items-center gap-2 bg-primary hover:bg-primary/80 text-white dark:text-background font-medium py-3 px-6 rounded-xl transition-colors duration-200"><svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"></path></svg> Visit Wiki Documentation </a><div class="mt-8 text-xs text-content-muted dark:text-content-muted"> Opens in a new tab </div></div></div>',1)])))}});export{d as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{a as P,r as a,b as i,g,s as _,e,w as v,v as h,t as y,k as M,y as S,p as u,f as w,_ as $,i as N,G as j,C as B,z as D,m as I,A as L,B as C,x as U}from"./index-D0IT5vDS.js";const q={class:"glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/20 rounded-[15px] p-6 max-w-md w-full shadow-2xl"},E={key:0,class:"bg-red-500/10 border border-red-500/30 rounded-lg p-3"},z={class:"text-red-600 dark:text-red-400 text-sm"},T={key:1,class:"bg-green-500/10 border border-green-600/40 dark:border-green-500/30 rounded-lg p-3"},G={class:"text-green-600 dark:text-green-400 text-sm"},H={class:"flex justify-end gap-3 mt-6"},F=["disabled"],O=["disabled"],R={key:0,class:"w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin"},A=P({name:"ChangePasswordModal",__name:"ChangePasswordModal",props:{isOpen:{type:Boolean},canSkip:{type:Boolean,default:!0}},emits:["close","success"],setup(V,{emit:x}){const p=x,l=a(""),s=a(""),d=a(""),o=a(!1),n=a(""),m=a(""),f=()=>{o.value||p("close")},k=()=>{p("close")},c=async()=>{if(n.value="",m.value="",s.value.length<8){n.value="New password must be at least 8 characters long";return}if(s.value!==d.value){n.value="Passwords do not match";return}if(s.value===l.value){n.value="New password must be different from current password";return}o.value=!0;try{const r=(await S.post("/auth/change_password",{current_password:l.value,new_password:s.value})).data;r&&r.success?(m.value=r.message||"Password changed successfully!",setTimeout(()=>{p("success"),p("close")},1500)):n.value=r?.error||"Failed to change password"}catch(t){console.error("Password change error:",t),n.value=t.response?.data?.error||"Failed to change password. Please try again."}finally{o.value=!1}};return(t,r)=>t.isOpen?(u(),i("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",onClick:_(f,["self"])},[e("div",q,[r[6]||(r[6]=e("h3",{class:"text-xl font-semibold text-content-primary dark:text-content-primary mb-2"},"Change Default Password",-1)),r[7]||(r[7]=e("p",{class:"text-content-secondary dark:text-content-muted text-sm mb-6"}," You're using the default password. Please change it to secure your account. ",-1)),e("form",{onSubmit:_(c,["prevent"]),class:"space-y-4"},[e("div",null,[r[3]||(r[3]=e("label",{class:"block text-sm font-medium text-content-secondary dark:text-content-primary/70 mb-2"},"Current Password",-1)),v(e("input",{"onUpdate:modelValue":r[0]||(r[0]=b=>l.value=b),type:"password",required:"",class:"w-full px-4 py-2 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary transition-colors",placeholder:"Enter current password"},null,512),[[h,l.value]])]),e("div",null,[r[4]||(r[4]=e("label",{class:"block text-sm font-medium text-content-secondary dark:text-content-primary/70 mb-2"},"New Password",-1)),v(e("input",{"onUpdate:modelValue":r[1]||(r[1]=b=>s.value=b),type:"password",required:"",minlength:"8",class:"w-full px-4 py-2 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary transition-colors",placeholder:"Enter new password (min 8 characters)"},null,512),[[h,s.value]])]),e("div",null,[r[5]||(r[5]=e("label",{class:"block text-sm font-medium text-content-secondary dark:text-content-primary/70 mb-2"},"Confirm New Password",-1)),v(e("input",{"onUpdate:modelValue":r[2]||(r[2]=b=>d.value=b),type:"password",required:"",minlength:"8",class:"w-full px-4 py-2 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary transition-colors",placeholder:"Confirm new password"},null,512),[[h,d.value]])]),n.value?(u(),i("div",E,[e("p",z,y(n.value),1)])):g("",!0),m.value?(u(),i("div",T,[e("p",G,y(m.value),1)])):g("",!0),e("div",H,[t.canSkip?(u(),i("button",{key:0,type:"button",onClick:k,disabled:o.value,class:"px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg border border-stroke-subtle dark:border-stroke/10 transition-colors disabled:opacity-50"}," Skip for Now ",8,F)):g("",!0),e("button",{type:"submit",disabled:o.value,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-white rounded-lg border border-primary/50 transition-colors disabled:opacity-50 flex items-center gap-2"},[o.value?(u(),i("div",R)):g("",!0),M(" "+y(o.value?"Changing...":"Change Password"),1)],8,O)])],32)])])):g("",!0)}}),Y={class:"min-h-screen bg-background dark:bg-background overflow-hidden relative flex items-start sm:items-center justify-center p-2 sm:p-4 pt-8 sm:pt-4"},J={class:"absolute toLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
import{a as j,r as i,c as w,o as H,H as T,b as s,e as o,k as $,j as h,t as c,g as q,F as L,h as N,i as J,L as K,p as n}from"./index-D0IT5vDS.js";const P={class:"space-y-6"},Q={class:"glass-card backdrop-blur border border-stroke-subtle dark:border-white/10 rounded-[15px] p-6"},X={class:"flex items-center justify-between mb-4"},Y=["disabled"],Z={class:"bg-gray-50 dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg p-4"},ee={class:"flex flex-wrap gap-2"},te=["onClick"],re={key:0,class:"w-px h-6 bg-stroke-subtle dark:bg-stroke/20 mx-2 self-center"},oe=["onClick"],se={class:"glass-card backdrop-blur border border-stroke-subtle dark:border-white/10 rounded-[15px] overflow-hidden"},ne={key:0,class:"p-8 text-center"},ae={key:1,class:"p-8 text-center"},le={class:"text-content-secondary dark:text-content-muted mb-4"},de={key:2,class:"max-h-[600px] overflow-y-auto"},ce={key:0,class:"p-8 text-center"},ie={key:1,class:"divide-y divide-gray-200 dark:divide-white/5"},ue={class:"flex-shrink-0 text-content-secondary dark:text-content-muted"},ge={class:"flex-shrink-0 px-2 py-1 text-xs font-medium rounded bg-blue-500/20 text-blue-600 dark:text-blue-400"},be={class:"text-content-primary dark:text-content-primary flex-1 break-all"},ve=j({name:"LogsView",__name:"Logs",setup(xe){const x=i([]),a=i(new Set),d=i(new Set(["DEBUG","INFO","WARNING","ERROR"])),v=i(new Set),p=i(new Set),m=i(!0),k=i(null);let u=null;const f=t=>{const e=t.match(/- ([^-]+) - (?:DEBUG|INFO|WARNING|ERROR) -/);return e?e[1].trim():"Unknown"},S=t=>{const e=t.match(/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2},\d{3} - [^-]+ - (?:DEBUG|INFO|WARNING|ERROR) - (.+)$/);return e?e[1]:t},R=(t,e)=>{if(t.size!==e.size)return!1;for(const r of t)if(!e.has(r))return!1;return!0},y=async()=>{try{const t=await K.getLogs();if(t.logs&&t.logs.length>0){x.value=t.logs;const e=new Set;x.value.forEach(b=>{const z=f(b.message);e.add(z)});const r=new Set;x.value.forEach(b=>{r.add(b.level)}),a.value.size===0&&(a.value=new Set(e));const l=!R(v.value,e),g=!R(p.value,r);l&&(v.value=e),g&&(p.value=r),k.value=null}}catch(t){console.error("Error loading logs:",t),k.value=t instanceof Error?t.message:"Failed to load logs"}finally{m.value=!1}},_=w(()=>x.value.filter(e=>{const r=f(e.message),l=a.value.has(r),g=d.value.has(e.level);return l&&g})),C=w(()=>Array.from(v.value).sort()),A=w(()=>{const t=["ERROR","WARNING","WARN","INFO","DEBUG"];return Array.from(p.value).sort((r,l)=>{const g=t.indexOf(r),b=t.indexOf(l);return g!==-1&&b!==-1?g-b:r.localeCompare(l)})}),I=t=>{d.value.has(t)?d.value.delete(t):d.value.add(t),d.value=new Set(d.value)},O=t=>new Date(t).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}),B=t=>({ERROR:"text-red-600 dark:text-red-400 bg-red-900/20",WARNING:"text-yellow-600 dark:text-yellow-400 bg-yellow-900/20",WARN:"text-yellow-600 dark:text-yellow-400 bg-yellow-900/20",INFO:"text-blue-600 dark:text-blue-400 bg-blue-900/20",DEBUG:"text-gray-400 bg-gray-900/20"})[t]||"text-gray-400 bg-gray-900/20",E=(t,e)=>e?{ERROR:"bg-red-100 dark:bg-red-500/20 text-red-600 dark:text-red-400 border-red-500/50",WARNING:"bg-yellow-100 dark:bg-yellow-500/20 text-yellow-600 dark:text-yellow-400 border-yellow-500/50",WARN:"bg-yellow-100 dark:bg-yellow-500/20 text-yellow-600 dark:text-yellow-400 border-yellow-500/50",INFO:"bg-blue-500/20 text-blue-600 dark:text-blue-400 border-blue-500/50",DEBUG:"bg-gray-500/20 text-gray-400 border-gray-500/50"}[t]||"bg-primary/20 text-primary border-primary/50":"bg-background-mute dark:bg-white/5 text-content-muted dark:text-white/60 border-stroke-subtle dark:border-white/20 hover:bg-stroke-subtle dark:hover:bg-white/10",G=t=>{a.value.has(t)?a.value.delete(t):a.value.add(t),a.value=new Set(a.value)},F=()=>{a.value=new Set(v.value)},M=()=>{a.value=new Set},D=()=>{d.value=new Set(p.value)},U=()=>{d.value=new Set},W=()=>{u&&clearInterval(u),u=setInterval(y,5e3)},V=()=>{u&&(clearInterval(u),u=null)};return H(()=>{y(),W()}),T(()=>{V()}),(t,e)=>(n(),s("div",P,[o("div",Q,[o("div",X,[e[1]||(e[1]=o("div",null,[o("h1",{class:"text-content-primary dark:text-content-primary text-2xl font-semibold mb-2"},"System Logs"),o("p",{class:"text-content-secondary dark:text-content-muted"},"Real-time system events and diagnostics")],-1)),o("button",{onClick:y,disabled:m.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"},[(n(),s("svg",{class:h(["w-4 h-4",{"animate-spin":m.value}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},e[0]||(e[0]=[o("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)),$(" "+c(m.value?"Loading...":"Refresh"),1)],8,Y)]),o("div",Z,[o("div",{class:"flex flex-wrap items-center gap-3 mb-4"},[e[2]||(e[2]=o("span",{class:"text-content-primLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
import{a as k,b as o,g,e as r,j as a,t as p,s as x,p as s}from"./index-D0IT5vDS.js";const f={class:"mb-6"},m={key:0,class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},v={key:1,class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},h={key:2,class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},w={class:"text-content-secondary dark:text-content-primary/80 text-base leading-relaxed"},C={class:"flex"},B=k({__name:"MessageDialog",props:{show:{type:Boolean},message:{},variant:{default:"success"}},emits:["close"],setup(i,{emit:d}){const t=i,l=d,c=n=>{n.target===n.currentTarget&&l("close")},b={success:"bg-green-100 dark:bg-green-500/20 border-green-600/40 dark:border-green-500/30 text-green-600 dark:text-green-400",error:"bg-red-100 dark:bg-red-500/20 border-red-500/30 text-red-600 dark:text-red-400",info:"bg-blue-500/20 border-blue-500/30 text-blue-600 dark:text-blue-400"},u={success:"bg-green-500 hover:bg-green-600",error:"bg-red-500 hover:bg-red-600",info:"bg-blue-500 hover:bg-blue-600"};return(n,e)=>t.show?(s(),o("div",{key:0,onClick:c,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"}},[r("div",{class:"bg-white dark:bg-surface-elevated backdrop-blur-xl rounded-[20px] p-6 w-full max-w-md border border-stroke-subtle dark:border-white/10",onClick:e[1]||(e[1]=x(()=>{},["stop"]))},[r("div",f,[r("div",{class:a(["inline-flex p-3 rounded-xl mb-4",b[t.variant]])},[t.variant==="success"?(s(),o("svg",m,e[2]||(e[2]=[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"},null,-1)]))):t.variant==="error"?(s(),o("svg",v,e[3]||(e[3]=[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"},null,-1)]))):(s(),o("svg",h,e[4]||(e[4]=[r("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)])))],2),r("p",w,p(t.message),1)]),r("div",C,[r("button",{onClick:e[0]||(e[0]=y=>l("close")),class:a(["flex-1 px-4 py-3 rounded-xl text-white transition-all duration-200",u[t.variant]])}," OK ",2)])])])):g("",!0)}});export{B as _};
|
||||
@@ -0,0 +1,65 @@
|
||||
import{a as bt,b as $,g as D,e as t,t as C,s as Lt,p as f,M as Yt,r as F,c as J,D as ht,N as Rt,f as it,T as Ft,l as Dt,O as jt,j as M,F as ct,h as gt,x as It,k as tt,o as Xt,P as te,i as ft,E as Pt,n as At,w as wt,Q as ie,q as Wt,v as le,L as Et}from"./index-D0IT5vDS.js";import{u as Ut}from"./useSignalQuality-DvX3fQnP.js";import{L as W}from"./leaflet-src-BtisrQHC.js";/* empty css */import{g as _t,s as Ct}from"./preferences-DtwbSSgO.js";import"./_commonjsHelpers-CqkleIqs.js";const de={class:"bg-gray-50 dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg p-4 mb-6"},ce={class:"flex items-center gap-3"},ue={class:"flex-1 min-w-0"},pe={class:"text-content-primary dark:text-content-primary font-medium truncate"},ge={class:"text-content-secondary dark:text-content-muted text-sm font-mono"},me={key:0,class:"text-white/50 text-xs"},he={key:1,class:"text-white/50 text-xs"},be=bt({__name:"DeleteNeighborModal",props:{show:{type:Boolean},neighbor:{}},emits:["close","delete"],setup(A,{emit:o}){const r=A,i=o,e=()=>{r.neighbor&&(i("delete",r.neighbor.id),d())},d=()=>{i("close")},g=s=>{s.target===s.currentTarget&&d()};return(s,a)=>s.show&&s.neighbor?(f(),$("div",{key:0,onClick:g,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"}},[t("div",{class:"bg-white dark:bg-surface-elevated backdrop-blur-xl rounded-[20px] p-6 w-full max-w-md border border-stroke-subtle dark:border-white/10",onClick:a[0]||(a[0]=Lt(()=>{},["stop"]))},[t("div",{class:"flex items-center gap-3 mb-6"},[a[2]||(a[2]=t("svg",{class:"w-6 h-6 text-accent-red",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("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)),a[3]||(a[3]=t("div",null,[t("h3",{class:"text-xl font-semibold text-content-primary dark:text-content-primary"},"Delete Neighbor"),t("p",{class:"text-content-secondary dark:text-content-muted text-sm mt-1"}," Are you sure you want to delete this neighbor? ")],-1)),t("button",{onClick:d,class:"ml-auto text-content-secondary dark:text-content-muted hover:text-content-primary dark:hover:text-content-primary transition-colors"},a[1]||(a[1]=[t("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),t("div",de,[t("div",ce,[t("div",ue,[t("div",pe,C(s.neighbor?.node_name||s.neighbor?.long_name||s.neighbor?.short_name||"Unknown"),1),t("div",ge," ID: "+C(s.neighbor?.node_num_hex||s.neighbor?.node_num||s.neighbor?.id||"N/A"),1),s.neighbor?.contact_type?(f(),$("div",me,C(s.neighbor.contact_type),1)):D("",!0),s.neighbor?.hw_model?(f(),$("div",he,C(s.neighbor.hw_model),1)):D("",!0)])])]),a[4]||(a[4]=t("div",{class:"bg-accent-red/10 border border-accent-red/30 rounded-lg p-4 mb-6"},[t("div",{class:"flex items-center gap-2 text-accent-red text-sm"},[t("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("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"})]),t("span",null,"This action cannot be undone")])],-1)),t("div",{class:"flex gap-3"},[t("button",{onClick:d,class:"flex-1 px-4 py-3 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 border border-stroke-subtle dark:border-stroke/20 text-content-primary dark:text-content-primary rounded-lg transition-colors"}," Cancel "),t("button",{onClick:e,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"}," Delete ")])])])):D("",!0)}}),xe={class:"bg-gradient-to-r from-primary/20 to-accent-cyan/20 border-b border-stroke-subtle dark:border-stroke/10 px-6 py-4"},ye={class:"flex items-center justify-between"},ve={class:"flex items-center gap-3"},ke={key:0,class:"text-sm text-content-secondary dark:text-content-muted"},fe={class:"p-6"},we={key:0,class:"text-center py-8"},_e={key:1,class:"text-center py-8"},Ce={class:"text-content-secondary dark:text-content-muted text-sm"},$e={key:2,class:"space-y-4"},Me={class:"bg-background-mute dark:bg-background/50 border border-stroke-subtle dark:border-stroke/10 rounded-[15px] p-4"},Ae={class:"flex items-center justify-between mb-2"},Le={class:"flex items-baseline gap-2"},Te={class:"text-3xl font-bold text-content-primary dark:text-content-primary"},Ee={class:"grid grid-cols-2 gap-3"},Se={class:"bg-background-mute dark:bg-background/50 border border-stroke-subtle dark:border-stroke/10 rounded-[15px] p-4"},Be={class:"flex items-center gap-2 mb-2"},Ne={class:"flex gap-0.5"},Fe={class:"flex items-baseline gaLine truncated
|
||||
<div style="
|
||||
width: ${H}px;
|
||||
height: ${H}px;
|
||||
background: rgba(170, 232, 232, 0.2);
|
||||
border: 2px solid #AAE8E8;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
backdrop-filter: blur(10px);
|
||||
box-shadow: 0 4px 12px rgba(170, 232, 232, 0.3);
|
||||
color: #ffffff;
|
||||
font-size: ${H<35?"11px":"13px"};
|
||||
font-weight: bold;
|
||||
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
|
||||
">
|
||||
${z}
|
||||
</div>
|
||||
`,iconSize:[H,H],iconAnchor:[H/2,H/2]})},B=n("#ef4444",!0);W.marker([E,c],{icon:B}).addTo(s).bindPopup(`
|
||||
<div class="p-2">
|
||||
<strong style="color: #ef4444;">Base Station</strong><br>
|
||||
<span class="text-sm" style="color: #9CA3AF;">Base Station</span><br>
|
||||
<span class="text-xs" style="color: #6B7280;">${E.toFixed(6)}, ${c.toFixed(6)}</span>
|
||||
</div>
|
||||
`);const R={Unknown:"#9CA3AF","Chat Node":"#60A5FA",Repeater:"#A5E5B6","Room Server":"#EBA0FC","Hybrid Node":"#FFC246"},V=(z,H,h,p,T=0)=>{if(!s)return;const N=z.jittered_latitude||z.latitude,U=z.jittered_longitude||z.longitude;if(N===null||U===null)return;const O=z.route_type||0;let Y=p,ot=3,Q=.7,q;O===2?(Y="#A5E5B6",ot=4,Q=.9):O===1?(Y="#FFC246",q="10, 5",Q=.8):O===3?(Y="#059669",ot=5,Q=.95):O===0?(Y="#ea580c",q="12, 6",Q=.8):(Y="#9CA3AF",q="2, 5",Q=.6);const rt=[H,h],st=[N,U],dt=W.polyline([rt,st],{color:Y,weight:ot,opacity:0,dashArray:q,className:"connection-line"}).addTo(s),xt=W.polyline([rt,rt],{color:Y,weight:ot,opacity:0,dashArray:q,className:"connection-line animated-line"}).addTo(s);setTimeout(()=>{let Tt=0;const Vt=30;xt.setStyle({opacity:Q+.2});const Ht=()=>{Tt++;const Zt=Tt/Vt,ne=rt[0]+(st[0]-rt[0])*Zt,se=rt[1]+(st[1]-rt[1])*Zt;xt.setLatLngs([rt,[ne,se]]),Tt<Vt?setTimeout(Ht,30):setTimeout(()=>{s&&xt&&xt.remove(),dt.setStyle({opacity:Q}),dt.on("mouseover",()=>{dt.setStyle({weight:ot+2,opacity:Math.min(Q+.3,1)})}),dt.on("mouseout",()=>{dt.setStyle({weight:ot,opacity:Q})});const ae=u(H,h,N,U);dt.bindPopup(`
|
||||
<div class="p-2">
|
||||
<strong style="color: ${p}">Connection to ${z.node_name||"Unknown Node"}</strong><br>
|
||||
<span class="text-sm" style="color: #E5E7EB;">Distance: ${ae.toFixed(2)} km</span><br>
|
||||
<span class="text-sm" style="color: #E5E7EB;">Route: ${y(z.route_type)}</span><br>
|
||||
<span class="text-sm" style="color: #E5E7EB;">Signal: ${I(z.rssi)} / ${Z(z.snr)}</span>
|
||||
</div>
|
||||
`),v.value.push(dt)},200)};Ht()},T)},G=()=>{if(!s||!w)return;const z=s.getBounds(),H=Math.floor(s.getZoom());m.value.forEach(p=>{s&&p.remove()}),m.value.clear(),v.value.forEach(p=>{s&&p.remove()}),v.value.length=0,w.getClusters([z.getWest(),z.getSouth(),z.getEast(),z.getNorth()],H).forEach(p=>{const[T,N]=p.geometry.coordinates,U=p.properties;if(U.cluster){const O=W.marker([N,T],{icon:l(U.point_count||0)}).addTo(s);O.on("click",()=>{if(s&&w){const st=w.getClusterExpansionZoom(U.cluster_id);s.setView([N,T],st)}});const ot=w.getLeaves(U.cluster_id,1/0).map(st=>`<div style="margin: 2px 0; color: ${R[st.properties.advert.contact_type]||R.Unknown};">
|
||||
• ${st.properties.advert.node_name||"Unknown Node"} (${st.properties.advert.contact_type})
|
||||
</div>`).join("");O.bindPopup(`
|
||||
<div class="p-2">
|
||||
<strong style="color: #AAE8E8;">Cluster: ${U.point_count} nodes</strong><br>
|
||||
<div style="max-height: 200px; overflow-y: auto; margin-top: 8px;">
|
||||
${ot}
|
||||
</div>
|
||||
<div style="margin-top: 8px; font-size: 11px; color: #ffffff99;">
|
||||
Click to zoom in and separate nodes
|
||||
</div>
|
||||
</div>
|
||||
`),m.value.set(`cluster-${U.cluster_id}`,O);const Q=u(E,c,N,T),q=Math.min(Math.floor(Q*5),200),rt={node_name:`Cluster of ${U.point_count} nodes`,contact_type:"Cluster",route_type:2,rssi:null,snr:null,jittered_latitude:N,jittered_longitude:T,latitude:N,longitude:T};V(rt,E,c,"#AAE8E8",q)}else{const O=U.advert,Y=R[O.contact_type]||R.Unknown,ot=n(Y),Q=N,q=T,rt=u(E,c,Q,q),st=W.marker([Q,q],{icon:ot}).addTo(s).bindPopup(`
|
||||
<div class="p-2">
|
||||
<strong style="color: ${Y}">${O.node_name||"Unknown Node"}</strong><br>
|
||||
<span class="text-sm" style="color: #E5E7EB;">Type: ${O.contact_type}</span><br>
|
||||
<span class="text-sm" style="color: #E5E7EB;">Distance: ${rt.toFixed(2)} km</span><br>
|
||||
<span class="text-sm" style="color: #E5E7EB;">Signal: ${I(O.rssi)} / ${Z(O.snr)}</span><br>
|
||||
<span class="text-sm" style="color: #E5E7EB;">Route: ${y(O.route_type)}</span><br>
|
||||
<span class="text-sm" style="color: #E5E7EB;">Last Seen: ${P(O.last_seen)}</span>
|
||||
${O.jittered_latitude?'<br><span class="text-xs" style="color: #9CA3AF;">Position adjusted to separate overlapping nodes</span>':""}
|
||||
</div>
|
||||
`);a.value.set(O.pubkey,st),m.value.set(`node-${O.pubkey}`,st);const dt=Math.min(Math.floor(rt*5),200),xt={...O,jittered_latitude:Q,jittered_longitude:q};V(xt,E,c,Y,dt)}})},X=(z,H)=>{let h=0;et(i.adverts).forEach(T=>{const N=T.properties.advert;if(N.latitude!==null&&N.longitude!==null){const U=R[N.contact_type]||R.Unknown,O=n(U),Y=N.jittered_latitude||N.latitude,ot=N.jittered_longitude||N.longitude,Q=W.marker([Y,ot],{icon:O}).addTo(s).bindPopup(`
|
||||
<div class="p-2">
|
||||
<strong style="color: ${U}">${N.node_name||"Unknown Node"}</strong><br>
|
||||
<span class="text-sm" style="color: #E5E7EB;">Type: ${N.contact_type}</span><br>
|
||||
<span class="text-sm" style="color: #E5E7EB;">Distance: ${u(z,H,Y,ot).toFixed(2)} km</span><br>
|
||||
<span class="text-sm" style="color: #E5E7EB;">Signal: ${I(N.rssi)} / ${Z(N.snr)}</span><br>
|
||||
<span class="text-sm" style="color: #E5E7EB;">Route: ${y(N.route_type)}</span><br>
|
||||
<span class="text-sm" style="color: #E5E7EB;">Last Seen: ${P(N.last_seen)}</span>
|
||||
${N.jittered_latitude?'<br><span class="text-xs" style="color: #9CA3AF;">Position adjusted to separate overlapping nodes</span>':""}
|
||||
</div>
|
||||
`);a.value.set(N.pubkey,Q);const q=Q.getElement();q&&(q.style.opacity="0",q.style.transition="opacity 0.5s ease-out"),V(N,z,H,U,h),setTimeout(()=>{q&&(q.style.opacity="1")},h+1e3),h+=100}})};if(S.value&&i.adverts.length>0)try{const z=et(i.adverts);lt(z);const H=Math.min(14,s.getZoom());s.setZoom(H),setTimeout(()=>{try{G()}catch(h){console.warn("Error updating clusters:",h),X(E,c)}},100),s.on("moveend",()=>{try{G()}catch(h){console.warn("Error updating clusters on move:",h)}}),s.on("zoomend",()=>{try{G()}catch(h){console.warn("Error updating clusters on zoom:",h)}})}catch(z){console.warn("Error initializing clustering:",z),X(E,c)}else X(E,c);setTimeout(()=>{s&&s.invalidateSize()},1e3)}catch(n){console.error("Error initializing map:",n)}};return o({highlightNode:E=>{const c=a.value.get(E);if(c){const n=c.getElement();if(n){const l=n.querySelector("div");l&&l.classList.add("marker-highlight")}}},unhighlightNode:E=>{const c=a.value.get(E);if(c){const n=c.getElement();if(n){const l=n.querySelector("div");l&&l.classList.remove("marker-highlight")}}},initializeOpenStreetMap:at}),ht(()=>i.adverts,()=>{s&&k.value&&setTimeout(()=>{at()},100)},{immediate:!1}),Xt(()=>{_.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),k.value&&i.adverts.length>0&&setTimeout(()=>{at()},300)}),te(()=>{_.disconnect(),j()}),(E,c)=>(f(),$("div",Oo,[k.value?(f(),$("div",{key:1,ref_key:"mapContainer",ref:g,class:"leaflet-map-container h-96 w-full glass-card backdrop-blur border border-black/6 dark:border-white/10 rounded-[12px] overflow-hidden shadow-sm dark:shadow-none",style:{"min-height":"384px",position:"relative"}},null,512)):(f(),$("div",Vo,c[0]||(c[0]=[ft('<div class="text-center text-content-primary dark:text-content-primary" data-v-a6a23e33><svg class="w-8 h-8 mx-auto mb-2 text-content-muted dark:text-content-muted" fill="currentColor" viewBox="0 0 20 20" data-v-a6a23e33><path d="M5.05 4.05a7 7 0 119.9 9.9L10 18.9l-4.95-4.95a7 7 0 010-9.9zM10 11a2 2 0 100-4 2 2 0 000 4z" data-v-a6a23e33></path></svg><p class="text-sm text-content-primary dark:text-content-primary" data-v-a6a23e33>No valid coordinates available</p><p class="text-xs text-content-secondary dark:text-content-muted" data-v-a6a23e33>Configure base station location to view map</p></div>',1)]))),k.value&&E.adverts.length>0?(f(),$("button",{key:2,onClick:d,class:"absolute bottom-3 right-3 z-[1001] flex items-center gap-2 px-3 py-2 bg-black/40 border border-white/10 rounded-lg text-white/80 hover:bg-white/10 hover:text-white transition-colors text-sm backdrop-blur-sm"},[c[1]||(c[1]=t("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})],-1)),t("span",Ho,C(E.showLegend?"Hide":"Show"),1)])):D("",!0),k.value&&E.adverts.length>0&&E.showLegend?(f(),$("div",Zo,[c[2]||(c[2]=ft('<div class="legend-section" data-v-a6a23e33><div class="legend-subtitle" data-v-a6a23e33>Node Types</div><div class="legend-items" data-v-a6a23e33><div class="legend-item" data-v-a6a23e33><div class="legend-icon" style="background-color:#ef4444;" data-v-a6a23e33></div><span data-v-a6a23e33>Base Station</span></div><div class="legend-item" data-v-a6a23e33><div class="legend-icon" style="background-color:#60A5FA;" data-v-a6a23e33></div><span data-v-a6a23e33>Chat Node</span></div><div class="legend-item" data-v-a6a23e33><div class="legend-icon" style="background-color:#A5E5B6;" data-v-a6a23e33></div><span data-v-a6a23e33>Repeater</span></div><div class="legend-item" data-v-a6a23e33><div class="legend-icon" style="background-color:#EBA0FC;" data-v-a6a23e33></div><span data-v-a6a23e33>Room Server</span></div><div class="legend-item" data-v-a6a23e33><div class="legend-icon" style="background-color:#FFC246;" data-v-a6a23e33></div><span data-v-a6a23e33>Hybrid Node</span></div></div></div><div class="legend-section" data-v-a6a23e33><div class="legend-subtitle" data-v-a6a23e33>Route Types</div><div class="legend-items" data-v-a6a23e33><div class="legend-item" data-v-a6a23e33><div class="legend-line" style="background:#A5E5B6;height:3px;" data-v-a6a23e33></div><span data-v-a6a23e33>Direct</span></div><div class="legend-item" data-v-a6a23e33><div class="legend-line" style="background:#059669;height:4px;" data-v-a6a23e33></div><span data-v-a6a23e33>Transport Direct</span></div><div class="legend-item" data-v-a6a23e33><div class="legend-line legend-line-dashed" style="background:#FFC246;" data-v-a6a23e33></div><span data-v-a6a23e33>Flood</span></div><div class="legend-item" data-v-a6a23e33><div class="legend-line legend-line-dashed" style="background:#ea580c;" data-v-a6a23e33></div><span data-v-a6a23e33>Transport Flood</span></div></div></div>',2)),t("div",Wo,C(E.adverts.length)+" node"+C(E.adverts.length!==1?"s":"")+" visible ",1)])):D("",!0),k.value?(f(),$("
Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
import{a as ve,r as d,D as xe,o as be,L as x,b as s,e,f as Q,g as u,i as G,k as b,t as a,j as h,F as I,h as J,w as m,v,X as Y,s as Z,p as n}from"./index-D0IT5vDS.js";import{g as ye,s as ge}from"./preferences-DtwbSSgO.js";import{_ as ke}from"./ConfirmDialog.vue_vue_type_script_setup_true_lang-CidOa_xU.js";import{_ as fe}from"./MessageDialog.vue_vue_type_script_setup_true_lang-C6ugQFfD.js";const he={class:"p-6 space-y-6"},we={class:"relative overflow-hidden rounded-[20px] p-6 mb-6 glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10"},_e={class:"relative flex items-center justify-between"},Ce={key:0,class:"grid grid-cols-1 md:grid-cols-3 gap-4"},Me={class:"group relative overflow-hidden glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-5 hover:scale-[1.02] transition-all duration-300 cursor-pointer"},je={class:"relative flex items-center justify-between"},Le={class:"text-3xl font-bold text-content-primary dark:text-content-primary mb-1"},Se={class:"group relative overflow-hidden glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-5 hover:scale-[1.02] transition-all duration-300 cursor-pointer"},$e={class:"relative flex items-center justify-between"},Ae={class:"text-3xl font-bold text-primary mb-1"},Ve={class:"group relative overflow-hidden glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-5 hover:scale-[1.02] transition-all duration-300 cursor-pointer"},Be={class:"relative flex items-center justify-between"},Re={key:0,class:"w-6 h-6 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},ze={key:1,class:"w-6 h-6 text-accent-yellow",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Ee={class:"glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-6"},Fe={key:0,class:"flex items-center justify-center py-12"},De={key:1,class:"flex items-center justify-center py-12"},Ie={class:"text-center"},Ne={class:"text-content-secondary dark:text-content-muted text-sm mb-4"},Ue={key:2,class:"space-y-4"},He={class:"relative flex items-start justify-between"},Ke={class:"flex-1"},Oe={class:"flex items-center gap-3 mb-4"},Pe={class:"relative"},Te={key:0,class:"absolute inset-0 bg-accent-green/50 rounded-full animate-ping"},Ge={class:"text-xl font-bold text-content-primary dark:text-content-primary group-hover:text-primary transition-colors"},Je={key:0,class:"text-content-muted dark:text-content-muted text-sm"},qe={class:"grid grid-cols-1 md:grid-cols-2 gap-3 text-sm mb-3"},We={class:"text-content-primary dark:text-content-primary/90 ml-2"},Xe={class:"flex items-center gap-2"},Qe={key:0,class:"text-content-primary dark:text-content-primary/90 font-mono ml-2 text-xs"},Ye={key:1,class:"text-content-muted dark:text-content-muted ml-2 text-xs"},Ze=["onClick"],et={class:"text-content-primary dark:text-content-primary/90 ml-2"},tt={key:0},rt={class:"text-content-primary dark:text-content-primary/90 ml-2"},ot={key:0,class:"text-accent-green"},st={key:1,class:"text-content-muted dark:text-content-muted"},nt={key:2,class:"text-primary"},at={key:0,class:"text-xs text-content-muted dark:text-content-muted font-mono"},lt={class:"ml-4 flex flex-wrap gap-2"},dt=["onClick","disabled","title"],it=["onClick","disabled","title"],ut=["onClick"],ct=["onClick"],pt={key:3,class:"text-center py-12 text-content-secondary dark:text-content-muted"},mt={key:1,class:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4"},vt={class:"bg-white dark:bg-surface-elevated backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-6 max-w-2xl w-full max-h-[90vh] overflow-y-auto"},xt={class:"space-y-4"},bt={class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},yt={key:0},gt={key:1,class:"text-content-secondary dark:text-content-muted text-sm"},kt={class:"grid grid-cols-2 gap-4"},ft={class:"grid grid-cols-2 gap-4"},ht={key:2,class:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4"},wt={class:"bg-white dark:bg-surface-elevated backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-6 max-w-2xl w-full max-h-[90vh] overflow-y-auto"},_t={class:"space-y-4"},Ct=["value"],Mt={class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},jt={key:0},Lt={key:1,class:"text-content-secondary dark:text-content-muted text-sm"},St={class:"grid grid-cols-2 gap-4"},$t={class:"grid grid-cols-2 gap-4"},At={key:0,class:"fixed inset-0 bg-black/70 backdrop-blur-md flex items-center justify-center z-50 p-4"},Vt={class:"bg-white dark:bg-surface-elevated backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[20px] p-6 max-w-4xl w-full h-[85vh] flex flex-col shadow-2xl"},Bt={class:"relative overflow-hidden rounded-[15px] mb-6 p-5 bg-white/50 dark:bg-white/5 border border-stroke-subtle dark:border-white/10"},Rt={class:"relative flex iLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
import{a as B,r as c,o as V,L as g,c as N,b as o,e as t,g as l,t as n,F as i,h as k,w as D,q as z,j as d,k as F,p as r}from"./index-D0IT5vDS.js";const T={class:"p-6 space-y-6"},$={key:0,class:"grid grid-cols-1 md:grid-cols-4 gap-4"},E={class:"glass-card rounded-[15px] p-4"},H={class:"text-2xl font-bold text-content-primary dark:text-content-primary"},O={class:"glass-card rounded-[15px] p-4"},P={class:"text-2xl font-bold text-cyan-500 dark:text-primary"},G={class:"glass-card rounded-[15px] p-4"},q={class:"text-2xl font-bold text-green-700 dark:text-green-500 dark:text-accent-green"},U={class:"glass-card rounded-[15px] p-4"},J={class:"text-2xl font-bold text-yellow-500 dark:text-secondary"},K={class:"glass-card rounded-[15px] p-6"},Q={class:"flex flex-wrap border-b border-stroke-subtle dark:border-stroke/10 mb-6"},W=["onClick"],X={class:"flex items-center gap-2"},Y={key:0,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Z={key:1,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},tt={key:2,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},et={class:"min-h-[400px]"},st={key:0,class:"flex items-center justify-center py-12"},nt={key:1,class:"flex items-center justify-center py-12"},ot={class:"text-center"},rt={class:"text-content-secondary dark:text-content-muted text-sm mb-4"},at={key:2,class:"space-y-4"},dt={key:0,class:"text-center py-12 text-content-secondary dark:text-content-muted"},ct={key:1,class:"space-y-4"},lt={class:"flex items-start justify-between"},it={class:"flex-1 min-w-0"},xt={class:"flex items-center gap-2 flex-wrap mb-3"},ut={class:"text-lg font-semibold text-content-primary dark:text-content-primary truncate"},mt={class:"flex flex-wrap items-center gap-x-4 gap-y-2 text-sm"},pt={key:0,class:"flex items-center gap-1.5"},kt={class:"text-content-secondary dark:text-content-muted"},vt={key:1,class:"flex items-center gap-1.5"},yt={class:"text-content-secondary dark:text-content-muted"},_t={key:2,class:"text-content-secondary dark:text-content-muted font-mono text-xs"},bt={key:3,class:"text-content-muted dark:text-content-muted font-mono text-xs"},gt={key:0,class:"text-content-muted dark:text-content-muted text-xs mt-2 mb-0"},ht={class:"grid grid-cols-2 md:grid-cols-4 gap-4 mt-4"},ft={class:"text-content-primary dark:text-content-primary font-medium"},wt={class:"text-cyan-500 dark:text-primary font-medium"},Ct={class:"mt-3 flex items-center gap-2"},At={key:3,class:"space-y-4"},Lt={key:0,class:"text-center py-12 text-content-secondary dark:text-content-muted"},St={key:1,class:"overflow-x-auto"},Nt={class:"w-full"},Mt={class:"py-3"},Rt={class:"font-mono text-sm text-content-primary dark:text-content-primary"},It={class:"py-3"},jt={class:"font-mono text-xs text-content-secondary dark:text-content-muted"},Bt={class:"py-3"},Vt={class:"text-sm text-content-primary dark:text-content-primary"},Dt={class:"text-xs text-content-muted dark:text-content-muted"},zt={class:"py-3"},Ft={class:"py-3"},Tt={class:"text-sm text-content-secondary dark:text-content-muted"},$t={class:"py-3"},Et=["onClick"],Ht={key:4,class:"space-y-4"},Ot={class:"mb-4"},Pt=["value"],Gt={key:0,class:"text-center py-12 text-content-secondary dark:text-content-muted"},qt={key:1,class:"grid grid-cols-1 gap-4"},Ut={class:"flex items-start justify-between"},Jt={class:"flex-1"},Kt={class:"flex items-center gap-3 mb-3"},Qt={class:"text-content-primary dark:text-content-primary font-mono text-sm"},Wt={class:"grid grid-cols-1 md:grid-cols-2 gap-3 text-sm"},Xt={class:"text-content-primary dark:text-content-primary/90 font-mono ml-2"},Yt={class:"text-content-primary dark:text-content-primary/90 ml-2"},Zt={class:"text-content-primary dark:text-content-primary/90 ml-2"},te={class:"text-content-primary dark:text-content-primary/90 ml-2"},ee=["onClick"],se={class:"flex justify-end"},ne=["disabled"],ae=B({name:"SessionsView",__name:"Sessions",setup(oe){const u=c("overview"),w=c(!1),m=c(!1),v=c(null),h=c(null),p=c([]),x=c(null),y=c(null),M=[{id:"overview",label:"Overview",icon:"overview"},{id:"clients",label:"Authenticated Clients",icon:"clients"},{id:"identities",label:"By Identity",icon:"identities"}];V(async()=>{await _(),w.value=!0});async function _(){m.value=!0,v.value=null;try{const a=await g.getACLInfo();a.success&&(h.value=a.data);const s=await g.getACLClients();s.success&&s.data&&(p.value=s.data.clients||[]);const e=await g.getACLStats();e.success&&(x.value=e.data)}catch(a){v.value=a instanceof Error?a.message:"Failed to load ACL data",console.error("Error fetching ACL data:",a)}finally{m.value=!1}}async function C(a,s){if(confirm("Are you sure you want to remove this client from the ACL?"))try{const e=await g.removeACLClient({public_key:a,identity_hash:s});e.success?await _():alert(`Failed to remove client: ${e.error}`)}catch(e){alert(`Error removing client: ${e}`)}}function b(a){return a?new Date(a*1e3).toLocaleString():"Never"}function R(a){u.value=a}const A=N(()=>y.value?p.value.filLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
import{d as A,r as l,c as P,a as W,o as I,b as a,e,f as B,_ as Y,t as i,u as o,n as J,g as k,F as N,h as z,i as K,w as h,v as C,j as _,k as V,l as q,T,m as Q,p as n,q as E,s as X,x as Z}from"./index-D0IT5vDS.js";const ee=A("setup",()=>{const m=l(1),r=l(5),y=l(`pyRpt${Math.floor(Math.random()*1e4).toString().padStart(4,"0")}`),b=l(null),v=l(null),x=l(""),f=l(""),w=l(!1),c=l({frequency:"915.0",spreading_factor:"7",bandwidth:"125",coding_rate:"5"}),R=l([]),j=l([]),g=l(!1),S=l(!1),u=l(null),t=P(()=>{switch(m.value){case 1:return!0;case 2:return y.value.trim().length>0;case 3:return b.value!==null;case 4:return w.value?c.value.frequency&&c.value.spreading_factor&&c.value.bandwidth&&c.value.coding_rate:v.value!==null;case 5:return x.value.length>=6&&x.value===f.value;default:return!1}}),s=P(()=>m.value>1),M=P(()=>m.value===r.value);async function F(){g.value=!0,u.value=null;try{const p=await(await fetch("/api/hardware_options")).json();if(p.error)throw new Error(p.error);R.value=p.hardware||[]}catch(d){u.value=d instanceof Error?d.message:"Failed to load hardware options",console.error("Error fetching hardware options:",d)}finally{g.value=!1}}async function H(){g.value=!0,u.value=null;try{const p=await(await fetch("/api/radio_presets")).json();if(p.error)throw new Error(p.error);j.value=p.presets||[]}catch(d){u.value=d instanceof Error?d.message:"Failed to load radio presets",console.error("Error fetching radio presets:",d)}finally{g.value=!1}}async function U(){if(!t.value)return{success:!1,error:"Please complete all required fields"};S.value=!0,u.value=null;try{const d=w.value?{title:"Custom Configuration",description:"Custom radio settings",frequency:c.value.frequency,spreading_factor:c.value.spreading_factor,bandwidth:c.value.bandwidth,coding_rate:c.value.coding_rate}:v.value,L=await(await fetch("/api/setup_wizard",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({node_name:y.value.trim(),hardware_key:b.value?.key,radio_preset:d,admin_password:x.value})})).json();if(!L.success)throw new Error(L.error||"Setup failed");return{success:!0,data:L}}catch(d){const p=d instanceof Error?d.message:"Failed to complete setup";return u.value=p,{success:!1,error:p}}finally{S.value=!1}}function O(){t.value&&m.value<r.value&&m.value++}function $(){s.value&&m.value--}function G(d){d>=1&&d<=r.value&&(m.value=d)}function D(){m.value=1,y.value=`pyRpt${Math.floor(Math.random()*1e4).toString().padStart(4,"0")}`,b.value=null,v.value=null,w.value=!1,c.value={frequency:"915.0",spreading_factor:"7",bandwidth:"125",coding_rate:"5"},x.value="",f.value="",u.value=null}return{currentStep:m,totalSteps:r,nodeName:y,selectedHardware:b,selectedRadioPreset:v,useCustomRadio:w,customRadio:c,adminPassword:x,confirmPassword:f,hardwareOptions:R,radioPresets:j,isLoading:g,isSubmitting:S,error:u,canGoNext:t,canGoBack:s,isLastStep:M,fetchHardwareOptions:F,fetchRadioPresets:H,completeSetup:U,nextStep:O,previousStep:$,goToStep:G,reset:D}}),te={class:"min-h-screen bg-background dark:bg-background overflow-hidden relative flex items-center justify-center p-4"},re={class:"absolute top-4 right-4 z-20"},oe={class:"w-full max-w-4xl relative z-10"},se={class:"mb-8"},ae={class:"flex justify-between mb-2"},ne={class:"text-content-secondary dark:text-content-muted text-sm"},de={class:"text-content-secondary dark:text-content-muted text-sm"},ie={class:"h-2 bg-stroke-subtle dark:bg-stroke/10 rounded-full overflow-hidden"},le={class:"bg-white dark:bg-surface-elevated backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[20px] p-6 sm:p-8 md:p-12"},ue={class:"flex justify-center mb-8"},ce={class:"flex gap-2"},pe={class:"mb-8"},me={class:"text-2xl sm:text-3xl font-bold text-content-primary dark:text-content-primary mb-2 text-center"},be={key:0,class:"space-y-6 mt-8"},fe={key:1,class:"space-y-6 mt-8"},xe={class:"max-w-md mx-auto"},ke={key:2,class:"space-y-6 mt-8"},ve={key:0,class:"text-center text-content-secondary dark:text-content-muted"},ge={key:1,class:"text-center text-content-secondary dark:text-content-muted"},ye={key:2,class:"grid grid-cols-1 md:grid-cols-2 gap-4 max-w-3xl mx-auto"},he=["onClick"],we={class:"font-medium text-content-primary dark:text-content-primary mb-1"},_e={class:"text-sm text-content-secondary dark:text-content-muted"},Se={key:3,class:"space-y-6 mt-8"},Ce={key:0,class:"text-center text-content-secondary dark:text-content-muted"},Re={key:1,class:"text-center text-content-secondary dark:text-content-muted"},je={key:2,class:"max-w-5xl mx-auto"},Pe={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 mb-4"},Me=["onClick"],Le={class:"relative z-10"},Be={class:"font-medium text-content-primary dark:text-content-primary mb-1 flex items-start justify-between gap-2"},Ne={class:"flex items-center gap-2"},ze={class:"text-2xl"},Ve={key:0,class:"text-primary flex-shrink-0"},qe={class:"text-xs text-content-secondary dark:text-content-muted mb-3"},Te={class:"grid grid-cols-2 gap-2 text-xs"},Ee={clLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
import{a as Oe,J as Le,K as ze,r as u,D as pe,c as me,o as He,E as ve,R as M,H as Je,b as h,e as a,g as B,w as Ue,q as je,F as ge,h as fe,f as G,u as xe,i as $e,t as Y,L as H,I as le,n as Ke,p as k,x as Ve}from"./index-D0IT5vDS.js";import{S as Z}from"./chartjs-adapter-date-fns.esm-DJElUt-M.js";import{g as Ie,s as Xe}from"./preferences-DtwbSSgO.js";import{C as q,a as We,L as Ge,P as Ye,b as Ze,c as qe,B as Qe,D as et,S as tt,p as at,d as st,e as rt,A as ot,f as lt,i as nt,T as it}from"./chart-B185MtDy.js";import{P as J}from"./plotly.min-DO11Gp-n.js";import"./_commonjsHelpers-CqkleIqs.js";const ct={class:"p-3 sm:p-6 space-y-4 sm:space-y-6"},dt={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center gap-3"},ut={class:"flex items-center gap-2 sm:gap-3"},pt=["value"],mt={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4"},vt={class:"glass-card rounded-[15px] p-3 sm:p-6"},gt={class:"relative h-40 sm:h-48 rounded-lg p-2 sm:p-4"},ft={key:0,class:"absolute inset-0 flex items-center justify-center bg-white/50 dark:bg-white/5 backdrop-blur-xs z-20"},xt={key:1,class:"absolute inset-0 flex items-center justify-center bg-white/50 dark:bg-white/5 z-20"},bt={class:"grid grid-cols-1 lg:grid-cols-2 gap-4 sm:gap-6 items-stretch"},yt={class:"glass-card rounded-[15px] p-3 sm:p-6 flex flex-col"},ht={class:"relative flex-1 min-h-[12rem] sm:min-h-[16rem] rounded-lg"},kt={key:0,class:"absolute inset-0 flex items-center justify-center bg-white/50 dark:bg-white/5 backdrop-blur-xs z-20"},Ct={class:"glass-card rounded-[15px] p-3 sm:p-6 flex flex-col"},_t={class:"flex-1 flex flex-col justify-evenly"},wt={key:0,class:"flex items-center justify-center flex-1"},St={key:1,class:"flex items-center justify-center flex-1"},Tt={class:"w-28 sm:w-32 text-sm text-content-primary dark:text-content-primary truncate"},Rt={class:"flex-1 h-12 bg-background-mute dark:bg-stroke/10 rounded overflow-hidden"},Dt={class:"w-20 text-sm text-content-secondary dark:text-content-muted text-right tabular-nums"},Et={key:0,class:"glass-card rounded-[15px] p-6 sm:p-8 text-center"},Ft={key:1,class:"glass-card rounded-[15px] p-6 sm:p-8 text-center"},Mt={class:"text-content-secondary dark:text-content-muted text-sm"},Pt=Oe({name:"StatisticsView",__name:"Statistics",setup(Bt){q.register(We,Ge,Ye,Ze,qe,Qe,et,tt,at,st,rt,ot,lt,nt,it);const A=Le(),Q=ze(),N=u(null),ee=u(!1),ne=()=>{N.value||Q.isConnected||(N.value=window.setInterval(X,3e4))},ie=()=>{N.value&&(clearInterval(N.value),N.value=null)},T=()=>{const e=document.documentElement.classList.contains("dark");return{gridColor:e?"rgba(255, 255, 255, 0.1)":"rgba(0, 0, 0, 0.1)",tickColor:e?"rgba(255, 255, 255, 0.7)":"rgba(0, 0, 0, 0.7)",legendColor:e?"rgba(255, 255, 255, 0.8)":"rgba(0, 0, 0, 0.8)",titleColor:e?"rgba(255, 255, 255, 0.8)":"rgba(0, 0, 0, 0.8)"}},v=u(Ie("statistics_selectedHours",24)),be=[{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"}];pe(v,e=>Xe("statistics_selectedHours",e));const R=u(null),O=u(null),U=u([]),D=u(null),te=u([]),j=u([]),$=u(!0),K=u(null),C=u({packetRate:!0,packetType:!0,noiseFloor:!1,routePie:!0,sparklines:!0}),L=u(!1),V=u(!1),z=u(!1),_=u(null),w=u(null),y=u(null),I=u(null),ae=u(null),se=u(null),E=u(null),ce=me(()=>{const e=A.packetStats;return e?{totalRx:e.total_packets||0,totalTx:e.transmitted_packets||0}:{totalRx:0,totalTx:0}}),re=(e,t)=>{if(e.length===0)return[];const o=Math.round(t*60*60*1e3/72),r=new Map;return e.forEach(([i,g])=>{let f=i;i>1e15?f=i/1e3:i>1e9&&i<1e12&&(f=i*1e3);const S=Math.floor(f/o)*o;r.has(S)||r.set(S,[]),r.get(S).push(g)}),Array.from(r.entries()).sort((i,g)=>i[0]-g[0]).map(([,i])=>i.reduce((g,f)=>g+f,0)/i.length)},oe=me(()=>{let e=[],t=[];if(R.value?.series){const s=R.value.series.find(r=>r.type==="rx_count"),o=R.value.series.find(r=>r.type==="tx_count");s?.data&&(e=re(s.data,v.value)),o?.data&&(t=re(o.data,v.value))}return{totalPackets:e,transmittedPackets:t,droppedPackets:[],crcErrors:re(j.value.map(s=>[s.timestamp>1e12?s.timestamp:s.timestamp*1e3,s.count]),v.value)}}),X=async()=>{try{$.value=!0,K.value=null,await Promise.all([A.fetchPacketStats({hours:v.value}),A.fetchSystemStats()]),$.value=!1,ye()}catch(e){K.value=e instanceof Error?e.message:"Failed to fetch data",$.value=!1}},ye=async()=>{C.value={packetRate:!0,packetType:!0,noiseFloor:!0,routePie:!0,sparklines:!0};const e=[he(),ke(),Ce(),_e(),we()];try{await Promise.allSettled(e),await ve(),!I.value||!ae.value?setTimeout(()=>{de()},100):de()}catch(t){console.error("Error loading chart data:",t)}},he=async()=>{try{const e=await H.get("/metrics_graph_data",{hours:v.value,resolution:"average",metrics:"rx_count,tx_count"});e?.success&&(R.value=e.data)}catch{R.value=null}},ke=async()=>{try{const e=await H.get("/packet_type_graph_data",{hours:v.value,resolution:"average",types:"all"});if(e?.success&&e.data){const t=e.data;U.value=t.series||[]}}catch{U.value=[]}},Ce=async()=>{try{conLine truncated
|
||||
@@ -0,0 +1,2 @@
|
||||
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/plotly.min-DO11Gp-n.js","assets/_commonjsHelpers-CqkleIqs.js"])))=>i.map(i=>d[i]);
|
||||
import{a as ot,r as u,c as W,E as N,o as nt,R as X,S as O,H as lt,b as d,e as t,g as v,f as A,t as o,F as Y,h as G,I as K,L as Q,j as V,p as i,x as dt}from"./index-D0IT5vDS.js";import{S as P}from"./chartjs-adapter-date-fns.esm-DJElUt-M.js";import{C as j,a as it,L as ct,P as ut,b as mt,c as vt,B as pt,D as xt,p as yt,d as gt,e as ft,A as bt,f as kt,i as ht,T as _t}from"./chart-B185MtDy.js";const Ct={class:"p-6 space-y-6"},wt={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4"},Ft={class:"grid grid-cols-1 lg:grid-cols-2 gap-6"},St={class:"glass-card rounded-[15px] p-6"},Ut={class:"relative h-32 bg-gray-100/50 dark:bg-white/5 rounded-lg p-4 mb-4 chart-container"},Bt={key:0,class:"absolute inset-0 flex items-center justify-center bg-white/50 dark:bg-white/5 backdrop-blur-sm z-20"},Et={key:1,class:"absolute inset-0 flex items-center justify-center bg-white/50 dark:bg-white/5 z-20"},At={key:0,class:"grid grid-cols-2 gap-4 text-sm"},Pt={class:"text-content-primary dark:text-content-primary font-semibold"},Lt={class:"text-content-primary dark:text-content-primary font-semibold"},Mt={class:"text-content-primary dark:text-content-primary font-semibold"},Dt={class:"text-content-primary dark:text-content-primary font-semibold"},Rt={class:"glass-card rounded-[15px] p-6"},Tt={class:"relative h-32 bg-gray-100/50 dark:bg-white/5 rounded-lg p-4 mb-4 chart-container"},zt={key:0,class:"absolute inset-0 flex items-center justify-center bg-white/50 dark:bg-white/5 backdrop-blur-sm z-20"},$t={key:1,class:"absolute inset-0 flex items-center justify-center bg-white/50 dark:bg-white/5 z-20"},It={key:0,class:"grid grid-cols-2 gap-4 text-sm"},Nt={class:"text-content-primary dark:text-content-primary font-semibold"},Ot={class:"text-content-primary dark:text-content-primary font-semibold"},Vt={class:"text-content-primary dark:text-content-primary font-semibold"},jt={class:"text-content-primary dark:text-content-primary font-semibold"},Ht={class:"grid grid-cols-1 lg:grid-cols-2 gap-6"},qt={class:"glass-card rounded-[15px] p-6"},Jt={class:"relative h-48"},Wt={key:0,class:"grid grid-cols-3 gap-4 text-sm mt-4"},Xt={class:"text-center"},Yt={class:"text-content-primary dark:text-content-primary font-semibold"},Gt={class:"text-center"},Kt={class:"font-semibold text-red-500 dark:text-red-400"},Qt={class:"text-center"},Zt={class:"font-semibold text-green-700 dark:text-green-400"},te={class:"glass-card rounded-[15px] p-6"},ee={key:0,class:"space-y-4"},ae={class:"grid grid-cols-2 gap-4 text-sm"},se={class:"text-content-primary dark:text-content-primary font-semibold"},re={class:"text-content-primary dark:text-content-primary font-semibold"},oe={class:"text-content-primary dark:text-content-primary font-semibold"},ne={class:"text-content-primary dark:text-content-primary font-semibold"},le={key:0,class:"pt-4 border-t border-stroke-subtle dark:border-stroke/10"},de={class:"grid grid-cols-2 gap-2 text-sm"},ie={class:"text-content-secondary dark:text-content-muted"},ce={class:"text-content-primary dark:text-content-primary font-semibold ml-1"},ue={class:"glass-card rounded-[15px] p-6"},me={key:0,class:"overflow-x-auto"},ve={class:"w-full text-sm"},pe={class:"text-content-secondary dark:text-content-primary/80 py-2 transition-all duration-300"},xe={class:"text-content-primary dark:text-content-primary font-semibold py-2 transition-all duration-300"},ye={class:"text-center text-orange-500 dark:text-orange-400 py-2 transition-all duration-300"},ge={class:"text-center text-green-700 dark:text-green-400 py-2 transition-all duration-300"},fe={class:"text-right text-content-secondary dark:text-content-primary/80 py-2 transition-all duration-300"},be={key:0,class:"mt-4 text-center text-content-secondary dark:text-content-muted text-sm transition-all duration-300"},ke={key:1,class:"text-center text-content-secondary dark:text-content-muted py-8"},he={key:0,class:"glass-card rounded-[15px] p-8 text-center"},_e={key:1,class:"glass-card rounded-[15px] p-8 text-center"},Ce={class:"text-content-secondary dark:text-content-muted text-sm"},we=ot({name:"SystemStatsView",__name:"SystemStats",setup(Fe){j.register(it,ct,ut,mt,vt,pt,xt,yt,gt,ft,bt,kt,ht,_t);const L=u(null),_=u(!0),C=u(null),s=u(null),b=u(null),x=u([]),M=u(null),p=u({cpuChart:!0,memoryChart:!0,diskChart:!1,processChart:!0}),D=u(!1),R=u(!1),y=u(null),g=u(null),T=u(null),z=u(null),k=u(null),B=W(()=>s.value?{cpuUsage:s.value.cpu.usage_percent,memoryUsage:s.value.memory.usage_percent,diskUsage:s.value.disk.usage_percent,uptime:s.value.system.uptime}:{cpuUsage:0,memoryUsage:0,diskUsage:0,uptime:0}),E=W(()=>x.value.length===0?{cpu:[],memory:[],disk:[],network:[]}:{cpu:x.value.map(a=>a.cpu.usage_percent),memory:x.value.map(a=>a.memory.usage_percent),disk:x.value.map(a=>a.disk.usage_percent),network:x.value.map(a=>a.network.bytes_recv/1024/1024)}),f=a=>{const e=["B","KB","MB","GB","TB"];if(a===0)return"0 B";const r=Math.floor(Math.log(a)/Math.log(1024));return parseFloat((a/Math.pow(1024,r)).toFixed(2)Line truncated
|
||||
@@ -0,0 +1,184 @@
|
||||
import{L as J,a as zl,r as ut,o as Hl,a0 as Ul,P as Rn,D as ql,b as tt,e as Z,g as Yt,t as Is,w as Kl,v as Vl,X as Ji,j as Tn,s as jl,p as it,x as Gl}from"./index-D0IT5vDS.js";/**
|
||||
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
||||
* @license MIT
|
||||
*
|
||||
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
||||
* @license MIT
|
||||
*
|
||||
* Originally forked from (with the author's permission):
|
||||
* Fabrice Bellard's javascript vt100 for jslinux:
|
||||
* http://bellard.org/jslinux/
|
||||
* Copyright (c) 2011 Fabrice Bellard
|
||||
*/var oa=Object.defineProperty,Yl=Object.getOwnPropertyDescriptor,Xl=(t,e)=>{for(var i in e)oa(t,i,{get:e[i],enumerable:!0})},ue=(t,e,i,s)=>{for(var r=s>1?void 0:s?Yl(e,i):e,n=t.length-1,o;n>=0;n--)(o=t[n])&&(r=(s?o(e,i,r):o(r))||r);return s&&r&&oa(e,i,r),r},P=(t,e)=>(i,s)=>e(i,s,t),Dn="Terminal input",pr={get:()=>Dn,set:t=>Dn=t},An="Too much output to announce, navigate to rows manually to read",vr={get:()=>An,set:t=>An=t};function Jl(t){return t.replace(/\r?\n/g,"\r")}function Zl(t,e){return e?"\x1B[200~"+t+"\x1B[201~":t}function Ql(t,e){t.clipboardData&&t.clipboardData.setData("text/plain",e.selectionText),t.preventDefault()}function eh(t,e,i,s){if(t.stopPropagation(),t.clipboardData){let r=t.clipboardData.getData("text/plain");aa(r,e,i,s)}}function aa(t,e,i,s){t=Jl(t),t=Zl(t,i.decPrivateModes.bracketedPasteMode&&s.rawOptions.ignoreBracketedPasteMode!==!0),i.triggerDataEvent(t,!0),e.value=""}function la(t,e,i){let s=i.getBoundingClientRect(),r=t.clientX-s.left-10,n=t.clientY-s.top-10;e.style.width="20px",e.style.height="20px",e.style.left=`${r}px`,e.style.top=`${n}px`,e.style.zIndex="1000",e.focus()}function Pn(t,e,i,s,r){la(t,e,i),r&&s.rightClickSelect(t),e.value=s.selectionText,e.select()}function Kt(t){return t>65535?(t-=65536,String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):String.fromCharCode(t)}function Ts(t,e=0,i=t.length){let s="";for(let r=e;r<i;++r){let n=t[r];n>65535?(n-=65536,s+=String.fromCharCode((n>>10)+55296)+String.fromCharCode(n%1024+56320)):s+=String.fromCharCode(n)}return s}var th=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,i){let s=e.length;if(!s)return 0;let r=0,n=0;if(this._interim){let o=e.charCodeAt(n++);56320<=o&&o<=57343?i[r++]=(this._interim-55296)*1024+o-56320+65536:(i[r++]=this._interim,i[r++]=o),this._interim=0}for(let o=n;o<s;++o){let l=e.charCodeAt(o);if(55296<=l&&l<=56319){if(++o>=s)return this._interim=l,r;let h=e.charCodeAt(o);56320<=h&&h<=57343?i[r++]=(l-55296)*1024+h-56320+65536:(i[r++]=l,i[r++]=h);continue}l!==65279&&(i[r++]=l)}return r}},ih=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,i){let s=e.length;if(!s)return 0;let r=0,n,o,l,h,a=0,c=0;if(this.interim[0]){let d=!1,m=this.interim[0];m&=(m&224)===192?31:(m&240)===224?15:7;let y=0,k;for(;(k=this.interim[++y]&63)&&y<4;)m<<=6,m|=k;let R=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,D=R-y;for(;c<D;){if(c>=s)return 0;if(k=e[c++],(k&192)!==128){c--,d=!0;break}else this.interim[y++]=k,m<<=6,m|=k&63}d||(R===2?m<128?c--:i[r++]=m:R===3?m<2048||m>=55296&&m<=57343||m===65279||(i[r++]=m):m<65536||m>1114111||(i[r++]=m)),this.interim.fill(0)}let _=s-4,f=c;for(;f<s;){for(;f<_&&!((n=e[f])&128)&&!((o=e[f+1])&128)&&!((l=e[f+2])&128)&&!((h=e[f+3])&128);)i[r++]=n,i[r++]=o,i[r++]=l,i[r++]=h,f+=4;if(n=e[f++],n<128)i[r++]=n;else if((n&224)===192){if(f>=s)return this.interim[0]=n,r;if(o=e[f++],(o&192)!==128){f--;continue}if(a=(n&31)<<6|o&63,a<128){f--;continue}i[r++]=a}else if((n&240)===224){if(f>=s)return this.interim[0]=n,r;if(o=e[f++],(o&192)!==128){f--;continue}if(f>=s)return this.interim[0]=n,this.interim[1]=o,r;if(l=e[f++],(l&192)!==128){f--;continue}if(a=(n&15)<<12|(o&63)<<6|l&63,a<2048||a>=55296&&a<=57343||a===65279)continue;i[r++]=a}else if((n&248)===240){if(f>=s)return this.interim[0]=n,r;if(o=e[f++],(o&192)!==128){f--;continue}if(f>=s)return this.interim[0]=n,this.interim[1]=o,r;if(l=e[f++],(l&192)!==128){f--;continue}if(f>=s)return this.interim[0]=n,this.interim[1]=o,this.interim[2]=l,r;if(h=e[f++],(h&192)!==128){f--;continue}if(a=(n&7)<<18|(o&63)<<12|(l&63)<<6|h&63,a<65536||a>1114111)continue;i[r++]=a}}return r}},ha="",Vt=" ",ji=class ca{constructor(){this.fg=0,this.bg=0,this.extended=new bs}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let e=new ca;return e.fg=this.fg,e.bg=this.bg,e.extended=this.extended.clone(),e}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;defaulLine truncated
|
||||
|
||||
WARNING: This link could potentially be dangerous`)){let i=window.open();if(i){try{i.opener=null}catch{}i.location.href=e}else console.warn("Opening link blocked as opener could not be cleared")}}var Ds=Ie("CharSizeService"),$t=Ie("CoreBrowserService"),gn=Ie("MouseService"),It=Ie("RenderService"),lh=Ie("SelectionService"),pa=Ie("CharacterJoinerService"),bi=Ie("ThemeService"),va=Ie("LinkProviderService"),hh=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?In.isErrorNoTelemetry(e)?new In(e.message+`
|
||||
|
||||
`+e.stack):new Error(e.message+`
|
||||
|
||||
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(i=>{i(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},ch=new hh;function hs(t){dh(t)||ch.onUnexpectedError(t)}var Sr="Canceled";function dh(t){return t instanceof uh?!0:t instanceof Error&&t.name===Sr&&t.message===Sr}var uh=class extends Error{constructor(){super(Sr),this.name=this.message}};function _h(t){return new Error(`Illegal argument: ${t}`)}var In=class br extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof br)return e;let i=new br;return i.message=e.message,i.stack=e.stack,i}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}},yr=class ma extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,ma.prototype)}};function Xe(t,e=0){return t[t.length-(1+e)]}var fh;(t=>{function e(n){return n<0}t.isLessThan=e;function i(n){return n<=0}t.isLessThanOrEqual=i;function s(n){return n>0}t.isGreaterThan=s;function r(n){return n===0}t.isNeitherLessOrGreaterThan=r,t.greaterThan=1,t.lessThan=-1,t.neitherLessOrGreaterThan=0})(fh||={});function gh(t,e){let i=this,s=!1,r;return function(){return s||(s=!0,e||(r=t.apply(i,arguments))),r}}var wa;(t=>{function e(S){return S&&typeof S=="object"&&typeof S[Symbol.iterator]=="function"}t.is=e;let i=Object.freeze([]);function s(){return i}t.empty=s;function*r(S){yield S}t.single=r;function n(S){return e(S)?S:r(S)}t.wrap=n;function o(S){return S||i}t.from=o;function*l(S){for(let L=S.length-1;L>=0;L--)yield S[L]}t.reverse=l;function h(S){return!S||S[Symbol.iterator]().next().done===!0}t.isEmpty=h;function a(S){return S[Symbol.iterator]().next().value}t.first=a;function c(S,L){let B=0;for(let $ of S)if(L($,B++))return!0;return!1}t.some=c;function _(S,L){for(let B of S)if(L(B))return B}t.find=_;function*f(S,L){for(let B of S)L(B)&&(yield B)}t.filter=f;function*d(S,L){let B=0;for(let $ of S)yield L($,B++)}t.map=d;function*m(S,L){let B=0;for(let $ of S)yield*L($,B++)}t.flatMap=m;function*y(...S){for(let L of S)yield*L}t.concat=y;function k(S,L,B){let $=B;for(let U of S)$=L($,U);return $}t.reduce=k;function*R(S,L,B=S.length){for(L<0&&(L+=S.length),B<0?B+=S.length:B>S.length&&(B=S.length);L<B;L++)yield S[L]}t.slice=R;function D(S,L=Number.POSITIVE_INFINITY){let B=[];if(L===0)return[B,S];let $=S[Symbol.iterator]();for(let U=0;U<L;U++){let Y=$.next();if(Y.done)return[B,t.empty()];B.push(Y.value)}return[B,{[Symbol.iterator](){return $}}]}t.consume=D;async function T(S){let L=[];for await(let B of S)L.push(B);return Promise.resolve(L)}t.asyncToArray=T})(wa||={});function oi(t){if(wa.is(t)){let e=[];for(let i of t)if(i)try{i.dispose()}catch(s){e.push(s)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}function ph(...t){return re(()=>oi(t))}function re(t){return{dispose:gh(()=>{t()})}}var Sa=class ba{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{oi(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?ba.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),void 0)}};Sa.DISABLE_DISPOSED_WARNING=!1;var jt=Sa,j=class{constructor(){this._store=new jt,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};j.None=Object.freeze({dispose(){}});var Si=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e}},At=typeof window=="object"?window:globalThis,Cr=class xr{constructor(e){this.element=e,this.next=xr.Undefined,this.prev=xr.Undefined}};Cr.Undefined=new Cr(void 0);var oe=Cr,On=class{constructor(){this._first=oe.Undefined,this._last=oe.Undefined,this._size=0}get size(){return this._size}isEmpty()
Line truncated
|
||||
`).slice(2).join(`
|
||||
`))}},Ch=class extends Error{constructor(t,e){super(t),this.name="ListenerLeakError",this.stack=e}},xh=class extends Error{constructor(t,e){super(t),this.name="ListenerRefusalError",this.stack=e}},kh=0,Fs=class{constructor(e){this.value=e,this.id=kh++}},Lh=2,Bh,A=class{constructor(e){this._size=0,this._options=e,this._leakageMon=this._options?.leakWarningThreshold?new bh(e?.onListenerError??hs,this._options?.leakWarningThreshold??Sh):void 0,this._perfMon=this._options?._profName?new wh(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,i,s)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let l=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(l);let h=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],a=new xh(`${l}. HINT: Stack shows most frequent listener (${h[1]}-times)`,h[0]);return(this._options?.onListenerError||hs)(a),j.None}if(this._disposed)return j.None;i&&(e=e.bind(i));let r=new Fs(e),n;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=yh.create(),n=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof Fs?(this._deliveryQueue??=new Eh,this._listeners=[this._listeners,r]):this._listeners.push(r):(this._options?.onWillAddFirstListener?.(this),this._listeners=r,this._options?.onDidAddFirstListener?.(this)),this._size++;let o=re(()=>{n?.(),this._removeListener(r)});return s instanceof jt?s.add(o):Array.isArray(s)&&s.push(o),o},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let i=this._listeners,s=i.indexOf(e);if(s===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,i[s]=void 0;let r=this._deliveryQueue.current===this;if(this._size*Lh<=i.length){let n=0;for(let o=0;o<i.length;o++)i[o]?i[n++]=i[o]:r&&(this._deliveryQueue.end--,n<this._deliveryQueue.i&&this._deliveryQueue.i--);i.length=n}}_deliver(e,i){if(!e)return;let s=this._options?.onListenerError||hs;if(!s){e.value(i);return}try{e.value(i)}catch(r){s(r)}}_deliverQueue(e){let i=e.current._listeners;for(;e.i<e.end;)this._deliver(i[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof Fs)this._deliver(this._listeners,e);else{let i=this._deliveryQueue;i.enqueue(this,e,this._listeners.length),this._deliverQueue(i)}this._perfMon?.stop()}hasListeners(){return this._size>0}},Eh=class{constructor(){this.i=-1,this.end=0}enqueue(e,i,s){this.i=0,this.end=s,this.current=e,this.value=i}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},Br=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new A,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new A,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(e){return this.mapWindowIdToZoomLevel.get(this.getWindowId(e))??0}setZoomLevel(e,i){if(this.getZoomLevel(i)===e)return;let s=this.getWindowId(i);this.mapWindowIdToZoomLevel.set(s,e),this._onDidChangeZoomLevel.fire(s)}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}setZoomFactor(e,i){this.mapWindowIdToZoomFactor.set(this.getWindowId(i),e)}setFullscreen(e,i){if(this.isFullscreen(i)===e)return;let s=this.getWindowId(i);this.mapWindowIdToFullScreen.set(s,e),this._onDidChangeFullscreen.fire(s)}isFullscreen(e){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(e))}getWindowId(e){return e.vscodeWindowId}};Br.INSTANCE=new Br;var pn=Br;function Mh(t,e,i){typeof e=="string"&&(e=t.matchMedia(e)),e.addEventListener("change",i)}pn.INSTANCE.onDidChangeZoomLevel;function Rh(t){return pn.INSTANCE.getZoomFactor(t)}pn.INSTANCE.onDidChangeFullscreen;var yi=typeof navigator=="object"?navigator.userAgent:"",Er=yi.indexOf("Firefox")>=0,Th=yi.indexOf("AppleWebKit")>=0,vn=yi.indexOf("Chrome")>=0,Dh=!vn&&yi.indexOf("Safari")>=0;yi.indexOf("Electron/")>=0;yi.indexOf("Android")>=0;var Ns=!1;if(typeof At.matchMedia=="function"){let t=At.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=At.matchMedia("(display-mode: fullscreen)");Ns=t.matches,Mh(At,t,({matches:i})=>{Ns&&e.matches||(Ns=
Line truncated
|
||||
`)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(c=>this._handleScroll(c)))}scrollLines(e){let i=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:i.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,i){i&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!i,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:this._optionsService.rawOptions.overviewRuler?.width||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let i=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),s=i-this._bufferService.buffer.ydisp;s!==0&&(this._latestYDisp=i,this._onRequestScrollLines.fire(s)),this._isHandlingScroll=!1}};$r=ue([P(2,Ve),P(3,$t),P(4,_a),P(5,bi),P(6,je),P(7,It)],$r);var Ir=class extends j{constructor(e,i,s,r,n){super(),this._screenElement=e,this._bufferService=i,this._coreBrowserService=s,this._decorationService=r,this._renderService=n,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this._register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this._register(this._decorationService.onDecorationRemoved(o=>this._removeDecoration(o))),this._register(re(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){let i=this._coreBrowserService.mainDocument.createElement("div");i.classList.add("xterm-decoration"),i.classList.toggle("xterm-decoration-top-layer",e?.options?.layer==="top"),i.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,i.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,i.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,i.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let s=e.options.x??0;return s&&s>this._bufferService.cols&&(i.style.display="none"),this._refreshXPosition(e,i),i}_refreshStyle(e){let i=e.marker.line-this._bufferService.buffers.active.ydisp;if(i<0||i>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let s=this._decorationElements.get(e);s||(s=this._createElement(e),e.element=s,this._decorationElements.set(e,s),this._container.appendChild(s),e.onDispose(()=>{this._decorationElements.delete(e),s.remove()})),s.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(s.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,s.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,s.style.top=`${i*this._renderServiceLine truncated
|
||||
`,t.VT="\v",t.FF="\f",t.CR="\r",t.SO="",t.SI="",t.DLE="",t.DC1="",t.DC2="",t.DC3="",t.DC4="",t.NAK="",t.SYN="",t.ETB="",t.CAN="",t.EM="",t.SUB="",t.ESC="\x1B",t.FS="",t.GS="",t.RS="",t.US="",t.SP=" ",t.DEL=""))(E||={});var us;(t=>(t.PAD="",t.HOP="",t.BPH="",t.NBH="",t.IND="",t.NEL="
",t.SSA="",t.ESA="",t.HTS="",t.HTJ="",t.VTS="",t.PLD="",t.PLU="",t.RI="",t.SS2="",t.SS3="",t.DCS="",t.PU1="",t.PU2="",t.STS="",t.CCH="",t.MW="",t.SPA="",t.EPA="",t.SOS="",t.SGCI="",t.SCI="",t.CSI="",t.ST="",t.OSC="",t.PM="",t.APC=""))(us||={});var Pa;(t=>t.ST=`${E.ESC}\\`)(Pa||={});var Or=class{constructor(e,i,s,r,n,o){this._textarea=e,this._compositionView=i,this._bufferService=s,this._optionsService=r,this._coreService=n,this._renderService=o,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){let i={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let s;i.start+=this._dataAlreadySent.length,this._isComposing?s=this._textarea.value.substring(i.start,this._compositionPosition.start):s=this._textarea.value.substring(i.start),s.length>0&&this._coreService.triggerDataEvent(s,!0)}},0)}else{this._isSendingComposition=!1;let i=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(i,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let i=this._textarea.value,s=i.replace(e,"");this._dataAlreadySent=s,i.length>e.length?this._coreService.triggerDataEvent(s,!0):i.length<e.length?this._coreService.triggerDataEvent(`${E.DEL}`,!0):i.length===e.length&&i!==e&&this._coreService.triggerDataEvent(i,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let i=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),s=this._renderService.dimensions.css.cell.height,r=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,n=i*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=n+"px",this._compositionView.style.top=r+"px",this._compositionView.style.height=s+"px",this._compositionView.style.lineHeight=s+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let o=this._compositionView.getBoundingClientRect();this._textarea.style.left=n+"px",this._textarea.style.top=r+"px",this._textarea.style.width=Math.max(o.width,1)+"px",this._textarea.style.height=Math.max(o.height,1)+"px",this._textarea.style.lineHeight=o.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};Or=ue([P(2,Ve),P(3,je),P(4,li),P(5,It)],Or);var Re=0,Te=0,De=0,ce=0,Zn={css:"#00000000",rgba:0},Se;(t=>{function e(r,n,o,l){return l!==void 0?`#${Xt(r)}${Xt(n)}${Xt(o)}${Xt(l)}`:`#${Xt(r)}${Xt(n)}${Xt(o)}`}t.toCss=e;function i(r,n,o,l=255){return(r<<24|n<<16|o<<8|l)>>>0}t.toRgba=i;function s(r,n,o,l){return{css:t.toCss(r,n,o,l),rgba:t.toRgba(r,n,o,l)}}t.toColor=s})(Se||={});var ie;(t=>{function e(h,a){if(ce=(a.rgba&255)/255,ce===1)return{css:a.css,rgba:a.rgba};let c=a.rgba>>24&255,_=a.rgba>>16&255,f=a.rgba>>8&255,d=h.rgba>>24&255,m=h.rgba>>16&255,y=h.rgba>>8&255;Re=d+Math.round((c-d)*ce),Te=m+Math.round((_-m)*ce),De=y+Math.round((f-y)*ce);let k=Se.toCss(Re,Te,De),R=Se.toRgba(Re,Te,De);return{css:k,rgba:R}}t.blend=e;function i(h){return(h.rgba&255)===255}t.isOpaque=i;function s(h,a,c){let _=_s.ensureContrastRatio(h.rgba,a.rgba,c);if(_)return Se.toColor(_>>24&255,_>>16&255,_>>8&255)}t.ensureContrastRatio=s;function r(h){let a=(h.rgba|255)>>>0;return[Re,Te,De]=_s.toChannels(a),{css:Se.toCss(Re,Te,De),rgba:a}}t.opaque=r;function n(h,a){return ce=Math.round(a*255),[Re,Te,De]=_s.toChannels(h.rgba),{css:Se.toCss(Re,Te,De,ce),rgba:Se.toRgba(Re,Te,De,ce)}}t.opacity=n;function o(h,a){return ce=h.rgba&255,n(h,ce*a/255)}t.multiplyOpacity=o;function l(h){return[h.rgba
Line truncated
|
||||
`:`
|
||||
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),Cn&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(e){let i=this._getMouseBufferCoords(e),s=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!s||!r||!i?!1:this._areCoordsInSelection(i,s,r)}isCellInSelection(e,i){let s=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!s||!r?!1:this._areCoordsInSelection([e,i],s,r)}_areCoordsInSelection(e,i,s){return e[1]>i[1]&&e[1]<s[1]||i[1]===s[1]&&e[1]===i[1]&&e[0]>=i[0]&&e[0]<s[0]||i[1]<s[1]&&e[1]===s[1]&&e[0]<s[0]||i[1]<s[1]&&e[1]===i[1]&&e[0]>=i[0]}_selectWordAtCursor(e,i){let s=this._linkifier.currentLink?.link?.range;if(s)return this._model.selectionStart=[s.start.x-1,s.start.y-1],this._model.selectionStartLength=to(s,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let r=this._getMouseBufferCoords(e);return r?(this._selectWordAt(r,i),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,i){this._model.clearSelection(),e=Math.max(e,0),i=Math.min(i,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,i],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let i=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(i)return i[0]--,i[1]--,i[1]+=this._bufferService.buffer.ydisp,i}_getMouseEventScrollAmount(e){let i=yn(this._coreBrowserService.window,e,this._screenElement)[1],s=this._renderService.dimensions.css.canvas.height;return i>=0&&i<=s?0:(i>s&&(i-=s),i=Math.min(Math.max(i,-Us),Us),i/=Us,i/Math.abs(i)+Math.round(i*(sd-1)))}shouldForceSelection(e){return xs?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),rd)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let i=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);i&&i.length!==this._model.selectionStart[0]&&i.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let i=this._getMouseBufferCoords(e);i&&(this._activeSelectionMode=2,this._selectLineAt(i[1]))}shouldColumnSelect(e){return e.altKey&&!(xs&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let i=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEven
Line truncated
|
||||
`))),this._register(this._terminal.onA11yTab(n=>this._handleTab(n))),this._register(this._terminal.onKey(n=>this._handleKey(n.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(H(r,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(re(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(t){for(let e=0;e<t;e++)this._handleChar(" ")}_handleChar(t){this._liveRegionLineCount<ko+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==t&&(this._charsToAnnounce+=t):this._charsToAnnounce+=t,t===`
|
||||
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===ko+1&&(this._liveRegion.textContent+=vr.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(t){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(t)||this._charsToConsume.push(t)}_refreshRows(t,e){this._liveRegionDebouncer.refresh(t,e,this._terminal.rows)}_renderRows(t,e){let i=this._terminal.buffer,s=i.lines.length.toString();for(let r=t;r<=e;r++){let n=i.lines.get(i.ydisp+r),o=[],l=n?.translateToString(!0,void 0,void 0,o)||"",h=(i.ydisp+r+1).toString(),a=this._rowElements[r];a&&(l.length===0?(a.textContent=" ",this._rowColumns.set(a,[0,1])):(a.textContent=l,this._rowColumns.set(a,o)),a.setAttribute("aria-posinset",h),a.setAttribute("aria-setsize",s),this._alignRowWidth(a))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(t,e){let i=t.target,s=this._rowElements[e===0?1:this._rowElements.length-2],r=i.getAttribute("aria-posinset"),n=e===0?"1":`${this._terminal.buffer.lines.length}`;if(r===n||t.relatedTarget!==s)return;let o,l;if(e===0?(o=i,l=this._rowElements.pop(),this._rowContainer.removeChild(l)):(o=this._rowElements.shift(),l=i,this._rowContainer.removeChild(o)),o.removeEventListener("focus",this._topBoundaryFocusListener),l.removeEventListener("focus",this._bottomBoundaryFocusListener),e===0){let h=this._createAccessibilityTreeNode();this._rowElements.unshift(h),this._rowContainer.insertAdjacentElement("afterbegin",h)}else{let h=this._createAccessibilityTreeNode();this._rowElements.push(h),this._rowContainer.appendChild(h)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(e===0?-1:1),this._rowElements[e===0?1:this._rowElements.length-2].focus(),t.preventDefault(),t.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let t=this._coreBrowserService.mainDocument.getSelection();if(!t)return;if(t.isCollapsed){this._rowContainer.contains(t.anchorNode)&&this._terminal.clearSelection();return}if(!t.anchorNode||!t.focusNode){console.error("anchorNode and/or focusNode are null");return}let e={node:t.anchorNode,offset:t.anchorOffset},i={node:t.focusNode,offset:t.focusOffset};if((e.node.compareDocumentPosition(i.node)&Node.DOCUMENT_POSITION_PRECEDING||e.node===i.node&&e.offset>i.offset)&&([e,i]=[i,e]),e.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(e={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(e.node))return;let s=this._rowElements.slice(-1)[0];if(i.node.compareDocumentPosition(s)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(i={node:s,offset:s.textContent?.length??0}),!this._rowContainer.contains(i.node))return;let r=({node:l,offset:h})=>{let a=l instanceof Text?l.parentNode:l,c=parseInt(a?.getAttribute("aria-posinset"),10)-1;if(isNaN(c))return console.warn("row is invalid. Race condition?"),null;let _=this._rowColumns.get(a);if(!_)return console.warn("columns is null. Race condition?"),null;let f=h<_.length?_[h]:_.slice(-1)[0]+1;return f>=this._terminal.cols&&(++c,f=0),{row:c,column:f}},n=r(e),o=r(i);if(!(!n||!o)){if(n.row>o.row||n.row===o.row&&n.column>=o.column)throw new Error("invalid range");this._terminal.select(n.column,n.row,(o.row-n.row)*this._terminal.cols-n.column+o.column)}}_handleResize(t){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let e=this._rowContainer.children.length;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let t=this._coreBrowserService.mainDocument.createElement("div");return t.setAttribute("role","listitem"),t.tabIndex=-1,this._refreshRowDimensions(t),t}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let t=0;t<this._terminal.rows;t++)this._refreshRowDimensions(this._rowElements[t]),this._alignRowWidth(this._rowElements[t])}}_refreshRowDimensions(t){t.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(t){t.style.transform="";let e=t.getBoundingClientRect().width,i=this._rowColumns.get(t)?.sli
Line truncated
|
||||
`,e)}paste(t){this._core.paste(t)}refresh(t,e){this._verifyIntegers(t,e),this._core.refresh(t,e)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(t){this._addonManager.loadAddon(this,t)}static get strings(){return{get promptLabel(){return pr.get()},set promptLabel(t){pr.set(t)},get tooMuchOutput(){return vr.get()},set tooMuchOutput(t){vr.set(t)}}}_verifyIntegers(...t){for(ft of t)if(ft===1/0||isNaN(ft)||ft%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...t){for(ft of t)if(ft&&(ft===1/0||isNaN(ft)||ft%1!==0||ft<0))throw new Error("This API only accepts positive integers")}};/**
|
||||
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
||||
* @license MIT
|
||||
*
|
||||
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
||||
* @license MIT
|
||||
*
|
||||
* Originally forked from (with the author's permission):
|
||||
* Fabrice Bellard's javascript vt100 for jslinux:
|
||||
* http://bellard.org/jslinux/
|
||||
* Copyright (c) 2011 Fabrice Bellard
|
||||
*/var ru=2,nu=1,ou=class{activate(t){this._terminal=t}dispose(){}fit(){let t=this.proposeDimensions();if(!t||!this._terminal||isNaN(t.cols)||isNaN(t.rows))return;let e=this._terminal._core;(this._terminal.rows!==t.rows||this._terminal.cols!==t.cols)&&(e._renderService.clear(),this._terminal.resize(t.cols,t.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let t=this._terminal._core._renderService.dimensions;if(t.css.cell.width===0||t.css.cell.height===0)return;let e=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,i=window.getComputedStyle(this._terminal.element.parentElement),s=parseInt(i.getPropertyValue("height")),r=Math.max(0,parseInt(i.getPropertyValue("width"))),n=window.getComputedStyle(this._terminal.element),o={top:parseInt(n.getPropertyValue("padding-top")),bottom:parseInt(n.getPropertyValue("padding-bottom")),right:parseInt(n.getPropertyValue("padding-right")),left:parseInt(n.getPropertyValue("padding-left"))},l=o.top+o.bottom,h=o.right+o.left,a=s-l,c=r-h-e;return{cols:Math.max(ru,Math.floor(c/t.css.cell.width)),rows:Math.max(nu,Math.floor(a/t.css.cell.height))}}};/**
|
||||
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
||||
* @license MIT
|
||||
*
|
||||
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
||||
* @license MIT
|
||||
*
|
||||
* Originally forked from (with the author's permission):
|
||||
* Fabrice Bellard's javascript vt100 for jslinux:
|
||||
* http://bellard.org/jslinux/
|
||||
* Copyright (c) 2011 Fabrice Bellard
|
||||
*/var au=class{constructor(t,e,i,s={}){this._terminal=t,this._regex=e,this._handler=i,this._options=s}provideLinks(t,e){let i=hu.computeLink(t,this._regex,this._terminal,this._handler);e(this._addCallbacks(i))}_addCallbacks(t){return t.map(e=>(e.leave=this._options.leave,e.hover=(i,s)=>{if(this._options.hover){let{range:r}=e;this._options.hover(i,s,r)}},e))}};function lu(t){try{let e=new URL(t),i=e.password&&e.username?`${e.protocol}//${e.username}:${e.password}@${e.host}`:e.username?`${e.protocol}//${e.username}@${e.host}`:`${e.protocol}//${e.host}`;return t.toLocaleLowerCase().startsWith(i.toLocaleLowerCase())}catch{return!1}}var hu=class gs{static computeLink(e,i,s,r){let n=new RegExp(i.source,(i.flags||"")+"g"),[o,l]=gs._getWindowedLineStrings(e-1,s),h=o.join(""),a,c=[];for(;a=n.exec(h);){let _=a[0];if(!lu(_))continue;let[f,d]=gs._mapStrIdx(s,l,0,a.index),[m,y]=gs._mapStrIdx(s,f,d,_.length);if(f===-1||d===-1||m===-1||y===-1)continue;let k={start:{x:d+1,y:f+1},end:{x:y,y:m+1}};c.push({range:k,text:_,activate:r})}return c}static _getWindowedLineStrings(e,i){let s,r=e,n=e,o=0,l="",h=[];if(s=i.buffer.active.getLine(e)){let a=s.translateToString(!0);if(s.isWrapped&&a[0]!==" "){for(o=0;(s=i.buffer.active.getLine(--r))&&o<2048&&(l=s.translateToString(!0),o+=l.length,h.push(l),!(!s.isWrapped||l.indexOf(" ")!==-1)););h.reverse()}for(h.push(a),o=0;(s=i.buffer.active.getLine(++n))&&s.isWrapped&&o<2048&&(l=s.translateToString(!0),o+=l.length,h.push(l),l.indexOf(" ")===-1););}return[h,r]}static _mapStrIdx(e,i,s,r){let n=e.buffer.active,o=n.getNullCell(),l=s;for(;r;){let h=n.getLine(i);if(!h)return[-1,-1];for(let a=l;a<h.length;++a){h.getCell(a,o);let c=o.getChars();if(o.getWidth()&&(r-=c.length||1,a===h.length-1&&c==="")){let _=n.getLine(i+1);_&&_.isWrapped&&(_.getCell(0,o),o.getWidth()===2&&(r+=1))}if(r<0)return[i,a]}i++,l=0}return[i,l]}},cu=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function du(t,e){let i=window.open();if(i){try{i.opener=null}catch{}i.location.href=e}else console.warn("Opening link blocked as opener could not be cleared")}var uu=class{constructor(t=du,e={}){this._handler=t,this._options=e}activate(t){this._terminal=t;let e=this._options,i=e.urlRegex||cu;this._linkProvider=this._terminal.registerLinkProvider(new au(this._terminal,i,this._handler,e))}dispose(){this._linkProvider?.dispose()}};/**
|
||||
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
||||
* @license MIT
|
||||
*
|
||||
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
||||
* @license MIT
|
||||
*
|
||||
* Originally forked from (with the author's permission):
|
||||
* Fabrice Bellard's javascript vt100 for jslinux:
|
||||
* http://bellard.org/jslinux/
|
||||
* Copyright (c) 2011 Fabrice Bellard
|
||||
*/var _u=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(t){setTimeout(()=>{throw t.stack?Bo.isErrorNoTelemetry(t)?new Bo(t.message+`
|
||||
|
||||
`+t.stack):new Error(t.message+`
|
||||
|
||||
`+t.stack):t},0)}}addListener(t){return this.listeners.push(t),()=>{this._removeListener(t)}}emit(t){this.listeners.forEach(e=>{e(t)})}_removeListener(t){this.listeners.splice(this.listeners.indexOf(t),1)}setUnexpectedErrorHandler(t){this.unexpectedErrorHandler=t}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(t){this.unexpectedErrorHandler(t),this.emit(t)}onUnexpectedExternalError(t){this.unexpectedErrorHandler(t)}},fu=new _u;function Xs(t){gu(t)||fu.onUnexpectedError(t)}var Qr="Canceled";function gu(t){return t instanceof pu?!0:t instanceof Error&&t.name===Qr&&t.message===Qr}var pu=class extends Error{constructor(){super(Qr),this.name=this.message}},Bo=class en extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof en)return e;let i=new en;return i.message=e.message,i.stack=e.stack,i}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}},vu;(t=>{function e(n){return n<0}t.isLessThan=e;function i(n){return n<=0}t.isLessThanOrEqual=i;function s(n){return n>0}t.isGreaterThan=s;function r(n){return n===0}t.isNeitherLessOrGreaterThan=r,t.greaterThan=1,t.lessThan=-1,t.neitherLessOrGreaterThan=0})(vu||={});function mu(t,e){let i=this,s=!1,r;return function(){return s||(s=!0,e||(r=t.apply(i,arguments))),r}}var Xa;(t=>{function e(S){return S&&typeof S=="object"&&typeof S[Symbol.iterator]=="function"}t.is=e;let i=Object.freeze([]);function s(){return i}t.empty=s;function*r(S){yield S}t.single=r;function n(S){return e(S)?S:r(S)}t.wrap=n;function o(S){return S||i}t.from=o;function*l(S){for(let L=S.length-1;L>=0;L--)yield S[L]}t.reverse=l;function h(S){return!S||S[Symbol.iterator]().next().done===!0}t.isEmpty=h;function a(S){return S[Symbol.iterator]().next().value}t.first=a;function c(S,L){let B=0;for(let $ of S)if(L($,B++))return!0;return!1}t.some=c;function _(S,L){for(let B of S)if(L(B))return B}t.find=_;function*f(S,L){for(let B of S)L(B)&&(yield B)}t.filter=f;function*d(S,L){let B=0;for(let $ of S)yield L($,B++)}t.map=d;function*m(S,L){let B=0;for(let $ of S)yield*L($,B++)}t.flatMap=m;function*y(...S){for(let L of S)yield*L}t.concat=y;function k(S,L,B){let $=B;for(let U of S)$=L($,U);return $}t.reduce=k;function*R(S,L,B=S.length){for(L<0&&(L+=S.length),B<0?B+=S.length:B>S.length&&(B=S.length);L<B;L++)yield S[L]}t.slice=R;function D(S,L=Number.POSITIVE_INFINITY){let B=[];if(L===0)return[B,S];let $=S[Symbol.iterator]();for(let U=0;U<L;U++){let Y=$.next();if(Y.done)return[B,t.empty()];B.push(Y.value)}return[B,{[Symbol.iterator](){return $}}]}t.consume=D;async function T(S){let L=[];for await(let B of S)L.push(B);return Promise.resolve(L)}t.asyncToArray=T})(Xa||={});function Hi(t){if(Xa.is(t)){let e=[];for(let i of t)if(i)try{i.dispose()}catch(s){e.push(s)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}function Ja(...t){return Ci(()=>Hi(t))}function Ci(t){return{dispose:mu(()=>{t()})}}var Za=class Qa{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Hi(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?Qa.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),void 0)}};Za.DISABLE_DISPOSED_WARNING=!1;var xn=Za,Gt=class{constructor(){this._store=new xn,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};Gt.None=Object.freeze({dispose(){}});var Bs=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e}},wu=globalThis.performance&&typeof globalThis.performance.now=="function",Su=class el{static create(e){return new el(e)}constructor(e){this._now=wu&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},kn;(t=>{t.None=()=>Gt.None;function e(v,u){return _(v,()=>{},0,void 0,!0,voi
Line truncated
|
||||
`).slice(2).join(`
|
||||
`))}},ku=class extends Error{constructor(e,i){super(e),this.name="ListenerLeakError",this.stack=i}},Lu=class extends Error{constructor(e,i){super(e),this.name="ListenerRefusalError",this.stack=i}},Bu=0,Js=class{constructor(e){this.value=e,this.id=Bu++}},Eu=2,Mu,vt=class{constructor(e){this._size=0,this._options=e,this._leakageMon=this._options?.leakWarningThreshold?new Cu(e?.onListenerError??Xs,this._options?.leakWarningThreshold??yu):void 0,this._perfMon=this._options?._profName?new bu(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,i,s)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let l=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(l);let h=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],a=new Lu(`${l}. HINT: Stack shows most frequent listener (${h[1]}-times)`,h[0]);return(this._options?.onListenerError||Xs)(a),Gt.None}if(this._disposed)return Gt.None;i&&(e=e.bind(i));let r=new Js(e),n;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=xu.create(),n=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof Js?(this._deliveryQueue??=new Ru,this._listeners=[this._listeners,r]):this._listeners.push(r):(this._options?.onWillAddFirstListener?.(this),this._listeners=r,this._options?.onDidAddFirstListener?.(this)),this._size++;let o=Ci(()=>{n?.(),this._removeListener(r)});return s instanceof xn?s.add(o):Array.isArray(s)&&s.push(o),o},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let i=this._listeners,s=i.indexOf(e);if(s===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,i[s]=void 0;let r=this._deliveryQueue.current===this;if(this._size*Eu<=i.length){let n=0;for(let o=0;o<i.length;o++)i[o]?i[n++]=i[o]:r&&(this._deliveryQueue.end--,n<this._deliveryQueue.i&&this._deliveryQueue.i--);i.length=n}}_deliver(e,i){if(!e)return;let s=this._options?.onListenerError||Xs;if(!s){e.value(i);return}try{e.value(i)}catch(r){s(r)}}_deliverQueue(e){let i=e.current._listeners;for(;e.i<e.end;)this._deliver(i[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof Js)this._deliver(this._listeners,e);else{let i=this._deliveryQueue;i.enqueue(this,e,this._listeners.length),this._deliverQueue(i)}this._perfMon?.stop()}hasListeners(){return this._size>0}},Ru=class{constructor(){this.i=-1,this.end=0}enqueue(t,e,i){this.i=0,this.end=i,this.current=t,this.value=e}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},rl=Object.freeze(function(t,e){let i=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(i)}}}),Tu;(t=>{function e(i){return i===t.None||i===t.Cancelled||i instanceof Du?!0:!i||typeof i!="object"?!1:typeof i.isCancellationRequested=="boolean"&&typeof i.onCancellationRequested=="function"}t.isCancellationToken=e,t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:kn.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:rl})})(Tu||={});var Du=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?rl:(this._emitter||(this._emitter=new vt),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},pi="en",Zs=!1,rs,ps=pi,Eo=pi,Au,Rt,si=globalThis,Qe;typeof si.vscode<"u"&&typeof si.vscode.process<"u"?Qe=si.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(Qe=process);var Pu=typeof Qe?.versions?.electron=="string",$u=Pu&&Qe?.type==="renderer";if(typeof Qe=="object"){Qe.platform,Qe.platform,Zs=Qe.platform==="linux",Zs&&Qe.env.SNAP&&Qe.env.SNAP_REVISION,Qe.env.CI||Qe.env.BUILD_ARTIFACTSTAGINGDIRECTORY,rs=pi,ps=pi;let t=Qe.env.VSCODE_NLS_CONFIG;if(t)try{let e=JSON.parse(t);rs=e.userLocale,Eo=e.osLocale,ps=e.resolvedLanguage||pi,Au=e.languagePack?.translationsConfigFile}catch{}}else typeof navigator=="object"&&!$u?(Rt=navigator.userAgent,Rt.indexOf("Windows")>=0,Rt.indexOf("Macintosh")>=0,(Rt.indexOf("Macintosh")>=0||Rt.indexOf("iP
Line truncated
|
||||
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
||||
* @license MIT
|
||||
*
|
||||
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
||||
* @license MIT
|
||||
*
|
||||
* Originally forked from (with the author's permission):
|
||||
* Fabrice Bellard's javascript vt100 for jslinux:
|
||||
* http://bellard.org/jslinux/
|
||||
* Copyright (c) 2011 Fabrice Bellard
|
||||
*/var Qs=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],Vu=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],xe;function ju(t,e){let i=0,s=e.length-1,r;if(t<e[0][0]||t>e[s][1])return!1;for(;s>=i;)if(r=i+s>>1,t>e[r][1])i=r+1;else if(t<e[r][0])s=r-1;else return!0;return!1}var Gu=class{constructor(){if(this.version="6",!xe){xe=new Uint8Array(65536),xe.fill(1),xe[0]=0,xe.fill(0,1,32),xe.fill(0,127,160),xe.fill(2,4352,4448),xe[9001]=2,xe[9002]=2,xe.fill(2,11904,42192),xe[12351]=1,xe.fill(2,44032,55204),xe.fill(2,63744,64256),xe.fill(2,65040,65050),xe.fill(2,65072,65136),xe.fill(2,65280,65377),xe.fill(2,65504,65511);for(let e=0;e<Qs.length;++e)xe.fill(0,Qs[e][0],Qs[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?xe[e]:ju(e,Vu)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,i){let s=this.wcwidth(e),r=s===0&&i!==0;if(r){let n=Ms.extractWidth(i);n===0?r=!1:n>s&&(s=n)}return Ms.createPropertyValue(0,s,r)}},Yu=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(t){setTimeout(()=>{throw t.stack?Ro.isErrorNoTelemetry(t)?new Ro(t.message+`
|
||||
|
||||
`+t.stack):new Error(t.message+`
|
||||
|
||||
`+t.stack):t},0)}}addListener(t){return this.listeners.push(t),()=>{this._removeListener(t)}}emit(t){this.listeners.forEach(e=>{e(t)})}_removeListener(t){this.listeners.splice(this.listeners.indexOf(t),1)}setUnexpectedErrorHandler(t){this.unexpectedErrorHandler=t}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(t){this.unexpectedErrorHandler(t),this.emit(t)}onUnexpectedExternalError(t){this.unexpectedErrorHandler(t)}},Xu=new Yu;function er(t){Ju(t)||Xu.onUnexpectedError(t)}var rn="Canceled";function Ju(t){return t instanceof Zu?!0:t instanceof Error&&t.name===rn&&t.message===rn}var Zu=class extends Error{constructor(){super(rn),this.name=this.message}},Ro=class nn extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof nn)return e;let i=new nn;return i.message=e.message,i.stack=e.stack,i}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}};function Qu(t,e){let i=this,s=!1,r;return function(){return s||(s=!0,e||(r=t.apply(i,arguments))),r}}var e_;(t=>{function e(n){return n<0}t.isLessThan=e;function i(n){return n<=0}t.isLessThanOrEqual=i;function s(n){return n>0}t.isGreaterThan=s;function r(n){return n===0}t.isNeitherLessOrGreaterThan=r,t.greaterThan=1,t.lessThan=-1,t.neitherLessOrGreaterThan=0})(e_||={});var ol;(t=>{function e(S){return S&&typeof S=="object"&&typeof S[Symbol.iterator]=="function"}t.is=e;let i=Object.freeze([]);function s(){return i}t.empty=s;function*r(S){yield S}t.single=r;function n(S){return e(S)?S:r(S)}t.wrap=n;function o(S){return S||i}t.from=o;function*l(S){for(let L=S.length-1;L>=0;L--)yield S[L]}t.reverse=l;function h(S){return!S||S[Symbol.iterator]().next().done===!0}t.isEmpty=h;function a(S){return S[Symbol.iterator]().next().value}t.first=a;function c(S,L){let B=0;for(let $ of S)if(L($,B++))return!0;return!1}t.some=c;function _(S,L){for(let B of S)if(L(B))return B}t.find=_;function*f(S,L){for(let B of S)L(B)&&(yield B)}t.filter=f;function*d(S,L){let B=0;for(let $ of S)yield L($,B++)}t.map=d;function*m(S,L){let B=0;for(let $ of S)yield*L($,B++)}t.flatMap=m;function*y(...S){for(let L of S)yield*L}t.concat=y;function k(S,L,B){let $=B;for(let U of S)$=L($,U);return $}t.reduce=k;function*R(S,L,B=S.length){for(L<0&&(L+=S.length),B<0?B+=S.length:B>S.length&&(B=S.length);L<B;L++)yield S[L]}t.slice=R;function D(S,L=Number.POSITIVE_INFINITY){let B=[];if(L===0)return[B,S];let $=S[Symbol.iterator]();for(let U=0;U<L;U++){let Y=$.next();if(Y.done)return[B,t.empty()];B.push(Y.value)}return[B,{[Symbol.iterator](){return $}}]}t.consume=D;async function T(S){let L=[];for await(let B of S)L.push(B);return Promise.resolve(L)}t.asyncToArray=T})(ol||={});function al(t){if(ol.is(t)){let e=[];for(let i of t)if(i)try{i.dispose()}catch(s){e.push(s)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}function t_(...t){return ll(()=>al(t))}function ll(t){return{dispose:Qu(()=>{t()})}}var hl=class cl{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{al(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?cl.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),void 0)}};hl.DISABLE_DISPOSED_WARNING=!1;var Ln=hl,Es=class{constructor(){this._store=new Ln,this._store}dispose(){this._store.dispose()}_register(t){if(t===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(t)}};Es.None=Object.freeze({dispose(){}});var i_=globalThis.performance&&typeof globalThis.performance.now=="function",s_=class dl{static create(e){return new dl(e)}constructor(e){this._now=i_&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},r_;(t=>{t.None=()=>Es.None;function e(v,u){return _(v,()=>{},0,void 0,!0,void 0,u)}t.defer=e;function i(v){return(u,p=null,g)=>{let w=!1,b;return b=v(C=>{if(!w)return b?b.dispose():w=!0,u.call(p,C)},null,g),w&&b.dispose(),b}}t.once=i;function s(v,u,p){return a((g,w=null,b)=>v(C=>g.call(w,u(C)),null,b),p)}t.map=s;function r(v,u,p){return a((g,w=null,b)=>v(C=>{u(C),g.call(w,C)},null,b),p)}t.forEach=r;function n(v,u,p
Line truncated
|
||||
`).slice(2).join(`
|
||||
`))}},h_=class extends Error{constructor(e,i){super(e),this.name="ListenerLeakError",this.stack=i}},c_=class extends Error{constructor(e,i){super(e),this.name="ListenerRefusalError",this.stack=i}},d_=0,tr=class{constructor(t){this.value=t,this.id=d_++}},u_=2,__,Ht=class{constructor(e){this._size=0,this._options=e,this._leakageMon=this._options?.leakWarningThreshold?new a_(e?.onListenerError??er,this._options?.leakWarningThreshold??o_):void 0,this._perfMon=this._options?._profName?new n_(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,i,s)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let l=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(l);let h=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],a=new c_(`${l}. HINT: Stack shows most frequent listener (${h[1]}-times)`,h[0]);return(this._options?.onListenerError||er)(a),Es.None}if(this._disposed)return Es.None;i&&(e=e.bind(i));let r=new tr(e),n;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=l_.create(),n=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof tr?(this._deliveryQueue??=new f_,this._listeners=[this._listeners,r]):this._listeners.push(r):(this._options?.onWillAddFirstListener?.(this),this._listeners=r,this._options?.onDidAddFirstListener?.(this)),this._size++;let o=ll(()=>{n?.(),this._removeListener(r)});return s instanceof Ln?s.add(o):Array.isArray(s)&&s.push(o),o},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let i=this._listeners,s=i.indexOf(e);if(s===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,i[s]=void 0;let r=this._deliveryQueue.current===this;if(this._size*u_<=i.length){let n=0;for(let o=0;o<i.length;o++)i[o]?i[n++]=i[o]:r&&(this._deliveryQueue.end--,n<this._deliveryQueue.i&&this._deliveryQueue.i--);i.length=n}}_deliver(e,i){if(!e)return;let s=this._options?.onListenerError||er;if(!s){e.value(i);return}try{e.value(i)}catch(r){s(r)}}_deliverQueue(e){let i=e.current._listeners;for(;e.i<e.end;)this._deliver(i[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof tr)this._deliver(this._listeners,e);else{let i=this._deliveryQueue;i.enqueue(this,e,this._listeners.length),this._deliverQueue(i)}this._perfMon?.stop()}hasListeners(){return this._size>0}},f_=class{constructor(){this.i=-1,this.end=0}enqueue(t,e,i){this.i=0,this.end=i,this.current=t,this.value=e}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},Ms=class vs{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new Ht,this.onChange=this._onChange.event;let e=new Gu;this.register(e),this._active=e.version,this._activeProvider=e}static extractShouldJoin(e){return(e&1)!==0}static extractWidth(e){return e>>1&3}static extractCharKind(e){return e>>3}static createPropertyValue(e,i,s=!1){return(e&16777215)<<3|(i&3)<<1|(s?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(e){if(!this._providers[e])throw new Error(`unknown Unicode version "${e}"`);this._active=e,this._activeProvider=this._providers[e],this._onChange.fire(e)}register(e){this._providers[e.version]=e}wcwidth(e){return this._activeProvider.wcwidth(e)}getStringCellWidth(e){let i=0,s=0,r=e.length;for(let n=0;n<r;++n){let o=e.charCodeAt(n);if(55296<=o&&o<=56319){if(++n>=r)return i+this.wcwidth(o);let a=e.charCodeAt(n);56320<=a&&a<=57343?o=(o-55296)*1024+a-56320+65536:i+=this.wcwidth(a)}let l=this.charProperties(o,s),h=vs.extractWidth(l);vs.extractShouldJoin(l)&&(h-=vs.extractWidth(s)),i+=h,s=l}return i}charProperties(e,i){return this._activeProvider.charProperties(e,i)}},ir=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[253
Line truncated
|
||||
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
||||
* @license MIT
|
||||
*
|
||||
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
||||
* @license MIT
|
||||
*
|
||||
* Originally forked from (with the author's permission):
|
||||
* Fabrice Bellard's javascript vt100 for jslinux:
|
||||
* http://bellard.org/jslinux/
|
||||
* Copyright (c) 2011 Fabrice Bellard
|
||||
*/var w_=(t,e,i,s)=>{for(var r=e,n=t.length-1,o;n>=0;n--)(o=t[n])&&(r=o(r)||r);return r},S_=(t,e)=>(i,s)=>e(i,s,t),b_=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(t){setTimeout(()=>{throw t.stack?Do.isErrorNoTelemetry(t)?new Do(t.message+`
|
||||
|
||||
`+t.stack):new Error(t.message+`
|
||||
|
||||
`+t.stack):t},0)}}addListener(t){return this.listeners.push(t),()=>{this._removeListener(t)}}emit(t){this.listeners.forEach(e=>{e(t)})}_removeListener(t){this.listeners.splice(this.listeners.indexOf(t),1)}setUnexpectedErrorHandler(t){this.unexpectedErrorHandler=t}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(t){this.unexpectedErrorHandler(t),this.emit(t)}onUnexpectedExternalError(t){this.unexpectedErrorHandler(t)}},y_=new b_;function rr(t){C_(t)||y_.onUnexpectedError(t)}var ln="Canceled";function C_(t){return t instanceof x_?!0:t instanceof Error&&t.name===ln&&t.message===ln}var x_=class extends Error{constructor(){super(ln),this.name=this.message}},Do=class hn extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof hn)return e;let i=new hn;return i.message=e.message,i.stack=e.stack,i}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}},k_;(t=>{function e(n){return n<0}t.isLessThan=e;function i(n){return n<=0}t.isLessThanOrEqual=i;function s(n){return n>0}t.isGreaterThan=s;function r(n){return n===0}t.isNeitherLessOrGreaterThan=r,t.greaterThan=1,t.lessThan=-1,t.neitherLessOrGreaterThan=0})(k_||={});function L_(t,e){let i=this,s=!1,r;return function(){return s||(s=!0,e||(r=t.apply(i,arguments))),r}}var gl;(t=>{function e(S){return S&&typeof S=="object"&&typeof S[Symbol.iterator]=="function"}t.is=e;let i=Object.freeze([]);function s(){return i}t.empty=s;function*r(S){yield S}t.single=r;function n(S){return e(S)?S:r(S)}t.wrap=n;function o(S){return S||i}t.from=o;function*l(S){for(let L=S.length-1;L>=0;L--)yield S[L]}t.reverse=l;function h(S){return!S||S[Symbol.iterator]().next().done===!0}t.isEmpty=h;function a(S){return S[Symbol.iterator]().next().value}t.first=a;function c(S,L){let B=0;for(let $ of S)if(L($,B++))return!0;return!1}t.some=c;function _(S,L){for(let B of S)if(L(B))return B}t.find=_;function*f(S,L){for(let B of S)L(B)&&(yield B)}t.filter=f;function*d(S,L){let B=0;for(let $ of S)yield L($,B++)}t.map=d;function*m(S,L){let B=0;for(let $ of S)yield*L($,B++)}t.flatMap=m;function*y(...S){for(let L of S)yield*L}t.concat=y;function k(S,L,B){let $=B;for(let U of S)$=L($,U);return $}t.reduce=k;function*R(S,L,B=S.length){for(L<0&&(L+=S.length),B<0?B+=S.length:B>S.length&&(B=S.length);L<B;L++)yield S[L]}t.slice=R;function D(S,L=Number.POSITIVE_INFINITY){let B=[];if(L===0)return[B,S];let $=S[Symbol.iterator]();for(let U=0;U<L;U++){let Y=$.next();if(Y.done)return[B,t.empty()];B.push(Y.value)}return[B,{[Symbol.iterator](){return $}}]}t.consume=D;async function T(S){let L=[];for await(let B of S)L.push(B);return Promise.resolve(L)}t.asyncToArray=T})(gl||={});function pl(t){if(gl.is(t)){let e=[];for(let i of t)if(i)try{i.dispose()}catch(s){e.push(s)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}function vl(...t){return We(()=>pl(t))}function We(t){return{dispose:L_(()=>{t()})}}var ml=class wl{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{pl(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?wl.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),void 0)}};ml.DISABLE_DISPOSED_WARNING=!1;var wi=ml,dt=class{constructor(){this._store=new wi,this._store}dispose(){this._store.dispose()}_register(t){if(t===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(t)}};dt.None=Object.freeze({dispose(){}});var Ti=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(t){this._isDisposed||t===this._value||(this._value?.dispose(),this._value=t)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}clearAndLeak(){let t=this._value;return this._value=void 0,t}},Bn=typeof process<"u"&&"title"in process,$s=Bn?"node":navigator.userAgent,B_=Bn?"node":navigator.platform,E_=$s.includes("Firefox"),M_=$s.includes("Edge"),Sl=/^((?!chrome|android).)*safari/i.test($s);function R_(){if(!Sl)return 0;let t=$s.match(/Version\/(\d+)/);return t===null||t.length<2?0:parseInt(t[1])}B_.indexOf("Linux")>=0;var T_="",Ae=0,Pe=0,$e=0,de=0,ot={css:"#00000000",rgba:0},Ke;(t=>{function e(r,n,o,l){return l!==void 0?`#${Jt(r)}${Jt(n)}${Jt(o)}${Jt(l)}`:`#${Jt(r)}${Jt(n)}${Jt(o)}`}t.toCss=e;function i(r,n,o,l=
Line truncated
|
||||
`).slice(2).join(`
|
||||
`))}},of=class extends Error{constructor(t,e){super(t),this.name="ListenerLeakError",this.stack=e}},af=class extends Error{constructor(t,e){super(t),this.name="ListenerRefusalError",this.stack=e}},lf=0,or=class{constructor(t){this.value=t,this.id=lf++}},hf=2,cf,se=class{constructor(t){this._size=0,this._options=t,this._leakageMon=this._options?.leakWarningThreshold?new rf(t?.onListenerError??rr,this._options?.leakWarningThreshold??sf):void 0,this._perfMon=this._options?._profName?new tf(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(t,e,i)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let o=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(o);let l=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],h=new af(`${o}. HINT: Stack shows most frequent listener (${l[1]}-times)`,l[0]);return(this._options?.onListenerError||rr)(h),dt.None}if(this._disposed)return dt.None;e&&(t=t.bind(e));let s=new or(t),r;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(s.stack=nf.create(),r=this._leakageMon.check(s.stack,this._size+1)),this._listeners?this._listeners instanceof or?(this._deliveryQueue??=new df,this._listeners=[this._listeners,s]):this._listeners.push(s):(this._options?.onWillAddFirstListener?.(this),this._listeners=s,this._options?.onDidAddFirstListener?.(this)),this._size++;let n=We(()=>{r?.(),this._removeListener(s)});return i instanceof wi?i.add(n):Array.isArray(i)&&i.push(n),n},this._event}_removeListener(t){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let e=this._listeners,i=e.indexOf(t);if(i===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,e[i]=void 0;let s=this._deliveryQueue.current===this;if(this._size*hf<=e.length){let r=0;for(let n=0;n<e.length;n++)e[n]?e[r++]=e[n]:s&&(this._deliveryQueue.end--,r<this._deliveryQueue.i&&this._deliveryQueue.i--);e.length=r}}_deliver(t,e){if(!t)return;let i=this._options?.onListenerError||rr;if(!i){t.value(e);return}try{t.value(e)}catch(s){i(s)}}_deliverQueue(t){let e=t.current._listeners;for(;t.i<t.end;)this._deliver(e[t.i++],t.value);t.reset()}fire(t){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof or)this._deliver(this._listeners,t);else{let e=this._deliveryQueue;e.enqueue(this,t,this._listeners.length),this._deliverQueue(e)}this._perfMon?.stop()}hasListeners(){return this._size>0}},df=class{constructor(){this.i=-1,this.end=0}enqueue(t,e,i){this.i=0,this.end=i,this.current=t,this.value=e}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},Oo={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}},Di=2,Ai,Ut=class fi{constructor(e,i,s){this._document=e,this._config=i,this._unicodeService=s,this._didWarmUp=!1,this._cacheMap=new Io,this._cacheMapCombined=new Io,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new vi,this._textureSize=512,this._onAddTextureAtlasCanvas=new se,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new se,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=Al(e,this._config.deviceCellWidth*4+Di*2,this._config.deviceCellHeight+Di*2),this._tmpCtx=we(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}get pages(){return this._pages}dispose(){this._tmpCanvas.remove();for(let e of this.pages)e.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){let e=new Z_;for(let i=33;i<126;i++)e.enqueue(()=>{if(!this._cacheMap.get(i,0,0,0)){let s=this._drawToCache(i,0,0,0,!1,void 0);this._cacheMap.set(i,0,0,0,s)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(!(this._pages[0].currentRow.x===0&&this._pages[0].currentRow.y===0)){for(let e of this._pages)e.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(fi.maxAtlasPages&&this._pages.length>=Math.max(4,fi.maxAtlasPages)){let i=this._pages.filter(a=>a.canvas.width*2<=(fi.maxTextureS
Line truncated
|
||||
layout (location = 0) in vec2 a_unitquad;
|
||||
layout (location = 1) in vec2 a_cellpos;
|
||||
layout (location = 2) in vec2 a_offset;
|
||||
layout (location = 3) in vec2 a_size;
|
||||
layout (location = 4) in float a_texpage;
|
||||
layout (location = 5) in vec2 a_texcoord;
|
||||
layout (location = 6) in vec2 a_texsize;
|
||||
|
||||
uniform mat4 u_projection;
|
||||
uniform vec2 u_resolution;
|
||||
|
||||
out vec2 v_texcoord;
|
||||
flat out int v_texpage;
|
||||
|
||||
void main() {
|
||||
vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);
|
||||
gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
|
||||
v_texpage = int(a_texpage);
|
||||
v_texcoord = a_texcoord + a_unitquad * a_texsize;
|
||||
}`;function Sf(t){let e="";for(let i=1;i<t;i++)e+=` else if (v_texpage == ${i}) { outColor = texture(u_texture[${i}], v_texcoord); }`;return`#version 300 es
|
||||
precision lowp float;
|
||||
|
||||
in vec2 v_texcoord;
|
||||
flat in int v_texpage;
|
||||
|
||||
uniform sampler2D u_texture[${t}];
|
||||
|
||||
out vec4 outColor;
|
||||
|
||||
void main() {
|
||||
if (v_texpage == 0) {
|
||||
outColor = texture(u_texture[0], v_texcoord);
|
||||
} ${e}
|
||||
}`}var qt=11,ui=qt*Float32Array.BYTES_PER_ELEMENT,bf=2,he=0,te,hr=0,Pi=0,yf=class extends dt{constructor(t,e,i,s){super(),this._terminal=t,this._gl=e,this._dimensions=i,this._optionsService=s,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};let r=this._gl;Ut.maxAtlasPages===void 0&&(Ut.maxAtlasPages=Math.min(32,we(r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS))),Ut.maxTextureSize=we(r.getParameter(r.MAX_TEXTURE_SIZE))),this._program=we(Ol(r,wf,Sf(Ut.maxAtlasPages))),this._register(We(()=>r.deleteProgram(this._program))),this._projectionLocation=we(r.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=we(r.getUniformLocation(this._program,"u_resolution")),this._textureLocation=we(r.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=r.createVertexArray(),r.bindVertexArray(this._vertexArrayObject);let n=new Float32Array([0,0,1,0,0,1,1,1]),o=r.createBuffer();this._register(We(()=>r.deleteBuffer(o))),r.bindBuffer(r.ARRAY_BUFFER,o),r.bufferData(r.ARRAY_BUFFER,n,r.STATIC_DRAW),r.enableVertexAttribArray(0),r.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);let l=new Uint8Array([0,1,2,3]),h=r.createBuffer();this._register(We(()=>r.deleteBuffer(h))),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,h),r.bufferData(r.ELEMENT_ARRAY_BUFFER,l,r.STATIC_DRAW),this._attributesBuffer=we(r.createBuffer()),this._register(We(()=>r.deleteBuffer(this._attributesBuffer))),r.bindBuffer(r.ARRAY_BUFFER,this._attributesBuffer),r.enableVertexAttribArray(2),r.vertexAttribPointer(2,2,r.FLOAT,!1,ui,0),r.vertexAttribDivisor(2,1),r.enableVertexAttribArray(3),r.vertexAttribPointer(3,2,r.FLOAT,!1,ui,2*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(3,1),r.enableVertexAttribArray(4),r.vertexAttribPointer(4,1,r.FLOAT,!1,ui,4*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(4,1),r.enableVertexAttribArray(5),r.vertexAttribPointer(5,2,r.FLOAT,!1,ui,5*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(5,1),r.enableVertexAttribArray(6),r.vertexAttribPointer(6,2,r.FLOAT,!1,ui,7*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(6,1),r.enableVertexAttribArray(1),r.vertexAttribPointer(1,2,r.FLOAT,!1,ui,9*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(1,1),r.useProgram(this._program);let a=new Int32Array(Ut.maxAtlasPages);for(let c=0;c<Ut.maxAtlasPages;c++)a[c]=c;r.uniform1iv(this._textureLocation,a),r.uniformMatrix4fv(this._projectionLocation,!1,Il),this._atlasTextures=[];for(let c=0;c<Ut.maxAtlasPages;c++){let _=new mf(we(r.createTexture()));this._register(We(()=>r.deleteTexture(_.texture))),r.activeTexture(r.TEXTURE0+c),r.bindTexture(r.TEXTURE_2D,_.texture),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,1,1,0,r.RGBA,r.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[c]=_}r.enable(r.BLEND),r.blendFunc(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return this._atlas?this._atlas.beginFrame():!0}updateCell(t,e,i,s,r,n,o,l,h){this._updateCell(this._vertices.attributes,t,e,i,s,r,n,o,l,h)}_updateCell(t,e,i,s,r,n,o,l,h,a){if(he=(i*this._terminal.cols+e)*qt,s===0||s===void 0){t.fill(0,he,he+qt-1-bf);return}this._atlas&&(l&&l.length>1?te=this._atlas.getRasterizedGlyphCombinedChar(l,r,n,o,!1,this._terminal.element):te=this._atlas.getRasterizedGlyph(s,r,n,o,!1,this._terminal.element),hr=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),r!==a&&te.offset.x>hr?(Pi=te.offset.x-hr,t[he]=-(te.offset.x-Pi)+this._dimensions.device.char.left,t[he+1]=-te.offset.y+this._dimensions.device.char.top,t[he+2]=(te.size.x-Pi)/this._dimensions.device.canvas.width,t[he+3]=te.size.y/this._dimensions.device.canvas.height,t[he+4]=te.texturePage,t[he+5]=te.texturePositionClipSpace.x+Pi/this._atlas.pages[te.texturePage].canvas.width,t[he+6]=te.texturePositionClipSpace.y,t[he+7]=te.sizeClipSpace.x-Pi/this._atlas.pages[te.texturePage].canvas.width,t[he+8]=te.sizeClipSpace.y):(t[he]=-te.offset.x+this._dimensions.device.char.left,t[he+1]=-te.offset.y+this._dimensions.device.char.top,t[he+2]=te.size.x/this._dimensions.device.canvas.width,t[he+3]=te.size.y/this._dimensions.device.canvas.height,t[he+4]=te.texturePage,t[he+5]=te.texturePositionClipSpace.x,t[he+6]=te.texturePositionClipSpace.y,t[he+7]=te.sizeClipSpace.x,t[he+8]=te.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&O_(s,h,te.size.x,this._dimensions.device.cell.width)&&(t[he+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width))}clear(){let t=this._terminal,e=t.cols*t.rows*qt;this._vertices.count!==e?this._vertices.attributes=new Float32Array(e):this._vertices.attributes.fill(0);let i=0;for(;i<this._vertices.attributesBuffers.length;i++)this._vertices.count!==e?this._vertices.attributesBuffers[i]=new Float32Array(e):this._vertices.attributesBuffers[i].fill(0);this.
Line truncated
|
||||
layout (location = 0) in vec2 a_position;
|
||||
layout (location = 1) in vec2 a_size;
|
||||
layout (location = 2) in vec4 a_color;
|
||||
layout (location = 3) in vec2 a_unitquad;
|
||||
|
||||
uniform mat4 u_projection;
|
||||
|
||||
out vec4 v_color;
|
||||
|
||||
void main() {
|
||||
vec2 zeroToOne = a_position + (a_unitquad * a_size);
|
||||
gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
|
||||
v_color = a_color;
|
||||
}`,Ef=`#version 300 es
|
||||
precision lowp float;
|
||||
|
||||
in vec4 v_color;
|
||||
|
||||
out vec4 outColor;
|
||||
|
||||
void main() {
|
||||
outColor = v_color;
|
||||
}`,Dt=8,dr=Dt*Float32Array.BYTES_PER_ELEMENT,Mf=20*Dt,Uo=class{constructor(){this.attributes=new Float32Array(Mf),this.count=0}},Et=0,qo=0,Ko=0,Vo=0,jo=0,Go=0,Yo=0,Rf=class extends dt{constructor(t,e,i,s){super(),this._terminal=t,this._gl=e,this._dimensions=i,this._themeService=s,this._vertices=new Uo,this._verticesCursor=new Uo;let r=this._gl;this._program=we(Ol(r,Bf,Ef)),this._register(We(()=>r.deleteProgram(this._program))),this._projectionLocation=we(r.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=r.createVertexArray(),r.bindVertexArray(this._vertexArrayObject);let n=new Float32Array([0,0,1,0,0,1,1,1]),o=r.createBuffer();this._register(We(()=>r.deleteBuffer(o))),r.bindBuffer(r.ARRAY_BUFFER,o),r.bufferData(r.ARRAY_BUFFER,n,r.STATIC_DRAW),r.enableVertexAttribArray(3),r.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let l=new Uint8Array([0,1,2,3]),h=r.createBuffer();this._register(We(()=>r.deleteBuffer(h))),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,h),r.bufferData(r.ELEMENT_ARRAY_BUFFER,l,r.STATIC_DRAW),this._attributesBuffer=we(r.createBuffer()),this._register(We(()=>r.deleteBuffer(this._attributesBuffer))),r.bindBuffer(r.ARRAY_BUFFER,this._attributesBuffer),r.enableVertexAttribArray(0),r.vertexAttribPointer(0,2,r.FLOAT,!1,dr,0),r.vertexAttribDivisor(0,1),r.enableVertexAttribArray(1),r.vertexAttribPointer(1,2,r.FLOAT,!1,dr,2*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(1,1),r.enableVertexAttribArray(2),r.vertexAttribPointer(2,4,r.FLOAT,!1,dr,4*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(2,1),this._updateCachedColors(s.colors),this._register(this._themeService.onChangeColors(a=>{this._updateCachedColors(a),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(t){let e=this._gl;e.useProgram(this._program),e.bindVertexArray(this._vertexArrayObject),e.uniformMatrix4fv(this._projectionLocation,!1,Il),e.bindBuffer(e.ARRAY_BUFFER,this._attributesBuffer),e.bufferData(e.ARRAY_BUFFER,t.attributes,e.DYNAMIC_DRAW),e.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,e.UNSIGNED_BYTE,0,t.count)}handleResize(){this._updateViewportRectangle()}setDimensions(t){this._dimensions=t}_updateCachedColors(t){this._bgFloat=this._colorToFloat32Array(t.background),this._cursorFloat=this._colorToFloat32Array(t.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(t){let e=this._terminal,i=this._vertices,s=1,r,n,o,l,h,a,c,_,f,d,m;for(r=0;r<e.rows;r++){for(o=-1,l=0,h=0,a=!1,n=0;n<e.cols;n++)c=(r*e.cols+n)*Rs,_=t.cells[c+ms],f=t.cells[c+ws],d=!!(f&67108864),(_!==l||f!==h&&(a||d))&&((l!==0||a&&h!==0)&&(m=s++*Dt,this._updateRectangle(i,m,h,l,o,n,r)),o=n,l=_,h=f,a=d);(l!==0||a&&h!==0)&&(m=s++*Dt,this._updateRectangle(i,m,h,l,o,e.cols,r))}i.count=s}updateCursor(t){let e=this._verticesCursor,i=t.cursor;if(!i||i.style==="block"){e.count=0;return}let s,r=0;(i.style==="bar"||i.style==="outline")&&(s=r++*Dt,this._addRectangleFloat(e.attributes,s,i.x*this._dimensions.device.cell.width,i.y*this._dimensions.device.cell.height,i.style==="bar"?i.dpr*i.cursorWidth:i.dpr,this._dimensions.device.cell.height,this._cursorFloat)),(i.style==="underline"||i.style==="outline")&&(s=r++*Dt,this._addRectangleFloat(e.attributes,s,i.x*this._dimensions.device.cell.width,(i.y+1)*this._dimensions.device.cell.height-i.dpr,i.width*this._dimensions.device.cell.width,i.dpr,this._cursorFloat)),i.style==="outline"&&(s=r++*Dt,this._addRectangleFloat(e.attributes,s,i.x*this._dimensions.device.cell.width,i.y*this._dimensions.device.cell.height,i.width*this._dimensions.device.cell.width,i.dpr,this._cursorFloat),s=r++*Dt,this._addRectangleFloat(e.attributes,s,(i.x+i.width)*this._dimensions.device.cell.width-i.dpr,i.y*this._dimensions.device.cell.height,i.dpr,this._dimensions.device.cell.height,this._cursorFloat)),e.count=r}_updateRectangle(t,e,i,s,r,n,o){if(i&67108864)switch(i&50331648){case 16777216:case 33554432:Et=this._themeService.colors.ansi[i&255].rgba;break;case 50331648:Et=(i&16777215)<<8;break;case 0:default:Et=this._themeService.colors.foreground.rgba}else switch(s&50331648){case 16777216:case 33554432:Et=this._themeService.colors.ansi[s&255].rgba;break;case 50331648:Et=(s&16777215)<<8;break;case 0:default:Et=this._themeService.colors.background.rgba}t.attributes.length<e+4&&(t.attributes=vf(t.attributes,this._terminal.rows*this._terminal.cols*Dt)),qo=r*this._dimensions.device.cell.width,Ko=o*this._dimensions.device.cell.height,Vo=(Et>>24&255)/255,jo=(Et>>16&255)/255,Go=(Et>>8&255)/255,Yo=1,this._addRectangle(t.attributes,e,qo,Ko,(n-r)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,Vo,jo,Go,Yo)}_addRectangle(t,e,i,s,r,n,o,l,h,a){t[e]=i/this._dimensions.device.canvas.width,t[e+1]=s/this._dimensions.device.canvas.heigh
Line truncated
|
||||
\x1B[1;36m❯\x1B[0m `)},v=O=>{if(!(!d||!O)){d.write(`\x1B[90m${O}\x1B[0m`);for(let I=0;I<O.length;I++)d.write("\b")}},u=()=>{if(!(!d||!T)){for(let O=0;O<T.length;O++)d.write(" ");for(let O=0;O<T.length;O++)d.write("\b");T=""}},p=O=>{if(!d)return;const I=O.charCodeAt(0);if(I===13){u(),d.write(`\r
|
||||
`),k.trim()?(w(k.trim()),R.push(k.trim()),D=R.length):W(),k="";return}if(I===127){k.length>0&&(u(),k=k.slice(0,-1),d.write("\b \b"),g());return}if(I===3){u(),d.write(`^C\r
|
||||
`),k="",W();return}if(I===12){d.clear(),k="",W();return}if(I===6){h.value=!h.value;return}if(O==="\x1B[A"){R.length>0&&D>0&&(u(),D--,d.write("\r\x1B[K"),W(),k=R[D],d.write(k));return}if(O==="\x1B[B"){u(),D<R.length-1?(D++,d.write("\r\x1B[K"),W(),k=R[D],d.write(k)):D===R.length-1&&(D=R.length,d.write("\r\x1B[K"),W(),k="");return}if(O==="\x1B[C"&&T&&!c.value){u();const G=T;k+=G,d.write(G),T="";return}if(I===9){u();const G=k.toLowerCase(),X=k.split(/\s+/),_e=X[0]?.toLowerCase();if(X.length>2&&Y[_e]){const N=X[1]?.toLowerCase(),be=X.slice(2).join(" ").toLowerCase(),fe=Y[_e][N];if(fe){const ee=fe.filter(He=>He.toLowerCase().startsWith(be));if(ee.length===1){const He=X.slice(2).join(" "),ve=ee[0].slice(He.length);k+=ve,d.write(ve)}else ee.length>1&&(d.write(`\r
|
||||
\r
|
||||
\x1B[33mAvailable values:\x1B[0m\r
|
||||
\r
|
||||
`),ee.forEach(He=>{d.writeln(` \x1B[36m${He}\x1B[0m`)}),W(),d.write(k));return}}if(X.length>1&&U[_e]){if(_e==="ping"){const fe=X.slice(1).join(" ").toLowerCase(),ee=Date.now();ee-$>3e4&&na().then(ve=>{B=ve,$=ee,U.ping=ve});const He=B.filter(ve=>ve.toLowerCase().startsWith(fe));if(He.length===1){const ve=X.slice(1).join(" "),hi=He[0].slice(ve.length)+" ";k+=hi,d.write(hi)}else He.length>1?(d.write(`\r
|
||||
\r
|
||||
\x1B[33mAvailable neighbors:\x1B[0m\r
|
||||
\r
|
||||
`),He.forEach(ve=>{d.writeln(` \x1B[36m${ve}\x1B[0m`)}),W(),d.write(k)):B.length===0&&fe===""&&(d.write(`\r
|
||||
\r
|
||||
\x1B[33mFetching neighbors...\x1B[0m\r
|
||||
`),na().then(ve=>{B=ve,$=ee,U.ping=ve,d.write(`\r
|
||||
\x1B[33mAvailable neighbors:\x1B[0m\r
|
||||
\r
|
||||
`),ve.forEach(hi=>{d.writeln(` \x1B[36m${hi}\x1B[0m`)}),W(),d.write(k)}).catch(()=>{d.write(`\r
|
||||
\x1B[31mFailed to fetch neighbors\x1B[0m\r
|
||||
`),W(),d.write(k)}));return}const N=X.slice(1).join(" ").toLowerCase(),be=U[_e].filter(fe=>fe.toLowerCase().startsWith(N));if(be.length===1){const fe=X.slice(1).join(" "),ee=be[0].slice(fe.length)+" ";k+=ee,d.write(ee)}else if(be.length>1){d.write(`\r
|
||||
\r
|
||||
\x1B[33mAvailable parameters:\x1B[0m\r
|
||||
\r
|
||||
`);const fe=le[_e]||{};be.forEach(ee=>{const He=fe[ee]||"",ve=ee.padEnd(20);d.writeln(` \x1B[36m${ve}\x1B[0m\x1B[90m${He}\x1B[0m`)}),W(),d.write(k)}return}const Be=S.getAllCommands().filter(N=>!!(N.name.toLowerCase().startsWith(G)||N.aliases?.some(be=>be.toLowerCase().startsWith(G))));if(Be.length===1){const N=Be[0].name.slice(k.length)+" ";k+=N,d.write(N)}else Be.length>1&&(d.write(`\r
|
||||
\r
|
||||
\x1B[33mAvailable commands:\x1B[0m\r
|
||||
\r
|
||||
`),Be.forEach(N=>{const be=N.aliases&&N.aliases.length>0?` (${N.aliases.join(", ")})`:"";d.writeln(` \x1B[36m${N.name.padEnd(15)}\x1B[0m ${N.description}${be}`)}),W(),d.write(k));return}I>=32&&I<127&&(u(),k+=O,d.write(O),c.value||g())},g=()=>{if(k.length===0){T="";return}const O=L.filter(I=>I.startsWith(k.toLowerCase()));O.length===1&&O[0]!==k?(T=O[0].slice(k.length),v(T)):T=""},w=async O=>{if(!d)return;const I=O.trim(),[G,...X]=I.split(/\s+/),_e=S.findCommand(G);if(_e)try{await _e.execute({term:d,args:X,writePrompt:W})}catch(Le){console.error("Command execution error:",Le),d.writeln(`\x1B[1;31m✗ Error:\x1B[0m ${Le instanceof Error?Le.message:"Command failed"}`),W()}else d.writeln(`\x1B[1;31m✗ Unknown command:\x1B[0m ${G}`),d.writeln("\x1B[90mType \x1B[36mhelp\x1B[90m for available commands\x1B[0m"),W()},b=()=>{!y||!l.value||y.findNext(l.value,{caseSensitive:!1})},C=()=>{!y||!l.value||y.findPrevious(l.value,{caseSensitive:!1})},x=()=>{h.value=!1,l.value="",d?.focus()},M=async()=>{if(o.value){if(_.value)try{document.exitFullscreen&&await document.exitFullscreen(),_.value=!1}catch(O){console.error("Failed to exit fullscreen:",O)}else try{o.value.requestFullscreen&&await o.value.requestFullscreen(),_.value=!0,setTimeout(()=>{c.value&&n.value?n.value.focus():d&&d.focus()},100)}catch(O){console.error("Failed to enter fullscreen:",O)}setTimeout(()=>{m?.fit()},100)}},F=()=>{f.value=!f.value,f.value&&c.value&&setTimeout(()=>{window.scrollTo(0,1)},100),setTimeout(()=>{c.value&&n.value?n.value.focus():d?.focus(),m?.fit()},150)},K=()=>{f.value=!1,setTimeout(()=>{m?.fit()},100)};ql(e,O=>{d&&(d.options.theme=O==="dark"?i:s)}),typeof document<"u"&&(document.addEventListener("fullscreenchange",()=>{_.value=!!document.fullscreenElement,setTimeout(()=>m?.fit(),100)}),document.addEventListener("keydown",O=>{O.key==="Escape"&&f.value&&!_.value&&K()}),document.addEventListener("keydown",O=>{O.key==="Escape"&&f.value&&!_.value&&K()}));const z=()=>{c.value&&n.value&&n.value.focus()},pe=O=>{const I=O.target,G=I.value;if(G&&d){const X=G.slice(-1);p(X)}I.value=""},q=()=>{d&&p("\r"),n.value&&(n.value.value="")},ne=()=>{d&&p(""),n.value&&(n.value.value="")};return(O,I)=>(it(),tt("div",mg,[Z("div",wg,[Z("div",Sg,[I[8]||(I[8]=Z("div",null,[Z("h1",{class:"text-content-primary dark:text-content-primary text-lg md:text-xl font-semibold"},"Terminal"),Z("p",{class:"text-content-secondary dark:text-content-muted text-sm hidden md:block"},"Interactive command-line interface")],-1)),Z("div",bg,[c.value?(it(),tt("button",{key:0,onClick:F,class:"flex items-center gap-2 px-3 py-2 bg-accent-purple/20 hover:bg-accent-purple/30 text-accent-purple border border-accent-purple/50 rounded-lg transition-colors",title:f.value?"Exit fullscreen":"Enter fullscreen"},[f.value?(it(),tt("svg",xg,I[3]||(I[3]=[Z("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"},null,-1)]))):(it(),tt("svg",Cg,I[2]||(I[2]=[Z("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4"},null,-1)]))),Z("span",kg,Is(f.value?"Exit":"Fullscreen"),1)],8,yg)):Yt("",!0),c.value?Yt("",!0):(it(),tt("button",{key:1,onClick:F,class:"flex items-center gap-2 px-3 py-2 md:px-4 bg-accent-purple/20 hover:bg-accent-purple/30 text-accent-purple border border-accent-purple/50 rounded-lg transition-colors",title:f.value?"Exit full window":"Full window"},[I[4]||(I[4]=Z("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Z("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z"})],-1)),Z("span",Bg,Is(f.value?"Exit Window":"Full Window"),1)],8,Lg)),c.value?Yt("",!0):(it(),tt("button",{key:2,onClick:M,class:"flex items-center gap-2 px-3 py-2 md:px-4 bg-accent-purple/20 hover:bg-accent-purple/30 text-accent-purple border border-accent-purple/50 rounded-lg transition-colors",title:_.value?"Exit fullscreen":"Fullscreen"},[_.value?(it(),tt("svg",Rg,I[6]||(I[6]=[Z("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"},null,-1)]))):(it(),tt("svg",Mg,I[5]||(I[5]=[Z("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4"},null,-1)]))),Z("span",Tg,Is(_.value?"Exit Full":"Fullscreen"),1)],8,Eg)),Z("button",{onClick:I[0]||(I[0]=G=>h.value=!h.value),class:"flex items-center gap-2 px-3 py-2 md:px-4 bg-primary/20 hover:bg-primary/30 text-primary border border-primary/50 rounded-lg transition-colors"},I[7]||(I[7]=[Z("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Z("path",{"stroke-linecap":"round","stroke-linejoin"
Line truncated
|
||||
@@ -0,0 +1,6 @@
|
||||
import{a as Ae,c as j,b as O,e as I,g as U,t as Z,n as ye,F as ge,p as Y,x as Ge}from"./index-D0IT5vDS.js";import{g as Ve}from"./chart-B185MtDy.js";const ze={class:"sparkline-card"},je={class:"card-header"},Ue={class:"card-title"},Ze={key:0,class:"card-subtitle"},Je={key:0,class:"card-chart"},Ke={key:0,class:"chart-loader"},Se={key:1,class:"chart-text"},et={class:"percent-value"},tt=["id","viewBox"],nt=["d","fill"],rt=["d","stroke"],J=100,K=40,at=Ae({name:"SparklineChart",__name:"Sparkline",props:{title:{},value:{},color:{},data:{default:()=>[]},showChart:{type:Boolean,default:!0},variant:{default:"smooth"},loading:{type:Boolean,default:!1},centerText:{default:""},subtitle:{default:""}},setup(r){const e=r,t=i=>{if(i.length<3)return i;const d=Math.min(15,Math.max(3,Math.floor(i.length*.2))),f=[];for(let D=0;D<i.length;D++){const P=Math.floor(d/2),l=Math.max(0,D-P),w=Math.min(i.length,D+P+1),k=i.slice(l,w);f.push(k.reduce((R,H)=>R+H,0)/k.length)}const y=Math.min(10,f.length),T=f.length/y,N=[];for(let D=0;D<y;D++){const P=Math.floor(D*T);N.push(f[P])}return N},n=j(()=>!e.data||e.data.length===0?[]:e.variant==="smooth"?t(e.data):e.data),a=i=>{if(i.length<2)return"";const d=Math.max(...i),f=Math.min(...i),y=d-f||1,T=e.variant==="classic"?4:2;let N="";return i.forEach((D,P)=>{const l=P/(i.length-1)*J,w=(D-f)/y,k=T+(K-T*2)*(1-w);if(P===0)N+=`M ${l.toFixed(2)} ${k.toFixed(2)}`;else{const H=((P-1)/(i.length-1)*J+l)/2;N+=` Q ${H.toFixed(2)} ${k.toFixed(2)} ${l.toFixed(2)} ${k.toFixed(2)}`}}),N},s=j(()=>a(n.value)),o=j(()=>s.value?`${s.value} L ${J} ${K} L 0 ${K} Z`:""),c=j(()=>`sparkline-${e.title.replace(/\s+/g,"-").toLowerCase()}`);return(i,d)=>(Y(),O("div",ze,[I("div",je,[I("div",null,[I("p",Ue,Z(i.title),1),i.subtitle?(Y(),O("p",Ze,Z(i.subtitle),1)):U("",!0)]),I("span",{class:"card-value",style:ye({color:i.color})},Z(typeof i.value=="number"?i.value.toLocaleString():i.value),5)]),i.showChart?(Y(),O("div",Je,[i.loading&&i.variant==="classic"?(Y(),O("div",Ke,[I("div",{class:"loader-spinner",style:ye({borderTopColor:i.color})},null,4)])):i.centerText?(Y(),O("div",Se,[I("span",et,Z(i.centerText),1)])):(Y(),O("svg",{key:2,id:c.value,class:"chart-svg",viewBox:`0 0 ${J} ${K}`,preserveAspectRatio:"none"},[i.variant==="classic"?(Y(),O(ge,{key:0},[n.value.length>1?(Y(),O("path",{key:0,d:o.value,fill:i.color,"fill-opacity":"0.8",class:"sparkline-path"},null,8,nt)):U("",!0)],64)):(Y(),O(ge,{key:1},[n.value.length>1?(Y(),O("path",{key:0,d:s.value,stroke:i.color,"stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round",fill:"none",class:"sparkline-path"},null,8,rt)):U("",!0)],64))],8,tt))])):U("",!0)]))}}),Vr=Ge(at,[["__scopeId","data-v-257cbdca"]]),Te=6048e5,st=864e5,G=6e4,V=36e5,ot=1e3,pe=Symbol.for("constructDateFrom");function p(r,e){return typeof r=="function"?r(e):r&&typeof r=="object"&&pe in r?r[pe](e):r instanceof Date?new r.constructor(e):new Date(e)}function u(r,e){return p(e||r,r)}function ne(r,e,t){const n=u(r,t?.in);return isNaN(e)?p(t?.in||r,NaN):(e&&n.setDate(n.getDate()+e),n)}function ce(r,e,t){const n=u(r,t?.in);if(isNaN(e))return p(r,NaN);if(!e)return n;const a=n.getDate(),s=p(r,n.getTime());s.setMonth(n.getMonth()+e+1,0);const o=s.getDate();return a>=o?s:(n.setFullYear(s.getFullYear(),s.getMonth(),a),n)}function ue(r,e,t){return p(r,+u(r)+e)}function it(r,e,t){return ue(r,e*V)}let ct={};function F(){return ct}function W(r,e){const t=F(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??t.weekStartsOn??t.locale?.options?.weekStartsOn??0,a=u(r,e?.in),s=a.getDay(),o=(s<n?7:0)+s-n;return a.setDate(a.getDate()-o),a.setHours(0,0,0,0),a}function Q(r,e){return W(r,{...e,weekStartsOn:1})}function Pe(r,e){const t=u(r,e?.in),n=t.getFullYear(),a=p(t,0);a.setFullYear(n+1,0,4),a.setHours(0,0,0,0);const s=Q(a),o=p(t,0);o.setFullYear(n,0,4),o.setHours(0,0,0,0);const c=Q(o);return t.getTime()>=s.getTime()?n+1:t.getTime()>=c.getTime()?n:n-1}function ee(r){const e=u(r),t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+r-+t}function C(r,...e){const t=p.bind(null,e.find(n=>typeof n=="object"));return e.map(t)}function se(r,e){const t=u(r,e?.in);return t.setHours(0,0,0,0),t}function Oe(r,e,t){const[n,a]=C(t?.in,r,e),s=se(n),o=se(a),c=+s-ee(s),i=+o-ee(o);return Math.round((c-i)/st)}function ut(r,e){const t=Pe(r,e),n=p(r,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),Q(n)}function dt(r,e,t){const n=u(r,t?.in);return n.setTime(n.getTime()+e*G),n}function lt(r,e,t){return ce(r,e*3,t)}function ft(r,e,t){return ue(r,e*1e3)}function ht(r,e,t){return ne(r,e*7,t)}function mt(r,e,t){return ce(r,e*12,t)}function A(r,e){const t=+u(r)-+u(e);return t<0?-1:t>0?1:t}function wt(r){return r instanceof Date||typeof r=="object"&&Object.prototype.toString.call(r)==="[object Date]"}function Ye(r){return!(!wt(r)&&typeof r!="number"||isNaN(+u(r)))}function yt(r,e,t){const[n,a]=C(t?.in,r,e),s=n.getFullYear()-a.getFulLine truncated
|
||||
* chartjs-adapter-date-fns v3.0.0
|
||||
* https://www.chartjs.org
|
||||
* (c) 2022 chartjs-adapter-date-fns Contributors
|
||||
* Released under the MIT license
|
||||
*/const $r={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"};Ve._date.override({_id:"date-fns",formats:function(){return $r},parse:function(r,e){if(r===null||typeof r>"u")return null;const t=typeof r;return t==="number"||r instanceof Date?r=u(r):t==="string"&&(typeof e=="string"?r=Dr(r,e,new Date,this.options):r=Yr(r,this.options)),Ye(r)?r.getTime():null},format:function(r,e){return Tn(r,e,this.options)},add:function(r,e,t){switch(t){case"millisecond":return ue(r,e);case"second":return ft(r,e);case"minute":return dt(r,e);case"hour":return it(r,e);case"day":return ne(r,e);case"week":return ht(r,e);case"month":return ce(r,e);case"quarter":return lt(r,e);case"year":return mt(r,e);default:return r}},diff:function(r,e,t){switch(t){case"millisecond":return de(r,e);case"second":return Dt(r,e);case"minute":return bt(r,e);case"hour":return pt(r,e);case"day":return ve(r,e);case"week":return kt(r,e);case"month":return Ne(r,e);case"quarter":return Mt(r,e);case"year":return Tt(r,e);default:return 0}},startOf:function(r,e,t){switch(e){case"second":return Or(r);case"minute":return Pr(r);case"hour":return Tr(r);case"day":return se(r);case"week":return W(r);case"isoWeek":return W(r,{weekStartsOn:+t});case"month":return Ot(r);case"quarter":return Pt(r);case"year":return Ee(r);default:return r}},endOf:function(r,e){switch(e){case"second":return Et(r);case"minute":return Wt(r);case"hour":return vt(r);case"day":return _e(r);case"week":return _t(r);case"month":return We(r);case"quarter":return Nt(r);case"year":return Yt(r);default:return r}}});export{Vr as S};
|
||||
@@ -0,0 +1,35 @@
|
||||
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Setup-DFGUHlPP.js","assets/Setup-RshMWyiL.css","assets/Login-BNn34coJ.js","assets/Login-BiyTDci2.css","assets/Dashboard-DQfmgsLU.js","assets/chart-B185MtDy.js","assets/useSignalQuality-DvX3fQnP.js","assets/preferences-DtwbSSgO.js","assets/Dashboard-CZYwlk3m.css","assets/Neighbors-Dp7tqjVr.js","assets/leaflet-src-BtisrQHC.js","assets/_commonjsHelpers-CqkleIqs.js","assets/Neighbors-BPsas1hQ.css","assets/leaflet-Dgihpmma.css","assets/Statistics-BszK_T8m.js","assets/chartjs-adapter-date-fns.esm-DJElUt-M.js","assets/chartjs-adapter-date-fns-kwjCs6JU.css","assets/plotly.min-DO11Gp-n.js","assets/Statistics-C56LjnFt.css","assets/SystemStats-DbE-CP6d.js","assets/SystemStats-B8-MXEai.css","assets/Configuration-jnqusIoi.js","assets/ConfirmDialog.vue_vue_type_script_setup_true_lang-CidOa_xU.js","assets/Configuration-DCyoN75P.css","assets/CADCalibration-BxVQoh3t.js","assets/CADCalibration-DnmufMQ0.css","assets/RoomServers-BzhrqUTJ.js","assets/MessageDialog.vue_vue_type_script_setup_true_lang-C6ugQFfD.js","assets/Companions-dNR-ED8E.js","assets/Terminal-CHr0ym4k.js","assets/Terminal-NOfYg9Od.css"])))=>i.map(i=>d[i]);
|
||||
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();/**
|
||||
* @vue/shared v3.5.18
|
||||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||||
* @license MIT
|
||||
**//*! #__NO_SIDE_EFFECTS__ */function so(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Se={},xn=[],Et=()=>{},Ic=()=>!1,Gr=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),oo=e=>e.startsWith("onUpdate:"),$e=Object.assign,io=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Dc=Object.prototype.hasOwnProperty,ke=(e,t)=>Dc.call(e,t),ie=Array.isArray,wn=e=>ar(e)==="[object Map]",Mn=e=>ar(e)==="[object Set]",Ho=e=>ar(e)==="[object Date]",fe=e=>typeof e=="function",Pe=e=>typeof e=="string",At=e=>typeof e=="symbol",Ae=e=>e!==null&&typeof e=="object",pa=e=>(Ae(e)||fe(e))&&fe(e.then)&&fe(e.catch),ha=Object.prototype.toString,ar=e=>ha.call(e),$c=e=>ar(e).slice(8,-1),ma=e=>ar(e)==="[object Object]",ao=e=>Pe(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,qn=so(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),zr=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},Vc=/-(\w)/g,dt=zr(e=>e.replace(Vc,(t,n)=>n?n.toUpperCase():"")),Fc=/\B([A-Z])/g,Xt=zr(e=>e.replace(Fc,"-$1").toLowerCase()),Jr=zr(e=>e.charAt(0).toUpperCase()+e.slice(1)),ps=zr(e=>e?`on${Jr(e)}`:""),Gt=(e,t)=>!Object.is(e,t),Sr=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Is=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},Ir=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Bc=e=>{const t=Pe(e)?Number(e):NaN;return isNaN(t)?e:t};let jo;const Yr=()=>jo||(jo=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Pn(e){if(ie(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],s=Pe(r)?qc(r):Pn(r);if(s)for(const o in s)t[o]=s[o]}return t}else if(Pe(e)||Ae(e))return e}const Hc=/;(?![^(]*\))/g,jc=/:([^]+)/,Uc=/\/\*[^]*?\*\//g;function qc(e){const t={};return e.replace(Uc,"").split(Hc).forEach(n=>{if(n){const r=n.split(jc);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function ce(e){let t="";if(Pe(e))t=e;else if(ie(e))for(let n=0;n<e.length;n++){const r=ce(e[n]);r&&(t+=r+" ")}else if(Ae(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const Kc="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Wc=so(Kc);function ga(e){return!!e||e===""}function Zc(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=hn(e[r],t[r]);return n}function hn(e,t){if(e===t)return!0;let n=Ho(e),r=Ho(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=At(e),r=At(t),n||r)return e===t;if(n=ie(e),r=ie(t),n||r)return n&&r?Zc(e,t):!1;if(n=Ae(e),r=Ae(t),n||r){if(!n||!r)return!1;const s=Object.keys(e).length,o=Object.keys(t).length;if(s!==o)return!1;for(const i in e){const a=e.hasOwnProperty(i),l=t.hasOwnProperty(i);if(a&&!l||!a&&l||!hn(e[i],t[i]))return!1}}return String(e)===String(t)}function lo(e,t){return e.findIndex(n=>hn(n,t))}const ya=e=>!!(e&&e.__v_isRef===!0),W=e=>Pe(e)?e:e==null?"":ie(e)||Ae(e)&&(e.toString===ha||!fe(e.toString))?ya(e)?W(e.value):JSON.stringify(e,va,2):String(e),va=(e,t)=>ya(t)?va(e,t.value):wn(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,s],o)=>(n[hs(r,o)+" =>"]=s,n),{})}:Mn(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>hs(n))}:At(t)?hs(t):Ae(t)&&!ie(t)&&!ma(t)?String(t):t,hs=(e,t="")=>{var n;return At(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
|
||||
* @vue/reactivity v3.5.18
|
||||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||||
* @license MIT
|
||||
**/let He;class ba{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=He,!t&&He&&(this.index=(He.scopes||(He.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].pause();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].resume();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].resume()}}run(t){if(this._active){const n=He;try{return He=this,t()}finally{He=n}}}on(){++this._on===1&&(this.prevScope=He,He=this)}off(){this._on>0&&--this._on===0&&(He=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let n,r;for(n=0,r=this.effects.length;n<r;n++)this.effects[n].stop();for(this.effects.length=0,n=0,r=this.cleanups.length;n<r;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,r=this.scopes.length;n<r;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const s=this.parent.scopes.pop();s&&s!==this&&(this.parent.scopes[this.index]=s,s.index=this.index)}this.parent=void 0}}}function Ca(e){return new ba(e)}function _a(){return He}function Gc(e,t=!1){He&&He.cleanups.push(e)}let Te;const ms=new WeakSet;class xa{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,He&&He.active&&He.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,ms.has(this)&&(ms.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||ka(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Uo(this),Ea(this);const t=Te,n=ft;Te=this,ft=!0;try{return this.fn()}finally{Sa(this),Te=t,ft=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)fo(t);this.deps=this.depsTail=void 0,Uo(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?ms.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Ds(this)&&this.run()}get dirty(){return Ds(this)}}let wa=0,Kn,Wn;function ka(e,t=!1){if(e.flags|=8,t){e.next=Wn,Wn=e;return}e.next=Kn,Kn=e}function co(){wa++}function uo(){if(--wa>0)return;if(Wn){let t=Wn;for(Wn=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Kn;){let t=Kn;for(Kn=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){e||(e=r)}t=n}}if(e)throw e}function Ea(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Sa(e){let t,n=e.depsTail,r=n;for(;r;){const s=r.prevDep;r.version===-1?(r===n&&(n=s),fo(r),zc(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=s}e.deps=t,e.depsTail=n}function Ds(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Aa(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Aa(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===er)||(e.globalVersion=er,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Ds(e))))return;e.flags|=2;const t=e.dep,n=Te,r=ft;Te=e,ft=!0;try{Ea(e);const s=e.fn(e._value);(t.version===0||Gt(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{Te=n,ft=r,Sa(e),e.flags&=-3}}function fo(e,t=!1){const{dep:n,prevSub:r,nextSub:s}=e;if(r&&(r.nextSub=s,e.prevSub=void 0),s&&(s.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let o=n.computed.deps;o;o=o.nextDep)fo(o,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function zc(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let ft=!0;const Ra=[];function Dt(){Ra.push(ft),ft=!1}function $t(){const e=Ra.pop();ft=e===void 0?!0:e}function Uo(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Te;Te=void 0;try{t()}finally{Te=n}}}let er=0;class Jc{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class po{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!Te||!ft||Te===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Te)n=this.activeLink=new Jc(Te,this),Te.deps?(n.prevDep=Te.depsTail,Te.depsTail.nextDep=n,Te.depsTail=n):Te.deps=Te.depsTail=n,Ta(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const r=n.nextDep;r.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=r),n.prevDep=Te.depsTail,n.nextDep=void 0,Te.depsTail.nextDep=n,Te.depsTail=n,Te.deps===n&&(Te.deps=r)}return n}trigger(t){this.version++,er++,this.notify(t)}notify(t){co();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{uo()}}}functiLine truncated
|
||||
* @vue/runtime-core v3.5.18
|
||||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||||
* @license MIT
|
||||
**/function cr(e,t,n,r){try{return r?e(...r):e()}catch(s){ur(s,t,n)}}function pt(e,t,n,r){if(fe(e)){const s=cr(e,t,n,r);return s&&pa(s)&&s.catch(o=>{ur(o,t,n)}),s}if(ie(e)){const s=[];for(let o=0;o<e.length;o++)s.push(pt(e[o],t,n,r));return s}}function ur(e,t,n,r=!0){const s=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||Se;if(t){let a=t.parent;const l=t.proxy,u=`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const c=a.ec;if(c){for(let d=0;d<c.length;d++)if(c[d](e,l,u)===!1)return}a=a.parent}if(o){Dt(),cr(o,null,10,[e,l,u]),$t();return}}ku(e,n,s,r,i)}function ku(e,t,n,r=!0,s=!1){if(s)throw e;console.error(e)}const ze=[];let xt=-1;const kn=[];let Ut=null,Cn=0;const Ba=Promise.resolve();let Fr=null;function Xr(e){const t=Fr||Ba;return e?t.then(this?e.bind(this):e):t}function Eu(e){let t=xt+1,n=ze.length;for(;t<n;){const r=t+n>>>1,s=ze[r],o=nr(s);o<e||o===e&&s.flags&2?t=r+1:n=r}return t}function vo(e){if(!(e.flags&1)){const t=nr(e),n=ze[ze.length-1];!n||!(e.flags&2)&&t>=nr(n)?ze.push(e):ze.splice(Eu(t),0,e),e.flags|=1,Ha()}}function Ha(){Fr||(Fr=Ba.then(Ua))}function Su(e){ie(e)?kn.push(...e):Ut&&e.id===-1?Ut.splice(Cn+1,0,e):e.flags&1||(kn.push(e),e.flags|=1),Ha()}function Ko(e,t,n=xt+1){for(;n<ze.length;n++){const r=ze[n];if(r&&r.flags&2){if(e&&r.id!==e.uid)continue;ze.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function ja(e){if(kn.length){const t=[...new Set(kn)].sort((n,r)=>nr(n)-nr(r));if(kn.length=0,Ut){Ut.push(...t);return}for(Ut=t,Cn=0;Cn<Ut.length;Cn++){const n=Ut[Cn];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}Ut=null,Cn=0}}const nr=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Ua(e){try{for(xt=0;xt<ze.length;xt++){const t=ze[xt];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),cr(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;xt<ze.length;xt++){const t=ze[xt];t&&(t.flags&=-2)}xt=-1,ze.length=0,ja(),Fr=null,(ze.length||kn.length)&&Ua()}}let st=null,qa=null;function Br(e){const t=st;return st=e,qa=e&&e.type.__scopeId||null,t}function Au(e,t=st,n){if(!t||e._n)return e;const r=(...s)=>{r._d&&ii(-1);const o=Br(t);let i;try{i=e(...s)}finally{Br(o),r._d&&ii(1)}return i};return r._n=!0,r._c=!0,r._d=!0,r}function yh(e,t){if(st===null)return e;const n=ss(st),r=e.dirs||(e.dirs=[]);for(let s=0;s<t.length;s++){let[o,i,a,l=Se]=t[s];o&&(fe(o)&&(o={mounted:o,updated:o}),o.deep&&Nt(i),r.push({dir:o,instance:n,value:i,oldValue:void 0,arg:a,modifiers:l}))}return e}function tn(e,t,n,r){const s=e.dirs,o=t&&t.dirs;for(let i=0;i<s.length;i++){const a=s[i];o&&(a.oldValue=o[i].value);let l=a.dir[r];l&&(Dt(),pt(l,n,8,[e.el,a,e,t]),$t())}}const Ka=Symbol("_vte"),Wa=e=>e.__isTeleport,Zn=e=>e&&(e.disabled||e.disabled===""),Wo=e=>e&&(e.defer||e.defer===""),Zo=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Go=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Fs=(e,t)=>{const n=e&&e.to;return Pe(n)?t?t(n):null:n},Za={name:"Teleport",__isTeleport:!0,process(e,t,n,r,s,o,i,a,l,u){const{mc:c,pc:d,pbc:f,o:{insert:y,querySelector:h,createText:v,createComment:w}}=u,S=Zn(t.props);let{shapeFlag:L,children:R,dynamicChildren:M}=t;if(e==null){const V=t.el=v(""),Y=t.anchor=v("");y(V,n,r),y(Y,n,r);const q=(N,Q)=>{L&16&&(s&&s.isCE&&(s.ce._teleportTarget=N),c(R,N,Q,s,o,i,a,l))},X=()=>{const N=t.target=Fs(t.props,h),Q=Ga(N,t,v,y);N&&(i!=="svg"&&Zo(N)?i="svg":i!=="mathml"&&Go(N)&&(i="mathml"),S||(q(N,Q),Ar(t,!1)))};S&&(q(n,Y),Ar(t,!0)),Wo(t.props)?(t.el.__isMounted=!1,Ze(()=>{X(),delete t.el.__isMounted},o)):X()}else{if(Wo(t.props)&&e.el.__isMounted===!1){Ze(()=>{Za.process(e,t,n,r,s,o,i,a,l,u)},o);return}t.el=e.el,t.targetStart=e.targetStart;const V=t.anchor=e.anchor,Y=t.target=e.target,q=t.targetAnchor=e.targetAnchor,X=Zn(e.props),N=X?n:Y,Q=X?V:q;if(i==="svg"||Zo(Y)?i="svg":(i==="mathml"||Go(Y))&&(i="mathml"),M?(f(e.dynamicChildren,M,N,s,o,i,a),xo(e,t,!0)):l||d(e,t,N,Q,s,o,i,a,!1),S)X?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):xr(t,n,V,u,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const j=t.target=Fs(t.props,h);j&&xr(t,j,null,u,0)}else X&&xr(t,Y,q,u,1);Ar(t,S)}},remove(e,t,n,{um:r,o:{remove:s}},o){const{shapeFlag:i,children:a,anchor:l,targetStart:u,targetAnchor:c,target:d,props:f}=e;if(d&&(s(u),s(c)),o&&s(l),i&16){const y=o||!Zn(f);for(let h=0;h<a.length;h++){const v=a[h];r(v,t,n,y,!!v.dynamicChildren)}}},move:xr,hydrate:Ru};function xr(e,t,n,{o:{insert:r},m:s},o=2){o===0&&r(e.targetAnchor,t,n);const{el:i,anchor:a,shapeFlag:l,children:u,props:c}=e,d=o===2;if(d&&r(i,t,n),(!d||Zn(c))&&l&16)for(let f=0;f<u.length;f++)s(u[f],t,n,2);d&&r(a,t,n)}function Ru(e,t,n,r,s,o,{o:{nextSibling:i,parentNode:a,querySelector:l,insert:u,createText:c}},d){const f=t.target=Fs(t.props,l);if(f){const y=Zn(t.props),h=f._lpa||f.firstChild;if(t.shapeFlag&16)if(y)t.anchor=d(i(e),t,a(e),n,r,s,o),t.targetStart=h,t.targetAnchor=h&&i(h);else{t.anchor=i(e);let v=h;for(;v;){if(v&&v.nodeType===8){if(v.data==="teleport start anchor")
Line truncated
|
||||
* @vue/runtime-dom v3.5.18
|
||||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||||
* @license MIT
|
||||
**/let Ws;const ci=typeof window<"u"&&window.trustedTypes;if(ci)try{Ws=ci.createPolicy("vue",{createHTML:e=>e})}catch{}const El=Ws?e=>Ws.createHTML(e):e=>e,N1="http://www.w3.org/2000/svg",I1="http://www.w3.org/1998/Math/MathML",Pt=typeof document<"u"?document:null,ui=Pt&&Pt.createElement("template"),D1={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const s=t==="svg"?Pt.createElementNS(N1,e):t==="mathml"?Pt.createElementNS(I1,e):n?Pt.createElement(e,{is:n}):Pt.createElement(e);return e==="select"&&r&&r.multiple!=null&&s.setAttribute("multiple",r.multiple),s},createText:e=>Pt.createTextNode(e),createComment:e=>Pt.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Pt.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,s,o){const i=n?n.previousSibling:t.lastChild;if(s&&(s===o||s.nextSibling))for(;t.insertBefore(s.cloneNode(!0),n),!(s===o||!(s=s.nextSibling)););else{ui.innerHTML=El(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const a=ui.content;if(r==="svg"||r==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}t.insertBefore(a,n)}return[i?i.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Bt="transition",$n="animation",or=Symbol("_vtc"),Sl={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},$1=$e({},za,Sl),V1=e=>(e.displayName="Transition",e.props=$1,e),vh=V1((e,{slots:t})=>Eo(Pu,F1(e),t)),rn=(e,t=[])=>{ie(e)?e.forEach(n=>n(...t)):e&&e(...t)},di=e=>e?ie(e)?e.some(t=>t.length>1):e.length>1:!1;function F1(e){const t={};for(const _ in e)_ in Sl||(t[_]=e[_]);if(e.css===!1)return t;const{name:n="v",type:r,duration:s,enterFromClass:o=`${n}-enter-from`,enterActiveClass:i=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:l=o,appearActiveClass:u=i,appearToClass:c=a,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:y=`${n}-leave-to`}=e,h=B1(s),v=h&&h[0],w=h&&h[1],{onBeforeEnter:S,onEnter:L,onEnterCancelled:R,onLeave:M,onLeaveCancelled:V,onBeforeAppear:Y=S,onAppear:q=L,onAppearCancelled:X=R}=t,N=(_,K,I,ne)=>{_._enterCancelled=ne,sn(_,K?c:a),sn(_,K?u:i),I&&I()},Q=(_,K)=>{_._isLeaving=!1,sn(_,d),sn(_,y),sn(_,f),K&&K()},j=_=>(K,I)=>{const ne=_?q:L,se=()=>N(K,_,I);rn(ne,[K,se]),fi(()=>{sn(K,_?l:o),Ot(K,_?c:a),di(ne)||pi(K,r,v,se)})};return $e(t,{onBeforeEnter(_){rn(S,[_]),Ot(_,o),Ot(_,i)},onBeforeAppear(_){rn(Y,[_]),Ot(_,l),Ot(_,u)},onEnter:j(!1),onAppear:j(!0),onLeave(_,K){_._isLeaving=!0;const I=()=>Q(_,K);Ot(_,d),_._enterCancelled?(Ot(_,f),gi()):(gi(),Ot(_,f)),fi(()=>{_._isLeaving&&(sn(_,d),Ot(_,y),di(M)||pi(_,r,w,I))}),rn(M,[_,I])},onEnterCancelled(_){N(_,!1,void 0,!0),rn(R,[_])},onAppearCancelled(_){N(_,!0,void 0,!0),rn(X,[_])},onLeaveCancelled(_){Q(_),rn(V,[_])}})}function B1(e){if(e==null)return null;if(Ae(e))return[xs(e.enter),xs(e.leave)];{const t=xs(e);return[t,t]}}function xs(e){return Bc(e)}function Ot(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[or]||(e[or]=new Set)).add(t)}function sn(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[or];n&&(n.delete(t),n.size||(e[or]=void 0))}function fi(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let H1=0;function pi(e,t,n,r){const s=e._endId=++H1,o=()=>{s===e._endId&&r()};if(n!=null)return setTimeout(o,n);const{type:i,timeout:a,propCount:l}=j1(e,t);if(!i)return r();const u=i+"end";let c=0;const d=()=>{e.removeEventListener(u,f),o()},f=y=>{y.target===e&&++c>=l&&d()};setTimeout(()=>{c<l&&d()},a+1),e.addEventListener(u,f)}function j1(e,t){const n=window.getComputedStyle(e),r=h=>(n[h]||"").split(", "),s=r(`${Bt}Delay`),o=r(`${Bt}Duration`),i=hi(s,o),a=r(`${$n}Delay`),l=r(`${$n}Duration`),u=hi(a,l);let c=null,d=0,f=0;t===Bt?i>0&&(c=Bt,d=i,f=o.length):t===$n?u>0&&(c=$n,d=u,f=l.length):(d=Math.max(i,u),c=d>0?i>u?Bt:$n:null,f=c?c===Bt?o.length:l.length:0);const y=c===Bt&&/\b(transform|all)(,|$)/.test(r(`${Bt}Property`).toString());return{type:c,timeout:d,propCount:f,hasTransform:y}}function hi(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>mi(n)+mi(e[r])))}function mi(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function gi(){return document.body.offsetHeight}function U1(e,t,n){const r=e[or];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const qr=Symbol("_vod"),Al=Symbol("_vsh"),bh={beforeMount(e,{value:t},{transition:n}){e[qr]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):Vn(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},
Line truncated
|
||||
* pinia v3.0.4
|
||||
* (c) 2025 Eduardo San Martin Morote
|
||||
* @license MIT
|
||||
*/let Tl;const os=e=>Tl=e,Ol=Symbol();function Gs(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var Qn;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(Qn||(Qn={}));function fd(){const e=Ca(!0),t=e.run(()=>Z({}));let n=[],r=[];const s=yo({install(o){os(s),s._a=o,o.provide(Ol,s),o.config.globalProperties.$pinia=s,r.forEach(i=>n.push(i)),r=[]},use(o){return this._a?n.push(o):r.push(o),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return s}const Ml=()=>{};function Ti(e,t,n,r=Ml){e.add(t);const s=()=>{e.delete(t)&&r()};return!n&&_a()&&Gc(s),s}function bn(e,...t){e.forEach(n=>{n(...t)})}const pd=e=>e(),Oi=Symbol(),Es=Symbol();function zs(e,t){e instanceof Map&&t instanceof Map?t.forEach((n,r)=>e.set(r,n)):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const n in t){if(!t.hasOwnProperty(n))continue;const r=t[n],s=e[n];Gs(s)&&Gs(r)&&e.hasOwnProperty(n)&&!Ie(r)&&!zt(r)?e[n]=zs(s,r):e[n]=r}return e}const hd=Symbol();function md(e){return!Gs(e)||!Object.prototype.hasOwnProperty.call(e,hd)}const{assign:jt}=Object;function gd(e){return!!(Ie(e)&&e.effect)}function yd(e,t,n,r){const{state:s,actions:o,getters:i}=t,a=n.state.value[e];let l;function u(){a||(n.state.value[e]=s?s():{});const c=yu(n.state.value[e]);return jt(c,o,Object.keys(i||{}).reduce((d,f)=>(d[f]=yo(oe(()=>{os(n);const y=n._s.get(e);return i[f].call(y,y)})),d),{}))}return l=Pl(e,u,t,n,r,!0),l}function Pl(e,t,n={},r,s,o){let i;const a=jt({actions:{}},n),l={deep:!0};let u,c,d=new Set,f=new Set,y;const h=r.state.value[e];!o&&!h&&(r.state.value[e]={}),Z({});let v;function w(X){let N;u=c=!1,typeof X=="function"?(X(r.state.value[e]),N={type:Qn.patchFunction,storeId:e,events:y}):(zs(r.state.value[e],X),N={type:Qn.patchObject,payload:X,storeId:e,events:y});const Q=v=Symbol();Xr().then(()=>{v===Q&&(u=!0)}),c=!0,bn(d,N,r.state.value[e])}const S=o?function(){const{state:N}=n,Q=N?N():{};this.$patch(j=>{jt(j,Q)})}:Ml;function L(){i.stop(),d.clear(),f.clear(),r._s.delete(e)}const R=(X,N="")=>{if(Oi in X)return X[Es]=N,X;const Q=function(){os(r);const j=Array.from(arguments),_=new Set,K=new Set;function I(ee){_.add(ee)}function ne(ee){K.add(ee)}bn(f,{args:j,name:Q[Es],store:V,after:I,onError:ne});let se;try{se=X.apply(this&&this.$id===e?this:V,j)}catch(ee){throw bn(K,ee),ee}return se instanceof Promise?se.then(ee=>(bn(_,ee),ee)).catch(ee=>(bn(K,ee),Promise.reject(ee))):(bn(_,se),se)};return Q[Oi]=!0,Q[Es]=N,Q},M={_p:r,$id:e,$onAction:Ti.bind(null,f),$patch:w,$reset:S,$subscribe(X,N={}){const Q=Ti(d,X,N.detached,()=>j()),j=i.run(()=>St(()=>r.state.value[e],_=>{(N.flush==="sync"?c:u)&&X({storeId:e,type:Qn.direct,events:y},_)},jt({},l,N)));return Q},$dispose:L},V=lr(M);r._s.set(e,V);const q=(r._a&&r._a.runWithContext||pd)(()=>r._e.run(()=>(i=Ca()).run(()=>t({action:R}))));for(const X in q){const N=q[X];if(Ie(N)&&!gd(N)||zt(N))o||(h&&md(N)&&(Ie(N)?N.value=h[X]:zs(N,h[X])),r.state.value[e][X]=N);else if(typeof N=="function"){const Q=R(N,X);q[X]=Q,a.actions[X]=N}}return jt(V,q),jt(_e(V),q),Object.defineProperty(V,"$state",{get:()=>r.state.value[e],set:X=>{w(N=>{jt(N,X)})}}),r._p.forEach(X=>{jt(V,i.run(()=>X({store:V,app:r._a,pinia:r,options:a})))}),h&&o&&n.hydrate&&n.hydrate(V.$state,h),u=!0,c=!0,V}/*! #__NO_SIDE_EFFECTS__ */function So(e,t,n){let r;const s=typeof t=="function";r=s?n:t;function o(i,a){const l=Xu();return i=i||(l?ct(Ol,null):null),i&&os(i),i=Tl,i._s.has(e)||(s?Pl(e,t,r,i):yd(e,r,i)),i._s.get(e)}return o.$id=e,o}/*!
|
||||
* vue-router v4.6.3
|
||||
* (c) 2025 Eduardo San Martin Morote
|
||||
* @license MIT
|
||||
*/const _n=typeof document<"u";function Ll(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function vd(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&Ll(e.default)}const we=Object.assign;function Ss(e,t){const n={};for(const r in t){const s=t[r];n[r]=ht(s)?s.map(e):e(s)}return n}const Xn=()=>{},ht=Array.isArray;function Mi(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}const Nl=/#/g,bd=/&/g,Cd=/\//g,_d=/=/g,xd=/\?/g,Il=/\+/g,wd=/%5B/g,kd=/%5D/g,Dl=/%5E/g,Ed=/%60/g,$l=/%7B/g,Sd=/%7C/g,Vl=/%7D/g,Ad=/%20/g;function Ao(e){return e==null?"":encodeURI(""+e).replace(Sd,"|").replace(wd,"[").replace(kd,"]")}function Rd(e){return Ao(e).replace($l,"{").replace(Vl,"}").replace(Dl,"^")}function Js(e){return Ao(e).replace(Il,"%2B").replace(Ad,"+").replace(Nl,"%23").replace(bd,"%26").replace(Ed,"`").replace($l,"{").replace(Vl,"}").replace(Dl,"^")}function Td(e){return Js(e).replace(_d,"%3D")}function Od(e){return Ao(e).replace(Nl,"%23").replace(xd,"%3F")}function Md(e){return Od(e).replace(Cd,"%2F")}function ir(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const Pd=/\/$/,Ld=e=>e.replace(Pd,"");function As(e,t,n="/"){let r,s={},o="",i="";const a=t.indexOf("#");let l=t.indexOf("?");return l=a>=0&&l>a?-1:l,l>=0&&(r=t.slice(0,l),o=t.slice(l,a>0?a:t.length),s=e(o.slice(1))),a>=0&&(r=r||t.slice(0,a),i=t.slice(a,t.length)),r=$d(r??t,n),{fullPath:r+o+i,path:r,query:s,hash:ir(i)}}function Nd(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function Pi(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Id(e,t,n){const r=t.matched.length-1,s=n.matched.length-1;return r>-1&&r===s&&Rn(t.matched[r],n.matched[s])&&Fl(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function Rn(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Fl(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!Dd(e[n],t[n]))return!1;return!0}function Dd(e,t){return ht(e)?Li(e,t):ht(t)?Li(t,e):e===t}function Li(e,t){return ht(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function $d(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),r=e.split("/"),s=r[r.length-1];(s===".."||s===".")&&r.push("");let o=n.length-1,i,a;for(i=0;i<r.length;i++)if(a=r[i],a!==".")if(a==="..")o>1&&o--;else break;return n.slice(0,o).join("/")+"/"+r.slice(i).join("/")}const Ht={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let Ys=function(e){return e.pop="pop",e.push="push",e}({}),Rs=function(e){return e.back="back",e.forward="forward",e.unknown="",e}({});function Vd(e){if(!e)if(_n){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Ld(e)}const Fd=/^[^#]+#/;function Bd(e,t){return e.replace(Fd,"#")+t}function Hd(e,t){const n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}const is=()=>({left:window.scrollX,top:window.scrollY});function jd(e){let t;if("el"in e){const n=e.el,r=typeof n=="string"&&n.startsWith("#"),s=typeof n=="string"?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!s)return;t=Hd(s,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function Ni(e,t){return(history.state?history.state.position-t:-1)+e}const Qs=new Map;function Ud(e,t){Qs.set(e,t)}function qd(e){const t=Qs.get(e);return Qs.delete(e),t}function Kd(e){return typeof e=="string"||e&&typeof e=="object"}function Bl(e){return typeof e=="string"||typeof e=="symbol"}let Le=function(e){return e[e.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",e[e.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",e[e.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",e[e.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",e[e.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",e}({});const Hl=Symbol("");Le.MATCHER_NOT_FOUND+"",Le.NAVIGATION_GUARD_REDIRECT+"",Le.NAVIGATION_ABORTED+"",Le.NAVIGATION_CANCELLED+"",Le.NAVIGATION_DUPLICATED+"";function Tn(e,t){return we(new Error,{type:e,[Hl]:!0},t)}function Mt(e,t){return e instanceof Error&&Hl in e&&(t==null||!!(e.type&t))}const Wd=["params","query","hash"];function Zd(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of Wd)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function Gd(e){const t={};if(e===""||e==="?")return t;const n=(e[0]==="?"?e.slice(1):e).split("&");for(let r=0;r<n.length;++r){const s=n[r].replace(Il," "),o=s.indexOf("="),i=ir(o<0?s:s.slice(0,o)),a=o<0?null:ir(s.slice(o+1));if(i in t){let l=t[i];ht(l)||(l=t[i]=[l]),l.push(a)}else t[i]=a}return t}function Ii(e){let t="";for(let n in e){conLine truncated
|
||||
* vue-router v4.6.3
|
||||
* (c) 2025 Eduardo San Martin Morote
|
||||
* @license MIT
|
||||
*/let Qd=()=>location.protocol+"//"+location.host;function jl(e,t){const{pathname:n,search:r,hash:s}=t,o=e.indexOf("#");if(o>-1){let i=s.includes(e.slice(o))?e.slice(o).length:1,a=s.slice(i);return a[0]!=="/"&&(a="/"+a),Pi(a,"")}return Pi(n,e)+r+s}function Xd(e,t,n,r){let s=[],o=[],i=null;const a=({state:f})=>{const y=jl(e,location),h=n.value,v=t.value;let w=0;if(f){if(n.value=y,t.value=f,i&&i===h){i=null;return}w=v?f.position-v.position:0}else r(y);s.forEach(S=>{S(n.value,h,{delta:w,type:Ys.pop,direction:w?w>0?Rs.forward:Rs.back:Rs.unknown})})};function l(){i=n.value}function u(f){s.push(f);const y=()=>{const h=s.indexOf(f);h>-1&&s.splice(h,1)};return o.push(y),y}function c(){if(document.visibilityState==="hidden"){const{history:f}=window;if(!f.state)return;f.replaceState(we({},f.state,{scroll:is()}),"")}}function d(){for(const f of o)f();o=[],window.removeEventListener("popstate",a),window.removeEventListener("pagehide",c),document.removeEventListener("visibilitychange",c)}return window.addEventListener("popstate",a),window.addEventListener("pagehide",c),document.addEventListener("visibilitychange",c),{pauseListeners:l,listen:u,destroy:d}}function $i(e,t,n,r=!1,s=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:s?is():null}}function ef(e){const{history:t,location:n}=window,r={value:jl(e,n)},s={value:t.state};s.value||o(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function o(l,u,c){const d=e.indexOf("#"),f=d>-1?(n.host&&document.querySelector("base")?e:e.slice(d))+l:Qd()+e+l;try{t[c?"replaceState":"pushState"](u,"",f),s.value=u}catch(y){console.error(y),n[c?"replace":"assign"](f)}}function i(l,u){o(l,we({},t.state,$i(s.value.back,l,s.value.forward,!0),u,{position:s.value.position}),!0),r.value=l}function a(l,u){const c=we({},s.value,t.state,{forward:l,scroll:is()});o(c.current,c,!0),o(l,we({},$i(r.value,l,null),{position:c.position+1},u),!1),r.value=l}return{location:r,state:s,push:a,replace:i}}function tf(e){e=Vd(e);const t=ef(e),n=Xd(e,t.state,t.location,t.replace);function r(o,i=!0){i||n.pauseListeners(),history.go(o)}const s=we({location:"",base:e,go:r,createHref:Bd.bind(null,e)},t,n);return Object.defineProperty(s,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(s,"state",{enumerable:!0,get:()=>t.state.value}),s}let cn=function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e}({});var De=function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e}(De||{});const nf={type:cn.Static,value:""},rf=/[a-zA-Z0-9_]/;function sf(e){if(!e)return[[]];if(e==="/")return[[nf]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(y){throw new Error(`ERR (${n})/"${u}": ${y}`)}let n=De.Static,r=n;const s=[];let o;function i(){o&&s.push(o),o=[]}let a=0,l,u="",c="";function d(){u&&(n===De.Static?o.push({type:cn.Static,value:u}):n===De.Param||n===De.ParamRegExp||n===De.ParamRegExpEnd?(o.length>1&&(l==="*"||l==="+")&&t(`A repeatable param (${u}) must be alone in its segment. eg: '/:ids+.`),o.push({type:cn.Param,value:u,regexp:c,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):t("Invalid state to consume buffer"),u="")}function f(){u+=l}for(;a<e.length;){if(l=e[a++],l==="\\"&&n!==De.ParamRegExp){r=n,n=De.EscapeNext;continue}switch(n){case De.Static:l==="/"?(u&&d(),i()):l===":"?(d(),n=De.Param):f();break;case De.EscapeNext:f(),n=r;break;case De.Param:l==="("?n=De.ParamRegExp:rf.test(l)?f():(d(),n=De.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--);break;case De.ParamRegExp:l===")"?c[c.length-1]=="\\"?c=c.slice(0,-1)+l:n=De.ParamRegExpEnd:c+=l;break;case De.ParamRegExpEnd:d(),n=De.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--,c="";break;default:t("Unknown state");break}}return n===De.ParamRegExp&&t(`Unfinished custom RegExp for param "${u}"`),d(),i(),s}const Vi="[^/]+?",of={sensitive:!1,strict:!1,start:!0,end:!0};var Ge=function(e){return e[e._multiplier=10]="_multiplier",e[e.Root=90]="Root",e[e.Segment=40]="Segment",e[e.SubSegment=30]="SubSegment",e[e.Static=40]="Static",e[e.Dynamic=20]="Dynamic",e[e.BonusCustomRegExp=10]="BonusCustomRegExp",e[e.BonusWildcard=-50]="BonusWildcard",e[e.BonusRepeatable=-20]="BonusRepeatable",e[e.BonusOptional=-8]="BonusOptional",e[e.BonusStrict=.7000000000000001]="BonusStrict",e[e.BonusCaseSensitive=.25]="BonusCaseSensitive",e}(Ge||{});const af=/[.+*?^${}()[\]/\\]/g;function lf(e,t){const n=we({},of,t),r=[];let s=n.start?"^":"";const o=[];for(const u of e){const c=u.length?[]:[Ge.Root];n.strict&&!u.length&&(s+="/");for(let d=0;d<u.length;d++){const f=u[d];let y=Ge.Segment+(n.sensitive?Ge.BonusCaseSensitive:0);if(f.type===cn.Static)d||(s+="/"),s+=f.value.replace(af,"\\$&"),y+=Ge.Static;else if(f.type===cn.Param){const{value:h,repeatable:v,optional:w,regexp:S}=f;o.push({name:h,repeatable:v,optional:w});const L=S||Vi;if(L!==Vi){y+=Ge.BonusLine truncated
|
||||
`).forEach(function(i){s=i.indexOf(":"),n=i.substring(0,s).trim().toLowerCase(),r=i.substring(s+1).trim(),!(!n||t[n]&&A0[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Yi=Symbol("internals");function Bn(e){return e&&String(e).trim().toLowerCase()}function Lr(e){return e===!1||e==null?e:x.isArray(e)?e.map(Lr):String(e)}function T0(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const O0=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Os(e,t,n,r,s){if(x.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!x.isString(t)){if(x.isString(r))return t.indexOf(r)!==-1;if(x.isRegExp(r))return r.test(t)}}function M0(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function P0(e,t){const n=x.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,o,i){return this[r].call(this,t,s,o,i)},configurable:!0})})}let tt=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function o(a,l,u){const c=Bn(l);if(!c)throw new Error("header name must be a non-empty string");const d=x.findKey(s,c);(!d||s[d]===void 0||u===!0||u===void 0&&s[d]!==!1)&&(s[d||l]=Lr(a))}const i=(a,l)=>x.forEach(a,(u,c)=>o(u,c,l));if(x.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(x.isString(t)&&(t=t.trim())&&!O0(t))i(R0(t),n);else if(x.isObject(t)&&x.isIterable(t)){let a={},l,u;for(const c of t){if(!x.isArray(c))throw TypeError("Object iterator must return a key-value pair");a[u=c[0]]=(l=a[u])?x.isArray(l)?[...l,c[1]]:[l,c[1]]:c[1]}i(a,n)}else t!=null&&o(n,t,r);return this}get(t,n){if(t=Bn(t),t){const r=x.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return T0(s);if(x.isFunction(n))return n.call(this,s,r);if(x.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Bn(t),t){const r=x.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Os(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function o(i){if(i=Bn(i),i){const a=x.findKey(r,i);a&&(!n||Os(r,r[a],a,n))&&(delete r[a],s=!0)}}return x.isArray(t)?t.forEach(o):o(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const o=n[r];(!t||Os(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const n=this,r={};return x.forEach(this,(s,o)=>{const i=x.findKey(r,o);if(i){n[i]=Lr(s),delete n[o];return}const a=t?M0(o):String(o).trim();a!==o&&delete n[o],n[a]=Lr(s),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return x.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&x.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
||||
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[Yi]=this[Yi]={accessors:{}}).accessors,s=this.prototype;function o(i){const a=Bn(i);r[a]||(P0(s,i),r[a]=!0)}return x.isArray(t)?t.forEach(o):o(t),this}};tt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);x.reduceDescriptors(tt.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});x.freezeMethods(tt);function Ms(e,t){const n=this||yr,r=t||n,s=tt.from(r.headers);let o=r.data;return x.forEach(e,function(a){o=a.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function ic(e){return!!(e&&e.__CANCEL__)}function Nn(e,t,n){he.call(this,e??"canceled",he.ERR_CANCELED,t,n),this.name="CanceledError"}x.inherits(Nn,he,{__CANCEL__:!0});function ac(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new he("Request failed with status code "+n.status,[he.ERR_BAD_REQUEST,he.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function L0(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function N0(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,o=0,i;return t=t!==void 0?t:1e3,function(l){const u=Date.now(),c=r[o];i||(i=u),n[s]=l,r[s]=u;let d=o,f=0;for(;d!==s;)f+=n[d++],d=d%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),u-i<t)return;const y=c&&u-c;return y?Math.round(f*1e3/y):void 0}}function I0(e,t){let n=0,r=1e3/t,s,o;const i=(u,c=Date.now())=>{n=c,s=null,o&&(clearTimeout(o),o=null),e(...u)};return[(...u)=>{const c=Date.now(),d=c-n;d>=r?i(u,c):(s=u,o||(o=setTimeout(()=>{o=null,i(s)},r-d)))},()=>s&&i(s)]}const Kr=(e,t,n=3)=>{let r=0;const s=N0(50,250);return I0(o=>{const i=o.loaded,a=o.lengthComputable?o.total:void 0,l=i-r,u=s(l),c=i<=a;r=i;const d={loaded:i,total:a,progress:a?i/a:void 0,bytes:l,rate:u||void 0,estimated:u&&a&&c?(a-i)/u:void 0,event:o,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(d)},n)},Qi=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Xi=e=>(...t)=>x.asap(()=>e(...t)),D0=Ue.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Ue.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Ue.origin),Ue.navigator&&/(msie|trident)/i.test(Ue.navigator.userAgent)):()=>!0,$0=Ue.hasStandardBrowserEnv?{write(e,t,n,r,s,o,i){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];x.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),x.isString(r)&&a.push(`path=${r}`),x.isString(s)&&a.push(`domain=${s}`),o===!0&&a.push("secure"),x.isString(i)&&a.push(`SameSite=${i}`),document.cookie=a.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function V0(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function F0(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function lc(e,t,n){let r=!V0(t);return e&&(r||n==!1)?F0(e,t):t}const ea=e=>e instanceof tt?{...e}:e;function mn(e,t){t=t||{};const n={};function r(u,c,d,f){return x.isPlainObject(u)&&x.isPlainObject(c)?x.merge.call({caseless:f},u,c):x.isPlainObject(c)?x.merge({},c):x.isArray(c)?c.slice():c}function s(u,c,d,f){if(x.isUndefined(c)){if(!x.isUndefined(u))return r(void 0,u,d,f)}else return r(u,c,d,f)}function o(u,c){if(!x.isUndefined(c))return r(void 0,c)}function i(u,c){if(x.isUndefined(c)){if(!x.isUndefined(u))return r(void 0,u)}else return r(void 0,c)}function a(u,c,d){if(d in t)return r(u,c);if(d in e)return r(void 0,u)}const l={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(u,c,d)=>s(ea(u),ea(c),d,!0)};return x.forEach(Object.keys({...e,...t}),function(c){const d=l[c]||s,f=d(e[c],t[c],c);x.isUndefined(f)&&d!==a||(n[c]=f)}),n}const cc=e=>{const t=mn({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:a}=t;if(t.headers=i=tt.from(i),t.url=rc(lc(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),x.isFormData(n)){if(Ue.hasStandardBrowserEnv||Ue.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(x.isFunction(n.getHeaders)){const l=n.getHeaders(),u=["content-type","content-length"];Object.entries(l).forEach(([c,d])=>{u.inclu
Line truncated
|
||||
`+i.map(ia).join(`
|
||||
`):" "+ia(i[0]):"as no adapter specified";throw new he("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return s}const dc={getAdapter:J0,adapters:No};function Ps(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Nn(null,e)}function aa(e){return Ps(e),e.headers=tt.from(e.headers),e.data=Ms.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),dc.getAdapter(e.adapter||yr.adapter,e)(e).then(function(r){return Ps(e),r.data=Ms.call(e,e.transformResponse,r),r.headers=tt.from(r.headers),r},function(r){return ic(r)||(Ps(e),r&&r.response&&(r.response.data=Ms.call(e,e.transformResponse,r.response),r.response.headers=tt.from(r.response.headers))),Promise.reject(r)})}const fc="1.13.2",fs={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{fs[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const la={};fs.transitional=function(t,n,r){function s(o,i){return"[Axios v"+fc+"] Transitional option '"+o+"'"+i+(r?". "+r:"")}return(o,i,a)=>{if(t===!1)throw new he(s(i," has been removed"+(n?" in "+n:"")),he.ERR_DEPRECATED);return n&&!la[i]&&(la[i]=!0,console.warn(s(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,i,a):!0}};fs.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function Y0(e,t,n){if(typeof e!="object")throw new he("options must be an object",he.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const o=r[s],i=t[o];if(i){const a=e[o],l=a===void 0||i(a,o,e);if(l!==!0)throw new he("option "+o+" must be "+l,he.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new he("Unknown option "+o,he.ERR_BAD_OPTION)}}const Nr={assertOptions:Y0,validators:fs},_t=Nr.validators;let pn=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Ji,response:new Ji}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
||||
`+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=mn(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&Nr.assertOptions(r,{silentJSONParsing:_t.transitional(_t.boolean),forcedJSONParsing:_t.transitional(_t.boolean),clarifyTimeoutError:_t.transitional(_t.boolean)},!1),s!=null&&(x.isFunction(s)?n.paramsSerializer={serialize:s}:Nr.assertOptions(s,{encode:_t.function,serialize:_t.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Nr.assertOptions(n,{baseUrl:_t.spelling("baseURL"),withXsrfToken:_t.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&x.merge(o.common,o[n.method]);o&&x.forEach(["delete","get","head","post","put","patch","common"],h=>{delete o[h]}),n.headers=tt.concat(i,o);const a=[];let l=!0;this.interceptors.request.forEach(function(v){typeof v.runWhen=="function"&&v.runWhen(n)===!1||(l=l&&v.synchronous,a.unshift(v.fulfilled,v.rejected))});const u=[];this.interceptors.response.forEach(function(v){u.push(v.fulfilled,v.rejected)});let c,d=0,f;if(!l){const h=[aa.bind(this),void 0];for(h.unshift(...a),h.push(...u),f=h.length,c=Promise.resolve(n);d<f;)c=c.then(h[d++],h[d++]);return c}f=a.length;let y=n;for(;d<f;){const h=a[d++],v=a[d++];try{y=h(y)}catch(w){v.call(this,w);break}}try{c=aa.call(this,y)}catch(h){return Promise.reject(h)}for(d=0,f=u.length;d<f;)c=c.then(u[d++],u[d++]);return c}getUri(t){t=mn(this.defaults,t);const n=lc(t.baseURL,t.url,t.allowAbsoluteUrls);return rc(n,t.params,t.paramsSerializer)}};x.forEach(["delete","get","head","options"],function(t){pn.prototype[t]=function(n,r){return this.request(mn(r||{},{method:t,url:n,data:(r||{}).data}))}});x.forEach(["post","put","patch"],function(t){function n(r){return function(o,i,a){return this.request(mn(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}pn.prototype[t]=n(),pn.prototype[t+"Form"]=n(!0)});let Q0=class pc{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(a=>{r.subscribe(a),o=a}).then(s);return i.cancel=function(){r.unsubscribe(o)},i},t(function(o,i,a){r.reason||(r.reason=new Nn(o,i,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new pc(function(s){t=s}),cancel:t}}};function X0(e){return function(n){return e.apply(null,n)}}function e2(e){return x.isObject(e)&&e.isAxiosError===!0}const ro={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(ro).forEach(([e,t])=>{ro[t]=e});function hc(e){const t=new pn(e),n=Kl(pn.prototype.request,t);return x.extend(n,pn.prototype,t,{allOwnKeys:!0}),x.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return hc(mn(e,s))},n}const Me=hc(yr);Me.Axios=pn;Me.CanceledError=Nn;Me.CancelToken=Q0;Me.isCancel=ic;Me.VERSION=fc;Me.toFormData=ds;Me.AxiosError=he;Me.Cancel=Me.CanceledError;Me.all=function(t){return Promise.all(t)};Me.spread=X0;Me.isAxiosError=e2;Me.mergeConfig=mn;Me.AxiosH
Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
@tailwind base;@tailwind components;@tailwind utilities;:root{--vt-c-white: #ffffff;--vt-c-white-soft: #f8f8f8;--vt-c-white-mute: #f2f2f2;--vt-c-black: #181818;--vt-c-black-soft: #222222;--vt-c-black-mute: #282828;--vt-c-indigo: #2c3e50;--vt-c-divider-light-1: rgba(60, 60, 60, .29);--vt-c-divider-light-2: rgba(60, 60, 60, .12);--vt-c-divider-dark-1: rgba(84, 84, 84, .65);--vt-c-divider-dark-2: rgba(84, 84, 84, .48);--vt-c-text-light-1: var(--vt-c-indigo);--vt-c-text-light-2: rgba(60, 60, 60, .66);--vt-c-text-dark-1: var(--vt-c-white);--vt-c-text-dark-2: rgba(235, 235, 235, .64)}:root{--color-surface: #FFFFFF;--color-surface-elevated: #FFFFFF;--color-background: #F5F7FA;--color-background-soft: #F8F8F8;--color-background-mute: #EBEEF2;--color-text-primary: #111827;--color-text-secondary: #374151;--color-text-muted: #6B7280;--color-heading: #030712;--color-text: #374151;--color-border: #9CA3AF;--color-border-subtle: #D1D5DB;--color-border-hover: #6B7280;--color-primary: #0D7377;--color-secondary: #92610A;--color-accent-green: #15803D;--color-accent-purple: #7C3AED;--color-accent-red: #DC2626;--color-accent-cyan: #0E7490;--section-gap: 160px;--color-primary-bg: #AAE8E8;--color-secondary-bg: #FFC246;--color-accent-green-bg: #A5E5B6;--color-accent-purple-bg: #EBA0FC;--color-accent-red-bg: #FB787B;--color-accent-cyan-bg: #D1E6E4;--color-badge-cyan-bg: #D1E6E4;--color-badge-cyan-text: #0D7377;--color-badge-neutral-bg: #E5E7EB;--color-badge-neutral-text: #374151;--color-glass-bg: rgba(255, 255, 255, .75);--color-glass-border: rgba(0, 0, 0, .06);--color-glass-shadow: 0 4px 16px rgba(0, 0, 0, .04), 0 1px 3px rgba(0, 0, 0, .02);--color-glass-green-bg: linear-gradient(91deg, rgba(165, 229, 182, .35) 1.17%, rgba(165, 229, 182, .15) 99.82%);--color-glass-green-border: rgba(165, 229, 182, .3);--color-glass-green-shadow: 0 4px 12px rgba(165, 229, 182, .15);--color-glass-orange-bg: linear-gradient(91deg, rgba(245, 158, 11, .25) 1.17%, rgba(245, 158, 11, .12) 99.82%);--color-glass-orange-border: rgba(245, 158, 11, .25);--color-glass-orange-shadow: 0 4px 12px rgba(245, 158, 11, .15)}.dark{--color-surface: #0F1112;--color-surface-elevated: #1A1E1F;--color-background: #09090B;--color-background-soft: #111314;--color-background-mute: #1A1E1F;--color-text-primary: #F9FAFB;--color-text-secondary: #D1D5DB;--color-text-muted: #9CA3AF;--color-heading: #FFFFFF;--color-text: #ADADAD;--color-border: #4B4B4B;--color-border-subtle: #374151;--color-border-hover: #6B7280;--color-primary: #AAE8E8;--color-secondary: #FFC246;--color-accent-green: #A5E5B6;--color-accent-purple: #EBA0FC;--color-accent-red: #FB787B;--color-accent-cyan: #D1E6E4;--color-primary-bg: #0D7377;--color-secondary-bg: #92610A;--color-accent-green-bg: #15803D;--color-accent-purple-bg: #7C3AED;--color-accent-red-bg: #DC2626;--color-accent-cyan-bg: #0E7490;--color-badge-cyan-bg: #223231;--color-badge-cyan-text: #D1E6E4;--color-badge-neutral-bg: #374151;--color-badge-neutral-text: #D1D5DB;--color-glass-bg: rgba(0, 0, 0, .4);--color-glass-border: rgba(255, 255, 255, .05);--color-glass-shadow: 0 4px 16px rgba(0, 0, 0, .2);--color-glass-green-bg: linear-gradient(91deg, rgba(21, 128, 61, .25) 1.17%, rgba(21, 128, 61, .1) 99.82%);--color-glass-green-border: rgba(165, 229, 182, .15);--color-glass-green-shadow: 0 4px 12px rgba(0, 0, 0, .2);--color-glass-orange-bg: linear-gradient(91deg, rgba(245, 158, 11, .25) 1.17%, rgba(245, 158, 11, .12) 99.82%);--color-glass-orange-border: rgba(245, 158, 11, .15);--color-glass-orange-shadow: 0 4px 12px rgba(0, 0, 0, .2)}*,*:before,*:after{box-sizing:border-box;margin:0;font-weight:400}body{min-height:100vh;color:var(--color-text);background:var(--color-background);transition:color .5s,background-color .5s;line-height:1.6;font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;font-size:15px;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
import{M as x,c as s}from"./index-D0IT5vDS.js";const l={7:-7.5,8:-10,9:-12.5,10:-15,11:-17.5,12:-20},d=-116,i=8,u=5;function y(t,e){return t-e}function S(t){return l[t]??l[i]}function f(t,e){const r=e+u;if(t<=e){const o=t<=e-5?0:1;return{bars:o,color:"text-red-600 dark:text-red-400",snr:t,quality:o===0?"none":"poor"}}if(t<r){const n=(t-e)/u<.5?2:3;return{bars:n,color:n===2?"text-orange-600 dark:text-orange-400":"text-yellow-600 dark:text-yellow-400",snr:t,quality:"fair"}}const a=t-r>=10?5:4;return{bars:a,color:a===5?"text-green-600 dark:text-green-400":"text-green-600 dark:text-green-300",snr:t,quality:a===5?"excellent":"good"}}function N(){const t=x(),e=s(()=>t.noiseFloorDbm??d),r=s(()=>t.stats?.config?.radio?.spreading_factor??i),c=s(()=>S(r.value));return{getSignalQuality:o=>{if(!o||o>0||o<-120)return{bars:0,color:"text-gray-400 dark:text-gray-500",snr:-999,quality:"none"};const n=y(o,e.value),g=Math.max(-30,Math.min(20,n));return f(g,c.value)},noiseFloor:e,spreadingFactor:r,minSNR:c}}export{N as u};
|
||||
@@ -8,8 +8,8 @@
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&display=swap" rel="stylesheet">
|
||||
<script type="module" crossorigin src="/assets/index-BvDdpPbD.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-CMJaSgt0.css">
|
||||
<script type="module" crossorigin src="/assets/index-D0IT5vDS.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-b0YoQjVs.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
||||
Reference in new issue
Block a user