diff --git a/CHANGELOG b/CHANGELOG index ed317762..c6e1d886 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,27 @@ # Change Log +## 2.2.23 05/08/2021 + +* Release web UI 2.2.23 +* Fix hostname inconsistencies during script execution +* Add option `--without-kvm` +* Add a `reload` server endpoint. Fixes #1926 +* Handle -no-kvm param deprecated in Qemu >= v5.2 +* Fix binary websocket access to the console +* Change how to generate random MAC addresses +* setup.py: prevent installing tests directory +* Support cloning of encrypted qcow2 base image files +* Fix VMware VM support on Linux and Windows. Fixes #1919 + +## 2.2.22 10/06/2021 + +* Fix VMware support on macOS BigSur +* Link style support. Fixes https://github.com/GNS3/gns3-gui/issues/2461 +* Release web UI version 2.2.22 +* Preserve auto_start/auto_open/auto_close when restoring snapshot +* Fix uBridge errors for cloud nodes not visible in logs. Fixes #1895 +* Prevent directory traversal. Fixes #1894 + ## 2.2.21 10/05/2021 * Release Web-Ui v2.2.21 diff --git a/dev-requirements.txt b/dev-requirements.txt index d6cfcd64..5d789f00 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,8 +1,8 @@ -r requirements.txt pytest==6.2.4 -flake8==3.9.1 +flake8==3.9.2 pytest-timeout==1.4.2 pytest-asyncio==0.15.1 -requests==2.25.1 -httpx==0.18.1 +requests==2.26.0 +httpx==0.18.2 diff --git a/gns3server/api/routes/compute/atm_switch_nodes.py b/gns3server/api/routes/compute/atm_switch_nodes.py index 44dbc57a..4dcab777 100644 --- a/gns3server/api/routes/compute/atm_switch_nodes.py +++ b/gns3server/api/routes/compute/atm_switch_nodes.py @@ -20,7 +20,7 @@ API routes for ATM switch nodes. import os -from fastapi import APIRouter, Depends, Body, Path, status +from fastapi import APIRouter, Depends, Body, Path, Response, status from fastapi.encoders import jsonable_encoder from fastapi.responses import StreamingResponse from uuid import UUID @@ -109,42 +109,43 @@ async def update_atm_switch( @router.delete("/{node_id}", status_code=status.HTTP_204_NO_CONTENT) -async def delete_atm_switch_node(node: ATMSwitch = Depends(dep_node)) -> None: +async def delete_atm_switch_node(node: ATMSwitch = Depends(dep_node)) -> Response: """ Delete an ATM switch node. """ await Dynamips.instance().delete_node(node.id) + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/start", status_code=status.HTTP_204_NO_CONTENT) -def start_atm_switch(node: ATMSwitch = Depends(dep_node)): +def start_atm_switch(node: ATMSwitch = Depends(dep_node)) -> Response: """ Start an ATM switch node. This endpoint results in no action since ATM switch nodes are always on. """ - pass + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/stop", status_code=status.HTTP_204_NO_CONTENT) -def stop_atm_switch(node: ATMSwitch = Depends(dep_node)) -> None: +def stop_atm_switch(node: ATMSwitch = Depends(dep_node)) -> Response: """ Stop an ATM switch node. This endpoint results in no action since ATM switch nodes are always on. """ - pass + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/suspend", status_code=status.HTTP_204_NO_CONTENT) -def suspend_atm_switch(node: ATMSwitch = Depends(dep_node)) -> None: +def suspend_atm_switch(node: ATMSwitch = Depends(dep_node)) -> Response: """ Suspend an ATM switch node. This endpoint results in no action since ATM switch nodes are always on. """ - pass + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post( @@ -170,7 +171,7 @@ async def create_nio( @router.delete("/{node_id}/adapters/{adapter_number}/ports/{port_number}/nio", status_code=status.HTTP_204_NO_CONTENT) -async def delete_nio(adapter_number: int, port_number: int, node: ATMSwitch = Depends(dep_node)) -> None: +async def delete_nio(adapter_number: int, port_number: int, node: ATMSwitch = Depends(dep_node)) -> Response: """ Remove a NIO (Network Input/Output) from the node. The adapter number on the switch is always 0. @@ -178,6 +179,7 @@ async def delete_nio(adapter_number: int, port_number: int, node: ATMSwitch = De nio = await node.remove_nio(port_number) await nio.delete() + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/start") @@ -207,13 +209,14 @@ async def stop_capture( adapter_number: int = Path(..., ge=0, le=0), port_number: int, node: ATMSwitch = Depends(dep_node) -) -> None: +) -> Response: """ Stop a packet capture on the node. The adapter number on the switch is always 0. """ await node.stop_capture(port_number) + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.get("/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/stream") diff --git a/gns3server/api/routes/compute/cloud_nodes.py b/gns3server/api/routes/compute/cloud_nodes.py index 65ad686f..5ec5ea00 100644 --- a/gns3server/api/routes/compute/cloud_nodes.py +++ b/gns3server/api/routes/compute/cloud_nodes.py @@ -20,7 +20,7 @@ API routes for cloud nodes. import os -from fastapi import APIRouter, Depends, Path, status +from fastapi import APIRouter, Depends, Path, Response, status from fastapi.encoders import jsonable_encoder from fastapi.responses import StreamingResponse from typing import Union @@ -99,41 +99,43 @@ def update_cloud(node_data: schemas.CloudUpdate, node: Cloud = Depends(dep_node) @router.delete("/{node_id}", status_code=status.HTTP_204_NO_CONTENT) -async def delete_cloud(node: Cloud = Depends(dep_node)) -> None: +async def delete_cloud(node: Cloud = Depends(dep_node)) -> Response: """ Delete a cloud node. """ await Builtin.instance().delete_node(node.id) + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/start", status_code=status.HTTP_204_NO_CONTENT) -async def start_cloud(node: Cloud = Depends(dep_node)) -> None: +async def start_cloud(node: Cloud = Depends(dep_node)) -> Response: """ Start a cloud node. """ await node.start() + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/stop", status_code=status.HTTP_204_NO_CONTENT) -async def stop_cloud(node: Cloud = Depends(dep_node)) -> None: +async def stop_cloud(node: Cloud = Depends(dep_node)) -> Response: """ Stop a cloud node. This endpoint results in no action since cloud nodes cannot be stopped. """ - pass + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/suspend", status_code=status.HTTP_204_NO_CONTENT) -async def suspend_cloud(node: Cloud = Depends(dep_node)) -> None: +async def suspend_cloud(node: Cloud = Depends(dep_node)) -> Response: """ Suspend a cloud node. This endpoint results in no action since cloud nodes cannot be suspended. """ - pass + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post( @@ -188,13 +190,14 @@ async def delete_cloud_nio( adapter_number: int = Path(..., ge=0, le=0), port_number: int, node: Cloud = Depends(dep_node) -) -> None: +) -> Response: """ Remove a NIO (Network Input/Output) from the node. The adapter number on the cloud is always 0. """ await node.remove_nio(port_number) + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/start") @@ -223,13 +226,14 @@ async def stop_cloud_capture( adapter_number: int = Path(..., ge=0, le=0), port_number: int, node: Cloud = Depends(dep_node) -) -> None: +) -> Response: """ Stop a packet capture on the node. The adapter number on the cloud is always 0. """ await node.stop_capture(port_number) + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.get("/{node_id}/adapters/{adapter_number}/ports/{port_number}/pcap") diff --git a/gns3server/api/routes/compute/compute.py b/gns3server/api/routes/compute/compute.py index d97ab3f2..518f7441 100644 --- a/gns3server/api/routes/compute/compute.py +++ b/gns3server/api/routes/compute/compute.py @@ -34,7 +34,7 @@ from gns3server.compute.virtualbox import VirtualBox from gns3server.compute.vmware import VMware from gns3server import schemas -from fastapi import APIRouter, HTTPException, Body, status +from fastapi import APIRouter, HTTPException, Body, Response, status from fastapi.encoders import jsonable_encoder from uuid import UUID from typing import Optional, List @@ -150,7 +150,7 @@ async def get_qemu_capabilities() -> dict: status_code=status.HTTP_204_NO_CONTENT, responses={403: {"model": schemas.ErrorMessage, "description": "Forbidden to create Qemu image"}}, ) -async def create_qemu_image(image_data: schemas.QemuImageCreate) -> None: +async def create_qemu_image(image_data: schemas.QemuImageCreate) -> Response: """ Create a Qemu image. """ @@ -163,13 +163,15 @@ async def create_qemu_image(image_data: schemas.QemuImageCreate) -> None: image_data.qemu_img, image_data.path, jsonable_encoder(image_data, exclude_unset=True) ) + return Response(status_code=status.HTTP_204_NO_CONTENT) + @router.put( "/qemu/img", status_code=status.HTTP_204_NO_CONTENT, responses={403: {"model": schemas.ErrorMessage, "description": "Forbidden to update Qemu image"}}, ) -async def update_qemu_image(image_data: schemas.QemuImageUpdate) -> None: +async def update_qemu_image(image_data: schemas.QemuImageUpdate) -> Response: """ Update a Qemu image. """ @@ -181,6 +183,8 @@ async def update_qemu_image(image_data: schemas.QemuImageUpdate) -> None: if image_data.extend: await Qemu.instance().resize_disk(image_data.qemu_img, image_data.path, image_data.extend) + return Response(status_code=status.HTTP_204_NO_CONTENT) + @router.get("/virtualbox/vms", response_model=List[dict]) async def get_virtualbox_vms() -> List[dict]: diff --git a/gns3server/api/routes/compute/docker_nodes.py b/gns3server/api/routes/compute/docker_nodes.py index 042f2312..61426730 100644 --- a/gns3server/api/routes/compute/docker_nodes.py +++ b/gns3server/api/routes/compute/docker_nodes.py @@ -20,7 +20,7 @@ API routes for Docker nodes. import os -from fastapi import APIRouter, WebSocket, Depends, Body, status +from fastapi import APIRouter, WebSocket, Depends, Body, Response, status from fastapi.encoders import jsonable_encoder from fastapi.responses import StreamingResponse from uuid import UUID @@ -132,66 +132,73 @@ async def update_docker_node(node_data: schemas.DockerUpdate, node: DockerVM = D @router.post("/{node_id}/start", status_code=status.HTTP_204_NO_CONTENT) -async def start_docker_node(node: DockerVM = Depends(dep_node)) -> None: +async def start_docker_node(node: DockerVM = Depends(dep_node)) -> Response: """ Start a Docker node. """ await node.start() + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/stop", status_code=status.HTTP_204_NO_CONTENT) -async def stop_docker_node(node: DockerVM = Depends(dep_node)) -> None: +async def stop_docker_node(node: DockerVM = Depends(dep_node)) -> Response: """ Stop a Docker node. """ await node.stop() + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/suspend", status_code=status.HTTP_204_NO_CONTENT) -async def suspend_docker_node(node: DockerVM = Depends(dep_node)) -> None: +async def suspend_docker_node(node: DockerVM = Depends(dep_node)) -> Response: """ Suspend a Docker node. """ await node.pause() + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/reload", status_code=status.HTTP_204_NO_CONTENT) -async def reload_docker_node(node: DockerVM = Depends(dep_node)) -> None: +async def reload_docker_node(node: DockerVM = Depends(dep_node)) -> Response: """ Reload a Docker node. """ await node.restart() + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/pause", status_code=status.HTTP_204_NO_CONTENT) -async def pause_docker_node(node: DockerVM = Depends(dep_node)) -> None: +async def pause_docker_node(node: DockerVM = Depends(dep_node)) -> Response: """ Pause a Docker node. """ await node.pause() + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/unpause", status_code=status.HTTP_204_NO_CONTENT) -async def unpause_docker_node(node: DockerVM = Depends(dep_node)) -> None: +async def unpause_docker_node(node: DockerVM = Depends(dep_node)) -> Response: """ Unpause a Docker node. """ await node.unpause() + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.delete("/{node_id}", status_code=status.HTTP_204_NO_CONTENT) -async def delete_docker_node(node: DockerVM = Depends(dep_node)) -> None: +async def delete_docker_node(node: DockerVM = Depends(dep_node)) -> Response: """ Delete a Docker node. """ await node.delete() + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/duplicate", response_model=schemas.Docker, status_code=status.HTTP_201_CREATED) @@ -250,13 +257,14 @@ async def delete_docker_node_nio( adapter_number: int, port_number: int, node: DockerVM = Depends(dep_node) -) -> None: +) -> Response: """ Delete a NIO (Network Input/Output) from the node. The port number on the Docker node is always 0. """ await node.adapter_remove_nio_binding(adapter_number) + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/start") @@ -284,13 +292,14 @@ async def stop_docker_node_capture( adapter_number: int, port_number: int, node: DockerVM = Depends(dep_node) -) -> None: +) -> Response: """ Stop a packet capture on the node. The port number on the Docker node is always 0. """ await node.stop_capture(adapter_number) + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.get("/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/stream") @@ -319,6 +328,7 @@ async def console_ws(websocket: WebSocket, node: DockerVM = Depends(dep_node)) - @router.post("/{node_id}/console/reset", status_code=status.HTTP_204_NO_CONTENT) -async def reset_console(node: DockerVM = Depends(dep_node)) -> None: +async def reset_console(node: DockerVM = Depends(dep_node)) -> Response: await node.reset_console() + return Response(status_code=status.HTTP_204_NO_CONTENT) diff --git a/gns3server/api/routes/compute/dynamips_nodes.py b/gns3server/api/routes/compute/dynamips_nodes.py index 81317fd6..981dd282 100644 --- a/gns3server/api/routes/compute/dynamips_nodes.py +++ b/gns3server/api/routes/compute/dynamips_nodes.py @@ -21,7 +21,7 @@ API routes for Dynamips nodes. import os import sys -from fastapi import APIRouter, WebSocket, Depends, status +from fastapi import APIRouter, WebSocket, Depends, Response, status from fastapi.encoders import jsonable_encoder from fastapi.responses import StreamingResponse from typing import List @@ -105,16 +105,17 @@ async def update_router(node_data: schemas.DynamipsUpdate, node: Router = Depend @router.delete("/{node_id}", status_code=status.HTTP_204_NO_CONTENT) -async def delete_router(node: Router = Depends(dep_node)) -> None: +async def delete_router(node: Router = Depends(dep_node)) -> Response: """ Delete a Dynamips router. """ await Dynamips.instance().delete_node(node.id) + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/start", status_code=status.HTTP_204_NO_CONTENT) -async def start_router(node: Router = Depends(dep_node)) -> None: +async def start_router(node: Router = Depends(dep_node)) -> Response: """ Start a Dynamips router. """ @@ -124,39 +125,44 @@ async def start_router(node: Router = Depends(dep_node)) -> None: except GeneratorExit: pass await node.start() + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/stop", status_code=status.HTTP_204_NO_CONTENT) -async def stop_router(node: Router = Depends(dep_node)) -> None: +async def stop_router(node: Router = Depends(dep_node)) -> Response: """ Stop a Dynamips router. """ await node.stop() + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/suspend", status_code=status.HTTP_204_NO_CONTENT) -async def suspend_router(node: Router = Depends(dep_node)) -> None: +async def suspend_router(node: Router = Depends(dep_node)) -> Response: await node.suspend() + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/resume", status_code=status.HTTP_204_NO_CONTENT) -async def resume_router(node: Router = Depends(dep_node)) -> None: +async def resume_router(node: Router = Depends(dep_node)) -> Response: """ Resume a suspended Dynamips router. """ await node.resume() + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/reload", status_code=status.HTTP_204_NO_CONTENT) -async def reload_router(node: Router = Depends(dep_node)) -> None: +async def reload_router(node: Router = Depends(dep_node)) -> Response: """ Reload a suspended Dynamips router. """ await node.reload() + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post( @@ -202,13 +208,14 @@ async def update_nio( @router.delete("/{node_id}/adapters/{adapter_number}/ports/{port_number}/nio", status_code=status.HTTP_204_NO_CONTENT) -async def delete_nio(adapter_number: int, port_number: int, node: Router = Depends(dep_node)) -> None: +async def delete_nio(adapter_number: int, port_number: int, node: Router = Depends(dep_node)) -> Response: """ Delete a NIO (Network Input/Output) from the node. """ nio = await node.slot_remove_nio_binding(adapter_number, port_number) await nio.delete() + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/start") @@ -240,12 +247,13 @@ async def start_capture( @router.post( "/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/stop", status_code=status.HTTP_204_NO_CONTENT ) -async def stop_capture(adapter_number: int, port_number: int, node: Router = Depends(dep_node)) -> None: +async def stop_capture(adapter_number: int, port_number: int, node: Router = Depends(dep_node)) -> Response: """ Stop a packet capture on the node. """ await node.stop_capture(adapter_number, port_number) + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.get("/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/stream") @@ -303,6 +311,7 @@ async def console_ws(websocket: WebSocket, node: Router = Depends(dep_node)) -> @router.post("/{node_id}/console/reset", status_code=status.HTTP_204_NO_CONTENT) -async def reset_console(node: Router = Depends(dep_node)) -> None: +async def reset_console(node: Router = Depends(dep_node)) -> Response: await node.reset_console() + return Response(status_code=status.HTTP_204_NO_CONTENT) diff --git a/gns3server/api/routes/compute/ethernet_hub_nodes.py b/gns3server/api/routes/compute/ethernet_hub_nodes.py index 783cd397..fe7999ee 100644 --- a/gns3server/api/routes/compute/ethernet_hub_nodes.py +++ b/gns3server/api/routes/compute/ethernet_hub_nodes.py @@ -20,7 +20,7 @@ API routes for Ethernet hub nodes. import os -from fastapi import APIRouter, Depends, Body, Path, status +from fastapi import APIRouter, Depends, Body, Path, Response, status from fastapi.encoders import jsonable_encoder from fastapi.responses import StreamingResponse from uuid import UUID @@ -108,42 +108,43 @@ async def update_ethernet_hub( @router.delete("/{node_id}", status_code=status.HTTP_204_NO_CONTENT) -async def delete_ethernet_hub(node: EthernetHub = Depends(dep_node)) -> None: +async def delete_ethernet_hub(node: EthernetHub = Depends(dep_node)) -> Response: """ Delete an Ethernet hub. """ await Dynamips.instance().delete_node(node.id) + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/start", status_code=status.HTTP_204_NO_CONTENT) -def start_ethernet_hub(node: EthernetHub = Depends(dep_node)) -> None: +def start_ethernet_hub(node: EthernetHub = Depends(dep_node)) -> Response: """ Start an Ethernet hub. This endpoint results in no action since Ethernet hub nodes are always on. """ - pass + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/stop", status_code=status.HTTP_204_NO_CONTENT) -def stop_ethernet_hub(node: EthernetHub = Depends(dep_node)) -> None: +def stop_ethernet_hub(node: EthernetHub = Depends(dep_node)) -> Response: """ Stop an Ethernet hub. This endpoint results in no action since Ethernet hub nodes are always on. """ - pass + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/suspend", status_code=status.HTTP_204_NO_CONTENT) -def suspend_ethernet_hub(node: EthernetHub = Depends(dep_node)) -> None: +def suspend_ethernet_hub(node: EthernetHub = Depends(dep_node)) -> Response: """ Suspend an Ethernet hub. This endpoint results in no action since Ethernet hub nodes are always on. """ - pass + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post( @@ -174,7 +175,7 @@ async def delete_nio( adapter_number: int = Path(..., ge=0, le=0), port_number: int, node: EthernetHub = Depends(dep_node) -) -> None: +) -> Response: """ Delete a NIO (Network Input/Output) from the node. The adapter number on the hub is always 0. @@ -182,6 +183,7 @@ async def delete_nio( nio = await node.remove_nio(port_number) await nio.delete() + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/start") @@ -210,13 +212,14 @@ async def stop_capture( adapter_number: int = Path(..., ge=0, le=0), port_number: int, node: EthernetHub = Depends(dep_node) -) -> None: +) -> Response: """ Stop a packet capture on the node. The adapter number on the hub is always 0. """ await node.stop_capture(port_number) + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.get("/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/stream") diff --git a/gns3server/api/routes/compute/ethernet_switch_nodes.py b/gns3server/api/routes/compute/ethernet_switch_nodes.py index 3375dd19..d3ca028b 100644 --- a/gns3server/api/routes/compute/ethernet_switch_nodes.py +++ b/gns3server/api/routes/compute/ethernet_switch_nodes.py @@ -20,7 +20,7 @@ API routes for Ethernet switch nodes. import os -from fastapi import APIRouter, Depends, Body, Path, status +from fastapi import APIRouter, Depends, Body, Path, Response, status from fastapi.encoders import jsonable_encoder from fastapi.responses import StreamingResponse from uuid import UUID @@ -112,42 +112,43 @@ async def update_ethernet_switch( @router.delete("/{node_id}", status_code=status.HTTP_204_NO_CONTENT) -async def delete_ethernet_switch(node: EthernetSwitch = Depends(dep_node)) -> None: +async def delete_ethernet_switch(node: EthernetSwitch = Depends(dep_node)) -> Response: """ Delete an Ethernet switch. """ await Dynamips.instance().delete_node(node.id) + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/start", status_code=status.HTTP_204_NO_CONTENT) -def start_ethernet_switch(node: EthernetSwitch = Depends(dep_node)) -> None: +def start_ethernet_switch(node: EthernetSwitch = Depends(dep_node)) -> Response: """ Start an Ethernet switch. This endpoint results in no action since Ethernet switch nodes are always on. """ - pass + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/stop", status_code=status.HTTP_204_NO_CONTENT) -def stop_ethernet_switch(node: EthernetSwitch = Depends(dep_node)) -> None: +def stop_ethernet_switch(node: EthernetSwitch = Depends(dep_node)) -> Response: """ Stop an Ethernet switch. This endpoint results in no action since Ethernet switch nodes are always on. """ - pass + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/suspend", status_code=status.HTTP_204_NO_CONTENT) -def suspend_ethernet_switch(node: EthernetSwitch = Depends(dep_node)) -> None: +def suspend_ethernet_switch(node: EthernetSwitch = Depends(dep_node)) -> Response: """ Suspend an Ethernet switch. This endpoint results in no action since Ethernet switch nodes are always on. """ - pass + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post( @@ -174,7 +175,7 @@ async def delete_nio( adapter_number: int = Path(..., ge=0, le=0), port_number: int, node: EthernetSwitch = Depends(dep_node) -) -> None: +) -> Response: """ Delete a NIO (Network Input/Output) from the node. The adapter number on the switch is always 0. @@ -182,6 +183,7 @@ async def delete_nio( nio = await node.remove_nio(port_number) await nio.delete() + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/start") @@ -210,13 +212,14 @@ async def stop_capture( adapter_number: int = Path(..., ge=0, le=0), port_number: int, node: EthernetSwitch = Depends(dep_node) -) -> None: +) -> Response: """ Stop a packet capture on the node. The adapter number on the switch is always 0. """ await node.stop_capture(port_number) + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.get("/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/stream") diff --git a/gns3server/api/routes/compute/frame_relay_switch_nodes.py b/gns3server/api/routes/compute/frame_relay_switch_nodes.py index d0ea5537..9d0f61ce 100644 --- a/gns3server/api/routes/compute/frame_relay_switch_nodes.py +++ b/gns3server/api/routes/compute/frame_relay_switch_nodes.py @@ -20,7 +20,7 @@ API routes for Frame Relay switch nodes. import os -from fastapi import APIRouter, Depends, Body, Path, status +from fastapi import APIRouter, Depends, Body, Path, Response, status from fastapi.encoders import jsonable_encoder from fastapi.responses import StreamingResponse from uuid import UUID @@ -112,42 +112,43 @@ async def update_frame_relay_switch( @router.delete("/{node_id}", status_code=status.HTTP_204_NO_CONTENT) -async def delete_frame_relay_switch(node: FrameRelaySwitch = Depends(dep_node)) -> None: +async def delete_frame_relay_switch(node: FrameRelaySwitch = Depends(dep_node)) -> Response: """ Delete a Frame Relay switch node. """ await Dynamips.instance().delete_node(node.id) + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/start", status_code=status.HTTP_204_NO_CONTENT) -def start_frame_relay_switch(node: FrameRelaySwitch = Depends(dep_node)) -> None: +def start_frame_relay_switch(node: FrameRelaySwitch = Depends(dep_node)) -> Response: """ Start a Frame Relay switch node. This endpoint results in no action since Frame Relay switch nodes are always on. """ - pass + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/stop", status_code=status.HTTP_204_NO_CONTENT) -def stop_frame_relay_switch(node: FrameRelaySwitch = Depends(dep_node)) -> None: +def stop_frame_relay_switch(node: FrameRelaySwitch = Depends(dep_node)) -> Response: """ Stop a Frame Relay switch node. This endpoint results in no action since Frame Relay switch nodes are always on. """ - pass + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/suspend", status_code=status.HTTP_204_NO_CONTENT) -def suspend_frame_relay_switch(node: FrameRelaySwitch = Depends(dep_node)) -> None: +def suspend_frame_relay_switch(node: FrameRelaySwitch = Depends(dep_node)) -> Response: """ Suspend a Frame Relay switch node. This endpoint results in no action since Frame Relay switch nodes are always on. """ - pass + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post( @@ -178,7 +179,7 @@ async def delete_nio( adapter_number: int = Path(..., ge=0, le=0), port_number: int, node: FrameRelaySwitch = Depends(dep_node) -) -> None: +) -> Response: """ Remove a NIO (Network Input/Output) from the node. The adapter number on the switch is always 0. @@ -186,6 +187,7 @@ async def delete_nio( nio = await node.remove_nio(port_number) await nio.delete() + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/start") @@ -214,13 +216,14 @@ async def stop_capture( adapter_number: int = Path(..., ge=0, le=0), port_number: int, node: FrameRelaySwitch = Depends(dep_node) -) -> None: +) -> Response: """ Stop a packet capture on the node. The adapter number on the switch is always 0. """ await node.stop_capture(port_number) + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.get("/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/stream") diff --git a/gns3server/api/routes/compute/images.py b/gns3server/api/routes/compute/images.py index e556c1d3..1d185949 100644 --- a/gns3server/api/routes/compute/images.py +++ b/gns3server/api/routes/compute/images.py @@ -21,7 +21,7 @@ API routes for images. import os import urllib.parse -from fastapi import APIRouter, Request, status, HTTPException +from fastapi import APIRouter, Request, status, Response, HTTPException from fastapi.responses import FileResponse from typing import List @@ -54,13 +54,14 @@ async def get_dynamips_images() -> List[str]: @router.post("/dynamips/images/{filename:path}", status_code=status.HTTP_204_NO_CONTENT) -async def upload_dynamips_image(filename: str, request: Request) -> None: +async def upload_dynamips_image(filename: str, request: Request) -> Response: """ Upload a Dynamips IOS image. """ dynamips_manager = Dynamips.instance() await dynamips_manager.write_image(urllib.parse.unquote(filename), request.stream()) + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.get("/dynamips/images/{filename:path}") @@ -95,13 +96,14 @@ async def get_iou_images() -> List[str]: @router.post("/iou/images/{filename:path}", status_code=status.HTTP_204_NO_CONTENT) -async def upload_iou_image(filename: str, request: Request) -> None: +async def upload_iou_image(filename: str, request: Request) -> Response: """ Upload an IOU image. """ iou_manager = IOU.instance() await iou_manager.write_image(urllib.parse.unquote(filename), request.stream()) + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.get("/iou/images/{filename:path}") @@ -132,10 +134,11 @@ async def get_qemu_images() -> List[str]: @router.post("/qemu/images/{filename:path}", status_code=status.HTTP_204_NO_CONTENT) -async def upload_qemu_image(filename: str, request: Request) -> None: +async def upload_qemu_image(filename: str, request: Request) -> Response: qemu_manager = Qemu.instance() await qemu_manager.write_image(urllib.parse.unquote(filename), request.stream()) + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.get("/qemu/images/{filename:path}") diff --git a/gns3server/api/routes/compute/iou_nodes.py b/gns3server/api/routes/compute/iou_nodes.py index 1234c10d..35d4f067 100644 --- a/gns3server/api/routes/compute/iou_nodes.py +++ b/gns3server/api/routes/compute/iou_nodes.py @@ -20,7 +20,7 @@ API routes for IOU nodes. import os -from fastapi import APIRouter, WebSocket, Depends, Body, status +from fastapi import APIRouter, WebSocket, Depends, Body, Response, status from fastapi.encoders import jsonable_encoder from fastapi.responses import StreamingResponse from typing import Union @@ -113,12 +113,13 @@ async def update_iou_node(node_data: schemas.IOUUpdate, node: IOUVM = Depends(de @router.delete("/{node_id}", status_code=status.HTTP_204_NO_CONTENT) -async def delete_iou_node(node: IOUVM = Depends(dep_node)) -> None: +async def delete_iou_node(node: IOUVM = Depends(dep_node)) -> Response: """ Delete an IOU node. """ await IOU.instance().delete_node(node.id) + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/duplicate", response_model=schemas.IOU, status_code=status.HTTP_201_CREATED) @@ -135,7 +136,7 @@ async def duplicate_iou_node( @router.post("/{node_id}/start", status_code=status.HTTP_204_NO_CONTENT) -async def start_iou_node(start_data: schemas.IOUStart, node: IOUVM = Depends(dep_node)) -> None: +async def start_iou_node(start_data: schemas.IOUStart, node: IOUVM = Depends(dep_node)) -> Response: """ Start an IOU node. """ @@ -146,35 +147,37 @@ async def start_iou_node(start_data: schemas.IOUStart, node: IOUVM = Depends(dep setattr(node, name, value) await node.start() - return node.asdict() + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/stop", status_code=status.HTTP_204_NO_CONTENT) -async def stop_iou_node(node: IOUVM = Depends(dep_node)) -> None: +async def stop_iou_node(node: IOUVM = Depends(dep_node)) -> Response: """ Stop an IOU node. """ await node.stop() + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/stop", status_code=status.HTTP_204_NO_CONTENT) -def suspend_iou_node(node: IOUVM = Depends(dep_node)) -> None: +def suspend_iou_node(node: IOUVM = Depends(dep_node)) -> Response: """ Suspend an IOU node. Does nothing since IOU doesn't support being suspended. """ - pass + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/reload", status_code=status.HTTP_204_NO_CONTENT) -async def reload_iou_node(node: IOUVM = Depends(dep_node)) -> None: +async def reload_iou_node(node: IOUVM = Depends(dep_node)) -> Response: """ Reload an IOU node. """ await node.reload() + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post( @@ -220,12 +223,13 @@ async def update_iou_node_nio( @router.delete("/{node_id}/adapters/{adapter_number}/ports/{port_number}/nio", status_code=status.HTTP_204_NO_CONTENT) -async def delete_iou_node_nio(adapter_number: int, port_number: int, node: IOUVM = Depends(dep_node)) -> None: +async def delete_iou_node_nio(adapter_number: int, port_number: int, node: IOUVM = Depends(dep_node)) -> Response: """ Delete a NIO (Network Input/Output) from the node. """ await node.adapter_remove_nio_binding(adapter_number, port_number) + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/start") @@ -247,12 +251,13 @@ async def start_iou_node_capture( @router.post( "/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/stop", status_code=status.HTTP_204_NO_CONTENT ) -async def stop_iou_node_capture(adapter_number: int, port_number: int, node: IOUVM = Depends(dep_node)) -> None: +async def stop_iou_node_capture(adapter_number: int, port_number: int, node: IOUVM = Depends(dep_node)) -> Response: """ Stop a packet capture on the node. """ await node.stop_capture(adapter_number, port_number) + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.get("/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/stream") @@ -280,6 +285,7 @@ async def console_ws(websocket: WebSocket, node: IOUVM = Depends(dep_node)) -> N @router.post("/{node_id}/console/reset", status_code=status.HTTP_204_NO_CONTENT) -async def reset_console(node: IOUVM = Depends(dep_node)) -> None: +async def reset_console(node: IOUVM = Depends(dep_node)) -> Response: await node.reset_console() + return Response(status_code=status.HTTP_204_NO_CONTENT) diff --git a/gns3server/api/routes/compute/nat_nodes.py b/gns3server/api/routes/compute/nat_nodes.py index c15f9225..8a0e930c 100644 --- a/gns3server/api/routes/compute/nat_nodes.py +++ b/gns3server/api/routes/compute/nat_nodes.py @@ -20,7 +20,7 @@ API routes for NAT nodes. import os -from fastapi import APIRouter, Depends, Path, status +from fastapi import APIRouter, Depends, Path, Response, status from fastapi.encoders import jsonable_encoder from fastapi.responses import StreamingResponse from typing import Union @@ -94,41 +94,43 @@ def update_nat_node(node_data: schemas.NATUpdate, node: Nat = Depends(dep_node)) @router.delete("/{node_id}", status_code=status.HTTP_204_NO_CONTENT) -async def delete_nat_node(node: Nat = Depends(dep_node)) -> None: +async def delete_nat_node(node: Nat = Depends(dep_node)) -> Response: """ Delete a cloud node. """ await Builtin.instance().delete_node(node.id) + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/start", status_code=status.HTTP_204_NO_CONTENT) -async def start_nat_node(node: Nat = Depends(dep_node)) -> None: +async def start_nat_node(node: Nat = Depends(dep_node)) -> Response: """ Start a NAT node. """ await node.start() + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/stop", status_code=status.HTTP_204_NO_CONTENT) -async def stop_nat_node(node: Nat = Depends(dep_node)) -> None: +async def stop_nat_node(node: Nat = Depends(dep_node)) -> Response: """ Stop a NAT node. This endpoint results in no action since cloud nodes cannot be stopped. """ - pass + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/suspend", status_code=status.HTTP_204_NO_CONTENT) -async def suspend_nat_node(node: Nat = Depends(dep_node)) -> None: +async def suspend_nat_node(node: Nat = Depends(dep_node)) -> Response: """ Suspend a NAT node. This endpoint results in no action since NAT nodes cannot be suspended. """ - pass + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post( @@ -183,13 +185,14 @@ async def delete_nat_node_nio( adapter_number: int = Path(..., ge=0, le=0), port_number: int, node: Nat = Depends(dep_node) -) -> None: +) -> Response: """ Remove a NIO (Network Input/Output) from the node. The adapter number on the cloud is always 0. """ await node.remove_nio(port_number) + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/start") @@ -218,13 +221,14 @@ async def stop_nat_node_capture( adapter_number: int = Path(..., ge=0, le=0), port_number: int, node: Nat = Depends(dep_node) -): +) -> Response: """ Stop a packet capture on the node. The adapter number on the cloud is always 0. """ await node.stop_capture(port_number) + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.get("/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/stream") diff --git a/gns3server/api/routes/compute/projects.py b/gns3server/api/routes/compute/projects.py index a1ddbfc4..c35cbbe4 100644 --- a/gns3server/api/routes/compute/projects.py +++ b/gns3server/api/routes/compute/projects.py @@ -25,7 +25,7 @@ import logging log = logging.getLogger() -from fastapi import APIRouter, Depends, HTTPException, Request, status +from fastapi import APIRouter, Depends, HTTPException, Request, Response, status from fastapi.encoders import jsonable_encoder from fastapi.responses import FileResponse from typing import List @@ -103,7 +103,7 @@ def get_compute_project(project: Project = Depends(dep_project)) -> schemas.Proj @router.post("/projects/{project_id}/close", status_code=status.HTTP_204_NO_CONTENT) -async def close_compute_project(project: Project = Depends(dep_project)) -> None: +async def close_compute_project(project: Project = Depends(dep_project)) -> Response: """ Close a project on the compute. """ @@ -118,17 +118,18 @@ async def close_compute_project(project: Project = Depends(dep_project)) -> None pass else: log.warning("Skip project closing, another client is listening for project notifications") + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.delete("/projects/{project_id}", status_code=status.HTTP_204_NO_CONTENT) -async def delete_compute_project(project: Project = Depends(dep_project)) -> None: +async def delete_compute_project(project: Project = Depends(dep_project)) -> Response: """ Delete project from the compute. """ await project.delete() ProjectManager.instance().remove_project(project.id) - + return Response(status_code=status.HTTP_204_NO_CONTENT) # @Route.get( # r"/projects/{project_id}/notifications", @@ -214,7 +215,11 @@ async def get_compute_project_file(file_path: str, project: Project = Depends(de @router.post("/projects/{project_id}/files/{file_path:path}", status_code=status.HTTP_204_NO_CONTENT) -async def write_compute_project_file(file_path: str, request: Request, project: Project = Depends(dep_project)) -> None: +async def write_compute_project_file( + file_path: str, + request: Request, + project: Project = Depends(dep_project) +) -> Response: file_path = urllib.parse.unquote(file_path) path = os.path.normpath(file_path) @@ -238,3 +243,5 @@ async def write_compute_project_file(file_path: str, request: Request, project: raise HTTPException(status_code=status.HTTP_404_NOT_FOUND) except PermissionError: raise HTTPException(status_code=status.HTTP_403_FORBIDDEN) + + return Response(status_code=status.HTTP_204_NO_CONTENT) \ No newline at end of file diff --git a/gns3server/api/routes/compute/qemu_nodes.py b/gns3server/api/routes/compute/qemu_nodes.py index 16a86091..66ce046a 100644 --- a/gns3server/api/routes/compute/qemu_nodes.py +++ b/gns3server/api/routes/compute/qemu_nodes.py @@ -20,7 +20,7 @@ API routes for Qemu nodes. import os -from fastapi import APIRouter, WebSocket, Depends, Body, Path, status +from fastapi import APIRouter, WebSocket, Depends, Body, Path, Response, status from fastapi.encoders import jsonable_encoder from fastapi.responses import StreamingResponse from uuid import UUID @@ -104,12 +104,13 @@ async def update_qemu_node(node_data: schemas.QemuUpdate, node: QemuVM = Depends @router.delete("/{node_id}", status_code=status.HTTP_204_NO_CONTENT) -async def delete_qemu_node(node: QemuVM = Depends(dep_node)) -> None: +async def delete_qemu_node(node: QemuVM = Depends(dep_node)) -> Response: """ Delete a Qemu node. """ await Qemu.instance().delete_node(node.id) + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/duplicate", response_model=schemas.Qemu, status_code=status.HTTP_201_CREATED) @@ -126,61 +127,67 @@ async def duplicate_qemu_node( @router.post("/{node_id}/resize_disk", status_code=status.HTTP_204_NO_CONTENT) -async def resize_qemu_node_disk(node_data: schemas.QemuDiskResize, node: QemuVM = Depends(dep_node)) -> None: +async def resize_qemu_node_disk(node_data: schemas.QemuDiskResize, node: QemuVM = Depends(dep_node)) -> Response: await node.resize_disk(node_data.drive_name, node_data.extend) + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/start", status_code=status.HTTP_204_NO_CONTENT) -async def start_qemu_node(node: QemuVM = Depends(dep_node)) -> None: +async def start_qemu_node(node: QemuVM = Depends(dep_node)) -> Response: """ Start a Qemu node. """ qemu_manager = Qemu.instance() hardware_accel = qemu_manager.config.settings.Qemu.enable_hardware_acceleration - if hardware_accel and "-no-kvm" not in node.options and "-no-hax" not in node.options: + if hardware_accel and "-machine accel=tcg" not in node.options: pm = ProjectManager.instance() if pm.check_hardware_virtualization(node) is False: pass # FIXME: check this # raise ComputeError("Cannot start VM with hardware acceleration (KVM/HAX) enabled because hardware virtualization (VT-x/AMD-V) is already used by another software like VMware or VirtualBox") await node.start() + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/stop", status_code=status.HTTP_204_NO_CONTENT) -async def stop_qemu_node(node: QemuVM = Depends(dep_node)) -> None: +async def stop_qemu_node(node: QemuVM = Depends(dep_node)) -> Response: """ Stop a Qemu node. """ await node.stop() + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/reload", status_code=status.HTTP_204_NO_CONTENT) -async def reload_qemu_node(node: QemuVM = Depends(dep_node)) -> None: +async def reload_qemu_node(node: QemuVM = Depends(dep_node)) -> Response: """ Reload a Qemu node. """ await node.reload() + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/suspend", status_code=status.HTTP_204_NO_CONTENT) -async def suspend_qemu_node(node: QemuVM = Depends(dep_node)) -> None: +async def suspend_qemu_node(node: QemuVM = Depends(dep_node)) -> Response: """ Suspend a Qemu node. """ await node.suspend() + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/resume", status_code=status.HTTP_204_NO_CONTENT) -async def resume_qemu_node(node: QemuVM = Depends(dep_node)) -> None: +async def resume_qemu_node(node: QemuVM = Depends(dep_node)) -> Response: """ Resume a Qemu node. """ await node.resume() + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post( @@ -236,13 +243,14 @@ async def delete_qemu_node_nio( adapter_number: int, port_number: int = Path(..., ge=0, le=0), node: QemuVM = Depends(dep_node) -) -> None: +) -> Response: """ Delete a NIO (Network Input/Output) from the node. The port number on the Qemu node is always 0. """ await node.adapter_remove_nio_binding(adapter_number) + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/start") @@ -270,13 +278,14 @@ async def stop_qemu_node_capture( adapter_number: int, port_number: int = Path(..., ge=0, le=0), node: QemuVM = Depends(dep_node) -) -> None: +) -> Response: """ Stop a packet capture on the node. The port number on the Qemu node is always 0. """ await node.stop_capture(adapter_number) + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.get("/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/stream") @@ -304,6 +313,7 @@ async def console_ws(websocket: WebSocket, node: QemuVM = Depends(dep_node)) -> @router.post("/{node_id}/console/reset", status_code=status.HTTP_204_NO_CONTENT) -async def reset_console(node: QemuVM = Depends(dep_node)) -> None: +async def reset_console(node: QemuVM = Depends(dep_node)) -> Response: await node.reset_console() + return Response(status_code=status.HTTP_204_NO_CONTENT) diff --git a/gns3server/api/routes/compute/virtualbox_nodes.py b/gns3server/api/routes/compute/virtualbox_nodes.py index 93b548a0..351ad58f 100644 --- a/gns3server/api/routes/compute/virtualbox_nodes.py +++ b/gns3server/api/routes/compute/virtualbox_nodes.py @@ -20,7 +20,7 @@ API routes for VirtualBox nodes. import os -from fastapi import APIRouter, WebSocket, Depends, Path, status +from fastapi import APIRouter, WebSocket, Depends, Path, Response, status from fastapi.encoders import jsonable_encoder from fastapi.responses import StreamingResponse from uuid import UUID @@ -137,57 +137,63 @@ async def update_virtualbox_node( @router.delete("/{node_id}", status_code=status.HTTP_204_NO_CONTENT) -async def delete_virtualbox_node(node: VirtualBoxVM = Depends(dep_node)) -> None: +async def delete_virtualbox_node(node: VirtualBoxVM = Depends(dep_node)) -> Response: """ Delete a VirtualBox node. """ await VirtualBox.instance().delete_node(node.id) + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/start", status_code=status.HTTP_204_NO_CONTENT) -async def start_virtualbox_node(node: VirtualBoxVM = Depends(dep_node)) -> None: +async def start_virtualbox_node(node: VirtualBoxVM = Depends(dep_node)) -> Response: """ Start a VirtualBox node. """ await node.start() + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/stop", status_code=status.HTTP_204_NO_CONTENT) -async def stop_virtualbox_node(node: VirtualBoxVM = Depends(dep_node)) -> None: +async def stop_virtualbox_node(node: VirtualBoxVM = Depends(dep_node)) -> Response: """ Stop a VirtualBox node. """ await node.stop() + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/suspend", status_code=status.HTTP_204_NO_CONTENT) -async def suspend_virtualbox_node(node: VirtualBoxVM = Depends(dep_node)) -> None: +async def suspend_virtualbox_node(node: VirtualBoxVM = Depends(dep_node)) -> Response: """ Suspend a VirtualBox node. """ await node.suspend() + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/resume", status_code=status.HTTP_204_NO_CONTENT) -async def resume_virtualbox_node(node: VirtualBoxVM = Depends(dep_node)) -> None: +async def resume_virtualbox_node(node: VirtualBoxVM = Depends(dep_node)) -> Response: """ Resume a VirtualBox node. """ await node.resume() + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/reload", status_code=status.HTTP_204_NO_CONTENT) -async def reload_virtualbox_node(node: VirtualBoxVM = Depends(dep_node)) -> None: +async def reload_virtualbox_node(node: VirtualBoxVM = Depends(dep_node)) -> Response: """ Reload a VirtualBox node. """ await node.reload() + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post( @@ -243,13 +249,14 @@ async def delete_virtualbox_node_nio( adapter_number: int, port_number: int = Path(..., ge=0, le=0), node: VirtualBoxVM = Depends(dep_node) -) -> None: +) -> Response: """ Delete a NIO (Network Input/Output) from the node. The port number on the VirtualBox node is always 0. """ await node.adapter_remove_nio_binding(adapter_number) + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/start") @@ -277,13 +284,14 @@ async def stop_virtualbox_node_capture( adapter_number: int, port_number: int = Path(..., ge=0, le=0), node: VirtualBoxVM = Depends(dep_node) -) -> None: +) -> Response: """ Stop a packet capture on the node. The port number on the VirtualBox node is always 0. """ await node.stop_capture(adapter_number) + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.get("/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/stream") @@ -312,6 +320,7 @@ async def console_ws(websocket: WebSocket, node: VirtualBoxVM = Depends(dep_node @router.post("/{node_id}/console/reset", status_code=status.HTTP_204_NO_CONTENT) -async def reset_console(node: VirtualBoxVM = Depends(dep_node)) -> None: +async def reset_console(node: VirtualBoxVM = Depends(dep_node)) -> Response: await node.reset_console() + return Response(status_code=status.HTTP_204_NO_CONTENT) diff --git a/gns3server/api/routes/compute/vmware_nodes.py b/gns3server/api/routes/compute/vmware_nodes.py index 976b749e..59c25927 100644 --- a/gns3server/api/routes/compute/vmware_nodes.py +++ b/gns3server/api/routes/compute/vmware_nodes.py @@ -20,7 +20,7 @@ API routes for VMware nodes. import os -from fastapi import APIRouter, WebSocket, Depends, Path, status +from fastapi import APIRouter, WebSocket, Depends, Path, Response, status from fastapi.encoders import jsonable_encoder from fastapi.responses import StreamingResponse from uuid import UUID @@ -103,57 +103,63 @@ def update_vmware_node(node_data: schemas.VMwareUpdate, node: VMwareVM = Depends @router.delete("/{node_id}", status_code=status.HTTP_204_NO_CONTENT) -async def delete_vmware_node(node: VMwareVM = Depends(dep_node)) -> None: +async def delete_vmware_node(node: VMwareVM = Depends(dep_node)) -> Response: """ Delete a VMware node. """ await VMware.instance().delete_node(node.id) + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/start", status_code=status.HTTP_204_NO_CONTENT) -async def start_vmware_node(node: VMwareVM = Depends(dep_node)) -> None: +async def start_vmware_node(node: VMwareVM = Depends(dep_node)) -> Response: """ Start a VMware node. """ await node.start() + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/stop", status_code=status.HTTP_204_NO_CONTENT) -async def stop_vmware_node(node: VMwareVM = Depends(dep_node)) -> None: +async def stop_vmware_node(node: VMwareVM = Depends(dep_node)) -> Response: """ Stop a VMware node. """ await node.stop() + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/suspend", status_code=status.HTTP_204_NO_CONTENT) -async def suspend_vmware_node(node: VMwareVM = Depends(dep_node)) -> None: +async def suspend_vmware_node(node: VMwareVM = Depends(dep_node)) -> Response: """ Suspend a VMware node. """ await node.suspend() + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/resume", status_code=status.HTTP_204_NO_CONTENT) -async def resume_vmware_node(node: VMwareVM = Depends(dep_node)) -> None: +async def resume_vmware_node(node: VMwareVM = Depends(dep_node)) -> Response: """ Resume a VMware node. """ await node.resume() + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/reload", status_code=status.HTTP_204_NO_CONTENT) -async def reload_vmware_node(node: VMwareVM = Depends(dep_node)) -> None: +async def reload_vmware_node(node: VMwareVM = Depends(dep_node)) -> Response: """ Reload a VMware node. """ await node.reload() + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post( @@ -207,13 +213,14 @@ async def delete_vmware_node_nio( adapter_number: int, port_number: int = Path(..., ge=0, le=0), node: VMwareVM = Depends(dep_node) -) -> None: +) -> Response: """ Delete a NIO (Network Input/Output) from the node. The port number on the VMware node is always 0. """ await node.adapter_remove_nio_binding(adapter_number) + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/start") @@ -241,13 +248,14 @@ async def stop_vmware_node_capture( adapter_number: int, port_number: int = Path(..., ge=0, le=0), node: VMwareVM = Depends(dep_node) -) -> None: +) -> Response: """ Stop a packet capture on the node. The port number on the VMware node is always 0. """ await node.stop_capture(adapter_number) + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.get("/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/stream") @@ -289,6 +297,7 @@ async def console_ws(websocket: WebSocket, node: VMwareVM = Depends(dep_node)) - @router.post("/{node_id}/console/reset", status_code=status.HTTP_204_NO_CONTENT) -async def reset_console(node: VMwareVM = Depends(dep_node)) -> None: +async def reset_console(node: VMwareVM = Depends(dep_node)) -> Response: await node.reset_console() + return Response(status_code=status.HTTP_204_NO_CONTENT) diff --git a/gns3server/api/routes/compute/vpcs_nodes.py b/gns3server/api/routes/compute/vpcs_nodes.py index 7d9ffab9..e505e78f 100644 --- a/gns3server/api/routes/compute/vpcs_nodes.py +++ b/gns3server/api/routes/compute/vpcs_nodes.py @@ -20,7 +20,7 @@ API routes for VPCS nodes. import os -from fastapi import APIRouter, WebSocket, Depends, Body, Path, status +from fastapi import APIRouter, WebSocket, Depends, Body, Path, Response, status from fastapi.encoders import jsonable_encoder from fastapi.responses import StreamingResponse from uuid import UUID @@ -93,12 +93,13 @@ def update_vpcs_node(node_data: schemas.VPCSUpdate, node: VPCSVM = Depends(dep_n @router.delete("/{node_id}", status_code=status.HTTP_204_NO_CONTENT) -async def delete_vpcs_node(node: VPCSVM = Depends(dep_node)) -> None: +async def delete_vpcs_node(node: VPCSVM = Depends(dep_node)) -> Response: """ Delete a VPCS node. """ await VPCS.instance().delete_node(node.id) + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/duplicate", response_model=schemas.VPCS, status_code=status.HTTP_201_CREATED) @@ -114,40 +115,43 @@ async def duplicate_vpcs_node( @router.post("/{node_id}/start", status_code=status.HTTP_204_NO_CONTENT) -async def start_vpcs_node(node: VPCSVM = Depends(dep_node)) -> None: +async def start_vpcs_node(node: VPCSVM = Depends(dep_node)) -> Response: """ Start a VPCS node. """ await node.start() + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/stop", status_code=status.HTTP_204_NO_CONTENT) -async def stop_vpcs_node(node: VPCSVM = Depends(dep_node)) -> None: +async def stop_vpcs_node(node: VPCSVM = Depends(dep_node)) -> Response: """ Stop a VPCS node. """ await node.stop() + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/suspend", status_code=status.HTTP_204_NO_CONTENT) -async def suspend_vpcs_node(node: VPCSVM = Depends(dep_node)) -> None: +async def suspend_vpcs_node(node: VPCSVM = Depends(dep_node)) -> Response: """ Suspend a VPCS node. Does nothing, suspend is not supported by VPCS. """ - pass + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/reload", status_code=status.HTTP_204_NO_CONTENT) -async def reload_vpcs_node(node: VPCSVM = Depends(dep_node)) -> None: +async def reload_vpcs_node(node: VPCSVM = Depends(dep_node)) -> Response: """ Reload a VPCS node. """ await node.reload() + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post( @@ -202,13 +206,14 @@ async def delete_vpcs_node_nio( adapter_number: int = Path(..., ge=0, le=0), port_number: int, node: VPCSVM = Depends(dep_node) -) -> None: +) -> Response: """ Delete a NIO (Network Input/Output) from the node. The adapter number on the VPCS node is always 0. """ await node.port_remove_nio_binding(port_number) + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/start") @@ -237,19 +242,21 @@ async def stop_vpcs_node_capture( adapter_number: int = Path(..., ge=0, le=0), port_number: int, node: VPCSVM = Depends(dep_node) -) -> None: +) -> Response: """ Stop a packet capture on the node. The adapter number on the VPCS node is always 0. """ await node.stop_capture(port_number) + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/console/reset", status_code=status.HTTP_204_NO_CONTENT) -async def reset_console(node: VPCSVM = Depends(dep_node)) -> None: +async def reset_console(node: VPCSVM = Depends(dep_node)) -> Response: await node.reset_console() + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.get("/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/stream") diff --git a/gns3server/api/routes/controller/__init__.py b/gns3server/api/routes/controller/__init__.py index 2e12010e..71e0cc02 100644 --- a/gns3server/api/routes/controller/__init__.py +++ b/gns3server/api/routes/controller/__init__.py @@ -95,7 +95,6 @@ router.include_router( router.include_router( symbols.router, - dependencies=[Depends(get_current_active_user)], prefix="/symbols", tags=["Symbols"] ) diff --git a/gns3server/api/routes/controller/computes.py b/gns3server/api/routes/controller/computes.py index 2cc8727c..34e10f5c 100644 --- a/gns3server/api/routes/controller/computes.py +++ b/gns3server/api/routes/controller/computes.py @@ -18,7 +18,7 @@ API routes for computes. """ -from fastapi import APIRouter, Depends, status +from fastapi import APIRouter, Depends, Response, status from typing import List, Union from uuid import UUID @@ -93,12 +93,13 @@ async def update_compute( @router.delete("/{compute_id}", status_code=status.HTTP_204_NO_CONTENT) async def delete_compute( compute_id: Union[str, UUID], computes_repo: ComputesRepository = Depends(get_repository(ComputesRepository)) -) -> None: +) -> Response: """ Delete a compute from the controller. """ await ComputesService(computes_repo).delete_compute(compute_id) + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.get("/{compute_id}/{emulator}/images") diff --git a/gns3server/api/routes/controller/controller.py b/gns3server/api/routes/controller/controller.py index 9fa2cbb8..0db1d6e2 100644 --- a/gns3server/api/routes/controller/controller.py +++ b/gns3server/api/routes/controller/controller.py @@ -18,7 +18,7 @@ import asyncio import signal import os -from fastapi import APIRouter, Depends, status +from fastapi import APIRouter, Depends, Response, status from fastapi.encoders import jsonable_encoder from typing import List @@ -67,15 +67,29 @@ def check_version(version: schemas.Version) -> dict: return {"version": __version__} +@router.post( + "/reload", + dependencies=[Depends(get_current_active_user)], + status_code=status.HTTP_204_NO_CONTENT, +) +async def reload() -> Response: + """ + Reload the controller + """ + + await Controller.instance().reload() + return Response(status_code=status.HTTP_204_NO_CONTENT) + + @router.post( "/shutdown", dependencies=[Depends(get_current_active_user)], status_code=status.HTTP_204_NO_CONTENT, responses={403: {"model": schemas.ErrorMessage, "description": "Server shutdown not allowed"}}, ) -async def shutdown() -> None: +async def shutdown() -> Response: """ - Shutdown the local server + Shutdown the server """ if Config.instance().settings.Server.local is False: @@ -101,6 +115,7 @@ async def shutdown() -> None: # then shutdown the server itself os.kill(os.getpid(), signal.SIGTERM) + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.get( diff --git a/gns3server/api/routes/controller/drawings.py b/gns3server/api/routes/controller/drawings.py index bce40ca7..accec9cf 100644 --- a/gns3server/api/routes/controller/drawings.py +++ b/gns3server/api/routes/controller/drawings.py @@ -18,7 +18,7 @@ API routes for drawings. """ -from fastapi import APIRouter, status +from fastapi import APIRouter, Response, status from fastapi.encoders import jsonable_encoder from typing import List from uuid import UUID @@ -76,10 +76,11 @@ async def update_drawing(project_id: UUID, drawing_id: UUID, drawing_data: schem @router.delete("/{drawing_id}", status_code=status.HTTP_204_NO_CONTENT) -async def delete_drawing(project_id: UUID, drawing_id: UUID) -> None: +async def delete_drawing(project_id: UUID, drawing_id: UUID) -> Response: """ Delete a drawing. """ project = await Controller.instance().get_loaded_project(str(project_id)) await project.delete_drawing(str(drawing_id)) + return Response(status_code=status.HTTP_204_NO_CONTENT) diff --git a/gns3server/api/routes/controller/groups.py b/gns3server/api/routes/controller/groups.py index 20b17ae4..b9ac05c4 100644 --- a/gns3server/api/routes/controller/groups.py +++ b/gns3server/api/routes/controller/groups.py @@ -19,7 +19,7 @@ API routes for user groups. """ -from fastapi import APIRouter, Depends, status +from fastapi import APIRouter, Depends, Response, status from uuid import UUID from typing import List @@ -99,7 +99,7 @@ async def update_user_group( if not user_group: raise ControllerNotFoundError(f"User group '{user_group_id}' not found") - if user_group.builtin: + if user_group.is_builtin: raise ControllerForbiddenError(f"Built-in user group '{user_group_id}' cannot be updated") return await users_repo.update_user_group(user_group_id, user_group_update) @@ -112,7 +112,7 @@ async def update_user_group( async def delete_user_group( user_group_id: UUID, users_repo: UsersRepository = Depends(get_repository(UsersRepository)), -) -> None: +) -> Response: """ Delete an user group """ @@ -121,13 +121,15 @@ async def delete_user_group( if not user_group: raise ControllerNotFoundError(f"User group '{user_group_id}' not found") - if user_group.builtin: + if user_group.is_builtin: raise ControllerForbiddenError(f"Built-in user group '{user_group_id}' cannot be deleted") success = await users_repo.delete_user_group(user_group_id) if not success: raise ControllerNotFoundError(f"User group '{user_group_id}' could not be deleted") + return Response(status_code=status.HTTP_204_NO_CONTENT) + @router.get("/{user_group_id}/members", response_model=List[schemas.User]) async def get_user_group_members( @@ -149,7 +151,7 @@ async def add_member_to_group( user_group_id: UUID, user_id: UUID, users_repo: UsersRepository = Depends(get_repository(UsersRepository)) -) -> None: +) -> Response: """ Add member to an user group. """ @@ -162,6 +164,8 @@ async def add_member_to_group( if not user_group: raise ControllerNotFoundError(f"User group '{user_group_id}' not found") + return Response(status_code=status.HTTP_204_NO_CONTENT) + @router.delete( "/{user_group_id}/members/{user_id}", @@ -171,7 +175,7 @@ async def remove_member_from_group( user_group_id: UUID, user_id: UUID, users_repo: UsersRepository = Depends(get_repository(UsersRepository)), -) -> None: +) -> Response: """ Remove member from an user group. """ @@ -184,6 +188,8 @@ async def remove_member_from_group( if not user_group: raise ControllerNotFoundError(f"User group '{user_group_id}' not found") + return Response(status_code=status.HTTP_204_NO_CONTENT) + @router.get("/{user_group_id}/roles", response_model=List[schemas.Role]) async def get_user_group_roles( @@ -206,7 +212,7 @@ async def add_role_to_group( role_id: UUID, users_repo: UsersRepository = Depends(get_repository(UsersRepository)), rbac_repo: RbacRepository = Depends(get_repository(RbacRepository)) -) -> None: +) -> Response: """ Add role to an user group. """ @@ -219,6 +225,8 @@ async def add_role_to_group( if not user_group: raise ControllerNotFoundError(f"User group '{user_group_id}' not found") + return Response(status_code=status.HTTP_204_NO_CONTENT) + @router.delete( "/{user_group_id}/roles/{role_id}", @@ -229,7 +237,7 @@ async def remove_role_from_group( role_id: UUID, users_repo: UsersRepository = Depends(get_repository(UsersRepository)), rbac_repo: RbacRepository = Depends(get_repository(RbacRepository)) -) -> None: +) -> Response: """ Remove role from an user group. """ @@ -241,3 +249,5 @@ async def remove_role_from_group( user_group = await users_repo.remove_role_from_user_group(user_group_id, role) if not user_group: raise ControllerNotFoundError(f"User group '{user_group_id}' not found") + + return Response(status_code=status.HTTP_204_NO_CONTENT) diff --git a/gns3server/api/routes/controller/links.py b/gns3server/api/routes/controller/links.py index 31ecff6e..8f1c6f9c 100644 --- a/gns3server/api/routes/controller/links.py +++ b/gns3server/api/routes/controller/links.py @@ -21,7 +21,7 @@ API routes for links. import multidict import aiohttp -from fastapi import APIRouter, Depends, Request, status +from fastapi import APIRouter, Depends, Request, Response, status from fastapi.responses import StreamingResponse from fastapi.encoders import jsonable_encoder from typing import List @@ -81,6 +81,8 @@ async def create_link(project_id: UUID, link_data: schemas.LinkCreate) -> schema link_data = jsonable_encoder(link_data, exclude_unset=True) if "filters" in link_data: await link.update_filters(link_data["filters"]) + if "link_style" in link_data: + await link.update_link_style(link_data["link_style"]) if "suspend" in link_data: await link.update_suspend(link_data["suspend"]) try: @@ -124,6 +126,8 @@ async def update_link(link_data: schemas.LinkUpdate, link: Link = Depends(dep_li link_data = jsonable_encoder(link_data, exclude_unset=True) if "filters" in link_data: await link.update_filters(link_data["filters"]) + if "link_style" in link_data: + await link.update_link_style(link_data["link_style"]) if "suspend" in link_data: await link.update_suspend(link_data["suspend"]) if "nodes" in link_data: @@ -132,13 +136,14 @@ async def update_link(link_data: schemas.LinkUpdate, link: Link = Depends(dep_li @router.delete("/{link_id}", status_code=status.HTTP_204_NO_CONTENT) -async def delete_link(project_id: UUID, link: Link = Depends(dep_link)) -> None: +async def delete_link(project_id: UUID, link: Link = Depends(dep_link)) -> Response: """ Delete a link. """ project = await Controller.instance().get_loaded_project(str(project_id)) await project.delete_link(link.id) + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{link_id}/reset", response_model=schemas.Link) @@ -165,12 +170,13 @@ async def start_capture(capture_data: dict, link: Link = Depends(dep_link)) -> s @router.post("/{link_id}/capture/stop", status_code=status.HTTP_204_NO_CONTENT) -async def stop_capture(link: Link = Depends(dep_link)) -> None: +async def stop_capture(link: Link = Depends(dep_link)) -> Response: """ Stop packet capture on the link. """ await link.stop_capture() + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.get("/{link_id}/capture/stream") diff --git a/gns3server/api/routes/controller/nodes.py b/gns3server/api/routes/controller/nodes.py index 3016d84f..c175d583 100644 --- a/gns3server/api/routes/controller/nodes.py +++ b/gns3server/api/routes/controller/nodes.py @@ -130,40 +130,44 @@ async def get_nodes(project: Project = Depends(dep_project)) -> List[schemas.Nod @router.post("/start", status_code=status.HTTP_204_NO_CONTENT) -async def start_all_nodes(project: Project = Depends(dep_project)) -> None: +async def start_all_nodes(project: Project = Depends(dep_project)) -> Response: """ Start all nodes belonging to a given project. """ await project.start_all() + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/stop", status_code=status.HTTP_204_NO_CONTENT) -async def stop_all_nodes(project: Project = Depends(dep_project)) -> None: +async def stop_all_nodes(project: Project = Depends(dep_project)) -> Response: """ Stop all nodes belonging to a given project. """ await project.stop_all() + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/suspend", status_code=status.HTTP_204_NO_CONTENT) -async def suspend_all_nodes(project: Project = Depends(dep_project)) -> None: +async def suspend_all_nodes(project: Project = Depends(dep_project)) -> Response: """ Suspend all nodes belonging to a given project. """ await project.suspend_all() + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/reload", status_code=status.HTTP_204_NO_CONTENT) -async def reload_all_nodes(project: Project = Depends(dep_project)) -> None: +async def reload_all_nodes(project: Project = Depends(dep_project)) -> Response: """ Reload all nodes belonging to a given project. """ await project.stop_all() await project.start_all() + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.get("/{node_id}", response_model=schemas.Node) @@ -197,12 +201,13 @@ async def update_node(node_data: schemas.NodeUpdate, node: Node = Depends(dep_no status_code=status.HTTP_204_NO_CONTENT, responses={**responses, 409: {"model": schemas.ErrorMessage, "description": "Cannot delete node"}}, ) -async def delete_node(node_id: UUID, project: Project = Depends(dep_project)) -> None: +async def delete_node(node_id: UUID, project: Project = Depends(dep_project)) -> Response: """ Delete a node from a project. """ await project.delete_node(str(node_id)) + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/duplicate", response_model=schemas.Node, status_code=status.HTTP_201_CREATED) @@ -216,39 +221,43 @@ async def duplicate_node(duplicate_data: schemas.NodeDuplicate, node: Node = Dep @router.post("/{node_id}/start", status_code=status.HTTP_204_NO_CONTENT) -async def start_node(start_data: dict, node: Node = Depends(dep_node)) -> None: +async def start_node(start_data: dict, node: Node = Depends(dep_node)) -> Response: """ Start a node. """ await node.start(data=start_data) + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/stop", status_code=status.HTTP_204_NO_CONTENT) -async def stop_node(node: Node = Depends(dep_node)) -> None: +async def stop_node(node: Node = Depends(dep_node)) -> Response: """ Stop a node. """ await node.stop() + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/suspend", status_code=status.HTTP_204_NO_CONTENT) -async def suspend_node(node: Node = Depends(dep_node)) -> None: +async def suspend_node(node: Node = Depends(dep_node)) -> Response: """ Suspend a node. """ await node.suspend() + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/reload", status_code=status.HTTP_204_NO_CONTENT) -async def reload_node(node: Node = Depends(dep_node)) -> None: +async def reload_node(node: Node = Depends(dep_node)) -> Response: """ Reload a node. """ await node.reload() + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.get("/{node_id}/links", response_model=List[schemas.Link], response_model_exclude_unset=True) @@ -282,11 +291,13 @@ async def idlepc_proposals(node: Node = Depends(dep_node)) -> List[str]: @router.post("/{node_id}/resize_disk", status_code=status.HTTP_204_NO_CONTENT) -async def resize_disk(resize_data: dict, node: Node = Depends(dep_node)) -> None: +async def resize_disk(resize_data: dict, node: Node = Depends(dep_node)) -> Response: """ Resize a disk image. """ + await node.post("/resize_disk", **resize_data) + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.get("/{node_id}/files/{file_path:path}") @@ -377,15 +388,17 @@ async def ws_console(websocket: WebSocket, node: Node = Depends(dep_node)) -> No @router.post("/console/reset", status_code=status.HTTP_204_NO_CONTENT) -async def reset_console_all_nodes(project: Project = Depends(dep_project)) -> None: +async def reset_console_all_nodes(project: Project = Depends(dep_project)) -> Response: """ Reset console for all nodes belonging to the project. """ await project.reset_console_all() + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{node_id}/console/reset", status_code=status.HTTP_204_NO_CONTENT) -async def console_reset(node: Node = Depends(dep_node)) -> None: +async def console_reset(node: Node = Depends(dep_node)) -> Response: - await node.post("/console/reset") # , request.json) + await node.post("/console/reset") + return Response(status_code=status.HTTP_204_NO_CONTENT) diff --git a/gns3server/api/routes/controller/permissions.py b/gns3server/api/routes/controller/permissions.py index 466a2707..fe7bf0f2 100644 --- a/gns3server/api/routes/controller/permissions.py +++ b/gns3server/api/routes/controller/permissions.py @@ -19,7 +19,7 @@ API routes for permissions. """ -from fastapi import APIRouter, Depends, status +from fastapi import APIRouter, Depends, Response, status from uuid import UUID from typing import List @@ -103,7 +103,7 @@ async def update_permission( async def delete_permission( permission_id: UUID, rbac_repo: RbacRepository = Depends(get_repository(RbacRepository)), -) -> None: +) -> Response: """ Delete a permission. """ @@ -115,3 +115,5 @@ async def delete_permission( success = await rbac_repo.delete_permission(permission_id) if not success: raise ControllerNotFoundError(f"Permission '{permission_id}' could not be deleted") + + return Response(status_code=status.HTTP_204_NO_CONTENT) diff --git a/gns3server/api/routes/controller/projects.py b/gns3server/api/routes/controller/projects.py index 55252c41..757faf6f 100644 --- a/gns3server/api/routes/controller/projects.py +++ b/gns3server/api/routes/controller/projects.py @@ -30,7 +30,7 @@ import logging log = logging.getLogger() -from fastapi import APIRouter, Depends, Request, Body, HTTPException, status, WebSocket, WebSocketDisconnect +from fastapi import APIRouter, Depends, Request, Response, Body, HTTPException, status, WebSocket, WebSocketDisconnect from fastapi.encoders import jsonable_encoder from fastapi.responses import StreamingResponse, FileResponse from websockets.exceptions import ConnectionClosed, WebSocketException @@ -48,6 +48,8 @@ from gns3server.utils.asyncio import aiozipstream from gns3server.utils.path import is_safe_path from gns3server.config import Config from gns3server.db.repositories.rbac import RbacRepository +from gns3server.db.repositories.templates import TemplatesRepository +from gns3server.services.templates import TemplatesService from .dependencies.authentication import get_current_active_user from .dependencies.database import get_repository @@ -139,7 +141,7 @@ async def update_project( async def delete_project( project: Project = Depends(dep_project), rbac_repo: RbacRepository = Depends(get_repository(RbacRepository)) -) -> None: +) -> Response: """ Delete a project. """ @@ -148,6 +150,7 @@ async def delete_project( await project.delete() controller.remove_project(project) await rbac_repo.delete_all_permissions_with_path(f"/projects/{project.id}") + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.get("/{project_id}/stats") @@ -164,12 +167,13 @@ def get_project_stats(project: Project = Depends(dep_project)) -> dict: status_code=status.HTTP_204_NO_CONTENT, responses={**responses, 409: {"model": schemas.ErrorMessage, "description": "Could not close project"}}, ) -async def close_project(project: Project = Depends(dep_project)) -> None: +async def close_project(project: Project = Depends(dep_project)) -> Response: """ Close a project. """ await project.close() + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post( @@ -413,7 +417,7 @@ async def get_file(file_path: str, project: Project = Depends(dep_project)) -> F @router.post("/{project_id}/files/{file_path:path}", status_code=status.HTTP_204_NO_CONTENT) -async def write_file(file_path: str, request: Request, project: Project = Depends(dep_project)) -> None: +async def write_file(file_path: str, request: Request, project: Project = Depends(dep_project)) -> Response: """ Write a file from a project. """ @@ -437,3 +441,30 @@ async def write_file(file_path: str, request: Request, project: Project = Depend raise HTTPException(status_code=status.HTTP_401_UNAUTHORIZED) except OSError as e: raise ControllerError(str(e)) + + return Response(status_code=status.HTTP_204_NO_CONTENT) + + +@router.post( + "/{project_id}/templates/{template_id}", + response_model=schemas.Node, + status_code=status.HTTP_201_CREATED, + responses={404: {"model": schemas.ErrorMessage, "description": "Could not find project or template"}}, +) +async def create_node_from_template( + project_id: UUID, + template_id: UUID, + template_usage: schemas.TemplateUsage, + templates_repo: TemplatesRepository = Depends(get_repository(TemplatesRepository)), +) -> schemas.Node: + """ + Create a new node from a template. + """ + + template = await TemplatesService(templates_repo).get_template(template_id) + controller = Controller.instance() + project = controller.get_project(str(project_id)) + node = await project.add_node_from_template( + template, x=template_usage.x, y=template_usage.y, compute_id=template_usage.compute_id + ) + return node.asdict() diff --git a/gns3server/api/routes/controller/roles.py b/gns3server/api/routes/controller/roles.py index c96feb64..8da951d6 100644 --- a/gns3server/api/routes/controller/roles.py +++ b/gns3server/api/routes/controller/roles.py @@ -19,7 +19,7 @@ API routes for roles. """ -from fastapi import APIRouter, Depends, status +from fastapi import APIRouter, Depends, Response, status from uuid import UUID from typing import List @@ -95,7 +95,7 @@ async def update_role( if not role: raise ControllerNotFoundError(f"Role '{role_id}' not found") - if role.builtin: + if role.is_builtin: raise ControllerForbiddenError(f"Built-in role '{role_id}' cannot be updated") return await rbac_repo.update_role(role_id, role_update) @@ -105,7 +105,7 @@ async def update_role( async def delete_role( role_id: UUID, rbac_repo: RbacRepository = Depends(get_repository(RbacRepository)), -) -> None: +) -> Response: """ Delete a role. """ @@ -114,13 +114,15 @@ async def delete_role( if not role: raise ControllerNotFoundError(f"Role '{role_id}' not found") - if role.builtin: + if role.is_builtin: raise ControllerForbiddenError(f"Built-in role '{role_id}' cannot be deleted") success = await rbac_repo.delete_role(role_id) if not success: raise ControllerNotFoundError(f"Role '{role_id}' could not be deleted") + return Response(status_code=status.HTTP_204_NO_CONTENT) + @router.get("/{role_id}/permissions", response_model=List[schemas.Permission]) async def get_role_permissions( @@ -142,7 +144,7 @@ async def add_permission_to_role( role_id: UUID, permission_id: UUID, rbac_repo: RbacRepository = Depends(get_repository(RbacRepository)) -) -> None: +) -> Response: """ Add a permission to a role. """ @@ -155,6 +157,8 @@ async def add_permission_to_role( if not role: raise ControllerNotFoundError(f"Role '{role_id}' not found") + return Response(status_code=status.HTTP_204_NO_CONTENT) + @router.delete( "/{role_id}/permissions/{permission_id}", @@ -164,7 +168,7 @@ async def remove_permission_from_role( role_id: UUID, permission_id: UUID, rbac_repo: RbacRepository = Depends(get_repository(RbacRepository)), -) -> None: +) -> Response: """ Remove member from an user group. """ @@ -176,3 +180,5 @@ async def remove_permission_from_role( role = await rbac_repo.remove_permission_from_role(role_id, permission) if not role: raise ControllerNotFoundError(f"Role '{role_id}' not found") + + return Response(status_code=status.HTTP_204_NO_CONTENT) \ No newline at end of file diff --git a/gns3server/api/routes/controller/snapshots.py b/gns3server/api/routes/controller/snapshots.py index d410e88a..b1faa8cf 100644 --- a/gns3server/api/routes/controller/snapshots.py +++ b/gns3server/api/routes/controller/snapshots.py @@ -23,7 +23,7 @@ import logging log = logging.getLogger() -from fastapi import APIRouter, Depends, status +from fastapi import APIRouter, Depends, Response, status from typing import List from uuid import UUID @@ -69,12 +69,13 @@ def get_snapshots(project: Project = Depends(dep_project)) -> List[schemas.Snaps @router.delete("/{snapshot_id}", status_code=status.HTTP_204_NO_CONTENT) -async def delete_snapshot(snapshot_id: UUID, project: Project = Depends(dep_project)) -> None: +async def delete_snapshot(snapshot_id: UUID, project: Project = Depends(dep_project)) -> Response: """ Delete a snapshot. """ await project.delete_snapshot(str(snapshot_id)) + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.post("/{snapshot_id}/restore", status_code=status.HTTP_201_CREATED, response_model=schemas.Project) diff --git a/gns3server/api/routes/controller/symbols.py b/gns3server/api/routes/controller/symbols.py index 127f2c14..40161672 100644 --- a/gns3server/api/routes/controller/symbols.py +++ b/gns3server/api/routes/controller/symbols.py @@ -21,7 +21,7 @@ API routes for symbols. import os -from fastapi import APIRouter, Request, status +from fastapi import APIRouter, Request, Depends, Response, status from fastapi.responses import FileResponse from typing import List @@ -29,6 +29,8 @@ from gns3server.controller import Controller from gns3server import schemas from gns3server.controller.controller_error import ControllerError, ControllerNotFoundError +from .dependencies.authentication import get_current_active_user + import logging log = logging.getLogger(__name__) @@ -57,7 +59,7 @@ async def get_symbol(symbol_id: str) -> FileResponse: symbol = controller.symbols.get_path(symbol_id) return FileResponse(symbol) except (KeyError, OSError) as e: - return ControllerNotFoundError(f"Could not get symbol file: {e}") + raise ControllerNotFoundError(f"Could not get symbol file: {e}") @router.get( @@ -75,11 +77,25 @@ async def get_symbol_dimensions(symbol_id: str) -> dict: symbol_dimensions = {"width": width, "height": height} return symbol_dimensions except (KeyError, OSError, ValueError) as e: - return ControllerNotFoundError(f"Could not get symbol file: {e}") + raise ControllerNotFoundError(f"Could not get symbol file: {e}") -@router.post("/{symbol_id:path}/raw", status_code=status.HTTP_204_NO_CONTENT) -async def upload_symbol(symbol_id: str, request: Request) -> None: +@router.get("/default_symbols") +def get_default_symbols() -> dict: + """ + Return all default symbols. + """ + + controller = Controller.instance() + return controller.symbols.default_symbols() + + +@router.post( + "/{symbol_id:path}/raw", + dependencies=[Depends(get_current_active_user)], + status_code=status.HTTP_204_NO_CONTENT +) +async def upload_symbol(symbol_id: str, request: Request) -> Response: """ Upload a symbol file. """ @@ -96,12 +112,4 @@ async def upload_symbol(symbol_id: str, request: Request) -> None: # Reset the symbol list controller.symbols.list() - -@router.get("/default_symbols") -def get_default_symbols() -> dict: - """ - Return all default symbols. - """ - - controller = Controller.instance() - return controller.symbols.default_symbols() + return Response(status_code=status.HTTP_204_NO_CONTENT) diff --git a/gns3server/api/routes/controller/templates.py b/gns3server/api/routes/controller/templates.py index a346545a..4f1914b5 100644 --- a/gns3server/api/routes/controller/templates.py +++ b/gns3server/api/routes/controller/templates.py @@ -25,12 +25,11 @@ import logging log = logging.getLogger(__name__) -from fastapi import APIRouter, Request, Response, HTTPException, Depends, status +from fastapi import APIRouter, Request, Response, HTTPException, Depends, Response, status from typing import List from uuid import UUID from gns3server import schemas -from gns3server.controller import Controller from gns3server.db.repositories.templates import TemplatesRepository from gns3server.services.templates import TemplatesService from gns3server.db.repositories.rbac import RbacRepository @@ -103,13 +102,14 @@ async def delete_template( template_id: UUID, templates_repo: TemplatesRepository = Depends(get_repository(TemplatesRepository)), rbac_repo: RbacRepository = Depends(get_repository(RbacRepository)) -) -> None: +) -> Response: """ Delete a template. """ await TemplatesService(templates_repo).delete_template(template_id) await rbac_repo.delete_all_permissions_with_path(f"/templates/{template_id}") + return Response(status_code=status.HTTP_204_NO_CONTENT) @router.get("/templates", response_model=List[schemas.Template], response_model_exclude_unset=True) @@ -152,28 +152,3 @@ async def duplicate_template( template = await TemplatesService(templates_repo).duplicate_template(template_id) await rbac_repo.add_permission_to_user_with_path(current_user.user_id, f"/templates/{template_id}/*") return template - - -@router.post( - "/projects/{project_id}/templates/{template_id}", - response_model=schemas.Node, - status_code=status.HTTP_201_CREATED, - responses={404: {"model": schemas.ErrorMessage, "description": "Could not find project or template"}}, -) -async def create_node_from_template( - project_id: UUID, - template_id: UUID, - template_usage: schemas.TemplateUsage, - templates_repo: TemplatesRepository = Depends(get_repository(TemplatesRepository)), -) -> schemas.Node: - """ - Create a new node from a template. - """ - - template = await TemplatesService(templates_repo).get_template(template_id) - controller = Controller.instance() - project = controller.get_project(str(project_id)) - node = await project.add_node_from_template( - template, x=template_usage.x, y=template_usage.y, compute_id=template_usage.compute_id - ) - return node.asdict() diff --git a/gns3server/api/routes/controller/users.py b/gns3server/api/routes/controller/users.py index edf53b9a..1bff6bfe 100644 --- a/gns3server/api/routes/controller/users.py +++ b/gns3server/api/routes/controller/users.py @@ -19,7 +19,7 @@ API routes for users. """ -from fastapi import APIRouter, Depends, HTTPException, status +from fastapi import APIRouter, Depends, HTTPException, Response, status from fastapi.security import OAuth2PasswordRequestForm from uuid import UUID from typing import List @@ -98,13 +98,20 @@ async def get_logged_in_user(current_user: schemas.User = Depends(get_current_ac return current_user -@router.get("/me", response_model=schemas.User) -async def get_logged_in_user(current_user: schemas.User = Depends(get_current_active_user)) -> schemas.User: +@router.put("/me", response_model=schemas.User) +async def update_logged_in_user( + user_update: schemas.LoggedInUserUpdate, + current_user: schemas.User = Depends(get_current_active_user), + users_repo: UsersRepository = Depends(get_repository(UsersRepository)) +) -> schemas.User: """ - Get the current active user. + Update the current active user. """ - return current_user + if user_update.email and await users_repo.get_user_by_email(user_update.email): + raise ControllerBadRequestError(f"Email '{user_update.email}' is already registered") + + return await users_repo.update_user(current_user.user_id, user_update) @router.get("", response_model=List[schemas.User], dependencies=[Depends(get_current_active_user)]) @@ -166,6 +173,12 @@ async def update_user( Update an user. """ + if user_update.username and await users_repo.get_user_by_username(user_update.username): + raise ControllerBadRequestError(f"Username '{user_update.username}' is already registered") + + if user_update.email and await users_repo.get_user_by_email(user_update.email): + raise ControllerBadRequestError(f"Email '{user_update.email}' is already registered") + user = await users_repo.update_user(user_id, user_update) if not user: raise ControllerNotFoundError(f"User '{user_id}' not found") @@ -180,7 +193,7 @@ async def update_user( async def delete_user( user_id: UUID, users_repo: UsersRepository = Depends(get_repository(UsersRepository)), -) -> None: +) -> Response: """ Delete an user. """ @@ -196,6 +209,8 @@ async def delete_user( if not success: raise ControllerNotFoundError(f"User '{user_id}' could not be deleted") + return Response(status_code=status.HTTP_204_NO_CONTENT) + @router.get( "/{user_id}/groups", @@ -238,7 +253,7 @@ async def add_permission_to_user( user_id: UUID, permission_id: UUID, rbac_repo: RbacRepository = Depends(get_repository(RbacRepository)) -) -> None: +) -> Response: """ Add a permission to an user. """ @@ -251,6 +266,8 @@ async def add_permission_to_user( if not user: raise ControllerNotFoundError(f"User '{user_id}' not found") + return Response(status_code=status.HTTP_204_NO_CONTENT) + @router.delete( "/{user_id}/permissions/{permission_id}", @@ -261,7 +278,7 @@ async def remove_permission_from_user( user_id: UUID, permission_id: UUID, rbac_repo: RbacRepository = Depends(get_repository(RbacRepository)), -) -> None: +) -> Response: """ Remove permission from an user. """ @@ -273,3 +290,5 @@ async def remove_permission_from_user( user = await rbac_repo.remove_permission_from_user(user_id, permission) if not user: raise ControllerNotFoundError(f"User '{user_id}' not found") + + return Response(status_code=status.HTTP_204_NO_CONTENT) diff --git a/gns3server/appliances/6wind-turbo-router.gns3a b/gns3server/appliances/6wind-turbo-router.gns3a new file mode 100644 index 00000000..56c4062b --- /dev/null +++ b/gns3server/appliances/6wind-turbo-router.gns3a @@ -0,0 +1,46 @@ +{ + "name": "6WIND Turbo Router", + "category": "router", + "description": "6WIND Turbo Router is a high performance, ready-to-use software virtual router. It can be deployed bare metal or in virtual machines on commercial-off-the-shelf (COTS) servers. It is a carrier-grade solution for Service Prodivers aiming at using white boxes to deploy network functions. Typical use-cases are transit/peering router, IPsec VPN gateway and CGNAT.", + "vendor_name": "6WIND", + "vendor_url": "https://www.6wind.com/", + "documentation_url": "https://doc.6wind.com/turbo-router-3/latest/turbo-router/", + "product_name": "6WIND Turbo Router", + "product_url": "https://www.6wind.com/vrouter-solutions/turbo-router/", + "registry_version": 4, + "status": "stable", + "maintainer": "GNS3 Team", + "maintainer_email": "developers@gns3.net", + "usage": "Default username / password is admin / admin.", + "symbol": "6wind.svg", + "port_name_format": "eth{0}", + "qemu": { + "adapter_type": "virtio-net-pci", + "adapters": 8, + "ram": 4096, + "cpus": 4, + "hda_disk_interface": "virtio", + "arch": "x86_64", + "console_type": "telnet", + "boot_priority": "c", + "kvm": "require", + "options": "-cpu host" + }, + "images": [ + { + "filename": "6wind-vrouter-tr-ae-x86_64-v3.1.4.m1.qcow2", + "version": "3.1.4.m1", + "md5sum": "bc84b81fba4f2f01eda6a338469e37a5", + "filesize": 693829632, + "download_url": "https://portal.6wind.com/register.php?utm_campaign=GNS3-2021-EVAL" + } + ], + "versions": [ + { + "name": "3.1.4.m1", + "images": { + "hda_disk_image": "6wind-vrouter-tr-ae-x86_64-v3.1.4.m1.qcow2" + } + } + ] +} diff --git a/gns3server/appliances/aruba-arubaoscx.gns3a b/gns3server/appliances/aruba-arubaoscx.gns3a index 2be46fbe..16094598 100644 --- a/gns3server/appliances/aruba-arubaoscx.gns3a +++ b/gns3server/appliances/aruba-arubaoscx.gns3a @@ -29,7 +29,6 @@ "process_priority": "normal" }, "images": [ - { "filename": "arubaoscx-disk-image-genericx86-p4-20201110192651.vmdk", "version": "10.06.0001", diff --git a/gns3server/appliances/aruba-vgw.gns3a b/gns3server/appliances/aruba-vgw.gns3a index 61b40582..17a709ed 100644 --- a/gns3server/appliances/aruba-vgw.gns3a +++ b/gns3server/appliances/aruba-vgw.gns3a @@ -5,8 +5,8 @@ "vendor_name": "HPE Aruba", "vendor_url": "arubanetworks.com", "documentation_url": "https://asp.arubanetworks.com/downloads;products=Aruba%20SD-WAN", - "product_url": "https://www.arubanetworks.com/products/networking/gateways-and-controllers/", "product_name": "Aruba SD-WAN Virtual Gateway", + "product_url": "https://www.arubanetworks.com/products/networking/gateways-and-controllers/", "registry_version": 4, "status": "stable", "availability": "service-contract", diff --git a/gns3server/appliances/cisco-asa.gns3a b/gns3server/appliances/cisco-asa.gns3a index 8ccb9831..69afb053 100644 --- a/gns3server/appliances/cisco-asa.gns3a +++ b/gns3server/appliances/cisco-asa.gns3a @@ -22,7 +22,7 @@ "console_type": "telnet", "kernel_command_line": "ide_generic.probe_mask=0x01 ide_core.chs=0.0:980,16,32 auto nousb console=ttyS0,9600 bigphysarea=65536 ide1=noprobe no-hlt", "kvm": "disable", - "options": "-no-kvm -icount auto -hdachs 980,16,32", + "options": "-machine accel=tcg -icount auto -hdachs 980,16,32", "cpu_throttling": 80, "process_priority": "low" }, diff --git a/gns3server/appliances/cisco-asav.gns3a b/gns3server/appliances/cisco-asav.gns3a index 8093a531..ca8e47b9 100644 --- a/gns3server/appliances/cisco-asav.gns3a +++ b/gns3server/appliances/cisco-asav.gns3a @@ -25,6 +25,20 @@ "kvm": "require" }, "images": [ + { + "filename": "asav9-15-1.qcow2", + "version": "9.15.1", + "md5sum": "4e8747667f52e9046979f126128a61d1", + "filesize": 252444672, + "download_url": "https://software.cisco.com/download/home/286119613/type/280775065/release/9.15.1" + }, + { + "filename": "asav9-14-1.qcow2", + "version": "9.14.1", + "md5sum": "03d89e18e7f8ad00fe8e979c4790587d", + "filesize": 211877888, + "download_url": "https://software.cisco.com/download/home/286119613/type/280775065/release/9.14.1" + }, { "filename": "asav9-12-2-9.qcow2", "version": "9.12.2-9", @@ -90,6 +104,18 @@ } ], "versions": [ + { + "name": "9.15.1", + "images": { + "hda_disk_image": "asav9-15-1.qcow2" + } + }, + { + "name": "9.14.1", + "images": { + "hda_disk_image": "asav9-14-1.qcow2" + } + }, { "name": "9.12.2-9", "images": { diff --git a/gns3server/appliances/cisco-iosv.gns3a b/gns3server/appliances/cisco-iosv.gns3a index 5def210f..89832630 100644 --- a/gns3server/appliances/cisco-iosv.gns3a +++ b/gns3server/appliances/cisco-iosv.gns3a @@ -31,7 +31,14 @@ "download_url": "https://sourceforge.net/projects/gns-3/files", "direct_download_url": "https://sourceforge.net/projects/gns-3/files/Qemu%20Appliances/IOSv_startup_config.img/download" }, - { + { + "filename": "vios-adventerprisek9-m.spa.159-3.m3.qcow2", + "version": "15.9(3)M3", + "md5sum": "12893843af18e4c62f13d07266755653", + "filesize": 57296384, + "download_url": "https://learningnetworkstore.cisco.com/myaccount" + }, + { "filename": "vios-adventerprisek9-m.spa.159-3.m2.qcow2", "version": "15.9(3)M2", "md5sum": "a19e998bc3086825c751d125af722329", @@ -75,7 +82,14 @@ } ], "versions": [ - { + { + "name": "15.9(3)M3", + "images": { + "hda_disk_image": "vios-adventerprisek9-m.spa.159-3.m3.qcow2", + "hdb_disk_image": "IOSv_startup_config.img" + } + }, + { "name": "15.9(3)M2", "images": { "hda_disk_image": "vios-adventerprisek9-m.spa.159-3.m2.qcow2", diff --git a/gns3server/appliances/cisco-iosvl2.gns3a b/gns3server/appliances/cisco-iosvl2.gns3a index 496841bc..02a7af5b 100644 --- a/gns3server/appliances/cisco-iosvl2.gns3a +++ b/gns3server/appliances/cisco-iosvl2.gns3a @@ -23,6 +23,13 @@ "kvm": "require" }, "images": [ + { + "filename": "vios_l2-adventerprisek9-m.ssa.high_iron_20200929.qcow2", + "version": "15.2(20200924:215240)", + "md5sum": "99ecab32de12410c533e6abd4e9710aa", + "filesize": 90409984, + "download_url": "https://learningnetworkstore.cisco.com/myaccount" + }, { "filename": "vios_l2-adventerprisek9-m.ssa.high_iron_20190423.qcow2", "version": "15.2(6.0.81)E", @@ -53,6 +60,12 @@ } ], "versions": [ + { + "name": "15.2(20200924:215240)", + "images": { + "hda_disk_image": "vios_l2-adventerprisek9-m.ssa.high_iron_20200929.qcow2" + } + }, { "name": "15.2(6.0.81)E", "images": { diff --git a/gns3server/appliances/cumulus-vx.gns3a b/gns3server/appliances/cumulus-vx.gns3a index 970b2297..884ac4e5 100644 --- a/gns3server/appliances/cumulus-vx.gns3a +++ b/gns3server/appliances/cumulus-vx.gns3a @@ -25,12 +25,12 @@ }, "images": [ { - "filename": "cumulus-linux-4.3.0-vx-amd64-qemu.qcow2", - "version": "4.3.0", - "md5sum": "aba2f0bb462b26a208afb6202bc97d51", - "filesize": 2819325952, - "download_url": "https://cumulusnetworks.com/cumulus-vx/download/", - "direct_download_url": "https://d2cd9e7ca6hntp.cloudfront.net/public/CumulusLinux-4.3.0/cumulus-linux-4.3.0-vx-amd64-qemu.qcow2" + "filename": "cumulus-linux-4.3.0-vx-amd64-qemu.qcow2", + "version": "4.3.0", + "md5sum": "aba2f0bb462b26a208afb6202bc97d51", + "filesize": 2819325952, + "download_url": "https://cumulusnetworks.com/cumulus-vx/download/", + "direct_download_url": "https://d2cd9e7ca6hntp.cloudfront.net/public/CumulusLinux-4.3.0/cumulus-linux-4.3.0-vx-amd64-qemu.qcow2" }, { "filename": "cumulus-linux-4.2.0-vx-amd64-qemu.qcow2", @@ -233,7 +233,7 @@ { "name": "4.3.0", "images": { - "hda_disk_image": "cumulus-linux-4.3.0-vx-amd64-qemu.qcow2" + "hda_disk_image": "cumulus-linux-4.3.0-vx-amd64-qemu.qcow2" } }, { diff --git a/gns3server/appliances/exos.gns3a b/gns3server/appliances/exos.gns3a index 7ee67774..5e51b1a3 100644 --- a/gns3server/appliances/exos.gns3a +++ b/gns3server/appliances/exos.gns3a @@ -26,7 +26,7 @@ "options": "-cpu core2duo" }, "images": [ - { + { "filename": "EXOS-VM_v31.1.1.3.qcow2", "version": "31.1.1.3", "md5sum": "e4936ad94a5304bfeeca8dfc6f285cc0", diff --git a/gns3server/appliances/extreme-networks-voss.gns3a b/gns3server/appliances/extreme-networks-voss.gns3a index f1592e8b..54d99ca9 100644 --- a/gns3server/appliances/extreme-networks-voss.gns3a +++ b/gns3server/appliances/extreme-networks-voss.gns3a @@ -26,19 +26,26 @@ "options": "-nographic" }, "images": [ + { + "filename": "VOSSGNS3.8.4.0.0.qcow2", + "version": "v8.4.0.0", + "md5sum": "f457e7da3c1dec50670624c421333ef3", + "filesize": 386203648, + "direct_download_url": "https://akamai-ep.extremenetworks.com/Extreme_P/github-en/Virtual_VOSS/VOSSGNS3.8.4.0.0.qcow2" + }, { "filename": "VOSSGNS3.8.3.0.0.qcow2", "version": "v8.3.0.0", "md5sum": "e1c789e439c5951728e349cf44690230", "filesize": 384696320, - "direct_download_url": "https://akamai-ep.extremenetworks.com/Extreme_P/github-en/Virtual_VOSS/VOSSGNS3.8.3.0.0.qcow2" + "direct_download_url": "https://akamai-ep.extremenetworks.com/Extreme_P/github-en/Virtual_VOSS/VOSSGNS3.8.3.0.0.qcow2" }, - { + { "filename": "VOSSGNS3.8.2.0.0.qcow2", "version": "v8.2.0.0", "md5sum": "9a0cd77c08644abbf3a69771c125c011", "filesize": 331808768, - "direct_download_url": "https://akamai-ep.extremenetworks.com/Extreme_P/github-en/Virtual_VOSS/VOSSGNS3.8.2.0.0.qcow2" + "direct_download_url": "https://akamai-ep.extremenetworks.com/Extreme_P/github-en/Virtual_VOSS/VOSSGNS3.8.2.0.0.qcow2" }, { "filename": "VOSSGNS3.8.1.5.0.qcow2", @@ -70,18 +77,24 @@ } ], "versions": [ + { + "name": "v8.4.0.0", + "images": { + "hda_disk_image": "VOSSGNS3.8.4.0.0.qcow2" + } + }, { "name": "v8.3.0.0", "images": { "hda_disk_image": "VOSSGNS3.8.3.0.0.qcow2" } - }, - { + }, + { "name": "v8.2.0.0", "images": { "hda_disk_image": "VOSSGNS3.8.2.0.0.qcow2" } - }, + }, { "name": "8.1.5.0", "images": { diff --git a/gns3server/appliances/fortianalyzer.gns3a b/gns3server/appliances/fortianalyzer.gns3a index 1db35d13..b16940a2 100644 --- a/gns3server/appliances/fortianalyzer.gns3a +++ b/gns3server/appliances/fortianalyzer.gns3a @@ -179,8 +179,8 @@ { "name": "6.4.5", "images": { - "hda_disk_image": "FAZ_VM64_KVM-v6-build2288-FORTINET.out.kvm.qcow2", - "hdb_disk_image": "empty30G.qcow2" + "hda_disk_image": "FAZ_VM64_KVM-v6-build2288-FORTINET.out.kvm.qcow2", + "hdb_disk_image": "empty30G.qcow2" } }, { diff --git a/gns3server/appliances/fortigate.gns3a b/gns3server/appliances/fortigate.gns3a index fe88e94c..4e933a54 100644 --- a/gns3server/appliances/fortigate.gns3a +++ b/gns3server/appliances/fortigate.gns3a @@ -254,11 +254,11 @@ ], "versions": [ { - "name": "6.4.5", - "images": { - "hda_disk_image": "FGT_VM64_KVM-v6-build1828-FORTINET.out.kvm.qcow2", - "hdb_disk_image": "empty30G.qcow2" - } + "name": "6.4.5", + "images": { + "hda_disk_image": "FGT_VM64_KVM-v6-build1828-FORTINET.out.kvm.qcow2", + "hdb_disk_image": "empty30G.qcow2" + } }, { "name": "6.2.2", diff --git a/gns3server/appliances/fortimanager.gns3a b/gns3server/appliances/fortimanager.gns3a index f913d843..8f75a84e 100644 --- a/gns3server/appliances/fortimanager.gns3a +++ b/gns3server/appliances/fortimanager.gns3a @@ -179,15 +179,15 @@ { "name": "6.4.5", "images": { - "hda_disk_image": "FMG_VM64_KVM-v6-build2288-FORTINET.out.kvm.qcow2", - "hdb_disk_image": "empty30G.qcow2" + "hda_disk_image": "FMG_VM64_KVM-v6-build2288-FORTINET.out.kvm.qcow2", + "hdb_disk_image": "empty30G.qcow2" } }, { "name": "6.4.4", "images": { - "hda_disk_image": "FMG_VM64_KVM-v6-build2253-FORTINET.out.kvm.qcow2", - "hdb_disk_image": "empty30G.qcow2" + "hda_disk_image": "FMG_VM64_KVM-v6-build2253-FORTINET.out.kvm.qcow2", + "hdb_disk_image": "empty30G.qcow2" } }, { diff --git a/gns3server/appliances/frr.gns3a b/gns3server/appliances/frr.gns3a index ae25e7cb..2765dd81 100644 --- a/gns3server/appliances/frr.gns3a +++ b/gns3server/appliances/frr.gns3a @@ -21,6 +21,14 @@ "kvm": "allow" }, "images": [ + { + "filename": "frr-7.5.1.qcow2", + "version": "7.5.1", + "md5sum": "4b3ca0932a396b282ba35f102be1ed3b", + "filesize": 51169280, + "download_url": "https://sourceforge.net/projects/gns-3/files/Qemu%20Appliances/", + "direct_download_url": "http://downloads.sourceforge.net/project/gns-3/Qemu%20Appliances/frr-7.5.1.qcow2" + }, { "filename": "frr-7.3.1.qcow2", "version": "7.3.1", @@ -31,6 +39,12 @@ } ], "versions": [ + { + "name": "7.5.1", + "images": { + "hda_disk_image": "frr-7.5.1.qcow2" + } + }, { "name": "7.3.1", "images": { diff --git a/gns3server/appliances/huawei-ar1kv.gns3a b/gns3server/appliances/huawei-ar1kv.gns3a index fbad35b9..46fba486 100644 --- a/gns3server/appliances/huawei-ar1kv.gns3a +++ b/gns3server/appliances/huawei-ar1kv.gns3a @@ -6,7 +6,7 @@ "vendor_url": "https://www.huawei.com", "product_name": "HuaWei AR1000v", "product_url": "https://support.huawei.com/enterprise/en/routers/ar1000v-pid-21768212", - "registry_version": 5, + "registry_version": 4, "status": "experimental", "availability": "service-contract", "maintainer": "none", diff --git a/gns3server/appliances/huawei-ce12800.gns3a b/gns3server/appliances/huawei-ce12800.gns3a index 4cc5eb0c..135c4522 100644 --- a/gns3server/appliances/huawei-ce12800.gns3a +++ b/gns3server/appliances/huawei-ce12800.gns3a @@ -5,7 +5,7 @@ "vendor_name": "HuaWei", "vendor_url": "https://www.huawei.com", "product_name": "HuaWei CE12800", - "registry_version": 5, + "registry_version": 4, "status": "experimental", "availability": "service-contract", "maintainer": "none", @@ -33,10 +33,10 @@ ], "versions": [ { + "name": "V200R005C10SPC607B607", "images": { "hda_disk_image": "ce12800-V200R005C10SPC607B607.qcow2" - }, - "name": "V200R005C10SPC607B607" + } } ] } diff --git a/gns3server/appliances/huawei-ne40e.gns3a b/gns3server/appliances/huawei-ne40e.gns3a index 73ed94ca..4c07b542 100644 --- a/gns3server/appliances/huawei-ne40e.gns3a +++ b/gns3server/appliances/huawei-ne40e.gns3a @@ -6,7 +6,7 @@ "vendor_url": "https://www.huawei.com", "product_name": "HuaWei NE40E", "product_url": "https://e.huawei.com/en/products/enterprise-networking/routers/ne/ne40e", - "registry_version": 5, + "registry_version": 4, "status": "experimental", "availability": "service-contract", "maintainer": "none", @@ -35,10 +35,10 @@ ], "versions": [ { + "name": "V800R011C00SPC607B607", "images": { "hda_disk_image": "ne40e-V800R011C00SPC607B607.qcow2" - }, - "name": "V800R011C00SPC607B607" + } } ] -} \ No newline at end of file +} diff --git a/gns3server/appliances/huawei-usg6kv.gns3a b/gns3server/appliances/huawei-usg6kv.gns3a index 4655f92a..21256ac6 100644 --- a/gns3server/appliances/huawei-usg6kv.gns3a +++ b/gns3server/appliances/huawei-usg6kv.gns3a @@ -6,7 +6,7 @@ "vendor_url": "https://www.huawei.com", "product_name": "HuaWei USG6000v", "product_url": "https://e.huawei.com/en/products/enterprise-networking/security/firewall-gateway/usg6000v", - "registry_version": 5, + "registry_version": 4, "status": "experimental", "availability": "service-contract", "maintainer": "none", diff --git a/gns3server/appliances/kali-linux.gns3a b/gns3server/appliances/kali-linux.gns3a index 06288bd7..ea215748 100644 --- a/gns3server/appliances/kali-linux.gns3a +++ b/gns3server/appliances/kali-linux.gns3a @@ -23,6 +23,14 @@ "kvm": "require" }, "images": [ + { + "filename": "kali-linux-2021.1-live-amd64.iso", + "version": "2021.1", + "md5sum": "3a3716fef866e5c29a1c1ccfc94264b5", + "filesize": 3591385088, + "download_url": "http://cdimage.kali.org/kali-2021.1/", + "direct_download_url": "http://cdimage.kali.org/kali-2021.1/kali-linux-2021.1-live-amd64.iso" + }, { "filename": "kali-linux-2019.3-amd64.iso", "version": "2019.3", @@ -137,6 +145,13 @@ } ], "versions": [ + { + "name": "2021.1", + "images": { + "hda_disk_image": "kali-linux-persistence-1gb.qcow2", + "cdrom_image": "kali-linux-2021.1-live-amd64.iso" + } + }, { "name": "2019.3", "images": { diff --git a/gns3server/appliances/ntopng.gns3a b/gns3server/appliances/ntopng.gns3a index c2f3c940..6c5b58c6 100644 --- a/gns3server/appliances/ntopng.gns3a +++ b/gns3server/appliances/ntopng.gns3a @@ -3,16 +3,18 @@ "category": "guest", "description": "ntopng is the next generation version of the original ntop, a network traffic probe that shows the network usage, similar to what the popular top Unix command does. ntopng is based on libpcap and it has been written in a portable way in order to virtually run on every Unix platform, MacOSX and on Windows as well. ntopng users can use a a web browser to navigate through ntop (that acts as a web server) traffic information and get a dump of the network status. In the latter case, ntopng can be seen as a simple RMON-like agent with an embedded web interface.", "vendor_name": "ntop", - "vendor_url": "http://www.ntop.org/", + "vendor_url": "https://www.ntop.org/", + "documentation_url": "https://www.ntop.org/guides/ntopng/", "product_name": "ntopng", "registry_version": 3, "status": "stable", "maintainer": "GNS3 Team", "maintainer_email": "developers@gns3.net", - "usage": "In the web interface login as admin/admin", + "usage": "In the web interface login as admin/admin\n\nPersistent configuration:\n- Add \"/var/lib/redis\" as an additional persistent directory.\n- Use \"redis-cli save\" in an auxiliary console to save the configuration.", "docker": { "adapters": 1, - "image": "lucaderi/ntopng-docker:latest", + "image": "ntop/ntopng:stable", + "start_command": "--dns-mode 2 --interface eth0", "console_type": "http", "console_http_port": 3000, "console_http_path": "/" diff --git a/gns3server/appliances/open-media-vault.gns3a b/gns3server/appliances/open-media-vault.gns3a index 9e0d624c..6bc5ef04 100644 --- a/gns3server/appliances/open-media-vault.gns3a +++ b/gns3server/appliances/open-media-vault.gns3a @@ -19,7 +19,7 @@ "ram": 2048, "hda_disk_interface": "ide", "hdb_disk_interface": "ide", - "arch": "x86_64", + "arch": "x86_64", "console_type": "vnc", "boot_priority": "dc", "kvm": "require" @@ -52,4 +52,4 @@ } } ] -} \ No newline at end of file +} diff --git a/gns3server/appliances/openwrt.gns3a b/gns3server/appliances/openwrt.gns3a index f5782536..a8b8fca8 100644 --- a/gns3server/appliances/openwrt.gns3a +++ b/gns3server/appliances/openwrt.gns3a @@ -22,7 +22,7 @@ "kvm": "allow" }, "images": [ - { + { "filename": "openwrt-19.07.7-x86-64-combined-ext4.img", "version": "19.07.7", "md5sum": "0cfa752fab87014419ab00b18a6cc5a6", diff --git a/gns3server/appliances/puppy-linux.gns3a b/gns3server/appliances/puppy-linux.gns3a index 24315993..a0d6a435 100644 --- a/gns3server/appliances/puppy-linux.gns3a +++ b/gns3server/appliances/puppy-linux.gns3a @@ -26,7 +26,7 @@ "filename": "fossapup64-9.5.iso", "version": "9.5", "md5sum": "6a45e7a305b7d3172ebd9eab5ca460e4", - "filesize": 428867584, + "filesize": 428867584, "download_url": "http://puppylinux.com/index.html", "direct_download_url": "http://distro.ibiblio.org/puppylinux/puppy-fossa/fossapup64-9.5.iso" }, diff --git a/gns3server/appliances/rhel.gns3a b/gns3server/appliances/rhel.gns3a index 29a87362..22b3ab72 100644 --- a/gns3server/appliances/rhel.gns3a +++ b/gns3server/appliances/rhel.gns3a @@ -7,7 +7,7 @@ "documentation_url": "https://access.redhat.com/solutions/641193", "product_name": "Red Hat Enterprise Linux KVM Guest Image", "product_url": "https://www.redhat.com/en/technologies/linux-platforms/enterprise-linux", - "registry_version": 5, + "registry_version": 4, "status": "stable", "availability": "service-contract", "maintainer": "Neyder Achahuanco", @@ -56,25 +56,25 @@ ], "versions": [ { + "name": "8.3", "images": { "hda_disk_image": "rhel-8.3-x86_64-kvm.qcow2", "cdrom_image": "rhel-cloud-init.iso" - }, - "name": "8.3" + } }, { + "name": "7.9", "images": { "hda_disk_image": "rhel-server-7.9-x86_64-kvm.qcow2", "cdrom_image": "rhel-cloud-init.iso" - }, - "name": "7.9" + } }, { + "name": "6.10", "images": { "hda_disk_image": "rhel-server-6.10-update-11-x86_64-kvm.qcow2", "cdrom_image": "rhel-cloud-init.iso" - }, - "name": "6.10" + } } ] } diff --git a/gns3server/appliances/rockylinux.gns3a b/gns3server/appliances/rockylinux.gns3a new file mode 100644 index 00000000..789918d3 --- /dev/null +++ b/gns3server/appliances/rockylinux.gns3a @@ -0,0 +1,45 @@ +{ + "name": "RockyLinux", + "category": "guest", + "description": "Rocky Linux is a community enterprise operating system designed to be 100% bug-for-bug compatible with Red Hat Enterprise Linux (RHEL).", + "vendor_name": "Rocky Enterprise Software Foundation", + "vendor_url": "https://rockylinux.org", + "documentation_url": "https://docs.rockylinux.org", + "product_name": "Rocky Linux", + "registry_version": 4, + "status": "experimental", + "maintainer": "Bernhard Ehlers", + "maintainer_email": "none@b-ehlers.de", + "usage": "Username:\trockylinux\nPassword:\trockylinux\nTo become root, use \"sudo su\".\n\nTo improve performance, increase RAM and vCPUs in the VM settings.", + "symbol": "linux_guest.svg", + "port_name_format": "ens{port4}", + "qemu": { + "adapter_type": "virtio-net-pci", + "adapters": 1, + "ram": 1536, + "hda_disk_interface": "sata", + "arch": "x86_64", + "console_type": "vnc", + "kvm": "require", + "options": "-usbdevice tablet" + }, + "images": [ + { + "filename": "RockyLinux_8.4_VMG_LinuxVMImages.COM.vmdk", + "version": "8.4", + "md5sum": "3452d5b0fbb4cdcf3ac6fe8de8d0ac08", + "filesize": 5273878528, + "download_url": "https://www.linuxvmimages.com/images/rockylinux-8", + "direct_download_url": "https://sourceforge.net/projects/linuxvmimages/files/VMware/R/rockylinux/8/RockyLinux_8.4_VMM.7z/download", + "compression": "7z" + } + ], + "versions": [ + { + "name": "8.4", + "images": { + "hda_disk_image": "RockyLinux_8.4_VMG_LinuxVMImages.COM.vmdk" + } + } + ] +} diff --git a/gns3server/appliances/tinycore-linux.gns3a b/gns3server/appliances/tinycore-linux.gns3a index 1fcee667..17e4825b 100644 --- a/gns3server/appliances/tinycore-linux.gns3a +++ b/gns3server/appliances/tinycore-linux.gns3a @@ -1,7 +1,7 @@ { "name": "Tiny Core Linux", "category": "guest", - "description": "Core Linux is a smaller variant of Tiny Core without a graphical desktop.\n\nIt provides a complete Linux system using only a few MiB." , + "description": "Core Linux is a smaller variant of Tiny Core without a graphical desktop.\n\nIt provides a complete Linux system using only a few MiB.", "vendor_name": "Team Tiny Core", "vendor_url": "http://distro.ibiblio.org/tinycorelinux", "documentation_url": "http://wiki.tinycorelinux.net/", diff --git a/gns3server/appliances/vyos.gns3a b/gns3server/appliances/vyos.gns3a index 2801dbec..aba9a41d 100644 --- a/gns3server/appliances/vyos.gns3a +++ b/gns3server/appliances/vyos.gns3a @@ -26,12 +26,19 @@ }, "images": [ { - "filename": "vyos-1.3-rolling-202101-qemu.qcow2", - "version": "1.3-snapshot-202101", - "md5sum": "b05a1f8a879c42342ea90f65ebe62f05", - "filesize": 315359232, - "download_url": "https://vyos.net/get/snapshots/", - "direct_download_url": "https://s3.amazonaws.com/s3-us.vyos.io/snapshot/vyos-1.3-rolling-202101/qemu/vyos-1.3-rolling-202101-qemu.qcow2" + "filename": "vyos-1.3.0-rc5-amd64.qcow2", + "version": "1.3.0-rc5", + "md5sum": "dd704f59afc0fccdf601cc750bf2c438", + "filesize": 361955328, + "download_url": "https://www.b-ehlers.de/GNS3/images/", + "direct_download_url": "https://www.b-ehlers.de/GNS3/images/vyos-1.3.0-rc5-amd64.qcow2" + }, + { + "filename": "vyos-1.2.8-amd64.iso", + "version": "1.2.8", + "md5sum": "0ad879db903efdbf1c39dc945e165931", + "filesize": 429916160, + "download_url": "https://support.vyos.io/en/downloads/files/vyos-1-2-8-generic-iso-image" }, { "filename": "vyos-1.2.7-amd64.iso", @@ -59,9 +66,16 @@ ], "versions": [ { - "name": "1.3-snapshot-202101", + "name": "1.3.0-rc5", "images": { - "hda_disk_image": "vyos-1.3-rolling-202101-qemu.qcow2" + "hda_disk_image": "vyos-1.3.0-rc5-amd64.qcow2" + } + }, + { + "name": "1.2.8", + "images": { + "hda_disk_image": "empty8G.qcow2", + "cdrom_image": "vyos-1.2.8-amd64.iso" } }, { diff --git a/gns3server/appliances/windows-xp+ie.gns3a b/gns3server/appliances/windows-xp+ie.gns3a index 6bd31aa9..f5aeb0c6 100644 --- a/gns3server/appliances/windows-xp+ie.gns3a +++ b/gns3server/appliances/windows-xp+ie.gns3a @@ -48,4 +48,4 @@ } } ] -} \ No newline at end of file +} diff --git a/gns3server/compute/builtin/nodes/cloud.py b/gns3server/compute/builtin/nodes/cloud.py index dc7b1de0..098ffcff 100644 --- a/gns3server/compute/builtin/nodes/cloud.py +++ b/gns3server/compute/builtin/nodes/cloud.py @@ -430,6 +430,7 @@ class Cloud(BaseNode): await self._add_ubridge_connection(nio, port_number) self._nios[port_number] = nio except (NodeError, UbridgeError) as e: + log.error('Cannot add NIO on cloud "{name}": {error}'.format(name=self._name, error=e)) await self._stop_ubridge() self.status = "stopped" self._nios[port_number] = nio diff --git a/gns3server/compute/qemu/qemu_vm.py b/gns3server/compute/qemu/qemu_vm.py index ed0cbefa..3077b973 100644 --- a/gns3server/compute/qemu/qemu_vm.py +++ b/gns3server/compute/qemu/qemu_vm.py @@ -669,7 +669,7 @@ class QemuVM(BaseNode): if not mac_address: # use the node UUID to generate a random MAC address - self._mac_address = f"0c:{self.project.id[-4:-2]}:{self.project.id[-2:]}:{self.id[-4:-2]}:{self.id[-2:]}:00" + self._mac_address = f"0c:{self.id[2:4]}:{self.id[4:6]}:{self.id[6:8]}:00:00" else: self._mac_address = mac_address @@ -912,20 +912,26 @@ class QemuVM(BaseNode): ) ) - if not sys.platform.startswith("linux"): - if "-no-kvm" in options: - options = options.replace("-no-kvm", "") - if "-enable-kvm" in options: + # "-no-kvm" and "-no-hax' are deprecated since Qemu v5.2 + if "-no-kvm" in options: + options = options.replace("-no-kvm", "-machine accel=tcg") + if "-no-hax" in options: + options = options.replace("-no-hax", "-machine accel=tcg") + + if "-enable-kvm" in options: + if not sys.platform.startswith("linux"): + # KVM can only be enabled on Linux options = options.replace("-enable-kvm", "") - else: - if "-no-hax" in options: - options = options.replace("-no-hax", "") - if "-enable-hax" in options: + else: + options = options.replace("-enable-kvm", "-machine accel=kvm") + + if "-enable-hax" in options: + if not sys.platform.startswith("win"): + # HAXM is only available on Windows options = options.replace("-enable-hax", "") - if "-icount" in options and ("-no-kvm" not in options): - # automatically add the -no-kvm option if -icount is detected - # to help with the migration of ASA VMs created before version 1.4 - options = "-no-kvm " + options + else: + options = options.replace("-enable-hax", "-machine accel=hax") + self._options = options.strip() @property @@ -1862,6 +1868,24 @@ class QemuVM(BaseNode): try: qemu_img_path = self._get_qemu_img() command = [qemu_img_path, "create", "-o", f"backing_file={disk_image}", "-f", "qcow2", disk] + try: + base_qcow2 = Qcow2(disk_image) + if base_qcow2.crypt_method: + # Workaround for https://gitlab.com/qemu-project/qemu/-/issues/441 + # Also embed a secret name so it doesn't have to be passed to qemu -drive ... + options = { + "encrypt.key-secret": os.path.basename(disk_image), + "driver": "qcow2", + "file": { + "driver": "file", + "filename": disk_image, + }, + } + command = [qemu_img_path, "create", "-b", "json:"+json.dumps(options, separators=(',', ':')), + "-f", "qcow2", "-u", disk, str(base_qcow2.size)] + except Qcow2Error: + pass # non-qcow2 base images are acceptable (e.g. vmdk, raw image) + retcode = await self._qemu_img_exec(command) if retcode: stdout = self.read_qemu_img_stdout() @@ -2070,7 +2094,7 @@ class QemuVM(BaseNode): # The disk exists we check if the clone works try: qcow2 = Qcow2(disk) - await qcow2.rebase(qemu_img_path, disk_image) + await qcow2.validate(qemu_img_path) except (Qcow2Error, OSError) as e: raise QemuError(f"Could not use qcow2 disk image '{disk_image}' for {disk_name} {e}") @@ -2310,7 +2334,7 @@ class QemuVM(BaseNode): enable_hardware_accel = self.manager.config.settings.Qemu.enable_hardware_acceleration require_hardware_accel = self.manager.config.settings.Qemu.require_hardware_acceleration - if enable_hardware_accel and "-no-kvm" not in options and "-no-hax" not in options: + if enable_hardware_accel and "-machine accel=tcg" not in options: # Turn OFF hardware acceleration for non x86 architectures if sys.platform.startswith("win"): supported_binaries = [ diff --git a/gns3server/compute/qemu/utils/qcow2.py b/gns3server/compute/qemu/utils/qcow2.py index 1119bb60..52269f36 100644 --- a/gns3server/compute/qemu/utils/qcow2.py +++ b/gns3server/compute/qemu/utils/qcow2.py @@ -58,13 +58,12 @@ class Qcow2: # uint64_t snapshots_offset; # } QCowHeader; - struct_format = ">IIQi" - with open(self._path, "rb") as f: + struct_format = ">IIQiiQi" + with open(self._path, 'rb') as f: content = f.read(struct.calcsize(struct_format)) try: - self.magic, self.version, self.backing_file_offset, self.backing_file_size = struct.unpack_from( - struct_format, content - ) + (self.magic, self.version, self.backing_file_offset, self.backing_file_size, + self.cluster_bits, self.size, self.crypt_method) = struct.unpack_from(struct_format, content) except struct.error: raise Qcow2Error(f"Invalid file header for {self._path}") @@ -105,3 +104,15 @@ class Qcow2: if retcode != 0: raise Qcow2Error("Could not rebase the image") self._reload() + + async def validate(self, qemu_img): + """ + Run qemu-img info to validate the file and its backing images + + :param qemu_img: Path to the qemu-img binary + """ + command = [qemu_img, "info", "--backing-chain", self._path] + process = await asyncio.create_subprocess_exec(*command) + retcode = await process.wait() + if retcode != 0: + raise Qcow2Error("Could not validate the image") diff --git a/gns3server/compute/vmware/__init__.py b/gns3server/compute/vmware/__init__.py index 569c642e..fb439798 100644 --- a/gns3server/compute/vmware/__init__.py +++ b/gns3server/compute/vmware/__init__.py @@ -26,6 +26,7 @@ import asyncio import subprocess import logging import codecs +import ipaddress from collections import OrderedDict from gns3server.utils.interfaces import interfaces @@ -50,6 +51,7 @@ class VMware(BaseManager): self._vmrun_path = None self._host_type = None self._vmnets = [] + self._vmnets_info = {} self._vmnet_start_range = 2 if sys.platform.startswith("win"): self._vmnet_end_range = 19 @@ -277,7 +279,7 @@ class VMware(BaseManager): else: # location on Linux vmware_networking_file = "/etc/vmware/networking" - vmnet_interfaces = [] + vmnet_interfaces = {} try: with open(vmware_networking_file, encoding="utf-8") as f: for line in f.read().splitlines(): @@ -285,7 +287,20 @@ class VMware(BaseManager): if match: vmnet = f"vmnet{match.group(1)}" if vmnet not in ("vmnet0", "vmnet1", "vmnet8"): - vmnet_interfaces.append(vmnet) + vmnet_interfaces[vmnet] = {} + with open(vmware_networking_file, "r", encoding="utf-8") as f: + for line in f.read().splitlines(): + match = re.search(r"VNET_([0-9]+)_HOSTONLY_SUBNET\s+(.*)", line) + if match: + vmnet = "vmnet{}".format(match.group(1)) + if vmnet in vmnet_interfaces.keys(): + vmnet_interfaces[vmnet]["subnet"] = match.group(2) + match = re.search(r"VNET_([0-9]+)_HOSTONLY_NETMASK\s+(.*)", line) + if match: + vmnet = "vmnet{}".format(match.group(1)) + if vmnet in vmnet_interfaces.keys(): + vmnet_interfaces[vmnet]["netmask"] = match.group(2) + except OSError as e: raise VMwareError(f"Cannot open {vmware_networking_file}: {e}") return vmnet_interfaces @@ -330,6 +345,25 @@ class VMware(BaseManager): ) return self._vmnets.pop(0) + def find_bridge_interface(self, vmnet_interface): + """ + Find the bridge interface that is used for the vmnet interface in VMware. + """ + + if vmnet_interface in self._vmnets_info.keys(): + subnet = self._vmnets_info[vmnet_interface].get("subnet", None) + netmask = self._vmnets_info[vmnet_interface].get("netmask", None) + if subnet and netmask: + for interface in interfaces(): + try: + network = ipaddress.ip_network(f"{subnet}/{netmask}") + ip = ipaddress.ip_address(interface["ip_address"]) + except ValueError: + continue + if ip in network: + return interface["name"] + return None + def refresh_vmnet_list(self, ubridge=True): if ubridge: @@ -337,6 +371,8 @@ class VMware(BaseManager): vmnet_interfaces = self._get_vmnet_interfaces_ubridge() else: vmnet_interfaces = self._get_vmnet_interfaces() + vmnet_interfaces = list(vmnet_interfaces.keys()) + self._vmnets_info = vmnet_interfaces.copy() # remove vmnets already in use for vmware_vm in self._nodes.values(): @@ -754,5 +790,4 @@ class VMware(BaseManager): if __name__ == "__main__": loop = asyncio.get_event_loop() vmware = VMware.instance() - print("=> Check version") loop.run_until_complete(asyncio.ensure_future(vmware.check_vmware_version())) diff --git a/gns3server/compute/vmware/vmware_vm.py b/gns3server/compute/vmware/vmware_vm.py index 6478f2a4..ac8cc836 100644 --- a/gns3server/compute/vmware/vmware_vm.py +++ b/gns3server/compute/vmware/vmware_vm.py @@ -22,9 +22,11 @@ import sys import os import asyncio import tempfile +import platform from gns3server.utils.asyncio.telnet_server import AsyncioTelnetServer from gns3server.utils.asyncio.serial import asyncio_open_serial +from gns3server.utils import parse_version from gns3server.utils.asyncio import locking from collections import OrderedDict from .vmware_error import VMwareError @@ -260,8 +262,13 @@ class VMwareVM(BaseNode): if self._get_vmx_setting(connected): del self._vmx_pairs[connected] + use_ubridge = True + # use alternative method to find vmnet interfaces on macOS >= 11.0 (BigSur) + # because "bridge" interfaces are used instead and they are only created on the VM starts + if sys.platform.startswith("darwin") and parse_version(platform.mac_ver()[0]) >= parse_version("11.0.0"): + use_ubridge = False + self.manager.refresh_vmnet_list(ubridge=use_ubridge) # then configure VMware network adapters - self.manager.refresh_vmnet_list() for adapter_number in range(0, self._adapters): custom_adapter = self._get_custom_adapter_settings(adapter_number) @@ -347,8 +354,17 @@ class VMwareVM(BaseNode): vmnet_interface = os.path.basename(self._vmx_pairs[vnet]) if sys.platform.startswith("darwin"): - # special case on OSX, we cannot bind VMnet interfaces using the libpcap - await self._ubridge_send(f'bridge add_nio_fusion_vmnet {vnet} "{vmnet_interface}"') + if parse_version(platform.mac_ver()[0]) >= parse_version("11.0.0"): + # a bridge interface (bridge100, bridge101 etc.) is used instead of a vmnet interface + # on macOS >= 11.0 (Big Sur) + vmnet_interface = self.manager.find_bridge_interface(vmnet_interface) + if not vmnet_interface: + raise VMwareError(f"Could not find bridge interface linked with {vmnet_interface}") + block_host_traffic = self.manager.config.get_section_config("VMware").getboolean("block_host_traffic", False) + await self._add_ubridge_ethernet_connection(vnet, vmnet_interface, block_host_traffic) + else: + # special case on macOS, we cannot bind VMnet interfaces using the libpcap + await self._ubridge_send('bridge add_nio_fusion_vmnet {name} "{interface}"'.format(name=vnet, interface=vmnet_interface)) else: block_host_traffic = self.manager.config.VMware.block_host_traffic await self._add_ubridge_ethernet_connection(vnet, vmnet_interface, block_host_traffic) diff --git a/gns3server/controller/import_project.py b/gns3server/controller/import_project.py index 2348fe73..f653cece 100644 --- a/gns3server/controller/import_project.py +++ b/gns3server/controller/import_project.py @@ -39,7 +39,8 @@ Handle the import of project from a .gns3project """ -async def import_project(controller, project_id, stream, location=None, name=None, keep_compute_id=False): +async def import_project(controller, project_id, stream, location=None, name=None, keep_compute_id=False, + auto_start=False, auto_open=False, auto_close=True): """ Import a project contain in a zip file @@ -99,9 +100,9 @@ async def import_project(controller, project_id, stream, location=None, name=Non topology = load_topology(os.path.join(path, "project.gns3")) topology["name"] = project_name # To avoid unexpected behavior (project start without manual operations just after import) - topology["auto_start"] = False - topology["auto_open"] = False - topology["auto_close"] = True + topology["auto_start"] = auto_start + topology["auto_open"] = auto_open + topology["auto_close"] = auto_close # Generate a new node id node_old_to_new = {} diff --git a/gns3server/controller/link.py b/gns3server/controller/link.py index d5a1bc41..b4a02c0e 100644 --- a/gns3server/controller/link.py +++ b/gns3server/controller/link.py @@ -85,6 +85,7 @@ class Link: self._link_type = "ethernet" self._suspended = False self._filters = {} + self._link_style = {} @property def filters(self): @@ -170,6 +171,13 @@ class Link: self._project.emit_notification("link.updated", self.asdict()) self._project.dump() + async def update_link_style(self, link_style): + if link_style != self._link_style: + self._link_style = link_style + await self.update() + self._project.emit_notification("link.updated", self.asdict()) + self._project.dump() + @property def created(self): """ @@ -432,7 +440,13 @@ class Link: } ) if topology_dump: - return {"nodes": res, "link_id": self._id, "filters": self._filters, "suspend": self._suspended} + return { + "nodes": res, + "link_id": self._id, + "filters": self._filters, + "link_style": self._link_style, + "suspend": self._suspended, + } return { "nodes": res, "link_id": self._id, @@ -444,4 +458,5 @@ class Link: "link_type": self._link_type, "filters": self._filters, "suspend": self._suspended, + "link_style": self._link_style, } diff --git a/gns3server/controller/project.py b/gns3server/controller/project.py index 51146194..996c1a05 100644 --- a/gns3server/controller/project.py +++ b/gns3server/controller/project.py @@ -966,6 +966,8 @@ class Project: link = await self.add_link(link_id=link_data["link_id"]) if "filters" in link_data: await link.update_filters(link_data["filters"]) + if "link_style" in link_data: + await link.update_link_style(link_data["link_style"]) for node_link in link_data.get("nodes", []): node = self.get_node(node_link["node_id"]) port = node.get_port(node_link["adapter_number"], node_link["port_number"]) diff --git a/gns3server/controller/snapshot.py b/gns3server/controller/snapshot.py index 5b389d74..1b6d480b 100644 --- a/gns3server/controller/snapshot.py +++ b/gns3server/controller/snapshot.py @@ -127,9 +127,9 @@ class Snapshot: if os.path.exists(project_files_path): await wait_run_in_executor(shutil.rmtree, project_files_path) with open(self._path, "rb") as f: - project = await import_project( - self._project.controller, self._project.id, f, location=self._project.path - ) + project = await import_project(self._project.controller, self._project.id, f, location=self._project.path, + auto_start=self._project.auto_start, auto_open=self._project.auto_open, + auto_close=self._project.auto_close) except (OSError, PermissionError) as e: raise ControllerError(str(e)) await project.open() diff --git a/gns3server/crash_report.py b/gns3server/crash_report.py index 8c48494f..9b0f379b 100644 --- a/gns3server/crash_report.py +++ b/gns3server/crash_report.py @@ -59,7 +59,7 @@ class CrashReport: Report crash to a third party service """ - DSN = "https://ccd9829f1391432c900aa835e7eb1050:83d10f4d74654e2b8428129a62cf31cf@o19455.ingest.sentry.io/38482" + DSN = "https://aefc1e0e41e94957936f8773071aebf9:056b5247d4854b81ac9162d9ccc5a503@o19455.ingest.sentry.io/38482" _instance = None def __init__(self): diff --git a/gns3server/db/models/roles.py b/gns3server/db/models/roles.py index 76b1d6f1..6cba0cc1 100644 --- a/gns3server/db/models/roles.py +++ b/gns3server/db/models/roles.py @@ -38,9 +38,9 @@ class Role(BaseTable): __tablename__ = "roles" role_id = Column(GUID, primary_key=True, default=generate_uuid) - name = Column(String) + name = Column(String, unique=True) description = Column(String) - builtin = Column(Boolean, default=False) + is_builtin = Column(Boolean, default=False) permissions = relationship("Permission", secondary=permission_role_link, back_populates="roles") groups = relationship("UserGroup", secondary=role_group_link, back_populates="roles") @@ -49,8 +49,8 @@ class Role(BaseTable): def create_default_roles(target, connection, **kw): default_roles = [ - {"name": "Administrator", "description": "Administrator role", "builtin": True}, - {"name": "User", "description": "User role", "builtin": True}, + {"name": "Administrator", "description": "Administrator role", "is_builtin": True}, + {"name": "User", "description": "User role", "is_builtin": True}, ] stmt = target.insert().values(default_roles) diff --git a/gns3server/db/models/users.py b/gns3server/db/models/users.py index 32c44bbd..e6bc53f4 100644 --- a/gns3server/db/models/users.py +++ b/gns3server/db/models/users.py @@ -15,7 +15,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -from sqlalchemy import Table, Boolean, Column, String, ForeignKey, event +from sqlalchemy import Table, Boolean, Column, String, DateTime, ForeignKey, event from sqlalchemy.orm import relationship from .base import Base, BaseTable, generate_uuid, GUID @@ -45,6 +45,7 @@ class User(BaseTable): email = Column(String, unique=True, index=True) full_name = Column(String) hashed_password = Column(String) + last_login = Column(DateTime) is_active = Column(Boolean, default=True) is_superadmin = Column(Boolean, default=False) groups = relationship("UserGroup", secondary=user_group_link, back_populates="users") @@ -75,7 +76,7 @@ class UserGroup(BaseTable): user_group_id = Column(GUID, primary_key=True, default=generate_uuid) name = Column(String, unique=True, index=True) - builtin = Column(Boolean, default=False) + is_builtin = Column(Boolean, default=False) users = relationship("User", secondary=user_group_link, back_populates="groups") roles = relationship("Role", secondary=role_group_link, back_populates="groups") @@ -84,8 +85,8 @@ class UserGroup(BaseTable): def create_default_user_groups(target, connection, **kw): default_groups = [ - {"name": "Administrators", "builtin": True}, - {"name": "Users", "builtin": True} + {"name": "Administrators", "is_builtin": True}, + {"name": "Users", "is_builtin": True} ] stmt = target.insert().values(default_groups) diff --git a/gns3server/db/repositories/users.py b/gns3server/db/repositories/users.py index 68d12f78..2db1516f 100644 --- a/gns3server/db/repositories/users.py +++ b/gns3server/db/repositories/users.py @@ -17,7 +17,7 @@ from uuid import UUID from typing import Optional, List, Union -from sqlalchemy import select, update, delete +from sqlalchemy import select, update, delete, func from sqlalchemy.ext.asyncio import AsyncSession from sqlalchemy.orm import selectinload @@ -140,6 +140,15 @@ class UsersRepository(BaseRepository): return user if not self._auth_service.verify_password(password, user.hashed_password): return None + + # Backup the updated_at value + updated_at = user.updated_at + user.last_login = func.current_timestamp() + await self._db_session.commit() + # Restore the original updated_at value + # so it is not affected by the last login update + user.updated_at = updated_at + await self._db_session.commit() return user async def get_user_memberships(self, user_id: UUID) -> List[models.UserGroup]: diff --git a/gns3server/handlers/api/compute/qemu_handler.py b/gns3server/handlers/api/compute/qemu_handler.py new file mode 100644 index 00000000..e69de29b diff --git a/gns3server/handlers/api/controller/server_handler.py b/gns3server/handlers/api/controller/server_handler.py new file mode 100644 index 00000000..e69de29b diff --git a/gns3server/schemas/__init__.py b/gns3server/schemas/__init__.py index e5683059..7a8ec42f 100644 --- a/gns3server/schemas/__init__.py +++ b/gns3server/schemas/__init__.py @@ -27,7 +27,7 @@ from .controller.drawings import Drawing from .controller.gns3vm import GNS3VM from .controller.nodes import NodeCreate, NodeUpdate, NodeDuplicate, NodeCapture, Node from .controller.projects import ProjectCreate, ProjectUpdate, ProjectDuplicate, Project, ProjectFile -from .controller.users import UserCreate, UserUpdate, User, Credentials, UserGroupCreate, UserGroupUpdate, UserGroup +from .controller.users import UserCreate, UserUpdate, LoggedInUserUpdate, User, Credentials, UserGroupCreate, UserGroupUpdate, UserGroup from .controller.rbac import RoleCreate, RoleUpdate, Role, PermissionCreate, PermissionUpdate, Permission from .controller.tokens import Token from .controller.snapshots import SnapshotCreate, Snapshot diff --git a/gns3server/schemas/controller/links.py b/gns3server/schemas/controller/links.py index 6a375cb9..af3f3952 100644 --- a/gns3server/schemas/controller/links.py +++ b/gns3server/schemas/controller/links.py @@ -42,6 +42,13 @@ class LinkType(str, Enum): serial = "serial" +class LinkStyle(BaseModel): + + color: Optional[str] = None + width: Optional[int] = None + type: Optional[int] = None + + class LinkBase(BaseModel): """ Link data. @@ -49,6 +56,7 @@ class LinkBase(BaseModel): nodes: Optional[List[LinkNode]] = Field(None, min_items=0, max_items=2) suspend: Optional[bool] = None + link_style: Optional[LinkStyle] = None filters: Optional[dict] = None diff --git a/gns3server/schemas/controller/rbac.py b/gns3server/schemas/controller/rbac.py index 4967e5ef..a3f4c9c1 100644 --- a/gns3server/schemas/controller/rbac.py +++ b/gns3server/schemas/controller/rbac.py @@ -114,7 +114,7 @@ class RoleUpdate(RoleBase): class Role(DateTimeModelMixin, RoleBase): role_id: UUID - builtin: bool + is_builtin: bool permissions: List[Permission] class Config: diff --git a/gns3server/schemas/controller/users.py b/gns3server/schemas/controller/users.py index 97988c53..cef4a076 100644 --- a/gns3server/schemas/controller/users.py +++ b/gns3server/schemas/controller/users.py @@ -14,6 +14,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +from datetime import datetime from typing import Optional from pydantic import EmailStr, BaseModel, Field, SecretStr from uuid import UUID @@ -27,6 +28,7 @@ class UserBase(BaseModel): """ username: Optional[str] = Field(None, min_length=3, regex="[a-zA-Z0-9_-]+$") + is_active: bool = True email: Optional[EmailStr] full_name: Optional[str] @@ -48,10 +50,20 @@ class UserUpdate(UserBase): password: Optional[SecretStr] = Field(None, min_length=6, max_length=100) +class LoggedInUserUpdate(BaseModel): + """ + Properties to update a logged in user. + """ + + password: Optional[SecretStr] = Field(None, min_length=6, max_length=100) + email: Optional[EmailStr] + full_name: Optional[str] + + class User(DateTimeModelMixin, UserBase): user_id: UUID - is_active: bool = True + last_login: Optional[datetime] = None is_superadmin: bool = False class Config: @@ -85,7 +97,7 @@ class UserGroupUpdate(UserGroupBase): class UserGroup(DateTimeModelMixin, UserGroupBase): user_group_id: UUID - builtin: bool + is_builtin: bool class Config: orm_mode = True diff --git a/gns3server/schemas/link.py b/gns3server/schemas/link.py new file mode 100644 index 00000000..e69de29b diff --git a/gns3server/static/web-ui/26.a7470e50128ddf7860c4.js b/gns3server/static/web-ui/26.a7470e50128ddf7860c4.js new file mode 100644 index 00000000..51fad865 --- /dev/null +++ b/gns3server/static/web-ui/26.a7470e50128ddf7860c4.js @@ -0,0 +1 @@ +(self.webpackChunkgns3_web_ui=self.webpackChunkgns3_web_ui||[]).push([[26],{91026:function(t,e,n){"use strict";n.r(e),n.d(e,{TopologySummaryComponent:function(){return F}});var i=n(37602),o=n(96852),s=n(14200),r=n(36889),a=n(3941),p=n(15132),c=n(40098),l=n(39095),u=n(88802),g=n(73044),d=n(59412),h=n(93386);function m(t,e){if(1&t){var n=i.EpF();i.TgZ(0,"div",2),i.NdJ("mousemove",function(t){return i.CHM(n),i.oxw().dragWidget(t)},!1,i.evT)("mouseup",function(){return i.CHM(n),i.oxw().toggleDragging(!1)},!1,i.evT),i.qZA()}}function f(t,e){1&t&&(i.O4$(),i.TgZ(0,"svg",28),i._UZ(1,"rect",29),i.qZA())}function y(t,e){1&t&&(i.O4$(),i.TgZ(0,"svg",28),i._UZ(1,"rect",30),i.qZA())}function b(t,e){1&t&&(i.O4$(),i.TgZ(0,"svg",28),i._UZ(1,"rect",31),i.qZA())}function v(t,e){if(1&t&&(i.TgZ(0,"div"),i._uU(1),i.qZA()),2&t){var n=i.oxw().$implicit;i.xp6(1),i.lnq(" ",n.console_type," ",n.console_host,":",n.console," ")}}function x(t,e){1&t&&(i.TgZ(0,"div"),i._uU(1," none "),i.qZA())}function Z(t,e){if(1&t&&(i.TgZ(0,"div",25),i.TgZ(1,"div"),i.YNc(2,f,2,0,"svg",26),i.YNc(3,y,2,0,"svg",26),i.YNc(4,b,2,0,"svg",26),i._uU(5),i.qZA(),i.YNc(6,v,2,3,"div",27),i.YNc(7,x,2,0,"div",27),i.qZA()),2&t){var n=e.$implicit;i.xp6(2),i.Q6J("ngIf","started"===n.status),i.xp6(1),i.Q6J("ngIf","suspended"===n.status),i.xp6(1),i.Q6J("ngIf","stopped"===n.status),i.xp6(1),i.hij(" ",n.name," "),i.xp6(1),i.Q6J("ngIf",null!=n.console&&null!=n.console&&"none"!=n.console_type),i.xp6(1),i.Q6J("ngIf",null==n.console||"none"===n.console_type)}}function C(t,e){1&t&&(i.O4$(),i.TgZ(0,"svg",28),i._UZ(1,"rect",29),i.qZA())}function S(t,e){1&t&&(i.O4$(),i.TgZ(0,"svg",28),i._UZ(1,"rect",31),i.qZA())}function _(t,e){if(1&t&&(i.TgZ(0,"div",25),i.TgZ(1,"div"),i.YNc(2,C,2,0,"svg",26),i.YNc(3,S,2,0,"svg",26),i._uU(4),i.qZA(),i.TgZ(5,"div"),i._uU(6),i.qZA(),i.TgZ(7,"div"),i._uU(8),i.qZA(),i.qZA()),2&t){var n=e.$implicit,o=i.oxw(2);i.xp6(2),i.Q6J("ngIf",n.connected),i.xp6(1),i.Q6J("ngIf",!n.connected),i.xp6(1),i.hij(" ",n.name," "),i.xp6(2),i.hij(" ",n.host," "),i.xp6(2),i.hij(" ",o.server.location," ")}}var w=function(t){return{lightTheme:t}},T=function(){return{right:!0,left:!0,bottom:!0,top:!0}};function E(t,e){if(1&t){var n=i.EpF();i.TgZ(0,"div",3),i.NdJ("mousedown",function(){return i.CHM(n),i.oxw().toggleDragging(!0)})("resizeStart",function(){return i.CHM(n),i.oxw().toggleDragging(!1)})("resizeEnd",function(t){return i.CHM(n),i.oxw().onResizeEnd(t)}),i.TgZ(1,"div",4),i.TgZ(2,"mat-tab-group"),i.TgZ(3,"mat-tab",5),i.NdJ("click",function(){return i.CHM(n),i.oxw().toggleTopologyVisibility(!0)}),i.TgZ(4,"div",6),i.TgZ(5,"div",7),i.TgZ(6,"mat-select",8),i.TgZ(7,"mat-optgroup",9),i.TgZ(8,"mat-option",10),i.NdJ("onSelectionChange",function(){return i.CHM(n),i.oxw().applyStatusFilter("started")}),i._uU(9,"started"),i.qZA(),i.TgZ(10,"mat-option",11),i.NdJ("onSelectionChange",function(){return i.CHM(n),i.oxw().applyStatusFilter("suspended")}),i._uU(11,"suspended"),i.qZA(),i.TgZ(12,"mat-option",12),i.NdJ("onSelectionChange",function(){return i.CHM(n),i.oxw().applyStatusFilter("stopped")}),i._uU(13,"stopped"),i.qZA(),i.qZA(),i.TgZ(14,"mat-optgroup",13),i.TgZ(15,"mat-option",14),i.NdJ("onSelectionChange",function(){return i.CHM(n),i.oxw().applyCaptureFilter("capture")}),i._uU(16,"active capture(s)"),i.qZA(),i.TgZ(17,"mat-option",15),i.NdJ("onSelectionChange",function(){return i.CHM(n),i.oxw().applyCaptureFilter("packet")}),i._uU(18,"active packet captures"),i.qZA(),i.qZA(),i.qZA(),i.qZA(),i.TgZ(19,"div",16),i.TgZ(20,"mat-select",17),i.NdJ("selectionChange",function(){return i.CHM(n),i.oxw().setSortingOrder()})("valueChange",function(t){return i.CHM(n),i.oxw().sortingOrder=t}),i.TgZ(21,"mat-option",18),i._uU(22,"sort by name ascending"),i.qZA(),i.TgZ(23,"mat-option",19),i._uU(24,"sort by name descending"),i.qZA(),i.qZA(),i.qZA(),i._UZ(25,"mat-divider",20),i.TgZ(26,"div",21),i.YNc(27,Z,8,6,"div",22),i.qZA(),i.qZA(),i.qZA(),i.TgZ(28,"mat-tab",23),i.NdJ("click",function(){return i.CHM(n),i.oxw().toggleTopologyVisibility(!1)}),i.TgZ(29,"div",6),i.TgZ(30,"div",24),i.YNc(31,_,9,5,"div",22),i.qZA(),i.qZA(),i.qZA(),i.qZA(),i.qZA(),i.qZA()}if(2&t){var o=i.oxw();i.Q6J("ngStyle",o.style)("ngClass",i.VKq(9,w,o.isLightThemeEnabled))("validateResize",o.validate)("resizeEdges",i.DdM(11,T))("enableGhostResize",!0),i.xp6(20),i.Q6J("value",o.sortingOrder),i.xp6(6),i.Q6J("ngStyle",o.styleInside),i.xp6(1),i.Q6J("ngForOf",o.filteredNodes),i.xp6(4),i.Q6J("ngForOf",o.computes)}}var F=function(){function t(t,e,n,o,s){this.nodesDataSource=t,this.projectService=e,this.computeService=n,this.linksDataSource=o,this.themeService=s,this.closeTopologySummary=new i.vpe,this.style={},this.styleInside={height:"280px"},this.subscriptions=[],this.nodes=[],this.filteredNodes=[],this.sortingOrder="asc",this.startedStatusFilterEnabled=!1,this.suspendedStatusFilterEnabled=!1,this.stoppedStatusFilterEnabled=!1,this.captureFilterEnabled=!1,this.packetFilterEnabled=!1,this.computes=[],this.isTopologyVisible=!0,this.isDraggingEnabled=!1,this.isLightThemeEnabled=!1}return t.prototype.ngOnInit=function(){var t=this;this.isLightThemeEnabled="light"===this.themeService.getActualTheme(),this.subscriptions.push(this.nodesDataSource.changes.subscribe(function(e){t.nodes=e,t.nodes.forEach(function(e){"0.0.0.0"!==e.console_host&&"0:0:0:0:0:0:0:0"!==e.console_host&&"::"!==e.console_host||(e.console_host=t.server.host)}),t.filteredNodes=e.sort("asc"===t.sortingOrder?t.compareAsc:t.compareDesc)})),this.projectService.getStatistics(this.server,this.project.project_id).subscribe(function(e){t.projectsStatistics=e}),this.computeService.getComputes(this.server).subscribe(function(e){t.computes=e}),this.style={top:"60px",right:"0px",width:"320px",height:"400px"}},t.prototype.toggleDragging=function(t){this.isDraggingEnabled=t},t.prototype.dragWidget=function(t){var e=Number(t.movementX),n=Number(t.movementY),i=Number(this.style.width.split("px")[0]),o=Number(this.style.height.split("px")[0]),s=Number(this.style.top.split("px")[0])+n;if(this.style.left){var r=Number(this.style.left.split("px")[0])+e;this.style={position:"fixed",left:r+"px",top:s+"px",width:i+"px",height:o+"px"}}else{var a=Number(this.style.right.split("px")[0])-e;this.style={position:"fixed",right:a+"px",top:s+"px",width:i+"px",height:o+"px"}}},t.prototype.validate=function(t){return!(t.rectangle.width&&t.rectangle.height&&(t.rectangle.width<290||t.rectangle.height<260))},t.prototype.onResizeEnd=function(t){this.style={position:"fixed",left:t.rectangle.left+"px",top:t.rectangle.top+"px",width:t.rectangle.width+"px",height:t.rectangle.height+"px"},this.styleInside={height:t.rectangle.height-120+"px"}},t.prototype.toggleTopologyVisibility=function(t){this.isTopologyVisible=t},t.prototype.compareAsc=function(t,e){return t.name mousetrap @@ -1953,6 +1868,7 @@ ngx-childprocess MIT ngx-device-detector +MIT ngx-electron MIT @@ -2163,157 +2079,6 @@ Apache-2.0 limitations under the License. -object-assign -MIT -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - - -prop-types -MIT -MIT License - -Copyright (c) 2013-present, Facebook, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -prop-types-extra -MIT -The MIT License (MIT) - -Copyright (c) 2015 react-bootstrap - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - - -react -MIT -MIT License - -Copyright (c) Facebook, Inc. and its affiliates. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -react-bootstrap -MIT -The MIT License (MIT) - -Copyright (c) 2014-present Stephen J. Collings, Matthew Honnibal, Pieter Vanderwerff - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - - -react-dom -MIT -MIT License - -Copyright (c) Facebook, Inc. and its affiliates. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - regenerator-runtime MIT MIT License @@ -2777,31 +2542,6 @@ THE SOFTWARE. -scheduler -MIT -MIT License - -Copyright (c) Facebook, Inc. and its affiliates. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - source-map BSD-3-Clause @@ -2851,31 +2591,6 @@ WTFPL 0. You just DO WHAT THE FUCK YOU WANT TO. -stylenames -MIT -MIT License - -Copyright (c) 2016 Kevin - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - svg-crowbar MIT Copyright (c) 2013 The New York Times @@ -2902,97 +2617,17 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -type -ISC -ISC License - -Copyright (c) 2019, Mariusz Nowak, @medikoo, medikoo.com - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE -OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. - - uuid MIT The MIT License (MIT) -Copyright (c) 2010-2016 Robert Kieffer and other contributors +Copyright (c) 2010-2020 Robert Kieffer and other contributors -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -warning -MIT -MIT License - -Copyright (c) 2013-present, Facebook, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -webpack -MIT -Copyright JS Foundation and other contributors - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. xterm diff --git a/gns3server/static/web-ui/ReleaseNotes.txt b/gns3server/static/web-ui/ReleaseNotes.txt index fc9bd32b..1f871249 100644 --- a/gns3server/static/web-ui/ReleaseNotes.txt +++ b/gns3server/static/web-ui/ReleaseNotes.txt @@ -1,6 +1,6 @@ GNS3 WebUI is web implementation of user interface for GNS3 software. -Current version: 2.2.19 +Current version: 2.2.22 Current version: 2020.4.0-beta.1 diff --git a/gns3server/static/web-ui/index.html b/gns3server/static/web-ui/index.html index 6f9c282d..b75f06fc 100644 --- a/gns3server/static/web-ui/index.html +++ b/gns3server/static/web-ui/index.html @@ -1,10 +1,8 @@ - - - - + + GNS3 Web UI - + - - + + - + @@ -48,5 +46,6 @@ gtag('config', 'G-5D6FZL9923'); - - + + + \ No newline at end of file diff --git a/gns3server/static/web-ui/main.2f0314a517dded67879c.js b/gns3server/static/web-ui/main.2f0314a517dded67879c.js deleted file mode 100644 index d2d18ec9..00000000 --- a/gns3server/static/web-ui/main.2f0314a517dded67879c.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[1],{"+/L5":function(e,t,n){var r=n("t1UP").isCustomProperty,i=n("vd7W").TYPE,o=n("4njK").mode,a=i.Ident,s=i.Hash,c=i.Colon,l=i.Semicolon,u=i.Delim;function h(e){return this.Raw(e,o.exclamationMarkOrSemicolon,!0)}function d(e){return this.Raw(e,o.exclamationMarkOrSemicolon,!1)}function f(){var e=this.scanner.tokenIndex,t=this.Value();return"Raw"!==t.type&&!1===this.scanner.eof&&this.scanner.tokenType!==l&&!1===this.scanner.isDelim(33)&&!1===this.scanner.isBalanceEdge(e)&&this.error(),t}function p(){var e=this.scanner.tokenStart;if(this.scanner.tokenType===u)switch(this.scanner.source.charCodeAt(this.scanner.tokenStart)){case 42:case 36:case 43:case 35:case 38:this.scanner.next();break;case 47:this.scanner.next(),this.scanner.isDelim(47)&&this.scanner.next()}return this.eat(this.scanner.tokenType===s?s:a),this.scanner.substrToCursor(e)}function m(){this.eat(u),this.scanner.skipSC();var e=this.consume(a);return"important"===e||e}e.exports={name:"Declaration",structure:{important:[Boolean,String],property:String,value:["Value","Raw"]},parse:function(){var e,t=this.scanner.tokenStart,n=this.scanner.tokenIndex,i=p.call(this),o=r(i),a=o?this.parseCustomProperty:this.parseValue,s=o?d:h,u=!1;return this.scanner.skipSC(),this.eat(c),o||this.scanner.skipSC(),e=a?this.parseWithFallback(f,s):s.call(this,this.scanner.tokenIndex),this.scanner.isDelim(33)&&(u=m.call(this),this.scanner.skipSC()),!1===this.scanner.eof&&this.scanner.tokenType!==l&&!1===this.scanner.isBalanceEdge(n)&&this.error(),{type:"Declaration",loc:this.getLocation(t,this.scanner.tokenStart),important:u,property:i,value:e}},generate:function(e){this.chunk(e.property),this.chunk(":"),this.node(e.value),e.important&&this.chunk(!0===e.important?"!important":"!"+e.important)},walkContext:"declaration"}},"+4/i":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n("qCKp"),i=n("odkN");r.Observable.prototype.let=i.letProto,r.Observable.prototype.letBind=i.letProto},"+EXs":function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}n.d(t,"a",function(){return o});var i=n("JL25");function o(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?Object(i.a)(e):t}},"+Kd2":function(e,t,n){var r=n("vd7W").TYPE,i=n("4njK").mode,o=r.Comma;e.exports=function(){var e=this.createList();return this.scanner.skipSC(),e.push(this.Identifier()),this.scanner.skipSC(),this.scanner.tokenType===o&&(e.push(this.Operator()),e.push(this.parseCustomProperty?this.Value(null):this.Raw(this.scanner.tokenIndex,i.exclamationMarkOrSemicolon,!1))),e}},"+Wds":function(e,t,n){"use strict";var r=String.prototype.indexOf;e.exports=function(e){return r.call(this,e,arguments[1])>-1}},"+XMV":function(e,t,n){"use strict";e.exports=n("GOzd")()?String.prototype.contains:n("+Wds")},"+oeQ":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n("qCKp"),i=n("H+DX");r.Observable.prototype.observeOn=i.observeOn},"+psR":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n("qCKp"),i=n("16Oq");r.Observable.prototype.retry=i.retry},"+qxJ":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n("qCKp"),i=n("GsYY");r.Observable.prototype.distinctUntilChanged=i.distinctUntilChanged},"+v8i":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n("qCKp");r.Observable.concat=r.concat},"+wdc":function(e,t,n){"use strict";var r,i,o,a;if("object"==typeof performance&&"function"==typeof performance.now){var s=performance;t.unstable_now=function(){return s.now()}}else{var c=Date,l=c.now();t.unstable_now=function(){return c.now()-l}}if("undefined"==typeof window||"function"!=typeof MessageChannel){var u=null,h=null,d=function e(){if(null!==u)try{var n=t.unstable_now();u(!0,n),u=null}catch(r){throw setTimeout(e,0),r}};r=function(e){null!==u?setTimeout(r,0,e):(u=e,setTimeout(d,0))},i=function(e,t){h=setTimeout(e,t)},o=function(){clearTimeout(h)},t.unstable_shouldYield=function(){return!1},a=t.unstable_forceFrameRate=function(){}}else{var f=window.setTimeout,p=window.clearTimeout;if("undefined"!=typeof console){var m=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),"function"!=typeof m&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")}var g=!1,v=null,b=-1,y=5,_=0;t.unstable_shouldYield=function(){return t.unstable_now()>=_},a=function(){},t.unstable_forceFrameRate=function(e){0>e||125>>1,i=e[r];if(!(void 0!==i&&0O(a,n))void 0!==c&&0>O(c,a)?(e[r]=c,e[s]=n,r=s):(e[r]=a,e[o]=n,r=o);else{if(!(void 0!==c&&0>O(c,n)))break e;e[r]=c,e[s]=n,r=s}}}return t}return null}function O(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var M=[],T=[],E=1,P=null,j=3,I=!1,A=!1,D=!1;function R(e){for(var t=S(T);null!==t;){if(null===t.callback)x(T);else{if(!(t.startTime<=e))break;x(T),t.sortIndex=t.expirationTime,C(M,t)}t=S(T)}}function L(e){if(D=!1,R(e),!A)if(null!==S(M))A=!0,r(N);else{var t=S(T);null!==t&&i(L,t.startTime-e)}}function N(e,n){A=!1,D&&(D=!1,o()),I=!0;var r=j;try{for(R(n),P=S(M);null!==P&&(!(P.expirationTime>n)||e&&!t.unstable_shouldYield());){var a=P.callback;if("function"==typeof a){P.callback=null,j=P.priorityLevel;var s=a(P.expirationTime<=n);n=t.unstable_now(),"function"==typeof s?P.callback=s:P===S(M)&&x(M),R(n)}else x(M);P=S(M)}if(null!==P)var c=!0;else{var l=S(T);null!==l&&i(L,l.startTime-n),c=!1}return c}finally{P=null,j=r,I=!1}}var F=a;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){A||I||(A=!0,r(N))},t.unstable_getCurrentPriorityLevel=function(){return j},t.unstable_getFirstCallbackNode=function(){return S(M)},t.unstable_next=function(e){switch(j){case 1:case 2:case 3:var t=3;break;default:t=j}var n=j;j=t;try{return e()}finally{j=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=F,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=j;j=e;try{return t()}finally{j=n}},t.unstable_scheduleCallback=function(e,n,a){var s=t.unstable_now();switch(a="object"==typeof a&&null!==a&&"number"==typeof(a=a.delay)&&0s?(e.sortIndex=a,C(T,e),null===S(M)&&e===S(T)&&(D?o():D=!0,i(L,a-s))):(e.sortIndex=c,C(M,e),A||I||(A=!0,r(N))),e},t.unstable_wrapCallback=function(e){var t=j;return function(){var n=j;j=t;try{return e.apply(this,arguments)}finally{j=n}}}},"/+5V":function(e,t){function n(e){function t(e){return null!==e&&("Type"===e.type||"Property"===e.type||"Keyword"===e.type)}var n=null;return null!==this.matched&&function r(i){if(Array.isArray(i.match)){for(var o=0;oe;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()},t.prototype._createAccessibilityTreeNode=function(){var e=document.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e},t.prototype._onTab=function(e){for(var t=0;t0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,"\n"===e&&(this._liveRegionLineCount++,21===this._liveRegionLineCount&&(this._liveRegion.textContent+=o.tooMuchOutput)),a.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout(function(){t._accessibilityTreeRoot.appendChild(t._liveRegion)},0))},t.prototype._clearLiveRegion=function(){this._liveRegion.textContent="",this._liveRegionLineCount=0,a.isMac&&h.removeElementFromParent(this._liveRegion)},t.prototype._onKey=function(e){this._clearLiveRegion(),this._charsToConsume.push(e)},t.prototype._refreshRows=function(e,t){this._renderRowsDebouncer.refresh(e,t,this._terminal.rows)},t.prototype._renderRows=function(e,t){for(var n=this._terminal.buffer,r=n.lines.length.toString(),i=e;i<=t;i++){var o=n.translateBufferLineToString(n.ydisp+i,!0),a=(n.ydisp+i+1).toString(),s=this._rowElements[i];s&&(0===o.length?s.innerText="\xa0":s.textContent=o,s.setAttribute("aria-posinset",a),s.setAttribute("aria-setsize",r))}this._announceCharacters()},t.prototype._refreshRowsDimensions=function(){if(this._renderService.dimensions.actualCellHeight){this._rowElements.length!==this._terminal.rows&&this._onResize(this._terminal.rows);for(var e=0;e>>0}}(n=t.channels||(t.channels={})),(r=t.color||(t.color={})).blend=function(e,t){var r=(255&t.rgba)/255;if(1===r)return{css:t.css,rgba:t.rgba};var i=t.rgba>>16&255,o=t.rgba>>8&255,a=e.rgba>>24&255,s=e.rgba>>16&255,c=e.rgba>>8&255,l=a+Math.round(((t.rgba>>24&255)-a)*r),u=s+Math.round((i-s)*r),h=c+Math.round((o-c)*r);return{css:n.toCss(l,u,h),rgba:n.toRgba(l,u,h)}},r.isOpaque=function(e){return 255==(255&e.rgba)},r.ensureContrastRatio=function(e,t,n){var r=o.ensureContrastRatio(e.rgba,t.rgba,n);if(r)return o.toColor(r>>24&255,r>>16&255,r>>8&255)},r.opaque=function(e){var t=(255|e.rgba)>>>0,r=o.toChannels(t);return{css:n.toCss(r[0],r[1],r[2]),rgba:t}},r.opacity=function(e,t){var r=Math.round(255*t),i=o.toChannels(e.rgba),a=i[0],s=i[1],c=i[2];return{css:n.toCss(a,s,c,r),rgba:n.toRgba(a,s,c,r)}},(t.css||(t.css={})).toColor=function(e){switch(e.length){case 7:return{css:e,rgba:(parseInt(e.slice(1),16)<<8|255)>>>0};case 9:return{css:e,rgba:parseInt(e.slice(1),16)>>>0}}throw new Error("css.toColor: Unsupported css format")},function(e){function t(e,t,n){var r=e/255,i=t/255,o=n/255;return.2126*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))+.7152*(i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4))+.0722*(o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4))}e.relativeLuminance=function(e){return t(e>>16&255,e>>8&255,255&e)},e.relativeLuminance2=t}(i=t.rgb||(t.rgb={})),function(e){function t(e,t,n){for(var r=e>>24&255,o=e>>16&255,a=e>>8&255,c=t>>24&255,l=t>>16&255,u=t>>8&255,h=s(i.relativeLuminance2(c,u,l),i.relativeLuminance2(r,o,a));h0||l>0||u>0);)c-=Math.max(0,Math.ceil(.1*c)),l-=Math.max(0,Math.ceil(.1*l)),u-=Math.max(0,Math.ceil(.1*u)),h=s(i.relativeLuminance2(c,u,l),i.relativeLuminance2(r,o,a));return(c<<24|l<<16|u<<8|255)>>>0}function r(e,t,n){for(var r=e>>24&255,o=e>>16&255,a=e>>8&255,c=t>>24&255,l=t>>16&255,u=t>>8&255,h=s(i.relativeLuminance2(c,u,l),i.relativeLuminance2(r,o,a));h>>0}e.ensureContrastRatio=function(e,n,o){var a=i.relativeLuminance(e>>8),c=i.relativeLuminance(n>>8);if(s(a,c)>24&255,e>>16&255,e>>8&255,255&e]},e.toColor=function(e,t,r){return{css:n.toCss(e,t,r),rgba:n.toRgba(e,t,r)}}}(o=t.rgba||(t.rgba={})),t.toPaddedHex=a,t.contrastRatio=s},7239:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.ColorContrastCache=void 0;var n=function(){function e(){this._color={},this._rgba={}}return e.prototype.clear=function(){this._color={},this._rgba={}},e.prototype.setCss=function(e,t,n){this._rgba[e]||(this._rgba[e]={}),this._rgba[e][t]=n},e.prototype.getCss=function(e,t){return this._rgba[e]?this._rgba[e][t]:void 0},e.prototype.setColor=function(e,t,n){this._color[e]||(this._color[e]={}),this._color[e][t]=n},e.prototype.getColor=function(e,t){return this._color[e]?this._color[e][t]:void 0},e}();t.ColorContrastCache=n},5680:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.ColorManager=t.DEFAULT_ANSI_COLORS=void 0;var r=n(4774),i=n(7239),o=r.css.toColor("#ffffff"),a=r.css.toColor("#000000"),s=r.css.toColor("#ffffff"),c=r.css.toColor("#000000"),l={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};t.DEFAULT_ANSI_COLORS=Object.freeze(function(){for(var e=[r.css.toColor("#2e3436"),r.css.toColor("#cc0000"),r.css.toColor("#4e9a06"),r.css.toColor("#c4a000"),r.css.toColor("#3465a4"),r.css.toColor("#75507b"),r.css.toColor("#06989a"),r.css.toColor("#d3d7cf"),r.css.toColor("#555753"),r.css.toColor("#ef2929"),r.css.toColor("#8ae234"),r.css.toColor("#fce94f"),r.css.toColor("#729fcf"),r.css.toColor("#ad7fa8"),r.css.toColor("#34e2e2"),r.css.toColor("#eeeeec")],t=[0,95,135,175,215,255],n=0;n<216;n++){var i=t[n/36%6|0],o=t[n/6%6|0],a=t[n%6];e.push({css:r.channels.toCss(i,o,a),rgba:r.channels.toRgba(i,o,a)})}for(n=0;n<24;n++){var s=8+10*n;e.push({css:r.channels.toCss(s,s,s),rgba:r.channels.toRgba(s,s,s)})}return e}());var u=function(){function e(e,n){this.allowTransparency=n;var u=e.createElement("canvas");u.width=1,u.height=1;var h=u.getContext("2d");if(!h)throw new Error("Could not get rendering context");this._ctx=h,this._ctx.globalCompositeOperation="copy",this._litmusColor=this._ctx.createLinearGradient(0,0,1,1),this._contrastCache=new i.ColorContrastCache,this.colors={foreground:o,background:a,cursor:s,cursorAccent:c,selectionTransparent:l,selectionOpaque:r.color.blend(a,l),ansi:t.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache}}return e.prototype.onOptionsChange=function(e){"minimumContrastRatio"===e&&this._contrastCache.clear()},e.prototype.setTheme=function(e){void 0===e&&(e={}),this.colors.foreground=this._parseColor(e.foreground,o),this.colors.background=this._parseColor(e.background,a),this.colors.cursor=this._parseColor(e.cursor,s,!0),this.colors.cursorAccent=this._parseColor(e.cursorAccent,c,!0),this.colors.selectionTransparent=this._parseColor(e.selection,l,!0),this.colors.selectionOpaque=r.color.blend(this.colors.background,this.colors.selectionTransparent),r.color.isOpaque(this.colors.selectionTransparent)&&(this.colors.selectionTransparent=r.color.opacity(this.colors.selectionTransparent,.3)),this.colors.ansi[0]=this._parseColor(e.black,t.DEFAULT_ANSI_COLORS[0]),this.colors.ansi[1]=this._parseColor(e.red,t.DEFAULT_ANSI_COLORS[1]),this.colors.ansi[2]=this._parseColor(e.green,t.DEFAULT_ANSI_COLORS[2]),this.colors.ansi[3]=this._parseColor(e.yellow,t.DEFAULT_ANSI_COLORS[3]),this.colors.ansi[4]=this._parseColor(e.blue,t.DEFAULT_ANSI_COLORS[4]),this.colors.ansi[5]=this._parseColor(e.magenta,t.DEFAULT_ANSI_COLORS[5]),this.colors.ansi[6]=this._parseColor(e.cyan,t.DEFAULT_ANSI_COLORS[6]),this.colors.ansi[7]=this._parseColor(e.white,t.DEFAULT_ANSI_COLORS[7]),this.colors.ansi[8]=this._parseColor(e.brightBlack,t.DEFAULT_ANSI_COLORS[8]),this.colors.ansi[9]=this._parseColor(e.brightRed,t.DEFAULT_ANSI_COLORS[9]),this.colors.ansi[10]=this._parseColor(e.brightGreen,t.DEFAULT_ANSI_COLORS[10]),this.colors.ansi[11]=this._parseColor(e.brightYellow,t.DEFAULT_ANSI_COLORS[11]),this.colors.ansi[12]=this._parseColor(e.brightBlue,t.DEFAULT_ANSI_COLORS[12]),this.colors.ansi[13]=this._parseColor(e.brightMagenta,t.DEFAULT_ANSI_COLORS[13]),this.colors.ansi[14]=this._parseColor(e.brightCyan,t.DEFAULT_ANSI_COLORS[14]),this.colors.ansi[15]=this._parseColor(e.brightWhite,t.DEFAULT_ANSI_COLORS[15]),this._contrastCache.clear()},e.prototype._parseColor=function(e,t,n){if(void 0===n&&(n=this.allowTransparency),void 0===e)return t;if(this._ctx.fillStyle=this._litmusColor,this._ctx.fillStyle=e,"string"!=typeof this._ctx.fillStyle)return console.warn("Color: "+e+" is invalid using fallback "+t.css),t;this._ctx.fillRect(0,0,1,1);var i=this._ctx.getImageData(0,0,1,1).data;if(255!==i[3]){if(!n)return console.warn("Color: "+e+" is using transparency, but allowTransparency is false. Using fallback "+t.css+"."),t;var o=this._ctx.fillStyle.substring(5,this._ctx.fillStyle.length-1).split(",").map(function(e){return Number(e)}),a=o[0],s=o[1],c=o[2],l=Math.round(255*o[3]);return{rgba:r.channels.toRgba(a,s,c,l),css:e}}return{css:this._ctx.fillStyle,rgba:r.channels.toRgba(i[0],i[1],i[2],i[3])}},e}();t.ColorManager=u},9631:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.removeElementFromParent=void 0,t.removeElementFromParent=function(){for(var e,t=[],n=0;n=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.MouseZone=t.Linkifier=void 0;var o=n(8460),a=n(2585),s=function(){function e(e,t,n){this._bufferService=e,this._logService=t,this._unicodeService=n,this._linkMatchers=[],this._nextLinkMatcherId=0,this._onShowLinkUnderline=new o.EventEmitter,this._onHideLinkUnderline=new o.EventEmitter,this._onLinkTooltip=new o.EventEmitter,this._rowsToLinkify={start:void 0,end:void 0}}return Object.defineProperty(e.prototype,"onShowLinkUnderline",{get:function(){return this._onShowLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onHideLinkUnderline",{get:function(){return this._onHideLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onLinkTooltip",{get:function(){return this._onLinkTooltip.event},enumerable:!1,configurable:!0}),e.prototype.attachToDom=function(e,t){this._element=e,this._mouseZoneManager=t},e.prototype.linkifyRows=function(t,n){var r=this;this._mouseZoneManager&&(void 0===this._rowsToLinkify.start||void 0===this._rowsToLinkify.end?(this._rowsToLinkify.start=t,this._rowsToLinkify.end=n):(this._rowsToLinkify.start=Math.min(this._rowsToLinkify.start,t),this._rowsToLinkify.end=Math.max(this._rowsToLinkify.end,n)),this._mouseZoneManager.clearAll(t,n),this._rowsTimeoutId&&clearTimeout(this._rowsTimeoutId),this._rowsTimeoutId=setTimeout(function(){return r._linkifyRows()},e._timeBeforeLatency))},e.prototype._linkifyRows=function(){this._rowsTimeoutId=void 0;var e=this._bufferService.buffer;if(void 0!==this._rowsToLinkify.start&&void 0!==this._rowsToLinkify.end){var t=e.ydisp+this._rowsToLinkify.start;if(!(t>=e.lines.length)){for(var n=e.ydisp+Math.min(this._rowsToLinkify.end,this._bufferService.rows)+1,r=Math.ceil(2e3/this._bufferService.cols),i=this._bufferService.buffer.iterator(!1,t,n,r,r);i.hasNext();)for(var o=i.next(),a=0;a=0;t--)if(e.priority<=this._linkMatchers[t].priority)return void this._linkMatchers.splice(t+1,0,e);this._linkMatchers.splice(0,0,e)}else this._linkMatchers.push(e)},e.prototype.deregisterLinkMatcher=function(e){for(var t=0;t>9&511:void 0;n.validationCallback?n.validationCallback(s,function(e){i._rowsTimeoutId||e&&i._addLink(l[1],l[0]-i._bufferService.buffer.ydisp,s,n,d)}):c._addLink(l[1],l[0]-c._bufferService.buffer.ydisp,s,n,d)},c=this;null!==(r=o.exec(t))&&"break"!==s(););},e.prototype._addLink=function(e,t,n,r,i){var o=this;if(this._mouseZoneManager&&this._element){var a=this._unicodeService.getStringCellWidth(n),s=e%this._bufferService.cols,l=t+Math.floor(e/this._bufferService.cols),u=(s+a)%this._bufferService.cols,h=l+Math.floor((s+a)/this._bufferService.cols);0===u&&(u=this._bufferService.cols,h--),this._mouseZoneManager.add(new c(s+1,l+1,u+1,h+1,function(e){if(r.handler)return r.handler(e,n);var t=window.open();t?(t.opener=null,t.location.href=n):console.warn("Opening link blocked as opener could not be cleared")},function(){o._onShowLinkUnderline.fire(o._createLinkHoverEvent(s,l,u,h,i)),o._element.classList.add("xterm-cursor-pointer")},function(e){o._onLinkTooltip.fire(o._createLinkHoverEvent(s,l,u,h,i)),r.hoverTooltipCallback&&r.hoverTooltipCallback(e,n,{start:{x:s,y:l},end:{x:u,y:h}})},function(){o._onHideLinkUnderline.fire(o._createLinkHoverEvent(s,l,u,h,i)),o._element.classList.remove("xterm-cursor-pointer"),r.hoverLeaveCallback&&r.hoverLeaveCallback()},function(e){return!r.willLinkActivate||r.willLinkActivate(e,n)}))}},e.prototype._createLinkHoverEvent=function(e,t,n,r,i){return{x1:e,y1:t,x2:n,y2:r,cols:this._bufferService.cols,fg:i}},e._timeBeforeLatency=200,e=r([i(0,a.IBufferService),i(1,a.ILogService),i(2,a.IUnicodeService)],e)}();t.Linkifier=s;var c=function(e,t,n,r,i,o,a,s,c){this.x1=e,this.y1=t,this.x2=n,this.y2=r,this.clickCallback=i,this.hoverCallback=o,this.tooltipCallback=a,this.leaveCallback=s,this.willLinkActivate=c};t.MouseZone=c},6465:function(e,t,n){var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},a=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.Linkifier2=void 0;var s=n(2585),c=n(8460),l=n(844),u=n(3656),h=function(e){function t(t){var n=e.call(this)||this;return n._bufferService=t,n._linkProviders=[],n._linkCacheDisposables=[],n._isMouseOut=!0,n._activeLine=-1,n._onShowLinkUnderline=n.register(new c.EventEmitter),n._onHideLinkUnderline=n.register(new c.EventEmitter),n.register(l.getDisposeArrayDisposable(n._linkCacheDisposables)),n}return i(t,e),Object.defineProperty(t.prototype,"onShowLinkUnderline",{get:function(){return this._onShowLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onHideLinkUnderline",{get:function(){return this._onHideLinkUnderline.event},enumerable:!1,configurable:!0}),t.prototype.registerLinkProvider=function(e){var t=this;return this._linkProviders.push(e),{dispose:function(){var n=t._linkProviders.indexOf(e);-1!==n&&t._linkProviders.splice(n,1)}}},t.prototype.attachToDom=function(e,t,n){var r=this;this._element=e,this._mouseService=t,this._renderService=n,this.register(u.addDisposableDomListener(this._element,"mouseleave",function(){r._isMouseOut=!0,r._clearCurrentLink()})),this.register(u.addDisposableDomListener(this._element,"mousemove",this._onMouseMove.bind(this))),this.register(u.addDisposableDomListener(this._element,"click",this._onClick.bind(this)))},t.prototype._onMouseMove=function(e){if(this._lastMouseEvent=e,this._element&&this._mouseService){var t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(t){this._isMouseOut=!1;for(var n=e.composedPath(),r=0;re?this._bufferService.cols:a.link.range.end.x,c=a.link.range.start.y=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,l.disposeArray(this._linkCacheDisposables))},t.prototype._handleNewLink=function(e){var t=this;if(this._element&&this._lastMouseEvent&&this._mouseService){var n=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);n&&this._linkAtPosition(e.link,n)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:void 0===e.link.decorations||e.link.decorations.underline,pointerCursor:void 0===e.link.decorations||e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:function(){var e,n;return null===(n=null===(e=t._currentLink)||void 0===e?void 0:e.state)||void 0===n?void 0:n.decorations.pointerCursor},set:function(e){var n,r;(null===(n=t._currentLink)||void 0===n?void 0:n.state)&&t._currentLink.state.decorations.pointerCursor!==e&&(t._currentLink.state.decorations.pointerCursor=e,t._currentLink.state.isHovered&&(null===(r=t._element)||void 0===r||r.classList.toggle("xterm-cursor-pointer",e)))}},underline:{get:function(){var e,n;return null===(n=null===(e=t._currentLink)||void 0===e?void 0:e.state)||void 0===n?void 0:n.decorations.underline},set:function(n){var r,i,o;(null===(r=t._currentLink)||void 0===r?void 0:r.state)&&(null===(o=null===(i=t._currentLink)||void 0===i?void 0:i.state)||void 0===o?void 0:o.decorations.underline)!==n&&(t._currentLink.state.decorations.underline=n,t._currentLink.state.isHovered&&t._fireUnderlineEvent(e.link,n))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedBufferChange(function(e){t._clearCurrentLink(0===e.start?0:e.start+1+t._bufferService.buffer.ydisp,e.end+1+t._bufferService.buffer.ydisp)})))}},t.prototype._linkHover=function(e,t,n){var r;(null===(r=this._currentLink)||void 0===r?void 0:r.state)&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(n,t.text)},t.prototype._fireUnderlineEvent=function(e,t){var n=e.range,r=this._bufferService.buffer.ydisp,i=this._createLinkUnderlineEvent(n.start.x-1,n.start.y-r-1,n.end.x,n.end.y-r-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(i)},t.prototype._linkLeave=function(e,t,n){var r;(null===(r=this._currentLink)||void 0===r?void 0:r.state)&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(n,t.text)},t.prototype._linkAtPosition=function(e,t){var n=e.range.start.yt.y;return(e.range.start.y===e.range.end.y&&e.range.start.x<=t.x&&e.range.end.x>=t.x||n&&e.range.end.x>=t.x||r&&e.range.start.x<=t.x||n&&r)&&e.range.start.y<=t.y&&e.range.end.y>=t.y},t.prototype._positionFromMouseEvent=function(e,t,n){var r=n.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(r)return{x:r[0],y:r[1]+this._bufferService.buffer.ydisp}},t.prototype._createLinkUnderlineEvent=function(e,t,n,r,i){return{x1:e,y1:t,x2:n,y2:r,cols:this._bufferService.cols,fg:i}},o([a(0,s.IBufferService)],t)}(l.Disposable);t.Linkifier2=h},9042:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.tooMuchOutput=t.promptLabel=void 0,t.promptLabel="Terminal input",t.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},6954:function(e,t,n){var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},a=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.MouseZoneManager=void 0;var s=n(844),c=n(3656),l=n(4725),u=n(2585),h=function(e){function t(t,n,r,i,o,a){var s=e.call(this)||this;return s._element=t,s._screenElement=n,s._bufferService=r,s._mouseService=i,s._selectionService=o,s._optionsService=a,s._zones=[],s._areZonesActive=!1,s._lastHoverCoords=[void 0,void 0],s._initialSelectionLength=0,s.register(c.addDisposableDomListener(s._element,"mousedown",function(e){return s._onMouseDown(e)})),s._mouseMoveListener=function(e){return s._onMouseMove(e)},s._mouseLeaveListener=function(e){return s._onMouseLeave(e)},s._clickListener=function(e){return s._onClick(e)},s}return i(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this),this._deactivate()},t.prototype.add=function(e){this._zones.push(e),1===this._zones.length&&this._activate()},t.prototype.clearAll=function(e,t){if(0!==this._zones.length){e&&t||(e=0,t=this._bufferService.rows-1);for(var n=0;ne&&r.y1<=t+1||r.y2>e&&r.y2<=t+1||r.y1t+1)&&(this._currentZone&&this._currentZone===r&&(this._currentZone.leaveCallback(),this._currentZone=void 0),this._zones.splice(n--,1))}0===this._zones.length&&this._deactivate()}},t.prototype._activate=function(){this._areZonesActive||(this._areZonesActive=!0,this._element.addEventListener("mousemove",this._mouseMoveListener),this._element.addEventListener("mouseleave",this._mouseLeaveListener),this._element.addEventListener("click",this._clickListener))},t.prototype._deactivate=function(){this._areZonesActive&&(this._areZonesActive=!1,this._element.removeEventListener("mousemove",this._mouseMoveListener),this._element.removeEventListener("mouseleave",this._mouseLeaveListener),this._element.removeEventListener("click",this._clickListener))},t.prototype._onMouseMove=function(e){this._lastHoverCoords[0]===e.pageX&&this._lastHoverCoords[1]===e.pageY||(this._onHover(e),this._lastHoverCoords=[e.pageX,e.pageY])},t.prototype._onHover=function(e){var t=this,n=this._findZoneEventAt(e);n!==this._currentZone&&(this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=void 0,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout)),n&&(this._currentZone=n,n.hoverCallback&&n.hoverCallback(e),this._tooltipTimeout=window.setTimeout(function(){return t._onTooltip(e)},this._optionsService.options.linkTooltipHoverDuration)))},t.prototype._onTooltip=function(e){this._tooltipTimeout=void 0;var t=this._findZoneEventAt(e);t&&t.tooltipCallback&&t.tooltipCallback(e)},t.prototype._onMouseDown=function(e){if(this._initialSelectionLength=this._getSelectionLength(),this._areZonesActive){var t=this._findZoneEventAt(e);(null==t?void 0:t.willLinkActivate(e))&&(e.preventDefault(),e.stopImmediatePropagation())}},t.prototype._onMouseLeave=function(e){this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=void 0,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout))},t.prototype._onClick=function(e){var t=this._findZoneEventAt(e),n=this._getSelectionLength();t&&n===this._initialSelectionLength&&(t.clickCallback(e),e.preventDefault(),e.stopImmediatePropagation())},t.prototype._getSelectionLength=function(){var e=this._selectionService.selectionText;return e?e.length:0},t.prototype._findZoneEventAt=function(e){var t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows);if(t)for(var n=t[0],r=t[1],i=0;i=o.x1&&n=o.x1||r===o.y2&&no.y1&&r4)&&t._coreMouseService.triggerMouseEvent({col:i.x-33,row:i.y-33,button:n,action:r,ctrl:e.ctrlKey,alt:e.altKey,shift:e.shiftKey})}var i={mouseup:null,wheel:null,mousedrag:null,mousemove:null},o=function(t){return r(t),t.buttons||(e._document.removeEventListener("mouseup",i.mouseup),i.mousedrag&&e._document.removeEventListener("mousemove",i.mousedrag)),e.cancel(t)},a=function(t){return r(t),t.preventDefault(),e.cancel(t)},s=function(e){e.buttons&&r(e)},l=function(e){e.buttons||r(e)};this.register(this._coreMouseService.onProtocolChange(function(t){t?("debug"===e.optionsService.options.logLevel&&e._logService.debug("Binding to mouse events:",e._coreMouseService.explainEvents(t)),e.element.classList.add("enable-mouse-events"),e._selectionService.disable()):(e._logService.debug("Unbinding from mouse events."),e.element.classList.remove("enable-mouse-events"),e._selectionService.enable()),8&t?i.mousemove||(n.addEventListener("mousemove",l),i.mousemove=l):(n.removeEventListener("mousemove",i.mousemove),i.mousemove=null),16&t?i.wheel||(n.addEventListener("wheel",a,{passive:!1}),i.wheel=a):(n.removeEventListener("wheel",i.wheel),i.wheel=null),2&t?i.mouseup||(i.mouseup=o):(e._document.removeEventListener("mouseup",i.mouseup),i.mouseup=null),4&t?i.mousedrag||(i.mousedrag=s):(e._document.removeEventListener("mousemove",i.mousedrag),i.mousedrag=null)})),this._coreMouseService.activeProtocol=this._coreMouseService.activeProtocol,this.register(p.addDisposableDomListener(n,"mousedown",function(t){if(t.preventDefault(),e.focus(),e._coreMouseService.areMouseEventsActive&&!e._selectionService.shouldForceSelection(t))return r(t),i.mouseup&&e._document.addEventListener("mouseup",i.mouseup),i.mousedrag&&e._document.addEventListener("mousemove",i.mousedrag),e.cancel(t)})),this.register(p.addDisposableDomListener(n,"wheel",function(t){if(i.wheel);else if(!e.buffer.hasScrollback){var n=e.viewport.getLinesScrolled(t);if(0===n)return;for(var r=c.C0.ESC+(e._coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(t.deltaY<0?"A":"B"),o="",a=0;a47)},t.prototype._keyUp=function(e){this._customKeyEventHandler&&!1===this._customKeyEventHandler(e)||(function(e){return 16===e.keyCode||17===e.keyCode||18===e.keyCode}(e)||this.focus(),this.updateCursorStyle(e))},t.prototype._keyPress=function(e){var t;if(this._keyDownHandled)return!1;if(this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(null==e.which)t=e.keyCode;else{if(0===e.which||0===e.charCode)return!1;t=e.which}return!(!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)||(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this._coreService.triggerDataEvent(t,!0),0))},t.prototype.bell=function(){this._soundBell()&&this._soundService.playBellSound()},t.prototype.resize=function(t,n){t!==this.cols||n!==this.rows?e.prototype.resize.call(this,t,n):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()},t.prototype._afterResize=function(e,t){var n,r;null===(n=this._charSizeService)||void 0===n||n.measure(),null===(r=this.viewport)||void 0===r||r.syncScrollArea(!0)},t.prototype.clear=function(){if(0!==this.buffer.ybase||0!==this.buffer.y){this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(var e=1;e=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},a=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.Viewport=void 0;var s=n(844),c=n(3656),l=n(4725),u=n(2585),h=function(e){function t(t,n,r,i,o,a,s){var l=e.call(this)||this;return l._scrollLines=t,l._viewportElement=n,l._scrollArea=r,l._bufferService=i,l._optionsService=o,l._charSizeService=a,l._renderService=s,l.scrollBarWidth=0,l._currentRowHeight=0,l._lastRecordedBufferLength=0,l._lastRecordedViewportHeight=0,l._lastRecordedBufferHeight=0,l._lastTouchY=0,l._lastScrollTop=0,l._wheelPartialScroll=0,l._refreshAnimationFrame=null,l._ignoreNextScrollEvent=!1,l.scrollBarWidth=l._viewportElement.offsetWidth-l._scrollArea.offsetWidth||15,l.register(c.addDisposableDomListener(l._viewportElement,"scroll",l._onScroll.bind(l))),setTimeout(function(){return l.syncScrollArea()},0),l}return i(t,e),t.prototype.onThemeChange=function(e){this._viewportElement.style.backgroundColor=e.background.css},t.prototype._refresh=function(e){var t=this;if(e)return this._innerRefresh(),void(null!==this._refreshAnimationFrame&&cancelAnimationFrame(this._refreshAnimationFrame));null===this._refreshAnimationFrame&&(this._refreshAnimationFrame=requestAnimationFrame(function(){return t._innerRefresh()}))},t.prototype._innerRefresh=function(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderService.dimensions.scaledCellHeight/window.devicePixelRatio,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;var e=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.canvasHeight);this._lastRecordedBufferHeight!==e&&(this._lastRecordedBufferHeight=e,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}var t=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==t&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=t),this._refreshAnimationFrame=null},t.prototype.syncScrollArea=function(e){if(void 0===e&&(e=!1),this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(e);this._lastRecordedViewportHeight===this._renderService.dimensions.canvasHeight&&this._lastScrollTop===this._bufferService.buffer.ydisp*this._currentRowHeight&&this._lastScrollTop===this._viewportElement.scrollTop&&this._renderService.dimensions.scaledCellHeight/window.devicePixelRatio===this._currentRowHeight||this._refresh(e)},t.prototype._onScroll=function(e){if(this._lastScrollTop=this._viewportElement.scrollTop,this._viewportElement.offsetParent)if(this._ignoreNextScrollEvent)this._ignoreNextScrollEvent=!1;else{var t=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._scrollLines(t,!0)}},t.prototype._bubbleScroll=function(e,t){return!(t<0&&0!==this._viewportElement.scrollTop||t>0&&this._viewportElement.scrollTop+this._lastRecordedViewportHeight0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._bufferService.rows),t},t.prototype._applyScrollModifier=function(e,t){var n=this._optionsService.options.fastScrollModifier;return"alt"===n&&t.altKey||"ctrl"===n&&t.ctrlKey||"shift"===n&&t.shiftKey?e*this._optionsService.options.fastScrollSensitivity*this._optionsService.options.scrollSensitivity:e*this._optionsService.options.scrollSensitivity},t.prototype.onTouchStart=function(e){this._lastTouchY=e.touches[0].pageY},t.prototype.onTouchMove=function(e){var t=this._lastTouchY-e.touches[0].pageY;return this._lastTouchY=e.touches[0].pageY,0!==t&&(this._viewportElement.scrollTop+=t,this._bubbleScroll(e,t))},o([a(3,u.IBufferService),a(4,u.IOptionsService),a(5,l.ICharSizeService),a(6,l.IRenderService)],t)}(s.Disposable);t.Viewport=h},2950:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CompositionHelper=void 0;var o=n(4725),a=n(2585),s=function(){function e(e,t,n,r,i,o){this._textarea=e,this._compositionView=t,this._bufferService=n,this._optionsService=r,this._charSizeService=i,this._coreService=o,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}return Object.defineProperty(e.prototype,"isComposing",{get:function(){return this._isComposing},enumerable:!1,configurable:!0}),e.prototype.compositionstart=function(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")},e.prototype.compositionupdate=function(e){var t=this;this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(function(){t._compositionPosition.end=t._textarea.value.length},0)},e.prototype.compositionend=function(){this._finalizeComposition(!0)},e.prototype.keydown=function(e){if(this._isComposing||this._isSendingComposition){if(229===e.keyCode)return!1;if(16===e.keyCode||17===e.keyCode||18===e.keyCode)return!1;this._finalizeComposition(!1)}return 229!==e.keyCode||(this._handleAnyTextareaChanges(),!1)},e.prototype._finalizeComposition=function(e){var t=this;if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){var n={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(function(){var e;t._isSendingComposition&&(t._isSendingComposition=!1,n.start+=t._dataAlreadySent.length,(e=t._isComposing?t._textarea.value.substring(n.start,n.end):t._textarea.value.substring(n.start)).length>0&&t._coreService.triggerDataEvent(e,!0))},0)}else{this._isSendingComposition=!1;var r=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(r,!0)}},e.prototype._handleAnyTextareaChanges=function(){var e=this,t=this._textarea.value;setTimeout(function(){if(!e._isComposing){var n=e._textarea.value.replace(t,"");n.length>0&&(e._dataAlreadySent=n,e._coreService.triggerDataEvent(n,!0))}},0)},e.prototype.updateCompositionElements=function(e){var t=this;if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){var n=Math.ceil(this._charSizeService.height*this._optionsService.options.lineHeight),r=this._bufferService.buffer.y*n,i=this._bufferService.buffer.x*this._charSizeService.width;this._compositionView.style.left=i+"px",this._compositionView.style.top=r+"px",this._compositionView.style.height=n+"px",this._compositionView.style.lineHeight=n+"px",this._compositionView.style.fontFamily=this._optionsService.options.fontFamily,this._compositionView.style.fontSize=this._optionsService.options.fontSize+"px";var o=this._compositionView.getBoundingClientRect();this._textarea.style.left=i+"px",this._textarea.style.top=r+"px",this._textarea.style.width=o.width+"px",this._textarea.style.height=o.height+"px",this._textarea.style.lineHeight=o.height+"px"}e||setTimeout(function(){return t.updateCompositionElements(!0)},0)}},r([i(2,a.IBufferService),i(3,a.IOptionsService),i(4,o.ICharSizeService),i(5,a.ICoreService)],e)}();t.CompositionHelper=s},9806:function(e,t){function n(e,t){var n=t.getBoundingClientRect();return[e.clientX-n.left,e.clientY-n.top]}Object.defineProperty(t,"__esModule",{value:!0}),t.getRawByteCoords=t.getCoords=t.getCoordsRelativeToElement=void 0,t.getCoordsRelativeToElement=n,t.getCoords=function(e,t,r,i,o,a,s,c){if(o){var l=n(e,t);if(l)return l[0]=Math.ceil((l[0]+(c?a/2:0))/a),l[1]=Math.ceil(l[1]/s),l[0]=Math.min(Math.max(l[0],1),r+(c?1:0)),l[1]=Math.min(Math.max(l[1],1),i),l}},t.getRawByteCoords=function(e){if(e)return{x:e[0]+32,y:e[1]+32}}},9504:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.moveToCellSequence=void 0;var r=n(2584);function i(e,t,n,r){var i=e-o(n,e),s=t-o(n,t);return l(Math.abs(i-s)-function(e,t,n){for(var r=0,i=e-o(n,e),s=t-o(n,t),c=0;c=0&&tt?"A":"B"}function s(e,t,n,r,i,o){for(var a=e,s=t,c="";a!==n||s!==r;)a+=i?1:-1,i&&a>o.cols-1?(c+=o.buffer.translateBufferLineToString(s,!1,e,a),a=0,e=0,s++):!i&&a<0&&(c+=o.buffer.translateBufferLineToString(s,!1,0,e+1),e=a=o.cols-1,s--);return c+o.buffer.translateBufferLineToString(s,!1,e,a)}function c(e,t){return r.C0.ESC+(t?"O":"[")+e}function l(e,t){e=Math.floor(e);for(var n="",r=0;r0?r-o(a,r):t;var d=r,f=function(e,t,n,r,a,s){var c;return c=i(n,r,a,s).length>0?r-o(a,r):t,e=n&&ce?"D":"C",l(Math.abs(u-e),c(a,r));a=h>t?"D":"C";var d=Math.abs(h-t);return l(function(e,t){return t.cols-e}(h>t?e:u,n)+(d-1)*n.cols+1+((h>t?u:e)-1),c(a,r))}},244:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.AddonManager=void 0;var n=function(){function e(){this._addons=[]}return e.prototype.dispose=function(){for(var e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()},e.prototype.loadAddon=function(e,t){var n=this,r={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(r),t.dispose=function(){return n._wrappedAddonDispose(r)},t.activate(e)},e.prototype._wrappedAddonDispose=function(e){if(!e.isDisposed){for(var t=-1,n=0;n=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new r.CellData)},e.prototype.translateToString=function(e,t,n){return this._line.translateToString(e,t,n)},e}(),d=function(){function e(e){this._core=e}return e.prototype.registerCsiHandler=function(e,t){return this._core.addCsiHandler(e,function(e){return t(e.toArray())})},e.prototype.addCsiHandler=function(e,t){return this.registerCsiHandler(e,t)},e.prototype.registerDcsHandler=function(e,t){return this._core.addDcsHandler(e,function(e,n){return t(e,n.toArray())})},e.prototype.addDcsHandler=function(e,t){return this.registerDcsHandler(e,t)},e.prototype.registerEscHandler=function(e,t){return this._core.addEscHandler(e,t)},e.prototype.addEscHandler=function(e,t){return this.registerEscHandler(e,t)},e.prototype.registerOscHandler=function(e,t){return this._core.addOscHandler(e,t)},e.prototype.addOscHandler=function(e,t){return this.registerOscHandler(e,t)},e}(),f=function(){function e(e){this._core=e}return e.prototype.register=function(e){this._core.unicodeService.register(e)},Object.defineProperty(e.prototype,"versions",{get:function(){return this._core.unicodeService.versions},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"activeVersion",{get:function(){return this._core.unicodeService.activeVersion},set:function(e){this._core.unicodeService.activeVersion=e},enumerable:!1,configurable:!0}),e}()},1546:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.BaseRenderLayer=void 0;var r=n(643),i=n(8803),o=n(1420),a=n(3734),s=n(1752),c=n(4774),l=n(9631),u=function(){function e(e,t,n,r,i,o,a,s){this._container=e,this._alpha=r,this._colors=i,this._rendererId=o,this._bufferService=a,this._optionsService=s,this._scaledCharWidth=0,this._scaledCharHeight=0,this._scaledCellWidth=0,this._scaledCellHeight=0,this._scaledCharLeft=0,this._scaledCharTop=0,this._currentGlyphIdentifier={chars:"",code:0,bg:0,fg:0,bold:!1,dim:!1,italic:!1},this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-"+t+"-layer"),this._canvas.style.zIndex=n.toString(),this._initCanvas(),this._container.appendChild(this._canvas)}return e.prototype.dispose=function(){var e;l.removeElementFromParent(this._canvas),null===(e=this._charAtlas)||void 0===e||e.dispose()},e.prototype._initCanvas=function(){this._ctx=s.throwIfFalsy(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()},e.prototype.onOptionsChanged=function(){},e.prototype.onBlur=function(){},e.prototype.onFocus=function(){},e.prototype.onCursorMove=function(){},e.prototype.onGridChanged=function(e,t){},e.prototype.onSelectionChanged=function(e,t,n){void 0===n&&(n=!1)},e.prototype.setColors=function(e){this._refreshCharAtlas(e)},e.prototype._setTransparency=function(e){if(e!==this._alpha){var t=this._canvas;this._alpha=e,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,t),this._refreshCharAtlas(this._colors),this.onGridChanged(0,this._bufferService.rows-1)}},e.prototype._refreshCharAtlas=function(e){this._scaledCharWidth<=0&&this._scaledCharHeight<=0||(this._charAtlas=o.acquireCharAtlas(this._optionsService.options,this._rendererId,e,this._scaledCharWidth,this._scaledCharHeight),this._charAtlas.warmUp())},e.prototype.resize=function(e){this._scaledCellWidth=e.scaledCellWidth,this._scaledCellHeight=e.scaledCellHeight,this._scaledCharWidth=e.scaledCharWidth,this._scaledCharHeight=e.scaledCharHeight,this._scaledCharLeft=e.scaledCharLeft,this._scaledCharTop=e.scaledCharTop,this._canvas.width=e.scaledCanvasWidth,this._canvas.height=e.scaledCanvasHeight,this._canvas.style.width=e.canvasWidth+"px",this._canvas.style.height=e.canvasHeight+"px",this._alpha||this._clearAll(),this._refreshCharAtlas(this._colors)},e.prototype._fillCells=function(e,t,n,r){this._ctx.fillRect(e*this._scaledCellWidth,t*this._scaledCellHeight,n*this._scaledCellWidth,r*this._scaledCellHeight)},e.prototype._fillBottomLineAtCells=function(e,t,n){void 0===n&&(n=1),this._ctx.fillRect(e*this._scaledCellWidth,(t+1)*this._scaledCellHeight-window.devicePixelRatio-1,n*this._scaledCellWidth,window.devicePixelRatio)},e.prototype._fillLeftLineAtCell=function(e,t,n){this._ctx.fillRect(e*this._scaledCellWidth,t*this._scaledCellHeight,window.devicePixelRatio*n,this._scaledCellHeight)},e.prototype._strokeRectAtCell=function(e,t,n,r){this._ctx.lineWidth=window.devicePixelRatio,this._ctx.strokeRect(e*this._scaledCellWidth+window.devicePixelRatio/2,t*this._scaledCellHeight+window.devicePixelRatio/2,n*this._scaledCellWidth-window.devicePixelRatio,r*this._scaledCellHeight-window.devicePixelRatio)},e.prototype._clearAll=function(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))},e.prototype._clearCells=function(e,t,n,r){this._alpha?this._ctx.clearRect(e*this._scaledCellWidth,t*this._scaledCellHeight,n*this._scaledCellWidth,r*this._scaledCellHeight):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(e*this._scaledCellWidth,t*this._scaledCellHeight,n*this._scaledCellWidth,r*this._scaledCellHeight))},e.prototype._fillCharTrueColor=function(e,t,n){this._ctx.font=this._getFont(!1,!1),this._ctx.textBaseline="middle",this._clipRow(n),this._ctx.fillText(e.getChars(),t*this._scaledCellWidth+this._scaledCharLeft,n*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2)},e.prototype._drawChars=function(e,t,n){var o,a,s=this._getContrastColor(e);s||e.isFgRGB()||e.isBgRGB()?this._drawUncachedChars(e,t,n,s):(e.isInverse()?(o=e.isBgDefault()?i.INVERTED_DEFAULT_COLOR:e.getBgColor(),a=e.isFgDefault()?i.INVERTED_DEFAULT_COLOR:e.getFgColor()):(a=e.isBgDefault()?r.DEFAULT_COLOR:e.getBgColor(),o=e.isFgDefault()?r.DEFAULT_COLOR:e.getFgColor()),o+=this._optionsService.options.drawBoldTextInBrightColors&&e.isBold()&&o<8?8:0,this._currentGlyphIdentifier.chars=e.getChars()||r.WHITESPACE_CELL_CHAR,this._currentGlyphIdentifier.code=e.getCode()||r.WHITESPACE_CELL_CODE,this._currentGlyphIdentifier.bg=a,this._currentGlyphIdentifier.fg=o,this._currentGlyphIdentifier.bold=!!e.isBold(),this._currentGlyphIdentifier.dim=!!e.isDim(),this._currentGlyphIdentifier.italic=!!e.isItalic(),this._charAtlas&&this._charAtlas.draw(this._ctx,this._currentGlyphIdentifier,t*this._scaledCellWidth+this._scaledCharLeft,n*this._scaledCellHeight+this._scaledCharTop)||this._drawUncachedChars(e,t,n))},e.prototype._drawUncachedChars=function(e,t,n,r){if(this._ctx.save(),this._ctx.font=this._getFont(!!e.isBold(),!!e.isItalic()),this._ctx.textBaseline="middle",e.isInverse())if(r)this._ctx.fillStyle=r.css;else if(e.isBgDefault())this._ctx.fillStyle=c.color.opaque(this._colors.background).css;else if(e.isBgRGB())this._ctx.fillStyle="rgb("+a.AttributeData.toColorRGB(e.getBgColor()).join(",")+")";else{var o=e.getBgColor();this._optionsService.options.drawBoldTextInBrightColors&&e.isBold()&&o<8&&(o+=8),this._ctx.fillStyle=this._colors.ansi[o].css}else if(r)this._ctx.fillStyle=r.css;else if(e.isFgDefault())this._ctx.fillStyle=this._colors.foreground.css;else if(e.isFgRGB())this._ctx.fillStyle="rgb("+a.AttributeData.toColorRGB(e.getFgColor()).join(",")+")";else{var s=e.getFgColor();this._optionsService.options.drawBoldTextInBrightColors&&e.isBold()&&s<8&&(s+=8),this._ctx.fillStyle=this._colors.ansi[s].css}this._clipRow(n),e.isDim()&&(this._ctx.globalAlpha=i.DIM_OPACITY),this._ctx.fillText(e.getChars(),t*this._scaledCellWidth+this._scaledCharLeft,n*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2),this._ctx.restore()},e.prototype._clipRow=function(e){this._ctx.beginPath(),this._ctx.rect(0,e*this._scaledCellHeight,this._bufferService.cols*this._scaledCellWidth,this._scaledCellHeight),this._ctx.clip()},e.prototype._getFont=function(e,t){return(t?"italic":"")+" "+(e?this._optionsService.options.fontWeightBold:this._optionsService.options.fontWeight)+" "+this._optionsService.options.fontSize*window.devicePixelRatio+"px "+this._optionsService.options.fontFamily},e.prototype._getContrastColor=function(e){if(1!==this._optionsService.options.minimumContrastRatio){var t=this._colors.contrastCache.getColor(e.bg,e.fg);if(void 0!==t)return t||void 0;var n=e.getFgColor(),r=e.getFgColorMode(),i=e.getBgColor(),o=e.getBgColorMode(),a=!!e.isInverse(),s=!!e.isInverse();if(a){var l=n;n=i,i=l;var u=r;r=o,o=u}var h=this._resolveBackgroundRgba(o,i,a),d=this._resolveForegroundRgba(r,n,a,s),f=c.rgba.ensureContrastRatio(h,d,this._optionsService.options.minimumContrastRatio);if(f){var p={css:c.channels.toCss(f>>24&255,f>>16&255,f>>8&255),rgba:f};return this._colors.contrastCache.setColor(e.bg,e.fg,p),p}this._colors.contrastCache.setColor(e.bg,e.fg,null)}},e.prototype._resolveBackgroundRgba=function(e,t,n){switch(e){case 16777216:case 33554432:return this._colors.ansi[t].rgba;case 50331648:return t<<8;case 0:default:return n?this._colors.foreground.rgba:this._colors.background.rgba}},e.prototype._resolveForegroundRgba=function(e,t,n,r){switch(e){case 16777216:case 33554432:return this._optionsService.options.drawBoldTextInBrightColors&&r&&t<8&&(t+=8),this._colors.ansi[t].rgba;case 50331648:return t<<8;case 0:default:return n?this._colors.background.rgba:this._colors.foreground.rgba}},e}();t.BaseRenderLayer=u},5879:function(e,t,n){var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.CharacterJoinerRegistry=t.JoinedCellData=void 0;var o=n(3734),a=n(643),s=n(511),c=function(e){function t(t,n,r){var i=e.call(this)||this;return i.content=0,i.combinedData="",i.fg=t.fg,i.bg=t.bg,i.combinedData=n,i._width=r,i}return i(t,e),t.prototype.isCombined=function(){return 2097152},t.prototype.getWidth=function(){return this._width},t.prototype.getChars=function(){return this.combinedData},t.prototype.getCode=function(){return 2097151},t.prototype.setFromCharData=function(e){throw new Error("not implemented")},t.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},t}(o.AttributeData);t.JoinedCellData=c;var l=function(){function e(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new s.CellData}return e.prototype.registerCharacterJoiner=function(e){var t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id},e.prototype.deregisterCharacterJoiner=function(e){for(var t=0;t1)for(var h=this._getJoinedRanges(r,s,o,t,i),d=0;d1)for(h=this._getJoinedRanges(r,s,o,t,i),d=0;d=this._bufferService.rows)this._clearCursor();else{var r=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1);if(this._bufferService.buffer.lines.get(t).loadCell(r,this._cell),void 0!==this._cell.content){if(!this._coreBrowserService.isFocused){this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css;var i=this._optionsService.options.cursorStyle;return i&&"block"!==i?this._cursorRenderers[i](r,n,this._cell):this._renderBlurCursor(r,n,this._cell),this._ctx.restore(),this._state.x=r,this._state.y=n,this._state.isFocused=!1,this._state.style=i,void(this._state.width=this._cell.getWidth())}if(!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isCursorVisible){if(this._state){if(this._state.x===r&&this._state.y===n&&this._state.isFocused===this._coreBrowserService.isFocused&&this._state.style===this._optionsService.options.cursorStyle&&this._state.width===this._cell.getWidth())return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[this._optionsService.options.cursorStyle||"block"](r,n,this._cell),this._ctx.restore(),this._state.x=r,this._state.y=n,this._state.isFocused=!1,this._state.style=this._optionsService.options.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}}else this._clearCursor()},t.prototype._clearCursor=function(){this._state&&(this._clearCells(this._state.x,this._state.y,this._state.width,1),this._state={x:0,y:0,isFocused:!1,style:"",width:0})},t.prototype._renderBarCursor=function(e,t,n){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillLeftLineAtCell(e,t,this._optionsService.options.cursorWidth),this._ctx.restore()},t.prototype._renderBlockCursor=function(e,t,n){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillCells(e,t,n.getWidth(),1),this._ctx.fillStyle=this._colors.cursorAccent.css,this._fillCharTrueColor(n,e,t),this._ctx.restore()},t.prototype._renderUnderlineCursor=function(e,t,n){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillBottomLineAtCells(e,t),this._ctx.restore()},t.prototype._renderBlurCursor=function(e,t,n){this._ctx.save(),this._ctx.strokeStyle=this._colors.cursor.css,this._strokeRectAtCell(e,t,n.getWidth(),1),this._ctx.restore()},t}(o.BaseRenderLayer);t.CursorRenderLayer=c;var l=function(){function e(e,t){this._renderCallback=t,this.isCursorVisible=!0,e&&this._restartInterval()}return Object.defineProperty(e.prototype,"isPaused",{get:function(){return!(this._blinkStartTimeout||this._blinkInterval)},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){this._blinkInterval&&(window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},e.prototype.restartBlinkAnimation=function(){var e=this;this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=window.requestAnimationFrame(function(){e._renderCallback(),e._animationFrame=void 0})))},e.prototype._restartInterval=function(e){var t=this;void 0===e&&(e=s),this._blinkInterval&&window.clearInterval(this._blinkInterval),this._blinkStartTimeout=window.setTimeout(function(){if(t._animationTimeRestarted){var e=s-(Date.now()-t._animationTimeRestarted);if(t._animationTimeRestarted=void 0,e>0)return void t._restartInterval(e)}t.isCursorVisible=!1,t._animationFrame=window.requestAnimationFrame(function(){t._renderCallback(),t._animationFrame=void 0}),t._blinkInterval=window.setInterval(function(){if(t._animationTimeRestarted){var e=s-(Date.now()-t._animationTimeRestarted);return t._animationTimeRestarted=void 0,void t._restartInterval(e)}t.isCursorVisible=!t.isCursorVisible,t._animationFrame=window.requestAnimationFrame(function(){t._renderCallback(),t._animationFrame=void 0})},s)},e)},e.prototype.pause=function(){this.isCursorVisible=!0,this._blinkInterval&&(window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},e.prototype.resume=function(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()},e}()},3700:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.GridCache=void 0;var n=function(){function e(){this.cache=[]}return e.prototype.resize=function(e,t){for(var n=0;n0&&this._clearCells(0,this._state.y1+1,this._state.cols,e),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}},t.prototype._onShowLinkUnderline=function(e){if(this._ctx.fillStyle=e.fg===a.INVERTED_DEFAULT_COLOR?this._colors.background.css:e.fg&&s.is256Color(e.fg)?this._colors.ansi[e.fg].css:this._colors.foreground.css,e.y1===e.y2)this._fillBottomLineAtCells(e.x1,e.y1,e.x2-e.x1);else{this._fillBottomLineAtCells(e.x1,e.y1,e.cols-e.x1);for(var t=e.y1+1;t=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},a=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.Renderer=void 0;var s=n(9596),c=n(4149),l=n(2512),u=n(5098),h=n(5879),d=n(844),f=n(4725),p=n(2585),m=n(1420),g=n(8460),v=1,b=function(e){function t(t,n,r,i,o,a,d,f,p){var m=e.call(this)||this;m._colors=t,m._screenElement=n,m._bufferService=o,m._charSizeService=a,m._optionsService=d,m._id=v++,m._onRequestRedraw=new g.EventEmitter;var b=m._optionsService.options.allowTransparency;return m._characterJoinerRegistry=new h.CharacterJoinerRegistry(m._bufferService),m._renderLayers=[new s.TextRenderLayer(m._screenElement,0,m._colors,m._characterJoinerRegistry,b,m._id,m._bufferService,d),new c.SelectionRenderLayer(m._screenElement,1,m._colors,m._id,m._bufferService,d),new u.LinkRenderLayer(m._screenElement,2,m._colors,m._id,r,i,m._bufferService,d),new l.CursorRenderLayer(m._screenElement,3,m._colors,m._id,m._onRequestRedraw,m._bufferService,d,f,p)],m.dimensions={scaledCharWidth:0,scaledCharHeight:0,scaledCellWidth:0,scaledCellHeight:0,scaledCharLeft:0,scaledCharTop:0,scaledCanvasWidth:0,scaledCanvasHeight:0,canvasWidth:0,canvasHeight:0,actualCellWidth:0,actualCellHeight:0},m._devicePixelRatio=window.devicePixelRatio,m._updateDimensions(),m.onOptionsChanged(),m}return i(t,e),Object.defineProperty(t.prototype,"onRequestRedraw",{get:function(){return this._onRequestRedraw.event},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){for(var t=0,n=this._renderLayers;t=this._bufferService.rows||a<0)this._state.ydisp=this._bufferService.buffer.ydisp;else{if(this._ctx.fillStyle=this._colors.selectionTransparent.css,n){var s=e[0];this._fillCells(s,o,t[0]-s,a-o+1)}else{this._fillCells(s=r===o?e[0]:0,o,(o===i?t[0]:this._bufferService.cols)-s,1);var c=Math.max(a-o-1,0);this._fillCells(0,o+1,this._bufferService.cols,c),o!==a&&this._fillCells(0,a,i===a?t[0]:this._bufferService.cols,1)}this._state.start=[e[0],e[1]],this._state.end=[t[0],t[1]],this._state.columnSelectMode=n,this._state.ydisp=this._bufferService.buffer.ydisp}}else this._clearState()},t.prototype._didStateChange=function(e,t,n,r){return!this._areCoordinatesEqual(e,this._state.start)||!this._areCoordinatesEqual(t,this._state.end)||n!==this._state.columnSelectMode||r!==this._state.ydisp},t.prototype._areCoordinatesEqual=function(e,t){return!(!e||!t)&&e[0]===t[0]&&e[1]===t[1]},t}(n(1546).BaseRenderLayer);t.SelectionRenderLayer=o},9596:function(e,t,n){var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.TextRenderLayer=void 0;var o=n(3700),a=n(1546),s=n(3734),c=n(643),l=n(5879),u=n(511),h=function(e){function t(t,n,r,i,a,s,c,l){var h=e.call(this,t,"text",n,a,r,s,c,l)||this;return h._characterWidth=0,h._characterFont="",h._characterOverlapCache={},h._workCell=new u.CellData,h._state=new o.GridCache,h._characterJoinerRegistry=i,h}return i(t,e),t.prototype.resize=function(t){e.prototype.resize.call(this,t);var n=this._getFont(!1,!1);this._characterWidth===t.scaledCharWidth&&this._characterFont===n||(this._characterWidth=t.scaledCharWidth,this._characterFont=n,this._characterOverlapCache={}),this._state.clear(),this._state.resize(this._bufferService.cols,this._bufferService.rows)},t.prototype.reset=function(){this._state.clear(),this._clearAll()},t.prototype._forEachCell=function(e,t,n,r){for(var i=e;i<=t;i++)for(var o=i+this._bufferService.buffer.ydisp,a=this._bufferService.buffer.lines.get(o),s=n?n.getJoinedCharacters(o):[],u=0;u0&&u===s[0][0]){d=!0;var p=s.shift();h=new l.JoinedCellData(this._workCell,a.translateToString(!0,p[0],p[1]),p[1]-p[0]),f=p[1]-1}!d&&this._isOverlapping(h)&&fthis._characterWidth;return this._ctx.restore(),this._characterOverlapCache[t]=n,n},t}(a.BaseRenderLayer);t.TextRenderLayer=h},9616:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.BaseCharAtlas=void 0;var n=function(){function e(){this._didWarmUp=!1}return e.prototype.dispose=function(){},e.prototype.warmUp=function(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)},e.prototype._doWarmUp=function(){},e.prototype.beginFrame=function(){},e}();t.BaseCharAtlas=n},1420:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.removeTerminalFromCache=t.acquireCharAtlas=void 0;var r=n(2040),i=n(1906),o=[];t.acquireCharAtlas=function(e,t,n,a,s){for(var c=r.generateConfig(a,s,e,n),l=0;l=0){if(r.configEquals(h.config,c))return h.atlas;1===h.ownedBy.length?(h.atlas.dispose(),o.splice(l,1)):h.ownedBy.splice(u,1);break}}for(l=0;l>>24,i=t.rgba>>>16&255,o=t.rgba>>>8&255,a=0;a=this.capacity)this._unlinkNode(n=this._head),delete this._map[n.key],n.key=e,n.value=t,this._map[e]=n;else{var r=this._nodePool;r.length>0?((n=r.pop()).key=e,n.value=t):n={prev:null,next:null,key:e,value:t},this._map[e]=n,this.size++}this._appendNode(n)},e}();t.LRUMap=n},1296:function(e,t,n){var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},a=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DomRenderer=void 0;var s=n(3787),c=n(8803),l=n(844),u=n(4725),h=n(2585),d=n(8460),f=n(4774),p=n(9631),m="xterm-dom-renderer-owner-",g="xterm-fg-",v="xterm-bg-",b="xterm-focus",y=1,_=function(e){function t(t,n,r,i,o,a,c,l,u){var h=e.call(this)||this;return h._colors=t,h._element=n,h._screenElement=r,h._viewportElement=i,h._linkifier=o,h._linkifier2=a,h._charSizeService=c,h._optionsService=l,h._bufferService=u,h._terminalClass=y++,h._rowElements=[],h._rowContainer=document.createElement("div"),h._rowContainer.classList.add("xterm-rows"),h._rowContainer.style.lineHeight="normal",h._rowContainer.setAttribute("aria-hidden","true"),h._refreshRowElements(h._bufferService.cols,h._bufferService.rows),h._selectionContainer=document.createElement("div"),h._selectionContainer.classList.add("xterm-selection"),h._selectionContainer.setAttribute("aria-hidden","true"),h.dimensions={scaledCharWidth:0,scaledCharHeight:0,scaledCellWidth:0,scaledCellHeight:0,scaledCharLeft:0,scaledCharTop:0,scaledCanvasWidth:0,scaledCanvasHeight:0,canvasWidth:0,canvasHeight:0,actualCellWidth:0,actualCellHeight:0},h._updateDimensions(),h._injectCss(),h._rowFactory=new s.DomRendererRowFactory(document,h._optionsService,h._colors),h._element.classList.add(m+h._terminalClass),h._screenElement.appendChild(h._rowContainer),h._screenElement.appendChild(h._selectionContainer),h._linkifier.onShowLinkUnderline(function(e){return h._onLinkHover(e)}),h._linkifier.onHideLinkUnderline(function(e){return h._onLinkLeave(e)}),h._linkifier2.onShowLinkUnderline(function(e){return h._onLinkHover(e)}),h._linkifier2.onHideLinkUnderline(function(e){return h._onLinkLeave(e)}),h}return i(t,e),Object.defineProperty(t.prototype,"onRequestRedraw",{get:function(){return(new d.EventEmitter).event},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){this._element.classList.remove(m+this._terminalClass),p.removeElementFromParent(this._rowContainer,this._selectionContainer,this._themeStyleElement,this._dimensionsStyleElement),e.prototype.dispose.call(this)},t.prototype._updateDimensions=function(){this.dimensions.scaledCharWidth=this._charSizeService.width*window.devicePixelRatio,this.dimensions.scaledCharHeight=Math.ceil(this._charSizeService.height*window.devicePixelRatio),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._optionsService.options.letterSpacing),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._optionsService.options.lineHeight),this.dimensions.scaledCharLeft=0,this.dimensions.scaledCharTop=0,this.dimensions.scaledCanvasWidth=this.dimensions.scaledCellWidth*this._bufferService.cols,this.dimensions.scaledCanvasHeight=this.dimensions.scaledCellHeight*this._bufferService.rows,this.dimensions.canvasWidth=Math.round(this.dimensions.scaledCanvasWidth/window.devicePixelRatio),this.dimensions.canvasHeight=Math.round(this.dimensions.scaledCanvasHeight/window.devicePixelRatio),this.dimensions.actualCellWidth=this.dimensions.canvasWidth/this._bufferService.cols,this.dimensions.actualCellHeight=this.dimensions.canvasHeight/this._bufferService.rows;for(var e=0,t=this._rowElements;et;)this._rowContainer.removeChild(this._rowElements.pop())},t.prototype.onResize=function(e,t){this._refreshRowElements(e,t),this._updateDimensions()},t.prototype.onCharSizeChanged=function(){this._updateDimensions()},t.prototype.onBlur=function(){this._rowContainer.classList.remove(b)},t.prototype.onFocus=function(){this._rowContainer.classList.add(b)},t.prototype.onSelectionChanged=function(e,t,n){for(;this._selectionContainer.children.length;)this._selectionContainer.removeChild(this._selectionContainer.children[0]);if(e&&t){var r=e[1]-this._bufferService.buffer.ydisp,i=t[1]-this._bufferService.buffer.ydisp,o=Math.max(r,0),a=Math.min(i,this._bufferService.rows-1);if(!(o>=this._bufferService.rows||a<0)){var s=document.createDocumentFragment();n?s.appendChild(this._createSelectionElement(o,e[0],t[0],a-o+1)):(s.appendChild(this._createSelectionElement(o,r===o?e[0]:0,o===i?t[0]:this._bufferService.cols)),s.appendChild(this._createSelectionElement(o+1,0,this._bufferService.cols,a-o-1)),o!==a&&s.appendChild(this._createSelectionElement(a,0,i===a?t[0]:this._bufferService.cols))),this._selectionContainer.appendChild(s)}}},t.prototype._createSelectionElement=function(e,t,n,r){void 0===r&&(r=1);var i=document.createElement("div");return i.style.height=r*this.dimensions.actualCellHeight+"px",i.style.top=e*this.dimensions.actualCellHeight+"px",i.style.left=t*this.dimensions.actualCellWidth+"px",i.style.width=this.dimensions.actualCellWidth*(n-t)+"px",i},t.prototype.onCursorMove=function(){},t.prototype.onOptionsChanged=function(){this._updateDimensions(),this._injectCss()},t.prototype.clear=function(){for(var e=0,t=this._rowElements;e=i&&(e=0,n++)}},o([a(6,u.ICharSizeService),a(7,h.IOptionsService),a(8,h.IBufferService)],t)}(l.Disposable);t.DomRenderer=_},3787:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.DomRendererRowFactory=t.CURSOR_STYLE_UNDERLINE_CLASS=t.CURSOR_STYLE_BAR_CLASS=t.CURSOR_STYLE_BLOCK_CLASS=t.CURSOR_BLINK_CLASS=t.CURSOR_CLASS=t.UNDERLINE_CLASS=t.ITALIC_CLASS=t.DIM_CLASS=t.BOLD_CLASS=void 0;var r=n(8803),i=n(643),o=n(511),a=n(4774);t.BOLD_CLASS="xterm-bold",t.DIM_CLASS="xterm-dim",t.ITALIC_CLASS="xterm-italic",t.UNDERLINE_CLASS="xterm-underline",t.CURSOR_CLASS="xterm-cursor",t.CURSOR_BLINK_CLASS="xterm-cursor-blink",t.CURSOR_STYLE_BLOCK_CLASS="xterm-cursor-block",t.CURSOR_STYLE_BAR_CLASS="xterm-cursor-bar",t.CURSOR_STYLE_UNDERLINE_CLASS="xterm-cursor-underline";var s=function(){function e(e,t,n){this._document=e,this._optionsService=t,this._colors=n,this._workCell=new o.CellData}return e.prototype.setColors=function(e){this._colors=e},e.prototype.createRow=function(e,n,o,s,l,u,h){for(var d=this._document.createDocumentFragment(),f=0,p=Math.min(e.length,h)-1;p>=0;p--)if(e.loadCell(p,this._workCell).getCode()!==i.NULL_CELL_CODE||n&&p===s){f=p+1;break}for(p=0;p1&&(g.style.width=u*m+"px"),n&&p===s)switch(g.classList.add(t.CURSOR_CLASS),l&&g.classList.add(t.CURSOR_BLINK_CLASS),o){case"bar":g.classList.add(t.CURSOR_STYLE_BAR_CLASS);break;case"underline":g.classList.add(t.CURSOR_STYLE_UNDERLINE_CLASS);break;default:g.classList.add(t.CURSOR_STYLE_BLOCK_CLASS)}this._workCell.isBold()&&g.classList.add(t.BOLD_CLASS),this._workCell.isItalic()&&g.classList.add(t.ITALIC_CLASS),this._workCell.isDim()&&g.classList.add(t.DIM_CLASS),this._workCell.isUnderline()&&g.classList.add(t.UNDERLINE_CLASS),g.textContent=this._workCell.isInvisible()?i.WHITESPACE_CELL_CHAR:this._workCell.getChars()||i.WHITESPACE_CELL_CHAR;var v=this._workCell.getFgColor(),b=this._workCell.getFgColorMode(),y=this._workCell.getBgColor(),_=this._workCell.getBgColorMode(),w=!!this._workCell.isInverse();if(w){var k=v;v=y,y=k;var C=b;b=_,_=C}switch(b){case 16777216:case 33554432:this._workCell.isBold()&&v<8&&this._optionsService.options.drawBoldTextInBrightColors&&(v+=8),this._applyMinimumContrast(g,this._colors.background,this._colors.ansi[v])||g.classList.add("xterm-fg-"+v);break;case 50331648:var S=a.rgba.toColor(v>>16&255,v>>8&255,255&v);this._applyMinimumContrast(g,this._colors.background,S)||this._addStyle(g,"color:#"+c(v.toString(16),"0",6));break;case 0:default:this._applyMinimumContrast(g,this._colors.background,this._colors.foreground)||w&&g.classList.add("xterm-fg-"+r.INVERTED_DEFAULT_COLOR)}switch(_){case 16777216:case 33554432:g.classList.add("xterm-bg-"+y);break;case 50331648:this._addStyle(g,"background-color:#"+c(y.toString(16),"0",6));break;case 0:default:w&&g.classList.add("xterm-bg-"+r.INVERTED_DEFAULT_COLOR)}d.appendChild(g)}}return d},e.prototype._applyMinimumContrast=function(e,t,n){if(1===this._optionsService.options.minimumContrastRatio)return!1;var r=this._colors.contrastCache.getColor(this._workCell.bg,this._workCell.fg);return void 0===r&&(r=a.color.ensureContrastRatio(t,n,this._optionsService.options.minimumContrastRatio),this._colors.contrastCache.setColor(this._workCell.bg,this._workCell.fg,null!=r?r:null)),!!r&&(this._addStyle(e,"color:"+r.css),!0)},e.prototype._addStyle=function(e,t){e.setAttribute("style",""+(e.getAttribute("style")||"")+t+";")},e}();function c(e,t,n){for(;e.lengththis._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}return this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]?[Math.max(this.selectionStart[0]+this.selectionStartLength,this.selectionEnd[0]),this.selectionEnd[1]]:this.selectionEnd}},enumerable:!1,configurable:!0}),e.prototype.areSelectionValuesReversed=function(){var e=this.selectionStart,t=this.selectionEnd;return!(!e||!t)&&(e[1]>t[1]||e[1]===t[1]&&e[0]>t[0])},e.prototype.onTrim=function(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)},e}();t.SelectionModel=n},428:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CharSizeService=void 0;var o=n(2585),a=n(8460),s=function(){function e(e,t,n){this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=new a.EventEmitter,this._measureStrategy=new c(e,t,this._optionsService)}return Object.defineProperty(e.prototype,"hasValidSize",{get:function(){return this.width>0&&this.height>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onCharSizeChange",{get:function(){return this._onCharSizeChange.event},enumerable:!1,configurable:!0}),e.prototype.measure=function(){var e=this._measureStrategy.measure();e.width===this.width&&e.height===this.height||(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())},r([i(2,o.IOptionsService)],e)}();t.CharSizeService=s;var c=function(){function e(e,t,n){this._document=e,this._parentElement=t,this._optionsService=n,this._result={width:0,height:0},this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W",this._measureElement.setAttribute("aria-hidden","true"),this._parentElement.appendChild(this._measureElement)}return e.prototype.measure=function(){this._measureElement.style.fontFamily=this._optionsService.options.fontFamily,this._measureElement.style.fontSize=this._optionsService.options.fontSize+"px";var e=this._measureElement.getBoundingClientRect();return 0!==e.width&&0!==e.height&&(this._result.width=e.width,this._result.height=Math.ceil(e.height)),this._result},e}()},5114:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.CoreBrowserService=void 0;var n=function(){function e(e){this._textarea=e}return Object.defineProperty(e.prototype,"isFocused",{get:function(){return(this._textarea.getRootNode?this._textarea.getRootNode():document).activeElement===this._textarea&&document.hasFocus()},enumerable:!1,configurable:!0}),e}();t.CoreBrowserService=n},8934:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.MouseService=void 0;var o=n(4725),a=n(9806),s=function(){function e(e,t){this._renderService=e,this._charSizeService=t}return e.prototype.getCoords=function(e,t,n,r,i){return a.getCoords(e,t,n,r,this._charSizeService.hasValidSize,this._renderService.dimensions.actualCellWidth,this._renderService.dimensions.actualCellHeight,i)},e.prototype.getRawByteCoords=function(e,t,n,r){var i=this.getCoords(e,t,n,r);return a.getRawByteCoords(i)},r([i(0,o.IRenderService),i(1,o.ICharSizeService)],e)}();t.MouseService=s},3230:function(e,t,n){var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},a=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.RenderService=void 0;var s=n(6193),c=n(8460),l=n(844),u=n(5596),h=n(3656),d=n(2585),f=n(4725),p=function(e){function t(t,n,r,i,o,a){var l=e.call(this)||this;if(l._renderer=t,l._rowCount=n,l._charSizeService=o,l._isPaused=!1,l._needsFullRefresh=!1,l._isNextRenderRedrawOnly=!0,l._needsSelectionRefresh=!1,l._canvasWidth=0,l._canvasHeight=0,l._selectionState={start:void 0,end:void 0,columnSelectMode:!1},l._onDimensionsChange=new c.EventEmitter,l._onRender=new c.EventEmitter,l._onRefreshRequest=new c.EventEmitter,l.register({dispose:function(){return l._renderer.dispose()}}),l._renderDebouncer=new s.RenderDebouncer(function(e,t){return l._renderRows(e,t)}),l.register(l._renderDebouncer),l._screenDprMonitor=new u.ScreenDprMonitor,l._screenDprMonitor.setListener(function(){return l.onDevicePixelRatioChange()}),l.register(l._screenDprMonitor),l.register(a.onResize(function(e){return l._fullRefresh()})),l.register(i.onOptionChange(function(){return l._renderer.onOptionsChanged()})),l.register(l._charSizeService.onCharSizeChange(function(){return l.onCharSizeChanged()})),l._renderer.onRequestRedraw(function(e){return l.refreshRows(e.start,e.end,!0)}),l.register(h.addDisposableDomListener(window,"resize",function(){return l.onDevicePixelRatioChange()})),"IntersectionObserver"in window){var d=new IntersectionObserver(function(e){return l._onIntersectionChange(e[e.length-1])},{threshold:0});d.observe(r),l.register({dispose:function(){return d.disconnect()}})}return l}return i(t,e),Object.defineProperty(t.prototype,"onDimensionsChange",{get:function(){return this._onDimensionsChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRenderedBufferChange",{get:function(){return this._onRender.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRefreshRequest",{get:function(){return this._onRefreshRequest.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dimensions",{get:function(){return this._renderer.dimensions},enumerable:!1,configurable:!0}),t.prototype._onIntersectionChange=function(e){this._isPaused=void 0===e.isIntersecting?0===e.intersectionRatio:!e.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)},t.prototype.refreshRows=function(e,t,n){void 0===n&&(n=!1),this._isPaused?this._needsFullRefresh=!0:(n||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount))},t.prototype._renderRows=function(e,t){this._renderer.renderRows(e,t),this._needsSelectionRefresh&&(this._renderer.onSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0},t.prototype.resize=function(e,t){this._rowCount=t,this._fireOnCanvasResize()},t.prototype.changeOptions=function(){this._renderer.onOptionsChanged(),this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize()},t.prototype._fireOnCanvasResize=function(){this._renderer.dimensions.canvasWidth===this._canvasWidth&&this._renderer.dimensions.canvasHeight===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.dimensions)},t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype.setRenderer=function(e){var t=this;this._renderer.dispose(),this._renderer=e,this._renderer.onRequestRedraw(function(e){return t.refreshRows(e.start,e.end,!0)}),this._needsSelectionRefresh=!0,this._fullRefresh()},t.prototype._fullRefresh=function(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)},t.prototype.setColors=function(e){this._renderer.setColors(e),this._fullRefresh()},t.prototype.onDevicePixelRatioChange=function(){this._charSizeService.measure(),this._renderer.onDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1)},t.prototype.onResize=function(e,t){this._renderer.onResize(e,t),this._fullRefresh()},t.prototype.onCharSizeChanged=function(){this._renderer.onCharSizeChanged()},t.prototype.onBlur=function(){this._renderer.onBlur()},t.prototype.onFocus=function(){this._renderer.onFocus()},t.prototype.onSelectionChanged=function(e,t,n){this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=n,this._renderer.onSelectionChanged(e,t,n)},t.prototype.onCursorMove=function(){this._renderer.onCursorMove()},t.prototype.clear=function(){this._renderer.clear()},t.prototype.registerCharacterJoiner=function(e){return this._renderer.registerCharacterJoiner(e)},t.prototype.deregisterCharacterJoiner=function(e){return this._renderer.deregisterCharacterJoiner(e)},o([a(3,d.IOptionsService),a(4,f.ICharSizeService),a(5,d.IBufferService)],t)}(l.Disposable);t.RenderService=p},9312:function(e,t,n){var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},a=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionService=void 0;var s=n(6114),c=n(456),l=n(511),u=n(8460),h=n(4725),d=n(2585),f=n(9806),p=n(9504),m=n(844),g=String.fromCharCode(160),v=new RegExp(g,"g"),b=function(e){function t(t,n,r,i,o,a,s){var h=e.call(this)||this;return h._element=t,h._screenElement=n,h._bufferService=r,h._coreService=i,h._mouseService=o,h._optionsService=a,h._renderService=s,h._dragScrollAmount=0,h._enabled=!0,h._workCell=new l.CellData,h._mouseDownTimeStamp=0,h._oldHasSelection=!1,h._oldSelectionStart=void 0,h._oldSelectionEnd=void 0,h._onLinuxMouseSelection=h.register(new u.EventEmitter),h._onRedrawRequest=h.register(new u.EventEmitter),h._onSelectionChange=h.register(new u.EventEmitter),h._onRequestScrollLines=h.register(new u.EventEmitter),h._mouseMoveListener=function(e){return h._onMouseMove(e)},h._mouseUpListener=function(e){return h._onMouseUp(e)},h._coreService.onUserInput(function(){h.hasSelection&&h.clearSelection()}),h._trimListener=h._bufferService.buffer.lines.onTrim(function(e){return h._onTrim(e)}),h.register(h._bufferService.buffers.onBufferActivate(function(e){return h._onBufferActivate(e)})),h.enable(),h._model=new c.SelectionModel(h._bufferService),h._activeSelectionMode=0,h}return i(t,e),Object.defineProperty(t.prototype,"onLinuxMouseSelection",{get:function(){return this._onLinuxMouseSelection.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRequestRedraw",{get:function(){return this._onRedrawRequest.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRequestScrollLines",{get:function(){return this._onRequestScrollLines.event},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){this._removeMouseDownListeners()},t.prototype.reset=function(){this.clearSelection()},t.prototype.disable=function(){this.clearSelection(),this._enabled=!1},t.prototype.enable=function(){this._enabled=!0},Object.defineProperty(t.prototype,"selectionStart",{get:function(){return this._model.finalSelectionStart},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selectionEnd",{get:function(){return this._model.finalSelectionEnd},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasSelection",{get:function(){var e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!(!e||!t||e[0]===t[0]&&e[1]===t[1])},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selectionText",{get:function(){var e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";var n=this._bufferService.buffer,r=[];if(3===this._activeSelectionMode){if(e[0]===t[0])return"";for(var i=e[1];i<=t[1];i++){var o=n.translateBufferLineToString(i,!0,e[0],t[0]);r.push(o)}}else{for(r.push(n.translateBufferLineToString(e[1],!0,e[0],e[1]===t[1]?t[0]:void 0)),i=e[1]+1;i<=t[1]-1;i++){var a=n.lines.get(i);o=n.translateBufferLineToString(i,!0),a&&a.isWrapped?r[r.length-1]+=o:r.push(o)}e[1]!==t[1]&&(a=n.lines.get(t[1]),o=n.translateBufferLineToString(t[1],!0,0,t[0]),a&&a.isWrapped?r[r.length-1]+=o:r.push(o))}return r.map(function(e){return e.replace(v," ")}).join(s.isWindows?"\r\n":"\n")},enumerable:!1,configurable:!0}),t.prototype.clearSelection=function(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()},t.prototype.refresh=function(e){var t=this;this._refreshAnimationFrame||(this._refreshAnimationFrame=window.requestAnimationFrame(function(){return t._refresh()})),s.isLinux&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)},t.prototype._refresh=function(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:3===this._activeSelectionMode})},t.prototype._isClickInSelection=function(e){var t=this._getMouseBufferCoords(e),n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!!(n&&r&&t)&&this._areCoordsInSelection(t,n,r)},t.prototype._areCoordsInSelection=function(e,t,n){return e[1]>t[1]&&e[1]=t[0]&&e[0]=t[0]},t.prototype._selectWordAtCursor=function(e){var t=this._getMouseBufferCoords(e);t&&(this._selectWordAt(t,!1),this._model.selectionEnd=void 0,this.refresh(!0))},t.prototype.selectAll=function(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()},t.prototype.selectLines=function(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()},t.prototype._onTrim=function(e){this._model.onTrim(e)&&this.refresh()},t.prototype._getMouseBufferCoords=function(e){var t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t},t.prototype._getMouseEventScrollAmount=function(e){var t=f.getCoordsRelativeToElement(e,this._screenElement)[1],n=this._renderService.dimensions.canvasHeight;return t>=0&&t<=n?0:(t>n&&(t-=n),t=Math.min(Math.max(t,-50),50),(t/=50)/Math.abs(t)+Math.round(14*t))},t.prototype.shouldForceSelection=function(e){return s.isMac?e.altKey&&this._optionsService.options.macOptionClickForcesSelection:e.shiftKey},t.prototype.onMouseDown=function(e){if(this._mouseDownTimeStamp=e.timeStamp,(2!==e.button||!this.hasSelection)&&0===e.button){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._onIncrementalClick(e):1===e.detail?this._onSingleClick(e):2===e.detail?this._onDoubleClick(e):3===e.detail&&this._onTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}},t.prototype._addMouseDownListeners=function(){var e=this;this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=window.setInterval(function(){return e._dragScroll()},50)},t.prototype._removeMouseDownListeners=function(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0},t.prototype._onIncrementalClick=function(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))},t.prototype._onSingleClick=function(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),this._model.selectionStart){this._model.selectionEnd=void 0;var t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&0===t.hasWidth(this._model.selectionStart[0])&&this._model.selectionStart[0]++}},t.prototype._onDoubleClick=function(e){var t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=1,this._selectWordAt(t,!0))},t.prototype._onTripleClick=function(e){var t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))},t.prototype.shouldColumnSelect=function(e){return e.altKey&&!(s.isMac&&this._optionsService.options.macOptionClickForcesSelection)},t.prototype._onMouseMove=function(e){if(e.stopImmediatePropagation(),this._model.selectionStart){var t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),this._model.selectionEnd){2===this._activeSelectionMode?this._model.selectionEnd[0]=this._model.selectionEnd[1]0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));var n=this._bufferService.buffer;if(this._model.selectionEnd[1]0?(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}},t.prototype._onMouseUp=function(e){var t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<500&&e.altKey&&this._optionsService.getOption("altClickMovesCursor")){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){var n=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(n&&void 0!==n[0]&&void 0!==n[1]){var r=p.moveToCellSequence(n[0]-1,n[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(r,!0)}}}else this._fireEventIfSelectionChanged()},t.prototype._fireEventIfSelectionChanged=function(){var e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,n=!(!e||!t||e[0]===t[0]&&e[1]===t[1]);n?e&&t&&(this._oldSelectionStart&&this._oldSelectionEnd&&e[0]===this._oldSelectionStart[0]&&e[1]===this._oldSelectionStart[1]&&t[0]===this._oldSelectionEnd[0]&&t[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(e,t,n)):this._oldHasSelection&&this._fireOnSelectionChange(e,t,n)},t.prototype._fireOnSelectionChange=function(e,t,n){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=n,this._onSelectionChange.fire()},t.prototype._onBufferActivate=function(e){var t=this;this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(function(e){return t._onTrim(e)})},t.prototype._convertViewportColToCharacterIndex=function(e,t){for(var n=t[0],r=0;t[0]>=r;r++){var i=e.loadCell(r,this._workCell).getChars().length;0===this._workCell.getWidth()?n--:i>1&&t[0]!==r&&(n+=i-1)}return n},t.prototype.setSelection=function(e,t,n){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=n,this.refresh()},t.prototype.rightClickSelect=function(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e),this._fireEventIfSelectionChanged())},t.prototype._getWordAt=function(e,t,n,r){if(void 0===n&&(n=!0),void 0===r&&(r=!0),!(e[0]>=this._bufferService.cols)){var i=this._bufferService.buffer,o=i.lines.get(e[1]);if(o){var a=i.translateBufferLineToString(e[1],!1),s=this._convertViewportColToCharacterIndex(o,e),c=s,l=e[0]-s,u=0,h=0,d=0,f=0;if(" "===a.charAt(s)){for(;s>0&&" "===a.charAt(s-1);)s--;for(;c1&&(f+=g-1,c+=g-1);p>0&&s>0&&!this._isCharWordSeparator(o.loadCell(p-1,this._workCell));){o.loadCell(p-1,this._workCell);var v=this._workCell.getChars().length;0===this._workCell.getWidth()?(u++,p--):v>1&&(d+=v-1,s-=v-1),s--,p--}for(;m1&&(f+=b-1,c+=b-1),c++,m++}}c++;var y=s+l-u+d,_=Math.min(this._bufferService.cols,c-s+u+h-d-f);if(t||""!==a.slice(s,c).trim()){if(n&&0===y&&32!==o.getCodePoint(0)){var w=i.lines.get(e[1]-1);if(w&&o.isWrapped&&32!==w.getCodePoint(this._bufferService.cols-1)){var k=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(k){var C=this._bufferService.cols-k.start;y-=C,_+=C}}}if(r&&y+_===this._bufferService.cols&&32!==o.getCodePoint(this._bufferService.cols-1)){var S=i.lines.get(e[1]+1);if(S&&S.isWrapped&&32!==S.getCodePoint(0)){var x=this._getWordAt([0,e[1]+1],!1,!1,!0);x&&(_+=x.length)}}return{start:y,length:_}}}}},t.prototype._selectWordAt=function(e,t){var n=this._getWordAt(e,t);if(n){for(;n.start<0;)n.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[n.start,e[1]],this._model.selectionStartLength=n.length}},t.prototype._selectToWordAt=function(e){var t=this._getWordAt(e,!0);if(t){for(var n=e[1];t.start<0;)t.start+=this._bufferService.cols,n--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,n++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,n]}},t.prototype._isCharWordSeparator=function(e){return 0!==e.getWidth()&&this._optionsService.options.wordSeparator.indexOf(e.getChars())>=0},t.prototype._selectLineAt=function(e){var t=this._bufferService.buffer.getWrappedRangeForLine(e);this._model.selectionStart=[0,t.first],this._model.selectionEnd=[this._bufferService.cols,t.last],this._model.selectionStartLength=0},o([a(2,d.IBufferService),a(3,d.ICoreService),a(4,h.IMouseService),a(5,d.IOptionsService),a(6,h.IRenderService)],t)}(m.Disposable);t.SelectionService=b},4725:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.ISoundService=t.ISelectionService=t.IRenderService=t.IMouseService=t.ICoreBrowserService=t.ICharSizeService=void 0;var r=n(8343);t.ICharSizeService=r.createDecorator("CharSizeService"),t.ICoreBrowserService=r.createDecorator("CoreBrowserService"),t.IMouseService=r.createDecorator("MouseService"),t.IRenderService=r.createDecorator("RenderService"),t.ISelectionService=r.createDecorator("SelectionService"),t.ISoundService=r.createDecorator("SoundService")},357:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.SoundService=void 0;var o=n(2585),a=function(){function e(e){this._optionsService=e}return Object.defineProperty(e,"audioContext",{get:function(){if(!e._audioContext){var t=window.AudioContext||window.webkitAudioContext;if(!t)return console.warn("Web Audio API is not supported by this browser. Consider upgrading to the latest version"),null;e._audioContext=new t}return e._audioContext},enumerable:!1,configurable:!0}),e.prototype.playBellSound=function(){var t=e.audioContext;if(t){var n=t.createBufferSource();t.decodeAudioData(this._base64ToArrayBuffer(this._removeMimeType(this._optionsService.options.bellSound)),function(e){n.buffer=e,n.connect(t.destination),n.start(0)})}},e.prototype._base64ToArrayBuffer=function(e){for(var t=window.atob(e),n=t.length,r=new Uint8Array(n),i=0;ithis._length)for(var t=this._length;t=e;i--)this._array[this._getCyclicIndex(i+n.length)]=this._array[this._getCyclicIndex(i)];for(i=0;ithis._maxLength){var o=this._length+n.length-this._maxLength;this._startIndex+=o,this._length=this._maxLength,this.onTrimEmitter.fire(o)}else this._length+=n.length},e.prototype.trimStart=function(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)},e.prototype.shiftElements=function(e,t,n){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+n<0)throw new Error("Cannot shift elements in list beyond index 0");if(n>0){for(var r=t-1;r>=0;r--)this.set(e+r+n,this.get(e+r));var i=e+t+n-this._length;if(i>0)for(this._length+=i;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(r=0;r=n.ybase&&(this._bufferService.isUserScrolling=!1);var r=n.ydisp;n.ydisp=Math.max(Math.min(n.ydisp+e,n.ybase),0),r!==n.ydisp&&(t||this._onScroll.fire(n.ydisp))},t.prototype.scrollPages=function(e){this.scrollLines(e*(this.rows-1))},t.prototype.scrollToTop=function(){this.scrollLines(-this._bufferService.buffer.ydisp)},t.prototype.scrollToBottom=function(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)},t.prototype.scrollToLine=function(e){var t=e-this._bufferService.buffer.ydisp;0!==t&&this.scrollLines(t)},t.prototype.addEscHandler=function(e,t){return this._inputHandler.addEscHandler(e,t)},t.prototype.addDcsHandler=function(e,t){return this._inputHandler.addDcsHandler(e,t)},t.prototype.addCsiHandler=function(e,t){return this._inputHandler.addCsiHandler(e,t)},t.prototype.addOscHandler=function(e,t){return this._inputHandler.addOscHandler(e,t)},t.prototype._setup=function(){this.optionsService.options.windowsMode&&this._enableWindowsMode()},t.prototype.reset=function(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this._coreService.reset(),this._coreMouseService.reset()},t.prototype._updateOptions=function(e){var t;switch(e){case"scrollback":this.buffers.resize(this.cols,this.rows);break;case"windowsMode":this.optionsService.options.windowsMode?this._enableWindowsMode():(null===(t=this._windowsMode)||void 0===t||t.dispose(),this._windowsMode=void 0)}},t.prototype._enableWindowsMode=function(){var e=this;if(!this._windowsMode){var t=[];t.push(this.onLineFeed(v.updateWindowsModeWrappedState.bind(null,this._bufferService))),t.push(this.addCsiHandler({final:"H"},function(){return v.updateWindowsModeWrappedState(e._bufferService),!1})),this._windowsMode={dispose:function(){for(var e=0,n=t;e24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}!function(e){e[e.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",e[e.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"}(o=t.WindowsOptionsReportType||(t.WindowsOptionsReportType={}));var k=function(){function e(e,t,n,r){this._bufferService=e,this._coreService=t,this._logService=n,this._optionsService=r,this._data=new Uint32Array(0)}return e.prototype.hook=function(e){this._data=new Uint32Array(0)},e.prototype.put=function(e,t,n){this._data=u.concat(this._data,e.subarray(t,n))},e.prototype.unhook=function(e){if(!e)return this._data=new Uint32Array(0),!0;var t=h.utf32ToString(this._data);switch(this._data=new Uint32Array(0),t){case'"q':this._coreService.triggerDataEvent(a.C0.ESC+'P1$r0"q'+a.C0.ESC+"\\");break;case'"p':this._coreService.triggerDataEvent(a.C0.ESC+'P1$r61;1"p'+a.C0.ESC+"\\");break;case"r":this._coreService.triggerDataEvent(a.C0.ESC+"P1$r"+(this._bufferService.buffer.scrollTop+1)+";"+(this._bufferService.buffer.scrollBottom+1)+"r"+a.C0.ESC+"\\");break;case"m":this._coreService.triggerDataEvent(a.C0.ESC+"P1$r0m"+a.C0.ESC+"\\");break;case" q":var n={block:2,underline:4,bar:6}[this._optionsService.options.cursorStyle];this._coreService.triggerDataEvent(a.C0.ESC+"P1$r"+(n-=this._optionsService.options.cursorBlink?1:0)+" q"+a.C0.ESC+"\\");break;default:this._logService.debug("Unknown DCS $q %s",t),this._coreService.triggerDataEvent(a.C0.ESC+"P0$r"+a.C0.ESC+"\\")}return!0},e}(),C=function(e){function t(t,n,r,i,o,l,u,p,g){void 0===g&&(g=new c.EscapeSequenceParser);var b=e.call(this)||this;b._bufferService=t,b._charsetService=n,b._coreService=r,b._dirtyRowService=i,b._logService=o,b._optionsService=l,b._coreMouseService=u,b._unicodeService=p,b._parser=g,b._parseBuffer=new Uint32Array(4096),b._stringDecoder=new h.StringToUtf32,b._utf8Decoder=new h.Utf8ToUtf32,b._workCell=new m.CellData,b._windowTitle="",b._iconName="",b._windowTitleStack=[],b._iconNameStack=[],b._curAttrData=d.DEFAULT_ATTR_DATA.clone(),b._eraseAttrDataInternal=d.DEFAULT_ATTR_DATA.clone(),b._onRequestBell=new f.EventEmitter,b._onRequestRefreshRows=new f.EventEmitter,b._onRequestReset=new f.EventEmitter,b._onRequestScroll=new f.EventEmitter,b._onRequestSyncScrollBar=new f.EventEmitter,b._onRequestWindowsOptionsReport=new f.EventEmitter,b._onA11yChar=new f.EventEmitter,b._onA11yTab=new f.EventEmitter,b._onCursorMove=new f.EventEmitter,b._onLineFeed=new f.EventEmitter,b._onScroll=new f.EventEmitter,b._onTitleChange=new f.EventEmitter,b._onAnsiColorChange=new f.EventEmitter,b.register(b._parser),b._parser.setCsiHandlerFallback(function(e,t){b._logService.debug("Unknown CSI code: ",{identifier:b._parser.identToString(e),params:t.toArray()})}),b._parser.setEscHandlerFallback(function(e){b._logService.debug("Unknown ESC code: ",{identifier:b._parser.identToString(e)})}),b._parser.setExecuteHandlerFallback(function(e){b._logService.debug("Unknown EXECUTE code: ",{code:e})}),b._parser.setOscHandlerFallback(function(e,t,n){b._logService.debug("Unknown OSC code: ",{identifier:e,action:t,data:n})}),b._parser.setDcsHandlerFallback(function(e,t,n){"HOOK"===t&&(n=n.toArray()),b._logService.debug("Unknown DCS code: ",{identifier:b._parser.identToString(e),action:t,payload:n})}),b._parser.setPrintHandler(function(e,t,n){return b.print(e,t,n)}),b._parser.registerCsiHandler({final:"@"},function(e){return b.insertChars(e)}),b._parser.registerCsiHandler({intermediates:" ",final:"@"},function(e){return b.scrollLeft(e)}),b._parser.registerCsiHandler({final:"A"},function(e){return b.cursorUp(e)}),b._parser.registerCsiHandler({intermediates:" ",final:"A"},function(e){return b.scrollRight(e)}),b._parser.registerCsiHandler({final:"B"},function(e){return b.cursorDown(e)}),b._parser.registerCsiHandler({final:"C"},function(e){return b.cursorForward(e)}),b._parser.registerCsiHandler({final:"D"},function(e){return b.cursorBackward(e)}),b._parser.registerCsiHandler({final:"E"},function(e){return b.cursorNextLine(e)}),b._parser.registerCsiHandler({final:"F"},function(e){return b.cursorPrecedingLine(e)}),b._parser.registerCsiHandler({final:"G"},function(e){return b.cursorCharAbsolute(e)}),b._parser.registerCsiHandler({final:"H"},function(e){return b.cursorPosition(e)}),b._parser.registerCsiHandler({final:"I"},function(e){return b.cursorForwardTab(e)}),b._parser.registerCsiHandler({final:"J"},function(e){return b.eraseInDisplay(e)}),b._parser.registerCsiHandler({prefix:"?",final:"J"},function(e){return b.eraseInDisplay(e)}),b._parser.registerCsiHandler({final:"K"},function(e){return b.eraseInLine(e)}),b._parser.registerCsiHandler({prefix:"?",final:"K"},function(e){return b.eraseInLine(e)}),b._parser.registerCsiHandler({final:"L"},function(e){return b.insertLines(e)}),b._parser.registerCsiHandler({final:"M"},function(e){return b.deleteLines(e)}),b._parser.registerCsiHandler({final:"P"},function(e){return b.deleteChars(e)}),b._parser.registerCsiHandler({final:"S"},function(e){return b.scrollUp(e)}),b._parser.registerCsiHandler({final:"T"},function(e){return b.scrollDown(e)}),b._parser.registerCsiHandler({final:"X"},function(e){return b.eraseChars(e)}),b._parser.registerCsiHandler({final:"Z"},function(e){return b.cursorBackwardTab(e)}),b._parser.registerCsiHandler({final:"`"},function(e){return b.charPosAbsolute(e)}),b._parser.registerCsiHandler({final:"a"},function(e){return b.hPositionRelative(e)}),b._parser.registerCsiHandler({final:"b"},function(e){return b.repeatPrecedingCharacter(e)}),b._parser.registerCsiHandler({final:"c"},function(e){return b.sendDeviceAttributesPrimary(e)}),b._parser.registerCsiHandler({prefix:">",final:"c"},function(e){return b.sendDeviceAttributesSecondary(e)}),b._parser.registerCsiHandler({final:"d"},function(e){return b.linePosAbsolute(e)}),b._parser.registerCsiHandler({final:"e"},function(e){return b.vPositionRelative(e)}),b._parser.registerCsiHandler({final:"f"},function(e){return b.hVPosition(e)}),b._parser.registerCsiHandler({final:"g"},function(e){return b.tabClear(e)}),b._parser.registerCsiHandler({final:"h"},function(e){return b.setMode(e)}),b._parser.registerCsiHandler({prefix:"?",final:"h"},function(e){return b.setModePrivate(e)}),b._parser.registerCsiHandler({final:"l"},function(e){return b.resetMode(e)}),b._parser.registerCsiHandler({prefix:"?",final:"l"},function(e){return b.resetModePrivate(e)}),b._parser.registerCsiHandler({final:"m"},function(e){return b.charAttributes(e)}),b._parser.registerCsiHandler({final:"n"},function(e){return b.deviceStatus(e)}),b._parser.registerCsiHandler({prefix:"?",final:"n"},function(e){return b.deviceStatusPrivate(e)}),b._parser.registerCsiHandler({intermediates:"!",final:"p"},function(e){return b.softReset(e)}),b._parser.registerCsiHandler({intermediates:" ",final:"q"},function(e){return b.setCursorStyle(e)}),b._parser.registerCsiHandler({final:"r"},function(e){return b.setScrollRegion(e)}),b._parser.registerCsiHandler({final:"s"},function(e){return b.saveCursor(e)}),b._parser.registerCsiHandler({final:"t"},function(e){return b.windowOptions(e)}),b._parser.registerCsiHandler({final:"u"},function(e){return b.restoreCursor(e)}),b._parser.registerCsiHandler({intermediates:"'",final:"}"},function(e){return b.insertColumns(e)}),b._parser.registerCsiHandler({intermediates:"'",final:"~"},function(e){return b.deleteColumns(e)}),b._parser.setExecuteHandler(a.C0.BEL,function(){return b.bell()}),b._parser.setExecuteHandler(a.C0.LF,function(){return b.lineFeed()}),b._parser.setExecuteHandler(a.C0.VT,function(){return b.lineFeed()}),b._parser.setExecuteHandler(a.C0.FF,function(){return b.lineFeed()}),b._parser.setExecuteHandler(a.C0.CR,function(){return b.carriageReturn()}),b._parser.setExecuteHandler(a.C0.BS,function(){return b.backspace()}),b._parser.setExecuteHandler(a.C0.HT,function(){return b.tab()}),b._parser.setExecuteHandler(a.C0.SO,function(){return b.shiftOut()}),b._parser.setExecuteHandler(a.C0.SI,function(){return b.shiftIn()}),b._parser.setExecuteHandler(a.C1.IND,function(){return b.index()}),b._parser.setExecuteHandler(a.C1.NEL,function(){return b.nextLine()}),b._parser.setExecuteHandler(a.C1.HTS,function(){return b.tabSet()}),b._parser.registerOscHandler(0,new v.OscHandler(function(e){return b.setTitle(e),b.setIconName(e),!0})),b._parser.registerOscHandler(1,new v.OscHandler(function(e){return b.setIconName(e)})),b._parser.registerOscHandler(2,new v.OscHandler(function(e){return b.setTitle(e)})),b._parser.registerOscHandler(4,new v.OscHandler(function(e){return b.setAnsiColor(e)})),b._parser.registerEscHandler({final:"7"},function(){return b.saveCursor()}),b._parser.registerEscHandler({final:"8"},function(){return b.restoreCursor()}),b._parser.registerEscHandler({final:"D"},function(){return b.index()}),b._parser.registerEscHandler({final:"E"},function(){return b.nextLine()}),b._parser.registerEscHandler({final:"H"},function(){return b.tabSet()}),b._parser.registerEscHandler({final:"M"},function(){return b.reverseIndex()}),b._parser.registerEscHandler({final:"="},function(){return b.keypadApplicationMode()}),b._parser.registerEscHandler({final:">"},function(){return b.keypadNumericMode()}),b._parser.registerEscHandler({final:"c"},function(){return b.fullReset()}),b._parser.registerEscHandler({final:"n"},function(){return b.setgLevel(2)}),b._parser.registerEscHandler({final:"o"},function(){return b.setgLevel(3)}),b._parser.registerEscHandler({final:"|"},function(){return b.setgLevel(3)}),b._parser.registerEscHandler({final:"}"},function(){return b.setgLevel(2)}),b._parser.registerEscHandler({final:"~"},function(){return b.setgLevel(1)}),b._parser.registerEscHandler({intermediates:"%",final:"@"},function(){return b.selectDefaultCharset()}),b._parser.registerEscHandler({intermediates:"%",final:"G"},function(){return b.selectDefaultCharset()});var y=function(e){_._parser.registerEscHandler({intermediates:"(",final:e},function(){return b.selectCharset("("+e)}),_._parser.registerEscHandler({intermediates:")",final:e},function(){return b.selectCharset(")"+e)}),_._parser.registerEscHandler({intermediates:"*",final:e},function(){return b.selectCharset("*"+e)}),_._parser.registerEscHandler({intermediates:"+",final:e},function(){return b.selectCharset("+"+e)}),_._parser.registerEscHandler({intermediates:"-",final:e},function(){return b.selectCharset("-"+e)}),_._parser.registerEscHandler({intermediates:".",final:e},function(){return b.selectCharset("."+e)}),_._parser.registerEscHandler({intermediates:"/",final:e},function(){return b.selectCharset("/"+e)})},_=this;for(var w in s.CHARSETS)y(w);return b._parser.registerEscHandler({intermediates:"#",final:"8"},function(){return b.screenAlignmentPattern()}),b._parser.setErrorHandler(function(e){return b._logService.error("Parsing error: ",e),e}),b._parser.registerDcsHandler({intermediates:"$",final:"q"},new k(b._bufferService,b._coreService,b._logService,b._optionsService)),b}return i(t,e),Object.defineProperty(t.prototype,"onRequestBell",{get:function(){return this._onRequestBell.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRequestRefreshRows",{get:function(){return this._onRequestRefreshRows.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRequestReset",{get:function(){return this._onRequestReset.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRequestScroll",{get:function(){return this._onRequestScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRequestSyncScrollBar",{get:function(){return this._onRequestSyncScrollBar.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRequestWindowsOptionsReport",{get:function(){return this._onRequestWindowsOptionsReport.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onA11yChar",{get:function(){return this._onA11yChar.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onA11yTab",{get:function(){return this._onA11yTab.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onTitleChange",{get:function(){return this._onTitleChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onAnsiColorChange",{get:function(){return this._onAnsiColorChange.event},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype.parse=function(e){var t=this._bufferService.buffer,n=t.x,r=t.y;if(this._logService.debug("parsing data",e),this._parseBuffer.length_)for(var i=0;i0&&2===f.getWidth(o.x-1)&&f.setCellFromCodePoint(o.x-1,0,1,d.fg,d.bg,d.extended);for(var m=t;m=c)if(l){for(;o.x=this._bufferService.rows&&(o.y=this._bufferService.rows-1),o.lines.get(o.ybase+o.y).isWrapped=!0),f=o.lines.get(o.ybase+o.y)}else if(o.x=c-1,2===i)continue;if(u&&(f.insertCells(o.x,i,o.getNullCell(d),d),2===f.getWidth(c-1)&&f.setCellFromCodePoint(c-1,p.NULL_CELL_CODE,p.NULL_CELL_WIDTH,d.fg,d.bg,d.extended)),f.setCellFromCodePoint(o.x++,r,i,d.fg,d.bg,d.extended),i>0)for(;--i;)f.setCellFromCodePoint(o.x++,0,0,d.fg,d.bg,d.extended)}else f.getWidth(o.x-1)?f.addCodepointToCell(o.x-1,r):f.addCodepointToCell(o.x-2,r)}n-t>0&&(f.loadCell(o.x-1,this._workCell),this._parser.precedingCodepoint=2===this._workCell.getWidth()||this._workCell.getCode()>65535?0:this._workCell.isCombined()?this._workCell.getChars().charCodeAt(0):this._workCell.content),o.x0&&0===f.getWidth(o.x)&&!f.hasContent(o.x)&&f.setCellFromCodePoint(o.x,0,1,d.fg,d.bg,d.extended),this._dirtyRowService.markDirty(o.y)},t.prototype.addCsiHandler=function(e,t){var n=this;return this._parser.registerCsiHandler(e,"t"!==e.final||e.prefix||e.intermediates?t:function(e){return!w(e.params[0],n._optionsService.options.windowOptions)||t(e)})},t.prototype.addDcsHandler=function(e,t){return this._parser.registerDcsHandler(e,new b.DcsHandler(t))},t.prototype.addEscHandler=function(e,t){return this._parser.registerEscHandler(e,t)},t.prototype.addOscHandler=function(e,t){return this._parser.registerOscHandler(e,new v.OscHandler(t))},t.prototype.bell=function(){return this._onRequestBell.fire(),!0},t.prototype.lineFeed=function(){var e=this._bufferService.buffer;return this._dirtyRowService.markDirty(e.y),this._optionsService.options.convertEol&&(e.x=0),e.y++,e.y===e.scrollBottom+1?(e.y--,this._onRequestScroll.fire(this._eraseAttrData())):e.y>=this._bufferService.rows&&(e.y=this._bufferService.rows-1),e.x>=this._bufferService.cols&&e.x--,this._dirtyRowService.markDirty(e.y),this._onLineFeed.fire(),!0},t.prototype.carriageReturn=function(){return this._bufferService.buffer.x=0,!0},t.prototype.backspace=function(){var e,t=this._bufferService.buffer;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),t.x>0&&t.x--,!0;if(this._restrictCursor(this._bufferService.cols),t.x>0)t.x--;else if(0===t.x&&t.y>t.scrollTop&&t.y<=t.scrollBottom&&(null===(e=t.lines.get(t.ybase+t.y))||void 0===e?void 0:e.isWrapped)){t.lines.get(t.ybase+t.y).isWrapped=!1,t.y--,t.x=this._bufferService.cols-1;var n=t.lines.get(t.ybase+t.y);n.hasWidth(t.x)&&!n.hasContent(t.x)&&t.x--}return this._restrictCursor(),!0},t.prototype.tab=function(){if(this._bufferService.buffer.x>=this._bufferService.cols)return!0;var e=this._bufferService.buffer.x;return this._bufferService.buffer.x=this._bufferService.buffer.nextStop(),this._optionsService.options.screenReaderMode&&this._onA11yTab.fire(this._bufferService.buffer.x-e),!0},t.prototype.shiftOut=function(){return this._charsetService.setgLevel(1),!0},t.prototype.shiftIn=function(){return this._charsetService.setgLevel(0),!0},t.prototype._restrictCursor=function(e){void 0===e&&(e=this._bufferService.cols-1),this._bufferService.buffer.x=Math.min(e,Math.max(0,this._bufferService.buffer.x)),this._bufferService.buffer.y=this._coreService.decPrivateModes.origin?Math.min(this._bufferService.buffer.scrollBottom,Math.max(this._bufferService.buffer.scrollTop,this._bufferService.buffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._bufferService.buffer.y)),this._dirtyRowService.markDirty(this._bufferService.buffer.y)},t.prototype._setCursor=function(e,t){this._dirtyRowService.markDirty(this._bufferService.buffer.y),this._coreService.decPrivateModes.origin?(this._bufferService.buffer.x=e,this._bufferService.buffer.y=this._bufferService.buffer.scrollTop+t):(this._bufferService.buffer.x=e,this._bufferService.buffer.y=t),this._restrictCursor(),this._dirtyRowService.markDirty(this._bufferService.buffer.y)},t.prototype._moveCursor=function(e,t){this._restrictCursor(),this._setCursor(this._bufferService.buffer.x+e,this._bufferService.buffer.y+t)},t.prototype.cursorUp=function(e){var t=this._bufferService.buffer.y-this._bufferService.buffer.scrollTop;return this._moveCursor(0,t>=0?-Math.min(t,e.params[0]||1):-(e.params[0]||1)),!0},t.prototype.cursorDown=function(e){var t=this._bufferService.buffer.scrollBottom-this._bufferService.buffer.y;return this._moveCursor(0,t>=0?Math.min(t,e.params[0]||1):e.params[0]||1),!0},t.prototype.cursorForward=function(e){return this._moveCursor(e.params[0]||1,0),!0},t.prototype.cursorBackward=function(e){return this._moveCursor(-(e.params[0]||1),0),!0},t.prototype.cursorNextLine=function(e){return this.cursorDown(e),this._bufferService.buffer.x=0,!0},t.prototype.cursorPrecedingLine=function(e){return this.cursorUp(e),this._bufferService.buffer.x=0,!0},t.prototype.cursorCharAbsolute=function(e){return this._setCursor((e.params[0]||1)-1,this._bufferService.buffer.y),!0},t.prototype.cursorPosition=function(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0},t.prototype.charPosAbsolute=function(e){return this._setCursor((e.params[0]||1)-1,this._bufferService.buffer.y),!0},t.prototype.hPositionRelative=function(e){return this._moveCursor(e.params[0]||1,0),!0},t.prototype.linePosAbsolute=function(e){return this._setCursor(this._bufferService.buffer.x,(e.params[0]||1)-1),!0},t.prototype.vPositionRelative=function(e){return this._moveCursor(0,e.params[0]||1),!0},t.prototype.hVPosition=function(e){return this.cursorPosition(e),!0},t.prototype.tabClear=function(e){var t=e.params[0];return 0===t?delete this._bufferService.buffer.tabs[this._bufferService.buffer.x]:3===t&&(this._bufferService.buffer.tabs={}),!0},t.prototype.cursorForwardTab=function(e){if(this._bufferService.buffer.x>=this._bufferService.cols)return!0;for(var t=e.params[0]||1;t--;)this._bufferService.buffer.x=this._bufferService.buffer.nextStop();return!0},t.prototype.cursorBackwardTab=function(e){if(this._bufferService.buffer.x>=this._bufferService.cols)return!0;for(var t=e.params[0]||1,n=this._bufferService.buffer;t--;)n.x=n.prevStop();return!0},t.prototype._eraseInBufferLine=function(e,t,n,r){void 0===r&&(r=!1);var i=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+e);i.replaceCells(t,n,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),r&&(i.isWrapped=!1)},t.prototype._resetBufferLine=function(e){var t=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+e);t.fill(this._bufferService.buffer.getNullCell(this._eraseAttrData())),t.isWrapped=!1},t.prototype.eraseInDisplay=function(e){var t;switch(this._restrictCursor(),e.params[0]){case 0:for(this._dirtyRowService.markDirty(t=this._bufferService.buffer.y),this._eraseInBufferLine(t++,this._bufferService.buffer.x,this._bufferService.cols,0===this._bufferService.buffer.x);t=this._bufferService.cols&&(this._bufferService.buffer.lines.get(t+1).isWrapped=!1);t--;)this._resetBufferLine(t);this._dirtyRowService.markDirty(0);break;case 2:for(this._dirtyRowService.markDirty((t=this._bufferService.rows)-1);t--;)this._resetBufferLine(t);this._dirtyRowService.markDirty(0);break;case 3:var n=this._bufferService.buffer.lines.length-this._bufferService.rows;n>0&&(this._bufferService.buffer.lines.trimStart(n),this._bufferService.buffer.ybase=Math.max(this._bufferService.buffer.ybase-n,0),this._bufferService.buffer.ydisp=Math.max(this._bufferService.buffer.ydisp-n,0),this._onScroll.fire(0))}return!0},t.prototype.eraseInLine=function(e){switch(this._restrictCursor(),e.params[0]){case 0:this._eraseInBufferLine(this._bufferService.buffer.y,this._bufferService.buffer.x,this._bufferService.cols);break;case 1:this._eraseInBufferLine(this._bufferService.buffer.y,0,this._bufferService.buffer.x+1);break;case 2:this._eraseInBufferLine(this._bufferService.buffer.y,0,this._bufferService.cols)}return this._dirtyRowService.markDirty(this._bufferService.buffer.y),!0},t.prototype.insertLines=function(e){this._restrictCursor();var t=e.params[0]||1,n=this._bufferService.buffer;if(n.y>n.scrollBottom||n.yn.scrollBottom||n.yt.scrollBottom||t.yt.scrollBottom||t.yt.scrollBottom||t.yt.scrollBottom||t.y0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(a.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(a.C0.ESC+"[?6c")),!0},t.prototype.sendDeviceAttributesSecondary=function(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(a.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(a.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(a.C0.ESC+"[>83;40003;0c")),!0},t.prototype._is=function(e){return 0===(this._optionsService.options.termName+"").indexOf(e)},t.prototype.setMode=function(e){for(var t=0;t=2||2===r[1]&&o+i>=5)break;r[1]&&(i=1)}while(++o+t5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,0===e&&(t.fg&=-268435457),t.updateExtended()},t.prototype.charAttributes=function(e){if(1===e.length&&0===e.params[0])return this._curAttrData.fg=d.DEFAULT_ATTR_DATA.fg,this._curAttrData.bg=d.DEFAULT_ATTR_DATA.bg,!0;for(var t,n=e.length,r=this._curAttrData,i=0;i=30&&t<=37?(r.fg&=-50331904,r.fg|=16777216|t-30):t>=40&&t<=47?(r.bg&=-50331904,r.bg|=16777216|t-40):t>=90&&t<=97?(r.fg&=-50331904,r.fg|=16777224|t-90):t>=100&&t<=107?(r.bg&=-50331904,r.bg|=16777224|t-100):0===t?(r.fg=d.DEFAULT_ATTR_DATA.fg,r.bg=d.DEFAULT_ATTR_DATA.bg):1===t?r.fg|=134217728:3===t?r.bg|=67108864:4===t?(r.fg|=268435456,this._processUnderline(e.hasSubParams(i)?e.getSubParams(i)[0]:1,r)):5===t?r.fg|=536870912:7===t?r.fg|=67108864:8===t?r.fg|=1073741824:2===t?r.bg|=134217728:21===t?this._processUnderline(2,r):22===t?(r.fg&=-134217729,r.bg&=-134217729):23===t?r.bg&=-67108865:24===t?r.fg&=-268435457:25===t?r.fg&=-536870913:27===t?r.fg&=-67108865:28===t?r.fg&=-1073741825:39===t?(r.fg&=-67108864,r.fg|=16777215&d.DEFAULT_ATTR_DATA.fg):49===t?(r.bg&=-67108864,r.bg|=16777215&d.DEFAULT_ATTR_DATA.bg):38===t||48===t||58===t?i+=this._extractColor(e,i,r):59===t?(r.extended=r.extended.clone(),r.extended.underlineColor=-1,r.updateExtended()):100===t?(r.fg&=-67108864,r.fg|=16777215&d.DEFAULT_ATTR_DATA.fg,r.bg&=-67108864,r.bg|=16777215&d.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",t);return!0},t.prototype.deviceStatus=function(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(a.C0.ESC+"[0n");break;case 6:this._coreService.triggerDataEvent(a.C0.ESC+"["+(this._bufferService.buffer.y+1)+";"+(this._bufferService.buffer.x+1)+"R")}return!0},t.prototype.deviceStatusPrivate=function(e){switch(e.params[0]){case 6:this._coreService.triggerDataEvent(a.C0.ESC+"[?"+(this._bufferService.buffer.y+1)+";"+(this._bufferService.buffer.x+1)+"R")}return!0},t.prototype.softReset=function(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._bufferService.buffer.scrollTop=0,this._bufferService.buffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=d.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._bufferService.buffer.savedX=0,this._bufferService.buffer.savedY=this._bufferService.buffer.ybase,this._bufferService.buffer.savedCurAttrData.fg=this._curAttrData.fg,this._bufferService.buffer.savedCurAttrData.bg=this._curAttrData.bg,this._bufferService.buffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0},t.prototype.setCursorStyle=function(e){var t=e.params[0]||1;switch(t){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}return this._optionsService.options.cursorBlink=t%2==1,!0},t.prototype.setScrollRegion=function(e){var t,n=e.params[0]||1;return(e.length<2||(t=e.params[1])>this._bufferService.rows||0===t)&&(t=this._bufferService.rows),t>n&&(this._bufferService.buffer.scrollTop=n-1,this._bufferService.buffer.scrollBottom=t-1,this._setCursor(0,0)),!0},t.prototype.windowOptions=function(e){if(!w(e.params[0],this._optionsService.options.windowOptions))return!0;var t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:2!==t&&this._onRequestWindowsOptionsReport.fire(o.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(o.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(a.C0.ESC+"[8;"+this._bufferService.rows+";"+this._bufferService.cols+"t");break;case 22:0!==t&&2!==t||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),0!==t&&1!==t||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:0!==t&&2!==t||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),0!==t&&1!==t||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0},t.prototype.saveCursor=function(e){return this._bufferService.buffer.savedX=this._bufferService.buffer.x,this._bufferService.buffer.savedY=this._bufferService.buffer.ybase+this._bufferService.buffer.y,this._bufferService.buffer.savedCurAttrData.fg=this._curAttrData.fg,this._bufferService.buffer.savedCurAttrData.bg=this._curAttrData.bg,this._bufferService.buffer.savedCharset=this._charsetService.charset,!0},t.prototype.restoreCursor=function(e){return this._bufferService.buffer.x=this._bufferService.buffer.savedX||0,this._bufferService.buffer.y=Math.max(this._bufferService.buffer.savedY-this._bufferService.buffer.ybase,0),this._curAttrData.fg=this._bufferService.buffer.savedCurAttrData.fg,this._curAttrData.bg=this._bufferService.buffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._bufferService.buffer.savedCharset&&(this._charsetService.charset=this._bufferService.buffer.savedCharset),this._restrictCursor(),!0},t.prototype.setTitle=function(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0},t.prototype.setIconName=function(e){return this._iconName=e,!0},t.prototype._parseAnsiColorChange=function(e){for(var t,n={colors:[]},r=/(\d+);rgb:([0-9a-f]{2})\/([0-9a-f]{2})\/([0-9a-f]{2})/gi;null!==(t=r.exec(e));)n.colors.push({colorIndex:parseInt(t[1]),red:parseInt(t[2],16),green:parseInt(t[3],16),blue:parseInt(t[4],16)});return 0===n.colors.length?null:n},t.prototype.setAnsiColor=function(e){var t=this._parseAnsiColorChange(e);return t?this._onAnsiColorChange.fire(t):this._logService.warn("Expected format ;rgb:// but got data: "+e),!0},t.prototype.nextLine=function(){return this._bufferService.buffer.x=0,this.index(),!0},t.prototype.keypadApplicationMode=function(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0},t.prototype.keypadNumericMode=function(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0},t.prototype.selectDefaultCharset=function(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,s.DEFAULT_CHARSET),!0},t.prototype.selectCharset=function(e){return 2!==e.length?(this.selectDefaultCharset(),!0):("/"===e[0]||this._charsetService.setgCharset(y[e[0]],s.CHARSETS[e[1]]||s.DEFAULT_CHARSET),!0)},t.prototype.index=function(){this._restrictCursor();var e=this._bufferService.buffer;return this._bufferService.buffer.y++,e.y===e.scrollBottom+1?(e.y--,this._onRequestScroll.fire(this._eraseAttrData())):e.y>=this._bufferService.rows&&(e.y=this._bufferService.rows-1),this._restrictCursor(),!0},t.prototype.tabSet=function(){return this._bufferService.buffer.tabs[this._bufferService.buffer.x]=!0,!0},t.prototype.reverseIndex=function(){this._restrictCursor();var e=this._bufferService.buffer;return e.y===e.scrollTop?(e.lines.shiftElements(e.ybase+e.y,e.scrollBottom-e.scrollTop,1),e.lines.set(e.ybase+e.y,e.getBlankLine(this._eraseAttrData())),this._dirtyRowService.markRangeDirty(e.scrollTop,e.scrollBottom)):(e.y--,this._restrictCursor()),!0},t.prototype.fullReset=function(){return this._parser.reset(),this._onRequestReset.fire(),!0},t.prototype.reset=function(){this._curAttrData=d.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=d.DEFAULT_ATTR_DATA.clone()},t.prototype._eraseAttrData=function(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal},t.prototype.setgLevel=function(e){return this._charsetService.setgLevel(e),!0},t.prototype.screenAlignmentPattern=function(){var e=new m.CellData;e.content=1<<22|"E".charCodeAt(0),e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg;var t=this._bufferService.buffer;this._setCursor(0,0);for(var n=0;n=0},8273:function(e,t){function n(e,t,n,r){if(void 0===n&&(n=0),void 0===r&&(r=e.length),n>=e.length)return e;r=r>=e.length?e.length:(e.length+r)%e.length;for(var i=n=(e.length+n)%e.length;i>>16&255,e>>>8&255,255&e]},e.fromColorRGB=function(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]},e.prototype.clone=function(){var t=new e;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t},e.prototype.isInverse=function(){return 67108864&this.fg},e.prototype.isBold=function(){return 134217728&this.fg},e.prototype.isUnderline=function(){return 268435456&this.fg},e.prototype.isBlink=function(){return 536870912&this.fg},e.prototype.isInvisible=function(){return 1073741824&this.fg},e.prototype.isItalic=function(){return 67108864&this.bg},e.prototype.isDim=function(){return 134217728&this.bg},e.prototype.getFgColorMode=function(){return 50331648&this.fg},e.prototype.getBgColorMode=function(){return 50331648&this.bg},e.prototype.isFgRGB=function(){return 50331648==(50331648&this.fg)},e.prototype.isBgRGB=function(){return 50331648==(50331648&this.bg)},e.prototype.isFgPalette=function(){return 16777216==(50331648&this.fg)||33554432==(50331648&this.fg)},e.prototype.isBgPalette=function(){return 16777216==(50331648&this.bg)||33554432==(50331648&this.bg)},e.prototype.isFgDefault=function(){return 0==(50331648&this.fg)},e.prototype.isBgDefault=function(){return 0==(50331648&this.bg)},e.prototype.isAttributeDefault=function(){return 0===this.fg&&0===this.bg},e.prototype.getFgColor=function(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}},e.prototype.getBgColor=function(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}},e.prototype.hasExtendedAttrs=function(){return 268435456&this.bg},e.prototype.updateExtended=function(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456},e.prototype.getUnderlineColor=function(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()},e.prototype.getUnderlineColorMode=function(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()},e.prototype.isUnderlineColorRGB=function(){return 268435456&this.bg&&~this.extended.underlineColor?50331648==(50331648&this.extended.underlineColor):this.isFgRGB()},e.prototype.isUnderlineColorPalette=function(){return 268435456&this.bg&&~this.extended.underlineColor?16777216==(50331648&this.extended.underlineColor)||33554432==(50331648&this.extended.underlineColor):this.isFgPalette()},e.prototype.isUnderlineColorDefault=function(){return 268435456&this.bg&&~this.extended.underlineColor?0==(50331648&this.extended.underlineColor):this.isFgDefault()},e.prototype.getUnderlineStyle=function(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0},e}();t.AttributeData=n;var r=function(){function e(e,t){void 0===e&&(e=0),void 0===t&&(t=-1),this.underlineStyle=e,this.underlineColor=t}return e.prototype.clone=function(){return new e(this.underlineStyle,this.underlineColor)},e.prototype.isEmpty=function(){return 0===this.underlineStyle},e}();t.ExtendedAttrs=r},9092:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.BufferStringIterator=t.Buffer=t.MAX_BUFFER_SIZE=void 0;var r=n(6349),i=n(8437),o=n(511),a=n(643),s=n(4634),c=n(4863),l=n(7116),u=n(3734);t.MAX_BUFFER_SIZE=4294967295;var h=function(){function e(e,t,n){this._hasScrollback=e,this._optionsService=t,this._bufferService=n,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.savedY=0,this.savedX=0,this.savedCurAttrData=i.DEFAULT_ATTR_DATA.clone(),this.savedCharset=l.DEFAULT_CHARSET,this.markers=[],this._nullCell=o.CellData.fromCharData([0,a.NULL_CELL_CHAR,a.NULL_CELL_WIDTH,a.NULL_CELL_CODE]),this._whitespaceCell=o.CellData.fromCharData([0,a.WHITESPACE_CELL_CHAR,a.WHITESPACE_CELL_WIDTH,a.WHITESPACE_CELL_CODE]),this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new r.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}return e.prototype.getNullCell=function(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new u.ExtendedAttrs),this._nullCell},e.prototype.getWhitespaceCell=function(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new u.ExtendedAttrs),this._whitespaceCell},e.prototype.getBlankLine=function(e,t){return new i.BufferLine(this._bufferService.cols,this.getNullCell(e),t)},Object.defineProperty(e.prototype,"hasScrollback",{get:function(){return this._hasScrollback&&this.lines.maxLength>this._rows},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isCursorInViewport",{get:function(){var e=this.ybase+this.y-this.ydisp;return e>=0&&et.MAX_BUFFER_SIZE?t.MAX_BUFFER_SIZE:n},e.prototype.fillViewportRows=function(e){if(0===this.lines.length){void 0===e&&(e=i.DEFAULT_ATTR_DATA);for(var t=this._rows;t--;)this.lines.push(this.getBlankLine(e))}},e.prototype.clear=function(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new r.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()},e.prototype.resize=function(e,t){var n=this.getNullCell(i.DEFAULT_ATTR_DATA),r=this._getCorrectBufferLength(t);if(r>this.lines.maxLength&&(this.lines.maxLength=r),this.lines.length>0){if(this._cols0&&this.lines.length<=this.ybase+this.y+a+1?(this.ybase--,a++,this.ydisp>0&&this.ydisp--):this.lines.push(new i.BufferLine(e,n)));else for(s=this._rows;s>t;s--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(r0&&(this.lines.trimStart(c),this.ybase=Math.max(this.ybase-c,0),this.ydisp=Math.max(this.ydisp-c,0),this.savedY=Math.max(this.savedY-c,0)),this.lines.maxLength=r}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),a&&(this.y+=a),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(o=0;othis._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))},e.prototype._reflowLarger=function(e,t){var n=s.reflowLargerGetLinesToRemove(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(i.DEFAULT_ATTR_DATA));if(n.length>0){var r=s.reflowLargerCreateNewLayout(this.lines,n);s.reflowLargerApplyNewLayout(this.lines,r.layout),this._reflowLargerAdjustViewport(e,t,r.countRemoved)}},e.prototype._reflowLargerAdjustViewport=function(e,t,n){for(var r=this.getNullCell(i.DEFAULT_ATTR_DATA),o=n;o-- >0;)0===this.ybase?(this.y>0&&this.y--,this.lines.length=0;a--){var c=this.lines.get(a);if(!(!c||!c.isWrapped&&c.getTrimmedLength()<=e)){for(var l=[c];c.isWrapped&&a>0;)c=this.lines.get(--a),l.unshift(c);var u=this.ybase+this.y;if(!(u>=a&&u0&&(r.push({start:a+l.length+o,newLines:m}),o+=m.length),l.push.apply(l,m);var b=f.length-1,y=f[b];0===y&&(y=f[--b]);for(var _=l.length-p-1,w=d;_>=0;){var k=Math.min(w,y);if(l[b].copyCellsFrom(l[_],w-k,y-k,k,!0),0==(y-=k)&&(y=f[--b]),0==(w-=k)){_--;var C=Math.max(_,0);w=s.getWrappedLineTrimmedLength(l,C,this._cols)}}for(g=0;g0;)0===this.ybase?this.y0){var x=[],O=[];for(g=0;g=0;g--)if(P&&P.start>T+j){for(var I=P.newLines.length-1;I>=0;I--)this.lines.set(g--,P.newLines[I]);g++,x.push({index:T+1,amount:P.newLines.length}),j+=P.newLines.length,P=r[++E]}else this.lines.set(g,O[T--]);var A=0;for(g=x.length-1;g>=0;g--)x[g].index+=A,this.lines.onInsertEmitter.fire(x[g]),A+=x[g].amount;var D=Math.max(0,M+o-this.lines.maxLength);D>0&&this.lines.onTrimEmitter.fire(D)}},e.prototype.stringIndexToBufferIndex=function(e,t,n){for(void 0===n&&(n=!1);t;){var r=this.lines.get(e);if(!r)return[-1,-1];for(var i=n?r.getTrimmedLength():r.length,o=0;o0&&this.lines.get(t).isWrapped;)t--;for(;n+10;);return e>=this._cols?this._cols-1:e<0?0:e},e.prototype.nextStop=function(e){for(null==e&&(e=this.x);!this.tabs[++e]&&e=this._cols?this._cols-1:e<0?0:e},e.prototype.addMarker=function(e){var t=this,n=new c.Marker(e);return this.markers.push(n),n.register(this.lines.onTrim(function(e){n.line-=e,n.line<0&&n.dispose()})),n.register(this.lines.onInsert(function(e){n.line>=e.index&&(n.line+=e.amount)})),n.register(this.lines.onDelete(function(e){n.line>=e.index&&n.linee.index&&(n.line-=e.amount)})),n.register(n.onDispose(function(){return t._removeMarker(n)})),n},e.prototype._removeMarker=function(e){this.markers.splice(this.markers.indexOf(e),1)},e.prototype.iterator=function(e,t,n,r,i){return new d(this,e,t,n,r,i)},e}();t.Buffer=h;var d=function(){function e(e,t,n,r,i,o){void 0===n&&(n=0),void 0===r&&(r=e.lines.length),void 0===i&&(i=0),void 0===o&&(o=0),this._buffer=e,this._trimRight=t,this._startIndex=n,this._endIndex=r,this._startOverscan=i,this._endOverscan=o,this._startIndex<0&&(this._startIndex=0),this._endIndex>this._buffer.lines.length&&(this._endIndex=this._buffer.lines.length),this._current=this._startIndex}return e.prototype.hasNext=function(){return this._currentthis._endIndex+this._endOverscan&&(e.last=this._endIndex+this._endOverscan),e.first=Math.max(e.first,0),e.last=Math.min(e.last,this._buffer.lines.length);for(var t="",n=e.first;n<=e.last;++n)t+=this._buffer.translateBufferLineToString(n,this._trimRight);return this._current=e.last+1,{range:e,content:t}},e}();t.BufferStringIterator=d},8437:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.BufferLine=t.DEFAULT_ATTR_DATA=void 0;var r=n(482),i=n(643),o=n(511),a=n(3734);t.DEFAULT_ATTR_DATA=Object.freeze(new a.AttributeData);var s=function(){function e(e,t,n){void 0===n&&(n=!1),this.isWrapped=n,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*e);for(var r=t||o.CellData.fromCharData([0,i.NULL_CELL_CHAR,i.NULL_CELL_WIDTH,i.NULL_CELL_CODE]),a=0;a>22,2097152&t?this._combined[e].charCodeAt(this._combined[e].length-1):n]},e.prototype.set=function(e,t){this._data[3*e+1]=t[i.CHAR_DATA_ATTR_INDEX],t[i.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[e]=t[1],this._data[3*e+0]=2097152|e|t[i.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*e+0]=t[i.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|t[i.CHAR_DATA_WIDTH_INDEX]<<22},e.prototype.getWidth=function(e){return this._data[3*e+0]>>22},e.prototype.hasWidth=function(e){return 12582912&this._data[3*e+0]},e.prototype.getFg=function(e){return this._data[3*e+1]},e.prototype.getBg=function(e){return this._data[3*e+2]},e.prototype.hasContent=function(e){return 4194303&this._data[3*e+0]},e.prototype.getCodePoint=function(e){var t=this._data[3*e+0];return 2097152&t?this._combined[e].charCodeAt(this._combined[e].length-1):2097151&t},e.prototype.isCombined=function(e){return 2097152&this._data[3*e+0]},e.prototype.getString=function(e){var t=this._data[3*e+0];return 2097152&t?this._combined[e]:2097151&t?r.stringFromCodePoint(2097151&t):""},e.prototype.loadCell=function(e,t){var n=3*e;return t.content=this._data[n+0],t.fg=this._data[n+1],t.bg=this._data[n+2],2097152&t.content&&(t.combinedData=this._combined[e]),268435456&t.bg&&(t.extended=this._extendedAttrs[e]),t},e.prototype.setCell=function(e,t){2097152&t.content&&(this._combined[e]=t.combinedData),268435456&t.bg&&(this._extendedAttrs[e]=t.extended),this._data[3*e+0]=t.content,this._data[3*e+1]=t.fg,this._data[3*e+2]=t.bg},e.prototype.setCellFromCodePoint=function(e,t,n,r,i,o){268435456&i&&(this._extendedAttrs[e]=o),this._data[3*e+0]=t|n<<22,this._data[3*e+1]=r,this._data[3*e+2]=i},e.prototype.addCodepointToCell=function(e,t){var n=this._data[3*e+0];2097152&n?this._combined[e]+=r.stringFromCodePoint(t):(2097151&n?(this._combined[e]=r.stringFromCodePoint(2097151&n)+r.stringFromCodePoint(t),n&=-2097152,n|=2097152):n=t|1<<22,this._data[3*e+0]=n)},e.prototype.insertCells=function(e,t,n,r){if((e%=this.length)&&2===this.getWidth(e-1)&&this.setCellFromCodePoint(e-1,0,1,(null==r?void 0:r.fg)||0,(null==r?void 0:r.bg)||0,(null==r?void 0:r.extended)||new a.ExtendedAttrs),t=0;--s)this.setCell(e+t+s,this.loadCell(e+s,i));for(s=0;sthis.length){var n=new Uint32Array(3*e);this.length&&n.set(3*e=e&&delete this._combined[o]}}else this._data=new Uint32Array(0),this._combined={};this.length=e}},e.prototype.fill=function(e){this._combined={},this._extendedAttrs={};for(var t=0;t=0;--e)if(4194303&this._data[3*e+0])return e+(this._data[3*e+0]>>22);return 0},e.prototype.copyCellsFrom=function(e,t,n,r,i){var o=e._data;if(i)for(var a=r-1;a>=0;a--)for(var s=0;s<3;s++)this._data[3*(n+a)+s]=o[3*(t+a)+s];else for(a=0;a=t&&(this._combined[l-t+n]=e._combined[l])}},e.prototype.translateToString=function(e,t,n){void 0===e&&(e=!1),void 0===t&&(t=0),void 0===n&&(n=this.length),e&&(n=Math.min(n,this.getTrimmedLength()));for(var o="";t>22||1}return o},e}();t.BufferLine=s},4634:function(e,t){function n(e,t,n){if(t===e.length-1)return e[t].getTrimmedLength();var r=!e[t].hasContent(n-1)&&1===e[t].getWidth(n-1),i=2===e[t+1].getWidth(0);return r&&i?n-1:n}Object.defineProperty(t,"__esModule",{value:!0}),t.getWrappedLineTrimmedLength=t.reflowSmallerGetNewLineLengths=t.reflowLargerApplyNewLayout=t.reflowLargerCreateNewLayout=t.reflowLargerGetLinesToRemove=void 0,t.reflowLargerGetLinesToRemove=function(e,t,r,i,o){for(var a=[],s=0;s=s&&i0&&(b>h||0===u[b].getTrimmedLength());b--)v++;v>0&&(a.push(s+u.length-v),a.push(v)),s+=u.length-1}}}return a},t.reflowLargerCreateNewLayout=function(e,t){for(var n=[],r=0,i=t[r],o=0,a=0;al&&(a-=l,s++);var u=2===e[s].getWidth(a-1);u&&a--;var h=u?r-1:r;i.push(h),c+=h}return i},t.getWrappedLineTrimmedLength=n},5295:function(e,t,n){var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.BufferSet=void 0;var o=n(9092),a=n(8460),s=function(e){function t(t,n){var r=e.call(this)||this;return r._optionsService=t,r._bufferService=n,r._onBufferActivate=r.register(new a.EventEmitter),r.reset(),r}return i(t,e),Object.defineProperty(t.prototype,"onBufferActivate",{get:function(){return this._onBufferActivate.event},enumerable:!1,configurable:!0}),t.prototype.reset=function(){this._normal=new o.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new o.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this.setupTabStops()},Object.defineProperty(t.prototype,"alt",{get:function(){return this._alt},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"active",{get:function(){return this._activeBuffer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"normal",{get:function(){return this._normal},enumerable:!1,configurable:!0}),t.prototype.activateNormalBuffer=function(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))},t.prototype.activateAltBuffer=function(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))},t.prototype.resize=function(e,t){this._normal.resize(e,t),this._alt.resize(e,t)},t.prototype.setupTabStops=function(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)},t}(n(844).Disposable);t.BufferSet=s},511:function(e,t,n){var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.CellData=void 0;var o=n(482),a=n(643),s=n(3734),c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.content=0,t.fg=0,t.bg=0,t.extended=new s.ExtendedAttrs,t.combinedData="",t}return i(t,e),t.fromCharData=function(e){var n=new t;return n.setFromCharData(e),n},t.prototype.isCombined=function(){return 2097152&this.content},t.prototype.getWidth=function(){return this.content>>22},t.prototype.getChars=function(){return 2097152&this.content?this.combinedData:2097151&this.content?o.stringFromCodePoint(2097151&this.content):""},t.prototype.getCode=function(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content},t.prototype.setFromCharData=function(e){this.fg=e[a.CHAR_DATA_ATTR_INDEX],this.bg=0;var t=!1;if(e[a.CHAR_DATA_CHAR_INDEX].length>2)t=!0;else if(2===e[a.CHAR_DATA_CHAR_INDEX].length){var n=e[a.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=n&&n<=56319){var r=e[a.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=r&&r<=57343?this.content=1024*(n-55296)+r-56320+65536|e[a.CHAR_DATA_WIDTH_INDEX]<<22:t=!0}else t=!0}else this.content=e[a.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|e[a.CHAR_DATA_WIDTH_INDEX]<<22;t&&(this.combinedData=e[a.CHAR_DATA_CHAR_INDEX],this.content=2097152|e[a.CHAR_DATA_WIDTH_INDEX]<<22)},t.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},t}(s.AttributeData);t.CellData=c},643:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.WHITESPACE_CELL_CODE=t.WHITESPACE_CELL_WIDTH=t.WHITESPACE_CELL_CHAR=t.NULL_CELL_CODE=t.NULL_CELL_WIDTH=t.NULL_CELL_CHAR=t.CHAR_DATA_CODE_INDEX=t.CHAR_DATA_WIDTH_INDEX=t.CHAR_DATA_CHAR_INDEX=t.CHAR_DATA_ATTR_INDEX=t.DEFAULT_ATTR=t.DEFAULT_COLOR=void 0,t.DEFAULT_COLOR=256,t.DEFAULT_ATTR=256|t.DEFAULT_COLOR<<9,t.CHAR_DATA_ATTR_INDEX=0,t.CHAR_DATA_CHAR_INDEX=1,t.CHAR_DATA_WIDTH_INDEX=2,t.CHAR_DATA_CODE_INDEX=3,t.NULL_CELL_CHAR="",t.NULL_CELL_WIDTH=1,t.NULL_CELL_CODE=0,t.WHITESPACE_CELL_CHAR=" ",t.WHITESPACE_CELL_WIDTH=1,t.WHITESPACE_CELL_CODE=32},4863:function(e,t,n){var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.Marker=void 0;var o=n(8460),a=function(e){function t(n){var r=e.call(this)||this;return r.line=n,r._id=t._nextId++,r.isDisposed=!1,r._onDispose=new o.EventEmitter,r}return i(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onDispose",{get:function(){return this._onDispose.event},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),e.prototype.dispose.call(this))},t._nextId=1,t}(n(844).Disposable);t.Marker=a},7116:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_CHARSET=t.CHARSETS=void 0,t.CHARSETS={},t.DEFAULT_CHARSET=t.CHARSETS.B,t.CHARSETS[0]={"`":"\u25c6",a:"\u2592",b:"\u2409",c:"\u240c",d:"\u240d",e:"\u240a",f:"\xb0",g:"\xb1",h:"\u2424",i:"\u240b",j:"\u2518",k:"\u2510",l:"\u250c",m:"\u2514",n:"\u253c",o:"\u23ba",p:"\u23bb",q:"\u2500",r:"\u23bc",s:"\u23bd",t:"\u251c",u:"\u2524",v:"\u2534",w:"\u252c",x:"\u2502",y:"\u2264",z:"\u2265","{":"\u03c0","|":"\u2260","}":"\xa3","~":"\xb7"},t.CHARSETS.A={"#":"\xa3"},t.CHARSETS.B=void 0,t.CHARSETS[4]={"#":"\xa3","@":"\xbe","[":"ij","\\":"\xbd","]":"|","{":"\xa8","|":"f","}":"\xbc","~":"\xb4"},t.CHARSETS.C=t.CHARSETS[5]={"[":"\xc4","\\":"\xd6","]":"\xc5","^":"\xdc","`":"\xe9","{":"\xe4","|":"\xf6","}":"\xe5","~":"\xfc"},t.CHARSETS.R={"#":"\xa3","@":"\xe0","[":"\xb0","\\":"\xe7","]":"\xa7","{":"\xe9","|":"\xf9","}":"\xe8","~":"\xa8"},t.CHARSETS.Q={"@":"\xe0","[":"\xe2","\\":"\xe7","]":"\xea","^":"\xee","`":"\xf4","{":"\xe9","|":"\xf9","}":"\xe8","~":"\xfb"},t.CHARSETS.K={"@":"\xa7","[":"\xc4","\\":"\xd6","]":"\xdc","{":"\xe4","|":"\xf6","}":"\xfc","~":"\xdf"},t.CHARSETS.Y={"#":"\xa3","@":"\xa7","[":"\xb0","\\":"\xe7","]":"\xe9","`":"\xf9","{":"\xe0","|":"\xf2","}":"\xe8","~":"\xec"},t.CHARSETS.E=t.CHARSETS[6]={"@":"\xc4","[":"\xc6","\\":"\xd8","]":"\xc5","^":"\xdc","`":"\xe4","{":"\xe6","|":"\xf8","}":"\xe5","~":"\xfc"},t.CHARSETS.Z={"#":"\xa3","@":"\xa7","[":"\xa1","\\":"\xd1","]":"\xbf","{":"\xb0","|":"\xf1","}":"\xe7"},t.CHARSETS.H=t.CHARSETS[7]={"@":"\xc9","[":"\xc4","\\":"\xd6","]":"\xc5","^":"\xdc","`":"\xe9","{":"\xe4","|":"\xf6","}":"\xe5","~":"\xfc"},t.CHARSETS["="]={"#":"\xf9","@":"\xe0","[":"\xe9","\\":"\xe7","]":"\xea","^":"\xee",_:"\xe8","`":"\xf4","{":"\xe4","|":"\xf6","}":"\xfc","~":"\xfb"}},2584:function(e,t){var n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.C1=t.C0=void 0,(r=t.C0||(t.C0={})).NUL="\0",r.SOH="\x01",r.STX="\x02",r.ETX="\x03",r.EOT="\x04",r.ENQ="\x05",r.ACK="\x06",r.BEL="\x07",r.BS="\b",r.HT="\t",r.LF="\n",r.VT="\v",r.FF="\f",r.CR="\r",r.SO="\x0e",r.SI="\x0f",r.DLE="\x10",r.DC1="\x11",r.DC2="\x12",r.DC3="\x13",r.DC4="\x14",r.NAK="\x15",r.SYN="\x16",r.ETB="\x17",r.CAN="\x18",r.EM="\x19",r.SUB="\x1a",r.ESC="\x1b",r.FS="\x1c",r.GS="\x1d",r.RS="\x1e",r.US="\x1f",r.SP=" ",r.DEL="\x7f",(n=t.C1||(t.C1={})).PAD="\x80",n.HOP="\x81",n.BPH="\x82",n.NBH="\x83",n.IND="\x84",n.NEL="\x85",n.SSA="\x86",n.ESA="\x87",n.HTS="\x88",n.HTJ="\x89",n.VTS="\x8a",n.PLD="\x8b",n.PLU="\x8c",n.RI="\x8d",n.SS2="\x8e",n.SS3="\x8f",n.DCS="\x90",n.PU1="\x91",n.PU2="\x92",n.STS="\x93",n.CCH="\x94",n.MW="\x95",n.SPA="\x96",n.EPA="\x97",n.SOS="\x98",n.SGCI="\x99",n.SCI="\x9a",n.CSI="\x9b",n.ST="\x9c",n.OSC="\x9d",n.PM="\x9e",n.APC="\x9f"},7399:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.evaluateKeyboardEvent=void 0;var r=n(2584),i={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};t.evaluateKeyboardEvent=function(e,t,n,o){var a={type:0,cancel:!1,key:void 0},s=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:"UIKeyInputUpArrow"===e.key?a.key=t?r.C0.ESC+"OA":r.C0.ESC+"[A":"UIKeyInputLeftArrow"===e.key?a.key=t?r.C0.ESC+"OD":r.C0.ESC+"[D":"UIKeyInputRightArrow"===e.key?a.key=t?r.C0.ESC+"OC":r.C0.ESC+"[C":"UIKeyInputDownArrow"===e.key&&(a.key=t?r.C0.ESC+"OB":r.C0.ESC+"[B");break;case 8:if(e.shiftKey){a.key=r.C0.BS;break}if(e.altKey){a.key=r.C0.ESC+r.C0.DEL;break}a.key=r.C0.DEL;break;case 9:if(e.shiftKey){a.key=r.C0.ESC+"[Z";break}a.key=r.C0.HT,a.cancel=!0;break;case 13:a.key=e.altKey?r.C0.ESC+r.C0.CR:r.C0.CR,a.cancel=!0;break;case 27:a.key=r.C0.ESC,e.altKey&&(a.key=r.C0.ESC+r.C0.ESC),a.cancel=!0;break;case 37:if(e.metaKey)break;s?(a.key=r.C0.ESC+"[1;"+(s+1)+"D",a.key===r.C0.ESC+"[1;3D"&&(a.key=r.C0.ESC+(n?"b":"[1;5D"))):a.key=t?r.C0.ESC+"OD":r.C0.ESC+"[D";break;case 39:if(e.metaKey)break;s?(a.key=r.C0.ESC+"[1;"+(s+1)+"C",a.key===r.C0.ESC+"[1;3C"&&(a.key=r.C0.ESC+(n?"f":"[1;5C"))):a.key=t?r.C0.ESC+"OC":r.C0.ESC+"[C";break;case 38:if(e.metaKey)break;s?(a.key=r.C0.ESC+"[1;"+(s+1)+"A",n||a.key!==r.C0.ESC+"[1;3A"||(a.key=r.C0.ESC+"[1;5A")):a.key=t?r.C0.ESC+"OA":r.C0.ESC+"[A";break;case 40:if(e.metaKey)break;s?(a.key=r.C0.ESC+"[1;"+(s+1)+"B",n||a.key!==r.C0.ESC+"[1;3B"||(a.key=r.C0.ESC+"[1;5B")):a.key=t?r.C0.ESC+"OB":r.C0.ESC+"[B";break;case 45:e.shiftKey||e.ctrlKey||(a.key=r.C0.ESC+"[2~");break;case 46:a.key=s?r.C0.ESC+"[3;"+(s+1)+"~":r.C0.ESC+"[3~";break;case 36:a.key=s?r.C0.ESC+"[1;"+(s+1)+"H":t?r.C0.ESC+"OH":r.C0.ESC+"[H";break;case 35:a.key=s?r.C0.ESC+"[1;"+(s+1)+"F":t?r.C0.ESC+"OF":r.C0.ESC+"[F";break;case 33:e.shiftKey?a.type=2:a.key=r.C0.ESC+"[5~";break;case 34:e.shiftKey?a.type=3:a.key=r.C0.ESC+"[6~";break;case 112:a.key=s?r.C0.ESC+"[1;"+(s+1)+"P":r.C0.ESC+"OP";break;case 113:a.key=s?r.C0.ESC+"[1;"+(s+1)+"Q":r.C0.ESC+"OQ";break;case 114:a.key=s?r.C0.ESC+"[1;"+(s+1)+"R":r.C0.ESC+"OR";break;case 115:a.key=s?r.C0.ESC+"[1;"+(s+1)+"S":r.C0.ESC+"OS";break;case 116:a.key=s?r.C0.ESC+"[15;"+(s+1)+"~":r.C0.ESC+"[15~";break;case 117:a.key=s?r.C0.ESC+"[17;"+(s+1)+"~":r.C0.ESC+"[17~";break;case 118:a.key=s?r.C0.ESC+"[18;"+(s+1)+"~":r.C0.ESC+"[18~";break;case 119:a.key=s?r.C0.ESC+"[19;"+(s+1)+"~":r.C0.ESC+"[19~";break;case 120:a.key=s?r.C0.ESC+"[20;"+(s+1)+"~":r.C0.ESC+"[20~";break;case 121:a.key=s?r.C0.ESC+"[21;"+(s+1)+"~":r.C0.ESC+"[21~";break;case 122:a.key=s?r.C0.ESC+"[23;"+(s+1)+"~":r.C0.ESC+"[23~";break;case 123:a.key=s?r.C0.ESC+"[24;"+(s+1)+"~":r.C0.ESC+"[24~";break;default:if(!e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)if(n&&!o||!e.altKey||e.metaKey)!n||e.altKey||e.ctrlKey||e.shiftKey||!e.metaKey?e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&1===e.key.length?a.key=e.key:e.key&&e.ctrlKey&&"_"===e.key&&(a.key=r.C0.US):65===e.keyCode&&(a.type=1);else{var c=i[e.keyCode],l=c&&c[e.shiftKey?1:0];l?a.key=r.C0.ESC+l:e.keyCode>=65&&e.keyCode<=90&&(a.key=r.C0.ESC+String.fromCharCode(e.ctrlKey?e.keyCode-64:e.keyCode+32))}else e.keyCode>=65&&e.keyCode<=90?a.key=String.fromCharCode(e.keyCode-64):32===e.keyCode?a.key=r.C0.NUL:e.keyCode>=51&&e.keyCode<=55?a.key=String.fromCharCode(e.keyCode-51+27):56===e.keyCode?a.key=r.C0.DEL:219===e.keyCode?a.key=r.C0.ESC:220===e.keyCode?a.key=r.C0.FS:221===e.keyCode&&(a.key=r.C0.GS)}return a}},482:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Utf8ToUtf32=t.StringToUtf32=t.utf32ToString=t.stringFromCodePoint=void 0,t.stringFromCodePoint=function(e){return e>65535?(e-=65536,String.fromCharCode(55296+(e>>10))+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)},t.utf32ToString=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=e.length);for(var r="",i=t;i65535?(o-=65536,r+=String.fromCharCode(55296+(o>>10))+String.fromCharCode(o%1024+56320)):r+=String.fromCharCode(o)}return r};var n=function(){function e(){this._interim=0}return e.prototype.clear=function(){this._interim=0},e.prototype.decode=function(e,t){var n=e.length;if(!n)return 0;var r=0,i=0;this._interim&&(56320<=(s=e.charCodeAt(i++))&&s<=57343?t[r++]=1024*(this._interim-55296)+s-56320+65536:(t[r++]=this._interim,t[r++]=s),this._interim=0);for(var o=i;o=n)return this._interim=a,r;var s;56320<=(s=e.charCodeAt(o))&&s<=57343?t[r++]=1024*(a-55296)+s-56320+65536:(t[r++]=a,t[r++]=s)}else 65279!==a&&(t[r++]=a)}return r},e}();t.StringToUtf32=n;var r=function(){function e(){this.interim=new Uint8Array(3)}return e.prototype.clear=function(){this.interim.fill(0)},e.prototype.decode=function(e,t){var n=e.length;if(!n)return 0;var r,i,o,a,s=0,c=0,l=0;if(this.interim[0]){var u=!1,h=this.interim[0];h&=192==(224&h)?31:224==(240&h)?15:7;for(var d=0,f=void 0;(f=63&this.interim[++d])&&d<4;)h<<=6,h|=f;for(var p=192==(224&this.interim[0])?2:224==(240&this.interim[0])?3:4,m=p-d;l=n)return 0;if(128!=(192&(f=e[l++]))){l--,u=!0;break}this.interim[d++]=f,h<<=6,h|=63&f}u||(2===p?h<128?l--:t[s++]=h:3===p?h<2048||h>=55296&&h<=57343||65279===h||(t[s++]=h):h<65536||h>1114111||(t[s++]=h)),this.interim.fill(0)}for(var g=n-4,v=l;v=n)return this.interim[0]=r,s;if(128!=(192&(i=e[v++]))){v--;continue}if((c=(31&r)<<6|63&i)<128){v--;continue}t[s++]=c}else if(224==(240&r)){if(v>=n)return this.interim[0]=r,s;if(128!=(192&(i=e[v++]))){v--;continue}if(v>=n)return this.interim[0]=r,this.interim[1]=i,s;if(128!=(192&(o=e[v++]))){v--;continue}if((c=(15&r)<<12|(63&i)<<6|63&o)<2048||c>=55296&&c<=57343||65279===c)continue;t[s++]=c}else if(240==(248&r)){if(v>=n)return this.interim[0]=r,s;if(128!=(192&(i=e[v++]))){v--;continue}if(v>=n)return this.interim[0]=r,this.interim[1]=i,s;if(128!=(192&(o=e[v++]))){v--;continue}if(v>=n)return this.interim[0]=r,this.interim[1]=i,this.interim[2]=o,s;if(128!=(192&(a=e[v++]))){v--;continue}if((c=(7&r)<<18|(63&i)<<12|(63&o)<<6|63&a)<65536||c>1114111)continue;t[s++]=c}}return s},e}();t.Utf8ToUtf32=r},225:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeV6=void 0;var r,i=n(8273),o=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],a=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],s=function(){function e(){if(this.version="6",!r){r=new Uint8Array(65536),i.fill(r,1),r[0]=0,i.fill(r,0,1,32),i.fill(r,0,127,160),i.fill(r,2,4352,4448),r[9001]=2,r[9002]=2,i.fill(r,2,11904,42192),r[12351]=1,i.fill(r,2,44032,55204),i.fill(r,2,63744,64256),i.fill(r,2,65040,65050),i.fill(r,2,65072,65136),i.fill(r,2,65280,65377),i.fill(r,2,65504,65511);for(var e=0;et[i][1])return!1;for(;i>=r;)if(e>t[n=r+i>>1][1])r=n+1;else{if(!(e=131072&&e<=196605||e>=196608&&e<=262141?2:1},e}();t.UnicodeV6=s},5981:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.WriteBuffer=void 0;var n=function(){function e(e){this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0}return e.prototype.writeSync=function(e){if(this._writeBuffer.length){for(var t=this._bufferOffset;t5e7)throw new Error("write data discarded, use flow control to avoid losing data");this._writeBuffer.length||(this._bufferOffset=0,setTimeout(function(){return n._innerWrite()})),this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)},e.prototype._innerWrite=function(){for(var e=this,t=Date.now();this._writeBuffer.length>this._bufferOffset;){var n=this._writeBuffer[this._bufferOffset],r=this._callbacks[this._bufferOffset];if(this._bufferOffset++,this._action(n),this._pendingData-=n.length,r&&r(),Date.now()-t>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(function(){return e._innerWrite()},0)):(this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0)},e}();t.WriteBuffer=n},5770:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.PAYLOAD_LIMIT=void 0,t.PAYLOAD_LIMIT=1e7},6351:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.DcsHandler=t.DcsParser=void 0;var r=n(482),i=n(8742),o=n(5770),a=[],s=function(){function e(){this._handlers=Object.create(null),this._active=a,this._ident=0,this._handlerFb=function(){}}return e.prototype.dispose=function(){this._handlers=Object.create(null),this._handlerFb=function(){},this._active=a},e.prototype.registerHandler=function(e,t){void 0===this._handlers[e]&&(this._handlers[e]=[]);var n=this._handlers[e];return n.push(t),{dispose:function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)}}},e.prototype.clearHandler=function(e){this._handlers[e]&&delete this._handlers[e]},e.prototype.setHandlerFallback=function(e){this._handlerFb=e},e.prototype.reset=function(){this._active.length&&this.unhook(!1),this._active=a,this._ident=0},e.prototype.hook=function(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||a,this._active.length)for(var n=this._active.length-1;n>=0;n--)this._active[n].hook(t);else this._handlerFb(this._ident,"HOOK",t)},e.prototype.put=function(e,t,n){if(this._active.length)for(var i=this._active.length-1;i>=0;i--)this._active[i].put(e,t,n);else this._handlerFb(this._ident,"PUT",r.utf32ToString(e,t,n))},e.prototype.unhook=function(e){if(this._active.length){for(var t=this._active.length-1;t>=0&&!this._active[t].unhook(e);t--);for(t--;t>=0;t--)this._active[t].unhook(!1)}else this._handlerFb(this._ident,"UNHOOK",e);this._active=a,this._ident=0},e}();t.DcsParser=s;var c=new i.Params;c.addParam(0);var l=function(){function e(e){this._handler=e,this._data="",this._params=c,this._hitLimit=!1}return e.prototype.hook=function(e){this._params=e.length>1||e.params[0]?e.clone():c,this._data="",this._hitLimit=!1},e.prototype.put=function(e,t,n){this._hitLimit||(this._data+=r.utf32ToString(e,t,n),this._data.length>o.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))},e.prototype.unhook=function(e){var t=!1;return this._hitLimit?t=!1:e&&(t=this._handler(this._data,this._params)),this._params=c,this._data="",this._hitLimit=!1,t},e}();t.DcsHandler=l},2015:function(e,t,n){var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.EscapeSequenceParser=t.VT500_TRANSITION_TABLE=t.TransitionTable=void 0;var o=n(844),a=n(8273),s=n(8742),c=n(6242),l=n(6351),u=function(){function e(e){this.table=new Uint8Array(e)}return e.prototype.setDefault=function(e,t){a.fill(this.table,e<<4|t)},e.prototype.add=function(e,t,n,r){this.table[t<<8|e]=n<<4|r},e.prototype.addMany=function(e,t,n,r){for(var i=0;i1)throw new Error("only one byte as prefix supported");if((n=e.prefix.charCodeAt(0))&&60>n||n>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(var r=0;ri||i>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");n<<=8,n|=i}}if(1!==e.final.length)throw new Error("final must be a single byte");var o=e.final.charCodeAt(0);if(t[0]>o||o>t[1])throw new Error("final must be in range "+t[0]+" .. "+t[1]);return(n<<=8)|o},n.prototype.identToString=function(e){for(var t=[];e;)t.push(String.fromCharCode(255&e)),e>>=8;return t.reverse().join("")},n.prototype.dispose=function(){this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null),this._oscParser.dispose(),this._dcsParser.dispose()},n.prototype.setPrintHandler=function(e){this._printHandler=e},n.prototype.clearPrintHandler=function(){this._printHandler=this._printHandlerFb},n.prototype.registerEscHandler=function(e,t){var n=this._identifier(e,[48,126]);void 0===this._escHandlers[n]&&(this._escHandlers[n]=[]);var r=this._escHandlers[n];return r.push(t),{dispose:function(){var e=r.indexOf(t);-1!==e&&r.splice(e,1)}}},n.prototype.clearEscHandler=function(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]},n.prototype.setEscHandlerFallback=function(e){this._escHandlerFb=e},n.prototype.setExecuteHandler=function(e,t){this._executeHandlers[e.charCodeAt(0)]=t},n.prototype.clearExecuteHandler=function(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]},n.prototype.setExecuteHandlerFallback=function(e){this._executeHandlerFb=e},n.prototype.registerCsiHandler=function(e,t){var n=this._identifier(e);void 0===this._csiHandlers[n]&&(this._csiHandlers[n]=[]);var r=this._csiHandlers[n];return r.push(t),{dispose:function(){var e=r.indexOf(t);-1!==e&&r.splice(e,1)}}},n.prototype.clearCsiHandler=function(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]},n.prototype.setCsiHandlerFallback=function(e){this._csiHandlerFb=e},n.prototype.registerDcsHandler=function(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)},n.prototype.clearDcsHandler=function(e){this._dcsParser.clearHandler(this._identifier(e))},n.prototype.setDcsHandlerFallback=function(e){this._dcsParser.setHandlerFallback(e)},n.prototype.registerOscHandler=function(e,t){return this._oscParser.registerHandler(e,t)},n.prototype.clearOscHandler=function(e){this._oscParser.clearHandler(e)},n.prototype.setOscHandlerFallback=function(e){this._oscParser.setHandlerFallback(e)},n.prototype.setErrorHandler=function(e){this._errorHandler=e},n.prototype.clearErrorHandler=function(){this._errorHandler=this._errorHandlerFb},n.prototype.reset=function(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0},n.prototype.parse=function(e,t){for(var n=0,r=0,i=this.currentState,o=this._oscParser,a=this._dcsParser,s=this._collect,c=this._params,l=this._transitions.table,u=0;u>4){case 2:for(var d=u+1;;++d){if(d>=t||(n=e[d])<32||n>126&&n=t||(n=e[d])<32||n>126&&n=t||(n=e[d])<32||n>126&&n=t||(n=e[d])<32||n>126&&n=0&&!f[p](c);p--);p<0&&this._csiHandlerFb(s<<8|n,c),this.precedingCodepoint=0;break;case 8:do{switch(n){case 59:c.addParam(0);break;case 58:c.addSubParam(-1);break;default:c.addDigit(n-48)}}while(++u47&&n<60);u--;break;case 9:s<<=8,s|=n;break;case 10:for(var m=this._escHandlers[s<<8|n],g=m?m.length-1:-1;g>=0&&!m[g]();g--);g<0&&this._escHandlerFb(s<<8|n),this.precedingCodepoint=0;break;case 11:c.reset(),c.addParam(0),s=0;break;case 12:a.hook(s<<8|n,c);break;case 13:for(var v=u+1;;++v)if(v>=t||24===(n=e[v])||26===n||27===n||n>127&&n=t||(n=e[b])<32||n>127&&n=0;e--)this._active[e].start();else this._handlerFb(this._id,"START")},e.prototype._put=function(e,t,n){if(this._active.length)for(var r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,n);else this._handlerFb(this._id,"PUT",i.utf32ToString(e,t,n))},e.prototype._end=function(e){if(this._active.length){for(var t=this._active.length-1;t>=0&&!this._active[t].end(e);t--);for(t--;t>=0;t--)this._active[t].end(!1)}else this._handlerFb(this._id,"END",e)},e.prototype.start=function(){this.reset(),this._state=1},e.prototype.put=function(e,t,n){if(3!==this._state){if(1===this._state)for(;t0&&this._put(e,t,n)}},e.prototype.end=function(e){0!==this._state&&(3!==this._state&&(1===this._state&&this._start(),this._end(e)),this._active=o,this._id=-1,this._state=0)},e}();t.OscParser=a;var s=function(){function e(e){this._handler=e,this._data="",this._hitLimit=!1}return e.prototype.start=function(){this._data="",this._hitLimit=!1},e.prototype.put=function(e,t,n){this._hitLimit||(this._data+=i.utf32ToString(e,t,n),this._data.length>r.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))},e.prototype.end=function(e){var t=!1;return this._hitLimit?t=!1:e&&(t=this._handler(this._data)),this._data="",this._hitLimit=!1,t},e}();t.OscHandler=s},8742:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Params=void 0;var n=2147483647,r=function(){function e(e,t){if(void 0===e&&(e=32),void 0===t&&(t=32),this.maxLength=e,this.maxSubParamsLength=t,t>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(e),this.length=0,this._subParams=new Int32Array(t),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(e),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}return e.fromArray=function(t){var n=new e;if(!t.length)return n;for(var r=t[0]instanceof Array?1:0;r>8,r=255&this._subParamsIdx[t];r-n>0&&e.push(Array.prototype.slice.call(this._subParams,n,r))}return e},e.prototype.reset=function(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1},e.prototype.addParam=function(e){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(e<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=e>n?n:e}},e.prototype.addSubParam=function(e){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(e<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=e>n?n:e,this._subParamsIdx[this.length-1]++}},e.prototype.hasSubParams=function(e){return(255&this._subParamsIdx[e])-(this._subParamsIdx[e]>>8)>0},e.prototype.getSubParams=function(e){var t=this._subParamsIdx[e]>>8,n=255&this._subParamsIdx[e];return n-t>0?this._subParams.subarray(t,n):null},e.prototype.getSubParamsAll=function(){for(var e={},t=0;t>8,r=255&this._subParamsIdx[t];r-n>0&&(e[t]=this._subParams.slice(n,r))}return e},e.prototype.addDigit=function(e){var t;if(!(this._rejectDigits||!(t=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)){var r=this._digitIsSub?this._subParams:this.params,i=r[t-1];r[t-1]=~i?Math.min(10*i+e,n):e}},e}();t.Params=r},744:function(e,t,n){var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},a=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.BufferService=t.MINIMUM_ROWS=t.MINIMUM_COLS=void 0;var s=n(2585),c=n(5295),l=n(8460),u=n(844);t.MINIMUM_COLS=2,t.MINIMUM_ROWS=1;var h=function(e){function n(n){var r=e.call(this)||this;return r._optionsService=n,r.isUserScrolling=!1,r._onResize=new l.EventEmitter,r.cols=Math.max(n.options.cols,t.MINIMUM_COLS),r.rows=Math.max(n.options.rows,t.MINIMUM_ROWS),r.buffers=new c.BufferSet(n,r),r}return i(n,e),Object.defineProperty(n.prototype,"onResize",{get:function(){return this._onResize.event},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!1,configurable:!0}),n.prototype.dispose=function(){e.prototype.dispose.call(this),this.buffers.dispose()},n.prototype.resize=function(e,t){this.cols=e,this.rows=t,this.buffers.resize(e,t),this.buffers.setupTabStops(this.cols),this._onResize.fire({cols:e,rows:t})},n.prototype.reset=function(){this.buffers.reset(),this.isUserScrolling=!1},o([a(0,s.IOptionsService)],n)}(u.Disposable);t.BufferService=h},7994:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.CharsetService=void 0;var n=function(){function e(){this.glevel=0,this._charsets=[]}return e.prototype.reset=function(){this.charset=void 0,this._charsets=[],this.glevel=0},e.prototype.setgLevel=function(e){this.glevel=e,this.charset=this._charsets[e]},e.prototype.setgCharset=function(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)},e}();t.CharsetService=n},1753:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreMouseService=void 0;var o=n(2585),a=n(8460),s={NONE:{events:0,restrict:function(){return!1}},X10:{events:1,restrict:function(e){return 4!==e.button&&1===e.action&&(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)}},VT200:{events:19,restrict:function(e){return 32!==e.action}},DRAG:{events:23,restrict:function(e){return 32!==e.action||3!==e.button}},ANY:{events:31,restrict:function(e){return!0}}};function c(e,t){var n=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return 4===e.button?(n|=64,n|=e.action):(n|=3&e.button,4&e.button&&(n|=64),8&e.button&&(n|=128),32===e.action?n|=32:0!==e.action||t||(n|=3)),n}var l=String.fromCharCode,u={DEFAULT:function(e){var t=[c(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":"\x1b[M"+l(t[0])+l(t[1])+l(t[2])},SGR:function(e){var t=0===e.action&&4!==e.button?"m":"M";return"\x1b[<"+c(e,!0)+";"+e.col+";"+e.row+t}},h=function(){function e(e,t){this._bufferService=e,this._coreService=t,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._onProtocolChange=new a.EventEmitter,this._lastEvent=null;for(var n=0,r=Object.keys(s);n=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows)return!1;if(4===e.button&&32===e.action)return!1;if(3===e.button&&32!==e.action)return!1;if(4!==e.button&&(2===e.action||3===e.action))return!1;if(e.col++,e.row++,32===e.action&&this._lastEvent&&this._compareEvents(this._lastEvent,e))return!1;if(!this._protocols[this._activeProtocol].restrict(e))return!1;var t=this._encodings[this._activeEncoding](e);return t&&("DEFAULT"===this._activeEncoding?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0},e.prototype.explainEvents=function(e){return{down:!!(1&e),up:!!(2&e),drag:!!(4&e),move:!!(8&e),wheel:!!(16&e)}},e.prototype._compareEvents=function(e,t){return e.col===t.col&&e.row===t.row&&e.button===t.button&&e.action===t.action&&e.ctrl===t.ctrl&&e.alt===t.alt&&e.shift===t.shift},r([i(0,o.IBufferService),i(1,o.ICoreService)],e)}();t.CoreMouseService=h},6975:function(e,t,n){var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},a=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreService=void 0;var s=n(2585),c=n(8460),l=n(1439),u=n(844),h=Object.freeze({insertMode:!1}),d=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0}),f=function(e){function t(t,n,r,i){var o=e.call(this)||this;return o._bufferService=n,o._logService=r,o._optionsService=i,o.isCursorInitialized=!1,o.isCursorHidden=!1,o._onData=o.register(new c.EventEmitter),o._onUserInput=o.register(new c.EventEmitter),o._onBinary=o.register(new c.EventEmitter),o._scrollToBottom=t,o.register({dispose:function(){return o._scrollToBottom=void 0}}),o.modes=l.clone(h),o.decPrivateModes=l.clone(d),o}return i(t,e),Object.defineProperty(t.prototype,"onData",{get:function(){return this._onData.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onUserInput",{get:function(){return this._onUserInput.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onBinary",{get:function(){return this._onBinary.event},enumerable:!1,configurable:!0}),t.prototype.reset=function(){this.modes=l.clone(h),this.decPrivateModes=l.clone(d)},t.prototype.triggerDataEvent=function(e,t){if(void 0===t&&(t=!1),!this._optionsService.options.disableStdin){var n=this._bufferService.buffer;n.ybase!==n.ydisp&&this._scrollToBottom(),t&&this._onUserInput.fire(),this._logService.debug('sending data "'+e+'"',function(){return e.split("").map(function(e){return e.charCodeAt(0)})}),this._onData.fire(e)}},t.prototype.triggerBinaryEvent=function(e){this._optionsService.options.disableStdin||(this._logService.debug('sending binary "'+e+'"',function(){return e.split("").map(function(e){return e.charCodeAt(0)})}),this._onBinary.fire(e))},o([a(1,s.IBufferService),a(2,s.ILogService),a(3,s.IOptionsService)],t)}(u.Disposable);t.CoreService=f},3730:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DirtyRowService=void 0;var o=n(2585),a=function(){function e(e){this._bufferService=e,this.clearRange()}return Object.defineProperty(e.prototype,"start",{get:function(){return this._start},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"end",{get:function(){return this._end},enumerable:!1,configurable:!0}),e.prototype.clearRange=function(){this._start=this._bufferService.buffer.y,this._end=this._bufferService.buffer.y},e.prototype.markDirty=function(e){ethis._end&&(this._end=e)},e.prototype.markRangeDirty=function(e,t){if(e>t){var n=e;e=t,t=n}ethis._end&&(this._end=t)},e.prototype.markAllDirty=function(){this.markRangeDirty(0,this._bufferService.rows-1)},r([i(0,o.IBufferService)],e)}();t.DirtyRowService=a},4348:function(e,t,n){var r=this&&this.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t0?i[0].index:t.length;if(t.length!==h)throw new Error("[createInstance] First service dependency of "+e.name+" at position "+(h+1)+" conflicts with "+t.length+" static arguments");return new(e.bind.apply(e,r([void 0],r(t,a))))},e}();t.InstantiationService=s},7866:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}},o=this&&this.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t=n)return t+this.wcwidth(i);var o=e.charCodeAt(r);56320<=o&&o<=57343?i=1024*(i-55296)+o-56320+65536:t+=this.wcwidth(o)}t+=this.wcwidth(i)}return t},e}();t.UnicodeService=o}},t={};return function n(r){if(t[r])return t[r].exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}(4389)}()},"/slF":function(e,t,n){var r=n("vd7W").isDigit,i=n("vd7W").cmpChar,o=n("vd7W").TYPE,a=o.Delim,s=o.WhiteSpace,c=o.Comment,l=o.Ident,u=o.Number,h=o.Dimension,d=45,f=!0;function p(e,t){return null!==e&&e.type===a&&e.value.charCodeAt(0)===t}function m(e,t,n){for(;null!==e&&(e.type===s||e.type===c);)e=n(++t);return t}function g(e,t,n,i){if(!e)return 0;var o=e.value.charCodeAt(t);if(43===o||o===d){if(n)return 0;t++}for(;t100&&(u=a-60+3,a=58);for(var h=s;h<=c;h++)h>=0&&h0&&r[h].length>u?"\u2026":"")+r[h].substr(u,98)+(r[h].length>u+100-1?"\u2026":""));return[n(s,o),new Array(a+l+2).join("-")+"^",n(o,c)].filter(Boolean).join("\n")}e.exports=function(e,t,n,i,a){var s=r("SyntaxError",e);return s.source=t,s.offset=n,s.line=i,s.column=a,s.sourceFragment=function(e){return o(s,isNaN(e)?0:e)},Object.defineProperty(s,"formattedMessage",{get:function(){return"Parse error: "+s.message+"\n"+o(s,2)}}),s.parseError={offset:n,line:i,column:a},s}},"1gRP":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n("kU1M");t.materialize=function(){return r.materialize()(this)}},"1uah":function(e,t,n){"use strict";n.d(t,"b",function(){return d}),n.d(t,"a",function(){return f});var r=n("mvVQ"),i=n("/E8u"),o=n("MGFw"),a=n("WtWf"),s=n("yCtX"),c=n("DH7j"),l=n("7o/Q"),u=n("Lhse"),h=n("zx2A");function d(){for(var e=arguments.length,t=new Array(e),n=0;n2&&void 0!==arguments[2]||Object.create(null),Object(o.a)(this,n),(i=t.call(this,e)).resultSelector=r,i.iterators=[],i.active=0,i.resultSelector="function"==typeof r?r:void 0,i}return Object(a.a)(n,[{key:"_next",value:function(e){var t=this.iterators;Object(c.a)(e)?t.push(new g(e)):t.push("function"==typeof e[u.a]?new m(e[u.a]()):new v(this.destination,this,e))}},{key:"_complete",value:function(){var e=this.iterators,t=e.length;if(this.unsubscribe(),0!==t){this.active=t;for(var n=0;nthis.index}},{key:"hasCompleted",value:function(){return this.array.length===this.index}}]),e}(),v=function(e){Object(r.a)(n,e);var t=Object(i.a)(n);function n(e,r,i){var a;return Object(o.a)(this,n),(a=t.call(this,e)).parent=r,a.observable=i,a.stillUnsubscribed=!0,a.buffer=[],a.isComplete=!1,a}return Object(a.a)(n,[{key:u.a,value:function(){return this}},{key:"next",value:function(){var e=this.buffer;return 0===e.length&&this.isComplete?{value:null,done:!0}:{value:e.shift(),done:!1}}},{key:"hasValue",value:function(){return this.buffer.length>0}},{key:"hasCompleted",value:function(){return 0===this.buffer.length&&this.isComplete}},{key:"notifyComplete",value:function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()}},{key:"notifyNext",value:function(e){this.buffer.push(e),this.parent.checkIterators()}},{key:"subscribe",value:function(){return Object(h.c)(this.observable,new h.a(this))}}]),n}(h.b)},"2+DN":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n("qCKp"),i=n("uMcE");r.Observable.prototype.shareReplay=i.shareReplay},"2Gxe":function(e,t,n){var r=n("vd7W").TYPE,i=r.Ident,o=r.String,a=r.Colon,s=r.LeftSquareBracket,c=r.RightSquareBracket;function l(){this.scanner.eof&&this.error("Unexpected end of input");var e=this.scanner.tokenStart,t=!1,n=!0;return this.scanner.isDelim(42)?(t=!0,n=!1,this.scanner.next()):this.scanner.isDelim(124)||this.eat(i),this.scanner.isDelim(124)?61!==this.scanner.source.charCodeAt(this.scanner.tokenStart+1)?(this.scanner.next(),this.eat(i)):t&&this.error("Identifier is expected",this.scanner.tokenEnd):t&&this.error("Vertical line is expected"),n&&this.scanner.tokenType===a&&(this.scanner.next(),this.eat(i)),{type:"Identifier",loc:this.getLocation(e,this.scanner.tokenStart),name:this.scanner.substrToCursor(e)}}function u(){var e=this.scanner.tokenStart,t=this.scanner.source.charCodeAt(e);return 61!==t&&126!==t&&94!==t&&36!==t&&42!==t&&124!==t&&this.error("Attribute selector (=, ~=, ^=, $=, *=, |=) is expected"),this.scanner.next(),61!==t&&(this.scanner.isDelim(61)||this.error("Equal sign is expected"),this.scanner.next()),this.scanner.substrToCursor(e)}e.exports={name:"AttributeSelector",structure:{name:"Identifier",matcher:[String,null],value:["String","Identifier",null],flags:[String,null]},parse:function(){var e,t=this.scanner.tokenStart,n=null,r=null,a=null;return this.eat(s),this.scanner.skipSC(),e=l.call(this),this.scanner.skipSC(),this.scanner.tokenType!==c&&(this.scanner.tokenType!==i&&(n=u.call(this),this.scanner.skipSC(),r=this.scanner.tokenType===o?this.String():this.Identifier(),this.scanner.skipSC()),this.scanner.tokenType===i&&(a=this.scanner.getTokenValue(),this.scanner.next(),this.scanner.skipSC())),this.eat(c),{type:"AttributeSelector",loc:this.getLocation(t,this.scanner.tokenStart),name:e,matcher:n,value:r,flags:a}},generate:function(e){var t=" ";this.chunk("["),this.node(e.name),null!==e.matcher&&(this.chunk(e.matcher),null!==e.value&&(this.node(e.value),"String"===e.value.type&&(t=""))),null!==e.flags&&(this.chunk(t),this.chunk(e.flags)),this.chunk("]")}}},"2IC2":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n("qCKp"),i=n("j5kd");r.Observable.prototype.windowTime=i.windowTime},"2QA8":function(e,t,n){"use strict";n.d(t,"a",function(){return r});var r=function(){return"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}()},"2TAq":function(e,t,n){var r=n("vd7W").isHexDigit,i=n("vd7W").cmpChar,o=n("vd7W").TYPE,a=o.Ident,s=o.Delim,c=o.Number,l=o.Dimension;function u(e,t){return null!==e&&e.type===s&&e.value.charCodeAt(0)===t}function h(e,t){return e.value.charCodeAt(0)===t}function d(e,t,n){for(var i=t,o=0;i0?6:0;if(!r(a))return 0;if(++o>6)return 0}return o}function f(e,t,n){if(!e)return 0;for(;u(n(t),63);){if(++e>6)return 0;t++}return t}e.exports=function(e,t){var n=0;if(null===e||e.type!==a||!i(e.value,0,117))return 0;if(null===(e=t(++n)))return 0;if(u(e,43))return null===(e=t(++n))?0:e.type===a?f(d(e,0,!0),++n,t):u(e,63)?f(1,++n,t):0;if(e.type===c){if(!h(e,43))return 0;var r=d(e,1,!0);return 0===r?0:null===(e=t(++n))?n:e.type===l||e.type===c?h(e,45)&&d(e,1,!1)?n+1:0:f(r,n,t)}return e.type===l&&h(e,43)?f(d(e,1,!0),++n,t):0}},"2Vo4":function(e,t,n){"use strict";n.d(t,"a",function(){return h});var r=n("MGFw"),i=n("WtWf"),o=n("t9bE"),a=n("KUzl"),s=n("mvVQ"),c=n("/E8u"),l=n("XNiG"),u=n("9ppp"),h=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(e){var i;return Object(r.a)(this,n),(i=t.call(this))._value=e,i}return Object(i.a)(n,[{key:"value",get:function(){return this.getValue()}},{key:"_subscribe",value:function(e){var t=Object(o.a)(Object(a.a)(n.prototype),"_subscribe",this).call(this,e);return t&&!t.closed&&e.next(this._value),t}},{key:"getValue",value:function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new u.a;return this._value}},{key:"next",value:function(e){Object(o.a)(Object(a.a)(n.prototype),"next",this).call(this,this._value=e)}}]),n}(l.b)},"2W6z":function(e,t,n){"use strict";e.exports=function(){}},"2fFW":function(e,t,n){"use strict";n.d(t,"a",function(){return i});var r=!1,i={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){if(e){var t=new Error;console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+t.stack)}else r&&console.log("RxJS: Back to a better error behavior. Thank you. <3");r=e},get useDeprecatedSynchronousErrorHandling(){return r}}},"2pxp":function(e,t){e.exports={parse:function(){return this.createSingleNodeList(this.SelectorList())}}},"338f":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n("kU1M");t.concatMap=function(e){return r.concatMap(e)(this)}},"33Dm":function(e,t,n){var r=n("vd7W").TYPE,i=r.WhiteSpace,o=r.Comment,a=r.Ident,s=r.LeftParenthesis;e.exports={name:"MediaQuery",structure:{children:[["Identifier","MediaFeature","WhiteSpace"]]},parse:function(){this.scanner.skipSC();var e=this.createList(),t=null,n=null;e:for(;!this.scanner.eof;){switch(this.scanner.tokenType){case o:this.scanner.next();continue;case i:n=this.WhiteSpace();continue;case a:t=this.Identifier();break;case s:t=this.MediaFeature();break;default:break e}null!==n&&(e.push(n),n=null),e.push(t)}return null===t&&this.error("Identifier or parenthesis is expected"),{type:"MediaQuery",loc:this.getLocationFromList(e),children:e}},generate:function(e){this.children(e)}}},"37L2":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n("qCKp"),i=n("338f");r.Observable.prototype.concatMap=i.concatMap},"3E0/":function(e,t,n){"use strict";n.d(t,"a",function(){return h});var r=n("mvVQ"),i=n("/E8u"),o=n("MGFw"),a=n("WtWf"),s=n("D0XW"),c=n("mlxB"),l=n("7o/Q"),u=n("WMd4");function h(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.a,n=Object(c.a)(e),r=n?+e-t.now():Math.abs(e);return function(e){return e.lift(new d(r,t))}}var d=function(){function e(t,n){Object(o.a)(this,e),this.delay=t,this.scheduler=n}return Object(a.a)(e,[{key:"call",value:function(e,t){return t.subscribe(new f(e,this.delay,this.scheduler))}}]),e}(),f=function(e){Object(r.a)(n,e);var t=Object(i.a)(n);function n(e,r,i){var a;return Object(o.a)(this,n),(a=t.call(this,e)).delay=r,a.scheduler=i,a.queue=[],a.active=!1,a.errored=!1,a}return Object(a.a)(n,[{key:"_schedule",value:function(e){this.active=!0,this.destination.add(e.schedule(n.dispatch,this.delay,{source:this,destination:this.destination,scheduler:e}))}},{key:"scheduleNotification",value:function(e){if(!0!==this.errored){var t=this.scheduler,n=new p(t.now()+this.delay,e);this.queue.push(n),!1===this.active&&this._schedule(t)}}},{key:"_next",value:function(e){this.scheduleNotification(u.a.createNext(e))}},{key:"_error",value:function(e){this.errored=!0,this.queue=[],this.destination.error(e),this.unsubscribe()}},{key:"_complete",value:function(){this.scheduleNotification(u.a.createComplete()),this.unsubscribe()}}],[{key:"dispatch",value:function(e){for(var t=e.source,n=t.queue,r=e.scheduler,i=e.destination;n.length>0&&n[0].time-r.now()<=0;)n.shift().notification.observe(i);if(n.length>0){var o=Math.max(0,n[0].time-r.now());this.schedule(e,o)}else this.unsubscribe(),t.active=!1}}]),n}(l.a),p=function e(t,n){Object(o.a)(this,e),this.time=t,this.notification=n}},"3EiV":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n("qCKp"),i=n("dL1u");r.Observable.prototype.buffer=i.buffer},"3N8a":function(e,t,n){"use strict";n.d(t,"a",function(){return s});var r=n("MGFw"),i=n("WtWf"),o=n("mvVQ"),a=n("/E8u"),s=function(e){Object(o.a)(n,e);var t=Object(a.a)(n);function n(e,i){var o;return Object(r.a)(this,n),(o=t.call(this,e,i)).scheduler=e,o.work=i,o.pending=!1,o}return Object(i.a)(n,[{key:"schedule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(this.closed)return this;this.state=e;var n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(r,this.id,t),this}},{key:"requestAsyncId",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return setInterval(e.flush.bind(e,this),n)}},{key:"recycleAsyncId",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(null!==n&&this.delay===n&&!1===this.pending)return t;clearInterval(t)}},{key:"execute",value:function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(e,t);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}},{key:"_execute",value:function(e,t){var n=!1,r=void 0;try{this.work(e)}catch(i){n=!0,r=!!i&&i||new Error(i)}if(n)return this.unsubscribe(),r}},{key:"_unsubscribe",value:function(){var e=this.id,t=this.scheduler,n=t.actions,r=n.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==r&&n.splice(r,1),null!=e&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null}}]),n}(function(e){Object(o.a)(n,e);var t=Object(a.a)(n);function n(e,i){return Object(r.a)(this,n),t.call(this)}return Object(i.a)(n,[{key:"schedule",value:function(e){return this}}]),n}(n("quSY").a))},"3Qpg":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n("qCKp");r.Observable.fromPromise=r.from},"3UWI":function(e,t,n){"use strict";n.d(t,"a",function(){return a});var r=n("D0XW"),i=n("tnsW"),o=n("PqYM");function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.a;return Object(i.a)(function(){return Object(o.a)(e,t)})}},"3XNy":function(e,t){function n(e){return e>=48&&e<=57}function r(e){return e>=65&&e<=90}function i(e){return e>=97&&e<=122}function o(e){return r(e)||i(e)}function a(e){return e>=128}function s(e){return o(e)||a(e)||95===e}function c(e){return e>=0&&e<=8||11===e||e>=14&&e<=31||127===e}function l(e){return 10===e||13===e||12===e}function u(e){return l(e)||32===e||9===e}function h(e,t){return 92===e&&!l(t)&&0!==t}var d=new Array(128);p.Eof=128,p.WhiteSpace=130,p.Digit=131,p.NameStart=132,p.NonPrintable=133;for(var f=0;f=65&&e<=70||e>=97&&e<=102},isUppercaseLetter:r,isLowercaseLetter:i,isLetter:o,isNonAscii:a,isNameStart:s,isName:function(e){return s(e)||n(e)||45===e},isNonPrintable:c,isNewline:l,isWhiteSpace:u,isValidEscape:h,isIdentifierStart:function(e,t,n){return 45===e?s(t)||45===t||h(t,n):!!s(e)||92===e&&h(e,t)},isNumberStart:function(e,t,r){return 43===e||45===e?n(t)?2:46===t&&n(r)?3:0:46===e?n(t)?2:0:n(e)?1:0},isBOM:function(e){return 65279===e||65534===e?1:0},charCodeCategory:p}},"3uOa":function(e,t,n){"use strict";n.r(t);var r=n("lcII");n.d(t,"webSocket",function(){return r.a});var i=n("wxn8");n.d(t,"WebSocketSubject",function(){return i.a})},"4AtU":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n("kU1M");t.expand=function(e,t,n){return void 0===t&&(t=Number.POSITIVE_INFINITY),void 0===n&&(n=void 0),r.expand(e,t=(t||0)<1?Number.POSITIVE_INFINITY:t,n)(this)}},"4D8k":function(e,t,n){"use strict";var r=n("9Qh4"),i=n("fEpb").Symbol;e.exports=function(e){return Object.defineProperties(e,{hasInstance:r("",i&&i.hasInstance||e("hasInstance")),isConcatSpreadable:r("",i&&i.isConcatSpreadable||e("isConcatSpreadable")),iterator:r("",i&&i.iterator||e("iterator")),match:r("",i&&i.match||e("match")),replace:r("",i&&i.replace||e("replace")),search:r("",i&&i.search||e("search")),species:r("",i&&i.species||e("species")),split:r("",i&&i.split||e("split")),toPrimitive:r("",i&&i.toPrimitive||e("toPrimitive")),toStringTag:r("",i&&i.toStringTag||e("toStringTag")),unscopables:r("",i&&i.unscopables||e("unscopables"))})}},"4HHr":function(e,t){var n=Object.prototype.hasOwnProperty,r=function(){};function i(e){return"function"==typeof e?e:r}function o(e,t){return function(n,r,i){n.type===t&&e.call(this,n,r,i)}}function a(e,t){var r=t.structure,i=[];for(var o in r)if(!1!==n.call(r,o)){var a=r[o],s={name:o,type:!1,nullable:!1};Array.isArray(r[o])||(a=[r[o]]);for(var c=0;c>>((3&t)<<3)&255;return i}}},"4hIw":function(e,t,n){"use strict";n.d(t,"b",function(){return c}),n.d(t,"a",function(){return l});var r=n("MGFw"),i=n("D0XW"),o=n("Kqap"),a=n("NXyV"),s=n("lJxs");function c(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i.a;return function(t){return Object(a.a)(function(){return t.pipe(Object(o.a)(function(t,n){var r=t.current;return{value:n,current:e.now(),last:r}},{current:e.now(),value:void 0,last:void 0}),Object(s.a)(function(e){return new l(e.value,e.current-e.last)}))})}}var l=function e(t,n){Object(r.a)(this,e),this.value=t,this.interval=n}},"4njK":function(e,t,n){var r=n("vd7W").TYPE,i=r.WhiteSpace,o=r.Semicolon,a=r.LeftCurlyBracket,s=r.Delim;function c(){return this.scanner.tokenIndex>0&&this.scanner.lookupType(-1)===i?this.scanner.tokenIndex>1?this.scanner.getTokenStart(this.scanner.tokenIndex-1):this.scanner.firstCharOffset:this.scanner.tokenStart}function l(){return 0}e.exports={name:"Raw",structure:{value:String},parse:function(e,t,n){var r,i=this.scanner.getTokenStart(e);return this.scanner.skip(this.scanner.getRawLength(e,t||l)),r=n&&this.scanner.tokenStart>i?c.call(this):this.scanner.tokenStart,{type:"Raw",loc:this.getLocation(i,r),value:this.scanner.source.substring(i,r)}},generate:function(e){this.chunk(e.value)},mode:{default:l,leftCurlyBracket:function(e){return e===a?1:0},leftCurlyBracketOrSemicolon:function(e){return e===a||e===o?1:0},exclamationMarkOrSemicolon:function(e,t,n){return e===s&&33===t.charCodeAt(n)||e===o?1:0},semicolonIncluded:function(e){return e===o?2:0}}}},"4vYp":function(e){e.exports=JSON.parse('{"generic":true,"types":{"absolute-size":"xx-small|x-small|small|medium|large|x-large|xx-large","alpha-value":"|","angle-percentage":"|","angular-color-hint":"","angular-color-stop":"&&?","angular-color-stop-list":"[ [, ]?]# , ","animateable-feature":"scroll-position|contents|","attachment":"scroll|fixed|local","attr()":"attr( ? [, ]? )","attr-matcher":"[\'~\'|\'|\'|\'^\'|\'$\'|\'*\']? \'=\'","attr-modifier":"i|s","attribute-selector":"\'[\' \']\'|\'[\' [|] ? \']\'","auto-repeat":"repeat( [auto-fill|auto-fit] , [? ]+ ? )","auto-track-list":"[? [|]]* ? [? [|]]* ?","baseline-position":"[first|last]? baseline","basic-shape":"|||","bg-image":"none|","bg-layer":"|| [/ ]?||||||||","bg-position":"[[left|center|right|top|bottom|]|[left|center|right|] [top|center|bottom|]|[center|[left|right] ?]&&[center|[top|bottom] ?]]","bg-size":"[|auto]{1,2}|cover|contain","blur()":"blur( )","blend-mode":"normal|multiply|screen|overlay|darken|lighten|color-dodge|color-burn|hard-light|soft-light|difference|exclusion|hue|saturation|color|luminosity","box":"border-box|padding-box|content-box","brightness()":"brightness( )","calc()":"calc( )","calc-sum":" [[\'+\'|\'-\'] ]*","calc-product":" [\'*\' |\'/\' ]*","calc-value":"|||( )","cf-final-image":"|","cf-mixing-image":"?&&","circle()":"circle( []? [at ]? )","clamp()":"clamp( #{3} )","class-selector":"\'.\' ","clip-source":"","color":"||||||currentcolor|","color-stop":"|","color-stop-angle":"{1,2}","color-stop-length":"{1,2}","color-stop-list":"[ [, ]?]# , ","combinator":"\'>\'|\'+\'|\'~\'|[\'||\']","common-lig-values":"[common-ligatures|no-common-ligatures]","compat":"searchfield|textarea|push-button|button-bevel|slider-horizontal|checkbox|radio|square-button|menulist|menulist-button|listbox|meter|progress-bar","composite-style":"clear|copy|source-over|source-in|source-out|source-atop|destination-over|destination-in|destination-out|destination-atop|xor","compositing-operator":"add|subtract|intersect|exclude","compound-selector":"[? * [ *]*]!","compound-selector-list":"#","complex-selector":" [? ]*","complex-selector-list":"#","conic-gradient()":"conic-gradient( [from ]? [at ]? , )","contextual-alt-values":"[contextual|no-contextual]","content-distribution":"space-between|space-around|space-evenly|stretch","content-list":"[|contents||||counter( , <\'list-style-type\'>? )]+","content-position":"center|start|end|flex-start|flex-end","content-replacement":"","contrast()":"contrast( [] )","counter()":"counter( , [|none]? )","counter-style":"|symbols( )","counter-style-name":"","counters()":"counters( , , [|none]? )","cross-fade()":"cross-fade( , ? )","cubic-bezier-timing-function":"ease|ease-in|ease-out|ease-in-out|cubic-bezier( , , , )","deprecated-system-color":"ActiveBorder|ActiveCaption|AppWorkspace|Background|ButtonFace|ButtonHighlight|ButtonShadow|ButtonText|CaptionText|GrayText|Highlight|HighlightText|InactiveBorder|InactiveCaption|InactiveCaptionText|InfoBackground|InfoText|Menu|MenuText|Scrollbar|ThreeDDarkShadow|ThreeDFace|ThreeDHighlight|ThreeDLightShadow|ThreeDShadow|Window|WindowFrame|WindowText","discretionary-lig-values":"[discretionary-ligatures|no-discretionary-ligatures]","display-box":"contents|none","display-inside":"flow|flow-root|table|flex|grid|ruby","display-internal":"table-row-group|table-header-group|table-footer-group|table-row|table-cell|table-column-group|table-column|table-caption|ruby-base|ruby-text|ruby-base-container|ruby-text-container","display-legacy":"inline-block|inline-list-item|inline-table|inline-flex|inline-grid","display-listitem":"?&&[flow|flow-root]?&&list-item","display-outside":"block|inline|run-in","drop-shadow()":"drop-shadow( {2,3} ? )","east-asian-variant-values":"[jis78|jis83|jis90|jis04|simplified|traditional]","east-asian-width-values":"[full-width|proportional-width]","element()":"element( )","ellipse()":"ellipse( [{2}]? [at ]? )","ending-shape":"circle|ellipse","env()":"env( , ? )","explicit-track-list":"[? ]+ ?","family-name":"|+","feature-tag-value":" [|on|off]?","feature-type":"@stylistic|@historical-forms|@styleset|@character-variant|@swash|@ornaments|@annotation","feature-value-block":" \'{\' \'}\'","feature-value-block-list":"+","feature-value-declaration":" : + ;","feature-value-declaration-list":"","feature-value-name":"","fill-rule":"nonzero|evenodd","filter-function":"|||||||||","filter-function-list":"[|]+","final-bg-layer":"<\'background-color\'>|||| [/ ]?||||||||","fit-content()":"fit-content( [|] )","fixed-breadth":"","fixed-repeat":"repeat( [] , [? ]+ ? )","fixed-size":"|minmax( , )|minmax( , )","font-stretch-absolute":"normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded|","font-variant-css21":"[normal|small-caps]","font-weight-absolute":"normal|bold|","frequency-percentage":"|","general-enclosed":"[ )]|( )","generic-family":"serif|sans-serif|cursive|fantasy|monospace|-apple-system","generic-name":"serif|sans-serif|cursive|fantasy|monospace","geometry-box":"|fill-box|stroke-box|view-box","gradient":"|||||<-legacy-gradient>","grayscale()":"grayscale( )","grid-line":"auto||[&&?]|[span&&[||]]","historical-lig-values":"[historical-ligatures|no-historical-ligatures]","hsl()":"hsl( [/ ]? )|hsl( , , , ? )","hsla()":"hsla( [/ ]? )|hsla( , , , ? )","hue":"|","hue-rotate()":"hue-rotate( )","image":"|||||","image()":"image( ? [? , ?]! )","image-set()":"image-set( # )","image-set-option":"[|] ","image-src":"|","image-tags":"ltr|rtl","inflexible-breadth":"||min-content|max-content|auto","inset()":"inset( {1,4} [round <\'border-radius\'>]? )","invert()":"invert( )","keyframes-name":"|","keyframe-block":"# { }","keyframe-block-list":"+","keyframe-selector":"from|to|","leader()":"leader( )","leader-type":"dotted|solid|space|","length-percentage":"|","line-names":"\'[\' * \']\'","line-name-list":"[|]+","line-style":"none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset","line-width":"|thin|medium|thick","linear-color-hint":"","linear-color-stop":" ?","linear-gradient()":"linear-gradient( [|to ]? , )","mask-layer":"|| [/ ]?||||||[|no-clip]||||","mask-position":"[|left|center|right] [|top|center|bottom]?","mask-reference":"none||","mask-source":"","masking-mode":"alpha|luminance|match-source","matrix()":"matrix( #{6} )","matrix3d()":"matrix3d( #{16} )","max()":"max( # )","media-and":" [and ]+","media-condition":"|||","media-condition-without-or":"||","media-feature":"( [||] )","media-in-parens":"( )||","media-not":"not ","media-or":" [or ]+","media-query":"|[not|only]? [and ]?","media-query-list":"#","media-type":"","mf-boolean":"","mf-name":"","mf-plain":" : ","mf-range":" [\'<\'|\'>\']? \'=\'? | [\'<\'|\'>\']? \'=\'? | \'<\' \'=\'? \'<\' \'=\'? | \'>\' \'=\'? \'>\' \'=\'? ","mf-value":"|||","min()":"min( # )","minmax()":"minmax( [|||min-content|max-content|auto] , [|||min-content|max-content|auto] )","named-color":"transparent|aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen|<-non-standard-color>","namespace-prefix":"","ns-prefix":"[|\'*\']? \'|\'","number-percentage":"|","numeric-figure-values":"[lining-nums|oldstyle-nums]","numeric-fraction-values":"[diagonal-fractions|stacked-fractions]","numeric-spacing-values":"[proportional-nums|tabular-nums]","nth":"|even|odd","opacity()":"opacity( [] )","overflow-position":"unsafe|safe","outline-radius":"|","page-body":"? [; ]?| ","page-margin-box":" \'{\' \'}\'","page-margin-box-type":"@top-left-corner|@top-left|@top-center|@top-right|@top-right-corner|@bottom-left-corner|@bottom-left|@bottom-center|@bottom-right|@bottom-right-corner|@left-top|@left-middle|@left-bottom|@right-top|@right-middle|@right-bottom","page-selector-list":"[#]?","page-selector":"+| *","perspective()":"perspective( )","polygon()":"polygon( ? , [ ]# )","position":"[[left|center|right]||[top|center|bottom]|[left|center|right|] [top|center|bottom|]?|[[left|right] ]&&[[top|bottom] ]]","pseudo-class-selector":"\':\' |\':\' \')\'","pseudo-element-selector":"\':\' ","pseudo-page":": [left|right|first|blank]","quote":"open-quote|close-quote|no-open-quote|no-close-quote","radial-gradient()":"radial-gradient( [||]? [at ]? , )","relative-selector":"? ","relative-selector-list":"#","relative-size":"larger|smaller","repeat-style":"repeat-x|repeat-y|[repeat|space|round|no-repeat]{1,2}","repeating-linear-gradient()":"repeating-linear-gradient( [|to ]? , )","repeating-radial-gradient()":"repeating-radial-gradient( [||]? [at ]? , )","rgb()":"rgb( {3} [/ ]? )|rgb( {3} [/ ]? )|rgb( #{3} , ? )|rgb( #{3} , ? )","rgba()":"rgba( {3} [/ ]? )|rgba( {3} [/ ]? )|rgba( #{3} , ? )|rgba( #{3} , ? )","rotate()":"rotate( [|] )","rotate3d()":"rotate3d( , , , [|] )","rotateX()":"rotateX( [|] )","rotateY()":"rotateY( [|] )","rotateZ()":"rotateZ( [|] )","saturate()":"saturate( )","scale()":"scale( , ? )","scale3d()":"scale3d( , , )","scaleX()":"scaleX( )","scaleY()":"scaleY( )","scaleZ()":"scaleZ( )","self-position":"center|start|end|self-start|self-end|flex-start|flex-end","shape-radius":"|closest-side|farthest-side","skew()":"skew( [|] , [|]? )","skewX()":"skewX( [|] )","skewY()":"skewY( [|] )","sepia()":"sepia( )","shadow":"inset?&&{2,4}&&?","shadow-t":"[{2,3}&&?]","shape":"rect( , , , )|rect( )","shape-box":"|margin-box","side-or-corner":"[left|right]||[top|bottom]","single-animation":"