Add database-level payload dedupe

This commit is contained in:
Jack Kingsman committed 2026-01-17 17:06:25 -08:00
1 parent 4219f96894
commit 850ce2d6c7
17 files changed
+412 -243

No files matched your search

-2
View File
@@ -215,8 +215,6 @@ All endpoints are prefixed with `/api` (e.g., `/api/health`).
| POST | `/api/packets/decrypt/historical` | Decrypt stored packets |
| GET | `/api/packets/decrypt/progress` | Get historical decryption progress |
| POST | `/api/packets/maintenance` | Delete old packets (cleanup) |
| POST | `/api/packets/dedup` | Remove duplicate raw packets |
| GET | `/api/packets/dedup/progress` | Get deduplication progress |
| POST | `/api/contacts/{key}/mark-read` | Mark contact conversation as read |
| POST | `/api/channels/{key}/mark-read` | Mark channel as read |
| POST | `/api/read-state/mark-all-read` | Mark all conversations as read |
+2
View File
@@ -50,12 +50,14 @@ CREATE TABLE IF NOT EXISTS raw_packets (
timestamp INTEGER NOT NULL,
data BLOB NOT NULL,
message_id INTEGER,
payload_hash TEXT,
FOREIGN KEY (message_id) REFERENCES messages(id)
);
CREATE INDEX IF NOT EXISTS idx_messages_conversation ON messages(type, conversation_key);
CREATE INDEX IF NOT EXISTS idx_messages_received ON messages(received_at);
CREATE INDEX IF NOT EXISTS idx_raw_packets_message_id ON raw_packets(message_id);
CREATE UNIQUE INDEX IF NOT EXISTS idx_raw_packets_payload_hash ON raw_packets(payload_hash);
CREATE INDEX IF NOT EXISTS idx_contacts_on_radio ON contacts(on_radio);
"""
+179
View File
@@ -9,6 +9,7 @@ so all migrations run in order on first startup after upgrade.
"""
import logging
from hashlib import sha256
import aiosqlite
@@ -57,6 +58,20 @@ async def run_migrations(conn: aiosqlite.Connection) -> int:
await set_version(conn, 3)
applied += 1
# Migration 4: Add payload_hash column for deduplication
if version < 4:
logger.info("Applying migration 4: add payload_hash column")
await _migrate_004_add_payload_hash_column(conn)
await set_version(conn, 4)
applied += 1
# Migration 5: Backfill payload hashes and deduplicate existing packets
if version < 5:
logger.info("Applying migration 5: backfill payload hashes and dedupe")
await _migrate_005_backfill_payload_hashes(conn)
await set_version(conn, 5)
applied += 1
if applied > 0:
logger.info(
"Applied %d migration(s), schema now at version %d", applied, await get_version(conn)
@@ -169,3 +184,167 @@ async def _migrate_003_drop_decrypted_column(conn: aiosqlite.Connection) -> None
raise
await conn.commit()
async def _migrate_004_add_payload_hash_column(conn: aiosqlite.Connection) -> None:
"""
Add payload_hash column to raw_packets for deduplication.
This column stores the SHA-256 hash of the packet payload (excluding routing/path info).
It will be used with a unique index to prevent duplicate packets from being stored.
"""
try:
await conn.execute("ALTER TABLE raw_packets ADD COLUMN payload_hash TEXT")
logger.debug("Added payload_hash column to raw_packets table")
except aiosqlite.OperationalError as e:
if "duplicate column name" in str(e).lower():
logger.debug("raw_packets.payload_hash already exists, skipping")
else:
raise
await conn.commit()
def _extract_payload_for_hash(raw_packet: bytes) -> bytes | None:
"""
Extract payload from a raw packet for hashing (migration-local copy of decoder logic).
Returns the payload bytes, or None if packet is malformed.
"""
if len(raw_packet) < 2:
return None
try:
header = raw_packet[0]
route_type = header & 0x03
offset = 1
# Skip transport codes if present (TRANSPORT_FLOOD=0, TRANSPORT_DIRECT=3)
if route_type in (0x00, 0x03):
if len(raw_packet) < offset + 4:
return None
offset += 4
# Get path length
if len(raw_packet) < offset + 1:
return None
path_length = raw_packet[offset]
offset += 1
# Skip path bytes
if len(raw_packet) < offset + path_length:
return None
offset += path_length
# Rest is payload (may be empty, matching decoder.py behavior)
return raw_packet[offset:]
except (IndexError, ValueError):
return None
async def _migrate_005_backfill_payload_hashes(conn: aiosqlite.Connection) -> None:
"""
Backfill payload_hash for existing packets and remove duplicates.
This may take a while for large databases. Progress is logged.
After backfilling, a unique index is created to prevent future duplicates.
"""
# Get count first
cursor = await conn.execute("SELECT COUNT(*) FROM raw_packets WHERE payload_hash IS NULL")
row = await cursor.fetchone()
total = row[0] if row else 0
if total == 0:
logger.debug("No packets need hash backfill")
else:
logger.info("Backfilling payload hashes for %d packets. This may take a while...", total)
# Process in batches to avoid memory issues
batch_size = 1000
processed = 0
duplicates_deleted = 0
# Track seen hashes to identify duplicates (keep oldest = lowest ID)
seen_hashes: dict[str, int] = {} # hash -> oldest packet ID
# First pass: compute hashes and identify duplicates
cursor = await conn.execute("SELECT id, data FROM raw_packets ORDER BY id ASC")
packets_to_update: list[tuple[str, int]] = [] # (hash, id)
ids_to_delete: list[int] = []
while True:
rows = await cursor.fetchmany(batch_size)
if not rows:
break
for row in rows:
packet_id = row[0]
packet_data = bytes(row[1])
# Extract payload and compute hash
payload = _extract_payload_for_hash(packet_data)
if payload:
payload_hash = sha256(payload).hexdigest()
else:
# For malformed packets, hash the full data
payload_hash = sha256(packet_data).hexdigest()
if payload_hash in seen_hashes:
# Duplicate - mark for deletion (we keep the older one)
ids_to_delete.append(packet_id)
duplicates_deleted += 1
else:
# New hash - keep this packet
seen_hashes[payload_hash] = packet_id
packets_to_update.append((payload_hash, packet_id))
processed += 1
if processed % 10000 == 0:
logger.info("Processed %d/%d packets...", processed, total)
# Second pass: update hashes for packets we're keeping
total_updates = len(packets_to_update)
logger.info("Updating %d packets with hashes...", total_updates)
for idx, (payload_hash, packet_id) in enumerate(packets_to_update, 1):
await conn.execute(
"UPDATE raw_packets SET payload_hash = ? WHERE id = ?",
(payload_hash, packet_id),
)
if idx % 10000 == 0:
logger.info("Updated %d/%d packets...", idx, total_updates)
# Third pass: delete duplicates
if ids_to_delete:
total_deletes = len(ids_to_delete)
logger.info("Removing %d duplicate packets...", total_deletes)
deleted_count = 0
# Delete in batches to avoid "too many SQL variables" error
for i in range(0, len(ids_to_delete), 500):
batch = ids_to_delete[i : i + 500]
placeholders = ",".join("?" * len(batch))
await conn.execute(f"DELETE FROM raw_packets WHERE id IN ({placeholders})", batch)
deleted_count += len(batch)
if deleted_count % 10000 < 500: # Log roughly every 10k
logger.info("Removed %d/%d duplicates...", deleted_count, total_deletes)
await conn.commit()
logger.info(
"Hash backfill complete: %d packets updated, %d duplicates removed",
len(packets_to_update),
duplicates_deleted,
)
# Create unique index on payload_hash (this enforces uniqueness going forward)
try:
await conn.execute(
"CREATE UNIQUE INDEX IF NOT EXISTS idx_raw_packets_payload_hash "
"ON raw_packets(payload_hash)"
)
logger.debug("Created unique index on payload_hash")
except aiosqlite.OperationalError as e:
if "already exists" not in str(e).lower():
raise
await conn.commit()
+22 -14
View File
@@ -155,10 +155,15 @@ async def process_raw_packet(
Process an incoming raw packet.
This is the main entry point for all incoming RF packets.
Note: Packets are deduplicated by payload hash in the database. If we receive
a duplicate packet (same payload, different path), we still broadcast it to
the frontend (for the real-time packet feed) but skip decryption processing
since the original packet was already processed.
"""
ts = timestamp or int(time.time())
packet_id = await RawPacketRepository.create(raw_bytes, ts)
packet_id, is_new_packet = await RawPacketRepository.create(raw_bytes, ts)
raw_hex = raw_bytes.hex()
# Parse packet to get type
@@ -179,22 +184,25 @@ async def process_raw_packet(
"sender": None,
}
# Try to decrypt/parse based on payload type
if payload_type == PayloadType.GROUP_TEXT:
decrypt_result = await _process_group_text(raw_bytes, packet_id, ts, packet_info)
if decrypt_result:
result.update(decrypt_result)
# Only process new packets - duplicates were already processed when first received
if is_new_packet:
# Try to decrypt/parse based on payload type
if payload_type == PayloadType.GROUP_TEXT:
decrypt_result = await _process_group_text(raw_bytes, packet_id, ts, packet_info)
if decrypt_result:
result.update(decrypt_result)
elif payload_type == PayloadType.ADVERT:
await _process_advertisement(raw_bytes, ts, packet_info)
elif payload_type == PayloadType.ADVERT:
await _process_advertisement(raw_bytes, ts, packet_info)
# TODO: Add TEXT_MESSAGE (direct message) decryption when private key is available
# elif payload_type == PayloadType.TEXT_MESSAGE:
# decrypt_result = await _process_direct_message(raw_bytes, packet_id, ts, packet_info)
# if decrypt_result:
# result.update(decrypt_result)
# TODO: Add TEXT_MESSAGE (direct message) decryption when private key is available
# elif payload_type == PayloadType.TEXT_MESSAGE:
# decrypt_result = await _process_direct_message(raw_bytes, packet_id, ts, packet_info)
# if decrypt_result:
# result.update(decrypt_result)
# Broadcast raw packet for the packet feed UI
# Always broadcast raw packet for the packet feed UI (even duplicates)
# This enables the frontend cracker to see all incoming packets in real-time
broadcast_payload = RawPacketBroadcast(
id=packet_id,
timestamp=ts,
+58 -7
View File
@@ -1,9 +1,15 @@
import logging
import sqlite3
import time
from hashlib import sha256
from typing import Any
from app.database import db
from app.decoder import extract_payload
from app.models import Channel, Contact, Message, RawPacket
logger = logging.getLogger(__name__)
class ContactRepository:
@staticmethod
@@ -454,17 +460,62 @@ class MessageRepository:
class RawPacketRepository:
@staticmethod
async def create(data: bytes, timestamp: int | None = None) -> int:
"""Create a raw packet. Returns the packet ID."""
async def create(data: bytes, timestamp: int | None = None) -> tuple[int, bool]:
"""
Create a raw packet with payload-based deduplication.
Returns (packet_id, is_new) tuple:
- is_new=True: New packet stored, packet_id is the new row ID
- is_new=False: Duplicate payload detected, packet_id is the existing row ID
Deduplication is based on the SHA-256 hash of the packet payload
(excluding routing/path information).
"""
ts = timestamp or int(time.time())
# Compute payload hash for deduplication
payload = extract_payload(data)
if payload:
payload_hash = sha256(payload).hexdigest()
else:
# For malformed packets, hash the full data
payload_hash = sha256(data).hexdigest()
# Check if this payload already exists
cursor = await db.conn.execute(
"INSERT INTO raw_packets (timestamp, data) VALUES (?, ?)",
(ts, data),
"SELECT id FROM raw_packets WHERE payload_hash = ?", (payload_hash,)
)
await db.conn.commit()
assert cursor.lastrowid is not None # INSERT always returns a row ID
return cursor.lastrowid
existing = await cursor.fetchone()
if existing:
# Duplicate - return existing packet ID
return (existing["id"], False)
# New packet - insert with hash
try:
cursor = await db.conn.execute(
"INSERT INTO raw_packets (timestamp, data, payload_hash) VALUES (?, ?, ?)",
(ts, data, payload_hash),
)
await db.conn.commit()
assert cursor.lastrowid is not None # INSERT always returns a row ID
return (cursor.lastrowid, True)
except sqlite3.IntegrityError:
# Race condition: another insert with same payload_hash happened between
# our SELECT and INSERT. This is expected for duplicate packets arriving
# close together. Query again to get the existing ID.
logger.debug(
"Duplicate packet detected via race condition (payload_hash=%s), dropping",
payload_hash[:16],
)
cursor = await db.conn.execute(
"SELECT id FROM raw_packets WHERE payload_hash = ?", (payload_hash,)
)
existing = await cursor.fetchone()
if existing:
return (existing["id"], False)
# This shouldn't happen, but if it does, re-raise
raise
@staticmethod
async def get_undecrypted_count() -> int:
+1 -129
View File
@@ -5,7 +5,7 @@ from fastapi import APIRouter, BackgroundTasks
from pydantic import BaseModel, Field
from app.database import db
from app.decoder import extract_payload, try_decrypt_packet_with_channel_key
from app.decoder import try_decrypt_packet_with_channel_key
from app.packet_processor import create_message_from_decrypted
from app.repository import RawPacketRepository
@@ -209,131 +209,3 @@ async def run_maintenance(request: MaintenanceRequest) -> MaintenanceResult:
logger.info("Database vacuumed")
return MaintenanceResult(packets_deleted=deleted, vacuumed=True)
class DedupProgress(BaseModel):
total: int
processed: int
duplicates_removed: int
in_progress: bool
class DedupResult(BaseModel):
started: bool
total_packets: int
message: str
# Global state for tracking dedup progress
_dedup_progress: DedupProgress | None = None
async def _run_payload_dedup() -> None:
"""Background task to remove duplicate-payload packets."""
global _dedup_progress
# Get all undecrypted packets
packets = await RawPacketRepository.get_all_undecrypted()
total = len(packets)
_dedup_progress = DedupProgress(
total=total, processed=0, duplicates_removed=0, in_progress=True
)
logger.info("Starting payload deduplication of %d packets", total)
# Group packets by payload hash
payload_groups: dict[str, list[int]] = {} # hash -> list of packet IDs
for packet_id, packet_data, _timestamp in packets:
payload = extract_payload(packet_data)
if payload is None:
continue
payload_hash = sha256(payload).hexdigest()
if payload_hash not in payload_groups:
payload_groups[payload_hash] = []
payload_groups[payload_hash].append(packet_id)
_dedup_progress = DedupProgress(
total=total,
processed=_dedup_progress.processed + 1,
duplicates_removed=_dedup_progress.duplicates_removed,
in_progress=True,
)
# Delete duplicates (keep the first/oldest packet in each group)
duplicates_removed = 0
for packet_ids in payload_groups.values():
if len(packet_ids) > 1:
# Keep the first one, delete the rest
ids_to_delete = packet_ids[1:]
for packet_id in ids_to_delete:
await db.conn.execute("DELETE FROM raw_packets WHERE id = ?", (packet_id,))
duplicates_removed += 1
_dedup_progress = DedupProgress(
total=total,
processed=_dedup_progress.processed,
duplicates_removed=duplicates_removed,
in_progress=True,
)
await db.conn.commit()
# Run VACUUM to reclaim space (must be outside transaction, use executescript)
await db.conn.executescript("VACUUM;")
_dedup_progress = DedupProgress(
total=total,
processed=total,
duplicates_removed=duplicates_removed,
in_progress=False,
)
logger.info("Payload deduplication complete: removed %d duplicates", duplicates_removed)
@router.post("/dedup", response_model=DedupResult)
async def deduplicate_packets(background_tasks: BackgroundTasks) -> DedupResult:
"""
Remove packets with duplicate payloads (keeps one copy of each unique payload).
This operation runs in the background and may take a long time for large databases.
Use GET /packets/dedup/progress to check status.
Note: This only affects undecrypted packets. Packets that arrive through different
repeater paths have different full data but the same payload - this removes those duplicates.
"""
global _dedup_progress
# Check if dedup is already in progress
if _dedup_progress and _dedup_progress.in_progress:
return DedupResult(
started=False,
total_packets=_dedup_progress.total,
message=f"Deduplication already in progress: {_dedup_progress.processed}/{_dedup_progress.total}",
)
# Get count of undecrypted packets
count = await RawPacketRepository.get_undecrypted_count()
if count == 0:
return DedupResult(
started=False, total_packets=0, message="No undecrypted packets to process"
)
# Start background dedup
background_tasks.add_task(_run_payload_dedup)
return DedupResult(
started=True,
total_packets=count,
message=f"Started deduplication of {count} packets in background. This may take a while.",
)
@router.get("/dedup/progress", response_model=DedupProgress | None)
async def get_dedup_progress() -> DedupProgress | None:
"""Get the current progress of payload deduplication."""
return _dedup_progress
+1 -1
View File
@@ -46,7 +46,7 @@ frontend/
│ │ ├── CrackerPanel.tsx # WebGPU channel key cracker (lazy-loads wordlist)
│ │ ├── NewMessageModal.tsx
│ │ ├── ConfigModal.tsx # Radio config + app settings
│ │ └── MaintenanceModal.tsx # Database maintenance (cleanup, dedup)
│ │ └── MaintenanceModal.tsx # Database maintenance (packet cleanup)
│ └── test/
│ ├── setup.ts # Test setup (jsdom, matchers)
│ ├── messageParser.test.ts
-1
View File
@@ -1 +0,0 @@
{"version":3,"mappings":"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 truncated
@@ -6,7 +6,7 @@ var yv=Object.defineProperty;var _v=(r,a,o)=>a in r?yv(r,a,{enumerable:!0,config
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Ap;function bv(){if(Ap)return at;Ap=1;var r=Symbol.for("react.element"),a=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),d=Symbol.for("react.provider"),m=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),v=Symbol.iterator;function w(S){return S===null||typeof S!="object"?null:(S=v&&S[v]||S["@@iterator"],typeof S=="function"?S:null)}var B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},R=Object.assign,C={};function E(S,V,K){this.props=S,this.context=V,this.refs=C,this.updater=K||B}E.prototype.isReactComponent={},E.prototype.setState=function(S,V){if(typeof S!="object"&&typeof S!="function"&&S!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,S,V,"setState")},E.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function T(){}T.prototype=E.prototype;function P(S,V,K){this.props=S,this.context=V,this.refs=C,this.updater=K||B}var k=P.prototype=new T;k.constructor=P,R(k,E.prototype),k.isPureReactComponent=!0;var N=Array.isArray,I=Object.prototype.hasOwnProperty,z={current:null},j={key:!0,ref:!0,__self:!0,__source:!0};function H(S,V,K){var Y,he={},pe=null,Ee=null;if(V!=null)for(Y in V.ref!==void 0&&(Ee=V.ref),V.key!==void 0&&(pe=""+V.key),V)I.call(V,Y)&&!j.hasOwnProperty(Y)&&(he[Y]=V[Y]);var ge=arguments.length-2;if(ge===1)he.children=K;else if(1<ge){for(var We=Array(ge),Ye=0;Ye<ge;Ye++)We[Ye]=arguments[Ye+2];he.children=We}if(S&&S.defaultProps)for(Y in ge=S.defaultProps,ge)he[Y]===void 0&&(he[Y]=ge[Y]);return{$$typeof:r,type:S,key:pe,ref:Ee,props:he,_owner:z.current}}function $(S,V){return{$$typeof:r,type:S.type,key:V,ref:S.ref,props:S.props,_owner:S._owner}}function U(S){return typeof S=="object"&&S!==null&&S.$$typeof===r}function G(S){var V={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(K){return V[K]})}var ne=/\/+/g;function ee(S,V){return typeof S=="object"&&S!==null&&S.key!=null?G(""+S.key):V.toString(36)}function oe(S,V,K,Y,he){var pe=typeof S;(pe==="undefined"||pe==="boolean")&&(S=null);var Ee=!1;if(S===null)Ee=!0;else switch(pe){case"string":case"number":Ee=!0;break;case"object":switch(S.$$typeof){case r:case a:Ee=!0}}if(Ee)return Ee=S,he=he(Ee),S=Y===""?"."+ee(Ee,0):Y,N(he)?(K="",S!=null&&(K=S.replace(ne,"$&/")+"/"),oe(he,V,K,"",function(Ye){return Ye})):he!=null&&(U(he)&&(he=$(he,K+(!he.key||Ee&&Ee.key===he.key?"":(""+he.key).replace(ne,"$&/")+"/")+S)),V.push(he)),1;if(Ee=0,Y=Y===""?".":Y+":",N(S))for(var ge=0;ge<S.length;ge++){pe=S[ge];var We=Y+ee(pe,ge);Ee+=oe(pe,V,K,We,he)}else if(We=w(S),typeof We=="function")for(S=We.call(S),ge=0;!(pe=S.next()).done;)pe=pe.value,We=Y+ee(pe,ge++),Ee+=oe(pe,V,K,We,he);else if(pe==="object")throw V=String(S),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(S).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.");return Ee}function de(S,V,K){if(S==null)return S;var Y=[],he=0;return oe(S,Y,"","",function(pe){return V.call(K,pe,he++)}),Y}function le(S){if(S._status===-1){var V=S._result;V=V(),V.then(function(K){(S._status===0||S._status===-1)&&(S._status=1,S._result=K)},function(K){(S._status===0||S._status===-1)&&(S._status=2,S._result=K)}),S._status===-1&&(S._status=0,S._result=V)}if(S._status===1)return S._result.default;throw S._result}var fe={current:null},q={transition:null},J={ReactCurrentDispatcher:fe,ReactCurrentBatchConfig:q,ReactCurrentOwner:z};function W(){throw Error("act(...) is not supported in production builds of React.")}return at.Children={map:de,forEach:function(S,V,K){de(S,function(){V.apply(this,arguments)},K)},count:function(S){var V=0;return de(S,function(){V++}),V},toArray:function(S){return de(S,function(V){return V})||[]},only:function(S){if(!U(S))throw Error("React.Children.only expected to receive a single React element child.");return S}},at.Component=E,at.Fragment=o,at.Profiler=f,at.PureComponent=P,at.StrictMode=l,at.Suspense=x,at.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=J,at.act=W,at.cloneElement=function(S,V,K){if(S==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+S+".");var Y=R({},S.props),he=S.key,pe=S.ref,Ee=S._owner;if(V!=null){if(V.ref!==void 0&&(pe=V.ref,Ee=z.current),V.key!==void 0&&(he=""+V.key),S.type&&S.type.defaultProps)var ge=S.type.defaultProps;for(We in V)I.call(V,We)&&!j.hasOwnProperty(We)&&(Y[We]=V[We]===void 0&&ge!==void 0?ge[We]:V[We])}var We=arguments.length-2;if(We===1)Y.children=K;else if(1<We){ge=Array(We);for(var Ye=0;Ye<We;Ye++)ge[Ye]=arguments[Ye+2];Y.children=ge}return{$$typeof:r,type:S.type,key:he,ref:pe,props:Y,_owner:Ee}},at.cLine truncated
*/var Ap;function bv(){if(Ap)return at;Ap=1;var r=Symbol.for("react.element"),a=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),d=Symbol.for("react.provider"),m=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),y=Symbol.iterator;function w(S){return S===null||typeof S!="object"?null:(S=y&&S[y]||S["@@iterator"],typeof S=="function"?S:null)}var P={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},D=Object.assign,C={};function E(S,V,K){this.props=S,this.context=V,this.refs=C,this.updater=K||P}E.prototype.isReactComponent={},E.prototype.setState=function(S,V){if(typeof S!="object"&&typeof S!="function"&&S!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,S,V,"setState")},E.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function T(){}T.prototype=E.prototype;function B(S,V,K){this.props=S,this.context=V,this.refs=C,this.updater=K||P}var k=B.prototype=new T;k.constructor=B,D(k,E.prototype),k.isPureReactComponent=!0;var N=Array.isArray,I=Object.prototype.hasOwnProperty,z={current:null},j={key:!0,ref:!0,__self:!0,__source:!0};function H(S,V,K){var Y,he={},pe=null,Ee=null;if(V!=null)for(Y in V.ref!==void 0&&(Ee=V.ref),V.key!==void 0&&(pe=""+V.key),V)I.call(V,Y)&&!j.hasOwnProperty(Y)&&(he[Y]=V[Y]);var ge=arguments.length-2;if(ge===1)he.children=K;else if(1<ge){for(var We=Array(ge),Ye=0;Ye<ge;Ye++)We[Ye]=arguments[Ye+2];he.children=We}if(S&&S.defaultProps)for(Y in ge=S.defaultProps,ge)he[Y]===void 0&&(he[Y]=ge[Y]);return{$$typeof:r,type:S,key:pe,ref:Ee,props:he,_owner:z.current}}function $(S,V){return{$$typeof:r,type:S.type,key:V,ref:S.ref,props:S.props,_owner:S._owner}}function U(S){return typeof S=="object"&&S!==null&&S.$$typeof===r}function G(S){var V={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(K){return V[K]})}var ne=/\/+/g;function ee(S,V){return typeof S=="object"&&S!==null&&S.key!=null?G(""+S.key):V.toString(36)}function oe(S,V,K,Y,he){var pe=typeof S;(pe==="undefined"||pe==="boolean")&&(S=null);var Ee=!1;if(S===null)Ee=!0;else switch(pe){case"string":case"number":Ee=!0;break;case"object":switch(S.$$typeof){case r:case a:Ee=!0}}if(Ee)return Ee=S,he=he(Ee),S=Y===""?"."+ee(Ee,0):Y,N(he)?(K="",S!=null&&(K=S.replace(ne,"$&/")+"/"),oe(he,V,K,"",function(Ye){return Ye})):he!=null&&(U(he)&&(he=$(he,K+(!he.key||Ee&&Ee.key===he.key?"":(""+he.key).replace(ne,"$&/")+"/")+S)),V.push(he)),1;if(Ee=0,Y=Y===""?".":Y+":",N(S))for(var ge=0;ge<S.length;ge++){pe=S[ge];var We=Y+ee(pe,ge);Ee+=oe(pe,V,K,We,he)}else if(We=w(S),typeof We=="function")for(S=We.call(S),ge=0;!(pe=S.next()).done;)pe=pe.value,We=Y+ee(pe,ge++),Ee+=oe(pe,V,K,We,he);else if(pe==="object")throw V=String(S),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(S).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.");return Ee}function de(S,V,K){if(S==null)return S;var Y=[],he=0;return oe(S,Y,"","",function(pe){return V.call(K,pe,he++)}),Y}function le(S){if(S._status===-1){var V=S._result;V=V(),V.then(function(K){(S._status===0||S._status===-1)&&(S._status=1,S._result=K)},function(K){(S._status===0||S._status===-1)&&(S._status=2,S._result=K)}),S._status===-1&&(S._status=0,S._result=V)}if(S._status===1)return S._result.default;throw S._result}var fe={current:null},q={transition:null},J={ReactCurrentDispatcher:fe,ReactCurrentBatchConfig:q,ReactCurrentOwner:z};function W(){throw Error("act(...) is not supported in production builds of React.")}return at.Children={map:de,forEach:function(S,V,K){de(S,function(){V.apply(this,arguments)},K)},count:function(S){var V=0;return de(S,function(){V++}),V},toArray:function(S){return de(S,function(V){return V})||[]},only:function(S){if(!U(S))throw Error("React.Children.only expected to receive a single React element child.");return S}},at.Component=E,at.Fragment=o,at.Profiler=f,at.PureComponent=B,at.StrictMode=l,at.Suspense=x,at.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=J,at.act=W,at.cloneElement=function(S,V,K){if(S==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+S+".");var Y=D({},S.props),he=S.key,pe=S.ref,Ee=S._owner;if(V!=null){if(V.ref!==void 0&&(pe=V.ref,Ee=z.current),V.key!==void 0&&(he=""+V.key),S.type&&S.type.defaultProps)var ge=S.type.defaultProps;for(We in V)I.call(V,We)&&!j.hasOwnProperty(We)&&(Y[We]=V[We]===void 0&&ge!==void 0?ge[We]:V[We])}var We=arguments.length-2;if(We===1)Y.children=K;else if(1<We){ge=Array(We);for(var Ye=0;Ye<We;Ye++)ge[Ye]=arguments[Ye+2];Y.children=ge}return{$$typeof:r,type:S.type,key:he,ref:pe,props:Y,_owner:Ee}},at.cLine truncated
* @license React
* react-jsx-runtime.production.min.js
*
@@ -14,7 +14,7 @@ var yv=Object.defineProperty;var _v=(r,a,o)=>a in r?yv(r,a,{enumerable:!0,config
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var xp;function Cv(){if(xp)return Ia;xp=1;var r=a0(),a=Symbol.for("react.element"),o=Symbol.for("react.fragment"),l=Object.prototype.hasOwnProperty,f=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,d={key:!0,ref:!0,__self:!0,__source:!0};function m(h,x,p){var y,v={},w=null,B=null;p!==void 0&&(w=""+p),x.key!==void 0&&(w=""+x.key),x.ref!==void 0&&(B=x.ref);for(y in x)l.call(x,y)&&!d.hasOwnProperty(y)&&(v[y]=x[y]);if(h&&h.defaultProps)for(y in x=h.defaultProps,x)v[y]===void 0&&(v[y]=x[y]);return{$$typeof:a,type:h,key:w,ref:B,props:v,_owner:f.current}}return Ia.Fragment=o,Ia.jsx=m,Ia.jsxs=m,Ia}var vp;function Ev(){return vp||(vp=1,Cf.exports=Cv()),Cf.exports}var D=Ev(),F=a0();const be=Zs(F),l0=wv({__proto__:null,default:be},[F]);var bu={},kf={exports:{}},Hn={},Sf={exports:{}},Bf={};/**
*/var xp;function Cv(){if(xp)return Ia;xp=1;var r=a0(),a=Symbol.for("react.element"),o=Symbol.for("react.fragment"),l=Object.prototype.hasOwnProperty,f=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,d={key:!0,ref:!0,__self:!0,__source:!0};function m(h,x,p){var v,y={},w=null,P=null;p!==void 0&&(w=""+p),x.key!==void 0&&(w=""+x.key),x.ref!==void 0&&(P=x.ref);for(v in x)l.call(x,v)&&!d.hasOwnProperty(v)&&(y[v]=x[v]);if(h&&h.defaultProps)for(v in x=h.defaultProps,x)y[v]===void 0&&(y[v]=x[v]);return{$$typeof:a,type:h,key:w,ref:P,props:y,_owner:f.current}}return Ia.Fragment=o,Ia.jsx=m,Ia.jsxs=m,Ia}var vp;function Ev(){return vp||(vp=1,Cf.exports=Cv()),Cf.exports}var R=Ev(),F=a0();const be=Zs(F),l0=wv({__proto__:null,default:be},[F]);var bu={},kf={exports:{}},Hn={},Sf={exports:{}},Bf={};/**
* @license React
* scheduler.production.min.js
*
@@ -22,7 +22,7 @@ var yv=Object.defineProperty;var _v=(r,a,o)=>a in r?yv(r,a,{enumerable:!0,config
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var yp;function kv(){return yp||(yp=1,(function(r){function a(q,J){var W=q.length;q.push(J);e:for(;0<W;){var S=W-1>>>1,V=q[S];if(0<f(V,J))q[S]=J,q[W]=V,W=S;else break e}}function o(q){return q.length===0?null:q[0]}function l(q){if(q.length===0)return null;var J=q[0],W=q.pop();if(W!==J){q[0]=W;e:for(var S=0,V=q.length,K=V>>>1;S<K;){var Y=2*(S+1)-1,he=q[Y],pe=Y+1,Ee=q[pe];if(0>f(he,W))pe<V&&0>f(Ee,he)?(q[S]=Ee,q[pe]=W,S=pe):(q[S]=he,q[Y]=W,S=Y);else if(pe<V&&0>f(Ee,W))q[S]=Ee,q[pe]=W,S=pe;else break e}}return J}function f(q,J){var W=q.sortIndex-J.sortIndex;return W!==0?W:q.id-J.id}if(typeof performance=="object"&&typeof performance.now=="function"){var d=performance;r.unstable_now=function(){return d.now()}}else{var m=Date,h=m.now();r.unstable_now=function(){return m.now()-h}}var x=[],p=[],y=1,v=null,w=3,B=!1,R=!1,C=!1,E=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,P=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function k(q){for(var J=o(p);J!==null;){if(J.callback===null)l(p);else if(J.startTime<=q)l(p),J.sortIndex=J.expirationTime,a(x,J);else break;J=o(p)}}function N(q){if(C=!1,k(q),!R)if(o(x)!==null)R=!0,le(I);else{var J=o(p);J!==null&&fe(N,J.startTime-q)}}function I(q,J){R=!1,C&&(C=!1,T(H),H=-1),B=!0;var W=w;try{for(k(J),v=o(x);v!==null&&(!(v.expirationTime>J)||q&&!G());){var S=v.callback;if(typeof S=="function"){v.callback=null,w=v.priorityLevel;var V=S(v.expirationTime<=J);J=r.unstable_now(),typeof V=="function"?v.callback=V:v===o(x)&&l(x),k(J)}else l(x);v=o(x)}if(v!==null)var K=!0;else{var Y=o(p);Y!==null&&fe(N,Y.startTime-J),K=!1}return K}finally{v=null,w=W,B=!1}}var z=!1,j=null,H=-1,$=5,U=-1;function G(){return!(r.unstable_now()-U<$)}function ne(){if(j!==null){var q=r.unstable_now();U=q;var J=!0;try{J=j(!0,q)}finally{J?ee():(z=!1,j=null)}}else z=!1}var ee;if(typeof P=="function")ee=function(){P(ne)};else if(typeof MessageChannel<"u"){var oe=new MessageChannel,de=oe.port2;oe.port1.onmessage=ne,ee=function(){de.postMessage(null)}}else ee=function(){E(ne,0)};function le(q){j=q,z||(z=!0,ee())}function fe(q,J){H=E(function(){q(r.unstable_now())},J)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(q){q.callback=null},r.unstable_continueExecution=function(){R||B||(R=!0,le(I))},r.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):$=0<q?Math.floor(1e3/q):5},r.unstable_getCurrentPriorityLevel=function(){return w},r.unstable_getFirstCallbackNode=function(){return o(x)},r.unstable_next=function(q){switch(w){case 1:case 2:case 3:var J=3;break;default:J=w}var W=w;w=J;try{return q()}finally{w=W}},r.unstable_pauseExecution=function(){},r.unstable_requestPaint=function(){},r.unstable_runWithPriority=function(q,J){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var W=w;w=q;try{return J()}finally{w=W}},r.unstable_scheduleCallback=function(q,J,W){var S=r.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?S+W:S):W=S,q){case 1:var V=-1;break;case 2:V=250;break;case 5:V=1073741823;break;case 4:V=1e4;break;default:V=5e3}return V=W+V,q={id:y++,callback:J,priorityLevel:q,startTime:W,expirationTime:V,sortIndex:-1},W>S?(q.sortIndex=W,a(p,q),o(x)===null&&q===o(p)&&(C?(T(H),H=-1):C=!0,fe(N,W-S))):(q.sortIndex=V,a(x,q),R||B||(R=!0,le(I))),q},r.unstable_shouldYield=G,r.unstable_wrapCallback=function(q){var J=w;return function(){var W=w;w=J;try{return q.apply(this,arguments)}finally{w=W}}}})(Bf)),Bf}var _p;function Sv(){return _p||(_p=1,Sf.exports=kv()),Sf.exports}/**
*/var yp;function kv(){return yp||(yp=1,(function(r){function a(q,J){var W=q.length;q.push(J);e:for(;0<W;){var S=W-1>>>1,V=q[S];if(0<f(V,J))q[S]=J,q[W]=V,W=S;else break e}}function o(q){return q.length===0?null:q[0]}function l(q){if(q.length===0)return null;var J=q[0],W=q.pop();if(W!==J){q[0]=W;e:for(var S=0,V=q.length,K=V>>>1;S<K;){var Y=2*(S+1)-1,he=q[Y],pe=Y+1,Ee=q[pe];if(0>f(he,W))pe<V&&0>f(Ee,he)?(q[S]=Ee,q[pe]=W,S=pe):(q[S]=he,q[Y]=W,S=Y);else if(pe<V&&0>f(Ee,W))q[S]=Ee,q[pe]=W,S=pe;else break e}}return J}function f(q,J){var W=q.sortIndex-J.sortIndex;return W!==0?W:q.id-J.id}if(typeof performance=="object"&&typeof performance.now=="function"){var d=performance;r.unstable_now=function(){return d.now()}}else{var m=Date,h=m.now();r.unstable_now=function(){return m.now()-h}}var x=[],p=[],v=1,y=null,w=3,P=!1,D=!1,C=!1,E=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,B=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function k(q){for(var J=o(p);J!==null;){if(J.callback===null)l(p);else if(J.startTime<=q)l(p),J.sortIndex=J.expirationTime,a(x,J);else break;J=o(p)}}function N(q){if(C=!1,k(q),!D)if(o(x)!==null)D=!0,le(I);else{var J=o(p);J!==null&&fe(N,J.startTime-q)}}function I(q,J){D=!1,C&&(C=!1,T(H),H=-1),P=!0;var W=w;try{for(k(J),y=o(x);y!==null&&(!(y.expirationTime>J)||q&&!G());){var S=y.callback;if(typeof S=="function"){y.callback=null,w=y.priorityLevel;var V=S(y.expirationTime<=J);J=r.unstable_now(),typeof V=="function"?y.callback=V:y===o(x)&&l(x),k(J)}else l(x);y=o(x)}if(y!==null)var K=!0;else{var Y=o(p);Y!==null&&fe(N,Y.startTime-J),K=!1}return K}finally{y=null,w=W,P=!1}}var z=!1,j=null,H=-1,$=5,U=-1;function G(){return!(r.unstable_now()-U<$)}function ne(){if(j!==null){var q=r.unstable_now();U=q;var J=!0;try{J=j(!0,q)}finally{J?ee():(z=!1,j=null)}}else z=!1}var ee;if(typeof B=="function")ee=function(){B(ne)};else if(typeof MessageChannel<"u"){var oe=new MessageChannel,de=oe.port2;oe.port1.onmessage=ne,ee=function(){de.postMessage(null)}}else ee=function(){E(ne,0)};function le(q){j=q,z||(z=!0,ee())}function fe(q,J){H=E(function(){q(r.unstable_now())},J)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(q){q.callback=null},r.unstable_continueExecution=function(){D||P||(D=!0,le(I))},r.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):$=0<q?Math.floor(1e3/q):5},r.unstable_getCurrentPriorityLevel=function(){return w},r.unstable_getFirstCallbackNode=function(){return o(x)},r.unstable_next=function(q){switch(w){case 1:case 2:case 3:var J=3;break;default:J=w}var W=w;w=J;try{return q()}finally{w=W}},r.unstable_pauseExecution=function(){},r.unstable_requestPaint=function(){},r.unstable_runWithPriority=function(q,J){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var W=w;w=q;try{return J()}finally{w=W}},r.unstable_scheduleCallback=function(q,J,W){var S=r.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?S+W:S):W=S,q){case 1:var V=-1;break;case 2:V=250;break;case 5:V=1073741823;break;case 4:V=1e4;break;default:V=5e3}return V=W+V,q={id:v++,callback:J,priorityLevel:q,startTime:W,expirationTime:V,sortIndex:-1},W>S?(q.sortIndex=W,a(p,q),o(x)===null&&q===o(p)&&(C?(T(H),H=-1):C=!0,fe(N,W-S))):(q.sortIndex=V,a(x,q),D||P||(D=!0,le(I))),q},r.unstable_shouldYield=G,r.unstable_wrapCallback=function(q){var J=w;return function(){var W=w;w=J;try{return q.apply(this,arguments)}finally{w=W}}}})(Bf)),Bf}var _p;function Sv(){return _p||(_p=1,Sf.exports=kv()),Sf.exports}/**
* @license React
* react-dom.production.min.js
*
@@ -30,19 +30,19 @@ var yv=Object.defineProperty;var _v=(r,a,o)=>a in r?yv(r,a,{enumerable:!0,config
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var wp;function Bv(){if(wp)return Hn;wp=1;var r=a0(),a=Sv();function o(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,s=1;s<arguments.length;s++)n+="&args[]="+encodeURIComponent(arguments[s]);return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var l=new Set,f={};function d(e,n){m(e,n),m(e+"Capture",n)}function m(e,n){for(f[e]=n,e=0;e<n.length;e++)l.add(n[e])}var h=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),x=Object.prototype.hasOwnProperty,p=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,y={},v={};function w(e){return x.call(v,e)?!0:x.call(y,e)?!1:p.test(e)?v[e]=!0:(y[e]=!0,!1)}function B(e,n,s,c){if(s!==null&&s.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return c?!1:s!==null?!s.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function R(e,n,s,c){if(n===null||typeof n>"u"||B(e,n,s,c))return!0;if(c)return!1;if(s!==null)switch(s.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function C(e,n,s,c,g,_,M){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=c,this.attributeNamespace=g,this.mustUseProperty=s,this.propertyName=e,this.type=n,this.sanitizeURL=_,this.removeEmptyString=M}var E={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){E[e]=new C(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];E[n]=new C(n,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){E[e]=new C(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){E[e]=new C(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){E[e]=new C(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){E[e]=new C(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){E[e]=new C(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){E[e]=new C(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){E[e]=new C(e,5,!1,e.toLowerCase(),null,!1,!1)});var T=/[\-:]([a-z])/g;function P(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var n=e.replace(T,P);E[n]=new C(n,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var n=e.replace(T,P);E[n]=new C(n,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var n=e.replace(T,P);E[n]=new C(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){E[e]=new C(e,1,!1,e.toLowerCase(),null,!1,!1)}),E.xlinkHref=new C("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){E[e]=new C(e,1,!1,e.toLowerCase(),null,!0,!0)});function k(e,n,s,c){var g=E.hasOwnProperty(n)?E[n]:null;(g!==null?g.type!==0:c||!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!= Line truncated
*/var wp;function Bv(){if(wp)return Hn;wp=1;var r=a0(),a=Sv();function o(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,s=1;s<arguments.length;s++)n+="&args[]="+encodeURIComponent(arguments[s]);return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var l=new Set,f={};function d(e,n){m(e,n),m(e+"Capture",n)}function m(e,n){for(f[e]=n,e=0;e<n.length;e++)l.add(n[e])}var h=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),x=Object.prototype.hasOwnProperty,p=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,v={},y={};function w(e){return x.call(y,e)?!0:x.call(v,e)?!1:p.test(e)?y[e]=!0:(v[e]=!0,!1)}function P(e,n,s,c){if(s!==null&&s.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return c?!1:s!==null?!s.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function D(e,n,s,c){if(n===null||typeof n>"u"||P(e,n,s,c))return!0;if(c)return!1;if(s!==null)switch(s.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function C(e,n,s,c,g,_,M){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=c,this.attributeNamespace=g,this.mustUseProperty=s,this.propertyName=e,this.type=n,this.sanitizeURL=_,this.removeEmptyString=M}var E={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){E[e]=new C(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];E[n]=new C(n,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){E[e]=new C(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){E[e]=new C(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){E[e]=new C(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){E[e]=new C(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){E[e]=new C(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){E[e]=new C(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){E[e]=new C(e,5,!1,e.toLowerCase(),null,!1,!1)});var T=/[\-:]([a-z])/g;function B(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var n=e.replace(T,B);E[n]=new C(n,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var n=e.replace(T,B);E[n]=new C(n,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var n=e.replace(T,B);E[n]=new C(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){E[e]=new C(e,1,!1,e.toLowerCase(),null,!1,!1)}),E.xlinkHref=new C("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){E[e]=new C(e,1,!1,e.toLowerCase(),null,!0,!0)});function k(e,n,s,c){var g=E.hasOwnProperty(n)?E[n]:null;(g!==null?g.type!==0:c||!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!= Line truncated
`+S+e}var K=!1;function Y(e,n){if(!e||K)return"";K=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(n)if(n=function(){throw Error()},Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(n,[])}catch(ce){var c=ce}Reflect.construct(e,[],n)}else{try{n.call()}catch(ce){c=ce}e.call(n.prototype)}else{try{throw Error()}catch(ce){c=ce}e()}}catch(ce){if(ce&&c&&typeof ce.stack=="string"){for(var g=ce.stack.split(`
`),_=c.stack.split(`
`),M=g.length-1,Z=_.length-1;1<=M&&0<=Z&&g[M]!==_[Z];)Z--;for(;1<=M&&0<=Z;M--,Z--)if(g[M]!==_[Z]){if(M!==1||Z!==1)do if(M--,Z--,0>Z||g[M]!==_[Z]){var X=`
`+g[M].replace(" at new "," at ");return e.displayName&&X.includes("<anonymous>")&&(X=X.replace("<anonymous>",e.displayName)),X}while(1<=M&&0<=Z);break}}}finally{K=!1,Error.prepareStackTrace=s}return(e=e?e.displayName||e.name:"")?V(e):""}function he(e){switch(e.tag){case 5:return V(e.type);case 16:return V("Lazy");case 13:return V("Suspense");case 19:return V("SuspenseList");case 0:case 2:case 15:return e=Y(e.type,!1),e;case 11:return e=Y(e.type.render,!1),e;case 1:return e=Y(e.type,!0),e;default:return""}}function pe(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case j:return"Fragment";case z:return"Portal";case $:return"Profiler";case H:return"StrictMode";case ee:return"Suspense";case oe:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case G:return(e.displayName||"Context")+".Consumer";case U:return(e._context.displayName||"Context")+".Provider";case ne:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case de:return n=e.displayName||null,n!==null?n:pe(e.type)||"Memo";case le:n=e._payload,e=e._init;try{return pe(e(n))}catch{}}return null}function Ee(e){var n=e.type;switch(e.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=n.render,e=e.displayName||e.name||"",n.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return pe(n);case 8:return n===H?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n}return null}function ge(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function We(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Ye(e){var n=We(e)?"checked":"value",s=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),c=""+e[n];if(!e.hasOwnProperty(n)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var g=s.get,_=s.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return g.call(this)},set:function(M){c=""+M,_.call(this,M)}}),Object.defineProperty(e,n,{enumerable:s.enumerable}),{getValue:function(){return c},setValue:function(M){c=""+M},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function kt(e){e._valueTracker||(e._valueTracker=Ye(e))}function pt(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var s=n.getValue(),c="";return e&&(c=We(e)?e.checked?"true":"false":e.value),e=c,e!==s?(n.setValue(e),!0):!1}function Se(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ve(e,n){var s=n.checked;return W({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:s??e._wrapperState.initialChecked})}function st(e,n){var s=n.defaultValue==null?"":n.defaultValue,c=n.checked!=null?n.checked:n.defaultChecked;s=ge(n.value!=null?n.value:s),e._wrapperState={initialChecked:c,initialValue:s,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function Dt(e,n){n=n.checked,n!=null&&k(e,"checked",n,!1)}function yt(e,n){Dt(e,n);var s=ge(n.value),c=n.type;if(s!=null)c==="number"?(s===0&&e.value===""||e.value!=s)&&(e.value=""+s):e.value!==""+s&&(e.value=""+s);else if(c==="submit"||c==="reset"){e.removeAttribute("value");return}n.hasOwnProperty("value")?Xe(e,n.type,s):n.hasOwnProperty("defaultValue")&&Xe(e,n.type,ge(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function vt(e,n,s){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var c=n.type;if(!(c!=="submit"&&c!=="reset"||n.value!==void 0&&n.value!==null))return;n=""+e._wrapperState.initialValue,s||n===e.value||(e.value=n),e.defaultValue=n}s=e.name,s!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,s!==""&&(e.name=s)}function Xe(e,n,s){(n!=="number"||Se(e.ownerDocument)!==e)&&(s==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+s&&(e.defaultValue=""+s))}var Ke=Array.isArray;function Je(e,n,s,c){if(e=e.options,n){n={};for(var g=0;g<s.length;g++)n["$"+s[g]]=!0;for(s=0;s<e.length;s++)g=n.hasOwnProperty("$"+e[s].value),e[s].selected!==g&&(e[s].selected=g),g&&c&&(e[s].defaultSelected=!0)}else{for(s=""+ge(s),n=null,g=0;g<e.length;g++){if(e[g].value===s){e[g].selected=!0,c&&(e[g].defaultSelected=!0);return}n!==null||e[g].disabled||(n=e[g])}n!==null&&(n.selected=!0)}}function Oe(e,n){if(n.dangerouslySetInnerHT Line truncated
`).replace(Q,"")}function ue(e,n,s){if(n=re(n),re(e)!==n&&s)throw Error(o(425))}function xe(){}var Be=null,He=null;function tt(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var nn=typeof setTimeout=="function"?setTimeout:void 0,Xt=typeof clearTimeout=="function"?clearTimeout:void 0,Tn=typeof Promise=="function"?Promise:void 0,_n=typeof queueMicrotask=="function"?queueMicrotask:typeof Tn<"u"?function(e){return Tn.resolve(null).then(e).catch(Vi)}:nn;function Vi(e){setTimeout(function(){throw e})}function wa(e,n){var s=n,c=0;do{var g=s.nextSibling;if(e.removeChild(s),g&&g.nodeType===8)if(s=g.data,s==="/$"){if(c===0){e.removeChild(g),Kn(n);return}c--}else s!=="$"&&s!=="$?"&&s!=="$!"||c++;s=g}while(s);Kn(n)}function Vr(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?")break;if(n==="/$")return null}}return e}function Ol(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"){if(n===0)return e;n--}else s==="/$"&&n++}e=e.previousSibling}return null}var si=Math.random().toString(36).slice(2),cr="__reactFiber$"+si,Ui="__reactProps$"+si,wt="__reactContainer$"+si,Zi="__reactEvents$"+si,gd="__reactListeners$"+si,xd="__reactHandles$"+si;function ai(e){var n=e[cr];if(n)return n;for(var s=e.parentNode;s;){if(n=s[wt]||s[cr]){if(s=n.alternate,n.child!==null||s!==null&&s.child!==null)for(e=Ol(e);e!==null;){if(s=e[cr])return s;e=Ol(e)}return n}e=s,s=e.parentNode}return null}function li(e){return e=e[cr]||e[wt],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function ui(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(o(33))}function xs(e){return e[Ui]||null}var vd=[],vs=-1;function Wi(e){return{current:e}}function Ft(e){0>vs||(e.current=vd[vs],vd[vs]=null,vs--)}function Tt(e,n){vs++,vd[vs]=e.current,e.current=n}var qi={},wn=Wi(qi),Mn=Wi(!1),bo=qi;function ys(e,n){var s=e.type.contextTypes;if(!s)return qi;var c=e.stateNode;if(c&&c.__reactInternalMemoizedUnmaskedChildContext===n)return c.__reactInternalMemoizedMaskedChildContext;var g={},_;for(_ in s)g[_]=n[_];return c&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=g),g}function In(e){return e=e.childContextTypes,e!=null}function zl(){Ft(Mn),Ft(wn)}function O0(e,n,s){if(wn.current!==qi)throw Error(o(168));Tt(wn,n),Tt(Mn,s)}function z0(e,n,s){var c=e.stateNode;if(n=n.childContextTypes,typeof c.getChildContext!="function")return s;c=c.getChildContext();for(var g in c)if(!(g in n))throw Error(o(108,Ee(e)||"Unknown",g));return W({},s,c)}function jl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||qi,bo=wn.current,Tt(wn,e),Tt(Mn,Mn.current),!0}function j0(e,n,s){var c=e.stateNode;if(!c)throw Error(o(169));s?(e=z0(e,n,bo),c.__reactInternalMemoizedMergedChildContext=e,Ft(Mn),Ft(wn),Tt(wn,e)):Ft(Mn),Tt(Mn,s)}var ci=null,Hl=!1,yd=!1;function H0(e){ci===null?ci=[e]:ci.push(e)}function zx(e){Hl=!0,H0(e)}function Gi(){if(!yd&&ci!==null){yd=!0;var e=0,n=ht;try{var s=ci;for(ht=1;e<s.length;e++){var c=s[e];do c=c(!0);while(c!==null)}ci=null,Hl=!1}catch(g){throw ci!==null&&(ci=ci.slice(e+1)),pl(Ys,Gi),g}finally{ht=n,yd=!1}}return null}var _s=[],ws=0,Vl=null,Ul=0,dr=[],fr=0,Co=null,di=1,fi="";function Eo(e,n){_s[ws++]=Ul,_s[ws++]=Vl,Vl=e,Ul=n}function V0(e,n,s){dr[fr++]=di,dr[fr++]=fi,dr[fr++]=Co,Co=e;var c=di;e=fi;var g=32-et(c)-1;c&=~(1<<g),s+=1;var _=32-et(n)+g;if(30<_){var M=g-g%5;_=(c&(1<<M)-1).toString(32),c>>=M,g-=M,di=1<<32-et(n)+g|s<<g|c,fi=_+e}else di=1<<_|s<<g|c,fi=e}function _d(e){e.return!==null&&(Eo(e,1),V0(e,1,0))}function wd(e){for(;e===Vl;)Vl=_s[--ws],_s[ws]=null,Ul=_s[--ws],_s[ws]=null;for(;e===Co;)Co=dr[--fr],dr[fr]=null,fi=dr[--fr],dr[fr]=null,di=dr[--fr],dr[fr]=null}var er=null,tr=null,Mt=!1,Er=null;function U0(e,n){var s=Ar(5,null,null,0);s.elementType="DELETED",s.stateNode=n,s.return=e,n=e.deletions,n===null?(e.deletions=[s],e.flags|=16):n.push(s)}function Z0(e,n){switch(e.tag){case 5:var s=e.type;return n=n.nodeType!==1||s.toLowerCase()!==n.nodeName.toLowerCase()?null:n,n!==null?(e.stateNode=n,er=e,tr=Vr(n.firstChild),!0):!1;case 6:return n=e.pendingProps===""||n.nodeType!==3?null:n,n!==null?(e.stateNode=n,er=e,tr=null,!0):!1;case 13:return n=n.nodeType!==8?null:n,n!==null?(s=Co!==null?{id:di,overflow:fi}:null,e.memoizedState={dehydrated:n,treeContext:s,retryLane:1073741824},s=Ar(18,null,null,0),s.stateNode=n,s.return=e,e.child=s,er=e,tr=null,!0):!1;default:return!1}}function bd(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Cd(e){if(Mt){var n=tr;if(n){var s=n;if(!Z0(e,n)){if(bd(e))throw Error(o(418));n=Vr(s.nextSibling);var c=er;n&&Z0(e,n)?U0(c,s):(e.flags=e.flags&-4097|2,Mt=!1,er=e)}}else{if(bd(e))throw Error(o(418));e.flags=e.flags&-4097|2,Mt=!1,er=e}}}function W0(e){for(e=e.r Line truncated
`+g[M].replace(" at new "," at ");return e.displayName&&X.includes("<anonymous>")&&(X=X.replace("<anonymous>",e.displayName)),X}while(1<=M&&0<=Z);break}}}finally{K=!1,Error.prepareStackTrace=s}return(e=e?e.displayName||e.name:"")?V(e):""}function he(e){switch(e.tag){case 5:return V(e.type);case 16:return V("Lazy");case 13:return V("Suspense");case 19:return V("SuspenseList");case 0:case 2:case 15:return e=Y(e.type,!1),e;case 11:return e=Y(e.type.render,!1),e;case 1:return e=Y(e.type,!0),e;default:return""}}function pe(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case j:return"Fragment";case z:return"Portal";case $:return"Profiler";case H:return"StrictMode";case ee:return"Suspense";case oe:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case G:return(e.displayName||"Context")+".Consumer";case U:return(e._context.displayName||"Context")+".Provider";case ne:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case de:return n=e.displayName||null,n!==null?n:pe(e.type)||"Memo";case le:n=e._payload,e=e._init;try{return pe(e(n))}catch{}}return null}function Ee(e){var n=e.type;switch(e.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=n.render,e=e.displayName||e.name||"",n.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return pe(n);case 8:return n===H?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n}return null}function ge(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function We(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Ye(e){var n=We(e)?"checked":"value",s=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),c=""+e[n];if(!e.hasOwnProperty(n)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var g=s.get,_=s.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return g.call(this)},set:function(M){c=""+M,_.call(this,M)}}),Object.defineProperty(e,n,{enumerable:s.enumerable}),{getValue:function(){return c},setValue:function(M){c=""+M},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function kt(e){e._valueTracker||(e._valueTracker=Ye(e))}function pt(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var s=n.getValue(),c="";return e&&(c=We(e)?e.checked?"true":"false":e.value),e=c,e!==s?(n.setValue(e),!0):!1}function Se(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ve(e,n){var s=n.checked;return W({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:s??e._wrapperState.initialChecked})}function st(e,n){var s=n.defaultValue==null?"":n.defaultValue,c=n.checked!=null?n.checked:n.defaultChecked;s=ge(n.value!=null?n.value:s),e._wrapperState={initialChecked:c,initialValue:s,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function Dt(e,n){n=n.checked,n!=null&&k(e,"checked",n,!1)}function yt(e,n){Dt(e,n);var s=ge(n.value),c=n.type;if(s!=null)c==="number"?(s===0&&e.value===""||e.value!=s)&&(e.value=""+s):e.value!==""+s&&(e.value=""+s);else if(c==="submit"||c==="reset"){e.removeAttribute("value");return}n.hasOwnProperty("value")?Xe(e,n.type,s):n.hasOwnProperty("defaultValue")&&Xe(e,n.type,ge(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function vt(e,n,s){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var c=n.type;if(!(c!=="submit"&&c!=="reset"||n.value!==void 0&&n.value!==null))return;n=""+e._wrapperState.initialValue,s||n===e.value||(e.value=n),e.defaultValue=n}s=e.name,s!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,s!==""&&(e.name=s)}function Xe(e,n,s){(n!=="number"||Se(e.ownerDocument)!==e)&&(s==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+s&&(e.defaultValue=""+s))}var Ke=Array.isArray;function Je(e,n,s,c){if(e=e.options,n){n={};for(var g=0;g<s.length;g++)n["$"+s[g]]=!0;for(s=0;s<e.length;s++)g=n.hasOwnProperty("$"+e[s].value),e[s].selected!==g&&(e[s].selected=g),g&&c&&(e[s].defaultSelected=!0)}else{for(s=""+ge(s),n=null,g=0;g<e.length;g++){if(e[g].value===s){e[g].selected=!0,c&&(e[g].defaultSelected=!0);return}n!==null||e[g].disabled||(n=e[g])}n!==null&&(n.selected=!0)}}function Oe(e,n){if(n.dangerouslySetInnerHT Line truncated
`).replace(Q,"")}function ue(e,n,s){if(n=re(n),re(e)!==n&&s)throw Error(o(425))}function xe(){}var Be=null,He=null;function tt(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var nn=typeof setTimeout=="function"?setTimeout:void 0,Xt=typeof clearTimeout=="function"?clearTimeout:void 0,Tn=typeof Promise=="function"?Promise:void 0,_n=typeof queueMicrotask=="function"?queueMicrotask:typeof Tn<"u"?function(e){return Tn.resolve(null).then(e).catch(Vi)}:nn;function Vi(e){setTimeout(function(){throw e})}function wa(e,n){var s=n,c=0;do{var g=s.nextSibling;if(e.removeChild(s),g&&g.nodeType===8)if(s=g.data,s==="/$"){if(c===0){e.removeChild(g),Kn(n);return}c--}else s!=="$"&&s!=="$?"&&s!=="$!"||c++;s=g}while(s);Kn(n)}function Vr(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?")break;if(n==="/$")return null}}return e}function Ol(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"){if(n===0)return e;n--}else s==="/$"&&n++}e=e.previousSibling}return null}var si=Math.random().toString(36).slice(2),cr="__reactFiber$"+si,Ui="__reactProps$"+si,wt="__reactContainer$"+si,Zi="__reactEvents$"+si,gd="__reactListeners$"+si,xd="__reactHandles$"+si;function ai(e){var n=e[cr];if(n)return n;for(var s=e.parentNode;s;){if(n=s[wt]||s[cr]){if(s=n.alternate,n.child!==null||s!==null&&s.child!==null)for(e=Ol(e);e!==null;){if(s=e[cr])return s;e=Ol(e)}return n}e=s,s=e.parentNode}return null}function li(e){return e=e[cr]||e[wt],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function ui(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(o(33))}function xs(e){return e[Ui]||null}var vd=[],vs=-1;function Wi(e){return{current:e}}function Ft(e){0>vs||(e.current=vd[vs],vd[vs]=null,vs--)}function Tt(e,n){vs++,vd[vs]=e.current,e.current=n}var qi={},wn=Wi(qi),Mn=Wi(!1),bo=qi;function ys(e,n){var s=e.type.contextTypes;if(!s)return qi;var c=e.stateNode;if(c&&c.__reactInternalMemoizedUnmaskedChildContext===n)return c.__reactInternalMemoizedMaskedChildContext;var g={},_;for(_ in s)g[_]=n[_];return c&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=g),g}function In(e){return e=e.childContextTypes,e!=null}function zl(){Ft(Mn),Ft(wn)}function O0(e,n,s){if(wn.current!==qi)throw Error(o(168));Tt(wn,n),Tt(Mn,s)}function z0(e,n,s){var c=e.stateNode;if(n=n.childContextTypes,typeof c.getChildContext!="function")return s;c=c.getChildContext();for(var g in c)if(!(g in n))throw Error(o(108,Ee(e)||"Unknown",g));return W({},s,c)}function jl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||qi,bo=wn.current,Tt(wn,e),Tt(Mn,Mn.current),!0}function j0(e,n,s){var c=e.stateNode;if(!c)throw Error(o(169));s?(e=z0(e,n,bo),c.__reactInternalMemoizedMergedChildContext=e,Ft(Mn),Ft(wn),Tt(wn,e)):Ft(Mn),Tt(Mn,s)}var ci=null,Hl=!1,yd=!1;function H0(e){ci===null?ci=[e]:ci.push(e)}function zx(e){Hl=!0,H0(e)}function Gi(){if(!yd&&ci!==null){yd=!0;var e=0,n=ht;try{var s=ci;for(ht=1;e<s.length;e++){var c=s[e];do c=c(!0);while(c!==null)}ci=null,Hl=!1}catch(g){throw ci!==null&&(ci=ci.slice(e+1)),pl(Ys,Gi),g}finally{ht=n,yd=!1}}return null}var _s=[],ws=0,Vl=null,Ul=0,dr=[],fr=0,Co=null,di=1,fi="";function Eo(e,n){_s[ws++]=Ul,_s[ws++]=Vl,Vl=e,Ul=n}function V0(e,n,s){dr[fr++]=di,dr[fr++]=fi,dr[fr++]=Co,Co=e;var c=di;e=fi;var g=32-et(c)-1;c&=~(1<<g),s+=1;var _=32-et(n)+g;if(30<_){var M=g-g%5;_=(c&(1<<M)-1).toString(32),c>>=M,g-=M,di=1<<32-et(n)+g|s<<g|c,fi=_+e}else di=1<<_|s<<g|c,fi=e}function _d(e){e.return!==null&&(Eo(e,1),V0(e,1,0))}function wd(e){for(;e===Vl;)Vl=_s[--ws],_s[ws]=null,Ul=_s[--ws],_s[ws]=null;for(;e===Co;)Co=dr[--fr],dr[fr]=null,fi=dr[--fr],dr[fr]=null,di=dr[--fr],dr[fr]=null}var er=null,tr=null,Mt=!1,Cr=null;function U0(e,n){var s=Ar(5,null,null,0);s.elementType="DELETED",s.stateNode=n,s.return=e,n=e.deletions,n===null?(e.deletions=[s],e.flags|=16):n.push(s)}function Z0(e,n){switch(e.tag){case 5:var s=e.type;return n=n.nodeType!==1||s.toLowerCase()!==n.nodeName.toLowerCase()?null:n,n!==null?(e.stateNode=n,er=e,tr=Vr(n.firstChild),!0):!1;case 6:return n=e.pendingProps===""||n.nodeType!==3?null:n,n!==null?(e.stateNode=n,er=e,tr=null,!0):!1;case 13:return n=n.nodeType!==8?null:n,n!==null?(s=Co!==null?{id:di,overflow:fi}:null,e.memoizedState={dehydrated:n,treeContext:s,retryLane:1073741824},s=Ar(18,null,null,0),s.stateNode=n,s.return=e,e.child=s,er=e,tr=null,!0):!1;default:return!1}}function bd(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Cd(e){if(Mt){var n=tr;if(n){var s=n;if(!Z0(e,n)){if(bd(e))throw Error(o(418));n=Vr(s.nextSibling);var c=er;n&&Z0(e,n)?U0(c,s):(e.flags=e.flags&-4097|2,Mt=!1,er=e)}}else{if(bd(e))throw Error(o(418));e.flags=e.flags&-4097|2,Mt=!1,er=e}}}function W0(e){for(e=e.r Line truncated
Error generating stack: `+_.message+`
`+_.stack}return{value:e,source:n,stack:g,digest:null}}function qd(e,n,s){return{value:e,source:null,stack:s??null,digest:n??null}}function Gd(e,n){try{console.error(n.value)}catch(s){setTimeout(function(){throw s})}}var Qx=typeof WeakMap=="function"?WeakMap:Map;function Eh(e,n,s){s=pi(-1,s),s.tag=3,s.payload={element:null};var c=n.value;return s.callback=function(){uu||(uu=!0,uf=c),Gd(e,n)},s}function kh(e,n,s){s=pi(-1,s),s.tag=3;var c=e.type.getDerivedStateFromError;if(typeof c=="function"){var g=n.value;s.payload=function(){return c(g)},s.callback=function(){Gd(e,n)}}var _=e.stateNode;return _!==null&&typeof _.componentDidCatch=="function"&&(s.callback=function(){Gd(e,n),typeof c!="function"&&(Yi===null?Yi=new Set([this]):Yi.add(this));var M=n.stack;this.componentDidCatch(n.value,{componentStack:M!==null?M:""})}),s}function Sh(e,n,s){var c=e.pingCache;if(c===null){c=e.pingCache=new Qx;var g=new Set;c.set(n,g)}else g=c.get(n),g===void 0&&(g=new Set,c.set(n,g));g.has(s)||(g.add(s),e=lv.bind(null,e,n,s),n.then(e,e))}function Bh(e){do{var n;if((n=e.tag===13)&&(n=e.memoizedState,n=n!==null?n.dehydrated!==null:!0),n)return e;e=e.return}while(e!==null);return null}function Ph(e,n,s,c,g){return(e.mode&1)===0?(e===n?e.flags|=65536:(e.flags|=128,s.flags|=131072,s.flags&=-52805,s.tag===1&&(s.alternate===null?s.tag=17:(n=pi(-1,1),n.tag=2,Ki(s,n,1))),s.lanes|=1),e):(e.flags|=65536,e.lanes=g,e)}var Kx=N.ReactCurrentOwner,On=!1;function Dn(e,n,s,c){n.child=e===null?K0(n,null,s,c):Cs(n,e.child,s,c)}function Th(e,n,s,c,g){s=s.render;var _=n.ref;return ks(n,g),c=Od(e,n,s,c,_,g),s=zd(),e!==null&&!On?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~g,mi(e,n,g)):(Mt&&s&&_d(n),n.flags|=1,Dn(e,n,c,g),n.child)}function Dh(e,n,s,c,g){if(e===null){var _=s.type;return typeof _=="function"&&!Af(_)&&_.defaultProps===void 0&&s.compare===null&&s.defaultProps===void 0?(n.tag=15,n.type=_,Rh(e,n,_,c,g)):(e=mu(s.type,null,c,n,n.mode,g),e.ref=n.ref,e.return=n,n.child=e)}if(_=e.child,(e.lanes&g)===0){var M=_.memoizedProps;if(s=s.compare,s=s!==null?s:zr,s(M,c)&&e.ref===n.ref)return mi(e,n,g)}return n.flags|=1,e=to(_,c),e.ref=n.ref,e.return=n,n.child=e}function Rh(e,n,s,c,g){if(e!==null){var _=e.memoizedProps;if(zr(_,c)&&e.ref===n.ref)if(On=!1,n.pendingProps=c=_,(e.lanes&g)!==0)(e.flags&131072)!==0&&(On=!0);else return n.lanes=e.lanes,mi(e,n,g)}return Qd(e,n,s,c,g)}function Fh(e,n,s){var c=n.pendingProps,g=c.children,_=e!==null?e.memoizedState:null;if(c.mode==="hidden")if((n.mode&1)===0)n.memoizedState={baseLanes:0,cachePool:null,transitions:null},Tt(Ts,nr),nr|=s;else{if((s&1073741824)===0)return e=_!==null?_.baseLanes|s:s,n.lanes=n.childLanes=1073741824,n.memoizedState={baseLanes:e,cachePool:null,transitions:null},n.updateQueue=null,Tt(Ts,nr),nr|=e,null;n.memoizedState={baseLanes:0,cachePool:null,transitions:null},c=_!==null?_.baseLanes:s,Tt(Ts,nr),nr|=c}else _!==null?(c=_.baseLanes|s,n.memoizedState=null):c=s,Tt(Ts,nr),nr|=c;return Dn(e,n,g,s),n.child}function Nh(e,n){var s=n.ref;(e===null&&s!==null||e!==null&&e.ref!==s)&&(n.flags|=512,n.flags|=2097152)}function Qd(e,n,s,c,g){var _=In(s)?bo:wn.current;return _=ys(n,_),ks(n,g),s=Od(e,n,s,c,_,g),c=zd(),e!==null&&!On?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~g,mi(e,n,g)):(Mt&&c&&_d(n),n.flags|=1,Dn(e,n,s,g),n.child)}function Lh(e,n,s,c,g){if(In(s)){var _=!0;jl(n)}else _=!1;if(ks(n,g),n.stateNode===null)iu(e,n),bh(n,s,c),Wd(n,s,c,g),c=!0;else if(e===null){var M=n.stateNode,Z=n.memoizedProps;M.props=Z;var X=M.context,ce=s.contextType;typeof ce=="object"&&ce!==null?ce=hr(ce):(ce=In(s)?bo:wn.current,ce=ys(n,ce));var ye=s.getDerivedStateFromProps,_e=typeof ye=="function"||typeof M.getSnapshotBeforeUpdate=="function";_e||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||(Z!==c||X!==ce)&&Ch(n,M,c,ce),Qi=!1;var ve=n.memoizedState;M.state=ve,Kl(n,c,M,g),X=n.memoizedState,Z!==c||ve!==X||Mn.current||Qi?(typeof ye=="function"&&(Zd(n,s,ye,c),X=n.memoizedState),(Z=Qi||wh(n,s,Z,c,ve,X,ce))?(_e||typeof M.UNSAFE_componentWillMount!="function"&&typeof M.componentWillMount!="function"||(typeof M.componentWillMount=="function"&&M.componentWillMount(),typeof M.UNSAFE_componentWillMount=="function"&&M.UNSAFE_componentWillMount()),typeof M.componentDidMount=="function"&&(n.flags|=4194308)):(typeof M.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=c,n.memoizedState=X),M.props=c,M.state=X,M.context=ce,c=Z):(typeof M.componentDidMount=="function"&&(n.flags|=4194308),c=!1)}else{M=n.stateNode,Y0(e,n),Z=n.memoizedProps,ce=n.type===n.elementType?Z:kr(n.type,Z),M.props=ce,_e=n.pendingProps,ve=M.context,X=s.contextType,typeof X=="object"&&X!==null?X=hr(X):(X=In(s)?bo:wn.current,X=ys(n,X));var Re=s.getDerivedStateFromProps;(ye=typeof Re=="function"||typeof M.getSnapshotBeforeUpdate=="function")||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||(Z!==_e||ve!==X)&&Ch(n,M,c,X),Qi=!1,ve=n.m Line truncated
`+_.stack}return{value:e,source:n,stack:g,digest:null}}function qd(e,n,s){return{value:e,source:null,stack:s??null,digest:n??null}}function Gd(e,n){try{console.error(n.value)}catch(s){setTimeout(function(){throw s})}}var Qx=typeof WeakMap=="function"?WeakMap:Map;function Eh(e,n,s){s=pi(-1,s),s.tag=3,s.payload={element:null};var c=n.value;return s.callback=function(){uu||(uu=!0,uf=c),Gd(e,n)},s}function kh(e,n,s){s=pi(-1,s),s.tag=3;var c=e.type.getDerivedStateFromError;if(typeof c=="function"){var g=n.value;s.payload=function(){return c(g)},s.callback=function(){Gd(e,n)}}var _=e.stateNode;return _!==null&&typeof _.componentDidCatch=="function"&&(s.callback=function(){Gd(e,n),typeof c!="function"&&(Yi===null?Yi=new Set([this]):Yi.add(this));var M=n.stack;this.componentDidCatch(n.value,{componentStack:M!==null?M:""})}),s}function Sh(e,n,s){var c=e.pingCache;if(c===null){c=e.pingCache=new Qx;var g=new Set;c.set(n,g)}else g=c.get(n),g===void 0&&(g=new Set,c.set(n,g));g.has(s)||(g.add(s),e=lv.bind(null,e,n,s),n.then(e,e))}function Bh(e){do{var n;if((n=e.tag===13)&&(n=e.memoizedState,n=n!==null?n.dehydrated!==null:!0),n)return e;e=e.return}while(e!==null);return null}function Ph(e,n,s,c,g){return(e.mode&1)===0?(e===n?e.flags|=65536:(e.flags|=128,s.flags|=131072,s.flags&=-52805,s.tag===1&&(s.alternate===null?s.tag=17:(n=pi(-1,1),n.tag=2,Ki(s,n,1))),s.lanes|=1),e):(e.flags|=65536,e.lanes=g,e)}var Kx=N.ReactCurrentOwner,On=!1;function Dn(e,n,s,c){n.child=e===null?K0(n,null,s,c):Cs(n,e.child,s,c)}function Th(e,n,s,c,g){s=s.render;var _=n.ref;return ks(n,g),c=Od(e,n,s,c,_,g),s=zd(),e!==null&&!On?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~g,mi(e,n,g)):(Mt&&s&&_d(n),n.flags|=1,Dn(e,n,c,g),n.child)}function Dh(e,n,s,c,g){if(e===null){var _=s.type;return typeof _=="function"&&!Af(_)&&_.defaultProps===void 0&&s.compare===null&&s.defaultProps===void 0?(n.tag=15,n.type=_,Rh(e,n,_,c,g)):(e=mu(s.type,null,c,n,n.mode,g),e.ref=n.ref,e.return=n,n.child=e)}if(_=e.child,(e.lanes&g)===0){var M=_.memoizedProps;if(s=s.compare,s=s!==null?s:zr,s(M,c)&&e.ref===n.ref)return mi(e,n,g)}return n.flags|=1,e=to(_,c),e.ref=n.ref,e.return=n,n.child=e}function Rh(e,n,s,c,g){if(e!==null){var _=e.memoizedProps;if(zr(_,c)&&e.ref===n.ref)if(On=!1,n.pendingProps=c=_,(e.lanes&g)!==0)(e.flags&131072)!==0&&(On=!0);else return n.lanes=e.lanes,mi(e,n,g)}return Qd(e,n,s,c,g)}function Fh(e,n,s){var c=n.pendingProps,g=c.children,_=e!==null?e.memoizedState:null;if(c.mode==="hidden")if((n.mode&1)===0)n.memoizedState={baseLanes:0,cachePool:null,transitions:null},Tt(Ts,nr),nr|=s;else{if((s&1073741824)===0)return e=_!==null?_.baseLanes|s:s,n.lanes=n.childLanes=1073741824,n.memoizedState={baseLanes:e,cachePool:null,transitions:null},n.updateQueue=null,Tt(Ts,nr),nr|=e,null;n.memoizedState={baseLanes:0,cachePool:null,transitions:null},c=_!==null?_.baseLanes:s,Tt(Ts,nr),nr|=c}else _!==null?(c=_.baseLanes|s,n.memoizedState=null):c=s,Tt(Ts,nr),nr|=c;return Dn(e,n,g,s),n.child}function Nh(e,n){var s=n.ref;(e===null&&s!==null||e!==null&&e.ref!==s)&&(n.flags|=512,n.flags|=2097152)}function Qd(e,n,s,c,g){var _=In(s)?bo:wn.current;return _=ys(n,_),ks(n,g),s=Od(e,n,s,c,_,g),c=zd(),e!==null&&!On?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~g,mi(e,n,g)):(Mt&&c&&_d(n),n.flags|=1,Dn(e,n,s,g),n.child)}function Lh(e,n,s,c,g){if(In(s)){var _=!0;jl(n)}else _=!1;if(ks(n,g),n.stateNode===null)iu(e,n),bh(n,s,c),Wd(n,s,c,g),c=!0;else if(e===null){var M=n.stateNode,Z=n.memoizedProps;M.props=Z;var X=M.context,ce=s.contextType;typeof ce=="object"&&ce!==null?ce=hr(ce):(ce=In(s)?bo:wn.current,ce=ys(n,ce));var ye=s.getDerivedStateFromProps,_e=typeof ye=="function"||typeof M.getSnapshotBeforeUpdate=="function";_e||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||(Z!==c||X!==ce)&&Ch(n,M,c,ce),Qi=!1;var ve=n.memoizedState;M.state=ve,Kl(n,c,M,g),X=n.memoizedState,Z!==c||ve!==X||Mn.current||Qi?(typeof ye=="function"&&(Zd(n,s,ye,c),X=n.memoizedState),(Z=Qi||wh(n,s,Z,c,ve,X,ce))?(_e||typeof M.UNSAFE_componentWillMount!="function"&&typeof M.componentWillMount!="function"||(typeof M.componentWillMount=="function"&&M.componentWillMount(),typeof M.UNSAFE_componentWillMount=="function"&&M.UNSAFE_componentWillMount()),typeof M.componentDidMount=="function"&&(n.flags|=4194308)):(typeof M.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=c,n.memoizedState=X),M.props=c,M.state=X,M.context=ce,c=Z):(typeof M.componentDidMount=="function"&&(n.flags|=4194308),c=!1)}else{M=n.stateNode,Y0(e,n),Z=n.memoizedProps,ce=n.type===n.elementType?Z:Er(n.type,Z),M.props=ce,_e=n.pendingProps,ve=M.context,X=s.contextType,typeof X=="object"&&X!==null?X=hr(X):(X=In(s)?bo:wn.current,X=ys(n,X));var Re=s.getDerivedStateFromProps;(ye=typeof Re=="function"||typeof M.getSnapshotBeforeUpdate=="function")||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||(Z!==_e||ve!==X)&&Ch(n,M,c,X),Qi=!1,ve=n.m Line truncated
`)}function Nv(r){if(r.length===0)return`Neighbors
No neighbors reported`;const a=[...r].sort((l,f)=>f.snr-l.snr),o=[`Neighbors (${a.length})`];for(const l of a){const f=l.name||l.pubkey_prefix,d=l.snr>=0?`+${l.snr.toFixed(1)}`:l.snr.toFixed(1);o.push(`${f}, ${d} dB [${Nu(l.last_heard_seconds)} ago]`)}return o.join(`
`)}function Lv(r){if(r.length===0)return`ACL
No ACL entries`;const a=[`ACL (${r.length})`];for(const o of r){const l=o.name||o.pubkey_prefix;a.push(`${l}: ${o.permission_name}`)}return a.join(`
`)}function Lo(r,a,o,l=0){const f=Math.floor(Date.now()/1e3);return{id:-Date.now()-l,type:"PRIV",conversation_key:r,text:a,sender_timestamp:f,received_at:f,path_len:null,txt_type:0,signature:null,outgoing:o,acked:1}}function Mv(r,a,o){const[l,f]=F.useState(!1);F.useEffect(()=>{f(!1)},[r==null?void 0:r.id]);const d=F.useMemo(()=>{if(!r||r.type!=="contact")return!1;const x=a.find(p=>p.public_key===r.id);return(x==null?void 0:x.type)===c0},[r,a]),m=F.useCallback(async x=>{if(!(!r||r.type!=="contact")&&d)try{const p=await lt.requestTelemetry(r.id,x),y=Lo(r.id,Fv(p),!1,0),v=Lo(r.id,Nv(p.neighbors),!1,1),w=Lo(r.id,Lv(p.acl),!1,2);o(B=>[...B,y,v,w]),f(!0)}catch(p){const y=Lo(r.id,`Telemetry request failed: ${p instanceof Error?p.message:"Unknown error"}`,!1,0);o(v=>[...v,y])}},[r,d,o]),h=F.useCallback(async x=>{if(!r||r.type!=="contact"||!d||!l)return;const p=Lo(r.id,`> ${x}`,!0,0);o(y=>[...y,p]);try{const y=await lt.sendRepeaterCommand(r.id,x),v=Lo(r.id,y.response,!1,1);y.sender_timestamp&&(v.sender_timestamp=y.sender_timestamp),o(w=>[...w,v])}catch(y){const v=Lo(r.id,`Command failed: ${y instanceof Error?y.message:"Unknown error"}`,!1,1);o(w=>[...w,v])}},[r,d,l,o]);return{repeaterLoggedIn:l,activeContactIsRepeater:d,handleTelemetryRequest:m,handleRepeaterCommand:h}}const Iv=12;function Hs(r){return r.slice(0,Iv)}function EA(r,a){return!r||!a?!1:Hs(r)===Hs(a)}function _i(r,a){return r||Hs(a)}const Wf="remoteterm-lastMessageTime";function kA(r){try{const a=localStorage.getItem(r);return a?JSON.parse(a):{}}catch{return{}}}function Ov(r,a){try{localStorage.setItem(r,JSON.stringify(a))}catch{}}function Ep(){return kA(Wf)}function Pf(r,a){const o=kA(Wf);return(!o[r]||a>o[r])&&(o[r]=a,Ov(Wf,o)),o}function Dr(r,a){return r==="channel"?`channel-${a}`:`contact-${Hs(a)}`}function kp(r,a){if(!a)return!1;const o=a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`@\\[${o}\\]`,"i").test(r)}function zv(r,a,o,l=null){const[f,d]=F.useState({}),[m,h]=F.useState({}),[x,p]=F.useState(Ep),y=F.useRef(l);F.useEffect(()=>{y.current=l},[l]);const v=F.useRef(new Set),w=F.useRef(new Set);F.useEffect(()=>{const T=r.filter(N=>!v.current.has(N.key)),P=a.filter(N=>N.public_key&&!w.current.has(N.public_key));if(T.length===0&&P.length===0)return;T.forEach(N=>v.current.add(N.key)),P.forEach(N=>w.current.add(N.public_key)),(async()=>{const N=[...T.map(I=>({type:"CHAN",conversation_key:I.key})),...P.map(I=>({type:"PRIV",conversation_key:I.public_key}))];if(N.length!==0)try{const I=await lt.getMessagesBulk(N,u0),z={},j={},H={};for(const $ of T){const U=I[`CHAN:${$.key}`]||[];if(U.length>0){const G=Dr("channel",$.key),ne=$.last_read_at||0,ee=U.filter(de=>!de.outgoing&&de.received_at>ne);ee.length>0&&(z[G]=ee.length,ee.some(de=>kp(de.text,y.current))&&(j[G]=!0));const oe=Math.max(...U.map(de=>de.received_at));H[G]=oe,Pf(G,oe)}}for(const $ of P){const U=I[`PRIV:${$.public_key}`]||[];if(U.length>0){const G=Dr("contact",$.public_key),ne=$.last_read_at||0,ee=U.filter(de=>!de.outgoing&&de.received_at>ne);ee.length>0&&(z[G]=ee.length,ee.some(de=>kp(de.text,y.current))&&(j[G]=!0));const oe=Math.max(...U.map(de=>de.received_at));H[G]=oe,Pf(G,oe)}}Object.keys(z).length>0&&d($=>({...$,...z})),Object.keys(j).length>0&&h($=>({...$,...j})),p(Ep())}catch(I){console.error("Failed to fetch messages bulk:",I)}})()},[r,a]),F.useEffect(()=>{if(o&&o.type!=="raw"&&o.type!=="map"){const T=Dr(o.type,o.id);d(P=>{if(P[T]){const k={...P};return delete k[T],k}return P}),h(P=>{if(P[T]){const k={...P};return delete k[T],k}return P}),o.type==="channel"?lt.markChannelRead(o.id).catch(P=>{console.error("Failed to mark channel as read on server:",P)}):o.type==="contact"&&lt.markContactRead(o.id).catch(P=>{console.error("Failed to mark contact as read on server:",P)})}},[o]);const B=F.useCallback((T,P)=>{d(k=>({...k,[T]:(k[T]||0)+1})),P&&h(k=>({...k,[T]:!0}))},[]),R=F.useCallback(()=>{d({}),h({}),lt.markAllRead().catch(T=>{console.error("Failed to mark all as read on server:",T)})},[]),C=F.useCallback(T=>{if(T.type==="raw"||T.type==="map")return;const P=Dr(T.type,T.id);d(k=>{if(k[P]){const N={...k};return delete N[P],N}return k}),h(k=>{if(k[P]){const N={...k};return delete N[P],N}return k}),T.type==="channel"?lt.markChannelRead(T.id).catch(k=>{console.error("Failed to mark channel as read on server:",k)}):T.type==="contact"&&lt.markContactRead(T.id).catch(k=>{console.error("Failed to mark contact as read on server:",k)})},[]),E=F.useCallback(T=>{let P=null;if(T.type==="CHAN"&&T.conversation_key?P=Dr("channel",T.conversation_key):T.type==="PRIV"&&T.conversation_key&&(P=Dr("contact",T.conversation_key)),P){const k=T.received_at||Math.floor(Date.now()/1e3),N=Pf(P,k);p(N)}},[]);return{unreadCounts:f,mentions:m,lastMessageTimes:x,incrementUnread:B,markAllRead:R,markConversationRead:C,trackNewMessage:E}}var d0=CA();const SA=Zs(d0);function jv(r){if(typeof document>"u")return;let a=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text Line truncated
`)}function Lo(r,a,o,l=0){const f=Math.floor(Date.now()/1e3);return{id:-Date.now()-l,type:"PRIV",conversation_key:r,text:a,sender_timestamp:f,received_at:f,path_len:null,txt_type:0,signature:null,outgoing:o,acked:1}}function Mv(r,a,o){const[l,f]=F.useState(!1);F.useEffect(()=>{f(!1)},[r==null?void 0:r.id]);const d=F.useMemo(()=>{if(!r||r.type!=="contact")return!1;const x=a.find(p=>p.public_key===r.id);return(x==null?void 0:x.type)===c0},[r,a]),m=F.useCallback(async x=>{if(!(!r||r.type!=="contact")&&d)try{const p=await dt.requestTelemetry(r.id,x),v=Lo(r.id,Fv(p),!1,0),y=Lo(r.id,Nv(p.neighbors),!1,1),w=Lo(r.id,Lv(p.acl),!1,2);o(P=>[...P,v,y,w]),f(!0)}catch(p){const v=Lo(r.id,`Telemetry request failed: ${p instanceof Error?p.message:"Unknown error"}`,!1,0);o(y=>[...y,v])}},[r,d,o]),h=F.useCallback(async x=>{if(!r||r.type!=="contact"||!d||!l)return;const p=Lo(r.id,`> ${x}`,!0,0);o(v=>[...v,p]);try{const v=await dt.sendRepeaterCommand(r.id,x),y=Lo(r.id,v.response,!1,1);v.sender_timestamp&&(y.sender_timestamp=v.sender_timestamp),o(w=>[...w,y])}catch(v){const y=Lo(r.id,`Command failed: ${v instanceof Error?v.message:"Unknown error"}`,!1,1);o(w=>[...w,y])}},[r,d,l,o]);return{repeaterLoggedIn:l,activeContactIsRepeater:d,handleTelemetryRequest:m,handleRepeaterCommand:h}}const Iv=12;function Hs(r){return r.slice(0,Iv)}function EA(r,a){return!r||!a?!1:Hs(r)===Hs(a)}function _i(r,a){return r||Hs(a)}const Wf="remoteterm-lastMessageTime";function kA(r){try{const a=localStorage.getItem(r);return a?JSON.parse(a):{}}catch{return{}}}function Ov(r,a){try{localStorage.setItem(r,JSON.stringify(a))}catch{}}function Ep(){return kA(Wf)}function Pf(r,a){const o=kA(Wf);return(!o[r]||a>o[r])&&(o[r]=a,Ov(Wf,o)),o}function Tr(r,a){return r==="channel"?`channel-${a}`:`contact-${Hs(a)}`}function kp(r,a){if(!a)return!1;const o=a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`@\\[${o}\\]`,"i").test(r)}function zv(r,a,o,l=null){const[f,d]=F.useState({}),[m,h]=F.useState({}),[x,p]=F.useState(Ep),v=F.useRef(l);F.useEffect(()=>{v.current=l},[l]);const y=F.useRef(new Set),w=F.useRef(new Set);F.useEffect(()=>{const T=r.filter(N=>!y.current.has(N.key)),B=a.filter(N=>N.public_key&&!w.current.has(N.public_key));if(T.length===0&&B.length===0)return;T.forEach(N=>y.current.add(N.key)),B.forEach(N=>w.current.add(N.public_key)),(async()=>{const N=[...T.map(I=>({type:"CHAN",conversation_key:I.key})),...B.map(I=>({type:"PRIV",conversation_key:I.public_key}))];if(N.length!==0)try{const I=await dt.getMessagesBulk(N,u0),z={},j={},H={};for(const $ of T){const U=I[`CHAN:${$.key}`]||[];if(U.length>0){const G=Tr("channel",$.key),ne=$.last_read_at||0,ee=U.filter(de=>!de.outgoing&&de.received_at>ne);ee.length>0&&(z[G]=ee.length,ee.some(de=>kp(de.text,v.current))&&(j[G]=!0));const oe=Math.max(...U.map(de=>de.received_at));H[G]=oe,Pf(G,oe)}}for(const $ of B){const U=I[`PRIV:${$.public_key}`]||[];if(U.length>0){const G=Tr("contact",$.public_key),ne=$.last_read_at||0,ee=U.filter(de=>!de.outgoing&&de.received_at>ne);ee.length>0&&(z[G]=ee.length,ee.some(de=>kp(de.text,v.current))&&(j[G]=!0));const oe=Math.max(...U.map(de=>de.received_at));H[G]=oe,Pf(G,oe)}}Object.keys(z).length>0&&d($=>({...$,...z})),Object.keys(j).length>0&&h($=>({...$,...j})),p(Ep())}catch(I){console.error("Failed to fetch messages bulk:",I)}})()},[r,a]),F.useEffect(()=>{if(o&&o.type!=="raw"&&o.type!=="map"){const T=Tr(o.type,o.id);d(B=>{if(B[T]){const k={...B};return delete k[T],k}return B}),h(B=>{if(B[T]){const k={...B};return delete k[T],k}return B}),o.type==="channel"?dt.markChannelRead(o.id).catch(B=>{console.error("Failed to mark channel as read on server:",B)}):o.type==="contact"&&dt.markContactRead(o.id).catch(B=>{console.error("Failed to mark contact as read on server:",B)})}},[o]);const P=F.useCallback((T,B)=>{d(k=>({...k,[T]:(k[T]||0)+1})),B&&h(k=>({...k,[T]:!0}))},[]),D=F.useCallback(()=>{d({}),h({}),dt.markAllRead().catch(T=>{console.error("Failed to mark all as read on server:",T)})},[]),C=F.useCallback(T=>{if(T.type==="raw"||T.type==="map")return;const B=Tr(T.type,T.id);d(k=>{if(k[B]){const N={...k};return delete N[B],N}return k}),h(k=>{if(k[B]){const N={...k};return delete N[B],N}return k}),T.type==="channel"?dt.markChannelRead(T.id).catch(k=>{console.error("Failed to mark channel as read on server:",k)}):T.type==="contact"&&dt.markContactRead(T.id).catch(k=>{console.error("Failed to mark contact as read on server:",k)})},[]),E=F.useCallback(T=>{let B=null;if(T.type==="CHAN"&&T.conversation_key?B=Tr("channel",T.conversation_key):T.type==="PRIV"&&T.conversation_key&&(B=Tr("contact",T.conversation_key)),B){const k=T.received_at||Math.floor(Date.now()/1e3),N=Pf(B,k);p(N)}},[]);return{unreadCounts:f,mentions:m,lastMessageTimes:x,incrementUnread:P,markAllRead:D,markConversationRead:C,trackNewMessage:E}}var d0=CA();const SA=Zs(d0);function jv(r){if(typeof document>"u")return;let a=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text Line truncated
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -57,7 +57,7 @@ No ACL entries`;const a=[`ACL (${r.length})`];for(const o of r){const l=o.name||
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const vy=F.forwardRef(({color:r="currentColor",size:a=24,strokeWidth:o=2,absoluteStrokeWidth:l,className:f="",children:d,iconNode:m,...h},x)=>F.createElement("svg",{ref:x,...xy,width:a,height:a,stroke:r,strokeWidth:l?Number(o)*24/Number(a):o,className:BA("lucide",f),...!d&&!gy(h)&&{"aria-hidden":"true"},...h},[...m.map(([p,y])=>F.createElement(p,y)),...Array.isArray(d)?d:[d]]));/**
*/const vy=F.forwardRef(({color:r="currentColor",size:a=24,strokeWidth:o=2,absoluteStrokeWidth:l,className:f="",children:d,iconNode:m,...h},x)=>F.createElement("svg",{ref:x,...xy,width:a,height:a,stroke:r,strokeWidth:l?Number(o)*24/Number(a):o,className:BA("lucide",f),...!d&&!gy(h)&&{"aria-hidden":"true"},...h},[...m.map(([p,v])=>F.createElement(p,v)),...Array.isArray(d)?d:[d]]));/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -77,8 +77,8 @@ No ACL entries`;const a=[`ACL (${r.length})`];for(const o of r){const l=o.name||
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Cy=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],PA=f0("x",Cy);function Ey({health:r,config:a,onConfigClick:o,onMaintenanceClick:l,onAdvertise:f,onMenuClick:d}){const m=(r==null?void 0:r.radio_connected)??!1,[h,x]=F.useState(!1),p=async()=>{x(!0);try{const y=await lt.reconnectRadio();y.connected&&It.success("Reconnected",{description:y.message})}catch(y){It.error("Reconnection failed",{description:y instanceof Error?y.message:"Check radio connection and power"})}finally{x(!1)}};return D.jsxs("div",{className:"flex items-center gap-4 px-4 py-2 bg-[#252525] border-b border-[#333] text-xs",children:[d&&D.jsx("button",{onClick:d,className:"md:hidden p-1 bg-transparent border-none text-[#e0e0e0] cursor-pointer","aria-label":"Open menu",children:D.jsx(by,{className:"h-5 w-5"})}),D.jsx("h1",{className:"hidden lg:block text-base font-semibold mr-auto",children:"RemoteTerm"}),D.jsxs("div",{className:"flex items-center gap-1 text-[#888]",children:[D.jsx("div",{className:`w-2 h-2 rounded-full ${m?"bg-[#4caf50]":"bg-[#666]"}`}),D.jsx("span",{className:"hidden lg:inline text-[#e0e0e0]",children:m?"Connected":"Disconnected"})]}),(r==null?void 0:r.serial_port)&&D.jsxs("div",{className:"hidden xl:flex items-center gap-1 text-[#888]",children:["Port: ",D.jsx("span",{className:"text-[#e0e0e0]",children:r.serial_port})]}),a&&D.jsxs(D.Fragment,{children:[D.jsx("div",{className:"hidden lg:flex items-center gap-1 text-[#888]",children:D.jsx("span",{className:"text-[#e0e0e0]",children:a.name||"Unnamed"})}),D.jsxs("div",{className:"hidden xl:flex items-center gap-1 text-[#888]",children:[a.radio.freq," MHz/SF",a.radio.sf,"/CR",a.radio.cr,"/",a.tx_power,"dBm"]})]}),D.jsx("div",{className:"flex-1 lg:hidden"}),!m&&D.jsx("button",{onClick:p,disabled:h,className:"px-3 py-1 bg-[#4a3000] border border-[#6b4500] text-[#ffa500] rounded text-xs cursor-pointer hover:bg-[#5a3a00] disabled:opacity-50 disabled:cursor-not-allowed",children:h?"Reconnecting...":"Reconnect"}),D.jsx("button",{onClick:f,disabled:!m,className:"px-3 py-1 bg-[#333] border border-[#444] text-[#e0e0e0] rounded text-xs cursor-pointer hover:bg-[#444] disabled:bg-[#333] disabled:text-[#666] disabled:cursor-not-allowed",children:"Advertise"}),D.jsx("button",{onClick:l,className:"px-2 py-1 bg-[#333] border border-[#444] text-[#e0e0e0] rounded text-xs cursor-pointer hover:bg-[#444]",title:"Database Maintenance",children:D.jsx("span",{role:"img","aria-label":"Settings",children:"⚙️"})}),D.jsxs("button",{onClick:o,className:"px-3 py-1 bg-[#333] border border-[#444] text-[#e0e0e0] rounded text-xs cursor-pointer hover:bg-[#444]",children:[D.jsx("span",{role:"img","aria-label":"Radio",children:"📻"})," ","Config"]})]})}const Gf=2,ky={text:"🛜",background:"#444444",textColor:"#ffffff"};function Sy(r){let a=0;for(let o=0;o<r.length;o++){const l=r.charCodeAt(o);a=(a<<5)-a+l,a=a&a}return Math.abs(a)}const By=/[\u{1F300}-\u{1F9FF}]|[\u{2600}-\u{26FF}]|[\u{2700}-\u{27BF}]|[\u{1F600}-\u{1F64F}]|[\u{1F680}-\u{1F6FF}]|[\u{1F1E0}-\u{1F1FF}]/u;function Py(r,a){if(!r)return a.slice(0,2).toUpperCase();const o=r.match(By);if(o)return o[0];const l=r.match(/[a-zA-Z]/g);if(!l||l.length===0)return a.slice(0,2).toUpperCase();const f=r.indexOf(" ");if(f!==-1){const d=l[0],m=r.slice(f+1).match(/[a-zA-Z]/);if(m)return(d+m[0]).toUpperCase()}return l[0].toUpperCase()}function Ty(r){const a=Sy(r),o=a%360,l=50+(a>>8)%30,f=35+(a>>16)%20,d=`hsl(${o}, ${l}%, ${f}%)`,m=f<45?"#ffffff":"#000000";return{background:d,text:m}}function Dy(r,a,o){if(o===Gf)return ky;const l=Py(r,a),f=Ty(a);return{text:l,background:f.background,textColor:f.text}}function Qf({name:r,publicKey:a,size:o=28,contactType:l}){const f=Dy(r,a,l);return D.jsx("div",{className:"flex items-center justify-center rounded-full font-semibold flex-shrink-0 select-none",style:{backgroundColor:f.background,color:f.textColor,width:o,height:o,fontSize:o*.45},children:f.text})}const TA="remoteterm-favorites";function Fc(){try{const r=localStorage.getItem(TA);return r?JSON.parse(r):[]}catch{return[]}}function DA(r){try{localStorage.setItem(TA,JSON.stringify(r))}catch{}}function Ry(r,a){const o=Fc();if(o.some(f=>f.type===r&&f.id===a))return o;const l=[...o,{type:r,id:a}];return DA(l),l}function Fy(r,a){const l=Fc().filter(f=>!(f.type===r&&f.id===a));return DA(l),l}function Is(r,a,o){return r.some(l=>l.type===a&&l.id===o)}function Ny(r,a){return Fc().some(l=>l.type===r&&l.id===a)?Fy(r,a):Ry(r,a)}function RA(r){var a,o,l="";if(typeof r=="string"||typeof r=="number")l+=r;else if(typeof r=="object")if(Array.isArray(r)){var f=r.length;for(a=0;a<f;a++)r[a]&&(o=RA(r[a]))&&(l&&(l+=" "),l+=o)}else for(o in r)r[o]&&(l&&(l+=" "),l+=o);return l}function FA(){for(var r,a,o=0,l="",f=arguments.length;o<f;o++)(r=arguments[o])&&(a=RA(r))&&(l&&(l+=" "),l+=a);return l}const Ly=(r,a)=>{const o=new Array(r.length+a.length);for(let l=0;l<r.length;l++)o[l]=r[l];for(let l=0;l<a.length;l++)o[r.length+l]=a[l];return o},My=(r,a)=>({claLine truncated
`).map((W,S,V)=>D.jsxs("span",{children:[L_(W,h),S<V.length-1&&D.jsx("br",{})]},S)),!de&&D.jsx("span",{className:"text-[10px] text-muted-foreground/50 ml-2",children:Sc(N.sender_timestamp||N.received_at)}),N.outgoing&&(N.acked>0?` ✓${N.acked>1?N.acked:""}`:" ?")]})]})]},N.id)})]}),v&&D.jsx("button",{onClick:C,className:"absolute bottom-4 right-4 w-10 h-10 rounded-full bg-muted hover:bg-accent border border-border flex items-center justify-center shadow-lg transition-opacity",title:"Scroll to bottom",children:D.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-muted-foreground",children:D.jsx("polyline",{points:"6 9 12 15 18 9"})})})]})}const zp=156,I_=140,O_=156,z_=120,j_=8,H_=F.forwardRef(function({onSend:a,disabled:o,placeholder:l,isRepeaterMode:f,conversationType:d,senderName:m},h){const[x,p]=F.useState(""),[y,v]=F.useState(!1),w=F.useRef(null);F.useImperativeHandle(h,()=>({appendText:I=>{var z;p(j=>j+I),(z=w.current)==null||z.focus()}}));const B=F.useMemo(()=>{if(d==="contact")return{warningAt:I_,dangerAt:zp,hardLimit:zp};if(d==="channel"){const I=(m==null?void 0:m.length)??10,z=Math.max(1,O_-I-2);return{warningAt:z_,dangerAt:Math.max(1,z-j_),hardLimit:z}}return null},[d,m]),{limitState:R,warningMessage:C}=F.useMemo(()=>{if(!B)return{limitState:"normal",warningMessage:null};const I=x.length;return I>=B.hardLimit?{limitState:"error",warningMessage:"likely truncated by radio"}:I>=B.dangerAt?{limitState:"danger",warningMessage:"may impact multi-repeater hop delivery"}:I>=B.warningAt?{limitState:"warning",warningMessage:"may impact multi-repeater hop delivery"}:{limitState:"normal",warningMessage:null}},[x.length,B]),E=B?B.hardLimit-x.length:0,T=F.useCallback(async I=>{I.preventDefault();const z=x.trim();if(f){if(y||o)return;v(!0);try{await a(z),p("")}catch(j){console.error("Failed to request telemetry:",j),It.error("Failed to request telemetry",{description:j instanceof Error?j.message:"Check radio connection"});return}finally{v(!1)}setTimeout(()=>{var j;return(j=w.current)==null?void 0:j.focus()},0)}else{if(!z||y||o)return;v(!0);try{await a(z),p("")}catch(j){console.error("Failed to send message:",j),It.error("Failed to send message",{description:j instanceof Error?j.message:"Check radio connection"});return}finally{v(!1)}setTimeout(()=>{var j;return(j=w.current)==null?void 0:j.focus()},0)}},[x,y,o,a,f]),P=F.useCallback(I=>{I.key==="Enter"&&!I.shiftKey&&(I.preventDefault(),T(I))},[T]),k=f?!0:x.trim().length>0,N=!f&&B!==null;return D.jsxs("form",{className:"px-4 py-3 border-t border-border flex flex-col gap-1",onSubmit:T,children:[D.jsxs("div",{className:"flex gap-2",children:[D.jsx(Yt,{ref:w,type:f?"password":"text",autoComplete:f?"off":void 0,value:x,onChange:I=>p(I.target.value),onKeyDown:P,placeholder:l||(f?"Enter password for admin login...":"Type a message..."),disabled:o||y,className:"flex-1 min-w-0"}),D.jsx(gr,{type:"submit",disabled:o||y||!k,className:"flex-shrink-0",children:y?f?"Logging in...":"Sending...":f?x.trim()?"Log in with password":"Log in as guest/use repeater ACLs":"Send"})]}),N&&D.jsxs("div",{className:"flex items-center justify-end gap-2 text-xs",children:[D.jsxs("span",{className:nt("tabular-nums",R==="error"||R==="danger"?"text-red-500 font-medium":R==="warning"?"text-yellow-500":"text-muted-foreground"),children:[x.length,"/",B.hardLimit,E<0&&` (${E})`]}),C&&D.jsxs("span",{className:nt(R==="error"?"text-red-500":"text-yellow-500"),children:["— ",C]})]})]})});function an(r,a,{checkForDefaultPrevented:o=!0}={}){return function(f){if(r==null||r(f),o===!1||!f.defaultPrevented)return a==null?void 0:a(f)}}function V_(r,a){const o=F.createContext(a),l=d=>{const{children:m,...h}=d,x=F.useMemo(()=>h,Object.values(h));return D.jsx(o.Provider,{value:x,children:m})};l.displayName=r+"Provider";function f(d){const m=F.useContext(o);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${r}\``)}return[l,f]}function al(r,a=[]){let o=[];function l(d,m){const h=F.createContext(m),x=o.length;o=[...o,m];const p=v=>{var T;const{scope:w,children:B,...R}=v,C=((T=w==null?void 0:w[r])==null?void 0:T[x])||h,E=F.useMemo(()=>R,Object.values(R));return D.jsx(C.Provider,{value:E,children:B})};p.displayName=d+"Provider";function y(v,w){var C;const B=((C=w==null?void 0:w[r])==null?void 0:C[x])||h,R=F.useContext(B);if(R)return R;if(m!==void 0)return m;throw new Error(`\`${v}\` must be used within \`${d}\``)}return[p,y]}const f=()=>{const d=o.map(m=>F.createContext(m));return function(h){const x=(h==null?void 0:h[r])||d;return F.useMemo(()=>({[`__scope${r}`]:{...h,[r]:x}}),[h,x])}};return f.scopeName=r,[l,U_(f,...a)]}function U_(...r){const a=r[0];if(r.length===1)return a;const o=()=>{const l=r.map(f=>({useScope:f(),scopeName:f.scopeName}));return function(d){const m=l.reduce((h,{useScope:x,scopeName:p})=>{const v=x(d)[`__scope${p}Line truncated
*/const Cy=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],PA=f0("x",Cy);function Ey({health:r,config:a,onConfigClick:o,onMaintenanceClick:l,onAdvertise:f,onMenuClick:d}){const m=(r==null?void 0:r.radio_connected)??!1,[h,x]=F.useState(!1),p=async()=>{x(!0);try{const v=await dt.reconnectRadio();v.connected&&Yt.success("Reconnected",{description:v.message})}catch(v){Yt.error("Reconnection failed",{description:v instanceof Error?v.message:"Check radio connection and power"})}finally{x(!1)}};return R.jsxs("div",{className:"flex items-center gap-4 px-4 py-2 bg-[#252525] border-b border-[#333] text-xs",children:[d&&R.jsx("button",{onClick:d,className:"md:hidden p-1 bg-transparent border-none text-[#e0e0e0] cursor-pointer","aria-label":"Open menu",children:R.jsx(by,{className:"h-5 w-5"})}),R.jsx("h1",{className:"hidden lg:block text-base font-semibold mr-auto",children:"RemoteTerm"}),R.jsxs("div",{className:"flex items-center gap-1 text-[#888]",children:[R.jsx("div",{className:`w-2 h-2 rounded-full ${m?"bg-[#4caf50]":"bg-[#666]"}`}),R.jsx("span",{className:"hidden lg:inline text-[#e0e0e0]",children:m?"Connected":"Disconnected"})]}),(r==null?void 0:r.serial_port)&&R.jsxs("div",{className:"hidden xl:flex items-center gap-1 text-[#888]",children:["Port: ",R.jsx("span",{className:"text-[#e0e0e0]",children:r.serial_port})]}),a&&R.jsxs(R.Fragment,{children:[R.jsx("div",{className:"hidden lg:flex items-center gap-1 text-[#888]",children:R.jsx("span",{className:"text-[#e0e0e0]",children:a.name||"Unnamed"})}),R.jsxs("div",{className:"hidden xl:flex items-center gap-1 text-[#888]",children:[a.radio.freq," MHz/SF",a.radio.sf,"/CR",a.radio.cr,"/",a.tx_power,"dBm"]})]}),R.jsx("div",{className:"flex-1 lg:hidden"}),!m&&R.jsx("button",{onClick:p,disabled:h,className:"px-3 py-1 bg-[#4a3000] border border-[#6b4500] text-[#ffa500] rounded text-xs cursor-pointer hover:bg-[#5a3a00] disabled:opacity-50 disabled:cursor-not-allowed",children:h?"Reconnecting...":"Reconnect"}),R.jsx("button",{onClick:f,disabled:!m,className:"px-3 py-1 bg-[#333] border border-[#444] text-[#e0e0e0] rounded text-xs cursor-pointer hover:bg-[#444] disabled:bg-[#333] disabled:text-[#666] disabled:cursor-not-allowed",children:"Advertise"}),R.jsx("button",{onClick:l,className:"px-2 py-1 bg-[#333] border border-[#444] text-[#e0e0e0] rounded text-xs cursor-pointer hover:bg-[#444]",title:"Database Maintenance",children:R.jsx("span",{role:"img","aria-label":"Settings",children:"⚙️"})}),R.jsxs("button",{onClick:o,className:"px-3 py-1 bg-[#333] border border-[#444] text-[#e0e0e0] rounded text-xs cursor-pointer hover:bg-[#444]",children:[R.jsx("span",{role:"img","aria-label":"Radio",children:"📻"})," ","Config"]})]})}const Gf=2,ky={text:"🛜",background:"#444444",textColor:"#ffffff"};function Sy(r){let a=0;for(let o=0;o<r.length;o++){const l=r.charCodeAt(o);a=(a<<5)-a+l,a=a&a}return Math.abs(a)}const By=/[\u{1F300}-\u{1F9FF}]|[\u{2600}-\u{26FF}]|[\u{2700}-\u{27BF}]|[\u{1F600}-\u{1F64F}]|[\u{1F680}-\u{1F6FF}]|[\u{1F1E0}-\u{1F1FF}]/u;function Py(r,a){if(!r)return a.slice(0,2).toUpperCase();const o=r.match(By);if(o)return o[0];const l=r.match(/[a-zA-Z]/g);if(!l||l.length===0)return a.slice(0,2).toUpperCase();const f=r.indexOf(" ");if(f!==-1){const d=l[0],m=r.slice(f+1).match(/[a-zA-Z]/);if(m)return(d+m[0]).toUpperCase()}return l[0].toUpperCase()}function Ty(r){const a=Sy(r),o=a%360,l=50+(a>>8)%30,f=35+(a>>16)%20,d=`hsl(${o}, ${l}%, ${f}%)`,m=f<45?"#ffffff":"#000000";return{background:d,text:m}}function Dy(r,a,o){if(o===Gf)return ky;const l=Py(r,a),f=Ty(a);return{text:l,background:f.background,textColor:f.text}}function Qf({name:r,publicKey:a,size:o=28,contactType:l}){const f=Dy(r,a,l);return R.jsx("div",{className:"flex items-center justify-center rounded-full font-semibold flex-shrink-0 select-none",style:{backgroundColor:f.background,color:f.textColor,width:o,height:o,fontSize:o*.45},children:f.text})}const TA="remoteterm-favorites";function Fc(){try{const r=localStorage.getItem(TA);return r?JSON.parse(r):[]}catch{return[]}}function DA(r){try{localStorage.setItem(TA,JSON.stringify(r))}catch{}}function Ry(r,a){const o=Fc();if(o.some(f=>f.type===r&&f.id===a))return o;const l=[...o,{type:r,id:a}];return DA(l),l}function Fy(r,a){const l=Fc().filter(f=>!(f.type===r&&f.id===a));return DA(l),l}function Is(r,a,o){return r.some(l=>l.type===a&&l.id===o)}function Ny(r,a){return Fc().some(l=>l.type===r&&l.id===a)?Fy(r,a):Ry(r,a)}function RA(r){var a,o,l="";if(typeof r=="string"||typeof r=="number")l+=r;else if(typeof r=="object")if(Array.isArray(r)){var f=r.length;for(a=0;a<f;a++)r[a]&&(o=RA(r[a]))&&(l&&(l+=" "),l+=o)}else for(o in r)r[o]&&(l&&(l+=" "),l+=o);return l}function FA(){for(var r,a,o=0,l="",f=arguments.length;o<f;o++)(r=arguments[o])&&(a=RA(r))&&(l&&(l+=" "),l+=a);return l}const Ly=(r,a)=>{const o=new Array(r.length+a.length);for(let l=0;l<r.length;l++)o[l]=r[l];for(let l=0;l<a.length;l++)o[r.length+l]=a[l];return o},My=(r,a)=>({claLine truncated
`).map((W,S,V)=>R.jsxs("span",{children:[L_(W,h),S<V.length-1&&R.jsx("br",{})]},S)),!de&&R.jsx("span",{className:"text-[10px] text-muted-foreground/50 ml-2",children:Sc(N.sender_timestamp||N.received_at)}),N.outgoing&&(N.acked>0?` ✓${N.acked>1?N.acked:""}`:" ?")]})]})]},N.id)})]}),y&&R.jsx("button",{onClick:C,className:"absolute bottom-4 right-4 w-10 h-10 rounded-full bg-muted hover:bg-accent border border-border flex items-center justify-center shadow-lg transition-opacity",title:"Scroll to bottom",children:R.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-muted-foreground",children:R.jsx("polyline",{points:"6 9 12 15 18 9"})})})]})}const zp=156,I_=140,O_=156,z_=120,j_=8,H_=F.forwardRef(function({onSend:a,disabled:o,placeholder:l,isRepeaterMode:f,conversationType:d,senderName:m},h){const[x,p]=F.useState(""),[v,y]=F.useState(!1),w=F.useRef(null);F.useImperativeHandle(h,()=>({appendText:I=>{var z;p(j=>j+I),(z=w.current)==null||z.focus()}}));const P=F.useMemo(()=>{if(d==="contact")return{warningAt:I_,dangerAt:zp,hardLimit:zp};if(d==="channel"){const I=(m==null?void 0:m.length)??10,z=Math.max(1,O_-I-2);return{warningAt:z_,dangerAt:Math.max(1,z-j_),hardLimit:z}}return null},[d,m]),{limitState:D,warningMessage:C}=F.useMemo(()=>{if(!P)return{limitState:"normal",warningMessage:null};const I=x.length;return I>=P.hardLimit?{limitState:"error",warningMessage:"likely truncated by radio"}:I>=P.dangerAt?{limitState:"danger",warningMessage:"may impact multi-repeater hop delivery"}:I>=P.warningAt?{limitState:"warning",warningMessage:"may impact multi-repeater hop delivery"}:{limitState:"normal",warningMessage:null}},[x.length,P]),E=P?P.hardLimit-x.length:0,T=F.useCallback(async I=>{I.preventDefault();const z=x.trim();if(f){if(v||o)return;y(!0);try{await a(z),p("")}catch(j){console.error("Failed to request telemetry:",j),Yt.error("Failed to request telemetry",{description:j instanceof Error?j.message:"Check radio connection"});return}finally{y(!1)}setTimeout(()=>{var j;return(j=w.current)==null?void 0:j.focus()},0)}else{if(!z||v||o)return;y(!0);try{await a(z),p("")}catch(j){console.error("Failed to send message:",j),Yt.error("Failed to send message",{description:j instanceof Error?j.message:"Check radio connection"});return}finally{y(!1)}setTimeout(()=>{var j;return(j=w.current)==null?void 0:j.focus()},0)}},[x,v,o,a,f]),B=F.useCallback(I=>{I.key==="Enter"&&!I.shiftKey&&(I.preventDefault(),T(I))},[T]),k=f?!0:x.trim().length>0,N=!f&&P!==null;return R.jsxs("form",{className:"px-4 py-3 border-t border-border flex flex-col gap-1",onSubmit:T,children:[R.jsxs("div",{className:"flex gap-2",children:[R.jsx($t,{ref:w,type:f?"password":"text",autoComplete:f?"off":void 0,value:x,onChange:I=>p(I.target.value),onKeyDown:B,placeholder:l||(f?"Enter password for admin login...":"Type a message..."),disabled:o||v,className:"flex-1 min-w-0"}),R.jsx(Dr,{type:"submit",disabled:o||v||!k,className:"flex-shrink-0",children:v?f?"Logging in...":"Sending...":f?x.trim()?"Log in with password":"Log in as guest/use repeater ACLs":"Send"})]}),N&&R.jsxs("div",{className:"flex items-center justify-end gap-2 text-xs",children:[R.jsxs("span",{className:nt("tabular-nums",D==="error"||D==="danger"?"text-red-500 font-medium":D==="warning"?"text-yellow-500":"text-muted-foreground"),children:[x.length,"/",P.hardLimit,E<0&&` (${E})`]}),C&&R.jsxs("span",{className:nt(D==="error"?"text-red-500":"text-yellow-500"),children:["— ",C]})]})]})});function an(r,a,{checkForDefaultPrevented:o=!0}={}){return function(f){if(r==null||r(f),o===!1||!f.defaultPrevented)return a==null?void 0:a(f)}}function V_(r,a){const o=F.createContext(a),l=d=>{const{children:m,...h}=d,x=F.useMemo(()=>h,Object.values(h));return R.jsx(o.Provider,{value:x,children:m})};l.displayName=r+"Provider";function f(d){const m=F.useContext(o);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${r}\``)}return[l,f]}function al(r,a=[]){let o=[];function l(d,m){const h=F.createContext(m),x=o.length;o=[...o,m];const p=y=>{var T;const{scope:w,children:P,...D}=y,C=((T=w==null?void 0:w[r])==null?void 0:T[x])||h,E=F.useMemo(()=>D,Object.values(D));return R.jsx(C.Provider,{value:E,children:P})};p.displayName=d+"Provider";function v(y,w){var C;const P=((C=w==null?void 0:w[r])==null?void 0:C[x])||h,D=F.useContext(P);if(D)return D;if(m!==void 0)return m;throw new Error(`\`${y}\` must be used within \`${d}\``)}return[p,v]}const f=()=>{const d=o.map(m=>F.createContext(m));return function(h){const x=(h==null?void 0:h[r])||d;return F.useMemo(()=>({[`__scope${r}`]:{...h,[r]:x}}),[h,x])}};return f.scopeName=r,[l,U_(f,...a)]}function U_(...r){const a=r[0];if(r.length===1)return a;const o=()=>{const l=r.map(f=>({useScope:f(),scopeName:f.scopeName}));return function(d){const m=l.reduce((h,{useScope:x,scopeName:p})=>{const y=x(d)[`__scope${p}Line truncated
.`.concat(C1,` {
overflow: hidden `).concat(l,`;
padding-right: `).concat(h,"px ").concat(l,`;
@@ -115,17 +115,17 @@ No ACL entries`;const a=[`ACL (${r.length})`];for(const o of r){const l=o.name||
body[`).concat(zs,`] {
`).concat(E1,": ").concat(h,`px;
}
`)},Qp=function(){var r=parseInt(document.body.getAttribute(zs)||"0",10);return isFinite(r)?r:0},Z1=function(){F.useEffect(function(){return document.body.setAttribute(zs,(Qp()+1).toString()),function(){var r=Qp()-1;r<=0?document.body.removeAttribute(zs):document.body.setAttribute(zs,r.toString())}},[])},W1=function(r){var a=r.noRelative,o=r.noImportant,l=r.gapMode,f=l===void 0?"margin":l;Z1();var d=F.useMemo(function(){return H1(f)},[f]);return F.createElement(V1,{styles:U1(d,!a,f,o?"":"!important")})},Yf=!1;if(typeof window<"u")try{var Tu=Object.defineProperty({},"passive",{get:function(){return Yf=!0,!0}});window.addEventListener("test",Tu,Tu),window.removeEventListener("test",Tu,Tu)}catch{Yf=!1}var Ns=Yf?{passive:!1}:!1,q1=function(r){return r.tagName==="TEXTAREA"},rg=function(r,a){if(!(r instanceof Element))return!1;var o=window.getComputedStyle(r);return o[a]!=="hidden"&&!(o.overflowY===o.overflowX&&!q1(r)&&o[a]==="visible")},G1=function(r){return rg(r,"overflowY")},Q1=function(r){return rg(r,"overflowX")},Kp=function(r,a){var o=a.ownerDocument,l=a;do{typeof ShadowRoot<"u"&&l instanceof ShadowRoot&&(l=l.host);var f=ig(r,l);if(f){var d=og(r,l),m=d[1],h=d[2];if(m>h)return!0}l=l.parentNode}while(l&&l!==o.body);return!1},K1=function(r){var a=r.scrollTop,o=r.scrollHeight,l=r.clientHeight;return[a,o,l]},$1=function(r){var a=r.scrollLeft,o=r.scrollWidth,l=r.clientWidth;return[a,o,l]},ig=function(r,a){return r==="v"?G1(a):Q1(a)},og=function(r,a){return r==="v"?K1(a):$1(a)},Y1=function(r,a){return r==="h"&&a==="rtl"?-1:1},X1=function(r,a,o,l,f){var d=Y1(r,window.getComputedStyle(a).direction),m=d*l,h=o.target,x=a.contains(h),p=!1,y=m>0,v=0,w=0;do{if(!h)break;var B=og(r,h),R=B[0],C=B[1],E=B[2],T=C-E-d*R;(R||T)&&ig(r,h)&&(v+=T,w+=R);var P=h.parentNode;h=P&&P.nodeType===Node.DOCUMENT_FRAGMENT_NODE?P.host:P}while(!x&&h!==document.body||x&&(a.contains(h)||a===h));return(y&&Math.abs(v)<1||!y&&Math.abs(w)<1)&&(p=!0),p},Du=function(r){return"changedTouches"in r?[r.changedTouches[0].clientX,r.changedTouches[0].clientY]:[0,0]},$p=function(r){return[r.deltaX,r.deltaY]},Yp=function(r){return r&&"current"in r?r.current:r},J1=function(r,a){return r[0]===a[0]&&r[1]===a[1]},e2=function(r){return`
`)},Qp=function(){var r=parseInt(document.body.getAttribute(zs)||"0",10);return isFinite(r)?r:0},Z1=function(){F.useEffect(function(){return document.body.setAttribute(zs,(Qp()+1).toString()),function(){var r=Qp()-1;r<=0?document.body.removeAttribute(zs):document.body.setAttribute(zs,r.toString())}},[])},W1=function(r){var a=r.noRelative,o=r.noImportant,l=r.gapMode,f=l===void 0?"margin":l;Z1();var d=F.useMemo(function(){return H1(f)},[f]);return F.createElement(V1,{styles:U1(d,!a,f,o?"":"!important")})},Yf=!1;if(typeof window<"u")try{var Tu=Object.defineProperty({},"passive",{get:function(){return Yf=!0,!0}});window.addEventListener("test",Tu,Tu),window.removeEventListener("test",Tu,Tu)}catch{Yf=!1}var Ns=Yf?{passive:!1}:!1,q1=function(r){return r.tagName==="TEXTAREA"},rg=function(r,a){if(!(r instanceof Element))return!1;var o=window.getComputedStyle(r);return o[a]!=="hidden"&&!(o.overflowY===o.overflowX&&!q1(r)&&o[a]==="visible")},G1=function(r){return rg(r,"overflowY")},Q1=function(r){return rg(r,"overflowX")},Kp=function(r,a){var o=a.ownerDocument,l=a;do{typeof ShadowRoot<"u"&&l instanceof ShadowRoot&&(l=l.host);var f=ig(r,l);if(f){var d=og(r,l),m=d[1],h=d[2];if(m>h)return!0}l=l.parentNode}while(l&&l!==o.body);return!1},K1=function(r){var a=r.scrollTop,o=r.scrollHeight,l=r.clientHeight;return[a,o,l]},$1=function(r){var a=r.scrollLeft,o=r.scrollWidth,l=r.clientWidth;return[a,o,l]},ig=function(r,a){return r==="v"?G1(a):Q1(a)},og=function(r,a){return r==="v"?K1(a):$1(a)},Y1=function(r,a){return r==="h"&&a==="rtl"?-1:1},X1=function(r,a,o,l,f){var d=Y1(r,window.getComputedStyle(a).direction),m=d*l,h=o.target,x=a.contains(h),p=!1,v=m>0,y=0,w=0;do{if(!h)break;var P=og(r,h),D=P[0],C=P[1],E=P[2],T=C-E-d*D;(D||T)&&ig(r,h)&&(y+=T,w+=D);var B=h.parentNode;h=B&&B.nodeType===Node.DOCUMENT_FRAGMENT_NODE?B.host:B}while(!x&&h!==document.body||x&&(a.contains(h)||a===h));return(v&&Math.abs(y)<1||!v&&Math.abs(w)<1)&&(p=!0),p},Du=function(r){return"changedTouches"in r?[r.changedTouches[0].clientX,r.changedTouches[0].clientY]:[0,0]},$p=function(r){return[r.deltaX,r.deltaY]},Yp=function(r){return r&&"current"in r?r.current:r},J1=function(r,a){return r[0]===a[0]&&r[1]===a[1]},e2=function(r){return`
.block-interactivity-`.concat(r,` {pointer-events: none;}
.allow-interactivity-`).concat(r,` {pointer-events: all;}
`)},t2=0,Ls=[];function n2(r){var a=F.useRef([]),o=F.useRef([0,0]),l=F.useRef(),f=F.useState(t2++)[0],d=F.useState(ng)[0],m=F.useRef(r);F.useEffect(function(){m.current=r},[r]),F.useEffect(function(){if(r.inert){document.body.classList.add("block-interactivity-".concat(f));var C=b1([r.lockRef.current],(r.shards||[]).map(Yp),!0).filter(Boolean);return C.forEach(function(E){return E.classList.add("allow-interactivity-".concat(f))}),function(){document.body.classList.remove("block-interactivity-".concat(f)),C.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(f))})}}},[r.inert,r.lockRef.current,r.shards]);var h=F.useCallback(function(C,E){if("touches"in C&&C.touches.length===2||C.type==="wheel"&&C.ctrlKey)return!m.current.allowPinchZoom;var T=Du(C),P=o.current,k="deltaX"in C?C.deltaX:P[0]-T[0],N="deltaY"in C?C.deltaY:P[1]-T[1],I,z=C.target,j=Math.abs(k)>Math.abs(N)?"h":"v";if("touches"in C&&j==="h"&&z.type==="range")return!1;var H=window.getSelection(),$=H&&H.anchorNode,U=$?$===z||$.contains(z):!1;if(U)return!1;var G=Kp(j,z);if(!G)return!0;if(G?I=j:(I=j==="v"?"h":"v",G=Kp(j,z)),!G)return!1;if(!l.current&&"changedTouches"in C&&(k||N)&&(l.current=I),!I)return!0;var ne=l.current||I;return X1(ne,E,C,ne==="h"?k:N)},[]),x=F.useCallback(function(C){var E=C;if(!(!Ls.length||Ls[Ls.length-1]!==d)){var T="deltaY"in E?$p(E):Du(E),P=a.current.filter(function(I){return I.name===E.type&&(I.target===E.target||E.target===I.shadowParent)&&J1(I.delta,T)})[0];if(P&&P.should){E.cancelable&&E.preventDefault();return}if(!P){var k=(m.current.shards||[]).map(Yp).filter(Boolean).filter(function(I){return I.contains(E.target)}),N=k.length>0?h(E,k[0]):!m.current.noIsolation;N&&E.cancelable&&E.preventDefault()}}},[]),p=F.useCallback(function(C,E,T,P){var k={name:C,delta:E,target:T,should:P,shadowParent:r2(T)};a.current.push(k),setTimeout(function(){a.current=a.current.filter(function(N){return N!==k})},1)},[]),y=F.useCallback(function(C){o.current=Du(C),l.current=void 0},[]),v=F.useCallback(function(C){p(C.type,$p(C),C.target,h(C,r.lockRef.current))},[]),w=F.useCallback(function(C){p(C.type,Du(C),C.target,h(C,r.lockRef.current))},[]);F.useEffect(function(){return Ls.push(d),r.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:w}),document.addEventListener("wheel",x,Ns),document.addEventListener("touchmove",x,Ns),document.addEventListener("touchstart",y,Ns),function(){Ls=Ls.filter(function(C){return C!==d}),document.removeEventListener("wheel",x,Ns),document.removeEventListener("touchmove",x,Ns),document.removeEventListener("touchstart",y,Ns)}},[]);var B=r.removeScrollBar,R=r.inert;return F.createElement(F.Fragment,null,R?F.createElement(d,{styles:e2(f)}):null,B?F.createElement(W1,{noRelative:r.noRelative,gapMode:r.gapMode}):null)}function r2(r){for(var a=null;r!==null;)r instanceof ShadowRoot&&(a=r.host,r=r.host),r=r.parentNode;return a}const i2=R1(tg,n2);var sg=F.forwardRef(function(r,a){return F.createElement(Mc,Kr({},r,{ref:a,sideCar:i2}))});sg.classNames=Mc.classNames;var o2=function(r){if(typeof document>"u")return null;var a=Array.isArray(r)?r[0]:r;return a.ownerDocument.body},Ms=new WeakMap,Ru=new WeakMap,Fu={},Of=0,ag=function(r){return r&&(r.host||ag(r.parentNode))},s2=function(r,a){return a.map(function(o){if(r.contains(o))return o;var l=ag(o);return l&&r.contains(l)?l:(console.error("aria-hidden",o,"in not contained inside",r,". Doing nothing"),null)}).filter(function(o){return!!o})},a2=function(r,a,o,l){var f=s2(a,Array.isArray(r)?r:[r]);Fu[o]||(Fu[o]=new WeakMap);var d=Fu[o],m=[],h=new Set,x=new Set(f),p=function(v){!v||h.has(v)||(h.add(v),p(v.parentNode))};f.forEach(p);var y=function(v){!v||x.has(v)||Array.prototype.forEach.call(v.children,function(w){if(h.has(w))y(w);else try{var B=w.getAttribute(l),R=B!==null&&B!=="false",C=(Ms.get(w)||0)+1,E=(d.get(w)||0)+1;Ms.set(w,C),d.set(w,E),m.push(w),C===1&&R&&Ru.set(w,!0),E===1&&w.setAttribute(o,"true"),R||w.setAttribute(l,"true")}catch(T){console.error("aria-hidden: cannot operate on ",w,T)}})};return y(a),h.clear(),Of++,function(){m.forEach(function(v){var w=Ms.get(v)-1,B=d.get(v)-1;Ms.set(v,w),d.set(v,B),w||(Ru.has(v)||v.removeAttribute(l),Ru.delete(v)),B||v.removeAttribute(o)}),Of--,Of||(Ms=new WeakMap,Ms=new WeakMap,Ru=new WeakMap,Fu={})}},l2=function(r,a,o){o===void 0&&(o="data-aria-hidden");var l=Array.from(Array.isArray(r)?r:[r]),f=o2(r);return f?(l.push.apply(l,Array.from(f.querySelectorAll("[aria-live], script"))),a2(l,f,o,"aria-hidden")):function(){return null}};function u2(r){const a=c2(r),o=F.forwardRef((l,f)=>{const{children:d,...m}=l,h=F.Children.toArray(d),x=h.find(f2);if(x){const p=x.props.children,y=h.map(v=>v===x?F.Children.count(p)>1?F.Children.only(null):F.isValidElement(p)?p.props.children:null:v);return D.jsx(a,{...m,ref:f,children:F.isValidElement(p)?F.cloneElement(p,void 0,y):null})}return D.jsx(a,{...m,ref:f,children:d})});return o.displayName=`${r}.Slot`,o}function c2(r){const a=F.forwardRef((o,l)=>{const{childre Line truncated
`)},t2=0,Ls=[];function n2(r){var a=F.useRef([]),o=F.useRef([0,0]),l=F.useRef(),f=F.useState(t2++)[0],d=F.useState(ng)[0],m=F.useRef(r);F.useEffect(function(){m.current=r},[r]),F.useEffect(function(){if(r.inert){document.body.classList.add("block-interactivity-".concat(f));var C=b1([r.lockRef.current],(r.shards||[]).map(Yp),!0).filter(Boolean);return C.forEach(function(E){return E.classList.add("allow-interactivity-".concat(f))}),function(){document.body.classList.remove("block-interactivity-".concat(f)),C.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(f))})}}},[r.inert,r.lockRef.current,r.shards]);var h=F.useCallback(function(C,E){if("touches"in C&&C.touches.length===2||C.type==="wheel"&&C.ctrlKey)return!m.current.allowPinchZoom;var T=Du(C),B=o.current,k="deltaX"in C?C.deltaX:B[0]-T[0],N="deltaY"in C?C.deltaY:B[1]-T[1],I,z=C.target,j=Math.abs(k)>Math.abs(N)?"h":"v";if("touches"in C&&j==="h"&&z.type==="range")return!1;var H=window.getSelection(),$=H&&H.anchorNode,U=$?$===z||$.contains(z):!1;if(U)return!1;var G=Kp(j,z);if(!G)return!0;if(G?I=j:(I=j==="v"?"h":"v",G=Kp(j,z)),!G)return!1;if(!l.current&&"changedTouches"in C&&(k||N)&&(l.current=I),!I)return!0;var ne=l.current||I;return X1(ne,E,C,ne==="h"?k:N)},[]),x=F.useCallback(function(C){var E=C;if(!(!Ls.length||Ls[Ls.length-1]!==d)){var T="deltaY"in E?$p(E):Du(E),B=a.current.filter(function(I){return I.name===E.type&&(I.target===E.target||E.target===I.shadowParent)&&J1(I.delta,T)})[0];if(B&&B.should){E.cancelable&&E.preventDefault();return}if(!B){var k=(m.current.shards||[]).map(Yp).filter(Boolean).filter(function(I){return I.contains(E.target)}),N=k.length>0?h(E,k[0]):!m.current.noIsolation;N&&E.cancelable&&E.preventDefault()}}},[]),p=F.useCallback(function(C,E,T,B){var k={name:C,delta:E,target:T,should:B,shadowParent:r2(T)};a.current.push(k),setTimeout(function(){a.current=a.current.filter(function(N){return N!==k})},1)},[]),v=F.useCallback(function(C){o.current=Du(C),l.current=void 0},[]),y=F.useCallback(function(C){p(C.type,$p(C),C.target,h(C,r.lockRef.current))},[]),w=F.useCallback(function(C){p(C.type,Du(C),C.target,h(C,r.lockRef.current))},[]);F.useEffect(function(){return Ls.push(d),r.setCallbacks({onScrollCapture:y,onWheelCapture:y,onTouchMoveCapture:w}),document.addEventListener("wheel",x,Ns),document.addEventListener("touchmove",x,Ns),document.addEventListener("touchstart",v,Ns),function(){Ls=Ls.filter(function(C){return C!==d}),document.removeEventListener("wheel",x,Ns),document.removeEventListener("touchmove",x,Ns),document.removeEventListener("touchstart",v,Ns)}},[]);var P=r.removeScrollBar,D=r.inert;return F.createElement(F.Fragment,null,D?F.createElement(d,{styles:e2(f)}):null,P?F.createElement(W1,{noRelative:r.noRelative,gapMode:r.gapMode}):null)}function r2(r){for(var a=null;r!==null;)r instanceof ShadowRoot&&(a=r.host,r=r.host),r=r.parentNode;return a}const i2=R1(tg,n2);var sg=F.forwardRef(function(r,a){return F.createElement(Mc,Kr({},r,{ref:a,sideCar:i2}))});sg.classNames=Mc.classNames;var o2=function(r){if(typeof document>"u")return null;var a=Array.isArray(r)?r[0]:r;return a.ownerDocument.body},Ms=new WeakMap,Ru=new WeakMap,Fu={},Of=0,ag=function(r){return r&&(r.host||ag(r.parentNode))},s2=function(r,a){return a.map(function(o){if(r.contains(o))return o;var l=ag(o);return l&&r.contains(l)?l:(console.error("aria-hidden",o,"in not contained inside",r,". Doing nothing"),null)}).filter(function(o){return!!o})},a2=function(r,a,o,l){var f=s2(a,Array.isArray(r)?r:[r]);Fu[o]||(Fu[o]=new WeakMap);var d=Fu[o],m=[],h=new Set,x=new Set(f),p=function(y){!y||h.has(y)||(h.add(y),p(y.parentNode))};f.forEach(p);var v=function(y){!y||x.has(y)||Array.prototype.forEach.call(y.children,function(w){if(h.has(w))v(w);else try{var P=w.getAttribute(l),D=P!==null&&P!=="false",C=(Ms.get(w)||0)+1,E=(d.get(w)||0)+1;Ms.set(w,C),d.set(w,E),m.push(w),C===1&&D&&Ru.set(w,!0),E===1&&w.setAttribute(o,"true"),D||w.setAttribute(l,"true")}catch(T){console.error("aria-hidden: cannot operate on ",w,T)}})};return v(a),h.clear(),Of++,function(){m.forEach(function(y){var w=Ms.get(y)-1,P=d.get(y)-1;Ms.set(y,w),d.set(y,P),w||(Ru.has(y)||y.removeAttribute(l),Ru.delete(y)),P||y.removeAttribute(o)}),Of--,Of||(Ms=new WeakMap,Ms=new WeakMap,Ru=new WeakMap,Fu={})}},l2=function(r,a,o){o===void 0&&(o="data-aria-hidden");var l=Array.from(Array.isArray(r)?r:[r]),f=o2(r);return f?(l.push.apply(l,Array.from(f.querySelectorAll("[aria-live], script"))),a2(l,f,o,"aria-hidden")):function(){return null}};function u2(r){const a=c2(r),o=F.forwardRef((l,f)=>{const{children:d,...m}=l,h=F.Children.toArray(d),x=h.find(f2);if(x){const p=x.props.children,v=h.map(y=>y===x?F.Children.count(p)>1?F.Children.only(null):F.isValidElement(p)?p.props.children:null:y);return R.jsx(a,{...m,ref:f,children:F.isValidElement(p)?F.cloneElement(p,void 0,v):null})}return R.jsx(a,{...m,ref:f,children:d})});return o.displayName=`${r}.Slot`,o}function c2(r){const a=F.forwardRef((o,l)=>{const{childre Line truncated
If you want to hide the \`${a.titleName}\`, you can wrap it with our VisuallyHidden component.
For more information, see https://radix-ui.com/primitives/docs/components/${a.docsSlug}`;return F.useEffect(()=>{r&&(document.getElementById(r)||console.error(o))},[o,r]),null},b2="DialogDescriptionWarning",C2=({contentRef:r,descriptionId:a})=>{const l=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${wg(b2).contentName}}.`;return F.useEffect(()=>{var d;const f=(d=r.current)==null?void 0:d.getAttribute("aria-describedby");a&&f&&(document.getElementById(a)||console.warn(l))},[l,r,a]),null},bg=ug,Cg=fg,Oc=hg,zc=pg,jc=Ag,Hc=xg,Eg=yg;const x0=bg,E2=Cg,kg=F.forwardRef(({className:r,...a},o)=>D.jsx(Oc,{ref:o,className:nt("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",r),...a}));kg.displayName=Oc.displayName;const Vc=F.forwardRef(({className:r,children:a,...o},l)=>D.jsxs(E2,{children:[D.jsx(kg,{}),D.jsxs(zc,{ref:l,className:nt("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",r),...o,children:[a,D.jsxs(Eg,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[D.jsx(PA,{className:"h-4 w-4"}),D.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Vc.displayName=zc.displayName;const Uc=({className:r,...a})=>D.jsx("div",{className:nt("flex flex-col space-y-1.5 text-center sm:text-left",r),...a});Uc.displayName="DialogHeader";const v0=({className:r,...a})=>D.jsx("div",{className:nt("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",r),...a});v0.displayName="DialogFooter";const Zc=F.forwardRef(({className:r,...a},o)=>D.jsx(jc,{ref:o,className:nt("text-lg font-semibold leading-none tracking-tight",r),...a}));Zc.displayName=jc.displayName;const k2=F.forwardRef(({className:r,...a},o)=>D.jsx(Hc,{ref:o,className:nt("text-sm text-muted-foreground",r),...a}));k2.displayName=Hc.displayName;function Xp(r){const a=S2(r),o=F.forwardRef((l,f)=>{const{children:d,...m}=l,h=F.Children.toArray(d),x=h.find(P2);if(x){const p=x.props.children,y=h.map(v=>v===x?F.Children.count(p)>1?F.Children.only(null):F.isValidElement(p)?p.props.children:null:v);return D.jsx(a,{...m,ref:f,children:F.isValidElement(p)?F.cloneElement(p,void 0,y):null})}return D.jsx(a,{...m,ref:f,children:d})});return o.displayName=`${r}.Slot`,o}function S2(r){const a=F.forwardRef((o,l)=>{const{children:f,...d}=o;if(F.isValidElement(f)){const m=D2(f),h=T2(d,f.props);return f.type!==F.Fragment&&(h.ref=l?sl(l,m):m),F.cloneElement(f,h)}return F.Children.count(f)>1?F.Children.only(null):null});return a.displayName=`${r}.SlotClone`,a}var B2=Symbol("radix.slottable");function P2(r){return F.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===B2}function T2(r,a){const o={...a};for(const l in a){const f=r[l],d=a[l];/^on[A-Z]/.test(l)?f&&d?o[l]=(...h)=>{const x=d(...h);return f(...h),x}:f&&(o[l]=f):l==="style"?o[l]={...f,...d}:l==="className"&&(o[l]=[f,d].filter(Boolean).join(" "))}return{...r,...o}}function D2(r){var l,f;let a=(l=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:l.get,o=a&&"isReactWarning"in a&&a.isReactWarning;return o?r.ref:(a=(f=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:f.get,o=a&&"isReactWarning"in a&&a.isReactWarning,o?r.props.ref:r.props.ref||r.ref)}function R2(r){const a=r+"CollectionProvider",[o,l]=al(a),[f,d]=o(a,{collectionRef:{current:null},itemMap:new Map}),m=C=>{const{scope:E,children:T}=C,P=be.useRef(null),k=be.useRef(new Map).current;return D.jsx(f,{scope:E,itemMap:k,collectionRef:P,children:T})};m.displayName=a;const h=r+"CollectionSlot",x=Xp(h),p=be.forwardRef((C,E)=>{const{scope:T,children:P}=C,k=d(h,T),N=xr(E,k.collectionRef);return D.jsx(x,{ref:N,children:P})});p.displayName=h;const y=r+"CollectionItemSlot",v="data-radix-collection-item",w=Xp(y),B=be.forwardRef((C,E)=>{const{scope:T,children:P,...k}=C,N=be.useRef(null),I=xr(E,N),z=d(y,T);return be.useEffect(()=>(z.itemMap.set(N,{ref:N,...k}),()=>void z.itemMap.delete(N))),D.jsx(w,{[v]:"",ref:I,children:P})});B.displayName=y;function R(C){const E=d(r+"CollectionConsumer",C);return be.useCallback(()=>{const P=E.collectionRef.current;if(!P)return[];const k=Array.from(P.querySelectorAll(`[${v}]`));return Array.from(E.itemMap.values()).sort((z,j)=>k.indexOf(z.ref.current)-k.indexOf(j.ref.current))},[E.coll Line truncated
For more information, see https://radix-ui.com/primitives/docs/components/${a.docsSlug}`;return F.useEffect(()=>{r&&(document.getElementById(r)||console.error(o))},[o,r]),null},b2="DialogDescriptionWarning",C2=({contentRef:r,descriptionId:a})=>{const l=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${wg(b2).contentName}}.`;return F.useEffect(()=>{var d;const f=(d=r.current)==null?void 0:d.getAttribute("aria-describedby");a&&f&&(document.getElementById(a)||console.warn(l))},[l,r,a]),null},bg=ug,Cg=fg,Oc=hg,zc=pg,jc=Ag,Hc=xg,Eg=yg;const x0=bg,E2=Cg,kg=F.forwardRef(({className:r,...a},o)=>R.jsx(Oc,{ref:o,className:nt("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",r),...a}));kg.displayName=Oc.displayName;const Vc=F.forwardRef(({className:r,children:a,...o},l)=>R.jsxs(E2,{children:[R.jsx(kg,{}),R.jsxs(zc,{ref:l,className:nt("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",r),...o,children:[a,R.jsxs(Eg,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[R.jsx(PA,{className:"h-4 w-4"}),R.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Vc.displayName=zc.displayName;const Uc=({className:r,...a})=>R.jsx("div",{className:nt("flex flex-col space-y-1.5 text-center sm:text-left",r),...a});Uc.displayName="DialogHeader";const v0=({className:r,...a})=>R.jsx("div",{className:nt("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",r),...a});v0.displayName="DialogFooter";const Zc=F.forwardRef(({className:r,...a},o)=>R.jsx(jc,{ref:o,className:nt("text-lg font-semibold leading-none tracking-tight",r),...a}));Zc.displayName=jc.displayName;const k2=F.forwardRef(({className:r,...a},o)=>R.jsx(Hc,{ref:o,className:nt("text-sm text-muted-foreground",r),...a}));k2.displayName=Hc.displayName;function Xp(r){const a=S2(r),o=F.forwardRef((l,f)=>{const{children:d,...m}=l,h=F.Children.toArray(d),x=h.find(P2);if(x){const p=x.props.children,v=h.map(y=>y===x?F.Children.count(p)>1?F.Children.only(null):F.isValidElement(p)?p.props.children:null:y);return R.jsx(a,{...m,ref:f,children:F.isValidElement(p)?F.cloneElement(p,void 0,v):null})}return R.jsx(a,{...m,ref:f,children:d})});return o.displayName=`${r}.Slot`,o}function S2(r){const a=F.forwardRef((o,l)=>{const{children:f,...d}=o;if(F.isValidElement(f)){const m=D2(f),h=T2(d,f.props);return f.type!==F.Fragment&&(h.ref=l?sl(l,m):m),F.cloneElement(f,h)}return F.Children.count(f)>1?F.Children.only(null):null});return a.displayName=`${r}.SlotClone`,a}var B2=Symbol("radix.slottable");function P2(r){return F.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===B2}function T2(r,a){const o={...a};for(const l in a){const f=r[l],d=a[l];/^on[A-Z]/.test(l)?f&&d?o[l]=(...h)=>{const x=d(...h);return f(...h),x}:f&&(o[l]=f):l==="style"?o[l]={...f,...d}:l==="className"&&(o[l]=[f,d].filter(Boolean).join(" "))}return{...r,...o}}function D2(r){var l,f;let a=(l=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:l.get,o=a&&"isReactWarning"in a&&a.isReactWarning;return o?r.ref:(a=(f=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:f.get,o=a&&"isReactWarning"in a&&a.isReactWarning,o?r.props.ref:r.props.ref||r.ref)}function R2(r){const a=r+"CollectionProvider",[o,l]=al(a),[f,d]=o(a,{collectionRef:{current:null},itemMap:new Map}),m=C=>{const{scope:E,children:T}=C,B=be.useRef(null),k=be.useRef(new Map).current;return R.jsx(f,{scope:E,itemMap:k,collectionRef:B,children:T})};m.displayName=a;const h=r+"CollectionSlot",x=Xp(h),p=be.forwardRef((C,E)=>{const{scope:T,children:B}=C,k=d(h,T),N=gr(E,k.collectionRef);return R.jsx(x,{ref:N,children:B})});p.displayName=h;const v=r+"CollectionItemSlot",y="data-radix-collection-item",w=Xp(v),P=be.forwardRef((C,E)=>{const{scope:T,children:B,...k}=C,N=be.useRef(null),I=gr(E,N),z=d(v,T);return be.useEffect(()=>(z.itemMap.set(N,{ref:N,...k}),()=>void z.itemMap.delete(N))),R.jsx(w,{[y]:"",ref:I,children:B})});P.displayName=v;function D(C){const E=d(r+"CollectionConsumer",C);return be.useCallback(()=>{const B=E.collectionRef.current;if(!B)return[];const k=Array.from(B.querySelectorAll(`[${y}]`));return Array.from(E.itemMap.values()).sort((z,j)=>k.indexOf(z.ref.current)-k.indexOf(j.ref.current))},[E.coll Line truncated
* Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com
* (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade
*/var Bw=el.exports,tm;function Pw(){return tm||(tm=1,(function(r,a){(function(o,l){l(a)})(Bw,(function(o){var l="1.9.4";function f(t){var i,u,A,b;for(u=1,A=arguments.length;u<A;u++){b=arguments[u];for(i in b)t[i]=b[i]}return t}var d=Object.create||(function(){function t(){}return function(i){return t.prototype=i,new t}})();function m(t,i){var u=Array.prototype.slice;if(t.bind)return t.bind.apply(t,u.call(arguments,1));var A=u.call(arguments,2);return function(){return t.apply(i,A.length?A.concat(u.call(arguments)):arguments)}}var h=0;function x(t){return"_leaflet_id"in t||(t._leaflet_id=++h),t._leaflet_id}function p(t,i,u){var A,b,O,Q;return Q=function(){A=!1,b&&(O.apply(u,b),b=!1)},O=function(){A?b=arguments:(t.apply(u,arguments),setTimeout(Q,i),A=!0)},O}function y(t,i,u){var A=i[1],b=i[0],O=A-b;return t===A&&u?t:((t-b)%O+O)%O+b}function v(){return!1}function w(t,i){if(i===!1)return t;var u=Math.pow(10,i===void 0?6:i);return Math.round(t*u)/u}function B(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function R(t){return B(t).split(/\s+/)}function C(t,i){Object.prototype.hasOwnProperty.call(t,"options")||(t.options=t.options?d(t.options):{});for(var u in i)t.options[u]=i[u];return t.options}function E(t,i,u){var A=[];for(var b in t)A.push(encodeURIComponent(u?b.toUpperCase():b)+"="+encodeURIComponent(t[b]));return(!i||i.indexOf("?")===-1?"?":"&")+A.join("&")}var T=/\{ *([\w_ -]+) *\}/g;function P(t,i){return t.replace(T,function(u,A){var b=i[A];if(b===void 0)throw new Error("No value provided for variable "+u);return typeof b=="function"&&(b=b(i)),b})}var k=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"};function N(t,i){for(var u=0;u<t.length;u++)if(t[u]===i)return u;return-1}var I="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function z(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var j=0;function H(t){var i=+new Date,u=Math.max(0,16-(i-j));return j=i+u,window.setTimeout(t,u)}var $=window.requestAnimationFrame||z("RequestAnimationFrame")||H,U=window.cancelAnimationFrame||z("CancelAnimationFrame")||z("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function G(t,i,u){if(u&&$===H)t.call(i);else return $.call(window,m(t,i))}function ne(t){t&&U.call(window,t)}var ee={__proto__:null,extend:f,create:d,bind:m,get lastId(){return h},stamp:x,throttle:p,wrapNum:y,falseFn:v,formatNum:w,trim:B,splitWords:R,setOptions:C,getParamString:E,template:P,isArray:k,indexOf:N,emptyImageUrl:I,requestFn:$,cancelFn:U,requestAnimFrame:G,cancelAnimFrame:ne};function oe(){}oe.extend=function(t){var i=function(){C(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},u=i.__super__=this.prototype,A=d(u);A.constructor=i,i.prototype=A;for(var b in this)Object.prototype.hasOwnProperty.call(this,b)&&b!=="prototype"&&b!=="__super__"&&(i[b]=this[b]);return t.statics&&f(i,t.statics),t.includes&&(de(t.includes),f.apply(null,[A].concat(t.includes))),f(A,t),delete A.statics,delete A.includes,A.options&&(A.options=u.options?d(u.options):{},f(A.options,t.options)),A._initHooks=[],A.callInitHooks=function(){if(!this._initHooksCalled){u.callInitHooks&&u.callInitHooks.call(this),this._initHooksCalled=!0;for(var O=0,Q=A._initHooks.length;O<Q;O++)A._initHooks[O].call(this)}},i},oe.include=function(t){var i=this.prototype.options;return f(this.prototype,t),t.options&&(this.prototype.options=i,this.mergeOptions(t.options)),this},oe.mergeOptions=function(t){return f(this.prototype.options,t),this},oe.addInitHook=function(t){var i=Array.prototype.slice.call(arguments,1),u=typeof t=="function"?t:function(){this[t].apply(this,i)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(u),this};function de(t){if(!(typeof L>"u"||!L||!L.Mixin)){t=k(t)?t:[t];for(var i=0;i<t.length;i++)t[i]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",new Error().stack)}}var le={on:function(t,i,u){if(typeof t=="object")for(var A in t)this._on(A,t[A],i);else{t=R(t);for(var b=0,O=t.length;b<O;b++)this._on(t[b],i,u)}return this},off:function(t,i,u){if(!arguments.length)delete this._events;else if(typeof t=="object")for(var A in t)this._off(A,t[A],i);else{t=R(t);for(var b=arguments.length===1,O=0,Q=t.length;O<Q;O++)b?this._off(t[O]):this._off(t[O],i,u)}return this},_on:function(t,i,u,A){if(typeof i!="function"){console.warn("wrong listener type: "+typeof i);return}if(this._listens(t,i,u)===!1){u===this&&(u=void 0);var b={fn:i,ctx:u};A&&(b.once=!0),this._events=this._events||{},this._events[t]=this._events[t]||[],this._events[t].push(b)}},_off:function(t,i,u){var A,b,O;if(this._events&&(A=this._events[t],!!A)){if(arguments.length===1){if(this._firingCount)for(b=0,O=A.length;b<O;b++)A[b].fn=v;delete this._events[t];return}if(typeof i!="function"){console.warn("wrong listener type: "+typeof i);return}var Q=thisLine truncated
*/var Bw=el.exports,tm;function Pw(){return tm||(tm=1,(function(r,a){(function(o,l){l(a)})(Bw,(function(o){var l="1.9.4";function f(t){var i,u,A,b;for(u=1,A=arguments.length;u<A;u++){b=arguments[u];for(i in b)t[i]=b[i]}return t}var d=Object.create||(function(){function t(){}return function(i){return t.prototype=i,new t}})();function m(t,i){var u=Array.prototype.slice;if(t.bind)return t.bind.apply(t,u.call(arguments,1));var A=u.call(arguments,2);return function(){return t.apply(i,A.length?A.concat(u.call(arguments)):arguments)}}var h=0;function x(t){return"_leaflet_id"in t||(t._leaflet_id=++h),t._leaflet_id}function p(t,i,u){var A,b,O,Q;return Q=function(){A=!1,b&&(O.apply(u,b),b=!1)},O=function(){A?b=arguments:(t.apply(u,arguments),setTimeout(Q,i),A=!0)},O}function v(t,i,u){var A=i[1],b=i[0],O=A-b;return t===A&&u?t:((t-b)%O+O)%O+b}function y(){return!1}function w(t,i){if(i===!1)return t;var u=Math.pow(10,i===void 0?6:i);return Math.round(t*u)/u}function P(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function D(t){return P(t).split(/\s+/)}function C(t,i){Object.prototype.hasOwnProperty.call(t,"options")||(t.options=t.options?d(t.options):{});for(var u in i)t.options[u]=i[u];return t.options}function E(t,i,u){var A=[];for(var b in t)A.push(encodeURIComponent(u?b.toUpperCase():b)+"="+encodeURIComponent(t[b]));return(!i||i.indexOf("?")===-1?"?":"&")+A.join("&")}var T=/\{ *([\w_ -]+) *\}/g;function B(t,i){return t.replace(T,function(u,A){var b=i[A];if(b===void 0)throw new Error("No value provided for variable "+u);return typeof b=="function"&&(b=b(i)),b})}var k=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"};function N(t,i){for(var u=0;u<t.length;u++)if(t[u]===i)return u;return-1}var I="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function z(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var j=0;function H(t){var i=+new Date,u=Math.max(0,16-(i-j));return j=i+u,window.setTimeout(t,u)}var $=window.requestAnimationFrame||z("RequestAnimationFrame")||H,U=window.cancelAnimationFrame||z("CancelAnimationFrame")||z("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function G(t,i,u){if(u&&$===H)t.call(i);else return $.call(window,m(t,i))}function ne(t){t&&U.call(window,t)}var ee={__proto__:null,extend:f,create:d,bind:m,get lastId(){return h},stamp:x,throttle:p,wrapNum:v,falseFn:y,formatNum:w,trim:P,splitWords:D,setOptions:C,getParamString:E,template:B,isArray:k,indexOf:N,emptyImageUrl:I,requestFn:$,cancelFn:U,requestAnimFrame:G,cancelAnimFrame:ne};function oe(){}oe.extend=function(t){var i=function(){C(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},u=i.__super__=this.prototype,A=d(u);A.constructor=i,i.prototype=A;for(var b in this)Object.prototype.hasOwnProperty.call(this,b)&&b!=="prototype"&&b!=="__super__"&&(i[b]=this[b]);return t.statics&&f(i,t.statics),t.includes&&(de(t.includes),f.apply(null,[A].concat(t.includes))),f(A,t),delete A.statics,delete A.includes,A.options&&(A.options=u.options?d(u.options):{},f(A.options,t.options)),A._initHooks=[],A.callInitHooks=function(){if(!this._initHooksCalled){u.callInitHooks&&u.callInitHooks.call(this),this._initHooksCalled=!0;for(var O=0,Q=A._initHooks.length;O<Q;O++)A._initHooks[O].call(this)}},i},oe.include=function(t){var i=this.prototype.options;return f(this.prototype,t),t.options&&(this.prototype.options=i,this.mergeOptions(t.options)),this},oe.mergeOptions=function(t){return f(this.prototype.options,t),this},oe.addInitHook=function(t){var i=Array.prototype.slice.call(arguments,1),u=typeof t=="function"?t:function(){this[t].apply(this,i)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(u),this};function de(t){if(!(typeof L>"u"||!L||!L.Mixin)){t=k(t)?t:[t];for(var i=0;i<t.length;i++)t[i]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",new Error().stack)}}var le={on:function(t,i,u){if(typeof t=="object")for(var A in t)this._on(A,t[A],i);else{t=D(t);for(var b=0,O=t.length;b<O;b++)this._on(t[b],i,u)}return this},off:function(t,i,u){if(!arguments.length)delete this._events;else if(typeof t=="object")for(var A in t)this._off(A,t[A],i);else{t=D(t);for(var b=arguments.length===1,O=0,Q=t.length;O<Q;O++)b?this._off(t[O]):this._off(t[O],i,u)}return this},_on:function(t,i,u,A){if(typeof i!="function"){console.warn("wrong listener type: "+typeof i);return}if(this._listens(t,i,u)===!1){u===this&&(u=void 0);var b={fn:i,ctx:u};A&&(b.once=!0),this._events=this._events||{},this._events[t]=this._events[t]||[],this._events[t].push(b)}},_off:function(t,i,u){var A,b,O;if(this._events&&(A=this._events[t],!!A)){if(arguments.length===1){if(this._firingCount)for(b=0,O=A.length;b<O;b++)A[b].fn=y;delete this._events[t];return}if(typeof i!="function"){console.warn("wrong listener type: "+typeof i);return}var Q=thisLine truncated
(c) 2012 by Cédric Mesnil. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
@@ -134,17 +134,17 @@ For more information, see https://radix-ui.com/primitives/docs/components/${a.do
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/return(function(l){var f=o,d=f.lib,m=d.WordArray,h=d.Hasher,x=f.algo,p=m.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),y=m.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),v=m.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),w=m.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),B=m.create([0,1518500249,1859775393,2400959708,2840853838]),R=m.create([1352829926,1548603684,1836072691,2053994217,0]),C=x.RIPEMD160=h.extend({_doReset:function(){this._hash=m.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(z,j){for(var H=0;H<16;H++){var $=j+H,U=z[$];z[$]=(U<<8|U>>>24)&16711935|(U<<24|U>>>8)&4278255360}var G=this._hash.words,ne=B.words,ee=R.words,oe=p.words,de=y.words,le=v.words,fe=w.words,q,J,W,S,V,K,Y,he,pe,Ee;K=q=G[0],Y=J=G[1],he=W=G[2],pe=S=G[3],Ee=V=G[4];for(var ge,H=0;H<80;H+=1)ge=q+z[j+oe[H]]|0,H<16?ge+=E(J,W,S)+ne[0]:H<32?ge+=T(J,W,S)+ne[1]:H<48?ge+=P(J,W,S)+ne[2]:H<64?ge+=k(J,W,S)+ne[3]:ge+=N(J,W,S)+ne[4],ge=ge|0,ge=I(ge,le[H]),ge=ge+V|0,q=V,V=S,S=I(W,10),W=J,J=ge,ge=K+z[j+de[H]]|0,H<16?ge+=N(Y,he,pe)+ee[0]:H<32?ge+=k(Y,he,pe)+ee[1]:H<48?ge+=P(Y,he,pe)+ee[2]:H<64?ge+=T(Y,he,pe)+ee[3]:ge+=E(Y,he,pe)+ee[4],ge=ge|0,ge=I(ge,fe[H]),ge=ge+Ee|0,K=Ee,Ee=pe,pe=I(he,10),he=Y,Y=ge;ge=G[1]+W+pe|0,G[1]=G[2]+S+Ee|0,G[2]=G[3]+V+K|0,G[3]=G[4]+q+Y|0,G[4]=G[0]+J+he|0,G[0]=ge},_doFinalize:function(){var z=this._data,j=z.words,H=this._nDataBytes*8,$=z.sigBytes*8;j[$>>>5]|=128<<24-$%32,j[($+64>>>9<<4)+14]=(H<<8|H>>>24)&16711935|(H<<24|H>>>8)&4278255360,z.sigBytes=(j.length+1)*4,this._process();for(var U=this._hash,G=U.words,ne=0;ne<5;ne++){var ee=G[ne];G[ne]=(ee<<8|ee>>>24)&16711935|(ee<<24|ee>>>8)&4278255360}return U},clone:function(){var z=h.clone.call(this);return z._hash=this._hash.clone(),z}});function E(z,j,H){return z^j^H}function T(z,j,H){return z&j|~z&H}function P(z,j,H){return(z|~j)^H}function k(z,j,H){return z&H|j&~H}function N(z,j,H){return z^(j|~H)}function I(z,j){return z<<j|z>>>32-j}f.RIPEMD160=h._createHelper(C),f.HmacRIPEMD160=h._createHmacHelper(C)})(),o.RIPEMD160})})(Ju)),Ju.exports}var ec={exports:{}},xb=ec.exports,ym;function Yc(){return ym||(ym=1,(function(r,a){(function(o,l){r.exports=l(ft())})(xb,function(o){(function(){var l=o,f=l.lib,d=f.Base,m=l.enc,h=m.Utf8,x=l.algo;x.HMAC=d.extend({init:function(p,y){p=this._hasher=new p.init,typeof y=="string"&&(y=h.parse(y));var v=p.blockSize,w=v*4;y.sigBytes>w&&(y=p.finalize(y)),y.clamp();for(var B=this._oKey=y.clone(),R=this._iKey=y.clone(),C=B.words,E=R.words,T=0;T<v;T++)C[T]^=1549556828,E[T]^=909522486;B.sigBytes=R.sigBytes=w,this.reset()},reset:function(){var p=this._hasher;p.reset(),p.update(this._iKey)},update:function(p){return this._hasher.update(p),this},finalize:function(p){var y=this._hasher,v=y.finalize(p);y.reset();var w=y.finalize(this._oKey.clone().concat(v));return w}})})()})})(ec)),ec.exports}var tc={exports:{}},vb=tc.exports,_m;function yb(){return _m||(_m=1,(function(r,a){(function(o,l,f){r.exports=l(ft(),ul(),Yc())})(vb,function(o){return(function(){var l=o,f=l.lib,d=f.Base,m=f.WordArray,h=l.algo,x=h.SHA256,p=h.HMAC,y=h.PBKDF2=d.extend({cfg:d.extend({keySize:128/32,hasher:x,iterations:25e4}),init:function(v){this.cfg=this.cfg.extend(v)},compute:function(v,w){for(var B=this.cfg,R=p.create(B.hasher,v),C=m.create(),E=m.create([1]),T=C.words,P=E.words,k=B.keySize,N=B.iterations;T.length<k;){var I=R.update(w).finalize(E);R.reset();for(var z=I.words,j=z.length,H=I,$=1;$<N;$++){H=R.finalize(H),R.reset();for(var U=H.words,G=0;G<j;G++)z[G]^=U[G]}C.concat(I),P[0]++}return C.sigBytes=k*4,C}});l.PBKDF2=function(v,w,B){return y.create(B).compute(v,w)}})(),o.PBKDF2})})(tc)),tc.exports}var nc={exports:{}},_b=nc.exports,wm;function ao(){return wm||(wm=1,(function(r,a){(function(o,l,f){r.exports=l(ft(),fx(),Yc())})(_b,function(o){return(function(){var l=o,f=l.lib,d=f.Base,m=f.WordArray,h=l.algo,x=h.MD5,p=h.EvpKDF=d.extend({cfg:d.extend({keySize:128/32,hasher:x,iterations:1}),init:function(y){this.cfg=this.cfg.extend(y)},compute:function(y,v){for(var w,B=this.cfg,R=B.hasher.create(),C=m.create(),E=C.words,T=B.keySize,P=B.iterations;E.length<T;){w&&R.update(w),w=R.update(y).finalize(v),R.reset();for(var k=1;k<P;k++)w=R.finalize(w),R.reset();C.concat(w)}return C.sigBytes=T*4,C}});l.EvpKDF=function(y,v,w){return p.create(w).compute(y,v)}})(),o.EvpKDF})})(nc)),nc.exports}var rc={exports:{}},wb=rc.exportsLine truncated
*/return(function(l){var f=o,d=f.lib,m=d.WordArray,h=d.Hasher,x=f.algo,p=m.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),v=m.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),y=m.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),w=m.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),P=m.create([0,1518500249,1859775393,2400959708,2840853838]),D=m.create([1352829926,1548603684,1836072691,2053994217,0]),C=x.RIPEMD160=h.extend({_doReset:function(){this._hash=m.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(z,j){for(var H=0;H<16;H++){var $=j+H,U=z[$];z[$]=(U<<8|U>>>24)&16711935|(U<<24|U>>>8)&4278255360}var G=this._hash.words,ne=P.words,ee=D.words,oe=p.words,de=v.words,le=y.words,fe=w.words,q,J,W,S,V,K,Y,he,pe,Ee;K=q=G[0],Y=J=G[1],he=W=G[2],pe=S=G[3],Ee=V=G[4];for(var ge,H=0;H<80;H+=1)ge=q+z[j+oe[H]]|0,H<16?ge+=E(J,W,S)+ne[0]:H<32?ge+=T(J,W,S)+ne[1]:H<48?ge+=B(J,W,S)+ne[2]:H<64?ge+=k(J,W,S)+ne[3]:ge+=N(J,W,S)+ne[4],ge=ge|0,ge=I(ge,le[H]),ge=ge+V|0,q=V,V=S,S=I(W,10),W=J,J=ge,ge=K+z[j+de[H]]|0,H<16?ge+=N(Y,he,pe)+ee[0]:H<32?ge+=k(Y,he,pe)+ee[1]:H<48?ge+=B(Y,he,pe)+ee[2]:H<64?ge+=T(Y,he,pe)+ee[3]:ge+=E(Y,he,pe)+ee[4],ge=ge|0,ge=I(ge,fe[H]),ge=ge+Ee|0,K=Ee,Ee=pe,pe=I(he,10),he=Y,Y=ge;ge=G[1]+W+pe|0,G[1]=G[2]+S+Ee|0,G[2]=G[3]+V+K|0,G[3]=G[4]+q+Y|0,G[4]=G[0]+J+he|0,G[0]=ge},_doFinalize:function(){var z=this._data,j=z.words,H=this._nDataBytes*8,$=z.sigBytes*8;j[$>>>5]|=128<<24-$%32,j[($+64>>>9<<4)+14]=(H<<8|H>>>24)&16711935|(H<<24|H>>>8)&4278255360,z.sigBytes=(j.length+1)*4,this._process();for(var U=this._hash,G=U.words,ne=0;ne<5;ne++){var ee=G[ne];G[ne]=(ee<<8|ee>>>24)&16711935|(ee<<24|ee>>>8)&4278255360}return U},clone:function(){var z=h.clone.call(this);return z._hash=this._hash.clone(),z}});function E(z,j,H){return z^j^H}function T(z,j,H){return z&j|~z&H}function B(z,j,H){return(z|~j)^H}function k(z,j,H){return z&H|j&~H}function N(z,j,H){return z^(j|~H)}function I(z,j){return z<<j|z>>>32-j}f.RIPEMD160=h._createHelper(C),f.HmacRIPEMD160=h._createHmacHelper(C)})(),o.RIPEMD160})})(Ju)),Ju.exports}var ec={exports:{}},xb=ec.exports,ym;function Yc(){return ym||(ym=1,(function(r,a){(function(o,l){r.exports=l(ft())})(xb,function(o){(function(){var l=o,f=l.lib,d=f.Base,m=l.enc,h=m.Utf8,x=l.algo;x.HMAC=d.extend({init:function(p,v){p=this._hasher=new p.init,typeof v=="string"&&(v=h.parse(v));var y=p.blockSize,w=y*4;v.sigBytes>w&&(v=p.finalize(v)),v.clamp();for(var P=this._oKey=v.clone(),D=this._iKey=v.clone(),C=P.words,E=D.words,T=0;T<y;T++)C[T]^=1549556828,E[T]^=909522486;P.sigBytes=D.sigBytes=w,this.reset()},reset:function(){var p=this._hasher;p.reset(),p.update(this._iKey)},update:function(p){return this._hasher.update(p),this},finalize:function(p){var v=this._hasher,y=v.finalize(p);v.reset();var w=v.finalize(this._oKey.clone().concat(y));return w}})})()})})(ec)),ec.exports}var tc={exports:{}},vb=tc.exports,_m;function yb(){return _m||(_m=1,(function(r,a){(function(o,l,f){r.exports=l(ft(),ul(),Yc())})(vb,function(o){return(function(){var l=o,f=l.lib,d=f.Base,m=f.WordArray,h=l.algo,x=h.SHA256,p=h.HMAC,v=h.PBKDF2=d.extend({cfg:d.extend({keySize:128/32,hasher:x,iterations:25e4}),init:function(y){this.cfg=this.cfg.extend(y)},compute:function(y,w){for(var P=this.cfg,D=p.create(P.hasher,y),C=m.create(),E=m.create([1]),T=C.words,B=E.words,k=P.keySize,N=P.iterations;T.length<k;){var I=D.update(w).finalize(E);D.reset();for(var z=I.words,j=z.length,H=I,$=1;$<N;$++){H=D.finalize(H),D.reset();for(var U=H.words,G=0;G<j;G++)z[G]^=U[G]}C.concat(I),B[0]++}return C.sigBytes=k*4,C}});l.PBKDF2=function(y,w,P){return v.create(P).compute(y,w)}})(),o.PBKDF2})})(tc)),tc.exports}var nc={exports:{}},_b=nc.exports,wm;function ao(){return wm||(wm=1,(function(r,a){(function(o,l,f){r.exports=l(ft(),fx(),Yc())})(_b,function(o){return(function(){var l=o,f=l.lib,d=f.Base,m=f.WordArray,h=l.algo,x=h.MD5,p=h.EvpKDF=d.extend({cfg:d.extend({keySize:128/32,hasher:x,iterations:1}),init:function(v){this.cfg=this.cfg.extend(v)},compute:function(v,y){for(var w,P=this.cfg,D=P.hasher.create(),C=m.create(),E=C.words,T=P.keySize,B=P.iterations;E.length<T;){w&&D.update(w),w=D.update(v).finalize(y),D.reset();for(var k=1;k<B;k++)w=D.finalize(w),D.reset();C.concat(w)}return C.sigBytes=T*4,C}});l.EvpKDF=function(v,y,w){return p.create(w).compute(v,y)}})(),o.EvpKDF})})(nc)),nc.exports}var rc={exports:{}},wb=rc.exportsLine truncated
* Counter block mode compatible with Dr Brian Gladman fileenc.c
* derived from CryptoJS.mode.CTR
* Jan Hruby jhruby.web@gmail.com
*/return o.mode.CTRGladman=(function(){var l=o.lib.BlockCipherMode.extend();function f(h){if((h>>24&255)===255){var x=h>>16&255,p=h>>8&255,y=h&255;x===255?(x=0,p===255?(p=0,y===255?y=0:++y):++p):++x,h=0,h+=x<<16,h+=p<<8,h+=y}else h+=1<<24;return h}function d(h){return(h[0]=f(h[0]))===0&&(h[1]=f(h[1])),h}var m=l.Encryptor=l.extend({processBlock:function(h,x){var p=this._cipher,y=p.blockSize,v=this._iv,w=this._counter;v&&(w=this._counter=v.slice(0),this._iv=void 0),d(w);var B=w.slice(0);p.encryptBlock(B,0);for(var R=0;R<y;R++)h[x+R]^=B[R]}});return l.Decryptor=m,l})(),o.mode.CTRGladman})})(sc)),sc.exports}var ac={exports:{}},Pb=ac.exports,Sm;function Tb(){return Sm||(Sm=1,(function(r,a){(function(o,l,f){r.exports=l(ft(),fn())})(Pb,function(o){return o.mode.OFB=(function(){var l=o.lib.BlockCipherMode.extend(),f=l.Encryptor=l.extend({processBlock:function(d,m){var h=this._cipher,x=h.blockSize,p=this._iv,y=this._keystream;p&&(y=this._keystream=p.slice(0),this._iv=void 0),h.encryptBlock(y,0);for(var v=0;v<x;v++)d[m+v]^=y[v]}});return l.Decryptor=f,l})(),o.mode.OFB})})(ac)),ac.exports}var lc={exports:{}},Db=lc.exports,Bm;function Rb(){return Bm||(Bm=1,(function(r,a){(function(o,l,f){r.exports=l(ft(),fn())})(Db,function(o){return o.mode.ECB=(function(){var l=o.lib.BlockCipherMode.extend();return l.Encryptor=l.extend({processBlock:function(f,d){this._cipher.encryptBlock(f,d)}}),l.Decryptor=l.extend({processBlock:function(f,d){this._cipher.decryptBlock(f,d)}}),l})(),o.mode.ECB})})(lc)),lc.exports}var uc={exports:{}},Fb=uc.exports,Pm;function Nb(){return Pm||(Pm=1,(function(r,a){(function(o,l,f){r.exports=l(ft(),fn())})(Fb,function(o){return o.pad.AnsiX923={pad:function(l,f){var d=l.sigBytes,m=f*4,h=m-d%m,x=d+h-1;l.clamp(),l.words[x>>>2]|=h<<24-x%4*8,l.sigBytes+=h},unpad:function(l){var f=l.words[l.sigBytes-1>>>2]&255;l.sigBytes-=f}},o.pad.Ansix923})})(uc)),uc.exports}var cc={exports:{}},Lb=cc.exports,Tm;function Mb(){return Tm||(Tm=1,(function(r,a){(function(o,l,f){r.exports=l(ft(),fn())})(Lb,function(o){return o.pad.Iso10126={pad:function(l,f){var d=f*4,m=d-l.sigBytes%d;l.concat(o.lib.WordArray.random(m-1)).concat(o.lib.WordArray.create([m<<24],1))},unpad:function(l){var f=l.words[l.sigBytes-1>>>2]&255;l.sigBytes-=f}},o.pad.Iso10126})})(cc)),cc.exports}var dc={exports:{}},Ib=dc.exports,Dm;function Ob(){return Dm||(Dm=1,(function(r,a){(function(o,l,f){r.exports=l(ft(),fn())})(Ib,function(o){return o.pad.Iso97971={pad:function(l,f){l.concat(o.lib.WordArray.create([2147483648],1)),o.pad.ZeroPadding.pad(l,f)},unpad:function(l){o.pad.ZeroPadding.unpad(l),l.sigBytes--}},o.pad.Iso97971})})(dc)),dc.exports}var fc={exports:{}},zb=fc.exports,Rm;function jb(){return Rm||(Rm=1,(function(r,a){(function(o,l,f){r.exports=l(ft(),fn())})(zb,function(o){return o.pad.ZeroPadding={pad:function(l,f){var d=f*4;l.clamp(),l.sigBytes+=d-(l.sigBytes%d||d)},unpad:function(l){for(var f=l.words,d=l.sigBytes-1,d=l.sigBytes-1;d>=0;d--)if(f[d>>>2]>>>24-d%4*8&255){l.sigBytes=d+1;break}}},o.pad.ZeroPadding})})(fc)),fc.exports}var hc={exports:{}},Hb=hc.exports,Fm;function Vb(){return Fm||(Fm=1,(function(r,a){(function(o,l,f){r.exports=l(ft(),fn())})(Hb,function(o){return o.pad.NoPadding={pad:function(){},unpad:function(){}},o.pad.NoPadding})})(hc)),hc.exports}var pc={exports:{}},Ub=pc.exports,Nm;function Zb(){return Nm||(Nm=1,(function(r,a){(function(o,l,f){r.exports=l(ft(),fn())})(Ub,function(o){return(function(l){var f=o,d=f.lib,m=d.CipherParams,h=f.enc,x=h.Hex,p=f.format;p.Hex={stringify:function(y){return y.ciphertext.toString(x)},parse:function(y){var v=x.parse(y);return m.create({ciphertext:v})}}})(),o.format.Hex})})(pc)),pc.exports}var mc={exports:{}},Wb=mc.exports,Lm;function qb(){return Lm||(Lm=1,(function(r,a){(function(o,l,f){r.exports=l(ft(),Wo(),qo(),ao(),fn())})(Wb,function(o){return(function(){var l=o,f=l.lib,d=f.BlockCipher,m=l.algo,h=[],x=[],p=[],y=[],v=[],w=[],B=[],R=[],C=[],E=[];(function(){for(var k=[],N=0;N<256;N++)N<128?k[N]=N<<1:k[N]=N<<1^283;for(var I=0,z=0,N=0;N<256;N++){var j=z^z<<1^z<<2^z<<3^z<<4;j=j>>>8^j&255^99,h[I]=j,x[j]=I;var H=k[I],$=k[H],U=k[$],G=k[j]*257^j*16843008;p[I]=G<<24|G>>>8,y[I]=G<<16|G>>>16,v[I]=G<<8|G>>>24,w[I]=G;var G=U*16843009^$*65537^H*257^I*16843008;B[j]=G<<24|G>>>8,R[j]=G<<16|G>>>16,C[j]=G<<8|G>>>24,E[j]=G,I?(I=H^k[k[k[U^H]]],z^=k[k[z]]):I=z=1}})();var T=[0,1,2,4,8,16,32,64,128,27,54],P=m.AES=d.extend({_doReset:function(){var k;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var N=this._keyPriorReset=this._key,I=N.words,z=N.sigBytes/4,j=this._nRounds=z+6,H=(j+1)*4,$=this._keySchedule=[],U=0;U<H;U++)U<z?$[U]=I[U]:(k=$[U-1],U%z?z>6&&U%z==4&&(k=h[k>>>24]<<24|h[k>>>16&255]<<16|h[k>>>8&255]<<8|h[k&255]):(k=k<<8|k>>>24,k=h[k>>>24]<<24|h[k>>>16&255]<<16|h[k>>>8&255]<<8|h[k&255],k^=T[U/z|0]<<24),$[U]=$[U-z]^k);for(var G=this._invKeySchedule=[],ne=0;ne<H;ne++){var U=H-ne;if(ne%4)var k=$[U];else var k=$[U-4];ne<4||U<=4?G[ne]=k:G[ne]=B[h[k>>>24]]^R[h[k>>>16&255]]^C[h[k>>>8&255]]^E[h[k&255]]}}},encryLine truncated
*/return o.mode.CTRGladman=(function(){var l=o.lib.BlockCipherMode.extend();function f(h){if((h>>24&255)===255){var x=h>>16&255,p=h>>8&255,v=h&255;x===255?(x=0,p===255?(p=0,v===255?v=0:++v):++p):++x,h=0,h+=x<<16,h+=p<<8,h+=v}else h+=1<<24;return h}function d(h){return(h[0]=f(h[0]))===0&&(h[1]=f(h[1])),h}var m=l.Encryptor=l.extend({processBlock:function(h,x){var p=this._cipher,v=p.blockSize,y=this._iv,w=this._counter;y&&(w=this._counter=y.slice(0),this._iv=void 0),d(w);var P=w.slice(0);p.encryptBlock(P,0);for(var D=0;D<v;D++)h[x+D]^=P[D]}});return l.Decryptor=m,l})(),o.mode.CTRGladman})})(sc)),sc.exports}var ac={exports:{}},Pb=ac.exports,Sm;function Tb(){return Sm||(Sm=1,(function(r,a){(function(o,l,f){r.exports=l(ft(),fn())})(Pb,function(o){return o.mode.OFB=(function(){var l=o.lib.BlockCipherMode.extend(),f=l.Encryptor=l.extend({processBlock:function(d,m){var h=this._cipher,x=h.blockSize,p=this._iv,v=this._keystream;p&&(v=this._keystream=p.slice(0),this._iv=void 0),h.encryptBlock(v,0);for(var y=0;y<x;y++)d[m+y]^=v[y]}});return l.Decryptor=f,l})(),o.mode.OFB})})(ac)),ac.exports}var lc={exports:{}},Db=lc.exports,Bm;function Rb(){return Bm||(Bm=1,(function(r,a){(function(o,l,f){r.exports=l(ft(),fn())})(Db,function(o){return o.mode.ECB=(function(){var l=o.lib.BlockCipherMode.extend();return l.Encryptor=l.extend({processBlock:function(f,d){this._cipher.encryptBlock(f,d)}}),l.Decryptor=l.extend({processBlock:function(f,d){this._cipher.decryptBlock(f,d)}}),l})(),o.mode.ECB})})(lc)),lc.exports}var uc={exports:{}},Fb=uc.exports,Pm;function Nb(){return Pm||(Pm=1,(function(r,a){(function(o,l,f){r.exports=l(ft(),fn())})(Fb,function(o){return o.pad.AnsiX923={pad:function(l,f){var d=l.sigBytes,m=f*4,h=m-d%m,x=d+h-1;l.clamp(),l.words[x>>>2]|=h<<24-x%4*8,l.sigBytes+=h},unpad:function(l){var f=l.words[l.sigBytes-1>>>2]&255;l.sigBytes-=f}},o.pad.Ansix923})})(uc)),uc.exports}var cc={exports:{}},Lb=cc.exports,Tm;function Mb(){return Tm||(Tm=1,(function(r,a){(function(o,l,f){r.exports=l(ft(),fn())})(Lb,function(o){return o.pad.Iso10126={pad:function(l,f){var d=f*4,m=d-l.sigBytes%d;l.concat(o.lib.WordArray.random(m-1)).concat(o.lib.WordArray.create([m<<24],1))},unpad:function(l){var f=l.words[l.sigBytes-1>>>2]&255;l.sigBytes-=f}},o.pad.Iso10126})})(cc)),cc.exports}var dc={exports:{}},Ib=dc.exports,Dm;function Ob(){return Dm||(Dm=1,(function(r,a){(function(o,l,f){r.exports=l(ft(),fn())})(Ib,function(o){return o.pad.Iso97971={pad:function(l,f){l.concat(o.lib.WordArray.create([2147483648],1)),o.pad.ZeroPadding.pad(l,f)},unpad:function(l){o.pad.ZeroPadding.unpad(l),l.sigBytes--}},o.pad.Iso97971})})(dc)),dc.exports}var fc={exports:{}},zb=fc.exports,Rm;function jb(){return Rm||(Rm=1,(function(r,a){(function(o,l,f){r.exports=l(ft(),fn())})(zb,function(o){return o.pad.ZeroPadding={pad:function(l,f){var d=f*4;l.clamp(),l.sigBytes+=d-(l.sigBytes%d||d)},unpad:function(l){for(var f=l.words,d=l.sigBytes-1,d=l.sigBytes-1;d>=0;d--)if(f[d>>>2]>>>24-d%4*8&255){l.sigBytes=d+1;break}}},o.pad.ZeroPadding})})(fc)),fc.exports}var hc={exports:{}},Hb=hc.exports,Fm;function Vb(){return Fm||(Fm=1,(function(r,a){(function(o,l,f){r.exports=l(ft(),fn())})(Hb,function(o){return o.pad.NoPadding={pad:function(){},unpad:function(){}},o.pad.NoPadding})})(hc)),hc.exports}var pc={exports:{}},Ub=pc.exports,Nm;function Zb(){return Nm||(Nm=1,(function(r,a){(function(o,l,f){r.exports=l(ft(),fn())})(Ub,function(o){return(function(l){var f=o,d=f.lib,m=d.CipherParams,h=f.enc,x=h.Hex,p=f.format;p.Hex={stringify:function(v){return v.ciphertext.toString(x)},parse:function(v){var y=x.parse(v);return m.create({ciphertext:y})}}})(),o.format.Hex})})(pc)),pc.exports}var mc={exports:{}},Wb=mc.exports,Lm;function qb(){return Lm||(Lm=1,(function(r,a){(function(o,l,f){r.exports=l(ft(),Wo(),qo(),ao(),fn())})(Wb,function(o){return(function(){var l=o,f=l.lib,d=f.BlockCipher,m=l.algo,h=[],x=[],p=[],v=[],y=[],w=[],P=[],D=[],C=[],E=[];(function(){for(var k=[],N=0;N<256;N++)N<128?k[N]=N<<1:k[N]=N<<1^283;for(var I=0,z=0,N=0;N<256;N++){var j=z^z<<1^z<<2^z<<3^z<<4;j=j>>>8^j&255^99,h[I]=j,x[j]=I;var H=k[I],$=k[H],U=k[$],G=k[j]*257^j*16843008;p[I]=G<<24|G>>>8,v[I]=G<<16|G>>>16,y[I]=G<<8|G>>>24,w[I]=G;var G=U*16843009^$*65537^H*257^I*16843008;P[j]=G<<24|G>>>8,D[j]=G<<16|G>>>16,C[j]=G<<8|G>>>24,E[j]=G,I?(I=H^k[k[k[U^H]]],z^=k[k[z]]):I=z=1}})();var T=[0,1,2,4,8,16,32,64,128,27,54],B=m.AES=d.extend({_doReset:function(){var k;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var N=this._keyPriorReset=this._key,I=N.words,z=N.sigBytes/4,j=this._nRounds=z+6,H=(j+1)*4,$=this._keySchedule=[],U=0;U<H;U++)U<z?$[U]=I[U]:(k=$[U-1],U%z?z>6&&U%z==4&&(k=h[k>>>24]<<24|h[k>>>16&255]<<16|h[k>>>8&255]<<8|h[k&255]):(k=k<<8|k>>>24,k=h[k>>>24]<<24|h[k>>>16&255]<<16|h[k>>>8&255]<<8|h[k&255],k^=T[U/z|0]<<24),$[U]=$[U-z]^k);for(var G=this._invKeySchedule=[],ne=0;ne<H;ne++){var U=H-ne;if(ne%4)var k=$[U];else var k=$[U-4];ne<4||U<=4?G[ne]=k:G[ne]=P[h[k>>>24]]^D[h[k>>>16&255]]^C[h[k>>>8&255]]^E[h[k&255]]}}},encryLine truncated
• Timestamp (4 bytes) - send time as unix timestamp
• Request Type (1 byte) - type of request (GetStats, GetTelemetryData, etc.)
• Request Data (remaining bytes) - additional request-specific data`,startByte:h+x,endByte:h+f.length-1,value:w});const B={type:r.PayloadType.Request,version:r.PayloadVersion.Version1,isValid:!0,timestamp:0,requestType:r.RequestType.GetStats,requestData:"",destinationHash:p,sourceHash:y,cipherMac:v,ciphertext:w};return d!=null&&d.includeSegments&&(B.segments=m),B}catch(m){return{type:r.PayloadType.Request,version:r.PayloadVersion.Version1,isValid:!1,errors:[m instanceof Error?m.message:"Failed to decode request payload"],timestamp:0,requestType:r.RequestType.GetStats,requestData:"",destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:""}}}}return Wa.RequestPayloadDecoder=o,Wa}var qa={},iA;function BC(){if(iA)return qa;iA=1,Object.defineProperty(qa,"__esModule",{value:!0}),qa.ResponsePayloadDecoder=void 0;const r=ir(),a=gn();class o{static decode(f,d){try{if(f.length<4){const R={type:r.PayloadType.Response,version:r.PayloadVersion.Version1,isValid:!1,errors:["Response payload too short (minimum 4 bytes: dest + source + MAC)"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return d!=null&&d.includeSegments&&(R.segments=[{name:"Invalid Response Data",description:"Response payload too short (minimum 4 bytes required)",startByte:d.segmentOffset||0,endByte:(d.segmentOffset||0)+f.length-1,value:(0,a.bytesToHex)(f)}]),R}const m=[],h=(d==null?void 0:d.segmentOffset)||0;let x=0;const p=(0,a.byteToHex)(f[x]);d!=null&&d.includeSegments&&m.push({name:"Destination Hash",description:"First byte of destination node public key",startByte:h+x,endByte:h+x,value:p}),x+=1;const y=(0,a.byteToHex)(f[x]);d!=null&&d.includeSegments&&m.push({name:"Source Hash",description:"First byte of source node public key",startByte:h+x,endByte:h+x,value:y}),x+=1;const v=(0,a.bytesToHex)(f.subarray(x,x+2));d!=null&&d.includeSegments&&m.push({name:"Cipher MAC",description:"MAC for encrypted data in next field",startByte:h+x,endByte:h+x+1,value:v}),x+=2;const w=(0,a.bytesToHex)(f.subarray(x));d!=null&&d.includeSegments&&f.length>x&&m.push({name:"Ciphertext",description:"Encrypted response data (tag + content)",startByte:h+x,endByte:h+f.length-1,value:w});const B={type:r.PayloadType.Response,version:r.PayloadVersion.Version1,isValid:!0,destinationHash:p,sourceHash:y,cipherMac:v,ciphertext:w,ciphertextLength:f.length-4};return d!=null&&d.includeSegments&&(B.segments=m),B}catch(m){return{type:r.PayloadType.Response,version:r.PayloadVersion.Version1,isValid:!1,errors:[m instanceof Error?m.message:"Failed to decode response payload"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0}}}}return qa.ResponsePayloadDecoder=o,qa}var Ga={},oA;function PC(){if(oA)return Ga;oA=1,Object.defineProperty(Ga,"__esModule",{value:!0}),Ga.AnonRequestPayloadDecoder=void 0;const r=ir(),a=gn();class o{static decode(f,d){try{if(f.length<35){const R={type:r.PayloadType.AnonRequest,version:r.PayloadVersion.Version1,isValid:!1,errors:["AnonRequest payload too short (minimum 35 bytes: dest + public key + MAC)"],destinationHash:"",senderPublicKey:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return d!=null&&d.includeSegments&&(R.segments=[{name:"Invalid AnonRequest Data",description:"AnonRequest payload too short (minimum 35 bytes required: 1 for dest hash + 32 for public key + 2 for MAC)",startByte:d.segmentOffset||0,endByte:(d.segmentOffset||0)+f.length-1,value:(0,a.bytesToHex)(f)}]),R}const m=[],h=(d==null?void 0:d.segmentOffset)||0;let x=0;const p=(0,a.byteToHex)(f[0]);d!=null&&d.includeSegments&&m.push({name:"Destination Hash",description:`First byte of destination node public key: 0x${p}`,startByte:h+x,endByte:h+x,value:p}),x+=1;const y=(0,a.bytesToHex)(f.subarray(1,33));d!=null&&d.includeSegments&&m.push({name:"Sender Public Key",description:"Ed25519 public key of the sender (32 bytes)",startByte:h+x,endByte:h+x+31,value:y}),x+=32;const v=(0,a.bytesToHex)(f.subarray(33,35));d!=null&&d.includeSegments&&m.push({name:"Cipher MAC",description:"MAC for encrypted data verification (2 bytes)",startByte:h+x,endByte:h+x+1,value:v}),x+=2;const w=(0,a.bytesToHex)(f.subarray(35));d!=null&&d.includeSegments&&f.length>35&&m.push({name:"Ciphertext",description:`Encrypted message data (${f.length-35} bytes). Contains encrypted plaintext with this structure:
• Request Data (remaining bytes) - additional request-specific data`,startByte:h+x,endByte:h+f.length-1,value:w});const P={type:r.PayloadType.Request,version:r.PayloadVersion.Version1,isValid:!0,timestamp:0,requestType:r.RequestType.GetStats,requestData:"",destinationHash:p,sourceHash:v,cipherMac:y,ciphertext:w};return d!=null&&d.includeSegments&&(P.segments=m),P}catch(m){return{type:r.PayloadType.Request,version:r.PayloadVersion.Version1,isValid:!1,errors:[m instanceof Error?m.message:"Failed to decode request payload"],timestamp:0,requestType:r.RequestType.GetStats,requestData:"",destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:""}}}}return Wa.RequestPayloadDecoder=o,Wa}var qa={},iA;function BC(){if(iA)return qa;iA=1,Object.defineProperty(qa,"__esModule",{value:!0}),qa.ResponsePayloadDecoder=void 0;const r=ir(),a=gn();class o{static decode(f,d){try{if(f.length<4){const D={type:r.PayloadType.Response,version:r.PayloadVersion.Version1,isValid:!1,errors:["Response payload too short (minimum 4 bytes: dest + source + MAC)"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return d!=null&&d.includeSegments&&(D.segments=[{name:"Invalid Response Data",description:"Response payload too short (minimum 4 bytes required)",startByte:d.segmentOffset||0,endByte:(d.segmentOffset||0)+f.length-1,value:(0,a.bytesToHex)(f)}]),D}const m=[],h=(d==null?void 0:d.segmentOffset)||0;let x=0;const p=(0,a.byteToHex)(f[x]);d!=null&&d.includeSegments&&m.push({name:"Destination Hash",description:"First byte of destination node public key",startByte:h+x,endByte:h+x,value:p}),x+=1;const v=(0,a.byteToHex)(f[x]);d!=null&&d.includeSegments&&m.push({name:"Source Hash",description:"First byte of source node public key",startByte:h+x,endByte:h+x,value:v}),x+=1;const y=(0,a.bytesToHex)(f.subarray(x,x+2));d!=null&&d.includeSegments&&m.push({name:"Cipher MAC",description:"MAC for encrypted data in next field",startByte:h+x,endByte:h+x+1,value:y}),x+=2;const w=(0,a.bytesToHex)(f.subarray(x));d!=null&&d.includeSegments&&f.length>x&&m.push({name:"Ciphertext",description:"Encrypted response data (tag + content)",startByte:h+x,endByte:h+f.length-1,value:w});const P={type:r.PayloadType.Response,version:r.PayloadVersion.Version1,isValid:!0,destinationHash:p,sourceHash:v,cipherMac:y,ciphertext:w,ciphertextLength:f.length-4};return d!=null&&d.includeSegments&&(P.segments=m),P}catch(m){return{type:r.PayloadType.Response,version:r.PayloadVersion.Version1,isValid:!1,errors:[m instanceof Error?m.message:"Failed to decode response payload"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0}}}}return qa.ResponsePayloadDecoder=o,qa}var Ga={},oA;function PC(){if(oA)return Ga;oA=1,Object.defineProperty(Ga,"__esModule",{value:!0}),Ga.AnonRequestPayloadDecoder=void 0;const r=ir(),a=gn();class o{static decode(f,d){try{if(f.length<35){const D={type:r.PayloadType.AnonRequest,version:r.PayloadVersion.Version1,isValid:!1,errors:["AnonRequest payload too short (minimum 35 bytes: dest + public key + MAC)"],destinationHash:"",senderPublicKey:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return d!=null&&d.includeSegments&&(D.segments=[{name:"Invalid AnonRequest Data",description:"AnonRequest payload too short (minimum 35 bytes required: 1 for dest hash + 32 for public key + 2 for MAC)",startByte:d.segmentOffset||0,endByte:(d.segmentOffset||0)+f.length-1,value:(0,a.bytesToHex)(f)}]),D}const m=[],h=(d==null?void 0:d.segmentOffset)||0;let x=0;const p=(0,a.byteToHex)(f[0]);d!=null&&d.includeSegments&&m.push({name:"Destination Hash",description:`First byte of destination node public key: 0x${p}`,startByte:h+x,endByte:h+x,value:p}),x+=1;const v=(0,a.bytesToHex)(f.subarray(1,33));d!=null&&d.includeSegments&&m.push({name:"Sender Public Key",description:"Ed25519 public key of the sender (32 bytes)",startByte:h+x,endByte:h+x+31,value:v}),x+=32;const y=(0,a.bytesToHex)(f.subarray(33,35));d!=null&&d.includeSegments&&m.push({name:"Cipher MAC",description:"MAC for encrypted data verification (2 bytes)",startByte:h+x,endByte:h+x+1,value:y}),x+=2;const w=(0,a.bytesToHex)(f.subarray(35));d!=null&&d.includeSegments&&f.length>35&&m.push({name:"Ciphertext",description:`Encrypted message data (${f.length-35} bytes). Contains encrypted plaintext with this structure:
• Timestamp (4 bytes) - send time as unix timestamp
• Sync Timestamp (4 bytes) - room server only, sender's "sync messages SINCE x" timestamp
• Password (remaining bytes) - password for repeater/room`,startByte:h+x,endByte:h+f.length-1,value:w});const B={type:r.PayloadType.AnonRequest,version:r.PayloadVersion.Version1,isValid:!0,destinationHash:p,senderPublicKey:y,cipherMac:v,ciphertext:w,ciphertextLength:f.length-35};return d!=null&&d.includeSegments&&(B.segments=m),B}catch(m){return{type:r.PayloadType.AnonRequest,version:r.PayloadVersion.Version1,isValid:!1,errors:[m instanceof Error?m.message:"Failed to decode AnonRequest payload"],destinationHash:"",senderPublicKey:"",cipherMac:"",ciphertext:"",ciphertextLength:0}}}}return Ga.AnonRequestPayloadDecoder=o,Ga}var Qa={},sA;function TC(){if(sA)return Qa;sA=1,Object.defineProperty(Qa,"__esModule",{value:!0}),Qa.AckPayloadDecoder=void 0;const r=ir(),a=gn();class o{static decode(f,d){try{if(f.length<4){const y={type:r.PayloadType.Ack,version:r.PayloadVersion.Version1,isValid:!1,errors:["Ack payload too short (minimum 4 bytes for checksum)"],checksum:""};return d!=null&&d.includeSegments&&(y.segments=[{name:"Invalid Ack Data",description:"Ack payload too short (minimum 4 bytes required for checksum)",startByte:d.segmentOffset||0,endByte:(d.segmentOffset||0)+f.length-1,value:(0,a.bytesToHex)(f)}]),y}const m=[],h=(d==null?void 0:d.segmentOffset)||0,x=(0,a.bytesToHex)(f.subarray(0,4));d!=null&&d.includeSegments&&m.push({name:"Checksum",description:`CRC checksum of message timestamp, text, and sender pubkey: 0x${x}`,startByte:h,endByte:h+3,value:x}),d!=null&&d.includeSegments&&f.length>4&&m.push({name:"Additional Data",description:"Extra data in Ack payload",startByte:h+4,endByte:h+f.length-1,value:(0,a.bytesToHex)(f.subarray(4))});const p={type:r.PayloadType.Ack,version:r.PayloadVersion.Version1,isValid:!0,checksum:x};return d!=null&&d.includeSegments&&(p.segments=m),p}catch(m){return{type:r.PayloadType.Ack,version:r.PayloadVersion.Version1,isValid:!1,errors:[m instanceof Error?m.message:"Failed to decode Ack payload"],checksum:""}}}}return Qa.AckPayloadDecoder=o,Qa}var Ka={},aA;function DC(){if(aA)return Ka;aA=1,Object.defineProperty(Ka,"__esModule",{value:!0}),Ka.PathPayloadDecoder=void 0;const r=ir(),a=gn();class o{static decode(f){try{if(f.length<2)return{type:r.PayloadType.Path,version:r.PayloadVersion.Version1,isValid:!1,errors:["Path payload too short (minimum 2 bytes: path length + extra type)"],pathLength:0,pathHashes:[],extraType:0,extraData:""};const d=f[0];if(f.length<1+d+1)return{type:r.PayloadType.Path,version:r.PayloadVersion.Version1,isValid:!1,errors:[`Path payload too short (need ${1+d+1} bytes for path length + path + extra type)`],pathLength:d,pathHashes:[],extraType:0,extraData:""};const m=[];for(let p=0;p<d;p++)m.push((0,a.byteToHex)(f[1+p]));const h=f[1+d];let x="";return f.length>1+d+1&&(x=(0,a.bytesToHex)(f.subarray(1+d+1))),{type:r.PayloadType.Path,version:r.PayloadVersion.Version1,isValid:!0,pathLength:d,pathHashes:m,extraType:h,extraData:x}}catch(d){return{type:r.PayloadType.Path,version:r.PayloadVersion.Version1,isValid:!1,errors:[d instanceof Error?d.message:"Failed to decode Path payload"],pathLength:0,pathHashes:[],extraType:0,extraData:""}}}}return Ka.PathPayloadDecoder=o,Ka}var $a={},lA;function RC(){if(lA)return $a;lA=1,Object.defineProperty($a,"__esModule",{value:!0}),$a.TextMessagePayloadDecoder=void 0;const r=ir(),a=gn();class o{static decode(f,d){try{if(f.length<4){const R={type:r.PayloadType.TextMessage,version:r.PayloadVersion.Version1,isValid:!1,errors:["TextMessage payload too short (minimum 4 bytes: dest + source + MAC)"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return d!=null&&d.includeSegments&&(R.segments=[{name:"Invalid TextMessage Data",description:"TextMessage payload too short (minimum 4 bytes required)",startByte:d.segmentOffset||0,endByte:(d.segmentOffset||0)+f.length-1,value:(0,a.bytesToHex)(f)}]),R}const m=[],h=(d==null?void 0:d.segmentOffset)||0;let x=0;const p=(0,a.byteToHex)(f[x]);d!=null&&d.includeSegments&&m.push({name:"Destination Hash",description:"First byte of destination node public key",startByte:h+x,endByte:h+x,value:p}),x+=1;const y=(0,a.byteToHex)(f[x]);d!=null&&d.includeSegments&&m.push({name:"Source Hash",description:"First byte of source node public key",startByte:h+x,endByte:h+x,value:y}),x+=1;const v=(0,a.bytesToHex)(f.subarray(x,x+2));d!=null&&d.includeSegments&&m.push({name:"Cipher MAC",description:"MAC for encrypted data in next field",startByte:h+x,endByte:h+x+1,value:v}),x+=2;const w=(0,a.bytesToHex)(f.subarray(x));d!=null&&d.includeSegments&&f.length>x&&m.push({name:"Ciphertext",description:"Encrypted message data (timestamp + message text)",startByte:h+x,endByte:h+f.length-1,value:w});const B={type:r.PayloadType.TextMessage,version:r.PayloadVersion.Version1,isValid:!0,destinationHash:p,sourceHash:y,cipherMac:v,ciphertext:w,ciphertextLength:f.length-4};return d!=null&&d.includeSegments&&(B.segments=m),B}catch(m){return{type:r.PayloadType.TextMessage,version:r.PayloadVersion.Version1,i Line truncated
• Password (remaining bytes) - password for repeater/room`,startByte:h+x,endByte:h+f.length-1,value:w});const P={type:r.PayloadType.AnonRequest,version:r.PayloadVersion.Version1,isValid:!0,destinationHash:p,senderPublicKey:v,cipherMac:y,ciphertext:w,ciphertextLength:f.length-35};return d!=null&&d.includeSegments&&(P.segments=m),P}catch(m){return{type:r.PayloadType.AnonRequest,version:r.PayloadVersion.Version1,isValid:!1,errors:[m instanceof Error?m.message:"Failed to decode AnonRequest payload"],destinationHash:"",senderPublicKey:"",cipherMac:"",ciphertext:"",ciphertextLength:0}}}}return Ga.AnonRequestPayloadDecoder=o,Ga}var Qa={},sA;function TC(){if(sA)return Qa;sA=1,Object.defineProperty(Qa,"__esModule",{value:!0}),Qa.AckPayloadDecoder=void 0;const r=ir(),a=gn();class o{static decode(f,d){try{if(f.length<4){const v={type:r.PayloadType.Ack,version:r.PayloadVersion.Version1,isValid:!1,errors:["Ack payload too short (minimum 4 bytes for checksum)"],checksum:""};return d!=null&&d.includeSegments&&(v.segments=[{name:"Invalid Ack Data",description:"Ack payload too short (minimum 4 bytes required for checksum)",startByte:d.segmentOffset||0,endByte:(d.segmentOffset||0)+f.length-1,value:(0,a.bytesToHex)(f)}]),v}const m=[],h=(d==null?void 0:d.segmentOffset)||0,x=(0,a.bytesToHex)(f.subarray(0,4));d!=null&&d.includeSegments&&m.push({name:"Checksum",description:`CRC checksum of message timestamp, text, and sender pubkey: 0x${x}`,startByte:h,endByte:h+3,value:x}),d!=null&&d.includeSegments&&f.length>4&&m.push({name:"Additional Data",description:"Extra data in Ack payload",startByte:h+4,endByte:h+f.length-1,value:(0,a.bytesToHex)(f.subarray(4))});const p={type:r.PayloadType.Ack,version:r.PayloadVersion.Version1,isValid:!0,checksum:x};return d!=null&&d.includeSegments&&(p.segments=m),p}catch(m){return{type:r.PayloadType.Ack,version:r.PayloadVersion.Version1,isValid:!1,errors:[m instanceof Error?m.message:"Failed to decode Ack payload"],checksum:""}}}}return Qa.AckPayloadDecoder=o,Qa}var Ka={},aA;function DC(){if(aA)return Ka;aA=1,Object.defineProperty(Ka,"__esModule",{value:!0}),Ka.PathPayloadDecoder=void 0;const r=ir(),a=gn();class o{static decode(f){try{if(f.length<2)return{type:r.PayloadType.Path,version:r.PayloadVersion.Version1,isValid:!1,errors:["Path payload too short (minimum 2 bytes: path length + extra type)"],pathLength:0,pathHashes:[],extraType:0,extraData:""};const d=f[0];if(f.length<1+d+1)return{type:r.PayloadType.Path,version:r.PayloadVersion.Version1,isValid:!1,errors:[`Path payload too short (need ${1+d+1} bytes for path length + path + extra type)`],pathLength:d,pathHashes:[],extraType:0,extraData:""};const m=[];for(let p=0;p<d;p++)m.push((0,a.byteToHex)(f[1+p]));const h=f[1+d];let x="";return f.length>1+d+1&&(x=(0,a.bytesToHex)(f.subarray(1+d+1))),{type:r.PayloadType.Path,version:r.PayloadVersion.Version1,isValid:!0,pathLength:d,pathHashes:m,extraType:h,extraData:x}}catch(d){return{type:r.PayloadType.Path,version:r.PayloadVersion.Version1,isValid:!1,errors:[d instanceof Error?d.message:"Failed to decode Path payload"],pathLength:0,pathHashes:[],extraType:0,extraData:""}}}}return Ka.PathPayloadDecoder=o,Ka}var $a={},lA;function RC(){if(lA)return $a;lA=1,Object.defineProperty($a,"__esModule",{value:!0}),$a.TextMessagePayloadDecoder=void 0;const r=ir(),a=gn();class o{static decode(f,d){try{if(f.length<4){const D={type:r.PayloadType.TextMessage,version:r.PayloadVersion.Version1,isValid:!1,errors:["TextMessage payload too short (minimum 4 bytes: dest + source + MAC)"],destinationHash:"",sourceHash:"",cipherMac:"",ciphertext:"",ciphertextLength:0};return d!=null&&d.includeSegments&&(D.segments=[{name:"Invalid TextMessage Data",description:"TextMessage payload too short (minimum 4 bytes required)",startByte:d.segmentOffset||0,endByte:(d.segmentOffset||0)+f.length-1,value:(0,a.bytesToHex)(f)}]),D}const m=[],h=(d==null?void 0:d.segmentOffset)||0;let x=0;const p=(0,a.byteToHex)(f[x]);d!=null&&d.includeSegments&&m.push({name:"Destination Hash",description:"First byte of destination node public key",startByte:h+x,endByte:h+x,value:p}),x+=1;const v=(0,a.byteToHex)(f[x]);d!=null&&d.includeSegments&&m.push({name:"Source Hash",description:"First byte of source node public key",startByte:h+x,endByte:h+x,value:v}),x+=1;const y=(0,a.bytesToHex)(f.subarray(x,x+2));d!=null&&d.includeSegments&&m.push({name:"Cipher MAC",description:"MAC for encrypted data in next field",startByte:h+x,endByte:h+x+1,value:y}),x+=2;const w=(0,a.bytesToHex)(f.subarray(x));d!=null&&d.includeSegments&&f.length>x&&m.push({name:"Ciphertext",description:"Encrypted message data (timestamp + message text)",startByte:h+x,endByte:h+f.length-1,value:w});const P={type:r.PayloadType.TextMessage,version:r.PayloadVersion.Version1,isValid:!0,destinationHash:p,sourceHash:v,cipherMac:y,ciphertext:w,ciphertextLength:f.length-4};return d!=null&&d.includeSegments&&(P.segments=m),P}catch(m){return{type:r.PayloadType.TextMessage,version:r.PayloadVersion.Version1,i Line truncated
// SHA256 round constants
const K: array<u32, 64> = array<u32, 64>(
0x428a2f98u, 0x71374491u, 0xb5c0fbcfu, 0xe9b5dba5u, 0x3956c25bu, 0x59f111f1u, 0x923f82a4u, 0xab1c5ed5u,
@@ -530,12 +530,12 @@ fn main(@builtin(global_invocation_id) global_id: vec3<u32>) {
process_candidate(name_idx);
}
}
`}async init(){if(!navigator.gpu)return console.warn("WebGPU not supported"),!1;try{const a=await navigator.gpu.requestAdapter();if(!a)return console.warn("No GPU adapter found"),!1;this.device=await a.requestDevice(),this.bindGroupLayout=this.device.createBindGroupLayout({entries:[{binding:0,visibility:GPUShaderStage.COMPUTE,buffer:{type:"uniform"}},{binding:1,visibility:GPUShaderStage.COMPUTE,buffer:{type:"storage"}},{binding:2,visibility:GPUShaderStage.COMPUTE,buffer:{type:"storage"}},{binding:3,visibility:GPUShaderStage.COMPUTE,buffer:{type:"read-only-storage"}}]}),this.paramsBuffer=this.device.createBuffer({size:32,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST}),this.matchCountBuffer=this.device.createBuffer({size:4,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST}),this.matchIndicesBuffer=this.device.createBuffer({size:1024*4,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC});for(let f=0;f<2;f++)this.matchCountReadBuffers[f]=this.device.createBuffer({size:4,usage:GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST}),this.matchIndicesReadBuffers[f]=this.device.createBuffer({size:1024*4,usage:GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST});const o=this.device.createShaderModule({code:this.shaderCode}),l=this.device.createPipelineLayout({bindGroupLayouts:[this.bindGroupLayout]});return this.pipeline=this.device.createComputePipeline({layout:l,compute:{module:o,entryPoint:"main"}}),!0}catch(a){return console.error("WebGPU initialization failed:",a),!1}}isAvailable(){return this.device!==null&&this.pipeline!==null}indexToRoomName(a,o){return Vo(o,a)}countNamesForLength(a){return tl(a)}async runBatch(a,o,l,f,d,m){if(!this.device||!this.pipeline||!this.bindGroupLayout||!this.paramsBuffer||!this.matchCountBuffer||!this.matchIndicesBuffer||!this.matchCountReadBuffers[0]||!this.matchCountReadBuffers[1]||!this.matchIndicesReadBuffers[0]||!this.matchIndicesReadBuffers[1])throw new Error("GPU not initialized");const h=this.currentReadBufferIndex;this.currentReadBufferIndex=1-this.currentReadBufferIndex;const x=this.matchCountReadBuffers[h],p=this.matchIndicesReadBuffers[h],y=d&&m?1:0;let v,w=0,B=0;if(y){const I=new Uint8Array(d.length/2);for(let U=0;U<I.length;U++)I[U]=parseInt(d.substr(U*2,2),16);w=I.length*8;const z=Math.ceil(I.length/4)*4,j=new Uint8Array(z);j.set(I),v=new Uint32Array(z/4);for(let U=0;U<v.length;U++)v[U]=j[U*4]<<24|j[U*4+1]<<16|j[U*4+2]<<8|j[U*4+3];const H=parseInt(m.substr(0,2),16),$=parseInt(m.substr(2,2),16);B=H<<24|$<<16}else v=new Uint32Array([0]);const R=Math.max(v.length*4,4);(!this.ciphertextBuffer||this.ciphertextBufferSize<R)&&(this.ciphertextBuffer&&this.ciphertextBuffer.destroy(),this.ciphertextBuffer=this.device.createBuffer({size:R,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST}),this.ciphertextBufferSize=R,this.bindGroupDirty=!0);const C=new Uint32Array([a,l,o,f,B,v.length,w,y]);this.device.queue.writeBuffer(this.paramsBuffer,0,C),this.device.queue.writeBuffer(this.ciphertextBuffer,0,v),this.device.queue.writeBuffer(this.matchCountBuffer,0,Jc.ZERO_DATA),(this.bindGroupDirty||!this.bindGroup)&&(this.bindGroup=this.device.createBindGroup({layout:this.bindGroupLayout,entries:[{binding:0,resource:{buffer:this.paramsBuffer}},{binding:1,resource:{buffer:this.matchCountBuffer}},{binding:2,resource:{buffer:this.matchIndicesBuffer}},{binding:3,resource:{buffer:this.ciphertextBuffer}}]}),this.bindGroupDirty=!1);const E=this.device.createCommandEncoder(),T=E.beginComputePass();T.setPipeline(this.pipeline),T.setBindGroup(0,this.bindGroup),T.dispatchWorkgroups(Math.ceil(f/(256*32))),T.end(),E.copyBufferToBuffer(this.matchCountBuffer,0,x,0,4),E.copyBufferToBuffer(this.matchIndicesBuffer,0,p,0,1024*4),this.device.queue.submit([E.finish()]),await x.mapAsync(GPUMapMode.READ);const k=new Uint32Array(x.getMappedRange())[0];x.unmap();const N=[];if(k>0){await p.mapAsync(GPUMapMode.READ);const I=new Uint32Array(p.getMappedRange());for(let z=0;z<Math.min(k,1024);z++)N.push(I[z]);p.unmap()}return N}destroy(){var a,o,l,f,d,m,h,x;(a=this.paramsBuffer)==null||a.destroy(),(o=this.matchCountBuffer)==null||o.destroy(),(l=this.matchIndicesBuffer)==null||l.destroy(),(f=this.ciphertextBuffer)==null||f.destroy(),(d=this.matchCountReadBuffers[0])==null||d.destroy(),(m=this.matchCountReadBuffers[1])==null||m.destroy(),(h=this.matchIndicesReadBuffers[0])==null||h.destroy(),(x=this.matchIndicesReadBuffers[1])==null||x.destroy(),this.paramsBuffer=null,this.matchCountBuffer=null,this.matchIndicesBuffer=null,this.ciphertextBuffer=null,this.ciphertextBufferSize=0,this.matchCountReadBuffers=[null,null],this.matchIndicesReadBuffers=[null,null],this.currentReadBufferIndex=0,this.bindGroup=null,this.bindGroupDirty=!0,this.device&&(this.device.destroy(),this.device=null),this.pipeline=null,this.bindGroupLayout=null}}Jc.ZERO_DATA=new Uint32Array([0]);function qC(){return typeof navigator<"u"&&"gpu"in navigator}class xA{runBatch(a,o,l,f,d,m){const h=[],x=a.toString(16).padStart(2,"0") Line truncated
`).map(d=>d.trim().toLowerCase()).filter(d=>d.length>0);this.wordlist=f.filter(vA)}setWordlist(a){this.wordlist=a.map(o=>o.trim().toLowerCase()).filter(vA)}abort(){this.abortFlag=!0}isGpuAvailable(){return qC()}async decodePacket(a){var l;const o=a.trim().replace(/\s+/g,"").replace(/^0x/i,"");if(!o||!/^[0-9a-fA-F]+$/.test(o))return null;try{const d=(l=(await mA.MeshCorePacketDecoder.decodeWithVerification(o,{})).payload)==null?void 0:l.decoded;return!(d!=null&&d.channelHash)||!(d!=null&&d.ciphertext)||!(d!=null&&d.cipherMac)?null:{channelHash:d.channelHash,ciphertext:d.ciphertext,cipherMac:d.cipherMac,isGroupText:!0}}catch{return null}}async crack(a,o,l){this.abortFlag=!1,this.useTimestampFilter=(o==null?void 0:o.useTimestampFilter)??!0,this.useUtf8Filter=(o==null?void 0:o.useUtf8Filter)??!0,this.useSenderFilter=(o==null?void 0:o.useSenderFilter)??!0,this.validSeconds=(o==null?void 0:o.validSeconds)??i0,this.useCpu=(o==null?void 0:o.forceCpu)??!1;const f=(o==null?void 0:o.maxLength)??8,d=(o==null?void 0:o.startingLength)??1,m=(o==null?void 0:o.useDictionary)??!0,h=(o==null?void 0:o.startFromType)??"bruteforce",x=a.toLowerCase(),p=await this.decodePacket(x);if(!p)return{found:!1,error:"Invalid packet or not a GroupText packet"};const{channelHash:y,ciphertext:v,cipherMac:w}=p,B=parseInt(y,16);this.useCpu?this.cpuInstance||(this.cpuInstance=new xA):this.gpuInstance||(this.gpuInstance=new Jc,await this.gpuInstance.init()||(this.useCpu=!0,this.cpuInstance=new xA));const R=performance.now();let C=0,E=performance.now(),T=d,P=0,k=0,N=!1;if(o!=null&&o.startFrom){const ee=o.startFrom.toLowerCase();if(h==="dictionary"){const oe=this.wordlist.indexOf(ee);oe>=0&&(k=oe+1)}else{N=!0;const oe=UC(ee);oe&&(T=Math.max(d,oe.length),P=oe.index+1,P>=tl(T)&&(T++,P=0))}}let I=0;m&&!N&&this.wordlist.length>0&&(I+=this.wordlist.length-k);for(let ee=T;ee<=f;ee++)I+=tl(ee);I-=P;const z=(ee,oe,de)=>{if(!l)return;const fe=(performance.now()-R)/1e3,q=fe>0?Math.round(C/fe):0,J=I-C,W=q>0?J/q:0;l({checked:C,total:I,percent:I>0?Math.min(100,C/I*100):0,rateKeysPerSec:q,etaSeconds:W,elapsedSeconds:fe,currentLength:oe,currentPosition:de,phase:ee})},j=ee=>{if(!Nx(v,w,ee))return{valid:!1};const oe=mA.ChannelCrypto.decryptGroupTextMessage(v,w,ee);return!oe.success||!oe.data?{valid:!1}:this.useTimestampFilter&&!ZC(oe.data.timestamp,this.validSeconds)?{valid:!1}:this.useUtf8Filter&&!WC(oe.data.message)?{valid:!1}:this.useSenderFilter&&!oe.data.sender?{valid:!1}:{valid:!0,message:oe.data.sender?`${oe.data.sender}: ${oe.data.message}`:oe.data.message}};if(!N&&k===0&&T===d&&P===0){z("public-key",0,r0);const ee=s0(Cc);if(y===ee){const oe=j(Cc);if(oe.valid)return{found:!0,roomName:r0,key:Cc,decryptedMessage:oe.message}}}if(m&&!N&&this.wordlist.length>0)for(let ee=k;ee<this.wordlist.length;ee++){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:this.wordlist[ee],resumeType:"dictionary"};const oe=this.wordlist[ee],de=o0("#"+oe),le=s0(de);if(parseInt(le,16)===B){const q=j(de);if(q.valid)return{found:!0,roomName:oe,key:de,decryptedMessage:q.message,resumeFrom:oe,resumeType:"dictionary"}}C++;const fe=performance.now();fe-E>=200&&(z("wordlist",oe.length,oe),E=fe,await new Promise(q=>setTimeout(q,0)))}const H=this.useCpu?1024:32768,$=(o==null?void 0:o.gpuDispatchMs)??1e3;let U=H,G=!1;for(let ee=T;ee<=f;ee++){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:Vo(ee,0)||void 0,resumeType:"bruteforce"};const oe=tl(ee);let de=ee===T?P:0;for(;de<oe;){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:Vo(ee,de)||void 0,resumeType:"bruteforce"};const le=Math.min(U,oe-de),fe=performance.now();let q;this.useCpu?q=this.cpuInstance.runBatch(B,ee,de,le,v,w):q=await this.gpuInstance.runBatch(B,ee,de,le,v,w);const J=performance.now()-fe;if(C+=le,!this.useCpu&&!G&&le>=H&&J>0){const S=$/J,V=Math.round(le*S),K=Math.pow(2,Math.round(Math.log2(Math.max(H,V))));U=Math.max(H,K),G=!0}for(const S of q){const V=Vo(ee,S);if(!V)continue;const K=o0("#"+V),Y=j(K);if(Y.valid)return{found:!0,roomName:V,key:K,decryptedMessage:Y.message,resumeFrom:V,resumeType:"bruteforce"}}de+=le;const W=performance.now();if(W-E>=200){const S=Vo(ee,Math.min(de,oe-1))||"";z("bruteforce",ee,S),E=W,await new Promise(V=>setTimeout(V,0))}}}return{found:!1,resumeFrom:Vo(f,tl(f)-1)||void 0,resumeType:"bruteforce"}}destroy(){this.gpuInstance&&(this.gpuInstance.destroy(),this.gpuInstance=null),this.cpuInstance&&(this.cpuInstance.destroy(),this.cpuInstance=null)}}var Uf,yA;function YC(){return yA||(yA=1,Uf={webm:"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmAQAAAAAAAEUq17GDD0JATYCNTGF2ZjU1LjMzLjEwMFdBjUxhdmY1NS4zMy4xMDBzpJBlrrXf3DCDVB8KcgbMpcr+RImIQJBgAA Line truncated
`}async init(){if(!navigator.gpu)return console.warn("WebGPU not supported"),!1;try{const a=await navigator.gpu.requestAdapter();if(!a)return console.warn("No GPU adapter found"),!1;this.device=await a.requestDevice(),this.bindGroupLayout=this.device.createBindGroupLayout({entries:[{binding:0,visibility:GPUShaderStage.COMPUTE,buffer:{type:"uniform"}},{binding:1,visibility:GPUShaderStage.COMPUTE,buffer:{type:"storage"}},{binding:2,visibility:GPUShaderStage.COMPUTE,buffer:{type:"storage"}},{binding:3,visibility:GPUShaderStage.COMPUTE,buffer:{type:"read-only-storage"}}]}),this.paramsBuffer=this.device.createBuffer({size:32,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST}),this.matchCountBuffer=this.device.createBuffer({size:4,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST}),this.matchIndicesBuffer=this.device.createBuffer({size:1024*4,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC});for(let f=0;f<2;f++)this.matchCountReadBuffers[f]=this.device.createBuffer({size:4,usage:GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST}),this.matchIndicesReadBuffers[f]=this.device.createBuffer({size:1024*4,usage:GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST});const o=this.device.createShaderModule({code:this.shaderCode}),l=this.device.createPipelineLayout({bindGroupLayouts:[this.bindGroupLayout]});return this.pipeline=this.device.createComputePipeline({layout:l,compute:{module:o,entryPoint:"main"}}),!0}catch(a){return console.error("WebGPU initialization failed:",a),!1}}isAvailable(){return this.device!==null&&this.pipeline!==null}indexToRoomName(a,o){return Vo(o,a)}countNamesForLength(a){return tl(a)}async runBatch(a,o,l,f,d,m){if(!this.device||!this.pipeline||!this.bindGroupLayout||!this.paramsBuffer||!this.matchCountBuffer||!this.matchIndicesBuffer||!this.matchCountReadBuffers[0]||!this.matchCountReadBuffers[1]||!this.matchIndicesReadBuffers[0]||!this.matchIndicesReadBuffers[1])throw new Error("GPU not initialized");const h=this.currentReadBufferIndex;this.currentReadBufferIndex=1-this.currentReadBufferIndex;const x=this.matchCountReadBuffers[h],p=this.matchIndicesReadBuffers[h],v=d&&m?1:0;let y,w=0,P=0;if(v){const I=new Uint8Array(d.length/2);for(let U=0;U<I.length;U++)I[U]=parseInt(d.substr(U*2,2),16);w=I.length*8;const z=Math.ceil(I.length/4)*4,j=new Uint8Array(z);j.set(I),y=new Uint32Array(z/4);for(let U=0;U<y.length;U++)y[U]=j[U*4]<<24|j[U*4+1]<<16|j[U*4+2]<<8|j[U*4+3];const H=parseInt(m.substr(0,2),16),$=parseInt(m.substr(2,2),16);P=H<<24|$<<16}else y=new Uint32Array([0]);const D=Math.max(y.length*4,4);(!this.ciphertextBuffer||this.ciphertextBufferSize<D)&&(this.ciphertextBuffer&&this.ciphertextBuffer.destroy(),this.ciphertextBuffer=this.device.createBuffer({size:D,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST}),this.ciphertextBufferSize=D,this.bindGroupDirty=!0);const C=new Uint32Array([a,l,o,f,P,y.length,w,v]);this.device.queue.writeBuffer(this.paramsBuffer,0,C),this.device.queue.writeBuffer(this.ciphertextBuffer,0,y),this.device.queue.writeBuffer(this.matchCountBuffer,0,Jc.ZERO_DATA),(this.bindGroupDirty||!this.bindGroup)&&(this.bindGroup=this.device.createBindGroup({layout:this.bindGroupLayout,entries:[{binding:0,resource:{buffer:this.paramsBuffer}},{binding:1,resource:{buffer:this.matchCountBuffer}},{binding:2,resource:{buffer:this.matchIndicesBuffer}},{binding:3,resource:{buffer:this.ciphertextBuffer}}]}),this.bindGroupDirty=!1);const E=this.device.createCommandEncoder(),T=E.beginComputePass();T.setPipeline(this.pipeline),T.setBindGroup(0,this.bindGroup),T.dispatchWorkgroups(Math.ceil(f/(256*32))),T.end(),E.copyBufferToBuffer(this.matchCountBuffer,0,x,0,4),E.copyBufferToBuffer(this.matchIndicesBuffer,0,p,0,1024*4),this.device.queue.submit([E.finish()]),await x.mapAsync(GPUMapMode.READ);const k=new Uint32Array(x.getMappedRange())[0];x.unmap();const N=[];if(k>0){await p.mapAsync(GPUMapMode.READ);const I=new Uint32Array(p.getMappedRange());for(let z=0;z<Math.min(k,1024);z++)N.push(I[z]);p.unmap()}return N}destroy(){var a,o,l,f,d,m,h,x;(a=this.paramsBuffer)==null||a.destroy(),(o=this.matchCountBuffer)==null||o.destroy(),(l=this.matchIndicesBuffer)==null||l.destroy(),(f=this.ciphertextBuffer)==null||f.destroy(),(d=this.matchCountReadBuffers[0])==null||d.destroy(),(m=this.matchCountReadBuffers[1])==null||m.destroy(),(h=this.matchIndicesReadBuffers[0])==null||h.destroy(),(x=this.matchIndicesReadBuffers[1])==null||x.destroy(),this.paramsBuffer=null,this.matchCountBuffer=null,this.matchIndicesBuffer=null,this.ciphertextBuffer=null,this.ciphertextBufferSize=0,this.matchCountReadBuffers=[null,null],this.matchIndicesReadBuffers=[null,null],this.currentReadBufferIndex=0,this.bindGroup=null,this.bindGroupDirty=!0,this.device&&(this.device.destroy(),this.device=null),this.pipeline=null,this.bindGroupLayout=null}}Jc.ZERO_DATA=new Uint32Array([0]);function qC(){return typeof navigator<"u"&&"gpu"in navigator}class xA{runBatch(a,o,l,f,d,m){const h=[],x=a.toString(16).padStart(2,"0") Line truncated
`).map(d=>d.trim().toLowerCase()).filter(d=>d.length>0);this.wordlist=f.filter(vA)}setWordlist(a){this.wordlist=a.map(o=>o.trim().toLowerCase()).filter(vA)}abort(){this.abortFlag=!0}isGpuAvailable(){return qC()}async decodePacket(a){var l;const o=a.trim().replace(/\s+/g,"").replace(/^0x/i,"");if(!o||!/^[0-9a-fA-F]+$/.test(o))return null;try{const d=(l=(await mA.MeshCorePacketDecoder.decodeWithVerification(o,{})).payload)==null?void 0:l.decoded;return!(d!=null&&d.channelHash)||!(d!=null&&d.ciphertext)||!(d!=null&&d.cipherMac)?null:{channelHash:d.channelHash,ciphertext:d.ciphertext,cipherMac:d.cipherMac,isGroupText:!0}}catch{return null}}async crack(a,o,l){this.abortFlag=!1,this.useTimestampFilter=(o==null?void 0:o.useTimestampFilter)??!0,this.useUtf8Filter=(o==null?void 0:o.useUtf8Filter)??!0,this.useSenderFilter=(o==null?void 0:o.useSenderFilter)??!0,this.validSeconds=(o==null?void 0:o.validSeconds)??i0,this.useCpu=(o==null?void 0:o.forceCpu)??!1;const f=(o==null?void 0:o.maxLength)??8,d=(o==null?void 0:o.startingLength)??1,m=(o==null?void 0:o.useDictionary)??!0,h=(o==null?void 0:o.startFromType)??"bruteforce",x=a.toLowerCase(),p=await this.decodePacket(x);if(!p)return{found:!1,error:"Invalid packet or not a GroupText packet"};const{channelHash:v,ciphertext:y,cipherMac:w}=p,P=parseInt(v,16);this.useCpu?this.cpuInstance||(this.cpuInstance=new xA):this.gpuInstance||(this.gpuInstance=new Jc,await this.gpuInstance.init()||(this.useCpu=!0,this.cpuInstance=new xA));const D=performance.now();let C=0,E=performance.now(),T=d,B=0,k=0,N=!1;if(o!=null&&o.startFrom){const ee=o.startFrom.toLowerCase();if(h==="dictionary"){const oe=this.wordlist.indexOf(ee);oe>=0&&(k=oe+1)}else{N=!0;const oe=UC(ee);oe&&(T=Math.max(d,oe.length),B=oe.index+1,B>=tl(T)&&(T++,B=0))}}let I=0;m&&!N&&this.wordlist.length>0&&(I+=this.wordlist.length-k);for(let ee=T;ee<=f;ee++)I+=tl(ee);I-=B;const z=(ee,oe,de)=>{if(!l)return;const fe=(performance.now()-D)/1e3,q=fe>0?Math.round(C/fe):0,J=I-C,W=q>0?J/q:0;l({checked:C,total:I,percent:I>0?Math.min(100,C/I*100):0,rateKeysPerSec:q,etaSeconds:W,elapsedSeconds:fe,currentLength:oe,currentPosition:de,phase:ee})},j=ee=>{if(!Nx(y,w,ee))return{valid:!1};const oe=mA.ChannelCrypto.decryptGroupTextMessage(y,w,ee);return!oe.success||!oe.data?{valid:!1}:this.useTimestampFilter&&!ZC(oe.data.timestamp,this.validSeconds)?{valid:!1}:this.useUtf8Filter&&!WC(oe.data.message)?{valid:!1}:this.useSenderFilter&&!oe.data.sender?{valid:!1}:{valid:!0,message:oe.data.sender?`${oe.data.sender}: ${oe.data.message}`:oe.data.message}};if(!N&&k===0&&T===d&&B===0){z("public-key",0,r0);const ee=s0(Cc);if(v===ee){const oe=j(Cc);if(oe.valid)return{found:!0,roomName:r0,key:Cc,decryptedMessage:oe.message}}}if(m&&!N&&this.wordlist.length>0)for(let ee=k;ee<this.wordlist.length;ee++){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:this.wordlist[ee],resumeType:"dictionary"};const oe=this.wordlist[ee],de=o0("#"+oe),le=s0(de);if(parseInt(le,16)===P){const q=j(de);if(q.valid)return{found:!0,roomName:oe,key:de,decryptedMessage:q.message,resumeFrom:oe,resumeType:"dictionary"}}C++;const fe=performance.now();fe-E>=200&&(z("wordlist",oe.length,oe),E=fe,await new Promise(q=>setTimeout(q,0)))}const H=this.useCpu?1024:32768,$=(o==null?void 0:o.gpuDispatchMs)??1e3;let U=H,G=!1;for(let ee=T;ee<=f;ee++){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:Vo(ee,0)||void 0,resumeType:"bruteforce"};const oe=tl(ee);let de=ee===T?B:0;for(;de<oe;){if(this.abortFlag)return{found:!1,aborted:!0,resumeFrom:Vo(ee,de)||void 0,resumeType:"bruteforce"};const le=Math.min(U,oe-de),fe=performance.now();let q;this.useCpu?q=this.cpuInstance.runBatch(P,ee,de,le,y,w):q=await this.gpuInstance.runBatch(P,ee,de,le,y,w);const J=performance.now()-fe;if(C+=le,!this.useCpu&&!G&&le>=H&&J>0){const S=$/J,V=Math.round(le*S),K=Math.pow(2,Math.round(Math.log2(Math.max(H,V))));U=Math.max(H,K),G=!0}for(const S of q){const V=Vo(ee,S);if(!V)continue;const K=o0("#"+V),Y=j(K);if(Y.valid)return{found:!0,roomName:V,key:K,decryptedMessage:Y.message,resumeFrom:V,resumeType:"bruteforce"}}de+=le;const W=performance.now();if(W-E>=200){const S=Vo(ee,Math.min(de,oe-1))||"";z("bruteforce",ee,S),E=W,await new Promise(V=>setTimeout(V,0))}}}return{found:!1,resumeFrom:Vo(f,tl(f)-1)||void 0,resumeType:"bruteforce"}}destroy(){this.gpuInstance&&(this.gpuInstance.destroy(),this.gpuInstance=null),this.cpuInstance&&(this.cpuInstance.destroy(),this.cpuInstance=null)}}var Uf,yA;function YC(){return yA||(yA=1,Uf={webm:"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmAQAAAAAAAEUq17GDD0JATYCNTGF2ZjU1LjMzLjEwMFdBjUxhdmY1NS4zMy4xMDBzpJBlrrXf3DCDVB8KcgbMpcr+RImIQJBgAA Line truncated
NoSleep enabled for older iOS devices. This can interrupt
active or long-running network requests from completing successfully.
See https://github.com/richtr/NoSleep.js/issues/15 for more details.
`),this.noSleepTimer=window.setInterval(()=>{document.hidden||(window.location.href=window.location.href.split("#")[0],window.setTimeout(window.stop,0))},15e3),this.enabled=!0,Promise.resolve()):this.noSleepVideo.play().then(h=>(this.enabled=!0,h)).catch(h=>{throw this.enabled=!1,h})}disable(){l()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):o()?this.noSleepTimer&&(console.warn(`
NoSleep now disabled for older iOS devices.
`),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}}return Zf=f,Zf}var JC=XC();const eE=Zs(JC);function tE(r){if(r.length<4)return null;try{const o=parseInt(r.slice(0,2),16)&3;let l=2;if(o===0||o===3){if(r.length<l+8)return null;l+=8}if(r.length<l+2)return null;const f=parseInt(r.slice(l,l+2),16);l+=2;const d=f*2;return r.length<l+d?null:(l+=d,r.slice(l))}catch{return null}}function nE({packets:r,channels:a,onChannelCreate:o,onRunningChange:l,visible:f=!1}){const[d,m]=F.useState(!1),[h,x]=F.useState(6),[p,y]=F.useState(!1),[v,w]=F.useState(!0),[B,R]=F.useState(!1),[C,E]=F.useState(null),[T,P]=F.useState(new Map),[k,N]=F.useState([]),[I,z]=F.useState(!1),[j,H]=F.useState(null),[$,U]=F.useState(null),[G,ne]=F.useState(0),ee=F.useRef(null),oe=F.useRef(null),de=F.useRef(!1),le=F.useRef(!1),fe=F.useRef(!1),q=F.useRef(new Map),J=F.useRef(!1),W=F.useRef(6),S=F.useRef(!0),V=F.useRef(!1),K=F.useRef(new Set),Y=F.useRef(new Set);F.useEffect(()=>{const Se=new $C;ee.current=Se,H(Se.isGpuAvailable());const Ve=new eE;return oe.current=Ve,()=>{Se.destroy(),ee.current=null,Ve.disable(),oe.current=null}},[]),F.useEffect(()=>{!f||I||Qw(async()=>{const{ENGLISH_WORDLIST:Se}=await import("./wordlist-BtmChKSf.js");return{ENGLISH_WORDLIST:Se}},[]).then(({ENGLISH_WORDLIST:Se})=>{ee.current&&(ee.current.setWordlist(Se),z(!0))}).catch(Se=>{console.error("Failed to load wordlist:",Se),It.error("Failed to load wordlist",{description:"Cracking will not be available"})})},[f,I]),F.useEffect(()=>{const Se=()=>{lt.getUndecryptedPacketCount().then(({count:st})=>U(st)).catch(()=>U(null))};Se();const Ve=setInterval(Se,3e4);return()=>clearInterval(Ve)},[]);const he=F.useMemo(()=>new Set(a.map(Se=>Se.key.toUpperCase())),[a]),pe=r.filter(Se=>Se.payload_type==="GROUP_TEXT"&&!Se.decrypted);F.useEffect(()=>{let Se=0;P(Ve=>{const st=new Map(Ve);let Dt=!1;for(const yt of pe)if(!st.has(yt.id)){const vt=tE(yt.data);if(vt&&Y.current.has(vt)){Se++;continue}vt&&Y.current.add(vt),st.set(yt.id,{packet:yt,attempts:0,lastAttemptLength:0,status:"pending"}),Dt=!0}return Dt?(q.current=st,st):Ve}),Se>0&&ne(Ve=>Ve+Se)},[pe.length]),F.useEffect(()=>{q.current=T},[T]),F.useEffect(()=>{J.current=p},[p]),F.useEffect(()=>{W.current=h},[h]),F.useEffect(()=>{S.current=v},[v]),F.useEffect(()=>{V.current=B},[B]),F.useEffect(()=>{K.current=new Set(pe.map(Se=>Se.id))},[pe]),F.useEffect(()=>{l==null||l(d)},[d,l]);const Ee=Array.from(T.values()).filter(Se=>Se.status==="pending").length,ge=Array.from(T.values()).filter(Se=>Se.status==="cracked").length,We=Array.from(T.values()).filter(Se=>Se.status==="failed").length,Ye=F.useCallback(async()=>{if(fe.current||!ee.current||!de.current)return;const Se=q.current;let Ve=null,st=null;for(const[Xe,Ke]of Se.entries())if(Ke.status==="pending"){Ve=Ke,st=Xe;break}if(!Ve&&J.current){const Xe=Array.from(Se.entries()).filter(([,Ke])=>Ke.status==="failed"&&Ke.lastAttemptLength<10);Xe.length>0&&(Xe.sort((Ke,Je)=>Ke[1].lastAttemptLength-Je[1].lastAttemptLength),[st,Ve]=Xe[0])}if(!Ve||st===null){de.current&&setTimeout(()=>Ye(),1e3);return}if(!K.current.has(st)){P(Xe=>{const Ke=new Map(Xe);return Ke.delete(st),Ke}),de.current&&setTimeout(()=>Ye(),10);return}fe.current=!0;const Dt=W.current,yt=Ve.lastAttemptLength>0,vt=yt?Ve.lastAttemptLength+1:Dt;try{const Xe=await ee.current.crack(Ve.packet.data,{maxLength:vt,useSenderFilter:!0,useTimestampFilter:!0,useUtf8Filter:!0,...V.current&&{gpuDispatchMs:1e4},...yt&&{useDictionary:!1,startingLength:vt}},Ke=>{E(Ke)});if(le.current){le.current=!1,fe.current=!1,E(null);return}if(Xe.found&&Xe.roomName&&Xe.key){P(Oe=>{const _t=new Map(Oe),Zt=_t.get(st);return Zt&&_t.set(st,{...Zt,status:"cracked",attempts:Zt.attempts+1,lastAttemptLength:vt}),_t});const Ke={roomName:Xe.roomName,key:Xe.key,packetId:st,message:Xe.decryptedMessage||"",crackedAt:Date.now()};N(Oe=>[...Oe,Ke]);const Je=Xe.key.toUpperCase();if(!he.has(Je))try{const Oe="#"+Xe.roomName;await o(Oe,Xe.key),S.current&&await lt.decryptHistoricalPackets({key_type:"channel",channel_name:Oe})}catch(Oe){console.error("Failed to create channel or decrypt historical:",Oe),It.error("Failed to save cracked channel",{description:Oe instanceof Error?Oe.message:"Channel discovered but could not be saved"})}}else P(Ke=>{const Je=new Map(Ke),Oe=Je.get(st);return Oe&&Je.set(st,{...Oe,status:"failed",attempts:Oe.attempts+1,lastAttemptLength:vt}),Je})}catch(Xe){console.error("Cracking error:",Xe),P(Ke=>{const Je=new Map(Ke),Oe=Je.get(st);return Oe&&Je.set(st,{...Oe,status:"failed",attempts:Oe.attempts+1,lastAttemptLength:vt}),Je})}fe.current=!1,E(null),de.current&&setTimeout(()=>Ye(),100)},[he,o]),kt=()=>{var Se;if(!j){It.error("WebGPU not available",{description:"Cracking requires Chrome 113+ or Edge 113+ with WebGPU support."});return}m(!0),de.current=!0,le.current=!1,(Se=oe.current)==null||Se.enable(),Ye()},pt=()=>{var Se,Ve;m(!1),de.current=!1,le.current=!0,(Se=ee.current)==null||Se.abort(),(Ve=oe.curre Line truncated
//# sourceMappingURL=index-DiX6e5Wm.js.map
`),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}}return Zf=f,Zf}var JC=XC();const eE=Zs(JC);function tE(r){if(r.length<4)return null;try{const o=parseInt(r.slice(0,2),16)&3;let l=2;if(o===0||o===3){if(r.length<l+8)return null;l+=8}if(r.length<l+2)return null;const f=parseInt(r.slice(l,l+2),16);l+=2;const d=f*2;return r.length<l+d?null:(l+=d,r.slice(l))}catch{return null}}function nE({packets:r,channels:a,onChannelCreate:o,onRunningChange:l,visible:f=!1}){const[d,m]=F.useState(!1),[h,x]=F.useState(6),[p,v]=F.useState(!1),[y,w]=F.useState(!0),[P,D]=F.useState(!1),[C,E]=F.useState(null),[T,B]=F.useState(new Map),[k,N]=F.useState([]),[I,z]=F.useState(!1),[j,H]=F.useState(null),[$,U]=F.useState(null),[G,ne]=F.useState(0),ee=F.useRef(null),oe=F.useRef(null),de=F.useRef(!1),le=F.useRef(!1),fe=F.useRef(!1),q=F.useRef(new Map),J=F.useRef(!1),W=F.useRef(6),S=F.useRef(!0),V=F.useRef(!1),K=F.useRef(new Set),Y=F.useRef(new Set);F.useEffect(()=>{const Se=new $C;ee.current=Se,H(Se.isGpuAvailable());const Ve=new eE;return oe.current=Ve,()=>{Se.destroy(),ee.current=null,Ve.disable(),oe.current=null}},[]),F.useEffect(()=>{!f||I||Qw(async()=>{const{ENGLISH_WORDLIST:Se}=await import("./wordlist-BtmChKSf.js");return{ENGLISH_WORDLIST:Se}},[]).then(({ENGLISH_WORDLIST:Se})=>{ee.current&&(ee.current.setWordlist(Se),z(!0))}).catch(Se=>{console.error("Failed to load wordlist:",Se),Yt.error("Failed to load wordlist",{description:"Cracking will not be available"})})},[f,I]),F.useEffect(()=>{const Se=()=>{dt.getUndecryptedPacketCount().then(({count:st})=>U(st)).catch(()=>U(null))};Se();const Ve=setInterval(Se,3e4);return()=>clearInterval(Ve)},[]);const he=F.useMemo(()=>new Set(a.map(Se=>Se.key.toUpperCase())),[a]),pe=r.filter(Se=>Se.payload_type==="GROUP_TEXT"&&!Se.decrypted);F.useEffect(()=>{let Se=0;B(Ve=>{const st=new Map(Ve);let Dt=!1;for(const yt of pe)if(!st.has(yt.id)){const vt=tE(yt.data);if(vt&&Y.current.has(vt)){Se++;continue}vt&&Y.current.add(vt),st.set(yt.id,{packet:yt,attempts:0,lastAttemptLength:0,status:"pending"}),Dt=!0}return Dt?(q.current=st,st):Ve}),Se>0&&ne(Ve=>Ve+Se)},[pe.length]),F.useEffect(()=>{q.current=T},[T]),F.useEffect(()=>{J.current=p},[p]),F.useEffect(()=>{W.current=h},[h]),F.useEffect(()=>{S.current=y},[y]),F.useEffect(()=>{V.current=P},[P]),F.useEffect(()=>{K.current=new Set(pe.map(Se=>Se.id))},[pe]),F.useEffect(()=>{l==null||l(d)},[d,l]);const Ee=Array.from(T.values()).filter(Se=>Se.status==="pending").length,ge=Array.from(T.values()).filter(Se=>Se.status==="cracked").length,We=Array.from(T.values()).filter(Se=>Se.status==="failed").length,Ye=F.useCallback(async()=>{if(fe.current||!ee.current||!de.current)return;const Se=q.current;let Ve=null,st=null;for(const[Xe,Ke]of Se.entries())if(Ke.status==="pending"){Ve=Ke,st=Xe;break}if(!Ve&&J.current){const Xe=Array.from(Se.entries()).filter(([,Ke])=>Ke.status==="failed"&&Ke.lastAttemptLength<10);Xe.length>0&&(Xe.sort((Ke,Je)=>Ke[1].lastAttemptLength-Je[1].lastAttemptLength),[st,Ve]=Xe[0])}if(!Ve||st===null){de.current&&setTimeout(()=>Ye(),1e3);return}if(!K.current.has(st)){B(Xe=>{const Ke=new Map(Xe);return Ke.delete(st),Ke}),de.current&&setTimeout(()=>Ye(),10);return}fe.current=!0;const Dt=W.current,yt=Ve.lastAttemptLength>0,vt=yt?Ve.lastAttemptLength+1:Dt;try{const Xe=await ee.current.crack(Ve.packet.data,{maxLength:vt,useSenderFilter:!0,useTimestampFilter:!0,useUtf8Filter:!0,...V.current&&{gpuDispatchMs:1e4},...yt&&{useDictionary:!1,startingLength:vt}},Ke=>{E(Ke)});if(le.current){le.current=!1,fe.current=!1,E(null);return}if(Xe.found&&Xe.roomName&&Xe.key){B(Oe=>{const _t=new Map(Oe),Vt=_t.get(st);return Vt&&_t.set(st,{...Vt,status:"cracked",attempts:Vt.attempts+1,lastAttemptLength:vt}),_t});const Ke={roomName:Xe.roomName,key:Xe.key,packetId:st,message:Xe.decryptedMessage||"",crackedAt:Date.now()};N(Oe=>[...Oe,Ke]);const Je=Xe.key.toUpperCase();if(!he.has(Je))try{const Oe="#"+Xe.roomName;await o(Oe,Xe.key),S.current&&await dt.decryptHistoricalPackets({key_type:"channel",channel_name:Oe})}catch(Oe){console.error("Failed to create channel or decrypt historical:",Oe),Yt.error("Failed to save cracked channel",{description:Oe instanceof Error?Oe.message:"Channel discovered but could not be saved"})}}else B(Ke=>{const Je=new Map(Ke),Oe=Je.get(st);return Oe&&Je.set(st,{...Oe,status:"failed",attempts:Oe.attempts+1,lastAttemptLength:vt}),Je})}catch(Xe){console.error("Cracking error:",Xe),B(Ke=>{const Je=new Map(Ke),Oe=Je.get(st);return Oe&&Je.set(st,{...Oe,status:"failed",attempts:Oe.attempts+1,lastAttemptLength:vt}),Je})}fe.current=!1,E(null),de.current&&setTimeout(()=>Ye(),100)},[he,o]),kt=()=>{var Se;if(!j){Yt.error("WebGPU not available",{description:"Cracking requires Chrome 113+ or Edge 113+ with WebGPU support."});return}m(!0),de.current=!0,le.current=!1,(Se=oe.current)==null||Se.enable(),Ye()},pt=()=>{var Se,Ve;m(!1),de.current=!1,le.current=!0,(Se=ee.current)==null||Se.abort(),(Ve=oe.curre Line truncated
//# sourceMappingURL=index-E6l20oLD.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"mappings":"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 truncated
+1 -1
View File
@@ -13,7 +13,7 @@
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
<link rel="manifest" href="/site.webmanifest" />
<script type="module" crossorigin src="/assets/index-DiX6e5Wm.js"></script>
<script type="module" crossorigin src="/assets/index-E6l20oLD.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-C5j7uJOC.css">
</head>
<body>
-2
View File
@@ -4,7 +4,6 @@ import type {
Channel,
CommandResponse,
Contact,
DedupResult,
HealthStatus,
MaintenanceResult,
Message,
@@ -169,7 +168,6 @@ export const api = {
method: 'POST',
body: JSON.stringify({ prune_undecrypted_days: pruneUndecryptedDays }),
}),
deduplicatePackets: () => fetchJson<DedupResult>('/packets/dedup', { method: 'POST' }),
// Read State
markAllRead: () =>
@@ -22,7 +22,6 @@ export function MaintenanceModal({
}: MaintenanceModalProps) {
const [retentionDays, setRetentionDays] = useState('14');
const [cleaning, setCleaning] = useState(false);
const [deduping, setDeduping] = useState(false);
const handleCleanup = async () => {
const days = parseInt(retentionDays, 10);
@@ -52,30 +51,6 @@ export function MaintenanceModal({
}
};
const handleDedup = async () => {
setDeduping(true);
try {
const result = await api.deduplicatePackets();
if (result.started) {
toast.success('Deduplication started', {
description: result.message,
});
} else {
toast.info('Deduplication', {
description: result.message,
});
}
} catch (err) {
console.error('Failed to start deduplication:', err);
toast.error('Deduplication failed', {
description: err instanceof Error ? err.message : 'Unknown error',
});
} finally {
setDeduping(false);
}
};
return (
<Dialog open={open} onOpenChange={(isOpen) => !isOpen && onClose()}>
<DialogContent className="sm:max-w-[400px]">
@@ -115,17 +90,6 @@ export function MaintenanceModal({
</Button>
</div>
</div>
<div className="space-y-3">
<Label>Remove Duplicate Packets</Label>
<p className="text-xs text-muted-foreground">
Remove packets with duplicate payloads (same message received via different paths).
Runs in background and may take a long time.
</p>
<Button variant="outline" onClick={handleDedup} disabled={deduping}>
{deduping ? 'Starting...' : 'Remove Duplicates'}
</Button>
</div>
</div>
</DialogContent>
</Dialog>
-6
View File
@@ -49,12 +49,6 @@ export interface MaintenanceResult {
vacuumed: boolean;
}
export interface DedupResult {
started: boolean;
total_packets: number;
message: string;
}
export interface Contact {
public_key: PublicKey;
name: string | null;
+112 -9
View File
@@ -477,15 +477,19 @@ class TestRawPacketRepository:
conn = await aiosqlite.connect(":memory:")
conn.row_factory = aiosqlite.Row
# Create the raw_packets table
# Create the raw_packets table with payload_hash for deduplication
await conn.execute("""
CREATE TABLE raw_packets (
id INTEGER PRIMARY KEY,
timestamp INTEGER NOT NULL,
data BLOB NOT NULL UNIQUE,
message_id INTEGER
data BLOB NOT NULL,
message_id INTEGER,
payload_hash TEXT
)
""")
await conn.execute(
"CREATE UNIQUE INDEX IF NOT EXISTS idx_raw_packets_payload_hash ON raw_packets(payload_hash)"
)
await conn.commit()
# Patch the db._connection to use our test connection
@@ -494,10 +498,11 @@ class TestRawPacketRepository:
try:
packet_data = b"\x01\x02\x03\x04\x05"
packet_id = await RawPacketRepository.create(packet_data, 1234567890)
packet_id, is_new = await RawPacketRepository.create(packet_data, 1234567890)
assert packet_id is not None
assert packet_id > 0
assert is_new is True
finally:
db._connection = original_conn
await conn.close()
@@ -514,15 +519,19 @@ class TestRawPacketRepository:
conn = await aiosqlite.connect(":memory:")
conn.row_factory = aiosqlite.Row
# Create the raw_packets table
# Create the raw_packets table with payload_hash for deduplication
await conn.execute("""
CREATE TABLE raw_packets (
id INTEGER PRIMARY KEY,
timestamp INTEGER NOT NULL,
data BLOB NOT NULL UNIQUE,
message_id INTEGER
data BLOB NOT NULL,
message_id INTEGER,
payload_hash TEXT
)
""")
await conn.execute(
"CREATE UNIQUE INDEX IF NOT EXISTS idx_raw_packets_payload_hash ON raw_packets(payload_hash)"
)
await conn.commit()
# Patch the db._connection to use our test connection
@@ -533,12 +542,106 @@ class TestRawPacketRepository:
packet1 = b"\x01\x02\x03"
packet2 = b"\x04\x05\x06"
id1 = await RawPacketRepository.create(packet1, 1234567890)
id2 = await RawPacketRepository.create(packet2, 1234567891)
id1, is_new1 = await RawPacketRepository.create(packet1, 1234567890)
id2, is_new2 = await RawPacketRepository.create(packet2, 1234567891)
assert id1 is not None
assert id2 is not None
assert id1 != id2
assert is_new1 is True
assert is_new2 is True
finally:
db._connection = original_conn
await conn.close()
@pytest.mark.asyncio
async def test_duplicate_packet_returns_existing_id(self):
"""Inserting same payload twice returns existing ID and is_new=False."""
import aiosqlite
from app.database import db
from app.repository import RawPacketRepository
conn = await aiosqlite.connect(":memory:")
conn.row_factory = aiosqlite.Row
# Create the raw_packets table with payload_hash for deduplication
await conn.execute("""
CREATE TABLE raw_packets (
id INTEGER PRIMARY KEY,
timestamp INTEGER NOT NULL,
data BLOB NOT NULL,
message_id INTEGER,
payload_hash TEXT
)
""")
await conn.execute(
"CREATE UNIQUE INDEX IF NOT EXISTS idx_raw_packets_payload_hash ON raw_packets(payload_hash)"
)
await conn.commit()
original_conn = db._connection
db._connection = conn
try:
# Same packet data inserted twice
packet_data = b"\x01\x02\x03\x04\x05"
id1, is_new1 = await RawPacketRepository.create(packet_data, 1234567890)
id2, is_new2 = await RawPacketRepository.create(packet_data, 1234567891)
# Both should return the same ID
assert id1 == id2
# First is new, second is not
assert is_new1 is True
assert is_new2 is False
finally:
db._connection = original_conn
await conn.close()
@pytest.mark.asyncio
async def test_malformed_packet_uses_full_data_hash(self):
"""Malformed packets (can't extract payload) hash full data for dedup."""
import aiosqlite
from app.database import db
from app.repository import RawPacketRepository
conn = await aiosqlite.connect(":memory:")
conn.row_factory = aiosqlite.Row
await conn.execute("""
CREATE TABLE raw_packets (
id INTEGER PRIMARY KEY,
timestamp INTEGER NOT NULL,
data BLOB NOT NULL,
message_id INTEGER,
payload_hash TEXT
)
""")
await conn.execute(
"CREATE UNIQUE INDEX IF NOT EXISTS idx_raw_packets_payload_hash ON raw_packets(payload_hash)"
)
await conn.commit()
original_conn = db._connection
db._connection = conn
try:
# Single byte is too short to be valid packet (extract_payload returns None)
malformed = b"\x01"
id1, is_new1 = await RawPacketRepository.create(malformed, 1234567890)
id2, is_new2 = await RawPacketRepository.create(malformed, 1234567891)
# Should still deduplicate using full data hash
assert id1 == id2
assert is_new1 is True
assert is_new2 is False
# Different malformed packet should get different ID
different_malformed = b"\x02"
id3, is_new3 = await RawPacketRepository.create(different_malformed, 1234567892)
assert id3 != id1
assert is_new3 is True
finally:
db._connection = original_conn
await conn.close()
+7 -7
View File
@@ -83,8 +83,8 @@ class TestMigration001:
# Run migrations
applied = await run_migrations(conn)
assert applied == 3 # All 3 migrations run
assert await get_version(conn) == 3
assert applied == 5 # All 5 migrations run
assert await get_version(conn) == 5
# Verify columns exist by inserting and selecting
await conn.execute(
@@ -149,9 +149,9 @@ class TestMigration001:
applied1 = await run_migrations(conn)
applied2 = await run_migrations(conn)
assert applied1 == 3 # All 3 migrations run
assert applied1 == 5 # All 5 migrations run
assert applied2 == 0 # No migrations on second run
assert await get_version(conn) == 3
assert await get_version(conn) == 5
finally:
await conn.close()
@@ -194,9 +194,9 @@ class TestMigration001:
# Run migrations - should not fail
applied = await run_migrations(conn)
# All 3 migrations applied (version incremented) but no error
assert applied == 3
assert await get_version(conn) == 3
# All 5 migrations applied (version incremented) but no error
assert applied == 5
assert await get_version(conn) == 5
finally:
await conn.close()
+5 -5
View File
@@ -393,7 +393,7 @@ class TestCreateMessageFromDecrypted:
from app.packet_processor import create_message_from_decrypted
# Create a raw packet first (required for the function)
packet_id = await RawPacketRepository.create(b"test_packet_data", 1700000000)
packet_id, _ = await RawPacketRepository.create(b"test_packet_data", 1700000000)
broadcasts, mock_broadcast = captured_broadcasts
@@ -439,7 +439,7 @@ class TestCreateMessageFromDecrypted:
"""create_message_from_decrypted handles messages without sender prefix."""
from app.packet_processor import create_message_from_decrypted
packet_id = await RawPacketRepository.create(b"test_packet_data_2", 1700000000)
packet_id, _ = await RawPacketRepository.create(b"test_packet_data_2", 1700000000)
broadcasts, mock_broadcast = captured_broadcasts
@@ -467,8 +467,8 @@ class TestCreateMessageFromDecrypted:
"""create_message_from_decrypted returns None for duplicate message."""
from app.packet_processor import create_message_from_decrypted
packet_id_1 = await RawPacketRepository.create(b"packet_1", 1700000000)
packet_id_2 = await RawPacketRepository.create(b"packet_2", 1700000001)
packet_id_1, _ = await RawPacketRepository.create(b"packet_1", 1700000000)
packet_id_2, _ = await RawPacketRepository.create(b"packet_2", 1700000001)
broadcasts, mock_broadcast = captured_broadcasts
@@ -505,7 +505,7 @@ class TestCreateMessageFromDecrypted:
"""create_message_from_decrypted links raw packet to created message."""
from app.packet_processor import create_message_from_decrypted
packet_id = await RawPacketRepository.create(b"test_packet", 1700000000)
packet_id, _ = await RawPacketRepository.create(b"test_packet", 1700000000)
broadcasts, mock_broadcast = captured_broadcasts