diff --git a/.cargo/config b/.cargo/config new file mode 100644 index 000000000..5aa69189f --- /dev/null +++ b/.cargo/config @@ -0,0 +1,2 @@ +[env] +__TAURI_WORKSPACE__ = "true" diff --git a/.changes/add-dylib-support-to-macos-frameworks.md b/.changes/add-dylib-support-to-macos-frameworks.md new file mode 100644 index 000000000..1017a65d7 --- /dev/null +++ b/.changes/add-dylib-support-to-macos-frameworks.md @@ -0,0 +1,5 @@ +--- +"tauri-bundler": patch +--- + +Add dylib support to `tauri.bundle.macOS.frameworks`. \ No newline at end of file diff --git a/.changes/additional-args-api.md b/.changes/additional-args-api.md new file mode 100644 index 000000000..e5a257daf --- /dev/null +++ b/.changes/additional-args-api.md @@ -0,0 +1,5 @@ +--- +"api": minor +--- + +Added the `additionalBrowserArgs` option when creating a window. diff --git a/.changes/additional-args-config.md b/.changes/additional-args-config.md new file mode 100644 index 000000000..bdb497ee3 --- /dev/null +++ b/.changes/additional-args-config.md @@ -0,0 +1,5 @@ +--- +"tauri-utils": minor +--- + +Added the `additional_browser_args` option to the window configuration. diff --git a/.changes/additional-args.md b/.changes/additional-args.md new file mode 100644 index 000000000..a9cc187ad --- /dev/null +++ b/.changes/additional-args.md @@ -0,0 +1,7 @@ +--- +"tauri": minor +"tauri-runtime-wry": minor +"tauri-runtime": minor +--- + +Added the `additional_browser_args` option when creating a window. diff --git a/.changes/cli-info.md b/.changes/cli-info.md new file mode 100644 index 000000000..e35cd9007 --- /dev/null +++ b/.changes/cli-info.md @@ -0,0 +1,6 @@ +--- +"cli.rs": "patch" +--- + +Fix `tauri info` panicking when parsing crates version on a newly created project without a `Cargo.lock` file. + diff --git a/.changes/content-protection-api.md b/.changes/content-protection-api.md new file mode 100644 index 000000000..b82d184b1 --- /dev/null +++ b/.changes/content-protection-api.md @@ -0,0 +1,5 @@ +--- +"api": "minor" +--- + +Added the `WindowOptions::contentProtected` option and `WebviewWindow#setContentProtected` to change it at runtime. diff --git a/.changes/content-protection-utils.md b/.changes/content-protection-utils.md new file mode 100644 index 000000000..591a40081 --- /dev/null +++ b/.changes/content-protection-utils.md @@ -0,0 +1,5 @@ +--- +"tauri-utils": "patch" +--- + +Added the `content_protected` option to the window configuration. diff --git a/.changes/content-protection.md b/.changes/content-protection.md new file mode 100644 index 000000000..489104058 --- /dev/null +++ b/.changes/content-protection.md @@ -0,0 +1,7 @@ +--- +"tauri": "minor" +"tauri-runtime": "minor" +"tauri-runtime-wry": "minor" +--- + +Added the `content_protected` option when creating a window and `Window::set_content_protected` to change it at runtime. diff --git a/.changes/core-navigation-handler.md b/.changes/core-navigation-handler.md new file mode 100644 index 000000000..ac48a4a14 --- /dev/null +++ b/.changes/core-navigation-handler.md @@ -0,0 +1,5 @@ +--- +"tauri": minor +--- + +Added `Window::on_navigation`. diff --git a/.changes/core-sync-windows-metadata.md b/.changes/core-sync-windows-metadata.md new file mode 100644 index 000000000..3c735ecc5 --- /dev/null +++ b/.changes/core-sync-windows-metadata.md @@ -0,0 +1,5 @@ +--- +"tauri": "patch" +--- + +Sync `__TAURI_METADATA__.__windows` across all windows. diff --git a/.changes/custom-buttons-api.md b/.changes/custom-buttons-api.md new file mode 100644 index 000000000..15c9058ac --- /dev/null +++ b/.changes/custom-buttons-api.md @@ -0,0 +1,5 @@ +--- +"api": minor +--- + +Allow setting the text of the dialog buttons. diff --git a/.changes/custom-buttons.md b/.changes/custom-buttons.md new file mode 100644 index 000000000..81b4dfd3e --- /dev/null +++ b/.changes/custom-buttons.md @@ -0,0 +1,5 @@ +--- +"tauri": minor +--- + +Added `OkWithLabel` and `OkCancelWithLabels` variants to the `api::dialog::MessageDialogButtons` enum to set the text of the dialog buttons. diff --git a/.changes/custom-icon.md b/.changes/custom-icon.md new file mode 100644 index 000000000..b41a58565 --- /dev/null +++ b/.changes/custom-icon.md @@ -0,0 +1,6 @@ +--- +"cli.rs": minor +"cli.js": minor +--- + +Add `--png` option for the `icon` command to generate custom icon sizes. diff --git a/.changes/expose-set_device_event_filter-in-tauri-api.md b/.changes/expose-set_device_event_filter-in-tauri-api.md new file mode 100644 index 000000000..cf1993c02 --- /dev/null +++ b/.changes/expose-set_device_event_filter-in-tauri-api.md @@ -0,0 +1,7 @@ +--- +"tauri-runtime-wry": minor +"tauri-runtime": minor +"tauri": minor +--- + +Added `Builder::device_event_filter` and `App::set_device_event_filter` methods. diff --git a/.changes/fix-2549.md b/.changes/fix-2549.md new file mode 100644 index 000000000..35b782a94 --- /dev/null +++ b/.changes/fix-2549.md @@ -0,0 +1,5 @@ +--- +"tauri": "patch" +--- + +Fix resize glitch when double clicking a custom titlebar in the top resize area. diff --git a/.changes/glob-match-require_literal_separator.md b/.changes/glob-match-require_literal_separator.md new file mode 100644 index 000000000..482a81028 --- /dev/null +++ b/.changes/glob-match-require_literal_separator.md @@ -0,0 +1,5 @@ +--- +"tauri": "patch" +--- + +Fix the filesystem scope allowing sub-directories of the directory picked by the dialog when `recursive` option was `false`. diff --git a/.changes/heck-unicode.md b/.changes/heck-unicode.md new file mode 100644 index 000000000..f0a0e4a26 --- /dev/null +++ b/.changes/heck-unicode.md @@ -0,0 +1,5 @@ +--- +"cli.rs": "patch" +--- + +Fix building apps with unicode characters in their `productName`. diff --git a/.changes/is-minimized.md b/.changes/is-minimized.md new file mode 100644 index 000000000..106e0906d --- /dev/null +++ b/.changes/is-minimized.md @@ -0,0 +1,8 @@ +--- +"tauri": minor +"tauri-runtime": minor +"tauri-runtime-wry": minor +"api": minor +--- + +Add `is_minimized()` window method. diff --git a/.changes/nsis.md b/.changes/nsis.md new file mode 100644 index 000000000..2a196dd74 --- /dev/null +++ b/.changes/nsis.md @@ -0,0 +1,8 @@ +--- +"tauri-bundler": minor +"tauri-utils": minor +"cli.rs": minor +"cli.js": minor +--- + +Add `nsis` bundle target diff --git a/.changes/open-links-mail-tel.md b/.changes/open-links-mail-tel.md new file mode 100644 index 000000000..1a925aa6a --- /dev/null +++ b/.changes/open-links-mail-tel.md @@ -0,0 +1,5 @@ +--- +"tauri": minor +--- + +Added support to `mailto:` and `tel:` links on the shell API. diff --git a/.changes/runtime-navigation-handler.md b/.changes/runtime-navigation-handler.md new file mode 100644 index 000000000..640eb406d --- /dev/null +++ b/.changes/runtime-navigation-handler.md @@ -0,0 +1,5 @@ +--- +"tauri-runtime": minor +--- + +Added `navigation_handler` field on `PendingWindow`. diff --git a/.changes/tauri-build-windows-manifest.md b/.changes/tauri-build-windows-manifest.md new file mode 100644 index 000000000..29605ee56 --- /dev/null +++ b/.changes/tauri-build-windows-manifest.md @@ -0,0 +1,5 @@ +--- +"tauri-build": "minor" +--- + +Add `WindowsAttributes::app_manifest` to specify the application manifest on Windows. diff --git a/.changes/title-getter.md b/.changes/title-getter.md new file mode 100644 index 000000000..d24da5817 --- /dev/null +++ b/.changes/title-getter.md @@ -0,0 +1,8 @@ +--- +"tauri": "minor" +"api": "minor" +"tauri-runtime": "minor" +"tauri-runtime-wry": "minor" +--- + +Add `title` getter on window. diff --git a/.changes/tray-tooltip-runtime.md b/.changes/tray-tooltip-runtime.md new file mode 100644 index 000000000..1c7a07a51 --- /dev/null +++ b/.changes/tray-tooltip-runtime.md @@ -0,0 +1,6 @@ +--- +"tauri-runtime": minor +"tauri-runtime-wry": minor +--- + +Added `TrayHandle::set_tooltip` and `SystemTray::with_tooltip`. diff --git a/.changes/tray-tooltip.md b/.changes/tray-tooltip.md new file mode 100644 index 000000000..f088c7aac --- /dev/null +++ b/.changes/tray-tooltip.md @@ -0,0 +1,5 @@ +--- +"tauri": patch +--- + +Implement `SystemTray::with_tooltip` and `SystemTrayHandle::set_tooltip` for Windows and macOS. diff --git a/.changes/url-getter.md b/.changes/url-getter.md new file mode 100644 index 000000000..b40863fef --- /dev/null +++ b/.changes/url-getter.md @@ -0,0 +1,7 @@ +--- +"tauri-runtime": minor +"tauri-runtime-wry": minor +"tauri": minor +--- + +Added window's `url()` getter. diff --git a/.changes/version-inheritance.md b/.changes/version-inheritance.md new file mode 100644 index 000000000..c809885c5 --- /dev/null +++ b/.changes/version-inheritance.md @@ -0,0 +1,5 @@ +--- +'cli.rs': 'minor' +--- + +Add support for Cargo's workspace inheritance for the package version. diff --git a/.changes/webview-theme.md b/.changes/webview-theme.md new file mode 100644 index 000000000..38e58bca9 --- /dev/null +++ b/.changes/webview-theme.md @@ -0,0 +1,7 @@ +--- +"tauri": "patch" +"tauri-runtime": "patch" +"tauri-runtime-wry": "patch" +--- + +On Windows, change webview theme based on Window theme for more accurate `prefers-color-scheme` support. diff --git a/.changes/wix-launch-app-checked.md b/.changes/wix-launch-app-checked.md new file mode 100644 index 000000000..073e4c3ec --- /dev/null +++ b/.changes/wix-launch-app-checked.md @@ -0,0 +1,6 @@ +--- +"tauri-bundler": "patch" +--- + +On Windows, the `msi` installer's `Launch App` checkbox will be checked by default. + diff --git a/.changes/wry-navigation-handler.md b/.changes/wry-navigation-handler.md new file mode 100644 index 000000000..6ac20e528 --- /dev/null +++ b/.changes/wry-navigation-handler.md @@ -0,0 +1,5 @@ +--- +"tauri-runtime-wry": minor +--- + +Implement the webview navigation handler. diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index c8315cf6a..5bc187ef1 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -10,6 +10,7 @@ on: env: RUST_BACKTRACE: 1 CARGO_PROFILE_DEV_DEBUG: 0 # This would add unnecessary bloat to the target folder, decreasing cache efficiency. + LC_ALL: en_US.UTF-8 # This prevents strace from changing it's number format to use commas. concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/check-generated-files.yml b/.github/workflows/check-generated-files.yml index 9f7e49ef1..156f19f52 100644 --- a/.github/workflows/check-generated-files.yml +++ b/.github/workflows/check-generated-files.yml @@ -5,6 +5,14 @@ name: Check generated files on: + pull_request: + paths: + - '.github/workflows/check-generated-files.yml' + - 'tooling/api/src/**' + - 'core/tauri/scripts/bundle.global.js' + - 'core/tauri-utils/src/config.rs' + - 'tooling/cli/schema.json' + - 'core/config-schema/schema.json' push: paths: - '.github/workflows/check-generated-files.yml' diff --git a/.github/workflows/covector-version-or-publish.yml b/.github/workflows/covector-version-or-publish.yml index 98556c0e0..054493427 100644 --- a/.github/workflows/covector-version-or-publish.yml +++ b/.github/workflows/covector-version-or-publish.yml @@ -124,7 +124,7 @@ jobs: token: ${{ secrets.ORG_TAURI_BOT_PAT }} repository: tauri-apps/tauri event-type: publish-clijs - inputs: '{"releaseId": "${{ steps.covector.outputs.cli.js-releaseId }}" }' + client-payload: '{"releaseId": "${{ steps.covector.outputs.cli.js-releaseId }}" }' - name: Trigger cli.rs publishing workflow if: | diff --git a/.github/workflows/publish-cli-js.yml b/.github/workflows/publish-cli-js.yml index 0a8662486..481e0af70 100644 --- a/.github/workflows/publish-cli-js.yml +++ b/.github/workflows/publish-cli-js.yml @@ -397,4 +397,4 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.ORG_NPM_TOKEN }} - RELEASE_ID: ${{ github.event.inputs.releaseId }} + RELEASE_ID: ${{ github.event.client_payload.releaseId || github.event.inputs.releaseId }} diff --git a/.scripts/update-lockfiles.sh b/.scripts/update-lockfiles.sh index 666c3a5e1..67490bfc4 100755 --- a/.scripts/update-lockfiles.sh +++ b/.scripts/update-lockfiles.sh @@ -3,7 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: MIT -declare -a examples=("api" "sidecar" "updater" "resources" "tauri-dynamic-lib") +declare -a examples=("api" "sidecar" "updater" "resources" "tauri-dynamic-lib" "workspace") declare -a tooling=("bench" "cli" "webdriver") for example in "${examples[@]}" diff --git a/Cargo.toml b/Cargo.toml index 68a0dd214..cd6783a04 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,8 @@ exclude = [ "examples/updater/src-tauri", "examples/resources/src-tauri", "examples/sidecar/src-tauri", - "examples/web/core" + "examples/web/core", + "examples/workspace" ] # default to small, optimized workspace release binaries diff --git a/SECURITY.md b/SECURITY.md index cbd06ded3..0b30bfd89 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -13,7 +13,16 @@ If you have found a potential security threat, vulnerability or exploit in Tauri or one of its upstream dependencies, please DON’T create a pull-request, DON’T file an issue on GitHub, DON’T mention it on Discord and DON’T create a forum thread. -We will be adding contact information to this page very soon. +Please submit your report via the GitHub Private Vulnerability Disclosure functionality. + +Find out more about the reporting process [here](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability). + +Our team will triage your report and keep you informed about the progress. +We may ask questions or request further guidance on reproduction of the vulnerability in the comments of the advisory, which will be publicized. + +Additionally, we may ask you to independently verify our patch, which will be available in the private advisory branch. Please do not publish your vulnerability during the process or before coordinated public disclosure from our side. We try to adhere to common standards of publication within 90-Days of disclosure. + +Depending on your decision to accept or deny credit for the vulnerability, you will be publicly attributed to the vulnerability and may be mentioned in our announcements. At the current time we do not have the financial ability to reward bounties, but in extreme cases will at our discretion consider a reward. diff --git a/core/config-schema/build.rs b/core/config-schema/build.rs index 12f04ae9b..31fc2aba9 100644 --- a/core/config-schema/build.rs +++ b/core/config-schema/build.rs @@ -18,7 +18,7 @@ pub fn main() -> Result<(), Box> { crate_dir.join("../../tooling/cli/schema.json"), ] { let mut schema_file = BufWriter::new(File::create(file)?); - write!(schema_file, "{}", schema_str)?; + write!(schema_file, "{schema_str}")?; } Ok(()) diff --git a/core/config-schema/schema.json b/core/config-schema/schema.json index 494e09df9..322ebf325 100644 --- a/core/config-schema/schema.json +++ b/core/config-schema/schema.json @@ -105,6 +105,7 @@ "print": false, "requestUserAttention": false, "setAlwaysOnTop": false, + "setContentProtected": false, "setCursorGrab": false, "setCursorIcon": false, "setCursorPosition": false, @@ -145,6 +146,7 @@ "allowDowngrades": true, "certificateThumbprint": null, "digestAlgorithm": null, + "nsis": null, "timestampUrl": null, "tsp": false, "webviewFixedRuntimePath": null, @@ -168,7 +170,8 @@ "dialog": true, "pubkey": "", "windows": { - "installMode": "passive" + "installMode": "passive", + "installerArgs": [] } }, "windows": [] @@ -281,6 +284,7 @@ "allowDowngrades": true, "certificateThumbprint": null, "digestAlgorithm": null, + "nsis": null, "timestampUrl": null, "tsp": false, "webviewFixedRuntimePath": null, @@ -378,6 +382,7 @@ "print": false, "requestUserAttention": false, "setAlwaysOnTop": false, + "setContentProtected": false, "setCursorGrab": false, "setCursorIcon": false, "setCursorPosition": false, @@ -425,7 +430,8 @@ "dialog": true, "pubkey": "", "windows": { - "installMode": "passive" + "installMode": "passive", + "installerArgs": [] } }, "allOf": [ @@ -641,6 +647,11 @@ "default": false, "type": "boolean" }, + "contentProtected": { + "description": "Prevents the window contents from being captured by other apps.", + "default": false, + "type": "boolean" + }, "skipTaskbar": { "description": "If `true`, hides the window icon from the taskbar on Windows and Linux.", "default": false, @@ -682,6 +693,13 @@ "string", "null" ] + }, + "additionalBrowserArgs": { + "description": "Defines additional browser arguments on Windows. By default wry passes `--disable-features=msWebOOUI,msPdfOOUI,msSmartScreenProtection` so if you use this method, you also need to disable these components by yourself if you want.", + "type": [ + "string", + "null" + ] } }, "additionalProperties": false @@ -1004,7 +1022,7 @@ "type": "boolean" }, "targets": { - "description": "The bundle targets, currently supports [\"deb\", \"appimage\", \"msi\", \"app\", \"dmg\", \"updater\"] or \"all\".", + "description": "The bundle targets, currently supports [\"deb\", \"appimage\", \"nsis\", \"msi\", \"app\", \"dmg\", \"updater\"] or \"all\".", "default": "all", "allOf": [ { @@ -1118,6 +1136,7 @@ "allowDowngrades": true, "certificateThumbprint": null, "digestAlgorithm": null, + "nsis": null, "timestampUrl": null, "tsp": false, "webviewFixedRuntimePath": null, @@ -1186,6 +1205,13 @@ "msi" ] }, + { + "description": "The NSIS bundle (.exe).", + "type": "string", + "enum": [ + "nsis" + ] + }, { "description": "The macOS application bundle (.app).", "type": "string", @@ -1370,6 +1396,17 @@ "type": "null" } ] + }, + "nsis": { + "description": "Configuration for the installer generated with NSIS.", + "anyOf": [ + { + "$ref": "#/definitions/NsisConfig" + }, + { + "type": "null" + } + ] } }, "additionalProperties": false @@ -1618,8 +1655,78 @@ }, "additionalProperties": false }, + "NsisConfig": { + "description": "Configuration for the Installer bundle using NSIS.", + "type": "object", + "properties": { + "license": { + "description": "The path to the license file to render on the installer.", + "type": [ + "string", + "null" + ] + }, + "headerImage": { + "description": "The path to a bitmap file to display on the header of installers pages.\n\nThe recommended dimensions are 150px x 57px.", + "type": [ + "string", + "null" + ] + }, + "sidebarImage": { + "description": "The path to a bitmap file for the Welcome page and the Finish page.\n\nThe recommended dimensions are 164px x 314px.", + "type": [ + "string", + "null" + ] + }, + "installerIcon": { + "description": "The path to an icon file used as the installer icon.", + "type": [ + "string", + "null" + ] + }, + "installMode": { + "description": "Whether the installation will be for all users or just the current user.", + "default": "currentUser", + "allOf": [ + { + "$ref": "#/definitions/NSISInstallerMode" + } + ] + } + }, + "additionalProperties": false + }, + "NSISInstallerMode": { + "description": "Install Modes for the NSIS installer.", + "oneOf": [ + { + "description": "Default mode for the installer.\n\nInstall the app by default in a directory that doesn't require Administrator access.\n\nInstaller metadata will be saved under the `HKCU` registry path.", + "type": "string", + "enum": [ + "currentUser" + ] + }, + { + "description": "Install the app by default in the `Program Files` folder directory requires Administrator access for the installation.\n\nInstaller metadata will be saved under the `HKLM` registry path.", + "type": "string", + "enum": [ + "perMachine" + ] + }, + { + "description": "Combines both modes and allows the user to choose at install time whether to install for the current user or per machine. Note that this mode will require Administrator access even if the user wants to install it for the current user only.\n\nInstaller metadata will be saved under the `HKLM` or `HKCU` registry path based on the user's choice.", + "type": "string", + "enum": [ + "both" + ] + } + ] + }, "AllowlistConfig": { - "description": "Allowlist configuration.", + "description": "Allowlist configuration. The allowlist is a translation of the [Cargo allowlist features](https://docs.rs/tauri/latest/tauri/#cargo-allowlist-features).\n\n# Notes\n\n- Endpoints that don't have their own allowlist option are enabled by default. - There is only \"opt-in\", no \"opt-out\". Setting an option to `false` has no effect.\n\n# Examples\n\n- * [`\"app-all\": true`](https://tauri.app/v1/api/config/#appallowlistconfig.all) will make the [hide](https://tauri.app/v1/api/js/app#hide) endpoint be available regardless of whether `hide` is set to `false` or `true` in the allowlist.", "type": "object", "properties": { "all": { @@ -1661,6 +1768,7 @@ "print": false, "requestUserAttention": false, "setAlwaysOnTop": false, + "setContentProtected": false, "setCursorGrab": false, "setCursorIcon": false, "setCursorPosition": false, @@ -2011,6 +2119,11 @@ "default": false, "type": "boolean" }, + "setContentProtected": { + "description": "Allows preventing the window contents from being captured by other apps.", + "default": false, + "type": "boolean" + }, "setSize": { "description": "Allows setting the window size.", "default": false, @@ -2211,7 +2324,7 @@ "description": "Defines the `shell > open` api scope.", "anyOf": [ { - "description": "If the shell open API should be enabled.\n\nIf enabled, the default validation regex (`^https?://`) is used.", + "description": "If the shell open API should be enabled.\n\nIf enabled, the default validation regex (`^((mailto:\\w+)|(tel:\\w+)|(https?://\\w+)).+`) is used.", "type": "boolean" }, { @@ -2559,7 +2672,8 @@ "windows": { "description": "The Windows configuration for the updater.", "default": { - "installMode": "passive" + "installMode": "passive", + "installerArgs": [] }, "allOf": [ { @@ -2579,6 +2693,14 @@ "description": "The updater configuration for Windows.", "type": "object", "properties": { + "installerArgs": { + "description": "Additional arguments given to the NSIS or WiX installer.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, "installMode": { "description": "The installation mode for the update on Windows. Defaults to `passive`.", "default": "passive", @@ -2602,7 +2724,7 @@ ] }, { - "description": "The quiet mode means there's no user interaction required. Requires admin privileges if the installer does.", + "description": "The quiet mode means there's no user interaction required. Requires admin privileges if the installer does (WiX).", "type": "string", "enum": [ "quiet" diff --git a/core/tauri-build/Cargo.toml b/core/tauri-build/Cargo.toml index 05387dab6..a96287726 100644 --- a/core/tauri-build/Cargo.toml +++ b/core/tauri-build/Cargo.toml @@ -21,10 +21,10 @@ anyhow = "1" quote = { version = "1", optional = true } tauri-codegen = { version = "1.2.1", path = "../tauri-codegen", optional = true } tauri-utils = { version = "1.2.1", path = "../tauri-utils", features = [ "build", "resources" ] } -cargo_toml = "0.13" +cargo_toml = "0.14" serde_json = "1" heck = "0.4" -json-patch = "0.2" +json-patch = "0.3" [target."cfg(windows)".dependencies] winres = "0.1" diff --git a/core/tauri-build/src/codegen/context.rs b/core/tauri-build/src/codegen/context.rs index 2d681229d..a21591fe3 100644 --- a/core/tauri-build/src/codegen/context.rs +++ b/core/tauri-build/src/codegen/context.rs @@ -86,7 +86,7 @@ impl CodegenContext { pub fn build(self) -> PathBuf { match self.try_build() { Ok(out) => out, - Err(error) => panic!("Error found during Codegen::build: {}", error), + Err(error) => panic!("Error found during Codegen::build: {error}"), } } @@ -161,7 +161,7 @@ impl CodegenContext { ) })?; - writeln!(file, "{}", code).with_context(|| { + writeln!(file, "{code}").with_context(|| { format!( "Unable to write tokenstream to out file during tauri-build {}", out.display() diff --git a/core/tauri-build/src/lib.rs b/core/tauri-build/src/lib.rs index 21536d882..1c4e701fe 100644 --- a/core/tauri-build/src/lib.rs +++ b/core/tauri-build/src/lib.rs @@ -35,8 +35,8 @@ fn copy_file(from: impl AsRef, to: impl AsRef) -> Result<()> { Ok(()) } -fn copy_binaries<'a>( - binaries: ResourcePaths<'a>, +fn copy_binaries( + binaries: ResourcePaths, target_triple: &str, path: &Path, package_name: Option<&String>, @@ -48,7 +48,7 @@ fn copy_binaries<'a>( .file_name() .expect("failed to extract external binary filename") .to_string_lossy() - .replace(&format!("-{}", target_triple), ""); + .replace(&format!("-{target_triple}"), ""); if package_name.map_or(false, |n| n == &file_name) { return Err(anyhow::anyhow!( @@ -90,7 +90,7 @@ fn has_feature(feature: &str) -> bool { // `alias` must be a snake case string. fn cfg_alias(alias: &str, has_feature: bool) { if has_feature { - println!("cargo:rustc-cfg={}", alias); + println!("cargo:rustc-cfg={alias}"); } } @@ -110,6 +110,15 @@ pub struct WindowsAttributes { /// /// If it is left unset, it will look up a path in the registry, i.e. HKLM\SOFTWARE\Microsoft\Windows Kits\Installed Roots sdk_dir: Option, + /// A string containing an [application manifest] to be included with the application on Windows. + /// + /// Defaults to: + /// ```ignore + #[doc = include_str!("window-app-manifest.xml")] + /// ``` + /// + /// [application manifest]: https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests + app_manifest: Option, } impl WindowsAttributes { @@ -135,6 +144,45 @@ impl WindowsAttributes { self.sdk_dir = Some(sdk_dir.as_ref().into()); self } + + /// Sets the Windows app [manifest]. + /// + /// # Example + /// + /// The following manifest will brand the exe as requesting administrator privileges. + /// Thus, everytime it is executed, a Windows UAC dialog will appear. + /// + /// Note that you can move the manifest contents to a separate file and use `include_str!("manifest.xml")` + /// instead of the inline string. + /// + /// ```rust,no_run + /// let mut windows = tauri_build::WindowsAttributes::new(); + /// windows = windows.app_manifest(r#" + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// "#); + /// tauri_build::try_build( + /// tauri_build::Attributes::new().windows_attributes(windows) + /// ).expect("failed to run build script"); + /// ``` + /// + /// Defaults to: + /// ```ignore + #[doc = include_str!("window-app-manifest.xml")] + /// [manifest]: https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests + /// ``` + #[must_use] + pub fn app_manifest>(mut self, manifest: S) -> Self { + self.app_manifest = Some(manifest.as_ref().to_string()); + self + } } /// The attributes used on the build. @@ -179,8 +227,8 @@ impl Attributes { /// This is typically desirable when running inside a build script; see [`try_build`] for no panics. pub fn build() { if let Err(error) = try_build(Attributes::default()) { - let error = format!("{:#}", error); - println!("{}", error); + let error = format!("{error:#}"); + println!("{error}"); if error.starts_with("unknown field") { print!("found an unknown configuration field. This usually means that you are using a CLI version that is newer than `tauri-build` and is incompatible. "); println!( @@ -336,24 +384,11 @@ pub fn try_build(attributes: Attributes) -> Result<()> { if window_icon_path.exists() { let mut res = WindowsResource::new(); - res.set_manifest( - r#" - - - - - - - - "#, - ); + if let Some(manifest) = attributes.windows_attributes.app_manifest { + res.set_manifest(&manifest); + } else { + res.set_manifest(include_str!("window-app-manifest.xml")); + } if let Some(sdk_dir) = &attributes.windows_attributes.sdk_dir { if let Some(sdk_dir_str) = sdk_dir.to_str() { diff --git a/core/tauri-build/src/window-app-manifest.xml b/core/tauri-build/src/window-app-manifest.xml new file mode 100644 index 000000000..2d510ed31 --- /dev/null +++ b/core/tauri-build/src/window-app-manifest.xml @@ -0,0 +1,14 @@ + + + + + + + diff --git a/core/tauri-codegen/Cargo.toml b/core/tauri-codegen/Cargo.toml index 38716d66a..ee2ea125c 100644 --- a/core/tauri-codegen/Cargo.toml +++ b/core/tauri-codegen/Cargo.toml @@ -14,7 +14,7 @@ readme = "README.md" [dependencies] sha2 = "0.10" -base64 = "0.13" +base64 = "0.20" proc-macro2 = "1" quote = "1" serde = { version = "1", features = [ "derive" ] } @@ -26,9 +26,9 @@ brotli = { version = "3", optional = true, default-features = false, features = regex = { version = "1.7.0", optional = true } uuid = { version = "1", features = [ "v4" ] } semver = "1" -ico = "0.2" +ico = "0.3" png = "0.17" -json-patch = "0.2" +json-patch = "0.3" [target."cfg(target_os = \"macos\")".dependencies] plist = "1" diff --git a/core/tauri-codegen/src/context.rs b/core/tauri-codegen/src/context.rs index 6f5dd3949..f01b8e089 100644 --- a/core/tauri-codegen/src/context.rs +++ b/core/tauri-codegen/src/context.rs @@ -141,7 +141,7 @@ pub fn context_codegen(data: ContextData) -> Result Result { let dir = config_parent.join(dir); if !dir.exists() { - panic!( - "The isolation application path is set to `{:?}` but it does not exist", - dir - ) + panic!("The isolation application path is set to `{dir:?}` but it does not exist") } let mut sets_isolation_hook = false; @@ -414,7 +411,7 @@ pub fn context_codegen(data: ContextData) -> Result quote!(::std::option::Option::None), ShellAllowlistOpen::Flag(true) => { - quote!(::std::option::Option::Some(#root::regex::Regex::new("^https?://").unwrap())) + quote!(::std::option::Option::Some(#root::regex::Regex::new(r#"^((mailto:\w+)|(tel:\w+)|(https?://\w+)).+"#).unwrap())) } ShellAllowlistOpen::Validate(regex) => match Regex::new(regex) { Ok(_) => quote!(::std::option::Option::Some(#root::regex::Regex::new(#regex).unwrap())), diff --git a/core/tauri-codegen/src/embedded_assets.rs b/core/tauri-codegen/src/embedded_assets.rs index 546c58387..b897500e2 100644 --- a/core/tauri-codegen/src/embedded_assets.rs +++ b/core/tauri-codegen/src/embedded_assets.rs @@ -343,14 +343,14 @@ impl EmbeddedAssets { let mut hex = String::with_capacity(2 * bytes.len()); for b in bytes { - write!(hex, "{:02x}", b).map_err(EmbeddedAssetsError::Hex)?; + write!(hex, "{b:02x}").map_err(EmbeddedAssetsError::Hex)?; } hex }; // use the content hash to determine filename, keep extensions that exist let out_path = if let Some(ext) = path.extension().and_then(|e| e.to_str()) { - out_dir.join(format!("{}.{}", hash, ext)) + out_dir.join(format!("{hash}.{ext}")) } else { out_dir.join(hash) }; diff --git a/core/tauri-runtime-wry/Cargo.toml b/core/tauri-runtime-wry/Cargo.toml index 54c480e57..5eda930d3 100644 --- a/core/tauri-runtime-wry/Cargo.toml +++ b/core/tauri-runtime-wry/Cargo.toml @@ -13,7 +13,7 @@ exclude = [ "CHANGELOG.md", "/target" ] readme = "README.md" [dependencies] -wry = { version = "0.23", default-features = false, features = [ "file-drop", "protocol" ] } +wry = { git = "https://github.com/tauri-apps/wry", default-features = false, features = [ "file-drop", "protocol" ] } tauri-runtime = { version = "0.12.1", path = "../tauri-runtime" } tauri-utils = { version = "1.2.1", path = "../tauri-utils" } uuid = { version = "1", features = [ "v4" ] } diff --git a/core/tauri-runtime-wry/build.rs b/core/tauri-runtime-wry/build.rs index f8d92f3f7..c0ac84b7f 100644 --- a/core/tauri-runtime-wry/build.rs +++ b/core/tauri-runtime-wry/build.rs @@ -6,7 +6,7 @@ // `alias` must be a snake case string. fn alias(alias: &str, has_feature: bool) { if has_feature { - println!("cargo:rustc-cfg={}", alias); + println!("cargo:rustc-cfg={alias}"); } } diff --git a/core/tauri-runtime-wry/src/lib.rs b/core/tauri-runtime-wry/src/lib.rs index 81aa7008d..4d25557f1 100644 --- a/core/tauri-runtime-wry/src/lib.rs +++ b/core/tauri-runtime-wry/src/lib.rs @@ -14,8 +14,8 @@ use tauri_runtime::{ dpi::{LogicalPosition, LogicalSize, PhysicalPosition, PhysicalSize, Position, Size}, CursorIcon, DetachedWindow, FileDropEvent, JsEventListenerKey, PendingWindow, WindowEvent, }, - Dispatch, Error, EventLoopProxy, ExitRequestedEventAction, Icon, Result, RunEvent, RunIteration, - Runtime, RuntimeHandle, UserAttentionType, UserEvent, + DeviceEventFilter, Dispatch, Error, EventLoopProxy, ExitRequestedEventAction, Icon, Result, + RunEvent, RunIteration, Runtime, RuntimeHandle, UserAttentionType, UserEvent, }; use tauri_runtime::window::MenuEvent; @@ -33,6 +33,8 @@ use wry::application::platform::macos::WindowBuilderExtMacOS; use wry::application::platform::unix::{WindowBuilderExtUnix, WindowExtUnix}; #[cfg(windows)] use wry::application::platform::windows::{WindowBuilderExtWindows, WindowExtWindows}; +#[cfg(windows)] +use wry::webview::WebViewBuilderExtWindows; #[cfg(target_os = "macos")] use tauri_utils::TitleBarStyle; @@ -47,7 +49,8 @@ use wry::{ }, event::{Event, StartCause, WindowEvent as WryWindowEvent}, event_loop::{ - ControlFlow, EventLoop, EventLoopProxy as WryEventLoopProxy, EventLoopWindowTarget, + ControlFlow, DeviceEventFilter as WryDeviceEventFilter, EventLoop, + EventLoopProxy as WryEventLoopProxy, EventLoopWindowTarget, }, menu::{ AboutMetadata as WryAboutMetadata, CustomMenuItem as WryCustomMenuItem, MenuBar, @@ -61,10 +64,9 @@ use wry::{ }, }, http::{Request as WryRequest, Response as WryResponse}, - webview::{FileDropEvent as WryFileDropEvent, WebContext, WebView, WebViewBuilder}, + webview::{FileDropEvent as WryFileDropEvent, Url, WebContext, WebView, WebViewBuilder}, }; -pub use wry; pub use wry::application::window::{Window, WindowBuilder as WryWindowBuilder, WindowId}; #[cfg(windows)] @@ -79,6 +81,7 @@ pub use wry::application::platform::macos::{ }; use std::{ + borrow::Cow, cell::RefCell, collections::{ hash_map::Entry::{Occupied, Vacant}, @@ -284,7 +287,7 @@ impl From<&WryRequest>> for HttpRequestWrapper { } // response -struct HttpResponseWrapper(WryResponse>); +struct HttpResponseWrapper(WryResponse>); impl From for HttpResponseWrapper { fn from(response: HttpResponse) -> Self { let (parts, body) = response.into_parts(); @@ -298,7 +301,7 @@ impl From for HttpResponseWrapper { res_builder = res_builder.header(name, val); } - let res = res_builder.body(body).unwrap(); + let res = res_builder.body(Cow::Owned(body)).unwrap(); Self(res) } } @@ -364,6 +367,18 @@ impl From for MenuItemWrapper { } } +pub struct DeviceEventFilterWrapper(pub WryDeviceEventFilter); + +impl From for DeviceEventFilterWrapper { + fn from(item: DeviceEventFilter) -> Self { + match item { + DeviceEventFilter::Always => Self(WryDeviceEventFilter::Always), + DeviceEventFilter::Never => Self(WryDeviceEventFilter::Never), + DeviceEventFilter::Unfocused => Self(WryDeviceEventFilter::Unfocused), + } + } +} + #[cfg(target_os = "macos")] pub struct NativeImageWrapper(pub WryNativeImage); @@ -705,6 +720,7 @@ impl WindowBuilder for WindowBuilderWrapper { .decorations(config.decorations) .maximized(config.maximized) .always_on_top(config.always_on_top) + .content_protected(config.content_protected) .skip_taskbar(config.skip_taskbar) .theme(config.theme); @@ -839,6 +855,11 @@ impl WindowBuilder for WindowBuilderWrapper { self } + fn content_protected(mut self, protected: bool) -> Self { + self.inner = self.inner.with_content_protection(protected); + self + } + #[cfg(windows)] fn parent_window(mut self, parent: HWND) -> Self { self.inner = self.inner.with_parent_window(parent); @@ -1017,16 +1038,19 @@ pub enum WindowMessage { #[cfg(any(debug_assertions, feature = "devtools"))] IsDevToolsOpen(Sender), // Getters + Url(Sender), ScaleFactor(Sender), InnerPosition(Sender>>), OuterPosition(Sender>>), InnerSize(Sender>), OuterSize(Sender>), IsFullscreen(Sender), + IsMinimized(Sender), IsMaximized(Sender), IsDecorated(Sender), IsResizable(Sender), IsVisible(Sender), + Title(Sender), IsMenuVisible(Sender), CurrentMonitor(Sender>), PrimaryMonitor(Sender>), @@ -1057,6 +1081,7 @@ pub enum WindowMessage { Close, SetDecorations(bool), SetAlwaysOnTop(bool), + SetContentProtected(bool), SetSize(Size), SetMinSize(Option), SetMaxSize(Option), @@ -1099,6 +1124,7 @@ pub enum TrayMessage { UpdateIconAsTemplate(bool), #[cfg(target_os = "macos")] UpdateTitle(String), + UpdateTooltip(String), Create(SystemTray, Sender>), Destroy(Sender>), } @@ -1215,6 +1241,10 @@ impl Dispatch for WryDispatcher { // Getters + fn url(&self) -> Result { + window_getter!(self, WindowMessage::Url) + } + fn scale_factor(&self) -> Result { window_getter!(self, WindowMessage::ScaleFactor) } @@ -1239,6 +1269,10 @@ impl Dispatch for WryDispatcher { window_getter!(self, WindowMessage::IsFullscreen) } + fn is_minimized(&self) -> Result { + window_getter!(self, WindowMessage::IsMinimized) + } + fn is_maximized(&self) -> Result { window_getter!(self, WindowMessage::IsMaximized) } @@ -1257,6 +1291,10 @@ impl Dispatch for WryDispatcher { window_getter!(self, WindowMessage::IsVisible) } + fn title(&self) -> Result { + window_getter!(self, WindowMessage::Title) + } + fn is_menu_visible(&self) -> Result { window_getter!(self, WindowMessage::IsMenuVisible) } @@ -1426,6 +1464,16 @@ impl Dispatch for WryDispatcher { ) } + fn set_content_protected(&self, protected: bool) -> Result<()> { + send_user_message( + &self.context, + Message::Window( + self.window_id, + WindowMessage::SetContentProtected(protected), + ), + ) + } + fn set_size(&self, size: Size) -> Result<()> { send_user_message( &self.context, @@ -2028,6 +2076,12 @@ impl Runtime for Wry { self.event_loop.hide_application(); } + fn set_device_event_filter(&mut self, filter: DeviceEventFilter) { + self + .event_loop + .set_device_event_filter(DeviceEventFilterWrapper::from(filter).0); + } + #[cfg(desktop)] fn run_iteration) + 'static>(&mut self, mut callback: F) -> RunIteration { use wry::application::platform::run_return::EventLoopExtRunReturn; @@ -2315,6 +2369,11 @@ fn handle_user_message( } } // Getters + WindowMessage::Url(tx) => { + if let WindowHandle::Webview { inner: w, .. } = &window { + tx.send(w.url()).unwrap(); + } + } WindowMessage::ScaleFactor(tx) => tx.send(window.scale_factor()).unwrap(), WindowMessage::InnerPosition(tx) => tx .send( @@ -2339,10 +2398,12 @@ fn handle_user_message( .send(PhysicalSizeWrapper(window.outer_size()).into()) .unwrap(), WindowMessage::IsFullscreen(tx) => tx.send(window.fullscreen().is_some()).unwrap(), + WindowMessage::IsMinimized(tx) => tx.send(window.is_minimized()).unwrap(), WindowMessage::IsMaximized(tx) => tx.send(window.is_maximized()).unwrap(), WindowMessage::IsDecorated(tx) => tx.send(window.is_decorated()).unwrap(), WindowMessage::IsResizable(tx) => tx.send(window.is_resizable()).unwrap(), WindowMessage::IsVisible(tx) => tx.send(window.is_visible()).unwrap(), + WindowMessage::Title(tx) => tx.send(window.title()).unwrap(), WindowMessage::IsMenuVisible(tx) => tx.send(window.is_menu_visible()).unwrap(), WindowMessage::CurrentMonitor(tx) => tx.send(window.current_monitor()).unwrap(), WindowMessage::PrimaryMonitor(tx) => tx.send(window.primary_monitor()).unwrap(), @@ -2387,6 +2448,9 @@ fn handle_user_message( } WindowMessage::SetDecorations(decorations) => window.set_decorations(decorations), WindowMessage::SetAlwaysOnTop(always_on_top) => window.set_always_on_top(always_on_top), + WindowMessage::SetContentProtected(protected) => { + window.set_content_protection(protected) + } WindowMessage::SetSize(size) => { window.set_inner_size(SizeWrapper::from(size).0); } @@ -2573,6 +2637,11 @@ fn handle_user_message( tray.set_title(&title); } } + TrayMessage::UpdateTooltip(tooltip) => { + if let Some(tray) = &mut *tray_context.tray.lock().unwrap() { + tray.set_tooltip(&tooltip); + } + } TrayMessage::Create(_tray, _tx) => { // already handled } @@ -2788,6 +2857,19 @@ fn handle_event_loop( } match event { + #[cfg(windows)] + WryWindowEvent::ThemeChanged(theme) => { + if let Some(window) = windows.borrow().get(&window_id) { + if let Some(WindowHandle::Webview { inner, .. }) = &window.inner { + let theme = match theme { + WryTheme::Dark => wry::webview::Theme::Dark, + WryTheme::Light => wry::webview::Theme::Light, + _ => wry::webview::Theme::Light, + }; + inner.set_theme(theme); + } + } + } WryWindowEvent::CloseRequested => { on_close_requested(callback, window_id, windows.clone()); } @@ -2962,6 +3044,9 @@ fn create_webview( .with_drag_and_drop(webview_attributes.file_drop_handler_enabled); } + #[cfg(windows)] + let window_theme = window_builder.inner.window.preferred_theme; + #[cfg(target_os = "macos")] { if window_builder.tabbing_identifier.is_none() @@ -2998,9 +3083,29 @@ fn create_webview( webview_builder = webview_builder .with_file_drop_handler(create_file_drop_handler(window_event_listeners.clone())); } + if let Some(navigation_handler) = pending.navigation_handler { + webview_builder = webview_builder.with_navigation_handler(move |url| { + Url::parse(&url).map(&navigation_handler).unwrap_or(true) + }); + } if let Some(user_agent) = webview_attributes.user_agent { webview_builder = webview_builder.with_user_agent(&user_agent); } + + #[cfg(windows)] + if let Some(additional_browser_args) = webview_attributes.additional_browser_args { + webview_builder = webview_builder.with_additional_browser_args(&additional_browser_args); + } + + #[cfg(windows)] + if let Some(theme) = window_theme { + webview_builder = webview_builder.with_theme(match theme { + WryTheme::Dark => wry::webview::Theme::Dark, + WryTheme::Light => wry::webview::Theme::Light, + _ => wry::webview::Theme::Light, + }); + } + if let Some(handler) = ipc_handler { webview_builder = webview_builder.with_ipc_handler(create_ipc_handler( context, diff --git a/core/tauri-runtime-wry/src/system_tray.rs b/core/tauri-runtime-wry/src/system_tray.rs index ee6db6c9e..6262460a3 100644 --- a/core/tauri-runtime-wry/src/system_tray.rs +++ b/core/tauri-runtime-wry/src/system_tray.rs @@ -114,6 +114,10 @@ pub fn create_tray( } } + if let Some(tooltip) = system_tray.tooltip { + builder = builder.with_tooltip(&tooltip); + } + let tray = builder .build(event_loop) .map_err(|e| Error::SystemTray(Box::new(e)))?; @@ -172,6 +176,16 @@ impl TrayHandle for SystemTrayHandle { .map_err(|_| Error::FailedToSendMessage) } + fn set_tooltip(&self, tooltip: &str) -> Result<()> { + self + .proxy + .send_event(Message::Tray( + self.id, + TrayMessage::UpdateTooltip(tooltip.to_owned()), + )) + .map_err(|_| Error::FailedToSendMessage) + } + fn destroy(&self) -> Result<()> { let (tx, rx) = std::sync::mpsc::channel(); send_user_message( diff --git a/core/tauri-runtime/Cargo.toml b/core/tauri-runtime/Cargo.toml index b8a090f90..7fdc1afb2 100644 --- a/core/tauri-runtime/Cargo.toml +++ b/core/tauri-runtime/Cargo.toml @@ -32,6 +32,7 @@ http = "0.2.4" http-range = "0.1.4" raw-window-handle = "0.5" rand = "0.8" +url = { version = "2" } [target."cfg(windows)".dependencies] webview2-com = "0.19.1" diff --git a/core/tauri-runtime/build.rs b/core/tauri-runtime/build.rs index f8d92f3f7..c0ac84b7f 100644 --- a/core/tauri-runtime/build.rs +++ b/core/tauri-runtime/build.rs @@ -6,7 +6,7 @@ // `alias` must be a snake case string. fn alias(alias: &str, has_feature: bool) { if has_feature { - println!("cargo:rustc-cfg={}", alias); + println!("cargo:rustc-cfg={alias}"); } } diff --git a/core/tauri-runtime/src/lib.rs b/core/tauri-runtime/src/lib.rs index 4dbde5901..fc8691206 100644 --- a/core/tauri-runtime/src/lib.rs +++ b/core/tauri-runtime/src/lib.rs @@ -10,6 +10,7 @@ use raw_window_handle::RawDisplayHandle; use serde::Deserialize; use std::{fmt::Debug, sync::mpsc::Sender}; use tauri_utils::Theme; +use url::Url; use uuid::Uuid; pub mod http; @@ -53,6 +54,7 @@ pub struct SystemTray { #[cfg(target_os = "macos")] pub title: Option, pub on_event: Option>, + pub tooltip: Option, } #[cfg(all(desktop, feature = "system-tray"))] @@ -86,6 +88,7 @@ impl Clone for SystemTray { menu_on_left_click: self.menu_on_left_click, #[cfg(target_os = "macos")] title: self.title.clone(), + tooltip: self.tooltip.clone(), } } } @@ -104,6 +107,7 @@ impl Default for SystemTray { #[cfg(target_os = "macos")] title: None, on_event: None, + tooltip: None, } } } @@ -156,6 +160,17 @@ impl SystemTray { self } + /// Sets the tray icon tooltip. + /// + /// ## Platform-specific: + /// + /// - **Linux:** Unsupported + #[must_use] + pub fn with_tooltip(mut self, tooltip: &str) -> Self { + self.tooltip = Some(tooltip.to_owned()); + self + } + /// Sets the menu to show when the system tray is right clicked. #[must_use] pub fn with_menu(mut self, menu: menu::SystemTrayMenu) -> Self { @@ -184,6 +199,23 @@ pub enum UserAttentionType { Informational, } +#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize)] +#[serde(tag = "type")] +pub enum DeviceEventFilter { + /// Always filter out device events. + Always, + /// Filter out device events while the window is not focused. + Unfocused, + /// Report all device events regardless of window focus. + Never, +} + +impl Default for DeviceEventFilter { + fn default() -> Self { + Self::Unfocused + } +} + #[derive(Debug, thiserror::Error)] #[non_exhaustive] pub enum Error { @@ -461,6 +493,19 @@ pub trait Runtime: Debug + Sized + 'static { #[cfg_attr(doc_cfg, doc(cfg(target_os = "macos")))] fn hide(&self); + /// Change the device event filter mode. + /// + /// Since the DeviceEvent capture can lead to high CPU usage for unfocused windows, [`tao`] + /// will ignore them by default for unfocused windows on Windows. This method allows changing + /// the filter to explicitly capture them again. + /// + /// ## Platform-specific + /// + /// - ** Linux / macOS / iOS / Android**: Unsupported. + /// + /// [`tao`]: https://crates.io/crates/tao + fn set_device_event_filter(&mut self, filter: DeviceEventFilter); + /// Runs the one step of the webview runtime event loop and returns control flow to the caller. #[cfg(desktop)] fn run_iteration) + 'static>(&mut self, callback: F) -> RunIteration; @@ -500,6 +545,9 @@ pub trait Dispatch: Debug + Clone + Send + Sync + Sized + 'static // GETTERS + /// Returns the webview's current URL. + fn url(&self) -> Result; + /// Returns the scale factor that can be used to map logical pixels to physical pixels, and vice versa. fn scale_factor(&self) -> Result; @@ -522,6 +570,9 @@ pub trait Dispatch: Debug + Clone + Send + Sync + Sized + 'static /// Gets the window's current fullscreen state. fn is_fullscreen(&self) -> Result; + /// Gets the window's current minimized state. + fn is_minimized(&self) -> Result; + /// Gets the window's current maximized state. fn is_maximized(&self) -> Result; @@ -533,6 +584,8 @@ pub trait Dispatch: Debug + Clone + Send + Sync + Sized + 'static /// Gets the window's current visibility state. fn is_visible(&self) -> Result; + /// Gets the window's current title. + fn title(&self) -> Result; /// Gets the window menu current visibility state. fn is_menu_visible(&self) -> Result; @@ -623,6 +676,9 @@ pub trait Dispatch: Debug + Clone + Send + Sync + Sized + 'static /// Updates the window alwaysOnTop flag. fn set_always_on_top(&self, always_on_top: bool) -> Result<()>; + /// Prevents the window contents from being captured by other apps. + fn set_content_protected(&self, protected: bool) -> Result<()>; + /// Resizes the window. fn set_size(&self, size: Size) -> Result<()>; diff --git a/core/tauri-runtime/src/menu.rs b/core/tauri-runtime/src/menu.rs index 4df40b23c..fe71bb17f 100644 --- a/core/tauri-runtime/src/menu.rs +++ b/core/tauri-runtime/src/menu.rs @@ -154,6 +154,7 @@ pub trait TrayHandle: fmt::Debug + Clone + Send + Sync { fn set_icon_as_template(&self, is_template: bool) -> crate::Result<()>; #[cfg(target_os = "macos")] fn set_title(&self, title: &str) -> crate::Result<()>; + fn set_tooltip(&self, tooltip: &str) -> crate::Result<()>; fn destroy(&self) -> crate::Result<()>; } diff --git a/core/tauri-runtime/src/webview.rs b/core/tauri-runtime/src/webview.rs index 8b6a0a694..d3d06a4a6 100644 --- a/core/tauri-runtime/src/webview.rs +++ b/core/tauri-runtime/src/webview.rs @@ -28,6 +28,7 @@ pub struct WebviewAttributes { pub file_drop_handler_enabled: bool, pub clipboard: bool, pub accept_first_mouse: bool, + pub additional_browser_args: Option, } impl WebviewAttributes { @@ -41,6 +42,7 @@ impl WebviewAttributes { file_drop_handler_enabled: true, clipboard: false, accept_first_mouse: false, + additional_browser_args: None, } } @@ -88,6 +90,13 @@ impl WebviewAttributes { self.accept_first_mouse = accept; self } + + /// Sets additional browser arguments. **Windows Only** + #[must_use] + pub fn additional_browser_args(mut self, additional_args: &str) -> Self { + self.additional_browser_args = Some(additional_args.to_string()); + self + } } /// Do **NOT** implement this trait except for use in a custom [`Runtime`](crate::Runtime). @@ -172,6 +181,10 @@ pub trait WindowBuilder: WindowBuilderBase { #[must_use] fn always_on_top(self, always_on_top: bool) -> Self; + /// Prevents the window contents from being captured by other apps. + #[must_use] + fn content_protected(self, protected: bool) -> Self; + /// Sets the window icon. fn icon(self, icon: Icon) -> crate::Result; diff --git a/core/tauri-runtime/src/window.rs b/core/tauri-runtime/src/window.rs index c07408b54..a7b56cf3d 100644 --- a/core/tauri-runtime/src/window.rs +++ b/core/tauri-runtime/src/window.rs @@ -12,6 +12,7 @@ use crate::{ }; use serde::{Deserialize, Deserializer, Serialize}; use tauri_utils::{config::WindowConfig, Theme}; +use url::Url; use std::{ collections::{HashMap, HashSet}, @@ -232,6 +233,9 @@ pub struct PendingWindow> { /// A HashMap mapping JS event names with associated listener ids. pub js_event_listeners: Arc>>>, + + /// A handler to decide if incoming url is allowed to navigate. + pub navigation_handler: Option bool + Send>>, } pub fn is_label_valid(label: &str) -> bool { @@ -271,6 +275,7 @@ impl> PendingWindow { url: "tauri://localhost".to_string(), menu_ids: Arc::new(Mutex::new(menu_ids)), js_event_listeners: Default::default(), + navigation_handler: Default::default(), }) } } @@ -300,6 +305,7 @@ impl> PendingWindow { url: "tauri://localhost".to_string(), menu_ids: Arc::new(Mutex::new(menu_ids)), js_event_listeners: Default::default(), + navigation_handler: Default::default(), }) } } diff --git a/core/tauri-utils/src/config.rs b/core/tauri-utils/src/config.rs index 906de01dc..917518618 100644 --- a/core/tauri-utils/src/config.rs +++ b/core/tauri-utils/src/config.rs @@ -55,7 +55,7 @@ pub enum WindowUrl { impl fmt::Display for WindowUrl { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { - Self::External(url) => write!(f, "{}", url), + Self::External(url) => write!(f, "{url}"), Self::App(path) => write!(f, "{}", path.display()), } } @@ -78,6 +78,8 @@ pub enum BundleType { AppImage, /// The Microsoft Installer bundle (.msi). Msi, + /// The NSIS bundle (.exe). + Nsis, /// The macOS application bundle (.app). App, /// The Apple Disk Image bundle (.dmg). @@ -95,6 +97,7 @@ impl Display for BundleType { Self::Deb => "deb", Self::AppImage => "appimage", Self::Msi => "msi", + Self::Nsis => "nsis", Self::App => "app", Self::Dmg => "dmg", Self::Updater => "updater", @@ -122,10 +125,11 @@ impl<'de> Deserialize<'de> for BundleType { "deb" => Ok(Self::Deb), "appimage" => Ok(Self::AppImage), "msi" => Ok(Self::Msi), + "nsis" => Ok(Self::Nsis), "app" => Ok(Self::App), "dmg" => Ok(Self::Dmg), "updater" => Ok(Self::Updater), - _ => Err(DeError::custom(format!("unknown bundle target '{}'", s))), + _ => Err(DeError::custom(format!("unknown bundle target '{s}'"))), } } } @@ -223,7 +227,7 @@ impl<'de> Deserialize<'de> for BundleTarget { match BundleTargetInner::deserialize(deserializer)? { BundleTargetInner::All(s) if s.to_lowercase() == "all" => Ok(Self::All), - BundleTargetInner::All(t) => Err(DeError::custom(format!("invalid bundle type {}", t))), + BundleTargetInner::All(t) => Err(DeError::custom(format!("invalid bundle type {t}"))), BundleTargetInner::List(l) => Ok(Self::List(l)), BundleTargetInner::One(t) => Ok(Self::One(t)), } @@ -416,6 +420,58 @@ pub struct WixConfig { pub dialog_image_path: Option, } +/// Configuration for the Installer bundle using NSIS. +#[derive(Debug, Default, PartialEq, Eq, Clone, Deserialize, Serialize)] +#[cfg_attr(feature = "schema", derive(JsonSchema))] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct NsisConfig { + /// The path to the license file to render on the installer. + pub license: Option, + /// The path to a bitmap file to display on the header of installers pages. + /// + /// The recommended dimensions are 150px x 57px. + pub header_image: Option, + /// The path to a bitmap file for the Welcome page and the Finish page. + /// + /// The recommended dimensions are 164px x 314px. + pub sidebar_image: Option, + /// The path to an icon file used as the installer icon. + pub installer_icon: Option, + /// Whether the installation will be for all users or just the current user. + #[serde(default)] + pub install_mode: NSISInstallerMode, +} + +/// Install Modes for the NSIS installer. +#[derive(Debug, PartialEq, Eq, Clone, Copy, Serialize, Deserialize)] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +#[cfg_attr(feature = "schema", derive(JsonSchema))] +pub enum NSISInstallerMode { + /// Default mode for the installer. + /// + /// Install the app by default in a directory that doesn't require Administrator access. + /// + /// Installer metadata will be saved under the `HKCU` registry path. + CurrentUser, + /// Install the app by default in the `Program Files` folder directory requires Administrator + /// access for the installation. + /// + /// Installer metadata will be saved under the `HKLM` registry path. + PerMachine, + /// Combines both modes and allows the user to choose at install time + /// whether to install for the current user or per machine. Note that this mode + /// will require Administrator access even if the user wants to install it for the current user only. + /// + /// Installer metadata will be saved under the `HKLM` or `HKCU` registry path based on the user's choice. + Both, +} + +impl Default for NSISInstallerMode { + fn default() -> Self { + Self::CurrentUser + } +} + /// Install modes for the Webview2 runtime. /// Note that for the updater bundle [`Self::DownloadBootstrapper`] is used. /// @@ -512,6 +568,8 @@ pub struct WindowsConfig { pub allow_downgrades: bool, /// Configuration for the MSI generated with WiX. pub wix: Option, + /// Configuration for the installer generated with NSIS. + pub nsis: Option, } impl Default for WindowsConfig { @@ -525,6 +583,7 @@ impl Default for WindowsConfig { webview_fixed_runtime_path: None, allow_downgrades: default_allow_downgrades(), wix: None, + nsis: None, } } } @@ -542,7 +601,7 @@ pub struct BundleConfig { /// Whether Tauri should bundle your application or just output the executable. #[serde(default)] pub active: bool, - /// The bundle targets, currently supports ["deb", "appimage", "msi", "app", "dmg", "updater"] or "all". + /// The bundle targets, currently supports ["deb", "appimage", "nsis", "msi", "app", "dmg", "updater"] or "all". #[serde(default)] pub targets: BundleTarget, /// The application identifier in reverse domain name notation (e.g. `com.tauri.example`). @@ -859,6 +918,9 @@ pub struct WindowConfig { /// Whether the window should always be on top of other windows. #[serde(default, alias = "always-on-top")] pub always_on_top: bool, + /// Prevents the window contents from being captured by other apps. + #[serde(default, alias = "content-protected")] + pub content_protected: bool, /// If `true`, hides the window icon from the taskbar on Windows and Linux. #[serde(default, alias = "skip-taskbar")] pub skip_taskbar: bool, @@ -881,6 +943,10 @@ pub struct WindowConfig { /// [tabbing identifier]: #[serde(default, alias = "tabbing-identifier")] pub tabbing_identifier: Option, + /// Defines additional browser arguments on Windows. By default wry passes `--disable-features=msWebOOUI,msPdfOOUI,msSmartScreenProtection` + /// so if you use this method, you also need to disable these components by yourself if you want. + #[serde(default, alias = "additional-browser-args")] + pub additional_browser_args: Option, } impl Default for WindowConfig { @@ -908,12 +974,14 @@ impl Default for WindowConfig { visible: default_visible(), decorations: default_decorations(), always_on_top: false, + content_protected: false, skip_taskbar: false, theme: None, title_bar_style: Default::default(), hidden_title: false, accept_first_mouse: false, tabbing_identifier: None, + additional_browser_args: None, } } } @@ -985,7 +1053,7 @@ impl CspDirectiveSources { /// Whether the given source is configured on this directive or not. pub fn contains(&self, source: &str) -> bool { match self { - Self::Inline(s) => s.contains(&format!("{} ", source)) || s.contains(&format!(" {}", source)), + Self::Inline(s) => s.contains(&format!("{source} ")) || s.contains(&format!(" {source}")), Self::List(l) => l.contains(&source.into()), } } @@ -1051,7 +1119,7 @@ impl From for HashMap { impl Display for Csp { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { - Self::Policy(s) => write!(f, "{}", s), + Self::Policy(s) => write!(f, "{s}"), Self::DirectiveMap(m) => { let len = m.len(); let mut i = 0; @@ -1329,6 +1397,9 @@ pub struct WindowAllowlistConfig { /// Allows setting the always_on_top flag of the window. #[serde(default, alias = "set-always-on-top")] pub set_always_on_top: bool, + /// Allows preventing the window contents from being captured by other apps. + #[serde(default, alias = "set-content-protected")] + pub set_content_protected: bool, /// Allows setting the window size. #[serde(default, alias = "set-size")] pub set_size: bool, @@ -1394,6 +1465,7 @@ impl Allowlist for WindowAllowlistConfig { close: true, set_decorations: true, set_always_on_top: true, + set_content_protected: false, set_size: true, set_min_size: true, set_max_size: true, @@ -1444,6 +1516,12 @@ impl Allowlist for WindowAllowlistConfig { set_always_on_top, "window-set-always-on-top" ); + check_feature!( + self, + features, + set_content_protected, + "window-set-content-protected" + ); check_feature!(self, features, set_size, "window-set-size"); check_feature!(self, features, set_min_size, "window-set-min-size"); check_feature!(self, features, set_max_size, "window-set-max-size"); @@ -1599,7 +1677,7 @@ pub struct ShellAllowlistScope(pub Vec); pub enum ShellAllowlistOpen { /// If the shell open API should be enabled. /// - /// If enabled, the default validation regex (`^https?://`) is used. + /// If enabled, the default validation regex (`^((mailto:\w+)|(tel:\w+)|(https?://\w+)).+`) is used. Flag(bool), /// Enable the shell open API, with a custom regex that the opened path must match against. @@ -2062,7 +2140,16 @@ impl Allowlist for AppAllowlistConfig { } } -/// Allowlist configuration. +/// Allowlist configuration. The allowlist is a translation of the [Cargo allowlist features](https://docs.rs/tauri/latest/tauri/#cargo-allowlist-features). +/// +/// # Notes +/// +/// - Endpoints that don't have their own allowlist option are enabled by default. +/// - There is only "opt-in", no "opt-out". Setting an option to `false` has no effect. +/// +/// # Examples +/// +/// - * [`"app-all": true`](https://tauri.app/v1/api/config/#appallowlistconfig.all) will make the [hide](https://tauri.app/v1/api/js/app#hide) endpoint be available regardless of whether `hide` is set to `false` or `true` in the allowlist. #[derive(Debug, Default, PartialEq, Eq, Clone, Deserialize, Serialize)] #[cfg_attr(feature = "schema", derive(JsonSchema))] #[serde(rename_all = "camelCase", deny_unknown_fields)] @@ -2287,7 +2374,7 @@ pub enum WindowsUpdateInstallMode { /// Specifies there's a basic UI during the installation process, including a final dialog box at the end. BasicUi, /// The quiet mode means there's no user interaction required. - /// Requires admin privileges if the installer does. + /// Requires admin privileges if the installer does (WiX). Quiet, /// Specifies unattended mode, which means the installation only shows a progress bar. Passive, @@ -2346,8 +2433,7 @@ impl<'de> Deserialize<'de> for WindowsUpdateInstallMode { "quiet" => Ok(Self::Quiet), "passive" => Ok(Self::Passive), _ => Err(DeError::custom(format!( - "unknown update install mode '{}'", - s + "unknown update install mode '{s}'" ))), } } @@ -2359,6 +2445,9 @@ impl<'de> Deserialize<'de> for WindowsUpdateInstallMode { #[cfg_attr(feature = "schema", derive(JsonSchema))] #[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct UpdaterWindowsConfig { + /// Additional arguments given to the NSIS or WiX installer. + #[serde(default, alias = "installer-args")] + pub installer_args: Vec, /// The installation mode for the update on Windows. Defaults to `passive`. #[serde(default, alias = "install-mode")] pub install_mode: WindowsUpdateInstallMode, @@ -2491,7 +2580,7 @@ pub enum AppUrl { impl std::fmt::Display for AppUrl { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { - Self::Url(url) => write!(f, "{}", url), + Self::Url(url) => write!(f, "{url}"), Self::Files(files) => write!(f, "{}", serde_json::to_string(files).unwrap()), } } @@ -2630,9 +2719,9 @@ impl<'d> serde::Deserialize<'d> for PackageVersion { let path = PathBuf::from(value); if path.exists() { let json_str = read_to_string(&path) - .map_err(|e| DeError::custom(format!("failed to read version JSON file: {}", e)))?; + .map_err(|e| DeError::custom(format!("failed to read version JSON file: {e}")))?; let package_json: serde_json::Value = serde_json::from_str(&json_str) - .map_err(|e| DeError::custom(format!("failed to read version JSON file: {}", e)))?; + .map_err(|e| DeError::custom(format!("failed to read version JSON file: {e}")))?; if let Some(obj) = package_json.as_object() { let version = obj .get("version") @@ -3040,12 +3129,14 @@ mod build { let visible = self.visible; let decorations = self.decorations; let always_on_top = self.always_on_top; + let content_protected = self.content_protected; let skip_taskbar = self.skip_taskbar; let theme = opt_lit(self.theme.as_ref()); let title_bar_style = &self.title_bar_style; let hidden_title = self.hidden_title; let accept_first_mouse = self.accept_first_mouse; let tabbing_identifier = opt_str_lit(self.tabbing_identifier.as_ref()); + let additional_browser_args = opt_str_lit(self.additional_browser_args.as_ref()); literal_struct!( tokens, @@ -3072,12 +3163,14 @@ mod build { visible, decorations, always_on_top, + content_protected, skip_taskbar, theme, title_bar_style, hidden_title, accept_first_mouse, - tabbing_identifier + tabbing_identifier, + additional_browser_args ); } } @@ -3333,7 +3426,8 @@ mod build { impl ToTokens for UpdaterWindowsConfig { fn to_tokens(&self, tokens: &mut TokenStream) { let install_mode = &self.install_mode; - literal_struct!(tokens, UpdaterWindowsConfig, install_mode); + let installer_args = vec_lit(&self.installer_args, str_lit); + literal_struct!(tokens, UpdaterWindowsConfig, install_mode, installer_args); } } diff --git a/core/tauri-utils/src/html.rs b/core/tauri-utils/src/html.rs index b8744261b..77bc8b800 100644 --- a/core/tauri-utils/src/html.rs +++ b/core/tauri-utils/src/html.rs @@ -37,7 +37,7 @@ fn serialize_node_ref_internal( traversal_scope: TraversalScope, ) -> crate::Result<()> { match (traversal_scope, node.data()) { - (ref scope, &NodeData::Element(ref element)) => { + (ref scope, NodeData::Element(element)) => { if *scope == TraversalScope::IncludeNode { let attrs = element.attributes.borrow(); @@ -82,16 +82,16 @@ fn serialize_node_ref_internal( (TraversalScope::ChildrenOnly(_), _) => Ok(()), - (TraversalScope::IncludeNode, &NodeData::Doctype(ref doctype)) => { + (TraversalScope::IncludeNode, NodeData::Doctype(doctype)) => { serializer.write_doctype(&doctype.name).map_err(Into::into) } - (TraversalScope::IncludeNode, &NodeData::Text(ref text)) => { + (TraversalScope::IncludeNode, NodeData::Text(text)) => { serializer.write_text(&text.borrow()).map_err(Into::into) } - (TraversalScope::IncludeNode, &NodeData::Comment(ref text)) => { + (TraversalScope::IncludeNode, NodeData::Comment(text)) => { serializer.write_comment(&text.borrow()).map_err(Into::into) } - (TraversalScope::IncludeNode, &NodeData::ProcessingInstruction(ref contents)) => { + (TraversalScope::IncludeNode, NodeData::ProcessingInstruction(contents)) => { let contents = contents.borrow(); serializer .write_processing_instruction(&contents.0, &contents.1) diff --git a/core/tauri-utils/src/mime_type.rs b/core/tauri-utils/src/mime_type.rs index be2471ea9..60bd08f0e 100644 --- a/core/tauri-utils/src/mime_type.rs +++ b/core/tauri-utils/src/mime_type.rs @@ -39,7 +39,7 @@ impl std::fmt::Display for MimeType { MimeType::Svg => "image/svg+xml", MimeType::Mp4 => "video/mp4", }; - write!(f, "{}", mime) + write!(f, "{mime}") } } diff --git a/core/tauri-utils/src/platform.rs b/core/tauri-utils/src/platform.rs index 96614ffa2..d16f275e8 100644 --- a/core/tauri-utils/src/platform.rs +++ b/core/tauri-utils/src/platform.rs @@ -133,10 +133,10 @@ pub fn target_triple() -> crate::Result { return Err(crate::Error::Environment); }; - format!("{}-{}", os, env) + format!("{os}-{env}") }; - Ok(format!("{}-{}", arch, os)) + Ok(format!("{arch}-{os}")) } /// Computes the resource directory of the current environment. @@ -157,8 +157,8 @@ pub fn resource_dir(package_info: &PackageInfo, env: &Env) -> crate::Result bool { // `alias` must be a snake case string. fn alias(alias: &str, has_feature: bool) { if has_feature { - println!("cargo:rustc-cfg={}", alias); + println!("cargo:rustc-cfg={alias}"); } } @@ -81,6 +81,7 @@ fn main() { "close", "set-decorations", "set-always-on-top", + "set-content-protected", "set-size", "set-min-size", "set-max-size", @@ -140,6 +141,18 @@ fn main() { CHECKED_FEATURES.get().unwrap().lock().unwrap().join(","), ) .expect("failed to write checked_features file"); + + // workaround needed to preven `STATUS_ENTRYPOINT_NOT_FOUND` error + // see https://github.com/tauri-apps/tauri/pull/4383#issuecomment-1212221864 + let target_os = std::env::var("CARGO_CFG_TARGET_OS"); + let target_env = std::env::var("CARGO_CFG_TARGET_ENV"); + let is_tauri_workspace = std::env::var("__TAURI_WORKSPACE__").map_or(false, |v| v == "true"); + if is_tauri_workspace + && Ok("windows") == target_os.as_deref() + && Ok("msvc") == target_env.as_deref() + { + add_manifest(); + } } // create aliases for the given module with its apis. @@ -152,14 +165,14 @@ fn main() { // // Note that both `module` and `apis` strings must be written in kebab case. fn alias_module(module: &str, apis: &[&str], api_all: bool) { - let all_feature_name = format!("{}-all", module); + let all_feature_name = format!("{module}-all"); let all = has_feature(&all_feature_name) || api_all; alias(&all_feature_name.to_snake_case(), all); let mut any = all; for api in apis { - let has = has_feature(&format!("{}-{}", module, api)) || all; + let has = has_feature(&format!("{module}-{api}")) || all; alias( &format!("{}_{}", AsSnakeCase(module), AsSnakeCase(api)), has, @@ -169,3 +182,22 @@ fn alias_module(module: &str, apis: &[&str], api_all: bool) { alias(&format!("{}_any", AsSnakeCase(module)), any); } + +fn add_manifest() { + static WINDOWS_MANIFEST_FILE: &str = "window-app-manifest.xml"; + + let manifest = std::env::current_dir() + .unwrap() + .join("../tauri-build/src") + .join(WINDOWS_MANIFEST_FILE); + + println!("cargo:rerun-if-changed={}", manifest.display()); + // Embed the Windows application manifest file. + println!("cargo:rustc-link-arg=/MANIFEST:EMBED"); + println!( + "cargo:rustc-link-arg=/MANIFESTINPUT:{}", + manifest.to_str().unwrap() + ); + // Turn linker warnings into errors. + println!("cargo:rustc-link-arg=/WX"); +} diff --git a/core/tauri/scripts/bundle.global.js b/core/tauri/scripts/bundle.global.js index 9947ec6e4..5c080edf8 100644 --- a/core/tauri/scripts/bundle.global.js +++ b/core/tauri/scripts/bundle.global.js @@ -1,8 +1,8 @@ -"use strict";var __TAURI_IIFE__=(()=>{var L=Object.defineProperty;var de=Object.getOwnPropertyDescriptor;var me=Object.getOwnPropertyNames;var pe=Object.prototype.hasOwnProperty;var c=(n,e)=>{for(var t in e)L(n,t,{get:e[t],enumerable:!0})},ge=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of me(e))!pe.call(n,s)&&s!==t&&L(n,s,{get:()=>e[s],enumerable:!(r=de(e,s))||r.enumerable});return n};var he=n=>ge(L({},"__esModule",{value:!0}),n);var Jt={};c(Jt,{app:()=>U,cli:()=>k,clipboard:()=>I,dialog:()=>N,event:()=>V,fs:()=>j,globalShortcut:()=>q,http:()=>$,invoke:()=>$t,notification:()=>J,os:()=>ne,path:()=>K,process:()=>Q,shell:()=>Z,tauri:()=>R,updater:()=>X,window:()=>te});var U={};c(U,{getName:()=>be,getTauriVersion:()=>Pe,getVersion:()=>_e,hide:()=>ve,show:()=>we});var R={};c(R,{convertFileSrc:()=>fe,invoke:()=>f,transformCallback:()=>d});function ye(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function d(n,e=!1){let t=ye(),r=`_${t}`;return Object.defineProperty(window,r,{value:s=>(e&&Reflect.deleteProperty(window,r),n==null?void 0:n(s)),writable:!1,configurable:!0}),t}async function f(n,e={}){return new Promise((t,r)=>{let s=d(l=>{t(l),Reflect.deleteProperty(window,`_${a}`)},!0),a=d(l=>{r(l),Reflect.deleteProperty(window,`_${s}`)},!0);window.__TAURI_IPC__({cmd:n,callback:s,error:a,...e})})}function fe(n,e="asset"){let t=encodeURIComponent(n);return navigator.userAgent.includes("Windows")?`https://${e}.localhost/${t}`:`${e}://localhost/${t}`}async function i(n){return f("tauri",n)}async function _e(){return i({__tauriModule:"App",message:{cmd:"getAppVersion"}})}async function be(){return i({__tauriModule:"App",message:{cmd:"getAppName"}})}async function Pe(){return i({__tauriModule:"App",message:{cmd:"getTauriVersion"}})}async function we(){return i({__tauriModule:"App",message:{cmd:"show"}})}async function ve(){return i({__tauriModule:"App",message:{cmd:"hide"}})}var k={};c(k,{getMatches:()=>Me});async function Me(){return i({__tauriModule:"Cli",message:{cmd:"cliMatches"}})}var I={};c(I,{readText:()=>Oe,writeText:()=>Te});async function Te(n){return i({__tauriModule:"Clipboard",message:{cmd:"writeText",data:n}})}async function Oe(){return i({__tauriModule:"Clipboard",message:{cmd:"readText",data:null}})}var N={};c(N,{ask:()=>Ce,confirm:()=>De,message:()=>Ae,open:()=>Fe,save:()=>Ee});async function Fe(n={}){return typeof n=="object"&&Object.freeze(n),i({__tauriModule:"Dialog",message:{cmd:"openDialog",options:n}})}async function Ee(n={}){return typeof n=="object"&&Object.freeze(n),i({__tauriModule:"Dialog",message:{cmd:"saveDialog",options:n}})}async function Ae(n,e){var r;let t=typeof e=="string"?{title:e}:e;return i({__tauriModule:"Dialog",message:{cmd:"messageDialog",message:n.toString(),title:(r=t==null?void 0:t.title)==null?void 0:r.toString(),type:t==null?void 0:t.type}})}async function Ce(n,e){var r;let t=typeof e=="string"?{title:e}:e;return i({__tauriModule:"Dialog",message:{cmd:"askDialog",message:n.toString(),title:(r=t==null?void 0:t.title)==null?void 0:r.toString(),type:t==null?void 0:t.type}})}async function De(n,e){var r;let t=typeof e=="string"?{title:e}:e;return i({__tauriModule:"Dialog",message:{cmd:"confirmDialog",message:n.toString(),title:(r=t==null?void 0:t.title)==null?void 0:r.toString(),type:t==null?void 0:t.type}})}var V={};c(V,{TauriEvent:()=>M,emit:()=>T,listen:()=>z,once:()=>H});async function ie(n,e){return i({__tauriModule:"Event",message:{cmd:"unlisten",event:n,eventId:e}})}async function w(n,e,t){await i({__tauriModule:"Event",message:{cmd:"emit",event:n,windowLabel:e,payload:t}})}async function _(n,e,t){return i({__tauriModule:"Event",message:{cmd:"listen",event:n,windowLabel:e,handler:d(t)}}).then(r=>async()=>ie(n,r))}async function v(n,e,t){return _(n,e,r=>{t(r),ie(n,r.id).catch(()=>{})})}var M=(u=>(u.WINDOW_RESIZED="tauri://resize",u.WINDOW_MOVED="tauri://move",u.WINDOW_CLOSE_REQUESTED="tauri://close-requested",u.WINDOW_CREATED="tauri://window-created",u.WINDOW_DESTROYED="tauri://destroyed",u.WINDOW_FOCUS="tauri://focus",u.WINDOW_BLUR="tauri://blur",u.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",u.WINDOW_THEME_CHANGED="tauri://theme-changed",u.WINDOW_FILE_DROP="tauri://file-drop",u.WINDOW_FILE_DROP_HOVER="tauri://file-drop-hover",u.WINDOW_FILE_DROP_CANCELLED="tauri://file-drop-cancelled",u.MENU="tauri://menu",u.CHECK_UPDATE="tauri://update",u.UPDATE_AVAILABLE="tauri://update-available",u.INSTALL_UPDATE="tauri://update-install",u.STATUS_UPDATE="tauri://update-status",u.DOWNLOAD_PROGRESS="tauri://update-download-progress",u))(M||{});async function z(n,e){return _(n,null,e)}async function H(n,e){return v(n,null,e)}async function T(n,e){return w(n,void 0,e)}var j={};c(j,{BaseDirectory:()=>O,Dir:()=>O,copyFile:()=>Ne,createDir:()=>ke,exists:()=>Ve,readBinaryFile:()=>xe,readDir:()=>Ue,readTextFile:()=>We,removeDir:()=>Ie,removeFile:()=>ze,renameFile:()=>He,writeBinaryFile:()=>Re,writeFile:()=>Le,writeTextFile:()=>Le});var O=(o=>(o[o.Audio=1]="Audio",o[o.Cache=2]="Cache",o[o.Config=3]="Config",o[o.Data=4]="Data",o[o.LocalData=5]="LocalData",o[o.Desktop=6]="Desktop",o[o.Document=7]="Document",o[o.Download=8]="Download",o[o.Executable=9]="Executable",o[o.Font=10]="Font",o[o.Home=11]="Home",o[o.Picture=12]="Picture",o[o.Public=13]="Public",o[o.Runtime=14]="Runtime",o[o.Template=15]="Template",o[o.Video=16]="Video",o[o.Resource=17]="Resource",o[o.App=18]="App",o[o.Log=19]="Log",o[o.Temp=20]="Temp",o[o.AppConfig=21]="AppConfig",o[o.AppData=22]="AppData",o[o.AppLocalData=23]="AppLocalData",o[o.AppCache=24]="AppCache",o[o.AppLog=25]="AppLog",o))(O||{});async function We(n,e={}){return i({__tauriModule:"Fs",message:{cmd:"readTextFile",path:n,options:e}})}async function xe(n,e={}){let t=await i({__tauriModule:"Fs",message:{cmd:"readFile",path:n,options:e}});return Uint8Array.from(t)}async function Le(n,e,t){typeof t=="object"&&Object.freeze(t),typeof n=="object"&&Object.freeze(n);let r={path:"",contents:""},s=t;return typeof n=="string"?r.path=n:(r.path=n.path,r.contents=n.contents),typeof e=="string"?r.contents=e??"":s=e,i({__tauriModule:"Fs",message:{cmd:"writeFile",path:r.path,contents:Array.from(new TextEncoder().encode(r.contents)),options:s}})}async function Re(n,e,t){typeof t=="object"&&Object.freeze(t),typeof n=="object"&&Object.freeze(n);let r={path:"",contents:[]},s=t;return typeof n=="string"?r.path=n:(r.path=n.path,r.contents=n.contents),e&&"dir"in e?s=e:typeof n=="string"&&(r.contents=e??[]),i({__tauriModule:"Fs",message:{cmd:"writeFile",path:r.path,contents:Array.from(r.contents instanceof ArrayBuffer?new Uint8Array(r.contents):r.contents),options:s}})}async function Ue(n,e={}){return i({__tauriModule:"Fs",message:{cmd:"readDir",path:n,options:e}})}async function ke(n,e={}){return i({__tauriModule:"Fs",message:{cmd:"createDir",path:n,options:e}})}async function Ie(n,e={}){return i({__tauriModule:"Fs",message:{cmd:"removeDir",path:n,options:e}})}async function Ne(n,e,t={}){return i({__tauriModule:"Fs",message:{cmd:"copyFile",source:n,destination:e,options:t}})}async function ze(n,e={}){return i({__tauriModule:"Fs",message:{cmd:"removeFile",path:n,options:e}})}async function He(n,e,t={}){return i({__tauriModule:"Fs",message:{cmd:"renameFile",oldPath:n,newPath:e,options:t}})}async function Ve(n,e={}){return i({__tauriModule:"Fs",message:{cmd:"exists",path:n,options:e}})}var q={};c(q,{isRegistered:()=>Ge,register:()=>je,registerAll:()=>qe,unregister:()=>$e,unregisterAll:()=>Je});async function je(n,e){return i({__tauriModule:"GlobalShortcut",message:{cmd:"register",shortcut:n,handler:d(e)}})}async function qe(n,e){return i({__tauriModule:"GlobalShortcut",message:{cmd:"registerAll",shortcuts:n,handler:d(e)}})}async function Ge(n){return i({__tauriModule:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:n}})}async function $e(n){return i({__tauriModule:"GlobalShortcut",message:{cmd:"unregister",shortcut:n}})}async function Je(){return i({__tauriModule:"GlobalShortcut",message:{cmd:"unregisterAll"}})}var $={};c($,{Body:()=>p,Client:()=>E,Response:()=>F,ResponseType:()=>re,fetch:()=>Ke,getClient:()=>se});var re=(r=>(r[r.JSON=1]="JSON",r[r.Text=2]="Text",r[r.Binary=3]="Binary",r))(re||{}),p=class{constructor(e,t){this.type=e,this.payload=t}static form(e){let t={},r=(s,a)=>{if(a!==null){let l;typeof a=="string"?l=a:a instanceof Uint8Array||Array.isArray(a)?l=Array.from(a):a instanceof File?l={file:a.name,mime:a.type,fileName:a.name}:typeof a.file=="string"?l={file:a.file,mime:a.mime,fileName:a.fileName}:l={file:Array.from(a.file),mime:a.mime,fileName:a.fileName},t[String(s)]=l}};if(e instanceof FormData)for(let[s,a]of e)r(s,a);else for(let[s,a]of Object.entries(e))r(s,a);return new p("Form",t)}static json(e){return new p("Json",e)}static text(e){return new p("Text",e)}static bytes(e){return new p("Bytes",Array.from(e instanceof ArrayBuffer?new Uint8Array(e):e))}},F=class{constructor(e){this.url=e.url,this.status=e.status,this.ok=this.status>=200&&this.status<300,this.headers=e.headers,this.rawHeaders=e.rawHeaders,this.data=e.data}},E=class{constructor(e){this.id=e}async drop(){return i({__tauriModule:"Http",message:{cmd:"dropClient",client:this.id}})}async request(e){let t=!e.responseType||e.responseType===1;return t&&(e.responseType=2),i({__tauriModule:"Http",message:{cmd:"httpRequest",client:this.id,options:e}}).then(r=>{let s=new F(r);if(t){try{s.data=JSON.parse(s.data)}catch(a){if(s.ok&&s.data==="")s.data={};else if(s.ok)throw Error(`Failed to parse response \`${s.data}\` as JSON: ${a}; - try setting the \`responseType\` option to \`ResponseType.Text\` or \`ResponseType.Binary\` if the API does not return a JSON response.`)}return s}return s})}async get(e,t){return this.request({method:"GET",url:e,...t})}async post(e,t,r){return this.request({method:"POST",url:e,body:t,...r})}async put(e,t,r){return this.request({method:"PUT",url:e,body:t,...r})}async patch(e,t){return this.request({method:"PATCH",url:e,...t})}async delete(e,t){return this.request({method:"DELETE",url:e,...t})}};async function se(n){return i({__tauriModule:"Http",message:{cmd:"createClient",options:n}}).then(e=>new E(e))}var G=null;async function Ke(n,e){return G===null&&(G=await se()),G.request({url:n,method:(e==null?void 0:e.method)??"GET",...e})}var J={};c(J,{isPermissionGranted:()=>Qe,requestPermission:()=>Ze,sendNotification:()=>Ye});async function Qe(){return window.Notification.permission!=="default"?Promise.resolve(window.Notification.permission==="granted"):i({__tauriModule:"Notification",message:{cmd:"isNotificationPermissionGranted"}})}async function Ze(){return window.Notification.requestPermission()}function Ye(n){typeof n=="string"?new window.Notification(n):new window.Notification(n.title,n)}var K={};c(K,{BaseDirectory:()=>O,appCacheDir:()=>tt,appConfigDir:()=>ae,appDataDir:()=>Be,appDir:()=>Xe,appLocalDataDir:()=>et,appLogDir:()=>oe,audioDir:()=>nt,basename:()=>At,cacheDir:()=>it,configDir:()=>rt,dataDir:()=>st,delimiter:()=>vt,desktopDir:()=>at,dirname:()=>Ft,documentDir:()=>ot,downloadDir:()=>lt,executableDir:()=>ut,extname:()=>Et,fontDir:()=>ct,homeDir:()=>dt,isAbsolute:()=>Ct,join:()=>Ot,localDataDir:()=>mt,logDir:()=>Pt,normalize:()=>Tt,pictureDir:()=>pt,publicDir:()=>gt,resolve:()=>Mt,resolveResource:()=>yt,resourceDir:()=>ht,runtimeDir:()=>ft,sep:()=>wt,templateDir:()=>_t,videoDir:()=>bt});function b(){return navigator.appVersion.includes("Win")}async function Xe(){return ae()}async function ae(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:21}})}async function Be(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:22}})}async function et(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:23}})}async function tt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:24}})}async function nt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:1}})}async function it(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:2}})}async function rt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:3}})}async function st(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:4}})}async function at(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:6}})}async function ot(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:7}})}async function lt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:8}})}async function ut(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:9}})}async function ct(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:10}})}async function dt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:11}})}async function mt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:5}})}async function pt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:12}})}async function gt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:13}})}async function ht(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:17}})}async function yt(n){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:n,directory:17}})}async function ft(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:14}})}async function _t(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:15}})}async function bt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:16}})}async function Pt(){return oe()}async function oe(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:25}})}var wt=b()?"\\":"/",vt=b()?";":":";async function Mt(...n){return i({__tauriModule:"Path",message:{cmd:"resolve",paths:n}})}async function Tt(n){return i({__tauriModule:"Path",message:{cmd:"normalize",path:n}})}async function Ot(...n){return i({__tauriModule:"Path",message:{cmd:"join",paths:n}})}async function Ft(n){return i({__tauriModule:"Path",message:{cmd:"dirname",path:n}})}async function Et(n){return i({__tauriModule:"Path",message:{cmd:"extname",path:n}})}async function At(n,e){return i({__tauriModule:"Path",message:{cmd:"basename",path:n,ext:e}})}async function Ct(n){return i({__tauriModule:"Path",message:{cmd:"isAbsolute",path:n}})}var Q={};c(Q,{exit:()=>Dt,relaunch:()=>St});async function Dt(n=0){return i({__tauriModule:"Process",message:{cmd:"exit",exitCode:n}})}async function St(){return i({__tauriModule:"Process",message:{cmd:"relaunch"}})}var Z={};c(Z,{Child:()=>A,Command:()=>P,EventEmitter:()=>g,open:()=>xt});async function Wt(n,e,t=[],r){return typeof t=="object"&&Object.freeze(t),i({__tauriModule:"Shell",message:{cmd:"execute",program:e,args:t,options:r,onEventFn:d(n)}})}var g=class{constructor(){this.eventListeners=Object.create(null)}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}on(e,t){return e in this.eventListeners?this.eventListeners[e].push(t):this.eventListeners[e]=[t],this}once(e,t){let r=(...s)=>{this.removeListener(e,r),t(...s)};return this.addListener(e,r)}off(e,t){return e in this.eventListeners&&(this.eventListeners[e]=this.eventListeners[e].filter(r=>r!==t)),this}removeAllListeners(e){return e?delete this.eventListeners[e]:this.eventListeners=Object.create(null),this}emit(e,...t){if(e in this.eventListeners){let r=this.eventListeners[e];for(let s of r)s(...t);return!0}return!1}listenerCount(e){return e in this.eventListeners?this.eventListeners[e].length:0}prependListener(e,t){return e in this.eventListeners?this.eventListeners[e].unshift(t):this.eventListeners[e]=[t],this}prependOnceListener(e,t){let r=(...s)=>{this.removeListener(e,r),t(...s)};return this.prependListener(e,r)}},A=class{constructor(e){this.pid=e}async write(e){return i({__tauriModule:"Shell",message:{cmd:"stdinWrite",pid:this.pid,buffer:typeof e=="string"?e:Array.from(e)}})}async kill(){return i({__tauriModule:"Shell",message:{cmd:"killChild",pid:this.pid}})}},P=class extends g{constructor(t,r=[],s){super();this.stdout=new g;this.stderr=new g;this.program=t,this.args=typeof r=="string"?[r]:r,this.options=s??{}}static sidecar(t,r=[],s){let a=new P(t,r,s);return a.options.sidecar=!0,a}async spawn(){return Wt(t=>{switch(t.event){case"Error":this.emit("error",t.payload);break;case"Terminated":this.emit("close",t.payload);break;case"Stdout":this.stdout.emit("data",t.payload);break;case"Stderr":this.stderr.emit("data",t.payload);break}},this.program,this.args,this.options).then(t=>new A(t))}async execute(){return new Promise((t,r)=>{this.on("error",r);let s=[],a=[];this.stdout.on("data",l=>{s.push(l)}),this.stderr.on("data",l=>{a.push(l)}),this.on("close",l=>{t({code:l.code,signal:l.signal,stdout:s.join(` +"use strict";var __TAURI_IIFE__=(()=>{var L=Object.defineProperty;var de=Object.getOwnPropertyDescriptor;var me=Object.getOwnPropertyNames;var pe=Object.prototype.hasOwnProperty;var c=(n,e)=>{for(var t in e)L(n,t,{get:e[t],enumerable:!0})},ge=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of me(e))!pe.call(n,s)&&s!==t&&L(n,s,{get:()=>e[s],enumerable:!(r=de(e,s))||r.enumerable});return n};var he=n=>ge(L({},"__esModule",{value:!0}),n);var Jt={};c(Jt,{app:()=>k,cli:()=>U,clipboard:()=>I,dialog:()=>z,event:()=>V,fs:()=>j,globalShortcut:()=>q,http:()=>$,invoke:()=>$t,notification:()=>J,os:()=>ne,path:()=>K,process:()=>Q,shell:()=>Y,tauri:()=>R,updater:()=>X,window:()=>te});var k={};c(k,{getName:()=>_e,getTauriVersion:()=>Pe,getVersion:()=>be,hide:()=>ve,show:()=>we});var R={};c(R,{convertFileSrc:()=>fe,invoke:()=>f,transformCallback:()=>d});function ye(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function d(n,e=!1){let t=ye(),r=`_${t}`;return Object.defineProperty(window,r,{value:s=>(e&&Reflect.deleteProperty(window,r),n?.(s)),writable:!1,configurable:!0}),t}async function f(n,e={}){return new Promise((t,r)=>{let s=d(l=>{t(l),Reflect.deleteProperty(window,`_${a}`)},!0),a=d(l=>{r(l),Reflect.deleteProperty(window,`_${s}`)},!0);window.__TAURI_IPC__({cmd:n,callback:s,error:a,...e})})}function fe(n,e="asset"){let t=encodeURIComponent(n);return navigator.userAgent.includes("Windows")?`https://${e}.localhost/${t}`:`${e}://localhost/${t}`}async function i(n){return f("tauri",n)}async function be(){return i({__tauriModule:"App",message:{cmd:"getAppVersion"}})}async function _e(){return i({__tauriModule:"App",message:{cmd:"getAppName"}})}async function Pe(){return i({__tauriModule:"App",message:{cmd:"getTauriVersion"}})}async function we(){return i({__tauriModule:"App",message:{cmd:"show"}})}async function ve(){return i({__tauriModule:"App",message:{cmd:"hide"}})}var U={};c(U,{getMatches:()=>Me});async function Me(){return i({__tauriModule:"Cli",message:{cmd:"cliMatches"}})}var I={};c(I,{readText:()=>Oe,writeText:()=>Te});async function Te(n){return i({__tauriModule:"Clipboard",message:{cmd:"writeText",data:n}})}async function Oe(){return i({__tauriModule:"Clipboard",message:{cmd:"readText",data:null}})}var z={};c(z,{ask:()=>Ae,confirm:()=>De,message:()=>Ce,open:()=>Fe,save:()=>Ee});async function Fe(n={}){return typeof n=="object"&&Object.freeze(n),i({__tauriModule:"Dialog",message:{cmd:"openDialog",options:n}})}async function Ee(n={}){return typeof n=="object"&&Object.freeze(n),i({__tauriModule:"Dialog",message:{cmd:"saveDialog",options:n}})}async function Ce(n,e){let t=typeof e=="string"?{title:e}:e;return i({__tauriModule:"Dialog",message:{cmd:"messageDialog",message:n.toString(),title:t?.title?.toString(),type:t?.type,buttonLabel:t?.okLabel?.toString()}})}async function Ae(n,e){let t=typeof e=="string"?{title:e}:e;return i({__tauriModule:"Dialog",message:{cmd:"askDialog",message:n.toString(),title:t?.title?.toString(),type:t?.type,buttonLabels:[t?.okLabel?.toString()??"Yes",t?.cancelLabel?.toString()??"No"]}})}async function De(n,e){let t=typeof e=="string"?{title:e}:e;return i({__tauriModule:"Dialog",message:{cmd:"confirmDialog",message:n.toString(),title:t?.title?.toString(),type:t?.type,buttonLabels:[t?.okLabel?.toString()??"Ok",t?.cancelLabel?.toString()??"Cancel"]}})}var V={};c(V,{TauriEvent:()=>M,emit:()=>T,listen:()=>N,once:()=>H});async function ie(n,e){return i({__tauriModule:"Event",message:{cmd:"unlisten",event:n,eventId:e}})}async function w(n,e,t){await i({__tauriModule:"Event",message:{cmd:"emit",event:n,windowLabel:e,payload:t}})}async function b(n,e,t){return i({__tauriModule:"Event",message:{cmd:"listen",event:n,windowLabel:e,handler:d(t)}}).then(r=>async()=>ie(n,r))}async function v(n,e,t){return b(n,e,r=>{t(r),ie(n,r.id).catch(()=>{})})}var M=(u=>(u.WINDOW_RESIZED="tauri://resize",u.WINDOW_MOVED="tauri://move",u.WINDOW_CLOSE_REQUESTED="tauri://close-requested",u.WINDOW_CREATED="tauri://window-created",u.WINDOW_DESTROYED="tauri://destroyed",u.WINDOW_FOCUS="tauri://focus",u.WINDOW_BLUR="tauri://blur",u.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",u.WINDOW_THEME_CHANGED="tauri://theme-changed",u.WINDOW_FILE_DROP="tauri://file-drop",u.WINDOW_FILE_DROP_HOVER="tauri://file-drop-hover",u.WINDOW_FILE_DROP_CANCELLED="tauri://file-drop-cancelled",u.MENU="tauri://menu",u.CHECK_UPDATE="tauri://update",u.UPDATE_AVAILABLE="tauri://update-available",u.INSTALL_UPDATE="tauri://update-install",u.STATUS_UPDATE="tauri://update-status",u.DOWNLOAD_PROGRESS="tauri://update-download-progress",u))(M||{});async function N(n,e){return b(n,null,e)}async function H(n,e){return v(n,null,e)}async function T(n,e){return w(n,void 0,e)}var j={};c(j,{BaseDirectory:()=>O,Dir:()=>O,copyFile:()=>ze,createDir:()=>Ue,exists:()=>Ve,readBinaryFile:()=>xe,readDir:()=>ke,readTextFile:()=>We,removeDir:()=>Ie,removeFile:()=>Ne,renameFile:()=>He,writeBinaryFile:()=>Re,writeFile:()=>Le,writeTextFile:()=>Le});var O=(o=>(o[o.Audio=1]="Audio",o[o.Cache=2]="Cache",o[o.Config=3]="Config",o[o.Data=4]="Data",o[o.LocalData=5]="LocalData",o[o.Desktop=6]="Desktop",o[o.Document=7]="Document",o[o.Download=8]="Download",o[o.Executable=9]="Executable",o[o.Font=10]="Font",o[o.Home=11]="Home",o[o.Picture=12]="Picture",o[o.Public=13]="Public",o[o.Runtime=14]="Runtime",o[o.Template=15]="Template",o[o.Video=16]="Video",o[o.Resource=17]="Resource",o[o.App=18]="App",o[o.Log=19]="Log",o[o.Temp=20]="Temp",o[o.AppConfig=21]="AppConfig",o[o.AppData=22]="AppData",o[o.AppLocalData=23]="AppLocalData",o[o.AppCache=24]="AppCache",o[o.AppLog=25]="AppLog",o))(O||{});async function We(n,e={}){return i({__tauriModule:"Fs",message:{cmd:"readTextFile",path:n,options:e}})}async function xe(n,e={}){let t=await i({__tauriModule:"Fs",message:{cmd:"readFile",path:n,options:e}});return Uint8Array.from(t)}async function Le(n,e,t){typeof t=="object"&&Object.freeze(t),typeof n=="object"&&Object.freeze(n);let r={path:"",contents:""},s=t;return typeof n=="string"?r.path=n:(r.path=n.path,r.contents=n.contents),typeof e=="string"?r.contents=e??"":s=e,i({__tauriModule:"Fs",message:{cmd:"writeFile",path:r.path,contents:Array.from(new TextEncoder().encode(r.contents)),options:s}})}async function Re(n,e,t){typeof t=="object"&&Object.freeze(t),typeof n=="object"&&Object.freeze(n);let r={path:"",contents:[]},s=t;return typeof n=="string"?r.path=n:(r.path=n.path,r.contents=n.contents),e&&"dir"in e?s=e:typeof n=="string"&&(r.contents=e??[]),i({__tauriModule:"Fs",message:{cmd:"writeFile",path:r.path,contents:Array.from(r.contents instanceof ArrayBuffer?new Uint8Array(r.contents):r.contents),options:s}})}async function ke(n,e={}){return i({__tauriModule:"Fs",message:{cmd:"readDir",path:n,options:e}})}async function Ue(n,e={}){return i({__tauriModule:"Fs",message:{cmd:"createDir",path:n,options:e}})}async function Ie(n,e={}){return i({__tauriModule:"Fs",message:{cmd:"removeDir",path:n,options:e}})}async function ze(n,e,t={}){return i({__tauriModule:"Fs",message:{cmd:"copyFile",source:n,destination:e,options:t}})}async function Ne(n,e={}){return i({__tauriModule:"Fs",message:{cmd:"removeFile",path:n,options:e}})}async function He(n,e,t={}){return i({__tauriModule:"Fs",message:{cmd:"renameFile",oldPath:n,newPath:e,options:t}})}async function Ve(n,e={}){return i({__tauriModule:"Fs",message:{cmd:"exists",path:n,options:e}})}var q={};c(q,{isRegistered:()=>Ge,register:()=>je,registerAll:()=>qe,unregister:()=>$e,unregisterAll:()=>Je});async function je(n,e){return i({__tauriModule:"GlobalShortcut",message:{cmd:"register",shortcut:n,handler:d(e)}})}async function qe(n,e){return i({__tauriModule:"GlobalShortcut",message:{cmd:"registerAll",shortcuts:n,handler:d(e)}})}async function Ge(n){return i({__tauriModule:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:n}})}async function $e(n){return i({__tauriModule:"GlobalShortcut",message:{cmd:"unregister",shortcut:n}})}async function Je(){return i({__tauriModule:"GlobalShortcut",message:{cmd:"unregisterAll"}})}var $={};c($,{Body:()=>p,Client:()=>E,Response:()=>F,ResponseType:()=>re,fetch:()=>Ke,getClient:()=>se});var re=(r=>(r[r.JSON=1]="JSON",r[r.Text=2]="Text",r[r.Binary=3]="Binary",r))(re||{}),p=class{constructor(e,t){this.type=e,this.payload=t}static form(e){let t={},r=(s,a)=>{if(a!==null){let l;typeof a=="string"?l=a:a instanceof Uint8Array||Array.isArray(a)?l=Array.from(a):a instanceof File?l={file:a.name,mime:a.type,fileName:a.name}:typeof a.file=="string"?l={file:a.file,mime:a.mime,fileName:a.fileName}:l={file:Array.from(a.file),mime:a.mime,fileName:a.fileName},t[String(s)]=l}};if(e instanceof FormData)for(let[s,a]of e)r(s,a);else for(let[s,a]of Object.entries(e))r(s,a);return new p("Form",t)}static json(e){return new p("Json",e)}static text(e){return new p("Text",e)}static bytes(e){return new p("Bytes",Array.from(e instanceof ArrayBuffer?new Uint8Array(e):e))}},F=class{constructor(e){this.url=e.url,this.status=e.status,this.ok=this.status>=200&&this.status<300,this.headers=e.headers,this.rawHeaders=e.rawHeaders,this.data=e.data}},E=class{constructor(e){this.id=e}async drop(){return i({__tauriModule:"Http",message:{cmd:"dropClient",client:this.id}})}async request(e){let t=!e.responseType||e.responseType===1;return t&&(e.responseType=2),i({__tauriModule:"Http",message:{cmd:"httpRequest",client:this.id,options:e}}).then(r=>{let s=new F(r);if(t){try{s.data=JSON.parse(s.data)}catch(a){if(s.ok&&s.data==="")s.data={};else if(s.ok)throw Error(`Failed to parse response \`${s.data}\` as JSON: ${a}; + try setting the \`responseType\` option to \`ResponseType.Text\` or \`ResponseType.Binary\` if the API does not return a JSON response.`)}return s}return s})}async get(e,t){return this.request({method:"GET",url:e,...t})}async post(e,t,r){return this.request({method:"POST",url:e,body:t,...r})}async put(e,t,r){return this.request({method:"PUT",url:e,body:t,...r})}async patch(e,t){return this.request({method:"PATCH",url:e,...t})}async delete(e,t){return this.request({method:"DELETE",url:e,...t})}};async function se(n){return i({__tauriModule:"Http",message:{cmd:"createClient",options:n}}).then(e=>new E(e))}var G=null;async function Ke(n,e){return G===null&&(G=await se()),G.request({url:n,method:e?.method??"GET",...e})}var J={};c(J,{isPermissionGranted:()=>Qe,requestPermission:()=>Ye,sendNotification:()=>Ze});async function Qe(){return window.Notification.permission!=="default"?Promise.resolve(window.Notification.permission==="granted"):i({__tauriModule:"Notification",message:{cmd:"isNotificationPermissionGranted"}})}async function Ye(){return window.Notification.requestPermission()}function Ze(n){typeof n=="string"?new window.Notification(n):new window.Notification(n.title,n)}var K={};c(K,{BaseDirectory:()=>O,appCacheDir:()=>tt,appConfigDir:()=>ae,appDataDir:()=>Be,appDir:()=>Xe,appLocalDataDir:()=>et,appLogDir:()=>oe,audioDir:()=>nt,basename:()=>Ct,cacheDir:()=>it,configDir:()=>rt,dataDir:()=>st,delimiter:()=>vt,desktopDir:()=>at,dirname:()=>Ft,documentDir:()=>ot,downloadDir:()=>lt,executableDir:()=>ut,extname:()=>Et,fontDir:()=>ct,homeDir:()=>dt,isAbsolute:()=>At,join:()=>Ot,localDataDir:()=>mt,logDir:()=>Pt,normalize:()=>Tt,pictureDir:()=>pt,publicDir:()=>gt,resolve:()=>Mt,resolveResource:()=>yt,resourceDir:()=>ht,runtimeDir:()=>ft,sep:()=>wt,templateDir:()=>bt,videoDir:()=>_t});function _(){return navigator.appVersion.includes("Win")}async function Xe(){return ae()}async function ae(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:21}})}async function Be(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:22}})}async function et(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:23}})}async function tt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:24}})}async function nt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:1}})}async function it(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:2}})}async function rt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:3}})}async function st(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:4}})}async function at(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:6}})}async function ot(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:7}})}async function lt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:8}})}async function ut(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:9}})}async function ct(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:10}})}async function dt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:11}})}async function mt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:5}})}async function pt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:12}})}async function gt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:13}})}async function ht(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:17}})}async function yt(n){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:n,directory:17}})}async function ft(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:14}})}async function bt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:15}})}async function _t(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:16}})}async function Pt(){return oe()}async function oe(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:25}})}var wt=_()?"\\":"/",vt=_()?";":":";async function Mt(...n){return i({__tauriModule:"Path",message:{cmd:"resolve",paths:n}})}async function Tt(n){return i({__tauriModule:"Path",message:{cmd:"normalize",path:n}})}async function Ot(...n){return i({__tauriModule:"Path",message:{cmd:"join",paths:n}})}async function Ft(n){return i({__tauriModule:"Path",message:{cmd:"dirname",path:n}})}async function Et(n){return i({__tauriModule:"Path",message:{cmd:"extname",path:n}})}async function Ct(n,e){return i({__tauriModule:"Path",message:{cmd:"basename",path:n,ext:e}})}async function At(n){return i({__tauriModule:"Path",message:{cmd:"isAbsolute",path:n}})}var Q={};c(Q,{exit:()=>Dt,relaunch:()=>St});async function Dt(n=0){return i({__tauriModule:"Process",message:{cmd:"exit",exitCode:n}})}async function St(){return i({__tauriModule:"Process",message:{cmd:"relaunch"}})}var Y={};c(Y,{Child:()=>C,Command:()=>P,EventEmitter:()=>g,open:()=>xt});async function Wt(n,e,t=[],r){return typeof t=="object"&&Object.freeze(t),i({__tauriModule:"Shell",message:{cmd:"execute",program:e,args:t,options:r,onEventFn:d(n)}})}var g=class{constructor(){this.eventListeners=Object.create(null)}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}on(e,t){return e in this.eventListeners?this.eventListeners[e].push(t):this.eventListeners[e]=[t],this}once(e,t){let r=(...s)=>{this.removeListener(e,r),t(...s)};return this.addListener(e,r)}off(e,t){return e in this.eventListeners&&(this.eventListeners[e]=this.eventListeners[e].filter(r=>r!==t)),this}removeAllListeners(e){return e?delete this.eventListeners[e]:this.eventListeners=Object.create(null),this}emit(e,...t){if(e in this.eventListeners){let r=this.eventListeners[e];for(let s of r)s(...t);return!0}return!1}listenerCount(e){return e in this.eventListeners?this.eventListeners[e].length:0}prependListener(e,t){return e in this.eventListeners?this.eventListeners[e].unshift(t):this.eventListeners[e]=[t],this}prependOnceListener(e,t){let r=(...s)=>{this.removeListener(e,r),t(...s)};return this.prependListener(e,r)}},C=class{constructor(e){this.pid=e}async write(e){return i({__tauriModule:"Shell",message:{cmd:"stdinWrite",pid:this.pid,buffer:typeof e=="string"?e:Array.from(e)}})}async kill(){return i({__tauriModule:"Shell",message:{cmd:"killChild",pid:this.pid}})}},P=class extends g{constructor(t,r=[],s){super();this.stdout=new g;this.stderr=new g;this.program=t,this.args=typeof r=="string"?[r]:r,this.options=s??{}}static sidecar(t,r=[],s){let a=new P(t,r,s);return a.options.sidecar=!0,a}async spawn(){return Wt(t=>{switch(t.event){case"Error":this.emit("error",t.payload);break;case"Terminated":this.emit("close",t.payload);break;case"Stdout":this.stdout.emit("data",t.payload);break;case"Stderr":this.stderr.emit("data",t.payload);break}},this.program,this.args,this.options).then(t=>new C(t))}async execute(){return new Promise((t,r)=>{this.on("error",r);let s=[],a=[];this.stdout.on("data",l=>{s.push(l)}),this.stderr.on("data",l=>{a.push(l)}),this.on("close",l=>{t({code:l.code,signal:l.signal,stdout:s.join(` `),stderr:a.join(` -`)})}),this.spawn().catch(r)})}};async function xt(n,e){return i({__tauriModule:"Shell",message:{cmd:"open",path:n,with:e}})}var X={};c(X,{checkUpdate:()=>Rt,installUpdate:()=>Lt,onUpdaterEvent:()=>Y});async function Y(n){return z("tauri://update-status",e=>{n(e==null?void 0:e.payload)})}async function Lt(){let n;function e(){n&&n(),n=void 0}return new Promise((t,r)=>{function s(a){if(a.error)return e(),r(a.error);if(a.status==="DONE")return e(),t()}Y(s).then(a=>{n=a}).catch(a=>{throw e(),a}),T("tauri://update-install").catch(a=>{throw e(),a})})}async function Rt(){let n;function e(){n&&n(),n=void 0}return new Promise((t,r)=>{function s(l){return e(),t({manifest:l,shouldUpdate:!0})}function a(l){if(l.error)return e(),r(l.error);if(l.status==="UPTODATE")return e(),t({shouldUpdate:!1})}H("tauri://update-available",l=>{s(l==null?void 0:l.payload)}).catch(l=>{throw e(),l}),Y(a).then(l=>{n=l}).catch(l=>{throw e(),l}),T("tauri://update").catch(l=>{throw e(),l})})}var te={};c(te,{CloseRequestedEvent:()=>x,LogicalPosition:()=>D,LogicalSize:()=>C,PhysicalPosition:()=>y,PhysicalSize:()=>h,UserAttentionType:()=>ue,WebviewWindow:()=>m,WebviewWindowHandle:()=>S,WindowManager:()=>W,appWindow:()=>B,availableMonitors:()=>Nt,currentMonitor:()=>kt,getAll:()=>ce,getCurrent:()=>Ut,primaryMonitor:()=>It});var C=class{constructor(e,t){this.type="Logical";this.width=e,this.height=t}},h=class{constructor(e,t){this.type="Physical";this.width=e,this.height=t}toLogical(e){return new C(this.width/e,this.height/e)}},D=class{constructor(e,t){this.type="Logical";this.x=e,this.y=t}},y=class{constructor(e,t){this.type="Physical";this.x=e,this.y=t}toLogical(e){return new D(this.x/e,this.y/e)}},ue=(t=>(t[t.Critical=1]="Critical",t[t.Informational=2]="Informational",t))(ue||{});function Ut(){return new m(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0})}function ce(){return window.__TAURI_METADATA__.__windows.map(n=>new m(n.label,{skip:!0}))}var le=["tauri://created","tauri://error"],S=class{constructor(e){this.label=e,this.listeners=Object.create(null)}async listen(e,t){return this._handleTauriEvent(e,t)?Promise.resolve(()=>{let r=this.listeners[e];r.splice(r.indexOf(t),1)}):_(e,this.label,t)}async once(e,t){return this._handleTauriEvent(e,t)?Promise.resolve(()=>{let r=this.listeners[e];r.splice(r.indexOf(t),1)}):v(e,this.label,t)}async emit(e,t){if(le.includes(e)){for(let r of this.listeners[e]||[])r({event:e,id:-1,windowLabel:this.label,payload:t});return Promise.resolve()}return w(e,this.label,t)}_handleTauriEvent(e,t){return le.includes(e)?(e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t],!0):!1}},W=class extends S{async scaleFactor(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"scaleFactor"}}}})}async innerPosition(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerPosition"}}}}).then(({x:e,y:t})=>new y(e,t))}async outerPosition(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerPosition"}}}}).then(({x:e,y:t})=>new y(e,t))}async innerSize(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerSize"}}}}).then(({width:e,height:t})=>new h(e,t))}async outerSize(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerSize"}}}}).then(({width:e,height:t})=>new h(e,t))}async isFullscreen(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isFullscreen"}}}})}async isMaximized(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isMaximized"}}}})}async isDecorated(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isDecorated"}}}})}async isResizable(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isResizable"}}}})}async isVisible(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isVisible"}}}})}async theme(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"theme"}}}})}async center(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"center"}}}})}async requestUserAttention(e){let t=null;return e&&(e===1?t={type:"Critical"}:t={type:"Informational"}),i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"requestUserAttention",payload:t}}}})}async setResizable(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setResizable",payload:e}}}})}async setTitle(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setTitle",payload:e}}}})}async maximize(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"maximize"}}}})}async unmaximize(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unmaximize"}}}})}async toggleMaximize(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"toggleMaximize"}}}})}async minimize(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"minimize"}}}})}async unminimize(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unminimize"}}}})}async show(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"show"}}}})}async hide(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"hide"}}}})}async close(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"close"}}}})}async setDecorations(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setDecorations",payload:e}}}})}async setAlwaysOnTop(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setAlwaysOnTop",payload:e}}}})}async setSize(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setSize",payload:{type:e.type,data:{width:e.width,height:e.height}}}}}})}async setMinSize(e){if(e&&e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMinSize",payload:e?{type:e.type,data:{width:e.width,height:e.height}}:null}}}})}async setMaxSize(e){if(e&&e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMaxSize",payload:e?{type:e.type,data:{width:e.width,height:e.height}}:null}}}})}async setPosition(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setPosition",payload:{type:e.type,data:{x:e.x,y:e.y}}}}}})}async setFullscreen(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFullscreen",payload:e}}}})}async setFocus(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFocus"}}}})}async setIcon(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setIcon",payload:{icon:typeof e=="string"?e:Array.from(e)}}}}})}async setSkipTaskbar(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setSkipTaskbar",payload:e}}}})}async setCursorGrab(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorGrab",payload:e}}}})}async setCursorVisible(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorVisible",payload:e}}}})}async setCursorIcon(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorIcon",payload:e}}}})}async setCursorPosition(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorPosition",payload:{type:e.type,data:{x:e.x,y:e.y}}}}}})}async setIgnoreCursorEvents(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setIgnoreCursorEvents",payload:e}}}})}async startDragging(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"startDragging"}}}})}async onResized(e){return this.listen("tauri://resize",e)}async onMoved(e){return this.listen("tauri://move",e)}async onCloseRequested(e){return this.listen("tauri://close-requested",t=>{let r=new x(t);Promise.resolve(e(r)).then(()=>{if(!r.isPreventDefault())return this.close()})})}async onFocusChanged(e){let t=await this.listen("tauri://focus",s=>{e({...s,payload:!0})}),r=await this.listen("tauri://blur",s=>{e({...s,payload:!1})});return()=>{t(),r()}}async onScaleChanged(e){return this.listen("tauri://scale-change",e)}async onMenuClicked(e){return this.listen("tauri://menu",e)}async onFileDropEvent(e){let t=await this.listen("tauri://file-drop",a=>{e({...a,payload:{type:"drop",paths:a.payload}})}),r=await this.listen("tauri://file-drop-hover",a=>{e({...a,payload:{type:"hover",paths:a.payload}})}),s=await this.listen("tauri://file-drop-cancelled",a=>{e({...a,payload:{type:"cancel"}})});return()=>{t(),r(),s()}}async onThemeChanged(e){return this.listen("tauri://theme-changed",e)}},x=class{constructor(e){this._preventDefault=!1;this.event=e.event,this.windowLabel=e.windowLabel,this.id=e.id}preventDefault(){this._preventDefault=!0}isPreventDefault(){return this._preventDefault}},m=class extends W{constructor(e,t={}){super(e),t!=null&&t.skip||i({__tauriModule:"Window",message:{cmd:"createWebview",data:{options:{label:e,...t}}}}).then(async()=>this.emit("tauri://created")).catch(async r=>this.emit("tauri://error",r))}static getByLabel(e){return ce().some(t=>t.label===e)?new m(e,{skip:!0}):null}},B;"__TAURI_METADATA__"in window?B=new m(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0}):(console.warn(`Could not find "window.__TAURI_METADATA__". The "appWindow" value will reference the "main" window label. -Note that this is not an issue if running this frontend on a browser instead of a Tauri window.`),B=new m("main",{skip:!0}));function ee(n){return n===null?null:{name:n.name,scaleFactor:n.scaleFactor,position:new y(n.position.x,n.position.y),size:new h(n.size.width,n.size.height)}}async function kt(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"currentMonitor"}}}}).then(ee)}async function It(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"primaryMonitor"}}}}).then(ee)}async function Nt(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"availableMonitors"}}}}).then(n=>n.map(ee))}var ne={};c(ne,{EOL:()=>zt,arch:()=>qt,platform:()=>Ht,tempdir:()=>Gt,type:()=>jt,version:()=>Vt});var zt=b()?`\r +`)})}),this.spawn().catch(r)})}};async function xt(n,e){return i({__tauriModule:"Shell",message:{cmd:"open",path:n,with:e}})}var X={};c(X,{checkUpdate:()=>Rt,installUpdate:()=>Lt,onUpdaterEvent:()=>Z});async function Z(n){return N("tauri://update-status",e=>{n(e?.payload)})}async function Lt(){let n;function e(){n&&n(),n=void 0}return new Promise((t,r)=>{function s(a){if(a.error){e(),r(a.error);return}a.status==="DONE"&&(e(),t())}Z(s).then(a=>{n=a}).catch(a=>{throw e(),a}),T("tauri://update-install").catch(a=>{throw e(),a})})}async function Rt(){let n;function e(){n&&n(),n=void 0}return new Promise((t,r)=>{function s(l){e(),t({manifest:l,shouldUpdate:!0})}function a(l){if(l.error){e(),r(l.error);return}l.status==="UPTODATE"&&(e(),t({shouldUpdate:!1}))}H("tauri://update-available",l=>{s(l?.payload)}).catch(l=>{throw e(),l}),Z(a).then(l=>{n=l}).catch(l=>{throw e(),l}),T("tauri://update").catch(l=>{throw e(),l})})}var te={};c(te,{CloseRequestedEvent:()=>x,LogicalPosition:()=>D,LogicalSize:()=>A,PhysicalPosition:()=>y,PhysicalSize:()=>h,UserAttentionType:()=>ue,WebviewWindow:()=>m,WebviewWindowHandle:()=>S,WindowManager:()=>W,appWindow:()=>B,availableMonitors:()=>zt,currentMonitor:()=>Ut,getAll:()=>ce,getCurrent:()=>kt,primaryMonitor:()=>It});var A=class{constructor(e,t){this.type="Logical";this.width=e,this.height=t}},h=class{constructor(e,t){this.type="Physical";this.width=e,this.height=t}toLogical(e){return new A(this.width/e,this.height/e)}},D=class{constructor(e,t){this.type="Logical";this.x=e,this.y=t}},y=class{constructor(e,t){this.type="Physical";this.x=e,this.y=t}toLogical(e){return new D(this.x/e,this.y/e)}},ue=(t=>(t[t.Critical=1]="Critical",t[t.Informational=2]="Informational",t))(ue||{});function kt(){return new m(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0})}function ce(){return window.__TAURI_METADATA__.__windows.map(n=>new m(n.label,{skip:!0}))}var le=["tauri://created","tauri://error"],S=class{constructor(e){this.label=e,this.listeners=Object.create(null)}async listen(e,t){return this._handleTauriEvent(e,t)?Promise.resolve(()=>{let r=this.listeners[e];r.splice(r.indexOf(t),1)}):b(e,this.label,t)}async once(e,t){return this._handleTauriEvent(e,t)?Promise.resolve(()=>{let r=this.listeners[e];r.splice(r.indexOf(t),1)}):v(e,this.label,t)}async emit(e,t){if(le.includes(e)){for(let r of this.listeners[e]||[])r({event:e,id:-1,windowLabel:this.label,payload:t});return Promise.resolve()}return w(e,this.label,t)}_handleTauriEvent(e,t){return le.includes(e)?(e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t],!0):!1}},W=class extends S{async scaleFactor(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"scaleFactor"}}}})}async innerPosition(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerPosition"}}}}).then(({x:e,y:t})=>new y(e,t))}async outerPosition(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerPosition"}}}}).then(({x:e,y:t})=>new y(e,t))}async innerSize(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerSize"}}}}).then(({width:e,height:t})=>new h(e,t))}async outerSize(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerSize"}}}}).then(({width:e,height:t})=>new h(e,t))}async isFullscreen(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isFullscreen"}}}})}async isMinimized(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isMinimized"}}}})}async isMaximized(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isMaximized"}}}})}async isDecorated(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isDecorated"}}}})}async isResizable(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isResizable"}}}})}async isVisible(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isVisible"}}}})}async title(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"title"}}}})}async theme(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"theme"}}}})}async center(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"center"}}}})}async requestUserAttention(e){let t=null;return e&&(e===1?t={type:"Critical"}:t={type:"Informational"}),i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"requestUserAttention",payload:t}}}})}async setResizable(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setResizable",payload:e}}}})}async setTitle(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setTitle",payload:e}}}})}async maximize(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"maximize"}}}})}async unmaximize(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unmaximize"}}}})}async toggleMaximize(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"toggleMaximize"}}}})}async minimize(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"minimize"}}}})}async unminimize(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unminimize"}}}})}async show(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"show"}}}})}async hide(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"hide"}}}})}async close(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"close"}}}})}async setDecorations(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setDecorations",payload:e}}}})}async setAlwaysOnTop(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setAlwaysOnTop",payload:e}}}})}async setContentProtected(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setContentProtected",payload:e}}}})}async setSize(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setSize",payload:{type:e.type,data:{width:e.width,height:e.height}}}}}})}async setMinSize(e){if(e&&e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMinSize",payload:e?{type:e.type,data:{width:e.width,height:e.height}}:null}}}})}async setMaxSize(e){if(e&&e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMaxSize",payload:e?{type:e.type,data:{width:e.width,height:e.height}}:null}}}})}async setPosition(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setPosition",payload:{type:e.type,data:{x:e.x,y:e.y}}}}}})}async setFullscreen(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFullscreen",payload:e}}}})}async setFocus(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFocus"}}}})}async setIcon(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setIcon",payload:{icon:typeof e=="string"?e:Array.from(e)}}}}})}async setSkipTaskbar(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setSkipTaskbar",payload:e}}}})}async setCursorGrab(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorGrab",payload:e}}}})}async setCursorVisible(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorVisible",payload:e}}}})}async setCursorIcon(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorIcon",payload:e}}}})}async setCursorPosition(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorPosition",payload:{type:e.type,data:{x:e.x,y:e.y}}}}}})}async setIgnoreCursorEvents(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setIgnoreCursorEvents",payload:e}}}})}async startDragging(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"startDragging"}}}})}async onResized(e){return this.listen("tauri://resize",e)}async onMoved(e){return this.listen("tauri://move",e)}async onCloseRequested(e){return this.listen("tauri://close-requested",t=>{let r=new x(t);Promise.resolve(e(r)).then(()=>{if(!r.isPreventDefault())return this.close()})})}async onFocusChanged(e){let t=await this.listen("tauri://focus",s=>{e({...s,payload:!0})}),r=await this.listen("tauri://blur",s=>{e({...s,payload:!1})});return()=>{t(),r()}}async onScaleChanged(e){return this.listen("tauri://scale-change",e)}async onMenuClicked(e){return this.listen("tauri://menu",e)}async onFileDropEvent(e){let t=await this.listen("tauri://file-drop",a=>{e({...a,payload:{type:"drop",paths:a.payload}})}),r=await this.listen("tauri://file-drop-hover",a=>{e({...a,payload:{type:"hover",paths:a.payload}})}),s=await this.listen("tauri://file-drop-cancelled",a=>{e({...a,payload:{type:"cancel"}})});return()=>{t(),r(),s()}}async onThemeChanged(e){return this.listen("tauri://theme-changed",e)}},x=class{constructor(e){this._preventDefault=!1;this.event=e.event,this.windowLabel=e.windowLabel,this.id=e.id}preventDefault(){this._preventDefault=!0}isPreventDefault(){return this._preventDefault}},m=class extends W{constructor(e,t={}){super(e),t?.skip||i({__tauriModule:"Window",message:{cmd:"createWebview",data:{options:{label:e,...t}}}}).then(async()=>this.emit("tauri://created")).catch(async r=>this.emit("tauri://error",r))}static getByLabel(e){return ce().some(t=>t.label===e)?new m(e,{skip:!0}):null}},B;"__TAURI_METADATA__"in window?B=new m(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0}):(console.warn(`Could not find "window.__TAURI_METADATA__". The "appWindow" value will reference the "main" window label. +Note that this is not an issue if running this frontend on a browser instead of a Tauri window.`),B=new m("main",{skip:!0}));function ee(n){return n===null?null:{name:n.name,scaleFactor:n.scaleFactor,position:new y(n.position.x,n.position.y),size:new h(n.size.width,n.size.height)}}async function Ut(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"currentMonitor"}}}}).then(ee)}async function It(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"primaryMonitor"}}}}).then(ee)}async function zt(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"availableMonitors"}}}}).then(n=>n.map(ee))}var ne={};c(ne,{EOL:()=>Nt,arch:()=>qt,platform:()=>Ht,tempdir:()=>Gt,type:()=>jt,version:()=>Vt});var Nt=_()?`\r `:` `;async function Ht(){return i({__tauriModule:"Os",message:{cmd:"platform"}})}async function Vt(){return i({__tauriModule:"Os",message:{cmd:"version"}})}async function jt(){return i({__tauriModule:"Os",message:{cmd:"osType"}})}async function qt(){return i({__tauriModule:"Os",message:{cmd:"arch"}})}async function Gt(){return i({__tauriModule:"Os",message:{cmd:"tempdir"}})}var $t=f;return he(Jt);})(); window.__TAURI__ = __TAURI_IIFE__ diff --git a/core/tauri/scripts/bundle.js b/core/tauri/scripts/bundle.js new file mode 100644 index 000000000..4a7da586b --- /dev/null +++ b/core/tauri/scripts/bundle.js @@ -0,0 +1 @@ +function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_setPrototypeOf(e,t)}function _createSuper(e){var t=_isNativeReflectConstruct();return function(){var r,n=_getPrototypeOf(e);if(t){var a=_getPrototypeOf(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return _possibleConstructorReturn(this,r)}}function _possibleConstructorReturn(e,t){if(t&&("object"===_typeof(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function _getPrototypeOf(e){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_getPrototypeOf(e)}function _createForOfIteratorHelper(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){u=!0,o=e},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var u=r.call(o,"catchLoc"),s=r.call(o,"finallyLoc");if(u&&s){if(this.prev=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),R(r),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;R(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:x(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},e}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r=0;--o){var i=this.tryEntries[o],u=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(s&&c){if(this.prev=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),P(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;P(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:A(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}("object"===("undefined"==typeof module?"undefined":_typeof(module))?module.exports:{});try{regeneratorRuntime=t}catch(e){"object"===("undefined"==typeof globalThis?"undefined":_typeof(globalThis))?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}function r(e){for(var t=void 0,r=e[0],n=1;n1&&void 0!==arguments[1]&&arguments[1],a=n(),o="_".concat(a);return Object.defineProperty(window,o,{value:function(n){return t&&Reflect.deleteProperty(window,o),r([e,"optionalCall",function(e){return e(n)}])},writable:!1,configurable:!0}),a}function o(e){return i.apply(this,arguments)}function i(){return i=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r,n=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",new Promise((function(e,n){var o=a((function(t){e(t),Reflect.deleteProperty(window,"_".concat(i))}),!0),i=a((function(e){n(e),Reflect.deleteProperty(window,"_".concat(o))}),!0);window.__TAURI_IPC__(_objectSpread({cmd:t,callback:o,error:i},r))})));case 2:case"end":return e.stop()}}),e)}))),i.apply(this,arguments)}var u=Object.freeze({__proto__:null,transformCallback:a,invoke:o,convertFileSrc:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"asset",r=encodeURIComponent(e);return navigator.userAgent.includes("Windows")?"https://".concat(t,".localhost/").concat(r):"".concat(t,"://").concat(r)}});function s(e){return c.apply(this,arguments)}function c(){return(c=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",o("tauri",t));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function p(){return(p=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"App",message:{cmd:"getAppVersion"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function l(){return(l=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"App",message:{cmd:"getAppName"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function f(){return(f=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"App",message:{cmd:"getTauriVersion"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var h=Object.freeze({__proto__:null,getName:function(){return l.apply(this,arguments)},getVersion:function(){return p.apply(this,arguments)},getTauriVersion:function(){return f.apply(this,arguments)}});function d(){return(d=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Cli",message:{cmd:"cliMatches"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var m=Object.freeze({__proto__:null,getMatches:function(){return d.apply(this,arguments)}});function _(){return(_=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Clipboard",message:{cmd:"writeText",data:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function y(){return(y=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Clipboard",message:{cmd:"readText",data:null}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var g=Object.freeze({__proto__:null,writeText:function(e){return _.apply(this,arguments)},readText:function(){return y.apply(this,arguments)}});function v(e,t){return null!=e?e:t()}function w(e){for(var t=void 0,r=e[0],n=1;n0&&void 0!==r[0]?r[0]:{})&&Object.freeze(t),e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"openDialog",options:t}}));case 3:case"end":return e.stop()}}),e)}))),b.apply(this,arguments)}function R(){return R=_asyncToGenerator(_regeneratorRuntime().mark((function e(){var t,r=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"object"===_typeof(t=r.length>0&&void 0!==r[0]?r[0]:{})&&Object.freeze(t),e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"saveDialog",options:t}}));case 3:case"end":return e.stop()}}),e)}))),R.apply(this,arguments)}function k(){return k=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){var n;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n="string"==typeof r?{title:r}:r,e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"messageDialog",message:t.toString(),title:w([n,"optionalAccess",function(e){return e.title},"optionalAccess",function(e){return e.toString},"call",function(e){return e()}]),type:w([n,"optionalAccess",function(e){return e.type}]),buttonLabel:w([n,"optionalAccess",function(e){return e.okLabel},"optionalAccess",function(e){return e.toString},"call",function(e){return e()}])}}));case 2:case"end":return e.stop()}}),e)}))),k.apply(this,arguments)}function x(){return x=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){var n;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n="string"==typeof r?{title:r}:r,e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"askDialog",message:t.toString(),title:w([n,"optionalAccess",function(e){return e.title},"optionalAccess",function(e){return e.toString},"call",function(e){return e()}]),type:w([n,"optionalAccess",function(e){return e.type}]),buttonLabels:[v(w([n,"optionalAccess",function(e){return e.okLabel},"optionalAccess",function(e){return e.toString},"call",function(e){return e()}]),(function(){return"Yes"})),v(w([n,"optionalAccess",function(e){return e.cancelLabel},"optionalAccess",function(e){return e.toString},"call",function(e){return e()}]),(function(){return"No"}))]}}));case 2:case"end":return e.stop()}}),e)}))),x.apply(this,arguments)}function T(){return T=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){var n;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n="string"==typeof r?{title:r}:r,e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"confirmDialog",message:t.toString(),title:w([n,"optionalAccess",function(e){return e.title},"optionalAccess",function(e){return e.toString},"call",function(e){return e()}]),type:w([n,"optionalAccess",function(e){return e.type}]),buttonLabels:[v(w([n,"optionalAccess",function(e){return e.okLabel},"optionalAccess",function(e){return e.toString},"call",function(e){return e()}]),(function(){return"Ok"})),v(w([n,"optionalAccess",function(e){return e.cancelLabel},"optionalAccess",function(e){return e.toString},"call",function(e){return e()}]),(function(){return"Cancel"}))]}}));case 2:case"end":return e.stop()}}),e)}))),T.apply(this,arguments)}var G,P=Object.freeze({__proto__:null,open:function(){return b.apply(this,arguments)},save:function(){return R.apply(this,arguments)},message:function(e,t){return k.apply(this,arguments)},ask:function(e,t){return x.apply(this,arguments)},confirm:function(e,t){return T.apply(this,arguments)}});function O(e,t){return A.apply(this,arguments)}function A(){return A=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Event",message:{cmd:"unlisten",event:t,eventId:r}}));case 1:case"end":return e.stop()}}),e)}))),A.apply(this,arguments)}function L(e,t,r){return M.apply(this,arguments)}function M(){return M=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r,n){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s({__tauriModule:"Event",message:{cmd:"emit",event:t,windowLabel:r,payload:"string"==typeof n?n:JSON.stringify(n)}});case 2:case"end":return e.stop()}}),e)}))),M.apply(this,arguments)}function E(e,t,r){return D.apply(this,arguments)}function D(){return D=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r,n){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Event",message:{cmd:"listen",event:t,windowLabel:r,handler:a(n)}}).then((function(e){return _asyncToGenerator(_regeneratorRuntime().mark((function r(){return _regeneratorRuntime().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",O(t,e));case 1:case"end":return r.stop()}}),r)})))})));case 1:case"end":return e.stop()}}),e)}))),D.apply(this,arguments)}function C(e,t,r){return S.apply(this,arguments)}function S(){return S=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r,n){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",E(t,r,(function(e){n(e),O(t,e.id).catch((function(){}))})));case 1:case"end":return e.stop()}}),e)}))),S.apply(this,arguments)}function j(e,t){return W.apply(this,arguments)}function W(){return W=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",E(t,null,r));case 1:case"end":return e.stop()}}),e)}))),W.apply(this,arguments)}function N(e,t){return I.apply(this,arguments)}function I(){return I=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",C(t,null,r));case 1:case"end":return e.stop()}}),e)}))),I.apply(this,arguments)}function z(e,t){return F.apply(this,arguments)}function F(){return F=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",L(t,void 0,r));case 1:case"end":return e.stop()}}),e)}))),F.apply(this,arguments)}!function(e){e.WINDOW_RESIZED="tauri://resize";e.WINDOW_MOVED="tauri://move";e.WINDOW_CLOSE_REQUESTED="tauri://close-requested";e.WINDOW_CREATED="tauri://window-created";e.WINDOW_DESTROYED="tauri://destroyed";e.WINDOW_FOCUS="tauri://focus";e.WINDOW_BLUR="tauri://blur";e.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change";e.WINDOW_THEME_CHANGED="tauri://theme-changed";e.WINDOW_FILE_DROP="tauri://file-drop";e.WINDOW_FILE_DROP_HOVER="tauri://file-drop-hover";e.WINDOW_FILE_DROP_CANCELLED="tauri://file-drop-cancelled";e.MENU="tauri://menu";e.CHECK_UPDATE="tauri://update";e.UPDATE_AVAILABLE="tauri://update-available";e.INSTALL_UPDATE="tauri://update-install";e.STATUS_UPDATE="tauri://update-status";e.DOWNLOAD_PROGRESS="tauri://update-download-progress"}(G||(G={}));var U,H=Object.freeze({__proto__:null,listen:j,once:N,emit:z});function V(e,t){return null!=e?e:t()}function B(){return B=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r,n=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"readTextFile",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)}))),B.apply(this,arguments)}function q(){return q=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r,n,a=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>1&&void 0!==a[1]?a[1]:{},e.next=3,s({__tauriModule:"Fs",message:{cmd:"readFile",path:t,options:r}});case 3:return n=e.sent,e.abrupt("return",Uint8Array.from(n));case 5:case"end":return e.stop()}}),e)}))),q.apply(this,arguments)}function J(e,t,r){return Y.apply(this,arguments)}function Y(){return Y=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r,n){var a,o;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"object"===_typeof(n)&&Object.freeze(n),"object"===_typeof(t)&&Object.freeze(t),a={path:"",contents:""},o=n,"string"==typeof t?a.path=t:(a.path=t.path,a.contents=t.contents),"string"==typeof r?a.contents=V(r,(function(){return""})):o=r,e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"writeFile",path:a.path,contents:Array.from((new TextEncoder).encode(a.contents)),options:o}}));case 7:case"end":return e.stop()}}),e)}))),Y.apply(this,arguments)}function K(){return K=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r,n){var a,o;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"object"===_typeof(n)&&Object.freeze(n),"object"===_typeof(t)&&Object.freeze(t),a={path:"",contents:[]},o=n,"string"==typeof t?a.path=t:(a.path=t.path,a.contents=t.contents),r&&"dir"in r?o=r:"string"==typeof t&&(a.contents=V(r,(function(){return[]}))),e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"writeFile",path:a.path,contents:Array.from(a.contents instanceof ArrayBuffer?new Uint8Array(a.contents):a.contents),options:o}}));case 7:case"end":return e.stop()}}),e)}))),K.apply(this,arguments)}function Q(){return Q=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r,n=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"readDir",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)}))),Q.apply(this,arguments)}function Z(){return Z=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r,n=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"createDir",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)}))),Z.apply(this,arguments)}function $(){return $=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r,n=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"removeDir",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)}))),$.apply(this,arguments)}function X(){return X=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){var n,a=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>2&&void 0!==a[2]?a[2]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"copyFile",source:t,destination:r,options:n}}));case 2:case"end":return e.stop()}}),e)}))),X.apply(this,arguments)}function ee(){return ee=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r,n=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"removeFile",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)}))),ee.apply(this,arguments)}function te(){return te=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){var n,a=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>2&&void 0!==a[2]?a[2]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"renameFile",oldPath:t,newPath:r,options:n}}));case 2:case"end":return e.stop()}}),e)}))),te.apply(this,arguments)}!function(e){e[e.Audio=1]="Audio";e[e.Cache=2]="Cache";e[e.Config=3]="Config";e[e.Data=4]="Data";e[e.LocalData=5]="LocalData";e[e.Desktop=6]="Desktop";e[e.Document=7]="Document";e[e.Download=8]="Download";e[e.Executable=9]="Executable";e[e.Font=10]="Font";e[e.Home=11]="Home";e[e.Picture=12]="Picture";e[e.Public=13]="Public";e[e.Runtime=14]="Runtime";e[e.Template=15]="Template";e[e.Video=16]="Video";e[e.Resource=17]="Resource";e[e.App=18]="App";e[e.Log=19]="Log";e[e.Temp=20]="Temp"}(U||(U={}));var re=Object.freeze({__proto__:null,get BaseDirectory(){return U},get Dir(){return U},readTextFile:function(e){return B.apply(this,arguments)},readBinaryFile:function(e){return q.apply(this,arguments)},writeTextFile:J,writeFile:J,writeBinaryFile:function(e,t,r){return K.apply(this,arguments)},readDir:function(e){return Q.apply(this,arguments)},createDir:function(e){return Z.apply(this,arguments)},removeDir:function(e){return $.apply(this,arguments)},copyFile:function(e,t){return X.apply(this,arguments)},removeFile:function(e){return ee.apply(this,arguments)},renameFile:function(e,t){return te.apply(this,arguments)}});function ne(){return(ne=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"register",shortcut:t,handler:a(r)}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ae(){return(ae=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"registerAll",shortcuts:t,handler:a(r)}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function oe(){return(oe=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ie(){return(ie=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"unregister",shortcut:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ue(){return(ue=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"unregisterAll"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var se,ce=Object.freeze({__proto__:null,register:function(e,t){return ne.apply(this,arguments)},registerAll:function(e,t){return ae.apply(this,arguments)},isRegistered:function(e){return oe.apply(this,arguments)},unregister:function(e){return ie.apply(this,arguments)},unregisterAll:function(){return ue.apply(this,arguments)}});function pe(e,t){return null!=e?e:t()}function le(e){for(var t=void 0,r=e[0],n=1;n=200&&this.status<300,this.headers=t.headers,this.rawHeaders=t.rawHeaders,this.data=t.data})),de=function(){function e(t){_classCallCheck(this,e),this.id=t}var t,r,n,a,o,i,u;return _createClass(e,[{key:"drop",value:(u=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Http",message:{cmd:"dropClient",client:this.id}}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return u.apply(this,arguments)})},{key:"request",value:(i=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=!t.responseType||t.responseType===se.JSON)&&(t.responseType=se.Text),e.abrupt("return",s({__tauriModule:"Http",message:{cmd:"httpRequest",client:this.id,options:t}}).then((function(e){var t=new he(e);if(r){try{t.data=JSON.parse(t.data)}catch(e){if(t.ok&&""===t.data)t.data={};else if(t.ok)throw Error("Failed to parse response `".concat(t.data,"` as JSON: ").concat(e,";\n try setting the `responseType` option to `ResponseType.Text` or `ResponseType.Binary` if the API does not return a JSON response."))}return t}return t})));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"get",value:(o=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"GET",url:t},r)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"post",value:(a=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r,n){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"POST",url:t,body:r},n)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return a.apply(this,arguments)})},{key:"put",value:(n=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r,n){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"PUT",url:t,body:r},n)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"patch",value:(r=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"PATCH",url:t},r)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"delete",value:(t=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"DELETE",url:t},r)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),e}();function me(e){return _e.apply(this,arguments)}function _e(){return(_e=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Http",message:{cmd:"createClient",options:t}}).then((function(e){return new de(e)})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ye=null;function ge(){return(ge=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==ye){e.next=4;break}return e.next=3,me();case 3:ye=e.sent;case 4:return e.abrupt("return",ye.request(_objectSpread({url:t,method:pe(le([r,"optionalAccess",function(e){return e.method}]),(function(){return"GET"}))},r)));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ve=Object.freeze({__proto__:null,getClient:me,fetch:function(e,t){return ge.apply(this,arguments)},Body:fe,Client:de,Response:he,get ResponseType(){return se}});function we(){return(we=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("default"===window.Notification.permission){e.next=2;break}return e.abrupt("return",Promise.resolve("granted"===window.Notification.permission));case 2:return e.abrupt("return",s({__tauriModule:"Notification",message:{cmd:"isNotificationPermissionGranted"}}));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function be(){return(be=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",window.Notification.requestPermission());case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Re=Object.freeze({__proto__:null,sendNotification:function(e){"string"==typeof e?new window.Notification(e):new window.Notification(e.title,e)},requestPermission:function(){return be.apply(this,arguments)},isPermissionGranted:function(){return we.apply(this,arguments)}});function ke(){return navigator.appVersion.includes("Win")}function xe(){return(xe=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:U.App}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Te(){return(Te=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:U.Audio}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ge(){return(Ge=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:U.Cache}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Pe(){return(Pe=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:U.Config}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Oe(){return(Oe=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:U.Data}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ae(){return(Ae=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:U.Desktop}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Le(){return(Le=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:U.Document}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Me(){return(Me=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:U.Download}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ee(){return(Ee=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:U.Executable}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function De(){return(De=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:U.Font}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ce(){return(Ce=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:U.Home}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Se(){return(Se=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:U.LocalData}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function je(){return(je=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:U.Picture}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function We(){return(We=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:U.Public}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ne(){return(Ne=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:U.Resource}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ie(){return(Ie=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:t,directory:U.Resource}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ze(){return(ze=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:U.Runtime}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Fe(){return(Fe=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:U.Template}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ue(){return(Ue=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:U.Video}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function He(){return(He=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:U.Log}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Ve=ke()?"\\":"/",Be=ke()?";":":";function qe(){return qe=_asyncToGenerator(_regeneratorRuntime().mark((function e(){var t,r,n,a=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t=a.length,r=new Array(t),n=0;n0&&void 0!==r[0]?r[0]:0,e.abrupt("return",s({__tauriModule:"Process",message:{cmd:"exit",exitCode:t}}));case 2:case"end":return e.stop()}}),e)}))),et.apply(this,arguments)}function tt(){return(tt=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Process",message:{cmd:"relaunch"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var rt=Object.freeze({__proto__:null,exit:function(){return et.apply(this,arguments)},relaunch:function(){return tt.apply(this,arguments)}});function nt(e,t){return null!=e?e:t()}function at(e,t){return ot.apply(this,arguments)}function ot(){return ot=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){var n,o,i=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.length>2&&void 0!==i[2]?i[2]:[],o=i.length>3?i[3]:void 0,"object"===_typeof(n)&&Object.freeze(n),e.abrupt("return",s({__tauriModule:"Shell",message:{cmd:"execute",program:r,args:n,options:o,onEventFn:a(t)}}));case 4:case"end":return e.stop()}}),e)}))),ot.apply(this,arguments)}var it=function(){function e(){_classCallCheck(this,e),e.prototype.__init.call(this)}return _createClass(e,[{key:"__init",value:function(){this.eventListeners=Object.create(null)}},{key:"addListener",value:function(e,t){return this.on(e,t)}},{key:"removeListener",value:function(e,t){return this.off(e,t)}},{key:"on",value:function(e,t){return e in this.eventListeners?this.eventListeners[e].push(t):this.eventListeners[e]=[t],this}},{key:"once",value:function(e,t){var r=this;return this.addListener(e,(function n(){r.removeListener(e,n),t.apply(void 0,arguments)}))}},{key:"off",value:function(e,t){return e in this.eventListeners&&(this.eventListeners[e]=this.eventListeners[e].filter((function(e){return e!==t}))),this}},{key:"removeAllListeners",value:function(e){return e?delete this.eventListeners[e]:this.eventListeners=Object.create(null),this}},{key:"emit",value:function(e){if(e in this.eventListeners){for(var t=this.eventListeners[e],r=arguments.length,n=new Array(r>1?r-1:0),a=1;a1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2?arguments[2]:void 0;return _classCallCheck(this,a),t=n.call(this),a.prototype.__init2.call(_assertThisInitialized(t)),a.prototype.__init3.call(_assertThisInitialized(t)),t.program=e,t.args="string"==typeof r?[r]:r,t.options=nt(o,(function(){return{}})),t}return _createClass(a,[{key:"__init2",value:function(){this.stdout=new it}},{key:"__init3",value:function(){this.stderr=new it}},{key:"spawn",value:(r=_asyncToGenerator(_regeneratorRuntime().mark((function e(){var t=this;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",at((function(e){switch(e.event){case"Error":t.emit("error",e.payload);break;case"Terminated":t.emit("close",e.payload);break;case"Stdout":t.stdout.emit("data",e.payload);break;case"Stderr":t.stderr.emit("data",e.payload)}}),this.program,this.args,this.options).then((function(e){return new ut(e)})));case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"execute",value:(t=_asyncToGenerator(_regeneratorRuntime().mark((function e(){var t=this;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){t.on("error",r);var n=[],a=[];t.stdout.on("data",(function(e){n.push(e)})),t.stderr.on("data",(function(e){a.push(e)})),t.on("close",(function(t){e({code:t.code,signal:t.signal,stdout:n.join("\n"),stderr:a.join("\n")})})),t.spawn().catch(r)})));case 1:case"end":return e.stop()}}),e)}))),function(){return t.apply(this,arguments)})}],[{key:"sidecar",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,n=new a(e,t,r);return n.options.sidecar=!0,n}}]),a}(it);function ct(){return ct=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Shell",message:{cmd:"open",path:t,with:r}}));case 1:case"end":return e.stop()}}),e)}))),ct.apply(this,arguments)}var pt=Object.freeze({__proto__:null,Command:st,Child:ut,EventEmitter:it,open:function(e,t){return ct.apply(this,arguments)}});function lt(e){for(var t=void 0,r=e[0],n=1;n1&&void 0!==arguments[1]?arguments[1]:{};return _classCallCheck(this,r),n=t.call(this,e),yt([a,"optionalAccess",function(e){return e.skip}])||s({__tauriModule:"Window",message:{cmd:"createWebview",data:{options:_objectSpread({label:e},a)}}}).then(_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",n.emit("tauri://created"));case 1:case"end":return e.stop()}}),e)})))).catch(function(){var e=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",n.emit("tauri://error",t));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),n}return _createClass(r,null,[{key:"getByLabel",value:function(e){return kt().some((function(t){return t.label===e}))?new r(e,{skip:!0}):null}}]),r}(Pt);function Lt(){return(Lt=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"currentMonitor"}}}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Mt(){return(Mt=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"primaryMonitor"}}}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Et(){return(Et=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"availableMonitors"}}}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}"__TAURI_METADATA__"in window?xt=new At(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0}):(console.warn('Could not find "window.__TAURI_METADATA__". The "appWindow" value will reference the "main" window label.\nNote that this is not an issue if running this frontend on a browser instead of a Tauri window.'),xt=new At("main",{skip:!0}));var Dt=Object.freeze({__proto__:null,WebviewWindow:At,WebviewWindowHandle:Gt,WindowManager:Pt,CloseRequestedEvent:Ot,getCurrent:function(){return new At(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0})},getAll:kt,get appWindow(){return xt},LogicalSize:vt,PhysicalSize:wt,LogicalPosition:bt,PhysicalPosition:Rt,get UserAttentionType(){return gt},currentMonitor:function(){return Lt.apply(this,arguments)},primaryMonitor:function(){return Mt.apply(this,arguments)},availableMonitors:function(){return Et.apply(this,arguments)}}),Ct=ke()?"\r\n":"\n";function St(){return(St=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"platform"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function jt(){return(jt=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"version"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Wt(){return(Wt=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"osType"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Nt(){return(Nt=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"arch"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function It(){return(It=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"tempdir"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var zt=Object.freeze({__proto__:null,EOL:Ct,platform:function(){return St.apply(this,arguments)},version:function(){return jt.apply(this,arguments)},type:function(){return Wt.apply(this,arguments)},arch:function(){return Nt.apply(this,arguments)},tempdir:function(){return It.apply(this,arguments)}}),Ft=o;e.app=h,e.cli=m,e.clipboard=g,e.dialog=P,e.event=H,e.fs=re,e.globalShortcut=ce,e.http=ve,e.invoke=Ft,e.notification=Re,e.os=zt,e.path=Xe,e.process=rt,e.shell=pt,e.tauri=u,e.updater=_t,e.window=Dt,Object.defineProperty(e,"__esModule",{value:!0})})); diff --git a/core/tauri/scripts/core.js b/core/tauri/scripts/core.js index bc1887495..634d1f6e9 100644 --- a/core/tauri/scripts/core.js +++ b/core/tauri/scripts/core.js @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -;(function () { +; (function () { function uid() { return window.crypto.getRandomValues(new Uint32Array(1))[0] } @@ -96,7 +96,7 @@ if (target.matches('a')) { if ( target.href && - target.href.startsWith('http') && + (['http://', 'https://', 'mailto:', 'tel:'].some(v => target.href.startsWith(v))) && target.target === '_blank' ) { window.__TAURI_INVOKE__('tauri', { @@ -136,6 +136,10 @@ if (e.target.hasAttribute('data-tauri-drag-region') && e.buttons === 1) { // prevents text cursor e.preventDefault() + // fix #2549: double click on drag region edge causes content to maximize without window sizing change + // https://github.com/tauri-apps/tauri/issues/2549#issuecomment-1250036908 + e.stopImmediatePropagation() + // start dragging if the element has a `tauri-drag-region` data attribute and maximize on double-clicking it window.__TAURI_INVOKE__('tauri', { __tauriModule: 'Window', @@ -151,15 +155,6 @@ } }) - listen('tauri://window-created', function (event) { - if (event.payload) { - var windowLabel = event.payload.label - window.__TAURI_METADATA__.__windows.push({ - label: windowLabel - }) - } - }) - let permissionSettable = false let permissionValue = 'default' diff --git a/core/tauri/src/api/dialog.rs b/core/tauri/src/api/dialog.rs index 313c075b2..b7e504085 100644 --- a/core/tauri/src/api/dialog.rs +++ b/core/tauri/src/api/dialog.rs @@ -171,7 +171,7 @@ macro_rules! message_dialog_builder { /// Options for action buttons on message dialogs. #[non_exhaustive] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum MessageDialogButtons { /// Ok button. Ok, @@ -179,6 +179,10 @@ pub enum MessageDialogButtons { OkCancel, /// Yes and No buttons. YesNo, + /// OK button with customized text. + OkWithLabel(String), + /// Ok and Cancel buttons with customized text. + OkCancelWithLabels(String, String), } impl From for rfd::MessageButtons { @@ -187,6 +191,10 @@ impl From for rfd::MessageButtons { MessageDialogButtons::Ok => Self::Ok, MessageDialogButtons::OkCancel => Self::OkCancel, MessageDialogButtons::YesNo => Self::YesNo, + MessageDialogButtons::OkWithLabel(ok_text) => Self::OkCustom(ok_text), + MessageDialogButtons::OkCancelWithLabels(ok_text, cancel_text) => { + Self::OkCancelCustom(ok_text, cancel_text) + } } } } diff --git a/core/tauri/src/api/dir.rs b/core/tauri/src/api/dir.rs index 771a8925e..77aa2323a 100644 --- a/core/tauri/src/api/dir.rs +++ b/core/tauri/src/api/dir.rs @@ -226,7 +226,7 @@ mod test { fn check_test_dir() { // create a callback closure that takes in a TempDir type and prints it. let callback = |td: &tempfile::TempDir| { - println!("{:?}", td); + println!("{td:?}"); }; // execute the with_temp_dir function on the callback diff --git a/core/tauri/src/api/file/extract.rs b/core/tauri/src/api/file/extract.rs index b343a4fc6..9e2eb76e8 100644 --- a/core/tauri/src/api/file/extract.rs +++ b/core/tauri/src/api/file/extract.rs @@ -150,7 +150,7 @@ impl<'a, R: std::fmt::Debug + Read + Seek> std::fmt::Debug for Extract<'a, R> { impl<'a, R: Read + Seek> Extract<'a, R> { /// Create archive from reader. pub fn from_cursor(mut reader: R, archive_format: ArchiveFormat) -> Extract<'a, R> { - if reader.seek(io::SeekFrom::Start(0)).is_err() { + if reader.rewind().is_err() { #[cfg(debug_assertions)] eprintln!("Could not seek to start of the file"); } diff --git a/core/tauri/src/api/http.rs b/core/tauri/src/api/http.rs index 3e17bc745..7b9614c19 100644 --- a/core/tauri/src/api/http.rs +++ b/core/tauri/src/api/http.rs @@ -441,8 +441,7 @@ impl<'de> Deserialize<'de> for HeaderMap { headers.insert(key, value); } else { return Err(serde::de::Error::custom(format!( - "invalid header `{}` `{}`", - key, value + "invalid header `{key}` `{value}`" ))); } } diff --git a/core/tauri/src/api/ipc.rs b/core/tauri/src/api/ipc.rs index cbffb02e0..f09be3232 100644 --- a/core/tauri/src/api/ipc.rs +++ b/core/tauri/src/api/ipc.rs @@ -242,22 +242,22 @@ mod test { } let raw_str = "T".repeat(MIN_JSON_PARSE_LEN); - assert_eq!(serialize_js(&raw_str).unwrap(), format!("\"{}\"", raw_str)); + assert_eq!(serialize_js(&raw_str).unwrap(), format!("\"{raw_str}\"")); assert_eq!( serialize_js(&JsonObj { value: raw_str.clone() }) .unwrap(), - format!("JSON.parse('{{\"value\":\"{}\"}}')", raw_str) + format!("JSON.parse('{{\"value\":\"{raw_str}\"}}')") ); assert_eq!( serialize_js(&JsonObj { - value: format!("\"{}\"", raw_str) + value: format!("\"{raw_str}\"") }) .unwrap(), - format!("JSON.parse('{{\"value\":\"\\\\\"{}\\\\\"\"}}')", raw_str) + format!("JSON.parse('{{\"value\":\"\\\\\"{raw_str}\\\\\"\"}}')") ); let dangerous_json = RawValue::from_string( diff --git a/core/tauri/src/api/shell.rs b/core/tauri/src/api/shell.rs index 9353e2f3f..f9db17f36 100644 --- a/core/tauri/src/api/shell.rs +++ b/core/tauri/src/api/shell.rs @@ -91,7 +91,7 @@ impl Program { /// Opens path or URL with the program specified in `with`, or system default if `None`. /// -/// The path will be matched against the shell open validation regex, defaulting to `^https?://`. +/// The path will be matched against the shell open validation regex, defaulting to `^((mailto:\w+)|(tel:\w+)|(https?://\w+)).+`. /// A custom validation regex may be supplied in the config in `tauri > allowlist > scope > open`. /// /// # Examples @@ -112,5 +112,5 @@ pub fn open>( ) -> crate::api::Result<()> { scope .open(path.as_ref(), with) - .map_err(|err| crate::api::Error::Shell(format!("failed to open: {}", err))) + .map_err(|err| crate::api::Error::Shell(format!("failed to open: {err}"))) } diff --git a/core/tauri/src/app.rs b/core/tauri/src/app.rs index 14eb6b071..779f4cc10 100644 --- a/core/tauri/src/app.rs +++ b/core/tauri/src/app.rs @@ -23,8 +23,8 @@ use crate::{ sealed::{ManagerBase, RuntimeOrDispatch}, utils::config::Config, utils::{assets::Assets, resources::resource_relpath, Env}, - Context, EventLoopMessage, Invoke, InvokeError, InvokeResponse, Manager, Runtime, Scopes, - StateManager, Theme, Window, + Context, DeviceEventFilter, EventLoopMessage, Invoke, InvokeError, InvokeResponse, Manager, + Runtime, Scopes, StateManager, Theme, Window, }; #[cfg(shell_scope)] @@ -805,6 +805,35 @@ impl App { .set_activation_policy(activation_policy); } + /// Change the device event filter mode. + /// + /// Since the DeviceEvent capture can lead to high CPU usage for unfocused windows, [`tao`] + /// will ignore them by default for unfocused windows on Windows. This method allows changing + /// the filter to explicitly capture them again. + /// + /// ## Platform-specific + /// + /// - ** Linux / macOS / iOS / Android**: Unsupported. + /// + /// # Examples + /// ```,no_run + /// let mut app = tauri::Builder::default() + /// // on an actual app, remove the string argument + /// .build(tauri::generate_context!("test/fixture/src-tauri/tauri.conf.json")) + /// .expect("error while building tauri application"); + /// app.set_device_event_filter(tauri::DeviceEventFilter::Always); + /// app.run(|_app_handle, _event| {}); + /// ``` + /// + /// [`tao`]: https://crates.io/crates/tao + pub fn set_device_event_filter(&mut self, filter: DeviceEventFilter) { + self + .runtime + .as_mut() + .unwrap() + .set_device_event_filter(filter); + } + /// Gets the argument matches of the CLI definition configured in `tauri.conf.json`. /// /// # Examples @@ -1008,6 +1037,9 @@ pub struct Builder { /// The updater configuration. #[cfg(updater)] updater_settings: UpdaterSettings, + + /// The device event filter. + device_event_filter: DeviceEventFilter, } impl Builder { @@ -1036,6 +1068,7 @@ impl Builder { system_tray_event_listeners: Vec::new(), #[cfg(updater)] updater_settings: Default::default(), + device_event_filter: Default::default(), } } @@ -1257,8 +1290,7 @@ impl Builder { let type_name = std::any::type_name::(); assert!( self.state.set(state), - "state for type '{}' is already being managed", - type_name + "state for type '{type_name}' is already being managed" ); self } @@ -1486,6 +1518,28 @@ impl Builder { self } + /// Change the device event filter mode. + /// + /// Since the DeviceEvent capture can lead to high CPU usage for unfocused windows, [`tao`] + /// will ignore them by default for unfocused windows on Windows. This method allows changing + /// the filter to explicitly capture them again. + /// + /// ## Platform-specific + /// + /// - ** Linux / macOS / iOS / Android**: Unsupported. + /// + /// # Examples + /// ```,no_run + /// tauri::Builder::default() + /// .device_event_filter(tauri::DeviceEventFilter::Always); + /// ``` + /// + /// [`tao`]: https://crates.io/crates/tao + pub fn device_event_filter(mut self, filter: DeviceEventFilter) -> Self { + self.device_event_filter = filter; + self + } + /// Builds the application. #[allow(clippy::type_complexity)] pub fn build(mut self, context: Context) -> crate::Result> { @@ -1519,6 +1573,9 @@ impl Builder { if let Some(ua) = &config.user_agent { webview_attributes = webview_attributes.user_agent(&ua.to_string()); } + if let Some(args) = &config.additional_browser_args { + webview_attributes = webview_attributes.additional_browser_args(&args.to_string()); + } if !config.file_drop_enabled { webview_attributes = webview_attributes.disable_file_drop_handler(); } @@ -1531,13 +1588,15 @@ impl Builder { } #[cfg(any(windows, target_os = "linux"))] - let runtime = if self.runtime_any_thread { + let mut runtime = if self.runtime_any_thread { R::new_any_thread()? } else { R::new()? }; #[cfg(not(any(windows, target_os = "linux")))] - let runtime = R::new()?; + let mut runtime = R::new()?; + + runtime.set_device_event_filter(self.device_event_filter); let runtime_handle = runtime.handle(); diff --git a/core/tauri/src/app/tray.rs b/core/tauri/src/app/tray.rs index 3a265f0c9..96c660127 100644 --- a/core/tauri/src/app/tray.rs +++ b/core/tauri/src/app/tray.rs @@ -64,6 +64,7 @@ pub struct SystemTray { icon_as_template_set: bool, #[cfg(target_os = "macos")] title: Option, + tooltip: Option, } impl fmt::Debug for SystemTray { @@ -98,6 +99,7 @@ impl Default for SystemTray { menu_on_left_click_set: false, #[cfg(target_os = "macos")] title: None, + tooltip: None, } } } @@ -257,6 +259,29 @@ impl SystemTray { self } + /// Sets the tray icon tooltip. + /// + /// ## Platform-specific: + /// + /// - **Linux:** Unsupported + /// + /// # Examples + /// + /// ``` + /// use tauri::SystemTray; + /// + /// tauri::Builder::default() + /// .setup(|app| { + /// let tray_handle = SystemTray::new().with_tooltip("My App").build(app)?; + /// Ok(()) + /// }); + /// ``` + #[must_use] + pub fn with_tooltip(mut self, tooltip: &str) -> Self { + self.tooltip = Some(tooltip.to_owned()); + self + } + /// Sets the event listener for this system tray. /// /// # Examples @@ -414,6 +439,10 @@ impl SystemTray { } } + if let Some(tooltip) = self.tooltip { + runtime_tray = runtime_tray.with_tooltip(&tooltip); + } + let id = runtime_tray.id; let tray_handler = match manager.runtime() { RuntimeOrDispatch::Runtime(r) => r.system_tray(runtime_tray), @@ -610,6 +639,15 @@ impl SystemTrayHandle { self.inner.set_title(title).map_err(Into::into) } + /// Set the tooltip for this tray icon. + /// + /// ## Platform-specific: + /// + /// - **Linux:** Unsupported + pub fn set_tooltip(&self, tooltip: &str) -> crate::Result<()> { + self.inner.set_tooltip(tooltip).map_err(Into::into) + } + /// Destroys this system tray. pub fn destroy(&self) -> crate::Result<()> { self.inner.destroy().map_err(Into::into) diff --git a/core/tauri/src/endpoints.rs b/core/tauri/src/endpoints.rs index 9dd2ca974..4106a4d04 100644 --- a/core/tauri/src/endpoints.rs +++ b/core/tauri/src/endpoints.rs @@ -238,8 +238,7 @@ pub(crate) fn handle( if let Some(unknown_variant_name) = s.next() { if unknown_variant_name == module { return resolver.reject(format!( - "The `{}` module is not enabled. You must enable one of its APIs in the allowlist.", - module + "The `{module}` module is not enabled. You must enable one of its APIs in the allowlist." )); } else if module == "Window" { return resolver.reject(window::into_allowlist_error(unknown_variant_name).to_string()); diff --git a/core/tauri/src/endpoints/dialog.rs b/core/tauri/src/endpoints/dialog.rs index aaba2d046..f71923cef 100644 --- a/core/tauri/src/endpoints/dialog.rs +++ b/core/tauri/src/endpoints/dialog.rs @@ -14,19 +14,21 @@ use tauri_macros::{command_enum, module_command_handler, CommandModule}; use std::path::PathBuf; macro_rules! message_dialog { - ($fn_name: ident, $allowlist: ident, $buttons: expr) => { + ($fn_name: ident, $allowlist: ident, $button_labels_type: ty, $buttons: expr) => { #[module_command_handler($allowlist)] fn $fn_name( context: InvokeContext, title: Option, message: String, level: Option, + button_labels: $button_labels_type, ) -> super::Result { + let determine_button = $buttons; let mut builder = crate::api::dialog::blocking::MessageDialogBuilder::new( title.unwrap_or_else(|| context.window.app_handle.package_info().name.clone()), message, ) - .buttons($buttons); + .buttons(determine_button(button_labels)); #[cfg(any(windows, target_os = "macos"))] { builder = builder.parent(&context.window); @@ -139,6 +141,8 @@ pub enum Cmd { message: String, #[serde(rename = "type")] level: Option, + #[serde(rename = "buttonLabel")] + button_label: Option, }, #[cmd(dialog_ask, "dialog > ask")] AskDialog { @@ -146,6 +150,8 @@ pub enum Cmd { message: String, #[serde(rename = "type")] level: Option, + #[serde(rename = "buttonLabels")] + button_label: Option<(String, String)>, }, #[cmd(dialog_confirm, "dialog > confirm")] ConfirmDialog { @@ -153,6 +159,8 @@ pub enum Cmd { message: String, #[serde(rename = "type")] level: Option, + #[serde(rename = "buttonLabels")] + button_labels: Option<(String, String)>, }, } @@ -255,19 +263,36 @@ impl Cmd { message_dialog!( message_dialog, dialog_message, - crate::api::dialog::MessageDialogButtons::Ok + Option, + |label: Option| { + label + .map(crate::api::dialog::MessageDialogButtons::OkWithLabel) + .unwrap_or(crate::api::dialog::MessageDialogButtons::Ok) + } ); message_dialog!( ask_dialog, dialog_ask, - crate::api::dialog::MessageDialogButtons::YesNo + Option<(String, String)>, + |labels: Option<(String, String)>| { + labels + .map(|(yes, no)| crate::api::dialog::MessageDialogButtons::OkCancelWithLabels(yes, no)) + .unwrap_or(crate::api::dialog::MessageDialogButtons::YesNo) + } ); message_dialog!( confirm_dialog, dialog_confirm, - crate::api::dialog::MessageDialogButtons::OkCancel + Option<(String, String)>, + |labels: Option<(String, String)>| { + labels + .map(|(ok, cancel)| { + crate::api::dialog::MessageDialogButtons::OkCancelWithLabels(ok, cancel) + }) + .unwrap_or(crate::api::dialog::MessageDialogButtons::OkCancel) + } ); } diff --git a/core/tauri/src/endpoints/event.rs b/core/tauri/src/endpoints/event.rs index 6d21d9316..8dd42f7af 100644 --- a/core/tauri/src/endpoints/event.rs +++ b/core/tauri/src/endpoints/event.rs @@ -138,7 +138,7 @@ impl Cmd { serde_json::to_string(&p) .map_err(|e| { #[cfg(debug_assertions)] - eprintln!("{}", e); + eprintln!("{e}"); e }) .ok() diff --git a/core/tauri/src/endpoints/shell.rs b/core/tauri/src/endpoints/shell.rs index 57aaf7db9..c85168549 100644 --- a/core/tauri/src/endpoints/shell.rs +++ b/core/tauri/src/endpoints/shell.rs @@ -135,7 +135,7 @@ impl Cmd { Ok(cmd) => cmd, Err(e) => { #[cfg(debug_assertions)] - eprintln!("{}", e); + eprintln!("{e}"); return Err(crate::Error::ProgramNotAllowed(PathBuf::from(program)).into_anyhow()); } } @@ -154,7 +154,7 @@ impl Cmd { if let Some(encoding) = crate::api::process::Encoding::for_label(encoding.as_bytes()) { command = command.encoding(encoding); } else { - return Err(anyhow::anyhow!(format!("unknown encoding {}", encoding))); + return Err(anyhow::anyhow!(format!("unknown encoding {encoding}"))); } } let (mut rx, child) = command.spawn()?; diff --git a/core/tauri/src/endpoints/window.rs b/core/tauri/src/endpoints/window.rs index 58ea4c747..f4e69a320 100644 --- a/core/tauri/src/endpoints/window.rs +++ b/core/tauri/src/endpoints/window.rs @@ -63,10 +63,12 @@ pub enum WindowManagerCmd { InnerSize, OuterSize, IsFullscreen, + IsMinimized, IsMaximized, IsDecorated, IsResizable, IsVisible, + Title, CurrentMonitor, PrimaryMonitor, AvailableMonitors, @@ -101,6 +103,8 @@ pub enum WindowManagerCmd { #[cfg(window_set_always_on_top)] #[serde(rename_all = "camelCase")] SetAlwaysOnTop(bool), + #[cfg(window_set_content_protected)] + SetContentProtected(bool), #[cfg(window_set_size)] SetSize(Size), #[cfg(window_set_min_size)] @@ -162,6 +166,9 @@ pub fn into_allowlist_error(variant: &str) -> crate::Error { "close" => crate::Error::ApiNotAllowlisted("window > close".to_string()), "setDecorations" => crate::Error::ApiNotAllowlisted("window > setDecorations".to_string()), "setAlwaysOnTop" => crate::Error::ApiNotAllowlisted("window > setAlwaysOnTop".to_string()), + "setContentProtected" => { + crate::Error::ApiNotAllowlisted("window > setContentProtected".to_string()) + } "setSize" => crate::Error::ApiNotAllowlisted("window > setSize".to_string()), "setMinSize" => crate::Error::ApiNotAllowlisted("window > setMinSize".to_string()), "setMaxSize" => crate::Error::ApiNotAllowlisted("window > setMaxSize".to_string()), @@ -180,9 +187,10 @@ pub fn into_allowlist_error(variant: &str) -> crate::Error { } "startDragging" => crate::Error::ApiNotAllowlisted("window > startDragging".to_string()), "print" => crate::Error::ApiNotAllowlisted("window > print".to_string()), - "internalToggleMaximize" => { + "__toggleMaximize" => { crate::Error::ApiNotAllowlisted("window > maximize and window > unmaximize".to_string()) } + "__toggleDevtools" => crate::Error::ApiNotAllowlisted("devtools".to_string()), _ => crate::Error::ApiNotAllowlisted("window".to_string()), } } @@ -253,10 +261,12 @@ impl Cmd { WindowManagerCmd::InnerSize => return Ok(window.inner_size()?.into()), WindowManagerCmd::OuterSize => return Ok(window.outer_size()?.into()), WindowManagerCmd::IsFullscreen => return Ok(window.is_fullscreen()?.into()), + WindowManagerCmd::IsMinimized => return Ok(window.is_minimized()?.into()), WindowManagerCmd::IsMaximized => return Ok(window.is_maximized()?.into()), WindowManagerCmd::IsDecorated => return Ok(window.is_decorated()?.into()), WindowManagerCmd::IsResizable => return Ok(window.is_resizable()?.into()), WindowManagerCmd::IsVisible => return Ok(window.is_visible()?.into()), + WindowManagerCmd::Title => return Ok(window.title()?.into()), WindowManagerCmd::CurrentMonitor => return Ok(window.current_monitor()?.into()), WindowManagerCmd::PrimaryMonitor => return Ok(window.primary_monitor()?.into()), WindowManagerCmd::AvailableMonitors => return Ok(window.available_monitors()?.into()), @@ -295,6 +305,10 @@ impl Cmd { WindowManagerCmd::SetDecorations(decorations) => window.set_decorations(decorations)?, #[cfg(window_set_always_on_top)] WindowManagerCmd::SetAlwaysOnTop(always_on_top) => window.set_always_on_top(always_on_top)?, + #[cfg(window_set_content_protected)] + WindowManagerCmd::SetContentProtected(protected) => { + window.set_content_protected(protected)? + } #[cfg(window_set_size)] WindowManagerCmd::SetSize(size) => window.set_size(size)?, #[cfg(window_set_min_size)] diff --git a/core/tauri/src/event.rs b/core/tauri/src/event.rs index d19fed996..9a1b3ec53 100644 --- a/core/tauri/src/event.rs +++ b/core/tauri/src/event.rs @@ -232,7 +232,7 @@ mod test { // dummy event handler function fn event_fn(s: Event) { - println!("{:?}", s); + println!("{s:?}"); } proptest! { @@ -304,18 +304,15 @@ pub fn unlisten_js(listeners_object_name: String, event_name: String, event_id: format!( " (function () {{ - const listeners = (window['{listeners}'] || {{}})['{event_name}'] + const listeners = (window['{listeners_object_name}'] || {{}})['{event_name}'] if (listeners) {{ - const index = window['{listeners}']['{event_name}'].findIndex(e => e.id === {event_id}) + const index = window['{listeners_object_name}']['{event_name}'].findIndex(e => e.id === {event_id}) if (index > -1) {{ - window['{listeners}']['{event_name}'].splice(index, 1) + window['{listeners_object_name}']['{event_name}'].splice(index, 1) }} }} }})() ", - listeners = listeners_object_name, - event_name = event_name, - event_id = event_id, ) } @@ -341,11 +338,7 @@ pub fn listen_js( windowLabel: {window_label}, handler: {handler} }}; - if ({event} == 'tauri://window-created') {{ - eventListeners.splice(eventListeners.length - 1, 0, listener) - }} else {{ - eventListeners.push(listener); - }} + eventListeners.push(listener); }})() ", listeners = listeners_object_name, @@ -353,7 +346,7 @@ pub fn listen_js( event_id = event_id, window_label = if let Some(l) = window_label { crate::runtime::window::assert_label_is_valid(&l); - format!("'{}'", l) + format!("'{l}'") } else { "null".to_owned() }, diff --git a/core/tauri/src/hooks.rs b/core/tauri/src/hooks.rs index 8d992b770..bd2337d69 100644 --- a/core/tauri/src/hooks.rs +++ b/core/tauri/src/hooks.rs @@ -99,7 +99,7 @@ impl InvokeError { /// Create an [`InvokeError`] as a string of the [`anyhow::Error`] message. #[inline(always)] pub fn from_anyhow(error: anyhow::Error) -> Self { - Self(JsonValue::String(format!("{:#}", error))) + Self(JsonValue::String(format!("{error:#}"))) } } diff --git a/core/tauri/src/lib.rs b/core/tauri/src/lib.rs index 5247e3c7b..4d4253eff 100644 --- a/core/tauri/src/lib.rs +++ b/core/tauri/src/lib.rs @@ -134,6 +134,7 @@ //! - **window-close**: Enables the [`close` API](https://tauri.app/en/docs/api/js/classes/window.WebviewWindow#close). //! - **window-set-decorations**: Enables the [`setDecorations` API](https://tauri.app/en/docs/api/js/classes/window.WebviewWindow#setdecorations). //! - **window-set-always-on-top**: Enables the [`setAlwaysOnTop` API](https://tauri.app/en/docs/api/js/classes/window.WebviewWindow#setalwaysontop). +//! - **window-set-content-protected**: Enables the [`setContentProtected` API](https://tauri.app/en/docs/api/js/classes/window.WebviewWindow#setcontentprotected). //! - **window-set-size**: Enables the [`setSize` API](https://tauri.app/en/docs/api/js/classes/window.WebviewWindow#setsize). //! - **window-set-min-size**: Enables the [`setMinSize` API](https://tauri.app/en/docs/api/js/classes/window.WebviewWindow#setminsize). //! - **window-set-max-size**: Enables the [`setMaxSize` API](https://tauri.app/en/docs/api/js/classes/window.WebviewWindow#setmaxsize). @@ -243,7 +244,7 @@ pub use { dpi::{LogicalPosition, LogicalSize, PhysicalPosition, PhysicalSize, Pixel, Position, Size}, CursorIcon, FileDropEvent, }, - RunIteration, UserAttentionType, + DeviceEventFilter, RunIteration, UserAttentionType, }, self::state::{State, StateManager}, self::utils::{ @@ -439,8 +440,7 @@ impl TryFrom for runtime::Icon { }) } _ => panic!( - "image `{}` extension not supported; please file a Tauri feature request. `png` or `ico` icons are supported with the `icon-png` and `icon-ico` feature flags", - extension + "image `{extension}` extension not supported; please file a Tauri feature request. `png` or `ico` icons are supported with the `icon-png` and `icon-ico` feature flags" ), } } @@ -844,8 +844,8 @@ mod tests { let lib_code = read_to_string(manifest_dir.join("src/lib.rs")).expect("failed to read lib.rs"); for f in get_manifest().features.keys() { - if !(f.starts_with("__") || f == "default" || lib_code.contains(&format!("*{}**", f))) { - panic!("Feature {} is not documented", f); + if !(f.starts_with("__") || f == "default" || lib_code.contains(&format!("*{f}**"))) { + panic!("Feature {f} is not documented"); } } } @@ -857,8 +857,7 @@ mod tests { for checked_feature in checked_features { if !manifest.features.iter().any(|(f, _)| f == checked_feature) { panic!( - "Feature {} was checked in the alias build step but it does not exist in core/tauri/Cargo.toml", - checked_feature + "Feature {checked_feature} was checked in the alias build step but it does not exist in core/tauri/Cargo.toml" ); } } @@ -894,22 +893,21 @@ mod tests { let module = module_all_feature.replace("-all", ""); assert!( checked_features.contains(&module_all_feature.as_str()), - "`{}` is not aliased", - module + "`{module}` is not aliased" ); - let module_prefix = format!("{}-", module); + let module_prefix = format!("{module}-"); // we assume that module features are the ones that start with `-` // though it's not 100% accurate, we have an allowed list to fix it let module_features = manifest - .features.keys() + .features + .keys() .filter(|f| f.starts_with(&module_prefix)); for module_feature in module_features { assert!( allowed.contains(&module_feature.as_str()) || checked_features.contains(&module_feature.as_str()), - "`{}` is not aliased", - module_feature + "`{module_feature}` is not aliased" ); } } @@ -937,7 +935,7 @@ mod test_utils { fn check_spawn_task(task in "[a-z]+") { // create dummy task function let dummy_task = async move { - format!("{}-run-dummy-task", task); + format!("{task}-run-dummy-task"); }; // call spawn crate::async_runtime::spawn(dummy_task); diff --git a/core/tauri/src/manager.rs b/core/tauri/src/manager.rs index cdb100e8a..7f63ef672 100644 --- a/core/tauri/src/manager.rs +++ b/core/tauri/src/manager.rs @@ -184,7 +184,7 @@ fn replace_csp_nonce( if !(nonces.is_empty() && hashes.is_empty()) { let nonce_sources = nonces .into_iter() - .map(|n| format!("'nonce-{}'", n)) + .map(|n| format!("'nonce-{n}'")) .collect::>(); let sources = csp.entry(directive.into()).or_insert_with(Default::default); let self_source = "'self'".to_string(); @@ -487,7 +487,7 @@ impl WindowManager { window_url.scheme(), window_url.host().unwrap(), if let Some(port) = window_url.port() { - format!(":{}", port) + format!(":{port}") } else { "".into() } @@ -714,7 +714,7 @@ impl WindowManager { { let assets = assets.clone(); let schema_ = schema.clone(); - let url_base = format!("{}://localhost", schema_); + let url_base = format!("{schema_}://localhost"); let aes_gcm_key = *crypto_keys.aes_gcm().raw(); pending.register_uri_scheme_protocol(schema, move |request| { @@ -813,7 +813,7 @@ impl WindowManager { let asset_response = assets .get(&path.as_str().into()) .or_else(|| { - eprintln!("Asset `{}` not found; fallback to {}.html", path, path); + eprintln!("Asset `{path}` not found; fallback to {path}.html"); let fallback = format!("{}.html", path.as_str()).into(); let asset = assets.get(&fallback); asset_path = fallback; @@ -1302,6 +1302,14 @@ impl WindowManager { .try_for_each(|window| window.emit_internal(event, source_window_label, payload.clone())) } + pub fn eval_script_all>(&self, script: S) -> crate::Result<()> { + let script = script.into(); + self + .windows_lock() + .values() + .try_for_each(|window| window.eval(&script)) + } + pub fn labels(&self) -> HashSet { self.windows_lock().keys().cloned().collect() } @@ -1408,8 +1416,7 @@ fn on_window_event( let windows = windows_map.values(); for window in windows { window.eval(&format!( - r#"(function () {{ const metadata = window.__TAURI_METADATA__; if (metadata != null) {{ metadata.__windows = window.__TAURI_METADATA__.__windows.filter(w => w.label !== "{}"); }} }})()"#, - label + r#"(function () {{ const metadata = window.__TAURI_METADATA__; if (metadata != null) {{ metadata.__windows = window.__TAURI_METADATA__.__windows.filter(w => w.label !== "{label}"); }} }})()"# ))?; } } diff --git a/core/tauri/src/pattern.rs b/core/tauri/src/pattern.rs index 660959dbb..0a52fe8af 100644 --- a/core/tauri/src/pattern.rs +++ b/core/tauri/src/pattern.rs @@ -87,8 +87,8 @@ pub(crate) struct PatternJavascript { #[allow(dead_code)] pub(crate) fn format_real_schema(schema: &str) -> String { if cfg!(windows) { - format!("https://{}.localhost", schema) + format!("https://{schema}.localhost") } else { - format!("{}://localhost", schema) + format!("{schema}://localhost") } } diff --git a/core/tauri/src/plugin.rs b/core/tauri/src/plugin.rs index d7aac7b8c..6c42d9927 100644 --- a/core/tauri/src/plugin.rs +++ b/core/tauri/src/plugin.rs @@ -545,7 +545,7 @@ impl PluginStore { .values() .filter_map(|p| p.initialization_script()) .fold(String::new(), |acc, script| { - format!("{}\n(function () {{ {} }})();", acc, script) + format!("{acc}\n(function () {{ {script} }})();") }) } @@ -586,9 +586,7 @@ impl PluginStore { .unwrap_or_else(String::new); plugin.extend_api(invoke); } else { - invoke - .resolver - .reject(format!("plugin {} not found", target)); + invoke.resolver.reject(format!("plugin {target} not found")); } } } diff --git a/core/tauri/src/scope/fs.rs b/core/tauri/src/scope/fs.rs index 32d92652a..8979eb8f1 100644 --- a/core/tauri/src/scope/fs.rs +++ b/core/tauri/src/scope/fs.rs @@ -141,7 +141,7 @@ impl Scope { /// Extend the allowed patterns with the given directory. /// /// After this function has been called, the frontend will be able to use the Tauri API to read - /// the directory and all of its files and subdirectories. + /// the directory and all of its files. If `recursive` is `true`, subdirectories will be accessible too. pub fn allow_directory>(&self, path: P, recursive: bool) -> crate::Result<()> { let path = path.as_ref(); { @@ -216,13 +216,22 @@ impl Scope { if let Ok(path) = path { let path: PathBuf = path.components().collect(); + let options = glob::MatchOptions { + // this is needed so `/dir/*` doesn't match files within subdirectories such as `/dir/subdir/file.txt` + // see: https://github.com/tauri-apps/tauri/security/advisories/GHSA-6mv3-wm7j-h4w5 + require_literal_separator: true, + // dotfiles are not supposed to be exposed by default + #[cfg(unix)] + require_literal_leading_dot: true, + ..Default::default() + }; let forbidden = self .forbidden_patterns .lock() .unwrap() .iter() - .any(|p| p.matches_path(&path)); + .any(|p| p.matches_path_with(&path, options)); if forbidden { false @@ -232,7 +241,7 @@ impl Scope { .lock() .unwrap() .iter() - .any(|p| p.matches_path(&path)); + .any(|p| p.matches_path_with(&path, options)); allowed } } else { @@ -269,32 +278,97 @@ mod tests { #[test] fn path_is_escaped() { let scope = new_scope(); - scope.allow_directory("/home/tauri/**", false).unwrap(); - assert!(scope.is_allowed("/home/tauri/**")); - assert!(scope.is_allowed("/home/tauri/**/file")); - assert!(!scope.is_allowed("/home/tauri/anyfile")); + #[cfg(unix)] + { + scope.allow_directory("/home/tauri/**", false).unwrap(); + assert!(scope.is_allowed("/home/tauri/**")); + assert!(scope.is_allowed("/home/tauri/**/file")); + assert!(!scope.is_allowed("/home/tauri/anyfile")); + } + #[cfg(windows)] + { + scope.allow_directory("C:\\home\\tauri\\**", false).unwrap(); + assert!(scope.is_allowed("C:\\home\\tauri\\**")); + assert!(scope.is_allowed("C:\\home\\tauri\\**\\file")); + assert!(!scope.is_allowed("C:\\home\\tauri\\anyfile")); + } let scope = new_scope(); - scope.allow_file("/home/tauri/**").unwrap(); - assert!(scope.is_allowed("/home/tauri/**")); - assert!(!scope.is_allowed("/home/tauri/**/file")); - assert!(!scope.is_allowed("/home/tauri/anyfile")); + #[cfg(unix)] + { + scope.allow_file("/home/tauri/**").unwrap(); + assert!(scope.is_allowed("/home/tauri/**")); + assert!(!scope.is_allowed("/home/tauri/**/file")); + assert!(!scope.is_allowed("/home/tauri/anyfile")); + } + #[cfg(windows)] + { + scope.allow_file("C:\\home\\tauri\\**").unwrap(); + assert!(scope.is_allowed("C:\\home\\tauri\\**")); + assert!(!scope.is_allowed("C:\\home\\tauri\\**\\file")); + assert!(!scope.is_allowed("C:\\home\\tauri\\anyfile")); + } let scope = new_scope(); - scope.allow_directory("/home/tauri", true).unwrap(); - scope.forbid_directory("/home/tauri/**", false).unwrap(); - assert!(!scope.is_allowed("/home/tauri/**")); - assert!(!scope.is_allowed("/home/tauri/**/file")); - assert!(!scope.is_allowed("/home/tauri/**/inner/file")); - assert!(scope.is_allowed("/home/tauri/inner/folder/anyfile")); - assert!(scope.is_allowed("/home/tauri/anyfile")); + #[cfg(unix)] + { + scope.allow_directory("/home/tauri", true).unwrap(); + scope.forbid_directory("/home/tauri/**", false).unwrap(); + assert!(!scope.is_allowed("/home/tauri/**")); + assert!(!scope.is_allowed("/home/tauri/**/file")); + assert!(scope.is_allowed("/home/tauri/**/inner/file")); + assert!(scope.is_allowed("/home/tauri/inner/folder/anyfile")); + assert!(scope.is_allowed("/home/tauri/anyfile")); + } + #[cfg(windows)] + { + scope.allow_directory("C:\\home\\tauri", true).unwrap(); + scope + .forbid_directory("C:\\home\\tauri\\**", false) + .unwrap(); + assert!(!scope.is_allowed("C:\\home\\tauri\\**")); + assert!(!scope.is_allowed("C:\\home\\tauri\\**\\file")); + assert!(scope.is_allowed("C:\\home\\tauri\\**\\inner\\file")); + assert!(scope.is_allowed("C:\\home\\tauri\\inner\\folder\\anyfile")); + assert!(scope.is_allowed("C:\\home\\tauri\\anyfile")); + } let scope = new_scope(); - scope.allow_directory("/home/tauri", true).unwrap(); - scope.forbid_file("/home/tauri/**").unwrap(); - assert!(!scope.is_allowed("/home/tauri/**")); - assert!(scope.is_allowed("/home/tauri/**/file")); - assert!(scope.is_allowed("/home/tauri/**/inner/file")); - assert!(scope.is_allowed("/home/tauri/anyfile")); + #[cfg(unix)] + { + scope.allow_directory("/home/tauri", true).unwrap(); + scope.forbid_file("/home/tauri/**").unwrap(); + assert!(!scope.is_allowed("/home/tauri/**")); + assert!(scope.is_allowed("/home/tauri/**/file")); + assert!(scope.is_allowed("/home/tauri/**/inner/file")); + assert!(scope.is_allowed("/home/tauri/anyfile")); + } + #[cfg(windows)] + { + scope.allow_directory("C:\\home\\tauri", true).unwrap(); + scope.forbid_file("C:\\home\\tauri\\**").unwrap(); + assert!(!scope.is_allowed("C:\\home\\tauri\\**")); + assert!(scope.is_allowed("C:\\home\\tauri\\**\\file")); + assert!(scope.is_allowed("C:\\home\\tauri\\**\\inner\\file")); + assert!(scope.is_allowed("C:\\home\\tauri\\anyfile")); + } + + let scope = new_scope(); + #[cfg(unix)] + { + scope.allow_directory("/home/tauri", false).unwrap(); + assert!(scope.is_allowed("/home/tauri/**")); + assert!(!scope.is_allowed("/home/tauri/**/file")); + assert!(!scope.is_allowed("/home/tauri/**/inner/file")); + assert!(scope.is_allowed("/home/tauri/anyfile")); + } + #[cfg(windows)] + { + scope.allow_directory("C:\\home\\tauri", false).unwrap(); + assert!(scope.is_allowed("C:\\home\\tauri\\**")); + assert!(!scope.is_allowed("C:\\home\\tauri\\**\\file")); + assert!(!scope.is_allowed("C:\\home\\tauri\\**\\inner\\file")); + assert!(scope.is_allowed("C:\\home\\tauri\\anyfile")); + } } } diff --git a/core/tauri/src/scope/http.rs b/core/tauri/src/scope/http.rs index 627b96d17..e96eb5831 100644 --- a/core/tauri/src/scope/http.rs +++ b/core/tauri/src/scope/http.rs @@ -21,7 +21,7 @@ impl Scope { .iter() .map(|url| { glob::Pattern::new(url.as_str()) - .unwrap_or_else(|_| panic!("scoped URL is not a valid glob pattern: `{}`", url)) + .unwrap_or_else(|_| panic!("scoped URL is not a valid glob pattern: `{url}`")) }) .collect(), } diff --git a/core/tauri/src/scope/shell.rs b/core/tauri/src/scope/shell.rs index 9197bc61f..e3ad64486 100644 --- a/core/tauri/src/scope/shell.rs +++ b/core/tauri/src/scope/shell.rs @@ -301,7 +301,7 @@ impl Scope { /// Open a path in the default (or specified) browser. /// /// The path is validated against the `tauri > allowlist > shell > open` validation regex, which - /// defaults to `^https?://`. + /// defaults to `^((mailto:\w+)|(tel:\w+)|(https?://\w+)).+`. #[cfg(feature = "shell-open-api")] pub fn open(&self, path: &str, with: Option) -> Result<(), ScopeError> { // ensure we pass validation if the configuration has one diff --git a/core/tauri/src/test/mock_runtime.rs b/core/tauri/src/test/mock_runtime.rs index 73c25681c..d7d8ebe33 100644 --- a/core/tauri/src/test/mock_runtime.rs +++ b/core/tauri/src/test/mock_runtime.rs @@ -12,8 +12,8 @@ use tauri_runtime::{ dpi::{PhysicalPosition, PhysicalSize, Position, Size}, CursorIcon, DetachedWindow, MenuEvent, PendingWindow, WindowEvent, }, - Dispatch, EventLoopProxy, Icon, Result, RunEvent, Runtime, RuntimeHandle, UserAttentionType, - UserEvent, + DeviceEventFilter, Dispatch, EventLoopProxy, Icon, Result, RunEvent, Runtime, RuntimeHandle, + UserAttentionType, UserEvent, }; #[cfg(all(desktop, feature = "system-tray"))] use tauri_runtime::{ @@ -250,6 +250,10 @@ impl WindowBuilder for MockWindowBuilder { self } + fn content_protected(self, protected: bool) -> Self { + self + } + fn icon(self, icon: Icon) -> Result { Ok(self) } @@ -329,6 +333,10 @@ impl Dispatch for MockDispatcher { Ok(false) } + fn url(&self) -> Result { + todo!() + } + fn scale_factor(&self) -> Result { Ok(1.0) } @@ -359,6 +367,10 @@ impl Dispatch for MockDispatcher { Ok(false) } + fn is_minimized(&self) -> Result { + Ok(false) + } + fn is_maximized(&self) -> Result { Ok(false) } @@ -375,6 +387,10 @@ impl Dispatch for MockDispatcher { Ok(true) } + fn title(&self) -> Result { + Ok(String::new()) + } + fn is_menu_visible(&self) -> Result { Ok(true) } @@ -481,6 +497,10 @@ impl Dispatch for MockDispatcher { Ok(()) } + fn set_content_protected(&self, protected: bool) -> Result<()> { + Ok(()) + } + fn set_size(&self, size: Size) -> Result<()> { Ok(()) } @@ -574,6 +594,10 @@ impl TrayHandle for MockTrayHandler { Ok(()) } + fn set_tooltip(&self, tooltip: &str) -> Result<()> { + Ok(()) + } + fn destroy(&self) -> Result<()> { Ok(()) } @@ -696,6 +720,8 @@ impl Runtime for MockRuntime { #[cfg_attr(doc_cfg, doc(cfg(target_os = "macos")))] fn hide(&self) {} + fn set_device_event_filter(&mut self, filter: DeviceEventFilter) {} + #[cfg(any( target_os = "macos", windows, diff --git a/core/tauri/src/updater/core.rs b/core/tauri/src/updater/core.rs index 57085bcfd..361e6f481 100644 --- a/core/tauri/src/updater/core.rs +++ b/core/tauri/src/updater/core.rs @@ -96,7 +96,7 @@ impl<'de> Deserialize<'de> for RemoteRelease { let pub_date = if let Some(date) = release.pub_date { Some( OffsetDateTime::parse(&date, &time::format_description::well_known::Rfc3339) - .map_err(|e| DeError::custom(format!("invalid value for `pub_date`: {}", e)))?, + .map_err(|e| DeError::custom(format!("invalid value for `pub_date`: {e}")))?, ) } else { None @@ -336,7 +336,7 @@ impl UpdateBuilder { (target.clone(), target) } else { let target = get_updater_target().ok_or(Error::UnsupportedOs)?; - (target.to_string(), format!("{}-{}", target, arch)) + (target.to_string(), format!("{target}-{arch}")) }; // Get the extract_path from the provided executable_path @@ -612,15 +612,7 @@ impl Update { archive_buffer, &self.extract_path, self.with_elevated_task, - self - .app - .config() - .tauri - .updater - .windows - .install_mode - .clone() - .msiexec_args(), + &self.app.config(), )?; #[cfg(not(target_os = "windows"))] copy_files_and_run(archive_buffer, &self.extract_path)?; @@ -698,17 +690,19 @@ fn copy_files_and_run(archive_buffer: R, extract_path: &Path) -> } // Windows - +// // ### Expected structure: // ├── [AppName]_[version]_x64.msi.zip # ZIP generated by tauri-bundler // │ └──[AppName]_[version]_x64.msi # Application MSI +// ├── [AppName]_[version]_x64-setup.exe.zip # ZIP generated by tauri-bundler +// │ └──[AppName]_[version]_x64-setup.exe # NSIS installer // └── ... - +// // ## MSI // Update server can provide a MSI for Windows. (Generated with tauri-bundler from *Wix*) // To replace current version of the application. In later version we'll offer // incremental update to push specific binaries. - +// // ## EXE // Update server can provide a custom EXE (installer) who can run any task. #[cfg(target_os = "windows")] @@ -717,7 +711,7 @@ fn copy_files_and_run( archive_buffer: R, _extract_path: &Path, with_elevated_task: bool, - msiexec_args: &[&str], + config: &crate::Config, ) -> Result { // FIXME: We need to create a memory buffer with the MSI and then run it. // (instead of extracting the MSI to a temp path) @@ -736,8 +730,6 @@ fn copy_files_and_run( extractor.extract_into(&tmp_dir)?; let paths = read_dir(&tmp_dir)?; - // This consumes the TempDir without deleting directory on the filesystem, - // meaning that the directory will no longer be automatically deleted. for path in paths { let found_path = path?.path(); @@ -745,9 +737,15 @@ fn copy_files_and_run( // If it's an `exe` we expect an installer not a runtime. if found_path.extension() == Some(OsStr::new("exe")) { // Run the EXE - Command::new(found_path) - .spawn() - .expect("installer failed to start"); + let mut installer = Command::new(found_path); + if crate::utils::config::WindowsUpdateInstallMode::Quiet + == config.tauri.updater.windows.install_mode + { + installer.arg("/S"); + } + installer.args(&config.tauri.updater.windows.installer_args); + + installer.spawn().expect("installer failed to start"); exit(0); } else if found_path.extension() == Some(OsStr::new("msi")) { @@ -801,6 +799,18 @@ fn copy_files_and_run( msi_path_arg.push(&found_path); msi_path_arg.push("\"\"\""); + let mut msiexec_args = config + .tauri + .updater + .windows + .install_mode + .clone() + .msiexec_args() + .iter() + .map(|p| p.to_string()) + .collect::>(); + msiexec_args.extend(config.tauri.updater.windows.installer_args.clone()); + // run the installer and relaunch the application let system_root = std::env::var("SYSTEMROOT"); let powershell_path = system_root.as_ref().map_or_else( @@ -895,7 +905,7 @@ fn copy_files_and_run(archive_buffer: R, extract_path: &Path) -> })?; let _ = std::process::Command::new("touch") - .arg(&extract_path) + .arg(extract_path) .status(); Ok(()) @@ -1049,14 +1059,13 @@ mod test { format!( r#" {{ - "name": "v{}", + "name": "v{version}", "notes": "This is the latest version! Once updated you shouldn't see this prompt.", "pub_date": "2020-06-25T14:14:19Z", - "signature": "{}", - "url": "{}" + "signature": "{public_signature}", + "url": "{download_url}" }} - "#, - version, public_signature, download_url + "# ) } @@ -1069,15 +1078,14 @@ mod test { format!( r#" {{ - "name": "v{}", + "name": "v{version}", "notes": "This is the latest version! Once updated you shouldn't see this prompt.", "pub_date": "2020-06-25T14:14:19Z", - "signature": "{}", - "url": "{}", - "with_elevated_task": {} + "signature": "{public_signature}", + "url": "{download_url}", + "with_elevated_task": {with_elevated_task} }} - "#, - version, public_signature, download_url, with_elevated_task + "# ) } @@ -1515,7 +1523,7 @@ mod test { }"#; fn missing_field_error(field: &str) -> String { - format!("the `{}` field was not set on the updater response", field) + format!("the `{field}` field was not set on the updater response") } let test_cases = [ @@ -1547,7 +1555,7 @@ mod test { .target("test-target") .build()); if let Err(e) = check_update { - println!("ERROR: {}, expected: {}", e, error); + println!("ERROR: {e}, expected: {error}"); assert!(e.to_string().contains(&error)); } else { panic!("unexpected Ok response"); diff --git a/core/tauri/src/updater/mod.rs b/core/tauri/src/updater/mod.rs index e235d8e49..240c06bc8 100644 --- a/core/tauri/src/updater/mod.rs +++ b/core/tauri/src/updater/mod.rs @@ -109,7 +109,7 @@ pub const EVENT_STATUS_UPTODATE: &str = "UPTODATE"; /// Gets the target string used on the updater. pub fn target() -> Option { if let (Some(target), Some(arch)) = (core::get_updater_target(), core::get_updater_arch()) { - Some(format!("{}-{}", target, arch)) + Some(format!("{target}-{arch}")) } else { None } @@ -565,7 +565,7 @@ async fn prompt_for_install( // something more conventional. let should_install = ask( parent_window, - format!(r#"A new version of {} is available! "#, app_name), + format!(r#"A new version of {app_name} is available! "#), format!( r#"{} {} is now available -- you have {}. diff --git a/core/tauri/src/window.rs b/core/tauri/src/window.rs index d56e70369..3fae7b37d 100644 --- a/core/tauri/src/window.rs +++ b/core/tauri/src/window.rs @@ -7,6 +7,7 @@ pub(crate) mod menu; pub use menu::{MenuEvent, MenuHandle}; +use url::Url; #[cfg(target_os = "macos")] use crate::TitleBarStyle; @@ -48,6 +49,7 @@ use std::{ }; pub(crate) type WebResourceRequestHandler = dyn Fn(&HttpRequest, &mut HttpResponse) + Send + Sync; +pub(crate) type NavigationHandler = dyn Fn(Url) -> bool + Send; #[derive(Clone, Serialize)] struct WindowCreatedEvent { @@ -108,6 +110,7 @@ pub struct WindowBuilder<'a, R: Runtime> { pub(crate) window_builder: >::WindowBuilder, pub(crate) webview_attributes: WebviewAttributes, web_resource_request_handler: Option>, + navigation_handler: Option>, } impl<'a, R: Runtime> fmt::Debug for WindowBuilder<'a, R> { @@ -181,6 +184,7 @@ impl<'a, R: Runtime> WindowBuilder<'a, R> { window_builder: >::WindowBuilder::new(), webview_attributes: WebviewAttributes::new(url), web_resource_request_handler: None, + navigation_handler: None, } } @@ -229,6 +233,33 @@ impl<'a, R: Runtime> WindowBuilder<'a, R> { self } + /// Defines a closure to be executed when the webview navigates to a URL. Returning `false` cancels the navigation. + /// + /// # Examples + /// + /// ```rust,no_run + /// use tauri::{ + /// utils::config::{Csp, CspDirectiveSources, WindowUrl}, + /// http::header::HeaderValue, + /// window::WindowBuilder, + /// }; + /// use std::collections::HashMap; + /// tauri::Builder::default() + /// .setup(|app| { + /// WindowBuilder::new(app, "core", WindowUrl::App("index.html".into())) + /// .on_navigation(|url| { + /// // allow the production URL or localhost on dev + /// url.scheme() == "tauri" || (cfg!(dev) && url.host_str() == Some("localhost")) + /// }) + /// .build()?; + /// Ok(()) + /// }); + /// ``` + pub fn on_navigation bool + Send + 'static>(mut self, f: F) -> Self { + self.navigation_handler.replace(Box::new(f)); + self + } + /// Creates a new webview window. pub fn build(mut self) -> crate::Result> { let web_resource_request_handler = self.web_resource_request_handler.take(); @@ -238,12 +269,13 @@ impl<'a, R: Runtime> WindowBuilder<'a, R> { self.label.clone(), )?; let labels = self.manager.labels().into_iter().collect::>(); - let pending = self.manager.prepare_window( + let mut pending = self.manager.prepare_window( self.app_handle.clone(), pending, &labels, web_resource_request_handler, )?; + pending.navigation_handler = self.navigation_handler.take(); let window = match &mut self.runtime { RuntimeOrDispatch::Runtime(runtime) => runtime.create_window(pending), RuntimeOrDispatch::RuntimeHandle(handle) => handle.create_window(pending), @@ -251,6 +283,11 @@ impl<'a, R: Runtime> WindowBuilder<'a, R> { } .map(|window| self.manager.attach_window(self.app_handle.clone(), window))?; + self.manager.eval_script_all(format!( + "window.__TAURI_METADATA__.__windows = {window_labels_array}.map(function (label) {{ return {{ label: label }} }})", + window_labels_array = serde_json::to_string(&self.manager.labels())?, + ))?; + self.manager.emit_filter( "tauri://window-created", None, @@ -398,6 +435,13 @@ impl<'a, R: Runtime> WindowBuilder<'a, R> { self } + /// Whether the window should always be on top of other windows. + #[must_use] + pub fn content_protected(mut self, protected: bool) -> Self { + self.window_builder = self.window_builder.content_protected(protected); + self + } + /// Sets the window icon. pub fn icon(mut self, icon: Icon) -> crate::Result { self.window_builder = self.window_builder.icon(icon.try_into()?)?; @@ -526,6 +570,22 @@ impl<'a, R: Runtime> WindowBuilder<'a, R> { self } + /// Set additional arguments for the webview. + /// + /// ## Platform-specific + /// + /// - **macOS / Linux / Android / iOS**: Unsupported. + /// + /// ## Warning + /// + /// By default wry passes `--disable-features=msWebOOUI,msPdfOOUI,msSmartScreenProtection` + /// so if you use this method, you also need to disable these components by yourself if you want. + #[must_use] + pub fn additional_browser_args(mut self, additional_args: &str) -> Self { + self.webview_attributes.additional_browser_args = Some(additional_args.to_string()); + self + } + /// Data directory for the webview. #[must_use] pub fn data_directory(mut self, data_directory: PathBuf) -> Self { @@ -888,6 +948,11 @@ impl Window { self.window.dispatcher.is_fullscreen().map_err(Into::into) } + /// Gets the window's current minimized state. + pub fn is_minimized(&self) -> crate::Result { + self.window.dispatcher.is_minimized().map_err(Into::into) + } + /// Gets the window's current maximized state. pub fn is_maximized(&self) -> crate::Result { self.window.dispatcher.is_maximized().map_err(Into::into) @@ -908,6 +973,11 @@ impl Window { self.window.dispatcher.is_visible().map_err(Into::into) } + /// Gets the window's current title. + pub fn title(&self) -> crate::Result { + self.window.dispatcher.title().map_err(Into::into) + } + /// Returns the monitor on which the window currently resides. /// /// Returns None if current monitor can't be detected. @@ -1115,6 +1185,15 @@ impl Window { .map_err(Into::into) } + /// Prevents the window contents from being captured by other apps. + pub fn set_content_protected(&self, protected: bool) -> crate::Result<()> { + self + .window + .dispatcher + .set_content_protected(protected) + .map_err(Into::into) + } + /// Resizes this window. pub fn set_size>(&self, size: S) -> crate::Result<()> { self @@ -1256,6 +1335,11 @@ impl Window { /// Webview APIs. impl Window { + /// Returns the current url of the webview. + pub fn url(&self) -> crate::Result { + self.window.dispatcher.url().map_err(Into::into) + } + /// Handles this window receiving an [`InvokeMessage`]. pub fn on_message(self, payload: InvokePayload) -> crate::Result<()> { let manager = self.manager.clone(); diff --git a/core/tests/app-updater/src/main.rs b/core/tests/app-updater/src/main.rs index d957fa1fd..db4a8db02 100644 --- a/core/tests/app-updater/src/main.rs +++ b/core/tests/app-updater/src/main.rs @@ -8,6 +8,13 @@ )] fn main() { + let mut context = tauri::generate_context!(); + if std::env::var("TARGET").unwrap_or_default() == "nsis" { + context.config_mut().tauri.updater.windows.installer_args = vec![format!( + "/D={}", + std::env::current_exe().unwrap().parent().unwrap().display() + )]; + } tauri::Builder::default() .setup(|app| { let handle = app.handle(); @@ -15,19 +22,19 @@ fn main() { match handle.updater().check().await { Ok(update) => { if let Err(e) = update.download_and_install().await { - println!("{}", e); + println!("{e}"); std::process::exit(1); } std::process::exit(0); } Err(e) => { - println!("{}", e); + println!("{e}"); std::process::exit(1); } } }); Ok(()) }) - .run(tauri::generate_context!()) + .run(context) .expect("error while running tauri application"); } diff --git a/core/tests/app-updater/tests/update.rs b/core/tests/app-updater/tests/update.rs index 2d3920e53..a6da06f8d 100644 --- a/core/tests/app-updater/tests/update.rs +++ b/core/tests/app-updater/tests/update.rs @@ -54,7 +54,13 @@ fn get_cli_bin_path(cli_dir: &Path, debug: bool) -> Option { } } -fn build_app(cli_bin_path: &Path, cwd: &Path, config: &Config, bundle_updater: bool) { +fn build_app( + cli_bin_path: &Path, + cwd: &Path, + config: &Config, + bundle_updater: bool, + target: BundleTarget, +) { let mut command = Command::new(cli_bin_path); command .args(["build", "--debug", "--verbose"]) @@ -62,18 +68,22 @@ fn build_app(cli_bin_path: &Path, cwd: &Path, config: &Config, bundle_updater: b .arg(serde_json::to_string(config).unwrap()) .current_dir(cwd); - #[cfg(windows)] - command.args(["--bundles", "msi"]); #[cfg(target_os = "linux")] - command.args(["--bundles", "appimage"]); + command.args(["--bundles", target.name()]); #[cfg(target_os = "macos")] - command.args(["--bundles", "app"]); + command.args(["--bundles", target.name()]); if bundle_updater { + #[cfg(windows)] + command.args(["--bundles", "msi", "nsis"]); + command .env("TAURI_PRIVATE_KEY", UPDATER_PRIVATE_KEY) .env("TAURI_KEY_PASSWORD", "") .args(["--bundles", "updater"]); + } else { + #[cfg(windows)] + command.args(["--bundles", target.name()]); } let status = command @@ -85,30 +95,83 @@ fn build_app(cli_bin_path: &Path, cwd: &Path, config: &Config, bundle_updater: b } } +#[derive(Copy, Clone)] +enum BundleTarget { + AppImage, + + App, + + Msi, + Nsis, +} + +impl BundleTarget { + fn name(self) -> &'static str { + match self { + Self::AppImage => "appimage", + Self::App => "app", + Self::Msi => "msi", + Self::Nsis => "nsis", + } + } +} + +impl Default for BundleTarget { + fn default() -> Self { + #[cfg(any(target_os = "macos", target_os = "ios"))] + return Self::App; + #[cfg(target_os = "linux")] + return Self::App; + #[cfg(windows)] + return Self::Nsis; + } +} + #[cfg(target_os = "linux")] -fn bundle_path(root_dir: &Path, version: &str) -> PathBuf { - root_dir.join(format!( - "target/debug/bundle/appimage/app-updater_{}_amd64.AppImage", - version - )) +fn bundle_paths(root_dir: &Path, version: &str) -> Vec<(BundleTarget, PathBuf)> { + vec![( + BundleTarget::AppImage, + root_dir.join(format!( + "target/debug/bundle/appimage/app-updater_{}_amd64.AppImage", + version + )), + )] } #[cfg(target_os = "macos")] -fn bundle_path(root_dir: &Path, _version: &str) -> PathBuf { - root_dir.join(format!("target/debug/bundle/macos/app-updater.app")) +fn bundle_paths(root_dir: &Path, _version: &str) -> Vec<(BundleTarget, PathBuf)> { + vec![( + BundleTarget::App, + root_dir.join(format!("target/debug/bundle/macos/app-updater.app")), + )] } #[cfg(target_os = "ios")] -fn bundle_path(root_dir: &Path, _version: &str) -> PathBuf { - root_dir.join(format!("target/debug/bundle/ios/app-updater.app")) +fn bundle_paths(root_dir: &Path, _version: &str) -> Vec<(BundleTarget, PathBuf)> { + vec![( + BundleTarget::App, + root_dir.join(format!("target/debug/bundle/ios/app-updater.app")), + )] } #[cfg(windows)] -fn bundle_path(root_dir: &Path, version: &str) -> PathBuf { - root_dir.join(format!( - "target/debug/bundle/msi/app-updater_{}_x64_en-US.msi", - version - )) +fn bundle_paths(root_dir: &Path, version: &str) -> Vec<(BundleTarget, PathBuf)> { + vec![ + ( + BundleTarget::Nsis, + root_dir.join(format!( + "target/debug/bundle/nsis/app-updater_{}_x64-setup.exe", + version + )), + ), + ( + BundleTarget::Msi, + root_dir.join(format!( + "target/debug/bundle/msi/app-updater_{}_x64_en-US.msi", + version + )), + ), + ] } #[test] @@ -140,99 +203,118 @@ fn update_app() { }; // bundle app update - build_app(&cli_bin_path, &manifest_dir, &config, true); + build_app( + &cli_bin_path, + &manifest_dir, + &config, + true, + Default::default(), + ); - let updater_ext = if cfg!(windows) { "zip" } else { "tar.gz" }; + let updater_zip_ext = if cfg!(windows) { "zip" } else { "tar.gz" }; - let out_bundle_path = bundle_path(&root_dir, "1.0.0"); - let signature_path = out_bundle_path.with_extension(format!( - "{}.{}.sig", - out_bundle_path.extension().unwrap().to_str().unwrap(), - updater_ext - )); - let signature = std::fs::read_to_string(&signature_path) - .unwrap_or_else(|_| panic!("failed to read signature file {}", signature_path.display())); - let out_updater_path = out_bundle_path.with_extension(format!( - "{}.{}", - out_bundle_path.extension().unwrap().to_str().unwrap(), - updater_ext - )); - let updater_path = root_dir.join(format!( - "target/debug/{}", - out_updater_path.file_name().unwrap().to_str().unwrap() - )); - std::fs::rename(&out_updater_path, &updater_path).expect("failed to rename bundle"); + for (bundle_target, out_bundle_path) in bundle_paths(&root_dir, "1.0.0") { + let bundle_updater_ext = out_bundle_path + .extension() + .unwrap() + .to_str() + .unwrap() + .replace("exe", "nsis"); + let signature_path = + out_bundle_path.with_extension(format!("{}.{}.sig", bundle_updater_ext, updater_zip_ext)); + let signature = std::fs::read_to_string(&signature_path) + .unwrap_or_else(|_| panic!("failed to read signature file {}", signature_path.display())); + let out_updater_path = + out_bundle_path.with_extension(format!("{}.{}", bundle_updater_ext, updater_zip_ext)); + let updater_path = root_dir.join(format!( + "target/debug/{}", + out_updater_path.file_name().unwrap().to_str().unwrap() + )); + std::fs::rename(&out_updater_path, &updater_path).expect("failed to rename bundle"); - std::thread::spawn(move || { - // start the updater server - let server = tiny_http::Server::http("localhost:3007").expect("failed to start updater server"); + let target = target.clone(); + std::thread::spawn(move || { + // start the updater server + let server = + tiny_http::Server::http("localhost:3007").expect("failed to start updater server"); - loop { - if let Ok(request) = server.recv() { - match request.url() { - "/" => { - let mut platforms = HashMap::new(); + loop { + if let Ok(request) = server.recv() { + match request.url() { + "/" => { + let mut platforms = HashMap::new(); - platforms.insert( - target.clone(), - PlatformUpdate { - signature: signature.clone(), - url: "http://localhost:3007/download", - with_elevated_task: false, - }, - ); - let body = serde_json::to_vec(&Update { - version: "1.0.0", - date: time::OffsetDateTime::now_utc() - .format(&time::format_description::well_known::Rfc3339) - .unwrap(), - platforms, - }) - .unwrap(); - let len = body.len(); - let response = tiny_http::Response::new( - tiny_http::StatusCode(200), - Vec::new(), - std::io::Cursor::new(body), - Some(len), - None, - ); - let _ = request.respond(response); + platforms.insert( + target.clone(), + PlatformUpdate { + signature: signature.clone(), + url: "http://localhost:3007/download", + with_elevated_task: false, + }, + ); + let body = serde_json::to_vec(&Update { + version: "1.0.0", + date: time::OffsetDateTime::now_utc() + .format(&time::format_description::well_known::Rfc3339) + .unwrap(), + platforms, + }) + .unwrap(); + let len = body.len(); + let response = tiny_http::Response::new( + tiny_http::StatusCode(200), + Vec::new(), + std::io::Cursor::new(body), + Some(len), + None, + ); + let _ = request.respond(response); + } + "/download" => { + let _ = request.respond(tiny_http::Response::from_file( + File::open(&updater_path).unwrap_or_else(|_| { + panic!("failed to open updater bundle {}", updater_path.display()) + }), + )); + // close server + return; + } + _ => (), } - "/download" => { - let _ = request.respond(tiny_http::Response::from_file( - File::open(&updater_path).unwrap_or_else(|_| { - panic!("failed to open updater bundle {}", updater_path.display()) - }), - )); - } - _ => (), } } + }); + + config.package.version = "0.1.0"; + + // bundle initial app version + build_app(&cli_bin_path, &manifest_dir, &config, false, bundle_target); + + let mut binary_cmd = if cfg!(windows) { + Command::new(root_dir.join("target/debug/app-updater.exe")) + } else if cfg!(target_os = "macos") { + Command::new( + bundle_paths(&root_dir, "0.1.0") + .first() + .unwrap() + .1 + .join("Contents/MacOS/app-updater"), + ) + } else if std::env::var("CI").map(|v| v == "true").unwrap_or_default() { + let mut c = Command::new("xvfb-run"); + c.arg("--auto-servernum") + .arg(&bundle_paths(&root_dir, "0.1.0").first().unwrap().1); + c + } else { + Command::new(&bundle_paths(&root_dir, "0.1.0").first().unwrap().1) + }; + + binary_cmd.env("TARGET", bundle_target.name()); + + let status = binary_cmd.status().expect("failed to run app"); + + if !status.success() { + panic!("failed to run app"); } - }); - - config.package.version = "0.1.0"; - - // bundle initial app version - build_app(&cli_bin_path, &manifest_dir, &config, false); - - let mut binary_cmd = if cfg!(windows) { - Command::new(root_dir.join("target/debug/app-updater.exe")) - } else if cfg!(target_os = "macos") { - Command::new(bundle_path(&root_dir, "0.1.0").join("Contents/MacOS/app-updater")) - } else if std::env::var("CI").map(|v| v == "true").unwrap_or_default() { - let mut c = Command::new("xvfb-run"); - c.arg("--auto-servernum") - .arg(bundle_path(&root_dir, "0.1.0")); - c - } else { - Command::new(bundle_path(&root_dir, "0.1.0")) - }; - - let status = binary_cmd.status().expect("failed to run app"); - - if !status.success() { - panic!("failed to run app"); } } diff --git a/core/tests/restart/src/main.rs b/core/tests/restart/src/main.rs index 3a6848c57..b03243562 100644 --- a/core/tests/restart/src/main.rs +++ b/core/tests/restart/src/main.rs @@ -24,7 +24,7 @@ fn main() { env.args.clear(); tauri::api::process::restart(&env) } - Some(invalid) => panic!("only argument `restart` is allowed, {} is invalid", invalid), + Some(invalid) => panic!("only argument `restart` is allowed, {invalid} is invalid"), None => {} }; } diff --git a/core/tests/restart/tests/restart.rs b/core/tests/restart/tests/restart.rs index 3a6662ec1..db458a4eb 100644 --- a/core/tests/restart/tests/restart.rs +++ b/core/tests/restart/tests/restart.rs @@ -32,7 +32,7 @@ fn symlink_runner(create_symlinks: impl Fn(&Path) -> io::Result) -> Res if cfg!(windows) { compiled_binary.set_extension("exe"); } - println!("{:?}", compiled_binary); + println!("{compiled_binary:?}"); // set up all the temporary file paths let temp = tempfile::TempDir::new()?; diff --git a/examples/api/dist/assets/index.css b/examples/api/dist/assets/index.css index c1feae7e6..f4435ce37 100644 --- a/examples/api/dist/assets/index.css +++ b/examples/api/dist/assets/index.css @@ -1 +1 @@ -*,::before,::after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x:var(--un-empty,/*!*/ /*!*/);--un-pan-y:var(--un-empty,/*!*/ /*!*/);--un-pinch-zoom:var(--un-empty,/*!*/ /*!*/);--un-scroll-snap-strictness:proximity;--un-ordinal:var(--un-empty,/*!*/ /*!*/);--un-slashed-zero:var(--un-empty,/*!*/ /*!*/);--un-numeric-figure:var(--un-empty,/*!*/ /*!*/);--un-numeric-spacing:var(--un-empty,/*!*/ /*!*/);--un-numeric-fraction:var(--un-empty,/*!*/ /*!*/);--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 #0000;--un-ring-shadow:0 0 #0000;--un-shadow-inset:var(--un-empty,/*!*/ /*!*/);--un-shadow:0 0 #0000;--un-ring-inset:var(--un-empty,/*!*/ /*!*/);--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,0.5);--un-blur:var(--un-empty,/*!*/ /*!*/);--un-brightness:var(--un-empty,/*!*/ /*!*/);--un-contrast:var(--un-empty,/*!*/ /*!*/);--un-drop-shadow:var(--un-empty,/*!*/ /*!*/);--un-grayscale:var(--un-empty,/*!*/ /*!*/);--un-hue-rotate:var(--un-empty,/*!*/ /*!*/);--un-invert:var(--un-empty,/*!*/ /*!*/);--un-saturate:var(--un-empty,/*!*/ /*!*/);--un-sepia:var(--un-empty,/*!*/ /*!*/);--un-backdrop-blur:var(--un-empty,/*!*/ /*!*/);--un-backdrop-brightness:var(--un-empty,/*!*/ /*!*/);--un-backdrop-contrast:var(--un-empty,/*!*/ /*!*/);--un-backdrop-grayscale:var(--un-empty,/*!*/ /*!*/);--un-backdrop-hue-rotate:var(--un-empty,/*!*/ /*!*/);--un-backdrop-invert:var(--un-empty,/*!*/ /*!*/);--un-backdrop-opacity:var(--un-empty,/*!*/ /*!*/);--un-backdrop-saturate:var(--un-empty,/*!*/ /*!*/);--un-backdrop-sepia:var(--un-empty,/*!*/ /*!*/);}@font-face { font-family: 'Fira Code'; font-style: normal; font-weight: 400; font-display: swap; src: url(https://fonts.gstatic.com/s/firacode/v21/uU9eCBsR6Z2vfE9aq3bL0fxyUs4tcw4W_D1sFVc.ttf) format('truetype');}@font-face { font-family: 'Fira Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(https://fonts.gstatic.com/s/firamono/v14/N0bX2SlFPv1weGeLZDtQIQ.ttf) format('truetype');}@font-face { font-family: 'Fira Mono'; font-style: normal; font-weight: 700; font-display: swap; src: url(https://fonts.gstatic.com/s/firamono/v14/N0bS2SlFPv1weGeLZDtondv3mQ.ttf) format('truetype');}@font-face { font-family: 'Rubik'; font-style: normal; font-weight: 400; font-display: swap; src: url(https://fonts.gstatic.com/s/rubik/v21/iJWZBXyIfDnIV5PNhY1KTN7Z-Yh-B4i1UA.ttf) format('truetype');}.i-codicon-bell-dot{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='currentColor'%3E%3Cpath fill-rule='evenodd' d='M12.994 7.875A4.008 4.008 0 0 1 12 8h-.01v.217c0 .909.143 1.818.442 2.691l.371 1.113h-9.63v-.012l.37-1.113a8.633 8.633 0 0 0 .443-2.691V6.004c0-.563.12-1.113.347-1.616c.227-.514.55-.969.969-1.34c.419-.382.91-.67 1.436-.837c.538-.18 1.1-.24 1.65-.18l.12.018a4 4 0 0 1 .673-.887a5.15 5.15 0 0 0-.697-.135c-.694-.072-1.4 0-2.07.227c-.67.215-1.28.574-1.794 1.053a4.923 4.923 0 0 0-1.208 1.675a5.067 5.067 0 0 0-.431 2.022v2.2a7.61 7.61 0 0 1-.383 2.37L2 12.343l.479.658h3.505c0 .526.215 1.04.586 1.412c.37.37.885.586 1.412.586c.526 0 1.04-.215 1.411-.586s.587-.886.587-1.412h3.505l.478-.658l-.586-1.77a7.63 7.63 0 0 1-.383-2.381v-.318ZM7.982 14.02a.997.997 0 0 0 .706-.3a.939.939 0 0 0 .287-.705H6.977c0 .263.107.514.299.706a.999.999 0 0 0 .706.299Z' clip-rule='evenodd'/%3E%3Cpath d='M12 7a3 3 0 1 0 0-6a3 3 0 0 0 0 6Z'/%3E%3C/g%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-chrome-close{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='m7.116 8l-4.558 4.558l.884.884L8 8.884l4.558 4.558l.884-.884L8.884 8l4.558-4.558l-.884-.884L8 7.116L3.442 2.558l-.884.884L7.116 8z' clip-rule='evenodd'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-chrome-maximize{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M3 3v10h10V3H3zm9 9H4V4h8v8z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-chrome-minimize{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M14 8v1H3V8h11z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-chrome-restore{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='currentColor'%3E%3Cpath d='M3 5v9h9V5H3zm8 8H4V6h7v7z'/%3E%3Cpath fill-rule='evenodd' d='M5 5h1V4h7v7h-1v1h2V3H5v2z' clip-rule='evenodd'/%3E%3C/g%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-clear-all{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='m10 12.6l.7.7l1.6-1.6l1.6 1.6l.8-.7L13 11l1.7-1.6l-.8-.8l-1.6 1.7l-1.6-1.7l-.7.8l1.6 1.6l-1.6 1.6zM1 4h14V3H1v1zm0 3h14V6H1v1zm8 2.5V9H1v1h8v-.5zM9 13v-1H1v1h8z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-clippy{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M7 13.992H4v-9h8v2h1v-2.5l-.5-.5H11v-1h-1a2 2 0 0 0-4 0H4.94v1H3.5l-.5.5v10l.5.5H7v-1zm0-11.2a1 1 0 0 1 .8-.8a1 1 0 0 1 .58.06a.94.94 0 0 1 .45.36a1 1 0 1 1-1.75.94a1 1 0 0 1-.08-.56zm7.08 9.46L13 13.342v-5.35h-1v5.34l-1.08-1.08l-.71.71l1.94 1.93h.71l1.93-1.93l-.71-.71zm-5.92-4.16h.71l1.93 1.93l-.71.71l-1.08-1.08v5.34h-1v-5.35l-1.08 1.09l-.71-.71l1.94-1.93z' clip-rule='evenodd'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-close{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='m8 8.707l3.646 3.647l.708-.707L8.707 8l3.647-3.646l-.707-.708L8 7.293L4.354 3.646l-.707.708L7.293 8l-3.646 3.646l.707.708L8 8.707z' clip-rule='evenodd'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-cloud-download{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M11.957 6h.05a2.99 2.99 0 0 1 2.116.879a3.003 3.003 0 0 1 0 4.242a2.99 2.99 0 0 1-2.117.879v-1a2.002 2.002 0 0 0 0-4h-.914l-.123-.857a2.49 2.49 0 0 0-2.126-2.122A2.478 2.478 0 0 0 6.231 5.5l-.333.762l-.809-.189A2.49 2.49 0 0 0 4.523 6c-.662 0-1.297.263-1.764.732A2.503 2.503 0 0 0 4.523 11h.498v1h-.498a3.486 3.486 0 0 1-2.628-1.16a3.502 3.502 0 0 1 1.958-5.78a3.462 3.462 0 0 1 1.468.04a3.486 3.486 0 0 1 3.657-2.06A3.479 3.479 0 0 1 11.957 6zm-5.25 5.121l1.314 1.314V7h.994v5.4l1.278-1.279l.707.707l-2.146 2.147h-.708L6 11.829l.707-.708z' clip-rule='evenodd'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-files{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 24 24' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M17.5 0h-9L7 1.5V6H2.5L1 7.5v15.07L2.5 24h12.07L16 22.57V18h4.7l1.3-1.43V4.5L17.5 0zm0 2.12l2.38 2.38H17.5V2.12zm-3 20.38h-12v-15H7v9.07L8.5 18h6v4.5zm6-6h-12v-15H16V6h4.5v10.5z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-hubot{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M8.48 4h4l.5.5v2.03h.52l.5.5V8l-.5.5h-.52v3l-.5.5H9.36l-2.5 2.76L6 14.4V12H3.5l-.5-.64V8.5h-.5L2 8v-.97l.5-.5H3V4.36L3.53 4h4V2.86A1 1 0 0 1 7 2a1 1 0 0 1 2 0a1 1 0 0 1-.52.83V4zM12 8V5H4v5.86l2.5.14H7v2.19l1.8-2.04l.35-.15H12V8zm-2.12.51a2.71 2.71 0 0 1-1.37.74v-.01a2.71 2.71 0 0 1-2.42-.74l-.7.71c.34.34.745.608 1.19.79c.45.188.932.286 1.42.29a3.7 3.7 0 0 0 2.58-1.07l-.7-.71zM6.49 6.5h-1v1h1v-1zm3 0h1v1h-1v-1z' clip-rule='evenodd'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-link-external{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='currentColor'%3E%3Cpath d='M1.5 1H6v1H2v12h12v-4h1v4.5l-.5.5h-13l-.5-.5v-13l.5-.5z'/%3E%3Cpath d='M15 1.5V8h-1V2.707L7.243 9.465l-.707-.708L13.293 2H8V1h6.5l.5.5z'/%3E%3C/g%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-menu{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M16 5H0V4h16v1zm0 8H0v-1h16v1zm0-4.008H0V8h16v.992z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-multiple-windows{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='m6 1.5l.5-.5h8l.5.5v7l-.5.5H12V8h2V4H7v1H6V1.5zM7 2v1h7V2H7zM1.5 7l-.5.5v7l.5.5h8l.5-.5v-7L9.5 7h-8zM2 9V8h7v1H2zm0 1h7v4H2v-4z' clip-rule='evenodd'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-radio-tower{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M2.998 5.58a5.55 5.55 0 0 1 1.62-3.88l-.71-.7a6.45 6.45 0 0 0 0 9.16l.71-.7a5.55 5.55 0 0 1-1.62-3.88zm1.06 0a4.42 4.42 0 0 0 1.32 3.17l.71-.71a3.27 3.27 0 0 1-.76-1.12a3.45 3.45 0 0 1 0-2.67a3.22 3.22 0 0 1 .76-1.13l-.71-.71a4.46 4.46 0 0 0-1.32 3.17zm7.65 3.21l-.71-.71c.33-.32.59-.704.76-1.13a3.449 3.449 0 0 0 0-2.67a3.22 3.22 0 0 0-.76-1.13l.71-.7a4.468 4.468 0 0 1 0 6.34zM13.068 1l-.71.71a5.43 5.43 0 0 1 0 7.74l.71.71a6.45 6.45 0 0 0 0-9.16zM9.993 5.43a1.5 1.5 0 0 1-.245.98a2 2 0 0 1-.27.23l3.44 7.73l-.92.4l-.77-1.73h-5.54l-.77 1.73l-.92-.4l3.44-7.73a1.52 1.52 0 0 1-.33-1.63a1.55 1.55 0 0 1 .56-.68a1.5 1.5 0 0 1 2.325 1.1zm-1.595-.34a.52.52 0 0 0-.25.14a.52.52 0 0 0-.11.22a.48.48 0 0 0 0 .29c.04.09.102.17.18.23a.54.54 0 0 0 .28.08a.51.51 0 0 0 .5-.5a.54.54 0 0 0-.08-.28a.58.58 0 0 0-.23-.18a.48.48 0 0 0-.29 0zm.23 2.05h-.27l-.87 1.94h2l-.86-1.94zm2.2 4.94l-.89-2h-2.88l-.89 2h4.66z' clip-rule='evenodd'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-record-keys{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M14 3H3a1 1 0 0 0-1 1v7a1 1 0 0 0 1 1h11a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1zm0 8H3V4h11v7zm-3-6h-1v1h1V5zm-1 2H9v1h1V7zm2-2h1v1h-1V5zm1 4h-1v1h1V9zM6 9h5v1H6V9zm7-2h-2v1h2V7zM8 5h1v1H8V5zm0 2H7v1h1V7zM4 9h1v1H4V9zm0-4h1v1H4V5zm3 0H6v1h1V5zM4 7h2v1H4V7z' clip-rule='evenodd'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-terminal{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 24 24' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M3 1.5L1.5 3v18L3 22.5h18l1.5-1.5V3L21 1.5H3zM3 21V3h18v18H3zm5.656-4.01l1.038 1.061l5.26-5.243v-.912l-5.26-5.26l-1.035 1.06l4.59 4.702l-4.593 4.592z' clip-rule='evenodd'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-terminal-bash{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M13.655 3.56L8.918.75a1.785 1.785 0 0 0-1.82 0L2.363 3.56a1.889 1.889 0 0 0-.921 1.628v5.624a1.889 1.889 0 0 0 .913 1.627l4.736 2.812a1.785 1.785 0 0 0 1.82 0l4.736-2.812a1.888 1.888 0 0 0 .913-1.627V5.188a1.889 1.889 0 0 0-.904-1.627zm-3.669 8.781v.404a.149.149 0 0 1-.07.124l-.239.137c-.038.02-.07 0-.07-.053v-.396a.78.78 0 0 1-.545.053a.073.073 0 0 1-.027-.09l.086-.365a.153.153 0 0 1 .071-.096a.048.048 0 0 1 .038 0a.662.662 0 0 0 .497-.063a.662.662 0 0 0 .37-.567c0-.206-.112-.292-.384-.293c-.344 0-.661-.066-.67-.574A1.47 1.47 0 0 1 9.6 9.437V9.03a.147.147 0 0 1 .07-.126l.231-.147c.038-.02.07 0 .07.054v.409a.754.754 0 0 1 .453-.055a.073.073 0 0 1 .03.095l-.081.362a.156.156 0 0 1-.065.09a.055.055 0 0 1-.035 0a.6.6 0 0 0-.436.072a.549.549 0 0 0-.331.486c0 .185.098.242.425.248c.438 0 .627.199.632.639a1.568 1.568 0 0 1-.576 1.185zm2.481-.68a.094.094 0 0 1-.036.092l-1.198.727a.034.034 0 0 1-.04.003a.035.035 0 0 1-.016-.037v-.31a.086.086 0 0 1 .055-.076l1.179-.706a.035.035 0 0 1 .056.035v.273zm.827-6.914L8.812 7.515c-.559.331-.97.693-.97 1.367v5.52c0 .404.165.662.413.741a1.465 1.465 0 0 1-.248.025c-.264 0-.522-.072-.748-.207L2.522 12.15a1.558 1.558 0 0 1-.75-1.338V5.188a1.558 1.558 0 0 1 .75-1.34l4.738-2.81a1.46 1.46 0 0 1 1.489 0l4.736 2.812a1.548 1.548 0 0 1 .728 1.083c-.154-.334-.508-.427-.92-.185h.002z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-window{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M14.5 2h-13l-.5.5v11l.5.5h13l.5-.5v-11l-.5-.5zM14 13H2V6h12v7zm0-8H2V3h12v2z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-ph-broadcast{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M128 88a40 40 0 1 0 40 40a40 40 0 0 0-40-40Zm0 64a24 24 0 1 1 24-24a24.1 24.1 0 0 1-24 24Zm-59-48.9a64.5 64.5 0 0 0 0 49.8a65.4 65.4 0 0 0 13.7 20.4a7.9 7.9 0 0 1 0 11.3a8 8 0 0 1-5.6 2.3a8.3 8.3 0 0 1-5.7-2.3a80 80 0 0 1-17.1-25.5a79.9 79.9 0 0 1 0-62.2a80 80 0 0 1 17.1-25.5a8 8 0 0 1 11.3 0a7.9 7.9 0 0 1 0 11.3A65.4 65.4 0 0 0 69 103.1Zm132.7 56a80 80 0 0 1-17.1 25.5a8.3 8.3 0 0 1-5.7 2.3a8 8 0 0 1-5.6-2.3a7.9 7.9 0 0 1 0-11.3a65.4 65.4 0 0 0 13.7-20.4a64.5 64.5 0 0 0 0-49.8a65.4 65.4 0 0 0-13.7-20.4a7.9 7.9 0 0 1 0-11.3a8 8 0 0 1 11.3 0a80 80 0 0 1 17.1 25.5a79.9 79.9 0 0 1 0 62.2ZM54.5 201.5a8.1 8.1 0 0 1 0 11.4a8.3 8.3 0 0 1-5.7 2.3a8.5 8.5 0 0 1-5.7-2.3a121.8 121.8 0 0 1-25.7-38.2a120.7 120.7 0 0 1 0-93.4a121.8 121.8 0 0 1 25.7-38.2a8.1 8.1 0 0 1 11.4 11.4A103.5 103.5 0 0 0 24 128a103.5 103.5 0 0 0 30.5 73.5ZM248 128a120.2 120.2 0 0 1-9.4 46.7a121.8 121.8 0 0 1-25.7 38.2a8.5 8.5 0 0 1-5.7 2.3a8.3 8.3 0 0 1-5.7-2.3a8.1 8.1 0 0 1 0-11.4A103.5 103.5 0 0 0 232 128a103.5 103.5 0 0 0-30.5-73.5a8.1 8.1 0 1 1 11.4-11.4a121.8 121.8 0 0 1 25.7 38.2A120.2 120.2 0 0 1 248 128Z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-ph-globe-hemisphere-west{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M221.6 173.3A102.9 102.9 0 0 0 232 128a104.2 104.2 0 0 0-77.2-100.5h-.5A103.8 103.8 0 0 0 60.4 49l-1.3 1.2A103.9 103.9 0 0 0 128 232h2.4a104.3 104.3 0 0 0 90.6-57.4ZM216 128a89.3 89.3 0 0 1-5.5 30.7l-46.4-28.5a16.6 16.6 0 0 0-6.3-2.3l-22.8-3a16.1 16.1 0 0 0-15.3 6.8h-8.6l-3.8-7.9a15.9 15.9 0 0 0-11-8.7l-6.6-1.4l4.6-10.8h21.4a16.1 16.1 0 0 0 7.7-2l12.2-6.8a16.1 16.1 0 0 0 3-2.1l26.9-24.4a15.7 15.7 0 0 0 4.5-16.9a88 88 0 0 1 46 77.3Zm-68.8-85.9l7.6 13.7l-26.9 24.3l-12.2 6.8H94.3a15.9 15.9 0 0 0-14.7 9.8l-5.3 12.4l-10.9-29.2l8.1-19.3a88 88 0 0 1 75.7-18.5ZM40 128a87.1 87.1 0 0 1 9.5-39.7l10.4 27.9a16.1 16.1 0 0 0 11.6 10l5.5 1.2h.1l15.8 3.4l3.8 7.9a16.3 16.3 0 0 0 14.4 9h1.2l-7.7 17.2a15.9 15.9 0 0 0 2.8 17.4l18.8 20.4l-2.5 13.2A88.1 88.1 0 0 1 40 128Zm100.1 87.2l1.8-9.5a16 16 0 0 0-3.9-13.9l-18.8-20.3l12.7-28.7l1-2.1l22.8 3.1l47.8 29.4a88.5 88.5 0 0 1-63.4 42Z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-ph-hand-waving{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='m220.2 104l-20-34.7a28.1 28.1 0 0 0-47.3-1.9l-17.3-30a28.1 28.1 0 0 0-38.3-10.3a29.4 29.4 0 0 0-9.9 9.6a27.9 27.9 0 0 0-11.5-6.2a27.2 27.2 0 0 0-21.2 2.8a27.9 27.9 0 0 0-10.3 38.2l3.4 5.8A28.5 28.5 0 0 0 36 81a28.1 28.1 0 0 0-10.2 38.2l42 72.8a88 88 0 1 0 152.4-88Zm-6.7 62.6a71.2 71.2 0 0 1-33.5 43.7A72.1 72.1 0 0 1 81.6 184l-42-72.8a12 12 0 0 1 20.8-12l22 38.1l.6.9v.2l.5.5l.2.2l.7.6h.1l.7.5h.3l.6.3h.2l.9.3h.1l.8.2h2.2l.9-.2h.3l.6-.2h.3l.9-.4a8.1 8.1 0 0 0 2.9-11l-22-38.1l-16-27.7a12 12 0 0 1-1.2-9.1a11.8 11.8 0 0 1 5.6-7.3a12 12 0 0 1 9.1-1.2a12.5 12.5 0 0 1 7.3 5.6l8 14h.1l26 45a7 7 0 0 0 1.5 1.9a8 8 0 0 0 12.3-9.9l-26-45a12 12 0 1 1 20.8-12l30 51.9l6.3 11a48.1 48.1 0 0 0-10.9 61a8 8 0 0 0 13.8-8a32 32 0 0 1 11.7-43.7l.7-.4l.5-.4h.1l.6-.6l.5-.5l.4-.5l.3-.6h.1l.2-.5v-.2a1.9 1.9 0 0 0 .2-.7h.1c0-.2.1-.4.1-.6s0-.2.1-.2v-2.1a6.4 6.4 0 0 0-.2-.7a1.9 1.9 0 0 0-.2-.7v-.2c0-.2-.1-.3-.2-.5l-.3-.7l-10-17.4a12 12 0 0 1 13.5-17.5a11.8 11.8 0 0 1 7.2 5.5l20 34.7a70.9 70.9 0 0 1 7.2 53.8Zm-125.8 78a8.2 8.2 0 0 1-6.6 3.4a8.6 8.6 0 0 1-4.6-1.4A117.9 117.9 0 0 1 41.1 208a8 8 0 1 1 13.8-8a102.6 102.6 0 0 0 30.8 33.4a8.1 8.1 0 0 1 2 11.2ZM168 31a8 8 0 0 1 8-8a60.2 60.2 0 0 1 52 30a7.9 7.9 0 0 1-3 10.9a7.1 7.1 0 0 1-4 1.1a8 8 0 0 1-6.9-4A44 44 0 0 0 176 39a8 8 0 0 1-8-8Z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-ph-moon{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M224.3 150.3a8.1 8.1 0 0 0-7.8-5.7l-2.2.4A84 84 0 0 1 111 41.6a5.7 5.7 0 0 0 .3-1.8a7.9 7.9 0 0 0-10.3-8.1a100 100 0 1 0 123.3 123.2a7.2 7.2 0 0 0 0-4.6ZM128 212A84 84 0 0 1 92.8 51.7a99.9 99.9 0 0 0 111.5 111.5A84.4 84.4 0 0 1 128 212Z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-ph-sun{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M128 60a68 68 0 1 0 68 68a68.1 68.1 0 0 0-68-68Zm0 120a52 52 0 1 1 52-52a52 52 0 0 1-52 52Zm-8-144V16a8 8 0 0 1 16 0v20a8 8 0 0 1-16 0ZM43.1 54.5a8.1 8.1 0 1 1 11.4-11.4l14.1 14.2a8 8 0 0 1 0 11.3a8.1 8.1 0 0 1-11.3 0ZM36 136H16a8 8 0 0 1 0-16h20a8 8 0 0 1 0 16Zm32.6 51.4a8 8 0 0 1 0 11.3l-14.1 14.2a8.3 8.3 0 0 1-5.7 2.3a8.5 8.5 0 0 1-5.7-2.3a8.1 8.1 0 0 1 0-11.4l14.2-14.1a8 8 0 0 1 11.3 0ZM136 220v20a8 8 0 0 1-16 0v-20a8 8 0 0 1 16 0Zm76.9-18.5a8.1 8.1 0 0 1 0 11.4a8.5 8.5 0 0 1-5.7 2.3a8.3 8.3 0 0 1-5.7-2.3l-14.1-14.2a8 8 0 0 1 11.3-11.3ZM248 128a8 8 0 0 1-8 8h-20a8 8 0 0 1 0-16h20a8 8 0 0 1 8 8Zm-60.6-59.4a8 8 0 0 1 0-11.3l14.1-14.2a8.1 8.1 0 0 1 11.4 11.4l-14.2 14.1a8.1 8.1 0 0 1-11.3 0Z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.note{position:relative;display:inline-flex;align-items:center;border-left-width:4px;border-left-style:solid;--un-border-opacity:1;border-color:rgba(53,120,229,var(--un-border-opacity));border-radius:0.25rem;background-color:rgba(53,120,229,0.1);padding:0.5rem;text-decoration:none;}.note-red{position:relative;display:inline-flex;align-items:center;border-left-width:4px;border-left-style:solid;--un-border-opacity:1;border-color:rgba(53,120,229,var(--un-border-opacity));border-radius:0.25rem;background-color:rgba(53,120,229,0.1);background-color:rgba(185,28,28,0.1);padding:0.5rem;text-decoration:none;}.nv{position:relative;display:flex;align-items:center;border-radius:0.25rem;padding:0.5rem;--un-text-opacity:1;color:rgba(194,197,202,var(--un-text-opacity));text-decoration:none;transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:125ms;}.nv_selected{position:relative;display:flex;align-items:center;border-left-width:4px;border-left-style:solid;border-radius:0.25rem;--un-bg-opacity:.05;background-color:hsla(0,0%,100%,var(--un-bg-opacity));padding:0.5rem;--un-text-opacity:1;color:rgba(194,197,202,var(--un-text-opacity));color:rgba(53,120,229,var(--un-text-opacity));text-decoration:none;transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:125ms;}.input{height:2.5rem;display:flex;align-items:center;border-radius:0.25rem;border-style:none;--un-bg-opacity:1;background-color:rgba(233,236,239,var(--un-bg-opacity));padding:0.5rem;--un-text-opacity:1;color:rgba(28,30,33,var(--un-text-opacity));--un-shadow:var(--un-shadow-inset) 0 4px 6px -1px var(--un-shadow-color, rgba(0,0,0,0.1)),var(--un-shadow-inset) 0 2px 4px -2px var(--un-shadow-color, rgba(0,0,0,0.1));box-shadow:var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow);outline:2px solid transparent;outline-offset:2px;}.btn{user-select:none;border-radius:0.25rem;border-style:none;--un-bg-opacity:1;background-color:rgba(53,120,229,var(--un-bg-opacity));padding:0.5rem;font-weight:400;--un-text-opacity:1;color:rgba(28,30,33,var(--un-text-opacity));color:rgba(255,255,255,var(--un-text-opacity));--un-shadow:var(--un-shadow-inset) 0 4px 6px -1px var(--un-shadow-color, rgba(0,0,0,0.1)),var(--un-shadow-inset) 0 2px 4px -2px var(--un-shadow-color, rgba(0,0,0,0.1));box-shadow:var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow);outline:2px solid transparent;outline-offset:2px;}.nv_selected:hover,.nv:hover{border-left-width:4px;border-left-style:solid;--un-bg-opacity:.05;background-color:hsla(0,0%,100%,var(--un-bg-opacity));--un-text-opacity:1;color:rgba(53,120,229,var(--un-text-opacity));}.dark .note{--un-border-opacity:1;border-color:rgba(103,214,237,var(--un-border-opacity));background-color:rgba(103,214,237,0.1);}.dark .note-red{--un-border-opacity:1;border-color:rgba(103,214,237,var(--un-border-opacity));background-color:rgba(103,214,237,0.1);background-color:rgba(185,28,28,0.1);}.btn:hover{--un-bg-opacity:1;background-color:rgba(45,102,195,var(--un-bg-opacity));}.dark .btn{--un-bg-opacity:1;background-color:rgba(103,214,237,var(--un-bg-opacity));font-weight:600;--un-text-opacity:1;color:rgba(28,30,33,var(--un-text-opacity));}.dark .btn:hover{--un-bg-opacity:1;background-color:rgba(57,202,232,var(--un-bg-opacity));}.dark .input{--un-bg-opacity:1;background-color:rgba(36,37,38,var(--un-bg-opacity));--un-text-opacity:1;color:rgba(227,227,227,var(--un-text-opacity));}.dark .note-red::after,.note-red::after{--un-bg-opacity:1;background-color:rgba(185,28,28,var(--un-bg-opacity));}.btn:active{--un-bg-opacity:1;background-color:rgba(37,84,160,var(--un-bg-opacity));}.dark .btn:active{--un-bg-opacity:1;background-color:rgba(25,181,213,var(--un-bg-opacity));}.dark .nv_selected,.dark .nv_selected:hover,.dark .nv:hover{--un-text-opacity:1;color:rgba(103,214,237,var(--un-text-opacity));} ::-webkit-scrollbar-thumb { background-color: #3578E5; } .dark ::-webkit-scrollbar-thumb { background-color: #67d6ed; } code { font-size: 0.75rem; font-family: "Fira Code","Fira Mono",ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace; border-radius: 0.25rem; background-color: #d6d8da; } .code-block { font-family: "Fira Code","Fira Mono",ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace; font-size: 0.875rem; } .dark code { background-color: #282a2e; } .visible{visibility:visible;}.absolute{position:absolute;}.left-2{left:0.5rem;}.top-2{top:0.5rem;}.z-2000{z-index:2000;}.grid{display:grid;}.grid-rows-\[2fr_auto\]{grid-template-rows:2fr auto;}.grid-rows-\[2px_2rem_1fr\]{grid-template-rows:2px 2rem 1fr;}.grid-rows-\[auto_1fr\]{grid-template-rows:auto 1fr;}.my-2{margin-top:0.5rem;margin-bottom:0.5rem;}.mb-2{margin-bottom:0.5rem;}.mr-2{margin-right:0.5rem;}.display-none,.hidden{display:none;}.children-h-10>*,.children\:h10>*{height:2.5rem;}.children\:h-100\%>*,.h-100\%{height:100%;}.children\:w-12>*{width:3rem;}.h-15rem{height:15rem;}.h-2px{height:2px;}.h-8{height:2rem;}.h-85\%{height:85%;}.h-auto{height:auto;}.h-screen{height:100vh;}.w-100\%{width:100%;}.w-8{width:2rem;}.w-screen{width:100vw;}.flex{display:flex;}.children\:inline-flex>*{display:inline-flex;}.flex-1{flex:1 1 0%;}.children-flex-none>*{flex:none;}.children\:grow>*,.grow{flex-grow:1;}.flex-row{flex-direction:row;}.flex-col{flex-direction:column;}.flex-wrap{flex-wrap:wrap;}@keyframes fade-in{from{opacity:0}to{opacity:1}}@keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}.animate-fade-in{animation:fade-in 1s linear 1;}.animate-spin{animation:spin 1s linear infinite;}.animate-duration-300ms{animation-duration:300ms;}.cursor-ns-resize{cursor:ns-resize;}.cursor-pointer{cursor:pointer;}.select-none{user-select:none;}.children\:items-center>*,.items-center{align-items:center;}.self-center{align-self:center;}.children\:justify-center>*,.justify-center{justify-content:center;}.justify-between{justify-content:space-between;}.gap-1{grid-gap:0.25rem;gap:0.25rem;}.gap-2{grid-gap:0.5rem;gap:0.5rem;}.overflow-hidden{overflow:hidden;}.overflow-y-auto{overflow-y:auto;}.rd-1{border-radius:0.25rem;}.rd-8{border-radius:2rem;}.bg-accent{--un-bg-opacity:1;background-color:rgba(53,120,229,var(--un-bg-opacity));}.bg-black\/20{background-color:rgba(0,0,0,0.2);}.bg-darkPrimaryLighter{--un-bg-opacity:1;background-color:rgba(36,37,38,var(--un-bg-opacity));}.bg-darkPrimaryLighter\/60{background-color:rgba(36,37,38,0.6);}.bg-primary{--un-bg-opacity:1;background-color:rgba(255,255,255,var(--un-bg-opacity));}.bg-white\/5{background-color:rgba(255,255,255,0.05);}.dark .dark\:bg-darkAccent{--un-bg-opacity:1;background-color:rgba(103,214,237,var(--un-bg-opacity));}.dark .dark\:bg-darkPrimary{--un-bg-opacity:1;background-color:rgba(27,27,29,var(--un-bg-opacity));}.dark .dark\:hover\:bg-darkHoverOverlay:hover{--un-bg-opacity:.05;background-color:hsla(0,0%,100%,var(--un-bg-opacity));}.dark .dark\:hover\:bg-red-700:hover,.hover\:bg-red-700:hover{--un-bg-opacity:1;background-color:rgba(185,28,28,var(--un-bg-opacity));}.hover\:bg-hoverOverlay:hover{--un-bg-opacity:.05;background-color:rgba(0,0,0,var(--un-bg-opacity));}.active\:bg-accentDark:active{--un-bg-opacity:1;background-color:rgba(48,108,206,var(--un-bg-opacity));}.active\:bg-hoverOverlay\/25:active{background-color:rgba(0,0,0,0.25);}.active\:bg-hoverOverlayDarker:active{--un-bg-opacity:.1;background-color:rgba(0,0,0,var(--un-bg-opacity));}.active\:bg-red-700\/90:active,.dark .dark\:active\:bg-red-700\/90:active{background-color:rgba(185,28,28,0.9);}.dark .dark\:active\:bg-darkAccentDark:active{--un-bg-opacity:1;background-color:rgba(73,206,233,var(--un-bg-opacity));}.dark .dark\:active\:bg-darkHoverOverlay\/25:active{background-color:hsla(0,0%,100%,0.25);}.dark .dark\:active\:bg-darkHoverOverlayDarker:active{--un-bg-opacity:.1;background-color:hsla(0,0%,100%,var(--un-bg-opacity));}.p-1{padding:0.25rem;}.p-7{padding:1.75rem;}.px{padding-left:1rem;padding-right:1rem;}.px-2{padding-left:0.5rem;padding-right:0.5rem;}.px-5{padding-left:1.25rem;padding-right:1.25rem;}.children-pb-2>*{padding-bottom:0.5rem;}.children-pt8>*{padding-top:2rem;}.pl-2{padding-left:0.5rem;}.all\:font-mono *{font-family:"Fira Code","Fira Mono",ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;}.all\:text-xs *{font-size:0.75rem;line-height:1rem;}.text-sm{font-size:0.875rem;line-height:1.25rem;}.font-700{font-weight:700;}.font-semibold{font-weight:600;}.dark .dark\:text-darkAccent{--un-text-opacity:1;color:rgba(103,214,237,var(--un-text-opacity));}.dark .dark\:text-darkAccentText,.text-primaryText{--un-text-opacity:1;color:rgba(28,30,33,var(--un-text-opacity));}.dark .dark\:text-darkPrimaryText,.hover\:text-darkPrimaryText:hover,.text-darkPrimaryText,.active\:text-darkPrimaryText:active{--un-text-opacity:1;color:rgba(227,227,227,var(--un-text-opacity));}.text-accent{--un-text-opacity:1;color:rgba(53,120,229,var(--un-text-opacity));}.text-accentText{--un-text-opacity:1;color:rgba(255,255,255,var(--un-text-opacity));}.filter{filter:var(--un-blur) var(--un-brightness) var(--un-contrast) var(--un-drop-shadow) var(--un-grayscale) var(--un-hue-rotate) var(--un-invert) var(--un-saturate) var(--un-sepia);}.transition-colors-250{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:250ms;}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;}@media (max-width: 639.9px){.lt-sm\:absolute{position:absolute;}.lt-sm\:z-1999{z-index:1999;}.lt-sm\:h-screen{height:100vh;}.lt-sm\:flex{display:flex;}.lt-sm\:bg-darkPrimaryLighter{--un-bg-opacity:1;background-color:rgba(36,37,38,var(--un-bg-opacity));}.lt-sm\:pl-10{padding-left:2.5rem;}.lt-sm\:shadow{--un-shadow:var(--un-shadow-inset) 0 1px 3px 0 var(--un-shadow-color, rgba(0,0,0,0.1)),var(--un-shadow-inset) 0 1px 2px -1px var(--un-shadow-color, rgba(0,0,0,0.1));box-shadow:var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow);}.lt-sm\:shadow-lg{--un-shadow:var(--un-shadow-inset) 0 10px 15px -3px var(--un-shadow-color, rgba(0,0,0,0.1)),var(--un-shadow-inset) 0 4px 6px -4px var(--un-shadow-color, rgba(0,0,0,0.1));box-shadow:var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow);}.lt-sm\:transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;}}*:not(h1,h2,h3,h4,h5,h6){margin:0;padding:0}*{box-sizing:border-box;font-family:Rubik,sans-serif}::-webkit-scrollbar{width:.25rem;height:3px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{border-radius:.25rem}code{padding:.05rem .25rem}code.code-block{padding:.5rem}#sidebar{width:18.75rem}@media screen and (max-width: 640px){#sidebar{--translate-x: -18.75rem;transform:translate(var(--translate-x))}}ul.svelte-gbh3pt{list-style:none;margin:0;padding:0;padding-left:var(--nodePaddingLeft, 1rem);border-left:var(--nodeBorderLeft, 1px dotted #9ca3af);color:var(--nodeColor, #374151)}.hidden.svelte-gbh3pt{display:none}.bracket.svelte-gbh3pt{cursor:pointer}.bracket.svelte-gbh3pt:hover{background:var(--bracketHoverBackground, #d1d5db)}.comma.svelte-gbh3pt{color:var(--nodeColor, #374151)}.val.svelte-gbh3pt{color:var(--leafDefaultColor, #9ca3af)}.val.string.svelte-gbh3pt{color:var(--leafStringColor, #059669)}.val.number.svelte-gbh3pt{color:var(--leafNumberColor, #d97706)}.val.boolean.svelte-gbh3pt{color:var(--leafBooleanColor, #2563eb)}.spinner.svelte-4xesec{height:1.2rem;width:1.2rem;border-radius:50rem;color:currentColor;border:2px dashed currentColor} +*,::before,::after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x:var(--un-empty,/*!*/ /*!*/);--un-pan-y:var(--un-empty,/*!*/ /*!*/);--un-pinch-zoom:var(--un-empty,/*!*/ /*!*/);--un-scroll-snap-strictness:proximity;--un-ordinal:var(--un-empty,/*!*/ /*!*/);--un-slashed-zero:var(--un-empty,/*!*/ /*!*/);--un-numeric-figure:var(--un-empty,/*!*/ /*!*/);--un-numeric-spacing:var(--un-empty,/*!*/ /*!*/);--un-numeric-fraction:var(--un-empty,/*!*/ /*!*/);--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 #0000;--un-ring-shadow:0 0 #0000;--un-shadow-inset:var(--un-empty,/*!*/ /*!*/);--un-shadow:0 0 #0000;--un-ring-inset:var(--un-empty,/*!*/ /*!*/);--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,0.5);--un-blur:var(--un-empty,/*!*/ /*!*/);--un-brightness:var(--un-empty,/*!*/ /*!*/);--un-contrast:var(--un-empty,/*!*/ /*!*/);--un-drop-shadow:var(--un-empty,/*!*/ /*!*/);--un-grayscale:var(--un-empty,/*!*/ /*!*/);--un-hue-rotate:var(--un-empty,/*!*/ /*!*/);--un-invert:var(--un-empty,/*!*/ /*!*/);--un-saturate:var(--un-empty,/*!*/ /*!*/);--un-sepia:var(--un-empty,/*!*/ /*!*/);--un-backdrop-blur:var(--un-empty,/*!*/ /*!*/);--un-backdrop-brightness:var(--un-empty,/*!*/ /*!*/);--un-backdrop-contrast:var(--un-empty,/*!*/ /*!*/);--un-backdrop-grayscale:var(--un-empty,/*!*/ /*!*/);--un-backdrop-hue-rotate:var(--un-empty,/*!*/ /*!*/);--un-backdrop-invert:var(--un-empty,/*!*/ /*!*/);--un-backdrop-opacity:var(--un-empty,/*!*/ /*!*/);--un-backdrop-saturate:var(--un-empty,/*!*/ /*!*/);--un-backdrop-sepia:var(--un-empty,/*!*/ /*!*/);}@font-face { font-family: 'Fira Code'; font-style: normal; font-weight: 400; font-display: swap; src: url(https://fonts.gstatic.com/s/firacode/v21/uU9eCBsR6Z2vfE9aq3bL0fxyUs4tcw4W_D1sFVc.ttf) format('truetype');}@font-face { font-family: 'Fira Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(https://fonts.gstatic.com/s/firamono/v14/N0bX2SlFPv1weGeLZDtQIQ.ttf) format('truetype');}@font-face { font-family: 'Fira Mono'; font-style: normal; font-weight: 700; font-display: swap; src: url(https://fonts.gstatic.com/s/firamono/v14/N0bS2SlFPv1weGeLZDtondv3mQ.ttf) format('truetype');}@font-face { font-family: 'Rubik'; font-style: normal; font-weight: 400; font-display: swap; src: url(https://fonts.gstatic.com/s/rubik/v23/iJWZBXyIfDnIV5PNhY1KTN7Z-Yh-B4i1UA.ttf) format('truetype');}.i-codicon-bell-dot{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='currentColor'%3E%3Cpath fill-rule='evenodd' d='M12.994 7.875A4.008 4.008 0 0 1 12 8h-.01v.217c0 .909.143 1.818.442 2.691l.371 1.113h-9.63v-.012l.37-1.113a8.633 8.633 0 0 0 .443-2.691V6.004c0-.563.12-1.113.347-1.616c.227-.514.55-.969.969-1.34c.419-.382.91-.67 1.436-.837c.538-.18 1.1-.24 1.65-.18l.12.018a4 4 0 0 1 .673-.887a5.15 5.15 0 0 0-.697-.135c-.694-.072-1.4 0-2.07.227c-.67.215-1.28.574-1.794 1.053a4.923 4.923 0 0 0-1.208 1.675a5.067 5.067 0 0 0-.431 2.022v2.2a7.61 7.61 0 0 1-.383 2.37L2 12.343l.479.658h3.505c0 .526.215 1.04.586 1.412c.37.37.885.586 1.412.586c.526 0 1.04-.215 1.411-.586s.587-.886.587-1.412h3.505l.478-.658l-.586-1.77a7.63 7.63 0 0 1-.383-2.381v-.318ZM7.982 14.02a.997.997 0 0 0 .706-.3a.939.939 0 0 0 .287-.705H6.977c0 .263.107.514.299.706a.999.999 0 0 0 .706.299Z' clip-rule='evenodd'/%3E%3Cpath d='M12 7a3 3 0 1 0 0-6a3 3 0 0 0 0 6Z'/%3E%3C/g%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-chrome-close{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='m7.116 8l-4.558 4.558l.884.884L8 8.884l4.558 4.558l.884-.884L8.884 8l4.558-4.558l-.884-.884L8 7.116L3.442 2.558l-.884.884L7.116 8z' clip-rule='evenodd'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-chrome-maximize{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M3 3v10h10V3H3zm9 9H4V4h8v8z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-chrome-minimize{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M14 8v1H3V8h11z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-chrome-restore{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='currentColor'%3E%3Cpath d='M3 5v9h9V5H3zm8 8H4V6h7v7z'/%3E%3Cpath fill-rule='evenodd' d='M5 5h1V4h7v7h-1v1h2V3H5v2z' clip-rule='evenodd'/%3E%3C/g%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-clear-all{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='m10 12.6l.7.7l1.6-1.6l1.6 1.6l.8-.7L13 11l1.7-1.6l-.8-.8l-1.6 1.7l-1.6-1.7l-.7.8l1.6 1.6l-1.6 1.6zM1 4h14V3H1v1zm0 3h14V6H1v1zm8 2.5V9H1v1h8v-.5zM9 13v-1H1v1h8z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-clippy{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M7 13.992H4v-9h8v2h1v-2.5l-.5-.5H11v-1h-1a2 2 0 0 0-4 0H4.94v1H3.5l-.5.5v10l.5.5H7v-1zm0-11.2a1 1 0 0 1 .8-.8a1 1 0 0 1 .58.06a.94.94 0 0 1 .45.36a1 1 0 1 1-1.75.94a1 1 0 0 1-.08-.56zm7.08 9.46L13 13.342v-5.35h-1v5.34l-1.08-1.08l-.71.71l1.94 1.93h.71l1.93-1.93l-.71-.71zm-5.92-4.16h.71l1.93 1.93l-.71.71l-1.08-1.08v5.34h-1v-5.35l-1.08 1.09l-.71-.71l1.94-1.93z' clip-rule='evenodd'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-close{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='m8 8.707l3.646 3.647l.708-.707L8.707 8l3.647-3.646l-.707-.708L8 7.293L4.354 3.646l-.707.708L7.293 8l-3.646 3.646l.707.708L8 8.707z' clip-rule='evenodd'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-cloud-download{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M11.957 6h.05a2.99 2.99 0 0 1 2.116.879a3.003 3.003 0 0 1 0 4.242a2.99 2.99 0 0 1-2.117.879v-1a2.002 2.002 0 0 0 0-4h-.914l-.123-.857a2.49 2.49 0 0 0-2.126-2.122A2.478 2.478 0 0 0 6.231 5.5l-.333.762l-.809-.189A2.49 2.49 0 0 0 4.523 6c-.662 0-1.297.263-1.764.732A2.503 2.503 0 0 0 4.523 11h.498v1h-.498a3.486 3.486 0 0 1-2.628-1.16a3.502 3.502 0 0 1 1.958-5.78a3.462 3.462 0 0 1 1.468.04a3.486 3.486 0 0 1 3.657-2.06A3.479 3.479 0 0 1 11.957 6zm-5.25 5.121l1.314 1.314V7h.994v5.4l1.278-1.279l.707.707l-2.146 2.147h-.708L6 11.829l.707-.708z' clip-rule='evenodd'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-files{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 24 24' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M17.5 0h-9L7 1.5V6H2.5L1 7.5v15.07L2.5 24h12.07L16 22.57V18h4.7l1.3-1.43V4.5L17.5 0zm0 2.12l2.38 2.38H17.5V2.12zm-3 20.38h-12v-15H7v9.07L8.5 18h6v4.5zm6-6h-12v-15H16V6h4.5v10.5z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-hubot{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M8.48 4h4l.5.5v2.03h.52l.5.5V8l-.5.5h-.52v3l-.5.5H9.36l-2.5 2.76L6 14.4V12H3.5l-.5-.64V8.5h-.5L2 8v-.97l.5-.5H3V4.36L3.53 4h4V2.86A1 1 0 0 1 7 2a1 1 0 0 1 2 0a1 1 0 0 1-.52.83V4zM12 8V5H4v5.86l2.5.14H7v2.19l1.8-2.04l.35-.15H12V8zm-2.12.51a2.71 2.71 0 0 1-1.37.74v-.01a2.71 2.71 0 0 1-2.42-.74l-.7.71c.34.34.745.608 1.19.79c.45.188.932.286 1.42.29a3.7 3.7 0 0 0 2.58-1.07l-.7-.71zM6.49 6.5h-1v1h1v-1zm3 0h1v1h-1v-1z' clip-rule='evenodd'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-link-external{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='currentColor'%3E%3Cpath d='M1.5 1H6v1H2v12h12v-4h1v4.5l-.5.5h-13l-.5-.5v-13l.5-.5z'/%3E%3Cpath d='M15 1.5V8h-1V2.707L7.243 9.465l-.707-.708L13.293 2H8V1h6.5l.5.5z'/%3E%3C/g%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-menu{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M16 5H0V4h16v1zm0 8H0v-1h16v1zm0-4.008H0V8h16v.992z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-multiple-windows{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='m6 1.5l.5-.5h8l.5.5v7l-.5.5H12V8h2V4H7v1H6V1.5zM7 2v1h7V2H7zM1.5 7l-.5.5v7l.5.5h8l.5-.5v-7L9.5 7h-8zM2 9V8h7v1H2zm0 1h7v4H2v-4z' clip-rule='evenodd'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-radio-tower{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M2.998 5.58a5.55 5.55 0 0 1 1.62-3.88l-.71-.7a6.45 6.45 0 0 0 0 9.16l.71-.7a5.55 5.55 0 0 1-1.62-3.88zm1.06 0a4.42 4.42 0 0 0 1.32 3.17l.71-.71a3.27 3.27 0 0 1-.76-1.12a3.45 3.45 0 0 1 0-2.67a3.22 3.22 0 0 1 .76-1.13l-.71-.71a4.46 4.46 0 0 0-1.32 3.17zm7.65 3.21l-.71-.71c.33-.32.59-.704.76-1.13a3.449 3.449 0 0 0 0-2.67a3.22 3.22 0 0 0-.76-1.13l.71-.7a4.468 4.468 0 0 1 0 6.34zM13.068 1l-.71.71a5.43 5.43 0 0 1 0 7.74l.71.71a6.45 6.45 0 0 0 0-9.16zM9.993 5.43a1.5 1.5 0 0 1-.245.98a2 2 0 0 1-.27.23l3.44 7.73l-.92.4l-.77-1.73h-5.54l-.77 1.73l-.92-.4l3.44-7.73a1.52 1.52 0 0 1-.33-1.63a1.55 1.55 0 0 1 .56-.68a1.5 1.5 0 0 1 2.325 1.1zm-1.595-.34a.52.52 0 0 0-.25.14a.52.52 0 0 0-.11.22a.48.48 0 0 0 0 .29c.04.09.102.17.18.23a.54.54 0 0 0 .28.08a.51.51 0 0 0 .5-.5a.54.54 0 0 0-.08-.28a.58.58 0 0 0-.23-.18a.48.48 0 0 0-.29 0zm.23 2.05h-.27l-.87 1.94h2l-.86-1.94zm2.2 4.94l-.89-2h-2.88l-.89 2h4.66z' clip-rule='evenodd'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-record-keys{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M14 3H3a1 1 0 0 0-1 1v7a1 1 0 0 0 1 1h11a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1zm0 8H3V4h11v7zm-3-6h-1v1h1V5zm-1 2H9v1h1V7zm2-2h1v1h-1V5zm1 4h-1v1h1V9zM6 9h5v1H6V9zm7-2h-2v1h2V7zM8 5h1v1H8V5zm0 2H7v1h1V7zM4 9h1v1H4V9zm0-4h1v1H4V5zm3 0H6v1h1V5zM4 7h2v1H4V7z' clip-rule='evenodd'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-terminal{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 24 24' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M3 1.5L1.5 3v18L3 22.5h18l1.5-1.5V3L21 1.5H3zM3 21V3h18v18H3zm5.656-4.01l1.038 1.061l5.26-5.243v-.912l-5.26-5.26l-1.035 1.06l4.59 4.702l-4.593 4.592z' clip-rule='evenodd'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-terminal-bash{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M13.655 3.56L8.918.75a1.785 1.785 0 0 0-1.82 0L2.363 3.56a1.889 1.889 0 0 0-.921 1.628v5.624a1.889 1.889 0 0 0 .913 1.627l4.736 2.812a1.785 1.785 0 0 0 1.82 0l4.736-2.812a1.888 1.888 0 0 0 .913-1.627V5.188a1.889 1.889 0 0 0-.904-1.627zm-3.669 8.781v.404a.149.149 0 0 1-.07.124l-.239.137c-.038.02-.07 0-.07-.053v-.396a.78.78 0 0 1-.545.053a.073.073 0 0 1-.027-.09l.086-.365a.153.153 0 0 1 .071-.096a.048.048 0 0 1 .038 0a.662.662 0 0 0 .497-.063a.662.662 0 0 0 .37-.567c0-.206-.112-.292-.384-.293c-.344 0-.661-.066-.67-.574A1.47 1.47 0 0 1 9.6 9.437V9.03a.147.147 0 0 1 .07-.126l.231-.147c.038-.02.07 0 .07.054v.409a.754.754 0 0 1 .453-.055a.073.073 0 0 1 .03.095l-.081.362a.156.156 0 0 1-.065.09a.055.055 0 0 1-.035 0a.6.6 0 0 0-.436.072a.549.549 0 0 0-.331.486c0 .185.098.242.425.248c.438 0 .627.199.632.639a1.568 1.568 0 0 1-.576 1.185zm2.481-.68a.094.094 0 0 1-.036.092l-1.198.727a.034.034 0 0 1-.04.003a.035.035 0 0 1-.016-.037v-.31a.086.086 0 0 1 .055-.076l1.179-.706a.035.035 0 0 1 .056.035v.273zm.827-6.914L8.812 7.515c-.559.331-.97.693-.97 1.367v5.52c0 .404.165.662.413.741a1.465 1.465 0 0 1-.248.025c-.264 0-.522-.072-.748-.207L2.522 12.15a1.558 1.558 0 0 1-.75-1.338V5.188a1.558 1.558 0 0 1 .75-1.34l4.738-2.81a1.46 1.46 0 0 1 1.489 0l4.736 2.812a1.548 1.548 0 0 1 .728 1.083c-.154-.334-.508-.427-.92-.185h.002z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-window{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M14.5 2h-13l-.5.5v11l.5.5h13l.5-.5v-11l-.5-.5zM14 13H2V6h12v7zm0-8H2V3h12v2z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-ph-broadcast{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M128 88a40 40 0 1 0 40 40a40 40 0 0 0-40-40Zm0 64a24 24 0 1 1 24-24a24.1 24.1 0 0 1-24 24Zm-59-48.9a64.5 64.5 0 0 0 0 49.8a65.4 65.4 0 0 0 13.7 20.4a7.9 7.9 0 0 1 0 11.3a8 8 0 0 1-5.6 2.3a8.3 8.3 0 0 1-5.7-2.3a80 80 0 0 1-17.1-25.5a79.9 79.9 0 0 1 0-62.2a80 80 0 0 1 17.1-25.5a8 8 0 0 1 11.3 0a7.9 7.9 0 0 1 0 11.3A65.4 65.4 0 0 0 69 103.1Zm132.7 56a80 80 0 0 1-17.1 25.5a8.3 8.3 0 0 1-5.7 2.3a8 8 0 0 1-5.6-2.3a7.9 7.9 0 0 1 0-11.3a65.4 65.4 0 0 0 13.7-20.4a64.5 64.5 0 0 0 0-49.8a65.4 65.4 0 0 0-13.7-20.4a7.9 7.9 0 0 1 0-11.3a8 8 0 0 1 11.3 0a80 80 0 0 1 17.1 25.5a79.9 79.9 0 0 1 0 62.2ZM54.5 201.5a8.1 8.1 0 0 1 0 11.4a8.3 8.3 0 0 1-5.7 2.3a8.5 8.5 0 0 1-5.7-2.3a121.8 121.8 0 0 1-25.7-38.2a120.7 120.7 0 0 1 0-93.4a121.8 121.8 0 0 1 25.7-38.2a8.1 8.1 0 0 1 11.4 11.4A103.5 103.5 0 0 0 24 128a103.5 103.5 0 0 0 30.5 73.5ZM248 128a120.2 120.2 0 0 1-9.4 46.7a121.8 121.8 0 0 1-25.7 38.2a8.5 8.5 0 0 1-5.7 2.3a8.3 8.3 0 0 1-5.7-2.3a8.1 8.1 0 0 1 0-11.4A103.5 103.5 0 0 0 232 128a103.5 103.5 0 0 0-30.5-73.5a8.1 8.1 0 1 1 11.4-11.4a121.8 121.8 0 0 1 25.7 38.2A120.2 120.2 0 0 1 248 128Z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-ph-globe-hemisphere-west{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M221.6 173.3A102.9 102.9 0 0 0 232 128a104.2 104.2 0 0 0-77.2-100.5h-.5A103.8 103.8 0 0 0 60.4 49l-1.3 1.2A103.9 103.9 0 0 0 128 232h2.4a104.3 104.3 0 0 0 90.6-57.4ZM216 128a89.3 89.3 0 0 1-5.5 30.7l-46.4-28.5a16.6 16.6 0 0 0-6.3-2.3l-22.8-3a16.1 16.1 0 0 0-15.3 6.8h-8.6l-3.8-7.9a15.9 15.9 0 0 0-11-8.7l-6.6-1.4l4.6-10.8h21.4a16.1 16.1 0 0 0 7.7-2l12.2-6.8a16.1 16.1 0 0 0 3-2.1l26.9-24.4a15.7 15.7 0 0 0 4.5-16.9a88 88 0 0 1 46 77.3Zm-68.8-85.9l7.6 13.7l-26.9 24.3l-12.2 6.8H94.3a15.9 15.9 0 0 0-14.7 9.8l-5.3 12.4l-10.9-29.2l8.1-19.3a88 88 0 0 1 75.7-18.5ZM40 128a87.1 87.1 0 0 1 9.5-39.7l10.4 27.9a16.1 16.1 0 0 0 11.6 10l5.5 1.2h.1l15.8 3.4l3.8 7.9a16.3 16.3 0 0 0 14.4 9h1.2l-7.7 17.2a15.9 15.9 0 0 0 2.8 17.4l18.8 20.4l-2.5 13.2A88.1 88.1 0 0 1 40 128Zm100.1 87.2l1.8-9.5a16 16 0 0 0-3.9-13.9l-18.8-20.3l12.7-28.7l1-2.1l22.8 3.1l47.8 29.4a88.5 88.5 0 0 1-63.4 42Z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-ph-hand-waving{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='m220.2 104l-20-34.7a28.1 28.1 0 0 0-47.3-1.9l-17.3-30a28.1 28.1 0 0 0-38.3-10.3a29.4 29.4 0 0 0-9.9 9.6a27.9 27.9 0 0 0-11.5-6.2a27.2 27.2 0 0 0-21.2 2.8a27.9 27.9 0 0 0-10.3 38.2l3.4 5.8A28.5 28.5 0 0 0 36 81a28.1 28.1 0 0 0-10.2 38.2l42 72.8a88 88 0 1 0 152.4-88Zm-6.7 62.6a71.2 71.2 0 0 1-33.5 43.7A72.1 72.1 0 0 1 81.6 184l-42-72.8a12 12 0 0 1 20.8-12l22 38.1l.6.9v.2l.5.5l.2.2l.7.6h.1l.7.5h.3l.6.3h.2l.9.3h.1l.8.2h2.2l.9-.2h.3l.6-.2h.3l.9-.4a8.1 8.1 0 0 0 2.9-11l-22-38.1l-16-27.7a12 12 0 0 1-1.2-9.1a11.8 11.8 0 0 1 5.6-7.3a12 12 0 0 1 9.1-1.2a12.5 12.5 0 0 1 7.3 5.6l8 14h.1l26 45a7 7 0 0 0 1.5 1.9a8 8 0 0 0 12.3-9.9l-26-45a12 12 0 1 1 20.8-12l30 51.9l6.3 11a48.1 48.1 0 0 0-10.9 61a8 8 0 0 0 13.8-8a32 32 0 0 1 11.7-43.7l.7-.4l.5-.4h.1l.6-.6l.5-.5l.4-.5l.3-.6h.1l.2-.5v-.2a1.9 1.9 0 0 0 .2-.7h.1c0-.2.1-.4.1-.6s0-.2.1-.2v-2.1a6.4 6.4 0 0 0-.2-.7a1.9 1.9 0 0 0-.2-.7v-.2c0-.2-.1-.3-.2-.5l-.3-.7l-10-17.4a12 12 0 0 1 13.5-17.5a11.8 11.8 0 0 1 7.2 5.5l20 34.7a70.9 70.9 0 0 1 7.2 53.8Zm-125.8 78a8.2 8.2 0 0 1-6.6 3.4a8.6 8.6 0 0 1-4.6-1.4A117.9 117.9 0 0 1 41.1 208a8 8 0 1 1 13.8-8a102.6 102.6 0 0 0 30.8 33.4a8.1 8.1 0 0 1 2 11.2ZM168 31a8 8 0 0 1 8-8a60.2 60.2 0 0 1 52 30a7.9 7.9 0 0 1-3 10.9a7.1 7.1 0 0 1-4 1.1a8 8 0 0 1-6.9-4A44 44 0 0 0 176 39a8 8 0 0 1-8-8Z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-ph-moon{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M224.3 150.3a8.1 8.1 0 0 0-7.8-5.7l-2.2.4A84 84 0 0 1 111 41.6a5.7 5.7 0 0 0 .3-1.8a7.9 7.9 0 0 0-10.3-8.1a100 100 0 1 0 123.3 123.2a7.2 7.2 0 0 0 0-4.6ZM128 212A84 84 0 0 1 92.8 51.7a99.9 99.9 0 0 0 111.5 111.5A84.4 84.4 0 0 1 128 212Z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-ph-sun{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M128 60a68 68 0 1 0 68 68a68.1 68.1 0 0 0-68-68Zm0 120a52 52 0 1 1 52-52a52 52 0 0 1-52 52Zm-8-144V16a8 8 0 0 1 16 0v20a8 8 0 0 1-16 0ZM43.1 54.5a8.1 8.1 0 1 1 11.4-11.4l14.1 14.2a8 8 0 0 1 0 11.3a8.1 8.1 0 0 1-11.3 0ZM36 136H16a8 8 0 0 1 0-16h20a8 8 0 0 1 0 16Zm32.6 51.4a8 8 0 0 1 0 11.3l-14.1 14.2a8.3 8.3 0 0 1-5.7 2.3a8.5 8.5 0 0 1-5.7-2.3a8.1 8.1 0 0 1 0-11.4l14.2-14.1a8 8 0 0 1 11.3 0ZM136 220v20a8 8 0 0 1-16 0v-20a8 8 0 0 1 16 0Zm76.9-18.5a8.1 8.1 0 0 1 0 11.4a8.5 8.5 0 0 1-5.7 2.3a8.3 8.3 0 0 1-5.7-2.3l-14.1-14.2a8 8 0 0 1 11.3-11.3ZM248 128a8 8 0 0 1-8 8h-20a8 8 0 0 1 0-16h20a8 8 0 0 1 8 8Zm-60.6-59.4a8 8 0 0 1 0-11.3l14.1-14.2a8.1 8.1 0 0 1 11.4 11.4l-14.2 14.1a8.1 8.1 0 0 1-11.3 0Z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.note{position:relative;display:inline-flex;align-items:center;border-left-width:4px;border-left-style:solid;--un-border-opacity:1;border-color:rgba(53,120,229,var(--un-border-opacity));border-radius:0.25rem;background-color:rgba(53,120,229,0.1);padding:0.5rem;text-decoration:none;}.note-red{position:relative;display:inline-flex;align-items:center;border-left-width:4px;border-left-style:solid;--un-border-opacity:1;border-color:rgba(53,120,229,var(--un-border-opacity));border-radius:0.25rem;background-color:rgba(53,120,229,0.1);background-color:rgba(185,28,28,0.1);padding:0.5rem;text-decoration:none;}.nv{position:relative;display:flex;align-items:center;border-radius:0.25rem;padding:0.5rem;--un-text-opacity:1;color:rgba(194,197,202,var(--un-text-opacity));text-decoration:none;transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:125ms;}.nv_selected{position:relative;display:flex;align-items:center;border-left-width:4px;border-left-style:solid;border-radius:0.25rem;--un-bg-opacity:.05;background-color:hsla(0,0%,100%,var(--un-bg-opacity));padding:0.5rem;--un-text-opacity:1;color:rgba(194,197,202,var(--un-text-opacity));color:rgba(53,120,229,var(--un-text-opacity));text-decoration:none;transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:125ms;}.input{height:2.5rem;display:flex;align-items:center;border-radius:0.25rem;border-style:none;--un-bg-opacity:1;background-color:rgba(233,236,239,var(--un-bg-opacity));padding:0.5rem;--un-text-opacity:1;color:rgba(28,30,33,var(--un-text-opacity));--un-shadow:var(--un-shadow-inset) 0 4px 6px -1px var(--un-shadow-color, rgba(0,0,0,0.1)),var(--un-shadow-inset) 0 2px 4px -2px var(--un-shadow-color, rgba(0,0,0,0.1));box-shadow:var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow);outline:2px solid transparent;outline-offset:2px;}.btn{user-select:none;border-radius:0.25rem;border-style:none;--un-bg-opacity:1;background-color:rgba(53,120,229,var(--un-bg-opacity));padding:0.5rem;font-weight:400;--un-text-opacity:1;color:rgba(28,30,33,var(--un-text-opacity));color:rgba(255,255,255,var(--un-text-opacity));--un-shadow:var(--un-shadow-inset) 0 4px 6px -1px var(--un-shadow-color, rgba(0,0,0,0.1)),var(--un-shadow-inset) 0 2px 4px -2px var(--un-shadow-color, rgba(0,0,0,0.1));box-shadow:var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow);outline:2px solid transparent;outline-offset:2px;}.nv_selected:hover,.nv:hover{border-left-width:4px;border-left-style:solid;--un-bg-opacity:.05;background-color:hsla(0,0%,100%,var(--un-bg-opacity));--un-text-opacity:1;color:rgba(53,120,229,var(--un-text-opacity));}.dark .note{--un-border-opacity:1;border-color:rgba(103,214,237,var(--un-border-opacity));background-color:rgba(103,214,237,0.1);}.dark .note-red{--un-border-opacity:1;border-color:rgba(103,214,237,var(--un-border-opacity));background-color:rgba(103,214,237,0.1);background-color:rgba(185,28,28,0.1);}.btn:hover{--un-bg-opacity:1;background-color:rgba(45,102,195,var(--un-bg-opacity));}.dark .btn{--un-bg-opacity:1;background-color:rgba(103,214,237,var(--un-bg-opacity));font-weight:600;--un-text-opacity:1;color:rgba(28,30,33,var(--un-text-opacity));}.dark .btn:hover{--un-bg-opacity:1;background-color:rgba(57,202,232,var(--un-bg-opacity));}.dark .input{--un-bg-opacity:1;background-color:rgba(36,37,38,var(--un-bg-opacity));--un-text-opacity:1;color:rgba(227,227,227,var(--un-text-opacity));}.dark .note-red::after,.note-red::after{--un-bg-opacity:1;background-color:rgba(185,28,28,var(--un-bg-opacity));}.btn:active{--un-bg-opacity:1;background-color:rgba(37,84,160,var(--un-bg-opacity));}.dark .btn:active{--un-bg-opacity:1;background-color:rgba(25,181,213,var(--un-bg-opacity));}.dark .nv_selected,.dark .nv_selected:hover,.dark .nv:hover{--un-text-opacity:1;color:rgba(103,214,237,var(--un-text-opacity));} ::-webkit-scrollbar-thumb { background-color: #3578E5; } .dark ::-webkit-scrollbar-thumb { background-color: #67d6ed; } code { font-size: 0.75rem; font-family: "Fira Code","Fira Mono",ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace; border-radius: 0.25rem; background-color: #d6d8da; } .code-block { font-family: "Fira Code","Fira Mono",ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace; font-size: 0.875rem; } .dark code { background-color: #282a2e; } .visible{visibility:visible;}.absolute{position:absolute;}.left-2{left:0.5rem;}.top-2{top:0.5rem;}.z-2000{z-index:2000;}.grid{display:grid;}.grid-rows-\[2fr_auto\]{grid-template-rows:2fr auto;}.grid-rows-\[2px_2rem_1fr\]{grid-template-rows:2px 2rem 1fr;}.grid-rows-\[auto_1fr\]{grid-template-rows:auto 1fr;}.my-2{margin-top:0.5rem;margin-bottom:0.5rem;}.mb-2{margin-bottom:0.5rem;}.mr-2{margin-right:0.5rem;}.display-none,.hidden{display:none;}.children-h-10>*,.children\:h10>*{height:2.5rem;}.children\:h-100\%>*,.h-100\%{height:100%;}.children\:w-12>*{width:3rem;}.h-15rem{height:15rem;}.h-2px{height:2px;}.h-8{height:2rem;}.h-85\%{height:85%;}.h-auto{height:auto;}.h-screen{height:100vh;}.w-100\%{width:100%;}.w-8{width:2rem;}.w-screen{width:100vw;}.flex{display:flex;}.children\:inline-flex>*{display:inline-flex;}.flex-1{flex:1 1 0%;}.children-flex-none>*{flex:none;}.children\:grow>*,.grow{flex-grow:1;}.flex-row{flex-direction:row;}.flex-col{flex-direction:column;}.flex-wrap{flex-wrap:wrap;}@keyframes fade-in{from{opacity:0}to{opacity:1}}@keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}.animate-fade-in{animation:fade-in 1s linear 1;}.animate-spin{animation:spin 1s linear infinite;}.animate-duration-300ms{animation-duration:300ms;}.cursor-ns-resize{cursor:ns-resize;}.cursor-pointer{cursor:pointer;}.select-none{user-select:none;}.children\:items-center>*,.items-center{align-items:center;}.self-center{align-self:center;}.children\:justify-center>*,.justify-center{justify-content:center;}.justify-between{justify-content:space-between;}.gap-1{grid-gap:0.25rem;gap:0.25rem;}.gap-2{grid-gap:0.5rem;gap:0.5rem;}.overflow-hidden{overflow:hidden;}.overflow-y-auto{overflow-y:auto;}.rd-1{border-radius:0.25rem;}.rd-8{border-radius:2rem;}.bg-accent{--un-bg-opacity:1;background-color:rgba(53,120,229,var(--un-bg-opacity));}.bg-black\/20{background-color:rgba(0,0,0,0.2);}.bg-darkPrimaryLighter{--un-bg-opacity:1;background-color:rgba(36,37,38,var(--un-bg-opacity));}.bg-darkPrimaryLighter\/60{background-color:rgba(36,37,38,0.6);}.bg-primary{--un-bg-opacity:1;background-color:rgba(255,255,255,var(--un-bg-opacity));}.bg-white\/5{background-color:rgba(255,255,255,0.05);}.dark .dark\:bg-darkAccent{--un-bg-opacity:1;background-color:rgba(103,214,237,var(--un-bg-opacity));}.dark .dark\:bg-darkPrimary{--un-bg-opacity:1;background-color:rgba(27,27,29,var(--un-bg-opacity));}.dark .dark\:hover\:bg-darkHoverOverlay:hover{--un-bg-opacity:.05;background-color:hsla(0,0%,100%,var(--un-bg-opacity));}.dark .dark\:hover\:bg-red-700:hover,.hover\:bg-red-700:hover{--un-bg-opacity:1;background-color:rgba(185,28,28,var(--un-bg-opacity));}.hover\:bg-hoverOverlay:hover{--un-bg-opacity:.05;background-color:rgba(0,0,0,var(--un-bg-opacity));}.active\:bg-accentDark:active{--un-bg-opacity:1;background-color:rgba(48,108,206,var(--un-bg-opacity));}.active\:bg-hoverOverlay\/25:active{background-color:rgba(0,0,0,0.25);}.active\:bg-hoverOverlayDarker:active{--un-bg-opacity:.1;background-color:rgba(0,0,0,var(--un-bg-opacity));}.active\:bg-red-700\/90:active,.dark .dark\:active\:bg-red-700\/90:active{background-color:rgba(185,28,28,0.9);}.dark .dark\:active\:bg-darkAccentDark:active{--un-bg-opacity:1;background-color:rgba(73,206,233,var(--un-bg-opacity));}.dark .dark\:active\:bg-darkHoverOverlay\/25:active{background-color:hsla(0,0%,100%,0.25);}.dark .dark\:active\:bg-darkHoverOverlayDarker:active{--un-bg-opacity:.1;background-color:hsla(0,0%,100%,var(--un-bg-opacity));}.p-1{padding:0.25rem;}.p-7{padding:1.75rem;}.px{padding-left:1rem;padding-right:1rem;}.px-2{padding-left:0.5rem;padding-right:0.5rem;}.px-5{padding-left:1.25rem;padding-right:1.25rem;}.children-pb-2>*{padding-bottom:0.5rem;}.children-pt8>*{padding-top:2rem;}.pl-2{padding-left:0.5rem;}.all\:font-mono *{font-family:"Fira Code","Fira Mono",ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;}.all\:text-xs *{font-size:0.75rem;line-height:1rem;}.text-sm{font-size:0.875rem;line-height:1.25rem;}.font-700{font-weight:700;}.font-semibold{font-weight:600;}.dark .dark\:text-darkAccent{--un-text-opacity:1;color:rgba(103,214,237,var(--un-text-opacity));}.dark .dark\:text-darkAccentText,.text-primaryText{--un-text-opacity:1;color:rgba(28,30,33,var(--un-text-opacity));}.dark .dark\:text-darkPrimaryText,.hover\:text-darkPrimaryText:hover,.text-darkPrimaryText,.active\:text-darkPrimaryText:active{--un-text-opacity:1;color:rgba(227,227,227,var(--un-text-opacity));}.text-accent{--un-text-opacity:1;color:rgba(53,120,229,var(--un-text-opacity));}.text-accentText{--un-text-opacity:1;color:rgba(255,255,255,var(--un-text-opacity));}.filter{filter:var(--un-blur) var(--un-brightness) var(--un-contrast) var(--un-drop-shadow) var(--un-grayscale) var(--un-hue-rotate) var(--un-invert) var(--un-saturate) var(--un-sepia);}.transition-colors-250{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:250ms;}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;}@media (max-width: 639.9px){.lt-sm\:absolute{position:absolute;}.lt-sm\:z-1999{z-index:1999;}.lt-sm\:h-screen{height:100vh;}.lt-sm\:flex{display:flex;}.lt-sm\:bg-darkPrimaryLighter{--un-bg-opacity:1;background-color:rgba(36,37,38,var(--un-bg-opacity));}.lt-sm\:pl-10{padding-left:2.5rem;}.lt-sm\:shadow{--un-shadow:var(--un-shadow-inset) 0 1px 3px 0 var(--un-shadow-color, rgba(0,0,0,0.1)),var(--un-shadow-inset) 0 1px 2px -1px var(--un-shadow-color, rgba(0,0,0,0.1));box-shadow:var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow);}.lt-sm\:shadow-lg{--un-shadow:var(--un-shadow-inset) 0 10px 15px -3px var(--un-shadow-color, rgba(0,0,0,0.1)),var(--un-shadow-inset) 0 4px 6px -4px var(--un-shadow-color, rgba(0,0,0,0.1));box-shadow:var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow);}.lt-sm\:transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;}}*:not(h1,h2,h3,h4,h5,h6){margin:0;padding:0}*{box-sizing:border-box;font-family:Rubik,sans-serif}::-webkit-scrollbar{width:.25rem;height:3px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{border-radius:.25rem}code{padding:.05rem .25rem}code.code-block{padding:.5rem}#sidebar{width:18.75rem}@media screen and (max-width: 640px){#sidebar{--translate-x: -18.75rem;transform:translate(var(--translate-x))}}ul.svelte-gbh3pt{list-style:none;margin:0;padding:0;padding-left:var(--nodePaddingLeft, 1rem);border-left:var(--nodeBorderLeft, 1px dotted #9ca3af);color:var(--nodeColor, #374151)}.hidden.svelte-gbh3pt{display:none}.bracket.svelte-gbh3pt{cursor:pointer}.bracket.svelte-gbh3pt:hover{background:var(--bracketHoverBackground, #d1d5db)}.comma.svelte-gbh3pt{color:var(--nodeColor, #374151)}.val.svelte-gbh3pt{color:var(--leafDefaultColor, #9ca3af)}.val.string.svelte-gbh3pt{color:var(--leafStringColor, #059669)}.val.number.svelte-gbh3pt{color:var(--leafNumberColor, #d97706)}.val.boolean.svelte-gbh3pt{color:var(--leafBooleanColor, #2563eb)}.spinner.svelte-4xesec{height:1.2rem;width:1.2rem;border-radius:50rem;color:currentColor;border:2px dashed currentColor} diff --git a/examples/api/dist/assets/index.js b/examples/api/dist/assets/index.js index f86184eb1..88023314d 100644 --- a/examples/api/dist/assets/index.js +++ b/examples/api/dist/assets/index.js @@ -1,46 +1,47 @@ -const to=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))i(l);new MutationObserver(l=>{for(const o of l)if(o.type==="childList")for(const u of o.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&i(u)}).observe(document,{childList:!0,subtree:!0});function n(l){const o={};return l.integrity&&(o.integrity=l.integrity),l.referrerpolicy&&(o.referrerPolicy=l.referrerpolicy),l.crossorigin==="use-credentials"?o.credentials="include":l.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(l){if(l.ep)return;l.ep=!0;const o=n(l);fetch(l.href,o)}};to();function V(){}function bs(e){return e()}function jl(){return Object.create(null)}function se(e){e.forEach(bs)}function no(e){return typeof e=="function"}function me(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}let Un;function io(e,t){return Un||(Un=document.createElement("a")),Un.href=t,e===Un.href}function lo(e){return Object.keys(e).length===0}function so(e,...t){if(e==null)return V;const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function gs(e,t,n){e.$$.on_destroy.push(so(t,n))}function s(e,t){e.appendChild(t)}function m(e,t,n){e.insertBefore(t,n||null)}function p(e){e.parentNode.removeChild(e)}function ft(e,t){for(let n=0;ne.removeEventListener(t,n,i)}function Xn(e){return function(t){return t.preventDefault(),e.call(this,t)}}function a(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function le(e){return e===""?null:+e}function ro(e){return Array.from(e.childNodes)}function K(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function B(e,t){e.value=t==null?"":t}function zt(e,t){for(let n=0;n{Gn.delete(e),i&&(n&&e.d(1),i())}),e.o(t)}else i&&i()}function $n(e){e&&e.c()}function Vt(e,t,n,i){const{fragment:l,on_mount:o,on_destroy:u,after_update:d}=e.$$;l&&l.m(t,n),i||Dt(()=>{const c=o.map(bs).filter(no);u?u.push(...c):se(c),e.$$.on_mount=[]}),d.forEach(Dt)}function Gt(e,t){const n=e.$$;n.fragment!==null&&(se(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function po(e,t){e.$$.dirty[0]===-1&&(jt.push(e),co(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const g=y.length?y[0]:_;return f.ctx&&l(f.ctx[k],f.ctx[k]=g)&&(!f.skip_bound&&f.bound[k]&&f.bound[k](g),v&&po(e,k)),_}):[],f.update(),v=!0,se(f.before_update),f.fragment=i?i(f.ctx):!1,t.target){if(t.hydrate){const k=ro(t.target);f.fragment&&f.fragment.l(k),k.forEach(p)}else f.fragment&&f.fragment.c();t.intro&&ze(e.$$.fragment),Vt(e,t.target,t.anchor,t.customElement),ys()}qt(c)}class we{$destroy(){Gt(this,1),this.$destroy=V}$on(t,n){const i=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return i.push(n),()=>{const l=i.indexOf(n);l!==-1&&i.splice(l,1)}}$set(t){this.$$set&&!lo(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const Et=[];function ws(e,t=V){let n;const i=new Set;function l(d){if(me(e,d)&&(e=d,n)){const c=!Et.length;for(const f of i)f[1](),Et.push(f,e);if(c){for(let f=0;f{i.delete(f),i.size===0&&(n(),n=null)}}return{set:l,update:o,subscribe:u}}var mo=Object.defineProperty,Te=(e,t)=>{for(var n in t)mo(e,n,{get:t[n],enumerable:!0})},ho={};Te(ho,{convertFileSrc:()=>ks,invoke:()=>Kn,transformCallback:()=>pt});function _o(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function pt(e,t=!1){let n=_o(),i=`_${n}`;return Object.defineProperty(window,i,{value:l=>(t&&Reflect.deleteProperty(window,i),e==null?void 0:e(l)),writable:!1,configurable:!0}),n}async function Kn(e,t={}){return new Promise((n,i)=>{let l=pt(u=>{n(u),Reflect.deleteProperty(window,`_${o}`)},!0),o=pt(u=>{i(u),Reflect.deleteProperty(window,`_${l}`)},!0);window.__TAURI_IPC__({cmd:e,callback:l,error:o,...t})})}function ks(e,t="asset"){let n=encodeURIComponent(e);return navigator.userAgent.includes("Windows")?`https://${t}.localhost/${n}`:`${t}://localhost/${n}`}async function L(e){return Kn("tauri",e)}var bo={};Te(bo,{Child:()=>Ms,Command:()=>Wi,EventEmitter:()=>Jn,open:()=>Oi});async function go(e,t,n=[],i){return typeof n=="object"&&Object.freeze(n),L({__tauriModule:"Shell",message:{cmd:"execute",program:t,args:n,options:i,onEventFn:pt(e)}})}var Jn=class{constructor(){this.eventListeners=Object.create(null)}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}on(e,t){return e in this.eventListeners?this.eventListeners[e].push(t):this.eventListeners[e]=[t],this}once(e,t){let n=(...i)=>{this.removeListener(e,n),t(...i)};return this.addListener(e,n)}off(e,t){return e in this.eventListeners&&(this.eventListeners[e]=this.eventListeners[e].filter(n=>n!==t)),this}removeAllListeners(e){return e?delete this.eventListeners[e]:this.eventListeners=Object.create(null),this}emit(e,...t){if(e in this.eventListeners){let n=this.eventListeners[e];for(let i of n)i(...t);return!0}return!1}listenerCount(e){return e in this.eventListeners?this.eventListeners[e].length:0}prependListener(e,t){return e in this.eventListeners?this.eventListeners[e].unshift(t):this.eventListeners[e]=[t],this}prependOnceListener(e,t){let n=(...i)=>{this.removeListener(e,n),t(...i)};return this.prependListener(e,n)}},Ms=class{constructor(e){this.pid=e}async write(e){return L({__tauriModule:"Shell",message:{cmd:"stdinWrite",pid:this.pid,buffer:typeof e=="string"?e:Array.from(e)}})}async kill(){return L({__tauriModule:"Shell",message:{cmd:"killChild",pid:this.pid}})}},Wi=class extends Jn{constructor(e,t=[],n){super(),this.stdout=new Jn,this.stderr=new Jn,this.program=e,this.args=typeof t=="string"?[t]:t,this.options=n!=null?n:{}}static sidecar(e,t=[],n){let i=new Wi(e,t,n);return i.options.sidecar=!0,i}async spawn(){return go(e=>{switch(e.event){case"Error":this.emit("error",e.payload);break;case"Terminated":this.emit("close",e.payload);break;case"Stdout":this.stdout.emit("data",e.payload);break;case"Stderr":this.stderr.emit("data",e.payload);break}},this.program,this.args,this.options).then(e=>new Ms(e))}async execute(){return new Promise((e,t)=>{this.on("error",t);let n=[],i=[];this.stdout.on("data",l=>{n.push(l)}),this.stderr.on("data",l=>{i.push(l)}),this.on("close",l=>{e({code:l.code,signal:l.signal,stdout:n.join(` +const so=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))i(l);new MutationObserver(l=>{for(const o of l)if(o.type==="childList")for(const u of o.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&i(u)}).observe(document,{childList:!0,subtree:!0});function n(l){const o={};return l.integrity&&(o.integrity=l.integrity),l.referrerpolicy&&(o.referrerPolicy=l.referrerpolicy),l.crossorigin==="use-credentials"?o.credentials="include":l.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(l){if(l.ep)return;l.ep=!0;const o=n(l);fetch(l.href,o)}};so();function G(){}function ws(e){return e()}function Vl(){return Object.create(null)}function re(e){e.forEach(ws)}function oo(e){return typeof e=="function"}function pe(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}let Gn;function ro(e,t){return Gn||(Gn=document.createElement("a")),Gn.href=t,e===Gn.href}function ao(e){return Object.keys(e).length===0}function uo(e,...t){if(e==null)return G;const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function ks(e,t,n){e.$$.on_destroy.push(uo(t,n))}function s(e,t){e.appendChild(t)}function m(e,t,n){e.insertBefore(t,n||null)}function p(e){e.parentNode.removeChild(e)}function ht(e,t){for(let n=0;ne.removeEventListener(t,n,i)}function Zn(e){return function(t){return t.preventDefault(),e.call(this,t)}}function a(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function oe(e){return e===""?null:+e}function fo(e){return Array.from(e.childNodes)}function Q(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function B(e,t){e.value=t==null?"":t}function Pt(e,t){for(let n=0;n{Kn.delete(e),i&&(n&&e.d(1),i())}),e.o(t)}else i&&i()}function xn(e){e&&e.c()}function Jt(e,t,n,i){const{fragment:l,on_mount:o,on_destroy:u,after_update:d}=e.$$;l&&l.m(t,n),i||Wt(()=>{const c=o.map(ws).filter(oo);u?u.push(...c):re(c),e.$$.on_mount=[]}),d.forEach(Wt)}function Xt(e,t){const n=e.$$;n.fragment!==null&&(re(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function bo(e,t){e.$$.dirty[0]===-1&&(qt.push(e),ho(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const v=y.length?y[0]:_;return f.ctx&&l(f.ctx[k],f.ctx[k]=v)&&(!f.skip_bound&&f.bound[k]&&f.bound[k](v),g&&bo(e,k)),_}):[],f.update(),g=!0,re(f.before_update),f.fragment=i?i(f.ctx):!1,t.target){if(t.hydrate){const k=fo(t.target);f.fragment&&f.fragment.l(k),k.forEach(p)}else f.fragment&&f.fragment.c();t.intro&&Ae(e.$$.fragment),Jt(e,t.target,t.anchor,t.customElement),Cs()}Vt(c)}class ve{$destroy(){Xt(this,1),this.$destroy=G}$on(t,n){const i=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return i.push(n),()=>{const l=i.indexOf(n);l!==-1&&i.splice(l,1)}}$set(t){this.$$set&&!ao(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const Dt=[];function Ts(e,t=G){let n;const i=new Set;function l(d){if(pe(e,d)&&(e=d,n)){const c=!Dt.length;for(const f of i)f[1](),Dt.push(f,e);if(c){for(let f=0;f{i.delete(f),i.size===0&&(n(),n=null)}}return{set:l,update:o,subscribe:u}}var go=Object.defineProperty,ke=(e,t)=>{for(var n in t)go(e,n,{get:t[n],enumerable:!0})},vo={};ke(vo,{convertFileSrc:()=>Ls,invoke:()=>ei,transformCallback:()=>_t});function yo(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function _t(e,t=!1){let n=yo(),i=`_${n}`;return Object.defineProperty(window,i,{value:l=>(t&&Reflect.deleteProperty(window,i),e==null?void 0:e(l)),writable:!1,configurable:!0}),n}async function ei(e,t={}){return new Promise((n,i)=>{let l=_t(u=>{n(u),Reflect.deleteProperty(window,`_${o}`)},!0),o=_t(u=>{i(u),Reflect.deleteProperty(window,`_${l}`)},!0);window.__TAURI_IPC__({cmd:e,callback:l,error:o,...t})})}function Ls(e,t="asset"){let n=encodeURIComponent(e);return navigator.userAgent.includes("Windows")?`https://${t}.localhost/${n}`:`${t}://localhost/${n}`}async function A(e){return ei("tauri",e)}var wo={};ke(wo,{Child:()=>As,Command:()=>Hi,EventEmitter:()=>Qn,open:()=>Fi});async function ko(e,t,n=[],i){return typeof n=="object"&&Object.freeze(n),A({__tauriModule:"Shell",message:{cmd:"execute",program:t,args:n,options:i,onEventFn:_t(e)}})}var Qn=class{constructor(){this.eventListeners=Object.create(null)}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}on(e,t){return e in this.eventListeners?this.eventListeners[e].push(t):this.eventListeners[e]=[t],this}once(e,t){let n=(...i)=>{this.removeListener(e,n),t(...i)};return this.addListener(e,n)}off(e,t){return e in this.eventListeners&&(this.eventListeners[e]=this.eventListeners[e].filter(n=>n!==t)),this}removeAllListeners(e){return e?delete this.eventListeners[e]:this.eventListeners=Object.create(null),this}emit(e,...t){if(e in this.eventListeners){let n=this.eventListeners[e];for(let i of n)i(...t);return!0}return!1}listenerCount(e){return e in this.eventListeners?this.eventListeners[e].length:0}prependListener(e,t){return e in this.eventListeners?this.eventListeners[e].unshift(t):this.eventListeners[e]=[t],this}prependOnceListener(e,t){let n=(...i)=>{this.removeListener(e,n),t(...i)};return this.prependListener(e,n)}},As=class{constructor(e){this.pid=e}async write(e){return A({__tauriModule:"Shell",message:{cmd:"stdinWrite",pid:this.pid,buffer:typeof e=="string"?e:Array.from(e)}})}async kill(){return A({__tauriModule:"Shell",message:{cmd:"killChild",pid:this.pid}})}},Hi=class extends Qn{constructor(e,t=[],n){super(),this.stdout=new Qn,this.stderr=new Qn,this.program=e,this.args=typeof t=="string"?[t]:t,this.options=n!=null?n:{}}static sidecar(e,t=[],n){let i=new Hi(e,t,n);return i.options.sidecar=!0,i}async spawn(){return ko(e=>{switch(e.event){case"Error":this.emit("error",e.payload);break;case"Terminated":this.emit("close",e.payload);break;case"Stdout":this.stdout.emit("data",e.payload);break;case"Stderr":this.stderr.emit("data",e.payload);break}},this.program,this.args,this.options).then(e=>new As(e))}async execute(){return new Promise((e,t)=>{this.on("error",t);let n=[],i=[];this.stdout.on("data",l=>{n.push(l)}),this.stderr.on("data",l=>{i.push(l)}),this.on("close",l=>{e({code:l.code,signal:l.signal,stdout:n.join(` `),stderr:i.join(` -`)})}),this.spawn().catch(t)})}};async function Oi(e,t){return L({__tauriModule:"Shell",message:{cmd:"open",path:e,with:t}})}var vo={};Te(vo,{TauriEvent:()=>Ls,emit:()=>ni,listen:()=>Xt,once:()=>Ss});async function Cs(e,t){return L({__tauriModule:"Event",message:{cmd:"unlisten",event:e,eventId:t}})}async function Ts(e,t,n){await L({__tauriModule:"Event",message:{cmd:"emit",event:e,windowLabel:t,payload:n}})}async function Ri(e,t,n){return L({__tauriModule:"Event",message:{cmd:"listen",event:e,windowLabel:t,handler:pt(n)}}).then(i=>async()=>Cs(e,i))}async function As(e,t,n){return Ri(e,t,i=>{n(i),Cs(e,i.id).catch(()=>{})})}var Ls=(e=>(e.WINDOW_RESIZED="tauri://resize",e.WINDOW_MOVED="tauri://move",e.WINDOW_CLOSE_REQUESTED="tauri://close-requested",e.WINDOW_CREATED="tauri://window-created",e.WINDOW_DESTROYED="tauri://destroyed",e.WINDOW_FOCUS="tauri://focus",e.WINDOW_BLUR="tauri://blur",e.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",e.WINDOW_THEME_CHANGED="tauri://theme-changed",e.WINDOW_FILE_DROP="tauri://file-drop",e.WINDOW_FILE_DROP_HOVER="tauri://file-drop-hover",e.WINDOW_FILE_DROP_CANCELLED="tauri://file-drop-cancelled",e.MENU="tauri://menu",e.CHECK_UPDATE="tauri://update",e.UPDATE_AVAILABLE="tauri://update-available",e.INSTALL_UPDATE="tauri://update-install",e.STATUS_UPDATE="tauri://update-status",e.DOWNLOAD_PROGRESS="tauri://update-download-progress",e))(Ls||{});async function Xt(e,t){return Ri(e,null,t)}async function Ss(e,t){return As(e,null,t)}async function ni(e,t){return Ts(e,void 0,t)}var yo={};Te(yo,{CloseRequestedEvent:()=>Ws,LogicalPosition:()=>Es,LogicalSize:()=>Qn,PhysicalPosition:()=>xe,PhysicalSize:()=>dt,UserAttentionType:()=>Ii,WebviewWindow:()=>mt,WebviewWindowHandle:()=>Ds,WindowManager:()=>Ps,appWindow:()=>je,availableMonitors:()=>Mo,currentMonitor:()=>wo,getAll:()=>zs,getCurrent:()=>Ut,primaryMonitor:()=>ko});var Qn=class{constructor(e,t){this.type="Logical",this.width=e,this.height=t}},dt=class{constructor(e,t){this.type="Physical",this.width=e,this.height=t}toLogical(e){return new Qn(this.width/e,this.height/e)}},Es=class{constructor(e,t){this.type="Logical",this.x=e,this.y=t}},xe=class{constructor(e,t){this.type="Physical",this.x=e,this.y=t}toLogical(e){return new Es(this.x/e,this.y/e)}},Ii=(e=>(e[e.Critical=1]="Critical",e[e.Informational=2]="Informational",e))(Ii||{});function Ut(){return new mt(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0})}function zs(){return window.__TAURI_METADATA__.__windows.map(e=>new mt(e.label,{skip:!0}))}var ql=["tauri://created","tauri://error"],Ds=class{constructor(e){this.label=e,this.listeners=Object.create(null)}async listen(e,t){return this._handleTauriEvent(e,t)?Promise.resolve(()=>{let n=this.listeners[e];n.splice(n.indexOf(t),1)}):Ri(e,this.label,t)}async once(e,t){return this._handleTauriEvent(e,t)?Promise.resolve(()=>{let n=this.listeners[e];n.splice(n.indexOf(t),1)}):As(e,this.label,t)}async emit(e,t){if(ql.includes(e)){for(let n of this.listeners[e]||[])n({event:e,id:-1,windowLabel:this.label,payload:t});return Promise.resolve()}return Ts(e,this.label,t)}_handleTauriEvent(e,t){return ql.includes(e)?(e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t],!0):!1}},Ps=class extends Ds{async scaleFactor(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"scaleFactor"}}}})}async innerPosition(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerPosition"}}}}).then(({x:e,y:t})=>new xe(e,t))}async outerPosition(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerPosition"}}}}).then(({x:e,y:t})=>new xe(e,t))}async innerSize(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerSize"}}}}).then(({width:e,height:t})=>new dt(e,t))}async outerSize(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerSize"}}}}).then(({width:e,height:t})=>new dt(e,t))}async isFullscreen(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isFullscreen"}}}})}async isMaximized(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isMaximized"}}}})}async isDecorated(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isDecorated"}}}})}async isResizable(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isResizable"}}}})}async isVisible(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isVisible"}}}})}async theme(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"theme"}}}})}async center(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"center"}}}})}async requestUserAttention(e){let t=null;return e&&(e===1?t={type:"Critical"}:t={type:"Informational"}),L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"requestUserAttention",payload:t}}}})}async setResizable(e){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setResizable",payload:e}}}})}async setTitle(e){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setTitle",payload:e}}}})}async maximize(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"maximize"}}}})}async unmaximize(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unmaximize"}}}})}async toggleMaximize(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"toggleMaximize"}}}})}async minimize(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"minimize"}}}})}async unminimize(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unminimize"}}}})}async show(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"show"}}}})}async hide(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"hide"}}}})}async close(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"close"}}}})}async setDecorations(e){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setDecorations",payload:e}}}})}async setAlwaysOnTop(e){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setAlwaysOnTop",payload:e}}}})}async setSize(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setSize",payload:{type:e.type,data:{width:e.width,height:e.height}}}}}})}async setMinSize(e){if(e&&e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMinSize",payload:e?{type:e.type,data:{width:e.width,height:e.height}}:null}}}})}async setMaxSize(e){if(e&&e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMaxSize",payload:e?{type:e.type,data:{width:e.width,height:e.height}}:null}}}})}async setPosition(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setPosition",payload:{type:e.type,data:{x:e.x,y:e.y}}}}}})}async setFullscreen(e){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFullscreen",payload:e}}}})}async setFocus(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFocus"}}}})}async setIcon(e){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setIcon",payload:{icon:typeof e=="string"?e:Array.from(e)}}}}})}async setSkipTaskbar(e){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setSkipTaskbar",payload:e}}}})}async setCursorGrab(e){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorGrab",payload:e}}}})}async setCursorVisible(e){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorVisible",payload:e}}}})}async setCursorIcon(e){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorIcon",payload:e}}}})}async setCursorPosition(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorPosition",payload:{type:e.type,data:{x:e.x,y:e.y}}}}}})}async setIgnoreCursorEvents(e){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setIgnoreCursorEvents",payload:e}}}})}async startDragging(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"startDragging"}}}})}async onResized(e){return this.listen("tauri://resize",e)}async onMoved(e){return this.listen("tauri://move",e)}async onCloseRequested(e){return this.listen("tauri://close-requested",t=>{let n=new Ws(t);Promise.resolve(e(n)).then(()=>{if(!n.isPreventDefault())return this.close()})})}async onFocusChanged(e){let t=await this.listen("tauri://focus",i=>{e({...i,payload:!0})}),n=await this.listen("tauri://blur",i=>{e({...i,payload:!1})});return()=>{t(),n()}}async onScaleChanged(e){return this.listen("tauri://scale-change",e)}async onMenuClicked(e){return this.listen("tauri://menu",e)}async onFileDropEvent(e){let t=await this.listen("tauri://file-drop",l=>{e({...l,payload:{type:"drop",paths:l.payload}})}),n=await this.listen("tauri://file-drop-hover",l=>{e({...l,payload:{type:"hover",paths:l.payload}})}),i=await this.listen("tauri://file-drop-cancelled",l=>{e({...l,payload:{type:"cancel"}})});return()=>{t(),n(),i()}}async onThemeChanged(e){return this.listen("tauri://theme-changed",e)}},Ws=class{constructor(e){this._preventDefault=!1,this.event=e.event,this.windowLabel=e.windowLabel,this.id=e.id}preventDefault(){this._preventDefault=!0}isPreventDefault(){return this._preventDefault}},mt=class extends Ps{constructor(e,t={}){super(e),t!=null&&t.skip||L({__tauriModule:"Window",message:{cmd:"createWebview",data:{options:{label:e,...t}}}}).then(async()=>this.emit("tauri://created")).catch(async n=>this.emit("tauri://error",n))}static getByLabel(e){return zs().some(t=>t.label===e)?new mt(e,{skip:!0}):null}},je;"__TAURI_METADATA__"in window?je=new mt(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0}):(console.warn(`Could not find "window.__TAURI_METADATA__". The "appWindow" value will reference the "main" window label. -Note that this is not an issue if running this frontend on a browser instead of a Tauri window.`),je=new mt("main",{skip:!0}));function Hi(e){return e===null?null:{name:e.name,scaleFactor:e.scaleFactor,position:new xe(e.position.x,e.position.y),size:new dt(e.size.width,e.size.height)}}async function wo(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"currentMonitor"}}}}).then(Hi)}async function ko(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"primaryMonitor"}}}}).then(Hi)}async function Mo(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"availableMonitors"}}}}).then(e=>e.map(Hi))}function Co(){return navigator.appVersion.includes("Win")}var To={};Te(To,{EOL:()=>Ao,arch:()=>Eo,platform:()=>Os,tempdir:()=>zo,type:()=>So,version:()=>Lo});var Ao=Co()?`\r +`)})}),this.spawn().catch(t)})}};async function Fi(e,t){return A({__tauriModule:"Shell",message:{cmd:"open",path:e,with:t}})}var Mo={};ke(Mo,{TauriEvent:()=>Ds,emit:()=>oi,listen:()=>Kt,once:()=>Ps});async function Ss(e,t){return A({__tauriModule:"Event",message:{cmd:"unlisten",event:e,eventId:t}})}async function Es(e,t,n){await A({__tauriModule:"Event",message:{cmd:"emit",event:e,windowLabel:t,payload:n}})}async function Ni(e,t,n){return A({__tauriModule:"Event",message:{cmd:"listen",event:e,windowLabel:t,handler:_t(n)}}).then(i=>async()=>Ss(e,i))}async function zs(e,t,n){return Ni(e,t,i=>{n(i),Ss(e,i.id).catch(()=>{})})}var Ds=(e=>(e.WINDOW_RESIZED="tauri://resize",e.WINDOW_MOVED="tauri://move",e.WINDOW_CLOSE_REQUESTED="tauri://close-requested",e.WINDOW_CREATED="tauri://window-created",e.WINDOW_DESTROYED="tauri://destroyed",e.WINDOW_FOCUS="tauri://focus",e.WINDOW_BLUR="tauri://blur",e.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",e.WINDOW_THEME_CHANGED="tauri://theme-changed",e.WINDOW_FILE_DROP="tauri://file-drop",e.WINDOW_FILE_DROP_HOVER="tauri://file-drop-hover",e.WINDOW_FILE_DROP_CANCELLED="tauri://file-drop-cancelled",e.MENU="tauri://menu",e.CHECK_UPDATE="tauri://update",e.UPDATE_AVAILABLE="tauri://update-available",e.INSTALL_UPDATE="tauri://update-install",e.STATUS_UPDATE="tauri://update-status",e.DOWNLOAD_PROGRESS="tauri://update-download-progress",e))(Ds||{});async function Kt(e,t){return Ni(e,null,t)}async function Ps(e,t){return zs(e,null,t)}async function oi(e,t){return Es(e,void 0,t)}var Co={};ke(Co,{CloseRequestedEvent:()=>Hs,LogicalPosition:()=>Ws,LogicalSize:()=>ti,PhysicalPosition:()=>nt,PhysicalSize:()=>mt,UserAttentionType:()=>ji,WebviewWindow:()=>bt,WebviewWindowHandle:()=>Rs,WindowManager:()=>Is,appWindow:()=>qe,availableMonitors:()=>Ao,currentMonitor:()=>To,getAll:()=>Os,getCurrent:()=>Bt,primaryMonitor:()=>Lo});var ti=class{constructor(e,t){this.type="Logical",this.width=e,this.height=t}},mt=class{constructor(e,t){this.type="Physical",this.width=e,this.height=t}toLogical(e){return new ti(this.width/e,this.height/e)}},Ws=class{constructor(e,t){this.type="Logical",this.x=e,this.y=t}},nt=class{constructor(e,t){this.type="Physical",this.x=e,this.y=t}toLogical(e){return new Ws(this.x/e,this.y/e)}},ji=(e=>(e[e.Critical=1]="Critical",e[e.Informational=2]="Informational",e))(ji||{});function Bt(){return new bt(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0})}function Os(){return window.__TAURI_METADATA__.__windows.map(e=>new bt(e.label,{skip:!0}))}var Jl=["tauri://created","tauri://error"],Rs=class{constructor(e){this.label=e,this.listeners=Object.create(null)}async listen(e,t){return this._handleTauriEvent(e,t)?Promise.resolve(()=>{let n=this.listeners[e];n.splice(n.indexOf(t),1)}):Ni(e,this.label,t)}async once(e,t){return this._handleTauriEvent(e,t)?Promise.resolve(()=>{let n=this.listeners[e];n.splice(n.indexOf(t),1)}):zs(e,this.label,t)}async emit(e,t){if(Jl.includes(e)){for(let n of this.listeners[e]||[])n({event:e,id:-1,windowLabel:this.label,payload:t});return Promise.resolve()}return Es(e,this.label,t)}_handleTauriEvent(e,t){return Jl.includes(e)?(e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t],!0):!1}},Is=class extends Rs{async scaleFactor(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"scaleFactor"}}}})}async innerPosition(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerPosition"}}}}).then(({x:e,y:t})=>new nt(e,t))}async outerPosition(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerPosition"}}}}).then(({x:e,y:t})=>new nt(e,t))}async innerSize(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerSize"}}}}).then(({width:e,height:t})=>new mt(e,t))}async outerSize(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerSize"}}}}).then(({width:e,height:t})=>new mt(e,t))}async isFullscreen(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isFullscreen"}}}})}async isMinimized(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isMinimized"}}}})}async isMaximized(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isMaximized"}}}})}async isDecorated(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isDecorated"}}}})}async isResizable(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isResizable"}}}})}async isVisible(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isVisible"}}}})}async title(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"title"}}}})}async theme(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"theme"}}}})}async center(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"center"}}}})}async requestUserAttention(e){let t=null;return e&&(e===1?t={type:"Critical"}:t={type:"Informational"}),A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"requestUserAttention",payload:t}}}})}async setResizable(e){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setResizable",payload:e}}}})}async setTitle(e){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setTitle",payload:e}}}})}async maximize(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"maximize"}}}})}async unmaximize(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unmaximize"}}}})}async toggleMaximize(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"toggleMaximize"}}}})}async minimize(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"minimize"}}}})}async unminimize(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unminimize"}}}})}async show(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"show"}}}})}async hide(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"hide"}}}})}async close(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"close"}}}})}async setDecorations(e){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setDecorations",payload:e}}}})}async setAlwaysOnTop(e){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setAlwaysOnTop",payload:e}}}})}async setContentProtected(e){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setContentProtected",payload:e}}}})}async setSize(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setSize",payload:{type:e.type,data:{width:e.width,height:e.height}}}}}})}async setMinSize(e){if(e&&e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMinSize",payload:e?{type:e.type,data:{width:e.width,height:e.height}}:null}}}})}async setMaxSize(e){if(e&&e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMaxSize",payload:e?{type:e.type,data:{width:e.width,height:e.height}}:null}}}})}async setPosition(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setPosition",payload:{type:e.type,data:{x:e.x,y:e.y}}}}}})}async setFullscreen(e){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFullscreen",payload:e}}}})}async setFocus(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFocus"}}}})}async setIcon(e){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setIcon",payload:{icon:typeof e=="string"?e:Array.from(e)}}}}})}async setSkipTaskbar(e){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setSkipTaskbar",payload:e}}}})}async setCursorGrab(e){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorGrab",payload:e}}}})}async setCursorVisible(e){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorVisible",payload:e}}}})}async setCursorIcon(e){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorIcon",payload:e}}}})}async setCursorPosition(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorPosition",payload:{type:e.type,data:{x:e.x,y:e.y}}}}}})}async setIgnoreCursorEvents(e){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setIgnoreCursorEvents",payload:e}}}})}async startDragging(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"startDragging"}}}})}async onResized(e){return this.listen("tauri://resize",e)}async onMoved(e){return this.listen("tauri://move",e)}async onCloseRequested(e){return this.listen("tauri://close-requested",t=>{let n=new Hs(t);Promise.resolve(e(n)).then(()=>{if(!n.isPreventDefault())return this.close()})})}async onFocusChanged(e){let t=await this.listen("tauri://focus",i=>{e({...i,payload:!0})}),n=await this.listen("tauri://blur",i=>{e({...i,payload:!1})});return()=>{t(),n()}}async onScaleChanged(e){return this.listen("tauri://scale-change",e)}async onMenuClicked(e){return this.listen("tauri://menu",e)}async onFileDropEvent(e){let t=await this.listen("tauri://file-drop",l=>{e({...l,payload:{type:"drop",paths:l.payload}})}),n=await this.listen("tauri://file-drop-hover",l=>{e({...l,payload:{type:"hover",paths:l.payload}})}),i=await this.listen("tauri://file-drop-cancelled",l=>{e({...l,payload:{type:"cancel"}})});return()=>{t(),n(),i()}}async onThemeChanged(e){return this.listen("tauri://theme-changed",e)}},Hs=class{constructor(e){this._preventDefault=!1,this.event=e.event,this.windowLabel=e.windowLabel,this.id=e.id}preventDefault(){this._preventDefault=!0}isPreventDefault(){return this._preventDefault}},bt=class extends Is{constructor(e,t={}){super(e),t!=null&&t.skip||A({__tauriModule:"Window",message:{cmd:"createWebview",data:{options:{label:e,...t}}}}).then(async()=>this.emit("tauri://created")).catch(async n=>this.emit("tauri://error",n))}static getByLabel(e){return Os().some(t=>t.label===e)?new bt(e,{skip:!0}):null}},qe;"__TAURI_METADATA__"in window?qe=new bt(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0}):(console.warn(`Could not find "window.__TAURI_METADATA__". The "appWindow" value will reference the "main" window label. +Note that this is not an issue if running this frontend on a browser instead of a Tauri window.`),qe=new bt("main",{skip:!0}));function Ui(e){return e===null?null:{name:e.name,scaleFactor:e.scaleFactor,position:new nt(e.position.x,e.position.y),size:new mt(e.size.width,e.size.height)}}async function To(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"currentMonitor"}}}}).then(Ui)}async function Lo(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"primaryMonitor"}}}}).then(Ui)}async function Ao(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"availableMonitors"}}}}).then(e=>e.map(Ui))}function So(){return navigator.appVersion.includes("Win")}var Eo={};ke(Eo,{EOL:()=>zo,arch:()=>Wo,platform:()=>Fs,tempdir:()=>Oo,type:()=>Po,version:()=>Do});var zo=So()?`\r `:` -`;async function Os(){return L({__tauriModule:"Os",message:{cmd:"platform"}})}async function Lo(){return L({__tauriModule:"Os",message:{cmd:"version"}})}async function So(){return L({__tauriModule:"Os",message:{cmd:"osType"}})}async function Eo(){return L({__tauriModule:"Os",message:{cmd:"arch"}})}async function zo(){return L({__tauriModule:"Os",message:{cmd:"tempdir"}})}var Do={};Te(Do,{getName:()=>Is,getTauriVersion:()=>Hs,getVersion:()=>Rs,hide:()=>Ns,show:()=>Fs});async function Rs(){return L({__tauriModule:"App",message:{cmd:"getAppVersion"}})}async function Is(){return L({__tauriModule:"App",message:{cmd:"getAppName"}})}async function Hs(){return L({__tauriModule:"App",message:{cmd:"getTauriVersion"}})}async function Fs(){return L({__tauriModule:"App",message:{cmd:"show"}})}async function Ns(){return L({__tauriModule:"App",message:{cmd:"hide"}})}var Po={};Te(Po,{exit:()=>js,relaunch:()=>Fi});async function js(e=0){return L({__tauriModule:"Process",message:{cmd:"exit",exitCode:e}})}async function Fi(){return L({__tauriModule:"Process",message:{cmd:"relaunch"}})}function Wo(e){let t,n,i,l,o,u,d,c,f,v,k,_,y,g,b,A,D,F,W,j,S,C,T,P,M,N;return{c(){t=r("p"),t.innerHTML=`This is a demo of Tauri's API capabilities using the @tauri-apps/api package. It's used as the main validation app, serving as the test bed of our +`;async function Fs(){return A({__tauriModule:"Os",message:{cmd:"platform"}})}async function Do(){return A({__tauriModule:"Os",message:{cmd:"version"}})}async function Po(){return A({__tauriModule:"Os",message:{cmd:"osType"}})}async function Wo(){return A({__tauriModule:"Os",message:{cmd:"arch"}})}async function Oo(){return A({__tauriModule:"Os",message:{cmd:"tempdir"}})}var Ro={};ke(Ro,{getName:()=>js,getTauriVersion:()=>Us,getVersion:()=>Ns,hide:()=>Bs,show:()=>qs});async function Ns(){return A({__tauriModule:"App",message:{cmd:"getAppVersion"}})}async function js(){return A({__tauriModule:"App",message:{cmd:"getAppName"}})}async function Us(){return A({__tauriModule:"App",message:{cmd:"getTauriVersion"}})}async function qs(){return A({__tauriModule:"App",message:{cmd:"show"}})}async function Bs(){return A({__tauriModule:"App",message:{cmd:"hide"}})}var Io={};ke(Io,{exit:()=>Vs,relaunch:()=>qi});async function Vs(e=0){return A({__tauriModule:"Process",message:{cmd:"exit",exitCode:e}})}async function qi(){return A({__tauriModule:"Process",message:{cmd:"relaunch"}})}function Ho(e){let t,n,i,l,o,u,d,c,f,g,k,_,y,v,b,L,D,H,W,j,E,M,T,P,C,F;return{c(){t=r("p"),t.innerHTML=`This is a demo of Tauri's API capabilities using the @tauri-apps/api package. It's used as the main validation app, serving as the test bed of our development process. In the future, this app will be used on Tauri's integration - tests.`,n=h(),i=r("br"),l=h(),o=r("br"),u=h(),d=r("pre"),c=z("App name: "),f=r("code"),v=z(e[2]),k=z(` -App version: `),_=r("code"),y=z(e[0]),g=z(` -Tauri version: `),b=r("code"),A=z(e[1]),D=z(` -`),F=h(),W=r("br"),j=h(),S=r("div"),C=r("button"),C.textContent="Close application",T=h(),P=r("button"),P.textContent="Relaunch application",a(C,"class","btn"),a(P,"class","btn"),a(S,"class","flex flex-wrap gap-1 shadow-")},m(U,J){m(U,t,J),m(U,n,J),m(U,i,J),m(U,l,J),m(U,o,J),m(U,u,J),m(U,d,J),s(d,c),s(d,f),s(f,v),s(d,k),s(d,_),s(_,y),s(d,g),s(d,b),s(b,A),s(d,D),m(U,F,J),m(U,W,J),m(U,j,J),m(U,S,J),s(S,C),s(S,T),s(S,P),M||(N=[E(C,"click",e[3]),E(P,"click",e[4])],M=!0)},p(U,[J]){J&4&&K(v,U[2]),J&1&&K(y,U[0]),J&2&&K(A,U[1])},i:V,o:V,d(U){U&&p(t),U&&p(n),U&&p(i),U&&p(l),U&&p(o),U&&p(u),U&&p(d),U&&p(F),U&&p(W),U&&p(j),U&&p(S),M=!1,se(N)}}}function Oo(e,t,n){let i="0.0.0",l="0.0.0",o="Unknown";Is().then(c=>{n(2,o=c)}),Rs().then(c=>{n(0,i=c)}),Hs().then(c=>{n(1,l=c)});async function u(){await js()}async function d(){await Fi()}return[i,l,o,u,d]}class Ro extends we{constructor(t){super(),ye(this,t,Oo,Wo,me,{})}}var Io={};Te(Io,{getMatches:()=>Us});async function Us(){return L({__tauriModule:"Cli",message:{cmd:"cliMatches"}})}function Ho(e){let t,n,i,l,o,u,d,c,f,v,k,_,y;return{c(){t=r("p"),t.innerHTML=`This binary can be run from the terminal and takes the following arguments: + tests.`,n=h(),i=r("br"),l=h(),o=r("br"),u=h(),d=r("pre"),c=z("App name: "),f=r("code"),g=z(e[2]),k=z(` +App version: `),_=r("code"),y=z(e[0]),v=z(` +Tauri version: `),b=r("code"),L=z(e[1]),D=z(` +`),H=h(),W=r("br"),j=h(),E=r("div"),M=r("button"),M.textContent="Close application",T=h(),P=r("button"),P.textContent="Relaunch application",a(M,"class","btn"),a(P,"class","btn"),a(E,"class","flex flex-wrap gap-1 shadow-")},m(U,J){m(U,t,J),m(U,n,J),m(U,i,J),m(U,l,J),m(U,o,J),m(U,u,J),m(U,d,J),s(d,c),s(d,f),s(f,g),s(d,k),s(d,_),s(_,y),s(d,v),s(d,b),s(b,L),s(d,D),m(U,H,J),m(U,W,J),m(U,j,J),m(U,E,J),s(E,M),s(E,T),s(E,P),C||(F=[S(M,"click",e[3]),S(P,"click",e[4])],C=!0)},p(U,[J]){J&4&&Q(g,U[2]),J&1&&Q(y,U[0]),J&2&&Q(L,U[1])},i:G,o:G,d(U){U&&p(t),U&&p(n),U&&p(i),U&&p(l),U&&p(o),U&&p(u),U&&p(d),U&&p(H),U&&p(W),U&&p(j),U&&p(E),C=!1,re(F)}}}function Fo(e,t,n){let i="0.0.0",l="0.0.0",o="Unknown";js().then(c=>{n(2,o=c)}),Ns().then(c=>{n(0,i=c)}),Us().then(c=>{n(1,l=c)});async function u(){await Vs()}async function d(){await qi()}return[i,l,o,u,d]}class No extends ve{constructor(t){super(),ge(this,t,Fo,Ho,pe,{})}}var jo={};ke(jo,{getMatches:()=>Gs});async function Gs(){return A({__tauriModule:"Cli",message:{cmd:"cliMatches"}})}function Uo(e){let t,n,i,l,o,u,d,c,f,g,k,_,y;return{c(){t=r("p"),t.innerHTML=`This binary can be run from the terminal and takes the following arguments:
  --config <PATH>
   --theme <light|dark|system>
   --verbose
- Additionally, it has a update --background subcommand.`,n=h(),i=r("br"),l=h(),o=r("div"),o.textContent="Note that the arguments are only parsed, not implemented.",u=h(),d=r("br"),c=h(),f=r("br"),v=h(),k=r("button"),k.textContent="Get matches",a(o,"class","note"),a(k,"class","btn"),a(k,"id","cli-matches")},m(g,b){m(g,t,b),m(g,n,b),m(g,i,b),m(g,l,b),m(g,o,b),m(g,u,b),m(g,d,b),m(g,c,b),m(g,f,b),m(g,v,b),m(g,k,b),_||(y=E(k,"click",e[0]),_=!0)},p:V,i:V,o:V,d(g){g&&p(t),g&&p(n),g&&p(i),g&&p(l),g&&p(o),g&&p(u),g&&p(d),g&&p(c),g&&p(f),g&&p(v),g&&p(k),_=!1,y()}}}function Fo(e,t,n){let{onMessage:i}=t;function l(){Us().then(i).catch(i)}return e.$$set=o=>{"onMessage"in o&&n(1,i=o.onMessage)},[l,i]}class No extends we{constructor(t){super(),ye(this,t,Fo,Ho,me,{onMessage:1})}}function jo(e){let t,n,i,l,o,u,d,c;return{c(){t=r("div"),n=r("button"),n.textContent="Call Log API",i=h(),l=r("button"),l.textContent="Call Request (async) API",o=h(),u=r("button"),u.textContent="Send event to Rust",a(n,"class","btn"),a(n,"id","log"),a(l,"class","btn"),a(l,"id","request"),a(u,"class","btn"),a(u,"id","event")},m(f,v){m(f,t,v),s(t,n),s(t,i),s(t,l),s(t,o),s(t,u),d||(c=[E(n,"click",e[0]),E(l,"click",e[1]),E(u,"click",e[2])],d=!0)},p:V,i:V,o:V,d(f){f&&p(t),d=!1,se(c)}}}function Uo(e,t,n){let{onMessage:i}=t,l;ut(async()=>{l=await Xt("rust-event",i)}),Pi(()=>{l&&l()});function o(){Kn("log_operation",{event:"tauri-click",payload:"this payload is optional because we used Option in Rust"})}function u(){Kn("perform_request",{endpoint:"dummy endpoint arg",body:{id:5,name:"test"}}).then(i).catch(i)}function d(){ni("js-event","this is the payload string")}return e.$$set=c=>{"onMessage"in c&&n(3,i=c.onMessage)},[o,u,d,i]}class qo extends we{constructor(t){super(),ye(this,t,Uo,jo,me,{onMessage:3})}}var Bo={};Te(Bo,{ask:()=>Bs,confirm:()=>Go,message:()=>Vo,open:()=>Ni,save:()=>qs});async function Ni(e={}){return typeof e=="object"&&Object.freeze(e),L({__tauriModule:"Dialog",message:{cmd:"openDialog",options:e}})}async function qs(e={}){return typeof e=="object"&&Object.freeze(e),L({__tauriModule:"Dialog",message:{cmd:"saveDialog",options:e}})}async function Vo(e,t){var n;let i=typeof t=="string"?{title:t}:t;return L({__tauriModule:"Dialog",message:{cmd:"messageDialog",message:e.toString(),title:(n=i==null?void 0:i.title)==null?void 0:n.toString(),type:i==null?void 0:i.type}})}async function Bs(e,t){var n;let i=typeof t=="string"?{title:t}:t;return L({__tauriModule:"Dialog",message:{cmd:"askDialog",message:e.toString(),title:(n=i==null?void 0:i.title)==null?void 0:n.toString(),type:i==null?void 0:i.type}})}async function Go(e,t){var n;let i=typeof t=="string"?{title:t}:t;return L({__tauriModule:"Dialog",message:{cmd:"confirmDialog",message:e.toString(),title:(n=i==null?void 0:i.title)==null?void 0:n.toString(),type:i==null?void 0:i.type}})}var Jo={};Te(Jo,{BaseDirectory:()=>Jt,Dir:()=>Jt,copyFile:()=>Qo,createDir:()=>$o,exists:()=>er,readBinaryFile:()=>ji,readDir:()=>Vs,readTextFile:()=>Xo,removeDir:()=>Ko,removeFile:()=>Zo,renameFile:()=>xo,writeBinaryFile:()=>Yo,writeFile:()=>Di,writeTextFile:()=>Di});var Jt=(e=>(e[e.Audio=1]="Audio",e[e.Cache=2]="Cache",e[e.Config=3]="Config",e[e.Data=4]="Data",e[e.LocalData=5]="LocalData",e[e.Desktop=6]="Desktop",e[e.Document=7]="Document",e[e.Download=8]="Download",e[e.Executable=9]="Executable",e[e.Font=10]="Font",e[e.Home=11]="Home",e[e.Picture=12]="Picture",e[e.Public=13]="Public",e[e.Runtime=14]="Runtime",e[e.Template=15]="Template",e[e.Video=16]="Video",e[e.Resource=17]="Resource",e[e.App=18]="App",e[e.Log=19]="Log",e[e.Temp=20]="Temp",e[e.AppConfig=21]="AppConfig",e[e.AppData=22]="AppData",e[e.AppLocalData=23]="AppLocalData",e[e.AppCache=24]="AppCache",e[e.AppLog=25]="AppLog",e))(Jt||{});async function Xo(e,t={}){return L({__tauriModule:"Fs",message:{cmd:"readTextFile",path:e,options:t}})}async function ji(e,t={}){let n=await L({__tauriModule:"Fs",message:{cmd:"readFile",path:e,options:t}});return Uint8Array.from(n)}async function Di(e,t,n){typeof n=="object"&&Object.freeze(n),typeof e=="object"&&Object.freeze(e);let i={path:"",contents:""},l=n;return typeof e=="string"?i.path=e:(i.path=e.path,i.contents=e.contents),typeof t=="string"?i.contents=t!=null?t:"":l=t,L({__tauriModule:"Fs",message:{cmd:"writeFile",path:i.path,contents:Array.from(new TextEncoder().encode(i.contents)),options:l}})}async function Yo(e,t,n){typeof n=="object"&&Object.freeze(n),typeof e=="object"&&Object.freeze(e);let i={path:"",contents:[]},l=n;return typeof e=="string"?i.path=e:(i.path=e.path,i.contents=e.contents),t&&"dir"in t?l=t:typeof e=="string"&&(i.contents=t!=null?t:[]),L({__tauriModule:"Fs",message:{cmd:"writeFile",path:i.path,contents:Array.from(i.contents instanceof ArrayBuffer?new Uint8Array(i.contents):i.contents),options:l}})}async function Vs(e,t={}){return L({__tauriModule:"Fs",message:{cmd:"readDir",path:e,options:t}})}async function $o(e,t={}){return L({__tauriModule:"Fs",message:{cmd:"createDir",path:e,options:t}})}async function Ko(e,t={}){return L({__tauriModule:"Fs",message:{cmd:"removeDir",path:e,options:t}})}async function Qo(e,t,n={}){return L({__tauriModule:"Fs",message:{cmd:"copyFile",source:e,destination:t,options:n}})}async function Zo(e,t={}){return L({__tauriModule:"Fs",message:{cmd:"removeFile",path:e,options:t}})}async function xo(e,t,n={}){return L({__tauriModule:"Fs",message:{cmd:"renameFile",oldPath:e,newPath:t,options:n}})}async function er(e,t={}){return L({__tauriModule:"Fs",message:{cmd:"exists",path:e,options:t}})}function tr(e){let t,n,i,l,o,u,d,c,f,v,k,_,y,g,b,A,D,F,W,j,S,C,T,P;return{c(){t=r("div"),n=r("input"),i=h(),l=r("input"),o=h(),u=r("br"),d=h(),c=r("div"),f=r("input"),v=h(),k=r("label"),k.textContent="Multiple",_=h(),y=r("div"),g=r("input"),b=h(),A=r("label"),A.textContent="Directory",D=h(),F=r("br"),W=h(),j=r("button"),j.textContent="Open dialog",S=h(),C=r("button"),C.textContent="Open save dialog",a(n,"class","input"),a(n,"id","dialog-default-path"),a(n,"placeholder","Default path"),a(l,"class","input"),a(l,"id","dialog-filter"),a(l,"placeholder","Extensions filter, comma-separated"),a(t,"class","flex gap-2 children:grow"),a(f,"type","checkbox"),a(f,"id","dialog-multiple"),a(k,"for","dialog-multiple"),a(g,"type","checkbox"),a(g,"id","dialog-directory"),a(A,"for","dialog-directory"),a(j,"class","btn"),a(j,"id","open-dialog"),a(C,"class","btn"),a(C,"id","save-dialog")},m(M,N){m(M,t,N),s(t,n),B(n,e[0]),s(t,i),s(t,l),B(l,e[1]),m(M,o,N),m(M,u,N),m(M,d,N),m(M,c,N),s(c,f),f.checked=e[2],s(c,v),s(c,k),m(M,_,N),m(M,y,N),s(y,g),g.checked=e[3],s(y,b),s(y,A),m(M,D,N),m(M,F,N),m(M,W,N),m(M,j,N),m(M,S,N),m(M,C,N),T||(P=[E(n,"input",e[8]),E(l,"input",e[9]),E(f,"change",e[10]),E(g,"change",e[11]),E(j,"click",e[4]),E(C,"click",e[5])],T=!0)},p(M,[N]){N&1&&n.value!==M[0]&&B(n,M[0]),N&2&&l.value!==M[1]&&B(l,M[1]),N&4&&(f.checked=M[2]),N&8&&(g.checked=M[3])},i:V,o:V,d(M){M&&p(t),M&&p(o),M&&p(u),M&&p(d),M&&p(c),M&&p(_),M&&p(y),M&&p(D),M&&p(F),M&&p(W),M&&p(j),M&&p(S),M&&p(C),T=!1,se(P)}}}function nr(e,t){var n=new Blob([e],{type:"application/octet-binary"}),i=new FileReader;i.onload=function(l){var o=l.target.result;t(o.substr(o.indexOf(",")+1))},i.readAsDataURL(n)}function ir(e,t,n){let{onMessage:i}=t,{insecureRenderHtml:l}=t,o=null,u=null,d=!1,c=!1;function f(){Ni({title:"My wonderful open dialog",defaultPath:o,filters:u?[{name:"Tauri Example",extensions:u.split(",").map(b=>b.trim())}]:[],multiple:d,directory:c}).then(function(b){if(Array.isArray(b))i(b);else{var A=b,D=A.match(/\S+\.\S+$/g);ji(A).then(function(F){D&&(A.includes(".png")||A.includes(".jpg"))?nr(new Uint8Array(F),function(W){var j="data:image/png;base64,"+W;l('')}):i(b)}).catch(i(b))}}).catch(i)}function v(){qs({title:"My wonderful save dialog",defaultPath:o,filters:u?[{name:"Tauri Example",extensions:u.split(",").map(b=>b.trim())}]:[]}).then(i).catch(i)}function k(){o=this.value,n(0,o)}function _(){u=this.value,n(1,u)}function y(){d=this.checked,n(2,d)}function g(){c=this.checked,n(3,c)}return e.$$set=b=>{"onMessage"in b&&n(6,i=b.onMessage),"insecureRenderHtml"in b&&n(7,l=b.insecureRenderHtml)},[o,u,d,c,f,v,i,l,k,_,y,g]}class lr extends we{constructor(t){super(),ye(this,t,ir,tr,me,{onMessage:6,insecureRenderHtml:7})}}function Bl(e,t,n){const i=e.slice();return i[9]=t[n],i}function Vl(e){let t,n=e[9][0]+"",i,l;return{c(){t=r("option"),i=z(n),t.__value=l=e[9][1],t.value=t.__value},m(o,u){m(o,t,u),s(t,i)},p:V,d(o){o&&p(t)}}}function sr(e){let t,n,i,l,o,u,d,c,f,v,k,_,y,g,b,A,D,F,W,j=e[2],S=[];for(let C=0;CisNaN(parseInt(_))).map(_=>[_,Jt[_]]);function c(){const _=o.match(/\S+\.\S+$/g),y={dir:Gl()};(_?ji(o,y):Vs(o,y)).then(function(b){if(_)if(o.includes(".png")||o.includes(".jpg"))or(new Uint8Array(b),function(A){const D="data:image/png;base64,"+A;l('')});else{const A=String.fromCharCode.apply(null,b);l(''),setTimeout(()=>{const D=document.getElementById("file-response");D.value=A,document.getElementById("file-save").addEventListener("click",function(){Di(o,D.value,{dir:Gl()}).catch(i)})})}else i(b)}).catch(i)}function f(){n(1,u.src=ks(o),u)}function v(){o=this.value,n(0,o)}function k(_){Yn[_?"unshift":"push"](()=>{u=_,n(1,u)})}return e.$$set=_=>{"onMessage"in _&&n(5,i=_.onMessage),"insecureRenderHtml"in _&&n(6,l=_.insecureRenderHtml)},[o,u,d,c,f,i,l,v,k]}class ar extends we{constructor(t){super(),ye(this,t,rr,sr,me,{onMessage:5,insecureRenderHtml:6})}}var ur={};Te(ur,{Body:()=>et,Client:()=>Js,Response:()=>Gs,ResponseType:()=>Ui,fetch:()=>cr,getClient:()=>Zn});var Ui=(e=>(e[e.JSON=1]="JSON",e[e.Text=2]="Text",e[e.Binary=3]="Binary",e))(Ui||{}),et=class{constructor(e,t){this.type=e,this.payload=t}static form(e){let t={},n=(i,l)=>{if(l!==null){let o;typeof l=="string"?o=l:l instanceof Uint8Array||Array.isArray(l)?o=Array.from(l):l instanceof File?o={file:l.name,mime:l.type,fileName:l.name}:typeof l.file=="string"?o={file:l.file,mime:l.mime,fileName:l.fileName}:o={file:Array.from(l.file),mime:l.mime,fileName:l.fileName},t[i]=o}};if(e instanceof FormData)for(let[i,l]of e)n(i,l);else for(let i in e){let l=e[i];n(i,l)}return new et("Form",t)}static json(e){return new et("Json",e)}static text(e){return new et("Text",e)}static bytes(e){return new et("Bytes",Array.from(e instanceof ArrayBuffer?new Uint8Array(e):e))}},Gs=class{constructor(e){this.url=e.url,this.status=e.status,this.ok=this.status>=200&&this.status<300,this.headers=e.headers,this.rawHeaders=e.rawHeaders,this.data=e.data}},Js=class{constructor(e){this.id=e}async drop(){return L({__tauriModule:"Http",message:{cmd:"dropClient",client:this.id}})}async request(e){let t=!e.responseType||e.responseType===1;return t&&(e.responseType=2),L({__tauriModule:"Http",message:{cmd:"httpRequest",client:this.id,options:e}}).then(n=>{let i=new Gs(n);if(t){try{i.data=JSON.parse(i.data)}catch(l){if(i.ok&&i.data==="")i.data={};else if(i.ok)throw Error(`Failed to parse response \`${i.data}\` as JSON: ${l}; - try setting the \`responseType\` option to \`ResponseType.Text\` or \`ResponseType.Binary\` if the API does not return a JSON response.`)}return i}return i})}async get(e,t){return this.request({method:"GET",url:e,...t})}async post(e,t,n){return this.request({method:"POST",url:e,body:t,...n})}async put(e,t,n){return this.request({method:"PUT",url:e,body:t,...n})}async patch(e,t){return this.request({method:"PATCH",url:e,...t})}async delete(e,t){return this.request({method:"DELETE",url:e,...t})}};async function Zn(e){return L({__tauriModule:"Http",message:{cmd:"createClient",options:e}}).then(t=>new Js(t))}var Si=null;async function cr(e,t){var n;return Si===null&&(Si=await Zn()),Si.request({url:e,method:(n=t==null?void 0:t.method)!=null?n:"GET",...t})}function Jl(e,t,n){const i=e.slice();return i[12]=t[n],i[14]=n,i}function Xl(e){let t,n,i,l,o,u,d,c,f,v,k,_,y,g,b,A,D,F=e[5],W=[];for(let T=0;TRe(W[T],1,1,()=>{W[T]=null});let S=!e[3]&&Ql(),C=!e[3]&&e[8]&&Zl();return{c(){t=r("span"),n=r("span"),i=z(e[6]),l=h(),o=r("ul");for(let T=0;T{v[g]=null}),ti(),o=v[l],o?o.p(_,y):(o=v[l]=f[l](_),o.c()),ze(o,1),o.m(t,u))},i(_){d||(ze(o),d=!0)},o(_){Re(o),d=!1},d(_){_&&p(t),c&&c.d(),v[l].d()}}}function Ql(e){let t;return{c(){t=r("span"),t.textContent=",",a(t,"class","comma svelte-gbh3pt")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function Zl(e){let t;return{c(){t=r("span"),t.textContent=",",a(t,"class","comma svelte-gbh3pt")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function pr(e){let t,n,i=e[5].length&&Xl(e);return{c(){i&&i.c(),t=xn()},m(l,o){i&&i.m(l,o),m(l,t,o),n=!0},p(l,[o]){l[5].length?i?(i.p(l,o),o&32&&ze(i,1)):(i=Xl(l),i.c(),ze(i,1),i.m(t.parentNode,t)):i&&(ei(),Re(i,1,1,()=>{i=null}),ti())},i(l){n||(ze(i),n=!0)},o(l){Re(i),n=!1},d(l){i&&i.d(l),l&&p(t)}}}const mr="...";function hr(e,t,n){let{json:i}=t,{depth:l=1/0}=t,{_lvl:o=0}=t,{_last:u=!0}=t;const d=b=>b===null?"null":typeof b;let c,f,v,k,_;const y=b=>{switch(d(b)){case"string":return`"${b}"`;case"function":return"f () {...}";case"symbol":return b.toString();default:return b}},g=()=>{n(8,_=!_)};return e.$$set=b=>{"json"in b&&n(0,i=b.json),"depth"in b&&n(1,l=b.depth),"_lvl"in b&&n(2,o=b._lvl),"_last"in b&&n(3,u=b._last)},e.$$.update=()=>{e.$$.dirty&17&&(n(5,c=d(i)==="object"?Object.keys(i):[]),n(4,f=Array.isArray(i)),n(6,v=f?"[":"{"),n(7,k=f?"]":"}")),e.$$.dirty&6&&n(8,_=le[9].call(n)),a(k,"class","input h-auto w-100%"),a(k,"id","request-body"),a(k,"placeholder","Request body"),a(k,"rows","5"),a(b,"class","btn"),a(b,"id","make-request"),a(C,"class","input"),a(P,"class","input"),a(S,"class","flex gap-2 children:grow"),a(Q,"type","checkbox"),a($,"class","btn"),a($,"type","button")},m(R,q){m(R,t,q),s(t,n),s(n,i),s(n,l),s(n,o),s(n,u),s(n,d),zt(n,e[0]),s(t,c),s(t,f),s(t,v),s(t,k),B(k,e[1]),s(t,_),s(t,y),s(t,g),s(t,b),m(R,A,q),m(R,D,q),m(R,F,q),m(R,W,q),m(R,j,q),m(R,S,q),s(S,C),B(C,e[2]),s(S,T),s(S,P),B(P,e[3]),m(R,M,q),m(R,N,q),m(R,U,q),m(R,J,q),s(J,Q),Q.checked=e[5],s(J,he),m(R,x,q),m(R,ne,q),m(R,Y,q),m(R,_e,q),m(R,O,q),m(R,$,q),m(R,ie,q),m(R,oe,q),m(R,Z,q),m(R,pe,q),m(R,re,q),Vt(be,R,q),ee=!0,ke||(Ae=[E(n,"change",e[9]),E(k,"input",e[10]),E(t,"submit",Xn(e[6])),E(C,"input",e[11]),E(P,"input",e[12]),E(Q,"change",e[13]),E($,"click",e[7])],ke=!0)},p(R,[q]){q&1&&zt(n,R[0]),q&2&&B(k,R[1]),q&4&&C.value!==R[2]&&B(C,R[2]),q&8&&P.value!==R[3]&&B(P,R[3]),q&32&&(Q.checked=R[5]);const We={};q&16&&(We.json=R[4]),be.$set(We)},i(R){ee||(ze(be.$$.fragment,R),ee=!0)},o(R){Re(be.$$.fragment,R),ee=!1},d(R){R&&p(t),R&&p(A),R&&p(D),R&&p(F),R&&p(W),R&&p(j),R&&p(S),R&&p(M),R&&p(N),R&&p(U),R&&p(J),R&&p(x),R&&p(ne),R&&p(Y),R&&p(_e),R&&p(O),R&&p($),R&&p(ie),R&&p(oe),R&&p(Z),R&&p(pe),R&&p(re),Gt(be,R),ke=!1,se(Ae)}}}function br(e,t,n){let i="GET",l="",{onMessage:o}=t;async function u(){const D=await Zn().catch(j=>{throw o(j),j}),W={url:"http://localhost:3003",method:i||"GET"||"GET"};l.startsWith("{")&&l.endsWith("}")||l.startsWith("[")&&l.endsWith("]")?W.body=et.json(JSON.parse(l)):l!==""&&(W.body=et.text(l)),D.request(W).then(o).catch(o)}let d="baz",c="qux",f=null,v=!0;async function k(){const D=await Zn().catch(F=>{throw o(F),F});n(4,f=await D.request({url:"http://localhost:3003",method:"POST",body:et.form({foo:d,bar:c}),headers:v?{"Content-Type":"multipart/form-data"}:void 0,responseType:Ui.Text}))}function _(){i=Ei(this),n(0,i)}function y(){l=this.value,n(1,l)}function g(){d=this.value,n(2,d)}function b(){c=this.value,n(3,c)}function A(){v=this.checked,n(5,v)}return e.$$set=D=>{"onMessage"in D&&n(8,o=D.onMessage)},[i,l,d,c,f,v,u,k,o,_,y,g,b,A]}class gr extends we{constructor(t){super(),ye(this,t,br,_r,me,{onMessage:8})}}function vr(e){let t,n,i;return{c(){t=r("button"),t.textContent="Send test notification",a(t,"class","btn"),a(t,"id","notification")},m(l,o){m(l,t,o),n||(i=E(t,"click",yr),n=!0)},p:V,i:V,o:V,d(l){l&&p(t),n=!1,i()}}}function yr(){new Notification("Notification title",{body:"This is the notification body"})}function wr(e,t,n){let{onMessage:i}=t;return e.$$set=l=>{"onMessage"in l&&n(0,i=l.onMessage)},[i]}class kr extends we{constructor(t){super(),ye(this,t,wr,vr,me,{onMessage:0})}}function xl(e,t,n){const i=e.slice();return i[67]=t[n],i}function es(e,t,n){const i=e.slice();return i[70]=t[n],i}function ts(e){let t,n,i,l,o,u,d=Object.keys(e[1]),c=[];for(let f=0;fe[39].call(i))},m(f,v){m(f,t,v),m(f,n,v),m(f,i,v),s(i,l);for(let k=0;ke[57].call(Ne)),a($e,"class","input"),a($e,"type","number"),a(Ke,"class","input"),a(Ke,"type","number"),a(Fe,"class","flex gap-2"),a(Qe,"class","input grow"),a(Qe,"id","title"),a(Ft,"class","btn"),a(Ft,"type","submit"),a(rt,"class","flex gap-1"),a(Ze,"class","input grow"),a(Ze,"id","url"),a(Nt,"class","btn"),a(Nt,"id","open-url"),a(at,"class","flex gap-1"),a(ot,"class","flex flex-col gap-1")},m(w,I){m(w,t,I),m(w,n,I),m(w,i,I),s(i,l),s(i,o),s(i,u),s(i,d),s(i,c),s(i,f),s(i,v),s(i,k),s(i,_),m(w,y,I),m(w,g,I),m(w,b,I),m(w,A,I),s(A,D),s(D,F),s(D,W),W.checked=e[3],s(A,j),s(A,S),s(S,C),s(S,T),T.checked=e[2],s(A,P),s(A,M),s(M,N),s(M,U),U.checked=e[4],s(A,J),s(A,Q),s(Q,he),s(Q,x),x.checked=e[5],s(A,ne),s(A,Y),s(Y,_e),s(Y,O),O.checked=e[6],m(w,$,I),m(w,ie,I),m(w,oe,I),m(w,Z,I),s(Z,pe),s(pe,re),s(re,be),s(re,ee),B(ee,e[13]),s(pe,ke),s(pe,Ae),s(Ae,R),s(Ae,q),B(q,e[14]),s(Z,We),s(Z,Le),s(Le,Me),s(Me,ae),s(Me,de),B(de,e[7]),s(Le,ue),s(Le,Se),s(Se,tt),s(Se,fe),B(fe,e[8]),s(Z,ce),s(Z,H),s(H,te),s(te,G),s(te,ge),B(ge,e[9]),s(H,Yt),s(H,ht),s(ht,$t),s(ht,Oe),B(Oe,e[10]),s(Z,Kt),s(Z,Ue),s(Ue,_t),s(_t,Qt),s(_t,X),B(X,e[11]),s(Ue,Pt),s(Ue,nt),s(nt,Wt),s(nt,De),B(De,e[12]),m(w,bt,I),m(w,gt,I),m(w,vt,I),m(w,Ee,I),s(Ee,Ie),s(Ie,Pe),s(Pe,it),s(Pe,Ot),s(Pe,lt),s(lt,Rt),s(lt,yt),s(Pe,It),s(Pe,wt),s(wt,Bi),s(wt,ii),s(Ie,Vi),s(Ie,qe),s(qe,xt),s(qe,Gi),s(qe,en),s(en,Ji),s(en,li),s(qe,Xi),s(qe,nn),s(nn,Yi),s(nn,si),s(Ee,$i),s(Ee,kt),s(kt,Be),s(Be,sn),s(Be,Ki),s(Be,on),s(on,Qi),s(on,oi),s(Be,Zi),s(Be,an),s(an,xi),s(an,ri),s(kt,el),s(kt,Ve),s(Ve,cn),s(Ve,tl),s(Ve,dn),s(dn,nl),s(dn,ai),s(Ve,il),s(Ve,pn),s(pn,ll),s(pn,ui),s(Ee,sl),s(Ee,Mt),s(Mt,Ge),s(Ge,hn),s(Ge,ol),s(Ge,_n),s(_n,rl),s(_n,ci),s(Ge,al),s(Ge,gn),s(gn,ul),s(gn,di),s(Mt,cl),s(Mt,Je),s(Je,yn),s(Je,dl),s(Je,wn),s(wn,fl),s(wn,fi),s(Je,pl),s(Je,Mn),s(Mn,ml),s(Mn,pi),s(Ee,hl),s(Ee,Ct),s(Ct,Xe),s(Xe,Tn),s(Xe,_l),s(Xe,An),s(An,bl),s(An,mi),s(Xe,gl),s(Xe,Sn),s(Sn,vl),s(Sn,hi),s(Ct,yl),s(Ct,Ye),s(Ye,zn),s(Ye,wl),s(Ye,Dn),s(Dn,kl),s(Dn,_i),s(Ye,Ml),s(Ye,Wn),s(Wn,Cl),s(Wn,bi),m(w,gi,I),m(w,vi,I),m(w,yi,I),m(w,Ht,I),m(w,wi,I),m(w,He,I),s(He,Rn),s(Rn,Tt),Tt.checked=e[15],s(Rn,Tl),s(He,Al),s(He,In),s(In,At),At.checked=e[16],s(In,Ll),s(He,Sl),s(He,Hn),s(Hn,Lt),Lt.checked=e[20],s(Hn,El),m(w,ki,I),m(w,Fe,I),s(Fe,Fn),s(Fn,zl),s(Fn,Ne);for(let ve=0;ve=1,v,k,_,y=f&&ts(e),g=e[1][e[0]]&&is(e);return{c(){t=r("div"),n=r("div"),i=r("input"),l=h(),o=r("button"),o.textContent="New window",u=h(),d=r("br"),c=h(),y&&y.c(),v=h(),g&&g.c(),a(i,"class","input grow"),a(i,"type","text"),a(i,"placeholder","New Window label.."),a(o,"class","btn"),a(n,"class","flex gap-1"),a(t,"class","flex flex-col children:grow gap-2")},m(b,A){m(b,t,A),s(t,n),s(n,i),B(i,e[21]),s(n,l),s(n,o),s(t,u),s(t,d),s(t,c),y&&y.m(t,null),s(t,v),g&&g.m(t,null),k||(_=[E(i,"input",e[38]),E(o,"click",e[35])],k=!0)},p(b,A){A[0]&2097152&&i.value!==b[21]&&B(i,b[21]),A[0]&2&&(f=Object.keys(b[1]).length>=1),f?y?y.p(b,A):(y=ts(b),y.c(),y.m(t,v)):y&&(y.d(1),y=null),b[1][b[0]]?g?g.p(b,A):(g=is(b),g.c(),g.m(t,null)):g&&(g.d(1),g=null)},i:V,o:V,d(b){b&&p(t),y&&y.d(),g&&g.d(),k=!1,se(_)}}}function Cr(e,t,n){let i=je.label;const l={[je.label]:je},o=["default","crosshair","hand","arrow","move","text","wait","help","progress","notAllowed","contextMenu","cell","verticalText","alias","copy","noDrop","grab","grabbing","allScroll","zoomIn","zoomOut","eResize","nResize","neResize","nwResize","sResize","seResize","swResize","wResize","ewResize","nsResize","neswResize","nwseResize","colResize","rowResize"];let{onMessage:u}=t,d,c="https://tauri.app",f=!0,v=!1,k=!0,_=!1,y=!1,g=null,b=null,A=null,D=null,F=null,W=null,j=null,S=null,C=1,T=new xe(j,S),P=new xe(j,S),M=new dt(g,b),N=new dt(g,b),U,J,Q=!1,he=!0,x=null,ne=null,Y="default",_e=!1,O="Awesome Tauri Example!";function $(){Oi(c)}function ie(){l[i].setTitle(O)}function oe(){l[i].hide(),setTimeout(l[i].show,2e3)}function Z(){l[i].minimize(),setTimeout(l[i].unminimize,2e3)}function pe(){Ni({multiple:!1}).then(X=>{typeof X=="string"&&l[i].setIcon(X)})}function re(){if(!d)return;const X=new mt(d);n(1,l[d]=X,l),X.once("tauri://error",function(){u("Error creating new webview")})}function be(){l[i].innerSize().then(X=>{n(26,M=X),n(7,g=M.width),n(8,b=M.height)}),l[i].outerSize().then(X=>{n(27,N=X)})}function ee(){l[i].innerPosition().then(X=>{n(24,T=X)}),l[i].outerPosition().then(X=>{n(25,P=X),n(13,j=P.x),n(14,S=P.y)})}async function ke(X){!X||(U&&U(),J&&J(),J=await X.listen("tauri://move",ee),U=await X.listen("tauri://resize",be))}async function Ae(){await l[i].minimize(),await l[i].requestUserAttention(Ii.Critical),await new Promise(X=>setTimeout(X,3e3)),await l[i].requestUserAttention(null)}function R(){d=this.value,n(21,d)}function q(){i=Ei(this),n(0,i),n(1,l)}const We=()=>l[i].center();function Le(){v=this.checked,n(3,v)}function Me(){f=this.checked,n(2,f)}function ae(){k=this.checked,n(4,k)}function de(){_=this.checked,n(5,_)}function ue(){y=this.checked,n(6,y)}function Se(){j=le(this.value),n(13,j)}function tt(){S=le(this.value),n(14,S)}function fe(){g=le(this.value),n(7,g)}function ce(){b=le(this.value),n(8,b)}function H(){A=le(this.value),n(9,A)}function te(){D=le(this.value),n(10,D)}function G(){F=le(this.value),n(11,F)}function ge(){W=le(this.value),n(12,W)}function Yt(){Q=this.checked,n(15,Q)}function ht(){he=this.checked,n(16,he)}function $t(){_e=this.checked,n(20,_e)}function Oe(){Y=Ei(this),n(19,Y),n(29,o)}function Kt(){x=le(this.value),n(17,x)}function Ue(){ne=le(this.value),n(18,ne)}function _t(){O=this.value,n(28,O)}function Qt(){c=this.value,n(22,c)}return e.$$set=X=>{"onMessage"in X&&n(37,u=X.onMessage)},e.$$.update=()=>{var X,Pt,nt,Wt,De,bt,gt,vt,Ee,Ie,Pe,it,Ot,lt,Rt,st,yt,It;e.$$.dirty[0]&3&&(l[i],ee(),be()),e.$$.dirty[0]&7&&((X=l[i])==null||X.setResizable(f)),e.$$.dirty[0]&11&&(v?(Pt=l[i])==null||Pt.maximize():(nt=l[i])==null||nt.unmaximize()),e.$$.dirty[0]&19&&((Wt=l[i])==null||Wt.setDecorations(k)),e.$$.dirty[0]&35&&((De=l[i])==null||De.setAlwaysOnTop(_)),e.$$.dirty[0]&67&&((bt=l[i])==null||bt.setFullscreen(y)),e.$$.dirty[0]&387&&g&&b&&((gt=l[i])==null||gt.setSize(new dt(g,b))),e.$$.dirty[0]&1539&&(A&&D?(vt=l[i])==null||vt.setMinSize(new Qn(A,D)):(Ee=l[i])==null||Ee.setMinSize(null)),e.$$.dirty[0]&6147&&(F>800&&W>400?(Ie=l[i])==null||Ie.setMaxSize(new Qn(F,W)):(Pe=l[i])==null||Pe.setMaxSize(null)),e.$$.dirty[0]&24579&&j!==null&&S!==null&&((it=l[i])==null||it.setPosition(new xe(j,S))),e.$$.dirty[0]&3&&((Ot=l[i])==null||Ot.scaleFactor().then(wt=>n(23,C=wt))),e.$$.dirty[0]&3&&ke(l[i]),e.$$.dirty[0]&32771&&((lt=l[i])==null||lt.setCursorGrab(Q)),e.$$.dirty[0]&65539&&((Rt=l[i])==null||Rt.setCursorVisible(he)),e.$$.dirty[0]&524291&&((st=l[i])==null||st.setCursorIcon(Y)),e.$$.dirty[0]&393219&&x!==null&&ne!==null&&((yt=l[i])==null||yt.setCursorPosition(new xe(x,ne))),e.$$.dirty[0]&1048579&&((It=l[i])==null||It.setIgnoreCursorEvents(_e))},[i,l,f,v,k,_,y,g,b,A,D,F,W,j,S,Q,he,x,ne,Y,_e,d,c,C,T,P,M,N,O,o,$,ie,oe,Z,pe,re,Ae,u,R,q,We,Le,Me,ae,de,ue,Se,tt,fe,ce,H,te,G,ge,Yt,ht,$t,Oe,Kt,Ue,_t,Qt]}class Tr extends we{constructor(t){super(),ye(this,t,Cr,Mr,me,{onMessage:37},null,[-1,-1,-1])}}var Ar={};Te(Ar,{isRegistered:()=>Sr,register:()=>Ys,registerAll:()=>Lr,unregister:()=>$s,unregisterAll:()=>Ks});async function Ys(e,t){return L({__tauriModule:"GlobalShortcut",message:{cmd:"register",shortcut:e,handler:pt(t)}})}async function Lr(e,t){return L({__tauriModule:"GlobalShortcut",message:{cmd:"registerAll",shortcuts:e,handler:pt(t)}})}async function Sr(e){return L({__tauriModule:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:e}})}async function $s(e){return L({__tauriModule:"GlobalShortcut",message:{cmd:"unregister",shortcut:e}})}async function Ks(){return L({__tauriModule:"GlobalShortcut",message:{cmd:"unregisterAll"}})}function ss(e,t,n){const i=e.slice();return i[9]=t[n],i}function os(e){let t,n=e[9]+"",i,l,o,u,d;function c(){return e[8](e[9])}return{c(){t=r("div"),i=z(n),l=h(),o=r("button"),o.textContent="Unregister",a(o,"class","btn"),a(o,"type","button"),a(t,"class","flex justify-between")},m(f,v){m(f,t,v),s(t,i),s(t,l),s(t,o),u||(d=E(o,"click",c),u=!0)},p(f,v){e=f,v&2&&n!==(n=e[9]+"")&&K(i,n)},d(f){f&&p(t),u=!1,d()}}}function rs(e){let t,n,i,l,o;return{c(){t=r("br"),n=h(),i=r("button"),i.textContent="Unregister all",a(i,"class","btn"),a(i,"type","button")},m(u,d){m(u,t,d),m(u,n,d),m(u,i,d),l||(o=E(i,"click",e[5]),l=!0)},p:V,d(u){u&&p(t),u&&p(n),u&&p(i),l=!1,o()}}}function Er(e){let t,n,i,l,o,u,d,c,f,v,k,_=e[1],y=[];for(let b=0;b<_.length;b+=1)y[b]=os(ss(e,_,b));let g=e[1].length>1&&rs(e);return{c(){t=r("div"),n=r("input"),i=h(),l=r("button"),l.textContent="Register",o=h(),u=r("br"),d=h(),c=r("div");for(let b=0;b1?g?g.p(b,A):(g=rs(b),g.c(),g.m(c,null)):g&&(g.d(1),g=null)},i:V,o:V,d(b){b&&p(t),b&&p(o),b&&p(u),b&&p(d),b&&p(c),ft(y,b),g&&g.d(),v=!1,se(k)}}}function zr(e,t,n){let i,{onMessage:l}=t;const o=ws([]);gs(e,o,_=>n(1,i=_));let u="CmdOrControl+X";function d(){const _=u;Ys(_,()=>{l(`Shortcut ${_} triggered`)}).then(()=>{o.update(y=>[...y,_]),l(`Shortcut ${_} registered successfully`)}).catch(l)}function c(_){const y=_;$s(y).then(()=>{o.update(g=>g.filter(b=>b!==y)),l(`Shortcut ${y} unregistered`)}).catch(l)}function f(){Ks().then(()=>{o.update(()=>[]),l("Unregistered all shortcuts")}).catch(l)}function v(){u=this.value,n(0,u)}const k=_=>c(_);return e.$$set=_=>{"onMessage"in _&&n(6,l=_.onMessage)},[u,i,o,d,c,f,l,v,k]}class Dr extends we{constructor(t){super(),ye(this,t,zr,Er,me,{onMessage:6})}}function as(e){let t,n,i,l,o,u,d;return{c(){t=r("br"),n=h(),i=r("input"),l=h(),o=r("button"),o.textContent="Write",a(i,"class","input"),a(i,"placeholder","write to stdin"),a(o,"class","btn")},m(c,f){m(c,t,f),m(c,n,f),m(c,i,f),B(i,e[4]),m(c,l,f),m(c,o,f),u||(d=[E(i,"input",e[14]),E(o,"click",e[8])],u=!0)},p(c,f){f&16&&i.value!==c[4]&&B(i,c[4])},d(c){c&&p(t),c&&p(n),c&&p(i),c&&p(l),c&&p(o),u=!1,se(d)}}}function Pr(e){let t,n,i,l,o,u,d,c,f,v,k,_,y,g,b,A,D,F,W,j,S,C,T,P,M=e[5]&&as(e);return{c(){t=r("div"),n=r("div"),i=z(`Script: + Additionally, it has a update --background subcommand.`,n=h(),i=r("br"),l=h(),o=r("div"),o.textContent="Note that the arguments are only parsed, not implemented.",u=h(),d=r("br"),c=h(),f=r("br"),g=h(),k=r("button"),k.textContent="Get matches",a(o,"class","note"),a(k,"class","btn"),a(k,"id","cli-matches")},m(v,b){m(v,t,b),m(v,n,b),m(v,i,b),m(v,l,b),m(v,o,b),m(v,u,b),m(v,d,b),m(v,c,b),m(v,f,b),m(v,g,b),m(v,k,b),_||(y=S(k,"click",e[0]),_=!0)},p:G,i:G,o:G,d(v){v&&p(t),v&&p(n),v&&p(i),v&&p(l),v&&p(o),v&&p(u),v&&p(d),v&&p(c),v&&p(f),v&&p(g),v&&p(k),_=!1,y()}}}function qo(e,t,n){let{onMessage:i}=t;function l(){Gs().then(i).catch(i)}return e.$$set=o=>{"onMessage"in o&&n(1,i=o.onMessage)},[l,i]}class Bo extends ve{constructor(t){super(),ge(this,t,qo,Uo,pe,{onMessage:1})}}function Vo(e){let t,n,i,l,o,u,d,c;return{c(){t=r("div"),n=r("button"),n.textContent="Call Log API",i=h(),l=r("button"),l.textContent="Call Request (async) API",o=h(),u=r("button"),u.textContent="Send event to Rust",a(n,"class","btn"),a(n,"id","log"),a(l,"class","btn"),a(l,"id","request"),a(u,"class","btn"),a(u,"id","event")},m(f,g){m(f,t,g),s(t,n),s(t,i),s(t,l),s(t,o),s(t,u),d||(c=[S(n,"click",e[0]),S(l,"click",e[1]),S(u,"click",e[2])],d=!0)},p:G,i:G,o:G,d(f){f&&p(t),d=!1,re(c)}}}function Go(e,t,n){let{onMessage:i}=t,l;ft(async()=>{l=await Kt("rust-event",i)}),Ii(()=>{l&&l()});function o(){ei("log_operation",{event:"tauri-click",payload:"this payload is optional because we used Option in Rust"})}function u(){ei("perform_request",{endpoint:"dummy endpoint arg",body:{id:5,name:"test"}}).then(i).catch(i)}function d(){oi("js-event","this is the payload string")}return e.$$set=c=>{"onMessage"in c&&n(3,i=c.onMessage)},[o,u,d,i]}class Jo extends ve{constructor(t){super(),ge(this,t,Go,Vo,pe,{onMessage:3})}}var Xo={};ke(Xo,{ask:()=>Xs,confirm:()=>Ko,message:()=>Yo,open:()=>Bi,save:()=>Js});async function Bi(e={}){return typeof e=="object"&&Object.freeze(e),A({__tauriModule:"Dialog",message:{cmd:"openDialog",options:e}})}async function Js(e={}){return typeof e=="object"&&Object.freeze(e),A({__tauriModule:"Dialog",message:{cmd:"saveDialog",options:e}})}async function Yo(e,t){var i,l;let n=typeof t=="string"?{title:t}:t;return A({__tauriModule:"Dialog",message:{cmd:"messageDialog",message:e.toString(),title:(i=n==null?void 0:n.title)==null?void 0:i.toString(),type:n==null?void 0:n.type,buttonLabel:(l=n==null?void 0:n.okLabel)==null?void 0:l.toString()}})}async function Xs(e,t){var i,l,o,u,d;let n=typeof t=="string"?{title:t}:t;return A({__tauriModule:"Dialog",message:{cmd:"askDialog",message:e.toString(),title:(i=n==null?void 0:n.title)==null?void 0:i.toString(),type:n==null?void 0:n.type,buttonLabels:[(o=(l=n==null?void 0:n.okLabel)==null?void 0:l.toString())!=null?o:"Yes",(d=(u=n==null?void 0:n.cancelLabel)==null?void 0:u.toString())!=null?d:"No"]}})}async function Ko(e,t){var i,l,o,u,d;let n=typeof t=="string"?{title:t}:t;return A({__tauriModule:"Dialog",message:{cmd:"confirmDialog",message:e.toString(),title:(i=n==null?void 0:n.title)==null?void 0:i.toString(),type:n==null?void 0:n.type,buttonLabels:[(o=(l=n==null?void 0:n.okLabel)==null?void 0:l.toString())!=null?o:"Ok",(d=(u=n==null?void 0:n.cancelLabel)==null?void 0:u.toString())!=null?d:"Cancel"]}})}var Qo={};ke(Qo,{BaseDirectory:()=>Yt,Dir:()=>Yt,copyFile:()=>tr,createDir:()=>xo,exists:()=>lr,readBinaryFile:()=>Vi,readDir:()=>Ys,readTextFile:()=>Zo,removeDir:()=>er,removeFile:()=>nr,renameFile:()=>ir,writeBinaryFile:()=>$o,writeFile:()=>Ri,writeTextFile:()=>Ri});var Yt=(e=>(e[e.Audio=1]="Audio",e[e.Cache=2]="Cache",e[e.Config=3]="Config",e[e.Data=4]="Data",e[e.LocalData=5]="LocalData",e[e.Desktop=6]="Desktop",e[e.Document=7]="Document",e[e.Download=8]="Download",e[e.Executable=9]="Executable",e[e.Font=10]="Font",e[e.Home=11]="Home",e[e.Picture=12]="Picture",e[e.Public=13]="Public",e[e.Runtime=14]="Runtime",e[e.Template=15]="Template",e[e.Video=16]="Video",e[e.Resource=17]="Resource",e[e.App=18]="App",e[e.Log=19]="Log",e[e.Temp=20]="Temp",e[e.AppConfig=21]="AppConfig",e[e.AppData=22]="AppData",e[e.AppLocalData=23]="AppLocalData",e[e.AppCache=24]="AppCache",e[e.AppLog=25]="AppLog",e))(Yt||{});async function Zo(e,t={}){return A({__tauriModule:"Fs",message:{cmd:"readTextFile",path:e,options:t}})}async function Vi(e,t={}){let n=await A({__tauriModule:"Fs",message:{cmd:"readFile",path:e,options:t}});return Uint8Array.from(n)}async function Ri(e,t,n){typeof n=="object"&&Object.freeze(n),typeof e=="object"&&Object.freeze(e);let i={path:"",contents:""},l=n;return typeof e=="string"?i.path=e:(i.path=e.path,i.contents=e.contents),typeof t=="string"?i.contents=t!=null?t:"":l=t,A({__tauriModule:"Fs",message:{cmd:"writeFile",path:i.path,contents:Array.from(new TextEncoder().encode(i.contents)),options:l}})}async function $o(e,t,n){typeof n=="object"&&Object.freeze(n),typeof e=="object"&&Object.freeze(e);let i={path:"",contents:[]},l=n;return typeof e=="string"?i.path=e:(i.path=e.path,i.contents=e.contents),t&&"dir"in t?l=t:typeof e=="string"&&(i.contents=t!=null?t:[]),A({__tauriModule:"Fs",message:{cmd:"writeFile",path:i.path,contents:Array.from(i.contents instanceof ArrayBuffer?new Uint8Array(i.contents):i.contents),options:l}})}async function Ys(e,t={}){return A({__tauriModule:"Fs",message:{cmd:"readDir",path:e,options:t}})}async function xo(e,t={}){return A({__tauriModule:"Fs",message:{cmd:"createDir",path:e,options:t}})}async function er(e,t={}){return A({__tauriModule:"Fs",message:{cmd:"removeDir",path:e,options:t}})}async function tr(e,t,n={}){return A({__tauriModule:"Fs",message:{cmd:"copyFile",source:e,destination:t,options:n}})}async function nr(e,t={}){return A({__tauriModule:"Fs",message:{cmd:"removeFile",path:e,options:t}})}async function ir(e,t,n={}){return A({__tauriModule:"Fs",message:{cmd:"renameFile",oldPath:e,newPath:t,options:n}})}async function lr(e,t={}){return A({__tauriModule:"Fs",message:{cmd:"exists",path:e,options:t}})}function sr(e){let t,n,i,l,o,u,d,c,f,g,k,_,y,v,b,L,D,H,W,j,E,M,T,P;return{c(){t=r("div"),n=r("input"),i=h(),l=r("input"),o=h(),u=r("br"),d=h(),c=r("div"),f=r("input"),g=h(),k=r("label"),k.textContent="Multiple",_=h(),y=r("div"),v=r("input"),b=h(),L=r("label"),L.textContent="Directory",D=h(),H=r("br"),W=h(),j=r("button"),j.textContent="Open dialog",E=h(),M=r("button"),M.textContent="Open save dialog",a(n,"class","input"),a(n,"id","dialog-default-path"),a(n,"placeholder","Default path"),a(l,"class","input"),a(l,"id","dialog-filter"),a(l,"placeholder","Extensions filter, comma-separated"),a(t,"class","flex gap-2 children:grow"),a(f,"type","checkbox"),a(f,"id","dialog-multiple"),a(k,"for","dialog-multiple"),a(v,"type","checkbox"),a(v,"id","dialog-directory"),a(L,"for","dialog-directory"),a(j,"class","btn"),a(j,"id","open-dialog"),a(M,"class","btn"),a(M,"id","save-dialog")},m(C,F){m(C,t,F),s(t,n),B(n,e[0]),s(t,i),s(t,l),B(l,e[1]),m(C,o,F),m(C,u,F),m(C,d,F),m(C,c,F),s(c,f),f.checked=e[2],s(c,g),s(c,k),m(C,_,F),m(C,y,F),s(y,v),v.checked=e[3],s(y,b),s(y,L),m(C,D,F),m(C,H,F),m(C,W,F),m(C,j,F),m(C,E,F),m(C,M,F),T||(P=[S(n,"input",e[8]),S(l,"input",e[9]),S(f,"change",e[10]),S(v,"change",e[11]),S(j,"click",e[4]),S(M,"click",e[5])],T=!0)},p(C,[F]){F&1&&n.value!==C[0]&&B(n,C[0]),F&2&&l.value!==C[1]&&B(l,C[1]),F&4&&(f.checked=C[2]),F&8&&(v.checked=C[3])},i:G,o:G,d(C){C&&p(t),C&&p(o),C&&p(u),C&&p(d),C&&p(c),C&&p(_),C&&p(y),C&&p(D),C&&p(H),C&&p(W),C&&p(j),C&&p(E),C&&p(M),T=!1,re(P)}}}function or(e,t){var n=new Blob([e],{type:"application/octet-binary"}),i=new FileReader;i.onload=function(l){var o=l.target.result;t(o.substr(o.indexOf(",")+1))},i.readAsDataURL(n)}function rr(e,t,n){let{onMessage:i}=t,{insecureRenderHtml:l}=t,o=null,u=null,d=!1,c=!1;function f(){Bi({title:"My wonderful open dialog",defaultPath:o,filters:u?[{name:"Tauri Example",extensions:u.split(",").map(b=>b.trim())}]:[],multiple:d,directory:c}).then(function(b){if(Array.isArray(b))i(b);else{var L=b,D=L.match(/\S+\.\S+$/g);Vi(L).then(function(H){D&&(L.includes(".png")||L.includes(".jpg"))?or(new Uint8Array(H),function(W){var j="data:image/png;base64,"+W;l('')}):i(b)}).catch(i(b))}}).catch(i)}function g(){Js({title:"My wonderful save dialog",defaultPath:o,filters:u?[{name:"Tauri Example",extensions:u.split(",").map(b=>b.trim())}]:[]}).then(i).catch(i)}function k(){o=this.value,n(0,o)}function _(){u=this.value,n(1,u)}function y(){d=this.checked,n(2,d)}function v(){c=this.checked,n(3,c)}return e.$$set=b=>{"onMessage"in b&&n(6,i=b.onMessage),"insecureRenderHtml"in b&&n(7,l=b.insecureRenderHtml)},[o,u,d,c,f,g,i,l,k,_,y,v]}class ar extends ve{constructor(t){super(),ge(this,t,rr,sr,pe,{onMessage:6,insecureRenderHtml:7})}}function Xl(e,t,n){const i=e.slice();return i[9]=t[n],i}function Yl(e){let t,n=e[9][0]+"",i,l;return{c(){t=r("option"),i=z(n),t.__value=l=e[9][1],t.value=t.__value},m(o,u){m(o,t,u),s(t,i)},p:G,d(o){o&&p(t)}}}function ur(e){let t,n,i,l,o,u,d,c,f,g,k,_,y,v,b,L,D,H,W,j=e[2],E=[];for(let M=0;MisNaN(parseInt(_))).map(_=>[_,Yt[_]]);function c(){const _=o.match(/\S+\.\S+$/g),y={dir:Kl()};(_?Vi(o,y):Ys(o,y)).then(function(b){if(_)if(o.includes(".png")||o.includes(".jpg"))cr(new Uint8Array(b),function(L){const D="data:image/png;base64,"+L;l('')});else{const L=String.fromCharCode.apply(null,b);l(''),setTimeout(()=>{const D=document.getElementById("file-response");D.value=L,document.getElementById("file-save").addEventListener("click",function(){Ri(o,D.value,{dir:Kl()}).catch(i)})})}else i(b)}).catch(i)}function f(){n(1,u.src=Ls(o),u)}function g(){o=this.value,n(0,o)}function k(_){$n[_?"unshift":"push"](()=>{u=_,n(1,u)})}return e.$$set=_=>{"onMessage"in _&&n(5,i=_.onMessage),"insecureRenderHtml"in _&&n(6,l=_.insecureRenderHtml)},[o,u,d,c,f,i,l,g,k]}class fr extends ve{constructor(t){super(),ge(this,t,dr,ur,pe,{onMessage:5,insecureRenderHtml:6})}}var pr={};ke(pr,{Body:()=>it,Client:()=>Qs,Response:()=>Ks,ResponseType:()=>Gi,fetch:()=>mr,getClient:()=>ni});var Gi=(e=>(e[e.JSON=1]="JSON",e[e.Text=2]="Text",e[e.Binary=3]="Binary",e))(Gi||{}),it=class{constructor(e,t){this.type=e,this.payload=t}static form(e){let t={},n=(i,l)=>{if(l!==null){let o;typeof l=="string"?o=l:l instanceof Uint8Array||Array.isArray(l)?o=Array.from(l):l instanceof File?o={file:l.name,mime:l.type,fileName:l.name}:typeof l.file=="string"?o={file:l.file,mime:l.mime,fileName:l.fileName}:o={file:Array.from(l.file),mime:l.mime,fileName:l.fileName},t[String(i)]=o}};if(e instanceof FormData)for(let[i,l]of e)n(i,l);else for(let[i,l]of Object.entries(e))n(i,l);return new it("Form",t)}static json(e){return new it("Json",e)}static text(e){return new it("Text",e)}static bytes(e){return new it("Bytes",Array.from(e instanceof ArrayBuffer?new Uint8Array(e):e))}},Ks=class{constructor(e){this.url=e.url,this.status=e.status,this.ok=this.status>=200&&this.status<300,this.headers=e.headers,this.rawHeaders=e.rawHeaders,this.data=e.data}},Qs=class{constructor(e){this.id=e}async drop(){return A({__tauriModule:"Http",message:{cmd:"dropClient",client:this.id}})}async request(e){let t=!e.responseType||e.responseType===1;return t&&(e.responseType=2),A({__tauriModule:"Http",message:{cmd:"httpRequest",client:this.id,options:e}}).then(n=>{let i=new Ks(n);if(t){try{i.data=JSON.parse(i.data)}catch(l){if(i.ok&&i.data==="")i.data={};else if(i.ok)throw Error(`Failed to parse response \`${i.data}\` as JSON: ${l}; + try setting the \`responseType\` option to \`ResponseType.Text\` or \`ResponseType.Binary\` if the API does not return a JSON response.`)}return i}return i})}async get(e,t){return this.request({method:"GET",url:e,...t})}async post(e,t,n){return this.request({method:"POST",url:e,body:t,...n})}async put(e,t,n){return this.request({method:"PUT",url:e,body:t,...n})}async patch(e,t){return this.request({method:"PATCH",url:e,...t})}async delete(e,t){return this.request({method:"DELETE",url:e,...t})}};async function ni(e){return A({__tauriModule:"Http",message:{cmd:"createClient",options:e}}).then(t=>new Qs(t))}var Pi=null;async function mr(e,t){var n;return Pi===null&&(Pi=await ni()),Pi.request({url:e,method:(n=t==null?void 0:t.method)!=null?n:"GET",...t})}function Ql(e,t,n){const i=e.slice();return i[12]=t[n],i[14]=n,i}function Zl(e){let t,n,i,l,o,u,d,c,f,g,k,_,y,v,b,L,D,H=e[5],W=[];for(let T=0;THe(W[T],1,1,()=>{W[T]=null});let E=!e[3]&&ts(),M=!e[3]&&e[8]&&ns();return{c(){t=r("span"),n=r("span"),i=z(e[6]),l=h(),o=r("ul");for(let T=0;T{g[v]=null}),si(),o=g[l],o?o.p(_,y):(o=g[l]=f[l](_),o.c()),Ae(o,1),o.m(t,u))},i(_){d||(Ae(o),d=!0)},o(_){He(o),d=!1},d(_){_&&p(t),c&&c.d(),g[l].d()}}}function ts(e){let t;return{c(){t=r("span"),t.textContent=",",a(t,"class","comma svelte-gbh3pt")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function ns(e){let t;return{c(){t=r("span"),t.textContent=",",a(t,"class","comma svelte-gbh3pt")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function br(e){let t,n,i=e[5].length&&Zl(e);return{c(){i&&i.c(),t=ii()},m(l,o){i&&i.m(l,o),m(l,t,o),n=!0},p(l,[o]){l[5].length?i?(i.p(l,o),o&32&&Ae(i,1)):(i=Zl(l),i.c(),Ae(i,1),i.m(t.parentNode,t)):i&&(li(),He(i,1,1,()=>{i=null}),si())},i(l){n||(Ae(i),n=!0)},o(l){He(i),n=!1},d(l){i&&i.d(l),l&&p(t)}}}const gr="...";function vr(e,t,n){let{json:i}=t,{depth:l=1/0}=t,{_lvl:o=0}=t,{_last:u=!0}=t;const d=b=>b===null?"null":typeof b;let c,f,g,k,_;const y=b=>{switch(d(b)){case"string":return`"${b}"`;case"function":return"f () {...}";case"symbol":return b.toString();default:return b}},v=()=>{n(8,_=!_)};return e.$$set=b=>{"json"in b&&n(0,i=b.json),"depth"in b&&n(1,l=b.depth),"_lvl"in b&&n(2,o=b._lvl),"_last"in b&&n(3,u=b._last)},e.$$.update=()=>{e.$$.dirty&17&&(n(5,c=d(i)==="object"?Object.keys(i):[]),n(4,f=Array.isArray(i)),n(6,g=f?"[":"{"),n(7,k=f?"]":"}")),e.$$.dirty&6&&n(8,_=le[9].call(n)),a(k,"class","input h-auto w-100%"),a(k,"id","request-body"),a(k,"placeholder","Request body"),a(k,"rows","5"),a(b,"class","btn"),a(b,"id","make-request"),a(M,"class","input"),a(P,"class","input"),a(E,"class","flex gap-2 children:grow"),a(x,"type","checkbox"),a(X,"class","btn"),a(X,"type","button")},m(R,q){m(R,t,q),s(t,n),s(n,i),s(n,l),s(n,o),s(n,u),s(n,d),Pt(n,e[0]),s(t,c),s(t,f),s(t,g),s(t,k),B(k,e[1]),s(t,_),s(t,y),s(t,v),s(t,b),m(R,L,q),m(R,D,q),m(R,H,q),m(R,W,q),m(R,j,q),m(R,E,q),s(E,M),B(M,e[2]),s(E,T),s(E,P),B(P,e[3]),m(R,C,q),m(R,F,q),m(R,U,q),m(R,J,q),s(J,x),x.checked=e[5],s(J,me),m(R,te,q),m(R,ie,q),m(R,Y,q),m(R,he,q),m(R,O,q),m(R,X,q),m(R,ne,q),m(R,ce,q),m(R,ae,q),m(R,ye,q),m(R,de,q),Jt(_e,R,q),$=!0,le||(Me=[S(n,"change",e[9]),S(k,"input",e[10]),S(t,"submit",Zn(e[6])),S(M,"input",e[11]),S(P,"input",e[12]),S(x,"change",e[13]),S(X,"click",e[7])],le=!0)},p(R,[q]){q&1&&Pt(n,R[0]),q&2&&B(k,R[1]),q&4&&M.value!==R[2]&&B(M,R[2]),q&8&&P.value!==R[3]&&B(P,R[3]),q&32&&(x.checked=R[5]);const We={};q&16&&(We.json=R[4]),_e.$set(We)},i(R){$||(Ae(_e.$$.fragment,R),$=!0)},o(R){He(_e.$$.fragment,R),$=!1},d(R){R&&p(t),R&&p(L),R&&p(D),R&&p(H),R&&p(W),R&&p(j),R&&p(E),R&&p(C),R&&p(F),R&&p(U),R&&p(J),R&&p(te),R&&p(ie),R&&p(Y),R&&p(he),R&&p(O),R&&p(X),R&&p(ne),R&&p(ce),R&&p(ae),R&&p(ye),R&&p(de),Xt(_e,R),le=!1,re(Me)}}}function wr(e,t,n){let i="GET",l="",{onMessage:o}=t;async function u(){const D=await ni().catch(j=>{throw o(j),j}),W={url:"http://localhost:3003",method:i||"GET"||"GET"};l.startsWith("{")&&l.endsWith("}")||l.startsWith("[")&&l.endsWith("]")?W.body=it.json(JSON.parse(l)):l!==""&&(W.body=it.text(l)),D.request(W).then(o).catch(o)}let d="baz",c="qux",f=null,g=!0;async function k(){const D=await ni().catch(H=>{throw o(H),H});n(4,f=await D.request({url:"http://localhost:3003",method:"POST",body:it.form({foo:d,bar:c}),headers:g?{"Content-Type":"multipart/form-data"}:void 0,responseType:Gi.Text}))}function _(){i=Wi(this),n(0,i)}function y(){l=this.value,n(1,l)}function v(){d=this.value,n(2,d)}function b(){c=this.value,n(3,c)}function L(){g=this.checked,n(5,g)}return e.$$set=D=>{"onMessage"in D&&n(8,o=D.onMessage)},[i,l,d,c,f,g,u,k,o,_,y,v,b,L]}class kr extends ve{constructor(t){super(),ge(this,t,wr,yr,pe,{onMessage:8})}}function Mr(e){let t,n,i;return{c(){t=r("button"),t.textContent="Send test notification",a(t,"class","btn"),a(t,"id","notification")},m(l,o){m(l,t,o),n||(i=S(t,"click",Cr),n=!0)},p:G,i:G,o:G,d(l){l&&p(t),n=!1,i()}}}function Cr(){new Notification("Notification title",{body:"This is the notification body"})}function Tr(e,t,n){let{onMessage:i}=t;return e.$$set=l=>{"onMessage"in l&&n(0,i=l.onMessage)},[i]}class Lr extends ve{constructor(t){super(),ge(this,t,Tr,Mr,pe,{onMessage:0})}}function is(e,t,n){const i=e.slice();return i[69]=t[n],i}function ls(e,t,n){const i=e.slice();return i[72]=t[n],i}function ss(e){let t,n,i,l,o,u,d=Object.keys(e[1]),c=[];for(let f=0;fe[40].call(i))},m(f,g){m(f,t,g),m(f,n,g),m(f,i,g),s(i,l);for(let k=0;ke[59].call(Ue)),a($e,"class","input"),a($e,"type","number"),a(xe,"class","input"),a(xe,"type","number"),a(je,"class","flex gap-2"),a(et,"class","input grow"),a(et,"id","title"),a(jt,"class","btn"),a(jt,"type","submit"),a(ct,"class","flex gap-1"),a(tt,"class","input grow"),a(tt,"id","url"),a(Ut,"class","btn"),a(Ut,"id","open-url"),a(dt,"class","flex gap-1"),a(ut,"class","flex flex-col gap-1")},m(w,I){m(w,t,I),m(w,n,I),m(w,i,I),s(i,l),s(i,o),s(i,u),s(i,d),s(i,c),s(i,f),s(i,g),s(i,k),s(i,_),m(w,y,I),m(w,v,I),m(w,b,I),m(w,L,I),s(L,D),s(D,H),s(D,W),W.checked=e[3],s(L,j),s(L,E),s(E,M),s(E,T),T.checked=e[2],s(L,P),s(L,C),s(C,F),s(C,U),U.checked=e[4],s(L,J),s(L,x),s(x,me),s(x,te),te.checked=e[5],s(L,ie),s(L,Y),s(Y,he),s(Y,O),O.checked=e[6],s(L,X),s(L,ne),s(ne,ce),s(ne,ae),ae.checked=e[7],m(w,ye,I),m(w,de,I),m(w,_e,I),m(w,$,I),s($,le),s(le,Me),s(Me,R),s(Me,q),B(q,e[14]),s(le,We),s(le,ze),s(ze,Ce),s(ze,Z),B(Z,e[15]),s($,De),s($,ee),s(ee,Te),s(Te,lt),s(Te,fe),B(fe,e[8]),s(ee,ue),s(ee,N),s(N,se),s(N,V),B(V,e[9]),s($,Oe),s($,Be),s(Be,gt),s(gt,Qt),s(gt,Re),B(Re,e[10]),s(Be,Zt),s(Be,vt),s(vt,$t),s(vt,Ie),B(Ie,e[11]),s($,xt),s($,Ve),s(Ve,K),s(K,Ot),s(K,Se),B(Se,e[12]),s(Ve,Rt),s(Ve,st),s(st,It),s(st,Ee),B(Ee,e[13]),m(w,yt,I),m(w,wt,I),m(w,kt,I),m(w,Le,I),s(Le,Fe),s(Fe,Pe),s(Pe,ot),s(Pe,Ht),s(Pe,rt),s(rt,Ft),s(rt,Mt),s(Pe,en),s(Pe,tn),s(tn,Xi),s(tn,ri),s(Fe,Yi),s(Fe,Ge),s(Ge,ln),s(Ge,Ki),s(Ge,sn),s(sn,Qi),s(sn,ai),s(Ge,Zi),s(Ge,rn),s(rn,$i),s(rn,ui),s(Le,xi),s(Le,Ct),s(Ct,Je),s(Je,un),s(Je,el),s(Je,cn),s(cn,tl),s(cn,ci),s(Je,nl),s(Je,fn),s(fn,il),s(fn,di),s(Ct,ll),s(Ct,Xe),s(Xe,mn),s(Xe,sl),s(Xe,hn),s(hn,ol),s(hn,fi),s(Xe,rl),s(Xe,bn),s(bn,al),s(bn,pi),s(Le,ul),s(Le,Tt),s(Tt,Ye),s(Ye,vn),s(Ye,cl),s(Ye,yn),s(yn,dl),s(yn,mi),s(Ye,fl),s(Ye,kn),s(kn,pl),s(kn,hi),s(Tt,ml),s(Tt,Ke),s(Ke,Cn),s(Ke,hl),s(Ke,Tn),s(Tn,_l),s(Tn,_i),s(Ke,bl),s(Ke,An),s(An,gl),s(An,bi),s(Le,vl),s(Le,Lt),s(Lt,Qe),s(Qe,En),s(Qe,yl),s(Qe,zn),s(zn,wl),s(zn,gi),s(Qe,kl),s(Qe,Pn),s(Pn,Ml),s(Pn,vi),s(Lt,Cl),s(Lt,Ze),s(Ze,On),s(Ze,Tl),s(Ze,Rn),s(Rn,Ll),s(Rn,yi),s(Ze,Al),s(Ze,Hn),s(Hn,Sl),s(Hn,wi),m(w,ki,I),m(w,Mi,I),m(w,Ci,I),m(w,Nt,I),m(w,Ti,I),m(w,Ne,I),s(Ne,Nn),s(Nn,At),At.checked=e[16],s(Nn,El),s(Ne,zl),s(Ne,jn),s(jn,St),St.checked=e[17],s(jn,Dl),s(Ne,Pl),s(Ne,Un),s(Un,Et),Et.checked=e[21],s(Un,Wl),m(w,Li,I),m(w,je,I),s(je,qn),s(qn,Ol),s(qn,Ue);for(let be=0;be=1,g,k,_,y=f&&ss(e),v=e[1][e[0]]&&rs(e);return{c(){t=r("div"),n=r("div"),i=r("input"),l=h(),o=r("button"),o.textContent="New window",u=h(),d=r("br"),c=h(),y&&y.c(),g=h(),v&&v.c(),a(i,"class","input grow"),a(i,"type","text"),a(i,"placeholder","New Window label.."),a(o,"class","btn"),a(n,"class","flex gap-1"),a(t,"class","flex flex-col children:grow gap-2")},m(b,L){m(b,t,L),s(t,n),s(n,i),B(i,e[22]),s(n,l),s(n,o),s(t,u),s(t,d),s(t,c),y&&y.m(t,null),s(t,g),v&&v.m(t,null),k||(_=[S(i,"input",e[39]),S(o,"click",e[36])],k=!0)},p(b,L){L[0]&4194304&&i.value!==b[22]&&B(i,b[22]),L[0]&2&&(f=Object.keys(b[1]).length>=1),f?y?y.p(b,L):(y=ss(b),y.c(),y.m(t,g)):y&&(y.d(1),y=null),b[1][b[0]]?v?v.p(b,L):(v=rs(b),v.c(),v.m(t,null)):v&&(v.d(1),v=null)},i:G,o:G,d(b){b&&p(t),y&&y.d(),v&&v.d(),k=!1,re(_)}}}function Sr(e,t,n){let i=qe.label;const l={[qe.label]:qe},o=["default","crosshair","hand","arrow","move","text","wait","help","progress","notAllowed","contextMenu","cell","verticalText","alias","copy","noDrop","grab","grabbing","allScroll","zoomIn","zoomOut","eResize","nResize","neResize","nwResize","sResize","seResize","swResize","wResize","ewResize","nsResize","neswResize","nwseResize","colResize","rowResize"];let{onMessage:u}=t,d,c="https://tauri.app",f=!0,g=!1,k=!0,_=!1,y=!0,v=!1,b=null,L=null,D=null,H=null,W=null,j=null,E=null,M=null,T=1,P=new nt(E,M),C=new nt(E,M),F=new mt(b,L),U=new mt(b,L),J,x,me=!1,te=!0,ie=null,Y=null,he="default",O=!1,X="Awesome Tauri Example!";function ne(){Fi(c)}function ce(){l[i].setTitle(X)}function ae(){l[i].hide(),setTimeout(l[i].show,2e3)}function ye(){l[i].minimize(),setTimeout(l[i].unminimize,2e3)}function de(){Bi({multiple:!1}).then(K=>{typeof K=="string"&&l[i].setIcon(K)})}function _e(){if(!d)return;const K=new bt(d);n(1,l[d]=K,l),K.once("tauri://error",function(){u("Error creating new webview")})}function $(){l[i].innerSize().then(K=>{n(27,F=K),n(8,b=F.width),n(9,L=F.height)}),l[i].outerSize().then(K=>{n(28,U=K)})}function le(){l[i].innerPosition().then(K=>{n(25,P=K)}),l[i].outerPosition().then(K=>{n(26,C=K),n(14,E=C.x),n(15,M=C.y)})}async function Me(K){!K||(J&&J(),x&&x(),x=await K.listen("tauri://move",le),J=await K.listen("tauri://resize",$))}async function R(){await l[i].minimize(),await l[i].requestUserAttention(ji.Critical),await new Promise(K=>setTimeout(K,3e3)),await l[i].requestUserAttention(null)}function q(){d=this.value,n(22,d)}function We(){i=Wi(this),n(0,i),n(1,l)}const ze=()=>l[i].center();function Ce(){g=this.checked,n(3,g)}function Z(){f=this.checked,n(2,f)}function De(){k=this.checked,n(4,k)}function ee(){_=this.checked,n(5,_)}function Te(){y=this.checked,n(6,y)}function lt(){v=this.checked,n(7,v)}function fe(){E=oe(this.value),n(14,E)}function ue(){M=oe(this.value),n(15,M)}function N(){b=oe(this.value),n(8,b)}function se(){L=oe(this.value),n(9,L)}function V(){D=oe(this.value),n(10,D)}function Oe(){H=oe(this.value),n(11,H)}function Be(){W=oe(this.value),n(12,W)}function gt(){j=oe(this.value),n(13,j)}function Qt(){me=this.checked,n(16,me)}function Re(){te=this.checked,n(17,te)}function Zt(){O=this.checked,n(21,O)}function vt(){he=Wi(this),n(20,he),n(30,o)}function $t(){ie=oe(this.value),n(18,ie)}function Ie(){Y=oe(this.value),n(19,Y)}function xt(){X=this.value,n(29,X)}function Ve(){c=this.value,n(23,c)}return e.$$set=K=>{"onMessage"in K&&n(38,u=K.onMessage)},e.$$.update=()=>{var K,Ot,Se,Rt,st,It,Ee,yt,wt,kt,Le,Fe,Pe,ot,Ht,rt,Ft,at,Mt;e.$$.dirty[0]&3&&(l[i],le(),$()),e.$$.dirty[0]&7&&((K=l[i])==null||K.setResizable(f)),e.$$.dirty[0]&11&&(g?(Ot=l[i])==null||Ot.maximize():(Se=l[i])==null||Se.unmaximize()),e.$$.dirty[0]&19&&((Rt=l[i])==null||Rt.setDecorations(k)),e.$$.dirty[0]&35&&((st=l[i])==null||st.setAlwaysOnTop(_)),e.$$.dirty[0]&67&&((It=l[i])==null||It.setContentProtected(y)),e.$$.dirty[0]&131&&((Ee=l[i])==null||Ee.setFullscreen(v)),e.$$.dirty[0]&771&&b&&L&&((yt=l[i])==null||yt.setSize(new mt(b,L))),e.$$.dirty[0]&3075&&(D&&H?(wt=l[i])==null||wt.setMinSize(new ti(D,H)):(kt=l[i])==null||kt.setMinSize(null)),e.$$.dirty[0]&12291&&(W>800&&j>400?(Le=l[i])==null||Le.setMaxSize(new ti(W,j)):(Fe=l[i])==null||Fe.setMaxSize(null)),e.$$.dirty[0]&49155&&E!==null&&M!==null&&((Pe=l[i])==null||Pe.setPosition(new nt(E,M))),e.$$.dirty[0]&3&&((ot=l[i])==null||ot.scaleFactor().then(en=>n(24,T=en))),e.$$.dirty[0]&3&&Me(l[i]),e.$$.dirty[0]&65539&&((Ht=l[i])==null||Ht.setCursorGrab(me)),e.$$.dirty[0]&131075&&((rt=l[i])==null||rt.setCursorVisible(te)),e.$$.dirty[0]&1048579&&((Ft=l[i])==null||Ft.setCursorIcon(he)),e.$$.dirty[0]&786435&&ie!==null&&Y!==null&&((at=l[i])==null||at.setCursorPosition(new nt(ie,Y))),e.$$.dirty[0]&2097155&&((Mt=l[i])==null||Mt.setIgnoreCursorEvents(O))},[i,l,f,g,k,_,y,v,b,L,D,H,W,j,E,M,me,te,ie,Y,he,O,d,c,T,P,C,F,U,X,o,ne,ce,ae,ye,de,_e,R,u,q,We,ze,Ce,Z,De,ee,Te,lt,fe,ue,N,se,V,Oe,Be,gt,Qt,Re,Zt,vt,$t,Ie,xt,Ve]}class Er extends ve{constructor(t){super(),ge(this,t,Sr,Ar,pe,{onMessage:38},null,[-1,-1,-1])}}var zr={};ke(zr,{isRegistered:()=>Pr,register:()=>$s,registerAll:()=>Dr,unregister:()=>xs,unregisterAll:()=>eo});async function $s(e,t){return A({__tauriModule:"GlobalShortcut",message:{cmd:"register",shortcut:e,handler:_t(t)}})}async function Dr(e,t){return A({__tauriModule:"GlobalShortcut",message:{cmd:"registerAll",shortcuts:e,handler:_t(t)}})}async function Pr(e){return A({__tauriModule:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:e}})}async function xs(e){return A({__tauriModule:"GlobalShortcut",message:{cmd:"unregister",shortcut:e}})}async function eo(){return A({__tauriModule:"GlobalShortcut",message:{cmd:"unregisterAll"}})}function us(e,t,n){const i=e.slice();return i[9]=t[n],i}function cs(e){let t,n=e[9]+"",i,l,o,u,d;function c(){return e[8](e[9])}return{c(){t=r("div"),i=z(n),l=h(),o=r("button"),o.textContent="Unregister",a(o,"class","btn"),a(o,"type","button"),a(t,"class","flex justify-between")},m(f,g){m(f,t,g),s(t,i),s(t,l),s(t,o),u||(d=S(o,"click",c),u=!0)},p(f,g){e=f,g&2&&n!==(n=e[9]+"")&&Q(i,n)},d(f){f&&p(t),u=!1,d()}}}function ds(e){let t,n,i,l,o;return{c(){t=r("br"),n=h(),i=r("button"),i.textContent="Unregister all",a(i,"class","btn"),a(i,"type","button")},m(u,d){m(u,t,d),m(u,n,d),m(u,i,d),l||(o=S(i,"click",e[5]),l=!0)},p:G,d(u){u&&p(t),u&&p(n),u&&p(i),l=!1,o()}}}function Wr(e){let t,n,i,l,o,u,d,c,f,g,k,_=e[1],y=[];for(let b=0;b<_.length;b+=1)y[b]=cs(us(e,_,b));let v=e[1].length>1&&ds(e);return{c(){t=r("div"),n=r("input"),i=h(),l=r("button"),l.textContent="Register",o=h(),u=r("br"),d=h(),c=r("div");for(let b=0;b1?v?v.p(b,L):(v=ds(b),v.c(),v.m(c,null)):v&&(v.d(1),v=null)},i:G,o:G,d(b){b&&p(t),b&&p(o),b&&p(u),b&&p(d),b&&p(c),ht(y,b),v&&v.d(),g=!1,re(k)}}}function Or(e,t,n){let i,{onMessage:l}=t;const o=Ts([]);ks(e,o,_=>n(1,i=_));let u="CmdOrControl+X";function d(){const _=u;$s(_,()=>{l(`Shortcut ${_} triggered`)}).then(()=>{o.update(y=>[...y,_]),l(`Shortcut ${_} registered successfully`)}).catch(l)}function c(_){const y=_;xs(y).then(()=>{o.update(v=>v.filter(b=>b!==y)),l(`Shortcut ${y} unregistered`)}).catch(l)}function f(){eo().then(()=>{o.update(()=>[]),l("Unregistered all shortcuts")}).catch(l)}function g(){u=this.value,n(0,u)}const k=_=>c(_);return e.$$set=_=>{"onMessage"in _&&n(6,l=_.onMessage)},[u,i,o,d,c,f,l,g,k]}class Rr extends ve{constructor(t){super(),ge(this,t,Or,Wr,pe,{onMessage:6})}}function fs(e){let t,n,i,l,o,u,d;return{c(){t=r("br"),n=h(),i=r("input"),l=h(),o=r("button"),o.textContent="Write",a(i,"class","input"),a(i,"placeholder","write to stdin"),a(o,"class","btn")},m(c,f){m(c,t,f),m(c,n,f),m(c,i,f),B(i,e[4]),m(c,l,f),m(c,o,f),u||(d=[S(i,"input",e[14]),S(o,"click",e[8])],u=!0)},p(c,f){f&16&&i.value!==c[4]&&B(i,c[4])},d(c){c&&p(t),c&&p(n),c&&p(i),c&&p(l),c&&p(o),u=!1,re(d)}}}function Ir(e){let t,n,i,l,o,u,d,c,f,g,k,_,y,v,b,L,D,H,W,j,E,M,T,P,C=e[5]&&fs(e);return{c(){t=r("div"),n=r("div"),i=z(`Script: `),l=r("input"),o=h(),u=r("div"),d=z(`Encoding: - `),c=r("input"),f=h(),v=r("div"),k=z(`Working directory: - `),_=r("input"),y=h(),g=r("div"),b=z(`Arguments: - `),A=r("input"),D=h(),F=r("div"),W=r("button"),W.textContent="Run",j=h(),S=r("button"),S.textContent="Kill",C=h(),M&&M.c(),a(l,"class","grow input"),a(n,"class","flex items-center gap-1"),a(c,"class","grow input"),a(u,"class","flex items-center gap-1"),a(_,"class","grow input"),a(_,"placeholder","Working directory"),a(v,"class","flex items-center gap-1"),a(A,"class","grow input"),a(A,"placeholder","Environment variables"),a(g,"class","flex items-center gap-1"),a(W,"class","btn"),a(S,"class","btn"),a(F,"class","flex children:grow gap-1"),a(t,"class","flex flex-col childre:grow gap-1")},m(N,U){m(N,t,U),s(t,n),s(n,i),s(n,l),B(l,e[0]),s(t,o),s(t,u),s(u,d),s(u,c),B(c,e[3]),s(t,f),s(t,v),s(v,k),s(v,_),B(_,e[1]),s(t,y),s(t,g),s(g,b),s(g,A),B(A,e[2]),s(t,D),s(t,F),s(F,W),s(F,j),s(F,S),s(t,C),M&&M.m(t,null),T||(P=[E(l,"input",e[10]),E(c,"input",e[11]),E(_,"input",e[12]),E(A,"input",e[13]),E(W,"click",e[6]),E(S,"click",e[7])],T=!0)},p(N,[U]){U&1&&l.value!==N[0]&&B(l,N[0]),U&8&&c.value!==N[3]&&B(c,N[3]),U&2&&_.value!==N[1]&&B(_,N[1]),U&4&&A.value!==N[2]&&B(A,N[2]),N[5]?M?M.p(N,U):(M=as(N),M.c(),M.m(t,null)):M&&(M.d(1),M=null)},i:V,o:V,d(N){N&&p(t),M&&M.d(),T=!1,se(P)}}}function Wr(e,t,n){const i=navigator.userAgent.includes("Windows");let l=i?"cmd":"sh",o=i?["/C"]:["-c"],{onMessage:u}=t,d='echo "hello world"',c=null,f="SOMETHING=value ANOTHER=2",v="",k="",_;function y(){return f.split(" ").reduce((C,T)=>{let[P,M]=T.split("=");return{...C,[P]:M}},{})}function g(){n(5,_=null);const C=new Wi(l,[...o,d],{cwd:c||null,env:y(),encoding:v});C.on("close",T=>{u(`command finished with code ${T.code} and signal ${T.signal}`),n(5,_=null)}),C.on("error",T=>u(`command error: "${T}"`)),C.stdout.on("data",T=>u(`command stdout: "${T}"`)),C.stderr.on("data",T=>u(`command stderr: "${T}"`)),C.spawn().then(T=>{n(5,_=T)}).catch(u)}function b(){_.kill().then(()=>u("killed child process")).catch(u)}function A(){_.write(k).catch(u)}function D(){d=this.value,n(0,d)}function F(){v=this.value,n(3,v)}function W(){c=this.value,n(1,c)}function j(){f=this.value,n(2,f)}function S(){k=this.value,n(4,k)}return e.$$set=C=>{"onMessage"in C&&n(9,u=C.onMessage)},[d,c,f,v,k,_,g,b,A,u,D,F,W,j,S]}class Or extends we{constructor(t){super(),ye(this,t,Wr,Pr,me,{onMessage:9})}}var Rr={};Te(Rr,{checkUpdate:()=>Zs,installUpdate:()=>Qs,onUpdaterEvent:()=>qi});async function qi(e){return Xt("tauri://update-status",t=>{e(t==null?void 0:t.payload)})}async function Qs(){let e;function t(){e&&e(),e=void 0}return new Promise((n,i)=>{function l(o){if(o.error)return t(),i(o.error);if(o.status==="DONE")return t(),n()}qi(l).then(o=>{e=o}).catch(o=>{throw t(),o}),ni("tauri://update-install").catch(o=>{throw t(),o})})}async function Zs(){let e;function t(){e&&e(),e=void 0}return new Promise((n,i)=>{function l(u){return t(),n({manifest:u,shouldUpdate:!0})}function o(u){if(u.error)return t(),i(u.error);if(u.status==="UPTODATE")return t(),n({shouldUpdate:!1})}Ss("tauri://update-available",u=>{l(u==null?void 0:u.payload)}).catch(u=>{throw t(),u}),qi(o).then(u=>{e=u}).catch(u=>{throw t(),u}),ni("tauri://update").catch(u=>{throw t(),u})})}function Ir(e){let t;return{c(){t=r("button"),t.innerHTML='
',a(t,"class","btn text-accentText dark:text-darkAccentText flex items-center justify-center")},m(n,i){m(n,t,i)},p:V,d(n){n&&p(t)}}}function Hr(e){let t,n,i;return{c(){t=r("button"),t.textContent="Install update",a(t,"class","btn")},m(l,o){m(l,t,o),n||(i=E(t,"click",e[4]),n=!0)},p:V,d(l){l&&p(t),n=!1,i()}}}function Fr(e){let t,n,i;return{c(){t=r("button"),t.textContent="Check update",a(t,"class","btn")},m(l,o){m(l,t,o),n||(i=E(t,"click",e[3]),n=!0)},p:V,d(l){l&&p(t),n=!1,i()}}}function Nr(e){let t;function n(o,u){return!o[0]&&!o[2]?Fr:!o[1]&&o[2]?Hr:Ir}let i=n(e),l=i(e);return{c(){t=r("div"),l.c(),a(t,"class","flex children:grow children:h10")},m(o,u){m(o,t,u),l.m(t,null)},p(o,[u]){i===(i=n(o))&&l?l.p(o,u):(l.d(1),l=i(o),l&&(l.c(),l.m(t,null)))},i:V,o:V,d(o){o&&p(t),l.d()}}}function jr(e,t,n){let{onMessage:i}=t,l;ut(async()=>{l=await Xt("tauri://update-status",i)}),Pi(()=>{l&&l()});let o,u,d;async function c(){n(0,o=!0);try{const{shouldUpdate:v,manifest:k}=await Zs();i(`Should update: ${v}`),i(k),n(2,d=v)}catch(v){i(v)}finally{n(0,o=!1)}}async function f(){n(1,u=!0);try{await Qs(),i("Installation complete, restart required."),await Fi()}catch(v){i(v)}finally{n(1,u=!1)}}return e.$$set=v=>{"onMessage"in v&&n(5,i=v.onMessage)},[o,u,d,c,f,i]}class Ur extends we{constructor(t){super(),ye(this,t,jr,Nr,me,{onMessage:5})}}var qr={};Te(qr,{readText:()=>eo,writeText:()=>xs});async function xs(e){return L({__tauriModule:"Clipboard",message:{cmd:"writeText",data:e}})}async function eo(){return L({__tauriModule:"Clipboard",message:{cmd:"readText",data:null}})}function Br(e){let t,n,i,l,o,u,d,c;return{c(){t=r("div"),n=r("input"),i=h(),l=r("button"),l.textContent="Write",o=h(),u=r("button"),u.textContent="Read",a(n,"class","grow input"),a(n,"placeholder","Text to write to the clipboard"),a(l,"class","btn"),a(l,"type","button"),a(u,"class","btn"),a(u,"type","button"),a(t,"class","flex gap-1")},m(f,v){m(f,t,v),s(t,n),B(n,e[0]),s(t,i),s(t,l),s(t,o),s(t,u),d||(c=[E(n,"input",e[4]),E(l,"click",e[1]),E(u,"click",e[2])],d=!0)},p(f,[v]){v&1&&n.value!==f[0]&&B(n,f[0])},i:V,o:V,d(f){f&&p(t),d=!1,se(c)}}}function Vr(e,t,n){let{onMessage:i}=t,l="clipboard message";function o(){xs(l).then(()=>{i("Wrote to the clipboard")}).catch(i)}function u(){eo().then(c=>{i(`Clipboard contents: ${c}`)}).catch(i)}function d(){l=this.value,n(0,l)}return e.$$set=c=>{"onMessage"in c&&n(3,i=c.onMessage)},[l,o,u,i,d]}class Gr extends we{constructor(t){super(),ye(this,t,Vr,Br,me,{onMessage:3})}}function Jr(e){let t;return{c(){t=r("div"),t.innerHTML=`
Not available for Linux
- `,a(t,"class","flex flex-col gap-2")},m(n,i){m(n,t,i)},p:V,i:V,o:V,d(n){n&&p(t)}}}function Xr(e,t,n){let{onMessage:i}=t;const l=window.constraints={audio:!0,video:!0};function o(d){const c=document.querySelector("video"),f=d.getVideoTracks();i("Got stream with constraints:",l),i(`Using video device: ${f[0].label}`),window.stream=d,c.srcObject=d}function u(d){if(d.name==="ConstraintNotSatisfiedError"){const c=l.video;i(`The resolution ${c.width.exact}x${c.height.exact} px is not supported by your device.`)}else d.name==="PermissionDeniedError"&&i("Permissions have not been granted to use your camera and microphone, you need to allow the page access to your devices in order for the demo to work.");i(`getUserMedia error: ${d.name}`,d)}return ut(async()=>{try{const d=await navigator.mediaDevices.getUserMedia(l);o(d)}catch(d){u(d)}}),Pi(()=>{window.stream.getTracks().forEach(function(d){d.stop()})}),e.$$set=d=>{"onMessage"in d&&n(0,i=d.onMessage)},[i]}class Yr extends we{constructor(t){super(),ye(this,t,Xr,Jr,me,{onMessage:0})}}function $r(e){let t,n,i,l,o,u;return{c(){t=r("div"),n=r("button"),n.textContent="Show",i=h(),l=r("button"),l.textContent="Hide",a(n,"class","btn"),a(n,"id","show"),a(n,"title","Hides and shows the app after 2 seconds"),a(l,"class","btn"),a(l,"id","hide")},m(d,c){m(d,t,c),s(t,n),s(t,i),s(t,l),o||(u=[E(n,"click",e[0]),E(l,"click",e[1])],o=!0)},p:V,i:V,o:V,d(d){d&&p(t),o=!1,se(u)}}}function Kr(e,t,n){let{onMessage:i}=t;function l(){o().then(()=>{setTimeout(()=>{Fs().then(()=>i("Shown app")).catch(i)},2e3)}).catch(i)}function o(){return Ns().then(()=>i("Hide app")).catch(i)}return e.$$set=u=>{"onMessage"in u&&n(2,i=u.onMessage)},[l,o,i]}class Qr extends we{constructor(t){super(),ye(this,t,Kr,$r,me,{onMessage:2})}}function us(e,t,n){const i=e.slice();return i[32]=t[n],i}function cs(e,t,n){const i=e.slice();return i[35]=t[n],i}function ds(e){let t,n,i,l,o,u,d,c,f,v,k,_,y,g,b;function A(C,T){return C[3]?xr:Zr}let D=A(e),F=D(e);function W(C,T){return C[2]?ta:ea}let j=W(e),S=j(e);return{c(){t=r("div"),n=r("span"),n.textContent="Tauri API Validation",i=h(),l=r("span"),o=r("span"),F.c(),d=h(),c=r("span"),c.innerHTML='
',f=h(),v=r("span"),S.c(),_=h(),y=r("span"),y.innerHTML='
',a(n,"class","lt-sm:pl-10 text-darkPrimaryText"),a(o,"title",u=e[3]?"Switch to Light mode":"Switch to Dark mode"),a(o,"class","hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"),a(c,"title","Minimize"),a(c,"class","hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"),a(v,"title",k=e[2]?"Restore":"Maximize"),a(v,"class","hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"),a(y,"title","Close"),a(y,"class","hover:bg-red-700 dark:hover:bg-red-700 hover:text-darkPrimaryText active:bg-red-700/90 dark:active:bg-red-700/90 active:text-darkPrimaryText "),a(l,"class","h-100% children:h-100% children:w-12 children:inline-flex children:items-center children:justify-center"),a(t,"class","w-screen select-none h-8 pl-2 flex justify-between items-center absolute text-primaryText dark:text-darkPrimaryText"),a(t,"data-tauri-drag-region","")},m(C,T){m(C,t,T),s(t,n),s(t,i),s(t,l),s(l,o),F.m(o,null),s(l,d),s(l,c),s(l,f),s(l,v),S.m(v,null),s(l,_),s(l,y),g||(b=[E(o,"click",e[12]),E(c,"click",e[9]),E(v,"click",e[10]),E(y,"click",e[11])],g=!0)},p(C,T){D!==(D=A(C))&&(F.d(1),F=D(C),F&&(F.c(),F.m(o,null))),T[0]&8&&u!==(u=C[3]?"Switch to Light mode":"Switch to Dark mode")&&a(o,"title",u),j!==(j=W(C))&&(S.d(1),S=j(C),S&&(S.c(),S.m(v,null))),T[0]&4&&k!==(k=C[2]?"Restore":"Maximize")&&a(v,"title",k)},d(C){C&&p(t),F.d(),S.d(),g=!1,se(b)}}}function Zr(e){let t;return{c(){t=r("div"),a(t,"class","i-ph-moon")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function xr(e){let t;return{c(){t=r("div"),a(t,"class","i-ph-sun")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function ea(e){let t;return{c(){t=r("div"),a(t,"class","i-codicon-chrome-maximize")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function ta(e){let t;return{c(){t=r("div"),a(t,"class","i-codicon-chrome-restore")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function na(e){let t;return{c(){t=r("span"),a(t,"class","i-codicon-menu animate-duration-300ms animate-fade-in")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function ia(e){let t;return{c(){t=r("span"),a(t,"class","i-codicon-close animate-duration-300ms animate-fade-in")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function fs(e){let t,n,i,l,o,u,d,c,f;function v(y,g){return y[3]?sa:la}let k=v(e),_=k(e);return{c(){t=r("a"),_.c(),n=h(),i=r("br"),l=h(),o=r("div"),u=h(),d=r("br"),a(t,"href","##"),a(t,"class","nv justify-between h-8"),a(o,"class","bg-white/5 h-2px")},m(y,g){m(y,t,g),_.m(t,null),m(y,n,g),m(y,i,g),m(y,l,g),m(y,o,g),m(y,u,g),m(y,d,g),c||(f=E(t,"click",e[12]),c=!0)},p(y,g){k!==(k=v(y))&&(_.d(1),_=k(y),_&&(_.c(),_.m(t,null)))},d(y){y&&p(t),_.d(),y&&p(n),y&&p(i),y&&p(l),y&&p(o),y&&p(u),y&&p(d),c=!1,f()}}}function la(e){let t,n;return{c(){t=z(`Switch to Dark mode - `),n=r("div"),a(n,"class","i-ph-moon")},m(i,l){m(i,t,l),m(i,n,l)},d(i){i&&p(t),i&&p(n)}}}function sa(e){let t,n;return{c(){t=z(`Switch to Light mode - `),n=r("div"),a(n,"class","i-ph-sun")},m(i,l){m(i,t,l),m(i,n,l)},d(i){i&&p(t),i&&p(n)}}}function oa(e){let t,n,i,l,o,u=e[35].label+"",d,c,f,v;function k(){return e[20](e[35])}return{c(){t=r("a"),n=r("div"),l=h(),o=r("p"),d=z(u),a(n,"class",i=e[35].icon+" mr-2"),a(t,"href","##"),a(t,"class",c="nv "+(e[1]===e[35]?"nv_selected":""))},m(_,y){m(_,t,y),s(t,n),s(t,l),s(t,o),s(o,d),f||(v=E(t,"click",k),f=!0)},p(_,y){e=_,y[0]&2&&c!==(c="nv "+(e[1]===e[35]?"nv_selected":""))&&a(t,"class",c)},d(_){_&&p(t),f=!1,v()}}}function ps(e){let t,n=e[35]&&oa(e);return{c(){n&&n.c(),t=xn()},m(i,l){n&&n.m(i,l),m(i,t,l)},p(i,l){i[35]&&n.p(i,l)},d(i){n&&n.d(i),i&&p(t)}}}function ms(e){let t,n=e[32].html+"",i;return{c(){t=new ao(!1),i=xn(),t.a=i},m(l,o){t.m(n,l,o),m(l,i,o)},p(l,o){o[0]&64&&n!==(n=l[32].html+"")&&t.p(n)},d(l){l&&p(i),l&&t.d()}}}function ra(e){let t,n,i,l,o,u,d,c,f,v,k,_,y,g,b,A,D,F,W,j,S,C,T,P,M,N,U,J=e[1].label+"",Q,he,x,ne,Y,_e,O,$,ie,oe,Z,pe,re,be,ee,ke,Ae,R,q=e[5]&&ds(e);function We(H,te){return H[0]?ia:na}let Le=We(e),Me=Le(e),ae=!e[5]&&fs(e),de=e[7],ue=[];for(let H=0;H{let[P,C]=T.split("=");return{...M,[P]:C}},{})}function v(){n(5,_=null);const M=new Hi(l,[...o,d],{cwd:c||null,env:y(),encoding:g});M.on("close",T=>{u(`command finished with code ${T.code} and signal ${T.signal}`),n(5,_=null)}),M.on("error",T=>u(`command error: "${T}"`)),M.stdout.on("data",T=>u(`command stdout: "${T}"`)),M.stderr.on("data",T=>u(`command stderr: "${T}"`)),M.spawn().then(T=>{n(5,_=T)}).catch(u)}function b(){_.kill().then(()=>u("killed child process")).catch(u)}function L(){_.write(k).catch(u)}function D(){d=this.value,n(0,d)}function H(){g=this.value,n(3,g)}function W(){c=this.value,n(1,c)}function j(){f=this.value,n(2,f)}function E(){k=this.value,n(4,k)}return e.$$set=M=>{"onMessage"in M&&n(9,u=M.onMessage)},[d,c,f,g,k,_,v,b,L,u,D,H,W,j,E]}class Fr extends ve{constructor(t){super(),ge(this,t,Hr,Ir,pe,{onMessage:9})}}var Nr={};ke(Nr,{checkUpdate:()=>no,installUpdate:()=>to,onUpdaterEvent:()=>Ji});async function Ji(e){return Kt("tauri://update-status",t=>{e(t==null?void 0:t.payload)})}async function to(){let e;function t(){e&&e(),e=void 0}return new Promise((n,i)=>{function l(o){if(o.error)return t(),i(o.error);if(o.status==="DONE")return t(),n()}Ji(l).then(o=>{e=o}).catch(o=>{throw t(),o}),oi("tauri://update-install").catch(o=>{throw t(),o})})}async function no(){let e;function t(){e&&e(),e=void 0}return new Promise((n,i)=>{function l(u){return t(),n({manifest:u,shouldUpdate:!0})}function o(u){if(u.error)return t(),i(u.error);if(u.status==="UPTODATE")return t(),n({shouldUpdate:!1})}Ps("tauri://update-available",u=>{l(u==null?void 0:u.payload)}).catch(u=>{throw t(),u}),Ji(o).then(u=>{e=u}).catch(u=>{throw t(),u}),oi("tauri://update").catch(u=>{throw t(),u})})}function jr(e){let t;return{c(){t=r("button"),t.innerHTML='
',a(t,"class","btn text-accentText dark:text-darkAccentText flex items-center justify-center")},m(n,i){m(n,t,i)},p:G,d(n){n&&p(t)}}}function Ur(e){let t,n,i;return{c(){t=r("button"),t.textContent="Install update",a(t,"class","btn")},m(l,o){m(l,t,o),n||(i=S(t,"click",e[4]),n=!0)},p:G,d(l){l&&p(t),n=!1,i()}}}function qr(e){let t,n,i;return{c(){t=r("button"),t.textContent="Check update",a(t,"class","btn")},m(l,o){m(l,t,o),n||(i=S(t,"click",e[3]),n=!0)},p:G,d(l){l&&p(t),n=!1,i()}}}function Br(e){let t;function n(o,u){return!o[0]&&!o[2]?qr:!o[1]&&o[2]?Ur:jr}let i=n(e),l=i(e);return{c(){t=r("div"),l.c(),a(t,"class","flex children:grow children:h10")},m(o,u){m(o,t,u),l.m(t,null)},p(o,[u]){i===(i=n(o))&&l?l.p(o,u):(l.d(1),l=i(o),l&&(l.c(),l.m(t,null)))},i:G,o:G,d(o){o&&p(t),l.d()}}}function Vr(e,t,n){let{onMessage:i}=t,l;ft(async()=>{l=await Kt("tauri://update-status",i)}),Ii(()=>{l&&l()});let o,u,d;async function c(){n(0,o=!0);try{const{shouldUpdate:g,manifest:k}=await no();i(`Should update: ${g}`),i(k),n(2,d=g)}catch(g){i(g)}finally{n(0,o=!1)}}async function f(){n(1,u=!0);try{await to(),i("Installation complete, restart required."),await qi()}catch(g){i(g)}finally{n(1,u=!1)}}return e.$$set=g=>{"onMessage"in g&&n(5,i=g.onMessage)},[o,u,d,c,f,i]}class Gr extends ve{constructor(t){super(),ge(this,t,Vr,Br,pe,{onMessage:5})}}var Jr={};ke(Jr,{readText:()=>lo,writeText:()=>io});async function io(e){return A({__tauriModule:"Clipboard",message:{cmd:"writeText",data:e}})}async function lo(){return A({__tauriModule:"Clipboard",message:{cmd:"readText",data:null}})}function Xr(e){let t,n,i,l,o,u,d,c;return{c(){t=r("div"),n=r("input"),i=h(),l=r("button"),l.textContent="Write",o=h(),u=r("button"),u.textContent="Read",a(n,"class","grow input"),a(n,"placeholder","Text to write to the clipboard"),a(l,"class","btn"),a(l,"type","button"),a(u,"class","btn"),a(u,"type","button"),a(t,"class","flex gap-1")},m(f,g){m(f,t,g),s(t,n),B(n,e[0]),s(t,i),s(t,l),s(t,o),s(t,u),d||(c=[S(n,"input",e[4]),S(l,"click",e[1]),S(u,"click",e[2])],d=!0)},p(f,[g]){g&1&&n.value!==f[0]&&B(n,f[0])},i:G,o:G,d(f){f&&p(t),d=!1,re(c)}}}function Yr(e,t,n){let{onMessage:i}=t,l="clipboard message";function o(){io(l).then(()=>{i("Wrote to the clipboard")}).catch(i)}function u(){lo().then(c=>{i(`Clipboard contents: ${c}`)}).catch(i)}function d(){l=this.value,n(0,l)}return e.$$set=c=>{"onMessage"in c&&n(3,i=c.onMessage)},[l,o,u,i,d]}class Kr extends ve{constructor(t){super(),ge(this,t,Yr,Xr,pe,{onMessage:3})}}function Qr(e){let t;return{c(){t=r("div"),t.innerHTML=`
Not available for Linux
+ `,a(t,"class","flex flex-col gap-2")},m(n,i){m(n,t,i)},p:G,i:G,o:G,d(n){n&&p(t)}}}function Zr(e,t,n){let{onMessage:i}=t;const l=window.constraints={audio:!0,video:!0};function o(d){const c=document.querySelector("video"),f=d.getVideoTracks();i("Got stream with constraints:",l),i(`Using video device: ${f[0].label}`),window.stream=d,c.srcObject=d}function u(d){if(d.name==="ConstraintNotSatisfiedError"){const c=l.video;i(`The resolution ${c.width.exact}x${c.height.exact} px is not supported by your device.`)}else d.name==="PermissionDeniedError"&&i("Permissions have not been granted to use your camera and microphone, you need to allow the page access to your devices in order for the demo to work.");i(`getUserMedia error: ${d.name}`,d)}return ft(async()=>{try{const d=await navigator.mediaDevices.getUserMedia(l);o(d)}catch(d){u(d)}}),Ii(()=>{window.stream.getTracks().forEach(function(d){d.stop()})}),e.$$set=d=>{"onMessage"in d&&n(0,i=d.onMessage)},[i]}class $r extends ve{constructor(t){super(),ge(this,t,Zr,Qr,pe,{onMessage:0})}}function xr(e){let t,n,i,l,o,u;return{c(){t=r("div"),n=r("button"),n.textContent="Show",i=h(),l=r("button"),l.textContent="Hide",a(n,"class","btn"),a(n,"id","show"),a(n,"title","Hides and shows the app after 2 seconds"),a(l,"class","btn"),a(l,"id","hide")},m(d,c){m(d,t,c),s(t,n),s(t,i),s(t,l),o||(u=[S(n,"click",e[0]),S(l,"click",e[1])],o=!0)},p:G,i:G,o:G,d(d){d&&p(t),o=!1,re(u)}}}function ea(e,t,n){let{onMessage:i}=t;function l(){o().then(()=>{setTimeout(()=>{qs().then(()=>i("Shown app")).catch(i)},2e3)}).catch(i)}function o(){return Bs().then(()=>i("Hide app")).catch(i)}return e.$$set=u=>{"onMessage"in u&&n(2,i=u.onMessage)},[l,o,i]}class ta extends ve{constructor(t){super(),ge(this,t,ea,xr,pe,{onMessage:2})}}function ps(e,t,n){const i=e.slice();return i[32]=t[n],i}function ms(e,t,n){const i=e.slice();return i[35]=t[n],i}function hs(e){let t,n,i,l,o,u,d,c,f,g,k,_,y,v,b;function L(M,T){return M[3]?ia:na}let D=L(e),H=D(e);function W(M,T){return M[2]?sa:la}let j=W(e),E=j(e);return{c(){t=r("div"),n=r("span"),n.textContent="Tauri API Validation",i=h(),l=r("span"),o=r("span"),H.c(),d=h(),c=r("span"),c.innerHTML='
',f=h(),g=r("span"),E.c(),_=h(),y=r("span"),y.innerHTML='
',a(n,"class","lt-sm:pl-10 text-darkPrimaryText"),a(o,"title",u=e[3]?"Switch to Light mode":"Switch to Dark mode"),a(o,"class","hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"),a(c,"title","Minimize"),a(c,"class","hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"),a(g,"title",k=e[2]?"Restore":"Maximize"),a(g,"class","hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"),a(y,"title","Close"),a(y,"class","hover:bg-red-700 dark:hover:bg-red-700 hover:text-darkPrimaryText active:bg-red-700/90 dark:active:bg-red-700/90 active:text-darkPrimaryText "),a(l,"class","h-100% children:h-100% children:w-12 children:inline-flex children:items-center children:justify-center"),a(t,"class","w-screen select-none h-8 pl-2 flex justify-between items-center absolute text-primaryText dark:text-darkPrimaryText"),a(t,"data-tauri-drag-region","")},m(M,T){m(M,t,T),s(t,n),s(t,i),s(t,l),s(l,o),H.m(o,null),s(l,d),s(l,c),s(l,f),s(l,g),E.m(g,null),s(l,_),s(l,y),v||(b=[S(o,"click",e[12]),S(c,"click",e[9]),S(g,"click",e[10]),S(y,"click",e[11])],v=!0)},p(M,T){D!==(D=L(M))&&(H.d(1),H=D(M),H&&(H.c(),H.m(o,null))),T[0]&8&&u!==(u=M[3]?"Switch to Light mode":"Switch to Dark mode")&&a(o,"title",u),j!==(j=W(M))&&(E.d(1),E=j(M),E&&(E.c(),E.m(g,null))),T[0]&4&&k!==(k=M[2]?"Restore":"Maximize")&&a(g,"title",k)},d(M){M&&p(t),H.d(),E.d(),v=!1,re(b)}}}function na(e){let t;return{c(){t=r("div"),a(t,"class","i-ph-moon")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function ia(e){let t;return{c(){t=r("div"),a(t,"class","i-ph-sun")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function la(e){let t;return{c(){t=r("div"),a(t,"class","i-codicon-chrome-maximize")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function sa(e){let t;return{c(){t=r("div"),a(t,"class","i-codicon-chrome-restore")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function oa(e){let t;return{c(){t=r("span"),a(t,"class","i-codicon-menu animate-duration-300ms animate-fade-in")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function ra(e){let t;return{c(){t=r("span"),a(t,"class","i-codicon-close animate-duration-300ms animate-fade-in")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function _s(e){let t,n,i,l,o,u,d,c,f;function g(y,v){return y[3]?ua:aa}let k=g(e),_=k(e);return{c(){t=r("a"),_.c(),n=h(),i=r("br"),l=h(),o=r("div"),u=h(),d=r("br"),a(t,"href","##"),a(t,"class","nv justify-between h-8"),a(o,"class","bg-white/5 h-2px")},m(y,v){m(y,t,v),_.m(t,null),m(y,n,v),m(y,i,v),m(y,l,v),m(y,o,v),m(y,u,v),m(y,d,v),c||(f=S(t,"click",e[12]),c=!0)},p(y,v){k!==(k=g(y))&&(_.d(1),_=k(y),_&&(_.c(),_.m(t,null)))},d(y){y&&p(t),_.d(),y&&p(n),y&&p(i),y&&p(l),y&&p(o),y&&p(u),y&&p(d),c=!1,f()}}}function aa(e){let t,n;return{c(){t=z(`Switch to Dark mode + `),n=r("div"),a(n,"class","i-ph-moon")},m(i,l){m(i,t,l),m(i,n,l)},d(i){i&&p(t),i&&p(n)}}}function ua(e){let t,n;return{c(){t=z(`Switch to Light mode + `),n=r("div"),a(n,"class","i-ph-sun")},m(i,l){m(i,t,l),m(i,n,l)},d(i){i&&p(t),i&&p(n)}}}function ca(e){let t,n,i,l,o,u=e[35].label+"",d,c,f,g;function k(){return e[20](e[35])}return{c(){t=r("a"),n=r("div"),l=h(),o=r("p"),d=z(u),a(n,"class",i=e[35].icon+" mr-2"),a(t,"href","##"),a(t,"class",c="nv "+(e[1]===e[35]?"nv_selected":""))},m(_,y){m(_,t,y),s(t,n),s(t,l),s(t,o),s(o,d),f||(g=S(t,"click",k),f=!0)},p(_,y){e=_,y[0]&2&&c!==(c="nv "+(e[1]===e[35]?"nv_selected":""))&&a(t,"class",c)},d(_){_&&p(t),f=!1,g()}}}function bs(e){let t,n=e[35]&&ca(e);return{c(){n&&n.c(),t=ii()},m(i,l){n&&n.m(i,l),m(i,t,l)},p(i,l){i[35]&&n.p(i,l)},d(i){n&&n.d(i),i&&p(t)}}}function gs(e){let t,n=e[32].html+"",i;return{c(){t=new po(!1),i=ii(),t.a=i},m(l,o){t.m(n,l,o),m(l,i,o)},p(l,o){o[0]&64&&n!==(n=l[32].html+"")&&t.p(n)},d(l){l&&p(i),l&&t.d()}}}function da(e){let t,n,i,l,o,u,d,c,f,g,k,_,y,v,b,L,D,H,W,j,E,M,T,P,C,F,U,J=e[1].label+"",x,me,te,ie,Y,he,O,X,ne,ce,ae,ye,de,_e,$,le,Me,R,q=e[5]&&hs(e);function We(N,se){return N[0]?ra:oa}let ze=We(e),Ce=ze(e),Z=!e[5]&&_s(e),De=e[7],ee=[];for(let N=0;N`,k=h(),_=r("a"),_.innerHTML=`GitHub - `,y=h(),g=r("a"),g.innerHTML=`Source - `,b=h(),A=r("br"),D=h(),F=r("div"),W=h(),j=r("br"),S=h(),C=r("div");for(let H=0;H',be=h(),ee=r("div");for(let H=0;H{Gt(G,1)}),ti()}Se?(Y=new Se(tt(H)),$n(Y.$$.fragment),ze(Y.$$.fragment,1),Vt(Y,ne,null)):Y=null}if(te[0]&64){fe=H[6];let G;for(G=0;G{await confirm("Are you sure?")||O.preventDefault()}),je.onFileDropEvent(O=>{D(`File drop: ${JSON.stringify(O.payload)}`)});const l=navigator.userAgent.toLowerCase(),o=l.includes("android")||l.includes("iphone"),u=[{label:"Welcome",component:Ro,icon:"i-ph-hand-waving"},{label:"Communication",component:qo,icon:"i-codicon-radio-tower"},!o&&{label:"CLI",component:No,icon:"i-codicon-terminal"},!o&&{label:"Dialog",component:lr,icon:"i-codicon-multiple-windows"},{label:"File system",component:ar,icon:"i-codicon-files"},{label:"HTTP",component:gr,icon:"i-ph-globe-hemisphere-west"},!o&&{label:"Notifications",component:kr,icon:"i-codicon-bell-dot"},!o&&{label:"App",component:Qr,icon:"i-codicon-hubot"},!o&&{label:"Window",component:Tr,icon:"i-codicon-window"},!o&&{label:"Shortcuts",component:Dr,icon:"i-codicon-record-keys"},{label:"Shell",component:Or,icon:"i-codicon-terminal-bash"},!o&&{label:"Updater",component:Ur,icon:"i-codicon-cloud-download"},!o&&{label:"Clipboard",component:Gr,icon:"i-codicon-clippy"},{label:"WebRTC",component:Yr,icon:"i-ph-broadcast"}];let d=u[0];function c(O){n(1,d=O)}let f;ut(async()=>{const O=Ut();n(2,f=await O.isMaximized()),Xt("tauri://resize",async()=>{n(2,f=await O.isMaximized())})});function v(){Ut().minimize()}async function k(){const O=Ut();await O.isMaximized()?O.unmaximize():O.maximize()}let _=!1;async function y(){_||(_=await Bs("Are you sure that you want to close this window?",{title:"Tauri API"}),_&&Ut().close())}let g;ut(()=>{n(3,g=localStorage&&localStorage.getItem("theme")=="dark"),_s(g)});function b(){n(3,g=!g),_s(g)}let A=ws([]);gs(e,A,O=>n(6,i=O));function D(O){A.update($=>[{html:`
[${new Date().toLocaleTimeString()}]: `+(typeof O=="string"?O:JSON.stringify(O,null,1))+"
"},...$])}function F(O){A.update($=>[{html:`
[${new Date().toLocaleTimeString()}]: `+O+"
"},...$])}function W(){A.update(()=>[])}let j,S,C;function T(O){C=O.clientY;const $=window.getComputedStyle(j);S=parseInt($.height,10);const ie=Z=>{const pe=Z.clientY-C,re=S-pe;n(4,j.style.height=`${re{document.removeEventListener("mouseup",oe),document.removeEventListener("mousemove",ie)};document.addEventListener("mouseup",oe),document.addEventListener("mousemove",ie)}let P;ut(async()=>{n(5,P=await Os()==="win32")});let M=!1,N,U,J=!1,Q=0,he=0;const x=(O,$,ie)=>Math.min(Math.max($,O),ie);ut(()=>{n(18,N=document.querySelector("#sidebar")),U=document.querySelector("#sidebarToggle"),document.addEventListener("click",O=>{U.contains(O.target)?n(0,M=!M):M&&!N.contains(O.target)&&n(0,M=!1)}),document.addEventListener("touchstart",O=>{if(U.contains(O.target))return;const $=O.touches[0].clientX;(0<$&&$<20&&!M||M)&&(J=!0,Q=$)}),document.addEventListener("touchmove",O=>{if(J){const $=O.touches[0].clientX;he=$;const ie=($-Q)/10;N.style.setProperty("--translate-x",`-${x(0,M?0-ie:18.75-ie,18.75)}rem`)}}),document.addEventListener("touchend",()=>{if(J){const O=(he-Q)/10;n(0,M=M?O>-(18.75/2):O>18.75/2)}J=!1})});const ne=()=>Oi("https://tauri.app/"),Y=O=>{c(O),n(0,M=!1)};function _e(O){Yn[O?"unshift":"push"](()=>{j=O,n(4,j)})}return e.$$.update=()=>{if(e.$$.dirty[0]&1){const O=document.querySelector("#sidebar");O&&aa(O,M)}},[M,d,f,g,j,P,i,u,c,v,k,y,b,A,D,F,W,T,N,ne,Y,_e]}class ca extends we{constructor(t){super(),ye(this,t,ua,ra,me,{},null,[-1,-1])}}new ca({target:document.querySelector("#app")}); + `,y=h(),v=r("a"),v.innerHTML=`Source + `,b=h(),L=r("br"),D=h(),H=r("div"),W=h(),j=r("br"),E=h(),M=r("div");for(let N=0;N',_e=h(),$=r("div");for(let N=0;N{Xt(V,1)}),si()}Te?(Y=new Te(lt(N)),xn(Y.$$.fragment),Ae(Y.$$.fragment,1),Jt(Y,ie,null)):Y=null}if(se[0]&64){fe=N[6];let V;for(V=0;V{await confirm("Are you sure?")||O.preventDefault()}),qe.onFileDropEvent(O=>{D(`File drop: ${JSON.stringify(O.payload)}`)});const l=navigator.userAgent.toLowerCase(),o=l.includes("android")||l.includes("iphone"),u=[{label:"Welcome",component:No,icon:"i-ph-hand-waving"},{label:"Communication",component:Jo,icon:"i-codicon-radio-tower"},!o&&{label:"CLI",component:Bo,icon:"i-codicon-terminal"},!o&&{label:"Dialog",component:ar,icon:"i-codicon-multiple-windows"},{label:"File system",component:fr,icon:"i-codicon-files"},{label:"HTTP",component:kr,icon:"i-ph-globe-hemisphere-west"},!o&&{label:"Notifications",component:Lr,icon:"i-codicon-bell-dot"},!o&&{label:"App",component:ta,icon:"i-codicon-hubot"},!o&&{label:"Window",component:Er,icon:"i-codicon-window"},!o&&{label:"Shortcuts",component:Rr,icon:"i-codicon-record-keys"},{label:"Shell",component:Fr,icon:"i-codicon-terminal-bash"},!o&&{label:"Updater",component:Gr,icon:"i-codicon-cloud-download"},!o&&{label:"Clipboard",component:Kr,icon:"i-codicon-clippy"},{label:"WebRTC",component:$r,icon:"i-ph-broadcast"}];let d=u[0];function c(O){n(1,d=O)}let f;ft(async()=>{const O=Bt();n(2,f=await O.isMaximized()),Kt("tauri://resize",async()=>{n(2,f=await O.isMaximized())})});function g(){Bt().minimize()}async function k(){const O=Bt();await O.isMaximized()?O.unmaximize():O.maximize()}let _=!1;async function y(){_||(_=await Xs("Are you sure that you want to close this window?",{title:"Tauri API"}),_&&Bt().close())}let v;ft(()=>{n(3,v=localStorage&&localStorage.getItem("theme")=="dark"),ys(v)});function b(){n(3,v=!v),ys(v)}let L=Ts([]);ks(e,L,O=>n(6,i=O));function D(O){L.update(X=>[{html:`
[${new Date().toLocaleTimeString()}]: `+(typeof O=="string"?O:JSON.stringify(O,null,1))+"
"},...X])}function H(O){L.update(X=>[{html:`
[${new Date().toLocaleTimeString()}]: `+O+"
"},...X])}function W(){L.update(()=>[])}let j,E,M;function T(O){M=O.clientY;const X=window.getComputedStyle(j);E=parseInt(X.height,10);const ne=ae=>{const ye=ae.clientY-M,de=E-ye;n(4,j.style.height=`${de{document.removeEventListener("mouseup",ce),document.removeEventListener("mousemove",ne)};document.addEventListener("mouseup",ce),document.addEventListener("mousemove",ne)}let P;ft(async()=>{n(5,P=await Fs()==="win32")});let C=!1,F,U,J=!1,x=0,me=0;const te=(O,X,ne)=>Math.min(Math.max(X,O),ne);ft(()=>{n(18,F=document.querySelector("#sidebar")),U=document.querySelector("#sidebarToggle"),document.addEventListener("click",O=>{U.contains(O.target)?n(0,C=!C):C&&!F.contains(O.target)&&n(0,C=!1)}),document.addEventListener("touchstart",O=>{if(U.contains(O.target))return;const X=O.touches[0].clientX;(0{if(J){const X=O.touches[0].clientX;me=X;const ne=(X-x)/10;F.style.setProperty("--translate-x",`-${te(0,C?0-ne:18.75-ne,18.75)}rem`)}}),document.addEventListener("touchend",()=>{if(J){const O=(me-x)/10;n(0,C=C?O>-(18.75/2):O>18.75/2)}J=!1})});const ie=()=>Fi("https://tauri.app/"),Y=O=>{c(O),n(0,C=!1)};function he(O){$n[O?"unshift":"push"](()=>{j=O,n(4,j)})}return e.$$.update=()=>{if(e.$$.dirty[0]&1){const O=document.querySelector("#sidebar");O&&fa(O,C)}},[C,d,f,v,j,P,i,u,c,g,k,y,b,L,D,H,W,T,F,ie,Y,he]}class ma extends ve{constructor(t){super(),ge(this,t,pa,da,pe,{},null,[-1,-1])}}new ma({target:document.querySelector("#app")}); diff --git a/examples/api/src-tauri/Cargo.lock b/examples/api/src-tauri/Cargo.lock index 9feee8d01..565215218 100644 --- a/examples/api/src-tauri/Cargo.lock +++ b/examples/api/src-tauri/Cargo.lock @@ -8,12 +8,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" -[[package]] -name = "adler32" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" - [[package]] name = "aead" version = "0.4.3" @@ -188,6 +182,12 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +[[package]] +name = "base64" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ea22880d78093b0cbe17c89f64a7d457941e65759157ec6cb31a31d652b05e5" + [[package]] name = "bitflags" version = "1.3.2" @@ -635,16 +635,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "deflate" -version = "0.7.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707b6a7b384888a70c8d2e8650b3e60170dfc6a67bb4aa67b6dfca57af4bedb4" -dependencies = [ - "adler32", - "byteorder", -] - [[package]] name = "derive_more" version = "0.99.17" @@ -1348,12 +1338,12 @@ dependencies = [ [[package]] name = "ico" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a4b3331534254a9b64095ae60d3dc2a8225a7a70229cd5888be127cdc1f6804" +checksum = "031530fe562d8c8d71c0635013d6d155bbfe8ba0aa4b4d2d24ce8af6b71047bd" dependencies = [ "byteorder", - "png 0.11.0", + "png", ] [[package]] @@ -1431,15 +1421,6 @@ dependencies = [ "cfb 0.7.3", ] -[[package]] -name = "inflate" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5f9f47468e9a76a6452271efadc88fe865a82be91fe75e6c0c57b87ccea59d4" -dependencies = [ - "adler32", -] - [[package]] name = "instant" version = "0.1.12" @@ -1541,7 +1522,19 @@ checksum = "f995a3c8f2bc3dd52a18a583e90f9ec109c047fa1603a853e46bcda14d2e279d" dependencies = [ "serde", "serde_json", - "treediff", + "treediff 3.0.2", +] + +[[package]] +name = "json-patch" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e712e62827c382a77b87f590532febb1f8b2fdbc3eefa1ee37fe7281687075ef" +dependencies = [ + "serde", + "serde_json", + "thiserror", + "treediff 4.0.2", ] [[package]] @@ -1891,17 +1884,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "num-iter" -version = "0.1.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - [[package]] name = "num-rational" version = "0.4.1" @@ -2290,7 +2272,7 @@ version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd39bc6cdc9355ad1dc5eeedefee696bb35c34caf21768741e81826c0bbd7225" dependencies = [ - "base64", + "base64 0.13.1", "indexmap", "line-wrap", "serde", @@ -2298,18 +2280,6 @@ dependencies = [ "xml-rs", ] -[[package]] -name = "png" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0b0cabbbd20c2d7f06dbf015e06aad59b6ca3d9ed14848783e98af9aaf19925" -dependencies = [ - "bitflags", - "deflate", - "inflate", - "num-iter", -] - [[package]] name = "png" version = "0.17.7" @@ -2565,7 +2535,7 @@ version = "0.11.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "431949c384f4e2ae07605ccaa56d1d9d2ecdb5cadd4f9577ccfab29f2e5149fc" dependencies = [ - "base64", + "base64 0.13.1", "bytes", "encoding_rs", "futures-core", @@ -2761,18 +2731,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.147" +version = "1.0.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d193d69bae983fc11a79df82342761dfbf28a99fc8d203dca4c3c1b590948965" +checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.147" +version = "1.0.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f1d362ca8fc9c3e3a7484440752472d68a6caa98f1ab81d99b5dfe517cec852" +checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" dependencies = [ "proc-macro2", "quote", @@ -2781,9 +2751,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.87" +version = "1.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce777b7b150d76b9cf60d28b55f5847135a003f7d7350c6be7a773508ce7d45" +checksum = "877c235533714907a8c2464236f5c4b2a17262ef1bd71f38f35ea592c8da6883" dependencies = [ "itoa 1.0.4", "ryu", @@ -3032,9 +3002,9 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.103" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a864042229133ada95abf3b54fdc62ef5ccabe9515b64717bcb9a1919e59445d" +checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" dependencies = [ "proc-macro2", "quote", @@ -3069,9 +3039,8 @@ dependencies = [ [[package]] name = "tao" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2845fd58915455c5faf2c9ac5d8a5ed43bd23ab57f0a67d63612936209eae74" +version = "0.15.8" +source = "git+https://github.com/tauri-apps/tao?branch=dev#b3aa3982d18a1ca2c8f08a135d7256b1aca46369" dependencies = [ "bitflags", "cairo-rs", @@ -3103,11 +3072,11 @@ dependencies = [ "objc", "once_cell", "parking_lot", - "paste", - "png 0.17.7", + "png", "raw-window-handle", "scopeguard", "serde", + "tao-macros", "unicode-segmentation", "uuid 1.2.1", "windows 0.39.0", @@ -3115,6 +3084,16 @@ dependencies = [ "x11-dl", ] +[[package]] +name = "tao-macros" +version = "0.0.0" +source = "git+https://github.com/tauri-apps/tao?branch=dev#b3aa3982d18a1ca2c8f08a135d7256b1aca46369" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tar" version = "0.4.38" @@ -3128,11 +3107,11 @@ dependencies = [ [[package]] name = "tauri" -version = "1.2.0" +version = "1.2.3" dependencies = [ "anyhow", "attohttpc", - "base64", + "base64 0.13.1", "bytes", "clap", "cocoa", @@ -3157,7 +3136,7 @@ dependencies = [ "os_info", "os_pipe", "percent-encoding", - "png 0.17.7", + "png", "rand 0.8.5", "raw-window-handle", "regex", @@ -3190,12 +3169,12 @@ dependencies = [ [[package]] name = "tauri-build" -version = "1.2.0" +version = "1.2.1" dependencies = [ "anyhow", "cargo_toml", "heck 0.4.0", - "json-patch", + "json-patch 0.3.0", "quote", "semver 1.0.14", "serde_json", @@ -3206,14 +3185,14 @@ dependencies = [ [[package]] name = "tauri-codegen" -version = "1.2.0" +version = "1.2.1" dependencies = [ - "base64", + "base64 0.20.0", "brotli", "ico", - "json-patch", + "json-patch 0.3.0", "plist", - "png 0.17.7", + "png", "proc-macro2", "quote", "regex", @@ -3230,7 +3209,7 @@ dependencies = [ [[package]] name = "tauri-macros" -version = "1.2.0" +version = "1.2.1" dependencies = [ "heck 0.4.0", "proc-macro2", @@ -3242,7 +3221,7 @@ dependencies = [ [[package]] name = "tauri-runtime" -version = "0.12.0" +version = "0.12.1" dependencies = [ "gtk", "http", @@ -3253,6 +3232,7 @@ dependencies = [ "serde_json", "tauri-utils", "thiserror", + "url", "uuid 1.2.1", "webview2-com", "windows 0.39.0", @@ -3260,7 +3240,7 @@ dependencies = [ [[package]] name = "tauri-runtime-wry" -version = "0.12.0" +version = "0.12.2" dependencies = [ "cocoa", "gtk", @@ -3278,7 +3258,7 @@ dependencies = [ [[package]] name = "tauri-utils" -version = "1.2.0" +version = "1.2.1" dependencies = [ "aes-gcm", "brotli", @@ -3288,7 +3268,7 @@ dependencies = [ "heck 0.4.0", "html5ever", "infer 0.7.0", - "json-patch", + "json-patch 0.2.6", "kuchiki", "memchr", "phf 0.10.1", @@ -3573,6 +3553,15 @@ dependencies = [ "serde_json", ] +[[package]] +name = "treediff" +version = "4.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52984d277bdf2a751072b5df30ec0377febdb02f7696d64c2d7d54630bac4303" +dependencies = [ + "serde_json", +] + [[package]] name = "try-lock" version = "0.2.3" @@ -4241,11 +4230,10 @@ dependencies = [ [[package]] name = "wry" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "923d297b203eae65b095af16c02978b7932be1968012b4da7138390edf34dea5" +version = "0.23.4" +source = "git+https://github.com/tauri-apps/wry?branch=dev#fca42a0730e75a142f7f354c6ac3f6d6a0f4711f" dependencies = [ - "base64", + "base64 0.13.1", "block", "cocoa", "core-graphics", diff --git a/examples/api/src-tauri/src/desktop.rs b/examples/api/src-tauri/src/desktop.rs index adbfce9a1..aabe918e3 100644 --- a/examples/api/src-tauri/src/desktop.rs +++ b/examples/api/src-tauri/src/desktop.rs @@ -1,7 +1,11 @@ use std::sync::atomic::{AtomicBool, Ordering}; use tauri::{ - api::dialog::ask, CustomMenuItem, GlobalShortcutManager, Manager, RunEvent, SystemTray, - SystemTrayEvent, SystemTrayMenu, WindowBuilder, WindowEvent, WindowUrl, + api::{ + dialog::{ask, MessageDialogBuilder, MessageDialogButtons}, + shell, + }, + CustomMenuItem, GlobalShortcutManager, Manager, RunEvent, SystemTray, SystemTrayEvent, + SystemTrayMenu, WindowBuilder, WindowEvent, WindowUrl, }; pub fn main() { @@ -71,6 +75,7 @@ fn create_tray(app: &tauri::App) -> tauri::Result<()> { tray_menu1 = tray_menu1 .add_item(CustomMenuItem::new("switch_menu", "Switch Menu")) + .add_item(CustomMenuItem::new("about", "About")) .add_item(CustomMenuItem::new("exit_app", "Quit")) .add_item(CustomMenuItem::new("destroy", "Destroy")); @@ -78,6 +83,7 @@ fn create_tray(app: &tauri::App) -> tauri::Result<()> { .add_item(CustomMenuItem::new("toggle", "Toggle")) .add_item(CustomMenuItem::new("new", "New window")) .add_item(CustomMenuItem::new("switch_menu", "Switch Menu")) + .add_item(CustomMenuItem::new("about", "About")) .add_item(CustomMenuItem::new("exit_app", "Quit")) .add_item(CustomMenuItem::new("destroy", "Destroy")); let is_menu1 = AtomicBool::new(true); @@ -87,6 +93,7 @@ fn create_tray(app: &tauri::App) -> tauri::Result<()> { SystemTray::new() .with_id(&tray_id) .with_menu(tray_menu1.clone()) + .with_tooltip("Tauri") .on_event(move |event| { let tray_handle = handle.tray_handle_by_id(&tray_id).unwrap(); match event { @@ -152,15 +159,29 @@ fn create_tray(app: &tauri::App) -> tauri::Result<()> { } "switch_menu" => { let flag = is_menu1.load(Ordering::Relaxed); - tray_handle - .set_menu(if flag { - tray_menu2.clone() - } else { - tray_menu1.clone() - }) - .unwrap(); + let (menu, tooltip) = if flag { + (tray_menu2.clone(), "Menu 2") + } else { + (tray_menu1.clone(), "Tauri") + }; + tray_handle.set_menu(menu).unwrap(); + tray_handle.set_tooltip(tooltip).unwrap(); is_menu1.store(!flag, Ordering::Relaxed); } + "about" => { + let window = handle.get_window("main").unwrap(); + MessageDialogBuilder::new("About app", "Tauri demo app") + .parent(&window) + .buttons(MessageDialogButtons::OkCancelWithLabels( + "Homepage".into(), + "know it".into(), + )) + .show(move |ok| { + if ok { + shell::open(&window.shell_scope(), "https://tauri.app/", None).unwrap(); + } + }); + } _ => {} } } diff --git a/examples/api/src-tauri/src/lib.rs b/examples/api/src-tauri/src/lib.rs index 2e51010a1..46ae9b4e6 100644 --- a/examples/api/src-tauri/src/lib.rs +++ b/examples/api/src-tauri/src/lib.rs @@ -65,7 +65,8 @@ impl AppBuilder { .user_agent("Tauri API") .title("Tauri API Validation") .inner_size(1000., 800.) - .min_inner_size(600., 400.); + .min_inner_size(600., 400.) + .content_protected(true); #[cfg(target_os = "windows")] { diff --git a/examples/api/src-tauri/src/main.rs b/examples/api/src-tauri/src/main.rs index 1ade16f98..542ed35e5 100644 --- a/examples/api/src-tauri/src/main.rs +++ b/examples/api/src-tauri/src/main.rs @@ -1,3 +1,8 @@ +#![cfg_attr( + all(not(debug_assertions), target_os = "windows"), + windows_subsystem = "windows" +)] + #[cfg(desktop)] mod desktop; diff --git a/examples/api/src/views/Window.svelte b/examples/api/src/views/Window.svelte index c117fea65..7ffd6523d 100644 --- a/examples/api/src/views/Window.svelte +++ b/examples/api/src/views/Window.svelte @@ -66,6 +66,7 @@ let maximized = false let decorations = true let alwaysOnTop = false + let contentProtected = true let fullscreen = false let width = null let height = null @@ -182,6 +183,7 @@ : windowMap[selectedWindow]?.unmaximize() $: windowMap[selectedWindow]?.setDecorations(decorations) $: windowMap[selectedWindow]?.setAlwaysOnTop(alwaysOnTop) + $: windowMap[selectedWindow]?.setContentProtected(contentProtected) $: windowMap[selectedWindow]?.setFullscreen(fullscreen) $: width && @@ -286,6 +288,10 @@ Always on top +
+

Welcome to Tauri!

+ +
+ +

+ Click on the Tauri, Vite, and Svelte logos to learn more. +

+ +
+ +
+ +
+ +
{@html response}
+
+ +
+ + diff --git a/tooling/cli/templates/plugin/with-api/examples/tauri-app/src/lib/Greet.svelte b/tooling/cli/templates/plugin/with-api/examples/tauri-app/src/lib/Greet.svelte new file mode 100644 index 000000000..d8a1bd7d6 --- /dev/null +++ b/tooling/cli/templates/plugin/with-api/examples/tauri-app/src/lib/Greet.svelte @@ -0,0 +1,22 @@ + + +
+
+ + +
+

{greetMsg}

+
+ diff --git a/tooling/cli/templates/plugin/with-api/examples/tauri-app/src/main.js b/tooling/cli/templates/plugin/with-api/examples/tauri-app/src/main.js new file mode 100644 index 000000000..6b4e1a969 --- /dev/null +++ b/tooling/cli/templates/plugin/with-api/examples/tauri-app/src/main.js @@ -0,0 +1,8 @@ +import "./style.css"; +import App from "./App.svelte"; + +const app = new App({ + target: document.getElementById("app"), +}); + +export default app; diff --git a/tooling/cli/templates/plugin/with-api/examples/tauri-app/src/style.css b/tooling/cli/templates/plugin/with-api/examples/tauri-app/src/style.css new file mode 100644 index 000000000..c0f9e3bc8 --- /dev/null +++ b/tooling/cli/templates/plugin/with-api/examples/tauri-app/src/style.css @@ -0,0 +1,102 @@ +:root { + font-family: Inter, Avenir, Helvetica, Arial, sans-serif; + font-size: 16px; + line-height: 24px; + font-weight: 400; + + color: #0f0f0f; + background-color: #f6f6f6; + + font-synthesis: none; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + -webkit-text-size-adjust: 100%; +} + +.container { + margin: 0; + padding-top: 10vh; + display: flex; + flex-direction: column; + justify-content: center; + text-align: center; +} + +.logo { + height: 6em; + padding: 1.5em; + will-change: filter; + transition: 0.75s; +} + +.logo.tauri:hover { + filter: drop-shadow(0 0 2em #24c8db); +} + +.row { + display: flex; + justify-content: center; +} + +a { + font-weight: 500; + color: #646cff; + text-decoration: inherit; +} + +a:hover { + color: #535bf2; +} + +h1 { + text-align: center; +} + +input, +button { + border-radius: 8px; + border: 1px solid transparent; + padding: 0.6em 1.2em; + font-size: 1em; + font-weight: 500; + font-family: inherit; + color: #0f0f0f; + background-color: #ffffff; + transition: border-color 0.25s; + box-shadow: 0 2px 2px rgba(0, 0, 0, 0.2); +} + +button { + cursor: pointer; +} + +button:hover { + border-color: #396cd8; +} + +input, +button { + outline: none; +} + +#greet-input { + margin-right: 5px; +} + +@media (prefers-color-scheme: dark) { + :root { + color: #f6f6f6; + background-color: #2f2f2f; + } + + a:hover { + color: #24c8db; + } + + input, + button { + color: #ffffff; + background-color: #0f0f0f98; + } +} diff --git a/tooling/cli/templates/plugin/with-api/examples/tauri-app/src/vite-env.d.ts b/tooling/cli/templates/plugin/with-api/examples/tauri-app/src/vite-env.d.ts new file mode 100644 index 000000000..4078e7476 --- /dev/null +++ b/tooling/cli/templates/plugin/with-api/examples/tauri-app/src/vite-env.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/tooling/cli/templates/plugin/with-api/examples/tauri-app/vite.config.js b/tooling/cli/templates/plugin/with-api/examples/tauri-app/vite.config.js new file mode 100644 index 000000000..714f46d72 --- /dev/null +++ b/tooling/cli/templates/plugin/with-api/examples/tauri-app/vite.config.js @@ -0,0 +1,27 @@ +import { defineConfig } from "vite"; +import { svelte } from "@sveltejs/vite-plugin-svelte"; + +// https://vitejs.dev/config/ +export default defineConfig({ + plugins: [svelte()], + + // Vite optons tailored for Tauri development and only applied in `tauri dev` or `tauri build` + // prevent vite from obscuring rust errors + clearScreen: false, + // tauri expects a fixed port, fail if that port is not available + server: { + port: 1420, + strictPort: true, + }, + // to make use of `TAURI_DEBUG` and other env variables + // https://tauri.studio/v1/api/config#buildconfig.beforedevcommand + envPrefix: ["VITE_", "TAURI_"], + build: { + // Tauri supports es2021 + target: ["es2021", "chrome100", "safari13"], + // don't minify for debug builds + minify: !process.env.TAURI_DEBUG ? "esbuild" : false, + // produce sourcemaps for debug builds + sourcemap: !!process.env.TAURI_DEBUG, + }, +});