Skip to content

armgit / WSM

Public Imported from GitHub
0

Run macOS applications on your Windows desktop, with a background runtime and integrated app windows.

C++

Release WSM 0.2.4 reliability, input and System Apps improvements

mxhm11crcf6776aa72c6
diff --git a/README.md b/README.md
index 241043d..04a1666 100644
--- a/README.md
+++ b/README.md
@@ -1,15 +1,17 @@
<p align="center"><img src="assets/branding/wsm-icon.png" width="128" alt="WSM icon"></p>
<h1 align="center">WSM</h1>
<p align="center"><strong>Windows Subsystem for macOS</strong><br>Like WSL — but for macOS apps.</p>
-<p align="center"><img src="assets/branding/release-badge.svg" alt="Release 0.2.3"> <img src="assets/branding/platform-badge.svg" alt="Windows x64"> <img src="assets/branding/runtime-badge.svg" alt="macOS Tahoe"></p>
+<p align="center"><img src="assets/branding/release-badge.svg" alt="Release 0.2.4"> <img src="assets/branding/platform-badge.svg" alt="Windows x64"> <img src="assets/branding/runtime-badge.svg" alt="macOS Tahoe"></p>
WSM brings macOS applications to your Windows desktop. Inspired by the convenience of WSL, it manages a virtualized macOS runtime in the background and presents supported apps in their own windows alongside your Windows applications.
After setup, add an app through the WSM library or open a supported Mac installer from File Explorer. WSM integrates app windows with the Windows taskbar, offers Start menu and desktop shortcuts, and provides shared clipboard and Windows drive access. The runtime can pause when idle and resume when needed.
-> **Compatibility:** Application support and functionality vary; some integrations are still being improved.
+> **Still in development — for users and media:** WSM is not yet fully stable or a finished product. Version 0.2.4 improves setup, app launching and everyday use, but bugs and compatibility limitations remain. Dropdown menus, scrolling and keyboard or mouse input can still occasionally feel delayed. An SSD makes a substantial difference to startup and app loading. Please keep these limitations in mind when trying or covering the project.
-[Download](https://github.com/mxhm11cr/WSM/releases/latest) · [Getting started](#getting-started) · [Features](#features) · [Screenshots](#screenshots) · [Performance](#performance) · [How it works](#how-it-works) · [FAQ](#faq)
+Please search existing [issues](https://github.com/mxhm11cr/WSM/issues) before opening a new one. Add useful details and diagnostics to an existing report when it matches your problem, rather than posting duplicates or repeated requests for updates. This project is still at the beginning: we need time to investigate, test and improve it. Thank you for giving us room to work and helping with clear, respectful reports.
+
+[Download 0.2.4](https://github.com/mxhm11cr/WSM/releases/download/v0.2.4/WSM-Setup-0.2.4.exe) · [Getting started](#getting-started) · [Features](#features) · [Screenshots](#screenshots) · [Performance](#performance) · [How it works](#how-it-works) · [FAQ](#faq)
## See it running
@@ -32,6 +34,7 @@ https://github.com/user-attachments/assets/dc418428-faef-4d71-acfd-998a7267f0c0
- **Individual app windows** — macOS applications appear alongside Windows applications, with their own taskbar icons.
- **Fullscreen apps** — use the green window button, F11 or Alt+Enter; press Esc to return to the previous window size.
- **App library and installation** — manage apps from WSM or open supported `.dmg`, `.pkg`, and `.app` files.
+- **System Apps folder** — find Finder, System Settings, Console and Disk Utility together in the library.
- **GPU acceleration** — a virtual GPU exposes Metal support to the macOS runtime.
- **Desktop integration** — shortcuts, keyboard mapping, clipboard sharing, and access to Windows drives.
- **Background runtime** — WSM manages the runtime and can pause it when inactive.
@@ -48,7 +51,7 @@ https://github.com/user-attachments/assets/dc418428-faef-4d71-acfd-998a7267f0c0
### Installation
-1. Download [WSM-Setup-0.2.3.exe](https://github.com/mxhm11cr/WSM/releases/latest).
+1. Download [WSM-Setup-0.2.4.exe](https://github.com/mxhm11cr/WSM/releases/download/v0.2.4/WSM-Setup-0.2.4.exe).
2. Run the installer and choose where to install WSM.
3. Open WSM and follow the setup wizard to prepare the macOS runtime.
4. Add a supported app or choose a built-in app from the library, then launch it from WSM or its shortcut.
@@ -78,6 +81,8 @@ Example measurements from a Windows 11 system with the WSM runtime on an SSD:
Results depend on hardware, storage, app, and configuration. See [performance notes](docs/PERFORMANCE.md) for more context.
+These are example measurements, not guaranteed timings. Cold starts and first app launches can be much slower on a hard disk, and occasional input or display delays remain under investigation.
+
## How it works
WSM uses a virtualized macOS environment with hardware acceleration. Its host service manages the runtime, tracks macOS windows and forwards their contents and input to individual Windows windows. The manager provides setup and the app library; guest-side services handle application integration and shared resources.
@@ -122,6 +127,8 @@ The macOS runtime needs to start after a full shutdown. Opening an app while it
## Roadmap
+- Continue improving input latency, scrolling, app loading and setup reliability. We are aiming for a noticeably better experience after the December 5–6 weekend.
+- Work toward Xcode support and investigate additional macOS integrations such as iMessage and AirDrop. Our next update target is as early as December 5; this is a development goal, not a guarantee that these features will be available then.
- Mirror the macOS menu bar into app windows.
- Improve application compatibility and desktop integration.
- Explore a lighter runtime mode.
diff --git a/assets/branding/release-badge.svg b/assets/branding/release-badge.svg
index b01ac8f..5e85f4b 100644
--- a/assets/branding/release-badge.svg
+++ b/assets/branding/release-badge.svg
@@ -1 +1 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="132" height="24" role="img" aria-label="Release 0.2.3"><rect width="132" height="24" rx="5" fill="#1e293b"/><path d="M64 0h63a5 5 0 0 1 5 5v14a5 5 0 0 1-5 5H64z" fill="#2563eb"/><g fill="#fff" font-family="Verdana,Arial,sans-serif" font-size="11" text-anchor="middle"><text x="32" y="16">Release</text><text x="98" y="16">0.2.3</text></g></svg>
+<svg xmlns="http://www.w3.org/2000/svg" width="132" height="24" role="img" aria-label="Release 0.2.4"><rect width="132" height="24" rx="5" fill="#1e293b"/><path d="M64 0h63a5 5 0 0 1 5 5v14a5 5 0 0 1-5 5H64z" fill="#2563eb"/><g fill="#fff" font-family="Verdana,Arial,sans-serif" font-size="11" text-anchor="middle"><text x="32" y="16">Release</text><text x="98" y="16">0.2.4</text></g></svg>
diff --git a/packaging/build-release.ps1 b/packaging/build-release.ps1
index 8f35a8c..574c1f8 100644
--- a/packaging/build-release.ps1
+++ b/packaging/build-release.ps1
@@ -64,7 +64,7 @@ $otherCpus = @('edk2-aarch64-*', 'edk2-riscv64-*', 'edk2-loongarch64-*', 'hexago
's390-ccw.img', 'slof.bin', 'skiboot.lid', 'u-boot*', 'palcode-clipper', 'opensbi-*', 'npcm*',
'ast27x0_bootrom.bin', 'QEMU,*.bin', 'vof*.bin', 'pnv-pnor.bin', 'qemu_vga.ndrv', 'dtb')
$devTools = @('qemu-system-x86_64w.exe', 'qemu-io.exe', 'qemu-nbd.exe', 'qemu-storage-daemon.exe', 'qemu-edid.exe',
- 'elf2dmp.exe', '*.exe.debug-orig', '*.pdb')
+ 'elf2dmp.exe', '*.exe.debug-orig', '*.pdb', '*.log', '*.jsonl')
Copy-Dir $qemu "$stage\runtime\reims-ctl\qemu\current" ($otherCpus + $devTools) @('include')
# These two files are required by the bundled x86-64 QEMU command line. A package
# without them starts reims-ctl but fails before the guest is created (issue #38).
diff --git a/packaging/wsm-setup.iss b/packaging/wsm-setup.iss
index b4ee54d..59d657b 100644
--- a/packaging/wsm-setup.iss
+++ b/packaging/wsm-setup.iss
@@ -1,6 +1,6 @@
-; Build with ISCC /DStageDir="..." /DMyAppVersion="0.2.2" WSM-Setup.iss
+; Build with ISCC /DStageDir="..." /DMyAppVersion="0.2.4" WSM-Setup.iss
#ifndef MyAppVersion
- #define MyAppVersion "0.2.2"
+ #define MyAppVersion "0.2.4"
#endif
#ifndef AppIdValue
#define AppIdValue "{{FC777B63-3C0A-4B29-9E05-817D50AA8BA9}"
diff --git a/src/wsm-compositor/src/compositor.cpp b/src/wsm-compositor/src/compositor.cpp
index ce26bbf..93acf72 100644
--- a/src/wsm-compositor/src/compositor.cpp
+++ b/src/wsm-compositor/src/compositor.cpp
@@ -436,6 +436,21 @@ struct RootlessCompositor::Impl {
return 0;
}
break;
+ case WM_NCRBUTTONDOWN: case WM_NCRBUTTONUP: case WM_NCRBUTTONDBLCLK:
+ case WM_NCMBUTTONDOWN: case WM_NCMBUTTONUP: case WM_NCMBUTTONDBLCLK:
+ if (self->callbacks.on_mouse_button) {
+ POINT pt{GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)};
+ ScreenToClient(hwnd, &pt);
+ if (!self->map_point(wid, pt.x, pt.y)) return 0;
+ proto::InputMouseButtonEvent ev{};
+ ev.window_id = wid; ev.x = pt.x; ev.y = pt.y;
+ ev.button = (msg == WM_NCRBUTTONDOWN || msg == WM_NCRBUTTONUP || msg == WM_NCRBUTTONDBLCLK) ? 1 : 2;
+ ev.pressed = msg != WM_NCRBUTTONUP && msg != WM_NCMBUTTONUP;
+ ev.clicks = (msg == WM_NCRBUTTONDBLCLK || msg == WM_NCMBUTTONDBLCLK) ? 2 : 1;
+ ev.modifiers = current_modifiers();
+ self->callbacks.on_mouse_button(ev);
+ }
+ return 0;
case WM_NCLBUTTONUP:
if (wParam == HTMINBUTTON || wParam == HTMAXBUTTON || wParam == HTCLOSE) return 0;
break;
@@ -506,27 +521,34 @@ struct RootlessCompositor::Impl {
case WM_LBUTTONDOWN: case WM_LBUTTONUP:
case WM_RBUTTONDOWN: case WM_RBUTTONUP:
case WM_MBUTTONDOWN: case WM_MBUTTONUP:
+ case WM_LBUTTONDBLCLK: case WM_RBUTTONDBLCLK: case WM_MBUTTONDBLCLK: {
+ const bool pressed = msg != WM_LBUTTONUP && msg != WM_RBUTTONUP && msg != WM_MBUTTONUP;
// Keep receiving moves while a button is held (drags that leave the window).
- if (msg == WM_LBUTTONDOWN || msg == WM_RBUTTONDOWN || msg == WM_MBUTTONDOWN) SetCapture(hwnd);
+ if (pressed) SetCapture(hwnd);
else if (!(wParam & (MK_LBUTTON | MK_RBUTTON | MK_MBUTTON))) ReleaseCapture();
if (self->callbacks.on_mouse_button) {
proto::InputMouseButtonEvent ev{};
ev.window_id = wid;
ev.x = GET_X_LPARAM(lParam);
ev.y = GET_Y_LPARAM(lParam);
- if (!self->map_point(wid, ev.x, ev.y) &&
- (msg == WM_LBUTTONDOWN || msg == WM_RBUTTONDOWN || msg == WM_MBUTTONDOWN)) return 0;
- ev.button = (msg == WM_LBUTTONDOWN || msg == WM_LBUTTONUP) ? 0
- : (msg == WM_RBUTTONDOWN || msg == WM_RBUTTONUP) ? 1 : 2;
- ev.pressed = (msg == WM_LBUTTONDOWN || msg == WM_RBUTTONDOWN || msg == WM_MBUTTONDOWN) ? 1 : 0;
+ if (!self->map_point(wid, ev.x, ev.y) && pressed) return 0;
+ ev.button = (msg == WM_LBUTTONDOWN || msg == WM_LBUTTONUP || msg == WM_LBUTTONDBLCLK) ? 0
+ : (msg == WM_RBUTTONDOWN || msg == WM_RBUTTONUP || msg == WM_RBUTTONDBLCLK) ? 1 : 2;
+ ev.pressed = pressed ? 1 : 0;
+ ev.clicks = (msg == WM_LBUTTONDBLCLK || msg == WM_RBUTTONDBLCLK || msg == WM_MBUTTONDBLCLK) ? 2 : 1;
ev.modifiers = current_modifiers();
self->callbacks.on_mouse_button(ev);
}
return 0;
+ }
case WM_MOUSEWHEEL:
if (self->callbacks.on_scroll) {
proto::InputScrollEvent ev{};
ev.window_id = wid;
+ POINT point{GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)};
+ ScreenToClient(hwnd, &point);
+ ev.x = point.x; ev.y = point.y;
+ if (!self->map_point(wid, ev.x, ev.y)) return 0;
ev.delta_y = static_cast<float>(GET_WHEEL_DELTA_WPARAM(wParam)) / static_cast<float>(WHEEL_DELTA);
ev.modifiers = current_modifiers();
self->callbacks.on_scroll(ev);
diff --git a/src/wsm-guest/agent/wsm-install.sh b/src/wsm-guest/agent/wsm-install.sh
index 361ca32..4d8ccb1 100644
--- a/src/wsm-guest/agent/wsm-install.sh
+++ b/src/wsm-guest/agent/wsm-install.sh
@@ -90,7 +90,7 @@ handle_file() {
if [[ "$f" == --builtin ]]; then
# An app that ships with macOS (Safari, TextEdit, …): nothing to copy, just report it.
a="$2"; icons="${3:-$HOME/Library/Caches/WSM/icons}"; mkdir -p "$icons"
- [[ "$a" == /Applications/*.app || "$a" == /System/Applications/*.app || "$a" == /System/Applications/Utilities/*.app ]] \
+ [[ "$a" == /Applications/*.app || "$a" == /System/Applications/*.app || "$a" == /System/Applications/Utilities/*.app || "$a" == /System/Library/CoreServices/Finder.app ]] \
|| fail "that isn't a built-in Mac app"
[[ -d "$a" ]] || fail "${a:t:r} isn't part of this macOS"
installed+=("$a")
diff --git a/src/wsm-guest/agent/wsm-trim.sh b/src/wsm-guest/agent/wsm-trim.sh
index 4585181..af77aba 100644
--- a/src/wsm-guest/agent/wsm-trim.sh
+++ b/src/wsm-guest/agent/wsm-trim.sh
@@ -7,7 +7,7 @@
# Kept on purpose, because apps rely on them: accountsd, cloudd (CloudKit), contactsd, quicklook,
# talagent (window restoration), usernoted, coreaudiod, networking, mobileassetd (fonts),
# keychain/security, WindowServer/Dock/Finder (the session), wallpaper (WSM's flat backdrop).
-VERSION=8
+VERSION=10
STAMP=/Library/WSM/trim-version
U=$(id -u)
# Keep the Dock out of captured application pixels, including runtimes already trimmed.
@@ -92,11 +92,27 @@ for j in $system_jobs; do
sudo launchctl bootout system/$j 2>/dev/null
done
-# Spotlight: stop indexing every volume (mds stays for apps that query metadata).
+# Spotlight: stop indexing every volume (mds stays enabled for apps and UserAccountUpdater;
+# re-enable it for runtimes provisioned before this fix had mds disabled).
+sudo launchctl enable system/com.apple.mds 2>/dev/null
sudo mdutil -a -i off >/dev/null 2>&1
+# Ensure loginwindow never re-runs UserAccountUpdater on future boots if an earlier build killed it.
+VER=$(defaults read /System/Library/CoreServices/SystemVersion ProductVersion 2>/dev/null)
+BLD=$(defaults read /System/Library/CoreServices/SystemVersion ProductBuildVersion 2>/dev/null)
+if [[ -n "$VER" && -n "$BLD" ]]; then
+ defaults write com.apple.loginwindow BuildVersionStampAsString -string "$BLD"
+ defaults write com.apple.loginwindow SystemVersionStampAsString -string "$VER"
+ defaults write com.apple.loginwindow lastUpdatedBuildVersion -string "$BLD"
+ defaults write com.apple.loginwindow lastUpdatedSystemVersion -string "$VER"
+ defaults write com.apple.UserAccountUpdater lastUpdatedBuildVersion -string "$BLD"
+ defaults write com.apple.UserAccountUpdater lastUpdatedSystemVersion -string "$VER"
+fi
# No automatic update checks or downloads, no Time Machine prompts.
sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticCheckEnabled -bool false
sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticDownload -bool false
+sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate CriticalUpdateInstall -bool false
+sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate ConfigDataInstall -bool false
+sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticallyInstallMacOSUpdates -bool false
sudo defaults write /Library/Preferences/com.apple.commerce AutoUpdate -bool false
sudo defaults write /Library/Preferences/com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true 2>/dev/null
# Interface work nobody sees: no animations, no transparency, no sleep of the display.
@@ -135,7 +151,7 @@ defaults write com.apple.loginwindow TALLogoutSavesState -bool false
defaults write com.apple.loginwindow LoginwindowLaunchesRelaunchApps -bool false
find ~/Library/Preferences/ByHost -name "com.apple.loginwindow.*.plist" -delete 2>/dev/null
pkill -x Tips 2>/dev/null
-killall Dock Finder NotificationCenter WindowManager tipsd chronod 2>/dev/null
+killall Dock Finder NotificationCenter WindowManager tipsd chronod Spotlight corespotlightd spotlightknowledged duetexpertd siriinferenced SoftwareUpdateNotificationManager photoanalysisd mediaanalysisd knowledge-agent suggestd triald SafariBookmarksSyncAgent 2>/dev/null
# Make the override database reach the disk before anything can power the runtime off.
sync; sleep 1; sync
diff --git a/src/wsm-guest/provision/wsm-offline-setup.sh b/src/wsm-guest/provision/wsm-offline-setup.sh
index 875e2bf..dad2f78 100644
--- a/src/wsm-guest/provision/wsm-offline-setup.sh
+++ b/src/wsm-guest/provision/wsm-offline-setup.sh
@@ -133,7 +133,9 @@ for svc in com.apple.photoanalysisd com.apple.mediaanalysisd com.apple.photolibr
com.apple.intelligenceplatformd com.apple.generativeexperiencesd com.apple.spotlightknowledged; do
defaults write "$D/private/var/db/com.apple.xpc.launchd/disabled.$UID_.plist" "$svc" -bool true
done
-for svc in com.apple.backupd-helper com.apple.backupd com.apple.mds com.apple.metadata.mds.spindump \
+# Keep com.apple.mds enabled (as wsm-trim.sh does): disabling mds before first login deadlocks
+# SettingsUAUPlugin/IndexSettings inside UserAccountUpdater and blocks Finder from starting.
+for svc in com.apple.backupd-helper com.apple.backupd com.apple.metadata.mds.spindump \
com.apple.softwareupdated com.apple.mobile.softwareupdated com.apple.analyticsd \
com.apple.ReportCrash.Root com.apple.diagnosticd.osactivity; do
defaults write "$OVR" "$svc" -bool true
@@ -153,6 +155,16 @@ defaults write "$H/Library/Preferences/com.apple.universalaccess" reduceMotion -
defaults write "$H/Library/Preferences/com.apple.universalaccess" reduceTransparency -bool true
defaults write "$H/Library/Preferences/NSGlobalDomain" NSAutomaticWindowAnimationsEnabled -bool false
defaults write "$H/Library/Preferences/com.apple.loginwindow" TALLogoutSavesState -bool false
+# Record the current macOS build/version for UserAccountUpdater so loginwindow launches Dock and
+# Finder directly instead of stalling on first-login UserAccountUpdater/IndexSettings plugins.
+if [ -n "$VER" ] && [ -n "$BLD" ]; then
+ defaults write "$H/Library/Preferences/com.apple.loginwindow" BuildVersionStampAsString -string "$BLD"
+ defaults write "$H/Library/Preferences/com.apple.loginwindow" SystemVersionStampAsString -string "$VER"
+ defaults write "$H/Library/Preferences/com.apple.loginwindow" lastUpdatedBuildVersion -string "$BLD"
+ defaults write "$H/Library/Preferences/com.apple.loginwindow" lastUpdatedSystemVersion -string "$VER"
+ defaults write "$H/Library/Preferences/com.apple.UserAccountUpdater" lastUpdatedBuildVersion -string "$BLD"
+ defaults write "$H/Library/Preferences/com.apple.UserAccountUpdater" lastUpdatedSystemVersion -string "$VER"
+fi
touch "$H/.hushlogin"
# Spotlight indexing off for the system volume (index lives on Data).
touch "$D/.metadata_never_index" 2>/dev/null || true
diff --git a/src/wsm-guest/provision/wsm-stage-installer.sh b/src/wsm-guest/provision/wsm-stage-installer.sh
index a7fa807..1192bc2 100644
--- a/src/wsm-guest/provision/wsm-stage-installer.sh
+++ b/src/wsm-guest/provision/wsm-stage-installer.sh
@@ -19,6 +19,20 @@ complete() {
[ "$(stat -f %z "$app/Contents/SharedSupport/SharedSupport.dmg")" = "$size" ]
}
find_app
+# Older builds can leave Apple's copy running after PackageKit has returned an
+# error. Wait for that exact source/destination before inspecting or reusing it;
+# never start a second writer or kill unrelated package work.
+if [ -n "$app" ]; then
+ legacy_copy="/bin/cp -fc $package ${target}Applications/${app##*/}/Contents/SharedSupport/SharedSupport.dmg"
+ direct_copy="/bin/cp -fc $package $app/Contents/SharedSupport/SharedSupport.dmg"
+ waited=0
+ while ps -axww -o command= | grep -Fqx -e "$legacy_copy" -e "$direct_copy"; do
+ [ "$waited" -lt 7200 ] || { echo 'The earlier installer copy is still running; its data is preserved' >&2; exit 1; }
+ [ "$waited" -ne 0 ] || echo 'Waiting for the previous Apple installer copy; keeping its progress'
+ sleep 5
+ waited=$((waited+5))
+ done
+fi
if [ ! -e "$marker" ] && complete; then echo 'Verified existing installer; reusing it'; exit 0; fi
mkdir -p "$target/Applications"
touch "$marker"
@@ -39,7 +53,25 @@ else
ln -s "$target/Applications" "$link"
created=1
fi
-CM_BUILD=CM_BUILD installer -pkg "$package" -target "$target"
+# Apple's postinstall uses cp -fc to place the package in SharedSupport. Copying
+# directly from Recovery's other volume can exceed PackageKit's script deadline,
+# which reports failure while its orphaned copy continues. Stage on the target
+# APFS volume first, outside PackageKit, so postinstall can use a fast APFS clone.
+local_package="$target/.wsm-InstallAssistant.pkg"
+if [ ! -f "$local_package" ] || [ "$(stat -f %z "$local_package")" != "$size" ]; then
+ temporary="$local_package.wsm-part"
+ if complete; then
+ # Preserve a completed copy from an earlier PackageKit timeout.
+ cp -c "$app/Contents/SharedSupport/SharedSupport.dmg" "$temporary"
+ else
+ echo 'Preparing a local installer copy before running the Apple package'
+ cp "$package" "$temporary"
+ fi
+ [ "$(stat -f %z "$temporary")" = "$size" ] || { echo 'Local installer copy is incomplete' >&2; exit 1; }
+ mv -f "$temporary" "$local_package"
+ temporary=
+fi
+CM_BUILD=CM_BUILD installer -pkg "$local_package" -target "$target"
find_app
[ -n "$app" ] || { echo 'The package did not create a usable Install macOS app' >&2; exit 1; }
if ! complete; then
@@ -54,4 +86,5 @@ fi
chmod -R 755 "$app"
complete || { echo 'Staged installer verification failed' >&2; exit 1; }
rm -f "$marker"
+rm -f "$local_package"
echo 'Installer app and full SharedSupport image verified'
diff --git a/src/wsm-manager/app.js b/src/wsm-manager/app.js
index e76b54a..d462c70 100644
--- a/src/wsm-manager/app.js
+++ b/src/wsm-manager/app.js
@@ -3,6 +3,13 @@
const API = location.origin.startsWith("http") ? location.origin : "http://127.0.0.1:17421";
const $ = (id) => document.getElementById(id);
const reduceMotion = matchMedia("(prefers-reduced-motion: reduce)").matches;
+const SYSTEM_APPS = [
+ { id: "com.apple.finder", name: "Finder", path: "/System/Library/CoreServices/Finder.app" },
+ { id: "com.apple.systempreferences", name: "System Settings", path: "/System/Applications/System Settings.app" },
+ { id: "com.apple.Console", name: "Console", path: "/System/Applications/Utilities/Console.app" },
+ { id: "com.apple.DiskUtility", name: "Disk Utility", path: "/System/Applications/Utilities/Disk Utility.app" },
+];
+const SYSTEM_APP_IDS = new Set(SYSTEM_APPS.map((app) => app.id));
const state = {
apps: [], runtime: "unknown", setup: null, busy: new Set(), running: new Set(),
@@ -106,8 +113,8 @@ function makeTile(app, i, firstPaint) {
};
if (state.glow.has(app.id)) node.style.setProperty("--glow", state.glow.get(app.id));
if (state.justInstalled.has(app.id)) { node.classList.add("pop"); state.justInstalled.delete(app.id); }
- node.addEventListener("click", () => openApp(app));
- node.addEventListener("contextmenu", (e) => { e.preventDefault(); showMenu(e.clientX, e.clientY, app); });
+ node.addEventListener("click", () => app.builtin ? addBuiltin(app) : openApp(app));
+ node.addEventListener("contextmenu", (e) => { e.preventDefault(); if (!app.builtin) showMenu(e.clientX, e.clientY, app); });
attachTilt(node);
return node;
}
@@ -151,9 +158,10 @@ function renderApps() {
// Keyed update: tiles stay put (no re-entrance animation) when only their state changes.
const firstPaint = !shelf.dataset.painted; shelf.dataset.painted = "1";
- const keep = new Set(state.apps.map((a) => a.id));
+ const libraryApps = state.apps.filter((app) => !SYSTEM_APP_IDS.has(app.id));
+ const keep = new Set(libraryApps.map((a) => a.id));
shelf.querySelectorAll(".tile[data-id]").forEach((n) => { if (!keep.has(n.dataset.id)) n.remove(); });
- state.apps.forEach((app, i) => {
+ libraryApps.forEach((app, i) => {
let node = shelf.querySelector(`.tile[data-id="${CSS.escape(app.id)}"]`);
if (!node) {
node = makeTile(app, i, firstPaint);
@@ -162,6 +170,7 @@ function renderApps() {
}
syncTileState(node, app);
});
+ renderSystemApps(shelf);
if (installing) installTile(state.install);
else shelf.querySelector(".tile.installing")?.remove();
@@ -195,6 +204,48 @@ function renderApps() {
shelf.appendChild(add);
}
+function renderSystemApps(shelf) {
+ let folder = shelf.querySelector(".system-folder");
+ if (!folder) {
+ folder = document.createElement("button");
+ folder.className = "tile system-folder";
+ folder.setAttribute("aria-haspopup", "dialog");
+ folder.innerHTML = '<span class="tile-icon"><span class="folder-preview"></span></span><span class="tile-name">System Apps</span><span class="tile-note">4 apps</span>';
+ for (const app of SYSTEM_APPS) {
+ const mini = document.createElement("span");
+ mini.className = "folder-mini";
+ const img = document.createElement("img"), fallback = document.createElement("span");
+ img.alt = ""; fallback.textContent = initials(app.name);
+ img.onload = () => { img.hidden = false; fallback.hidden = true; };
+ img.onerror = () => { img.hidden = true; fallback.hidden = false; };
+ img.src = `${API}/api/apps/icon?id=${encodeURIComponent(app.id)}`;
+ mini.dataset.id = app.id; mini.append(img, fallback);
+ folder.querySelector(".folder-preview").appendChild(mini);
+ }
+ folder.onclick = () => $("system-apps").showModal();
+ attachTilt(folder);
+ shelf.appendChild(folder);
+ }
+ for (const app of SYSTEM_APPS) {
+ const registered = state.apps.find((entry) => entry.id === app.id);
+ const visible = registered || { ...app, builtin: true };
+ let tile = $("system-apps-grid").querySelector(`.tile[data-id="${app.id}"]`);
+ // Replace the initial shortcut once its real icon and launch entry arrive.
+ if (tile && tile.dataset.registered !== String(!!registered)) { tile.remove(); tile = null; }
+ if (!tile) {
+ tile = makeTile(visible, 0, false);
+ tile.dataset.registered = String(!!registered);
+ $("system-apps-grid").appendChild(tile);
+ }
+ syncTileState(tile, visible);
+ const mini = folder.querySelector(`.folder-mini[data-id="${app.id}"]`);
+ if (registered && !mini.dataset.registered) {
+ mini.dataset.registered = "1";
+ mini.querySelector("img").src = `${API}/api/apps/icon?id=${encodeURIComponent(app.id)}&ready=1`;
+ }
+ }
+}
+
async function openApp(app) {
if (state.busy.has(app.id)) return;
state.busy.add(app.id); renderApps();
diff --git a/src/wsm-manager/index.html b/src/wsm-manager/index.html
index ed62c61..9f6cf67 100644
--- a/src/wsm-manager/index.html
+++ b/src/wsm-manager/index.html
@@ -56,6 +56,10 @@
</div>
<div class="scrim" id="scrim" hidden></div>
+ <dialog id="system-apps" class="system-apps-dialog" aria-labelledby="system-apps-title">
+ <header><h2 id="system-apps-title">System Apps</h2><form method="dialog"><button class="icon-btn" aria-label="Close System Apps">✕</button></form></header>
+ <section id="system-apps-grid" class="shelf" aria-label="System applications"></section>
+ </dialog>
<aside class="settings" id="settings" aria-labelledby="settings-title" aria-hidden="true">
<header class="settings-head">
<h2 id="settings-title">Settings</h2>
diff --git a/src/wsm-manager/styles.css b/src/wsm-manager/styles.css
index edac0c4..34af757 100644
--- a/src/wsm-manager/styles.css
+++ b/src/wsm-manager/styles.css
@@ -172,6 +172,15 @@ svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width:
@keyframes spin { to { transform: rotate(360deg); } }
/* ---------- shelf of apps ---------- */
+.folder-preview { width: 92px; height: 92px; padding: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; border-radius: 22px; background: rgba(155,170,205,.22); border: 1px solid var(--line); box-sizing: border-box; }
+.folder-mini { display: grid; place-items: center; border-radius: 8px; background: rgba(100,140,220,.16); overflow: hidden; font-size: 17px; font-weight: 700; }
+.tile-icon .folder-mini img { width: 30px; height: 30px; filter: none; }
+.system-apps-dialog { width: min(680px, calc(100vw - 40px)); padding: 24px; color: #f1f4ff; background: #111524; border: 1px solid rgba(170,185,220,.25); border-radius: 28px; box-shadow: 0 24px 90px #0008; }
+.system-apps-dialog::backdrop { background: #0007; backdrop-filter: blur(12px); }
+.system-apps-dialog > header { display: flex; align-items: center; justify-content: space-between; }
+.system-apps-dialog h2 { margin: 0; font-size: 24px; }
+.system-apps-dialog .shelf { grid-template-columns: repeat(4, minmax(0,1fr)); padding: 24px 0 0; overflow: visible; }
+@media (max-width: 560px) { .system-apps-dialog .shelf { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.shelf {
flex: 1; overflow-y: auto; padding: 22px 26px 40px;
display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); align-content: start; gap: 10px;
diff --git a/src/wsm-runtime/include/wsm/child_processes.hpp b/src/wsm-runtime/include/wsm/child_processes.hpp
new file mode 100644
index 0000000..aefb74e
--- /dev/null
+++ b/src/wsm-runtime/include/wsm/child_processes.hpp
@@ -0,0 +1,39 @@
+#pragma once
+#include <windows.h>
+#include <mutex>
+
+namespace wsm::runtime {
+// Explicitly enabled by wsmd. Children survive a daemon hot-swap; only the user's
+// Quit WSM action terminates the job. Other WSM installations never join it.
+inline std::mutex children_mutex;
+inline HANDLE children_job = nullptr;
+inline bool children_closing = false;
+inline bool initialize_child_processes() {
+ std::lock_guard<std::mutex> lock(children_mutex);
+ if (!children_job) children_job = CreateJobObjectW(nullptr, nullptr);
+ return children_job != nullptr;
+}
+inline BOOL create_owned_process_a(LPCSTR app, LPSTR line, LPSECURITY_ATTRIBUTES process_security,
+ LPSECURITY_ATTRIBUTES thread_security, BOOL inherit, DWORD flags, LPVOID environment,
+ LPCSTR directory, LPSTARTUPINFOA startup, LPPROCESS_INFORMATION process) {
+ std::lock_guard<std::mutex> lock(children_mutex);
+ if (children_closing) { SetLastError(ERROR_SHUTDOWN_IN_PROGRESS); return FALSE; }
+ if (!children_job) return CreateProcessA(app, line, process_security, thread_security, inherit,
+ flags, environment, directory, startup, process);
+ if (!CreateProcessA(app, line, process_security, thread_security, inherit, flags | CREATE_SUSPENDED,
+ environment, directory, startup, process)) return FALSE;
+ if (!AssignProcessToJobObject(children_job, process->hProcess)) {
+ const auto error = GetLastError();
+ TerminateProcess(process->hProcess, 1);
+ CloseHandle(process->hThread); CloseHandle(process->hProcess);
+ *process = {}; SetLastError(error); return FALSE;
+ }
+ if (!(flags & CREATE_SUSPENDED)) ResumeThread(process->hThread);
+ return TRUE;
+}
+inline void stop_child_processes() {
+ std::lock_guard<std::mutex> lock(children_mutex);
+ children_closing = true;
+ if (children_job) TerminateJobObject(children_job, 0);
+}
+}
diff --git a/src/wsm-runtime/include/wsm/guest_app_path.hpp b/src/wsm-runtime/include/wsm/guest_app_path.hpp
index 0fa1a64..7e45bac 100644
--- a/src/wsm-runtime/include/wsm/guest_app_path.hpp
+++ b/src/wsm-runtime/include/wsm/guest_app_path.hpp
@@ -6,7 +6,8 @@ namespace wsm::runtime {
// App Store apps are already installed in one of these locations. Treat the path as UTF-8;
// do not interpret it as a Windows filesystem path.
inline bool is_guest_app_path(const std::string& path) {
- if (path.rfind("/Applications/", 0) != 0 && path.rfind("/System/Applications/", 0) != 0) return false;
+ if (path.rfind("/Applications/", 0) != 0 && path.rfind("/System/Applications/", 0) != 0 &&
+ path != "/System/Library/CoreServices/Finder.app") return false;
if (path.size() < 5 || path.compare(path.size() - 4, 4, ".app") != 0) return false;
for (unsigned char c : path) if (c < 32 || c == 127) return false;
size_t begin = 1;
diff --git a/src/wsm-runtime/include/wsm/input_batches.hpp b/src/wsm-runtime/include/wsm/input_batches.hpp
new file mode 100644
index 0000000..1835d4d
--- /dev/null
+++ b/src/wsm-runtime/include/wsm/input_batches.hpp
@@ -0,0 +1,71 @@
+#pragma once
+#include <deque>
+#include <string>
+#include <vector>
+#include <utility>
+#include <set>
+#include <cstdint>
+
+namespace wsm::runtime {
+inline std::string input_key_code(const std::string& events) {
+ auto type = events.find("\"qcode\"");
+ if (type == std::string::npos) return {};
+ auto data = events.find("\"data\":\"", type);
+ if (data == std::string::npos) return {};
+ data += 8;
+ const auto end = events.find('"', data);
+ return end == std::string::npos ? std::string{} : events.substr(data, end - data);
+}
+inline std::string released_input_events(const std::set<std::string>& held_keys) {
+ std::string out;
+ for (auto button : {"left","right","middle"}) {
+ if (!out.empty()) out += ',';
+ out += "{\"type\":\"btn\",\"data\":{\"down\":false,\"button\":\"" + std::string(button) + "\"}}";
+ }
+ std::set<std::string> keys = held_keys;
+ for (auto key : {"shift","shift_r","ctrl","ctrl_r","meta_l","meta_r","alt","alt_r"}) keys.insert(key);
+ for (const auto& key : keys) out += ",{\"type\":\"key\",\"data\":{\"down\":false,\"key\":{\"type\":\"qcode\",\"data\":\"" + key + "\"}}}";
+ return out;
+}
+// Pace only a burst which can overrun USB HID's 10 ms polling queue. Human
+// input already spaced in time must not pay a sleep after every transition.
+struct InputCadence {
+ int64_t keyboard_due = 0, pointer_due = 0;
+ static int interval(const std::string& events) {
+ const auto key = input_key_code(events);
+ if (!key.empty()) {
+ // Extended PC scancodes occupy two entries in QEMU's HID queue.
+ static const std::set<std::string> extended = {"ctrl_r", "alt_r", "meta_l", "meta_r",
+ "insert", "delete", "home", "end", "pgup", "pgdn", "left", "right", "up", "down", "kp_divide"};
+ return extended.count(key) ? 20 : 10;
+ }
+ return events.find("\"down\"") != std::string::npos ? 10 : 0;
+ }
+ int64_t wait_ms(const std::string& events, int64_t now) const {
+ if (!interval(events)) return 0;
+ const auto due = input_key_code(events).empty() ? pointer_due : keyboard_due;
+ return due > now ? due - now : 0;
+ }
+ void delivered(const std::string& events, int64_t now) {
+ const auto gap = interval(events);
+ if (!gap) return;
+ (input_key_code(events).empty() ? pointer_due : keyboard_due) = now + gap;
+ }
+};
+// QEMU synchronizes HID state once per input-send-event command. A press and
+// release in one command can collapse to no click. Coalesce only pointer moves.
+inline std::vector<std::string> synchronized_input_batches(const std::deque<std::string>& events) {
+ std::vector<std::string> batches;
+ std::string movement;
+ for (const auto& event : events) {
+ if (event.empty()) continue;
+ if (event[0] == 'M') { movement = event.substr(1); continue; }
+ std::string batch = std::move(movement); movement.clear();
+ if (!batch.empty()) batch += ',';
+ batch += event[0] == 'E' ? event.substr(1) : event;
+ batches.push_back(std::move(batch));
+ }
+ if (!movement.empty()) batches.push_back(std::move(movement));
+ return batches;
+}
+}
diff --git a/src/wsm-runtime/include/wsm/process_identity.hpp b/src/wsm-runtime/include/wsm/process_identity.hpp
new file mode 100644
index 0000000..a7216b3
--- /dev/null
+++ b/src/wsm-runtime/include/wsm/process_identity.hpp
@@ -0,0 +1,25 @@
+#pragma once
+#include <windows.h>
+#include <filesystem>
+namespace wsm::runtime {
+inline bool same_executable_file(const std::filesystem::path& a, const std::filesystem::path& b) {
+ HANDLE first = CreateFileW(a.c_str(), FILE_READ_ATTRIBUTES, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, nullptr, OPEN_EXISTING, 0, nullptr);
+ HANDLE second = CreateFileW(b.c_str(), FILE_READ_ATTRIBUTES, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, nullptr, OPEN_EXISTING, 0, nullptr);
+ BY_HANDLE_FILE_INFORMATION x{}, y{};
+ const bool same = first != INVALID_HANDLE_VALUE && second != INVALID_HANDLE_VALUE &&
+ GetFileInformationByHandle(first, &x) && GetFileInformationByHandle(second, &y) &&
+ x.dwVolumeSerialNumber == y.dwVolumeSerialNumber && x.nFileIndexHigh == y.nFileIndexHigh && x.nFileIndexLow == y.nFileIndexLow;
+ if (first != INVALID_HANDLE_VALUE) CloseHandle(first);
+ if (second != INVALID_HANDLE_VALUE) CloseHandle(second);
+ return same;
+}
+inline bool process_runs_executable(DWORD pid, const std::filesystem::path& executable) {
+ if (!pid) return false;
+ HANDLE process = OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION, FALSE, pid);
+ if (!process) return false;
+ wchar_t image[32768]{}; DWORD length = 32768, code = 0;
+ const bool alive = GetExitCodeProcess(process, &code) && code == STILL_ACTIVE && QueryFullProcessImageNameW(process, 0, image, &length);
+ CloseHandle(process);
+ return alive && same_executable_file(image, executable);
+}
+}
diff --git a/src/wsm-runtime/include/wsm/provisioner.hpp b/src/wsm-runtime/include/wsm/provisioner.hpp
index 8de43ee..21ec29f 100644
--- a/src/wsm-runtime/include/wsm/provisioner.hpp
+++ b/src/wsm-runtime/include/wsm/provisioner.hpp
@@ -76,13 +76,15 @@ private:
std::string path_;
};
bool ssh_ok(uint32_t timeout_ms, bool require_desktop = true) const;
+ bool ssh_signin_status(uint32_t timeout_ms, std::string& summary) const;
bool request_guest_restart() const;
bool wait_for_first_sign_in();
- bool click_blue_button(); // Apple's first-run "Get Started"/"Continue", if on screen
+ bool click_blue_button(int* clicked_step = nullptr); // Apple's first-run "Get Started"/"Continue", if on screen
// helpers
int reims(const std::string& args, std::string* out = nullptr) const;
bool vm_running() const;
+ bool recover_paused_setup_vm();
bool screen_dump(std::vector<uint8_t>& rgb, int& w, int& h) const;
double screen_fraction_nonblack() const;
bool open_recovery_terminal();
@@ -95,6 +97,7 @@ private:
std::string root_, vm_dir_, reims_ctl_, qemu_img_, share_dir_;
std::string vm_ = "wsm-default";
int ssh_port_ = 2222;
+ int setup_crash_restarts_ = 0;
mutable std::mutex mu_;
mutable ProvSnapshot snap_;
std::atomic<bool> running_{false};
diff --git a/src/wsm-runtime/include/wsm/recovery_script.hpp b/src/wsm-runtime/include/wsm/recovery_script.hpp
index 40d01e2..922f361 100644
--- a/src/wsm-runtime/include/wsm/recovery_script.hpp
+++ b/src/wsm-runtime/include/wsm/recovery_script.hpp
@@ -1,5 +1,6 @@
#pragma once
#include "wsm/guest_app_path.hpp"
+#include <algorithm>
#include <cstdint>
#include <string>
@@ -31,9 +32,17 @@ inline std::string recovery_script_transfer(const std::string& script, const std
"v=$((v^((l&255)<<24)));\n"
"for ((i=0;i<8;i++)); do v=$((((v<<1)^((v&2147483648)?79764919:0))&4294967295)); done;\n"
"l=$((l>>8)); done; printf '%u %u' \"$((~v&4294967295))\" \"$n\";\n"
- "};\n: > " + destination + " &&\n";
- for (size_t i = 0; i < script.size(); i += 128)
- command += "printf %s " + guest_shell_quote(script.substr(i, 128)) + " >> " + destination + " &&\n";
+ "};\n{\n";
+ // Open the destination once instead of typing its path for every chunk.
+ // Bound the escaped line length as well as the original payload length.
+ for (size_t i = 0; i < script.size();) {
+ size_t count = std::min<size_t>(320, script.size() - i);
+ auto quoted = guest_shell_quote(script.substr(i, count));
+ while (quoted.size() > 384) quoted = guest_shell_quote(script.substr(i, --count));
+ command += "printf %s " + quoted + " &&\n";
+ i += count;
+ }
+ command += ":\n} > " + destination + " &&\n";
command += "set -- $(wsm_crc < " + destination + ") &&\n";
command += "[ \"$1:$2\" = \"" + std::to_string(recovery_script_cksum(script)) + ":" + std::to_string(script.size()) + "\" ] || "
"{ echo 'Recovery script transfer verification failed; no installer commands were executed.' >&2; false; }";
diff --git a/src/wsm-runtime/include/wsm/runtime_desktop.hpp b/src/wsm-runtime/include/wsm/runtime_desktop.hpp
new file mode 100644
index 0000000..055eb7f
--- /dev/null
+++ b/src/wsm-runtime/include/wsm/runtime_desktop.hpp
@@ -0,0 +1,58 @@
+#pragma once
+#include <cstdint>
+#include <string>
+#include <string_view>
+#include "wsm/guest_app_path.hpp"
+
+namespace wsm::runtime {
+// BSD ps etime: mm:ss, hh:mm:ss, or days-hh:mm:ss.
+inline int64_t desktop_elapsed_seconds(std::string_view text) {
+ while (!text.empty() && (text.front() == ' ' || text.front() == '\t')) text.remove_prefix(1);
+ while (!text.empty() && (text.back() == ' ' || text.back() == '\r' || text.back() == '\n')) text.remove_suffix(1);
+ int64_t days = 0, total = 0, value = 0;
+ int colons = 0; bool digits = false, has_days = false;
+ for (char c : text) {
+ if (c >= '0' && c <= '9') {
+ value = value * 10 + c - '0'; digits = true;
+ if (value > 1000000) return -1;
+ } else if (c == '-' && digits && !has_days && colons == 0) {
+ days = value; value = 0; digits = false; has_days = true;
+ } else if (c == ':' && digits && colons < 2) {
+ total = (total + value) * 60; value = 0; digits = false; ++colons;
+ } else return -1;
+ }
+ if (!digits || colons == 0 || (has_days && colons != 2) || value >= 60) return -1;
+ return days * 86400 + total + value;
+}
+// This watchdog only runs after runtime-ready, outside provisioning. Do not
+// repeat the first-install migration deadline on every completed-runtime boot.
+inline bool account_recovery_due(int64_t seconds) { return seconds >= 30; }
+inline bool window_watcher_timed_out(int64_t quiet_ms, bool received_output) {
+ return quiet_ms >= (received_output ? 15000 : 120000);
+}
+inline const char* desktop_probe_command() {
+ return "P=$(pgrep -x UserAccountUpdater | head -n 1); "
+ "if [ -n \"$P\" ]; then printf 'UAU %s ' \"$P\"; ps -p \"$P\" -o etime=; "
+ "elif [ \"$(stat -f %Su /dev/console)\" = wsm ]; then "
+ "pgrep -x Dock >/dev/null || launchctl kickstart gui/$(id -u)/com.apple.Dock.agent 2>/dev/null; "
+ "pgrep -x Finder >/dev/null || launchctl kickstart gui/$(id -u)/com.apple.Finder 2>/dev/null; "
+ "if pgrep -x Dock >/dev/null && pgrep -x Finder >/dev/null; then echo READY; else echo BOOTING; fi; "
+ "else echo BOOTING; fi";
+}
+inline std::string gui_open_command(const std::string& app) {
+ const char* option = app.find('/') != std::string::npos ? "" : app.find('.') != std::string::npos ? "-b " : "-a ";
+ return "sudo -n /bin/launchctl asuser $(id -u) /usr/bin/sudo -n -u \"$(id -un)\" /usr/bin/open " +
+ std::string(option) + guest_shell_quote(app);
+}
+inline std::string recover_runtime_account_command(uint32_t pid) {
+ const auto p = std::to_string(pid);
+ const std::string identity = "[ \"$(ps -p " + p + " -o comm=)\" = /System/Library/CoreServices/UserAccountUpdater ]";
+ // Same bounded recovery used by provisioning, also needed on later boots.
+ // Validate the live executable, and record one attempt per process per boot.
+ return identity + " || exit 1; M=/private/var/run/wsm-uau-" + p + ".recovered; "
+ "[ ! -e \"$M\" ] || exit 0; sudo -n touch \"$M\" || exit 1; "
+ "sudo -n pkill -TERM -x IndexSettings 2>/dev/null; "
+ "sudo -n pkill -TERM -x languageassetd 2>/dev/null; "
+ "sudo -n kill -TERM " + p + "; sleep 2; " + identity + " && sudo -n kill -KILL " + p + "; true";
+}
+}
diff --git a/src/wsm-runtime/include/wsm/runtime_idle.hpp b/src/wsm-runtime/include/wsm/runtime_idle.hpp
new file mode 100644
index 0000000..92c6512
--- /dev/null
+++ b/src/wsm-runtime/include/wsm/runtime_idle.hpp
@@ -0,0 +1,18 @@
+#pragma once
+#include <cstddef>
+#include <cstdint>
+#include <string_view>
+
+namespace wsm::runtime {
+inline bool runtime_idle_ready(bool running, bool desktop_ready, size_t windows, bool busy,
+ int64_t quiet_ms) {
+ return running && desktop_ready && windows == 0 && !busy && quiet_ms > 180000;
+}
+inline bool compact_requested(std::string_view marker) {
+ return marker == "asked\n" || marker == "asked\r\n" || marker == "asked";
+}
+inline bool maintenance_can_shutdown(uint64_t started, uint64_t current, bool desktop_ready,
+ size_t windows, bool busy) {
+ return started == current && desktop_ready && windows == 0 && !busy;
+}
+}
diff --git a/src/wsm-runtime/include/wsm/setup_assistant.hpp b/src/wsm-runtime/include/wsm/setup_assistant.hpp
index 2b739f4..7cc6a0a 100644
--- a/src/wsm-runtime/include/wsm/setup_assistant.hpp
+++ b/src/wsm-runtime/include/wsm/setup_assistant.hpp
@@ -13,4 +13,13 @@ inline bool setup_action_clickable(SetupAssistantStep step) {
inline bool welcome_restart_due(bool new_install, bool already_attempted, int stable_seconds) {
return new_install && !already_attempted && stable_seconds >= 120;
}
+// Recover a first sign-in stall when WSM's SSH account and passwordless sudo already work
+// (meaning offline setup succeeded), but macOS has not reached a signed-in Finder desktop
+// and no recognised clickable Setup Assistant prompt has made progress for 180 s (or
+// WelcomePending has been stable for 120 s). Strictly bounded to one graceful restart on a new install.
+inline bool first_sign_in_restart_due(bool new_install, bool already_attempted,
+ int welcome_pending_seconds, int ssh_stalled_seconds) {
+ return welcome_restart_due(new_install, already_attempted, welcome_pending_seconds) ||
+ (new_install && !already_attempted && ssh_stalled_seconds >= 180);
+}
}
diff --git a/src/wsm-runtime/include/wsm/ssh_tools.hpp b/src/wsm-runtime/include/wsm/ssh_tools.hpp
new file mode 100644
index 0000000..cd332c4
--- /dev/null
+++ b/src/wsm-runtime/include/wsm/ssh_tools.hpp
@@ -0,0 +1,50 @@
+#pragma once
+#include <windows.h>
+#include <filesystem>
+#include <string>
+#include <vector>
+
+namespace wsm::runtime {
+inline std::filesystem::path find_ssh_tool(const std::string& name, const std::vector<std::filesystem::path>& directories) {
+ if (name != "ssh" && name != "scp" && name != "ssh-keygen") return {};
+ for (const auto& directory : directories) {
+ std::error_code ec;
+ const auto file = directory / (name + ".exe");
+ if (!directory.empty() && std::filesystem::is_regular_file(file, ec)) return std::filesystem::absolute(file);
+ }
+ return {};
+}
+inline std::vector<std::filesystem::path> ssh_tool_directories() {
+ std::vector<std::filesystem::path> directories;
+ wchar_t system[32768]{};
+ if (GetSystemDirectoryW(system, 32768)) directories.emplace_back(std::filesystem::path(system) / "OpenSSH");
+ for (auto variable : {L"ProgramW6432", L"ProgramFiles"}) {
+ if (const auto value = _wgetenv(variable); value && *value) directories.emplace_back(std::filesystem::path(value) / "OpenSSH");
+ }
+ if (const auto value = _wgetenv(L"PATH")) {
+ const std::wstring path(value);
+ for (size_t start = 0; start < path.size();) {
+ const auto end = path.find(L';', start);
+ auto part = path.substr(start, end == std::wstring::npos ? path.size() - start : end - start);
+ if (part.size() >= 2 && part.front() == L'"' && part.back() == L'"') part = part.substr(1, part.size() - 2);
+ if (!part.empty()) directories.emplace_back(part);
+ if (end == std::wstring::npos) break;
+ start = end + 1;
+ }
+ }
+ return directories;
+}
+inline std::string ssh_tool_command(const std::string& name) {
+ const auto file = find_ssh_tool(name, ssh_tool_directories());
+ const auto utf8 = file.u8string();
+ return "\"" + std::string(reinterpret_cast<const char*>(utf8.data()), utf8.size()) + "\"";
+}
+inline bool ssh_tools_available() {
+ const auto directories = ssh_tool_directories();
+ for (auto name : {"ssh", "scp", "ssh-keygen"}) if (find_ssh_tool(name, directories).empty()) return false;
+ return true;
+}
+inline const char* ssh_tools_missing_message() {
+ return "OpenSSH tools (ssh, scp and ssh-keygen) were not found. WSM checks Windows System32/OpenSSH, Program Files/OpenSSH and PATH. Install Windows' OpenSSH Client or add a complete OpenSSH installation to PATH, then try again. Your macOS disk is kept.";
+}
+}
diff --git a/src/wsm-runtime/include/wsm/tray_icon.hpp b/src/wsm-runtime/include/wsm/tray_icon.hpp
new file mode 100644
index 0000000..80e9b9b
--- /dev/null
+++ b/src/wsm-runtime/include/wsm/tray_icon.hpp
@@ -0,0 +1,81 @@
+#pragma once
+#include <windows.h>
+#include <shellapi.h>
+#include <atomic>
+#include <functional>
+#include <string>
+#include <thread>
+
+namespace wsm::runtime {
+enum class TrayAction { Open, StopRuntime, Quit };
+class TrayIcon {
+public:
+ ~TrayIcon() { stop(); }
+ void start(std::function<void(TrayAction)> action) {
+ action_ = std::move(action);
+ thread_ = std::thread([this] {
+ WNDCLASSW wc{}; wc.lpfnWndProc = window_proc; wc.hInstance = GetModuleHandleW(nullptr);
+ wc.lpszClassName = L"WSM.Runtime.Tray"; RegisterClassW(&wc);
+ HWND window = CreateWindowW(wc.lpszClassName, L"WSM", 0, 0, 0, 0, 0, nullptr, nullptr, wc.hInstance, this);
+ window_.store(window);
+ if (!window) return;
+ add_icon(window);
+ MSG message{};
+ while (GetMessageW(&message, nullptr, 0, 0) > 0) { TranslateMessage(&message); DispatchMessageW(&message); }
+ window_.store(nullptr);
+ });
+ }
+ void stop() {
+ // Startup and shutdown can race when HTTP binding fails immediately.
+ if (!thread_.joinable()) return;
+ stopping_ = true;
+ if (auto window = window_.load()) PostMessageW(window, WM_CLOSE, 0, 0);
+ thread_.join();
+ }
+private:
+ void add_icon(HWND window) {
+ NOTIFYICONDATAW data{}; data.cbSize = sizeof(data); data.hWnd = window; data.uID = 1;
+ data.uFlags = NIF_MESSAGE | NIF_ICON | NIF_TIP; data.uCallbackMessage = WM_APP + 1;
+ data.hIcon = LoadIconW(GetModuleHandleW(nullptr), MAKEINTRESOURCEW(1));
+ if (!data.hIcon) data.hIcon = LoadIconW(nullptr, IDI_APPLICATION);
+ wcscpy_s(data.szTip, L"WSM — Mac apps on Windows");
+ Shell_NotifyIconW(NIM_ADD, &data);
+ if (stopping_) PostMessageW(window, WM_CLOSE, 0, 0);
+ }
+ static LRESULT CALLBACK window_proc(HWND window, UINT message, WPARAM wparam, LPARAM lparam) {
+ auto self = reinterpret_cast<TrayIcon*>(GetWindowLongPtrW(window, GWLP_USERDATA));
+ if (message == WM_NCCREATE) {
+ self = static_cast<TrayIcon*>(reinterpret_cast<CREATESTRUCTW*>(lparam)->lpCreateParams);
+ SetWindowLongPtrW(window, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(self));
+ }
+ if (!self) return DefWindowProcW(window, message, wparam, lparam);
+ static const UINT taskbar_created = RegisterWindowMessageW(L"TaskbarCreated");
+ if (message == taskbar_created) { self->add_icon(window); return 0; }
+ if (message == WM_APP + 1) {
+ if (lparam == WM_LBUTTONDBLCLK) self->action_(TrayAction::Open);
+ if (lparam == WM_RBUTTONUP || lparam == WM_CONTEXTMENU) {
+ HMENU menu = CreatePopupMenu();
+ AppendMenuW(menu, MF_STRING, 1, L"Open WSM");
+ AppendMenuW(menu, MF_STRING, 2, L"Stop macOS");
+ AppendMenuW(menu, MF_SEPARATOR, 0, nullptr);
+ AppendMenuW(menu, MF_STRING, 3, L"Quit WSM completely");
+ POINT point{}; GetCursorPos(&point); SetForegroundWindow(window);
+ const auto command = TrackPopupMenu(menu, TPM_RETURNCMD | TPM_NONOTIFY, point.x, point.y, 0, window, nullptr);
+ DestroyMenu(menu); PostMessageW(window, WM_NULL, 0, 0);
+ if (command >= 1 && command <= 3) self->action_(static_cast<TrayAction>(command - 1));
+ }
+ return 0;
+ }
+ if (message == WM_CLOSE) { DestroyWindow(window); return 0; }
+ if (message == WM_DESTROY) {
+ NOTIFYICONDATAW data{}; data.cbSize = sizeof(data); data.hWnd = window; data.uID = 1;
+ Shell_NotifyIconW(NIM_DELETE, &data); PostQuitMessage(0); return 0;
+ }
+ return DefWindowProcW(window, message, wparam, lparam);
+ }
+ std::atomic<HWND> window_{nullptr};
+ std::atomic<bool> stopping_{false};
+ std::function<void(TrayAction)> action_;
+ std::thread thread_;
+};
+}
diff --git a/src/wsm-runtime/include/wsm/vm_health.hpp b/src/wsm-runtime/include/wsm/vm_health.hpp
new file mode 100644
index 0000000..4c09276
--- /dev/null
+++ b/src/wsm-runtime/include/wsm/vm_health.hpp
@@ -0,0 +1,16 @@
+#pragma once
+#include <cctype>
+#include <string>
+namespace wsm::runtime {
+inline std::string qmp_status_name(const std::string& json) {
+ auto pos = json.find("\"status\"");
+ if (pos == std::string::npos || (pos = json.find(':', pos + 8)) == std::string::npos) return {};
+ do { ++pos; } while (pos < json.size() && std::isspace(static_cast<unsigned char>(json[pos])));
+ if (pos >= json.size() || json[pos] != '"') return {};
+ const auto end = json.find('"', ++pos);
+ return end == std::string::npos ? std::string{} : json.substr(pos, end - pos);
+}
+inline bool unexpected_setup_stop(const std::string& state) {
+ return state == "paused" || state == "internal-error" || state == "io-error" || state == "guest-panicked";
+}
+}
diff --git a/src/wsm-runtime/include/wsm/window_focus.hpp b/src/wsm-runtime/include/wsm/window_focus.hpp
new file mode 100644
index 0000000..24f0db1
--- /dev/null
+++ b/src/wsm-runtime/include/wsm/window_focus.hpp
@@ -0,0 +1,26 @@
+#pragma once
+#include <algorithm>
+#include <optional>
+#include <utility>
+#include <vector>
+
+namespace wsm::runtime {
+struct FocusBounds { int x, y, w, h, z; };
+inline bool guest_point_covered(int x, int y, int z, const std::vector<FocusBounds>& windows) {
+ for (const auto& w : windows)
+ if (w.z > z && x >= w.x && y >= w.y && x < w.x + w.w && y < w.y + w.h) return true;
+ return false;
+}
+inline std::optional<std::pair<int,int>> visible_title_point(const FocusBounds& w,
+ const std::vector<FocusBounds>& windows, int screen_w, int screen_h) {
+ const int y = w.y + 8;
+ if (w.h < 24 || y < 0 || y >= screen_h) return {};
+ const auto usable = [&](int x) { return x >= 0 && x < screen_w && !guest_point_covered(x, y, w.z, windows); };
+ const int center = w.x + w.w / 2;
+ if (usable(center)) return std::pair{center,y};
+ // Avoid the traffic lights and the outer rounded edge.
+ for (int x = w.x + std::min(110, w.w / 2); x < w.x + w.w - 28; x += 16)
+ if (usable(x)) return std::pair{x,y};
+ return {};
+}
+}
diff --git a/src/wsm-runtime/include/wsm/window_pixels.hpp b/src/wsm-runtime/include/wsm/window_pixels.hpp
new file mode 100644
index 0000000..0119885
--- /dev/null
+++ b/src/wsm-runtime/include/wsm/window_pixels.hpp
@@ -0,0 +1,26 @@
+#pragma once
+#include <algorithm>
+#include <cmath>
+#include <cstdint>
+#include <cstddef>
+
+namespace wsm::runtime {
+// Clip premultiplied BGRA geometrically. The pixels outside a Mac window can
+// belong to another app, so a desktop-colour key cannot identify its corners.
+inline void round_window_pixels(uint8_t* pixels, int width, int height, double radius) {
+ if (!pixels || width <= 0 || height <= 0) return;
+ radius = std::clamp(radius, 0.0, std::min(width, height) / 2.0);
+ if (radius < 1) return;
+ const int extent = static_cast<int>(std::ceil(radius));
+ for (int y = 0; y < extent; ++y) for (int x = 0; x < extent; ++x) {
+ const double dx = radius - x - 0.5, dy = radius - y - 0.5;
+ const double coverage = std::clamp(radius + 0.5 - std::sqrt(dx * dx + dy * dy), 0.0, 1.0);
+ if (coverage >= 1) continue;
+ const int xs[] = {x, width - 1 - x}, ys[] = {y, height - 1 - y};
+ for (int yy : ys) for (int xx : xs) {
+ auto p = pixels + (static_cast<size_t>(yy) * width + xx) * 4;
+ for (int c = 0; c < 4; ++c) p[c] = static_cast<uint8_t>(p[c] * coverage + 0.5);
+ }
+ }
+}
+}
diff --git a/src/wsm-runtime/include/wsm/window_streamer.hpp b/src/wsm-runtime/include/wsm/window_streamer.hpp
index 684b959..2d32c58 100644
--- a/src/wsm-runtime/include/wsm/window_streamer.hpp
+++ b/src/wsm-runtime/include/wsm/window_streamer.hpp
@@ -68,6 +68,8 @@ public:
void kick();
bool watching() const noexcept { return watching_.load(); }
+ bool desktop_ready() const noexcept { return watching_ && setup_detection_known_ && !setup_active_; }
+ bool launching() const { std::lock_guard<std::mutex> lock(mu_); return !pending_launches_.empty(); }
bool setup_active() const noexcept { return setup_active_.load(); }
bool setup_needs_attention() const noexcept { return setup_needs_attention_.load(); }
// Monotonic ms (steady_clock) of the last command, copy or input sent to the runtime.
@@ -107,8 +109,9 @@ private:
void apply_window_list(const std::string& line);
void sync_host_window(GuestWin& g);
bool lookup(uint64_t host_id, GuestWin& out) const;
- void queue_events(const std::string& events_json);
- void queue_abs(int gx, int gy);
+ bool focus_guest_window(const GuestWin& window, bool pointer_click = false, int x = 0, int y = 0);
+ void queue_events(const std::string& events_json, bool urgent = true);
+ void queue_abs(int gx, int gy, bool urgent = true);
std::string ssh_base() const;
int scp(const std::string& from, const std::string& to, uint32_t timeout_ms) const;
@@ -135,6 +138,7 @@ private:
mutable std::mutex mu_;
std::map<uint32_t, GuestWin> wins_;
+ std::map<std::string, int64_t> pending_launches_;
std::map<uint32_t, std::pair<int, int>> pid_offset_; // host = runtime + offset
std::map<uint32_t, int64_t> pid_empty_since_; // app lost its last window at
std::atomic<bool> kick_watch_{false};
@@ -163,6 +167,8 @@ private:
void* sh_out_ = nullptr;
std::atomic<int64_t> last_raise_ms_{0};
std::atomic<uint32_t> last_raise_pid_{0};
+ std::atomic<uint32_t> suppressed_buttons_{0};
+ float wheel_remainder_ = 0; // host UI thread; retain precise touchpad deltas
int screen_w_ = 1920, screen_h_ = 1080; // runtime screen, points
struct Frame { int w = 0, h = 0; std::vector<uint8_t> px; };
diff --git a/src/wsm-runtime/src/provisioner.cpp b/src/wsm-runtime/src/provisioner.cpp
index cd81431..a429d0f 100644
--- a/src/wsm-runtime/src/provisioner.cpp
+++ b/src/wsm-runtime/src/provisioner.cpp
@@ -1,3 +1,4 @@
+#include "wsm/child_processes.hpp"
#include "wsm/provisioner.hpp"
#include "wsm/host_probe.hpp"
#include "wsm/qmp_unix.hpp"
@@ -9,6 +10,8 @@
#include "wsm/runtime_storage.hpp"
#include "wsm/recovery_script.hpp"
#include "wsm/setup_resume.hpp"
+#include "wsm/ssh_tools.hpp"
+#include "wsm/vm_health.hpp"
#include <windows.h>
@@ -162,7 +165,7 @@ int Provisioner::reims(const std::string& args, std::string* out) const {
SetEnvironmentVariableA("XDG_DATA_HOME", env_data.c_str());
SetEnvironmentVariableA("XDG_CACHE_HOME", env_cache.c_str());
std::vector<char> buf(cmd.begin(), cmd.end()); buf.push_back(0);
- BOOL started = CreateProcessA(nullptr, buf.data(), nullptr, nullptr, TRUE, CREATE_NO_WINDOW, nullptr, root_.c_str(), &si, &pi);
+ BOOL started = wsm::runtime::create_owned_process_a(nullptr, buf.data(), nullptr, nullptr, TRUE, CREATE_NO_WINDOW, nullptr, root_.c_str(), &si, &pi);
if (nul != INVALID_HANDLE_VALUE) CloseHandle(nul);
if (!started) {
CloseHandle(rd); CloseHandle(wr);
@@ -203,6 +206,25 @@ bool Provisioner::vm_running() const {
return wsm::core::QmpUnixClient(vm_dir_ + "\\qmp.sock").execute("{\"execute\":\"query-status\"}", resp, 1500);
}
+bool Provisioner::recover_paused_setup_vm() {
+ std::string response;
+ if (!wsm::core::QmpUnixClient(vm_dir_ + "\\qmp.sock").execute("{\"execute\":\"query-status\"}", response, 1500)) return false;
+ const auto state = qmp_status_name(response);
+ if (!unexpected_setup_stop(state)) return false;
+ if (state == "io-error") {
+ fail("The macOS disk reported an I/O error. Check free space and save a diagnostic report before retrying.");
+ return true;
+ }
+ if (++setup_crash_restarts_ > 6) {
+ fail("The macOS runtime repeatedly stopped during setup. Your installer and disk are preserved; save a diagnostic report.");
+ return true;
+ }
+ log("setup runtime stopped (" + state + "); restarting the existing disk, attempt " + std::to_string(setup_crash_restarts_));
+ if (reims("stop " + vm_ + " --force") != 0 || reims("start " + vm_) != 0)
+ fail("WSM couldn't restart the stopped macOS runtime. Your installer and disk are preserved.");
+ return true;
+}
+
uint64_t Provisioner::disk_bytes() const {
std::error_code ec; auto s = fs::file_size(vm_dir_ + "\\disk.qcow2", ec); return ec ? 0 : s;
}
@@ -347,7 +369,12 @@ bool Provisioner::step_create_runtime() {
MEMORYSTATUSEX memory{}; memory.dwLength = sizeof(memory);
const uint64_t host_mib = GlobalMemoryStatusEx(&memory) ? memory.ullTotalPhys / (1024 * 1024) : 16384;
const std::string memory_arg = std::to_string(setup_memory_mib(host_mib)) + "M";
- int rc = reims("create wsm-default --macos tahoe --offline --memory " + memory_arg + " --cpus 4 --ssh-port 2222 --network false --audio false", &create_output);
+ // Use the discovered image explicitly: a newer Apple catalog must not turn a
+ // reusable local installer into another full macOS download.
+ const std::string source = p.reuse_installer
+ ? " --installer \"" + p.installer_path + "\""
+ : " --macos tahoe --offline";
+ int rc = reims("create wsm-default" + source + " --memory " + memory_arg + " --cpus 4 --ssh-port 2222 --network false --audio false", &create_output);
if (rc != 0) {
if (create_output.find("a VM named wsm-default already exists") != std::string::npos)
fail("A WSM runtime with this name is already registered elsewhere. Save a diagnostic report so the existing runtime can be located safely.");
@@ -356,6 +383,9 @@ bool Provisioner::step_create_runtime() {
return false;
}
reims("set wsm-default --env REIMS_VGPU_WINDOW=1");
+ // Keep the entire 128 GiB qcow2 L2 metadata table (16 MiB) in RAM during installation so
+ // macOS's ~200 GB of install I/O never thrashes NTFS with metadata seeks.
+ reims("set wsm-default --extra-args \"-set drive.disk.l2-cache-size=32M\"");
return true;
}
@@ -364,7 +394,14 @@ bool Provisioner::step_boot_recovery(bool* setup_detected) {
set(ProvState::BootingRecovery, 42, "Starting the macOS installer");
if (!vm_running() && reims("start wsm-default") != 0) { fail("The macOS installer didn't start."); return false; }
// Recovery's desktop is a mostly-dark full-screen picture; wait until it has drawn and settled.
+ // On a retry of an already-installed macOS, sshd can answer while the screen is still on the
+ // Apple boot logo (< 2% lit); detect that here so retries never time out at 42%.
for (int t = 0; t < 600; t += 5) {
+ if (recover_paused_setup_vm()) {
+ if (snapshot().state == ProvState::Failed) return false;
+ Sleep(5000); continue;
+ }
+ if (t > 0 && t % 15 == 0 && ssh_ok(5000, false)) break;
double lit = screen_fraction_nonblack();
if (lit > 0.02) { Sleep(15000); break; }
Sleep(5000);
@@ -374,30 +411,39 @@ bool Provisioner::step_boot_recovery(bool* setup_detected) {
// (e.g. Country) or the already-configured desktop/MiniBuddy (SSH reachable). Detect both
// before open_recovery_terminal(), because sending Esc on Setup Assistant opens VoiceOver
// Tutorial and makes Recovery Terminal retries fail.
- if (ssh_ok(8000, false)) {
- log("booting recovery: installed macOS account is already reachable; preserving disk and continuing sign-in");
- std::error_code ec;
- fs::remove(vm_dir_ + "\\wsm-installing", ec);
- if (setup_detected) *setup_detected = true;
- return true;
- }
- std::vector<uint8_t> frame; int fw = 0, fh = 0;
- if (screen_dump(frame, fw, fh)) {
- const auto first = recognize_setup_assistant(frame.data(), fw, fh);
- if (first.step != SetupAssistantStep::Unknown) {
- Sleep(2000);
- std::vector<uint8_t> confirm; int cw = 0, ch = 0;
- if (screen_dump(confirm, cw, ch) &&
- recognize_setup_assistant(confirm.data(), cw, ch).step == first.step) {
- log("booting recovery: installed macOS Setup Assistant detected; preserving disk and continuing account setup");
- std::error_code ec;
- fs::remove(vm_dir_ + "\\wsm-installing", ec);
- if (setup_detected) *setup_detected = true;
- return true;
+ auto detect_installed_macos = [&](const char* phase) {
+ if (ssh_ok(8000, false)) {
+ log(std::string("booting recovery (") + phase + "): installed macOS account is already reachable; preserving disk and continuing sign-in");
+ std::error_code ec;
+ fs::remove(vm_dir_ + "\\wsm-installing", ec);
+ if (setup_detected) *setup_detected = true;
+ return true;
+ }
+ std::vector<uint8_t> frame; int fw = 0, fh = 0;
+ if (screen_dump(frame, fw, fh)) {
+ const auto first = recognize_setup_assistant(frame.data(), fw, fh);
+ if (first.step != SetupAssistantStep::Unknown) {
+ Sleep(2000);
+ std::vector<uint8_t> confirm; int cw = 0, ch = 0;
+ if (screen_dump(confirm, cw, ch) &&
+ recognize_setup_assistant(confirm.data(), cw, ch).step == first.step) {
+ log(std::string("booting recovery (") + phase + "): installed macOS Setup Assistant detected; preserving disk and continuing account setup");
+ std::error_code ec;
+ fs::remove(vm_dir_ + "\\wsm-installing", ec);
+ if (setup_detected) *setup_detected = true;
+ return true;
+ }
}
}
+ return false;
+ };
+ if (detect_installed_macos("pre-terminal")) return true;
+ if (!open_recovery_terminal()) {
+ // An already-installed macOS can finish booting while Recovery Terminal retries run.
+ if (detect_installed_macos("post-terminal")) return true;
+ fail("WSM couldn't take control of the macOS installer.");
+ return false;
}
- if (!open_recovery_terminal()) { fail("WSM couldn't take control of the macOS installer."); return false; }
return true;
}
@@ -448,8 +494,10 @@ bool Provisioner::step_install() {
"/tmp/wsm-copy.log")) {
fail("WSM couldn't send the installer copy command. Save a diagnostic report."); return false;
}
- if (verdict(1800, "installer copy", [this](int t) {
- std::lock_guard<std::mutex> l(mu_); snap_.percent = 50 + std::min(8.0, t / 60.0); }) != Verdict::Green) {
+ if (verdict(7200, "installer copy", [this](int t) {
+ std::lock_guard<std::mutex> l(mu_); snap_.percent = 50 + std::min(7.0, t / 60.0);
+ snap_.detail = "Preparing the local installer; " + std::to_string(t / 60) + " min elapsed. Your downloaded installer is kept.";
+ }) != Verdict::Green) {
fail("The macOS installer couldn't be copied to the disk."); return false;
}
@@ -476,9 +524,13 @@ bool Provisioner::step_wait_first_boot() {
const auto began = std::chrono::steady_clock::now();
int last_detail_minute = -1;
int last_wake = -60;
+ bool first_poll = true;
for (int t = 0; t < 4 * 3600;) {
- const int interval = t < 180 ? 5 : 20;
- Sleep(interval * 1000);
+ if (!first_poll) {
+ const int interval = t < 180 ? 5 : 10;
+ Sleep(interval * 1000);
+ }
+ first_poll = false;
t = static_cast<int>(std::chrono::duration_cast<std::chrono::seconds>(std::chrono::steady_clock::now() - began).count());
if (t / 60 != last_detail_minute) {
last_detail_minute = t / 60;
@@ -491,6 +543,10 @@ bool Provisioner::step_wait_first_boot() {
reims("start wsm-default");
continue;
}
+ if (recover_paused_setup_vm()) {
+ if (snapshot().state == ProvState::Failed) return false;
+ continue;
+ }
// Recognize a stable first-boot Setup Assistant screen before the Recovery error-color
// heuristic. Country/Welcome screens can contain enough red pixels to look like the
// synthetic failure verdict; a confirmed known setup screen is stronger evidence.
@@ -544,8 +600,8 @@ bool Provisioner::step_wait_first_boot() {
wsm::core::QmpUnixClient q(vm_dir_ + "\\qmp.sock");
std::string response;
q.execute("{\"execute\":\"input-send-event\",\"arguments\":{\"events\":["
- "{\"type\":\"abs\",\"data\":{\"axis\":\"x\",\"value\":16000}},"
- "{\"type\":\"abs\",\"data\":{\"axis\":\"y\",\"value\":16000}}]}}", response);
+ "{\"type\":\"abs\",\"data\":{\"axis\":\"x\",\"value\":1000}},"
+ "{\"type\":\"abs\",\"data\":{\"axis\":\"y\",\"value\":1000}}]}}", response);
q.send_key_qcode("shift");
}
}
@@ -570,11 +626,45 @@ int run_quiet(const std::string& cmdline, DWORD timeout_ms) {
si.dwFlags = STARTF_USESHOWWINDOW; si.wShowWindow = SW_HIDE;
PROCESS_INFORMATION pi{};
std::string cl = cmdline;
- if (!CreateProcessA(nullptr, cl.data(), nullptr, nullptr, FALSE, CREATE_NO_WINDOW, nullptr, nullptr, &si, &pi)) return -1;
+ if (!wsm::runtime::create_owned_process_a(nullptr, cl.data(), nullptr, nullptr, FALSE, CREATE_NO_WINDOW, nullptr, nullptr, &si, &pi)) return -1;
+ if (WaitForSingleObject(pi.hProcess, timeout_ms) != WAIT_OBJECT_0) TerminateProcess(pi.hProcess, 255);
+ DWORD code = 255;
+ GetExitCodeProcess(pi.hProcess, &code);
+ CloseHandle(pi.hThread); CloseHandle(pi.hProcess);
+ return static_cast<int>(code);
+}
+
+int run_quiet_capture(const std::string& cmdline, DWORD timeout_ms, std::string& out) {
+ out.clear();
+ SECURITY_ATTRIBUTES sa{sizeof(sa), nullptr, TRUE};
+ HANDLE rd = nullptr, wr = nullptr;
+ if (!CreatePipe(&rd, &wr, &sa, 0)) return -1;
+ SetHandleInformation(rd, HANDLE_FLAG_INHERIT, 0);
+ HANDLE nul = CreateFileA("NUL", GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, &sa, OPEN_EXISTING, 0, nullptr);
+ STARTUPINFOA si{}; si.cb = sizeof(si);
+ si.dwFlags = STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES;
+ si.wShowWindow = SW_HIDE;
+ si.hStdInput = nul; si.hStdOutput = wr; si.hStdError = wr;
+ PROCESS_INFORMATION pi{};
+ std::string cl = cmdline;
+ BOOL started = wsm::runtime::create_owned_process_a(nullptr, cl.data(), nullptr, nullptr, TRUE, CREATE_NO_WINDOW, nullptr, nullptr, &si, &pi);
+ if (nul != INVALID_HANDLE_VALUE) CloseHandle(nul);
+ CloseHandle(wr);
+ if (!started) { CloseHandle(rd); return -1; }
if (WaitForSingleObject(pi.hProcess, timeout_ms) != WAIT_OBJECT_0) TerminateProcess(pi.hProcess, 255);
+ DWORD avail = 0;
+ while (PeekNamedPipe(rd, nullptr, 0, nullptr, &avail, nullptr) && avail > 0 && out.size() < 512) {
+ char buf[256];
+ DWORD got = 0;
+ const DWORD want = std::min<DWORD>(avail, sizeof(buf));
+ if (!ReadFile(rd, buf, want, &got, nullptr) || got == 0) break;
+ out.append(buf, got);
+ }
DWORD code = 255;
GetExitCodeProcess(pi.hProcess, &code);
+ CloseHandle(rd);
CloseHandle(pi.hThread); CloseHandle(pi.hProcess);
+ while (!out.empty() && (out.back() == '\r' || out.back() == '\n' || out.back() == ' ')) out.pop_back();
return static_cast<int>(code);
}
@@ -596,13 +686,14 @@ std::string kcpassword(const std::string& pw) {
} // namespace
bool Provisioner::make_payload(std::string& dir, std::string& err) {
+ if (!ssh_tools_available()) { err = ssh_tools_missing_message(); return false; }
const std::string guest = root_ + "\\runtime\\config\\guest";
const std::string key = guest + "\\id_ed25519", pwfile = guest + "\\password";
std::error_code ec;
fs::create_directories(guest, ec);
// The runtime's SSH key: made once, on this PC, never shipped.
if (!fs::exists(key, ec)) {
- int rc = run_quiet("\"C:\\Windows\\System32\\OpenSSH\\ssh-keygen.exe\" -q -t ed25519 -N \"\" -C wsm-runtime -f \"" + key + "\"", 60000);
+ int rc = run_quiet(ssh_tool_command("ssh-keygen") + " -q -t ed25519 -N \"\" -C wsm-runtime -f \"" + key + "\"", 60000);
if (rc != 0 || !fs::exists(key + ".pub", ec)) { err = "Windows' OpenSSH client (ssh-keygen) isn't available."; return false; }
}
// OpenSSH refuses a private key other accounts can read.
@@ -739,7 +830,7 @@ bool Provisioner::boot_into_recovery() {
bool Provisioner::request_guest_restart() const {
const std::string key = ssh_private_key_path(root_);
if (key.empty()) return false;
- const std::string cmd = "\"C:\\Windows\\System32\\OpenSSH\\ssh.exe\" -i \"" + key + "\"" +
+ const std::string cmd = ssh_tool_command("ssh") + " -i \"" + key + "\"" +
" -o IdentitiesOnly=yes -o BatchMode=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=NUL -o LogLevel=ERROR"
" -o ConnectTimeout=8 -p " + std::to_string(ssh_port_) +
" [email protected] \"sudo -n /sbin/shutdown -r now\"";
@@ -749,7 +840,7 @@ bool Provisioner::request_guest_restart() const {
bool Provisioner::ssh_ok(uint32_t timeout_ms, bool require_desktop) const {
const std::string key = ssh_private_key_path(root_);
if (key.empty()) return false;
- std::string cmd = "\"C:\\Windows\\System32\\OpenSSH\\ssh.exe\" -i \"" + key + "\"" +
+ std::string cmd = ssh_tool_command("ssh") + " -i \"" + key + "\"" +
" -o IdentitiesOnly=yes -o BatchMode=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=NUL -o LogLevel=ERROR"
" -o ConnectTimeout=8 -p " + std::to_string(ssh_port_) +
// sshd answers before anyone is signed in: ready means WSM's account owns the
@@ -762,8 +853,22 @@ bool Provisioner::ssh_ok(uint32_t timeout_ms, bool require_desktop) const {
return run_quiet(cmd, timeout_ms) == 0;
}
+bool Provisioner::ssh_signin_status(uint32_t timeout_ms, std::string& summary) const {
+ const std::string key = ssh_private_key_path(root_);
+ if (key.empty()) return false;
+ const std::string cmd = ssh_tool_command("ssh") + " -i \"" + key + "\"" +
+ " -o IdentitiesOnly=yes -o BatchMode=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=NUL -o LogLevel=ERROR"
+ " -o ConnectTimeout=8 -p " + std::to_string(ssh_port_) +
+ " [email protected] \"sudo -n true && echo console=$(stat -f %Su /dev/console) "
+ "finder=$(pgrep -x Finder | wc -l | tr -d ' ') "
+ "sa=$(pgrep -x 'Setup Assistant' | wc -l | tr -d ' ') "
+ "sb=$(pgrep -x SetupAssistantSpringboard | wc -l | tr -d ' ') "
+ "uau=$(pgrep -x UserAccountUpdater | wc -l | tr -d ' ')\"";
+ return run_quiet_capture(cmd, timeout_ms, summary) == 0;
+}
+
// Only act on an exactly recognised setup screen, never an arbitrary blue button.
-bool Provisioner::click_blue_button() {
+bool Provisioner::click_blue_button(int* clicked_step) {
std::vector<uint8_t> px; int w = 0, h = 0;
if (!screen_dump(px, w, h)) return false;
const auto first = recognize_setup_assistant(px.data(), w, h);
@@ -771,8 +876,9 @@ bool Provisioner::click_blue_button() {
Sleep(500);
if (!screen_dump(px, w, h)) return false;
const auto second = recognize_setup_assistant(px.data(), w, h);
- if (second.step != first.step || second.x != first.x || second.y != first.y) return false;
+ if (second.step != first.step || std::abs(second.x - first.x) > 128 || std::abs(second.y - first.y) > 128) return false;
log("handling a recognised first-sign-in setup screen (step " + std::to_string(static_cast<int>(first.step)) + ")");
+ if (clicked_step) *clicked_step = static_cast<int>(first.step);
return wsm::core::QmpUnixClient(vm_dir_ + "\\qmp.sock").send_mouse_click(first.x, first.y);
}
@@ -787,7 +893,9 @@ bool Provisioner::step_first_boot_setup() {
if (!make_payload(dir, err)) { fail(err); return false; }
// The payload as a read-only FAT stick, only for this boot.
- reims("stop " + vm_);
+ // macOS is at the read-only Setup Assistant Country screen, which ignores ACPI shutdown;
+ // force-stopping here avoids a 90 s ACPI timeout before Recovery starts.
+ reims("stop " + vm_ + " --force");
if (reims("set " + vm_ + " --extra-args \"" + payload_extra_args(dir) + "\"") != 0) {
fail("WSM couldn't attach its setup files to Recovery. Save a diagnostic report.");
return false;
@@ -829,7 +937,16 @@ bool Provisioner::step_first_boot_setup() {
for (int i = 0; i < 60 && vm_running(); ++i) Sleep(1000);
}
reims("stop " + vm_ + " --force"); // only if it's somehow still there
- reims("set " + vm_ + " --extra-args \"\"");
+ // Enable the fast runtime QEMU options immediately before 96% first boot (VNC frame push,
+ // 32 MiB qcow2 L2 cache, detect-zeroes, and dedicated input/capture QMP sockets) so apps
+ // launch with low latency the instant setup finishes without requiring an extra restart.
+ {
+ std::string d = vm_dir_;
+ for (auto& c : d) if (c == '\\') c = '/';
+ reims("set " + vm_ + " --extra-args \"-vnc 127.0.0.1:15,display=gfx -set drive.disk.detect-zeroes=on -set drive.disk.l2-cache-size=32M"
+ " -qmp " + qemu_extra_arg("unix:" + qemu_option_path(d) + "/wsm-in.sock,server=on,wait=off") +
+ " -qmp " + qemu_extra_arg("unix:" + qemu_option_path(d) + "/wsm-cap.sock,server=on,wait=off") + "\"");
+ }
std::error_code ec;
fs::remove_all(dir, ec); // holds the password in clear text
if (!ok) { fail(err); return false; }
@@ -855,10 +972,39 @@ bool Provisioner::wait_for_first_sign_in() {
const auto start = std::chrono::steady_clock::now();
int last_click = 0;
int last_diag_frame = -30;
+ int last_diag_log = -60;
+ int last_ssh_probe = -15;
+ int last_wake = -60;
int welcome_since = -1;
+ int ssh_stalled_since = -1;
+ int last_clicked_step = 0;
+ int same_step_clicks = 0;
+ int stopped_restarts = 0;
const bool new_install = !fs::exists(root_ + "\\runtime\\config\\runtime-ready.json");
const auto restart_marker = vm_dir_ + "\\wsm-welcome-restart";
bool restart_attempted = fs::exists(restart_marker);
+ int uau_since = -1;
+ bool uau_unstuck = false;
+ auto unstick_account_updater = [&]() {
+ const std::string key = ssh_private_key_path(root_);
+ if (key.empty()) return false;
+ const std::string cmd = ssh_tool_command("ssh") + " -i \"" + key + "\"" +
+ " -o IdentitiesOnly=yes -o BatchMode=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=NUL -o LogLevel=ERROR"
+ " -o ConnectTimeout=8 -p " + std::to_string(ssh_port_) +
+ " [email protected] \"V=$(defaults read /System/Library/CoreServices/SystemVersion ProductVersion 2>/dev/null); "
+ "B=$(defaults read /System/Library/CoreServices/SystemVersion ProductBuildVersion 2>/dev/null); "
+ "if [ -n \\\"$V\\\" ] && [ -n \\\"$B\\\" ]; then "
+ "defaults write com.apple.loginwindow BuildVersionStampAsString -string \\\"$B\\\"; "
+ "defaults write com.apple.loginwindow SystemVersionStampAsString -string \\\"$V\\\"; "
+ "defaults write com.apple.loginwindow lastUpdatedBuildVersion -string \\\"$B\\\"; "
+ "defaults write com.apple.loginwindow lastUpdatedSystemVersion -string \\\"$V\\\"; "
+ "defaults write com.apple.UserAccountUpdater lastUpdatedBuildVersion -string \\\"$B\\\"; "
+ "defaults write com.apple.UserAccountUpdater lastUpdatedSystemVersion -string \\\"$V\\\"; fi; "
+ "sudo -n pkill -TERM -x IndexSettings 2>/dev/null; "
+ "sudo -n pkill -TERM -x languageassetd 2>/dev/null; sleep 2; "
+ "sudo -n pkill -9 -x UserAccountUpdater 2>/dev/null; true\"";
+ return run_quiet(cmd, 15000) == 0;
+ };
auto save_signin_screen = [&]() {
std::vector<uint8_t> snap; int sw = 0, sh = 0;
if (!screen_dump(snap, sw, sh)) return;
@@ -870,39 +1016,129 @@ bool Provisioner::wait_for_first_sign_in() {
for (;;) {
const auto elapsed = std::chrono::duration_cast<std::chrono::seconds>(std::chrono::steady_clock::now() - start).count();
if (elapsed >= 20 * 60) break;
+ if (!vm_running()) {
+ Sleep(3000);
+ if (!vm_running()) {
+ if (++stopped_restarts > 6) {
+ fail("The macOS runtime repeatedly stopped during first sign-in. Save a diagnostic report.");
+ return false;
+ }
+ log("runtime stopped during first sign-in; starting it again (attempt " + std::to_string(stopped_restarts) + ")");
+ reims("start " + vm_);
+ welcome_since = -1;
+ ssh_stalled_since = -1;
+ Sleep(5000);
+ continue;
+ }
+ }
+ if (recover_paused_setup_vm()) {
+ if (snapshot().state == ProvState::Failed) return false;
+ welcome_since = -1;
+ ssh_stalled_since = -1;
+ Sleep(5000); continue;
+ }
if (ssh_ok(8000)) { log("first-boot setup: runtime reachable after " + std::to_string(elapsed) + " s"); return true; }
{
std::lock_guard<std::mutex> l(mu_);
snap_.detail = "Waiting for the macOS desktop; " + std::to_string(elapsed / 60) + " min elapsed.";
}
- if (static_cast<int>(elapsed) - last_diag_frame >= 30) {
+ const int now_s = static_cast<int>(elapsed);
+ if (now_s - last_diag_frame >= 30) {
save_signin_screen();
- last_diag_frame = static_cast<int>(elapsed);
+ last_diag_frame = now_s;
}
- if (new_install && !restart_attempted) {
+ SetupAssistantStep current_step = SetupAssistantStep::Unknown;
+ {
std::vector<uint8_t> pixels; int w = 0, h = 0;
- const bool pending = screen_dump(pixels, w, h) &&
- recognize_setup_assistant(pixels.data(), w, h).step == SetupAssistantStep::WelcomePending;
- if (!pending) welcome_since = -1;
- else if (welcome_since < 0) welcome_since = static_cast<int>(elapsed);
- if (pending && welcome_restart_due(new_install, restart_attempted, static_cast<int>(elapsed) - welcome_since) && ssh_ok(10000, false)) {
- // This is the final welcome animation, not installation or an account/security
- // prompt. A graceful restart completed it on the affected runtime. Limit this
- // recovery to a new installation and persist the attempt to prevent reboot loops.
+ if (screen_dump(pixels, w, h)) {
+ current_step = recognize_setup_assistant(pixels.data(), w, h).step;
+ if (now_s - last_wake >= 60 && screen_fraction_nonblack() <= 0.05) {
+ last_wake = now_s;
+ wsm::core::QmpUnixClient q(vm_dir_ + "\\qmp.sock");
+ std::string response;
+ q.execute("{\"execute\":\"input-send-event\",\"arguments\":{\"events\":["
+ "{\"type\":\"abs\",\"data\":{\"axis\":\"x\",\"value\":1000}},"
+ "{\"type\":\"abs\",\"data\":{\"axis\":\"y\",\"value\":1000}}]}}", response);
+ q.send_key_qcode("shift");
+ }
+ }
+ }
+ if (current_step == SetupAssistantStep::WelcomePending) {
+ if (welcome_since < 0) welcome_since = now_s;
+ } else {
+ welcome_since = -1;
+ }
+ if (now_s >= 30 && now_s - last_click >= 10) {
+ int clicked_step = 0;
+ const bool clicked = click_blue_button(&clicked_step);
+ last_click = now_s;
+ if (clicked) {
+ if (clicked_step != last_clicked_step) {
+ last_clicked_step = clicked_step;
+ same_step_clicks = 1;
+ ssh_stalled_since = -1;
+ } else {
+ ++same_step_clicks;
+ if (same_step_clicks < 6) ssh_stalled_since = -1;
+ }
+ welcome_since = -1;
+ }
+ }
+ if (now_s >= 30 && now_s - last_ssh_probe >= 15) {
+ last_ssh_probe = now_s;
+ std::string status;
+ if (ssh_signin_status(8000, status)) {
+ // Never treat active first-login account initialization (UserAccountUpdater) as
+ // a stall; rebooting mid-initialization forces macOS to redo it from scratch.
+ const bool initializing_account = status.find("uau=0") == std::string::npos;
+ if (initializing_account) {
+ ssh_stalled_since = -1;
+ if (uau_since < 0) uau_since = now_s;
+ if (!uau_unstuck && now_s - uau_since >= 180) {
+ uau_unstuck = true;
+ log("UserAccountUpdater hung for 180 s during first sign-in; clearing hung updater so Finder can start");
+ unstick_account_updater();
+ uau_since = -1;
+ }
+ } else {
+ uau_since = -1;
+ if (ssh_stalled_since < 0) ssh_stalled_since = now_s;
+ }
+ if (now_s - last_diag_log >= 60) {
+ log("first-sign-in waiting (" + std::to_string(now_s) + " s): " + status +
+ " step=" + std::to_string(static_cast<int>(current_step)));
+ last_diag_log = now_s;
+ }
+ } else {
+ ssh_stalled_since = -1;
+ }
+ }
+ if (new_install && !restart_attempted) {
+ const int welcome_elapsed = welcome_since >= 0 ? now_s - welcome_since : 0;
+ const int ssh_stalled = ssh_stalled_since >= 0 ? now_s - ssh_stalled_since : 0;
+ const bool welcome_due = welcome_restart_due(new_install, restart_attempted, welcome_elapsed);
+ if (first_sign_in_restart_due(new_install, restart_attempted, welcome_elapsed, ssh_stalled) &&
+ (ssh_stalled >= 180 || ssh_ok(10000, false))) {
+ // Offline setup already succeeded (SSH + passwordless sudo work), but macOS is
+ // stuck on the final Welcome animation or stalled before Finder/desktop appears.
+ // One graceful guest restart resolves this on Tahoe. Persist the marker so this
+ // recovery runs at most once per new installation and can never reboot-loop.
std::ofstream marker(restart_marker, std::ios::binary);
- marker << "one graceful final-welcome restart\n"; marker.close();
+ marker << (welcome_due ? "one graceful final-welcome restart\n" : "one graceful first-sign-in stall restart\n");
+ marker.close();
if (!marker) { fail("WSM couldn't save its setup recovery state. Save a diagnostic report."); return false; }
restart_attempted = true;
- log("final Welcome animation stalled for 120 s; requesting one graceful macOS restart");
+ welcome_since = -1;
+ ssh_stalled_since = -1;
+ log(welcome_due
+ ? "final Welcome animation stalled for 120 s; requesting one graceful macOS restart"
+ : "SSH reachable for 180 s without desktop progress; requesting one graceful macOS restart");
const bool accepted = request_guest_restart();
- log(accepted ? "graceful Welcome restart accepted" : "Welcome restart request ended; waiting to verify the desktop");
+ log(accepted ? "graceful first-sign-in restart accepted" : "first-sign-in restart request ended; waiting to verify the desktop");
Sleep(10000);
continue;
}
}
- if (elapsed >= 60 && elapsed - last_click >= 15) {
- click_blue_button(); last_click = static_cast<int>(elapsed);
- }
Sleep(5000);
}
save_signin_screen();
@@ -911,12 +1147,14 @@ bool Provisioner::wait_for_first_sign_in() {
}
bool Provisioner::repair_first_boot(const std::string& vm, int ssh_port, std::string& err) {
+ if (!ssh_tools_available()) { err = ssh_tools_missing_message(); return false; }
if (running_.exchange(true)) { err = "Setup is already running."; return false; }
vm_ = vm;
ssh_port_ = ssh_port;
vm_dir_ = root_ + "\\runtime\\reims-ctl\\vms\\" + vm;
{ std::lock_guard<std::mutex> l(mu_); snap_ = {}; }
if (worker_.joinable()) worker_.join();
+ setup_crash_restarts_ = 0;
worker_ = std::thread([this] {
SetupLock lock(root_);
if (step_first_boot_setup()) {
@@ -966,7 +1204,9 @@ bool Provisioner::begin(bool license_accepted, std::string& err) {
}
void Provisioner::run() {
+ setup_crash_restarts_ = 0;
set(ProvState::Preparing, 1, "Checking this PC");
+ if (!ssh_tools_available()) { fail(ssh_tools_missing_message()); return; }
if (!fs::exists(reims_ctl_)) { fail("WSM's runtime components are missing. Reinstall WSM."); return; }
const auto whpx = wsm::core::probe_whpx(true);
if (!whpx.hypervisor_present || !whpx.partition_create_verified) {
diff --git a/src/wsm-runtime/src/runtime_host.cpp b/src/wsm-runtime/src/runtime_host.cpp
index 98b033a..f8cfdd3 100644
--- a/src/wsm-runtime/src/runtime_host.cpp
+++ b/src/wsm-runtime/src/runtime_host.cpp
@@ -1,6 +1,9 @@
+#include "wsm/child_processes.hpp"
#include "wsm/runtime_host.hpp"
#include "wsm/qmp_unix.hpp"
#include "wsm/qemu_extra_args.hpp"
+#include "wsm/process_identity.hpp"
+#include "wsm/vm_health.hpp"
#include <windows.h>
#include <psapi.h>
@@ -46,7 +49,7 @@ int RuntimeHost::reims(const std::string& args, std::string* out) const {
si.hStdOutput = wr; si.hStdError = wr; si.hStdInput = nul; // never wait on an input nobody gives
PROCESS_INFORMATION pi{};
std::vector<char> buf(cmd.begin(), cmd.end()); buf.push_back(0);
- BOOL started = CreateProcessA(nullptr, buf.data(), nullptr, nullptr, TRUE, CREATE_NO_WINDOW, nullptr, root_.c_str(), &si, &pi);
+ BOOL started = wsm::runtime::create_owned_process_a(nullptr, buf.data(), nullptr, nullptr, TRUE, CREATE_NO_WINDOW, nullptr, root_.c_str(), &si, &pi);
if (nul != INVALID_HANDLE_VALUE) CloseHandle(nul);
if (!started) {
CloseHandle(rd); CloseHandle(wr); return -1;
@@ -67,12 +70,7 @@ uint32_t RuntimeHost::pid() const {
std::ifstream f(vm_dir_ + "\\qemu.pid");
uint32_t p = 0;
if (!(f >> p) || !p) return 0;
- HANDLE h = OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION | SYNCHRONIZE, FALSE, p);
- if (!h) return 0;
- DWORD code = 0;
- bool alive = GetExitCodeProcess(h, &code) && code == STILL_ACTIVE;
- CloseHandle(h);
- return alive ? p : 0;
+ return process_runs_executable(p, root_ + "\\runtime\\reims-ctl\\qemu\\current\\bin\\qemu-system-x86_64.exe") ? p : 0;
}
bool RuntimeHost::qmp(const std::string& json, std::string& resp, uint32_t timeout_ms) const {
@@ -126,8 +124,39 @@ bool RuntimeHost::ensure_running(std::string& err, uint64_t* took_ms) {
// (two QEMUs on one disk) or change its options meanwhile.
if (std::filesystem::exists(root_ + "\\runtime\\config\\setup-running")) { err = "macOS is still being set up."; return false; }
if (st.state == RtState::Running || st.state == RtState::Starting) return done();
- if (st.state == RtState::Paused) { if (!resume(err)) return false; return done(); }
+ if (st.state == RtState::Paused) {
+ if (!resume(err)) return false;
+ Sleep(250);
+ if (status().state != RtState::Paused) return done();
+ std::ifstream log_file(vm_dir_ + "\\qemu.log", std::ios::binary | std::ios::ate);
+ std::string tail;
+ if (log_file) {
+ const auto end = log_file.tellg();
+ log_file.seekg(end > std::streamoff(8192) ? end - std::streamoff(8192) : std::streampos(0));
+ tail.assign(std::istreambuf_iterator<char>(log_file), {});
+ }
+ if (tail.find("WHPX: Unexpected VP exit code 4") == std::string::npos) {
+ err = "The macOS runtime remains paused. Save a diagnostic report in Settings.";
+ return false;
+ }
+ std::lock_guard<std::mutex> l(mu_);
+ if (reims("stop " + vm_ + " --force") != 0 || reims("start " + vm_) != 0) {
+ err = "The stopped macOS runtime couldn't be restarted."; return false;
+ }
+ return done();
+ }
std::lock_guard<std::mutex> l(mu_);
+ // A PID may now belong to another program. Preserve its file for diagnostics, and
+ // never let a stale PID prevent startup or cause an unrelated process to be stopped.
+ if (!pid() && fs::exists(vm_dir_ + "\\qemu.pid")) {
+ std::string reply;
+ if (qmp("{\"execute\":\"query-status\"}", reply, 500)) {
+ err = "The runtime process identity couldn't be verified. Save a diagnostic report."; return false;
+ }
+ std::error_code ec;
+ fs::rename(vm_dir_ + "\\qemu.pid", vm_dir_ + "\\qemu.pid.stale-" + std::to_string(GetTickCount64()), ec);
+ if (ec) { err = "WSM couldn't preserve the stale runtime process record."; return false; }
+ }
apply_profile();
std::string out;
if (reims("start " + vm_, &out) != 0) { err = "The macOS runtime didn't start."; return false; }
@@ -158,8 +187,9 @@ void RuntimeHost::apply_profile() {
// held open for input and frame capture (QEMU serves one client per QMP socket).
std::string d = vm_dir_;
for (auto& c : d) if (c == '\\') c = '/';
- if (all.find("unix:" + d + "/wsm-cap.sock") == std::string::npos) {
- reims("set " + vm_ + " --extra-args \"-vnc 127.0.0.1:15,display=gfx -set drive.disk.detect-zeroes=on"
+ if (all.find("unix:" + d + "/wsm-cap.sock") == std::string::npos ||
+ all.find("l2-cache-size=32M") == std::string::npos) {
+ reims("set " + vm_ + " --extra-args \"-vnc 127.0.0.1:15,display=gfx -set drive.disk.detect-zeroes=on -set drive.disk.l2-cache-size=32M"
" -qmp " + qemu_extra_arg("unix:" + qemu_option_path(d) + "/wsm-in.sock,server=on,wait=off") +
" -qmp " + qemu_extra_arg("unix:" + qemu_option_path(d) + "/wsm-cap.sock,server=on,wait=off") + "\"");
}
@@ -216,7 +246,7 @@ bool RuntimeHost::compact(std::string& err, uint64_t* before_bytes, uint64_t* af
si.dwFlags = STARTF_USESHOWWINDOW; si.wShowWindow = SW_HIDE;
PROCESS_INFORMATION pi{};
std::string cl = cmdline;
- if (!CreateProcessA(nullptr, cl.data(), nullptr, nullptr, FALSE, CREATE_NO_WINDOW | BELOW_NORMAL_PRIORITY_CLASS,
+ if (!wsm::runtime::create_owned_process_a(nullptr, cl.data(), nullptr, nullptr, FALSE, CREATE_NO_WINDOW | BELOW_NORMAL_PRIORITY_CLASS,
nullptr, nullptr, &si, &pi)) return -1;
DWORD w = WaitForSingleObject(pi.hProcess, timeout_ms);
if (w != WAIT_OBJECT_0) TerminateProcess(pi.hProcess, 1);
diff --git a/src/wsm-runtime/src/runtime_password.cpp b/src/wsm-runtime/src/runtime_password.cpp
index 71bc708..51751ce 100644
--- a/src/wsm-runtime/src/runtime_password.cpp
+++ b/src/wsm-runtime/src/runtime_password.cpp
@@ -1,6 +1,8 @@
+#include "wsm/child_processes.hpp"
#include "wsm/runtime_password.hpp"
#include "wsm/guest_app_path.hpp"
#include "wsm/ssh_private_key.hpp"
+#include "wsm/ssh_tools.hpp"
#include <windows.h>
#include <filesystem>
#include <fstream>
@@ -33,14 +35,14 @@ int run_guest_script(const std::string& root, const std::string& script) {
if (nul == INVALID_HANDLE_VALUE) { CloseHandle(read_pipe); CloseHandle(write_pipe); return -1; }
std::string key = ssh_private_key_path(root);
if (key.empty()) { CloseHandle(read_pipe); CloseHandle(write_pipe); CloseHandle(nul); return -1; }
- std::string cmd = "\"C:\\Windows\\System32\\OpenSSH\\ssh.exe\" -T -i \"" + key +
+ std::string cmd = ssh_tool_command("ssh") + " -T -i \"" + key +
"\" -p 2222 -o IdentitiesOnly=yes -o BatchMode=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=NUL"
" -o LogLevel=ERROR -o ConnectTimeout=8 [email protected] /bin/sh -s";
STARTUPINFOA si{}; si.cb = sizeof(si); si.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW;
si.wShowWindow = SW_HIDE; si.hStdInput = read_pipe; si.hStdOutput = nul; si.hStdError = nul;
PROCESS_INFORMATION pi{};
std::vector<char> line(cmd.begin(), cmd.end()); line.push_back(0);
- BOOL started = CreateProcessA(nullptr, line.data(), nullptr, nullptr, TRUE, CREATE_NO_WINDOW,
+ BOOL started = wsm::runtime::create_owned_process_a(nullptr, line.data(), nullptr, nullptr, TRUE, CREATE_NO_WINDOW,
nullptr, nullptr, &si, &pi);
CloseHandle(read_pipe); CloseHandle(nul);
if (!started) { CloseHandle(write_pipe); return -1; }
diff --git a/src/wsm-runtime/src/setup_assistant.cpp b/src/wsm-runtime/src/setup_assistant.cpp
index b397bab..48d0021 100644
--- a/src/wsm-runtime/src/setup_assistant.cpp
+++ b/src/wsm-runtime/src/setup_assistant.cpp
@@ -25,9 +25,11 @@ struct Sample {
}
};
constexpr Sample samples[] = {
- {SetupAssistantStep::Country, 58,23,102,38, sample_country, 0,0, 1744, 984, true},
- {SetupAssistantStep::Country, 58,23,102,38, sample_country_25g342, 0,0, 1920,1080, true},
- {SetupAssistantStep::Country, 58,23,102,38, sample_country_tahoe_hidpi,0,0, 1744, 984, true},
+ // Match only the globe icon and "Select Your Country or Region" header (y=[23..36)),
+ // above the list box so unfocused grey selection bars or scrolled lists still match.
+ {SetupAssistantStep::Country, 58,23,102,36, sample_country, 0,0, 1744, 984, true},
+ {SetupAssistantStep::Country, 58,23,102,36, sample_country_25g342, 0,0, 1920,1080, true},
+ {SetupAssistantStep::Country, 58,23,102,36, sample_country_tahoe_hidpi,0,0, 1744, 984, true},
// Choose only downloading, never automatic installation, on this exact update screen.
{SetupAssistantStep::Update, 58,23,104,46, sample_update, 325,414, 1744, 984, true},
{SetupAssistantStep::Account, 58,24,100,57,sample_account, 335,401, 1920,1080, true},
@@ -50,6 +52,9 @@ constexpr Sample samples[] = {
{SetupAssistantStep::Welcome, 55,30,105,84,sample_welcome, 480,481, 1920,1080, false},
{SetupAssistantStep::Welcome, 55,36,105,84,sample_welcome_tahoe, 480,477, 1808,1020, false},
{SetupAssistantStep::WelcomePending, 52,35,108,50,sample_welcome_pending, 0,0, 1920,1080, false},
+ // The daylight Tahoe Welcome animation has no Get Started button yet.
+ // It is a read-only marker, used only for the bounded first-sign-in recovery.
+ {SetupAssistantStep::WelcomePending, 54,36,107,49,sample_welcome_pending_tahoe,0,0, 848,480, false},
};
struct WhiteCardRect {
@@ -299,6 +304,134 @@ SetupAssistantAction recognize_setup_assistant(const uint8_t* rgb, int width, in
}
}
}
+ // Pass 4: resolution-independent daylight Lake Tahoe Welcome matcher.
+ // The Lake Tahoe wallpaper scales with aspect-fill (cover) while "welcome" and the
+ // white "Get Started" pill button stay at fixed 1x/2x point size (~105x35 pt) anchored
+ // near bottom-center. Verify BOTH the Lake Tahoe rocks/water backdrop AND the exact
+ // "Get Started" pill text so no desktop or normal app can ever trigger a false click.
+ if (best_action.step == SetupAssistantStep::Unknown && !card.valid) {
+ const double wp_scale = std::max(static_cast<double>(width) / 160.0, static_cast<double>(height) / 90.0);
+ const double wp_ox = (static_cast<double>(width) - 160.0 * wp_scale) * 0.5;
+ const double wp_oy = (static_cast<double>(height) - 90.0 * wp_scale) * 0.5;
+ double wp_err_sum = 0.0;
+ size_t wp_n = 0;
+ bool wp_ok = true;
+ for (int y = 49; y < 72 && wp_ok; ++y) {
+ const int py0 = static_cast<int>(std::floor(wp_oy + y * wp_scale));
+ const int py1 = std::max(py0 + 1, static_cast<int>(std::floor(wp_oy + (y + 1) * wp_scale)));
+ if (py0 < 0 || py1 > height) { wp_ok = false; break; }
+ for (int x = 55; x < 105; ++x) {
+ const int px0 = static_cast<int>(std::floor(wp_ox + x * wp_scale));
+ const int px1 = std::max(px0 + 1, static_cast<int>(std::floor(wp_ox + (x + 1) * wp_scale)));
+ if (px0 < 0 || px1 > width) { wp_ok = false; break; }
+ const size_t toff = (static_cast<size_t>(y - 36) * 50 + (x - 55)) * 3;
+ for (int c = 0; c < 3; ++c) {
+ const int delta = rect_avg(px0, py0, px1, py1, c) - sample_welcome_tahoe[toff + c];
+ wp_err_sum += delta < 0 ? -delta : delta;
+ ++wp_n;
+ }
+ }
+ }
+ if (wp_ok && wp_n > 0 && wp_err_sum / static_cast<double>(wp_n) <= 4.5) {
+ auto is_bright = [&](int x, int y) {
+ const size_t off = (static_cast<size_t>(y) * width + x) * 3;
+ return rgb[off] >= 230 && rgb[off + 1] >= 230 && rgb[off + 2] >= 230;
+ };
+ const int cx = width / 2;
+ const int x_min = width * 35 / 100;
+ const int x_max = width * 65 / 100;
+ const int max_gap = std::max(18, width / 80);
+ const int probe_span = std::min(40, width / 10);
+ struct PillRow { int y, lx, rx; };
+ std::vector<PillRow> rows;
+ for (int y = height * 72 / 100; y < height * 96 / 100; ++y) {
+ int seed = -1;
+ for (int d = 0; d <= probe_span && seed < 0; ++d) {
+ if (cx - d >= x_min && is_bright(cx - d, y)) seed = cx - d;
+ else if (cx + d < x_max && is_bright(cx + d, y)) seed = cx + d;
+ }
+ if (seed < 0) continue;
+ int lx = seed, gap = 0;
+ for (int x = seed; x >= x_min; --x) {
+ if (is_bright(x, y)) { lx = x; gap = 0; }
+ else if (++gap > max_gap) break;
+ }
+ int rx = seed; gap = 0;
+ for (int x = seed; x < x_max; ++x) {
+ if (is_bright(x, y)) { rx = x; gap = 0; }
+ else if (++gap > max_gap) break;
+ }
+ const int rw = rx - lx + 1;
+ const int mid = (lx + rx) / 2;
+ if (rw >= 75 && rw <= 280 && std::abs(mid - cx) <= std::max(12, width / 40))
+ rows.push_back({y, lx, rx});
+ }
+ size_t best_b = 0, best_len = 0;
+ for (size_t i = 0; i < rows.size();) {
+ size_t j = i + 1;
+ while (j < rows.size() && rows[j].y <= rows[j - 1].y + 2) ++j;
+ if (j - i > best_len) { best_b = i; best_len = j - i; }
+ i = j;
+ }
+ if (best_len >= 24) {
+ const int by0 = rows[best_b].y;
+ const int by1 = rows[best_b + best_len - 1].y + 1;
+ const int bh = by1 - by0;
+ std::vector<int> lxs, rxs;
+ lxs.reserve(best_len); rxs.reserve(best_len);
+ for (size_t i = best_b; i < best_b + best_len; ++i) {
+ lxs.push_back(rows[i].lx);
+ rxs.push_back(rows[i].rx);
+ }
+ std::sort(lxs.begin(), lxs.end());
+ std::sort(rxs.begin(), rxs.end());
+ const int bx0 = lxs[lxs.size() / 4];
+ const int bx1 = rxs[rxs.size() * 3 / 4] + 1;
+ const int bw = bx1 - bx0;
+ const double aspect = static_cast<double>(bw) / static_cast<double>(bh);
+ const int dpi = (bw >= 150 && bh >= 50) ? 2 : 1;
+ if (aspect >= 2.3 && aspect <= 3.6 &&
+ bw >= 88 * dpi && bw <= 124 * dpi &&
+ bh >= 26 * dpi && bh <= 44 * dpi) {
+ const int pcx = (bx0 + bx1) / 2;
+ const int pcy = (by0 + by1) / 2;
+ const int pw = 80 * dpi;
+ const int ph = 20 * dpi;
+ const unsigned char* tmpl = (dpi == 2) ? sample_get_started_2x : sample_get_started_1x;
+ double best_pill_err = std::numeric_limits<double>::max();
+ for (int dy = -3 * dpi; dy <= 3 * dpi; ++dy) {
+ for (int dx = -3 * dpi; dx <= 3 * dpi; ++dx) {
+ const int x0 = pcx + dx - pw / 2;
+ const int y0 = pcy + dy - ph / 2;
+ if (x0 < 0 || y0 < 0 || x0 + pw > width || y0 + ph > height) continue;
+ double err_sum = 0.0;
+ size_t n = 0;
+ for (int gy = 0; gy < 5; ++gy) {
+ const int py0 = y0 + gy * ph / 5;
+ const int py1 = std::max(py0 + 1, y0 + (gy + 1) * ph / 5);
+ for (int gx = 0; gx < 20; ++gx) {
+ const int px0 = x0 + gx * pw / 20;
+ const int px1 = std::max(px0 + 1, x0 + (gx + 1) * pw / 20);
+ for (int c = 0; c < 3; ++c) {
+ const int delta = rect_avg(px0, py0, px1, py1, c) - tmpl[n++];
+ err_sum += delta < 0 ? -delta : delta;
+ }
+ }
+ }
+ const double e = err_sum / static_cast<double>(n);
+ if (e < best_pill_err) best_pill_err = e;
+ }
+ }
+ if (best_pill_err <= 2.5) {
+ const int qx = std::clamp(static_cast<int>(static_cast<double>(pcx) * 32767.0 / width + 0.5), 0, 32767);
+ const int qy = std::clamp(static_cast<int>(static_cast<double>(pcy) * 32767.0 / height + 0.5), 0, 32767);
+ best_action = {SetupAssistantStep::Welcome, qx, qy};
+ best_error = 0.0;
+ }
+ }
+ }
+ }
+ }
}
// Tight threshold intentionally rejects unfamiliar OS versions, languages and screens.
diff --git a/src/wsm-runtime/src/setup_assistant_templates.inc b/src/wsm-runtime/src/setup_assistant_templates.inc
index ab8a541..ba6940d 100644
--- a/src/wsm-runtime/src/setup_assistant_templates.inc
+++ b/src/wsm-runtime/src/setup_assistant_templates.inc
@@ -6,7 +6,7 @@ static constexpr unsigned char sample_filevault[] = {255,255,255,255,255,255,255
static constexpr unsigned char sample_filevault_confirm[] = {204,204,204,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,202,202,202,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,203,204,204,204,203,203,203,204,204,204,203,203,203,203,203,203,202,202,202,202,202,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201,201,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,201,201,201,201,201,201,201,201,201,201,201,201,201,201,201,202,202,202,202,202,202,203,203,203,203,203,203,204,204,204,189,189,189,164,164,164,173,173,173,181,181,181,204,204,204,205,205,205,216,216,216,201,201,201,212,212,212,209,209,209,206,206,206,206,206,206,207,207,207,213,213,213,204,204,204,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,215,215,215,207,207,207,200,200,200,201,201,201,202,202,202,203,203,203,196,196,196,190,190,190,207,207,207,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,215,215,215,199,199,199,201,201,201,203,203,203,184,184,184,185,185,185,222,222,222,242,242,242,207,207,207,218,218,218,220,220,220,214,214,214,211,211,211,211,211,211,204,204,204,206,206,206,214,214,214,219,219,219,204,204,204,237,237,237,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,232,232,232,183,183,183,194,194,194,189,189,189,194,194,194,187,187,187,231,231,231,242,242,242,204,204,204,195,195,195,220,220,220,197,197,197,196,196,196,218,218,218,206,206,206,219,219,219,197,197,197,219,219,219,194,194,194,230,230,230,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,230,230,230,185,185,185,196,196,196,196,196,196,189,189,189,179,179,179,234,234,234,242,242,242,161,161,161,176,176,176,170,170,170,168,168,168,204,204,204,152,152,152,178,178,178,174,174,174,171,171,171,180,180,180,186,186,186,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,225,225,225,183,183,183,186,186,186,196,196,196,188,188,188,182,182,182,233,233,233,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,231,231,231,242,242,242,242,242,242,230,230,230,236,236,236,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,225,225,225,182,182,182,191,191,191,196,196,196,188,188,188,182,182,182,232,232,232,242,242,242,221,221,221,231,231,231,232,232,232,228,228,228,231,231,231,224,224,224,232,232,232,226,226,226,236,236,236,228,228,228,224,224,224,235,235,235,230,230,230,224,224,224,227,227,227,228,228,228,225,225,225,238,238,238,242,242,242,226,226,226,178,178,178,193,193,193,189,189,189,187,187,187,181,181,181,232,232,232,242,242,242,211,211,211,216,216,216,209,209,209,215,215,215,217,217,217,214,214,214,211,211,211,216,216,216,224,224,224,202,202,202,219,219,219,232,232,232,218,218,218,218,218,218,225,225,225,228,228,228,202,202,202,231,231,231,242,242,242,227,227,227,180,180,180,191,191,191,194,194,194,196,196,196,186,186,186,233,233,233,242,242,242,187,187,187,197,197,197,184,184,184,182,182,182,184,184,184,174,174,174,171,171,171,203,203,203,178,178,178,199,199,199,174,174,174,215,215,215,186,186,186,184,184,184,185,185,185,190,190,190,181,181,181,217,217,217,242,242,242,227,227,227,185,185,185,195,195,195,201,201,201,196,196,196,186,186,186,233,233,233,242,242,242,232,232,232,240,240,240,236,236,236,242,242,242,242,242,242,240,240,240,239,239,239,242,242,242,240,240,240,229,229,229,237,237,237,242,242,242,242,242,242,233,233,233,242,242,242,242,242,242,229,229,229,242,242,242,242,242,242,227,227,227,185,185,185,195,195,195,201,201,201,196,196,196,186,186,186,233,233,233,242,242,242,197,197,197,207,207,207,190,190,190,203,203,203,202,202,202,223,223,223,206,206,206,200,200,200,203,203,203,220,220,220,197,197,197,193,193,193,203,203,203,209,209,209,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,227,227,227,185,185,185,195,195,195,201,201,201,196,196,196,186,186,186,233,233,233,242,242,242,199,199,199,213,213,213,201,201,201,187,187,187,213,213,213,210,210,210,192,192,192,208,208,208,221,221,221,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,227,227,227,185,185,185,195,195,195,201,201,201,196,196,196,186,186,186,233,233,233,242,242,242,223,223,223,225,225,225,225,225,225,219,219,219,230,230,230,225,225,225,228,228,228,221,221,221,227,227,227,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,227,227,227,185,185,185,195,195,195,201,201,201,196,196,196,186,186,186,233,233,233,242,242,242,240,240,240,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,242,242,242,242,242,242,212,225,239,201,218,237,201,219,238,201,219,238,201,219,238,201,219,238,201,219,237,215,226,239,242,242,242,227,227,227,186,186,186,195,195,195,201,201,201,196,196,196,186,186,186,232,232,232,236,236,236,224,224,224,224,224,224,207,207,207,210,210,210,209,209,209,209,209,209,224,224,224,224,224,224,232,232,232,130,178,230,0,104,218,12,111,219,31,122,222,35,125,223,31,122,222,12,111,219,4,106,218,0,104,218,153,191,233,228,228,228,186,186,186,195,195,195,201,201,201,196,196,196,187,187,187,223,223,223,236,236,236,224,224,224,224,224,224,206,206,206,187,187,187,193,193,193,189,189,189,224,224,224,224,224,224,231,231,231,117,171,229,0,104,218,14,112,220,49,133,225,61,140,226,62,140,227,55,137,226,12,111,219,0,104,218,144,186,232,231,231,231,186,186,186,196,196,196,201,201,201,197,197,197,189,189,189,206,206,206,242,242,242,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,241,241,241,241,241,241,202,219,238,201,219,238,201,219,238,201,219,238,201,219,238,201,219,238,201,219,238,204,220,238,242,242,242,208,208,208,188,188,188,196,196,196,201,201,201,198,198,198,191,191,191,182,182,182,194,194,194,205,205,205,200,200,200,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,200,200,200,205,205,205,197,197,197,181,181,181,191,191,191,198,198,198,202,202,202,200,200,200,195,195,195,188,188,188,181,181,181,176,176,176,173,173,173,172,172,172,171,171,171,172,172,172,172,172,172,172,172,172,172,172,172,171,171,171,172,172,172,172,172,172,171,171,171,172,172,172,171,171,171,171,171,171,172,172,172,173,173,173,176,176,176,181,181,181,187,187,187,194,194,194,199,199,199,202,202,202,201,201,201,199,199,199,194,194,194,190,190,190,187,187,187,185,185,185,184,184,184,183,183,183,184,184,184,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,184,184,184,183,183,183,184,184,184,184,184,184,185,185,185,187,187,187,190,190,190,194,194,194,198,198,198,201,201,201,203,203,203};
static constexpr unsigned char sample_welcome[] = {17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,19,21,17,19,22,17,20,21,17,19,21,18,19,21,17,20,21,17,19,21,18,20,21,17,20,22,18,20,21,17,20,21,17,20,22,18,19,21,17,20,21,17,19,21,18,20,21,17,20,22,18,20,21,17,20,21,17,20,22,18,19,21,17,20,21,17,19,21,18,20,21,17,20,22,18,20,21,17,20,21,17,20,22,18,19,21,17,20,21,17,19,21,18,20,21,17,20,22,18,20,21,17,20,21,17,20,22,18,19,21,17,20,21,17,19,21,18,20,21,17,20,22,18,20,21,17,20,21,17,20,22,18,19,21,17,20,21,17,19,21,18,20,21,17,20,22,18,20,21,17,20,21,17,20,22,18,19,21,17,20,21,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,18,19,21,17,19,21,17,19,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,19,21,17,19,21,17,19,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,19,21,17,19,21,17,19,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,19,21,17,19,21,17,19,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,19,21,17,19,21,17,19,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,19,21,17,19,21,17,19,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,19,21,17,19,21,17,19,21,18,20,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,18,19,21,17,20,21,17,19,22,17,20,21,17,19,21,18,19,22,17,20,21,17,19,21,18,19,21,17,20,21,17,19,22,17,20,21,17,19,21,18,19,22,17,20,21,17,19,21,18,19,21,17,20,21,17,19,22,17,20,21,17,19,21,18,19,22,17,20,21,17,19,21,18,19,21,17,20,21,17,19,22,17,20,21,17,19,21,18,19,22,17,20,21,17,19,21,18,19,21,17,20,21,17,19,22,17,20,21,17,19,21,18,19,22,17,20,21,17,19,21,18,19,21,17,20,21,17,19,22,17,20,21,17,19,21,18,19,22,17,20,21,17,19,21,18,19,21,17,20,21,17,20,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,20,21,17,19,21,17,20,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,20,21,17,19,21,17,20,21,18,19,21,42,44,46,95,97,98,51,52,54,17,19,21,18,20,21,17,19,21,17,20,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,20,21,17,19,21,17,20,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,20,21,17,19,21,17,20,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,20,21,17,19,21,17,20,21,18,19,21,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,19,21,17,19,22,17,20,21,25,27,29,140,141,141,118,118,119,140,140,141,18,20,22,17,19,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,19,21,17,19,22,17,20,21,17,19,21,18,19,21,17,20,21,17,19,21,18,20,21,17,20,22,18,20,21,17,20,21,17,20,22,18,19,21,17,20,21,17,19,21,18,20,21,17,20,22,18,20,21,17,20,21,17,20,22,18,19,21,72,73,74,124,125,125,39,41,42,142,143,143,25,27,28,17,20,21,17,20,22,18,19,21,17,20,21,17,19,21,18,20,21,17,20,22,18,20,21,17,20,21,17,20,22,18,19,21,17,20,21,17,19,21,18,20,21,17,20,22,18,20,21,17,20,21,17,20,22,18,19,21,17,20,21,17,19,21,18,20,21,17,20,22,18,20,21,17,20,21,17,20,22,18,19,21,17,20,21,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,104,105,106,87,88,89,64,66,67,129,130,131,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,33,35,37,92,93,94,82,83,84,18,20,22,17,19,21,41,43,44,29,31,33,32,34,35,92,93,94,20,22,24,17,19,21,18,19,21,57,59,60,99,100,101,56,57,59,17,19,21,18,19,21,124,124,125,65,66,67,104,105,106,94,95,96,18,20,21,17,19,21,66,67,69,98,99,100,81,82,83,21,23,25,18,19,21,20,22,24,79,80,82,99,100,101,63,65,66,18,19,21,17,19,21,17,19,21,49,50,52,84,86,87,91,93,94,79,80,81,30,31,33,88,89,90,88,89,90,25,27,29,18,19,21,17,19,21,35,37,38,94,95,96,79,80,82,18,19,21,17,19,21,132,133,133,119,120,120,134,134,135,68,70,71,17,19,22,119,119,120,79,80,81,52,54,55,144,144,145,54,56,57,17,19,21,50,52,53,145,145,146,109,110,111,144,145,145,30,32,34,17,19,21,138,138,138,72,74,75,143,143,143,47,48,50,17,19,21,77,78,79,141,141,142,110,111,112,135,135,136,82,83,84,18,20,21,109,110,111,136,136,137,111,112,112,144,144,145,103,104,105,23,25,27,38,39,41,136,137,138,141,142,142,96,97,98,126,127,128,147,147,148,117,118,119,125,126,127,103,105,106,18,20,21,20,22,24,134,135,136,118,119,120,135,136,136,72,73,75,18,20,22,134,134,134,23,24,26,119,120,121,75,76,77,17,19,21,134,134,135,57,59,60,24,26,28,134,134,135,78,79,81,17,19,22,97,98,99,96,97,97,35,37,39,143,143,144,34,36,38,17,20,21,135,136,136,140,140,141,107,108,109,17,19,21,19,21,23,136,137,137,65,67,68,17,20,21,37,39,41,31,32,34,47,49,51,143,144,144,39,40,42,17,20,21,84,85,87,143,143,143,155,155,156,151,151,152,142,142,143,97,98,98,17,19,21,79,81,82,118,118,119,18,20,22,77,78,79,119,120,121,17,20,21,49,51,52,140,140,140,22,24,26,108,109,110,82,83,84,17,19,21,37,39,40,17,20,21,139,140,140,50,52,53,35,37,38,145,145,145,51,53,54,17,19,21,133,133,133,145,146,146,113,113,114,129,129,130,127,128,129,140,141,141,97,98,99,17,19,21,18,19,21,126,126,127,135,135,136,34,36,38,17,19,21,65,67,68,144,145,145,47,48,50,18,19,21,17,20,21,18,20,22,120,121,121,140,140,141,18,19,22,17,20,21,93,94,95,106,107,108,65,67,68,54,56,57,125,126,126,64,65,66,18,19,22,100,101,102,85,86,87,18,19,21,93,94,95,100,100,101,17,20,21,51,53,54,143,143,144,63,64,66,143,144,144,42,44,45,29,31,33,17,20,21,18,20,22,139,139,140,77,78,79,117,118,119,142,142,142,102,103,104,94,95,96,136,137,137,68,69,71,103,104,105,123,124,124,143,144,144,118,119,119,49,51,53,70,71,73,128,129,130,143,143,143,138,139,139,67,68,70,66,68,69,140,141,141,132,133,133,116,117,118,49,51,52,56,57,59,121,122,123,130,131,131,141,141,141,79,81,82,73,74,75,143,143,144,54,55,56,18,19,21,18,20,22,143,144,144,43,45,47,17,19,21,124,125,125,65,67,68,17,20,21,91,92,93,118,119,120,47,49,51,85,86,88,145,145,146,148,149,149,79,80,81,64,66,67,147,147,148,17,20,21,17,19,21,79,80,81,153,154,154,124,124,125,67,68,69,143,143,143,142,142,142,56,58,59,17,19,21,17,19,22,20,22,24,94,95,96,151,151,151,149,150,150,146,146,146,98,99,100,35,37,38,93,94,95,149,150,150,148,149,149,89,89,91,38,40,41,125,125,126,149,150,150,150,150,151,112,113,113,35,37,39,65,66,68,146,147,147,148,148,148,80,81,82,17,20,21,17,19,21,29,30,32,136,137,137,26,28,30,17,19,21,134,134,135,44,45,47,17,20,21,38,39,41,135,135,136,150,150,150,142,142,143,107,108,109,143,144,144,152,152,153,146,147,147,82,83,84,18,19,21,17,20,21,17,19,21,18,20,21,17,20,22,18,20,21,17,20,21,17,20,22,18,19,21,17,20,21,17,19,21,18,20,21,17,20,22,30,31,33,53,55,56,19,21,23,18,19,21,17,20,21,17,19,21,18,20,21,17,20,22,18,20,21,17,20,21,17,20,22,43,45,46,32,34,36,17,19,21,18,20,21,17,20,22,18,20,21,17,20,21,17,20,22,18,19,21,17,20,21,17,19,21,18,20,22,17,20,22,18,20,21,22,24,26,17,20,22,18,19,21,17,20,21,17,19,21,30,32,33,17,20,22,18,20,21,27,29,31,52,54,56,32,34,36,17,20,21,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,18,19,21,17,19,21,17,19,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,19,21,17,19,21,17,19,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,19,21,17,19,21,17,19,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,19,21,17,19,21,17,19,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,19,21,17,19,21,17,19,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,19,21,17,19,21,17,19,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,19,21,17,19,21,17,19,21,18,20,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,18,19,21,17,20,21,17,19,22,17,20,21,17,19,21,18,19,22,17,20,21,17,19,21,18,19,21,17,20,21,17,19,22,17,20,21,17,19,21,18,19,22,17,20,21,17,19,21,18,19,21,17,20,21,17,19,22,17,20,21,17,19,21,18,19,22,17,20,21,17,19,21,18,19,21,17,20,21,17,19,22,17,20,21,17,19,21,18,19,22,17,20,21,17,19,21,18,19,21,17,20,21,17,19,22,17,20,21,17,19,21,18,19,22,17,20,21,17,19,21,18,19,21,17,20,21,17,19,22,17,20,21,17,19,21,18,19,22,17,20,21,17,19,21,18,19,21,17,20,21,17,20,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,20,21,17,19,21,17,20,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,20,21,17,19,21,17,20,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,20,21,17,19,21,17,20,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,20,21,17,19,21,17,20,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,20,21,17,19,21,17,20,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,20,21,17,19,21,17,20,21,18,19,21,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,19,21,17,19,22,17,20,21,17,19,21,18,19,21,17,20,21,17,19,21,18,20,21,17,20,22,18,20,21,17,20,21,17,20,22,18,19,21,17,20,21,17,19,21,18,20,21,17,20,22,18,20,21,17,20,21,17,20,22,18,19,21,17,20,21,17,19,21,18,20,21,17,20,22,18,20,21,17,20,21,17,20,22,18,19,21,17,20,21,17,19,21,18,20,21,17,20,22,18,20,21,17,20,21,17,20,22,18,19,21,17,20,21,17,19,21,18,20,21,17,20,22,18,20,21,17,20,21,17,20,22,18,19,21,17,20,21,17,19,21,18,20,21,17,20,22,18,20,21,17,20,21,17,20,22,18,19,21,17,20,21,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,18,19,21,17,19,21,17,19,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,19,21,17,19,21,17,19,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,19,21,17,19,21,17,19,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,19,21,17,19,21,17,19,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,19,21,17,19,21,17,19,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,19,21,17,19,21,17,19,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,19,21,17,19,21,17,19,21,18,20,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,18,19,21,17,20,21,17,19,22,17,20,21,17,19,21,18,19,22,17,20,21,17,19,21,18,19,21,17,20,21,17,19,22,17,20,21,17,19,21,18,19,22,17,20,21,17,19,21,18,19,21,17,20,21,17,19,22,17,20,21,17,19,21,18,19,22,17,20,21,17,19,21,18,19,21,17,20,21,17,19,22,17,20,21,17,19,21,18,19,22,17,20,21,17,19,21,18,19,21,17,20,21,17,19,22,17,20,21,17,19,21,18,19,22,17,20,21,17,19,21,18,19,21,17,20,21,17,19,22,17,20,21,17,19,21,18,19,22,17,20,21,17,19,21,18,19,21,17,20,21,17,20,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,20,21,17,19,21,17,20,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,20,21,17,19,21,17,20,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,20,21,17,19,21,17,20,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,20,21,17,19,21,17,20,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,20,21,17,19,21,17,20,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,20,21,17,19,21,17,20,21,18,19,21,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,19,21,17,19,22,17,20,21,17,19,21,18,19,21,17,20,21,17,19,21,18,20,21,17,20,22,18,20,21,17,20,21,17,20,22,18,19,21,17,20,21,17,19,21,18,20,21,17,20,22,18,20,21,17,20,21,17,20,22,18,19,21,17,20,21,17,19,21,18,20,21,17,20,22,18,20,21,17,20,21,17,20,22,18,19,21,17,20,21,17,19,21,18,20,21,17,20,22,18,20,21,17,20,21,17,20,22,18,19,21,17,20,21,17,19,21,18,20,21,17,20,22,18,20,21,17,20,21,17,20,22,18,19,21,17,20,21,17,19,21,18,20,21,17,20,22,18,20,21,17,20,21,17,20,22,18,19,21,17,20,21,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,18,19,21,17,19,21,17,19,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,19,21,17,19,21,17,19,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,19,21,17,19,21,17,19,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,19,21,17,19,21,17,19,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,19,21,17,19,21,17,19,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,19,21,17,19,21,17,19,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,19,21,17,19,21,17,19,21,18,20,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,18,19,21,17,20,21,17,19,22,17,20,21,17,19,21,18,19,22,17,20,21,17,19,21,18,19,21,17,20,21,17,19,22,17,20,21,17,19,21,18,19,22,17,20,21,17,19,21,18,19,21,17,20,21,17,19,22,17,20,21,17,19,21,18,19,22,17,20,21,17,19,21,18,19,21,17,20,21,17,19,22,17,20,21,17,19,21,18,19,22,17,20,21,17,19,21,18,19,21,17,20,21,17,19,22,17,20,21,17,19,21,18,19,22,17,20,21,17,19,21,18,19,21,17,20,21,17,19,22,17,20,21,17,19,21,18,19,22,17,20,21,17,19,21,18,19,21,17,20,21,17,20,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,20,21,17,19,21,17,20,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,20,21,17,19,21,17,20,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,20,21,17,19,21,17,20,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,20,21,17,19,21,17,20,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,20,21,17,19,21,17,20,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,20,21,17,19,21,17,20,21,18,19,21,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,19,21,17,19,22,17,20,21,17,19,21,18,19,21,17,20,21,17,19,21,18,20,21,17,20,22,18,20,21,17,20,21,17,20,22,18,19,21,17,20,21,17,19,21,18,20,21,17,20,22,18,20,21,17,20,21,17,20,22,18,19,21,17,20,21,17,19,21,18,20,21,17,20,22,18,20,21,17,20,21,17,20,22,18,19,21,17,20,21,17,19,21,18,20,21,17,20,22,18,20,21,17,20,21,17,20,22,18,19,21,17,20,21,17,19,21,18,20,21,17,20,22,18,20,21,17,20,21,17,20,22,18,19,21,17,20,21,17,19,21,18,20,21,17,20,22,18,20,21,17,20,21,17,20,22,18,19,21,17,20,21,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,18,19,21,17,19,21,17,19,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,19,21,17,19,21,17,19,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,19,21,17,19,21,17,19,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,19,21,17,19,21,17,19,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,19,21,17,19,21,17,19,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,19,21,17,19,21,17,19,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,19,21,17,19,21,17,19,21,18,20,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,18,19,21,17,20,21,17,19,22,17,20,21,17,19,21,18,19,22,17,20,21,17,19,21,18,19,21,17,20,21,17,19,22,17,20,21,17,19,21,18,19,22,17,20,21,17,19,21,18,19,21,17,20,21,17,19,22,17,20,21,17,19,21,18,19,22,17,20,21,17,19,21,18,19,21,17,20,21,17,19,22,17,20,21,17,19,21,18,19,22,17,20,21,17,19,21,18,19,21,17,20,21,17,19,22,17,20,21,17,19,21,18,19,22,17,20,21,17,19,21,18,19,21,17,20,21,17,19,22,17,20,21,17,19,21,18,19,22,17,20,21,17,19,21,18,19,21,17,20,21,17,20,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,20,21,17,19,21,17,20,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,20,21,17,19,21,17,20,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,20,21,17,19,21,17,20,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,20,21,17,19,21,17,20,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,20,21,17,19,21,17,20,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,20,21,17,19,21,17,20,21,18,19,21,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,49,50,52,91,92,94,94,95,96,94,95,96,94,95,96,94,95,96,92,93,94,54,55,57,17,19,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,19,21,17,19,22,17,20,21,17,19,21,18,19,21,17,20,21,17,19,21,18,20,21,17,20,22,18,20,21,17,20,21,17,20,22,18,19,21,17,20,21,17,19,21,18,20,21,17,20,22,18,20,21,17,20,21,17,20,22,18,19,21,17,20,21,17,19,21,18,20,21,60,62,64,238,238,239,224,224,225,240,240,241,224,224,225,235,235,236,238,238,239,240,240,241,240,240,241,75,76,78,17,20,21,17,20,22,18,19,21,17,20,21,17,19,21,18,20,21,17,20,22,18,20,21,17,20,21,17,20,22,18,19,21,17,20,21,17,19,21,18,20,21,17,20,22,18,20,21,17,20,21,17,20,22,18,19,21,17,20,21,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,19,21,85,87,88,242,242,243,190,190,191,182,182,183,198,198,199,159,159,160,181,181,182,185,185,186,242,242,243,113,115,116,17,19,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,18,19,21,17,19,21,17,19,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,19,21,17,19,21,17,19,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,19,21,17,19,21,17,19,21,17,19,21,20,22,24,137,138,139,167,168,169,167,168,169,167,167,169,167,167,168,167,168,169,167,168,169,147,148,149,26,27,29,17,19,21,17,19,21,18,19,21,17,19,21,17,19,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,19,21,17,19,21,17,19,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,19,21,17,19,21,17,19,21,18,20,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,22,17,19,21,18,20,21,17,19,21,16,18,20,17,19,20,16,18,21,16,18,20,17,19,21,16,18,20,17,19,20,16,18,21,17,19,21,18,20,21,17,19,22,17,19,21,18,20,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,21,17,19,22,17,19,21,18,20,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,19,21,17,19,21,17,19,21,17,19,21,17,19,21,17,19,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21};
-static constexpr unsigned char sample_country[] = {255,255,255,255,255,255,255,255,255,255,255,255,243,248,252,235,243,251,254,254,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,233,242,251,164,203,238,186,215,242,195,221,244,152,196,236,201,224,245,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,246,250,253,110,170,229,253,254,254,255,255,255,208,227,246,192,218,243,192,218,243,215,231,248,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,180,210,242,205,225,246,196,219,245,170,204,240,161,199,239,251,253,254,255,255,255,165,201,239,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,166,201,240,255,255,255,219,233,249,180,209,242,194,218,245,168,202,240,250,252,254,166,201,240,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,180,208,243,231,240,251,250,252,254,162,197,240,250,251,254,179,207,243,250,252,254,158,195,239,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,249,251,254,133,178,236,249,251,254,219,232,249,170,201,242,199,220,246,170,201,242,219,232,249,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,237,244,252,137,180,237,156,191,240,129,175,236,138,180,237,199,219,246,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,240,245,252,229,238,251,254,254,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,245,245,245,250,250,250,246,246,246,255,255,255,252,252,252,248,248,248,248,248,248,255,255,255,255,255,255,243,243,243,252,252,252,255,255,255,255,255,255,252,252,252,255,255,255,255,255,255,255,255,255,248,248,248,246,246,246,255,255,255,244,244,244,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,186,186,186,136,136,136,136,136,136,137,137,137,144,144,144,208,208,208,147,147,147,144,144,144,167,167,167,181,181,181,150,150,150,151,151,151,141,141,141,135,135,135,168,168,168,183,183,183,139,139,139,188,188,188,136,136,136,145,145,145,142,142,142,142,142,142,159,159,159,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255,255,255,254,254,254,254,254,254,255,255,255,254,254,254,254,254,254,254,254,254,255,255,255,254,254,254,235,235,235,254,254,254,254,254,254,255,255,255,254,254,254,238,238,238,238,238,238,254,254,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,246,249,253,243,247,252,243,247,252,243,247,252,243,247,252,243,247,252,243,247,252,243,247,252,243,247,252,243,247,252,243,247,252,243,247,252,243,247,252,243,247,252,243,247,252,243,247,252,243,247,252,243,247,252,243,247,252,243,247,252,243,247,252,243,247,252,243,247,252,243,247,252,243,247,252,243,247,252,243,247,252,243,247,252,243,247,252,243,247,252,243,247,252,243,247,252,243,247,252,243,247,252,243,247,252,243,247,252,243,247,252,243,247,252,243,247,252,243,247,252,243,247,252,245,248,253,255,255,255,255,255,255,88,142,214,57,121,205,63,125,207,55,119,205,49,116,203,51,117,204,56,120,205,43,112,202,33,105,199,33,105,199,33,105,199,33,105,199,33,105,199,33,105,199,33,105,199,33,105,199,33,105,199,33,105,199,33,105,199,33,105,199,33,105,199,33,105,199,33,105,199,33,105,199,33,105,199,33,105,199,33,105,199,33,105,199,33,105,199,33,105,199,33,105,199,33,105,199,33,105,199,33,105,199,33,105,199,33,105,199,33,105,199,33,105,199,33,105,199,33,105,199,183,194,210,171,195,228,255,255,255};
+static constexpr unsigned char sample_country[] = {255,255,255,255,255,255,255,255,255,255,255,255,243,248,252,235,243,251,254,254,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,233,242,251,164,203,238,186,215,242,195,221,244,152,196,236,201,224,245,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,246,250,253,110,170,229,253,254,254,255,255,255,208,227,246,192,218,243,192,218,243,215,231,248,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,180,210,242,205,225,246,196,219,245,170,204,240,161,199,239,251,253,254,255,255,255,165,201,239,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,166,201,240,255,255,255,219,233,249,180,209,242,194,218,245,168,202,240,250,252,254,166,201,240,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,180,208,243,231,240,251,250,252,254,162,197,240,250,251,254,179,207,243,250,252,254,158,195,239,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,249,251,254,133,178,236,249,251,254,219,232,249,170,201,242,199,220,246,170,201,242,219,232,249,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,237,244,252,137,180,237,156,191,240,129,175,236,138,180,237,199,219,246,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,240,245,252,229,238,251,254,254,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,245,245,245,250,250,250,246,246,246,255,255,255,252,252,252,248,248,248,248,248,248,255,255,255,255,255,255,243,243,243,252,252,252,255,255,255,255,255,255,252,252,252,255,255,255,255,255,255,255,255,255,248,248,248,246,246,246,255,255,255,244,244,244,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,186,186,186,136,136,136,136,136,136,137,137,137,144,144,144,208,208,208,147,147,147,144,144,144,167,167,167,181,181,181,150,150,150,151,151,151,141,141,141,135,135,135,168,168,168,183,183,183,139,139,139,188,188,188,136,136,136,145,145,145,142,142,142,142,142,142,159,159,159,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255,255,255,254,254,254,254,254,254,255,255,255,254,254,254,254,254,254,254,254,254,255,255,255,254,254,254,235,235,235,254,254,254,254,254,254,255,255,255,254,254,254,238,238,238,238,238,238,254,254,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255};
static constexpr unsigned char sample_update[] = {255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,195,219,246,128,180,236,113,171,234,187,214,245,240,246,252,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,140,187,238,111,170,234,219,233,249,250,252,254,185,214,244,133,182,237,240,246,252,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,188,215,245,147,191,239,253,254,254,163,200,241,255,255,255,255,255,255,195,219,246,146,190,239,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,146,190,239,215,231,249,255,255,255,151,193,239,126,178,236,176,208,243,176,208,243,105,166,233,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,171,205,242,203,224,247,255,255,255,132,182,237,131,181,237,254,254,255,254,254,254,131,182,237,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,210,228,248,105,166,233,234,242,252,164,201,241,255,255,255,255,255,255,145,190,239,174,207,243,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,160,199,241,36,125,223,180,210,244,202,224,247,113,171,234,135,184,237,238,244,252,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,214,230,249,131,182,237,110,169,234,207,226,248,241,246,253,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,217,217,217,179,179,179,202,202,202,197,197,197,181,181,181,213,213,213,193,193,193,196,196,196,200,200,200,233,233,233,192,192,192,213,213,213,190,190,190,200,200,200,201,201,201,188,188,188,190,190,190,211,211,211,177,177,177,199,199,199,251,251,251,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,226,226,226,172,172,172,195,195,195,192,192,192,185,185,185,202,202,202,215,215,215,184,184,184,180,180,180,222,222,222,204,204,204,195,195,195,196,196,196,209,209,209,194,194,194,184,184,184,192,192,192,199,199,199,188,188,188,182,182,182,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,241,241,241,249,249,249,248,248,248,255,255,255,255,255,255,255,255,255,255,255,255,241,241,241,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,246,246,246,250,250,250,255,255,255,255,255,255,255,255,255,235,235,235,249,249,249,255,255,255,255,255,255,255,255,255,248,248,248,255,255,255,255,255,255,255,255,255,243,243,243,255,255,255,246,246,246,250,250,250,255,255,255,244,244,244,255,255,255,255,255,255,246,246,246,255,255,255,246,246,246,255,255,255,249,249,249,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,238,238,238,229,229,229,216,216,216,221,221,221,214,214,214,228,228,228,214,214,214,224,224,224,218,218,218,217,217,217,216,216,216,236,236,236,201,201,201,214,214,214,215,215,215,221,221,221,212,212,212,236,236,236,214,214,214,221,221,221,237,237,237,215,215,215,231,231,231,214,214,214,216,216,216,210,210,210,221,221,221,217,217,217,218,218,218,220,220,220,221,221,221,207,207,207,232,232,232,212,212,212,212,212,212,220,220,220,211,211,211,219,219,219,204,204,204,216,216,216,222,222,222,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,253,253,253,253,253,255,255,255,255,255,255,255,255,255,251,251,251,255,255,255,252,252,252,251,251,251,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,252,252,252,255,255,255,255,255,255,254,254,254,255,255,255,255,255,255,252,252,252,255,255,255,255,255,255,255,255,255,252,252,252,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,228,228,228,207,207,207,206,206,206,236,236,236,219,219,219,206,206,206,206,206,206,194,194,194,212,212,212,213,213,213,210,210,210,232,232,232,218,218,218,208,208,208,231,231,231,204,204,204,225,225,225,202,202,202,202,202,202,219,219,219,230,230,230,208,208,208,230,230,230,198,198,198,206,206,206,198,198,198,204,204,204,199,199,199,250,250,250,215,215,215,210,210,210,227,227,227,222,222,222,193,193,193,237,237,237,211,211,211,199,199,199,221,221,221,203,203,203,203,203,203,231,231,231,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,248,248,248,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,247,247,247,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,250,250,250,245,245,245,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,241,241,241,214,214,214,217,217,217,230,230,230,236,236,236,221,221,221,225,225,225,217,217,217,222,222,222,227,227,227,230,230,230,225,225,225,226,226,226,226,226,226,221,221,221,220,220,220,232,232,232,231,231,231,224,224,224,237,237,237,219,219,219,228,228,228,232,232,232,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,250,250,250,244,244,244,238,238,238,246,246,246,249,249,249,241,241,241,240,240,240,246,246,246,241,241,241,240,240,240,246,246,246,248,248,248,229,229,229,238,238,238,239,239,239,239,239,239,243,243,243,241,241,241,242,242,242,245,245,245,244,244,244,218,218,218,241,241,241,250,250,250,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255};
static constexpr unsigned char sample_age_range[] = {
@@ -673,7 +673,7 @@ static constexpr unsigned char sample_apple_account[] = {
193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,192,192,192,190,190,190,187,187,187,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,192,192,192,188,188,188,213,213,213,246,246,246,253,253,253,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,191,191,191,192,192,192,254,254,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,191,191,191,199,199,199,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,190,190,190,199,199,199,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,190,190,190,199,199,199,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,190,190,190,199,199,199,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,252,253,254,245,249,253,236,243,252,244,248,253,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,190,190,190,199,199,199,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,250,252,254,226,238,250,233,242,251,242,247,253,234,242,251,231,240,251,255,255,255,255,255,255,255,255,255,255,255,255,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,190,190,190,199,199,199,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,229,240,251,243,248,253,254,254,254,233,242,251,253,254,254,233,242,251,240,246,252,255,255,255,255,255,255,255,255,255,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,190,190,190,199,199,199,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,243,248,253,226,237,250,254,254,254,133,183,237,92,158,231,252,253,254,240,246,252,229,239,251,255,255,255,255,255,255,255,255,255,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,190,190,190,199,199,199,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,242,247,253,222,235,250,254,254,254,81,152,229,24,118,221,244,248,253,237,244,252,228,239,251,255,255,255,255,255,255,255,255,255,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,190,190,190,199,199,199,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,223,236,250,242,247,253,246,249,253,244,248,253,254,254,254,228,239,251,237,244,252,255,255,255,255,255,255,255,255,255,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,190,190,190,199,199,199,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,248,251,254,219,234,249,230,240,251,241,247,253,231,241,251,224,237,250,255,255,255,255,255,255,255,255,255,255,255,255,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,190,190,190,199,199,199,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,250,252,254,240,246,252,227,238,251,238,244,252,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,190,190,190,199,199,199,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,190,190,190,199,199,199,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,190,190,190,199,199,199,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,241,241,241,244,244,244,255,255,255,249,249,249,255,255,255,252,252,252,253,253,253,244,244,244,255,255,255,255,255,255,247,247,247,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,190,190,190,199,199,199,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,158,158,158,133,133,133,135,135,135,160,160,160,153,153,153,150,150,150,188,188,188,139,139,139,139,139,139,142,142,142,178,178,178,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,190,190,190,199,199,199,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,254,254,239,239,239,245,245,245,254,254,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,253,253,254,254,254,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,190,190,190,199,199,199,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,215,215,215,215,215,215,209,209,209,225,225,225,236,236,236,206,206,206,233,233,233,211,211,211,220,220,220,214,214,214,212,212,212,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,190,190,190,199,199,199,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,254,254,246,246,246,251,251,251,255,255,255,255,255,255,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,190,190,190,199,199,199,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,229,229,229,212,212,212,228,228,228,216,216,216,218,218,218,233,233,233,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,190,190,190,199,199,199,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,250,250,250,249,249,249,253,253,253,249,249,249,250,250,250,249,249,249,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,190,190,190,199,199,199,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,190,190,190,199,199,199,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,216,228,246,212,226,246,212,226,246,212,226,246,212,226,246,212,226,246,212,226,246,212,226,246,212,226,246,212,226,246,212,226,246,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,190,190,190,199,199,199,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,200,214,234,229,229,229,229,229,229,229,229,229,237,237,237,221,221,221,230,230,230,228,228,228,232,232,232,227,227,227,230,230,230,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,190,190,190,199,199,199,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,199,216,242,206,220,240,207,221,240,209,222,242,209,223,242,210,224,243,208,221,241,208,222,241,210,223,243,206,220,240,209,223,242,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,190,190,190,199,199,199,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,243,248,253,255,255,255,253,253,254,255,255,255,255,255,255,255,255,255,250,252,254,255,255,255,250,252,254,250,252,254,255,255,255,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,190,190,190,199,199,199,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,216,231,249,189,215,245,184,212,244,205,225,247,185,213,244,193,218,246,207,226,248,172,205,242,182,212,244,206,226,248,193,218,246,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,190,190,190,199,199,199,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,190,190,190,199,199,199,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,206,226,247,191,217,245,175,208,243,198,221,246,179,210,244,190,216,245,187,215,245,193,218,246,183,212,244,240,246,252,255,255,255,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,190,190,190,199,199,199,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,254,254,254,254,254,254,254,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,190,190,190,199,199,199,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,190,190,190,199,199,199,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,190,190,190,199,199,199,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,190,190,190,199,199,199,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,190,190,190,199,199,199,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,190,190,190,199,199,199,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,190,190,190,199,199,199,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
};
-static constexpr unsigned char sample_country_25g342[] = {255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,245,249,253,215,232,247,230,241,250,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,192,218,243,184,214,242,222,236,249,200,224,245,141,189,234,247,250,253,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,215,231,248,155,196,237,255,255,255,228,239,250,170,205,240,247,250,253,169,204,240,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,173,205,241,223,236,249,176,207,241,129,179,234,169,203,240,251,252,254,175,207,241,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,170,203,241,255,255,255,188,214,244,251,252,254,249,251,254,185,212,243,172,204,241,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,201,221,246,208,226,247,248,251,254,179,207,243,194,217,245,232,241,251,159,195,240,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,170,201,242,183,209,244,184,210,244,172,202,242,147,186,238,236,243,252,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,230,239,251,172,202,242,198,218,246,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,237,237,237,254,254,254,247,247,247,255,255,255,250,250,250,238,238,238,255,255,255,255,255,255,241,241,241,249,249,249,255,255,255,255,255,255,250,250,250,255,255,255,255,255,255,255,255,255,231,231,231,255,255,255,246,246,246,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,183,183,183,148,148,148,148,148,148,167,167,167,205,205,205,165,165,165,166,166,166,168,168,168,203,203,203,155,155,155,141,141,141,179,179,179,151,151,151,174,174,174,164,164,164,201,201,201,142,142,142,133,133,133,155,155,155,146,146,146,204,204,204,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,244,244,244,255,255,255,255,255,255,255,255,255,249,249,249,243,243,243,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,213,226,245,210,224,244,210,224,244,210,224,244,210,224,244,210,224,244,210,224,244,210,224,244,210,224,244,210,224,244,210,224,244,210,224,244,210,224,244,210,224,244,210,224,244,210,224,244,210,224,244,210,224,244,210,224,244,210,224,244,210,224,244,210,224,244,210,224,244,210,224,244,210,224,244,210,224,244,210,224,244,210,224,244,210,224,244,210,224,244,210,224,244,210,224,244,210,224,244,210,224,244,210,224,244,210,224,244,210,224,244,210,224,244,255,255,255,255,255,255,255,255,255};
+static constexpr unsigned char sample_country_25g342[] = {255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,245,249,253,215,232,247,230,241,250,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,192,218,243,184,214,242,222,236,249,200,224,245,141,189,234,247,250,253,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,215,231,248,155,196,237,255,255,255,228,239,250,170,205,240,247,250,253,169,204,240,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,173,205,241,223,236,249,176,207,241,129,179,234,169,203,240,251,252,254,175,207,241,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,170,203,241,255,255,255,188,214,244,251,252,254,249,251,254,185,212,243,172,204,241,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,201,221,246,208,226,247,248,251,254,179,207,243,194,217,245,232,241,251,159,195,240,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,170,201,242,183,209,244,184,210,244,172,202,242,147,186,238,236,243,252,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,230,239,251,172,202,242,198,218,246,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,237,237,237,254,254,254,247,247,247,255,255,255,250,250,250,238,238,238,255,255,255,255,255,255,241,241,241,249,249,249,255,255,255,255,255,255,250,250,250,255,255,255,255,255,255,255,255,255,231,231,231,255,255,255,246,246,246,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,183,183,183,148,148,148,148,148,148,167,167,167,205,205,205,165,165,165,166,166,166,168,168,168,203,203,203,155,155,155,141,141,141,179,179,179,151,151,151,174,174,174,164,164,164,201,201,201,142,142,142,133,133,133,155,155,155,146,146,146,204,204,204,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255};
static constexpr unsigned char sample_account_menu_tahoe[] = {254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,230,230,230,227,227,227,229,229,229,239,239,239,196,220,246,207,226,247,199,221,246,253,253,253,252,252,252,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,252,252,252,253,253,253,254,254,254,255,255,255,255,255,255,251,251,251,248,248,248,245,245,245,245,245,245,245,245,245,245,245,245,245,245,245,245,245,245,245,245,245,245,245,245,245,245,245,245,245,245,245,245,245,245,245,245,245,245,245,246,246,246,249,249,249,252,252,252,254,254,254,255,255,255,255,255,255,249,249,249,244,244,244,236,236,236,226,226,226,230,230,230,233,233,233,229,229,229,231,231,231,231,231,231,233,233,233,230,230,230,229,229,229,231,231,231,235,235,235,220,220,220,241,241,241,245,245,245,250,250,250,253,253,253,254,254,254,255,255,255,247,247,247,239,239,239,230,230,230,226,226,226,226,226,226,228,228,228,223,223,223,224,224,224,228,228,228,228,228,228,223,223,223,226,226,226,226,226,226,228,228,228,225,225,225,232,232,232,236,236,236,244,244,244,252,252,252,254,254,254,255,255,255,245,245,245,235,235,235,242,242,242,234,234,234,241,241,241,241,241,241,241,241,241,241,241,241,240,240,240,239,239,239,242,242,242,241,241,241,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,238,238,238,249,249,249,254,254,254,255,255,255,200,200,200,231,231,231,223,223,223,180,180,180,218,218,218,184,184,184,199,199,199,189,189,189,186,186,186,176,176,176,208,208,208,186,186,186,199,199,199,193,193,193,188,188,188,209,209,209,242,242,242,237,237,237,245,245,245,254,254,254,255,255,255,178,178,178,214,214,214,242,242,242,235,235,235,240,240,240,240,240,240,241,241,241,240,240,240,241,241,241,242,242,242,242,242,242,240,240,240,240,240,240,242,242,242,240,240,240,242,242,242,242,242,242,218,218,218,163,163,163,169,169,169,169,169,169,186,186,186,217,217,217,230,230,230,180,180,180,204,204,204,180,180,180,212,212,212,199,199,199,203,203,203,183,183,183,208,208,208,199,199,199,198,198,198,188,188,188,187,187,187,179,179,179,222,222,222,222,222,222,183,183,183,190,190,190,190,190,190,189,189,189,193,193,193,220,220,220,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,196,196,196,188,188,188,192,192,192,193,193,193,191,191,191,186,186,186,181,181,181,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,180,180,180,186,186,186,191,191,191,192,192,192,193,193,193,192,192,192,192,192,192,192,192,192,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,192,192,192,192,192,192,193,193,193,193,193,193};
@@ -683,7 +683,7 @@ static constexpr unsigned char sample_filevault_confirm_tahoe[] = {203,203,203,2
static constexpr unsigned char sample_welcome_pending[] = {17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,18,19,22,17,20,21,17,19,21,18,19,21,17,20,21,17,19,22,17,20,21,17,19,21,18,19,22,17,20,21,17,19,21,18,19,21,17,20,21,17,19,22,17,20,21,17,19,21,18,19,22,17,20,21,17,19,21,18,19,21,17,20,21,17,19,22,17,20,21,17,19,21,18,19,22,17,20,21,17,19,21,18,19,21,17,20,21,17,19,22,17,20,21,17,19,21,18,19,22,17,20,21,17,19,21,18,19,21,17,20,21,17,19,22,17,20,21,17,19,21,18,19,22,17,20,21,17,19,21,18,19,21,17,20,21,17,19,22,17,20,21,17,19,21,18,19,22,17,20,21,17,19,21,18,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,21,18,20,21,17,19,21,17,20,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,20,21,17,19,21,17,20,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,20,21,17,19,21,17,20,21,18,19,21,44,45,47,95,96,97,47,49,50,17,19,21,18,20,21,17,19,21,17,20,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,20,21,17,19,21,17,20,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,20,21,17,19,21,17,20,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,20,21,17,19,21,17,20,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,19,21,17,19,22,17,20,21,27,28,30,144,145,145,122,123,123,132,133,133,18,20,22,17,19,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,18,20,21,17,20,21,17,20,22,18,19,21,17,20,21,17,19,21,18,20,21,17,20,22,18,20,21,17,20,21,17,20,22,18,19,21,17,20,21,17,19,21,18,20,21,17,20,22,18,20,21,17,20,21,17,20,22,18,19,21,78,80,81,125,125,126,46,47,49,140,141,141,21,23,24,17,20,21,17,20,22,18,19,21,17,20,21,17,19,21,18,20,21,17,20,22,18,20,21,17,20,21,17,20,22,18,19,21,17,20,21,17,19,21,18,20,21,17,20,22,18,20,21,17,20,21,17,20,22,18,19,21,17,20,21,17,19,21,18,20,21,17,20,22,18,20,21,17,20,21,17,20,22,18,19,21,17,20,21,17,19,21,18,20,21,17,20,22,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,111,112,113,83,84,85,71,73,74,125,125,126,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,18,20,21,17,19,21,17,19,21,35,36,38,92,94,95,78,79,80,18,20,22,17,19,21,41,43,45,28,29,31,34,36,38,88,90,91,19,21,23,17,19,21,18,19,21,59,61,62,97,98,100,52,54,55,17,19,21,18,19,21,131,131,132,58,60,61,111,112,113,91,92,93,18,20,21,17,19,21,67,69,70,97,97,99,77,78,79,21,23,24,18,19,21,21,22,24,80,81,83,97,98,99,60,61,63,18,19,21,17,19,21,17,19,21,51,53,54,81,82,83,92,93,94,75,77,78,30,32,34,89,90,91,85,86,87,24,26,28,18,19,21,17,19,21,36,38,40,94,95,96,75,77,78,18,19,21,17,19,21,17,19,21,18,19,21,17,19,21,17,19,21,18,20,21,19,21,23,138,139,139,124,124,125,135,135,136,60,61,62,17,19,22,126,127,127,71,72,73,61,62,64,143,144,144,46,48,50,17,19,21,54,56,57,151,151,151,110,111,112,141,141,142,27,29,31,17,19,21,146,146,147,66,68,69,146,147,147,48,50,51,17,19,21,82,83,84,146,146,147,109,110,111,130,130,131,76,78,79,18,20,21,115,116,117,142,142,143,104,105,105,140,141,141,96,97,98,23,25,27,39,41,43,141,142,142,142,143,143,99,99,100,124,125,125,145,146,146,121,122,122,122,123,123,95,96,97,18,20,21,21,23,25,141,141,142,123,124,125,134,135,135,65,66,67,18,20,22,17,19,21,18,20,21,17,19,22,17,19,21,17,20,21,42,44,46,135,135,136,23,25,27,128,129,129,66,67,68,17,19,21,141,142,142,52,53,54,27,29,31,140,140,141,70,71,72,17,19,22,104,105,106,94,95,96,37,39,41,146,146,147,31,33,35,17,20,21,144,145,145,137,138,139,113,113,114,17,19,21,19,21,23,143,143,144,69,70,71,17,20,21,32,33,35,34,36,38,51,53,55,145,146,146,44,46,47,17,20,21,92,93,94,141,141,141,152,152,153,152,152,153,146,147,147,96,97,98,17,19,21,86,88,89,118,119,120,19,21,23,86,87,88,110,111,112,17,20,21,55,57,58,137,137,138,23,25,27,115,116,117,76,77,78,17,19,21,17,19,22,17,20,21,17,19,21,18,19,22,17,20,21,17,19,21,34,36,38,17,20,21,146,146,147,45,47,48,38,39,41,148,148,149,42,44,45,17,19,21,140,140,141,142,143,143,108,109,110,133,133,134,123,124,125,143,143,144,108,109,109,17,19,21,18,19,21,133,134,134,142,142,142,42,44,45,17,19,21,71,72,73,144,145,145,40,41,43,18,19,21,17,20,21,18,20,22,126,127,127,131,131,131,18,19,22,17,20,21,100,101,102,99,100,100,54,55,57,56,57,59,132,133,133,59,60,61,18,19,22,107,109,109,80,81,82,18,19,21,100,102,102,93,93,94,17,20,21,60,62,63,134,134,135,65,67,68,148,148,148,44,46,48,28,30,32,17,19,22,17,20,21,17,19,21,17,19,21,18,20,21,17,19,21,17,20,21,18,20,22,145,146,146,71,72,74,123,124,125,142,142,142,93,94,95,97,99,100,140,140,140,56,58,59,93,94,95,117,118,119,142,143,143,123,124,124,50,52,53,71,72,74,131,132,132,144,144,145,133,134,135,64,65,66,67,69,70,144,145,145,139,139,140,108,109,110,47,48,50,56,58,59,125,126,127,135,135,136,141,142,142,74,75,76,75,77,78,146,147,147,58,60,61,18,19,21,18,20,22,149,150,150,38,40,42,17,19,21,131,132,132,59,60,62,17,20,21,100,101,102,108,109,110,47,49,50,89,90,91,146,146,147,148,149,149,92,93,94,66,68,69,149,150,150,49,50,52,18,20,21,17,19,21,17,19,21,17,19,21,17,19,22,17,20,21,17,19,21,76,77,78,144,145,145,132,132,133,72,73,74,130,130,131,144,144,145,70,72,73,17,19,21,17,19,22,20,22,24,86,87,88,142,142,143,148,148,149,148,148,148,107,108,109,41,43,45,83,84,85,139,140,140,148,149,149,103,104,105,39,41,42,113,114,115,146,146,146,151,151,151,121,121,122,43,45,47,62,64,65,135,135,136,148,149,149,94,95,96,17,20,21,17,19,21,32,34,36,138,138,139,23,25,27,17,19,21,139,139,140,42,44,46,17,20,21,40,41,43,125,126,126,147,148,148,143,144,144,107,107,108,134,135,135,151,151,151,150,150,150,94,95,96,17,19,22,17,20,21,17,19,21,18,20,21,17,20,21,17,20,22,18,19,21,17,20,21,17,19,21,18,20,21,17,20,22,18,20,21,17,20,21,17,20,22,18,19,21,17,20,21,17,19,21,18,20,21,17,20,22,24,26,28,47,49,50,19,21,23,18,19,21,17,20,21,17,19,21,18,20,21,17,20,22,18,20,21,17,20,21,17,20,22,35,37,38,31,33,34,17,19,21,18,20,21,17,20,22,18,20,21,17,20,21,17,20,22,18,19,21,17,20,21,17,19,21,18,20,21,17,20,22,18,20,21,21,23,25,17,20,22,18,19,21,17,20,21,17,19,21,25,27,29,17,20,22,18,20,21,23,25,26,46,48,49,32,34,35,17,20,21,17,19,21,18,20,21,17,20,22,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,17,19,21,17,20,21,17,19,22,17,20,21,17,19,21,17,19,22,17,20,21,17,19,21,18,20,21,17,19,21,17,19,21,18,19,21,17,19,21,17,19,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,19,21,17,19,21,17,19,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,19,21,17,19,21,17,19,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,19,21,17,19,21,17,19,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,19,21,17,19,21,17,19,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,19,21,17,19,21,17,19,21,18,19,21,17,19,21,18,20,21,17,19,21,17,19,21,18,19,21,17,19,21,17,19,21,18,19,21,17,19,21};
-static constexpr unsigned char sample_country_tahoe_hidpi[] = {255,255,255,255,255,255,255,255,255,255,255,255,242,247,252,235,244,251,254,254,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,231,241,250,164,203,238,187,216,242,194,220,243,151,196,236,204,226,245,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,246,250,253,116,174,230,254,254,254,255,255,255,203,224,246,195,220,244,189,216,243,215,231,248,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,180,210,242,203,224,246,200,222,245,166,202,240,164,200,239,252,253,254,255,255,255,165,201,239,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,166,201,240,255,255,255,210,228,247,185,212,243,196,219,245,167,201,240,253,253,254,166,201,240,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,180,208,243,232,240,251,246,249,253,165,199,240,251,253,254,175,206,242,253,254,254,158,195,239,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,249,251,254,137,181,237,251,252,254,208,225,247,176,205,242,204,223,247,165,198,241,219,232,249,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,236,243,252,142,182,238,152,189,239,124,171,235,142,183,238,206,223,247,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,247,250,253,241,246,253,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,195,195,195,162,162,162,154,154,154,176,176,176,177,177,177,208,208,208,170,170,170,181,181,181,190,190,190,190,190,190,178,178,178,183,183,183,172,172,172,166,166,166,193,193,193,198,198,198,174,174,174,194,194,194,152,152,152,177,177,177,165,165,165,174,174,174,191,191,191,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,232,232,232,222,222,222,227,227,227,222,222,222,222,222,222,245,245,245,228,228,228,221,221,221,236,236,236,229,229,229,222,222,222,222,222,222,229,229,229,224,224,224,215,215,215,242,242,242,222,222,222,242,242,242,229,229,229,209,209,209,210,210,210,220,220,220,235,235,235,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,155,187,231,125,167,223,125,167,223,125,167,223,125,167,223,125,167,223,125,167,223,125,167,223,125,167,223,125,167,223,125,167,223,125,167,223,125,167,223,125,167,223,125,167,223,125,167,223,125,167,223,125,167,223,125,167,223,125,167,223,125,167,223,125,167,223,125,167,223,125,167,223,125,167,223,125,167,223,125,167,223,125,167,223,125,167,223,125,167,223,125,167,223,125,167,223,125,167,223,125,167,223,125,167,223,125,167,223,125,167,223,125,167,223,125,167,223,125,167,223,209,223,243,199,217,242,255,255,255};
+static constexpr unsigned char sample_country_tahoe_hidpi[] = {255,255,255,255,255,255,255,255,255,255,255,255,242,247,252,235,244,251,254,254,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,231,241,250,164,203,238,187,216,242,194,220,243,151,196,236,204,226,245,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,246,250,253,116,174,230,254,254,254,255,255,255,203,224,246,195,220,244,189,216,243,215,231,248,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,180,210,242,203,224,246,200,222,245,166,202,240,164,200,239,252,253,254,255,255,255,165,201,239,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,166,201,240,255,255,255,210,228,247,185,212,243,196,219,245,167,201,240,253,253,254,166,201,240,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,180,208,243,232,240,251,246,249,253,165,199,240,251,253,254,175,206,242,253,254,254,158,195,239,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,249,251,254,137,181,237,251,252,254,208,225,247,176,205,242,204,223,247,165,198,241,219,232,249,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,236,243,252,142,182,238,152,189,239,124,171,235,142,183,238,206,223,247,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,247,250,253,241,246,253,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,195,195,195,162,162,162,154,154,154,176,176,176,177,177,177,208,208,208,170,170,170,181,181,181,190,190,190,190,190,190,178,178,178,183,183,183,172,172,172,166,166,166,193,193,193,198,198,198,174,174,174,194,194,194,152,152,152,177,177,177,165,165,165,174,174,174,191,191,191,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,232,232,232,222,222,222,227,227,227,222,222,222,222,222,222,245,245,245,228,228,228,221,221,221,236,236,236,229,229,229,222,222,222,222,222,222,229,229,229,224,224,224,215,215,215,242,242,242,222,222,222,242,242,242,229,229,229,209,209,209,210,210,210,220,220,220,235,235,235,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255};
static constexpr unsigned char sample_age_range_tahoe[] = {255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,194,219,246,236,244,252,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,213,230,248,228,239,251,255,255,255,255,255,255,72,147,228,180,210,244,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,248,251,254,211,229,248,255,255,255,255,255,255,209,228,248,225,237,250,255,255,255,214,230,249,136,184,237,165,201,241,253,254,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,244,248,253,223,236,250,249,251,254,225,237,250,151,193,239,157,197,240,241,246,252,81,152,229,29,121,222,38,126,223,197,220,246,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,207,226,248,196,220,246,220,234,249,193,218,246,153,194,240,153,195,240,216,232,249,103,165,232,17,114,220,66,143,227,182,212,244,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,210,228,248,194,218,246,224,236,250,208,227,248,162,200,241,163,200,241,225,237,250,184,213,244,39,127,223,100,163,232,223,236,250,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,239,246,252,203,224,247,254,254,254,255,255,255,177,209,243,180,210,244,255,255,255,248,251,254,54,136,225,129,180,236,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,240,246,252,203,224,247,254,254,254,255,255,255,177,209,243,180,210,244,255,255,255,249,251,254,54,136,225,130,181,236,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,252,253,254,244,248,253,254,254,255,255,255,255,241,246,253,241,246,252,255,255,255,254,254,254,224,236,250,232,241,251,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,214,214,214,225,225,225,230,230,230,213,213,213,216,216,216,224,224,224,225,225,225,230,230,230,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,184,184,184,139,139,139,179,179,179,194,194,194,170,170,170,182,182,182,148,148,148,180,180,180,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,238,238,238,252,252,252,250,250,250,253,253,253,247,247,247,248,248,248,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,253,253,253,254,254,254,254,254,254,254,254,254,246,246,246,244,244,244,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,253,253,253,254,254,254,253,253,253,249,249,249,254,254,254,254,254,254,239,239,239,254,254,254,254,254,254,254,254,254,246,246,246,249,249,249,254,254,254,246,246,246,246,246,246,254,254,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,219,219,219,209,209,209,204,204,204,221,221,221,221,221,221,214,214,214,215,215,215,215,215,215,202,202,202,215,215,215,221,221,221,210,210,210,204,204,204,198,198,198,230,230,230,222,222,222,218,218,218,212,212,212,218,218,218,209,209,209,216,216,216,206,206,206,213,213,213,229,229,229,215,215,215,208,208,208,229,229,229,208,208,208,209,209,209,237,237,237,205,205,205,213,213,213,222,222,222,217,217,217,222,222,222,216,216,216,207,207,207,213,213,213,251,251,251,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,252,252,252,255,255,255,255,255,255,255,255,255,252,252,252,254,254,254,255,255,255,255,255,255,255,255,255,255,255,255,254,254,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,225,225,225,215,215,215,222,222,222,227,227,227,216,216,216,221,221,221,220,220,220,223,223,223,217,217,217,216,216,216,223,223,223,232,232,232,216,216,216,226,226,226,211,211,211,218,218,218,225,225,225,219,219,219,212,212,212,224,224,224,235,235,235,219,219,219,232,232,232,222,222,222,238,238,238,222,222,222,216,216,216,220,220,220,223,223,223,212,212,212,233,233,233,224,224,224,223,223,223,220,220,220,221,221,221,214,214,214,235,235,235,219,219,219,223,223,223,238,238,238,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,250,250,250,245,245,245,241,241,241,247,247,247,247,247,247,240,240,240,246,246,246,243,243,243,241,241,241,239,239,239,246,246,246,249,249,249,243,243,243,248,248,248,243,243,243,242,242,242,236,236,236,244,244,244,242,242,242,239,239,239,245,245,245,241,241,241,248,248,248,232,232,232,246,246,246,234,234,234,239,239,239,242,242,242,246,246,246,236,236,236,250,250,250,239,239,239,243,243,243,244,244,244,241,241,241,242,242,242,245,245,245,242,242,242,241,241,241,251,251,251,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,236,236,236,221,221,221,228,228,228,230,230,230,230,230,230,229,229,229,224,224,224,236,236,236,230,230,230,227,227,227,254,254,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,232,232,232,229,229,229,235,235,235,225,225,225,247,247,247,235,235,235,226,226,226,230,230,230,236,236,236,231,231,231,249,249,249,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,252,252,252,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,252,252,252,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,250,250,250,250,250,250,250,250,250,250,250,250,232,232,232,216,216,216,215,215,215,235,235,235,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,250,250,250,246,248,249,184,211,241,250,250,250,237,237,237,227,227,227,224,224,224,240,240,240,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,229,229,229,250,250,250,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,250,250,250,250,250,250,226,236,246,250,250,250,240,240,240,234,234,234,235,235,235,233,233,233,230,230,230,230,230,230,231,231,231,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,242,242,242,250,250,250,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,250,250,250,250,250,250,250,250,250,250,250,250,248,248,248,243,243,243,244,244,244,241,241,241,242,242,242,238,238,238,243,243,243,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,254,254,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,253,253,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,253,253,253,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,250,250,250,250,250,250,250,250,250,250,250,250,236,236,236,238,238,238,237,237,237,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,250,250,250,247,248,249,186,212,241,250,250,250,237,237,237,202,202,202,205,205,205,248,248,248,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,235,235,235,250,250,250,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,250,250,250,247,248,249,197,219,243,250,250,250,243,243,243,239,239,239,239,239,239,235,235,235,248,248,248,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,235,235,235,250,250,250,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,250,250,250,250,250,250,250,250,250,250,250,250,245,245,245,240,240,240,235,235,235,240,240,240,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,253,253,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,253,253,253,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,254,254,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,250,250,250,250,250,250,250,250,250,250,250,250,247,247,247,247,247,247,247,247,247,249,249,249,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,250,250,250,249,249,249,200,221,243,250,250,250,222,222,222,189,189,189,198,198,198,226,226,226,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,241,241,241,250,250,250,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,250,250,250,244,247,249,133,182,235,250,250,250,247,247,247,245,245,245,250,250,250,248,248,248,248,248,248,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,229,229,229,250,250,250,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,250,250,250,250,250,250,241,244,248,250,250,250,242,242,242,229,229,229,229,229,229,227,227,227,218,218,218,240,240,240,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,252,252,252,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,252,252,252,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255};
@@ -692,3 +692,7 @@ static constexpr unsigned char sample_apple_account_inner[] = {255,255,255,255,2
static constexpr unsigned char sample_analytics_tahoe[] = {255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,169,204,242,163,201,241,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,246,249,253,235,243,252,112,170,234,103,165,232,94,160,231,158,198,241,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,146,191,239,49,133,225,102,164,232,92,158,231,59,139,226,132,182,237,173,206,243,230,240,251,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,138,186,238,35,125,223,92,158,231,82,152,229,46,131,224,112,170,234,16,113,220,174,207,243,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,132,182,237,22,117,221,83,153,230,72,146,228,34,124,223,103,165,233,2,105,218,169,204,242,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,195,219,246,138,185,238,169,204,242,164,201,241,144,189,238,183,212,244,125,178,236,214,231,249,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,182,212,244,151,193,239,151,193,239,151,193,239,151,193,239,151,193,239,151,193,239,197,221,246,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,254,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,175,175,175,167,167,167,164,164,164,148,148,148,154,154,154,176,176,176,197,197,197,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,250,250,250,243,243,243,243,243,243,229,229,229,245,245,245,246,246,246,247,247,247,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,232,232,232,213,213,213,219,219,219,232,232,232,220,220,220,222,222,222,215,215,215,236,236,236,217,217,217,222,222,222,229,229,229,227,227,227,230,230,230,223,223,223,219,219,219,222,222,222,221,221,221,220,220,220,225,225,225,220,220,220,231,231,231,226,226,226,218,218,218,227,227,227,223,223,223,238,238,238,212,212,212,224,224,224,227,227,227,228,228,228,224,224,224,216,216,216,230,230,230,223,223,223,233,233,233,228,228,228,220,220,220,233,233,233,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,252,252,252,243,243,243,237,237,237,251,251,251,239,239,239,237,237,237,244,244,244,247,247,247,244,244,244,244,244,244,244,244,244,239,239,239,241,241,241,244,244,244,245,245,245,244,244,244,244,244,244,237,237,237,245,245,245,243,243,243,249,249,249,249,249,249,237,237,237,246,246,246,248,248,248,248,248,248,245,245,245,244,244,244,249,249,249,240,240,240,244,244,244,243,243,243,244,244,244,242,242,242,245,245,245,244,244,244,246,246,246,247,247,247,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,235,235,235,221,221,221,233,233,233,227,227,227,227,227,227,239,239,239,225,225,225,228,228,228,226,226,226,230,230,230,218,218,218,228,228,228,230,230,230,218,218,218,246,246,246,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,244,244,244,239,239,239,247,247,247,239,239,239,241,241,241,245,245,245,236,236,236,240,240,240,239,239,239,245,245,245,237,237,237,240,240,240,238,238,238,234,234,234,249,249,249,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,254,254,254,254,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,236,236,236,241,241,241,191,191,191,202,202,202,202,202,202,209,209,209,189,189,189,221,221,221,199,199,199,199,199,199,203,203,203,203,203,203,217,217,217,194,194,194,217,217,217,196,196,196,197,197,197,201,201,201,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,251,251,251,252,252,252,236,236,236,237,237,237,245,245,245,237,237,237,238,238,238,246,246,246,235,235,235,240,240,240,235,235,235,243,243,243,241,241,241,244,244,244,241,241,241,232,232,232,240,240,240,238,238,238,246,246,246,240,240,240,241,241,241,242,242,242,241,241,241,240,240,240,242,242,242,240,240,240,247,247,247,243,243,243,239,239,239,240,240,240,238,238,238,241,241,241,235,235,235,250,250,250,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,243,243,243,232,232,232,238,238,238,233,233,233,233,233,233,240,240,240,238,238,238,234,234,234,239,239,239,236,236,236,244,244,244,236,236,236,238,238,238,236,236,236,237,237,237,240,240,240,236,236,236,237,237,237,241,241,241,228,228,228,242,242,242,237,237,237,237,237,237,239,239,239,237,237,237,233,233,233,238,238,238,240,240,240,234,234,234,235,235,235,236,236,236,243,243,243,253,253,253,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,224,224,224,225,225,225,219,219,219,217,217,217,231,231,231,223,223,223,216,216,216,225,225,225,222,222,222,224,224,224,230,230,230,226,226,226,232,232,232,222,222,222,211,211,211,234,234,234,219,219,219,220,220,220,235,235,235,230,230,230,210,210,210,226,226,226,226,226,226,222,222,222,233,233,233,218,218,218,232,232,232,226,226,226,216,216,216,236,236,236,225,225,225,224,224,224,219,219,219,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,225,225,225,224,224,224,218,218,218,224,224,224,235,235,235,221,221,221,227,227,227,223,223,223,218,218,218,224,224,224,251,251,251,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,254,254,254,254,254,254,254,254,254,254,254,255,255,255,254,254,254,255,255,255,254,254,254,254,254,254,254,254,254,254,254,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,254,254,254,254,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,245,245,245,247,247,247,235,235,235,238,238,238,238,238,238,245,245,245,238,238,238,236,236,236,243,243,243,239,239,239,241,241,241,238,238,238,237,237,237,243,243,243,233,233,233,236,236,236,243,243,243,237,237,237,242,242,242,235,235,235,243,243,243,235,235,235,239,239,239,236,236,236,238,238,238,238,238,238,245,245,245,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,253,253,253,253,253,245,245,245,245,245,245,250,250,250,247,247,247,249,249,249,245,245,245,248,248,248,246,246,246,247,247,247,247,247,247,245,245,245,247,247,247,246,246,246,248,248,248,248,248,248,244,244,244,247,247,247,248,248,248,246,246,246,246,246,246,248,248,248,251,251,251,243,243,243,248,248,248,246,246,246,247,247,247,248,248,248,247,247,247,246,246,246,248,248,248,250,250,250,245,245,245,248,248,248,250,250,250,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,249,249,249,243,243,243,246,246,246,243,243,243,245,245,245,244,244,244,246,246,246,245,245,245,244,244,244,245,245,245,246,246,246,248,248,248,242,242,242,245,245,245,246,246,246,248,248,248,245,245,245,248,248,248,243,243,243,243,243,243,248,248,248,248,248,248,243,243,243,246,246,246,245,245,245,242,242,242,248,248,248,242,242,242,245,245,245,249,249,249,249,249,249,245,245,245,245,245,245,248,248,248,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,241,241,241,238,238,238,241,241,241,239,239,239,237,237,237,245,245,245,236,236,236,234,234,234,243,243,243,236,236,236,237,237,237,241,241,241,238,238,238,243,243,243,238,238,238,239,239,239,250,250,250,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255};
static constexpr unsigned char sample_welcome_tahoe[] = {112,172,208,113,172,208,112,172,208,113,172,208,113,172,208,113,172,207,113,171,207,113,171,207,112,171,207,112,170,208,112,170,208,112,170,207,111,170,207,111,170,207,111,169,207,110,169,207,110,169,207,109,168,206,109,168,206,108,168,206,108,168,206,108,167,206,107,167,206,106,166,206,107,166,206,106,166,206,105,166,205,104,165,204,105,165,204,104,165,204,104,165,205,103,164,205,102,164,205,101,163,204,101,162,203,100,162,204,99,162,203,100,162,203,98,161,203,97,161,203,97,160,203,96,160,202,95,159,202,93,159,202,92,158,201,92,158,201,93,158,201,93,157,201,93,157,200,92,157,200,116,173,208,117,173,208,118,173,208,118,173,208,119,174,208,119,173,208,118,173,208,117,173,208,117,173,208,118,173,208,117,172,208,117,172,207,116,172,207,116,172,207,116,172,207,115,171,207,115,171,207,114,170,206,131,184,214,148,204,228,124,178,211,114,169,206,113,169,206,112,168,206,112,168,205,112,168,206,111,168,205,110,167,205,109,167,205,108,166,204,107,166,204,107,165,204,107,165,204,106,164,203,105,164,203,104,163,203,103,163,203,104,163,203,103,163,203,102,162,203,101,161,202,100,161,202,99,160,201,98,160,201,96,159,201,96,159,201,97,159,201,97,158,200,97,158,200,97,158,200,118,174,208,120,174,208,121,175,208,121,174,207,122,174,208,122,175,208,122,175,208,121,174,207,121,174,207,121,174,207,121,174,207,121,174,207,121,174,207,120,173,207,120,173,207,119,173,207,118,172,206,127,178,210,173,233,251,156,215,242,152,213,242,116,170,205,117,170,205,116,170,205,117,170,205,117,170,204,117,170,204,115,169,205,114,168,204,113,167,204,112,167,203,111,166,203,111,166,203,112,166,203,112,167,204,112,167,204,112,166,204,110,163,201,110,163,200,109,162,199,106,161,201,107,161,199,107,160,198,105,158,196,108,157,192,110,157,192,102,151,188,98,149,190,102,155,193,108,161,197,121,174,206,124,174,206,125,175,206,126,175,205,126,174,205,126,175,205,126,174,205,126,174,205,125,174,205,125,174,205,124,174,206,124,174,206,124,174,206,125,174,206,125,174,206,124,174,206,123,173,205,157,207,226,164,216,241,139,190,216,167,225,250,119,169,202,120,171,204,121,171,204,122,171,204,122,170,203,122,170,203,121,170,202,119,168,201,113,164,198,118,165,196,126,167,197,109,154,188,98,146,184,120,160,191,112,153,185,84,135,175,89,133,171,77,126,168,70,123,166,72,123,165,83,132,169,127,161,184,108,147,176,111,148,176,81,128,167,75,125,167,97,140,174,102,145,178,105,145,178,142,180,203,157,186,204,171,194,205,182,199,204,176,194,202,180,197,203,180,197,205,188,203,210,179,198,207,160,187,203,138,176,202,131,175,203,131,175,203,134,176,203,132,176,202,134,177,203,144,181,203,188,226,239,154,194,220,157,202,221,167,215,240,124,172,203,124,172,203,125,171,201,117,162,193,106,152,186,95,142,177,84,130,168,73,120,159,68,115,156,144,171,189,187,199,205,126,154,177,90,129,166,76,120,164,72,120,162,90,131,164,142,162,176,125,149,166,143,162,174,130,157,176,95,133,167,103,139,171,73,118,157,81,122,160,69,113,155,67,114,156,78,119,158,89,128,164,70,116,156,172,190,202,203,220,231,187,203,214,193,200,201,181,192,197,190,203,209,172,187,197,188,202,207,190,210,222,179,191,197,201,207,207,183,195,200,182,202,213,175,202,224,116,152,182,98,137,169,118,150,174,217,237,247,178,194,205,197,221,234,160,190,213,107,149,179,102,142,177,132,165,190,162,187,206,132,160,186,120,147,169,167,181,192,162,176,187,163,184,199,174,197,212,129,157,180,127,151,173,100,133,161,101,124,141,109,122,132,132,142,145,145,152,157,121,128,134,59,74,78,135,146,149,151,166,173,115,144,167,84,121,156,74,112,151,102,136,167,158,186,208,147,171,193,128,154,174,141,163,179,179,212,242,163,191,218,199,224,242,153,173,186,144,164,178,203,227,241,143,170,192,152,186,208,175,212,247,122,153,178,116,146,170,156,180,194,185,217,246,154,189,221,193,215,233,146,168,184,145,165,177,230,242,242,172,186,192,187,214,240,111,141,170,73,114,148,148,173,189,196,216,229,162,187,209,187,215,238,176,191,199,188,195,196,222,232,236,219,228,232,180,199,215,208,228,242,162,178,188,89,105,109,60,74,81,149,155,161,142,146,151,100,114,127,130,140,150,146,152,157,116,130,139,136,155,170,127,143,151,126,153,171,125,146,166,190,215,236,171,194,216,201,221,236,129,152,176,96,126,154,176,203,230,78,116,150,165,195,228,121,147,175,99,129,157,171,205,239,112,144,172,117,152,178,170,207,244,113,146,175,100,130,156,160,190,216,141,170,198,105,136,165,191,214,235,162,176,178,171,175,171,208,218,216,198,207,205,181,194,196,118,132,130,121,133,128,187,200,198,134,147,148,104,131,152,123,141,149,138,152,157,145,163,180,190,214,234,153,170,181,99,130,157,155,174,189,154,165,175,155,162,167,157,164,169,152,158,164,113,121,129,21,36,49,112,123,133,143,150,154,33,50,60,92,108,120,119,127,132,77,112,144,133,159,181,172,197,227,83,113,144,149,178,209,126,152,180,79,109,139,59,104,144,62,105,145,149,180,222,73,111,148,88,126,162,144,176,219,69,108,144,59,101,140,166,194,226,188,206,221,206,211,205,183,199,211,166,186,201,201,217,228,184,194,203,96,106,104,115,126,126,191,200,199,177,186,186,68,81,86,40,55,62,99,112,117,148,157,160,76,90,94,55,68,70,60,71,75,148,156,153,226,231,226,205,213,210,182,187,176,124,137,129,155,172,181,143,156,166,127,142,151,127,140,145,202,208,210,150,156,158,152,159,161,183,189,192,144,150,152,64,77,84,129,143,154,114,126,132,42,79,107,98,134,169,145,171,207,99,133,165,157,186,222,94,126,157,69,107,141,11,73,115,35,92,132,146,175,209,72,118,147,158,184,202,148,174,205,93,131,156,133,163,182,166,185,206,158,170,175,179,190,193,164,179,187,195,204,208,158,173,183,114,127,129,119,134,137,155,165,169,151,160,164,130,138,142,66,83,90,81,95,103,151,158,162,149,157,161,112,123,128,58,73,79,88,99,103,188,196,195,209,217,213,193,201,200,121,132,133,113,124,126,208,218,218,138,146,148,101,110,110,121,130,132,204,212,211,132,138,138,80,89,92,154,160,164,89,102,111,29,46,57,111,125,137,117,126,131,50,82,103,85,133,170,150,177,211,141,168,202,103,139,170,57,108,146,140,170,206,16,100,137,15,99,135,127,161,183,185,200,205,163,176,182,116,135,149,151,175,194,165,185,198,146,155,159,93,100,103,82,94,98,79,93,99,155,168,173,167,177,182,173,184,187,165,179,182,107,121,128,48,65,73,103,117,126,136,145,152,136,143,149,102,112,117,65,80,87,138,149,155,156,162,165,155,162,164,171,176,174,112,120,120,112,124,129,179,188,189,198,207,206,163,171,171,101,111,112,97,107,108,98,107,109,181,190,191,74,83,87,62,72,78,145,152,158,65,78,86,21,38,51,47,65,79,129,140,151,137,151,167,120,156,192,102,145,174,133,169,196,135,175,209,130,167,204,89,137,168,19,105,137,19,105,136,37,99,119,85,111,118,110,121,122,81,93,95,94,106,108,139,148,146,73,82,88,65,74,78,28,43,49,38,52,58,78,88,92,92,99,102,97,111,111,86,99,103,26,42,49,28,43,51,26,43,50,30,46,54,33,48,56,42,54,60,34,47,52,83,94,95,95,107,111,125,135,133,169,173,168,81,90,91,141,148,144,144,151,148,137,146,145,107,117,116,110,120,120,78,89,90,54,65,69,68,78,85,50,60,67,36,49,56,35,50,60,24,39,52,23,39,53,36,49,59,23,40,49,23,58,73,12,99,132,10,97,129,14,101,132,26,105,136,16,100,131,10,97,129,68,138,156,89,144,154,145,164,159,115,128,126,84,99,99,127,138,136,161,170,165,70,81,86,33,46,52,29,41,45,19,33,38,66,79,81,153,162,158,152,159,156,93,104,102,70,83,85,29,44,51,27,40,48,19,33,41,30,45,54,36,51,61,20,34,42,23,36,43,28,41,48,55,68,74,90,100,97,102,113,113,105,114,115,157,162,160,132,141,139,111,122,122,84,94,96,61,71,75,48,59,63,39,50,55,37,49,55,40,53,59,36,50,57,35,49,57,21,36,47,32,46,58,41,53,63,44,57,61,40,62,67,41,102,116,30,96,111,24,97,114,18,94,114,14,101,127,14,101,127,78,136,149,75,127,138,75,119,128,37,78,86,69,106,110,54,88,90,59,93,96,36,71,79,27,64,72,20,55,61,27,59,61,115,141,138,114,143,140,116,146,144,71,102,102,30,62,63,16,51,55,18,49,56,12,44,49,23,57,61,61,93,96,39,74,73,31,66,66,26,66,73,48,87,100,48,86,98,70,98,105,146,155,150,104,115,116,72,85,87,86,97,99,77,87,90,65,75,78,50,60,65,40,51,56,37,48,54,45,57,63,33,46,53,27,40,48,47,56,63,44,55,62,49,60,67,51,63,65,63,88,87,41,129,142,34,123,139,32,123,139,34,125,140,33,125,139,33,124,139,52,144,159,52,143,158,49,141,154,45,137,151,42,131,145,36,123,138,45,131,148,47,132,150,38,123,143,40,121,138,41,119,134,34,114,130,40,121,139,38,119,139,37,119,137,37,119,136,34,118,135,38,124,137,38,126,135,39,130,136,41,133,137,41,133,136,41,133,137,42,136,142,42,136,146,40,130,140,117,149,148,67,79,81,68,82,87,83,96,100,73,85,87,64,75,77,50,60,66,44,55,62,38,48,55,35,46,52,47,59,64,45,56,60,72,79,81,71,77,77,62,69,74,48,58,61,51,62,62,133,139,132,115,157,155,40,126,141,36,126,142,38,130,143,38,129,141,37,128,141,51,142,153,49,141,152,48,141,153,47,140,153,42,136,149,41,135,147,40,135,148,41,135,149,37,131,146,38,129,145,41,128,143,46,130,144,40,128,143,35,127,143,32,125,141,34,128,144,38,131,146,41,134,147,42,135,147,42,136,146,40,133,144,40,131,144,35,126,139,35,125,139,34,122,139,75,135,143,116,129,126,97,108,111,102,114,117,94,106,109,69,81,86,41,53,57,44,55,60,46,57,63,43,54,61,45,55,60,75,84,86,98,104,105,93,98,98,79,85,85,30,40,47,41,51,53,59,66,66,158,164,159,155,163,157,91,130,134,32,118,137,34,124,138,51,131,143,129,167,164,53,146,152,55,147,155,53,146,155,51,144,155,45,139,148,39,134,145,40,133,147,50,136,150,97,156,162,148,174,171,185,190,181,190,191,181,181,186,179,151,173,171,96,150,157,32,117,141,26,112,136,28,114,137,32,116,140,30,113,138,27,108,135,28,107,135,23,104,129,24,104,130,25,103,127,125,144,146,99,113,112,95,106,106,108,118,117,85,95,96,45,57,62,38,49,55,32,44,50,53,64,68,111,118,119,144,151,147,153,160,156,155,161,156,142,148,143,75,83,83,21,31,39,41,51,52,109,116,113,163,171,164,148,157,153,130,140,138,95,138,145,86,141,146,146,162,153,132,145,141,52,137,149,49,134,147,48,132,147,40,125,142,36,121,140,35,121,141,106,154,160,183,189,180,165,169,161,182,184,174,183,184,176,180,181,175,176,177,172,177,178,173,171,173,167,94,129,137,22,102,131,22,103,131,23,103,132,20,101,130,21,101,131,21,101,131,19,98,128,64,122,140,157,171,167,184,187,178,182,186,177,175,179,171,171,175,167,173,177,169,173,176,168,129,135,131,118,125,124,175,180,173,174,177,170,167,171,165,146,150,146,142,148,145,152,158,153,133,138,135,101,108,108,59,67,68,157,164,160,165,171,165,136,144,140,128,137,136,115,127,126,139,149,141,160,171,162,143,156,148,38,124,135,37,124,136,39,128,140,39,128,142,37,125,142,128,161,164,187,188,179,180,182,173,147,151,147,166,169,163,150,152,150,116,119,118,91,92,95,94,96,96,86,91,96,105,111,112,69,121,132,28,114,140,28,111,139,25,108,135,20,103,130,23,105,134,86,136,148,184,188,178,179,182,173,169,172,165,155,159,154,154,158,154,151,157,152,151,155,149,150,153,145,158,163,156,173,176,171,167,170,164,155,159,154,133,138,134,65,68,72,107,113,112,122,129,126,106,116,114,133,141,140,53,66,70,51,64,70,113,122,122,120,127,122,71,86,90,44,63,69,55,75,80,109,125,123,93,109,107,46,139,150,44,138,150,46,138,154,41,133,150,66,138,148,157,165,159,144,150,147,129,135,133,91,98,101,77,80,82,49,51,57,92,98,100,91,101,104,54,62,71,68,76,83,48,60,69,43,68,76,36,126,142,37,125,144,30,119,138,30,116,138,50,122,141,153,162,156,142,149,144,139,145,141,131,136,132,137,143,141,135,139,137,149,154,151,167,172,168,170,175,170,162,166,161,173,177,172,175,179,174,158,164,160,153,159,155,143,148,146,75,79,84,44,50,54,38,49,53,44,59,62,66,80,83,52,65,71,26,42,49,81,90,87,55,72,76,68,87,90,47,69,75,65,103,114,84,119,116,31,114,135,32,117,137,28,117,133,38,122,143,161,181,174,175,181,172,152,160,155,136,145,145,88,102,107,42,56,64,35,48,58,59,73,79,43,55,63,36,49,58,39,50,59,42,52,60,47,62,68,48,144,149,44,142,150,42,137,147,35,126,138,114,152,155,174,179,171,160,167,161,157,162,157,164,169,165,164,170,167,157,162,160,152,156,154,165,169,166,168,172,170,170,174,171,171,175,171,173,176,171,173,178,172,178,183,177,185,188,183,189,190,183,115,119,119,45,56,59,43,58,62,55,69,74,122,133,135,41,56,60,39,54,60,39,56,62,36,55,62,34,55,63,52,91,111,86,123,133,45,139,151,45,138,150,41,132,147,68,135,146,174,181,175,133,148,148,101,118,124,75,93,101,47,65,74,39,57,68,41,57,69,40,55,66,44,53,63,45,55,64,97,103,107,126,131,131,132,138,139,124,158,160,85,140,151,39,115,140,30,103,123,146,156,153,175,180,171,170,176,169,171,177,171,169,175,170,166,172,168,159,165,161,178,181,178,181,185,183,181,184,181,181,183,179,179,181,175,166,171,163,145,152,147,141,147,142,160,164,158,151,156,151,153,159,155,83,91,92,18,29,38,21,33,43,37,52,59,29,47,55,20,38,44,18,42,49,21,48,52,31,66,70,58,119,138,68,135,151,40,125,146,37,122,142,48,130,154,65,134,155,94,123,125,77,98,100,41,63,70,24,44,55,21,38,50,23,39,50,23,37,49,23,36,46,44,53,59,122,124,122,137,135,128,124,122,115,140,140,133,127,130,124,106,112,108,81,108,118,50,109,134,79,109,123,114,132,127,108,125,119,106,120,113,109,121,114,113,125,113,120,129,122,137,143,137,140,148,143,152,159,155,146,153,149,130,137,134,101,109,109,68,78,79,56,68,68,80,92,86,74,87,83,67,81,74,47,63,59,32,47,44,41,57,50,72,92,82,85,106,95,94,120,107,94,133,114,97,146,128,89,151,141,87,159,162,92,163,164,87,144,166,60,129,158,66,132,161,67,133,161,87,137,156,95,129,133,93,121,124,84,109,111,70,94,100,66,90,96,62,87,90,64,87,89,60,84,86,70,95,95,64,94,104,48,86,105,52,100,126,53,113,145,53,117,151,39,113,149,40,116,152,42,108,140,73,119,137,83,125,136,96,129,131,101,130,130,99,123,122,105,122,115,119,134,123,128,143,128,114,130,115,124,139,123,118,132,116,99,114,100,84,99,90,88,103,95,105,120,109,104,120,103,87,103,84,71,82,66,68,77,63,72,80,61,93,101,80,102,115,100,85,110,113,75,112,127,68,116,134,64,120,142,69,130,156,75,136,156,110,128,126,61,128,152,60,135,166,54,130,162,56,130,157,64,131,152,86,139,152,78,131,145,68,122,138,73,126,140,81,128,138,79,137,143,81,134,136,62,125,132,50,119,131,40,118,132,39,121,143,45,134,153,52,146,161,55,148,165,56,148,166,58,145,161,69,141,160,65,133,149,75,138,152,64,129,146,70,126,139,74,123,131,77,121,124,85,124,122,88,122,117,82,115,110,80,117,108,82,117,106,76,108,101,80,112,102,85,119,107,86,122,107,69,112,98,49,100,88,38,94,84,36,89,77,61,113,99,75,128,121,56,129,140,42,121,138,40,112,138,43,114,143,49,119,149,46,117,146,104,115,110,111,139,136,55,137,159,51,136,159,58,143,164,59,140,159,66,144,154,68,148,154,57,126,142,65,122,140,85,128,145,84,125,143,78,119,136,68,116,139,55,113,138,47,110,137,48,116,144,51,124,154,48,127,157,48,132,160,54,143,165,52,143,160,54,142,160,72,149,161,79,152,162,77,154,158,99,159,157,85,148,147,83,138,134,101,142,131,103,137,125,82,126,117,75,121,111,76,118,109,67,112,106,68,115,107,72,124,112,85,135,117,85,139,118,77,139,116,69,136,114,75,141,118,79,141,121,88,144,124,69,150,144,60,150,149,54,146,151,50,141,148,51,144,151,54,146,150,115,125,116,149,159,147,113,165,167,57,146,158,58,145,164,61,143,164,66,144,160,63,143,156,53,132,150,43,122,142,41,114,139,40,112,137,44,113,139,52,118,145,47,118,143,47,120,145,51,125,150,49,125,151,45,126,150,50,137,157,54,148,161,45,135,152,49,139,152,51,142,151,55,144,153,68,155,159,85,163,156,81,161,152,80,156,146,85,152,140,92,152,137,83,148,134,68,142,131,67,139,126,66,133,121,67,131,118,70,128,115,75,136,120,85,142,120,79,142,120,76,142,120,77,145,121,89,153,129,98,158,138,84,162,149,74,160,153,80,165,154,78,165,155,83,167,157,83,168,163,147,158,147,132,143,135,123,145,138,67,157,162,56,148,155,59,149,155,58,140,150,49,129,140,47,125,144,50,124,145,51,125,145,44,119,141,50,122,145,50,122,145,43,115,136,35,108,130,36,113,138,32,109,137,38,118,147,41,122,148,60,151,160,64,159,163,64,160,161,63,159,160,74,163,160,90,170,162,98,172,161,93,166,154,101,164,151,99,159,146,93,156,142,97,161,142,96,159,140,91,157,138,96,161,139,98,162,140,100,159,136,100,154,132,92,154,133,87,152,131,86,154,132,87,154,132,93,163,142,98,166,147,91,166,153,81,165,158,84,167,157,84,167,159,89,168,158,90,168,156,94,106,102,64,78,78,60,76,76,81,159,157,74,157,160,74,157,152,84,163,157,85,162,158,87,164,154,92,168,157,84,166,156,73,161,155,75,163,155,83,168,163,80,167,160,74,164,162,69,164,162,71,165,160,81,170,164,81,170,166,77,168,166,70,163,160,72,163,157,79,167,162,82,169,161,95,174,166,94,171,162,91,169,157,93,168,152,98,167,149,102,167,149,92,163,145,89,161,143,90,159,140,92,159,139,91,155,137,101,161,139,94,149,130,57,117,116,52,103,108,45,97,108,44,93,108,54,105,125,59,114,133,54,117,138,50,118,138,53,126,141,70,143,152,82,158,155,88,162,151,15,31,39,12,30,39,16,42,55,54,121,145,50,121,148,50,126,144,77,152,153,99,168,160,94,166,157,87,161,156,87,161,154,92,165,156,90,167,157,86,164,157,86,167,156,81,164,159,75,161,157,77,163,158,87,167,160,77,160,160,74,154,163,73,154,163,76,154,159,76,151,153,86,157,160,89,160,158,84,152,153,81,155,150,91,160,149,97,164,149,104,166,148,102,165,146,102,161,144,98,157,140,92,155,138,88,155,136,96,158,138,101,162,140,75,144,131,46,118,120,34,102,113,30,95,113,27,91,114,24,86,113,32,100,129,31,104,127,32,108,130,48,123,138,66,143,147,86,160,150,18,42,51,19,50,63,27,74,100,38,106,140,35,103,137,40,106,137,46,113,142,49,115,142,48,117,144,50,118,144,43,114,139,46,118,140,60,133,147,82,157,153,86,161,152,84,162,155,71,154,154,70,152,154,68,150,154,52,131,146,50,127,140,51,127,142,46,120,145,43,114,137,54,120,145,57,122,145,52,118,141,45,114,135,43,114,132,52,123,137,58,127,135,64,133,135,78,145,135,94,157,140,98,159,138,97,160,137,99,159,139,103,160,138,106,162,141,95,157,138,95,158,138,94,158,138,91,155,140,94,156,141,92,157,142,90,160,145,96,163,147,101,166,146,98,165,147,91,161,146,26,83,99,36,100,114,56,123,133,70,141,155,61,134,147,62,132,145,68,139,147,86,155,154,87,156,150,84,154,148,90,156,147,93,159,151,96,161,151,94,161,150,78,155,149,89,161,151,89,160,149,89,158,146,78,155,150,60,141,146,55,132,135,62,133,136,61,135,140,55,132,133,51,128,134,44,119,129,33,96,117,31,90,110,32,94,115,35,102,120,46,115,124,58,130,129,79,151,140,95,163,144,99,164,142,93,161,141,102,162,142,106,164,144,102,162,141,93,157,137,93,157,136,94,159,139,93,158,140,104,165,146,103,166,148,99,165,149,98,163,146,91,160,144,98,163,146,97,164,150,88,144,134,97,152,144,100,162,156,100,163,156,105,165,154,99,162,150,107,166,153,103,165,154,101,164,155,101,163,152,103,165,152,101,164,151,95,161,155,98,164,154,99,165,157,100,166,155,95,164,157,93,162,156,90,157,150,128,169,160,170,181,172,188,190,177,184,187,176,166,180,171,117,169,158,90,159,151,99,165,155,102,166,152,103,168,152,104,169,152,112,170,152,102,164,148,96,161,144,105,166,145,102,164,142,99,162,140,95,158,138,102,162,142,103,163,142,99,159,136,93,154,134,91,155,135,94,157,138,101,162,144,102,164,146,102,163,146,96,162,146,92,162,149,99,163,147,93,159,146,124,169,151,107,162,150,98,159,150,89,157,154,88,156,157,98,162,160,105,165,160,102,161,157,96,158,158,86,153,153,84,151,155,81,148,150,83,151,148,85,151,147,87,153,142,100,162,149,95,160,147,127,169,158,178,186,173,180,181,164,178,179,168,167,170,159,168,172,161,157,160,149,162,164,150,162,177,162,128,172,155,117,171,153,102,162,146,101,163,147,90,158,140,92,158,138,90,156,135,95,159,139,94,158,137,94,157,136,93,157,135,99,159,139,98,158,138,99,161,138,106,166,142,100,161,139,100,160,139,101,159,138,99,158,140,99,160,144,94,158,145,95,162,147,104,165,148,105,163,146,86,145,141,84,144,141,84,146,145,69,137,146,61,130,144,63,129,143,70,136,147,61,130,143,58,126,141,60,128,139,66,132,138,70,135,141,66,134,140,79,144,148,77,145,150,67,137,142,98,145,140,163,167,150,162,165,148,153,154,140,176,178,167,140,142,133,145,148,137,128,130,122,130,132,122,128,129,117,140,147,134,110,153,136,114,167,146,114,168,147,108,166,144,109,165,143,112,166,145,110,164,141,107,162,142,107,162,140,111,163,140,113,162,139,109,161,136,107,160,136,105,160,137,100,156,134,110,163,139,111,163,139,112,163,143,110,163,142,110,163,141,112,168,150,110,165,148,106,162,145,80,141,140,65,130,136,65,128,140,63,128,143,70,137,152,83,146,152,88,149,152,85,149,154,95,156,156,105,161,154,109,164,148,111,165,148,111,165,149,109,155,144,102,144,145,110,146,152,127,145,146,119,128,124,122,127,116,124,127,113,114,115,105,93,94,88,86,87,82,78,80,74,70,71,68,72,74,70,85,88,82,98,110,108,93,131,125,94,150,134,111,165,139,118,169,143,121,170,145,120,169,141,122,171,142,120,168,139,118,165,139,117,165,139,117,166,138,115,164,138,116,165,138,112,162,135,111,160,136,110,159,137,107,158,136,107,158,136,107,158,132,112,163,138,111,160,138,139,173,153,110,161,147,115,165,151,122,171,157,118,172,160,116,169,156,116,170,160,114,169,163,119,171,157,121,169,154,121,170,157,121,168,151,120,167,148,118,165,146,82,131,133,56,105,123,64,107,126,73,109,125,80,110,121,92,111,114,95,106,101,88,96,92,75,82,79,67,75,75,67,77,79,60,76,81,66,84,90,63,94,108,64,105,126,44,97,122,45,99,125,49,105,121,102,150,138,123,165,140,123,164,141,122,162,139,127,168,143,120,163,139,121,164,139,114,161,136,116,163,136,119,165,136,118,163,138,106,154,135,108,157,135,108,157,135,107,156,136,111,160,140,130,170,152,172,187,172,182,188,177,107,161,148,117,166,151,118,167,153,116,170,158,113,169,158,106,163,154,120,168,155,120,165,150,118,164,149,121,166,150,121,166,153,113,162,152,111,160,148,113,158,145,69,123,124,37,95,117,38,95,125,44,98,123,64,103,117,70,101,111,80,108,114,63,90,99,57,87,97,41,79,98,33,80,107,27,80,111,23,80,114,20,76,107,19,77,107,25,86,115,31,94,119,31,100,124,65,125,129,115,157,138,116,157,139,126,165,142,126,165,142,128,168,141,117,160,136,120,162,135,125,167,136,126,169,138,113,156,133,113,156,133,117,161,140,129,168,151,169,186,173,183,189,177,179,186,177,159,166,154,117,163,147,112,163,150,115,168,155,112,166,154,118,168,156,128,174,162,129,173,161,125,169,155,113,162,154,107,158,156,107,159,151,106,157,151,109,160,151,119,163,152,112,160,154,87,144,148,83,144,154,77,130,143,91,132,139,84,124,130,86,124,129,86,120,125,89,121,119,84,120,121,63,116,128,60,121,135,53,123,144,74,135,145,97,150,148,113,160,149,109,157,143,119,161,143,133,169,145,126,164,142,112,155,137,117,158,136,121,160,138,123,163,138,119,161,136,119,160,136,118,159,135,111,153,130,111,155,130,129,166,143,168,185,172,188,193,188,180,186,178,159,166,157,117,125,114,79,87,79,117,162,153,112,158,152,100,150,146,111,161,149,123,168,153,126,165,145,123,163,143,123,164,146,123,164,148,119,162,143,110,157,144,112,156,145,116,159,147,109,153,140,103,149,139,104,155,144,110,157,146,99,149,142,95,145,140,90,139,138,101,139,135,104,142,136,99,140,136,94,140,136,93,137,133,83,134,138,74,130,137,79,134,136,75,132,134,71,130,130,81,132,130,102,144,130,117,154,138,122,158,137,125,163,138,124,163,136,126,165,136,119,159,133,122,160,134,115,155,133,120,158,134,140,169,152,168,185,172,186,192,184,183,188,179,167,174,169,127,134,127,77,87,76,82,91,80,69,78,71,86,121,125,88,123,128,71,112,122,63,112,122,67,116,125,104,143,135,125,159,143,125,162,144,124,161,142,120,159,141,118,157,140,133,167,146,140,172,150,127,163,145,120,160,143,111,154,140,110,154,142,94,147,143,85,138,135,90,135,132,88,132,127,95,133,126,80,128,126,83,130,134,68,122,134,59,114,130,47,107,124,51,113,128,50,112,127,56,115,124,59,115,121,62,117,120,95,142,130,115,156,138,125,163,141,120,160,136,118,157,131,130,163,140,148,172,153,164,179,165,183,192,181,180,188,179,177,185,176,173,180,171,139,148,141,91,101,95,79,89,83,61,72,65,67,77,69,53,62,56,66,112,129,60,108,126,51,104,128,44,101,123,41,99,120,65,121,132,68,123,130,107,151,143,119,158,145,125,163,147,132,168,153,135,171,155,123,163,151,128,164,148,129,164,147,117,157,142,117,160,146,118,158,143,109,149,135,107,147,134,110,152,140,96,141,136,91,142,135,84,138,135,71,133,134,78,138,139,85,144,143,86,143,141,80,136,128,116,162,143,123,163,142,122,164,134,120,161,136,130,165,140,142,169,148,161,179,160,174,183,166,180,186,171,181,188,176,179,187,177,175,183,173,174,181,172,152,159,151,100,108,100,70,80,71,73,84,74,64,73,67,49,58,53,41,51,47,43,53,51,39,96,121,34,91,115,31,87,110,41,100,118,70,121,130,69,123,129,83,134,130,112,153,139,133,166,149,138,171,152,136,169,152,130,164,149,128,165,149,129,165,150,129,164,147,132,167,147,129,164,145,128,166,149,128,164,145,130,164,144,165,189,172,226,235,230,238,244,240,238,244,240,237,243,239,237,243,239,238,244,240,238,244,240,229,237,232,157,186,164,125,164,132,136,168,145,169,184,169,186,193,179,182,188,177,166,175,162,167,176,164,179,186,176,179,186,178,179,187,178,135,144,136,100,108,101,66,75,69,66,74,68,63,72,65,69,79,70,51,60,54,47,56,52,34,43,42,28,37,39,76,125,124,88,136,132,99,143,137,116,157,144,122,159,144,109,147,134,119,155,133,130,164,144,130,164,148,133,166,149,145,173,152,128,161,143,124,159,141,126,161,140,128,162,140,128,162,141,129,164,143,126,162,141,125,162,144,133,164,144,203,217,206,236,242,238,165,170,167,186,190,187,180,185,182,175,180,177,174,178,176,172,176,174,230,235,232,195,212,203,136,164,145,181,187,172,181,188,177,178,186,176,170,179,166,170,179,167,178,187,176,171,179,169,121,129,120,83,91,86,61,69,64,52,60,56,67,75,69,62,71,62,60,69,64,78,87,80,54,63,57,50,59,56,33,42,41,21,30,31,136,168,147,136,169,149,134,168,152,128,162,144,125,160,144,129,162,146,135,166,147,139,167,145,145,172,146,142,169,145,138,167,149,132,163,145,126,161,145,132,166,149,131,164,144,127,162,141,125,163,144,126,163,146,142,173,150,139,169,146,174,194,176,237,243,239,233,239,235,233,239,235,233,238,235,231,237,233,234,240,236,232,237,233,238,243,238,187,201,187,173,181,168,155,163,150,163,173,161,175,184,173,171,180,170,141,150,142,88,98,88,64,73,66,54,63,58,57,65,62,65,72,67,42,50,48,47,55,53,58,67,62,64,73,67,47,56,53,38,46,44,38,46,46,24,33,33,27,35,36,134,165,145,130,163,145,132,163,146,122,156,141,123,159,143,146,174,156,138,171,154,138,169,151,151,176,153,144,172,148,138,167,145,137,167,147,137,168,147,133,164,141,128,162,140,131,165,146,137,169,146,136,169,146,136,168,144,140,170,146,140,168,142,135,165,146,144,174,156,141,171,153,142,172,151,141,172,151,141,170,152,149,173,156,165,179,160,162,170,154,151,160,146,152,162,151,151,163,152,175,184,173,128,137,128,58,68,62,62,72,66,53,63,60,59,67,63,58,66,62,40,48,47,31,39,38,34,42,42,33,41,40,39,47,45,38,46,46,28,37,37,66,75,70,35,44,43,34,42,42,126,162,141,129,163,143,125,159,143,127,162,144,131,166,149,132,164,146,134,165,145,135,164,143,136,165,142,135,167,148,128,161,143,129,163,142,126,159,143,120,156,142,115,154,137,118,157,137,119,157,137,118,155,132,133,167,138,136,167,135,130,164,130,117,154,124,109,150,124,125,161,129,118,154,127,140,166,143,165,179,162,178,185,172,162,169,154,161,169,158,146,160,152,135,150,144,157,167,158,131,142,135,61,71,65,59,68,64,59,69,64,41,50,48,34,43,43,31,39,39,53,61,60,66,74,68,31,39,39,50,58,54,44,52,50,51,59,58,43,52,50,70,80,73,64,73,66,43,52,50,129,163,143,132,164,143,128,162,140,127,162,140,130,163,141,132,166,146,129,163,144,131,162,140,131,161,139,130,161,141,127,159,141,127,159,139,135,166,146,124,160,142,127,165,145,110,150,133,116,155,132,117,156,136,132,166,142,139,172,148,137,171,140,116,157,126,115,155,124,150,173,150,180,187,170,183,188,177,171,179,167,160,168,156,155,164,152,160,169,160,143,158,151,159,170,159,125,136,129,90,102,96,55,65,61,67,77,73,57,67,62,73,82,75,36,45,45,70,79,74,57,65,62,31,39,38,26,34,34,22,30,29,23,31,31,49,57,54,70,79,73,56,66,60,59,69,62,45,54,51};
+
+static constexpr unsigned char sample_welcome_pending_tahoe[] = {113,172,209,111,171,208,113,172,208,113,172,209,113,172,208,113,172,208,114,172,208,113,171,208,112,171,208,113,171,208,112,170,208,112,171,208,112,170,208,111,170,208,111,170,207,111,170,208,110,169,208,110,169,207,109,169,207,108,168,207,108,168,206,108,168,206,108,168,207,107,167,206,106,167,206,107,166,206,106,166,206,105,166,205,104,165,205,105,165,205,104,165,205,104,164,205,103,165,205,103,164,205,101,163,204,101,163,204,100,162,204,99,162,203,100,162,204,99,161,203,97,161,203,97,161,203,96,160,203,95,159,202,93,159,203,93,158,202,92,158,201,93,158,201,93,158,201,93,158,201,92,157,201,92,157,201,92,157,200,116,173,208,117,173,208,118,173,208,118,174,208,118,174,209,119,174,209,119,174,208,118,174,208,118,173,208,118,174,208,118,173,208,117,173,208,117,173,208,117,172,208,116,172,208,116,172,207,115,172,207,115,171,207,115,171,207,123,176,210,134,190,223,124,179,213,114,170,207,114,170,207,113,169,206,112,169,206,112,169,207,111,169,206,110,168,205,110,167,205,109,167,205,108,166,205,107,166,205,107,165,204,106,165,204,105,164,204,105,164,204,104,164,204,104,164,203,103,164,203,102,162,203,102,162,203,100,161,202,99,161,202,99,160,202,96,160,202,96,159,202,98,159,202,98,159,201,98,158,200,97,158,200,97,158,200,97,157,200,118,174,207,119,174,208,121,175,208,122,175,208,122,175,208,122,175,208,122,176,209,122,175,208,121,174,208,121,175,208,121,174,208,121,174,208,121,175,208,121,174,208,121,174,208,120,174,207,119,173,207,119,172,207,126,176,208,167,223,249,159,222,245,168,230,248,116,170,206,117,171,205,117,171,205,118,170,205,118,170,204,118,170,205,115,169,205,114,169,205,114,168,204,112,167,204,112,167,203,112,167,204,112,167,203,112,167,204,113,167,204,112,167,204,113,166,203,109,163,199,109,163,200,108,164,203,107,163,201,106,161,200,107,161,199,112,162,196,106,155,192,103,152,188,96,149,189,99,153,192,105,160,197,103,160,198,103,160,199,120,174,207,121,174,207,124,175,207,125,175,206,125,175,206,125,175,206,126,175,206,126,174,206,126,174,205,125,175,206,125,174,206,124,174,206,125,175,207,124,175,207,125,174,206,125,174,207,124,174,207,123,173,205,152,195,223,176,235,251,127,174,205,178,238,255,120,171,205,120,172,204,121,172,204,122,171,204,122,171,204,122,171,204,121,170,203,120,169,203,117,168,202,114,163,196,120,165,197,111,158,192,100,149,186,126,166,195,119,158,187,83,134,175,84,131,171,81,130,171,74,126,168,74,125,167,80,130,168,135,167,187,102,143,175,114,151,177,85,131,169,80,130,171,101,143,176,103,146,178,115,152,181,127,163,189,91,141,181,131,178,204,142,181,204,157,186,206,169,194,206,179,199,206,174,194,204,178,197,205,177,197,207,186,203,211,176,197,208,160,188,205,137,177,203,130,175,204,130,175,204,135,177,205,133,176,203,134,177,204,144,181,204,177,213,234,168,212,229,144,183,209,181,232,249,125,172,203,125,172,204,126,172,202,117,162,193,108,153,187,97,144,179,86,133,170,77,125,163,68,116,156,147,173,191,188,199,205,129,157,180,88,128,164,76,121,164,71,120,162,92,133,166,145,165,179,121,148,167,139,160,174,129,156,177,96,135,169,110,145,175,85,126,163,81,122,160,71,115,156,66,115,157,79,120,159,89,130,166,72,118,159,69,114,156,89,130,165,96,133,168,172,185,195,183,198,210,185,200,209,192,199,200,177,188,194,179,192,199,178,191,200,185,197,203,191,207,217,180,193,198,207,212,212,193,203,205,171,188,201,160,184,205,112,150,180,95,135,168,119,151,175,205,227,240,197,216,221,178,199,216,168,203,222,108,151,181,103,144,177,105,140,170,133,161,184,126,154,179,119,147,169,170,184,195,164,179,190,140,163,181,155,179,198,123,153,178,130,155,175,97,132,161,106,130,148,95,108,119,121,131,136,124,132,137,119,126,131,44,58,63,114,126,128,145,161,168,120,148,170,87,124,159,73,111,149,93,128,160,125,154,181,138,164,190,122,148,171,149,171,184,126,150,170,127,149,168,117,151,178,181,208,235,188,218,237,203,224,242,170,190,201,140,162,177,192,211,228,153,181,202,148,177,201,195,227,253,143,173,193,117,146,169,143,166,184,190,218,244,173,209,237,195,222,245,157,179,193,141,163,177,212,227,233,180,193,201,190,212,229,116,147,175,67,110,147,119,147,171,191,216,233,178,211,232,189,216,238,197,210,216,197,202,202,210,216,219,223,236,246,195,219,236,205,225,242,174,191,202,101,116,119,41,55,62,129,136,143,157,165,172,131,148,159,136,148,158,148,154,158,147,164,174,143,165,182,162,178,188,121,149,169,118,141,164,161,182,204,188,216,239,187,212,235,159,181,202,100,129,157,77,112,144,72,107,140,145,168,184,175,208,233,77,115,149,161,185,213,144,172,194,102,130,156,173,200,230,124,158,184,115,148,175,170,204,238,140,173,200,106,136,161,157,181,205,169,198,222,104,134,163,202,224,240,166,183,187,169,173,169,204,215,213,190,197,196,204,218,223,111,127,128,116,130,126,175,187,188,147,166,169,104,132,155,124,144,153,141,159,164,133,153,170,214,228,237,175,190,200,100,132,158,138,160,177,180,196,208,156,166,172,156,165,170,161,169,175,142,151,159,21,36,49,90,100,108,173,179,184,38,56,67,75,89,101,168,178,186,74,107,135,131,153,170,177,201,230,106,135,163,135,160,186,165,190,215,80,110,140,65,100,134,70,104,139,53,97,138,60,107,147,63,104,142,150,178,215,82,123,161,90,123,157,152,183,222,81,121,157,61,102,140,174,197,221,191,210,227,186,193,190,175,190,201,165,184,200,182,198,211,200,216,222,91,101,99,116,127,127,174,182,181,190,199,199,80,94,98,41,57,63,88,101,106,157,167,169,100,114,117,53,66,67,60,70,75,142,150,148,207,213,210,229,238,237,186,190,178,129,141,131,134,152,161,176,189,197,132,145,154,137,150,154,171,177,179,167,174,178,157,164,165,166,171,173,171,177,180,65,77,84,110,121,130,151,161,169,38,73,98,83,117,149,155,183,220,103,132,161,151,178,212,118,151,181,60,99,134,60,99,133,59,97,132,14,74,115,13,73,115,40,91,128,149,178,212,62,110,144,137,161,181,160,185,214,87,126,156,107,136,156,180,202,224,163,178,185,193,208,213,179,194,203,193,206,214,168,186,193,99,111,112,87,101,105,130,141,143,166,176,177,145,153,157,51,68,76,54,68,76,138,144,148,155,164,168,119,131,135,36,51,57,50,60,65,159,167,165,219,228,224,204,212,209,138,149,149,80,91,96,190,200,201,167,176,177,99,108,108,127,136,137,185,192,193,154,160,161,84,94,96,143,148,151,134,146,153,27,44,55,90,102,113,149,158,163,31,61,80,42,91,130,139,167,200,144,174,207,115,155,188,25,77,116,121,151,185,68,115,154,8,66,108,16,99,137,16,99,137,15,99,136,116,151,172,183,203,216,163,181,194,113,133,147,168,189,205,180,199,212,154,167,172,90,98,100,82,95,98,75,89,95,143,157,163,184,195,199,181,192,193,176,189,193,127,141,147,56,72,80,103,116,124,145,155,162,149,158,164,120,131,138,64,78,85,145,156,161,168,175,177,184,191,192,200,206,205,122,132,132,111,121,125,197,206,206,209,219,218,183,193,194,110,119,120,100,109,110,84,93,95,179,187,189,88,97,101,65,75,81,134,141,146,91,104,112,23,40,53,33,51,65,126,139,152,145,163,182,139,173,204,116,161,193,130,168,200,129,171,203,138,176,212,109,159,194,16,95,132,8,89,127,16,104,136,19,105,137,19,104,136,37,98,119,90,115,121,109,119,121,82,95,96,98,110,112,141,150,149,70,80,85,70,79,83,31,46,51,37,52,58,78,89,93,86,92,93,98,111,109,90,103,106,28,43,51,29,45,52,27,43,51,29,45,52,34,49,55,43,55,62,37,49,55,80,91,92,98,108,110,122,131,128,171,175,170,83,92,93,146,153,148,141,148,144,138,146,144,109,119,117,110,120,119,82,93,94,55,65,69,68,78,84,56,66,73,34,47,54,33,47,57,28,43,56,25,41,53,38,51,60,24,40,49,17,48,59,13,100,133,10,97,129,11,99,130,44,120,150,18,102,133,11,98,130,9,95,127,9,94,127,26,117,144,59,135,156,82,142,156,142,164,161,119,132,130,80,94,95,125,136,135,161,170,167,67,78,83,33,45,52,29,41,46,21,35,40,58,71,74,147,156,153,152,159,157,91,101,99,77,89,92,30,45,52,27,41,49,21,35,44,28,43,52,35,50,60,20,34,42,25,38,44,27,40,46,57,70,76,81,92,90,112,122,120,97,106,109,158,163,161,138,146,143,113,124,125,89,99,100,68,78,82,48,59,63,40,52,57,37,49,55,39,52,58,40,53,60,38,52,61,20,35,46,30,44,56,42,54,63,45,58,63,39,60,65,43,103,117,34,97,112,22,95,114,17,92,113,15,101,127,16,104,130,17,104,132,15,102,129};
+static constexpr unsigned char sample_get_started_1x[] = {237,244,241,237,244,241,237,244,241,237,244,241,237,244,241,237,244,241,236,243,240,236,243,240,236,243,240,236,243,240,236,243,240,236,243,240,236,243,240,236,243,240,237,244,241,237,244,241,237,244,241,237,244,241,237,244,241,237,244,241,237,244,241,205,212,209,154,159,157,205,211,209,237,244,241,212,218,215,227,233,230,216,223,220,152,156,154,199,205,202,209,216,213,236,243,240,236,243,240,236,243,240,203,209,206,237,244,241,237,244,241,237,244,241,186,192,189,237,244,241,237,244,241,157,161,159,204,210,208,142,147,145,87,89,88,122,125,124,192,198,195,209,215,212,147,152,150,168,173,171,152,156,154,107,111,109,117,121,120,168,173,171,130,135,133,102,105,104,135,139,137,134,139,137,146,150,148,237,244,241,237,244,241,189,194,192,157,162,160,168,173,171,153,158,156,188,193,191,193,199,196,207,213,210,158,163,160,181,187,184,157,161,160,139,144,142,134,138,136,226,233,230,161,166,164,157,162,160,190,196,194,147,151,149,165,170,167,237,244,241,237,244,241,237,244,241,237,244,241,237,244,241,237,244,241,237,244,241,236,243,240,236,243,240,236,243,240,236,243,240,236,243,240,236,243,240,236,243,240,236,243,240,237,244,241,237,244,241,237,244,241,237,244,241,237,244,241,237,244,241};
+static constexpr unsigned char sample_get_started_2x[] = {238,244,240,238,244,240,238,244,240,238,244,240,238,244,240,238,244,240,237,243,239,237,243,239,237,243,239,237,243,239,237,243,239,237,243,239,237,243,239,237,243,239,238,244,240,238,244,240,238,244,240,238,244,240,238,244,240,238,244,240,238,244,240,203,208,204,159,163,160,206,211,208,236,242,238,215,220,217,225,231,227,215,221,217,155,159,156,197,202,199,212,218,214,235,241,237,237,243,239,235,241,237,204,209,205,236,242,238,237,243,239,236,242,238,187,192,189,238,244,240,238,244,240,155,159,156,204,210,206,151,155,152,86,88,87,118,121,119,188,192,189,211,216,213,148,152,149,164,168,166,157,160,158,106,108,106,114,117,115,169,173,170,131,134,132,97,99,98,138,142,140,133,136,134,146,150,147,238,244,240,238,244,240,190,194,191,157,161,159,174,179,176,150,154,151,186,191,188,190,195,192,207,212,209,158,162,159,177,182,179,160,164,161,141,144,142,134,138,135,227,233,229,160,164,161,153,157,155,194,199,195,145,149,147,165,169,167,238,244,240,238,244,240,238,244,240,238,244,240,238,244,240,238,244,240,238,244,240,237,243,239,237,243,239,237,243,239,237,243,239,237,243,239,237,243,239,237,243,239,237,243,239,238,244,240,238,244,240,238,244,240,238,244,240,238,244,240,239,244,240};
diff --git a/src/wsm-runtime/src/window_streamer.cpp b/src/wsm-runtime/src/window_streamer.cpp
index f6f40b2..27c0246 100644
--- a/src/wsm-runtime/src/window_streamer.cpp
+++ b/src/wsm-runtime/src/window_streamer.cpp
@@ -1,7 +1,13 @@
+#include "wsm/child_processes.hpp"
#include "wsm/window_streamer.hpp"
#include "wsm/setup_assistant.hpp"
#include "wsm/ssh_private_key.hpp"
+#include "wsm/ssh_tools.hpp"
#include "wsm/qmp_unix.hpp"
+#include "wsm/runtime_desktop.hpp"
+#include "wsm/window_pixels.hpp"
+#include "wsm/input_batches.hpp"
+#include "wsm/window_focus.hpp"
#include <winsock2.h>
#include <ws2tcpip.h>
@@ -90,13 +96,14 @@ out("S " + Math.round(f.size.width) + " " + Math.round(f.size.height));
var skip = {"Window Server":1,"Dock":1,"SystemUIServer":1,"Control Center":1,"Spotlight":1,
"Notification Center":1,"NotificationCenter":1,"WindowManager":1,"Wallpaper":1,"loginwindow":1,
"TextInputMenuAgent":1,"TextInputSwitcher":1,"universalAccessAuthWarn":1,"CursorUIViewService":1,
- "Finder":1,"KeyboardSetupAssistant":1,"Installer Progress":1,"Setup Assistant":1,"SetupAssistantSpringboard":1};
+ "KeyboardSetupAssistant":1,"Installer Progress":1,"Setup Assistant":1,"SetupAssistantSpringboard":1};
var bundles = {};
function bid(pid) {
if (bundles[pid] !== undefined) return bundles[pid];
var a = $.NSRunningApplication.runningApplicationWithProcessIdentifier(pid);
var b = (a && a.bundleIdentifier && !a.bundleIdentifier.isNil()) ? ObjC.unwrap(a.bundleIdentifier) : "";
- bundles[pid] = b; return b;
+ if (a && a.executableURL && !a.executableURL.isNil() && ObjC.unwrap(a.executableURL.lastPathComponent) === "talagentd") b = "__WSM_RESTORE_PLACEHOLDER__";
+ if (b) bundles[pid] = b; return b;
}
var last = "", n = 0, lastSetup = null;
var pb = $.NSPasteboard.generalPasteboard, pbCount = pb.changeCount;
@@ -120,13 +127,15 @@ while (true) {
var b = w.kCGWindowBounds;
if (b.Width < 24 || b.Height < 16) continue;
if (b.Width > 2 * f.size.width || b.Height > 2 * f.size.height) continue; // backdrops, not windows
+ var bundle = bid(w.kCGWindowOwnerPID);
+ if (bundle === "__WSM_RESTORE_PLACEHOLDER__") continue; // frozen session previews are not app windows
r.push([w.kCGWindowNumber, w.kCGWindowOwnerPID, L, Math.round(b.X), Math.round(b.Y),
- Math.round(b.Width), Math.round(b.Height), o.replace(/[|;]/g, " "), bid(w.kCGWindowOwnerPID)].join("|"));
+ Math.round(b.Width), Math.round(b.Height), o.replace(/[|;]/g, " "), bundle].join("|"));
}
if (setup !== lastSetup) { out("A " + (setup ? "1" : "0")); lastSetup = setup; }
var s = r.join(";");
- if (s != last || ++n % 40 == 0) { out("W " + s); last = s; } else out("K");
- delay(0.1);
+ if (s != last || ++n % 80 == 0) { out("W " + s); last = s; } else out("K");
+ delay(0.05);
}
)JXA";
@@ -197,7 +206,7 @@ bool spawn(const std::string& cmdline, Proc& p) {
si.hStdError = out_w;
PROCESS_INFORMATION pi{};
std::string cl = cmdline;
- BOOL ok = CreateProcessA(nullptr, cl.data(), nullptr, nullptr, TRUE, CREATE_NO_WINDOW, nullptr, nullptr, &si, &pi);
+ BOOL ok = wsm::runtime::create_owned_process_a(nullptr, cl.data(), nullptr, nullptr, TRUE, CREATE_NO_WINDOW, nullptr, nullptr, &si, &pi);
CloseHandle(in_r);
CloseHandle(out_w);
if (!ok) {
@@ -237,7 +246,7 @@ WindowStreamer::WindowStreamer(compositor::RootlessCompositor& compositor, std::
WindowStreamer::~WindowStreamer() { stop(); }
std::string WindowStreamer::ssh_base() const {
- return "C:\\Windows\\System32\\OpenSSH\\ssh.exe -i " + quote_arg(ssh_private_key_path(root_)) +
+ return ssh_tool_command("ssh") + " -i " + quote_arg(ssh_private_key_path(root_)) +
" -p 2222 -o IdentitiesOnly=yes -o BatchMode=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=NUL -o LogLevel=ERROR"
" -o ConnectTimeout=10 -o ServerAliveInterval=10 -o ServerAliveCountMax=3 [email protected] ";
}
@@ -288,7 +297,7 @@ int WindowStreamer::guest_exec(const std::string& command, std::string* out, uin
}
int WindowStreamer::scp(const std::string& from, const std::string& to, uint32_t timeout_ms) const {
- std::string cmd = "C:\\Windows\\System32\\OpenSSH\\scp.exe -q -i " +
+ std::string cmd = ssh_tool_command("scp") + " -q -i " +
quote_arg(ssh_private_key_path(root_)) +
" -P 2222 -o IdentitiesOnly=yes -o BatchMode=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=NUL"
" -o LogLevel=ERROR -o ConnectTimeout=10 " + quote_arg(from) + " " + quote_arg(to);
@@ -378,18 +387,23 @@ void WindowStreamer::set_guest_clipboard(const std::string& text) {
}
bool WindowStreamer::launch_app(const std::string& app, std::string& err) {
- std::string cmd;
- if (app.find('/') != std::string::npos) cmd = "open " + quote_arg(app);
- else if (app.find('.') != std::string::npos) cmd = "open -b " + quote_arg(app);
- else cmd = "open -a " + quote_arg(app);
+ const auto cmd = gui_open_command(app);
{
// The user asked for it: its windows may show now (also when it was started hidden).
std::lock_guard<std::mutex> lk(mu_);
if (hidden_bundle_ == app) hidden_bundle_.clear();
+ bool visible = false;
+ for (const auto& [wid, window] : wins_)
+ if (window.bundle == app || window.owner == app ||
+ (app.find('/') != std::string::npos && guest_app_name(app) == window.owner)) visible = true;
+ if (!visible) pending_launches_[app] = now_ms();
}
std::string out;
int rc = quick(cmd, &out, 30000);
- if (rc != 0) { err = out.empty() ? ("exit " + std::to_string(rc)) : out; return false; }
+ if (rc != 0) {
+ { std::lock_guard<std::mutex> lock(mu_); pending_launches_.erase(app); }
+ err = out.empty() ? ("exit " + std::to_string(rc)) : out; return false;
+ }
last_input_ms_.store(now_ms());
if (app.find('/') == std::string::npos && app.find('.') != std::string::npos) remember_recent(app);
return true;
@@ -447,27 +461,17 @@ void WindowStreamer::prewarm_apps() {
}
}
if (ids.empty()) return;
- // 1. The most recent app, started hidden and in the background (-g -j) unless it already
- // runs (then it may have windows the user is looking at). Its windows are kept off the
- // Windows desktop until the user opens it (see apply_window_list).
- std::string first = ids.front(), out;
- quick("(p=$(osascript -l JavaScript -e \"ObjC.import('AppKit'); $.NSWorkspace.sharedWorkspace.URLForApplicationWithBundleIdentifier('" +
- first + "').path.js\" 2>/dev/null); if [[ -z $p ]]; then echo MISSING; else "
- "pgrep -qf \"$p/Contents/MacOS/\" && echo RUNNING || open -g -j -b " + quote_arg(first) + "; fi)", &out, 20000);
- if (out.find("RUNNING") == std::string::npos && out.find("MISSING") == std::string::npos) {
- std::lock_guard<std::mutex> lk(mu_);
- hidden_bundle_ = first;
- hidden_until_ms_ = now_ms() + 10 * 60 * 1000;
- }
- // 2. Every recent app's files into memory, at background I/O priority, so a launch reads
- // nothing from disk.
+ // Warm only each recent app's main executable binary (never recursively catting thousands of
+ // .lproj/resource files, which saturated slow disks and caused -1712 launch timeouts), and
+ // never spawn a hidden instance that can race with a user click and mask its window.
std::string list;
for (auto& id : ids) list += " " + id;
std::thread([this, list] {
- // Own subshell, detached inside it: nothing is left running in the shared shell.
+ for (int i = 0; i < 15 && running_.load(); ++i) Sleep(1000);
+ if (!running_.load() || !watching_.load()) return;
quick("( ( for id in" + list + "; do "
"p=$(osascript -l JavaScript -e \"ObjC.import('AppKit'); $.NSWorkspace.sharedWorkspace.URLForApplicationWithBundleIdentifier('$id').path.js\" 2>/dev/null); "
- "[[ -n $p ]] && taskpolicy -b find \"$p/\" -type f -size -96M -exec cat {} + >/dev/null 2>&1; "
+ "[[ -n $p && -d \"$p/Contents/MacOS\" ]] && taskpolicy -b find \"$p/Contents/MacOS\" -maxdepth 1 -type f -size -96M -exec cat {} + >/dev/null 2>&1; "
"done ) </dev/null &>/dev/null & )", nullptr, 15000);
}).detach();
}
@@ -531,10 +535,37 @@ size_t WindowStreamer::window_count() const {
}
void WindowStreamer::watch_loop() {
+ uint32_t recovered_updater = 0;
while (running_.load()) {
+ // Never connect over SSH, run wsm-trim/prewarm_apps, or mark the guest "watching" while
+ // provisioning owns the runtime; doing so competes with UserAccountUpdater on first sign-in
+ // and used to trigger wsmd's idle auto-pause right in the middle of 96% setup.
+ std::error_code ec;
+ if (std::filesystem::exists(root_ + "\\runtime\\config\\setup-running", ec) ||
+ !std::filesystem::exists(root_ + "\\runtime\\config\\runtime-ready.json", ec)) {
+ Sleep(2000);
+ continue;
+ }
setup_detection_known_.store(false);
+ std::string desktop;
+ if (guest_exec(desktop_probe_command(), &desktop, 15000) != 0) { Sleep(2000); continue; }
+ if (desktop.rfind("UAU ", 0) == 0) {
+ std::istringstream probe(desktop.substr(4));
+ uint32_t pid = 0; std::string elapsed;
+ if (probe >> pid >> elapsed; pid && account_recovery_due(desktop_elapsed_seconds(elapsed)) && recovered_updater != pid) {
+ recovered_updater = pid;
+ std::ofstream(root_ + "\\logs\\window-stream.log", std::ios::app)
+ << "Recovering stalled runtime UserAccountUpdater pid " << pid << ", age " << elapsed << "\n";
+ guest_exec(recover_runtime_account_command(pid), nullptr, 15000);
+ }
+ Sleep(2000); continue;
+ }
+ recovered_updater = 0;
+ if (desktop != "READY\n" && desktop != "READY\r\n") { Sleep(2000); continue; }
Proc p;
- if (!spawn(ssh_base() + quote_arg("osascript -l JavaScript -"), p)) { Sleep(2000); continue; }
+ // SSH can answer during boot, before a GUI session exists. AppKit calls
+ // can block indefinitely there; wait for this runtime user's console.
+ if (!spawn(ssh_base() + quote_arg("test \"$(stat -f %Su /dev/console)\" = wsm && exec osascript -l JavaScript -"), p)) { Sleep(2000); continue; }
watch_proc_ = p.process;
DWORD wr = 0;
WriteFile(p.in_w, kWindowScript, static_cast<DWORD>(std::strlen(kWindowScript)), &wr, nullptr);
@@ -543,13 +574,30 @@ void WindowStreamer::watch_loop() {
std::string acc, last_list;
char buf[8192];
DWORD n = 0;
- while (running_.load() && ReadFile(p.out_r, buf, sizeof(buf), &n, nullptr) && n > 0) {
+ int64_t last_output = now_ms(); bool received_output = false;
+ while (running_.load()) {
+ DWORD available = 0;
+ if (!PeekNamedPipe(p.out_r, nullptr, 0, nullptr, &available, nullptr)) break;
+ if (!available) {
+ if (WaitForSingleObject(p.process, 10) == WAIT_OBJECT_0) break;
+ if (window_watcher_timed_out(now_ms() - last_output, received_output)) {
+ std::ofstream(root_ + "\\logs\\window-stream.log", std::ios::app) << "Window reporter stopped responding; reconnecting without restarting macOS\n";
+ break;
+ }
+ continue;
+ }
+ if (!ReadFile(p.out_r, buf, std::min<DWORD>(sizeof(buf), available), &n, nullptr) || !n) break;
+ last_output = now_ms();
acc.append(buf, n);
size_t pos;
while ((pos = acc.find('\n')) != std::string::npos) {
std::string line = acc.substr(0, pos);
acc.erase(0, pos + 1);
if (!line.empty() && line.back() == '\r') line.pop_back();
+ // Screen dimensions arrive before AppKit finishes its cold
+ // start. Tight heartbeat deadlines apply only to the reporter
+ // loop, not the initial framework loading on a hard disk.
+ if (line == "K" || line.rfind("W ", 0) == 0) received_output = true;
if (line.rfind("S ", 0) == 0) {
int w = 0, h = 0;
if (std::sscanf(line.c_str() + 2, "%d %d", &w, &h) == 2 && w > 0 && h > 0) {
@@ -568,9 +616,16 @@ void WindowStreamer::watch_loop() {
std::string out;
int trc = guest_exec("zsh ~/Library/Caches/WSM/wsm-trim.sh", &out, 120000);
trim_report_ = out;
- if (trc == 0) post_setup_cleanup();
prewarm_apps();
mount_share();
+ if (trc == 0) {
+ // Defer 17 GB leftover cleanup so it never starves the user's
+ // very first app launch right after setup completes.
+ std::thread([this] {
+ for (int i = 0; i < 25 && running_.load(); ++i) Sleep(1000);
+ if (running_.load() && watching_.load()) post_setup_cleanup();
+ }).detach();
+ }
}
}).detach();
}
@@ -663,7 +718,7 @@ void WindowStreamer::post_setup_cleanup() {
// window watcher runs. Inside macOS: the installer's own 17 GB copy ("Previous Content").
std::string out;
if (!copy_to_guest(root_ + "\\src\\wsm-guest\\agent\\wsm-shrink.sh", "Library/Caches/WSM/wsm-shrink.sh") ||
- guest_exec("zsh ~/Library/Caches/WSM/wsm-shrink.sh --leftovers-only", &out, 15 * 60 * 1000) != 0)
+ guest_exec("taskpolicy -b zsh ~/Library/Caches/WSM/wsm-shrink.sh --leftovers-only", &out, 15 * 60 * 1000) != 0)
return; // try again next start
// On Windows: the downloaded installer / recovery images. Only finished ones: a .part is a
// download in progress (deleting it killed one), and nothing while a download holds the lock.
@@ -703,19 +758,25 @@ void WindowStreamer::apply_window_list(const std::string& list) {
std::stringstream is(item);
std::string part;
while (std::getline(is, part, '|')) f.push_back(part);
- if (f.size() < 9) continue;
+ if (f.size() < 8) continue;
GuestWin g;
g.wid = static_cast<uint32_t>(std::stoul(f[0]));
g.pid = static_cast<uint32_t>(std::stoul(f[1]));
g.layer = std::stoi(f[2]);
g.x = std::stoi(f[3]); g.y = std::stoi(f[4]);
g.w = std::stoi(f[5]); g.h = std::stoi(f[6]);
- g.owner = f[7]; g.bundle = f[8];
+ g.owner = f[7]; g.bundle = f.size() > 8 ? f[8] : "";
g.z = static_cast<int>(seen.size()); // list is back to front
{
// Started hidden by prewarm_apps and not opened yet: not on the Windows desktop.
std::lock_guard<std::mutex> lk(mu_);
if (!hidden_bundle_.empty() && g.bundle == hidden_bundle_ && now_ms() < hidden_until_ms_) continue;
+ for (auto pending = pending_launches_.begin(); pending != pending_launches_.end();) {
+ const auto& app = pending->first;
+ const bool matches = app == g.bundle || app == g.owner ||
+ (app.find('/') != std::string::npos && guest_app_name(app) == g.owner);
+ pending = matches ? pending_launches_.erase(pending) : std::next(pending);
+ }
}
seen[g.wid] = g;
}
@@ -738,7 +799,8 @@ void WindowStreamer::apply_window_list(const std::string& list) {
for (auto& [wid, g] : seen) if (g.layer == 0) now_count[g.pid]++;
int64_t t = now_ms();
for (auto& [wid, g] : wins_)
- if (g.layer == 0 && !now_count.count(g.pid) && list != kDisconnected) pid_empty_since_.emplace(g.pid, t);
+ if (g.layer == 0 && g.owner != "Finder" && g.bundle != "com.apple.finder" &&
+ !now_count.count(g.pid) && list != kDisconnected) pid_empty_since_.emplace(g.pid, t);
for (auto it = pid_empty_since_.begin(); it != pid_empty_since_.end();) {
if (now_count.count(it->first)) { it = pid_empty_since_.erase(it); continue; }
if (t - it->second > 2500) {
@@ -824,44 +886,36 @@ bool WindowStreamer::lookup(uint64_t host_id, GuestWin& out) const {
return true;
}
-namespace {
-
-// Makes the runtime's flat desktop colour transparent inside a window's corner squares and
-// un-blends the anti-aliased edge, so the window keeps macOS's exact rounded shape on Windows.
-// Writes premultiplied BGRA (the swap chain is DXGI_ALPHA_MODE_PREMULTIPLIED).
-void cut_corners(uint8_t* px, int w, int h, const uint8_t key[3]) {
- int R = std::min(40, std::min(w, h) / 3);
- if (R < 4) return;
- auto dist = [](const uint8_t* a, const uint8_t* k) {
- int d0 = std::abs(a[0] - k[0]), d1 = std::abs(a[1] - k[1]), d2 = std::abs(a[2] - k[2]);
- return std::max(d0, std::max(d1, d2));
- };
- const int cx[4] = {0, w - R, 0, w - R}, cy[4] = {0, 0, h - R, h - R};
- for (int c = 0; c < 4; ++c) {
- // Reference: the window's own colour just inside this corner.
- int rx = (c & 1) ? w - R - 1 : R, ry = (c & 2) ? h - R - 1 : R;
- const uint8_t* ref = px + (static_cast<size_t>(ry) * w + rx) * 4;
- int D = dist(ref, key);
- for (int y = cy[c]; y < cy[c] + R; ++y) {
- uint8_t* p = px + (static_cast<size_t>(y) * w + cx[c]) * 4;
- for (int x = 0; x < R; ++x, p += 4) {
- int d = dist(p, key);
- if (d >= D && D > 0) continue; // window pixel
- if (D < 24) { if (d <= 3) { p[0] = p[1] = p[2] = p[3] = 0; } continue; }
- double a = static_cast<double>(d) / D; // coverage of the window
- if (a < 0.02) { p[0] = p[1] = p[2] = p[3] = 0; continue; }
- for (int k = 0; k < 3; ++k) {
- double v = p[k] - (1.0 - a) * key[k];
- p[k] = static_cast<uint8_t>(v < 0 ? 0 : (v > 255 ? 255 : v));
- }
- p[3] = static_cast<uint8_t>(a * 255.0 + 0.5);
- }
- }
+bool WindowStreamer::focus_guest_window(const GuestWin& g, bool pointer_click, int x, int y) {
+ if (g.layer != 0) return true;
+ std::vector<FocusBounds> windows; int sw = 0, sh = 0;
+ {
+ std::lock_guard<std::mutex> lock(mu_);
+ for (const auto& [wid, w] : wins_) windows.push_back({w.x,w.y,w.w,w.h,w.z});
+ sw = screen_w_; sh = screen_h_;
+ }
+ if (pointer_click && !guest_point_covered(x, y, g.z, windows)) return true;
+ if (!pointer_click && std::none_of(windows.begin(), windows.end(), [&](const auto& w){return w.z > g.z;})) return true;
+ const auto now = now_ms();
+ if (last_raise_pid_.load() == g.pid && now - last_raise_ms_.load() < 300) return true;
+ if (auto point = visible_title_point({g.x,g.y,g.w,g.h,g.z}, windows, sw, sh)) {
+ // This activates the real guest window in HID order before the actual
+ // click, rather than waiting behind a potentially slow SSH/open call.
+ last_raise_pid_ = g.pid; last_raise_ms_ = now;
+ queue_abs(point->first, point->second);
+ queue_events("E{\"type\":\"btn\",\"data\":{\"down\":true,\"button\":\"left\"}}");
+ queue_events("E{\"type\":\"btn\",\"data\":{\"down\":false,\"button\":\"left\"}}");
+ return true;
}
+ // Completely covered: activate first and consume this click, so it cannot
+ // operate a different application underneath the independent host window.
+ if (!g.bundle.empty() && now - last_raise_ms_.load() >= 300) {
+ last_raise_pid_ = 0; last_raise_ms_ = now;
+ std::thread([this, bundle = g.bundle] { quick(gui_open_command(bundle), nullptr, 15000); }).detach();
+ }
+ return false;
}
-} // namespace
-
namespace {
bool sock_read(SOCKET s, void* buf, size_t len) {
@@ -965,12 +1019,17 @@ void WindowStreamer::vnc_loop() {
int rx = be16(b), ry = be16(b + 2), rw = be16(b + 4), rh = be16(b + 6);
int32_t enc = static_cast<int32_t>(be32(b + 8));
if (enc == 0) {
- row.resize(static_cast<size_t>(rw) * 4);
- for (int y = 0; y < rh; ++y) {
- if (!sock_read(s, row.data(), row.size())) { ok = false; break; }
+ if (rx < 0 || ry < 0 || rw <= 0 || rh <= 0 || rx + rw > w || ry + rh > h) { ok = false; break; }
+ const size_t stride = static_cast<size_t>(rw) * 4;
+ row.resize(stride * rh);
+ if (!sock_read(s, row.data(), row.size())) { ok = false; break; }
+ // Commit a complete rectangle atomically. Per-row recv/locking
+ // produced thousands of syscalls and mixed old/new rows.
+ {
std::lock_guard<std::mutex> lk(fb_mu_);
- if (ry + y < fb_h_ && rx + rw <= fb_w_)
- std::memcpy(&fb_[(static_cast<size_t>(ry + y) * fb_w_ + rx) * 4], row.data(), row.size());
+ if (rx + rw <= fb_w_ && ry + rh <= fb_h_)
+ for (int y = 0; y < rh; ++y)
+ std::memcpy(&fb_[(static_cast<size_t>(ry + y) * fb_w_ + rx) * 4], row.data() + y * stride, stride);
}
dx0 = std::min(dx0, rx); dy0 = std::min(dy0, ry);
dx1 = std::max(dx1, rx + rw); dy1 = std::max(dy1, ry + rh);
@@ -1010,6 +1069,7 @@ void WindowStreamer::vnc_loop() {
}
void WindowStreamer::capture_loop() {
+ SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL);
// Its own QMP connection, kept open (a new one per screendump cost a handshake per frame).
const std::string vmd = root_ + "\\runtime\\reims-ctl\\vms\\wsm-default";
wsm::core::QmpSession qmp(vmd + "\\wsm-cap.sock", vmd + "\\qmp.sock");
@@ -1020,7 +1080,6 @@ void WindowStreamer::capture_loop() {
// parts are filled from here, so another app's pixels can never get stuck in a window.
std::map<uint32_t, std::vector<uint8_t>> clean;
std::set<uint32_t> redo; // shown while unsettled: render again once settled
- uint8_t key[3] = {22, 20, 18}; // BGR of the backdrop colour
int64_t last_full = 0;
while (running_.load()) {
std::vector<GuestWin> list;
@@ -1045,9 +1104,9 @@ void WindowStreamer::capture_loop() {
}
int64_t t0 = now_ms();
// QEMU's VNC server checks the screen less often while it's quiet (up to seconds), so
- // right after input the frames come from screendumps, which are always fresh; changes
- // the app makes by itself (animations, new messages) come through VNC.
- const bool typing = now_ms() - last_input_ms_.load() < 1500;
+ // right after clicks/keys/scrolls frames come from screendumps; plain mouse hover stays
+ // on zero-disk VNC so moving the cursor never triggers 6 MB PPM disk churn.
+ const bool typing = now_ms() - last_input_ms_.load() < 900 || now_ms() - stack_changed_ms_.load() < 900;
// (Tried: VNC only, with QEMU's refresh forced back to 30 ms after each input. Measured
// slower than screendumps here: median 106 vs 68 ms key -> pixel in Safari.)
const bool vnc = vnc_live_.load() && !typing;
@@ -1088,22 +1147,7 @@ void WindowStreamer::capture_loop() {
{ std::lock_guard<std::mutex> lk(mu_); sw = screen_w_; sh = screen_h_; }
double sx = static_cast<double>(fw) / sw, sy = static_cast<double>(fh) / sh;
- // Desktop colour, read where no window is (screen corners below the menu bar).
- {
- const int pts[4][2] = {{4, 40}, {sw - 5, 40}, {4, sh - 5}, {sw - 5, sh - 5}};
- for (auto& pt : pts) {
- bool covered = false;
- for (auto& g : list)
- covered |= pt[0] >= g.x && pt[0] < g.x + g.w && pt[1] >= g.y && pt[1] < g.y + g.h;
- if (covered) continue;
- const uint8_t* s = src + (static_cast<size_t>(pt[1] * sy) * fw + static_cast<size_t>(pt[0] * sx)) * bpp;
- if (bpp == 4) { key[0] = s[0]; key[1] = s[1]; key[2] = s[2]; }
- else { key[0] = s[2]; key[1] = s[1]; key[2] = s[0]; }
- break;
- }
- }
-
- struct Out { uint32_t wid; int pw, ph, y0, y1; bool full; std::vector<uint8_t> px; };
+ struct Out { uint32_t wid; int pw, ph, y0, y1; bool full; std::vector<uint8_t> px; double radius = 24; };
std::vector<Out> outs;
for (const GuestWin& g : list) {
int px = static_cast<int>(g.x * sx), py = static_cast<int>(g.y * sy);
@@ -1115,7 +1159,7 @@ void WindowStreamer::capture_loop() {
if (pw <= 0 || ph <= 0) continue;
// While a window is moving inside the runtime, its reported bounds trail the pixels;
// presenting then would show the wrong area (flicker). Wait until it settles.
- if (now_ms() - g.changed_ms < 120) continue;
+ if (now_ms() - g.changed_ms < 60) continue;
auto geom = std::make_tuple(px, py, pw, ph);
bool geom_changed = prev_geom[g.wid] != geom;
// Nothing changed inside this window: no work at all.
@@ -1144,13 +1188,14 @@ void WindowStreamer::capture_loop() {
if (auto wi = wins_.find(g.wid); wi != wins_.end()) wi->second.covered_rects = static_cast<int>(cover.size());
}
Out o{g.wid, pw, ph, 0, ph - 1, true, {}};
+ o.radius = (g.layer == 0 ? 24.0 : 8.0) * std::min(sx, sy);
o.px.resize(static_cast<size_t>(pw) * ph * 4);
const size_t stride = static_cast<size_t>(pw) * 4;
for (int row = 0; row < ph; ++row) {
const uint8_t* r = src + (static_cast<size_t>(py + row) * fw + px) * bpp;
if (bpp == 4) { std::memcpy(&o.px[row * stride], r, stride); continue; }
uint8_t* d = &o.px[row * stride];
- for (int c = 0; c < pw; ++c, r += 3, d += 4) { d[0] = r[2]; d[1] = r[1]; d[2] = r[0]; }
+ for (int c = 0; c < pw; ++c, r += 3, d += 4) { d[0] = r[2]; d[1] = r[1]; d[2] = r[0]; d[3] = 255; }
}
if (!cover.empty()) {
// Keep this window's own last pixels there; never seen yet: its own background
@@ -1189,8 +1234,8 @@ void WindowStreamer::capture_loop() {
for (Out& o : outs) {
const size_t stride = static_cast<size_t>(o.pw) * 4;
- for (size_t i = 3; i < o.px.size(); i += 4) o.px[i] = 255;
- cut_corners(o.px.data(), o.pw, o.ph, key);
+ if (bpp == 4) for (size_t i = 3; i < o.px.size(); i += 4) o.px[i] = 255;
+ round_window_pixels(o.px.data(), o.pw, o.ph, o.radius);
// Only upload the rows that changed since the last frame of this window.
auto& last = prev[o.wid];
o.full = last.size() != o.px.size();
@@ -1233,7 +1278,7 @@ void WindowStreamer::capture_loop() {
if (vnc) {
// Event driven: wake when QEMU sends changed pixels or the window list changes.
std::unique_lock<std::mutex> lk(cap_mu_);
- cap_cv_.wait_for(lk, std::chrono::milliseconds(250), [&] { return cap_kick_.exchange(false); });
+ cap_cv_.wait_for(lk, std::chrono::milliseconds(100), [&] { return cap_kick_.exchange(false); });
} else {
// Screendumps: as fast as they come while the user types or clicks; ~6 fps otherwise
// (only when VNC isn't available).
@@ -1248,12 +1293,12 @@ void WindowStreamer::capture_loop() {
}
}
-void WindowStreamer::queue_events(const std::string& events_json) {
- last_input_ms_.store(now_ms());
- diag_wait_.store(true);
- last_activity_ms_.store(now_ms());
- cap_kick_.store(true);
- cap_cv_.notify_one();
+void WindowStreamer::queue_events(const std::string& events_json, bool urgent) {
+ const int64_t now = now_ms();
+ last_activity_ms_.store(now);
+ if (urgent) {
+ last_input_ms_.store(now);
+ }
{
std::lock_guard<std::mutex> lk(in_mu_);
in_q_.push_back(events_json);
@@ -1261,7 +1306,7 @@ void WindowStreamer::queue_events(const std::string& events_json) {
in_cv_.notify_one();
}
-void WindowStreamer::queue_abs(int gx, int gy) {
+void WindowStreamer::queue_abs(int gx, int gy, bool urgent) {
int sw, sh;
{ std::lock_guard<std::mutex> lk(mu_); sw = screen_w_; sh = screen_h_; }
if (gx < 0) gx = 0;
@@ -1271,13 +1316,18 @@ void WindowStreamer::queue_abs(int gx, int gy) {
long ax = static_cast<long>(gx) * 32767 / (sw - 1);
long ay = static_cast<long>(gy) * 32767 / (sh - 1);
queue_events("M{\"type\":\"abs\",\"data\":{\"axis\":\"x\",\"value\":" + std::to_string(ax) +
- "}},{\"type\":\"abs\",\"data\":{\"axis\":\"y\",\"value\":" + std::to_string(ay) + "}}");
+ "}},{\"type\":\"abs\",\"data\":{\"axis\":\"y\",\"value\":" + std::to_string(ay) + "}}", urgent);
}
void WindowStreamer::input_loop() {
+ SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL);
// Its own QMP connection, kept open: every key and click paid a connect and handshake.
const std::string vmd = root_ + "\\runtime\\reims-ctl\\vms\\wsm-default";
wsm::core::QmpSession qmp(vmd + "\\wsm-in.sock", vmd + "\\qmp.sock");
+ std::set<std::string> held_keys;
+ InputCadence cadence;
+ HANDLE input_timer = CreateWaitableTimerExW(nullptr, nullptr, CREATE_WAITABLE_TIMER_HIGH_RESOLUTION, TIMER_ALL_ACCESS);
+ if (!input_timer) input_timer = CreateWaitableTimerW(nullptr, FALSE, nullptr);
while (running_.load()) {
std::deque<std::string> batch;
{
@@ -1286,29 +1336,49 @@ void WindowStreamer::input_loop() {
batch.swap(in_q_);
}
if (batch.empty()) continue;
- // Collapse runs of pointer moves (prefix 'M') to the last one; keep everything else in order.
- std::string events;
- for (size_t i = 0; i < batch.size(); ++i) {
- const std::string& e = batch[i];
- if (e[0] == 'M' && i + 1 < batch.size() && batch[i + 1][0] == 'M') continue;
- if (!events.empty()) events += ",";
- events += (e[0] == 'M' || e[0] == 'E') ? e.substr(1) : e;
+ for (const auto& events : synchronized_input_batches(batch)) {
+ const auto delay = cadence.wait_ms(events, now_ms());
+ if (delay > 0) {
+ LARGE_INTEGER due{}; due.QuadPart = -delay * 10000;
+ if (input_timer && SetWaitableTimer(input_timer, &due, 0, nullptr, nullptr, FALSE)) WaitForSingleObject(input_timer, static_cast<DWORD>(delay + 20));
+ else Sleep(static_cast<DWORD>(delay));
+ }
+ std::string resp;
+ const auto key = input_key_code(events);
+ if (!key.empty() && events.find("\"down\":true") != std::string::npos) held_keys.insert(key);
+ if (!qmp.execute("{\"execute\":\"input-send-event\",\"arguments\":{\"events\":[" + events + "]}}", resp, 1000)) {
+ // A lost acknowledgement may follow an accepted press. Release
+ // the held state instead of leaving macOS dragging indefinitely.
+ qmp.execute("{\"execute\":\"input-send-event\",\"arguments\":{\"events\":[" + released_input_events(held_keys) + "]}}", resp, 1500);
+ held_keys.clear(); break;
+ }
+ if (!key.empty() && events.find("\"down\":false") != std::string::npos) held_keys.erase(key);
+ cadence.delivered(events, now_ms());
+ if (events.find("\"down\"") != std::string::npos) {
+ // Capture after delivery, not before QEMU receives the click/key.
+ diag_wait_.store(true); cap_kick_.store(true); cap_cv_.notify_one();
+ }
}
- std::string resp;
- qmp.execute("{\"execute\":\"input-send-event\",\"arguments\":{\"events\":[" + events + "]}}", resp, 1000);
}
+ if (input_timer) CloseHandle(input_timer);
}
bool WindowStreamer::on_mouse_move(const proto::InputMouseMoveEvent& ev) {
GuestWin g;
if (!lookup(ev.window_id, g)) return false;
- queue_abs(g.x + ev.x, g.y + ev.y);
+ queue_abs(g.x + ev.x, g.y + ev.y, false);
return true;
}
bool WindowStreamer::on_mouse_button(const proto::InputMouseButtonEvent& ev) {
GuestWin g;
if (!lookup(ev.window_id, g)) return false;
+ if (ev.button > 2) return true;
+ const uint32_t bit = 1u << ev.button;
+ if (!ev.pressed && (suppressed_buttons_.fetch_and(~bit) & bit)) return true;
+ if (ev.pressed && !focus_guest_window(g, true, g.x + ev.x, g.y + ev.y)) {
+ suppressed_buttons_.fetch_or(bit); return true;
+ }
queue_abs(g.x + ev.x, g.y + ev.y);
const char* b = ev.button == 1 ? "right" : ev.button == 2 ? "middle" : "left";
queue_events(std::string("E{\"type\":\"btn\",\"data\":{\"down\":") + (ev.pressed ? "true" : "false") +
@@ -1319,10 +1389,13 @@ bool WindowStreamer::on_mouse_button(const proto::InputMouseButtonEvent& ev) {
bool WindowStreamer::on_scroll(const proto::InputScrollEvent& ev) {
GuestWin g;
if (!lookup(ev.window_id, g)) return false;
- int steps = static_cast<int>(ev.delta_y >= 0 ? ev.delta_y + 0.5f : -ev.delta_y + 0.5f);
- if (steps < 1) steps = 1;
- const char* b = ev.delta_y > 0 ? "wheel-up" : "wheel-down";
- for (int i = 0; i < steps * 3; ++i) {
+ if (!focus_guest_window(g, true, g.x + ev.x, g.y + ev.y)) return true;
+ queue_abs(g.x + ev.x, g.y + ev.y);
+ wheel_remainder_ += ev.delta_y;
+ int steps = static_cast<int>(wheel_remainder_);
+ wheel_remainder_ -= steps;
+ const char* b = steps > 0 ? "wheel-up" : "wheel-down";
+ for (int i = 0; i < std::abs(steps); ++i) {
queue_events(std::string("E{\"type\":\"btn\",\"data\":{\"down\":true,\"button\":\"") + b +
"\"}},{\"type\":\"btn\",\"data\":{\"down\":false,\"button\":\"" + b + "\"}}");
}
@@ -1346,7 +1419,18 @@ void WindowStreamer::debug_key(const std::string& q) {
int WindowStreamer::hit_caption(uint64_t window_id, int x, int y) {
GuestWin g;
- if (!lookup(window_id, g) || g.layer != 0) return 0;
+ if (!lookup(window_id, g)) return 0;
+ {
+ std::lock_guard<std::mutex> lock(frame_mu_);
+ if (auto it = frames_by_win_.find(g.wid); it != frames_by_win_.end() && g.w > 0 && g.h > 0 &&
+ x >= 0 && y >= 0 && x < g.w && y < g.h && !it->second.px.empty()) {
+ const auto& frame = it->second;
+ const int px = std::clamp(x * frame.w / g.w, 0, frame.w - 1);
+ const int py = std::clamp(y * frame.h / g.h, 0, frame.h - 1);
+ if (frame.px[(static_cast<size_t>(py) * frame.w + px) * 4 + 3] < 16) return HTTRANSPARENT;
+ }
+ }
+ if (g.layer != 0) return 0;
// macOS's yellow button minimizes the Windows window (in the runtime it would hide the
// window in the Dock, which nobody can see); green toggles host fullscreen without
// creating a hidden macOS Space. Red goes to the app and closes its window properly.
@@ -1403,14 +1487,9 @@ bool WindowStreamer::on_window_action(const proto::WindowActionEvent& ev) {
GuestWin g;
if (!lookup(ev.window_id, g)) return (ev.window_id & kIdBase) != 0;
if (ev.action == static_cast<uint32_t>(proto::WindowActionKind::Focus) && g.layer == 0 && !g.bundle.empty()) {
- // Bring the app to the front inside the runtime too, so its window is the live one.
- int64_t t = now_ms();
- if (t - last_raise_ms_.load() > 300 || last_raise_pid_.load() != g.pid) {
- last_raise_ms_.store(t);
- last_raise_pid_.store(g.pid);
- std::string b = g.bundle;
- std::thread([this, b] { quick("open -b " + quote_arg(b), nullptr, 15000); }).detach();
- }
+ // A real pointer press can focus naturally; injecting another click first
+ // would turn an ordinary title-bar click into a double-click.
+ if (!(GetAsyncKeyState(VK_LBUTTON) & 0x8000) && !(GetAsyncKeyState(VK_RBUTTON) & 0x8000)) focus_guest_window(g);
return true;
}
if (ev.action == static_cast<uint32_t>(proto::WindowActionKind::Move)) {
diff --git a/src/wsm-runtime/src/wsmd.cpp b/src/wsm-runtime/src/wsmd.cpp
index d5eec89..4427f1e 100644
--- a/src/wsm-runtime/src/wsmd.cpp
+++ b/src/wsm-runtime/src/wsmd.cpp
@@ -1,3 +1,6 @@
+#include "wsm/child_processes.hpp"
+#include "wsm/tray_icon.hpp"
+#include "wsm/process_identity.hpp"
#include "wsm/host_probe.hpp"
#include "wsm/vm_manager.hpp"
#include "wsm/paths.hpp"
@@ -17,6 +20,7 @@
#include "wsm/reims_registry.hpp"
#include "wsm/usb_passthrough.hpp"
#include "wsm/runtime_storage.hpp"
+#include "wsm/runtime_idle.hpp"
#include <shobjidl.h>
#include <winsock2.h>
@@ -218,7 +222,7 @@ bool export_diagnostics(const std::string& root, std::string& out_path) {
};
std::ostringstream r;
r << "WSM diagnostic report\n\n";
- r << "Daemon build: 0.2.3 / recovery-transfer-v3-builtin / centered-setup-matcher (" << __DATE__ << " " << __TIME__ << ")\n";
+ r << "Daemon build: 0.2.4 / desktop-recovery / paced-input / system-apps (" << __DATE__ << " " << __TIME__ << ")\n";
MEMORYSTATUSEX ms{}; ms.dwLength = sizeof(ms); GlobalMemoryStatusEx(&ms);
r << "Host RAM: " << (ms.ullTotalPhys >> 20) << " MiB total, " << (ms.ullAvailPhys >> 20) << " MiB free\n";
r << "Host commit: " << (ms.ullAvailPageFile >> 20) << " MiB available, " << (ms.ullTotalPageFile >> 20) << " MiB limit\n";
@@ -369,7 +373,7 @@ struct ProvisionState {
PROCESS_INFORMATION pi{};
std::string mutable_cmd = cmdline;
- BOOL ok = CreateProcessA(nullptr, mutable_cmd.data(), nullptr, nullptr, TRUE,
+ BOOL ok = wsm::runtime::create_owned_process_a(nullptr, mutable_cmd.data(), nullptr, nullptr, TRUE,
CREATE_NO_WINDOW, nullptr, (wsm::core::resolve_wsm_root() + "\\runtime").c_str(), &si, &pi);
CloseHandle(hWrite);
if (!ok) {
@@ -527,6 +531,7 @@ std::pair<int, int> runtime_size() {
int main() {
SetConsoleCtrlHandler(console_ctrl_handler, TRUE);
+ if (!wsm::runtime::initialize_child_processes()) return 1;
WSADATA wsa{};
if (WSAStartup(MAKEWORD(2, 2), &wsa) != 0) {
@@ -671,6 +676,7 @@ int main() {
}
std::atomic<bool> app_scan_busy{false};
+ std::atomic<uint64_t> foreground_requests{0};
// Keeps the runtime warm, like a phone keeps apps in memory: boot it in the background once
// (so the first app opens in seconds, not minutes), and pause it (vCPUs stopped, no CPU use)
@@ -683,11 +689,9 @@ int main() {
std::filesystem::exists(wsm_root + "\\runtime\\config\\runtime-ready.json"))
runtime.ensure_running(e);
int64_t idle_since = 0;
- bool reached = false;
for (;;) {
Sleep(5000);
auto st = runtime.status().state;
- reached |= streamer.watching();
{
// A runtime trying the virtio disk profile: keep it once macOS is up on it, or put
// SATA back if it isn't up after 12 minutes (a hard disk boot can take 5).
@@ -704,8 +708,12 @@ int main() {
int64_t now = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now().time_since_epoch()).count();
// Idle = no app window, no install or setup, nothing sent to the runtime for a while
// (a launch or install step in flight counts as activity). A file switches it off.
- bool idle = st == wsm::runtime::RtState::Running && reached && streamer.window_count() == 0 &&
- !installer.busy() && !streamer.setup_active() && !app_scan_busy.load() && now - streamer.last_activity_ms() > 3 * 60 * 1000 &&
+ bool idle = wsm::runtime::runtime_idle_ready(st == wsm::runtime::RtState::Running,
+ streamer.desktop_ready(), streamer.window_count(),
+ installer.busy() || provisioner.busy() || app_scan_busy.load() || streamer.launching(),
+ now - streamer.last_activity_ms()) &&
+ std::filesystem::exists(wsm_root + "\\runtime\\config\\runtime-ready.json") &&
+ !std::filesystem::exists(wsm_root + "\\runtime\\config\\setup-running") &&
!std::filesystem::exists(wsm_root + "\\runtime\\config\\no-autopause") &&
![&] { std::lock_guard<std::mutex> l(provision.mutex); return provision.running; }();
if (!idle) { idle_since = 0; continue; }
@@ -713,13 +721,15 @@ int main() {
if (now - idle_since > 3 * 60 * 1000) {
idle_since = 0;
const std::string pending = wsm_root + "\\runtime\\config\\compact-pending";
+ const bool requested = wsm::runtime::compact_requested(read_file_text(pending));
static int compact_tries = 0;
- if (std::filesystem::exists(pending) && ++compact_tries > 3) {
+ if (requested && ++compact_tries > 3) {
std::error_code rec; // didn't work 3 times: stop trying, keep the runtime as is
std::filesystem::remove(pending, rec);
}
- if (std::filesystem::exists(pending)) {
- // Once (after setup, or when asked): give the disk's free space back. Zero the
+ if (requested && std::filesystem::exists(pending)) {
+ const auto activity = foreground_requests.load();
+ // Explicit Settings request: give the disk's free space back. Zero the
// free space only when QEMU stores zero writes as nothing (else the image would
// grow to its full size), then shut down, rewrite the image, start again.
std::string qb;
@@ -729,7 +739,8 @@ int main() {
if (zeroes && streamer.copy_to_guest(wsm_root + "\\src\\wsm-guest\\agent\\wsm-shrink.sh",
"Library/Caches/WSM/wsm-shrink.sh"))
streamer.guest_exec("zsh ~/Library/Caches/WSM/wsm-shrink.sh", nullptr, 40 * 60 * 1000);
- if (streamer.window_count() == 0 && !installer.busy()) {
+ if (wsm::runtime::maintenance_can_shutdown(activity, foreground_requests.load(),
+ streamer.desktop_ready(), streamer.window_count(), installer.busy() || provisioner.busy() || streamer.launching())) {
if (streamer.watching()) streamer.quick("sudo shutdown -h now", nullptr, 5000);
runtime.shutdown(e);
uint64_t b0 = 0, b1 = 0;
@@ -789,10 +800,14 @@ int main() {
hidden.swap(keep);
}
}
- // Seed the two built-in apps on a fresh runtime. Respect removals in hidden-apps.txt;
+ // Seed built-in apps, including the manager's System Apps folder. Respect removals;
// the regular installer imports their real icons and creates the normal shortcuts.
out = "APP|com.apple.Safari|/Applications/Safari.app\n"
"APP|com.apple.AppStore|/System/Applications/App Store.app\n" + out;
+ out += "APP|com.apple.finder|/System/Library/CoreServices/Finder.app\n"
+ "APP|com.apple.systempreferences|/System/Applications/System Settings.app\n"
+ "APP|com.apple.Console|/System/Applications/Utilities/Console.app\n"
+ "APP|com.apple.DiskUtility|/System/Applications/Utilities/Disk Utility.app\n";
std::istringstream lines(out);
for (std::string l; std::getline(lines, l);) {
if (!l.empty() && l.back() == '\r') l.pop_back();
@@ -888,8 +903,60 @@ int main() {
std::cout << "[wsmd] WSM Runtime Daemon listening on http://127.0.0.1:17421\n";
+ std::atomic<int> tray_request{-1};
+ wsm::runtime::TrayIcon tray;
+ tray.start([&](wsm::runtime::TrayAction action) { tray_request.store(static_cast<int>(action)); });
+
std::mutex api_mutex;
while (g_running.load()) {
+ const auto tray_action = tray_request.exchange(-1);
+ if (tray_action == static_cast<int>(wsm::runtime::TrayAction::Open)) {
+ wchar_t executable[32768]{}; GetModuleFileNameW(nullptr, executable, 32768);
+ const auto manager = std::filesystem::path(executable).parent_path() / "WsmManager.exe";
+ ShellExecuteW(nullptr, L"open", manager.c_str(), nullptr, manager.parent_path().c_str(), SW_SHOWNORMAL);
+ } else if (tray_action == static_cast<int>(wsm::runtime::TrayAction::StopRuntime)) {
+ if (!provisioner.busy()) {
+ if (streamer.watching()) streamer.quick("sudo shutdown -h now", nullptr, 5000);
+ std::string stop_error; runtime.shutdown(stop_error);
+ }
+ } else if (tray_action == static_cast<int>(wsm::runtime::TrayAction::Quit)) {
+ // Finish normal guest shutdown when possible. During setup stop only our
+ // supervised children; the image, partial downloads and disk stay on disk.
+ if (!provisioner.busy()) {
+ if (streamer.watching()) streamer.quick("sudo shutdown -h now", nullptr, 5000);
+ std::string stop_error; runtime.shutdown(stop_error);
+ }
+ wsm::runtime::stop_child_processes();
+ // A VM can predate this daemon (hot-swap). Its verified QMP endpoint is
+ // installation-local; never terminate QEMU processes by their name.
+ if (runtime.status().pid) {
+ std::string reply;
+ wsm::core::QmpUnixClient(runtime.qmp_socket()).execute("{\"execute\":\"quit\"}", reply, 3000);
+ }
+ HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
+ PROCESSENTRY32W entry{}; entry.dwSize = sizeof(entry);
+ wchar_t self[32768]{}; GetModuleFileNameW(nullptr, self, 32768);
+ const auto manager = std::filesystem::path(self).parent_path() / "WsmManager.exe";
+ if (snapshot != INVALID_HANDLE_VALUE && Process32FirstW(snapshot, &entry)) do {
+ if (_wcsicmp(entry.szExeFile, L"WsmManager.exe") != 0 ||
+ !wsm::runtime::process_runs_executable(entry.th32ProcessID, manager)) continue;
+ HANDLE process = OpenProcess(SYNCHRONIZE | PROCESS_TERMINATE, FALSE, entry.th32ProcessID);
+ if (!process) continue;
+ EnumWindows([](HWND window, LPARAM pid) -> BOOL {
+ DWORD owner = 0; GetWindowThreadProcessId(window, &owner);
+ if (owner == static_cast<DWORD>(pid)) PostMessageW(window, WM_CLOSE, 0, 0);
+ return TRUE;
+ }, entry.th32ProcessID);
+ if (WaitForSingleObject(process, 3000) == WAIT_TIMEOUT &&
+ wsm::runtime::process_runs_executable(entry.th32ProcessID, manager)) TerminateProcess(process, 0);
+ CloseHandle(process);
+ } while (Process32NextW(snapshot, &entry));
+ if (snapshot != INVALID_HANDLE_VALUE) CloseHandle(snapshot);
+ tray.stop(); closesocket(listen_sock);
+ // Setup workers may be unwinding after their child process exits. Exit as
+ // one process rather than destroy objects still captured by those workers.
+ ExitProcess(0);
+ }
fd_set fds;
FD_ZERO(&fds);
FD_SET(listen_sock, &fds);
@@ -1091,7 +1158,7 @@ int main() {
// Runtime state comes from the single runtime owner (reims-ctl); "ready" additionally
// requires the in-guest helper to be connected.
std::string state = wsm::runtime::rt_state_name(rt.state);
- if (rt.state == wsm::runtime::RtState::Running && (!streamer.watching() || streamer.setup_active())) state = "waiting_for_guest";
+ if (rt.state == wsm::runtime::RtState::Running && !streamer.desktop_ready()) state = "waiting_for_guest";
if (rt.state == wsm::runtime::RtState::Running && streamer.setup_active() && streamer.setup_needs_attention()) state = "setup_attention";
body << "{\"state\":\"" << state << "\",\"working_set_mb\":" << rt.working_set_mb
<< ",\"legacy_state\":\"" << vm_state_to_string(st.state)
@@ -1114,6 +1181,7 @@ int main() {
} else if (method == "GET" && path == "/api/vm/log") {
resp = http_response(200, "OK", "{\"log\":\"" + json_escape_str(vm.read_qemu_log_tail(100)) + "\"}");
} else if (method == "POST" && path == "/api/vm/start") {
+ ++foreground_requests;
std::string start_err;
uint64_t ms = 0;
if (runtime.ensure_running(start_err, &ms)) {
@@ -1286,6 +1354,7 @@ int main() {
resp = http_response(400, "Bad Request", "{\"ok\":false,\"error\":\"" + json_escape_str(imp_err) + "\"}");
}
} else if (method == "POST" && path == "/api/apps/launch") {
+ ++foreground_requests;
std::string app_id = extract_http_body(req);
wsm::runtime::AppBundleInfo info;
if (!apps.find(app_id, info)) {
@@ -1357,6 +1426,7 @@ int main() {
resp = http_response(200, "OK", installer.status_json());
} else if (method == "GET" && path == "/api/stream/status") {
resp = http_response(200, "OK", std::string("{\"watching\":") + (streamer.watching() ? "true" : "false") +
+ ",\"launching\":" + (streamer.launching() ? "true" : "false") +
",\"setup_active\":" + (streamer.setup_active() ? "true" : "false") +
",\"setup_needs_attention\":" + (streamer.setup_needs_attention() ? "true" : "false") +
",\"windows\":" + std::to_string(streamer.window_count()) +
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 2977f72..18370cf 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -13,6 +13,9 @@ target_compile_definitions(wsm_app_sync_tests PRIVATE WSM_TEST_FIXTURE_DIR="${CM
add_test(NAME wsm_app_sync_tests COMMAND wsm_app_sync_tests)
add_executable(wsm_qmp_input_tests wsm_qmp_input_tests.cpp)
+add_executable(wsm_child_process_tests wsm_child_process_tests.cpp)
+target_link_libraries(wsm_child_process_tests PRIVATE wsm-appman)
+add_test(NAME wsm_child_process_tests COMMAND wsm_child_process_tests)
target_link_libraries(wsm_qmp_input_tests PRIVATE wsm-core)
add_test(NAME wsm_qmp_input_tests COMMAND wsm_qmp_input_tests)
diff --git a/tests/fixtures/setup_assistant/welcome_pending_tahoe.ppm b/tests/fixtures/setup_assistant/welcome_pending_tahoe.ppm
new file mode 100644
index 0000000..0de550c
--- /dev/null
+++ b/tests/fixtures/setup_assistant/welcome_pending_tahoe.ppm
@@ -0,0 +1,17 @@
+P6
+160 90
+255
+9��9��9��9��9��9��9��9��9��9��9��9��9��9��9��9��8��8��9��8��9��:��9��9��9��8��8��8��8��8��8��9��9��:��:��:��:��9��9��8��8��8��8��7��7��8��8��8��8��7��7��7��7��7��7��7��7��7��6��6��6��6��6��6��6��6��6��5��5��6��5��5��5��5��5��5��4��5��5��4��5��5��4��5��5��4��5��5��4��4��4��4��4��4��4��4��4��4��4��3��3��3��3��3��3��3��2��2��2��2��2��2��1��1��1��0��0��0��0��/��0��0��0��0��/��/��/��/��.��.��/��.��-��.��-��,��,�,�,�,�+�+~�+~�+~�+}�+}�*}�*}�*|�)|�)|�){�({�){�){�({�({�)z�(z�(z�9��:��:��9��:��:��:��:��:��9��:��9��9��9��9��9��9��9��9��9��9��:��:��:��9��9��9��9��9��8��8��9��:��:��:��:��:��:��:��9��9��9��8��9��8��8��8��8��8��8��8��8��8��8��7��7��8��7��7��7��7��7��7��7��7��7��6��6��6��6��6��6��6��6��6��5��5��6��6��5��6��5��5��6��5��5��6��5��5��5��4��4��5��4��4��5��4��4��4��4��4��4��3��3��4��3��3��3��3��3��3��2��2��2��1��1��1��1��0��0��0��1��1��0��0��0��0��/��/��/��/��/��.��.��.��-��-�-�-�,�,�,�+~�,~�,~�+}�+}�+}�*}�*}�*}�)|�)|�)|�){�({�){�)z�)z�)z�:��:��:��:��:��:��:��9��:��:��9��:��:��9��9��9��9��9��9��9��9��:��9��:��:��9��:��9��:��9��9��:��:��:��:��:��:��:��:��:��9��:��9��9��9��9��9��9��9��9��8��8��8��9��9��8��9��9��8��8��7��7��7��8��7��7��7��7��7��6��6��7��7��7��6��6��6��7��7��6��6��6��6��6��6��6��6��6��5��5��5��4��5��5��4��4��5��4��4��4��4��4��4��4��5��5��4��3��4��3��3��3��2��2��2��2��1��1��1��0��1��1��1��1��0��0��0��0��0��0��/��/��.��.��.��.��-��-��-�,�,�,�,~�,~�-~�,~�,~�,}�+~�+}�+|�*}�*|�*|�)|�){�*{�){�){�)z�;��;��;��;��:��;��;��:��;��:��:��:��:��:��:��:��:��:��:��:��9��:��:��:��:��:��:��;��;��;��;��:��;��;��:��:��;��:��:��:��:��;��:��9��:��:��9��9��:��9��9��9��8��9��9��9��:��:��9��9��9��8��8��8��8��8��8��8��8��8��8��8��8��7��8��8��7��8��8��7��7��7��7��7��6��6��7��6��6��7��6��6��7��6��6��6��5��5��5��5��6��6��5��5��6��6��6��6��5��5��5��4��3��3��3��2��2��2��2��1��1��2��1��1��1��1��1��1��0��0��0��/��/��/��.��.��.��-��.��-�,�,�-~�-�-~�-~�,~�-~�,}�+}�+}�+}�+}�*|�*|�)|�*{�*{�*{�){�<��<��<��<��<��<��;��<��<��;��;��;��;��;��;��;��;��;��;��<��;��;��;��;��;��<��<��<��=��<��<��<��<��;��<��;��;��;��;��;��;��;��;��;��;��;��;��;��;��;��:��:��:��:��:��:��;��;��;��:��:��:��9��9��9��9��9��:��:��9��9��9��9��9��9��9��9��8��8��8��8��8��8��8��8��8��8��8��8��8��8��8��8��8��7��7��7��6��6��6��6��6��6��6��6��6��6��6��6��5��5��5��4��4��4��4��4��3��3��3��2��2��2��2��2��2��1��1��1��1��0��0��0��/��/��/��/��.��/��.��.��.��-�-�.�.�-�-~�-~�,~�,~�,}�,}�+}�+|�*|�+|�*{�*{�*|�<��<��=��=��<��=��<��<��=��<��<��<��;��<��<��<��;��<��<��<��<��;��;��<��<��=��=��=��=��=��=��=��<��<��<��<��;��;��;��;��;��<��;��<��<��<��;��;��;��;��<��<��;��;��;��;��;��;��;��;��:��:��:��:��:��;��;��:��:��:��:��:��:��:��:��9��:��9��9��9��9��9��9��9��9��8��8��9��8��8��9��8��9��9��9��8��8��7��7��7��7��6��6��6��6��6��6��6��6��6��5��6��5��5��5��5��5��5��4��3��3��3��3��3��2��2��2��1��1��1��0��0��0��0��0��0��/��/��/��.��.��.��-��.��.�.�.�-~�-�-~�,~�,~�,}�,}�+}�+}�+|�+|�*|�*{�=��>��>��>��>��>��>��=��>��=��=��=��=��=��>��>��=��=��=��=��=��=��<��=��=��>��>��>��=��>��=��=��=��=��=��=��<��<��<��<��<��=��<��=��<��<��<��<��<��<��<��=��=��<��<��<��<��<��;��<��;��;��;��;��;��<��<��;��;��;��;��;��;��;��;��:��:��:��:��:��:��:��9��:��9��9��9��9��9��:��9��9��:��9��9��9��9��9��8��8��8��7��6��6��7��6��6��6��7��7��6��6��6��6��6��6��5��5��5��4��4��3��3��3��3��2��2��2��1��1��1��1��1��1��0��0��0��/��/��/��.��.��.��.��.��.�.�.�.~�-�-~�-~�,~�,}�,}�+}�+}�+|�+|�+|�>��@��@��?��@��@��?��@��?��?��?��?��?��?��?��>��?��?��>��>��>��>��>��>��>��?��?��>��>��?��>��>��>��>��>��>��=��=��=��=��>��=��>��>��=��<��=��=��<��=��=��=��>��=��=��=��=��=��=��<��<��<��<��<��<��=��=��<��<��<��<��<��<��<��<��<��;��;��;��;��;��;��:��;��:��:��:��:��:��:��:��:��;��:��:��:��:��9��9��9��8��8��7��7��7��7��7��8��7��7��7��7��7��7��6��6��6��5��5��5��4��4��4��4��3��3��3��2��2��2��2��2��1��1��1��1��0��0��0��/��/��/��/��/��/��/��/��/��.�.�.�-�-~�-~�,~�,}�,}�,}�,}�,}�?��@��@��@��@��@��@��@��A��@��@��@��?��?��@��?��?��@��?��?��?��?��?��?��?��?��@��?��?��?��?��>��>��>��?��?��>��>��>��>��>��>��>��>��=��<��=��=��=��=��=��>��>��>��>��=��=��=��=��=��=��=��=��=��=��=��=��=��=��=��<��=��=��<��<��<��<��<��<��;��;��;��;��;��;��;��;��;��:��:��;��;��;��;��:��:��;��:��:��:��:��9��9��9��8��8��8��8��8��8��7��8��7��7��7��6��6��6��5��5��5��5��4��4��4��3��4��3��3��3��2��2��2��1��1��1��0��0��0��0��0��0��/��0��0��/��/��/��/��/��.�.��.�.�-�-~�-~�-~�,~�,}�A��A��A��A��A��A��A��A��A��A��A��A��A��@��A��A��@��@��@��@��@��@��@��@��@��@��@��@��?��@��?��?��?��?��?��?��?��?��?��?��>��?��?��>��>��=��=��>��?��>��>��>��>��>��>��>��>��>��=��=��>��=��=��=��=��>��>��>��=��>��=��=��=��=��=��=��=��=��=��<��;��<��<��<��;��;��;��;��;��;��;��;��;��;��;��;��;��;��;��:��:��:��9��:��9��9��9��9��8��8��8��8��7��7��7��7��7��6��6��5��5��5��5��5��4��4��4��4��3��3��3��2��2��2��2��2��2��1��1��1��0��0��0��0��0��0��0��0��/��/��/��.�.�.�-�-�-~�-~�-~�-}�B��B��B��B��B��B��B��B��B��B��B��B��B��B��B��B��B��B��A��A��A��A��A��A��A��B��B��A��A��A��@��A��A��@��@��@��@��@��@��?��?��?��?��?��?��>��?��?��?��?��?��?��?��>��>��?��?��?��?��?��>��>��?��>��>��?��>��>��>��>��>��=��>��>��>��>��=��>��>��=��<��<��=��=��<��<��<��<��<��<��<��<��<��;��;��<��;��;��;��;��;��;��:��:��:��:��:��:��9��9��9��8��8��8��8��7��7��7��6��6��6��6��6��5��5��5��5��4��4��4��4��3��3��3��3��2��2��2��2��1��1��1��1��1��1��1��1��1��0��0��0��/��/��/��.�.�.�.~�.~�.~�B��B��C��C��B��C��C��B��C��B��B��C��B��B��B��B��B��B��B��B��B��B��B��B��B��B��B��B��B��B��B��B��A��A��A��A��@��@��@��@��@��@��?��?��?��?��?��?��?��?��?��?��?��>��>��?��?��?��?��?��?��?��?��?��?��?��?��>��?��>��>��>��>��>��>��>��>��>��>��=��=��=��=��=��=��=��=��=��<��=��=��<��<��<��<��<��<��;��<��<��;��;��;��:��:��:��:��:��:��9��9��9��9��8��8��8��7��7��7��7��7��7��6��6��6��5��6��5��5��5��4��4��4��4��3��3��3��2��2��2��2��2��1��2��2��1��1��1��1��0��0��0��/��/��/��/��/�.�.�.�C��C��C��D��C��D��D��C��C��C��C��C��C��C��C��C��C��C��C��C��C��C��C��C��D��C��C��C��C��C��C��C��C��C��B��B��B��A��B��A��@��A��@��@��@��@��@��@��@��?��@��@��?��?��?��?��@��@��@��@��@��@��@��@��?��?��@��?��?��?��?��>��>��>��?��?��?��?��?��=��>��>��>��>��>��>��>��=��=��=��=��=��=��=��=��<��<��<��<��<��<��<��;��;��;��;��;��:��:��:��:��9��9��9��9��8��8��8��8��7��7��7��7��7��6��6��6��6��5��5��6��5��4��5��4��4��3��3��3��3��2��2��2��2��2��2��1��1��1��1��1��1��0��0��/��/��/��/�/��/�D��D��E��D��E��E��D��E��D��D��D��D��C��D��C��C��D��C��D��D��C��C��C��D��D��D��D��D��D��D��C��D��D��D��D��D��C��C��C��B��B��B��A��A��A��@��A��A��A��A��A��@��A��@��@��@��@��A��A��A��A��A��A��A��@��@��@��@��@��@��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��>��>��>��>��>��>��=��=��=��=��=��=��<��<��<��<��<��<��;��;��;��;��;��;��:��:��:��9��9��9��9��8��9��8��8��8��7��7��7��7��7��7��6��6��6��5��5��5��5��4��4��4��3��3��3��3��3��3��3��2��2��2��2��2��1��1��1��0��0��0��0��0��0��D��D��E��E��E��E��E��E��E��E��D��E��E��D��E��E��D��D��E��D��D��D��D��D��D��D��D��D��D��D��D��D��D��E��D��D��C��D��D��C��C��C��B��B��B��B��B��B��A��B��A��A��A��A��A��A��A��A��A��A��A��A��A��A��A��A��A��A��A��@��@��@��@��@��@��@��@��@��@��@��@��@��@��@��@��?��?��?��?��?��?��>��>��>��>��>��>��>��=��=��=��<��<��<��<��<��;��;��;��;��;��;��:��:��:��:��:��9��9��9��9��9��8��8��8��8��8��7��7��7��7��6��6��6��5��5��4��4��4��4��4��4��3��3��4��3��3��3��2��2��2��2��1��1��1��0��1��0��0��0��E��E��E��E��E��E��F��F��F��E��E��E��E��E��E��E��E��E��E��E��F��E��E��E��E��E��E��E��E��D��D��D��D��E��E��E��E��D��D��D��C��D��D��C��C��C��B��B��B��B��B��B��B��B��B��B��B��B��B��B��B��B��B��B��A��A��A��A��A��B��A��A��A��A��A��A��A��A��A��A��A��A��@��@��A��@��@��@��@��?��?��?��?��?��?��?��>��>��>��>��=��=��=��=��=��=��<��<��<��<��<��;��;��;��;��;��:��:��:��:��9��9��9��9��9��8��8��8��8��8��8��7��7��7��6��6��6��5��5��5��4��4��4��4��4��4��3��3��3��2��3��2��1��2��2��1��1��1��1��1��F��F��F��F��F��F��F��F��F��F��F��F��F��F��F��F��F��F��F��G��G��G��G��G��G��G��F��F��F��E��E��F��E��F��F��F��F��F��F��E��E��E��E��E��E��D��D��D��C��C��C��C��D��D��D��D��D��C��C��C��C��C��C��C��B��B��B��B��B��B��B��B��B��B��B��B��B��B��B��B��B��A��A��A��A��A��A��A��A��@��@��@��@��@��@��?��?��?��?��>��>��>��>��=��>��=��=��=��=��=��=��<��<��<��<��<��;��;��;��;��:��:��:��9��9��9��9��9��9��9��8��8��8��7��7��7��6��6��6��5��5��5��4��5��4��3��4��4��4��4��3��3��3��3��2��2��2��1��1��2��G��G��G��G��G��G��G��G��G��G��F��G��G��F��G��G��F��G��G��G��H��H��G��G��G��G��G��G��G��F��F��F��F��F��G��G��G��G��G��F��F��G��F��F��F��F��E��E��E��E��E��E��E��E��E��E��E��E��D��D��E��D��E��E��D��C��C��C��C��C��B��B��C��C��C��C��C��C��C��B��B��B��B��B��B��A��A��A��A��A��A��A��A��@��@��@��@��@��@��@��?��?��?��?��>��?��>��>��>��>��=��>��=��=��=��<��<��<��<��;��:��:��:��:��:��9��9��9��9��9��9��9��8��8��7��7��6��6��6��6��5��5��5��5��5��4��4��4��4��4��4��3��3��3��3��3��2��2��2��2��G��G��G��G��G��G��G��G��H��G��G��G��G��G��H��H��H��H��H��H��I��H��H��H��H��G��H��G��H��G��G��G��G��G��G��H��H��G��H��G��G��G��G��F��F��G��F��F��F��F��F��F��E��E��F��E��F��F��E��E��F��F��F��F��E��D��D��D��D��D��C��C��E��D��D��D��C��D��D��C��C��C��B��C��C��B��B��B��A��B��A��A��A��A��@��A��A��@��@��@��@��@��@��?��@��?��?��?��?��?��>��>��>��>��=��=��=��<��<��;��:��;��;��:��:��:��:��:��9��9��9��9��9��8��7��7��7��6��6��7��6��6��6��6��6��5��5��5��5��4��4��4��3��3��3��2��3��2��3��3��G��G��G��G��H��H��H��H��H��H��H��H��H��H��H��H��I��I��I��J��J��J��I��I��I��I��I��I��I��I��H��I��I��H��H��I��I��I��I��H��H��H��H��H��G��H��H��H��G��G��G��G��G��G��G��F��G��G��G��G��G��G��G��G��G��G��F��F��G��F��E��F��F��E��E��E��E��D��D��D��D��D��D��D��D��C��C��C��C��B��B��B��B��B��B��B��B��A��B��A��A��A��A��@��@��@��@��@��@��?��?��?��>��>��>��=��=��=��<��<��<��<��;��;��;��;��;��:��:��:��:��:��9��9��9��8��8��8��7��7��7��7��7��7��7��5��6��6��5��5��5��5��5��4��4��4��4��4��4��4��G��G��G��G��G��H��H��H��I��H��H��H��H��H��I��I��I��I��I��J��K��J��J��J��J��J��J��J��J��J��J��J��J��J��J��J��J��I��J��I��I��I��I��I��I��H��H��H��H��H��H��H��H��H��H��I��H��H��H��H��H��H��H��H��G��H��H��I��I��H��G��G��G��G��G��G��F��F��F��E��E��E��E��E��E��E��E��E��D��D��D��D��C��C��B��B��B��B��B��B��A��A��A��A��A��A��@��@��@��?��@��?��?��?��?��>��>��>��=��<��<��<��<��<��;��;��;��;��;��;��:��:��:��9��9��9��8��8��8��8��8��8��8��8��7��6��6��6��6��6��6��6��5��5��5��5��5��5��4��4��G��G��H��H��H��I��I��I��I��I��H��I��I��H��I��I��J��J��J��K��K��K��K��K��K��K��K��K��K��K��K��K��K��K��J��K��K��J��J��J��J��J��J��I��J��I��I��I��I��I��I��I��H��I��I��I��I��I��I��I��I��I��I��I��I��I��J��I��I��I��H��H��H��H��H��H��G��G��G��G��F��F��F��F��F��E��E��E��E��E��D��D��D��D��C��C��B��C��B��B��B��B��A��B��A��A��A��A��@��@��@��@��?��?��?��?��?��>��>��>��=��=��=��<��<��<��<��<��<��;��<��;��;��;��:��:��:��9��9��9��8��9��9��8��8��7��6��7��7��6��6��6��6��6��6��5��5��5��5��5��J��J��J��J��K��K��J��K��K��K��K��K��J��K��J��J��K��K��L��L��L��L��L��L��L��M��L��L��L��L��L��M��M��L��L��L��L��L��L��K��K��K��K��K��K��K��K��K��K��K��K��K��K��K��K��K��K��K��K��K��K��K��K��J��J��K��K��K��J��J��J��I��I��I��I��I��I��H��H��H��H��H��G��G��G��F��F��F��F��F��F��F��E��E��D��D��D��C��D��C��C��C��B��C��B��B��B��B��A��A��A��A��@��@��@��@��@��@��?��?��?��>��>��>��=��=��=��=��=��=��<��=��<��;��;��;��:��:��:��9��:��9��9��9��9��8��8��7��7��7��7��7��7��7��6��6��6��6��6��6��L��L��L��M��L��M��M��L��M��M��M��M��M��M��M��L��L��L��L��L��M��M��L��M��M��M��M��M��M��M��M��M��M��M��M��M��M��M��M��M��M��M��M��M��M��L��L��L��L��M��M��M��L��M��L��L��L��L��L��L��L��K��K��K��K��K��K��K��K��K��J��J��J��J��J��J��J��J��J��I��J��J��I��H��H��H��G��G��G��G��G��F��F��F��F��E��E��E��D��C��C��C��C��C��C��C��C��C��B��B��A��A��A��@��A��A��@��A��@��@��@��?��?��?��?��>��=��=��=��=��=��>��=��<��;��;��:��:��;��;��;��;��:��:��9��8��8��8��8��8��7��7��7��7��7��7��7��7��7��7��N��M��N��N��M��N��N��N��N��O��O��O��O��O��O��N��N��N��O��N��O��O��N��N��N��N��N��N��N��O��N��N��N��N��N��N��N��N��N��N��N��N��N��N��N��M��M��M��O��O��O��O��N��N��N��M��M��M��L��L��L��L��L��L��K��L��L��K��L��L��K��K��K��K��K��K��K��K��K��J��K��K��K��J��I��J��J��J��I��I��H��H��I��H��H��H��G��F��F��D��E��E��D��D��D��D��D��C��C��C��B��B��B��B��B��B��B��B��A��A��A��@��@��@��?��>��>��>��>��>��>��>��=��=��;��;��;��:��;��;��;��;��<��:��:��9��8��9��9��8��8��8��8��8��8��7��8��8��8��8��O��P��P��O��P��P��O��P��Q��Q��Q��Q��Q��Q��Q��Q��Q��Q��Q��Q��Q��P��P��P��Q��P��P��P��P��Q��P��P��P��P��P��O��O��O��P��O��O��O��O��P��O��O��O��O��O��P��P��P��P��O��O��O��O��N��N��N��N��M��M��M��L��M��M��N��M��M��L��L��L��L��M��L��L��L��L��L��L��L��L��L��L��L��L��L��K��K��K��J��K��J��J��I��I��H��G��F��G��F��E��E��E��E��E��D��D��C��C��C��C��C��C��B��B��B��B��B��A��A��@��@��@��?��?��?��?��?��?��?��>��<��<��<��;��<��<��;��2j}3u�<��<��;��;��:��:��:��:��:��9��9��9��9��9��9��9��9��9��Q��Q��Q��Q��Q��Q��Q��R��S��R��R��S��R��R��S��S��R��S��R��R��R��R��Q��R��R��R��R��R��R��R��R��R��Q��Q��Q��Q��P��P��P��P��P��P��P��Q��Q��P��P��P��P��P��Q��P��P��P��P��P��O��O��O��O��P��O��O��N��N��N��N��N��N��N��M��M��M��M��N��N��M��M��M��L��L��M��M��N��N��M��M��M��L��L��L��K��K��K��K��J��J��I��H��H��G��G��F��F��E��E��E��D��E��C��C��C��C��C��C��C��B��B��B��A��B��A��@��@��@��?��@��@��@��@��@��?��>��=��<��=��<��<��9��7z�0XZ'`o;��=��<��<��;��;��;��:��:��:��:��:��:��:��:��:��:��:��R��R��R��R��R��R��R��S��S��S��S��S��S��S��S��T��S��T��S��S��S��S��S��S��S��T��T��S��S��T��T��S��S��S��R��R��R��R��R��R��R��S��S��R��S��S��Q��Q��Q��R��R��R��Q��Q��R��R��Q��Q��Q��Q��Q��Q��P��Q��P��O��P��P��O��P��O��O��P��O��O��O��O��O��N��N��N��N��M��N��N��N��N��M��K��L��L��K��K��L��K��K��J��J��I��I��I��H��G��G��G��F��F��F��E��D��D��D��D��D��D��C��C��C��B��B��B��B��B��A��A��A��A��A��A��A��A��@��?��>��=��=��=��:��0gt2Q@0J5*\`0o�9��=��=��<��<��;��;��;��;��:��;��;��:��;��;��;��;��S��S��S��S��S��T��T��T��T��T��T��T��T��U��U��V��V��V��V��V��U��U��U��U��U��U��V��U��U��U��U��U��V��T��U��U��U��U��U��U��U��U��U��V��V��V��V��U��U��V��U��U��T��T��T��U��U��T��T��U��U��T��S��S��R��R��R��R��S��R��R��R��R��R��Q��Q��Q��Q��P��O��O��N��N��N��O��O��O��N��M��L��L��L��M��M��L��L��L��K��K��J��J��J��J��I��I��H��H��H��G��F��F��F��E��E��E��D��D��D��C��D��D��C��D��C��C��C��B��B��B��A��A��A��@��?��?��>��?��<~�.RK,I>-G2-YY&LF2z�@��=��=��=��<��<��=��<��<��<��<��<��<��<��<��<��U��U��U��U��U��V��U��U��V��V��V��V��V��V��W��W��W��W��W��W��W��V��V��V��W��V��W��V��W��V��W��W��W��W��V��W��W��V��W��V��V��W��W��W��X��X��X��X��X��X��X��W��X��X��X��W��X��W��V��V��W��W��V��V��U��U��T��T��T��T��T��T��S��S��S��S��S��R��R��Q��P��O��O��O��P��P��O��O��N��M��M��M��N��N��N��M��M��M��L��M��L��L��K��K��K��K��J��J��I��I��H��H��G��G��G��F��E��E��E��F��E��E��E��E��D��C��C��C��B��B��A��A��@��?��?��?��?��:��1WS!;-!>6"DAB>6��A��@��>��>��>��=��>��=��=��=��=��=��>��=��=��>��W��W��W��X��W��X��X��W��X��X��X��Y��Y��Y��Y��Y��X��Y��Y��X��X��X��W��X��X��X��X��X��X��X��Y��Y��Y��Y��X��Y��Y��Y��Y��Y��Y��Y��Z��Y��Y��Z��Z��Z��Z��Z��Y��Y��Y��Y��Z��Y��Y��Y��X��X��Y��Y��X��X��W��W��W��V��V��V��V��U��U��U��U��U��T��T��T��S��S��R��Q��Q��Q��P��P��O��O��O��N��N��O��O��O��N��N��M��N��N��N��N��M��M��M��M��M��L��L��K��K��J��J��J��I��H��H��G��G��G��G��G��F��F��F��E��E��E��C��C��B��A��@��A��@��@��<��;mv9\U&C4$?2 >74.`�4w�@��?��@��@��>��>��?��>��?��?��>��?��?��?��?��Y��Z��Z��Z��Z��Z��Z��Z��Z��[��[��\��[��[��\��\��[��\��\��[��[��[��[��[��[��[��[��[��\��\��[��[��\��[��[��\��\��\��\��[��\��\��[��\��[��\��\��]��\��[��[��[��[��[��[��\��[��[��[��[��[��[��[��Z��Z��Z��Y��Z��Z��Y��Y��Y��X��X��X��X��W��W��W��W��V��V��U��U��T��S��S��R��R��Q��P��P��P��P��P��O��O��O��P��O��O��P��P��O��P��P��O��O��O��N��N��M��L��L��K��K��K��J��J��J��I��I��I��I��H��H��G��F��F��E��D��C��C��C��C��C��<jr4bm7WL;J$>R:!A:?IYtA��B��;|�/erA��@��@��@��A��A��@��@��A��@��A��@��\��\��]��]��^��]��]��]��^��^��^��_��^��^��_��^��^��_��^��^��^��^��]��^��]��]��^��^��^��^��^��^��^��]��]��^��]��^��]��]��]��^��^��^��^��^��^��^��^��]��^��]��^��]��]��\��\��]��]��\��]��]��]��]��\��\��\��\��\��[��[��Z��[��[��Z��Z��Z��Z��Y��Z��Y��X��X��W��W��V��W��W��V��U��T��T��T��T��S��R��R��Q��Q��R��Q��Q��Q��Q��R��R��Q��Q��Q��Q��P��P��O��N��N��N��M��M��M��M��L��M��M��M��L��J��I��J��I��H��F��D��D��D��E��F��Fu�+JH4L:*7 A=(?4,(4'*h�?��4k|3^`B��B��A��A��A��A��B��A��A��A��A��A��^��^��_��`��`��`��`��`��a��a��a��a��a��a��a��a��a��a��a��a��a��b��b��b��b��c��c��c��c��c��c��b��c��b��b��b��a��a��a��a��a��`��a��`��`��`��`��`��a��a��a��a��a��`��`��`��_��`��_��_��`��_��_��_��_��_��_��^��_��^��^��^��^��]��]��]��\��\��\��[��[��Z��Z��Z��Y��Y��Z��Y��Y��Y��X��X��X��W��V��U��U��T��T��T��S��T��S��T��U��T��T��S��S��T��T��S��Q��R��Q��Q��Q��P��P��P��P��P��P��P��O��N��L��M��L��J��H��G��F��G��G��H��K��3I71D43X[983/57 <<(`x4gw@��8fh<~�C��C��B��B��B��B��B��B��B��B��B��c��d��d��e��f��f��f��f��g��g��g��g��g��g��h��g��h��h��h��h��h��h��i��i��i��k��l��k��k��j��i��i��i��i��i��h��g��g��g��f��f��f��f��f��f��e��f��f��f��f��f��e��e��e��e��f��e��e��e��f��f��e��e��e��e��e��d��d��d��c��b��b��b��a��a��a��a��a��`��`��`��_��_��^��^��]��]��]��]��]��]��^��]��[��Y��Y��Y��X��X��W��V��V��V��V��X��X��X��X��X��X��X��X��X��X��V��V��U��U��T��T��T��T��T��S��R��Q��P��O��O��N��L��K��J��I��J��K��PztMW-BT8JY0AR.=XF8G-4B*,A6EdVKn[=jl8{�H��F��D��D��D��D��D��D��C��D��D��j��j��j��j��k��k��l��l��m��l��l��l��m��m��n��n��o��p��q��q��q��q��q��q��q��p��q��q��q��p��p��p��q��p��p��o��o��n��n��m��m��m��l��l��m��l��k��k��l��l��l��l��l��k��k��j��l��k��k��l��k��k��k��k��k��k��j��i��i��i��h��h��h��g��g��f��f��f��f��e��e��e��d��d��c��b��c��b��b��a��b��`��`��_��^��]��]��[��Z��Y��Y��Y��Y��Z��Z��Z��Z��[��[��\��\��[��[��Z��Y��X��W��W��W��W��W��W��V��V��U��S��T��S��R��Q��Q��P��N��M��M��L�HX.DP%HU/:E08C(1E7<UX2F@+F?5TBSoY5ae-l�H��J��H��G��G��G��G��F��F��F��G��o��p��p��p��p��q��r��r��r��q��q��q��r��s��s��t��u��u��w��w��w��w��v��u��t��t��t��t��s��s��s��r��s��r��r��r��r��q��q��r��r��r��r��q��q��q��q��r��r��r��q��r��p��q��q��o��q��q��q��q��r��q��p��q��p��p��p��o��o��o��n��n��m��l��l��l��l��k��j��k��j��i��h��i��h��h��g��g��e��e��d��c��d��c��a��a��`��_��]��]��\��]��]��]��\��\��\��\��]��]��]��]��]��]��\��Z��Y��Y��Y��Z��Z��Z��Y��W��W��V��U��U��U��U��U��S��R��R��Q��GlhDV59F,4Y`;^\.B7)Vj=z�H��K��Ckg>`U-ak5cgQ��O��N��M��L��M��K��K��K��J��J��v��w��w��w��x��x��x��x��x��y��z��z��y��z��z��{��|��|��|��}��|��{��z��y��x��y��y��y��y��y��y��y��y��y��y��y��y��x��w��w��x��w��w��w��w��v��v��w��w��w��v��u��t��t��t��u��v��v��v��w��w��v��v��v��v��u��u��u��t��t��s��s��s��{�҆��|��r��r��q��p��p��o��n��n��m��l��k��k��j��i��i��h��h��g��f��f��d��c��c��`��`��b��b��b��a��a��a��`��`��`��`��`��_��_��^��\��[��[��\��]��^��]��\��\��[��[��Z��Z��Z��Z��X��W��V��U��V��T��>VI;^cM��J��?q�2`|Z��Y��LxqQueBq}(NH<]GC��H��@�Q��c��K��V��c��]��\��S��}��~�ӊ�ӕ�ԋ�ӈ�ш�ӄ�ч�ы�ԕ�И�Ԋ�ӄ�ӂ�ю�Н�Ϫ�ӑ�Ӌ�Б�Ή�҃�Ҋ�ґ�҂�Ҁ����~��~��~������~��~��~��}��}��}��|��|��|��{��{��z��z��y��z��y��y��x��w��v��v��v��w��y��z��z��z��z��z��y��y��y��y��y��y��y��x��w��w��~�Ч��������t��u��u��v��v��v��s��r��r��p��p��p��p��p��q��p��q��m��m��l��k��j��k��p��j��g��`��c��i��g��g��g��g��g��f��d��d��b��c��b��`��`��`��`��`��`��`��a��`��`��`��_��_��_��]��\��[��[��\��]��_��_��`��`��W��4^za��b��QxpJlZI_D;P<CX<6+$\&_�N}����/_�6^k4ZdJr�S{�q����Ґ�ː�ɘ�ʑ�Ɉ�ǖ�˖�ˢ�̉�dž�Ȃ��z��c���É�Ȏ�ƒ��~����̗�ɂ�ŋ�ŝ�ɯ����ԯ��w��i�Á�˂�Ѓ�҃�҃�у�с�Є�Ђ�π�Ё�Ѐ�Ё�΁�π�π�π��~��}��|��{��y��y��x��x��x��y��|��}��}��}��~��~��~��}��}��|��}��|��}��}��|��{�͘�߰���Ͳ��x��x��y��z��z��z��y��x��u��r��x��o��d��~��w��S��T��Q��J~�J}�P�����f��r��U��P��e��g��s����[��j��m��t�����w��h��^��\��i��\��`��f��e��e��f��e��f��f��g��g��g��e��c��d��c��d��e��e��g��g��_��f��c��f��Kcr���w��Vpb?Q4/H7)B92L;(LB-_y,_�)[2\r���k{zk|����{��q����ƅ�Í�Ş�lj�ˆ�Ď�Ȑ�Ɖ��x��e��a��s����Ȃ��m��`�������˒�Nj��p��S��m��{��x��t��l��������u��X��`�������Ϲ�ο�г�˖�ȥ����н����ҽ�һ�ҽ�ҩ�̞�Α�·�̆�ͅ�ό�φ�̓�̎�̝�Ω�γ�ή�̲�ͱ�Ϻ�Ӱ�Р�͉�˂�̂�̇�ͅ�ˆ�̐�̱���吷ѵ��}��}��~��u��l��a��V��M}�Dt������́��X��Ly�Gx�\�����y��������`��n��U~�Qz�Gs�Bs�Ox�Y��Hv�Er�Y��h��f��^��U}�Sz�e��U|�Fr�T{�e��Y��V��Z��g��l��m��m��m��l��l��k��m����¥�Ȍ��d��f��Nz�Cp�:g�1a�3b�0_�-]�6U.^�4b�?U<)B4<@$DG"<2=3?]QOdWPfV}�{o�}>PTL[^���������q��c��f�����z��v��u��c��~��m��X��m��h��y��l��Jy�i��t�����q��k��O��[��Hy�K~�L{�Bs�;n�X��f��d��Q�T~�a��x��p��y�����p��o����ę����������������Ī����ɸ�ɟ�Ã��s��o��`����÷�ҹ����ȱ�³�Dz�ȹ�˿�ٴ�������ͫ�ɠ��p��_��w�������ݲ�ب��l��g��i�����~��w����ä��������{�����a��j��_lwy��|��w~�,:?r~����x��W|�Io�]��}�����z�����~����Ot�i��j��Ut�Xz�a��Vw�]�Sw�Mq�Uy�Io�>g�Sx�v��������k��Jp�?e�6a�5^�6Z�1W0W�0W�.V~.V~4]�Eh�Sq�2]�2]�.\�.L0]�3_�:P@!?:'FD <?>UWL``chVTW>NTFL[\;HHJV[������������S~�N}�e��a��p��c��W��Hu�Ix�i��U��R|�f��O{�<n�>m�@o�U�Y��Ht�<m�@q�Aq�Fu�Er�@n�?o�@o�`��{��Z��b��Qy�i��j��v��a��g��e��j�����w��s��Y��g��p��h��]��k��z��g��[�g��o��u����������Ɍ����䙵ʔ��������u������������������������ɾ��t��Cn�w����������������������������etw)7>������������������������y��v����̼���럵�d��Mp�Hk�b|�d~�@c�Ij�Rq�`}�\|�Jl�Ad�Gi�@e�Kl�^|�Lm�Hi�Qn�1W|Kl�Zv�Mj�3W~7\�>`�Ab�Fg�9[~9[�c����isp3HJ$Fa-Qq)X�*BN!E`)Ld)=.HQ'CJ:QXdmdgsobiUJTQ.58`hb���v����������î��>o�Cs�Bt�>q�Br�Gw�;n�=m�Cr�Q}�=m�Es�@o�=n�?n�?o�Dp�Dp�An�?n�Ap�Jv�Bo�@n�@n�Eq�Bm�@m�Bn�Fr�Cl�Bm�Do�Lt�Gp�Ry�Vy�Ov�Gr�T{�Jq�Ou�e��W�T{�X{�>h�Ou�Fl�f��Ns�Cj�Bj�Cm�������Ms���Ր��f�����|��s�����j����ͩ��h����𦷻�����վ�����o�t�~������h��|��������������d�������М�����������$1Zdl���&8CKYe���Jk�������j��������Pn�Ad�Fh�Bc�Kj�Ac�Tq�Ll�Ii�^y�Lj�Ff�Gh�]z�=`�<_�<_�Ba�:[�6Z=^Fc�Sm�9\1V{Mj�D`Ea~@b�n��{�����gtq-BG05JWTUb_O]`GVS&049>=JS;rp^b_FSUE9C7jqe3AH-<E>T\������������������?s�Bu�Cu�Cv�Au�At�Cv�Cv�Ev�Cu�Ct�Du�Ev�Fw�Kw�Iv�Lw�Kv�Hu�Gt�It�Jv�Hu�Ft�Ft�Ft�Fq�Er�Ep�Fp�Ep�Eq�Do�Eo�Fp�Fn�Dn�?l�@j�@i�>f�=f�<g�<g�<f�;g�Fo�?h�>g�=g�>h�9d�8c�6b�5a�<k�?h����R{�Z{����Qy�=f���ݿ������ɥ�ȶ�����[ect������P^b)9?Xej���dru5BC<FK��������������������ń��������������������AMTny����&IbSu����g�����v��<c�<c�;a�9`�9`�8_�:`�<`�9^�<b�>b�:_�7^�7\�3[�4Z~4Z~4Y}4X|1W{1V{3W{7Z}5Y|6Z|Fd�3Uw]w����|�zZkk���>OP$-`kh~�m��|Y_QpjV~rY�}^�{emnaUXO(:B3=A_llp|���������������QadH\d/GR LxMxNx LwMyNyMxNyNxNxNyNxNxMxNyMwNxNwNxNwNvNwMvNvNvOxNwMvMvMvMuLuKsMtKsLsLsKsLtKtJsKsMuMtLsLt Jt JsJs IsJtJt Jt JrJs Is([����>n�������W~�k����ࣲ���ճ����֨��copWei���������3DL6DL������w��$392<A��������ъ��P[`��ɧ��cll��������T^`������,7Zfq���=P*[���Ȑ��s��Mty��Ds�BlAm@l @j ?j
+?k=h=h?i?i>i?k>k>k?l?l ?l>k
+@m Ak
+>l
+=k >k =k
+<hu��`jbVcaARWPdg&;B;MOKWRadKUaJSXCf^FpjS�}dgiKihYU^^=HN��������������������HYR0EMC\dMcfe�f�g�f�e�f�f�f�f�e�f�e�f�f�g�g�e�i�g�g�g�h�>}�T��k�P��j��`��k�h�h�h�h�f�g�f�g�f�f�j�J��p��n��CUXETk�f�f�f�f�e�f�e�d�c�c�c�t����أ��q����ʹ�Ԛ��ZbdR_bKY_�����ǵ�������8HPgt|������x��@NU������������z��oy}�����ڷ��nwxdmnT]_���XaeAKQ���[hp(5!3A~��������t����ȁ�ˊ��m��_�YY�X�XYV}V}V~U|U}V}U|U|T|S|Z#b�"b����xzo��3e~g����{�����S`^Zeefoo���XilPggL^[jvf>AajWQTFSM;OZ;.<.������Wiez�����������{�����������4EK-CKixun�n�n�n�o�o�o�n�m�l�m�l�m�l�m�n�n�#r�l�k�/gzauydnkmyw_rr8FH /5"18CO=hu5TYUij�l�m�k�m�k�m�w��q|w1AC
+"
+" &dk�i�k�ay+N\Shj�h�h�i�h�%bwZsymwyR_`bnp���FPUFOS.3%4:NY]V\]bomZgj+3-4+3-4"17+7>%17P[\blnz�����S\]���������mwunxwR]^7AEDNT8BI"/6!/9+8)5&3<(10; d�
+a� c�,x�f� b� _ ^
+_�
+^� `� ^� ^�\[} [W{WyWyVzVx`vDYWRcbr|AIG(04Q^]`jhakhmwt���N][x�}������AVW%.8|��QYVDH7w�]qlR_\���������y��\pm;QS������w��������������Veb *3DIy�w�w�x�w�w�w�u�w�w�s�q�p�n�n�m�m�ezl�p�j�i�j�!m�,p�TfN`N_Tj g\tb}p�q�q�u�t�u�u�#v�'y�&u�i~_vc|x�x�x�y�y�u�v�t�u�u�;��R�����w��P^_}�����CNS!-4).#(:GJ������[ecMY\-4)1#,+4#2<"*&,(.9FLQ\Zpzxajm������q|}YcdDNR0;?(49%17'4:(5<&4=#.,8*6?-:?'<A+gu"ap_r\qeh�h�f�e� e� f� e� f� g�i�g� f g� f@}�2t�o|u@KG9DC,0#+Uad������lut'6>������������w�~ !-"/-?H���\ggARUScaPTOtyl���������bpmy��t�}���������������������������J[^"�� ��"��#��"��#��"��!��!��!��"��"�� �"��� ��!�#��$��"��"��"��#��$��%��#��"��!��#��"�� ��!��"��!��#��$��$��#��$��$��'��#��"�"}�#~�'��%�"|�"|�&}�(|�D��({�%{�-~�W��Q��Q{�'OWMqt;\]@`c&GPBJ9?"?Ay��u��x��Hff @@5:39.4;@?_a'HH!CCBI1Vc9]hHdk���juvNZ\XceMWZCMP4?C*5:&16+8>#08'/*4;,7=4?F2?A@UT+��#{�!{�#}�!|� {� {� y�#w�%t�n}s�r�p�jg}!h|7q~?y�������lxu8C?!Pah������������gpp������������)3#&9AGUWZe\jum4EGNXT���������������8EG���������j~z������������������������~� �$��$��"�#��"�$��%��!~� |�"}�!|�$~�%�$��'��&��*��*��+��*��)��)��*��,��*��*��*��,��(��*��+��*��/��1��0��.��/��2��5��4��3��2��/��/��2��3��6��3��3��1��2��1��2��4��5��2��.��+��%{�.��0��'}�)z�+y�"s�)z�'y�&z�$x�"x�'~�'��)��+��*��)��+��+��)��o��@LOCQVR`dJVXAKM1;A.8@&17$/4-9?*5:JRSGMN@GK0:>3>>{�|y��*��$~�'��&��%��$�%��%��)��)��(��&��#�"}� x�!v�>��z��u��>��>��,if!`c `i9s{\��^��:]i<^d\vuNehdwvp�}Zfc*:=.38LJhs``l\K\V"24jp`ks_��r��y��o@LHWe]��������Mfejtl������u�{������������*��*��+��*��)��,��(��*��.��/��-��/��1��1��.��2��3��4��6��4��3��6��3��3��5��6��5��5��7��5��7��9��:��<��?��<��;��>��<��<��B��@��>��=��8��;��:��8��5��6��6��5��5��3��5��2��2��2��0��(��*��)��)��$��&��%}�#}�&��#~�{�#�(��+��+��+��)��*��%��%��"|�>��v��blperueqtDOU-8<,7<)4;/9@(28KSVbhiX^]X^^)/*472::������b��#y�$�(��q��~��R��%~�!{�&��$�$|�$|�#{�)�������������Ohh6��$}�#|�$�'�$}�$�%}�&~�&}�,��1��7��[��S��M�x-ld-ofQ�~K�s7o`N{mY�nb�nv�w{�xp�wUyij�zm�p��d�y~��������������~��y�����6��9��9��=��>��<��@��B��>��?��?��?��A��D��F��@��D��B��E��F��E��I��H��F��F��D��?��D��B��D��B��G��E��F��G��J��I��I��H��F��F��E��E��G��B��@��=��A��B��>��@��;��9��;��7��5��7��6��2��,��'��)��4��^�����������������[��v�r�u�u�r�m�l�h�h�fz��ftsbmmissYdd0<B&18!-26@Egop������������Za`!))24Zb_���������_��M��������v�gspXxz'o�k�l�j�m�l�������������emlcon6JNc}j�h�d�i�k�k�k�e�d�f�g�(m�+q�/q�!bo]i,pz*nw di%hp,r}-ux8}s;|o[��b��?~y5}~A��E��I��X��d��o��h��Y��P�}W�}B��@��A��H��H��I��H��G��D��F��E��H��H��J��N��E��G��G��J��J��J��M��L��R��Q��L��L��G��A��D��H��N��I��K��H��J��D��F��H��A��F��E��D��F��H��A��B��@��<��9��:��8��9��8��4��4��2��-��(~�#y�!y�j��������������������������a��g�g�g�f�d�e�c�9w�������������������������s{z���������������������flm4=>������������y�����������t�{t��k{x`vu2��}�!}�y�@�����ĺ���������u�*CJ]ro�l�m�o� p�n�n�l�"y�'��,��.��,��/��&{~$vz*|}*|~#vv+||.��/��0�||�����������l��>��;��C��V��\��X��_��T��L��M��H��K��E��D��D��E��I��I��I��L��I��L��I��M��N��J��L��H��M��I��N��N��O��M��K��K��J��J��E��L��I��F��H��M��G��@��@��B��E��>��<��?��@��B��>��A��=��?��:��7��2��.��&x�$v�+|�+}� u�&}�&}�#z�x�����������������|~_`cege_dgovvE}�r�p�m�i�h�?}����������������������������������������DHKnut|��lvs���=HM5AGu~~��P]_.AG8KQu��gvtK\]DUX6GK?MP5OWn�s�v�Mv}���������������]lm1=Um&{�#{�&~�*��4��5��9��+��,��,��.��1��-��1��"z{&xz1}�3}�-xy.x{/}�*zi�����������������y��4��5��8��D��L��J��K��F��C��?��H��D��D��F��D��A��D��E��E��F��J��D��F��H��I��D��@��B��G��I��C��C��G��I��L��O��M��K��K��J��F��J��H��=��:��8��9��H��`��i��m��c��[��J��:��<��7��8��4��5��2��1��3��2��-��-��/��)��D�����������\ceUYZ34:^dfZcg8?HFNU2=F-KS$~�%|�w�t�/y����������������������������������������������LOT17:,7:1?B?NP;IO+1LVS=LNDW[/EL?alSts?ed>cd4[`.\i3k�<y�1o�)d+d|X��[�b��[?ou+dqbs)y�[���������������û���������J��@��<��3��-��${#rx.{}8��2�}.z{-x*s}i�����������{��NdfFad5p~>��C��K��Y��U��Q��P��N��<��8��6��8��=��=��:��=��<��>��;��@��A��=��:��=��;��<��>��>��>��9��>��E��A��C��H��D��?��?��>��A��=��;��1��H���������ļ�º�������������ľ�þ���r��A��&��*�� w� u�#u�q�q�s�v�(|�������������Tbf-:B$0:=JP+8@$1:'2;)3<0DJ0��-��+��$��p��������������������������������������������������|~-7;+;?6EIv��5CG'6<*;@%8>$9@2WiVz�T|�Bs�5o�5t�*r�&q� k�#n�'q�5v�9y�;{�B��6��,|�,}�]��������ozw�����frrIU\8HO[jmYy~/�0��6��8��7��1��:��7��5{5~3~�6��@��a��m��j��g��[��U��`��c��k��r��v��{��v��v��w��,��5��2��9��2��,��'��0��.��,��.��/��/��5��4��(|�!v�'z�-��1��,��.��/��2��7��;��;��6��9��:��6��+��-��4�����������������������ksrclm��s}|���������������{��B��/��2��0��-��+��+��L��������hyPbi1CL'9D)9E+;E/8B-7@X_esy||��p��J��#r�h|������������������������������������������������������ltr!)$-&3;#4<$+%-(07=4m�@��>��?��?��<��<��=��<��<��@��A��?��C��I��=��6��3��D��U��RzVtr_zwUnmD\]6PT8UXIhhEw�3w�B��<|�6v�4s�8szH~K}|EwuGxv@{|I��H��^��l��k��o��l��i��p��s��u��z�����������������%��(��!z�&~�!x�t�"y� w�${� w�"w�#y�!x�#v�n�%x�!v�q�q� u� w�t�$x� v�r�*{�)y�%v�(w�,{�.}�"s�/w�������������������iqrVcd;DF9BFJTVJVX@KLGQPgqn����������ľ���m��4��(~�&|�0��E��_yyUjk+BI-9(4)4&3%/)39tvu���~w�����}osoTnv0l�Olyt��p�ylyrlxrq}qx�z���������������jsqIST8EER^XNZVFTN8FB.-'61BUMSg^Zsg\�p`�|X��W��]��Y��W��T��S��O��O��N��R��S��U��Y��_��a��\��Z��V��V��[��`��b��h��q��s��r��l��e��b��a��d��f��j��f��a��i��k��i��e��k��m��s��w��y��{��y��x��y��z��t��z��~��~��x��z��~����!��!��#�� ��%��|�x�&~� y�x�w�'~�%}�%}�$}�!{�{�-��'��!y�${�#z�'}�&{�)|�4��6��0��/��,~�,�-}����������������}��frtZfh(48.7:,68*48/597?C9CDPYY>HHQVVrtr~�����������N��B��H��E��\��c��b{~TjmI`eH]c=TX@UX=SUJaaB_i1Ui4c}5o�9w�+r�)u�)j�Dt�S~�_��e��f~}k|sz�|���q�q���z�wlzlR`VZiao~sn~nYiUJVDFN?IO;^cMitbYqpNq~Gu�By�D��K��O��I��E��H��A��@��D��M��N��R��S��W��V��Q��G��G��C��I��N��N��I��O��R��R��U��R��V��Z��T��W��Z��[��^��_��d��g��h��i��l��n��q��q��u��o��r��t��o��q��r��t��w��r��p��u��x��%�"�$��"��}���|�{�!~� w�k�t�u�q�"x�+�+�/��$x�(|�/��+|�t�&y�+|�+}�(z�){�*{�.�.�:{����������~��TaeNY[:FL$-1%/4/7<+36)26-4828=-49-685>?9>@599CGF:>>CGHX\\t��4|�:��5��;��B��U��M��Ey�I}�R��N��P��<|�0u�(t�%w�,��5��8��:��<��H��C��K��8x�@u�Es~HquV{zUspWuqLlfVulKhcPmeUsiXyjHna5bW)[S&UJ<k_J|v:}�+x�+q�-t�1x�0w�0s�&j�(m� h�"m�&s�-|�0�1~�0y�7�;��5�6��<��C��L��D��N��L��H��R��W��V��O��T��U��\��Z��`��_��d��a��h��k��j�����������{��p��p��r��r��n��q��p��j��j��q��s��r��l��j��k��v�s�#z�!z� x�y�(��(��/��$}�)�� y�%}�%|�%|�!x�"x�$z�t�#w�(}�(~�"x�#z�+��%|�.��+��#x�"w�#x�g��������y��L\`AOS/?D.9?AMQ1<@(05$-1,591;>4;@DKO;CGCKNBEHAGHKQP>EEEKMS\^kvpk��;��5��<��=��E��E��9�@z�U��V~�Mw�Fv�9s�/p�0w�/{�1��1��7��3��5��I��T��K��c��V��M��_��e�|S~uIzpLwmErjEtkJ~sU�uS�uO�uC�rG�uM�xX�}F��<��6��1��3��7��9��;��>��D��A��A��D��F��F��M��O��T��R��O��P��M��L��O��S��N��I��Q��M��Q��V��W��Y��`��\��d��g��i��j��a��e��o����������]okX|]��d��p��v��o��u��w��u��t��u��m��m��e��a��r�s�"v�"x�!x�r�v� y�)��+��1��-��+��%~�-��,��5��3��,��&�'~�,��,��*��)��%}�+��'}�+��,��,��������u�}��o{}ZgjamrP\a/=A=HM4>C2<@4>C1<@5>BDLQNVZNX[0>@8CE5A@>EHGPRBMLv�w���r��9��<��?��B��?��3��*{�%n�&o�-r�5x�0x�1z�2}�1}�){�2��8��,��0��2��7��F��U��Q��O��Q��^��X��H��G��I�G�{K�vM�yT�wP�xN�zM�xV��b��V��J��P��N��R��S��O��M��Q��V��Y��N��J��S��U��V��W��T��U��W��Q��P��P��N��V��X��V��Y��Y��U��W��[��]��`��Z��[��[��\��^��Q�{M�{;lqBkqMtwKrs<jq*cr,gy*evF}S��k��f��j��l��t��p��t��i��d��O��#u�*~�+��+��v�v�u� v�v�t�o�p�u�${�(��'��*��'��v�s�%|�+��/��.��/��(�0��(~�)~�%{�D��������y�|��ovoszt]ebrywT]^\eeQ[[Q\]HQTV`aISTW`_^ges{wenlT_]jtqrzw������������~��?��4��:��9��0}�0|�-v�4|�.v�5{�4y�-r�"i�"m�h�!o�$s�<��A��?��?��J��W��c��^��f��d��_��a��`��W��b��a��b��d��]��W��V��U��Z��c��\��Q��S��R��X��Z��\��S��W��]��\��a��a��T��Z��b��b��a��`��X��R��X��[��V��\��W��X��\��c��e��f��e��b��e��j��i��k��r��q��o��r��k��r��s��n��l��p��i��p��m��l��r��s��p��n��r��m��n��p��q��p��&|�(}�$y�#y�'~�u�v�x�#{�'}�'}�*��0��/��)�"z�"y�%z�%z�%{�+�-��#{�%}�!z�)��,��)��)�-��h��r�v�t}p{zq{yx�}pxtjspu}{}��y�~~�������������������������u~wgqlbkf`jd`lgCPO@POQ��J��J��U��T��U��Y��T��H��K��R��P��H��E��F��Q��R��L��E��I��O��R��_��a��[��]��c��f��]��Y��[��]��[��d��`��@|w6kn-bk0am7jz@w�:z�5z�8��F��P��X��a��b��d��d��f��e��f��a��`��`��d��f��i��e��_��\��[��f��m��f��r��~����������������������������������������������u��r��t��t��u��m��o��m��p��q��m��q��o��t��w��u��o��s��v�!x�!z�w�#|�#|�#|�t�"w�#y�"w�'|�%z�%}�%}�*��.��/��.��$|�${�z�)��(��,��,��0��0��/��,}�]stYikSbeXgiO]`BQU8GK1@EKX\VccYcd_ghLUULUU_ecS[XW_]TZY:BD3<@'16%,(%&' ()55y�2{�4��P��g��_��Y��Y��]��[��W��W��Q��L��M��Y��O��J��K��N��L��Y��Z��U��T��[��c��i��g��g��b��\��W��^��e��N��1z|bn]qZsWs"e�g�!k�/z�=��T��P��I��J��U��F��:��W��N��S��_��`��Z��\��[��b��u��������������������������t{s]f\LUJNVLIQK?GCFLHIPI8@<=F@<CAGNKMUN_j_l|nl�sg�zp��s��r��m��g��e��j��p��p��n��a��k��i��m�� w�"{�(��+��'��.��/��0��&��,��.��*��%��{�y�%��'��$��+��/��.��,��1��1��3��4��/��0��6��<��Hz�3HG!34 /2 ( " "(#($  " #"#    " $')2/:H`'k�"f�%g�.q�1s�.t�1v�)q�-u�=��S��X��U��H��G��C��5��1~�0|�.x�/u�<~�A��7y�-s�*s�6|�?��E��S��_��a��b��e��i��j��_��]��]��W��W��U��X��\��e��b��\��[��^��U��^��b��a��]��[��Z��Y��`��x��������������������jskiqgLUJLVJ]eX[eXLVLNWMCLEAJECLH3=:4<<6==BJH@HDKQLNVOAIC;C<:D>7@:2;76?:IRI]dXWcWn�ww��w��w��x��r��h��o��p��h��&��*��&��&��"��'��$��(��(��*��,��,��,��2��3��.��.��6��1��9��3��;��B��A��:��:��5��:��A��D��G��\�{Fh`?\V8UQ0II%>?78#:< 783715/3!48!48/316177>9A8@<I@OIUMZRb$ds9{�@��=��@��G��W��U��O��U��\��`��]��N��Y��[��X��P��=��8��@��@��7��3~�-w� `v"_s$aw'k}3x�;��J��_��e��]��e��i��i��`��^��_��]��i��i��c��c��\��b��b��\��a��\��^��`��a��[��_��o������Ĺ���������hrf[e[Q\QMWMIRJOXMIRGHRIHRIHQJ;E=:C>4;8:B@1:9:C?/861;:6@?5><>GACKEBKE?IE1867><3;8*22086*33&/0;EFGTUDQP>LKDQMLSQHPKO\R^mbfzo5��2��5��0��1��9��<��?��>��<��H��M��B��>��D��F��I��L��K��M��M��W��W��R��U��R��R��W��_��a��]��g��r��u��o��a�u]�qSwcKl[DeWBcWAaU7VM1QI6VP3XT1VS;\SBi]IpbIqdIsbR�r[�uT�Y��c��e��e��i��d��k��g��e��e��h��f��_��d��d��f��a��\��X��v��������������t��Z��c��g��h��g��q��h��a��h��h��g��`��f��i��f��^��Z��]��e��g��g��a��]��d��]��d��g��c��\��\��i���������Ĺ������nukU\SR[PU`PYdSWbSQ[PS]RLVL6@:)103<85=:*31&0-4<:,412<9,54"++$%"+,'//2<:KTQAIE>GC7?<-52-52"*,"*+"'3AB2=?<IJ$.0".0$00&00 )(/859C>7@;5��A��C��A��A��B��;��9��<��A��O��S��E��L��I��E��G��U��T��O��P��S��O��H��F��Y��^��^��a��b��c��s��x��y��w��q�|q�zr�{m�vh�rp�vi�pk�ve�qh�tl�}l�~r�t�}q��r��s��p��m��u��|��m��e��]��[��e��l��i��d��Y��X��S��W��Z��[��c��b��}�����������������������������w��j��h��[��]��X��_��^��_��]��b��b��a��j��g��e��f��c��c��]��a��f��h��f��f��^��p���������ž�����{[dXV^QCKCAIA>F=ISHKTH=G>OZPOYOISH.86"&"#%.0'/1'00)20"!$+**33$&"%%..0:79C?4=9#*+!*,$%#** )+&05=IM/;>&*",-*42.63/87*32-53<EA8A=;��<��B��F��F��K��O��O��M��N��M��T��L��R��[��U��U��Y��R��P��Q��Q��S��T��`��S��\��\��]��a��d��h��e��k��p��s��t��v��v��z��w��m�}n��s��j��i�p��t��q��n��k��c��R��J�X��Y��U��R��D��?��C��H��B��:~�9�B��D��A��P��N��F��`����������������������z��y��x���o��q��s��k��l��p��m��k��j��o��q��o��l��j��c��m��p��o��n��m��o��n��l��j���������Ƽ������oxoU^TKTIJTHCMB;C=4<6>F??HA+4/;D>-729C<DND(2/"/772:9'..'/0#+,""((+33,53-65'02!#" # %%*0<=&24(35",,8@>:C@8A<5>;,524<92;74=9?��A��F��I��L��O��Z��N��R��i��l��m��d��c��a��V��]��h��g��]��`��d��a��h��h��t��t��q��j��c��g��o��u��m��p��x��y��}��z��v��q��n��i��a�zg�i�{o��m�~l��q��u��l��e��c��`��O��A��;{�:}�>��R��W��V��_��g��k��q��p��o��g��p�����y�|{t}�rsuj]^YXYSOPJIJGGHDSVPamk_�|]��q��v��z��y��|��y��w��u��v��s��v��p��o��n��m��m��k��p��n�����������������elbRYOPZMV`SLVIFPE:D<5>75=8085CLF+2/ *()''0--72!+*"&('&/.!"%#%&(!"!#$--&//&/0.88!#!'!*-(23")*(30$$'003=:7@=6>;5?:1:5;C>:C=3<8KSM;��;��9��=��<��E��Q��P��V��\��_��d��]��U��a��c��d��j��l��_��_��`��i��m��p��m��j��`��f��u��~����r��u��{��~��������y��s��s��m��b��g��h��q��s��q��t��x��k��j��j��h��e��n��q��z��w��s��u��p��u��x��y��x��x��w��S��;k}CmNpWq{brs`jdX^YJOMEJKENN?KOGVXFakHn�1e}1h�7n{l��|��{��x����x��y��t��t��v��v��n��m��n��k��n��z��������������oun\f\Q[OPYMMWLDNEEOGENHBLF<E>9B=/85085 %/-)2/"+,"""#.64(( #",,!**#$!*+$,.(02'11.88198/88&//$& )*.75(2/$-,.73,530:73<9.744=:9A>-53$.,S��Q��R��N��P��R��[��`��\��[��]��g��l��]��i��e��f��g��a��`��c��j��h��f��l��h��d��a��l��m��w��{��r��w��|��y�����}��u��n��t��l��j��i��s��t��u��q��n��q��u��q��k��i��j��m��w��v��v��s��l��x��y��w��y��y��s��o��n��Cy|'`u(`}-c{BhwIgpSntA\c;W`-Qc"QlQnOrLkNlTr^wc|@}�r��v����~�����v��v��}�����p��p��v��}����������������~T^TR[QQ\PKUJGQGJTINXNENF=F>.83%., )((1/!*) ! #""(10*20"! :A@6?<(11&&'/0085094.636?:(2/'0/"#  $'&$$() ""$"++,531:7&0/##(02#&"Y��P��R��L��S��X��Z��`��i��a��Y��X��Y��`��h��g��a��\��`��e��j��c��h��r��n��\��U��S��c��u��m��V��Z��p��w��x��v��w��m��l��i��o��|��x��w��w��l��l��y��w��w��q��l��r����u��o��s��o��u��������|��r��h��m��n��k��y��p��S��S��N��Y��V~�V|�Vv|ZywX||?s�<x�7|�J��a��p��m��z�����~��o��v��y��|��x��v��v��p��q��}������Ŀ������y�wRZQ@I@:D@QZSCMD7A:EPH@J@HRJ6@<7@=$#:B>  ((!()%'!$#$085'0-+31AID:B=!*(%$&'#+,*2/.61+3/#+'#+*%--"*,!
+ (23!% #&&&/-*40('*33#++#T��N��P��O��K��K��W��[��Z��]��U��f��g��h��`��W��U��g��m��g��p��m��l��g��Y��]��[��Z��Y��R��N��h��{��g��i��h��j��g��f��\��]��Y��n��u��m��^��^��n��o��l��m��o��m��p��r��x��o��f��o��z��~��{��y��{��w��p��p��t��k��e��g��m��g��b��Z��h��i��g��_��]��S��I��R��N��L��S��l��y��|��{��{��|��w��z��r��v��������������������PZOS\QKTM7A<:D?MWQCMEAJE.93;E?@JC3=9AJF%("%&' "$ !%%,43%-+-517?:.62('&//4<;'/-(1/%-+&.+%.+$,-"*+%("$#%#,- "!)+!+*1:68A>8B>+32#$%./ ]��[��I��R��X��e��]��_��_��a��d��Z��_��Y��c��e��a��k��k��i��c��^��O��S��N��K��O��S��]��a��c��e��]��\��J��8x�=y�;y�;{}>}Q��W��S��_��V��U��X��Y��]��_��S��\��Y��Z��U}�Y}�X{�HqzDt|Iyj��~��~��}��z��t��������~��x��p��o��^��V��Z��[��a�S��U��H|�@u�5o}7t�6t�5q{=uz=tw[��q����{��w��������������������������akeOYR?IBDNF7A::C?+403<9<E@/94/95>IC+61$.+   #  "$#''.63-63#,*'0/!)'! ##,44-53"*($,,%-,(1/"++'0,%-,'&&.,(1."*)('""'&5=:4=:)2/ )( "%X��H��F��P��[��]��[��\��Z��Y��\��[��c��h��m��`��Q��N��?��@��M��F��D��G��J��a��\��b��e��X��C��9w�7u�1q�6s�3l�Ay�:u�3o�2r{<}C��9~=��<��F��LwU{T~~U~Mv|Kx�M{�Ix�Ds�Cq�:j}2i�0j�&`vE�Cz�m��u����������|��������v��u��u��g��k��l��a��]��O��"QV#OTS��W��L��s��}��~��y��}�����������������������������iqhEOEEPGEOH/83(2.+432<84=<1:7!+'*41AKG;E?)319C>!  '(<C@=E@&.0+30'( "$&!**.73-62#"#%&'!(*!!%$ )'084*3/&.-,42 ('&.+!*''% ,53$-+$# *(%%%%" !!)*F��M��O��T��Y��]��c��Y��Y��Z��a��R��U��^��`��h��h��e��L��Z��\��e��n��n��T��P��M��R��A~�8w�*lx+kx4r�1m}&bo(es+hu1oyD��K��Y��V��V��P��<��9q{?svC{�Fz�Cu�?mx:kx6i{4ew2e{'a{%^wXo(cuAv�;s{U��p�����������������������������������������������Vsc($F_S~����������������������������������������ltmFOHCKEAJBFOG9C=2:7$-* )+",+$.,"-*%.+%/,8A<@JF1<5  &.-:B=9A<%-+$,*!))"**:B>"*&&%#+)'/, ('" &.+&.+083195)2/)10$,* )(!! !)'5>9*21"#((  "%%%]��Z��T��Y��U��R��`��b��g��b��]��\��[��f��f��a��d��c��h��a��b��^��[��Z��d��j��k��g��^��_��[��a��f��_��R��K��K��^��g��p��f��h��g��U��I��3sv6svC��>y{1kx4px<y�1mz=rCu|J{{W��d��p��z��j��u�����������������|������������������������������HbW% ?XHx��z��p��������������������������~�}]e_<E?7?;<D>CKC<E@KTM<D?5=:!))"#%&)23*33&/.&$#!",(<F?/84 #++ (&*30=EA !*)4<:298$$ 9A>:B=$,*&.,,419A<" #"'##+'+4.082'/,*3/"*' ! &.- )(%$!*($,*'/- )''&%%#$ )*!++%&"++\��a��V��T��S��b��a��j��k��n��k��h��l��l��h��Z��T��j��s��n��m��i��n��y��s��g��l��f��j��j��t��u��s��t��������������������������~��v��n��q��}��y��{����������i��r�����������������}����������������������������������|������������������{��BZMD[L����������������������������XbX@IB4<8?FBCKF.62,427@;BKE3<8'/-$--##%%*12(120967@9'0,$-+6?<KTN7@< $'BJE9A:2:5?GB!*)+32,42)10 1:60:54=93;87>96>9%#"!&$#!&.).61083/62(1+"+(%$$$ !!)'&$ &$ !)("!!! ))%&'' a��b��b��_��R��N��_��Z��_��m��m��m��l��]��T��O��O��Y��^��d��i��k��o��h��_��d��g��m��q��t��s��x��q��t�����������������������z��|��~��������~��������������������}��������������}��{�������������������������������������������������������}��}������������������������������?HB<FA8B><DA@ID,42##%.-!)()10+32%%AKE!*( ((!.64 (('0.'1+NXQXbYKUN&$"+,086-73DNH+43""$--((((%-+/76%,+%%(1/?HD<D@;D?8A:6>8%"%-+!"+)'/*1834=6(1,!"!"!&&%-,!)'"+)""#$!"$# !#$#$ #[��d��`��^��X��U��W��\��`��i��g��L��O��_��V��S��R��a��b��e��]��_��i��o��o��o��p��z��z��w��y��~��������������������}��w��z���������������������������������}��~��y����������|����������������������������z��s��w��x��x�����������|��r�����z�����������������������������=GA<FA=GB(20&/-##3;:?GA"*).63)1/5=<'0/[email protected]$%&$#+*&&+5/>HABMH=HB###,-4>;JTMDNH$/+$.,!))(0./733;83;8+30196@IDBKE/85$-*/74 (&)1-'/+"+((1,*2,'/*,5/$-("*&$""+(#+)%-, )&'/,%-*'0+*2-$,)#"$$%%@��?��P��Z��Z��m��l��e��e��i��]��a��e��Y��]��Y��h��k��t��|��l��t��|�����|��y��w��{��x��s��v��w��y�����������}��}�����~�����������y��m��o��e��c��t��{��x��u��z��{��~����������������������������������~����������n��t��u�����������t�r�{������������������������������\hc8B=CLH:D@MVO )(HQL;C>'% ! +30IQL<E?9C=096$-+#+*2;7_g].83/:5BLGOYT(( *+'002;8/93;F?<FA2<7*41#-)4<97?;4<98@=5=97@:>G@AKDKTN*2/&#$"$# %.+%.*)2,,5-081%-) )&-51'0*'##+)(%'$&.*%.)(0+%-*&$" &%
+ !D��F��T��S��^��_��_��T��R��c��e��t��t��m��b��f��f��t�����{��z��������}��{��q��n��|��{��q��w��|��y��k��c��e��m��t��x��z��~��v��t��z��|�����|��q��j��a�}d�~r��~��|�����������z��w��������������|��i��s��~�����x�����{��w��|����y��{�����������������������������������o}w]jg*64?HEFPJ=FA%&,44()%(%'4<:,50#-)AJDP[T5?;'0+/73MUM/93?IDP\T<HA*)**'11-74CLG7A;=GB,63",* &%086.63/747>;4=9>GB@IA8A=:C>7?;#+*$-,%%#+*%.+)1,+4.'0+)1-#,(,40&"$ '%%-( "*($,)(0,"+'%-)&#%#&&!"'&O��[��^��o��]��S��Y��Q��d��m��v��y��z��p��t��r��n��p��u��y�������}��}��z��v��z��������}��z����������|��{��~��s��m��o��w��z����{��|��z��w��i��f��i��r��r��o��v��y��z��t��n��m��o�����������}��r��x��y����~��z��x��q��s��t��������������������������������������������GTOIUMLWNEPH&1-!#$&"% "#$%%5=98@=5>:?HD3=9-735>:)1-.62;E@[f]KXOKWP%1."-,)433<;8A>=FA:E@CMI<EB)'(0.:B>/73-73)3.7@;AKEIRJ7@;9B=%/*)2.(0.#+)%-,+3/*2-$,)$,)!*' )&&.+)2.$!(%$ %#%%!*(&.+$-)#+(!*'(%&$ )&%$Q��_��j��c��]��_��W��]��d��p��l��j��s��i��k��^��^��Y��Z��_��g��f��j��w����|��{��t��z��y��z��z��������������������|��v��y�����������������v��~��{��~��y����u��y��s�~y��s�}o�j�~k��{��t��u��p��s��o��r��|��x��p��s��w�����������������������������������������������~��3>99D>Q]S9D?#"! 
+"$ !*21(0./858@;0:6'101;8'#$-)7?94>7VbZO\RKXQ>JE0;7(31&1/096DNI;GA3>9-74$.+(',400:47A<DNHFPIMWPFPI6@:?HC'1+(1,%-*&/*#+)!)' )''0-)1,  )1/#+) )&&$'% %% )'!%#&$%-+$""!_��_��l��\��P��V��T��Z��f��t��{��{��l��^wxTu|Nr�Pu�Lv�Bv�=o~;o~;ny7m{>w�n��{��{��y��w��y��z��}�����������������{��x��x��s��t��������������}��v�~{��y��s��x��n�}~�����|��}�����������y��y�����~��|�����w��t��u��o��o��w��������������������������������w�|������������-94)11-645?90;8!++!" )*!!#)03"*+%.-<CA9A=2;82<:=GC)&"+(GOGR[QurlxkeqeCOH".+$/.,735?;AJDBMG8D?)(.857A<;D?3<8?JE9C<CMFAKD9C<2<5#-)!*')%*3/+3.*3-&/,,40)2.#,(&%'%&$ "+)%$  #"#!!&$" F��R��L��O��V}�`|wXvxYv|b��_�RtJmw=gvDm|6g6n�;m�9er-bw.d|0g}%_t%Xf*et4owS�~f��z�����{��w��s��r��x��~��{��y�����}��w��z�����������|����������������������}��}�����������~��~��z��u��w��u��q��w��~��{��t��q��s��o��������������������������������_nf���������cmf1<;((+34+42@ID?IB0:81;9 )*'*6?=%.-)12((:D@FOK4=99A>(10"+*&0.EPKMVNJSHepbq}m>KB6B>2>;*528B?9C>/94>HC2<8)414>:HTKEOG@JC;E>5>7?HAAJC7A9*3/ *'$" %"!*&(0,/71-5/)2+/72"*(#" (' ""##&%!""# """""!E��E��Cw�Kw~Oy�M{�Ny�Cn|Dr�8n�1h�6t�/j�(b}._t=kw3i�1ctPdRlSmZwTkYk>v{b��������������������{��|��p��~�����������~��������q��y��������������~������������w��~��{����y�����~����������������������~��~��r��o�����������������������������������������\ha/;8/97(103<;$-+.73AKE=GC",*&./6?=$--##'/.8A>>HE6?<,54FNJ.75'108C>ZdZCMDZeZVbX?KB6B=/;71<9<GC5@;5@;DOHPZQHSJGRIQ\R:E=7A93<56@96?8:D=2<4%/'8B84>4($",(!*&($)2,#,''/+(0,!*&" ((!"!$%   $&!"
\ No newline at end of file
diff --git a/tests/wsm-stage-installer-tests.sh b/tests/wsm-stage-installer-tests.sh
index ed68d5a..c29ba60 100644
--- a/tests/wsm-stage-installer-tests.sh
+++ b/tests/wsm-stage-installer-tests.sh
@@ -20,6 +20,8 @@ cat > "$base/mock/installer" <<'MOCK'
#!/bin/sh
echo called >> "$TEST_ROOT/calls"
target=$4
+case "$2" in "$target/.wsm-InstallAssistant.pkg") ;; *) echo 'Package must be staged on target APFS first' >&2; exit 91;; esac
+cmp "$2" "$TEST_ROOT/Install Assistant.pkg" || exit 92
app="$target/Applications/Install macOS Tahoe.app"
mkdir -p "$app/Contents/Resources" "$app/Contents/SharedSupport"
printf '#!/bin/sh\nexit 0\n' > "$app/Contents/Resources/startosinstall"
@@ -28,6 +30,8 @@ if [ "${FAIL_PACKAGE:-0}" = 1 ]; then exit 7; fi
MOCK
cat > "$base/mock/cp" <<'MOCK'
#!/bin/sh
+[ "${1:-}" != -c ] || shift
+[ ! -e "$TEST_ROOT/legacy-pending" ] || { echo 'Concurrent installer copy' >&2; exit 95; }
if [ "${FAIL_COPY:-0}" = 1 ]; then
printf partial > "$2"
exit 8
@@ -35,6 +39,21 @@ fi
/usr/bin/cp "$@"
MOCK
chmod +x "$base/mock/"*
+cat > "$base/mock/ps" <<'MOCK'
+#!/bin/sh
+if [ "${WAIT_OLD_COPY:-0}" = 1 ] && [ ! -e "$TEST_ROOT/legacy-signaled" ]; then
+ touch "$TEST_ROOT/legacy-signaled" "$TEST_ROOT/legacy-pending"
+ printf '/bin/cp -fc %s/Install Assistant.pkg %s/Macintosh HDApplications/Install macOS Tahoe.app/Contents/SharedSupport/SharedSupport.dmg\n' "$TEST_ROOT" "$TEST_ROOT"
+else
+ rm -f "$TEST_ROOT/legacy-pending"
+fi
+exit 0
+MOCK
+cat > "$base/mock/sleep" <<'MOCK'
+#!/bin/sh
+echo waited >> "$TEST_ROOT/waited"
+MOCK
+chmod +x "$base/mock/ps" "$base/mock/sleep"
target="$base/Macintosh HD"
package="$base/Install Assistant.pkg"
mkdir -p "$target"
@@ -50,7 +69,8 @@ sh "$script" "$target" "$package"
[ "$(wc -l < "$base/calls")" = 1 ]
# A truncated previous copy must be repaired, even with a valid executable.
printf short > "$support"
-sh "$script" "$target" "$package"
+WAIT_OLD_COPY=1 sh "$script" "$target" "$package"
+test "$(cat "$base/waited")" = waited
cmp "$package" "$support"
[ "$(wc -l < "$base/calls")" = 2 ]
# A package failure cannot be hidden by its partially created executable.
diff --git a/tests/wsm_app_sync_tests.cpp b/tests/wsm_app_sync_tests.cpp
index 4539999..8dda64f 100644
--- a/tests/wsm_app_sync_tests.cpp
+++ b/tests/wsm_app_sync_tests.cpp
@@ -10,6 +10,14 @@
#include "wsm/reims_registry.hpp"
#include "wsm/ssh_private_key.hpp"
#include "wsm/qmp_unix.hpp"
+#include "wsm/ssh_tools.hpp"
+#include "wsm/process_identity.hpp"
+#include "wsm/vm_health.hpp"
+#include "wsm/runtime_idle.hpp"
+#include "wsm/runtime_desktop.hpp"
+#include "wsm/window_pixels.hpp"
+#include "wsm/input_batches.hpp"
+#include "wsm/window_focus.hpp"
#include <windows.h>
#include <cstdlib>
#include <filesystem>
@@ -37,6 +45,62 @@ int fake_guest(const std::string&, const std::string& script) {
int main() {
using namespace wsm::runtime;
+ const FocusBounds focus_target{100,100,500,400,0};
+ CHECK(!guest_point_covered(200,108,0,{{400,200,500,400,1}}));
+ CHECK(guest_point_covered(200,108,0,{{100,100,500,400,1}}));
+ CHECK((visible_title_point(focus_target, {}, 1920,1080) == std::pair<int,int>{350,108}));
+ CHECK(!visible_title_point(focus_target, {{0,0,1920,1080,1}},1920,1080));
+ const auto exposed = visible_title_point(focus_target, {{300,100,200,400,1}},1920,1080);
+ CHECK(exposed && !guest_point_covered(exposed->first, exposed->second,0,{{300,100,200,400,1}}));
+ CHECK(gui_open_command("com.apple.Safari").find("asuser") != std::string::npos);
+ CHECK(gui_open_command("/Applications/Alice's App.app").find("'\\''") != std::string::npos);
+ const auto clicks = synchronized_input_batches({"Mold-position", "Mclick-position", "Eleft-down", "Eleft-up", "Eright-down", "Eright-up"});
+ CHECK(clicks.size() == 4 && clicks[0] == "click-position,left-down");
+ CHECK(clicks[1] == "left-up" && clicks[2] == "right-down" && clicks[3] == "right-up");
+ CHECK(synchronized_input_batches({"Mfirst", "Mlast"}) == std::vector<std::string>{"last"});
+ CHECK(input_key_code("{\"key\":{\"type\":\"qcode\",\"data\":\"a\"}}") == "a");
+ CHECK(input_key_code("{\"type\":\"btn\"}").empty());
+ CHECK(is_guest_app_path("/System/Library/CoreServices/Finder.app"));
+ CHECK(!is_guest_app_path("/System/Library/CoreServices/../Other.app"));
+ InputCadence cadence;
+ const std::string key_a = "{\"key\":{\"type\":\"qcode\",\"data\":\"a\"}}";
+ CHECK(cadence.wait_ms(key_a, 100) == 0);
+ cadence.delivered(key_a, 100);
+ CHECK(cadence.wait_ms(key_a, 102) == 8);
+ CHECK(cadence.wait_ms(key_a, 110) == 0);
+ CHECK(cadence.wait_ms(key_a, 300) == 0); // normal typing never sleeps
+ CHECK(cadence.wait_ms("{\"type\":\"abs\"}", 102) == 0);
+ CHECK(cadence.wait_ms("{\"down\":true}", 102) == 0); // pointer independent of keyboard
+ CHECK(released_input_events({"a"}).find("\"down\":true") == std::string::npos);
+ CHECK(released_input_events({"a"}).find("\"data\":\"a\"") != std::string::npos);
+ std::vector<uint8_t> corner_pixels(80 * 60 * 4, 255);
+ round_window_pixels(corner_pixels.data(), 80, 60, 24);
+ CHECK(corner_pixels[3] == 0 && corner_pixels[(80 * 60 - 1) * 4 + 3] == 0);
+ CHECK(corner_pixels[(30 * 80 + 40) * 4 + 3] == 255);
+ std::vector<uint8_t> dark_pixels(80 * 60 * 4, 0);
+ for (size_t i = 3; i < dark_pixels.size(); i += 4) dark_pixels[i] = 255;
+ round_window_pixels(dark_pixels.data(), 80, 60, 24);
+ CHECK(dark_pixels[(24 * 80 + 24) * 4 + 3] == 255);
+ for (size_t i = 0; i < corner_pixels.size(); i += 4) CHECK(corner_pixels[i] <= corner_pixels[i+3]);
+ CHECK(desktop_elapsed_seconds(" 03:01\n") == 181);
+ CHECK(desktop_elapsed_seconds("01:02:03") == 3723);
+ CHECK(desktop_elapsed_seconds("2-00:00:01") == 172801);
+ CHECK(desktop_elapsed_seconds("bad") == -1);
+ CHECK(desktop_elapsed_seconds("00:99") == -1);
+ CHECK(!account_recovery_due(29)); CHECK(account_recovery_due(30));
+ CHECK(!window_watcher_timed_out(119999, false)); CHECK(window_watcher_timed_out(120000, false));
+ CHECK(!window_watcher_timed_out(14999, true)); CHECK(window_watcher_timed_out(15000, true));
+ CHECK(!runtime_idle_ready(true, false, 0, false, 900000)); // SSH/old session alone is not an idle desktop.
+ CHECK(!runtime_idle_ready(false, true, 0, false, 900000));
+ CHECK(!runtime_idle_ready(true, true, 1, false, 900000));
+ CHECK(!runtime_idle_ready(true, true, 0, true, 900000));
+ CHECK(!runtime_idle_ready(true, true, 0, false, 180000));
+ CHECK(runtime_idle_ready(true, true, 0, false, 180001));
+ CHECK(!compact_requested("after setup\n"));
+ CHECK(compact_requested("asked\n"));
+ CHECK(!maintenance_can_shutdown(3, 4, true, 0, false)); // A launch during maintenance cancels shutdown.
+ CHECK(!maintenance_can_shutdown(3, 3, false, 0, false));
+ CHECK(maintenance_can_shutdown(3, 3, true, 0, false));
const std::string legacy_launch = "19:16:10 guest$ A=/Applications/Install.app; \"$A/Contents/Resources/startosinstall\" --agreetolicense --volume \"$V\"\n";
CHECK(legacy_install_needs_resume(legacy_launch + "22:20:23 [booting] Starting the macOS installer\n22:22:18 [failed] WSM couldn't take control of the macOS installer.\n"));
CHECK(!legacy_install_needs_resume("[booting] Starting the macOS installer\n"));
@@ -46,12 +110,19 @@ int main() {
CHECK(recovery_script_cksum("123456789") == 930766865u);
CHECK(recovery_script_cksum("") == 4294967295u);
const auto transfer = recovery_script_transfer(std::string(6000, 'x'), "/tmp/test-script.sh");
+ CHECK(transfer.size() < 7500);
size_t line_start = 0;
while (line_start < transfer.size()) {
const auto end = transfer.find('\n', line_start);
CHECK((end == std::string::npos ? transfer.size() : end) - line_start < 512);
line_start = end == std::string::npos ? transfer.size() : end + 1;
}
+ const auto quotes = recovery_script_transfer(std::string(1000, '\''), "/tmp/test-script.sh");
+ for (size_t start = 0; start < quotes.size();) {
+ const auto end = quotes.find('\n', start);
+ CHECK((end == std::string::npos ? quotes.size() : end) - start < 512);
+ start = end == std::string::npos ? quotes.size() : end + 1;
+ }
CHECK(!setup_action_clickable(SetupAssistantStep::WelcomePending));
CHECK(!setup_action_clickable(SetupAssistantStep::Unknown));
CHECK(setup_action_clickable(SetupAssistantStep::Welcome));
@@ -59,6 +130,11 @@ int main() {
CHECK(welcome_restart_due(true, false, 120));
CHECK(!welcome_restart_due(false, false, 1200));
CHECK(!welcome_restart_due(true, true, 1200));
+ CHECK(!first_sign_in_restart_due(true, false, 119, 179));
+ CHECK(first_sign_in_restart_due(true, false, 120, 0));
+ CHECK(first_sign_in_restart_due(true, false, 0, 180));
+ CHECK(!first_sign_in_restart_due(false, false, 1200, 1200));
+ CHECK(!first_sign_in_restart_due(true, true, 1200, 1200));
CHECK(setup_memory_mib(8077) == 4096);
CHECK(qemu_extra_arg("dir=C:/Users/Alice Smith/payload") == "'dir=C:/Users/Alice Smith/payload'");
CHECK(qemu_extra_arg("O'Neil") == "'O'\\''Neil'");
@@ -99,6 +175,7 @@ int main() {
{"welcome.ppm", SetupAssistantStep::Welcome, 480, 481},
{"welcome_tahoe.ppm", SetupAssistantStep::Welcome, 480, 477},
{"welcome_pending.ppm", SetupAssistantStep::WelcomePending, 0, 0},
+ {"welcome_pending_tahoe.ppm", SetupAssistantStep::WelcomePending, 0, 0},
{"normal_app.ppm", SetupAssistantStep::Unknown, 0, 0},
};
for (const auto& s : screens) {
@@ -188,6 +265,12 @@ int main() {
// 1920x1080 templates (Country 25G342, AppleAccount, AccountMenu popup, FileVault) on 1744x984 & 2560x1440.
const auto country_on_1744 = project_centered(load_screen("country_25g342.ppm"), 1920, 1080, 1744, 984);
CHECK(recognize_setup_assistant(country_on_1744.data(), 1744, 984).step == SetupAssistantStep::Country);
+ // Unfocused Country screen on 1712x964 where the first list row turns grey (#D4D4D4) instead of blue.
+ auto country_unfocused_160 = load_screen("country_25g342.ppm");
+ for (int y = 36; y < 40; ++y) for (int x = 58; x < 102; ++x)
+ for (int c = 0; c < 3; ++c) country_unfocused_160[(y * 160 + x) * 3 + c] = 212;
+ const auto country_unfocused_1712 = project_centered(country_unfocused_160, 1920, 1080, 1712, 964);
+ CHECK(recognize_setup_assistant(country_unfocused_1712.data(), 1712, 964).step == SetupAssistantStep::Country);
const auto apple_on_1744 = project_centered(load_screen("apple_account.ppm"), 1920, 1080, 1744, 984);
CHECK(recognize_setup_assistant(apple_on_1744.data(), 1744, 984).step == SetupAssistantStep::AppleAccount);
const auto popup_on_1744 = project_centered(parent, 1920, 1080, 1744, 984);
@@ -206,6 +289,11 @@ int main() {
CHECK(recognize_setup_assistant(analytics_on_1280.data(), 1280, 800).step == SetupAssistantStep::Analytics);
const auto welcome_tahoe_on_1080 = project_centered(load_screen("welcome_tahoe.ppm"), 1808, 1020, 1920, 1080);
CHECK(recognize_setup_assistant(welcome_tahoe_on_1080.data(), 1920, 1080).step == SetupAssistantStep::Welcome);
+ // Lake Tahoe backdrop with a blank white pill (no "Get Started" text) must never trigger Welcome.
+ auto tahoe_blank_pill = project_centered(load_screen("welcome_pending_tahoe.ppm"), 1712, 964, 1712, 964);
+ for (int y = 829; y < 863; ++y) for (int x = 804; x < 908; ++x)
+ for (int c = 0; c < 3; ++c) tahoe_blank_pill[(static_cast<size_t>(y) * 1712 + x) * 3 + c] = 250;
+ CHECK(recognize_setup_assistant(tahoe_blank_pill.data(), 1712, 964).step != SetupAssistantStep::Welcome);
const auto age_tahoe_on_1080 = project_centered(load_screen("age_range_tahoe.ppm"), 1808, 1020, 1920, 1080);
const auto age_tahoe_action = recognize_setup_assistant(age_tahoe_on_1080.data(), 1920, 1080);
CHECK(age_tahoe_action.step == SetupAssistantStep::AgeRange);
@@ -257,6 +345,28 @@ int main() {
const fs::path root = fs::temp_directory_path() / ("wsm-app-sync-test-" + std::to_string(GetCurrentProcessId()));
CHECK(!fs::exists(root));
+ const auto standalone_ssh = root / "Standalone OpenSSH";
+ fs::create_directories(standalone_ssh);
+ for (auto name : {"ssh.exe", "scp.exe", "ssh-keygen.exe"}) { std::ofstream(standalone_ssh / name) << "test fixture"; }
+ CHECK(find_ssh_tool("ssh", {root / "missing", standalone_ssh}) == fs::absolute(standalone_ssh / "ssh.exe"));
+ CHECK(find_ssh_tool("scp", {standalone_ssh}) == fs::absolute(standalone_ssh / "scp.exe"));
+ CHECK(find_ssh_tool("ssh-keygen", {standalone_ssh}) == fs::absolute(standalone_ssh / "ssh-keygen.exe"));
+ CHECK(find_ssh_tool("../ssh", {standalone_ssh}).empty());
+ CHECK(find_ssh_tool("ssh", {root / "missing"}).empty());
+ wchar_t own_executable[32768]{};
+ CHECK(GetModuleFileNameW(nullptr, own_executable, 32768) != 0);
+ CHECK(process_runs_executable(GetCurrentProcessId(), own_executable));
+ CHECK(!process_runs_executable(GetCurrentProcessId(), standalone_ssh / "ssh.exe"));
+ CHECK(!process_runs_executable(0, own_executable));
+ CHECK(qmp_status_name("{\"return\":{\"status\": \"paused\",\"running\":false}}") == "paused");
+ CHECK(qmp_status_name("{\"return\":{\"status\":\"running\"}}") == "running");
+ CHECK(qmp_status_name("{\"error\":{}}").empty());
+ CHECK(unexpected_setup_stop("paused"));
+ CHECK(unexpected_setup_stop("guest-panicked"));
+ CHECK(!unexpected_setup_stop("running"));
+ CHECK(!unexpected_setup_stop("shutdown"));
+ for (auto name : {"ssh.exe", "scp.exe", "ssh-keygen.exe"}) fs::remove(standalone_ssh / name);
+ fs::remove(standalone_ssh);
fs::create_directories(root / "runtime" / "config" / "guest");
CHECK(!wsm::core::QmpUnixClient((root / "missing-qmp.sock").string()).type_ascii_text("test"));
const auto ssh_key = root / "runtime" / "config" / "guest" / "id_ed25519";
diff --git a/tests/wsm_child_process_tests.cpp b/tests/wsm_child_process_tests.cpp
new file mode 100644
index 0000000..2be42c0
--- /dev/null
+++ b/tests/wsm_child_process_tests.cpp
@@ -0,0 +1,39 @@
+#include "wsm/child_processes.hpp"
+#include <iostream>
+#include <string>
+
+int main(int argc, char**) {
+ if (argc > 1) { Sleep(INFINITE); return 0; }
+ wchar_t path[32768]{}; GetModuleFileNameW(nullptr, path, 32768);
+ const std::wstring child_line = L"\"" + std::wstring(path) + L"\" --child";
+ STARTUPINFOW outside_start{}; outside_start.cb = sizeof(outside_start);
+ PROCESS_INFORMATION outside{};
+ std::wstring outside_line = child_line;
+ if (!CreateProcessW(nullptr, outside_line.data(), nullptr, nullptr, FALSE, CREATE_NO_WINDOW,
+ nullptr, nullptr, &outside_start, &outside)) return 1;
+ const auto cleanup_outside = [&] {
+ TerminateProcess(outside.hProcess, 0); WaitForSingleObject(outside.hProcess, 3000);
+ CloseHandle(outside.hProcess); CloseHandle(outside.hThread);
+ };
+ if (!wsm::runtime::initialize_child_processes()) { cleanup_outside(); return 2; }
+ const auto bytes = WideCharToMultiByte(CP_ACP, 0, child_line.c_str(), -1, nullptr, 0, nullptr, nullptr);
+ std::string owned_line(static_cast<size_t>(bytes), '\0');
+ WideCharToMultiByte(CP_ACP, 0, child_line.c_str(), -1, owned_line.data(), bytes, nullptr, nullptr);
+ STARTUPINFOA startup{}; startup.cb = sizeof(startup);
+ PROCESS_INFORMATION owned{};
+ if (!wsm::runtime::create_owned_process_a(nullptr, owned_line.data(), nullptr, nullptr, FALSE,
+ CREATE_NO_WINDOW, nullptr, nullptr, &startup, &owned)) { cleanup_outside(); return 3; }
+ BOOL in_job = FALSE;
+ const bool supervised = IsProcessInJob(owned.hProcess, wsm::runtime::children_job, &in_job) && in_job;
+ wsm::runtime::stop_child_processes();
+ const bool stopped = WaitForSingleObject(owned.hProcess, 5000) == WAIT_OBJECT_0;
+ const bool unrelated_alive = WaitForSingleObject(outside.hProcess, 0) == WAIT_TIMEOUT;
+ PROCESS_INFORMATION rejected{};
+ const bool relaunch_blocked = !wsm::runtime::create_owned_process_a(nullptr, owned_line.data(), nullptr,
+ nullptr, FALSE, CREATE_NO_WINDOW, nullptr, nullptr, &startup, &rejected);
+ if (!relaunch_blocked) { TerminateProcess(rejected.hProcess, 1); CloseHandle(rejected.hProcess); CloseHandle(rejected.hThread); }
+ CloseHandle(owned.hProcess); CloseHandle(owned.hThread); cleanup_outside();
+ if (!supervised || !stopped || !unrelated_alive || !relaunch_blocked) return 4;
+ std::cout << "Owned children stop, unrelated processes survive, relaunch is blocked.\n";
+ return 0;
+}
diff --git a/tests/wsm_fullscreen_tests.cpp b/tests/wsm_fullscreen_tests.cpp
index 28efa2f..aef5450 100644
--- a/tests/wsm_fullscreen_tests.cpp
+++ b/tests/wsm_fullscreen_tests.cpp
@@ -17,9 +17,13 @@ int main(int argc, char** argv) {
x = 10; y = 540; CHECK(!viewport_point(view, 800, 600, x, y));
RootlessCompositor compositor;
std::atomic<int> pointer_x{-1}, pointer_y{-1}, mouse_presses{0};
+ std::atomic<int> last_button{-1}, last_clicks{0};
InputCallbacks callbacks;
callbacks.on_mouse_move = [&](const wsm::proto::InputMouseMoveEvent& event) { pointer_x = event.x; pointer_y = event.y; };
- callbacks.on_mouse_button = [&](const wsm::proto::InputMouseButtonEvent& event) { if (event.pressed) ++mouse_presses; };
+ callbacks.on_mouse_button = [&](const wsm::proto::InputMouseButtonEvent& event) {
+ last_button = event.button; last_clicks = event.clicks;
+ if (event.pressed) ++mouse_presses;
+ };
std::string error;
CHECK(compositor.start(callbacks, error));
const auto title = "WSM fullscreen test " + std::to_string(GetCurrentProcessId());
@@ -67,6 +71,16 @@ int main(int argc, char** argv) {
GetWindowRect(hwnd, &updated); CHECK(same_rect(updated, full));
SendMessageW(hwnd, WM_NCLBUTTONDOWN, HTMAXBUTTON, 0);
GetWindowRect(hwnd, &updated); CHECK(same_rect(updated, original));
+ const int presses_before = mouse_presses.load();
+ SendMessageW(hwnd, WM_RBUTTONDOWN, MK_RBUTTON, MAKELPARAM(200, 100));
+ SendMessageW(hwnd, WM_RBUTTONUP, 0, MAKELPARAM(200, 100));
+ CHECK(last_button == 1 && mouse_presses == presses_before + 1);
+ SendMessageW(hwnd, WM_LBUTTONDBLCLK, MK_LBUTTON, MAKELPARAM(200, 100));
+ CHECK(last_button == 0 && last_clicks == 2 && mouse_presses == presses_before + 2);
+ SendMessageW(hwnd, WM_LBUTTONUP, 0, MAKELPARAM(200, 100));
+ SendMessageW(hwnd, WM_NCRBUTTONDOWN, HTCAPTION, MAKELPARAM(original.left + 200, original.top + 15));
+ SendMessageW(hwnd, WM_NCRBUTTONUP, HTCAPTION, MAKELPARAM(original.left + 200, original.top + 15));
+ CHECK(last_button == 1 && mouse_presses == presses_before + 3);
compositor.stop();
std::cout << "PASS: F11/green button fullscreen, Escape restore, input scaling, menus and geometry stability\n";
}