diff --git a/.gitattributes b/.gitattributes index 82f4bab2..5c17cdc9 100644 --- a/.gitattributes +++ b/.gitattributes @@ -58,19 +58,8 @@ js/core/fallback/index.html text eol=lf js/core/fallback/webfront-fallback.mjs text eol=lf include/webfront/system/FallbackIndexHtmlData.hpp text eol=lf include/webfront/system/FallbackModuleData.hpp text eol=lf -js/developer/components/terminal/* text eol=lf -js/developer/components/tools/* text eol=lf -include/webfront/system/ToolManagerModuleData.hpp text eol=lf -third_party/xterm/* text eol=lf -include/webfront/system/TerminalIndexHtmlData.hpp text eol=lf -include/webfront/system/TerminalModuleData.hpp text eol=lf -include/webfront/system/XtermModuleData.hpp text eol=lf -include/webfront/system/XtermCssData.hpp text eol=lf -include/webfront/system/XtermFitAddonData.hpp text eol=lf # The fake npm registry of the browser integration test: its packuments are served byte for byte. -test/web/registry/* text eol=lf -test/web/registry/tarballs/* binary # Serialisation *.json text diff --git a/.github/workflows/DeveloperDistribution.yml b/.github/workflows/DeveloperDistribution.yml index c7f9fec1..46c039e6 100644 --- a/.github/workflows/DeveloperDistribution.yml +++ b/.github/workflows/DeveloperDistribution.yml @@ -6,7 +6,6 @@ on: branches: [develop, master] paths: - 'js/developer/environment/**' - - 'js/developer/components/tools/**' - 'js/developer/tools/starters/pi/**' - 'examples/life/ui/**' - 'js/developer/tools/**' @@ -17,7 +16,6 @@ on: branches: [develop, master] paths: - 'js/developer/environment/**' - - 'js/developer/components/tools/**' - 'js/developer/tools/starters/pi/**' - 'examples/life/ui/**' - 'js/developer/tools/**' diff --git a/AGENTS.md b/AGENTS.md index 8bd25e82..6782434e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -12,22 +12,20 @@ The README introduces WebFront through the Game of Life walkthrough, demonstrati ## Repository map -- `include/webfront/`: public header-only library, included as ``. `WebFront.hpp` is the main orchestration API. +- `include/webfront/`: public header-only library, included as ``. `WebFront.hpp` is the main orchestration API; `Commands.hpp` adds an application's C++ commands to the developer environment's terminal. - `include/webfront/http/`: HTTP and WebSocket protocol implementation. - `include/webfront/weblink/`: bridge message encoding and routing. - `include/webfront/system/`: layered virtual filesystems and embedded web resources. - `include/webfront/frontend/`: system-browser, CEF, optional Windows WebView2 and macOS WKWebView frontend adapters. -- `include/webfront/components/`: opt-in UI components (`Terminal.hpp`, `ToolManager.hpp`); their assets are served by embedded providers such as `include/webfront/system/TerminalFS.hpp`, and installed tools by `include/webfront/system/PackageFS.hpp` from `ToolStore.hpp`'s project directory. - `examples/`: only Hello World (`hello-world/`) and Game of Life (`life/`, with console, developer and embedded stages). -- `js/core/`: readable browser bridge, fallback and bootstrap loader compiled into `include/webfront/`, plus the embedding CMake modules; `js/developer/`: developer environment, terminal/`wf` components, build and vendoring tools. Production C++ remains header-only in `include/webfront/`. +- `js/core/`: readable browser bridge, fallback and bootstrap loader compiled into `include/webfront/`, plus the embedding CMake modules; `js/developer/`: developer environment (its terminal and `wf`), build and vendoring tools. Production C++ remains header-only in `include/webfront/`. - `js/developer/tools/starters/pi/`, `test/fixtures/`, `test/web/fixtures/`: retained package and regression fixtures, not public example applications. - `test/unit/`: Catch2 unit tests; `test/web/`: Jasmine real-browser integration test; `test/fuzz/`, `test/fixtures/`; `test/cmake/`: CMake test scripts and sub-projects. The `RepositoryLayout` CTest case pins the tracked root. - `cmake/`: build modules (frontends, CEF, CPM, compiler options); `.github/`: workflows, `.github/CONTRIBUTING.md`. - `.devcontainer/`: devcontainer and its Dockerfile; `docs/`: documentation, `docs/CHANGELOG.md`, `docs/Doxyfile.in`. -- `third_party/xterm/`: vendored xterm.js distribution embedded by the terminal component; refresh it only with `cmake/UpdateXterm.cmake`. - `docs/PROJECT_STATUS.md`: evidence-based status snapshot and known limitations. - `docs/adr/README.md`: architecture decision index, Git history, tradeoffs and implementation rules; read the relevant ADRs before changing their contracts. -- `docs/UI_COMPONENTS.md`: UI component architecture, the terminal component and the planned `wf` tool manager. +- `docs/UI_COMPONENTS.md`: what replaced the removed terminal component and `wf` tool manager, with the migration to `webfront::Commands`. - `docs/ISSUE_AUDIT.md`: recommendations for the current GitHub backlog. The historical `webfront/` prototype and the former top-level `webtest/` are gone: use `test/unit/` for current C++ tests and `test/web/` for browser tests. Do not revive legacy code without a specific issue and regression coverage. diff --git a/cmake/UpdateXterm.cmake b/cmake/UpdateXterm.cmake deleted file mode 100644 index 5867c7dc..00000000 --- a/cmake/UpdateXterm.cmake +++ /dev/null @@ -1,39 +0,0 @@ -# Maintenance script, not part of the build: refreshes the vendored xterm.js files in -# third_party/xterm from the npm registry (network access required), then regenerate the embedded -# headers with the webfront-embedded-assets target and review the diff. -# -# cmake -DXTERM_VERSION=6.0.0 -DFIT_VERSION=0.11.0 -P cmake/UpdateXterm.cmake - -cmake_minimum_required(VERSION 3.31) - -if(NOT DEFINED XTERM_VERSION OR NOT DEFINED FIT_VERSION) - message(FATAL_ERROR "Set XTERM_VERSION and FIT_VERSION, e.g. -DXTERM_VERSION=6.0.0 -DFIT_VERSION=0.11.0") -endif() - -get_filename_component(root "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE) -set(destination "${root}/third_party/xterm") -string(RANDOM LENGTH 8 suffix) -set(work "${CMAKE_CURRENT_BINARY_DIR}/webfront-xterm-update-${suffix}") - -function(_fetch_package url archive) - file(DOWNLOAD "${url}" "${archive}" STATUS status TLS_VERIFY ON) - list(GET status 0 code) - if(NOT code EQUAL 0) - message(FATAL_ERROR "Download of ${url} failed: ${status}") - endif() -endfunction() - -_fetch_package("https://registry.npmjs.org/@xterm/xterm/-/xterm-${XTERM_VERSION}.tgz" "${work}/xterm.tgz") -_fetch_package("https://registry.npmjs.org/@xterm/addon-fit/-/addon-fit-${FIT_VERSION}.tgz" "${work}/fit.tgz") -file(ARCHIVE_EXTRACT INPUT "${work}/xterm.tgz" DESTINATION "${work}/xterm") -file(ARCHIVE_EXTRACT INPUT "${work}/fit.tgz" DESTINATION "${work}/fit") - -file(COPY_FILE "${work}/xterm/package/lib/xterm.mjs" "${destination}/xterm.mjs") -file(COPY_FILE "${work}/xterm/package/css/xterm.css" "${destination}/xterm.css") -file(COPY_FILE "${work}/xterm/package/LICENSE" "${destination}/LICENSE") -file(COPY_FILE "${work}/fit/package/lib/addon-fit.mjs" "${destination}/addon-fit.mjs") -file(COPY_FILE "${work}/fit/package/LICENSE" "${destination}/addon-fit-LICENSE") -file(WRITE "${destination}/VERSION" "@xterm/xterm ${XTERM_VERSION}\n@xterm/addon-fit ${FIT_VERSION}\n") -file(REMOVE_RECURSE "${work}") - -message(STATUS "Updated ${destination}; now run: cmake --build --target webfront-embedded-assets") diff --git a/docs/ASYNC_EXECUTION.md b/docs/ASYNC_EXECUTION.md index 518b685d..ab8aee6f 100644 --- a/docs/ASYNC_EXECUTION.md +++ b/docs/ASYNC_EXECUTION.md @@ -76,6 +76,27 @@ auto handle = app.spawn(showSquareRoot(ui)); handle.requestStop(); ``` +`ui.writesAtMost(limit)` returns a sender completing once at most `limit` frames +wait for the network on that browser's connection, woken by the write that brings +them down (no polling), or at once when the browser is gone. A closing connection +or a released link also completes it, after the closure was reported; it observes +the task's stop token. It paces output to a browser that reads slower than written. + +`app.resumeAfter(duration)` and `ui.resumeAfter(duration)` return a sender that +completes on the server context once the duration has elapsed. Awaited in a task, +it observes the task's stop token: `TaskHandle::requestStop()` or shutdown +completes it stopped at once, so a waiting coroutine never delays shutdown. +`app.subscribeUIClosed(handler)` calls the handler on the server thread when a +browser closes its connection or the connection fails (a failed write included), +for as long as the returned `UISubscription` lives; shutdown, which stops every +connection itself, notifies no handler. The connection is then released by a task +on the server context; a call made meanwhile on another thread keeps the link alive +until it returns (`findLink` shares it). Afterwards, an untyped `jsFunction` call to that UI is +dropped, a typed call returns a future that throws `Browser connection closed`, +a `jsFunctionSender` completes with an error when started, and `addScript` throws +`ConnectionError`. The 16-bit identifier of a released connection is reused only +after 65,536 later connections. + `app.spawn(task)` and `ui.spawn(task)` may be called from any thread while the application object remains alive, including concurrently with stop/shutdown. Coroutine bodies and their resumptions execute on the server context. Synchronize @@ -120,7 +141,7 @@ context. Neither sender calls nor future calls have a delivery acknowledgement for the write queue or an automatic response deadline. An unsuccessful write that does not report closure can leave a call pending until disconnection; sender waits can also be ended by task cancellation or application shutdown. -Timeout composition remains future work. +Timeout composition with `resumeAfter` remains future work. Cancellation before start sends no frame. Cancellation after dispatch stops waiting locally; JavaScript already running continues, and its late response diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 42ab1031..ab5b192d 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -36,8 +36,32 @@ end with code 1. Nothing is written (`noEmit`). Ctrl+C and the time limit terminate a running compilation after the 2 s grace period. The local registry fixture serves typescript 5.9.3 and 6.0.3, typed and `@types` packages. +- The environment's terminal (developer distribution 0.5.0, #308) becomes WebFront's complete terminal: built-in + `help`, `clear`, `history` and `exit`, streamed output, Ctrl+C for every command, per-project persistent history, + multi-line paste run line by line, multi-row redraw, CJK and emoji widths shared with xterm.js, exit codes and + completion of commands, `wf` subcommands, manifest scripts, entries, providers and project paths. + `webfront::Commands` (``) adds an application's C++ commands to it: coroutines spawned per + browser session through the bridge functions `webfront.commands.list`, `.start` and `.cancel`, streaming their + output, stopped by Ctrl+C, the browser's disconnection or shutdown; the terminal does not wait for a stopped + command; `co_await context.print(text)` waits for a slow browser. New `app.resumeAfter(duration)`/ + `ui.resumeAfter(duration)` timer sender, `app.subscribeUIClosed(handler)`, `app.connectedBrowsers()`, `UI::id()`, + `UI::pendingWrites()`, `UI::writesAtMost(limit)` (woken by the write that drains the queue), `app.findLink(id)` and + `json::Reader::array`. `cppFunction` returns false when the name was + already registered, and `hasCppFunction(name)` tells whether it is. + +### Removed + +- **Breaking:** the terminal component and the `wf` tool manager (#313): `webfront::Terminal`, `terminal::Shell`, + `webfront::ToolManager`, `fs::TerminalFS`, `fs::ToolManagerFS`, `fs::ToolStore`, `fs::PackageFS`, their embedded + modules, the embedded xterm.js copy, `third_party/xterm` and `cmake/UpdateXterm.cmake`. The developer environment's + terminal and `webfront::Commands` replace them; `docs/UI_COMPONENTS.md` describes the migration. xterm.js is a + locked dependency of the environment archive. `fs::tools::safeRelativePath` becomes `fs::safeRelativePath` + (``). + ### Changed +- **Breaking:** `BasicWF::getLink(id)`, whose reference could outlive a released connection, is replaced by + `findLink(id)`, which shares the link with the caller (null once the browser is gone). - `DeveloperBootstrapOptions::registry` is now `std::optional`: unset, the manifest's registry applies; set, it must be HTTPS or a same-origin path and takes precedence over the manifest. The environment configuration gains `registryExplicit`; earlier environments keep reading `registry`. @@ -57,6 +81,12 @@ ### Fixed +- A browser's disconnection is now reported and its connection released: `WebLink` emits its `closed` event once when + the browser closes the connection or it fails. The event was never emitted before, so nothing observed + disconnections and every closed connection (socket, buffers) stayed until the application was destroyed. `BasicWF` + now releases it by a task on the server context; afterwards untyped `jsFunction` calls to that browser are + dropped, typed ones fail and `jsFunctionSender` reports an error when started, instead of throwing + `std::out_of_range`. - Linux CEF builds: the runtime files, resources and locales are copied once per destination directory by a shared copy target, instead of by every CEF target's post-build step, which made parallel builds fail intermittently ("Error copying directory ... locales"). The destination is the target's output directory diff --git a/docs/DEVELOPER_ENVIRONMENT.md b/docs/DEVELOPER_ENVIRONMENT.md index a29c60c0..39f1c36a 100644 --- a/docs/DEVELOPER_ENVIRONMENT.md +++ b/docs/DEVELOPER_ENVIRONMENT.md @@ -332,6 +332,78 @@ wf check terminated with `worker.terminate()` after the two-second grace period. The exit code is 130 (Ctrl+C) or 124 (time limit), and the terminal stays usable. +## The terminal and the application's commands + +The terminal of the environment (developer distribution 0.5.0, #308) is the only WebFront terminal; it is served +from the environment archive with xterm.js, never from a C++ header. It runs `wf` commands, the application's C++ +commands and its own: `help`, `clear` (screen and scrollback), `history` (`history -c` clears it) and +`exit [code]`, which ends the session and closes the window; when the browser keeps a window that a script did not +open, Enter starts a new session. No system shell is exposed. + +- **Editing:** left/right, Home/End (Ctrl+A/Ctrl+E), Backspace/Delete, Ctrl+U/Ctrl+K, Ctrl+L, up/down through the + history. A line wider than the terminal wraps over several rows and is redrawn in place; a line taller than the + terminal is drawn a screen of rows at a time around the cursor, since rows that left the screen cannot be rewritten. The editor moves over + grapheme clusters: CJK characters and emoji (ZWJ sequences, flags, skin tones, presentation selector) take two + cells, combining marks none. The same widths are registered in xterm.js, so both always agree. +- **History:** kept per project in `.webfront/developer/history.json` (500 lines), restored by the next terminal. Each + line is added to the file as it is, with a conditional publication tried again on conflict, so terminals of several + pages on the same project keep each other's lines. A history file that cannot be read is never replaced. +- **Typing ahead and paste:** keys typed or pasted while a command runs are applied after it, line by line; a last + line without a line break waits on the prompt. Ctrl+C drops the keys still waiting. +- **Completion (Tab):** command names, `wf` subcommands, the manifest's scripts after `wf run`, its entries and + providers after `wf preview` and `wf embed`, and project paths, also when the word is escaped (`my\ dir/`) or + quoted (`"my dir/`); the completion is written the same way and closes the quote. Several candidates are completed + to their common prefix, or listed. +- **Exit codes:** a failed command prints `Error: `, with `(exit code N)` when N is not 1. Ctrl+C gives 130. +- **Output streams** while a command runs, for `wf` and C++ commands alike, without a size limit: C++ output is + sent in pieces below the 65,535-byte limit of bridge strings. + +An application adds its own commands with `webfront::Commands` (``), which replaces +`terminal::Shell` of the removed terminal component ([migration](UI_COMPONENTS.md)). A command is a coroutine: + +```cpp +#include + +webfront::NativeApp app{projectDirectory}; +webfront::Commands commands{app}; +commands.add("count", "Count to N, once a second", [](webfront::Commands::Context context) -> webfront::Task { + using namespace std::chrono_literals; + for (int i = 1; i <= std::stoi(context.args().at(0)); ++i) { + co_await context.print(std::to_string(i) + "\n"); + co_await context.ui().resumeAfter(1s); + } +}); +app.bootstrap("developer"); +app.show(); +``` + +The terminal discovers the commands through the bridge (`webfront.commands.list`) and runs each one in the session +of its browser with `webfront.commands.start`. In C++, the command is spawned like `ui.spawn` on the server thread: + +- `context.write(text)` streams output with fire-and-forget calls; `co_await context.print(text)` sends it piece by + piece and, after each piece, suspends the command while more than 32 frames wait for a browser that reads slower + (`ui.writesAtMost`, woken by the write that drains the queue); each wait is a point where Ctrl+C stops it. + `context.args()` holds the words after the command name, split like a shell line; `context.exit(code)` sets the + exit code. A command that returns once asked to stop reports 130, whatever it returned. +- Ctrl+C sends `webfront.commands.cancel`: the command's stop token is requested, which the senders it awaits + observe (`ui.resumeAfter`, `ui.jsFunctionSender`, ...); loops check `context.stopRequested()`. The terminal does + not wait for the command to end: the prompt returns at once and the next command runs, while the first one + unwinds. Its late output and exit report are ignored. +- The browser's disconnection stops its commands, and the application's shutdown drains them with its other tasks. + In the terminal, a command whose connection closes ends at once with an error (exit code 1): its exit report can + no longer arrive. +- An exception thrown by a command is printed as an error, with exit code 1. +- Each connected browser has its own session: a command in one browser neither delays nor is stopped by another. +- A command must not block the server thread, which serves every browser: a handler that does not return + `webfront::Task` does not compile. Long computations belong on another thread. + +A second `webfront::Commands` on the same application throws `std::logic_error` and registers nothing. A copy of a +`Context` may outlive its command (a detached task): its stop token stays valid and its writes are dropped once the +browser is gone. The names `wf`, `clear`, `exit`, +`help` and `history` are reserved. `context.write` has no flow control: a command +writing large output with it, faster than the browser reads, grows the connection's write queue; use +`context.print` for such output. + ## Dependencies, storage and limitations - `wf install` accepts exact versions, registry tags and semver ranges, resolves ordinary @@ -348,8 +420,7 @@ wf check Preview/embed consume the locked local files without resolving versions again. - Unpacked packages are cached by name, version and integrity under `.webfront/developer/packages/`, each with a record of its files' digests. A failed install can leave unused cached packages, but the lock - file remains unchanged. A lock naming more than 512 packages is refused. The tools - installed by the existing `ToolManager` keep their separate store and `webfront-tools.lock.json`. + file remains unchanged. A lock naming more than 512 packages is refused. - Published environment/preview resources are served under `/webfront/developer/`. The protected `/WebFront.js` remains the library's version. Sources, staging and cached archives are not HTTP routes. Project reads and publications reject traversal and escaping symlinks. This does not diff --git a/docs/EMBEDDED_ASSETS.md b/docs/EMBEDDED_ASSETS.md index b11c10a3..de417a1f 100644 --- a/docs/EMBEDDED_ASSETS.md +++ b/docs/EMBEDDED_ASSETS.md @@ -25,7 +25,9 @@ Babel is served at `/babel-standalone@8.0.7/babel.min.js`. Jasmine 7 boots its globals from `jasmine.js`; its single `boot.js` installs the HTML reporter and starts the suite on window load. The runner serves `/jasmine/7.0.2/` and awaits the final C++ reporting Promise. The favicon is served as its original PNG, without an extra gzip layer. -The terminal keeps its existing `webfront/components/terminal/` URLs and MIME types. +xterm.js and its fit addon are no longer embedded: they are locked dependencies +(`js/developer/vendor/package.json`) bundled into the developer environment archive by +`js/developer/tools/build.mjs`. ## Maintenance @@ -37,8 +39,6 @@ Run from the repository root: # Online, maintenance only: exact versions and transitive integrity hashes are in package-lock.json. npm ci --prefix js/developer/vendor --ignore-scripts node js/developer/vendor/update.mjs -# Refresh xterm only through its dedicated script, retaining readable upstream files and licenses. -cmake -DXTERM_VERSION=6.0.0 -DFIT_VERSION=0.11.0 -P cmake/UpdateXterm.cmake # Offline after C++ dependencies are configured; npm/node_modules is not required here. cmake --build build --target webfront-embedded-assets @@ -49,9 +49,8 @@ ctest --test-dir build -R 'Asset.*Fresh|EmbeddedGzipContents|EmbeddedAssetGenera `package-lock.json` pins the npm tarball URLs, integrity hashes, scheduler 0.28.0 and esbuild 0.28.2. When upgrading, recheck the registry's stable tags, update exact versions and the lockfile, then review sources, routes, tests, version inventory and size measurements together. -`cmake/UpdateXterm.cmake` takes exact versions explicitly and records them in -`third_party/xterm/VERSION`. `js/developer/vendor/update.mjs` records the other versions alongside -their distribution files in `third_party/`. +`js/developer/vendor/update.mjs` records the versions alongside their distribution files in +`third_party/`. `js/core/EmbedTextAsset.cmake` delegates rendering and exact byte comparison to `js/developer/vendor/embed.mjs`. It assembles bounded lines of five 64-bit words and joins them diff --git a/docs/PROJECT_STATUS.md b/docs/PROJECT_STATUS.md index 9d90807b..4f456561 100644 --- a/docs/PROJECT_STATUS.md +++ b/docs/PROJECT_STATUS.md @@ -128,7 +128,9 @@ Status snapshot: 2026-07-19. Optional mddlog integration note: 2026-10-02. Newco dependencies. `wf check` (#322) type-checks with the locked `typescript` 5.x/6.x in a Worker, over a bounded in-memory snapshot. `wf run`/`wf exec` (#307) run WebFront scripts in a Worker under the manifest permissions, which frame the `context` API only and are not a sandbox. Peers require explicit compatible roots/direct - dependencies. Automatic rebuild/watch is future work. `wf restore [--offline]` (0.5.0, #306) rebuilds or checks + dependencies. The environment's terminal (#308) runs `wf`, built-in and C++ commands (`webfront::Commands`: + per-browser coroutine sessions, streamed output, Ctrl+C cancellation without waiting, drained at shutdown) with + multi-row editing, CJK/emoji widths, persistent history and completion. Automatic rebuild/watch is future work. `wf restore [--offline]` (0.5.0, #306) rebuilds or checks the cache from the lock, from the application's registry option, else the manifest's, else npmjs. See [DEVELOPER_ENVIRONMENT](DEVELOPER_ENVIRONMENT.md) for exact commands and limits. @@ -316,15 +318,11 @@ See [WebKitGTK notes](WEBKITGTK.md). ## UI components: the terminal and the tool manager -- First opt-in UI component (#230), designed in [UI_COMPONENTS.md](UI_COMPONENTS.md): `webfront::Terminal` (`include/webfront/components/Terminal.hpp`) registers C++ commands behind an embedded xterm.js 6.0.0 terminal (`fs::TerminalFS`, served under `webfront/components/terminal/`; composed with `fs::DefaultFSWith<>`). The standalone terminal target was removed in 0.4; see the component API example in [UI_COMPONENTS.md](UI_COMPONENTS.md). The bridge protocol is unchanged. -- Line editing, history and Tab completion run in the browser; C++ receives whole lines and returns the output as the Promise result. A command exception rejects the Promise and is printed as an error. Output is capped at 60000 bytes because bridge strings carry a 16-bit length. -- Covered by Catch2 (`TerminalTests.cpp`, `TerminalFSTests.cpp`), five asset freshness CTest cases and Jasmine specs (`test/web/js/terminal-specs.mjs`) in the browser integration test. -- Verified 2026-10-14 on Linux (GCC 16.1, Unix Makefiles generator): CEF-off build with all 100 CTest cases passing; the example driven in headless Chromium (commands, errors, quoting, completion, history, `help`, `clear`); and the Jasmine suite, terminal specs included, run in headless Chromium through a scratch copy of the runner that replaces `CEFFrontend`. A deliberately broken terminal spec made that run fail. **Not verified:** the CEF/Xvfb CTest itself, Windows, macOS and Clang. -- Limitations: no output streaming, no cancellation, no per-browser sessions, and single-row line redraw (see the design note). -- The `wf` tool manager (#234, npm-hosted web tools installed during debugging): `webfront::ToolManager` (`include/webfront/components/ToolManager.hpp`) stores tools with `fs::ToolStore` under `.webfront/tools/`, records them in `webfront-tools.lock.json`, serves them with `fs::PackageFS` under `webfront/tools/` and runs `wf list`, `wf remove` and `wf help` in C++. `wf search`, `wf install` and `wf open` run in the page, in `wf.mjs` (`js/developer/components/tools/`, served by `fs::ToolManagerFS`), a terminal extension module loaded through the new `Terminal::extension()`: it fetches the packument and tarball, checks the SHA-512 `dist.integrity` with `crypto.subtle`, gunzips with `DecompressionStream`, reads the ustar archive (pax and prefixed paths included) and sends the files in 256 KiB chunks through `webfront.pkg.*`, after refusing archives unpacking to more than 256 MiB. Ctrl+C interrupts it through the `signal` the terminal passes to browser commands. The registry is set by `ToolManagerOptions::registry`. The standalone tools target was removed in 0.4; the component remains documented in [UI_COMPONENTS.md](UI_COMPONENTS.md). Covered by `ToolStoreTests.cpp`, `ToolManagerTests.cpp`, `TerminalTests.cpp` and the Jasmine specs `test/web/js/tools-specs.mjs`, which install a fixture package from a fake registry served by the test (`test/web/registry/`, regenerated by `make_fixture.py`) into a temporary directory. -- Verified 2026-10-15 on macOS (Apple clang, CEF off): all CTest cases pass except `AddSubdirectoryConsumer`, which fails locally because of the outdated libc++ headers of the Command Line Tools; the Jasmine suite, tools specs included, run in Chromium through a scratch copy of the runner that replaces `CEFFrontend` (one terminal spec, "reports an application without terminal functions", fails there as it does on develop, because that browser gave its unsized terminal a two-column width); `WebFrontTools` driven against registry.npmjs.org (`wf help`, `wf search`, `wf list`, `wf install left-pad` downloaded, verified and refused as not a tool). **Not verified locally:** the CEF/Xvfb CTest (Linux only; the macOS CEF build of `webtest` fails inside stdexec), Windows. -- Limitations of the tool manager: no semver ranges (an exact version or a dist-tag), no dependencies (a tool must bundle what it uses), no progress bar beyond step messages, sequential chunk uploads, and the trust model of `npm install`. -- Found while building it: the C++ encoder wrapped the 16-bit length of strings over 65535 bytes (#231, fixed: such strings now fail explicitly, see "Implemented baseline"); `MimeType::toString()` mapped `csv` to `text/css` (#232, fixed: a `static_assert` now ties the name table to the enum); with GCC 16.1 and the Ninja generator, CMake's module dependency scanning (`-fmodules-ts`) crashes the compiler inside stdexec, while Unix Makefiles builds work. +- Removed (#313, with #308): `webfront::Terminal`, `webfront::ToolManager`, `fs::TerminalFS`, `fs::ToolManagerFS`, + `fs::ToolStore`, `fs::PackageFS`, their embedded modules and xterm.js headers, `third_party/xterm` and + `cmake/UpdateXterm.cmake`, with their Catch2 and Jasmine tests and the fake tool registry. The environment's + terminal and `webfront::Commands` replace them ([UI_COMPONENTS.md](UI_COMPONENTS.md) has the migration); + `fs::safeRelativePath` moved to `SafePath.hpp`, the tarball helpers of `wf.mjs` to `js/developer/environment/tarball.mjs`. ## Intended product @@ -453,6 +451,7 @@ Local verification on 2026-07-19 completed successfully: the CEF-off build passe - Result values are currently limited to the bridge's existing scalar, string, tuple, numeric typed-array and packed bitset parameter types; richer object/DOM values remain out of scope. - `webfront::Task`, `app.spawn(task)`/`ui.spawn(task)` and per-task `TaskHandle::requestStop()` provide application-owned coroutine lifetime without exposing an execution context. The compiled `WebFrontAwaitBrowser` example matches the README; `app.shutdown()` stops and joins before returning; spawn is callable from any thread while the application lives and returns a stopped handle if shutdown rejects it. Destruction keeps owners alive and logs/waits if an external operation delays the join, whereas explicit shutdown reports absent context progress. - `ui.jsFunctionSender(name)(...)` (default `R = void`) adds lazy, awaitable typed calls, with value/error/stopped completion and local receiver-token cancellation. Futures and JavaScript Promises remain supported without cancellation. JavaScript already dispatched continues; late replies are discarded. See [execution design](ASYNC_EXECUTION.md). +- Terminal commands (`webfront::Commands`) stream output with fire-and-forget calls: `context.write` has no flow control, `co_await context.print` waits, without polling, while the browser has more than 32 frames to read. - Repeated cancellation of JavaScript functions that never respond reserves their 16-bit IDs until disconnection. Enough such calls exhaust IDs and subsequent calls fail with `Too many outstanding WebFront calls`. Calls have no automatic timeout or per-write delivery acknowledgement. - Server-owned counting scopes track HTTP, WebSocket and application operations through destruction. Shutdown drains until scope join completes, independently of unrelated context work. Regression tests cover pending reads, connection lifetime, sender errors, cancellation and result/stop races; the shared Jasmine suite exercises sender value/void/error and late-result cancellation. - Ordinary JavaScript arrays encode as tuple-like parameters; only numeric typed arrays use the homogeneous array wire representation. diff --git a/docs/UI_COMPONENTS.md b/docs/UI_COMPONENTS.md index 50980a5c..31361f11 100644 --- a/docs/UI_COMPONENTS.md +++ b/docs/UI_COMPONENTS.md @@ -1,275 +1,43 @@ # UI components -Status: design note, 2026-10-15. Stage 1 (the terminal component, #230) and stage 2 (the `wf` tool -manager, #234) are implemented. +Status: removed (#313, delivered with #308). The opt-in terminal component (`webfront::Terminal`, +`fs::TerminalFS`, #230) and the `wf` tool manager (`webfront::ToolManager`, `fs::ToolStore`, +`fs::PackageFS`, `fs::ToolManagerFS`, #234) are gone, with their embedded xterm.js copy. Their design +notes remain in the Git history of this file. -WebFront's core is a server and a bridge. A *UI component* is a reusable piece of browser UI with a -C++ façade, packaged so that an application gets it from a header include. The first component is an -interactive terminal: it is useful on its own (a command-line interface to a C++ application) and is -the host for the planned tool manager. +They are replaced by the developer environment, downloaded and verified by +`NativeApp::bootstrap("developer")` ([DEVELOPER_ENVIRONMENT](DEVELOPER_ENVIRONMENT.md)): -## Anatomy of a component - -A component has four parts. - -| Part | Rule | Terminal | -| --- | --- | --- | -| Assets | An embedded `fs::Provider` serving under the reserved prefix `webfront/components//`, so it never collides with a development document root or the application's own pages. Readable sources live in `js/developer/components//`, third-party code in `third_party/`, and generated headers are checked in and kept fresh by CTest, like `WebFront.js`. | `fs::TerminalFS` (`include/webfront/system/TerminalFS.hpp`) | -| Browser module | A native ES module exporting `mount(element, options)`. It depends only on the global `webFront` bridge and its own assets (relative imports), and waits for `webFront.ready`. | `js/developer/components/terminal/terminal.mjs` | -| C++ façade | A header under `include/webfront/components/` that registers its bridge functions under `webfront..`. `BasicWF::cppFunction` ignores a second registration of the same name, so the prefix is what keeps components and applications apart. | `webfront::Terminal` (`include/webfront/components/Terminal.hpp`) | -| Wire format | Only the existing bridge types: scalars, strings (at most 65535 bytes), tuples and numeric typed arrays. Lists of words cross as `"\n"`-separated strings. A component never changes `Messages.hpp` or `WebFront.js`. | `run(line) -> output`, `complete(line) -> candidates` | - -Assets are added to an application through its filesystem type. `fs::DefaultFSWith` is -`fs::DefaultFS` with extra providers placed after the protected `WebFront.js` and before the -document root, so a development root can neither replace the bridge nor shadow a component file: - -```cpp -using TerminalApp = webfront::BasicWF>; -``` - -Components are opt-in. `webfront::WebFront` does not include their assets, so its binary does not -grow, and `#include ` alone does not pull them in. - -## The terminal component - -```cpp -#include -#include - -int main() { - webfront::TerminalApp app; - webfront::Terminal terminal{app, {.prompt = "demo> "}}; - terminal.command("greet", "Greet someone", [](webfront::CommandArgs args) { - return "Hello, " + (args.empty() ? std::string{"world"} : args[0]) + "!"; - }); - app.show(terminal.page); -} -``` - -The snippet above shows the standalone component API. The [Life walkthrough](../README.md#game-of-life-from-console-to-native-application) demonstrates the downloaded developer terminal. - -- **Rendering:** [xterm.js](https://xtermjs.org/) 6.0.0 and its fit addon 0.11.0 (MIT; the terminal used by - VS Code, Tabby and Hyper), vendored verbatim in `third_party/xterm/` and embedded as reproducible gzip (95,272 bytes including word padding). - See [embedded asset maintenance](EMBEDDED_ASSETS.md) for pinned sources, licenses and regeneration commands. - ghostty-web, Ghostty's emulator compiled to WebAssembly with an xterm-compatible API, was - considered and set aside for now: it is under heavy development and supports Chrome only. -- **Line editing happens in the browser.** The editor in `terminal.mjs` handles insertion, left and - right, Home and End (also Ctrl+A and Ctrl+E), Backspace and Delete, Ctrl+U, history (up and down), - Tab completion of command names, Ctrl+C (cancel the line) and Ctrl+L (clear the screen). C++ - only receives validated lines, one at a time. The prompt stays locked until the Promise for the - line settles. -- **Commands** are registered by name with a help text and a handler of one of three shapes: - `(CommandArgs, std::ostream&)`, `(CommandArgs) -> R` or `() -> R`, where `R` is `void` or anything - that can be written to a `std::ostream`. `CommandArgs` is a `std::span` - without the command name. The line is split shell-style: single quotes are literal, double quotes - honor backslash escapes, and an unquoted backslash escapes the next character. `help` and `clear` - are built in. Duplicate, empty or whitespace-containing names throw `std::invalid_argument`. -- **Output and errors:** the command output is the Promise result, with `"\n"` converted to - `"\r\n"` and ANSI escape sequences passed through. An unknown command or a malformed line prints - a red message. An exception thrown by a command rejects the Promise, and the page prints - `Error: `. Output and error messages (which may quote the line) are capped at 60000 bytes, cut on a UTF-8 character boundary, with a - notice, because bridge strings carry a 16-bit length. -- **Lifetime and threads:** the registered bridge functions share ownership of the command - registry, so the `Terminal` object may go out of scope before the application. The registry is - guarded by a mutex: commands may be added while the server thread runs others, and commands run - on the server thread. - -### Limitations of the first version - -- Output appears when a command finishes. There is no streaming. A long command keeps the prompt - locked; Ctrl+C interrupts a browser command (below) but not a C++ one. -- Every connected browser shares the same commands. The terminal does not know which browser sent - a line. -- The line editor redraws within one terminal row, so a line wider than the terminal displays - incorrectly. Wide (CJK) characters count as one column. -- There is no `exit` command. With the system browser, `show()` waits for Enter on standard input, - and stopping the server from inside a command would drop the reply to that command. -- A multi-line paste runs its first line only. - -### Browser commands: terminal extensions - -Some commands must run in the page, such as a download over HTTPS. `Terminal::extension(url)` adds -a browser module that the page imports before it shows the prompt (the URLs are read from -`webfront.terminal.extensions()`). The module may export `commands`, an object mapping a command -name to `async (args, context) => output`. The page splits each line like C++ (`tokenize` in -`terminal.mjs`); when its first word names a browser command, the handler runs first. `context` -holds `line`, `bridge`, `write(text)` for progress output, `runInCpp()` and `signal`, an -`AbortSignal` that Ctrl+C aborts with the reason `Error("Interrupted")`. A handler returning -`undefined` lets C++ run the line, so one command can be split between the page and C++, as `wf` -is. A module that fails to load is reported in red and the terminal stays usable. - -## Core gaps found by the terminal - -These belong to the core, not to the component. Stage 1 did not change them; the first two are -now resolved: - -1. `onUIStarted` keeps a single handler, which a component would replace. Resolved by #233: - components call `subscribeUIStarted(handler)` and keep the returned `UISubscription`. -2. A `cppFunction` callback did not know which `UI` called it. Resolved by #233: a callback whose - first parameter is the application's `UI` receives the calling browser, so a component can answer - later or stream to it. -3. Outstanding calls cannot be cancelled (already listed in `PROJECT_STATUS.md`). -4. Bridge strings are limited to 65535 bytes. Until #231 the C++ encoder wrapped longer lengths and - corrupted the message; it now rejects them (the JavaScript encoder always did). The terminal caps - its output and error messages below that limit so they are shown rather than rejected. - -## Stage 2 design: the `wf` tool manager (#234) - -Goal: install web-based development tools (log viewers, memory or protocol inspectors, plotters…) -into a WebFront application while debugging it, the way `npm install` adds a package. - -### Packages - -A tool is an ordinary npm package whose `package.json` has a `webfront` field and the -`webfront-tool` keyword: - -```json -{ - "name": "@acme/webfront-plot", - "version": "1.2.0", - "keywords": ["webfront-tool"], - "webfront": { "kind": "tool", "title": "Live plot", "entry": "dist/index.html" } -} -``` - -Reusing npm provides hosting, versioning, `dist.integrity` hashes and search without running a -registry. - -### Commands - -`wf` is a terminal command, plus browser-side code for the network part (`wf.mjs`, a terminal -extension). `wf search`, `wf install` and `wf open` run in the page; `wf list`, `wf remove` and -`wf help` in C++: - -| Command | Effect | +| Removed | Replacement | | --- | --- | -| `wf search ` | npm search API restricted to `keywords:webfront-tool` | -| `wf install [@version]` | Download, verify, unpack, store, record in the lock file | -| `wf list` | Installed tools with version and title | -| `wf remove ` | Delete the tool's files and lock entry | -| `wf open ` | Open `webfront/tools//` in a new tab or window | - -### Installation flow - -The download runs in the browser, which already speaks HTTPS. This keeps TLS out of the -header-only C++ library. - -1. The browser fetches the packument from `registry.npmjs.org/` (CORS-enabled) and resolves - the version. -2. It downloads the tarball, then checks `dist.integrity` (SHA-512) with `crypto.subtle`. -3. It gunzips with `DecompressionStream("gzip")`, refusing more than 256 MiB of output, and reads the archive with a small ustar reader - (about 60 lines). -4. It calls `webfront.pkg.begin(pkg, version)`, then for each file - `webfront.pkg.writeFile(pkg, version, path, offset, Uint8Array)`. Files are sent in 256 KiB - chunks; typed arrays already cross the bridge. Progress is shown in - the browser, so no C++ push is needed. -5. C++ rejects absolute paths, empty, `.` and `..` components, backslashes, and the characters Windows forbids in file names, and a chunk - whose offset does not follow the bytes already written. Files are staged under - `/.webfront/tools/.staging/`, in a directory of their own for each installation in - progress, so versions differing only by case never share staged files. -6. `webfront.pkg.commit(pkg, version, integrity, entry, title)` checks that the entry page was - written, moves the staged files to `/.webfront/tools/@/`, replacing any - installed version, and records the tool in `/webfront-tools.lock.json`. A failed or - abandoned installation leaves the installed version untouched. -7. `fs::PackageFS` serves `webfront/tools//…` from the versions recorded in the lock file, - which it reads on each request. The prefix stays inside the reserved `webfront/` namespace, so a - tool never collides with the application's pages. +| `webfront::Terminal` page and its line editor | The environment's terminal: streaming, Ctrl+C for every command, per-browser sessions, multi-row redraw, CJK and emoji widths, history, completion | +| `terminal::Shell` and `Terminal::command` | `webfront::Commands` (``): coroutine commands, discovered by the environment | +| `Terminal::extension` browser commands | `wf run` scripts and `wf exec` package entries | +| `ToolManager`, `wf install/list/remove/open` of tools | `wf install` and `wf restore` of npm packages, locked by `webfront-packages.lock.json` | -### Browser side (implemented) +## Migrating `terminal::Shell` commands -`js/developer/components/tools/wf.mjs` is served by `fs::ToolManagerFS` at -`webfront/components/tools/wf.mjs` and added to the terminal by `ToolManager`. Besides the -`commands` it exports `search`, `install`, `installed`, `open`, `readTar`, `gunzip`, -`verifyIntegrity` and `parseSpec`, so other pages can use them. - -- The registry comes from `webfront.pkg.registry()`, which returns `ToolManagerOptions::registry` - (`https://registry.npmjs.org/` by default; a relative URL is resolved against the page). It must - allow CORS requests from the application's page. -- A version is an exact version or a dist-tag (`latest` by default); ranges are not resolved. -- Only SHA-512 integrities are accepted. `crypto.subtle` needs a secure context, which - `http://localhost` is. -- The reader accepts ustar headers (with the `prefix` field), pax extended headers (`path`) and GNU - long names, checks each header's checksum and keeps regular files only. The first path component - (`package/`) is removed, as npm does. -- The archive's `package.json` must name the requested package and version and have a `webfront` - field with `kind: "tool"` and an `entry` present in the archive; the title defaults to the name. -- Files are sent in 256 KiB chunks, one call at a time, so C++ sees every chunk in order. The - browser sends such a call in several WebSocket frames, which the server reassembles. -- Ctrl+C aborts the downloads and stops the upload before the next chunk; the installation is then - not committed. -- `wf open` finds the tool in `webfront.pkg.list()` and calls `window.open(url, "_blank")`; when the - browser blocks the window, it prints the URL instead. - -The browser integration test serves a fake registry: packuments and a fixture tarball in -`test/web/registry/` (regenerated by `make_fixture.py`, which also writes a packument with a wrong -integrity), and a search endpoint answered by the test. Tools are installed into a temporary -directory, never into the source tree. - -### C++ side (implemented) +A command of the removed component returned its output once it ended, on the server thread: ```cpp -#include - -webfront::ToolsApp app; // DefaultFSWith -webfront::Terminal terminal{app}; -webfront::ToolManager tools{app, terminal}; // adds 'wf' and the webfront.pkg.* functions +terminal.command("greet", "Greet someone", [](webfront::CommandArgs args) { + return "Hello, " + (args.empty() ? std::string{"world"} : args[0]) + "!"; +}); ``` -- `fs::ToolStore` (`include/webfront/system/ToolStore.hpp`, with the small JSON reader of `include/webfront/utils/Json.hpp`) validates npm names (`@scope/` allowed), - versions and paths, stages and commits installations, and reads and writes the lock file through - a temporary file renamed over it. The lock file is read strictly, and a record whose name, - version or entry could leave the tools directory is rejected. Names, versions and paths may not - contain `..` anywhere, because the HTTP server rejects such URLs, and titles and integrities may not - contain control characters, which would break the `webfront.pkg.list()` format, nor exceed 1024 - bytes, so that every line fits in a list page. Stores of the same project share one lock and one - set of pending installations within the process; versions differing only by case, which name the - same directory on a case-insensitive volume, replace each other without losing files. Once the lock file - is written, a directory that cannot be deleted is left behind instead of failing the operation. -- `fs::BasicPackageFS` (`include/webfront/system/PackageFS.hpp`) takes the project directory from - `Location::get()`; `fs::PackageFS` uses the working directory at startup (`fs::CurrentDirectory`). - `ToolManager` must use the same `Location`. -- `webfront.pkg.list(first)` returns the `name\tversion\tentry URL\ttitle` lines of the tools from - index `first`, as many as fit below the bridge's string limit, for `wf open`; the page calls it again - from the next index until it gets an empty string. The URL is absolute and percent-encoded, so every accepted file name reaches `PackageFS`. -- The registered functions share ownership of the store, so a `ToolManager` may be destroyed before - the application. - -The lock file is meant to be committed with the project, the `.webfront/` directory is not: +With `webfront::Commands`, it is a coroutine that streams its output and can be stopped: -```json -{ - "lockfileVersion": 1, - "tools": { - "@acme/webfront-plot": { - "version": "1.2.0", - "integrity": "sha512-…", - "entry": "dist/index.html", - "title": "Live plot" - } - } -} +```cpp +webfront::Commands commands{app}; +commands.add("greet", "Greet someone", [](webfront::Commands::Context context) -> webfront::Task { + context.write("Hello, " + (context.args().empty() ? std::string{"world"} : context.args()[0]) + "!\n"); + co_return; +}); ``` -### Security - -An installed tool runs in the application's origin and can call every registered C++ function. The -trust model is therefore that of `npm install`: only install tools you trust, and only during -development. A later step can serve tools from a separate origin (another port) with an allow-list of -callable functions. The tool manager is a development feature, like a document root, not a -production plugin system. - -### Prerequisites - -- Core gaps 1 and 2 above, for progress and output streaming initiated by C++ (done in #233). -- A filesystem provider writing outside the build tree, with tests using temporary directories. -- Browser tests that use a local fake registry: tests must not need the public network (done: - `test/web/js/tools-specs.mjs`). - -## Browser-powered developer environment - -The opt-in `NativeApp` bootstrap extends this architecture with a downloaded environment rather -than embedding xterm/compiler/framework assets. It installs ordinary npm libraries into a separate -store, builds TSX in a browser Worker and generates application-owned filesystem providers. -The existing terminal/ToolManager APIs and their prebundled tool format remain supported. -See [the developer environment](DEVELOPER_ENVIRONMENT.md) for the API, provisioning, Game of Life walkthrough, -trust boundary and offline tests. The browser installer is intentionally not the complete npm CLI. +- `CommandArgs` becomes `context.args()`; the `std::ostream&` output becomes `context.write(text)`, or + `co_await context.print(text)` for large output; `"\n"` ends a line. +- An exception is still shown as an error; `context.exit(code)` sets a non-zero exit code. +- A command must not block the server thread: long work awaits senders (`context.ui().resumeAfter`, + `jsFunctionSender`) or runs on another thread. Ctrl+C, the browser's disconnection and shutdown stop it. +- `help`, `clear`, `history` and `exit` are built into the terminal; their names are reserved. diff --git a/docs/adr/ADR-002-systemes-de-fichiers-composables.md b/docs/adr/ADR-002-systemes-de-fichiers-composables.md index 7a817ce2..0a46273d 100644 --- a/docs/adr/ADR-002-systemes-de-fichiers-composables.md +++ b/docs/adr/ADR-002-systemes-de-fichiers-composables.md @@ -63,9 +63,9 @@ la racine de développement optionnelle, puis la page de repli embarquée d’`I `fs::DefaultFSWith` place les providers supplémentaires entre le bridge protégé et la racine locale. Sans `documentRoot`, le provider local ne touche pas au disque. -Les espaces réservés `webfront/components//` et `webfront/tools//` séparent les -ressources réutilisables des pages applicatives. `PackageFS` ne sert que les installations -référencées par le store (ADR-010). Les fichiers natifs de développement et `NativeDebugFS` +Les espaces réservés `webfront/components//` et `webfront/tools//` séparaient les +ressources réutilisables des pages applicatives ; `PackageFS` et les composants qui les servaient +sont retirés (ADR-010 v1.7), l'environnement développeur sert les siennes sous `webfront/developer/`. Les fichiers natifs de développement et `NativeDebugFS` ne constituent pas un sandbox de production. ## Orientation embarquée, Yocto et mobile diff --git a/docs/adr/ADR-010-composants-et-outils-optionnels.md b/docs/adr/ADR-010-composants-et-outils-optionnels.md index 80941db4..50104a1d 100644 --- a/docs/adr/ADR-010-composants-et-outils-optionnels.md +++ b/docs/adr/ADR-010-composants-et-outils-optionnels.md @@ -11,11 +11,13 @@ | 1.4 | 2026-10-15 | Acceptée | Ambroise Leclerc | Validation des outils avec un registre local factice. | [d53ffcc](https://github.com/ambroise-leclerc/WebFront/commit/d53ffcc40102c7405eb7060d7021aad366d6d7e9) | | 1.5 | 2026-10-16 | Acceptée | Ambroise Leclerc | Interruption des commandes navigateur et transferts séquentiels par blocs de 256 KiB. | [c81f7f7](https://github.com/ambroise-leclerc/WebFront/commit/c81f7f74728ad24a53c16f907e016eb0fe1b8bce) | | 1.6 | 2026-10-22 | Acceptée | Ambroise Leclerc | Trajectoire de retrait de Terminal.hpp, ToolManager.hpp, ToolStore et PackageFS au profit de l'environnement bootstrap (ADR-016). | [404fed2](https://github.com/ambroise-leclerc/WebFront/commit/404fed2c2145d4faba8efee035e10522ff87a91f) | +| 1.7 | 2026-10-23 | Acceptée | Ambroise Leclerc | Retrait effectué (#313) : le terminal de l'environnement et `webfront::Commands` remplacent le composant terminal et le gestionnaire d'outils. | [PR #331](https://github.com/ambroise-leclerc/WebFront/pull/331) | ## État et chronologie **Acceptée.** Décision initiale : **2026-10-14** (version 1.0). -Dernière révision : **2026-10-22** (version 1.6). +Dernière révision : **2026-10-23** (version 1.7) : le terminal et les outils relèvent désormais +d'[ADR-016](ADR-016-bootstrap-comme-socle.md). Le présent texte expose la décision en vigueur ; le tableau retrace ses états antérieurs. ## Contexte @@ -68,9 +70,9 @@ l’autorité du bridge de l’application ; c’est une fonction de développem ### Révision de l'ADR-016 `Terminal.hpp`, `ToolManager.hpp`, `ToolStore`, `PackageFS`, `TerminalFS`, `ToolManagerFS` et xterm -embarqué sont voués au retrait (#313) : le terminal et le `wf` de l'environnement téléchargé -([ADR-016](ADR-016-bootstrap-comme-socle.md)) les remplacent. Ils restent fonctionnels et testés -tant que l'équivalent n'est pas couvert ; aucune nouvelle fonctionnalité ne leur est ajoutée. +embarqué sont retirés (#313, version 1.7) : le terminal et le `wf` de l'environnement téléchargé +([ADR-016](ADR-016-bootstrap-comme-socle.md)) les remplacent, et `webfront::Commands` remplace +`terminal::Shell` pour les commandes C++ de l'application. Les abonnements UI multiples et l'injection du navigateur appelant demeurent des contrats du cœur. ## Prescriptions d’implémentation et de génération de code @@ -87,8 +89,8 @@ Les abonnements UI multiples et l'injection du navigateur appelant demeurent des ## Sources et vérification -- [Architecture des composants et limites](../UI_COMPONENTS.md), - [Terminal](../../include/webfront/components/Terminal.hpp), [ToolManager](../../include/webfront/components/ToolManager.hpp). +- [Retrait et migration](../UI_COMPONENTS.md), [Commands](../../include/webfront/Commands.hpp) ; le composant + retiré reste lisible dans l'historique Git. - Tests : [UISubscribersTests](../../test/unit/UISubscribersTests.cpp), - [ToolStoreTests](../../test/unit/ToolStoreTests.cpp), [tools-specs](../../test/web/js/tools-specs.mjs). + [CommandsTests](../../test/unit/CommandsTests.cpp), [developer-specs](../../test/web/developer-specs.mjs). - Voir [ADR-002](ADR-002-systemes-de-fichiers-composables.md), [ADR-008](ADR-008-contenu-de-confiance-et-origines.md) et [ADR-016](ADR-016-bootstrap-comme-socle.md). diff --git a/docs/adr/ADR-016-bootstrap-comme-socle.md b/docs/adr/ADR-016-bootstrap-comme-socle.md index 03e75890..ea5862da 100644 --- a/docs/adr/ADR-016-bootstrap-comme-socle.md +++ b/docs/adr/ADR-016-bootstrap-comme-socle.md @@ -100,9 +100,9 @@ développeur ni outillage. L'outillage de construction n'est jamais embarqué da - **[ADR-009](ADR-009-modules-et-assets-reproductibles.md)** (v2.1) : les assets embarqués sont limités à la liste normative ; `BabelFS`, `ReactFS`, `JasmineFS` et leurs sources vendorisées sont retirés (#312, #319). Les tests migrent vers `wf test` (#311). -- **[ADR-010](ADR-010-composants-et-outils-optionnels.md)** (v1.6) : `Terminal.hpp`, +- **[ADR-010](ADR-010-composants-et-outils-optionnels.md)** (v1.7) : `Terminal.hpp`, `ToolManager.hpp`, `ToolStore`, `PackageFS`, `TerminalFS`, `ToolManagerFS` et xterm embarqué - sont retirés (#313). Le terminal et `wf` de l'environnement téléchargé les remplacent ; les + sont retirés (#313, effectué). Le terminal et `wf` de l'environnement téléchargé les remplacent ; les abonnements UI multiples et l'injection du navigateur appelant restent des contrats du cœur. - **[ADR-013](ADR-013-bootstrap-developpeur-a-la-demande.md), [ADR-014](ADR-014-construction-javascript-dans-le-browser.md), diff --git a/docs/adr/README.md b/docs/adr/README.md index b17eee03..48b8ed57 100644 --- a/docs/adr/README.md +++ b/docs/adr/README.md @@ -49,7 +49,7 @@ verification evidence remain in [PROJECT_STATUS](../PROJECT_STATUS.md). | [ADR-007](ADR-007-frontends-explicites.md) | Explicit frontend selection and a shared lifecycle contract | Accepted | 2026-05-31 | 1.10 — 2026-10-20 | | [ADR-008](ADR-008-contenu-de-confiance-et-origines.md) | Restricting bridge origins without promising a sandbox | Accepted | 2026-10-18 | 1.0 — 2026-10-18 | | [ADR-009](ADR-009-modules-et-assets-reproductibles.md) | Serving modules locally and regenerating assets reproducibly | Accepted | 2023-03-16 | 2.1 — 2026-10-22 | -| [ADR-010](ADR-010-composants-et-outils-optionnels.md) | Extending WebFront through optional components and development tools | Accepted | 2026-10-14 | 1.6 — 2026-10-22 | +| [ADR-010](ADR-010-composants-et-outils-optionnels.md) | Extending WebFront through optional components and development tools | Accepted | 2026-10-14 | 1.7 — 2026-10-23 | | [ADR-011](ADR-011-diagnostics-optionnels.md) | Confining mddlog behind an optional diagnostics façade | Accepted | 2026-10-01 | 1.2 — 2026-10-02 | | [ADR-012](ADR-012-preuves-et-tests.md) | Demonstrating contracts through deterministic tests and browser integration | Accepted | 2020-04-19 | 1.6 — 2026-10-19 | | [ADR-013](ADR-013-bootstrap-developpeur-a-la-demande.md) | Bootstrapping a downloaded developer environment | Proposée | 2026-10-20 | 0.2 — 2026-10-22 | diff --git a/include/webfront/Commands.hpp b/include/webfront/Commands.hpp new file mode 100644 index 00000000..f7583af6 --- /dev/null +++ b/include/webfront/Commands.hpp @@ -0,0 +1,418 @@ +/// @brief Terminal commands of an application: coroutines that the developer environment's terminal discovers and +/// runs, one browser session at a time, streaming their output and cancelled by Ctrl+C, a disconnection or shutdown. +#pragma once + +#include "networking/Tasks.hpp" +#include "Task.hpp" +#include "UISubscribers.hpp" +#include "utils/Json.hpp" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace webfront { + +namespace commands { + +/// Bridge strings carry a 16-bit length: output is sent in pieces of at most this many bytes. +inline constexpr std::size_t maxChunkBytes = 60000; + +/// Frames that print() lets wait for the network before it suspends the command. +inline constexpr std::size_t maxPendingOutput = 32; + +/// Exit code of a command stopped by Ctrl+C, a disconnection or the application's shutdown. +inline constexpr int interruptedExitCode = 130; + +/// Names the terminal itself handles, which an application cannot register. +inline constexpr std::array reservedNames{"wf", "clear", "exit", "help", "history"}; + +namespace detail { + +namespace ex = networking::ex; + +/// Splits text into pieces of at most maxBytes (at least 4), never inside a UTF-8 character. Bytes that are not +/// UTF-8, with no character start in a piece, are cut at maxBytes. +inline std::vector chunks(std::string_view text, std::size_t maxBytes = maxChunkBytes) { + std::vector pieces; + while (text.size() > maxBytes) { + std::size_t cut = maxBytes; + while (cut > 0 && (static_cast(text[cut]) & 0xC0) == 0x80) + --cut; + if (cut == 0) + cut = maxBytes; + pieces.push_back(text.substr(0, cut)); + text.remove_prefix(cut); + } + if (!text.empty()) + pieces.push_back(text); + return pieces; +} + +/// The command's arguments, a JSON array of strings sent by the terminal. +inline std::vector parseArguments(std::string_view json) { + std::vector arguments; + json::Reader reader{json}; + reader.array([&] { + arguments.push_back(reader.string()); + }); + reader.end(); + return arguments; +} + +inline void validateName(std::string_view name) { + const auto invalid = name.empty() || std::ranges::any_of(name, [](char c) { + return static_cast(c) <= ' ' || c == '\x7f' || c == '\'' || c == '"' || c == '\\'; + }); + if (invalid) + throw std::invalid_argument("Invalid command name '" + std::string(name) + "'"); + if (std::ranges::find(reservedNames, name) != reservedNames.end()) + throw std::invalid_argument("Command name '" + std::string(name) + "' is reserved by the terminal"); +} + +/// One running command, shared by its coroutine, its Context and the registry. +template +struct Run { + UI ui; + std::uint32_t id; + std::vector arguments; + int exitCode = 0; + // The command's own stop source, requested with its task's: a copy of the Context that outlives the task still + // reads a valid source. + ex::inplace_stop_source stop; + std::atomic disconnected{false}; + + Run(UI caller, std::uint32_t commandId, std::vector args) : ui(std::move(caller)), id(commandId), arguments(std::move(args)) { } + + /// Calls a browser function of the terminal, unless the browser disconnected (Registry::closed): its connection + /// is gone, and a later browser may get its identifier. Returns false when the call was not made. + bool send(std::string_view function, auto&&... values) { + if (disconnected.load()) + return false; + ui.jsFunction(function)(id, std::forward(values)...); + return true; + } +}; + +} // namespace detail + +/// What a command receives: its arguments, its output and its cancellation. Cheap to copy; valid while the command +/// runs. Its members are called from the command's coroutine, on the server thread. +template +class Context { +public: + explicit Context(std::shared_ptr> command) : run(std::move(command)) { } + + /// The words after the command name, split like a shell line by the terminal. + [[nodiscard]] const std::vector& args() const noexcept { + return run->arguments; + } + + /// The browser running the command, for jsFunctionSender calls or resumeAfter. + [[nodiscard]] UI ui() const { + return run->ui; + } + + /// Streams text to the terminal at once, in pieces under the bridge's string limit. "\n" ends a line. Nothing is + /// sent once the command is stopped, since the terminal no longer waits for it. + void write(std::string_view text) const { + if (run->stop.stop_requested()) + return; + for (const auto piece : detail::chunks(text)) + if (!run->send("webfront.commands.output", piece)) + return; + } + + /// Writes like write(), one piece at a time: after each piece, the command is suspended while more than + /// maxPendingOutput frames wait for a browser that reads slower than the command writes. Each wait is a point where + /// Ctrl+C stops the command. Prefer it to write() for large or unbounded output. The returned task does not need + /// this Context: it may be awaited after it is gone. + [[nodiscard]] Task print(std::string text) const { + return printPieces(run, std::move(text)); + } + + /// Sets the exit code reported when the command returns; 0 by default. An exception reports 1. + void exit(int code) const noexcept { + run->exitCode = code; + } + + /// True once Ctrl+C, a disconnection or the application's shutdown asked the command to stop. Awaited senders + /// observe it themselves; loops that do not await check it. + [[nodiscard]] bool stopRequested() const noexcept { + return run->stop.stop_requested(); + } + + /// Valid as long as a copy of this Context lives. + [[nodiscard]] networking::ex::inplace_stop_token stopToken() const noexcept { + return run->stop.get_token(); + } + +private: + std::shared_ptr> run; + + // A static coroutine: a task starts when awaited, so it takes the command by value at the call instead of reading + // it through `this` once started. + static Task printPieces(std::shared_ptr> command, std::string text) { + for (const auto piece : detail::chunks(text)) { + if (command->stop.stop_requested() || !command->send("webfront.commands.output", piece)) + co_return; + co_await command->ui.writesAtMost(maxPendingOutput); // at once if the queue is short, else woken as it drains + } + } +}; + +namespace detail { + +/// The registered commands and the commands running in each connected browser. Thread-safe. +template +class Registry : public std::enable_shared_from_this> { +public: + using Handler = std::function)>; + + void add(std::string name, std::string help, Handler handler) { + validateName(name); + if (!handler) + throw std::invalid_argument("Command '" + name + "' has no handler"); + std::scoped_lock lock{mutex}; + if (!commands.try_emplace(name, Command{std::move(help), std::make_shared(std::move(handler))}).second) + throw std::invalid_argument("Command '" + name + "' is already registered"); + } + + /// The commands as a JSON array of {"name", "help"} objects, sorted by name. + [[nodiscard]] std::string list() const { + std::scoped_lock lock{mutex}; + std::string json = "["; + for (const auto& [name, command] : commands) { + if (json.size() > 1) + json += ','; + json += "{\"name\":" + json::quote(name) + ",\"help\":" + json::quote(command.help) + '}'; + } + return json + ']'; + } + + /// Spawns a command for the browser, which numbers its commands. Throws, rejecting the browser's call, for an + /// unknown command, malformed arguments, a number already running or an application shutting down. + void start(UI ui, std::uint32_t id, const std::string& name, const std::string& argumentsJson) { + auto arguments = parseArguments(argumentsJson); + std::shared_ptr handler; + const Key key{ui.id(), id}; + auto run = std::make_shared>(ui, id, std::move(arguments)); + { + std::scoped_lock lock{mutex}; + const auto found = commands.find(name); + if (found == commands.end()) + throw std::invalid_argument("Unknown command '" + name + "'"); + if (running.contains(key)) + throw std::invalid_argument("Command " + std::to_string(id) + " is already running"); + handler = found->second.handler; + running.try_emplace(key, Running{run}); + } + auto handle = ui.spawn(execute(this->weak_from_this(), std::move(handler), run)); + if (handle.stopRequested()) { // refused, or accepted only to be cancelled by the shutdown + finished(key, run); + throw std::runtime_error("The application is shutting down"); + } + std::scoped_lock lock{mutex}; + if (auto found = running.find(key); found != running.end() && found->second.run == run) { + found->second.handle = std::move(handle); + if (found->second.cancelRequested) + found->second.handle->requestStop(); + } + } + + /// Ctrl+C: asks the command to stop. The browser no longer waits for it; a command that already ended is ignored. + void cancel(const UI& ui, std::uint32_t id) { + std::optional handle; + { + std::scoped_lock lock{mutex}; + const auto found = running.find(Key{ui.id(), id}); + if (found == running.end()) + return; + found->second.cancelRequested = true; + handle = found->second.handle; + } + if (handle) + handle->requestStop(); // outside the lock: the command may complete inline and unregister itself + } + + /// A disconnected browser: its commands are stopped, never write to the connection again and leave the session at + /// once, so that a later browser given the same identifier starts afresh even if one of them ignores its stop. + void closed(const UI& ui) { + std::vector handles; + { + std::scoped_lock lock{mutex}; + for (auto command = running.begin(); command != running.end();) { + if (command->first.first != ui.id()) { + ++command; + continue; + } + command->second.run->disconnected = true; + if (command->second.handle) + handles.push_back(*command->second.handle); + command = running.erase(command); + } + } + for (const auto& handle : handles) + handle.requestStop(); + } + + void keep(UISubscription subscription) { + closedSubscription = std::move(subscription); + } + + [[nodiscard]] std::size_t runningCount() const { + std::scoped_lock lock{mutex}; + return running.size(); + } + +private: + using Key = std::pair().id())>, std::uint32_t>; + + struct Command { + std::string help; + std::shared_ptr handler; + }; + struct Running { + std::shared_ptr> run; + std::optional handle{}; + bool cancelRequested = false; + }; + + mutable std::mutex mutex; + std::map> commands; + std::map running; + UISubscription closedSubscription; + + void finished(const Key& key, const std::shared_ptr>& run) { + std::scoped_lock lock{mutex}; + if (auto found = running.find(key); found != running.end() && found->second.run == run) + running.erase(found); + } + + // Runs the command, then reports its exit code and error message to the browser, which ignores the report of a + // command it stopped waiting for. A stopped command still reports: its coroutine was unwound, not this one. + struct ForwardStop { + Run* run; + void operator()() noexcept { run->stop.request_stop(); } + }; + + static Task execute(std::weak_ptr registry, std::shared_ptr handler, std::shared_ptr> run) { + const auto taskStop = co_await ex::read_env(ex::get_stop_token); + // Forwards the task's stop request (Ctrl+C, disconnection, shutdown) to the command's source while it runs. + const ex::stop_callback_for_t, ForwardStop> forward{taskStop, ForwardStop{run.get()}}; + bool stopped = false; + std::string error; + try { + // The command observes its own source: requested before the senders it awaits are stopped. + co_await ex::let_stopped(ex::write_env((*handler)(Context{run}), ex::prop{ex::get_stop_token, run->stop.get_token()}), + [&stopped]() noexcept { + stopped = true; + return ex::just(); + }); + } catch (const std::exception& exception) { + error = *exception.what() ? exception.what() : "C++ exception"; + } catch (...) { + error = "Unknown C++ exception"; + } + if (auto owner = registry.lock()) + owner->finished(Key{run->ui.id(), run->id}, run); + // A command that returns once asked to stop was interrupted too, whatever it returned. + const int code = stopped || run->stop.stop_requested() ? interruptedExitCode : !error.empty() ? 1 : run->exitCode; + try { + run->send("webfront.commands.exit", code, error.empty() ? std::string_view{} : chunks(error).front()); + } catch (...) { } // nothing is left to report it to + } +}; + +} // namespace detail +} // namespace commands + +/// Adds an application's commands to the terminal of the developer environment (BasicDeveloperApp::bootstrap). +/// +/// The constructor registers the bridge functions webfront.commands.list, .start and .cancel, through which each +/// connected browser discovers the commands and runs them in its own session. A command is a coroutine, +/// `webfront::Task(webfront::commands::Context)`, spawned on the server thread like ui.spawn: +/// - it streams its output with Context::write, never through one blocking reply; co_await Context::print also waits +/// while a slow browser has not read the output; +/// - Ctrl+C in the terminal, the browser's disconnection or the application's shutdown requests its stop, which the +/// senders it awaits observe (ui.resumeAfter, ui.jsFunctionSender, ...). The terminal does not wait for a stopped +/// command: its late output and exit report are ignored, and the next command can start at once; +/// - an exception it throws is shown as an error in the terminal, with exit code 1. +/// A command must not block the server thread, which serves every browser: synchronous handlers are refused at +/// compile time, and long computations belong on another thread. Create one Commands object per application (a second +/// one throws); the registered bridge functions own the commands, so the object may be destroyed before the application. +template +class Commands { +public: + using UI = typename App::UI; + using Context = commands::Context; + + /// Throws std::logic_error, registering nothing, if one of its bridge functions is already registered, as by + /// another Commands object. + explicit Commands(App& app) : registry(std::make_shared>()) { + for (const auto* name : {"webfront.commands.list", "webfront.commands.start", "webfront.commands.cancel"}) + if (app.hasCppFunction(name)) + throw std::logic_error(std::string(name) + " is taken: create one webfront::Commands per application"); + const auto registered = [](bool added) { + if (!added) + throw std::logic_error("The webfront.commands bridge functions are taken: create one webfront::Commands per application"); + }; + registered(app.template cppFunction("webfront.commands.list", [owner = registry] { + return owner->list(); + })); + registered(app.template cppFunction( + "webfront.commands.start", [owner = registry](UI ui, std::uint32_t id, const std::string& name, const std::string& arguments) { + owner->start(std::move(ui), id, name, arguments); + })); + registered(app.template cppFunction("webfront.commands.cancel", [owner = registry](UI ui, std::uint32_t id) { + owner->cancel(ui, id); + })); + registry->keep(app.subscribeUIClosed([weak = std::weak_ptr(registry)](UI ui) { + if (auto owner = weak.lock()) + owner->closed(ui); + })); + } + + /// Registers a command. Throws std::invalid_argument for an empty name, one with whitespace, quotes or + /// backslashes, a name the terminal reserves (commands::reservedNames) or one already registered. + template + Commands& add(std::string name, std::string help, Function&& handler) { + static_assert(std::is_invocable_r_v&, Context>, + "webfront::Commands::add: a command is a coroutine returning webfront::Task and taking a " + "webfront::commands::Context; a synchronous handler would block the server thread."); + auto callable = std::make_shared>(std::forward(handler)); + // A coroutine, so that the context outlives the handler's task: a handler may take it by reference. + registry->add(std::move(name), std::move(help), [callable](Context context) -> Task { + co_await std::invoke(*callable, context); + }); + return *this; + } + + /// The commands running in all browsers, for tests and diagnostics. + [[nodiscard]] std::size_t running() const { + return registry->runningCount(); + } + +private: + std::shared_ptr> registry; +}; + +template +Commands(App&) -> Commands; + +} // namespace webfront diff --git a/include/webfront/JsFunction.hpp b/include/webfront/JsFunction.hpp index 77a87cc3..989c5fa1 100644 --- a/include/webfront/JsFunction.hpp +++ b/include/webfront/JsFunction.hpp @@ -9,6 +9,10 @@ #include #include #include +#include +#include +#include +#include #include #include @@ -33,14 +37,22 @@ class JsFunction { (((command.encodeParameter(std::forward(ts), frame))), ...); command.setParametersCount(static_cast(1 + sizeof...(ts))); - auto&& link = webFront.getLink(webLinkId); - if constexpr (std::is_same_v) - link.sendFrame(std::move(frame)); - else { - auto [callId, result] = link.template expectResult(); + // A browser whose connection closed is gone: a call to it is dropped, and a typed call fails. + // The link is shared while used: a release on the server thread cannot destroy it meanwhile. + const auto link = webFront.findLink(webLinkId); + if constexpr (std::is_same_v) { + if (link) + link->sendFrame(std::move(frame)); + } else { + if (!link) { + std::promise closed; + closed.set_exception(std::make_exception_ptr(std::runtime_error("Browser connection closed"))); + return closed.get_future(); + } + auto [callId, result] = link->template expectResult(); command.setCallId(callId); if (callId != 0) - link.sendFrame(std::move(frame)); + link->sendFrame(std::move(frame)); // Structured bindings are not implicitly movable on return, so a move-only future would be // copied here. Newer libc++ accepts it; Apple Clang rejects it outright. return std::move(result); diff --git a/include/webfront/JsFunctionSender.hpp b/include/webfront/JsFunctionSender.hpp index cabcbf4c..180c00f2 100644 --- a/include/webfront/JsFunctionSender.hpp +++ b/include/webfront/JsFunctionSender.hpp @@ -237,10 +237,12 @@ class JsFunctionSender { std::weak_ptr> socket; public: + /// The connection of a browser that is gone leaves the references empty: started calls report an error. JsFunctionSender(std::string_view functionName, WebFront& wf, WebLinkId id) : name(functionName) { - auto& link = wf.getLink(id); - pending = link.pendingResults(); - socket = link.socket(); + if (const auto link = wf.findLink(id)) { + pending = link->pendingResults(); + socket = link->socket(); + } } auto operator()(auto&&... arguments) const { diff --git a/include/webfront/UISubscribers.hpp b/include/webfront/UISubscribers.hpp index 1adb30a1..0f7f8816 100644 --- a/include/webfront/UISubscribers.hpp +++ b/include/webfront/UISubscribers.hpp @@ -1,4 +1,4 @@ -/// @brief Subscriptions to connected browsers (BasicWF::subscribeUIStarted). +/// @brief Subscriptions to connecting and disconnecting browsers (BasicWF::subscribeUIStarted, subscribeUIClosed). #pragma once #include @@ -11,7 +11,7 @@ namespace webfront { -/// Keeps a BasicWF::subscribeUIStarted handler registered while it lives. Destroying or resetting it +/// Keeps a BasicWF::subscribeUIStarted or subscribeUIClosed handler registered while it lives. Destroying or resetting it /// unsubscribes; this is safe after the application itself was destroyed. Move-only. class UISubscription { public: @@ -31,7 +31,7 @@ class UISubscription { reset(); } - /// Unsubscribes now. Takes effect for browsers that connect afterwards. + /// Unsubscribes now. Takes effect for browsers that connect (or disconnect) afterwards. void reset() { if (auto unsubscribe = std::exchange(cancel, {})) unsubscribe(); @@ -47,10 +47,10 @@ class UISubscription { namespace detail { -/// Handlers notified, in subscription order, of each connected browser. Thread-safe: browsers -/// connect on the server thread while handlers may be added or removed from any thread. +/// Handlers notified, in subscription order, of each connected (or disconnected) browser. Thread-safe: +/// browsers connect on the server thread while handlers may be added or removed from any thread. template -class UIStartedSubscribers : public std::enable_shared_from_this> { +class UISubscribers : public std::enable_shared_from_this> { public: using Handler = std::function; diff --git a/include/webfront/WebFront.hpp b/include/webfront/WebFront.hpp index 35bd005b..8aef5f1b 100644 --- a/include/webfront/WebFront.hpp +++ b/include/webfront/WebFront.hpp @@ -16,6 +16,7 @@ #include "weblink/Messages.hpp" #include "weblink/WebLink.hpp" +#include #include #include #include @@ -46,17 +47,28 @@ class BasicUI { public: BasicUI(WebFront& wf, WebLinkId id) : webFront(wf), webLinkId(id) {} + /// Identifies this browser's connection among those connected. The 16-bit identifier of a released connection + /// is only reused after 65,536 later connections. + [[nodiscard]] WebLinkId id() const noexcept { + return webLinkId; + } + /** * @brief Injects a Javascript script in the client * * @param script */ void addScript(std::string_view script) const { - try { - webFront.getLink(webLinkId).sendCommand(msg::TextCommand(msg::TxtOpcode::injectScript, script)); - } catch (const std::out_of_range&) { + const auto link = webFront.findLink(webLinkId); + if (!link) throw ConnectionError("Connection with client lost"); - } + link->sendCommand(msg::TextCommand(msg::TxtOpcode::injectScript, script)); + } + + /// The frames queued for this browser and not yet written to the network; 0 once its connection is gone. + [[nodiscard]] std::size_t pendingWrites() const { + const auto link = webFront.findLink(webLinkId); + return link ? link->pendingWrites() : 0; } /** @@ -79,6 +91,19 @@ class BasicUI { return webFront.spawn(std::move(task)); } + /// A sender completing once at most `limit` frames await the network for this browser, or at once when it is gone; + /// co_await propagates the task's stop token. It paces output to a browser that reads slower than it is written. + [[nodiscard]] auto writesAtMost(std::size_t limit) const { + using Link = typename decltype(webFront.findLink(webLinkId))::element_type; + return detail::WritesAtMost{webFront.findLink(webLinkId), limit}; + } + + /// A sender completing on the server context after the duration; see BasicWF::resumeAfter. + template + [[nodiscard]] auto resumeAfter(std::chrono::duration duration) const { + return webFront.resumeAfter(duration); + } + /// Lazy typed call; co_await propagates the receiver's stop token. Cancellation /// stops waiting locally; a JavaScript function already dispatched keeps running. template @@ -216,8 +241,8 @@ struct ApplyArgs; template struct ApplyArgs> { template - static void invoke(Self& self, std::string functionName, Function&& function) { - self.template cppFunction(std::move(functionName), std::forward(function)); + static bool invoke(Self& self, std::string functionName, Function&& function) { + return self.template cppFunction(std::move(functionName), std::forward(function)); } }; @@ -294,16 +319,23 @@ class BasicWF { httpDocRoot(config.documentRoot), contentPolicy(std::move(config.contentPolicy)), idsCounter(0) { + // Links are created on the server thread, outside the lock: identifiers are only assigned here. httpServer.onUpgrade([this](typename Net::Socket&& socket) { - for (bool inserted = false; !inserted; ++idsCounter) - std::tie(std::ignore, inserted) = webLinks.try_emplace( - idsCounter, - std::move(socket), - idsCounter, - [this](WebLinkEvent event) { - onEvent(event); - }, - httpServer.taskScope()); + WebLinkId id{}; + { + std::scoped_lock lock{linksMutex}; + while (webLinks.contains(idsCounter)) + ++idsCounter; + id = idsCounter++; + } + auto link = std::make_shared>(std::move(socket), id, [this](WebLinkEvent event) { + onEvent(event); + }, httpServer.taskScope(), false); + { + std::scoped_lock lock{linksMutex}; + webLinks.emplace(id, link); + } + link->start(); // registered first: every event it dispatches finds it }); } @@ -316,7 +348,7 @@ class BasicWF { stopAndJoinServer(); // Coroutine cleanup may use its UI, so links stay alive through the join. httpServer.drainUntilJoined(); - webLinks.clear(); + releaseLinks(); } /** @brief Stops and joins owned work before returning. Call outside server callbacks, @@ -326,7 +358,7 @@ class BasicWF { stopAndJoinServer(); // Application coroutine cleanup may still use its UI: retain links until join. httpServer.drain(); - webLinks.clear(); + releaseLinks(); } /** @brief Thread-safe while the application lives. Starts on the server thread. @@ -338,6 +370,14 @@ class BasicWF { return httpServer.startTask(std::move(task)); } + /** @brief A sender completing on the server context once the duration has elapsed. co_await propagates the + * task's stop token: a stop request (TaskHandle::requestStop, shutdown) completes it stopped at once. + */ + template + [[nodiscard]] auto resumeAfter(std::chrono::duration duration) { + return httpServer.resumeAfter(duration); + } + void run() { httpServer.run(); } @@ -360,8 +400,31 @@ class BasicWF { [[nodiscard]] UISubscription subscribeUIStarted(std::function handler) { return uiSubscribers->subscribe(std::move(handler)); } - WebLink& getLink(WebLinkId id) { - return webLinks.at(id); + + /// Adds a handler called on the server thread when a browser closes its connection, or the connection fails + /// (a failed write included), while the returned subscription lives. Its UI no longer reaches the browser: the + /// connection is released after the handlers, then calls to it are dropped and typed calls fail. Application + /// shutdown, which stops every connection itself, notifies no handler. + [[nodiscard]] UISubscription subscribeUIClosed(std::function handler) { + return uiClosedSubscribers->subscribe(std::move(handler)); + } + /// The link of a connected browser, shared with the caller so that it stays valid while used, from any thread; + /// null once its connection closed and was released. + [[nodiscard]] std::shared_ptr> findLink(WebLinkId id) const { + std::scoped_lock lock{linksMutex}; + const auto found = webLinks.find(id); + return found == webLinks.end() ? nullptr : found->second; + } + + /// The browsers connected now: a closed connection is released shortly after its closure. + [[nodiscard]] std::size_t connectedBrowsers() const { + std::scoped_lock lock{linksMutex}; + return webLinks.size(); + } + + /// Whether a C++ function of that name is registered. + [[nodiscard]] bool hasCppFunction(std::string_view functionName) const { + return cppFunctions.contains(functionName); } /** @@ -374,18 +437,21 @@ class BasicWF { * @tparam Args parameters of the CppFunction * @param functionName * @param function + * @return false when a function of that name was already registered, which stays registered */ template - void cppFunction(std::string functionName, auto&& function) { + bool cppFunction(std::string functionName, auto&& function) { if constexpr (detail::takes_caller::value) - registerWithCaller(std::move(functionName), std::forward(function)); + return registerWithCaller(std::move(functionName), std::forward(function)); else { auto callable = detail::makeCppFunctionHandler(std::forward(function)); auto responder = detail::makeCppFunctionResponder(std::move(callable)); - cppFunctions.try_emplace(std::move(functionName), - [responder](std::span data, WebLink& link, msg::CallId callId, UI) mutable { - responder(data, link, callId); - }); + return cppFunctions + .try_emplace(std::move(functionName), + [responder](std::span data, WebLink& link, msg::CallId callId, UI) mutable { + responder(data, link, callId); + }) + .second; } } @@ -400,9 +466,10 @@ class BasicWF { * * @param functionName * @param function + * @return false when a function of that name was already registered, which stays registered */ template - void cppFunction(std::string functionName, Function&& function) { + bool cppFunction(std::string functionName, Function&& function) { using Callable = std::remove_cvref_t; static_assert(detail::has_callable_traits, "webfront::BasicWF::cppFunction: could not deduce this callable's signature. Generic " @@ -410,7 +477,7 @@ class BasicWF { "cppFunction(name, callable)."); using Traits = detail::callable_traits; using Args = typename detail::caller_aware_args::type; - detail::ApplyArgs::invoke(*this, std::move(functionName), std::forward(function)); + return detail::ApplyArgs::invoke(*this, std::move(functionName), std::forward(function)); } enum class WindowAction { none, closeWindow }; @@ -478,15 +545,36 @@ class BasicWF { serverThread.join(); } + // A released link is destroyed outside the lock, by its last owner: a call on another thread may still use it. + Task releaseLink(WebLinkId id) { + std::shared_ptr> released; + { + std::scoped_lock lock{linksMutex}; + if (auto found = webLinks.find(id); found != webLinks.end()) { + released = std::move(found->second); + webLinks.erase(found); + } + } + co_return; + } + + void releaseLinks() { + std::map>> released; + std::scoped_lock lock{linksMutex}; + released.swap(webLinks); + } + template - void registerWithCaller(std::string functionName, auto&& function) { + bool registerWithCaller(std::string functionName, auto&& function) { auto adapted = detail::adaptCaller(std::forward(function)); auto callable = detail::makeCppFunctionHandler(std::move(adapted)); auto responder = detail::makeCppFunctionResponder(std::move(callable)); - cppFunctions.try_emplace(std::move(functionName), - [responder](std::span data, WebLink& link, msg::CallId callId, UI caller) mutable { - responder(data, link, callId, caller); - }); + return cppFunctions + .try_emplace(std::move(functionName), + [responder](std::span data, WebLink& link, msg::CallId callId, UI caller) mutable { + responder(data, link, callId, caller); + }) + .second; } http::Server httpServer; @@ -494,11 +582,13 @@ class BasicWF { std::string httpPort; std::filesystem::path httpDocRoot; ContentPolicy contentPolicy; - std::map> webLinks; + mutable std::mutex linksMutex; // guards webLinks, read from any thread + std::map>> webLinks; WebLinkId idsCounter{0}; std::function uiStartedHandler; - std::shared_ptr> uiSubscribers = std::make_shared>(); - std::map, WebLink&, msg::CallId, UI)>> cppFunctions; + std::shared_ptr> uiSubscribers = std::make_shared>(); + std::shared_ptr> uiClosedSubscribers = std::make_shared>(); + std::map, WebLink&, msg::CallId, UI)>, std::less<>> cppFunctions; std::thread serverThread; // Background thread running the HTTP server private: @@ -510,14 +600,25 @@ class BasicWF { uiSubscribers->notify(UI{*this, event.webLinkId}); break; case WebLinkEvent::Code::closed: - webLinks.erase(event.webLinkId); + // Shutdown cancels the connections' writes, which then fail and report a closure: not a disconnection. + if (httpServer.taskScope().stopRequested()) + break; + uiClosedSubscribers->notify(UI{*this, event.webLinkId}); + // The link is running this handler: it is released afterwards, by a task on the server context. + // During shutdown the task is refused and the link goes with the application. + static_cast(httpServer.startTask(releaseLink(event.webLinkId))); break; - case WebLinkEvent::Code::cppFunctionCalled: + case WebLinkEvent::Code::cppFunctionCalled: { + // Links are registered before they read, and released after their closure: the caller is registered. + const auto link = findLink(event.webLinkId); + if (!link) + break; if (auto function = cppFunctions.find(event.text); function != cppFunctions.end()) - function->second(event.data, getLink(event.webLinkId), event.callId, UI{*this, event.webLinkId}); + function->second(event.data, *link, event.callId, UI{*this, event.webLinkId}); else - getLink(event.webLinkId).sendError(event.callId, "C++ function '" + event.text + "' was not found"); + link->sendError(event.callId, "C++ function '" + event.text + "' was not found"); break; + } } } }; diff --git a/include/webfront/components/Terminal.hpp b/include/webfront/components/Terminal.hpp deleted file mode 100644 index 91d414b3..00000000 --- a/include/webfront/components/Terminal.hpp +++ /dev/null @@ -1,360 +0,0 @@ -/// @brief Interactive terminal component: an xterm.js page served from embedded assets, whose line -/// editor sends each validated line to commands registered in C++. -#pragma once - -#include "../system/DefaultFS.hpp" -#include "../system/TerminalFS.hpp" -#include "../WebFront.hpp" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace webfront { - -/// Arguments of a terminal command, without the command name. -using CommandArgs = std::span; - -struct TerminalOptions { - std::string prompt = "> "; - std::string banner = "WebFront terminal. Type 'help' to list the commands."; -}; - -namespace terminal { - -namespace detail { - -/// Shell-style word splitting, one character at a time; see tokenize(). -class LineSplitter { -public: - explicit LineSplitter(std::string_view text) : line(text) {} - - std::vector split() { - while (index < line.size()) - take(line[index++]); - endWord(); - return std::move(words); - } - -private: - std::string_view line; - std::size_t index = 0; - std::vector words; - std::string word; - bool inWord = false; - - void take(char c) { - if (c == ' ' || c == '\t') - return endWord(); - inWord = true; - if (c == '\\') - readEscaped(); - else if (c == '\'' || c == '"') - readQuoted(c); - else - word += c; - } - - void readEscaped() { - if (index == line.size()) - throw std::invalid_argument("Trailing backslash"); - word += line[index++]; - } - - char nextQuoted() { - if (index == line.size()) - throw std::invalid_argument("Unterminated quote"); - return line[index++]; - } - - void readQuoted(char quote) { - for (char c = nextQuoted(); c != quote; c = nextQuoted()) - word += quote == '"' && c == '\\' ? escapedInDoubleQuotes() : c; - } - - // A backslash ending the line stays literal; the missing closing quote is reported next. - char escapedInDoubleQuotes() { - return index < line.size() ? line[index++] : '\\'; - } - - void endWord() { - if (inWord) - words.push_back(std::exchange(word, {})); - inWord = false; - } -}; - -} // namespace detail - -/// Splits a command line into words. Whitespace separates words; single quotes keep their content -/// verbatim, double quotes keep it but honor backslash escapes, and an unquoted backslash escapes -/// the next character. Throws std::invalid_argument on an unterminated quote or a trailing backslash. -inline std::vector tokenize(std::string_view line) { - return detail::LineSplitter{line}.split(); -} - -/// Bridge strings carry a 16-bit length, so a command output is capped below that limit, on a -/// UTF-8 character boundary, with a visible notice. -inline constexpr std::size_t maxOutputBytes = 60000; - -namespace detail { - -/// Prepares text for the terminal: "\n" becomes "\r\n", then the result is capped to -/// maxOutputBytes. -inline std::string toTerminalText(std::string_view text) { - std::string converted; - converted.reserve(text.size()); - char previous = '\0'; - for (const char c : text) { - if (c == '\n' && previous != '\r') - converted += '\r'; - converted += c; - previous = c; - } - if (converted.size() <= maxOutputBytes) - return converted; - std::size_t cut = maxOutputBytes; - while (cut > 0 && (static_cast(converted[cut]) & 0xC0) == 0x80) - --cut; - converted.resize(cut); - return converted + "\r\n\x1b[33m[output truncated]\x1b[0m"; -} - -} // namespace detail - -/// Command registry and dispatcher, independent of any connection. Thread-safe: commands may be -/// registered while the server thread runs others. -class Shell { -public: - using Handler = std::function; - - /// Registers a command. Throws std::invalid_argument if the name is empty, contains whitespace - /// or quotes, or is already registered. - void command(std::string name, std::string help, Handler handler) { - if (name.empty() || name.find_first_of(" \t'\"\\") != std::string::npos) - throw std::invalid_argument("Invalid terminal command name '" + name + "'"); - if (!handler) - throw std::invalid_argument("Terminal command '" + name + "' has no handler"); - std::scoped_lock lock{mutex}; - if (!commands.try_emplace(name, Command{std::move(help), std::make_shared(std::move(handler))}).second) - throw std::invalid_argument("Terminal command '" + name + "' is already registered"); - } - - /// Runs one line and returns its output, using "\n" line endings converted to "\r\n" for the - /// terminal. An empty line produces no output; an unknown command or a malformed line produces - /// an error message. Exceptions thrown by a command propagate to the caller. - std::string run(std::string_view line) const { - std::vector words; - try { - words = tokenize(line); - } catch (const std::invalid_argument& error) { - return errorMessage(error.what()); - } - if (words.empty()) - return {}; - - std::shared_ptr handler; - { - std::scoped_lock lock{mutex}; - if (auto found = commands.find(words.front()); found != commands.end()) - handler = found->second.handler; - } - if (!handler) - return errorMessage("Unknown command '" + words.front() + "'. Type 'help' to list the commands."); - - std::ostringstream output; - (*handler)(CommandArgs{words}.subspan(1), output); - return detail::toTerminalText(output.view()); - } - - /// Completes the command name of a line: returns the matching names separated by "\n", or an - /// empty string once the line already contains a space (arguments are not completed). - [[nodiscard]] std::string complete(std::string_view line) const { - if (line.find_first_of(" \t") != std::string_view::npos) - return {}; - std::string candidates; - std::scoped_lock lock{mutex}; - for (auto found = commands.lower_bound(std::string(line)); found != commands.end() && found->first.starts_with(line); ++found) { - if (!candidates.empty()) - candidates += '\n'; - candidates += found->first; - } - return candidates; - } - - /// Adds a browser module that the terminal page imports when it starts (see Terminal::extension). - /// Throws std::invalid_argument if the URL is empty or contains a line break; adding a URL twice - /// has no effect. - void extension(std::string moduleUrl) { - if (moduleUrl.empty() || moduleUrl.find_first_of("\r\n") != std::string::npos) - throw std::invalid_argument("Invalid terminal extension URL '" + moduleUrl + "'"); - std::scoped_lock lock{mutex}; - if (std::ranges::find(extensionUrls, moduleUrl) == extensionUrls.end()) - extensionUrls.push_back(std::move(moduleUrl)); - } - - /// The URLs of the browser modules, in the order they were added, separated by "\n". - [[nodiscard]] std::string extensions() const { - std::scoped_lock lock{mutex}; - std::string urls; - for (const auto& url : extensionUrls) { - if (!urls.empty()) - urls += '\n'; - urls += url; - } - return urls; - } - - /// Lists every command with its help text, aligned, one per line. - [[nodiscard]] std::string help() const { - std::scoped_lock lock{mutex}; - std::size_t width = 0; - for (const auto& [name, command] : commands) - width = std::max(width, name.size()); - std::string text; - for (const auto& [name, command] : commands) { - if (!text.empty()) - text += '\n'; - text += name + std::string(width - name.size() + 2, ' ') + command.help; - } - return text; - } - -private: - struct Command { - std::string help; - std::shared_ptr handler; - }; - - mutable std::mutex mutex; - std::map> commands; - std::vector extensionUrls; - - // Messages may quote the user's line, so they are capped like command output, before the - // color codes are added so the closing reset always survives. - static std::string errorMessage(std::string_view message) { - return "\x1b[31m" + detail::toTerminalText(message) + "\x1b[0m"; - } -}; - -/// Adapts the accepted handler shapes to Shell::Handler: -/// (CommandArgs, std::ostream&) -> void, (CommandArgs) -> R, () -> R -/// where R is void or anything that can be written to a std::ostream. -template -Shell::Handler adaptHandler(Function&& function) { - using Stored = std::decay_t; - auto callable = std::make_shared(std::forward(function)); - auto writeResult = [](std::ostream& output, auto&& invoke) { - using R = decltype(invoke()); - if constexpr (std::is_void_v) - invoke(); - else - output << invoke(); - }; - if constexpr (std::invocable) - return [callable](CommandArgs args, std::ostream& output) { - std::invoke(*callable, args, output); - }; - else if constexpr (std::invocable) - return [callable, writeResult](CommandArgs args, std::ostream& output) { - writeResult(output, [&]() -> decltype(auto) { - return std::invoke(*callable, args); - }); - }; - else { - static_assert(std::invocable, - "webfront::Terminal::command: the handler must accept (CommandArgs, std::ostream&), " - "(CommandArgs) or no argument."); - return [callable, writeResult](CommandArgs, std::ostream& output) { - writeResult(output, [&]() -> decltype(auto) { - return std::invoke(*callable); - }); - }; - } -} - -} // namespace terminal - -/// Application type serving the terminal page next to the default WebFront assets. -using TerminalApp = BasicWF>; - -/// Gives an application a command-line interface in the browser. -/// -/// The constructor registers the JavaScript-callable functions webfront.terminal.prompt, .banner, -/// .run, .complete and .extensions on the application, plus a built-in 'help' command. The registered functions -/// own the command registry, so a Terminal object may be destroyed before the application; commands -/// can only be added through a live Terminal. The application's filesystem must serve -/// fs::TerminalFS (TerminalApp does). -template -class Terminal { -public: - static constexpr std::string_view page = fs::TerminalFS::page; - /// Erases the screen and the scrollback and homes the cursor. The page writes no line break - /// after an output ending with the cursor-home sequence. - static constexpr std::string_view clearScreen = "\x1b[2J\x1b[3J\x1b[H"; - - explicit Terminal(App& app, TerminalOptions options = {}) : shell(std::make_shared()) { - shell->command("help", "List the available commands", [weakShell = std::weak_ptr(shell)](CommandArgs, std::ostream& output) { - if (auto registry = weakShell.lock()) - output << registry->help(); - }); - shell->command("clear", "Clear the screen and its scrollback", [](CommandArgs, std::ostream& output) { - output << clearScreen; - }); - app.template cppFunction("webfront.terminal.prompt", [prompt = options.prompt] { - return prompt; - }); - app.template cppFunction("webfront.terminal.banner", [banner = options.banner] { - return banner; - }); - app.template cppFunction("webfront.terminal.run", [registry = shell](const std::string& line) { - return registry->run(line); - }); - app.template cppFunction("webfront.terminal.complete", [registry = shell](const std::string& line) { - return registry->complete(line); - }); - app.template cppFunction("webfront.terminal.extensions", [registry = shell] { - return registry->extensions(); - }); - } - - /// Registers a command; see terminal::adaptHandler for the accepted handler shapes and - /// terminal::Shell::command for the errors. - template - Terminal& command(std::string name, std::string help, Function&& handler) { - shell->command(std::move(name), std::move(help), terminal::adaptHandler(std::forward(handler))); - return *this; - } - - /// Adds a browser module that the terminal page imports before showing the prompt, such as - /// "/webfront/components/tools/wf.mjs". The module may export `commands`, an object mapping a - /// command name to `async (args, context) => output`, run in the browser before the line reaches - /// C++. `args` are the words after the command name, split like in C++; `context` holds `line`, - /// `bridge`, `write(text)` (progress output) and `runInCpp()` (the C++ output of the line). A - /// handler returning undefined lets C++ run the line. See terminal.mjs. - Terminal& extension(std::string moduleUrl) { - shell->extension(std::move(moduleUrl)); - return *this; - } - -private: - std::shared_ptr shell; -}; - -template -Terminal(App&, TerminalOptions = {}) -> Terminal; - -} // namespace webfront diff --git a/include/webfront/components/ToolManager.hpp b/include/webfront/components/ToolManager.hpp deleted file mode 100644 index 6aaa2a0d..00000000 --- a/include/webfront/components/ToolManager.hpp +++ /dev/null @@ -1,205 +0,0 @@ -/// @brief The wf tool manager: web tools installed into a WebFront application while it is -/// developed, stored by fs::ToolStore and served by fs::PackageFS (see docs/UI_COMPONENTS.md). -#pragma once - -#include "../system/PackageFS.hpp" -#include "../system/ToolManagerFS.hpp" -#include "../system/ToolStore.hpp" -#include "Terminal.hpp" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace webfront { - -/// Application type serving the terminal page, the browser side of the tool manager and the installed -/// tools next to the default assets. -using ToolsApp = BasicWF>; - -struct ToolManagerOptions { - /// npm registry used by 'wf search' and 'wf install', from the browser. It must allow CORS - /// requests from the application's page (registry.npmjs.org does). A relative URL is resolved - /// against the page. - std::string registry = "https://registry.npmjs.org/"; -}; - -namespace tools::detail { - -// JavaScript numbers are exact integers up to 2^53. -inline std::uint64_t toIndex(double value) { - const bool integral = std::floor(value) == value; // false for NaN - const bool inRange = value >= 0 && value <= 9007199254740992.0; - if (!integral || !inRange) - throw std::invalid_argument("Invalid file offset or list index"); - return static_cast(value); -} - -/// Bridge strings carry a 16-bit length; a list page stays below it, like terminal output. -inline constexpr std::size_t maxListBytes = 60000; - -/// The lines of the installed tools from index 'first', as many whole lines as fit in -/// maxListBytes; empty past the last tool. A line always fits, since names, versions, paths and -/// texts are bounded by the store's validation. -inline std::string listPage(const fs::ToolStore& store, std::uint64_t first) { - const auto installed = store.installed(); - std::string page; - auto tool = installed.begin(); - std::advance(tool, static_cast(std::min(first, installed.size()))); - for (; tool != installed.end(); ++tool) { - const auto& [name, record] = *tool; - const auto line = name + "\t" + record.version + "\t" + fs::PackageFS::url(name, record.entry) + "\t" + record.title + "\n"; - if (page.size() + line.size() > maxListBytes) - break; - page += line; - } - return page; -} - -inline void requireArguments(CommandArgs args, std::size_t count) { - if (args.size() != count) - throw std::invalid_argument("Wrong number of arguments. Type 'wf help'."); -} - -inline void usage(fs::ToolStore&, CommandArgs, std::ostream& output) { - output << "wf search [term] Search the registry for web tools\n" - "wf install [@version] Download, verify and install a tool\n" - "wf list List the installed tools\n" - "wf open Open an installed tool in a new tab\n" - "wf remove Uninstall a tool"; -} - -// 'wf search', 'wf install' and 'wf open' are handled by the page (wf.mjs) and only reach C++ when -// the page did not load it. -inline void browserOnly(std::string_view command) { - throw std::invalid_argument("'wf " + std::string(command) + "' runs in the terminal page, which did not load " + std::string(fs::ToolManagerFS::module) - + ". Is fs::ToolManagerFS served?"); -} - -inline void removeTool(fs::ToolStore& store, CommandArgs args, std::ostream& output) { - requireArguments(args, 2); - if (!store.remove(args[1])) - throw std::invalid_argument(args[1] + " is not installed"); - output << "Removed " << args[1] << "."; -} - -inline void listTools(fs::ToolStore& store, CommandArgs args, std::ostream& output) { - requireArguments(args, 1); - const auto installed = store.installed(); - if (installed.empty()) { - output << "No tool installed."; - return; - } - std::size_t width = 0; - for (const auto& [name, record] : installed) - width = std::max(width, name.size() + 1 + record.version.size()); - const char* separator = ""; - for (const auto& [name, record] : installed) { - const auto label = name + "@" + record.version; - output << separator << label << std::string(width - label.size() + 2, ' ') << record.title; - separator = "\n"; - } -} - -struct WfCommand { - std::string_view name; - void (*run)(fs::ToolStore&, CommandArgs, std::ostream&); -}; - -// The subcommands running in C++; the page runs the others (browserCommands). -inline constexpr std::array wfCommands{ - WfCommand{ "help", &usage}, - WfCommand{ "list", &listTools}, - WfCommand{"remove", &removeTool}, -}; -inline constexpr std::array browserCommands{"search", "install", "open"}; - -inline void runWf(fs::ToolStore& store, CommandArgs args, std::ostream& output) { - const std::string_view command = args.empty() ? "help" : std::string_view(args[0]); - if (const auto found = std::ranges::find(wfCommands, command, &WfCommand::name); found != wfCommands.end()) - return found->run(store, args, output); - if (std::ranges::find(browserCommands, command) != browserCommands.end()) - return browserOnly(command); - throw std::invalid_argument("Unknown wf command '" + std::string(command) + "'. Type 'wf help'."); -} - -} // namespace tools::detail - -/// Adds the 'wf' command to a terminal, the browser module running its network part (wf.mjs, served -/// by fs::ToolManagerFS, loaded as a terminal extension) and the bridge functions the page uses: -/// webfront.pkg.registry() -> the npm registry URL of ToolManagerOptions -/// webfront.pkg.begin(name, version) -/// webfront.pkg.writeFile(name, version, path, offset, Uint8Array) -/// webfront.pkg.commit(name, version, integrity, entry, title) -/// webfront.pkg.list(first) -> "name\tversion\tentry URL\ttitle\n" lines of the installed tools -/// from index 'first', paged below the bridge's string limit: the -/// page calls it again from the next index until it gets "" -/// The tools live in Location::get(), which must match the application's fs::BasicPackageFS -/// (ToolsApp uses fs::CurrentDirectory). The registered functions share ownership of the store, so -/// a ToolManager may be destroyed before the application. -/// -/// Development only: an installed tool runs in the application's origin and can call every -/// registered C++ function, so the trust model is that of 'npm install'. -template -class ToolManager { -public: - using PackageFS = fs::BasicPackageFS; - - ToolManager(App& app, Terminal& terminal, ToolManagerOptions options = {}) : toolStore(std::make_shared(Location::get())) { - app.template cppFunction("webfront.pkg.registry", [registry = std::move(options.registry)] { - return registry; - }); - app.template cppFunction("webfront.pkg.begin", - [registry = toolStore](const std::string& name, const std::string& packageVersion) { - registry->begin(name, packageVersion); - }); - app.template cppFunction>( - "webfront.pkg.writeFile", - [registry = toolStore](const std::string& name, - const std::string& packageVersion, - const std::string& path, - double offset, - const std::vector& bytes) { - registry->write(name, packageVersion, {.path = path, .offset = tools::detail::toIndex(offset), .bytes = bytes}); - }); - app.template cppFunction( - "webfront.pkg.commit", - [registry = toolStore](const std::string& name, - const std::string& packageVersion, - const std::string& integrity, - const std::string& entry, - const std::string& title) { - registry->commit({.name = name, .version = packageVersion, .integrity = integrity, .entry = entry, .title = title}); - }); - app.template cppFunction("webfront.pkg.list", [registry = toolStore](double first) { - return tools::detail::listPage(*registry, tools::detail::toIndex(first)); - }); - terminal.command("wf", - "Manage web tools: wf search | install | list | open | remove. Type 'wf help'.", - [registry = toolStore](CommandArgs args, std::ostream& output) { - tools::detail::runWf(*registry, args, output); - }); - terminal.extension("/" + std::string(fs::ToolManagerFS::module)); - } - - [[nodiscard]] fs::ToolStore& store() { - return *toolStore; - } - -private: - std::shared_ptr toolStore; -}; - -template -ToolManager(App&, Terminal&, ToolManagerOptions = {}) -> ToolManager; - -} // namespace webfront diff --git a/include/webfront/http/HTTPServer.hpp b/include/webfront/http/HTTPServer.hpp index 9ea498ec..7ba6762c 100644 --- a/include/webfront/http/HTTPServer.hpp +++ b/include/webfront/http/HTTPServer.hpp @@ -18,6 +18,7 @@ #include #include +#include #include #include #include @@ -457,6 +458,12 @@ class Server { return handle; } + /** @brief A sender completing on the server context after the duration, or stopped first by its stop token. */ + template + auto resumeAfter(std::chrono::duration duration) { + return Net::ResumeAfter(acceptor, duration); + } + /// Called, on the context's thread, with the socket of a connection upgraded to a WebSocket. void onUpgrade(std::function&& handler) { upgradeHandler = std::move(handler); diff --git a/include/webfront/http/WebSocket.hpp b/include/webfront/http/WebSocket.hpp index 74451772..3276d419 100644 --- a/include/webfront/http/WebSocket.hpp +++ b/include/webfront/http/WebSocket.hpp @@ -338,6 +338,8 @@ class WebSocket : public std::enable_shared_from_this> { /// Called on every failed write, before its diagnostic and even after stop(): frames queued /// before stopping still fail, and their producer must be detached rather than fed the error. void onWriteError(std::function&& handler) { writeErrorHandler = std::move(handler); } + /// Called, outside the write lock, each time the queue shrinks: a frame was written, or a failure dropped them all. + void onWritten(std::function&& handler) { writtenHandler = std::move(handler); } void write(std::string_view text) { writeData(Frame(text)); } void write(std::span data) { writeData(Frame(data)); } void write(std::span data, std::span data2) { writeData(Frame(data, data2)); } @@ -360,6 +362,7 @@ class WebSocket : public std::enable_shared_from_this> { std::function)> binaryHandler; std::function closeHandler; std::function writeErrorHandler; + std::function writtenHandler; mutable std::mutex writeMutex; std::deque>> writeQueue; // the first frame is the one being written networking::TaskScope& taskScope; @@ -531,9 +534,11 @@ class WebSocket : public std::enable_shared_from_this> { // Writes the queued frames in order and ends when the queue is empty. networking::Task writeFrames(std::shared_ptr) { try { - for (auto frame = nextFrame(false); frame; frame = nextFrame(true)) { + for (auto frame = nextFrame(false); frame;) { // A stopped WebSocket cancels the write: it fails like a write on a closed connection. co_await networking::ex::stopped_as_error(Net::Send(socket, frame->toBuffers()), std::make_error_code(std::errc::operation_canceled)); + frame = nextFrame(true); + if (writtenHandler) writtenHandler(); } } catch (const std::system_error& error) { @@ -541,7 +546,8 @@ class WebSocket : public std::enable_shared_from_this> { std::lock_guard lock(writeMutex); writeQueue.clear(); } - onWriteFailed(error.code()); + onWriteFailed(error.code()); // reports the closure before the waiters for the queue resume + if (writtenHandler) writtenHandler(); } } diff --git a/include/webfront/networking/TCPNetworkingStdnet.hpp b/include/webfront/networking/TCPNetworkingStdnet.hpp index e07e4cb4..98550e4b 100644 --- a/include/webfront/networking/TCPNetworkingStdnet.hpp +++ b/include/webfront/networking/TCPNetworkingStdnet.hpp @@ -8,6 +8,7 @@ #include "BasicNetworking.hpp" #include "SenderHeaders.hpp" +#include #include #include @@ -33,6 +34,11 @@ class TCPStdnet : public BasicNetworking<::stdnet::const_buffer, ::stdnet::mutab static auto Receive(Socket& socket, MutableBuffer buffer) { return ::stdnet::async_receive(socket, buffer); } static auto Send(Socket& socket, const auto& buffers) { return ::stdnet::async_write(socket, buffers); } static auto Accept(Acceptor& acceptor) { return ::stdnet::async_accept(acceptor); } + /// Completes on the context of a socket or an acceptor once the duration has elapsed, or stops first on a stop request. + template + static auto ResumeAfter(auto& ioObject, std::chrono::duration duration) { + return ::stdnet::async_resume_after(Scheduler(ioObject), duration); + } }; } // namespace webfront::networking diff --git a/include/webfront/system/DefaultFS.hpp b/include/webfront/system/DefaultFS.hpp index 8905b64f..8c288387 100644 --- a/include/webfront/system/DefaultFS.hpp +++ b/include/webfront/system/DefaultFS.hpp @@ -50,7 +50,7 @@ class OptionalDevRootFS { /// 3. IndexFS's embedded fallback page, favicon, and WebFront.js copy. using DefaultFS = Multi; -/// DefaultFS with additional embedded providers, such as a UI component's assets (e.g. TerminalFS). +/// DefaultFS with additional embedded providers, such as the assets an application generated with wf embed. /// They are consulted after the protected WebFront.js and before the document root, so a /// development root cannot shadow a component's files. template diff --git a/include/webfront/system/DeveloperBootstrapData.hpp b/include/webfront/system/DeveloperBootstrapData.hpp index 2f438be5..0f656918 100644 --- a/include/webfront/system/DeveloperBootstrapData.hpp +++ b/include/webfront/system/DeveloperBootstrapData.hpp @@ -11,161 +11,161 @@ struct DeveloperBootstrapData { static constexpr std::string_view encoding{}; static constexpr std::size_t dataSize{6195}; static constexpr std::array data{ - 0x76617220753d6e65, 0x7720546578744465, 0x636f6465723b6173, 0x796e632066756e63, 0x74696f6e20702874, - 0x2c65297b6c657420, 0x6e3d537472696e67, 0x28653f3f2222292e, 0x73706c6974282f5c, 0x732b2f292e66696c, + 0x766172206c3d6e65, 0x7720546578744465, 0x636f6465723b6173, 0x796e632066756e63, 0x74696f6e20682865, + 0x2c74297b6c657420, 0x723d537472696e67, 0x28743f3f2222292e, 0x73706c6974282f5c, 0x732b2f292e66696c, 0x74657228613d3e61, 0x2e73746172747357, 0x6974682822736861, 0x3531322d2229292e, 0x6d617028613d3e61, - 0x2e73706c69742822, 0x3f22295b305d293b, 0x6966286e2e6c656e, 0x6774683d3d3d3029, 0x7468726f77206e65, + 0x2e73706c69742822, 0x3f22295b305d293b, 0x696628722e6c656e, 0x6774683d3d3d3029, 0x7468726f77206e65, 0x77204572726f7228, 0x2254686520706163, 0x6b61676520686173, 0x206e6f205348412d, 0x35313220696e7465, 0x677269747922293b, 0x69662821676c6f62, 0x616c546869732e63, 0x727970746f3f2e73, 0x7562746c65297468, 0x726f77206e657720, 0x4572726f72282249, 0x6e74656772697479, 0x20636865636b7320, 0x6e65656420612073, 0x656375726520636f, 0x6e74657874202868, 0x74747073206f7220, 0x6c6f63616c686f73, 0x742922293b6c6574, - 0x20723d6e65772055, 0x696e743841727261, 0x7928617761697420, 0x63727970746f2e73, 0x7562746c652e6469, - 0x6765737428225348, 0x412d353132222c74, 0x29292c6f3d227368, 0x613531322d222b62, 0x746f612841727261, - 0x792e66726f6d2872, 0x2c613d3e53747269, 0x6e672e66726f6d43, 0x686172436f646528, 0x6129292e6a6f696e, - 0x28222229293b6966, 0x28216e2e696e636c, 0x75646573286f2929, 0x7468726f77206e65, 0x77204572726f7228, - 0x60496e7465677269, 0x747920636865636b, 0x206661696c65643a, 0x2065787065637465, 0x6420247b6e5b305d, - 0x7d2c20676f742024, 0x7b6f7d60293b7265, 0x7475726e206f7d61, 0x73796e632066756e, 0x6374696f6e206428, - 0x742c653d32363834, 0x3335343536297b6c, 0x6574206e3d6e6577, 0x20426c6f62285b74, 0x5d292e7374726561, + 0x206e3d6e65772055, 0x696e743841727261, 0x7928617761697420, 0x63727970746f2e73, 0x7562746c652e6469, + 0x6765737428225348, 0x412d353132222c65, 0x29292c6f3d227368, 0x613531322d222b62, 0x746f612841727261, + 0x792e66726f6d286e, 0x2c613d3e53747269, 0x6e672e66726f6d43, 0x686172436f646528, 0x6129292e6a6f696e, + 0x28222229293b6966, 0x2821722e696e636c, 0x75646573286f2929, 0x7468726f77206e65, 0x77204572726f7228, + 0x60496e7465677269, 0x747920636865636b, 0x206661696c65643a, 0x2065787065637465, 0x6420247b725b305d, + 0x7d2c20676f742024, 0x7b6f7d60293b7265, 0x7475726e206f7d61, 0x73796e632066756e, 0x6374696f6e207028, + 0x652c743d32363834, 0x3335343536297b6c, 0x657420723d6e6577, 0x20426c6f62285b65, 0x5d292e7374726561, 0x6d28292e70697065, 0x5468726f75676828, 0x6e6577204465636f, 0x6d7072657373696f, 0x6e53747265616d28, - 0x22677a6970222929, 0x2e67657452656164, 0x657228292c723d5b, 0x5d2c6f3d303b666f, 0x72286c657420613d, - 0x6177616974206e2e, 0x7265616428293b21, 0x612e646f6e653b61, 0x3d6177616974206e, 0x2e72656164282929, - 0x7b6966286f2b3d61, 0x2e76616c75652e6c, 0x656e6774682c6f3e, 0x65297468726f7720, 0x6177616974206e2e, + 0x22677a6970222929, 0x2e67657452656164, 0x657228292c6e3d5b, 0x5d2c6f3d303b666f, 0x72286c657420613d, + 0x617761697420722e, 0x7265616428293b21, 0x612e646f6e653b61, 0x3d61776169742072, 0x2e72656164282929, + 0x7b6966286f2b3d61, 0x2e76616c75652e6c, 0x656e6774682c6f3e, 0x74297468726f7720, 0x617761697420722e, 0x63616e63656c2829, 0x2c6e657720457272, 0x6f72286054686520, 0x74617262616c6c20, 0x756e7061636b7320, - 0x746f206d6f726520, 0x7468616e20247b65, 0x7d20627974657360, 0x293b722e70757368, 0x28612e76616c7565, - 0x297d72657475726e, 0x206e65772055696e, 0x7438417272617928, 0x6177616974206e65, 0x7720426c6f622872, - 0x292e617272617942, 0x7566666572282929, 0x7d66756e6374696f, 0x6e206c28742c652c, 0x6e297b6c65742072, - 0x3d742e7375626172, 0x72617928652c652b, 0x6e292c6f3d722e69, 0x6e6465784f662830, 0x293b72657475726e, - 0x20752e6465636f64, 0x65286f3c303f723a, 0x722e737562617272, 0x617928302c6f2929, 0x7d66756e6374696f, - 0x6e207928742c652c, 0x6e297b696628745b, 0x655d263132382972, 0x657475726e20742e, 0x7375626172726179, - 0x28652b312c652b6e, 0x292e726564756365, 0x28286f2c61293d3e, 0x6f2a3235362b612c, 0x745b655d26313237, - 0x293b6c657420723d, 0x6c28742c652c6e29, 0x2e7472696d28293b, 0x696628212f5e5b30, 0x2d375d2a242f2e74, - 0x6573742872292974, 0x68726f77206e6577, 0x204572726f722822, 0x436f727275707420, 0x7461722068656164, - 0x657222293b726574, 0x75726e20723d3d3d, 0x22223f303a706172, 0x7365496e7428722c, 0x38297d66756e6374, - 0x696f6e2054287429, 0x7b6c657420653d30, 0x3b666f72286c6574, 0x206e3d303b6e3c35, 0x31323b2b2b6e2965, - 0x2b3d6e3e3d313438, 0x26266e3c3135363f, 0x33323a745b6e5d3b, 0x6966287928742c31, 0x34382c3829213d3d, - 0x65297468726f7720, 0x6e6577204572726f, 0x722822436f727275, 0x7074207461722068, 0x6561646572206368, - 0x65636b73756d2229, 0x7d66756e6374696f, 0x6e20532874297b6c, 0x657420653d7b7d2c, 0x6e3d303b666f7228, - 0x3b6e3c742e6c656e, 0x6774683b297b6c65, 0x7420723d742e696e, 0x6465784f66283332, 0x2c6e292c6f3d723c, - 0x303f4e614e3a4e75, 0x6d62657228752e64, 0x65636f646528742e, 0x7375626172726179, 0x286e2c722929293b, - 0x69662821286f3e30, 0x297c7c6e2b6f3e74, 0x2e6c656e67746829, 0x7468726f77206e65, 0x77204572726f7228, - 0x22436f7272757074, 0x2070617820686561, 0x64657222293b6c65, 0x7420613d752e6465, 0x636f646528742e73, - 0x7562617272617928, 0x722b312c6e2b6f2d, 0x3129292c693d612e, 0x696e6465784f6628, 0x223d22293b655b61, - 0x2e736c6963652830, 0x2c69295d3d612e73, 0x6c69636528692b31, 0x292c6e2b3d6f7d72, 0x657475726e20657d, - 0x66756e6374696f6e, 0x207a28742c65297b, 0x6c6574206e3d742e, 0x7375626172726179, 0x28652c652b353132, - 0x293b54286e293b6c, 0x657420723d79286e, 0x2c3132342c313229, 0x2c6f3d652b353132, 0x3b6966286f2b723e, - 0x742e6c656e677468, 0x297468726f77206e, 0x6577204572726f72, 0x28225472756e6361, 0x7465642074617220, - 0x6172636869766522, 0x293b72657475726e, 0x7b6865616465723a, 0x6e2c747970653a6e, 0x5b3135365d3d3d3d, - 0x303f2230223a5374, 0x72696e672e66726f, 0x6d43686172436f64, 0x65286e5b3135365d, 0x292c646174613a74, - 0x2e73756261727261, 0x79286f2c6f2b7229, 0x2c6e6578743a6f2b, 0x4d6174682e636569, 0x6c28722f35313229, - 0x2a3531327d7d6675, 0x6e6374696f6e2055, 0x28742c65297b7265, 0x7475726e20652b35, 0x31323e742e6c656e, - 0x6774687c7c742e73, 0x7562617272617928, 0x652c652b35313229, 0x2e6576657279286e, 0x3d3e6e3d3d3d3029, - 0x7d66756e6374696f, 0x6e20492874297b6c, 0x657420653d6c2874, 0x2c302c313030292c, 0x6e3d6c28742c3235, - 0x372c35293d3d3d22, 0x7573746172223f6c, 0x28742c3334352c31, 0x3535293a22223b72, 0x657475726e206e3f, - 0x60247b6e7d2f247b, 0x657d603a657d7661, 0x7220683d7b783a28, 0x742c65293d3e287b, 0x2e2e2e742c706178, - 0x3a532865292e7061, 0x74687d292c4c3a28, 0x742c65293d3e287b, 0x2e2e2e742c6c6f6e, 0x673a6c28652c302c, - 0x652e6c656e677468, 0x297d292c673a743d, 0x3e747d3b66756e63, 0x74696f6e206d2874, 0x297b6c657420653d, - 0x5b5d2c6e3d7b7d3b, 0x666f72286c657420, 0x723d303b21552874, 0x2c72293b297b6c65, 0x747b686561646572, - 0x3a6f2c747970653a, 0x612c646174613a69, 0x2c6e6578743a737d, 0x3d7a28742c72293b, 0x696628723d732c4f, - 0x626a6563742e6861, 0x734f776e28682c61, 0x29297b6e3d685b61, 0x5d286e2c69293b63, 0x6f6e74696e75657d, - 0x28613d3d3d223022, 0x7c7c613d3d3d2237, 0x22292626652e7075, 0x7368287b70617468, 0x3a6e2e7061783f3f, - 0x6e2e6c6f6e673f3f, 0x49286f292c627974, 0x65733a697d292c6e, 0x3d7b7d7d72657475, 0x726e20657d766172, - 0x20633d28742c652c, 0x2e2e2e6e293d3e74, 0x2e63707046756e63, 0x74696f6e28607765, 0x6266726f6e742e64, - 0x6576656c6f706572, 0x2e247b657d602928, 0x2e2e2e6e293b6173, 0x796e632066756e63, 0x74696f6e20672874, - 0x2c65297b6c657420, 0x6e3d5b5d2c723d30, 0x3b666f72283b3b29, 0x7b6c6574206f3d61, 0x7761697420632874, - 0x2c2272656164222c, 0x652c72293b696628, 0x6e2e70757368286f, 0x292c722b3d6f2e6c, 0x656e6774682c6f2e, - 0x6c656e6774683c32, 0x3632313434296272, 0x65616b3b69662872, 0x3e3235362a313032, 0x342a313032342974, + 0x746f206d6f726520, 0x7468616e20247b74, 0x7d20627974657360, 0x293b6e2e70757368, 0x28612e76616c7565, + 0x297d72657475726e, 0x206e65772055696e, 0x7438417272617928, 0x6177616974206e65, 0x7720426c6f62286e, + 0x292e617272617942, 0x7566666572282929, 0x7d66756e6374696f, 0x6e207528652c742c, 0x72297b6c6574206e, + 0x3d652e7375626172, 0x72617928742c742b, 0x72292c6f3d6e2e69, 0x6e6465784f662830, 0x293b72657475726e, + 0x206c2e6465636f64, 0x65286f3c303f6e3a, 0x6e2e737562617272, 0x617928302c6f2929, 0x7d66756e6374696f, + 0x6e207928652c742c, 0x72297b696628655b, 0x745d263132382972, 0x657475726e20652e, 0x7375626172726179, + 0x28742b312c742b72, 0x292e726564756365, 0x28286f2c61293d3e, 0x6f2a3235362b612c, 0x655b745d26313237, + 0x293b6c6574206e3d, 0x7528652c742c7229, 0x2e7472696d28293b, 0x696628212f5e5b30, 0x2d375d2a242f2e74, + 0x657374286e292974, 0x68726f77206e6577, 0x204572726f722822, 0x436f727275707420, 0x7461722068656164, + 0x657222293b726574, 0x75726e206e3d3d3d, 0x22223f303a706172, 0x7365496e74286e2c, 0x38297d66756e6374, + 0x696f6e207a286529, 0x7b6c657420743d30, 0x3b666f72286c6574, 0x20723d303b723c35, 0x31323b2b2b722974, + 0x2b3d723e3d313438, 0x2626723c3135363f, 0x33323a655b725d3b, 0x6966287928652c31, 0x34382c3829213d3d, + 0x74297468726f7720, 0x6e6577204572726f, 0x722822436f727275, 0x7074207461722068, 0x6561646572206368, + 0x65636b73756d2229, 0x7d66756e6374696f, 0x6e20422865297b6c, 0x657420743d7b7d2c, 0x723d303b666f7228, + 0x3b723c652e6c656e, 0x6774683b297b6c65, 0x74206e3d652e696e, 0x6465784f66283332, 0x2c72292c6f3d6e3c, + 0x303f4e614e3a4e75, 0x6d626572286c2e64, 0x65636f646528652e, 0x7375626172726179, 0x28722c6e2929293b, + 0x69662821286f3e30, 0x297c7c722b6f3e65, 0x2e6c656e67746829, 0x7468726f77206e65, 0x77204572726f7228, + 0x22436f7272757074, 0x2070617820686561, 0x64657222293b6c65, 0x7420613d6c2e6465, 0x636f646528652e73, + 0x7562617272617928, 0x6e2b312c722b6f2d, 0x3129292c693d612e, 0x696e6465784f6628, 0x223d22293b745b61, + 0x2e736c6963652830, 0x2c69295d3d612e73, 0x6c69636528692b31, 0x292c722b3d6f7d72, 0x657475726e20747d, + 0x66756e6374696f6e, 0x205428652c74297b, 0x6c657420723d652e, 0x7375626172726179, 0x28742c742b353132, + 0x293b7a2872293b6c, 0x6574206e3d792872, 0x2c3132342c313229, 0x2c6f3d742b353132, 0x3b6966286f2b6e3e, + 0x652e6c656e677468, 0x297468726f77206e, 0x6577204572726f72, 0x28225472756e6361, 0x7465642074617220, + 0x6172636869766522, 0x293b72657475726e, 0x7b6865616465723a, 0x722c747970653a72, 0x5b3135365d3d3d3d, + 0x303f2230223a5374, 0x72696e672e66726f, 0x6d43686172436f64, 0x6528725b3135365d, 0x292c646174613a65, + 0x2e73756261727261, 0x79286f2c6f2b6e29, 0x2c6e6578743a6f2b, 0x4d6174682e636569, 0x6c286e2f35313229, + 0x2a3531327d7d6675, 0x6e6374696f6e2043, 0x28652c74297b7265, 0x7475726e20742b35, 0x31323e652e6c656e, + 0x6774687c7c652e73, 0x7562617272617928, 0x742c742b35313229, 0x2e65766572792872, 0x3d3e723d3d3d3029, + 0x7d66756e6374696f, 0x6e20492865297b6c, 0x657420743d752865, 0x2c302c313030292c, 0x723d7528652c3235, + 0x372c35293d3d3d22, 0x7573746172223f75, 0x28652c3334352c31, 0x3535293a22223b72, 0x657475726e20723f, + 0x60247b727d2f247b, 0x747d603a747d7661, 0x7220773d7b783a28, 0x652c74293d3e287b, 0x2e2e2e652c706178, + 0x3a422874292e7061, 0x74687d292c4c3a28, 0x652c74293d3e287b, 0x2e2e2e652c6c6f6e, 0x673a7528742c302c, + 0x742e6c656e677468, 0x297d292c673a653d, 0x3e657d3b66756e63, 0x74696f6e206d2865, 0x297b6c657420743d, + 0x5b5d2c723d7b7d3b, 0x666f72286c657420, 0x6e3d303b21432865, 0x2c6e293b297b6c65, 0x747b686561646572, + 0x3a6f2c747970653a, 0x612c646174613a69, 0x2c6e6578743a737d, 0x3d5428652c6e293b, 0x6966286e3d732c4f, + 0x626a6563742e6861, 0x734f776e28772c61, 0x29297b723d775b61, 0x5d28722c69293b63, 0x6f6e74696e75657d, + 0x28613d3d3d223022, 0x7c7c613d3d3d2237, 0x22292626742e7075, 0x7368287b70617468, 0x3a722e7061783f3f, + 0x722e6c6f6e673f3f, 0x49286f292c627974, 0x65733a697d292c72, 0x3d7b7d7d72657475, 0x726e20747d766172, + 0x20633d28652c742c, 0x2e2e2e72293d3e65, 0x2e63707046756e63, 0x74696f6e28607765, 0x6266726f6e742e64, + 0x6576656c6f706572, 0x2e247b747d602928, 0x2e2e2e72293b6173, 0x796e632066756e63, 0x74696f6e20672865, + 0x2c74297b6c657420, 0x723d5b5d2c6e3d30, 0x3b666f72283b3b29, 0x7b6c6574206f3d61, 0x7761697420632865, + 0x2c2272656164222c, 0x742c6e293b696628, 0x722e70757368286f, 0x292c6e2b3d6f2e6c, 0x656e6774682c6f2e, + 0x6c656e6774683c32, 0x3632313434296272, 0x65616b3b6966286e, 0x3e3235362a313032, 0x342a313032342974, 0x68726f77206e6577, 0x204572726f722822, 0x50726f6a65637420, 0x66696c6520697320, 0x746f6f206c617267, 0x6522297d72657475, 0x726e206e65772055, 0x696e743841727261, 0x7928617761697420, 0x6e657720426c6f62, - 0x286e292e61727261, 0x7942756666657228, 0x29297d6173796e63, 0x2066756e6374696f, 0x6e206a28742c7b69, - 0x643a652c70617468, 0x3a6e2c6279746573, 0x3a727d2c6f297b66, 0x6f72286c65742061, 0x3d303b613c722e6c, + 0x2872292e61727261, 0x7942756666657228, 0x29297d6173796e63, 0x2066756e6374696f, 0x6e205528652c7b69, + 0x643a742c70617468, 0x3a722c6279746573, 0x3a6e7d2c6f297b66, 0x6f72286c65742061, 0x3d303b613c6e2e6c, 0x656e6774687c7c61, 0x3d3d3d303b612b3d, 0x323632313434296f, 0x3f2e7468726f7749, 0x6641626f72746564, - 0x28292c6177616974, 0x206328742c227772, 0x697465222c652c6e, 0x2c612c722e737562, 0x617272617928612c, - 0x612b323632313434, 0x29297d6173796e63, 0x2066756e6374696f, 0x6e206628742c652c, 0x6e2c7b6469726563, - 0x746f72793a723d21, 0x302c7369676e616c, 0x3a6f2c7265706c61, 0x63653a613d21307d, 0x3d7b7d297b6c6574, - 0x20693d6177616974, 0x206328742c613f22, 0x626567696e223a22, 0x626567696e4e6577, 0x222c652c72293b74, - 0x72797b666f72286c, 0x65745b732c245d6f, 0x66206e2961776169, 0x74206a28742c7b69, 0x643a692c70617468, - 0x3a732c6279746573, 0x3a247d2c6f293b6f, 0x3f2e7468726f7749, 0x6641626f72746564, 0x28292c6177616974, - 0x206328742c22636f, 0x6d6d6974222c6929, 0x7d63617463682873, 0x297b7468726f7720, 0x6177616974206328, - 0x742c2261626f7274, 0x222c69292e636174, 0x63682828293d3e7b, 0x7d292c737d7d6173, 0x796e632066756e63, - 0x74696f6e20422874, 0x2c65297b6c657420, 0x6e3d5b5d2c723d30, 0x3b666f72283b3b29, 0x7b6c65747b646f6e, - 0x653a6f2c76616c75, 0x653a617d3d617761, 0x697420742e726561, 0x6428293b6966286f, 0x2972657475726e20, - 0x6e3b696628722b3d, 0x612e6c656e677468, 0x2c723e6529746872, 0x6f77206e65772045, 0x72726f722822436f, + 0x28292c6177616974, 0x206328652c227772, 0x697465222c742c72, 0x2c612c6e2e737562, 0x617272617928612c, + 0x612b323632313434, 0x29297d6173796e63, 0x2066756e6374696f, 0x6e206628652c742c, 0x722c7b6469726563, + 0x746f72793a6e3d21, 0x302c7369676e616c, 0x3a6f2c7265706c61, 0x63653a613d21307d, 0x3d7b7d297b6c6574, + 0x20693d6177616974, 0x206328652c613f22, 0x626567696e223a22, 0x626567696e4e6577, 0x222c742c6e293b74, + 0x72797b666f72286c, 0x65745b732c535d6f, 0x6620722961776169, 0x74205528652c7b69, 0x643a692c70617468, + 0x3a732c6279746573, 0x3a537d2c6f293b6f, 0x3f2e7468726f7749, 0x6641626f72746564, 0x28292c6177616974, + 0x206328652c22636f, 0x6d6d6974222c6929, 0x7d63617463682873, 0x297b7468726f7720, 0x6177616974206328, + 0x652c2261626f7274, 0x222c69292e636174, 0x63682828293d3e7b, 0x7d292c737d7d6173, 0x796e632066756e63, + 0x74696f6e20502865, 0x2c74297b6c657420, 0x723d5b5d2c6e3d30, 0x3b666f72283b3b29, 0x7b6c65747b646f6e, + 0x653a6f2c76616c75, 0x653a617d3d617761, 0x697420652e726561, 0x6428293b6966286f, 0x2972657475726e20, + 0x723b6966286e2b3d, 0x612e6c656e677468, 0x2c6e3e7429746872, 0x6f77206e65772045, 0x72726f722822436f, 0x6d70726573736564, 0x20646f776e6c6f61, 0x6420657863656564, 0x7320697473206279, 0x7465206c696d6974, - 0x22293b6e2e707573, 0x682861297d7d6173, 0x796e632066756e63, 0x74696f6e20462874, 0x2c65297b7472797b, - 0x72657475726e2061, 0x7761697420422874, 0x2c65297d63617463, 0x68286e297b746872, 0x6f77206177616974, - 0x20742e63616e6365, 0x6c28292e63617463, 0x682828293d3e7b7d, 0x292c6e7d66696e61, 0x6c6c797b742e7265, - 0x6c656173654c6f63, 0x6b28297d7d617379, 0x6e632066756e6374, 0x696f6e206228742c, 0x653d36342a313032, - 0x342a31303234297b, 0x69662821742e6f6b, 0x297468726f77206e, 0x6577204572726f72, 0x2860446f776e6c6f, - 0x61643a2048545450, 0x20247b742e737461, 0x7475737d60293b69, 0x66284e756d626572, 0x28742e6865616465, - 0x72732e6765742822, 0x636f6e74656e742d, 0x6c656e6774682229, 0x293e65297468726f, 0x77206e6577204572, + 0x22293b722e707573, 0x682861297d7d6173, 0x796e632066756e63, 0x74696f6e20242865, 0x2c74297b7472797b, + 0x72657475726e2061, 0x7761697420502865, 0x2c74297d63617463, 0x682872297b746872, 0x6f77206177616974, + 0x20652e63616e6365, 0x6c28292e63617463, 0x682828293d3e7b7d, 0x292c727d66696e61, 0x6c6c797b652e7265, + 0x6c656173654c6f63, 0x6b28297d7d617379, 0x6e632066756e6374, 0x696f6e206228652c, 0x743d36342a313032, + 0x342a31303234297b, 0x69662821652e6f6b, 0x297468726f77206e, 0x6577204572726f72, 0x2860446f776e6c6f, + 0x61643a2048545450, 0x20247b652e737461, 0x7475737d60293b69, 0x66284e756d626572, 0x28652e6865616465, + 0x72732e6765742822, 0x636f6e74656e742d, 0x6c656e6774682229, 0x293e74297468726f, 0x77206e6577204572, 0x726f722822436f6d, 0x7072657373656420, 0x646f776e6c6f6164, 0x2065786365656473, 0x2069747320627974, 0x65206c696d697422, 0x293b72657475726e, 0x206e65772055696e, 0x7438417272617928, 0x6177616974206e65, - 0x7720426c6f622861, 0x7761697420462874, 0x2e626f64792e6765, 0x7452656164657228, 0x292c6529292e6172, - 0x7261794275666665, 0x722829297d766172, 0x204f3d2f5b5c5c5c, 0x303a2a3f223c3e7c, 0x5d2f2c433d743d3e, - 0x742e73706c697428, 0x222f22292e736f6d, 0x6528653d3e21657c, 0x7c653d3d3d222e22, 0x7c7c653d3d3d222e, - 0x2e22293b66756e63, 0x74696f6e20762874, 0x297b72657475726e, 0x20747970656f6620, 0x74213d2273747269, - 0x6e67227c7c21747c, 0x7c4f2e7465737428, 0x74293f21303a4328, 0x74297d7661722077, 0x3d743d3e21762874, - 0x292c503d6e657720, 0x546578744465636f, 0x6465723b66756e63, 0x74696f6e20412874, 0x2c65297b69662821, - 0x652e706174682e73, 0x7461727473576974, 0x6828227061636b61, 0x67652f2229297468, 0x726f77206e657720, + 0x7720426c6f622861, 0x7761697420242865, 0x2e626f64792e6765, 0x7452656164657228, 0x292c7429292e6172, + 0x7261794275666665, 0x722829297d766172, 0x206a3d2f5b5c5c5c, 0x303a2a3f223c3e7c, 0x5d2f2c413d653d3e, + 0x652e73706c697428, 0x222f22292e736f6d, 0x6528743d3e21747c, 0x7c743d3d3d222e22, 0x7c7c743d3d3d222e, + 0x2e22293b66756e63, 0x74696f6e20762865, 0x297b72657475726e, 0x20747970656f6620, 0x65213d2273747269, + 0x6e67227c7c21657c, 0x7c6a2e7465737428, 0x65293f21303a4128, 0x65297d7661722064, 0x3d653d3e21762865, + 0x292c4f3d6e657720, 0x546578744465636f, 0x6465723b66756e63, 0x74696f6e20462865, 0x2c74297b69662821, + 0x742e706174682e73, 0x7461727473576974, 0x6828227061636b61, 0x67652f2229297468, 0x726f77206e657720, 0x4572726f72282249, 0x6e76616c69642065, 0x6e7669726f6e6d65, 0x6e74206172636869, 0x766520726f6f7422, - 0x293b6c6574206e3d, 0x652e706174682e73, 0x6c6963652838293b, 0x6966282177286e29, 0x7c7c742e68617328, - 0x6e29297468726f77, 0x206e657720457272, 0x6f722822496e7661, 0x6c6964206f722064, 0x75706c6963617465, - 0x20656e7669726f6e, 0x6d656e7420706174, 0x6822293b742e7365, 0x74286e2c652e6279, 0x746573297d66756e, - 0x6374696f6e204c28, 0x74297b6c65742065, 0x3d6e6577204d6170, 0x3b666f72286c6574, 0x206e206f66206d28, - 0x7429294128652c6e, 0x293b72657475726e, 0x20657d66756e6374, 0x696f6e205228742c, 0x65297b7265747572, - 0x6e20742e70726f74, 0x6f636f6c213d3d31, 0x7c7c217728742e65, 0x6e747279293f2131, 0x3a652e6861732874, - 0x2e656e747279297d, 0x6173796e63206675, 0x6e6374696f6e2078, 0x28742c65297b6177, 0x616974207028742c, - 0x65293b6c6574206e, 0x3d4c286177616974, 0x2064287429293b69, 0x6628216e2e686173, 0x2822656e7669726f, + 0x293b6c657420723d, 0x742e706174682e73, 0x6c6963652838293b, 0x6966282164287229, 0x7c7c652e68617328, + 0x7229297468726f77, 0x206e657720457272, 0x6f722822496e7661, 0x6c6964206f722064, 0x75706c6963617465, + 0x20656e7669726f6e, 0x6d656e7420706174, 0x6822293b652e7365, 0x7428722c742e6279, 0x746573297d66756e, + 0x6374696f6e204c28, 0x65297b6c65742074, 0x3d6e6577204d6170, 0x3b666f72286c6574, 0x2072206f66206d28, + 0x6529294628742c72, 0x293b72657475726e, 0x20747d66756e6374, 0x696f6e204e28652c, 0x74297b7265747572, + 0x6e20652e70726f74, 0x6f636f6c213d3d31, 0x7c7c216428652e65, 0x6e747279293f2131, 0x3a742e6861732865, + 0x2e656e747279297d, 0x6173796e63206675, 0x6e6374696f6e2078, 0x28652c74297b6177, 0x616974206828652c, + 0x74293b6c65742072, 0x3d4c286177616974, 0x2070286529293b69, 0x662821722e686173, 0x2822656e7669726f, 0x6e6d656e742e6a73, 0x6f6e222929746872, 0x6f77206e65772045, 0x72726f722822456e, 0x7669726f6e6d656e, 0x7420617263686976, 0x6520686173206e6f, 0x20656e7669726f6e, 0x6d656e742e6a736f, 0x6e22293b6c657420, - 0x723d4a534f4e2e70, 0x6172736528502e64, 0x65636f6465286e2e, 0x6765742822656e76, 0x69726f6e6d656e74, - 0x2e6a736f6e222929, 0x293b696628215228, 0x722c6e2929746872, 0x6f77206e65772045, 0x72726f722822556e, + 0x6e3d4a534f4e2e70, 0x61727365284f2e64, 0x65636f646528722e, 0x6765742822656e76, 0x69726f6e6d656e74, + 0x2e6a736f6e222929, 0x293b696628214e28, 0x6e2c722929746872, 0x6f77206e65772045, 0x72726f722822556e, 0x737570706f727465, 0x642057656246726f, 0x6e7420646576656c, 0x6f70657220656e76, 0x69726f6e6d656e74, - 0x22293b7265747572, 0x6e7b66696c65733a, 0x6e2c6d616e696665, 0x73743a727d7d7661, 0x72206b3d222e7765, + 0x22293b7265747572, 0x6e7b66696c65733a, 0x722c6d616e696665, 0x73743a6e7d7d7661, 0x7220453d222e7765, 0x6266726f6e742f64, 0x6576656c6f706572, 0x2f656e7669726f6e, 0x6d656e742e74677a, 0x223b6173796e6320, - 0x66756e6374696f6e, 0x204e28742c65297b, 0x7472797b6c657420, 0x6e3d617761697420, 0x6728742c6b293b72, - 0x657475726e206177, 0x6169742078286e2c, 0x65292c6e7d636174, 0x63687b7265747572, 0x6e206e756c6c7d7d, - 0x6173796e63206675, 0x6e6374696f6e2057, 0x28742c65297b6c65, 0x74206e3d6e657720, 0x55524c28742e656e, - 0x7669726f6e6d656e, 0x742c6c6f63617469, 0x6f6e2e6872656629, 0x3b6966286e2e7072, 0x6f746f636f6c213d, - 0x3d2268747470733a, 0x2226266e2e6f7269, 0x67696e213d3d6c6f, 0x636174696f6e2e6f, 0x726967696e297468, + 0x66756e6374696f6e, 0x205228652c74297b, 0x7472797b6c657420, 0x723d617761697420, 0x6728652c45293b72, + 0x657475726e206177, 0x616974207828722c, 0x74292c727d636174, 0x63687b7265747572, 0x6e206e756c6c7d7d, + 0x6173796e63206675, 0x6e6374696f6e2044, 0x28652c74297b6c65, 0x7420723d6e657720, 0x55524c28652e656e, + 0x7669726f6e6d656e, 0x742c6c6f63617469, 0x6f6e2e6872656629, 0x3b696628722e7072, 0x6f746f636f6c213d, + 0x3d2268747470733a, 0x222626722e6f7269, 0x67696e213d3d6c6f, 0x636174696f6e2e6f, 0x726967696e297468, 0x726f77206e657720, 0x4572726f72282254, 0x686520656e766972, 0x6f6e6d656e74206d, 0x7573742075736520, - 0x4854545053206f72, 0x2074686520617070, 0x6c69636174696f6e, 0x206f726967696e22, 0x293b6c657420723d, - 0x6177616974206528, 0x6e293b6966282172, 0x2e6f6b297468726f, 0x77206e6577204572, 0x726f722860456e76, - 0x69726f6e6d656e74, 0x20646f776e6c6f61, 0x643a204854545020, 0x247b722e73746174, 0x75737d60293b7265, - 0x7475726e20622872, 0x297d66756e637469, 0x6f6e20442874297b, 0x72657475726e2174, 0x7c7c217728742e61, - 0x726368697665293f, 0x21313a537472696e, 0x6728742e696e7465, 0x6772697479292e73, 0x7461727473576974, - 0x6828227368613531, 0x322d22297d66756e, 0x6374696f6e204828, 0x742c65297b726574, 0x75726e204f626a65, - 0x63742e66726f6d45, 0x6e7472696573284f, 0x626a6563742e656e, 0x747269657328742e, 0x7374617274657273, - 0x3f3f7b7d292e6d61, 0x7028285b6e2c725d, 0x293d3e7b69662821, 0x4428722929746872, 0x6f77206e65772045, + 0x4854545053206f72, 0x2074686520617070, 0x6c69636174696f6e, 0x206f726967696e22, 0x293b6c6574206e3d, + 0x6177616974207428, 0x72293b696628216e, 0x2e6f6b297468726f, 0x77206e6577204572, 0x726f722860456e76, + 0x69726f6e6d656e74, 0x20646f776e6c6f61, 0x643a204854545020, 0x247b6e2e73746174, 0x75737d60293b7265, + 0x7475726e2062286e, 0x297d66756e637469, 0x6f6e20482865297b, 0x72657475726e2165, 0x7c7c216428652e61, + 0x726368697665293f, 0x21313a537472696e, 0x6728652e696e7465, 0x6772697479292e73, 0x7461727473576974, + 0x6828227368613531, 0x322d22297d66756e, 0x6374696f6e205728, 0x652c74297b726574, 0x75726e204f626a65, + 0x63742e66726f6d45, 0x6e7472696573284f, 0x626a6563742e656e, 0x747269657328652e, 0x7374617274657273, + 0x3f3f7b7d292e6d61, 0x7028285b722c6e5d, 0x293d3e7b69662821, 0x48286e2929746872, 0x6f77206e65772045, 0x72726f722822496e, 0x76616c6964207069, 0x6e6e656420737461, 0x72746572206d6574, 0x616461746122293b, - 0x72657475726e5b6e, 0x2c7b75726c3a6e65, 0x772055524c28722e, 0x617263686976652c, 0x65292e687265662c, - 0x696e746567726974, 0x793a722e696e7465, 0x67726974797d5d7d, 0x29297d6173796e63, 0x2066756e6374696f, - 0x6e204528742c652c, 0x6e3d66657463682c, 0x723d28293d3e7b7d, 0x297b6c6574206f3d, 0x6177616974204e28, - 0x742c652e696e7465, 0x6772697479293b6f, 0x3f7228225573696e, 0x6720766572696669, 0x6564206361636865, - 0x6420646576656c6f, 0x70657220656e7669, 0x726f6e6d656e7422, 0x293a28722822446f, 0x776e6c6f6164696e, - 0x6720646576656c6f, 0x70657220656e7669, 0x726f6e6d656e7422, 0x292c6f3d61776169, 0x74205728652c6e29, - 0x293b6c65747b6669, 0x6c65733a612c6d61, 0x6e69666573743a69, 0x7d3d617761697420, 0x78286f2c652e696e, - 0x7465677269747929, 0x2c733d4828692c6e, 0x65772055524c2865, 0x2e656e7669726f6e, 0x6d656e742c6c6f63, - 0x6174696f6e2e6872, 0x656629293b726574, 0x75726e2061776169, 0x74206628742c222e, 0x77656266726f6e74, - 0x2f646576656c6f70, 0x65722f656e766972, 0x6f6e6d656e74222c, 0x61292c6177616974, 0x206628742c6b2c6e, + 0x72657475726e5b72, 0x2c7b75726c3a6e65, 0x772055524c286e2e, 0x617263686976652c, 0x74292e687265662c, + 0x696e746567726974, 0x793a6e2e696e7465, 0x67726974797d5d7d, 0x29297d6173796e63, 0x2066756e6374696f, + 0x6e206b28652c742c, 0x723d66657463682c, 0x6e3d28293d3e7b7d, 0x297b6c6574206f3d, 0x6177616974205228, + 0x652c742e696e7465, 0x6772697479293b6f, 0x3f6e28225573696e, 0x6720766572696669, 0x6564206361636865, + 0x6420646576656c6f, 0x70657220656e7669, 0x726f6e6d656e7422, 0x293a286e2822446f, 0x776e6c6f6164696e, + 0x6720646576656c6f, 0x70657220656e7669, 0x726f6e6d656e7422, 0x292c6f3d61776169, 0x74204428742c7229, + 0x293b6c65747b6669, 0x6c65733a612c6d61, 0x6e69666573743a69, 0x7d3d617761697420, 0x78286f2c742e696e, + 0x7465677269747929, 0x2c733d5728692c6e, 0x65772055524c2874, 0x2e656e7669726f6e, 0x6d656e742c6c6f63, + 0x6174696f6e2e6872, 0x656629293b726574, 0x75726e2061776169, 0x74206628652c222e, 0x77656266726f6e74, + 0x2f646576656c6f70, 0x65722f656e766972, 0x6f6e6d656e74222c, 0x61292c6177616974, 0x206628652c452c6e, 0x6577204d6170285b, 0x5b226f7574707574, 0x222c6f5d5d292c7b, 0x6469726563746f72, 0x793a21317d292c7b, 0x75726c3a602f7765, 0x6266726f6e742f64, 0x6576656c6f706572, 0x2f656e7669726f6e, 0x6d656e742f247b69, - 0x2e656e7472797d60, 0x2c636f6e6669673a, 0x7b2e2e2e652c7374, 0x6172746572733a73, 0x7d7d7d6966287479, + 0x2e656e7472797d60, 0x2c636f6e6669673a, 0x7b2e2e2e742c7374, 0x6172746572733a73, 0x7d7d7d6966287479, 0x70656f6620646f63, 0x756d656e743c2275, 0x222626646f63756d, 0x656e742e67657445, 0x6c656d656e744279, - 0x4964282272657472, 0x792229297b6c6574, 0x20743d646f63756d, 0x656e742e67657445, 0x6c656d656e744279, - 0x4964282273746174, 0x757322292c653d64, 0x6f63756d656e742e, 0x676574456c656d65, 0x6e74427949642822, - 0x726574727922292c, 0x6e3d6173796e6328, 0x293d3e7b652e6869, 0x6464656e3d21303b, 0x7472797b61776169, - 0x742077656246726f, 0x6e742e7265616479, 0x3b6c657420723d4a, 0x534f4e2e70617273, 0x6528617761697420, + 0x4964282272657472, 0x792229297b6c6574, 0x20653d646f63756d, 0x656e742e67657445, 0x6c656d656e744279, + 0x4964282273746174, 0x757322292c743d64, 0x6f63756d656e742e, 0x676574456c656d65, 0x6e74427949642822, + 0x726574727922292c, 0x723d6173796e6328, 0x293d3e7b742e6869, 0x6464656e3d21303b, 0x7472797b61776169, + 0x742077656246726f, 0x6e742e7265616479, 0x3b6c6574206e3d4a, 0x534f4e2e70617273, 0x6528617761697420, 0x632877656246726f, 0x6e742c22636f6e66, 0x69672229292c7b75, 0x726c3a6f2c636f6e, 0x6669673a617d3d61, - 0x7761697420452877, 0x656246726f6e742c, 0x722c66657463682c, 0x733d3e7b742e7465, 0x7874436f6e74656e, + 0x77616974206b2877, 0x656246726f6e742c, 0x6e2c66657463682c, 0x733d3e7b652e7465, 0x7874436f6e74656e, 0x743d737d293b6177, 0x6169742861776169, 0x7420696d706f7274, 0x286f29292e6d6f75, 0x6e74287b62726964, 0x67653a7765624672, 0x6f6e742c636f6e66, 0x69673a612c746572, 0x6d696e616c3a646f, 0x63756d656e742e67, 0x6574456c656d656e, 0x7442794964282274, 0x65726d696e616c22, 0x292c707265766965, 0x773a646f63756d65, - 0x6e742e676574456c, 0x656d656e74427949, 0x6428227072657669, 0x657722297d292c74, 0x2e74657874436f6e, + 0x6e742e676574456c, 0x656d656e74427949, 0x6428227072657669, 0x657722297d292c65, 0x2e74657874436f6e, 0x74656e743d224465, 0x76656c6f70657220, 0x656e7669726f6e6d, 0x656e742072656164, 0x792e205479706520, - 0x77662068656c702e, 0x227d636174636828, 0x72297b742e746578, 0x74436f6e74656e74, 0x3d60426f6f747374, - 0x726170206661696c, 0x65643a20247b722e, 0x6d6573736167657d, 0x602c652e68696464, 0x656e3d21317d7d3b, - 0x652e616464457665, 0x6e744c697374656e, 0x65722822636c6963, 0x6b222c6e292c6e28, 0x297d0a0000000000 + 0x77662068656c702e, 0x227d636174636828, 0x6e297b652e746578, 0x74436f6e74656e74, 0x3d60426f6f747374, + 0x726170206661696c, 0x65643a20247b6e2e, 0x6d6573736167657d, 0x602c742e68696464, 0x656e3d21317d7d3b, + 0x742e616464457665, 0x6e744c697374656e, 0x65722822636c6963, 0x6b222c72292c7228, 0x297d0a0000000000 }; }; diff --git a/include/webfront/system/DeveloperFS.hpp b/include/webfront/system/DeveloperFS.hpp index f8ac16cf..a475e34d 100644 --- a/include/webfront/system/DeveloperFS.hpp +++ b/include/webfront/system/DeveloperFS.hpp @@ -6,6 +6,14 @@ #include "DeveloperStore.hpp" #include "IndexFS.hpp" +#include +#include +#include +#include +#include +#include +#include + namespace webfront::fs { class DeveloperFS { diff --git a/include/webfront/system/DeveloperFiles.hpp b/include/webfront/system/DeveloperFiles.hpp index ec974ba6..c8ca64ce 100644 --- a/include/webfront/system/DeveloperFiles.hpp +++ b/include/webfront/system/DeveloperFiles.hpp @@ -5,7 +5,16 @@ #include #include +#include +#include +#include +#include +#include #include +#include +#include +#include +#include namespace webfront::developer { diff --git a/include/webfront/system/DeveloperJournal.hpp b/include/webfront/system/DeveloperJournal.hpp index 72ce233e..e82e56a3 100644 --- a/include/webfront/system/DeveloperJournal.hpp +++ b/include/webfront/system/DeveloperJournal.hpp @@ -4,12 +4,24 @@ #include "WindowsCompat.hpp" #include "DeveloperPaths.hpp" +#include +#include +#include +#include #include +#include +#include +#include #include #include #include #include +#include +#include #include +#include +#include +#include #if !defined(_WIN32) #include diff --git a/include/webfront/system/DeveloperPaths.hpp b/include/webfront/system/DeveloperPaths.hpp index 36c87403..338620cf 100644 --- a/include/webfront/system/DeveloperPaths.hpp +++ b/include/webfront/system/DeveloperPaths.hpp @@ -1,13 +1,17 @@ /// @brief Path containment helpers of the developer store. #pragma once -#include "ToolStore.hpp" +#include "SafePath.hpp" + +#include +#include +#include namespace webfront::developer { // Resolve existing parents too: a symlink must never turn a relative project path into an escape. inline std::filesystem::path projectPath(const std::filesystem::path& root, std::string_view relative) { - const auto path = root / fs::tools::safeRelativePath(relative); + const auto path = root / fs::safeRelativePath(relative); const auto resolved = std::filesystem::weakly_canonical(path); auto base = root.begin(); auto part = resolved.begin(); diff --git a/include/webfront/system/DeveloperStore.hpp b/include/webfront/system/DeveloperStore.hpp index 51189cf0..be6629eb 100644 --- a/include/webfront/system/DeveloperStore.hpp +++ b/include/webfront/system/DeveloperStore.hpp @@ -7,8 +7,23 @@ #include #include +#include +#include +#include +#include +#include +#include +#include +#include #include #include +#include +#include +#include +#include +#include +#include +#include namespace webfront::developer { @@ -423,7 +438,7 @@ class Store { static std::filesystem::path checkedChunk(const Transaction& tx, const std::string& path, std::size_t size) { if (!tx.directory && path != "output") throw std::invalid_argument("Expected output file"); - auto relative = fs::tools::safeRelativePath(path); + auto relative = fs::safeRelativePath(path); requireWithinLimits(tx, size); return relative; } diff --git a/include/webfront/system/PackageFS.hpp b/include/webfront/system/PackageFS.hpp deleted file mode 100644 index 86de9cb1..00000000 --- a/include/webfront/system/PackageFS.hpp +++ /dev/null @@ -1,91 +0,0 @@ -/// @brief Virtual file system serving the web tools installed by the wf tool manager under -/// webfront/tools//, from the versions recorded in the project's lock file (see ToolStore). -#pragma once - -#include "FileSystem.hpp" -#include "ToolStore.hpp" - -#include -#include -#include -#include -#include -#include - -namespace webfront::fs { - -namespace detail { - -inline std::string encodePath(std::string_view path) { - constexpr std::string_view kept = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~/@"; - constexpr std::string_view hexDigits = "0123456789ABCDEF"; - std::string encoded; - for (const char c : path) { - const auto byte = static_cast(c); - if (kept.find(c) != std::string_view::npos) - encoded += c; - else - encoded += {'%', hexDigits[byte >> 4], hexDigits[byte & 0xF]}; - } - return encoded; -} - -} // namespace detail - -/// Default project location of the installed tools: the process's working directory when the -/// application starts. -struct CurrentDirectory { - static std::filesystem::path get() { - return std::filesystem::current_path(); - } -}; - -/// Serves webfront/tools// from the installed version of . The lock file is read -/// on each request, so tools installed or removed while the application runs are served at once. -/// Location::get() gives the project directory; the ToolManager component must use the same one. -/// Development only: an installed tool runs in the application's origin. -template -class BasicPackageFS { -public: - static constexpr std::string_view prefix = "webfront/tools/"; - - explicit BasicPackageFS(std::filesystem::path /*docRoot*/) : project(Location::get()) {} - - /// Absolute URL path of a file of an installed tool, such as the page of its entry. Characters - /// other than unreserved ones, '/' and '@' are percent-encoded, so the server decodes it back. - static std::string url(std::string_view name, std::string_view path) { - return "/" + std::string(prefix) + detail::encodePath(name) + "/" + detail::encodePath(path); - } - - std::optional open(std::filesystem::path file) const { - const auto filename = file.relative_path().generic_string(); - if (!filename.starts_with(prefix)) - return {}; - const auto rest = std::string_view(filename).substr(prefix.size()); - // A scoped name ("@scope/name") spans two components. - const auto nameEnd = rest.find('/', rest.starts_with('@') ? rest.find('/') + 1 : 0); - if (nameEnd == std::string_view::npos) - return {}; - try { - const ToolStore store{project}; - const auto record = store.find(rest.substr(0, nameEnd)); - if (!record) - return {}; - const auto path = store.installDir(record->name, record->version) / tools::safeRelativePath(rest.substr(nameEnd + 1)); - if (!std::filesystem::is_regular_file(path)) - return {}; - std::ifstream stream(path, std::ios::binary); - if (stream.is_open()) - return File{std::move(stream)}; - } catch (const std::exception&) { // malformed lock file or unsafe path: not served - } - return {}; - } - -private: - std::filesystem::path project; -}; - -using PackageFS = BasicPackageFS<>; - -} // namespace webfront::fs diff --git a/include/webfront/system/SafePath.hpp b/include/webfront/system/SafePath.hpp new file mode 100644 index 00000000..92b2a2df --- /dev/null +++ b/include/webfront/system/SafePath.hpp @@ -0,0 +1,51 @@ +/// @brief Relative paths received from the browser, checked to stay inside the directory they name a file of. +#pragma once + +#include +#include +#include +#include +#include +#include + +namespace webfront::fs { + +namespace detail { + +inline std::filesystem::path fromUtf8(std::string_view text) { + return std::filesystem::path(std::u8string(reinterpret_cast(text.data()), text.size())); +} + +// The HTTP server rejects every URL containing "..", so a path containing it could be written but never served. +inline bool hasSafeCharacters(std::string_view path) { + using namespace std::string_view_literals; + if (path.size() > 4096 || path.find("..") != std::string_view::npos) + return false; + return path.find_first_of("\\:*?\"<>|\0"sv) == std::string_view::npos; +} + +// Appends a component unless it is empty, "." or ".." (or "...", which no path needs). +inline bool appendComponent(std::filesystem::path& path, std::string_view component) { + if (component.find_first_not_of('.') == std::string_view::npos) + return false; + path /= fromUtf8(component); + return true; +} + +} // namespace detail + +/// Converts a '/'-separated path received from the browser into a relative path that stays inside +/// its directory. Rejects empty and absolute paths, empty, "." and ".." components, backslashes, +/// colons (drive letters and alternate streams), the other characters Windows forbids in file names +/// (*?"<>|) and NUL, on every platform, with std::invalid_argument. +inline std::filesystem::path safeRelativePath(std::string_view path) { + std::filesystem::path result; + bool safe = detail::hasSafeCharacters(path); + for (const auto part : std::views::split(path, '/')) + safe = safe && detail::appendComponent(result, std::string_view(part.begin(), part.end())); + if (!safe || result.empty()) + throw std::invalid_argument("Unsafe path '" + std::string(path) + "'"); + return result; +} + +} // namespace webfront::fs diff --git a/include/webfront/system/TerminalFS.hpp b/include/webfront/system/TerminalFS.hpp deleted file mode 100644 index 0daec7b0..00000000 --- a/include/webfront/system/TerminalFS.hpp +++ /dev/null @@ -1,44 +0,0 @@ -/// @brief Virtual file system serving the terminal component's page, module and the vendored -/// xterm.js distribution (MIT, see third_party/xterm/LICENSE) under webfront/components/terminal/. -#pragma once - -#include "FileSystem.hpp" -#include "TerminalIndexHtmlData.hpp" -#include "TerminalModuleData.hpp" -#include "XtermCssData.hpp" -#include "XtermFitAddonData.hpp" -#include "XtermModuleData.hpp" - -#include -#include -#include - -namespace webfront::fs { - -class TerminalFS { -public: - static constexpr std::string_view prefix = "webfront/components/terminal/"; - static constexpr std::string_view page = "webfront/components/terminal/index.html"; - - explicit TerminalFS(std::filesystem::path /*docRoot*/) {} - - static std::optional open(std::filesystem::path file) { - const auto filename = file.relative_path().generic_string(); - if (!filename.starts_with(prefix)) - return {}; - const auto name = std::string_view(filename).substr(prefix.size()); - if (name == "index.html") - return File{generated::TerminalIndexHtmlData{}}; - if (name == "terminal.mjs") - return File{generated::TerminalModuleData{}}; - if (name == "xterm.mjs") - return File{generated::XtermModuleData{}}; - if (name == "xterm.css") - return File{generated::XtermCssData{}}; - if (name == "addon-fit.mjs") - return File{generated::XtermFitAddonData{}}; - return {}; - } -}; - -} // namespace webfront::fs diff --git a/include/webfront/system/TerminalIndexHtmlData.hpp b/include/webfront/system/TerminalIndexHtmlData.hpp deleted file mode 100644 index 7dbe56af..00000000 --- a/include/webfront/system/TerminalIndexHtmlData.hpp +++ /dev/null @@ -1,33 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -namespace webfront::fs::generated { - -struct TerminalIndexHtmlData { - static constexpr std::string_view encoding{}; - static constexpr std::size_t dataSize{617}; - static constexpr std::array data{ - 0x3c21444f43545950, 0x452068746d6c3e0a, 0x3c68746d6c206c61, 0x6e673d22656e223e, 0x0a3c686561643e0a, - 0x3c6d657461206368, 0x61727365743d2275, 0x74662d38223e0a3c, 0x6d657461206e616d, 0x653d227669657770, - 0x6f72742220636f6e, 0x74656e743d227769, 0x6474683d64657669, 0x63652d7769647468, 0x2c20696e69746961, - 0x6c2d7363616c653d, 0x31223e0a3c746974, 0x6c653e5765624672, 0x6f6e74205465726d, 0x696e616c3c2f7469, - 0x746c653e0a3c6c69, 0x6e6b2072656c3d22, 0x7374796c65736865, 0x6574222068726566, 0x3d22787465726d2e, - 0x637373223e0a3c73, 0x74796c653e0a2020, 0x68746d6c2c20626f, 0x6479207b20686569, 0x6768743a20313030, - 0x253b206d61726769, 0x6e3a20303b206261, 0x636b67726f756e64, 0x3a20233064313131, 0x373b207d0a202023, - 0x7465726d696e616c, 0x207b20706f736974, 0x696f6e3a20616273, 0x6f6c7574653b2069, 0x6e7365743a20302e, - 0x3572656d3b207d0a, 0x3c2f7374796c653e, 0x0a3c2f686561643e, 0x0a3c626f64793e0a, 0x3c6469762069643d, - 0x227465726d696e61, 0x6c2220617269612d, 0x6c6162656c3d2257, 0x656246726f6e7420, 0x7465726d696e616c, - 0x223e3c2f6469763e, 0x0a3c736372697074, 0x207372633d222f57, 0x656246726f6e742e, 0x6a73223e3c2f7363, - 0x726970743e0a3c73, 0x6372697074207479, 0x70653d226d6f6475, 0x6c65223e0a202069, 0x6d706f7274207b6d, - 0x6f756e747d206672, 0x6f6d20222e2f7465, 0x726d696e616c2e6d, 0x6a73223b0a202067, 0x6c6f62616c546869, - 0x732e77656266726f, 0x6e745465726d696e, 0x616c203d20617761, 0x6974206d6f756e74, 0x28646f63756d656e, - 0x742e676574456c65, 0x6d656e7442794964, 0x28227465726d696e, 0x616c2229293b0a3c, 0x2f7363726970743e, - 0x0a3c2f626f64793e, 0x0a3c2f68746d6c3e, 0x0a00000000000000 - }; -}; - -} // namespace webfront::fs::generated diff --git a/include/webfront/system/TerminalModuleData.hpp b/include/webfront/system/TerminalModuleData.hpp deleted file mode 100644 index 70bd555a..00000000 --- a/include/webfront/system/TerminalModuleData.hpp +++ /dev/null @@ -1,343 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -namespace webfront::fs::generated { - -struct TerminalModuleData { - static constexpr std::string_view encoding{}; - static constexpr std::size_t dataSize{13037}; - static constexpr std::array data{ - 0x2f2f2f2040627269, 0x6566205765624672, 0x6f6e74207465726d, 0x696e616c20636f6d, 0x706f6e656e743a20, - 0x616e20787465726d, 0x2e6a73207465726d, 0x696e616c2077686f, 0x7365206c696e6520, 0x656469746f722073, - 0x656e647320656163, 0x682076616c696461, 0x7465640a2f2f2f20, 0x6c696e6520746f20, 0x74686520432b2b20, - 0x636f6d6d616e6473, 0x2072656769737465, 0x726564207468726f, 0x7567682077656266, 0x726f6e743a3a5465, - 0x726d696e616c2028, 0x696e636c7564652f, 0x77656266726f6e74, 0x2f636f6d706f6e65, 0x6e74732f5465726d, - 0x696e616c2e687070, 0x292c0a2f2f2f2075, 0x6e6c657373206120, 0x62726f7773657220, 0x636f6d6d616e6420, - 0x6f6620616e206578, 0x74656e73696f6e20, 0x6d6f64756c652028, 0x5465726d696e616c, 0x3a3a657874656e73, - 0x696f6e292068616e, 0x646c657320697420, 0x66697273742e0a0a, 0x696d706f7274207b, 0x5465726d696e616c, - 0x7d2066726f6d2022, 0x2e2f787465726d2e, 0x6d6a73223b0a696d, 0x706f7274207b4669, 0x744164646f6e7d20, - 0x66726f6d20222e2f, 0x6164646f6e2d6669, 0x742e6d6a73223b0a, 0x0a636f6e73742061, 0x6e7369203d207b0a, - 0x202020207265643a, 0x2028746578742920, 0x3d3e20605c783162, 0x5b33316d247b7465, 0x78747d5c7831625b, - 0x306d602c0a202020, 0x20636c656172546f, 0x456e643a20225c78, 0x31625b4b222c0a20, 0x202020636c656172, - 0x53637265656e3a20, 0x225c7831625b324a, 0x5c7831625b334a5c, 0x7831625b48222c0a, 0x202020206c656674, - 0x3a2028636f756e74, 0x29203d3e2028636f, 0x756e74203e203020, 0x3f20605c7831625b, 0x247b636f756e747d, - 0x4460203a20222229, 0x2c0a7d3b0a0a6675, 0x6e6374696f6e2063, 0x6f6d6d6f6e507265, 0x66697828776f7264, - 0x7329207b0a202020, 0x2072657475726e20, 0x776f7264732e7265, 0x6475636528287072, 0x656669782c20776f, - 0x726429203d3e207b, 0x0a20202020202020, 0x20636f6e7374206c, 0x696d6974203d204d, 0x6174682e6d696e28, - 0x7072656669782e6c, 0x656e6774682c2077, 0x6f72642e6c656e67, 0x7468293b0a202020, 0x20202020206c6574, - 0x206c656e67746820, 0x3d20303b0a202020, 0x2020202020776869, 0x6c6520286c656e67, 0x7468203c206c696d, - 0x6974202626207072, 0x656669785b6c656e, 0x6774685d203d3d3d, 0x20776f72645b6c65, 0x6e6774685d290a20, - 0x2020202020202020, 0x2020202b2b6c656e, 0x6774683b0a202020, 0x2020202020726574, 0x75726e2070726566, - 0x69782e736c696365, 0x28302c206c656e67, 0x7468293b0a202020, 0x207d293b0a7d0a0a, 0x2f2f205265616473, - 0x2061206c696e6520, 0x666f7220746f6b65, 0x6e697a6528292c20, 0x6f6e6520776f7264, 0x2070617274206174, - 0x20612074696d652e, 0x0a636c6173732053, 0x63616e6e6572207b, 0x0a20202020636f6e, 0x7374727563746f72, - 0x286c696e6529207b, 0x0a20202020202020, 0x20746869732e6c69, 0x6e65203d206c696e, 0x653b0a2020202020, - 0x202020746869732e, 0x696e646578203d20, 0x303b0a202020207d, 0x0a0a202020206765, 0x7420646f6e652829, - 0x207b0a2020202020, 0x2020207265747572, 0x6e20746869732e69, 0x6e646578203d3d3d, 0x20746869732e6c69, - 0x6e652e6c656e6774, 0x683b0a202020207d, 0x0a0a202020206e65, 0x78742870726f626c, 0x656d29207b0a2020, - 0x2020202020206966, 0x2028746869732e64, 0x6f6e65290a202020, 0x2020202020202020, 0x207468726f77206e, - 0x65772053796e7461, 0x784572726f722870, 0x726f626c656d293b, 0x0a20202020202020, 0x2072657475726e20, - 0x746869732e6c696e, 0x655b746869732e69, 0x6e6465782b2b5d3b, 0x0a202020207d0a0a, 0x202020202f2f2054, - 0x686520636f6e7465, 0x6e74206f66206120, 0x71756f7465642073, 0x7472696e67207768, 0x6f7365206f70656e, - 0x696e672071756f74, 0x6520776173207265, 0x61642e20496e7369, 0x646520646f75626c, 0x652071756f746573, - 0x2061206261636b73, 0x6c6173680a202020, 0x202f2f2065736361, 0x7065732074686520, 0x6e65787420636861, - 0x7261637465723b20, 0x6f6e6520656e6469, 0x6e6720746865206c, 0x696e652073746179, 0x73206c6974657261, - 0x6c2c20616e642074, 0x6865206d69737369, 0x6e6720636c6f7369, 0x6e672071756f7465, 0x0a202020202f2f20, - 0x6973207265706f72, 0x746564206e657874, 0x2e0a202020207175, 0x6f7465642871756f, 0x746529207b0a2020, - 0x2020202020206c65, 0x7420636f6e74656e, 0x74203d2022223b0a, 0x2020202020202020, 0x666f7220286c6574, - 0x2063686172203d20, 0x746869732e6e6578, 0x742822556e746572, 0x6d696e6174656420, 0x71756f746522293b, - 0x206368617220213d, 0x3d2071756f74653b, 0x2063686172203d20, 0x746869732e6e6578, 0x742822556e746572, - 0x6d696e6174656420, 0x71756f7465222929, 0x0a20202020202020, 0x2020202020636f6e, 0x74656e74202b3d20, - 0x71756f7465203d3d, 0x3d20272227202626, 0x2063686172203d3d, 0x3d20225c5c222026, 0x262021746869732e, - 0x646f6e65203f2074, 0x6869732e6e657874, 0x2829203a20636861, 0x723b0a2020202020, 0x2020207265747572, - 0x6e20636f6e74656e, 0x743b0a202020207d, 0x0a0a202020202f2f, 0x2057686174206063, 0x686172602c207265, - 0x6164206f75747369, 0x64652071756f7465, 0x732c206164647320, 0x746f207468652063, 0x757272656e742077, - 0x6f72642e0a202020, 0x2070617274286368, 0x617229207b0a2020, 0x2020202020206966, 0x202863686172203d, - 0x3d3d20225c5c2229, 0x0a20202020202020, 0x2020202020726574, 0x75726e2074686973, 0x2e6e657874282254, - 0x7261696c696e6720, 0x6261636b736c6173, 0x6822293b0a202020, 0x2020202020696620, 0x2863686172203d3d, - 0x3d20222722207c7c, 0x2063686172203d3d, 0x3d20272227290a20, 0x2020202020202020, 0x2020207265747572, - 0x6e20746869732e71, 0x756f746564286368, 0x6172293b0a202020, 0x2020202020726574, 0x75726e2063686172, - 0x3b0a202020207d0a, 0x7d0a0a2f2f2f2053, 0x706c697473206120, 0x6c696e6520696e74, 0x6f20776f72647320, - 0x6c696b6520746572, 0x6d696e616c3a3a74, 0x6f6b656e697a6520, 0x696e20432b2b3a20, 0x7768697465737061, - 0x6365207365706172, 0x6174657320776f72, 0x64732c2073696e67, 0x6c652071756f7465, 0x730a2f2f2f206b65, - 0x6570207468656972, 0x20636f6e74656e74, 0x2076657262617469, 0x6d2c20646f75626c, 0x652071756f746573, - 0x206b656570206974, 0x2062757420686f6e, 0x6f72206261636b73, 0x6c61736820657363, 0x617065732c20616e, - 0x6420616e20756e71, 0x756f7465640a2f2f, 0x2f206261636b736c, 0x6173682065736361, 0x7065732074686520, - 0x6e65787420636861, 0x7261637465722e20, 0x5468726f77732061, 0x2053796e74617845, 0x72726f72206f6e20, - 0x616e20756e746572, 0x6d696e6174656420, 0x71756f7465206f72, 0x206120747261696c, 0x696e670a2f2f2f20, - 0x6261636b736c6173, 0x682e0a6578706f72, 0x742066756e637469, 0x6f6e20746f6b656e, 0x697a65286c696e65, - 0x29207b0a20202020, 0x636f6e737420776f, 0x726473203d205b5d, 0x3b0a20202020636f, 0x6e7374207363616e, - 0x6e6572203d206e65, 0x77205363616e6e65, 0x72286c696e65293b, 0x0a202020206c6574, 0x20776f7264203d20, - 0x6e756c6c3b20202f, 0x2f206e756c6c2062, 0x65747765656e2077, 0x6f7264730a202020, 0x207768696c652028, - 0x217363616e6e6572, 0x2e646f6e6529207b, 0x0a20202020202020, 0x20636f6e73742063, 0x686172203d207363, - 0x616e6e65722e6e65, 0x787428293b0a2020, 0x202020202020636f, 0x6e73742073657061, 0x7261746f72203d20, - 0x63686172203d3d3d, 0x20222022207c7c20, 0x63686172203d3d3d, 0x20225c74223b0a20, 0x2020202020202069, - 0x6620287365706172, 0x61746f7220262620, 0x776f726420213d3d, 0x206e756c6c290a20, 0x2020202020202020, - 0x202020776f726473, 0x2e7075736828776f, 0x7264293b0a202020, 0x2020202020776f72, 0x64203d2073657061, - 0x7261746f72203f20, 0x6e756c6c203a2028, 0x776f7264203f3f20, 0x222229202b207363, 0x616e6e65722e7061, - 0x7274286368617229, 0x3b0a202020207d0a, 0x2020202069662028, 0x776f726420213d3d, 0x206e756c6c290a20, - 0x2020202020202077, 0x6f7264732e707573, 0x6828776f7264293b, 0x0a20202020726574, 0x75726e20776f7264, - 0x733b0a7d0a0a2f2f, 0x2042726f77736572, 0x20636f6d6d616e64, 0x206f757470757420, 0x7573657320225c6e, - 0x22206c696e652065, 0x6e64696e67732c20, 0x636f6e7665727465, 0x64206c696b652043, 0x2b2b206f75747075, - 0x742e0a636f6e7374, 0x20746f5465726d69, 0x6e616c5465787420, 0x3d20287465787429, 0x203d3e2074657874, - 0x2e7265706c616365, 0x282f283f3c215c72, 0x295c6e2f672c2022, 0x5c725c6e22293b0a, 0x0a2f2f2f2052756e, - 0x732061206c696e65, 0x3a20612062726f77, 0x73657220636f6d6d, 0x616e64206f662060, 0x636f6d6d616e6473, - 0x60202861204d6170, 0x2066726f6d20636f, 0x6d6d616e64206e61, 0x6d6520746f206861, 0x6e646c6572292077, - 0x68656e206f6e6520, 0x69730a2f2f2f2072, 0x6567697374657265, 0x6420666f72206974, 0x7320666972737420, - 0x776f726420616e64, 0x20646f6573206e6f, 0x742072657475726e, 0x20756e646566696e, 0x65642c20656c7365, - 0x206072756e496e43, 0x7070286c696e6529, 0x602e2041206c696e, 0x6520746861740a2f, 0x2f2f2063616e6e6f, - 0x742062652073706c, 0x697420676f657320, 0x746f20432b2b2c20, 0x7768696368207265, 0x706f727473207468, - 0x65206572726f722e, 0x2042726f77736572, 0x20636f6d6d616e64, 0x7320676574206073, 0x69676e616c602c20, - 0x7768696368204374, 0x726c2b430a2f2f2f, 0x2061626f72747320, 0x7769746820746865, 0x20726561736f6e20, - 0x4572726f72282249, 0x6e74657272757074, 0x656422293b206120, 0x432b2b20636f6d6d, 0x616e642063616e6e, - 0x6f7420626520696e, 0x7465727275707465, 0x642e0a6578706f72, 0x74206173796e6320, 0x66756e6374696f6e, - 0x2072756e4c696e65, 0x286c696e652c207b, 0x636f6d6d616e6473, 0x2c2072756e496e43, 0x70702c2077726974, - 0x652c206272696467, 0x652c207369676e61, 0x6c203d206e657720, 0x41626f7274436f6e, 0x74726f6c6c657228, - 0x292e7369676e616c, 0x7d29207b0a202020, 0x206c657420776f72, 0x64733b0a20202020, 0x747279207b0a2020, - 0x202020202020776f, 0x726473203d20746f, 0x6b656e697a65286c, 0x696e65293b0a2020, 0x20207d2063617463, - 0x6820286572726f72, 0x29207b0a20202020, 0x2020202072657475, 0x726e2072756e496e, 0x437070286c696e65, - 0x293b0a202020207d, 0x0a20202020636f6e, 0x73742068616e646c, 0x6572203d20776f72, 0x64732e6c656e6774, - 0x68203e2030203f20, 0x636f6d6d616e6473, 0x2e67657428776f72, 0x64735b305d29203a, 0x20756e646566696e, - 0x65643b0a20202020, 0x696620282168616e, 0x646c6572290a2020, 0x2020202020207265, 0x7475726e2072756e, - 0x496e437070286c69, 0x6e65293b0a202020, 0x20636f6e7374206f, 0x7574707574203d20, 0x6177616974206861, - 0x6e646c657228776f, 0x7264732e736c6963, 0x652831292c207b0a, 0x2020202020202020, 0x6c696e652c0a2020, - 0x2020202020206272, 0x696467652c0a2020, 0x2020202020207369, 0x676e616c2c0a2020, 0x2020202020207772, - 0x6974653a20287465, 0x787429203d3e2077, 0x7269746528746f54, 0x65726d696e616c54, 0x6578742853747269, - 0x6e67287465787429, 0x29292c0a20202020, 0x2020202072756e49, 0x6e4370703a202829, 0x203d3e2072756e49, - 0x6e437070286c696e, 0x65292c0a20202020, 0x7d293b0a20202020, 0x72657475726e206f, 0x7574707574203d3d, - 0x3d20756e64656669, 0x6e6564203f207275, 0x6e496e437070286c, 0x696e6529203a2074, 0x6f5465726d696e61, - 0x6c54657874285374, 0x72696e67286f7574, 0x70757429293b0a7d, 0x0a0a2f2f2f20496d, 0x706f727473207468, - 0x6520657874656e73, 0x696f6e206d6f6475, 0x6c6573206c697374, 0x656420627920432b, 0x2b2028225c6e222d, - 0x7365706172617465, 0x642055524c732920, 0x616e6420636f6c6c, 0x6563747320746865, 0x69722062726f7773, - 0x65720a2f2f2f2063, 0x6f6d6d616e64732e, 0x2041206d6f64756c, 0x6520746861742066, 0x61696c7320746f20, - 0x6c6f616420697320, 0x7265706f72746564, 0x20616e6420736b69, 0x707065642e0a6173, 0x796e632066756e63, - 0x74696f6e206c6f61, 0x64457874656e7369, 0x6f6e732875726c73, 0x2c20777269746529, 0x207b0a2020202063, - 0x6f6e737420636f6d, 0x6d616e6473203d20, 0x6e6577204d617028, 0x293b0a2020202066, 0x6f722028636f6e73, - 0x742075726c206f66, 0x2075726c732e7370, 0x6c697428225c6e22, 0x292e66696c746572, 0x2828656e74727929, - 0x203d3e20656e7472, 0x7920213d3d202222, 0x2929207b0a202020, 0x2020202020747279, 0x207b0a2020202020, - 0x2020202020202063, 0x6f6e7374206d6f64, 0x756c65203d206177, 0x61697420696d706f, 0x72742875726c293b, - 0x0a20202020202020, 0x2020202020666f72, 0x2028636f6e737420, 0x5b6e616d652c2068, 0x616e646c65725d20, - 0x6f66204f626a6563, 0x742e656e74726965, 0x73286d6f64756c65, 0x2e636f6d6d616e64, 0x73203f3f207b7d29, - 0x290a202020202020, 0x2020202020202020, 0x2020636f6d6d616e, 0x64732e736574286e, 0x616d652c2068616e, - 0x646c6572293b0a20, 0x202020202020207d, 0x2063617463682028, 0x6572726f7229207b, 0x0a20202020202020, - 0x2020202020777269, 0x746528616e73692e, 0x7265642860546572, 0x6d696e616c206578, 0x74656e73696f6e20, - 0x247b75726c7d2066, 0x61696c656420746f, 0x206c6f61643a2024, 0x7b6572726f723f2e, 0x6d65737361676520, - 0x3f3f206572726f72, 0x7d6029202b20225c, 0x725c6e22293b0a20, 0x202020202020207d, 0x0a202020207d0a20, - 0x2020207265747572, 0x6e20636f6d6d616e, 0x64733b0a7d0a0a2f, 0x2f2045646974696e, 0x67206b6579732c20, - 0x617320787465726d, 0x2e6a73207265706f, 0x727473207468656d, 0x20696e206f6e4461, 0x74612c206d617070, - 0x656420746f204c69, 0x6e65456469746f72, 0x20616374696f6e73, 0x2e0a636f6e737420, 0x6b6579416374696f, - 0x6e73203d206e6577, 0x204d6170285b0a20, 0x2020205b225c7222, 0x2c2028656469746f, 0x7229203d3e206564, - 0x69746f722e737562, 0x6d697428295d2c0a, 0x202020205b225c78, 0x3766222c20286564, 0x69746f7229203d3e, - 0x20656469746f722e, 0x6572617365282d31, 0x295d2c0a20202020, 0x5b225c62222c2028, 0x656469746f722920, - 0x3d3e20656469746f, 0x722e657261736528, 0x2d31295d2c0a2020, 0x20205b225c783162, 0x5b337e222c202865, - 0x6469746f7229203d, 0x3e20656469746f72, 0x2e65726173652830, 0x295d2c0a20202020, 0x5b225c7831625b44, - 0x222c202865646974, 0x6f7229203d3e2065, 0x6469746f722e6d6f, 0x7665546f28656469, 0x746f722e63757273, - 0x6f72202d2031295d, 0x2c0a202020205b22, 0x5c7831625b43222c, 0x2028656469746f72, 0x29203d3e20656469, - 0x746f722e6d6f7665, 0x546f28656469746f, 0x722e637572736f72, 0x202b2031295d2c0a, 0x202020205b225c78, - 0x31625b48222c2028, 0x656469746f722920, 0x3d3e20656469746f, 0x722e6d6f7665546f, 0x2830295d2c0a2020, - 0x20205b225c783162, 0x4f48222c20286564, 0x69746f7229203d3e, 0x20656469746f722e, 0x6d6f7665546f2830, - 0x295d2c0a20202020, 0x5b225c783031222c, 0x2028656469746f72, 0x29203d3e20656469, 0x746f722e6d6f7665, - 0x546f2830295d2c0a, 0x202020205b225c78, 0x31625b46222c2028, 0x656469746f722920, 0x3d3e20656469746f, - 0x722e6d6f7665546f, 0x28656469746f722e, 0x63686172732e6c65, 0x6e677468295d2c0a, 0x202020205b225c78, - 0x31624f46222c2028, 0x656469746f722920, 0x3d3e20656469746f, 0x722e6d6f7665546f, 0x28656469746f722e, - 0x63686172732e6c65, 0x6e677468295d2c0a, 0x202020205b225c78, 0x3035222c20286564, 0x69746f7229203d3e, - 0x20656469746f722e, 0x6d6f7665546f2865, 0x6469746f722e6368, 0x6172732e6c656e67, 0x7468295d2c0a2020, - 0x20205b225c783162, 0x5b41222c20286564, 0x69746f7229203d3e, 0x20656469746f722e, 0x726563616c6c282d, - 0x31295d2c0a202020, 0x205b225c7831625b, 0x42222c2028656469, 0x746f7229203d3e20, 0x656469746f722e72, - 0x6563616c6c283129, 0x5d2c0a202020205b, 0x225c74222c202865, 0x6469746f7229203d, 0x3e20656469746f72, - 0x2e747261636b2865, 0x6469746f722e636f, 0x6d706c6574654c69, 0x6e652829295d2c0a, 0x202020205b225c78, - 0x3033222c20286564, 0x69746f7229203d3e, 0x20656469746f722e, 0x63616e63656c4c69, 0x6e6528295d2c0a20, - 0x2020205b225c7830, 0x63222c2028656469, 0x746f7229203d3e20, 0x656469746f722e72, 0x656472617728616e, - 0x73692e636c656172, 0x53637265656e295d, 0x2c0a202020205b22, 0x5c783135222c2028, 0x656469746f722920, - 0x3d3e20656469746f, 0x722e6b696c6c4265, 0x666f726543757273, 0x6f7228295d2c0a5d, 0x293b0a0a2f2f2f20, - 0x4c696e6520656469, 0x746f722064726976, 0x656e206279207468, 0x65207465726d696e, 0x616c277320696e70, - 0x757420646174612e, 0x2060777269746528, 0x7465787429602064, 0x6973706c61797320, 0x746578743b206072, - 0x756e286c696e6529, 0x6020616e640a2f2f, 0x2f2060636f6d706c, 0x657465286c696e65, 0x2960207265747572, - 0x6e2050726f6d6973, 0x6573206f66207468, 0x6520432b2b206f75, 0x7470757420616e64, 0x206f6620225c6e22, - 0x2d73657061726174, 0x656420636f6d706c, 0x6574696f6e206361, 0x6e64696461746573, 0x2e0a6578706f7274, - 0x20636c617373204c, 0x696e65456469746f, 0x72207b0a20202020, 0x636f6e7374727563, 0x746f72287b777269, - 0x74652c2072756e2c, 0x20636f6d706c6574, 0x652c2070726f6d70, 0x747d29207b0a2020, 0x2020202020207468, - 0x69732e7772697465, 0x203d207772697465, 0x3b0a202020202020, 0x2020746869732e72, 0x756e203d2072756e, - 0x3b0a202020202020, 0x2020746869732e63, 0x6f6d706c65746520, 0x3d20636f6d706c65, 0x74653b0a20202020, - 0x2020202074686973, 0x2e61626f7274203d, 0x206e756c6c3b0a20, 0x2020202020202074, 0x6869732e70726f6d, - 0x7074203d2070726f, 0x6d70743b0a202020, 0x2020202020746869, 0x732e636861727320, 0x3d205b5d3b0a2020, - 0x2020202020207468, 0x69732e637572736f, 0x72203d20303b0a20, 0x2020202020202074, 0x6869732e68697374, - 0x6f7279203d205b5d, 0x3b0a202020202020, 0x2020746869732e68, 0x6973746f7279496e, 0x646578203d20303b, - 0x0a20202020202020, 0x20746869732e6275, 0x7379203d206e756c, 0x6c3b0a202020207d, 0x0a0a202020206765, - 0x74206c696e652829, 0x207b0a2020202020, 0x2020207265747572, 0x6e20746869732e63, 0x686172732e6a6f69, - 0x6e282222293b0a20, 0x2020207d0a0a2020, 0x20202f2f2f205265, 0x736f6c766573206f, 0x6e6365206e6f2063, - 0x6f6d6d616e64206f, 0x7220636f6d706c65, 0x74696f6e20697320, 0x70656e64696e672e, 0x0a20202020617379, - 0x6e63207768656e49, 0x646c652829207b0a, 0x2020202020202020, 0x7768696c65202874, 0x6869732e62757379, - 0x290a202020202020, 0x2020202020206177, 0x6169742074686973, 0x2e627573793b0a20, 0x2020207d0a0a2020, - 0x202073686f775072, 0x6f6d70742829207b, 0x0a20202020202020, 0x20746869732e7772, 0x6974652874686973, - 0x2e70726f6d707429, 0x3b0a202020207d0a, 0x0a2020202068616e, 0x646c652864617461, 0x29207b0a20202020, - 0x2020202069662028, 0x746869732e627573, 0x79290a2020202020, 0x2020202020202072, 0x657475726e207468, - 0x69732e696e746572, 0x7275707428646174, 0x61293b0a20202020, 0x20202020636f6e73, 0x7420616374696f6e, - 0x203d206b65794163, 0x74696f6e732e6765, 0x742864617461293b, 0x0a20202020202020, 0x2069662028616374, - 0x696f6e290a202020, 0x2020202020202020, 0x2072657475726e20, 0x616374696f6e2874, 0x686973293b0a2020, - 0x2020202020206966, 0x202821646174612e, 0x7374617274735769, 0x746828225c783162, 0x2229290a20202020, - 0x2020202020202020, 0x72657475726e2074, 0x6869732e696e7365, 0x7274546578742864, 0x617461293b0a2020, - 0x20207d0a0a202020, 0x202f2f205768696c, 0x65206120636f6d6d, 0x616e642072756e73, 0x2c204374726c2b43, - 0x2061626f72747320, 0x697473207369676e, 0x616c206f6e636520, 0x616e642074686520, 0x6f74686572206b65, - 0x7973206172652069, 0x676e6f7265642e0a, 0x20202020696e7465, 0x7272757074286461, 0x746129207b0a2020, - 0x202020202020636f, 0x6e73742072756e6e, 0x696e67203d207468, 0x69732e61626f7274, 0x3f2e7369676e616c, - 0x2e61626f72746564, 0x203d3d3d2066616c, 0x73653b0a20202020, 0x2020202069662028, 0x6461746120213d3d, - 0x20225c7830332220, 0x7c7c202172756e6e, 0x696e67290a202020, 0x2020202020202020, 0x2072657475726e3b, - 0x0a20202020202020, 0x20746869732e7772, 0x69746528225e435c, 0x725c6e22293b0a20, 0x2020202020202074, - 0x6869732e61626f72, 0x742e61626f727428, 0x6e6577204572726f, 0x722822496e746572, 0x7275707465642229, - 0x293b0a202020207d, 0x0a0a202020202f2f, 0x205479706564206f, 0x7220706173746564, 0x20746578743a2070, - 0x72696e7461626c65, 0x2063686172616374, 0x6572732061726520, 0x696e736572746564, 0x2c20612063617272, - 0x6961676520726574, 0x75726e207375626d, 0x6974732074686520, 0x6c696e650a202020, 0x202f2f20616e6420, - 0x7468652072657374, 0x206f662061206d75, 0x6c74692d6c696e65, 0x2070617374652069, 0x732064726f707065, - 0x642c2073696e6365, 0x20636f6d6d616e64, 0x732072756e206f6e, 0x6520617420612074, 0x696d652e0a202020, - 0x20696e7365727454, 0x6578742864617461, 0x29207b0a20202020, 0x20202020636f6e73, 0x74205b746578742c, - 0x202e2e2e72657374, 0x5d203d2064617461, 0x2e73706c69742822, 0x5c7222293b0a2020, 0x2020202020207468, - 0x69732e696e736572, 0x742841727261792e, 0x66726f6d28746578, 0x74292e66696c7465, 0x7228286368617229, - 0x203d3e2063686172, 0x203e3d2022202220, 0x2626206368617220, 0x213d3d20225c7837, 0x662229293b0a2020, - 0x2020202020206966, 0x2028726573742e6c, 0x656e677468203e20, 0x30290a2020202020, 0x2020202020202072, - 0x657475726e207468, 0x69732e7375626d69, 0x7428293b0a202020, 0x207d0a0a20202020, 0x696e736572742863, - 0x6861727329207b0a, 0x2020202020202020, 0x6966202863686172, 0x732e6c656e677468, 0x203d3d3d2030290a, - 0x2020202020202020, 0x2020202072657475, 0x726e3b0a20202020, 0x2020202074686973, 0x2e63686172732e73, - 0x706c696365287468, 0x69732e637572736f, 0x722c20302c202e2e, 0x2e6368617273293b, 0x0a20202020202020, - 0x20746869732e6375, 0x72736f72202b3d20, 0x63686172732e6c65, 0x6e6774683b0a2020, 0x2020202020207468, - 0x69732e7265647261, 0x7728293b0a202020, 0x207d0a0a20202020, 0x6572617365286f66, 0x6673657429207b0a, - 0x2020202020202020, 0x636f6e737420696e, 0x646578203d207468, 0x69732e637572736f, 0x72202b206f666673, - 0x65743b0a20202020, 0x2020202069662028, 0x696e646578203c20, 0x30207c7c20696e64, 0x6578203e3d207468, - 0x69732e6368617273, 0x2e6c656e67746829, 0x0a20202020202020, 0x2020202020726574, 0x75726e3b0a202020, - 0x2020202020746869, 0x732e63686172732e, 0x73706c6963652869, 0x6e6465782c203129, 0x3b0a202020202020, - 0x2020746869732e63, 0x7572736f72203d20, 0x696e6465783b0a20, 0x2020202020202074, 0x6869732e72656472, - 0x617728293b0a2020, 0x20207d0a0a202020, 0x206b696c6c426566, 0x6f7265437572736f, 0x722829207b0a2020, - 0x2020202020207468, 0x69732e6368617273, 0x2e73706c69636528, 0x302c20746869732e, 0x637572736f72293b, - 0x0a20202020202020, 0x20746869732e6375, 0x72736f72203d2030, 0x3b0a202020202020, 0x2020746869732e72, - 0x656472617728293b, 0x0a202020207d0a0a, 0x202020206d6f7665, 0x546f28706f736974, 0x696f6e29207b0a20, - 0x2020202020202063, 0x6f6e737420637572, 0x736f72203d204d61, 0x74682e6d61782830, 0x2c204d6174682e6d, - 0x696e28746869732e, 0x63686172732e6c65, 0x6e6774682c20706f, 0x736974696f6e2929, 0x3b0a202020202020, - 0x2020696620286375, 0x72736f72203d3d3d, 0x20746869732e6375, 0x72736f72290a2020, 0x2020202020202020, - 0x202072657475726e, 0x3b0a202020202020, 0x2020746869732e63, 0x7572736f72203d20, 0x637572736f723b0a, - 0x2020202020202020, 0x746869732e726564, 0x72617728293b0a20, 0x2020207d0a0a2020, 0x2020726563616c6c, - 0x2864697265637469, 0x6f6e29207b0a2020, 0x202020202020636f, 0x6e737420696e6465, 0x78203d2074686973, - 0x2e686973746f7279, 0x496e646578202b20, 0x646972656374696f, 0x6e3b0a2020202020, 0x2020206966202869, - 0x6e646578203c2030, 0x207c7c20696e6465, 0x78203e2074686973, 0x2e686973746f7279, 0x2e6c656e67746829, - 0x0a20202020202020, 0x2020202020726574, 0x75726e3b0a202020, 0x2020202020746869, 0x732e686973746f72, - 0x79496e646578203d, 0x20696e6465783b0a, 0x2020202020202020, 0x746869732e636861, 0x7273203d20417272, - 0x61792e66726f6d28, 0x696e646578203d3d, 0x3d20746869732e68, 0x6973746f72792e6c, 0x656e677468203f20, - 0x2222203a20746869, 0x732e686973746f72, 0x795b696e6465785d, 0x293b0a2020202020, 0x202020746869732e, - 0x637572736f72203d, 0x20746869732e6368, 0x6172732e6c656e67, 0x74683b0a20202020, 0x2020202074686973, - 0x2e72656472617728, 0x293b0a202020207d, 0x0a0a202020206361, 0x6e63656c4c696e65, 0x2829207b0a202020, - 0x2020202020746869, 0x732e777269746528, 0x225e435c725c6e22, 0x293b0a2020202020, 0x202020746869732e, - 0x6368617273203d20, 0x5b5d3b0a20202020, 0x2020202074686973, 0x2e637572736f7220, 0x3d20303b0a202020, - 0x2020202020746869, 0x732e686973746f72, 0x79496e646578203d, 0x20746869732e6869, 0x73746f72792e6c65, - 0x6e6774683b0a2020, 0x2020202020207468, 0x69732e73686f7750, 0x726f6d707428293b, 0x0a202020207d0a0a, - 0x202020202f2f2052, 0x6577726974657320, 0x7468652070726f6d, 0x707420616e642074, 0x6865206c696e6520, - 0x696e20706c616365, 0x2c207468656e206d, 0x6f76657320746865, 0x20637572736f7220, 0x6261636b20746f20, - 0x69747320706f7369, 0x74696f6e2e0a2020, 0x2020726564726177, 0x2870726566697820, 0x3d20225c72222920, - 0x7b0a202020202020, 0x2020746869732e77, 0x7269746528707265, 0x666978202b207468, 0x69732e70726f6d70, - 0x74202b2074686973, 0x2e6c696e65202b20, 0x616e73692e636c65, 0x6172546f456e6420, 0x2b20616e73692e6c, - 0x6566742874686973, 0x2e63686172732e6c, 0x656e677468202d20, 0x746869732e637572, 0x736f7229293b0a20, - 0x2020207d0a0a2020, 0x2020747261636b28, 0x70726f6d69736529, 0x207b0a2020202020, 0x202020746869732e, - 0x62757379203d2070, 0x726f6d6973652e66, 0x696e616c6c792828, 0x29203d3e207b0a20, 0x2020202020202020, - 0x202020746869732e, 0x62757379203d206e, 0x756c6c3b0a202020, 0x20202020207d293b, 0x0a20202020202020, - 0x2072657475726e20, 0x746869732e627573, 0x793b0a202020207d, 0x0a0a202020207375, 0x626d69742829207b, - 0x0a20202020202020, 0x20636f6e7374206c, 0x696e65203d207468, 0x69732e6c696e653b, 0x0a20202020202020, - 0x20746869732e7772, 0x69746528225c725c, 0x6e22293b0a202020, 0x2020202020746869, 0x732e636861727320, - 0x3d205b5d3b0a2020, 0x2020202020207468, 0x69732e637572736f, 0x72203d20303b0a20, 0x2020202020202069, - 0x6620286c696e652e, 0x7472696d28292021, 0x3d3d202222202626, 0x20746869732e6869, 0x73746f72792e6174, - 0x282d312920213d3d, 0x206c696e65290a20, 0x2020202020202020, 0x202020746869732e, 0x686973746f72792e, - 0x70757368286c696e, 0x65293b0a20202020, 0x2020202074686973, 0x2e686973746f7279, 0x496e646578203d20, - 0x746869732e686973, 0x746f72792e6c656e, 0x6774683b0a202020, 0x2020202020726574, 0x75726e2074686973, - 0x2e747261636b2874, 0x6869732e65786563, 0x757465286c696e65, 0x29293b0a20202020, 0x7d0a0a2020202061, - 0x73796e6320657865, 0x63757465286c696e, 0x6529207b0a202020, 0x2020202020746869, 0x732e61626f727420, - 0x3d206e6577204162, 0x6f7274436f6e7472, 0x6f6c6c657228293b, 0x0a20202020202020, 0x20747279207b0a20, - 0x2020202020202020, 0x202020636f6e7374, 0x206f757470757420, 0x3d20617761697420, 0x746869732e72756e, - 0x286c696e652c2074, 0x6869732e61626f72, 0x742e7369676e616c, 0x293b0a2020202020, 0x202020202020202f, - 0x2f20546865207072, 0x6f6d707420737461, 0x727473206f6e2061, 0x206e6577206c696e, 0x652c20756e6c6573, - 0x7320746865206f75, 0x7470757420616c72, 0x6561647920656e64, 0x73206f6e65206f72, 0x206c656176657320, - 0x7468650a20202020, 0x2020202020202020, 0x2f2f20637572736f, 0x7220617420686f6d, 0x6520287375636820, - 0x6173207468652027, 0x636c656172272063, 0x6f6d6d616e64292e, 0x0a20202020202020, 0x2020202020696620, - 0x286f757470757429, 0x0a20202020202020, 0x2020202020202020, 0x20746869732e7772, 0x697465286f757470, - 0x75742e656e647357, 0x69746828225c6e22, 0x29207c7c206f7574, 0x7075742e656e6473, 0x5769746828225c78, - 0x31625b482229203f, 0x206f757470757420, 0x3a206f7574707574, 0x202b20225c725c6e, 0x22293b0a20202020, - 0x202020207d206361, 0x7463682028657272, 0x6f7229207b0a2020, 0x2020202020202020, 0x2020746869732e77, - 0x7269746528616e73, 0x692e726564286045, 0x72726f723a20247b, 0x6572726f723f2e6d, 0x657373616765203f, - 0x3f206572726f727d, 0x6029202b20225c72, 0x5c6e22293b0a2020, 0x2020202020207d0a, 0x2020202020202020, - 0x746869732e73686f, 0x7750726f6d707428, 0x293b0a202020207d, 0x0a0a202020206173, 0x796e6320636f6d70, - 0x6c6574654c696e65, 0x2829207b0a202020, 0x20202020202f2f20, 0x4f6e6c7920746865, 0x20636f6d6d616e64, - 0x206e616d65206973, 0x20636f6d706c6574, 0x65642c20616e6420, 0x6f6e6c7920776974, 0x6820746865206375, - 0x72736f7220617420, 0x74686520656e6420, 0x6f6620746865206c, 0x696e652e0a202020, 0x2020202020696620, - 0x28746869732e6375, 0x72736f7220213d3d, 0x20746869732e6368, 0x6172732e6c656e67, 0x7468290a20202020, - 0x2020202020202020, 0x72657475726e3b0a, 0x2020202020202020, 0x636f6e7374206c69, 0x6e65203d20746869, - 0x732e6c696e653b0a, 0x2020202020202020, 0x6c65742063616e64, 0x6964617465733b0a, 0x2020202020202020, - 0x747279207b0a2020, 0x2020202020202020, 0x202063616e646964, 0x61746573203d2028, 0x6177616974207468, - 0x69732e636f6d706c, 0x657465286c696e65, 0x29292e73706c6974, 0x28225c6e22292e66, 0x696c746572282877, - 0x6f726429203d3e20, 0x776f726420213d3d, 0x202222293b0a2020, 0x2020202020207d20, 0x6361746368202865, - 0x72726f7229207b0a, 0x2020202020202020, 0x2020202072657475, 0x726e3b0a20202020, 0x202020207d0a2020, - 0x2020202020206966, 0x202863616e646964, 0x617465732e6c656e, 0x677468203d3d3d20, 0x30290a2020202020, - 0x2020202020202072, 0x657475726e3b0a20, 0x2020202020202063, 0x6f6e737420636f6d, 0x706c6574696f6e20, - 0x3d2063616e646964, 0x617465732e6c656e, 0x677468203d3d3d20, 0x31203f2063616e64, 0x6964617465735b30, - 0x5d202b2022202220, 0x3a20636f6d6d6f6e, 0x5072656669782863, 0x616e646964617465, 0x73293b0a20202020, - 0x2020202069662028, 0x636f6d706c657469, 0x6f6e2e6c656e6774, 0x68203e206c696e65, 0x2e6c656e67746829, - 0x0a20202020202020, 0x2020202020726574, 0x75726e2074686973, 0x2e696e7365727428, 0x41727261792e6672, - 0x6f6d28636f6d706c, 0x6574696f6e2e736c, 0x696365286c696e65, 0x2e6c656e67746829, 0x29293b0a20202020, - 0x2020202074686973, 0x2e77726974652822, 0x5c725c6e22202b20, 0x63616e6469646174, 0x65732e6a6f696e28, - 0x2220202229202b20, 0x225c725c6e22293b, 0x0a20202020202020, 0x20746869732e7265, 0x6472617728293b0a, - 0x202020207d0a7d0a, 0x0a2f2f2f204d6f75, 0x6e74732061207465, 0x726d696e616c2069, 0x6e2060656c656d65, - 0x6e7460206f6e6365, 0x2074686520576562, 0x46726f6e74206272, 0x6964676520697320, 0x72656164792e2052, - 0x657475726e732074, 0x686520787465726d, 0x205465726d696e61, 0x6c2c0a2f2f2f2069, 0x7473206c696e6520, - 0x656469746f722061, 0x6e6420612060666c, 0x7573682829602072, 0x65736f6c76696e67, 0x207768656e206576, - 0x6572792077726974, 0x6520686173206265, 0x656e2072656e6465, 0x7265642e0a657870, 0x6f7274206173796e, - 0x632066756e637469, 0x6f6e206d6f756e74, 0x28656c656d656e74, 0x2c207b6272696467, 0x65203d20676c6f62, - 0x616c546869732e77, 0x656246726f6e742c, 0x207465726d696e61, 0x6c4f7074696f6e73, 0x203d207b7d7d203d, - 0x207b7d29207b0a20, 0x202020636f6e7374, 0x207465726d696e61, 0x6c203d206e657720, 0x5465726d696e616c, - 0x287b0a2020202020, 0x202020637572736f, 0x72426c696e6b3a20, 0x747275652c0a2020, 0x202020202020636f, - 0x6e76657274456f6c, 0x3a2066616c73652c, 0x0a20202020202020, 0x20666f6e7446616d, 0x696c793a20277569, - 0x2d6d6f6e6f737061, 0x63652c2022436173, 0x636164696120436f, 0x6465222c2022536f, 0x7572636520436f64, - 0x652050726f222c20, 0x4d656e6c6f2c2043, 0x6f6e736f6c61732c, 0x206d6f6e6f737061, 0x6365272c0a202020, - 0x2020202020746865, 0x6d653a207b626163, 0x6b67726f756e643a, 0x2022233064313131, 0x37222c20666f7265, - 0x67726f756e643a20, 0x2223653665646633, 0x227d2c0a20202020, 0x202020202e2e2e74, 0x65726d696e616c4f, - 0x7074696f6e732c0a, 0x202020207d293b0a, 0x20202020636f6e73, 0x7420666974203d20, 0x6e65772046697441, - 0x64646f6e28293b0a, 0x202020207465726d, 0x696e616c2e6c6f61, 0x644164646f6e2866, 0x6974293b0a202020, - 0x207465726d696e61, 0x6c2e6f70656e2865, 0x6c656d656e74293b, 0x0a20202020666974, 0x2e66697428293b0a, - 0x202020206e657720, 0x526573697a654f62, 0x7365727665722828, 0x29203d3e20666974, 0x2e6669742829292e, - 0x6f62736572766528, 0x656c656d656e7429, 0x3b0a0a202020206c, 0x6574206c61737457, 0x72697465203d2050, - 0x726f6d6973652e72, 0x65736f6c76652829, 0x3b0a20202020636f, 0x6e73742077726974, 0x65203d2028746578, - 0x7429203d3e207b0a, 0x2020202020202020, 0x6c61737457726974, 0x65203d206e657720, 0x50726f6d69736528, - 0x287265736f6c7665, 0x29203d3e20746572, 0x6d696e616c2e7772, 0x6974652874657874, 0x2c207265736f6c76, - 0x6529293b0a202020, 0x207d3b0a20202020, 0x636f6e737420666c, 0x757368203d202829, 0x203d3e206c617374, - 0x57726974653b0a0a, 0x2020202074727920, 0x7b0a202020202020, 0x2020617761697420, 0x6272696467652e72, - 0x656164793b0a2020, 0x20207d2063617463, 0x6820286572726f72, 0x29207b0a20202020, 0x2020202077726974, - 0x6528616e73692e72, 0x65642860436f6e6e, 0x656374696f6e2074, 0x6f20746865206170, 0x706c69636174696f, - 0x6e206661696c6564, 0x3a20247b6572726f, 0x723f2e6d65737361, 0x6765203f3f206572, 0x726f727d6029202b, - 0x20225c725c6e2229, 0x3b0a202020202020, 0x202072657475726e, 0x207b7465726d696e, 0x616c2c2065646974, - 0x6f723a206e756c6c, 0x2c20666c7573687d, 0x3b0a202020207d0a, 0x0a20202020636f6e, 0x73742063616c6c20, - 0x3d20286e616d6529, 0x203d3e2062726964, 0x67652e6370704675, 0x6e6374696f6e2860, 0x77656266726f6e74, - 0x2e7465726d696e61, 0x6c2e247b6e616d65, 0x7d60293b0a202020, 0x206c65742070726f, 0x6d70742c2062616e, - 0x6e65722c20657874, 0x656e73696f6e733b, 0x0a20202020747279, 0x207b0a2020202020, 0x2020205b70726f6d, - 0x70742c2062616e6e, 0x65722c2065787465, 0x6e73696f6e735d20, 0x3d20617761697420, 0x50726f6d6973652e, - 0x616c6c285b63616c, 0x6c282270726f6d70, 0x74222928292c2063, 0x616c6c282262616e, 0x6e6572222928292c, - 0x2063616c6c282265, 0x7874656e73696f6e, 0x73222928295d293b, 0x0a202020207d2063, 0x6174636820286572, - 0x726f7229207b0a20, 0x202020202020202f, 0x2f20466f72206578, 0x616d706c65206120, 0x7061676520736572, - 0x7665642062792061, 0x6e206170706c6963, 0x6174696f6e207769, 0x74686f7574207765, 0x6266726f6e743a3a, - 0x5465726d696e616c, 0x2e0a202020202020, 0x2020777269746528, 0x616e73692e726564, 0x28605465726d696e, - 0x616c20756e617661, 0x696c61626c653a20, 0x247b6572726f723f, 0x2e6d657373616765, 0x203f3f206572726f, - 0x727d6029202b2022, 0x5c725c6e22293b0a, 0x2020202020202020, 0x72657475726e207b, 0x7465726d696e616c, - 0x2c20656469746f72, 0x3a206e756c6c2c20, 0x666c7573687d3b0a, 0x202020207d0a2020, 0x2020636f6e737420, - 0x636f6d6d616e6473, 0x203d206177616974, 0x206c6f6164457874, 0x656e73696f6e7328, 0x657874656e73696f, - 0x6e732c2077726974, 0x65293b0a20202020, 0x636f6e7374207275, 0x6e496e437070203d, 0x2063616c6c282272, - 0x756e22293b0a2020, 0x2020636f6e737420, 0x72756e203d20286c, 0x696e652c20736967, 0x6e616c29203d3e20, - 0x72756e4c696e6528, 0x6c696e652c207b63, 0x6f6d6d616e64732c, 0x2072756e496e4370, 0x702c207772697465, - 0x2c20627269646765, 0x2c207369676e616c, 0x7d293b0a20202020, 0x636f6e7374206564, 0x69746f72203d206e, - 0x6577204c696e6545, 0x6469746f72287b77, 0x726974652c207275, 0x6e2c20636f6d706c, 0x6574653a2063616c, - 0x6c2822636f6d706c, 0x65746522292c2070, 0x726f6d70747d293b, 0x0a20202020696620, 0x2862616e6e657229, - 0x0a20202020202020, 0x2077726974652862, 0x616e6e65722e7265, 0x706c616365416c6c, 0x28225c6e222c2022, - 0x5c725c6e2229202b, 0x20225c725c6e2229, 0x3b0a202020206564, 0x69746f722e73686f, 0x7750726f6d707428, - 0x293b0a2020202074, 0x65726d696e616c2e, 0x6f6e446174612828, 0x6461746129203d3e, 0x20656469746f722e, - 0x68616e646c652864, 0x61746129293b0a20, 0x2020207465726d69, 0x6e616c2e666f6375, 0x7328293b0a202020, - 0x2072657475726e20, 0x7b7465726d696e61, 0x6c2c20656469746f, 0x722c20666c757368, 0x7d3b0a7d0a000000 - }; -}; - -} // namespace webfront::fs::generated diff --git a/include/webfront/system/ToolManagerFS.hpp b/include/webfront/system/ToolManagerFS.hpp deleted file mode 100644 index 4f2da3c3..00000000 --- a/include/webfront/system/ToolManagerFS.hpp +++ /dev/null @@ -1,28 +0,0 @@ -/// @brief Virtual file system serving the browser side of the wf tool manager (the terminal extension -/// wf.mjs) under webfront/components/tools/. -#pragma once - -#include "FileSystem.hpp" -#include "ToolManagerModuleData.hpp" - -#include -#include -#include - -namespace webfront::fs { - -class ToolManagerFS { -public: - static constexpr std::string_view prefix = "webfront/components/tools/"; - static constexpr std::string_view module = "webfront/components/tools/wf.mjs"; - - explicit ToolManagerFS(std::filesystem::path /*docRoot*/) {} - - static std::optional open(std::filesystem::path file) { - if (file.relative_path().generic_string() == module) - return File{generated::ToolManagerModuleData{}}; - return {}; - } -}; - -} // namespace webfront::fs diff --git a/include/webfront/system/ToolManagerModuleData.hpp b/include/webfront/system/ToolManagerModuleData.hpp deleted file mode 100644 index a055a52f..00000000 --- a/include/webfront/system/ToolManagerModuleData.hpp +++ /dev/null @@ -1,393 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -namespace webfront::fs::generated { - -struct ToolManagerModuleData { - static constexpr std::string_view encoding{}; - static constexpr std::size_t dataSize{15006}; - static constexpr std::array data{ - 0x2f2f2f2040627269, 0x65662042726f7773, 0x6572207369646520, 0x6f66207468652077, 0x6620746f6f6c206d, - 0x616e616765722028, 0x23323334292c2061, 0x207465726d696e61, 0x6c20657874656e73, 0x696f6e2061646465, - 0x642062790a2f2f2f, 0x2077656266726f6e, 0x743a3a546f6f6c4d, 0x616e616765722028, 0x696e636c7564652f, - 0x77656266726f6e74, 0x2f636f6d706f6e65, 0x6e74732f546f6f6c, 0x4d616e616765722e, 0x687070292e202777, - 0x6620736561726368, 0x272c202777662069, 0x6e7374616c6c2720, 0x616e640a2f2f2f20, 0x277766206f70656e, - 0x272072756e206865, 0x72652c2062656361, 0x7573652074686520, 0x646f776e6c6f6164, 0x20737065616b7320, - 0x48545450533b2027, 0x7766206c69737427, 0x2c20277766207265, 0x6d6f76652720616e, 0x6420277766206865, - 0x6c70272072756e0a, 0x2f2f2f20696e2043, 0x2b2b2e20416e2069, 0x6e7374616c6c6174, 0x696f6e2066657463, - 0x6865732074686520, 0x7061636b756d656e, 0x7420616e64207468, 0x652074617262616c, 0x6c2066726f6d2074, - 0x6865206e706d2072, 0x656769737472792c, 0x20636865636b7320, 0x7468650a2f2f2f20, 0x74617262616c6c27, - 0x73205348412d3531, 0x3220696e74656772, 0x6974792c20756e70, 0x61636b7320697420, 0x616e642073656e64, - 0x7320697473206669, 0x6c6573207468726f, 0x7567682077656266, 0x726f6e742e706b67, 0x2e626567696e2c0a, - 0x2f2f2f202e777269, 0x746546696c652061, 0x6e64202e636f6d6d, 0x69742e0a0a636f6e, 0x737420626c6f636b, - 0x53697a65203d2035, 0x31323b0a2f2f2f20, 0x46696c6573206372, 0x6f73732074686520, 0x6272696467652069, - 0x6e206368756e6b73, 0x206f662074686973, 0x206d616e79206279, 0x7465733b20746865, 0x2062726f77736572, - 0x2073656e64732061, 0x206c61726765206f, 0x6e6520696e207365, 0x766572616c0a2f2f, 0x2f20576562536f63, - 0x6b6574206672616d, 0x65732c2077686963, 0x6820746865207365, 0x7276657220726561, 0x7373656d626c6573, - 0x2e0a6578706f7274, 0x20636f6e73742063, 0x68756e6b53697a65, 0x203d20323536202a, 0x20313032343b0a2f, - 0x2f2f204c61726765, 0x737420756e706163, 0x6b65642074617262, 0x616c6c2061636365, 0x707465642c206167, - 0x61696e7374206465, 0x636f6d7072657373, 0x696f6e20626f6d62, 0x732e0a6578706f72, 0x7420636f6e737420, - 0x6d6178556e706163, 0x6b65644279746573, 0x203d20323536202a, 0x2031303234202a20, 0x313032343b0a636f, - 0x6e73742075746638, 0x203d206e65772054, 0x6578744465636f64, 0x657228293b0a0a2f, 0x2f2f2053706c6974, - 0x7320226e616d655b, 0x4076657273696f6e, 0x5d222c2077686572, 0x6520746865206e61, 0x6d65206d61792062, - 0x652073636f706564, 0x2028224073636f70, 0x652f6e616d654031, 0x2e302e3022292e20, 0x5468652076657273, - 0x696f6e2069732022, 0x220a2f2f2f207768, 0x656e20616273656e, 0x742e0a6578706f72, 0x742066756e637469, - 0x6f6e207061727365, 0x5370656328737065, 0x6329207b0a202020, 0x20636f6e73742061, 0x74203d2073706563, - 0x2e696e6465784f66, 0x282240222c207370, 0x65632e7374617274, 0x7357697468282240, 0x2229203f2031203a, - 0x2030293b0a202020, 0x2072657475726e20, 0x6174203c2030203f, 0x207b6e616d653a20, 0x737065632c207665, - 0x7273696f6e3a2022, 0x227d203a207b6e61, 0x6d653a2073706563, 0x2e736c6963652830, 0x2c206174292c2076, - 0x657273696f6e3a20, 0x737065632e736c69, 0x6365286174202b20, 0x31297d3b0a7d0a0a, 0x66756e6374696f6e, - 0x2072656769737472, 0x7942617365287265, 0x6769737472792920, 0x7b0a20202020636f, 0x6e73742062617365, - 0x203d206e65772055, 0x524c287265676973, 0x7472792c20676c6f, 0x62616c546869732e, 0x6c6f636174696f6e, - 0x3f2e68726566293b, 0x0a20202020696620, 0x2821626173652e70, 0x6174686e616d652e, 0x656e647357697468, - 0x28222f2229290a20, 0x2020202020202062, 0x6173652e70617468, 0x6e616d65202b3d20, 0x222f223b0a202020, - 0x2072657475726e20, 0x626173653b0a7d0a, 0x0a2f2f2054686520, 0x7265676973747279, 0x20656e636f646573, - 0x2074686520736c61, 0x7368206f66206120, 0x73636f706564206e, 0x616d652e0a636f6e, 0x7374207061636b75, - 0x6d656e7455726c20, 0x3d2028626173652c, 0x206e616d6529203d, 0x3e206e6577205552, 0x4c286e616d652e72, - 0x65706c6163652822, 0x2f222c2022253266, 0x22292c2062617365, 0x293b0a0a6173796e, 0x632066756e637469, - 0x6f6e206665746368, 0x4f6b2875726c2c20, 0x6665746368496d70, 0x6c2c207369676e61, 0x6c29207b0a202020, - 0x20636f6e73742072, 0x6573706f6e736520, 0x3d20617761697420, 0x6665746368496d70, 0x6c2875726c2c207b, - 0x7369676e616c7d29, 0x3b0a202020206966, 0x202821726573706f, 0x6e73652e6f6b290a, 0x2020202020202020, - 0x7468726f77206e65, 0x77204572726f7228, 0x60247b75726c7d3a, 0x204854545020247b, 0x726573706f6e7365, - 0x2e7374617475737d, 0x60293b0a20202020, 0x72657475726e2072, 0x6573706f6e73653b, 0x0a7d0a0a6173796e, - 0x632066756e637469, 0x6f6e206665746368, 0x4a736f6e2875726c, 0x2c20666574636849, 0x6d706c2c20736967, - 0x6e616c29207b0a20, 0x2020207265747572, 0x6e20286177616974, 0x2066657463684f6b, 0x2875726c2c206665, - 0x746368496d706c2c, 0x207369676e616c29, 0x292e6a736f6e2829, 0x3b0a7d0a0a66756e, 0x6374696f6e207265, - 0x736f6c76654d616e, 0x6966657374287061, 0x636b756d656e742c, 0x206e616d652c2072, 0x6571756573746564, - 0x29207b0a20202020, 0x636f6e7374207461, 0x67203d2072657175, 0x6573746564207c7c, 0x20226c6174657374, - 0x223b0a2020202063, 0x6f6e737420766572, 0x73696f6e203d2070, 0x61636b756d656e74, 0x5b22646973742d74, - 0x616773225d3f2e5b, 0x7461675d203f3f20, 0x7265717565737465, 0x643b0a2020202063, 0x6f6e7374206d616e, - 0x6966657374203d20, 0x7061636b756d656e, 0x742e76657273696f, 0x6e733f2e5b766572, 0x73696f6e5d3b0a20, - 0x2020206966202821, 0x6d616e6966657374, 0x290a202020202020, 0x20207468726f7720, 0x6e6577204572726f, - 0x722860247b6e616d, 0x657d20686173206e, 0x6f2076657273696f, 0x6e2027247b746167, 0x7d2760293b0a2020, - 0x202072657475726e, 0x206d616e69666573, 0x743b0a7d0a0a2f2f, 0x2f20436865636b73, 0x2062797465732061, - 0x6761696e73742061, 0x6e2053524920696e, 0x7465677269747920, 0x737472696e672028, 0x227368613531322d, - 0x3c6261736536343e, 0x222c20706f737369, 0x626c792073657665, 0x72616c2068617368, 0x65730a2f2f2f2073, - 0x6570617261746564, 0x2062792073706163, 0x65732920616e6420, 0x72657475726e7320, 0x746865206d617463, - 0x68696e6720227368, 0x613531322de280a6, 0x2220686173682e20, 0x4f6e6c7920534841, 0x2d35313220697320, - 0x6163636570746564, 0x2e0a6578706f7274, 0x206173796e632066, 0x756e6374696f6e20, 0x766572696679496e, - 0x7465677269747928, 0x62797465732c2069, 0x6e74656772697479, 0x29207b0a20202020, 0x636f6e7374206578, - 0x706563746564203d, 0x20537472696e6728, 0x696e746567726974, 0x79203f3f20222229, 0x0a20202020202020, - 0x202e73706c697428, 0x2f5c732b2f290a20, 0x202020202020202e, 0x66696c7465722828, 0x6861736829203d3e, - 0x20686173682e7374, 0x6172747357697468, 0x2822736861353132, 0x2d2229290a202020, 0x20202020202e6d61, - 0x7028286861736829, 0x203d3e2068617368, 0x2e73706c69742822, 0x3f22295b305d293b, 0x0a20202020696620, - 0x2865787065637465, 0x642e6c656e677468, 0x203d3d3d2030290a, 0x2020202020202020, 0x7468726f77206e65, - 0x77204572726f7228, 0x2254686520706163, 0x6b61676520686173, 0x206e6f205348412d, 0x35313220696e7465, - 0x677269747922293b, 0x0a20202020696620, 0x2821676c6f62616c, 0x546869732e637279, 0x70746f3f2e737562, - 0x746c65290a202020, 0x2020202020746872, 0x6f77206e65772045, 0x72726f722822496e, 0x7465677269747920, - 0x636865636b73206e, 0x6565642061207365, 0x6375726520636f6e, 0x7465787420286874, 0x747073206f72206c, - 0x6f63616c686f7374, 0x2922293b0a202020, 0x20636f6e73742064, 0x6967657374203d20, 0x6e65772055696e74, - 0x3841727261792861, 0x7761697420637279, 0x70746f2e73756274, 0x6c652e6469676573, 0x7428225348412d35, - 0x3132222c20627974, 0x657329293b0a2020, 0x2020636f6e737420, 0x61637475616c203d, 0x2022736861353132, - 0x2d22202b2062746f, 0x612841727261792e, 0x66726f6d28646967, 0x6573742c20286279, 0x746529203d3e2053, - 0x7472696e672e6672, 0x6f6d43686172436f, 0x6465286279746529, 0x292e6a6f696e2822, 0x2229293b0a202020, - 0x2069662028216578, 0x7065637465642e69, 0x6e636c7564657328, 0x61637475616c2929, 0x0a20202020202020, - 0x207468726f77206e, 0x6577204572726f72, 0x2860496e74656772, 0x6974792063686563, 0x6b206661696c6564, - 0x3a20657870656374, 0x656420247b657870, 0x65637465645b305d, 0x7d2c20676f742024, 0x7b61637475616c7d, - 0x60293b0a20202020, 0x72657475726e2061, 0x637475616c3b0a7d, 0x0a0a2f2f2f204775, 0x6e7a697073206279, - 0x7465732c20666169, 0x6c696e67206f6e63, 0x65206d6f72652074, 0x68616e20606c696d, 0x6974602062797465, - 0x7320636f6d65206f, 0x75742e0a6578706f, 0x7274206173796e63, 0x2066756e6374696f, 0x6e2067756e7a6970, - 0x2862797465732c20, 0x6c696d6974203d20, 0x6d6178556e706163, 0x6b65644279746573, 0x29207b0a20202020, - 0x636f6e7374207265, 0x61646572203d206e, 0x657720426c6f6228, 0x5b62797465735d29, 0x2e73747265616d28, - 0x292e706970655468, 0x726f756768286e65, 0x77204465636f6d70, 0x72657373696f6e53, 0x747265616d282267, - 0x7a69702229292e67, 0x6574526561646572, 0x28293b0a20202020, 0x636f6e7374206368, 0x756e6b73203d205b, - 0x5d3b0a202020206c, 0x657420746f74616c, 0x203d20303b0a2020, 0x2020666f7220286c, 0x6574207265616420, - 0x3d20617761697420, 0x7265616465722e72, 0x65616428293b2021, 0x726561642e646f6e, 0x653b207265616420, - 0x3d20617761697420, 0x7265616465722e72, 0x656164282929207b, 0x0a20202020202020, 0x20746f74616c202b, - 0x3d20726561642e76, 0x616c75652e6c656e, 0x6774683b0a202020, 0x2020202020696620, 0x28746f74616c203e, - 0x206c696d69742920, 0x7b0a202020202020, 0x2020202020206177, 0x6169742072656164, 0x65722e63616e6365, - 0x6c28293b0a202020, 0x2020202020202020, 0x207468726f77206e, 0x6577204572726f72, 0x2860546865207461, - 0x7262616c6c20756e, 0x7061636b7320746f, 0x206d6f7265207468, 0x616e20247b6c696d, 0x69747d2062797465, - 0x7360293b0a202020, 0x20202020207d0a20, 0x2020202020202063, 0x68756e6b732e7075, 0x736828726561642e, - 0x76616c7565293b0a, 0x202020207d0a2020, 0x202072657475726e, 0x206e65772055696e, 0x7438417272617928, - 0x6177616974206e65, 0x7720426c6f622863, 0x68756e6b73292e61, 0x7272617942756666, 0x65722829293b0a7d, - 0x0a0a2f2f2041204e, 0x554c2d7465726d69, 0x6e61746564206865, 0x6164657220666965, 0x6c642e0a66756e63, - 0x74696f6e20746578, 0x7428626c6f636b2c, 0x206f66667365742c, 0x206c656e67746829, 0x207b0a2020202063, - 0x6f6e737420666965, 0x6c64203d20626c6f, 0x636b2e7375626172, 0x726179286f666673, 0x65742c206f666673, - 0x6574202b206c656e, 0x677468293b0a2020, 0x2020636f6e737420, 0x656e64203d206669, 0x656c642e696e6465, - 0x784f662830293b0a, 0x2020202072657475, 0x726e20757466382e, 0x6465636f64652865, 0x6e64203c2030203f, - 0x206669656c64203a, 0x206669656c642e73, 0x7562617272617928, 0x302c20656e642929, 0x3b0a7d0a0a2f2f20, - 0x416e206f6374616c, 0x206e756d6265722c, 0x206f722061206261, 0x73652d323536206f, 0x6e65207768656e20, - 0x7468652066697273, 0x7420627974652068, 0x6173206974732068, 0x6967682062697420, 0x7365742028474e55, - 0x20616e6420737461, 0x72292e0a66756e63, 0x74696f6e206e756d, 0x62657228626c6f63, 0x6b2c206f66667365, - 0x742c206c656e6774, 0x6829207b0a202020, 0x2069662028626c6f, 0x636b5b6f66667365, 0x745d202620307838, - 0x30290a2020202020, 0x2020207265747572, 0x6e20626c6f636b2e, 0x7375626172726179, 0x286f666673657420, - 0x2b20312c206f6666, 0x736574202b206c65, 0x6e677468292e7265, 0x6475636528287661, 0x6c75652c20627974, - 0x6529203d3e207661, 0x6c7565202a203235, 0x36202b2062797465, 0x2c20626c6f636b5b, 0x6f66667365745d20, - 0x262030783766293b, 0x0a20202020636f6e, 0x7374206469676974, 0x73203d2074657874, 0x28626c6f636b2c20, - 0x6f66667365742c20, 0x6c656e677468292e, 0x7472696d28293b0a, 0x2020202069662028, 0x212f5e5b302d375d, - 0x2a242f2e74657374, 0x2864696769747329, 0x290a202020202020, 0x20207468726f7720, 0x6e6577204572726f, - 0x722822436f727275, 0x7074207461722068, 0x656164657222293b, 0x0a20202020726574, 0x75726e2064696769, - 0x7473203d3d3d2022, 0x22203f2030203a20, 0x7061727365496e74, 0x286469676974732c, 0x2038293b0a7d0a0a, - 0x66756e6374696f6e, 0x2076657269667943, 0x6865636b73756d28, 0x6865616465722920, 0x7b0a202020206c65, - 0x742073756d203d20, 0x303b0a2020202066, 0x6f7220286c657420, 0x696e646578203d20, 0x303b20696e646578, - 0x203c20626c6f636b, 0x53697a653b202b2b, 0x696e646578290a20, 0x2020202020202073, 0x756d202b3d20696e, - 0x646578203e3d2031, 0x343820262620696e, 0x646578203c203135, 0x36203f2030783230, 0x203a206865616465, - 0x725b696e6465785d, 0x3b0a202020206966, 0x20286e756d626572, 0x286865616465722c, 0x203134382c203829, - 0x20213d3d2073756d, 0x290a202020202020, 0x20207468726f7720, 0x6e6577204572726f, 0x722822436f727275, - 0x7074207461722068, 0x6561646572206368, 0x65636b73756d2229, 0x3b0a7d0a0a2f2f20, 0x223c6c656e677468, - 0x3e203c6b65793e3d, 0x3c76616c75653e5c, 0x6e22207265636f72, 0x6473206f66206120, 0x7061782065787465, - 0x6e64656420686561, 0x6465723b206c656e, 0x6774687320636f75, 0x6e74206279746573, 0x2e0a66756e637469, - 0x6f6e207061785265, 0x636f726473286461, 0x746129207b0a2020, 0x2020636f6e737420, 0x7265636f72647320, - 0x3d207b7d3b0a2020, 0x20206c6574206f66, 0x66736574203d2030, 0x3b0a202020207768, 0x696c6520286f6666, - 0x736574203c206461, 0x74612e6c656e6774, 0x6829207b0a202020, 0x2020202020636f6e, 0x7374207370616365, - 0x203d20646174612e, 0x696e6465784f6628, 0x307832302c206f66, 0x66736574293b0a20, 0x2020202020202063, - 0x6f6e7374206c656e, 0x677468203d207370, 0x616365203c203020, 0x3f204e614e203a20, 0x4e756d6265722875, - 0x7466382e6465636f, 0x646528646174612e, 0x7375626172726179, 0x286f66667365742c, 0x2073706163652929, - 0x293b0a2020202020, 0x2020206966202821, 0x286c656e67746820, 0x3e203029207c7c20, 0x6f6666736574202b, - 0x206c656e67746820, 0x3e20646174612e6c, 0x656e677468290a20, 0x2020202020202020, 0x2020207468726f77, - 0x206e657720457272, 0x6f722822436f7272, 0x7570742070617820, 0x6865616465722229, 0x3b0a202020202020, - 0x2020636f6e737420, 0x7265636f7264203d, 0x20757466382e6465, 0x636f646528646174, 0x612e737562617272, - 0x6179287370616365, 0x202b20312c206f66, 0x66736574202b206c, 0x656e677468202d20, 0x3129293b0a202020, - 0x2020202020636f6e, 0x737420657175616c, 0x73203d207265636f, 0x72642e696e646578, 0x4f6628223d22293b, - 0x0a20202020202020, 0x207265636f726473, 0x5b7265636f72642e, 0x736c69636528302c, 0x20657175616c7329, - 0x5d203d207265636f, 0x72642e736c696365, 0x28657175616c7320, 0x2b2031293b0a2020, 0x2020202020206f66, - 0x66736574202b3d20, 0x6c656e6774683b0a, 0x202020207d0a2020, 0x202072657475726e, 0x207265636f726473, - 0x3b0a7d0a0a2f2f20, 0x54686520656e7472, 0x792077686f736520, 0x6865616465722073, 0x7461727473206174, - 0x20606f6666736574, 0x603a206974732068, 0x65616465722c2074, 0x79706520666c6167, 0x2c20646174612061, - 0x6e6420746865206f, 0x6666736574206f66, 0x20746865206e6578, 0x740a2f2f20656e74, 0x72792e0a66756e63, - 0x74696f6e20726561, 0x64456e7472792861, 0x7263686976652c20, 0x6f66667365742920, 0x7b0a20202020636f, - 0x6e73742068656164, 0x6572203d20617263, 0x686976652e737562, 0x6172726179286f66, 0x667365742c206f66, - 0x66736574202b2062, 0x6c6f636b53697a65, 0x293b0a2020202076, 0x6572696679436865, 0x636b73756d286865, - 0x61646572293b0a20, 0x202020636f6e7374, 0x2073697a65203d20, 0x6e756d6265722868, 0x65616465722c2031, - 0x32342c203132293b, 0x0a20202020636f6e, 0x7374207374617274, 0x203d206f66667365, 0x74202b20626c6f63, - 0x6b53697a653b0a20, 0x2020206966202873, 0x74617274202b2073, 0x697a65203e206172, 0x63686976652e6c65, - 0x6e677468290a2020, 0x2020202020207468, 0x726f77206e657720, 0x4572726f72282254, 0x72756e6361746564, - 0x2074617220617263, 0x6869766522293b0a, 0x2020202072657475, 0x726e207b0a202020, 0x2020202020686561, - 0x6465722c0a202020, 0x2020202020747970, 0x653a206865616465, 0x725b3135365d203d, 0x3d3d2030203f2022, - 0x3022203a20537472, 0x696e672e66726f6d, 0x43686172436f6465, 0x286865616465725b, 0x3135365d292c0a20, - 0x2020202020202064, 0x6174613a20617263, 0x686976652e737562, 0x6172726179287374, 0x6172742c20737461, - 0x7274202b2073697a, 0x65292c0a20202020, 0x202020206e657874, 0x3a20737461727420, 0x2b204d6174682e63, - 0x65696c2873697a65, 0x202f20626c6f636b, 0x53697a6529202a20, 0x626c6f636b53697a, 0x652c0a202020207d, - 0x3b0a7d0a0a2f2f20, 0x416e206172636869, 0x766520656e647320, 0x61742074776f207a, 0x65726f20626c6f63, - 0x6b733b206f6e6520, 0x697320656e6f7567, 0x6820746f2073746f, 0x702e0a66756e6374, 0x696f6e206973456e, - 0x6428617263686976, 0x652c206f66667365, 0x7429207b0a202020, 0x2072657475726e20, 0x6f6666736574202b, - 0x20626c6f636b5369, 0x7a65203e20617263, 0x686976652e6c656e, 0x677468207c7c2061, 0x7263686976652e73, - 0x7562617272617928, 0x6f66667365742c20, 0x6f6666736574202b, 0x20626c6f636b5369, 0x7a65292e65766572, - 0x7928286279746529, 0x203d3e2062797465, 0x203d3d3d2030293b, 0x0a7d0a0a2f2f2054, 0x6865206e616d6520, - 0x6669656c64206f66, 0x2061207573746172, 0x206865616465722c, 0x2061667465722069, 0x7473207072656669, - 0x78206669656c642e, 0x0a66756e6374696f, 0x6e20686561646572, 0x5061746828686561, 0x64657229207b0a20, - 0x202020636f6e7374, 0x206e616d65203d20, 0x7465787428686561, 0x6465722c20302c20, 0x313030293b0a2020, - 0x2020636f6e737420, 0x707265666978203d, 0x2074657874286865, 0x616465722c203235, 0x372c203529203d3d, - 0x3d20227573746172, 0x22203f2074657874, 0x286865616465722c, 0x203334352c203135, 0x3529203a2022223b, - 0x0a20202020726574, 0x75726e2070726566, 0x6978203f2060247b, 0x7072656669787d2f, 0x247b6e616d657d60, - 0x203a206e616d653b, 0x0a7d0a0a2f2f2045, 0x6e7472696573206e, 0x616d696e67207468, 0x65206e657874206f, - 0x6e653a2061207061, 0x7820657874656e64, 0x6564206865616465, 0x7220616e64206120, 0x474e55206c6f6e67, - 0x206e616d652e2041, 0x2070617820676c6f, 0x62616c2068656164, 0x6572206e616d6573, 0x0a2f2f206e6f7468, - 0x696e672057656246, 0x726f6e7420757365, 0x732e0a636f6e7374, 0x206e616d65456e74, 0x72696573203d207b, - 0x0a20202020783a20, 0x286e616d65732c20, 0x6461746129203d3e, 0x20287b2e2e2e6e61, 0x6d65732c20706178, - 0x3a20706178526563, 0x6f72647328646174, 0x61292e706174687d, 0x292c0a202020204c, 0x3a20286e616d6573, - 0x2c20646174612920, 0x3d3e20287b2e2e2e, 0x6e616d65732c206c, 0x6f6e673a20746578, 0x7428646174612c20, - 0x302c20646174612e, 0x6c656e677468297d, 0x292c0a2020202067, 0x3a20286e616d6573, 0x29203d3e206e616d, - 0x65732c0a7d3b0a0a, 0x2f2f2f2052656164, 0x7320612074617220, 0x6172636869766520, 0x2875737461722c20, - 0x7769746820706178, 0x20616e6420474e55, 0x206c6f6e67206e61, 0x6d65732920616e64, 0x2072657475726e73, - 0x2069747320726567, 0x756c61722066696c, 0x65732061730a2f2f, 0x2f207b706174682c, 0x2062797465737d2c, - 0x20696e2061726368, 0x697665206f726465, 0x722e204469726563, 0x746f726965732c20, 0x6c696e6b7320616e, - 0x64206f7468657220, 0x656e747269657320, 0x61726520736b6970, 0x7065642e0a657870, 0x6f72742066756e63, - 0x74696f6e20726561, 0x6454617228617263, 0x6869766529207b0a, 0x20202020636f6e73, 0x742066696c657320, - 0x3d205b5d3b0a2020, 0x20206c6574206e61, 0x6d6573203d207b7d, 0x3b0a20202020666f, 0x7220286c6574206f, - 0x6666736574203d20, 0x303b20216973456e, 0x6428617263686976, 0x652c206f66667365, 0x74293b29207b0a20, - 0x2020202020202063, 0x6f6e7374207b6865, 0x616465722c207479, 0x70652c2064617461, 0x2c206e6578747d20, - 0x3d2072656164456e, 0x7472792861726368, 0x6976652c206f6666, 0x736574293b0a2020, 0x2020202020206f66, - 0x66736574203d206e, 0x6578743b0a202020, 0x2020202020696620, 0x284f626a6563742e, 0x6861734f776e286e, - 0x616d65456e747269, 0x65732c2074797065, 0x2929207b0a202020, 0x2020202020202020, 0x206e616d6573203d, - 0x206e616d65456e74, 0x726965735b747970, 0x655d286e616d6573, 0x2c2064617461293b, 0x0a20202020202020, - 0x2020202020636f6e, 0x74696e75653b0a20, 0x202020202020207d, 0x0a20202020202020, 0x2069662028747970, - 0x65203d3d3d202230, 0x22207c7c20747970, 0x65203d3d3d202237, 0x22290a2020202020, 0x2020202020202066, - 0x696c65732e707573, 0x68287b706174683a, 0x206e616d65732e70, 0x6178203f3f206e61, 0x6d65732e6c6f6e67, - 0x203f3f2068656164, 0x6572506174682868, 0x6561646572292c20, 0x62797465733a2064, 0x6174617d293b0a20, - 0x202020202020206e, 0x616d6573203d207b, 0x7d3b0a202020207d, 0x0a20202020726574, 0x75726e2066696c65, - 0x733b0a7d0a0a2f2f, 0x2f20546865206669, 0x6c6573206f662061, 0x6e206e706d207461, 0x7262616c6c206279, - 0x2070617468207265, 0x6c61746976652074, 0x6f20746865207061, 0x636b61676520726f, 0x6f743a2074686520, - 0x6669727374207061, 0x746820636f6d706f, 0x6e656e740a2f2f2f, 0x20286e6f726d616c, 0x6c7920227061636b, - 0x6167652f22292069, 0x732072656d6f7665, 0x642c206173206e70, 0x6d20646f65732e20, 0x41206c6174657220, - 0x656e747279207265, 0x706c616365732061, 0x6e206561726c6965, 0x72206f6e652e0a66, 0x756e6374696f6e20, - 0x7061636b61676546, 0x696c657328656e74, 0x7269657329207b0a, 0x20202020636f6e73, 0x742066696c657320, - 0x3d206e6577204d61, 0x7028293b0a202020, 0x20666f722028636f, 0x6e7374207b706174, 0x682c206279746573, - 0x7d206f6620656e74, 0x7269657329207b0a, 0x2020202020202020, 0x636f6e7374207265, 0x6c6174697665203d, - 0x20706174682e7265, 0x706c616365282f5e, 0x285c2e3f5c2f292b, 0x2f2c202222292e73, 0x706c697428222f22, - 0x292e736c69636528, 0x31292e6a6f696e28, 0x222f22293b0a2020, 0x2020202020206966, 0x202872656c617469, - 0x766520213d3d2022, 0x22290a2020202020, 0x2020202020202066, 0x696c65732e736574, 0x2872656c61746976, - 0x652c206279746573, 0x293b0a202020207d, 0x0a20202020726574, 0x75726e2066696c65, 0x733b0a7d0a0a6675, - 0x6e6374696f6e2070, 0x61636b6167654a73, 0x6f6e2866696c6573, 0x2c206e616d652c20, 0x76657273696f6e29, - 0x207b0a2020202063, 0x6f6e7374206d616e, 0x6966657374203d20, 0x66696c65732e6765, 0x7428227061636b61, - 0x67652e6a736f6e22, 0x293b0a2020202069, 0x662028216d616e69, 0x66657374290a2020, 0x2020202020207468, - 0x726f77206e657720, 0x4572726f72286024, 0x7b6e616d657d4024, 0x7b76657273696f6e, 0x7d20686173206e6f, - 0x207061636b616765, 0x2e6a736f6e60293b, 0x0a20202020636f6e, 0x737420706b67203d, 0x204a534f4e2e7061, - 0x7273652875746638, 0x2e6465636f646528, 0x6d616e6966657374, 0x29293b0a20202020, 0x69662028706b672e, - 0x6e616d6520213d3d, 0x206e616d65207c7c, 0x20706b672e766572, 0x73696f6e20213d3d, 0x2076657273696f6e, - 0x290a202020202020, 0x20207468726f7720, 0x6e6577204572726f, 0x7228605468652061, 0x7263686976652063, - 0x6f6e7461696e7320, 0x247b706b672e6e61, 0x6d657d40247b706b, 0x672e76657273696f, 0x6e7d2c206e6f7420, - 0x247b6e616d657d40, 0x247b76657273696f, 0x6e7d60293b0a2020, 0x202072657475726e, 0x20706b673b0a7d0a, - 0x0a636f6e73742069, 0x73546f6f6c203d20, 0x286669656c642920, 0x3d3e206669656c64, 0x3f2e6b696e64203d, - 0x3d3d2022746f6f6c, 0x2220262620747970, 0x656f66206669656c, 0x642e656e74727920, 0x3d3d3d2022737472, - 0x696e67223b0a0a66, 0x756e6374696f6e20, 0x746f6f6c4f662866, 0x696c65732c206e61, 0x6d652c2076657273, - 0x696f6e29207b0a20, 0x202020636f6e7374, 0x20746f6f6c203d20, 0x7061636b6167654a, 0x736f6e2866696c65, - 0x732c206e616d652c, 0x2076657273696f6e, 0x292e77656266726f, 0x6e743b0a20202020, 0x6966202821697354, - 0x6f6f6c28746f6f6c, 0x29290a2020202020, 0x2020207468726f77, 0x206e657720457272, 0x6f722860247b6e61, - 0x6d657d206973206e, 0x6f74206120576562, 0x46726f6e7420746f, 0x6f6c3a2069747320, 0x7061636b6167652e, - 0x6a736f6e20686173, 0x206e6f2077656266, 0x726f6e7420666965, 0x6c64207769746820, 0x6b696e642022746f, - 0x6f6c2220616e6420, 0x616e20656e747279, 0x60293b0a20202020, 0x72657475726e207b, 0x656e7472793a2074, - 0x6f6f6c2e656e7472, 0x792e7265706c6163, 0x65282f5e285c2e5c, 0x2f292b2f2c202222, 0x292c207469746c65, - 0x3a20747970656f66, 0x20746f6f6c2e7469, 0x746c65203d3d3d20, 0x22737472696e6722, 0x203f20746f6f6c2e, - 0x7469746c65203a20, 0x6e616d657d3b0a7d, 0x0a0a636f6e737420, 0x706b6746756e6374, 0x696f6e203d202862, - 0x72696467652c206e, 0x616d6529203d3e20, 0x6272696467652e63, 0x707046756e637469, 0x6f6e286077656266, - 0x726f6e742e706b67, 0x2e247b6e616d657d, 0x60293b0a0a2f2f2f, 0x204f7074696f6e73, 0x2073686172656420, - 0x6279207365617263, 0x68282920616e6420, 0x696e7374616c6c28, 0x293a0a2f2f2f2020, 0x2062726964676520, - 0x2020207468652057, 0x656246726f6e7420, 0x6272696467652028, 0x676c6f62616c5468, 0x69732e7765624672, - 0x6f6e74290a2f2f2f, 0x2020207265676973, 0x7472792020746865, 0x206e706d20726567, 0x6973747279205552, - 0x4c20286465666175, 0x6c743a2077656266, 0x726f6e742e706b67, 0x2e72656769737472, 0x7928292c20736574, - 0x20696e20546f6f6c, 0x4d616e616765724f, 0x7074696f6e73290a, 0x2f2f2f2020206665, 0x7463682020202020, - 0x7468652066657463, 0x682066756e637469, 0x6f6e0a2f2f2f2020, 0x207369676e616c20, 0x202020616e204162, - 0x6f72745369676e61, 0x6c2073746f707069, 0x6e67207468652064, 0x6f776e6c6f616473, 0x20616e6420746865, - 0x2075706c6f61640a, 0x6173796e63206675, 0x6e6374696f6e2073, 0x657474696e677328, 0x7b62726964676520, - 0x3d20676c6f62616c, 0x546869732e776562, 0x46726f6e742c2072, 0x656769737472792c, 0x2066657463683a20, - 0x6665746368496d70, 0x6c203d20282e2e2e, 0x6172677329203d3e, 0x20676c6f62616c54, 0x6869732e66657463, - 0x68282e2e2e617267, 0x73292c207369676e, 0x616c7d203d207b7d, 0x29207b0a20202020, 0x72657475726e207b, - 0x6272696467652c20, 0x6665746368496d70, 0x6c2c207369676e61, 0x6c2c20626173653a, 0x2072656769737472, - 0x7942617365287265, 0x676973747279203f, 0x3f20286177616974, 0x20706b6746756e63, 0x74696f6e28627269, - 0x6467652c20227265, 0x6769737472792229, 0x282929297d3b0a7d, 0x0a0a2f2f2f205365, 0x6172636865732074, - 0x6865207265676973, 0x74727920666f7220, 0x7061636b61676573, 0x2077697468207468, 0x652077656266726f, - 0x6e742d746f6f6c20, 0x6b6579776f72642e, 0x2052657475726e73, 0x207b6e616d652c20, 0x76657273696f6e2c, - 0x0a2f2f2f20646573, 0x6372697074696f6e, 0x7d206f626a656374, 0x732e0a6578706f72, 0x74206173796e6320, - 0x66756e6374696f6e, 0x2073656172636828, 0x7465726d2c206f70, 0x74696f6e7329207b, 0x0a20202020636f6e, - 0x7374207b66657463, 0x68496d706c2c2073, 0x69676e616c2c2062, 0x6173657d203d2061, 0x7761697420736574, - 0x74696e6773286f70, 0x74696f6e73293b0a, 0x20202020636f6e73, 0x742075726c203d20, 0x6e65772055524c28, - 0x222d2f76312f7365, 0x61726368222c2062, 0x617365293b0a2020, 0x202075726c2e7365, 0x6172636850617261, - 0x6d732e7365742822, 0x74657874222c2060, 0x6b6579776f726473, 0x3a77656266726f6e, 0x742d746f6f6c2024, - 0x7b7465726d7d602e, 0x7472696d2829293b, 0x0a2020202075726c, 0x2e73656172636850, 0x6172616d732e7365, - 0x74282273697a6522, 0x2c2022323022293b, 0x0a20202020636f6e, 0x737420726573756c, 0x74203d2061776169, - 0x742066657463684a, 0x736f6e2875726c2c, 0x206665746368496d, 0x706c2c207369676e, 0x616c293b0a202020, - 0x2072657475726e20, 0x28726573756c742e, 0x6f626a6563747320, 0x3f3f205b5d292e6d, 0x617028287b706163, - 0x6b6167653a20666f, 0x756e647d29203d3e, 0x20287b0a20202020, 0x202020206e616d65, 0x3a20666f756e642e, - 0x6e616d652c0a2020, 0x2020202020207665, 0x7273696f6e3a2066, 0x6f756e642e766572, 0x73696f6e2c0a2020, - 0x2020202020206465, 0x736372697074696f, 0x6e3a20666f756e64, 0x2e64657363726970, 0x74696f6e203f3f20, - 0x22222c0a20202020, 0x7d29293b0a7d0a0a, 0x2f2f20446f776e6c, 0x6f61647320746865, 0x2074617262616c6c, - 0x206f662061206d61, 0x6e69666573742061, 0x6e64207265747572, 0x6e73206974732066, 0x696c657320776974, - 0x6820746865207665, 0x7269666965642069, 0x6e74656772697479, 0x2e0a6173796e6320, 0x66756e6374696f6e, - 0x20646f776e6c6f61, 0x64286d616e696665, 0x73742c207061636b, 0x756d656e744c6f63, 0x6174696f6e2c2066, - 0x65746368496d706c, 0x2c207369676e616c, 0x29207b0a20202020, 0x636f6e7374207461, 0x7262616c6c55726c, - 0x203d206e65772055, 0x524c286d616e6966, 0x6573742e64697374, 0x3f2e74617262616c, 0x6c203f3f2022222c, - 0x207061636b756d65, 0x6e744c6f63617469, 0x6f6e293b0a202020, 0x20636f6e73742074, 0x617262616c6c203d, - 0x206e65772055696e, 0x7438417272617928, 0x6177616974202861, 0x7761697420666574, 0x63684f6b28746172, - 0x62616c6c55726c2c, 0x206665746368496d, 0x706c2c207369676e, 0x616c29292e617272, 0x6179427566666572, - 0x2829293b0a202020, 0x20636f6e73742069, 0x6e74656772697479, 0x203d206177616974, 0x2076657269667949, - 0x6e74656772697479, 0x2874617262616c6c, 0x2c206d616e696665, 0x73742e646973743f, 0x2e696e7465677269, - 0x7479293b0a202020, 0x2072657475726e20, 0x7b696e7465677269, 0x74792c2066696c65, 0x733a207061636b61, - 0x676546696c657328, 0x7265616454617228, 0x6177616974206775, 0x6e7a697028746172, 0x62616c6c2929297d, - 0x3b0a7d0a0a2f2f20, 0x53656e6473207468, 0x652066696c657320, 0x746f207765626672, 0x6f6e742e706b672e, - 0x777269746546696c, 0x6520696e20636875, 0x6e6b733b20616e20, 0x656d707479206669, 0x6c65206973207365, - 0x6e74206173206f6e, 0x6520656d70747920, 0x6368756e6b2e0a61, 0x73796e632066756e, 0x6374696f6e207570, - 0x6c6f61642866696c, 0x65732c207b627269, 0x6467652c206e616d, 0x652c207665727369, 0x6f6e2c207369676e, - 0x616c7d29207b0a20, 0x202020636f6e7374, 0x2077726974654669, 0x6c65203d20706b67, 0x46756e6374696f6e, - 0x286272696467652c, 0x2022777269746546, 0x696c6522293b0a20, 0x202020666f722028, 0x636f6e7374205b70, - 0x6174682c20627974, 0x65735d206f662066, 0x696c657329207b0a, 0x2020202020202020, 0x6c6574206f666673, - 0x6574203d20303b0a, 0x2020202020202020, 0x646f207b0a202020, 0x2020202020202020, 0x207369676e616c3f, - 0x2e7468726f774966, 0x41626f7274656428, 0x293b0a2020202020, 0x2020202020202063, 0x6f6e737420636875, - 0x6e6b203d20627974, 0x65732e7375626172, 0x726179286f666673, 0x65742c206f666673, 0x6574202b20636875, - 0x6e6b53697a65293b, 0x0a20202020202020, 0x2020202020617761, 0x6974207772697465, 0x46696c65286e616d, - 0x652c207665727369, 0x6f6e2c2070617468, 0x2c206f6666736574, 0x2c206368756e6b29, 0x3b0a202020202020, - 0x2020202020206f66, 0x66736574202b3d20, 0x6368756e6b2e6c65, 0x6e6774683b0a2020, 0x2020202020207d20, - 0x7768696c6520286f, 0x6666736574203c20, 0x62797465732e6c65, 0x6e677468293b0a20, 0x2020207d0a7d0a0a, - 0x2f2f2f20446f776e, 0x6c6f6164732c2076, 0x6572696669657320, 0x616e642073746f72, 0x657320226e616d65, - 0x5b4076657273696f, 0x6e206f7220646973, 0x742d7461675d2220, 0x286c617465737420, 0x6279206465666175, - 0x6c74292e20607072, 0x6f67726573732874, 0x65787429600a2f2f, 0x2f207265706f7274, 0x7320746865207374, - 0x6570732e20526573, 0x6f6c76657320746f, 0x207b6e616d652c20, 0x76657273696f6e2c, 0x207469746c652c20, - 0x656e7472792c2066, 0x696c65737d3b2072, 0x656a656374732077, 0x6974686f75742063, 0x68616e67696e6720, - 0x7468650a2f2f2f20, 0x696e7374616c6c65, 0x642076657273696f, 0x6e207768656e2061, 0x6e797468696e6720, - 0x6661696c73206f72, 0x20607369676e616c, 0x602069732061626f, 0x727465642e0a6578, 0x706f727420617379, - 0x6e632066756e6374, 0x696f6e20696e7374, 0x616c6c2873706563, 0x2c207b70726f6772, 0x657373203d202829, - 0x203d3e207b7d2c20, 0x2e2e2e6f7074696f, 0x6e737d203d207b7d, 0x29207b0a20202020, 0x636f6e7374207b6e, - 0x616d652c20766572, 0x73696f6e3a207265, 0x717565737465647d, 0x203d207061727365, 0x5370656328737065, - 0x63293b0a20202020, 0x636f6e7374207b62, 0x72696467652c2066, 0x65746368496d706c, 0x2c207369676e616c, - 0x2c20626173657d20, 0x3d20617761697420, 0x73657474696e6773, 0x286f7074696f6e73, 0x293b0a2020202063, - 0x6f6e737420706163, 0x6b756d656e744c6f, 0x636174696f6e203d, 0x207061636b756d65, 0x6e7455726c286261, - 0x73652c206e616d65, 0x293b0a2020202063, 0x6f6e7374206d616e, 0x6966657374203d20, 0x7265736f6c76654d, - 0x616e696665737428, 0x6177616974206665, 0x7463684a736f6e28, 0x7061636b756d656e, 0x744c6f636174696f, - 0x6e2c206665746368, 0x496d706c2c207369, 0x676e616c292c206e, 0x616d652c20726571, 0x756573746564293b, - 0x0a20202020636f6e, 0x7374207b76657273, 0x696f6e7d203d206d, 0x616e69666573743b, 0x0a2020202070726f, - 0x6772657373286044, 0x6f776e6c6f616469, 0x6e6720247b6e616d, 0x657d40247b766572, 0x73696f6e7de280a6, - 0x60293b0a20202020, 0x636f6e7374207b69, 0x6e74656772697479, 0x2c2066696c65737d, 0x203d206177616974, - 0x20646f776e6c6f61, 0x64286d616e696665, 0x73742c207061636b, 0x756d656e744c6f63, 0x6174696f6e2c2066, - 0x65746368496d706c, 0x2c207369676e616c, 0x293b0a2020202063, 0x6f6e7374207b656e, 0x7472792c20746974, - 0x6c657d203d20746f, 0x6f6c4f662866696c, 0x65732c206e616d65, 0x2c2076657273696f, 0x6e293b0a20202020, - 0x696620282166696c, 0x65732e6861732865, 0x6e74727929290a20, 0x2020202020202074, 0x68726f77206e6577, - 0x204572726f722860, 0x54686520656e7472, 0x7920706167652024, 0x7b656e7472797d20, 0x6f6620247b6e616d, - 0x657d206973206e6f, 0x7420696e20746865, 0x207061636b616765, 0x60293b0a0a202020, 0x2070726f67726573, - 0x732860496e737461, 0x6c6c696e6720247b, 0x66696c65732e7369, 0x7a657d2066696c65, 0x73e280a660293b0a, - 0x2020202061776169, 0x7420706b6746756e, 0x6374696f6e286272, 0x696467652c202262, 0x6567696e2229286e, - 0x616d652c20766572, 0x73696f6e293b0a20, 0x2020206177616974, 0x2075706c6f616428, 0x66696c65732c207b, - 0x6272696467652c20, 0x6e616d652c207665, 0x7273696f6e2c2073, 0x69676e616c7d293b, 0x0a20202020736967, - 0x6e616c3f2e746872, 0x6f77496641626f72, 0x74656428293b0a20, 0x2020206177616974, 0x20706b6746756e63, - 0x74696f6e28627269, 0x6467652c2022636f, 0x6d6d69742229286e, 0x616d652c20766572, 0x73696f6e2c20696e, - 0x746567726974792c, 0x20656e7472792c20, 0x7469746c65293b0a, 0x2020202072657475, 0x726e207b6e616d65, - 0x2c2076657273696f, 0x6e2c207469746c65, 0x2c20656e7472792c, 0x2066696c65733a20, 0x66696c65732e7369, - 0x7a657d3b0a7d0a0a, 0x2f2f2f2054686520, 0x696e7374616c6c65, 0x6420746f6f6c732c, 0x2066726f6d207468, - 0x6520706167657320, 0x6f66207765626672, 0x6f6e742e706b672e, 0x6c69737428293a20, 0x7b6e616d652c2076, - 0x657273696f6e2c20, 0x75726c2c20746974, 0x6c657d206f626a65, 0x6374732e0a657870, 0x6f7274206173796e, - 0x632066756e637469, 0x6f6e20696e737461, 0x6c6c656428627269, 0x646765203d20676c, 0x6f62616c54686973, - 0x2e77656246726f6e, 0x7429207b0a202020, 0x20636f6e7374206c, 0x697374203d20706b, 0x6746756e6374696f, - 0x6e28627269646765, 0x2c20226c69737422, 0x293b0a2020202063, 0x6f6e737420746f6f, 0x6c73203d205b5d3b, - 0x0a20202020666f72, 0x20283b3b29207b0a, 0x2020202020202020, 0x636f6e7374206c69, 0x6e6573203d202861, - 0x77616974206c6973, 0x7428746f6f6c732e, 0x6c656e6774682929, 0x2e73706c69742822, 0x5c6e22292e66696c, - 0x74657228286c696e, 0x6529203d3e206c69, 0x6e6520213d3d2022, 0x22293b0a20202020, 0x2020202069662028, - 0x6c696e65732e6c65, 0x6e677468203d3d3d, 0x2030290a20202020, 0x2020202020202020, 0x72657475726e2074, - 0x6f6f6c733b0a2020, 0x202020202020666f, 0x722028636f6e7374, 0x206c696e65206f66, 0x206c696e65732920, - 0x7b0a202020202020, 0x202020202020636f, 0x6e7374205b6e616d, 0x652c207665727369, 0x6f6e2c2075726c2c, - 0x207469746c655d20, 0x3d206c696e652e73, 0x706c697428225c74, 0x22293b0a20202020, 0x2020202020202020, - 0x746f6f6c732e7075, 0x7368287b6e616d65, 0x2c2076657273696f, 0x6e2c2075726c2c20, 0x7469746c657d293b, - 0x0a20202020202020, 0x207d0a202020207d, 0x0a7d0a0a2f2f2f20, 0x4f70656e73207468, 0x6520656e74727920, - 0x70616765206f6620, 0x616e20696e737461, 0x6c6c656420746f6f, 0x6c20696e2061206e, 0x657720746162206f, - 0x722077696e646f77, 0x2c20616e64207265, 0x736f6c7665732074, 0x6f20697473205552, 0x4c2e0a6578706f72, - 0x74206173796e6320, 0x66756e6374696f6e, 0x206f70656e286e61, 0x6d652c2062726964, 0x6765203d20676c6f, - 0x62616c546869732e, 0x77656246726f6e74, 0x29207b0a20202020, 0x636f6e737420746f, 0x6f6c203d20286177, - 0x61697420696e7374, 0x616c6c6564286272, 0x6964676529292e66, 0x696e64282863616e, 0x6469646174652920, - 0x3d3e2063616e6469, 0x646174652e6e616d, 0x65203d3d3d206e61, 0x6d65293b0a202020, 0x206966202821746f, - 0x6f6c290a20202020, 0x202020207468726f, 0x77206e6577204572, 0x726f722860247b6e, 0x616d657d20697320, - 0x6e6f7420696e7374, 0x616c6c656460293b, 0x0a20202020726574, 0x75726e207b2e2e2e, 0x746f6f6c2c206f70, - 0x656e65643a20676c, 0x6f62616c54686973, 0x2e6f70656e28746f, 0x6f6c2e75726c2c20, 0x225f626c616e6b22, - 0x2920213d3d206e75, 0x6c6c7d3b0a7d0a0a, 0x66756e6374696f6e, 0x2072657175697265, 0x4f6e652861726773, - 0x29207b0a20202020, 0x6966202861726773, 0x2e6c656e67746820, 0x213d3d2031290a20, 0x2020202020202074, - 0x68726f77206e6577, 0x204572726f722822, 0x57726f6e67206e75, 0x6d626572206f6620, 0x617267756d656e74, - 0x732e205479706520, 0x2777662068656c70, 0x272e22293b0a2020, 0x202072657475726e, 0x20617267735b305d, - 0x3b0a7d0a0a66756e, 0x6374696f6e20666f, 0x726d6174466f756e, 0x6428666f756e6429, 0x207b0a2020202069, - 0x662028666f756e64, 0x2e6c656e67746820, 0x3d3d3d2030290a20, 0x2020202020202072, 0x657475726e20224e, - 0x6f20746f6f6c2066, 0x6f756e642e223b0a, 0x20202020636f6e73, 0x7420776964746820, 0x3d204d6174682e6d, - 0x6178282e2e2e666f, 0x756e642e6d617028, 0x287b6e616d652c20, 0x76657273696f6e7d, 0x29203d3e206e616d, - 0x652e6c656e677468, 0x202b207665727369, 0x6f6e2e6c656e6774, 0x68202b203129293b, 0x0a20202020726574, - 0x75726e20666f756e, 0x642e6d617028287b, 0x6e616d652c207665, 0x7273696f6e2c2064, 0x6573637269707469, - 0x6f6e7d29203d3e20, 0x60247b6e616d657d, 0x40247b7665727369, 0x6f6e7d602e706164, 0x456e642877696474, - 0x68202b203229202b, 0x2064657363726970, 0x74696f6e292e6a6f, 0x696e28225c6e2229, 0x3b0a7d0a0a2f2f20, - 0x5468652077662073, 0x7562636f6d6d616e, 0x64732072756e6e69, 0x6e6720696e207468, 0x652062726f777365, - 0x723b20277766206c, 0x697374272c202777, 0x662072656d6f7665, 0x2720616e64202777, 0x662068656c702720, - 0x72756e20696e2043, 0x2b2b2e0a636f6e73, 0x7420737562636f6d, 0x6d616e6473203d20, 0x7b0a202020207365, - 0x617263683a206173, 0x796e632028617267, 0x732c207b62726964, 0x67652c207369676e, 0x616c7d29203d3e20, - 0x666f726d6174466f, 0x756e642861776169, 0x7420736561726368, 0x28617267732e6a6f, 0x696e28222022292c, - 0x207b627269646765, 0x2c207369676e616c, 0x7d29292c0a202020, 0x20696e7374616c6c, 0x3a206173796e6320, - 0x28617267732c207b, 0x6272696467652c20, 0x7369676e616c2c20, 0x77726974657d2920, 0x3d3e207b0a202020, - 0x2020202020636f6e, 0x737420746f6f6c20, 0x3d20617761697420, 0x696e7374616c6c28, 0x726571756972654f, - 0x6e65286172677329, 0x2c207b6272696467, 0x652c207369676e61, 0x6c2c2070726f6772, 0x6573733a20287374, - 0x657029203d3e2077, 0x7269746528737465, 0x70202b20225c6e22, 0x297d293b0a202020, 0x2020202020726574, - 0x75726e2060496e73, 0x74616c6c65642024, 0x7b746f6f6c2e6e61, 0x6d657d40247b746f, 0x6f6c2e7665727369, - 0x6f6e7d3a20247b74, 0x6f6f6c2e7469746c, 0x657d2e2054797065, 0x20277766206f7065, 0x6e20247b746f6f6c, - 0x2e6e616d657d272e, 0x603b0a202020207d, 0x2c0a202020206f70, 0x656e3a206173796e, 0x632028617267732c, - 0x207b627269646765, 0x7d29203d3e207b0a, 0x2020202020202020, 0x636f6e737420746f, 0x6f6c203d20617761, - 0x6974206f70656e28, 0x726571756972654f, 0x6e65286172677329, 0x2c20627269646765, 0x293b0a2020202020, - 0x2020207265747572, 0x6e20746f6f6c2e6f, 0x70656e6564203f20, 0x604f70656e656420, 0x247b746f6f6c2e74, - 0x69746c657d3a2024, 0x7b746f6f6c2e7572, 0x6c7d60203a206054, 0x68652062726f7773, 0x657220626c6f636b, - 0x656420746865206e, 0x65772077696e646f, 0x772e204f70656e20, 0x247b746f6f6c2e75, 0x726c7d603b0a2020, - 0x20207d2c0a7d3b0a, 0x0a6173796e632066, 0x756e6374696f6e20, 0x7766285b636f6d6d, 0x616e642c202e2e2e, - 0x617267735d2c2063, 0x6f6e746578742920, 0x7b0a202020207265, 0x7475726e204f626a, 0x6563742e6861734f, - 0x776e28737562636f, 0x6d6d616e64732c20, 0x636f6d6d616e6429, 0x203f20737562636f, 0x6d6d616e64735b63, - 0x6f6d6d616e645d28, 0x617267732c20636f, 0x6e7465787429203a, 0x20756e646566696e, 0x65643b0a7d0a0a2f, - 0x2f2f205465726d69, 0x6e616c2062726f77, 0x73657220636f6d6d, 0x616e647320287365, 0x65205465726d696e, - 0x616c3a3a65787465, 0x6e73696f6e292e0a, 0x6578706f72742063, 0x6f6e737420636f6d, 0x6d616e6473203d20, - 0x7b77667d3b0a0000 - }; -}; - -} // namespace webfront::fs::generated diff --git a/include/webfront/system/ToolStore.hpp b/include/webfront/system/ToolStore.hpp deleted file mode 100644 index e55e6338..00000000 --- a/include/webfront/system/ToolStore.hpp +++ /dev/null @@ -1,476 +0,0 @@ -/// @brief Installed web tools (the wf tool manager, #234): validation of the names and paths a -/// browser sends, the files of each tool under /.webfront/tools/, and the lock file -/// /webfront-tools.lock.json that records them. -#pragma once - -#include "../utils/Json.hpp" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace webfront::fs { - -/// One installed tool, as recorded in the lock file. -struct ToolRecord { - std::string name{}; - std::string version{}; - std::string integrity{}; - std::string entry{}; ///< Page opened by 'wf open', relative to the package root - std::string title{}; - - bool operator==(const ToolRecord&) const = default; -}; - -/// Part of a file sent by the browser: bytes to write at an offset of a '/'-separated path. -struct FileChunk { - std::string_view path{}; - std::uint64_t offset = 0; - std::span bytes{}; -}; - -namespace tools { - -namespace detail { - -inline constexpr std::string_view nameCharacters = "abcdefghijklmnopqrstuvwxyz0123456789-._~"; -inline constexpr std::string_view versionCharacters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.+-"; - -inline std::filesystem::path fromUtf8(std::string_view text) { - return std::filesystem::path(std::u8string(reinterpret_cast(text.data()), text.size())); -} - -inline bool consistsOf(std::string_view text, std::string_view allowed) { - return text.find_first_not_of(allowed) == std::string_view::npos; -} - -// Neither "." nor ".." can be a name part, since no part starts with '.'. -// The HTTP server rejects every URL containing "..", so a name or path containing it could be -// installed but never served. -inline bool hasDoubleDot(std::string_view text) { - return text.find("..") != std::string_view::npos; -} - -inline bool isNamePart(std::string_view part) { - if (part.empty() || hasDoubleDot(part)) - return false; - return std::string_view("._").find(part.front()) == std::string_view::npos && consistsOf(part, nameCharacters); -} - -inline bool isPackageName(std::string_view name) { - if (name.size() > 214) - return false; - if (!name.starts_with('@')) - return isNamePart(name); - const auto slash = name.find('/'); - if (slash == std::string_view::npos) - return false; - return isNamePart(name.substr(1, slash - 1)) && isNamePart(name.substr(slash + 1)); -} - -inline bool isVersion(std::string_view toolVersion) { - if (toolVersion.empty() || toolVersion.size() > 256) - return false; - if (hasDoubleDot(toolVersion)) - return false; - return std::isdigit(static_cast(toolVersion.front())) != 0 && consistsOf(toolVersion, versionCharacters); -} - -inline bool hasSafeCharacters(std::string_view path) { - using namespace std::string_view_literals; - if (path.size() > 4096 || hasDoubleDot(path)) - return false; - return path.find_first_of("\\:*?\"<>|\0"sv) == std::string_view::npos; -} - -// Titles and integrities are listed one tool per line, fields separated by tabs. -inline bool hasControlCharacters(std::string_view text) { - return std::ranges::any_of(text, [](char c) { - return static_cast(c) < 0x20 || c == 0x7F; - }); -} - -// Appends a component unless it is empty, "." or ".." (or "...", which no package needs). -inline bool appendComponent(std::filesystem::path& path, std::string_view component) { - if (component.find_first_not_of('.') == std::string_view::npos) - return false; - path /= fromUtf8(component); - return true; -} - -} // namespace detail - -/// Accepts an npm package name: lowercase URL-safe characters, an optional "@scope/" prefix, and no -/// part starting with '.' or '_'. Throws std::invalid_argument. -inline void validatePackageName(std::string_view name) { - if (!detail::isPackageName(name)) - throw std::invalid_argument("Invalid package name '" + std::string(name) + "'"); -} - -/// Accepts a semantic version: a digit followed by letters, digits, '.', '+' or '-'. Throws -/// std::invalid_argument. -inline void validateVersion(std::string_view toolVersion) { - if (!detail::isVersion(toolVersion)) - throw std::invalid_argument("Invalid package version '" + std::string(toolVersion) + "'"); -} - -/// Converts a '/'-separated path received from the browser into a relative path that stays inside -/// its directory. Rejects empty and absolute paths, empty, "." and ".." components, backslashes, -/// colons (drive letters and alternate streams), the other characters Windows forbids in file names -/// (*?"<>|) and NUL, on every platform, with std::invalid_argument. -inline std::filesystem::path safeRelativePath(std::string_view path) { - std::filesystem::path result; - bool safe = detail::hasSafeCharacters(path); - for (const auto part : std::views::split(path, '/')) - safe = safe && detail::appendComponent(result, std::string_view(part.begin(), part.end())); - if (!safe || result.empty()) - throw std::invalid_argument("Unsafe path '" + std::string(path) + "'"); - return result; -} - -namespace detail { - -// The string members of a lock file record, by JSON name. -inline constexpr std::array, 4> recordFields{ - { - {"version", &ToolRecord::version}, - {"integrity", &ToolRecord::integrity}, - {"entry", &ToolRecord::entry}, - {"title", &ToolRecord::title}, - } -}; - -// Bounds every webfront.pkg.list() line well below one bridge string. -inline constexpr std::size_t maxTextBytes = 1024; - -inline void validateRecord(const ToolRecord& record) { - validatePackageName(record.name); - validateVersion(record.version); - safeRelativePath(record.entry); - if (std::max(record.title.size(), record.integrity.size()) > maxTextBytes) - throw std::invalid_argument("Title or integrity of " + record.name + " longer than " + std::to_string(maxTextBytes) + " bytes"); - if (hasControlCharacters(record.title + record.integrity)) - throw std::invalid_argument("Control characters in the title or integrity of " + record.name); -} - -/// What the stores of one project directory share within the process. -struct ProjectState { - std::mutex mutex; - /// Staging subdirectory of each installation in progress, by exact "@". Numbered - /// rather than named after the key, so versions differing only by case never share a directory - /// on a case-insensitive volume. - std::map> pending; - std::uint64_t nextStaging = 0; -}; - -/// Returns the state of a project directory, the same for every store of that directory in the -/// process however its path is spelled, so their transactions are serialized. -inline std::shared_ptr projectState(const std::filesystem::path& project) { - static std::mutex registryMutex; - static std::map> registry; - std::error_code error; - auto key = std::filesystem::weakly_canonical(project, error); - if (error) - key = std::filesystem::absolute(project).lexically_normal(); - std::scoped_lock lock{registryMutex}; - std::erase_if(registry, [](const auto& entry) { - return entry.second.expired(); - }); - auto& entry = registry[key]; - auto state = entry.lock(); - if (!state) - entry = state = std::make_shared(); - return state; -} - -inline ToolRecord readRecord(json::Reader& reader, const std::string& name) { - ToolRecord record{.name = name}; - reader.object([&](const std::string& key) { - const auto field = std::ranges::find(recordFields, key, &std::pair::first); - if (field == recordFields.end()) - return reader.skipValue(); - record.*(field->second) = reader.string(); - }); - validateRecord(record); - return record; -} - -} // namespace detail - -using LockedTools = std::map>; - -/// Parses a lock file. Unknown members are ignored; every recorded name, version and entry is -/// validated, so a hand-edited lock file cannot point outside the tools directory. Throws -/// std::runtime_error on malformed JSON and std::invalid_argument on an invalid record. -inline LockedTools parseLock(std::string_view text) { - LockedTools tools; - json::Reader reader{text}; - reader.object([&](const std::string& key) { - if (key != "tools") - return reader.skipValue(); - reader.object([&](const std::string& name) { - tools.insert_or_assign(name, detail::readRecord(reader, name)); - }); - }); - reader.end(); - return tools; -} - -/// Writes a lock file's JSON, tools sorted by name. -inline std::string formatLock(const LockedTools& tools) { - std::string text = "{\n \"lockfileVersion\": 1,\n \"tools\": {"; - const char* separator = "\n"; - for (const auto& [name, record] : tools) { - text += separator; - text += " " + json::quote(name) + ": {"; - const char* fieldSeparator = "\n"; - for (const auto& [field, member] : detail::recordFields) { - text += fieldSeparator; - text += " " + json::quote(field) + ": " + json::quote(record.*member); - fieldSeparator = ",\n"; - } - text += "\n }"; - separator = ",\n"; - } - return text += tools.empty() ? "}\n}\n" : "\n }\n}\n"; -} - -} // namespace tools - -/// The tools installed in a project directory: -/// /.webfront/tools/@/ the files of each installed tool -/// /webfront-tools.lock.json name, version, integrity, entry and title of each -/// An installation is staged under .webfront/tools/.staging/ and replaces the installed version -/// only when committed; a reinstalled version is kept as @~backup (or ~backup if -/// an earlier backup could not be deleted) until the lock file is written. A failed or abandoned installation leaves the installed tool intact. -/// Thread-safe within a process, also between stores of the same project; several processes must -/// not install into the same project at the same time. Errors throw std::invalid_argument (invalid input) or -/// std::runtime_error / std::filesystem::filesystem_error (I/O). -class ToolStore { -public: - explicit ToolStore(std::filesystem::path projectDirectory) : project(std::move(projectDirectory)), state(tools::detail::projectState(project)) {} - - [[nodiscard]] const std::filesystem::path& projectDir() const { - return project; - } - [[nodiscard]] std::filesystem::path toolsDir() const { - return project / ".webfront" / "tools"; - } - [[nodiscard]] std::filesystem::path lockFile() const { - return project / "webfront-tools.lock.json"; - } - [[nodiscard]] std::filesystem::path installDir(std::string_view name, std::string_view toolVersion) const { - return toolsDir() / tools::detail::fromUtf8(std::string(name) + "@" + std::string(toolVersion)); - } - - /// The installed tools; an absent lock file means none. Throws std::runtime_error if the lock - /// file cannot be read or is malformed, so its tools are never dropped by mistake. - [[nodiscard]] tools::LockedTools installed() const { - return readLock(lockFile()); - } - - [[nodiscard]] std::optional find(std::string_view name) const { - auto tools = installed(); - if (auto found = tools.find(name); found != tools.end()) - return std::move(found->second); - return std::nullopt; - } - - /// Starts (or restarts) the installation of a version, discarding the files already staged for it. - void begin(std::string_view name, std::string_view toolVersion) { - tools::validatePackageName(name); - tools::validateVersion(toolVersion); - std::scoped_lock lock{state->mutex}; - // With no installation in progress, whatever is staged was abandoned by an earlier process. - if (state->pending.empty()) - std::filesystem::remove_all(stagingRoot()); - auto& staging = state->pending[key(name, toolVersion)]; - if (!staging.empty()) - std::filesystem::remove_all(stagingRoot() / staging); - staging = std::to_string(state->nextStaging++); - std::filesystem::remove_all(stagingRoot() / staging); - } - - /// Writes a chunk of a staged file. Offset 0 creates or truncates the file; any other offset must - /// equal the number of bytes already written, so a missing or repeated chunk is detected. - void write(std::string_view name, std::string_view toolVersion, const FileChunk& chunk) { - const auto relative = tools::safeRelativePath(chunk.path); - std::scoped_lock lock{state->mutex}; - const auto target = stagingDir(name, toolVersion) / relative; - if (chunk.offset != 0) - requireWritten(target, chunk); - std::filesystem::create_directories(target.parent_path()); - std::ofstream file(target, std::ios::binary | (chunk.offset == 0 ? std::ios::trunc : std::ios::app)); - file.write(reinterpret_cast(chunk.bytes.data()), static_cast(chunk.bytes.size())); - if (!file.flush()) - throw std::runtime_error("Cannot write '" + std::string(chunk.path) + "'"); - } - - /// Installs the staged files as record.version, replacing any installed version of the tool, and - /// records it in the lock file. The entry page must have been written. - void commit(const ToolRecord& record) { - tools::detail::validateRecord(record); - std::scoped_lock lock{state->mutex}; - const auto staged = stagingDir(record.name, record.version); - if (!std::filesystem::is_regular_file(staged / tools::safeRelativePath(record.entry))) - throw std::invalid_argument("Entry page '" + record.entry + "' of " + record.name + " was not written"); - - auto locked = readLock(lockFile()); - std::optional replaced; - if (const auto previous = locked.find(record.name); previous != locked.end() && previous->second.version != record.version) - replaced = installDir(record.name, previous->second.version); - locked.insert_or_assign(record.name, record); - installStaged(record, locked); - state->pending.erase(key(record.name, record.version)); - if (replaced) - removeReplaced(*replaced, installDir(record.name, record.version)); - } - - /// Uninstalls a tool. Returns false if it is not installed. - bool remove(std::string_view name) { - tools::validatePackageName(name); - std::scoped_lock lock{state->mutex}; - auto tools = readLock(lockFile()); - const auto found = tools.find(name); - if (found == tools.end()) - return false; - const auto directory = installDir(name, found->second.version); - tools.erase(found); - writeLock(tools); - removeLeftover(directory); - return true; - } - - static tools::LockedTools readLock(const std::filesystem::path& file) { - if (!std::filesystem::exists(file)) - return {}; - std::ifstream stream(file, std::ios::binary); - if (!stream.is_open()) - throw std::runtime_error("Cannot read " + file.filename().string()); - std::ostringstream content; - content << stream.rdbuf(); - try { - return tools::parseLock(content.view()); - } catch (const std::exception& error) { - throw std::runtime_error("Malformed " + file.filename().string() + ": " + error.what()); - } - } - -private: - std::filesystem::path project; - std::shared_ptr state; - - static std::string key(std::string_view name, std::string_view toolVersion) { - return std::string(name) + "@" + std::string(toolVersion); - } - - [[nodiscard]] std::filesystem::path stagingRoot() const { - return toolsDir() / ".staging"; - } - - // Requires the installation to be in progress; called with the mutex held. - [[nodiscard]] std::filesystem::path stagingDir(std::string_view name, std::string_view toolVersion) const { - const auto found = state->pending.find(key(name, toolVersion)); - if (found == state->pending.end()) - throw std::invalid_argument("No installation of " + key(name, toolVersion) + " in progress"); - return stagingRoot() / found->second; - } - - static void requireWritten(const std::filesystem::path& target, const FileChunk& chunk) { - std::error_code error; - const auto written = std::filesystem::file_size(target, error); - if (error || written != chunk.offset) - throw std::invalid_argument("Chunk of '" + std::string(chunk.path) + "' at offset " + std::to_string(chunk.offset) - + " does not follow the bytes already written"); - } - - // Moves the staged files into place and writes the lock file. A directory already installed for - // this version is kept aside until the lock file is written, and restored if anything fails. - void installStaged(const ToolRecord& record, const tools::LockedTools& locked) const { - const auto target = installDir(record.name, record.version); - const auto backup = unusedBackup(target); - const bool replacing = std::filesystem::exists(target); - if (replacing) { - std::filesystem::rename(target, backup); - } - try { - std::filesystem::create_directories(target.parent_path()); - std::filesystem::rename(stagingDir(record.name, record.version), target); - writeLock(locked); - } catch (...) { - restore(target, backup, replacing); - throw; - } - removeLeftover(backup); - } - - // Next to the target, so renaming does not need write access to the directory itself; '~' cannot - // appear in a version, so no installed version has this name. A backup an earlier operation left - // behind (see removeLeftover) is deleted if possible, otherwise skipped, so it never blocks a - // later reinstallation. - static std::filesystem::path unusedBackup(const std::filesystem::path& target) { - for (std::size_t index = 1;; ++index) { - auto backup = target; - backup += index == 1 ? std::string("~backup") : "~backup" + std::to_string(index); - removeLeftover(backup); - if (!std::filesystem::exists(std::filesystem::symlink_status(backup))) - return backup; - } - } - - // Once the lock file is written the operation has succeeded: a directory that cannot be deleted - // is left behind rather than reported as a failure of an operation that took effect. - static void removeLeftover(const std::filesystem::path& directory) { - std::error_code ignored; - std::filesystem::remove_all(directory, ignored); - } - - // On a case-insensitive volume, versions differing only by case ("1.0.0-alpha" and - // "1.0.0-Alpha") name the same directory, which now holds the new version. - static void removeReplaced(const std::filesystem::path& replaced, const std::filesystem::path& installed) { - std::error_code error; - if (!std::filesystem::equivalent(replaced, installed, error)) - removeLeftover(replaced); - } - - static void restore(const std::filesystem::path& target, const std::filesystem::path& backup, bool replacing) { - std::error_code ignored; - std::filesystem::remove_all(target, ignored); - if (replacing) - std::filesystem::rename(backup, target, ignored); - } - - // Written next to the lock file, then renamed over it, so a reader never sees a partial file. - void writeLock(const tools::LockedTools& tools) const { - const auto file = lockFile(); - auto temporary = file; - temporary += ".tmp"; - { - std::ofstream stream(temporary, std::ios::binary | std::ios::trunc); - stream << tools::formatLock(tools); - if (!stream.flush()) - throw std::runtime_error("Cannot write " + temporary.string()); - } - std::filesystem::rename(temporary, file); - } -}; - -} // namespace webfront::fs diff --git a/include/webfront/system/XtermCssData.hpp b/include/webfront/system/XtermCssData.hpp deleted file mode 100644 index a8a06525..00000000 --- a/include/webfront/system/XtermCssData.hpp +++ /dev/null @@ -1,81 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -namespace webfront::fs::generated { - -struct XtermCssData { - static constexpr std::string_view encoding{"gzip"}; - static constexpr std::size_t dataSize{2547}; - static constexpr std::array data{ - 0x1f8b080000000000, 0x0203ad58e9522347, 0x12fe0d4f913b8e8d, 0x8509b50433b6d7d6, 0x4438560362e85d90, - 0x0849783c3f4bdd25, 0xa9a00fb9ba5bc038, 0xfceefb651dad9b81, 0x5d33671d79677e99, 0xd5adb76f0fe92d9d, - 0xe5f327ada6b3928e, 0xa2637a7772fa3d8d, 0x66921e4ba9d3e65d, 0x41a22a67b92e9ad4, 0x491232170bd2b290, - 0x7a21e3e64e06ef02, 0xfcf5be416733ad8a, 0x329fcfa4a67fcbc9, 0x44cb273aba0e4774, 0xa5229915f298a967, - 0x65392fdaadd65495, 0xb36adc8cf2b415cd, 0xeeee5a4e3c5ff957, 0x62ef1368b1e6ad1b, 0x9caaa2507946aa20, - 0x0890e3279a6a9195, 0x326e102449ca2714, 0xcd849eca06953989, 0xec89e6521720c8c7, 0xa55099caa6242882, - 0xeecc0f97cb193815, 0xf9a47c105ae27e4c, 0xa228f24809b0a438, 0x8faa5466a52859e4, 0x4425b2a0a3126e7a, - 0x3374146f8e8d9c58, 0x8a8419aa0c0c25f9, 0x537a80797955b2e7, 0x4aad2266d3c0a528, 0xa962d6c41f272a55, - 0x4e08935b77333fb0, 0xae0a98c20a3728cd, 0x6335e17fa5b16f5e, 0x8d1355cc1a14c3df, 0x5a8dab129b056f1a, - 0xbf35d89a56aea990, 0x89510e4c140c3046, 0x2f7534d75810fc04, 0x2d9cbb0ade7998e5, 0xe9ba3dca6835a974, - 0x06c170109b9ec37d, 0x46ee9d8c4ade618a, 0x499e24f903db18e5, 0x59acd8b4a2eda2c8, 0x7926c6f9421ab36c, - 0x0e657909adad2a1c, 0x11a38c8db43b2a66, 0x029938860ec67d10, 0xae32e6c6bbde32d8, 0x5a8d8b12f9a04442, - 0xf35c1bb99b1673fa, 0x1a3d2ebb34ec5f8c, 0x3e77065d0a877433, 0xe8ff1a9e77cfe94d, 0x6788f59b067d0e47, - 0x97fddb11e1c6a0d3, 0x1b7da1fe05757a5f, 0xe83f61efbc41dddf, 0x6e06dde190fa03e6, 0x165edf5c855d6c87, - 0xbdb3abdbf3b0f789, 0x3e82b4d747e28748, 0x61f01df58d4cc72d, 0xec82f482aebb83b3, 0x4b2c3b1fc3ab70f4, - 0xa5c1bc2ec2518f39, 0x5ff407d4a19bce60, 0x149edd5e75067473, 0x3bb8e90fbb50e21c, 0x9c7b61ef620041dd, - 0xeb6e6fd48460ec51, 0xf7572c6878d9b9ba, 0x6269ccae730b3306, 0xac289df56fbe0cc2, 0x4f9723baec5f9d77, - 0xb1f9b10bfd3a1faf, 0xba561aac3bbbea84, 0xd70d3aef5c773eb1, 0x8e03ea839131926f, 0x5a35e9f365977759, - 0x6a07bfcf4661bfc7, 0xf69cf57ba301960d, 0x983b18d5d49fc361, 0xb7419d413864cf5c, 0x0cfad7c652f62e88, - 0x700b7c40daeb5a46, 0xecf9f500e10aaf6f, 0x61bde749e7ddce15, 0xd8215abdcd80fa20, 0xf7915f2a43923c21, - 0x27f53dd266a291d5, 0x475c7a262b2cd0fd, 0x6335e58e395389e8, 0x428c51b4923ea280, 0x848e71e74e2c4411, - 0x69352f69519e9e9c, 0x304fba2b1295558f, 0x8e88910dc036b634, 0xcd5c4f5bee42cb5e, 0xd802ced34d41f61e, - 0x9749eeb407c0146a, 0x9a01475280185099, 0x0f192bcda12a51e2, 0x13275e1428129991, 0x0494675c26a84857, - 0x3216dde96c18a262, 0xc011a59fe6d9d412, 0xe67086a689146505, 0xb462f7b50e0f5db3, 0xa073391155525251, - 0x3e3106b2d5be53d8, 0x8b4dcbfa8f4370a2, 0xa80284e836147c2c, 0x3f989d795e180c68, 0xc3820440b790761f, - 0xe0a603280fe468a3, 0xd033b71da445b0ef, 0xe8418eef55b9ebf8, 0x4faf467302dc2e1a, 0x6ed5362ba71ad016, - 0xb1905b2464ff0966, 0x32610074b7976a8b, 0x7191270058ab04ba, 0x5b9b4eecff8d8bf8, 0xc702dbd740c1eb8f, - 0x1e733cbfb42a4a06, 0xaf19020f37973361, 0xa13e1219320a2e45, 0xe7c875cc11c8b5e7, 0x175e770d0e8bf95c, - 0x0a4ddc1df2392263, 0x4e914df871e2daf4, 0xc35e63020e03604f, 0x78a344cccda73660, 0x6ce4d6cb14cd53c1, - 0xe2da3cba66a8ae99, 0x70bf72c6a11238d3, 0x3ce443c5444e4af4, 0x02de10e8056ca0c9, 0x056ed7c0715aa842, - 0x8d13e9b5dfe7df7c, 0x2e22553ed54a30db, 0x36053fe347a6db21, 0x78507139ab5733c9, 0xc5552f6b0f057091, - 0x0b18dd68b9405fa7, 0x070ddf7297322a4b, 0xf6b8f33626a02997, 0x9ab5a2b6de5b956b, 0xcdddce1be00d7a98, - 0xa9520605d43729c6, 0xec9d450ba927e888, 0x6d64401ccbcceea2, 0xd0d4d75dc98879c8, 0xb30e164a3eb8d021, - 0x18a3fe79bf0d0ca9, 0xcf973a4ce1e05416, 0x056abe9ac3a2543e, 0xf088e4751b8be87e, 0xaaf32a8bdbf4ddc9, - 0x89734f94275caadf, 0x5d5c5cd80d0c13f3, 0x44c0f7cb9adb17a6, 0xbdd6d63e3f7dd6aa, 0xa6c04484dcb2c6d5, - 0x82c7491eddef4867, 0x26e19ebe74463fa3, 0xfe907eb323037e6b, 0xf97ba5b4190d96d5, 0xe4531513097c8065, - 0x5d50938adb0292ed, 0xf76a879702ef9ada, 0x573e880194b40c9d, 0x0f1ddec516259f77, 0x9a81fe8dcc768bd5, - 0x9c1ee76599a766b9, 0xe50857779b18b584, 0xd67d14166dbe016e, 0x3b55aa39063c5d07, 0xa91405da4400fce5, - 0xf97833822a63900d, 0x5c20f9c814be4a4c, 0x51af56c04b107647, 0xf51bf6bed0b35ca7, 0x02a158e2bfcc0450, - 0x2648737489c054ba, 0x371a49f379064f98, 0x2372473cd95a9298, 0x8ee4b449655a3d62, 0xb0679040ba397ce3, - 0xb932467786ce0a0f, 0x0eeda1cd25ce5612, 0x2cd5718e33170247, 0xedbb938fd0fae946, 0x2375bbab3c919c55, - 0x9ab90e681bded2c4, 0x3373c8833f0e191a, 0xf072a833dc334502, 0x1718aad52a5baf8d, 0x882200898f1890fb, - 0xa819cb71353dde54, 0x9bf1464c7d09bf2a, 0xa536b27cbb369628, 0xb28e55251e7c001d, 0x8dd8f92432ee7191, - 0xdedbdbd78c0a4a54, 0xc4aa65f4b6dd5e3a, 0x8cedd925ee054c0d, 0xed24cfca60225295, 0x20e13164e5062559, - 0xddb5c1c54f486b48, 0x3ad72fd39e7e41c5, 0x2d8c38a323b02e0d, 0xecc4d8362e379c6d, 0x6f9c6064c24b0c23, - 0xe1ba1109f022d072, 0xea6dfe560c4d15ce, 0x1fd7faeea95ffb82, 0xac37b6bbde124762, 0xe5c74524ec391605, - 0x9ec2496cc604e033, 0x801975b744633755, 0x6024b6b3819f4160, 0xb4b4376cbcb80d30, 0xb99218a3ed18251f, - 0xb1040d58baf7f954, 0x66529b177e94e0b9, 0x6f9e9dfc71c3d4fa, 0xa9f9b0e0aba51e45, 0x4ee96f0aed4bf3eb, - 0x72d50e4896dae0d1, 0x29fd61021ac412f3, 0x8179ceb7a93efe40, 0x7f6e93bcdb4512e7, 0x78c3cb6f50bedf45, - 0xf920164fdfa0fb7e, 0xb7c4929df13ce50f, 0x3b2985f90eb046e9, 0x4939fabce7c2bc45, 0xebcf57bde9f75ee6, - 0xdc5ac22ecdf7b2da, 0xe9f49ad533dedfcb, 0x7167306a8e7ba3b2, 0x97dfce20ad68b837, 0x5a7b39ee0cde92e3, - 0x3351e44f4bf7b29c, 0xa1c6a6b37da13432, 0xdc9dd570bab9c397, 0x7c4d61b008e3353a, 0xddd619641cd4d0ff, - 0xe387c3835d88f4ff, 0x89d8be8ca6146074, 0x319d7729fd9f6b80, 0xb5bccd8ee36934d0, 0x555237eb9aeaa797, - 0x8f36eb0def1b7d6c, 0x43df4db1eff63fb5, 0xc182dff278c66bac, 0xdd279045d11ae3e9, 0xd91aebfc013da955, - 0xa9961d6a3124b752, 0x192bb15c3723a0a4, 0xfd20b0fc448c9103, 0xcd5b7d7539d08753, 0xb4f25f19f0b1c4cd, - 0x47e69b01136f8da4, 0xe06de6343f45fe42, 0xcd5ae2c604b43a55, 0x41878e66a55fcfd4, 0x2ef8257cb0355b1d, - 0x989e6d1f64a76861, 0xbbf1fe7949fe7d0b, 0xfecbc6f1e1f0f000, 0x3a7fac7b1971da10, 0x9ee11c0a7828ecfe, - 0x4c817997f04753f4, 0x2415dde3ab65864a, 0x4f910476743b5879, 0xbfe9e9581c9d34cc, 0xaf63666ffabf0bbb, - 0x6f90f83c9516a632, 0x055b070d427cc3d6, 0x30927be75cca7b4c, 0xe5785a32efe5a865, 0x5e6c2f315565bb8c, - 0x4526a35e77a7f1ab, 0xb83627027683f52e, 0xd37e5a33cda6c4b0, 0xe687f1d70c3ab097, 0x5bfa70266278f5a5, - 0xb9626f43f0aefa3d, 0xd8781dbfcc28cbb3, 0x696b76c9c23d8f0e, 0x3c201cd811eb3d4f, 0x4f077e96b22b3f69, - 0x9d9cfc1dab71fe18, 0x589e6d5a087d1404, 0x8b823fe839f14874, 0x77dc308fd7633aa1, 0x1f91cffc27e0bff0, - 0x59439a9c7e85f2ac, 0xdb7eedad96f5985f, 0x6bef1476eadb5baf, 0xd69e55b616fccfda, 0x1b788776680a9a3b, - 0xc20bc2b06ac65a10, 0xcce2b5d26bfffd65, 0xd6ff176f2b2d08c8, 0x1b00000000000000 - }; -}; - -} // namespace webfront::fs::generated diff --git a/include/webfront/system/XtermFitAddonData.hpp b/include/webfront/system/XtermFitAddonData.hpp deleted file mode 100644 index 697e50d8..00000000 --- a/include/webfront/system/XtermFitAddonData.hpp +++ /dev/null @@ -1,38 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -namespace webfront::fs::generated { - -struct XtermFitAddonData { - static constexpr std::string_view encoding{"gzip"}; - static constexpr std::size_t dataSize{807}; - static constexpr std::array data{ - 0x1f8b080000000000, 0x0203b5545d73d33a, 0x107defafd87267b8, 0x76af2327b97d4a46, 0xc3e5169881a1c050, - 0xe035a3daeb5a41b6, 0x3cd2e68b24ff9d95, 0x4dd3625a280fe425, 0xd6ea9cb3677725a5, 0x272747700267b6d9, - 0x387d551244590ce3, 0xe1e874301e8e4fe1, 0x4389b0267495987b, 0x500b2aadf3029e1a, 0x032dda83438f6e89, - 0xb9082aff199d61ed, 0x11ce5f7ee0f59dc2, 0x63161efd9bc059e9, 0xb427db94e8e01516, 0x85c30d44cc83d79d, - 0x467c8fe05b56d3b5, 0x32660385759f3187, 0xc2d90aa295a61288, 0xed762efff6d0b06d, 0xedbdb6753c094c80, - 0x17ead2b120fc8fc6, 0x28973366ae96ca67, 0x4e37044b1a0d8741, 0x13e6dee87ab1fe46, 0x2a899a499a5e761c, - 0x61dd55fa0d907680, 0x1f4a1cf513312e3d, 0x4a4f067ff2d77af9, 0xdecab9ce9cf5b620, 0x8ebbc63a45dc8bfb, - 0xa777ddf91c1675ce, 0x5309cdbc35100117, 0x888705ad0974dd62, 0x1a67e79811386ba9, 0xeddff5d074cdabaa, - 0xcbca09fe64f5dcdf, 0xa57250ca713293a3, 0xc4cacc28efb72a23, 0xbd548411c65b2ab5, 0x17b37096c3f191b8, - 0xcfb56facc728deee, 0x0b4dfc679000658b, 0xe39ac2de335d7125, 0xecdf47f15417d131, 0xee76c7df0bed76da, - 0xbf516f221499353e, 0xbe593abbf271ec90, 0x16ae9e0669eaa40f, 0x4c31cbacc369d48b, 0x06deb1949dc06ed7, - 0xdb0d49dadd36dbe3, 0xc7118999c330af0b, 0x9e24375e6406958b, 0xe2a42f8b5e7fe146, 0xb4c4e4dadefe8e42, - 0xb7a1d07e91bd8040, 0x83cca07b3744a3d8, 0x163def56bf6e43bf, 0x8afc6028f49d44e6, 0xbdc8f8368995cea9, - 0x94520eb93537d112, 0xc3810ee1dba97c3f, 0x956dc261f482afbc, 0x35e652659f03e5c9, 0x70720fce2e831d5c, - 0xbd5f18744fbadcbb, 0xdde8347172a5ebdc, 0xaec415d299ad9a05, 0x617e411b83fd69de, 0xdd8ec4480e787c59, - 0x53e482c63b1e033a, 0xda7c526681d1a3ae, 0x9c47719c2879aea8, 0x14955a47c3e4a79c, 0xd61c53e244ffa6b9, - 0x38a9e5969fe2c941, 0x5fdfa1dfa83cd7f5, 0xd58081c1d8a525b2, 0xd5c3281d36b0da77, 0xe761a4161a38068b, - 0x0752029219fba492, 0xb5609fffd4a24b9d, 0xe41c680539145049, 0x26cda04a1aa906f9, 0xc04fbb33b30d5763, - 0x72e87799b49f85b1, 0xd6454dda3f83a11a, 0xbe4337f8d96d7c76, 0x1bdf8d938dedf753, 0x5cf34b4c5b0bcac3, - 0x0b4d4ff3dcd6fbe9, 0x519afe05de2e5c86, 0xe7aa69b8988fef5f, 0x4b2ecbd6037e9c44, 0x35f79ca339fa0ab7, - 0x9f71d2af07000000 - }; -}; - -} // namespace webfront::fs::generated diff --git a/include/webfront/system/XtermModuleData.hpp b/include/webfront/system/XtermModuleData.hpp deleted file mode 100644 index d8fccbab..00000000 --- a/include/webfront/system/XtermModuleData.hpp +++ /dev/null @@ -1,2315 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -namespace webfront::fs::generated { - -struct XtermModuleData { - static constexpr std::string_view encoding{"gzip"}; - static constexpr std::size_t dataSize{91908}; - static constexpr std::array data{ - 0x1f8b080000000000, 0x0203d4bd6b5fdb48, 0xf22ffe7c5e85e37f, 0x0e3f3b08e30b1030, 0x283edc92b0c36dc1, - 0x49266158226c8135, 0x18c923c95c06bcaf, 0xfdffadeaab649964, 0xf69c7d70763f13ac, 0xbe56575757575755, - 0x572fbe79f34be94d, 0x693b1a3dc6c1f520, 0x2d557ad552b3de58, 0x5a68d69b4ba5eec0, 0x2f3da47e7c5bfb23, - 0x2979e37410c549ad, 0xb4391c96b874528a, 0xfdc48feffc7e8d5a, 0xf9dfc3a0e787895f, 0x3ad8ebe2bbb0e126, - 0x1a6eb49cd2f6200e, 0x92341a0dfcb8f40f, 0xffea2af61f4b15d4, 0x2bed8b36aa331a3c, 0x426b41e80d878fa5, - 0xab28bef1fba5ab38, 0xba2d55ee8374504a, 0x01ae80f27f92d208, 0x600749124461b54d, 0x354ba5f7de658c06, - 0x4b5bfe70e8c57d94, 0xf9c3bbf3925e1c8c, 0xd2d25ddaa8d7a9cd, 0xd21fc93008c70fb2, 0xd2204d47edc5c54b, - 0x51a716c5d78bb2c0, 0xa2283035c446be23, 0x945bfc65f1cdc27f, 0xf37f0c4b169483a0, 0x1747497495223d1e, - 0x45b1970217b3674f, 0x61be5f1a877dcc0a, 0x21d39a905ae9d4f7, 0xf547fa90968290cb, 0x8ce2e80fbf9796e2, - 0x284a197f6ad28210, 0x5fb7a25774f0df1c, 0x3df07be7c5a5bf12, 0xf7e89280a9f5fdab, 0x20f48fe30854903e, - 0xae53e6c950655efb, 0xe9d17da832777c41, 0x0151ccc5f6876e25, 0x71d2aafbee09e057, 0x288986524aab7f25, - 0xc8f09d27546fa767, 0xfeb9e387e35b3ff6, 0x2e877efb557d529d, 0x70fd03ae8e7281dd, 0x44ec06ef1a9dbb28, - 0xe897eaeda07332ac, 0xa048b59d3aa19bd4, 0x867e789d0e161a4e, 0xb41ebe73ebebe1c2, 0x42b512b9c959785e, - 0x9d9babc46e25e844, 0x54c189abeda81257, 0xabcfcf71753df6d3, 0x711c9682b9b9786e, 0x0ec089024e3c714e, - 0xd5102a028c94fe3a, 0x499501fc90b8e52e, 0xad0dac220c6c344e, 0xcbce6de0f2b02a28, 0xfc217112fc4ce897, - 0x9b4c9cd7543e8a4a, 0xb7e3dea0148d5354, 0x28a551c90bc3681c, 0xf67ca7147a77c1b5, 0x97fa941a47f749e9, - 0xd60bc7bc4229c1f7, 0xfa65e7c26affb56e, 0x1f2d2793f52bb442, 0x3402c2ac24d52739, 0xaaa416fba3a1d7f3, - 0x2b8bbfc79ddfc3c5, 0x6ba7fc7b5cae4e74, 0xf11b14c7205585b4, 0x53fefda1b175d6ac, 0xd7ff5d9e4fe6d557, - 0xe3dfe576626a7da6, 0x4944ada4d61b06a3, 0xcb08cb73c74bbdb9, 0xb95c420d30d2df4a, 0x39f51fd245801284, - 0x652745f210248496, 0xba48ae3a496d14fb, 0x777e98eef857de78, 0x98562c00ffe4ae98, 0x129e82ab4a52237e, - 0x4754e7015b2850a1, 0xea994eab4f431f0b, 0x0924918505a89b82, 0xa5babe1d5662d9fe, 0xc4f48a54dd6be232, - 0x4e9dc46564f95816, 0xbde338b8c3641d44, 0x7d3fa95dc65eefc6, 0x4ffdfeb19788b4b9, 0xb9a0167bf747236a, - 0x2ca905d76114fb5b, 0x53c55eb9eeab7a15, 0x2da66025d77e4ce0, 0xed121ed00d65a4b5, 0x3b6f38f6dd72d940, - 0x76202113a30c5c9f, 0xc6b50522ea07e1f5, 0xf63040ed13e01668, 0x911840c26f0b0196, 0xc755bad0a8f35211, - 0xa95f910a5c22711d, 0x33923e0efdda7dd0, 0x4f076eb9591f3df0, 0x3471e2c0273e974f, 0xa5f6dcefaf9fe2c9, - 0xe8e1bb4e457b9418, 0x6612ffda032b7c70, 0xcbd81aead4c055d4, 0x1b27f61c1f6b6c63, 0xe93de9113a5891c0, - 0x23f58e81f56e4e99, 0x6a682a1462822c25, 0x69cab21bdff6ed05, 0xf16e6579b9b5dca9, 0x240b2efd5a714e81, - 0xfbf0ba46fbdff6c0, 0x8bb7312d954af2ee, 0x5da35e9d5f5e6eae, 0xad54e78b8a24ffab, 0x81ad7d7e79a5d5ac, - 0x57abedc22216107b, 0x34a5a95b777ccda9, 0xd40496cbebc4df04, 0xcda6ebf186bf3e3f, 0x0f34500226eb2c3e, - 0x073f9350870aea60, 0xde2d043cfc21e061, 0x16f0190d85d58962, 0x8c1366deb1db1b7a, 0x49f2d4033da7f1b8, - 0x07465fa93ea58320, 0xa95d0421849be0d6, 0xad4f7a43df2b4ac7, 0x8aa1562db24d2516, 0xd6b1a65f0555d959, - 0x7d5da081c8b44e59, 0x998644dd08757b12, 0xcecdb412cecf57d7, 0x79341b6e3437176d, 0xb8cb6f5b4bad8e7f, - 0x16cfcf9fbbd91616, 0x0462de300aa205ae, 0x36cf186d5764854c, 0x7947264620b9dc90, 0xd49c456eb81e6d04, - 0x98b348c037ccc217, 0x55691cdcef863b9c, 0x9b1b02c09556638d, 0xb9192abd73f5e8b3, 0x5d0c9d98b1e14db5, - 0x27470b76ebe5473b, 0xcc8cd02b1ce1508d, 0xcaabae633a534861, 0xfe64085eb4b2dc7c, 0xbb86ad5295d33410, - 0x4f264efa02052890, 0x43ffbef4091fab9b, 0x71ec3d565ad52c41, 0xc862b5ab6038acd4, 0xabff095538913374, - 0x3c678cdf038b4264, 0xcb67f573d1d285fb, 0xaae18cc45c9abcf5, 0xd19c5b19cd359b4b, 0x55d7751b6bcd4eab, - 0xd1a684a53a2520bd, 0xd3586ebfe5de30c5, 0xce152fccf5ca55b6, 0xa1f9f9dbf3b99516, 0x848adb8da5f5ea68, - 0x63c35d7146cfee15, 0x57dc942467bab53b, 0x6cb6a7734defadf6, 0x9273e26e2edc8a8e, 0x071b27eb4c26038b, - 0x4878d080e86c8039, 0x722a577368b68ac9, 0x6b3457ab4f838505, 0x0763afaf5f4262b8, 0x99f843089099fe6e, - 0x6962af1c03330632, 0xb9787eae6c12089d, 0xd1069ae9a095b6a4, 0x81519b325ac868d6, 0x97569f9f47ef5c26, - 0xb0b9b991243da4a1, 0x04930e9a51d5aaed, 0xd106531d5569341a, 0x4bf8cfce96eb294f, 0x1184c09e1b2c2c39, - 0x7d772090d0c7daaa, 0xb204889fbdb9b957, 0x6072187d1f421d0d, 0x9913c012cefaf30d, 0x3b09ab10494d3b09, - 0x0b09492d99b45e95, 0xc0847a91ab1f6681, 0x38fd79778910ce5d, 0x12c243c290aebace, 0x18467e25b46699e7, - 0xac9f5fd866cad165, 0x4c8d0ab06916a3cc, 0x2cf61716ccc244b9, 0xb18be65b8deac6c6, 0xca73840973c60c44, - 0xb69c04692c265d82, 0xa449ebff36482f37, 0x9549691066b97131, 0x27d4f8f0c7e36d2c, 0x63bc8de63300c15a, - 0xa3a10fc5d005218e, 0x35218e35218e1521, 0x56556bebc5585965, 0xac0039ff2f61e5ef, 0x369e496912557377, - 0x62155077de8f27e1, 0x2dcdc1aa9e039a0e, 0x9a059e0e4f4c875c, 0xe563b5ca0b706f6d, 0x237c760a62127ae8, - 0xd73d64db92f8b9e3, 0x8bfda554b8c35c5d, 0x83dbf3af4bfd0b02, 0x9f0fc1b2cfdb4e9c, 0x4e921407821e8e4b, - 0xdbd1308a4f3e6c55, 0xf4b9e62c7d07c168, 0x65aeb9bcecd0cf55, 0xf18bfe3d57f558fe, 0x99aa594999472f33, - 0x35ae3ce3b3a13e57, 0x9f53e0953eb0cd45, 0xa10f58897fa50c4f, 0xa20e961077afc5fe, 0x71750df914e0cb61, - 0xe0438f20331e88e7, 0xdc9a934e82642fbc, 0xf3e384dab6a7feea, 0x7a6ee56da3bebaba, 0xb284325bd1b03f5d, - 0xa0d15a6a36debe6d, 0xaea2c427d24540dd, 0x926f67e025bbb2d7, 0xcd348d2194cfcd65, 0x61612d06d53c2551, - 0x1ec452ef34daaa8b, 0xe6caea526b796979, 0x858040a19b692840, 0x1cab6feb6b8da618, 0x4b900438e817005b, - 0x7fdb7abbd4586dd2, 0x78f6520fe27eaed0, 0x6566c83bc1ed74be, 0x3d62126a71d81ac4, 0xd1f87a30dd5fb3b1, - 0xf47669b5b5b24465, 0x719a4c7168f0f348, 0x449336f847988902, 0x1c52c7067a1cc6de, 0x5f3319d101af001f, - 0xf556ab41ddd2a96d, 0x6641ea59150c92f7, 0xd744928622734d11, 0x33b34a6f1594b6da, 0xcb957e7f7dec816a, - 0x53034161fb8d95b7, 0x402c160056404176, 0xabb5bcbcb4d4222c, 0x6dcd68300742bec1, 0x5cb6d5e0fb6bad15, - 0x7809c23af75d5c34, 0xd7381525720f2ec7, 0xa99fafa1668acac9, 0xc580354b95ccd4a2, 0x700255696f300dc9, - 0x53cfc346a346d7e6, 0x2f3598769e089797, 0xd7b980aa9d2f209b, 0x595e87228e8094f9, 0x0b8d89453e3960ec, - 0xb1fe3430a8f43230, 0x44e4b38199662379, 0x6a369c623cea4371, 0xa28a2bfeaef94d90, 0xecde8ed2c74ab5a3, - 0xaaba0baaf25bc178, 0x2eaf9f5dd31e10a1, 0xb99bc2873a16d81d, 0xcfcdfd7b0667e35a, 0x551b8733cafc0788, - 0x9dd5d2cbd89e556b, 0xc614884a3679aa1d, 0x773a630a5dc5dce7, 0x67d12666e947f812, 0xf396678df6bea437, - 0xdeff1c929f9c3a8b, 0xfd09b0347f9d8227, 0xcfc8fe9b30e5f9e1, 0xcfd4d114a7c7a121, 0x9e1a4b319bfbef8c, - 0xa56e00320a5d9bf0, 0x589628d89415287a, 0xede752664825ed46, 0x9bb9b36effb31707, 0x5e981e5d5d41ff9c, - 0xeb67ba8d4c69683a, 0xe2b4501215da3b9c, 0x19849a06ed2841f4, 0x621c0ff7fafa8b72, 0xa08ab4727c82ae84, - 0xf41c2c225b8c8daa, 0xcd2d2cadacbd5dc1, 0x0967ed9913b3e3dc, 0xd868ae08d452e109, 0xa0e53621ab5a1d73, - 0x57d97ac5bd2e4b55, 0x0477acfa5dadbe7b, 0xd75ce1a6736dd8bd, 0x80276b40e54091fa, 0xeca604a1692b0b8a, - 0x62ce1950a83129d6, 0xb5b2bd8ae2b95e95, 0x0498e9d434c0fdd1, 0xe00a472cdae76cdd, 0xac989f1cd2f2e423, - 0xa47a0b5badb7cbab, 0xf5b595d6ea12a16b, 0x4d8bfa1bf54efaaf, 0xa5e6dad2da0aa450, 0xf097ec90b2ed6687, - 0xa604cd461e9f6b56, 0x6ffa9c213be48386, 0x81cba639e2007227, 0xcda0223bab969023, 0x5141828e38a5fda9, - 0x56011119964c8223, 0x5aee68968c61fbab, 0xd46a352fbe86112f, 0x4c611ce3c6e80c88, 0x4fb5247ee2f4a6ea, - 0xdd5e0236b6d790d5, 0xc33e9a4105cae61b, 0xad2ccc1cb3c81290, 0xbecf96730220615b, 0x3699c3838470ae59, - 0x5f7bdb586e12017c, 0x21e3477131cc3217, 0xa1c6f3d24dae25b1, 0x9aed8188259b2dd6, 0xe8c02c51945e6d63, - 0xd8d4d3f4b66c8f65, 0xba175b473c9da98c, 0xa3309616744a649a, 0xc39d3e76fb38ff0a, 0xc2e2b913a87fd520, - 0x55828fb3b06cf95d, 0xb38ad4bad6875959, 0xa46a5126394eb600, 0xaddbca71587b62ad, 0x1c17d68f7cf98656, - 0x7e877373a1527e67, 0x48ae126754e0a1ad, 0x027ff67160c79a6a, 0xb60958a913d2bf32, 0xcd4c43aa2bafc356, - 0x3c8d62ae2110a5da, 0x9014a12bf226b899, 0x682c1bed84520f48, 0x31499299fe969469, 0xf29938cee542fd03, - 0xa6e57ef03ac522f4, 0x6185fe18f267df1f, 0xd1fa0a7b819f949d, 0xf7212f97036f642c, 0xc5bfc1b26a0c6367, - 0x1fc3f3e7e7b37363, 0xb30ad87086f9791f, 0x92a2001f4afd8404, 0x7485042687d45555, 0xd8400ed315a99914, - 0x47905400cd41ab4a, 0xc7f17be65abb710c, 0x0e52fedf7ba7709d, 0x80a7c3a177eb2f90, 0x3d00fe15707ee879, - 0x61290a61fbbef44b, 0x6372a6800d5ce6c2, 0x37a534f262948766, 0x0bf6db63760240af, 0x13a371b908fa6e82, - 0x31134f6043355429, 0xc6d8c8166fb239a4, 0x677f24e720cfb493, 0xd2e86ba37132a83c, 0x05fd76e20464b16c, - 0xfb932a3649ca73cf, 0xb2e99869ae9c56d9, 0x3cf6de05b2ca5be3, 0xab2b3f96232ac37c, 0x097f0524c36f04d6, - 0x5e0cc3e45cc37429, 0x734ce2b74424d2e4, 0xfba949c7ae4ee97b, 0xe0bcd83d02b67aeb, 0x5ca6805074b41f5d, - 0x9b5a1f39495aa04d, 0x72228a1e25bd7de8, 0x6b4cfa3f44e79fc2, 0x806c32267d4b40ba, 0x23903fd5f3bd9495, - 0xb29292b09b8b6de5, 0xd2460aec9b2235ca, 0xc0e5fa2a3903961b, 0x4ce0167317f47d4a, 0x64d70c6d289a6ebb, - 0x26be6ab4b9f12aa9, 0xc0decdfc0596a427, 0xbf22dc4694c3079b, 0x1a62f70c1a7dd958, 0x1624db7c4f9aad8f, - 0x5ed81ffab103731f, 0xc8f74f6708db33fa, 0xe842b97aebf7f799, 0xc6b1423d170e2863, 0xfa67404c5219097b, - 0xe09cbd8de17a0fc6, 0x4a0208da55178560, 0x960868696d0b8601, 0x77a32a2f1e58eb23, 0xafbf0dbfa74acf81, - 0xed312a54d445962c, 0xcb5b3e6b6da9ddea, 0xd3d8ed01967c09cb, 0x5a400c6f305500ab, 0xd4133c7c8c9f0460, - 0x05e3105c7a0025af, 0x4ceca19721754363, 0x93dacbdcdc1172e8, 0x93199d57eda0fd80, 0x5ae92b03dd13a839, - 0x4edb4f0fedf17cc3, 0x7984ac044fa03e7d, 0xf7e62baf06ba13a8, 0x1be10941f91358f4, 0xc4c6f32aecd4e01a, - 0x13dd1f46e1477896, 0x91022fea45c3a49a, 0xc68fdcbeb4459eec, 0xa3c3f5b332bb9f95, 0x1dfe9bb4cbe7d08b, - 0xf78663f86e546ee1, 0x7a222ac31da8820e, 0x6085ea79d0043cd1, 0xefc9083e42922f90, 0xd748bbefc45e78ed, - 0xb72f1c0fdc845c40, 0xda955be70a0e3961, 0x27aca9344a722eaa, 0xeda321673a8308aa, 0x4353b0c6df9d9a2c, - 0xe6c0467a67b5038e, 0x896f9d0d9728a2a5, 0x9f24820e48a068ea, 0xc1c8982c8940e1e8, 0xe2c3ff09db0796ef, - 0x41e5ecb45277de57, 0x9dd34ac3f9487f9a, 0xe012d573e73ead9a, 0xcd0243618f1f601f, 0x447415c4b795ef3b, - 0x51e9311a97eec195, 0x8841db1e4caf9fd2, 0x49e7975fbe6c9e1c, 0xee1d7e68c3053248, 0xe0d216de947ad178, - 0xd82f8da071255e46, 0xfe4de0f17d422a54, 0xb5c9772c00b1c2ef, 0xc16aa3fb1abccbe0, 0xe243934e1c05b31b, - 0x7012fc11c2f17028, 0xa76a420b063fc947, 0x6e10fbb08e0a0227, 0xa614915b8b074d20, 0x78a11fc2d1418071, - 0x890ae4f7e82525d1, 0x9e042c84fb1d0062, 0xbbb5df87a714f377, 0x6ce68a359f067f59, 0xecd1338c7c8bbcb6, - 0x6cf6bf232ae5583f, 0xb135a49ed0dc5885, 0xff29f8af7071b1d9, 0xac13c95d047d83be, 0xfcf81f11189c55f3, - 0x44340827d35bab9b, 0xa1dc123056ac0ee2, 0xa1a60a73ee2fe16c, 0x7bfe104ea5849384, 0xf8a33c36f80f23d6, - 0x91f3ce2db9a1d9f8, 0xc9170cdc30b8f5e1, 0xdb56210735b4449b, 0x3df900c1eda9e3c5, 0xa4daa3ba87511783, - 0xc4f61d3fa25a87d6, 0x295c04d2daad9f24, 0xdeb53ffffd975fbe, 0xcfcb6ad5b6111666, 0x9500e3c09a9d78fd, - 0xfebe04db586f844c, 0xa787235632c40109, 0x20b1add8bfc56ab4, 0xaa6271dc06e67866, 0x2a8399ef7a5011fa, - 0xa84be7612ccce9da, 0xf94ac9881c3985b8, 0x6852598c388296b2, 0xea603502739f0af1, 0xabdb9b817e3eb7ce, - 0xa89a3ff615159a44, 0x61aef60f7a2480c5, 0xe94da028db00f938, 0xc31df2271b023fdf, 0x1a329bfe121a3eb3, - 0x4f62e5d32139dc3d, 0x3f6f0d6bd310c2ad, 0x8ae8f713c4dc6d0f, 0xae93432c53539f6b, 0x6aa1169e992434f5, - 0xfce8aa7419745ed5, 0xdb99246e909c1643, 0x8893d86e3ee15491, 0x2832e36feeea3290, 0x47617510e67a8567, - 0xe14fa14410b7c8bf, 0x6473e0b61a483fb2, 0x81e42520c6f67d6f, 0x38f4afe151aac4e7, 0x36386932f96eaf83, - 0x72be0c981441e949, 0x071debc03e0d27ad, 0x5306544d24c309fe, 0xd5874adec272e6e8, 0xad2794f4ea36fe12, - 0x6d8fe683809f3d92, 0xfb1a937ae9c2d591, 0x572d52f8afe3ab7e, 0x0a99832661354145, 0x804e9c13adb0fba9, - 0x913f3f9737436865, 0x1459952ec7d7a5a8, 0xd71bc7e0f835f04e, 0xe9e08c65c98245fa, 0x38f269ad025deca9, - 0x2a9368ffd433fa5e, 0x1e2aa0230c721e7e, 0x38f542c60c84374b, 0xbc11c29b45f88d1d, 0x78e9a076358c905e, - 0x89e7c3ea6213da93, 0x4a72169d573bb11b, 0xcd37daa11b69db39, 0xec2c34cb3d35cbbd, 0xa9e1097ee691eb95, - 0x96b3e1bfdddf87bb, 0xe941848d0dff8d13, 0xfadaeb3f9007db54, 0x9e9ce35e5c430ff0, 0xea86c156a8acc439, - 0x503449aebaef65d5, 0x63602cc0c60bb95c, 0x89ba410984618142, 0x52e90b15b1ad430a, 0x4ef167fa74680063, - 0x7fb27689a708c206, 0x5a12b5e14e9df07e, 0x7d0f7727f6b6c7c1, 0xb18203a4ff277ca7, 0x218854a573bd7f17, - 0xa0195311d33c7901, 0x2a705641d098576b, 0x2c98e11fa055fb93, 0xff08fd3e845ea268, 0x08b8d29fddea076e, - 0xf120ae826920f997, 0xa8208ddc5e6ca8ef, 0x142775f22eb54ef3, 0xda1fbed2984fa12a, 0x60f7f9681dde2670, - 0xa757f51248e6aa8a, 0xb7519f0cb147ef63, 0xa57681463731eda7, 0x9972201dbbe051bc, 0x4bc806c919fe6697, - 0x7f278a7f80471af6, 0x076eda374503bb28, 0x6b1fa9f0a18f8b28, 0x7e4c5d1cc576cdc0, 0x19d6aeadef06be87, - 0x0a6288b7c35a38ab, 0x2aee1654e2e8f9d9, 0x7d9a58726d08566c, 0xfcdfb5a77f42eac3, 0x84a892319744ea2e, - 0x40b290f20c6c2a9e, 0xb39916aec300dd0a, 0x425262432e87c488, 0x0aae1454c9d31bc4, 0x18099f49a56d3e3b, - 0xcf5052a692106364, 0x4d526d0443645bfc, 0x92d6107456289ca9, 0x1cd0c8826a87161d, 0xee5aa0d75b6ff453, - 0xd520c0102e502389, 0x6ed916209607c8b1, 0x084ad4402b54c579, 0xe503449f79cdfb20, 0x4e58aee2bab32a32, - 0x84a81d38afa0ad64, 0xf778cda97e5899c1, 0x240f56b84a09ec98, 0xca07dec3166f2adc, 0x02d834d49545cdc4, - 0x68a612e0dc1765a9, 0x166dc7504054a97d, 0xd28062f9e29e88ec, 0x64b2be09771ed2b7, 0xf31e483a582c3410, - 0x1afb3b45eea6b53a, 0x7a92e4040ae566d3, 0xe38e2a74a80175da, 0xbc14bc57fa86133e, 0x49274a1ee138ac8a, - 0x9fa014a40a92c015, 0x06b5f732d90e23c7, 0x8b9c08cca2484723, 0xe9318d7ef51fb506, 0x0614a13585947236, - 0x8cce5d1c4ba0834c, 0x0728689cd505a307, 0xd7463508dfd43959, 0x51129c8ff2e61734, 0x5aa37412d20df198, - 0xde9196e59b5c011a, 0x1c9f75774882af30, 0x2a31e54d15545976, 0x733833436359549a, 0xd3b345df604f89a1, - 0x2605d86a70d89fd5, 0x2e4695f8b601f2ab, 0x8f813fec9f611b38, 0x9fdcf88f7953802a, 0x3679a37efd5c83a5, - 0x34e7394f45648ae1, 0x1f7ac6385b25d392, 0xa9f5709066e56bc0, 0xd8c298ce2a5ee49e, 0x3ede5e46e0a74cd9, - 0x51ec0c75521a09af, 0xffae770d12a99ecf, 0x1a88d0308f5ff0fd, 0xb608464c6f4e4947, 0xb0b2320e877810ad, - 0x30db809ec44eaa26, 0x3a05df85bd860909, 0x92959ad217daa255, 0xa8a69e4c3d4c6096, 0x3dcba60ce02383c5, - 0x994d06e690c7d49c, 0x2356abb05a67cfcf, 0x723cb634f82bdf60, 0xb1ab12bb69c00153, 0x56d3e766a1ee5362, - 0x343b6812634265d2, 0x75d00d1e6f341a3e, 0x626e8d898d381a29, 0x4e9ec8acce7a8ee2, 0x72aa33b85df2b5be, - 0x70bd7294ddfdf7f4, 0xacef016b906941a3, 0x7b90b223e6496593, 0x7696a32468cdcbaa, 0x9df2e4088c12e282, - 0xd8b8243fc355541f, 0x8c00ccc9160b0c95, 0xa192609746167813, 0x10406241ec213f01, 0x7dc24409c9593510, - 0x5b1013f49dbd36d5, 0x41d9fb1864684944, 0xa13db6e767ea8e4e, 0x32f0d8d6bd455444, 0x2dcf1b774fdbc8d6, - 0x6fe8fae00dae0f4a, 0x58ce6ece519f6ea8, 0x4131ef46a697a1e9, 0xe5157a994653a50a, 0x7984ccfeb53e0cb7, - 0xa04ea814095b6c99, 0x7587a625cf86f785, 0x667861d260682f85, 0xae563730aeec3937, 0x82e28e01bdbe9de2, - 0x13dfd92321fca612, 0xf9ce3114d092daf4, 0xf6f7aa41c8c6beee, 0x8e4d7b03d19e6ae7, 0xd86ae658db818e19, - 0x92907df5155a7b85, 0x15a91656ac40e831, 0xcd98105adc9ea9d9, 0x7f7908a2ae1e059a, 0x20d6d337f52f7ea2, - 0xfe1bbbfed5d08354, 0x30722f4c1b23b266, 0xdb7491a98b3ae080, 0x3820b89619ed96ba, 0x758ee5a9ce778f75, - 0xcf07b2672472b707, 0xbe5e93114d224e1b, 0x63a80371db43757f, 0x25dad2c42800b9d9, 0x0053abdccc9b64e7, - 0x18ae06c726a17dfc, 0x4efd4449abfefacd, 0xc6f1fa0d869b2165, 0xdcbc46bfb8dea22f, 0x8d52bfeee1f8f612, - 0x0694e3a3d3bdeede, 0xe7dd8bbdc3f77b87, 0x7bddaf0aa7904989, 0x0088c94a0a383b76, 0xf6ce79e1638c4574, - 0x6be1025372e06fdc, 0xe01f80235ac462f2, 0x256553cbc7b85a89, 0x6562da963c02a6ce, 0xf56321e1a0082f01, - 0x25e8a0d05341b76a, 0x2901cd131a30ed5b, 0xe08aeee6ba973c86, 0xd06aa8819fd0ba13, 0x0c00a3a37bd7debd, - 0x07d5964dbab2673d, 0x77500ae04a3c2c44, 0x3e94cb777ee58668, 0x89dbed0a21de3dc1, 0x51e32f88687cd460, - 0x65eb90d87f1faee1, 0x90ef9c813ac30ff2, 0x4a24a926bc03e7db, 0x09925194d0b5e844, 0xefaf74835527b365, - 0x25bb3f4dd59cdead, 0x201a3fc17c4aaa25, 0x862589c671cf17bf, 0xe135cd2c1727d536, 0xc06544e37275d07f, - 0x680fa0beed3fcccf, 0xe31e587147621317, 0xc27e4a175d4d660e, 0xc8a241ac432fc480, 0x1080f2278f5a6802, - 0xaa52d74b9ad26306, 0x7e6a1f2f6c35a889, 0xa1c201ebd68b6f36, 0xe1364e45e0406114, 0xb5f98168994156d1, - 0x28d1758aba024fd7, 0x0589c9a3cc096ef2, 0x4f03cb863186cdda, 0xf70379c10d273bae, 0x203c1a726dcce85a, - 0x5601dea10a37aa37, 0x311f7c919dcd9474, 0xf5b86f8d33735981, 0x847db99ec0fe6620, 0x460bc9e79277572a, - 0x674e708e3331642f, 0x9e315807898e489f, 0x330d3f24d30c96aa, 0x8afda219d10a0c6f, 0xd12deec5fbfb50e6, - 0x643bc7690a579715, 0x12d9f704fe26b862, 0x02e987d33c350e18, 0x5f5f1883926bf510, 0x7aeebbdecf400f93, - 0x5a167a82616c3c5c, 0x1443e4891c281917, 0x25e884cd9d08b625, 0xe6dd1d5bfdbfaaf4, 0xe41ccecd0df878a2, - 0xbe71d6845c6bf531, 0xa52183d127864304, 0xfeeb3de25277afd4, 0x0fe4584bf05d81a6, 0xf615f45cf65d4a5b, - 0x9682e2c5121f7a0e, 0x4cb3aca3ec299f1e, 0xec3a7d160c2a1738, 0x640851f002921f18, 0x16f050eee0b7db83, - 0x7b509bfec148c97f, 0xfa0243ac02a583e0, 0x8ac453810ec40160, 0x14b33524ad7cffe5, 0x7bd520068de12e87, - 0x0e5450f6d2122cb5, 0xe52a08c4cc112607, 0x498abcc795817356, 0x16fa5f67f15f397e, 0x53fabd527bf37bf5, - 0xf522b24caa580231, 0xba2b2e8c53f440c9, 0x781270e133338658, 0x2937318f7604d821, 0xe9f7d8250cea2cba, - 0x8d3ad8c0c4ca0bac, 0xb89d59854118c799, 0xb1d86e61631d546b, 0x7fc078c7e3073dc1, 0x6a9944316e3047b8, - 0x94f5ce23060b760c, 0xfc09f570b90c2703, 0x23c688be755b208e, 0xa7e1fc3c9715a0c0, 0xe3406c6196c78106, - 0x871c0fa4b57e7cd6, 0x3b5fefbbdf2b092c, 0x8ad07e73cc175cd9, 0x67c66480edcd372c, 0x70c181e9fcbef81a, - 0xf657d1e4a484f3e9, 0x4d522d61be5e3ff5, 0x27df19149c05f3ed, 0xd8ad38b72eb41fb4, 0x40474430235c647d, - 0x1757aeaa00a9eae0, 0xf75515aeedc47f4b, 0xb76704a71ecfd995, 0xb3790e04c8d385e2, 0x45b7d5ea00162641, - 0x6ddf1146a6b450e2, 0xad8266d98769f70a, 0xb06d6a8823d20c0a, 0xb8c936ccae106afc, 0x57b0b2ac9bc6e040, - 0x19cdbbb034fe0222, 0x9ffa5f49b228ac37, 0x4d48af9f8619fc90, 0xe9c613cb9ee50fb9, 0xcbb32963522a6af5, - 0x97d74f0383ac4961, 0xcf3ffb3f9848f50d, 0x7eb59ec1602a7250, 0x9801c41ee9034495, 0xbb904e4ab7306333, - 0x7ab2434bd058d501, 0xf9006fedc0e9fba9, 0x170c937634c19957, 0x08062036d61344ee, 0xc03a847d625b1ca4, - 0x9e8478d097a1a040, 0x78ab5d5c04c98569, 0xff82d7a4dfbfb828, 0xafa30e2d3aa16e98, 0x2948582cf0d8f224, - 0x200841d1a6e5b294, 0x1cd6a78cd36709bc, 0xdd947fc030baa603, 0xbfd3f271653d2763, 0x90f902076130a09d, - 0x1adc4d7c3e985375, 0xdae6a5fb418174f1, 0x37aa65248c09acca, 0x1a815764ed54b26c, 0x3fede49917472531, - 0xc5475c9ccae5e0b1, 0x2351dc05423741c5, 0xcc5029c994f9d538, 0x7bf4d3aa62297c9a, 0x49aa7d611913f548, - 0x4167ea7d80de2303, 0x6f7e8059780f9583, 0xe15f21f656f22f34, 0xcaef5ca7bce3130a, 0x714410a3028f6634, - 0xb25f88567f12dacd, 0x8ed9903b26dde1e4, 0x58016a25a80cd6d5, 0x5ec3a0407e2bd2cc, 0xe9947743f882d0c5, - 0x59d0924f8949e97e, 0x1060898bae697110, 0x5058cce44c2187cb, 0x923f8621d4f849b5, 0x73768e8839ca1f56, - 0x5b4a21602af86d54, 0x0c223a784a556fea, 0x6e3395327e740772, 0x526c57c66dc29f74, 0xc18c2b4fb2e536d4, - 0x4f4ce4a0070aae03, 0x4ce1ff5ac1cacaa0, 0xbe3a82f40b8f2017, 0x692489478932523d, 0x4c372f0551b17b1b, - 0x3a2075e3448f4945, 0xfed0c5c8a94a9652, 0x2134ac26b08fb1c3, 0xac50750a05b2c9cf, 0xab914d8e56976ae3, - 0xa20698372abaa7ca, 0xe40214e6f22df559, 0xaea252b82a2d35c9, 0x4da9b1705357e42c, 0x4a439912c4e08940, - 0x9e432024f2f1c029, 0xd2de19c8cc952230, 0xcd15a431350d5886, 0x42053a8d964e3fae, 0xedec9d6e6eedef5e, - 0xe02f8ee3bb3b17d2, 0x93caf02cf669b245, 0xc1f8910893624af5, 0xe1d664f74f6925c3, 0x354e8970c9540aa9, - 0x05ee4fde90a24b91, 0x1b968f452b610081, 0xd7386e1d1aa32fde, 0x76b15522ea19acad, 0x82cf6234da072787, - 0x4a814190aa51db13, 0xfac4bf3f42a284e1, 0x051ce6bbd3bde04e, 0xb5610fb2f34d987f, 0x002f1fdfd45d0753, - 0x559809944377619b, 0x3c556c98217df80b, 0x93a3acb3bbbedb8f, 0x9d9d1722e630ef10, 0xbb18f49f6a7d5047, - 0x265b5087b5b472eb, 0x880b59c3852f9220, 0xbe9fc5f3cf13abdd, 0xa1985a2042ec6b39, 0x7dafe24100173b19, - 0x63e3515eec2f0e1d, 0x54cc4f880fb0e434, 0x9b0564cde6422f4a, 0xb76d4435ed0e6173, 0x228511595c5db513, - 0x5f1d8b31834ea6d6, 0xa708388591672c35, 0x225580f20217244e, 0x979bbee94ead6e64, 0x83dc95a25fc5e9ad, - 0x72d9f9b1abea2130, 0xdd62210a43ce1546, 0x20ce71c2bdd2e8fa, 0x3b22a17d3d8c2ebd, 0x21b96b72851b65e6, - 0xbe293673b3b30e14, 0x2cd29c43ba3cf726, 0xadd14d3c0a1dd817, 0xc9e46391490638f6, 0x27af849b54bb6873, - 0x803d5470b68bdccb, 0x157a850efc836946, 0xf20554284a66fb10, 0x6b660a6d947cbe29, 0xbe33257b72ed4635, - 0x19d893c2e584a30f, 0x497e360c5a05c638, 0x42c035c6895502ac, 0x8bb1974982e26ac6, 0x5825b9e4c7aa7883, - 0x18ab3acce4eda050, 0x0cc0ad04d40113fb, 0x44fa44ce2a01df4a, 0xf395b97bf541aab1, 0x66e248d886658eb0, - 0x4c4a88037351485d, 0xf531b9f634c2a229, 0x3015c2c6cdf80958, 0xa6ca541268cf7616, 0x88d2548deb071291, - 0x849979b721156eda, 0x7f81e5a5181c0169, 0x522891be9dec0332, 0x91fa0c236f703fd9, 0x392ea005b53eb20b, - 0x55366c95e3153a8a, 0x46760f34fe973aa0, 0xfc9f689f8a71f33a, 0x59f4c168c9b68fdd, 0x91b156d42b512ed5, - 0x80a696112b4a4aa2, 0x152896b70ae45761, 0xcbd95479a5f8a789, 0x1b72c60bad70690b, 0x350485d5d0d4eaa2, - 0xd68a20cd0065cfa5, 0x18b095905fc24a30, 0x211a5b701b933745, 0x96899fe517d23140, 0xcd307881804072f2, - 0xbf86ae61d535f835, 0x729458b8656aa36d, 0x71762d64aeaf8db7, 0xcead761ba51b19e4, 0x8a295d51b27e4124, - 0x25413f5be070480d, 0xfe05b5294dcbab46, 0x075a69eec4da49f2, 0xfdd77069ae5f29ce, 0x37d20d6e87d0915d, - 0xa20ad5f41e491140, 0x390b3e91f4db16ab, 0x448655075a10718b, 0xf7efb5eb0fbd51c1, 0x114415e18b30f2e2, - 0xb64a5bc8f5204513, 0xee219f2767f103db, 0x85ae22faf735ff7e, 0xbd5ef9273998ffd3, 0x17e21531262169d9, - 0xee788fbc865f0b8d, 0xca5314ee04fd4de3, 0xffdeee4edc47e7da, 0xbd0e945b51d5b987, 0x8ae611ded4d992dc, - 0xfcd3fc3c48c26d82, 0xf4b3172692103818, 0x4408288073301cbe, 0x4956dcdffb7577ff, 0xabb894371a5f92ce, - 0x99f448a71f8f3eed, 0xef943e6e7ede2d6d, 0xedee1e4a2292dac5, 0xdcd9a356b25b2615, 0x365d89c37242b42a, - 0x9c029d2eeebe80e7, 0x9a73ae5f7974ba46, 0xb1802f861b8eff8e, 0x1477c0b4e5af6e75, 0x02dc61196174193f, - 0x43e04cf2fa2e70c3, 0x06af7b6a8516e42e, 0xa1fe4171d107f7b1, 0x72881c3a00eeaa03, 0xe043e7c1086b6d54, - 0x4057c2efe6da3984, 0xee4836e8eccecd59, 0x059d87098103a371, 0xce91010372aef590, 0x0695cabdb32b807a, - 0x0050dcffbd687ed7, 0xe9560e811599895a, 0xd422d9be33fe0e3f, 0xd1e01335e4e86635, 0xd4ba51e9fc627949, - 0x94a29f6998da9d9b, 0xb31aceb72b6cfd19, 0xcf093d1da5472a92, 0x20462e9c48332e11, 0xd088bc3c69426bf2, - 0xc89ae407f7dd03c3, 0x622605ff5353da03, 0x58f7a029f4e4858f, 0x59c7091e207265a3, 0xd7da6f063968b5b2, - 0xeb76511b83d905f2, 0x783cd2709f719760, 0x0aa516d0948b25f9, 0x056765ac34767ad4, 0xf743aa4fd7a0ad5d, - 0x72dff0d1dcc4e105, 0x79222e916093b20b, 0x5a6703708b2e8e2f, 0x957b611b00fac191, 0xefe853828a1543e7, - 0x3200b85be340ca66, 0xedf4326ba76bbbef, 0xb3aaaad315cab3c7, 0x6abb3b37d7e5761e, 0x71e1ceb440eb8db0, - 0x8ff0bd181a168a58, 0x2d40308ff79b93fa, 0xce91ef90c489ab6c, 0x8e9fbaac2afe021e, 0x421e66b89085a53e, - 0xecb71f30da1958f9, 0x06ac20c4f0bb2708, 0x67f3680f1847a303, 0x082ef7b0c71d6153, 0xabdc1219c5d89668, - 0x8b50c71cba3b2778, 0x184172055b30fc18, 0xf519e848ffaabcba, 0x7f7efecb87de0f41, 0x3b654357f0a66429, - 0xd9511b26f645c422, 0x870b44b95361f15e, 0xa98c8fd0271ab394, 0xc818e735a2e722d1, 0x957d00447cd59d3f, - 0xc7fed8e7a0f1a997, 0xdca020c4479e681a, 0xba9c693370700b80, 0x85ca43baf0f72241, 0x60a47234df329471, - 0x4894e14314e77b8f, 0x42ab70c70972ce0f, 0x0571dc621018bb20, 0x0f6691971c7adc72, 0xa1295dd054631066, - 0xbd5b0589ed62ed03, 0xdbf79dcabda01a5e, 0x12edb3dd7350c814, 0x2b168bdfc3cd8adb, 0x316cbdbee568531a, - 0x714faa3d6071973a, 0xa52180c4eaceae76, 0x94118b90730e5dcc, 0xe2ab6ee5019554be, 0x244850e344f6879e, - 0xc0c2320e3a191676, 0xa619924c77ec847b, 0x1864bb5859483f67, 0xbe44164bcb45a774, 0xc580a3d36bba1c67, - 0xb886347881e38396, 0x31d6774fbb9d5d79, 0xe10ca6f96f9a7aa1, 0x160151dff39ce0be, 0x801818d3f06e47bb, - 0x1f5203a60a96b5b8, 0xeee87c93d33b9bc1, 0x3ce010a340b05bb0, 0xfa546456501bf458, 0xe9762c423facb60f, - 0x4933fb02613ee476, 0x3c01aad138eb9ebf, 0xe18ebba13f715d3b, 0xeb8564b12a220dde, 0x61e4d47759d979a4, - 0x5b7dac6827ca6f52, 0xaaf6dd43340f2d08, 0x893cdf208d939876, 0x626d4c847d459c0f, 0x6237603339fc82a8, - 0x8113e91d5b297ff4, 0x861484018a623622, 0xad0b09f9a8480d01, 0x348ce89e24fbd21b, 0x466bf2040d74a51f, - 0xb39ae0d925afb1e5, 0x742b204b30185947, 0x10e78b55a846e7ba, 0x7d22ab881d8a364d, 0xb5a8f4b696afbc8b, - 0xfeee815e5a8aa067, 0xd900afa20a5628ed, 0x8cee3b8a802769fd, 0x9ad6e7fd0bad71a9, 0x07f79ad72a6dbbaa, - 0x2c6a36b0c030ad9d, 0xdd367ca4444f7ac6, 0x303e65f561038b69, 0x9acc3f5df79a90d8, 0x052027550e6fac37, - 0x3f4b52dc937b1596, 0xb104f7de2519e11b, 0x9953c46ab816dfb4, 0xa668d591500c3c61, 0xc53fc8efdc9d4ece, - 0x3b7c79ddb57767ad, 0x8ff6835908449d92, 0xf8c919f590eeb251, 0xc2ae90addd3db314, 0x6efe837160897173, - 0x59c8b3a32a28f0df, 0x18daced141666437, 0x6664c796e4471d4b, 0x6f3accef3b92d131, 0xc7ccc5d34866903f, - 0xa51646b107096c74, 0x05d09a19c0e107f7, 0xc4b10e9eba123b58, 0xe9cc54e5b7941726, 0xe455c2e61f6122eb, - 0x5a5b29882b3b0a05, 0x41649d230eb26791, 0x475e7baa4b2544e3, 0xf8d4770fac5ac75c, 0xcbda5679813f62dd, - 0x61e162cdb150390e, 0xa1ea3d1d5fd2432a, 0x9718b72fd9ceafd9, 0xb04bdc8c0cb97049, 0x2fcf108f72bb52f7, - 0x202d973a18194597, 0xc0e5956ba1601784, 0x346ba62546404747, 0xdc309912581d3f93, 0x02640d415bb94a93, - 0x7570009259cd8d61, 0x024c89aecef5dcdc, 0xb5b02658d9d5c925, 0xac12e1270e12491c, 0x21332af81f622cb8, - 0x3f7c1ce149220c5b, 0x0c8dcac90c956070, 0x642300817ec2fe8c, 0xb611393d8b41be4a, 0x20954106d1e4a704, - 0xa71dd1a48ed163f5, 0xa2eb64309fc181dc, 0x95f32d93df0cdfb1, 0xb2446f2c098bda08, 0x77bf0a02d46d6528, - 0x564c011344df3a6e, 0x7ece1e7eed231436, 0x4202efd07db2110f, 0x41807c3d0db69000, 0x04ed4aa41037c962, - 0x013200a40e34a48e, 0x5f340ea770b23057, 0x324327a026451d63, 0x16a6a908a7c8a97e, 0x9880bfb996954931, - 0x36ab1a5a529247e6, 0xb2b7df5162483b6b, 0xacbfe7c32b6f5f24, 0xa2b05c90c5e63ebf, 0x80f2196ebdaf2daf, - 0xde03651c3928368e, 0xa8fbfedb44516a45, 0x06e19d0c55914996, 0xfa268a310cfca9d4, 0xfe5804dd210143a4, - 0xf04568bcb0924e2e, 0x5e3f1d70a8a3e328, 0x8227d8e4bb834fd4, 0xd56b0aae2ca46e32, 0x9a3a52547d61e998, - 0x08e916cfde4c4349, 0x61b4b37a685d2bab, 0xbbd4c90a74cc4e16, 0x661d6da16080f3ca, 0x6294430754f39632, - 0x4e002b8d61985631, 0x407d83c80c5ffa1f, 0xbd0edd83d41945d0, 0xcdf1f7a5d26d5ee6, 0x2e4b538022b77219, - 0x1bf455f595a84a63, 0xa50a07ccfe2923af, 0xe594ebf04554a1fa, 0x32d117c478615e15, 0x075c75878ea72890, - 0xfc9734693c3218d7, 0xe80e6ade46c806f4, 0xa4a39d0f7a03bf07, 0x5b75cebb59f7c1ee, 0xa3b881fbfcec6f68, - 0x9f4ebb256dd4149f, 0xca2d56ac1cc06ce5, 0x094f64e998fafc6c, 0xbdb722f3d98758e4, 0x3b31dc01e5cc6486, - 0x043d775132405423, 0xcc622078535b2658, 0xcef094877c6c0560, 0x1c440902d0e1d236, 0x7819f00e0ce064ef, - 0x7e3f039d2b8c4ece, 0x4dd018847011345b, 0xdadfddfc1591c144, 0xf86e07fe0ce4f10b, 0xaf3678d8e9681bca, - 0xc3a1563a383aedc2, 0xa94af4631aa9bc7e, 0x8a10e9eb3b854732, 0xea4f984db3be1602, 0x87c2d3f84fe43b48, - 0x99260b78624ac73b, 0xad975076aa19689f, 0x8973c45606332b46, 0x8ff04eb16ada0ec8, 0x1c8840bb4e22241b, - 0xb94e660aa32e9150, 0xcc9e0f2e17e1fbac, 0xc64b68823744f4f2, 0x12cbe973e85ec6ce, 0xb58a8691bb509ab1, - 0x88eb68fc4a016d79, 0x9bb31782ea48da16, 0x6494980e9c7c11f3, 0x8bf5c0dcbac6be69, 0xdb76221667eea6ed, - 0x628a78107fcad036, 0x2f4583a005561409, 0x4389366472970ec6, 0xf21c42612ba0b777, 0xbefe5f68fdc4bf1a, - 0x273252ca54079fc1, 0xce9ce3c2c06a591c, 0xcb0da5ef7e26fe8f, 0x710fdda6f3d5bcbc, 0x477e67f60e788c5b, - 0x8514b48fcd74dac1, 0x0e94e26fa87001eb, 0xfa720ec258200c01, 0x5d8aa47bc768fd82, 0x6f277ed05e9cd891, - 0x40ac7b242b011e21, 0x4e5bd1fe484ec89a, 0x13ce68b1c24d0636, 0x84d3eeeee1eec9e9, 0x79e9c3f6ff5074bf, - 0x016c34d68265dfa4, 0x7b726d3f3ceac281, 0x44fb04f5db1441c9, 0x6e35b1bd8b55f760, 0x3ec299134033c921, - 0xc0039e14f88bf799, 0x13767ba1f822e407, 0x2a547fb05d29af76, 0x8a0023372ee8ed88, 0xecef5e98096969cf, - 0x46b5d3d17f490d8a, 0xa82788fee08ea277, 0x60da99621ce86b4a, 0x4dcad1603e83e03b, 0x38982a7a6142e974, - 0xf655c32fb7d01945, 0xd5b6f20311412e60, 0x60232872b511fc22, 0xbaa2d08bdce96bb9, 0xca54bec9ceb506d7, - 0xa800dbf8e33f49d5, 0x996f3393696d7786, 0x5fa9b9b4640c9564, 0x8cef9966b03d8ac8, 0x1fd28147b971650a, - 0xd17d2c92a015ee15, 0x35713757f2712e6d, 0x2156b9eb397d2d93, 0xf1578e2989b00792, 0x2d69d3142822575f, - 0xfbdbd87e173994cc, 0x383d91c2778a5032, 0x5a7f8e1acdef01e6, 0xc3265362a78398c4, 0xea894ce336a09b52, - 0x5822a04444072bd3, 0x88146fdec8f0ac9e, 0xd970ed8272f33dd9, 0x7dffe974f7949d09, 0x7b3d1f6fbd12cd98, - 0x357be9f73c5805e1, 0x3c06c6d8f37d721b, 0x8423190096fd942e, 0xf1d82c9613765bcb, 0xe3a6749750b0b899, - 0xd04daab96d19772e, 0xc49d87a93ac51b65, 0xa77356fe74f8ebe1, 0xd197437135a0ec2c, 0x2050ab9081bf8273, - 0xc04b7f522b7ddc3b, 0xecb64b5ca7848ee9, 0xfd4db4552c2c8c11, 0xe975b29042439a54, 0xbf3b637a754cb991, - 0x4ccd7c66053f3fef, 0xa7d50aae6f0a8b2e, 0x7b2b6797849c6569, 0xf125bb07d9fdd95e, 0x4e97878410c76a13, - 0x92ebe93d34e52d53, 0x3ced22c850cf0f54, 0x1c9b420aa835f985, 0x54b907d96663ed97, 0x63aa09095516b6e8, - 0x1e0222ee70e0093e, 0xdd50d4e9586d4d2d, 0x4c693e372494d9aa, 0x945b4796117478f0, 0x7fc8f78eac652862, - 0xe89a040834ca2d35, 0x17fe0dafbf4e4f53, 0x913e04ebd376d833, 0x7dc983536e81cfaa, 0xaebd0b0847e2c2ce, - 0x503a783f5da0d438, 0xd48e9b1039c10034, 0x57c82922a11c11d7, 0xc772a75a11356198, 0x3fd5522014384fd1, - 0x90d1ee857c515288, 0xaf996b95050295d3, 0xb2442a79430b37eb, 0x16613443b8fde7bb, 0x8482c42ef0c7ef8b, - 0xbf2fca6f842040e8, 0x96df17cffed53e7f, 0xd3febd3f4fff5517, 0x1189d2efd1babd88, 0xc1a3d5509d71a786, - 0xb8c89d8ee7988706, 0x61e1b0185c51783d, 0xbd64729397b5ace9, 0xa9935b8ed90ca494, 0x6c8e3a226a046299, - 0xbec8d87f8297677c, 0x73855460859a55fb, 0xa42150ba0b6ae200, 0x8a7b811cbc55f8eb, 0xda775310cf593abd, - 0x4a61d1300c2d0d71, 0x39ea5797a18f5c3e, 0xa24b21fb1fa74787, 0x987a1277822bc841, 0x391481088daf3002, - 0x8dd21d6c1982597a, 0x668fc31b78b560ba, 0x641ded92cd9e4f0b, 0x783e2f3897f8cb9c, 0x3bb3fb75764fcf4e, - 0xc99b3ff14e263d32, 0x6be2a8d18ba0e6d1, 0xcd3a1edd54f9eb11, 0x84561f71d3f00c26, 0x9e033d475c9ce8bc, - 0x8dc07e452c0477c7, 0xf0d419def12bca23, 0x69b72819b120e0f8, 0x2685cb10be74325f, 0x5f11d217056480f4, - 0x1fef032a30b13cec, 0x81bd2b72e19b423a, 0x55de72a1a8da1cb3, 0x5575cd905957ab15, 0x3a6dd9467896d582, - 0x0dba31079fb2ccd8, 0x10a31d59f4129c3a, 0x8ca2a894a1607222, 0x0da52da115ca6379, 0x144ba0a66ba88521, - 0x05515c3d622d5341, 0x326bac2cfacd53a7, 0x11748af78ddc20f3, 0xab8eee9a2bff51b5, 0x263390629efd9085, - 0x4211f14fcbf27a17, 0x5131180a468ee92a, 0x1c2745235214900f, 0x1a24366af5eac21f, 0x2f84650d48af2594, - 0x6988b941ca6c09a7, 0x156f3bc0d9511791, 0x3eb76aa1c9a188d3, 0xa39f758c93248b5a, 0xd93a3617ccf8a60b, - 0x70af9586edbaf01e, 0x116ca25fd8af7caf, 0xdf8dbe45d1ed3e18, 0xbb50e0a900535825, 0xc452858a375be44e, - 0x1428cc9f5d5568c4, 0x45d5a9fedf23842e, 0x02eace04e03d4cd7, 0xb0bfe02acc0c08ac, 0x022f549e09031539, - 0x35edcba00e1af6bc, 0x1f7631fe840649bf, 0x0d20f229ca51a753, 0xa73b105673ea06a3, 0x2c6c727c7aa8a788, - 0x69d94d124b78010c, 0x221fbad6aff6c8a2, 0xc9604622428319fc, 0xff7098a2d80be3e4, 0x272bec067570ac59, - 0x6db1626d7a80747f, 0x915ebfd05397c519, 0xde303239ff39cecc, 0xb4bf80348b7c14d6, 0x32dd6ba4bd1252cd, - 0xac1e66614dbc71a2, 0xbf4d705521bea92c, 0x32dcc5b5bdc3d3ee, 0xe6e1b67035bb8e79, 0xb19f062e7e99f723, - 0xcc430a055a141c5c, 0x0844ec5d0708aa49, 0x3132e876d6948dba, 0x0c070c8cbd8c6658, 0xd9b23b764f03dd7b, - 0xe1dab73c7bec38ba, 0x76b52cb5c988c1dd, 0x994d1b243b476093, 0x6234329c39b885b9, 0x24a3d36a38eac69b, - 0xd7144605f7f47703, 0xf7087ba914e6ca38, 0x06f857d143b98a38, 0x52ce16426259799b, 0x08d3e57ff12f7f0d, - 0x10b797f2bbd9badb, 0x10fe6ee1724259a7, 0xb88cd0854862e79f, 0x7a3843079ccf73b2, 0x37ce54dfa5f0e171, - 0x142e8a161eb3b9b0, 0x2fc7e0de22ef8eaf, 0x3f10a18bf15e9153, 0xa99a2edb455c29fc, 0x32052ae50a498343, - 0xef71e116c4d3a6b3, 0x75d8f7e87da26a09, 0x617472b9e276d102, 0x5dba8f11a77f8102, 0xe023b70a751eeeae, - 0xbed8f0959e1c945e, 0x07d492acfcc40105, 0x5ef94ee2549e640a, 0xbdd88163d51d643f, 0xc41c1669b088a012, - 0xf95d19bbea456436, 0xe1bb98a9e33075cb, 0x3efce11f092dce03, 0xffbbc751dbbeb163, 0xf61d3b695ff3bfff, - 0xe0947ff2bfbec7e6, 0x5dfeb71b3b7bb17b, 0x983a9711fd1b78ce, 0x6bdff9ec5b9eface, 0x038c4402df9f11ca, - 0x8817de46796c42ad, 0xe9540a348c100609, 0xe5761e7c772aa32d, 0x6b58e5742b32ad53, 0xa3701642040d5135, - 0xb33ed1a62c26ac99, 0xa778e558d47e8080, 0x672a72447a9094a9, 0x8c3710dc531cf4a9, 0x1c55a1c0cc101610, - 0x621e47018ba2d083, 0x5e3ab0d4c6ee0380, 0x876311f9fa531d10, 0x45ab59265ce732fa, 0x5e8cbc32e13f9783, - 0xd8fde387324dc91e, 0x16c6ab57c8f6c3bb, 0xdae9e1e671eef3e2, 0x64f7f3dee9ded121, 0xcdd629def6c60ca9, - 0xfc6d046bd31f5b9f, 0xf6f6772e364fba7b, 0xef37b7bb600e1fa0, 0xa3ded93bd9ddee1e, 0x9d7cc59cd254f2b4, - 0x32cb4f0824aaf7f9, 0x74fb6867f7e270ff, 0xf462fb0891b23ed0, 0xc8cd0b14a9cbc72c, 0x4472812e0f28463b, - 0x29738d7dd83be13e, 0x0a12496b5122bfd0, 0x3e0bdf14500ad14a, 0xc3eb31b42dcfcf4c, 0x44f42abe4c39666d, - 0x24a20084099042f3, 0x83a743ae82ebf738, 0x89aba80244a8ea45, 0xa3999c0cc88abd4e, 0xe535dc45a7591aad, - 0x81d7e6705a163b43, 0x22d80666cbce3bf0, 0x7a508d46c940e462, 0x4da0d159d9cfcf76, 0x5e70ec0956944f1e, - 0x8089700685867e65, 0x00bcf51ebad1b837, 0x3886662285127856, 0xcebb3a518edd269e, 0x4100d9308458a9af, - 0x41b706c2e852b053, 0x5edba819db176b2e, 0xac59dedf3cfcf069, 0xf3c32e4f0ba6d374, 0xafa60736e4fd0876, - 0x8b6dbcec098509a6, 0xb80b6d933a81b395, 0x909ed85197b2e57c, 0x971481232835afc4, 0xdfe8a8fb1077f0b7, - 0xd17ee4bfad36d17b, 0x05bf10249c1fde89, 0xddc7d8e9faee43ec, 0x7c0bb11ac423da31, 0xc473f12490e75e63, - 0x891aae12dc922705, 0x4484608438d2f60d, 0xa0873186d2419128, 0x0ee0022275fddcca, 0x7b1fc872700f6a2f, - 0x76126f9d828ddaf1, 0x234d30463c552d8f, 0x0799b0d15601eb35, 0xb00e5f14246edbd6, 0xe9efdc1692e92d73, - 0xca212b0cbdb44d1f, 0xa1f8c00be6f85828, 0x233219fac2d55af1, 0xb2a47c532f1b7dda, 0xea56766457c1d1a7, - 0x5a493ccb9123c21a, 0xd3888286233d504f, 0x0018348114f35874, 0x7611169af578f446, 0x3cc22969c3184a4e, - 0x4b3a32063e441d51, 0x039ed588e0353727, 0xfe4aee7e8a2dab3f, 0x1efa9b144fee4b14, 0xdfe8f01b74b2a3cd, - 0x4fea3c820dd8e394, 0xb10ed1baa1722106, 0x84481af488df0fda, 0x84a14e3e4c11e001, 0x0adc9124a79d4bd6, - 0x972b2d0439f00a3e, 0xa6c32413dc0292f9, 0xf9745daa53e95dac, 0xc051f56903c68e67, 0x23b1f234038a7630, - 0x71ca6fe88915355b, 0x08af6d3c8f21b555, 0x010ec73126de5d79, 0x0f75f87b6b515ba2, 0x121c57c745456c49, - 0x0c5a772ef36a089c, 0xe70b5a62155e5429, 0x6c6bb77f2da4aaaa, 0xb35f58c096ae245d, 0xfd9c30d9864794e7, - 0xb94f88e035ba8ce0, 0x3bd87eba8f7167b0, 0x4b2f0eed405bd48f, 0xe0424fba1d9cf7e3, 0x47bc0288ab72f014, - 0x1c112d92c7d9cbf9, 0x90b1a3d16319be06, 0x003a82ce2682b248, 0x7595fd421c55d92f, 0x02c7c1674243f0e3, - 0x9aaa382caf888c2c, 0x86413549d4ead4db, 0x28ab929f9f4f63bc, 0xead4745262d9ed32, 0x6442fac1aa9f7200, - 0x0f7b6c7c283ec5d3, 0x47f4031a345a5549, 0x1b4223e7c80430c7, 0xc28666ef1178308e, 0xc313487786c22be6, - 0x00995e9ce8926b90, 0x7e0b073e14719782, 0x47535651fc6e049e, 0xa04b9c76c466bba1, 0xb3141aca82a6ce72, - 0xfb07dc6328c8b4ae, 0x3775493bd7285c2e, 0x4c635385333da5b9, 0x9ee086020bff3f84, 0x52e23170bae29933, - 0xfcdad3bf1ec52f61, 0x5c68b62489ff1351, 0x85a3ecae000f01d9, 0xf33f429a743300a0, 0x26d27e56d99d2253, - 0x293310ae44ee78b2, 0x5a86d39b6adda8b0, 0xaf4ffc24538a505f, 0xd7c9a7d3ec8d4053, 0x79efc7953f1013c7, - 0x0db5cc2dbe4cf739, 0xa8110f782a4d8ec4, 0x6e377b8b0f0d8289, 0x0fdfb96babb813b4, 0xe1361a2d651324d2, - 0x5a97af94a3987c81, 0x5c3e015efe342a8b, 0x07c51bea29f1f20e, 0x54f42a715925eefb, 0x57a94a7cab124fc8, - 0xbdb1acd8f08c5953, 0x47cb4d587fe1e7c4, 0xcc2c048bfea71de8, 0xf4c4dc269e72b873, 0x62784c89f5808686, - 0x14755eaac8f876bd, 0x15851eb72fe84bfa, 0xd0e135188f3e63f1, 0x296143dffcc84726, 0xca7be6711aa9cb57, - 0x7d4175a37ecb1cdd, 0x2d65a90f992741a0, 0x1cf153851597c050, 0x86fc2d73145c9423, 0x7f93c6e5a3970ce4, - 0x63ae96038204a453, 0x6e94db7030844890, 0x8148a74b05930041, 0xa74a7b8aec5f25cb, 0x6dfafbafe41d4a2e, - 0x7008ee86ff62fc67, 0x0338f90eb5125e60, 0x0fae023fa610f859, 0x466186a1fc554cca, 0xf274cadba9243c61, - 0x9e4b59c2eb16e888, 0xacd8e45f99716786, 0x572f9b6ecf49d9b5, 0x3326a1047c548127, 0xd853f6b9ddcc144e, - 0xc3969b470b0a5920, 0x339dd360cf9ad4e5, 0xb752e58d78bc85fe, 0x40d9d0632a58279e, 0x7a828a2b8afb383e, - 0xc9378ef94bbcdd35, 0x451c65f3be82784b, 0xc8aaa25db436103e, 0x832c5ed2cb0a4eb3, 0xe57552a4c0a9d694, - 0x86f316a9c14c0fc6, 0xb5cfac1b19268858, 0x8b1c7ea62b748035, 0x63a7a8d8e1e6694b, 0xe13f5604a67ceb32, - 0x0793eadc24e980e4, 0x2a18073b839b0bac, 0x9e8c1247ad88f778, 0x95d14bec08cc52e9, 0x793c1ea7558a38f8, - 0x08961841456afcff, 0x847a55ef2664b111, 0x98d773ad027d69c6, 0xfb96527683aae4bd, 0x401bb3cfe535c93e, - 0x4babcb82a1aed4db, 0x28f92d5415d7dec2, 0x87922e2a89dc862e, 0xbf2219705d7160fc, 0x5c5369bad946a3a1, - 0x18754b575d1549cd, 0xe612f5d555c1b24b, 0xcbb22f1d716e4b4c, 0x6f97024260346b7a, 0x382849d3a2339a26, - 0x43ed008f11c40992, 0x0938a8a3e776fd4e, 0x7379a54d6fbac375, 0xdf5d6e349dbe87fb, 0xc0cd25e74ae422a7, - 0x8d2222c8d04bae8b, 0xe4800a3d61dc2786, 0x40d2204b6f5bd068, 0x90f3977c464c6e0b, 0x97e245452ea12426, - 0xf1ca31ce37e28734, 0x5649160f9bb2f825, 0x5d2af5b6a27f8a0c, 0xc9dc7148e31ff229, 0x0ac9d9e9d932fea5, - 0xcb7ec0e302f4f689, 0x08deac78137c8552, 0xbab45bde94256809, 0xda3c0384abec9774, 0xfe21e8f0270bb1fd, - 0x31cd5c33d05abfa7, 0x796e6ec099af697e, 0x9c1db0fd51c0e0a5, 0xa4ea2586854bd397, 0x0cd76cb376bb30b5, - 0xb04d8b7caab8ce81, 0x659482a8607ee5d9, 0x5c49def6d44b566c, 0x2771e81553ebc725, 0xd011596271a36be4, - 0xe138209edef8a99e, 0x72d57ea208fae2fd, 0xce1a655614cf62a7, 0x408c99463818f1a4, 0x08df72db900ea872, - 0xdac0b697b3fb1752, 0x96a65256a65296df, 0x0a87332b5528018c, 0x334b6e13aef8cfee, 0x18b187333b2b250e, - 0x54a2d98f29b9af92, 0xf5364ba95748c51f, 0x4889f6206dfce534, 0x11ffb5d1b2ebcb89, 0x741b286426f65033, - 0x43214ba29010eec5, 0x49e90bd871e6c1f5, 0x91dac95e4177c2f1, 0x539f9fd52fccb08e, 0x11ca92bed1236347, - 0x9557642026aaf23a, 0x4dc43515aa3b8a92, 0x4d95a1ac52da3c2b, 0xc92aa572ed1ea5fe, 0xd84ed1314b459fbc, - 0x1decabb780a4833f, 0x38e2293c448fb83d, 0xa129e69bd3c635e5, 0x3eb262dee33db027, 0x9f6fcee37024df0c, - 0x50a654bc8fd38756, 0xd4059e109b21ee40, 0x8dc41a26199a4ee1, 0x14cef3941f5cd123, 0xf03895f03b9978b9, - 0xc7fac4b99fe0afb6, 0xff4e13a20a64ae78, 0x9dc3bddacf69a970, 0xd67ca74a0e1bf7da, 0x029a81a3ab6d14ef, - 0x8bb19fe09e131e81, 0xc6d16913c7100a99, 0x28d28da710941234, 0xdb6ae77e02f36853, 0xe08cabb45d9f4854, - 0x90a6afae9c2f5fc0, 0xb07188a20bd3385d, 0x09efc2a8265f4f26, 0x93cc957c3e79de1d, 0xc21d057ecec3e157, - 0x380ae0468f49f88d, 0x12860415543d78f7, 0xccc68bbc6c2d9c07, 0x737904db16eef610, 0x33da1e064839c121, - 0x913a9c47d0778c8c, 0x7af120115ea51295, 0x3c5cbce247c3c5c3, 0x4462c1fc591422d2, 0x7aa18c3c6d53ef76, - 0xe4aae0526aa32992, 0x10a8e9ad714a0f31, 0x509001fe014159ae, 0xd5a08f4b3ad3d9f2, 0x1213503c28a80c55, - 0x15f7c6df89ce81f5, 0x7ba648228264931e, 0x967f3c3fc352a88d, 0x65fdcb2145ebbf61, 0x33b955baa9c485ff, - 0x923c237491581350, 0xcbfe66473b11511a, 0xa304ef528a4c19b7, 0x314aa83ea57c555e, 0xb3b214e007ce7f9b, - 0xb7305083bec18f77, 0x942ef232c2952b41, 0x5ea47478a1a4525f, 0x2aa232953260882e, 0xbffe5c97dd68f4b7, - 0x7b441dc58bf6d9f9, 0xe46faff0da5de023, 0xde8146d4824be1d5, 0xed71500a96c04f88, 0x3dff910453208b88, - 0x25f650a4e6540fd6, 0xaabb7a99e5249968, 0x86c6f13289fc0926, 0x267f511803fa4ae2, 0x9ecd49d53218a6de, - 0x57e588c65fbf41cb, 0xa3a32fd209453ea8, 0x00e5e3b42952be2a, 0xb12874fdbf2f56d8, 0xa3186739b71276d8, - 0xb68a0b489510a6a2, 0x6abbd16c55a1316b, 0x36d9af5ec7957460, 0x68056f839b0be686, 0xeea7d023e8c7c183, - 0x3f3c211461655a26, 0xebb0763ff0fde10e, 0x834d26f56a2cdcd4, 0xe54032f98b9546b3, 0xfe068ed7b34ba080, - 0x0e7529bb886a9f77, 0x616cdededcbfd8fc, 0x6def54d8eda39af7, 0x8047d45c30d84cae, 0xf066944d2f449251, - 0x2cb64ca39aa970b7, 0xd25903f6ac754f54, 0xc37185b2bd1a6232, 0x5cececee77372ff6, 0xf70e119b86ece738, - 0xba653ac0ca1070b7, 0x3263d2e9c5a98b4b, 0x7546f9340a7f6314, 0x9ec21de3dec6e36f, 0xee020c555631c253, - 0xb59d2d922d308dea, 0x7c8942547f3c3ad9, 0xfb7674d89d85ec5c, 0xbe856ec048e3fbef, 0xa15b76c0b0dbe8b6, - 0xd28b5309ddf63c98, 0x370f654991602187, 0xee646426dace2ca4, 0xe24c019a1c8427fd, 0x21c7a27b527f9f65, - 0x091fd9229eb513e5, 0xa24beb883fd6eb8a, 0xb6c5505c9481ed0a, 0xc609296e980b6899, 0x885ef47a3764bddb, - 0x699b361cad55fc37, 0x2032e08b38780c96, 0x7f8bf7e6f1e03c12, 0x6c55739ad0d3f2af, 0x60ed928417bf3266, - 0xbe570de5a983a732, 0x12d984bc89087b1d, 0xacc330d8962f71cd, 0xd6f7c8ccac0be34a, 0xfc8cc2e6e945326b, - 0xdba5bad10d5c4b71, 0xb9a03038f78ceee9, 0xb1af199db55f8b9b, 0x4af410911efd4f37, 0x5b9fd9ec0e2e5cc3, - 0x76706b5be1e196f0, 0x52a070d33df60d79, 0x4b44c51411c717ca, 0x2faaa0efc4671a51, 0x573b6423da953d13, - 0xa4438599136b43d1, 0x927ea9a07070d331, 0xcb75af5c6d064e5e, 0xa8d6d989d49d2509, 0x9d1e5226ac8a52bf, - 0x6462834cbfce306b, 0xc4f958e4367ad59a, 0xbc80eb970c92a52f, 0x4d824b78b02f73fe, 0xd79745f95cc07715, - 0x749f8816af775b7e, 0xa496df85125b8dc0, 0xaaec37b87e7c7518, 0xa5f4d21675911fa8, 0xa288a28727f2e4c2, - 0x30705457bab76cb3, 0x0a2b5fb5a400a6cb, 0x19d40ac5ed913098, 0x1b13a63b2b02ff49, 0x4ae1f7877063bb2e, - 0xfd8f5df97f28f0be, 0x0ac48fdb36b277fa, 0xa3afd7e4c623a098, 0x7ad92687520a2a08, 0xd4e471f577e0b4ea, - 0xfe0c98b27389cbbf, 0x0f2b5d36bf79e1c5, 0x61f35881ba63245d, 0xb52dcaca4dafa932, 0x15717faab5a93985, - 0x806c3cc26cd7f0ff, 0x93f955f7e60b2758, 0xcac778ed2b7fc15e, 0xa248465a31a0cbfb, 0x84b86d49a4abebe0, - 0xfdbf1983fcc162c9, 0xae15b1f42f3d6733, 0x5e379bb0f6fbb6fc, 0xe5f8ba6c92ee5174, 0x1fe91284ad502f66, - 0xbd415a5544c7b36a, 0x743621eacb7806bb, 0x91f6b652da13795c, 0x337a81f9c6f23a02, 0x76e61fa5e84bbaa3, - 0x3d89d409b8c1070d, 0x4ac61ac93765e124, 0x8237cb8205d320a8, 0x91ee7d4b35a8b651, 0x59828578559302e5, - 0x4f26b883c9e0628e, 0xb4b3542156e87589, 0x29bed67922d8084c, 0x7f22ddf0a0072bec, 0x54c7aa2f42a08859, - 0x3f712e3d173e559b, 0xb1156bdbb1dcaaee, 0x20fd904f57ee4dd4, 0x849e54620a84068a, 0x9f43d54f9e5268a7, - 0x80c3edc2e7034e01, 0x14746de8be1be27c, 0xa5c2e763a7a0b8bb, 0x46088ff90c209688, 0x09fb31e1272a53da, - 0x89337e20e8ba2038, 0x1c4388e7f7435e03, 0xd08c0ab070230e49, 0xf2861c6ef887f887, 0x1ed0c25571849d66, - 0x47b32da804a03baf, 0x56ee6c51e342ee52, 0xf8a1f498641314be, 0x2dd9c0e717b8d585, 0x4ee1be89ddf000c1, - 0x83456008ab960272, 0xaa9ec06baeb6807c, 0x461bb61560aa91e9, 0xa9a0e3f148968018, 0x2b7a3982e791440f, - 0x092aba1bf01938e3, 0xfd9fb44fe119adf7, 0x71e1df46af219a5e, 0xe98232753863eb27, 0x3848dfa02e372738, - 0x2290b7a49236c83d, 0x5684785657634e18, 0x52ed2c15856c7353, 0x51d558e4c9c7db15, 0x946216df9304ae1d, - 0xe3094b15834d00eb, 0xa839c9e4f124d1bb, 0xa93eb1109d253e69, 0x88ac99cfe24abd04, 0x4ce42b19a84ab2ee, - 0x6fe6da51cf50050a, 0x2475d74e24101c26, 0x4554d377eff0bebf, 0x7c5a80c7bb37f5be, 0x80b2943cd193016d, - 0x83947e6407f6a2f9, 0x807653bd9266a681, 0x97afbc212b272aeb, 0x0080868053f348b0, 0x5df22cc5a5d24926, - 0x9a14f7d3c8d6c50d, 0x14ae2bc7b42e50fa, 0xda447e5417bd33b3, 0xae645aa1a127a68b, 0x99a256cd20753d41, - 0x3e7ca1beb84f7ad8, 0x432e0ed039936ad1, 0xe29841fa69554f5d, 0x85e889489fdbd1ad, 0x5c709c76798fd4ac, - 0x7711cef5ef77479d, 0xd09d7e7bbda9e0b0, 0x994e555ab6df5e84, 0x9b0609ac188565c9, 0x2bf915ac3358bdb2, - 0x985dcad45581e5a8, 0x4501af3561ea503e, 0xf596762047a01eea, 0xd32ec53095aada76, 0x7f592200479743b6, - 0xdd0898a84c8c4645, 0xa799a87379eae143, 0x1d66ca62e63f6a50, 0x5aaf55f3e201f81f, 0x76a0d7ffcce6458a, - 0x8a9e36b31966172f, 0x402952a485423251, 0x1d26a8b8d1c93a30, 0xbc7b70dcfdea1201, 0xe88def0c714cd889, - 0x2f42bad994f7ed5b, 0x76cbcbcdb5950d17, 0xce75c986bbbcd26a, 0xac995b55fc86a32e, 0xb8d26ad675c1b7ad, - 0xa59629b889164983, 0x2383a6240ba2d58d, 0x46bd3a5f4917b86a, 0x757e6579b9b5622a, 0x1dd86084e80a5a1e, - 0x93cb09685239e908, 0xd90315c85d46e962, 0x94170de9fe68a3e9, 0xfce1575a4b6ba897, 0x8b9d81e71b7761ac, - 0xa58caef8cb6e37ea, 0x02946ae7588c43e4, 0x290d8eca3cb52b4a, 0x014fe5a15f9307f3, 0x9978f4c5ce5e6bc1, - 0xf1825ec3654d9a95, 0xb1d2a00c2b46a86c, 0x4b2133ddd858c673, 0x23f309dc77741909, 0x8bc21e55e92cb55a, - 0xedd59556e6014f39, 0xa0a7d44591c6d2da, 0x12779673499b7244, 0xe3d2c6ef6a93d46b, 0x544d3b9ce9f62552, - 0xb5a283bba92f2dbf, 0xa53980282bc356e3, 0x59510a6a84390dc0, 0x243310cae9c8b6b0, 0xda68ad12a08e94fb, - 0x61cd275214cf2bd3, 0xd3d276ab10e7304c, 0x6e988806f726f8d9, 0x7abb13dcd16719de, 0x6dc9d04888d5b100, - 0xf3b4fbef4aa5b181, 0xc08b38faab883fc9, 0xc6460ab9772ea9be, 0x7b8737ccf18f85f7, 0x1bc627b04686fbcb, - 0x477ada9c30274c2e, 0x0aab14ac37dec063, 0x6e40256d9ef1395e, 0xab3211ad79c06880, 0xe2508a07bad5046c, - 0xa4eb555823e71385, 0x69eb41d17b7ee695, 0x07a032a79e7ed8e2, 0x08ec386111e9131b, 0xe010eb9fe01ebfaa, - 0x968178a79b436115, 0xc7c76c8af898225a, 0x0ca2f7b5016f2521, 0x2c64236a3ae9e292, 0xb886bbad5c84b78b, - 0x9f1e1dd45d38bc35, 0x9757971a6b2d15c5, 0xb8e12ed59bad66ab, 0x058a54694d171e67, 0xcdd66a0b8e682aad, - 0xe536dfa236c86155, 0x252d0109abcbadb7, 0x6f9761201069147a, 0x9ec5476bac2b6f15, 0x47a7dc9dcf9c4f4f, - 0xec7f86d948f25aca, 0x9171ebedc298542d, 0xd6a6104361ba3409, 0x64fea3dbae1f615a, 0x3e455085889e9ad5, - 0xb958f741827b31a4, 0xb2188b50bb56480f, 0x75d507e7ddfc1bf3, 0x2ac408f5affc8115, 0x3056d4a682be9dc8, - 0xc1156a209cd45df5, 0x0e4e72218e6f50bf, 0x00661879e95aa2b5, 0x92e9890dbace221f, 0xb083070081832d01, - 0x0f9593a7fa7c6343, 0xba632222975d1139, 0x3805269531420221, 0x3ca1e3b9e0fa9133, 0xc6ab199e4bacbd25, - 0x1e720bd1a2edb998, 0xa0656c6eb20c1f24, 0xd5f084ec003772b8, 0x0b519343749d0377, 0x28a31b8a16b353a4, - 0xc23615cf483811ed, 0xcb601aeaedec8d46, 0x73b5939e81cd6155, 0xb6830df27484bd5c, 0x2434d69acf9560ae, - 0xb1b6ba440b1f5e78, 0x32bdb94ae92b2d66, 0x075554e3bd4cd783, 0xf726e7379696ea54, 0x04fe94d99a4b752c, - 0xdc975ad42d2dd519, 0x82d5d672bdbeca6d, 0xade6ea602501e6ff, 0xa81b0701c456e04a, 0xa5450d1fb14c1cbc, - 0x6db6225d0835b9cf, 0x73125ddf4bcf5696, 0x70a4a3cb7bf8b94c, 0x3f71750f3f57f0c4, 0x3b05044420e7a978, - 0x766a1968b5b65917, 0x2fae230ddacbab4c, 0x51804546d6eac9ae, 0x1d417646c7aac697, 0x2d2543dbc2edf313, - 0x87b101bb55dcab3a, 0x6f3e1af647d3fe68, 0xd91fe08cba2dc905, 0xa92319d34cf629e7, 0xc7c19e320bf81c53, - 0x7ab70ca7b7ecdc65, 0x2acb8072a9bbfa26, 0x3b5a8b4dee7c263d, 0x0df1c956b3b2bce2, 0xb096ec6a18d1d17e, - 0x71a9b9b6b4b6f216, 0xb21b226de9f8c053, 0xd556300fffcb94b5, 0x8a0aa826f2af7afc, 0x1a71672f83eb2d78, - 0xb8ddb49aea6a846c, 0x56cb223dec9abd8d, 0x95a5f5debcbb54e5, 0x37c965773df861c0, 0xcea2bfa83bfc67d5, - 0xa45a1b90318bea62, 0xef67b72695b08055, 0x83daffca2602aee9, 0x44a0673a11eb8200, 0x9030d8ac7b405e5e, - 0x8a5034cf1e34c961, 0x411209f92d481271, 0x3c67ec0c72c35fa5, 0x21cc577b604b1db0, 0xcc782e7cfe773c07, - 0x2eeb36961bab6009, 0xcda5355c40de5812, 0xd9ff0affc579abcb, 0x6bd80e5bf00947de, 0x8aae8a9acf21d706, - 0x5ba9afa110584adb, 0xaad86aad2d2fadac, 0xbd5d85a3d2c005a6, 0x0267b93aefcd0fe7, 0xc7f39951bfe141cf, - 0xe9395fc640228c8b, 0xb626548b1d5c1fc3, 0xe0f14ca73b50fb74, 0x5da3651e9cc9d4d4, 0x1280fa311f176437, - 0x35fae6c382ec9646, 0xe97c5490bda4d13c, 0x3fb4b27152ca1263, 0x5628d0d7e1842055, 0xa1538b38416d47a0, - 0x62fa05362702de09, 0x1fa1f6d6c0d15158, 0xda977844ca4f9553, 0x52fbd0ca4bdaefed, 0x2f8e9fddfe6825ed, - 0xf5db4791f9dc7a44, 0xc29701bcf313d9f8, 0xa7817ab52103c021, 0xa68103e67dd26107, 0x65ceafb2c254c65f, - 0x83896b29fdc52567, 0x1541e94a38f3e0cd, 0x2fe96289801cc6da, 0x90b0c7e5ae3f81cc, 0x4ade9eb8b4990d36, - 0x43c70421ed086d9e, 0x7859f60eb421c22f, 0x5957e320b698438e, 0xf4efb054e722aeb6, 0x0e7c8b1841956127, - 0x555fcafbb00825f2, 0x4dac59789166d419, 0xc881368673b3c9a4, 0x8ce61b2bf4bc7894, 0x1bb3baefa2a27c0a, - 0x9f4d812888490a91, 0x51068f22acbf2804, 0x1da4f6cc25ace63b, 0x60f988cb4bb310bb, 0x75d06be653a040b5, - 0xc85a01e8cdb18b89, 0x4afb40f5d7dad6ee, 0xfba393dd8b4f87fb, 0x479b3be229156913, 0x1765e52b6ad4155e, - 0xded2946addbd1701, 0x019062e73325db85, 0x380aac4dd7843bf5, 0xf8573e3491a16fab, 0x94c4b2dd0d2f87d0, - 0x7c5369e91a4b0225, 0xfc5e33fe80e41526, 0xa20990fb9e8a4599, 0xf7193445a47badf2, 0x8955b3e1216c0af9, - 0x98e1debd298405c1, 0x80a9762cc02f0997, 0xda1711061b699749, 0x0a6f98892b94e6d5, 0x55f819293d0ffb24, - 0x292db9785b83986b, 0x362835dde256da26, 0xaa3d1da1c034966d, 0x2adbd0b43f812ca6, 0x650d6ebde8bda19f, - 0xecc002d2b607a881, 0x297704a3a0122764, 0x4b6ce7a8f2f2108f, 0x64732c7eccaa0f34, 0x5b33aa587813527c, - 0x7f52aab0295a577d, 0x60effd7c45d356c2, 0x15f9b56d54e3ebff, 0x8899a4cba9e9135e, 0x898189a9001e269c, - 0x8111909f3e6e237a, 0x5c95eeeeca040a9a, 0x042d3e6804918042, 0x174300e140d91160, 0x6fe6025077d8e5f1, - 0x093fac24b1bec7a3, 0x321daa4217832013, 0xc53ec313021e7963, 0xc1736e53f1a6893a, 0x9dabe8f637b9d0f6, - 0x2ab0bdb22c8b55d1, 0x95fea173730c5b81, 0x0ddde089aa4ba3a5, 0x5da0a33cd4ac06c9, 0x156067a6e7aaa23f, - 0xbc9c446fd92a2fdb, 0x38c0e586141ec3ea, 0x411fee4a9cb1f3a4, 0x6bf2103207616a71, 0xf32413ab5ce57358, - 0x1fbb376dd80142f6, 0x69ceb52981954eb6, 0x729f22360990e0c2, 0xa77e827e6d4b7a66, 0x5385de46fd12fb22, - 0xfd123b23fdc20a60, 0x9322b1fe504b9511, 0x344cb4038614f19a, 0xd5eff4aa02178948, 0xb5267e42c50b962f, - 0x6be2581fa9f02bf5, 0xf52a2e6410e83bc8, 0xc7dfaa836ff1ea39, 0x07f065ccacebbaf0, 0x7d59bf4de1854bea, - 0x044c8534b879ee51, 0x0410202bb2a414f0, 0xae0d5951c08618c0, 0xea19599cf40664fb, 0x138079ce00543910, - 0xbafb316d2ea23859, 0xd66501408b3825d2, 0x92be1906700c06ea, 0xded36504dee4e8e1, 0x0db4319e38f79e04, - 0x2b0714df82900d2b, 0x9545164a96618ba0, 0x1498cc4339162a0b, 0x59f896514dc18cb5, 0x817da41e081ae51e, - 0x08d246d1fba08feb, 0xc2f2bee3c0e76786, 0xfc0959afd5cd242e, 0xa10e41a284e15574, 0x415717c27257dfa2, - 0x1c47f51f09626413, 0x9d22512859ac468c, 0xd3950e0ea5d21448, 0xb6e795ca12a0eb1c, 0xd5f6904866c695fc, - 0x11fcc7592224a0e4, 0xc8541fdaa8a4aec3, 0x592b88efcbb08b25, 0xfcce5fe1175c2a55, 0xffb818c0bfc8e355, - 0x418b34f113ab6c94, 0x0a5748d96d9d7c43, 0x696eb62277648592, 0x78cfd60575e16ac6, 0xb5164c03d81b8279, - 0x4969926fb1909a0e, 0xd71b40a7e22a0dc2, 0x9a8c90887f75da57, 0xe80700a202da11c0, 0xe15341c96f818b90, - 0xf433dd9e6ec7841f, 0x5c46902f5d697631, 0x116f88b11920f76e, 0xd0541d26700c2000, 0x651b8e32a32cd13c, - 0x5c4975dc79586048, 0x690ebf246a058fc5, 0x50bca16ac8defa09, 0x5e6e329175c505b8, 0x3b7006ee22d77265, - 0x4cce232c3e421db8, 0x0e414b0f405e0643, 0x9472f7899b6dc335, 0x55566b0f850ccecd, 0xf9ed483e7d86a8c5, - 0x96a8eb0968e85922, 0xf9535acbe03baf1d, 0xbf86f41b280ec5ac, 0x06fc6a05c9c750eb, 0xe243c604575ed5d3, - 0x8891a5a11e274958, 0xf044f64451e28708, 0x2e290095de535fdd, 0xa7edfdbded5fdb72, 0xb777363ffd2613bc, - 0xf1834cdbd9da9769, 0xfa8a907370847717, 0x2e3e1db7856480ad, 0x5c26ede0490399c8, 0xdbbf4c3ec2050299, - 0x4c1a31957c807499, 0x4c82992efda9ab0a, 0x8f5395b87bd8d56d, 0x00c5a611bce0a25b, 0x81b1cb34f3e5e3ee, - 0xee7e5b3ac53bc747, 0x784d61f784819651, 0x7b086c952c009719, 0x02749525a0945902, 0x4e9525fb9679b277, - 0x44deebeefed6bd38, 0xd83dfc04cc5a9292, 0x9305e9d7ddafb25f, 0x252d71d2f1c9eee9, 0x29a709918913096c, - 0x21343974f8699787, 0x1122d539991351bb, 0x7c89c852b13f0e45, 0xa64a55dfc7081477, 0x8157f1bf00625c9f, - 0xa2272564e2c7bd1d, 0x1a061207419fc6b7, 0x89d77028014232a8, 0x62ebe80433e25d62, 0x0b4660d19393234c, - 0x045b75cb0e60ddfb, 0x86a28014145a764e, 0xb74f8ef63144c164, 0xcacefb4ffbfb48c3, 0xf3fb17db1f11ac0e, - 0x454df04c1567f5cb, 0xaf1705e5eefdcb9b, 0x209d2e7dbabb8f38, 0x88e882a34002dfb2, 0xbcceffb475b047f9, - 0xe34b58d419c45d7c, 0x7268690074b4fd09, 0xd8bdc20907a8e5af, 0x8b3d4c0127508047, 0x91c434c8694c835b, - 0xfb9f30e6cbe11843, 0xde3b3ca6cc20c49d, 0x60f486888c4021ba, 0x035fe4506a3bf8be, 0x40cc46c2591f4922, - 0xf613278b04594452, 0x34a54882e6644953, 0x942c098a93c512a2, 0x54b182764e8e4012, 0x88ee058a90cd61aa, - 0x456398ebcdc3bd83, 0xcd2e424d4a48b6d2, 0x8e44a89653d85886, 0x282d9e4a90809aaa, 0xd46441c55d746055, - 0xcbf5b78751f1afa2, 0xaac22b889c28ad06, 0x10de4b26ca3b161e, 0x5e7538fbfdfef785, 0xf379586afe3ffd1b, - 0x1f95df6be6f34d75, 0xd1ec961fd9ae09a9, 0x1d4fd02a67413861, 0x8a971ee445dfd872, 0x8b958f096c79fd12, - 0xbd11435e8fb7b895, 0x08bf57711c8a612e, 0x787ec633077765bc, 0x68a20e0a74777990, 0xa6a3f6e2e2fd3dce, - 0xd32ddc5abe5e6cac, 0xadad2d3e0cd2db61, 0xb913b93af49908c0, 0x256fa01d9e02beb0, 0xda9e954f226a7cd6, - 0x3ae77d0101f3e837, 0xa52c8914de83e9e1, 0x23642c9dd3239443, 0x0f06e4c5df6b8bd7, 0x4eb954564f624020, - 0x40745e617346ab71, 0x006d07c28ea8379e, 0x2b6743c73b679745, 0x213479efe00a899d, 0x77f15f51f8fbfdfc, - 0xebc55a4ac69061b5, 0x139d0dcf5daf4d57, 0x70e55a833b400717, 0x77f896341e61c093, 0xb024810f9d32c402, - 0x04bdc3f697cb8050, 0x8b6b1ab8db849027, 0xb805c333e344e6fc, 0x7a220cc948378215, 0xe6f1650c23b8aeac, - 0x3239f16aa79f3f98, 0x13ed4f36d6acd7eb, 0x8bc91d16a2694a04, 0xf59b1147479c02c5, 0xf3c84a32be805fee, - 0x1796f7102047da5e, 0xb29f52f4d3df10bf, 0xcc070968e6eb32c2, 0xe5dd5bf3cd977ecd, 0x274cdb24f7e132e8, - 0x541a5d499d4adcca, 0x35279339a69649bd, 0xc2d6f4debb0d868f, 0xd9b42f39b829ed94, 0xe48f6c4afa08d7ed, - 0x6c6320e771eceb30, 0x62994c8e8ac97c67, 0x2a9b36c81dbf07fe, 0x49f9168ee081f231, 0x070c1627d8c5e988, - 0x82b85e9b64b33c74, 0x920cd96c61415e9d, 0x352977015e810df0, 0xd28c55aa170de1ae, 0x646606becbd73109, - 0xdedbd90c344db63d, 0xdc4ad5974668afa7, 0xa7dbcb21458bd553, 0xfb703af0b0bda32a, 0x5d79389064638cea, - 0x7ba49ef8ffb9fbf2, 0xe626af2ecf9ab56a, 0xe68fd9f79a05d434, 0x65e1c7c63610826d, 0xd9650c2424ec4b08, - 0xedb8405832d68b2c, 0xb96539acfeeef33b, 0xdbdd1f4986a4e7ed, 0x79bb83f5dcf5dced, 0xdc73cf9a6c2a7288, - 0xe098576ea729fb40, 0x77228cd4b004a41f, 0x2eb97161b6af98d0, 0x136fd6a81bd9bec5, 0x3ef44de88b71ebb2, - 0x36e5e665f347eddb, 0x5bb2d481e68505b9, 0x0b6cf972fb384c51, 0xe374b88a2d53862b, 0xc26dd29129374a87, - 0x326a954f69b159ce, 0xf185b8613976e5a6, 0xe584478deba12f36, 0xaf796141ee828f70, 0xb907c61951078245, - 0x8aed4b56508c5b87, 0xf763c533e52e3c1e, 0x8afa09d053b1b320, 0x3fad10765bbf2e01, 0xae2b75cc387052cf, - 0x5c20ab12f63d69e9, 0x22a45aea5fd1ed24, 0x08b448a15a08c584, 0xd50d51780906c1ed, 0x9340901279250936, - 0xe1ee02afd8e9ef07, 0xe2e1b80e836bc31c, 0x4b44dd85f94905d7, 0x955c317157929675, 0xa5b7516d57969f54, - 0x705dd1cd559e52bb, 0xd7a2e974975d712a, 0x5d6e5cd87746a5e2, 0x617152362ab93d6b, 0x07a5d97171bf50f1, - 0x3d9bac589c992f5d, 0x7249d7af615ab0ae, 0x09075776c5c79065, 0xd9196c398d500b5d, 0xa1687d3372954454, - 0x86072da63e229812, 0xc2a4084c5aa65051, 0x6e1d47ccd4dc3d2e, 0x3fbe813c0d54be87, 0x7c7e5a412fbb805e, - 0xaabbf58222c9f517, 0x125b35f76058a450, 0x8da1d836f2cc4fbb, 0xa3d8a219f7745c32, 0xd941465c903c9bbd, - 0xc55339e8c2b1b2a3, 0xca24f203354065b9, 0x888962e286b3fe08, 0x7c323c04bde78157, 0xda3202dde8cde22e, - 0x7199615141fd4a95, 0xfac68d4e8d5a77c4, 0x6bb1799f1b15e60e, 0x7e7144aeefc213be, 0x5127013d5cec26cc, - 0x4f2ac83213891c2c, 0x317dc6cbcb3474b1, 0x6dcdf2c584a48ac9, 0x6fdf76429747bda4, 0x347bb1bfac50a9aa, - 0x1c21a3f4f50425f4, 0x7fd4b57f15949105, 0x85c9e0c02149f14d, 0xbca1258246f74a67, 0x6ee9e84375cefe69, - 0x8257028ff44c5fea, 0x532298064b8a27c0, 0xbd39ca43f7d9ba6c, 0xfc6e09178e1392a5, 0x93c74dcde2696658, - 0x94dbf6ec80fc5866, 0xd96056138335484c, 0x6ae4f9a7c25b6067, 0x4859f128cf52ad97, 0x729528cf570944fb, - 0x409d5ee86e461d81, 0xd60fa2f71e9f1e7d, 0x78bd1aa8bebf2209, 0x47a8090069928680, 0x7a51724dead41886, - 0xc3772254b9ad7ea8, 0x71b699d97c9fa054, 0xdb5a563f7081e39e, 0xe29d13e5a41266f2, 0x6d8240803d74443b, - 0xdaab3e726f41b0e7, 0xa4a00f2c29e6d841, 0x96e90fd9e38f1b62, 0xbb6fe71aa016ee28, 0x3a65047dfd902aec, - 0x4b78afe991d39418, 0x90381e59a95712ea, 0x8de032351c57e409, 0x3c6ed01c3bd44d5a, 0x695c4e7b24815ca5, - 0xe2e020713c4dc6fe, 0x5c7bbb7d44149573, 0xceaa33180891a4c6, 0x88441cc7ddac9605, 0xda216357f93924b1, - 0x208e47da9c685285, 0xb20d3694260d2473, 0x2187636fa11bd351, 0x3b2736a7fdccb14e, 0xfd7c90bb76a7be5c, - 0x07caf34704484daf, 0x6c21e64ed30b65f5, 0x9a5c91778428e104, 0x46deb8ae38fa4b68, 0xb90f01638353c961, - 0xb916a8102cc75c4b, 0x43be1645f66edc07, 0x3a00814ff1b74f10, 0x2f7c38e87f848e14, 0x718c114adcebdc1c, - 0xc3b8657c70ee5377, 0x34844b4d5200c014, 0xc0bd3664dc060ce9, 0xa2443e440816240a, 0x24a4585295f8d383, - 0x21b4302c6c86634e, 0xbfbe7028805d20c7, 0xeaafd738baad6383, 0x82a3e935ba44f8de, 0x3e7ef87e400e8dba, - 0x23d001036831288f, 0x58ecbc5c0edb670e, 0x2a424688e1743222, 0x4d3fb2a985f80ac6, 0xdaf6452139ecb758, - 0xaf8e08d7d2e391ea, 0x93361eaff6ce6057, 0x04c93f76d7a0e9b3, 0x010f5bcfdae0612e, 0x40916774b8406af7, - 0xd8bfe33664188345, 0x31094c334daa3358, 0x6479459aad328bc1, 0x228412591e4b26d0, 0xb017c165ad07d2b9, - 0x6673ee47f84d7006, 0xf98f5551e2b1d33b, 0xba95e068d53af29e, 0x2f38ba9bf72223ce, 0xe8047f6f2bdbb8f7, - 0x7600119da812c539, 0x080cc82efc100f04, 0xfedc117f45578e34, 0xcc429d3300456e4f, 0x3091acb8485e2402, - 0x0b768d657d61113a, 0x41a4ca74f206d2b3, 0x1e7001b46c9dcfd1, 0x581fb6c701ea2464, 0xf73d0a01a4f209f0, - 0xf57dec12ec52399c, 0xe4d009a9626a05e1, 0xf46748098f013805, 0x4162c9734d33bc18, 0x4923583458c0c14c, - 0x79423d91b8261509, 0xbbe49d9f56351abf, 0xa6d98f99a762662a, 0xdce9c83a90aa1ddd, 0x6b8f81fab9f95bec, - 0x90cfdd6aa615fbd8, 0x456a84c0c47fb47e, 0x18b09edd63d54ae8, 0xb57c9eed0151d071, 0x0195cf6d93275753, - 0x7d09b6c49f094ab4, 0xf526021477ad98e4, 0x8cb16c52aa4336b2, 0x9193f2953abe0936, 0x3bf4c35829cf5323, - 0xd1c673b8df7b4551, 0x85a53376e3ac17c4, 0xbbad794cd56368e6, 0x6ea3f501db42aa26, 0x495a0a12cc43523e, - 0xc9cff10ec9f2b099, 0xd93dfb6e8b225385, 0x29156c8ac63db841, 0xe1e690a5fe5a2d19, 0x671be33d24f7b49a, - 0xf4885ca1a2a0b844, 0x0d125f6ae2cb8a24, 0xefc45d3517b5c7ab, 0x6450aaa9521f6071, 0x0351f24b4b7e0957, - 0x09a29acc03c286fa, 0x41d025abce024b0a, 0x2e86604fc0257d19, 0xf1df6a70c9f74bfd, 0x7ee93dfe10869456, - 0x40132478931c6fe7, 0x54053d31125f7c71, 0x738c70ddf6109412, 0x08809d77de81f988, 0x6353dc7ca99ab6d8, - 0x4144779024f05f24, 0xb6eac99618aef739, 0xc8bbaaf365c5784f, 0x0c45ee9c7796dec8, 0x6a95da0ef606b022, - 0xdf379e1821544882, 0xeaf6e0dcf3073f3f, 0x80ea081c1da0b906, 0x04ad6b749521a460, 0x976347c0f031df8a, - 0x61e3bb502df473b3, 0x70829061f18e23b8, 0x0fd61fc31b252251, 0xc269e4d6cb8b17d9, 0xd0aafd060694569c, - 0x77d3c253284d2d86, 0xfbabd95cbf0252aa, 0x5cfe6556fe259797, 0x99dcabdd73b8f02a, 0x0fa76ebc3ddd7839, - 0x089564bdccb25e26, 0xfb473ad883030675, 0xa889c07f7f4de30e, 0xc8977f98f1b3f369, 0x83aad070a7d4e4ab, - 0x28d1e31eda5b5922, 0x8c32aba3d69ecfe2, 0x9629f5b0d589535f, 0x52ea7e6b07346d48, 0x53ed9a9390add646, - 0x3229a176273dde2f, 0x5edc32fe44b0223a, 0x818ab341028f900a, 0xcc01cb653128a4f5, 0x3b6a5e7e551d6d2c, - 0x21341c8c91f77cc6, 0x21651c5a46274165, 0x32a375eb090c95ad, 0x232695f5f7845a9f, 0x706c0b38b397e34c, - 0xa8ffcd843353e802, 0xc4992aa9707e63fb, 0x040d1ff207de22e6, 0x949407632de04940, 0x7ad192e84608d38f, - 0x11d64e4856f225cf, 0xe4819f2c217b9c3b, 0x7239eeee7d27166e, 0xb8bfe99d44db08e3, 0x211705bd855a9278, - 0xe3f1e23654a99ebc, 0x7a86b8bbdb0f9f3f, 0x78f6ead9ddfbb737, 0x47885f3a72be494a, 0xb434dc307848477c, - 0x2a22c0e49d02cde6, 0x30cd9f51326a9840, 0xa8f38540111a27ec, 0xd8c00f03fba8c9de, 0x0d64e60e7b05dbd4, - 0x49738e1923b3a79a, 0xf771737a8ca635a4, 0xa621709a0a9a27ca, 0xe336d710ce758867, 0xf368ad095b6014a2, - 0xfb9ec232a84e1374, 0xf399ccdc81590745, 0xd3126d7e759a36c2, 0xc95e18e01f4783ed, 0x2063971d780d92b3, - 0x647c9170ffc2e794, 0x3fb6ccbf215577b1, 0x498d68ce16d4e0bb, 0x622e26382d200a3a, 0xc04223202f8472c4, - 0x7f8714ef0786d58f, 0x17458ff1d59d2777, 0xb74997ed120cd8ca, 0xc9830dd2e445c565, 0xb432bc34b80403b6, - 0xb64f3b6a9d5c6a23, 0x8dd762bf1ec7f39e, 0xc2448481947f6dbd, 0xaaa284972dd85c38, 0x552e60bead649a60, - 0x3e5d1d6abc9c706e, 0xf6646ee65fc9eccc, 0x43ecee08267e4a95, 0xc8e994302e934119, 0x655c2283442f7b76, - 0x322824917332082f, 0xc93215046a2ba282, 0x947e9d4090c3b671, 0xf29280924d6e5cc4, 0x90089748295ebadb, - 0xfbc93d199574b470, 0x561297673b219fe5, 0x7b22f9ccf694617f, 0x663573055b2fc951, 0x9b99b8c2cb3cd95f, - 0xd0969775c2c759c1, 0xcc1a0c3231a852b3, 0xea6aeb8fa5fc4ff1, 0x1a4e0e666b617169, 0xe95a159271adeb4b, - 0x88055ebc14e0c865, 0xa9ba3fb7f362b85b, 0x3dae1ad1f3b70133, 0x7966073d1ab51e8b, 0x92a059d078b610fc, - 0x6f91627ce859d071, 0x62c8aeed25ba850a, 0x3d0ca636108f556c, 0xf9cc608e789bc381, 0x53999fd08657b19f, - 0xd610a9084f6d8834, 0x8aa735c41ac8535b, 0x6295e5094da97afb, 0x84764c15de3782dd, 0x17543f515778b595, - 0xc13d2e556525ed09, 0x5559979b8d2a8703, 0xd2ee9e509454c0b5, 0x24eb854f28ca2ae4, 0x5a56d0e1a49dc1ea, - 0xeb5c5aee78454481, 0xc1d2231053218fc8, 0x45757a3e4434d6ea, 0x616a1fd94f4cbb12, 0xfb488825b6082592, - 0x3b124421711f1a51, 0xe6ed2d5574add153, 0x6695680b76638503, 0xf97ca30dcef5fb05, 0x2f496da465139935, - 0x2c0b80dd21ceab29, 0xa8ca87486775c6f9, 0xc6d1879a92a64588, 0x0c5181d0b2661f06, 0x7422e11684424bab, - 0xb3822e24ae343aab, 0x42ca7d93ea881e6f, 0x524914f626553385, 0xdfa422abe24daaa7, 0x8ac15a2d544b9e61, - 0xb50aba14fef744b5, 0x8274894adaa1cf87, 0xc1ca14b53b5d899a, 0xf528286eb2cd1a55, 0x9ab02425c54c3180, - 0x4b2ae6cb5256bad4, 0x1f69f56c718a2a95, 0xf2d7eaa62231156b, 0x39078e8a0a380898, 0xf3dfe89287caa772, - 0xbb20909731ba8417, 0x348dcc47674ec582, 0x146419149d93b865, 0xcd29dc5fd5586022, 0xf5a47b849dc6dec2, - 0x4be3b9ef1c920575, 0x2ce2fe94ba2f21d2, 0xccc190f0a1e77dbc, 0x9ff314fc247b4259, 0x90b0f019d46d05de, - 0xddcb6388edbfa978, 0x8a2d814097bb572e, 0x23c428df6fe47737, 0x2f314317a5528589, 0x8901ea56305ba8df, - 0x51d8848954dbc5fe, 0xc231e6d2e4dac485, 0x09238faea7f228fa, 0xc32106b31ee5f3c8, 0x2b7269eda991455d, - 0x3c6e3658766a83a3, 0x3d0aa7d47ddb1dfd, 0xc2ae3b9cf9855898, 0xb1335109d51a3ade, 0x2f54241a13b1e4c8, - 0x5b640fff8ee07c82, 0xde3503fc8b772bfe, 0xedb7fa5f6c8247ed, 0xf74f5dc42f13e7bb, 0x445264ee57dd757a, - 0xe5d1931e11e5ba1b, 0x50478057b8de029e, 0xaa23cec1bb094c67, 0xfe496eecf0fc1a6c, 0xe0bd0ce7e4c305d8, - 0xfaf43987ecd4a5f5, 0x48fb5e06276afdea, 0x34c34720337814ab, 0xaae72fc95755c061, 0x98c6e0d684f48c07, - 0x4ab195a314557e88, 0x461e1542829631db, 0x67352836b5896020, 0x1cd2dc7f47255cf7, 0xfe53f39d01b59926, - 0x47f574bcbea62444, 0x650c68f7c5c6ec02, 0xff2d6cdbc13149f0, 0x33e7c78a2c0b5bc9, 0x5f093c54ba121084, - 0x4ceda9bd81bc2b15, 0x0c5acb0629522348, 0xa8342253b4106129, 0x8942179bc36bbb66, 0xc5ed272e8542e627, - 0x024392c21e242503, 0x0453179662f57d3f, 0x95a122e38cd318cc, 0x553a0909d834e608, 0x683f29d13c852723, - 0x3f1769ab1841d4a8, 0x1b60386468d43045, 0x2509cadb4d8cdacd, 0x98c6ace9f5520b06, 0xc499e1005559ce8f, - 0x2628c12351976bce, 0x90c656d71cb08503, 0x0beaea4895b1e1c6, 0x1594c097790be80d, 0x9e1e0e87b682b836, - 0xa01a30a4a882a16b, 0x002448be2587c370, 0x99b220e100b20331, 0x71d7a7cb1ace44bf, 0x637bd4e6c075eb32, - 0xa2d1bb6c5e513f6e, 0xe7e620d825530e41, 0xb2337c533c26f563, 0x0df96c30164b1c05, 0x83b2b4818260dfc3, - 0xa87f4bedfb6e2da9, 0x4dd1339ea8e3991a, 0x95146cca4827452f, 0x49528228dc91d04e, 0xe3ec1201f6bbb690, - 0x94b14ff173609d04, 0x5be8165486f8c500, 0xaab8906c3e169574, 0xd81a3fc04062cf29, 0x547342b6f3d2c80e, - 0x52c93905b1ad0bc8, 0x055e35ecff9c6bc7, 0x78af179523d342de, 0x5b659c9e45a62a35, 0x9e2b3140e52f3c71, - 0x362fb4729326134a, 0x54fd1eb9e24d506d, 0xe08fc44f0b471ac9, 0x0a529cafecce2b55, 0x6718d3828164a8dc, - 0x5352d6b6069aa282, 0x60f99b4666324f35, 0xd3b709aeed5ef728, 0x0724e89d8774e784, 0x4d51e2d1a6c34ada, - 0x2e2fe878e8f48468, 0x16d0f636bcb6629b, 0x4f693c9e332bf600, 0x3cf4f88e98b43885, 0x93f4ed7b2f59821e, - 0x7b48ca0095ed280b, 0xece3639476a177f7, 0x2c43af1973106523, 0x596a44d9fe1ca279, 0x538df469648c5ebb, - 0x3ce1cd1f560a5174, 0xdc24926669916a06, 0x5544f9a56ea387ab, 0x5637d218584c1c9e, 0x67295d3b119ca00a, - 0x5120c14316c1d5e1, 0x708d10df03735e97, 0x36446ed3f1902a67, 0xf233911e6b35f91d, 0x5dede6aa69f3a725, - 0x100d1f312d2d140a, 0x4f4fb137db37359b, 0x74fa261667dcb3ae, 0x45b99107fa309e1d, 0x5ad5984ea175de2a, - 0xf8169248641cbc6c, 0xfa8d1606969bf584, 0xd776172882e26621, 0x53928482a3681acd, 0x53c8d51e8140c0b7, - 0x643888320df9a467, 0xb81caf6936704197, 0x1eec88d152b3bb49, 0x3e4291eccf72aa02, 0xd4854bbcee0611cd, - 0x018487836264cd2d, 0x3e13c634d5f6ff2f, 0x36001c58dbec95ef, 0xee35389115964097, 0x7cda85645510dc4a, - 0xa83df68b152e5cfe, 0x22822a236be95737, 0x4b6112d5dd62fae0, 0x8f9e6881f9b8ac25, 0x424e044afff0a71a, - 0x84d81d2fb808134e, 0xed3df0e738dfbdf4, 0x8edc4a06be32ef69, 0xd08adc5f66e85abf, 0xbb090fd297c937dd, - 0xdc1cf172108918ff, 0xaaf3cc07266899e4, 0x0695b0af0d6c0c81, 0xb8f2c3ed1255dce3, 0xd0b0b17766596f92, - 0x44bb9d454e6cb394, 0x7c86f38ab2900466, 0x16d53ebab65c9238, 0x7c48976a9696e999, 0x14371ca6989b87b4, - 0x11d92b38d44edd6a, 0x8c35d85859bc76c9, 0xe2b27b8f3c632c19, 0xf86be3f9c5ebc826, 0x3d9505fe0547a448, - 0x95df942af97033da, 0x46482bf4816b893c, 0xf4921de8229ceb9b, 0x9b34cecbc3b6d6ad, 0x0e5ed5b43e768aeb, - 0x8aa5e867e262c3a4, 0xad86f45560b0abe8, 0x699ef35d24d3c596, 0x4d778ba0e0987ae5, 0xb430b2a4a4b87386, - 0xa98ff76bf372b49f, 0x599b695db50515b9, 0xfb2d447a3b112b84, 0x3c4b789d73a2626e, 0x8e387c0691a671ea, - 0x840de9b712055b73, 0xf448ecd2d5ee7df1, 0xb66b8e5083b4cf60, 0x04cf2f2f29b11728, 0xc3222de65fa138a1, - 0xb7101b6d859e7779, 0x9f1ea1ee71859de4, 0x23ed846596175065, 0x79418dfeeea422db, 0xf81daf00c652dbdc, - 0x38579202d36787b9, 0x7b832ccb7c2f9bbc, 0x30c42bc76c238cfd, 0xe7bc31f78e1f74bb, 0x1d56b03029125862, - 0x6c0475b39b9516eb, 0xa84206490034a06c, 0x9d98e75b2d945f49, 0x8c9a0436daca7401, 0x26a9aef9c268a6b4, - 0x07791459387958d5, 0xb9407aa2020811c7, 0x90fd82e6e957c873, 0x681d24a77520a82f, 0x5015d2d540638470, - 0x5c399ac474b974e4, 0xc033784a078b2173, 0x7857b7829f3cdb1c, 0x51a36ec74c6e4d05, 0x998129bdb9d58af7, - 0x27bd2e0393fe9a5d, 0x6db752bed2845072, 0x10021ad6e075a6b6, 0x500ba35a09151837, 0xab2f49d9d673e2c1, - 0xd6aa0215b90c3751, 0x5a2f08f7eece88b7, 0xd97267240a1f1e10, 0x8d3a2770039a4f4a, 0x3625a76078011406, - 0xcaeff7a0932c06b9, 0x82142c6576902741, 0x902f0b22e66d36ce, 0xedb7e14b926cd7d9, 0x7a936350b45bcb57, - 0x97aae7a906d53485, 0x957efbd3c7272849, 0x5864d17f388bd263, 0x92bbd31fc75f34b6, 0xa7637ad347947bf3, - 0x2329adb97cf98c4a, 0xbc698f988076652c, 0x2143c8a4fe4b05ca, 0x58ee0eb9bdf685ab, 0x864ed739d7eab906, - 0x62956032466db9d2, 0x91e4e612fa6836bf, 0xb35570a2fa127cbc, 0xc3dc812e0c16b4b7, 0xe6a622ff99d517e4, - 0xcce87ad936b7630e, 0x4bf8899a2a89aa4a, 0xe422a00140a181d2, 0x20bfa8a8213e2327, 0x562047300b3809d0, - 0xf8443d7153386576, 0x1c820a5acdfb7044, 0x97d78cc9d42da0df, 0x15d69aa675a1f9a9, 0xdec5e92b99264475, - 0x11c70fe12b3b5a81, 0x877472cc1a35ee34, 0xf284004517d32749, 0x06562eed9c202824, 0x4fc18a16fdc2e0d9, - 0x73cc89b32eaf948e, 0x914943126d1e7d91, 0xfab9f665c465599a, 0x6a34a8b2057b91d3, 0xf0b8a878cac303c1, - 0x42844f28ab6e7c4c, 0xbf25e82ff414422c, 0x8b74b0ea68838376, 0xc277ed0cd31fb610, 0xefc66ca3c5a5d27d, - 0x460efa07aafea1fe, 0xa7077536fcd252b8, 0x1307e2575a6542aa, 0xed5ae8547a21e5ab, 0x9bdcd3c58b835c8b, - 0x17ec09f016746398, 0x7fae98a91ee324a3, 0x11fb5d2d5da007bf, 0x0dc715715670efa8, 0x523dc401b4f58bd5, - 0xc231896eca6c238b, 0x0affa3185841d23f, 0x79704185bfca01be, 0xc14982d65344bbd5, 0xc197119aa0fbb8fe, - 0x8f44709db936bf7b, 0x0534e31006902524, 0xbb8dd23fafe83bba, 0xb1d20983188b0205, 0x4086dcefde238530, - 0xde686e16ea0b3f3d, 0x84f70e296ca5f559, 0xa2e8bfa601c99ed2, 0x0b5f6652667e7243, 0x5eec465761e18e24, - 0x125755dd48cba780, 0x4f4de0321cc4f54e, 0xc9e68e823226cd05, 0x176c8a994928e882, 0x2f80a702eb25d250, - 0x055bbb3bf338c8df, 0xc7cc85a714d46976, 0xa29a106f07876ead, 0xb7de2254bcde1a41, 0xd725ba037235bdda, - 0x3b00c4853e78b299, 0xcc526412ab1e33f3, 0xa72e8f69e50cf7f7, 0x71467e2dc6f690bc, 0x973eafc9daeb5283, - 0xe40a56c2877c18b4, 0x1042a3d42522b2a2, 0xbc18eec86dc50d88, 0x7dce805694ed875c, 0x90573fb4275d32e7, - 0xf91d5bc6e41591b0, 0xfb16dce023b4732e, 0x16cd5f1e2694cc56, 0xb6d8c61d30551ff2, 0xf8a86e07b48709ab, - 0xcf5a1f554939f31b, 0x3601440b85e46f50, 0xcd9dbc79bdcc880b, 0x3c1c8d0f866f8703, 0x1855e7459d84239e, - 0x95bd3ec409c61a51, 0x8a25f51ad81033b1, 0x068b9afe282d5b22, 0x87d4e7d34c4320bd, 0xd096637b0f17b0b7, - 0x30adef710ff437b6, 0xdbee8698b0d1468c, 0x1c128d05efb5c9fb, 0x06a899ef4173c13c, 0x8d4deda676a7ddea, - 0xf6c76d0aa4126a18, 0x4f9df7c00f193c35, 0x225c098219903b07, 0xf3261465881b10da, 0x8b934e9d21f3cfaa, - 0xaa4d8e8b321d1a8a, 0xd29ef20dea941b34, 0x22b67b751b8d175d, 0x904966f916741de4, 0x05cf46d1c0019ad1, - 0x4413a9315f4cb931, 0x3f1b1ba65611db6d, 0xb81050d99f6cd9e3, 0xfd950de1a10af314, 0x8f3d2c492f2b6f5c, - 0x90e6bab12ba783f3, 0x9d98de11c8a6ebac, 0x49b634a6ee0cc783, 0x87b0f7ea76b67e6f, 0xf77819b992cda0e5, - 0x1a85e9e928cbf197, 0x6a5649b29ed00ba6, 0x26cf41e3197bfb60, 0x541c6c6b29d14ba3, 0x206d828d4a4ab26e, - 0x72b23de3d38a539d, 0x4f5f3679c5a9f3fc, 0x77f7b6d22313ad8e, 0x93b6a5bd90bb58c4, 0x10cfd6ce7aab9903, - 0x42b2e4b3297dfe4c, 0xefdb8f27ec3ad822, 0x67ed397cccccd8bb, 0x55c921707be0ac50, 0x64a8a4f6c889cbce, - 0x87a54de06b4f3d8e, 0x3eb699ed62052d70, 0x8628171757827327, 0x842983bb05773f49, 0xca7061e5127000c2, - 0x3193c9fb6883e9bd, 0xf36dbdde81560ae7, 0x71350003c2caf454, 0xaeb65d923f8e611d, 0x68b6150ee5ea5292, - 0x6a4bb1ba24fa5c27, 0xe1f0dd105660f8eb, 0xc387f72ef52fb337, 0xb283d65c7fe104d2, 0xff11aee06aaf35b8, - 0x044bf73f714c88dc, 0x571ad341dd9882aa, 0x70dc427287e23673, 0xc1e3d2459e8a4852, 0x447476c4e2626294, - 0x50329883a5f43a44, 0xed8b5b523de2f665, 0x7de2045c9e16e7d4, 0xc9f83dad6219a432, 0x1a3c6ce3cbd84da8, - 0xd7c3add5288d72a9, 0x7ce9051fd7294e67, 0x543578cfd7910954, 0xa58e984817808711, 0xbc41cba57d095fbe, - 0x6ed8f5933aed4563, 0x8f8f22a0a6b22a82, 0x7ed21c4a1644bf73, 0x902faf18f20f291e, 0xd17f28ed25d6479e, - 0xe9f5f66d00fb0751, 0xd4890bdfbb3e693e, 0x377b0ba1ef6e455f, 0xbdf93cb1ea4d1c8f, 0xd0f8671bc904b8e6, - 0xc7679d6c21625fa4, 0x9a14cfb3b8a681fa, 0x9b7f1c854af0c43f, 0x61d64e59df9bee34, 0x91477ef644381486, - 0x0341243d4c9c0d88, 0x51dc1c56f4670820, 0x209a1cf53e11efbf, 0xff63fb9851c4f126, 0xd8fcb6a0b8bbc232, - 0xac37b0840e7c528c, 0xa2e1b8967cbbec05, 0x452d212e383273a4, 0xd8f228d0a969569e, 0x5319f558d5481757, - 0x1bbe0ce267b907d3, 0xaaa9610b77c3e953, 0xcb275e70c559c8fd, 0xdd160ac11fe5b9c8, 0x0d2e79de6537ae8b, - 0x7f818f5dbb6842d9, 0x5470a747d31f4dcf, 0x4294e38e7df3f24a, 0x135623622a13811d, 0x94713a1a4e1616c9, - 0xc1bc44a956284597, 0x76c4bd2db9478fdb, 0x0832540455904c72, 0xf3c6c208d235c20d, 0xb8d51c08546622e7, - 0xe0876f4f63f615a4, 0x1ae18682fa685eb9, 0xf4962db6e7e9ef70, 0x5b7e6d93029c682c, 0xced806349e27f0f7, - 0xa298bf09e7ab2407, 0x11aea2159cc4ac8a, 0xabbc743baa48d167, 0xc24710f0256686ec, 0xa25003b4ab2c8b87, - 0x12c9deb558ec2dc7, 0x42615254b89ead51, 0xf3364991964f28b6, 0x5b27410995c502d8, 0x62708aca1de634e5, - 0x1fc38d6153537f5f, 0xcc7805c0d2dd0c1d, 0xed1650c346bb06c8, 0xc024be05aca5fa3b, 0xc04a9cf106c846f5, - 0x67e1ffe855174c67, 0x8aff5d7a8cfd4b19, 0x7a21cc82f9dd112d, 0x69299c09f317f07b, 0xd2789023d1c30aa8, - 0x9fbafd63f1be0618, 0xfa63113f6dc46fc3, 0xfbaa51fe87237ea8, 0x64ce86f881c5cf8a, 0xf87157cc86f88d16, - 0x988ef7d992e24c68, 0xff6ca8795694ef04, 0x2933e172eb72764c, 0x7ebfddba06cf6d3f, 0x0ff1a7fa34245ef9, - 0x4931826b607d3236, 0x67742e900dbd637e, 0x75761af4f5d2fbdc, 0x80d3ad161c4d569f, 0xecd2f8342a066ad9, - 0x6b53b42be8f65e53, 0xe8293ec3e8239c6f, 0xea37ac22e04e14ce, 0x628d2fd81ee10bcf, 0xed47071f8f69d8f7, - 0xc9dfda0b8a0c2e6a, 0xaa61b5168a9a149b, 0x6b5282beae106c40, 0xb83c08d200d6730f, 0x7fbd7e5e7bb4d619, - 0xaa2c946a058d6e8e, 0x858b447aeb2b954a, 0x9ac60b60b177ed31, 0x2863d819edca445c, 0x8217cfb88de61b74, - 0xf16e6d0433816816, 0xe64700ef6fe3b4aa, 0x373f7ffa1e3a4dac, 0x32e11fabadc56b66, 0xf0004645a73deaf0, - 0x24a89f059e8a677a, 0x1d7739a6c9e21bba, 0x14ba232e41d2c1c3, 0xa1b3ff9386028306, 0xc8e264816105a23f, - 0x5fc20c447c1d4fa9, 0xe22a9845464c1ab0, 0x02bd98628a37382f, 0x099eb06ac62fd6b9, 0x5dda75320da9e485, - 0x07a8002631dcc844, 0x157caeed2c2e6911, 0x3ff17b3e9ffa0886, 0xa0371f7c8ffb0e3f, 0xf256ec5ce680b420, - 0xb6246a820e4bf460, 0x7f4a4973d836a43b, 0x18265928216fe1a3, 0x73de243e729afa12, 0xa9c64b90dddec3ae, - 0xa1fdea95b9b7fa87, 0xa0a8e002c0370521, 0x746d2e5c6f93ebe4, 0xf9d6e2ca35dcf7b6, 0xa6393c58e11c1c18, - 0x14b944281568c940, 0x72ab89e4dad3b3cb, 0xe507d4ff4690acc1, 0xad64a52ce9286f00, 0xe7479477e0f3b8f8, - 0x9effa6226b077fdb, 0x16e1fddedf9ea814, 0x1f9c9dc56bce8cc6, 0xb5e8eaf5c81302f4, 0x8de2f988ad5808f8, - 0x484c0096fffae2d2, 0x3230eea7910f3341, 0x9bfed38891f0c171, 0xebd3a8ea9853a71a, 0x956e55158dbd53fc, - 0x510e288683173d10, 0x2833b495950b93e2, 0x36e5de6c3d2233c2, 0x5caddce809d74f26, 0x403648e7864e8d3f, - 0xea8c6d2a9db15648, 0x9b0589715968606a, 0xfc1f781cf5f70542, 0xca3b5765c12d8266, 0x0251f96ae8d02c10, - 0xa06b19c8d9b31222, 0x7bb750d92941509a, 0xe8e7f93c38a1254f, 0x27c44a5e969f3d2b, 0x8b6ae56768f20cae, - 0x109d9949e0b75222, 0x03f97e16a01e4615, 0x49d93eec31f59918, 0x9aaccca6acee6b24, 0x6e1611df8ba950f5, - 0xa2e8ca450ad96923, 0x99ba70696e3315a8, 0xa98d642b5ed7844d, 0x0b769e84153cb64b, 0x8e34ab24c97c8ace, - 0xa81f9ed74c75c539, 0x2f9bcf7c14794309, 0xf450f6fa3a10d38a, 0x5f0b61d64e0e2031, 0x72be1ac8acf23700, - 0x9ab765c08252a95b, 0xf3c0d2309bec382f, 0x1f67e8c9a44f5861, 0xf0706079f1ee4b72, 0xed0d688ae94abb38, - 0xf4f86c2866b75d4f, 0xa273905e6a844393, 0x079834ee489ccafb, 0x6ca7151fb85e2ec1, 0x0ba22146d30fa9e8, - 0xd06bd5871e97676a, 0xe01e97752db0c917, 0x99780d4f5c68f7c4, 0xdad2997c117e87ce, 0xf25baf03c3bddf3d, - 0x26a052c3ce541549, 0x8cc91edacd0c4ffc, 0xa4e6a7f3938af534, 0x39f3b3545a8a0736, 0xf24266ee4b89a453, - 0xca4249fad445a712, 0x349edf7bddf74fe0, 0x9b6104fb0ccccd5d, 0x3870763510418c38, 0x78aa4d69bb052a8b, - 0xc07e37bb70af00be, 0xd66ce8f0d4e913ff, 0x92168d6d7a4c453c, 0x6fb0a08f3ca3e326, 0x4f77144b977d3ac5, - 0xba26b1da5be4cf89, 0xb4d48571e0f186ab, 0x9ddd8a784b3ff3c6, 0x8459f67cab71eeb0, 0xbdf7c7dec409b783, - 0x80335740e9790d3d, 0xf8d61e6a78214b93, 0xbe114b38cba2eea2, 0xdfddca5aa399c6b5, 0x8f475611b809e501, - 0xe784dca0cf7d0a46, 0x32536fc592e8a798, 0x1ef4a0d268088b87, 0x7876b407e3ad0fbd, 0xe3620fc592ecf7ad, - 0x901ef4e0c99af21a, 0x7ad945583668c08e, 0x5cb1bae381f972c5, 0xbe231ed7144062fd, 0xabda560a204eefa5, - 0x583200beae879091, 0x36617994f116979f, 0x40bc2b67d1f11bc3, 0x261d1f3043793354, 0x72177caa00ab6c74, - 0xc16e62bd637792c7, 0x4ec95dd575485a12, 0x4893c11f52178ba8, 0xf09ca21bf403051c, 0x169de3320e10ae46, - 0xed1d66313a96a228, 0xfb67bf09018431a1, 0x82c7650e2c59ede9, 0xfbad040d47e350e3, 0xc18cd8b0e00e2f7e, - 0xbc7dfb1e14029350, 0x9b64f2910d1c96a5, 0x016f6e9382cb9239, 0x014e347d3b851065, 0xe11c1c3b86c2da27, - 0x78464608d03a3e20, 0xf87b325e703bb91f, 0x61af501026e5beb8, 0xf833cae39b198382, 0x6d638dcc5e296612, - 0x941157cdb97af96c, 0xf82bd4f9e787c4b5, 0xd98433e8d6923062, 0x59e3bfb9e19948fd, 0x26b297f0ba777c74, - 0x87a2fbbda3ad0fec, 0xd37a07deb2775b3b, 0xfd6a88384a128af0, 0x3cddbef152a4df12, 0xdfe5e7eec7b55a18, - 0xbf7c698345769e7c, 0xdb0048d09e80624a, 0xa3ed3e35c915fac9, 0x5c162f0f72bc3d4b, 0x391998b35b88689d, - 0xb2ff47b0cfa0f28f, 0x9d02157689f9f4f3, 0xf0d210d19e4ebc88, 0x64616e6f7d693390, 0x13ee356521f6babd, - 0x3e3e8c4b9523ad92, 0x00e680a2c05114ed, 0xa0c37ed0213d6d66, 0xedb1845d6bfb4464, 0x8c745a6a9c85c287, - 0x13e2df450e870f82, 0xcf2f5f82c909f248, 0x2c8735a5135a7b3e, 0x020f64748ecb528d, 0xc8e2a96c64a1ce28, - 0x0f62eba67a830c0c, 0x89de254d366c8188, 0x63ed3cccdc6228db, 0xfdf7ed8fc7903b1d, 0xe3b5ecc161afecec, - 0x552eab417ccba8ec, 0xdd7db70ea6dae6cd, 0x58b3dde13528ed9e, 0x2aad6760c8ea4001, 0x2433c641628b3bcf, - 0x31f4947c2e232d75, 0x1ed73d9bcc351ff0, 0xccade58ca21afb56, 0x87f0e2dbdb0b53c4, 0x52777602417ed08e, - 0x09f515f38ab93ec2, 0x230eb84f01dfcfbd, 0xf6e55e23e41890cf, 0x41772481df5fbb0e, 0x5e9f771a09ae77f7, - 0x2b70b03abb916f69, 0x01adc15aba2a2990, 0xcfbc5210de7d6188, 0x546bd45ac8cc35f0, 0xac4a411422e7ad14, - 0x4f6104c72fc40222, 0xc72fc0ef3d7c62f3, 0xf2571f2117be68c2, 0x029559802c0851ea, 0x2853a76c0adbefb5, - 0xf0aa2e7c1e9cbe9e, 0x8d0de76a0ca31a53, 0x7862ae56ff946a4a, 0x7f4cf2049c73e7e3, 0xc7f352620609ad7c, - 0xc0492f94774bcca6, 0xe38ea412be8e3bd4, 0x45ce4c52857949e5, 0x1a39508997a27cf7, 0x44f6f013b661a99c, - 0x39c2147378f543d4, 0xfcac472e800cc445, 0x3a2313b06a60623f, 0x0d202945647a04ca, 0xac2064bcb4bac030, - 0x3232681a3983ba54, 0xb3ac53d443102198, 0x39a62bd92121c046, 0x17403aef7db3df9c, 0x64881ad79df52a85, - 0x62c98c960953b044, 0xe8260fd233b8c013, 0xfd8450154e1fa321, 0xeae5400c61021e1a, 0x95e3eff81a2e492b, - 0xf82240311ebff90a, 0x3e4d6b0485703852, 0x468daf58621ca17a, 0x56018d1841ee2b5b, 0x8a567205685033d0, - 0x17c17867286d5331, 0x4bc300a08624f27d, 0xd614d06eeaaaa365, 0xff7cf08df934ad1f, 0x14429509af2cdfc6, - 0x148e191a9dd4cc72, 0x557c56048b55c71c, 0xa3952b56bda6434d, 0xde7ce9a80bdc3037, 0x0169556ca332455d, - 0x9c86203f9f81b032, 0x9af58aa37e852dc9, 0xd6d4154140c18415, 0x109cd638c38e6c52, 0x9c653a1e3b07072a, - 0xe2dfd151f2859683, 0x1a11e7aa543d638e, 0x456dc5d59771c40b, 0x1afcc5665d6edea6, 0xaf18b6e774544bcd, - 0xb9ccac355f0d07c0, 0xee3adf44c8a6443d, 0x57c097ad99a15ae6, 0x61d04a363b99526e, 0xde5e3a92bc4a308e, - 0xd21ce7792954e1fc, 0x466ac4c989f27c4b, 0x7790b420f852ce58, 0xb7b872adaf5ef25a, 0x2578dcb6f9087c3f, - 0x6719768dcea58a52, 0x8ae2137625fb290f, 0x479b29def8d0d8a9, 0x0ace9b93fd7d0040, 0x32b23d68b5c47c2d, - 0x4b6e470f1a4b3d71, 0xda374fe0481c4a95, 0x1a0708be7811a56d, 0x92164e6df95256a4, 0x95d33b7efa71b027, - 0xb4b34bfa912e64e7, 0xe9dee790be38942f, 0x8eedf9c8e5988666, 0x7e92314e22209ff4, 0xe628f87a124c86af, - 0xb642b0007387134d, 0x17058f5286763906, 0xce2457f1ab7bad0d, 0x842b1fc08465000a, 0xa58275af630b25ba, - 0x4649af20018fba7b, 0x086bbd279d4bdc20, 0x88f70b2034c42d07, 0x383c35e168be665c, 0xde415c4027aa5642, - 0x69aa7f26cfcf9f03, 0xe416dc062b212517, 0x1309c9ddb6b8b828, 0x6d1341ca43366102, 0x9c8f1ce431306be6, - 0xee3e582dbda3be56, 0xd6b9db69a891b3bf, 0xf8a1d0532408904e, 0x927f27696eecf214, 0xd74c4751ec910fa0, - 0x14c213b08213341e, 0xee0dfb0a25764c26, 0xc72df7f339275de7, 0xf62e2e7f470ef9ea, 0xd7ae2813feac81b4, - 0x0c596bf8ac25e7aa, 0xc5417c61717432a0, 0xb7d3c91b14ed4183, 0xb78f3108ecdbc3fe, 0x70741c46a1cc7b0f, - 0xa5fc16a7d58516e6, 0x065a7d50bed45090, 0xb1b8777c4c632ae9, 0xb14cee231bc076f0, 0xe49b02de08aab178, - 0xb9fb756378ed0c0c, 0xa085d903955456db, 0xe1a2c0ea9082e410, 0x07cd4c862f289843, 0xf3b56b12363a06ca, - 0x22257e1ad04e6391, 0x25f5e7e44f4960bf, 0x71cefbcee50fbef0, 0xce7d6e54afcf9df3, 0xcbb57a0ebc165b45, - 0x6f5ec0856fc68bba, 0xf6ba6a9ce2b87d65, 0xd7ab07744ecf04c0, 0x8f54e38f8502922e, 0x52f33b13181c63b6, - 0x5b846377f12f5019, 0x997bfdafc1a5aa43, 0x79d14dcf97f031d9, 0x68b8bd837bf7a44b, 0xb76b69c3949a902f, - 0xbacf6ff22f170337, 0xd83ad066c46dfe92, 0x048e1a7b4e5a0e3a, 0x9b1960e530079b7d, 0x22b0f951754d0063, - 0x2a0787f1a1a59287, 0x41e56612e19185ef, 0x2a9dfdccf26f2a12, 0x7565c15a09f93474, 0x99f970543dcf6745, - 0x2c9302f9053d2843, 0xc6b4112042829eb0, 0x20656073ab4c03d1, 0xd05e8eb716ae4962, 0xd2734680cd7c91e3, - 0x679d1dc8c28d674a, 0x59139902d368934c, 0xcc58f3fa9fd24e59, 0x6459f3029bd25644, 0x1b6c8a7df2972fcb, - 0x574f4ffd49c07623, 0x9f46724c26af1657, 0xea247113b3aac552, 0xa5556a7720741007, 0x32f01142d8283cc3, - 0xc566c2c32c073103, 0x974e3678b03c34ed, 0xb68440163f92469f, 0xe3ce4690991cc791, 0xfd811f7df7107050, - 0xd491fbaec099289b, 0x59b6737bf07b7b42, 0x1cd1990f839e9de2, 0xf4e065834790288e, 0x38eaaafe695371a8, - 0x87742d5cccb9598e, 0xf9b71c6aa760eadf, 0x69240308f1aca88a, 0x4c5eeef849e7448a, 0xe5519b5649dd7b50, - 0xdc8ff422bf751ebd, 0xaa8b915987480267, 0xf8c19ab29dd74658, 0x85f221b6382cc5b7, 0x2e1b7ab083cebab7, - 0x2d19e28c5bf7e776, 0x9ec26aef4eb37a3a, 0x77a56a03313c9dbb, 0x5a8de091fce9dcb5, 0xea097f7f57fd487f, - 0xae577bdde66ef509, 0xaecc885df0c38cec, 0x824224d96ed7cc6d, 0x5be62232661ff49c, 0xcfa711e2cdb26248, - 0xca59e87491c978c4, 0x726cdd62e6c2302b, 0xaf5d1fb3edd1fdf6, 0x911680ce89901f77, 0x8f8540f2ef7fbf88, - 0x1a43d76761c8e488, 0x1d2766165b11575a, 0xb830a4fa4538734e, 0xf5543d8c10686a49, 0x57379ab70269ef6a, - 0xd49031f1bea44d43, 0xdf70f185db84ace1, 0xf511e8a9a2ce5071, 0xf92d07163f25676b, 0xde23c2a0618b4292, - 0xcfa7a156be23b4df, 0x09245dbe31a8cba3, 0x513688b8bd3f8e1e, 0xcd774b7d4bce54b2, 0xdc0d9aaa1d67b6cb, - 0x69982eed891686f2, 0xc759473cad617af0, 0xc1439e352a2f405f, 0x00da4975ef5bb363, 0x765bdd5e8fa6a59d, - 0x1d441c06187ff26a, 0x9f26e0db6c4f2150, 0x92fcb39326e5bd6e, 0x2eec4a140b035bae, 0x467cbf39d6893847, - 0x0ea76be6dba790f3, 0x8ac009bb9f64178c, 0xb484809cf387b0bc, 0xd35565a89ed27b3b, 0x30f34a5bf16a305c, - 0xfcd730c8b3bac130, 0x34963c610ae76f12, 0x4b8271e05a6f1ad6, 0x63a6852f230e7e0b, 0xc891d53e284246a3, - 0x42202125963721f1, 0x4512364783f444a8, 0x2961f2308ddc7a7d, 0xe173706de3de364d, 0x1623a19b339328e2, - 0x14e8f4e8c36bd787, 0x5ce9d449d0b2249e, 0xa969a57ec2a63118, 0x6df7b03d7aa774dc, 0x04ba810cd1092129, - 0x39fc2d5d534f4286, 0x1204676f48556dfd, 0x8c7cd8dc7421f1a0, 0x333152ec120f034c, 0x0b52e73220681458, - 0x59786b87b3db2036, 0x4eba65f13685a3b9, 0x74ebebaefdbac923, 0xbdcfdefa12748d36, 0x8a189c1dcf741795, - 0x43c33a77fabb083b, 0x788876edde3eec8d, 0xb1ab854c73b5c0a0, 0xcf221517d0255ebb, 0x1cfb106f182b951e, - 0x5674a56d3a03e342, 0x43e4f210bedd72ea, 0x24a42e902df7b958, 0x4b8548336f9174e2, 0x29502c885b87f7e9, - 0x72237fe7e184d45c, 0xa29b3251ab8d37fd, 0xe1de3bb35dcd8ad1, 0xc0ff010eb7f5f127, 0x1c6e6b5a0f77ef5b, - 0xdaf8d6532aeb5bd8, 0x9770b6e0ce5374d0, 0x709c6cc7f20bac17, 0xaae367e73d9834a8, 0x3f4136f3e54b8315, - 0xfb9a84ab47044663, 0xd34e3b7f42f70f23, 0x199d6dcd6828d0dc, 0x2186974c0bf92cfb, 0x868668e809d1e3ee, - 0xd7da43b93903b5e3, 0xcf4810ce15af313c, 0xa8f835b62cafb115, 0x7d8d5da96eeaab8c, 0x9f5f3fd8f3ab141d, - 0xd9e083f00ba2d09d, 0x5d251fe8f3d170d8, 0xcf53ee62463eb496, 0x4c69123be9116e66, 0x7a6e7fde87f205a4, - 0x32348de41299cc2e, 0x46f8c10b04f10c5b, 0x6a723fa96e97b5ad, 0xac06753701ae7231, 0x5be7895bd2249b3b, - 0x4e839373260ec391, 0x59cbf6684846738a, 0x2104ab269b145cdb, 0x120b4df96a459a8d, 0xfb6ab2950833d289, - 0x8e9fd88a14236b06, 0x67883fb58a950c54, 0x7a6919486a3c3aa6, 0xd8307f473ede493f, 0x20b8c15cd88ba8ce, - 0x56e72f6d5aa767c3, 0x521d7ccd068823ba, 0x3b1de225945b7381, 0x20c854a1b00aea3a, 0x3659ec701529597d, - 0xbf44357775b26799, 0xea64fdcbcdb9b598, 0x7102666a94c377c8, 0xad449384b6a3a99e, 0xa10520a319ea032c, - 0xb2ad9adee0fc3ccc, 0x76a288a341752009, 0xcc1634436698529b, 0x8669a5dd74255381, 0x7ae150a261c6798e, - 0xc9e7764932d6e360, 0xa076e8179677d36a, 0x3afe53528155f4e5, 0x1dd887380d6e370b, 0x672bf2cf06422f5d, - 0x5b9ce775a4460391, 0x86920317c78d2e35, 0xa5946700d34e0fb7, 0x21a1dac66ea91fb5, 0x522e574020e1e888, - 0x9aebb6646b7afc9b, 0x6651ccf2a443ef1c, 0x28c9a058e6ea2819, 0x5150a65c0e551b5a, 0xbad3cadceb4d2ff3, - 0xe69b749268cf126b, 0x2b6536c62c486336, 0x963598ceca674c34, 0x9efa9a0c0b8fc36e, 0xaa0655606f9a2e14, - 0x9f455ad5a71827fa, 0x04abf2070349ac3b, 0x9eb3468667b3117b, 0x3acfdf628acbe761, 0x32c73fc33b99b2b6, - 0xeee9456abdb21ce2, 0xebdef852d7b33a45, 0xa4318dcf69a86561, 0xc4ca2ec9f36e9b1b, 0x89fca5165716fe0f, - 0x49815cbf361743af, 0x0bcea31c3555ae3e, 0x5113422a7ac24e5d, 0x2799d2978e932490, 0xa4ccf00133b1d221, - 0x66c73e6ccab4c8f8, 0x43eb805f76202c12, 0xaba0edf187736882, 0xbc92bee99e2385d7, 0xc0eae70f6505aaa0, - 0x0d2651dfc613fcea, 0xe6cfcc80feb378b7, 0xba64a517e9d7b16f, 0x9367ebd728223835, 0x87c2f17472b83200, - 0x83e108111922f19e, 0x638cea39824dca7b, 0x792292b23daca229, 0xe4601a5846118edd, 0xa0419cd6d95652c6, - 0xe15df82b3341fa35, 0xc95b92ec86164b37, 0x1016167fd4376c2c, 0x86b6fde04dfb9226, 0xa737f8074b15266c, - 0xf919352b6385bf40, 0xdf6fd67ec2db25d1, 0xbf9a7e9ed24ef865, 0xf78a9fc2352e785c, 0x4f139512961cf380, - 0xb65fb0f1c2e848ea, 0x58393a985c1f7e3f, 0x2f5f2143416fd75c, 0x5b6aad3d5e244a22, 0x46c912b10059cc09, - 0xe8d22f21302039c5, 0x6fe13424e195ca07, 0xe55e4f9a5fa65fdc, 0x1affd2d696e7b50f, 0x4a93565d12fd9562, - 0xd164645d7c7e01b7, 0x28d445c0c65a51b6, 0x456157768e46720b, 0x393799a102810aa2, 0xa72a01d8e426918c, - 0x1cbdd8ad96e1c2fa, 0x3b6370d5c101d079, 0x4e7a157eb919c66f, 0x990bcf93cd518c93, 0x1585c40e47ead612, - 0x4220063b6506d66d, 0x38c4cbf19e91f9c1, 0xa6b9a4f30d5f9b44, 0x7afe391d50d3f0b7, 0x2944ed9fd385340e, - 0xfe2a13cc7f4e1fdc, 0xb60f9d58a620cf78, 0x41f93d915178a54b, 0xda717925cfb1e962, 0x5a534a854e477de9, - 0xc97b386e27e5fa4e, 0xbb507248b46e064a, 0x7d1b33c15746a7d3, 0xee718f792221e5a4, 0xb7442218ac25c341, - 0xd98af0968243c157, 0xbe8b671862e0c2cc, 0xf8ab3b3af8caea5b, 0x335e5cef6cf2d3a4, 0xb5980be85c2a13cc, - 0xb415d90b3a107948, 0xd20883e3644cf980, 0x230e361435ce2c89, 0x18d06eb3e79822a0, 0x6be491ee6792da77, - 0x8b43e0d45626b6f8, 0xb4ca935f82b1d7bd, 0xf825e804c7f160ed, 0xd86176f6c9b72c9d, 0x011d7a445da84a71, - 0x74e5df1c8e481519, 0x6cf4605f502b6e5b, 0xb8f898a55d30a3b6, 0x235ccd0cdf43cf4a, 0x7ab3b989ba5a2eee, - 0x40f84a771161cfd2, 0x9704ba99d85d116b, 0x9641284d802d855f, 0x5a2762881742e7bd, 0x34bdf77a3b9edfec, - 0x784312b642e56135, 0xb89d94d76286d004, 0xcaa1786d34175e74, 0x4bbd53e88bf6f8ab, 0xe1228968c87b427c, - 0x8d04d0e699219d2f, 0x439aa99c7807ff75, 0xa7cb691796f3eb8f, 0x1e38777579654d93, 0xd9f45c0a7786d87c, - 0x8165c17a81b1c66d, 0xf8dc2c5d0cd3945e, 0x4ed7c0948bd50603, 0x0115ab0db2bae077, 0xaa3d789de458bbe0, - 0xe489dceacddadced, 0xd6c6dcedc507cfef, 0xb51abf2d35aadb8b, 0x4f1ffed86afc13fe, 0xf5ecd756e39fd2af, - 0xdbf4eb9ff1af87cf, 0x5a8d7fcebf1e3c6e, 0x35fe05fddadafeb9, 0xd5f897f4ebe66d6a, 0xe6c3d275fe788adf, - 0x6fe8d78fa8f3afe8, 0xc7bd3b2d5833e0c7, 0x2f48f9ed774aba73, 0x07bff6e9d7f613fc, 0xc28b8b406835fe0d, - 0xffb8db6afc5bfa71, 0xebdeed56e3dff1af, 0xede556e3dfcbaf95, 0x56e33fc8af2badc6, 0x7f945f575b8dff44, - 0xbf1e6c01a8ffcc8d, 0xbc7cd06afc1719c6, 0xcd56e3bf725f5b48, 0xfb6f9c76bfd5f8ef, 0x5cec3932ff07273d, - 0xdda6512cdf64f830, 0x8aff493f7ec08fff, 0x453f9ee0c7ffa61f, 0xcff1e3ff70d547b0, 0xdee4ee65fcd7efc0, - 0x55efdc9b2f5fe0ae, 0x4a267aabb736f716, 0x33fd76f1d1d62d2a, 0xf23de6faede28f0f, 0x51131fcbf471f311, - 0x261e1f2bf4f1e0a6, 0x7c5ca18fbb0fa4ce, 0x55ce913ebebf461f, 0x4f9f6ef1c777f471, 0x5b3f30fb68fa194d, - 0xff87efbf978f9ff8, 0xe3067dfca2395bf4, 0xf1e89e348db1d2c7, 0x73fed8a68f27987b, 0xfcbe25dd60aaf171, - 0x5b3e30dbf8b8431f, 0xb7b6b9b11b3c9c47, 0xcfb136f8e0e13c7a, 0xce756ef0709e4a9f, 0x377838dbdb3cb61b, - 0x3c9cfb2ff8b78ce6, 0x110fe0868c463f78, 0x344f1f4a7d1ecdd3, 0x1fb619b61b3c9ca7, 0xfac1c3d9a61d830f, - 0x1ece53da641f6ef0, 0x681eca9adee0e13c, 0xc29ae3378f66eb91, 0x64f0926d012bb835, 0xdb3f861b353cd7a9, - 0x1d109e6f685f9cfe, 0xf6dbebe6dcfe7150, 0xec8272c5a745db26, 0x762418a3ed9659bd, 0x52e804c580c4759b, - 0xa27d9bb0b28dfd4c, 0xf866365e780fbe1d, 0xb8c3d0450d34ba51, 0x18499ac7144f1440, 0x5b135d98d4cf8cfc, - 0x295615ec9a201450, 0x8ab03d6e6ff531ba, 0xce4734386e41624f, 0x8c8ba0cf947b1164, 0x9d06fd70eb81579d, - 0x00e6303e770295dc, 0x484621e94493c3b4, 0x1373ce98d7a5398f, 0xecdee068a46e3035, 0xb5137eba86bc4728, - 0x705f4e4c35bd046c, 0x12000844819ea52f, 0xf5cbeb4b9bc602ee, 0x048afd243e6c621d, 0xcf7c5ab0469326e5, - 0x14a123426051dc4d, 0xfd3e5c58f4610413, 0x80c0fca877dd8fb8, 0xcd9c203f5da6c0b6, 0x23db582afa470bdb, - 0xe4e81b4189a0cd15, 0x7dafdc881396bf4b, 0xbeaf27dfdffb7039, 0x13c086b182732110, 0xf5661eedc592616b, - 0xf0f1994e9330ed38, 0xa4f732427a837b56, 0x6a389c83fabda1b2, 0x0ab73ddcd18bcfa3, 0x71e2f4804dd9eb7c, - 0xfc262ebcb9082d1f, 0x7158a525bb2858cd, 0xd2d24dc417628ab1, 0xa694a1051a4ace51, 0x7c1283e16f9a226b, - 0xb2498f61c78ab80b, 0xc01ddaf03404d05c, 0x9db525524835afad, 0xee35e151e9220abf, 0x859f00840f6a8bab, - 0xd21e095310310aff, 0xb056e0f4e9700fb6, 0x3a50a6adf0c4d5f5, 0x81b827000d17df04, 0xf484edad4e9c4a90, - 0xae153688f3abe5d6, 0x2ef63717b7c0ba69, 0xa32e243a7b240f6f, 0x38615a8a607b50be, 0xd2d5b05da2beb1a6, - 0xaf09c55fe41aeb67, 0xa9caf739a8b5d3d7, 0x511bac2164521b36, 0xb99a6973e83cd3e6, 0xa8c7db350833482d, - 0xf28851f464743c1c, 0xdd65b442a2b98865, 0xef55b98ab53fe82e, 0xca957af1b67311a7, 0x6755507421c8ca26, - 0x5267d49b845bc1d9, 0x2dd1f8e15e269c42, 0x15c3c17ce3e843dd, 0x75edb53c47d38b29, 0xd7b037bd64a0f239, - 0x43e97d5cf677da87, 0xbdbe49392798aaba, 0xa2535b14073533b4, 0x47051948c6510894, 0x5f6c18b4db4de20a, - 0x106663be283337ec, 0xf8ba535e37f14981, 0x6cc693fc80554c22, 0x8fa1b22a979b13ea, 0x844c5da9a49b6a62, - 0xad60a9ac02973e85, 0x4834417753a83092, 0x78d2993f5d03fd1f, 0x3fc0f9c17db522b7, 0xeaf4fe6645d10bfa, - 0xe03ea1607e07f40f, 0x4890a5ea27fc7774, 0xdcfa8c6dbedaf89b, 0x25fd5fa31abd7dd3, 0x26e2fa2f6b733d60, - 0x5ee778ef1851c358, 0xc1c611d37d675bbc, 0xf9fa6f2e7cfe7d4c, 0x8ac2fc179e5bf82f, 0x024cf1df7ef3f4f5, - 0x6a7d99d7a73d2cd4, 0xf6f1710b9c54eb0f, 0x25a5bfd6cab56bd6, 0xe7dc687d7de5ea97, 0xc1fa3ac8b3e1fafa, - 0xf75ffacd8d8d8d25, 0x6ee00920c70bc7b5, 0x00c5e518621eab76, 0xe5f264c056df2543, 0x9f910ab2062214d4, - 0xe6fe123cbb9eaf91, 0x41543835ac730464, 0xfa530bfe90a9c18b, 0x04f465fc837906ad, 0xa8a4220370c2fc51, - 0xee55ca9eaa1e897c, 0x6d6cac5ca5da88cf, 0x6609cbdf7102b97e, 0x9684eff9fb55ab1d, 0xd73872095ae3d025, - 0x708d356c8157f321, 0xe3ed60e155f3d24f, 0x706edd6d1d45197b, 0x0bb0184106b6ca61, 0x94d15938a40c0679, - 0xbff5179d4c5cb807, 0x5d146e565b9cc653, 0xe912551d9147bf2f, 0x23df3a3ded2fc268, 0x188f8468cddb6ea5, - 0x05729e472298af5d, 0x4385def1c3a33658, 0x59f12a63f2e19747, 0x9d645f1881443986, 0x036f8e0b0a1115c7, - 0xf6d7d62a99409426, 0xb59c3d8b00c8a3a0, 0x959edbf3b3ef2611, 0xbf78f6e012bad434, 0xdece0e961ec12f9e, - 0xc5b5c72f549176a8, 0xcec18e4dca2e418a, 0x6e410d0d40d5cd9d, 0x342b9e9f7c4665a7, 0xd07cc15d330dbee7, - 0x3b1cc9ced371fc14, 0x0a9a4e2e51d7556d, 0x87025f4daf15969e, 0xfbcd1613390a0a07, 0x271d7958b064112c, - 0x7e012b02f3a74b27, 0x741e68160fc535d2, 0x472c263732f08d60, 0xa5ac899d6477277b, 0x3bdad9bb6855d7f0, - 0xc90f375b431cd8e7, 0xc181fd24b88c5606, 0x6cd9b5f1e8a39ad6, 0xd4d9ea9a0edb1adc, 0xa4ab78c8825eb784, - 0xc4865fe254d7abfa, 0xfc9e79f1edce1d66, 0xb80ec6fd8ff47e6b, 0xae911b6e98195750, 0x0feb0fdfb4fb86d5, - 0xe1a6a22bfcd65663, 0x6f78049f4fe31688, 0x0e8685b8dbedd10f, 0xa376872e41159e2c, 0x83efbad71eef1d7c, - 0x3e0dd11ce39e112e, 0x23e4cc5dfe9b9ddf, 0x3aed85fdddcf57aa, 0xef4f2ff79acd6378, 0x94460684feaa7cbd, - 0x470ea8afaeea5261, 0x4b416d0e1e6cd10d, 0x041e7d5cdd9068ac, 0x90f3a1234032071e, 0x3e3c3a318e488bad, - 0x5457d262c01859b1, 0x2bd5d5b4983f731e, 0x4d3058d7fe9f82f5, 0x535eea6a756d3af0, 0x381602fe75059f8f, - 0xd5480ed15c3e0e6e, 0x87ee2fc30fa752fd, 0x46a17a4d6dae656e, 0xea6deda9c2e66f73, 0xbf1d5f9afbadf379, - 0xb9ba72dac4ef6aca, 0xf71c272c7d59fef2, 0x5b67f3b74564cd37, 0x29bdb9f95bf332e3, 0xca81e1ca7055063b, - 0xa4831d2ec0606705, 0x29e15c0f76ae2025, 0xc24c48bbb6eb641a, 0x9bcb32c03bfd2126, 0x98b29a4d415de559, - 0xa6a72078a0e7c7b9, 0x6775a2d8b5caeab9, 0xe740d516dd1d19e7, 0x2065c51c894226b9, 0x4570a24d9c4aff05, - 0x018c73e16a89e75b, 0x70a545cfe6c63777, 0x19c841b1880e3757, 0x3fede2dc039ddc3d, 0x84df497adcb942c2, - 0x97fb09a416cdc957, 0xf6af7baa16a357bc, 0xdb5292e75380417f, 0xefc27c2ba679bc86, 0x3b9ec30e2de39750, - 0x273db933e9152e11, 0x28ef9db06b5ab085, 0xa31b9f59d5166ca5, 0xc72413dcbaf3df76, 0x6bc07f4f5a430475, - 0x5eba7263e5fbcde1, 0xe5e595c51b2b3ed2, 0xf4dc707e718988ad, 0x65fa53ad2c5ea558, 0x1d7d57a19f55e8e7, - 0x15f65a6d57a19d55, 0x686715cc76f5e4d2, 0xe2caf2ca77f30797, 0x16af2f5f5b99dfbb, 0xb4b8747d65a534ea, - 0x15581d34e7c866d1, 0xb3ef476b88d3104d, 0x2a53ab4248f6cb34, 0xe4b9be0665e9bb9b, 0xf1847eebfc63e8b6, - 0x027bada12bd2a1df, 0x5ae415fd1682d01f, 0xeabd88ca6b2fec19, 0x5dd889324e163a46, 0x179629c99cfa3b1d, - 0x94083dd6d4376209, 0x32da6cbee608485a, 0xca62260d92cfd5af, 0xdd39a2fed6d11669, 0x5aaf8302a136e1da, - 0x48bb0011cc658acd, 0x1c5133dcce21b520, 0x446dcf6a6e4da8b9, 0x2f3575020f37b636, 0x8f56f78dd57bc468, - 0xb9e35b7a35a1a58e, 0x83e195c17036e8b5, 0xd3571b879b9dd523, 0x83a1738a892fd1ab, 0x11ed1c2d83df2e07, - 0xc176e16d243baa13, 0x6cba57c1a63bf29b, 0x8ee12d41bb32d7a9, 0x5e5547cde2505668, 0x11e19a549461d6b0, - 0x18a0983a1be0d1bf, 0xa27f1019a2b9d6ec, 0x2cf837f792e80fb0, 0x3a68e7d222e8a2ea, 0x554df62bc93eaac9, - 0x3e92ec6f855b5f2d, 0x1d7e9fbee2f7e951, 0x74bf0f50bb73b217, 0xa0c1e8e1f057bd10, 0xeb68104b217f8ee8, - 0x0f2d87e702324882, 0x0e44411709842864, 0x5de2728a367c39e0, 0x0d59a0b89cbe477d, 0x393c48ffa156aa37, - 0x201a1c6133dc5a45, 0x6f2ec855f589e217, 0xca2f935ba4a1bc4c, 0x06c1abab35c21d70, 0x0186cf7c07b826c1, - 0x0671410de83e7f2a, 0x5c7a1079deffb472, 0x9a57361b4b8859b9, 0x3af60f004c075e35, 0xee363e5e1f43b644, - 0x5756f3f2dc31ff5d, 0xd5bfd0eee4bfece6, 0xf99734b6c4adeed4, 0x00eba4624f5c73b5, 0x1302efee0d9e291d, - 0xa25820aa94c4fdb7, 0x14daf1ad70c1ded0, 0xc71bfd888a9bd72a, 0x795f8d4e992fcdd9, 0x5e5cbbb27483ae55, - 0x92e7b2965e2ac815, 0xfd4f71fa070df738, 0x37ec8dcb44615da5, 0xe9653215a4887dd4, 0x00d35dac77951059, - 0x6494d33b842f5f7a, 0x1c7661d443cd6d91, 0xf314a9e3b6838e5f, 0x46e6c172df3a089f, 0xcf20ed827dbf5794, - 0xe49be82b16cb3b21, 0x3e5a8760af3bfa09, 0xae3aa1eee4adba07, 0x24d98d73ef769c71, 0xd7fbe1e8dd3618db, - 0x6c4cf6f7b82fcc84, 0xc089017b26df2b36, 0x343faf212e6048ea, 0x1da4174112434eb6, 0x70ef75102831eccb, - 0x195a03b0ae9a0967, 0xf565d7af75e7e7c9, 0xfeba5c68a7bb8bd6, 0x497e6224524d6330, 0xf0a1e713d4d9215b, - 0x358e0cf420b1125c, 0x048e2eb4462c32a9, 0x818ac2ed698f98f9, 0x50163541e39edc03, 0x80214baf18908281, - 0xf02769aa4751a4c9, 0x85026eeec131b97b, 0x7b666881037b817b, 0x8b007a2095118c01, 0xa5286edddb39649c, - 0xc8c74dfa709aa564, 0xd877b0ce19cf46bd, 0xc3c36e47b4b571ac, 0x0f646601c8b0dda1, 0x5d811870f13631a1, - 0xb17d071b995cd205, 0xf3e44aecbf454edb, 0xe4f12ef90d250ba3, 0xf46061b0b16c3c3b, 0xe7ad5a56e1890808, - 0x47b81187d06519f8, 0x71d01eeeacefd9ae, 0xc04e246d59da627b, 0x3b9d5d509aad03cc, 0xc8103392018489c9, - 0xa0391d9ab8381c9b, 0x1e5aede4cb97f74e, 0x65a1465ac6222d37, 0x1c53819f61387b18, 0xcedefa810d67cf0f, - 0xe760670fc3d1dd0c, 0xc389b431a7e3630f, 0x2798f47a393379c0, 0x111f0fc4e832394b, 0x7a6a967635f00c5d, - 0x68c25522e61b21a0, 0x21e4155dc67d8844, 0x64d0b6c1f96a4f39, 0xa76d0cc1b86b36e1, 0x59c7edb0e3648f9e, - 0x584bb42ff7c688ad, 0xd41dbdedeaa8fbd5, 0xc9ce01e64560c546, 0x8a613df1aa16ea65, 0x9aa643ea3e1bd2f2, - 0xba7668e6aa3e7c89, 0xd61551136ee11252, 0x1432a849c8791bef, 0x8c76e9f8e29de667, 0xa6e76626df1a3c29, - 0x3a237c04e5f080b6, 0x3f906f3dd6edc296, 0xa38e4edc29a3c082, 0x7dacdb7a0b9113e7, 0xe857ab4da0e1d8f7, - 0xc18a413217a3dfc8, 0x2050e7e747bbd5f9, 0x7ef30dc899776b5a, 0x7733aaba4a63a393, 0x70006612378bda75, - 0x6301ef170a027057, 0x7b2e5a18363817ac, 0x050d049b164cdcda, 0xc889c6d746360d70, 0xc0a073485e84817b, - 0x18f6016072f87b67, 0x04f37e0284f2c0b1, 0x0d4a81e594957284, 0x3d1717b6144e84a0, 0xfb112b7dafc5dfa3, - 0x850551a628f7efcb, 0x42d98c6a1701a02a, 0x9e68ede20b7da315, 0x94a78f752a4ba118, 0xeb8a61b680a489a6, - 0xea0d4e10edddcefb, 0xe678c7662d9806f8, 0x4cb0db740cd91f28, 0x0696fd2d41f6b70b, 0xfa2120271f728c2c, - 0x6deddaf56b4bdfaf, 0xb760ca71bcdec2c7, 0xb5ef3de578332c78, 0xe3eaf5152b77e3bb, 0x2bcbbed88561508c, - 0x1bfff285abfa22bf, 0x04f1ef8999041633, 0x71d057ff9e220692, 0x149d7f9d821f407b, 0xa926bb2254b10a2e, - 0x3ace0705c5b18000, 0xea1500b25cf23773, 0xea7ba54ad66b5aeb, 0x5488dc291a92c46e, 0x31cf7f220aa823af, - 0x8cfa3255c9442972, 0x064fa5257dc9dcab, 0x80e94c468e02cc7b, 0x404cba7917012787, 0xa8df0773f13ee997, - 0x99469a064b7e4a62, 0x16687a2d9daad75c, 0x2ee9cc4e619324c8, 0xcea2d16b2e072504, 0x7b344946e441672c, - 0x99f5dc3b15e1c513, 0x0aff16ce327965e0, 0xf71763800e1137af, 0xcaf783a19b125186, 0xad7f546f8b829721, - 0x7b507f30bcf93625, 0x73e0acfc707d38bf, 0x8ce378d8c25f1560, 0x82c5b35441f7bb51, 0x3dc48fbbf8ef1dfe, - 0x7b44c4154d63759f, 0x24e58ff8e7cf2c39, 0xefe19f5f08fac7dd, 0x16d9632fa0c53dfe, 0xebd0de47a0bd8feb, - 0x876b1f09dfe11c1b, 0x5d659a148eae6210, 0x9e152810a5ae08e9, 0x3c63cad05004d760, 0x95bdf7ad8f1bad4e, - 0xafbaddfa587d489a, 0x605652a062f6116d, 0xbc02c2c1ff5fbcf8, 0x5e56e045eb95446c, 0xc6a9db024236d520, - 0x54bfab0b4a5a862f, 0x0859413243637bd8, 0xa2aff9e5b587eb2f, 0x808ed61e627cef2f, 0x5e6ca1ba196fe70d, - 0x3ca4da54ea3cd49b, 0x87a8b8b48bbf1b68, 0x0a88fafd2614d3a1, 0x0ef881b7f32f66ac, 0x68e3000a2f11bf15, - 0x03450d34f9df05fa, 0x6e6226f863b97ad6, 0xfa104c6273156b46, 0x39cc927b500be847, 0xc2f37fd7c23ea1e9, - 0x1a56e36eeb313cbe, 0x6096a18ef571bdb5, 0x573d0c1d01675668, 0x98a1dbedbdc08262, 0x6bacabdeadd425c2, - 0x0bb07aa911920812, 0x30509b614895e0a4, 0x6b9f960ec9b0fb3a, 0x4751f43f40e2fd9c, 0xd493c434ebcb174a, - 0xa03093f2cd4194bb, 0xa442beb504dd4eec, 0xd06797da0b27fcc6, 0x409c272a7c7308cf, 0x7d4dfe791761707a, - 0x14dea03abfdfdc37, 0x3dc9bad821476d78, 0xe1145f1580690b3d, 0x3db878f1119e2ce7, 0xf1f7fc234ccd077a, - 0xdcb75a77090acebb, 0x78f10826bb3aa177, 0x80ec24aa04410d9e, 0x40abf50e253f2c0a, 0xb7a1dba11f487c04, - 0x2d371af010d53180, 0x56eb3e7e9cff3bfc, 0x87c099e71fe2033b, 0x96c11ffcde3bee81, 0x938cb0cf4fe65bef, - 0xbbabf817a3dc9a9f, 0xf75728c34bc0ee47, 0xdacd4f9ad56c0376, 0xf88016e22e9607ac, 0x8b77f883f7c323fc, - 0x0961270c31ee1286, 0xf8b94b28e2410580, 0xb1b311ad1cd28adb, 0x8061d8fa88b9ce75, 0xf84cad0e41443b5d, - 0x9074186c7da1bb03, 0x28ffb0f66f8789a5, 0x5f840850072a7b5c, 0x26702b9d5900f58e, 0xef60c4c7a80de2ae, - 0x5479e10d36d33b34, 0xa199ec381551081a, 0x9b493124ad7226d6, 0x5476605ac467aca6, 0x5d903b0cbf9d0626, - 0x92c6fb85c49e0d68, 0x3e49bd228496db5c, 0x133a96ab489be50a, 0xd65f589cc02f1746, 0x4e54341846b182cf, - 0xb76a7ad1aef2177b, 0x42f3672f9df53748, 0xc56c8727322dd2e3, 0x742d0483b2bc04d4, 0x14ad8df058f0a9c8, - 0x900a970bd008b6a6, 0xb6f65a5a73035ab8, 0x80a3e636b94b6629, 0x28453b7ee23013d9, 0x4b09d6391fb5ced2, - 0x431768bc49ac853c, 0x1f2a1ac8db37153d, 0x74e8d1a6881f5f43, 0x543977e1f32d52e0, 0x7355785c714b6846, - 0x02d520700e2cd35f, 0x7bb7a92f641ad2e2, 0x45e22d5454ece037, 0x2d1ca92bdf1ddc64, 0x9b7771a041c8cb2f, - 0xea8bf5ef310d2fe6, 0x5b90514d1ac9117c, 0x5d1ef7765ec09b1d, 0x82ebc4f8db2f842e, 0x2b999ecac62a4db5, - 0x2c38dd83ef10281c, 0xb8f52deeb77467d0, 0x8bd6651362a0607f, 0x6500c3932c371204, 0xe03c6b77a054ced3, - 0x5575c7510a117948, 0x851d20a7de74e5a0, 0x1713a668b97dbc70, 0x787f609792a735a1, 0x69f6f561fda2d527, - 0x8aa675d8a5065f30, 0x042026ba783d8d5b, 0x50a7449b5b03beb6, 0xc7e3ea71af3ae2d7, 0xe5375ec02f9cb312, - 0xf6124df6d9e4251a, 0x77170894b9176924, 0x30ec3bcc1f20b9b6, 0x74e5caf27757bf67, 0x500ba59c36d2f277, - 0xd7af5f5f59be568d, 0xc7c582205a0856bd, 0x1c834e3068d70966, 0xa5542aefe431889b, 0x4241d0c994110dd5, - 0x39c4860787f34720, 0x747069cf01c8e957, 0xc76670affb6851a2, 0x8ab71ae4dd1d889d, 0x495a86e66c0c6394, - 0x14f8705a6971a190, 0x5a2220f2b929162b, 0x4e4eb124099b30fe, 0x04a5466ec5f540f4, 0xc66b7a53c1485bd4, - 0xa6b4f5ef56f9ebca, 0x956bd7ae5ebdb2b2, 0xda1bdb513feceeda, 0x5daaf8f5cd5b20d6, 0x43c2a0c13573ce06, - 0x4455bdaacb619704, 0x49983127c7ebb21e, 0x8059e3763ae2d17a, 0xbf7aedf716a24490, 0x0208146cff7e38c7, - 0x4d40601ac9912a48, 0x8de0c125016169d5, 0x6eaefddee61c0fc1, 0xefa5d22056ae5d47, 0x13b075a1a2beff53, - 0x9da4317499833b8b, 0x76d7f354db0fdd54, 0x8bd72890de94190d, 0xb16dbf4be8f65b70, 0x379e668cab751a8f, - 0x00d0fd1e4c9b4f0e, 0x4d3a8e290568ba88, 0x7d2c220c18c68a3a, 0x708fc6b3b14fb3c1, 0x9762714905bdf955, - 0xedf3aaf27ad24f59, 0xd9beacac851da905, 0xe98540f2b80728f2, 0x5d102e3d2bbccfbe, 0xe8d3e722d80d1e86, - 0x7d7f76c2d990bd71, 0xfa8b773db6ef63cc, 0xb67ed17bfa1c539a, 0xe6b717982822f537, 0x41cdaf26b43bde35, - 0xe61d2c666804171b, 0xe61b8018a3031636, 0x3f77c5a37547e0dc, 0x6f561f5bb78dc1b6, 0x7ff162f18dd08123, - 0xcdd2644416b54e08, 0x50bf0fc1e60beb8b, 0xda053478be7c0127, 0x4dd5463930a4b720, 0xe4dbd74b0eacea36, - 0x6e34d2efacda2c31, 0xc263e13cb17ea1fc, 0x23add0de42d7a4d3, 0x0c9753a4cf8ba24e, 0xb5ceb8ce5f03ef65, - 0x00aa0779736515fc, 0x92368e7249b31a2e, 0x14bad510aef1a1fc, 0x5bf5c9679380c519, 0x509c24d8e6285f7f, - 0xb73737c9bba1e3d5, 0xb7cd10d26deab16d, 0xea0b9fdb4c35611d, 0x89514d1e4bb2b9f1, 0x72efb183b7de5bc9, - 0x41bbbf1fd5d73350, 0x2a4b8f4a578e5dac, 0x1a78e25d1522e031, 0x8eda9b13d8d86aac, 0xcd8a9c04d1ca6439, - 0x3836b04bbef0b98b, 0xf88af03491f31f02, 0x167a890fe7cc9f42, 0x3e9c493041b99c1f, 0x6d9e5f7646993157, - 0x6eb3c77cff11fedd, 0x1c6fb4e80b1666f4, 0x83d8d3e375ca609f, 0xb323e632afa70536, 0xb8aa2fd1dd908c2e, - 0x6a2e839d435fd873, 0xf48144fc72f5a425, 0xe941ca71152925bf, 0x6a32a326c0ed061f, 0x577da20f3924d58a, - 0x98baf8485566f222, 0x2e28d8e704aee190, 0x2b0efc0835099a66, 0x566d3199d57a77ad, 0x094fa7f3c726c93e, - 0x66c6f1cb925b7559, 0x7a31f605578ad956, 0xacb77a650551cbdb, 0x1fa1a702950d2d80, 0xede37422f88b0da5, - 0x9c105e94c9a15b40, 0x3eb1ac98a4d21d86, 0x37383d1435fd10da, 0x2838792e629593f4, 0xfbb053df126f4a5c, - 0xd3ecd1465fd0ae0a, 0x81a77c23f1de6f8f, 0x7aed85036666e019, 0x86b9f286c6411531, 0xb73a80d23ba16970, - 0xad1078cd9babc5c5, 0x68b67eee8e0684cc, 0xc5a5a6cac4ebf854, 0x35116588b5ec06a4, 0x910a94b22b4c98b6, - 0x553347e5b65cf005, 0x02f985aea9ac9c8a, 0xba6a7a199ca917b2, 0xcb75f676aca8dc50, 0x2681d9d2d574333c, - 0x5337c3bac1443931, 0x00ba84d90ed50b13, 0xd2bb09314520a89e, 0x127264523664b893, 0xb287e560cd697c34, - 0x0b3ae542304c0b5c, 0x950c350d42700089, 0xf447f39313072d20, 0xa4c17ae0730b37f0, 0x3f6b506a68143ad6, - 0x4842d74675a0aee3, 0xafd3ec0b7e8cb1ca, 0xc58b3d9726280431, 0x759214422a2ed825, 0x232713ed38dc6462, - 0x1dc54d4e43cb2325, 0xe778aa706023cb52, 0x4a985096bb731ef5, 0x2c25f09f97cc3129, 0x2b645b93e2a5c088, - 0xba5c61b95c61545b, 0x61e5ac3d5c99d283, 0x2e3d2b8b25fa04a2, 0xfe03620e94b4497a, 0x89400469c77809a7, - 0x9328c42dd80a349b, 0x50b7fc2e203b690f, 0x417c4e3227de4391, 0xca836646e4a4c20d, 0x10206c361d72920b, - 0xc50db6c807a69a93, 0x80034372ebf956e3, 0x26c5cfd2df771575, 0x9ae52e6f5b163640, 0xa705f0118d1b129e, - 0xd04de276fa5fa0bc, 0xceade0172c68acbe, 0x070c5d0fbd330469, 0x97621211c16d74e2, 0xf034a890d04ae9d2, - 0x74776da0b06888bc, 0x9ca81dcf1580d15b, 0x1ceeefa31716145d, 0xbeb2a25eed0f8feb, 0xe3a918aa884ef541, - 0x1b34b51265ce7f4d, 0x41262b19e6719ca9, 0x3a88490d6d384fe4, 0x834e21759bd018e8, 0xcf721dc98d6bb21f, - 0x0750e2f64d48d07f, 0x2542de30f66e24e8, 0x552c669e64042351, 0x0456b71f93961485, 0x448dc05702c98d40, - 0xa592ee0313774c4e, 0x0ad948945e3cbd16, 0xbdc22ed052442e6c, 0x22aabf30809a0bb5, 0x801fedc0221b5b1d, - 0x0a5f4ee7824489c4, 0xdb82e301daa86d8a, 0xc840df5fbe9cac63, 0xb3963a2f2cad4e50, 0xb6b48a14b3958510, - 0xb1b0b28065c2caaa, 0x0b9ee2ca9e242bcb, 0x9a24e1e232ad2c4f, 0x0b01cfcbf6432c11, 0x8e0a5c9f0537c536, - 0xc3d6fbcbf280e57d, 0x6560205485076193, 0x825d84b9b89934a5, 0x3c607a4504f5515c, 0xdb2bcdc0aa963d43, - 0xe39a3f53eb3d31bc, 0x4fd7916a15165279, 0x31d9aaebad1b170e, 0x2ee8bcf97ccea239, 0xa9e9a80453a11bcb, - 0xf8039bac879cdfe8, 0xa7fec9f5d26b05b1, 0x3ef5a1bcad5e1db7, 0x8ce93a3c5c10071c, 0x5d88f9de83485868, - 0x54f7405c4a369dd1, 0x46f597917d83cf84, 0xcfa17d8225d9a8de, 0xf55c2e71ab1bd5af, 0xaeb8c3428dea01b4, - 0x17ab97670a2242ea, 0x2a155b1454876940, 0x116a9e9c32396d20, 0xa73d647a402eea5e, 0x31d488a9ffa48149, - 0x4cf9e7a0db477774, 0x6dc9e3cef47f4854, 0x0bb7f1ff97bb2fef, 0x6aebc8f6fdff7d0a, 0xacdb9d059644183c, - 0x4ac85cf0d07126dc, 0x38e93821be8e2c04, 0x281612ad2181b679, 0x9ffdfdf654d3a973, 0x246c77dfb55ef78a, - 0x39aa71d7ae69d71e, 0xfb932d1f3b04c402, 0x114fa62a649e4a12, 0xfda45ed6c3db7146, 0x35e94db926938548, - 0x8e7493ce139c3c26, 0x1477be87d6a3f984, 0x1bff597cb8bab991, 0x980174ae0c3bb45e, 0x24dfc5b23eec1357, - 0xd7398b51f5715a4c, 0x7facadf7c9058eef, 0xc5e3ab5ad61fbe8c, 0xc36ac95be95b1730, 0x352a5470e7616ff8, - 0x6ce1655fcaea8113, 0xdbca7bed2951c2cc, 0xfad5e11094a9aed6, 0xc720a4583941cb2b, 0xf72acb145d76bcde, - 0xcf4e875407b541a1, 0x3332fea517855388, 0xc228f84007a2efa6, 0x6c4ed376fba8e009, 0x27d6e460f43bc64c, - 0xbe124e7c433eb194, 0x9d182ca567b866c7, 0x932b78f3906978ce, 0x1ebca16dfa8f59c3, 0x66c88a5b18d1780a, - 0xde4c351e54b4e796, 0x0d101e2ed065eb14, 0xa7ba0489fe84a228, 0x17709e0c3f06efbc, 0xf281c3a34c0d657e, - 0x4552ef109b552d42, 0x67862b55b6f86dbf, 0x8be77aaec5283275, 0x11b7fad0af466fb4, 0xbf13d64066472425, - 0x98d5c62c651ff3d1, 0x1c06f1aaa1d3c5e6, 0x218d21e93646b694, 0x0f67e23b61aec2cf, 0x2eb08fae2ee33bc4, - 0xb74c0644c78bb8a9, 0xbba8c59ea0962a28, 0xcfea1b14252e859f, 0x0c283b8402237281, 0x5f3c62222f7279bf, - 0xfbaa4eeb7d83891a, 0x333fd4d54148f632, 0x96bcdb3ad692faa1, 0x3b29b676cc3725c5, 0x6edb9d9469ccf92a, - 0x53615905b8a1e9f6, 0x22e446b2b5eadec3, 0xa104e1272a07ae6e, 0xd82afa77376d79e7, 0xd41cfb02d3375a49, - 0x11f206565e220c1e, 0xb110c70a76d9ed5c, 0xdabca2683116b31d, 0xd0ca2c74c08eeaaa, 0x225f548ff5cbcc92, - 0x0a9a2c0961b16080, 0xa58d962fd2741859, 0xcfee590c27cefdaa, 0x5aae088c43b8f5b6, 0x2b3ee24440beae15, - 0xa24d2f1a4449fce8, 0x05235814d679c99a, 0x74b1621bfed9a929, 0x0d668f95ec3de298, 0xc3f9ec45fab322e6, - 0x5c929cc877a111f5, 0x069e336c17b0301f, 0xc693eb95f5bfbcff, 0xb67fbd42e28d95f7, 0x2b1ab4adb53218b1, - 0xfe222b7eb657d406, 0x64657363e3af6df8, 0x2e99c062a93b6c42, 0x5e713a6aade01468, 0x5fff56898b886b68, - 0x7cf01cb91bce6b3e, 0x226158248b9d8f59, 0x51e5ed2c5863e12e, 0xa096208a76b4ab93, 0x6d160811b7340a39, - 0x9f7555145abfc182, 0x78bf7201fd126437, 0xf951386dad90dcb0, 0xbd229a042b90bc07, 0xca2cac55d0867f9c, - 0xd1ac79c2640b9558, 0x9ec8b1ba53dccfcb, 0xd6540187d644e85b, 0x926e1a942c176d62, 0x51c3366a0582512c, - 0xcf417d8951af3b75, 0x6020c00db5a87315, 0x0e9eb4af04019054, 0x54f742bbac05ebf7, 0x55ed8764816be889, - 0x872062a165872fe4, 0x19faacee2de8e853, 0xfa213270d9be448e, 0x69bdf18ac579c289, 0x744c88c8e637d692, - 0x7fe31466dfa44df3, 0x1301081d5951a895, 0x97161abb42745e95, 0x15e325f0df701a7e, 0x429137a64000007f, - 0x0f25b3bfe2df95b7, 0x1c8e0698a2d83406, 0xb69cf3ed956b9dda, 0xa8f628aa7dd99c9e, 0x75e14edd9660b6ca, - 0x98aa688d54db90f7, 0x94a8c4eb7e0a379b, 0x64ecf5283099665f, 0xbbce0b4d0d4667fd, 0x09942d334d58e585, - 0x8b55b604fe7d3770, 0x1b439b28da3bc449, 0x6e5a019d8b774240, 0xa0d9cde90a9e8e17, 0x4d9c550013aed8b1, - 0x53ab56d627808125, 0x93028039fb4f0240, 0xcb3105016be0e340, 0xa8ee5c7a5a625555, 0x2eaa4f07223cdf42, - 0xccd039b710ba955b, 0xf00b82cb1e01d8aa, 0x010d0b7e12cc6a0b, 0x03e0f40b54cec5e5, 0x0acce021a92be04e, - 0xcb3445d2d95a69a2, 0xec27e28cd768787c, 0x2c3e97a52acb5971, 0x03ae6ce0ff291e29, 0x50f3276226dcc4d1, - 0xe128182ae0267b80, 0x321e3d0109aab1b7, 0x4a54e44a931a595b, 0x7c6502ce577c4cbb, 0xf0f92bddb76815fc, - 0xd036519ead958d36, 0xec2c60d04c1fff6a, 0x224053ff1210b6f3, 0xf44b394670db41dc, 0x61fd81835bd2677e, - 0x0d97eaf32fb3ad3e, 0xa9c33223012349ec, 0x09760421cc6b0a88, 0xc70ad9105c81ab4c, 0x6103d616e2fff709, - 0xc01fd21cb8fe458f, 0x14b7c832159725aa, 0xba9e925ad4f0d820, 0xca21c701b704d1c7, 0x2092a6750c9a7806, - 0x0699e7db5f12326b, 0x6fd941e7fbba1926, 0x14fefc422950e94e, 0x01a7c81f8d5e69f0, 0xe65164f885ccbd52, - 0x5644b3c0f724a596, 0xda4f354460a1202c, 0x19095399de79a8c3, 0xe459fda9257e5f2d, 0xf19f30e7e4c5e0b2, - 0x0fbf23d81c2ac0b0, 0x7758a938248054d5, 0x16aa589e19d112eb, 0x04783f1d054687f3, 0xd9b1038166e8b863, - 0xb1182987acacd25e, 0xd81d2be9c3233c6b, 0xe69641f368d0d600, 0x9f19167c22e0f02d, 0x8f2f48074bf07dd8, - 0xa7175b18daaf0437, 0x0be451657e144a25, 0x9b899a4cca50c896, 0x84fcbdaa5caa9561, 0x6324c34f7a6b3a71, - 0xd7675d4cd2c7fe70, 0xee951a4b24a82a95, 0x7867c8d458a360b2, 0xc1654919ff0d0a3a, 0xda059b9e2dea8364, - 0x61b90eaa228564fb, 0xb64cebbd30b5aa8a, 0xe9b4f0b2821e8e36, 0xc30b11b078d9a53f, 0x062a1bbf199a9c4e, - 0x55d5aa33bdade83c, 0x56b552b34ccf560c, 0x5584cc4ac5149acb, 0x6ba50a224ed3afb2, 0xb4e89990bba2c565, - 0x63fd1ee7e76b893a, 0xda8b19c32447d813, 0xfd891897a77c96b1, 0x9e18265c3c5391a6, 0x158c1e365eb7e739, - 0x85626ec2e1cb8ec3, 0x61e38c2d2f5aaca7, 0x75b64b7f5a94d0e8, 0x3687f040a2d19ca4, 0x07f2a101ed292ab2, - 0x01479f43f28820b5, 0x4bdd4add0c14767d, 0x29be57d03ddc9590, 0x67a91bb450f72175, 0x331c7932a9a47020, - 0xeac1141e863180ee, 0xe71b40179dbfa198, 0xa3a5bb2f6c0a8ec0, 0xca1a521d1f28a49a, 0xe3b4251423a05927, - 0xd298520ac2566269, 0x81dbab9326a2359b, 0xfa6dbd2b42eb0a3e, 0x2f9b792d2ad424cd, 0xd902e777540e6d20, - 0x25b07a241423cae5, 0x469558d8865ac328, 0xd531b1bb926c5712, 0x3fbbbe6321f57b0b, 0x09966a652cbaa66e, - 0xa063f1ffb300db54, 0x8f9df7ccbca0ca05, 0x3ff3d71114a9ddd5, 0x1228a3975f87d826, 0xb812dfc266b44ef7, - 0xe6d8ebd32e0aeee5, 0x7c0e060e4d605ffd, 0x6232f803934bc7b3, 0x3105f689d5b2ab16, 0x7b8b38085cd81dfa, - 0x8b1be7b7c2b28d73, 0x61773f2c2a6daf58, 0xae15f830ecc38721, 0x4866f25ea8ce2dcf, 0x0879acb26cf13083, - 0x79823b43f8c10a7d, 0x83f6c437284c356e, 0xbd51b77db06c4fe6, 0x727d7dbd405b78c7, 0x5b6fa0b7d8c3f90b, - 0x956868319236e382, 0xc32bdd350d7851c2, 0x34e2b8a540aa8587, 0x9cd3e9fc0d0fba37, 0xd3c2834fd9d7b6d1, - 0xbd8e8f1330919128, 0xbaf74a3cfdf5cb4d, 0x18eb5c6ee19f2bfa, 0xbaa22fbe5a28bc5d, 0x41b7e7e35a027199, - 0xa910ba829bec905d, 0x04acf46072c59ff0, 0xf725d7a6adba1c31, 0xd69e78d573bf47c8, 0x7b3b7b6a2de66166, - 0x382fd852aa2c9ef3, 0xb9c8fddbc2cc6e54, 0x8a1d251b157f31f7, 0xaed53936ea9876a4, 0xadbde5b698b9665b, - 0x6ecf984bb68fdb33, 0xe750913d875fc576, 0xbd0e355bf1c07f4e, 0xe3e03db397d933e7, 0xafe11d058e42dd9e, - 0x39913db3873d73a8, 0x7b66ef867be6b071, 0x0217511df88f257d, 0x5fd2fbbde99e19ee, 0x9e9351eb6ebfb5d1, - 0xc2fe19eec2d11cf6, 0xe0eea0355e6b6e22, 0x89f6d3751b3ac86c, 0xc87abf71097d9697, 0xab0f1aa4ecf772f5, - 0xa118b46e923b47fa, 0xbba916ad9b5b6ae2, 0xbab92d36ad3f6b38, 0xb7df9750664ed596, 0xf3819ce5d656c354, - 0xa522cc4c951f29c1, 0x7b32af886b3abbd9, 0xb269b269edc24d6c, 0x64bd03bf05988c53, 0xb3208bbbb05b3f1e, - 0x818b86b474436ff9, 0xeecbdec7686c3965, 0xd3ef8425a6148cf2, 0x6c8e6a9e8480aeab, 0x1109b5d70da78e6a, - 0xe64bd04be483158f, 0xac7f40ca784ce512, 0xdfe53c25ce224ae6, 0x049ee95d0b91ce5a, 0x326cdf0f42b6484b, - 0xe63f817f90d76969, 0xd192e5173becf0eb, 0x41ab2ac3435645a2, 0xc75098d993010f0f, 0xcb1cab5323137e85, - 0x35fbbbaed95f0a2e, 0xe7132b2b59aed8aa, 0xddc92913e438fd6c, 0x52a6407b27e3e6f3, 0x0d02be0e8868dc1b, - 0x1dbfc469c0b40db9, 0x8c10e325b252c03f, 0x8320611058bf49bb, 0x3666a72fca891687, 0x93e2abbe55b33007, - 0xfa2f93c5fbcd5905, 0x989900221de1a7e9, 0x4e2c88af1e5bb52d, 0xe7bf2e57f34626c0, 0xd906a250e53fd542, - 0x2bba6cf9a5b5ded3, 0x7a5546e2d9b2454b, 0x712d1d613af3d08c, 0x5b5b0bb656645059, 0xdae9c7c6512d6d30, - 0x36895d4a97c418cd, 0xc906f87e7efed69d, 0x5e497f81c9e31a6c, 0x1e1b8bcbaaeaa557, 0xa5a6ad810df1c7a2, - 0x0db1e0f2b12d21cf, 0x59d6533e4087ac22, 0xf498d348f0d6c07f, 0xceca7b669e4ef509, 0x9cc4df33652157da, - 0x4e42f20744ec7c21, 0x13566bbcd96b0358, 0x877ef1059fd41670, 0x767f7cb93725996d, 0x49e693becf5d2b06, - 0xe32293159c80c7ac, 0x49b272dec70ee84d, 0x21c743d4418bcb05, 0xef5b7ea57940d91e, 0xfb66937f338525d1, - 0x63715ace39dc44eb, 0x3e3d53f53290a55a, 0x4057bd90ae984a57, 0x0ddf025f57df02d9, 0x93d482e9ba65f327, - 0x04a7d06cd423f41c, 0x4c20e3e1b9f3d3f9, 0x2ff36ee3d8c5c5f1, 0x739721374264a2f5, 0xe4029c0a2838c077, - 0x5f867e38354244fa, 0x074fcdae42d45b86, 0x444a8b05299139d3, 0x78f413f7b04c9b99, 0x9271626c28159137, - 0x71410a479647069d, 0xe95212729aa261c5, 0x5f486ef76777e284, 0x2069f5609c8e7a70, 0x29c5f6be754c6b99, - 0x77a2a8d8bacf1bf7, 0x04d30b2bf9c50dbc, 0x85d0a2a43ed1e644, 0x91c9a416a3cc502a, 0xf965b002eef929bf, - 0x415a909d7bb430fd, 0x28a389600a295e41, 0xdc338c0c0a242065, 0xab72b51711726907, 0x7a0a6ababe3dcd63, - 0xfcd5a440820a33c1, 0x77b1abd926d37616, 0x8905542ed3800878, 0xdeff6ed09b8c67dd, 0xe9bbc0e62abfc5dc, - 0x0425d9b8484ed38b, 0x24390ed2a3406e76, 0xc16a721c887c8f28, 0x9dbe377a8b36cd15, 0xdc51ffbb762c889d, - 0x89ebdb2384b87817, 0x131ca4cf30f7cf4f, 0x9e0cd89addf135f1, 0x36a6f1a4a260ed2c, 0x1c6c612dc4524a5a, - 0x419e712855628414, 0xcde9c41ecadbbffb, 0x9258977ec7bbf51e, 0xe37ec9deca10c0cc, 0x987ccd687bc599eb, - 0xb89a10afd0f67708, 0x51a3867b861e5dc1, 0x2e2feb5c7acf6665, 0xc65a40bd3d9dcaa6, 0xcf392b0c164bb0f7, - 0x2bdb4ea4cf34afce, 0x6e898f89cc7a0bdf, 0x33a48783fbffbbfe, 0xf1a00b4e50ef8c0a, 0xedaa40d6e138d3c8, - 0xe75b926550e49ae0, 0xc8b55c6cf537b936, 0xa07f78bcb2eadbf0, 0x3a66957d5f1f5f40, 0x450bcee2aa61a047, - 0x50251694c91eac46, 0x159596b548d1688b, 0xed38d16c2920cbcf, 0x48293e43cf1dc909, 0xa407af125d7f5fee, - 0xe9ada71e71015f4c, 0xc67fc0da328c2b96, 0x3b37a2a2deb12389, 0x1ba430716dad009d, 0x24e1851557b6f026, - 0xefd532b2c5c69a01, 0x511f1767d5b90304, 0x66015dafa11832a5, 0x3492cb00515f2876, 0x88774ef07860fee0, - 0xa407899ba524ece3, 0x2145dde670bdf0f1, 0x25c179296a3730ac, 0x6e0001e7280c168d, 0x02e814389c5d81ab, - 0x0305a9da05161a9a, 0x6a92ac8cbc378f97, 0x2bcede678d1c4720, 0x981e83f2aa3960a1, 0x1b1c9d58d2cf4842, - 0xe1e6f875100b509d, 0xdc85ae0c34765028, 0xc69f77dce85910ec, 0xa23bbb5035127791, 0x7ed757bb88babbd5, - 0xc29c7e89b369ee02, 0xee7011faf925a490, 0xbe26f19d1dcb9b92, 0x29dece805ad9a436, 0x8206929288084191, - 0x795082bd44bc2a09, 0xdde2557788879f0b, 0x8a17ba43e84be83f, 0xe87a4651b374bc40, 0x97dc310e6725c697, - 0x01abce6dc9a0fb85, 0x8ce2c5a595b30625, 0x2800fcdd18c4d161, 0x9fd5171cecb65031, 0x751e689ebfc540db, - 0x0493443e837c564b, 0x700fed6a6043f133, 0xcd6c7e3a29f9662d, 0x0a02a849ccf850c2, 0x2f8b112941a7267b, - 0x4b621dcb08aac951, 0x1358a6379b0ab85b, 0x4f818017d9b45166, 0xea63a96a2c26b091, 0x89574f4cfdd78d57, - 0xcaf6ec8f9659c98f, 0xbbc321a944faa55c, 0x74c061e4aeaaad59, 0x153aa20bfeeb9c12, 0x3f945ae044dabd00, - 0x8a16cefad4c03c60, 0xf87b5135f3cd1a25, 0x3a2fca51aabb7070, 0x8e1dc6f0855e5ab3, 0xf0cbd1efd80571c3, - 0xee224dfa5b349e89, 0x78104906143c0011, 0x9275a290065e21e2, 0x5e708d4981284812, 0xeba3cdc536b0437c, - 0x748d654f61aa304b, 0x3ec11ccc5a054886, 0x5c8206588a7efa9a, 0x6e4bc50510e8b565, 0xfc77128ac1bf56f8, - 0x23ad8f9d186663cd, 0xb5faa6f955b240fe, 0xcd58268bc330c5eb, 0xd46597538a2e1b9f, 0xb9c2561c64926582, - 0xbc4b3acd9843492c, 0x5e7cb1c73135758e, 0x302798c769d6f727, 0x5d84d67492032dd8, 0xa2873583394e8bce, - 0x003e1d2c270731b4, 0x7a73c94e2d04aa4d, 0x4e2d2429b5465e05, 0x2bce11a117672384, 0x286e7f0b6f04a3c6, - 0x7b0a52d83d011fff, 0x1fa0a88820a7e9fd, 0x0a3ea7a1be83e0b9, 0xfd83979cf2c31429, 0xf4983a195f72c24b, - 0x4a780ec2867ffd44, 0x159e5f9c814bcfbf, 0x7fa4dfdff64fbbbd, 0xaba7c7a792f68cd3, 0x10cb471ad81fe0e7, - 0x77dd1efff865861f, 0xdf43bf837f7d4759, 0x0295e48ef15b5e06, 0x534e783ad530fbdf, 0x817abcbae8032117, - 0x9371af3f9deed4e6, 0x08f8509b0d66304e, 0x052f57931b2f069d, 0xef06bb10231c23f4, 0xcba8fbc7e0b44bac, - 0x2b5cc593bd53729b, 0x71902f0041f30c88, 0x3f6fbc9c765e0c28, 0x7af4700e2d94d59a, 0xe202e28e67dd3887, - 0x068ce45fc69d2fff, 0x677575f7568ff1f8, 0x010f9f0956c5dafa, 0xdaed290fed4b7260, 0x0817e42fa03ce688, - 0xbcaf28e430d174bf, 0x8ced5edf60b28ebb, 0xe7f7d4ea973a55bf, 0x7eb9faeb717ded4b, 0xc7df9d92541a0eb8, - 0x3f7c701e90b77637, 0x5a8e3425d7991220, 0xfa9759e7a806e4c3, 0x2c653c3d83e806df, 0x28d187a723fa7cf1, - 0xe2b17cdc7bf04d0d, 0x11786d6c0750c8fd, 0xa9db01ae107062f0, 0xa20befb13ffa9f34, 0xfbb5c653acb49a4e, - 0x161ac1d7e63df9bb, 0xbd257f1f3f4ddbdc, 0x1fa01147f4d77891, 0xd4d61ec1a1c30fd3, 0xce97bfbe7d3c3978, - 0xf9ebdb2f3dbe680c, 0x93dcd5ebec9cc1b9, 0x0a5e37d0f5b8ee8f, 0x98b1e5432f7399e4, 0x7a627767d8832743, - 0x4a567fd2da868601, 0x956aaa45af5aeb9c, 0x2631a2df0c5e536c, 0x1efd364f5959f792, 0x6f06a441a71b34e0, - 0xe3d15ded8f8b4249, 0xa73617a4d9516859, 0xce656d082d906003, 0xcc00e0eee2a85d3b, 0x4cf8264880d2cdb5, - 0x8e58dcc21ce63b40, 0x533d9e3370aac862, 0x03713237c8fff9fa, 0x0cb4da619f78fdac, 0x0b474190254c7d15, - 0xee39c267070f2dda, 0xa184b5f511b178c3, 0x91e7e7c41df6b809, 0x361b85069a38a071, 0x1cb8c8a3643540de, - 0x2a532007b737d7ef, 0x3ea22747b3bfd3dc, 0x022bd6a2d6825d3e, 0x5afd8d2058e14587, 0xa779afdf47e4a515, - 0xe0015669f838ee77, 0x8fd9a4eded157820, 0xdc190cad84ca1667, 0x1c6815f83c9f3ab6, 0x87ce9d5d69938efa, - 0xb2b4c575dd789e32, 0x5c113db338793e9e, 0x3c8246634c602ec8, 0xad1e69ea3e510029, 0xdc04cd6bba2e11e2, - 0x83fab50620684d2b, 0xbaa8e3050cd7673a, 0x88f7114ee5f437bc, 0x83de6a166a1251de, 0xb8bad93035e779b0, - 0x0e05dce28838252d, 0x78ddf87ad6b9f51d, 0x490d334dd1352304, 0xd3eed5b4f57cda18, 0x551d4cbc1c5824fa, - 0xf58cd8b07e9b704e, 0x62a72169fee472e7, 0x5298ad69c60dbaa1, 0x27c49407efc8ab92, 0x68a82ee469f21a37, - 0xbf87a1bf41f37998, 0x79eecc1d99222e22, 0xab39fa175d922808, 0xb7f807ec2a46e0c8, 0xba1cbf45c3d0427c, - 0xc2cfa42e22a655b7, 0x3698bee0f6bcf070, 0x84cd397d86ab53e9, 0x2e9f03b2048814e3, 0x0371587830827200, - 0x62cc07359d2e7aa1, 0xba3c805928ef14af, 0x244dfdbe38096560, 0x4584a889ef79afb7, 0x948e44eff699da06, - 0x915b4e2ff6702fde, 0xa5a41ff9d2c58c44, 0x7a29c8e81fffc3ac, 0x3096e8abb24e5976, 0xb6df65fa49da2db4, - 0x238661b29517b597, 0x299b26273258eaf2, 0x49ff2d36510fa050, 0x7bd0515c85e2a17b, 0x3805eada945c1ae2, - 0xb1c46d5ed285bb1e, 0xae46bd83f90c8ccc, 0xaf24063bf77d6962, 0xed62f341bf96e21f, 0x77277e375060d172, - 0x2e71b15feffeaecc, 0xf15fe6cd1988537c, 0xdbd5b694c5d621d5, 0xc4dcb02560d94832, 0x75cc0b354ca6f96b, - 0x8f7459c9bacab761, 0xc79488a8769d07f8, 0xffa817cb940b982a, 0xe9a5782bd80b161b, 0x1e12de5d78b4434d, - 0x46d9a5d197b64072, 0x8f1b54bf99222604, 0xcbb0e8ffdbf0eae2, 0x8c1e17e551c19019, 0x19f0d26fe76c4b95, - 0x388b1a9df229d61a, 0xd10fea0409b9684a, 0x48c6d8e04da0cfd1, 0x1fa18e86ee1442d1, 0x108d9c908756a6ba, - 0x5261244e3aecddc8, 0xd16b8436effef1a3, 0xf1e634c0016fa0e1, 0x1d2ab17a83d9a9db, 0x14d0390f3e491ba3, - 0x00c959ea5075d9b9, 0xa707275ea67ceb1d, 0xe815be8893e90d78, 0x97395122fd979edf, 0xcb15fdf7d083296e, - 0x849e24131e67781a, 0x048c66b2c8ae689c, 0xd98c78b4d472b944, 0x47aa20406f8df56c, 0x234e8f47165158c6, - 0x347d8e46fa466a52, 0x246dac3f9a012c61, 0xe8d452101ca5977c, 0x88962201a5a27839, 0xe6f9400711396299, - 0x1908cdf2ae1de3db, 0xd158146cd217842e, 0xa767a0e2c5ef1bb0, 0x506a1bad5b6915e3, 0x6a5a9b88aeb1582c, - 0xe2222f27659c8e5e, 0xb1d53c2de81ee629, 0x116a84b759f7fadd, 0x1370038d6ba82919, 0x4293c4a9be6a310c, - 0x8303d0505b6c63c3, 0x9e845e6054614145, 0xf7357852230a3c2d, 0xf7b633b929dce4b2, 0xf59d615912bfa1a4, - 0x92e2a58d9876789f, 0x3bb66a9f631d81ac, 0x8d5ed703a4623be1, 0x74f062f532a2dba1, 0x31a1800cf9810180, - 0xa19e9d24c4c6710e, 0x49f1360e32fecdd8, 0x8b70525c29861c64, 0xa7a3f10b29398292, 0x3186ab2d7d9c04fa, - 0x245113cb793ee0e7, 0x894c63eac240b2d0, 0x683ea3e0d5a00ac8, 0x60aef38bc1b839a5, 0x6f0756c9d167549f, - 0x5f500344c74d1e06, 0x55854a5f7ed7d8b0, 0x05671381d448ae3e, 0xb47ca0dace7acf3b, 0x63b712fbd8783e6c, - 0x9a963b5772dda1bf, 0x5c72656fe5575bd1, 0x17add393f26f5c3b, 0x43976a456d30e266, 0x8442f3b35b788b06, - 0xaa56a5bdb057100c, 0x58b2dded7dcb29fb, 0x84f5880be38a2682, 0x5ba79316ab062cc2, 0x5a12e200a686450a, - 0x6ba09b88fc1f1d33, 0x6555bd1f6cee639a, 0x2a27914d14710a87, 0x65b60ad64ad87072, 0x8baba16de6e61121, - 0xe882452a6c6fa2d2, 0x71f3eecdc09ebae1, 0x322cd4df5d773cb2, 0x04214bb9df29270a, 0x6e025575574b9105, - 0x55ee6bb220243352, 0xa04988a558fe6c2d, 0x74068973f9c88272, 0x55b82e734b93efbc, 0x503aeb78265b558a, - 0xe4bdc8642b689905, 0x9e5fca6fb8400f36, 0xbde38aae83f3b79c, 0x8bab9787b004a69c, 0x77854aa406051319, - 0x5309e702dc62708a, 0x9d211f075c1573d5, 0x62c055365bbdafc6, 0xaa0fc456f5efaa00, 0x73998ba916295464, - 0x98bfa11a4caaff32, 0x1ea944c1d9d0c954, 0x18a394706fdf8822, 0xce14163d2bc0070d, 0xc8ad4005272864f1, - 0x88a5c544deaf348d, 0x0bcf817e1275013a, 0xa821926945ad1819, 0x44e56db9447039a1, 0x1c893a685c05cd7d, - 0xcb58a48f91886b4c, 0x8ca9b5239d839b51, 0xb02e849dc73e5648, 0x63b3bf8d4d6e2207, 0x471d6b8781d5e562, - 0xfda3485214b69222, 0xc7e498ee71e63019, 0x2a39c25a5488b670, 0xea887c7373711d1b, 0x3dc52ba5312ba854, - 0xfd270615aaa87eed, 0xb439edc9ef5c555d, 0x42d8e8fd56494049, 0xfb49de9b6098a182, 0x601de2dfba704930, - 0x6a587bf529b921d0, 0xefbfc47912e591da, 0x24b744336b61dc99, 0x3c9aeed69ed45a35, 0x48fe9f0d440c49f2, - 0xc849132ca9ef0770, 0x6280cba23dee8c1e, 0xcdac9c86a2744547, 0x4d0cbcdbf9577795, 0x0a4d5b136c96fa2a, - 0x1c12addd167707f5, 0xcdfa379239694d49, 0xbf517b477f5dd787, 0x5778455980ed8595, 0xcd4d9f874ec23ce8, - 0xcd927f92a92f009c, 0x04dab2be110ac72d, 0x493e38e7c66eadd6, 0x0210fd21d7c17fcd, 0x538aeb499eb436f1, - 0xaf9624103174540d, 0x804483c93c4ea932, 0x0d8f64c6d210bed5, 0x1f84a074b4d6fc87, 0xc21722614c3dfc9d, - 0x17065e81612f98c5, 0x6834328bc5c13cda, 0xd81d7706d429dd22, 0x2de8f5eb240d3031, 0xff8c1b093ae6818f, - 0x91039920e972600d, 0x44a3eec66376b0ab, 0xd62a89f0b3a3769e, 0x20c638b2c73b1106, 0xda6373a432ece898, - 0xa9ebbdda2e5c2a6c, 0xb6dd8af7be2026f5, 0xe1edf1da2e98433f, 0x4dd8f117ccbdeb75, 0x0b223af0f031244e, - 0xf84c4a062e0ca26f, 0x0dcb7ad21904ad89, 0xbe01cc2da6503cc1, 0xbf3b1248b2bdd687, 0xc240b68926ed8da4, - 0x1185a6efa149d0ae, 0x73e7d7a365944e61, 0x63ba03fa6f0ce733, 0x50ec7944f668e31d, 0xa82a3dc6267c52f3, - 0xfd2812dd4aa78dba, 0x8732fb41195de131, 0x2c9d2979f5c1cc23, 0xa439e360956c60a0, 0x9b496ebf06f01d30, - 0x64840c7746310a4c, 0x0d635c876f0c7283, 0xd100f2c68f10fe9a, 0x7d05edae76eb1d57, 0x050cf3d114ca547d, - 0x3987a1e2d3ff610c, 0xbf06a44931a46d86, 0x0548bb64a331c57f, 0x43ac8dd62d6a8e5d, 0xb5dca821b400176c, - 0x68ca00418b907637, 0x9b6ec577eb3703cb, 0xe30f7b21585940f0, 0x01107c54b386dfae, 0x3f7df9b8deaf07e7, - 0x107617d79886a173, 0xd4f10b8ce005e3ba, 0x8dda839d29fcc4d6, 0xb1e2b071dd4a2232, 0x0b414a3364965d5e, - 0x71e43fa5aea042c7, 0xc4e5de70c8022d0a, 0x542b39b1c7ca6f4d, 0x3788ef334790dacd, 0x78b378b29291eb3a, - 0x179dd6754dec76f8, 0x1e374744969ff0dd, 0x0bcdee1e6d34e086, 0x4e6885101a33db89, 0xbbd3e8a6519a500c, - 0xb03d723db3cd0698, 0x07e087b31966520b, 0xad4b9db89dcc1050, 0x32209b0ac0ebddab, 0x1a4a4bc60234aa80, - 0x3d0295bb2d7aed4c, 0x07622845b73083ae, 0x85589035af346adc, 0x281992944eae23c3, 0xf4455a1ce7eeecaf, - 0x65597c372f405002, 0xcbe66b0980a531aa, 0x4a230dc171cfebd6, 0x5179d79fd638355d, 0xd202c2f866a746d0, - 0xa50cb47072249672, 0xbeb17fe3acfc3b71, 0xe3df55c583846d31, 0x7248786d377d21f3, 0xfaba6ae596a3086a, - 0x8085b61433b7c8f2, 0xafbf7b6bb345237b, 0x4401a9b149642ae8, 0x07e6891c8792574f, 0x7dabff30199ca7c6, - 0x107177f6a428200e, 0x619a33432e141734, 0x9415ce95ddd9d017, 0x6f7ab413bf519fb1, 0x298c7910f91ace67, - 0x9147359262058f1b, 0x3cc0f9d2c34ad708, 0xc2eb578f384231fc, 0xf0a6be357e93ab77, 0x0537f1291425c93e, - 0xf42fefa5f0e57503, 0xba915af17a0d3efb, 0x47e472e32d9426a1, 0x7c3de9237405da96, 0xf2d28dd5d04eaf61, - 0x33ead6fa6d00c32d, 0x355d3ede27da934b, 0xbb04f1c057ee9369, 0xe7ee46e3674417be, 0xdbf8bd4bdfafe8df, - 0x8dc62fa0947ebddc, 0xdba835beeeb2a016, 0x6a134f2f2f567f81, 0x27825378db60bba0, 0xc1a769e1598c61e3, - 0x8ac431868d33e2e2, 0x673aadbc9812a8d2, 0xc93b273b344bb420, 0xc489ae9f05228eed, 0xf14c752fc3d8b108, - 0xc5e07a9fca3b750f, 0xfd0062cfbd21e932, 0xf97530ebfef1e41d, 0x79ed6344fe3384ed, 0x091c14d0eb1aebec, - 0x1cb1fd0cc2e1f157, 0x71547e9f11130fb1, 0x079030db932b8ee7, 0xc42ae76c9ae79bae, 0x540c2baf90cd2ba8, - 0xa0915c60490db462, 0xb0e4a481a4f184a7, 0x58dd7cbe7021bd00, 0x3f772c534c44f374, 0xa94114cbe7b2a2be, - 0x78291063d3193f3b, 0x3d0e397719cfccf9, 0xec39d75394f4e345, 0x658d1f2f7cf99059, 0x361efd88f5fc7c04, - 0xae58c0640b9d66eb, 0x11991ea94e6e88c7, 0xc379e2a7224bc3c9, 0x230a0c37ba381210, 0x25ad4ceb27d75c46, - 0x7b2d6933cd750a39, 0xb2279dece39ce375, 0xd3fc6158990e9d31, 0x9d787c340c30b3db, 0x9b3ce5a2f28a513c, - 0xa39f36b7218938f4, 0xcb0dd529f76168ef, 0x7b4ceb2adfbc7452, 0x48bb826422fa9a29, 0x14001f50469fcf77, - 0xcc5d3db636614612, 0x960f0e347e01c4b7, 0x63c1e5187b2fcf3c, 0x74e2baf270585893, 0x281f753618beda22, - 0xff81651d1243a3aa, 0x612383d8133d9141, 0x44e9103b007fe065, 0x10d73effd87c1d43, 0xce2ea73e1708ccf8, - 0xa4fef5a584c7f212, 0x7e8d61f3e3cd0e33, 0x4bb4d3d916c31132, 0x979601c5ed23f23f, 0xd276282374ec1ea4, - 0x3ad7efeef13e67a2, 0xb03d078f86ff1a6b, 0xeb0c0e80ab580c73, 0x10626cc7df1e8921, 0xd219e828e73b9e20, - 0x618a931a955ef5da, 0xd2d2d58d53656a9f, 0x9dd40fc1bd356869, 0x2c20d737db5d8117, 0x6e6e11d25f209e47, - 0x2e8be1cb76d110ba, 0x444bb6e7010f6c37, 0xd23fab77ce5a7e70, 0x8c78b778a4cb6ed4, 0x25a7c3597375af6c, - 0x838eb181b94713d8, 0xee7ef145b71c82b9, 0x4100f7f1f68a18e1, 0x0172b13aec3c1a9a, 0x3fd9d5af41c0adc0, - 0x41c3faef88d7b4fa, 0x74bafbdbaf93fff3, 0x5bebb7fff39b0ad5, 0x0acc115dbb25a746, 0xf97917c9865df9e2, - 0xad2b5e379da172a0, 0x9dc009b1656ee095, 0x2493fbc9d6be0e5a, 0x9cd5fbb085310dbb, 0x68f32bd6bd8f9c1c, - 0x2de45538a2ba3e9e, 0x4d20bccc8d24f68c, 0x92d042a14acfa213, 0xc84b8c4acea0a2b9, 0x45e5c1724d26d053, - 0x3818e9bd7beee792, 0xa62d745f684e2064, 0x59ab13085cab76b0, 0x95c36b24e682431b, 0x8a74b74676702bc0, - 0x1368e75247215cc2, 0x04be06c420c02380, 0x531ff29f07a405e0, 0x1ca1dbd70252be80, 0xcaeb8d314a0f733a, - 0x07b014e9853ae137, 0x3afbac80b36697ae, 0xc727fdc0839dcf7b, 0xf94605bacb2893eb, 0xbae2f6a3a248da22, - 0x799c22287f02c87b, 0x3391c617b1e89e6b, 0xe4359bbc1d91ff9c, 0x5d766a031f4eb4e1, 0x253449e6e64fb8b0, - 0x4714a58a5fabc475, 0xb7d72cceba9086cb, 0x335bf1363795840c, 0x73265f3fe0efe2e1, 0x162a7f96ac657b73, - 0x8f9cc43d400f8493, 0x4ea1a4aa23480036, 0xa19ca54cd3e4c8cd, 0xb098f54458fa5495, 0xa6f9c9112ade941c, - 0xe981c9689ffc0564, 0xb4342bc87cbb8c4a, 0xc6adb38abbba6406, 0x0931e58c506c9b9b, 0x0d3d7c66b84b45ba, - 0x8c72f41c77ed5e97, 0x4d7874c085ac05f1, 0xae24a572b1a2cb03, 0xcf9406c9277a03fb, 0xc4c842767cd36cb2, - 0xb71afd03f14905ef, 0x9cbdcf23a69c0de5, 0x293d37436e851f0f, 0xfcf12c3248c88e6a, 0x8dc8136faab6ac87, - 0x1cdb360316b80d76, 0x2057db68ad0e1e91, 0x0fb841b3037974b0, 0xea020deae613ec5c, 0xfa6ff065e70996c3, - 0x974ed20a0d80c0a2, 0x78707bf5e72e699d, 0x61f19f8de7c3e367, 0xe349cf5f6381e6e0, 0x2f33a8e7778770c0, - 0x7ce5eef25267b4e7, 0xdd9eda9bd0cdc76d, 0xfa17490bba546783, 0x136a4939a58e20a2, 0xfe1cad9ee1f92080, - 0x8d7d376e5154c239, 0xe27992dec296794f, 0x0f6359e13cf625e0, 0x14c4493aec8d160a, 0x3ff2a337151352ff, - 0x1a5f9013af2edc40, 0xc843b1bf0e87d5b4, 0x52346e8bdb64455e, 0x57fc6824b80c03aa, 0xb567e6135832b45a, - 0x28ae0610070080ac, 0xe33ec21e5190a8cd, 0xa8f04b50bdd0f3ca, 0x94db8aca3d19cfd1, 0x69aedcb64da4dbe1, - 0xb013b282f6a63f3e, 0x5e4cae52d80edcd0, 0xf9a2a64d17c5838f, 0x5c8d3acd9a8a32a4, 0xa3cadbd279d0abf1, - 0xfa207ada390d4f39, 0x43f958f44bb53bbf, 0x885af5bc23c797f0, 0xb3cc962950a6a375, 0x6a5bbc5267cb2a04, - 0xb4b46f0dc8fdbdcb, 0x946fd95be1336154, 0x3af8b720b5bce9c5, 0x785da05ee5705739, 0x0b8b2649480a6fb6, - 0x54d877d10d9897da, 0xe46ee44a1ac8ddb2, 0xf1d60d4fbc5222cd, 0x8e90525ac7f4f572, 0x0f91e08483459e7b, - 0xbea0efdd6d38b1aa, 0x2040aadf277a9ae6, 0x6adac1b980a88bbc, 0xb857504bc40728ef, 0x8c18046d3c40c96b, - 0x2261cb396ccd1626, 0x727f4037051b2854, 0x350b3e02dd1c764c, 0x969481c651f6a88d, 0xd4889377004e4cef, - 0x832b336314bd2877, 0x2a2ff36c244c5434, 0xbd15a92913b10b02, 0x9c792c4603246bc4, 0x3dafdcf57f6bf517, - 0x930b7e2c11e0c6e7, 0xb9f5b213e4a67d7e, 0x7e4ebe4f67fde8ca, 0x5d66c1c56467baec, 0x4c77a098432cb1d2, - 0x3cc89a5be447c933, 0x126fbaf74b40473d, 0x5d27c15d6a566155, 0x9c05bbe3b3c0aa6f, 0x9c92ad525e13fc4f, - 0x35df28c92d23cd2b, 0x9920e6aa5557dc0f, 0x637df49522a48c8c, 0x8a119c23d2cbcf40, 0x1c0920770a9786d4, - 0x8486dd278c3a6dcd, 0x4bc6cb70acd139ab, 0xf8d6552b8d990fd1, 0x33d242362f3c2ea5, 0x361b628e161c81aa, - 0x795171004a095d6c, 0x45f454d6c2a1b94a, 0x116de9a956765c4b, 0x49e1b65495c18092, 0x6729c7910b492a26, - 0xf48dfa2f36e19c3a, 0x674f161b483ad1ce, 0x39774e64295cc72e, 0x172c59280d8a1402, 0x7855819b17347138, - 0x4c17b0627594aee3, 0xf2833fda01375be8, 0xe5bc99c81f2ce2ef, 0xd14bba540b0d1145, 0x12de87b39cf83878, - 0x9d21451e308527e5, 0xad3b6b7513fb065e, 0xa1ddf352c3c417df, 0xa07e632e62e6e7d8, 0xe03b741a0e765e41, - 0x3ab1fc6b1ae5f80a, 0xa55b722a24444034, 0x96ab033a43ca72ae, 0x47cad4ad64d3a80a, 0xcac73068e0249318, - 0x995f7c41fcd3c0a4, 0x8278a8eea79d62b0, 0x84a062c4c8645954, 0xaedd25ac5a20f801, 0xd6987410a401d92e, - 0xc458581102a4d353, 0xbc5ebab32eef41b0, 0x23f945cb723765ba, 0xd276e6cce727050b, 0x2d35ab2dcdfe3cd2, - 0x4f7202700b22965b, 0xb788be2b93be4ad8, 0x2367c39628c7d85a, 0x132be00452e5a61b, 0xf5e1628e9bbffb54, - 0x9dc67bc28f356908, 0x9ee0502fd40b412e, 0x2b228cfb9256b2f7, 0x425ac05f0a95a335, 0x8be87caec762a249, - 0xe422be244a442eda, 0x60a294640cf645fc, 0xd74425c31e1125e2, 0xc450b1c4bb58ca69, 0x9de0b0e11356da8f, - 0x354dcc1639640193, 0xad09f6c8082a9333, 0x67463f1efe40b6ac, 0x1334450a31f0cd19, 0x4a34064e9a4cae1a, - 0xc1b01cb54726431e, 0x0380e1b87b4c6225, 0xb2448a14bdd6f8a8, 0x41bb3839cd84202e, 0x4105845261726477, - 0xd26cb6c68fe824c5, 0xf4934f8949bd4391, 0x4f4d923b210bee82, 0x94e833c8674bb8f4, 0x2ca65af884d73590, - 0xb2e4ab4f16f16044, 0xa7bf7f8f99015b46, 0xace824bef957e766, 0x86505a060c61f32b, 0xddae0e493620e943, - 0x75d39c78544e3d04, 0x2f338b2b9255d518, 0x76c601fd4a27849c, 0x66c3b0852e0a2dd6, 0x718058c582e82eb1, - 0x8a87ac11419a0d73, 0x04d4a5efe61c5174, 0x11861eff41d3b071, 0x4e2bfa84fc32a122, 0x503067cb24680688, - 0x3bd839c598f49958, 0x8992dd5e9b379b62, 0x4173b6d375927057, 0xf20c9aa5561251a4, 0xbd9ec72103d138e0, - 0x3fed60fd1f2a3dbe, 0x7a0c13a44358b034, 0x82cc03ca04277cf5, 0x0d320fb0f71861cf, 0x3b5c44d173e0b618, - 0x81f59c36d1ea79bd, 0xf31cb7ec19ff596b, 0x1fd2687848cee492, 0xf045b3ffb20fd7c1, 0xe406194ebedc7e3e, - 0x7437b4dbd16b70c5, 0x5a5d82413367b2e1, 0x3ebfd141e0d0d07a, 0xc723b9a877dea1af, 0x7993fe600940fa83, - 0xdc6b9e81831d40a4, 0x3300c407f3b1dc30, 0x0fea8b869929f139, 0x86b9b5eb26548789, 0x09a36162c2789858, - 0x3a947b7d8d0feef0, 0xa433aff79ac7750a, 0xa99cd83467a8b6b3, 0xe6bc7e5c7fd3bc68, 0x9e6bd044a230baeb, - 0x538ea542aac84421, 0x9d332c3528c3d08e, 0x0725471194c9084c, 0x08c5e3fe0ba8c890, 0xb771a2dbb7e4d83f, - 0x2c6c685a5fa87e48, 0xf502abbdc3b8918a, 0x70f341eb079e21a0, 0x2753a93c14c892de, 0xe968202d2125480f, - 0xa4a5e7a56757f340, 0x44e9ed9366e77963, 0x0f3b046421d9ca62, 0xfcf5bd12025b1ebf, 0x0962961b53116338, - 0x22186391956382af, 0x08e919b490c617b5, 0x24a32704acb50fb0, 0x8e309e03e320981a, 0x942aca9c3424bdb5, - 0x8701c7c2fa821643, 0x743508a1af07a32a, 0x22ec6cb4d7f4332f, 0x88e575c833d4cc73, 0x8c6325072ebacc8d, - 0xab83732370bca722, 0x27d58dc00993cd0a, 0x9bf4f77834eaa085, 0x46a39f15a3018dc2, 0x9b2904b2d29c2aec, - 0xa26e9cec526b1c02, 0x419fd1153098b3f1, 0x0ae581c590ed2a50, 0xad14b8c6040104b2, 0xc766c8344e8e6ca7, - 0xf153fedec531e8db, 0xf2919f8263933cc1, 0xdb9c2a073b99d1ec, 0x939740912d744884, 0x0d58d2545934ad74, - 0xddbfbf8440e40a43, 0x053d349d5db34218, 0xd22a0e162a0cc30e, 0x0a785aadc9a16d56, 0xe873446a6c1fadb1, - 0x0340606cc28e3cb6, 0xc5538777e0f1841d, 0x7adc13ff1ef73582, 0xcd0372e4f1bad157, 0x37fa5fa9a54ad65b, - 0x3502d375112c421c, 0x55874e3d28e36886, 0x5799f158e537ca3a, 0x7eaea41cf55f7706, 0xa4242c2e3922d526, - 0x2da2dc585f41b55c, 0x134726068bb8b9fe, 0xa90a6c2006315e49, 0x85fd2b339581ae85, 0x26d0601e937ffac8, - 0x49095431fc2039b0, 0x941449a370a29c0d, 0x861ba29e527f2748, 0x4a1bb36269735cd6, 0x35180f58326387e0, - 0xac32e23cb8701884, 0x7ee7e0edef5835eb, 0xa0f1fbe4f8d68556, 0x4300847f218c9874, 0x5efbafadfef69ded, - 0x7b084d1126f67a1b, 0xf85f9278a7ffb0bb, 0x512879a75b2cb97d, 0xe7deddee9d24f1fe, 0xddbb1bf7df26891b, - 0xf71e3e78d84d128f, 0xb78feff74e92c4bb, 0x77efdebfbb9d24f6, 0x4fb61e6e3d4c121f, 0x74fb5bdb69ef27bd, - 0xfec33b699bf7b71e, 0x9e143aea1edf3fe9, 0x3e288ca8bfd5df4a, 0x7ba7fff56ad836bc, 0xb71fde6d6c6ee3bf, - 0xfb771b5bb00edbba, 0x7bd7ab82c308a2dd, 0xdfd9dabcd786df00, 0x774a1df5bfdcbef7, 0xd77b1f40e6e31ec5, - 0x2ffd013dbaa3fe5f, 0xefbd6e6b208af798, 0xe0d6efd433969fe8, 0x673626a76fbb9c76, 0x880f53da84517adc, - 0xe19db0bf07f5feed, 0xcd8d9246f1ff62a3, 0x948846cd79c0f51a, 0x8e5d5e5f2f679d08, 0xbbfc3fa0e79b4194, - 0x4eab8857c76c982f, 0x0f1d946f068d1f07, 0x1d86a646fdaf0271, 0x8d15ffcfc6faf61a, 0x3c4f106477b61ede, - 0x7978effee6e6fdeb, 0xc6dfbb9d9760432e, 0xb0a85b3626b9faee, 0x7d4cc16af944f8c9, 0x8e88b3eef0c45cfb, - 0x66b2632fb7d5f64e, 0x9992716264e3c41b, 0x7dda2122aa7fca9a, 0x5a2d0c983cbce82f, 0x204e7cf6b66643fd, - 0xdaeb5110eed660d8, 0x7077062e38abae57, 0x8bcbda776dfd408f, 0x6989b5d9fa71902b, 0x7170d18578a3f5e3, - 0x3a84dbd019e3495b, 0xf3059f8f94b7b4b0, 0xc962c992a6d5a1cd, 0xe4255cb7f627be38, 0x0a421cdc1bccae56, - 0x818ff5ad42d1afc0, 0xbe292f7fa7505eb4, 0x274a2bdc85d70834, 0xf80778078773f8ef, 0xdc0765d29fd05c60, - 0x8083d604c26a7e24, 0xad412d3c58264a2e, 0x44698dc262d25285, 0xf4eb28242cec9bb0, 0x9acd93721066f787, - 0x3370e3f35e9f035a, 0x6a46a596f515fdf2, 0xa2df833ab289ed85, 0x135ae2e33a08021d, 0x027f633fe8f93e19, - 0xec24b4ef4d06ac0e, 0x9b651f150267732a, 0xc7049636115de13a, 0x261fa508bf0328d8, 0xb9eea2ce37a042fd, - 0xcfc64bf2cab3eeb7, 0x25e7fb9f3811295f, 0xb667c7d67858a141, 0x15241fc7247066a5, 0x65332faa23a57090, - 0x72cdeabdcdb0658a, 0xf086cb5696bd9987, 0x61516f5193950744, 0x0c57b1e8a776b5e4, 0x282a618cbaf0872a, - 0x98da99d4dd68403e, 0xbd71315db36338df, 0x5ca77301be01f901, 0xcd649a1bb41fc107, 0x90318505f360c78d, - 0xe5d1ef0fbc45451b, 0xb88ccbfaaf465f0c, 0x47f572c8c2535945, 0xe042e9b25b439658, 0x592e46e47b0c3637, - 0x6e974cabc905936b, 0x3a2952dafe9d5cfb, 0xe98594eb202d53da, 0xc35dee21738371ab, 0x9974505654832eb7, - 0x4e70b9490a49dcf9, 0x808369dcbbc64458, 0xe69a05693b65c1e9, 0x326590bd9e666c49, 0xc629e98a52d696cf, - 0xda96ac2b303ca135, 0x8fbc6d9f77c7ba9a, 0xf729e78ecfb92b39, 0xe75d0ad2d7a5ccbb, 0x3ef39e64f6aebadc, - 0xd93d9f735f72fe3c, 0x1bccb8c5fb3eeb81, 0xf6c5a2967d1bdc03, 0x5fe0615800b66594, 0xfd3018bbe185f3ff, - 0x662345b22fa2f891, 0x223fbb1123dd9751, 0x54191c3272a4fa12, 0x8a3129f19dc70032, 0x7c21439d488e1413, - 0x48f525148552e227, 0xc3089261d3b22ec4, 0x74ff780f458d05e6, 0xed5ab805a7bf712f, 0x296fbcc4481238da, - 0x99b020507b1fd537, 0x7596c29a47233c83, 0xfa92b9a68a6f59ba, 0x42a98a02d194e457, 0xd14e09dded6d0fe5, - 0xd267fb70572db4b0, 0x8c52976d2cad2721, 0xeabcca43ecedabd8, 0x15f4183c66dbf5fa, 0x40030c4afb82d381, - 0xa9ee142b22cf04fa, 0xd33f07142c1220f4, 0xa01c8207d63d47a7, 0x0aecfeb2c9b5e6b3, 0xdb6f11d5ed5d5b5b, - 0xb91fb7125043b956, 0x7c76dcca83b815a5, 0x99722d4896d63e16, 0xd38bb8328f1b5ca6, 0x529cf4c1b7047b6d, - 0x7072a54b033831ca, 0x52e76de9e9cdaeb4, 0xcc92895f7325880f, 0x9f78255875efbe22, 0xbae4515240851de3, - 0xc428c39b5983577f, 0x45ac8b30d0e837de, 0x438fd7c8994dae8c, 0x76f66f780c1b6a35, 0xbdb3f7ceff12bbc7, - 0x39cc39fe5d5f5f77, 0x7a7238ae260338fa, 0xa097f177dd0b3b25, 0x587c4e116c656513, 0x9f8cb964ca308b09, - 0x736d433864de934f, 0x94671561d2852e9e, 0xe27820374c696f51, 0x15fd8b778b760edd, 0xc842206b2b2c79c2, - 0xc22c292279881338, 0xac0afd4731563035, 0x8291c3a90bfc26a9, 0x3c8e4b51b7626ce8, 0x6b2774651c95658e, - 0x21897aad5c029c2b, 0xacd04970c6e7808b, 0x821ca23a26cba1fb, 0x158d711dab0a5e4f, 0xe094080fb1b1b0e2, - 0x9b90dcd15f629ac3, 0xb58273e8494188f5, 0xc680f3c86287a87e, 0x6cf2fc82c7a7a318, 0x96d770d9345b1f51, - 0x486e84c5bc60ee0e, 0x96e88fdf7ff3fdc1, 0x4fdfc3bb04b78b42, 0xd428c513bd5e27b7, 0x4ec2dc1aae693412, - 0x2744d96057090236, 0x0ca0f42c65657367, 0x30305a022884f89d, 0x926f0be95d00eb8f, 0x7a5734740f7077b6, - 0x02459c81b8697d8f, 0x2bed1aefd0d10936, 0xe16c8ab890b333a4, 0x5ac7d7e4b06a36e8, 0xad7427a76c3a83d8, - 0x9ece541690cc6803, 0xf56962a0aa24ecdd, 0x7eaff31ef75eaf0f, 0x41c571ffedfcb4b5, 0xd9188c4ec6adad06, - 0x05196d6d37fa047e, 0xeb4e637c72d2ba0b, 0x6e42af53c3553b39, 0x5fff7dda5aa93506, 0x9f876f361c9f7e0b, - 0x9ed5b0735713e424, 0xfc5693039d9a8f61, 0x0058eb210f20ed80, 0xa8db1e2f357eec5b, 0x95f4b96fe97656fb, - 0x067413b991f47b2a, 0x142b672f58591878, 0xf7614df46df75f57, 0x92d51dbe80c0ea9c, 0xef92f84ef70b0e54, - 0x9006a7eed39ddda9, 0xd9e18b08d510f622, 0x89fe61751bf413eb, 0x2d95f4064b27d03e, 0x88dab0aa91661b25, - 0x78f6f043d591dc1b, 0xcf7a6bf581ae2c5e, 0x4fe80fbf9cd4c246, 0xbae3f5bf09a8655a, 0x27051d92ba5914e0, - 0x05e5d776772d4c2e, 0x124444c22bbb1422, 0x6752b03444dcde27, 0x41447bac1420b33f, 0x5d1e206aee63e0a1, - 0x7a021087142e03c8, 0xd9762e0d1035f731, 0x00513d0188cf9d52, 0x88eedc18226eef63, 0x40e28a02d3751bc7, - 0x5d40f20c54c839e8, 0xf19f7fddf02c8475, 0xb5ca60f518a45087, 0xd8eafda7e7030a2e, 0xb820be2a17953249, - 0xc590fd4ffc0e5c32, 0xb3a5da94a2d66654, 0x316e93f43a976a91, 0x0a5a7b41a54840d1, 0x9d4cba574cb6ecd1, - 0x9769e91b76a2f8d4, 0xac63e70c185de071, 0x3ab25d8582772bcb, 0x20ba272816594bba, 0xb98007ced8fccb03, - 0x16b81c9fe0349e88, 0xcbf120d0963d59a1, 0x2bb136389ad8ab81, 0x07a8b701896baf7a, 0xb8bf455b70b26641, - 0xe4050ba6f31bac8d, 0xccf0e58aca0e5649, 0x011aa916d067a2de, 0x7b0aa2bf55c264ba, 0x60e46609e0c64d12, - 0xb93354a4f799664d, 0x45ce1543855a0093, 0xe18130bbba3424fb, 0x4c833902b5a27834, 0x385c7df10271f63e, - 0x86d528548720b5ae, 0xa6263e493dd4ba4a, 0xd266bc8ef91147b6, 0x27617fec36be07e8, 0xc8919b5b62a939a9, - 0x5bdf29ad5843442d, 0x50a8c32b48dfb995, 0x953fcffa84603826, 0x1567a683e90ac5ca, 0x8137d09826ff4ca3, - 0x31cbb7e5d00da533, 0xf1d336e0e04df905, 0x599c82eb8bf1455a, 0x76d91e9bdce7944c, 0x3244bb9e290f4235, - 0x9696e717f5c12f8a, 0xea0d9879b4b0af11, 0x56d0e242e09ed8de, 0x35e529ddbde9712c, 0xe65bfa6268a81917, - 0x42c13921bbf9bb31, 0x84b64770c4df1e41, 0x177509304c316d29, 0xa00172c24f338272, 0x29ccf4eb849b0938, - 0x6cac9917fbe34a6f, 0x8cecb09d1a9dad32, 0xdd3296aec794df1d, 0x6ac7932d6c865556, 0x380ce9c300c3b37f, - 0x7c122cbb09a00311, 0x18ec68b75e079074, 0x58c50723717ba2a3, 0x95a35246c751e100, 0xaf27e753d37e6700, - 0x21452072efa1be11, 0x3484a7da20c2870b, 0xec3ff978dfd9801d, 0x8ce9cd6bc7858345, 0x1c1adbf37005c163, - 0xe8b5c9bea1709650, 0x33f5c90e18359903, 0x893c23332088f220, 0x90ac20a2ec10773e, 0xbc255f8de1579927, - 0x7a054a1abc341e05, 0xec488a38b1d91e43, 0xcfae3db635cd3741, 0x7d5c57dd33be4bea, 0x633566c5d6ad0fea, - 0x139d5effc41ea155, 0x6a349e15730c905f, 0x406d5dd576741467, 0xa35e7114ca2a88b7, 0x4c708ac828b007c3, - 0x51503413b67188ef, 0x333dea0a374fbdbf, 0x969ecdfa3adfef6c, 0xf3df57890e16cdcc, 0x13b0a4ba80a7f1ed, - 0x1456f8bff495f4cc, 0x44cae270af1a2440, 0x35169d8be7def81c, 0x243112de9bc2a163, 0xa4cf66c466b46456, - 0x8fa37e7f848ef0f6, 0x96126ab7f7cdf818, 0xf65dff0478e37352, 0xaa24e33752141e4c, 0x1a089801c38b187f, - 0x33709e894322f853, 0x331ed88a05245487, 0x7d9612d329347713, 0x1dbedbfb75a836c1, 0xc0f28bad8d87f737, - 0xef6eea25a827962b, 0x040d652b6206ee36, 0x5c2802b606bb8f29, 0x4671ab566bf41f3d, 0xdadaaa2acc3616a4, - 0x22ed2ccdc34c770d, 0xb60642e1043cb500, 0x1a31c32081961d75, 0x086252688d558423, 0x25471e6f67f641a1, - 0x83b5dbd6eb9d9dad, 0x2da339c252dc7a00, 0xecc69a2b4e08550b, 0xedaca22437408820, 0x76e5c2825f6c82cd, - 0xbef570939b7d8637, 0x585951f1e1ba5f51, 0x628b7cdc4f490043, 0xe692557dded97c78, 0x677b635b541e9d2e, - 0x7ce91a71314e3e7d, 0x62dd5a2377865aa2, 0x1254ed9139a8622c, 0xf349707a0068d5ba, 0x1fb47a0111fc5acc, - 0x703c5481b4f5fa8b, 0xbbdbf71edcdfa029, 0x734626a1ca280e13, 0x14240690cc440867, 0x77445b0eea2aa749, - 0x2aedb1f5b769ea16, 0xa56a333626ba1691, 0x2623a203c229c7b8, 0x4112f7e9ede9175b, 0xf71edcd9be7be7ee, - 0x3dae62e791b1ecc3, 0xe349eab0a2ac1b4d, 0xaee3cc268b40c974, 0x9cef0df52c295644, 0xd6dd677da7796c3f, - 0x7e729a2643484b1d, 0xdb009ed1f189b578, 0x21eb5ae228617e96, 0x840d8fea2ad83e0c, 0xe814c84086bb2e07, - 0x19754bf15f1d44b0, 0x74532ca7361bd15a, 0x2e5fc4f50eadddb5, 0x9615c91e7f28e2f2, 0xd7ea5c01819f3a4d, - 0x6d1561bc3bfa8986, 0x30aa4d1e15593153, 0x293d95b6a9188f37, 0x878a09d86f44a7d2, 0x709ca2363dd3fe2a, - 0xe3518304f34ae3cf, 0x4db1c533f65c7ed6, 0xa0c4bf815b0f7a50, 0x7d797b18a51ac6de, 0xff67702346859a7d, - 0x21fe37da4d04318b, 0xaec819223f2931eb, 0xf72f52e0ec2ab95f, 0xfbc5fb950a12532d, 0x2466307b606104dd, - 0xa3da24ae3621139c, 0x040901b84ba0232c, 0xad88013b961e470b, 0xb0bf24f6989e8831, 0x981f7d8a3842668c, - 0xbab019f772749829, 0x102c1f8dce4f5c56, 0x4965b5e114d3a0e8, 0x1ead6ccfe6429d53, 0x079341e6b82018bd, - 0xe15505c0d26b7401, 0x21ef63f647da07f6, 0x41691fce7168b607, 0xb84fe5f6db338a6b, 0x378b6644a623be30, - 0x353a95bf4408c7b0, 0x755245870518f89c, 0x23fd9431f9a58e68, 0x82ac7542810cf846, 0xa4bd65ec177d1816, - 0x6804cdb87de7f6b7, 0x884ce893d5d6e9ed, 0x15245dd29d320d6f, 0xefb3ef12796c99df, 0x20c7eacad78533e3, - 0xdb77f435967f4fa4, 0x95c901fb5adb5932, 0xcbf60f6b20578d61, 0x5cd5f0c4c7511f6c, 0xcf0069d8a8b9ed89, - 0xc7367716b410c034, 0x9d436b8e7a65a8a4, 0x517d98bd833790e4, 0x324bc3533a464b10, 0x99123a8753888411, - 0x7cf268fcbab10963, 0x410443c46a9313d2, 0x6918ebed0839a19c, 0x54c54e236220edd9, 0x9cd5677b1e55f41c, - 0x9318e83e8a91652f, 0xb5066675d1b261db, 0xa3d1fce23bf84498, 0x5c855cd11bad3e8b, 0xb655b1701c0bde42, - 0xb756ac8e5963d346, 0xb4717d3210e2c64e, 0xbf82e8353eda5575, 0x2a3c4b06e9590276, 0x60e27f2d786f9b1f, - 0x9cf4bdbd44a761fb, 0xd7bdf1c5159d162e, 0x5ea3e733eb676001, 0x57c49ca225784b0a, 0xc62274d9543bd2a8, - 0xc03c70e642c41542, 0x65b70b92354c9a54, 0xd1cf32b643da60bc, 0xc273eb539a4ed32c, 0x5aa5713e66fe1b8b, - 0x720c8bcd7051218a, 0x3e0ed985c713d0e2, 0x70124c500c737c1a, 0xc4a34e1f3f803353, 0x3919736ec0593cf8, - 0xc51f8c3b42034254, 0xe302227e175c233a, 0xa99981a06f3fc78d, 0x9e09413a5b8b766d, 0xf22a77974abd5886, - 0xd80a6e4bb2f4eafb, 0xf1fee967ed5eb75e, 0xfce2ddd8dedebc77, 0xe7c10d40a3ddc4c4, 0x906ca93496ad2e0d, - 0xe6453a191aae198a, 0x71425076c1de74e3, 0x982361beb3cff15a, 0x827e5707f5ee1afa, 0x9ebfee8c8fc02ed4, - 0x1f6dff03a02f7aef, 0xa18ddc72476a4296, 0x76092a68cd720896, 0xff6dc8e4ee89aeaf, 0xdc8529309b878d30, - 0x7a8cbbb686475db9, 0xb6e61cb2387d48ce, 0x9b6020c747cd1cfd, 0x936e8a387b712e5e, 0xdc331bca48bbbb14, - 0xcd79b02b07a67f06, 0xc2ab51ea8dbfb87b, 0xa040448ed4ed9a07, 0x635e59d916f7b80f, 0xc6b15b471ee97de1, - 0x67c25f8d3d7b110d, 0xc8be0baf68982f0f, 0x8905345c6bfdc9f1, 0x1c46f50ed4b6dd5a, 0x9499b56b1057c61c, - 0xce12548a0a13cece, 0x98d6fb870feede23, 0x2f6a96df18855116, 0xa7d960ce8192de10, 0x5d0d77827d4a6195, - 0x35e4ce101e73841d, 0x5ec7c26145bdb93f, 0x7dd6884d82c82d7d, 0xc6d059e7488a0e55, 0x3885b9f7c472500d, - 0x7e6d2cce4eb17938, 0xd1809ba82139c4eb, 0x020ac405f2805977, 0xbcfe7ae0991f7726, 0x83d5b3468f22a1bf, - 0xe96c925b1ee9f9cd, 0x8e55d3a93a91926f, 0xa8e45ee7a479d180, 0x3b9de631bce9b815, 0xb1d7385c6b9f1df5, - 0xc04c8c0e8fb3a337, 0xaf1b170d94651742, 0xc7f08f818ea15e80, 0x55d203990e9f406b, 0x0d38993940f79dce, - 0x89bada0128282b8f, 0xba1e2e71fc41db70, 0x36927b31a08f4cb7, 0x54ba8142e8b28e67, 0x0375ae4d18e14099, - 0x78fc5e73f5e80978, 0x8c09072b9e864e7e, 0x8a6cae4f42749e90, 0x3b9fd59347bd0f1f, 0xce8e4e18b0642fb0, - 0x8b7cb83969ae9de3, 0x2575cee5c7aa5059, 0x772d9dc3205212cf, 0xb179a229b3e539f6, 0xa1aec7bc1e8d897a, - 0x4412008a0c3f837e, 0x02ec9c3da842f3ba, 0x3b99685e7acb02a4, 0xb153283d02294546, 0xd15582da71736432, - 0xcb21849508433e04, 0xd6b0dd86dc2bb520, 0x272d5cf7d318c676, 0x8bbc1f76af205983, 0xc8b347b50fd90dd8, - 0x710b9bcb8d055310, 0x8d2525fa42253f6d, 0x5e156d31da806991, 0xd1091499d4007206, 0x94c41013d2cdc300, - 0xafe751987d601471, 0xf6396c15a26ec129, 0xd523acfc29a287ce, 0x10b20ab6387388da, 0x35a38b538570ce01, - 0xd5e918e0bd33c42d, 0x237c83e67087de9d, 0x1a45ac09cf45ac60, 0x7f0de4c996c78d49, 0x6d8f893e1e3d82ff, - 0xcad55113c718cd15, 0xe76377e359e257fc, 0x48577c7b0e57b3f0, 0x8522c7c67c17ebb8, 0x8553d0e27ff11aca, - 0x44ece7cec2b770c0, 0xc1329374e2f71717, 0xb23e776f7176c05d, 0xa12d8820fe5a29da, 0x96d859807e06ceaa, - 0xcfda10e80d329cb9, 0x023aabbacf55ab1b, 0x1fd9f8ebe4c2c747, 0x5d7f229ef92858a0, 0x89e638858241c023, - 0x83d1d383e3ce7cb4, 0xfe66845bf8398e01, 0x6764aed5e5022ad3, 0x2c0bcbf83aa2b325, 0x9a1e850882d09a76, - 0x3e034dd868a09a1b, 0x8f1078d5e0e2b139, 0x875ebe2b7164d8f8, 0xde0c298231ba179c, 0x4ff2572e26df1484, - 0x534948509c970bc5, 0x39c67de7b1d4d964, 0x616b6f04ccf11740, 0xc333ed6b32d45fdf, 0x6f8f38a4dffbda6f, - 0x88c9ffeb7cebeee3, 0x7bb546573e1f6ed5, 0x1a6ff9f3cec6c35a, 0xa3a79f8f6b8d63fd, 0x7c0221a37eeed51a, - 0x27f8bcdc4784df53, 0xfed8ac35ce2473eb, 0x0e34aab5dc7eadf1, 0xbb34bff9a0d678a7, 0x9fa834944f6afe5c, - 0x53516d249fdb481d, 0xf3e7f63e7abad04f, 0x34f64fad8616269a, 0x8ab2f095c09f0070, 0xa68d21752e9f04ce, - 0x1fda2e3effd45414, 0xb8d4c630f02bfedc, 0xba8702ffd2cfbbb5, 0x46ed3da36963fb31, 0xfaab7d109c6ddda3, - 0x1fd7f4e3726f1b9f, 0xff973ff7efd7ae81, 0xdef53d60f7bf2c93, 0x53f64df30cc88729, 0x5a90dda8fdb7d47d, - 0x8acf237c0e7ec7c7, 0xafbf4a2246537b8d, 0xcf0f06c8e51e70c8, 0x609c380868f806c1, 0x1de9ef31a69a8c02, - 0xdf7393bf5e3ec6a0, 0xacd127986f6e14c9, 0x34c0ff91546a8497, 0xc4e5534cbdf6f694, 0xeaf1a02f9f5135e9, - 0xf02955930e9f3d96, 0x0e0f73637a4a5812, 0x00689118004fef3b, 0x00f6e853bba25eb5, 0x2bfad4ae68b8d215, - 0x46ce5dfd1d5d15da, 0x7f8a09ccb4ff144b, 0x4707f894102c037c, 0x46a35ab2d767fbd2, 0xeb37ae5786b912ad, - 0x8ccb2a04026bd6fe, 0x9367d2fecf390406, 0x5d952090e1d75105, 0xd3e6d6eae533424c, 0x61544f75da9ed23a, - 0x81e5a18d8d07a463, 0x23706d6c54b372c9, 0x0418a57ada37552b, 0x5d32bf2c18f11e8e, 0x1307007d0b00fbcf, - 0x5c578c13ed8a0a68, 0x57ba0bbfa2b1c1c2, 0xd58d8df0f39fd90e, 0x47b54ecdef729e98, 0xe28aa5d4852bf68d, - 0x9bb8e2d25db4b478, 0xe9f24d30eca8a398, 0x2db8e4f94bce2554, 0xe49a89e245a97175, 0x0f6e1aab2d5ee250, - 0xeaaa8fc36eb42d18, 0xb9b8ddb61ff601ed, 0x5ff998210097d3cf, 0x99764162fe6c59fc, 0xeb55f40b6e5be921, - 0xce82f757b06f65c6, 0x57984fbed0fab3ce, 0xd70adf7977f20e2e, 0xdb3c4141112b3892, 0x7a859a8f3a9e2423, - 0x6098d3cb932253fe, 0xcf3eca6fc316d968, 0x15389f85bd2d5ee3, 0x9ea839674631a583, 0x6bfcf7791f5e1788, - 0x48f9da05ee0ef35f, 0xa885940be34eaecb, 0xca3dd9a9c23a7c89, 0x67cbb09371479d88, 0x3dddbf2c521bab9e, - 0x20ba626fa6ee6285, 0x50f44d9aaf1231b3, 0xff614c1e5f8384fd, 0x314288a9463c9737, 0xe207c89f5ffcd07d, - 0xfb12014b286435f1, 0xc814e5212d632273, 0x9b0e56c9f0027c97, 0x4c3a19f8274df6da, 0x145e59c0dce6874d, - 0x9a827dd85e21cd35, 0x4618426883249f15, 0x8ea2b5901b48bc5a, 0x92e12499f1a092cc, 0xaaa1153bb1c1147b, - 0x28c929196c5c8a55, 0x9d86ddd13b760518, 0x6ad750ad5f8c9a2d, 0x5b93f19cab012607, 0xe076c74a4a774799, - 0x2a42149f9f4e99d0, 0x02ec62b1a99ab6f8, 0x707e3e3237c6b157, 0x793e77447dfc4a34, 0x30f958725a4a1c3d, - 0x50459ad26ae9ae08, 0xc3e445903a8eac45, 0xa75075f5725b3973, 0x5bd17be701e90d77, 0x7b43bca248746363, - 0x390440da71800ca7, 0x840ead547a005ac8, 0x00bc065fc5113268, 0x40caafc34353b8a3, 0xd286bc1a749e8259, - 0x266dcfc8b59e9ee2, 0x32a77a8aeb0ffb70, 0x262cff9b474c2824, 0x0e6c41c255f88a0c, 0x73c9397725681426, - 0x8a947373abcf78b3, 0x49324c64030438db, 0xda403048db6267e6, 0x189bc26d2c5461a6, 0x233cb6cbfaf1de6e, - 0xe108de0d4f85b5c4, 0x18f2f13680173029, 0x7cebc1ec837bc1cd, 0x163adbb16d4173ea, 0x98ce15be4739d4dc, - 0x94224898786261e1, 0x17b32b36d0c761e3, 0x2ce76f56793e181e, 0x7f3f3f7fdb9fb806, 0x94a1ed97b11d47c0, - 0x8d8afe784cc4a82b, 0x8eba782c406fdb94, 0xb738195ad5e0dde8, 0x1aa7d5ef1ae25fe4, 0x53bb0a0211f13b91, - 0x453c198f3019a634, 0x1e2d96dc6444058a, 0x606bd04b0583ec4f, 0xf4869052e10830ff, 0xb2aac33597582528, - 0xa0511c1a588d31bb, 0x33c8f1c602435df4, 0x7228b810ab012287, 0x14fc37384592328c, 0x4d5f46c9beb89024, - 0x72a9688f057b4fa4, 0xd197893fefcb06e9, 0xb5d84915e75d1143, 0x195c501bd9154409, 0x2110af92f2921834, - 0x181c56e4f3ba785e, 0x114fdae8c1c3fe09, 0x9cda3cb508a73ef0, 0x3c52c51b833f231e, 0xe1008e79bfc54382, - 0x188b9943621c1f12, 0x21ed18128966ac51, 0xa4499da398c9a3f5, 0xcddb857e7dc4a13c, 0xb55ade6e7f049f58, - 0xf08ae5edd5df9293, 0x8cfeb12850685912, 0x3a5d97e4a8501b01, 0xb52b40507b919bc1, 0x4c0a127a652ae7b7, - 0xa2426632881d0f49, 0x543217156d60f218, 0xd181fe0854f63737, 0x36948ac0189def10, 0x2270d205e490b1fc, - 0x29ea1ac431169ea8, 0x2e186e4c75d9894d, 0x4eedf13cbc985dc1, 0x083faaf8a8b3b5b9, 0x7ddf9ce424f52df4, - 0xcd321709f90072db, 0xc0bbf225372b1c4c, 0xd4f9511c4e155829, 0xff2dac7e882d8a5a, 0x0a84a4bf3c87bdbf, - 0x66b083a1a470e430, 0xa51c42a927842591, 0x45c404d7b0aa3cc7, 0xc1860527be703217, 0xe95f501eeafe3d20, - 0x0e44a00a4950d030, 0x49aba204a83bb100, 0xc6fb8cf043da3bfe, 0x7d3e75e13bf8f93e, 0x0201eec53464b9b3, - 0xa042acfc9cc00c47, 0x21b22720a6587904, 0xe7eec179cf4126e4, 0xb7bf1fcd2029a633, 0xa26b38be2f21b773, - 0xb7165f11aadaa7f7, 0x6078eb0678c60d1a, 0x710ab257c6005786, 0x0d3f5c171fbf06f2, 0x2882a8894eeae4be, - 0x8fc3b9913e1a283e, 0xd2a710895181c063, 0xb16f1781a3ba6134, 0x836e468a030a2616, 0x39cf3b501f505973, - 0x581957777badd055, 0x1312acc67c7d3e62, 0xfbb7551538eb32d0, 0x700fe162a6ece72c, 0x8b7ebe33accf4d25, - 0x2d9242437a756439, 0x2adc4d8046f01888, 0xe8207e0b360e4986, 0x7b56cbaa37de84fc, 0x221f61f1ca4c8d63, - 0xc4eebef1936fcf12, 0x79e62564421defe7, 0x62d9a8b1926a8ce3, 0x8b50aef91c73f97c, 0xe7b8fddc5404348c, - 0x49f4927ac5e1122e, 0x64bdbf5bbbbe703b, 0x9f0484ea6c5a3ceb, 0x7bb4d6c70d6c0d0e, 0x93d8ba1039add5a3, - 0x49e34ab00ebe3099, 0xb643df66e3a4d33b, 0x3a078c1a05e71c1b, 0x4692a4ec5ec74dd0, 0x314a1f7644c1abbd, - 0x470bd326df513d87, 0x8d135e1773d4f71e, 0xd9c4b198262782fa, 0xf9d1de6b449479de, 0x38c17fcf69ecf842, - 0x60900c3c28868c43, 0x79bfeea900f49d9f, 0x9b3d6cdcf6210955, 0xe78d77c18ac16916, 0xcf808d8827a277f4, - 0x1c0137a16281bf4e, 0x3580124d03e0a073, 0xdc7c23833ec81f67, 0xf27307b49b9d6c46, 0x4407347625911dbc, - 0x3ebc3b85dcba2a2e, 0x3f988b361de51f05, 0x29e4c6c3b3d0f52a, 0x20e4cec28872fdb9, 0x0e15395f81685f8e, - 0xd492dc45433acaba, 0xe1423fa1732d43f4, 0x9ca0d36ec042f0a7, 0xcb89dabc6a88a9b0, 0x16c590c2ca138d95, - 0x117435d444326469, 0xdc1c67dc1b825105, 0x305736423190ea14, 0x110d8a1f540b4732, 0x5081d3f25842783c, - 0x3aabbff1aa657b9d, 0xe375db90fe30e73d, 0x83851b3ee3484f01, 0x8d357c796c087482, 0xb91aea66174d0c04, - 0x58324d8c42dbd8f1, 0x6feac52e195ff57a, 0x4f5534d25e1bdd23, 0x5802eb3e37e51f41, 0x85699db19e8b0e77, - 0x485a2e0c0b0e9710, 0xa7598b772acd8a3d, 0x5c4d00d7c327384c, 0x09a5d997a5a8cb44, 0x9d14ec92cf4355b6, - 0x4cdc32b1fb857a4c, 0x643d1f10dbde2fd8, 0xeec84740f371cf58, 0x258e8c0b4ba29c78, 0x63468a34a9fcb204, - 0x6e710f12aa6f1147, 0x4d22d3206456e6e5, 0x915446a9a83ad45b, 0x4cc586839f40c386, 0x62a5c0930259d005, - 0xac2d75d037bbd521, 0x5eb41c52242ed190, 0x22820d04cbfd838a, 0x13034f0f2815a9e0, 0x89435ac0cae1e400, - 0x392e384f85af70e9, 0x9d153e64996b9778, 0x835d079d0968f011, 0x07d09801296fefb5, 0xb6bc02b812945d11, - 0x571e2178db5e91dd, 0x6cfb03ca5e82c6b4, 0x10446817a1b6af49, 0x8de1069dc0450875, 0x120ef326bdf1d3f7, - 0x3b1113395d954896, 0xe3b795049108054b, 0x762ed2611ca643c1, 0x519442f439936425, 0x7129ad31f30482d3, - 0x04be587262250177, 0x6f383488ab01c60a, 0xb00590000c039b18, 0x60a80039a822d999, 0xd34a716c8d101e58, - 0x560a287e2f1189df, 0xc3191c7b75b1d64c, 0x49931c23874ef0d2, 0xf09be40e1049e48c, 0x44be28843802da1a, - 0x8cd7e00a95b521a7, 0x59d00a4c76e4e063, 0x5b5c4aa92345ceb4, 0xca9644af2edf9282, 0xa5bf11014ada8ba0, - 0x54d81fa5dd635825, 0xdd93fb3f551f0ad8, 0x261a8453304daefc, 0x612f1c276696aef2, 0x5b93d515a5592029, - 0x90e4200d445e7c66, 0x8a5c25febfe8e5b8, 0x9437c4ac6c18da51, 0x7140d76ac75bd9b2, 0x6972e8860b9c309c, - 0xb99fe668d10b6902, 0x578bc662bb69a0e7, 0x4f0efb101cc80138, 0x8914044c0f1db92e, 0x83d17882a72f6fc6, - 0xbf0c10d3d474d3a2, 0x4e73403bf9273780, 0x8b3a114a39b74a43, 0xb135a1d69de6dbd2, 0xad87a1777556a543, - 0xa743974cb1c68e0f, 0xaa29ff47ab213474, 0x310f309a839e8c60, 0x1abaa384afd87513, 0x6a70163756c80dba, - 0xe062d2795a4c52af, 0xb93460ff9e7f4a2d, 0x373f6153ce999654, 0x74bc4b9d824b7388, 0x349c11733bccba0a, - 0xb294fbc4df856b22, 0xcdf329ffb9895873, 0x18d91baae42d708a, 0x96c307aa396410e8, 0x85c5e8d713e12682, - 0xdfa18a7113673954, 0x15078fd2371e39d5, 0xc90e5b17826c4e3a, 0x3d02351b0525c808, 0xe02da4c6cb57c2aa, - 0x450971ab696ed074, 0xa12539f5df91ff9d, 0xc753e8fd8e6ee6ff, 0x7130fd11b7adf081, 0x23dd97f1081ec031, - 0x8aea033e2a633f23, 0xbf8a3818b9f1ea76, 0xa232f6336c870522, 0xeee512d1bc94f5e1, 0xc346e39d69e5b2bc, - 0x245f96b2a8ec632b, 0x2bc75b36d4d59979, 0x542cb902b46ae19a, 0x637a2319092f3e10, 0x0d61c872e6091001, - 0xc16791b4969c45d6, 0x85d48b9661c0fd55, 0xce3bb8c8aa518d41, 0x52f0fc00737a9a33, 0x66d478c8da2e2e61, - 0x378fb265a801bc72, 0xa86e0b41baf04ba3, 0x68b7269c68bf461c, 0x5b2db8c5821efca5, 0x5e5c70d772611304, - 0x6cf61a8c4c0db011, 0x77dd5e021419e1d8, 0x71eb1a30b9f9f0c1, 0x182276f0c88218d1, 0xf30d4e8138942c39, - 0x3ed1247801d2a4b7, 0xa714c705a1ec630e, 0x608089a43bd21718, 0x450eac44de87b964, 0x0e0dacc04dc0088b, - 0x843455448c224df0, 0x8248e6a6a9398212, 0xaee2c2b03d449e25, 0x39be6977d7929c73, 0x47e6e831336f046f, - 0x2411bbde74ec7cba, 0x9291437033a051e1, 0xf21b5d795f25b3c3, 0xa664890c5813c8b1, 0x00bd596d94cadb4a, - 0x1af8f0418be3c1e2, 0x8381c334ab09e13d, 0xace615a8c8b71c72, 0x1a5d344f525b5782, 0x98ed01bc223b2e74, - 0xe6a055a8fc8a0ef7, 0xa1db7a320bccb229, 0x6c2a597aec8e0ece, 0xe8d8a2c4893a4ce6, 0x5772846ea8490e66, - 0x5ef4100c1cbb0d8b, 0x7bc0ccf4b4063093, 0x60dd31c70c9fd890, 0x3646f06c4758d09a, 0x4396824e57233b6e, - 0xba34704d043e8447, 0xea4318417264bb3f, 0x00db86f6fbd61d8d, 0xceb00f40dfb5402a, 0xcacf97b3ab216c09, - 0xde0ec744654b1ad3, 0xb870dd2ebf2cc091, 0x9684288c6692ca22, 0x82c4f9df86571767, 0xd31608db639ccefb, - 0xe3e1f10f64fe30da, 0x97182f1cea8173c7, 0x3df6127880c83e13, 0x440a6a112fa17102, 0x868b0c0cc248d0dc, - 0xb8b16bb81c61d3e0, 0x325ef6112702fd23, 0x8450eb6ee304528f, 0x67ddf3c1107602e7, 0xe3d19875e5501cc9, - 0x2f71d0b510e092be, 0x7fea53efad9a5cc3, 0x922f690421868b7f, 0x611b718afcfe3e1c, 0x82bfc3ebf2f805fa, - 0xfc7fec7d89761b37, 0xd2eeabc81c8f4346, 0x2d9bfb2651bab22d, 0x279a899723399924, 0x8aae4c9394cd0945, - 0x2a5c12fb4afc9ffd, 0x7e5585b51b4d3665, 0x6792fc674ee25613, 0x0d140a85ad50a865, 0x4097a2441d6ae3d7, - 0x02053f06242c3ba5, 0x4046e377f06d4f24, 0xfcba3beee3464bda, 0xa15d49c370003eb0, 0x6154c16e9fe59b3d, - 0xc5b44b838afaf972, 0x7c84f830b03da533, 0x262e18a94afd8586, 0xd4f1f81a365fa09b, 0x24ba44e08c08e473, - 0x32e8222c92c67776, 0x3599ccdf0bc99e2e, 0x109e18bb2430bdea, 0xaa63ccf1ecf960de, 0xa59c26e90916909f, - 0x2182431404136099, 0x330482eaa1568c38, 0xbaff3e9df7879c0d, 0x177a93dfe0ae804d, 0x700eaf8726cdc6bf, - 0xea71bbdc9353bb89, 0x898ce5a10db958fc, 0x828ff2628781c7f8, 0x018d92119666905b, 0x0f307ce31145480b, - 0xba330aecdcfe711e, 0xc97db6e20c08b273, 0xc14d05ed453c7f74, 0x4338b7735bf9c2d9, 0xf9cdf28be8272877, - 0xa30152c3739ce895, 0x6223f502182f6034, 0x3f9a8cb8410858f0, 0x02f114da12bb0053, 0x8162308c8e88c961, - 0x4cbdf055a873198d, 0x7b9d33331ad5f0cb, 0x41e700cf323f2bfc, 0xacf293ad6a72757e, 0x36f8d9e4670bcff3, - 0xa8bf462e90900a8c, 0xdd83ec6aee2d90d3, 0x4f549c9cdce0dee0, 0x266c36b4ce15e049, 0x187a946c1f496f70, - 0x2f81102dca0127dc, 0x57ef3a3eac67dd31, 0xc6f3ff1b1c8efb88, 0xe93da4d807520ddc, 0xa6c0592ac770c12e, - 0xc82d336ed3c98daa, 0x703f860f343e72d5, 0x4f4269a89d61308b, 0xad322645114f24f6, 0x700c206d537a6eb3, - 0xbc53f15b36437c25, 0xe35cc4fca5480e78, 0x3f7279419fa2b025, 0xddbf217b526c2a4a, 0x67d35606212505ba, - 0x9d8c9f2392d0f01a, 0x136353c8e4955f64, 0x4b53e29576109e60, 0x48523b0e31e95047, 0x090da908fb82e51e, - 0x4498ad64e8911708, 0xa7c2a5246008ecee, 0xb772f76fa6cb9c0d, 0x0f126f0582b18325, 0xe4aefd34f89a7b5c, - 0x3d7ce25d86fa298a, 0x8adeb4bd0fc6a36f, 0x6c9ccb3e8b5ef547, 0x770c80be10b901df, 0x89e82d261e00ae3b, - 0x105a96c2d2bb49cb, 0x5de5ab00a1a1b0de, 0xd1da894545790251, 0x23580226a377525b, 0x28823f2f6056ced9, - 0xcb736df25b0d0e6a, 0xd8e1705285e8deac, 0x076732494283aac3, 0x658ebc7f9337deee, 0x16a278e09619cf05, - 0x2b4f52289825686e, 0x6361e5bca5131539, 0xb5b8d9ec6e9b6bc7, 0x1268fb650c55b091, 0x21549cc6acd20415, - 0xa7d25e07c6acf042, 0x8c7d52df7577c63d, 0x8ce0de68d1076b37, 0x44c0ff36d7e756e7, 0x302d002d9c167616, - 0x3411cc10e7b09bb9, 0x42c813e631c1f64a, 0x49021101b6b0b613, 0x79de0ee0001f8bee, 0x1cc363ab140999da, - 0xa0d13046a360485a, 0x8d163180a5c8b080, 0x65f5ced1b3f24344, 0xc12e3cc23f0f9e23, 0x0465445ddf11d69e, - 0x08ea4d014fcbe92d, 0x28ae684190f75284, 0x4bb0238a7ae0a4b3, 0x578eb135f865d11d, 0x6dcd272b1121c655, - 0xd54bbc2c57758f46, 0x08393248a9ef0a5c, 0x29d5864135980e7b, 0x2ba05bae80ba076e, 0x3a60fd2486e5c6e4, - 0xdbf55fd1436c31bd, 0xd8ce48334f58e6db, 0x5bfe81fe03c7427c, 0xb14a806faf9ce36d, 0x804dc63b35514897, - 0xa18f937d6ec2eb41, 0xce988d2b45487610, 0x84c385380a9a150e, 0xcecec145583b7d5e, 0x3b0b1c95678ed972, - 0x003729e76d7a3c78, 0x4035910f03529535, 0xa60d62186e5ca528, 0xbfcfb80fa7fb19c5, 0x254140fb3e91032c, - 0x18b82166268519fa, 0x27bcac30a3673f20, 0xe9badba7c4b7414e, 0xda3d76a818b3eed1, 0x43254dc0dd095f89, - 0xbb4dc81a067434ef, 0x4ab839626fc1e93c, 0xc3c6cb95cf3e8e7b, 0xe8fc3196c7fecbc5, 0x9c396570794e8122, - 0x5a335a233f133f2d, 0x3eafe45f9538e1a4, 0x12b727fe55cb541f, 0x20b52d0c66075653, 0xe067e470fadbd7c3, - 0x3e0273b9e239c77d, 0x6d9a09bdcd213f62, 0x82397362580d269e, 0xcd4989017c0c31ea, 0x540b6bd3ae84dc3c, - 0xfa670cce09e63902, 0x0dca6af27ae2db92, 0xa40922d38ba47c75, 0x2b45ec4458c06016, 0x2cb4767c7fd07b35, - 0x65791e8d48fef61e, 0x71d83c0157e65250, 0x68a0931df501b3fb, 0x46d6654c41d2aff4, 0xdd03941b13468bbc, - 0xfd3b2b2db6d0a189, 0xd6d93239e74672c2, 0xc312055796b09a82, 0xca4382adcd191aea, 0x5b7c2e48dcaafc1b, - 0x9a9a38a76d91fb21, 0xe2d406c4a925734b, 0x1caf9c971b81c140, 0xdb825ca721a62fd6, 0x94793e972bb0db90, - 0x71671f6222d7f9b8, 0x11dfaa49a0231aa8, 0x4e9111a8ba450be2, 0xb37587f629b1a279, 0x60e4003d7b0355fe, - 0x954d847c1951d553, 0x9aa826946a24897a, 0xb0a22951cfb34274, 0x0a46620c36f3345f, 0x66c9cf48497efaa3, - 0xcecd8b972f8eda37, 0x3c2b66100250ac4f, 0xec85f336e180953e, 0xfabe54349ff9cc2d, 0x9f679d7d12976140, - 0x8cb18555b193b1bc, 0x7a4232a9d2c1bd52, 0x1b6e637af3e90803, 0x3ec2275c3cf20b0b, 0xfde8153a87cbe8bb, - 0xd738d05ae8ad1878, 0x03b0525e464f4f0e, 0xbf3259cb70b3ec64, 0xbd87ca243370a9c0, 0x3b91835a05f51cbe, - 0xf8c114adf88dc0f2, 0xefecdccf67ae771c, 0xd5848352bd0d6ff6, 0xf8c5d81f54d52f34, 0xeaa08977bd75baf4, - 0x38c80f6e3bf56a84, 0xa7460d6253fe2599, 0x1e40baa35f11524c, 0xb2e320a0d39a9256, 0x2a3729d169dc0152, - 0x2be5b693c63e7825, 0x3b4510971dfcd5ac, 0x231a55c6069ac64d, 0x74891e7f7af4ecf0, 0xdb6f5e53eb9575c2, - 0x19b71b4bd376a58c, 0xdac040c90b9826bc, 0x58a77e7043b25fae, 0xd5206884b37ffd56, 0xe6370ac5f7e6a70f, - 0xa5c767cfefdfbc82, 0x5a0e85d55eaa5784, 0x87d6afb0bd5ebe59, 0x46a75f9d38f5fb8d, 0xd13440c7570f7257, - 0xb08c7f9e5328480d, 0x7bf76f04618ca1dd, 0xfb378cb0bc006154, 0x3457355cbc3afefe, 0xe89bd3cf58d107f9, - 0xf35155b28cba9f8d, 0x71e841bc988d73b8, 0xb886dfcf09dff0d8, 0xd81963ac1de86d27, 0x4924b1e42394f292, - 0x2f3837fd4815b0e9, 0xa4d0c60b220b298c, 0x45fd6040311a8945, 0x51d775daac6732d6, 0xb0b3488b8279e3c9, - 0x6a73368eb129448c, 0xebb2af3fa2a3294a, 0x42854997843fecfe, 0x0851811c7fdaf162, 0x974e31dd6e14bb94, - 0x62ae0a0ae94619c0, 0xcec5afa13879be1c, 0x522e03c7c9653a41, 0x72599d040332a89b, 0xa0bf4a81299888c5, - 0x6c20024209911f2f, 0x66b1098139172ad2, 0x65609183b1c57010, 0x5f54caf0c76d58f2, 0x94b418ff3c9efc36, - 0xded2b9cc8e161e62, 0x5a7b24d1ad36deb4, 0x57a14254297678c3, 0x324c29fdd56996ed, 0x07b7596e4fa4374b, - 0xe70a37cbcc10be82, 0xb5fc5f7c5ed1060a, 0x1746f6939d5a6aa5, 0x555f6333cc98f127, 0x67187c818e673894, - 0xfe8bbe19de51c55e, 0x226e6334effe406b, 0x18022fc9a68483d5, 0xed2d0424c66c97a4, 0x84ca12407b1855b7, - 0x4dc34753d8c0a896, 0xe268f6d1bf5431f0, 0x617d630e859244dc, 0x2dc05aac1e3e7df9, 0xfce2e9d137af0f65, - 0xa93dc84f1e7510b0, 0x432415d0f434c00a, 0x7b35f6c4f765e761, 0xc53a3088b71c969d, 0x40cd11ca18386925, - 0x0a852f53bf215e72, 0xa96dac400319fede, 0xa1f82a19da76f8d5, 0x91209faa30164d96, 0x61623a625768028c, - 0x5447315fa15e75ff, 0x1d0cc48c73051b1a, 0x94b6ac2d95bc165a, 0x5f53a28c669cede2, 0xa4a33bd2eecb21c0, - 0xe8452bef2695ed28, 0x03482539f112ce29, 0xaa1a74a2d19c14e9, 0x663aec8ff711d161, 0xf547e612ed47dad2, - 0x5973d314e58f1610, 0x1c660beab8c3e66a, 0xf9afc744c626ad4e, 0x6071942ccffa20a0, 0xb340f73db88240c6, - 0x63d9915c01752796, 0xdff04aae395562ea, 0x95c529ccd3bc38f2, 0x7aa10b557c4efe11, 0xaceb3fad9595404e, - 0xaf5346dddab02264, 0x411e3f2f2172556a, 0x3e7bd81d12d7648e, 0x3e66e51b207939f8, 0x807bcce15811d1b8, - 0x2ab9818c0d629d7b, 0x88328459bbb89657, 0x0452c175f13bf901, 0x16991468e5075863, 0x9ed4aa489d64e16e, - 0xefd83553af9c1f48, 0x43e6e1071a0a64a3, 0x367cf8d19055aeef, 0xf580e68ff8ab062b, 0xffc45fdb09ea05b9, - 0xcd8083009f5fed40, 0xe34479e5f981492f, 0x80f1c2b9463014a0, 0x2ca3b959c93981df, 0xe81807fed23fc6bd, - 0xc3d5bf3ec675d531, 0xee259c259d35eacd, 0xa8d9689d4767a552, 0xad16e1d1e4f73ae2, 0x3794ea70cb7a56aa, - 0x96915ead739e6aa3, 0x84f786a4372af45e, 0x95f73abd37e4bd45, 0xef9c1f219c223ce4, 0x1dc170f0e03cf512, - 0xe0d42b70238cf76a, 0x13ef55aeb75143bd, 0x8d3ac36cd41bf42e, 0xe90d4a6f54e8bd59, 0x443a1ef28ebaf0e0, - 0xf72af234eb757a6f, 0xd500b3c565cbc572, 0x232a172b357aaf14, 0x6b111e94a75cc141, 0x8b1ef2dec27b43d2, - 0x9b25bc37a98df843, 0xf99b0ca75a2c4778, 0x100ee56aa582f78a, 0xbcb728bd851852f4, 0x8eba70b94aef35e0, - 0x460f7eaf14f15e61, 0x98b53ae0d7ea9cbf, 0x5e463a1ef28ebaea, 0x65c6a18ef3261e92, 0xa742e9156a6f1992, - 0x78bc331de0d61af0, 0xeb2d2edb000de9c1, 0xef35e0d6603ae30f, 0xf234ea92a70e3878, 0xf07bb38ef726e769, - 0x9680331efc8e7ea4, 0x87bca3ac8c8d7293, 0x68d26c72bdcd16e0, 0xe341ef2da2091efc, 0x5e45593cf08eabe6, - 0x66440f7ec71d043d, 0xe8bd54a94678701e, 0x0c2cbc5789fef853, 0xa777aaab52aa35f0, 0xcee3b002078c70bc, - 0xc5f8e34f85dea9de, 0x4a19e3811ef28eb2, 0x651e7b95720bf596, 0x5b0ca7023cf1a0f6, 0x56aae8777ad03bf5, - 0x053de41df96b5579, 0x277cf0a0f73afa97, 0x1ef20ef875958e39, 0x52a973df61b4a05d, 0x78c83bdad5e03952, - 0x69608ee021799a94, 0xdee4f426e56932fd, 0x2b44437ac83b60e2, 0x21ef683b1ef4de42, 0x3f565a3c9ef10778, - 0xb60466ab0138ad06, 0xe76f11fc568b7168, 0x0126c628d10da3b4, 0x89f70abf97aaa508, 0x0fa233fed4e99d60, - 0x564b986b785059fc, 0x41593cf81d30f120, 0xf8d52ac655b5ce73, 0xaddac258a207de6b, 0xad623dc283e0d75a, - 0xa8abd6621ad65ae8, 0x173c0826940bca11, 0x1e04b35e04fe7850, 0x59402be19dfbab5e, 0xc438a487bcb7f0ce, - 0x7d572f61eed083df, 0x41733c383fc64e44, 0x0f7aaf42d88007b5, 0x0b7f90bfca38d4ab, 0x68173de4bd41ef0c, - 0xa78ef15caf37391d, 0x41e5223ca88df516, 0xfa851ef20e7cd008, 0x7ec75ca387bc037f, 0x3cf0de2842e2d4c0, - 0xa242eff5523d6ac8, 0x9cc572d5c43bcf97, 0x26d69b080fcad32c, 0x63cce341659b9843, 0x78e7fec21fbc2310, - 0x00bd432b2382977a, 0x5e57cb150c507a12, 0x76a57215dd474fc2, 0x0371034ae81c7aaa, 0x5fe8127acaaf6a8d, - 0x7e71ef62bc1269e9, 0x49bfe0f8148d4478, 0x01a644ad58c3373c, 0xe5579908434ffe55, 0x2bd32f5aabb05540, - 0xa7e40c24c3a8a427, 0x6768968ae83f3c99, 0x30f80bca344b25ee, 0xf226053ca3271313, 0x7f018a9ebca5b44a, - 0x556c18f4871b8617, 0xde705a252637bfc8, 0x77b51db5ca25da84, 0xf08797fd52ab52c7, 0x06427f083ab2a101, - 0x91fc51bf3151f107, 0xe3437e63dda3df2d, 0xe07d8eeb1d2bafeb, 0xe1a6cdcaebc885be, 0xf6364d6ec6498f0f, - 0x8e9c2089c2ff9050, 0xee930f6b1246995d, 0x5c4c0229e2b178ea, 0x86ebfefd7dc82991, 0x73ca39217481caa2, - 0x660d0818d221d91a, 0x72e0054e8f790201, 0x27417bf2a5d2bcf1, 0xc441ea04497756c4, 0x66e6ea39b6e7873a, - 0xdf0d2c8875d08fa6, 0x5ce551d7d5493580, 0x55e82936f68cfd00, 0x43cf4b255164a60a, 0xd823e7377648ecf8, - 0x36a98c71849ea4e9, 0xcfe5a11684b87b90, 0xedf12b62edd1abce, 0x8a2e29625096d153, 0x9c1943178b0ad4cb, - 0x1d68588bca118656, 0x91849526199b5a15, 0xc3120c868331926b, 0x456ce5343e3d9490, 0x4033b286edc34f2e, - 0x4303b15ec392eb27, 0x030a3d4b6407ec59, 0xc9bd7402d4cc0b96, 0x0c2fc9368e429eca, 0x4be91ce69ccbe56f, - 0xbddfe2b145f7204f, 0x8545e11ee886b3e2, 0x7c8f697e80a623ee, 0x25c6d61cf3a64019, 0xf63ba54a094893d1, - 0x6207ec48bd48a24f, 0xa4d22b44b548c586, 0x8ff5f9a0dc86c11f, 0xa4ad4a6163084d84, 0xb81f0b8b07dc54d0, - 0x999dace4485ac35a, 0xc25a4de490033ee2, 0x9e40fbf8268d1632, 0x7ca72069edf13ef1, 0xf3d078a0cb296e0b, - 0xf243d50f77505a55, 0x04aa2070e3833941, 0xda24623070188ed5, 0xeb48b97e85921214, 0xe395f44c00e6495a, - 0xe1cb46acd4d06880, 0xb1b84f4bfb6252be, 0x843e9898215d2a5d, 0x5ac773b6777ec264, 0x5653c54b4603194d, - 0x44ea8515f87cd823, 0xe12b11eaf4fd6431, 0xeaff0371cb6c1f23, 0x825a899499200af3, 0xf226c2cc62de3fa8, - 0xc43291d8fc9fac94, 0xe3e633b942f4b671, 0x8f6dfdf506988852, 0xadb0b757c1a1f341, 0x052f2568c360c441, - 0xae1cf35d6ea965cd, 0x26493ca60841da57, 0x0a9364282ed37fae, 0x44ed3b291816a839, 0x82349dcff39c6820, - 0x52bcd35439dab7e3, 0x21dd5c691c499c36, 0x4f88d38c63ab7827, 0x262a3252444f7ae8, 0x3b584f94d223055a, - 0x0ea1891ea8d99987, 0x36562e39a23043c3, 0xee2a1cee211e6b49, 0x45b1e7088d26488f, 0x73433766af1cb40d, - 0xd7f71056e5c164af, 0x53c396d66202a310, 0x34c4b56c4ef96fd1, 0x18294f09f0cb1083, 0x87f2e5e25e07b108, - 0x1600d6a8542b0793, 0x4e7eb2c39514a013, 0x54ae6e2f7638d736, 0xaf656dedee4a835e, 0xe850386234e1af54, - 0x133282e8e296c49b, 0x2498fb26c5996223, 0xb2a3e8eec473437b, 0x2c42a55d506da4d7, 0xa64170495cd53781, - 0xfc6a0dbb5eb1b1be, 0x1b9162b5f5c52b9e, 0x85c995b02fc2551f, 0x9480549b7dd8dcca, 0x27948246934454b6, - 0xcdc8539fd490d6e0, 0x7c3818c95c52f937, 0xf6bc66d92c5a68ae, 0x203ab6e71a2ab7dc, 0x703c8f711fa547a6, - 0xb657701c179824b1, 0xcfb03f21073d5039, 0xc49a1e17f81b01c0, 0x60c636459b8e630b, 0x3338ab90ba246d60, - 0xf2067684d99fef86, 0xf03a069142133c5e, 0x235af43ae00ca29e, 0xbe2c8b79b2462904, 0xbf4351a56061bc05, - 0x6a3d8dee87d3c55b, 0x886ebb5733f58503, 0x100df617bdc4aa94, 0x4be616452fa55af6, 0x8e17eda9689701ab, - 0x9c5aa64853f14afc, 0xa122ca9309bce687, 0xa1d36305f118a582, 0x787e637c62722884, 0x13258ffb1f0cc757, - 0xaafbb5e1128dd6f6, 0xa75073c27834a6ba, 0x928ac6c53ff4e9f7, 0xf10c5fd8b24a7627, 0xbaf7d5601d33ff19, - 0xb39c7a31330b9013, 0xd8c5d728e38b5cda, 0xaadce830140f50db, 0xcd80a726907e2968, 0xc3c69649379e2d24, - 0x5ffdbeee2444a0a4, 0x6b3815d0862ee024, 0xd57036583d02d1f2, 0xfca1a29d32c4bbde, 0x89c6281d6c8332ca, - 0xef703c3d24da9e72, 0xe2389a342a96e8e3, 0x60cf7b19d1e92168, 0x4866805eb7274782, 0xcd62c74070645046, - 0x674cc40709a28fcc, 0x27d24f9aa68e1f21, 0xc76386e9325ab91c, 0x1742423a56e57585, 0xd16e7bf0717fbfa9, - 0xfdb0c53f3d80c6c0, 0xee7467c87e5b04b0, 0x8c1f168893d2e3c3, 0x1999ac3d848187f2, 0xb0674130476b46c7, - 0xdc5fdad3266a6c1a, 0x7ed2043363d471f6, 0xec6771170d75d1e1, 0x38700da1a08f8fec, 0xa1740fcb73625d63, - 0xe5d419abc6eae56b, 0xa744f7c5a2924dd6, 0x3483be5ecd7c823b, 0xd818a30a9f307b7b, 0x4d653d9618be4e87, - 0x3b70b6b70169ffbb, 0xe1c17743786471a7, 0x731a518ad13de12a, 0x13317b5d4a6823b6, 0x181a9688f109ee51, - 0xd3e9badf8da0eaa6, 0x2586a0478fc05aef, 0xd20e5ef7b6b7974b, 0x72c5a973b8079640, 0x599e30859df037cc, - 0xb3c23e87b6f4c0b9, 0xaec5932548549256, 0x91b932da81632575, 0x27e4ac863a1631dd, 0x6db2d99a57353c18, - 0x9855c50da61a5e55, 0x3e7df9c00665a291, 0x3a48b2c16b6ca1c0, 0x28e5d161a8e338e5, 0xf68620ae75128b66, - 0x9c0ed2edcab9b40c, 0x451308d414d27786, 0xb1d1e96a74ead6a7, 0xd72475c8142489c1, 0x197cc2918114fde9, - 0xfccff4c05a89e200, 0xb03d8fbea30b3ac5, 0x2dffc2d1d5ae56f0, 0xcc17c42e98601ffa, 0xb0f68b564142342f, - 0x8a83aa7cc7b2a9d3, 0x2af180caf2ec6d87, 0x0da6b42e12ea405c, 0x929beb2e2e8f5947, 0x1bb7fbc6c92eb40e, - 0x2f31db5e637e2ede, 0xbd27f57273d453c6, 0x552eefac9120ded9, 0xf5a69ff87816db9d, 0x9c6f66801bd74637, - 0xeab4cd6a8f8ab351, 0x0e80600e45b7a8da, 0x204a1b5323f20818, 0x7371ee64d00c2019, 0x0b6ced7ca1d3812a, - 0xf90cede7180b7108, 0x20e43c212258d50f, 0x6ae989f7832f57f9, 0x6568364d33036418, 0xe09edc306efa40c3, - 0x9d87f1477da7c726, 0x27b99d48eeb99c2a, 0x022174ddcfe4ba0a, 0xea72f042639657a7, 0x12bbef1a7cb5232b, - 0x1a8d7a7595710bf3, 0x277670ee34450b1c, 0x620457102009063c, 0x25e0f0b055281ada, 0x2970c37e943b7d7d, - 0x78f21a7b81e72d5e, 0x1328d8e4b97639e8, 0x345961babc80aab4, 0x76e86b852d597179, 0xf52d348a8e358018, - 0x4ec6274a0c27b881, 0xc68e18c7697a8e19, 0xa021d1c181091970, 0xca24c42e2d7dc49d, 0x6f74f60b8ca6128f, - 0x2627002d1d18e037, 0x808f0ca4a3548338, 0xc42d52b615122eca, 0xca8632ef559bb7b7, 0xb5c61e24a46e818a, - 0x1fe61c234426aa21, 0x18453535effa8556, 0xcae94eb5a94a99c1, 0x8f094e9b9e5eb71d, 0xe22c69bc72907637, - 0x54846e7b28ad62a3, 0x461b7268c0aa799b, 0x0ec3a317142d4fba, 0x5ced9d640513ee73, 0x7806c115878b8399, - 0x61e4e2c19bddfe54, 0x067360fc8aa80cce, 0x0a6d7bc89db1680b, 0x05c2452349f8c9bd, 0x4e638ea5d4f131c7, - 0xa48400024422bfbb, 0x342cc9320ca64a00, 0x0af368e86f42f873, 0x35c4c5882724f2ab, 0x343c7ea2059da9f7, - 0xc9c19dc835a40ad9, 0x3bad9d156c2d1742, 0x931af69f410c7246, 0x351ab3ac7ad03dbe, 0x56d2fc60e84e3d7c, - 0x4c30308e2b6fc4f6, 0x881df4cd107e3d95, 0xbcc04e7b9d4fef23, 0x4e3e67eefb1f8d45, 0x0495ddee98a5491f, - 0x9ec8fe429d854a83, 0x86999a6935416d48, 0x269be661dd51acb3, 0xe1660ec9fa628ed5, 0xdffd05df8b994f91, - 0xed133d68641f0fe1, 0x660026929dfd3588, 0x61e860b9f5637ba6, 0x661d280eec07e6c0, 0x2e56716019f82a35, - 0x247eb06c19295369, 0xa6ed33715d9f9dcf, 0xf881f88cff727296, 0x934b705dfec2ff1f, 0xe2bc16e3f793c9cf, - 0x5999af1fec32c463, 0x6ec9854d4ce324af, 0x20f9fceb9e64cfdd, 0xde02f046db1f2958, 0xe6be7ef9f29f8868, - 0x1be37afcb5db9200, 0x57fb905bc6b99e21, 0x022a531b2059ff04, 0x468cd1f9dd7831d5, 0x470ec3b13972dfbe, - 0x106afdf519064d8d, 0x3f3fcf60e7d61fc5, 0x3624e6eb32fa3714, 0x05c8c3ef70f7df50, 0x36d5d24b509136a8, - 0xef83d145b3b111ea, 0xd2e4df7a5b72d905, 0xd563faaa56726a61, 0xfb7e09c2122d562c, 0x9e1f908b4b96f1b7, - 0xffadd1ff73302266, 0xe47d265e4455a22f, 0x1f36634c0cb9d791, 0x28c9a8642faa1997, 0x67b315e3024e3146, - 0x098d255ca4631f78, 0x3ab8ecc2038db3d3, 0x7366d1cd99efed55, 0x6fb1ee62104adf90, 0x82b6cd7436604134, - 0xaca728df545c558f, 0x015967f52f95cc7d, 0x14056a4a40c1b592, 0x01b48c7ec6f1156a, 0x64ef7b1d7d97aac4, - 0x947287f76c964704, 0x75f8c6d01e15d89a, 0x83799d485a47ba4d, 0x628a9bef460b3017, 0x0bba4255efeabe82, - 0x7f918c2e8f2b4d28, 0x1571541ee8e094ab, 0xd0de1116a58c3ae4, 0x5557110df3655276, 0x55d118265ca204fd, - 0xaa11eedd1d8292ef, 0x3db205553499c297, 0x5f99a26f304dc8cd, 0xc3a460bf4283193a, 0xc5a4b28d7f50b31b, - 0x4515bff8300fdb52, 0x5443f504be419d0b, 0x2a80feb77c0997b8, 0x08ee6613a06e3682, 0xda181828938352a0, - 0x26e98283c638298c, 0xa33652202400a4e0, 0xa5f2d70402ac8254, 0x0a6ae694966358ab, 0x218d513686eb9894, - 0xe01c0448030eb974, 0x82cad3449287d318, 0x85f09f5b0c804d82, 0xca039ddc88ad7275, 0x9e2af2e80495073a, - 0xc511e9b139495003, 0x8ed0cdb6580dc574, 0x82ca0315e588d4ec, 0x4c1ef4a54d800630, 0x747d7d94a76845cd, - 0x2471193741939af4, 0xc131e0a8f7a1b50a, 0x9dce78dfca604b92, 0xe40c2aadad6a44fa, 0xcb4441dd47aaee46, - 0x3c69ec25f1d8a004, 0x3b58808697a38571, 0xe276b542074abb3c, 0x532a94dbff049d65, 0x52668406ae4f74a8, - 0x1843913882162929, 0x915722e8ce060b82, 0x80f12fbab66abc36, 0x1f26f5b3d7a93ca3, 0xc9421be4345fb88d, - 0x6e42ac12fa146b12, 0xa0902a26e1ec0d08, 0xf3059ab0f12fd41a, 0xd44c8328a5a25a92, 0x760a1cfa33a522cc, - 0x3033defc2fe5e417, 0xb2eca08a308f134d, 0xc2b72692d0b7894f, 0x3036687255f14f67, 0x50116f41a917aac7, - 0xa1722dac5c549df7, 0x2d0fed501e402d7f, 0x18b640179dc43de2, 0x26f8633ef045b519, 0xe8a0cae0286a6114, - 0xc1d352ea58e1a2f1, 0x3589d7206f11527b, 0x029123f4516118f8, 0x06682082ad42d638, 0x2f290623f44d3506, - 0xdf56b7460a2731e7, 0x2103eac5a804e468, 0xe13289829c971443, 0x2ef44dc3a79117ea, 0x058c7e2917c34b8f, - 0x7f7ca4ff535616d2, 0x3e4fff4a35c63ea2, 0x51587fe97f7f0d8c, 0xa54a5b69dbf033c2, 0x2a075b1dd6615a84, - 0x4151b2aeb2a3f8e7, 0x81dab8ed6f6f5dc7, 0x6f6f8dc16f7f5070, 0x8ac5648983f7db35, 0x7e1e3bef7b712f04, - 0x1c7a874f1770146d, 0xd9f9199c9cb0d488, 0x058d1012e9237b1b, 0x522cf58e63093e58, 0x00f8d17b0f65504e, - 0x57c227783663435b, 0x11572a3db9050238, 0xc3f92aa72572799c, 0xb13aaf7869eec9c5, 0x461a23ef9eba02c4, - 0xbae90dc8a8911414, 0xbdaaa12a0a3e55cb, 0x6820ad0237291e06, 0xb5c86af061d05bcc, 0x07360b39f4d61f7b, - 0xb3a15fd62b39eb85, 0x4bb1234aef936990, 0x838dd18075110c22, 0xb54a1067315c95cb, 0xa2ba2a57d0ed65d6, - 0x1a3263bc06178ab1, 0xa21481673d743b74, 0x34421e26aeb40bc7, 0x8b7e6f969eedc264, 0x733b451bd17afda4, - 0x3c42aad24706cb3c, 0x423f8dbb70dbfbd3, 0x4fb925bbe821b720, 0x72ca36c6de1dd8eb, 0x603da99febdb2e56, - 0xea1fd0c8bc1c7e50, 0x56a8f2c39c44939a, 0x2993f1e8e3168ec3, 0x5b6f3f42dcd89dc1, 0x010395d8c20ca630, - 0x0aac9522f62a1a96, 0xe718289a3e78502f, 0xee4fe10560bf5e49, 0x8257d0b4fb3b9c1c, 0x3095df0db68a1f2a, - 0xbdad870fe9ef658e, 0xa3ce914750725b8b, 0x49858e81e269324d, 0x37a39cd28cf96f13, 0x6ec68cdae1956455, - 0x1bb7497e2ce5703d, 0x501b99e80878f11c, 0x0e11a0410d542be5, 0x7dd8d98ef6ab8d24, 0x726ed11029ca4521, - 0x4519a4d89deeed75, 0xa08d720b9566210b, 0x0f05eb813ed0879c, 0xc300eec27fe9183a, 0xbe4c0a00549e6e15, - 0x1caff708f12179da, 0x2127f7fb43b2424a, 0x68defbc00dd6705c, 0x88824b429c5e4be7, 0xe4c6501da24c13c6, - 0xd174c983d6c65cd3, 0x7a384a0b7097cca1, 0xe4b41af0214426d9, 0x5046a240c8fb9da6, 0x15c02b5f7c704dff, - 0x6f520f87df2a9206, 0xc0319a59d6aca72d, 0x6ffd23fd4e88debd, 0x9cc18ca185d25c30, 0x381335eed5dd9fa3, - 0x67cccb62866ad739, 0x761d221faf899b88, 0xd8777d19a1a59dfe, 0x6713dc4ec807d153, 0xf23e62d241380175, - 0x1f010bee89ba8f18, 0xebfb8889731fe1b6, 0xcab899716a5cd5be, 0xf88545e672d46fb6, 0x6273a3114000bb1a, - 0xdb901c79abbee713, 0xc7df0fcea0d2e90e, 0x76f293230d8d41c8, 0x5a3edec635d993c8, 0x069a17e704c8018c, - 0x0cb227660f5c3dc8, 0x4c4477bb6706c756, 0xec7b7c6cf99f3ff7, 0xd8721b632c139c1a, 0x03cd8a937b5d7622, - 0xb7ad26496a8fafb2, 0x647eda9b7964f6af, 0x5cf53e6ff6687369, 0x97c480ae52b8b12e, 0x4873d56d20f9777f, - 0x493022d83420920d, 0xb1a002578190776a, 0x545fc65629af6586, 0xd149b48caf841849, 0x1780311933e5bc76, - 0x48c4215b2089b52d, 0x18c69a268bc31b39, 0x53c465a2d4faede5, 0x0c660c715b31c39c, 0x2c2704974ceebda3, - 0x3b30dc74757a0826, 0x7ed291c29c9648b1, 0x4bd480cccc8e7f34, 0x8a4dce0773bf8e79, 0x0f9d3042704ab133, - 0x98fa24ef8ec61198, 0x9d1480ce812901d0, 0x3938c5bee18c666e, 0x939caff630679c9c, 0x3b5ff5e9ae335972, - 0xaaf6aca224f11452, 0x1da16f8a51d7de8d, 0xc4d1b5ba50898690, 0xce61ca27029b8a8d, 0x32cc66ff2e8ee7ab, - 0xd45a3493969201d7, 0x9f0e7778054b041c, 0x97b754e874f65ebc, 0xd587b773f8a1a690, 0xaa43f84102470bef, - 0xc25b8ab2d1d63b78, 0x4a8237b1c5f51601, 0xc7ab62f4547ce550, 0x4f21cef28a9ec25d, 0xb172de9e4254f6e8, - 0xbe552167d744827b, 0x58eadfef43d75dae, 0x53a1354f03b28b80, 0xefefcfbd2b2458f9, 0xa97b540423a6aee9, - 0xaebdab0c0fa5f751, 0x57dd3e86c7b5e344, 0x7bab9a09cd3f04b5, 0x3aa146912752071b, 0x05db8e2f33ea6e90, - 0xdcfc94e16d8affd6, 0xc99d7f57e3d7659b, 0xedb2bd6a0c4e39b8, 0xf9fcc4b5ca6d4b6d, 0x83b6d8a59414aefe, - 0x340d49f65ba6e560, 0xdd8a9ddc5dc2cd78, 0x50aa99e0f58bce68, 0x7701edd5eded8589, 0xa440c45d9c1b277a, - 0x8e244ddd3f266aa3, 0xfbc8fc780f179007, 0xe3f6cf608ca2c9fe, 0x7e554ddf725b5776, 0xd5596051435d577c, - 0xd2be42e45a5c6953, 0x7588c40f5f057420, 0x048b8e1eda0390c0, 0x11090bf322ba82ef, 0xacce15d60ea33b0b, - 0x80ff8b412d9dc15f, 0x51ba50f173c0182a, 0x06291fa07310e6fb, 0x61709d3ea2dc1957, 0x6c3b3f4a1cb122c1, - 0xe9e46fc0a88bb474, 0x81104114d48a5cdb, 0x9b112238b8291474, 0x8f268571b6c6bf22, 0x99432a51198574df, - 0x4284c27ef9e12c11, 0xafdabec441abd1a6, 0x01d60b1c2c3cf034, 0x50c7881bd4e91df4, 0x8c5e109c288a5ca0, - 0xaf57eade593f6d43, 0xe9675eb53d7ea712, 0xf5a27e34a1ebf3ee, 0x6e9f0247274f08fa, 0xd0e4a01a53a7c8d4, - 0x5dcd767fb2a5a7b2, 0x9a83b59647514f49, 0xc65d5b9b896cc6ee, 0x8d82284856846ca1, 0x0bfb4456313e1a43, - 0xedbcb0fcedfd1061, 0xfcb0aaec91230f59, 0x510a1054d1d0c73d, 0xcdee0201eb9d8a35, 0x7aa6ed90e5782990, - 0xebb8f9e1b49bfafb, 0x2220a408f5f775e7, 0xe2e022d9df086227, 0xfd7d7176edeeccd7, 0x77ebe36a74115deb, - 0x3ebeb67decca1302, 0x7d9cb15b4b5a0ff2, 0x33eca1a5b2826537, 0x7b51035a33003d18, 0x95d0ba9e58d6695b, - 0x85fb74de5eebea6f, 0x43d6411e0c761db4, 0xb89002546021742b, 0x67662b23cbe2ecf3, 0xa16eab47b8fa0193, - 0x2ffd66f880c9a7ef, 0xf6d93ab6aafac239, 0xadbac6219aeb8911, 0xfb0a2a41e97b688c, 0xb416f47ad232af98, - 0x85815a43d6da1f46, 0x5661af3c6e68423c, 0x8f52fceaf73a8ffe, 0x6ffeeca77e77e7f2, 0xbcf0d3a3d0ebfd5b, - 0x93e3a6bc74be247f, 0xb9592bdec7c42f37, 0x6bd5fb98f875ff51, 0x744978aaa4edfb8f, 0xac8f8c7fb18f0cf6, - 0xace55a5a92fbf7f9, 0xe41b58f54e9fa023, 0x317e68a736e2b2dc, 0xf4dddb768ee623f4, 0x6da1bfac34baa0b9, - 0x259a7ffd1e1c9d0c, 0xe0148acb199939dc, 0x649d1f946aedc159, 0xf5fc008271bc34ce, 0x0f4897ac4d1e58b4, - 0x31ed9913bc89994e, 0x388dc8535938fe44, 0x497a36f85982db2a, 0xb8327d34fc92a4ec, 0x6ecc27a75899b3d6, - 0xf8d994627095b6b6, 0x5885b3d6f9d99262, 0xa480618a9dc3ca49, 0x6b315abafc4d8842, 0xacbfa10a86e8a5a1, - 0xc78307675081e28b, 0xf4731b80cbb89828, 0x185b6495f2a84217, 0x65a46750b46e07e8, 0xaa6cba57c1226904, - 0x0b06735debe0cb69, 0x847f301c26a42546, 0x209fec0fc650f36b, 0xb328010c36fdad1c, 0x8cc161c34fd67ed3, - 0x89d16486c8d75ea0, 0x071a17ea2e047049, 0x995961ba573ec815, 0x73db83f6c01cc415, 0xc3506d6b254ddcb8, - 0x68be425764361165, 0xd23d84bb0cd50452, 0x31330c82cebfeda2, 0x7635e2f84f4084b0, 0x3b6351cb7967a603, - 0x13d028bd7f03fc21, 0xff292c1ff12bc43d, 0xfa15b21d0ab040f3, 0xf8aad7b9c9e573b8, 0x9dcf157288dd91fb, - 0x32d72e47b9ed5cbb, 0x12e57638e5215296, 0x1182fc887bb3e862, 0xd42915ed447acba8, 0xf0549aed4387d1f8, - 0xd2c07af4afe19863, 0xe8c25ada482930eb, 0x140fac7ce1c1cf08, 0xb930869f606417aa, 0x68a2d0378e7f86c8, - 0x47e663c5f9287568, 0x1568bd15c4bf5324, 0xd757c30f18b67a1f, 0x70aaee822131b0eb, 0xce1732ed471438f5, - 0xa5e1a18b7856b3f7, 0xe69bee54bf46f6e9, 0xa33933a73ddd0f7e, 0x7bc086d9af97b8d6, 0x9670acf6bb4b2958, - 0xd113785a8f0d0711, 0xffea9303bb7ca278, 0x8c1e5899bc2c701f, 0x0e0412b95ce22017, 0xb9c14ae47149612b, - 0x7348517269e1d5e5, 0x642abb2441a66348, 0xd85e0fe723d5e672, 0x9222ee5777f4d02d, 0x88fbcda5d6f5e4da, - 0xfd941c373c76d5ca, 0xa05c36fe3aead410, 0x74f71d49327f5da3, 0x50a3a5b3505585ca, 0x2fa478243b7c8bd3, - 0x44a6501fe2d9291e, 0xedc38d00a2437d38, 0xe1c494b3bc785090, 0x894e9ef5d02684bb, 0x95641dc08380b2cf, - 0x76fda1ab3e2cc469, 0x9b4e5eb82a40d3ce, 0x7bf7a784ae37dade, 0xdad711f6382cc2da, 0x308156cfa7030229, - 0x39118f4a5534bf6c, 0xba1fe6fa8304d5e3, 0x6eb21605406a4cf1, 0x726d8a934d549320, 0xbaf3f3c692c1d81c, - 0xcee7ec8abcf3bdb6, 0x2bd097bd1449597f, 0xc5d63298e2223d91, 0xcb44be7a8c799029, 0x049993d14b0bc738, - 0x3b9145e68402f367, 0x819ecc1ffa945697, 0x754db6ae169bd34f, 0x4c89d4a6e3ec650b, 0xd216cb9dfc90520b, - 0x44ec12f3e07137a8, 0xda93ac295022fc31, 0x5c2356070af6a842, 0x219c0c483f2553c5, 0x2b0aaecc1343e3b0, - 0x54fa480be6ea3a63, 0xb96c4200daebae76, 0x02b50298cd647ec7, 0x404950420a77bd1a, 0x5a229f9b148349eb, - 0xf0b301cc9f56428c, 0xe5b20931682a80ca, 0x4a585e1e132bdf87, 0xc3ab4d96b046c98c, 0x5e5a9c8014e27e0d, - 0xed9c2cea9707c455, 0xd1b486bd3a48268e, 0xc5df9336a6fdf903, 0x7e223e2156dfbef2, 0x58538c8c24522b6b, - 0x5ecc281875772421, 0xf83be4d91e8eedc9, 0x017e532faad6f9a6, 0xb34d989bd721fc9f, 0x620942347704f594, - 0x65fe4715a0dadf03, 0x7d07af6a63490f69, 0x1857484ccfc95126, 0xf98d6326911a61af, 0xb31fa8aca7a2f4c8, - 0x4fa364280d22e620, 0xa0af90876cd22a42, 0x26e2fee5be558e50, 0x9f9c1ee3c210b2dd, 0xad5c74631508ac5c, - 0x8aaaf075af7a052d, 0xd1ede310a29cb221, 0xe47612af80460e5a, 0xb816a7a3d3279be3, 0x144620ac37930989, - 0xef8f9e7cfbfac822, 0xc22fbd6035018505, 0xa27f7491a5075ea6, 0xb4b6074fce3ce4fb, 0x1159beb52f825507, - 0x343c6cd5e45844cc, 0x8f7112bee85cd8ee, 0x4a8d7769d07afae4, 0xf40e03c3a07cddfd, 0x389a206e6e186b4f, - 0x71cee0ab6440f8a4, 0x926205032a4d5ac1, 0xf5ff40bf554f1e89, 0xfbcbfc3b50ca00c3, 0x53c96ce7d0e00054, - 0x092ff4cde012c86d, 0x80d8a10342d6b86f, 0xaf3f112b17a46075, 0x42b1bf3742eb7102, 0xada7e8f48d403c49, - 0x80783699fed69df6, 0x3782f23401e531c6, 0xf0c6608e12605ee0, 0x18445bee46609e25, 0xc0bcd222c98d617d, - 0x95804543f2f0ed6c, 0x32c292b411a8af93, 0x68a9fd702330c769, 0x3d06be692340ff70, 0x00f1f1e478fc146a, - 0x7d23ac2c3d8ac999, 0x01922874b7730766, 0x58af066a0333ad47, 0xef9f4948d27b77c6, 0x6d05c44d10fb26b1, - 0x4af1997e23da3f77, 0x608862e3e6305e25, 0x606cb05a2a18a789, 0x5528ebc2a600bc4e, 0x00d87809fa3ede2d, - 0x9b37e3c7d4f567d3, 0x49f1c68544bec027, 0xb33b4df6ae03e7bd, 0x9ee7278311f4b910, 0x577313486f1d48d3, - 0xc1350c55cc6a4684, 0xc25e8dcc9b00ecb9, 0x5d8633f0532895f5, 0x583631441cb1c10c, 0xdbfa1562ae6583a9, - 0x67d9be9965ebc09f, 0xe25030ee67ae4041, 0xed3b50c969f85dfb, 0x65e0c0f9f593fae5, 0xd2ede1efeeb494bf, - 0x73404081e70969b3, 0x6e04e0bd47eb39c5, 0x92dcacdbece21800, 0xa562cb6f84d1c81b, 0xad9f885310d85db0, - 0xba8acd6a3b1a3702, 0x33f6565c1ad62434, 0x5f6404926c5f1abc, 0x8d9a18e330ef19e8, 0xd76e8f4e2e45a2f6, - 0x895ceb2ffe2811e9, 0xcae9fc23544a3621, 0xe4d40723a29013e4, 0xdf7002cd5c38dd5f, 0x0782cf4620e60e08, - 0x91f82a11d9465016, 0xfe48a58ba74d7089, 0xd1fb0b43ef65f244, 0x8435ef2a2b76a970, 0xff27c93bdc1dee17, - 0xb92fc2e383b40228, 0xa628fe0c329e0462, 0x18df0f8ee6a98834, 0x6569c9c8bc39b3ef, 0x2e752458cea4f1d1, - 0xdb878f8fbe61fb4c, 0xcef81652787b445f, 0x51ea9b67b6106d6d, 0x245ecc54f0bbd777, 0x2cf8ecae353e39b1, - 0x057b70c63decbe1b, 0x9cc8557326fa9c3a, 0xe4018336bbeee266, 0x3a4bc9af9da662a7, 0xcc54e6f4a52dc371, - 0x4d5f42c52653c1e3, 0x58c1e32ccd3b1c3e, 0x3c7ef1d496643586, 0x6ce55eb8e366ac8f, 0xbc998a7efddaa129, - 0x28734a0a3b29d3c1, 0x31e129b2cdc135cb, 0x2a45b809e82c3f26, 0xf98f4ea02b52bae7, 0xa2349a65ebe18a2d, - 0x83c00d40c900a11c, 0x80a011cb50bc1a28, 0xfe722ad71dc7d423, 0x833e0b9bb3416b06, 0xa07d8d201153cc1a, - 0x08203351c425751c, 0xa367ef364006ce18, 0xd2213dde085288c8, 0x1a92ec5b9b404394, 0xbc1838b5056e4ef0, - 0x52925c0ad686a44a, 0xd04a81d98c4e4942, 0x799bfb3a50011bfe, 0x8632e18fb32c1b80, 0x68ba207c66630328, - 0x24b25bb356ad284d, 0x92baf52bd60a0024, 0x0ccbba6e058a93fc, 0xc4a1011b80f368db, 0x0448c705827076d7, - 0xddfe213ca30d7b6c, 0x74c53bff06d0f693, 0xd05e2cae0688a2be, 0x29243a411b48a4bc, 0x239cfb0610e86061, - 0x47998922064f6f99, 0x414cc2202a1b80b8, 0xfd7410c4ff7e6243, 0x88d50d80489521ba, 0x20629ce2dfbd3b05, - 0x072831baca5b9e8e, 0xbaf649e049eabc0e, 0xbc5160ec911f86f1, 0xc03565cc545d5e57, 0xd74b54a66b419eed, - 0x54b67d05e84206d0, 0x85bb81fe3203e82f, 0xef067a3b03e8edbb, 0x81dec9007ae76ea0, 0x1f6600fdf06ea01f, - 0x6500fd88417b4a5c, 0x5940ffcd8c756f3b, 0x1335c5c3d1f0ddf8, 0x0a9792afba73d294, 0x0ab2c2ae8d93e162, - 0xddab50b682cae748, 0x4d9eac63f927dd83, 0x82994d258663ad9f, 0x7e14a5432eb105df, 0x0ff505bd7b621411, - 0x8ebe4cc56718f143, 0x9f50eb7ec5e3a13a, 0x4a6329a6d80143ec, 0xb8e75ed72ad1d1c8, 0x08996abb2a1a2173, - 0x6d4f672364b1ad95, 0x383ae325531b2aad, 0xd89f262332413e24, 0xbb646badef74065e, 0x79ddddeb541e3c50, - 0x263bd093c5f10f8a, 0xc6444c9596574eae, 0x98ebbf1a4c7064a3, 0xc1817efcdbe9372f, 0xff75f1faf8f9d14b, - 0xf8be2e44bf8e0a85, 0xf3028ea1a4004cde, 0xafc87d0dec1fe219, 0xc5f61aaad190e94c, 0xe00e16b702e3fc1b, - 0xb1a096ded786d45b, 0xf3eecf3452a092f7, 0x4e07e6ba7ff3eb68, 0xb975357b43aa0917, 0xa4a12ad60ba4f278, - 0x8c43736a67527052, 0x48bfa129b4988e8e, 0xfbd67e5d39ef305e, 0xab5dad90871f8c71, 0xa797fc51acdc93b6, - 0xa33210c82ea0cbda, 0xd2c6578d322ae14a, 0x131a956b7a9d9cf8, 0x7acd0a7733b470a6, 0x301f5939024d7352, - 0x466060781967f05a, 0x177e7f419e8d0306, 0xb87a246e2fa07a6e, 0x8c1f8383cec43f49, 0xa84abc5126f35ba4, - 0x9e81eea61880b02a, 0x832a7f4e744b7307, 0x6f28b0f0008185db, 0xfc160f1808cfbc12, 0x2e1096939dfd90e3, - 0x222c37d63751ee0d, 0x9c2325153734ae62, 0xf190f84c816e07f0, 0xa0e5229ba73e9b61, 0xaf0de00cbfc0e064, - 0xb13ee7c4753030eb, 0xf92e690a6da314e5, 0x0c0d6d7fa0896f02, 0xd224b370b7acd7d6, 0x3551c23448a8fdd3, - 0x89a96ba396794a5c, 0xe24be484b4d8607a, 0xe40c0213a5a00725, 0xe39ec170b7b7ddc1, 0x479e55301fc56030, - 0x9f0ee857dbd40ba3, 0xc424a1026ac46a36, 0x00618442932fbc90, 0x27a9a52d781d5563, 0xafb0c4ab4b292b9e, - 0xd432cd5728d1ac30, 0xe82275f00bdad6d6, 0xcd566364730fab85, 0x32cbdd8c229b91e0, 0xd31a8d59b3a6d13d, - 0x7266b9b6d15ec40b, 0xbdce62a3809bb3d0, 0x528b2f1358160514, 0x48391eb8ef59233e, 0x76b1e26faf501694, - 0xe0c63bab329067a5, 0x82f1ce1187cf0688, 0x9fa386ddf7121331, 0x96075be5ccb63da0, 0xeacd34201f9db0fb, - 0x36335b075a48c2a2, 0x70cfa089cdba5895, 0x155bac288eb96e5e, 0xc8d6c18f70ad4ba9, 0x9fd6a98467a000ee, - 0x425fe528b6f264d0, 0xc5e8a4d3384c2c43, 0x6850806a437ac72a, 0x8206b4ba93a3d2b8, 0x284218ea2e5bb961, - 0xc94f66bfe24c725f, 0xc3d569fd61873fa0, 0xd52839fa6c3cecd0, 0xd0e4c8d8a10f9aff, 0x8e0f17dce3fffc94, - 0xd282e0423ab10f3f, 0x3c78a0025c5e8819, 0x0cc7a40fe4437f49, 0xe0b20bbe09c46dc7, 0x33daf3d0dc6b6c75, - 0xc106a00cf993c572, 0xc893e83ab60e24ec, 0x46cd11f70ab62a57, 0x1cf15e1c5488556d, 0x04c71664ba3a9291, - 0xf2b2333a0bedbee3, 0xc2f9ee4bb6757f19, 0xdb013922fda5c2c2, 0xb74b8907821f4798, 0x3393ce218e156ed0, - 0xf94b69c9a1f3c189, 0x547f59884e3a8707, 0xf142d7050a6a7d99, 0xbfee5c465d3bdb8c, 0x1e3dcfb12784b8ee, - 0xa124df698a79d637, 0x649c4b92b8d7134a, 0x545d902c1ceaf715, 0x832b384cb6273b27, 0x884440bd8158b842, - 0xff8be838c8d4ee9c, 0x704f863e754e82c8, 0x6c6f0793294c7d32, 0x59f48e1e4fe6f3c9, 0xd576e92038d67776, - 0x820b8f14356e331c, 0x1b1d8a91474c5210, 0x9a8a0a1c5c3c8305, 0x52f3d302f919d701, 0x27443eb0ffbc6b4c, - 0x74c2ab82eb7be147, 0xc4e5bfc0b279fd91, 0xe6ff8c1680fccbe8, 0x1893fc84ae4c778f, 0xf716bb8597e1f5e1, - 0x187d2c8b81b5fd0d, 0x0d9005168d09fbea, 0x522eb106c4eb1fea, 0x09e0e7362371edda, 0x85c8f2e5dd0b9a30, - 0x06a5d713c2325ce0, 0x25bb44330bd27107, 0xc31f31ae8e29264f, 0x618315901b0dcb88, 0x029d474d6b7aa4d9, - 0xad2ff88992c1b211, 0xea0c0d1634f505a4, 0xc48c3cc40d91d378, 0x106ff52a4dd4955e, 0xa0729b34833666f0, - 0xb593fda284dadcd9, 0x99dc8d12aed3a5d0, 0x2ed0b90e2e407b8b, 0xac3b95b222bf7701, 0x2f5cb327203b96c2, - 0x70c68d363345b7b0, 0x29cabaad37d5b3a7, 0x09c1c3c22652fd9f, 0x43efff9e76b8ccaf, 0x9e644af1ebe9aa0f, - 0x03c485d987453573, 0xda12f6483b344c65, 0x983c4d98c2c1109c, 0x741b0b8a6f3790d2, 0x846cde34d3056f22, - 0x0f82700d6288542f, 0xbbab60c5f266f381, 0x997e0b28f8e00e90, 0xf011ad8e98fb4ccf, 0xf0524e09d83c9656, - 0xb522e648f44e5c5a, 0x7a676125c105d8fc, 0x68320aef3e1f6c24, 0xda3fdf2e8b2d76b3, 0x1d568df7ccfb6b08, - 0xfce7d85efd68859a, 0xd461bce96011deb0, 0x0cc5ee3828ac41a2, 0x1d7771cd1c7ff4c5, 0x8706957094719c88, - 0x7fab4e40eace95a8, 0x210721ffac4ed7d2, 0xb8f954ca04618ef3, 0x830d779ca0c93d66, 0x9083b0d2e89b5687, - 0x17ecd05661c3a685, 0xa8e208e162e33275, 0x66bc9e5c878becad, 0x9b4dc162771da207, 0x768c6a31fc7f66e8, - 0xdbc91fa3655a87c1, 0xc79172cff219cfc1, 0x03dae357b002bc7f, 0xae6703c263463b74, 0x4919e39848ac9b16, - 0x8fb2ba7e6d509307, 0xa33e95221ffcb07a, 0x411a7b89a495713a, 0x9f5c9bc9975d3ce2, 0x9f49c91e9b179720, - 0x51204446bbad7e5d, 0xec42c497d8b8d7ef, 0xa61869d7652c857d, 0x0ca5e294d7f40a0d, 0xb1e01cf8d0b14269, - 0xf15804072ad0890b, 0x0e86f0d699414834, 0x99c2eddef8c054b5, 0x6615b088ac5a6282, 0xc8600f8dd512da08, - 0xd7b41450eec8ca5e, 0x184d70d701ffdd36, 0xb40c040dafd85ad8, 0x1ceca6302de11c29, 0x78bc4f0566027aa6, - 0x6c6f1b13ee0a62e5, 0x24e552a05b2a078f, 0x53619cd1c6a5b158, 0x35bec382cbf72a52, 0x99681b38ef2a06cc, - 0xc1bd18ed98f137c4, 0x958d3967dcde42cd, 0x4631607e7e8a46e3, 0xe562c6c5dab0ae42, 0xd59d3521ac3faec3, - 0x76436463792ca6da, 0x5416c87aeb97dbad, 0x5e59baaf30a58d89, 0xec8ae2093a79108c, 0x756c0c8247c7f0a6, - 0xcc6c5fc83836088a, 0xc7ce5a409e656cbc, 0x5176f4c69b849529, 0xbc22580cb571553a, 0x50734f08476cb602, - 0xf2724715c0f744b2, 0x56a92066e3f779d0, 0x4e5afc6d3a44e236, 0x6ee97805451329ad, 0x4d5abcadc02b38f0, - 0x1d4bb7e04871be2a, 0x7e48acdaacdb420b, 0xd34c5362b70fbcf8, 0x1e5e7300447b8ff5, 0x9b79dea6a2502809, - 0x11814a756ee0b620, 0x3e5dc924d489217f, 0x4726cd6b09a8238e, 0x6b11f27d3778e058, 0xcda1294a2496863f, - 0x0daa1479208e6adc, 0xbe675d17430743fb, 0xb175d464debebbed, 0xd42af566a3d8a200, 0x8cd0e481b8f2f696, - 0xc70418f16089079d, 0x1d5d048108892354, 0xe6dc82adac63a23c, 0x45879509077a97d0, 0x5d773b6b20aece88, - 0x8c6f4738228b7c96, 0x80af11c586c51d90, 0x2247083f9f1f7907, 0x2af0026ce0e837c0, 0xe0edc7cddf086f84, - 0x6483e44f6260df09, 0x5fc3f4046f935959, 0xe339f81c480356e1, 0x11c1cd88d7de9873, 0x00dddacd8efc3cbc, - 0xa7da0ba433ee943f, 0xc8223be70d52efe3, 0x5a9ecd78194a0eae, 0x695872f6214829be, 0x554e933280bcf03e, - 0x9ac6b4efa2223547, 0xe3c3634a25d737c1, 0x730cfd7b510392f0, 0x204b5ac2dcb4e327, 0xfe7195a82c3494ec, - 0x789f6e977c790468, 0x6857b33b51ca77b7, 0x5eb6bef4579e9ac1, 0x86be1c1f79235962, 0x8b847d4b5197ae20, - 0x34eb3c2974a229b9, 0x7547ab20b0b8dbdc, 0x9f4214840caf61cd, 0x8fab02d1ecc3f22d, 0x7758bb53bab80278, - 0x45b30de4b57c5b77, 0xf746aad1a45af789, 0x7de6476070239805, 0xa8a5bccca7ceb531, 0xc923d3071e16a42b, - 0x565a34e119025457, 0x8285f0215e547310, 0x4a3e5c9ef4725697, 0xa71c6e79e3448ec5, 0x33b8ad566eb6cd16, - 0xed7a39d12bac17d8, 0x27b36c35b4b6a6ad, 0x072bd697cfb15c7a, 0x2bda4638a42f53a5, 0x1860ed867f43c081, - 0x96f00ae8f5cb1d6f, 0x81d09daeb719a364, 0x1d97168459be300b, 0xb9429c2dc7ebb08a, 0x9cdaafc2a2029ff7, - 0x0cef36a9025ca315, 0x1d1260a54b289404, 0x4d2b1b870a07ab93, 0x0909affd2b396299, 0xff3a9021ce7dab74, - 0x3654b6943d110bf2, 0xe35177fcb3339412, 0xf761bea077cd4691, 0x75aeb9745a759277, 0x9d11fd6f1d62dcdb, - 0x9f34d056155e31d0, 0xb28d30847b5f3fbe, 0xb00bfc25c797ebd6, 0x6fddf8fa9cf742fa, 0x1c8a1d7eb85ed126, - 0x2692b9d3c1e98e42, 0x615ee85d775e7f18, 0x9514127f5e2a1987, 0x6521c9c35a398737, 0x9d36a193bd8bc930, - 0x4f3707ac96983f6c, 0x7aafbc6af2a7b9e9, 0x035f64ff1fec0545, 0xacdfa5238804eb7b, 0xe1fb3f86e2ecc234, - 0x5534f8fb6fbac15e, 0x4edd8d9d7ba4b5da, 0x106e2096bb9e7c77, 0xc7deea0516fcaeab, 0x13a25a3b7286f51c, - 0xfce7ef69710bfbdf, 0xae4eef6a773bff8b, 0x76b5efdbebbf9d9d, 0xadb3835cc95fb2ff, 0x7d1f6cffedff6ceb, - 0xfaff9efe77fcdefe, 0x61fcbe77bfb5425c, 0x17939e253414fee3, 0xe78054afb8312592, 0x743b33d2791dc6a5, - 0x0ab1e3cd3861fc85, 0x9b8da0b5fe07c868, 0xb54de2e7d1bda498, 0x5662878cdbc345c2, 0xc4baab64db5fe292, - 0xe63de4fa7acef6f1, 0xdedfd35f77851a17, 0x9d2e2493f0a34a86, 0x0db083eb176e6f8b, 0xbb0881bebd7d0e0b, - 0xaefe76e7629f0308, 0x1e94db25b690eb21, 0x2a9305590248b2c4, 0xeb17166cf9f3af21, 0x7086db4ef0caefe1, - 0x59631b99dda92306, 0x9d0b7c652772b835, 0x4ef7386c350a1cda, 0xef23b4bea2d77096, 0xcfc1abc2f42a079c, - 0x6dd2f4c3aff31d65, 0xbee77f11c5c65c41, 0x2901b9ca65a8fb1d, 0xbc3cd0f03ba23027, 0xf0fb878815dbb9b3, - 0x83d26eb997d38a40, 0x0405ddb6f890335a, 0xa1d9a0d40123b5c1, 0xd607f2064ddea411, 0xfbc5dd72a3be5bf4, - 0x1be2136a2378cdda, 0x6eab1687a7089305, 0x90d3ba6d38b872a1, 0xe84eda88befbcdca, 0x6eb5582c56182751, - 0x02003043ceb5b777, 0x4453f24ab84d1e12, 0x74c8c9019b0aa1cb, 0xc4ef27a0e9713fc4, 0x541a5a9f0343dccb, - 0xc66f9d87fa6644c7, 0x8d5d65120cf33cef, 0xbe41dfa6c410563f, 0x1d130f53d0def2c4, 0x1c23df116b7d97b2, - 0x4a03139ba3768f26, 0xbbd23f071f67f1a6, 0x683849255eed34a8, 0x18fdc3a893adc856, 0xca96ad9c2d5b85b2, - 0xb988ea90ed19ada0, 0xdcf87de69e302600, 0x1ecc1073305faa94, 0x53addcedd59d17e7, 0x4c8c373cf4ea19fa, - 0x433462ad1f20ab15, 0x06d33a0f5a230334, 0x6bd51eeb5213953a, 0x6d748ad21239c58c, 0x95acd632d49bb025, - 0x8901a96b5224e3dc, 0xe027c2476d91dfca, 0x2de57f69d0df7286, 0xe99678e27b088741, 0x1b0d6f0c6c14b394, - 0x4d89e3a65c420403, 0xa6fbf10f55f42752, 0x979ae062b093fbbe, 0x54cc79441ee801b9, 0xb6e877afcbc558e1, - 0x62d1ccbb75a59f9e, 0x1c7e152f9cb9eac3, 0x173fc4cb8696bb38, 0x65691394207c018a, 0x9a387c496a02bc1e, - 0x41c9ce7f7af4e4f4, 0xe835e7d91a4fe65b, 0x088149030103203f, 0x1b0cb6fe56ae151b, 0x855c1c9e3baf024d, - 0x3d1a637704a7d5c9, 0x9d7e75126b2a629a, 0xaec5a5b4012e887e, 0x9a1d978b57c7df1f, 0x7d73eaa1540e4daf, - 0xe14cd680af877d04, 0x76c251c6afb4da94, 0x32aef3d1580e3586, 0xbd1c329d1b6d9d47, 0x2f28e198688c3f7a, - 0xff70a4b43ad2b4cb, 0xd2d13f1e4391b43b, 0xc2821a9a86099f24, 0xbf4e86fd2d473322, 0xe374c544ca327edf, - 0xf27104ddf9aa8b15, 0x26b88197b32cd8e4, 0x9506fec8c6d42a98, 0xcb20e87b603fb771, 0x137e5706c41b179b, - 0x30203a367d12e13f, 0x8e05f11af3bbedec, 0xcdb0a2c7efb7b1eb, 0x5bb5cfb7b1fbabc1, 0x261bbb57f2ae1bbb, - 0x0764d5c6ce63845c, 0x9d916dead67c8255, 0x757a85adfe13f773, 0x4dd00df673b33bdb, 0x9d76e36df3c5cb17, - 0x479fb86fc696f1d5, 0xfbe2c9e9efb72f3e, 0x3d7a76f8ed37af37, 0xda1b059fdf676f0c, 0xe1936963f4795cb3, - 0x31c65c6a27f6c6bb, 0xed842f78f8aacdd0, 0xd1a71b9e936a3ce0, 0xaae36facf6bff206, 0x19db60eebc4126e6, - 0x6c5adb92fb928de1, 0x613d6feee65fc15d, 0xecabb3570f5fbc7c, 0x7d7172f4e4e5572f, 0x8e7f3c7ada299ed3, - 0x4475937211650363, 0xd729e11bfe4ac2c9, 0x11259591c46f92f8, 0xeae8e4f9e18ba317, 0xafbff9e1823e57f0, - 0x399696cc2890aab1, 0xac02b550c84f6f6f, 0xc9848505925a6abe, 0x827ad18dbfeeb427, 0x1ccad34e96f668e9, - 0x4071679511583ae0, 0xa31b3588db8b8874, 0x19dbef75696fa8eb, 0x5a29d6e968deee2f, 0x3b0be3782875078e, - 0xae3bf9c3e804ae5d, 0x21bd4c4879dedcbf, 0x6141cff2ecfecdf0, 0x2097a3b02d4b78de, 0x5ceedebf3959deff, - 0x08079ae4dee8aa73, 0xd8d93f244f3ed165, 0xd0eae4e092ac490e, 0xaef39751b5d0a61f, 0x55fe71854ae30c11, - 0x6cff284349b257e4, 0x57b9a8f2939723cd, 0x01212725c21d0a17, 0x5039c661d64481ad, 0x70ae8b74c6e3e03d, - 0x72358b10bad20b44, 0x086856b1adeaa89b, 0x3a843150401b26d9, 0xeef0ea53d36d454b, 0xe523374a7ceef4db, - 0xcaadb33bbdfa58ae, 0xa98ff7bab1955365, 0xa8ea0ce380370885, 0xb7453cb117eb2cd2, 0x08d53dd8665d5ce5, - 0xa0abb1c5ceeb7ee4, 0x73acfde615a463aa, 0xfda43b7d6cf753fb, 0x515aa1ebc73ea832, 0xb3ef1d3a039aaca5, - 0x58d6523cab3ea299, 0x1255e986922258e3, 0xf656a5db37dd373d, 0xfcd434a135d7a09c, 0x5c594daeb2256f72, - 0xdd34a37479b1b886, 0xbf583e7649c40a65, 0x1b0553242d7c66ab, 0x2b184ec216ab58a9, 0x94ead56634809555, - 0xa9de6834caa57a84, 0x0f4fe192887d2201, 0xc2c9578ff3670ce1, 0x1cd550e11a18672a, 0xc1c55b8808821295, - 0x4aad56ad56cab7d3, 0x07e55a0d7b1eecb4, 0xe4fec441435f099e, 0x913328764685ffce, 0x71b152249fc7bbfd, - 0x09fbfb3b1b6d4fce, 0xed141f6e8fceb185, 0xc28fc3e9e22d1c7c, 0x232d8fb48200eb22, 0x23dd98789f706d42, - 0xd0b6c6300a55f84e, 0x3ab8ad22d08bed12, 0x81ef9e2dce777f7b, 0x3f44ac99eded85b9, 0x3779f060b13da21c, - 0x7b6395a2371ac64c, 0x830386303ebdbd55, 0x2970b9c529b5826c, 0x8294acea5cea3a46, 0xdbf664c4d99d1af4, - 0xf9a9db29ef764d3a, 0xee5dba85f159976a, 0xd821833a7ec7cea7, 0xce5463ab9f5f69b6, 0xb19fbfd3de0d6343, - 0x803ea1ed2538513c, 0xabd0a34a8fdab9b7, 0xf783239ac2dc2e15, 0xc4dbf5206a0442bb, 0xc2eed857188e4d28, - 0x6208ecc2aca36c3c, 0x29b20edd839b58f4, 0xc95a53f20751d1b7, 0xb823f2ad3ee90d66, 0xb36f7521e1088616, - 0x39fb6a90cbdffb9f, 0xc1eded60bf469688, 0x031a2e4e26533dc7, 0xbf83cf8021687adb, 0x29d79bd54aad8a48, - 0xf670aa4b6e6470b5, 0x7a49268bfa4383a0, 0x48b38e142c445ed7, 0xf8611929d2f919b3, 0xed5de77bea25f092, - 0xf40662f3fda3206b, 0x5f0db24e520c35b2, 0xe44da11af0aa374a, 0xc566b38e299bc42a, 0x162c511413f49015, - 0x9b4e67df659bcd98, 0xcf5edba88425276d, 0xe246e940f968b67e, 0xd19d8c66326055d8, 0x9dec0d7727902238, - 0x17b493f308f64c15, 0xd01a6a0895c601d6, 0x43a6b8598ce8f76d, 0x47af66b7d39d0a36, 0x5614a94a912a1711, - 0xbb525b842c539d22, 0x5529d29222ad2cb5, 0xb48ab74d2e846d85, 0x4b958a596a426e2e, 0xc766d1493a8ee553, - 0xe940d557a9964b28, 0x8a89c67c8680d39d, 0xca8955c1d51d9b1e, 0x58674ef86beaa400, 0x47e2de523a29a09f, - 0xdbb80dc7ba4fa06b, 0x0a0b63c2cba90d95, 0xea61d1d408171b95, 0x46b5d42c4b724b25, 0x974bd546b559c1d6, - 0xc3c965d510bf79e5, 0x924f108b39223509, 0x4665ec63aa6774d9, 0x16d3d84d5059855a, 0x760ed42459d1cb9d, - 0xb3690443b82a4509, 0xf04b7a4068db6449, 0x1762242a11721052, 0x9a1eea8310e48125, 0x48437ab665b03233, - 0x562847abc403357e, 0x6a820cd80a3dce9c, 0xcc444f5a4862992b, 0xcddb5b2ea4fed69a, 0x07936d350b631bf6, - 0x4453b9a6075aac37, 0x6b4405a1b5dfac1a, 0x6364d62ffb6ad62f, 0x2729b613802d1827, 0xd626350b8ac54c64, - 0xd123603535d22418, 0xdf8e7f1e43c5790b, 0xf36f0b214964396c, 0x6ffd1d72287030d6, 0x24de0b0a8bc532d5, - 0x3039249e58710a2a, 0x8edfc44488e97e5c, 0x60ce16d4d5829d9b, 0xb2a8cc58298e5e74, 0xde9a2e4f74e5f664, - 0x1d8a56bbaabdff11, 0x840f92182bb14dad, 0xedcb86dc5f75f757, 0xad22bf9ccb751339, 0x37ee2a63e59d4b16, - 0x314bba6618d4c6b0, 0x69af511c5b6183a4, 0xa546760bc548d7f3, 0x2c893dcbefed17ff, 0x0eddffe863830ba2, - 0xfef72998d2b71f52, 0x4db3528b808ec6d3, 0x83e15e5df70fe088, 0xb294356cabef3a22, 0xbdacb47ab5a7f94d, - 0x04f7a298e1464876, 0x0c240c0355c431df, 0x955c50101b66a3d6, 0x57a5e3a810872702, 0xb00cf8b9127d29c4, - 0x8e10f5cc0547ac6e, 0x627c5d8e8c68e4de, 0x8e26bd9f3d49ac12, 0x9b6791217a90cc16, 0xe041ab09b42c9244, - 0x1fafee54c1618db6, 0x6967f8f732ed1e81, 0x056615c5a69ed28d, 0x17b63ac5fa052172, 0x944292eef43d9c11, - 0x613aeff8282a28ad, 0xdee44c96fd98fda0, 0xa41bdbe30cb54f1a, 0x9c2b579361d85d91, 0xb79e80f30c5e37b1, - 0x76951f1b5b0e02f7, 0xe055d869ee865e85, 0x938ac7ca8553094c, 0xa7210e5ce5a7ee2a, 0xa56a9b223ee1a81d, - 0x5b6d215443453355, 0x93c435d546f2dec6, 0xa0075286927058e0, 0x965497057e7f6452, 0x61b31b56139b555a, - 0xafd246966654be9c, 0xfbfb5bb9dc965543, 0xfce694addf1ca138, 0xc7cf55319316336d, 0xfbef7cd3ab7b22bb, - 0xea910b78164ec9c1, 0x2e1ce926dfc5a064, 0x3180b22147ff4d54, 0xaf3fe8bafd8c898a, 0xfdcfba568f0a9504, - 0x1556b64a7d36f185, 0xd328465e8f92cd4b, 0x47dac235918f83a4, 0x60b8095d3eab7311, 0xe737425b6f5635ed, - 0x35bb71d850fa2fb9, 0x458b3a827385b692, 0x8c416757425b6845, 0x87bd40aef4d3c974, 0x0e3a2564aec7dcbf, - 0xf9e44ac5c22775a0, 0xaca1e13a5287993b, 0xf553c170a9bcae17, 0xac6bae5510538ba7, 0x7ad294ad556664bc, - 0xeb9cb9695c744ec6, 0xfc1b60618d212bb5, 0x7249ebccbf38203d, 0x130145720643849b, 0x2dfd0cf2256c4f2a, - 0xa2da2eaeaac5878e, 0xd9b0946afd18024e, 0xb53241806dde89a9, 0x7bf47f7fea6fdf7f, 0x8423eea047815d94, - 0x3b32364938c6a630, 0xe65ca7a33c84d878, 0xe14b8c835c61282b, 0x2647a5831343d653, 0xc6251efc1c13d326, - 0xf2e17f9154661781, 0x64bcccf0682299e9, 0xea0e812fbb08aeb4, 0xd4e2d0612cba1b2e, 0xac2893900f660d42, - 0x141be9dc616eb4aa, 0x34934171ab70e693, 0xb09d98b1d52d393f, 0x61cf3974be37a943, 0xf86fd2777463ad3d, - 0x8e751091ed4d9514, 0xf812a263297b704f, 0xab06212ac270f6de, 0x6683e0345ed2f1a4, 0x9a1e372701c7222e, - 0xbd8c20b674bf815e, 0x44d6bec4961e75f6, 0x4712820b2ea66100, 0x921bf63bb8ecd14d, 0x99801711a17c670a, - 0x99a46a6c051609fe, 0xdd7b284a6460254c, 0x0848d6c598d477ae, 0x7e48201dd1802302, 0xdd0cfbed71b4980e, - 0xdb4378464c028c0b, 0x5958af3e41abf541, 0x2f3f4b73cc79661d, 0x82ce043ebd1ef4a0, 0x14612e98b4ffbcc4, - 0xec95f95adc1defe9, 0x690c4f5b79788c55, 0x4ba10347bb8e2ae0, 0xf6651c6dc3a52e05, 0xb13b1b93bc9b2669, - 0x600e9df933360013, 0x8a1f4b5c9598793c, 0xa1794c4011662a38, 0x2d15483dafc320d5, 0x649f00b47754d1e4, - 0xd151f403ee445328, 0x88fb43e7a30e9f9f, 0xbd3caebb9c8f6edc, 0xfcec30cad418ded3, 0xe3eb331d4206fe95, - 0x43886865d0c35e36, 0x8497f3e480a0eea6, 0xaef6d66eee221955, 0x13bb7c4bc761f9a6, 0xd081de3a5c56fd35, - 0xc1fa9b7df555cd4d, 0xebae601b5545e55a, 0x5d5aab81a4f5d96a, 0x200d1fc8aa8e5b0d, 0xa8a90091b753f698, - 0xb02e1e0527736999, 0xde2991f97d287f56, 0xd300db80178b2b60, 0xd4cb88fc1fa9fe28, 0xdb7f28e87c7637fd, - 0x196d804c4d3ad9b5, 0x87935942077ce5f3, 0x3d8c14a902b5f303, 0xb97f443c726d00b8, 0xa2f2abde19e5c725, - 0xf1002fa573486a04, 0x1bc4119681e7b734, 0x4b3893bf66349dbb, 0xc7ab4b097f719a1c, 0x27199d39d38ce205, - 0x87758984e3720ce1, 0x33f5c12a6293ad3b, 0xafdbc1f81aeb9cca, 0x5b53f7744f33c4ee, 0x1f8d0614b97e8533, - 0xdce0599b36ca153e, 0x6c363519beabf3a0, 0x6cde493fc9dc5da2, 0xfdad1cef09cb77c3, 0xca5cc28a5c6e63d2, - 0xc277b99715415d7c, 0xb5a93188f5d7241e, 0x85b0d30fa61495cd, 0xe4529ea7d382fb07, 0x4bc72e2257e7bc0d, - 0x8a481ea8d29555a5, 0x89ef520b72e2ea2a, 0x6de5564b325be41e, 0x8e86efc634965fe1, 0xca1310d138993d64, - 0x7efe0b22ed500443, 0x7cee94f6f6cae5db, 0x7a0b0a2469e220d6, 0x615921ec89d937f8, 0xc623a91e5b89154f, - 0xf78f9d3e3bb687e1, 0xe8fb8e8761b89aa0, 0x839c38ce06557ce7, 0x1086954b9f2e87f0, 0x8ac5932519be839a, - 0x28a350b660be4555, 0xf6fdce91a50bddd8, 0x4dc4c9f76fbaf827, 0xef3ffda45464c39e, 0x0ae597f15e90aea5, - 0x3beadcf0950ef839, 0x7321d3ae46b84e69, 0xd797fadc4b11783a, 0x9d2f72bf7c71f0e6, 0x55e9fe540baedd9e, - 0x1ee29a583b8aa7d8, 0x9bc565ee97376d29, 0x77fdc5c11754ae5e, 0xda2de107a7e6a688, 0xbb2fc0a0dc6822b6, - 0x94482cae13f4eeb9, 0x9c0aa4dc154e6354, 0xa678959384ad5f0c, 0x94d1d9c4bd123adf, 0xc9ebdf7cb5432815, - 0x965bc029f7aa787f, 0x8a38fdb1356f4d64, 0x9b58cee532fa71d8, 0xe98dbab3d90da609, 0x96b3450f6c741e71, - 0xea03fdd199cba6e2, 0x46be5fba3fa4104b, 0x1e56f4a75ef67134, 0x5e998b9ba6567280, 0x96f9c5c04516a3ea, - 0x69cfe55e0ae03497, 0xc09013a49947e4b3, 0x641fb71ff977f0b0, 0x1fcd21561b74de41, 0xe7d285ad6128e8d0, - 0x570b821f08783b7d, 0xa4ed09ffd8abc288, 0x2f7741fce7f9b353, 0xe47b563847576049, 0x598c31d5c1f5e390, - 0x3633cb6171af0316, 0x68b64787a65fbbd3, 0xad8b5ea736684447, 0x23e846476ff1a318, 0xbd1b4b3f6e897462, - 0xb6f5d4eb51d27a58, 0x4032825dcaae2813, 0xc8bad4cfdfa6c3b9, 0x5a5f70f0d4f78ddd, 0xd18863eed9a46bc0, - 0xa680fbb40915559a, 0xb4eee5e525095475, 0xe270463cfbbf0096, 0xac5f6064a1961724, 0x3e01d899c9d81ff6, - 0xbfc59e783c16230a, 0x953a1953d101d4b9, 0x66464ca34544795a, 0xd97f550d0965f4d2, 0x1e62c718cf9710bc, - 0x224ca6a9c9ecaa7e, 0xf5b840a49284ba52, 0xbc84e810acbd48c6, 0xf449d83462df4c36, 0xb75dd269a4769ba0, - 0xd9b655214cd05d8e, 0xe3d6478026bea4fb, 0xb239539de1e63d7a, 0x2b5143b82b94f053, 0x098715c95c3cb43c, - 0xd80d4a86ab636c36, 0x9e8187c14fe7c756, 0x84dd57c7c975078a, 0x370dd440b17a63a1, 0x1638368596b2d239, - 0xa6631215ed5ff420, 0xe5c2f4daa2117234, 0x9da285392eb30571, 0x5c770b8ec9117412, 0x02b9680b26255b97, - 0x23e424ee00ab349d, 0x5dbb4ce31142c3e0, 0x404b054474ac1cdb, 0xbb145282368b843f, 0x050c7b6a875678b8, - 0xe9367e9611622218, 0x0cc7e3c1946780e1, 0x49e5b2e26a30c1c8, 0xcfc39a259931d06f, 0x9f820adc9c58e0a4, - 0xda0bafee4523e5bc, 0xbdc55284f1774501, 0xba1f42670d88f270, 0x4c23b5a77a206436, 0x97198932eadce666, - 0x264d7d6f308fc9dd, 0x39dd60685dfc4567, 0x3f81d30e74628f46, 0x07eb68578c16e640, 0xeb244f91bc8bddbb, - 0x4b5a01009f071bb5, 0x183c1f8229987767, 0x3f332c8c0a1aae0b, 0x48b9c1785c0d67ac, 0xc8341921e411d8b7, - 0x022e25de0fc6f9ae, 0xe946373a8ca179a8, 0xbdd4365c4a230870, 0x60ee9945c3e9ec1d, 0xe83aaace4ea18358, - 0x08a86192a98bb4bc, 0xc04ddb7f4b51c493, 0x9b4e6019721ca2ba, 0x1012632eb920ad29, 0xe9cfd642b47e7298, - 0x087cc9765bf9bfa9, 0x3ff661ed52e8983b, 0xba1b971c04c126d0, 0x96bfd89c4fbb2059, 0x262e28f49e8a6d70, - 0x3a1cf09d10526989, 0x7cded572025aee1e, 0x7f94eb27fdc944a4, 0xe63b19d4e54a2542, 0x3c1bfb567f88db26, - 0xbd615a431704b097, 0xf03bd08f51c17628, 0x5ac0a2734335b7e7, 0x116e7c5ca43144f9, 0x98d386e188e1e0bb, - 0xd8ed297ec9643670, 0x3a6a3aa06860029d, 0xc2a133b68ba86bc5, 0x044edb5846b1008e, 0x989c11fde529058d, - 0x4fa3dc8973d51108, 0xf5f1b80f69242daa, 0x7a85f1c8a78f5f64, 0x5be309f6d150925c, 0xbc9e301a388ff571, - 0xaa745a4c29bc8f4e, 0xd2a982e34c921c10, 0xa9aaa404864cc2a1, 0x26d8c4126c929d60, 0x239859196982d752, - 0xa2d8e821aa8f8855, 0x0e531461a2faf499, 0xfe2e7d1230dbedaa, 0xd57a85d9cb9cdcd0, 0xd28d841c6d49b486, - 0xe02b9d7d39eb82ff, 0x82319977820e9e18, 0x1c6a02a282c5fb11, 0x1cce4db39382ccbd, 0x30ed801afd648109, - 0x06bf7f944eb6e1e0, 0x21252e63bd630ae2, 0xfc4b5363b94b0a53, 0xb8391c2edf5030ad, 0x40f52ec15423ace3, - 0xaf5de246f9f6567f, 0x538ea3872c99f362, 0xc828bb9e392386ba, 0x137cacdfcfe2b212, 0xd9d1d5c18e361986, - 0xb000a475096b9273, 0x7c596047a595ea35, 0xf9de884e373c8f88, 0xd284082fb0587e3d, 0x008966f3614fafee, - 0x1ef3ff1184d02be6, 0xe3e1181eea561f11, 0xbc3cfaa71c0c0c1c, 0x5e9e57427172c88f, 0x18041de37c359458, - 0x2e2734ba0f0dc240, 0x5849ae86e5e5d13f, 0x63703eef39ca8095, 0xdb985510b183e210, 0x3d86f13f715c7a6f, - 0xa21ca3b10c2f5fa0, 0x1382d5278d55cbd7, 0x26e1d1eaa35ef35f, 0x87a006c3c2c5ab5a, 0x015fd4368ef91305, - 0xb4186646e759a866, 0x5dd8dea5dd1d9761, 0x765cc63a0ca0ad57, 0x1575847677c76494, 0x1d93774a23caa9d7, - 0xc1c4b5f5bf3b3add, 0xece84c1561e295ab, 0xf2ca0be527637498, 0x7d14ff438595f2ab, 0x0e5f552a84b26070, - 0x6dc281ad43e0471d, 0xd7caafcbf0a89ede, 0xce0618607fc888c1, 0x4c8f56bf2e5b1c87, 0xe7af599ea3f9017f, - 0x010a86170f362a31, 0x1613d324b4a604b1, 0x0b8fa3605fdabb49, 0x85f5fd8738707190, 0xe5640b9d2dc39c12, - 0x74421252b2fcdaca, 0x7c5e4aef22cedd14, 0xfd5c8bb32bfc97dd, 0xd1406023dacdcacb, 0x0e6d20c8cf94d6fa, - 0x25b5c28092c58bf0, 0xdd727c5a46afd221, 0x93c804d5ca0d2def, 0xe81e0513d2c514a8, 0x710756e3e7501118, - 0x5e8f06729321eaa1, 0xf9b39ce286484122, 0x17e95fafe61f73e7, 0x9145402a55a600f8, 0xe8c148c320d1dd42, - 0x292d8d48c6ebbb01, 0xcbccb19257f80f92, 0x987f4655cf1bbec1, 0x4bd92090f8e5ec8a, 0x4cfa92d63432294a, - 0xf0968477e33cb3f5, 0xf670ef60c897b2c2, 0xf5af9d2c6ea77bec, 0x51e8040f2619a781, 0x2d43e3844292a41f, - 0x5e0f8d2365272dcc, 0x5bc5632a32570609, 0xdbffafee4b1b9b4a, 0xaeb4bfe757184d0f, 0xb11bd98d0d4d771b, - 0x84c718e826c3166c, 0xd2ddaf9b17842cb0, 0x125972b40413a3fc, 0xf679ce56fbbdba82, 0x64962c58f756d5b9, - 0xb5d7a9b33c271d3c, 0x10d8533b63d8f0cb, 0x0806fd1564530139, 0xd594bc36d25a16fc, 0x3a282b2931eab3b2, - 0x7b086555789efadc, 0x9a493a4cdd77e202, 0x65f037926cba0221, 0xa0dfda00c63962f4, 0x582e4998567db26f, - 0x0ca4caf920fbc454, 0x35901945e127aba7, 0xe1dc0f23cd2388df, 0x7450833c984a2395, 0x4913a5b5c1746d3e, - 0x9af48783eedb617f, 0x0d1372ed0354b96b, 0x6ffb3006a3bbe1c9, 0xda743c1e9121155d, 0xab9ca028aba1ab16, - 0x2c836803e2309a90, 0xbf647b590e794d85, 0x14385024ebd3a7dd, 0xa7e84a3891f0af01, 0x7e6182397f827efb, - 0x2f70e6c2d5cf5e0c, 0xda070e57b0884748, 0x64615f298b200ea1, 0x5cb419e22a690021, 0x09f1e7fbbb54c067, - 0xd252cfbbef83c080, 0x51a6af654c540767, 0x058ec6d8769c0233, 0xc85f8cc31a6e7a9e, 0x821e29a5afd611e1, - 0x987bcdbf2241529d, 0xa1fbd2922c30b01b, 0x7f58271e75d95a1e, 0x4c7bba174a4fc74e, 0x08e1565951c251ba, - 0xdf9bae482929e128, 0x1d4c072b524a4a38, 0x4acf566e5d52822d, 0xb7e76e7a2c397713, 0xab9de403a1dd4fb6, - 0x561a7a3757fa4467, 0x18849aba58526515, 0xec527859397496f9, 0x461289db2cb07b3b, 0x1f0cc966f46d7f12, - 0x8897caeff7fa00af, 0x21093929d061f600, 0x79d039589a24fb9d, 0x9ded1bdfa9c3e3d2, 0x7a1083c49837b435, - 0xf6d547a33fa2cd54, 0x1b9b0b94d64d5753, 0x2972120b07369b5a, 0x468a4dbb9791fb5b, 0x7738d725db27553a, - 0x4e64e760e899f9f5, 0x7bc027048df511ac, 0xc78ab2039cde61d1, 0xc2c4bf84134477b8, 0xdbfaa9b560461134, - 0x4b9b0f8c6e48bb14, 0xb9535656bc7320cc, 0xa13f59c7ef70b222, 0xf2a28a53c156c067, 0x87657fef7b9d4b20, - 0xa31cb7ae836ddd00, 0xb70a20cae3d6361e, 0xaee0e1dbeb78d8c1, 0xc37fd0c3361e6ee0, 0xe1dfe861070f37f1, - 0xf0153ddcc0c3b778, 0xf8777ab889875b78, 0xf8fff4f02d1ebec3, 0xc3557ab88587eff1, 0xf0353d7c87871ff0, - 0xb08e87edef29e936, 0x9e76f989d23a78ba, 0xc64f54bd36fe7b87, 0x9fa87e9b787a4d4f, 0x3f50050196d1bacb, - 0x4f54c36ff0b4c74f, 0x54c53778fa079e76, 0xb6a91cd1b9a427c0, 0x121fb77efb0d8f9f, 0xf8910abec2d3829f, - 0xa8e0ef5beddfb77e, 0x0fc9bc33f0780403, 0x8f3664bdde92ca9c, 0x317a745d1eee6239, 0x92cc5fd6ce026a88, - 0x7555b543aecc7640, 0x9ff0025086f4b8a3, 0x8fbdd96448cf37f5, 0xf9ac3febd2f3f778, 0x3607e52909780f08, - 0xa0cd2264f31b5a91, 0x2f1f2133df605e9e, 0x2366cbf8436b6fb6, 0x37e1548d68f16cbf, 0x0577a7e0c5315e14, - 0xca53e0bf0a0af753, 0x0a7851a0c001e52a, 0x481ca424f0a24082, 0xe23d0a0562c5121a, 0xf7521af7626c5742, - 0x04a364dfa9addfde, 0xb676df6edd7ff0b8, 0x6d1d4f1eef0111fe, 0x9de0f26283f0e386, 0xd327fae6ff33777f, - 0x7bfdd31134153201, 0x52e457e0f4688574, 0xd085c8dbad8317a8, 0xd5c18baa823b00e6, 0xf11fadaa3aff4b6a, - 0x92228d1bdf493b74, 0x3e19585cdca5c7db, 0xb75bd7d611a77ae3, 0x5a0b63da60dca34f, 0x685735fe04c6bcc1, - 0xbc883ef1fd8a9fc0, 0xdc6e30ff232cbaeb, 0x2b7e02d3b0c1cc4c, 0x30adaff819859b86, 0x9ba1c990b68e77fe, - 0x11cfe99bb776d3aa, 0xdcf055f947fadd1b, 0xff88bb2f2f1d34e4, 0xa7bc21781567ff29, 0xa6f76d1dbd87393d, - 0xbc8ab33f8ce9ddc0, 0x26e07648d8f0633b, 0xedece09d2de0b8f0, 0xb7352dff3669f9cd, 0x0265fa5a99f2ad1a, - 0xcab762cadb8022ab, 0xe984e749f167cf93, 0xd237ea4aff312dfd, 0xc7a4f4cdbad22fd2, 0xd2499c09c015d594, - 0x3e4c4bc72121b681, 0x699195ae1b91ed64, 0x48b6b7bfcb097c57, 0x47e0bb94c0f73981, 0xefeb087c9f12f821, - 0x27f0431d811f1202, 0x601b52023bd76b08, 0xec5c4f096ce70482, 0x31c8096ca704f2d9, 0xb753b723ec245bc2, - 0x36d02c320237eb08, 0xdc74044ec4414af6, 0x4bb783a55b9b1d56, 0xf8697baa6360ee76, 0x6e01d1d43d02eef0, - 0xbad645ccd4050916, 0x37294af57ccfe62d, 0x60e3ba274296db71, 0x4d78faf2b14f022c, 0x2a34ed017dc0c635, - 0xa1ffedf6b59defe2, 0x4f7c7bcb7d02fc43, 0x94045e32ecc1380d, 0xc8ce96f6f0304922, 0x2b004bfcf1509c74, - 0xd7d09bf03585ec06, 0x1e9ec5de5397fef7, 0xbd6347edd5de161e, 0x42de52ecc736c2b1, 0x1b3afa75fd6f163f, - 0x7e6b0cbbdd37e01a, 0x824fcd8bdd0863b7, 0x700ac0726ebe351b, 0xbf844bc3e400538e, 0x404ec26acdc55127, - 0xac168f6854f78033, 0x96216eade1608c0a, 0x325473bf7b025691, 0x2ed227902d051ef4, 0x28090f7adf364e17, - 0xbf79002d071586a8, 0xac8bc885b3f1e3f1, 0x877285bb218fb590, 0xdae30e1b4ff5f272, 0xf0fc7cd8561a03cc, - 0x033e9300e1cc4919, 0x917c2204030784d1, 0xeff531c04cd589c7, 0xaf8d6ac86ab86e7b, 0x4decb535f1e521ec, - 0xe92ce53fc214f47b, 0x0224b336616bf63e, 0xd9873e507b91b27d, 0x1ba4c2f8a8336ceb, 0x523c496f942ee8e8, - 0xfd933fd175353056, 0x7f37c45d19fa474e, 0x3c82cd255b1ffcc1, 0xa80ca60f290366a0, 0xe5f1f6e762eb4280, - 0x0a18e494e47d49ac, 0xa3a8592842ab0a13, 0xcc989aaa9e5a08c6, 0x0d4853b366987cc2, 0x194e17da61063c51, - 0x3b8a9483d654120e, 0x9a2375f543c3340e, 0x506e343fd76c9e40, 0xb15d5e1e59685a7f, 0xc466b2819e2dcae3, - 0x833125b4452c0291, 0x4d929dd7acb9a324, 0x65e05503851e018c, 0xdbb7649ec1a44fe5, 0xaafa4ca67162c47c, - 0x1d768234e412d134, 0x1f5275e42a36bcd2, 0x817f049c6007e910, 0x52331f61adc6ecb8, 0xff6ac32218db3b5f, - 0x882214ed09e203e5, 0x6cf74176571ec34c, 0x08a01a2d2353b657, 0x4c42ed511de1a063, 0x55ec95cf3e873a55, - 0x2278b766ecf90dc4, 0x4966681618d897eb, 0x605e9ce19af2e0ce, 0x58cca1c5aa75185b, 0x1bd2c6299215526e, - 0x589629663f41b861, 0xb429031404e90804, 0x1dd9c760b069a2fb, 0x1a70db7d406ccb43, 0xbebe31f443794da6, - 0xab225c96158bc22d, 0x3767ae1753161b7d, 0x76967480f1fdbe85, 0xd90e3acd3e5cd14a, 0xd40d0677d64c9d10, - 0xeee326e8ce370bf1, 0x34b1c597542e5c7c, 0xa34d040c960556b7, 0xb83661df282b09ab, 0xd0c70f96d59467e7, - 0x75452b01f51fed61, 0x35ec0e8e27143e38, 0x6cdf285e0c1696bb, 0x7edf2c6e8ce59d30, 0x5f269a647d5efc52, - 0xb24ac2b9608be46b, 0x19ac47100077f5ac, 0x6cb65aea36ecb0fb, 0x446f942d0e58d15f, 0xc1cb3b58387d700e, - 0x7939075e543d9b10, 0xf5016be5e3a03f3c, 0x31176b4bfed2898a, 0x2300f3e241b7777a, 0xef2367216bdaff63, - 0x1d63be0b3ee99fd0, 0x2b2ccbcf94f09fd1, 0x21c75b5b704b719f, 0x78255a0250263d99, 0xf684ea3a68411796, - 0xb184ebbf8d23afaf, 0x5e3cf009ba36b87b, 0x97c297573665826e, 0x2073fbbbb38d0181, 0x803afe1d6b7fa3df, - 0x99008799618ac4af, 0xcdafa012a94dc099, 0x52b7dcde986c6e3a, 0x0761073cd65775c6, 0x4b389db53f22c047, - 0xfba8de9c39b56606, 0xc6c918cb925455bc, 0xa33d801d6be76e7f, 0x8fad61d485db9b30, 0xdf77b909a595543a, - 0xcb6c756b4a941353, 0x63e7200b9b1934ff, 0x5c98bd90127dc891, 0x131592450e239da4, 0xdac6041d954ecd20, - 0xc94f31a73676892e, 0xda8376ed60aa66fe, 0x27e60529aa726ad1, 0x7f9251003b1bd8b4, 0x1b58b1d83b20506e, - 0x9103c82049866fb7, 0x4b6f7b50dbb0c6ca, 0xc3d035bcbaaf0c4a, 0x69127c0ea8793935, 0x65ba9d0565c5202b, - 0x3d87e0e474d17654, 0xf6497757ddbd1b40, 0xe7b18a146a616a51, 0x3a7afcf7a7fbb383, 0xbe586df83839d729, - 0x348e3ba187e5cf26, 0x27188c44469da18b, 0xea78b1b7475446d7, 0xe05d62ef3e0c4e66, 0xa77b7b7075c00e0b, - 0x7fd3fe1da090ad5f, 0x4100b220d3b0fbb1, 0x3fd9db6bbd65838c, 0x162df40921bdca79, 0x337407846f42d802, - 0x00fa99af6650d5e8, 0x4c19a05a772fb139, 0xc0bf26ac2c768a97, 0xd36bf0d82f56f725, 0x5cb8fb773e925910, - 0x57d867aba8f008f7, 0x0e52adb6ff739a6c, 0x3e0ffab5ce144ad7, 0x9cbb698a102ac283, 0xb3012164c8da85b3, - 0x4ce64c4099d40020, 0x2e92ee1e3247aa08, 0x45c93e7b44a487ce, 0xec9fdc7bdf216577, 0xf4ee61f84e16273c, - 0xa5e447648cbb8525, 0x046d76ffc38b3954, 0xdf6a180009c7d23c, 0xce1ece166ea3cc9d, 0x16a1ba0071814dda, - 0x60c5f09e4388b940, 0x532976893510bc27, 0xcaa59f4a0818baa4, 0x15fa3b2448826256, 0x57ca0c195cb104c0, - 0x515f738d3181fb4d, 0x6a8cee2fd7382110, 0xd518852a6a9c948a, 0x6b8c62a51a3f7cbf, 0x70bb90b36ab449a4, - 0xe8383cdf030b0439, 0xaf0f7b149aadfda8, 0x284bc205e3b06704, 0x01b689e94d7ee5d4, 0xa74eb0045c33d4b5, - 0xd73f3aa5c88de3e1, 0xc993430791008a16, 0xd2f189872fc0f4e7, 0xe9d105e08f847b34, 0x1037ba13a4ed9848, - 0x1ef5367d74ffea55, 0xde53cdfbb49c89f6, 0x737e436df09670d0, 0x6b1fa0b233bab374, 0x66deca6606130240, - 0xc6066637dae956c0, 0xe1a7e305505d1c58, 0x873dfa9262e23730, 0x7b7acbd09e611c3d, 0x8d070ec8431ed2f2, - 0x0e835892c190eff6, 0x15c734770327cc4a, 0x15be441d6e0c7561, 0x8414d9321e1f2fd5, 0x801bafbe0679e319, - 0xf556563d7a0e2ab7, 0x5419e74d5ea8cda6, 0xc12ed4cd0cbb48a6, 0x43dd115b1c41fbf6, 0x1ec9666b1ab530eb, - 0xbb628bedfe52374d, 0xab2a63a6273886d4, 0x9fdf910d00cf6c12, 0x79814a34330aaf65, 0xda3a27e1804d9ba5, - 0xb0d56eca917d9726, 0x86f391e6533abb8d, 0x7571358bc24e68b5, 0xe277d16ec07746dd, 0x512e860860c8bf3e, - 0xb05be3d1acdeadd1, 0x3888f83a802314b5, 0x062297ed2564a977, 0x8f6c50bd4bdac4f1, 0xcc5417e72ee7db82, - 0x0d747ea6f7899f21, 0x44f7cedb43604349, 0x7c07b22593deb5fd, 0x890d098fb0358fa6, 0x40760cb05de4fdfe, - 0x68c413b8d36aa957, 0x725505312883d17d, 0x04a524ac2d072243, 0x61a6066f07802885, 0x26613443161cd700, - 0x3d60d71f05995b6f, 0x9d0cfee6a020cb65, 0xc05ba2571f839165, 0x86a285de9d9c6d46, 0x791d05ee8b46df0a, - 0x73d29a7231e2d65b, 0x308425d78a21be58, 0xcebebc429b33e08f, 0x85850d548f7ad9b1, 0xbe1889a1ded96d1a, - 0x082cd890a45369d1, 0xe3a189a7a459fbe1, 0x078ff0bda70ccc59, 0xaa30a17ee19885a0, 0xc09c1562babcb76a, - 0x45c6e7f7e84c8653, 0x0d8719a566f6a937, 0x011d1ddab84699e0, 0x22ee0e6ae1543f8b, 0x8647660c6a77fd15, - 0xf5321ba41b9df5d6, 0x3b2ad1d2dc55552e, 0x51cbde38c1c3d2cf, 0xd4346cc9042e76bf, 0x4b767e9f6ea9d6cf, - 0x5c9f2f9d8894b249, 0xd7e0f1a8943b9ee5, 0x5d80cb6e522aa63a, 0xa8e00e49bf576e89, 0xa79f7ff1be1e8145, - 0xbf9b476eabe65d8d, 0x4361b38d2bbd250b, 0x543d87ddcac0ad99, 0x3a2387f139e862a7, 0xc205960d72d7a29a, - 0xc35b82d8ccb52323, 0x3246fda1dffd30f4, 0x80a54df61c06b56d, 0xb419c439f9e9c578, 0x8cf0738d76a53c7f, - 0x71b3a9cb1f0e917d, 0xeb084712ef0ead4d, 0xfe0febafd7badbdb, 0x40aca4ff4081dd8c, 0x605d9f7d619d90a1, - 0x58a374fc55e0b17f, 0xf2e76e0f8fae1bbb, 0xef48d0313ab1e59a, 0x57c321f1ac44f22d, 0x26edc888d6b73c71, - 0xa7739f314f4982df, 0x0ff73f7b2b4190aa, 0xbcf22232b4543c19, 0x65cb68ed800a8f2a, 0x703690a909b1c0bb, - 0x2fa7d684c03e468b, 0x6c33d266c9bb2614, 0x9c7d7beab9c824de, 0xfcee4dd36a1c75df, 0xa6b5e0574dca93d8, - 0x2629cbafd860b741, 0xf97bc3f9246800df, 0xda1ebb3db0ba2723, 0x6e8e6523987553ba, 0x1aabf34571647cae, - 0x12e5c7ebe3764b40, 0xa691058c1ce8b432, 0xbfd043cbb0cc21b4, 0xc0eaa19ee793cfa8, 0x60313d4f0dde45f2, - 0xe14becd895db8bf8, 0xc339e78d8a2ddd72, 0xe55c81576843c61a, 0x4c9fd06790715cfb, 0xb7a12257ce2c98a8, - 0x643264e5f885397a, 0x95d8ef3b1708c51d, 0xc79e713cb853f199, 0x08254e55343dd22c, 0xa7048c5907309b13, - 0xa464291ccf19abca, 0x7b1fe6d5730060a5, 0x9b43a713553ee02d, 0x66d8cda9abd19dd7, 0x3aaf070c7c83e1a7, - 0xe026e97ac8ba262c, 0x8ccb46cdf76171e0, 0x17a8ebe4ec0bed6f, 0x7e3bbf2482d8e016, 0xdfc0460cb759f65a, - 0x2cf6aac2d511e48e, 0x9f86a11b67cecf60, 0x2ec965972e750506, 0x9e8919571322e226, 0x7915c596a2ee84e8, - 0x3c90972998aeb70b, 0x0126140247772472, 0xb41aea4578bfe2d3, 0x770ddaf22ec58798, 0x77867bf0e8ec8ea6, - 0x433a6c8d20c40b7a, 0xbdd53f5d740bfafc, 0xb4e329c03c33a841, 0xbb1748708c8d1ebf, 0xba4d586df3300ce4, - 0x7a2f1ec8df2ef6e1, 0xea93de511913aad7, 0x46b07ce8d9809d16, 0x179a57e52794805e, 0x898325192c4eef19, - 0x9a509103afe8986d, 0xe1ee6da738e14263, 0x687e2619fc7acf01, 0x1c121f49e34b6b18, 0x6080ec98bc28beb5, - 0x99172fb158095cbf, 0x468a04420fbfe802, 0xeeb697f8ca148587, 0xc1e98f89e0d4a4e1, 0x7071e437186f56de, - 0x7e7608059101d62b, 0xfb97b0c7840e9cb6, 0x7609b3aa3497a379, 0xbc78c3388a283484, 0xe21b8b86a6224c15, - 0xa89ee824434763e9, 0x42b73d77a143f760, 0x280988c4bc211272, 0xaec485cbe62e1c26, 0x412e82425eda225b, - 0xcd9d08b09206cdb7, 0xaebef9bcbbe7bc41, 0xe9da2ba54451e5e1, 0x3d6d72f1f7e220d7, 0xe0f9489a8ca55168, - 0x6f03aef754c0eebf, 0xa812bcbf966b10de, 0x0bf0a9ffdb977fb7, 0x1222576a9ecf9bdb, 0xbb45d94683750935, - 0x09ad7476efa4c012, 0x238b1ec2af10d9e6, 0xfcd1d959ff048039, 0x7dc0849e77df8be6, 0xdb6d1819af178967, - 0x530ec85bc845f671, 0x4b447e1c60dfbe23, 0x827a17d3882dea28, 0xba34baa47b4eaaf7, 0x5047e12eb9f20b3b, - 0xda1684d6a7e309cd, 0x26a71f773dcb277d, 0xf8258fa77c252cf9, 0xe9131eb9e3980ecb, 0x6121d4dbea8bc0c0, - 0x672458856fc613a8, 0xc034ef5a17d202d2, 0x7141481000ab0e3a, 0x9723a422d0b12fdb, 0x1e3344a77b27889d, - 0x0bd89f595e47d567, 0xe5579a93ba667d00, 0x013d2cc67be33360, 0x8df4ad479fab6611, 0x8732256f5c252a5b, - 0xf79f1dbc7cf2e0e9, 0xd1ebe7cf0e1f1d3d, 0x7af6f4f5f3170f0e, 0x1edc7ff4f44758f5, 0x734ed20ff30f729d, - 0x96af022a517e90a2, 0xfb1842e8579de349, 0x1b06a1ed25df2e2d, 0xc78dabeb15553978, 0xf6f468ffd1d307f7, - 0x5fdffbf553459e87, 0xcf1e3f7ef633aa4b, 0x55b13e2dae7a840e, 0x82d7370501a2b0bc, 0xda7de0cf4d2a549e, - 0x3dd2208bcb1b6152, 0x47e7009be7431ba0, 0xf1aaa5c72afb61f4, 0x658d7663244190a5, 0xd1306e9436456cc1, - 0x9eae43580c2c6baa, 0x4e8cb0a9e3ceba10, 0x9f1bf1d3055d9d28, 0xadd79903f544e0b6, 0x607041c297bd39c1, - 0xdbe0ab546f9439f1, 0xc1c07a7b4b5881ed, 0xeb1bb0b2a2f39a71, 0x40206f507db1ad34, 0x013321411d604c06, - 0x2358910c4eb6d65e, 0xe0a4a12ca27042e0, 0xb936ebf3a982affd, 0x3819e7476c6d4f76, 0x93d765fa809ca19c, - 0xf40d2254fb81f3ce, 0xe99dd7d6bfaf8f4f, 0x5fedbe8e26026cc4, 0xf41be7a650f4fb0e, 0xa06d3078d7ae9db4, - 0x11d67ea37d895aee, 0x9e50a83a7c7ef71c, 0x7618c3ce984c70ba, 0xf823d0af57d6af80, 0xe9b9023e82365cbe, - 0x16dc054331fef0e9, 0x133f60a1f2238098, 0x893ce8dcc50bf995, 0x8b38b507d7c0cfe3, 0x429fea8e34ac14be, - 0x22e5210342f9f63a, 0x7f60931f36be2e34, 0x094952e09afb32b4, 0x79916cca5db29a9e, 0xa35fc6f40471534a, - 0x939f3605cc5833e2, 0xb5c02ab1f2c45fd1, 0xa3a3f65fa43cc13e, 0x1ae293e79d721786, 0x8c4b98cd0a3eb7c0, - 0x4cfd8b59980a318d, 0x4528ade8b408fc79, 0x19ab50127edbc263, 0xa4bfb2220e384624, 0xf5a65bce5b0eac05, - 0x0bfcacd2419dc94e, 0x3fbad187ed094372, 0x8532b8139767ab37, 0xc5ff61f8b575da27, 0xb0818dcb676fff8c, - 0x25b605593cee8ef5, 0xba83298567695fb2, 0x8597bf28d57faa8b, 0x05ae46618bf38b37, 0xed77a076880558b8, - 0x6879fb19c942f91d, 0xbe5a3e3370d12aac, 0x1263ada2c55e9264, 0xb8150993dddb6661, 0x1c2f387226a9198a, - 0x7c12c3f0b878132f, 0xe6c48e5431c297c4, 0xffa2ab758c3a0dbb, 0xda8f2af75c528780, 0x2c4b4fc88ec234e0, - 0x143d986290d11282, 0x6ce4603840255fd0, 0xcebb2143e790c293, 0x53ac0f086877d6c0, 0xa352d88e2b939851, - 0x99e81ebdbcfafc31, 0x60c5a4f57c832016, 0xc3fe2feb8830f40d, 0xc2e3be81a502ac12, 0x188879bb7d012bf4, - 0xc3f59d76176be310, 0xce89c07a7905a305, 0x41663e550cf97ae3, 0x05987b24e60baa41, 0x71d60b67214aeba0, - 0x68b760d60c31ecae, 0x59335028235c64fe, 0x36084a8c83b403b2, 0x03138b2f52f705fe, 0x770340fee0e3cf38, - 0x588b414777a732b7, 0x03ff3d099845d733, 0xec211eb4f874fc81, 0x203b5f5a90a87ab3, 0xe7aaec8594c442f2, - 0x27b46c850f55652f, 0xa4d4d9575f3eb5e5, 0x5dea44afbacdd352, 0x0717b234e28ee6b3, 0x26369691aeb5e143, - 0x245cac90e99e330e, 0x6e8a3ba9db5160de, 0xc4148240d8eea40e, 0x0798c4f7b942249a, 0xa7ed164f505023bd, - 0x77f08168f298182e, 0xfb68e30fd0d96ee7, 0xae6cb14cfe095ec7, 0x4aee46d460f6e534, 0x900135c2b0f90c6a, - 0xf3f302ad97e71125, 0x817c0c9b9e45ccb6, 0x2463185d0303ed47, 0x3c55c4b2cf383b33, 0x9e25707b9f093b4d, - 0x5ce77c5b11f67a90, 0x0632f2e327be7d24, 0x12a51b1d99fb23fe, 0x1f59f8d5f8586a38, 0x647289649965a076, - 0x77572ed3bd2b724b, 0x7db6cd5332194666, 0x9522985921f589a0, 0x33925d395ddb2fdc, 0x091da76d5d50eac7, - 0xaad48f749d0cc7f1, 0x27faa0f70388b377, 0x08ab2ecc17ba3ef9, 0x1d91544b5bf0544f, 0x1757a46a29ad43b8, - 0x9f3d1c4b34903e21, 0x881596a7ddaf54cc, 0x174c21634668fbd9, 0x4fe50f413e122eff, 0x0506780e12b56175, - 0x80e48b633e7c05b1, 0xb9b3f32ced59b8b9, 0x917b46d43fd9b6a6, 0x86ff08960faf0fff, 0x480e0063aeaa1921, - 0x5fbd1a3f332c5a1c, 0x2c35216e7156a23c, 0x7c645114109ddfe8, 0x519dd1c738995f39, 0x3f8ac211ca9fb777, - 0x14a68ea33be08a31, 0x504d634513897981, 0xf883e416a69ae8f7, 0x28feaa2386e12561, 0xe408e6c764603186, - 0x949213280f89f310, 0x1a04fde1a69a5fa7, 0x91f09f945567dd73, 0x8e85744975dd45dc, 0xa3301e5da16ea418, - 0x1a4131e498aefaba, 0xd51f511c2cc1adb4, 0xa51d183bd7c95d8e, 0xa3964e4934397aef, 0x5b5ff3559a05d565, - 0xbd6a87e602821227, 0xdbd780eb1c6e5ea2, 0x751d69f0aad8ca10, 0x1350363b322d54b0, 0x8a312cffa00be9ca, - 0xdc64d182d8906c7d, 0xbcd3dfbbbe5b48b8, 0x80a2307a0dce0ec1, 0x990d5e3107048e89, 0x50ee0bd70ec8a46e, - 0xf7ee744e6ff7a84e, 0x2c873bed4e491f87, 0xf5a3b14b8608a90b, 0xab5d43422313a81e, 0x410ae24a5a31daea, - 0x6b14187217fbde1c, 0xfb22216131ab72f0, 0x5090f905a7bd8a13, 0x0d55affd103769e8, 0x74cfd55f80ad0ad6, - 0x193e02383eaa3cbc, 0x97602c2cdfa228ae, 0x389c114fb5b8514a, 0x1f1392ee6df2cdc0, 0xce602c8cecf84ffb, - 0xcc91d2277ce8c172, 0x4d3e731de02a53b2, 0x6aadfe46380f97f7, 0x0cc155a3fdd81d8a, 0xed871adada8fe675, - 0xc1ab54f500106464, 0x2a79989194a372ca, 0x5de639e80d95f4a1, 0x7f8b7ccfcb733d50, 0x752a04f96257c32f, - 0xe77d6cd389aa77f5, 0xea839e8e6bf45e3a, 0xa67c903af54ab363, 0xd7bb2ba6495b3c74, 0x90eab806643948c6, - 0x6db620e179cdbb5c, 0xde67387e4b1c24ce, 0x7dc22fba024cf48a, 0xef449b187c882bab, 0x1cec5e30aaf0473d, - 0x253ea6db41c23a57, 0x744aa996ce63c967, 0xb65bd2975fc21c17, 0x67333a9a7649459a, 0xcfbc52f155266332, - 0x85649be029934f27, 0xd821e5bd89219bf5, 0x11f1cdfb55ee5efa, 0x78cd420f8eb3de75, 0xda39125db95e4886, - 0xe65bcbb6cfc7033a, 0x5c2572f567508aca, 0x2fda8329f3cffd93, 0x5ddc37831113ae3a, 0xee32ed86f22429d4, - 0xe472d156312300d0, 0x507752e8925d3681, 0x9367b9db88be10b6, 0xec125be56e6086e8, 0x3b17dc0df52ea290, - 0x55358bc21cee22a8, 0x9a0f7b9d942dad23, 0x4ea8a689abc4a434, 0xfccbca39db8cbc8c, 0xeb7b17a54ced77fd, - 0x2d6c367eff1e6808, 0x7a0793f0d8505c31, 0xfd96046f0be280af, 0xd8677e527d467fd5, 0x535ca1b75c99557a, - 0x8a7c239da0484f1b, 0x999ddc27ee3652dc, 0x7c3cae7466b42a16, 0xc900f2816fec3960, 0x5bd4ca80fa66e969, - 0x48666f124b9bac20, 0xae030e909fae6d2b, 0x52523572bd73b2ab, 0xce022af04d1e9d78, 0xcf966587057c7e9b, - 0x1c16e4555e71fb24, 0xf96879b51b23f7af, 0xd884c1f26597de21, 0xddc131aa74f1f5bb, 0x93b2c6d593b672fe, - 0xb9f91448c79a4dd2, 0x9a0938e0f8fe2b6f, 0x1070952f7b6025ab, 0x1df2b0c1164b61c8, 0x16827f20f0eec078, - 0x91d28a08cde978d0, 0x9d355d83b9289aad, 0x48222b64755e6f5d, 0x406565bf3f6e8ef8, 0x896f44fa57dea9e7, - 0xe3ed75bb9a1744ca, 0x6a335190016f8817, 0x34dc320356e69f32, 0xeea66efba78cbb13, 0x107df6b8ab3577cd, - 0xd0b3909723877227, 0x04439f722bd9b0db, 0x20a94226bfd62218, 0x6b7c2d46b8fc709b, 0x585e50069e2eed35, - 0x99211c740834bcf3, 0xc00278b4a8be3e04, 0x281b6ccc79301e4f, 0x4e5896508c2b41df, 0x28079c60cd5f10c0, - 0xf6f262774486381f, 0xf167fbd5d2fd99ae, 0xe755ab21502519ed, 0xeddd7efbe336c2d4, 0x5eecec4eda1f013c, - 0x4ba615d3625429ae, 0xf3bbf7bb638a2b00, 0xad952ab7eeab728b, 0x02189072eb21fdb9, 0xd91e4ea0e33a45f4, - 0x5187ad8f7b12daec, 0xc4d9539e1374e3e5, 0x1f0463190d2ca744, 0x6fd22c8466196761, 0x30cc6094830cfc1c, - 0x2787e5f999812f3f, 0xa6a04287a3582107, 0x66d174710e2e88e6, 0xf5e0dda0ec6fe702, 0xa3be15ed7c6766b2, - 0x73f8b9d07d510245, 0x048a327d7fd8ef8f, 0xa297cfa18cd5c82c, 0x41eef908923fd287, 0xf74f082c95303903, - 0x955ba0287fd21d21, 0x064f7d1db1b5c9a2, 0x278542bd822ccb17, 0xbe4a746f0c145a47, 0xcc67e0df59dc550f, - 0x83521d7735c8638f, 0x6980d4d8267389a6, 0xb198397b9f7ce268, 0x30635f94a5e4f38c, 0xd1bb84ec3d5225d4, - 0xc7d3f539e421a1c0, 0x7627b5b161c5a36a, 0x4916f33d8b806b6a, 0x73c3a1a759e69f11, 0x65eb194c7e6ab369, - 0xd81fe76b6867d6ea, 0xb12f8f1a47dfbc67, 0x17e7ec7321f79e2a, 0xcf9bd7e48f4e48be, 0xac2643173336ff60, - 0x4d5d5c589a506cbb, 0x42a8d40f60a49747, 0xb5f4911e69fa054e, 0x6a3a1f052666354a, 0x868c41ee3c038756, - 0x263e4008a6c7fb3e, 0xc13ce13716fc9e70, 0x6e16486ca52f1da2, 0xbc387784de7574b5, 0x92b72b579cd42439, - 0xc2da2a3434c691a2, 0x1e41324bf09cd60b, 0x5ab9380fe17535fb, 0x84e0023962ea4347, 0x2f95576c10783125, - 0xe9767f8788e65fad, 0x4c2dd80b1db9e0dd, 0xcaf46ce372c4929d, 0xecb308626f8be8f9, 0xbd6e45930b3710ec, - 0x04622f85e91a54b9, 0x29ab858931f4f049, 0x38c3d9c9e367a178, 0x432b11bdcbee05d6, 0xc77bb939a479fb93, - 0x4b26192338de2635, 0x4570090255a76135, 0x75b1a45135f97510, 0xd552bd77b37cf436, 0xcae67c9db3acc9f8, - 0x65a5c891b458c80f, 0x5254c68e9fbc90a5, 0x68f67cb1843afdd9, 0x29facfb6e4243e97, 0x5c767067815d9b46, - 0x7e1ac01b0856951a, 0xf7690701b4264035, 0x73085d709eebb4b6, 0xaf47011e7610580b, 0x993cf09864da4e32, - 0x215812e2b9f10294, 0x0c3b699407a4c380, 0x6dc0a9142042ebb2, 0x705523fc7a17914a, 0x749d2f0d538cd0ca, - 0x260428cf24f4ca1c, 0x369e26ef18aa2a4a, 0x3f56d2af0c0820cf, 0xc758a2cb4363c2d6, 0x9031fb17af606bb7, - 0xb8fdd5e5d9902edd, 0x5f5dbe9b6e1d1e2d, 0xde44b17570b58172, 0xd355528d25a38f9f, 0x8d4f06ef60434a55, - 0x206ff4615cdfce9f, 0x1d861a2056794102, 0x314d30abcc19d48c, 0xc22bc9427dd82510, 0x9932ad45386aa5fe, - 0xc1d9819b87cc3737, 0x5f4c9de603210afc, 0x5ac220d5ed0a4120, 0xd864ce6be057d12f, 0xf581cd286b9ad3e8, - 0xb686fda3ab72067b, 0x5477a94bf595128c, 0x0312d57b87283015, 0x7dec775df01e1423, 0x308a7748d69f7b4e, - 0x9d9b5f5a648ff17a, 0xff40181a588b5495, 0x5b852b14599f83ac, 0x281275b108d5651d, 0x7db00f32ea1b5a88, - 0xf00ac6f1f9845575, 0xd472f2ad5566435b, 0x543be52d4ecb2343, 0x1fc9a5ef2c8c13a3, 0x731b79409f7d90e3, - 0xd74d06db8685115b, 0xbccd77601bcdbd2d, 0x494c5ba89b763cf2, 0xd2c5e63fee70f1fc, 0x44326b0c7b2ac4cc, - 0xfca774d0b3ea0e32, 0xa955dc477ade687f, 0xbc9e2260afb5340c, 0x23692d35eda8b603, 0xbe75dcbf8f462684, - 0x77ea51367f6351d1, 0x4ffd212d4bf2c3e3, 0x77a3f74ec71acde2, 0x82f75f188d56243f, 0xae3b55ab18b9fe8a, - 0xb5446ca327c2b518, 0xa24d0b5dd820c01d, 0x0552417feb6a66c2, 0xcd12347c528cb771, 0x81f1d7d34646d45f, - 0x8fe1b31335aab111, 0xb65600cec42bda6d, 0xc7d3566cb887088a, 0xd8995f6b9d5fe8fc, 0x4dd2e1e7d9e95627, - 0x33e1ceb03a839ac8, 0x8faa73d0e8fdb434, 0xd7dfc5f9a2b5f96d, 0x8b70ff06b31f87e3, 0xb75d8a5fae7c258e, - 0x056cf3051c0f3546, 0x75b6a8bdf1f9c716, 0x6690328e3093091c, 0x3baf5efd132e11b6, 0x85d87b9ba3641a26, - 0x1314c5ffea325a55, 0xb3651d61c33abd49, 0xb97e8e48eb1c8a18, 0x18f11658fcb42941, 0xcec3a9b220959903, - 0x8b5e6a3c05b8855f, 0xce88c2365dbdfa7c, 0x546e0c5c8a7168a9, 0x5b4445b7c408b8d8, 0x9c4e67f050e8fd45, - 0xba75fa3344c1d473, 0xe66f593d2e10a15f, 0xccf030971afe37d4, 0xa97dcf591254d6ab, 0x3bbfe851d1acdb80, - 0x47f2a44915f92a11, 0x4c50e72c52350120, 0xea245b69a0b33bd1, 0x27dbf9b04169c59c, 0x884acb2887e5d9c0, - 0x68050a6063a670e0, 0x0a49b0f4b5318de0, 0x086021450806941f, 0x0f69ee32c450f527, 0xe6e727383a83fad6, - 0x7e4272a329ab7d84, 0x31be1ab602791bb5, 0x81efd441bdf9d92e, 0x55c59e8ec4bd21fc, 0x53561d69a69ebbf4, - 0xdebc9b18e99e00e9, 0xcc88a79f3b7e1a70, 0x1d62feff750efe60, 0xbad65d937bf39a71, 0x17f09f733ef60062, - 0x0542c9893100c3f1, 0x7bcfd90036c9d363, 0x20bc359867afc163, 0x08727c5c3ce10b6f, 0x34c18575679c4ac0, - 0x7addd98cc197d766, 0x6324f4d7ee3f7b92, 0x70387b5b98d76085, 0xccc94f6f76c48f38, 0xa57ae617a80bd09a, - 0x5149c119c0175c0b, 0x0513d72b30ab7208, 0x85a59f723eff2a67, 0xd52cd0ed4545e25d, 0xcd723d83a2740289, - 0xa6b6b82a3974c336, 0x823e4c807d71498c, 0xf394683c1c86405c, 0xe7731973a827035c, 0xc28733dcd0eb387b, - 0x73fb5b7201308842, 0x0023a4aeb326d589, 0x6cd2927a5aa73c9c, 0x74df7385eda826fc, 0x75626fb521cd5b99, - 0x962c9b0f5826941a, 0x149c7e131a4a3a3a, 0x619ad7282a56ae8e, 0x64f19893c9de159f, 0xbea1d711fc0f3887, - 0xee3b7c373824e68d, 0x629519b953de9b3c, 0x2a65f3be4c4a962b, 0x2f99dc0d276e6ede, 0xb709cde200c467b9, - 0x5e29a26d7c49232c, 0x9bb9cf3bceb6a605, 0x9bbe50ca0e17c054, 0xbb6ffbc356fbccd0, 0xcfda47f023595aea, - 0x0c7b0f6ef523f274, 0x7ed7853c67d9a7e6, 0xb331f6b909367a94, 0x00d04393fcddf3c1, 0x0c7eae8482d5a0c8, - 0xf41c9715b6afafac, 0x9373c3f638d9d1c1, 0x18ef5ce007cffb3d, 0x48697b91b405f38a, 0x2dcc0e6770a79533, - 0x9d1ce3bb27cf4643, 0xd5c3d66c8141599b, 0xd6ae7a9f43c44455, 0x39fe76852263b914, 0xe70f2ae6778c4672, - 0x908467cfde9e1c55, 0xa6e3d32cd02541fa, 0x89b34252efb4e62d, 0xcde80e815dc2b808, 0x831fd6eaeebacefc, - 0x363f9197f2490a28, 0x605b4c51f014ec32, 0xd58448ae930353c6, 0xf29daacd2adf1b8c, 0xae1337421e4faef1, - 0xabeb40ff6c3719eb, 0xdc72159a76b6b71c, 0x8f6be430a30201eb, 0x0ab59c392fbf6515, 0x7861a31de903824a, - 0x31a2dd1f6037f539, 0x1ae39e33765f560f, 0xd818d77dd34f98d0, 0x53fcb3d7dd1fb5db, 0x6976976e824d6bed, - 0x10f9621959333cd7, 0x0ad358b7769c7188, 0x5aec59ad9c32cee5, 0x8c29e312c0a9a295, 0x1bab56ce2d6a77cd, - 0xa0efae70ae2725d3, 0x533148664ea9544e, 0x2e3c2bcc9faf749c, 0xe25b7b5a95c6db40, 0x55c10894a079ed7e, - 0x693cbbef5758e606, 0xae65899af2f3e7f6, 0xa94a3a92192d3c8d, 0x71e461d7c0fa6d36, 0xf9e8a2e5382d224f, - 0xbb58d7daeb42e176, 0x69387cd1ac837c4e, 0x2734766617b023ca, 0x820e71594293585f, 0xaeea16edf5f3a12a, - 0x39ad006b3b7d4ea7, 0x6188c4e555200311, 0xaa4035fd1009c59b, 0x47d6e1736700d025, 0xb2c9819652c80d3e, - 0x7212a9f987dd473e, 0x7f26fd5d676d645c, 0x5ede2813eaf6edc0, 0x6c25c03c240768d1, 0x02864888636ff56b, - 0xba19e51dd54ec68f, 0x5c2a45fcfc26f675, 0xb1543711a8b04d57, 0xf91fcd5836134897, 0x7b29cd56d95b562b, - 0xff6eab8b9d049583, 0x1fecfc9c85805244, 0xbd099a7f30857f0c, 0xada1520bc27ac3a8, 0xead6bce89f80a5ae, - 0x3aae8a3094140640, 0xe0eac76430857f05, 0x7f4cb291ee6d957a, 0xa0d3e6176c08ed55, 0x0834094bfac17172, - 0x533078cdf43ec480, 0x6aa5dde42b68e62d, 0x64a881e88b45869b, 0x46917d8ee4d80837, 0xb6ac09b620d2b5bd, - 0xb7c5c19d0fb1c3d5, 0xc0a73459083f365b, 0xde35ca0a37bc59ed, 0x53075acfcad01543, 0xc745b2a273bdc1fa, - 0x749ff5fa168923a3, 0xab9733eb950a6993, 0x84fdd8e49a6ef238, 0x40ec605a8e8ca6e4, 0x369226a3935ef136, - 0x01ff225dfe975c95, 0xd32a6697b05abb86, 0x80bb2c053414fda1, 0x6b759466a7f7e76f, 0xc26f6d652422b4e2, - 0x8c8cabb9ac57a29a, 0x7297983771b10d70, 0xa030797452177d1d, 0x55e67f477f38d7bc, 0xe40ab975d6ef4ee7, - 0x1cf1b0e650757b92, 0xd7d4aa11046408bc, 0x143dbc9fe7d362cb, 0xb3266dfa556a5fbc, 0x3cd71cbe35fd90b2, - 0xfbf2d6b1d1b01bf1, 0x2d081008cd26413f, 0xea1d3f282489020e, 0xf463469dc4754c48, 0x4c5bd5696648f0ca, - 0xb1cc9174345d1fd3, 0x9f88cddba7664207, 0x9d8a4ae38f20b121, 0x984f6fb716c86777, 0x4f3b377680d029fa, - 0xcbc0fd18f00637dc, 0x7b17289150f611f9, 0x56dedeb9b1673f77, 0x6f6093f329d3abdb, 0xf0a0f44f37812aed, - 0x9f76f676766f0416, 0x690e080a95b94ea1, 0x024af4b3fc7c0ea0, 0xc47693121f4efb10, 0x8692e11b7a5bccbf, - 0x7ea657a101187974, 0x55a561b4d0356019, 0xa3eeeee1c3089f3c, 0xebfe4a83d123c751, 0x4296cfce197295c1, - 0x0cf454793863ce04, 0x9eb8ce4483bc72e5, 0x1dd969ec996d0755, 0x2f939221eff9842a, 0x6750d9a8db69a777, - 0x875c58a96b6ea6e6, 0x8d9ac920270865db, 0xe21ecec3df776fee, 0x5d812b54de1ab534, 0x0a5cbde00b3404b4, - 0x0afe6d13142d03bd, 0xb62ff0f7022e5a5d, 0x58e6e890ccdb643b, 0x871fa7edde6c32c4, 0x94a03fd07fb7bba8, - 0x198c0c871466b9cd, 0x28f178e4bf78016b, 0x39b9bb5eea446111, 0x639bc7547eca8480, 0x862678a4e9cd8f08, - 0x0be94bc298719d46, 0xd34f7907dfe4c412, 0x45d0580756368219, 0x23ff847990fca40f, 0xdb46de8088e84582, - 0xb28e3fa1bd6b48b8, 0x28da3657d9285914, 0xc0bec98468e417d7, 0x552ab008ba204afe, 0xf4899317a9b94999, - 0x3f1a8fe01641f2fd, 0xa19e704c4b39a46a, 0x3136f4bc8fc1fa0c, 0xc9c4540290396086, 0x4c037c0fdb26ccbf, - 0x4899cb555e139e69, 0x57557f5995fa17e7, 0x436cc0c2b17157ad, 0xcc8d555c9b3c8387, 0x780d55d57d39a27d, - 0x9e2afc0ede8e5195, 0xa1f95e6667b75275, 0x8c37c454bdfafd9e, 0x4e17a283090b8554, 0x86ae1beadc7c6637, - 0x49e901d1de7cc22e, 0xa8349ca4392196f1, 0xa362dbb750339eac, 0x15b5928d1735e21f, 0x408920c85acc4a6c, - 0x404491dfa25afcb7, 0xba4a4a45f3fb8256, 0x8d1deb9ff939eae1, 0x7e5b7bb1566d483f, 0x7b91839a7deda67d, - 0x8d969fff1e3dd917, 0x7959aff0cd7c4f08, 0x1fe4cbeec695df63, 0x0cac88d7aa701c4b, 0x32e557ad4174bf52, - 0x98b4611ee6810bda, 0x3d15b8e2cdaf5626, 0xa7cba63aac72e743, 0x58b64e7ac19599a2, 0xa599b731ed816e1c, - 0xb2adb6622dacb059, 0xd7aea66854e28dba, 0x88c0898ed4f9aa9d, 0x78c5e6adf787a864, 0x416a93732ec459e3, - 0xaabd28d92df20d9f, 0xfc2014eb5d389498, 0x436046e87f964f11, 0x763e3cd498a73aed, 0x88e1b23f92aaaca1, - 0x215586051e5f0344, 0x0e4b86747bad67ad, 0xddd6716be39a6b39, 0x58a1d63e5edef3d0, 0xdecbada74f3d1a44, - 0x5845b816c47b980f, 0x791e063c8f3b2c8d, 0xe4b5c86d211c4869, 0xba36e0cdc78b43f0, 0x9b6575108073dda9, - 0x27c22b449aa2cc2d, 0x153e549f4a497658, 0x7c0746f2b9d5be37, 0xf0866683b5f830f0, 0xca47ab90cda17534, - 0xb186df588422c8a0, 0x739d342a11fe46d9, 0x377673912fd1a895, 0xf84ae6e790aa787f, 0x8588c0d75263f3a4, - 0xd40247e323c2c7cf, 0xf36b40f66a60024f, 0xe11ea3e1b3c3472a, 0x1228b7f3684cdf88, 0x7b904ce26992ca80, - 0x8735a9ab08955aa1, 0xa6fc5975da0202f9, 0xd292b70712802cab, 0x13d6015b2a13b103, 0x82bdf80cabe98518, - 0x031e94fc7982887c, 0x45779f7e5438df6b, 0x93e2590610283a10, 0xa35ce611d8c8f318, 0xcdb1f72eb89ba8a5, - 0x1334bfb2cebada58, 0xf30c0d40e8e13532, 0xb284dd2404eb144a, 0x3c327a2bd374f524, 0x178ab05115d29dc1, - 0x822436ff8d4da8ad, 0xbcaf0b3eae13b062, 0xe593cfd75977f217, 0x89a6973b7d010d96, 0x13dd003de1e774ac, - 0x353336614d5fe2b1, 0x722d18f2fbce8b3e, 0x9b419983bd1b97a8, 0xd022765a886964e7, 0x4aa5f4dcd3a0034e, - 0x550f11664fcebf85, 0x01b7242b75e91757, 0xc6bd2085ea6eab15, 0x1175803932b16c6a, 0xa5449c63516d538d, - 0xd5bc6435d02e0066, 0x9655e990320a084d, 0xb3acdbaf166df005, 0x4d683f189d34a34c, 0x194177b148439155, - 0x721369461de07d40, 0x13d4b0203e8fe6cf, 0x4ee5aa423ee322f0, 0x38f08c7086f6a2fc, 0x7484f6e241be0a1b, - 0x79cc33e78740416e, 0x678e62c2a0825579, 0xd245fcd0482171d6, 0x55d9fea3e993fe0c, 0x7e9db8d2b0744a5c, - 0xc980315b6560af9e, 0x16e448104efa40b9, 0x8323f0d9e825befc, 0x887473fae1709730, 0x1bf3f01c8d4e50c7, - 0x3010938a465185c0, 0xd0e3d3247321c09b, 0x160922f5797f38fb, 0x71d23d3f6d7900cc, 0x123c8e32e093cea3, - 0xa19dc62bb3dfcac4, 0x851d1b2b7a927e65, 0x2976857d30440e13, 0x165aa30d3720b8b2, 0xdf3b062a156ce1d1, - 0xe9147219bed4dee6, 0x68d7c04d94a5676e, 0x8930885d2e78ef08, 0x093fe34d67313d3a, 0x1d4c4e58b075c861, - 0x2cc3a60a0c3ccc8f, 0x99b0b967065f695f, 0xe199815c3c2c983f, 0xb86e89f0937fcbe4, 0xe29f67e817fecd39, - 0x7d2c44d44dded079, 0x778031d89fad5fdf, 0xb8dbb9f56d31e14e, 0xe70777e143b4685b, 0x70f9c847d3b40c9c, - 0x84167078406e03aa, 0x822bdad12f3424f6, 0x78f0c2cdadcc03d6, 0xfb95128611abf52f, 0x510e008bf8b77d32, - 0x3ee305bbdb77aaa5, 0xdc49b7f6aa2674b8, 0x8f97082653ad250d, 0x86743c8bed65384a, 0xd7531ec20a7c2a44, - 0x81cee74604e2a6fb, 0x4b54bb7c8381f4cc, 0xe600bce0ddd418d8, 0x7ca02a0ea68a6c12, 0x666f969bb54a70bf, - 0x87b20ae711d955fb, 0x6dc1568f601bd096, 0xe19cbdf626bb8404, 0x0ac27845738ba240, 0xe8cfbb37bf935d5d, - 0xf0a64b305d10107d, 0xf1d68dcf1ff57cc0, 0xecc844a2b86b5441, 0x834965cd634d6e30, 0x7e61e4f9e3a348df, - 0x7bb0e72f3f8becdb, 0x36cbc849c5d6f006, 0x8577b20746565863, 0xa1cd87d3418f7603, 0x1209d220dbb30235, - 0x52291d9eb490dcc3, 0x3c517ae6fc9c2ab9, 0x5dd5f407b0ad2908, 0x6aba46e8a74e340c, 0x8f1e854b7748d227, - 0x01d34542796f9100, 0x9d2e0954151f2724, 0xdd2406ff840d2244, 0xf6cc46d9788baa7d, 0x0f932672bf23d605, - 0x872188535f721229, 0x5869d1480463e255, 0xa1f0a010b016f0c5, 0xf1a0c1e270fdd67c, 0xbb8ad9a6b0197e4a, - 0xd5a1df59d030aa7c, 0x734958d07b7e9e62, 0xd70b1489129b91b6, 0x3cea1c03ec973095, 0x1454d85b2d0691ca, - 0x03e301cf4d254605, 0x60d1ff449126e99d, 0x5b5b558607e62d27, 0x929fa05688b612e0, 0x07054c6b420a413f, - 0x8c9630d476b5c818, 0x341263267c1b4b36, 0x95b0be631ae021e4, 0x32e8f6ac089f8000, 0xb0740a66b8054b6e, - 0x8f267b2e843a8752, 0x3c6320cd37266a47, 0xf20ec1127c80bd6d, 0x0bb01787d58b3ee7, 0xb198f53505a41b76, - 0x01f54a62a25f5cd0, 0x14679a262bdb5866, 0xb9e044589df5223a, 0x9a6ce4cd24fdec3c, 0xb991ea2759cc70d2, - 0x2cf4f3318e235dda, 0xa513443d3799e8ab, 0x15aa3a92f086e9a5, 0xfb7a985e218faa6d, 0x38cf25da5a303df7, - 0x6790e1061ee391b0, 0xb99091c2ba04906d, 0x91a32b15c8634629, 0x2088dccb9bc2b0c8, 0x6036c524b14a2550, - 0x6de12617bb39a85d, 0x4b0cbde402b3360d, 0x6709e88a87830b58, 0x7c624ff34653cb0b, 0x8b6a2328bd0a2ad3, - 0xf14d40324d089769, 0xb098a5604c5158e8, 0x66981d61230cefb9, 0x2942c8e736e1166a, 0x3fa626c01dd99a00, - 0xb983f1c7b2f79b14, 0xc62d3e4e161d2071, 0xa7ee4a5c193e3e8a, 0x1a8fab2d4c159ccd, 0x14b8409c200e2a57, - 0xd91cba19ddfaf429, 0x7afe2e79fe9e516c, 0x2f14c53682aeb565, 0x04a11dd93f1dbf5a, 0xb8b05897b6179a55, - 0xbbe471316e6fcfee, 0x62c39c6d6e2a8496, 0x241fcf5e812d1043, 0xb420c4d670dc3dd9, 0xa70ceb509099f8fc, - 0xd232027258b3c2e2, 0x467f21b883c0de53, 0x74876d33d9d03af0, 0xc60baec9e5ee785b, 0xea0fe0eacffbf235, - 0xa520595d6414829d, 0x2ee5021231ad3edc, 0x1ceccb31020fdaec, 0x4322e34a688175c2, 0x7ee188c73eae8ff4, - 0x09e21d830d807603, 0x513865ea28a780bd, 0x2d93fa1e90c28b7d, 0xfdb56d8405c08404, 0x09005c01a7be0577, - 0xb446fdda3f215970, 0x506b66ebac675852, 0x011b69372a2ef896, 0x545b633bf511d909, 0xb38d26ca87d24441, - 0xed9d401f2708cb8c, 0x71c3925e2cc000f2, 0xfd4b520532907ba7, 0x985192281705c793, 0x09228cc71d586261, - 0x966579fd42327b65, 0x4944673812f89f0a, 0x10d334eaebbf6e2c, 0x3852eb10f3e1682c, 0x3c3915a3959cd7b0, - 0x2aab76d81f345e6b, 0xdc61d48c503dd451, 0xdc5dbe64f6176405, 0x4abd1a7dcd72f210, 0x59dc4730fabfa61d, - 0x674c4390e7978a3c, 0x179cc71468959498, 0xfd60f4376ccc95b9, 0x28b1663c0bcc18e5, 0x16655d1c9b3ae7f7, - 0x043ac386964689e5, 0x8844e029ae7b3c7a, 0xee7b3c88dafff753, 0x7cee245e6e1a2797, 0xf67c1724172e4312, - 0x98b1013e732167fc, 0x32c2571e210a7017, 0x563a20f18741008a, 0xe1a0f42443bb257f, 0x9da408f7cdfe6444, - 0x2178aa8b220f5078, 0x2c63e0ff17e4b1aa, 0xb1f909ed7b11fa6e, 0x586bef7d2666320a, 0xf3290f6188eeb80e, - 0x9cec0294159a1609, 0x93e4551002a4292d, 0x343322e49a8d7e4e, 0xf64eb1b4510043ec, 0x4f481bc0d976820d, - 0x933e4e7fd6825ee3, 0x564a523a93e52d36, 0x4d5aa595ed936e32, 0x82290d975049869a, 0xa693f845edaecb53, - 0x76e635a4d3818955, 0x789f89e3c1d2178a, 0x3901d64408b2b3f1, 0xfe64d2fdc8903738, 0x05ea88557cd0ebed, - 0x7a7a095f5a912827, 0xaed5b086a1ca9090, 0x3bae4e1dc98acfba, 0xea3c98f61a5627c9, 0x491fae2b5c55ccde, - 0x3f6bfce124277db8, 0xae70553199348f57, 0x99347102a2830c7a, 0x601033653766241f, 0x18989f1aa13f6f4c, - 0x52d6f206bbc69fe4, 0x5593d2510168d852, 0x12b5d58eb2a2b1d2, 0x2f8f7a9d63b2ec01, 0x3c428bee90ad57ed, - 0x9774ddbf3fac3d29, 0xf0253d2982fdb418, 0x1b816a1531523581, 0x142e1ca8fcf9fc2d, 0x982dbdec752e81f8, - 0x1a344c6f0d0b6536, 0x11b5294f04202e16, 0x31c2a78c029067c2, 0x062131d918181b76, 0x9174a0084969442c, - 0x713c2c36c8685834, 0x97e997381e571021, 0x9bc2b652a82da0bd, 0x05af16b74b51d2cc, 0x272f6a30451ac1c4, - 0x2d575878ef473d6c, 0x95bde11c1a36eae0, 0x747f7f23b9d75a5f, 0x5dce162da0658d00, 0x9535fc48a611346d, - 0xb839fdb56044df90, 0x3f0d7d8eea45acf1, 0xfef92044f18c1a5e, 0x9041028e6bfc2128, 0x9b73ebbf8ee7629e, - 0x4115a0afa74560b4, 0xc17526bcaec9bc4f, 0x7fc96a1a124aceb1, 0xb6ff1cc203c3bf8e, 0x589cb0869c64b960, - 0x1332c17659cec789, 0x9a3374d02ee6f619, 0xb404dd7d2bf25292, 0xe682f0a62213f92b, 0x481ee2f91ef6f3bb, - 0x8166b464cdadd06d, 0xe5bc92e872b21cb3, 0x2a27256a4e91b955, 0xe49444cb9938e656, 0x14897369d9007fbe, - 0xa25c90c360c52783, 0x59ff79174186abba, 0x27c8c165545e55cc, 0xad699c0f707490c2, 0xa7d9e4ad73f59047, - 0xe62e5fb810a3a0e4, 0x7634c9c00475bbcd, 0x3e9c2d2abe563d8e, 0xc83101538816ab6e, 0x899c9336ea622e4a, - 0x908b0e76f4620e4a, 0xa886aed6bb866bbf, 0xddb2f2adfa7edc1d, 0xd61f52a0c64eaad4, 0x1f41f5cc7e8a0990, - 0xf9807ac9996445db, 0x50696d002c445c12, 0x804a65ee6d49b11a, 0x4b777579fb0578f1, 0xbba07211e3c6b7fe, - 0x74b4735d52fe36a3, 0x5f61dafd17fb3f72, 0x12d97e4729fb4f7f, 0xe504385feb7bd587, 0x5c16cd22a80dbb8c, - 0x8351309908dee2f9, 0xbc0b37c234b7bc6f, 0xbf8599db5ffa4054, 0x7c4e86939a2d7fd9, 0x164594a497bb97c7, - 0x8004229a4ffc858e, 0x88142ef75cb2df1e, 0x431a3818e967e4a1, 0x4d523b2c0d126c74, 0x19665f93b3f73829, - 0x15ac5a73b8e73641, 0x64e01419914d3042, 0xaf43836659b28436, 0x49a9a20ff9170bd9, 0x4bf4f84c177c78ee, - 0x324b651971ce3a1d, 0x071f982abd8b4a1c, 0xf75f7566f8c7e0c0, 0xc39b8b608047f0ef, 0x92a2af20d840cd89, - 0x49259b9a30834b20, 0xb659903dbc8c04fd, 0x07707c0abd0e2e0a, 0xd524094ec43dbb02, 0x82d2193385faaad6, - 0x20362e519f738971, 0x6c35a952deb2a16c, 0x2afa892e0949ce4a, 0xcbd88c48ed36544d, 0xa5c672d5b7b59676, - 0x1d81d46e74065d61, 0x5cef74f48bd5b6d2, 0x45abd1c63d219f12, 0xf34989f52f9fdcba, 0xa098415861a46290, - 0x9fa232c0ef6275a2, 0x8fd75a9f72b13883, 0x5996aac8b16a0d38, 0x9b7da11115aab531, 0xe5ec71862af3d1fa, - 0x723e639595a5ecae, 0xcb0d2b8316e4b694, 0xcd7782b454a0b010, 0x6da5573a443e0055, 0xe463e25189c82562, - 0x150256a2e42211e6, 0xd384d40fa298d3d2, 0x625784556ae58a38, 0xf57e3a80a0fe8118, 0xcf703838d5bf950c, - 0x43d5e3e459a2efca, 0xbb37bf4d7ef7868a, 0x8ac343bc79da3be7, 0x48b4ca99e04bc49a, 0x717766d0ab1ae5b1, - 0x6f79a2320ed45591, 0x86cc50478274065a, 0xc0a8c0aa6cd05ba3, 0x3319974f7011fe4c, 0xa68b34ddf7cece67, - 0x8f0995d4af394327, 0x5dd0c53aca82cf22, 0x91ea0fda6de6a3c7, 0xe327f3dea930069e, 0xc4eb88449c094490, - 0xac4470f14efa93c4, 0x0fc20dbc846bc13b, 0xb002b817434c028d, 0xe13750bc0ca64fbb, 0x4ff10ccbb397fd7f, - 0xdf667ba9dc4501cd, 0xa72bacdcc309a1e5, 0x7c36055f219f203d, 0x77c57e5bf171580e, 0xd5d6807edd81a549, - 0xc38a88a50524c241, 0x8d16b7e1450d4dc8, 0xe5fde11a5469e664, 0xb1b8fdbb6fbef9b7, 0xb5e9780e3fcc27e0, - 0x3e31862f5f3cee30, 0x02edd6d99fc966f1, 0xfc77ff05410b413b, 0x8a43050000000000 - }; -}; - -} // namespace webfront::fs::generated diff --git a/include/webfront/utils/Json.hpp b/include/webfront/utils/Json.hpp index 8bf076b4..2847116a 100644 --- a/include/webfront/utils/Json.hpp +++ b/include/webfront/utils/Json.hpp @@ -127,6 +127,17 @@ class Reader { expect('}'); } + /// Reads an array, calling onElement() for each element; onElement must consume the value. + void array(auto&& onElement) { + expect('['); + if (consumeIf(']')) + return; + do + onElement(); + while (consumeIf(',')); + expect(']'); + } + std::string string() { expect('"'); std::string value; @@ -195,13 +206,9 @@ class Reader { } void skipArray() { - expect('['); - if (consumeIf(']')) - return; - do + array([this] { skipValue(); - while (consumeIf(',')); - expect(']'); + }); } void skipToken() { diff --git a/include/webfront/weblink/WebLink.hpp b/include/webfront/weblink/WebLink.hpp index 1be64d1a..8f609692 100644 --- a/include/webfront/weblink/WebLink.hpp +++ b/include/webfront/weblink/WebLink.hpp @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -123,7 +124,9 @@ class WebLink { std::shared_ptr> pending{std::make_shared>()}; public: - WebLink(typename Net::Socket&& socket, WebLinkId webLinkId, std::function eventHandler, networking::TaskScope& scope) + /// Starts reading at once, unless `startNow` is false: start() then begins, once the owner can dispatch its events. + WebLink(typename Net::Socket&& socket, WebLinkId webLinkId, std::function eventHandler, networking::TaskScope& scope, + bool startNow = true) : ws(websocket::WebSocket::create(std::move(socket), scope)), id(webLinkId), eventsHandler(eventHandler) { log::debug("New WebLink created with id:{}", id); @@ -132,17 +135,25 @@ class WebLink { ws->onMessage([this, guard = handlers](std::span data) { guard->run([&] { onBinaryMessage(data); }); }); // Retire the transport before the WebSocket logs the write error, so it is never fed its own failure. ws->onWriteError([this, guard = handlers](std::error_code) { guard->run([&] { detachTransport(true); }); }); + ws->onWritten([this, guard = handlers] { guard->run([&] { wakeWriters(); }); }); ws->onClose([this, guard = handlers](websocket::CloseEvent event) { guard->run([&] { const log::ContextScope context(linkContext()); detachTransport(false); auto message = event.reason.empty() ? std::string("Browser connection closed") : std::string("Browser connection closed: ") + event.reason; rejectPending(std::make_exception_ptr(std::runtime_error(message))); + // The WebSocket reports its closure once, and never when it is stopped by the server or the link. + eventsHandler({WebLinkEvent::Code::closed, id}); + wakeAllWriters(); // after the closure is known: nothing will be written any more }); }); - ws->start(); + if (startNow) + ws->start(); } + + /// Starts reading, for a link constructed with `startNow` false. + void start() { ws->start(); } WebLink(const WebLink&) = delete; WebLink(WebLink&&) = delete; WebLink& operator=(const WebLink&) = delete; @@ -160,6 +171,7 @@ class WebLink { const log::ContextScope context(linkContext()); log::debug("WebLink destructor"); rejectPending(std::make_exception_ptr(std::runtime_error("Browser connection closed"))); + wakeAllWriters(); } /// Diagnostic frames are refused once this many frames of any kind await the network. @@ -167,6 +179,28 @@ class WebLink { [[nodiscard]] std::uint64_t droppedLogFrames() const { return droppedLogs.load(std::memory_order_relaxed); } [[nodiscard]] std::size_t pendingWrites() const { return ws->pendingWrites(); } + /// Returns 0 when at most `limit` frames await the network. Otherwise registers `ready`, called once they do, on + /// the thread that writes the frame bringing them down, and returns its identifier for cancelWrites(). The waiters + /// are also called when the connection closes or the link is destroyed: nothing is left to wait for. + std::uint64_t whenWritesAtMost(std::size_t limit, std::function ready) { + std::lock_guard lock(writersMutex); + if (ws->pendingWrites() <= limit) + return 0; + const auto waiter = ++lastWriter; + writers.emplace(waiter, Writer{limit, std::move(ready)}); + return waiter; + } + + /// Forgets a waiter of whenWritesAtMost() that was not called yet. + void cancelWrites(std::uint64_t waiter) { + std::function removed; // destroyed outside the lock + std::lock_guard lock(writersMutex); + if (auto found = writers.find(waiter); found != writers.end()) { + removed = std::move(found->second.ready); + writers.erase(found); + } + } + void sendCommand(auto message) { ws->write(message.header(), message.payload()); } void sendFrame(websocket::Frame frame) { ws->write(std::move(frame)); } @@ -277,6 +311,45 @@ class WebLink { } private: + struct Writer { + std::size_t limit; + std::function ready; + }; + std::mutex writersMutex; + std::map writers; // waiters of whenWritesAtMost(), by identifier + std::uint64_t lastWriter = 0; + + // The queue shrank: the waiters it now satisfies are removed, then called outside the lock. + void wakeWriters() { + std::vector> ready; + { + std::lock_guard lock(writersMutex); + if (writers.empty()) + return; + const auto queued = ws->pendingWrites(); + for (auto writer = writers.begin(); writer != writers.end();) { + if (queued > writer->second.limit) { + ++writer; + continue; + } + ready.push_back(std::move(writer->second.ready)); + writer = writers.erase(writer); + } + } + for (auto& call : ready) + call(); + } + + void wakeAllWriters() { + std::map ready; + { + std::lock_guard lock(writersMutex); + ready.swap(writers); + } + for (auto& [waiter, writer] : ready) + writer.ready(); + } + /// Context for link-level logs outside any call; operationId stays empty. [[nodiscard]] log::Context linkContext() const { return {.component = "weblink", .webLinkId = idText.view(), .direction = log::CallDirection::None, .callId = {}}; @@ -326,4 +399,124 @@ class WebLink { } }; + +namespace detail { +/// Completes once at most `limit` frames await the network on a link (WebLink::whenWritesAtMost), or stopped by the +/// receiver's stop token. A link that is gone completes it at once: nothing is left to wait for. +template +class WritesAtMost { +public: + using sender_concept = networking::ex::sender_t; + using completion_signatures = networking::ex::completion_signatures; + + WritesAtMost(std::weak_ptr waited, std::size_t pending) : link(std::move(waited)), limit(pending) {} + + template + class Operation { + using StopToken = networking::ex::stop_token_of_t>; + enum class Completion { none, value, stopped }; + // Shared with the link's waiter and the stop callback, which may run on other threads, also during start(). + // The first of them to finish the operation completes it, unless start() is still running: it then records + // the completion, which start() delivers once it no longer touches the operation. + struct State { + std::atomic done{false}; + std::atomic waiter{0}; + std::mutex mutex; + bool starting = true; + Completion completion = Completion::none; + Operation* operation; + + // True when start() will deliver the completion itself. + bool record(Completion finished) { + std::lock_guard lock(mutex); + if (starting) + completion = finished; + return starting; + } + }; + struct OnStop { + Operation* operation; + void operator()() noexcept { operation->stopped(); } + }; + + Receiver receiver; + std::weak_ptr link; + std::size_t limit; + std::shared_ptr state; + std::optional> stopCallback; + + void stopped() noexcept { + if (state->done.exchange(true)) + return; + if (auto waited = link.lock()) + waited->cancelWrites(state->waiter); + if (state->record(Completion::stopped)) + return; + networking::ex::set_stopped(std::move(receiver)); // may destroy this operation + } + + public: + Operation(Receiver r, std::weak_ptr waited, std::size_t pending) + : receiver(std::move(r)), link(std::move(waited)), limit(pending), state(std::make_shared()) { + state->operation = this; + } + Operation(Operation&&) = delete; + + void start() noexcept { + auto token = networking::ex::get_stop_token(networking::ex::get_env(receiver)); + auto waited = link.lock(); + if (token.stop_requested()) { + state->done = true; + return networking::ex::set_stopped(std::move(receiver)); + } + if (!waited) { + state->done = true; + return networking::ex::set_value(std::move(receiver)); + } + const auto shared = state; + stopCallback.emplace(std::move(token), OnStop{this}); // a stop requested meanwhile is recorded at once + std::uint64_t waiter = 0; + if (!shared->done) { + try { + waiter = waited->whenWritesAtMost(limit, [shared] { + if (shared->done.exchange(true) || shared->record(Completion::value)) + return; // stopped first, or start() delivers it + auto* operation = shared->operation; + operation->stopCallback.reset(); // waits for a stop callback running on another thread + networking::ex::set_value(std::move(operation->receiver)); + }); + } catch (...) { } // registering failed: there is nothing to wait for + } + shared->waiter = waiter; + Completion completion; + { + std::lock_guard lock(shared->mutex); + shared->starting = false; + completion = shared->completion; + } + if (completion == Completion::none && waiter == 0 && !shared->done.exchange(true)) + completion = Completion::value; // already at most `limit` frames queued + if (completion == Completion::none) + return; // the waiter or the stop callback completes it + if (waiter != 0) + waited->cancelWrites(waiter); + stopCallback.reset(); + if (completion == Completion::value) + networking::ex::set_value(std::move(receiver)); + else + networking::ex::set_stopped(std::move(receiver)); + } + }; + + template + Operation connect(Receiver receiver) const { + return Operation(std::move(receiver), link, limit); + } + +private: + std::weak_ptr link; + std::size_t limit; +}; +} // namespace detail + } // namespace webfront diff --git a/js/core/WebFrontAssets.cmake b/js/core/WebFrontAssets.cmake index 73483007..17146274 100644 --- a/js/core/WebFrontAssets.cmake +++ b/js/core/WebFrontAssets.cmake @@ -50,27 +50,6 @@ function(webfront_add_embedded_assets) "${root}/js/core/bootstrap/bootstrap.bundle.mjs" "${root}/include/webfront/system/DeveloperBootstrapData.hpp" DeveloperBootstrapData DeveloperBootstrapAssetFresh) - # Terminal component (include/webfront/system/TerminalFS.hpp). xterm.js files are vendored verbatim in - # third_party/xterm (see its VERSION file); refresh them with cmake/UpdateXterm.cmake. - _webfront_add_embedded_text_asset( - "${root}/js/developer/components/terminal/index.html" "${root}/include/webfront/system/TerminalIndexHtmlData.hpp" - TerminalIndexHtmlData TerminalIndexHtmlAssetFresh) - _webfront_add_embedded_text_asset( - "${root}/js/developer/components/terminal/terminal.mjs" "${root}/include/webfront/system/TerminalModuleData.hpp" - TerminalModuleData TerminalModuleAssetFresh) - # Browser side of the wf tool manager (include/webfront/system/ToolManagerFS.hpp). - _webfront_add_embedded_text_asset( - "${root}/js/developer/components/tools/wf.mjs" "${root}/include/webfront/system/ToolManagerModuleData.hpp" - ToolManagerModuleData ToolManagerModuleAssetFresh) - _webfront_add_embedded_text_asset( - "${root}/third_party/xterm/xterm.mjs" "${root}/include/webfront/system/XtermModuleData.hpp" - XtermModuleData XtermModuleAssetFresh ON) - _webfront_add_embedded_text_asset( - "${root}/third_party/xterm/xterm.css" "${root}/include/webfront/system/XtermCssData.hpp" - XtermCssData XtermCssAssetFresh ON) - _webfront_add_embedded_text_asset( - "${root}/third_party/xterm/addon-fit.mjs" "${root}/include/webfront/system/XtermFitAddonData.hpp" - XtermFitAddonData XtermFitAddonAssetFresh ON) _webfront_add_embedded_text_asset( "${root}/third_party/react/runtime.mjs" "${root}/include/webfront/system/ReactRuntimeData.hpp" ReactRuntimeData ReactRuntimeAssetFresh ON) diff --git a/js/core/bootstrap/bootstrap.bundle.mjs b/js/core/bootstrap/bootstrap.bundle.mjs index 3b130c47..6aa88502 100644 --- a/js/core/bootstrap/bootstrap.bundle.mjs +++ b/js/core/bootstrap/bootstrap.bundle.mjs @@ -1 +1 @@ -var u=new TextDecoder;async function p(t,e){let n=String(e??"").split(/\s+/).filter(a=>a.startsWith("sha512-")).map(a=>a.split("?")[0]);if(n.length===0)throw new Error("The package has no SHA-512 integrity");if(!globalThis.crypto?.subtle)throw new Error("Integrity checks need a secure context (https or localhost)");let r=new Uint8Array(await crypto.subtle.digest("SHA-512",t)),o="sha512-"+btoa(Array.from(r,a=>String.fromCharCode(a)).join(""));if(!n.includes(o))throw new Error(`Integrity check failed: expected ${n[0]}, got ${o}`);return o}async function d(t,e=268435456){let n=new Blob([t]).stream().pipeThrough(new DecompressionStream("gzip")).getReader(),r=[],o=0;for(let a=await n.read();!a.done;a=await n.read()){if(o+=a.value.length,o>e)throw await n.cancel(),new Error(`The tarball unpacks to more than ${e} bytes`);r.push(a.value)}return new Uint8Array(await new Blob(r).arrayBuffer())}function l(t,e,n){let r=t.subarray(e,e+n),o=r.indexOf(0);return u.decode(o<0?r:r.subarray(0,o))}function y(t,e,n){if(t[e]&128)return t.subarray(e+1,e+n).reduce((o,a)=>o*256+a,t[e]&127);let r=l(t,e,n).trim();if(!/^[0-7]*$/.test(r))throw new Error("Corrupt tar header");return r===""?0:parseInt(r,8)}function T(t){let e=0;for(let n=0;n<512;++n)e+=n>=148&&n<156?32:t[n];if(y(t,148,8)!==e)throw new Error("Corrupt tar header checksum")}function S(t){let e={},n=0;for(;n0)||n+o>t.length)throw new Error("Corrupt pax header");let a=u.decode(t.subarray(r+1,n+o-1)),i=a.indexOf("=");e[a.slice(0,i)]=a.slice(i+1),n+=o}return e}function z(t,e){let n=t.subarray(e,e+512);T(n);let r=y(n,124,12),o=e+512;if(o+r>t.length)throw new Error("Truncated tar archive");return{header:n,type:n[156]===0?"0":String.fromCharCode(n[156]),data:t.subarray(o,o+r),next:o+Math.ceil(r/512)*512}}function U(t,e){return e+512>t.length||t.subarray(e,e+512).every(n=>n===0)}function I(t){let e=l(t,0,100),n=l(t,257,5)==="ustar"?l(t,345,155):"";return n?`${n}/${e}`:e}var h={x:(t,e)=>({...t,pax:S(e).path}),L:(t,e)=>({...t,long:l(e,0,e.length)}),g:t=>t};function m(t){let e=[],n={};for(let r=0;!U(t,r);){let{header:o,type:a,data:i,next:s}=z(t,r);if(r=s,Object.hasOwn(h,a)){n=h[a](n,i);continue}(a==="0"||a==="7")&&e.push({path:n.pax??n.long??I(o),bytes:i}),n={}}return e}var c=(t,e,...n)=>t.cppFunction(`webfront.developer.${e}`)(...n);async function g(t,e){let n=[],r=0;for(;;){let o=await c(t,"read",e,r);if(n.push(o),r+=o.length,o.length<262144)break;if(r>256*1024*1024)throw new Error("Project file is too large")}return new Uint8Array(await new Blob(n).arrayBuffer())}async function j(t,{id:e,path:n,bytes:r},o){for(let a=0;a{}),s}}async function B(t,e){let n=[],r=0;for(;;){let{done:o,value:a}=await t.read();if(o)return n;if(r+=a.length,r>e)throw new Error("Compressed download exceeds its byte limit");n.push(a)}}async function F(t,e){try{return await B(t,e)}catch(n){throw await t.cancel().catch(()=>{}),n}finally{t.releaseLock()}}async function b(t,e=64*1024*1024){if(!t.ok)throw new Error(`Download: HTTP ${t.status}`);if(Number(t.headers.get("content-length"))>e)throw new Error("Compressed download exceeds its byte limit");return new Uint8Array(await new Blob(await F(t.body.getReader(),e)).arrayBuffer())}var O=/[\\\0:*?"<>|]/,C=t=>t.split("/").some(e=>!e||e==="."||e==="..");function v(t){return typeof t!="string"||!t||O.test(t)?!0:C(t)}var w=t=>!v(t),P=new TextDecoder;function A(t,e){if(!e.path.startsWith("package/"))throw new Error("Invalid environment archive root");let n=e.path.slice(8);if(!w(n)||t.has(n))throw new Error("Invalid or duplicate environment path");t.set(n,e.bytes)}function L(t){let e=new Map;for(let n of m(t))A(e,n);return e}function R(t,e){return t.protocol!==1||!w(t.entry)?!1:e.has(t.entry)}async function x(t,e){await p(t,e);let n=L(await d(t));if(!n.has("environment.json"))throw new Error("Environment archive has no environment.json");let r=JSON.parse(P.decode(n.get("environment.json")));if(!R(r,n))throw new Error("Unsupported WebFront developer environment");return{files:n,manifest:r}}var k=".webfront/developer/environment.tgz";async function N(t,e){try{let n=await g(t,k);return await x(n,e),n}catch{return null}}async function W(t,e){let n=new URL(t.environment,location.href);if(n.protocol!=="https:"&&n.origin!==location.origin)throw new Error("The environment must use HTTPS or the application origin");let r=await e(n);if(!r.ok)throw new Error(`Environment download: HTTP ${r.status}`);return b(r)}function D(t){return!t||!w(t.archive)?!1:String(t.integrity).startsWith("sha512-")}function H(t,e){return Object.fromEntries(Object.entries(t.starters??{}).map(([n,r])=>{if(!D(r))throw new Error("Invalid pinned starter metadata");return[n,{url:new URL(r.archive,e).href,integrity:r.integrity}]}))}async function E(t,e,n=fetch,r=()=>{}){let o=await N(t,e.integrity);o?r("Using verified cached developer environment"):(r("Downloading developer environment"),o=await W(e,n));let{files:a,manifest:i}=await x(o,e.integrity),s=H(i,new URL(e.environment,location.href));return await f(t,".webfront/developer/environment",a),await f(t,k,new Map([["output",o]]),{directory:!1}),{url:`/webfront/developer/environment/${i.entry}`,config:{...e,starters:s}}}if(typeof document<"u"&&document.getElementById("retry")){let t=document.getElementById("status"),e=document.getElementById("retry"),n=async()=>{e.hidden=!0;try{await webFront.ready;let r=JSON.parse(await c(webFront,"config")),{url:o,config:a}=await E(webFront,r,fetch,s=>{t.textContent=s});await(await import(o)).mount({bridge:webFront,config:a,terminal:document.getElementById("terminal"),preview:document.getElementById("preview")}),t.textContent="Developer environment ready. Type wf help."}catch(r){t.textContent=`Bootstrap failed: ${r.message}`,e.hidden=!1}};e.addEventListener("click",n),n()} +var l=new TextDecoder;async function h(e,t){let r=String(t??"").split(/\s+/).filter(a=>a.startsWith("sha512-")).map(a=>a.split("?")[0]);if(r.length===0)throw new Error("The package has no SHA-512 integrity");if(!globalThis.crypto?.subtle)throw new Error("Integrity checks need a secure context (https or localhost)");let n=new Uint8Array(await crypto.subtle.digest("SHA-512",e)),o="sha512-"+btoa(Array.from(n,a=>String.fromCharCode(a)).join(""));if(!r.includes(o))throw new Error(`Integrity check failed: expected ${r[0]}, got ${o}`);return o}async function p(e,t=268435456){let r=new Blob([e]).stream().pipeThrough(new DecompressionStream("gzip")).getReader(),n=[],o=0;for(let a=await r.read();!a.done;a=await r.read()){if(o+=a.value.length,o>t)throw await r.cancel(),new Error(`The tarball unpacks to more than ${t} bytes`);n.push(a.value)}return new Uint8Array(await new Blob(n).arrayBuffer())}function u(e,t,r){let n=e.subarray(t,t+r),o=n.indexOf(0);return l.decode(o<0?n:n.subarray(0,o))}function y(e,t,r){if(e[t]&128)return e.subarray(t+1,t+r).reduce((o,a)=>o*256+a,e[t]&127);let n=u(e,t,r).trim();if(!/^[0-7]*$/.test(n))throw new Error("Corrupt tar header");return n===""?0:parseInt(n,8)}function z(e){let t=0;for(let r=0;r<512;++r)t+=r>=148&&r<156?32:e[r];if(y(e,148,8)!==t)throw new Error("Corrupt tar header checksum")}function B(e){let t={},r=0;for(;r0)||r+o>e.length)throw new Error("Corrupt pax header");let a=l.decode(e.subarray(n+1,r+o-1)),i=a.indexOf("=");t[a.slice(0,i)]=a.slice(i+1),r+=o}return t}function T(e,t){let r=e.subarray(t,t+512);z(r);let n=y(r,124,12),o=t+512;if(o+n>e.length)throw new Error("Truncated tar archive");return{header:r,type:r[156]===0?"0":String.fromCharCode(r[156]),data:e.subarray(o,o+n),next:o+Math.ceil(n/512)*512}}function C(e,t){return t+512>e.length||e.subarray(t,t+512).every(r=>r===0)}function I(e){let t=u(e,0,100),r=u(e,257,5)==="ustar"?u(e,345,155):"";return r?`${r}/${t}`:t}var w={x:(e,t)=>({...e,pax:B(t).path}),L:(e,t)=>({...e,long:u(t,0,t.length)}),g:e=>e};function m(e){let t=[],r={};for(let n=0;!C(e,n);){let{header:o,type:a,data:i,next:s}=T(e,n);if(n=s,Object.hasOwn(w,a)){r=w[a](r,i);continue}(a==="0"||a==="7")&&t.push({path:r.pax??r.long??I(o),bytes:i}),r={}}return t}var c=(e,t,...r)=>e.cppFunction(`webfront.developer.${t}`)(...r);async function g(e,t){let r=[],n=0;for(;;){let o=await c(e,"read",t,n);if(r.push(o),n+=o.length,o.length<262144)break;if(n>256*1024*1024)throw new Error("Project file is too large")}return new Uint8Array(await new Blob(r).arrayBuffer())}async function U(e,{id:t,path:r,bytes:n},o){for(let a=0;a{}),s}}async function P(e,t){let r=[],n=0;for(;;){let{done:o,value:a}=await e.read();if(o)return r;if(n+=a.length,n>t)throw new Error("Compressed download exceeds its byte limit");r.push(a)}}async function $(e,t){try{return await P(e,t)}catch(r){throw await e.cancel().catch(()=>{}),r}finally{e.releaseLock()}}async function b(e,t=64*1024*1024){if(!e.ok)throw new Error(`Download: HTTP ${e.status}`);if(Number(e.headers.get("content-length"))>t)throw new Error("Compressed download exceeds its byte limit");return new Uint8Array(await new Blob(await $(e.body.getReader(),t)).arrayBuffer())}var j=/[\\\0:*?"<>|]/,A=e=>e.split("/").some(t=>!t||t==="."||t==="..");function v(e){return typeof e!="string"||!e||j.test(e)?!0:A(e)}var d=e=>!v(e),O=new TextDecoder;function F(e,t){if(!t.path.startsWith("package/"))throw new Error("Invalid environment archive root");let r=t.path.slice(8);if(!d(r)||e.has(r))throw new Error("Invalid or duplicate environment path");e.set(r,t.bytes)}function L(e){let t=new Map;for(let r of m(e))F(t,r);return t}function N(e,t){return e.protocol!==1||!d(e.entry)?!1:t.has(e.entry)}async function x(e,t){await h(e,t);let r=L(await p(e));if(!r.has("environment.json"))throw new Error("Environment archive has no environment.json");let n=JSON.parse(O.decode(r.get("environment.json")));if(!N(n,r))throw new Error("Unsupported WebFront developer environment");return{files:r,manifest:n}}var E=".webfront/developer/environment.tgz";async function R(e,t){try{let r=await g(e,E);return await x(r,t),r}catch{return null}}async function D(e,t){let r=new URL(e.environment,location.href);if(r.protocol!=="https:"&&r.origin!==location.origin)throw new Error("The environment must use HTTPS or the application origin");let n=await t(r);if(!n.ok)throw new Error(`Environment download: HTTP ${n.status}`);return b(n)}function H(e){return!e||!d(e.archive)?!1:String(e.integrity).startsWith("sha512-")}function W(e,t){return Object.fromEntries(Object.entries(e.starters??{}).map(([r,n])=>{if(!H(n))throw new Error("Invalid pinned starter metadata");return[r,{url:new URL(n.archive,t).href,integrity:n.integrity}]}))}async function k(e,t,r=fetch,n=()=>{}){let o=await R(e,t.integrity);o?n("Using verified cached developer environment"):(n("Downloading developer environment"),o=await D(t,r));let{files:a,manifest:i}=await x(o,t.integrity),s=W(i,new URL(t.environment,location.href));return await f(e,".webfront/developer/environment",a),await f(e,E,new Map([["output",o]]),{directory:!1}),{url:`/webfront/developer/environment/${i.entry}`,config:{...t,starters:s}}}if(typeof document<"u"&&document.getElementById("retry")){let e=document.getElementById("status"),t=document.getElementById("retry"),r=async()=>{t.hidden=!0;try{await webFront.ready;let n=JSON.parse(await c(webFront,"config")),{url:o,config:a}=await k(webFront,n,fetch,s=>{e.textContent=s});await(await import(o)).mount({bridge:webFront,config:a,terminal:document.getElementById("terminal"),preview:document.getElementById("preview")}),e.textContent="Developer environment ready. Type wf help."}catch(n){e.textContent=`Bootstrap failed: ${n.message}`,t.hidden=!1}};t.addEventListener("click",r),r()} diff --git a/js/developer/components/terminal/index.html b/js/developer/components/terminal/index.html deleted file mode 100644 index 480c7245..00000000 --- a/js/developer/components/terminal/index.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - - -WebFront Terminal - - - - -
- - - - diff --git a/js/developer/components/terminal/terminal.mjs b/js/developer/components/terminal/terminal.mjs deleted file mode 100644 index f910ffe2..00000000 --- a/js/developer/components/terminal/terminal.mjs +++ /dev/null @@ -1,360 +0,0 @@ -/// @brief WebFront terminal component: an xterm.js terminal whose line editor sends each validated -/// line to the C++ commands registered through webfront::Terminal (include/webfront/components/Terminal.hpp), -/// unless a browser command of an extension module (Terminal::extension) handles it first. - -import {Terminal} from "./xterm.mjs"; -import {FitAddon} from "./addon-fit.mjs"; - -const ansi = { - red: (text) => `\x1b[31m${text}\x1b[0m`, - clearToEnd: "\x1b[K", - clearScreen: "\x1b[2J\x1b[3J\x1b[H", - left: (count) => (count > 0 ? `\x1b[${count}D` : ""), -}; - -function commonPrefix(words) { - return words.reduce((prefix, word) => { - const limit = Math.min(prefix.length, word.length); - let length = 0; - while (length < limit && prefix[length] === word[length]) - ++length; - return prefix.slice(0, length); - }); -} - -// Reads a line for tokenize(), one word part at a time. -class Scanner { - constructor(line) { - this.line = line; - this.index = 0; - } - - get done() { - return this.index === this.line.length; - } - - next(problem) { - if (this.done) - throw new SyntaxError(problem); - return this.line[this.index++]; - } - - // The content of a quoted string whose opening quote was read. Inside double quotes a backslash - // escapes the next character; one ending the line stays literal, and the missing closing quote - // is reported next. - quoted(quote) { - let content = ""; - for (let char = this.next("Unterminated quote"); char !== quote; char = this.next("Unterminated quote")) - content += quote === '"' && char === "\\" && !this.done ? this.next() : char; - return content; - } - - // What `char`, read outside quotes, adds to the current word. - part(char) { - if (char === "\\") - return this.next("Trailing backslash"); - if (char === "'" || char === '"') - return this.quoted(char); - return char; - } -} - -/// Splits a line into words like terminal::tokenize in C++: whitespace separates words, single quotes -/// keep their content verbatim, double quotes keep it but honor backslash escapes, and an unquoted -/// backslash escapes the next character. Throws a SyntaxError on an unterminated quote or a trailing -/// backslash. -export function tokenize(line) { - const words = []; - const scanner = new Scanner(line); - let word = null; // null between words - while (!scanner.done) { - const char = scanner.next(); - const separator = char === " " || char === "\t"; - if (separator && word !== null) - words.push(word); - word = separator ? null : (word ?? "") + scanner.part(char); - } - if (word !== null) - words.push(word); - return words; -} - -// Browser command output uses "\n" line endings, converted like C++ output. -const toTerminalText = (text) => text.replace(/(? 0 ? commands.get(words[0]) : undefined; - if (!handler) - return runInCpp(line); - const output = await handler(words.slice(1), { - line, - bridge, - signal, - write: (text) => write(toTerminalText(String(text))), - runInCpp: () => runInCpp(line), - }); - return output === undefined ? runInCpp(line) : toTerminalText(String(output)); -} - -/// Imports the extension modules listed by C++ ("\n"-separated URLs) and collects their browser -/// commands. A module that fails to load is reported and skipped. -async function loadExtensions(urls, write) { - const commands = new Map(); - for (const url of urls.split("\n").filter((entry) => entry !== "")) { - try { - const module = await import(url); - for (const [name, handler] of Object.entries(module.commands ?? {})) - commands.set(name, handler); - } catch (error) { - write(ansi.red(`Terminal extension ${url} failed to load: ${error?.message ?? error}`) + "\r\n"); - } - } - return commands; -} - -// Editing keys, as xterm.js reports them in onData, mapped to LineEditor actions. -const keyActions = new Map([ - ["\r", (editor) => editor.submit()], - ["\x7f", (editor) => editor.erase(-1)], - ["\b", (editor) => editor.erase(-1)], - ["\x1b[3~", (editor) => editor.erase(0)], - ["\x1b[D", (editor) => editor.moveTo(editor.cursor - 1)], - ["\x1b[C", (editor) => editor.moveTo(editor.cursor + 1)], - ["\x1b[H", (editor) => editor.moveTo(0)], - ["\x1bOH", (editor) => editor.moveTo(0)], - ["\x01", (editor) => editor.moveTo(0)], - ["\x1b[F", (editor) => editor.moveTo(editor.chars.length)], - ["\x1bOF", (editor) => editor.moveTo(editor.chars.length)], - ["\x05", (editor) => editor.moveTo(editor.chars.length)], - ["\x1b[A", (editor) => editor.recall(-1)], - ["\x1b[B", (editor) => editor.recall(1)], - ["\t", (editor) => editor.track(editor.completeLine())], - ["\x03", (editor) => editor.cancelLine()], - ["\x0c", (editor) => editor.redraw(ansi.clearScreen)], - ["\x15", (editor) => editor.killBeforeCursor()], -]); - -/// Line editor driven by the terminal's input data. `write(text)` displays text; `run(line)` and -/// `complete(line)` return Promises of the C++ output and of "\n"-separated completion candidates. -export class LineEditor { - constructor({write, run, complete, prompt}) { - this.write = write; - this.run = run; - this.complete = complete; - this.abort = null; - this.prompt = prompt; - this.chars = []; - this.cursor = 0; - this.history = []; - this.historyIndex = 0; - this.busy = null; - } - - get line() { - return this.chars.join(""); - } - - /// Resolves once no command or completion is pending. - async whenIdle() { - while (this.busy) - await this.busy; - } - - showPrompt() { - this.write(this.prompt); - } - - handle(data) { - if (this.busy) - return this.interrupt(data); - const action = keyActions.get(data); - if (action) - return action(this); - if (!data.startsWith("\x1b")) - return this.insertText(data); - } - - // While a command runs, Ctrl+C aborts its signal once and the other keys are ignored. - interrupt(data) { - const running = this.abort?.signal.aborted === false; - if (data !== "\x03" || !running) - return; - this.write("^C\r\n"); - this.abort.abort(new Error("Interrupted")); - } - - // Typed or pasted text: printable characters are inserted, a carriage return submits the line - // and the rest of a multi-line paste is dropped, since commands run one at a time. - insertText(data) { - const [text, ...rest] = data.split("\r"); - this.insert(Array.from(text).filter((char) => char >= " " && char !== "\x7f")); - if (rest.length > 0) - return this.submit(); - } - - insert(chars) { - if (chars.length === 0) - return; - this.chars.splice(this.cursor, 0, ...chars); - this.cursor += chars.length; - this.redraw(); - } - - erase(offset) { - const index = this.cursor + offset; - if (index < 0 || index >= this.chars.length) - return; - this.chars.splice(index, 1); - this.cursor = index; - this.redraw(); - } - - killBeforeCursor() { - this.chars.splice(0, this.cursor); - this.cursor = 0; - this.redraw(); - } - - moveTo(position) { - const cursor = Math.max(0, Math.min(this.chars.length, position)); - if (cursor === this.cursor) - return; - this.cursor = cursor; - this.redraw(); - } - - recall(direction) { - const index = this.historyIndex + direction; - if (index < 0 || index > this.history.length) - return; - this.historyIndex = index; - this.chars = Array.from(index === this.history.length ? "" : this.history[index]); - this.cursor = this.chars.length; - this.redraw(); - } - - cancelLine() { - this.write("^C\r\n"); - this.chars = []; - this.cursor = 0; - this.historyIndex = this.history.length; - this.showPrompt(); - } - - // Rewrites the prompt and the line in place, then moves the cursor back to its position. - redraw(prefix = "\r") { - this.write(prefix + this.prompt + this.line + ansi.clearToEnd + ansi.left(this.chars.length - this.cursor)); - } - - track(promise) { - this.busy = promise.finally(() => { - this.busy = null; - }); - return this.busy; - } - - submit() { - const line = this.line; - this.write("\r\n"); - this.chars = []; - this.cursor = 0; - if (line.trim() !== "" && this.history.at(-1) !== line) - this.history.push(line); - this.historyIndex = this.history.length; - return this.track(this.execute(line)); - } - - async execute(line) { - this.abort = new AbortController(); - try { - const output = await this.run(line, this.abort.signal); - // The prompt starts on a new line, unless the output already ends one or leaves the - // cursor at home (such as the 'clear' command). - if (output) - this.write(output.endsWith("\n") || output.endsWith("\x1b[H") ? output : output + "\r\n"); - } catch (error) { - this.write(ansi.red(`Error: ${error?.message ?? error}`) + "\r\n"); - } - this.showPrompt(); - } - - async completeLine() { - // Only the command name is completed, and only with the cursor at the end of the line. - if (this.cursor !== this.chars.length) - return; - const line = this.line; - let candidates; - try { - candidates = (await this.complete(line)).split("\n").filter((word) => word !== ""); - } catch (error) { - return; - } - if (candidates.length === 0) - return; - const completion = candidates.length === 1 ? candidates[0] + " " : commonPrefix(candidates); - if (completion.length > line.length) - return this.insert(Array.from(completion.slice(line.length))); - this.write("\r\n" + candidates.join(" ") + "\r\n"); - this.redraw(); - } -} - -/// Mounts a terminal in `element` once the WebFront bridge is ready. Returns the xterm Terminal, -/// its line editor and a `flush()` resolving when every write has been rendered. -export async function mount(element, {bridge = globalThis.webFront, terminalOptions = {}} = {}) { - const terminal = new Terminal({ - cursorBlink: true, - convertEol: false, - fontFamily: 'ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace', - theme: {background: "#0d1117", foreground: "#e6edf3"}, - ...terminalOptions, - }); - const fit = new FitAddon(); - terminal.loadAddon(fit); - terminal.open(element); - fit.fit(); - new ResizeObserver(() => fit.fit()).observe(element); - - let lastWrite = Promise.resolve(); - const write = (text) => { - lastWrite = new Promise((resolve) => terminal.write(text, resolve)); - }; - const flush = () => lastWrite; - - try { - await bridge.ready; - } catch (error) { - write(ansi.red(`Connection to the application failed: ${error?.message ?? error}`) + "\r\n"); - return {terminal, editor: null, flush}; - } - - const call = (name) => bridge.cppFunction(`webfront.terminal.${name}`); - let prompt, banner, extensions; - try { - [prompt, banner, extensions] = await Promise.all([call("prompt")(), call("banner")(), call("extensions")()]); - } catch (error) { - // For example a page served by an application without webfront::Terminal. - write(ansi.red(`Terminal unavailable: ${error?.message ?? error}`) + "\r\n"); - return {terminal, editor: null, flush}; - } - const commands = await loadExtensions(extensions, write); - const runInCpp = call("run"); - const run = (line, signal) => runLine(line, {commands, runInCpp, write, bridge, signal}); - const editor = new LineEditor({write, run, complete: call("complete"), prompt}); - if (banner) - write(banner.replaceAll("\n", "\r\n") + "\r\n"); - editor.showPrompt(); - terminal.onData((data) => editor.handle(data)); - terminal.focus(); - return {terminal, editor, flush}; -} diff --git a/js/developer/components/tools/wf.mjs b/js/developer/components/tools/wf.mjs deleted file mode 100644 index c8a477f9..00000000 --- a/js/developer/components/tools/wf.mjs +++ /dev/null @@ -1,341 +0,0 @@ -/// @brief Browser side of the wf tool manager (#234), a terminal extension added by -/// webfront::ToolManager (include/webfront/components/ToolManager.hpp). 'wf search', 'wf install' and -/// 'wf open' run here, because the download speaks HTTPS; 'wf list', 'wf remove' and 'wf help' run -/// in C++. An installation fetches the packument and the tarball from the npm registry, checks the -/// tarball's SHA-512 integrity, unpacks it and sends its files through webfront.pkg.begin, -/// .writeFile and .commit. - -const blockSize = 512; -/// Files cross the bridge in chunks of this many bytes; the browser sends a large one in several -/// WebSocket frames, which the server reassembles. -export const chunkSize = 256 * 1024; -/// Largest unpacked tarball accepted, against decompression bombs. -export const maxUnpackedBytes = 256 * 1024 * 1024; -const utf8 = new TextDecoder(); - -/// Splits "name[@version]", where the name may be scoped ("@scope/name@1.0.0"). The version is "" -/// when absent. -export function parseSpec(spec) { - const at = spec.indexOf("@", spec.startsWith("@") ? 1 : 0); - return at < 0 ? {name: spec, version: ""} : {name: spec.slice(0, at), version: spec.slice(at + 1)}; -} - -function registryBase(registry) { - const base = new URL(registry, globalThis.location?.href); - if (!base.pathname.endsWith("/")) - base.pathname += "/"; - return base; -} - -// The registry encodes the slash of a scoped name. -const packumentUrl = (base, name) => new URL(name.replace("/", "%2f"), base); - -async function fetchOk(url, fetchImpl, signal) { - const response = await fetchImpl(url, {signal}); - if (!response.ok) - throw new Error(`${url}: HTTP ${response.status}`); - return response; -} - -async function fetchJson(url, fetchImpl, signal) { - return (await fetchOk(url, fetchImpl, signal)).json(); -} - -function resolveManifest(packument, name, requested) { - const tag = requested || "latest"; - const version = packument["dist-tags"]?.[tag] ?? requested; - const manifest = packument.versions?.[version]; - if (!manifest) - throw new Error(`${name} has no version '${tag}'`); - return manifest; -} - -/// Checks bytes against an SRI integrity string ("sha512-", possibly several hashes -/// separated by spaces) and returns the matching "sha512-…" hash. Only SHA-512 is accepted. -export async function verifyIntegrity(bytes, integrity) { - const expected = String(integrity ?? "") - .split(/\s+/) - .filter((hash) => hash.startsWith("sha512-")) - .map((hash) => hash.split("?")[0]); - if (expected.length === 0) - throw new Error("The package has no SHA-512 integrity"); - if (!globalThis.crypto?.subtle) - throw new Error("Integrity checks need a secure context (https or localhost)"); - const digest = new Uint8Array(await crypto.subtle.digest("SHA-512", bytes)); - const actual = "sha512-" + btoa(Array.from(digest, (byte) => String.fromCharCode(byte)).join("")); - if (!expected.includes(actual)) - throw new Error(`Integrity check failed: expected ${expected[0]}, got ${actual}`); - return actual; -} - -/// Gunzips bytes, failing once more than `limit` bytes come out. -export async function gunzip(bytes, limit = maxUnpackedBytes) { - const reader = new Blob([bytes]).stream().pipeThrough(new DecompressionStream("gzip")).getReader(); - const chunks = []; - let total = 0; - for (let read = await reader.read(); !read.done; read = await reader.read()) { - total += read.value.length; - if (total > limit) { - await reader.cancel(); - throw new Error(`The tarball unpacks to more than ${limit} bytes`); - } - chunks.push(read.value); - } - return new Uint8Array(await new Blob(chunks).arrayBuffer()); -} - -// A NUL-terminated header field. -function text(block, offset, length) { - const field = block.subarray(offset, offset + length); - const end = field.indexOf(0); - return utf8.decode(end < 0 ? field : field.subarray(0, end)); -} - -// An octal number, or a base-256 one when the first byte has its high bit set (GNU and star). -function number(block, offset, length) { - if (block[offset] & 0x80) - return block.subarray(offset + 1, offset + length).reduce((value, byte) => value * 256 + byte, block[offset] & 0x7f); - const digits = text(block, offset, length).trim(); - if (!/^[0-7]*$/.test(digits)) - throw new Error("Corrupt tar header"); - return digits === "" ? 0 : parseInt(digits, 8); -} - -function verifyChecksum(header) { - let sum = 0; - for (let index = 0; index < blockSize; ++index) - sum += index >= 148 && index < 156 ? 0x20 : header[index]; - if (number(header, 148, 8) !== sum) - throw new Error("Corrupt tar header checksum"); -} - -// " =\n" records of a pax extended header; lengths count bytes. -function paxRecords(data) { - const records = {}; - let offset = 0; - while (offset < data.length) { - const space = data.indexOf(0x20, offset); - const length = space < 0 ? NaN : Number(utf8.decode(data.subarray(offset, space))); - if (!(length > 0) || offset + length > data.length) - throw new Error("Corrupt pax header"); - const record = utf8.decode(data.subarray(space + 1, offset + length - 1)); - const equals = record.indexOf("="); - records[record.slice(0, equals)] = record.slice(equals + 1); - offset += length; - } - return records; -} - -// The entry whose header starts at `offset`: its header, type flag, data and the offset of the next -// entry. -function readEntry(archive, offset) { - const header = archive.subarray(offset, offset + blockSize); - verifyChecksum(header); - const size = number(header, 124, 12); - const start = offset + blockSize; - if (start + size > archive.length) - throw new Error("Truncated tar archive"); - return { - header, - type: header[156] === 0 ? "0" : String.fromCharCode(header[156]), - data: archive.subarray(start, start + size), - next: start + Math.ceil(size / blockSize) * blockSize, - }; -} - -// An archive ends at two zero blocks; one is enough to stop. -function isEnd(archive, offset) { - return offset + blockSize > archive.length || archive.subarray(offset, offset + blockSize).every((byte) => byte === 0); -} - -// The name field of a ustar header, after its prefix field. -function headerPath(header) { - const name = text(header, 0, 100); - const prefix = text(header, 257, 5) === "ustar" ? text(header, 345, 155) : ""; - return prefix ? `${prefix}/${name}` : name; -} - -// Entries naming the next one: a pax extended header and a GNU long name. A pax global header names -// nothing WebFront uses. -const nameEntries = { - x: (names, data) => ({...names, pax: paxRecords(data).path}), - L: (names, data) => ({...names, long: text(data, 0, data.length)}), - g: (names) => names, -}; - -/// Reads a tar archive (ustar, with pax and GNU long names) and returns its regular files as -/// {path, bytes}, in archive order. Directories, links and other entries are skipped. -export function readTar(archive) { - const files = []; - let names = {}; - for (let offset = 0; !isEnd(archive, offset);) { - const {header, type, data, next} = readEntry(archive, offset); - offset = next; - if (Object.hasOwn(nameEntries, type)) { - names = nameEntries[type](names, data); - continue; - } - if (type === "0" || type === "7") - files.push({path: names.pax ?? names.long ?? headerPath(header), bytes: data}); - names = {}; - } - return files; -} - -/// The files of an npm tarball by path relative to the package root: the first path component -/// (normally "package/") is removed, as npm does. A later entry replaces an earlier one. -function packageFiles(entries) { - const files = new Map(); - for (const {path, bytes} of entries) { - const relative = path.replace(/^(\.?\/)+/, "").split("/").slice(1).join("/"); - if (relative !== "") - files.set(relative, bytes); - } - return files; -} - -function packageJson(files, name, version) { - const manifest = files.get("package.json"); - if (!manifest) - throw new Error(`${name}@${version} has no package.json`); - const pkg = JSON.parse(utf8.decode(manifest)); - if (pkg.name !== name || pkg.version !== version) - throw new Error(`The archive contains ${pkg.name}@${pkg.version}, not ${name}@${version}`); - return pkg; -} - -const isTool = (field) => field?.kind === "tool" && typeof field.entry === "string"; - -function toolOf(files, name, version) { - const tool = packageJson(files, name, version).webfront; - if (!isTool(tool)) - throw new Error(`${name} is not a WebFront tool: its package.json has no webfront field with kind "tool" and an entry`); - return {entry: tool.entry.replace(/^(\.\/)+/, ""), title: typeof tool.title === "string" ? tool.title : name}; -} - -const pkgFunction = (bridge, name) => bridge.cppFunction(`webfront.pkg.${name}`); - -/// Options shared by search() and install(): -/// bridge the WebFront bridge (globalThis.webFront) -/// registry the npm registry URL (default: webfront.pkg.registry(), set in ToolManagerOptions) -/// fetch the fetch function -/// signal an AbortSignal stopping the downloads and the upload -async function settings({bridge = globalThis.webFront, registry, fetch: fetchImpl = (...args) => globalThis.fetch(...args), signal} = {}) { - return {bridge, fetchImpl, signal, base: registryBase(registry ?? (await pkgFunction(bridge, "registry")()))}; -} - -/// Searches the registry for packages with the webfront-tool keyword. Returns {name, version, -/// description} objects. -export async function search(term, options) { - const {fetchImpl, signal, base} = await settings(options); - const url = new URL("-/v1/search", base); - url.searchParams.set("text", `keywords:webfront-tool ${term}`.trim()); - url.searchParams.set("size", "20"); - const result = await fetchJson(url, fetchImpl, signal); - return (result.objects ?? []).map(({package: found}) => ({ - name: found.name, - version: found.version, - description: found.description ?? "", - })); -} - -// Downloads the tarball of a manifest and returns its files with the verified integrity. -async function download(manifest, packumentLocation, fetchImpl, signal) { - const tarballUrl = new URL(manifest.dist?.tarball ?? "", packumentLocation); - const tarball = new Uint8Array(await (await fetchOk(tarballUrl, fetchImpl, signal)).arrayBuffer()); - const integrity = await verifyIntegrity(tarball, manifest.dist?.integrity); - return {integrity, files: packageFiles(readTar(await gunzip(tarball)))}; -} - -// Sends the files to webfront.pkg.writeFile in chunks; an empty file is sent as one empty chunk. -async function upload(files, {bridge, name, version, signal}) { - const writeFile = pkgFunction(bridge, "writeFile"); - for (const [path, bytes] of files) { - let offset = 0; - do { - signal?.throwIfAborted(); - const chunk = bytes.subarray(offset, offset + chunkSize); - await writeFile(name, version, path, offset, chunk); - offset += chunk.length; - } while (offset < bytes.length); - } -} - -/// Downloads, verifies and stores "name[@version or dist-tag]" (latest by default). `progress(text)` -/// reports the steps. Resolves to {name, version, title, entry, files}; rejects without changing the -/// installed version when anything fails or `signal` is aborted. -export async function install(spec, {progress = () => {}, ...options} = {}) { - const {name, version: requested} = parseSpec(spec); - const {bridge, fetchImpl, signal, base} = await settings(options); - const packumentLocation = packumentUrl(base, name); - const manifest = resolveManifest(await fetchJson(packumentLocation, fetchImpl, signal), name, requested); - const {version} = manifest; - progress(`Downloading ${name}@${version}…`); - const {integrity, files} = await download(manifest, packumentLocation, fetchImpl, signal); - const {entry, title} = toolOf(files, name, version); - if (!files.has(entry)) - throw new Error(`The entry page ${entry} of ${name} is not in the package`); - - progress(`Installing ${files.size} files…`); - await pkgFunction(bridge, "begin")(name, version); - await upload(files, {bridge, name, version, signal}); - signal?.throwIfAborted(); - await pkgFunction(bridge, "commit")(name, version, integrity, entry, title); - return {name, version, title, entry, files: files.size}; -} - -/// The installed tools, from the pages of webfront.pkg.list(): {name, version, url, title} objects. -export async function installed(bridge = globalThis.webFront) { - const list = pkgFunction(bridge, "list"); - const tools = []; - for (;;) { - const lines = (await list(tools.length)).split("\n").filter((line) => line !== ""); - if (lines.length === 0) - return tools; - for (const line of lines) { - const [name, version, url, title] = line.split("\t"); - tools.push({name, version, url, title}); - } - } -} - -/// Opens the entry page of an installed tool in a new tab or window, and resolves to its URL. -export async function open(name, bridge = globalThis.webFront) { - const tool = (await installed(bridge)).find((candidate) => candidate.name === name); - if (!tool) - throw new Error(`${name} is not installed`); - return {...tool, opened: globalThis.open(tool.url, "_blank") !== null}; -} - -function requireOne(args) { - if (args.length !== 1) - throw new Error("Wrong number of arguments. Type 'wf help'."); - return args[0]; -} - -function formatFound(found) { - if (found.length === 0) - return "No tool found."; - const width = Math.max(...found.map(({name, version}) => name.length + version.length + 1)); - return found.map(({name, version, description}) => `${name}@${version}`.padEnd(width + 2) + description).join("\n"); -} - -// The wf subcommands running in the browser; 'wf list', 'wf remove' and 'wf help' run in C++. -const subcommands = { - search: async (args, {bridge, signal}) => formatFound(await search(args.join(" "), {bridge, signal})), - install: async (args, {bridge, signal, write}) => { - const tool = await install(requireOne(args), {bridge, signal, progress: (step) => write(step + "\n")}); - return `Installed ${tool.name}@${tool.version}: ${tool.title}. Type 'wf open ${tool.name}'.`; - }, - open: async (args, {bridge}) => { - const tool = await open(requireOne(args), bridge); - return tool.opened ? `Opened ${tool.title}: ${tool.url}` : `The browser blocked the new window. Open ${tool.url}`; - }, -}; - -async function wf([command, ...args], context) { - return Object.hasOwn(subcommands, command) ? subcommands[command](args, context) : undefined; -} - -/// Terminal browser commands (see Terminal::extension). -export const commands = {wf}; diff --git a/js/developer/environment/archive.mjs b/js/developer/environment/archive.mjs index ee35d189..75580d32 100644 --- a/js/developer/environment/archive.mjs +++ b/js/developer/environment/archive.mjs @@ -1,5 +1,5 @@ // Reading an npm package archive: its files and the checks on its package.json. -import {gunzip, readTar} from '../components/tools/wf.mjs'; +import {gunzip, readTar} from './tarball.mjs'; import {safePackagePath} from './paths.mjs'; const text = new TextDecoder(); diff --git a/js/developer/environment/bootstrap.mjs b/js/developer/environment/bootstrap.mjs index 94c9fc08..d27284db 100644 --- a/js/developer/environment/bootstrap.mjs +++ b/js/developer/environment/bootstrap.mjs @@ -1,4 +1,4 @@ -import {gunzip, readTar, verifyIntegrity} from '../components/tools/wf.mjs'; +import {gunzip, readTar, verifyIntegrity} from './tarball.mjs'; import {readProject, publish, responseBytes} from './io.mjs'; import {isUnsafe} from './paths.mjs'; diff --git a/js/developer/environment/bundles.json b/js/developer/environment/bundles.json index 98f859a8..fbc29bef 100644 --- a/js/developer/environment/bundles.json +++ b/js/developer/environment/bundles.json @@ -1,7 +1,7 @@ { "js/developer/environment/manifest.mjs": "b534d152e6fb008b23d4cad00d8d72913091a9acd12603356995cbd8ed08f76c", "js/developer/environment/project.mjs": "280cced29e41bc48d5d9d69934186ababfdbbc9dc32ed9517e17af4f19d3bd73", - "js/developer/environment/installer.mjs": "f3e919535847c93f62498ee0ad3fec49ff5f7531fb657feaca80e2ccb6da1c0c", + "js/developer/environment/installer.mjs": "d4e67a246fc907d6123ff9602f09c6c263c7942d86890d4f408cbed3cc63b717", "js/developer/environment/restore.mjs": "cdd22eebd55d68bd705685cd5ee3059e228a35053eaad116ab99c4c05b908098", "js/developer/environment/cache.mjs": "6fd0e3b760dfc1070a28e2e2eb3c86621c970c775045e7a9ae665da4f6845922", "js/developer/environment/scripts.mjs": "83ae28e822db986d9b3ae547f005f1a7c94868c36f232d68ddeb6126fb0a5021", @@ -11,20 +11,23 @@ "js/developer/environment/typecheck-snapshot.mjs": "2b68ae117cb39a3f67e3fe2c0b88c479ed0aed31f793c95725488b0af7d97d54", "js/developer/environment/typecheck-worker.mjs": "7c072f7ce902ba8d6ee59015be93c3a5c358d95a5153758309ea825bd39a903e", "js/developer/environment/packages-entry.mjs": "e0b4acd4330b8b51eb0e695384c8df2b103a4be4f598ac83277838022f747e30", - "js/developer/environment/bootstrap.mjs": "534af4b3d07891338c3390e1d5e06c2fb6dd8df11ca6547735565b17f1b9cd70", + "js/developer/environment/bootstrap.mjs": "b46c9d66ea7083f17fc9b29a8cd9c350966e2420b39fd44b910e8fdd274854df", "js/developer/environment/bootstrap-entry.mjs": "ff8084f23f5acc721f97eb1ed0a454e7bfee1894de17d54f0100fa11f7ef8b77", - "js/developer/environment/packages.mjs": "faed29500a34c6ce24756d07bd4b47b9168ccec4bd49d12f00096a869637d74d", - "js/developer/environment/starter.mjs": "048cf2af36b407bc075323f78a1195b4be91ad7da51f6ce941d9fb230f314ff9", + "js/developer/environment/packages.mjs": "6636219f3fef20ea1d274dc9298d8af451ef257b86fe6c1ed0de9a7c797b11d8", + "js/developer/environment/starter.mjs": "f38e290e03aebe146623c2ca9b590d645fb91a51acdf7a98101bb00b5b88096c", "js/developer/environment/paths.mjs": "3b6114df78eb193161c5c84499dda084cb7ff91c56a4496371c30295d00880e3", - "js/developer/environment/runtime.mjs": "37e236b86100f382bb0cf96598573b6d1a22c021b909760ec8ecdc27e6aaa940", + "js/developer/environment/runtime.mjs": "6325ee38cafa803b72932b4b2f2263014cbffae47d2191848940145f85e17d08", + "js/developer/environment/terminal.mjs": "7ffcf7ac6ef63c35cdf5ef70284b384525b13ba18422af069289e53b6c4f6be1", + "js/developer/environment/tarball.mjs": "1c1e1aea067910e1fec74e85b4bf9fbefed9b38187a04d8d2764f0b9a96fca39", + "js/developer/environment/commands.mjs": "8de20c01f02f33c0566f204fcf1ee2382a23344d2103581fe2914469ec570531", "js/developer/environment/compiler.mjs": "cc6fbe8cabbd94750045cebfdf942234247519099a192ef9cdda6ccbdbfbb6a4", "js/developer/environment/bundler.mjs": "c2f55056a4702d57207203a29226f98a95a31ae615596bf21338b7dfabe83ed9", "js/developer/environment/entry.mjs": "b2b942443e3c74ae2c008392ba244d9b7e91db70ba1b4ebbe1357c455ebf51bb", "js/developer/environment/conditions.mjs": "7f0ecba239480831e38985ccffd4c82309949924f4eb9d938e4ad1b09f5f36ed", "js/developer/environment/io.mjs": "21af39f07c7eb863908c1df768e3c31de1c6eb8ff757c2a287c4a47c76855db6", "js/developer/environment/recipe.mjs": "5e7b80cb9090dce63fafafbb852879fce9f6ed2399ac364bbe5af1cf6f4c1758", - "js/developer/environment/registry.mjs": "717b928b47d1eb8d1635cbfda60473f4a8e0918c1345d5364b6b7d2ffe199195", - "js/developer/environment/archive.mjs": "1fb8b9c3c27219858597801104639bba1104c7a7d33973609cd556b5e5f81d2d", + "js/developer/environment/registry.mjs": "42baa605f0335622470aaf4b945c5e38486d56a0ac0ef6442e5348f160aa3f88", + "js/developer/environment/archive.mjs": "5a5b135dc935c3916fc0e8ccfc0e92485e0c6e201cbceab160de68fe89cb6bba", "js/developer/environment/lock.mjs": "d69a3a877b92da52b21dcc78877345015ac31b7dec1c484ee1ff1f97f154d51f", "js/developer/environment/pins.mjs": "df07f6f01edaf86a1052d0e76f6c6745cb6e7a3309bbd256ac720ee8adc85297", "js/developer/environment/peers.mjs": "e1d999892138682fc0134ef1f4d4b19b9a9ad8d7fb16e37fc9c6c684bd853896", @@ -34,13 +37,12 @@ "js/developer/tools/starters/pi/style.css": "360e2c7ae6d3699b00e18cbf67efbae7a8d8863d88926b31139e102cf38e5abd", "examples/life/ui/main.tsx": "ed11a82aad1639eb6997af8b0fca4d5c5ed4c36422c22a74ac49ae73078d0a91", "examples/life/ui/style.css": "9bb55eb0f0a3287e5b7dc78af9d69608b87ff42c4d9c8a653bc83a52fe293c44", - "js/developer/components/tools/wf.mjs": "2a8b463b2da223deb8d54d9fdd6037fdd079afeb24e39337693df03cdbcbd0ec", "js/developer/tools/distribution.json": "12b40657d1bc34c4093cd5f793d772bf3fa6fd8615ab7b766ad1756092438f83", - "js/developer/tools/build.mjs": "24325d88355574ff498426c9260420ed02adf6cf1c5cfa5f98e066c048739e51", + "js/developer/tools/build.mjs": "1516d8f0be60c0dc3d6f3ae66a92558699d62b4d15714325580eb2c0d35dac7f", "js/developer/tools/site.mjs": "1827d3fd7e1e470336aab25ea8686c912c2b674a10f7be496f2f0077fbc45292", "js/developer/tools/archive.mjs": "bfe9feeb5e4d4e1b7c44c4dec4dcbeab4ae59c2bf16a1d2b32cd6910a2b84e7b", "js/developer/vendor/package-lock.json": "f6aefe8b4cb0b15f866f41eae425f6654d2c6c2d96438fd0da878c5651585616", - "js/core/bootstrap/bootstrap.bundle.mjs": "792fe7cf564bd12ac47fef419d8c71e2070925764a17706552e7d3f5d6ba2181", - "js/developer/environment/packages.bundle.mjs": "47fae31846bad6569a4f83e5fb765a8b2c01b265eb830c3c302d97d4a2d2ba68", + "js/core/bootstrap/bootstrap.bundle.mjs": "1069b307799ed2b0de53914748521731bc9796414a416d56340bbda983ef2443", + "js/developer/environment/packages.bundle.mjs": "7c5b721c9252e81a4228bbef0441576fdb77af983e40675dbeab5976da582529", "include/webfront/system/DeveloperReleaseData.hpp": "c97a8c3b21df3306c179f7b46d945159b5854f9d2810f135a4ab224c768c75d7" } diff --git a/js/developer/environment/commands.mjs b/js/developer/environment/commands.mjs new file mode 100644 index 00000000..7e0c618e --- /dev/null +++ b/js/developer/environment/commands.mjs @@ -0,0 +1,80 @@ +// The application's C++ commands (webfront::Commands): discovered through the bridge and run in this browser's session. +// Their output streams in through fire-and-forget calls; Ctrl+C cancels them in C++ without waiting for them to end. + +/** Names the terminal itself handles; webfront::commands::reservedNames refuses them to C++ commands. */ +export const reservedNames = ['wf', 'clear', 'exit', 'help', 'history']; + +const running = new Map(); // command number -> {write, exit} +let lastId = 0; + +// The browser functions that C++ calls with the output and the exit of a command. A command this page no longer +// waits for (interrupted, or of an earlier page) is ignored. +function installReceivers() { + const namespace = globalThis.webfront ??= {}; + namespace.commands ??= { + output: (id, text) => running.get(id)?.write(text), + exit: (id, code, error) => running.get(id)?.exit(code, error), + }; +} + +/** The application's commands, as a Map from name to help text; empty for an application without webfront::Commands. */ +export async function discoverCommands(bridge) { + installReceivers(); + let listed; + try { listed = JSON.parse(await bridge.cppFunction('webfront.commands.list')()); } + catch (error) { + if (/C\+\+ function 'webfront\.commands\.list' was not found/.test(error?.message)) return new Map(); + throw error; + } + return new Map(listed.map(({name, help}) => [name, help])); +} + +const failure = (message, exitCode) => Object.assign(new Error(message), {exitCode}); + +/** + * Runs a C++ command and resolves once it returns. It rejects with the command's exception (exit code 1), with its + * non-zero exit code, or at once with exit code 130 when `signal` aborts: the command is then asked to stop, and its + * late output and exit are ignored. It also rejects when the bridge's connection closes, since its exit can no longer + * arrive (C++ stops the commands of a disconnected browser). `write` receives the output as it comes, with "\n" line + * endings. + */ +export function runCommand(bridge, name, args, {signal, write = () => {}} = {}) { + installReceivers(); + lastId = lastId % 0xffffffff + 1; + const id = lastId; + // The bridge's WebSocket: its close event is the only notice of a disconnection once the start is acknowledged. + const socket = bridge.socket; + return new Promise((resolve, reject) => { + const finish = () => { + running.delete(id); + signal?.removeEventListener('abort', interrupt); + socket?.removeEventListener?.('close', disconnected); + }; + const interrupt = () => { + finish(); + bridge.cppFunction('webfront.commands.cancel')(id).catch(() => {}); + reject(failure('Interrupted', 130)); + }; + const disconnected = () => { + finish(); + reject(failure('The connection to the application closed', 1)); + }; + if (signal?.aborted) return reject(failure('Interrupted', 130)); + running.set(id, {write, exit: (code, error) => { + finish(); + if (code === 0) resolve(''); + else reject(failure(error || `Command ${name} exited with code ${code}`, code)); + }}); + signal?.addEventListener('abort', interrupt, {once: true}); + socket?.addEventListener?.('close', disconnected, {once: true}); + const failed = error => { + if (!running.has(id)) return; + finish(); + reject(error); + }; + // The start is sent now, before any cancel that Ctrl+C sends; a bridge that throws instead of rejecting must + // not leave the command registered. + try { bridge.cppFunction('webfront.commands.start')(id, name, JSON.stringify(args)).catch(failed); } + catch (error) { failed(error); } + }); +} diff --git a/js/developer/environment/installer.mjs b/js/developer/environment/installer.mjs index 242858bc..75e71865 100644 --- a/js/developer/environment/installer.mjs +++ b/js/developer/environment/installer.mjs @@ -1,7 +1,7 @@ // wf init and wf install: the manifest states the intent, the lock the exact resolution; both are published together. import semver from 'semver'; import {resolvePackages, downloadPackage} from './packages.mjs'; -import {parseSpec} from '../components/tools/wf.mjs'; +import {parseSpec} from './tarball.mjs'; import {publish} from './io.mjs'; import {manifestPath, newManifest, manifestName, serializeManifest, validateManifest, dependenciesDigest} from './manifest.mjs'; import {loadProject, publishTogether, lockPath, noManifest, desynchronized, textBytes} from './project.mjs'; diff --git a/js/developer/environment/packages.bundle.mjs b/js/developer/environment/packages.bundle.mjs index 26cae5fd..e9a80e18 100644 --- a/js/developer/environment/packages.bundle.mjs +++ b/js/developer/environment/packages.bundle.mjs @@ -1,16 +1,16 @@ -var Gn=Object.create;var mt=Object.defineProperty;var Mn=Object.getOwnPropertyDescriptor;var Wn=Object.getOwnPropertyNames;var _n=Object.getPrototypeOf,Bn=Object.prototype.hasOwnProperty;var w=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}};var Xn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Wn(t))!Bn.call(e,s)&&s!==r&&mt(e,s,{get:()=>t[s],enumerable:!(n=Mn(t,s))||n.enumerable});return e};var F=(e,t,r)=>(r=e!=null?Gn(_n(e)):{},Xn(t||!e||!e.__esModule?mt(r,"default",{value:e,enumerable:!0}):r,e));var B=w((Ec,xt)=>{"use strict";var Kn="2.0.0",Qn=Number.MAX_SAFE_INTEGER||9007199254740991,es=16,ts=250,rs=["major","premajor","minor","preminor","patch","prepatch","prerelease"];xt.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:es,MAX_SAFE_BUILD_LENGTH:ts,MAX_SAFE_INTEGER:Qn,RELEASE_TYPES:rs,SEMVER_SPEC_VERSION:Kn,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var X=w((gc,Rt)=>{"use strict";var ns=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};Rt.exports=ns});var z=w((j,bt)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:Ae,MAX_SAFE_BUILD_LENGTH:ss,MAX_LENGTH:os}=B(),is=X();j=bt.exports={};var as=j.re=[],cs=j.safeRe=[],p=j.src=[],ls=j.safeSrc=[],h=j.t={},us=0,je="[a-zA-Z0-9-]",fs=[["\\s",1],["\\d",os],[je,ss]],ps=e=>{for(let[t,r]of fs)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},E=(e,t,r)=>{let n=ps(t),s=us++;is(e,s,t),h[e]=s,p[s]=t,ls[s]=n,as[s]=new RegExp(t,r?"g":void 0),cs[s]=new RegExp(n,r?"g":void 0)};E("NUMERICIDENTIFIER","0|[1-9]\\d*");E("NUMERICIDENTIFIERLOOSE","\\d+");E("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${je}*`);E("MAINVERSION",`(${p[h.NUMERICIDENTIFIER]})\\.(${p[h.NUMERICIDENTIFIER]})\\.(${p[h.NUMERICIDENTIFIER]})`);E("MAINVERSIONLOOSE",`(${p[h.NUMERICIDENTIFIERLOOSE]})\\.(${p[h.NUMERICIDENTIFIERLOOSE]})\\.(${p[h.NUMERICIDENTIFIERLOOSE]})`);E("PRERELEASEIDENTIFIER",`(?:${p[h.NONNUMERICIDENTIFIER]}|${p[h.NUMERICIDENTIFIER]})`);E("PRERELEASEIDENTIFIERLOOSE",`(?:${p[h.NONNUMERICIDENTIFIER]}|${p[h.NUMERICIDENTIFIERLOOSE]})`);E("PRERELEASE",`(?:-(${p[h.PRERELEASEIDENTIFIER]}(?:\\.${p[h.PRERELEASEIDENTIFIER]})*))`);E("PRERELEASELOOSE",`(?:-?(${p[h.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${p[h.PRERELEASEIDENTIFIERLOOSE]})*))`);E("BUILDIDENTIFIER",`${je}+`);E("BUILD",`(?:\\+(${p[h.BUILDIDENTIFIER]}(?:\\.${p[h.BUILDIDENTIFIER]})*))`);E("FULLPLAIN",`v?${p[h.MAINVERSION]}${p[h.PRERELEASE]}?${p[h.BUILD]}?`);E("FULL",`^${p[h.FULLPLAIN]}$`);E("LOOSEPLAIN",`[v=\\s]*${p[h.MAINVERSIONLOOSE]}${p[h.PRERELEASELOOSE]}?${p[h.BUILD]}?`);E("LOOSE",`^${p[h.LOOSEPLAIN]}$`);E("GTLT","((?:<|>)?=?)");E("XRANGEIDENTIFIERLOOSE",`${p[h.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);E("XRANGEIDENTIFIER",`${p[h.NUMERICIDENTIFIER]}|x|X|\\*`);E("XRANGEPLAIN",`[v=\\s]*(${p[h.XRANGEIDENTIFIER]})(?:\\.(${p[h.XRANGEIDENTIFIER]})(?:\\.(${p[h.XRANGEIDENTIFIER]})(?:${p[h.PRERELEASE]})?${p[h.BUILD]}?)?)?`);E("XRANGEPLAINLOOSE",`[v=\\s]*(${p[h.XRANGEIDENTIFIERLOOSE]})(?:\\.(${p[h.XRANGEIDENTIFIERLOOSE]})(?:\\.(${p[h.XRANGEIDENTIFIERLOOSE]})(?:${p[h.PRERELEASELOOSE]})?${p[h.BUILD]}?)?)?`);E("XRANGE",`^${p[h.GTLT]}\\s*${p[h.XRANGEPLAIN]}$`);E("XRANGELOOSE",`^${p[h.GTLT]}\\s*${p[h.XRANGEPLAINLOOSE]}$`);E("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Ae}})(?:\\.(\\d{1,${Ae}}))?(?:\\.(\\d{1,${Ae}}))?`);E("COERCE",`${p[h.COERCEPLAIN]}(?:$|[^\\d])`);E("COERCEFULL",p[h.COERCEPLAIN]+`(?:${p[h.PRERELEASE]})?(?:${p[h.BUILD]})?(?:$|[^\\d])`);E("COERCERTL",p[h.COERCE],!0);E("COERCERTLFULL",p[h.COERCEFULL],!0);E("LONETILDE","(?:~>?)");E("TILDETRIM",`(\\s*)${p[h.LONETILDE]}\\s+`,!0);j.tildeTrimReplace="$1~";E("TILDE",`^${p[h.LONETILDE]}${p[h.XRANGEPLAIN]}$`);E("TILDELOOSE",`^${p[h.LONETILDE]}${p[h.XRANGEPLAINLOOSE]}$`);E("LONECARET","(?:\\^)");E("CARETTRIM",`(\\s*)${p[h.LONECARET]}\\s+`,!0);j.caretTrimReplace="$1^";E("CARET",`^${p[h.LONECARET]}${p[h.XRANGEPLAIN]}$`);E("CARETLOOSE",`^${p[h.LONECARET]}${p[h.XRANGEPLAINLOOSE]}$`);E("COMPARATORLOOSE",`^${p[h.GTLT]}\\s*(${p[h.LOOSEPLAIN]})$|^$`);E("COMPARATOR",`^${p[h.GTLT]}\\s*(${p[h.FULLPLAIN]})$|^$`);E("COMPARATORTRIM",`(\\s*)${p[h.GTLT]}\\s*(${p[h.LOOSEPLAIN]}|${p[h.XRANGEPLAIN]})`,!0);j.comparatorTrimReplace="$1$2$3";E("HYPHENRANGE",`^\\s*(${p[h.XRANGEPLAIN]})\\s+-\\s+(${p[h.XRANGEPLAIN]})\\s*$`);E("HYPHENRANGELOOSE",`^\\s*(${p[h.XRANGEPLAINLOOSE]})\\s+-\\s+(${p[h.XRANGEPLAINLOOSE]})\\s*$`);E("STAR","(<|>)?=?\\s*\\*");E("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");E("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var ae=w(($c,Ot)=>{"use strict";var hs=Object.freeze({loose:!0}),ds=Object.freeze({}),ms=e=>e?typeof e!="object"?hs:e:ds;Ot.exports=ms});var Pe=w((yc,kt)=>{"use strict";var vt=/^[0-9]+$/,It=(e,t)=>{if(typeof e=="number"&&typeof t=="number")return e===t?0:eIt(t,e);kt.exports={compareIdentifiers:It,rcompareIdentifiers:ws}});var b=w((xc,Nt)=>{"use strict";var ce=X(),{MAX_LENGTH:St,MAX_SAFE_INTEGER:le}=B(),{safeRe:ue,t:fe}=z(),Es=ae(),{compareIdentifiers:qe}=Pe(),Ce=class e{constructor(t,r){if(r=Es(r),t instanceof e){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>St)throw new TypeError(`version is longer than ${St} characters`);ce("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=t.trim().match(r.loose?ue[fe.LOOSE]:ue[fe.FULL]);if(!n)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>le||this.major<0)throw new TypeError("Invalid major version");if(this.minor>le||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>le||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(s=>{if(/^[0-9]+$/.test(s)){let o=+s;if(o>=0&&ot.major?1:this.minort.minor?1:this.patcht.patch?1:0}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],s=t.prerelease[r];if(ce("prerelease compare",r,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return qe(n,s)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let n=this.build[r],s=t.build[r];if(ce("build compare",r,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return qe(n,s)}while(++r)}inc(t,r,n){if(t.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let s=`-${r}`.match(this.options.loose?ue[fe.PRERELEASELOOSE]:ue[fe.PRERELEASE]);if(!s||s[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let s=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[s];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(s)}}if(r){let o=[r,s];n===!1&&(o=[r]),qe(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=o):this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};Nt.exports=Ce});var q=w((Rc,Tt)=>{"use strict";var Lt=b(),gs=(e,t,r=!1)=>{if(e instanceof Lt)return e;try{return new Lt(e,t)}catch(n){if(!r)return null;throw n}};Tt.exports=gs});var jt=w((bc,At)=>{"use strict";var $s=q(),ys=(e,t)=>{let r=$s(e,t);return r?r.version:null};At.exports=ys});var qt=w((Oc,Pt)=>{"use strict";var xs=q(),Rs=(e,t)=>{let r=xs(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};Pt.exports=Rs});var Ut=w((vc,Dt)=>{"use strict";var Ct=b(),bs=(e,t,r,n,s)=>{typeof r=="string"&&(s=n,n=r,r=void 0);try{return new Ct(e instanceof Ct?e.version:e,r).inc(t,n,s).version}catch{return null}};Dt.exports=bs});var Gt=w((Ic,zt)=>{"use strict";var Ft=q(),Os=(e,t)=>{let r=Ft(e,null,!0),n=Ft(t,null,!0),s=r.compare(n);if(s===0)return null;let o=s>0,i=o?r:n,c=o?n:r,a=!!i.prerelease.length;if(!!c.prerelease.length&&!a){if(!c.patch&&!c.minor)return"major";if(c.compareMain(i)===0)return c.minor&&!c.patch?"minor":"patch"}let u=a?"pre":"";return r.major!==n.major?u+"major":r.minor!==n.minor?u+"minor":r.patch!==n.patch?u+"patch":"prerelease"};zt.exports=Os});var Wt=w((kc,Mt)=>{"use strict";var vs=b(),Is=(e,t)=>new vs(e,t).major;Mt.exports=Is});var Bt=w((Sc,_t)=>{"use strict";var ks=b(),Ss=(e,t)=>new ks(e,t).minor;_t.exports=Ss});var Vt=w((Nc,Xt)=>{"use strict";var Ns=b(),Ls=(e,t)=>new Ns(e,t).patch;Xt.exports=Ls});var Jt=w((Lc,Ht)=>{"use strict";var Ts=q(),As=(e,t)=>{let r=Ts(e,t);return r&&r.prerelease.length?r.prerelease:null};Ht.exports=As});var N=w((Tc,Zt)=>{"use strict";var Yt=b(),js=(e,t,r)=>new Yt(e,r).compare(new Yt(t,r));Zt.exports=js});var Qt=w((Ac,Kt)=>{"use strict";var Ps=N(),qs=(e,t,r)=>Ps(t,e,r);Kt.exports=qs});var tr=w((jc,er)=>{"use strict";var Cs=N(),Ds=(e,t)=>Cs(e,t,!0);er.exports=Ds});var pe=w((Pc,nr)=>{"use strict";var rr=b(),Us=(e,t,r)=>{let n=new rr(e,r),s=new rr(t,r);return n.compare(s)||n.compareBuild(s)};nr.exports=Us});var or=w((qc,sr)=>{"use strict";var Fs=pe(),zs=(e,t)=>e.sort((r,n)=>Fs(r,n,t));sr.exports=zs});var ar=w((Cc,ir)=>{"use strict";var Gs=pe(),Ms=(e,t)=>e.sort((r,n)=>Gs(n,r,t));ir.exports=Ms});var V=w((Dc,cr)=>{"use strict";var Ws=N(),_s=(e,t,r)=>Ws(e,t,r)>0;cr.exports=_s});var he=w((Uc,lr)=>{"use strict";var Bs=N(),Xs=(e,t,r)=>Bs(e,t,r)<0;lr.exports=Xs});var De=w((Fc,ur)=>{"use strict";var Vs=N(),Hs=(e,t,r)=>Vs(e,t,r)===0;ur.exports=Hs});var Ue=w((zc,fr)=>{"use strict";var Js=N(),Ys=(e,t,r)=>Js(e,t,r)!==0;fr.exports=Ys});var de=w((Gc,pr)=>{"use strict";var Zs=N(),Ks=(e,t,r)=>Zs(e,t,r)>=0;pr.exports=Ks});var me=w((Mc,hr)=>{"use strict";var Qs=N(),eo=(e,t,r)=>Qs(e,t,r)<=0;hr.exports=eo});var Fe=w((Wc,dr)=>{"use strict";var to=De(),ro=Ue(),no=V(),so=de(),oo=he(),io=me(),ao=(e,t,r,n)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return to(e,r,n);case"!=":return ro(e,r,n);case">":return no(e,r,n);case">=":return so(e,r,n);case"<":return oo(e,r,n);case"<=":return io(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};dr.exports=ao});var wr=w((_c,mr)=>{"use strict";var co=b(),lo=q(),{safeRe:we,t:Ee}=z(),uo=(e,t)=>{if(e instanceof co)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?we[Ee.COERCEFULL]:we[Ee.COERCE]);else{let a=t.includePrerelease?we[Ee.COERCERTLFULL]:we[Ee.COERCERTL],l;for(;(l=a.exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||l.index+l[0].length!==r.index+r[0].length)&&(r=l),a.lastIndex=l.index+l[1].length+l[2].length;a.lastIndex=-1}if(r===null)return null;let n=r[2],s=r[3]||"0",o=r[4]||"0",i=t.includePrerelease&&r[5]?`-${r[5]}`:"",c=t.includePrerelease&&r[6]?`+${r[6]}`:"";return lo(`${n}.${s}.${o}${i}${c}`,t)};mr.exports=uo});var gr=w((Bc,Er)=>{"use strict";var ze=class{constructor(){this.max=1e3,this.map=new Map}get(t){let r=this.map.get(t);if(r!==void 0)return this.map.delete(t),this.map.set(t,r),r}delete(t){return this.map.delete(t)}set(t,r){if(!this.delete(t)&&r!==void 0){if(this.map.size>=this.max){let s=this.map.keys().next().value;this.delete(s)}this.map.set(t,r)}return this}};Er.exports=ze});var L=w((Xc,Rr)=>{"use strict";var fo=/\s+/g,Ge=class e{constructor(t,r){if(r=ho(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof Me)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().replace(fo," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(s=>!yr(s[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let s of this.set)if(s.length===1&&xo(s[0])){this.set=[s];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let t=0;t0&&(this.formatted+="||");let r=this.set[t];for(let n=0;n0&&(this.formatted+=" "),this.formatted+=r[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(t){let n=((this.options.includePrerelease&&$o)|(this.options.loose&&yo))+":"+t,s=$r.get(n);if(s)return s;let o=this.options.loose,i=o?v[O.HYPHENRANGELOOSE]:v[O.HYPHENRANGE];t=t.replace(i,To(this.options.includePrerelease)),g("hyphen replace",t),t=t.replace(v[O.COMPARATORTRIM],wo),g("comparator trim",t),t=t.replace(v[O.TILDETRIM],Eo),g("tilde trim",t),t=t.replace(v[O.CARETTRIM],go),g("caret trim",t);let c=t.split(" ").map(f=>Ro(f,this.options)).join(" ").split(/\s+/).map(f=>Lo(f,this.options));o&&(c=c.filter(f=>(g("loose invalid filter",f,this.options),!!f.match(v[O.COMPARATORLOOSE])))),g("range list",c);let a=new Map,l=c.map(f=>new Me(f,this.options));for(let f of l){if(yr(f))return[f];a.set(f.value,f)}a.size>1&&a.has("")&&a.delete("");let u=[...a.values()];return $r.set(n,u),u}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some(n=>xr(n,r)&&t.set.some(s=>xr(s,r)&&n.every(o=>s.every(i=>o.intersects(i,r)))))}test(t){if(!t)return!1;if(typeof t=="string")try{t=new mo(t,this.options)}catch{return!1}for(let r=0;re.value==="<0.0.0-0",xo=e=>e.value==="",xr=(e,t)=>{let r=!0,n=e.slice(),s=n.pop();for(;r&&n.length;)r=n.every(o=>s.intersects(o,t)),s=n.pop();return r},Ro=(e,t)=>(e=e.replace(v[O.BUILD],""),g("comp",e,t),e=vo(e,t),g("caret",e),e=bo(e,t),g("tildes",e),e=ko(e,t),g("xrange",e),e=No(e,t),g("stars",e),e),I=e=>!e||e.toLowerCase()==="x"||e==="*",bo=(e,t)=>e.trim().split(/\s+/).map(r=>Oo(r,t)).join(" "),Oo=(e,t)=>{let r=t.loose?v[O.TILDELOOSE]:v[O.TILDE];return e.replace(r,(n,s,o,i,c)=>{g("tilde",e,n,s,o,i,c);let a;return I(s)?a="":I(o)?a=`>=${s}.0.0 <${+s+1}.0.0-0`:I(i)?a=`>=${s}.${o}.0 <${s}.${+o+1}.0-0`:c?(g("replaceTilde pr",c),a=`>=${s}.${o}.${i}-${c} <${s}.${+o+1}.0-0`):a=`>=${s}.${o}.${i} <${s}.${+o+1}.0-0`,g("tilde return",a),a})},vo=(e,t)=>e.trim().split(/\s+/).map(r=>Io(r,t)).join(" "),Io=(e,t)=>{g("caret",e,t);let r=t.loose?v[O.CARETLOOSE]:v[O.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(s,o,i,c,a)=>{g("caret",e,s,o,i,c,a);let l;return I(o)?l="":I(i)?l=`>=${o}.0.0${n} <${+o+1}.0.0-0`:I(c)?o==="0"?l=`>=${o}.${i}.0${n} <${o}.${+i+1}.0-0`:l=`>=${o}.${i}.0${n} <${+o+1}.0.0-0`:a?(g("replaceCaret pr",a),o==="0"?i==="0"?l=`>=${o}.${i}.${c}-${a} <${o}.${i}.${+c+1}-0`:l=`>=${o}.${i}.${c}-${a} <${o}.${+i+1}.0-0`:l=`>=${o}.${i}.${c}-${a} <${+o+1}.0.0-0`):(g("no pr"),o==="0"?i==="0"?l=`>=${o}.${i}.${c}${n} <${o}.${i}.${+c+1}-0`:l=`>=${o}.${i}.${c}${n} <${o}.${+i+1}.0-0`:l=`>=${o}.${i}.${c} <${+o+1}.0.0-0`),g("caret return",l),l})},ko=(e,t)=>(g("replaceXRanges",e,t),e.split(/\s+/).map(r=>So(r,t)).join(" ")),So=(e,t)=>{e=e.trim();let r=t.loose?v[O.XRANGELOOSE]:v[O.XRANGE];return e.replace(r,(n,s,o,i,c,a)=>{g("xRange",e,n,s,o,i,c,a);let l=I(o),u=l||I(i),f=u||I(c),m=f;return s==="="&&m&&(s=""),a=t.includePrerelease?"-0":"",l?s===">"||s==="<"?n="<0.0.0-0":n="*":s&&m?(u&&(i=0),c=0,s===">"?(s=">=",u?(o=+o+1,i=0,c=0):(i=+i+1,c=0)):s==="<="&&(s="<",u?o=+o+1:i=+i+1),s==="<"&&(a="-0"),n=`${s+o}.${i}.${c}${a}`):u?n=`>=${o}.0.0${a} <${+o+1}.0.0-0`:f&&(n=`>=${o}.${i}.0${a} <${o}.${+i+1}.0-0`),g("xRange return",n),n})},No=(e,t)=>(g("replaceStars",e,t),e.trim().replace(v[O.STAR],"")),Lo=(e,t)=>(g("replaceGTE0",e,t),e.trim().replace(v[t.includePrerelease?O.GTE0PRE:O.GTE0],"")),To=e=>(t,r,n,s,o,i,c,a,l,u,f,m)=>(I(n)?r="":I(s)?r=`>=${n}.0.0${e?"-0":""}`:I(o)?r=`>=${n}.${s}.0${e?"-0":""}`:i?r=`>=${r}`:r=`>=${r}${e?"-0":""}`,I(l)?a="":I(u)?a=`<${+l+1}.0.0-0`:I(f)?a=`<${l}.${+u+1}.0-0`:m?a=`<=${l}.${u}.${f}-${m}`:e?a=`<${l}.${u}.${+f+1}-0`:a=`<=${a}`,`${r} ${a}`.trim()),Ao=(e,t,r)=>{for(let n=0;n0){let s=e[n].semver;if(s.major===t.major&&s.minor===t.minor&&s.patch===t.patch)return!0}return!1}return!0}});var H=w((Vc,Sr)=>{"use strict";var J=Symbol("SemVer ANY"),Be=class e{static get ANY(){return J}constructor(t,r){if(r=br(r),t instanceof e){if(t.loose===!!r.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(" "),_e("comparator",t,r),this.options=r,this.loose=!!r.loose,this.parse(t),this.semver===J?this.value="":this.value=this.operator+this.semver.version,_e("comp",this)}parse(t){let r=this.options.loose?Or[vr.COMPARATORLOOSE]:Or[vr.COMPARATOR],n=t.match(r);if(!n)throw new TypeError(`Invalid comparator: ${t}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new Ir(n[2],this.options.loose):this.semver=J}toString(){return this.value}test(t){if(_e("Comparator.test",t,this.options.loose),this.semver===J||t===J)return!0;if(typeof t=="string")try{t=new Ir(t,this.options)}catch{return!1}return We(t,this.operator,this.semver,this.options)}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new kr(t.value,r).test(this.value):t.operator===""?t.value===""?!0:new kr(this.value,r).test(t.semver):(r=br(r),r.includePrerelease&&(this.value==="<0.0.0-0"||t.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&t.operator.startsWith(">")||this.operator.startsWith("<")&&t.operator.startsWith("<")||this.semver.version===t.semver.version&&this.operator.includes("=")&&t.operator.includes("=")||We(this.semver,"<",t.semver,r)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||We(this.semver,">",t.semver,r)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}};Sr.exports=Be;var br=ae(),{safeRe:Or,t:vr}=z(),We=Fe(),_e=X(),Ir=b(),kr=L()});var Y=w((Hc,Nr)=>{"use strict";var jo=L(),Po=(e,t,r)=>{try{t=new jo(t,r)}catch{return!1}return t.test(e)};Nr.exports=Po});var Tr=w((Jc,Lr)=>{"use strict";var qo=L(),Co=(e,t)=>new qo(e,t).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));Lr.exports=Co});var jr=w((Yc,Ar)=>{"use strict";var Do=b(),Uo=L(),Fo=(e,t,r)=>{let n=null,s=null,o=null;try{o=new Uo(t,r)}catch{return null}return e.forEach(i=>{o.test(i)&&(!n||s.compare(i)===-1)&&(n=i,s=new Do(n,r))}),n};Ar.exports=Fo});var qr=w((Zc,Pr)=>{"use strict";var zo=b(),Go=L(),Mo=(e,t,r)=>{let n=null,s=null,o=null;try{o=new Go(t,r)}catch{return null}return e.forEach(i=>{o.test(i)&&(!n||s.compare(i)===1)&&(n=i,s=new zo(n,r))}),n};Pr.exports=Mo});var Ur=w((Kc,Dr)=>{"use strict";var Xe=b(),Wo=L(),Cr=V(),_o=(e,t)=>{e=new Wo(e,t);let r=new Xe("0.0.0");if(e.test(r)||(r=new Xe("0.0.0-0"),e.test(r)))return r;r=null;for(let n=0;n{let c=new Xe(i.semver.version);switch(i.operator){case">":c.prerelease.length===0?c.patch++:c.prerelease.push(0),c.raw=c.format();case"":case">=":(!o||Cr(c,o))&&(o=c);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${i.operator}`)}}),o&&(!r||Cr(r,o))&&(r=o)}return r&&e.test(r)?r:null};Dr.exports=_o});var zr=w((Qc,Fr)=>{"use strict";var Bo=L(),Xo=(e,t)=>{try{return new Bo(e,t).range||"*"}catch{return null}};Fr.exports=Xo});var ge=w((el,_r)=>{"use strict";var Vo=b(),Wr=H(),{ANY:Ho}=Wr,Jo=L(),Yo=Y(),Gr=V(),Mr=he(),Zo=me(),Ko=de(),Qo=(e,t,r,n)=>{e=new Vo(e,n),t=new Jo(t,n);let s,o,i,c,a;switch(r){case">":s=Gr,o=Zo,i=Mr,c=">",a=">=";break;case"<":s=Mr,o=Ko,i=Gr,c="<",a="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Yo(e,t,n))return!1;for(let l=0;l{d.semver===Ho&&(d=new Wr(">=0.0.0")),f=f||d,m=m||d,s(d.semver,f.semver,n)?f=d:i(d.semver,m.semver,n)&&(m=d)}),f.operator===c||f.operator===a||(!m.operator||m.operator===c)&&o(e,m.semver))return!1;if(m.operator===a&&i(e,m.semver))return!1}return!0};_r.exports=Qo});var Xr=w((tl,Br)=>{"use strict";var ei=ge(),ti=(e,t,r)=>ei(e,t,">",r);Br.exports=ti});var Hr=w((rl,Vr)=>{"use strict";var ri=ge(),ni=(e,t,r)=>ri(e,t,"<",r);Vr.exports=ni});var Zr=w((nl,Yr)=>{"use strict";var Jr=L(),si=(e,t,r)=>(e=new Jr(e,r),t=new Jr(t,r),e.intersects(t,r));Yr.exports=si});var Qr=w((sl,Kr)=>{"use strict";var oi=Y(),ii=N();Kr.exports=(e,t,r)=>{let n=[],s=null,o=null,i=e.sort((u,f)=>ii(u,f,r));for(let u of i)oi(u,t,r)?(o=u,s||(s=u)):(o&&n.push([s,o]),o=null,s=null);s&&n.push([s,null]);let c=[];for(let[u,f]of n)u===f?c.push(u):!f&&u===i[0]?c.push("*"):f?u===i[0]?c.push(`<=${f}`):c.push(`${u} - ${f}`):c.push(`>=${u}`);let a=c.join(" || "),l=typeof t.raw=="string"?t.raw:String(t);return a.length{"use strict";var en=L(),He=H(),{ANY:Ve}=He,Z=Y(),Je=N(),ai=(e,t,r={})=>{if(e===t)return!0;e=new en(e,r),t=new en(t,r);let n=!1;e:for(let s of e.set){for(let o of t.set){let i=li(s,o,r);if(n=n||i!==null,i)continue e}if(n)return!1}return!0},ci=[new He(">=0.0.0-0")],tn=[new He(">=0.0.0")],li=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===Ve){if(t.length===1&&t[0].semver===Ve)return!0;r.includePrerelease?e=ci:e=tn}if(t.length===1&&t[0].semver===Ve){if(r.includePrerelease)return!0;t=tn}let n=new Set,s,o;for(let d of e)d.operator===">"||d.operator===">="?s=rn(s,d,r):d.operator==="<"||d.operator==="<="?o=nn(o,d,r):n.add(d.semver);if(n.size>1)return null;let i;if(s&&o){if(i=Je(s.semver,o.semver,r),i>0)return null;if(i===0&&(s.operator!==">="||o.operator!=="<="))return null}for(let d of n){if(s&&!Z(d,String(s),r)||o&&!Z(d,String(o),r))return null;for(let A of t)if(!Z(d,String(A),r))return!1;return!0}let c,a,l,u,f=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1,m=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1;f&&f.prerelease.length===1&&o.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(let d of t){if(u=u||d.operator===">"||d.operator===">=",l=l||d.operator==="<"||d.operator==="<=",s){if(m&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===m.major&&d.semver.minor===m.minor&&d.semver.patch===m.patch&&(m=!1),d.operator===">"||d.operator===">="){if(c=rn(s,d,r),c===d&&c!==s)return!1}else if(s.operator===">="&&!Z(s.semver,String(d),r))return!1}if(o){if(f&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===f.major&&d.semver.minor===f.minor&&d.semver.patch===f.patch&&(f=!1),d.operator==="<"||d.operator==="<="){if(a=nn(o,d,r),a===d&&a!==o)return!1}else if(o.operator==="<="&&!Z(o.semver,String(d),r))return!1}if(!d.operator&&(o||s)&&i!==0)return!1}return!(s&&l&&!o&&i!==0||o&&u&&!s&&i!==0||m||f)},rn=(e,t,r)=>{if(!e)return t;let n=Je(e.semver,t.semver,r);return n>0?e:n<0||t.operator===">"&&e.operator===">="?t:e},nn=(e,t,r)=>{if(!e)return t;let n=Je(e.semver,t.semver,r);return n<0?e:n>0||t.operator==="<"&&e.operator==="<="?t:e};sn.exports=ai});var C=w((il,ln)=>{"use strict";var Ye=z(),an=B(),ui=b(),cn=Pe(),fi=q(),pi=jt(),hi=qt(),di=Ut(),mi=Gt(),wi=Wt(),Ei=Bt(),gi=Vt(),$i=Jt(),yi=N(),xi=Qt(),Ri=tr(),bi=pe(),Oi=or(),vi=ar(),Ii=V(),ki=he(),Si=De(),Ni=Ue(),Li=de(),Ti=me(),Ai=Fe(),ji=wr(),Pi=H(),qi=L(),Ci=Y(),Di=Tr(),Ui=jr(),Fi=qr(),zi=Ur(),Gi=zr(),Mi=ge(),Wi=Xr(),_i=Hr(),Bi=Zr(),Xi=Qr(),Vi=on();ln.exports={parse:fi,valid:pi,clean:hi,inc:di,diff:mi,major:wi,minor:Ei,patch:gi,prerelease:$i,compare:yi,rcompare:xi,compareLoose:Ri,compareBuild:bi,sort:Oi,rsort:vi,gt:Ii,lt:ki,eq:Si,neq:Ni,gte:Li,lte:Ti,cmp:Ai,coerce:ji,Comparator:Pi,Range:qi,satisfies:Ci,toComparators:Di,maxSatisfying:Ui,minSatisfying:Fi,minVersion:zi,validRange:Gi,outside:Mi,gtr:Wi,ltr:_i,intersects:Bi,simplifyRange:Xi,subset:Vi,SemVer:ui,re:Ye.re,src:Ye.src,tokens:Ye.t,SEMVER_SPEC_VERSION:an.SEMVER_SPEC_VERSION,RELEASE_TYPES:an.RELEASE_TYPES,compareIdentifiers:cn.compareIdentifiers,rcompareIdentifiers:cn.rcompareIdentifiers}});var Te=new TextDecoder;function ie(e){let t=e.indexOf("@",e.startsWith("@")?1:0);return t<0?{name:e,version:""}:{name:e.slice(0,t),version:e.slice(t+1)}}async function Et(e,t){let r=String(t??"").split(/\s+/).filter(o=>o.startsWith("sha512-")).map(o=>o.split("?")[0]);if(r.length===0)throw new Error("The package has no SHA-512 integrity");if(!globalThis.crypto?.subtle)throw new Error("Integrity checks need a secure context (https or localhost)");let n=new Uint8Array(await crypto.subtle.digest("SHA-512",e)),s="sha512-"+btoa(Array.from(n,o=>String.fromCharCode(o)).join(""));if(!r.includes(s))throw new Error(`Integrity check failed: expected ${r[0]}, got ${s}`);return s}async function gt(e,t=268435456){let r=new Blob([e]).stream().pipeThrough(new DecompressionStream("gzip")).getReader(),n=[],s=0;for(let o=await r.read();!o.done;o=await r.read()){if(s+=o.value.length,s>t)throw await r.cancel(),new Error(`The tarball unpacks to more than ${t} bytes`);n.push(o.value)}return new Uint8Array(await new Blob(n).arrayBuffer())}function _(e,t,r){let n=e.subarray(t,t+r),s=n.indexOf(0);return Te.decode(s<0?n:n.subarray(0,s))}function $t(e,t,r){if(e[t]&128)return e.subarray(t+1,t+r).reduce((s,o)=>s*256+o,e[t]&127);let n=_(e,t,r).trim();if(!/^[0-7]*$/.test(n))throw new Error("Corrupt tar header");return n===""?0:parseInt(n,8)}function Vn(e){let t=0;for(let r=0;r<512;++r)t+=r>=148&&r<156?32:e[r];if($t(e,148,8)!==t)throw new Error("Corrupt tar header checksum")}function Hn(e){let t={},r=0;for(;r0)||r+s>e.length)throw new Error("Corrupt pax header");let o=Te.decode(e.subarray(n+1,r+s-1)),i=o.indexOf("=");t[o.slice(0,i)]=o.slice(i+1),r+=s}return t}function Jn(e,t){let r=e.subarray(t,t+512);Vn(r);let n=$t(r,124,12),s=t+512;if(s+n>e.length)throw new Error("Truncated tar archive");return{header:r,type:r[156]===0?"0":String.fromCharCode(r[156]),data:e.subarray(s,s+n),next:s+Math.ceil(n/512)*512}}function Yn(e,t){return t+512>e.length||e.subarray(t,t+512).every(r=>r===0)}function Zn(e){let t=_(e,0,100),r=_(e,257,5)==="ustar"?_(e,345,155):"";return r?`${r}/${t}`:t}var wt={x:(e,t)=>({...e,pax:Hn(t).path}),L:(e,t)=>({...e,long:_(t,0,t.length)}),g:e=>e};function yt(e){let t=[],r={};for(let n=0;!Yn(e,n);){let{header:s,type:o,data:i,next:c}=Jn(e,n);if(n=c,Object.hasOwn(wt,o)){r=wt[o](r,i);continue}(o==="0"||o==="7")&&t.push({path:r.pax??r.long??Zn(s),bytes:i}),r={}}return t}var xe=F(C(),1);var x=(e,t,...r)=>e.cppFunction(`webfront.developer.${t}`)(...r);async function G(e,t){let r=[],n=0;for(;;){let s=await x(e,"read",t,n);if(r.push(s),n+=s.length,s.length<262144)break;if(n>256*1024*1024)throw new Error("Project file is too large")}return new Uint8Array(await new Blob(r).arrayBuffer())}async function K(e,{id:t,path:r,bytes:n},s){for(let o=0;o{}),c}}async function Hi(e,t){let r=[],n=0;for(;;){let{done:s,value:o}=await e.read();if(s)return r;if(n+=o.length,n>t)throw new Error("Compressed download exceeds its byte limit");r.push(o)}}async function Ji(e,t){try{return await Hi(e,t)}catch(r){throw await e.cancel().catch(()=>{}),r}finally{e.releaseLock()}}async function un(e,t=64*1024*1024){if(!e.ok)throw new Error(`Download: HTTP ${e.status}`);if(Number(e.headers.get("content-length"))>t)throw new Error("Compressed download exceeds its byte limit");return new Uint8Array(await new Blob(await Ji(e.body.getReader(),t)).arrayBuffer())}var M=".webfront/developer/packages",Yi=/[\\\0:*?"<>|]/,Zi=e=>e.split("/").some(t=>!t||t==="."||t==="..");function Ki(e){return typeof e!="string"||!e||Yi.test(e)?!0:Zi(e)}function T(e){if(Ki(e))throw new Error(`Unsafe package path: ${e}`);return e}var Qi=new TextDecoder,ea=["preinstall","install","postinstall"];async function fn(e){let t=new Map;for(let r of yt(await gt(e))){if(!r.path.startsWith("package/"))throw new Error("Invalid npm tarball root");let n=T(r.path.slice(8));if(t.has(n))throw new Error(`Duplicate package path: ${n}`);t.set(n,r.bytes)}return t}var ta=e=>ea.some(t=>e.scripts?.[t]),ra=e=>e.has("binding.gyp")||[...e.keys()].some(t=>t.endsWith(".node"));function na(e,t){return ta(e)||e.gypfile?!0:ra(t)}function pn(e,t,r){let n=JSON.parse(Qi.decode(e.get("package.json")));if(n.name!==t||n.version!==r)throw new Error("npm archive identity mismatch");if(na(n,e))throw new Error(`${t} needs an unsupported install script or native module`);return n}function W(e){return!e||typeof e!="object"?!1:!Array.isArray(e)}var R="webfront.project.json",S="webfront-packages.lock.json",ee=1,Ze=/^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/,sa=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/,oa=/^[0-9A-Za-z.+\-^~<>=*| ]{1,128}$/,hn=/^[A-Za-z0-9][A-Za-z0-9:_.-]{0,63}$/,Ke=/^[A-Za-z_][A-Za-z0-9_]*$/,dn=["format","name","version","dependencies","registry","scripts","entries","providers","test","permissions"],ia=["files","publish","fetch"],$=e=>{throw new Error(`${R}: ${e}`)};function P(e,t){return W(e)||$(`${t} must be an object`),e}function Qe(e,t,r){for(let n of Object.keys(e))t.includes(n)||$(`unknown key "${n}" in ${r}`)}function $e(e,t){typeof e!="string"&&$(`${t} must be a project path`);try{return T(e)}catch{return $(`${t} is not a safe project-relative path: ${e}`)}}function mn(e,t){return(!Array.isArray(e)||e.length>256)&&$(`${t} must be an array of at most 256 paths`),e.map((r,n)=>$e(r,`${t}[${n}]`))}function aa(e){let t=P(e,"dependencies");for(let[r,n]of Object.entries(t))Ze.test(r)||$(`invalid npm package name "${r}"`),(typeof n!="string"||!oa.test(n)||n!==n.trim())&&$(`invalid version range for "${r}"`);return t}var et=e=>e.startsWith("/")&&!e.startsWith("//")&&!e.includes("\\");function ca(e){if(typeof e!="string"&&$("registry must be a URL"),et(e))return e;let t;try{t=new URL(e)}catch{return $("registry must be an https URL or an absolute path")}return t.protocol!=="https:"&&$("registry must use https"),e}function la(e){let t=P(e,"scripts");for(let[r,n]of Object.entries(t))(!hn.test(r)||typeof n!="string"||!n||n.length>1024)&&$(`invalid script "${r}"`);return t}function ua(e){let t=P(e,"entries");for(let[r,n]of Object.entries(t))hn.test(r)||$(`invalid entry name "${r}"`),$e(n,`entries.${r}`);return t}function fa(e,t){let r=P(e,"providers");for(let[n,s]of Object.entries(r))Ke.test(n)||$(`invalid provider name "${n}"`),P(s,`providers.${n}`),Qe(s,["entry","output"],`providers.${n}`),typeof s.entry!="string"&&$(`providers.${n}.entry must name an entry or a path`),Object.hasOwn(t,s.entry)||$e(s.entry,`providers.${n}.entry`),$e(s.output,`providers.${n}.output`).endsWith(".hpp")||$(`providers.${n}.output must be a .hpp file`);return r}function pa(e){let t=P(e,"test");return Qe(t,["specs"],"test"),t.specs!==void 0&&mn(t.specs,"test.specs"),t}function ha(e,t){let r;try{r=new URL(e)}catch{return $(`${t} must be an https origin`)}return(r.protocol!=="https:"||r.origin!==e)&&$(`${t} must be an https origin without a path`),e}function da(e){let t=P(e,"permissions");for(let r of Object.keys(t))ia.includes(r)||$(`unknown permission "${r}"`);for(let r of["files","publish"])t[r]!==void 0&&mn(t[r],`permissions.${r}`);return t.fetch!==void 0&&((!Array.isArray(t.fetch)||t.fetch.length>64)&&$("permissions.fetch must be an array of origins"),t.fetch.forEach((r,n)=>ha(r,`permissions.fetch[${n}]`))),t}function ma(e){(typeof e.name!="string"||!Ze.test(e.name))&&$("name must be a lower-case npm package name"),(typeof e.version!="string"||!sa.test(e.version))&&$("version must be a semantic version")}function wa(e){e.format!==ee&&(Number.isInteger(e.format)&&e.format>ee&&$(`format ${e.format} is not supported by this environment (it reads format ${ee}); update the environment`),$(`format must be ${ee}`))}function te(e){P(e,"the manifest"),wa(e),Qe(e,dn,"the manifest"),ma(e);let t=e.entries===void 0?{}:ua(e.entries);return{...e,dependencies:e.dependencies===void 0?{}:aa(e.dependencies),entries:t,providers:e.providers===void 0?{}:fa(e.providers,t),...e.registry===void 0?{}:{registry:ca(e.registry)},...e.scripts===void 0?{}:{scripts:la(e.scripts)},...e.test===void 0?{}:{test:pa(e.test)},...e.permissions===void 0?{}:{permissions:da(e.permissions)}}}function tt(e){let t;try{t=JSON.parse(new TextDecoder().decode(e))}catch{return $("not valid JSON")}return{source:t,manifest:te(t)}}function gl(e){return tt(e).manifest}function rt(e){let t={};for(let r of dn)e[r]!==void 0&&(t[r]=e[r]);return JSON.stringify(t,null,2)+` -`}function wn(e){return{format:ee,name:e,version:"0.1.0",dependencies:{}}}function En(e){let r=(String(e??"").split("/").filter(Boolean).pop()??"").toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^[^a-z0-9]+/,"").replace(/-+$/,"");return Ze.test(r)?r:"webfront-app"}async function ye(e){let t=JSON.stringify(Object.entries(e).sort(([n],[s])=>ns?1:0)),r=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(t));return[...new Uint8Array(r)].map(n=>n.toString(16).padStart(2,"0")).join("")}var nt=e=>/^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/.test(e),Re=(e,t)=>`${e.replace("/","+")}@${t}`,st=(e,t,r)=>`${Re(e,t)}-${r.slice(7).replaceAll("+","-").replaceAll("/","_").replaceAll("=","")}`;async function Ea(e,t,{fetchImpl:r,signal:n}){let s=await r(new URL(e.replace("/","%2f"),t),{signal:n});if(!s.ok)throw new Error(`Registry metadata for ${e}: HTTP ${s.status}`);return s.json()}function ga(e,t){let r=e["dist-tags"]?.[t];return r||(xe.default.valid(t)?t:xe.default.maxSatisfying(Object.keys(e.versions??{}),t))}function $a(e,t,r){let n=r||"latest",s=ga(e,n),o=e.versions?.[s];if(!o||!xe.default.valid(s))throw new Error(`Cannot resolve ${t}@${n}`);return{version:s,manifest:o}}async function ya(e,t,r,{fetchImpl:n,signal:s}){let o=new URL(t.dist?.tarball,r);if(o.protocol!=="https:"&&o.origin!==r.origin)throw new Error("Package tarballs must use HTTPS or the registry origin");let i=await n(o,{signal:s});if(!i.ok)throw new Error(`Package download for ${e}: HTTP ${i.status}`);let c=await un(i);return{bytes:c,integrity:await Et(c,t.dist.integrity)}}function ot(e){let t=new URL(e,globalThis.location?.href),r=t.origin===globalThis.location?.origin;if(e.startsWith("/")?!et(e)||!r:t.protocol!=="https:"&&!r)throw new Error(`The npm registry must use HTTPS or the application origin: ${e}`);return t.pathname.endsWith("/")||(t.pathname+="/"),t}async function D(e,t,{registry:r,fetchImpl:n=fetch,signal:s}){if(!nt(e))throw new Error(`Unsupported npm package name: ${e}`);let o=ot(r),i={fetchImpl:n,signal:s},{version:c,manifest:a}=$a(await Ea(e,o,i),e,t),{bytes:l,integrity:u}=await ya(e,a,o,i),f=await fn(l),m=pn(f,e,c);return{id:Re(e,c),key:st(e,c,u),manifest:m,integrity:u,files:f}}var be=F(C(),1);function xa(e,t,r){let n=e?.roots?.[t];return n?.requested===r&&e.packages[n.id]?e.packages[n.id]:be.default.validRange(r)?Object.values(e?.packages??{}).filter(o=>o.name===t&&be.default.satisfies(o.version,r)).sort((o,i)=>be.default.rcompare(o.version,i.version))[0]??null:null}function gn({registry:e="https://registry.npmjs.org/",fetchImpl:t=fetch,signal:r,download:n=D,previous:s}){let o=new Map;return async(i,c)=>{let a=`${i}@${c}`;if(o.has(a))return o.get(a);let l=xa(s,i,c),u=await n(i,l?.version??c,{registry:e,fetchImpl:t,signal:r});if(l&&u.integrity!==l.integrity)throw new Error(`${u.id} no longer matches the integrity recorded in the lock`);return o.set(a,u),u}}var $n=F(C(),1),yn=(e,t,r)=>new Error(`${e.name}@${e.version} requires peer ${t}@${r}; install a compatible root explicitly`);function Ra(e,t,r){if(e.manifest.peerDependenciesMeta?.[t]?.optional)return null;throw yn(e,t,r)}function ba(e,[t,r],{nodes:n,roots:s}){let o=s[t]?.id??e.dependencies[t];if(!o)return Ra(e,t,r);if(!$n.default.satisfies(n[o].version,r))throw yn(e,t,r);return o}function Oa(e,t){for(let r of Object.entries(e.manifest.peerDependencies??{})){let n=ba(e,r,t);n&&(e.dependencies[r[0]]=n)}}function xn(e,t){for(let r of Object.values(e))Oa(r,{nodes:e,roots:t})}var Rn=F(C(),1);function va(e,t){return!nt(t.name)||!Rn.default.valid(t.version)?!1:e===Re(t.name,t.version)}function Ia(e){return e.integrity?.startsWith("sha512-")?e.key===st(e.name,e.version,e.integrity):!1}function ka(e,t,r){if(!va(t,r)||!Ia(r))throw new Error("Invalid locked package");for(let n of r.files)T(n);if(Object.values(r.dependencies).some(n=>!e.packages[n]))throw new Error("Dangling locked dependency")}function Sa(e){return e?.format!==1?!1:!!e.roots&&!!e.packages}function it(e){if(!Sa(e))throw new Error("Unsupported package lock");if(Object.keys(e.packages).length>512)throw new Error("The package lock exceeds 512 packages");for(let[t,r]of Object.entries(e.packages))ka(e,t,r);if(Object.values(e.roots).some(t=>!e.packages[t.id]))throw new Error("Dangling locked root");return e}function Na(e,t,r){if(Object.keys(e.nodes).length>=512)throw new Error("Dependency graph exceeds 512 packages");for(let n of r.files.values())e.total+=n.length;if(e.total>256*1024*1024)throw new Error("Dependency graph exceeds 256 MiB");e.nodes[r.id]={name:t,version:r.manifest.version,integrity:r.integrity,key:r.key,manifest:r.manifest,files:[...r.files.keys()].sort(),dependencies:{}},e.downloads.set(r.id,r.files)}async function La(e,t){let r={};for(let n of e){let{name:s,version:o}=ie(n);r[s]={requested:o||"latest",id:await t(s,o||"latest")}}return r}async function bn(e,t={}){let r=gn(t),n={nodes:{},downloads:new Map,total:0},s=async(i,c)=>{t.signal?.throwIfAborted();let a=await r(i,c);if(n.nodes[a.id])return a.id;Na(n,i,a);for(let[l,u]of Object.entries(a.manifest.dependencies??{}).sort())n.nodes[a.id].dependencies[l]=await s(l,u);return a.id},o=await La(e,s);return xn(n.nodes,o),{lock:{format:1,registry:t.registry??"https://registry.npmjs.org/",roots:o,packages:n.nodes},downloads:n.downloads}}var at=F(C(),1);var Ta=new TextDecoder,Aa=new TextEncoder,Oe="No webfront.project.json: run wf init",ve="The lock does not match the dependencies of webfront.project.json; run wf install --update to resolve them again";async function On(e,t){try{return await G(e,t)}catch(r){if(r.message.includes("Cannot read project file:"))return null;throw r}}function ja(e,t,r){return t?r===t.requested?!0:at.default.validRange(r)!==null&&at.default.satisfies(e.packages[t.id].version,r):!1}function Pa(e,t){let r=Object.keys(t);return r.length===Object.keys(e.roots).length&&r.every(n=>ja(e,e.roots[n],t[n]))}function qa(e,t,r){return e?t?t.manifestDigest===void 0?Pa(t,e.dependencies)?"legacy":"desynchronized":t.manifestDigest===r?"consistent":"desynchronized":"unlocked":"no-manifest"}async function re(e){let t=await x(e,"state",`${R} -${S}`),r=await On(e,R),n=await On(e,S),{source:s,manifest:o}=r?tt(r):{source:null,manifest:null},i=n?it(JSON.parse(Ta.decode(n))):null,c=o?await ye(o.dependencies):null;return{manifest:o,source:s,lock:i,token:t,status:qa(o,i,c),digest:c}}var In=e=>e.status==="desynchronized"?`Warning: ${ve}.\r -`:"";async function kn(e,t,r,{signal:n}={}){let s=[];try{for(let[o,i]of t){n?.throwIfAborted();let c=await x(e,"begin",o,!1);s.push(c),await K(e,{id:c,path:"output",bytes:i},n)}n?.throwIfAborted(),await x(e,"commitGroup",s.join(` +var Gn=Object.create;var mt=Object.defineProperty;var Mn=Object.getOwnPropertyDescriptor;var Wn=Object.getOwnPropertyNames;var _n=Object.getPrototypeOf,Xn=Object.prototype.hasOwnProperty;var w=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}};var Bn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Wn(t))!Xn.call(e,s)&&s!==r&&mt(e,s,{get:()=>t[s],enumerable:!(n=Mn(t,s))||n.enumerable});return e};var z=(e,t,r)=>(r=e!=null?Gn(_n(e)):{},Bn(t||!e||!e.__esModule?mt(r,"default",{value:e,enumerable:!0}):r,e));var X=w((Ea,xt)=>{"use strict";var Kn="2.0.0",Qn=Number.MAX_SAFE_INTEGER||9007199254740991,es=16,ts=250,rs=["major","premajor","minor","preminor","patch","prepatch","prerelease"];xt.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:es,MAX_SAFE_BUILD_LENGTH:ts,MAX_SAFE_INTEGER:Qn,RELEASE_TYPES:rs,SEMVER_SPEC_VERSION:Kn,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var B=w((ga,Rt)=>{"use strict";var ns=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};Rt.exports=ns});var F=w((P,Ot)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:Te,MAX_SAFE_BUILD_LENGTH:ss,MAX_LENGTH:os}=X(),is=B();P=Ot.exports={};var cs=P.re=[],as=P.safeRe=[],p=P.src=[],ls=P.safeSrc=[],h=P.t={},us=0,Pe="[a-zA-Z0-9-]",fs=[["\\s",1],["\\d",os],[Pe,ss]],ps=e=>{for(let[t,r]of fs)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},E=(e,t,r)=>{let n=ps(t),s=us++;is(e,s,t),h[e]=s,p[s]=t,ls[s]=n,cs[s]=new RegExp(t,r?"g":void 0),as[s]=new RegExp(n,r?"g":void 0)};E("NUMERICIDENTIFIER","0|[1-9]\\d*");E("NUMERICIDENTIFIERLOOSE","\\d+");E("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Pe}*`);E("MAINVERSION",`(${p[h.NUMERICIDENTIFIER]})\\.(${p[h.NUMERICIDENTIFIER]})\\.(${p[h.NUMERICIDENTIFIER]})`);E("MAINVERSIONLOOSE",`(${p[h.NUMERICIDENTIFIERLOOSE]})\\.(${p[h.NUMERICIDENTIFIERLOOSE]})\\.(${p[h.NUMERICIDENTIFIERLOOSE]})`);E("PRERELEASEIDENTIFIER",`(?:${p[h.NONNUMERICIDENTIFIER]}|${p[h.NUMERICIDENTIFIER]})`);E("PRERELEASEIDENTIFIERLOOSE",`(?:${p[h.NONNUMERICIDENTIFIER]}|${p[h.NUMERICIDENTIFIERLOOSE]})`);E("PRERELEASE",`(?:-(${p[h.PRERELEASEIDENTIFIER]}(?:\\.${p[h.PRERELEASEIDENTIFIER]})*))`);E("PRERELEASELOOSE",`(?:-?(${p[h.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${p[h.PRERELEASEIDENTIFIERLOOSE]})*))`);E("BUILDIDENTIFIER",`${Pe}+`);E("BUILD",`(?:\\+(${p[h.BUILDIDENTIFIER]}(?:\\.${p[h.BUILDIDENTIFIER]})*))`);E("FULLPLAIN",`v?${p[h.MAINVERSION]}${p[h.PRERELEASE]}?${p[h.BUILD]}?`);E("FULL",`^${p[h.FULLPLAIN]}$`);E("LOOSEPLAIN",`[v=\\s]*${p[h.MAINVERSIONLOOSE]}${p[h.PRERELEASELOOSE]}?${p[h.BUILD]}?`);E("LOOSE",`^${p[h.LOOSEPLAIN]}$`);E("GTLT","((?:<|>)?=?)");E("XRANGEIDENTIFIERLOOSE",`${p[h.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);E("XRANGEIDENTIFIER",`${p[h.NUMERICIDENTIFIER]}|x|X|\\*`);E("XRANGEPLAIN",`[v=\\s]*(${p[h.XRANGEIDENTIFIER]})(?:\\.(${p[h.XRANGEIDENTIFIER]})(?:\\.(${p[h.XRANGEIDENTIFIER]})(?:${p[h.PRERELEASE]})?${p[h.BUILD]}?)?)?`);E("XRANGEPLAINLOOSE",`[v=\\s]*(${p[h.XRANGEIDENTIFIERLOOSE]})(?:\\.(${p[h.XRANGEIDENTIFIERLOOSE]})(?:\\.(${p[h.XRANGEIDENTIFIERLOOSE]})(?:${p[h.PRERELEASELOOSE]})?${p[h.BUILD]}?)?)?`);E("XRANGE",`^${p[h.GTLT]}\\s*${p[h.XRANGEPLAIN]}$`);E("XRANGELOOSE",`^${p[h.GTLT]}\\s*${p[h.XRANGEPLAINLOOSE]}$`);E("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Te}})(?:\\.(\\d{1,${Te}}))?(?:\\.(\\d{1,${Te}}))?`);E("COERCE",`${p[h.COERCEPLAIN]}(?:$|[^\\d])`);E("COERCEFULL",p[h.COERCEPLAIN]+`(?:${p[h.PRERELEASE]})?(?:${p[h.BUILD]})?(?:$|[^\\d])`);E("COERCERTL",p[h.COERCE],!0);E("COERCERTLFULL",p[h.COERCEFULL],!0);E("LONETILDE","(?:~>?)");E("TILDETRIM",`(\\s*)${p[h.LONETILDE]}\\s+`,!0);P.tildeTrimReplace="$1~";E("TILDE",`^${p[h.LONETILDE]}${p[h.XRANGEPLAIN]}$`);E("TILDELOOSE",`^${p[h.LONETILDE]}${p[h.XRANGEPLAINLOOSE]}$`);E("LONECARET","(?:\\^)");E("CARETTRIM",`(\\s*)${p[h.LONECARET]}\\s+`,!0);P.caretTrimReplace="$1^";E("CARET",`^${p[h.LONECARET]}${p[h.XRANGEPLAIN]}$`);E("CARETLOOSE",`^${p[h.LONECARET]}${p[h.XRANGEPLAINLOOSE]}$`);E("COMPARATORLOOSE",`^${p[h.GTLT]}\\s*(${p[h.LOOSEPLAIN]})$|^$`);E("COMPARATOR",`^${p[h.GTLT]}\\s*(${p[h.FULLPLAIN]})$|^$`);E("COMPARATORTRIM",`(\\s*)${p[h.GTLT]}\\s*(${p[h.LOOSEPLAIN]}|${p[h.XRANGEPLAIN]})`,!0);P.comparatorTrimReplace="$1$2$3";E("HYPHENRANGE",`^\\s*(${p[h.XRANGEPLAIN]})\\s+-\\s+(${p[h.XRANGEPLAIN]})\\s*$`);E("HYPHENRANGELOOSE",`^\\s*(${p[h.XRANGEPLAINLOOSE]})\\s+-\\s+(${p[h.XRANGEPLAINLOOSE]})\\s*$`);E("STAR","(<|>)?=?\\s*\\*");E("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");E("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var ce=w(($a,bt)=>{"use strict";var hs=Object.freeze({loose:!0}),ds=Object.freeze({}),ms=e=>e?typeof e!="object"?hs:e:ds;bt.exports=ms});var je=w((ya,kt)=>{"use strict";var It=/^[0-9]+$/,vt=(e,t)=>{if(typeof e=="number"&&typeof t=="number")return e===t?0:evt(t,e);kt.exports={compareIdentifiers:vt,rcompareIdentifiers:ws}});var O=w((xa,Nt)=>{"use strict";var ae=B(),{MAX_LENGTH:St,MAX_SAFE_INTEGER:le}=X(),{safeRe:ue,t:fe}=F(),Es=ce(),{compareIdentifiers:qe}=je(),Ce=class e{constructor(t,r){if(r=Es(r),t instanceof e){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>St)throw new TypeError(`version is longer than ${St} characters`);ae("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=t.trim().match(r.loose?ue[fe.LOOSE]:ue[fe.FULL]);if(!n)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>le||this.major<0)throw new TypeError("Invalid major version");if(this.minor>le||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>le||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(s=>{if(/^[0-9]+$/.test(s)){let o=+s;if(o>=0&&ot.major?1:this.minort.minor?1:this.patcht.patch?1:0}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],s=t.prerelease[r];if(ae("prerelease compare",r,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return qe(n,s)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let n=this.build[r],s=t.build[r];if(ae("build compare",r,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return qe(n,s)}while(++r)}inc(t,r,n){if(t.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let s=`-${r}`.match(this.options.loose?ue[fe.PRERELEASELOOSE]:ue[fe.PRERELEASE]);if(!s||s[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let s=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[s];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(s)}}if(r){let o=[r,s];n===!1&&(o=[r]),qe(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=o):this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};Nt.exports=Ce});var q=w((Ra,At)=>{"use strict";var Lt=O(),gs=(e,t,r=!1)=>{if(e instanceof Lt)return e;try{return new Lt(e,t)}catch(n){if(!r)return null;throw n}};At.exports=gs});var Pt=w((Oa,Tt)=>{"use strict";var $s=q(),ys=(e,t)=>{let r=$s(e,t);return r?r.version:null};Tt.exports=ys});var qt=w((ba,jt)=>{"use strict";var xs=q(),Rs=(e,t)=>{let r=xs(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};jt.exports=Rs});var Ut=w((Ia,Dt)=>{"use strict";var Ct=O(),Os=(e,t,r,n,s)=>{typeof r=="string"&&(s=n,n=r,r=void 0);try{return new Ct(e instanceof Ct?e.version:e,r).inc(t,n,s).version}catch{return null}};Dt.exports=Os});var Gt=w((va,Ft)=>{"use strict";var zt=q(),bs=(e,t)=>{let r=zt(e,null,!0),n=zt(t,null,!0),s=r.compare(n);if(s===0)return null;let o=s>0,i=o?r:n,a=o?n:r,c=!!i.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(i)===0)return a.minor&&!a.patch?"minor":"patch"}let u=c?"pre":"";return r.major!==n.major?u+"major":r.minor!==n.minor?u+"minor":r.patch!==n.patch?u+"patch":"prerelease"};Ft.exports=bs});var Wt=w((ka,Mt)=>{"use strict";var Is=O(),vs=(e,t)=>new Is(e,t).major;Mt.exports=vs});var Xt=w((Sa,_t)=>{"use strict";var ks=O(),Ss=(e,t)=>new ks(e,t).minor;_t.exports=Ss});var Vt=w((Na,Bt)=>{"use strict";var Ns=O(),Ls=(e,t)=>new Ns(e,t).patch;Bt.exports=Ls});var Yt=w((La,Ht)=>{"use strict";var As=q(),Ts=(e,t)=>{let r=As(e,t);return r&&r.prerelease.length?r.prerelease:null};Ht.exports=Ts});var N=w((Aa,Zt)=>{"use strict";var Jt=O(),Ps=(e,t,r)=>new Jt(e,r).compare(new Jt(t,r));Zt.exports=Ps});var Qt=w((Ta,Kt)=>{"use strict";var js=N(),qs=(e,t,r)=>js(t,e,r);Kt.exports=qs});var tr=w((Pa,er)=>{"use strict";var Cs=N(),Ds=(e,t)=>Cs(e,t,!0);er.exports=Ds});var pe=w((ja,nr)=>{"use strict";var rr=O(),Us=(e,t,r)=>{let n=new rr(e,r),s=new rr(t,r);return n.compare(s)||n.compareBuild(s)};nr.exports=Us});var or=w((qa,sr)=>{"use strict";var zs=pe(),Fs=(e,t)=>e.sort((r,n)=>zs(r,n,t));sr.exports=Fs});var cr=w((Ca,ir)=>{"use strict";var Gs=pe(),Ms=(e,t)=>e.sort((r,n)=>Gs(n,r,t));ir.exports=Ms});var V=w((Da,ar)=>{"use strict";var Ws=N(),_s=(e,t,r)=>Ws(e,t,r)>0;ar.exports=_s});var he=w((Ua,lr)=>{"use strict";var Xs=N(),Bs=(e,t,r)=>Xs(e,t,r)<0;lr.exports=Bs});var De=w((za,ur)=>{"use strict";var Vs=N(),Hs=(e,t,r)=>Vs(e,t,r)===0;ur.exports=Hs});var Ue=w((Fa,fr)=>{"use strict";var Ys=N(),Js=(e,t,r)=>Ys(e,t,r)!==0;fr.exports=Js});var de=w((Ga,pr)=>{"use strict";var Zs=N(),Ks=(e,t,r)=>Zs(e,t,r)>=0;pr.exports=Ks});var me=w((Ma,hr)=>{"use strict";var Qs=N(),eo=(e,t,r)=>Qs(e,t,r)<=0;hr.exports=eo});var ze=w((Wa,dr)=>{"use strict";var to=De(),ro=Ue(),no=V(),so=de(),oo=he(),io=me(),co=(e,t,r,n)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return to(e,r,n);case"!=":return ro(e,r,n);case">":return no(e,r,n);case">=":return so(e,r,n);case"<":return oo(e,r,n);case"<=":return io(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};dr.exports=co});var wr=w((_a,mr)=>{"use strict";var ao=O(),lo=q(),{safeRe:we,t:Ee}=F(),uo=(e,t)=>{if(e instanceof ao)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?we[Ee.COERCEFULL]:we[Ee.COERCE]);else{let c=t.includePrerelease?we[Ee.COERCERTLFULL]:we[Ee.COERCERTL],l;for(;(l=c.exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||l.index+l[0].length!==r.index+r[0].length)&&(r=l),c.lastIndex=l.index+l[1].length+l[2].length;c.lastIndex=-1}if(r===null)return null;let n=r[2],s=r[3]||"0",o=r[4]||"0",i=t.includePrerelease&&r[5]?`-${r[5]}`:"",a=t.includePrerelease&&r[6]?`+${r[6]}`:"";return lo(`${n}.${s}.${o}${i}${a}`,t)};mr.exports=uo});var gr=w((Xa,Er)=>{"use strict";var Fe=class{constructor(){this.max=1e3,this.map=new Map}get(t){let r=this.map.get(t);if(r!==void 0)return this.map.delete(t),this.map.set(t,r),r}delete(t){return this.map.delete(t)}set(t,r){if(!this.delete(t)&&r!==void 0){if(this.map.size>=this.max){let s=this.map.keys().next().value;this.delete(s)}this.map.set(t,r)}return this}};Er.exports=Fe});var L=w((Ba,Rr)=>{"use strict";var fo=/\s+/g,Ge=class e{constructor(t,r){if(r=ho(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof Me)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().replace(fo," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(s=>!yr(s[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let s of this.set)if(s.length===1&&xo(s[0])){this.set=[s];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let t=0;t0&&(this.formatted+="||");let r=this.set[t];for(let n=0;n0&&(this.formatted+=" "),this.formatted+=r[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(t){let n=((this.options.includePrerelease&&$o)|(this.options.loose&&yo))+":"+t,s=$r.get(n);if(s)return s;let o=this.options.loose,i=o?I[b.HYPHENRANGELOOSE]:I[b.HYPHENRANGE];t=t.replace(i,Ao(this.options.includePrerelease)),g("hyphen replace",t),t=t.replace(I[b.COMPARATORTRIM],wo),g("comparator trim",t),t=t.replace(I[b.TILDETRIM],Eo),g("tilde trim",t),t=t.replace(I[b.CARETTRIM],go),g("caret trim",t);let a=t.split(" ").map(f=>Ro(f,this.options)).join(" ").split(/\s+/).map(f=>Lo(f,this.options));o&&(a=a.filter(f=>(g("loose invalid filter",f,this.options),!!f.match(I[b.COMPARATORLOOSE])))),g("range list",a);let c=new Map,l=a.map(f=>new Me(f,this.options));for(let f of l){if(yr(f))return[f];c.set(f.value,f)}c.size>1&&c.has("")&&c.delete("");let u=[...c.values()];return $r.set(n,u),u}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some(n=>xr(n,r)&&t.set.some(s=>xr(s,r)&&n.every(o=>s.every(i=>o.intersects(i,r)))))}test(t){if(!t)return!1;if(typeof t=="string")try{t=new mo(t,this.options)}catch{return!1}for(let r=0;re.value==="<0.0.0-0",xo=e=>e.value==="",xr=(e,t)=>{let r=!0,n=e.slice(),s=n.pop();for(;r&&n.length;)r=n.every(o=>s.intersects(o,t)),s=n.pop();return r},Ro=(e,t)=>(e=e.replace(I[b.BUILD],""),g("comp",e,t),e=Io(e,t),g("caret",e),e=Oo(e,t),g("tildes",e),e=ko(e,t),g("xrange",e),e=No(e,t),g("stars",e),e),v=e=>!e||e.toLowerCase()==="x"||e==="*",Oo=(e,t)=>e.trim().split(/\s+/).map(r=>bo(r,t)).join(" "),bo=(e,t)=>{let r=t.loose?I[b.TILDELOOSE]:I[b.TILDE];return e.replace(r,(n,s,o,i,a)=>{g("tilde",e,n,s,o,i,a);let c;return v(s)?c="":v(o)?c=`>=${s}.0.0 <${+s+1}.0.0-0`:v(i)?c=`>=${s}.${o}.0 <${s}.${+o+1}.0-0`:a?(g("replaceTilde pr",a),c=`>=${s}.${o}.${i}-${a} <${s}.${+o+1}.0-0`):c=`>=${s}.${o}.${i} <${s}.${+o+1}.0-0`,g("tilde return",c),c})},Io=(e,t)=>e.trim().split(/\s+/).map(r=>vo(r,t)).join(" "),vo=(e,t)=>{g("caret",e,t);let r=t.loose?I[b.CARETLOOSE]:I[b.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(s,o,i,a,c)=>{g("caret",e,s,o,i,a,c);let l;return v(o)?l="":v(i)?l=`>=${o}.0.0${n} <${+o+1}.0.0-0`:v(a)?o==="0"?l=`>=${o}.${i}.0${n} <${o}.${+i+1}.0-0`:l=`>=${o}.${i}.0${n} <${+o+1}.0.0-0`:c?(g("replaceCaret pr",c),o==="0"?i==="0"?l=`>=${o}.${i}.${a}-${c} <${o}.${i}.${+a+1}-0`:l=`>=${o}.${i}.${a}-${c} <${o}.${+i+1}.0-0`:l=`>=${o}.${i}.${a}-${c} <${+o+1}.0.0-0`):(g("no pr"),o==="0"?i==="0"?l=`>=${o}.${i}.${a}${n} <${o}.${i}.${+a+1}-0`:l=`>=${o}.${i}.${a}${n} <${o}.${+i+1}.0-0`:l=`>=${o}.${i}.${a} <${+o+1}.0.0-0`),g("caret return",l),l})},ko=(e,t)=>(g("replaceXRanges",e,t),e.split(/\s+/).map(r=>So(r,t)).join(" ")),So=(e,t)=>{e=e.trim();let r=t.loose?I[b.XRANGELOOSE]:I[b.XRANGE];return e.replace(r,(n,s,o,i,a,c)=>{g("xRange",e,n,s,o,i,a,c);let l=v(o),u=l||v(i),f=u||v(a),m=f;return s==="="&&m&&(s=""),c=t.includePrerelease?"-0":"",l?s===">"||s==="<"?n="<0.0.0-0":n="*":s&&m?(u&&(i=0),a=0,s===">"?(s=">=",u?(o=+o+1,i=0,a=0):(i=+i+1,a=0)):s==="<="&&(s="<",u?o=+o+1:i=+i+1),s==="<"&&(c="-0"),n=`${s+o}.${i}.${a}${c}`):u?n=`>=${o}.0.0${c} <${+o+1}.0.0-0`:f&&(n=`>=${o}.${i}.0${c} <${o}.${+i+1}.0-0`),g("xRange return",n),n})},No=(e,t)=>(g("replaceStars",e,t),e.trim().replace(I[b.STAR],"")),Lo=(e,t)=>(g("replaceGTE0",e,t),e.trim().replace(I[t.includePrerelease?b.GTE0PRE:b.GTE0],"")),Ao=e=>(t,r,n,s,o,i,a,c,l,u,f,m)=>(v(n)?r="":v(s)?r=`>=${n}.0.0${e?"-0":""}`:v(o)?r=`>=${n}.${s}.0${e?"-0":""}`:i?r=`>=${r}`:r=`>=${r}${e?"-0":""}`,v(l)?c="":v(u)?c=`<${+l+1}.0.0-0`:v(f)?c=`<${l}.${+u+1}.0-0`:m?c=`<=${l}.${u}.${f}-${m}`:e?c=`<${l}.${u}.${+f+1}-0`:c=`<=${c}`,`${r} ${c}`.trim()),To=(e,t,r)=>{for(let n=0;n0){let s=e[n].semver;if(s.major===t.major&&s.minor===t.minor&&s.patch===t.patch)return!0}return!1}return!0}});var H=w((Va,Sr)=>{"use strict";var Y=Symbol("SemVer ANY"),Xe=class e{static get ANY(){return Y}constructor(t,r){if(r=Or(r),t instanceof e){if(t.loose===!!r.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(" "),_e("comparator",t,r),this.options=r,this.loose=!!r.loose,this.parse(t),this.semver===Y?this.value="":this.value=this.operator+this.semver.version,_e("comp",this)}parse(t){let r=this.options.loose?br[Ir.COMPARATORLOOSE]:br[Ir.COMPARATOR],n=t.match(r);if(!n)throw new TypeError(`Invalid comparator: ${t}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new vr(n[2],this.options.loose):this.semver=Y}toString(){return this.value}test(t){if(_e("Comparator.test",t,this.options.loose),this.semver===Y||t===Y)return!0;if(typeof t=="string")try{t=new vr(t,this.options)}catch{return!1}return We(t,this.operator,this.semver,this.options)}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new kr(t.value,r).test(this.value):t.operator===""?t.value===""?!0:new kr(this.value,r).test(t.semver):(r=Or(r),r.includePrerelease&&(this.value==="<0.0.0-0"||t.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&t.operator.startsWith(">")||this.operator.startsWith("<")&&t.operator.startsWith("<")||this.semver.version===t.semver.version&&this.operator.includes("=")&&t.operator.includes("=")||We(this.semver,"<",t.semver,r)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||We(this.semver,">",t.semver,r)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}};Sr.exports=Xe;var Or=ce(),{safeRe:br,t:Ir}=F(),We=ze(),_e=B(),vr=O(),kr=L()});var J=w((Ha,Nr)=>{"use strict";var Po=L(),jo=(e,t,r)=>{try{t=new Po(t,r)}catch{return!1}return t.test(e)};Nr.exports=jo});var Ar=w((Ya,Lr)=>{"use strict";var qo=L(),Co=(e,t)=>new qo(e,t).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));Lr.exports=Co});var Pr=w((Ja,Tr)=>{"use strict";var Do=O(),Uo=L(),zo=(e,t,r)=>{let n=null,s=null,o=null;try{o=new Uo(t,r)}catch{return null}return e.forEach(i=>{o.test(i)&&(!n||s.compare(i)===-1)&&(n=i,s=new Do(n,r))}),n};Tr.exports=zo});var qr=w((Za,jr)=>{"use strict";var Fo=O(),Go=L(),Mo=(e,t,r)=>{let n=null,s=null,o=null;try{o=new Go(t,r)}catch{return null}return e.forEach(i=>{o.test(i)&&(!n||s.compare(i)===1)&&(n=i,s=new Fo(n,r))}),n};jr.exports=Mo});var Ur=w((Ka,Dr)=>{"use strict";var Be=O(),Wo=L(),Cr=V(),_o=(e,t)=>{e=new Wo(e,t);let r=new Be("0.0.0");if(e.test(r)||(r=new Be("0.0.0-0"),e.test(r)))return r;r=null;for(let n=0;n{let a=new Be(i.semver.version);switch(i.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!o||Cr(a,o))&&(o=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${i.operator}`)}}),o&&(!r||Cr(r,o))&&(r=o)}return r&&e.test(r)?r:null};Dr.exports=_o});var Fr=w((Qa,zr)=>{"use strict";var Xo=L(),Bo=(e,t)=>{try{return new Xo(e,t).range||"*"}catch{return null}};zr.exports=Bo});var ge=w((el,_r)=>{"use strict";var Vo=O(),Wr=H(),{ANY:Ho}=Wr,Yo=L(),Jo=J(),Gr=V(),Mr=he(),Zo=me(),Ko=de(),Qo=(e,t,r,n)=>{e=new Vo(e,n),t=new Yo(t,n);let s,o,i,a,c;switch(r){case">":s=Gr,o=Zo,i=Mr,a=">",c=">=";break;case"<":s=Mr,o=Ko,i=Gr,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Jo(e,t,n))return!1;for(let l=0;l{d.semver===Ho&&(d=new Wr(">=0.0.0")),f=f||d,m=m||d,s(d.semver,f.semver,n)?f=d:i(d.semver,m.semver,n)&&(m=d)}),f.operator===a||f.operator===c||(!m.operator||m.operator===a)&&o(e,m.semver))return!1;if(m.operator===c&&i(e,m.semver))return!1}return!0};_r.exports=Qo});var Br=w((tl,Xr)=>{"use strict";var ei=ge(),ti=(e,t,r)=>ei(e,t,">",r);Xr.exports=ti});var Hr=w((rl,Vr)=>{"use strict";var ri=ge(),ni=(e,t,r)=>ri(e,t,"<",r);Vr.exports=ni});var Zr=w((nl,Jr)=>{"use strict";var Yr=L(),si=(e,t,r)=>(e=new Yr(e,r),t=new Yr(t,r),e.intersects(t,r));Jr.exports=si});var Qr=w((sl,Kr)=>{"use strict";var oi=J(),ii=N();Kr.exports=(e,t,r)=>{let n=[],s=null,o=null,i=e.sort((u,f)=>ii(u,f,r));for(let u of i)oi(u,t,r)?(o=u,s||(s=u)):(o&&n.push([s,o]),o=null,s=null);s&&n.push([s,null]);let a=[];for(let[u,f]of n)u===f?a.push(u):!f&&u===i[0]?a.push("*"):f?u===i[0]?a.push(`<=${f}`):a.push(`${u} - ${f}`):a.push(`>=${u}`);let c=a.join(" || "),l=typeof t.raw=="string"?t.raw:String(t);return c.length{"use strict";var en=L(),He=H(),{ANY:Ve}=He,Z=J(),Ye=N(),ci=(e,t,r={})=>{if(e===t)return!0;e=new en(e,r),t=new en(t,r);let n=!1;e:for(let s of e.set){for(let o of t.set){let i=li(s,o,r);if(n=n||i!==null,i)continue e}if(n)return!1}return!0},ai=[new He(">=0.0.0-0")],tn=[new He(">=0.0.0")],li=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===Ve){if(t.length===1&&t[0].semver===Ve)return!0;r.includePrerelease?e=ai:e=tn}if(t.length===1&&t[0].semver===Ve){if(r.includePrerelease)return!0;t=tn}let n=new Set,s,o;for(let d of e)d.operator===">"||d.operator===">="?s=rn(s,d,r):d.operator==="<"||d.operator==="<="?o=nn(o,d,r):n.add(d.semver);if(n.size>1)return null;let i;if(s&&o){if(i=Ye(s.semver,o.semver,r),i>0)return null;if(i===0&&(s.operator!==">="||o.operator!=="<="))return null}for(let d of n){if(s&&!Z(d,String(s),r)||o&&!Z(d,String(o),r))return null;for(let T of t)if(!Z(d,String(T),r))return!1;return!0}let a,c,l,u,f=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1,m=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1;f&&f.prerelease.length===1&&o.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(let d of t){if(u=u||d.operator===">"||d.operator===">=",l=l||d.operator==="<"||d.operator==="<=",s){if(m&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===m.major&&d.semver.minor===m.minor&&d.semver.patch===m.patch&&(m=!1),d.operator===">"||d.operator===">="){if(a=rn(s,d,r),a===d&&a!==s)return!1}else if(s.operator===">="&&!Z(s.semver,String(d),r))return!1}if(o){if(f&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===f.major&&d.semver.minor===f.minor&&d.semver.patch===f.patch&&(f=!1),d.operator==="<"||d.operator==="<="){if(c=nn(o,d,r),c===d&&c!==o)return!1}else if(o.operator==="<="&&!Z(o.semver,String(d),r))return!1}if(!d.operator&&(o||s)&&i!==0)return!1}return!(s&&l&&!o&&i!==0||o&&u&&!s&&i!==0||m||f)},rn=(e,t,r)=>{if(!e)return t;let n=Ye(e.semver,t.semver,r);return n>0?e:n<0||t.operator===">"&&e.operator===">="?t:e},nn=(e,t,r)=>{if(!e)return t;let n=Ye(e.semver,t.semver,r);return n<0?e:n>0||t.operator==="<"&&e.operator==="<="?t:e};sn.exports=ci});var C=w((il,ln)=>{"use strict";var Je=F(),cn=X(),ui=O(),an=je(),fi=q(),pi=Pt(),hi=qt(),di=Ut(),mi=Gt(),wi=Wt(),Ei=Xt(),gi=Vt(),$i=Yt(),yi=N(),xi=Qt(),Ri=tr(),Oi=pe(),bi=or(),Ii=cr(),vi=V(),ki=he(),Si=De(),Ni=Ue(),Li=de(),Ai=me(),Ti=ze(),Pi=wr(),ji=H(),qi=L(),Ci=J(),Di=Ar(),Ui=Pr(),zi=qr(),Fi=Ur(),Gi=Fr(),Mi=ge(),Wi=Br(),_i=Hr(),Xi=Zr(),Bi=Qr(),Vi=on();ln.exports={parse:fi,valid:pi,clean:hi,inc:di,diff:mi,major:wi,minor:Ei,patch:gi,prerelease:$i,compare:yi,rcompare:xi,compareLoose:Ri,compareBuild:Oi,sort:bi,rsort:Ii,gt:vi,lt:ki,eq:Si,neq:Ni,gte:Li,lte:Ai,cmp:Ti,coerce:Pi,Comparator:ji,Range:qi,satisfies:Ci,toComparators:Di,maxSatisfying:Ui,minSatisfying:zi,minVersion:Fi,validRange:Gi,outside:Mi,gtr:Wi,ltr:_i,intersects:Xi,simplifyRange:Bi,subset:Vi,SemVer:ui,re:Je.re,src:Je.src,tokens:Je.t,SEMVER_SPEC_VERSION:cn.SEMVER_SPEC_VERSION,RELEASE_TYPES:cn.RELEASE_TYPES,compareIdentifiers:an.compareIdentifiers,rcompareIdentifiers:an.rcompareIdentifiers}});var Ae=new TextDecoder;function ie(e){let t=e.indexOf("@",e.startsWith("@")?1:0);return t<0?{name:e,version:""}:{name:e.slice(0,t),version:e.slice(t+1)}}async function Et(e,t){let r=String(t??"").split(/\s+/).filter(o=>o.startsWith("sha512-")).map(o=>o.split("?")[0]);if(r.length===0)throw new Error("The package has no SHA-512 integrity");if(!globalThis.crypto?.subtle)throw new Error("Integrity checks need a secure context (https or localhost)");let n=new Uint8Array(await crypto.subtle.digest("SHA-512",e)),s="sha512-"+btoa(Array.from(n,o=>String.fromCharCode(o)).join(""));if(!r.includes(s))throw new Error(`Integrity check failed: expected ${r[0]}, got ${s}`);return s}async function gt(e,t=268435456){let r=new Blob([e]).stream().pipeThrough(new DecompressionStream("gzip")).getReader(),n=[],s=0;for(let o=await r.read();!o.done;o=await r.read()){if(s+=o.value.length,s>t)throw await r.cancel(),new Error(`The tarball unpacks to more than ${t} bytes`);n.push(o.value)}return new Uint8Array(await new Blob(n).arrayBuffer())}function _(e,t,r){let n=e.subarray(t,t+r),s=n.indexOf(0);return Ae.decode(s<0?n:n.subarray(0,s))}function $t(e,t,r){if(e[t]&128)return e.subarray(t+1,t+r).reduce((s,o)=>s*256+o,e[t]&127);let n=_(e,t,r).trim();if(!/^[0-7]*$/.test(n))throw new Error("Corrupt tar header");return n===""?0:parseInt(n,8)}function Vn(e){let t=0;for(let r=0;r<512;++r)t+=r>=148&&r<156?32:e[r];if($t(e,148,8)!==t)throw new Error("Corrupt tar header checksum")}function Hn(e){let t={},r=0;for(;r0)||r+s>e.length)throw new Error("Corrupt pax header");let o=Ae.decode(e.subarray(n+1,r+s-1)),i=o.indexOf("=");t[o.slice(0,i)]=o.slice(i+1),r+=s}return t}function Yn(e,t){let r=e.subarray(t,t+512);Vn(r);let n=$t(r,124,12),s=t+512;if(s+n>e.length)throw new Error("Truncated tar archive");return{header:r,type:r[156]===0?"0":String.fromCharCode(r[156]),data:e.subarray(s,s+n),next:s+Math.ceil(n/512)*512}}function Jn(e,t){return t+512>e.length||e.subarray(t,t+512).every(r=>r===0)}function Zn(e){let t=_(e,0,100),r=_(e,257,5)==="ustar"?_(e,345,155):"";return r?`${r}/${t}`:t}var wt={x:(e,t)=>({...e,pax:Hn(t).path}),L:(e,t)=>({...e,long:_(t,0,t.length)}),g:e=>e};function yt(e){let t=[],r={};for(let n=0;!Jn(e,n);){let{header:s,type:o,data:i,next:a}=Yn(e,n);if(n=a,Object.hasOwn(wt,o)){r=wt[o](r,i);continue}(o==="0"||o==="7")&&t.push({path:r.pax??r.long??Zn(s),bytes:i}),r={}}return t}var xe=z(C(),1);var x=(e,t,...r)=>e.cppFunction(`webfront.developer.${t}`)(...r);async function G(e,t){let r=[],n=0;for(;;){let s=await x(e,"read",t,n);if(r.push(s),n+=s.length,s.length<262144)break;if(n>256*1024*1024)throw new Error("Project file is too large")}return new Uint8Array(await new Blob(r).arrayBuffer())}async function K(e,{id:t,path:r,bytes:n},s){for(let o=0;o{}),a}}async function Hi(e,t){let r=[],n=0;for(;;){let{done:s,value:o}=await e.read();if(s)return r;if(n+=o.length,n>t)throw new Error("Compressed download exceeds its byte limit");r.push(o)}}async function Yi(e,t){try{return await Hi(e,t)}catch(r){throw await e.cancel().catch(()=>{}),r}finally{e.releaseLock()}}async function un(e,t=64*1024*1024){if(!e.ok)throw new Error(`Download: HTTP ${e.status}`);if(Number(e.headers.get("content-length"))>t)throw new Error("Compressed download exceeds its byte limit");return new Uint8Array(await new Blob(await Yi(e.body.getReader(),t)).arrayBuffer())}var M=".webfront/developer/packages",Ji=/[\\\0:*?"<>|]/,Zi=e=>e.split("/").some(t=>!t||t==="."||t==="..");function Ki(e){return typeof e!="string"||!e||Ji.test(e)?!0:Zi(e)}function A(e){if(Ki(e))throw new Error(`Unsafe package path: ${e}`);return e}var Qi=new TextDecoder,ec=["preinstall","install","postinstall"];async function fn(e){let t=new Map;for(let r of yt(await gt(e))){if(!r.path.startsWith("package/"))throw new Error("Invalid npm tarball root");let n=A(r.path.slice(8));if(t.has(n))throw new Error(`Duplicate package path: ${n}`);t.set(n,r.bytes)}return t}var tc=e=>ec.some(t=>e.scripts?.[t]),rc=e=>e.has("binding.gyp")||[...e.keys()].some(t=>t.endsWith(".node"));function nc(e,t){return tc(e)||e.gypfile?!0:rc(t)}function pn(e,t,r){let n=JSON.parse(Qi.decode(e.get("package.json")));if(n.name!==t||n.version!==r)throw new Error("npm archive identity mismatch");if(nc(n,e))throw new Error(`${t} needs an unsupported install script or native module`);return n}function W(e){return!e||typeof e!="object"?!1:!Array.isArray(e)}var R="webfront.project.json",S="webfront-packages.lock.json",ee=1,Ze=/^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/,sc=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/,oc=/^[0-9A-Za-z.+\-^~<>=*| ]{1,128}$/,hn=/^[A-Za-z0-9][A-Za-z0-9:_.-]{0,63}$/,Ke=/^[A-Za-z_][A-Za-z0-9_]*$/,dn=["format","name","version","dependencies","registry","scripts","entries","providers","test","permissions"],ic=["files","publish","fetch"],$=e=>{throw new Error(`${R}: ${e}`)};function j(e,t){return W(e)||$(`${t} must be an object`),e}function Qe(e,t,r){for(let n of Object.keys(e))t.includes(n)||$(`unknown key "${n}" in ${r}`)}function $e(e,t){typeof e!="string"&&$(`${t} must be a project path`);try{return A(e)}catch{return $(`${t} is not a safe project-relative path: ${e}`)}}function mn(e,t){return(!Array.isArray(e)||e.length>256)&&$(`${t} must be an array of at most 256 paths`),e.map((r,n)=>$e(r,`${t}[${n}]`))}function cc(e){let t=j(e,"dependencies");for(let[r,n]of Object.entries(t))Ze.test(r)||$(`invalid npm package name "${r}"`),(typeof n!="string"||!oc.test(n)||n!==n.trim())&&$(`invalid version range for "${r}"`);return t}var et=e=>e.startsWith("/")&&!e.startsWith("//")&&!e.includes("\\");function ac(e){if(typeof e!="string"&&$("registry must be a URL"),et(e))return e;let t;try{t=new URL(e)}catch{return $("registry must be an https URL or an absolute path")}return t.protocol!=="https:"&&$("registry must use https"),e}function lc(e){let t=j(e,"scripts");for(let[r,n]of Object.entries(t))(!hn.test(r)||typeof n!="string"||!n||n.length>1024)&&$(`invalid script "${r}"`);return t}function uc(e){let t=j(e,"entries");for(let[r,n]of Object.entries(t))hn.test(r)||$(`invalid entry name "${r}"`),$e(n,`entries.${r}`);return t}function fc(e,t){let r=j(e,"providers");for(let[n,s]of Object.entries(r))Ke.test(n)||$(`invalid provider name "${n}"`),j(s,`providers.${n}`),Qe(s,["entry","output"],`providers.${n}`),typeof s.entry!="string"&&$(`providers.${n}.entry must name an entry or a path`),Object.hasOwn(t,s.entry)||$e(s.entry,`providers.${n}.entry`),$e(s.output,`providers.${n}.output`).endsWith(".hpp")||$(`providers.${n}.output must be a .hpp file`);return r}function pc(e){let t=j(e,"test");return Qe(t,["specs"],"test"),t.specs!==void 0&&mn(t.specs,"test.specs"),t}function hc(e,t){let r;try{r=new URL(e)}catch{return $(`${t} must be an https origin`)}return(r.protocol!=="https:"||r.origin!==e)&&$(`${t} must be an https origin without a path`),e}function dc(e){let t=j(e,"permissions");for(let r of Object.keys(t))ic.includes(r)||$(`unknown permission "${r}"`);for(let r of["files","publish"])t[r]!==void 0&&mn(t[r],`permissions.${r}`);return t.fetch!==void 0&&((!Array.isArray(t.fetch)||t.fetch.length>64)&&$("permissions.fetch must be an array of origins"),t.fetch.forEach((r,n)=>hc(r,`permissions.fetch[${n}]`))),t}function mc(e){(typeof e.name!="string"||!Ze.test(e.name))&&$("name must be a lower-case npm package name"),(typeof e.version!="string"||!sc.test(e.version))&&$("version must be a semantic version")}function wc(e){e.format!==ee&&(Number.isInteger(e.format)&&e.format>ee&&$(`format ${e.format} is not supported by this environment (it reads format ${ee}); update the environment`),$(`format must be ${ee}`))}function te(e){j(e,"the manifest"),wc(e),Qe(e,dn,"the manifest"),mc(e);let t=e.entries===void 0?{}:uc(e.entries);return{...e,dependencies:e.dependencies===void 0?{}:cc(e.dependencies),entries:t,providers:e.providers===void 0?{}:fc(e.providers,t),...e.registry===void 0?{}:{registry:ac(e.registry)},...e.scripts===void 0?{}:{scripts:lc(e.scripts)},...e.test===void 0?{}:{test:pc(e.test)},...e.permissions===void 0?{}:{permissions:dc(e.permissions)}}}function tt(e){let t;try{t=JSON.parse(new TextDecoder().decode(e))}catch{return $("not valid JSON")}return{source:t,manifest:te(t)}}function gl(e){return tt(e).manifest}function rt(e){let t={};for(let r of dn)e[r]!==void 0&&(t[r]=e[r]);return JSON.stringify(t,null,2)+` +`}function wn(e){return{format:ee,name:e,version:"0.1.0",dependencies:{}}}function En(e){let r=(String(e??"").split("/").filter(Boolean).pop()??"").toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^[^a-z0-9]+/,"").replace(/-+$/,"");return Ze.test(r)?r:"webfront-app"}async function ye(e){let t=JSON.stringify(Object.entries(e).sort(([n],[s])=>ns?1:0)),r=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(t));return[...new Uint8Array(r)].map(n=>n.toString(16).padStart(2,"0")).join("")}var nt=e=>/^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/.test(e),Re=(e,t)=>`${e.replace("/","+")}@${t}`,st=(e,t,r)=>`${Re(e,t)}-${r.slice(7).replaceAll("+","-").replaceAll("/","_").replaceAll("=","")}`;async function Ec(e,t,{fetchImpl:r,signal:n}){let s=await r(new URL(e.replace("/","%2f"),t),{signal:n});if(!s.ok)throw new Error(`Registry metadata for ${e}: HTTP ${s.status}`);return s.json()}function gc(e,t){let r=e["dist-tags"]?.[t];return r||(xe.default.valid(t)?t:xe.default.maxSatisfying(Object.keys(e.versions??{}),t))}function $c(e,t,r){let n=r||"latest",s=gc(e,n),o=e.versions?.[s];if(!o||!xe.default.valid(s))throw new Error(`Cannot resolve ${t}@${n}`);return{version:s,manifest:o}}async function yc(e,t,r,{fetchImpl:n,signal:s}){let o=new URL(t.dist?.tarball,r);if(o.protocol!=="https:"&&o.origin!==r.origin)throw new Error("Package tarballs must use HTTPS or the registry origin");let i=await n(o,{signal:s});if(!i.ok)throw new Error(`Package download for ${e}: HTTP ${i.status}`);let a=await un(i);return{bytes:a,integrity:await Et(a,t.dist.integrity)}}function ot(e){let t=new URL(e,globalThis.location?.href),r=t.origin===globalThis.location?.origin;if(e.startsWith("/")?!et(e)||!r:t.protocol!=="https:"&&!r)throw new Error(`The npm registry must use HTTPS or the application origin: ${e}`);return t.pathname.endsWith("/")||(t.pathname+="/"),t}async function D(e,t,{registry:r,fetchImpl:n=fetch,signal:s}){if(!nt(e))throw new Error(`Unsupported npm package name: ${e}`);let o=ot(r),i={fetchImpl:n,signal:s},{version:a,manifest:c}=$c(await Ec(e,o,i),e,t),{bytes:l,integrity:u}=await yc(e,c,o,i),f=await fn(l),m=pn(f,e,a);return{id:Re(e,a),key:st(e,a,u),manifest:m,integrity:u,files:f}}var Oe=z(C(),1);function xc(e,t,r){let n=e?.roots?.[t];return n?.requested===r&&e.packages[n.id]?e.packages[n.id]:Oe.default.validRange(r)?Object.values(e?.packages??{}).filter(o=>o.name===t&&Oe.default.satisfies(o.version,r)).sort((o,i)=>Oe.default.rcompare(o.version,i.version))[0]??null:null}function gn({registry:e="https://registry.npmjs.org/",fetchImpl:t=fetch,signal:r,download:n=D,previous:s}){let o=new Map;return async(i,a)=>{let c=`${i}@${a}`;if(o.has(c))return o.get(c);let l=xc(s,i,a),u=await n(i,l?.version??a,{registry:e,fetchImpl:t,signal:r});if(l&&u.integrity!==l.integrity)throw new Error(`${u.id} no longer matches the integrity recorded in the lock`);return o.set(c,u),u}}var $n=z(C(),1),yn=(e,t,r)=>new Error(`${e.name}@${e.version} requires peer ${t}@${r}; install a compatible root explicitly`);function Rc(e,t,r){if(e.manifest.peerDependenciesMeta?.[t]?.optional)return null;throw yn(e,t,r)}function Oc(e,[t,r],{nodes:n,roots:s}){let o=s[t]?.id??e.dependencies[t];if(!o)return Rc(e,t,r);if(!$n.default.satisfies(n[o].version,r))throw yn(e,t,r);return o}function bc(e,t){for(let r of Object.entries(e.manifest.peerDependencies??{})){let n=Oc(e,r,t);n&&(e.dependencies[r[0]]=n)}}function xn(e,t){for(let r of Object.values(e))bc(r,{nodes:e,roots:t})}var Rn=z(C(),1);function Ic(e,t){return!nt(t.name)||!Rn.default.valid(t.version)?!1:e===Re(t.name,t.version)}function vc(e){return e.integrity?.startsWith("sha512-")?e.key===st(e.name,e.version,e.integrity):!1}function kc(e,t,r){if(!Ic(t,r)||!vc(r))throw new Error("Invalid locked package");for(let n of r.files)A(n);if(Object.values(r.dependencies).some(n=>!e.packages[n]))throw new Error("Dangling locked dependency")}function Sc(e){return e?.format!==1?!1:!!e.roots&&!!e.packages}function it(e){if(!Sc(e))throw new Error("Unsupported package lock");if(Object.keys(e.packages).length>512)throw new Error("The package lock exceeds 512 packages");for(let[t,r]of Object.entries(e.packages))kc(e,t,r);if(Object.values(e.roots).some(t=>!e.packages[t.id]))throw new Error("Dangling locked root");return e}function Nc(e,t,r){if(Object.keys(e.nodes).length>=512)throw new Error("Dependency graph exceeds 512 packages");for(let n of r.files.values())e.total+=n.length;if(e.total>256*1024*1024)throw new Error("Dependency graph exceeds 256 MiB");e.nodes[r.id]={name:t,version:r.manifest.version,integrity:r.integrity,key:r.key,manifest:r.manifest,files:[...r.files.keys()].sort(),dependencies:{}},e.downloads.set(r.id,r.files)}async function Lc(e,t){let r={};for(let n of e){let{name:s,version:o}=ie(n);r[s]={requested:o||"latest",id:await t(s,o||"latest")}}return r}async function On(e,t={}){let r=gn(t),n={nodes:{},downloads:new Map,total:0},s=async(i,a)=>{t.signal?.throwIfAborted();let c=await r(i,a);if(n.nodes[c.id])return c.id;Nc(n,i,c);for(let[l,u]of Object.entries(c.manifest.dependencies??{}).sort())n.nodes[c.id].dependencies[l]=await s(l,u);return c.id},o=await Lc(e,s);return xn(n.nodes,o),{lock:{format:1,registry:t.registry??"https://registry.npmjs.org/",roots:o,packages:n.nodes},downloads:n.downloads}}var ct=z(C(),1);var Ac=new TextDecoder,Tc=new TextEncoder,be="No webfront.project.json: run wf init",Ie="The lock does not match the dependencies of webfront.project.json; run wf install --update to resolve them again";async function bn(e,t){try{return await G(e,t)}catch(r){if(r.message.includes("Cannot read project file:"))return null;throw r}}function Pc(e,t,r){return t?r===t.requested?!0:ct.default.validRange(r)!==null&&ct.default.satisfies(e.packages[t.id].version,r):!1}function jc(e,t){let r=Object.keys(t);return r.length===Object.keys(e.roots).length&&r.every(n=>Pc(e,e.roots[n],t[n]))}function qc(e,t,r){return e?t?t.manifestDigest===void 0?jc(t,e.dependencies)?"legacy":"desynchronized":t.manifestDigest===r?"consistent":"desynchronized":"unlocked":"no-manifest"}async function re(e){let t=await x(e,"state",`${R} +${S}`),r=await bn(e,R),n=await bn(e,S),{source:s,manifest:o}=r?tt(r):{source:null,manifest:null},i=n?it(JSON.parse(Ac.decode(n))):null,a=o?await ye(o.dependencies):null;return{manifest:o,source:s,lock:i,token:t,status:qc(o,i,a),digest:a}}var vn=e=>e.status==="desynchronized"?`Warning: ${Ie}.\r +`:"";async function kn(e,t,r,{signal:n}={}){let s=[];try{for(let[o,i]of t){n?.throwIfAborted();let a=await x(e,"begin",o,!1);s.push(a),await K(e,{id:a,path:"output",bytes:i},n)}n?.throwIfAborted(),await x(e,"commitGroup",s.join(` `),`${R} -${S}`,r.token)}catch(o){for(let i of s)await x(e,"abort",i).catch(()=>{});throw o}}function vn(e,t,r){let n=e?.entries??{};if(t!==void 0)return Object.hasOwn(n,t)?n[t]:t;if(Object.hasOwn(n,"main"))return n.main;let s=Object.keys(n);if(s.length===1)return n[s[0]];throw new Error(`Usage: ${r} (declare entries.main in ${R} to omit the entry)`)}function Gl(e,[t,r,n,...s]){if(t&&Object.hasOwn(e?.providers??{},t)&&r===void 0){let i=e.providers[t];return{entry:vn(e,i.entry),output:i.output,className:t}}if(!t||r!=="--output"||s.length||!n?.endsWith(".hpp"))throw new Error("wf embed requires or --output ");let o=n.split("/").pop().slice(0,-4);if(!Ke.test(o))throw new Error(`wf embed: ${o} is not a C++ class name; name the output .hpp`);return{entry:vn(e,t),output:n,className:o}}var Ie=e=>Aa.encode(e);var pt=F(C(),1);var Sn=e=>`${M}/${e.key}`,Nn=e=>`${M}/${e.key}.json`,Da=new TextEncoder,Ua=new TextDecoder,Ln=e=>e.message.includes("Cannot read project file:");async function Tn(e){return[...new Uint8Array(await crypto.subtle.digest("SHA-256",e))].map(r=>r.toString(16).padStart(2,"0")).join("")}async function ke(e,t,r,{signal:n}={}){let s={};for(let i of[...r.keys()].sort())s[i]=await Tn(r.get(i));await Q(e,Sn(t),r,{signal:n});let o=JSON.stringify({format:1,integrity:t.integrity,files:s},null,2)+` -`;await Q(e,Nn(t),new Map([["output",Da.encode(o)]]),{directory:!1,signal:n})}async function Fa(e,t){let r;try{r=await G(e,Nn(t))}catch(n){if(Ln(n))return null;throw n}try{return JSON.parse(Ua.decode(r))}catch{return{}}}var za=(e,t)=>Object.keys(e.files).sort().join(` +${S}`,r.token)}catch(o){for(let i of s)await x(e,"abort",i).catch(()=>{});throw o}}function In(e,t,r){let n=e?.entries??{};if(t!==void 0)return Object.hasOwn(n,t)?n[t]:t;if(Object.hasOwn(n,"main"))return n.main;let s=Object.keys(n);if(s.length===1)return n[s[0]];throw new Error(`Usage: ${r} (declare entries.main in ${R} to omit the entry)`)}function Gl(e,[t,r,n,...s]){if(t&&Object.hasOwn(e?.providers??{},t)&&r===void 0){let i=e.providers[t];return{entry:In(e,i.entry),output:i.output,className:t}}if(!t||r!=="--output"||s.length||!n?.endsWith(".hpp"))throw new Error("wf embed requires or --output ");let o=n.split("/").pop().slice(0,-4);if(!Ke.test(o))throw new Error(`wf embed: ${o} is not a C++ class name; name the output .hpp`);return{entry:In(e,t),output:n,className:o}}var ve=e=>Tc.encode(e);var pt=z(C(),1);var Sn=e=>`${M}/${e.key}`,Nn=e=>`${M}/${e.key}.json`,Dc=new TextEncoder,Uc=new TextDecoder,Ln=e=>e.message.includes("Cannot read project file:");async function An(e){return[...new Uint8Array(await crypto.subtle.digest("SHA-256",e))].map(r=>r.toString(16).padStart(2,"0")).join("")}async function ke(e,t,r,{signal:n}={}){let s={};for(let i of[...r.keys()].sort())s[i]=await An(r.get(i));await Q(e,Sn(t),r,{signal:n});let o=JSON.stringify({format:1,integrity:t.integrity,files:s},null,2)+` +`;await Q(e,Nn(t),new Map([["output",Dc.encode(o)]]),{directory:!1,signal:n})}async function zc(e,t){let r;try{r=await G(e,Nn(t))}catch(n){if(Ln(n))return null;throw n}try{return JSON.parse(Uc.decode(r))}catch{return{}}}var Fc=(e,t)=>Object.keys(e.files).sort().join(` `)===[...t.files].sort().join(` -`);async function Ga(e,t,r){let n=[],s=0;for(;;){let o;try{o=await x(e,"read",t,s)}catch(i){if(Ln(i))return null;throw i}if(s+=o.length,s>r)return null;if(n.push(o),o.length<262144)return new Uint8Array(await new Blob(n).arrayBuffer())}}async function ct(e,t,{signal:r,limit:n=1/0}={}){let s=await Fa(e,t);if(!s)return{state:"missing",size:0};if(s.integrity!==t.integrity||!W(s.files)||!za(s,t))return{state:"corrupted",size:0};let o=0;for(let i of t.files){r?.throwIfAborted();let c=await Ga(e,`${Sn(t)}/${i}`,n-o);if(!c||await Tn(c)!==s.files[i])return{state:"corrupted",size:0};o+=c.length}return{state:"valid",size:o}}var Vl=async(e,t,r)=>(await ct(e,t,r)).state;var Ma="https://registry.npmjs.org/";function Wa({registry:e,registryExplicit:t}={},r){return t&&e?{url:e,source:"application option"}:r?.registry?{url:r.registry,source:R}:{url:e||Ma,source:"default"}}function lt(e,t){let r=Wa(e,t);return ot(r.url),r}var ut=({url:e,source:t})=>`Registry: ${e} (${t})`,_a=256*1024*1024,Ba=e=>[...e.values()].reduce((t,r)=>t+r.length,0),Xa=e=>new Error(`The locked packages exceed ${e/(1024*1024)} MiB unpacked`);async function Va(e,t,{signal:r,limit:n}){let s=[],o=0;for(let[i,c]of Object.entries(t.packages)){r?.throwIfAborted();let a=await ct(e,c,{signal:r,limit:n-o});o+=a.size,s.push({id:i,node:c,state:a.state})}return{states:s,size:o}}async function ft(e,t,{registry:r,offline:n=!1,signal:s,progress:o=()=>{},fetchImpl:i=fetch,limit:c=_a}){let{states:a,size:l}=await Va(e,t,{signal:s,limit:c}),u=l,f={verified:a.filter(({state:m})=>m==="valid").length,restored:0,problems:[]};for(let{id:m,node:d,state:A}of a.filter(({state:k})=>k!=="valid")){if(n){f.problems.push(`${m} (${A})`);continue}o(`Restoring ${m}${A==="corrupted"?" (corrupted in the cache)":""}`);let k=await D(d.name,d.version,{registry:r,fetchImpl:i,signal:s});if(k.integrity!==d.integrity)throw new Error(`${m} no longer matches the integrity recorded in the lock`);if(u+=Ba(k.files),u>c)throw Xa(c);await ke(e,d,k.files,{signal:s}),f.restored++}if(f.problems.length)throw new Error(`The cache does not match ${S}; missing or corrupted, nothing downloaded:\r +`);async function Gc(e,t,r){let n=[],s=0;for(;;){let o;try{o=await x(e,"read",t,s)}catch(i){if(Ln(i))return null;throw i}if(s+=o.length,s>r)return null;if(n.push(o),o.length<262144)return new Uint8Array(await new Blob(n).arrayBuffer())}}async function at(e,t,{signal:r,limit:n=1/0}={}){let s=await zc(e,t);if(!s)return{state:"missing",size:0};if(s.integrity!==t.integrity||!W(s.files)||!Fc(s,t))return{state:"corrupted",size:0};let o=0;for(let i of t.files){r?.throwIfAborted();let a=await Gc(e,`${Sn(t)}/${i}`,n-o);if(!a||await An(a)!==s.files[i])return{state:"corrupted",size:0};o+=a.length}return{state:"valid",size:o}}var Vl=async(e,t,r)=>(await at(e,t,r)).state;var Mc="https://registry.npmjs.org/";function Wc({registry:e,registryExplicit:t}={},r){return t&&e?{url:e,source:"application option"}:r?.registry?{url:r.registry,source:R}:{url:e||Mc,source:"default"}}function lt(e,t){let r=Wc(e,t);return ot(r.url),r}var ut=({url:e,source:t})=>`Registry: ${e} (${t})`,_c=256*1024*1024,Xc=e=>[...e.values()].reduce((t,r)=>t+r.length,0),Bc=e=>new Error(`The locked packages exceed ${e/(1024*1024)} MiB unpacked`);async function Vc(e,t,{signal:r,limit:n}){let s=[],o=0;for(let[i,a]of Object.entries(t.packages)){r?.throwIfAborted();let c=await at(e,a,{signal:r,limit:n-o});o+=c.size,s.push({id:i,node:a,state:c.state})}return{states:s,size:o}}async function ft(e,t,{registry:r,offline:n=!1,signal:s,progress:o=()=>{},fetchImpl:i=fetch,limit:a=_c}){let{states:c,size:l}=await Vc(e,t,{signal:s,limit:a}),u=l,f={verified:c.filter(({state:m})=>m==="valid").length,restored:0,problems:[]};for(let{id:m,node:d,state:T}of c.filter(({state:k})=>k!=="valid")){if(n){f.problems.push(`${m} (${T})`);continue}o(`Restoring ${m}${T==="corrupted"?" (corrupted in the cache)":""}`);let k=await D(d.name,d.version,{registry:r,fetchImpl:i,signal:s});if(k.integrity!==d.integrity)throw new Error(`${m} no longer matches the integrity recorded in the lock`);if(u+=Xc(k.files),u>a)throw Bc(a);await ke(e,d,k.files,{signal:s}),f.restored++}if(f.problems.length)throw new Error(`The cache does not match ${S}; missing or corrupted, nothing downloaded:\r ${f.problems.join(`\r `)}\r -Run wf restore to download them.`);return f}function Ha(e){let t=e.includes("--offline");if(e.some(r=>r!=="--offline"))throw new Error("Usage: wf restore [--offline]");return{offline:t}}async function Ql(e,t,{registry:r,registryExplicit:n,signal:s,progress:o=()=>{},fetchImpl:i=fetch}={}){let{offline:c}=Ha(t),a=await re(e);if(!a.manifest)throw new Error(Oe);if(!a.lock)throw new Error(`No ${S}: run wf install to resolve the dependencies`);let l=c?null:lt({registry:r,registryExplicit:n},a.manifest);o(c?"Offline: no registry is contacted":ut(l));let u=await ft(e,a.lock,{registry:l?.url,offline:c,signal:s,progress:o,fetchImpl:i}),f=Object.keys(a.lock.packages).length,m=c?`Cache verified offline: ${f} packages match ${S}.`:`Restored ${u.restored} of ${f} packages (${u.verified} already in the cache). Lock: ${S}`;return{...u,registry:l,text:In(a)+m}}var Pn=e=>{let{name:t,version:r}=ie(e);return[t,r||void 0]};function Ja(e,t){let{version:r}=e.packages[t.id];return!(pt.default.valid(t.requested)!==null)&&t.requested!=="latest"&&pt.default.validRange(t.requested)!==null?t.requested:`^${r}`}async function cu(e,[t,...r],{signal:n}={}){if(r.length)throw new Error("Usage: wf init [name]");let{lock:s}=await re(e),o=wn(t??En(""));s&&(o.dependencies=Object.fromEntries(Object.entries(s.roots).map(([c,a])=>[c,Ja(s,a)]))),te(o),await Q(e,R,new Map([["output",Ie(rt(o))]]),{directory:!1,replace:!1,signal:n});let i=s?` with the ${Object.keys(o.dependencies).length} dependencies of ${S}`:"";return`Created ${R}${i}. Add libraries with wf install .`}function Ya(e,t){let r={...e.manifest.dependencies},n=new Set;for(let s of t){let[o,i]=Pn(s);r[o]=i??"latest",i&&i!=="latest"&&n.add(o)}return te({...e.source,dependencies:r}),{dependencies:r,explicit:n}}function Za(e,t){let r={...e.source,dependencies:t};return te(r),r}function Ka({dependencies:e,explicit:t},r,n){let s={...e};for(let o of n){let i=Pn(o)[0];t.has(i)||(s[i]=`^${r.packages[r.roots[i].id].version}`)}return s}async function Qa(e,t,r){let n=Object.entries(e).map(([i,c])=>`${i}@${c}`),{lock:s,downloads:o}=await bn(n,{registry:r.registry,signal:r.signal,fetchImpl:r.fetchImpl,previous:t,download:async(...i)=>(r.progress(`Resolving ${i[0]}@${i[1]}`),D(...i))});return{lock:s,downloads:o}}async function ec(e,t,r,{signal:n,progress:s}){for(let[o,i]of r)s(`Storing ${o}`),await ke(e,t.packages[o],i,{signal:n})}function tc(e){let t=e.includes("--update"),r=e.filter(n=>n!=="--update");if(r.some(n=>n.startsWith("-")))throw new Error("Usage: wf install [--update] [[@range] ...]");return{update:t,specs:r}}async function An(e,t,{manifest:r,lock:n},s){let o=new Map([[S,Ie(JSON.stringify(n,null,2)+` -`)]]);r&&o.set(R,Ie(rt(r))),await kn(e,o,t,s)}var jn=async(e,t)=>({format:e.format,manifestDigest:await ye(t),...e});async function lu(e,t,{registry:r,registryExplicit:n,signal:s,progress:o=()=>{},fetchImpl:i=fetch}){let{update:c,specs:a}=tc(t),l=await re(e);if(!l.manifest)throw new Error(Oe);let u=lt({registry:r,registryExplicit:n},l.manifest),f={registry:u.url,signal:s,fetchImpl:i,progress:o};if(a.length&&c)throw new Error("Usage: wf install --update does not take packages");if(a.length&&l.status==="desynchronized")throw new Error(ve);if(!a.length&&!c&&l.status==="desynchronized")throw new Error(ve);o(ut(u));let m=l.status==="consistent"||l.status==="legacy";if(!a.length&&!c&&m){let{restored:U}=await ft(e,l.lock,f);if(l.status==="consistent")return{lock:l.lock,restored:U,registry:u};let oe=await jn(l.lock,l.manifest.dependencies);return await An(e,l,{manifest:null,lock:oe},{signal:s}),{lock:oe,restored:U,registry:u}}let d=Ya(l,a),A=m&&!c?l.lock:void 0,k=await Qa(d.dependencies,A,f),Le=Ka(d,k.lock,a);await ec(e,k.lock,k.downloads,{signal:s,progress:o});let se=await jn(k.lock,Le),y=a.length?Za(l,Le):null;return await An(e,l,{manifest:y,lock:se},{signal:s}),{lock:se,restored:0,registry:u}}var rc=[R,S,".webfront"],ne=(e,t)=>e===t||e.startsWith(t+"/");function ht(e){try{return T(e)}catch{throw new Error(`Not a project-relative path: ${e}`)}}var Se=(e,t,r)=>new Error(`Permission denied: ${e} ${t} is not granted by permissions.${r} in ${R}`);function qn(e,t){let r=ht(t);if(![...e?.files??[],...e?.publish??[]].some(s=>ne(r,s)))throw Se("reading",t,"files");return r}function Cn(e,t){let r=t===""||t==="."?"":ht(t),n=[...e?.files??[],...e?.publish??[]];if(r&&n.some(o=>ne(r,o)))return{path:r,keep:()=>!0};let s=o=>n.some(i=>ne(o,i)||i.startsWith(o+"/"));if(!n.some(o=>r===""||o.startsWith(r+"/")))throw Se("listing",r||"the project root","files");return{path:r,keep:o=>s(r?`${r}/${o.replace(/\/$/,"")}`:o.replace(/\/$/,""))}}function Dn(e,t){let r=ht(t);if(rc.some(n=>ne(r,n)))throw new Error(`Permission denied: ${t} is managed by wf and never written by a script`);if(!(e?.publish??[]).some(n=>ne(r,n)))throw Se("writing",t,"publish");return r}function hu(e,t,r){let n=new URL(t,r);if(!(e?.fetch??[]).includes(n.origin))throw Se("fetching",n.origin,"fetch");return n}var nc=2e3,Fn=600,Ne=[1,3600],Un=4,dt=class extends Error{constructor(t,r){super(t),this.exitCode=r}},$u=(e,t=1/0,r=Date.now())=>Math.min(r+e*1e3,t),yu=(e,t=Date.now())=>Math.max(0,(e-t)/1e3);function xu(e,t){let r=Fn,n=e;if(n[0]==="--timeout"){if(r=Number(n[1]),!Number.isInteger(r)||rNe[1])throw new Error(`--timeout expects whole seconds from ${Ne[0]} to ${Ne[1]}`);n=n.slice(2)}if(!n.length||n[0].startsWith("-"))throw new Error(`Usage: ${t}`);return{timeout:r,target:n[0],args:n.slice(1)}}function Ru(e,t,r,n,s=0){let o=e?.scripts??{};if(!Object.hasOwn(o,t)){let a=Object.keys(o).sort().join(", ")||"none";throw new Error(`No script "${t}" in ${R} (scripts: ${a})`)}let[i,...c]=n(o[t]);if(i==="wf"){if(s>=Un)throw new Error(`Scripts call wf more than ${Un} levels deep`);return{kind:"wf",argv:[...c,...r]}}return{kind:"module",entry:{namespace:"project",path:T(i)},args:[...c,...r]}}function zn(e,t){if(e?.roots&&Object.hasOwn(e.roots,t)){let{id:n}=e.roots[t];return[n,e.packages[n]]}let r=Object.entries(e?.packages??{}).filter(([,n])=>n.name===t);if(r.length>1)throw new Error(`${t} is locked at several versions; install it as a root to choose one`);return r[0]??null}function sc(e,t){let r=t.webfront?.bin;if(typeof r=="string")return{[t.name.split("/").pop()]:r};if(r&&typeof r=="object"&&!Array.isArray(r))return r;throw t.bin?new Error(`${e} only declares an npm "bin" (a Node.js program); wf exec runs only "webfront.bin" entries`):new Error(`${e} has no WebFront executable entry ("webfront.bin" in its package.json)`)}function bu(e,t){let r=t.indexOf(":",t.startsWith("@")?t.indexOf("/"):0),[n,s]=r<0?[t,void 0]:[t.slice(0,r),t.slice(r+1)],o=zn(e,n);if(!o)throw new Error(`${n} is not installed: run wf install ${n}`);let[i,c]=o,a=sc(i,c.manifest),l=Object.keys(a),u=s??(l.length===1?l[0]:void 0);if(!u||!Object.hasOwn(a,u))throw new Error(`${i} has the WebFront entries ${l.join(", ")||"none"}: run wf exec ${n}:`);let f=String(a[u]).replace(/^\.\//,"");if(!c.files.includes(T(f)))throw new Error(`${i}: webfront.bin entry ${u} names a missing file ${f}`);return{id:i,name:u,entry:{namespace:"npm",path:`${i}/${f}`}}}var oc=new TextDecoder;function Ou({bridge:e,permissions:t,lock:r}){let n=new AbortController,s=[],o=new Set;async function i(a,l){let u=Dn(t,a);if(!(l instanceof Uint8Array))throw new TypeError("context.project.write expects a string or a Uint8Array");let f={path:u,state:"staging"};s.push(f);let m=null;try{m=await x(e,"begin",u,!1),await K(e,{id:m,path:"output",bytes:l},n.signal),n.signal.throwIfAborted(),f.state="committing",await x(e,"commit",m),f.state="applied"}catch(d){let A=n.signal.aborted&&f.state!=="committing";throw f.state=A?"abandoned":"failed",m!==null&&await x(e,"abort",m).catch(()=>{}),d}}let c={read:a=>G(e,qn(t,a)),list:async(a="")=>{let{path:l,keep:u}=Cn(t,a);return JSON.parse(oc.decode(await x(e,"list",l))).filter(u)},write:i,resolve:a=>{let l=zn(r,a)?.[1];return l?{name:l.name,version:l.version,integrity:l.integrity}:null}};return{publications:s,async handle({operation:a,args:l}){if(n.signal.aborted)throw new Error("The script was stopped");if(!Object.hasOwn(c,a))throw new Error(`Unknown context operation: ${a}`);let u=c[a](...l);o.add(u);try{return await u}finally{o.delete(u)}},async finish(){for(let a of s)(a.state==="staging"||a.state==="committing")&&(a.unawaited=!0);for(;o.size;)await Promise.allSettled([...o]);await this.stop()},async stop(){n.abort(new Error("The script was stopped")),await Promise.allSettled([...o])}}}function vu({createWorker:e,host:t,message:r,signal:n,timeout:s=Fn,grace:o=nc,write:i}){return new Promise(c=>{let a=e(),l=[],u=null,f=!1,m=()=>u==="timeout"?124:130,d=y=>{f||(f=!0,a.terminate(),l.forEach(clearTimeout),n?.removeEventListener("abort",k),c({reason:u??"exit",...y}))},A=y=>{u||f||(u=y,a.postMessage({type:"abort"}),l.push(setTimeout(()=>d({code:m(),forced:o}),o)))},k=()=>A("interrupted"),se={console:y=>i(String(y.text).replace(/\r?\n/g,`\r +Run wf restore to download them.`);return f}function Hc(e){let t=e.includes("--offline");if(e.some(r=>r!=="--offline"))throw new Error("Usage: wf restore [--offline]");return{offline:t}}async function Ql(e,t,{registry:r,registryExplicit:n,signal:s,progress:o=()=>{},fetchImpl:i=fetch}={}){let{offline:a}=Hc(t),c=await re(e);if(!c.manifest)throw new Error(be);if(!c.lock)throw new Error(`No ${S}: run wf install to resolve the dependencies`);let l=a?null:lt({registry:r,registryExplicit:n},c.manifest);o(a?"Offline: no registry is contacted":ut(l));let u=await ft(e,c.lock,{registry:l?.url,offline:a,signal:s,progress:o,fetchImpl:i}),f=Object.keys(c.lock.packages).length,m=a?`Cache verified offline: ${f} packages match ${S}.`:`Restored ${u.restored} of ${f} packages (${u.verified} already in the cache). Lock: ${S}`;return{...u,registry:l,text:vn(c)+m}}var jn=e=>{let{name:t,version:r}=ie(e);return[t,r||void 0]};function Yc(e,t){let{version:r}=e.packages[t.id];return!(pt.default.valid(t.requested)!==null)&&t.requested!=="latest"&&pt.default.validRange(t.requested)!==null?t.requested:`^${r}`}async function au(e,[t,...r],{signal:n}={}){if(r.length)throw new Error("Usage: wf init [name]");let{lock:s}=await re(e),o=wn(t??En(""));s&&(o.dependencies=Object.fromEntries(Object.entries(s.roots).map(([a,c])=>[a,Yc(s,c)]))),te(o),await Q(e,R,new Map([["output",ve(rt(o))]]),{directory:!1,replace:!1,signal:n});let i=s?` with the ${Object.keys(o.dependencies).length} dependencies of ${S}`:"";return`Created ${R}${i}. Add libraries with wf install .`}function Jc(e,t){let r={...e.manifest.dependencies},n=new Set;for(let s of t){let[o,i]=jn(s);r[o]=i??"latest",i&&i!=="latest"&&n.add(o)}return te({...e.source,dependencies:r}),{dependencies:r,explicit:n}}function Zc(e,t){let r={...e.source,dependencies:t};return te(r),r}function Kc({dependencies:e,explicit:t},r,n){let s={...e};for(let o of n){let i=jn(o)[0];t.has(i)||(s[i]=`^${r.packages[r.roots[i].id].version}`)}return s}async function Qc(e,t,r){let n=Object.entries(e).map(([i,a])=>`${i}@${a}`),{lock:s,downloads:o}=await On(n,{registry:r.registry,signal:r.signal,fetchImpl:r.fetchImpl,previous:t,download:async(...i)=>(r.progress(`Resolving ${i[0]}@${i[1]}`),D(...i))});return{lock:s,downloads:o}}async function ea(e,t,r,{signal:n,progress:s}){for(let[o,i]of r)s(`Storing ${o}`),await ke(e,t.packages[o],i,{signal:n})}function ta(e){let t=e.includes("--update"),r=e.filter(n=>n!=="--update");if(r.some(n=>n.startsWith("-")))throw new Error("Usage: wf install [--update] [[@range] ...]");return{update:t,specs:r}}async function Tn(e,t,{manifest:r,lock:n},s){let o=new Map([[S,ve(JSON.stringify(n,null,2)+` +`)]]);r&&o.set(R,ve(rt(r))),await kn(e,o,t,s)}var Pn=async(e,t)=>({format:e.format,manifestDigest:await ye(t),...e});async function lu(e,t,{registry:r,registryExplicit:n,signal:s,progress:o=()=>{},fetchImpl:i=fetch}){let{update:a,specs:c}=ta(t),l=await re(e);if(!l.manifest)throw new Error(be);let u=lt({registry:r,registryExplicit:n},l.manifest),f={registry:u.url,signal:s,fetchImpl:i,progress:o};if(c.length&&a)throw new Error("Usage: wf install --update does not take packages");if(c.length&&l.status==="desynchronized")throw new Error(Ie);if(!c.length&&!a&&l.status==="desynchronized")throw new Error(Ie);o(ut(u));let m=l.status==="consistent"||l.status==="legacy";if(!c.length&&!a&&m){let{restored:U}=await ft(e,l.lock,f);if(l.status==="consistent")return{lock:l.lock,restored:U,registry:u};let oe=await Pn(l.lock,l.manifest.dependencies);return await Tn(e,l,{manifest:null,lock:oe},{signal:s}),{lock:oe,restored:U,registry:u}}let d=Jc(l,c),T=m&&!a?l.lock:void 0,k=await Qc(d.dependencies,T,f),Le=Kc(d,k.lock,c);await ea(e,k.lock,k.downloads,{signal:s,progress:o});let se=await Pn(k.lock,Le),y=c.length?Zc(l,Le):null;return await Tn(e,l,{manifest:y,lock:se},{signal:s}),{lock:se,restored:0,registry:u}}var ra=[R,S,".webfront"],ne=(e,t)=>e===t||e.startsWith(t+"/");function ht(e){try{return A(e)}catch{throw new Error(`Not a project-relative path: ${e}`)}}var Se=(e,t,r)=>new Error(`Permission denied: ${e} ${t} is not granted by permissions.${r} in ${R}`);function qn(e,t){let r=ht(t);if(![...e?.files??[],...e?.publish??[]].some(s=>ne(r,s)))throw Se("reading",t,"files");return r}function Cn(e,t){let r=t===""||t==="."?"":ht(t),n=[...e?.files??[],...e?.publish??[]];if(r&&n.some(o=>ne(r,o)))return{path:r,keep:()=>!0};let s=o=>n.some(i=>ne(o,i)||i.startsWith(o+"/"));if(!n.some(o=>r===""||o.startsWith(r+"/")))throw Se("listing",r||"the project root","files");return{path:r,keep:o=>s(r?`${r}/${o.replace(/\/$/,"")}`:o.replace(/\/$/,""))}}function Dn(e,t){let r=ht(t);if(ra.some(n=>ne(r,n)))throw new Error(`Permission denied: ${t} is managed by wf and never written by a script`);if(!(e?.publish??[]).some(n=>ne(r,n)))throw Se("writing",t,"publish");return r}function hu(e,t,r){let n=new URL(t,r);if(!(e?.fetch??[]).includes(n.origin))throw Se("fetching",n.origin,"fetch");return n}var na=2e3,zn=600,Ne=[1,3600],Un=4,dt=class extends Error{constructor(t,r){super(t),this.exitCode=r}},$u=(e,t=1/0,r=Date.now())=>Math.min(r+e*1e3,t),yu=(e,t=Date.now())=>Math.max(0,(e-t)/1e3);function xu(e,t){let r=zn,n=e;if(n[0]==="--timeout"){if(r=Number(n[1]),!Number.isInteger(r)||rNe[1])throw new Error(`--timeout expects whole seconds from ${Ne[0]} to ${Ne[1]}`);n=n.slice(2)}if(!n.length||n[0].startsWith("-"))throw new Error(`Usage: ${t}`);return{timeout:r,target:n[0],args:n.slice(1)}}function Ru(e,t,r,n,s=0){let o=e?.scripts??{};if(!Object.hasOwn(o,t)){let c=Object.keys(o).sort().join(", ")||"none";throw new Error(`No script "${t}" in ${R} (scripts: ${c})`)}let[i,...a]=n(o[t]);if(i==="wf"){if(s>=Un)throw new Error(`Scripts call wf more than ${Un} levels deep`);return{kind:"wf",argv:[...a,...r]}}return{kind:"module",entry:{namespace:"project",path:A(i)},args:[...a,...r]}}function Fn(e,t){if(e?.roots&&Object.hasOwn(e.roots,t)){let{id:n}=e.roots[t];return[n,e.packages[n]]}let r=Object.entries(e?.packages??{}).filter(([,n])=>n.name===t);if(r.length>1)throw new Error(`${t} is locked at several versions; install it as a root to choose one`);return r[0]??null}function sa(e,t){let r=t.webfront?.bin;if(typeof r=="string")return{[t.name.split("/").pop()]:r};if(r&&typeof r=="object"&&!Array.isArray(r))return r;throw t.bin?new Error(`${e} only declares an npm "bin" (a Node.js program); wf exec runs only "webfront.bin" entries`):new Error(`${e} has no WebFront executable entry ("webfront.bin" in its package.json)`)}function Ou(e,t){let r=t.indexOf(":",t.startsWith("@")?t.indexOf("/"):0),[n,s]=r<0?[t,void 0]:[t.slice(0,r),t.slice(r+1)],o=Fn(e,n);if(!o)throw new Error(`${n} is not installed: run wf install ${n}`);let[i,a]=o,c=sa(i,a.manifest),l=Object.keys(c),u=s??(l.length===1?l[0]:void 0);if(!u||!Object.hasOwn(c,u))throw new Error(`${i} has the WebFront entries ${l.join(", ")||"none"}: run wf exec ${n}:`);let f=String(c[u]).replace(/^\.\//,"");if(!a.files.includes(A(f)))throw new Error(`${i}: webfront.bin entry ${u} names a missing file ${f}`);return{id:i,name:u,entry:{namespace:"npm",path:`${i}/${f}`}}}var oa=new TextDecoder;function bu({bridge:e,permissions:t,lock:r}){let n=new AbortController,s=[],o=new Set;async function i(c,l){let u=Dn(t,c);if(!(l instanceof Uint8Array))throw new TypeError("context.project.write expects a string or a Uint8Array");let f={path:u,state:"staging"};s.push(f);let m=null;try{m=await x(e,"begin",u,!1),await K(e,{id:m,path:"output",bytes:l},n.signal),n.signal.throwIfAborted(),f.state="committing",await x(e,"commit",m),f.state="applied"}catch(d){let T=n.signal.aborted&&f.state!=="committing";throw f.state=T?"abandoned":"failed",m!==null&&await x(e,"abort",m).catch(()=>{}),d}}let a={read:c=>G(e,qn(t,c)),list:async(c="")=>{let{path:l,keep:u}=Cn(t,c);return JSON.parse(oa.decode(await x(e,"list",l))).filter(u)},write:i,resolve:c=>{let l=Fn(r,c)?.[1];return l?{name:l.name,version:l.version,integrity:l.integrity}:null}};return{publications:s,async handle({operation:c,args:l}){if(n.signal.aborted)throw new Error("The script was stopped");if(!Object.hasOwn(a,c))throw new Error(`Unknown context operation: ${c}`);let u=a[c](...l);o.add(u);try{return await u}finally{o.delete(u)}},async finish(){for(let c of s)(c.state==="staging"||c.state==="committing")&&(c.unawaited=!0);for(;o.size;)await Promise.allSettled([...o]);await this.stop()},async stop(){n.abort(new Error("The script was stopped")),await Promise.allSettled([...o])}}}function Iu({createWorker:e,host:t,message:r,signal:n,timeout:s=zn,grace:o=na,write:i}){return new Promise(a=>{let c=e(),l=[],u=null,f=!1,m=()=>u==="timeout"?124:130,d=y=>{f||(f=!0,c.terminate(),l.forEach(clearTimeout),n?.removeEventListener("abort",k),a({reason:u??"exit",...y}))},T=y=>{u||f||(u=y,c.postMessage({type:"abort"}),l.push(setTimeout(()=>d({code:m(),forced:o}),o)))},k=()=>T("interrupted"),se={console:y=>i(String(y.text).replace(/\r?\n/g,`\r `)+`\r -`,y.stream),exit:y=>d({code:u&&y.code===0?m():y.code}),error:y=>d({code:u?m():1,error:y.error}),call:async y=>{let U;try{U={value:await t.handle(y)}}catch(oe){U={error:oe.message}}f||a.postMessage({type:"reply",id:y.id,...U})}};a.onmessage=({data:y})=>se[y?.type]?.(y),a.onerror=y=>{y.preventDefault?.(),d({code:1,error:y.message||"The script Worker failed"})},n?.addEventListener("abort",k,{once:!0}),l.push(setTimeout(()=>A("timeout"),s*1e3)),a.postMessage({type:"run",...r}),n?.aborted&&k()})}function ic(e,t){let r=t?e:e.filter(o=>o.unawaited),n=o=>r.filter(i=>i.state===o).map(({path:i})=>i),s=[];return t&&n("applied").length&&s.push(`Applied before the stop: ${n("applied").join(", ")}`),n("abandoned").length&&s.push(`Abandoned, unchanged: ${n("abandoned").join(", ")}`),n("failed").length&&s.push(`Failed, unchanged: ${n("failed").join(", ")}`),s}function Iu(e,t,r){let n={interrupted:"stopped by Ctrl+C",timeout:"stopped at its time limit"}[t.reason],s=ic(r,n!==void 0);if(t.code===0&&!n&&!s.length)return`${e} completed.`;let o=t.forced?` (terminated after the ${t.forced/1e3} s grace period)`:"",i=t.code===0&&!n?1:t.code,c=n?`${n}${o}`:t.code===0?"ended without applying all its writes":`exited with code ${t.code}`;throw new dt([t.error,`${e} ${c}`,...s].filter(Boolean).join(`\r -`),i)}var Pu=new TextDecoder,lc=["",".tsx",".ts",".jsx",".js",".mjs",".cjs",".json",".css","/index.tsx","/index.ts","/index.js"],qu=new Map(Object.entries({mjs:"js",cjs:"js",js:"js",jsx:"jsx",ts:"ts",tsx:"tsx",css:"css",json:"json"}));async function uc(e,t,r){try{return await e(t,r)}catch(n){if(t!=="project")throw n;return}}function fc(e,t,r,n){let s=new Map,o=(a,l)=>{let u=n?.packages?.[a];if(u)return s.has(a)||s.set(a,new Set(u.files)),s.get(a).has(l)?t(`${M}/${u.key}/${l}`):void 0},i=async(a,l)=>{if(a==="project")return t(l);let u=l.indexOf("/"),[f,m]=[l.slice(0,u),l.slice(u+1)];return e?e[f]?.get(m):o(f,m)};return{read:i,find:async(a,l)=>{for(let u of lc){let f=await uc(i,a,l+u);if(f!==void 0)return r.set(`${a}:${l+u}`,f),{path:l+u,namespace:a}}throw new Error(`Cannot resolve ${l}`)}}}var pc=new Set(["assert","async_hooks","buffer","child_process","cluster","console","constants","crypto","dgram","diagnostics_channel","dns","domain","events","fs","http","http2","https","inspector","module","net","os","path","perf_hooks","process","punycode","querystring","readline","repl","stream","string_decoder","sys","timers","tls","trace_events","tty","url","util","v8","vm","wasi","worker_threads","zlib"]),hc=/^(?:node:|[a-z_][a-z0-9_]*(?:\/|$))/;function dc(e){if(e.startsWith("node:"))return e.slice(5).split("/")[0];let t=e.split("/")[0];return pc.has(t)?t:null}export{dt as ScriptExit,Vl as cacheState,hu as checkFetch,qn as checkRead,Dn as checkWrite,fc as createFinder,Ma as defaultRegistry,Fn as defaultTimeout,ye as dependenciesDigest,ut as describeRegistry,ve as desynchronized,D as downloadPackage,Wa as effectiveRegistry,Gl as embedTarget,sa as exactVersion,bu as execTarget,nc as gracePeriod,Ke as identifier,cu as initProject,ct as inspectCache,lu as install,Cn as listable,re as loadProject,S as lockPath,zn as lockedPackage,Pa as locksDependencies,ee as manifestFormat,En as manifestName,R as manifestPath,wn as newManifest,Oe as noManifest,dc as nodeBuiltin,hc as nodeImport,Ze as npmName,Sn as packageDirectory,M as packageRoot,gl as parseManifest,xu as parseRunOptions,kn as publishTogether,tt as readManifest,Nn as recordPath,vn as resolveEntry,bn as resolvePackages,Ql as restore,ft as restorePackages,$u as runDeadline,Iu as runResult,vu as runWorker,T as safePackagePath,et as sameOriginPath,Ru as scriptCommand,Ou as scriptHost,yu as secondsLeft,rt as serializeManifest,ke as storePackage,In as syncNotice,Ie as textBytes,Ne as timeoutBounds,_a as unpackedLimit,lt as usableRegistry,it as validateLock,te as validateManifest}; +`,y.stream),exit:y=>d({code:u&&y.code===0?m():y.code}),error:y=>d({code:u?m():1,error:y.error}),call:async y=>{let U;try{U={value:await t.handle(y)}}catch(oe){U={error:oe.message}}f||c.postMessage({type:"reply",id:y.id,...U})}};c.onmessage=({data:y})=>se[y?.type]?.(y),c.onerror=y=>{y.preventDefault?.(),d({code:1,error:y.message||"The script Worker failed"})},n?.addEventListener("abort",k,{once:!0}),l.push(setTimeout(()=>T("timeout"),s*1e3)),c.postMessage({type:"run",...r}),n?.aborted&&k()})}function ia(e,t){let r=t?e:e.filter(o=>o.unawaited),n=o=>r.filter(i=>i.state===o).map(({path:i})=>i),s=[];return t&&n("applied").length&&s.push(`Applied before the stop: ${n("applied").join(", ")}`),n("abandoned").length&&s.push(`Abandoned, unchanged: ${n("abandoned").join(", ")}`),n("failed").length&&s.push(`Failed, unchanged: ${n("failed").join(", ")}`),s}function vu(e,t,r){let n={interrupted:"stopped by Ctrl+C",timeout:"stopped at its time limit"}[t.reason],s=ia(r,n!==void 0);if(t.code===0&&!n&&!s.length)return`${e} completed.`;let o=t.forced?` (terminated after the ${t.forced/1e3} s grace period)`:"",i=t.code===0&&!n?1:t.code,a=n?`${n}${o}`:t.code===0?"ended without applying all its writes":`exited with code ${t.code}`;throw new dt([t.error,`${e} ${a}`,...s].filter(Boolean).join(`\r +`),i)}var ju=new TextDecoder,la=["",".tsx",".ts",".jsx",".js",".mjs",".cjs",".json",".css","/index.tsx","/index.ts","/index.js"],qu=new Map(Object.entries({mjs:"js",cjs:"js",js:"js",jsx:"jsx",ts:"ts",tsx:"tsx",css:"css",json:"json"}));async function ua(e,t,r){try{return await e(t,r)}catch(n){if(t!=="project")throw n;return}}function fa(e,t,r,n){let s=new Map,o=(c,l)=>{let u=n?.packages?.[c];if(u)return s.has(c)||s.set(c,new Set(u.files)),s.get(c).has(l)?t(`${M}/${u.key}/${l}`):void 0},i=async(c,l)=>{if(c==="project")return t(l);let u=l.indexOf("/"),[f,m]=[l.slice(0,u),l.slice(u+1)];return e?e[f]?.get(m):o(f,m)};return{read:i,find:async(c,l)=>{for(let u of la){let f=await ua(i,c,l+u);if(f!==void 0)return r.set(`${c}:${l+u}`,f),{path:l+u,namespace:c}}throw new Error(`Cannot resolve ${l}`)}}}var pa=new Set(["assert","async_hooks","buffer","child_process","cluster","console","constants","crypto","dgram","diagnostics_channel","dns","domain","events","fs","http","http2","https","inspector","module","net","os","path","perf_hooks","process","punycode","querystring","readline","repl","stream","string_decoder","sys","timers","tls","trace_events","tty","url","util","v8","vm","wasi","worker_threads","zlib"]),ha=/^(?:node:|[a-z_][a-z0-9_]*(?:\/|$))/;function da(e){if(e.startsWith("node:"))return e.slice(5).split("/")[0];let t=e.split("/")[0];return pa.has(t)?t:null}export{dt as ScriptExit,Vl as cacheState,hu as checkFetch,qn as checkRead,Dn as checkWrite,fa as createFinder,Mc as defaultRegistry,zn as defaultTimeout,ye as dependenciesDigest,ut as describeRegistry,Ie as desynchronized,D as downloadPackage,Wc as effectiveRegistry,Gl as embedTarget,sc as exactVersion,Ou as execTarget,na as gracePeriod,Ke as identifier,au as initProject,at as inspectCache,lu as install,Cn as listable,re as loadProject,S as lockPath,Fn as lockedPackage,jc as locksDependencies,ee as manifestFormat,En as manifestName,R as manifestPath,wn as newManifest,be as noManifest,da as nodeBuiltin,ha as nodeImport,Ze as npmName,Sn as packageDirectory,M as packageRoot,gl as parseManifest,xu as parseRunOptions,kn as publishTogether,tt as readManifest,Nn as recordPath,In as resolveEntry,On as resolvePackages,Ql as restore,ft as restorePackages,$u as runDeadline,vu as runResult,Iu as runWorker,A as safePackagePath,et as sameOriginPath,Ru as scriptCommand,bu as scriptHost,yu as secondsLeft,rt as serializeManifest,ke as storePackage,vn as syncNotice,ve as textBytes,Ne as timeoutBounds,_c as unpackedLimit,lt as usableRegistry,it as validateLock,te as validateManifest}; diff --git a/js/developer/environment/packages.mjs b/js/developer/environment/packages.mjs index 4fd6004d..57de2be4 100644 --- a/js/developer/environment/packages.mjs +++ b/js/developer/environment/packages.mjs @@ -1,5 +1,5 @@ // npm library resolution for the browser. Tools continue to use the existing wf installer. -import {parseSpec} from '../components/tools/wf.mjs'; +import {parseSpec} from './tarball.mjs'; import {downloadPackage} from './registry.mjs'; import {pinnedDownloader} from './pins.mjs'; import {connectPeers} from './peers.mjs'; diff --git a/js/developer/environment/registry.mjs b/js/developer/environment/registry.mjs index 66704627..0fceb1cd 100644 --- a/js/developer/environment/registry.mjs +++ b/js/developer/environment/registry.mjs @@ -1,7 +1,7 @@ // npm registry access: resolving a version, downloading and checking one package archive. import semver from 'semver'; import {responseBytes} from './io.mjs'; -import {verifyIntegrity} from '../components/tools/wf.mjs'; +import {verifyIntegrity} from './tarball.mjs'; import {readArchive, checkedManifest} from './archive.mjs'; import {sameOriginPath} from './manifest.mjs'; diff --git a/js/developer/environment/runtime.mjs b/js/developer/environment/runtime.mjs index 9c79a780..bf95f886 100644 --- a/js/developer/environment/runtime.mjs +++ b/js/developer/environment/runtime.mjs @@ -1,8 +1,12 @@ -import {Terminal} from '../../../third_party/xterm/xterm.mjs'; -import {FitAddon} from '../../../third_party/xterm/addon-fit.mjs'; -import {LineEditor, tokenize} from '../components/terminal/terminal.mjs'; +import {Terminal} from '@xterm/xterm'; +import {FitAddon} from '@xterm/addon-fit'; +import {LineEditor, tokenize, wordAtEnd, unicodeProvider, clearScreen, historyLimit} from './terminal.mjs'; +import {manifestPath} from './manifest.mjs'; +import {discoverCommands, runCommand, reservedNames} from './commands.mjs'; +export {discoverCommands, reservedNames}; import {validateLock} from './packages.mjs'; -import {readProject, publish} from './io.mjs'; +import {call, readProject, publish, writeChunks} from './io.mjs'; +import {isUnsafe} from './paths.mjs'; import {createStarter} from './starter.mjs'; import {install, initProject} from './installer.mjs'; import {restore, describeRegistry} from './restore.mjs'; @@ -198,7 +202,7 @@ async function list(_args, {bridge}) { return syncNotice(project) + (names || 'No installed packages.'); } -const help = () => 'wf init [name]\nwf create [directory]\nwf install [--update] [[@range] ...]\nwf restore [--offline]\nwf run [--timeout ] )") != string::npos); - REQUIRE(page.find(R"(from "./terminal.mjs")") != string::npos); - REQUIRE(page.find(R"(href="xterm.css")") != string::npos); - } - THEN("the component module imports the vendored xterm.js modules") { - const auto module = read(terminalFS, prefix + "terminal.mjs"); - REQUIRE(module.find(R"(from "./xterm.mjs")") != string::npos); - REQUIRE(module.find(R"(from "./addon-fit.mjs")") != string::npos); - } - THEN("the vendored xterm.js and Fit modules and CSS are gzip encoded") { - for (const auto& [name, size] : array, 3>{ - {{"xterm.mjs", fs::generated::XtermModuleData::dataSize}, - {"xterm.css", fs::generated::XtermCssData::dataSize}, - {"addon-fit.mjs", fs::generated::XtermFitAddonData::dataSize}} - }) { - auto file = terminalFS.open(prefix + string{name}); - REQUIRE(file.has_value()); - readEmbeddedAsset(*file, size); - } - } - THEN("each served file has the MIME type the browser needs for modules and styles") { - auto mime = [](const string& path) { - return http::MimeType::fromExtension(filesystem::path{path}.extension().string()).toString(); - }; - REQUIRE(mime(prefix + "index.html") == "text/html"); - REQUIRE(mime(prefix + "terminal.mjs") == "application/javascript"); - REQUIRE(mime(prefix + "xterm.mjs") == "application/javascript"); - REQUIRE(mime(prefix + "xterm.css") == "text/css"); - } - THEN("other paths, including the bare names outside the prefix, are not served") { - REQUIRE_FALSE(terminalFS.open("xterm.mjs").has_value()); - REQUIRE_FALSE(terminalFS.open("index.html").has_value()); - REQUIRE_FALSE(terminalFS.open(prefix + "missing.mjs").has_value()); - REQUIRE_FALSE(terminalFS.open(prefix + "xterm.mjs.map").has_value()); - } - } -} - -SCENARIO("DefaultFSWith adds component assets to the default WebFront filesystem") { - GIVEN("DefaultFSWith without a document root") { - fs::DefaultFSWith filesystem{std::filesystem::path{}}; - - THEN("the terminal page, the protected bridge and the fallback page are all served") { - REQUIRE(filesystem.open(string{fs::TerminalFS::page}).has_value()); - REQUIRE(read(filesystem, "WebFront.js").find("WebFrontBridge") != string::npos); - REQUIRE(filesystem.open("index.html").has_value()); - REQUIRE_FALSE(filesystem.open("unknown.txt").has_value()); - } - } -} diff --git a/test/unit/TerminalTests.cpp b/test/unit/TerminalTests.cpp deleted file mode 100644 index 98461e8d..00000000 --- a/test/unit/TerminalTests.cpp +++ /dev/null @@ -1,268 +0,0 @@ -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace std; -using namespace webfront; - -namespace { - -// Records the functions a Terminal registers, like BasicWF::cppFunction, and calls them directly. -struct RecordingApp { - map> nullary; - map> unary; - - template - void cppFunction(string name, auto&& function) { - static_assert(is_same_v); - if constexpr (sizeof...(Args) == 0) - nullary.try_emplace(std::move(name), std::forward(function)); - else - unary.try_emplace(std::move(name), std::forward(function)); - } - - string run(const string& line) { - return unary.at("webfront.terminal.run")(line); - } - string complete(const string& line) { - return unary.at("webfront.terminal.complete")(line); - } -}; - -bool contains(const string& text, const string& part) { - return text.find(part) != string::npos; -} - -// A shell with one command per accepted handler shape, plus a throwing one. -struct SampleShell { - terminal::Shell shell; - vector received; - - SampleShell() { - shell.command("greet", "Greet someone", terminal::adaptHandler([](CommandArgs args) { - return "Hello, " + (args.empty() ? string{"world"} : args[0]) + "!"; - })); - shell.command("record", "Record its arguments", terminal::adaptHandler([this](CommandArgs args) { - received.assign(args.begin(), args.end()); - })); - shell.command("lines", "Write two lines", terminal::adaptHandler([](CommandArgs, ostream& output) { - output << "one\ntwo"; - })); - shell.command("answer", "No argument", terminal::adaptHandler([] { - return 42; - })); - shell.command("fail", "Throw", terminal::adaptHandler([](CommandArgs) -> string { - throw runtime_error("command failed"); - })); - } - SampleShell(const SampleShell&) = delete; - SampleShell& operator=(const SampleShell&) = delete; -}; - -} // namespace - -SCENARIO("Terminal lines are split into words") { - GIVEN("lines with whitespace, quotes and escapes") { - auto [line, words] = GENERATE(table>({ - { " greet \t Ada ", {"greet", "Ada"}}, // whitespace runs separate words - { "", {}}, // an empty line has no word - { " ", {}}, // nor has a blank one - {R"(say "hello world" 'a b')", {"say", "hello world", "a b"}}, - { R"(x "" y)", {"x", "", "y"}}, // empty quotes give an empty word - { R"(pre"fix"post)", {"prefixpost"}}, // quotes join adjacent text - { R"(a\ b)", {"a b"}}, // a backslash escapes outside quotes, - { R"("say \"hi\"")", {R"(say "hi")"}}, // inside double quotes, - { R"('a\b')", {R"(a\b)"}}, // but not inside single quotes - })); - THEN("the line '" + line + "' is split as expected") { - REQUIRE(terminal::tokenize(line) == words); - } - } - GIVEN("malformed lines") { - auto line = GENERATE(string{R"(say "hello)"}, string{"say 'hello"}, string{R"(say \)"}, string{R"("a\)"}); - THEN("an unterminated quote or a trailing backslash is rejected: " + line) { - REQUIRE_THROWS_AS(terminal::tokenize(line), invalid_argument); - } - } -} - -SCENARIO("The terminal shell runs commands of every accepted handler shape") { - GIVEN("a shell with sample commands") { - SampleShell sample; - auto& shell = sample.shell; - - THEN("a returning command's result is its output") { - REQUIRE(shell.run("greet Ada") == "Hello, Ada!"); - REQUIRE(shell.run("greet") == "Hello, world!"); - REQUIRE(shell.run("answer ignored") == "42"); - } - THEN("the command receives its arguments without its name") { - REQUIRE(shell.run("record 'a b' c").empty()); - REQUIRE(sample.received == vector{"a b", "c"}); - } - THEN("written line breaks become terminal line breaks") { - REQUIRE(shell.run("lines") == "one\r\ntwo"); - } - THEN("an empty line produces no output") { - REQUIRE(shell.run("").empty()); - REQUIRE(shell.run(" ").empty()); - } - } -} - -SCENARIO("The terminal shell reports failing lines") { - GIVEN("a shell with sample commands") { - SampleShell sample; - auto& shell = sample.shell; - - THEN("an unknown command or a malformed line produces an error message, not an exception") { - const auto unknown = shell.run("nope"); - REQUIRE(contains(unknown, "Unknown command 'nope'")); - REQUIRE(unknown.starts_with("\x1b[31m")); - REQUIRE(contains(shell.run(R"(greet "Ada)"), "Unterminated quote")); - } - THEN("a command's exception propagates, so the JavaScript Promise rejects") { - REQUIRE_THROWS_AS(shell.run("fail"), runtime_error); - } - } -} - -SCENARIO("The terminal shell completes and documents its commands") { - GIVEN("a shell with sample commands") { - SampleShell sample; - auto& shell = sample.shell; - - THEN("command names complete by prefix, in order") { - REQUIRE(shell.complete("") == "answer\nfail\ngreet\nlines\nrecord"); - REQUIRE(shell.complete("gr") == "greet"); - REQUIRE(shell.complete("zz").empty()); - } - THEN("arguments are not completed") { - REQUIRE(shell.complete("greet A").empty()); - } - THEN("help lists every command with its aligned description") { - REQUIRE(shell.help() - == "answer No argument\n" - "fail Throw\n" - "greet Greet someone\n" - "lines Write two lines\n" - "record Record its arguments"); - } - } -} - -SCENARIO("The terminal shell rejects invalid registrations") { - GIVEN("a shell with sample commands") { - SampleShell sample; - auto& shell = sample.shell; - - THEN("a duplicate or malformed name is rejected") { - auto name = GENERATE(string{"greet"}, string{""}, string{"two words"}, string{"quo'te"}); - REQUIRE_THROWS_AS(shell.command(name, "rejected", terminal::adaptHandler([] {})), invalid_argument); - } - THEN("a command without a handler is rejected") { - REQUIRE_THROWS_AS(shell.command("ok", "no handler", terminal::Shell::Handler{}), invalid_argument); - REQUIRE(shell.complete("ok").empty()); - } - } -} - -SCENARIO("Terminal output is capped below the bridge's string limit") { - GIVEN("a command writing more than the limit, ending in multi-byte characters") { - terminal::Shell shell; - shell.command("flood", "Too much output", terminal::adaptHandler([] { - string text(terminal::maxOutputBytes - 1, 'x'); - for (int index = 0; index < 10; ++index) - text += "\xc3\xa9"; // U+00E9, two bytes - return text; - })); - - WHEN("it runs") { - const auto output = shell.run("flood"); - THEN("the output fits a 16-bit length and ends with a notice") { - REQUIRE(output.size() < 65536); - REQUIRE(output.ends_with("[output truncated]\x1b[0m")); - } - THEN("it is cut before the first character that would not fit whole") { - REQUIRE(output.substr(0, terminal::maxOutputBytes - 1) == string(terminal::maxOutputBytes - 1, 'x')); - REQUIRE(output[terminal::maxOutputBytes - 1] == '\r'); - } - } - } -} - -SCENARIO("Terminal error messages are capped below the bridge's string limit") { - GIVEN("a shell and an unknown command name as long as the largest bridge string") { - terminal::Shell shell; - const string name(65535, 'x'); - - WHEN("it runs") { - const auto output = shell.run(name); - THEN("the diagnostic fits a 16-bit length and is marked as truncated") { - REQUIRE(output.size() < 65536); - REQUIRE(contains(output, "[output truncated]")); - } - THEN("the diagnostic keeps its colors") { - REQUIRE(output.starts_with("\x1b[31mUnknown command 'xxx")); - REQUIRE(output.ends_with("\x1b[0m")); - } - } - } -} - -SCENARIO("Terminal registers its bridge functions and built-in commands on the application") { - GIVEN("a terminal on an application") { - RecordingApp app; - auto terminal = make_unique>(app, TerminalOptions{.prompt = "demo> ", .banner = "Welcome"}); - terminal->command("greet", "Greet someone", [](CommandArgs args) { - return "Hello, " + args[0] + "!"; - }); - - THEN("the page reads the configured prompt and banner") { - REQUIRE(app.nullary.at("webfront.terminal.prompt")() == "demo> "); - REQUIRE(app.nullary.at("webfront.terminal.banner")() == "Welcome"); - } - THEN("lines run registered commands and complete their names") { - REQUIRE(app.run("greet Ada") == "Hello, Ada!"); - REQUIRE(app.complete("g") == "greet"); - } - THEN("help and clear are built in") { - REQUIRE(contains(app.run("help"), "greet Greet someone")); - REQUIRE(contains(app.run("help"), "clear ")); - REQUIRE(app.run("clear") == Terminal::clearScreen); - } - THEN("a duplicate command is rejected") { - REQUIRE_THROWS_AS(terminal->command("help", "again", [] {}), invalid_argument); - } - THEN("the page lists no extension module by default") { - REQUIRE(app.nullary.at("webfront.terminal.extensions")().empty()); - } - WHEN("extension modules are added, one of them twice") { - terminal->extension("/a.mjs").extension("/b/c.mjs").extension("/a.mjs"); - THEN("the page lists each once, in order") { - REQUIRE(app.nullary.at("webfront.terminal.extensions")() == "/a.mjs\n/b/c.mjs"); - } - } - THEN("an empty or multi-line extension URL is rejected") { - auto url = GENERATE(string{}, string{"/a.mjs\n/b.mjs"}, string{"/a.mjs\r"}); - REQUIRE_THROWS_AS(terminal->extension(url), invalid_argument); - REQUIRE(app.nullary.at("webfront.terminal.extensions")().empty()); - } - WHEN("the Terminal object is destroyed") { - terminal.reset(); - THEN("the registered functions still own the commands") { - REQUIRE(app.run("greet Ada") == "Hello, Ada!"); - REQUIRE(contains(app.run("help"), "greet")); - } - } - } -} diff --git a/test/unit/ToolManagerTests.cpp b/test/unit/ToolManagerTests.cpp deleted file mode 100644 index bb5248e9..00000000 --- a/test/unit/ToolManagerTests.cpp +++ /dev/null @@ -1,306 +0,0 @@ -#include "TemporaryDirectory.hpp" -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace std; -using namespace webfront; -using webfront::test::TemporaryDirectory; - -namespace { - -// The project directory of the tools, chosen by each test. -struct TestProject { - static inline filesystem::path directory; - static filesystem::path get() { - return directory; - } -}; - -using TestPackageFS = fs::BasicPackageFS; - -// Records the functions registered on it, like BasicWF::cppFunction, and calls them directly. -struct RecordingApp { - map functions; - - template - void cppFunction(string name, auto&& function) { - functions.try_emplace(std::move(name), std::function(std::forward(function))); - } - - template - R call(const string& name, Args... args) { - return any_cast&>(functions.at(name))(std::move(args)...); - } - - string run(const string& line) { - return call("webfront.terminal.run", line); - } -}; - -vector bytes(string_view text) { - return {text.begin(), text.end()}; -} - -optional served(TestPackageFS& packages, const filesystem::path& path) { - auto file = packages.open(path); - if (!file) - return nullopt; - string content; - array buffer{}; - while (!file->eof()) - content.append(buffer.data(), file->read(buffer)); - return content; -} - -bool contains(const string& text, const string& part) { - return text.find(part) != string::npos; -} - -} // namespace - -SCENARIO("The tool manager installs tools through its bridge functions") { - GIVEN("a terminal with a tool manager on an application") { - TemporaryDirectory project; - TestProject::directory = project.path(); - RecordingApp app; - Terminal terminal{app}; - auto manager = make_unique>(app, terminal); - REQUIRE(manager->store().projectDir() == project.path()); - - WHEN("the page installs a tool in two chunks") { - app.call("webfront.pkg.begin", "@acme/plot", "1.2.0"); - app.call>("webfront.pkg.writeFile", - "@acme/plot", - "1.2.0", - "dist/index.html", - 0, - bytes("

pl")); - app.call>("webfront.pkg.writeFile", - "@acme/plot", - "1.2.0", - "dist/index.html", - 5, - bytes("ot

")); - app.call("webfront.pkg.commit", "@acme/plot", "1.2.0", "sha512-abc", "dist/index.html", "Live plot"); - - THEN("the page lists it with the URL of its entry") { - REQUIRE(app.call("webfront.pkg.list", 0) == "@acme/plot\t1.2.0\t/webfront/tools/@acme/plot/dist/index.html\tLive plot\n"); - } - THEN("wf list shows it") { - REQUIRE(app.run("wf list") == "@acme/plot@1.2.0 Live plot"); - } - THEN("PackageFS serves its files") { - TestPackageFS packages{"ignored"}; - REQUIRE(served(packages, "webfront/tools/@acme/plot/dist/index.html") == "

plot

"); - REQUIRE(served(packages, "/webfront/tools/@acme/plot/dist/index.html") == "

plot

"); - } - AND_WHEN("wf remove uninstalls it") { - REQUIRE(app.run("wf remove @acme/plot") == "Removed @acme/plot."); - THEN("it is no longer listed nor served") { - REQUIRE(app.run("wf list") == "No tool installed."); - REQUIRE(app.call("webfront.pkg.list", 0).empty()); - TestPackageFS packages{"ignored"}; - REQUIRE_FALSE(served(packages, "webfront/tools/@acme/plot/dist/index.html")); - } - } - AND_WHEN("the ToolManager object is destroyed") { - manager.reset(); - THEN("the registered functions still own the store") { - REQUIRE(contains(app.run("wf list"), "@acme/plot@1.2.0")); - } - } - } - } -} - -SCENARIO("Installed tools are listed with URLs the HTTP server resolves") { - GIVEN("a terminal with a tool manager on an application") { - TemporaryDirectory project; - TestProject::directory = project.path(); - RecordingApp app; - Terminal terminal{app}; - ToolManager manager{app, terminal}; - - WHEN("a tool whose entry needs escaping in a URL is installed") { - const string entry = "dist/a+b c%41\xc3\xa9#[].html"; - app.call("webfront.pkg.begin", "logs", "1.0.0"); - app.call>("webfront.pkg.writeFile", "logs", "1.0.0", entry, 0, bytes("

logs

")); - app.call("webfront.pkg.commit", "logs", "1.0.0", "", entry, "Logs"); - THEN("its listed URL is absolute, encoded, and leads the server to the file") { - const auto list = app.call("webfront.pkg.list", 0); - const auto url = list.substr(list.find("logs\t1.0.0\t") + 11); - REQUIRE(url.starts_with("/webfront/tools/logs/dist/a%2Bb%20c%2541%C3%A9%23%5B%5D.html\t")); - TestPackageFS packages{"ignored"}; - REQUIRE(served(packages, uri::decode(url.substr(0, url.find('\t')))) == "

logs

"); - http::RequestHandler handler{"."}; - http::Request request; - request.method = http::Request::Method::Get; - request.uri = url.substr(0, url.find('\t')); - REQUIRE(handler.handleRequest(request).statusCode == http::Response::ok); - } - } - } -} - -SCENARIO("The tool manager rejects malformed calls and commands") { - GIVEN("a terminal with a tool manager on an application") { - TemporaryDirectory project; - TestProject::directory = project.path(); - RecordingApp app; - Terminal terminal{app}; - ToolManager manager{app, terminal}; - - THEN("a negative, fractional or too large offset is rejected") { - app.call("webfront.pkg.begin", "plot", "1.0.0"); - for (const double offset : {-1.0, 0.5, 1e300, numeric_limits::infinity(), numeric_limits::quiet_NaN()}) - REQUIRE_THROWS_AS( - (app.call>("webfront.pkg.writeFile", "plot", "1.0.0", "a.js", offset, bytes("x"))), - invalid_argument); - } - THEN("wf documents itself and rejects malformed commands") { - REQUIRE(contains(app.run("help"), "Manage web tools: wf search | install | list | open | remove")); - for (const auto* command : {"wf search [term]", "wf install [@version]", "wf list", "wf open ", "wf remove "}) - REQUIRE(contains(app.run("wf"), command)); - REQUIRE(app.run("wf help") == app.run("wf")); - REQUIRE_THROWS_AS(app.run("wf frobnicate"), invalid_argument); - REQUIRE_THROWS_AS(app.run("wf remove"), invalid_argument); - REQUIRE_THROWS_AS(app.run("wf remove a b"), invalid_argument); - REQUIRE_THROWS_AS(app.run("wf list all"), invalid_argument); - REQUIRE_THROWS_AS(app.run("wf remove plot"), invalid_argument); - REQUIRE_THROWS_AS(app.run("wf remove ../x"), invalid_argument); - } - THEN("the commands of the page explain that it did not load its module when they reach C++") { - for (const auto* line : {"wf search", "wf install plot", "wf open plot"}) - REQUIRE_THROWS_WITH(app.run(line), Catch::Matchers::ContainsSubstring("webfront/components/tools/wf.mjs")); - } - THEN("the terminal page loads the browser module and reads the default registry") { - REQUIRE(app.call("webfront.terminal.extensions") == "/webfront/components/tools/wf.mjs"); - REQUIRE(app.call("webfront.pkg.registry") == "https://registry.npmjs.org/"); - } - } -} - -SCENARIO("The registry of the tool manager is configurable") { - GIVEN("a tool manager with a local registry") { - TemporaryDirectory project; - TestProject::directory = project.path(); - RecordingApp app; - Terminal terminal{app}; - ToolManager manager{app, terminal, {.registry = "/registry/"}}; - THEN("the page reads it") { - REQUIRE(app.call("webfront.pkg.registry") == "/registry/"); - } - } -} - -SCENARIO("The tool list is paged below the bridge's string limit") { - GIVEN("more tools with long titles than one bridge string can carry") { - TemporaryDirectory project; - TestProject::directory = project.path(); - RecordingApp app; - Terminal terminal{app}; - ToolManager manager{app, terminal}; - constexpr size_t toolCount = 70; - for (size_t index = 0; index < toolCount; ++index) { - const auto name = "tool" + to_string(index); - manager.store().begin(name, "1.0.0"); - manager.store().write(name, "1.0.0", {.path = "index.html", .offset = 0, .bytes = bytes("x")}); - manager.store().commit({.name = name, .version = "1.0.0", .entry = "index.html", .title = string(1024, 't')}); - } - - WHEN("the page reads the list from index 0 until an empty page") { - vector lines; - size_t pages = 0; - for (string page = app.call("webfront.pkg.list", 0); !page.empty(); - page = app.call("webfront.pkg.list", static_cast(lines.size()))) { - REQUIRE(page.size() <= tools::detail::maxListBytes); - REQUIRE(page.ends_with('\n')); - for (size_t start = 0, end = page.find('\n'); end != string::npos; start = end + 1, end = page.find('\n', start)) - lines.push_back(page.substr(0, page.find('\t', start)).substr(start)); - ++pages; - } - THEN("every tool is listed once, over several pages") { - REQUIRE(pages > 1); - REQUIRE(lines.size() == toolCount); - REQUIRE(set(lines.begin(), lines.end()).size() == toolCount); - } - } - THEN("an index past the end gives an empty page and an invalid index is rejected") { - REQUIRE(app.call("webfront.pkg.list", toolCount).empty()); - REQUIRE_THROWS_AS((app.call("webfront.pkg.list", -1)), invalid_argument); - } - } -} - -SCENARIO("PackageFS serves only the files of installed tools") { - GIVEN("a project with one installed tool and a file outside it") { - TemporaryDirectory project; - TestProject::directory = project.path(); - fs::ToolStore store{project.path()}; - store.begin("plot", "1.0.0"); - store.write("plot", "1.0.0", {.path = "index.html", .offset = 0, .bytes = bytes("

plot

")}); - store.write("plot", "1.0.0", {.path = "assets/app.js", .offset = 0, .bytes = bytes("go()")}); - store.commit({.name = "plot", .version = "1.0.0", .entry = "index.html"}); - ofstream(project.path() / "secret.txt") << "secret"; - TestPackageFS packages{"ignored"}; - - THEN("files of the installed version are served, also in subdirectories") { - REQUIRE(served(packages, "webfront/tools/plot/index.html") == "

plot

"); - REQUIRE(served(packages, "webfront/tools/plot/assets/app.js") == "go()"); - } - THEN("missing files, directories, unknown tools and other prefixes are not served") { - REQUIRE_FALSE(served(packages, "webfront/tools/plot/missing.js")); - REQUIRE_FALSE(served(packages, "webfront/tools/plot/assets")); - REQUIRE_FALSE(served(packages, "webfront/tools/other/index.html")); - REQUIRE_FALSE(served(packages, "webfront/tools/plot")); - REQUIRE_FALSE(served(packages, "webfront/tools/@scope")); - REQUIRE_FALSE(served(packages, "tools/plot/index.html")); - } - THEN("paths escaping the tool are not served") { - REQUIRE_FALSE(served(packages, "webfront/tools/plot/../../../secret.txt")); - REQUIRE_FALSE(served(packages, "webfront/tools/plot/./index.html")); - REQUIRE_FALSE(served(packages, "webfront/tools/../../secret.txt")); - } - WHEN("the lock file becomes malformed") { - ofstream(project.path() / "webfront-tools.lock.json") << "{"; - THEN("nothing is served") { - REQUIRE_FALSE(served(packages, "webfront/tools/plot/index.html")); - } - } - } -} - -SCENARIO("ToolsApp serves installed tools after the protected bridge script") { - GIVEN("the filesystem of ToolsApp") { - fs::DefaultFSWith files{""}; - THEN("the bridge script, the terminal, the tool manager module and the fallback page are served") { - REQUIRE(files.open("WebFront.js")); - REQUIRE(files.open(fs::TerminalFS::page)); - REQUIRE(files.open(fs::ToolManagerFS::module)); - REQUIRE_FALSE(files.open(string(fs::ToolManagerFS::prefix) + "other.mjs")); - REQUIRE(files.open("index.html")); - } - THEN("an unknown tool falls through to the next providers") { - REQUIRE_FALSE(files.open("webfront/tools/none/index.html")); - } - } -} diff --git a/test/unit/ToolStoreTests.cpp b/test/unit/ToolStoreTests.cpp deleted file mode 100644 index a4baf262..00000000 --- a/test/unit/ToolStoreTests.cpp +++ /dev/null @@ -1,532 +0,0 @@ -#include "TemporaryDirectory.hpp" -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace std; -using namespace webfront; -using webfront::test::TemporaryDirectory; - -namespace { - -vector bytes(string_view text) { - return {text.begin(), text.end()}; -} - -string contentOf(const filesystem::path& file) { - ifstream stream(file, ios::binary); - ostringstream content; - content << stream.rdbuf(); - return content.str(); -} - -fs::ToolRecord plotRecord(string version = "1.2.0") { - return {.name = "@acme/plot", .version = std::move(version), .integrity = "sha512-abc", .entry = "dist/index.html", .title = "Live plot"}; -} - -void install(fs::ToolStore& store, const fs::ToolRecord& record, string_view page = "

plot

") { - store.begin(record.name, record.version); - store.write(record.name, record.version, {.path = record.entry, .offset = 0, .bytes = bytes(page)}); - store.commit(record); -} - -} // namespace - -SCENARIO("Package names, versions and paths from the browser are validated") { - GIVEN("valid npm names, versions and package paths") { - auto name = GENERATE("plot", "webfront-plot", "@acme/plot", "a.b_c~d"); - THEN("they are accepted") { - REQUIRE_NOTHROW(fs::tools::validatePackageName(name)); - REQUIRE_NOTHROW(fs::tools::validateVersion("1.2.0-beta.1+build.5")); - REQUIRE(fs::tools::safeRelativePath("dist/assets/app.js") == filesystem::path("dist") / "assets" / "app.js"); - } - } - GIVEN("names that could leave the tools directory or are not npm names") { - auto name = GENERATE("", - ".", - "..", - "../x", - "@acme", - "@acme/", - "@/plot", - "@acme/../x", - "@acme/a/b", - "Plot", - "_plot", - "a b", - "a\\b", - "a..b", - "@acme/a..b", - "@a..b/c"); - THEN("they are rejected") { - REQUIRE_THROWS_AS(fs::tools::validatePackageName(name), invalid_argument); - } - } - GIVEN("names and versions longer than npm accepts") { - THEN("they are rejected") { - REQUIRE_THROWS_AS(fs::tools::validatePackageName(string(215, 'a')), invalid_argument); - REQUIRE_THROWS_AS(fs::tools::validateVersion("1" + string(256, '0')), invalid_argument); - } - } - GIVEN("invalid versions") { - auto version = GENERATE("", "..", "v1.0.0", "1.0/0", "1.0 0", "1..0"); - THEN("they are rejected") { - REQUIRE_THROWS_AS(fs::tools::validateVersion(version), invalid_argument); - } - } - GIVEN("unsafe paths") { - auto path = GENERATE(as{}, - "", - "/etc/passwd", - "../x", - "a/../../x", - "a/./b", - "a//b", - "a/", - "..", - "C:/x", - "c:x", - "a\\..\\b", - "a?.js", - "a*.js", - "ab", - "a|b", - "a\"b", - "main..html", - "a/b..c/d", - string("a\0b", 3)); - THEN("they are rejected") { - REQUIRE_THROWS_AS(fs::tools::safeRelativePath(path), invalid_argument); - } - } -} - -SCENARIO("The lock file is read and written as JSON") { - GIVEN("two installed tools") { - fs::tools::LockedTools tools; - tools.emplace("@acme/plot", plotRecord()); - tools.emplace("logs", fs::ToolRecord{.name = "logs", .version = "0.1.0", .integrity = "", .entry = "index.html", .title = "Say \"hi\" \\o/"}); - - WHEN("they are formatted and parsed back") { - const auto json = fs::tools::formatLock(tools); - THEN("the same records are read, sorted by name") { - REQUIRE(json.starts_with("{\n \"lockfileVersion\": 1,\n \"tools\": {\n \"@acme/plot\": {")); - REQUIRE(fs::tools::parseLock(json) == tools); - } - } - } - GIVEN("no tool") { - THEN("an empty lock file round-trips") { - REQUIRE(fs::tools::parseLock(fs::tools::formatLock({})).empty()); - } - } - GIVEN("a lock file edited by hand, with unknown members and escapes") { - const auto json = R"({"other": [1, true, null, {"a": "b"}], "tools": {"plot": {"version": "1.0.0", "extra": 3, - "entry": "index.html", "title": "\u00e9\ud83d\ude00\/"}}})"; - THEN("the unknown members are skipped and the escapes decoded") { - const auto tools = fs::tools::parseLock(json); - REQUIRE(tools.at("plot").version == "1.0.0"); - REQUIRE(tools.at("plot").title == "\xc3\xa9\xf0\x9f\x98\x80/"); - } - } - GIVEN("empty arrays and objects among the unknown members") { - THEN("they are skipped") { - REQUIRE(fs::tools::parseLock(R"({"a": [], "b": {}, "c": [[]], "tools": {}})").empty()); - } - } - GIVEN("every escape of the JSON grammar") { - json::Reader reader{R"("\"\\\/\b\f\n\r\t\u20AC\u0041")"}; - THEN("each one is decoded") { - REQUIRE(reader.string() - == "\"\\/\b\f\n\r\t\xe2\x82\xac" - "A"); - } - } -} - -SCENARIO("The lock file reader is strict") { - GIVEN("malformed JSON") { - auto json = GENERATE("", - "{", - R"({"tools": {"plot": {"version": "1.0.0"}})", - R"({"tools": 1} x)", - R"({"tools": {"p": {"title": "\x"}}})", - R"({"tools": {"p": {"title": "\ud800"}}})", - R"({"tools": {"p": {"title": "\udc00"}}})", - R"({"tools": {"p": {"title": "\ud800\u0041"}}})", - R"({"tools": {"p": {"title": "\u12G4"}}})", - R"({"tools": {"p": {"title": "\u12"}}})", - R"({"other": [1, }})", - R"({"other": 1} x)", - R"({"other": "abc)", - R"({"tools": {"p": {"x": }}})", - R"({"tools": {}, "other": garbage})", - R"({"tools": {}, "lockfileVersion": 1e+})", - R"({"a": 01})", - R"({"a": -})", - R"({"a": 1.})", - R"({"a": .5})", - R"({"a": +1})", - R"({"a": 1e})", - R"({"a": tru})", - R"({"a": nulls})", - "{\"tools\": {\"p\": {\"title\": \"a\nb\"}}}"); - THEN("parsing throws") { - REQUIRE_THROWS(fs::tools::parseLock(json)); - } - } - GIVEN("numbers and literals of the JSON grammar among the unknown members") { - const auto json = R"({"a": -0.5e+10, "b": 1E5, "c": 0, "d": true, "e": false, "f": null, "g": 12.25, "h": -0, "i": 3e-2, "tools": {}})"; - THEN("they are skipped") { - REQUIRE(fs::tools::parseLock(json).empty()); - } - } - GIVEN("strings with control characters") { - THEN("quoting escapes them") { - REQUIRE(json::quote("a\nb\x01") == R"("a\u000ab\u0001")"); - } - } - GIVEN("a record pointing outside the tools directory or breaking the listing") { - auto json = GENERATE(R"({"tools": {"../x": {"version": "1.0.0", "entry": "index.html"}}})", - R"({"tools": {"plot": {"version": "../1", "entry": "index.html"}}})", - R"({"tools": {"plot": {"version": "1.0.0", "entry": "../../secret"}}})", - R"({"tools": {"plot": {"version": "1.0.0", "entry": "index.html", "title": "a\nb"}}})", - R"({"tools": {"plot": {"version": "1.0.0", "entry": "index.html", "integrity": "a\tb"}}})"); - THEN("parsing rejects it") { - REQUIRE_THROWS_AS(fs::tools::parseLock(json), invalid_argument); - } - } -} - -SCENARIO("A tool store installs tools in its project directory") { - GIVEN("an empty project") { - TemporaryDirectory project; - fs::ToolStore store{project.path()}; - REQUIRE(store.installed().empty()); - - WHEN("a tool is installed in several chunks") { - store.begin("@acme/plot", "1.2.0"); - store.write("@acme/plot", "1.2.0", {.path = "dist/index.html", .offset = 0, .bytes = bytes("

")}); - store.write("@acme/plot", "1.2.0", {.path = "dist/index.html", .offset = 3, .bytes = bytes("plot

")}); - store.write("@acme/plot", "1.2.0", {.path = "package.json", .offset = 0, .bytes = bytes("{}")}); - store.commit(plotRecord()); - - THEN("its files are in its version directory and the lock file records it") { - const auto directory = project.path() / ".webfront" / "tools" / "@acme" / "plot@1.2.0"; - REQUIRE(store.installDir("@acme/plot", "1.2.0") == directory); - REQUIRE(contentOf(directory / "dist" / "index.html") == "

plot

"); - REQUIRE(contentOf(directory / "package.json") == "{}"); - REQUIRE(store.find("@acme/plot") == plotRecord()); - REQUIRE(fs::ToolStore::readLock(project.path() / "webfront-tools.lock.json").size() == 1); - REQUIRE_FALSE(filesystem::exists(project.path() / "webfront-tools.lock.json.tmp")); - } - AND_WHEN("another version is installed") { - install(store, plotRecord("2.0.0"), "

v2

"); - THEN("it replaces the previous one") { - REQUIRE(store.find("@acme/plot")->version == "2.0.0"); - REQUIRE_FALSE(filesystem::exists(store.installDir("@acme/plot", "1.2.0"))); - REQUIRE(contentOf(store.installDir("@acme/plot", "2.0.0") / "dist" / "index.html") == "

v2

"); - } - } - AND_WHEN("the same version is installed again") { - install(store, plotRecord(), "

again

"); - THEN("its files are replaced") { - REQUIRE(contentOf(store.installDir("@acme/plot", "1.2.0") / "dist" / "index.html") == "

again

"); - } - } - AND_WHEN("it is removed") { - REQUIRE(store.remove("@acme/plot")); - THEN("its files and its lock entry are gone") { - REQUIRE_FALSE(filesystem::exists(store.installDir("@acme/plot", "1.2.0"))); - REQUIRE(store.installed().empty()); - REQUIRE_FALSE(store.remove("@acme/plot")); - } - } - } - } -} - -SCENARIO("A tool store rejects inconsistent installations") { - GIVEN("a project with an installation in progress") { - TemporaryDirectory project; - fs::ToolStore store{project.path()}; - store.begin("plot", "1.0.0"); - store.write("plot", "1.0.0", {.path = "index.html", .offset = 0, .bytes = bytes("abc")}); - - THEN("a chunk that does not follow the written bytes is rejected") { - REQUIRE_THROWS_AS(store.write("plot", "1.0.0", {.path = "index.html", .offset = 2, .bytes = bytes("x")}), invalid_argument); - REQUIRE_THROWS_AS(store.write("plot", "1.0.0", {.path = "missing.js", .offset = 1, .bytes = bytes("x")}), invalid_argument); - } - THEN("a file that cannot be written is reported") { - store.write("plot", "1.0.0", {.path = "dir/file.js", .offset = 0, .bytes = bytes("x")}); - REQUIRE_THROWS_AS(store.write("plot", "1.0.0", {.path = "dir", .offset = 0, .bytes = bytes("x")}), runtime_error); - } - THEN("an unsafe path is rejected") { - REQUIRE_THROWS_AS(store.write("plot", "1.0.0", {.path = "../escape.js", .offset = 0, .bytes = bytes("x")}), invalid_argument); - REQUIRE_FALSE(filesystem::exists(project.path() / ".webfront" / "tools" / ".staging" / "escape.js")); - } - THEN("writing or committing a version that was not begun is rejected") { - REQUIRE_THROWS_AS(store.write("plot", "2.0.0", {.path = "index.html", .offset = 0, .bytes = bytes("x")}), invalid_argument); - REQUIRE_THROWS_AS(store.commit({.name = "plot", .version = "2.0.0", .entry = "index.html"}), invalid_argument); - } - THEN("a lock file that cannot be written fails the commit") { - filesystem::create_directories(project.path() / "webfront-tools.lock.json.tmp"); - REQUIRE_THROWS_AS(store.commit({.name = "plot", .version = "1.0.0", .entry = "index.html"}), runtime_error); - } - THEN("a title or integrity longer than 1024 bytes is rejected") { - REQUIRE_THROWS_AS(store.commit({.name = "plot", .version = "1.0.0", .entry = "index.html", .title = string(1025, 't')}), invalid_argument); - REQUIRE_THROWS_AS(store.commit({.name = "plot", .version = "1.0.0", .integrity = string(1025, 'i'), .entry = "index.html"}), invalid_argument); - REQUIRE_NOTHROW(store.commit({.name = "plot", .version = "1.0.0", .entry = "index.html", .title = string(1024, 't')})); - } - THEN("a title or integrity with control characters is rejected") { - REQUIRE_THROWS_AS(store.commit({.name = "plot", .version = "1.0.0", .entry = "index.html", .title = "two\nlines"}), invalid_argument); - REQUIRE_THROWS_AS(store.commit({.name = "plot", .version = "1.0.0", .integrity = "a\tb", .entry = "index.html"}), invalid_argument); - REQUIRE(store.installed().empty()); - } - THEN("a commit whose entry page was not written is rejected") { - REQUIRE_THROWS_AS(store.commit({.name = "plot", .version = "1.0.0", .entry = "missing.html"}), invalid_argument); - REQUIRE(store.installed().empty()); - } - WHEN("the installation is committed") { - store.commit({.name = "plot", .version = "1.0.0", .entry = "index.html"}); - THEN("it cannot be committed or written again without a new begin") { - REQUIRE_THROWS_AS(store.commit({.name = "plot", .version = "1.0.0", .entry = "index.html"}), invalid_argument); - REQUIRE_THROWS_AS(store.write("plot", "1.0.0", {.path = "index.html", .offset = 0, .bytes = bytes("x")}), invalid_argument); - } - } - } -} - -SCENARIO("A tool store refuses lock files it cannot read") { - GIVEN("a lock file that exists but cannot be read") { - TemporaryDirectory project; - const auto lockFile = project.path() / "webfront-tools.lock.json"; - filesystem::create_directory(lockFile); - fs::ToolStore store{project.path()}; - THEN("reading the installed tools fails instead of reporting none") { - REQUIRE_THROWS_AS(store.installed(), runtime_error); - } - THEN("an installation fails without replacing the lock file") { - store.begin("plot", "1.0.0"); - store.write("plot", "1.0.0", {.path = "index.html", .offset = 0, .bytes = bytes("x")}); - REQUIRE_THROWS_AS(store.commit({.name = "plot", .version = "1.0.0", .entry = "index.html"}), runtime_error); - REQUIRE(filesystem::is_directory(lockFile)); - } - } - -#ifndef _WIN32 - GIVEN("a lock file without read permission") { - TemporaryDirectory project; - const auto lockFile = project.path() / "webfront-tools.lock.json"; - ofstream(lockFile) << R"({"tools": {"logs": {"version": "1.0.0", "entry": "index.html"}}})"; - filesystem::permissions(lockFile, filesystem::perms::none); - const bool readable = ifstream(lockFile).is_open(); // e.g. when the tests run as root - fs::ToolStore store{project.path()}; - THEN("an installation fails instead of dropping the recorded tools") { - store.begin("plot", "1.0.0"); - store.write("plot", "1.0.0", {.path = "index.html", .offset = 0, .bytes = bytes("x")}); - if (!readable) - REQUIRE_THROWS_AS(store.commit({.name = "plot", .version = "1.0.0", .entry = "index.html"}), runtime_error); - filesystem::permissions(lockFile, filesystem::perms::owner_read | filesystem::perms::owner_write); - REQUIRE(store.find("logs")); - } - } -#endif - GIVEN("a malformed lock file") { - TemporaryDirectory project; - ofstream(project.path() / "webfront-tools.lock.json") << "{ not json"; - fs::ToolStore store{project.path()}; - THEN("reading the installed tools reports it") { - REQUIRE_THROWS_AS(store.installed(), runtime_error); - } - } -} - -SCENARIO("A tool store keeps the installed version when a replacement does not complete") { - GIVEN("a project with an installed tool") { - TemporaryDirectory project; - fs::ToolStore store{project.path()}; - install(store, plotRecord()); - - WHEN("a version differing only by case is installed, as on a case-insensitive volume") { - install(store, plotRecord("1.2.0-alpha"), "

alpha

"); - install(store, plotRecord("1.2.0-Alpha"), "

Alpha

"); - THEN("the cleanup of the replaced version keeps the new files") { - REQUIRE(store.find("@acme/plot")->version == "1.2.0-Alpha"); - REQUIRE(contentOf(store.installDir("@acme/plot", "1.2.0-Alpha") / "dist" / "index.html") == "

Alpha

"); - } - } - WHEN("installing a version fails when the lock file is written") { - filesystem::create_directories(project.path() / "webfront-tools.lock.json.tmp"); - const auto failingInstall = [&](string version) { - REQUIRE_THROWS_AS(install(store, plotRecord(std::move(version)), "

failed

"), runtime_error); - }; - failingInstall("1.2.0"); - failingInstall("2.0.0"); - THEN("the installed version and its files are intact, and no other version is left") { - REQUIRE(store.find("@acme/plot") == plotRecord()); - REQUIRE(contentOf(store.installDir("@acme/plot", "1.2.0") / "dist" / "index.html") == "

plot

"); - REQUIRE_FALSE(filesystem::exists(store.installDir("@acme/plot", "2.0.0"))); - } - } - WHEN("a new installation is abandoned") { - store.begin("@acme/plot", "3.0.0"); - store.write("@acme/plot", "3.0.0", {.path = "dist/index.html", .offset = 0, .bytes = bytes("

v3

")}); - THEN("the installed version is untouched") { - REQUIRE(store.find("@acme/plot")->version == "1.2.0"); - REQUIRE(contentOf(store.installDir("@acme/plot", "1.2.0") / "dist" / "index.html") == "

plot

"); - } - } - } -} - -SCENARIO("Installations of versions differing only by case do not share their staged files") { - GIVEN("a project") { - TemporaryDirectory project; - fs::ToolStore store{project.path()}; - const auto stage = [&store](const fs::ToolRecord& record, string_view page) { - store.begin(record.name, record.version); - store.write(record.name, record.version, {.path = record.entry, .offset = 0, .bytes = bytes(page)}); - }; - - WHEN("the installations of 1.2.0-alpha and 1.2.0-Alpha are interleaved") { - stage(plotRecord("1.2.0-alpha"), "

alpha

"); - stage(plotRecord("1.2.0-Alpha"), "

Alpha

"); - THEN("each commit installs the files written for its own version") { - store.commit(plotRecord("1.2.0-alpha")); - REQUIRE(store.find("@acme/plot")->version == "1.2.0-alpha"); - REQUIRE(contentOf(store.installDir("@acme/plot", "1.2.0-alpha") / "dist" / "index.html") == "

alpha

"); - store.commit(plotRecord("1.2.0-Alpha")); - REQUIRE(store.find("@acme/plot")->version == "1.2.0-Alpha"); - REQUIRE(contentOf(store.installDir("@acme/plot", "1.2.0-Alpha") / "dist" / "index.html") == "

Alpha

"); - } - } - WHEN("an installation is restarted while another case variant is staged") { - stage(plotRecord("1.2.0-alpha"), "

alpha

"); - stage(plotRecord("1.2.0-Alpha"), "

Alpha

"); - store.begin("@acme/plot", "1.2.0-Alpha"); - THEN("only the restarted installation loses its staged files") { - REQUIRE_THROWS_AS(store.commit(plotRecord("1.2.0-Alpha")), invalid_argument); - store.commit(plotRecord("1.2.0-alpha")); - REQUIRE(contentOf(store.installDir("@acme/plot", "1.2.0-alpha") / "dist" / "index.html") == "

alpha

"); - } - } - } -} - -SCENARIO("Stores of the same project share their transactions") { - GIVEN("two stores of one project") { - TemporaryDirectory project; - fs::ToolStore first{project.path()}; - fs::ToolStore second{project.path() / "."}; - - THEN("an installation begun in one can be completed in the other") { - first.begin("plot", "1.0.0"); - second.write("plot", "1.0.0", {.path = "index.html", .offset = 0, .bytes = bytes("x")}); - second.commit({.name = "plot", .version = "1.0.0", .entry = "index.html"}); - REQUIRE(first.find("plot")); - } - WHEN("both install tools at the same time") { - constexpr int toolsPerStore = 25; - atomic failures{0}; - const auto installMany = [&failures](fs::ToolStore& store, const string& prefix) { - for (int index = 0; index < toolsPerStore; ++index) { - try { - install(store, {.name = prefix + to_string(index), .version = "1.0.0", .entry = "index.html"}); - } catch (const exception&) { - ++failures; - } - } - }; - { - jthread a{installMany, ref(first), "a"}; - jthread b{installMany, ref(second), "b"}; - } - THEN("every installation succeeds and is recorded with its files") { - REQUIRE(failures == 0); - const auto installed = first.installed(); - REQUIRE(installed.size() == 2 * toolsPerStore); - for (const auto& [name, record] : installed) - REQUIRE(filesystem::is_regular_file(first.installDir(name, record.version) / "index.html")); - } - } - } -} - -#ifndef _WIN32 -namespace { - -// Makes a directory read-only (its entries cannot be deleted) until destroyed. -class ReadOnlyDirectory { -public: - explicit ReadOnlyDirectory(filesystem::path path) : directory(std::move(path)) { - filesystem::permissions(directory, filesystem::perms::owner_read | filesystem::perms::owner_exec); - } - ReadOnlyDirectory(const ReadOnlyDirectory&) = delete; - ReadOnlyDirectory& operator=(const ReadOnlyDirectory&) = delete; - ~ReadOnlyDirectory() { - error_code ignored; - filesystem::permissions(directory, filesystem::perms::owner_all, ignored); - } - -private: - filesystem::path directory; -}; - -} // namespace - -SCENARIO("Directories that cannot be deleted do not fail completed operations") { - GIVEN("an installed version whose files cannot be deleted") { - TemporaryDirectory project; - fs::ToolStore store{project.path()}; - install(store, {.name = "plot", .version = "1.0.0", .entry = "index.html"}); - const auto installed = store.installDir("plot", "1.0.0"); - const auto backup = project.path() / ".webfront" / "tools" / "plot@1.0.0~backup"; - - WHEN("another version replaces it") { - const ReadOnlyDirectory readOnly{installed}; - REQUIRE_NOTHROW(install(store, {.name = "plot", .version = "2.0.0", .entry = "index.html"})); - THEN("the new version is installed") { - REQUIRE(store.find("plot")->version == "2.0.0"); - } - } - WHEN("the same version is reinstalled") { - const ReadOnlyDirectory readOnly{installed}; - REQUIRE_NOTHROW(install(store, {.name = "plot", .version = "1.0.0", .entry = "index.html"}, "

again

")); - THEN("the new files are installed") { - REQUIRE(contentOf(installed / "index.html") == "

again

"); - } - AND_WHEN("it is reinstalled again while the backup is still left behind") { - REQUIRE_NOTHROW(install(store, {.name = "plot", .version = "1.0.0", .entry = "index.html"}, "

third

")); - THEN("the newest files are installed") { - REQUIRE(contentOf(installed / "index.html") == "

third

"); - } - } - // The read-only directory was moved to the backup, which could not be deleted. - error_code ignored; - filesystem::permissions(backup, filesystem::perms::owner_all, ignored); - } - WHEN("it is removed") { - const ReadOnlyDirectory readOnly{installed}; - THEN("the removal succeeds") { - REQUIRE(store.remove("plot")); - REQUIRE(store.installed().empty()); - } - } - } -} -#endif diff --git a/test/unit/UISubscribersTests.cpp b/test/unit/UISubscribersTests.cpp index 97bef257..0755186a 100644 --- a/test/unit/UISubscribersTests.cpp +++ b/test/unit/UISubscribersTests.cpp @@ -15,7 +15,7 @@ struct FakeUI { int id; }; -using Subscribers = detail::UIStartedSubscribers; +using Subscribers = detail::UISubscribers; } // namespace diff --git a/test/unit/WebLinkTests.cpp b/test/unit/WebLinkTests.cpp index 3ad22773..fe7c2c56 100644 --- a/test/unit/WebLinkTests.cpp +++ b/test/unit/WebLinkTests.cpp @@ -209,6 +209,22 @@ SCENARIO("WebLink dispatches browser messages and allocates distinct calls") { REQUIRE(callId == 0); REQUIRE(futureError(result) == "Browser connection closed"); } + THEN("the link reports the disconnection once") { + REQUIRE(events == vector{WebLinkEvent::Code::closed}); + } + } +} + +SCENARIO("WebLink reports a browser's close frame as its disconnection") { + InjectableSocket::reset(); + vector events; + InlineTaskScope scope; + WebLink link{InjectableSocket{}, 10, [&](WebLinkEvent event) { events.push_back(event.code); }, scope}; + WHEN("the browser sends a close frame") { + InjectableSocket::receive(std::array{byte{0x88}, byte{0x80}, byte{1}, byte{2}, byte{3}, byte{4}}); + THEN("the link reports one disconnection, and none when it is destroyed") { + REQUIRE(events == vector{WebLinkEvent::Code::closed}); + } } } @@ -330,3 +346,87 @@ SCENARIO("A browser that stops reading bounds the diagnostic frames queued for i CHECK(link.pendingWrites() == 0); log::setLogLevel(log::Disabled); } + +namespace { +template +networking::Task waitWrites(Writes writes, bool& woken) { + co_await std::move(writes); + woken = true; +} + +// Records the events the link had reported when the writer resumed. +template +networking::Task waitWritesSeeing(Writes writes, const vector& events, vector& seen) { + co_await std::move(writes); + seen = events; +} +} // namespace + +SCENARIO("A link wakes a writer once its write queue drains") { + InjectableSocket::reset(); + InlineTaskScope scope; + auto link = make_shared>(InjectableSocket{}, WebLinkId{12}, [](WebLinkEvent) { }, scope); + InjectableSocket::deferWrites(); + for (msg::CallId call = 1; call <= 3; ++call) + link->sendError(call, "queued"); + REQUIRE(link->pendingWrites() == 3); + using Writes = webfront::detail::WritesAtMost>; + bool woken = false; + GIVEN("a task waiting for at most one queued frame") { + networking::Spawn(scope, networking::ex::inline_scheduler{}, waitWrites(Writes{link, 1}, woken)); + THEN("it wakes when the second write ends, not before") { + CHECK_FALSE(woken); + InjectableSocket::completeDeferredWrites(); + CHECK_FALSE(woken); + InjectableSocket::completeDeferredWrites(); + CHECK(woken); + } + } + GIVEN("a waiting task that is stopped") { + networking::ex::inplace_stop_source stop; + networking::Spawn(scope, networking::ex::inline_scheduler{}, stop.get_token(), waitWrites(Writes{link, 0}, woken)); + stop.request_stop(); + THEN("it unwinds, and the drained queue does not call it") { + while (InjectableSocket::completeDeferredWrites() > 0) { } + CHECK_FALSE(woken); + CHECK(link->pendingWrites() == 0); + } + } + GIVEN("a link destroyed while a task waits") { + networking::Spawn(scope, networking::ex::inline_scheduler{}, waitWrites(Writes{link, 0}, woken)); + link.reset(); + THEN("the task resumes: nothing is left to wait for") { + CHECK(woken); + } + } + GIVEN("a link that is gone") { + std::weak_ptr> gone; + networking::Spawn(scope, networking::ex::inline_scheduler{}, waitWrites(Writes{gone, 0}, woken)); + THEN("the task does not wait") { + CHECK(woken); + } + } + InjectableSocket::deferWrites(false); + while (InjectableSocket::completeDeferredWrites() > 0) { } +} + +SCENARIO("A writer resumes after a failed write reported the closure") { + InjectableSocket::reset(); + InlineTaskScope scope; + vector events; + auto link = make_shared>(InjectableSocket{}, WebLinkId{13}, [&events](WebLinkEvent event) { events.push_back(event.code); }, scope); + InjectableSocket::deferWrites(); + for (msg::CallId call = 1; call <= 3; ++call) + link->sendError(call, "queued"); + vector seen{WebLinkEvent::Code::linked}; // replaced when the writer resumes + networking::Spawn(scope, networking::ex::inline_scheduler{}, waitWritesSeeing(webfront::detail::WritesAtMost>{link, 0}, events, seen)); + WHEN("the write fails") { + InjectableSocket::failWrites(make_error_code(errc::broken_pipe)); + InjectableSocket::deferWrites(false); + InjectableSocket::completeDeferredWrites(); + THEN("the writer resumes once the closure was reported") { + CHECK(seen == vector{WebLinkEvent::Code::closed}); + } + } + InjectableSocket::reset(); +} diff --git a/test/web/DeveloperTest.cpp b/test/web/DeveloperTest.cpp index b9f35887..a5157f2d 100644 --- a/test/web/DeveloperTest.cpp +++ b/test/web/DeveloperTest.cpp @@ -1,10 +1,14 @@ #include "../../examples/life/Life.hpp" #include "../fixtures/Pi.hpp" #include "../unit/TemporaryDirectory.hpp" +#include #include #include +#include #include +#include +#include #include namespace { @@ -68,6 +72,106 @@ void registerCallbacks(App& app, const std::filesystem::path& project, std::atom }); } +// What the test's long commands went through, by tag: running, stopping (a lingering command after Ctrl+C), cancelled. +class CommandStates { +public: + void set(const std::string& tag, std::string state) { + std::scoped_lock lock{mutex}; + states[tag] = std::move(state); + } + std::string get(const std::string& tag) const { + std::scoped_lock lock{mutex}; + const auto found = states.find(tag); + return found == states.end() ? "absent" : found->second; + } + +private: + mutable std::mutex mutex; + std::map states; +}; + +namespace ex = webfront::networking::ex; +using namespace std::chrono_literals; + +// Marks its command cancelled once the coroutine unwinds or returns. +struct Cancelled { + std::shared_ptr states; + std::string tag; + ~Cancelled() { + states->set(tag, "cancelled"); + } +}; + +template +webfront::Task waitUntilStopped(Context context, std::shared_ptr states) { + const auto tag = context.args().at(0); + Cancelled cancelled{states, tag}; + states->set(tag, "running"); + context.write("waiting " + tag + "\n"); + for (;;) + co_await context.ui().resumeAfter(20ms); +} + +// After Ctrl+C, keeps running for a while, deaf to the stop request, before it ends. +template +webfront::Task lingerAfterStop(Context context, std::shared_ptr states) { + const auto tag = context.args().at(0); + Cancelled cancelled{states, tag}; + states->set(tag, "running"); + const auto deafPause = [&] { + return ex::write_env(context.ui().resumeAfter(20ms), ex::prop{ex::get_stop_token, ex::never_stop_token{}}); + }; + while (!context.stopRequested()) + co_await deafPause(); + states->set(tag, "stopping"); + for (int i = 0; i < 40; ++i) + co_await deafPause(); +} + +template +void registerCommands(webfront::Commands& commands, const std::shared_ptr& states) { + using Context = typename webfront::Commands::Context; + commands.add("echo", "Write its arguments", [](Context context) -> webfront::Task { + std::string line; + for (const auto& word : context.args()) + line += (line.empty() ? "" : " ") + word; + context.write(line + "\n"); + co_return; + }); + commands.add("stream", "Write 150001 bytes", [](Context context) -> webfront::Task { + std::string text; + for (int i = 0; i < 75000; ++i) + text += "\xC3\xA9"; + context.write(text + "\n"); + co_return; + }); + commands.add("sleep", "Wait some milliseconds", [](Context context) -> webfront::Task { + co_await context.ui().resumeAfter(std::chrono::milliseconds(std::stoi(context.args().at(0)))); + }); + commands.add("crlf", "Split a CRLF between two writes", [](Context context) -> webfront::Task { + context.write("one\r"); + context.write("\ntwo\n"); + co_return; + }); + commands.add("partial", "Write without a final line break", [](Context context) -> webfront::Task { + context.write("partial"); + co_return; + }); + commands.add("fail", "Throw", [](Context) -> webfront::Task { + throw std::runtime_error("command failed on purpose"); + }); + commands.add("status", "Exit with a code", [](Context context) -> webfront::Task { + context.exit(std::stoi(context.args().at(0))); + co_return; + }); + commands.add("wait", "Wait until stopped", [states](Context context) { + return waitUntilStopped(std::move(context), states); + }); + commands.add("linger", "Linger after Ctrl+C", [states](Context context) { + return lingerAfterStop(std::move(context), states); + }); +} + template void bootstrapApp(App& app, std::string_view mode, const std::string& integrity) { if (mode.empty()) @@ -101,14 +205,29 @@ int main(int argc, char** argv) { App app{project.path()}; std::atomic passed{false}; registerCallbacks(app, project.path(), passed); + auto states = std::make_shared(); + webfront::Commands commands{app}; + registerCommands(commands, states); + app.cppFunction("test.command", [states](std::string tag) { + return states->get(tag); + }); + app.cppFunction("test.browsers", [&app] { + return static_cast(app.connectedBrowsers()); + }); bootstrapApp(app, argc == 4 ? std::string_view(argv[3]) : std::string_view{}, integrity); auto subscription = app.subscribeUIStarted([injected = false](App::UI ui) mutable { if (!std::exchange(injected, true)) ui.addScript(runScript); }); app.show(); + // The test ends while the "final" command runs: shutdown drains it. + app.shutdown(); if (!passed.load()) return 1; + if (states->get("final") != "cancelled") { + std::cerr << "The command running at shutdown was not drained: " << states->get("final") << '\n'; + return 1; + } copyHeaders(project.path(), argv[2]); return 0; } catch (const std::exception& error) { diff --git a/test/web/JasmineTest.cpp b/test/web/JasmineTest.cpp index 836f3bb6..300b3f5d 100644 --- a/test/web/JasmineTest.cpp +++ b/test/web/JasmineTest.cpp @@ -1,14 +1,9 @@ -#include -#include #include #include #include #include #include -#include #include -#include -#include #include #include #include @@ -56,42 +51,6 @@ struct TestState { atomic passed{false}; }; -/// Project directory of the tools installed by test/web/js/tools-specs.mjs: a fresh temporary -/// directory, removed by main(), so the test never writes into the source tree. -struct TestToolsProject { - static filesystem::path get() { - static const filesystem::path directory = [] { - const auto unique = to_string(chrono::system_clock::now().time_since_epoch().count()); - auto path = filesystem::temp_directory_path() / ("webfront-webtest-tools-" + unique); - filesystem::create_directories(path); - return path; - }(); - return directory; - } -}; - -/// Search endpoint of the fake npm registry used by test/web/js/tools-specs.mjs; its packuments and -/// tarball are plain files under test/web/registry/ (see make_fixture.py), served by NativeDebugFS. -/// The server drops the query string before looking up files, so tools-specs.mjs checks the query -/// wf.mjs sends. -class FakeRegistrySearchFS { -public: - explicit FakeRegistrySearchFS(filesystem::path docRoot) : root(std::move(docRoot)) {} - - optional open(filesystem::path file) const { - const auto request = file.relative_path().generic_string(); - if (request != "registry/-/v1/search") - return {}; - ifstream stream(root / "registry" / "search.json", ios::binary); - if (!stream.is_open()) - return {}; - return fs::File{std::move(stream)}; - } - -private: - filesystem::path root; -}; - // Serve the actual example page so the React regression exercises the shipped UI. class ReactDemoFS { public: @@ -132,15 +91,11 @@ class EncodedRunnerFS { using TestFS = fs::Multi>; + fs::BabelFS>; // CMake chooses an embedded frontend; the same specs run under CEF/Xvfb and Windows WebView2. #ifndef WEBFRONT_TEST_FRONTEND #define WEBFRONT_TEST_FRONTEND webfront::frontend::CEFFrontend @@ -152,7 +107,6 @@ class BrowserIntegrationTest { explicit BrowserIntegrationTest(const filesystem::path& docRoot) : webFront("9002", docRoot) { registerCallbacks(); registerBitsetCallbacks(); - registerTerminalCommands(); } ~BrowserIntegrationTest() { @@ -402,19 +356,6 @@ class BrowserIntegrationTest { }); } - /// Commands driven by test/web/js/terminal-specs.mjs, and the tool manager driven by - /// test/web/js/tools-specs.mjs against the fake registry under test/web/registry/. - void registerTerminalCommands() { - Terminal terminal{webFront, {.prompt = "test> ", .banner = "webtest terminal"}}; - terminal.command("greet", "Greet someone", [](CommandArgs args) { - return "Hello, " + (args.empty() ? string{"world"} : args[0]) + "!"; - }); - terminal.command("fail", "Throw from C++", [](CommandArgs) -> string { - throw runtime_error("terminal command failed"); - }); - ToolManager tools{webFront, terminal, {.registry = "/registry/"}}; - } - /// The JS side echoes back the very arrays browserReady() sent it, so the cpp* members double as the /// expected values and there is a single place to edit when the fixtures change. template @@ -526,8 +467,6 @@ int main() { log::error("Browser integration test failed: {}", error.what()); cerr << error.what() << '\n'; } - error_code ignored; - filesystem::remove_all(TestToolsProject::get(), ignored); log::removeSinks(consoleSink); return result; } diff --git a/test/web/SpecRunner.html b/test/web/SpecRunner.html index e81a77fc..7cd93fc6 100644 --- a/test/web/SpecRunner.html +++ b/test/web/SpecRunner.html @@ -6,7 +6,6 @@ WebFront automated browser tests - diff --git a/test/web/developer-session.html b/test/web/developer-session.html new file mode 100644 index 00000000..f531ff7b --- /dev/null +++ b/test/web/developer-session.html @@ -0,0 +1,8 @@ + + + +Second developer session +
+ + + diff --git a/test/web/developer-session.mjs b/test/web/developer-session.mjs new file mode 100644 index 00000000..77c8d0fb --- /dev/null +++ b/test/web/developer-session.mjs @@ -0,0 +1,6 @@ +// A second browser session for developer-specs.mjs: its own WebFront connection, the same environment runtime. +globalThis.session = (async () => { + await webFront.ready; + const runtime = await import('/webfront/developer/environment/runtime.mjs'); + return {runtime, bridge: webFront, cppCommands: await runtime.discoverCommands(webFront)}; +})(); diff --git a/test/web/developer-specs.mjs b/test/web/developer-specs.mjs index 31f2bbd3..15e4ce03 100644 --- a/test/web/developer-specs.mjs +++ b/test/web/developer-specs.mjs @@ -335,7 +335,308 @@ try { assert(JSON.stringify([await listing(''), await listing('check')]) === JSON.stringify(before), 'A check must not write any project file'); assert(JSON.parse(await listing('.webfront/developer/staging')).length === 0, 'A check must leave no staged files'); assert(/typescript@6\.0\.3/.test(await runtime.execute(['list'], context)), 'The terminal must stay usable after a stopped check'); - await webFront.cppFunction('test.report')(true, 'WASM + npm + TSX + PI + Life animation + deterministic headers + scripts + type check passed'); + // The terminal: the application's C++ commands, run in this browser's session. + assert(JSON.stringify([...runtime.builtinNames].sort()) === JSON.stringify([...runtime.reservedNames].sort()), + `The terminal's own commands must be the names reserved to it: ${runtime.builtinNames}`); + const cppCommands = await runtime.discoverCommands(webFront); + assert(['echo', 'fail', 'linger', 'status', 'stream', 'wait'].every(name => cppCommands.has(name)) && cppCommands.get('echo') === 'Write its arguments', + `The C++ commands must be discovered with their help: ${[...cppCommands.keys()]}`); + const commandState = tag => webFront.cppFunction('test.command')(tag); + const waitState = async (tag, state) => { + for (let attempt = 0; (await commandState(tag)) !== state; ++attempt) { + if (attempt === 200) throw new Error(`Command ${tag} did not reach ${state}: ${await commandState(tag)}`); + await delay(25); + } + }; + const lineContext = (signal = new AbortController().signal, chunks = []) => ({...context, cppCommands, signal, write: text => chunks.push(text)}); + const streamed = []; + assert(await runtime.runLine('stream', lineContext(undefined, streamed)) === '', 'A C++ command resolves once it returns'); + assert(streamed.length >= 3 && streamed.join('') === 'é'.repeat(75000) + '\r\n', `Long C++ output must stream in pieces under the bridge limit: ${streamed.length}`); + const crlf = []; + await runtime.runLine('crlf', lineContext(undefined, crlf)); + assert(crlf.join('') === 'one\r\ntwo\r\n', `A CRLF split between two writes must stay one line break: ${JSON.stringify(crlf.join(''))}`); + const thrown = await failure(runtime.runLine('fail', lineContext())); + assert(thrown?.message === 'command failed on purpose' && thrown.exitCode === 1, `A C++ exception must reject the command: ${thrown}`); + const exitCode = await failure(runtime.runLine('status 3', lineContext())); + assert(exitCode?.exitCode === 3 && /exited with code 3/.test(exitCode.message), `A C++ exit code must be reported: ${exitCode}`); + assert(/Unknown command: absent/.test((await failure(runtime.runLine('absent', lineContext())))?.message), 'An unknown command must be refused'); + // Ctrl+C: the terminal stops waiting at once, the next command answers while the first is still ending in C++. + const interruptLinger = new AbortController(); + const lingering = failure(runtime.runLine('linger first', lineContext(interruptLinger.signal))); + await waitState('first', 'running'); + interruptLinger.abort(new Error('Interrupted')); + assert((await lingering)?.exitCode === 130, 'An interrupted C++ command must end with exit code 130'); + const echoed = []; + await runtime.runLine('echo "after Ctrl+C"', lineContext(undefined, echoed)); + assert(echoed.join('') === 'after Ctrl+C\r\n', `The next command must run normally: ${echoed}`); + assert(['running', 'stopping'].includes(await commandState('first')), 'The second command must answer before the first one ends'); + await waitState('first', 'stopping'); + await waitState('first', 'cancelled'); + // Sessions: a second browser has its own commands; a long command there does not delay this one, Ctrl+C here does + // not stop it, and its disconnection does. + const sessionFrame = document.createElement('iframe'); + sessionFrame.src = '/fixtures/session.html'; + document.body.append(sessionFrame); + for (let attempt = 0; !sessionFrame.contentWindow?.session; ++attempt) { + if (attempt === 200) throw new Error('The second session did not load'); + await delay(25); + } + const second = await sessionFrame.contentWindow.session; + const secondWait = failure(second.runtime.runLine('wait second', {bridge: second.bridge, cppCommands: second.cppCommands, signal: new AbortController().signal})); + await waitState('second', 'running'); + const interruptFirst = new AbortController(); + const firstWait = failure(runtime.runLine('wait here', lineContext(interruptFirst.signal))); + await waitState('here', 'running'); + const echoStarted = performance.now(); + await runtime.runLine('echo isolated', lineContext()); + assert(performance.now() - echoStarted < 2000, 'A command in another session must not delay this one'); + interruptFirst.abort(new Error('Interrupted')); + await firstWait; + await waitState('here', 'cancelled'); + assert(await commandState('second') === 'running', 'Ctrl+C in one browser must not stop the command of another'); + const browsers = await webFront.cppFunction('test.browsers')(); + // Its connection closes while its acknowledged command runs: the terminal stops waiting for an exit that cannot come. + second.bridge.socket.close(); + const lost = await secondWait; + assert(lost?.exitCode === 1 && /connection to the application closed/.test(lost.message), + `A command of a closed connection must reject: ${lost?.message}`); + await waitState('second', 'cancelled'); + for (let attempt = 0; await webFront.cppFunction('test.browsers')() !== browsers - 1; ++attempt) + if (attempt === 200) throw new Error('The connection of a closed browser must be released'); + else await delay(25); + sessionFrame.remove(); + // The terminal itself, mounted in this page with a real xterm.js. + const host = document.createElement('div'); + host.style.cssText = 'width:640px;height:240px'; + document.body.append(host); + let exitedWith = null; + // The test sets the terminal's size itself: an observer following the element would race with it. + const mounted = async () => runtime.mount({bridge: webFront, config, terminal: host, preview: context.preview, onExit: code => { exitedWith = code; }, fitToElement: false}); + const {terminal, editor} = await mounted(); + terminal.resize(80, 12); + const buffer = () => terminal.buffer.active; + const rendered = () => new Promise(resolve => terminal.write('', resolve)); + // Like xterm.js, one input per key; text may come as one input. + const type = async (...inputs) => { + for (const data of inputs) { + terminal.input(data); + await editor.whenIdle(); + } + await rendered(); + }; + const rows = () => { + const lines = []; + for (let y = 0; y < buffer().length; ++y) lines.push(buffer().getLine(y).translateToString(true)); + return lines; + }; + const cursorRow = () => buffer().baseY + buffer().cursorY; + const lastRows = count => rows().slice(cursorRow() - count + 1, cursorRow() + 1); + await type('echo hello\r'); + assert(JSON.stringify(lastRows(3)) === JSON.stringify(['> echo hello', 'hello', '> ']), `A C++ command must run from the terminal: ${lastRows(3)}`); + // Cell widths: CJK, emoji, a flag, a ZWJ sequence and a combining mark. + await type('漢字😀🇫🇷👨‍👩‍👧éx'); + assert(buffer().cursorX === 2 + 2 + 2 + 2 + 2 + 2 + 1 + 1, `Wide characters must take two cells: ${buffer().cursorX}`); + // xterm.js draws each cluster where the editor placed it. + const drawn = buffer().getLine(cursorRow()); + const cellsDrawn = [[2, '漢', 2], [4, '字', 2], [6, '😀', 2], [8, '🇫🇷', 2], [10, '👨‍👩‍👧', 2], [12, 'e\u0301', 1], [13, 'x', 1]] + .map(([column, chars, width]) => [drawn.getCell(column).getChars() === chars, drawn.getCell(column).getWidth() === width]).flat(); + assert(cellsDrawn.every(Boolean), `xterm.js must draw the clusters with the editor's widths: ${cellsDrawn}`); + await type('\x7f', '\x7f'); + assert(buffer().cursorX === 12 && editor.line === '漢字😀🇫🇷👨‍👩‍👧', `Backspace must erase whole clusters: ${buffer().cursorX} ${editor.line}`); + await type('\x1b[D', '\x1b[D'); + assert(buffer().cursorX === 8, `The cursor must move over whole clusters: ${buffer().cursorX}`); + await type('\x03'); + assert(lastRows(2)[0].endsWith('^C') && lastRows(1)[0] === '> ' && editor.line === '', 'Ctrl+C must drop the line'); + // A line over several rows: wrapping, editing in the middle, a row filled exactly and a wide character at a row end. + terminal.resize(20, 12); + await rendered(); + assert(terminal.cols === 20, `The terminal must keep the width the test gives it: ${terminal.cols}`); + await type('echo ' + 'a'.repeat(40)); + let top = cursorRow() - 2; + assert(buffer().cursorX === 7 && JSON.stringify(rows().slice(top, top + 3)) === JSON.stringify(['> echo ' + 'a'.repeat(13), 'a'.repeat(20), 'a'.repeat(7)]), + `A long line must wrap: ${rows().slice(top, top + 3)}`); + await type('\x01', 'X'); + assert(cursorRow() === top && buffer().cursorX === 3 && JSON.stringify(rows().slice(top, top + 3)) === JSON.stringify(['> Xecho ' + 'a'.repeat(12), 'a'.repeat(20), 'a'.repeat(8)]), + `Editing the start of a long line must redraw its rows: ${rows().slice(top, top + 3)}`); + await type('\x05', 'b'.repeat(12)); + assert(cursorRow() === top + 3 && buffer().cursorX === 0, `A line filling its last row exactly must leave the cursor on the next row: ${cursorRow() - top} ${buffer().cursorX}`); + await type('\x7f', '漢'); + assert(cursorRow() === top + 3 && buffer().cursorX === 2 && rows()[top + 2] === 'a'.repeat(8) + 'b'.repeat(11) && rows()[top + 3] === '漢', + `A wide character must not split at a row end: ${buffer().cursorX} ${rows().slice(top + 2, top + 4)}`); + await type('\x15'); + assert(cursorRow() === top && buffer().cursorX === 2 && rows()[top + 1] === '', 'Erasing a long line must clear its rows'); + terminal.resize(80, 12); + await rendered(); + // Exit codes, errors and clear. + await type('status 3\r'); + assert(editor.status === 3 && lastRows(2)[0] === 'Error: Command status exited with code 3', `An exit code must be shown: ${lastRows(2)}`); + await type('fail\r'); + assert(editor.status === 1 && lastRows(2)[0] === 'Error: command failed on purpose', `A C++ exception must be shown as an error: ${lastRows(2)}`); + await type('partial\r', 'x'); + assert(JSON.stringify(lastRows(2)) === JSON.stringify(['partial', '> x']), `Output without a final line break must not hold the prompt: ${lastRows(2)}`); + await type('\x03'); + // Keys typed while a completion is pending are applied after it, Enter included. + terminal.input('ec'); + terminal.input('\t'); + terminal.input('ho'); + terminal.input(' typed-ahead\r'); + for (let attempt = 0; editor.busy || lastRows(2)[0] !== 'ho typed-ahead'; ++attempt) { + if (attempt === 200) throw new Error(`Keys typed during a completion must be kept: ${lastRows(3)}`); + await editor.whenIdle(); + await rendered(); + await delay(10); + } + assert(lastRows(3)[0] === '> echo ho typed-ahead' && editor.ahead.length === 0, `The completed line must run once: ${lastRows(3)}`); + await type('echo ok\r'); + assert(editor.status === 0, 'A successful command must reset the status'); + // Ctrl+C in the terminal: the prompt comes back at once, and a command typed then runs while the first one ends. + terminal.input('linger terminal\r'); + await waitState('terminal', 'running'); + await type('\x03'); + await type('echo next\r'); + const lingerState = await commandState('terminal'); + assert(editor.status === 0 && lastRows(2)[0] === 'next' && ['running', 'stopping'].includes(lingerState), `Ctrl+C must interrupt a C++ command: ${lastRows(3)} ${editor.status} ${lingerState}`); + await waitState('terminal', 'stopping'); + // Pasted lines run one after the other; the last one, without a line break, waits on the prompt. + // Keys typed one by one while a command runs are applied after it, Enter included. + terminal.input('sleep 300\r'); + for (const key of [...'echo ahead', '\r']) terminal.input(key); + await editor.whenIdle(); + await rendered(); + assert(JSON.stringify(lastRows(4)) === JSON.stringify(['> sleep 300', '> echo ahead', 'ahead', '> ']), `Keys typed during a command must be kept: ${lastRows(4)}`); + terminal.paste('echo one\necho two\necho three'); + await editor.whenIdle(); + await rendered(); + assert(JSON.stringify(lastRows(5)) === JSON.stringify(['> echo one', 'one', '> echo two', 'two', '> echo three']), `A multi-line paste must run line by line: ${lastRows(5)}`); + await type('\r'); + assert(lastRows(2)[0] === 'three', 'The pasted last line must run once submitted'); + // Completion of command names, wf subcommands, manifest scripts and project paths. + const completed = async (text, expected) => { + await type(text, '\t'); + assert(editor.line === expected, `${JSON.stringify(text)} must complete to ${JSON.stringify(expected)}: ${JSON.stringify(editor.line)}`); + await type('\x03'); + }; + await completed('ec', 'echo '); + await completed('wf ru', 'wf run '); + await completed('wf run ge', 'wf run gen '); + await completed('echo too', 'echo tools/'); + await completed('echo tools/js', 'echo tools/jsx.tsx '); + await completed('hi', 'history '); + await completed('echo /to', 'echo /to'); // project paths are relative: an absolute one is not completed + // Paths with spaces and quotes: the completion reads the escaped or quoted word and extends it the same way. + await writeFile("my dir/file one's.txt", 'x'); + await completed('echo my\\ d', 'echo my\\ dir/'); + await completed('echo my\\ dir/f', "echo my\\ dir/file\\ one\\'s.txt "); + await completed('echo "my d', 'echo "my dir/'); + await completed('echo "my dir/f', `echo "my dir/file one's.txt" `); + // A single quote cannot be written between single quotes: nothing is inserted. + await completed("echo 'my dir/f", "echo 'my dir/f"); + await type('h', '\t'); + assert(editor.line === 'h' && lastRows(2)[0].includes('help') && lastRows(2)[0].includes('history'), `Several candidates must be listed: ${lastRows(2)}`); + await type('\x03'); + await type('clear\r'); + assert(buffer().length === terminal.rows && rows()[0] === '> ', `clear must empty the screen and the scrollback: ${rows()[0]}`); + // A line taller than the screen is drawn a screen at a time around the cursor, never duplicated on it. + terminal.resize(20, 4); + await rendered(); + const digits = '0123456789'.repeat(10).slice(0, 95); + const tall = '> echo ' + digits; + const layoutRow = index => tall.slice(20 * index, 20 * index + 20); + const screen = () => rows().slice(buffer().baseY, buffer().baseY + terminal.rows); + const shows = (first, cursorY, cursorX, message) => { + const expected = [0, 1, 2, 3].map(index => layoutRow(first + index)); + assert(JSON.stringify(screen()) === JSON.stringify(expected) && buffer().cursorY === cursorY && buffer().cursorX === cursorX, + `${message}: ${JSON.stringify(screen())} at ${buffer().cursorY},${buffer().cursorX}`); + }; + await type('echo ' + digits); + shows(2, 3, 2, 'The end of a tall line must be on screen'); + await type('\x01'); + shows(0, 0, 2, 'Home must show the start of a tall line, once'); + await type('\x05'); + shows(2, 3, 2, 'End must show the end of a tall line again'); + await type('\r'); + assert(lastRows(2)[0] === digits.slice(80) && lastRows(1)[0] === '> ', `A tall line must run: ${screen()}`); + terminal.resize(80, 12); + await type('clear\r'); + // Enter and Ctrl+C typed while a completion is pending: the command starts, then is interrupted at once. + terminal.input('lin'); + terminal.input('\t'); + terminal.input('replay'); + terminal.input('\r'); + terminal.input('\x03'); + await waitState('replay', 'stopping'); + for (let attempt = 0; editor.busy; ++attempt) { + if (attempt === 100) throw new Error(`Ctrl+C typed during a completion must interrupt the replayed command: ${lastRows(3)}`); + await delay(20); + } + assert(editor.status === 130 && lastRows(3)[0] === '> linger replay', `The replayed command must be interrupted: ${lastRows(3)} ${editor.status}`); + // The history is kept per project: a new terminal recalls it. + await runtime.historySaved(); + const saved = JSON.parse(new TextDecoder().decode(await readFile(runtime.historyPath))); + assert(saved.at(-1) === 'linger replay' && saved.includes('clear') && saved.includes('echo three'), `The history must be saved in the project: ${saved.slice(-3)}`); + await type('exit 4\r'); + assert(exitedWith === 4 && editor.closed && lastRows(2)[0] === 'Session ended. Press Enter to start a new session.', `exit must end the session with its code: ${exitedWith}`); + await type('echo ignored'); + assert(!editor.busy && editor.line === '', 'A closed session must ignore input'); + // The window stays open when the browser refuses to close it: Enter starts a new session. + await type('\r'); + assert(!editor.closed && editor.status === 0 && lastRows(1)[0] === '> ', `Enter must start a new session after exit: ${lastRows(2)}`); + await runtime.historySaved(); + terminal.dispose(); + host.replaceChildren(); + const again = await mounted(); + again.terminal.input('\x1b[A'); + await new Promise(resolve => again.terminal.write('', resolve)); + assert(again.editor.line === 'exit 4', `A new terminal must recall the project's history: ${again.editor.line}`); + again.terminal.input('\x03'); + // Two terminals on the same project: each one adds its lines to the history, neither erases the other's. + const otherHost = document.createElement('div'); + otherHost.style.cssText = 'width:640px;height:240px'; + document.body.append(otherHost); + const other = await runtime.mount({bridge: webFront, config, terminal: otherHost, preview: context.preview, onExit: () => {}}); + for (const [session, line] of [[again, 'echo from-first'], [other, 'echo from-second'], [again, 'echo first-again']]) { + session.terminal.input(line + '\r'); + await session.editor.whenIdle(); + } + await runtime.historySaved(); + const shared = JSON.parse(new TextDecoder().decode(await readFile(runtime.historyPath))); + assert(JSON.stringify(shared.slice(-3)) === JSON.stringify(['echo from-first', 'echo from-second', 'echo first-again']), + `Terminals must not erase each other's history: ${shared.slice(-4)}`); + other.terminal.dispose(); + otherHost.remove(); + // Two pages, each with its own runtime module, write their histories at the same time: no line is lost. + const historyFrame = document.createElement('iframe'); + historyFrame.src = '/fixtures/session.html'; + document.body.append(historyFrame); + for (let attempt = 0; !historyFrame.contentWindow?.session; ++attempt) { + if (attempt === 200) throw new Error('The second page did not load'); + await delay(25); + } + const page = await historyFrame.contentWindow.session; + const pageTerminal = await page.runtime.mount({bridge: page.bridge, config, terminal: historyFrame.contentDocument.getElementById('terminal'), + preview: context.preview, onExit: () => {}, fitToElement: false}); + const lines = page => [1, 2, 3, 4, 5].map(index => `echo ${page}${index}`); + again.terminal.paste(lines('here').join('\n') + '\n'); + pageTerminal.terminal.paste(lines('there').join('\n') + '\n'); + await Promise.all([again.editor.whenIdle(), pageTerminal.editor.whenIdle()]); + await Promise.all([runtime.historySaved(), page.runtime.historySaved()]); + const merged = JSON.parse(new TextDecoder().decode(await readFile(runtime.historyPath))); + const missing = [...lines('here'), ...lines('there')].filter(line => !merged.includes(line)); + assert(missing.length === 0, `Concurrent pages must keep every history line: ${missing}`); + // A history that cannot be read is never replaced by the lines of one terminal. + await writeFile(runtime.historyPath, '{broken'); + again.terminal.input('echo kept\r'); + await again.editor.whenIdle(); + await runtime.historySaved(); + assert(new TextDecoder().decode(await readFile(runtime.historyPath)) === '{broken', 'A malformed history must be left unchanged'); + pageTerminal.terminal.dispose(); + historyFrame.remove(); + again.terminal.dispose(); + host.remove(); + // The application stops while this command runs: its shutdown must drain it (checked in C++). + void failure(runtime.runLine('wait final', lineContext())); + await waitState('final', 'running'); + await webFront.cppFunction('test.report')(true, 'WASM + npm + TSX + PI + Life animation + deterministic headers + scripts + type check + terminal passed'); } catch (error) { console.error(error); await webFront.cppFunction('test.report')(false, String(error.stack ?? error)); diff --git a/test/web/js/terminal-specs.mjs b/test/web/js/terminal-specs.mjs deleted file mode 100644 index 99db7cc4..00000000 --- a/test/web/js/terminal-specs.mjs +++ /dev/null @@ -1,162 +0,0 @@ -// Drives the embedded terminal component (served by fs::TerminalFS) against the commands that -// test/web/JasmineTest.cpp registers through webfront::Terminal. Trailing spaces are trimmed when -// reading the screen, so a prompt line reads 'test>'. -import { mount, runLine, tokenize } from '/webfront/components/terminal/terminal.mjs'; - -describe('WebFront terminal component', () => { - let mounted; - let element; - - beforeAll(async () => { - element = document.createElement('div'); - element.style.width = '640px'; - element.style.height = '240px'; - document.body.appendChild(element); - mounted = await mount(element); - }); - - afterAll(() => { - mounted.terminal.dispose(); - element.remove(); - }); - - it('loads the compressed xterm CSS and Fit addon locally and resizes the terminal', async () => { - const initialColumns = mounted.terminal.cols; - expect(initialColumns).toBeGreaterThan(20); - element.style.width = '960px'; - try { - const deadline = Date.now() + 3000; - while (mounted.terminal.cols <= initialColumns && Date.now() < deadline) - await new Promise(resolve => setTimeout(resolve, 20)); - expect(mounted.terminal.cols).toBeGreaterThan(initialColumns); - const style = getComputedStyle(element.querySelector('.xterm')); - expect(style.position).toBe('relative'); - const resources = performance.getEntriesByType('resource') - .filter(entry => entry.name.includes('/webfront/components/terminal/')); - for (const name of ['xterm.mjs', 'xterm.css', 'addon-fit.mjs']) - expect(resources.some(entry => entry.name.endsWith('/' + name))).toBeTrue(); - expect(resources.every(entry => new URL(entry.name).origin === location.origin)).toBeTrue(); - } finally { - element.style.width = '640px'; - const deadline = Date.now() + 3000; - while (mounted.terminal.cols !== initialColumns && Date.now() < deadline) - await new Promise(resolve => setTimeout(resolve, 20)); - } - }); - - function screen() { - const buffer = mounted.terminal.buffer.active; - const lines = []; - for (let index = 0; index < buffer.length; ++index) - lines.push(buffer.getLine(index).translateToString(true)); - return lines.join('\n').trimEnd(); - } - - // Each chunk is delivered like one keyboard event, then the command or completion is awaited. - async function type(...chunks) { - for (const chunk of chunks) { - mounted.terminal.input(chunk); - await mounted.editor.whenIdle(); - } - await mounted.flush(); - return screen(); - } - - it('shows the banner and prompt read from C++', async () => { - await mounted.flush(); - expect(mounted.editor).not.toBeNull(); - expect(screen()).toContain('webtest terminal'); - expect(screen().split('\n').at(-1)).toBe('test>'); - }); - - it('runs a registered C++ command with its parsed arguments', async () => { - const text = await type('greet "Ada Lovelace"\r'); - expect(text).toContain('test> greet "Ada Lovelace"\nHello, Ada Lovelace!\ntest>'); - }); - - it('reports an unknown command without failing the session', async () => { - const text = await type('nope\r'); - expect(text).toContain("Unknown command 'nope'"); - expect(text.split('\n').at(-1)).toBe('test>'); - }); - - it('shows a C++ command exception as an error', async () => { - const text = await type('fail\r'); - expect(text).toContain('Error: terminal command failed'); - expect(text.split('\n').at(-1)).toBe('test>'); - }); - - it('reports an application without terminal functions instead of failing to mount', async () => { - const element = document.createElement('div'); - document.body.appendChild(element); - const missing = { - ready: Promise.resolve(), - cppFunction: (name) => () => Promise.reject(new Error(`C++ function '${name}' was not found`)), - }; - const failed = await mount(element, { bridge: missing }); - await failed.flush(); - expect(failed.editor).toBeNull(); - expect(failed.terminal.buffer.active.getLine(0).translateToString(true)) - .toContain("Terminal unavailable: C++ function 'webfront.terminal."); - failed.terminal.dispose(); - element.remove(); - }); - - it('splits lines into words like C++', () => { - expect(tokenize(`greet 'Ada L' "a\\"b" c\\ d`)).toEqual(['greet', 'Ada L', 'a"b', 'c d']); - expect(() => tokenize('"open')).toThrowError(SyntaxError, 'Unterminated quote'); - expect(() => tokenize('end\\')).toThrowError(SyntaxError, 'Trailing backslash'); - }); - - it('runs browser commands of extensions before C++, which gets the lines they decline', async () => { - const runInCpp = async (line) => `cpp:${line}`; - const progress = []; - const commands = new Map([['tool', async ([action], context) => { - if (action !== 'local') - return undefined; - context.write('step\n'); - return `browser:${context.line}\nsecond line`; - }]]); - const options = {commands, runInCpp, write: (text) => progress.push(text)}; - expect(await runLine('tool local', options)).toBe('browser:tool local\r\nsecond line'); - expect(progress).toEqual(['step\r\n']); - expect(await runLine('tool other', options)).toBe('cpp:tool other'); - expect(await runLine('greet', options)).toBe('cpp:greet'); - expect(await runLine('tool "open', options)).toBe('cpp:tool "open'); - }); - - it('reports an extension module that fails to load and keeps the terminal usable', async () => { - const element = document.createElement('div'); - element.style.width = '1000px'; - element.style.height = '120px'; - document.body.appendChild(element); - const bridge = { - ready: Promise.resolve(), - cppFunction: (name) => async (line) => ({ - 'webfront.terminal.prompt': '> ', - 'webfront.terminal.banner': '', - 'webfront.terminal.extensions': '/webfront/components/tools/missing.mjs', - 'webfront.terminal.run': `ran ${line}`, - })[name], - }; - const withExtension = await mount(element, { bridge }); - await withExtension.flush(); - const text = withExtension.terminal.buffer.active.getLine(0).translateToString(true); - expect(text).toContain('Terminal extension /webfront/components/tools/missing.mjs failed to load'); - expect(withExtension.editor).not.toBeNull(); - withExtension.terminal.dispose(); - element.remove(); - }); - - // Specs run in random order, so this one does not depend on the history left by the others. - it('completes a command name with Tab and recalls history', async () => { - await type('gre', '\t'); - expect(mounted.editor.line).toBe('greet '); - await type('Bob\r'); - expect(screen()).toContain('Hello, Bob!'); - await type('\x1b[A'); - expect(mounted.editor.line).toBe('greet Bob'); - await type('\x03'); - expect(mounted.editor.line).toBe(''); - }); -}); diff --git a/test/web/js/tools-specs.mjs b/test/web/js/tools-specs.mjs deleted file mode 100644 index a81192ff..00000000 --- a/test/web/js/tools-specs.mjs +++ /dev/null @@ -1,271 +0,0 @@ -// Drives the wf tool manager: the browser module served by fs::ToolManagerFS, loaded by the terminal -// as an extension, against the webfront::ToolManager that test/web/JasmineTest.cpp registers with the -// fake npm registry under test/web/registry/ (no public network). Installed tools go to a temporary -// project directory, served by fs::BasicPackageFS. -import { mount } from '/webfront/components/terminal/terminal.mjs'; -import { chunkSize, gunzip, installed, parseSpec, readTar, verifyIntegrity } from '/webfront/components/tools/wf.mjs'; - -const toolName = 'webfront-test-tool'; -const toolUrl = `/webfront/tools/${toolName}/`; -const longPath = 'dist/assets/' + 'nested-directory-with-a-long-name/'.repeat(3) + 'file.txt'; - -async function fetchBytes(url) { - const response = await fetch(url); - if (!response.ok) - throw new Error(`${url}: HTTP ${response.status}`); - return new Uint8Array(await response.arrayBuffer()); -} - -async function sha512(bytes) { - return 'sha512-' + btoa(String.fromCharCode(...new Uint8Array(await crypto.subtle.digest('SHA-512', bytes)))); -} - -// A tar archive of [{path, text}] regular files; a path over 100 bytes gets a GNU long-name entry. -function tar(entries) { - const encoder = new TextEncoder(); - const blocks = []; - const padded = (bytes) => { - const block = new Uint8Array(Math.ceil(bytes.length / 512) * 512); - block.set(bytes); - return block; - }; - const header = (name, size, type) => { - const block = new Uint8Array(512); - const put = (value, offset) => block.set(encoder.encode(value), offset); - put(name.slice(0, 100), 0); - put('0000644\0', 100); - put(size.toString(8).padStart(11, '0') + '\0', 124); - put('00000000000\0', 136); - block.fill(0x20, 148, 156); - put(type, 156); - put('ustar\x0000', 257); - put(block.reduce((sum, byte) => sum + byte, 0).toString(8).padStart(6, '0') + '\0 ', 148); - return block; - }; - for (const {path, text} of entries) { - const bytes = encoder.encode(text); - if (path.length > 100) { - const name = encoder.encode(path + '\0'); - blocks.push(header('././@LongLink', name.length, 'L'), padded(name)); - } - blocks.push(header(path, bytes.length, '0'), padded(bytes)); - } - blocks.push(new Uint8Array(1024)); - return new Uint8Array(blocks.flatMap((block) => [...block])); -} - -async function gzip(bytes) { - return new Uint8Array(await new Response(new Blob([bytes]).stream().pipeThrough(new CompressionStream('gzip'))).arrayBuffer()); -} - -async function fixtureTarball() { - const packument = await (await fetch(`/registry/${toolName}`)).json(); - const {tarball, integrity} = packument.versions['1.0.0'].dist; - return {bytes: await fetchBytes(`/registry/${tarball}`), integrity}; -} - -describe('WebFront wf tool manager', () => { - let mounted; - - beforeAll(async () => { - const element = document.createElement('div'); - element.style.width = '1200px'; - element.style.height = '320px'; - document.body.appendChild(element); - mounted = await mount(element); - }); - - afterAll(() => { - mounted.terminal.dispose(); - }); - - // Wrapped rows are joined, so long output lines read as one. - function screen() { - const buffer = mounted.terminal.buffer.active; - let text = ''; - for (let index = 0; index < buffer.length; ++index) { - const line = buffer.getLine(index); - text += (index > 0 && !line.isWrapped ? '\n' : '') + line.translateToString(true); - } - return text.trimEnd(); - } - - // Clears the screen, runs a line and returns what it printed, without the prompts. - async function run(line) { - for (const chunk of ['clear\r', line + '\r']) { - mounted.terminal.input(chunk); - await mounted.editor.whenIdle(); - } - await mounted.flush(); - const lines = screen().split('\n'); - expect(lines[0]).toBe(`test> ${line}`); - expect(lines.at(-1)).toBe('test>'); - return lines.slice(1, -1).join('\n'); - } - - async function isInstalled(name) { - return (await installed()).some((tool) => tool.name === name); - } - - it('splits package specs into a name and a version', () => { - expect(parseSpec('plot')).toEqual({name: 'plot', version: ''}); - expect(parseSpec('plot@1.2.0')).toEqual({name: 'plot', version: '1.2.0'}); - expect(parseSpec('@acme/plot')).toEqual({name: '@acme/plot', version: ''}); - expect(parseSpec('@acme/plot@next')).toEqual({name: '@acme/plot', version: 'next'}); - }); - - it('verifies the SHA-512 integrity of a tarball and reads its ustar, prefixed and pax paths', async () => { - const {bytes, integrity} = await fixtureTarball(); - expect(await verifyIntegrity(bytes, `sha1-ignored ${integrity}`)).toBe(integrity); - await expectAsync(verifyIntegrity(bytes, 'sha512-' + btoa('x'.repeat(64)))).toBeRejectedWithError(/Integrity check failed/); - await expectAsync(verifyIntegrity(bytes, 'sha1-only')).toBeRejectedWithError(/no SHA-512 integrity/); - - const files = readTar(await gunzip(bytes)); - expect(files.map((file) => file.path)).toEqual([ - 'package/package.json', - 'package/dist/index.html', - 'package/dist/data.bin', - `package/${longPath}`, - 'package/dist/café.txt', - ]); - expect(files[2].bytes.length).toBe(40000); - }); - - it('rejects a corrupt tar header', async () => { - const archive = readTar(new Uint8Array(1024)); // only end-of-archive blocks - expect(archive).toEqual([]); - const corrupt = new Uint8Array(1024); - corrupt.set(new TextEncoder().encode('name'), 0); - expect(() => readTar(corrupt)).toThrowError(/Corrupt tar header/); - }); - - it('lets C++ answer wf help', async () => { - const output = await run('wf help'); - expect(output).toContain('wf install [@version]'); - expect(output).toContain('wf remove '); - }); - - it('searches the registry for web tools', async () => { - const fetched = spyOn(window, 'fetch').and.callThrough(); - const output = await run('wf search test'); - const url = new URL(fetched.calls.mostRecent().args[0], location.href); - expect(url.pathname).toBe('/registry/-/v1/search'); - expect(url.searchParams.get('text')).toBe('keywords:webfront-tool test'); - expect(output).toContain(`${toolName}@1.0.0 Fixture of the WebFront browser integration test`); - }); - - it('installs a tool that is then listed, served, opened and removed', async () => { - const installOutput = await run(`wf install ${toolName}`); - expect(installOutput).toContain(`Downloading ${toolName}@1.0.0`); - expect(installOutput).toContain('Installing 5 files'); - expect(installOutput).toContain(`Installed ${toolName}@1.0.0: Test tool.`); - expect(await run('wf list')).toBe(`${toolName}@1.0.0 Test tool`); - - const page = new TextDecoder().decode(await fetchBytes(`${toolUrl}dist/index.html`)); - expect(page).toContain('webfront-test-tool page'); - const data = await fetchBytes(`${toolUrl}dist/data.bin`); - expect(data.length).toBe(40000); - expect(data.every((byte, index) => byte === index % 251)).toBeTrue(); - expect(new TextDecoder().decode(await fetchBytes(toolUrl + longPath))).toBe('long path\n'); - expect(new TextDecoder().decode(await fetchBytes(`${toolUrl}dist/${encodeURIComponent('café.txt')}`))).toBe('pax path\n'); - - const open = spyOn(window, 'open').and.returnValue({}); - expect(await run(`wf open ${toolName}`)).toBe(`Opened Test tool: ${toolUrl}dist/index.html`); - expect(open).toHaveBeenCalledOnceWith(`${toolUrl}dist/index.html`, '_blank'); - - expect(await run(`wf remove ${toolName}`)).toBe(`Removed ${toolName}.`); - expect((await fetch(`${toolUrl}dist/index.html`)).status).toBe(404); - }); - - it('refuses a tarball whose integrity does not match', async () => { - const output = await run('wf install webfront-test-corrupt'); - expect(output).toContain('Error: Integrity check failed'); - expect(await isInstalled('webfront-test-corrupt')).toBeFalse(); - }); - - it('reports an unknown version or package', async () => { - expect(await run(`wf install ${toolName}@9.9.9`)).toContain(`Error: ${toolName} has no version '9.9.9'`); - expect(await run('wf install webfront-missing-tool')).toMatch(/Error: .*\/registry\/webfront-missing-tool: HTTP 404/); - expect(await isInstalled(toolName)).toBeFalse(); - }); - - it('reports a tool that is not installed or malformed arguments', async () => { - expect(await run('wf open webfront-missing-tool')).toBe('Error: webfront-missing-tool is not installed'); - expect(await run('wf install')).toBe("Error: Wrong number of arguments. Type 'wf help'."); - }); - - it('refuses a tarball that unpacks to more than the limit', async () => { - const bytes = await gzip(new Uint8Array(4096)); - expect((await gunzip(bytes, 4096)).length).toBe(4096); - await expectAsync(gunzip(bytes, 4095)).toBeRejectedWithError(/unpacks to more than 4095 bytes/); - }); - - // Packages built in the page and served by a fetch stub under the fake registry's URL. - describe('with packages published in the page', () => { - const realFetch = window.fetch; - let routes; - - beforeEach(() => { - routes = new Map(); - spyOn(window, 'fetch').and.callFake((url, init) => { - const route = routes.get(new URL(url, location.href).pathname); - return route ? route(init) : realFetch(url, init); - }); - }); - - async function publish(name, entries) { - const tarball = await gzip(tar(entries)); - const packument = { - name, - 'dist-tags': {latest: '1.0.0'}, - versions: {'1.0.0': {name, version: '1.0.0', dist: {tarball: `/registry/tarballs/${name}.tgz`, integrity: await sha512(tarball)}}}, - }; - routes.set(`/registry/${name}`, async () => new Response(JSON.stringify(packument))); - routes.set(`/registry/tarballs/${name}.tgz`, async () => new Response(tarball)); - } - - const manifest = (name) => ({path: 'package/package.json', - text: JSON.stringify({name, version: '1.0.0', webfront: {kind: 'tool', entry: 'index.html', title: name}})}); - - it('installs files larger than a bridge chunk, which the browser sends in several WebSocket frames', async () => { - const big = '0123456789'.repeat(Math.ceil(1.2 * chunkSize / 10)); - await publish('webfront-test-big', [manifest('webfront-test-big'), - {path: 'package/index.html', text: '

big

'}, - {path: 'package/big.txt', text: big}, - {path: 'package/empty.txt', text: ''}, - {path: `package/${'n'.repeat(120)}.txt`, text: 'long name'}]); - expect(await run('wf install webfront-test-big')).toContain('Installed webfront-test-big@1.0.0'); - const tool = '/webfront/tools/webfront-test-big/'; - expect(new TextDecoder().decode(await fetchBytes(`${tool}big.txt`))).toBe(big); - expect((await fetchBytes(`${tool}empty.txt`)).length).toBe(0); - expect(new TextDecoder().decode(await fetchBytes(`${tool}${'n'.repeat(120)}.txt`))).toBe('long name'); - expect(await run('wf remove webfront-test-big')).toBe('Removed webfront-test-big.'); - }); - - it('lets C++ reject a path escaping the tool', async () => { - await publish('webfront-test-evil', [manifest('webfront-test-evil'), - {path: 'package/index.html', text: '

evil

'}, - {path: `package/${'x'.repeat(100)}/../../evil.txt`, text: 'escaped'}]); - expect(await run('wf install webfront-test-evil')).toContain("Error: Unsafe path 'x"); - expect(await isInstalled('webfront-test-evil')).toBeFalse(); - }); - - it('stops an installation with Ctrl+C', async () => { - let started; - const waiting = new Promise((resolve) => { started = resolve; }); - routes.set('/registry/webfront-test-slow', ({signal}) => new Promise((resolve, reject) => { - signal.addEventListener('abort', () => reject(signal.reason)); - started(); - })); - mounted.terminal.input('clear\r'); - await mounted.editor.whenIdle(); - mounted.terminal.input('wf install webfront-test-slow\r'); - await waiting; - mounted.terminal.input('\x03'); - await mounted.editor.whenIdle(); - await mounted.flush(); - expect(screen()).toBe('test> wf install webfront-test-slow\n^C\nError: Interrupted\ntest>'); - expect(await isInstalled('webfront-test-slow')).toBeFalse(); - }); - }); -}); diff --git a/test/web/js/webfront-specs.mjs b/test/web/js/webfront-specs.mjs index 7bf355c4..8e95b93f 100644 --- a/test/web/js/webfront-specs.mjs +++ b/test/web/js/webfront-specs.mjs @@ -1,7 +1,5 @@ import './content-policy-specs.mjs'; import { importedValue } from './module-fixture.mjs'; -import './terminal-specs.mjs'; -import './tools-specs.mjs'; import './react-demo-specs.mjs'; describe('Frontend page URL', () => { diff --git a/test/web/registry/make_fixture.py b/test/web/registry/make_fixture.py deleted file mode 100644 index 7f93df33..00000000 --- a/test/web/registry/make_fixture.py +++ /dev/null @@ -1,81 +0,0 @@ -"""Regenerates the fake npm registry served to test/web/js/tools-specs.mjs: the tarball of the -webfront-test-tool package and the packuments that point at it. Run from any directory: - - python3 test/web/registry/make_fixture.py - -The output is deterministic (no timestamps), so an unchanged script leaves the files unchanged. -""" - -import base64 -import gzip -import hashlib -import io -import json -import pathlib -import tarfile - -HERE = pathlib.Path(__file__).resolve().parent -NAME = "webfront-test-tool" -VERSION = "1.0.0" -TARBALL = f"tarballs/{NAME}-{VERSION}.tgz" - -package_json = { - "name": NAME, - "version": VERSION, - "description": "Fixture of the WebFront browser integration test", - "keywords": ["webfront-tool"], - "webfront": {"kind": "tool", "title": "Test tool", "entry": "dist/index.html"}, -} - -files = { - "package.json": json.dumps(package_json, indent=2).encode() + b"\n", - "dist/index.html": b'\nTest tool\n

webfront-test-tool page

\n', - # Larger than a writeFile chunk (16384 bytes), so it is sent in several chunks. - "dist/data.bin": bytes(index % 251 for index in range(40000)), - # Longer than the 100-byte ustar name field: split between the ustar prefix and name fields. - "dist/assets/" + "nested-directory-with-a-long-name/" * 3 + "file.txt": b"long path\n", - # Non-ASCII: stored in a pax extended header. - "dist/café.txt": b"pax path\n", -} - - -def tarball(): - archive = io.BytesIO() - with tarfile.open(fileobj=archive, mode="w", format=tarfile.PAX_FORMAT) as tar: - for path, data in files.items(): - info = tarfile.TarInfo("package/" + path) - info.size = len(data) - info.mode = 0o644 - info.mtime = 0 - # node-tar, which npm uses, also writes plain ustar headers when a path fits in them. - tar.format = tarfile.PAX_FORMAT if not path.isascii() else tarfile.USTAR_FORMAT - tar.addfile(info, io.BytesIO(data)) - compressed = io.BytesIO() - with gzip.GzipFile(fileobj=compressed, mode="wb", mtime=0) as stream: - stream.write(archive.getvalue()) - return compressed.getvalue() - - -def packument(name, integrity): - return { - "name": name, - "dist-tags": {"latest": VERSION}, - "versions": {VERSION: {"name": name, "version": VERSION, "dist": {"tarball": TARBALL, "integrity": integrity}}}, - } - - -def write_json(path, value): - (HERE / path).write_text(json.dumps(value, indent=2) + "\n", encoding="utf-8", newline="\n") - - -data = tarball() -(HERE / "tarballs").mkdir(exist_ok=True) -(HERE / TARBALL).write_bytes(data) -integrity = "sha512-" + base64.b64encode(hashlib.sha512(data).digest()).decode() -write_json(NAME, packument(NAME, integrity)) -# Same tarball, wrong hash: the installation must be refused. -write_json("webfront-test-corrupt", packument("webfront-test-corrupt", "sha512-" + base64.b64encode(bytes(64)).decode())) -write_json( - "search.json", - {"objects": [{"package": {"name": NAME, "version": VERSION, "description": package_json["description"]}}], "total": 1}, -) diff --git a/test/web/registry/search.json b/test/web/registry/search.json deleted file mode 100644 index 1a95dc83..00000000 --- a/test/web/registry/search.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "objects": [ - { - "package": { - "name": "webfront-test-tool", - "version": "1.0.0", - "description": "Fixture of the WebFront browser integration test" - } - } - ], - "total": 1 -} diff --git a/test/web/registry/tarballs/webfront-test-tool-1.0.0.tgz b/test/web/registry/tarballs/webfront-test-tool-1.0.0.tgz deleted file mode 100644 index 20df3899..00000000 Binary files a/test/web/registry/tarballs/webfront-test-tool-1.0.0.tgz and /dev/null differ diff --git a/test/web/registry/webfront-test-corrupt b/test/web/registry/webfront-test-corrupt deleted file mode 100644 index 928af8cf..00000000 --- a/test/web/registry/webfront-test-corrupt +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "webfront-test-corrupt", - "dist-tags": { - "latest": "1.0.0" - }, - "versions": { - "1.0.0": { - "name": "webfront-test-corrupt", - "version": "1.0.0", - "dist": { - "tarball": "tarballs/webfront-test-tool-1.0.0.tgz", - "integrity": "sha512-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==" - } - } - } -} diff --git a/test/web/registry/webfront-test-tool b/test/web/registry/webfront-test-tool deleted file mode 100644 index 5a08390c..00000000 --- a/test/web/registry/webfront-test-tool +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "webfront-test-tool", - "dist-tags": { - "latest": "1.0.0" - }, - "versions": { - "1.0.0": { - "name": "webfront-test-tool", - "version": "1.0.0", - "dist": { - "tarball": "tarballs/webfront-test-tool-1.0.0.tgz", - "integrity": "sha512-WA/PcGQdG7416UoBzMF+yoZyiE37RiTyqgw8Aj5AaJWkEU/rXHvfTYM4X/0BGRWHQCxRSJKlE7MKgsJvih/t2w==" - } - } - } -} diff --git a/third_party/xterm/LICENSE b/third_party/xterm/LICENSE deleted file mode 100644 index 4472336c..00000000 --- a/third_party/xterm/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -Copyright (c) 2017-2019, The xterm.js authors (https://github.com/xtermjs/xterm.js) -Copyright (c) 2014-2016, SourceLair Private Company (https://www.sourcelair.com) -Copyright (c) 2012-2013, Christopher Jeffrey (https://github.com/chjj/) - -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. diff --git a/third_party/xterm/VERSION b/third_party/xterm/VERSION deleted file mode 100644 index 19a6fe9d..00000000 --- a/third_party/xterm/VERSION +++ /dev/null @@ -1,2 +0,0 @@ -@xterm/xterm 6.0.0 -@xterm/addon-fit 0.11.0 diff --git a/third_party/xterm/addon-fit-LICENSE b/third_party/xterm/addon-fit-LICENSE deleted file mode 100644 index 8f178925..00000000 --- a/third_party/xterm/addon-fit-LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2019, The xterm.js authors (https://github.com/xtermjs/xterm.js) - -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. diff --git a/third_party/xterm/addon-fit.mjs b/third_party/xterm/addon-fit.mjs deleted file mode 100644 index 24d4f618..00000000 --- a/third_party/xterm/addon-fit.mjs +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved. - * @license MIT - * - * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License) - * @license MIT - * - * Originally forked from (with the author's permission): - * Fabrice Bellard's javascript vt100 for jslinux: - * http://bellard.org/jslinux/ - * Copyright (c) 2011 Fabrice Bellard - */ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var h=2,_=1,o=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let t=this._terminal._core._renderService.dimensions;if(t.css.cell.width===0||t.css.cell.height===0)return;let s=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,r=window.getComputedStyle(this._terminal.element.parentElement),l=parseInt(r.getPropertyValue("height")),a=Math.max(0,parseInt(r.getPropertyValue("width"))),i=window.getComputedStyle(this._terminal.element),n={top:parseInt(i.getPropertyValue("padding-top")),bottom:parseInt(i.getPropertyValue("padding-bottom")),right:parseInt(i.getPropertyValue("padding-right")),left:parseInt(i.getPropertyValue("padding-left"))},m=n.top+n.bottom,d=n.right+n.left,c=l-m,p=a-d-s;return{cols:Math.max(h,Math.floor(p/t.css.cell.width)),rows:Math.max(_,Math.floor(c/t.css.cell.height))}}};export{o as FitAddon}; -//# sourceMappingURL=addon-fit.mjs.map diff --git a/third_party/xterm/xterm.css b/third_party/xterm/xterm.css deleted file mode 100644 index 819654e4..00000000 --- a/third_party/xterm/xterm.css +++ /dev/null @@ -1,285 +0,0 @@ -/** - * Copyright (c) 2014 The xterm.js authors. All rights reserved. - * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License) - * https://github.com/chjj/term.js - * @license MIT - * - * 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. - * - * Originally forked from (with the author's permission): - * Fabrice Bellard's javascript vt100 for jslinux: - * http://bellard.org/jslinux/ - * Copyright (c) 2011 Fabrice Bellard - * The original design remains. The terminal itself - * has been extended to include xterm CSI codes, among - * other features. - */ - -/** - * Default styles for xterm.js - */ - -.xterm { - cursor: text; - position: relative; - user-select: none; - -ms-user-select: none; - -webkit-user-select: none; -} - -.xterm.focus, -.xterm:focus { - outline: none; -} - -.xterm .xterm-helpers { - position: absolute; - top: 0; - /** - * The z-index of the helpers must be higher than the canvases in order for - * IMEs to appear on top. - */ - z-index: 5; -} - -.xterm .xterm-helper-textarea { - padding: 0; - border: 0; - margin: 0; - /* Move textarea out of the screen to the far left, so that the cursor is not visible */ - position: absolute; - opacity: 0; - left: -9999em; - top: 0; - width: 0; - height: 0; - z-index: -5; - /** Prevent wrapping so the IME appears against the textarea at the correct position */ - white-space: nowrap; - overflow: hidden; - resize: none; -} - -.xterm .composition-view { - /* TODO: Composition position got messed up somewhere */ - background: #000; - color: #FFF; - display: none; - position: absolute; - white-space: nowrap; - z-index: 1; -} - -.xterm .composition-view.active { - display: block; -} - -.xterm .xterm-viewport { - /* On OS X this is required in order for the scroll bar to appear fully opaque */ - background-color: #000; - overflow-y: scroll; - cursor: default; - position: absolute; - right: 0; - left: 0; - top: 0; - bottom: 0; -} - -.xterm .xterm-screen { - position: relative; -} - -.xterm .xterm-screen canvas { - position: absolute; - left: 0; - top: 0; -} - -.xterm-char-measure-element { - display: inline-block; - visibility: hidden; - position: absolute; - top: 0; - left: -9999em; - line-height: normal; -} - -.xterm.enable-mouse-events { - /* When mouse events are enabled (eg. tmux), revert to the standard pointer cursor */ - cursor: default; -} - -.xterm.xterm-cursor-pointer, -.xterm .xterm-cursor-pointer { - cursor: pointer; -} - -.xterm.column-select.focus { - /* Column selection mode */ - cursor: crosshair; -} - -.xterm .xterm-accessibility:not(.debug), -.xterm .xterm-message { - position: absolute; - left: 0; - top: 0; - bottom: 0; - right: 0; - z-index: 10; - color: transparent; - pointer-events: none; -} - -.xterm .xterm-accessibility-tree:not(.debug) *::selection { - color: transparent; -} - -.xterm .xterm-accessibility-tree { - font-family: monospace; - user-select: text; - white-space: pre; -} - -.xterm .xterm-accessibility-tree > div { - transform-origin: left; - width: fit-content; -} - -.xterm .live-region { - position: absolute; - left: -9999px; - width: 1px; - height: 1px; - overflow: hidden; -} - -.xterm-dim { - /* Dim should not apply to background, so the opacity of the foreground color is applied - * explicitly in the generated class and reset to 1 here */ - opacity: 1 !important; -} - -.xterm-underline-1 { text-decoration: underline; } -.xterm-underline-2 { text-decoration: double underline; } -.xterm-underline-3 { text-decoration: wavy underline; } -.xterm-underline-4 { text-decoration: dotted underline; } -.xterm-underline-5 { text-decoration: dashed underline; } - -.xterm-overline { - text-decoration: overline; -} - -.xterm-overline.xterm-underline-1 { text-decoration: overline underline; } -.xterm-overline.xterm-underline-2 { text-decoration: overline double underline; } -.xterm-overline.xterm-underline-3 { text-decoration: overline wavy underline; } -.xterm-overline.xterm-underline-4 { text-decoration: overline dotted underline; } -.xterm-overline.xterm-underline-5 { text-decoration: overline dashed underline; } - -.xterm-strikethrough { - text-decoration: line-through; -} - -.xterm-screen .xterm-decoration-container .xterm-decoration { - z-index: 6; - position: absolute; -} - -.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer { - z-index: 7; -} - -.xterm-decoration-overview-ruler { - z-index: 8; - position: absolute; - top: 0; - right: 0; - pointer-events: none; -} - -.xterm-decoration-top { - z-index: 2; - position: relative; -} - - - -/* Derived from vs/base/browser/ui/scrollbar/media/scrollbar.css */ - -/* xterm.js customization: Override xterm's cursor style */ -.xterm .xterm-scrollable-element > .scrollbar { - cursor: default; -} - -/* Arrows */ -.xterm .xterm-scrollable-element > .scrollbar > .scra { - cursor: pointer; - font-size: 11px !important; -} - -.xterm .xterm-scrollable-element > .visible { - opacity: 1; - - /* Background rule added for IE9 - to allow clicks on dom node */ - background:rgba(0,0,0,0); - - transition: opacity 100ms linear; - /* In front of peek view */ - z-index: 11; -} -.xterm .xterm-scrollable-element > .invisible { - opacity: 0; - pointer-events: none; -} -.xterm .xterm-scrollable-element > .invisible.fade { - transition: opacity 800ms linear; -} - -/* Scrollable Content Inset Shadow */ -.xterm .xterm-scrollable-element > .shadow { - position: absolute; - display: none; -} -.xterm .xterm-scrollable-element > .shadow.top { - display: block; - top: 0; - left: 3px; - height: 3px; - width: 100%; - box-shadow: var(--vscode-scrollbar-shadow, #000) 0 6px 6px -6px inset; -} -.xterm .xterm-scrollable-element > .shadow.left { - display: block; - top: 3px; - left: 0; - height: 100%; - width: 3px; - box-shadow: var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset; -} -.xterm .xterm-scrollable-element > .shadow.top-left-corner { - display: block; - top: 0; - left: 0; - height: 3px; - width: 3px; -} -.xterm .xterm-scrollable-element > .shadow.top.left { - box-shadow: var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset; -} diff --git a/third_party/xterm/xterm.mjs b/third_party/xterm/xterm.mjs deleted file mode 100644 index d5402562..00000000 --- a/third_party/xterm/xterm.mjs +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved. - * @license MIT - * - * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License) - * @license MIT - * - * Originally forked from (with the author's permission): - * Fabrice Bellard's javascript vt100 for jslinux: - * http://bellard.org/jslinux/ - * Copyright (c) 2011 Fabrice Bellard - */ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var zs=Object.defineProperty;var Rl=Object.getOwnPropertyDescriptor;var Ll=(s,t)=>{for(var e in t)zs(s,e,{get:t[e],enumerable:!0})};var M=(s,t,e,i)=>{for(var r=i>1?void 0:i?Rl(t,e):t,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(t,e,r):o(r))||r);return i&&r&&zs(t,e,r),r},S=(s,t)=>(e,i)=>t(e,i,s);var Gs="Terminal input",mi={get:()=>Gs,set:s=>Gs=s},$s="Too much output to announce, navigate to rows manually to read",_i={get:()=>$s,set:s=>$s=s};function Al(s){return s.replace(/\r?\n/g,"\r")}function kl(s,t){return t?"\x1B[200~"+s+"\x1B[201~":s}function Vs(s,t){s.clipboardData&&s.clipboardData.setData("text/plain",t.selectionText),s.preventDefault()}function qs(s,t,e,i){if(s.stopPropagation(),s.clipboardData){let r=s.clipboardData.getData("text/plain");Cn(r,t,e,i)}}function Cn(s,t,e,i){s=Al(s),s=kl(s,e.decPrivateModes.bracketedPasteMode&&i.rawOptions.ignoreBracketedPasteMode!==!0),e.triggerDataEvent(s,!0),t.value=""}function Mn(s,t,e){let i=e.getBoundingClientRect(),r=s.clientX-i.left-10,n=s.clientY-i.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${r}px`,t.style.top=`${n}px`,t.style.zIndex="1000",t.focus()}function Pn(s,t,e,i,r){Mn(s,t,e),r&&i.rightClickSelect(s),t.value=i.selectionText,t.select()}function Ce(s){return s>65535?(s-=65536,String.fromCharCode((s>>10)+55296)+String.fromCharCode(s%1024+56320)):String.fromCharCode(s)}function It(s,t=0,e=s.length){let i="";for(let r=t;r65535?(n-=65536,i+=String.fromCharCode((n>>10)+55296)+String.fromCharCode(n%1024+56320)):i+=String.fromCharCode(n)}return i}var er=class{constructor(){this._interim=0}clear(){this._interim=0}decode(t,e){let i=t.length;if(!i)return 0;let r=0,n=0;if(this._interim){let o=t.charCodeAt(n++);56320<=o&&o<=57343?e[r++]=(this._interim-55296)*1024+o-56320+65536:(e[r++]=this._interim,e[r++]=o),this._interim=0}for(let o=n;o=i)return this._interim=l,r;let a=t.charCodeAt(o);56320<=a&&a<=57343?e[r++]=(l-55296)*1024+a-56320+65536:(e[r++]=l,e[r++]=a);continue}l!==65279&&(e[r++]=l)}return r}},tr=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(t,e){let i=t.length;if(!i)return 0;let r=0,n,o,l,a,u=0,h=0;if(this.interim[0]){let _=!1,p=this.interim[0];p&=(p&224)===192?31:(p&240)===224?15:7;let m=0,f;for(;(f=this.interim[++m]&63)&&m<4;)p<<=6,p|=f;let A=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,R=A-m;for(;h=i)return 0;if(f=t[h++],(f&192)!==128){h--,_=!0;break}else this.interim[m++]=f,p<<=6,p|=f&63}_||(A===2?p<128?h--:e[r++]=p:A===3?p<2048||p>=55296&&p<=57343||p===65279||(e[r++]=p):p<65536||p>1114111||(e[r++]=p)),this.interim.fill(0)}let c=i-4,d=h;for(;d=i)return this.interim[0]=n,r;if(o=t[d++],(o&192)!==128){d--;continue}if(u=(n&31)<<6|o&63,u<128){d--;continue}e[r++]=u}else if((n&240)===224){if(d>=i)return this.interim[0]=n,r;if(o=t[d++],(o&192)!==128){d--;continue}if(d>=i)return this.interim[0]=n,this.interim[1]=o,r;if(l=t[d++],(l&192)!==128){d--;continue}if(u=(n&15)<<12|(o&63)<<6|l&63,u<2048||u>=55296&&u<=57343||u===65279)continue;e[r++]=u}else if((n&248)===240){if(d>=i)return this.interim[0]=n,r;if(o=t[d++],(o&192)!==128){d--;continue}if(d>=i)return this.interim[0]=n,this.interim[1]=o,r;if(l=t[d++],(l&192)!==128){d--;continue}if(d>=i)return this.interim[0]=n,this.interim[1]=o,this.interim[2]=l,r;if(a=t[d++],(a&192)!==128){d--;continue}if(u=(n&7)<<18|(o&63)<<12|(l&63)<<6|a&63,u<65536||u>1114111)continue;e[r++]=u}}return r}};var ir="";var we=" ";var De=class s{constructor(){this.fg=0;this.bg=0;this.extended=new rt}static toColorRGB(t){return[t>>>16&255,t>>>8&255,t&255]}static fromColorRGB(t){return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255}clone(){let t=new s;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},rt=class s{constructor(t=0,e=0){this._ext=0;this._urlId=0;this._ext=t,this._urlId=e}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(t){this._ext&=-67108864,this._ext|=t&67108863}get urlId(){return this._urlId}set urlId(t){this._urlId=t}get underlineVariantOffset(){let t=(this._ext&3758096384)>>29;return t<0?t^4294967288:t}set underlineVariantOffset(t){this._ext&=536870911,this._ext|=t<<29&3758096384}clone(){return new s(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}};var q=class s extends De{constructor(){super(...arguments);this.content=0;this.fg=0;this.bg=0;this.extended=new rt;this.combinedData=""}static fromCharData(e){let i=new s;return i.setFromCharData(e),i}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?Ce(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let i=!1;if(e[1].length>2)i=!0;else if(e[1].length===2){let r=e[1].charCodeAt(0);if(55296<=r&&r<=56319){let n=e[1].charCodeAt(1);56320<=n&&n<=57343?this.content=(r-55296)*1024+n-56320+65536|e[2]<<22:i=!0}else i=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;i&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}};var js="di$target",Hn="di$dependencies",Fn=new Map;function Xs(s){return s[Hn]||[]}function ie(s){if(Fn.has(s))return Fn.get(s);let t=function(e,i,r){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");Pl(t,e,r)};return t._id=s,Fn.set(s,t),t}function Pl(s,t,e){t[js]===t?t[Hn].push({id:s,index:e}):(t[Hn]=[{id:s,index:e}],t[js]=t)}var F=ie("BufferService"),rr=ie("CoreMouseService"),ge=ie("CoreService"),Zs=ie("CharsetService"),xt=ie("InstantiationService");var nr=ie("LogService"),H=ie("OptionsService"),sr=ie("OscLinkService"),Js=ie("UnicodeService"),Be=ie("DecorationService");var wt=class{constructor(t,e,i){this._bufferService=t;this._optionsService=e;this._oscLinkService=i}provideLinks(t,e){let i=this._bufferService.buffer.lines.get(t-1);if(!i){e(void 0);return}let r=[],n=this._optionsService.rawOptions.linkHandler,o=new q,l=i.getTrimmedLength(),a=-1,u=-1,h=!1;for(let c=0;cn?n.activate(m,f,_):Ol(m,f),hover:(m,f)=>n?.hover?.(m,f,_),leave:(m,f)=>n?.leave?.(m,f,_)})}h=!1,o.hasExtendedAttrs()&&o.extended.urlId?(u=c,a=o.extended.urlId):(u=-1,a=-1)}}e(r)}};wt=M([S(0,F),S(1,H),S(2,sr)],wt);function Ol(s,t){if(confirm(`Do you want to navigate to ${t}? - -WARNING: This link could potentially be dangerous`)){let i=window.open();if(i){try{i.opener=null}catch{}i.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}var nt=ie("CharSizeService"),ae=ie("CoreBrowserService"),Dt=ie("MouseService"),ce=ie("RenderService"),Qs=ie("SelectionService"),or=ie("CharacterJoinerService"),Re=ie("ThemeService"),lr=ie("LinkProviderService");var Wn=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(t){setTimeout(()=>{throw t.stack?ar.isErrorNoTelemetry(t)?new ar(t.message+` - -`+t.stack):new Error(t.message+` - -`+t.stack):t},0)}}addListener(t){return this.listeners.push(t),()=>{this._removeListener(t)}}emit(t){this.listeners.forEach(e=>{e(t)})}_removeListener(t){this.listeners.splice(this.listeners.indexOf(t),1)}setUnexpectedErrorHandler(t){this.unexpectedErrorHandler=t}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(t){this.unexpectedErrorHandler(t),this.emit(t)}onUnexpectedExternalError(t){this.unexpectedErrorHandler(t)}},Bl=new Wn;function Lt(s){Nl(s)||Bl.onUnexpectedError(s)}var Un="Canceled";function Nl(s){return s instanceof bi?!0:s instanceof Error&&s.name===Un&&s.message===Un}var bi=class extends Error{constructor(){super(Un),this.name=this.message}};function eo(s){return s?new Error(`Illegal argument: ${s}`):new Error("Illegal argument")}var ar=class s extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof s)return t;let e=new s;return e.message=t.message,e.stack=t.stack,e}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},Rt=class s extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,s.prototype)}};function Fl(s,t,e=0,i=s.length){let r=e,n=i;for(;r{function s(a){return a<0}l.isLessThan=s;function t(a){return a<=0}l.isLessThanOrEqual=t;function e(a){return a>0}l.isGreaterThan=e;function i(a){return a===0}l.isNeitherLessOrGreaterThan=i,l.greaterThan=1,l.lessThan=-1,l.neitherLessOrGreaterThan=0})(ro||={});function no(s,t){return(e,i)=>t(s(e),s(i))}var so=(s,t)=>s-t;var At=class At{constructor(t){this.iterate=t}forEach(t){this.iterate(e=>(t(e),!0))}toArray(){let t=[];return this.iterate(e=>(t.push(e),!0)),t}filter(t){return new At(e=>this.iterate(i=>t(i)?e(i):!0))}map(t){return new At(e=>this.iterate(i=>e(t(i))))}some(t){let e=!1;return this.iterate(i=>(e=t(i),!e)),e}findFirst(t){let e;return this.iterate(i=>t(i)?(e=i,!1):!0),e}findLast(t){let e;return this.iterate(i=>(t(i)&&(e=i),!0)),e}findLastMaxBy(t){let e,i=!0;return this.iterate(r=>((i||ro.isGreaterThan(t(r,e)))&&(i=!1,e=r),!0)),e}};At.empty=new At(t=>{});var io=At;function co(s,t){let e=Object.create(null);for(let i of s){let r=t(i),n=e[r];n||(n=e[r]=[]),n.push(i)}return e}var lo,ao,oo=class{constructor(t,e){this.toKey=e;this._map=new Map;this[lo]="SetWithKey";for(let i of t)this.add(i)}get size(){return this._map.size}add(t){let e=this.toKey(t);return this._map.set(e,t),this}delete(t){return this._map.delete(this.toKey(t))}has(t){return this._map.has(this.toKey(t))}*entries(){for(let t of this._map.values())yield[t,t]}keys(){return this.values()}*values(){for(let t of this._map.values())yield t}clear(){this._map.clear()}forEach(t,e){this._map.forEach(i=>t.call(e,i,i,this))}[(ao=Symbol.iterator,lo=Symbol.toStringTag,ao)](){return this.values()}};var ur=class{constructor(){this.map=new Map}add(t,e){let i=this.map.get(t);i||(i=new Set,this.map.set(t,i)),i.add(e)}delete(t,e){let i=this.map.get(t);i&&(i.delete(e),i.size===0&&this.map.delete(t))}forEach(t,e){let i=this.map.get(t);i&&i.forEach(e)}get(t){let e=this.map.get(t);return e||new Set}};function Kn(s,t){let e=this,i=!1,r;return function(){if(i)return r;if(i=!0,t)try{r=s.apply(e,arguments)}finally{t()}else r=s.apply(e,arguments);return r}}var zn;(O=>{function s(I){return I&&typeof I=="object"&&typeof I[Symbol.iterator]=="function"}O.is=s;let t=Object.freeze([]);function e(){return t}O.empty=e;function*i(I){yield I}O.single=i;function r(I){return s(I)?I:i(I)}O.wrap=r;function n(I){return I||t}O.from=n;function*o(I){for(let k=I.length-1;k>=0;k--)yield I[k]}O.reverse=o;function l(I){return!I||I[Symbol.iterator]().next().done===!0}O.isEmpty=l;function a(I){return I[Symbol.iterator]().next().value}O.first=a;function u(I,k){let P=0;for(let oe of I)if(k(oe,P++))return!0;return!1}O.some=u;function h(I,k){for(let P of I)if(k(P))return P}O.find=h;function*c(I,k){for(let P of I)k(P)&&(yield P)}O.filter=c;function*d(I,k){let P=0;for(let oe of I)yield k(oe,P++)}O.map=d;function*_(I,k){let P=0;for(let oe of I)yield*k(oe,P++)}O.flatMap=_;function*p(...I){for(let k of I)yield*k}O.concat=p;function m(I,k,P){let oe=P;for(let Me of I)oe=k(oe,Me);return oe}O.reduce=m;function*f(I,k,P=I.length){for(k<0&&(k+=I.length),P<0?P+=I.length:P>I.length&&(P=I.length);ki.source!==null&&!this.getRootParent(i,t).isSingleton).flatMap(([i])=>i)}computeLeakingDisposables(t=10,e){let i;if(e)i=e;else{let a=new Map,u=[...this.livingDisposables.values()].filter(c=>c.source!==null&&!this.getRootParent(c,a).isSingleton);if(u.length===0)return;let h=new Set(u.map(c=>c.value));if(i=u.filter(c=>!(c.parent&&h.has(c.parent))),i.length===0)throw new Error("There are cyclic diposable chains!")}if(!i)return;function r(a){function u(c,d){for(;c.length>0&&d.some(_=>typeof _=="string"?_===c[0]:c[0].match(_));)c.shift()}let h=a.source.split(` -`).map(c=>c.trim().replace("at ","")).filter(c=>c!=="");return u(h,["Error",/^trackDisposable \(.*\)$/,/^DisposableTracker.trackDisposable \(.*\)$/]),h.reverse()}let n=new ur;for(let a of i){let u=r(a);for(let h=0;h<=u.length;h++)n.add(u.slice(0,h).join(` -`),a)}i.sort(no(a=>a.idx,so));let o="",l=0;for(let a of i.slice(0,t)){l++;let u=r(a),h=[];for(let c=0;cr(f)[c]),f=>f);delete m[u[c]];for(let[f,A]of Object.entries(m))h.unshift(` - stacktraces of ${A.length} other leaks continue with ${f}`);h.unshift(d)}o+=` - - -==================== Leaking disposable ${l}/${i.length}: ${a.value.constructor.name} ==================== -${h.join(` -`)} -============================================================ - -`}return i.length>t&&(o+=` - - -... and ${i.length-t} more leaking disposables - -`),{leaks:i,details:o}}};hr.idx=0;var uo=hr;function Ul(s){dt=s}if(Wl){let s="__is_disposable_tracked__";Ul(new class{trackDisposable(t){let e=new Error("Potentially leaked disposable").stack;setTimeout(()=>{t[s]||console.log(e)},3e3)}setParent(t,e){if(t&&t!==D.None)try{t[s]=!0}catch{}}markAsDisposed(t){if(t&&t!==D.None)try{t[s]=!0}catch{}}markAsSingleton(t){}})}function fr(s){return dt?.trackDisposable(s),s}function pr(s){dt?.markAsDisposed(s)}function vi(s,t){dt?.setParent(s,t)}function Kl(s,t){if(dt)for(let e of s)dt.setParent(e,t)}function Gn(s){return dt?.markAsSingleton(s),s}function Ne(s){if(zn.is(s)){let t=[];for(let e of s)if(e)try{e.dispose()}catch(i){t.push(i)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(s)?[]:s}else if(s)return s.dispose(),s}function ho(...s){let t=C(()=>Ne(s));return Kl(s,t),t}function C(s){let t=fr({dispose:Kn(()=>{pr(t),s()})});return t}var dr=class dr{constructor(){this._toDispose=new Set;this._isDisposed=!1;fr(this)}dispose(){this._isDisposed||(pr(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Ne(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return vi(t,this),this._isDisposed?dr.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),vi(t,null))}};dr.DISABLE_DISPOSED_WARNING=!1;var Ee=dr,D=class{constructor(){this._store=new Ee;fr(this),vi(this._store,this)}dispose(){pr(this),this._store.dispose()}_register(t){if(t===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(t)}};D.None=Object.freeze({dispose(){}});var ye=class{constructor(){this._isDisposed=!1;fr(this)}get value(){return this._isDisposed?void 0:this._value}set value(t){this._isDisposed||t===this._value||(this._value?.dispose(),t&&vi(t,this),this._value=t)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,pr(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){let t=this._value;return this._value=void 0,t&&vi(t,null),t}};var fe=typeof window=="object"?window:globalThis;var kt=class kt{constructor(t){this.element=t,this.next=kt.Undefined,this.prev=kt.Undefined}};kt.Undefined=new kt(void 0);var G=kt,Ct=class{constructor(){this._first=G.Undefined;this._last=G.Undefined;this._size=0}get size(){return this._size}isEmpty(){return this._first===G.Undefined}clear(){let t=this._first;for(;t!==G.Undefined;){let e=t.next;t.prev=G.Undefined,t.next=G.Undefined,t=e}this._first=G.Undefined,this._last=G.Undefined,this._size=0}unshift(t){return this._insert(t,!1)}push(t){return this._insert(t,!0)}_insert(t,e){let i=new G(t);if(this._first===G.Undefined)this._first=i,this._last=i;else if(e){let n=this._last;this._last=i,i.prev=n,n.next=i}else{let n=this._first;this._first=i,i.next=n,n.prev=i}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(i))}}shift(){if(this._first!==G.Undefined){let t=this._first.element;return this._remove(this._first),t}}pop(){if(this._last!==G.Undefined){let t=this._last.element;return this._remove(this._last),t}}_remove(t){if(t.prev!==G.Undefined&&t.next!==G.Undefined){let e=t.prev;e.next=t.next,t.next.prev=e}else t.prev===G.Undefined&&t.next===G.Undefined?(this._first=G.Undefined,this._last=G.Undefined):t.next===G.Undefined?(this._last=this._last.prev,this._last.next=G.Undefined):t.prev===G.Undefined&&(this._first=this._first.next,this._first.prev=G.Undefined);this._size-=1}*[Symbol.iterator](){let t=this._first;for(;t!==G.Undefined;)yield t.element,t=t.next}};var zl=globalThis.performance&&typeof globalThis.performance.now=="function",mr=class s{static create(t){return new s(t)}constructor(t){this._now=zl&&t===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}};var Gl=!1,fo=!1,$l=!1,$;(Qe=>{Qe.None=()=>D.None;function t(y){if($l){let{onDidAddListener:T}=y,g=gi.create(),w=0;y.onDidAddListener=()=>{++w===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),g.print()),T?.()}}}function e(y,T){return d(y,()=>{},0,void 0,!0,void 0,T)}Qe.defer=e;function i(y){return(T,g=null,w)=>{let E=!1,x;return x=y(N=>{if(!E)return x?x.dispose():E=!0,T.call(g,N)},null,w),E&&x.dispose(),x}}Qe.once=i;function r(y,T,g){return h((w,E=null,x)=>y(N=>w.call(E,T(N)),null,x),g)}Qe.map=r;function n(y,T,g){return h((w,E=null,x)=>y(N=>{T(N),w.call(E,N)},null,x),g)}Qe.forEach=n;function o(y,T,g){return h((w,E=null,x)=>y(N=>T(N)&&w.call(E,N),null,x),g)}Qe.filter=o;function l(y){return y}Qe.signal=l;function a(...y){return(T,g=null,w)=>{let E=ho(...y.map(x=>x(N=>T.call(g,N))));return c(E,w)}}Qe.any=a;function u(y,T,g,w){let E=g;return r(y,x=>(E=T(E,x),E),w)}Qe.reduce=u;function h(y,T){let g,w={onWillAddFirstListener(){g=y(E.fire,E)},onDidRemoveLastListener(){g?.dispose()}};T||t(w);let E=new v(w);return T?.add(E),E.event}function c(y,T){return T instanceof Array?T.push(y):T&&T.add(y),y}function d(y,T,g=100,w=!1,E=!1,x,N){let Z,te,Oe,ze=0,le,et={leakWarningThreshold:x,onWillAddFirstListener(){Z=y(ht=>{ze++,te=T(te,ht),w&&!Oe&&(me.fire(te),te=void 0),le=()=>{let fi=te;te=void 0,Oe=void 0,(!w||ze>1)&&me.fire(fi),ze=0},typeof g=="number"?(clearTimeout(Oe),Oe=setTimeout(le,g)):Oe===void 0&&(Oe=0,queueMicrotask(le))})},onWillRemoveListener(){E&&ze>0&&le?.()},onDidRemoveLastListener(){le=void 0,Z.dispose()}};N||t(et);let me=new v(et);return N?.add(me),me.event}Qe.debounce=d;function _(y,T=0,g){return Qe.debounce(y,(w,E)=>w?(w.push(E),w):[E],T,void 0,!0,void 0,g)}Qe.accumulate=_;function p(y,T=(w,E)=>w===E,g){let w=!0,E;return o(y,x=>{let N=w||!T(x,E);return w=!1,E=x,N},g)}Qe.latch=p;function m(y,T,g){return[Qe.filter(y,T,g),Qe.filter(y,w=>!T(w),g)]}Qe.split=m;function f(y,T=!1,g=[],w){let E=g.slice(),x=y(te=>{E?E.push(te):Z.fire(te)});w&&w.add(x);let N=()=>{E?.forEach(te=>Z.fire(te)),E=null},Z=new v({onWillAddFirstListener(){x||(x=y(te=>Z.fire(te)),w&&w.add(x))},onDidAddFirstListener(){E&&(T?setTimeout(N):N())},onDidRemoveLastListener(){x&&x.dispose(),x=null}});return w&&w.add(Z),Z.event}Qe.buffer=f;function A(y,T){return(w,E,x)=>{let N=T(new O);return y(function(Z){let te=N.evaluate(Z);te!==R&&w.call(E,te)},void 0,x)}}Qe.chain=A;let R=Symbol("HaltChainable");class O{constructor(){this.steps=[]}map(T){return this.steps.push(T),this}forEach(T){return this.steps.push(g=>(T(g),g)),this}filter(T){return this.steps.push(g=>T(g)?g:R),this}reduce(T,g){let w=g;return this.steps.push(E=>(w=T(w,E),w)),this}latch(T=(g,w)=>g===w){let g=!0,w;return this.steps.push(E=>{let x=g||!T(E,w);return g=!1,w=E,x?E:R}),this}evaluate(T){for(let g of this.steps)if(T=g(T),T===R)break;return T}}function I(y,T,g=w=>w){let w=(...Z)=>N.fire(g(...Z)),E=()=>y.on(T,w),x=()=>y.removeListener(T,w),N=new v({onWillAddFirstListener:E,onDidRemoveLastListener:x});return N.event}Qe.fromNodeEventEmitter=I;function k(y,T,g=w=>w){let w=(...Z)=>N.fire(g(...Z)),E=()=>y.addEventListener(T,w),x=()=>y.removeEventListener(T,w),N=new v({onWillAddFirstListener:E,onDidRemoveLastListener:x});return N.event}Qe.fromDOMEventEmitter=k;function P(y){return new Promise(T=>i(y)(T))}Qe.toPromise=P;function oe(y){let T=new v;return y.then(g=>{T.fire(g)},()=>{T.fire(void 0)}).finally(()=>{T.dispose()}),T.event}Qe.fromPromise=oe;function Me(y,T){return y(g=>T.fire(g))}Qe.forward=Me;function Pe(y,T,g){return T(g),y(w=>T(w))}Qe.runAndSubscribe=Pe;class Ke{constructor(T,g){this._observable=T;this._counter=0;this._hasChanged=!1;let w={onWillAddFirstListener:()=>{T.addObserver(this)},onDidRemoveLastListener:()=>{T.removeObserver(this)}};g||t(w),this.emitter=new v(w),g&&g.add(this.emitter)}beginUpdate(T){this._counter++}handlePossibleChange(T){}handleChange(T,g){this._hasChanged=!0}endUpdate(T){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function di(y,T){return new Ke(y,T).emitter.event}Qe.fromObservable=di;function V(y){return(T,g,w)=>{let E=0,x=!1,N={beginUpdate(){E++},endUpdate(){E--,E===0&&(y.reportChanges(),x&&(x=!1,T.call(g)))},handlePossibleChange(){},handleChange(){x=!0}};y.addObserver(N),y.reportChanges();let Z={dispose(){y.removeObserver(N)}};return w instanceof Ee?w.add(Z):Array.isArray(w)&&w.push(Z),Z}}Qe.fromObservableLight=V})($||={});var Mt=class Mt{constructor(t){this.listenerCount=0;this.invocationCount=0;this.elapsedOverall=0;this.durations=[];this.name=`${t}_${Mt._idPool++}`,Mt.all.add(this)}start(t){this._stopWatch=new mr,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};Mt.all=new Set,Mt._idPool=0;var $n=Mt,po=-1;var br=class br{constructor(t,e,i=(br._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t;this.threshold=e;this.name=i;this._warnCountdown=0}dispose(){this._stacks?.clear()}check(t,e){let i=this.threshold;if(i<=0||e{let n=this._stacks.get(t.value)||0;this._stacks.set(t.value,n-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,e=0;for(let[i,r]of this._stacks)(!t||e{if(s instanceof Pt)t(s);else for(let e=0;e{s.length!==0&&(console.warn("[LEAKING LISTENERS] GC'ed these listeners that were NOT yet disposed:"),console.warn(s.join(` -`)),s.length=0)},3e3),_r=new FinalizationRegistry(t=>{typeof t=="string"&&s.push(t)})}var v=class{constructor(t){this._size=0;this._options=t,this._leakageMon=po>0||this._options?.leakWarningThreshold?new Vn(t?.onListenerError??Lt,this._options?.leakWarningThreshold??po):void 0,this._perfMon=this._options?._profName?new $n(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){if(!this._disposed){if(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners){if(fo){let t=this._listeners;queueMicrotask(()=>{Yl(t,e=>e.stack?.print())})}this._listeners=void 0,this._size=0}this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose()}}get event(){return this._event??=(t,e,i)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let a=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(a);let u=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],h=new Yn(`${a}. HINT: Stack shows most frequent listener (${u[1]}-times)`,u[0]);return(this._options?.onListenerError||Lt)(h),D.None}if(this._disposed)return D.None;e&&(t=t.bind(e));let r=new Pt(t),n,o;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=gi.create(),n=this._leakageMon.check(r.stack,this._size+1)),fo&&(r.stack=o??gi.create()),this._listeners?this._listeners instanceof Pt?(this._deliveryQueue??=new jn,this._listeners=[this._listeners,r]):this._listeners.push(r):(this._options?.onWillAddFirstListener?.(this),this._listeners=r,this._options?.onDidAddFirstListener?.(this)),this._size++;let l=C(()=>{_r?.unregister(l),n?.(),this._removeListener(r)});if(i instanceof Ee?i.add(l):Array.isArray(i)&&i.push(l),_r){let a=new Error().stack.split(` -`).slice(2,3).join(` -`).trim(),u=/(file:|vscode-file:\/\/vscode-app)?(\/[^:]*:\d+:\d+)/.exec(a);_r.register(l,u?.[2]??a,l)}return l},this._event}_removeListener(t){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let e=this._listeners,i=e.indexOf(t);if(i===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,e[i]=void 0;let r=this._deliveryQueue.current===this;if(this._size*ql<=e.length){let n=0;for(let o=0;o0}};var jn=class{constructor(){this.i=-1;this.end=0}enqueue(t,e,i){this.i=0,this.end=i,this.current=t,this.value=e}reset(){this.i=this.end,this.current=void 0,this.value=void 0}};var gr=class gr{constructor(){this.mapWindowIdToZoomLevel=new Map;this._onDidChangeZoomLevel=new v;this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event;this.mapWindowIdToZoomFactor=new Map;this._onDidChangeFullscreen=new v;this.onDidChangeFullscreen=this._onDidChangeFullscreen.event;this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,e){if(this.getZoomLevel(e)===t)return;let i=this.getWindowId(e);this.mapWindowIdToZoomLevel.set(i,t),this._onDidChangeZoomLevel.fire(i)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,e){this.mapWindowIdToZoomFactor.set(this.getWindowId(e),t)}setFullscreen(t,e){if(this.isFullscreen(e)===t)return;let i=this.getWindowId(e);this.mapWindowIdToFullScreen.set(i,t),this._onDidChangeFullscreen.fire(i)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};gr.INSTANCE=new gr;var Si=gr;function Xl(s,t,e){typeof t=="string"&&(t=s.matchMedia(t)),t.addEventListener("change",e)}var Eu=Si.INSTANCE.onDidChangeZoomLevel;function mo(s){return Si.INSTANCE.getZoomFactor(s)}var Tu=Si.INSTANCE.onDidChangeFullscreen,Ot=typeof navigator=="object"?navigator.userAgent:"",Ei=Ot.indexOf("Firefox")>=0,Bt=Ot.indexOf("AppleWebKit")>=0,Ti=Ot.indexOf("Chrome")>=0,Sr=!Ti&&Ot.indexOf("Safari")>=0;var Iu=Ot.indexOf("Electron/")>=0,yu=Ot.indexOf("Android")>=0,vr=!1;if(typeof fe.matchMedia=="function"){let s=fe.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=fe.matchMedia("(display-mode: fullscreen)");vr=s.matches,Xl(fe,s,({matches:e})=>{vr&&t.matches||(vr=e)})}function _o(){return vr}var Nt="en",yr=!1,xr=!1,Ii=!1,Zl=!1,vo=!1,go=!1,Jl=!1,Ql=!1,ea=!1,ta=!1,Tr,Ir=Nt,bo=Nt,ia,$e,Ve=globalThis,xe;typeof Ve.vscode<"u"&&typeof Ve.vscode.process<"u"?xe=Ve.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(xe=process);var So=typeof xe?.versions?.electron=="string",ra=So&&xe?.type==="renderer";if(typeof xe=="object"){yr=xe.platform==="win32",xr=xe.platform==="darwin",Ii=xe.platform==="linux",Zl=Ii&&!!xe.env.SNAP&&!!xe.env.SNAP_REVISION,Jl=So,ea=!!xe.env.CI||!!xe.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Tr=Nt,Ir=Nt;let s=xe.env.VSCODE_NLS_CONFIG;if(s)try{let t=JSON.parse(s);Tr=t.userLocale,bo=t.osLocale,Ir=t.resolvedLanguage||Nt,ia=t.languagePack?.translationsConfigFile}catch{}vo=!0}else typeof navigator=="object"&&!ra?($e=navigator.userAgent,yr=$e.indexOf("Windows")>=0,xr=$e.indexOf("Macintosh")>=0,Ql=($e.indexOf("Macintosh")>=0||$e.indexOf("iPad")>=0||$e.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Ii=$e.indexOf("Linux")>=0,ta=$e?.indexOf("Mobi")>=0,go=!0,Ir=globalThis._VSCODE_NLS_LANGUAGE||Nt,Tr=navigator.language.toLowerCase(),bo=Tr):console.error("Unable to resolve platform.");var Xn=0;xr?Xn=1:yr?Xn=3:Ii&&(Xn=2);var wr=yr,Te=xr,Zn=Ii;var Dr=vo;var na=go&&typeof Ve.importScripts=="function",xu=na?Ve.origin:void 0;var Fe=$e,st=Ir,sa;(i=>{function s(){return st}i.value=s;function t(){return st.length===2?st==="en":st.length>=3?st[0]==="e"&&st[1]==="n"&&st[2]==="-":!1}i.isDefaultVariant=t;function e(){return st==="en"}i.isDefault=e})(sa||={});var oa=typeof Ve.postMessage=="function"&&!Ve.importScripts,Eo=(()=>{if(oa){let s=[];Ve.addEventListener("message",e=>{if(e.data&&e.data.vscodeScheduleAsyncWork)for(let i=0,r=s.length;i{let i=++t;s.push({id:i,callback:e}),Ve.postMessage({vscodeScheduleAsyncWork:i},"*")}}return s=>setTimeout(s)})();var la=!!(Fe&&Fe.indexOf("Chrome")>=0),wu=!!(Fe&&Fe.indexOf("Firefox")>=0),Du=!!(!la&&Fe&&Fe.indexOf("Safari")>=0),Ru=!!(Fe&&Fe.indexOf("Edg/")>=0),Lu=!!(Fe&&Fe.indexOf("Android")>=0);var ot=typeof navigator=="object"?navigator:{},aa={clipboard:{writeText:Dr||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(ot&&ot.clipboard&&ot.clipboard.writeText),readText:Dr||!!(ot&&ot.clipboard&&ot.clipboard.readText)},keyboard:Dr||_o()?0:ot.keyboard||Sr?1:2,touch:"ontouchstart"in fe||ot.maxTouchPoints>0,pointerEvents:fe.PointerEvent&&("ontouchstart"in fe||navigator.maxTouchPoints>0)};var yi=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(t,e){this._keyCodeToStr[t]=e,this._strToKeyCode[e.toLowerCase()]=t}keyCodeToStr(t){return this._keyCodeToStr[t]}strToKeyCode(t){return this._strToKeyCode[t.toLowerCase()]||0}},Jn=new yi,To=new yi,Io=new yi,yo=new Array(230);var Qn;(o=>{function s(l){return Jn.keyCodeToStr(l)}o.toString=s;function t(l){return Jn.strToKeyCode(l)}o.fromString=t;function e(l){return To.keyCodeToStr(l)}o.toUserSettingsUS=e;function i(l){return Io.keyCodeToStr(l)}o.toUserSettingsGeneral=i;function r(l){return To.strToKeyCode(l)||Io.strToKeyCode(l)}o.fromUserSettings=r;function n(l){if(l>=98&&l<=113)return null;switch(l){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return Jn.keyCodeToStr(l)}o.toElectronAccelerator=n})(Qn||={});var Rr=class s{constructor(t,e,i,r,n){this.ctrlKey=t;this.shiftKey=e;this.altKey=i;this.metaKey=r;this.keyCode=n}equals(t){return t instanceof s&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){let t=this.ctrlKey?"1":"0",e=this.shiftKey?"1":"0",i=this.altKey?"1":"0",r=this.metaKey?"1":"0";return`K${t}${e}${i}${r}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new es([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}};var es=class{constructor(t){if(t.length===0)throw eo("chords");this.chords=t}getHashCode(){let t="";for(let e=0,i=this.chords.length;e{function s(r){return r===i.None||r===i.Cancelled||r instanceof ts?!0:!r||typeof r!="object"?!1:typeof r.isCancellationRequested=="boolean"&&typeof r.onCancellationRequested=="function"}i.isCancellationToken=s,i.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:$.None}),i.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Do})})(ma||={});var ts=class{constructor(){this._isCancelled=!1;this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?Do:(this._emitter||(this._emitter=new v),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}};var _a=Symbol("MicrotaskDelay");var Ye=class{constructor(t,e){this._isDisposed=!1;this._token=-1,typeof t=="function"&&typeof e=="number"&&this.setIfNotSet(t,e)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(t,e){if(this._isDisposed)throw new Rt("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,t()},e)}setIfNotSet(t,e){if(this._isDisposed)throw new Rt("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,t()},e))}},kr=class{constructor(){this.disposable=void 0;this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(t,e,i=globalThis){if(this.isDisposed)throw new Rt("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let r=i.setInterval(()=>{t()},e);this.disposable=C(()=>{i.clearInterval(r),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}};var ba,Ar;(function(){typeof globalThis.requestIdleCallback!="function"||typeof globalThis.cancelIdleCallback!="function"?Ar=(s,t)=>{Eo(()=>{if(e)return;let i=Date.now()+15;t(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,i-Date.now())}}))});let e=!1;return{dispose(){e||(e=!0)}}}:Ar=(s,t,e)=>{let i=s.requestIdleCallback(t,typeof e=="number"?{timeout:e}:void 0),r=!1;return{dispose(){r||(r=!0,s.cancelIdleCallback(i))}}},ba=s=>Ar(globalThis,s)})();var va;(e=>{async function s(i){let r,n=await Promise.all(i.map(o=>o.then(l=>l,l=>{r||(r=l)})));if(typeof r<"u")throw r;return n}e.settled=s;function t(i){return new Promise(async(r,n)=>{try{await i(r,n)}catch(o){n(o)}})}e.withAsyncBody=t})(va||={});var _e=class _e{static fromArray(t){return new _e(e=>{e.emitMany(t)})}static fromPromise(t){return new _e(async e=>{e.emitMany(await t)})}static fromPromises(t){return new _e(async e=>{await Promise.all(t.map(async i=>e.emitOne(await i)))})}static merge(t){return new _e(async e=>{await Promise.all(t.map(async i=>{for await(let r of i)e.emitOne(r)}))})}constructor(t,e){this._state=0,this._results=[],this._error=null,this._onReturn=e,this._onStateChanged=new v,queueMicrotask(async()=>{let i={emitOne:r=>this.emitOne(r),emitMany:r=>this.emitMany(r),reject:r=>this.reject(r)};try{await Promise.resolve(t(i)),this.resolve()}catch(r){this.reject(r)}finally{i.emitOne=void 0,i.emitMany=void 0,i.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,e){return new _e(async i=>{for await(let r of t)i.emitOne(e(r))})}map(t){return _e.map(this,t)}static filter(t,e){return new _e(async i=>{for await(let r of t)e(r)&&i.emitOne(r)})}filter(t){return _e.filter(this,t)}static coalesce(t){return _e.filter(t,e=>!!e)}coalesce(){return _e.coalesce(this)}static async toPromise(t){let e=[];for await(let i of t)e.push(i);return e}toPromise(){return _e.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};_e.EMPTY=_e.fromArray([]);var Ro=_e;function Lo(s){return 55296<=s&&s<=56319}function is(s){return 56320<=s&&s<=57343}function Ao(s,t){return(s-55296<<10)+(t-56320)+65536}function Mo(s){return ns(s,0)}function ns(s,t){switch(typeof s){case"object":return s===null?je(349,t):Array.isArray(s)?Ea(s,t):Ta(s,t);case"string":return Po(s,t);case"boolean":return Sa(s,t);case"number":return je(s,t);case"undefined":return je(937,t);default:return je(617,t)}}function je(s,t){return(t<<5)-t+s|0}function Sa(s,t){return je(s?433:863,t)}function Po(s,t){t=je(149417,t);for(let e=0,i=s.length;ens(i,e),t)}function Ta(s,t){return t=je(181387,t),Object.keys(s).sort().reduce((e,i)=>(e=Po(i,e),ns(s[i],e)),t)}function rs(s,t,e=32){let i=e-t,r=~((1<>>i)>>>0}function ko(s,t=0,e=s.byteLength,i=0){for(let r=0;re.toString(16).padStart(2,"0")).join(""):Ia((s>>>0).toString(16),t/4)}var Cr=class Cr{constructor(){this._h0=1732584193;this._h1=4023233417;this._h2=2562383102;this._h3=271733878;this._h4=3285377520;this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(t){let e=t.length;if(e===0)return;let i=this._buff,r=this._buffLen,n=this._leftoverHighSurrogate,o,l;for(n!==0?(o=n,l=-1,n=0):(o=t.charCodeAt(0),l=0);;){let a=o;if(Lo(o))if(l+1>>6,t[e++]=128|(i&63)>>>0):i<65536?(t[e++]=224|(i&61440)>>>12,t[e++]=128|(i&4032)>>>6,t[e++]=128|(i&63)>>>0):(t[e++]=240|(i&1835008)>>>18,t[e++]=128|(i&258048)>>>12,t[e++]=128|(i&4032)>>>6,t[e++]=128|(i&63)>>>0),e>=64&&(this._step(),e-=64,this._totalLen+=64,t[0]=t[64],t[1]=t[65],t[2]=t[66]),e}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),wi(this._h0)+wi(this._h1)+wi(this._h2)+wi(this._h3)+wi(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,ko(this._buff,this._buffLen),this._buffLen>56&&(this._step(),ko(this._buff));let t=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(t/4294967296),!1),this._buffDV.setUint32(60,t%4294967296,!1),this._step()}_step(){let t=Cr._bigBlock32,e=this._buffDV;for(let c=0;c<64;c+=4)t.setUint32(c,e.getUint32(c,!1),!1);for(let c=64;c<320;c+=4)t.setUint32(c,rs(t.getUint32(c-12,!1)^t.getUint32(c-32,!1)^t.getUint32(c-56,!1)^t.getUint32(c-64,!1),1),!1);let i=this._h0,r=this._h1,n=this._h2,o=this._h3,l=this._h4,a,u,h;for(let c=0;c<80;c++)c<20?(a=r&n|~r&o,u=1518500249):c<40?(a=r^n^o,u=1859775393):c<60?(a=r&n|r&o|n&o,u=2400959708):(a=r^n^o,u=3395469782),h=rs(i,5)+a+l+u+t.getUint32(c*4,!1)&4294967295,l=o,o=n,n=rs(r,30),r=i,i=h;this._h0=this._h0+i&4294967295,this._h1=this._h1+r&4294967295,this._h2=this._h2+n&4294967295,this._h3=this._h3+o&4294967295,this._h4=this._h4+l&4294967295}};Cr._bigBlock32=new DataView(new ArrayBuffer(320));var Co=Cr;var{registerWindow:Bh,getWindow:be,getDocument:Nh,getWindows:Fh,getWindowsCount:Hh,getWindowId:Oo,getWindowById:Wh,hasWindow:Uh,onDidRegisterWindow:No,onWillUnregisterWindow:Kh,onDidUnregisterWindow:zh}=function(){let s=new Map;fe;let t={window:fe,disposables:new Ee};s.set(fe.vscodeWindowId,t);let e=new v,i=new v,r=new v;function n(o,l){return(typeof o=="number"?s.get(o):void 0)??(l?t:void 0)}return{onDidRegisterWindow:e.event,onWillUnregisterWindow:r.event,onDidUnregisterWindow:i.event,registerWindow(o){if(s.has(o.vscodeWindowId))return D.None;let l=new Ee,a={window:o,disposables:l.add(new Ee)};return s.set(o.vscodeWindowId,a),l.add(C(()=>{s.delete(o.vscodeWindowId),i.fire(o)})),l.add(L(o,Y.BEFORE_UNLOAD,()=>{r.fire(o)})),e.fire(a),l},getWindows(){return s.values()},getWindowsCount(){return s.size},getWindowId(o){return o.vscodeWindowId},hasWindow(o){return s.has(o)},getWindowById:n,getWindow(o){let l=o;if(l?.ownerDocument?.defaultView)return l.ownerDocument.defaultView.window;let a=o;return a?.view?a.view.window:fe},getDocument(o){return be(o).document}}}();var ss=class{constructor(t,e,i,r){this._node=t,this._type=e,this._handler=i,this._options=r||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function L(s,t,e,i){return new ss(s,t,e,i)}function ya(s,t){return function(e){return t(new qe(s,e))}}function xa(s){return function(t){return s(new ft(t))}}var os=function(t,e,i,r){let n=i;return e==="click"||e==="mousedown"||e==="contextmenu"?n=ya(be(t),i):(e==="keydown"||e==="keypress"||e==="keyup")&&(n=xa(i)),L(t,e,n,r)};var wa,mt;var Mr=class extends kr{constructor(t){super(),this.defaultTarget=t&&be(t)}cancelAndSet(t,e,i){return super.cancelAndSet(t,e,i??this.defaultTarget)}},Di=class{constructor(t,e=0){this._runner=t,this.priority=e,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(t){Lt(t)}}static sort(t,e){return e.priority-t.priority}};(function(){let s=new Map,t=new Map,e=new Map,i=new Map,r=n=>{e.set(n,!1);let o=s.get(n)??[];for(t.set(n,o),s.set(n,[]),i.set(n,!0);o.length>0;)o.sort(Di.sort),o.shift().execute();i.set(n,!1)};mt=(n,o,l=0)=>{let a=Oo(n),u=new Di(o,l),h=s.get(a);return h||(h=[],s.set(a,h)),h.push(u),e.get(a)||(e.set(a,!0),n.requestAnimationFrame(()=>r(a))),u},wa=(n,o,l)=>{let a=Oo(n);if(i.get(a)){let u=new Di(o,l),h=t.get(a);return h||(h=[],t.set(a,h)),h.push(u),u}else return mt(n,o,l)}})();var pt=class pt{constructor(t,e){this.width=t;this.height=e}with(t=this.width,e=this.height){return t!==this.width||e!==this.height?new pt(t,e):this}static is(t){return typeof t=="object"&&typeof t.height=="number"&&typeof t.width=="number"}static lift(t){return t instanceof pt?t:new pt(t.width,t.height)}static equals(t,e){return t===e?!0:!t||!e?!1:t.width===e.width&&t.height===e.height}};pt.None=new pt(0,0);var Bo=pt;function Fo(s){let t=s.getBoundingClientRect(),e=be(s);return{left:t.left+e.scrollX,top:t.top+e.scrollY,width:t.width,height:t.height}}var Gh=new class{constructor(){this.mutationObservers=new Map}observe(s,t,e){let i=this.mutationObservers.get(s);i||(i=new Map,this.mutationObservers.set(s,i));let r=Mo(e),n=i.get(r);if(n)n.users+=1;else{let o=new v,l=new MutationObserver(u=>o.fire(u));l.observe(s,e);let a=n={users:1,observer:l,onDidMutate:o.event};t.add(C(()=>{a.users-=1,a.users===0&&(o.dispose(),l.disconnect(),i?.delete(r),i?.size===0&&this.mutationObservers.delete(s))})),i.set(r,n)}return n.onDidMutate}};var Y={CLICK:"click",AUXCLICK:"auxclick",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",POINTER_LEAVE:"pointerleave",CONTEXT_MENU:"contextmenu",WHEEL:"wheel",KEY_DOWN:"keydown",KEY_PRESS:"keypress",KEY_UP:"keyup",LOAD:"load",BEFORE_UNLOAD:"beforeunload",UNLOAD:"unload",PAGE_SHOW:"pageshow",PAGE_HIDE:"pagehide",PASTE:"paste",ABORT:"abort",ERROR:"error",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_CHANGE:"fullscreenchange",WK_FULLSCREEN_CHANGE:"webkitfullscreenchange",SELECT:"select",CHANGE:"change",SUBMIT:"submit",RESET:"reset",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",STORAGE:"storage",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend",ANIMATION_START:Bt?"webkitAnimationStart":"animationstart",ANIMATION_END:Bt?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:Bt?"webkitAnimationIteration":"animationiteration"};var Da=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;function Ho(s,t,e,...i){let r=Da.exec(t);if(!r)throw new Error("Bad use of emmet");let n=r[1]||"div",o;return s!=="http://www.w3.org/1999/xhtml"?o=document.createElementNS(s,n):o=document.createElement(n),r[3]&&(o.id=r[3]),r[4]&&(o.className=r[4].replace(/\./g," ").trim()),e&&Object.entries(e).forEach(([l,a])=>{typeof a>"u"||(/^on\w+$/.test(l)?o[l]=a:l==="selected"?a&&o.setAttribute(l,"true"):o.setAttribute(l,a))}),o.append(...i),o}function Ra(s,t,...e){return Ho("http://www.w3.org/1999/xhtml",s,t,...e)}Ra.SVG=function(s,t,...e){return Ho("http://www.w3.org/2000/svg",s,t,...e)};var ls=class{constructor(t){this.domNode=t;this._maxWidth="";this._width="";this._height="";this._top="";this._left="";this._bottom="";this._right="";this._paddingTop="";this._paddingLeft="";this._paddingBottom="";this._paddingRight="";this._fontFamily="";this._fontWeight="";this._fontSize="";this._fontStyle="";this._fontFeatureSettings="";this._fontVariationSettings="";this._textDecoration="";this._lineHeight="";this._letterSpacing="";this._className="";this._display="";this._position="";this._visibility="";this._color="";this._backgroundColor="";this._layerHint=!1;this._contain="none";this._boxShadow=""}setMaxWidth(t){let e=Ie(t);this._maxWidth!==e&&(this._maxWidth=e,this.domNode.style.maxWidth=this._maxWidth)}setWidth(t){let e=Ie(t);this._width!==e&&(this._width=e,this.domNode.style.width=this._width)}setHeight(t){let e=Ie(t);this._height!==e&&(this._height=e,this.domNode.style.height=this._height)}setTop(t){let e=Ie(t);this._top!==e&&(this._top=e,this.domNode.style.top=this._top)}setLeft(t){let e=Ie(t);this._left!==e&&(this._left=e,this.domNode.style.left=this._left)}setBottom(t){let e=Ie(t);this._bottom!==e&&(this._bottom=e,this.domNode.style.bottom=this._bottom)}setRight(t){let e=Ie(t);this._right!==e&&(this._right=e,this.domNode.style.right=this._right)}setPaddingTop(t){let e=Ie(t);this._paddingTop!==e&&(this._paddingTop=e,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(t){let e=Ie(t);this._paddingLeft!==e&&(this._paddingLeft=e,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(t){let e=Ie(t);this._paddingBottom!==e&&(this._paddingBottom=e,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(t){let e=Ie(t);this._paddingRight!==e&&(this._paddingRight=e,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(t){this._fontFamily!==t&&(this._fontFamily=t,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(t){this._fontWeight!==t&&(this._fontWeight=t,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(t){let e=Ie(t);this._fontSize!==e&&(this._fontSize=e,this.domNode.style.fontSize=this._fontSize)}setFontStyle(t){this._fontStyle!==t&&(this._fontStyle=t,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(t){this._fontFeatureSettings!==t&&(this._fontFeatureSettings=t,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(t){this._fontVariationSettings!==t&&(this._fontVariationSettings=t,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(t){this._textDecoration!==t&&(this._textDecoration=t,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(t){let e=Ie(t);this._lineHeight!==e&&(this._lineHeight=e,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(t){let e=Ie(t);this._letterSpacing!==e&&(this._letterSpacing=e,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(t){this._className!==t&&(this._className=t,this.domNode.className=this._className)}toggleClassName(t,e){this.domNode.classList.toggle(t,e),this._className=this.domNode.className}setDisplay(t){this._display!==t&&(this._display=t,this.domNode.style.display=this._display)}setPosition(t){this._position!==t&&(this._position=t,this.domNode.style.position=this._position)}setVisibility(t){this._visibility!==t&&(this._visibility=t,this.domNode.style.visibility=this._visibility)}setColor(t){this._color!==t&&(this._color=t,this.domNode.style.color=this._color)}setBackgroundColor(t){this._backgroundColor!==t&&(this._backgroundColor=t,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(t){this._layerHint!==t&&(this._layerHint=t,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(t){this._boxShadow!==t&&(this._boxShadow=t,this.domNode.style.boxShadow=t)}setContain(t){this._contain!==t&&(this._contain=t,this.domNode.style.contain=this._contain)}setAttribute(t,e){this.domNode.setAttribute(t,e)}removeAttribute(t){this.domNode.removeAttribute(t)}appendChild(t){this.domNode.appendChild(t.domNode)}removeChild(t){this.domNode.removeChild(t.domNode)}};function Ie(s){return typeof s=="number"?`${s}px`:s}function _t(s){return new ls(s)}var Wt=class{constructor(){this._hooks=new Ee;this._pointerMoveCallback=null;this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(t,e){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let i=this._onStopCallback;this._onStopCallback=null,t&&i&&i(e)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(t,e,i,r,n){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=r,this._onStopCallback=n;let o=t;try{t.setPointerCapture(e),this._hooks.add(C(()=>{try{t.releasePointerCapture(e)}catch{}}))}catch{o=be(t)}this._hooks.add(L(o,Y.POINTER_MOVE,l=>{if(l.buttons!==i){this.stopMonitoring(!0);return}l.preventDefault(),this._pointerMoveCallback(l)})),this._hooks.add(L(o,Y.POINTER_UP,l=>this.stopMonitoring(!0)))}};function Wo(s,t,e){let i=null,r=null;if(typeof e.value=="function"?(i="value",r=e.value,r.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof e.get=="function"&&(i="get",r=e.get),!r)throw new Error("not supported");let n=`$memoize$${t}`;e[i]=function(...o){return this.hasOwnProperty(n)||Object.defineProperty(this,n,{configurable:!1,enumerable:!1,writable:!1,value:r.apply(this,o)}),this[n]}}var He;(n=>(n.Tap="-xterm-gesturetap",n.Change="-xterm-gesturechange",n.Start="-xterm-gesturestart",n.End="-xterm-gesturesend",n.Contextmenu="-xterm-gesturecontextmenu"))(He||={});var Q=class Q extends D{constructor(){super();this.dispatched=!1;this.targets=new Ct;this.ignoreTargets=new Ct;this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register($.runAndSubscribe(No,({window:e,disposables:i})=>{i.add(L(e.document,"touchstart",r=>this.onTouchStart(r),{passive:!1})),i.add(L(e.document,"touchend",r=>this.onTouchEnd(e,r))),i.add(L(e.document,"touchmove",r=>this.onTouchMove(r),{passive:!1}))},{window:fe,disposables:this._store}))}static addTarget(e){if(!Q.isTouchDevice())return D.None;Q.INSTANCE||(Q.INSTANCE=Gn(new Q));let i=Q.INSTANCE.targets.push(e);return C(i)}static ignoreTarget(e){if(!Q.isTouchDevice())return D.None;Q.INSTANCE||(Q.INSTANCE=Gn(new Q));let i=Q.INSTANCE.ignoreTargets.push(e);return C(i)}static isTouchDevice(){return"ontouchstart"in fe||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(e){let i=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let r=0,n=e.targetTouches.length;r=Q.HOLD_DELAY&&Math.abs(u.initialPageX-Se(u.rollingPageX))<30&&Math.abs(u.initialPageY-Se(u.rollingPageY))<30){let c=this.newGestureEvent(He.Contextmenu,u.initialTarget);c.pageX=Se(u.rollingPageX),c.pageY=Se(u.rollingPageY),this.dispatchEvent(c)}else if(n===1){let c=Se(u.rollingPageX),d=Se(u.rollingPageY),_=Se(u.rollingTimestamps)-u.rollingTimestamps[0],p=c-u.rollingPageX[0],m=d-u.rollingPageY[0],f=[...this.targets].filter(A=>u.initialTarget instanceof Node&&A.contains(u.initialTarget));this.inertia(e,f,r,Math.abs(p)/_,p>0?1:-1,c,Math.abs(m)/_,m>0?1:-1,d)}this.dispatchEvent(this.newGestureEvent(He.End,u.initialTarget)),delete this.activeTouches[a.identifier]}this.dispatched&&(i.preventDefault(),i.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,i){let r=document.createEvent("CustomEvent");return r.initEvent(e,!1,!0),r.initialTarget=i,r.tapCount=0,r}dispatchEvent(e){if(e.type===He.Tap){let i=new Date().getTime(),r=0;i-this._lastSetTapCountTime>Q.CLEAR_TAP_COUNT_TIME?r=1:r=2,this._lastSetTapCountTime=i,e.tapCount=r}else(e.type===He.Change||e.type===He.Contextmenu)&&(this._lastSetTapCountTime=0);if(e.initialTarget instanceof Node){for(let r of this.ignoreTargets)if(r.contains(e.initialTarget))return;let i=[];for(let r of this.targets)if(r.contains(e.initialTarget)){let n=0,o=e.initialTarget;for(;o&&o!==r;)n++,o=o.parentElement;i.push([n,r])}i.sort((r,n)=>r[0]-n[0]);for(let[r,n]of i)n.dispatchEvent(e),this.dispatched=!0}}inertia(e,i,r,n,o,l,a,u,h){this.handle=mt(e,()=>{let c=Date.now(),d=c-r,_=0,p=0,m=!0;n+=Q.SCROLL_FRICTION*d,a+=Q.SCROLL_FRICTION*d,n>0&&(m=!1,_=o*n*d),a>0&&(m=!1,p=u*a*d);let f=this.newGestureEvent(He.Change);f.translationX=_,f.translationY=p,i.forEach(A=>A.dispatchEvent(f)),m||this.inertia(e,i,c,n,o,l+_,a,u,h+p)})}onTouchMove(e){let i=Date.now();for(let r=0,n=e.changedTouches.length;r3&&(l.rollingPageX.shift(),l.rollingPageY.shift(),l.rollingTimestamps.shift()),l.rollingPageX.push(o.pageX),l.rollingPageY.push(o.pageY),l.rollingTimestamps.push(i)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}};Q.SCROLL_FRICTION=-.005,Q.HOLD_DELAY=700,Q.CLEAR_TAP_COUNT_TIME=400,M([Wo],Q,"isTouchDevice",1);var Pr=Q;var lt=class extends D{onclick(t,e){this._register(L(t,Y.CLICK,i=>e(new qe(be(t),i))))}onmousedown(t,e){this._register(L(t,Y.MOUSE_DOWN,i=>e(new qe(be(t),i))))}onmouseover(t,e){this._register(L(t,Y.MOUSE_OVER,i=>e(new qe(be(t),i))))}onmouseleave(t,e){this._register(L(t,Y.MOUSE_LEAVE,i=>e(new qe(be(t),i))))}onkeydown(t,e){this._register(L(t,Y.KEY_DOWN,i=>e(new ft(i))))}onkeyup(t,e){this._register(L(t,Y.KEY_UP,i=>e(new ft(i))))}oninput(t,e){this._register(L(t,Y.INPUT,e))}onblur(t,e){this._register(L(t,Y.BLUR,e))}onfocus(t,e){this._register(L(t,Y.FOCUS,e))}onchange(t,e){this._register(L(t,Y.CHANGE,e))}ignoreGesture(t){return Pr.ignoreTarget(t)}};var Uo=11,Or=class extends lt{constructor(t){super(),this._onActivate=t.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=t.bgWidth+"px",this.bgDomNode.style.height=t.bgHeight+"px",typeof t.top<"u"&&(this.bgDomNode.style.top="0px"),typeof t.left<"u"&&(this.bgDomNode.style.left="0px"),typeof t.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof t.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=t.className,this.domNode.style.position="absolute",this.domNode.style.width=Uo+"px",this.domNode.style.height=Uo+"px",typeof t.top<"u"&&(this.domNode.style.top=t.top+"px"),typeof t.left<"u"&&(this.domNode.style.left=t.left+"px"),typeof t.bottom<"u"&&(this.domNode.style.bottom=t.bottom+"px"),typeof t.right<"u"&&(this.domNode.style.right=t.right+"px"),this._pointerMoveMonitor=this._register(new Wt),this._register(os(this.bgDomNode,Y.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._register(os(this.domNode,Y.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._pointerdownRepeatTimer=this._register(new Mr),this._pointerdownScheduleRepeatTimer=this._register(new Ye)}_arrowPointerDown(t){if(!t.target||!(t.target instanceof Element))return;let e=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,be(t))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(e,200),this._pointerMoveMonitor.startMonitoring(t.target,t.pointerId,t.buttons,i=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),t.preventDefault()}};var cs=class s{constructor(t,e,i,r,n,o,l){this._forceIntegerValues=t;this._scrollStateBrand=void 0;this._forceIntegerValues&&(e=e|0,i=i|0,r=r|0,n=n|0,o=o|0,l=l|0),this.rawScrollLeft=r,this.rawScrollTop=l,e<0&&(e=0),r+e>i&&(r=i-e),r<0&&(r=0),n<0&&(n=0),l+n>o&&(l=o-n),l<0&&(l=0),this.width=e,this.scrollWidth=i,this.scrollLeft=r,this.height=n,this.scrollHeight=o,this.scrollTop=l}equals(t){return this.rawScrollLeft===t.rawScrollLeft&&this.rawScrollTop===t.rawScrollTop&&this.width===t.width&&this.scrollWidth===t.scrollWidth&&this.scrollLeft===t.scrollLeft&&this.height===t.height&&this.scrollHeight===t.scrollHeight&&this.scrollTop===t.scrollTop}withScrollDimensions(t,e){return new s(this._forceIntegerValues,typeof t.width<"u"?t.width:this.width,typeof t.scrollWidth<"u"?t.scrollWidth:this.scrollWidth,e?this.rawScrollLeft:this.scrollLeft,typeof t.height<"u"?t.height:this.height,typeof t.scrollHeight<"u"?t.scrollHeight:this.scrollHeight,e?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new s(this._forceIntegerValues,this.width,this.scrollWidth,typeof t.scrollLeft<"u"?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof t.scrollTop<"u"?t.scrollTop:this.rawScrollTop)}createScrollEvent(t,e){let i=this.width!==t.width,r=this.scrollWidth!==t.scrollWidth,n=this.scrollLeft!==t.scrollLeft,o=this.height!==t.height,l=this.scrollHeight!==t.scrollHeight,a=this.scrollTop!==t.scrollTop;return{inSmoothScrolling:e,oldWidth:t.width,oldScrollWidth:t.scrollWidth,oldScrollLeft:t.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:t.height,oldScrollHeight:t.scrollHeight,oldScrollTop:t.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:i,scrollWidthChanged:r,scrollLeftChanged:n,heightChanged:o,scrollHeightChanged:l,scrollTopChanged:a}}},Ri=class extends D{constructor(e){super();this._scrollableBrand=void 0;this._onScroll=this._register(new v);this.onScroll=this._onScroll.event;this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new cs(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,i){let r=this._state.withScrollDimensions(e,i);this._setState(r,!!this._smoothScrolling),this._smoothScrolling?.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let i=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(i,!1)}setScrollPositionSmooth(e,i){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};let r=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===r.scrollLeft&&this._smoothScrolling.to.scrollTop===r.scrollTop)return;let n;i?n=new Nr(this._smoothScrolling.from,r,this._smoothScrolling.startTime,this._smoothScrolling.duration):n=this._smoothScrolling.combine(this._state,r,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=n}else{let r=this._state.withScrollPosition(e);this._smoothScrolling=Nr.start(this._state,r,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),i=this._state.withScrollPosition(e);if(this._setState(i,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,i){let r=this._state;r.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(r,i)))}},Br=class{constructor(t,e,i){this.scrollLeft=t,this.scrollTop=e,this.isDone=i}};function as(s,t){let e=t-s;return function(i){return s+e*ka(i)}}function La(s,t,e){return function(i){return i2.5*i){let n,o;return t{this._domNode?.setClassName(this._visibleClassName)},0))}_hide(t){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode?.setClassName(this._invisibleClassName+(t?" fade":"")))}};var Ca=140,Ut=class extends lt{constructor(t){super(),this._lazyRender=t.lazyRender,this._host=t.host,this._scrollable=t.scrollable,this._scrollByPage=t.scrollByPage,this._scrollbarState=t.scrollbarState,this._visibilityController=this._register(new Fr(t.visibility,"visible scrollbar "+t.extraScrollbarClassName,"invisible scrollbar "+t.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new Wt),this._shouldRender=!0,this.domNode=_t(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(L(this.domNode.domNode,Y.POINTER_DOWN,e=>this._domNodePointerDown(e)))}_createArrow(t){let e=this._register(new Or(t));this.domNode.domNode.appendChild(e.bgDomNode),this.domNode.domNode.appendChild(e.domNode)}_createSlider(t,e,i,r){this.slider=_t(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(t),this.slider.setLeft(e),typeof i=="number"&&this.slider.setWidth(i),typeof r=="number"&&this.slider.setHeight(r),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(L(this.slider.domNode,Y.POINTER_DOWN,n=>{n.button===0&&(n.preventDefault(),this._sliderPointerDown(n))})),this.onclick(this.slider.domNode,n=>{n.leftButton&&n.stopPropagation()})}_onElementSize(t){return this._scrollbarState.setVisibleSize(t)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(t){return this._scrollbarState.setScrollSize(t)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(t){return this._scrollbarState.setScrollPosition(t)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(t){t.target===this.domNode.domNode&&this._onPointerDown(t)}delegatePointerDown(t){let e=this.domNode.domNode.getClientRects()[0].top,i=e+this._scrollbarState.getSliderPosition(),r=e+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),n=this._sliderPointerPosition(t);i<=n&&n<=r?t.button===0&&(t.preventDefault(),this._sliderPointerDown(t)):this._onPointerDown(t)}_onPointerDown(t){let e,i;if(t.target===this.domNode.domNode&&typeof t.offsetX=="number"&&typeof t.offsetY=="number")e=t.offsetX,i=t.offsetY;else{let n=Fo(this.domNode.domNode);e=t.pageX-n.left,i=t.pageY-n.top}let r=this._pointerDownRelativePosition(e,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(r):this._scrollbarState.getDesiredScrollPositionFromOffset(r)),t.button===0&&(t.preventDefault(),this._sliderPointerDown(t))}_sliderPointerDown(t){if(!t.target||!(t.target instanceof Element))return;let e=this._sliderPointerPosition(t),i=this._sliderOrthogonalPointerPosition(t),r=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(t.target,t.pointerId,t.buttons,n=>{let o=this._sliderOrthogonalPointerPosition(n),l=Math.abs(o-i);if(wr&&l>Ca){this._setDesiredScrollPositionNow(r.getScrollPosition());return}let u=this._sliderPointerPosition(n)-e;this._setDesiredScrollPositionNow(r.getDesiredScrollPositionFromDelta(u))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(t){let e={};this.writeScrollPosition(e,t),this._scrollable.setScrollPositionNow(e)}updateScrollbarSize(t){this._updateScrollbarSize(t),this._scrollbarState.setScrollbarSize(t),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}};var Kt=class s{constructor(t,e,i,r,n,o){this._scrollbarSize=Math.round(e),this._oppositeScrollbarSize=Math.round(i),this._arrowSize=Math.round(t),this._visibleSize=r,this._scrollSize=n,this._scrollPosition=o,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new s(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(t){let e=Math.round(t);return this._visibleSize!==e?(this._visibleSize=e,this._refreshComputedValues(),!0):!1}setScrollSize(t){let e=Math.round(t);return this._scrollSize!==e?(this._scrollSize=e,this._refreshComputedValues(),!0):!1}setScrollPosition(t){let e=Math.round(t);return this._scrollPosition!==e?(this._scrollPosition=e,this._refreshComputedValues(),!0):!1}setScrollbarSize(t){this._scrollbarSize=Math.round(t)}setOppositeScrollbarSize(t){this._oppositeScrollbarSize=Math.round(t)}static _computeValues(t,e,i,r,n){let o=Math.max(0,i-t),l=Math.max(0,o-2*e),a=r>0&&r>i;if(!a)return{computedAvailableSize:Math.round(o),computedIsNeeded:a,computedSliderSize:Math.round(l),computedSliderRatio:0,computedSliderPosition:0};let u=Math.round(Math.max(20,Math.floor(i*l/r))),h=(l-u)/(r-i),c=n*h;return{computedAvailableSize:Math.round(o),computedIsNeeded:a,computedSliderSize:Math.round(u),computedSliderRatio:h,computedSliderPosition:Math.round(c)}}_refreshComputedValues(){let t=s._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(t){if(!this._computedIsNeeded)return 0;let e=t-this._arrowSize-this._computedSliderSize/2;return Math.round(e/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(t){if(!this._computedIsNeeded)return 0;let e=t-this._arrowSize,i=this._scrollPosition;return e0&&Math.abs(t.deltaY)>0)return 1;let i=.5;if((!this._isAlmostInt(t.deltaX)||!this._isAlmostInt(t.deltaY))&&(i+=.25),e){let r=Math.abs(t.deltaX),n=Math.abs(t.deltaY),o=Math.abs(e.deltaX),l=Math.abs(e.deltaY),a=Math.max(Math.min(r,o),1),u=Math.max(Math.min(n,l),1),h=Math.max(r,o),c=Math.max(n,l);h%a===0&&c%u===0&&(i-=.5)}return Math.min(Math.max(i,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};zr.INSTANCE=new zr;var hs=zr,ds=class extends lt{constructor(e,i,r){super();this._onScroll=this._register(new v);this.onScroll=this._onScroll.event;this._onWillScroll=this._register(new v);this.onWillScroll=this._onWillScroll.event;this._options=Pa(i),this._scrollable=r,this._register(this._scrollable.onScroll(o=>{this._onWillScroll.fire(o),this._onDidScroll(o),this._onScroll.fire(o)}));let n={onMouseWheel:o=>this._onMouseWheel(o),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new Ur(this._scrollable,this._options,n)),this._horizontalScrollbar=this._register(new Wr(this._scrollable,this._options,n)),this._domNode=document.createElement("div"),this._domNode.className="xterm-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=_t(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=_t(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=_t(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,o=>this._onMouseOver(o)),this.onmouseleave(this._listenOnDomNode,o=>this._onMouseLeave(o)),this._hideTimeout=this._register(new Ye),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=Ne(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,Te&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new xi(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=Ne(this._mouseWheelToDispose),e)){let r=n=>{this._onMouseWheel(new xi(n))};this._mouseWheelToDispose.push(L(this._listenOnDomNode,Y.MOUSE_WHEEL,r,{passive:!1}))}}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;let i=hs.INSTANCE;zo&&i.acceptStandardWheelEvent(e);let r=!1;if(e.deltaY||e.deltaX){let o=e.deltaY*this._options.mouseWheelScrollSensitivity,l=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&l+o===0?l=o=0:Math.abs(o)>=Math.abs(l)?l=0:o=0),this._options.flipAxes&&([o,l]=[l,o]);let a=!Te&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||a)&&!l&&(l=o,o=0),e.browserEvent&&e.browserEvent.altKey&&(l=l*this._options.fastScrollSensitivity,o=o*this._options.fastScrollSensitivity);let u=this._scrollable.getFutureScrollPosition(),h={};if(o){let c=Ko*o,d=u.scrollTop-(c<0?Math.floor(c):Math.ceil(c));this._verticalScrollbar.writeScrollPosition(h,d)}if(l){let c=Ko*l,d=u.scrollLeft-(c<0?Math.floor(c):Math.ceil(c));this._horizontalScrollbar.writeScrollPosition(h,d)}h=this._scrollable.validateScrollPosition(h),(u.scrollLeft!==h.scrollLeft||u.scrollTop!==h.scrollTop)&&(zo&&this._options.mouseWheelSmoothScroll&&i.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(h):this._scrollable.setScrollPositionNow(h),r=!0)}let n=r;!n&&this._options.alwaysConsumeMouseWheel&&(n=!0),!n&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(n=!0),n&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let e=this._scrollable.getCurrentScrollPosition(),i=e.scrollTop>0,r=e.scrollLeft>0,n=r?" left":"",o=i?" top":"",l=r||i?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${n}`),this._topShadowDomNode.setClassName(`shadow${o}`),this._topLeftShadowDomNode.setClassName(`shadow${l}${o}${n}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),Ma)}};var Kr=class extends ds{constructor(t,e,i){super(t,e,i)}setScrollPosition(t){t.reuseAnimation?this._scrollable.setScrollPositionSmooth(t,t.reuseAnimation):this._scrollable.setScrollPositionNow(t)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function Pa(s){let t={lazyRender:typeof s.lazyRender<"u"?s.lazyRender:!1,className:typeof s.className<"u"?s.className:"",useShadows:typeof s.useShadows<"u"?s.useShadows:!0,handleMouseWheel:typeof s.handleMouseWheel<"u"?s.handleMouseWheel:!0,flipAxes:typeof s.flipAxes<"u"?s.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof s.consumeMouseWheelIfScrollbarIsNeeded<"u"?s.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof s.alwaysConsumeMouseWheel<"u"?s.alwaysConsumeMouseWheel:!1,scrollYToX:typeof s.scrollYToX<"u"?s.scrollYToX:!1,mouseWheelScrollSensitivity:typeof s.mouseWheelScrollSensitivity<"u"?s.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof s.fastScrollSensitivity<"u"?s.fastScrollSensitivity:5,scrollPredominantAxis:typeof s.scrollPredominantAxis<"u"?s.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof s.mouseWheelSmoothScroll<"u"?s.mouseWheelSmoothScroll:!0,arrowSize:typeof s.arrowSize<"u"?s.arrowSize:11,listenOnDomNode:typeof s.listenOnDomNode<"u"?s.listenOnDomNode:null,horizontal:typeof s.horizontal<"u"?s.horizontal:1,horizontalScrollbarSize:typeof s.horizontalScrollbarSize<"u"?s.horizontalScrollbarSize:10,horizontalSliderSize:typeof s.horizontalSliderSize<"u"?s.horizontalSliderSize:0,horizontalHasArrows:typeof s.horizontalHasArrows<"u"?s.horizontalHasArrows:!1,vertical:typeof s.vertical<"u"?s.vertical:1,verticalScrollbarSize:typeof s.verticalScrollbarSize<"u"?s.verticalScrollbarSize:10,verticalHasArrows:typeof s.verticalHasArrows<"u"?s.verticalHasArrows:!1,verticalSliderSize:typeof s.verticalSliderSize<"u"?s.verticalSliderSize:0,scrollByPage:typeof s.scrollByPage<"u"?s.scrollByPage:!1};return t.horizontalSliderSize=typeof s.horizontalSliderSize<"u"?s.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=typeof s.verticalSliderSize<"u"?s.verticalSliderSize:t.verticalScrollbarSize,Te&&(t.className+=" mac"),t}var zt=class extends D{constructor(e,i,r,n,o,l,a,u){super();this._bufferService=r;this._optionsService=a;this._renderService=u;this._onRequestScrollLines=this._register(new v);this.onRequestScrollLines=this._onRequestScrollLines.event;this._isSyncing=!1;this._isHandlingScroll=!1;this._suppressOnScrollHandler=!1;let h=this._register(new Ri({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:c=>mt(n.window,c)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{h.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new Kr(i,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},h)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(o.onProtocolChange(c=>{this._scrollableElement.updateOptions({handleMouseWheel:!(c&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register($.runAndSubscribe(l.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=l.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(C(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=n.mainDocument.createElement("style"),i.appendChild(this._styleElement),this._register(C(()=>this._styleElement.remove())),this._register($.runAndSubscribe(l.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${l.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${l.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${l.colors.scrollbarSliderActiveBackground.css};`,"}"].join(` -`)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(c=>this._handleScroll(c)))}scrollLines(e){let i=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:i.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,i){i&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!i,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:this._optionsService.rawOptions.overviewRuler?.width||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let i=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),r=i-this._bufferService.buffer.ydisp;r!==0&&(this._latestYDisp=i,this._onRequestScrollLines.fire(r)),this._isHandlingScroll=!1}};zt=M([S(2,F),S(3,ae),S(4,rr),S(5,Re),S(6,H),S(7,ce)],zt);var Gt=class extends D{constructor(e,i,r,n,o){super();this._screenElement=e;this._bufferService=i;this._coreBrowserService=r;this._decorationService=n;this._renderService=o;this._decorationElements=new Map;this._altBufferIsActive=!1;this._dimensionsChanged=!1;this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this._register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this._register(this._decorationService.onDecorationRemoved(l=>this._removeDecoration(l))),this._register(C(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){let i=this._coreBrowserService.mainDocument.createElement("div");i.classList.add("xterm-decoration"),i.classList.toggle("xterm-decoration-top-layer",e?.options?.layer==="top"),i.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,i.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,i.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,i.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let r=e.options.x??0;return r&&r>this._bufferService.cols&&(i.style.display="none"),this._refreshXPosition(e,i),i}_refreshStyle(e){let i=e.marker.line-this._bufferService.buffers.active.ydisp;if(i<0||i>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let r=this._decorationElements.get(e);r||(r=this._createElement(e),e.element=r,this._decorationElements.set(e,r),this._container.appendChild(r),e.onDispose(()=>{this._decorationElements.delete(e),r.remove()})),r.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(r.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,r.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,r.style.top=`${i*this._renderService.dimensions.css.cell.height}px`,r.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(r)}}_refreshXPosition(e,i=e.element){if(!i)return;let r=e.options.x??0;(e.options.anchor||"left")==="right"?i.style.right=r?`${r*this._renderService.dimensions.css.cell.width}px`:"":i.style.left=r?`${r*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){this._decorationElements.get(e)?.remove(),this._decorationElements.delete(e),e.dispose()}};Gt=M([S(1,F),S(2,ae),S(3,Be),S(4,ce)],Gt);var Gr=class{constructor(){this._zones=[];this._zonePool=[];this._zonePoolIndex=0;this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(t){if(t.options.overviewRulerOptions){for(let e of this._zones)if(e.color===t.options.overviewRulerOptions.color&&e.position===t.options.overviewRulerOptions.position){if(this._lineIntersectsZone(e,t.marker.line))return;if(this._lineAdjacentToZone(e,t.marker.line,t.options.overviewRulerOptions.position)){this._addLineToZone(e,t.marker.line);return}}if(this._zonePoolIndex=t.startBufferLine&&e<=t.endBufferLine}_lineAdjacentToZone(t,e,i){return e>=t.startBufferLine-this._linePadding[i||"full"]&&e<=t.endBufferLine+this._linePadding[i||"full"]}_addLineToZone(t,e){t.startBufferLine=Math.min(t.startBufferLine,e),t.endBufferLine=Math.max(t.endBufferLine,e)}};var We={full:0,left:0,center:0,right:0},at={full:0,left:0,center:0,right:0},Li={full:0,left:0,center:0,right:0},bt=class extends D{constructor(e,i,r,n,o,l,a,u){super();this._viewportElement=e;this._screenElement=i;this._bufferService=r;this._decorationService=n;this._renderService=o;this._optionsService=l;this._themeService=a;this._coreBrowserService=u;this._colorZoneStore=new Gr;this._shouldUpdateDimensions=!0;this._shouldUpdateAnchor=!0;this._lastKnownBufferLength=0;this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement),this._register(C(()=>this._canvas?.remove()));let h=this._canvas.getContext("2d");if(h)this._ctx=h;else throw new Error("Ctx cannot be null");this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),this._register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this._register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})),this._register(this._renderService.onRender(()=>{(!this._containerHeight||this._containerHeight!==this._screenElement.clientHeight)&&(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange("overviewRuler",()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){return this._optionsService.options.overviewRuler?.width||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),i=Math.ceil((this._canvas.width-1)/3);at.full=this._canvas.width,at.left=e,at.center=i,at.right=e,this._refreshDrawHeightConstants(),Li.full=1,Li.left=1,Li.center=1+at.left,Li.right=1+at.left+at.center}_refreshDrawHeightConstants(){We.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,i=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);We.left=i,We.center=i,We.right=i}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*We.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*We.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*We.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*We.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(let i of this._decorationService.decorations)this._colorZoneStore.addDecoration(i);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let i of e)i.position!=="full"&&this._renderColorZone(i);for(let i of e)i.position==="full"&&this._renderColorZone(i);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(Li[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-We[e.position||"full"]/2),at[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+We[e.position||"full"]))}_queueRefresh(e,i){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=i||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};bt=M([S(2,F),S(3,Be),S(4,ce),S(5,H),S(6,Re),S(7,ae)],bt);var b;(E=>(E.NUL="\0",E.SOH="",E.STX="",E.ETX="",E.EOT="",E.ENQ="",E.ACK="",E.BEL="\x07",E.BS="\b",E.HT=" ",E.LF=` -`,E.VT="\v",E.FF="\f",E.CR="\r",E.SO="",E.SI="",E.DLE="",E.DC1="",E.DC2="",E.DC3="",E.DC4="",E.NAK="",E.SYN="",E.ETB="",E.CAN="",E.EM="",E.SUB="",E.ESC="\x1B",E.FS="",E.GS="",E.RS="",E.US="",E.SP=" ",E.DEL="\x7F"))(b||={});var Ai;(g=>(g.PAD="\x80",g.HOP="\x81",g.BPH="\x82",g.NBH="\x83",g.IND="\x84",g.NEL="\x85",g.SSA="\x86",g.ESA="\x87",g.HTS="\x88",g.HTJ="\x89",g.VTS="\x8A",g.PLD="\x8B",g.PLU="\x8C",g.RI="\x8D",g.SS2="\x8E",g.SS3="\x8F",g.DCS="\x90",g.PU1="\x91",g.PU2="\x92",g.STS="\x93",g.CCH="\x94",g.MW="\x95",g.SPA="\x96",g.EPA="\x97",g.SOS="\x98",g.SGCI="\x99",g.SCI="\x9A",g.CSI="\x9B",g.ST="\x9C",g.OSC="\x9D",g.PM="\x9E",g.APC="\x9F"))(Ai||={});var fs;(t=>t.ST=`${b.ESC}\\`)(fs||={});var $t=class{constructor(t,e,i,r,n,o){this._textarea=t;this._compositionView=e;this._bufferService=i;this._optionsService=r;this._coreService=n;this._renderService=o;this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(t){this._compositionView.textContent=t.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(t){if(this._isComposing||this._isSendingComposition){if(t.keyCode===20||t.keyCode===229||t.keyCode===16||t.keyCode===17||t.keyCode===18)return!1;this._finalizeComposition(!1)}return t.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(t){if(this._compositionView.classList.remove("active"),this._isComposing=!1,t){let e={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let i;e.start+=this._dataAlreadySent.length,this._isComposing?i=this._textarea.value.substring(e.start,this._compositionPosition.start):i=this._textarea.value.substring(e.start),i.length>0&&this._coreService.triggerDataEvent(i,!0)}},0)}else{this._isSendingComposition=!1;let e=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(e,!0)}}_handleAnyTextareaChanges(){let t=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let e=this._textarea.value,i=e.replace(t,"");this._dataAlreadySent=i,e.length>t.length?this._coreService.triggerDataEvent(i,!0):e.lengththis.updateCompositionElements(!0),0)}}};$t=M([S(2,F),S(3,H),S(4,ge),S(5,ce)],$t);var ue=0,he=0,de=0,J=0,ps={css:"#00000000",rgba:0},j;(i=>{function s(r,n,o,l){return l!==void 0?`#${vt(r)}${vt(n)}${vt(o)}${vt(l)}`:`#${vt(r)}${vt(n)}${vt(o)}`}i.toCss=s;function t(r,n,o,l=255){return(r<<24|n<<16|o<<8|l)>>>0}i.toRgba=t;function e(r,n,o,l){return{css:i.toCss(r,n,o,l),rgba:i.toRgba(r,n,o,l)}}i.toColor=e})(j||={});var U;(l=>{function s(a,u){if(J=(u.rgba&255)/255,J===1)return{css:u.css,rgba:u.rgba};let h=u.rgba>>24&255,c=u.rgba>>16&255,d=u.rgba>>8&255,_=a.rgba>>24&255,p=a.rgba>>16&255,m=a.rgba>>8&255;ue=_+Math.round((h-_)*J),he=p+Math.round((c-p)*J),de=m+Math.round((d-m)*J);let f=j.toCss(ue,he,de),A=j.toRgba(ue,he,de);return{css:f,rgba:A}}l.blend=s;function t(a){return(a.rgba&255)===255}l.isOpaque=t;function e(a,u,h){let c=$r.ensureContrastRatio(a.rgba,u.rgba,h);if(c)return j.toColor(c>>24&255,c>>16&255,c>>8&255)}l.ensureContrastRatio=e;function i(a){let u=(a.rgba|255)>>>0;return[ue,he,de]=$r.toChannels(u),{css:j.toCss(ue,he,de),rgba:u}}l.opaque=i;function r(a,u){return J=Math.round(u*255),[ue,he,de]=$r.toChannels(a.rgba),{css:j.toCss(ue,he,de,J),rgba:j.toRgba(ue,he,de,J)}}l.opacity=r;function n(a,u){return J=a.rgba&255,r(a,J*u/255)}l.multiplyOpacity=n;function o(a){return[a.rgba>>24&255,a.rgba>>16&255,a.rgba>>8&255]}l.toColorRGB=o})(U||={});var z;(i=>{let s,t;try{let r=document.createElement("canvas");r.width=1,r.height=1;let n=r.getContext("2d",{willReadFrequently:!0});n&&(s=n,s.globalCompositeOperation="copy",t=s.createLinearGradient(0,0,1,1))}catch{}function e(r){if(r.match(/#[\da-f]{3,8}/i))switch(r.length){case 4:return ue=parseInt(r.slice(1,2).repeat(2),16),he=parseInt(r.slice(2,3).repeat(2),16),de=parseInt(r.slice(3,4).repeat(2),16),j.toColor(ue,he,de);case 5:return ue=parseInt(r.slice(1,2).repeat(2),16),he=parseInt(r.slice(2,3).repeat(2),16),de=parseInt(r.slice(3,4).repeat(2),16),J=parseInt(r.slice(4,5).repeat(2),16),j.toColor(ue,he,de,J);case 7:return{css:r,rgba:(parseInt(r.slice(1),16)<<8|255)>>>0};case 9:return{css:r,rgba:parseInt(r.slice(1),16)>>>0}}let n=r.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(n)return ue=parseInt(n[1]),he=parseInt(n[2]),de=parseInt(n[3]),J=Math.round((n[5]===void 0?1:parseFloat(n[5]))*255),j.toColor(ue,he,de,J);if(!s||!t)throw new Error("css.toColor: Unsupported css format");if(s.fillStyle=t,s.fillStyle=r,typeof s.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(s.fillRect(0,0,1,1),[ue,he,de,J]=s.getImageData(0,0,1,1).data,J!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:j.toRgba(ue,he,de,J),css:r}}i.toColor=e})(z||={});var ve;(e=>{function s(i){return t(i>>16&255,i>>8&255,i&255)}e.relativeLuminance=s;function t(i,r,n){let o=i/255,l=r/255,a=n/255,u=o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4),h=l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4),c=a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4);return u*.2126+h*.7152+c*.0722}e.relativeLuminance2=t})(ve||={});var $r;(n=>{function s(o,l){if(J=(l&255)/255,J===1)return l;let a=l>>24&255,u=l>>16&255,h=l>>8&255,c=o>>24&255,d=o>>16&255,_=o>>8&255;return ue=c+Math.round((a-c)*J),he=d+Math.round((u-d)*J),de=_+Math.round((h-_)*J),j.toRgba(ue,he,de)}n.blend=s;function t(o,l,a){let u=ve.relativeLuminance(o>>8),h=ve.relativeLuminance(l>>8);if(Xe(u,h)>8));if(m>8));return m>A?p:f}return p}let d=i(o,l,a),_=Xe(u,ve.relativeLuminance(d>>8));if(_>8));return _>m?d:p}return d}}n.ensureContrastRatio=t;function e(o,l,a){let u=o>>24&255,h=o>>16&255,c=o>>8&255,d=l>>24&255,_=l>>16&255,p=l>>8&255,m=Xe(ve.relativeLuminance2(d,_,p),ve.relativeLuminance2(u,h,c));for(;m0||_>0||p>0);)d-=Math.max(0,Math.ceil(d*.1)),_-=Math.max(0,Math.ceil(_*.1)),p-=Math.max(0,Math.ceil(p*.1)),m=Xe(ve.relativeLuminance2(d,_,p),ve.relativeLuminance2(u,h,c));return(d<<24|_<<16|p<<8|255)>>>0}n.reduceLuminance=e;function i(o,l,a){let u=o>>24&255,h=o>>16&255,c=o>>8&255,d=l>>24&255,_=l>>16&255,p=l>>8&255,m=Xe(ve.relativeLuminance2(d,_,p),ve.relativeLuminance2(u,h,c));for(;m>>0}n.increaseLuminance=i;function r(o){return[o>>24&255,o>>16&255,o>>8&255,o&255]}n.toChannels=r})($r||={});function vt(s){let t=s.toString(16);return t.length<2?"0"+t:t}function Xe(s,t){return s1){let c=this._getJoinedRanges(r,l,o,e,n);for(let d=0;d1){let h=this._getJoinedRanges(r,l,o,e,n);for(let c=0;c=di,E=y,x=this._workCell;if(_.length>0&&y===_[0][0]&&w){let W=_.shift(),An=this._isCellInSelection(W[0],e);for(O=W[0]+1;O=W[1],w?(g=!0,x=new Vr(this._workCell,t.translateToString(!0,W[0],W[1]),W[1]-W[0]),E=W[1]-1,T=x.getWidth()):di=W[1]}let N=this._isCellInSelection(y,e),Z=i&&y===o,te=Qe&&y>=h&&y<=c,Oe=!1;this._decorationService.forEachDecorationAtCell(y,e,void 0,W=>{Oe=!0});let ze=x.getChars()||we;if(ze===" "&&(x.isUnderline()||x.isOverline())&&(ze="\xA0"),Ke=T*a-u.get(ze,x.isBold(),x.isItalic()),!f)f=this._document.createElement("span");else if(A&&(N&&Pe||!N&&!Pe&&x.bg===I)&&(N&&Pe&&p.selectionForeground||x.fg===k)&&x.extended.ext===P&&te===oe&&Ke===Me&&!Z&&!g&&!Oe&&w){x.isInvisible()?R+=we:R+=ze,A++;continue}else A&&(f.textContent=R),f=this._document.createElement("span"),A=0,R="";if(I=x.bg,k=x.fg,P=x.extended.ext,oe=te,Me=Ke,Pe=N,g&&o>=y&&o<=E&&(o=y),!this._coreService.isCursorHidden&&Z&&this._coreService.isCursorInitialized){if(V.push("xterm-cursor"),this._coreBrowserService.isFocused)l&&V.push("xterm-cursor-blink"),V.push(r==="bar"?"xterm-cursor-bar":r==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(n)switch(n){case"outline":V.push("xterm-cursor-outline");break;case"block":V.push("xterm-cursor-block");break;case"bar":V.push("xterm-cursor-bar");break;case"underline":V.push("xterm-cursor-underline");break;default:break}}if(x.isBold()&&V.push("xterm-bold"),x.isItalic()&&V.push("xterm-italic"),x.isDim()&&V.push("xterm-dim"),x.isInvisible()?R=we:R=x.getChars()||we,x.isUnderline()&&(V.push(`xterm-underline-${x.extended.underlineStyle}`),R===" "&&(R="\xA0"),!x.isUnderlineColorDefault()))if(x.isUnderlineColorRGB())f.style.textDecorationColor=`rgb(${De.toColorRGB(x.getUnderlineColor()).join(",")})`;else{let W=x.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&x.isBold()&&W<8&&(W+=8),f.style.textDecorationColor=p.ansi[W].css}x.isOverline()&&(V.push("xterm-overline"),R===" "&&(R="\xA0")),x.isStrikethrough()&&V.push("xterm-strikethrough"),te&&(f.style.textDecoration="underline");let le=x.getFgColor(),et=x.getFgColorMode(),me=x.getBgColor(),ht=x.getBgColorMode(),fi=!!x.isInverse();if(fi){let W=le;le=me,me=W;let An=et;et=ht,ht=An}let tt,Qi,pi=!1;this._decorationService.forEachDecorationAtCell(y,e,void 0,W=>{W.options.layer!=="top"&&pi||(W.backgroundColorRGB&&(ht=50331648,me=W.backgroundColorRGB.rgba>>8&16777215,tt=W.backgroundColorRGB),W.foregroundColorRGB&&(et=50331648,le=W.foregroundColorRGB.rgba>>8&16777215,Qi=W.foregroundColorRGB),pi=W.options.layer==="top")}),!pi&&N&&(tt=this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque,me=tt.rgba>>8&16777215,ht=50331648,pi=!0,p.selectionForeground&&(et=50331648,le=p.selectionForeground.rgba>>8&16777215,Qi=p.selectionForeground)),pi&&V.push("xterm-decoration-top");let it;switch(ht){case 16777216:case 33554432:it=p.ansi[me],V.push(`xterm-bg-${me}`);break;case 50331648:it=j.toColor(me>>16,me>>8&255,me&255),this._addStyle(f,`background-color:#${qo((me>>>0).toString(16),"0",6)}`);break;case 0:default:fi?(it=p.foreground,V.push(`xterm-bg-${257}`)):it=p.background}switch(tt||x.isDim()&&(tt=U.multiplyOpacity(it,.5)),et){case 16777216:case 33554432:x.isBold()&&le<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(le+=8),this._applyMinimumContrast(f,it,p.ansi[le],x,tt,void 0)||V.push(`xterm-fg-${le}`);break;case 50331648:let W=j.toColor(le>>16&255,le>>8&255,le&255);this._applyMinimumContrast(f,it,W,x,tt,Qi)||this._addStyle(f,`color:#${qo(le.toString(16),"0",6)}`);break;case 0:default:this._applyMinimumContrast(f,it,p.foreground,x,tt,Qi)||fi&&V.push(`xterm-fg-${257}`)}V.length&&(f.className=V.join(" "),V.length=0),!Z&&!g&&!Oe&&w?A++:f.textContent=R,Ke!==this.defaultSpacing&&(f.style.letterSpacing=`${Ke}px`),d.push(f),y=E}return f&&A&&(f.textContent=R),d}_applyMinimumContrast(t,e,i,r,n,o){if(this._optionsService.rawOptions.minimumContrastRatio===1||$o(r.getCode()))return!1;let l=this._getContrastCache(r),a;if(!n&&!o&&(a=l.getColor(e.rgba,i.rgba)),a===void 0){let u=this._optionsService.rawOptions.minimumContrastRatio/(r.isDim()?2:1);a=U.ensureContrastRatio(n||e,o||i,u),l.setColor((n||e).rgba,(o||i).rgba,a??null)}return a?(this._addStyle(t,`color:${a.css}`),!0):!1}_getContrastCache(t){return t.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(t,e){t.setAttribute("style",`${t.getAttribute("style")||""}${e};`)}_isCellInSelection(t,e){let i=this._selectionStart,r=this._selectionEnd;return!i||!r?!1:this._columnSelectMode?i[0]<=r[0]?t>=i[0]&&e>=i[1]&&t=i[1]&&t>=r[0]&&e<=r[1]:e>i[1]&&e=i[0]&&t=i[0]}};Vt=M([S(1,or),S(2,H),S(3,ae),S(4,ge),S(5,Be),S(6,Re)],Vt);function qo(s,t,e){for(;s.length0&&(this._flat[r]=l),l}let n=t;e&&(n+="B"),i&&(n+="I");let o=this._holey.get(n);if(o===void 0){let l=0;e&&(l|=1),i&&(l|=2),o=this._measure(t,l),o>0&&this._holey.set(n,o)}return o}_measure(t,e){let i=this._measureElements[e];return i.textContent=t.repeat(32),i.offsetWidth/32}};var ms=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(t,e,i,r=!1){if(this.selectionStart=e,this.selectionEnd=i,!e||!i||e[0]===i[0]&&e[1]===i[1]){this.clear();return}let n=t.buffers.active.ydisp,o=e[1]-n,l=i[1]-n,a=Math.max(o,0),u=Math.min(l,t.rows-1);if(a>=t.rows||u<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=r,this.viewportStartRow=o,this.viewportEndRow=l,this.viewportCappedStartRow=a,this.viewportCappedEndRow=u,this.startCol=e[0],this.endCol=i[0]}isCellSelected(t,e,i){return this.hasSelection?(i-=t.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?e>=this.startCol&&i>=this.viewportCappedStartRow&&e=this.viewportCappedStartRow&&e>=this.endCol&&i<=this.viewportCappedEndRow:i>this.viewportStartRow&&i=this.startCol&&e=this.startCol):!1}};function Yo(){return new ms}var _s="xterm-dom-renderer-owner-",Le="xterm-rows",jr="xterm-fg-",jo="xterm-bg-",ki="xterm-focus",Xr="xterm-selection",Na=1,Yt=class extends D{constructor(e,i,r,n,o,l,a,u,h,c,d,_,p,m){super();this._terminal=e;this._document=i;this._element=r;this._screenElement=n;this._viewportElement=o;this._helperContainer=l;this._linkifier2=a;this._charSizeService=h;this._optionsService=c;this._bufferService=d;this._coreService=_;this._coreBrowserService=p;this._themeService=m;this._terminalClass=Na++;this._rowElements=[];this._selectionRenderModel=Yo();this.onRequestRedraw=this._register(new v).event;this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(Le),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(Xr),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=Vo(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(f=>this._injectCss(f))),this._injectCss(this._themeService.colors),this._rowFactory=u.createInstance(Vt,document),this._element.classList.add(_s+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(f=>this._handleLinkHover(f))),this._register(this._linkifier2.onHideLinkUnderline(f=>this._handleLinkLeave(f))),this._register(C(()=>{this._element.classList.remove(_s+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new Yr(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(let r of this._rowElements)r.style.width=`${this.dimensions.css.canvas.width}px`,r.style.height=`${this.dimensions.css.cell.height}px`,r.style.lineHeight=`${this.dimensions.css.cell.height}px`,r.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let i=`${this._terminalSelector} .${Le} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=i,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let i=`${this._terminalSelector} .${Le} { pointer-events: none; color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;i+=`${this._terminalSelector} .${Le} .xterm-dim { color: ${U.multiplyOpacity(e.foreground,.5).css};}`,i+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;let r=`blink_underline_${this._terminalClass}`,n=`blink_bar_${this._terminalClass}`,o=`blink_block_${this._terminalClass}`;i+=`@keyframes ${r} { 50% { border-bottom-style: hidden; }}`,i+=`@keyframes ${n} { 50% { box-shadow: none; }}`,i+=`@keyframes ${o} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,i+=`${this._terminalSelector} .${Le}.${ki} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${Le}.${ki} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${Le}.${ki} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${o} 1s step-end infinite;}${this._terminalSelector} .${Le} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${Le} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${Le} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${Le} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${Le} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,i+=`${this._terminalSelector} .${Xr} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${Xr} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${Xr} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[l,a]of e.ansi.entries())i+=`${this._terminalSelector} .${jr}${l} { color: ${a.css}; }${this._terminalSelector} .${jr}${l}.xterm-dim { color: ${U.multiplyOpacity(a,.5).css}; }${this._terminalSelector} .${jo}${l} { background-color: ${a.css}; }`;i+=`${this._terminalSelector} .${jr}${257} { color: ${U.opaque(e.background).css}; }${this._terminalSelector} .${jr}${257}.xterm-dim { color: ${U.multiplyOpacity(U.opaque(e.background),.5).css}; }${this._terminalSelector} .${jo}${257} { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=i}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,i){for(let r=this._rowElements.length;r<=i;r++){let n=this._document.createElement("div");this._rowContainer.appendChild(n),this._rowElements.push(n)}for(;this._rowElements.length>i;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,i){this._refreshRowElements(e,i),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(ki),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(ki),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,i,r){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,i,r),this.renderRows(0,this._bufferService.rows-1),!e||!i||(this._selectionRenderModel.update(this._terminal,e,i,r),!this._selectionRenderModel.hasSelection))return;let n=this._selectionRenderModel.viewportStartRow,o=this._selectionRenderModel.viewportEndRow,l=this._selectionRenderModel.viewportCappedStartRow,a=this._selectionRenderModel.viewportCappedEndRow,u=this._document.createDocumentFragment();if(r){let h=e[0]>i[0];u.appendChild(this._createSelectionElement(l,h?i[0]:e[0],h?e[0]:i[0],a-l+1))}else{let h=n===l?e[0]:0,c=l===o?i[0]:this._bufferService.cols;u.appendChild(this._createSelectionElement(l,h,c));let d=a-l-1;if(u.appendChild(this._createSelectionElement(l+1,0,this._bufferService.cols,d)),l!==a){let _=o===a?i[0]:this._bufferService.cols;u.appendChild(this._createSelectionElement(a,0,_))}}this._selectionContainer.appendChild(u)}_createSelectionElement(e,i,r,n=1){let o=this._document.createElement("div"),l=i*this.dimensions.css.cell.width,a=this.dimensions.css.cell.width*(r-i);return l+a>this.dimensions.css.canvas.width&&(a=this.dimensions.css.canvas.width-l),o.style.height=`${n*this.dimensions.css.cell.height}px`,o.style.top=`${e*this.dimensions.css.cell.height}px`,o.style.left=`${l}px`,o.style.width=`${a}px`,o}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(let e of this._rowElements)e.replaceChildren()}renderRows(e,i){let r=this._bufferService.buffer,n=r.ybase+r.y,o=Math.min(r.x,this._bufferService.cols-1),l=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,a=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,u=this._optionsService.rawOptions.cursorInactiveStyle;for(let h=e;h<=i;h++){let c=h+r.ydisp,d=this._rowElements[h],_=r.lines.get(c);if(!d||!_)break;d.replaceChildren(...this._rowFactory.createRow(_,c,c===n,a,u,o,l,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${_s}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,i,r,n,o,l){r<0&&(e=0),n<0&&(i=0);let a=this._bufferService.rows-1;r=Math.max(Math.min(r,a),0),n=Math.max(Math.min(n,a),0),o=Math.min(o,this._bufferService.cols);let u=this._bufferService.buffer,h=u.ybase+u.y,c=Math.min(u.x,o-1),d=this._optionsService.rawOptions.cursorBlink,_=this._optionsService.rawOptions.cursorStyle,p=this._optionsService.rawOptions.cursorInactiveStyle;for(let m=r;m<=n;++m){let f=m+u.ydisp,A=this._rowElements[m],R=u.lines.get(f);if(!A||!R)break;A.replaceChildren(...this._rowFactory.createRow(R,f,f===h,_,p,c,d,this.dimensions.css.cell.width,this._widthCache,l?m===r?e:0:-1,l?(m===n?i:o)-1:-1))}}};Yt=M([S(7,xt),S(8,nt),S(9,H),S(10,F),S(11,ge),S(12,ae),S(13,Re)],Yt);var jt=class extends D{constructor(e,i,r){super();this._optionsService=r;this.width=0;this.height=0;this._onCharSizeChange=this._register(new v);this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new vs(this._optionsService))}catch{this._measureStrategy=this._register(new bs(e,i,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let e=this._measureStrategy.measure();(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};jt=M([S(2,H)],jt);var Zr=class extends D{constructor(){super(...arguments);this._result={width:0,height:0}}_validateAndSet(e,i){e!==void 0&&e>0&&i!==void 0&&i>0&&(this._result.width=e,this._result.height=i)}},bs=class extends Zr{constructor(e,i,r){super();this._document=e;this._parentElement=i;this._optionsService=r;this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}},vs=class extends Zr{constructor(e){super();this._optionsService=e;this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let i=this._ctx.measureText("W");if(!("width"in i&&"fontBoundingBoxAscent"in i&&"fontBoundingBoxDescent"in i))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText("W");return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}};var Jr=class extends D{constructor(e,i,r){super();this._textarea=e;this._window=i;this.mainDocument=r;this._isFocused=!1;this._cachedIsFocused=void 0;this._screenDprMonitor=this._register(new gs(this._window));this._onDprChange=this._register(new v);this.onDprChange=this._onDprChange.event;this._onWindowChange=this._register(new v);this.onWindowChange=this._onWindowChange.event;this._register(this.onWindowChange(n=>this._screenDprMonitor.setWindow(n))),this._register($.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(L(this._textarea,"focus",()=>this._isFocused=!0)),this._register(L(this._textarea,"blur",()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}},gs=class extends D{constructor(e){super();this._parentWindow=e;this._windowResizeListener=this._register(new ye);this._onDprChange=this._register(new v);this.onDprChange=this._onDprChange.event;this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(C(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=L(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){!this._resolutionMediaMatchList||!this._outerListener||(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}};var Qr=class extends D{constructor(){super();this.linkProviders=[];this._register(C(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let i=this.linkProviders.indexOf(e);i!==-1&&this.linkProviders.splice(i,1)}}}};function Ci(s,t,e){let i=e.getBoundingClientRect(),r=s.getComputedStyle(e),n=parseInt(r.getPropertyValue("padding-left")),o=parseInt(r.getPropertyValue("padding-top"));return[t.clientX-i.left-n,t.clientY-i.top-o]}function Xo(s,t,e,i,r,n,o,l,a){if(!n)return;let u=Ci(s,t,e);if(u)return u[0]=Math.ceil((u[0]+(a?o/2:0))/o),u[1]=Math.ceil(u[1]/l),u[0]=Math.min(Math.max(u[0],1),i+(a?1:0)),u[1]=Math.min(Math.max(u[1],1),r),u}var Xt=class{constructor(t,e){this._renderService=t;this._charSizeService=e}getCoords(t,e,i,r,n){return Xo(window,t,e,i,r,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,n)}getMouseReportCoords(t,e){let i=Ci(window,t,e);if(this._charSizeService.hasValidSize)return i[0]=Math.min(Math.max(i[0],0),this._renderService.dimensions.css.canvas.width-1),i[1]=Math.min(Math.max(i[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(i[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(i[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(i[0]),y:Math.floor(i[1])}}};Xt=M([S(0,ce),S(1,nt)],Xt);var en=class{constructor(t,e){this._renderCallback=t;this._coreBrowserService=e;this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(t){return this._refreshCallbacks.push(t),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(t,e,i){this._rowCount=i,t=t!==void 0?t:0,e=e!==void 0?e:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,t):t,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,e):e,!this._animationFrame&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0){this._runRefreshCallbacks();return}let t=Math.max(this._rowStart,0),e=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(t,e),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let t of this._refreshCallbacks)t(0);this._refreshCallbacks=[]}};var tn={};Ll(tn,{getSafariVersion:()=>Ha,isChromeOS:()=>Ts,isFirefox:()=>Ss,isIpad:()=>Wa,isIphone:()=>Ua,isLegacyEdge:()=>Fa,isLinux:()=>Bi,isMac:()=>Zt,isNode:()=>Mi,isSafari:()=>Zo,isWindows:()=>Es});var Mi=typeof process<"u"&&"title"in process,Pi=Mi?"node":navigator.userAgent,Oi=Mi?"node":navigator.platform,Ss=Pi.includes("Firefox"),Fa=Pi.includes("Edge"),Zo=/^((?!chrome|android).)*safari/i.test(Pi);function Ha(){if(!Zo)return 0;let s=Pi.match(/Version\/(\d+)/);return s===null||s.length<2?0:parseInt(s[1])}var Zt=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(Oi),Wa=Oi==="iPad",Ua=Oi==="iPhone",Es=["Windows","Win16","Win32","WinCE"].includes(Oi),Bi=Oi.indexOf("Linux")>=0,Ts=/\bCrOS\b/.test(Pi);var rn=class{constructor(){this._tasks=[];this._i=0}enqueue(t){this._tasks.push(t),this._start()}flush(){for(;this._in){r-e<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-e))}ms`),this._start();return}r=n}this.clear()}},Is=class extends rn{_requestCallback(t){return setTimeout(()=>t(this._createDeadline(16)))}_cancelCallback(t){clearTimeout(t)}_createDeadline(t){let e=performance.now()+t;return{timeRemaining:()=>Math.max(0,e-performance.now())}}},ys=class extends rn{_requestCallback(t){return requestIdleCallback(t)}_cancelCallback(t){cancelIdleCallback(t)}},Jt=!Mi&&"requestIdleCallback"in window?ys:Is,nn=class{constructor(){this._queue=new Jt}set(t){this._queue.clear(),this._queue.enqueue(t)}flush(){this._queue.flush()}};var Qt=class extends D{constructor(e,i,r,n,o,l,a,u,h){super();this._rowCount=e;this._optionsService=r;this._charSizeService=n;this._coreService=o;this._coreBrowserService=u;this._renderer=this._register(new ye);this._pausedResizeTask=new nn;this._observerDisposable=this._register(new ye);this._isPaused=!1;this._needsFullRefresh=!1;this._isNextRenderRedrawOnly=!0;this._needsSelectionRefresh=!1;this._canvasWidth=0;this._canvasHeight=0;this._selectionState={start:void 0,end:void 0,columnSelectMode:!1};this._onDimensionsChange=this._register(new v);this.onDimensionsChange=this._onDimensionsChange.event;this._onRenderedViewportChange=this._register(new v);this.onRenderedViewportChange=this._onRenderedViewportChange.event;this._onRender=this._register(new v);this.onRender=this._onRender.event;this._onRefreshRequest=this._register(new v);this.onRefreshRequest=this._onRefreshRequest.event;this._renderDebouncer=new en((c,d)=>this._renderRows(c,d),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new xs(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(C(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(a.onResize(()=>this._fullRefresh())),this._register(a.buffers.onBufferActivate(()=>this._renderer.value?.clear())),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(l.onDecorationRegistered(()=>this._fullRefresh())),this._register(l.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(a.cols,a.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(a.buffer.y,a.buffer.y,!0))),this._register(h.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,i),this._register(this._coreBrowserService.onWindowChange(c=>this._registerIntersectionObserver(c,i)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,i){if("IntersectionObserver"in e){let r=new e.IntersectionObserver(n=>this._handleIntersectionChange(n[n.length-1]),{threshold:0});r.observe(i),this._observerDisposable.value=C(()=>r.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.isIntersecting,!this._isPaused&&!this._charSizeService.hasValidSize&&this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,i,r=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,i);return}let n=this._syncOutputHandler.flush();n&&(e=Math.min(e,n.start),i=Math.max(i,n.end)),r||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,i,this._rowCount)}_renderRows(e,i){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,i);return}e=Math.min(e,this._rowCount-1),i=Math.min(i,this._rowCount-1),this._renderer.value.renderRows(e,i),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:i}),this._onRender.fire({start:e,end:i}),this._isNextRenderRedrawOnly=!0}}resize(e,i){this._rowCount=i,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(i=>this.refreshRows(i.start,i.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,i){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value?.handleResize(e,i)):this._renderer.value.handleResize(e,i),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(e,i,r){this._selectionState.start=e,this._selectionState.end=i,this._selectionState.columnSelectMode=r,this._renderer.value?.handleSelectionChanged(e,i,r)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};Qt=M([S(2,H),S(3,nt),S(4,ge),S(5,Be),S(6,F),S(7,ae),S(8,Re)],Qt);var xs=class{constructor(t,e,i){this._coreBrowserService=t;this._coreService=e;this._onTimeout=i;this._start=0;this._end=0;this._isBuffering=!1}bufferRows(t,e){this._isBuffering?(this._start=Math.min(this._start,t),this._end=Math.max(this._end,e)):(this._start=t,this._end=e,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let t={start:this._start,end:this._end};return this._isBuffering=!1,t}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function Jo(s,t,e,i){let r=e.buffer.x,n=e.buffer.y;if(!e.buffer.hasScrollback)return Ga(r,n,s,t,e,i)+sn(n,t,e,i)+$a(r,n,s,t,e,i);let o;if(n===t)return o=r>s?"D":"C",Fi(Math.abs(r-s),Ni(o,i));o=n>t?"D":"C";let l=Math.abs(n-t),a=za(n>t?s:r,e)+(l-1)*e.cols+1+Ka(n>t?r:s,e);return Fi(a,Ni(o,i))}function Ka(s,t){return s-1}function za(s,t){return t.cols-s}function Ga(s,t,e,i,r,n){return sn(t,i,r,n).length===0?"":Fi(el(s,t,s,t-gt(t,r),!1,r).length,Ni("D",n))}function sn(s,t,e,i){let r=s-gt(s,e),n=t-gt(t,e),o=Math.abs(r-n)-Va(s,t,e);return Fi(o,Ni(Qo(s,t),i))}function $a(s,t,e,i,r,n){let o;sn(t,i,r,n).length>0?o=i-gt(i,r):o=t;let l=i,a=qa(s,t,e,i,r,n);return Fi(el(s,o,e,l,a==="C",r).length,Ni(a,n))}function Va(s,t,e){let i=0,r=s-gt(s,e),n=t-gt(t,e);for(let o=0;o=0&&s0?o=i-gt(i,r):o=t,s=e&&ot?"A":"B"}function el(s,t,e,i,r,n){let o=s,l=t,a="";for(;(o!==e||l!==i)&&l>=0&&ln.cols-1?(a+=n.buffer.translateBufferLineToString(l,!1,s,o),o=0,s=0,l++):!r&&o<0&&(a+=n.buffer.translateBufferLineToString(l,!1,0,s+1),o=n.cols-1,s=o,l--);return a+n.buffer.translateBufferLineToString(l,!1,s,o)}function Ni(s,t){let e=t?"O":"[";return b.ESC+e+s}function Fi(s,t){s=Math.floor(s);let e="";for(let i=0;ithis._bufferService.cols?t%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(t/this._bufferService.cols)-1]:[t%this._bufferService.cols,this.selectionStart[1]+Math.floor(t/this._bufferService.cols)]:[t,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let t=this.selectionStart[0]+this.selectionStartLength;return t>this._bufferService.cols?[t%this._bufferService.cols,this.selectionStart[1]+Math.floor(t/this._bufferService.cols)]:[Math.max(t,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let t=this.selectionStart,e=this.selectionEnd;return!t||!e?!1:t[1]>e[1]||t[1]===e[1]&&t[0]>e[0]}handleTrim(t){return this.selectionStart&&(this.selectionStart[1]-=t),this.selectionEnd&&(this.selectionEnd[1]-=t),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function ws(s,t){if(s.start.y>s.end.y)throw new Error(`Buffer range end (${s.end.x}, ${s.end.y}) cannot be before start (${s.start.x}, ${s.start.y})`);return t*(s.end.y-s.start.y)+(s.end.x-s.start.x+1)}var Ds=50,Ya=15,ja=50,Xa=500,Za="\xA0",Ja=new RegExp(Za,"g");var ei=class extends D{constructor(e,i,r,n,o,l,a,u,h){super();this._element=e;this._screenElement=i;this._linkifier=r;this._bufferService=n;this._coreService=o;this._mouseService=l;this._optionsService=a;this._renderService=u;this._coreBrowserService=h;this._dragScrollAmount=0;this._enabled=!0;this._workCell=new q;this._mouseDownTimeStamp=0;this._oldHasSelection=!1;this._oldSelectionStart=void 0;this._oldSelectionEnd=void 0;this._onLinuxMouseSelection=this._register(new v);this.onLinuxMouseSelection=this._onLinuxMouseSelection.event;this._onRedrawRequest=this._register(new v);this.onRequestRedraw=this._onRedrawRequest.event;this._onSelectionChange=this._register(new v);this.onSelectionChange=this._onSelectionChange.event;this._onRequestScrollLines=this._register(new v);this.onRequestScrollLines=this._onRequestScrollLines.event;this._mouseMoveListener=c=>this._handleMouseMove(c),this._mouseUpListener=c=>this._handleMouseUp(c),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(c=>this._handleTrim(c)),this._register(this._bufferService.buffers.onBufferActivate(c=>this._handleBufferActivate(c))),this.enable(),this._model=new on(this._bufferService),this._activeSelectionMode=0,this._register(C(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(c=>{c.rowsChanged&&this.clearSelection()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){let e=this._model.finalSelectionStart,i=this._model.finalSelectionEnd;return!e||!i?!1:e[0]!==i[0]||e[1]!==i[1]}get selectionText(){let e=this._model.finalSelectionStart,i=this._model.finalSelectionEnd;if(!e||!i)return"";let r=this._bufferService.buffer,n=[];if(this._activeSelectionMode===3){if(e[0]===i[0])return"";let l=e[0]l.replace(Ja," ")).join(Es?`\r -`:` -`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),Bi&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(e){let i=this._getMouseBufferCoords(e),r=this._model.finalSelectionStart,n=this._model.finalSelectionEnd;return!r||!n||!i?!1:this._areCoordsInSelection(i,r,n)}isCellInSelection(e,i){let r=this._model.finalSelectionStart,n=this._model.finalSelectionEnd;return!r||!n?!1:this._areCoordsInSelection([e,i],r,n)}_areCoordsInSelection(e,i,r){return e[1]>i[1]&&e[1]=i[0]&&e[0]=i[0]}_selectWordAtCursor(e,i){let r=this._linkifier.currentLink?.link?.range;if(r)return this._model.selectionStart=[r.start.x-1,r.start.y-1],this._model.selectionStartLength=ws(r,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let n=this._getMouseBufferCoords(e);return n?(this._selectWordAt(n,i),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,i){this._model.clearSelection(),e=Math.max(e,0),i=Math.min(i,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,i],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let i=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(i)return i[0]--,i[1]--,i[1]+=this._bufferService.buffer.ydisp,i}_getMouseEventScrollAmount(e){let i=Ci(this._coreBrowserService.window,e,this._screenElement)[1],r=this._renderService.dimensions.css.canvas.height;return i>=0&&i<=r?0:(i>r&&(i-=r),i=Math.min(Math.max(i,-Ds),Ds),i/=Ds,i/Math.abs(i)+Math.round(i*(Ya-1)))}shouldForceSelection(e){return Zt?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),ja)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let i=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);i&&i.length!==this._model.selectionStart[0]&&i.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let i=this._getMouseBufferCoords(e);i&&(this._activeSelectionMode=2,this._selectLineAt(i[1]))}shouldColumnSelect(e){return e.altKey&&!(Zt&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let i=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}this._activeSelectionMode===2?this._model.selectionEnd[1]0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let r=this._bufferService.buffer;if(this._model.selectionEnd[1]0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let i=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&ithis._handleTrim(i))}_convertViewportColToCharacterIndex(e,i){let r=i;for(let n=0;i>=n;n++){let o=e.loadCell(n,this._workCell).getChars().length;this._workCell.getWidth()===0?r--:o>1&&i!==n&&(r+=o-1)}return r}setSelection(e,i,r){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,i],this._model.selectionStartLength=r,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,i,r=!0,n=!0){if(e[0]>=this._bufferService.cols)return;let o=this._bufferService.buffer,l=o.lines.get(e[1]);if(!l)return;let a=o.translateBufferLineToString(e[1],!1),u=this._convertViewportColToCharacterIndex(l,e[0]),h=u,c=e[0]-u,d=0,_=0,p=0,m=0;if(a.charAt(u)===" "){for(;u>0&&a.charAt(u-1)===" ";)u--;for(;h1&&(m+=I-1,h+=I-1);R>0&&u>0&&!this._isCharWordSeparator(l.loadCell(R-1,this._workCell));){l.loadCell(R-1,this._workCell);let k=this._workCell.getChars().length;this._workCell.getWidth()===0?(d++,R--):k>1&&(p+=k-1,u-=k-1),u--,R--}for(;O1&&(m+=k-1,h+=k-1),h++,O++}}h++;let f=u+c-d+p,A=Math.min(this._bufferService.cols,h-u+d+_-p-m);if(!(!i&&a.slice(u,h).trim()==="")){if(r&&f===0&&l.getCodePoint(0)!==32){let R=o.lines.get(e[1]-1);if(R&&l.isWrapped&&R.getCodePoint(this._bufferService.cols-1)!==32){let O=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(O){let I=this._bufferService.cols-O.start;f-=I,A+=I}}}if(n&&f+A===this._bufferService.cols&&l.getCodePoint(this._bufferService.cols-1)!==32){let R=o.lines.get(e[1]+1);if(R?.isWrapped&&R.getCodePoint(0)!==32){let O=this._getWordAt([0,e[1]+1],!1,!1,!0);O&&(A+=O.length)}}return{start:f,length:A}}}_selectWordAt(e,i){let r=this._getWordAt(e,i);if(r){for(;r.start<0;)r.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[r.start,e[1]],this._model.selectionStartLength=r.length}}_selectToWordAt(e){let i=this._getWordAt(e,!0);if(i){let r=e[1];for(;i.start<0;)i.start+=this._bufferService.cols,r--;if(!this._model.areSelectionValuesReversed())for(;i.start+i.length>this._bufferService.cols;)i.length-=this._bufferService.cols,r++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?i.start:i.start+i.length,r]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let i=this._bufferService.buffer.getWrappedRangeForLine(e),r={start:{x:0,y:i.first},end:{x:this._bufferService.cols-1,y:i.last}};this._model.selectionStart=[0,i.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=ws(r,this._bufferService.cols)}};ei=M([S(3,F),S(4,ge),S(5,Dt),S(6,H),S(7,ce),S(8,ae)],ei);var Hi=class{constructor(){this._data={}}set(t,e,i){this._data[t]||(this._data[t]={}),this._data[t][e]=i}get(t,e){return this._data[t]?this._data[t][e]:void 0}clear(){this._data={}}};var Wi=class{constructor(){this._color=new Hi;this._css=new Hi}setCss(t,e,i){this._css.set(t,e,i)}getCss(t,e){return this._css.get(t,e)}setColor(t,e,i){this._color.set(t,e,i)}getColor(t,e){return this._color.get(t,e)}clear(){this._color.clear(),this._css.clear()}};var re=Object.freeze((()=>{let s=[z.toColor("#2e3436"),z.toColor("#cc0000"),z.toColor("#4e9a06"),z.toColor("#c4a000"),z.toColor("#3465a4"),z.toColor("#75507b"),z.toColor("#06989a"),z.toColor("#d3d7cf"),z.toColor("#555753"),z.toColor("#ef2929"),z.toColor("#8ae234"),z.toColor("#fce94f"),z.toColor("#729fcf"),z.toColor("#ad7fa8"),z.toColor("#34e2e2"),z.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let e=0;e<216;e++){let i=t[e/36%6|0],r=t[e/6%6|0],n=t[e%6];s.push({css:j.toCss(i,r,n),rgba:j.toRgba(i,r,n)})}for(let e=0;e<24;e++){let i=8+e*10;s.push({css:j.toCss(i,i,i),rgba:j.toRgba(i,i,i)})}return s})());var St=z.toColor("#ffffff"),Ki=z.toColor("#000000"),tl=z.toColor("#ffffff"),il=Ki,Ui={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},Qa=St,ti=class extends D{constructor(e){super();this._optionsService=e;this._contrastCache=new Wi;this._halfContrastCache=new Wi;this._onChangeColors=this._register(new v);this.onChangeColors=this._onChangeColors.event;this._colors={foreground:St,background:Ki,cursor:tl,cursorAccent:il,selectionForeground:void 0,selectionBackgroundTransparent:Ui,selectionBackgroundOpaque:U.blend(Ki,Ui),selectionInactiveBackgroundTransparent:Ui,selectionInactiveBackgroundOpaque:U.blend(Ki,Ui),scrollbarSliderBackground:U.opacity(St,.2),scrollbarSliderHoverBackground:U.opacity(St,.4),scrollbarSliderActiveBackground:U.opacity(St,.5),overviewRulerBorder:St,ansi:re.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this._register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this._register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}get colors(){return this._colors}_setTheme(e={}){let i=this._colors;if(i.foreground=K(e.foreground,St),i.background=K(e.background,Ki),i.cursor=U.blend(i.background,K(e.cursor,tl)),i.cursorAccent=U.blend(i.background,K(e.cursorAccent,il)),i.selectionBackgroundTransparent=K(e.selectionBackground,Ui),i.selectionBackgroundOpaque=U.blend(i.background,i.selectionBackgroundTransparent),i.selectionInactiveBackgroundTransparent=K(e.selectionInactiveBackground,i.selectionBackgroundTransparent),i.selectionInactiveBackgroundOpaque=U.blend(i.background,i.selectionInactiveBackgroundTransparent),i.selectionForeground=e.selectionForeground?K(e.selectionForeground,ps):void 0,i.selectionForeground===ps&&(i.selectionForeground=void 0),U.isOpaque(i.selectionBackgroundTransparent)&&(i.selectionBackgroundTransparent=U.opacity(i.selectionBackgroundTransparent,.3)),U.isOpaque(i.selectionInactiveBackgroundTransparent)&&(i.selectionInactiveBackgroundTransparent=U.opacity(i.selectionInactiveBackgroundTransparent,.3)),i.scrollbarSliderBackground=K(e.scrollbarSliderBackground,U.opacity(i.foreground,.2)),i.scrollbarSliderHoverBackground=K(e.scrollbarSliderHoverBackground,U.opacity(i.foreground,.4)),i.scrollbarSliderActiveBackground=K(e.scrollbarSliderActiveBackground,U.opacity(i.foreground,.5)),i.overviewRulerBorder=K(e.overviewRulerBorder,Qa),i.ansi=re.slice(),i.ansi[0]=K(e.black,re[0]),i.ansi[1]=K(e.red,re[1]),i.ansi[2]=K(e.green,re[2]),i.ansi[3]=K(e.yellow,re[3]),i.ansi[4]=K(e.blue,re[4]),i.ansi[5]=K(e.magenta,re[5]),i.ansi[6]=K(e.cyan,re[6]),i.ansi[7]=K(e.white,re[7]),i.ansi[8]=K(e.brightBlack,re[8]),i.ansi[9]=K(e.brightRed,re[9]),i.ansi[10]=K(e.brightGreen,re[10]),i.ansi[11]=K(e.brightYellow,re[11]),i.ansi[12]=K(e.brightBlue,re[12]),i.ansi[13]=K(e.brightMagenta,re[13]),i.ansi[14]=K(e.brightCyan,re[14]),i.ansi[15]=K(e.brightWhite,re[15]),e.extendedAnsi){let r=Math.min(i.ansi.length-16,e.extendedAnsi.length);for(let n=0;no.index-l.index),r=[];for(let o of i){let l=this._services.get(o.id);if(!l)throw new Error(`[createInstance] ${t.name} depends on UNKNOWN service ${o.id._id}.`);r.push(l)}let n=i.length>0?i[0].index:e.length;if(e.length!==n)throw new Error(`[createInstance] First service dependency of ${t.name} at position ${n+1} conflicts with ${e.length} static arguments`);return new t(...e,...r)}};var ec={trace:0,debug:1,info:2,warn:3,error:4,off:5},tc="xterm.js: ",ii=class extends D{constructor(e){super();this._optionsService=e;this._logLevel=5;this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),ic=this}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=ec[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let i=0;ithis._length)for(let i=this._length;i=e;n--)this._array[this._getCyclicIndex(n+r.length)]=this._array[this._getCyclicIndex(n)];for(let n=0;nthis._maxLength){let n=this._length+r.length-this._maxLength;this._startIndex+=n,this._length=this._maxLength,this.onTrimEmitter.fire(n)}else this._length+=r.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,i,r){if(!(i<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+r<0)throw new Error("Cannot shift elements in list beyond index 0");if(r>0){for(let o=i-1;o>=0;o--)this.set(e+o+r,this.get(e+o));let n=e+i+r-this._length;if(n>0)for(this._length+=n;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let n=0;n>22,e&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):i]}set(t,e){this._data[t*B+1]=e[0],e[1].length>1?(this._combined[t]=e[1],this._data[t*B+0]=t|2097152|e[2]<<22):this._data[t*B+0]=e[1].charCodeAt(0)|e[2]<<22}getWidth(t){return this._data[t*B+0]>>22}hasWidth(t){return this._data[t*B+0]&12582912}getFg(t){return this._data[t*B+1]}getBg(t){return this._data[t*B+2]}hasContent(t){return this._data[t*B+0]&4194303}getCodePoint(t){let e=this._data[t*B+0];return e&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):e&2097151}isCombined(t){return this._data[t*B+0]&2097152}getString(t){let e=this._data[t*B+0];return e&2097152?this._combined[t]:e&2097151?Ce(e&2097151):""}isProtected(t){return this._data[t*B+2]&536870912}loadCell(t,e){return an=t*B,e.content=this._data[an+0],e.fg=this._data[an+1],e.bg=this._data[an+2],e.content&2097152&&(e.combinedData=this._combined[t]),e.bg&268435456&&(e.extended=this._extendedAttrs[t]),e}setCell(t,e){e.content&2097152&&(this._combined[t]=e.combinedData),e.bg&268435456&&(this._extendedAttrs[t]=e.extended),this._data[t*B+0]=e.content,this._data[t*B+1]=e.fg,this._data[t*B+2]=e.bg}setCellFromCodepoint(t,e,i,r){r.bg&268435456&&(this._extendedAttrs[t]=r.extended),this._data[t*B+0]=e|i<<22,this._data[t*B+1]=r.fg,this._data[t*B+2]=r.bg}addCodepointToCell(t,e,i){let r=this._data[t*B+0];r&2097152?this._combined[t]+=Ce(e):r&2097151?(this._combined[t]=Ce(r&2097151)+Ce(e),r&=-2097152,r|=2097152):r=e|1<<22,i&&(r&=-12582913,r|=i<<22),this._data[t*B+0]=r}insertCells(t,e,i){if(t%=this.length,t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,i),e=0;--n)this.setCell(t+e+n,this.loadCell(t+n,r));for(let n=0;nthis.length){if(this._data.buffer.byteLength>=i*4)this._data=new Uint32Array(this._data.buffer,0,i);else{let r=new Uint32Array(i);r.set(this._data),this._data=r}for(let r=this.length;r=t&&delete this._combined[l]}let n=Object.keys(this._extendedAttrs);for(let o=0;o=t&&delete this._extendedAttrs[l]}}return this.length=t,i*4*Ls=0;--t)if(this._data[t*B+0]&4194303)return t+(this._data[t*B+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*B+0]&4194303||this._data[t*B+2]&50331648)return t+(this._data[t*B+0]>>22);return 0}copyCellsFrom(t,e,i,r,n){let o=t._data;if(n)for(let a=r-1;a>=0;a--){for(let u=0;u=e&&(this._combined[u-e+i]=t._combined[u])}}translateToString(t,e,i,r){e=e??0,i=i??this.length,t&&(i=Math.min(i,this.getTrimmedLength())),r&&(r.length=0);let n="";for(;e>22||1}return r&&r.push(e),n}};function sl(s,t,e,i,r,n){let o=[];for(let l=0;l=l&&i0&&(f>c||h[f].getTrimmedLength()===0);f--)m++;m>0&&(o.push(l+h.length-m),o.push(m)),l+=h.length-1}return o}function ol(s,t){let e=[],i=0,r=t[i],n=0;for(let o=0;ori(s,u,t)).reduce((a,u)=>a+u),n=0,o=0,l=0;for(;la&&(n-=a,o++);let u=s[o].getWidth(n-1)===2;u&&n--;let h=u?e-1:e;i.push(h),l+=h}return i}function ri(s,t,e){if(t===s.length-1)return s[t].getTrimmedLength();let i=!s[t].hasContent(e-1)&&s[t].getWidth(e-1)===1,r=s[t+1].getWidth(0)===2;return i&&r?e-1:e}var un=class un{constructor(t){this.line=t;this.isDisposed=!1;this._disposables=[];this._id=un._nextId++;this._onDispose=this.register(new v);this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),Ne(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};un._nextId=1;var cn=un;var ne={},Je=ne.B;ne[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"};ne.A={"#":"\xA3"};ne.B=void 0;ne[4]={"#":"\xA3","@":"\xBE","[":"ij","\\":"\xBD","]":"|","{":"\xA8","|":"f","}":"\xBC","~":"\xB4"};ne.C=ne[5]={"[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"};ne.R={"#":"\xA3","@":"\xE0","[":"\xB0","\\":"\xE7","]":"\xA7","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xA8"};ne.Q={"@":"\xE0","[":"\xE2","\\":"\xE7","]":"\xEA","^":"\xEE","`":"\xF4","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xFB"};ne.K={"@":"\xA7","[":"\xC4","\\":"\xD6","]":"\xDC","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xDF"};ne.Y={"#":"\xA3","@":"\xA7","[":"\xB0","\\":"\xE7","]":"\xE9","`":"\xF9","{":"\xE0","|":"\xF2","}":"\xE8","~":"\xEC"};ne.E=ne[6]={"@":"\xC4","[":"\xC6","\\":"\xD8","]":"\xC5","^":"\xDC","`":"\xE4","{":"\xE6","|":"\xF8","}":"\xE5","~":"\xFC"};ne.Z={"#":"\xA3","@":"\xA7","[":"\xA1","\\":"\xD1","]":"\xBF","{":"\xB0","|":"\xF1","}":"\xE7"};ne.H=ne[7]={"@":"\xC9","[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"};ne["="]={"#":"\xF9","@":"\xE0","[":"\xE9","\\":"\xE7","]":"\xEA","^":"\xEE",_:"\xE8","`":"\xF4","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xFB"};var cl=4294967295,$i=class{constructor(t,e,i){this._hasScrollback=t;this._optionsService=e;this._bufferService=i;this.ydisp=0;this.ybase=0;this.y=0;this.x=0;this.tabs={};this.savedY=0;this.savedX=0;this.savedCurAttrData=X.clone();this.savedCharset=Je;this.markers=[];this._nullCell=q.fromCharData([0,ir,1,0]);this._whitespaceCell=q.fromCharData([0,we,1,32]);this._isClearing=!1;this._memoryCleanupQueue=new Jt;this._memoryCleanupPosition=0;this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new zi(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(t){return t?(this._nullCell.fg=t.fg,this._nullCell.bg=t.bg,this._nullCell.extended=t.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new rt),this._nullCell}getWhitespaceCell(t){return t?(this._whitespaceCell.fg=t.fg,this._whitespaceCell.bg=t.bg,this._whitespaceCell.extended=t.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new rt),this._whitespaceCell}getBlankLine(t,e){return new Ze(this._bufferService.cols,this.getNullCell(t),e)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&ecl?cl:e}fillViewportRows(t){if(this.lines.length===0){t===void 0&&(t=X);let e=this._rows;for(;e--;)this.lines.push(this.getBlankLine(t))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new zi(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(t,e){let i=this.getNullCell(X),r=0,n=this._getCorrectBufferLength(e);if(n>this.lines.maxLength&&(this.lines.maxLength=n),this.lines.length>0){if(this._cols0&&this.lines.length<=this.ybase+this.y+o+1?(this.ybase--,o++,this.ydisp>0&&this.ydisp--):this.lines.push(new Ze(t,i)));else for(let l=this._rows;l>e;l--)this.lines.length>e+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(n0&&(this.lines.trimStart(l),this.ybase=Math.max(this.ybase-l,0),this.ydisp=Math.max(this.ydisp-l,0),this.savedY=Math.max(this.savedY-l,0)),this.lines.maxLength=n}this.x=Math.min(this.x,t-1),this.y=Math.min(this.y,e-1),o&&(this.y+=o),this.savedX=Math.min(this.savedX,t-1),this.scrollTop=0}if(this.scrollBottom=e-1,this._isReflowEnabled&&(this._reflow(t,e),this._cols>t))for(let o=0;o.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let t=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,t=!1);let e=0;for(;this._memoryCleanupPosition100)return!0;return t}get _isReflowEnabled(){let t=this._optionsService.rawOptions.windowsPty;return t&&t.buildNumber?this._hasScrollback&&t.backend==="conpty"&&t.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(t,e){this._cols!==t&&(t>this._cols?this._reflowLarger(t,e):this._reflowSmaller(t,e))}_reflowLarger(t,e){let i=this._optionsService.rawOptions.reflowCursorLine,r=sl(this.lines,this._cols,t,this.ybase+this.y,this.getNullCell(X),i);if(r.length>0){let n=ol(this.lines,r);ll(this.lines,n.layout),this._reflowLargerAdjustViewport(t,e,n.countRemoved)}}_reflowLargerAdjustViewport(t,e,i){let r=this.getNullCell(X),n=i;for(;n-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length=0;l--){let a=this.lines.get(l);if(!a||!a.isWrapped&&a.getTrimmedLength()<=t)continue;let u=[a];for(;a.isWrapped&&l>0;)a=this.lines.get(--l),u.unshift(a);if(!i){let I=this.ybase+this.y;if(I>=l&&I0&&(n.push({start:l+u.length+o,newLines:p}),o+=p.length),u.push(...p);let m=c.length-1,f=c[m];f===0&&(m--,f=c[m]);let A=u.length-d-1,R=h;for(;A>=0;){let I=Math.min(R,f);if(u[m]===void 0)break;if(u[m].copyCellsFrom(u[A],R-I,f-I,I,!0),f-=I,f===0&&(m--,f=c[m]),R-=I,R===0){A--;let k=Math.max(A,0);R=ri(u,k,this._cols)}}for(let I=0;I0;)this.ybase===0?this.y0){let l=[],a=[];for(let f=0;f=0;f--)if(d&&d.start>h+_){for(let A=d.newLines.length-1;A>=0;A--)this.lines.set(f--,d.newLines[A]);f++,l.push({index:h+1,amount:d.newLines.length}),_+=d.newLines.length,d=n[++c]}else this.lines.set(f,a[h--]);let p=0;for(let f=l.length-1;f>=0;f--)l[f].index+=p,this.lines.onInsertEmitter.fire(l[f]),p+=l[f].amount;let m=Math.max(0,u+o-this.lines.maxLength);m>0&&this.lines.onTrimEmitter.fire(m)}}translateBufferLineToString(t,e,i=0,r){let n=this.lines.get(t);return n?n.translateToString(e,i,r):""}getWrappedRangeForLine(t){let e=t,i=t;for(;e>0&&this.lines.get(e).isWrapped;)e--;for(;i+10;);return t>=this._cols?this._cols-1:t<0?0:t}nextStop(t){for(t==null&&(t=this.x);!this.tabs[++t]&&t=this._cols?this._cols-1:t<0?0:t}clearMarkers(t){this._isClearing=!0;for(let e=0;e{e.line-=i,e.line<0&&e.dispose()})),e.register(this.lines.onInsert(i=>{e.line>=i.index&&(e.line+=i.amount)})),e.register(this.lines.onDelete(i=>{e.line>=i.index&&e.linei.index&&(e.line-=i.amount)})),e.register(e.onDispose(()=>this._removeMarker(e))),e}_removeMarker(t){this._isClearing||this.markers.splice(this.markers.indexOf(t),1)}};var hn=class extends D{constructor(e,i){super();this._optionsService=e;this._bufferService=i;this._onBufferActivate=this._register(new v);this.onBufferActivate=this._onBufferActivate.event;this.reset(),this._register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this._register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new $i(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new $i(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(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}))}resize(e,i){this._normal.resize(e,i),this._alt.resize(e,i),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}};var ks=2,Cs=1,ni=class extends D{constructor(e){super();this.isUserScrolling=!1;this._onResize=this._register(new v);this.onResize=this._onResize.event;this._onScroll=this._register(new v);this.onScroll=this._onScroll.event;this.cols=Math.max(e.rawOptions.cols||0,ks),this.rows=Math.max(e.rawOptions.rows||0,Cs),this.buffers=this._register(new hn(e,this)),this._register(this.buffers.onBufferActivate(i=>{this._onScroll.fire(i.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,i){let r=this.cols!==e,n=this.rows!==i;this.cols=e,this.rows=i,this.buffers.resize(e,i),this._onResize.fire({cols:e,rows:i,colsChanged:r,rowsChanged:n})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,i=!1){let r=this.buffer,n;n=this._cachedBlankLine,(!n||n.length!==this.cols||n.getFg(0)!==e.fg||n.getBg(0)!==e.bg)&&(n=r.getBlankLine(e,i),this._cachedBlankLine=n),n.isWrapped=i;let o=r.ybase+r.scrollTop,l=r.ybase+r.scrollBottom;if(r.scrollTop===0){let a=r.lines.isFull;l===r.lines.length-1?a?r.lines.recycle().copyFrom(n):r.lines.push(n.clone()):r.lines.splice(l+1,0,n.clone()),a?this.isUserScrolling&&(r.ydisp=Math.max(r.ydisp-1,0)):(r.ybase++,this.isUserScrolling||r.ydisp++)}else{let a=l-o+1;r.lines.shiftElements(o+1,a-1,-1),r.lines.set(l,n.clone())}this.isUserScrolling||(r.ydisp=r.ybase),this._onScroll.fire(r.ydisp)}scrollLines(e,i){let r=this.buffer;if(e<0){if(r.ydisp===0)return;this.isUserScrolling=!0}else e+r.ydisp>=r.ybase&&(this.isUserScrolling=!1);let n=r.ydisp;r.ydisp=Math.max(Math.min(r.ydisp+e,r.ybase),0),n!==r.ydisp&&(i||this._onScroll.fire(r.ydisp))}};ni=M([S(0,H)],ni);var si={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:Zt,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},nc=["normal","bold","100","200","300","400","500","600","700","800","900"],dn=class extends D{constructor(e){super();this._onOptionChange=this._register(new v);this.onOptionChange=this._onOptionChange.event;let i={...si};for(let r in e)if(r in i)try{let n=e[r];i[r]=this._sanitizeAndValidateOption(r,n)}catch(n){console.error(n)}this.rawOptions=i,this.options={...i},this._setupOptions(),this._register(C(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,i){return this.onOptionChange(r=>{r===e&&i(this.rawOptions[e])})}onMultipleOptionChange(e,i){return this.onOptionChange(r=>{e.indexOf(r)!==-1&&i()})}_setupOptions(){let e=r=>{if(!(r in si))throw new Error(`No option with key "${r}"`);return this.rawOptions[r]},i=(r,n)=>{if(!(r in si))throw new Error(`No option with key "${r}"`);n=this._sanitizeAndValidateOption(r,n),this.rawOptions[r]!==n&&(this.rawOptions[r]=n,this._onOptionChange.fire(r))};for(let r in this.rawOptions){let n={get:e.bind(this,r),set:i.bind(this,r)};Object.defineProperty(this.options,r,n)}}_sanitizeAndValidateOption(e,i){switch(e){case"cursorStyle":if(i||(i=si[e]),!sc(i))throw new Error(`"${i}" is not a valid value for ${e}`);break;case"wordSeparator":i||(i=si[e]);break;case"fontWeight":case"fontWeightBold":if(typeof i=="number"&&1<=i&&i<=1e3)break;i=nc.includes(i)?i:si[e];break;case"cursorWidth":i=Math.floor(i);case"lineHeight":case"tabStopWidth":if(i<1)throw new Error(`${e} cannot be less than 1, value: ${i}`);break;case"minimumContrastRatio":i=Math.max(1,Math.min(21,Math.round(i*10)/10));break;case"scrollback":if(i=Math.min(i,4294967295),i<0)throw new Error(`${e} cannot be less than 0, value: ${i}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(i<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${i}`);break;case"rows":case"cols":if(!i&&i!==0)throw new Error(`${e} must be numeric, value: ${i}`);break;case"windowsPty":i=i??{};break}return i}};function sc(s){return s==="block"||s==="underline"||s==="bar"}function oi(s,t=5){if(typeof s!="object")return s;let e=Array.isArray(s)?[]:{};for(let i in s)e[i]=t<=1?s[i]:s[i]&&oi(s[i],t-1);return e}var ul=Object.freeze({insertMode:!1}),hl=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),li=class extends D{constructor(e,i,r){super();this._bufferService=e;this._logService=i;this._optionsService=r;this.isCursorInitialized=!1;this.isCursorHidden=!1;this._onData=this._register(new v);this.onData=this._onData.event;this._onUserInput=this._register(new v);this.onUserInput=this._onUserInput.event;this._onBinary=this._register(new v);this.onBinary=this._onBinary.event;this._onRequestScrollToBottom=this._register(new v);this.onRequestScrollToBottom=this._onRequestScrollToBottom.event;this.modes=oi(ul),this.decPrivateModes=oi(hl)}reset(){this.modes=oi(ul),this.decPrivateModes=oi(hl)}triggerDataEvent(e,i=!1){if(this._optionsService.rawOptions.disableStdin)return;let r=this._bufferService.buffer;i&&this._optionsService.rawOptions.scrollOnUserInput&&r.ybase!==r.ydisp&&this._onRequestScrollToBottom.fire(),i&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(n=>n.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace("sending binary (codes)",()=>e.split("").map(i=>i.charCodeAt(0))),this._onBinary.fire(e))}};li=M([S(0,F),S(1,nr),S(2,H)],li);var dl={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:s=>s.button===4||s.action!==1?!1:(s.ctrl=!1,s.alt=!1,s.shift=!1,!0)},VT200:{events:19,restrict:s=>s.action!==32},DRAG:{events:23,restrict:s=>!(s.action===32&&s.button===3)},ANY:{events:31,restrict:s=>!0}};function Ms(s,t){let e=(s.ctrl?16:0)|(s.shift?4:0)|(s.alt?8:0);return s.button===4?(e|=64,e|=s.action):(e|=s.button&3,s.button&4&&(e|=64),s.button&8&&(e|=128),s.action===32?e|=32:s.action===0&&!t&&(e|=3)),e}var Ps=String.fromCharCode,fl={DEFAULT:s=>{let t=[Ms(s,!1)+32,s.col+32,s.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${Ps(t[0])}${Ps(t[1])}${Ps(t[2])}`},SGR:s=>{let t=s.action===0&&s.button!==4?"m":"M";return`\x1B[<${Ms(s,!0)};${s.col};${s.row}${t}`},SGR_PIXELS:s=>{let t=s.action===0&&s.button!==4?"m":"M";return`\x1B[<${Ms(s,!0)};${s.x};${s.y}${t}`}},ai=class extends D{constructor(e,i,r){super();this._bufferService=e;this._coreService=i;this._optionsService=r;this._protocols={};this._encodings={};this._activeProtocol="";this._activeEncoding="";this._lastEvent=null;this._wheelPartialScroll=0;this._onProtocolChange=this._register(new v);this.onProtocolChange=this._onProtocolChange.event;for(let n of Object.keys(dl))this.addProtocol(n,dl[n]);for(let n of Object.keys(fl))this.addEncoding(n,fl[n]);this.reset()}addProtocol(e,i){this._protocols[e]=i}addEncoding(e,i){this._encodings[e]=i}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw new Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw new Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,i,r){if(e.deltaY===0||e.shiftKey||i===void 0||r===void 0)return 0;let n=i/r,o=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(o/=n+0,Math.abs(e.deltaY)<50&&(o*=.3),this._wheelPartialScroll+=o,o=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(o*=this._bufferService.rows),o}_applyScrollModifier(e,i){return i.altKey||i.ctrlKey||i.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(e))return!1;let i=this._encodings[this._activeEncoding](e);return i&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(i):this._coreService.triggerDataEvent(i,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_equalEvents(e,i,r){if(r){if(e.x!==i.x||e.y!==i.y)return!1}else if(e.col!==i.col||e.row!==i.row)return!1;return!(e.button!==i.button||e.action!==i.action||e.ctrl!==i.ctrl||e.alt!==i.alt||e.shift!==i.shift)}};ai=M([S(0,F),S(1,ge),S(2,H)],ai);var Os=[[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]],ac=[[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]],se;function cc(s,t){let e=0,i=t.length-1,r;if(st[i][1])return!1;for(;i>=e;)if(r=e+i>>1,s>t[r][1])e=r+1;else if(s=131072&&t<=196605||t>=196608&&t<=262141?2:1}charProperties(t,e){let i=this.wcwidth(t),r=i===0&&e!==0;if(r){let n=Ae.extractWidth(e);n===0?r=!1:n>i&&(i=n)}return Ae.createPropertyValue(0,i,r)}};var Ae=class s{constructor(){this._providers=Object.create(null);this._active="";this._onChange=new v;this.onChange=this._onChange.event;let t=new fn;this.register(t),this._active=t.version,this._activeProvider=t}static extractShouldJoin(t){return(t&1)!==0}static extractWidth(t){return t>>1&3}static extractCharKind(t){return t>>3}static createPropertyValue(t,e,i=!1){return(t&16777215)<<3|(e&3)<<1|(i?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(t){if(!this._providers[t])throw new Error(`unknown Unicode version "${t}"`);this._active=t,this._activeProvider=this._providers[t],this._onChange.fire(t)}register(t){this._providers[t.version]=t}wcwidth(t){return this._activeProvider.wcwidth(t)}getStringCellWidth(t){let e=0,i=0,r=t.length;for(let n=0;n=r)return e+this.wcwidth(o);let u=t.charCodeAt(n);56320<=u&&u<=57343?o=(o-55296)*1024+u-56320+65536:e+=this.wcwidth(u)}let l=this.charProperties(o,i),a=s.extractWidth(l);s.extractShouldJoin(l)&&(a-=s.extractWidth(i)),e+=a,i=l}return e}charProperties(t,e){return this._activeProvider.charProperties(t,e)}};var pn=class{constructor(){this.glevel=0;this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(t){this.glevel=t,this.charset=this._charsets[t]}setgCharset(t,e){this._charsets[t]=e,this.glevel===t&&(this.charset=e)}};function Bs(s){let e=s.buffer.lines.get(s.buffer.ybase+s.buffer.y-1)?.get(s.cols-1),i=s.buffer.lines.get(s.buffer.ybase+s.buffer.y);i&&e&&(i.isWrapped=e[3]!==0&&e[3]!==32)}var Vi=2147483647,uc=256,ci=class s{constructor(t=32,e=32){this.maxLength=t;this.maxSubParamsLength=e;if(e>uc)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(t),this.length=0,this._subParams=new Int32Array(e),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(t),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let e=new s;if(!t.length)return e;for(let i=Array.isArray(t[0])?1:0;i>8,r=this._subParamsIdx[e]&255;r-i>0&&t.push(Array.prototype.slice.call(this._subParams,i,r))}return t}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(t){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=t>Vi?Vi:t}addSubParam(t){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=t>Vi?Vi:t,this._subParamsIdx[this.length-1]++}}hasSubParams(t){return(this._subParamsIdx[t]&255)-(this._subParamsIdx[t]>>8)>0}getSubParams(t){let e=this._subParamsIdx[t]>>8,i=this._subParamsIdx[t]&255;return i-e>0?this._subParams.subarray(e,i):null}getSubParamsAll(){let t={};for(let e=0;e>8,r=this._subParamsIdx[e]&255;r-i>0&&(t[e]=this._subParams.slice(i,r))}return t}addDigit(t){let e;if(this._rejectDigits||!(e=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let i=this._digitIsSub?this._subParams:this.params,r=i[e-1];i[e-1]=~r?Math.min(r*10+t,Vi):t}};var qi=[],mn=class{constructor(){this._state=0;this._active=qi;this._id=-1;this._handlers=Object.create(null);this._handlerFb=()=>{};this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(t,e){this._handlers[t]===void 0&&(this._handlers[t]=[]);let i=this._handlers[t];return i.push(e),{dispose:()=>{let r=i.indexOf(e);r!==-1&&i.splice(r,1)}}}clearHandler(t){this._handlers[t]&&delete this._handlers[t]}setHandlerFallback(t){this._handlerFb=t}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=qi}reset(){if(this._state===2)for(let t=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;t>=0;--t)this._active[t].end(!1);this._stack.paused=!1,this._active=qi,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||qi,!this._active.length)this._handlerFb(this._id,"START");else for(let t=this._active.length-1;t>=0;t--)this._active[t].start()}_put(t,e,i){if(!this._active.length)this._handlerFb(this._id,"PUT",It(t,e,i));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(t,e,i)}start(){this.reset(),this._state=1}put(t,e,i){if(this._state!==3){if(this._state===1)for(;e0&&this._put(t,e,i)}}end(t,e=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,"END",t);else{let i=!1,r=this._active.length-1,n=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,i=e,n=this._stack.fallThrough,this._stack.paused=!1),!n&&i===!1){for(;r>=0&&(i=this._active[r].end(t),i!==!0);r--)if(i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,i;r--}for(;r>=0;r--)if(i=this._active[r].end(!1),i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,i}this._active=qi,this._id=-1,this._state=0}}},pe=class{constructor(t){this._handler=t;this._data="";this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(t,e,i){this._hitLimit||(this._data+=It(t,e,i),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(t){let e=!1;if(this._hitLimit)e=!1;else if(t&&(e=this._handler(this._data),e instanceof Promise))return e.then(i=>(this._data="",this._hitLimit=!1,i));return this._data="",this._hitLimit=!1,e}};var Yi=[],_n=class{constructor(){this._handlers=Object.create(null);this._active=Yi;this._ident=0;this._handlerFb=()=>{};this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Yi}registerHandler(t,e){this._handlers[t]===void 0&&(this._handlers[t]=[]);let i=this._handlers[t];return i.push(e),{dispose:()=>{let r=i.indexOf(e);r!==-1&&i.splice(r,1)}}}clearHandler(t){this._handlers[t]&&delete this._handlers[t]}setHandlerFallback(t){this._handlerFb=t}reset(){if(this._active.length)for(let t=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;t>=0;--t)this._active[t].unhook(!1);this._stack.paused=!1,this._active=Yi,this._ident=0}hook(t,e){if(this.reset(),this._ident=t,this._active=this._handlers[t]||Yi,!this._active.length)this._handlerFb(this._ident,"HOOK",e);else for(let i=this._active.length-1;i>=0;i--)this._active[i].hook(e)}put(t,e,i){if(!this._active.length)this._handlerFb(this._ident,"PUT",It(t,e,i));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(t,e,i)}unhook(t,e=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",t);else{let i=!1,r=this._active.length-1,n=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,i=e,n=this._stack.fallThrough,this._stack.paused=!1),!n&&i===!1){for(;r>=0&&(i=this._active[r].unhook(t),i!==!0);r--)if(i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,i;r--}for(;r>=0;r--)if(i=this._active[r].unhook(!1),i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,i}this._active=Yi,this._ident=0}},ji=new ci;ji.addParam(0);var Xi=class{constructor(t){this._handler=t;this._data="";this._params=ji;this._hitLimit=!1}hook(t){this._params=t.length>1||t.params[0]?t.clone():ji,this._data="",this._hitLimit=!1}put(t,e,i){this._hitLimit||(this._data+=It(t,e,i),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(t){let e=!1;if(this._hitLimit)e=!1;else if(t&&(e=this._handler(this._data,this._params),e instanceof Promise))return e.then(i=>(this._params=ji,this._data="",this._hitLimit=!1,i));return this._params=ji,this._data="",this._hitLimit=!1,e}};var Fs=class{constructor(t){this.table=new Uint8Array(t)}setDefault(t,e){this.table.fill(t<<4|e)}add(t,e,i,r){this.table[e<<8|t]=i<<4|r}addMany(t,e,i,r){for(let n=0;nu),i=(a,u)=>e.slice(a,u),r=i(32,127),n=i(0,24);n.push(25),n.push.apply(n,i(28,32));let o=i(0,14),l;s.setDefault(1,0),s.addMany(r,0,2,0);for(l in o)s.addMany([24,26,153,154],l,3,0),s.addMany(i(128,144),l,3,0),s.addMany(i(144,152),l,3,0),s.add(156,l,0,0),s.add(27,l,11,1),s.add(157,l,4,8),s.addMany([152,158,159],l,0,7),s.add(155,l,11,3),s.add(144,l,11,9);return s.addMany(n,0,3,0),s.addMany(n,1,3,1),s.add(127,1,0,1),s.addMany(n,8,0,8),s.addMany(n,3,3,3),s.add(127,3,0,3),s.addMany(n,4,3,4),s.add(127,4,0,4),s.addMany(n,6,3,6),s.addMany(n,5,3,5),s.add(127,5,0,5),s.addMany(n,2,3,2),s.add(127,2,0,2),s.add(93,1,4,8),s.addMany(r,8,5,8),s.add(127,8,5,8),s.addMany([156,27,24,26,7],8,6,0),s.addMany(i(28,32),8,0,8),s.addMany([88,94,95],1,0,7),s.addMany(r,7,0,7),s.addMany(n,7,0,7),s.add(156,7,0,0),s.add(127,7,0,7),s.add(91,1,11,3),s.addMany(i(64,127),3,7,0),s.addMany(i(48,60),3,8,4),s.addMany([60,61,62,63],3,9,4),s.addMany(i(48,60),4,8,4),s.addMany(i(64,127),4,7,0),s.addMany([60,61,62,63],4,0,6),s.addMany(i(32,64),6,0,6),s.add(127,6,0,6),s.addMany(i(64,127),6,0,0),s.addMany(i(32,48),3,9,5),s.addMany(i(32,48),5,9,5),s.addMany(i(48,64),5,0,6),s.addMany(i(64,127),5,7,0),s.addMany(i(32,48),4,9,5),s.addMany(i(32,48),1,9,2),s.addMany(i(32,48),2,9,2),s.addMany(i(48,127),2,10,0),s.addMany(i(48,80),1,10,0),s.addMany(i(81,88),1,10,0),s.addMany([89,90,92],1,10,0),s.addMany(i(96,127),1,10,0),s.add(80,1,11,9),s.addMany(n,9,0,9),s.add(127,9,0,9),s.addMany(i(28,32),9,0,9),s.addMany(i(32,48),9,9,12),s.addMany(i(48,60),9,8,10),s.addMany([60,61,62,63],9,9,10),s.addMany(n,11,0,11),s.addMany(i(32,128),11,0,11),s.addMany(i(28,32),11,0,11),s.addMany(n,10,0,10),s.add(127,10,0,10),s.addMany(i(28,32),10,0,10),s.addMany(i(48,60),10,8,10),s.addMany([60,61,62,63],10,0,11),s.addMany(i(32,48),10,9,12),s.addMany(n,12,0,12),s.add(127,12,0,12),s.addMany(i(28,32),12,0,12),s.addMany(i(32,48),12,9,12),s.addMany(i(48,64),12,0,11),s.addMany(i(64,127),12,12,13),s.addMany(i(64,127),10,12,13),s.addMany(i(64,127),9,12,13),s.addMany(n,13,13,13),s.addMany(r,13,13,13),s.add(127,13,0,13),s.addMany([27,156,24,26],13,14,0),s.add(ke,0,2,0),s.add(ke,8,5,8),s.add(ke,6,0,6),s.add(ke,11,0,11),s.add(ke,13,13,13),s}(),bn=class extends D{constructor(e=hc){super();this._transitions=e;this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0};this.initialState=0,this.currentState=this.initialState,this._params=new ci,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(i,r,n)=>{},this._executeHandlerFb=i=>{},this._csiHandlerFb=(i,r)=>{},this._escHandlerFb=i=>{},this._errorHandlerFb=i=>i,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(C(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new mn),this._dcsParser=this._register(new _n),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,i=[64,126]){let r=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(r=e.prefix.charCodeAt(0),r&&60>r||r>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(let o=0;ol||l>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");r<<=8,r|=l}}if(e.final.length!==1)throw new Error("final must be a single byte");let n=e.final.charCodeAt(0);if(i[0]>n||n>i[1])throw new Error(`final must be in range ${i[0]} .. ${i[1]}`);return r<<=8,r|=n,r}identToString(e){let i=[];for(;e;)i.push(String.fromCharCode(e&255)),e>>=8;return i.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,i){let r=this._identifier(e,[48,126]);this._escHandlers[r]===void 0&&(this._escHandlers[r]=[]);let n=this._escHandlers[r];return n.push(i),{dispose:()=>{let o=n.indexOf(i);o!==-1&&n.splice(o,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,i){this._executeHandlers[e.charCodeAt(0)]=i}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,i){let r=this._identifier(e);this._csiHandlers[r]===void 0&&(this._csiHandlers[r]=[]);let n=this._csiHandlers[r];return n.push(i),{dispose:()=>{let o=n.indexOf(i);o!==-1&&n.splice(o,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,i){return this._dcsParser.registerHandler(this._identifier(e),i)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,i){return this._oscParser.registerHandler(e,i)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,i,r,n,o){this._parseStack.state=e,this._parseStack.handlers=i,this._parseStack.handlerPos=r,this._parseStack.transition=n,this._parseStack.chunkPos=o}parse(e,i,r){let n=0,o=0,l=0,a;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,l=this._parseStack.chunkPos+1;else{if(r===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let u=this._parseStack.handlers,h=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(r===!1&&h>-1){for(;h>=0&&(a=u[h](this._params),a!==!0);h--)if(a instanceof Promise)return this._parseStack.handlerPos=h,a}this._parseStack.handlers=[];break;case 4:if(r===!1&&h>-1){for(;h>=0&&(a=u[h](),a!==!0);h--)if(a instanceof Promise)return this._parseStack.handlerPos=h,a}this._parseStack.handlers=[];break;case 6:if(n=e[this._parseStack.chunkPos],a=this._dcsParser.unhook(n!==24&&n!==26,r),a)return a;n===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(n=e[this._parseStack.chunkPos],a=this._oscParser.end(n!==24&&n!==26,r),a)return a;n===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,l=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let u=l;u>4){case 2:for(let m=u+1;;++m){if(m>=i||(n=e[m])<32||n>126&&n=i||(n=e[m])<32||n>126&&n=i||(n=e[m])<32||n>126&&n=i||(n=e[m])<32||n>126&&n=0&&(a=c[d](this._params),a!==!0);d--)if(a instanceof Promise)return this._preserveStack(3,c,d,o,u),a;d<0&&this._csiHandlerFb(this._collect<<8|n,this._params),this.precedingJoinState=0;break;case 8:do switch(n){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(n-48)}while(++u47&&n<60);u--;break;case 9:this._collect<<=8,this._collect|=n;break;case 10:let _=this._escHandlers[this._collect<<8|n],p=_?_.length-1:-1;for(;p>=0&&(a=_[p](),a!==!0);p--)if(a instanceof Promise)return this._preserveStack(4,_,p,o,u),a;p<0&&this._escHandlerFb(this._collect<<8|n),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|n,this._params);break;case 13:for(let m=u+1;;++m)if(m>=i||(n=e[m])===24||n===26||n===27||n>127&&n=i||(n=e[m])<32||n>127&&n>4:n>>8}return i}}function Hs(s,t){let e=s.toString(16),i=e.length<2?"0"+e:e;switch(t){case 4:return e[0];case 8:return i;case 12:return(i+i).slice(0,3);default:return i+i}}function ml(s,t=16){let[e,i,r]=s;return`rgb:${Hs(e,t)}/${Hs(i,t)}/${Hs(r,t)}`}var mc={"(":0,")":1,"*":2,"+":3,"-":1,".":2},ut=131072,_l=10;function bl(s,t){if(s>24)return t.setWinLines||!1;switch(s){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}var vl=5e3,gl=0,vn=class extends D{constructor(e,i,r,n,o,l,a,u,h=new bn){super();this._bufferService=e;this._charsetService=i;this._coreService=r;this._logService=n;this._optionsService=o;this._oscLinkService=l;this._coreMouseService=a;this._unicodeService=u;this._parser=h;this._parseBuffer=new Uint32Array(4096);this._stringDecoder=new er;this._utf8Decoder=new tr;this._windowTitle="";this._iconName="";this._windowTitleStack=[];this._iconNameStack=[];this._curAttrData=X.clone();this._eraseAttrDataInternal=X.clone();this._onRequestBell=this._register(new v);this.onRequestBell=this._onRequestBell.event;this._onRequestRefreshRows=this._register(new v);this.onRequestRefreshRows=this._onRequestRefreshRows.event;this._onRequestReset=this._register(new v);this.onRequestReset=this._onRequestReset.event;this._onRequestSendFocus=this._register(new v);this.onRequestSendFocus=this._onRequestSendFocus.event;this._onRequestSyncScrollBar=this._register(new v);this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event;this._onRequestWindowsOptionsReport=this._register(new v);this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event;this._onA11yChar=this._register(new v);this.onA11yChar=this._onA11yChar.event;this._onA11yTab=this._register(new v);this.onA11yTab=this._onA11yTab.event;this._onCursorMove=this._register(new v);this.onCursorMove=this._onCursorMove.event;this._onLineFeed=this._register(new v);this.onLineFeed=this._onLineFeed.event;this._onScroll=this._register(new v);this.onScroll=this._onScroll.event;this._onTitleChange=this._register(new v);this.onTitleChange=this._onTitleChange.event;this._onColor=this._register(new v);this.onColor=this._onColor.event;this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0};this._specialColors=[256,257,258];this._register(this._parser),this._dirtyRowTracker=new Zi(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(c=>this._activeBuffer=c.activeBuffer)),this._parser.setCsiHandlerFallback((c,d)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(c),params:d.toArray()})}),this._parser.setEscHandlerFallback(c=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(c)})}),this._parser.setExecuteHandlerFallback(c=>{this._logService.debug("Unknown EXECUTE code: ",{code:c})}),this._parser.setOscHandlerFallback((c,d,_)=>{this._logService.debug("Unknown OSC code: ",{identifier:c,action:d,data:_})}),this._parser.setDcsHandlerFallback((c,d,_)=>{d==="HOOK"&&(_=_.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(c),action:d,payload:_})}),this._parser.setPrintHandler((c,d,_)=>this.print(c,d,_)),this._parser.registerCsiHandler({final:"@"},c=>this.insertChars(c)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},c=>this.scrollLeft(c)),this._parser.registerCsiHandler({final:"A"},c=>this.cursorUp(c)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},c=>this.scrollRight(c)),this._parser.registerCsiHandler({final:"B"},c=>this.cursorDown(c)),this._parser.registerCsiHandler({final:"C"},c=>this.cursorForward(c)),this._parser.registerCsiHandler({final:"D"},c=>this.cursorBackward(c)),this._parser.registerCsiHandler({final:"E"},c=>this.cursorNextLine(c)),this._parser.registerCsiHandler({final:"F"},c=>this.cursorPrecedingLine(c)),this._parser.registerCsiHandler({final:"G"},c=>this.cursorCharAbsolute(c)),this._parser.registerCsiHandler({final:"H"},c=>this.cursorPosition(c)),this._parser.registerCsiHandler({final:"I"},c=>this.cursorForwardTab(c)),this._parser.registerCsiHandler({final:"J"},c=>this.eraseInDisplay(c,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},c=>this.eraseInDisplay(c,!0)),this._parser.registerCsiHandler({final:"K"},c=>this.eraseInLine(c,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},c=>this.eraseInLine(c,!0)),this._parser.registerCsiHandler({final:"L"},c=>this.insertLines(c)),this._parser.registerCsiHandler({final:"M"},c=>this.deleteLines(c)),this._parser.registerCsiHandler({final:"P"},c=>this.deleteChars(c)),this._parser.registerCsiHandler({final:"S"},c=>this.scrollUp(c)),this._parser.registerCsiHandler({final:"T"},c=>this.scrollDown(c)),this._parser.registerCsiHandler({final:"X"},c=>this.eraseChars(c)),this._parser.registerCsiHandler({final:"Z"},c=>this.cursorBackwardTab(c)),this._parser.registerCsiHandler({final:"`"},c=>this.charPosAbsolute(c)),this._parser.registerCsiHandler({final:"a"},c=>this.hPositionRelative(c)),this._parser.registerCsiHandler({final:"b"},c=>this.repeatPrecedingCharacter(c)),this._parser.registerCsiHandler({final:"c"},c=>this.sendDeviceAttributesPrimary(c)),this._parser.registerCsiHandler({prefix:">",final:"c"},c=>this.sendDeviceAttributesSecondary(c)),this._parser.registerCsiHandler({final:"d"},c=>this.linePosAbsolute(c)),this._parser.registerCsiHandler({final:"e"},c=>this.vPositionRelative(c)),this._parser.registerCsiHandler({final:"f"},c=>this.hVPosition(c)),this._parser.registerCsiHandler({final:"g"},c=>this.tabClear(c)),this._parser.registerCsiHandler({final:"h"},c=>this.setMode(c)),this._parser.registerCsiHandler({prefix:"?",final:"h"},c=>this.setModePrivate(c)),this._parser.registerCsiHandler({final:"l"},c=>this.resetMode(c)),this._parser.registerCsiHandler({prefix:"?",final:"l"},c=>this.resetModePrivate(c)),this._parser.registerCsiHandler({final:"m"},c=>this.charAttributes(c)),this._parser.registerCsiHandler({final:"n"},c=>this.deviceStatus(c)),this._parser.registerCsiHandler({prefix:"?",final:"n"},c=>this.deviceStatusPrivate(c)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},c=>this.softReset(c)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},c=>this.setCursorStyle(c)),this._parser.registerCsiHandler({final:"r"},c=>this.setScrollRegion(c)),this._parser.registerCsiHandler({final:"s"},c=>this.saveCursor(c)),this._parser.registerCsiHandler({final:"t"},c=>this.windowOptions(c)),this._parser.registerCsiHandler({final:"u"},c=>this.restoreCursor(c)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},c=>this.insertColumns(c)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},c=>this.deleteColumns(c)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},c=>this.selectProtected(c)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},c=>this.requestMode(c,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},c=>this.requestMode(c,!1)),this._parser.setExecuteHandler(b.BEL,()=>this.bell()),this._parser.setExecuteHandler(b.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(b.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(b.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(b.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(b.BS,()=>this.backspace()),this._parser.setExecuteHandler(b.HT,()=>this.tab()),this._parser.setExecuteHandler(b.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(b.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(Ai.IND,()=>this.index()),this._parser.setExecuteHandler(Ai.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(Ai.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new pe(c=>(this.setTitle(c),this.setIconName(c),!0))),this._parser.registerOscHandler(1,new pe(c=>this.setIconName(c))),this._parser.registerOscHandler(2,new pe(c=>this.setTitle(c))),this._parser.registerOscHandler(4,new pe(c=>this.setOrReportIndexedColor(c))),this._parser.registerOscHandler(8,new pe(c=>this.setHyperlink(c))),this._parser.registerOscHandler(10,new pe(c=>this.setOrReportFgColor(c))),this._parser.registerOscHandler(11,new pe(c=>this.setOrReportBgColor(c))),this._parser.registerOscHandler(12,new pe(c=>this.setOrReportCursorColor(c))),this._parser.registerOscHandler(104,new pe(c=>this.restoreIndexedColor(c))),this._parser.registerOscHandler(110,new pe(c=>this.restoreFgColor(c))),this._parser.registerOscHandler(111,new pe(c=>this.restoreBgColor(c))),this._parser.registerOscHandler(112,new pe(c=>this.restoreCursorColor(c))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(let c in ne)this._parser.registerEscHandler({intermediates:"(",final:c},()=>this.selectCharset("("+c)),this._parser.registerEscHandler({intermediates:")",final:c},()=>this.selectCharset(")"+c)),this._parser.registerEscHandler({intermediates:"*",final:c},()=>this.selectCharset("*"+c)),this._parser.registerEscHandler({intermediates:"+",final:c},()=>this.selectCharset("+"+c)),this._parser.registerEscHandler({intermediates:"-",final:c},()=>this.selectCharset("-"+c)),this._parser.registerEscHandler({intermediates:".",final:c},()=>this.selectCharset("."+c)),this._parser.registerEscHandler({intermediates:"/",final:c},()=>this.selectCharset("/"+c));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(c=>(this._logService.error("Parsing error: ",c),c)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new Xi((c,d)=>this.requestStatusString(c,d)))}getAttrData(){return this._curAttrData}_preserveStack(e,i,r,n){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=i,this._parseStack.decodedLength=r,this._parseStack.position=n}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((i,r)=>setTimeout(()=>r("#SLOW_TIMEOUT"),vl))]).catch(i=>{if(i!=="#SLOW_TIMEOUT")throw i;console.warn(`async parser handler taking longer than ${vl} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,i){let r,n=this._activeBuffer.x,o=this._activeBuffer.y,l=0,a=this._parseStack.paused;if(a){if(r=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,i))return this._logSlowResolvingAsync(r),r;n=this._parseStack.cursorStartX,o=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>ut&&(l=this._parseStack.position+ut)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e=="string"?` "${e}"`:` "${Array.prototype.map.call(e,c=>String.fromCharCode(c)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof e=="string"?e.split("").map(c=>c.charCodeAt(0)):e),this._parseBuffer.lengthut)for(let c=l;c0&&_.getWidth(this._activeBuffer.x-1)===2&&_.setCellFromCodepoint(this._activeBuffer.x-1,0,1,d);let p=this._parser.precedingJoinState;for(let m=i;mu){if(h){let O=_,I=this._activeBuffer.x-R;for(this._activeBuffer.x=R,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),_=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),R>0&&_ instanceof Ze&&_.copyCellsFrom(O,I,0,R,!1);I=0;)_.setCellFromCodepoint(this._activeBuffer.x++,0,0,d);continue}if(c&&(_.insertCells(this._activeBuffer.x,o-R,this._activeBuffer.getNullCell(d)),_.getWidth(u-1)===2&&_.setCellFromCodepoint(u-1,0,1,d)),_.setCellFromCodepoint(this._activeBuffer.x++,n,o,d),o>0)for(;--o;)_.setCellFromCodepoint(this._activeBuffer.x++,0,0,d)}this._parser.precedingJoinState=p,this._activeBuffer.x0&&_.getWidth(this._activeBuffer.x)===0&&!_.hasContent(this._activeBuffer.x)&&_.setCellFromCodepoint(this._activeBuffer.x,0,1,d),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,i){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,r=>bl(r.params[0],this._optionsService.rawOptions.windowOptions)?i(r):!0):this._parser.registerCsiHandler(e,i)}registerDcsHandler(e,i){return this._parser.registerDcsHandler(e,new Xi(i))}registerEscHandler(e,i){return this._parser.registerEscHandler(e,i)}registerOscHandler(e,i){return this._parser.registerOscHandler(e,new pe(i))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e.hasWidth(this._activeBuffer.x)&&!e.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(e,i){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+i):(this._activeBuffer.x=e,this._activeBuffer.y=i),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,i){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+i)}cursorUp(e){let i=this._activeBuffer.y-this._activeBuffer.scrollTop;return i>=0?this._moveCursor(0,-Math.min(i,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let i=this._activeBuffer.scrollBottom-this._activeBuffer.y;return i>=0?this._moveCursor(0,Math.min(i,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let i=e.params[0];return i===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:i===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let i=e.params[0]||1;for(;i--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let i=e.params[0]||1;for(;i--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let i=e.params[0];return i===1&&(this._curAttrData.bg|=536870912),(i===2||i===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,i,r,n=!1,o=!1){let l=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);l.replaceCells(i,r,this._activeBuffer.getNullCell(this._eraseAttrData()),o),n&&(l.isWrapped=!1)}_resetBufferLine(e,i=!1){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);r&&(r.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),i),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),r.isWrapped=!1)}eraseInDisplay(e,i=!1){this._restrictCursor(this._bufferService.cols);let r;switch(e.params[0]){case 0:for(r=this._activeBuffer.y,this._dirtyRowTracker.markDirty(r),this._eraseInBufferLine(r++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,i);r=this._bufferService.cols&&(this._activeBuffer.lines.get(r+1).isWrapped=!1);r--;)this._resetBufferLine(r,i);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(r=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,r-1);r--&&!this._activeBuffer.lines.get(this._activeBuffer.ybase+r)?.getTrimmedLength(););for(;r>=0;r--)this._bufferService.scroll(this._eraseAttrData())}else{for(r=this._bufferService.rows,this._dirtyRowTracker.markDirty(r-1);r--;)this._resetBufferLine(r,i);this._dirtyRowTracker.markDirty(0)}break;case 3:let n=this._activeBuffer.lines.length-this._bufferService.rows;n>0&&(this._activeBuffer.lines.trimStart(n),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-n,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-n,0),this._onScroll.fire(0));break}return!0}eraseInLine(e,i=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,i);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,i);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,i);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let i=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.y65535?2:1}let c=h;for(let d=1;d0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(b.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(b.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(b.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(b.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(b.ESC+"[>83;40003;0c")),!0}_is(e){return(this._optionsService.rawOptions.termName+"").indexOf(e)===0}setMode(e){for(let i=0;i(P[P.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",P[P.SET=1]="SET",P[P.RESET=2]="RESET",P[P.PERMANENTLY_SET=3]="PERMANENTLY_SET",P[P.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(r||={});let n=this._coreService.decPrivateModes,{activeProtocol:o,activeEncoding:l}=this._coreMouseService,a=this._coreService,{buffers:u,cols:h}=this._bufferService,{active:c,alt:d}=u,_=this._optionsService.rawOptions,p=(A,R)=>(a.triggerDataEvent(`${b.ESC}[${i?"":"?"}${A};${R}$y`),!0),m=A=>A?1:2,f=e.params[0];return i?f===2?p(f,4):f===4?p(f,m(a.modes.insertMode)):f===12?p(f,3):f===20?p(f,m(_.convertEol)):p(f,0):f===1?p(f,m(n.applicationCursorKeys)):f===3?p(f,_.windowOptions.setWinLines?h===80?2:h===132?1:0:0):f===6?p(f,m(n.origin)):f===7?p(f,m(n.wraparound)):f===8?p(f,3):f===9?p(f,m(o==="X10")):f===12?p(f,m(_.cursorBlink)):f===25?p(f,m(!a.isCursorHidden)):f===45?p(f,m(n.reverseWraparound)):f===66?p(f,m(n.applicationKeypad)):f===67?p(f,4):f===1e3?p(f,m(o==="VT200")):f===1002?p(f,m(o==="DRAG")):f===1003?p(f,m(o==="ANY")):f===1004?p(f,m(n.sendFocus)):f===1005?p(f,4):f===1006?p(f,m(l==="SGR")):f===1015?p(f,4):f===1016?p(f,m(l==="SGR_PIXELS")):f===1048?p(f,1):f===47||f===1047||f===1049?p(f,m(c===d)):f===2004?p(f,m(n.bracketedPasteMode)):f===2026?p(f,m(n.synchronizedOutput)):p(f,0)}_updateAttrColor(e,i,r,n,o){return i===2?(e|=50331648,e&=-16777216,e|=De.fromColorRGB([r,n,o])):i===5&&(e&=-50331904,e|=33554432|r&255),e}_extractColor(e,i,r){let n=[0,0,-1,0,0,0],o=0,l=0;do{if(n[l+o]=e.params[i+l],e.hasSubParams(i+l)){let a=e.getSubParams(i+l),u=0;do n[1]===5&&(o=1),n[l+u+1+o]=a[u];while(++u=2||n[1]===2&&l+o>=5)break;n[1]&&(o=1)}while(++l+i5)&&(e=1),i.extended.underlineStyle=e,i.fg|=268435456,e===0&&(i.fg&=-268435457),i.updateExtended()}_processSGR0(e){e.fg=X.fg,e.bg=X.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let i=e.length,r,n=this._curAttrData;for(let o=0;o=30&&r<=37?(n.fg&=-50331904,n.fg|=16777216|r-30):r>=40&&r<=47?(n.bg&=-50331904,n.bg|=16777216|r-40):r>=90&&r<=97?(n.fg&=-50331904,n.fg|=16777216|r-90|8):r>=100&&r<=107?(n.bg&=-50331904,n.bg|=16777216|r-100|8):r===0?this._processSGR0(n):r===1?n.fg|=134217728:r===3?n.bg|=67108864:r===4?(n.fg|=268435456,this._processUnderline(e.hasSubParams(o)?e.getSubParams(o)[0]:1,n)):r===5?n.fg|=536870912:r===7?n.fg|=67108864:r===8?n.fg|=1073741824:r===9?n.fg|=2147483648:r===2?n.bg|=134217728:r===21?this._processUnderline(2,n):r===22?(n.fg&=-134217729,n.bg&=-134217729):r===23?n.bg&=-67108865:r===24?(n.fg&=-268435457,this._processUnderline(0,n)):r===25?n.fg&=-536870913:r===27?n.fg&=-67108865:r===28?n.fg&=-1073741825:r===29?n.fg&=2147483647:r===39?(n.fg&=-67108864,n.fg|=X.fg&16777215):r===49?(n.bg&=-67108864,n.bg|=X.bg&16777215):r===38||r===48||r===58?o+=this._extractColor(e,o,n):r===53?n.bg|=1073741824:r===55?n.bg&=-1073741825:r===59?(n.extended=n.extended.clone(),n.extended.underlineColor=-1,n.updateExtended()):r===100?(n.fg&=-67108864,n.fg|=X.fg&16777215,n.bg&=-67108864,n.bg|=X.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",r);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${b.ESC}[0n`);break;case 6:let i=this._activeBuffer.y+1,r=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${b.ESC}[${i};${r}R`);break}return!0}deviceStatusPrivate(e){switch(e.params[0]){case 6:let i=this._activeBuffer.y+1,r=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${b.ESC}[?${i};${r}R`);break;case 15:break;case 25:break;case 26:break;case 53:break}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=X.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(e){let i=e.length===0?1:e.params[0];if(i===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(i){case 1:case 2:this._coreService.decPrivateModes.cursorStyle="block";break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle="underline";break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle="bar";break}let r=i%2===1;this._coreService.decPrivateModes.cursorBlink=r}return!0}setScrollRegion(e){let i=e.params[0]||1,r;return(e.length<2||(r=e.params[1])>this._bufferService.rows||r===0)&&(r=this._bufferService.rows),r>i&&(this._activeBuffer.scrollTop=i-1,this._activeBuffer.scrollBottom=r-1,this._setCursor(0,0)),!0}windowOptions(e){if(!bl(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let i=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:i!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${b.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(i===0||i===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>_l&&this._windowTitleStack.shift()),(i===0||i===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>_l&&this._iconNameStack.shift());break;case 23:(i===0||i===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(i===0||i===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(e){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(e){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let i=[],r=e.split(";");for(;r.length>1;){let n=r.shift(),o=r.shift();if(/^\d+$/.exec(n)){let l=parseInt(n);if(Sl(l))if(o==="?")i.push({type:0,index:l});else{let a=Ws(o);a&&i.push({type:1,index:l,color:a})}}}return i.length&&this._onColor.fire(i),!0}setHyperlink(e){let i=e.indexOf(";");if(i===-1)return!0;let r=e.slice(0,i).trim(),n=e.slice(i+1);return n?this._createHyperlink(r,n):r.trim()?!1:this._finishHyperlink()}_createHyperlink(e,i){this._getCurrentLinkId()&&this._finishHyperlink();let r=e.split(":"),n,o=r.findIndex(l=>l.startsWith("id="));return o!==-1&&(n=r[o].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:n,uri:i}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,i){let r=e.split(";");for(let n=0;n=this._specialColors.length);++n,++i)if(r[n]==="?")this._onColor.fire([{type:0,index:this._specialColors[i]}]);else{let o=Ws(r[n]);o&&this._onColor.fire([{type:1,index:this._specialColors[i],color:o}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let i=[],r=e.split(";");for(let n=0;n=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){let e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=X.clone(),this._eraseAttrDataInternal=X.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new q;e.content=1<<22|69,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let i=0;i(this._coreService.triggerDataEvent(`${b.ESC}${a}${b.ESC}\\`),!0),n=this._bufferService.buffer,o=this._optionsService.rawOptions,l={block:2,underline:4,bar:6};return r(e==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e==='"p'?'P1$r61;1"p':e==="r"?`P1$r${n.scrollTop+1};${n.scrollBottom+1}r`:e==="m"?"P1$r0m":e===" q"?`P1$r${l[o.cursorStyle]-(o.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,i){this._dirtyRowTracker.markRangeDirty(e,i)}},Zi=class{constructor(t){this._bufferService=t;this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(t){tthis.end&&(this.end=t)}markRangeDirty(t,e){t>e&&(gl=t,t=e,e=gl),tthis.end&&(this.end=e)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};Zi=M([S(0,F)],Zi);function Sl(s){return 0<=s&&s<256}var _c=5e7,El=12,bc=50,gn=class extends D{constructor(e){super();this._action=e;this._writeBuffer=[];this._callbacks=[];this._pendingData=0;this._bufferOffset=0;this._isSyncWriting=!1;this._syncCalls=0;this._didUserInput=!1;this._onWriteParsed=this._register(new v);this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,i){if(i!==void 0&&this._syncCalls>i){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let r;for(;r=this._writeBuffer.shift();){this._action(r);let n=this._callbacks.shift();n&&n()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,i){if(this._pendingData>_c)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(i),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(i)}_innerWrite(e=0,i=!0){let r=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let n=this._writeBuffer[this._bufferOffset],o=this._action(n,i);if(o){let a=u=>performance.now()-r>=El?setTimeout(()=>this._innerWrite(0,u)):this._innerWrite(r,u);o.catch(u=>(queueMicrotask(()=>{throw u}),Promise.resolve(!1))).then(a);return}let l=this._callbacks[this._bufferOffset];if(l&&l(),this._bufferOffset++,this._pendingData-=n.length,performance.now()-r>=El)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>bc&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}};var ui=class{constructor(t){this._bufferService=t;this._nextId=1;this._entriesWithId=new Map;this._dataByLinkId=new Map}registerLink(t){let e=this._bufferService.buffer;if(t.id===void 0){let a=e.addMarker(e.ybase+e.y),u={data:t,id:this._nextId++,lines:[a]};return a.onDispose(()=>this._removeMarkerFromLink(u,a)),this._dataByLinkId.set(u.id,u),u.id}let i=t,r=this._getEntryIdKey(i),n=this._entriesWithId.get(r);if(n)return this.addLineToLink(n.id,e.ybase+e.y),n.id;let o=e.addMarker(e.ybase+e.y),l={id:this._nextId++,key:this._getEntryIdKey(i),data:i,lines:[o]};return o.onDispose(()=>this._removeMarkerFromLink(l,o)),this._entriesWithId.set(l.key,l),this._dataByLinkId.set(l.id,l),l.id}addLineToLink(t,e){let i=this._dataByLinkId.get(t);if(i&&i.lines.every(r=>r.line!==e)){let r=this._bufferService.buffer.addMarker(e);i.lines.push(r),r.onDispose(()=>this._removeMarkerFromLink(i,r))}}getLinkData(t){return this._dataByLinkId.get(t)?.data}_getEntryIdKey(t){return`${t.id};;${t.uri}`}_removeMarkerFromLink(t,e){let i=t.lines.indexOf(e);i!==-1&&(t.lines.splice(i,1),t.lines.length===0&&(t.data.id!==void 0&&this._entriesWithId.delete(t.key),this._dataByLinkId.delete(t.id)))}};ui=M([S(0,F)],ui);var Tl=!1,Sn=class extends D{constructor(e){super();this._windowsWrappingHeuristics=this._register(new ye);this._onBinary=this._register(new v);this.onBinary=this._onBinary.event;this._onData=this._register(new v);this.onData=this._onData.event;this._onLineFeed=this._register(new v);this.onLineFeed=this._onLineFeed.event;this._onResize=this._register(new v);this.onResize=this._onResize.event;this._onWriteParsed=this._register(new v);this.onWriteParsed=this._onWriteParsed.event;this._onScroll=this._register(new v);this._instantiationService=new ln,this.optionsService=this._register(new dn(e)),this._instantiationService.setService(H,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(ni)),this._instantiationService.setService(F,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(ii)),this._instantiationService.setService(nr,this._logService),this.coreService=this._register(this._instantiationService.createInstance(li)),this._instantiationService.setService(ge,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(ai)),this._instantiationService.setService(rr,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(Ae)),this._instantiationService.setService(Js,this.unicodeService),this._charsetService=this._instantiationService.createInstance(pn),this._instantiationService.setService(Zs,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(ui),this._instantiationService.setService(sr,this._oscLinkService),this._inputHandler=this._register(new vn(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register($.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register($.forward(this._bufferService.onResize,this._onResize)),this._register($.forward(this.coreService.onData,this._onData)),this._register($.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),this._register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this._register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this._register(this._bufferService.onScroll(()=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new gn((i,r)=>this._inputHandler.parse(i,r))),this._register($.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new v),this._onScroll.event(e=>{this._onScrollApi?.fire(e.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(e){for(let i in e)this.optionsService.options[i]=e[i]}write(e,i){this._writeBuffer.write(e,i)}writeSync(e,i){this._logService.logLevel<=3&&!Tl&&(this._logService.warn("writeSync is unreliable and will be removed soon."),Tl=!0),this._writeBuffer.writeSync(e,i)}input(e,i=!0){this.coreService.triggerDataEvent(e,i)}resize(e,i){isNaN(e)||isNaN(i)||(e=Math.max(e,ks),i=Math.max(i,Cs),this._bufferService.resize(e,i))}scroll(e,i=!1){this._bufferService.scroll(e,i)}scrollLines(e,i){this._bufferService.scrollLines(e,i)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let i=e-this._bufferService.buffer.ydisp;i!==0&&this.scrollLines(i)}registerEscHandler(e,i){return this._inputHandler.registerEscHandler(e,i)}registerDcsHandler(e,i){return this._inputHandler.registerDcsHandler(e,i)}registerCsiHandler(e,i){return this._inputHandler.registerCsiHandler(e,i)}registerOscHandler(e,i){return this._inputHandler.registerOscHandler(e,i)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,i=this.optionsService.rawOptions.windowsPty;i&&i.buildNumber!==void 0&&i.buildNumber!==void 0?e=i.backend==="conpty"&&i.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(Bs.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(Bs(this._bufferService),!1))),this._windowsWrappingHeuristics.value=C(()=>{for(let i of e)i.dispose()})}}};var gc={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:["'",'"']};function Il(s,t,e,i){let r={type:0,cancel:!1,key:void 0},n=(s.shiftKey?1:0)|(s.altKey?2:0)|(s.ctrlKey?4:0)|(s.metaKey?8:0);switch(s.keyCode){case 0:s.key==="UIKeyInputUpArrow"?t?r.key=b.ESC+"OA":r.key=b.ESC+"[A":s.key==="UIKeyInputLeftArrow"?t?r.key=b.ESC+"OD":r.key=b.ESC+"[D":s.key==="UIKeyInputRightArrow"?t?r.key=b.ESC+"OC":r.key=b.ESC+"[C":s.key==="UIKeyInputDownArrow"&&(t?r.key=b.ESC+"OB":r.key=b.ESC+"[B");break;case 8:r.key=s.ctrlKey?"\b":b.DEL,s.altKey&&(r.key=b.ESC+r.key);break;case 9:if(s.shiftKey){r.key=b.ESC+"[Z";break}r.key=b.HT,r.cancel=!0;break;case 13:r.key=s.altKey?b.ESC+b.CR:b.CR,r.cancel=!0;break;case 27:r.key=b.ESC,s.altKey&&(r.key=b.ESC+b.ESC),r.cancel=!0;break;case 37:if(s.metaKey)break;n?r.key=b.ESC+"[1;"+(n+1)+"D":t?r.key=b.ESC+"OD":r.key=b.ESC+"[D";break;case 39:if(s.metaKey)break;n?r.key=b.ESC+"[1;"+(n+1)+"C":t?r.key=b.ESC+"OC":r.key=b.ESC+"[C";break;case 38:if(s.metaKey)break;n?r.key=b.ESC+"[1;"+(n+1)+"A":t?r.key=b.ESC+"OA":r.key=b.ESC+"[A";break;case 40:if(s.metaKey)break;n?r.key=b.ESC+"[1;"+(n+1)+"B":t?r.key=b.ESC+"OB":r.key=b.ESC+"[B";break;case 45:!s.shiftKey&&!s.ctrlKey&&(r.key=b.ESC+"[2~");break;case 46:n?r.key=b.ESC+"[3;"+(n+1)+"~":r.key=b.ESC+"[3~";break;case 36:n?r.key=b.ESC+"[1;"+(n+1)+"H":t?r.key=b.ESC+"OH":r.key=b.ESC+"[H";break;case 35:n?r.key=b.ESC+"[1;"+(n+1)+"F":t?r.key=b.ESC+"OF":r.key=b.ESC+"[F";break;case 33:s.shiftKey?r.type=2:s.ctrlKey?r.key=b.ESC+"[5;"+(n+1)+"~":r.key=b.ESC+"[5~";break;case 34:s.shiftKey?r.type=3:s.ctrlKey?r.key=b.ESC+"[6;"+(n+1)+"~":r.key=b.ESC+"[6~";break;case 112:n?r.key=b.ESC+"[1;"+(n+1)+"P":r.key=b.ESC+"OP";break;case 113:n?r.key=b.ESC+"[1;"+(n+1)+"Q":r.key=b.ESC+"OQ";break;case 114:n?r.key=b.ESC+"[1;"+(n+1)+"R":r.key=b.ESC+"OR";break;case 115:n?r.key=b.ESC+"[1;"+(n+1)+"S":r.key=b.ESC+"OS";break;case 116:n?r.key=b.ESC+"[15;"+(n+1)+"~":r.key=b.ESC+"[15~";break;case 117:n?r.key=b.ESC+"[17;"+(n+1)+"~":r.key=b.ESC+"[17~";break;case 118:n?r.key=b.ESC+"[18;"+(n+1)+"~":r.key=b.ESC+"[18~";break;case 119:n?r.key=b.ESC+"[19;"+(n+1)+"~":r.key=b.ESC+"[19~";break;case 120:n?r.key=b.ESC+"[20;"+(n+1)+"~":r.key=b.ESC+"[20~";break;case 121:n?r.key=b.ESC+"[21;"+(n+1)+"~":r.key=b.ESC+"[21~";break;case 122:n?r.key=b.ESC+"[23;"+(n+1)+"~":r.key=b.ESC+"[23~";break;case 123:n?r.key=b.ESC+"[24;"+(n+1)+"~":r.key=b.ESC+"[24~";break;default:if(s.ctrlKey&&!s.shiftKey&&!s.altKey&&!s.metaKey)s.keyCode>=65&&s.keyCode<=90?r.key=String.fromCharCode(s.keyCode-64):s.keyCode===32?r.key=b.NUL:s.keyCode>=51&&s.keyCode<=55?r.key=String.fromCharCode(s.keyCode-51+27):s.keyCode===56?r.key=b.DEL:s.keyCode===219?r.key=b.ESC:s.keyCode===220?r.key=b.FS:s.keyCode===221&&(r.key=b.GS);else if((!e||i)&&s.altKey&&!s.metaKey){let l=gc[s.keyCode]?.[s.shiftKey?1:0];if(l)r.key=b.ESC+l;else if(s.keyCode>=65&&s.keyCode<=90){let a=s.ctrlKey?s.keyCode-64:s.keyCode+32,u=String.fromCharCode(a);s.shiftKey&&(u=u.toUpperCase()),r.key=b.ESC+u}else if(s.keyCode===32)r.key=b.ESC+(s.ctrlKey?b.NUL:" ");else if(s.key==="Dead"&&s.code.startsWith("Key")){let a=s.code.slice(3,4);s.shiftKey||(a=a.toLowerCase()),r.key=b.ESC+a,r.cancel=!0}}else e&&!s.altKey&&!s.ctrlKey&&!s.shiftKey&&s.metaKey?s.keyCode===65&&(r.type=1):s.key&&!s.ctrlKey&&!s.altKey&&!s.metaKey&&s.keyCode>=48&&s.key.length===1?r.key=s.key:s.key&&s.ctrlKey&&(s.key==="_"&&(r.key=b.US),s.key==="@"&&(r.key=b.NUL));break}return r}var ee=0,En=class{constructor(t){this._getKey=t;this._array=[];this._insertedValues=[];this._flushInsertedTask=new Jt;this._isFlushingInserted=!1;this._deletedIndices=[];this._flushDeletedTask=new Jt;this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(t){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(t)}_flushInserted(){let t=this._insertedValues.sort((n,o)=>this._getKey(n)-this._getKey(o)),e=0,i=0,r=new Array(this._array.length+this._insertedValues.length);for(let n=0;n=this._array.length||this._getKey(t[e])<=this._getKey(this._array[i])?(r[n]=t[e],e++):r[n]=this._array[i++];this._array=r,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(t){if(this._flushCleanupInserted(),this._array.length===0)return!1;let e=this._getKey(t);if(e===void 0||(ee=this._search(e),ee===-1)||this._getKey(this._array[ee])!==e)return!1;do if(this._array[ee]===t)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(ee),!0;while(++een-o),e=0,i=new Array(this._array.length-t.length),r=0;for(let n=0;n0&&this._flushDeletedTask.flush()}*getKeyIterator(t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(ee=this._search(t),!(ee<0||ee>=this._array.length)&&this._getKey(this._array[ee])===t))do yield this._array[ee];while(++ee=this._array.length)&&this._getKey(this._array[ee])===t))do e(this._array[ee]);while(++ee=e;){let r=e+i>>1,n=this._getKey(this._array[r]);if(n>t)i=r-1;else if(n0&&this._getKey(this._array[r-1])===t;)r--;return r}}return e}};var Us=0,yl=0,Tn=class extends D{constructor(){super();this._decorations=new En(e=>e?.marker.line);this._onDecorationRegistered=this._register(new v);this.onDecorationRegistered=this._onDecorationRegistered.event;this._onDecorationRemoved=this._register(new v);this.onDecorationRemoved=this._onDecorationRemoved.event;this._register(C(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let i=new Ks(e);if(i){let r=i.marker.onDispose(()=>i.dispose()),n=i.onDispose(()=>{n.dispose(),i&&(this._decorations.delete(i)&&this._onDecorationRemoved.fire(i),r.dispose())});this._decorations.insert(i),this._onDecorationRegistered.fire(i)}return i}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,i,r){let n=0,o=0;for(let l of this._decorations.getKeyIterator(i))n=l.options.x??0,o=n+(l.options.width??1),e>=n&&e{Us=o.options.x??0,yl=Us+(o.options.width??1),e>=Us&&e=this._debounceThresholdMS)this._lastRefreshMs=r,this._innerRefresh();else if(!this._additionalRefreshRequested){let n=r-this._lastRefreshMs,o=this._debounceThresholdMS-n;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},o)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let t=Math.max(this._rowStart,0),e=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(t,e)}};var xl=20;var wl=!1,Tt=class extends D{constructor(e,i,r,n){super();this._terminal=e;this._coreBrowserService=r;this._renderService=n;this._rowColumns=new WeakMap;this._liveRegionLineCount=0;this._charsToConsume=[];this._charsToAnnounce="";let o=this._coreBrowserService.mainDocument;this._accessibilityContainer=o.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=o.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let l=0;lthis._handleBoundaryFocus(l,0),this._bottomBoundaryFocusListener=l=>this._handleBoundaryFocus(l,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=o.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new In(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");wl?(this._accessibilityContainer.classList.add("debug"),this._rowContainer.classList.add("debug"),this._debugRootContainer=o.createElement("div"),this._debugRootContainer.classList.add("xterm"),this._debugRootContainer.appendChild(o.createTextNode("------start a11y------")),this._debugRootContainer.appendChild(this._accessibilityContainer),this._debugRootContainer.appendChild(o.createTextNode("------end a11y------")),this._terminal.element.insertAdjacentElement("afterend",this._debugRootContainer)):this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this._register(this._terminal.onResize(l=>this._handleResize(l.rows))),this._register(this._terminal.onRender(l=>this._refreshRows(l.start,l.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(l=>this._handleChar(l))),this._register(this._terminal.onLineFeed(()=>this._handleChar(` -`))),this._register(this._terminal.onA11yTab(l=>this._handleTab(l))),this._register(this._terminal.onKey(l=>this._handleKey(l.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(L(o,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(C(()=>{wl?this._debugRootContainer.remove():this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let i=0;i0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===` -`&&(this._liveRegionLineCount++,this._liveRegionLineCount===xl+1&&(this._liveRegion.textContent+=_i.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),/\p{Control}/u.test(e)||this._charsToConsume.push(e)}_refreshRows(e,i){this._liveRegionDebouncer.refresh(e,i,this._terminal.rows)}_renderRows(e,i){let r=this._terminal.buffer,n=r.lines.length.toString();for(let o=e;o<=i;o++){let l=r.lines.get(r.ydisp+o),a=[],u=l?.translateToString(!0,void 0,void 0,a)||"",h=(r.ydisp+o+1).toString(),c=this._rowElements[o];c&&(u.length===0?(c.textContent="\xA0",this._rowColumns.set(c,[0,1])):(c.textContent=u,this._rowColumns.set(c,a)),c.setAttribute("aria-posinset",h),c.setAttribute("aria-setsize",n),this._alignRowWidth(c))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,i){let r=e.target,n=this._rowElements[i===0?1:this._rowElements.length-2],o=r.getAttribute("aria-posinset"),l=i===0?"1":`${this._terminal.buffer.lines.length}`;if(o===l||e.relatedTarget!==n)return;let a,u;if(i===0?(a=r,u=this._rowElements.pop(),this._rowContainer.removeChild(u)):(a=this._rowElements.shift(),u=r,this._rowContainer.removeChild(a)),a.removeEventListener("focus",this._topBoundaryFocusListener),u.removeEventListener("focus",this._bottomBoundaryFocusListener),i===0){let h=this._createAccessibilityTreeNode();this._rowElements.unshift(h),this._rowContainer.insertAdjacentElement("afterbegin",h)}else{let h=this._createAccessibilityTreeNode();this._rowElements.push(h),this._rowContainer.appendChild(h)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(i===0?-1:1),this._rowElements[i===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error("anchorNode and/or focusNode are null");return}let i={node:e.anchorNode,offset:e.anchorOffset},r={node:e.focusNode,offset:e.focusOffset};if((i.node.compareDocumentPosition(r.node)&Node.DOCUMENT_POSITION_PRECEDING||i.node===r.node&&i.offset>r.offset)&&([i,r]=[r,i]),i.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(i={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(i.node))return;let n=this._rowElements.slice(-1)[0];if(r.node.compareDocumentPosition(n)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(r={node:n,offset:n.textContent?.length??0}),!this._rowContainer.contains(r.node))return;let o=({node:u,offset:h})=>{let c=u instanceof Text?u.parentNode:u,d=parseInt(c?.getAttribute("aria-posinset"),10)-1;if(isNaN(d))return console.warn("row is invalid. Race condition?"),null;let _=this._rowColumns.get(c);if(!_)return console.warn("columns is null. Race condition?"),null;let p=h<_.length?_[h]:_.slice(-1)[0]+1;return p>=this._terminal.cols&&(++d,p=0),{row:d,column:p}},l=o(i),a=o(r);if(!(!l||!a)){if(l.row>a.row||l.row===a.row&&l.column>=a.column)throw new Error("invalid range");this._terminal.select(l.column,l.row,(a.row-l.row)*this._terminal.cols-l.column+a.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let i=this._rowContainer.children.length;ie;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e{Ne(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(L(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(L(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(L(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(L(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let i=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!i)return;this._isMouseOut=!1;let r=e.composedPath();for(let n=0;n{n?.forEach(o=>{o.link.dispose&&o.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let r=!1;for(let[n,o]of this._linkProviderService.linkProviders.entries())i?this._activeProviderReplies?.get(n)&&(r=this._checkLinkProviderResult(n,e,r)):o.provideLinks(e.y,l=>{if(this._isMouseOut)return;let a=l?.map(u=>({link:u}));this._activeProviderReplies?.set(n,a),r=this._checkLinkProviderResult(n,e,r),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,i){let r=new Set;for(let n=0;ne?this._bufferService.cols:a.link.range.end.x;for(let c=u;c<=h;c++){if(r.has(c)){o.splice(l--,1);break}r.add(c)}}}}_checkLinkProviderResult(e,i,r){if(!this._activeProviderReplies)return r;let n=this._activeProviderReplies.get(e),o=!1;for(let l=0;lthis._linkAtPosition(a.link,i));l&&(r=!0,this._handleNewLink(l))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!r)for(let l=0;lthis._linkAtPosition(u.link,i));if(a){r=!0,this._handleNewLink(a);break}}return r}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let i=this._positionFromMouseEvent(e,this._element,this._mouseService);i&&this._mouseDownLink&&Ec(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,i)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,i){!this._currentLink||!this._lastMouseEvent||(!e||!i||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=i)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,Ne(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let i=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);i&&this._linkAtPosition(e.link,i)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0?!0:e.link.decorations.underline,pointerCursor:e.link.decorations===void 0?!0:e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:r=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==r&&(this._currentLink.state.decorations.pointerCursor=r,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",r))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:r=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==r&&(this._currentLink.state.decorations.underline=r,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,r))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(r=>{if(!this._currentLink)return;let n=r.start===0?0:r.start+1+this._bufferService.buffer.ydisp,o=this._bufferService.buffer.ydisp+1+r.end;if(this._currentLink.link.range.start.y>=n&&this._currentLink.link.range.end.y<=o&&(this._clearCurrentLink(n,o),this._lastMouseEvent)){let l=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);l&&this._askForLink(l,!1)}})))}_linkHover(e,i,r){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(i,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),i.hover&&i.hover(r,i.text)}_fireUnderlineEvent(e,i){let r=e.range,n=this._bufferService.buffer.ydisp,o=this._createLinkUnderlineEvent(r.start.x-1,r.start.y-n-1,r.end.x,r.end.y-n-1,void 0);(i?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(o)}_linkLeave(e,i,r){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(i,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),i.leave&&i.leave(r,i.text)}_linkAtPosition(e,i){let r=e.range.start.y*this._bufferService.cols+e.range.start.x,n=e.range.end.y*this._bufferService.cols+e.range.end.x,o=i.y*this._bufferService.cols+i.x;return r<=o&&o<=n}_positionFromMouseEvent(e,i,r){let n=r.getCoords(e,i,this._bufferService.cols,this._bufferService.rows);if(n)return{x:n[0],y:n[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,i,r,n,o){return{x1:e,y1:i,x2:r,y2:n,cols:this._bufferService.cols,fg:o}}};hi=M([S(1,Dt),S(2,ce),S(3,F),S(4,lr)],hi);function Ec(s,t){return s.text===t.text&&s.range.start.x===t.range.start.x&&s.range.start.y===t.range.start.y&&s.range.end.x===t.range.end.x&&s.range.end.y===t.range.end.y}var yn=class extends Sn{constructor(e={}){super(e);this._linkifier=this._register(new ye);this.browser=tn;this._keyDownHandled=!1;this._keyDownSeen=!1;this._keyPressHandled=!1;this._unprocessedDeadKey=!1;this._accessibilityManager=this._register(new ye);this._onCursorMove=this._register(new v);this.onCursorMove=this._onCursorMove.event;this._onKey=this._register(new v);this.onKey=this._onKey.event;this._onRender=this._register(new v);this.onRender=this._onRender.event;this._onSelectionChange=this._register(new v);this.onSelectionChange=this._onSelectionChange.event;this._onTitleChange=this._register(new v);this.onTitleChange=this._onTitleChange.event;this._onBell=this._register(new v);this.onBell=this._onBell.event;this._onFocus=this._register(new v);this._onBlur=this._register(new v);this._onA11yCharEmitter=this._register(new v);this._onA11yTabEmitter=this._register(new v);this._onWillOpen=this._register(new v);this._setup(),this._decorationService=this._instantiationService.createInstance(Tn),this._instantiationService.setService(Be,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(Qr),this._instantiationService.setService(lr,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(wt)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(i=>this.refresh(i?.start??0,i?.end??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(i=>this._reportWindowsOptions(i))),this._register(this._inputHandler.onColor(i=>this._handleColorEvent(i))),this._register($.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register($.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register($.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register($.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(i=>this._afterResize(i.cols,i.rows))),this._register(C(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}_handleColorEvent(e){if(this._themeService)for(let i of e){let r,n="";switch(i.index){case 256:r="foreground",n="10";break;case 257:r="background",n="11";break;case 258:r="cursor",n="12";break;default:r="ansi",n="4;"+i.index}switch(i.type){case 0:let o=U.toColorRGB(r==="ansi"?this._themeService.colors.ansi[i.index]:this._themeService.colors[r]);this.coreService.triggerDataEvent(`${b.ESC}]${n};${ml(o)}${fs.ST}`);break;case 1:if(r==="ansi")this._themeService.modifyColors(l=>l.ansi[i.index]=j.toColor(...i.color));else{let l=r;this._themeService.modifyColors(a=>a[l]=j.toColor(...i.color))}break;case 2:this._themeService.restoreColor(i.index);break}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Tt,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(b.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(b.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,i=this.buffer.lines.get(e);if(!i)return;let r=Math.min(this.buffer.x,this.cols-1),n=this._renderService.dimensions.css.cell.height,o=i.getWidth(r),l=this._renderService.dimensions.css.cell.width*o,a=this.buffer.y*this._renderService.dimensions.css.cell.height,u=r*this._renderService.dimensions.css.cell.width;this.textarea.style.left=u+"px",this.textarea.style.top=a+"px",this.textarea.style.width=l+"px",this.textarea.style.height=n+"px",this.textarea.style.lineHeight=n+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(L(this.element,"copy",i=>{this.hasSelection()&&Vs(i,this._selectionService)}));let e=i=>qs(i,this.textarea,this.coreService,this.optionsService);this._register(L(this.textarea,"paste",e)),this._register(L(this.element,"paste",e)),Ss?this._register(L(this.element,"mousedown",i=>{i.button===2&&Pn(i,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(L(this.element,"contextmenu",i=>{Pn(i,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),Bi&&this._register(L(this.element,"auxclick",i=>{i.button===1&&Mn(i,this.textarea,this.screenElement)}))}_bindKeys(){this._register(L(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(L(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(L(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(L(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(L(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(L(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(L(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){if(!e)throw new Error("Terminal requires a parent element.");if(e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),e.appendChild(this.element);let i=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),i.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(L(this.screenElement,"mousemove",o=>this.updateCursorStyle(o))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),i.appendChild(this.screenElement);let r=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",mi.get()),Ts||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._register(this.optionsService.onSpecificOptionChange("disableStdin",()=>r.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(Jr,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(ae,this._coreBrowserService),this._register(L(this.textarea,"focus",o=>this._handleTextAreaFocus(o))),this._register(L(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(jt,this._document,this._helperContainer),this._instantiationService.setService(nt,this._charSizeService),this._themeService=this._instantiationService.createInstance(ti),this._instantiationService.setService(Re,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(ct),this._instantiationService.setService(or,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(Qt,this.rows,this.screenElement)),this._instantiationService.setService(ce,this._renderService),this._register(this._renderService.onRenderedViewportChange(o=>this._onRender.fire(o))),this.onResize(o=>this._renderService.resize(o.cols,o.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance($t,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(Xt),this._instantiationService.setService(Dt,this._mouseService);let n=this._linkifier.value=this._register(this._instantiationService.createInstance(hi,this.screenElement));this.element.appendChild(i);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this._register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this._register(this.onBlur(()=>this._renderService.handleBlur())),this._register(this.onFocus(()=>this._renderService.handleFocus())),this._viewport=this._register(this._instantiationService.createInstance(zt,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(o=>{super.scrollLines(o,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(ei,this.element,this.screenElement,n)),this._instantiationService.setService(Qs,this._selectionService),this._register(this._selectionService.onRequestScrollLines(o=>this.scrollLines(o.amount,o.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(o=>this._renderService.handleSelectionChanged(o.start,o.end,o.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(o=>{this.textarea.value=o,this.textarea.focus(),this.textarea.select()})),this._register($.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{this._selectionService.refresh(),this._viewport?.queueSync()})),this._register(this._instantiationService.createInstance(Gt,this.screenElement)),this._register(L(this.element,"mousedown",o=>this._selectionService.handleMouseDown(o))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(Tt,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",o=>this._handleScreenReaderModeOptionChange(o))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(bt,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",o=>{!this._overviewRulerRenderer&&o&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(bt,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(Yt,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,i=this.element;function r(l){let a=e._mouseService.getMouseReportCoords(l,e.screenElement);if(!a)return!1;let u,h;switch(l.overrideType||l.type){case"mousemove":h=32,l.buttons===void 0?(u=3,l.button!==void 0&&(u=l.button<3?l.button:3)):u=l.buttons&1?0:l.buttons&4?1:l.buttons&2?2:3;break;case"mouseup":h=0,u=l.button<3?l.button:3;break;case"mousedown":h=1,u=l.button<3?l.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(l)===!1)return!1;let c=l.deltaY;if(c===0||e.coreMouseService.consumeWheelEvent(l,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return!1;h=c<0?0:1,u=4;break;default:return!1}return h===void 0||u===void 0||u>4?!1:e.coreMouseService.triggerMouseEvent({col:a.col,row:a.row,x:a.x,y:a.y,button:u,action:h,ctrl:l.ctrlKey,alt:l.altKey,shift:l.shiftKey})}let n={mouseup:null,wheel:null,mousedrag:null,mousemove:null},o={mouseup:l=>(r(l),l.buttons||(this._document.removeEventListener("mouseup",n.mouseup),n.mousedrag&&this._document.removeEventListener("mousemove",n.mousedrag)),this.cancel(l)),wheel:l=>(r(l),this.cancel(l,!0)),mousedrag:l=>{l.buttons&&r(l)},mousemove:l=>{l.buttons||r(l)}};this._register(this.coreMouseService.onProtocolChange(l=>{l?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(l)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),l&8?n.mousemove||(i.addEventListener("mousemove",o.mousemove),n.mousemove=o.mousemove):(i.removeEventListener("mousemove",n.mousemove),n.mousemove=null),l&16?n.wheel||(i.addEventListener("wheel",o.wheel,{passive:!1}),n.wheel=o.wheel):(i.removeEventListener("wheel",n.wheel),n.wheel=null),l&2?n.mouseup||(n.mouseup=o.mouseup):(this._document.removeEventListener("mouseup",n.mouseup),n.mouseup=null),l&4?n.mousedrag||(n.mousedrag=o.mousedrag):(this._document.removeEventListener("mousemove",n.mousedrag),n.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(L(i,"mousedown",l=>{if(l.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(l)))return r(l),n.mouseup&&this._document.addEventListener("mouseup",n.mouseup),n.mousedrag&&this._document.addEventListener("mousemove",n.mousedrag),this.cancel(l)})),this._register(L(i,"wheel",l=>{if(!n.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(l)===!1)return!1;if(!this.buffer.hasScrollback){if(l.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(l,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return this.cancel(l,!0);let h=b.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(l.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(h,!0),this.cancel(l,!0)}}},{passive:!1}))}refresh(e,i){this._renderService?.refreshRows(e,i)}updateCursorStyle(e){this._selectionService?.shouldColumnSelect(e)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,i){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,i),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let i=e-this._bufferService.buffer.ydisp;i!==0&&this.scrollLines(i)}paste(e){Cn(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let i=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),i}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,i,r){this._selectionService.setSelection(e,i,r)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(!(!this._selectionService||!this._selectionService.hasSelection))return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(e,i){this._selectionService?.selectLines(e,i)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let i=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!i&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!i&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let r=Il(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),r.type===3||r.type===2){let n=this.rows-1;return this.scrollLines(r.type===2?-n:n),this.cancel(e,!0)}if(r.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(r.cancel&&this.cancel(e,!0),!r.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((r.key===b.ETX||r.key===b.CR)&&(this.textarea.value=""),this._onKey.fire({key:r.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(r.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,i){let r=e.isMac&&!this.options.macOptionIsMeta&&i.altKey&&!i.ctrlKey&&!i.metaKey||e.isWindows&&i.altKey&&i.ctrlKey&&!i.metaKey||e.isWindows&&i.getModifierState("AltGraph");return i.type==="keypress"?r:r&&(!i.keyCode||i.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(Tc(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let i;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)i=e.charCode;else if(e.which===null||e.which===void 0)i=e.keyCode;else if(e.which!==0&&e.charCode!==0)i=e.which;else return!1;return!i||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(i=String.fromCharCode(i),this._onKey.fire({key:i,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(i,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType==="insertText"&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let i=e.data;return this.coreService.triggerDataEvent(i,!0),this.cancel(e),!0}return!1}resize(e,i){if(e===this.cols&&i===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,i)}_afterResize(e,i){this._charSizeService?.measure()}clear(){if(!(this.buffer.ybase===0&&this.buffer.y===0)){this.buffer.clearAllMarkers(),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(let e=1;e=0;t--)this._addons[t].instance.dispose()}loadAddon(t,e){let i={instance:e,dispose:e.dispose,isDisposed:!1};this._addons.push(i),e.dispose=()=>this._wrappedAddonDispose(i),e.activate(t)}_wrappedAddonDispose(t){if(t.isDisposed)return;let e=-1;for(let i=0;i=this._line.length))return e?(this._line.loadCell(t,e),e):this._line.loadCell(t,new q)}translateToString(t,e,i){return this._line.translateToString(t,e,i)}};var Ji=class{constructor(t,e){this._buffer=t;this.type=e}init(t){return this._buffer=t,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(t){let e=this._buffer.lines.get(t);if(e)return new wn(e)}getNullCell(){return new q}};var Dn=class extends D{constructor(e){super();this._core=e;this._onBufferChange=this._register(new v);this.onBufferChange=this._onBufferChange.event;this._normal=new Ji(this._core.buffers.normal,"normal"),this._alternate=new Ji(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}};var Rn=class{constructor(t){this._core=t}registerCsiHandler(t,e){return this._core.registerCsiHandler(t,i=>e(i.toArray()))}addCsiHandler(t,e){return this.registerCsiHandler(t,e)}registerDcsHandler(t,e){return this._core.registerDcsHandler(t,(i,r)=>e(i,r.toArray()))}addDcsHandler(t,e){return this.registerDcsHandler(t,e)}registerEscHandler(t,e){return this._core.registerEscHandler(t,e)}addEscHandler(t,e){return this.registerEscHandler(t,e)}registerOscHandler(t,e){return this._core.registerOscHandler(t,e)}addOscHandler(t,e){return this.registerOscHandler(t,e)}};var Ln=class{constructor(t){this._core=t}register(t){this._core.unicodeService.register(t)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(t){this._core.unicodeService.activeVersion=t}};var Ic=["cols","rows"],Ue=0,Dl=class extends D{constructor(t){super(),this._core=this._register(new yn(t)),this._addonManager=this._register(new xn),this._publicOptions={...this._core.options};let e=r=>this._core.options[r],i=(r,n)=>{this._checkReadonlyOptions(r),this._core.options[r]=n};for(let r in this._core.options){let n={get:e.bind(this,r),set:i.bind(this,r)};Object.defineProperty(this._publicOptions,r,n)}}_checkReadonlyOptions(t){if(Ic.includes(t))throw new Error(`Option "${t}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new Rn(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new Ln(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this._register(new Dn(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let t=this._core.coreService.decPrivateModes,e="none";switch(this._core.coreMouseService.activeProtocol){case"X10":e="x10";break;case"VT200":e="vt200";break;case"DRAG":e="drag";break;case"ANY":e="any";break}return{applicationCursorKeysMode:t.applicationCursorKeys,applicationKeypadMode:t.applicationKeypad,bracketedPasteMode:t.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:e,originMode:t.origin,reverseWraparoundMode:t.reverseWraparound,sendFocusMode:t.sendFocus,synchronizedOutputMode:t.synchronizedOutput,wraparoundMode:t.wraparound}}get options(){return this._publicOptions}set options(t){for(let e in t)this._publicOptions[e]=t[e]}blur(){this._core.blur()}focus(){this._core.focus()}input(t,e=!0){this._core.input(t,e)}resize(t,e){this._verifyIntegers(t,e),this._core.resize(t,e)}open(t){this._core.open(t)}attachCustomKeyEventHandler(t){this._core.attachCustomKeyEventHandler(t)}attachCustomWheelEventHandler(t){this._core.attachCustomWheelEventHandler(t)}registerLinkProvider(t){return this._core.registerLinkProvider(t)}registerCharacterJoiner(t){return this._checkProposedApi(),this._core.registerCharacterJoiner(t)}deregisterCharacterJoiner(t){this._checkProposedApi(),this._core.deregisterCharacterJoiner(t)}registerMarker(t=0){return this._verifyIntegers(t),this._core.registerMarker(t)}registerDecoration(t){return this._checkProposedApi(),this._verifyPositiveIntegers(t.x??0,t.width??0,t.height??0),this._core.registerDecoration(t)}hasSelection(){return this._core.hasSelection()}select(t,e,i){this._verifyIntegers(t,e,i),this._core.select(t,e,i)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(t,e){this._verifyIntegers(t,e),this._core.selectLines(t,e)}dispose(){super.dispose()}scrollLines(t){this._verifyIntegers(t),this._core.scrollLines(t)}scrollPages(t){this._verifyIntegers(t),this._core.scrollPages(t)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(t){this._verifyIntegers(t),this._core.scrollToLine(t)}clear(){this._core.clear()}write(t,e){this._core.write(t,e)}writeln(t,e){this._core.write(t),this._core.write(`\r -`,e)}paste(t){this._core.paste(t)}refresh(t,e){this._verifyIntegers(t,e),this._core.refresh(t,e)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(t){this._addonManager.loadAddon(this,t)}static get strings(){return{get promptLabel(){return mi.get()},set promptLabel(t){mi.set(t)},get tooMuchOutput(){return _i.get()},set tooMuchOutput(t){_i.set(t)}}}_verifyIntegers(...t){for(Ue of t)if(Ue===1/0||isNaN(Ue)||Ue%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...t){for(Ue of t)if(Ue&&(Ue===1/0||isNaN(Ue)||Ue%1!==0||Ue<0))throw new Error("This API only accepts positive integers")}};export{Dl as Terminal}; -//# sourceMappingURL=xterm.mjs.map