From 342867d838a28da0207f435c6c7ba30c413d2b86 Mon Sep 17 00:00:00 2001 From: Preston Wang-Stosur-Bassett Date: Wed, 10 Apr 2024 11:27:51 -0400 Subject: [PATCH 1/3] Fixed missing click events in topbar --- src/native/Cargo.lock | 1 + src/native/Cargo.toml | 1 + src/native/src/main.rs | 92 ++++++++++++++++--- src/native/tauri.conf.json | 4 +- src/views/templates/build/bundle.css.map | 16 ++-- src/views/templates/build/bundle.js | 2 +- src/views/templates/build/bundle.js.map | 2 +- .../components/Navigation/Navigation.svelte | 29 ++++++ 8 files changed, 123 insertions(+), 24 deletions(-) diff --git a/src/native/Cargo.lock b/src/native/Cargo.lock index 5f7c33ac..ea6ca106 100644 --- a/src/native/Cargo.lock +++ b/src/native/Cargo.lock @@ -3621,6 +3621,7 @@ version = "0.0.6" dependencies = [ "chinese_dictionary", "cocoa", + "objc", "serde", "serde_json", "tauri", diff --git a/src/native/Cargo.toml b/src/native/Cargo.toml index 5428c1fd..ee210955 100644 --- a/src/native/Cargo.toml +++ b/src/native/Cargo.toml @@ -20,6 +20,7 @@ tauri = { version = "1.6.0", features = ["api-all", "updater"] } [target.'cfg(target_os = "macos")'.dependencies] cocoa = "0.24.0" +objc = "0.2.7" [features] # by default Tauri runs in production mode diff --git a/src/native/src/main.rs b/src/native/src/main.rs index 8831c886..889fc2e5 100644 --- a/src/native/src/main.rs +++ b/src/native/src/main.rs @@ -11,6 +11,7 @@ use dictionary::{ }; use io::{export_list_data, import_list_data}; use serde::{Deserialize, Serialize}; +use std::sync::{Arc, Mutex}; use tauri::{ api::shell::open as open_browser, CustomMenuItem, Manager, Menu, MenuItem, Runtime, Submenu, Window, WindowEvent, @@ -29,6 +30,12 @@ fn open_character_window(app_handle: tauri::AppHandle, word: CharacterWindowWord character_window.show().unwrap(); } +// Code to set the macOS traffic lights inset. +// Implementation taken from: +// https://github.com/hoppscotch/hoppscotch/blob/main/packages/hoppscotch-selfhost-desktop/src-tauri/src/mac/window.rs +const WINDOW_CONTROL_PAD_X: f64 = 20.0; +const WINDOW_CONTROL_PAD_Y: f64 = 23.0; + pub enum ToolbarThickness { Thick, Medium, @@ -38,6 +45,9 @@ pub enum ToolbarThickness { pub trait WindowExt { #[cfg(target_os = "macos")] fn set_transparent_titlebar(&self, thickness: ToolbarThickness); + + #[cfg(target_os = "macos")] + fn set_window_controls_pos(&self, x: f64, y: f64); } impl WindowExt for Window { @@ -65,6 +75,43 @@ impl WindowExt for Window { } } } + + #[cfg(target_os = "macos")] + fn set_window_controls_pos(&self, x: f64, y: f64) { + use cocoa::{ + appkit::{NSView, NSWindow, NSWindowButton}, + foundation::NSRect, + }; + use objc::{msg_send, sel, sel_impl}; + + unsafe { + let window = self.ns_window().unwrap() as cocoa::base::id; + + let close = window.standardWindowButton_(NSWindowButton::NSWindowCloseButton); + let minimize = window.standardWindowButton_(NSWindowButton::NSWindowMiniaturizeButton); + let maximize = window.standardWindowButton_(NSWindowButton::NSWindowZoomButton); + + let title_bar_container_view = close.superview().superview(); + + let close_rect: NSRect = msg_send![close, frame]; + let button_height = close_rect.size.height; + + let title_bar_frame_height = button_height + y; + let mut title_bar_rect = NSView::frame(title_bar_container_view); + title_bar_rect.size.height = title_bar_frame_height; + title_bar_rect.origin.y = NSView::frame(window).size.height - title_bar_frame_height; + let _: () = msg_send![title_bar_container_view, setFrame: title_bar_rect]; + + let window_buttons = vec![close, minimize, maximize]; + let space_between = NSView::frame(minimize).origin.x - NSView::frame(close).origin.x; + + for (i, button) in window_buttons.into_iter().enumerate() { + let mut rect: NSRect = NSView::frame(button); + rect.origin.x = x + (i as f64 * space_between); + button.setFrameOrigin(rect.origin); + } + } + } } #[cfg(target_os = "macos")] @@ -95,31 +142,50 @@ fn main() { tauri::Builder::default() .setup(|app| { let main_window = app.get_window("main").unwrap(); + let main_window = Arc::new(Mutex::new(main_window)); let character_window = app.get_window("characters").unwrap(); #[cfg(target_os = "macos")] { - main_window.set_transparent_titlebar(ToolbarThickness::Thick); - character_window.set_transparent_titlebar(ToolbarThickness::Medium); + // main_window.set_transparent_titlebar(ToolbarThickness::Thick); + // character_window.set_transparent_titlebar(ToolbarThickness::Medium); + main_window + .lock() + .unwrap() + .set_window_controls_pos(WINDOW_CONTROL_PAD_X, WINDOW_CONTROL_PAD_Y); } #[cfg(debug_assertions)] { - main_window.open_devtools(); + main_window.lock().unwrap().open_devtools(); character_window.open_devtools(); } let handle = app.handle(); - main_window.on_window_event(move |event| { - if let WindowEvent::CloseRequested { .. } = event { - /* TODO(macos): When the app icon is clicked from the dock, open the main window. - * Currently, Tuair doesn't offer a way to capture dock click events, so - * for now we'll just clcose the application when the main window is - * closed, like we do for other platforms. - */ - - // When the main window is closed, emit an exit event. - handle.exit(0); + let main_window_clone = main_window.clone(); + main_window.lock().unwrap().on_window_event(move |event| { + match event { + WindowEvent::CloseRequested { .. } => { + /* TODO(macos): When the app icon is clicked from the dock, open the main window. + * Currently, Tuair doesn't offer a way to capture dock click events, so + * for now we'll just clcose the application when the main window is + * closed, like we do for other platforms. + */ + + // When the main window is closed, emit an exit event. + handle.exit(0); + } + WindowEvent::Resized { .. } => { + // On macOS we want to redraw the traffic lights when the window is resized. + #[cfg(target_os = "macos")] + { + main_window_clone.lock().unwrap().set_window_controls_pos( + WINDOW_CONTROL_PAD_X, + WINDOW_CONTROL_PAD_Y, + ); + } + } + _ => (), } }); diff --git a/src/native/tauri.conf.json b/src/native/tauri.conf.json index 229ba2af..06c88724 100644 --- a/src/native/tauri.conf.json +++ b/src/native/tauri.conf.json @@ -72,7 +72,9 @@ "resizable": true, "title": "Syng", "url": "index.html", - "acceptFirstMouse": true + "acceptFirstMouse": true, + "titleBarStyle": "Overlay", + "hiddenTitle": true }, { "label": "characters", diff --git a/src/views/templates/build/bundle.css.map b/src/views/templates/build/bundle.css.map index edd58574..67adf1e9 100644 --- a/src/views/templates/build/bundle.css.map +++ b/src/views/templates/build/bundle.css.map @@ -32,18 +32,18 @@ "Flashcards.svelte" ], "sourcesContent": [ - "\n\n
\n\t
\n\t\t\n\t
\n\t
\n\t\t\n\t
\n
\n\n\n", + "\n\n
\n\t
\n\t\t\n\t
\n\t
\n\t\t\n\t
\n
\n\n\n", "\n\n
\n\t\n\t\t switchScript('simplified')}\n\t\t>\n\t\t\t\n\t\t\t\tSimplified\n\t\t\t\n\t\t\n\t\t switchScript('traditional')}\n\t\t>\n\t\t\t\n\t\t\t\tTraditional\n\t\t\t\n\t\t\n\t
\n\t
\n\t\t{#if characterNotFound}\n\t\t\t
\n\t\t\t\t

Character Data Not Found

\n\t\t\t\t

\n\t\t\t\t\tThe stroke order data cannot be found for at least one of\n\t\t\t\t\tthe characters in this word.\n\t\t\t\t

\n\t\t\t
\n\t\t{:else}\n\t\t\t
\n\t\t\t\t handleControlButtonClick()}\n\t\t\t\t>\n\t\t\t\t\t\n\t\t\t\t\t\t{#if !activeAnimation}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t{:else}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t{/if}\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t

\n\t\t\t\t\t\t\t{#if activeAnimation}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tPause\n\t\t\t\t\t\t\t{:else if pausedAnimation}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tResume\n\t\t\t\t\t\t\t{:else}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tPlay Stroke Order\n\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t

\n\t\t\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t{/if}\n\t
\n\n\n\n", "\n\n\n\n\n\t{#each characters as character, index}\n\t\t{character}\n\t{/each}\n", "\n\n\n\n
\n\t{#if pattern.test(value) }\n\t\t{ value.split(findPattern(value)) } \n\t\t\n\t\t\t{ getDisplayValue(findPattern(value)) }\n\t\t\n\t{:else}\n\t\t{ value }\n\t{/if}\n
", - "\n\n
\n\t{#if word}\n\t\t
\n\t\t\t\n\t\t\t\n\t\t\t\t{#each actions as action}\n\t\t\t\t\t{#if action.dropdown}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t{#if action.tooltip}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t\t\t\t{action.tooltip}\n\t\t\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t{:else}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t{#if action.tooltip}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t\t\t{action.tooltip}\n\t\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t\n\t\t\t\t\t{/if}\n\t\t\t\t{/each}\n\t\t\t\n\t\t\n\t\t
\n\t\t\t

Definitions

\n\t\t\t\n\t\t
\n\t\t{#if word.measure_words.length}\n\t\t\t
\n\t\t\t\t

Measure Words

\n\t\t\t\t\n\t\t\t
\n\t\t{/if}\n\t\t{#if typeof word.notes === \"string\"}\n\t\t\t
\n\t\t\t\t

Notes

\n\t\t\t\t{word.notes}\n\t\t\t
\n\t\t{/if}\n\t{/if}\n\n\n\n", + "\n\n
\n\t{#if word}\n\t\t
\n\t\t\t\n\t\t\t\n\t\t\t\t{#each actions as action}\n\t\t\t\t\t{#if action.dropdown}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t{#if action.tooltip}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t\t\t\t{action.tooltip}\n\t\t\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t{:else}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t{#if action.tooltip}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t\t\t{action.tooltip}\n\t\t\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t\n\t\t\t\t\t{/if}\n\t\t\t\t{/each}\n\t\t\t\n\t\t\n\t\t
\n\t\t\t

Definitions

\n\t\t\t\n\t\t
\n\t\t{#if word.measure_words.length}\n\t\t\t
\n\t\t\t\t

Measure Words

\n\t\t\t\t\n\t\t\t
\n\t\t{/if}\n\t\t{#if typeof word.notes === 'string'}\n\t\t\t
\n\t\t\t\t

Notes

\n\t\t\t\t{word.notes}\n\t\t\t
\n\t\t{/if}\n\t{/if}\n\n\n\n", "\n\n\n\n\n openLink() } data-testid=\"dictionary-link\">\n\t\n", "\n\n\n\n
\n\t

\n\t\t\n\t\t{#if word.simplified != word.traditional}\n\t\t\t ()\n\t\t{/if}\n\t

\n\t
\n\t\t

\n\t\t\t{word.pinyin_marks}\n\t\t

\n\t
\n
", "\n\n\n\n
\n\t\n\t\t{ value.simplified }\n\t\t{#if value.simplified != value.traditional}\n\t\t ({value.traditional})\n\t\t{/if}\n\t\n
", - "\n\n\n\t\n\t\t{#each primaryNavigation as navItem}\n\t\t\t{#if !navItem.beta || enableBetaFeatures}\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t

\n\t\t\t\t\t\t\t{navItem.title}\n\t\t\t\t\t\t

\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t{/if}\n\t\t{/each}\n\t\n\t
\n\t\t{#each secondaryNavigation as navItem}\n\t\t\t{#if !navItem.beta || enableBetaFeatures}\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t

\n\t\t\t\t\t\t\t{navItem.title}\n\t\t\t\t\t\t

\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t{/if}\n\t\t{/each}\n\t
\n\n\n\n", + "\n\n\n\t\n\t\t{#each primaryNavigation as navItem}\n\t\t\t{#if !navItem.beta || enableBetaFeatures}\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t

\n\t\t\t\t\t\t\t{navItem.title}\n\t\t\t\t\t\t

\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t{/if}\n\t\t{/each}\n\t\n\t
\n\t\t{#each secondaryNavigation as navItem}\n\t\t\t{#if !navItem.beta || enableBetaFeatures}\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t

\n\t\t\t\t\t\t\t{navItem.title}\n\t\t\t\t\t\t

\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t{/if}\n\t\t{/each}\n\t
\n\n\n\n", "\n\n\n\n
\n\t{#each tones as tone}\n\t\t
\n\t\t\t\n\t\t\t handleUpdate(tone.index) }>\n\t\t
\n\t{/each}\n
", "\n\n\n\n
\n{#if !knownStatus}\n\t{#if checking}\n\t\t\n\t\t\n\t\t\tChecking for updates...\n\t\t\n\t{:else}\n\t\t\n\t\t updateStatus() }>\n\t\t\tCheck for updates\n\t\t\n\t{/if}\n{:else}\n\t{#if updateAvailable}\n\t\t\n\t
\n\t\t\t\n\t\t\t\tUpdate available\n\t\t\t\n\t\t\t\n\t\t\t\tVersion { updateVersion }
\n\t\t\t\tRelease Notes: { releaseNotes }\n\t\t\t
\n\t\t\t\n\t\t\t\t fetchUpdate() } disabled={ updating }>\n\t\t\t\t\t{#if !updating }\n\t\t\t\t\t\tUpdate\n\t\t\t\t\t{:else}\n\t\t\t\t\t\tUpdating...\n\t\t\t\t\t{/if}\n\t\t\t\t\n\t\t\t\n\t\t
\n\t{:else}\n\t\t\n\t\t
\n\t\t\t\n\t\t\t\tYou are up to date\n\t\t\t\n\t\t\t\n\t\t\t\tVersion { currentVersion }\n\t\t\t\n\t\t
\n\t{/if}\n{/if}\n
", - "\n\n
\n \n {value}\n \n \n {#each actions as action}\n \n \n
\n

\n {action.tooltip}\n

\n
\n \n {/each}\n
\n
\n\n\n", + "\n\n
\n \n {value}\n \n \n {#each actions as action}\n \n \n
\n

\n {action.tooltip}\n

\n
\n \n {/each}\n
\n
\n\n\n", "\n\n\n\n", "\n\n\n\n
\n\t\n
", "\n\n\n\n
", @@ -55,12 +55,12 @@ "\n\n\n\n
\n\t
\n\t\t
\n\t\t\t

{ title }

\n\t\t\t { dispatch('close', e); } }\">\n\t\t\t\t\n\t\t\t\n\t\t
\n\t\t
\n\t\t\t\n\t\t
\n\t\t
\n\t\t\t\n\t\t
\n\t
\n\t
\n
", "\n\n\n\n dispatch('change', e.srcElement.value) } on:keyup={ handleKeyup }/>", "\n\n\n\n\n\t dispatch('change', e.srcElement.checked) } />\n\t\n", - "\n\n
\n\t\n\t\t\n\t\t\t\n\t\t\t\t{activeList} \n\t\t\t\n\t\t\n\t\t
\n\t\t\t{#each actions as action}\n\t\t\t\t{#if !action.exclude.includes(activeList)}\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t

{action.tooltip}

\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t{/if}\n\t\t\t{/each}\n\t\t
\n\t\n\t
\n\t\t
\n\t\t\t\n\t\t
\n\t\t
\n\t\t\t\n\t\t
\n\t
\n\t\n\t\t
\n\t\t\t

What would you like to call this list?

\n\t\t\t\n\t\t
\n\t\t\n\t\t\tCancel\n\t\t\t \n\t\t\t\n\t\t\t\tCreate\n\t\t\t\n\t\t\n\t\n\n\n\n", + "\n\n
\n\t\n\t\t\n\t\t\t\n\t\t\t\t{activeList} \n\t\t\t\n\t\t\n\t\t
\n\t\t\t{#each actions as action}\n\t\t\t\t{#if !action.exclude.includes(activeList)}\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t

{action.tooltip}

\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t{/if}\n\t\t\t{/each}\n\t\t
\n\t\n\t
\n\t\t
\n\t\t\t\n\t\t
\n\t\t
\n\t\t\t\n\t\t
\n\t
\n\t\n\t\t
\n\t\t\t

What would you like to call this list?

\n\t\t\t\n\t\t
\n\t\t\n\t\t\tCancel\n\t\t\t \n\t\t\t\n\t\t\t\tCreate\n\t\t\t\n\t\t\n\t\n\n\n\n", "\n\n\n\n
\n\t
\n\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\n\t\t switchLang() }>\n\t\t\t{ searchLang }\n\t\t\n\t\t query(e.detail, true) } on:keyup={ e => query(e.detail, false) } on:enter={ handleEnter } />\n\t
\n\t
\n\t\t
\n\t\t\t\n\t\t
\n\t\t
\n\t\t\t\n\t\t
\n\t
\n
", "\n\n\n\n
\n\t
\n\t\t

Settings

\n\t
\n\t
\n\t\t{#each preferences as preference}\n\t\t\t
\n\t\t\t\t

{ preference.label }

\n\t\t\t\t\n\t\t\t
\n\t\t{/each}\n\t
\n
", - "\n\n
\n\t\n\t\t

Study

\n\t
\n\t
\n\t\t{#if populatedLists.length}\n\t\t\t\n\t\t{:else}\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\tTo take a quiz or study flashcards, add vocab words to your\n\t\t\t\t\tlists.\n\t\t\t\t\n\t\t\t
\n\t\t{/if}\n\t
\n\n\n\n", - "\n\n
\n \n
\n {#each leftActions as action}\n \n \n  \n {action.label}\n \n {/each}\n
\n
\n {#each rightActions as action}\n \n {action.label}\n  \n \n \n {/each}\n
\n
\n
\n {#if showDetails}\n
\n
\n \n
\n
\n {:else}\n
\n {#if listContent.length > 0}\n

\n {listContent[activeIndex]\n .simplified} ({listContent[activeIndex]\n .traditional})\n

\n {:else}\n

\n {loading ? LOADING_LIST_MESSAGE : EMPTY_LIST_MESSAGE}\n

\n {/if}\n
\n {/if}\n
\n\n\n\n" + "\n\n
\n\t\n\t\t

Study

\n\t
\n\t
\n\t\t{#if populatedLists.length}\n\t\t\t\n\t\t{:else}\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\tTo take a quiz or study flashcards, add vocab words to your\n\t\t\t\t\tlists.\n\t\t\t\t\n\t\t\t
\n\t\t{/if}\n\t
\n\n\n\n", + "\n\n
\n \n
\n {#each leftActions as action}\n \n \n  \n {action.label}\n \n {/each}\n
\n
\n {#each rightActions as action}\n \n {action.label}\n  \n \n \n {/each}\n
\n
\n
\n {#if showDetails}\n
\n
\n \n
\n
\n {:else}\n
\n {#if listContent.length > 0}\n

\n {listContent[activeIndex]\n .simplified} ({listContent[activeIndex]\n .traditional})\n

\n {:else}\n

\n {loading ? LOADING_LIST_MESSAGE : EMPTY_LIST_MESSAGE}\n

\n {/if}\n
\n {/if}\n
\n\n\n\n" ], "names": [], - "mappings": "AA0CC,6BAAe,CACd,OAAO,CAAE,IAAI,CACb,MAAM,CAAE,KAAK,CACb,QAAQ,CAAE,MACX,CACA,oCAAsB,CACrB,OAAO,CAAE,IAAI,CACb,IAAI,CAAE,CAAC,CACP,SAAS,CAAE,IAAI,CACf,SAAS,CAAE,IACZ,CACA,iCAAmB,CAClB,OAAO,CAAE,IAAI,CACb,IAAI,CAAE,EACP;AC4IA,yCAA4B,CAC3B,OAAO,CAAE,IAAI,CACb,cAAc,CAAE,MAAM,CACtB,MAAM,CAAE,KAAK,CACb,KAAK,CAAE,IACR,CACA,wCAA2B,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AO,CAAE,IAAI,oBAAoB,CACrC,CACA,+CAAkB,CACd,OAAO,CAAE,IAAI,CACb,WAAW,CAAE,MAAM,CACnB,eAAe,CAAE,MAAM,CACvB,KAAK,CAAE,IAAI,CACX,MAAM,CAAE,IACZ,CACA,gCAAiB,CAAC,iBAAG,CACjB,SAAS,CAAE,IAAI,CACf,WAAW,CAAE,GAAG,CAChB,aAAa,CAAE,IACnB,CACA,8CAAiB,CACb,MAAM,CAAE,IAAI,iBAAiB,CAAC,CAAC,IAAI,uBAAuB,CAAC,CAC3D,KAAK,CAAE,IAAI,CACX,OAAO,CAAE,IAAI,CACb,eAAe,CAAE,MACrB,CACA,yDAA4B,CACxB,KAAK,CAAE,IAAI,CACX,OAAO,CAAE,IACb" } \ No newline at end of file diff --git a/src/views/templates/build/bundle.js b/src/views/templates/build/bundle.js index 1ea56280..04f8a80b 100644 --- a/src/views/templates/build/bundle.js +++ b/src/views/templates/build/bundle.js @@ -1,2 +1,2 @@ -var app=function(){"use strict";function t(){}function e(t,e){for(const n in e)t[n]=e[n];return t}function n(t){return t()}function r(){return Object.create(null)}function s(t){t.forEach(n)}function o(t){return"function"==typeof t}function i(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function a(e,...n){if(null==e)return t;const r=e.subscribe(...n);return r.unsubscribe?()=>r.unsubscribe():r}function l(t,e,n,r){if(t){const s=c(t,e,n,r);return t[0](s)}}function c(t,n,r,s){return t[1]&&s?e(r.ctx.slice(),t[1](s(n))):r.ctx}function h(t,e,n,r){if(t[2]&&r){const s=t[2](r(n));if(void 0===e.dirty)return s;if("object"==typeof s){const t=[],n=Math.max(e.dirty.length,s.length);for(let r=0;r32){const e=[],n=t.ctx.length/32;for(let t=0;tt.removeEventListener(e,n,r)}function C(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function z(t,e){e=""+e,t.data!==e&&(t.data=e)}function S(t,e,n){t.classList[n?"add":"remove"](e)}function P(t,e){return new t(e)}let T;function E(t){T=t}function W(){if(!T)throw new Error("Function called outside component initialization");return T}function M(t){W().$$.on_destroy.push(t)}function D(){const t=W();return(e,n,{cancelable:r=!1}={})=>{const s=t.$$.callbacks[e];if(s){const o=function(t,e,{bubbles:n=!1,cancelable:r=!1}={}){const s=document.createEvent("CustomEvent");return s.initCustomEvent(t,n,r,e),s}(e,n,{cancelable:r});return s.slice().forEach((e=>{e.call(t,o)})),!o.defaultPrevented}return!0}}function L(t,e){const n=t.$$.callbacks[e.type];n&&n.slice().forEach((t=>t.call(this,e)))}const A=[],R=[];let I=[];const B=[],j=Promise.resolve();let O=!1;function N(){O||(O=!0,j.then(V))}function q(){return N(),j}function F(t){I.push(t)}const H=new Set;let U=0;function V(){if(0!==U)return;const t=T;do{try{for(;U{Q.delete(t),r&&(n&&t.d(1),r())})),t.o(e)}else r&&r()}function tt(t,e){const n={},r={},s={$$scope:1};let o=t.length;for(;o--;){const i=t[o],a=e[o];if(a){for(const t in i)t in a||(r[t]=1);for(const t in a)s[t]||(n[t]=a[t],s[t]=1);t[o]=a}else for(const t in i)s[t]=1}for(const t in r)t in n||(n[t]=void 0);return n}function et(t){return"object"==typeof t&&null!==t?t:{}}function nt(t){t&&t.c()}function rt(t,e,r,i){const{fragment:a,after_update:l}=t.$$;a&&a.m(e,r),i||F((()=>{const e=t.$$.on_mount.map(n).filter(o);t.$$.on_destroy?t.$$.on_destroy.push(...e):s(e),t.$$.on_mount=[]})),l.forEach(F)}function st(t,e){const n=t.$$;null!==n.fragment&&(!function(t){const e=[],n=[];I.forEach((r=>-1===t.indexOf(r)?e.push(r):n.push(r))),n.forEach((t=>t())),I=e}(n.after_update),s(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function ot(e,n,o,i,a,l,c,h=[-1]){const d=T;E(e);const u=e.$$={fragment:null,ctx:[],props:l,update:t,not_equal:a,bound:r(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(n.context||(d?d.$$.context:[])),callbacks:r(),dirty:h,skip_bound:!1,root:n.target||d.$$.root};c&&c(u.root);let p=!1;if(u.ctx=o?o(e,n.props||{},((t,n,...r)=>{const s=r.length?r[0]:n;return u.ctx&&a(u.ctx[t],u.ctx[t]=s)&&(!u.skip_bound&&u.bound[t]&&u.bound[t](s),p&&function(t,e){-1===t.$$.dirty[0]&&(A.push(t),N(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const t=r.indexOf(n);-1!==t&&r.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const at=[];function lt(t,e){return{subscribe:ct(t,e).subscribe}}function ct(e,n=t){let r;const s=new Set;function o(t){if(i(e,t)&&(e=t,r)){const t=!at.length;for(const t of s)t[1](),at.push(t,e);if(t){for(let t=0;t{s.delete(l),0===s.size&&r&&(r(),r=null)}}}}function ht(e,n,r){const i=!Array.isArray(e),l=i?[e]:e,c=n.length<2;return lt(r,(e=>{let r=!1;const h=[];let d=0,u=t;const p=()=>{if(d)return;u();const r=n(i?h[0]:h,e);c?e(r):u=o(r)?r:t},f=l.map(((t,e)=>a(t,(t=>{h[e]=t,d&=~(1<{d|=1<{st(t,1)})),K()}i?(n=P(i,a()),n.$on("routeEvent",t[7]),nt(n.$$.fragment),J(n.$$.fragment,1),rt(n,r.parentNode,r)):n=null}else i&&n.$set(s)},i(t){s||(n&&J(n.$$.fragment,t),s=!0)},o(t){n&&Z(n.$$.fragment,t),s=!1},d(t){t&&$(r),n&&st(n,t)}}}function pt(t){let n,r,s;const o=[{params:t[1]},t[2]];var i=t[0];function a(t){let n={};for(let t=0;t{st(t,1)})),K()}i?(n=P(i,a()),n.$on("routeEvent",t[6]),nt(n.$$.fragment),J(n.$$.fragment,1),rt(n,r.parentNode,r)):n=null}else i&&n.$set(s)},i(t){s||(n&&J(n.$$.fragment,t),s=!0)},o(t){n&&Z(n.$$.fragment,t),s=!1},d(t){t&&$(r),n&&st(n,t)}}}function ft(t){let e,n,r,s;const o=[pt,ut],i=[];function a(t,e){return t[1]?0:1}return e=a(t),n=i[e]=o[e](t),{c(){n.c(),r=x()},m(t,n){i[e].m(t,n),m(t,r,n),s=!0},p(t,[s]){let l=e;e=a(t),e===l?i[e].p(t,s):(G(),Z(i[l],1,1,(()=>{i[l]=null})),K(),n=i[e],n?n.p(t,s):(n=i[e]=o[e](t),n.c()),J(n,1),n.m(r.parentNode,r))},i(t){s||(J(n),s=!0)},o(t){Z(n),s=!1},d(t){i[e].d(t),t&&$(r)}}}function gt(){const t=window.location.href.indexOf("#/");let e=t>-1?window.location.href.substr(t+1):"/";const n=e.indexOf("?");let r="";return n>-1&&(r=e.substr(n+1),e=e.substr(0,n)),{location:e,querystring:r}}const mt=lt(null,(function(t){t(gt());const e=()=>{t(gt())};return window.addEventListener("hashchange",e,!1),function(){window.removeEventListener("hashchange",e,!1)}}));ht(mt,(t=>t.location));const $t=ht(mt,(t=>t.querystring)),wt=ct(void 0);function vt(t,e,n){let{routes:r={}}=e,{prefix:s=""}=e,{restoreScrollState:o=!1}=e;class i{constructor(t,e){if(!e||"function"!=typeof e&&("object"!=typeof e||!0!==e._sveltesparouter))throw Error("Invalid component object");if(!t||"string"==typeof t&&(t.length<1||"/"!=t.charAt(0)&&"*"!=t.charAt(0))||"object"==typeof t&&!(t instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:n,keys:r}=dt(t);this.path=t,"object"==typeof e&&!0===e._sveltesparouter?(this.component=e.component,this.conditions=e.conditions||[],this.userData=e.userData,this.props=e.props||{}):(this.component=()=>Promise.resolve(e),this.conditions=[],this.props={}),this._pattern=n,this._keys=r}match(t){if(s)if("string"==typeof s){if(!t.startsWith(s))return null;t=t.substr(s.length)||"/"}else if(s instanceof RegExp){const e=t.match(s);if(!e||!e[0])return null;t=t.substr(e[0].length)||"/"}const e=this._pattern.exec(t);if(null===e)return null;if(!1===this._keys)return e;const n={};let r=0;for(;r{a.push(new i(e,t))})):Object.keys(r).forEach((t=>{a.push(new i(t,r[t]))}));let l=null,c=null,h={};const d=D();async function u(t,e){await q(),d(t,e)}let p=null,f=null;var g;o&&(f=t=>{p=t.state&&(t.state.__svelte_spa_router_scrollY||t.state.__svelte_spa_router_scrollX)?t.state:null},window.addEventListener("popstate",f),g=()=>{var t;(t=p)?window.scrollTo(t.__svelte_spa_router_scrollX,t.__svelte_spa_router_scrollY):window.scrollTo(0,0)},W().$$.after_update.push(g));let m=null,$=null;const w=mt.subscribe((async t=>{m=t;let e=0;for(;e{wt.set(c)}))}n(0,l=null),$=null,wt.set(void 0)}));return M((()=>{w(),f&&window.removeEventListener("popstate",f)})),t.$$set=t=>{"routes"in t&&n(3,r=t.routes),"prefix"in t&&n(4,s=t.prefix),"restoreScrollState"in t&&n(5,o=t.restoreScrollState)},t.$$.update=()=>{32&t.$$.dirty&&(history.scrollRestoration=o?"manual":"auto")},[l,c,h,r,s,o,function(e){L.call(this,t,e)},function(e){L.call(this,t,e)}]}class kt extends it{constructor(t){super(),ot(this,t,vt,ft,i,{routes:3,prefix:4,restoreScrollState:5})}}function _t(e){let n,r,s,o;return{c(){n=k("svg"),r=k("line"),s=k("polyline"),C(r,"x1","19"),C(r,"y1","12"),C(r,"x2","5"),C(r,"y2","12"),C(s,"points","12 19 5 12 12 5"),C(n,"xmlns","http://www.w3.org/2000/svg"),C(n,"width",e[0]),C(n,"height",e[0]),C(n,"fill","none"),C(n,"viewBox","0 0 24 24"),C(n,"stroke","currentColor"),C(n,"stroke-width",e[1]),C(n,"stroke-linecap","round"),C(n,"stroke-linejoin","round"),C(n,"class",o="feather feather-arrow-left "+e[2])},m(t,e){m(t,n,e),g(n,r),g(n,s)},p(t,[e]){1&e&&C(n,"width",t[0]),1&e&&C(n,"height",t[0]),2&e&&C(n,"stroke-width",t[1]),4&e&&o!==(o="feather feather-arrow-left "+t[2])&&C(n,"class",o)},i:t,o:t,d(t){t&&$(n)}}}function yt(t,e,n){let{size:r="24"}=e,{strokeWidth:s=2}=e,{class:o=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,s=t.strokeWidth),"class"in t&&n(2,o=t.class)},[r,s,o]}class xt extends it{constructor(t){super(),ot(this,t,yt,_t,i,{size:0,strokeWidth:1,class:2})}}function bt(e){let n,r,s,o;return{c(){n=k("svg"),r=k("line"),s=k("polyline"),C(r,"x1","5"),C(r,"y1","12"),C(r,"x2","19"),C(r,"y2","12"),C(s,"points","12 5 19 12 12 19"),C(n,"xmlns","http://www.w3.org/2000/svg"),C(n,"width",e[0]),C(n,"height",e[0]),C(n,"fill","none"),C(n,"viewBox","0 0 24 24"),C(n,"stroke","currentColor"),C(n,"stroke-width",e[1]),C(n,"stroke-linecap","round"),C(n,"stroke-linejoin","round"),C(n,"class",o="feather feather-arrow-right "+e[2])},m(t,e){m(t,n,e),g(n,r),g(n,s)},p(t,[e]){1&e&&C(n,"width",t[0]),1&e&&C(n,"height",t[0]),2&e&&C(n,"stroke-width",t[1]),4&e&&o!==(o="feather feather-arrow-right "+t[2])&&C(n,"class",o)},i:t,o:t,d(t){t&&$(n)}}}function Ct(t,e,n){let{size:r="24"}=e,{strokeWidth:s=2}=e,{class:o=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,s=t.strokeWidth),"class"in t&&n(2,o=t.class)},[r,s,o]}class zt extends it{constructor(t){super(),ot(this,t,Ct,bt,i,{size:0,strokeWidth:1,class:2})}}function St(e){let n,r,s,o;return{c(){n=k("svg"),r=k("path"),s=k("path"),C(r,"d","M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"),C(s,"d","M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"),C(n,"xmlns","http://www.w3.org/2000/svg"),C(n,"width",e[0]),C(n,"height",e[0]),C(n,"fill","none"),C(n,"viewBox","0 0 24 24"),C(n,"stroke","currentColor"),C(n,"stroke-width",e[1]),C(n,"stroke-linecap","round"),C(n,"stroke-linejoin","round"),C(n,"class",o="feather feather-book-open "+e[2])},m(t,e){m(t,n,e),g(n,r),g(n,s)},p(t,[e]){1&e&&C(n,"width",t[0]),1&e&&C(n,"height",t[0]),2&e&&C(n,"stroke-width",t[1]),4&e&&o!==(o="feather feather-book-open "+t[2])&&C(n,"class",o)},i:t,o:t,d(t){t&&$(n)}}}function Pt(t,e,n){let{size:r="24"}=e,{strokeWidth:s=2}=e,{class:o=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,s=t.strokeWidth),"class"in t&&n(2,o=t.class)},[r,s,o]}class Tt extends it{constructor(t){super(),ot(this,t,Pt,St,i,{size:0,strokeWidth:1,class:2})}}function Et(e){let n,r,s;return{c(){n=k("svg"),r=k("path"),C(r,"d","M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z"),C(n,"xmlns","http://www.w3.org/2000/svg"),C(n,"width",e[0]),C(n,"height",e[0]),C(n,"fill","none"),C(n,"viewBox","0 0 24 24"),C(n,"stroke","currentColor"),C(n,"stroke-width",e[1]),C(n,"stroke-linecap","round"),C(n,"stroke-linejoin","round"),C(n,"class",s="feather feather-bookmark "+e[2])},m(t,e){m(t,n,e),g(n,r)},p(t,[e]){1&e&&C(n,"width",t[0]),1&e&&C(n,"height",t[0]),2&e&&C(n,"stroke-width",t[1]),4&e&&s!==(s="feather feather-bookmark "+t[2])&&C(n,"class",s)},i:t,o:t,d(t){t&&$(n)}}}function Wt(t,e,n){let{size:r="24"}=e,{strokeWidth:s=2}=e,{class:o=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,s=t.strokeWidth),"class"in t&&n(2,o=t.class)},[r,s,o]}class Mt extends it{constructor(t){super(),ot(this,t,Wt,Et,i,{size:0,strokeWidth:1,class:2})}}function Dt(e){let n,r,s;return{c(){n=k("svg"),r=k("polyline"),C(r,"points","20 6 9 17 4 12"),C(n,"xmlns","http://www.w3.org/2000/svg"),C(n,"width",e[0]),C(n,"height",e[0]),C(n,"fill","none"),C(n,"viewBox","0 0 24 24"),C(n,"stroke","currentColor"),C(n,"stroke-width",e[1]),C(n,"stroke-linecap","round"),C(n,"stroke-linejoin","round"),C(n,"class",s="feather feather-check "+e[2])},m(t,e){m(t,n,e),g(n,r)},p(t,[e]){1&e&&C(n,"width",t[0]),1&e&&C(n,"height",t[0]),2&e&&C(n,"stroke-width",t[1]),4&e&&s!==(s="feather feather-check "+t[2])&&C(n,"class",s)},i:t,o:t,d(t){t&&$(n)}}}function Lt(t,e,n){let{size:r="24"}=e,{strokeWidth:s=2}=e,{class:o=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,s=t.strokeWidth),"class"in t&&n(2,o=t.class)},[r,s,o]}class At extends it{constructor(t){super(),ot(this,t,Lt,Dt,i,{size:0,strokeWidth:1,class:2})}}function Rt(e){let n,r,s;return{c(){n=k("svg"),r=k("polyline"),C(r,"points","6 9 12 15 18 9"),C(n,"xmlns","http://www.w3.org/2000/svg"),C(n,"width",e[0]),C(n,"height",e[0]),C(n,"fill","none"),C(n,"viewBox","0 0 24 24"),C(n,"stroke","currentColor"),C(n,"stroke-width",e[1]),C(n,"stroke-linecap","round"),C(n,"stroke-linejoin","round"),C(n,"class",s="feather feather-chevron-down "+e[2])},m(t,e){m(t,n,e),g(n,r)},p(t,[e]){1&e&&C(n,"width",t[0]),1&e&&C(n,"height",t[0]),2&e&&C(n,"stroke-width",t[1]),4&e&&s!==(s="feather feather-chevron-down "+t[2])&&C(n,"class",s)},i:t,o:t,d(t){t&&$(n)}}}function It(t,e,n){let{size:r="24"}=e,{strokeWidth:s=2}=e,{class:o=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,s=t.strokeWidth),"class"in t&&n(2,o=t.class)},[r,s,o]}class Bt extends it{constructor(t){super(),ot(this,t,It,Rt,i,{size:0,strokeWidth:1,class:2})}}function jt(e){let n,r,s;return{c(){n=k("svg"),r=k("polyline"),C(r,"points","15 18 9 12 15 6"),C(n,"xmlns","http://www.w3.org/2000/svg"),C(n,"width",e[0]),C(n,"height",e[0]),C(n,"fill","none"),C(n,"viewBox","0 0 24 24"),C(n,"stroke","currentColor"),C(n,"stroke-width",e[1]),C(n,"stroke-linecap","round"),C(n,"stroke-linejoin","round"),C(n,"class",s="feather feather-chevron-left "+e[2])},m(t,e){m(t,n,e),g(n,r)},p(t,[e]){1&e&&C(n,"width",t[0]),1&e&&C(n,"height",t[0]),2&e&&C(n,"stroke-width",t[1]),4&e&&s!==(s="feather feather-chevron-left "+t[2])&&C(n,"class",s)},i:t,o:t,d(t){t&&$(n)}}}function Ot(t,e,n){let{size:r="24"}=e,{strokeWidth:s=2}=e,{class:o=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,s=t.strokeWidth),"class"in t&&n(2,o=t.class)},[r,s,o]}class Nt extends it{constructor(t){super(),ot(this,t,Ot,jt,i,{size:0,strokeWidth:1,class:2})}}function qt(e){let n,r,s;return{c(){n=k("svg"),r=k("polyline"),C(r,"points","9 18 15 12 9 6"),C(n,"xmlns","http://www.w3.org/2000/svg"),C(n,"width",e[0]),C(n,"height",e[0]),C(n,"fill","none"),C(n,"viewBox","0 0 24 24"),C(n,"stroke","currentColor"),C(n,"stroke-width",e[1]),C(n,"stroke-linecap","round"),C(n,"stroke-linejoin","round"),C(n,"class",s="feather feather-chevron-right "+e[2])},m(t,e){m(t,n,e),g(n,r)},p(t,[e]){1&e&&C(n,"width",t[0]),1&e&&C(n,"height",t[0]),2&e&&C(n,"stroke-width",t[1]),4&e&&s!==(s="feather feather-chevron-right "+t[2])&&C(n,"class",s)},i:t,o:t,d(t){t&&$(n)}}}function Ft(t,e,n){let{size:r="24"}=e,{strokeWidth:s=2}=e,{class:o=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,s=t.strokeWidth),"class"in t&&n(2,o=t.class)},[r,s,o]}class Ht extends it{constructor(t){super(),ot(this,t,Ft,qt,i,{size:0,strokeWidth:1,class:2})}}function Ut(e){let n,r,s,o;return{c(){n=k("svg"),r=k("rect"),s=k("path"),C(r,"x","9"),C(r,"y","9"),C(r,"width","13"),C(r,"height","13"),C(r,"rx","2"),C(r,"ry","2"),C(s,"d","M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"),C(n,"xmlns","http://www.w3.org/2000/svg"),C(n,"width",e[0]),C(n,"height",e[0]),C(n,"fill","none"),C(n,"viewBox","0 0 24 24"),C(n,"stroke","currentColor"),C(n,"stroke-width",e[1]),C(n,"stroke-linecap","round"),C(n,"stroke-linejoin","round"),C(n,"class",o="feather feather-copy "+e[2])},m(t,e){m(t,n,e),g(n,r),g(n,s)},p(t,[e]){1&e&&C(n,"width",t[0]),1&e&&C(n,"height",t[0]),2&e&&C(n,"stroke-width",t[1]),4&e&&o!==(o="feather feather-copy "+t[2])&&C(n,"class",o)},i:t,o:t,d(t){t&&$(n)}}}function Vt(t,e,n){let{size:r="24"}=e,{strokeWidth:s=2}=e,{class:o=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,s=t.strokeWidth),"class"in t&&n(2,o=t.class)},[r,s,o]}class Yt extends it{constructor(t){super(),ot(this,t,Vt,Ut,i,{size:0,strokeWidth:1,class:2})}}function Qt(e){let n,r,s,o,i;return{c(){n=k("svg"),r=k("path"),s=k("polyline"),o=k("line"),C(r,"d","M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"),C(s,"points","7 10 12 15 17 10"),C(o,"x1","12"),C(o,"y1","15"),C(o,"x2","12"),C(o,"y2","3"),C(n,"xmlns","http://www.w3.org/2000/svg"),C(n,"width",e[0]),C(n,"height",e[0]),C(n,"fill","none"),C(n,"viewBox","0 0 24 24"),C(n,"stroke","currentColor"),C(n,"stroke-width",e[1]),C(n,"stroke-linecap","round"),C(n,"stroke-linejoin","round"),C(n,"class",i="feather feather-download "+e[2])},m(t,e){m(t,n,e),g(n,r),g(n,s),g(n,o)},p(t,[e]){1&e&&C(n,"width",t[0]),1&e&&C(n,"height",t[0]),2&e&&C(n,"stroke-width",t[1]),4&e&&i!==(i="feather feather-download "+t[2])&&C(n,"class",i)},i:t,o:t,d(t){t&&$(n)}}}function Xt(t,e,n){let{size:r="24"}=e,{strokeWidth:s=2}=e,{class:o=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,s=t.strokeWidth),"class"in t&&n(2,o=t.class)},[r,s,o]}class Gt extends it{constructor(t){super(),ot(this,t,Xt,Qt,i,{size:0,strokeWidth:1,class:2})}}function Kt(e){let n,r,s,o,i;return{c(){n=k("svg"),r=k("circle"),s=k("path"),o=k("line"),C(r,"cx","12"),C(r,"cy","12"),C(r,"r","10"),C(s,"d","M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"),C(o,"x1","12"),C(o,"y1","17"),C(o,"x2","12.01"),C(o,"y2","17"),C(n,"xmlns","http://www.w3.org/2000/svg"),C(n,"width",e[0]),C(n,"height",e[0]),C(n,"fill","none"),C(n,"viewBox","0 0 24 24"),C(n,"stroke","currentColor"),C(n,"stroke-width",e[1]),C(n,"stroke-linecap","round"),C(n,"stroke-linejoin","round"),C(n,"class",i="feather feather-help-circle "+e[2])},m(t,e){m(t,n,e),g(n,r),g(n,s),g(n,o)},p(t,[e]){1&e&&C(n,"width",t[0]),1&e&&C(n,"height",t[0]),2&e&&C(n,"stroke-width",t[1]),4&e&&i!==(i="feather feather-help-circle "+t[2])&&C(n,"class",i)},i:t,o:t,d(t){t&&$(n)}}}function Jt(t,e,n){let{size:r="24"}=e,{strokeWidth:s=2}=e,{class:o=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,s=t.strokeWidth),"class"in t&&n(2,o=t.class)},[r,s,o]}class Zt extends it{constructor(t){super(),ot(this,t,Jt,Kt,i,{size:0,strokeWidth:1,class:2})}}function te(e){let n,r,s,o,i,a;return{c(){n=k("svg"),r=k("polyline"),s=k("polyline"),o=k("line"),i=k("line"),C(r,"points","15 3 21 3 21 9"),C(s,"points","9 21 3 21 3 15"),C(o,"x1","21"),C(o,"y1","3"),C(o,"x2","14"),C(o,"y2","10"),C(i,"x1","3"),C(i,"y1","21"),C(i,"x2","10"),C(i,"y2","14"),C(n,"xmlns","http://www.w3.org/2000/svg"),C(n,"width",e[0]),C(n,"height",e[0]),C(n,"fill","none"),C(n,"viewBox","0 0 24 24"),C(n,"stroke","currentColor"),C(n,"stroke-width",e[1]),C(n,"stroke-linecap","round"),C(n,"stroke-linejoin","round"),C(n,"class",a="feather feather-maximize-2 "+e[2])},m(t,e){m(t,n,e),g(n,r),g(n,s),g(n,o),g(n,i)},p(t,[e]){1&e&&C(n,"width",t[0]),1&e&&C(n,"height",t[0]),2&e&&C(n,"stroke-width",t[1]),4&e&&a!==(a="feather feather-maximize-2 "+t[2])&&C(n,"class",a)},i:t,o:t,d(t){t&&$(n)}}}function ee(t,e,n){let{size:r="24"}=e,{strokeWidth:s=2}=e,{class:o=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,s=t.strokeWidth),"class"in t&&n(2,o=t.class)},[r,s,o]}class ne extends it{constructor(t){super(),ot(this,t,ee,te,i,{size:0,strokeWidth:1,class:2})}}function re(e){let n,r,s;return{c(){n=k("svg"),r=k("path"),C(r,"d","M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z"),C(n,"xmlns","http://www.w3.org/2000/svg"),C(n,"width",e[0]),C(n,"height",e[0]),C(n,"fill","none"),C(n,"viewBox","0 0 24 24"),C(n,"stroke","currentColor"),C(n,"stroke-width",e[1]),C(n,"stroke-linecap","round"),C(n,"stroke-linejoin","round"),C(n,"class",s="feather feather-message-circle "+e[2])},m(t,e){m(t,n,e),g(n,r)},p(t,[e]){1&e&&C(n,"width",t[0]),1&e&&C(n,"height",t[0]),2&e&&C(n,"stroke-width",t[1]),4&e&&s!==(s="feather feather-message-circle "+t[2])&&C(n,"class",s)},i:t,o:t,d(t){t&&$(n)}}}function se(t,e,n){let{size:r="24"}=e,{strokeWidth:s=2}=e,{class:o=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,s=t.strokeWidth),"class"in t&&n(2,o=t.class)},[r,s,o]}class oe extends it{constructor(t){super(),ot(this,t,se,re,i,{size:0,strokeWidth:1,class:2})}}function ie(e){let n,r,s,o,i;return{c(){n=k("svg"),r=k("circle"),s=k("circle"),o=k("circle"),C(r,"cx","12"),C(r,"cy","12"),C(r,"r","1"),C(s,"cx","12"),C(s,"cy","5"),C(s,"r","1"),C(o,"cx","12"),C(o,"cy","19"),C(o,"r","1"),C(n,"xmlns","http://www.w3.org/2000/svg"),C(n,"width",e[0]),C(n,"height",e[0]),C(n,"fill","none"),C(n,"viewBox","0 0 24 24"),C(n,"stroke","currentColor"),C(n,"stroke-width",e[1]),C(n,"stroke-linecap","round"),C(n,"stroke-linejoin","round"),C(n,"class",i="feather feather-more-vertical "+e[2])},m(t,e){m(t,n,e),g(n,r),g(n,s),g(n,o)},p(t,[e]){1&e&&C(n,"width",t[0]),1&e&&C(n,"height",t[0]),2&e&&C(n,"stroke-width",t[1]),4&e&&i!==(i="feather feather-more-vertical "+t[2])&&C(n,"class",i)},i:t,o:t,d(t){t&&$(n)}}}function ae(t,e,n){let{size:r="24"}=e,{strokeWidth:s=2}=e,{class:o=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,s=t.strokeWidth),"class"in t&&n(2,o=t.class)},[r,s,o]}class le extends it{constructor(t){super(),ot(this,t,ae,ie,i,{size:0,strokeWidth:1,class:2})}}function ce(e){let n,r,s,o;return{c(){n=k("svg"),r=k("rect"),s=k("rect"),C(r,"x","6"),C(r,"y","4"),C(r,"width","4"),C(r,"height","16"),C(s,"x","14"),C(s,"y","4"),C(s,"width","4"),C(s,"height","16"),C(n,"xmlns","http://www.w3.org/2000/svg"),C(n,"width",e[0]),C(n,"height",e[0]),C(n,"fill","none"),C(n,"viewBox","0 0 24 24"),C(n,"stroke","currentColor"),C(n,"stroke-width",e[1]),C(n,"stroke-linecap","round"),C(n,"stroke-linejoin","round"),C(n,"class",o="feather feather-pause "+e[2])},m(t,e){m(t,n,e),g(n,r),g(n,s)},p(t,[e]){1&e&&C(n,"width",t[0]),1&e&&C(n,"height",t[0]),2&e&&C(n,"stroke-width",t[1]),4&e&&o!==(o="feather feather-pause "+t[2])&&C(n,"class",o)},i:t,o:t,d(t){t&&$(n)}}}function he(t,e,n){let{size:r="24"}=e,{strokeWidth:s=2}=e,{class:o=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,s=t.strokeWidth),"class"in t&&n(2,o=t.class)},[r,s,o]}class de extends it{constructor(t){super(),ot(this,t,he,ce,i,{size:0,strokeWidth:1,class:2})}}function ue(e){let n,r,s;return{c(){n=k("svg"),r=k("polygon"),C(r,"points","5 3 19 12 5 21 5 3"),C(n,"xmlns","http://www.w3.org/2000/svg"),C(n,"width",e[0]),C(n,"height",e[0]),C(n,"fill","none"),C(n,"viewBox","0 0 24 24"),C(n,"stroke","currentColor"),C(n,"stroke-width",e[1]),C(n,"stroke-linecap","round"),C(n,"stroke-linejoin","round"),C(n,"class",s="feather feather-play "+e[2])},m(t,e){m(t,n,e),g(n,r)},p(t,[e]){1&e&&C(n,"width",t[0]),1&e&&C(n,"height",t[0]),2&e&&C(n,"stroke-width",t[1]),4&e&&s!==(s="feather feather-play "+t[2])&&C(n,"class",s)},i:t,o:t,d(t){t&&$(n)}}}function pe(t,e,n){let{size:r="24"}=e,{strokeWidth:s=2}=e,{class:o=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,s=t.strokeWidth),"class"in t&&n(2,o=t.class)},[r,s,o]}class fe extends it{constructor(t){super(),ot(this,t,pe,ue,i,{size:0,strokeWidth:1,class:2})}}function ge(e){let n,r,s,o;return{c(){n=k("svg"),r=k("line"),s=k("line"),C(r,"x1","12"),C(r,"y1","5"),C(r,"x2","12"),C(r,"y2","19"),C(s,"x1","5"),C(s,"y1","12"),C(s,"x2","19"),C(s,"y2","12"),C(n,"xmlns","http://www.w3.org/2000/svg"),C(n,"width",e[0]),C(n,"height",e[0]),C(n,"fill","none"),C(n,"viewBox","0 0 24 24"),C(n,"stroke","currentColor"),C(n,"stroke-width",e[1]),C(n,"stroke-linecap","round"),C(n,"stroke-linejoin","round"),C(n,"class",o="feather feather-plus "+e[2])},m(t,e){m(t,n,e),g(n,r),g(n,s)},p(t,[e]){1&e&&C(n,"width",t[0]),1&e&&C(n,"height",t[0]),2&e&&C(n,"stroke-width",t[1]),4&e&&o!==(o="feather feather-plus "+t[2])&&C(n,"class",o)},i:t,o:t,d(t){t&&$(n)}}}function me(t,e,n){let{size:r="24"}=e,{strokeWidth:s=2}=e,{class:o=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,s=t.strokeWidth),"class"in t&&n(2,o=t.class)},[r,s,o]}class $e extends it{constructor(t){super(),ot(this,t,me,ge,i,{size:0,strokeWidth:1,class:2})}}function we(e){let n,r,s,o;return{c(){n=k("svg"),r=k("polyline"),s=k("path"),C(r,"points","1 4 1 10 7 10"),C(s,"d","M3.51 15a9 9 0 1 0 2.13-9.36L1 10"),C(n,"xmlns","http://www.w3.org/2000/svg"),C(n,"width",e[0]),C(n,"height",e[0]),C(n,"fill","none"),C(n,"viewBox","0 0 24 24"),C(n,"stroke","currentColor"),C(n,"stroke-width",e[1]),C(n,"stroke-linecap","round"),C(n,"stroke-linejoin","round"),C(n,"class",o="feather feather-rotate-ccw "+e[2])},m(t,e){m(t,n,e),g(n,r),g(n,s)},p(t,[e]){1&e&&C(n,"width",t[0]),1&e&&C(n,"height",t[0]),2&e&&C(n,"stroke-width",t[1]),4&e&&o!==(o="feather feather-rotate-ccw "+t[2])&&C(n,"class",o)},i:t,o:t,d(t){t&&$(n)}}}function ve(t,e,n){let{size:r="24"}=e,{strokeWidth:s=2}=e,{class:o=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,s=t.strokeWidth),"class"in t&&n(2,o=t.class)},[r,s,o]}class ke extends it{constructor(t){super(),ot(this,t,ve,we,i,{size:0,strokeWidth:1,class:2})}}function _e(e){let n,r,s,o;return{c(){n=k("svg"),r=k("polyline"),s=k("path"),C(r,"points","23 4 23 10 17 10"),C(s,"d","M20.49 15a9 9 0 1 1-2.12-9.36L23 10"),C(n,"xmlns","http://www.w3.org/2000/svg"),C(n,"width",e[0]),C(n,"height",e[0]),C(n,"fill","none"),C(n,"viewBox","0 0 24 24"),C(n,"stroke","currentColor"),C(n,"stroke-width",e[1]),C(n,"stroke-linecap","round"),C(n,"stroke-linejoin","round"),C(n,"class",o="feather feather-rotate-cw "+e[2])},m(t,e){m(t,n,e),g(n,r),g(n,s)},p(t,[e]){1&e&&C(n,"width",t[0]),1&e&&C(n,"height",t[0]),2&e&&C(n,"stroke-width",t[1]),4&e&&o!==(o="feather feather-rotate-cw "+t[2])&&C(n,"class",o)},i:t,o:t,d(t){t&&$(n)}}}function ye(t,e,n){let{size:r="24"}=e,{strokeWidth:s=2}=e,{class:o=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,s=t.strokeWidth),"class"in t&&n(2,o=t.class)},[r,s,o]}class xe extends it{constructor(t){super(),ot(this,t,ye,_e,i,{size:0,strokeWidth:1,class:2})}}function be(e){let n,r,s,o;return{c(){n=k("svg"),r=k("circle"),s=k("line"),C(r,"cx","11"),C(r,"cy","11"),C(r,"r","8"),C(s,"x1","21"),C(s,"y1","21"),C(s,"x2","16.65"),C(s,"y2","16.65"),C(n,"xmlns","http://www.w3.org/2000/svg"),C(n,"width",e[0]),C(n,"height",e[0]),C(n,"fill","none"),C(n,"viewBox","0 0 24 24"),C(n,"stroke","currentColor"),C(n,"stroke-width",e[1]),C(n,"stroke-linecap","round"),C(n,"stroke-linejoin","round"),C(n,"class",o="feather feather-search "+e[2])},m(t,e){m(t,n,e),g(n,r),g(n,s)},p(t,[e]){1&e&&C(n,"width",t[0]),1&e&&C(n,"height",t[0]),2&e&&C(n,"stroke-width",t[1]),4&e&&o!==(o="feather feather-search "+t[2])&&C(n,"class",o)},i:t,o:t,d(t){t&&$(n)}}}function Ce(t,e,n){let{size:r="24"}=e,{strokeWidth:s=2}=e,{class:o=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,s=t.strokeWidth),"class"in t&&n(2,o=t.class)},[r,s,o]}class ze extends it{constructor(t){super(),ot(this,t,Ce,be,i,{size:0,strokeWidth:1,class:2})}}function Se(e){let n,r,s,o;return{c(){n=k("svg"),r=k("circle"),s=k("path"),C(r,"cx","12"),C(r,"cy","12"),C(r,"r","3"),C(s,"d","M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"),C(n,"xmlns","http://www.w3.org/2000/svg"),C(n,"width",e[0]),C(n,"height",e[0]),C(n,"fill","none"),C(n,"viewBox","0 0 24 24"),C(n,"stroke","currentColor"),C(n,"stroke-width",e[1]),C(n,"stroke-linecap","round"),C(n,"stroke-linejoin","round"),C(n,"class",o="feather feather-settings "+e[2])},m(t,e){m(t,n,e),g(n,r),g(n,s)},p(t,[e]){1&e&&C(n,"width",t[0]),1&e&&C(n,"height",t[0]),2&e&&C(n,"stroke-width",t[1]),4&e&&o!==(o="feather feather-settings "+t[2])&&C(n,"class",o)},i:t,o:t,d(t){t&&$(n)}}}function Pe(t,e,n){let{size:r="24"}=e,{strokeWidth:s=2}=e,{class:o=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,s=t.strokeWidth),"class"in t&&n(2,o=t.class)},[r,s,o]}class Te extends it{constructor(t){super(),ot(this,t,Pe,Se,i,{size:0,strokeWidth:1,class:2})}}function Ee(e){let n,r,s,o,i,a;return{c(){n=k("svg"),r=k("polyline"),s=k("path"),o=k("line"),i=k("line"),C(r,"points","3 6 5 6 21 6"),C(s,"d","M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"),C(o,"x1","10"),C(o,"y1","11"),C(o,"x2","10"),C(o,"y2","17"),C(i,"x1","14"),C(i,"y1","11"),C(i,"x2","14"),C(i,"y2","17"),C(n,"xmlns","http://www.w3.org/2000/svg"),C(n,"width",e[0]),C(n,"height",e[0]),C(n,"fill","none"),C(n,"viewBox","0 0 24 24"),C(n,"stroke","currentColor"),C(n,"stroke-width",e[1]),C(n,"stroke-linecap","round"),C(n,"stroke-linejoin","round"),C(n,"class",a="feather feather-trash-2 "+e[2])},m(t,e){m(t,n,e),g(n,r),g(n,s),g(n,o),g(n,i)},p(t,[e]){1&e&&C(n,"width",t[0]),1&e&&C(n,"height",t[0]),2&e&&C(n,"stroke-width",t[1]),4&e&&a!==(a="feather feather-trash-2 "+t[2])&&C(n,"class",a)},i:t,o:t,d(t){t&&$(n)}}}function We(t,e,n){let{size:r="24"}=e,{strokeWidth:s=2}=e,{class:o=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,s=t.strokeWidth),"class"in t&&n(2,o=t.class)},[r,s,o]}class Me extends it{constructor(t){super(),ot(this,t,We,Ee,i,{size:0,strokeWidth:1,class:2})}}function De(e){let n,r,s,o;return{c(){n=k("svg"),r=k("polyline"),s=k("polyline"),C(r,"points","23 6 13.5 15.5 8.5 10.5 1 18"),C(s,"points","17 6 23 6 23 12"),C(n,"xmlns","http://www.w3.org/2000/svg"),C(n,"width",e[0]),C(n,"height",e[0]),C(n,"fill","none"),C(n,"viewBox","0 0 24 24"),C(n,"stroke","currentColor"),C(n,"stroke-width",e[1]),C(n,"stroke-linecap","round"),C(n,"stroke-linejoin","round"),C(n,"class",o="feather feather-trending-up "+e[2])},m(t,e){m(t,n,e),g(n,r),g(n,s)},p(t,[e]){1&e&&C(n,"width",t[0]),1&e&&C(n,"height",t[0]),2&e&&C(n,"stroke-width",t[1]),4&e&&o!==(o="feather feather-trending-up "+t[2])&&C(n,"class",o)},i:t,o:t,d(t){t&&$(n)}}}function Le(t,e,n){let{size:r="24"}=e,{strokeWidth:s=2}=e,{class:o=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,s=t.strokeWidth),"class"in t&&n(2,o=t.class)},[r,s,o]}class Ae extends it{constructor(t){super(),ot(this,t,Le,De,i,{size:0,strokeWidth:1,class:2})}}function Re(e){let n,r,s,o,i;return{c(){n=k("svg"),r=k("path"),s=k("polyline"),o=k("line"),C(r,"d","M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"),C(s,"points","17 8 12 3 7 8"),C(o,"x1","12"),C(o,"y1","3"),C(o,"x2","12"),C(o,"y2","15"),C(n,"xmlns","http://www.w3.org/2000/svg"),C(n,"width",e[0]),C(n,"height",e[0]),C(n,"fill","none"),C(n,"viewBox","0 0 24 24"),C(n,"stroke","currentColor"),C(n,"stroke-width",e[1]),C(n,"stroke-linecap","round"),C(n,"stroke-linejoin","round"),C(n,"class",i="feather feather-upload "+e[2])},m(t,e){m(t,n,e),g(n,r),g(n,s),g(n,o)},p(t,[e]){1&e&&C(n,"width",t[0]),1&e&&C(n,"height",t[0]),2&e&&C(n,"stroke-width",t[1]),4&e&&i!==(i="feather feather-upload "+t[2])&&C(n,"class",i)},i:t,o:t,d(t){t&&$(n)}}}function Ie(t,e,n){let{size:r="24"}=e,{strokeWidth:s=2}=e,{class:o=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,s=t.strokeWidth),"class"in t&&n(2,o=t.class)},[r,s,o]}class Be extends it{constructor(t){super(),ot(this,t,Ie,Re,i,{size:0,strokeWidth:1,class:2})}}function je(e){let n,r,s,o;return{c(){n=k("svg"),r=k("line"),s=k("line"),C(r,"x1","18"),C(r,"y1","6"),C(r,"x2","6"),C(r,"y2","18"),C(s,"x1","6"),C(s,"y1","6"),C(s,"x2","18"),C(s,"y2","18"),C(n,"xmlns","http://www.w3.org/2000/svg"),C(n,"width",e[0]),C(n,"height",e[0]),C(n,"fill","none"),C(n,"viewBox","0 0 24 24"),C(n,"stroke","currentColor"),C(n,"stroke-width",e[1]),C(n,"stroke-linecap","round"),C(n,"stroke-linejoin","round"),C(n,"class",o="feather feather-x "+e[2])},m(t,e){m(t,n,e),g(n,r),g(n,s)},p(t,[e]){1&e&&C(n,"width",t[0]),1&e&&C(n,"height",t[0]),2&e&&C(n,"stroke-width",t[1]),4&e&&o!==(o="feather feather-x "+t[2])&&C(n,"class",o)},i:t,o:t,d(t){t&&$(n)}}}function Oe(t,e,n){let{size:r="24"}=e,{strokeWidth:s=2}=e,{class:o=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,s=t.strokeWidth),"class"in t&&n(2,o=t.class)},[r,s,o]}class Ne extends it{constructor(t){super(),ot(this,t,Oe,je,i,{size:0,strokeWidth:1,class:2})}}const qe=[];let Fe;function He(t){const e=t.pattern.test(Fe);Ue(t,t.className,e),Ue(t,t.inactiveClassName,!e)}function Ue(t,e,n){(e||"").split(" ").forEach((e=>{e&&(t.node.classList.remove(e),n&&t.node.classList.add(e))}))}function Ve(t,e){if(!(e=e&&("string"==typeof e||"object"==typeof e&&e instanceof RegExp)?{path:e}:e||{}).path&&t.hasAttribute("href")&&(e.path=t.getAttribute("href"),e.path&&e.path.length>1&&"#"==e.path.charAt(0)&&(e.path=e.path.substring(1))),e.className||(e.className="active"),!e.path||"string"==typeof e.path&&(e.path.length<1||"/"!=e.path.charAt(0)&&"*"!=e.path.charAt(0)))throw Error('Invalid value for "path" argument');const{pattern:n}="string"==typeof e.path?dt(e.path):{pattern:e.path},r={node:t,className:e.className,inactiveClassName:e.inactiveClassName,pattern:n};return qe.push(r),He(r),{destroy(){qe.splice(qe.indexOf(r),1)}}}mt.subscribe((t=>{Fe=t.location+(t.querystring?"?"+t.querystring:""),qe.map(He)}));const Ye={lists:[],notes:""},Qe=["notes"];function Xe(){}class Ge{constructor(t,e){this.initialized=!1,this._list_db=new PouchDB(t),this._document_db=new PouchDB(e)}init(){return new Promise(((t,e)=>{this._list_db.allDocs({include_docs:!0}).then((n=>{n.rows.map((t=>t.doc.name)).includes("Bookmarks")?(this.initialized=!0,t()):this._list_db.post({name:"Bookmarks"}).then((n=>{if(!n.ok)throw console.error(n),e(new Error("There was an error initializing the bookmarks data. Check the logs for more details.")),new Xe;this.initialized=!0,t()})).catch((t=>{throw console.error(t),e(new Error("There was an error initializing the bookmarks data. Check the logs for more details.")),new Xe}))})).catch(Xe,(()=>{})).catch((t=>{console.error(t),e(new Error("There was an error loading bookmarks data. Check the logs for more details."))}))}))}waitForInit(){return new Promise(((t,e)=>{let n=!1;const r=()=>{this.initialized?(t(),n=!0):setTimeout(r,10)};n||r()}))}getLists(){return new Promise(((t,e)=>{this._list_db.allDocs({include_docs:!0}).then((e=>{t(e.rows.map((t=>t.doc.name)))})).catch((t=>{console.error(t),e(new Error("There was an error fetching the available word lists."))}))}))}getEmptyLists(){let t;return new Promise(((e,n)=>{this._list_db.allDocs({include_docs:!0}).then((e=>(t=e.rows.map((t=>t.doc)),this._document_db.allDocs({include_docs:!0})))).then((n=>{n=n.rows.map((t=>t.doc));const r=t.filter((t=>{const e=t._id;return!n.filter((t=>t.lists.includes(e))).length})).map((t=>t.name));e(r)})).catch((t=>{console.error(t),n(new Error("There was an error trying to fetch empty lists."))}))}))}createList(t){return new Promise(((e,n)=>{this._list_db.allDocs({include_docs:!0}).then((t=>t.rows.map((t=>t.doc.name)))).then((e=>{if(e.includes(t))throw n(new Error(`Cannot create list. A list with the name ${t} already exists.`)),new Xe;return this._list_db.post({name:t})})).then((r=>{r.ok?e():(console.error(r),n(new Error(`There was an error while creating ${t}. Check the logs for more details.`)))})).catch(Xe,(()=>{})).catch((e=>{console.error(e),n(new Error(`There was an error while creating ${t}. Check the logs for more details.`))}))}))}deleteList(t){let e;return new Promise(((n,r)=>{this._list_db.allDocs({include_docs:!0}).then((n=>{const s=n.rows.filter((e=>e.doc.name===t))[0];if(!s)throw r(new Error(`There was an error deleting the list ${t}. The list does not exist.`)),new Xe;return s.doc._deleted=!0,e=s.doc._id,this._list_db.put(s.doc)})).then((e=>{if(e.ok)return this._document_db.allDocs({include_docs:!0});throw console.error(e),r(`There was an error deleting the list ${t}. Check the log for more details.`),new Xe})).then((t=>{const n=t.rows.map((t=>t.doc));for(let t=0;tt!==e)),r.lists.length||(r._deleted=!0)}return this._document_db.bulkDocs(n)})).then((e=>{e.map((t=>t.ok)).includes(!1)?(console.error(e),r(new Error(`There was an error deleting the list ${t}. Check the log for more details.`))):n()})).catch(Xe,(()=>{})).catch((e=>{console.error(e),r(new Error(`There was an error deleting the list ${t}. Check the log for more details.`))}))}))}getListContent(t){let e;return new Promise(((n,r)=>{this._list_db.allDocs({include_docs:!0}).then((n=>{const s=n.rows.filter((e=>e.doc.name===t))[0];if(!s)throw console.error(n),r(new Error(`There was an error fetching the contents of ${t}. List does not exist! Check the log for more details.`)),new Xe;return e=s.doc._id,this._document_db.allDocs({include_docs:!0})})).then((t=>{n(t.rows.filter((t=>t.doc.lists.includes(e))).map((t=>t.doc)))})).catch(Xe,(()=>{})).catch((e=>{console.error(e),r(new Error(`There was an error loading the list ${t}. Check the log for more details.`))}))}))}getWordByHash(t){return new Promise(((e,n)=>{this._document_db.allDocs({include_docs:!0}).then((n=>{e(n.rows.filter((e=>e.doc.hash===t)).map((t=>t.doc))[0])}))}))}_createWordEntry(t,e){const n={...Ye,...t};return n.lists=[e],n}addToList(t,e){let n;return new Promise(((r,s)=>{this._list_db.allDocs({include_docs:!0}).then((e=>{const r=e.rows.filter((e=>e.doc.name===t)).map((t=>t.doc))[0];if(!r)throw s(new Error(`There was an error adding the word to ${t}. List does not exist!`)),new Xe;return n=r._id,this._document_db.allDocs({include_docs:!0})})).then((t=>{const r=t.rows.map((t=>t.doc));let s=r.filter((t=>t.hash===e.hash))[0];return s?(s.lists.includes(n)||s.lists.push(n),this._document_db.put(s)):(s=this._createWordEntry(e,n),this._document_db.post(s))})).then((e=>{e.ok?r():(console.error(e),s(new Error(`There was an error adding the word to ${t}. Check the log for more details.`)))})).catch(Xe,(()=>{})).catch((e=>{console.error(e),s(new Error(`There was an error adding the word to ${t}. Check the log for more details.`))}))}))}removeFromList(t,e){let n;return new Promise(((r,s)=>{this._list_db.allDocs({include_docs:!0}).then((e=>{const r=e.rows.filter((e=>e.doc.name===t)).map((t=>t.doc))[0];if(!r)throw s(new Error(`There was an error removing the word from ${t}. The list does not exist.`)),new Xe;return n=r._id,this._document_db.allDocs({include_docs:!0})})).then((r=>{const o=r.rows.map((t=>t.doc));let i=o.filter((t=>t.hash===e.hash))[0];if(i)return i.lists=i.lists.filter((t=>t!==n)),this._document_db.put(i);throw s(new Error(`There was an error removing the word from ${t}. The word does not exist!`)),new Xe})).then((e=>{e.ok?r():(console.error(e),s(new Error(`There was an error removing the word from ${t}. Check the log for more details.`)))})).catch(Xe,(()=>{})).catch((e=>{console.error(e),s(new Error(`There was an error removing the word from ${t}. Check the log for more details.`))}))}))}inList(t){let e;return new Promise(((n,r)=>{this.getWordByHash(t).then((t=>(e=t?t.lists:[],this._list_db.allDocs({include_docs:!0})))).then((t=>{n(t.rows.filter((t=>e.includes(t.doc._id))).map((t=>t.doc.name)))})).catch((t=>{console.error(t),r(new Error("There was an error fetching bookmarks data. Please check the log for more details."))}))}))}updateProperty(t,e,n){return new Promise(((r,s)=>{this.getWordByHash(t).then((t=>{if(!t)throw s(new Error("There was an error updating the bookmarks entry. That word could not be found in any of your lists.")),new Xe;if(!Qe.includes(e))throw s(new Error(`There was an error updating the bookmarks entry. The property ${e} cannot be updated with this method.`)),new Xe;return t[e]=n,this._document_db.put(t)})).then((t=>{t.ok?r():s(new Error("There was an error updating the bookmarks entry."))})).catch(Xe,(()=>{})).catch((t=>{console.error(t),s(new Error("There was an error updating the bookmarks entry. Check the log for more details."))}))}))}}const Ke=(t,e)=>{e&&console.error(e),alert(t)},Je=(t,e)=>({requiresRestart:t,value:e});class Ze{constructor(t){this._name=t,this._config={},this.initialized=!1}init(){return new Promise(((t,e)=>{this._db=new PouchDB(this._name),this._db.get("config").catch((t=>{if("not_found"===t.name)return{_id:"config",transparency:Je(!0,!1),beta:Je(!0,!1),toneColors:Je(!0,{colors:["--sy-color--blue-3","--sy-color--yellow-1","--sy-color--red-1","--sy-color--green-3","--sy-color--grey-4"],hasCustomColors:!1})};console.error(t),e("There was an error loading user preferences. Check the logs for more details.")})).then((e=>{this._config=e,this.initialized=!0,t()})).catch((t=>{console.error(t),e("There was an error loading user preferences. Check the logs for more details.")}))}))}waitForInit(){return new Promise(((t,e)=>{let n=!1;const r=()=>{this.initialized?(t(),n=!0):setTimeout(r,10)};n||r()}))}get(t){if(!this.initialized)return Ke("Cannot read preferences. Preferences not yet initialized."),void console.log("Trying to access property "+t);const e=this._config[t];return e||Ke(`Requested preference ${t} does not exist!`),e.value}set(t,e){if(!this.initialized)return void Ke("Cannot save preferences. Preferences not yet initialized.");const n=this._config[t];n?(n.requiresRestart&&alert("You must restart Syng for this change to take effect."),this._config[t].value=e,this._db.put(this._config).then((t=>{t.ok?this._config._rev=t.rev:Ke("Cannot save preferences. An unknown error occurred. Check the log for more details.",t)})).catch((t=>{Ke("Cannot save preferences. An unknown error occurred. Check the logs for more details.",t)}))):Ke(`Requested preference ${t} does not exist!`)}}const tn=async()=>"debug"in await(async()=>{try{const t=await window.__TAURI__.cli.getMatches();return"run"===t.subcommand.name?t.subcommand.matches.args:t.args}catch(t){return console.error(t),{}}})();function en(){return en=Object.assign||function(t){for(var e=1;e=g),v="y"===i&&(m<=0||m+u>=f);w||v||(r=!1,n.removeEventListener(un,l),n.removeEventListener(un,c),"translate3d(0px, 0px, 0px)"!==n.style.transform&&(n.style.transition="none",n.style.transform=pn)),m===s&&$===o||(s=m,o=$,r||!w&&!v||(r=!0,n.addEventListener(un,l),n.style.transition="transform ".concat(e.duration[0],"ms ").concat(e.easing),n.style.transform="translate3d(".concat(w?e.intensity*-h:0,"px, ").concat(v?e.intensity*-d:0,"px, 0)")))}function l(){n.removeEventListener(un,l),n.addEventListener(un,c),n.style.transition="transform ".concat(e.duration[1],"ms ").concat(e.easing),n.style.transform=pn}function c(){n.removeEventListener(un,c),r=!1}function h(){e.appleDevicesOnly&&!hn||(e.useNative&&cn?t.style.webkitOverflowScrolling="touch":e.useNative&&cn||t.addEventListener("wheel",a,{passive:!0}))}h();var d={el:t,props:e,enable:h,disable:function(){t.style.webkitOverflowScrolling="",t.removeEventListener("wheel",a,{passive:!0})}};return t._elasticScroll=d,d}function gn(t){var e,n=en({},nn,t),r=(e=n.targets,"string"==typeof e?dn(document.querySelectorAll(e)):e instanceof NodeList?dn(e):e instanceof Element?[e]:[]).map((function(t){return fn(t,n)})).filter(Boolean);return n.targets instanceof Element?r[0]:r}gn.defaults=nn,window.onload=()=>{gn({appleDevicesOnly:!1,intensity:1})};const mn=()=>{const t=tn(),e=t?"development_config":"config",n=t?"development_word-lists":"word-lists",r=t?"development_bookmarks":"bookmarks";window.preferenceManager=new Ze(e),window.bookmarkManager=new Ge(n,r);const s=[{name:"init-dictionary",action:window.__TAURI__.invoke("init_dictionary")},{name:"init-preference-manager",action:window.preferenceManager.init()},{name:"cache-platform",action:window.__TAURI__.os.platform()},{name:"init-bookmark-manager",action:window.bookmarkManager.init()}];Promise.all(s.map((t=>t.action))).then((t=>{const e=(t=>t.map(((t,e)=>({name:s[e].name,result:t}))))(t);window.platform=((t,e)=>{const n=e.find((e=>e.name===t));return n?n.result:void 0})("cache-platform",e),document.dispatchEvent(new Event("init")),(()=>{const t=window.preferenceManager.get("toneColors");if(t.hasCustomColors){const e=document.querySelector(":root").style,n=t.colors;for(let t=0;t{Ke("There was an error starting Syng. Please quit and try again. If this problem persists please file a bug report.",t)}))};function $n(t,e,n){const r=t.slice();return r[6]=e[n],r}function wn(t,e,n){const r=t.slice();return r[6]=e[n],r}function vn(t){let e,n,r,s,o,i,a,l,c,h,d,u=t[6].title+"";var p=t[6].icon;return p&&(r=P(p,{props:{size:"24"}})),{c(){e=v("a"),n=v("span"),r&&nt(r.$$.fragment),s=y(),o=v("div"),i=v("p"),a=_(u),l=y(),C(n,"class","navigation--item svelte-81zlxj"),C(o,"class","sy-tooltip--body sy-tooltip--body-right"),C(e,"href",`#/${t[6].link}`),C(e,"class","sy-tooltip--container")},m(u,p){m(u,e,p),g(e,n),r&&rt(r,n,null),g(e,s),g(e,o),g(o,i),g(i,a),g(e,l),c=!0,h||(d=f(Ve.call(null,n,{path:t[6].pattern||`/${t[6].link}`,className:"navigation--item-active"})),h=!0)},p(e,s){if(p!==(p=(t=e)[6].icon)){if(r){G();const t=r;Z(t.$$.fragment,1,0,(()=>{st(t,1)})),K()}p?(r=P(p,{props:{size:"24"}}),nt(r.$$.fragment),J(r.$$.fragment,1),rt(r,n,null)):r=null}},i(t){c||(r&&J(r.$$.fragment,t),c=!0)},o(t){r&&Z(r.$$.fragment,t),c=!1},d(t){t&&$(e),r&&st(r),h=!1,d()}}}function kn(t){let e,n,r=(!t[6].beta||t[0])&&vn(t);return{c(){r&&r.c(),e=x()},m(t,s){r&&r.m(t,s),m(t,e,s),n=!0},p(t,n){!t[6].beta||t[0]?r?(r.p(t,n),1&n&&J(r,1)):(r=vn(t),r.c(),J(r,1),r.m(e.parentNode,e)):r&&(G(),Z(r,1,1,(()=>{r=null})),K())},i(t){n||(J(r),n=!0)},o(t){Z(r),n=!1},d(t){r&&r.d(t),t&&$(e)}}}function _n(t){let e,n,r,s,o,i,a,l,c,h,d,u=t[6].title+"";var p=t[6].icon;function w(t){return{props:{size:t[6].size}}}return p&&(r=P(p,w(t))),{c(){e=v("a"),n=v("span"),r&&nt(r.$$.fragment),s=y(),o=v("div"),i=v("p"),a=_(u),l=y(),C(n,"class","navigation--item svelte-81zlxj"),C(o,"class","sy-tooltip--body sy-tooltip--body-right"),C(e,"href",`#/${t[6].link}`),C(e,"class","sy-tooltip--container")},m(u,p){m(u,e,p),g(e,n),r&&rt(r,n,null),g(e,s),g(e,o),g(o,i),g(i,a),g(e,l),c=!0,h||(d=f(Ve.call(null,n,{path:`/${t[6].link}`,className:"navigation--item-active"})),h=!0)},p(e,s){if(p!==(p=(t=e)[6].icon)){if(r){G();const t=r;Z(t.$$.fragment,1,0,(()=>{st(t,1)})),K()}p?(r=P(p,w(t)),nt(r.$$.fragment),J(r.$$.fragment,1),rt(r,n,null)):r=null}},i(t){c||(r&&J(r.$$.fragment,t),c=!0)},o(t){r&&Z(r.$$.fragment,t),c=!1},d(t){t&&$(e),r&&st(r),h=!1,d()}}}function yn(t){let e,n,r=(!t[6].beta||t[0])&&_n(t);return{c(){r&&r.c(),e=x()},m(t,s){r&&r.m(t,s),m(t,e,s),n=!0},p(t,n){!t[6].beta||t[0]?r?(r.p(t,n),1&n&&J(r,1)):(r=_n(t),r.c(),J(r,1),r.m(e.parentNode,e)):r&&(G(),Z(r,1,1,(()=>{r=null})),K())},i(t){n||(J(r),n=!0)},o(t){Z(r),n=!1},d(t){r&&r.d(t),t&&$(e)}}}function xn(t){let e,n,r,s,o,i=t[3],a=[];for(let e=0;eZ(a[t],1,1,(()=>{a[t]=null}));let c=t[4],h=[];for(let e=0;eZ(h[t],1,1,(()=>{h[t]=null}));return{c(){e=v("div"),n=v("div");for(let t=0;t{o="darwin"===t[1],n(2,l=o),n(0,i=window.preferenceManager.get("beta")),n(1,a=o&&window.preferenceManager.get("transparency"))})).catch((t=>{Ke("There was an unexpected error reading system information. Syng may not operate as expected. Please restart Syng. If this problem persists, please report this bug. For more details check the logs.",t)})),[i,a,l,r,s]}class Cn extends it{constructor(t){super(),ot(this,t,bn,xn,i,{})}}function zn(t){let e,n,r,s;const o=t[12].default,i=l(o,t,t[11],null);return{c(){e=v("button"),i&&i.c(),C(e,"class",p(t[2]())+" svelte-161klet"),e.disabled=t[0],C(e,"data-testid","sy-button")},m(o,a){m(o,e,a),i&&i.m(e,null),n=!0,r||(s=b(e,"click",t[13]),r=!0)},p(t,[r]){i&&i.p&&(!n||2048&r)&&d(i,o,t,t[11],n?h(o,t[11],r,null):u(t[11]),null),(!n||1&r)&&(e.disabled=t[0])},i(t){n||(J(i,t),n=!0)},o(t){Z(i,t),n=!1},d(t){t&&$(e),i&&i.d(t),r=!1,s()}}}function Sn(t,e,n){let{$$slots:r={},$$scope:s}=e,{style:o="filled"}=e,{size:i="medium"}=e,{shape:a="rectangle"}=e,{disabled:l=!1}=e,{grouped:c=!1}=e,{color:h}=e,{hover:d}=e,{center:u=!1}=e,{classes:p=[]}=e;const f=D();return t.$$set=t=>{"style"in t&&n(3,o=t.style),"size"in t&&n(4,i=t.size),"shape"in t&&n(5,a=t.shape),"disabled"in t&&n(0,l=t.disabled),"grouped"in t&&n(6,c=t.grouped),"color"in t&&n(7,h=t.color),"hover"in t&&n(8,d=t.hover),"center"in t&&n(9,u=t.center),"classes"in t&&n(10,p=t.classes),"$$scope"in t&&n(11,s=t.$$scope)},[l,f,()=>p.concat(["sy-button",`sy-button--${o}`,`sy-button--${i}`,`sy-button--${a}`,u?"sy-button--center":"",h?`sy-button--color-${h}`:"",d?`sy-button--hover-${d}`:"",c?"sy-button--grouped":""]).join(" "),o,i,a,c,h,d,u,p,s,r,()=>f("click")]}class Pn extends it{constructor(t){super(),ot(this,t,Sn,zn,i,{style:3,size:4,shape:5,disabled:0,grouped:6,color:7,hover:8,center:9,classes:10})}}function Tn(t){let e,n;const r=t[3].default,s=l(r,t,t[2],null);return{c(){e=v("div"),s&&s.c(),C(e,"class",p(t[0]())+" svelte-vpwbgu")},m(t,r){m(t,e,r),s&&s.m(e,null),n=!0},p(t,[e]){s&&s.p&&(!n||4&e)&&d(s,r,t,t[2],n?h(r,t[2],e,null):u(t[2]),null)},i(t){n||(J(s,t),n=!0)},o(t){Z(s,t),n=!1},d(t){t&&$(e),s&&s.d(t)}}}function En(t,e,n){let{$$slots:r={},$$scope:s}=e,{size:o="medium"}=e;return t.$$set=t=>{"size"in t&&n(1,o=t.size),"$$scope"in t&&n(2,s=t.$$scope)},[()=>["sy-button-bar--container",`sy-button-bar--container--${o}`].join(" "),o,s,r]}class Wn extends it{constructor(t){super(),ot(this,t,En,Tn,i,{size:1})}}function Mn(e){let n,r,o,i;return{c(){n=v("span"),r=_(e[0]),C(n,"class",p(e[1]())+" svelte-312fzw")},m(t,s){m(t,n,s),g(n,r),o||(i=[b(n,"click",e[2]),b(n,"keyup",e[2])],o=!0)},p(t,[e]){1&e&&z(r,t[0])},i:t,o:t,d(t){t&&$(n),o=!1,s(i)}}}function Dn(t,e,n){let{text:r}=e,{color:s="black"}=e,{hover:o="blue"}=e,{icon:i}=e;const a=D();return t.$$set=t=>{"text"in t&&n(0,r=t.text),"color"in t&&n(3,s=t.color),"hover"in t&&n(4,o=t.hover),"icon"in t&&n(5,i=t.icon)},[r,()=>["st-dropdown-item--container",`st-dropdown-item--color--${s}`,`st-dropdown-item--hover--${o}`].join(" "),t=>{a("click",t)},s,o,i]}class Ln extends it{constructor(t){super(),ot(this,t,Dn,Mn,i,{text:0,color:3,hover:4,icon:5})}}function An(t,e,n){const r=t.slice();return r[13]=e[n],r}function Rn(t){let e,n,r;function s(...e){return t[9](t[13],...e)}var o=t[13].component;function i(t){return{props:{text:t[13].text,icon:t[13].icon,color:t[13].color,hover:t[13].hover}}}return o&&(e=P(o,i(t)),e.$on("click",s)),{c(){e&&nt(e.$$.fragment),n=x()},m(t,s){e&&rt(e,t,s),m(t,n,s),r=!0},p(r,a){t=r;const l={};if(1&a&&(l.text=t[13].text),1&a&&(l.icon=t[13].icon),1&a&&(l.color=t[13].color),1&a&&(l.hover=t[13].hover),1&a&&o!==(o=t[13].component)){if(e){G();const t=e;Z(t.$$.fragment,1,0,(()=>{st(t,1)})),K()}o?(e=P(o,i(t)),e.$on("click",s),nt(e.$$.fragment),J(e.$$.fragment,1),rt(e,n.parentNode,n)):e=null}else o&&e.$set(l)},i(t){r||(e&&J(e.$$.fragment,t),r=!0)},o(t){e&&Z(e.$$.fragment,t),r=!1},d(t){t&&$(n),e&&st(e,t)}}}function In(t){let e,n,r,o,i,a,c,f;const k=t[8].default,_=l(k,t,t[7],null);let x=t[0],z=[];for(let e=0;eZ(z[t],1,1,(()=>{z[t]=null}));return{c(){e=v("div"),n=v("span"),_&&_.c(),r=y(),o=v("div"),i=v("div");for(let t=0;t{t.composedPath().includes(l)||n(1,c=!1)},u=t=>{t&&(h("selection",t),n(1,c=!1))};M((()=>{document.removeEventListener("click",d,{capture:!0})}));return t.$$set=t=>{"values"in t&&n(0,o=t.values),"position"in t&&n(6,i=t.position),"$$scope"in t&&n(7,s=t.$$scope)},t.$$.update=()=>{2&t.$$.dirty&&(c?document.addEventListener("click",d,{capture:!0}):document.removeEventListener("click",d,{capture:!0}))},[o,c,a,u,()=>{n(1,c=!c)},()=>["sy-dropdown--list",`sy-dropdown--list--${i}`].join(" "),i,s,r,(t,e)=>u(t.id)]}class jn extends it{constructor(t){super(),ot(this,t,Bn,In,i,{values:0,position:6})}}function On(t){let e,n,r,o,i,a,l,c;var h=t[0];return h&&(n=P(h,{props:{size:"14"}})),{c(){e=v("span"),n&&nt(n.$$.fragment),r=_("\n\t \n\t"),o=v("span"),i=_(t[1]),C(e,"class",p(t[2]())+" svelte-rlw7fj")},m(s,h){m(s,e,h),n&&rt(n,e,null),g(e,r),g(e,o),g(o,i),a=!0,l||(c=[b(e,"click",t[3]),b(e,"keyup",t[3])],l=!0)},p(t,[s]){if(1&s&&h!==(h=t[0])){if(n){G();const t=n;Z(t.$$.fragment,1,0,(()=>{st(t,1)})),K()}h?(n=P(h,{props:{size:"14"}}),nt(n.$$.fragment),J(n.$$.fragment,1),rt(n,e,r)):n=null}(!a||2&s)&&z(i,t[1])},i(t){a||(n&&J(n.$$.fragment,t),a=!0)},o(t){n&&Z(n.$$.fragment,t),a=!1},d(t){t&&$(e),n&&st(n),l=!1,s(c)}}}function Nn(t,e,n){let{icon:r}=e,{text:s=""}=e,{hover:o="blue"}=e,{color:i="black"}=e;const a=D();return t.$$set=t=>{"icon"in t&&n(0,r=t.icon),"text"in t&&n(1,s=t.text),"hover"in t&&n(4,o=t.hover),"color"in t&&n(5,i=t.color)},[r,s,()=>["twi-dropdown-item--container",`twi-dropdown-item--color--${i}`,`twi-dropdown-item--hover--${o}`].join(" "),t=>{a("click",t)},o,i]}class qn extends it{constructor(t){super(),ot(this,t,Nn,On,i,{icon:0,text:1,hover:4,color:5})}}function Fn(t,e,n){const r=t.slice();return r[7]=e[n],r}function Hn(t){let e,n,r,s;var o=t[1];function i(t){return{props:{value:t[7]}}}return o&&(n=P(o,i(t)),n.$on("selection",t[5]),n.$on("event",t[6])),{c(){e=v("div"),n&&nt(n.$$.fragment),r=y(),C(e,"class","sy-list--list-item svelte-kedf8z")},m(t,o){m(t,e,o),n&&rt(n,e,null),g(e,r),s=!0},p(t,s){const a={};if(1&s&&(a.value=t[7]),2&s&&o!==(o=t[1])){if(n){G();const t=n;Z(t.$$.fragment,1,0,(()=>{st(t,1)})),K()}o?(n=P(o,i(t)),n.$on("selection",t[5]),n.$on("event",t[6]),nt(n.$$.fragment),J(n.$$.fragment,1),rt(n,e,r)):n=null}else o&&n.$set(a)},i(t){s||(n&&J(n.$$.fragment,t),s=!0)},o(t){n&&Z(n.$$.fragment,t),s=!1},d(t){t&&$(e),n&&st(n)}}}function Un(t){let e,n,r=t[0],s=[];for(let e=0;eZ(s[t],1,1,(()=>{s[t]=null}));return{c(){e=v("div");for(let t=0;t{"values"in t&&n(0,r=t.values),"component"in t&&n(1,s=t.component),"highlight"in t&&n(3,o=t.highlight),"filterable"in t&&n(4,i=t.filterable)},[r,s,a,o,i,t=>a("selection",t.detail),function(e){L.call(this,t,e)}]}class Yn extends it{constructor(t){super(),ot(this,t,Vn,Un,i,{values:0,component:1,highlight:3,filterable:4})}}function Qn(e){let n,r,o;return{c(){n=v("input"),C(n,"placeholder",e[0]),C(n,"type",e[1]),C(n,"class",p(e[5]())+" svelte-z7kzs5"),C(n,"id",e[2]),C(n,"spellcheck",e[3])},m(t,s){m(t,n,s),r||(o=[b(n,"change",e[10]),b(n,"keyup",e[6])],r=!0)},p(t,[e]){1&e&&C(n,"placeholder",t[0]),2&e&&C(n,"type",t[1]),4&e&&C(n,"id",t[2]),8&e&&C(n,"spellcheck",t[3])},i:t,o:t,d(t){t&&$(n),r=!1,s(o)}}}function Xn(t,e,n){let{style:r="standard"}=e,{size:s="medium"}=e,{transparency:o=!1}=e,{placeholder:i=""}=e,{type:a="text"}=e,{id:l}=e,{spellcheck:c}=e;const h=D();return t.$$set=t=>{"style"in t&&n(7,r=t.style),"size"in t&&n(8,s=t.size),"transparency"in t&&n(9,o=t.transparency),"placeholder"in t&&n(0,i=t.placeholder),"type"in t&&n(1,a=t.type),"id"in t&&n(2,l=t.id),"spellcheck"in t&&n(3,c=t.spellcheck)},[i,a,l,c,h,()=>["sy-text-input",o?"sy-text-input--transparency":"",`sy-text-input--${r}`,`sy-text-input--${s}`].join(" "),t=>{"Enter"==t.code?h("enter",t):h("keyup",t.srcElement.value)},r,s,o,t=>h("change",t.srcElement.value)]}class Gn extends it{constructor(t){super(),ot(this,t,Xn,Qn,i,{style:7,size:8,transparency:9,placeholder:0,type:1,id:2,spellcheck:3})}}function Kn(e){let n,r,o,i,a,l,c,h,d,u,f,w=e[6](e[2])+"";return{c(){n=v("div"),r=v("p"),o=_(e[0]),i=y(),a=v("p"),l=_(e[1]),c=y(),h=v("p"),d=_(w),C(r,"class","sy-list-preview-item--text sy-list-preview-item--headline svelte-14tz0cu"),C(a,"class","sy-list-preview-item--text sy-list-preview-item--subtitle svelte-14tz0cu"),C(h,"class","sy-list-preview-item--text sy-list-preview-item--content svelte-14tz0cu"),C(n,"class",p(e[8]())+" svelte-14tz0cu"),S(n,"sy-list-preview-item-container--active",e[4]&&e[5])},m(t,s){m(t,n,s),g(n,r),g(r,o),g(n,i),g(n,a),g(a,l),g(n,c),g(n,h),g(h,d),u||(f=[b(n,"click",e[10]),b(n,"keyup",e[9])],u=!0)},p(t,[e]){1&e&&z(o,t[0]),2&e&&z(l,t[1]),4&e&&w!==(w=t[6](t[2])+"")&&z(d,w),48&e&&S(n,"sy-list-preview-item-container--active",t[4]&&t[5])},i:t,o:t,d(t){t&&$(n),u=!1,s(f)}}}function Jn(t,e,n){let{headline:r=""}=e,{subtitle:s=""}=e,{content:o=""}=e,{index:i}=e,{active:a=!1}=e,{highlight:l}=e;const c=D();return t.$$set=t=>{"headline"in t&&n(0,r=t.headline),"subtitle"in t&&n(1,s=t.subtitle),"content"in t&&n(2,o=t.content),"index"in t&&n(3,i=t.index),"active"in t&&n(4,a=t.active),"highlight"in t&&n(5,l=t.highlight)},[r,s,o,i,a,l,t=>t.length>25?`${t.slice(0,22)}...`:t,c,()=>["sy-list-preview-item-container"].join(" "),t=>{13===t.keycode&&c("click",i)},()=>c("click",i)]}class Zn extends it{constructor(t){super(),ot(this,t,Jn,Kn,i,{headline:0,subtitle:1,content:2,index:3,active:4,highlight:5})}}function tr(t,e,n){const r=t.slice();return r[11]=e[n],r[13]=n,r}function er(e){let n,r;return n=new Gn({props:{spellcheck:!1,placeholder:"Filter",size:"large",id:e[4]}}),n.$on("keyup",e[6]),{c(){nt(n.$$.fragment)},m(t,e){rt(n,t,e),r=!0},p:t,i(t){r||(J(n.$$.fragment,t),r=!0)},o(t){Z(n.$$.fragment,t),r=!1},d(t){st(n,t)}}}function nr(t){let e,n;return e=new Zn({props:{headline:t[11].headline,subtitle:t[11].subtitle,content:t[11].content,active:t[2]===t[13],index:t[13],highlight:t[0]}}),e.$on("click",t[5]),e.$on("event",t[9]),{c(){nt(e.$$.fragment)},m(t,r){rt(e,t,r),n=!0},p(t,n){const r={};8&n&&(r.headline=t[11].headline),8&n&&(r.subtitle=t[11].subtitle),8&n&&(r.content=t[11].content),4&n&&(r.active=t[2]===t[13]),1&n&&(r.highlight=t[0]),e.$set(r)},i(t){n||(J(e.$$.fragment,t),n=!0)},o(t){Z(e.$$.fragment,t),n=!1},d(t){st(e,t)}}}function rr(t){let e,n,r,s=t[1]&&er(t),o=t[3],i=[];for(let e=0;eZ(i[t],1,1,(()=>{i[t]=null}));return{c(){s&&s.c(),e=y();for(let t=0;t{s=null})),K()),45&r){let e;for(o=t[3],e=0;e{"values"in t&&n(7,o=t.values),"highlight"in t&&n(0,i=t.highlight),"filterable"in t&&n(1,a=t.filterable),"component"in t&&n(8,l=t.component)},t.$$.update=()=>{if(130&t.$$.dirty&&o&&(n(3,c=o),a)){const t=document.getElementById(r);t&&(t.value="")}},[i,a,s,c,r,t=>{n(2,s=t.detail),h("selection",{index:o.indexOf(c[s]),value:c[s]})},t=>{t=t.detail,n(3,c=o.filter((e=>e.content.includes(t)||e.headline.includes(t)||e.subtitle.includes(t))))},o,l,function(e){L.call(this,t,e)}]}class or extends it{constructor(t){super(),ot(this,t,sr,rr,i,{values:7,highlight:0,filterable:1,component:8})}}function ir(t){let e,n,r;var s=t[6][t[0]];function o(t){return{props:{values:t[1],component:t[2],highlight:t[3],filterable:t[4]}}}return s&&(e=P(s,o(t)),e.$on("selection",t[7]),e.$on("event",t[8])),{c(){e&&nt(e.$$.fragment),n=x()},m(t,s){e&&rt(e,t,s),m(t,n,s),r=!0},p(t,[r]){const i={};if(2&r&&(i.values=t[1]),4&r&&(i.component=t[2]),8&r&&(i.highlight=t[3]),16&r&&(i.filterable=t[4]),1&r&&s!==(s=t[6][t[0]])){if(e){G();const t=e;Z(t.$$.fragment,1,0,(()=>{st(t,1)})),K()}s?(e=P(s,o(t)),e.$on("selection",t[7]),e.$on("event",t[8]),nt(e.$$.fragment),J(e.$$.fragment,1),rt(e,n.parentNode,n)):e=null}else s&&e.$set(i)},i(t){r||(e&&J(e.$$.fragment,t),r=!0)},o(t){e&&Z(e.$$.fragment,t),r=!1},d(t){t&&$(n),e&&st(e,t)}}}function ar(t,e,n){let{style:r="content"}=e,{values:s=[]}=e,{component:o}=e,{highlight:i}=e,{filterable:a=!1}=e;const l=D(),c={preview:or,content:Yn};return t.$$set=t=>{"style"in t&&n(0,r=t.style),"values"in t&&n(1,s=t.values),"component"in t&&n(2,o=t.component),"highlight"in t&&n(3,i=t.highlight),"filterable"in t&&n(4,a=t.filterable)},[r,s,o,i,a,l,c,t=>l("selection",t.detail),function(e){L.call(this,t,e)}]}class lr extends it{constructor(t){super(),ot(this,t,ar,ir,i,{style:0,values:1,component:2,highlight:3,filterable:4})}}function cr(t){let e,n,r,s;const o=t[3].default,i=l(o,t,t[2],null);return{c(){e=v("a"),i&&i.c(),C(e,"href","javascript:void(0)"),C(e,"class","dictionary-link svelte-vhlbnn"),C(e,"data-testid","dictionary-link")},m(o,a){m(o,e,a),i&&i.m(e,null),n=!0,r||(s=b(e,"click",t[4]),r=!0)},p(t,[e]){i&&i.p&&(!n||4&e)&&d(i,o,t,t[2],n?h(o,t[2],e,null):u(t[2]),null)},i(t){n||(J(i,t),n=!0)},o(t){Z(i,t),n=!1},d(t){t&&$(e),i&&i.d(t),r=!1,s()}}}function hr(t,e,n){let{$$slots:r={},$$scope:s}=e,{link:o}=e;const i=D(),a=()=>i("open",o);return t.$$set=t=>{"link"in t&&n(1,o=t.link),"$$scope"in t&&n(2,s=t.$$scope)},[a,o,s,r,()=>a()]}class dr extends it{constructor(t){super(),ot(this,t,hr,cr,i,{link:1})}}function ur(e){let n;return{c(){n=_(e[0])},m(t,e){m(t,n,e)},p(t,e){1&e&&z(n,t[0])},i:t,o:t,d(t){t&&$(n)}}}function pr(t){let e,n,r,s,o=t[0].split(t[1](t[0]))+"";return r=new dr({props:{link:t[3](t[1](t[0])),$$slots:{default:[fr]},$$scope:{ctx:t}}}),r.$on("open",t[4]),{c(){e=_(o),n=_(" \n\t\t"),nt(r.$$.fragment)},m(t,o){m(t,e,o),m(t,n,o),rt(r,t,o),s=!0},p(t,n){(!s||1&n)&&o!==(o=t[0].split(t[1](t[0]))+"")&&z(e,o);const i={};1&n&&(i.link=t[3](t[1](t[0]))),129&n&&(i.$$scope={dirty:n,ctx:t}),r.$set(i)},i(t){s||(J(r.$$.fragment,t),s=!0)},o(t){Z(r.$$.fragment,t),s=!1},d(t){t&&$(e),t&&$(n),st(r,t)}}}function fr(t){let e,n=t[2](t[1](t[0]))+"";return{c(){e=_(n)},m(t,n){m(t,e,n)},p(t,r){1&r&&n!==(n=t[2](t[1](t[0]))+"")&&z(e,n)},d(t){t&&$(e)}}}function gr(t){let e,n,r,s,o;const i=[pr,ur],a=[];function l(t,e){return 1&e&&(n=null),null==n&&(n=!!mr.test(t[0])),n?0:1}return r=l(t,-1),s=a[r]=i[r](t),{c(){e=v("div"),s.c(),C(e,"class","dictionary-content--definition-item svelte-1qtxwq5")},m(t,n){m(t,e,n),a[r].m(e,null),o=!0},p(t,[n]){let o=r;r=l(t,n),r===o?a[r].p(t,n):(G(),Z(a[o],1,1,(()=>{a[o]=null})),K(),s=a[r],s?s.p(t,n):(s=a[r]=i[r](t),s.c()),J(s,1),s.m(e,null))},i(t){o||(J(s),o=!0)},o(t){Z(s),o=!1},d(t){t&&$(e),a[r].d()}}}const mr=/\s\S+\[(\S|\s\S)+.\]/g;function $r(t,e,n){let{value:r}=e;const s=t=>{const e=t.split("[")[0].split("|");return{traditional:e[0],simplified:e[1]||e[0]}},o=D();return t.$$set=t=>{"value"in t&&n(0,r=t.value)},[r,t=>{const e=t.match(mr);return e?e[0]:null},t=>{const e=s(t);return e.traditional==e.simplified?`${e.traditional}`:`${e.simplified} (${e.traditional})`},t=>s(t).traditional,t=>o("event",t.detail)]}class wr extends it{constructor(t){super(),ot(this,t,$r,gr,i,{value:0})}}function vr(t,e,n){const r=t.slice();return r[2]=e[n],r[4]=n,r}function kr(t){let e,n,r,s=t[2]+"";return{c(){e=v("span"),n=_(s),C(e,"class",r=p(`colored-characters--tone-${t[1][t[4]]||5}`)+" svelte-sic3zr")},m(t,r){m(t,e,r),g(e,n)},p(t,o){1&o&&s!==(s=t[2]+"")&&z(n,s),2&o&&r!==(r=p(`colored-characters--tone-${t[1][t[4]]||5}`)+" svelte-sic3zr")&&C(e,"class",r)},d(t){t&&$(e)}}}function _r(e){let n,r=e[0],s=[];for(let t=0;t{"characters"in t&&n(0,r=t.characters),"tones"in t&&n(1,s=t.tones)},[r,s]}class xr extends it{constructor(t){super(),ot(this,t,yr,_r,i,{characters:0,tones:1})}}function br(t){let e,n,r,s;return n=new xr({props:{characters:t[0].traditional,tones:t[0].tone_marks}}),{c(){e=_(" ("),nt(n.$$.fragment),r=_(")")},m(t,o){m(t,e,o),rt(n,t,o),m(t,r,o),s=!0},p(t,e){const r={};1&e&&(r.characters=t[0].traditional),1&e&&(r.tones=t[0].tone_marks),n.$set(r)},i(t){s||(J(n.$$.fragment,t),s=!0)},o(t){Z(n.$$.fragment,t),s=!1},d(t){t&&$(e),st(n,t),t&&$(r)}}}function Cr(t){let e,n,r,s,o,i,a,l,c,h=t[0].pinyin_marks+"";r=new xr({props:{characters:t[0].simplified,tones:t[0].tone_marks}});let d=t[0].simplified!=t[0].traditional&&br(t);return{c(){e=v("div"),n=v("h1"),nt(r.$$.fragment),s=y(),d&&d.c(),o=y(),i=v("div"),a=v("h3"),l=_(h),C(n,"class","chinese-characters--character-container chinese-characters--character svelte-k2y6zv"),C(n,"data-testid","chinese-characters"),C(a,"class","chinese-characters--pinyin-container svelte-k2y6zv"),C(e,"class","chinese-characters--container svelte-k2y6zv")},m(t,h){m(t,e,h),g(e,n),rt(r,n,null),g(n,s),d&&d.m(n,null),g(e,o),g(e,i),g(i,a),g(a,l),c=!0},p(t,[e]){const s={};1&e&&(s.characters=t[0].simplified),1&e&&(s.tones=t[0].tone_marks),r.$set(s),t[0].simplified!=t[0].traditional?d?(d.p(t,e),1&e&&J(d,1)):(d=br(t),d.c(),J(d,1),d.m(n,null)):d&&(G(),Z(d,1,1,(()=>{d=null})),K()),(!c||1&e)&&h!==(h=t[0].pinyin_marks+"")&&z(l,h)},i(t){c||(J(r.$$.fragment,t),J(d),c=!0)},o(t){Z(r.$$.fragment,t),Z(d),c=!1},d(t){t&&$(e),st(r),d&&d.d()}}}function zr(t,e,n){let{word:r={}}=e;return t.$$set=t=>{"word"in t&&n(0,r=t.word)},[r]}class Sr extends it{constructor(t){super(),ot(this,t,zr,Cr,i,{word:0})}}function Pr(t){let e,n,r,s=t[0].traditional+"";return{c(){e=_(" ("),n=_(s),r=_(")")},m(t,s){m(t,e,s),m(t,n,s),m(t,r,s)},p(t,e){1&e&&s!==(s=t[0].traditional+"")&&z(n,s)},d(t){t&&$(e),t&&$(n),t&&$(r)}}}function Tr(t){let e,n,r,s=t[0].simplified+"",o=t[0].simplified!=t[0].traditional&&Pr(t);return{c(){e=_(s),n=y(),o&&o.c(),r=x()},m(t,s){m(t,e,s),m(t,n,s),o&&o.m(t,s),m(t,r,s)},p(t,n){1&n&&s!==(s=t[0].simplified+"")&&z(e,s),t[0].simplified!=t[0].traditional?o?o.p(t,n):(o=Pr(t),o.c(),o.m(r.parentNode,r)):o&&(o.d(1),o=null)},d(t){t&&$(e),t&&$(n),o&&o.d(t),t&&$(r)}}}function Er(t){let e,n,r;return n=new dr({props:{link:t[0].traditional,$$slots:{default:[Tr]},$$scope:{ctx:t}}}),n.$on("open",t[1]),{c(){e=v("div"),nt(n.$$.fragment),C(e,"class","dictionary-content--mw svelte-n92ii8")},m(t,s){m(t,e,s),rt(n,e,null),r=!0},p(t,[e]){const r={};1&e&&(r.link=t[0].traditional),9&e&&(r.$$scope={dirty:e,ctx:t}),n.$set(r)},i(t){r||(J(n.$$.fragment,t),r=!0)},o(t){Z(n.$$.fragment,t),r=!1},d(t){t&&$(e),st(n)}}}function Wr(t,e,n){let{value:r}=e;const s=D();return t.$$set=t=>{"value"in t&&n(0,r=t.value)},[r,t=>s("event",t.detail)]}class Mr extends it{constructor(t){super(),ot(this,t,Wr,Er,i,{value:0})}}function Dr(t,e,n){const r=t.slice();return r[18]=e[n],r}function Lr(t){let e,n,r,s,o,i,a,l,c,h,d,u,p;n=new Sr({props:{word:t[0]}}),s=new Wn({props:{$$slots:{default:[Fr]},$$scope:{ctx:t}}}),c=new lr({props:{values:t[0].english,component:wr}}),c.$on("event",t[2]);let f=t[0].measure_words.length&&Hr(t),w="string"==typeof t[0].notes&&Ur(t);return{c(){e=v("section"),nt(n.$$.fragment),r=y(),nt(s.$$.fragment),o=y(),i=v("section"),a=v("h2"),a.textContent="Definitions",l=y(),nt(c.$$.fragment),h=y(),f&&f.c(),d=y(),w&&w.c(),u=x(),C(e,"class","dictionary-content dictionary-content--header svelte-1dqewiq"),C(a,"class","dictionary-content--section-title svelte-1dqewiq"),C(i,"class","dictionary-content svelte-1dqewiq")},m(t,$){m(t,e,$),rt(n,e,null),g(e,r),rt(s,e,null),m(t,o,$),m(t,i,$),g(i,a),g(i,l),rt(c,i,null),m(t,h,$),f&&f.m(t,$),m(t,d,$),w&&w.m(t,$),m(t,u,$),p=!0},p(t,e){const r={};1&e&&(r.word=t[0]),n.$set(r);const o={};2097154&e&&(o.$$scope={dirty:e,ctx:t}),s.$set(o);const i={};1&e&&(i.values=t[0].english),c.$set(i),t[0].measure_words.length?f?(f.p(t,e),1&e&&J(f,1)):(f=Hr(t),f.c(),J(f,1),f.m(d.parentNode,d)):f&&(G(),Z(f,1,1,(()=>{f=null})),K()),"string"==typeof t[0].notes?w?w.p(t,e):(w=Ur(t),w.c(),w.m(u.parentNode,u)):w&&(w.d(1),w=null)},i(t){p||(J(n.$$.fragment,t),J(s.$$.fragment,t),J(c.$$.fragment,t),J(f),p=!0)},o(t){Z(n.$$.fragment,t),Z(s.$$.fragment,t),Z(c.$$.fragment,t),Z(f),p=!1},d(t){t&&$(e),st(n),st(s),t&&$(o),t&&$(i),st(c),t&&$(h),f&&f.d(t),t&&$(d),w&&w.d(t),t&&$(u)}}}function Ar(t){let e,n;return e=new Pn({props:{grouped:"true",classes:["sy-tooltip--container"],$$slots:{default:[Br]},$$scope:{ctx:t}}}),e.$on("click",(function(){o(t[18].action)&&t[18].action.apply(this,arguments)})),{c(){nt(e.$$.fragment)},m(t,r){rt(e,t,r),n=!0},p(n,r){t=n;const s={};2097154&r&&(s.$$scope={dirty:r,ctx:t}),e.$set(s)},i(t){n||(J(e.$$.fragment,t),n=!0)},o(t){Z(e.$$.fragment,t),n=!1},d(t){st(e,t)}}}function Rr(t){let e,n;return e=new jn({props:{values:t[18].dropdown,position:"right",$$slots:{default:[Nr]},$$scope:{ctx:t}}}),e.$on("selection",t[4]),{c(){nt(e.$$.fragment)},m(t,r){rt(e,t,r),n=!0},p(t,n){const r={};2&n&&(r.values=t[18].dropdown),2097154&n&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(J(e.$$.fragment,t),n=!0)},o(t){Z(e.$$.fragment,t),n=!1},d(t){st(e,t)}}}function Ir(t){let e,n,r,s=t[18].tooltip+"";return{c(){e=v("div"),n=v("p"),r=_(s),C(e,"class","sy-tooltip--body sy-tooltip--body-bottom")},m(t,s){m(t,e,s),g(e,n),g(n,r)},p(t,e){2&e&&s!==(s=t[18].tooltip+"")&&z(r,s)},d(t){t&&$(e)}}}function Br(t){let e,n,r,s;var o=t[18].component;o&&(e=P(o,{props:{size:"18"}}));let i=t[18].tooltip&&Ir(t);return{c(){e&&nt(e.$$.fragment),n=y(),i&&i.c(),r=y()},m(t,o){e&&rt(e,t,o),m(t,n,o),i&&i.m(t,o),m(t,r,o),s=!0},p(t,s){if(2&s&&o!==(o=t[18].component)){if(e){G();const t=e;Z(t.$$.fragment,1,0,(()=>{st(t,1)})),K()}o?(e=P(o,{props:{size:"18"}}),nt(e.$$.fragment),J(e.$$.fragment,1),rt(e,n.parentNode,n)):e=null}t[18].tooltip?i?i.p(t,s):(i=Ir(t),i.c(),i.m(r.parentNode,r)):i&&(i.d(1),i=null)},i(t){s||(e&&J(e.$$.fragment,t),s=!0)},o(t){e&&Z(e.$$.fragment,t),s=!1},d(t){e&&st(e,t),t&&$(n),i&&i.d(t),t&&$(r)}}}function jr(t){let e,n,r,s=t[18].tooltip+"";return{c(){e=v("div"),n=v("p"),r=_(s),C(e,"class","sy-tooltip--body sy-tooltip--body-bottom")},m(t,s){m(t,e,s),g(e,n),g(n,r)},p(t,e){2&e&&s!==(s=t[18].tooltip+"")&&z(r,s)},d(t){t&&$(e)}}}function Or(t){let e,n,r,s;var o=t[18].component;o&&(e=P(o,{props:{size:"18"}}));let i=t[18].tooltip&&jr(t);return{c(){e&&nt(e.$$.fragment),n=y(),i&&i.c(),r=x()},m(t,o){e&&rt(e,t,o),m(t,n,o),i&&i.m(t,o),m(t,r,o),s=!0},p(t,s){if(2&s&&o!==(o=t[18].component)){if(e){G();const t=e;Z(t.$$.fragment,1,0,(()=>{st(t,1)})),K()}o?(e=P(o,{props:{size:"18"}}),nt(e.$$.fragment),J(e.$$.fragment,1),rt(e,n.parentNode,n)):e=null}t[18].tooltip?i?i.p(t,s):(i=jr(t),i.c(),i.m(r.parentNode,r)):i&&(i.d(1),i=null)},i(t){s||(e&&J(e.$$.fragment,t),s=!0)},o(t){e&&Z(e.$$.fragment,t),s=!1},d(t){e&&st(e,t),t&&$(n),i&&i.d(t),t&&$(r)}}}function Nr(t){let e,n,r;return e=new Pn({props:{grouped:"true",classes:["sy-tooltip--container",...t[18].classes],$$slots:{default:[Or]},$$scope:{ctx:t}}}),e.$on("click",(function(){o(t[18].action)&&t[18].action.apply(this,arguments)})),{c(){nt(e.$$.fragment),n=y()},m(t,s){rt(e,t,s),m(t,n,s),r=!0},p(n,r){t=n;const s={};2&r&&(s.classes=["sy-tooltip--container",...t[18].classes]),2097154&r&&(s.$$scope={dirty:r,ctx:t}),e.$set(s)},i(t){r||(J(e.$$.fragment,t),r=!0)},o(t){Z(e.$$.fragment,t),r=!1},d(t){st(e,t),t&&$(n)}}}function qr(t){let e,n,r,s;const o=[Rr,Ar],i=[];function a(t,e){return t[18].dropdown?0:1}return e=a(t),n=i[e]=o[e](t),{c(){n.c(),r=x()},m(t,n){i[e].m(t,n),m(t,r,n),s=!0},p(t,s){let l=e;e=a(t),e===l?i[e].p(t,s):(G(),Z(i[l],1,1,(()=>{i[l]=null})),K(),n=i[e],n?n.p(t,s):(n=i[e]=o[e](t),n.c()),J(n,1),n.m(r.parentNode,r))},i(t){s||(J(n),s=!0)},o(t){Z(n),s=!1},d(t){i[e].d(t),t&&$(r)}}}function Fr(t){let e,n,r=t[1],s=[];for(let e=0;eZ(s[t],1,1,(()=>{s[t]=null}));return{c(){for(let t=0;t{r=null})),K())},i(t){n||(J(r),n=!0)},o(t){Z(r),n=!1},d(t){t&&$(e),r&&r.d()}}}function Yr(t,e,n){let r,{word:s}=e,{lists:o=[]}=e,{backgroundColor:i="grey"}=e,a=[];const l=()=>{window.bookmarkManager.inList(s.hash).then((t=>{n(8,a=t),n(1,r[0].component=f(),r),n(1,r[0].tooltip=g(),r)})).catch((t=>{Ke("There was an error fetching list membership. Check the log for more details.",t)}))},c=(t,e,n)=>{window.bookmarkManager[t](e,n).then((()=>{l()})).catch((t=>{Ke("There was an error modifying the list membership. Check the log for more details.",{e:t,word:n,list:e})}))},h=(t,e)=>{c("removeFromList",t,e)},d=(t,e)=>{c("addToList",t,e)},u=window.__TAURI__.invoke,p=D(),f=()=>a.length?At:$e,g=()=>`${a.length?"Remove from":"Add to"} ${o.length>1?"List":"Bookmarks"}`;let m;return t.$$set=t=>{"word"in t&&n(0,s=t.word),"lists"in t&&n(6,o=t.lists),"backgroundColor"in t&&n(7,i=t.backgroundColor)},t.$$.update=()=>{1&t.$$.dirty&&s&&l(),321&t.$$.dirty&&n(1,r=[{component:f(),tooltip:g(),action:()=>{if(1===o.length){const t=o[0];a.includes(t)?h(t,s):d(t,s)}},dropdown:1===o.length?void 0:o.map((t=>{let e=a.includes(t);return{text:t,id:t,component:e?qn:Ln,icon:e?At:void 0,hover:e?"red":void 0}})),classes:["sy-button--grouped--first"]},{component:ne,tooltip:"Enlarge Characters",action:()=>{u("open_character_window",{word:{traditional:s.traditional,simplified:s.simplified}}).catch((t=>{Ke("An unknown error occurred while trying to open the enlarged character window. Please check the log for more details.",t)}))}}])},[s,r,t=>p("link",t.detail),()=>{const t=s;clearTimeout(m),m=setTimeout((()=>{const e=document.getElementById("dictionary-content--notes").value.trim();window.bookmarkManager.updateProperty(t.hash,"notes",e).then((()=>{t.notes=e})).catch((t=>{Ke("An unknown error occurred while trying to save the notes. Please check the log for more details.",t)}))}),500)},t=>{const e=t.detail;a.includes(e)?h(e,s):d(e,s)},()=>["dictionary-content-container",`dictionary-content--background-${i}`].join(" "),o,i,a]}class Qr extends it{constructor(t){super(),ot(this,t,Yr,Vr,i,{word:0,lists:6,backgroundColor:7})}}function Xr(e){let n;return{c(){n=v("hr"),C(n,"class","sy-dropdown--divider svelte-n4h875")},m(t,e){m(t,n,e)},p:t,i:t,o:t,d(t){t&&$(n)}}}function Gr(t,e,n){let{text:r}=e,{icon:s}=e;return t.$$set=t=>{"text"in t&&n(0,r=t.text),"icon"in t&&n(1,s=t.icon)},[r,s]}class Kr extends it{constructor(t){super(),ot(this,t,Gr,Xr,i,{text:0,icon:1})}}const Jr=t=>({}),Zr=t=>({}),ts=t=>({}),es=t=>({});function ns(e){let n,r;return n=new Ne({props:{size:"14"}}),{c(){nt(n.$$.fragment)},m(t,e){rt(n,t,e),r=!0},p:t,i(t){r||(J(n.$$.fragment,t),r=!0)},o(t){Z(n.$$.fragment,t),r=!1},d(t){st(n,t)}}}function rs(t){let e,n,r,s,o,i,a,c,p,f,w,k,x,b;a=new Pn({props:{style:"ghost",$$slots:{default:[ns]},$$scope:{ctx:t}}}),a.$on("click",t[4]);const P=t[3].body,T=l(P,t,t[5],es),E=t[3].footer,W=l(E,t,t[5],Zr);return{c(){e=v("div"),n=v("div"),r=v("div"),s=v("h2"),o=_(t[1]),i=y(),nt(a.$$.fragment),c=y(),p=v("div"),T&&T.c(),f=y(),w=v("div"),W&&W.c(),k=y(),x=v("div"),C(s,"class","sy-modal--title svelte-sr1ian"),C(r,"class","sy-modal--header svelte-sr1ian"),C(p,"class","sy-modal--body svelte-sr1ian"),C(w,"class","sy-modal--footer svelte-sr1ian"),C(n,"class","sy-modal--content svelte-sr1ian"),C(x,"class","sy-modal--backdrop svelte-sr1ian"),C(e,"class","sy-modal--container svelte-sr1ian"),S(e,"sy-modal--active",t[0])},m(t,l){m(t,e,l),g(e,n),g(n,r),g(r,s),g(s,o),g(r,i),rt(a,r,null),g(n,c),g(n,p),T&&T.m(p,null),g(n,f),g(n,w),W&&W.m(w,null),g(e,k),g(e,x),b=!0},p(t,[n]){(!b||2&n)&&z(o,t[1]);const r={};32&n&&(r.$$scope={dirty:n,ctx:t}),a.$set(r),T&&T.p&&(!b||32&n)&&d(T,P,t,t[5],b?h(P,t[5],n,ts):u(t[5]),es),W&&W.p&&(!b||32&n)&&d(W,E,t,t[5],b?h(E,t[5],n,Jr):u(t[5]),Zr),(!b||1&n)&&S(e,"sy-modal--active",t[0])},i(t){b||(J(a.$$.fragment,t),J(T,t),J(W,t),b=!0)},o(t){Z(a.$$.fragment,t),Z(T,t),Z(W,t),b=!1},d(t){t&&$(e),st(a),T&&T.d(t),W&&W.d(t)}}}function ss(t,e,n){let{$$slots:r={},$$scope:s}=e,{visible:o=!1}=e,{title:i=""}=e;const a=D();return t.$$set=t=>{"visible"in t&&n(0,o=t.visible),"title"in t&&n(1,i=t.title),"$$scope"in t&&n(5,s=t.$$scope)},[o,i,a,r,t=>{a("close",t)},s]}class os extends it{constructor(t){super(),ot(this,t,ss,rs,i,{visible:0,title:1})}}function is(t,e,n){const r=t.slice();return r[30]=e[n],r}function as(t){let e,n,r,s;return r=new Bt({props:{size:"20"}}),{c(){e=_(t[0]),n=_(" "),nt(r.$$.fragment)},m(t,o){m(t,e,o),m(t,n,o),rt(r,t,o),s=!0},p(t,n){(!s||1&n[0])&&z(e,t[0])},i(t){s||(J(r.$$.fragment,t),s=!0)},o(t){Z(r.$$.fragment,t),s=!1},d(t){t&&$(e),t&&$(n),st(r,t)}}}function ls(t){let e,n;return e=new Pn({props:{size:"large",style:"ghost",center:!0,$$slots:{default:[as]},$$scope:{ctx:t}}}),{c(){nt(e.$$.fragment)},m(t,r){rt(e,t,r),n=!0},p(t,n){const r={};1&n[0]|4&n[1]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(J(e.$$.fragment,t),n=!0)},o(t){Z(e.$$.fragment,t),n=!1},d(t){st(e,t)}}}function cs(t){let e,n,r,s;return n=new Pn({props:{style:"ghost",disabled:t[30].disabled,hover:t[30].hover,classes:["sy-tooltip--container"],$$slots:{default:[hs]},$$scope:{ctx:t}}}),n.$on("click",t[30].action),{c(){e=v("span"),nt(n.$$.fragment),r=y(),C(e,"class","bookmarks--header--action-item svelte-12dvz92")},m(t,o){m(t,e,o),rt(n,e,null),g(e,r),s=!0},p(t,e){const r={};4&e[1]&&(r.$$scope={dirty:e,ctx:t}),n.$set(r)},i(t){s||(J(n.$$.fragment,t),s=!0)},o(t){Z(n.$$.fragment,t),s=!1},d(t){t&&$(e),st(n)}}}function hs(t){let e,n,r,s,o,i,a=t[30].tooltip+"";var l=t[30].icon;return l&&(e=P(l,{props:{size:"20"}})),{c(){e&&nt(e.$$.fragment),n=y(),r=v("div"),s=v("p"),o=_(a),C(r,"class","sy-tooltip--body sy-tooltip--body-bottom")},m(t,a){e&&rt(e,t,a),m(t,n,a),m(t,r,a),g(r,s),g(s,o),i=!0},p(t,r){if(l!==(l=t[30].icon)){if(e){G();const t=e;Z(t.$$.fragment,1,0,(()=>{st(t,1)})),K()}l?(e=P(l,{props:{size:"20"}}),nt(e.$$.fragment),J(e.$$.fragment,1),rt(e,n.parentNode,n)):e=null}},i(t){i||(e&&J(e.$$.fragment,t),i=!0)},o(t){e&&Z(e.$$.fragment,t),i=!1},d(t){e&&st(e,t),t&&$(n),t&&$(r)}}}function ds(t){let e,n,r=!t[30].exclude.includes(t[0]),s=r&&cs(t);return{c(){s&&s.c(),e=x()},m(t,r){s&&s.m(t,r),m(t,e,r),n=!0},p(t,n){1&n[0]&&(r=!t[30].exclude.includes(t[0])),r?s?(s.p(t,n),1&n[0]&&J(s,1)):(s=cs(t),s.c(),J(s,1),s.m(e.parentNode,e)):s&&(G(),Z(s,1,1,(()=>{s=null})),K())},i(t){n||(J(s),n=!0)},o(t){Z(s),n=!1},d(t){s&&s.d(t),t&&$(e)}}}function us(e){let n,r,s,o,i;return o=new Gn({props:{size:"large",placeholder:`ex. ${e[10]()}`,id:"create-new-list-input"}}),{c(){n=v("div"),r=v("p"),r.textContent="What would you like to call this list?",s=y(),nt(o.$$.fragment),C(n,"class","bookmarks-modal-content svelte-12dvz92"),C(n,"slot","body")},m(t,e){m(t,n,e),g(n,r),g(n,s),rt(o,n,null),i=!0},p:t,i(t){i||(J(o.$$.fragment,t),i=!0)},o(t){Z(o.$$.fragment,t),i=!1},d(t){t&&$(n),st(o)}}}function ps(t){let e;return{c(){e=_("Cancel")},m(t,n){m(t,e,n)},d(t){t&&$(e)}}}function fs(t){let e;return{c(){e=_("Create")},m(t,n){m(t,e,n)},d(t){t&&$(e)}}}function gs(t){let e,n,r,s;return e=new Pn({props:{size:"large",$$slots:{default:[ps]},$$scope:{ctx:t}}}),e.$on("click",t[11]),r=new Pn({props:{size:"large",color:"green",disabled:t[6],$$slots:{default:[fs]},$$scope:{ctx:t}}}),r.$on("click",t[12]),{c(){nt(e.$$.fragment),n=_("\n\t\t\t \n\t\t\t"),nt(r.$$.fragment)},m(t,o){rt(e,t,o),m(t,n,o),rt(r,t,o),s=!0},p(t,n){const s={};4&n[1]&&(s.$$scope={dirty:n,ctx:t}),e.$set(s);const o={};64&n[0]&&(o.disabled=t[6]),4&n[1]&&(o.$$scope={dirty:n,ctx:t}),r.$set(o)},i(t){s||(J(e.$$.fragment,t),J(r.$$.fragment,t),s=!0)},o(t){Z(e.$$.fragment,t),Z(r.$$.fragment,t),s=!1},d(t){st(e,t),t&&$(n),st(r,t)}}}function ms(t){let e,n,r,s,o,i,a,l,c,h,d,u,p,f,k;r=new jn({props:{values:t[3],$$slots:{default:[ls]},$$scope:{ctx:t}}}),r.$on("selection",t[9]);let _=t[14],x=[];for(let e=0;e<_.length;e+=1)x[e]=ds(is(t,_,e));const b=t=>Z(x[t],1,1,(()=>{x[t]=null}));return c=new lr({props:{style:"preview",values:t[4],highlight:t[7],filterable:!0}}),c.$on("selection",t[13]),u=new Qr({props:{word:t[1],lists:t[2]}}),f=new os({props:{title:"Create List",visible:t[5],$$slots:{footer:[gs],body:[us]},$$scope:{ctx:t}}}),f.$on("close",t[11]),{c(){e=v("div"),n=v("div"),nt(r.$$.fragment),s=y(),o=v("div");for(let t=0;t{window.bookmarkManager.getLists().then((e=>{n(2,a=e),n(3,l=[...e.map((t=>({text:t,id:t,component:Ln}))).sort(((t,e)=>t.text.localeCompare(e.text))),{component:Kr},{text:"Create New",id:"create-new",component:qn,icon:$e,color:"blue",hover:"green"}]),t()})).catch((t=>{Ke("There was an error fetching word lists. Check the logs for more details.",t)}))};c((()=>{}));let h=[],d=[];const u=t=>{window.bookmarkManager.getListContent(i).then((e=>{var r;h=e,n(4,(r=e,n(7,v=!1),d=r.map((t=>({headline:t.traditional===t.simplified?t.simplified:`${t.simplified} (${t.traditional})`,subtitle:t.pinyin_marks,content:t.english.join("; "),active:!1}))))),t()})).catch((t=>{Ke("There was an error fetching the word list content. Check the logs for more details.",t)}))};u((()=>{}));const p=t=>{n(0,i=t),u((()=>{}))},f=["HSK 1","Week 3 Vocab","Internet Slang","Idioms","Chapter 7"],g=["create-new","Bookmarks"];let m=!1,$=!1;const w=()=>{n(5,m=!1),document.getElementById("create-new-list-input").value="",n(6,$=!1)};let v=!0,k=!1;return[i,o,a,l,d,m,$,v,s,t=>{"create-new"!==t.detail?p(t.detail):n(5,m=!0)},()=>f.slice(Math.random()*f.length)[0],w,()=>{n(6,$=!0);const t=document.getElementById("create-new-list-input").value.trim();if(!t||g.includes(t))return Ke(`Cannot create new list with name ${t}.`),void w();window.bookmarkManager.createList(t).then((()=>{c((()=>{w()}))})).catch((e=>{Ke(`There was an unexpected error while attempting to create the list ${t}. Check the log for more details.`,e),w()}))},t=>{n(1,o=h[t.detail.index]),n(7,v=!0)},[{icon:Gt,action:()=>{r("import_list_data").then((t=>{if(t){const e=((t,e)=>{let n=t,r=2;for(;e.includes(n)&&r<=100;)n=`${t} ${r}`,r++;return n})(t.meta.name,a);window.bookmarkManager.createList(e).then((()=>{const n=t.entries.reduceRight(((t,e)=>t.find((t=>t.hash===e.hash))?t:[...t,e]),[]).map((t=>window.bookmarkManager.addToList(e,t)));return Promise.all(n)})).then((()=>{c((()=>{}))})).catch((t=>{Ke("There was an error importing the list. Check the log for more details.",t)}))}})).catch((t=>{Ke("There was an error importing the list. Check the log for more details.",t)}))},tooltip:"Import",exclude:[],disabled:!1},{icon:Be,action:()=>{r("export_list_data",{name:i,data:h}).then((()=>{})).catch((t=>{Ke("There was an error exporting your list. Check the log for more details.",t)}))},tooltip:"Export",exclude:[],disabled:!1},{icon:Me,action:()=>{k=!0,window.__TAURI__.dialog.ask(`Are you sure you want to delete ${i}?`,"Delete List").then((t=>{t?window.bookmarkManager.deleteList(i).then((()=>{p("Bookmarks"),c((()=>{k=!1}))})).catch((t=>{Ke(`There was an unexpected error deleting the list ${i}. Please check the log for more details.`,t),k=!1})):k=!1})).catch((t=>{Ke(`There was an unexpected error while attempting to delete the list ${i}. Check the log for more details.`,t),k=!1}))},tooltip:"Delete",exclude:["Bookmarks"],disabled:k,hover:"red"}]]}class ws extends it{constructor(t){super(),ot(this,t,$s,ms,i,{},null,[-1,-1])}}function vs(e){let n,r;return{c(){n=v("center"),r=v("h1"),r.textContent=`${ks}`},m(t,e){m(t,n,e),g(n,r)},p:t,i:t,o:t,d(t){t&&$(n)}}}let ks="CHAT";class _s extends it{constructor(t){super(),ot(this,t,null,vs,i,{})}}function ys(e){let n,r;return{c(){n=v("center"),r=v("h1"),r.textContent=`${xs}`},m(t,e){m(t,n,e),g(n,r)},p:t,i:t,o:t,d(t){t&&$(n)}}}let xs="HELP";class bs extends it{constructor(t){super(),ot(this,t,null,ys,i,{})}}function Cs(e){let n,r;return{c(){n=v("center"),r=v("h1"),r.textContent=`${zs}`},m(t,e){m(t,n,e),g(n,r)},p:t,i:t,o:t,d(t){t&&$(n)}}}let zs="NOT FOUND";class Ss extends it{constructor(t){super(),ot(this,t,null,Cs,i,{})}}function Ps(e){let n,r;return{c(){n=v("center"),r=v("h1"),r.textContent=`${Ts}`},m(t,e){m(t,n,e),g(n,r)},p:t,i:t,o:t,d(t){t&&$(n)}}}let Ts="READER";class Es extends it{constructor(t){super(),ot(this,t,null,Ps,i,{})}}function Ws(e){let n,r;return n=new Nt({props:{size:"20"}}),{c(){nt(n.$$.fragment)},m(t,e){rt(n,t,e),r=!0},p:t,i(t){r||(J(n.$$.fragment,t),r=!0)},o(t){Z(n.$$.fragment,t),r=!1},d(t){st(n,t)}}}function Ms(e){let n,r;return n=new Ht({props:{size:"20"}}),{c(){nt(n.$$.fragment)},m(t,e){rt(n,t,e),r=!0},p:t,i(t){r||(J(n.$$.fragment,t),r=!0)},o(t){Z(n.$$.fragment,t),r=!1},d(t){st(n,t)}}}function Ds(t){let e;return{c(){e=_(t[4])},m(t,n){m(t,e,n)},p(t,n){16&n&&z(e,t[4])},d(t){t&&$(e)}}}function Ls(t){let e,n,r,s,o,i,a,l,c,h,d,u,p,f,w,k,_,x;return r=new Pn({props:{style:"ghost",size:"large",disabled:null==t[7][t[0]-1],$$slots:{default:[Ws]},$$scope:{ctx:t}}}),r.$on("click",t[9]),o=new Pn({props:{style:"ghost",size:"large",disabled:null==t[7][t[0]+1],$$slots:{default:[Ms]},$$scope:{ctx:t}}}),o.$on("click",t[10]),a=new Pn({props:{style:"ghost",size:"large",$$slots:{default:[Ds]},$$scope:{ctx:t}}}),a.$on("click",t[15]),c=new Gn({props:{spellcheck:"false",style:"ghost",size:"large",placeholder:"Search...",id:"search",transparency:Rs}}),c.$on("change",t[16]),c.$on("keyup",t[17]),c.$on("enter",t[13]),f=new lr({props:{style:"preview",values:t[1],highlight:t[5]}}),f.$on("selection",t[12]),_=new Qr({props:{word:t[3],lists:t[2]}}),_.$on("link",t[14]),{c(){e=v("div"),n=v("div"),nt(r.$$.fragment),s=y(),nt(o.$$.fragment),i=y(),nt(a.$$.fragment),l=y(),nt(c.$$.fragment),d=y(),u=v("div"),p=v("div"),nt(f.$$.fragment),w=y(),k=v("div"),nt(_.$$.fragment),C(n,"class","search-bar-container svelte-sv63r7"),C(n,"data-testid","search-bar-container"),C(n,"data-tauri-drag-region",h=!!t[6]||void 0),S(n,"search-bar-container--transparency",Rs),C(p,"class","search-results svelte-sv63r7"),C(p,"data-elastic",""),C(k,"class","dictionary-content svelte-sv63r7"),C(u,"class","search-content-container svelte-sv63r7"),C(e,"class","search-page-container svelte-sv63r7")},m(t,h){m(t,e,h),g(e,n),rt(r,n,null),g(n,s),rt(o,n,null),g(n,i),rt(a,n,null),g(n,l),rt(c,n,null),g(e,d),g(e,u),g(u,p),rt(f,p,null),g(u,w),g(u,k),rt(_,k,null),x=!0},p(t,[e]){const s={};1&e&&(s.disabled=null==t[7][t[0]-1]),33554432&e&&(s.$$scope={dirty:e,ctx:t}),r.$set(s);const i={};1&e&&(i.disabled=null==t[7][t[0]+1]),33554432&e&&(i.$$scope={dirty:e,ctx:t}),o.$set(i);const l={};33554448&e&&(l.$$scope={dirty:e,ctx:t}),a.$set(l),(!x||64&e&&h!==(h=!!t[6]||void 0))&&C(n,"data-tauri-drag-region",h);const c={};2&e&&(c.values=t[1]),32&e&&(c.highlight=t[5]),f.$set(c);const d={};8&e&&(d.word=t[3]),4&e&&(d.lists=t[2]),_.$set(d)},i(t){x||(J(r.$$.fragment,t),J(o.$$.fragment,t),J(a.$$.fragment,t),J(c.$$.fragment,t),J(f.$$.fragment,t),J(_.$$.fragment,t),x=!0)},o(t){Z(r.$$.fragment,t),Z(o.$$.fragment,t),Z(a.$$.fragment,t),Z(c.$$.fragment,t),Z(f.$$.fragment,t),Z(_.$$.fragment,t),x=!1},d(t){t&&$(e),st(r),st(o),st(a),st(c),st(f),st(_)}}}let As,Rs=!1;function Is(t,e,n){let r,s=-1,o=[],i=[],a=[],l=[],c="EN",h=!0,d=!1;window.__TAURI__.os.platform().then((t=>{n(6,d="darwin"===t)}));const u=window.__TAURI__.invoke,p=["EN","PY","ZH"],f=(t,e)=>{(t.length||e)&&(n(5,h=!1),a=t,n(1,i=t.map((t=>({headline:t.traditional===t.simplified?t.simplified:`${t.simplified} (${t.traditional})`,subtitle:t.pinyin_marks,content:t.english.join("; "),active:!1})))))},g=(t,e,r)=>{t?(u("classify",{text:t}).then((t=>{n(4,c=t)})).catch((t=>{Ke("There was an error classifying the language of your query.",t)})),u("query",{text:t}).then((t=>{f(t,e),null!=r&&q().then((()=>{w(r)}))})).catch((t=>{Ke("There was an error searching the dictionary for your query.",t)}))):f([],!0)},m=(t,e)=>{n(3,r=t),n(5,h=e)},$=()=>{const t=p.indexOf(c)+1;n(4,c=p[t{try{switch(e){case"EN":u("query_by_english",{text:t}).then((t=>f(t,!0)));break;case"PY":u("query_by_pinyin",{text:t}).then((t=>f(t,!0)));break;case"ZH":u("query_by_chinese",{text:t}).then((t=>f(t,!0)))}}catch(t){Ke("There was an error searching the dictionary for your query.",t)}})(document.getElementById("search").value,c)},w=t=>{try{document.getElementsByClassName("sy-list-preview-item-container")[t].click()}catch(t){}};window.bookmarkManager.getLists().then((t=>{n(2,l=t)})).catch((t=>{Ke("There was an error fetching word lists. Check the log for more details.",t)}));return[s,i,l,r,c,h,d,o,g,t=>{n(0,s-=1),m(o[s],!1)},t=>{n(0,s+=1),m(o[s],!1)},$,t=>{const e=a[t.detail.index];m(e,!0);let r=o.map((t=>t.word_id)).indexOf(e.word_id);r>=0&&(o.splice(r,1),n(0,s-=1)),o.push(e),n(0,s+=1)},t=>{w(0)},t=>{const e=t.detail;document.getElementById("search").value=e,g(e,!0,0)},()=>$(),t=>g(t.detail,!0),t=>g(t.detail,!1)]}class Bs extends it{constructor(t){super(),ot(this,t,Is,Ls,i,{})}}function js(t,e,n){const r=t.slice();return r[7]=e[n],r}function Os(t){let e,n,r,s,o,i,a,l,c=t[7].label+"";function h(){return t[2](t[7])}return{c(){e=v("div"),n=v("label"),r=_(c),s=y(),o=v("input"),i=y(),C(n,"for",`tone-${t[7].index+1}`),C(o,"type","color"),o.value=t[7].color,C(o,"id",`tone-${t[7].index+1}`),C(o,"name",`tone-${t[7].index+1}`),C(e,"class","tone-color-picker--tone svelte-1wk3p9z")},m(t,c){m(t,e,c),g(e,n),g(n,r),g(e,s),g(e,o),g(e,i),a||(l=b(o,"change",h),a=!0)},p(e,n){t=e},d(t){t&&$(e),a=!1,l()}}}function Ns(e){let n,r=e[0],s=[];for(let t=0;t{return(e=t,"--"==e.substring(0,2)?n.getPropertyValue(e):e).trim();var e})),s=[{label:"First Tone",color:r[0],index:0},{label:"Second Tone",color:r[1],index:1},{label:"Third Tone",color:r[2],index:2},{label:"Fourth Tone",color:r[3],index:3},{label:"No Tone",color:r[4],index:4}],o=t=>{r[t]=document.getElementById(`tone-${t+1}`).value,e("change",{hasCustomColors:!0,colors:r})};return[s,o,t=>o(t.index)]}class Fs extends it{constructor(t){super(),ot(this,t,qs,Ns,i,{})}}function Hs(e){let n,r,s,o,i,a;return{c(){n=v("div"),r=v("span"),r.textContent="You are up to date",s=y(),o=v("span"),i=_("Version "),a=_(e[0]),C(r,"class","updater-checker--status--title svelte-19yodez"),C(o,"class","update-checker--status--subtitle svelte-19yodez"),C(n,"class","update-checker--up-to-date update-checker--status svelte-19yodez")},m(t,e){m(t,n,e),g(n,r),g(n,s),g(n,o),g(o,i),g(o,a)},p(t,e){1&e&&z(a,t[0])},i:t,o:t,d(t){t&&$(n)}}}function Us(t){let e,n,r,s,o,i,a,l,c,h,d,u,p;return u=new Pn({props:{color:"green",size:"large",disabled:t[6],$$slots:{default:[Xs]},$$scope:{ctx:t}}}),u.$on("click",t[10]),{c(){e=v("div"),n=v("span"),n.textContent="Update available",r=y(),s=v("span"),o=_("Version "),i=_(t[1]),a=v("br"),l=_("\n\t\t\t\tRelease Notes: "),c=_(t[2]),h=y(),d=v("span"),nt(u.$$.fragment),C(n,"class","updater-checker--status--title svelte-19yodez"),C(s,"class","update-checker--status--subtitle svelte-19yodez"),C(d,"class","update-checker--update-button svelte-19yodez"),C(e,"class","update-checker--status update-checker--update-available svelte-19yodez")},m(t,f){m(t,e,f),g(e,n),g(e,r),g(e,s),g(s,o),g(s,i),g(s,a),g(s,l),g(s,c),g(e,h),g(e,d),rt(u,d,null),p=!0},p(t,e){(!p||2&e)&&z(i,t[1]),(!p||4&e)&&z(c,t[2]);const n={};64&e&&(n.disabled=t[6]),4160&e&&(n.$$scope={dirty:e,ctx:t}),u.$set(n)},i(t){p||(J(u.$$.fragment,t),p=!0)},o(t){Z(u.$$.fragment,t),p=!1},d(t){t&&$(e),st(u)}}}function Vs(t){let e,n,r,s;const o=[Ks,Gs],i=[];function a(t,e){return t[5]?0:1}return e=a(t),n=i[e]=o[e](t),{c(){n.c(),r=x()},m(t,n){i[e].m(t,n),m(t,r,n),s=!0},p(t,s){let l=e;e=a(t),e===l?i[e].p(t,s):(G(),Z(i[l],1,1,(()=>{i[l]=null})),K(),n=i[e],n?n.p(t,s):(n=i[e]=o[e](t),n.c()),J(n,1),n.m(r.parentNode,r))},i(t){s||(J(n),s=!0)},o(t){Z(n),s=!1},d(t){i[e].d(t),t&&$(r)}}}function Ys(t){let e;return{c(){e=_("Updating...")},m(t,n){m(t,e,n)},d(t){t&&$(e)}}}function Qs(t){let e;return{c(){e=_("Update")},m(t,n){m(t,e,n)},d(t){t&&$(e)}}}function Xs(t){let e;function n(t,e){return t[6]?Ys:Qs}let r=n(t),s=r(t);return{c(){s.c(),e=x()},m(t,n){s.m(t,n),m(t,e,n)},p(t,o){r!==(r=n(t))&&(s.d(1),s=r(t),s&&(s.c(),s.m(e.parentNode,e)))},d(t){s.d(t),t&&$(e)}}}function Gs(t){let e,n;return e=new Pn({props:{size:"large",$$slots:{default:[Js]},$$scope:{ctx:t}}}),e.$on("click",t[9]),{c(){nt(e.$$.fragment)},m(t,r){rt(e,t,r),n=!0},p(t,n){const r={};4096&n&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(J(e.$$.fragment,t),n=!0)},o(t){Z(e.$$.fragment,t),n=!1},d(t){st(e,t)}}}function Ks(t){let e,n;return e=new Pn({props:{disabled:!0,size:"large",$$slots:{default:[Zs]},$$scope:{ctx:t}}}),{c(){nt(e.$$.fragment)},m(t,r){rt(e,t,r),n=!0},p(t,n){const r={};4096&n&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(J(e.$$.fragment,t),n=!0)},o(t){Z(e.$$.fragment,t),n=!1},d(t){st(e,t)}}}function Js(t){let e;return{c(){e=_("Check for updates")},m(t,n){m(t,e,n)},d(t){t&&$(e)}}}function Zs(t){let e;return{c(){e=_("Checking for updates...")},m(t,n){m(t,e,n)},d(t){t&&$(e)}}}function to(t){let e,n,r,s;const o=[Vs,Us,Hs],i=[];function a(t,e){return t[3]?t[4]?1:2:0}return n=a(t),r=i[n]=o[n](t),{c(){e=v("div"),r.c(),C(e,"class","update-checker svelte-19yodez")},m(t,r){m(t,e,r),i[n].m(e,null),s=!0},p(t,[s]){let l=n;n=a(t),n===l?i[n].p(t,s):(G(),Z(i[l],1,1,(()=>{i[l]=null})),K(),r=i[n],r?r.p(t,s):(r=i[n]=o[n](t),r.c()),J(r,1),r.m(e,null))},i(t){s||(J(r),s=!0)},o(t){Z(r),s=!1},d(t){t&&$(e),i[n].d()}}}function eo(t,e,n){let r=window.version||"",s=window.updateVersion||"",o=window.updateReleaseNotes||"",i=window.updateStatusAvailable||!1,a=window.updateAvailable||!1,l=!1,c=!1;window.version||window.__TAURI__.app.getVersion().then((t=>{n(0,r=t),window.version=t}));const h=()=>{n(5,l=!1),n(6,c=!1),n(4,a=!1),n(3,i=!1),n(1,s=""),n(2,o=""),window.updateAvailable=!1,window.updateStatusAvailable=!1,window.updateVersion="",window.updateReleaseNotes=""},d=()=>{n(5,l=!0),n(6,c=!1),window.__TAURI__.updater.checkUpdate().then((t=>{t.shouldUpdate?(n(1,s=t.manifest.version),n(2,o=t.manifest.body),n(3,i=!0),n(4,a=!0),n(5,l=!1),window.updateVersion=t.manifest.version,window.updateReleaseNotes=t.manifest.body,window.updateStatusAvailable=!0,window.updateAvailable=!0):(n(3,i=!0),n(5,l=!1),n(4,a=!1),window.updateAvailable=!1,window.updateStatusAvailable=!0)})).catch((t=>{h(),Ke("There was an error checking for updates. Please try again later. Check the log for more details.",t)}))},u=()=>{n(6,c=!0),window.__TAURI__.updater.installUpdate().then((()=>{window.__TAURI__.process.relaunch()})).catch((t=>{h(),Ke("There was an error fetching the update. Please try again later. Check the log for more details.",t)}))};return[r,s,o,i,a,l,c,d,u,()=>d(),()=>u()]}class no extends it{constructor(t){super(),ot(this,t,eo,to,i,{})}}const ro=new Uint8Array(16);function so(){if(!As&&(As="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!As))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return As(ro)}const oo=[];for(let t=0;t<256;++t)oo.push((t+256).toString(16).slice(1));var io={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function ao(t,e,n){if(io.randomUUID&&!e&&!t)return io.randomUUID();const r=(t=t||{}).random||(t.rng||so)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,e){n=n||0;for(let t=0;t<16;++t)e[n+t]=r[t];return e}return function(t,e=0){return oo[t[e+0]]+oo[t[e+1]]+oo[t[e+2]]+oo[t[e+3]]+"-"+oo[t[e+4]]+oo[t[e+5]]+"-"+oo[t[e+6]]+oo[t[e+7]]+"-"+oo[t[e+8]]+oo[t[e+9]]+"-"+oo[t[e+10]]+oo[t[e+11]]+oo[t[e+12]]+oo[t[e+13]]+oo[t[e+14]]+oo[t[e+15]]}(r)}function lo(e){let n,r,s,o,i,a,l;return{c(){n=v("span"),r=v("input"),s=y(),o=v("label"),i=_("Toggle"),C(r,"type","checkbox"),C(r,"id",e[1]),C(r,"class","sy-toggle svelte-ssxm77"),r.value=e[2],r.checked=e[0],C(o,"for",e[1]),C(o,"class","sy-toggle--label svelte-ssxm77"),C(n,"class","sy-toggle--container svelte-ssxm77")},m(t,c){m(t,n,c),g(n,r),g(n,s),g(n,o),g(o,i),a||(l=b(r,"change",e[4]),a=!0)},p(t,[e]){2&e&&C(r,"id",t[1]),4&e&&(r.value=t[2]),1&e&&(r.checked=t[0]),2&e&&C(o,"for",t[1])},i:t,o:t,d(t){t&&$(n),a=!1,l()}}}function co(t,e,n){let{checked:r=!1}=e,{id:s=ao()}=e,{value:o}=e;const i=D();return t.$$set=t=>{"checked"in t&&n(0,r=t.checked),"id"in t&&n(1,s=t.id),"value"in t&&n(2,o=t.value)},[r,s,o,i,t=>i("change",t.srcElement.checked)]}class ho extends it{constructor(t){super(),ot(this,t,co,lo,i,{checked:0,id:1,value:2})}}function uo(t,e,n){const r=t.slice();return r[2]=e[n],r}function po(t){let n,r,s,o,i,a,l,c=t[2].label+"";const h=[t[2].props];var d=t[2].component;function u(t){let n={};for(let t=0;t{st(t,1)})),K()}d?(i=P(d,u()),i.$on("change",t[2].handler),nt(i.$$.fragment),J(i.$$.fragment,1),rt(i,n,a)):i=null}else d&&i.$set(r)},i(t){l||(i&&J(i.$$.fragment,t),l=!0)},o(t){i&&Z(i.$$.fragment,t),l=!1},d(t){t&&$(n),i&&st(i)}}}function fo(t){let e,n,r,s,o,i,a,l=t[1],c=[];for(let e=0;eZ(c[t],1,1,(()=>{c[t]=null}));return{c(){e=v("div"),n=v("div"),r=v("h1"),s=_("Settings"),o=y(),i=v("div");for(let t=0;twindow.preferenceManager.set("beta",t.detail),component:ho,props:{checked:window.preferenceManager.get("beta")}},{label:"Updates",centerLabel:!1,component:no,props:{},handler:()=>{}},{label:"Tone Colors",centerLabel:!1,handler:t=>window.preferenceManager.set("toneColors",t.detail),component:Fs,props:{}}]]}class mo extends it{constructor(t){super(),ot(this,t,go,fo,i,{})}}function $o(t,e,n){const r=t.slice();return r[4]=e[n],r}function wo(t){let e,n,r,s,o,i,a,l=t[4].tooltip+"";var c=t[4].icon;return c&&(e=P(c,{props:{size:"18"}})),{c(){e&&nt(e.$$.fragment),n=y(),r=v("div"),s=v("p"),o=_(l),i=y(),C(r,"class","sy-tooltip--body sy-tooltip--body-bottom")},m(t,l){e&&rt(e,t,l),m(t,n,l),m(t,r,l),g(r,s),g(s,o),m(t,i,l),a=!0},p(t,r){if(c!==(c=t[4].icon)){if(e){G();const t=e;Z(t.$$.fragment,1,0,(()=>{st(t,1)})),K()}c?(e=P(c,{props:{size:"18"}}),nt(e.$$.fragment),J(e.$$.fragment,1),rt(e,n.parentNode,n)):e=null}},i(t){a||(e&&J(e.$$.fragment,t),a=!0)},o(t){e&&Z(e.$$.fragment,t),a=!1},d(t){e&&st(e,t),t&&$(n),t&&$(r),t&&$(i)}}}function vo(t){let e,n;return e=new Pn({props:{center:!0,size:"large",classes:["sy-tooltip--container"],$$slots:{default:[wo]},$$scope:{ctx:t}}}),e.$on("click",t[4].action),{c(){nt(e.$$.fragment)},m(t,r){rt(e,t,r),n=!0},p(t,n){const r={};128&n&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(J(e.$$.fragment,t),n=!0)},o(t){Z(e.$$.fragment,t),n=!1},d(t){st(e,t)}}}function ko(t){let e,n,r,s,o,i,a=t[1],l=[];for(let e=0;eZ(l[t],1,1,(()=>{l[t]=null}));return{c(){e=v("div"),n=v("span"),r=_(t[0]),s=y(),o=v("span");for(let t=0;t{r&&s("selection",r)},tooltip:`Flashcards for ${r}`}];return t.$$set=t=>{"value"in t&&n(0,r=t.value)},[r,o]}class yo extends it{constructor(t){super(),ot(this,t,_o,ko,i,{value:0})}}function xo(e){let n;return{c(){n=v("div"),n.innerHTML="To take a quiz or study flashcards, add vocab words to your\n\t\t\t\t\tlists.",C(n,"class","study--empty svelte-1hd52ir")},m(t,e){m(t,n,e)},p:t,i:t,o:t,d(t){t&&$(n)}}}function bo(t){let e,n;return e=new lr({props:{values:t[0],component:yo}}),e.$on("selection",t[2]),{c(){nt(e.$$.fragment)},m(t,r){rt(e,t,r),n=!0},p(t,n){const r={};1&n&&(r.values=t[0]),e.$set(r)},i(t){n||(J(e.$$.fragment,t),n=!0)},o(t){Z(e.$$.fragment,t),n=!1},d(t){st(e,t)}}}function Co(t){let e,n,r,s,o,i,a,l,c;const h=[bo,xo],d=[];function u(t,e){return t[0].length?0:1}return a=u(t),l=d[a]=h[a](t),{c(){e=v("div"),n=v("div"),r=v("h1"),s=_("Study"),o=y(),i=v("div"),l.c(),C(r,"data-tauri-drag-region",!!t[1]||void 0),C(n,"class","study--title svelte-1hd52ir"),C(n,"data-tauri-drag-region",!!t[1]||void 0),C(i,"class","study--content"),C(e,"class","study--container svelte-1hd52ir")},m(t,l){m(t,e,l),g(e,n),g(n,r),g(r,s),g(e,o),g(e,i),d[a].m(i,null),c=!0},p(t,[e]){let n=a;a=u(t),a===n?d[a].p(t,e):(G(),Z(d[n],1,1,(()=>{d[n]=null})),K(),l=d[a],l?l.p(t,e):(l=d[a]=h[a](t),l.c()),J(l,1),l.m(i,null))},i(t){c||(J(l),c=!0)},o(t){Z(l),c=!1},d(t){t&&$(e),d[a].d()}}}function zo(t,e,n){const r="darwin"===window.platform;let s=[],o=[],i=[];window.bookmarkManager.getLists().then((t=>{n(3,s=t.sort(((t,e)=>t.localeCompare(e))))})).catch((t=>{Ke("There was an error fetching word lists. Check the logs for more details.",t)})),window.bookmarkManager.getEmptyLists().then((t=>{n(4,o=t)})).catch((t=>{Ke("There was an error fetching the empty lists. Check the log for more details.",t)}));return t.$$.update=()=>{24&t.$$.dirty&&n(0,i=s.filter((t=>!o.includes(t))))},[i,r,t=>{const e=`#/study/flashcards?list=${t.detail}`;document.location.href=e},s,o]}class So extends it{constructor(t){super(),ot(this,t,zo,Co,i,{})}}function Po(e){let n,r;return{c(){n=v("center"),r=v("h1"),r.textContent=`${To}`},m(t,e){m(t,n,e),g(n,r)},p:t,i:t,o:t,d(t){t&&$(n)}}}let To="TOOLS";class Eo extends it{constructor(t){super(),ot(this,t,null,Po,i,{})}}function Wo(t,e,n){const r=t.slice();return r[12]=e[n],r}function Mo(t,e,n){const r=t.slice();return r[12]=e[n],r}function Do(t){let e,n,r,s,o,i=t[12].label+"";var a=t[12].icon;return a&&(e=P(a,{})),{c(){e&&nt(e.$$.fragment),n=_("\n  \n "),r=_(i),s=y()},m(t,i){e&&rt(e,t,i),m(t,n,i),m(t,r,i),m(t,s,i),o=!0},p(t,s){if(32&s&&a!==(a=t[12].icon)){if(e){G();const t=e;Z(t.$$.fragment,1,0,(()=>{st(t,1)})),K()}a?(e=P(a,{}),nt(e.$$.fragment),J(e.$$.fragment,1),rt(e,n.parentNode,n)):e=null}(!o||32&s)&&i!==(i=t[12].label+"")&&z(r,i)},i(t){o||(e&&J(e.$$.fragment,t),o=!0)},o(t){e&&Z(e.$$.fragment,t),o=!1},d(t){e&&st(e,t),t&&$(n),t&&$(r),t&&$(s)}}}function Lo(t){let e,n;return e=new Pn({props:{disabled:t[12].disabled,style:"ghost",center:!0,$$slots:{default:[Do]},$$scope:{ctx:t}}}),e.$on("click",(function(){o(t[12].action)&&t[12].action.apply(this,arguments)})),{c(){nt(e.$$.fragment)},m(t,r){rt(e,t,r),n=!0},p(n,r){t=n;const s={};32&r&&(s.disabled=t[12].disabled),131104&r&&(s.$$scope={dirty:r,ctx:t}),e.$set(s)},i(t){n||(J(e.$$.fragment,t),n=!0)},o(t){Z(e.$$.fragment,t),n=!1},d(t){st(e,t)}}}function Ao(t){let e,n,r,s,o,i=t[12].label+"";var a=t[12].icon;return a&&(r=P(a,{})),{c(){e=_(i),n=_("\n  \n "),r&&nt(r.$$.fragment),s=y()},m(t,i){m(t,e,i),m(t,n,i),r&&rt(r,t,i),m(t,s,i),o=!0},p(t,n){if((!o||64&n)&&i!==(i=t[12].label+"")&&z(e,i),64&n&&a!==(a=t[12].icon)){if(r){G();const t=r;Z(t.$$.fragment,1,0,(()=>{st(t,1)})),K()}a?(r=P(a,{}),nt(r.$$.fragment),J(r.$$.fragment,1),rt(r,s.parentNode,s)):r=null}},i(t){o||(r&&J(r.$$.fragment,t),o=!0)},o(t){r&&Z(r.$$.fragment,t),o=!1},d(t){t&&$(e),t&&$(n),r&&st(r,t),t&&$(s)}}}function Ro(t){let e,n;return e=new Pn({props:{disabled:t[12].disabled,style:"ghost",center:!0,$$slots:{default:[Ao]},$$scope:{ctx:t}}}),e.$on("click",(function(){o(t[12].action)&&t[12].action.apply(this,arguments)})),{c(){nt(e.$$.fragment)},m(t,r){rt(e,t,r),n=!0},p(n,r){t=n;const s={};64&r&&(s.disabled=t[12].disabled),131136&r&&(s.$$scope={dirty:r,ctx:t}),e.$set(s)},i(t){n||(J(e.$$.fragment,t),n=!0)},o(t){Z(e.$$.fragment,t),n=!1},d(t){st(e,t)}}}function Io(e){let n;function r(t,e){return t[2].length>0?Oo:jo}let s=r(e),o=s(e);return{c(){n=v("div"),o.c(),C(n,"class","flashcard--front svelte-1mngjuk")},m(t,e){m(t,n,e),o.m(n,null)},p(t,e){s===(s=r(t))&&o?o.p(t,e):(o.d(1),o=s(t),o&&(o.c(),o.m(n,null)))},i:t,o:t,d(t){t&&$(n),o.d()}}}function Bo(t){let e,n,r,s;return r=new Qr({props:{word:t[2][t[0]],backgroundColor:"white",lists:t[4]}}),{c(){e=v("div"),n=v("div"),nt(r.$$.fragment),C(n,"class","flashcard--back--container svelte-1mngjuk"),C(e,"class","flashcard--back svelte-1mngjuk")},m(t,o){m(t,e,o),g(e,n),rt(r,n,null),s=!0},p(t,e){const n={};5&e&&(n.word=t[2][t[0]]),16&e&&(n.lists=t[4]),r.$set(n)},i(t){s||(J(r.$$.fragment,t),s=!0)},o(t){Z(r.$$.fragment,t),s=!1},d(t){t&&$(e),st(r)}}}function jo(t){let e,n,r=(t[3]?Fo:qo)+"";return{c(){e=v("h1"),n=_(r),C(e,"class","svelte-1mngjuk")},m(t,r){m(t,e,r),g(e,n)},p(t,e){8&e&&r!==(r=(t[3]?Fo:qo)+"")&&z(n,r)},d(t){t&&$(e)}}}function Oo(t){let e,n,r,s,o,i=t[2][t[0]].simplified+"",a=t[2][t[0]].traditional+"";return{c(){e=v("h1"),n=_(i),r=_(" ("),s=_(a),o=_(")"),C(e,"class","svelte-1mngjuk")},m(t,i){m(t,e,i),g(e,n),g(e,r),g(e,s),g(e,o)},p(t,e){5&e&&i!==(i=t[2][t[0]].simplified+"")&&z(n,i),5&e&&a!==(a=t[2][t[0]].traditional+"")&&z(s,a)},d(t){t&&$(e)}}}function No(t){let e,n,r,s,o,i,a,l,c,h,d=t[5],u=[];for(let e=0;eZ(u[t],1,1,(()=>{u[t]=null}));let f=t[6],k=[];for(let e=0;eZ(k[t],1,1,(()=>{k[t]=null})),x=[Bo,Io],b=[];function z(t,e){return t[1]?0:1}return l=z(t),c=b[l]=x[l](t),{c(){e=v("div"),n=v("div"),r=v("div");for(let t=0;t{b[n]=null})),K(),c=b[l],c?c.p(t,e):(c=b[l]=x[l](t),c.c()),J(c,1),c.m(a,null))},i(t){if(!h){for(let t=0;tn(9,r=t),t.$$.on_destroy.push(a(s,o));let i=!0;const l="darwin"===window.platform;let c,h=0,d=!1,u=[],p=new URLSearchParams(r);c=p.get("list");let f=[];window.bookmarkManager.getLists().then((t=>{n(4,f=t)})).catch((t=>{Ke("There was an error fetching word lists. Check the log for more details.",t)}));let g=[{icon:Nt,label:"Back",disabled:!1,action:()=>{window.history.back()}},{icon:xt,label:"Previous",disabled:0===h,action:()=>{n(0,h-=1)}}],m=[{icon:xe,label:"Flip",disabled:!1,action:()=>{n(1,d=!d)}},{icon:zt,label:"Next",disabled:h===u.length-1,action:()=>{n(0,h+=1)}}];return t.$$.update=()=>{1&t.$$.dirty&&n(5,g[1].disabled=0===h,g),5&t.$$.dirty&&n(6,m[1].disabled=h===u.length-1,m),1&t.$$.dirty&&n(1,d=!1),2&t.$$.dirty&&n(6,m[0].icon=d?ke:xe,m)},window.bookmarkManager.getListContent(c).then((t=>{n(2,u=t),n(3,i=!1)})).catch((t=>{Ke("There was an error fetching list content. Check the log for more details.",t)})),[h,d,u,i,f,g,m,l]}class Uo extends it{constructor(t){super(),ot(this,t,Ho,No,i,{})}}function Vo(e){let n,r,s,o,i,a,l;return s=new Cn({}),a=new kt({props:{routes:e[0]}}),{c(){n=v("div"),r=v("div"),nt(s.$$.fragment),o=y(),i=v("div"),nt(a.$$.fragment),C(r,"class","navigation-container svelte-1izwdrv"),C(i,"class","content-container svelte-1izwdrv"),C(n,"class","app-container svelte-1izwdrv")},m(t,e){m(t,n,e),g(n,r),rt(s,r,null),g(n,o),g(n,i),rt(a,i,null),l=!0},p:t,i(t){l||(J(s.$$.fragment,t),J(a.$$.fragment,t),l=!0)},o(t){Z(s.$$.fragment,t),Z(a.$$.fragment,t),l=!1},d(t){t&&$(n),st(s),st(a)}}}function Yo(t){mn();return[{"/":Bs,"/read":Es,"/bookmarks":ws,"/study":So,"/study/flashcards":Uo,"/tools":Eo,"/help":bs,"/settings":mo,"/chat":_s,"*":Ss}]}class Qo extends it{constructor(t){super(),ot(this,t,Yo,Vo,i,{})}}var Xo;const Go="undefined"==typeof window?global:window,Ko=Go.performance&&(()=>Go.performance.now())||(()=>Date.now()),Jo=Go.requestAnimationFrame||(t=>setTimeout((()=>t(Ko())),1e3/60)),Zo=Go.cancelAnimationFrame||clearTimeout;function ti(t){return t[t.length-1]}const ei=(t,e)=>t<0?e+t:t;function ni(t,e){const n={...t};for(const r in e){const s=t[r],o=e[r];s!==o&&(s&&o&&"object"==typeof s&&"object"==typeof o&&!Array.isArray(o)?n[r]=ni(s,o):n[r]=o)}return n}let ri=0;function si(){return ri++,ri}function oi(t){return t.reduce(((t,e)=>e+t),0)/t.length}function ii(t){const e=t.toUpperCase().trim();if(/^#([A-F0-9]{3}){1,2}$/.test(e)){let t=e.substring(1).split("");3===t.length&&(t=[t[0],t[0],t[1],t[1],t[2],t[2]]);const n=`${t.join("")}`;return{r:parseInt(n.slice(0,2),16),g:parseInt(n.slice(2,4),16),b:parseInt(n.slice(4,6),16),a:1}}const n=e.match(/^RGBA?\((\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*(\d*\.?\d+))?\)$/);if(n)return{r:parseInt(n[1],10),g:parseInt(n[2],10),b:parseInt(n[3],10),a:parseFloat(n[4]||1,10)};throw new Error(`Invalid color: ${t}`)}function ai(t,e){const n={};for(let r=0;r0||ci.indexOf("Trident/")>0||ci.indexOf("Edge/")>0,di=()=>{};class ui{constructor(t,e,n=di){this._mutationChains=[],this._onStateChange=n,this.state={options:{drawingFadeDuration:e.drawingFadeDuration,drawingWidth:e.drawingWidth,drawingColor:ii(e.drawingColor),strokeColor:ii(e.strokeColor),outlineColor:ii(e.outlineColor),radicalColor:ii(e.radicalColor||e.strokeColor),highlightColor:ii(e.highlightColor)},character:{main:{opacity:e.showCharacter?1:0,strokes:{}},outline:{opacity:e.showOutline?1:0,strokes:{}},highlight:{opacity:1,strokes:{}}},userStrokes:null};for(let e=0;et.scope));return this.cancelMutations(n),new Promise((r=>{const s={_isActive:!0,_index:0,_resolve:r,_mutations:t,_loop:e.loop,_scopes:n};this._mutationChains.push(s),this._run(s)}))}_run(t){if(!t._isActive)return;const e=t._mutations;if(t._index>=e.length){if(!t._loop)return t._isActive=!1,this._mutationChains=this._mutationChains.filter((e=>e!==t)),void t._resolve({canceled:!1});t._index=0}t._mutations[t._index].run(this).then((()=>{t._isActive&&(t._index++,this._run(t))}))}_getActiveMutations(){return this._mutationChains.map((t=>t._mutations[t._index]))}pauseAll(){this._getActiveMutations().forEach((t=>t.pause()))}resumeAll(){this._getActiveMutations().forEach((t=>t.resume()))}cancelMutations(t){for(const e of this._mutationChains)for(const n of e._scopes)for(const r of t)(n.startsWith(r)||r.startsWith(n))&&this._cancelMutationChain(e)}cancelAll(){this.cancelMutations([""])}_cancelMutationChain(t){var e;t._isActive=!1;for(let e=t._index;ee!==t))}}const pi=(t,e)=>({x:t.x-e.x,y:t.y-e.y}),fi=t=>Math.sqrt(Math.pow(t.x,2)+Math.pow(t.y,2)),gi=(t,e)=>fi(pi(t,e)),mi=(t,e=1)=>{const n=10*e;return{x:Math.round(n*t.x)/n,y:Math.round(n*t.y)/n}},$i=t=>{let e=t[0];return t.slice(1).reduce(((t,n)=>{const r=gi(n,e);return e=n,t+r}),0)},wi=(t,e,n)=>{const r=pi(e,t),s=n/fi(r);return{x:e.x+s*r.x,y:e.y+s*r.y}},vi=t=>{const e=((t,e=30)=>{const n=$i(t)/(e-1),r=[t[0]],s=ti(t),o=t.slice(1);for(let t=0;tt.x))),y:oi(e.map((t=>t.y)))},r=e.map((t=>pi(t,n))),s=Math.sqrt(oi([Math.pow(r[0].x,2)+Math.pow(r[0].y,2),Math.pow(ti(r).x,2)+Math.pow(ti(r).y,2)]));return((t,e=.05)=>{const n=t.slice(0,1);for(const r of t.slice(1)){const t=n[n.length-1],s=gi(r,t);if(s>e){const o=Math.ceil(s/e),i=s/o;for(let e=0;e({x:t.x/s,y:t.y/s}))))};function ki(t,e=!1){const n=mi(t[0]),r=t.slice(1);let s=`M ${n.x} ${n.y}`;return r.forEach((t=>{const e=mi(t);s+=` L ${e.x} ${e.y}`})),e&&(s+="Z"),s}const _i=(t,e)=>{const n=(t=>{if(t.length<3)return t;const e=[t[0],t[1]];return t.slice(2).forEach((t=>{const n=e.length,r=pi(t,e[n-1]),s=pi(e[n-1],e[n-2]);r.y*s.x-r.x*s.y==0&&e.pop(),e.push(t)})),e})(t);if(n.length<2)return n;const r=n[1],s=n[0],o=wi(r,s,e),i=n.slice(1);return i.unshift(o),i};class yi{constructor(t,e,n,r=!1){this.path=t,this.points=e,this.strokeNum=n,this.isInRadical=r}getStartingPoint(){return this.points[0]}getEndingPoint(){return this.points[this.points.length-1]}getLength(){return $i(this.points)}getVectors(){let t=this.points[0];return this.points.slice(1).map((e=>{const n=pi(e,t);return t=e,n}))}getDistance(t){const e=this.points.map((e=>gi(e,t)));return Math.min(...e)}getAverageDistance(t){return t.reduce(((t,e)=>t+this.getDistance(e)),0)/t.length}}class xi{constructor(t,e){this.symbol=t,this.strokes=e}}function bi({radStrokes:t,strokes:e,medians:n}){return e.map(((e,r)=>{const s=n[r].map((t=>{const[e,n]=t;return{x:e,y:n}}));return new yi(e,s,r,(o=r,(null!==(i=null==t?void 0:t.indexOf(o))&&void 0!==i?i:-1)>=0));var o,i}))}const[Ci,zi]=[{x:0,y:-124},{x:1024,y:900}],Si=zi.x-Ci.x,Pi=zi.y-Ci.y;class Ti{constructor(t){const{padding:e,width:n,height:r}=t;this.padding=e,this.width=n,this.height=r;const s=n-2*e,o=r-2*e,i=s/Si,a=o/Pi;this.scale=Math.min(i,a);const l=e+(s-this.scale*Si)/2,c=e+(o-this.scale*Pi)/2;this.xOffset=-1*Ci.x*this.scale+l,this.yOffset=-1*Ci.y*this.scale+c}convertExternalPoint(t){return{x:(t.x-this.xOffset)/this.scale,y:(this.height-this.yOffset-t.y)/this.scale}}}const Ei=(t,e)=>{const n=(t=>{const e=[];let n=t[0];return t.slice(1).forEach((t=>{e.push(pi(t,n)),n=t})),e})(t),r=e.getVectors();return oi(n.map((t=>{const e=r.map((e=>{return r=t,((n=e).x*r.x+n.y*r.y)/fi(n)/fi(r);var n,r}));return Math.max(...e)})))>0},Wi=t=>{if(t.length<2)return t;const[e,...n]=t,r=[e];for(const t of n)s=t,o=r[r.length-1],(s.x!==o.x||s.y!==o.y)&&r.push(t);var s,o;return r},Mi=[Math.PI/16,Math.PI/32,0,-1*Math.PI/32,-1*Math.PI/16],Di=(t,e,n)=>{const r=vi(t),s=vi(e);let o=1/0;return Mi.forEach((t=>{const e=((t,e)=>{const n=t.length>=e.length?t:e,r=t.length>=e.length?e:t,s=(t,e,s,o)=>{if(0===t&&0===e)return gi(n[0],r[0]);if(t>0&&0===e)return Math.max(s[0],gi(n[t],r[0]));const i=o[o.length-1];return 0===t&&e>0?Math.max(i,gi(n[0],r[e])):Math.max(Math.min(s[e],s[e-1],i),gi(n[t],r[e]))};let o=[];for(let t=0;tt.map((t=>({x:Math.cos(e)*t.x-Math.sin(e)*t.y,y:Math.sin(e)*t.x+Math.cos(e)*t.y}))))(s,t));e{const{leniency:r=1,isOutlineVisible:s=!1,checkBackwards:o=!0,averageDistanceThreshold:i=350}=n,a=e.getAverageDistance(t),l=a<=i*(s||e.strokeNum>0?.5:1)*r;if(!l)return{isMatch:!1,avgDist:a,meta:{isStrokeBackwards:!1}};const c=((t,e,n)=>{const r=gi(e.getStartingPoint(),t[0]),s=gi(e.getEndingPoint(),t[t.length-1]);return r<=250*n&&s<=250*n})(t,e,r),h=Ei(t,e),d=Di(t,e.points,r),u=((t,e,n)=>n*($i(t)+25)/(e.getLength()+25)>=.35)(t,e,r),p=l&&c&&h&&d&&u;if(o&&!p){if(Li([...t].reverse(),e,{...n,checkBackwards:!1}).isMatch)return{isMatch:p,avgDist:a,meta:{isStrokeBackwards:!0}}}return{isMatch:p,avgDist:a,meta:{isStrokeBackwards:!1}}};class Ai{constructor(t,e,n){this.id=t,this.points=[e],this.externalPoints=[n]}appendPoint(t,e){this.points.push(t),this.externalPoints.push(e)}}class Ri{constructor(t,e,n={}){this._tick=t=>{if(null!==this._startPauseTime)return;const e=Math.min(1,(t-this._startTime-this._pausedDuration)/this._duration);if(1===e)this._renderState.updateState(this._values),this._frameHandle=void 0,this.cancel(this._renderState);else{const t=ji(e),n=Ii(this._startState,this._values,t);this._renderState.updateState(n),this._frameHandle=Jo(this._tick)}},this.scope=t,this._valuesOrCallable=e,this._duration=n.duration||0,this._force=n.force,this._pausedDuration=0,this._startPauseTime=null}run(t){return this._values||this._inflateValues(t),0===this._duration&&t.updateState(this._values),0===this._duration||Bi(t.state,this._values)?Promise.resolve():(this._renderState=t,this._startState=t.state,this._startTime=performance.now(),this._frameHandle=Jo(this._tick),new Promise((t=>{this._resolve=t})))}_inflateValues(t){let e=this._valuesOrCallable;"function"==typeof this._valuesOrCallable&&(e=this._valuesOrCallable(t.state)),this._values=function(t,e){const n=t.split("."),r={};let s=r;for(let t=0;t=0?n*(o-i)+i:Ii(i,o,n)}return r}function Bi(t,e){for(const n in e){const r=e[n],s=null==t?void 0:t[n];if(r>=0){if(r!==s)return!1}else if(!Bi(s,r))return!1}return!0}Ri.Delay=class{constructor(t){this._duration=t,this._startTime=null,this._paused=!1,this.scope=`delay.${t}`}run(){return this._startTime=Ko(),this._runningPromise=new Promise((t=>{this._resolve=t,this._timeout=setTimeout((()=>this.cancel()),this._duration)})),this._runningPromise}pause(){if(this._paused)return;const t=performance.now()-(this._startTime||0);this._duration=Math.max(0,this._duration-t),clearTimeout(this._timeout),this._paused=!0}resume(){this._paused&&(this._startTime=performance.now(),this._timeout=setTimeout((()=>this.cancel()),this._duration),this._paused=!1)}cancel(){clearTimeout(this._timeout),this._resolve&&this._resolve(),this._resolve=void 0}};const ji=t=>-Math.cos(t*Math.PI)/2+.5,Oi=(t,e,n)=>[new Ri(`character.${t}.strokes`,ai({opacity:1,displayPortion:1},e.strokes.length),{duration:n,force:!0})],Ni=(t,e,n)=>[new Ri(`character.${t}`,{opacity:1,strokes:ai({opacity:1,displayPortion:1},e.strokes.length)},{duration:n,force:!0})],qi=(t,e,n)=>[new Ri(`character.${t}.opacity`,0,{duration:n,force:!0}),...Oi(t,e,0)],Fi=(t,e,n)=>[new Ri(`options.${t}`,e,{duration:n})],Hi=(t,e,n)=>{const r=t.strokeNum,s=(t.getLength()+600)/(3*n);return[new Ri("options.highlightColor",e),new Ri("character.highlight",{opacity:1,strokes:{[r]:{displayPortion:0,opacity:0}}}),new Ri(`character.highlight.strokes.${r}`,{displayPortion:1,opacity:1},{duration:s}),new Ri(`character.highlight.strokes.${r}.opacity`,0,{duration:s,force:!0})]},Ui=(t,e,n)=>{const r=e.strokeNum,s=(e.getLength()+600)/(3*n);return[new Ri(`character.${t}`,{opacity:1,strokes:{[r]:{displayPortion:0,opacity:1}}}),new Ri(`character.${t}.strokes.${r}.displayPortion`,1,{duration:s})]},Vi=(t,e,n,r,s)=>{let o=qi(t,e,n);return o=o.concat(Oi(t,e,0)),o.push(new Ri(`character.${t}`,{opacity:1,strokes:ai({opacity:0},e.strokes.length)},{force:!0})),e.strokes.forEach(((e,n)=>{n>0&&o.push(new Ri.Delay(s)),o=o.concat(Ui(t,e,r))})),o},Yi=(t,e)=>[new Ri(`userStrokes.${t}.opacity`,0,{duration:e}),new Ri(`userStrokes.${t}`,null,{force:!0})];class Qi{constructor(t,e,n){this._currentStrokeIndex=0,this._mistakesOnStroke=0,this._totalMistakes=0,this._character=t,this._renderState=e,this._isActive=!1,this._positioner=n}startQuiz(t){this._isActive=!0,this._options=t;const e=ei(t.quizStartStrokeNum,this._character.strokes.length);return this._currentStrokeIndex=Math.min(e,this._character.strokes.length-1),this._mistakesOnStroke=0,this._totalMistakes=0,this._renderState.run((n=this._character,r=t.strokeFadeDuration,s=this._currentStrokeIndex,[...qi("main",n,r),new Ri("character.highlight",{opacity:1,strokes:ai({opacity:0},n.strokes.length)},{force:!0}),new Ri("character.main",{opacity:1,strokes:li(n.strokes.length,(t=>({opacity:t[new Ri("quiz.activeUserStrokeId",t,{force:!0}),new Ri(`userStrokes.${t}`,{points:[e],opacity:1},{force:!0})])(n,e))}continueUserStroke(t){if(!this._userStroke)return Promise.resolve();const e=this._positioner.convertExternalPoint(t);this._userStroke.appendPoint(e,t);const n=this._userStroke.points.slice(0);return this._renderState.run((r=this._userStroke.id,[new Ri(`userStrokes.${r}.points`,n,{force:!0})]));var r}setPositioner(t){this._positioner=t}endUserStroke(){var t;if(!this._userStroke)return;if(this._renderState.run(Yi(this._userStroke.id,null!==(t=this._options.drawingFadeDuration)&&void 0!==t?t:300)),1===this._userStroke.points.length)return void(this._userStroke=void 0);const{acceptBackwardsStrokes:e,markStrokeCorrectAfterMisses:n}=this._options,r=this._getCurrentStroke(),{isMatch:s,meta:o}=function(t,e,n,r={}){const s=e.strokes,o=Wi(t.points);if(o.length<2)return{isMatch:!1,meta:{isStrokeBackwards:!1}};const{isMatch:i,meta:a,avgDist:l}=Li(o,s[n],r);if(!i)return{isMatch:i,meta:a};const c=s.slice(n+1);let h=l;for(let t=0;t0,leniency:this._options.leniency,averageDistanceThreshold:this._options.averageDistanceThreshold}),i=n&&this._mistakesOnStroke+1>=n;if(s||i||o.isStrokeBackwards&&e)this._handleSuccess(o);else{this._handleFailure(o);const{showHintAfterMisses:t,highlightColor:e,strokeHighlightSpeed:n}=this._options;!1!==t&&this._mistakesOnStroke>=t&&this._renderState.run(Hi(r,ii(e),n))}this._userStroke=void 0}cancel(){this._isActive=!1,this._userStroke&&this._renderState.run(Yi(this._userStroke.id,this._options.drawingFadeDuration))}_getStrokeData({isCorrect:t,meta:e}){return{character:this._character.symbol,strokeNum:this._currentStrokeIndex,mistakesOnStroke:this._mistakesOnStroke,totalMistakes:this._totalMistakes,strokesRemaining:this._character.strokes.length-this._currentStrokeIndex-(t?1:0),drawnPath:(n=this._userStroke,{pathString:ki(n.externalPoints),points:n.points.map((t=>mi(t)))}),isBackwards:e.isStrokeBackwards};var n}_handleSuccess(t){if(!this._options)return;const{strokes:e,symbol:n}=this._character,{onCorrectStroke:r,onComplete:s,highlightOnComplete:o,strokeFadeDuration:i,highlightCompleteColor:a,highlightColor:l,strokeHighlightDuration:c}=this._options;null==r||r({...this._getStrokeData({isCorrect:!0,meta:t})});let h=(d="main",u=this._currentStrokeIndex,[new Ri(`character.${d}.strokes.${u}`,{displayPortion:1,opacity:1},{duration:i,force:!0})]);var d,u;this._mistakesOnStroke=0,this._currentStrokeIndex+=1;this._currentStrokeIndex===e.length&&(this._isActive=!1,null==s||s({character:n,totalMistakes:this._totalMistakes}),o&&(h=h.concat(((t,e,n)=>[new Ri("options.highlightColor",e),...qi("highlight",t),...Ni("highlight",t,n/2),...qi("highlight",t,n/2)])(this._character,ii(a||l),2*(c||0))))),this._renderState.run(h)}_handleFailure(t){var e,n;this._mistakesOnStroke+=1,this._totalMistakes+=1,null===(e=(n=this._options).onMistake)||void 0===e||e.call(n,this._getStrokeData({isCorrect:!1,meta:t}))}_getCurrentStroke(){return this._character.strokes[this._currentStrokeIndex]}}function Xi(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function Gi(t,e,n){t.setAttributeNS(null,e,n)}function Ki(t,e){Object.keys(e).forEach((n=>Gi(t,n,e[n])))}function Ji(t){var e;null==t||null===(e=t.parentNode)||void 0===e||e.removeChild(t)}class Zi{constructor(t){this.stroke=t,this._pathLength=t.getLength()+Zi.STROKE_WIDTH/2}_getStrokeDashoffset(t){return.999*this._pathLength*(1-t)}_getColor({strokeColor:t,radicalColor:e}){return e&&this.stroke.isInRadical?e:t}}Zi.STROKE_WIDTH=200;class ta extends Zi{constructor(t){super(t),this._oldProps=void 0}mount(t){this._animationPath=Xi("path"),this._clip=Xi("clipPath"),this._strokePath=Xi("path");const e=`mask-${si()}`;Gi(this._clip,"id",e),Gi(this._strokePath,"d",this.stroke.path),this._animationPath.style.opacity="0",Gi(this._animationPath,"clip-path",function(t){let e="";return window.location&&window.location.href&&(e=window.location.href.replace(/#[^#]*$/,"").replace(/"/gi,"%22")),`url("${e}#${t}")`}(e));const n=_i(this.stroke.points,100);return Gi(this._animationPath,"d",ki(n)),Ki(this._animationPath,{stroke:"#FFFFFF","stroke-width":200..toString(),fill:"none","stroke-linecap":"round","stroke-linejoin":"miter","stroke-dasharray":`${this._pathLength},${this._pathLength}`}),this._clip.appendChild(this._strokePath),t.defs.appendChild(this._clip),t.svg.appendChild(this._animationPath),this}render(t){var e,n;if(t===this._oldProps||!this._animationPath)return;t.displayPortion!==(null===(e=this._oldProps)||void 0===e?void 0:e.displayPortion)&&(this._animationPath.style.strokeDashoffset=this._getStrokeDashoffset(t.displayPortion).toString());const r=this._getColor(t);if(!this._oldProps||r!==this._getColor(this._oldProps)){const{r:t,g:e,b:n,a:s}=r;Ki(this._animationPath,{stroke:`rgba(${t},${e},${n},${s})`})}t.opacity!==(null===(n=this._oldProps)||void 0===n?void 0:n.opacity)&&(this._animationPath.style.opacity=t.opacity.toString()),this._oldProps=t}}class ea{constructor(t){this._oldProps=void 0,this._strokeRenderers=t.strokes.map((t=>new ta(t)))}mount(t){const e=t.createSubRenderTarget();this._group=e.svg,this._strokeRenderers.forEach((t=>{t.mount(e)}))}render(t){var e,n;if(t===this._oldProps||!this._group)return;const{opacity:r,strokes:s,strokeColor:o,radicalColor:i=null}=t;var a;r!==(null===(e=this._oldProps)||void 0===e?void 0:e.opacity)&&(this._group.style.opacity=r.toString(),hi||(0===r?this._group.style.display="none":0===(null===(a=this._oldProps)||void 0===a?void 0:a.opacity)&&this._group.style.removeProperty("display")));const l=!this._oldProps||o!==this._oldProps.strokeColor||i!==this._oldProps.radicalColor;if(l||s!==(null===(n=this._oldProps)||void 0===n?void 0:n.strokes))for(let t=0;t{t(this._eventify(e,this._getMousePoint))})),this.node.addEventListener("touchstart",(e=>{t(this._eventify(e,this._getTouchPoint))}))}addPointerMoveListener(t){this.node.addEventListener("mousemove",(e=>{t(this._eventify(e,this._getMousePoint))})),this.node.addEventListener("touchmove",(e=>{t(this._eventify(e,this._getTouchPoint))}))}addPointerEndListener(t){document.addEventListener("mouseup",t),document.addEventListener("touchend",t)}getBoundingClientRect(){return this.node.getBoundingClientRect()}updateDimensions(t,e){this.node.setAttribute("width",`${t}`),this.node.setAttribute("height",`${e}`)}_eventify(t,e){return{getPoint:()=>e.call(this,t),preventDefault:()=>t.preventDefault()}}_getMousePoint(t){const{left:e,top:n}=this.getBoundingClientRect();return{x:t.clientX-e,y:t.clientY-n}}_getTouchPoint(t){const{left:e,top:n}=this.getBoundingClientRect();return{x:t.touches[0].clientX-e,y:t.touches[0].clientY-n}}}class sa extends ra{constructor(t,e){super(t),this.svg=t,this.defs=e,"createSVGPoint"in t&&(this._pt=t.createSVGPoint())}static init(t,e="100%",n="100%"){const r="string"==typeof t?document.getElementById(t):t;if(!r)throw new Error(`HanziWriter target element not found: ${t}`);const s=r.nodeName.toUpperCase(),o=(()=>{if("SVG"===s||"G"===s)return r;{const t=Xi("svg");return r.appendChild(t),t}})();Ki(o,{width:e,height:n});const i=Xi("defs");return o.appendChild(i),new sa(o,i)}createSubRenderTarget(){const t=Xi("g");return this.svg.appendChild(t),new sa(t,this.defs)}_getMousePoint(t){if(this._pt&&(this._pt.x=t.clientX,this._pt.y=t.clientY,"getScreenCTM"in this.node)){var e;const t=this._pt.matrixTransform(null===(e=this.node.getScreenCTM())||void 0===e?void 0:e.inverse());return{x:t.x,y:t.y}}return super._getMousePoint.call(this,t)}_getTouchPoint(t){if(this._pt&&(this._pt.x=t.touches[0].clientX,this._pt.y=t.touches[0].clientY,"getScreenCTM"in this.node)){var e;const t=this._pt.matrixTransform(null===(e=this.node.getScreenCTM())||void 0===e?void 0:e.inverse());return{x:t.x,y:t.y}}return super._getTouchPoint(t)}}var oa={HanziWriterRenderer:class{constructor(t,e){this._character=t,this._positioner=e,this._mainCharRenderer=new ea(t),this._outlineCharRenderer=new ea(t),this._highlightCharRenderer=new ea(t),this._userStrokeRenderers={}}mount(t){const e=t.createSubRenderTarget(),n=e.svg,{xOffset:r,yOffset:s,height:o,scale:i}=this._positioner;Gi(n,"transform",`translate(${r}, ${o-s}) scale(${i}, ${-1*i})`),this._outlineCharRenderer.mount(e),this._mainCharRenderer.mount(e),this._highlightCharRenderer.mount(e),this._positionedTarget=e}render(t){const{main:e,outline:n,highlight:r}=t.character,{outlineColor:s,radicalColor:o,highlightColor:i,strokeColor:a,drawingWidth:l,drawingColor:c}=t.options;this._outlineCharRenderer.render({opacity:n.opacity,strokes:n.strokes,strokeColor:s}),this._mainCharRenderer.render({opacity:e.opacity,strokes:e.strokes,strokeColor:a,radicalColor:o}),this._highlightCharRenderer.render({opacity:r.opacity,strokes:r.strokes,strokeColor:i});const h=t.userStrokes||{};for(const t in this._userStrokeRenderers){var d;if(!h[t])null===(d=this._userStrokeRenderers[t])||void 0===d||d.destroy(),delete this._userStrokeRenderers[t]}for(const t in h){const e=h[t];if(!e)continue;const n={strokeWidth:l,strokeColor:c,...e};(()=>{if(this._userStrokeRenderers[t])return this._userStrokeRenderers[t];const e=new na;return e.mount(this._positionedTarget),this._userStrokeRenderers[t]=e,e})().render(n)}}destroy(){Ji(this._positionedTarget.svg),this._positionedTarget.defs.innerHTML=""}},createRenderTarget:sa.init};const ia=(t,e)=>{t.beginPath();const n=e[0],r=e.slice(1);t.moveTo(n.x,n.y);for(const e of r)t.lineTo(e.x,e.y);t.stroke()};class aa extends Zi{constructor(t,e=!0){super(t),e&&Path2D?this._path2D=new Path2D(this.stroke.path):this._pathCmd=(t=>{const e=t.split(/(^|\s+)(?=[A-Z])/).filter((t=>" "!==t)),n=[t=>t.beginPath()];for(const t of e){const[e,...r]=t.split(/\s+/),s=r.map((t=>parseFloat(t)));"M"===e?n.push((t=>t.moveTo(...s))):"L"===e?n.push((t=>t.lineTo(...s))):"C"===e?n.push((t=>t.bezierCurveTo(...s))):"Q"===e&&n.push((t=>t.quadraticCurveTo(...s)))}return t=>n.forEach((e=>e(t)))})(this.stroke.path),this._extendedMaskPoints=_i(this.stroke.points,Zi.STROKE_WIDTH/2)}render(t,e){if(e.opacity<.05)return;var n;(t.save(),this._path2D)?t.clip(this._path2D):(null===(n=this._pathCmd)||void 0===n||n.call(this,t),t.globalAlpha=0,t.stroke(),t.clip());const{r:r,g:s,b:o,a:i}=this._getColor(e),a=1===i?`rgb(${r},${s},${o})`:`rgb(${r},${s},${o},${i})`,l=this._getStrokeDashoffset(e.displayPortion);t.globalAlpha=e.opacity,t.strokeStyle=a,t.fillStyle=a,t.lineWidth=Zi.STROKE_WIDTH,t.lineCap="round",t.lineJoin="round",t.setLineDash([this._pathLength,this._pathLength],l),t.lineDashOffset=l,ia(t,this._extendedMaskPoints),t.restore()}}class la{constructor(t){this._strokeRenderers=t.strokes.map((t=>new aa(t)))}render(t,e){if(e.opacity<.05)return;const{opacity:n,strokeColor:r,radicalColor:s,strokes:o}=e;for(let e=0;e{if("CANVAS"===s)return r;const t=document.createElement("canvas");return r.appendChild(t),t})();return o.setAttribute("width",e),o.setAttribute("height",n),new ha(o)}getContext(){return this.node.getContext("2d")}}var da={HanziWriterRenderer:class{constructor(t,e){this.destroy=di,this._character=t,this._positioner=e,this._mainCharRenderer=new la(t),this._outlineCharRenderer=new la(t),this._highlightCharRenderer=new la(t)}mount(t){this._target=t}_animationFrame(t){const{width:e,height:n,scale:r,xOffset:s,yOffset:o}=this._positioner,i=this._target.getContext();i.clearRect(0,0,e,n),i.save(),i.translate(s,n-o),i.transform(1,0,0,-1,0,0),i.scale(r,r),t(i),i.restore(),i.draw&&i.draw()}render(t){const{outline:e,main:n,highlight:r}=t.character,{outlineColor:s,strokeColor:o,radicalColor:i,highlightColor:a,drawingColor:l,drawingWidth:c}=t.options;this._animationFrame((h=>{this._outlineCharRenderer.render(h,{opacity:e.opacity,strokes:e.strokes,strokeColor:s}),this._mainCharRenderer.render(h,{opacity:n.opacity,strokes:n.strokes,strokeColor:o,radicalColor:i}),this._highlightCharRenderer.render(h,{opacity:r.opacity,strokes:r.strokes,strokeColor:a});const d=t.userStrokes||{};for(const t in d){const e=d[t];if(e){ca(h,{strokeWidth:c,strokeColor:l,...e})}}}))}},createRenderTarget:ha.init};const ua={charDataLoader:(t,e,n)=>{const r=new XMLHttpRequest;r.overrideMimeType&&r.overrideMimeType("application/json"),r.open("GET",(t=>`https://cdn.jsdelivr.net/npm/hanzi-writer-data@2.0/${t}.json`)(t),!0),r.onerror=t=>{n(r,t)},r.onreadystatechange=()=>{4===r.readyState&&(200===r.status?e(JSON.parse(r.responseText)):0!==r.status&&n&&n(r))},r.send(null)},onLoadCharDataError:null,onLoadCharDataSuccess:null,showOutline:!0,showCharacter:!0,renderer:"svg",width:0,height:0,padding:20,strokeAnimationSpeed:1,strokeFadeDuration:400,strokeHighlightDuration:200,strokeHighlightSpeed:2,delayBetweenStrokes:1e3,delayBetweenLoops:2e3,strokeColor:"#555",radicalColor:null,highlightColor:"#AAF",outlineColor:"#DDD",drawingColor:"#333",leniency:1,showHintAfterMisses:3,highlightOnComplete:!0,highlightCompleteColor:null,markStrokeCorrectAfterMisses:!1,acceptBackwardsStrokes:!1,quizStartStrokeNum:0,averageDistanceThreshold:350,drawingFadeDuration:300,drawingWidth:4,strokeWidth:2,outlineWidth:2,rendererOverride:{}};class pa{constructor(t){this._loadCounter=0,this._isLoading=!1,this.loadingFailed=!1,this._options=t}_debouncedLoad(t,e){const n=t=>{var n;e===this._loadCounter&&(null===(n=this._resolve)||void 0===n||n.call(this,t))},r=t=>{var n;e===this._loadCounter&&(null===(n=this._reject)||void 0===n||n.call(this,t))},s=this._options.charDataLoader(t,n,r);s&&("then"in s?s.then(n).catch(r):n(s))}_setupLoadingPromise(){return new Promise(((t,e)=>{this._resolve=t,this._reject=e})).then((t=>{var e,n;return this._isLoading=!1,null===(e=(n=this._options).onLoadCharDataSuccess)||void 0===e||e.call(n,t),t})).catch((t=>{if(this._isLoading=!1,this.loadingFailed=!0,this._options.onLoadCharDataError)return void this._options.onLoadCharDataError(t);if(t instanceof Error)throw t;const e=new Error(`Failed to load char data for ${this._loadingChar}`);throw e.reason=t,e}))}loadCharData(t){this._loadingChar=t;const e=this._setupLoadingPromise();return this.loadingFailed=!1,this._isLoading=!0,this._loadCounter++,this._debouncedLoad(t,this._loadCounter),e}}class fa{constructor(t,e={}){const{HanziWriterRenderer:n,createRenderTarget:r}="canvas"===e.renderer?da:oa,s=e.rendererOverride||{};this._renderer={HanziWriterRenderer:s.HanziWriterRenderer||n,createRenderTarget:s.createRenderTarget||r},this.target=this._renderer.createRenderTarget(t,e.width,e.height),this._options=this._assignOptions(e),this._loadingManager=new pa(this._options),this._setupListeners()}static create(t,e,n){const r=new fa(t,n);return r.setCharacter(e),r}static loadCharacterData(t,e={}){const n=(()=>{const{_loadingManager:n,_loadingOptions:r}=fa;return(null==n?void 0:n._loadingChar)===t&&r===e?n:new pa({...ua,...e})})();return fa._loadingManager=n,fa._loadingOptions=e,n.loadCharData(t)}static getScalingTransform(t,e,n=0){const r=new Ti({width:t,height:e,padding:n});return{x:r.xOffset,y:r.yOffset,scale:r.scale,transform:(s=`\n translate(${r.xOffset}, ${r.height-r.yOffset})\n scale(${r.scale}, ${-1*r.scale})\n `,s.replace(/^\s+/,"").replace(/\s+$/,"")).replace(/\s+/g," ")};var s}showCharacter(t={}){return this._options.showCharacter=!0,this._withData((()=>{var e;return null===(e=this._renderState)||void 0===e?void 0:e.run(Ni("main",this._character,"number"==typeof t.duration?t.duration:this._options.strokeFadeDuration)).then((e=>{var n;return null===(n=t.onComplete)||void 0===n||n.call(t,e),e}))}))}hideCharacter(t={}){return this._options.showCharacter=!1,this._withData((()=>{var e;return null===(e=this._renderState)||void 0===e?void 0:e.run(qi("main",this._character,"number"==typeof t.duration?t.duration:this._options.strokeFadeDuration)).then((e=>{var n;return null===(n=t.onComplete)||void 0===n||n.call(t,e),e}))}))}animateCharacter(t={}){return this.cancelQuiz(),this._withData((()=>{var e;return null===(e=this._renderState)||void 0===e?void 0:e.run(Vi("main",this._character,this._options.strokeFadeDuration,this._options.strokeAnimationSpeed,this._options.delayBetweenStrokes)).then((e=>{var n;return null===(n=t.onComplete)||void 0===n||n.call(t,e),e}))}))}animateStroke(t,e={}){return this.cancelQuiz(),this._withData((()=>{var n;return null===(n=this._renderState)||void 0===n?void 0:n.run(((t,e,n,r)=>{const s=e.strokes[n];return[new Ri(`character.${t}`,(n=>{const r=n.character[t],s={opacity:1,strokes:{}};for(let t=0;t{var n;return null===(n=e.onComplete)||void 0===n||n.call(e,t),t}))}))}highlightStroke(t,e={}){return this._withData((()=>{var n,r;if(this._character&&this._renderState)return this._renderState.run(Hi((n=this._character.strokes,r=t,n[ei(r,n.length)]),ii(this._options.highlightColor),this._options.strokeHighlightSpeed)).then((t=>{var n;return null===(n=e.onComplete)||void 0===n||n.call(e,t),t}))}))}async loopCharacterAnimation(){return this.cancelQuiz(),this._withData((()=>this._renderState.run(((t,e,n,r,s,o)=>{const i=Vi(t,e,n,r,s);return i.push(new Ri.Delay(o)),i})("main",this._character,this._options.strokeFadeDuration,this._options.strokeAnimationSpeed,this._options.delayBetweenStrokes,this._options.delayBetweenLoops),{loop:!0})))}pauseAnimation(){return this._withData((()=>{var t;return null===(t=this._renderState)||void 0===t?void 0:t.pauseAll()}))}resumeAnimation(){return this._withData((()=>{var t;return null===(t=this._renderState)||void 0===t?void 0:t.resumeAll()}))}showOutline(t={}){return this._options.showOutline=!0,this._withData((()=>{var e;return null===(e=this._renderState)||void 0===e?void 0:e.run(Ni("outline",this._character,"number"==typeof t.duration?t.duration:this._options.strokeFadeDuration)).then((e=>{var n;return null===(n=t.onComplete)||void 0===n||n.call(t,e),e}))}))}hideOutline(t={}){return this._options.showOutline=!1,this._withData((()=>{var e;return null===(e=this._renderState)||void 0===e?void 0:e.run(qi("outline",this._character,"number"==typeof t.duration?t.duration:this._options.strokeFadeDuration)).then((e=>{var n;return null===(n=t.onComplete)||void 0===n||n.call(t,e),e}))}))}updateDimensions({width:t,height:e,padding:n}){if(void 0!==t&&(this._options.width=t),void 0!==e&&(this._options.height=e),void 0!==n&&(this._options.padding=n),this.target.updateDimensions(this._options.width,this._options.height),this._character&&this._renderState&&this._hanziWriterRenderer&&this._positioner){this._hanziWriterRenderer.destroy();const t=this._initAndMountHanziWriterRenderer(this._character);this._renderState.overwriteOnStateChange((e=>t.render(e))),t.render(this._renderState.state),this._quiz&&this._quiz.setPositioner(this._positioner)}}updateColor(t,e,n={}){var r;let s=[];const o=ii((()=>"radicalColor"!==t||e?e:this._options.strokeColor)());this._options[t]=e;const i=null!==(r=n.duration)&&void 0!==r?r:this._options.strokeFadeDuration;return s=s.concat(Fi(t,o,i)),"radicalColor"!==t||e||(s=s.concat(Fi(t,null,0))),this._withData((()=>{var t;return null===(t=this._renderState)||void 0===t?void 0:t.run(s).then((t=>{var e;return null===(e=n.onComplete)||void 0===e||e.call(n,t),t}))}))}quiz(t={}){return this._withData((async()=>{this._character&&this._renderState&&this._positioner&&(this.cancelQuiz(),this._quiz=new Qi(this._character,this._renderState,this._positioner),this._options={...this._options,...t},this._quiz.startQuiz(this._options))}))}cancelQuiz(){this._quiz&&(this._quiz.cancel(),this._quiz=void 0)}setCharacter(t){return this.cancelQuiz(),this._char=t,this._hanziWriterRenderer&&this._hanziWriterRenderer.destroy(),this._renderState&&this._renderState.cancelAll(),this._hanziWriterRenderer=null,this._withDataPromise=this._loadingManager.loadCharData(t).then((e=>{if(!e||this._loadingManager.loadingFailed)return;this._character=function(t,e){const n=bi(e);return new xi(t,n)}(t,e),this._renderState=new ui(this._character,this._options,(t=>n.render(t)));const n=this._initAndMountHanziWriterRenderer(this._character);n.render(this._renderState.state)})),this._withDataPromise}_initAndMountHanziWriterRenderer(t){const{width:e,height:n,padding:r}=this._options;this._positioner=new Ti({width:e,height:n,padding:r});const s=new this._renderer.HanziWriterRenderer(t,this._positioner);return s.mount(this.target),this._hanziWriterRenderer=s,s}async getCharacterData(){if(!this._char)throw new Error("setCharacter() must be called before calling getCharacterData()");return await this._withData((()=>this._character))}_assignOptions(t){const e={...ua,...t};return t.strokeAnimationDuration&&!t.strokeAnimationSpeed&&(e.strokeAnimationSpeed=500/t.strokeAnimationDuration),t.strokeHighlightDuration&&!t.strokeHighlightSpeed&&(e.strokeHighlightSpeed=500/e.strokeHighlightDuration),t.highlightCompleteColor||(e.highlightCompleteColor=e.highlightColor),this._fillWidthAndHeight(e)}_fillWidthAndHeight(t){const e={...t};if(e.width&&!e.height)e.height=e.width;else if(e.height&&!e.width)e.width=e.height;else if(!e.width&&!e.height){const{width:t,height:n}=this.target.getBoundingClientRect(),r=Math.min(t,n);e.width=r,e.height=r}return e}_withData(t){if(this._loadingManager.loadingFailed)throw Error("Failed to load character data. Call setCharacter and try again.");return this._withDataPromise?this._withDataPromise.then((()=>{if(!this._loadingManager.loadingFailed)return t()})):Promise.resolve().then(t)}_setupListeners(){this.target.addPointerStartListener((t=>{this._quiz&&(t.preventDefault(),this._quiz.startUserStroke(t.getPoint()))})),this.target.addPointerMoveListener((t=>{this._quiz&&(t.preventDefault(),this._quiz.continueUserStroke(t.getPoint()))})),this.target.addPointerEndListener((()=>{var t;null===(t=this._quiz)||void 0===t||t.endUserStroke()}))}}function ga(t){let e;return{c(){e=v("span"),e.textContent="Simplified",C(e,"class","svelte-377oc3"),S(e,"script-selector--active","simplified"==t[1])},m(t,n){m(t,e,n)},p(t,n){2&n&&S(e,"script-selector--active","simplified"==t[1])},d(t){t&&$(e)}}}function ma(t){let e;return{c(){e=v("span"),e.textContent="Traditional",C(e,"class","svelte-377oc3"),S(e,"script-selector--active","traditional"==t[1])},m(t,n){m(t,e,n)},p(t,n){2&n&&S(e,"script-selector--active","traditional"==t[1])},d(t){t&&$(e)}}}function $a(t){let e,n,r,s,o;return n=new Pn({props:{classes:["sy-tooltip--container"],$$slots:{default:[ba]},$$scope:{ctx:t}}}),n.$on("click",t[9]),{c(){e=v("div"),nt(n.$$.fragment),r=y(),s=v("div"),s.innerHTML='
',C(e,"class","character-actions svelte-377oc3"),C(s,"class","character-container svelte-377oc3")},m(t,i){m(t,e,i),rt(n,e,null),m(t,r,i),m(t,s,i),o=!0},p(t,e){const r={};262156&e&&(r.$$scope={dirty:e,ctx:t}),n.$set(r)},i(t){o||(J(n.$$.fragment,t),o=!0)},o(t){Z(n.$$.fragment,t),o=!1},d(t){t&&$(e),st(n),t&&$(r),t&&$(s)}}}function wa(e){let n;return{c(){n=v("div"),n.innerHTML="

Character Data Not Found

\n\t\t\t\t

The stroke order data cannot be found for at least one of\n\t\t\t\t\tthe characters in this word.

",C(n,"class","character-window--character-not-found--container svelte-377oc3")},m(t,e){m(t,n,e)},p:t,i:t,o:t,d(t){t&&$(n)}}}function va(t){let e,n;return e=new de({props:{size:"18"}}),{c(){nt(e.$$.fragment)},m(t,r){rt(e,t,r),n=!0},i(t){n||(J(e.$$.fragment,t),n=!0)},o(t){Z(e.$$.fragment,t),n=!1},d(t){st(e,t)}}}function ka(t){let e,n;return e=new fe({props:{size:"18"}}),{c(){nt(e.$$.fragment)},m(t,r){rt(e,t,r),n=!0},i(t){n||(J(e.$$.fragment,t),n=!0)},o(t){Z(e.$$.fragment,t),n=!1},d(t){st(e,t)}}}function _a(t){let e;return{c(){e=_("Play Stroke Order")},m(t,n){m(t,e,n)},d(t){t&&$(e)}}}function ya(t){let e;return{c(){e=_("Resume")},m(t,n){m(t,e,n)},d(t){t&&$(e)}}}function xa(t){let e;return{c(){e=_("Pause")},m(t,n){m(t,e,n)},d(t){t&&$(e)}}}function ba(t){let e,n,r,s,o,i,a;const l=[ka,va],c=[];function h(t,e){return t[2]?1:0}function d(t,e){return t[2]?xa:t[3]?ya:_a}n=h(t),r=c[n]=l[n](t);let u=d(t),p=u(t);return{c(){e=v("span"),r.c(),s=y(),o=v("div"),i=v("p"),p.c(),C(e,"class","animate-button--icon-container svelte-377oc3"),C(e,"data-testid","control-button"),C(i,"data-testid","tooltip-text"),C(o,"class","sy-tooltip--body sy-tooltip--body-bottom")},m(t,r){m(t,e,r),c[n].m(e,null),m(t,s,r),m(t,o,r),g(o,i),p.m(i,null),a=!0},p(t,s){let o=n;n=h(t),n!==o&&(G(),Z(c[o],1,1,(()=>{c[o]=null})),K(),r=c[n],r||(r=c[n]=l[n](t),r.c()),J(r,1),r.m(e,null)),u!==(u=d(t))&&(p.d(1),p=u(t),p&&(p.c(),p.m(i,null)))},i(t){a||(J(r),a=!0)},o(t){Z(r),a=!1},d(t){t&&$(e),c[n].d(),t&&$(s),t&&$(o),p.d()}}}function Ca(t){let e,n,r,s,o,i,a,l,c,h,d;r=new Pn({props:{style:"ghost",size:"large",$$slots:{default:[ga]},$$scope:{ctx:t}}}),r.$on("click",t[7]),o=new Pn({props:{style:"ghost",size:"large",$$slots:{default:[ma]},$$scope:{ctx:t}}}),o.$on("click",t[8]);const u=[wa,$a],p=[];function f(t,e){return t[4]?0:1}return c=f(t),h=p[c]=u[c](t),{c(){e=v("div"),n=v("div"),nt(r.$$.fragment),s=y(),nt(o.$$.fragment),a=y(),l=v("div"),h.c(),C(n,"class","script-selector-container svelte-377oc3"),C(n,"data-tauri-drag-region",i=!!t[0]||void 0),C(l,"class","character-window--content svelte-377oc3"),C(e,"class","character-window-container svelte-377oc3")},m(t,i){m(t,e,i),g(e,n),rt(r,n,null),g(n,s),rt(o,n,null),g(e,a),g(e,l),p[c].m(l,null),d=!0},p(t,[e]){const s={};262146&e&&(s.$$scope={dirty:e,ctx:t}),r.$set(s);const a={};262146&e&&(a.$$scope={dirty:e,ctx:t}),o.$set(a),(!d||1&e&&i!==(i=!!t[0]||void 0))&&C(n,"data-tauri-drag-region",i);let g=c;c=f(t),c===g?p[c].p(t,e):(G(),Z(p[g],1,1,(()=>{p[g]=null})),K(),h=p[c],h?h.p(t,e):(h=p[c]=u[c](t),h.c()),J(h,1),h.m(l,null))},i(t){d||(J(r.$$.fragment,t),J(o.$$.fragment,t),J(h),d=!0)},o(t){Z(r.$$.fragment,t),Z(o.$$.fragment,t),Z(h),d=!1},d(t){t&&$(e),st(r),st(o),p[c].d()}}}fa._loadingManager=null,fa._loadingOptions=null;function za(t,e,n){let r,s=!1;window.__TAURI__.os.platform().then((t=>{n(0,s="darwin"===t)}));let o,i,a=[],l="simplified",c=!1,h=!1,d=!1;const u=()=>window.matchMedia("(prefers-color-scheme: dark)").matches,p=t=>{n(1,l=t),n(2,c=!1),n(3,h=!1),f(r[l])},f=t=>{n(4,d=!1),q().then((()=>{const e=document.getElementById("character-target");e&&(e.innerHTML=""),a=[];for(let e=0;e{fetch(`resources/hanzi-writer-data/data/${t}.json`).then((t=>t.json())).then((t=>{e(t)})).catch((t=>{n(4,d=!0),console.log(t)}))}}),a.push(i);var r}))},g=(t,e)=>{if(e){n(2,c=!0);for(let t=0;t=0&&tg(t+1,!1)})):(n(2,c=!1),n(3,h=!1))},m=()=>{c?(n(3,h=!0),n(2,c=!1),a[o].pauseAnimation()):h?(n(3,h=!1),n(2,c=!0),a[o].resumeAnimation()):g(0,!0)};window.__TAURI__.event.listen("display-characters",(t=>{r=t.payload,f(r[l])})),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",(t=>{f(r[l])}));return[s,l,c,h,d,p,m,()=>p("simplified"),()=>p("traditional"),()=>m()]}class Sa extends it{constructor(t){super(),ot(this,t,za,Ca,i,{})}}let Pa;const Ta=document.getElementById("app"),Ea=document.getElementById("characters");return Ta?Pa=new Qo({target:Ta}):Ea&&(Pa=new Sa({target:Ea})),Pa}(); +var app=function(){"use strict";function t(){}function e(t,e){for(const n in e)t[n]=e[n];return t}function n(t){return t()}function r(){return Object.create(null)}function s(t){t.forEach(n)}function o(t){return"function"==typeof t}function i(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function a(e,...n){if(null==e)return t;const r=e.subscribe(...n);return r.unsubscribe?()=>r.unsubscribe():r}function l(t,e,n,r){if(t){const s=c(t,e,n,r);return t[0](s)}}function c(t,n,r,s){return t[1]&&s?e(r.ctx.slice(),t[1](s(n))):r.ctx}function h(t,e,n,r){if(t[2]&&r){const s=t[2](r(n));if(void 0===e.dirty)return s;if("object"==typeof s){const t=[],n=Math.max(e.dirty.length,s.length);for(let r=0;r32){const e=[],n=t.ctx.length/32;for(let t=0;tt.removeEventListener(e,n,r)}function C(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function z(t,e){e=""+e,t.data!==e&&(t.data=e)}function S(t,e,n){t.classList[n?"add":"remove"](e)}function P(t,e){return new t(e)}let T;function E(t){T=t}function W(){if(!T)throw new Error("Function called outside component initialization");return T}function M(t){W().$$.on_destroy.push(t)}function D(){const t=W();return(e,n,{cancelable:r=!1}={})=>{const s=t.$$.callbacks[e];if(s){const o=function(t,e,{bubbles:n=!1,cancelable:r=!1}={}){const s=document.createEvent("CustomEvent");return s.initCustomEvent(t,n,r,e),s}(e,n,{cancelable:r});return s.slice().forEach((e=>{e.call(t,o)})),!o.defaultPrevented}return!0}}function A(t,e){const n=t.$$.callbacks[e.type];n&&n.slice().forEach((t=>t.call(this,e)))}const L=[],R=[];let I=[];const B=[],j=Promise.resolve();let O=!1;function N(){O||(O=!0,j.then(V))}function q(){return N(),j}function F(t){I.push(t)}const H=new Set;let U=0;function V(){if(0!==U)return;const t=T;do{try{for(;U{Q.delete(t),r&&(n&&t.d(1),r())})),t.o(e)}else r&&r()}function tt(t,e){const n={},r={},s={$$scope:1};let o=t.length;for(;o--;){const i=t[o],a=e[o];if(a){for(const t in i)t in a||(r[t]=1);for(const t in a)s[t]||(n[t]=a[t],s[t]=1);t[o]=a}else for(const t in i)s[t]=1}for(const t in r)t in n||(n[t]=void 0);return n}function et(t){return"object"==typeof t&&null!==t?t:{}}function nt(t){t&&t.c()}function rt(t,e,r,i){const{fragment:a,after_update:l}=t.$$;a&&a.m(e,r),i||F((()=>{const e=t.$$.on_mount.map(n).filter(o);t.$$.on_destroy?t.$$.on_destroy.push(...e):s(e),t.$$.on_mount=[]})),l.forEach(F)}function st(t,e){const n=t.$$;null!==n.fragment&&(!function(t){const e=[],n=[];I.forEach((r=>-1===t.indexOf(r)?e.push(r):n.push(r))),n.forEach((t=>t())),I=e}(n.after_update),s(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function ot(e,n,o,i,a,l,c,h=[-1]){const d=T;E(e);const u=e.$$={fragment:null,ctx:[],props:l,update:t,not_equal:a,bound:r(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(n.context||(d?d.$$.context:[])),callbacks:r(),dirty:h,skip_bound:!1,root:n.target||d.$$.root};c&&c(u.root);let p=!1;if(u.ctx=o?o(e,n.props||{},((t,n,...r)=>{const s=r.length?r[0]:n;return u.ctx&&a(u.ctx[t],u.ctx[t]=s)&&(!u.skip_bound&&u.bound[t]&&u.bound[t](s),p&&function(t,e){-1===t.$$.dirty[0]&&(L.push(t),N(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const t=r.indexOf(n);-1!==t&&r.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const at=[];function lt(t,e){return{subscribe:ct(t,e).subscribe}}function ct(e,n=t){let r;const s=new Set;function o(t){if(i(e,t)&&(e=t,r)){const t=!at.length;for(const t of s)t[1](),at.push(t,e);if(t){for(let t=0;t{s.delete(l),0===s.size&&r&&(r(),r=null)}}}}function ht(e,n,r){const i=!Array.isArray(e),l=i?[e]:e,c=n.length<2;return lt(r,(e=>{let r=!1;const h=[];let d=0,u=t;const p=()=>{if(d)return;u();const r=n(i?h[0]:h,e);c?e(r):u=o(r)?r:t},f=l.map(((t,e)=>a(t,(t=>{h[e]=t,d&=~(1<{d|=1<{st(t,1)})),K()}i?(n=P(i,a()),n.$on("routeEvent",t[7]),nt(n.$$.fragment),J(n.$$.fragment,1),rt(n,r.parentNode,r)):n=null}else i&&n.$set(s)},i(t){s||(n&&J(n.$$.fragment,t),s=!0)},o(t){n&&Z(n.$$.fragment,t),s=!1},d(t){t&&$(r),n&&st(n,t)}}}function pt(t){let n,r,s;const o=[{params:t[1]},t[2]];var i=t[0];function a(t){let n={};for(let t=0;t{st(t,1)})),K()}i?(n=P(i,a()),n.$on("routeEvent",t[6]),nt(n.$$.fragment),J(n.$$.fragment,1),rt(n,r.parentNode,r)):n=null}else i&&n.$set(s)},i(t){s||(n&&J(n.$$.fragment,t),s=!0)},o(t){n&&Z(n.$$.fragment,t),s=!1},d(t){t&&$(r),n&&st(n,t)}}}function ft(t){let e,n,r,s;const o=[pt,ut],i=[];function a(t,e){return t[1]?0:1}return e=a(t),n=i[e]=o[e](t),{c(){n.c(),r=x()},m(t,n){i[e].m(t,n),m(t,r,n),s=!0},p(t,[s]){let l=e;e=a(t),e===l?i[e].p(t,s):(G(),Z(i[l],1,1,(()=>{i[l]=null})),K(),n=i[e],n?n.p(t,s):(n=i[e]=o[e](t),n.c()),J(n,1),n.m(r.parentNode,r))},i(t){s||(J(n),s=!0)},o(t){Z(n),s=!1},d(t){i[e].d(t),t&&$(r)}}}function gt(){const t=window.location.href.indexOf("#/");let e=t>-1?window.location.href.substr(t+1):"/";const n=e.indexOf("?");let r="";return n>-1&&(r=e.substr(n+1),e=e.substr(0,n)),{location:e,querystring:r}}const mt=lt(null,(function(t){t(gt());const e=()=>{t(gt())};return window.addEventListener("hashchange",e,!1),function(){window.removeEventListener("hashchange",e,!1)}}));ht(mt,(t=>t.location));const $t=ht(mt,(t=>t.querystring)),wt=ct(void 0);function vt(t,e,n){let{routes:r={}}=e,{prefix:s=""}=e,{restoreScrollState:o=!1}=e;class i{constructor(t,e){if(!e||"function"!=typeof e&&("object"!=typeof e||!0!==e._sveltesparouter))throw Error("Invalid component object");if(!t||"string"==typeof t&&(t.length<1||"/"!=t.charAt(0)&&"*"!=t.charAt(0))||"object"==typeof t&&!(t instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:n,keys:r}=dt(t);this.path=t,"object"==typeof e&&!0===e._sveltesparouter?(this.component=e.component,this.conditions=e.conditions||[],this.userData=e.userData,this.props=e.props||{}):(this.component=()=>Promise.resolve(e),this.conditions=[],this.props={}),this._pattern=n,this._keys=r}match(t){if(s)if("string"==typeof s){if(!t.startsWith(s))return null;t=t.substr(s.length)||"/"}else if(s instanceof RegExp){const e=t.match(s);if(!e||!e[0])return null;t=t.substr(e[0].length)||"/"}const e=this._pattern.exec(t);if(null===e)return null;if(!1===this._keys)return e;const n={};let r=0;for(;r{a.push(new i(e,t))})):Object.keys(r).forEach((t=>{a.push(new i(t,r[t]))}));let l=null,c=null,h={};const d=D();async function u(t,e){await q(),d(t,e)}let p=null,f=null;var g;o&&(f=t=>{p=t.state&&(t.state.__svelte_spa_router_scrollY||t.state.__svelte_spa_router_scrollX)?t.state:null},window.addEventListener("popstate",f),g=()=>{var t;(t=p)?window.scrollTo(t.__svelte_spa_router_scrollX,t.__svelte_spa_router_scrollY):window.scrollTo(0,0)},W().$$.after_update.push(g));let m=null,$=null;const w=mt.subscribe((async t=>{m=t;let e=0;for(;e{wt.set(c)}))}n(0,l=null),$=null,wt.set(void 0)}));return M((()=>{w(),f&&window.removeEventListener("popstate",f)})),t.$$set=t=>{"routes"in t&&n(3,r=t.routes),"prefix"in t&&n(4,s=t.prefix),"restoreScrollState"in t&&n(5,o=t.restoreScrollState)},t.$$.update=()=>{32&t.$$.dirty&&(history.scrollRestoration=o?"manual":"auto")},[l,c,h,r,s,o,function(e){A.call(this,t,e)},function(e){A.call(this,t,e)}]}class kt extends it{constructor(t){super(),ot(this,t,vt,ft,i,{routes:3,prefix:4,restoreScrollState:5})}}function _t(e){let n,r,s,o;return{c(){n=k("svg"),r=k("line"),s=k("polyline"),C(r,"x1","19"),C(r,"y1","12"),C(r,"x2","5"),C(r,"y2","12"),C(s,"points","12 19 5 12 12 5"),C(n,"xmlns","http://www.w3.org/2000/svg"),C(n,"width",e[0]),C(n,"height",e[0]),C(n,"fill","none"),C(n,"viewBox","0 0 24 24"),C(n,"stroke","currentColor"),C(n,"stroke-width",e[1]),C(n,"stroke-linecap","round"),C(n,"stroke-linejoin","round"),C(n,"class",o="feather feather-arrow-left "+e[2])},m(t,e){m(t,n,e),g(n,r),g(n,s)},p(t,[e]){1&e&&C(n,"width",t[0]),1&e&&C(n,"height",t[0]),2&e&&C(n,"stroke-width",t[1]),4&e&&o!==(o="feather feather-arrow-left "+t[2])&&C(n,"class",o)},i:t,o:t,d(t){t&&$(n)}}}function yt(t,e,n){let{size:r="24"}=e,{strokeWidth:s=2}=e,{class:o=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,s=t.strokeWidth),"class"in t&&n(2,o=t.class)},[r,s,o]}class xt extends it{constructor(t){super(),ot(this,t,yt,_t,i,{size:0,strokeWidth:1,class:2})}}function bt(e){let n,r,s,o;return{c(){n=k("svg"),r=k("line"),s=k("polyline"),C(r,"x1","5"),C(r,"y1","12"),C(r,"x2","19"),C(r,"y2","12"),C(s,"points","12 5 19 12 12 19"),C(n,"xmlns","http://www.w3.org/2000/svg"),C(n,"width",e[0]),C(n,"height",e[0]),C(n,"fill","none"),C(n,"viewBox","0 0 24 24"),C(n,"stroke","currentColor"),C(n,"stroke-width",e[1]),C(n,"stroke-linecap","round"),C(n,"stroke-linejoin","round"),C(n,"class",o="feather feather-arrow-right "+e[2])},m(t,e){m(t,n,e),g(n,r),g(n,s)},p(t,[e]){1&e&&C(n,"width",t[0]),1&e&&C(n,"height",t[0]),2&e&&C(n,"stroke-width",t[1]),4&e&&o!==(o="feather feather-arrow-right "+t[2])&&C(n,"class",o)},i:t,o:t,d(t){t&&$(n)}}}function Ct(t,e,n){let{size:r="24"}=e,{strokeWidth:s=2}=e,{class:o=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,s=t.strokeWidth),"class"in t&&n(2,o=t.class)},[r,s,o]}class zt extends it{constructor(t){super(),ot(this,t,Ct,bt,i,{size:0,strokeWidth:1,class:2})}}function St(e){let n,r,s,o;return{c(){n=k("svg"),r=k("path"),s=k("path"),C(r,"d","M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"),C(s,"d","M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"),C(n,"xmlns","http://www.w3.org/2000/svg"),C(n,"width",e[0]),C(n,"height",e[0]),C(n,"fill","none"),C(n,"viewBox","0 0 24 24"),C(n,"stroke","currentColor"),C(n,"stroke-width",e[1]),C(n,"stroke-linecap","round"),C(n,"stroke-linejoin","round"),C(n,"class",o="feather feather-book-open "+e[2])},m(t,e){m(t,n,e),g(n,r),g(n,s)},p(t,[e]){1&e&&C(n,"width",t[0]),1&e&&C(n,"height",t[0]),2&e&&C(n,"stroke-width",t[1]),4&e&&o!==(o="feather feather-book-open "+t[2])&&C(n,"class",o)},i:t,o:t,d(t){t&&$(n)}}}function Pt(t,e,n){let{size:r="24"}=e,{strokeWidth:s=2}=e,{class:o=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,s=t.strokeWidth),"class"in t&&n(2,o=t.class)},[r,s,o]}class Tt extends it{constructor(t){super(),ot(this,t,Pt,St,i,{size:0,strokeWidth:1,class:2})}}function Et(e){let n,r,s;return{c(){n=k("svg"),r=k("path"),C(r,"d","M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z"),C(n,"xmlns","http://www.w3.org/2000/svg"),C(n,"width",e[0]),C(n,"height",e[0]),C(n,"fill","none"),C(n,"viewBox","0 0 24 24"),C(n,"stroke","currentColor"),C(n,"stroke-width",e[1]),C(n,"stroke-linecap","round"),C(n,"stroke-linejoin","round"),C(n,"class",s="feather feather-bookmark "+e[2])},m(t,e){m(t,n,e),g(n,r)},p(t,[e]){1&e&&C(n,"width",t[0]),1&e&&C(n,"height",t[0]),2&e&&C(n,"stroke-width",t[1]),4&e&&s!==(s="feather feather-bookmark "+t[2])&&C(n,"class",s)},i:t,o:t,d(t){t&&$(n)}}}function Wt(t,e,n){let{size:r="24"}=e,{strokeWidth:s=2}=e,{class:o=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,s=t.strokeWidth),"class"in t&&n(2,o=t.class)},[r,s,o]}class Mt extends it{constructor(t){super(),ot(this,t,Wt,Et,i,{size:0,strokeWidth:1,class:2})}}function Dt(e){let n,r,s;return{c(){n=k("svg"),r=k("polyline"),C(r,"points","20 6 9 17 4 12"),C(n,"xmlns","http://www.w3.org/2000/svg"),C(n,"width",e[0]),C(n,"height",e[0]),C(n,"fill","none"),C(n,"viewBox","0 0 24 24"),C(n,"stroke","currentColor"),C(n,"stroke-width",e[1]),C(n,"stroke-linecap","round"),C(n,"stroke-linejoin","round"),C(n,"class",s="feather feather-check "+e[2])},m(t,e){m(t,n,e),g(n,r)},p(t,[e]){1&e&&C(n,"width",t[0]),1&e&&C(n,"height",t[0]),2&e&&C(n,"stroke-width",t[1]),4&e&&s!==(s="feather feather-check "+t[2])&&C(n,"class",s)},i:t,o:t,d(t){t&&$(n)}}}function At(t,e,n){let{size:r="24"}=e,{strokeWidth:s=2}=e,{class:o=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,s=t.strokeWidth),"class"in t&&n(2,o=t.class)},[r,s,o]}class Lt extends it{constructor(t){super(),ot(this,t,At,Dt,i,{size:0,strokeWidth:1,class:2})}}function Rt(e){let n,r,s;return{c(){n=k("svg"),r=k("polyline"),C(r,"points","6 9 12 15 18 9"),C(n,"xmlns","http://www.w3.org/2000/svg"),C(n,"width",e[0]),C(n,"height",e[0]),C(n,"fill","none"),C(n,"viewBox","0 0 24 24"),C(n,"stroke","currentColor"),C(n,"stroke-width",e[1]),C(n,"stroke-linecap","round"),C(n,"stroke-linejoin","round"),C(n,"class",s="feather feather-chevron-down "+e[2])},m(t,e){m(t,n,e),g(n,r)},p(t,[e]){1&e&&C(n,"width",t[0]),1&e&&C(n,"height",t[0]),2&e&&C(n,"stroke-width",t[1]),4&e&&s!==(s="feather feather-chevron-down "+t[2])&&C(n,"class",s)},i:t,o:t,d(t){t&&$(n)}}}function It(t,e,n){let{size:r="24"}=e,{strokeWidth:s=2}=e,{class:o=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,s=t.strokeWidth),"class"in t&&n(2,o=t.class)},[r,s,o]}class Bt extends it{constructor(t){super(),ot(this,t,It,Rt,i,{size:0,strokeWidth:1,class:2})}}function jt(e){let n,r,s;return{c(){n=k("svg"),r=k("polyline"),C(r,"points","15 18 9 12 15 6"),C(n,"xmlns","http://www.w3.org/2000/svg"),C(n,"width",e[0]),C(n,"height",e[0]),C(n,"fill","none"),C(n,"viewBox","0 0 24 24"),C(n,"stroke","currentColor"),C(n,"stroke-width",e[1]),C(n,"stroke-linecap","round"),C(n,"stroke-linejoin","round"),C(n,"class",s="feather feather-chevron-left "+e[2])},m(t,e){m(t,n,e),g(n,r)},p(t,[e]){1&e&&C(n,"width",t[0]),1&e&&C(n,"height",t[0]),2&e&&C(n,"stroke-width",t[1]),4&e&&s!==(s="feather feather-chevron-left "+t[2])&&C(n,"class",s)},i:t,o:t,d(t){t&&$(n)}}}function Ot(t,e,n){let{size:r="24"}=e,{strokeWidth:s=2}=e,{class:o=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,s=t.strokeWidth),"class"in t&&n(2,o=t.class)},[r,s,o]}class Nt extends it{constructor(t){super(),ot(this,t,Ot,jt,i,{size:0,strokeWidth:1,class:2})}}function qt(e){let n,r,s;return{c(){n=k("svg"),r=k("polyline"),C(r,"points","9 18 15 12 9 6"),C(n,"xmlns","http://www.w3.org/2000/svg"),C(n,"width",e[0]),C(n,"height",e[0]),C(n,"fill","none"),C(n,"viewBox","0 0 24 24"),C(n,"stroke","currentColor"),C(n,"stroke-width",e[1]),C(n,"stroke-linecap","round"),C(n,"stroke-linejoin","round"),C(n,"class",s="feather feather-chevron-right "+e[2])},m(t,e){m(t,n,e),g(n,r)},p(t,[e]){1&e&&C(n,"width",t[0]),1&e&&C(n,"height",t[0]),2&e&&C(n,"stroke-width",t[1]),4&e&&s!==(s="feather feather-chevron-right "+t[2])&&C(n,"class",s)},i:t,o:t,d(t){t&&$(n)}}}function Ft(t,e,n){let{size:r="24"}=e,{strokeWidth:s=2}=e,{class:o=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,s=t.strokeWidth),"class"in t&&n(2,o=t.class)},[r,s,o]}class Ht extends it{constructor(t){super(),ot(this,t,Ft,qt,i,{size:0,strokeWidth:1,class:2})}}function Ut(e){let n,r,s,o;return{c(){n=k("svg"),r=k("rect"),s=k("path"),C(r,"x","9"),C(r,"y","9"),C(r,"width","13"),C(r,"height","13"),C(r,"rx","2"),C(r,"ry","2"),C(s,"d","M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"),C(n,"xmlns","http://www.w3.org/2000/svg"),C(n,"width",e[0]),C(n,"height",e[0]),C(n,"fill","none"),C(n,"viewBox","0 0 24 24"),C(n,"stroke","currentColor"),C(n,"stroke-width",e[1]),C(n,"stroke-linecap","round"),C(n,"stroke-linejoin","round"),C(n,"class",o="feather feather-copy "+e[2])},m(t,e){m(t,n,e),g(n,r),g(n,s)},p(t,[e]){1&e&&C(n,"width",t[0]),1&e&&C(n,"height",t[0]),2&e&&C(n,"stroke-width",t[1]),4&e&&o!==(o="feather feather-copy "+t[2])&&C(n,"class",o)},i:t,o:t,d(t){t&&$(n)}}}function Vt(t,e,n){let{size:r="24"}=e,{strokeWidth:s=2}=e,{class:o=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,s=t.strokeWidth),"class"in t&&n(2,o=t.class)},[r,s,o]}class Yt extends it{constructor(t){super(),ot(this,t,Vt,Ut,i,{size:0,strokeWidth:1,class:2})}}function Qt(e){let n,r,s,o,i;return{c(){n=k("svg"),r=k("path"),s=k("polyline"),o=k("line"),C(r,"d","M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"),C(s,"points","7 10 12 15 17 10"),C(o,"x1","12"),C(o,"y1","15"),C(o,"x2","12"),C(o,"y2","3"),C(n,"xmlns","http://www.w3.org/2000/svg"),C(n,"width",e[0]),C(n,"height",e[0]),C(n,"fill","none"),C(n,"viewBox","0 0 24 24"),C(n,"stroke","currentColor"),C(n,"stroke-width",e[1]),C(n,"stroke-linecap","round"),C(n,"stroke-linejoin","round"),C(n,"class",i="feather feather-download "+e[2])},m(t,e){m(t,n,e),g(n,r),g(n,s),g(n,o)},p(t,[e]){1&e&&C(n,"width",t[0]),1&e&&C(n,"height",t[0]),2&e&&C(n,"stroke-width",t[1]),4&e&&i!==(i="feather feather-download "+t[2])&&C(n,"class",i)},i:t,o:t,d(t){t&&$(n)}}}function Xt(t,e,n){let{size:r="24"}=e,{strokeWidth:s=2}=e,{class:o=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,s=t.strokeWidth),"class"in t&&n(2,o=t.class)},[r,s,o]}class Gt extends it{constructor(t){super(),ot(this,t,Xt,Qt,i,{size:0,strokeWidth:1,class:2})}}function Kt(e){let n,r,s,o,i;return{c(){n=k("svg"),r=k("circle"),s=k("path"),o=k("line"),C(r,"cx","12"),C(r,"cy","12"),C(r,"r","10"),C(s,"d","M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"),C(o,"x1","12"),C(o,"y1","17"),C(o,"x2","12.01"),C(o,"y2","17"),C(n,"xmlns","http://www.w3.org/2000/svg"),C(n,"width",e[0]),C(n,"height",e[0]),C(n,"fill","none"),C(n,"viewBox","0 0 24 24"),C(n,"stroke","currentColor"),C(n,"stroke-width",e[1]),C(n,"stroke-linecap","round"),C(n,"stroke-linejoin","round"),C(n,"class",i="feather feather-help-circle "+e[2])},m(t,e){m(t,n,e),g(n,r),g(n,s),g(n,o)},p(t,[e]){1&e&&C(n,"width",t[0]),1&e&&C(n,"height",t[0]),2&e&&C(n,"stroke-width",t[1]),4&e&&i!==(i="feather feather-help-circle "+t[2])&&C(n,"class",i)},i:t,o:t,d(t){t&&$(n)}}}function Jt(t,e,n){let{size:r="24"}=e,{strokeWidth:s=2}=e,{class:o=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,s=t.strokeWidth),"class"in t&&n(2,o=t.class)},[r,s,o]}class Zt extends it{constructor(t){super(),ot(this,t,Jt,Kt,i,{size:0,strokeWidth:1,class:2})}}function te(e){let n,r,s,o,i,a;return{c(){n=k("svg"),r=k("polyline"),s=k("polyline"),o=k("line"),i=k("line"),C(r,"points","15 3 21 3 21 9"),C(s,"points","9 21 3 21 3 15"),C(o,"x1","21"),C(o,"y1","3"),C(o,"x2","14"),C(o,"y2","10"),C(i,"x1","3"),C(i,"y1","21"),C(i,"x2","10"),C(i,"y2","14"),C(n,"xmlns","http://www.w3.org/2000/svg"),C(n,"width",e[0]),C(n,"height",e[0]),C(n,"fill","none"),C(n,"viewBox","0 0 24 24"),C(n,"stroke","currentColor"),C(n,"stroke-width",e[1]),C(n,"stroke-linecap","round"),C(n,"stroke-linejoin","round"),C(n,"class",a="feather feather-maximize-2 "+e[2])},m(t,e){m(t,n,e),g(n,r),g(n,s),g(n,o),g(n,i)},p(t,[e]){1&e&&C(n,"width",t[0]),1&e&&C(n,"height",t[0]),2&e&&C(n,"stroke-width",t[1]),4&e&&a!==(a="feather feather-maximize-2 "+t[2])&&C(n,"class",a)},i:t,o:t,d(t){t&&$(n)}}}function ee(t,e,n){let{size:r="24"}=e,{strokeWidth:s=2}=e,{class:o=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,s=t.strokeWidth),"class"in t&&n(2,o=t.class)},[r,s,o]}class ne extends it{constructor(t){super(),ot(this,t,ee,te,i,{size:0,strokeWidth:1,class:2})}}function re(e){let n,r,s;return{c(){n=k("svg"),r=k("path"),C(r,"d","M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z"),C(n,"xmlns","http://www.w3.org/2000/svg"),C(n,"width",e[0]),C(n,"height",e[0]),C(n,"fill","none"),C(n,"viewBox","0 0 24 24"),C(n,"stroke","currentColor"),C(n,"stroke-width",e[1]),C(n,"stroke-linecap","round"),C(n,"stroke-linejoin","round"),C(n,"class",s="feather feather-message-circle "+e[2])},m(t,e){m(t,n,e),g(n,r)},p(t,[e]){1&e&&C(n,"width",t[0]),1&e&&C(n,"height",t[0]),2&e&&C(n,"stroke-width",t[1]),4&e&&s!==(s="feather feather-message-circle "+t[2])&&C(n,"class",s)},i:t,o:t,d(t){t&&$(n)}}}function se(t,e,n){let{size:r="24"}=e,{strokeWidth:s=2}=e,{class:o=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,s=t.strokeWidth),"class"in t&&n(2,o=t.class)},[r,s,o]}class oe extends it{constructor(t){super(),ot(this,t,se,re,i,{size:0,strokeWidth:1,class:2})}}function ie(e){let n,r,s,o,i;return{c(){n=k("svg"),r=k("circle"),s=k("circle"),o=k("circle"),C(r,"cx","12"),C(r,"cy","12"),C(r,"r","1"),C(s,"cx","12"),C(s,"cy","5"),C(s,"r","1"),C(o,"cx","12"),C(o,"cy","19"),C(o,"r","1"),C(n,"xmlns","http://www.w3.org/2000/svg"),C(n,"width",e[0]),C(n,"height",e[0]),C(n,"fill","none"),C(n,"viewBox","0 0 24 24"),C(n,"stroke","currentColor"),C(n,"stroke-width",e[1]),C(n,"stroke-linecap","round"),C(n,"stroke-linejoin","round"),C(n,"class",i="feather feather-more-vertical "+e[2])},m(t,e){m(t,n,e),g(n,r),g(n,s),g(n,o)},p(t,[e]){1&e&&C(n,"width",t[0]),1&e&&C(n,"height",t[0]),2&e&&C(n,"stroke-width",t[1]),4&e&&i!==(i="feather feather-more-vertical "+t[2])&&C(n,"class",i)},i:t,o:t,d(t){t&&$(n)}}}function ae(t,e,n){let{size:r="24"}=e,{strokeWidth:s=2}=e,{class:o=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,s=t.strokeWidth),"class"in t&&n(2,o=t.class)},[r,s,o]}class le extends it{constructor(t){super(),ot(this,t,ae,ie,i,{size:0,strokeWidth:1,class:2})}}function ce(e){let n,r,s,o;return{c(){n=k("svg"),r=k("rect"),s=k("rect"),C(r,"x","6"),C(r,"y","4"),C(r,"width","4"),C(r,"height","16"),C(s,"x","14"),C(s,"y","4"),C(s,"width","4"),C(s,"height","16"),C(n,"xmlns","http://www.w3.org/2000/svg"),C(n,"width",e[0]),C(n,"height",e[0]),C(n,"fill","none"),C(n,"viewBox","0 0 24 24"),C(n,"stroke","currentColor"),C(n,"stroke-width",e[1]),C(n,"stroke-linecap","round"),C(n,"stroke-linejoin","round"),C(n,"class",o="feather feather-pause "+e[2])},m(t,e){m(t,n,e),g(n,r),g(n,s)},p(t,[e]){1&e&&C(n,"width",t[0]),1&e&&C(n,"height",t[0]),2&e&&C(n,"stroke-width",t[1]),4&e&&o!==(o="feather feather-pause "+t[2])&&C(n,"class",o)},i:t,o:t,d(t){t&&$(n)}}}function he(t,e,n){let{size:r="24"}=e,{strokeWidth:s=2}=e,{class:o=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,s=t.strokeWidth),"class"in t&&n(2,o=t.class)},[r,s,o]}class de extends it{constructor(t){super(),ot(this,t,he,ce,i,{size:0,strokeWidth:1,class:2})}}function ue(e){let n,r,s;return{c(){n=k("svg"),r=k("polygon"),C(r,"points","5 3 19 12 5 21 5 3"),C(n,"xmlns","http://www.w3.org/2000/svg"),C(n,"width",e[0]),C(n,"height",e[0]),C(n,"fill","none"),C(n,"viewBox","0 0 24 24"),C(n,"stroke","currentColor"),C(n,"stroke-width",e[1]),C(n,"stroke-linecap","round"),C(n,"stroke-linejoin","round"),C(n,"class",s="feather feather-play "+e[2])},m(t,e){m(t,n,e),g(n,r)},p(t,[e]){1&e&&C(n,"width",t[0]),1&e&&C(n,"height",t[0]),2&e&&C(n,"stroke-width",t[1]),4&e&&s!==(s="feather feather-play "+t[2])&&C(n,"class",s)},i:t,o:t,d(t){t&&$(n)}}}function pe(t,e,n){let{size:r="24"}=e,{strokeWidth:s=2}=e,{class:o=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,s=t.strokeWidth),"class"in t&&n(2,o=t.class)},[r,s,o]}class fe extends it{constructor(t){super(),ot(this,t,pe,ue,i,{size:0,strokeWidth:1,class:2})}}function ge(e){let n,r,s,o;return{c(){n=k("svg"),r=k("line"),s=k("line"),C(r,"x1","12"),C(r,"y1","5"),C(r,"x2","12"),C(r,"y2","19"),C(s,"x1","5"),C(s,"y1","12"),C(s,"x2","19"),C(s,"y2","12"),C(n,"xmlns","http://www.w3.org/2000/svg"),C(n,"width",e[0]),C(n,"height",e[0]),C(n,"fill","none"),C(n,"viewBox","0 0 24 24"),C(n,"stroke","currentColor"),C(n,"stroke-width",e[1]),C(n,"stroke-linecap","round"),C(n,"stroke-linejoin","round"),C(n,"class",o="feather feather-plus "+e[2])},m(t,e){m(t,n,e),g(n,r),g(n,s)},p(t,[e]){1&e&&C(n,"width",t[0]),1&e&&C(n,"height",t[0]),2&e&&C(n,"stroke-width",t[1]),4&e&&o!==(o="feather feather-plus "+t[2])&&C(n,"class",o)},i:t,o:t,d(t){t&&$(n)}}}function me(t,e,n){let{size:r="24"}=e,{strokeWidth:s=2}=e,{class:o=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,s=t.strokeWidth),"class"in t&&n(2,o=t.class)},[r,s,o]}class $e extends it{constructor(t){super(),ot(this,t,me,ge,i,{size:0,strokeWidth:1,class:2})}}function we(e){let n,r,s,o;return{c(){n=k("svg"),r=k("polyline"),s=k("path"),C(r,"points","1 4 1 10 7 10"),C(s,"d","M3.51 15a9 9 0 1 0 2.13-9.36L1 10"),C(n,"xmlns","http://www.w3.org/2000/svg"),C(n,"width",e[0]),C(n,"height",e[0]),C(n,"fill","none"),C(n,"viewBox","0 0 24 24"),C(n,"stroke","currentColor"),C(n,"stroke-width",e[1]),C(n,"stroke-linecap","round"),C(n,"stroke-linejoin","round"),C(n,"class",o="feather feather-rotate-ccw "+e[2])},m(t,e){m(t,n,e),g(n,r),g(n,s)},p(t,[e]){1&e&&C(n,"width",t[0]),1&e&&C(n,"height",t[0]),2&e&&C(n,"stroke-width",t[1]),4&e&&o!==(o="feather feather-rotate-ccw "+t[2])&&C(n,"class",o)},i:t,o:t,d(t){t&&$(n)}}}function ve(t,e,n){let{size:r="24"}=e,{strokeWidth:s=2}=e,{class:o=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,s=t.strokeWidth),"class"in t&&n(2,o=t.class)},[r,s,o]}class ke extends it{constructor(t){super(),ot(this,t,ve,we,i,{size:0,strokeWidth:1,class:2})}}function _e(e){let n,r,s,o;return{c(){n=k("svg"),r=k("polyline"),s=k("path"),C(r,"points","23 4 23 10 17 10"),C(s,"d","M20.49 15a9 9 0 1 1-2.12-9.36L23 10"),C(n,"xmlns","http://www.w3.org/2000/svg"),C(n,"width",e[0]),C(n,"height",e[0]),C(n,"fill","none"),C(n,"viewBox","0 0 24 24"),C(n,"stroke","currentColor"),C(n,"stroke-width",e[1]),C(n,"stroke-linecap","round"),C(n,"stroke-linejoin","round"),C(n,"class",o="feather feather-rotate-cw "+e[2])},m(t,e){m(t,n,e),g(n,r),g(n,s)},p(t,[e]){1&e&&C(n,"width",t[0]),1&e&&C(n,"height",t[0]),2&e&&C(n,"stroke-width",t[1]),4&e&&o!==(o="feather feather-rotate-cw "+t[2])&&C(n,"class",o)},i:t,o:t,d(t){t&&$(n)}}}function ye(t,e,n){let{size:r="24"}=e,{strokeWidth:s=2}=e,{class:o=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,s=t.strokeWidth),"class"in t&&n(2,o=t.class)},[r,s,o]}class xe extends it{constructor(t){super(),ot(this,t,ye,_e,i,{size:0,strokeWidth:1,class:2})}}function be(e){let n,r,s,o;return{c(){n=k("svg"),r=k("circle"),s=k("line"),C(r,"cx","11"),C(r,"cy","11"),C(r,"r","8"),C(s,"x1","21"),C(s,"y1","21"),C(s,"x2","16.65"),C(s,"y2","16.65"),C(n,"xmlns","http://www.w3.org/2000/svg"),C(n,"width",e[0]),C(n,"height",e[0]),C(n,"fill","none"),C(n,"viewBox","0 0 24 24"),C(n,"stroke","currentColor"),C(n,"stroke-width",e[1]),C(n,"stroke-linecap","round"),C(n,"stroke-linejoin","round"),C(n,"class",o="feather feather-search "+e[2])},m(t,e){m(t,n,e),g(n,r),g(n,s)},p(t,[e]){1&e&&C(n,"width",t[0]),1&e&&C(n,"height",t[0]),2&e&&C(n,"stroke-width",t[1]),4&e&&o!==(o="feather feather-search "+t[2])&&C(n,"class",o)},i:t,o:t,d(t){t&&$(n)}}}function Ce(t,e,n){let{size:r="24"}=e,{strokeWidth:s=2}=e,{class:o=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,s=t.strokeWidth),"class"in t&&n(2,o=t.class)},[r,s,o]}class ze extends it{constructor(t){super(),ot(this,t,Ce,be,i,{size:0,strokeWidth:1,class:2})}}function Se(e){let n,r,s,o;return{c(){n=k("svg"),r=k("circle"),s=k("path"),C(r,"cx","12"),C(r,"cy","12"),C(r,"r","3"),C(s,"d","M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"),C(n,"xmlns","http://www.w3.org/2000/svg"),C(n,"width",e[0]),C(n,"height",e[0]),C(n,"fill","none"),C(n,"viewBox","0 0 24 24"),C(n,"stroke","currentColor"),C(n,"stroke-width",e[1]),C(n,"stroke-linecap","round"),C(n,"stroke-linejoin","round"),C(n,"class",o="feather feather-settings "+e[2])},m(t,e){m(t,n,e),g(n,r),g(n,s)},p(t,[e]){1&e&&C(n,"width",t[0]),1&e&&C(n,"height",t[0]),2&e&&C(n,"stroke-width",t[1]),4&e&&o!==(o="feather feather-settings "+t[2])&&C(n,"class",o)},i:t,o:t,d(t){t&&$(n)}}}function Pe(t,e,n){let{size:r="24"}=e,{strokeWidth:s=2}=e,{class:o=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,s=t.strokeWidth),"class"in t&&n(2,o=t.class)},[r,s,o]}class Te extends it{constructor(t){super(),ot(this,t,Pe,Se,i,{size:0,strokeWidth:1,class:2})}}function Ee(e){let n,r,s,o,i,a;return{c(){n=k("svg"),r=k("polyline"),s=k("path"),o=k("line"),i=k("line"),C(r,"points","3 6 5 6 21 6"),C(s,"d","M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"),C(o,"x1","10"),C(o,"y1","11"),C(o,"x2","10"),C(o,"y2","17"),C(i,"x1","14"),C(i,"y1","11"),C(i,"x2","14"),C(i,"y2","17"),C(n,"xmlns","http://www.w3.org/2000/svg"),C(n,"width",e[0]),C(n,"height",e[0]),C(n,"fill","none"),C(n,"viewBox","0 0 24 24"),C(n,"stroke","currentColor"),C(n,"stroke-width",e[1]),C(n,"stroke-linecap","round"),C(n,"stroke-linejoin","round"),C(n,"class",a="feather feather-trash-2 "+e[2])},m(t,e){m(t,n,e),g(n,r),g(n,s),g(n,o),g(n,i)},p(t,[e]){1&e&&C(n,"width",t[0]),1&e&&C(n,"height",t[0]),2&e&&C(n,"stroke-width",t[1]),4&e&&a!==(a="feather feather-trash-2 "+t[2])&&C(n,"class",a)},i:t,o:t,d(t){t&&$(n)}}}function We(t,e,n){let{size:r="24"}=e,{strokeWidth:s=2}=e,{class:o=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,s=t.strokeWidth),"class"in t&&n(2,o=t.class)},[r,s,o]}class Me extends it{constructor(t){super(),ot(this,t,We,Ee,i,{size:0,strokeWidth:1,class:2})}}function De(e){let n,r,s,o;return{c(){n=k("svg"),r=k("polyline"),s=k("polyline"),C(r,"points","23 6 13.5 15.5 8.5 10.5 1 18"),C(s,"points","17 6 23 6 23 12"),C(n,"xmlns","http://www.w3.org/2000/svg"),C(n,"width",e[0]),C(n,"height",e[0]),C(n,"fill","none"),C(n,"viewBox","0 0 24 24"),C(n,"stroke","currentColor"),C(n,"stroke-width",e[1]),C(n,"stroke-linecap","round"),C(n,"stroke-linejoin","round"),C(n,"class",o="feather feather-trending-up "+e[2])},m(t,e){m(t,n,e),g(n,r),g(n,s)},p(t,[e]){1&e&&C(n,"width",t[0]),1&e&&C(n,"height",t[0]),2&e&&C(n,"stroke-width",t[1]),4&e&&o!==(o="feather feather-trending-up "+t[2])&&C(n,"class",o)},i:t,o:t,d(t){t&&$(n)}}}function Ae(t,e,n){let{size:r="24"}=e,{strokeWidth:s=2}=e,{class:o=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,s=t.strokeWidth),"class"in t&&n(2,o=t.class)},[r,s,o]}class Le extends it{constructor(t){super(),ot(this,t,Ae,De,i,{size:0,strokeWidth:1,class:2})}}function Re(e){let n,r,s,o,i;return{c(){n=k("svg"),r=k("path"),s=k("polyline"),o=k("line"),C(r,"d","M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"),C(s,"points","17 8 12 3 7 8"),C(o,"x1","12"),C(o,"y1","3"),C(o,"x2","12"),C(o,"y2","15"),C(n,"xmlns","http://www.w3.org/2000/svg"),C(n,"width",e[0]),C(n,"height",e[0]),C(n,"fill","none"),C(n,"viewBox","0 0 24 24"),C(n,"stroke","currentColor"),C(n,"stroke-width",e[1]),C(n,"stroke-linecap","round"),C(n,"stroke-linejoin","round"),C(n,"class",i="feather feather-upload "+e[2])},m(t,e){m(t,n,e),g(n,r),g(n,s),g(n,o)},p(t,[e]){1&e&&C(n,"width",t[0]),1&e&&C(n,"height",t[0]),2&e&&C(n,"stroke-width",t[1]),4&e&&i!==(i="feather feather-upload "+t[2])&&C(n,"class",i)},i:t,o:t,d(t){t&&$(n)}}}function Ie(t,e,n){let{size:r="24"}=e,{strokeWidth:s=2}=e,{class:o=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,s=t.strokeWidth),"class"in t&&n(2,o=t.class)},[r,s,o]}class Be extends it{constructor(t){super(),ot(this,t,Ie,Re,i,{size:0,strokeWidth:1,class:2})}}function je(e){let n,r,s,o;return{c(){n=k("svg"),r=k("line"),s=k("line"),C(r,"x1","18"),C(r,"y1","6"),C(r,"x2","6"),C(r,"y2","18"),C(s,"x1","6"),C(s,"y1","6"),C(s,"x2","18"),C(s,"y2","18"),C(n,"xmlns","http://www.w3.org/2000/svg"),C(n,"width",e[0]),C(n,"height",e[0]),C(n,"fill","none"),C(n,"viewBox","0 0 24 24"),C(n,"stroke","currentColor"),C(n,"stroke-width",e[1]),C(n,"stroke-linecap","round"),C(n,"stroke-linejoin","round"),C(n,"class",o="feather feather-x "+e[2])},m(t,e){m(t,n,e),g(n,r),g(n,s)},p(t,[e]){1&e&&C(n,"width",t[0]),1&e&&C(n,"height",t[0]),2&e&&C(n,"stroke-width",t[1]),4&e&&o!==(o="feather feather-x "+t[2])&&C(n,"class",o)},i:t,o:t,d(t){t&&$(n)}}}function Oe(t,e,n){let{size:r="24"}=e,{strokeWidth:s=2}=e,{class:o=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,s=t.strokeWidth),"class"in t&&n(2,o=t.class)},[r,s,o]}class Ne extends it{constructor(t){super(),ot(this,t,Oe,je,i,{size:0,strokeWidth:1,class:2})}}const qe=[];let Fe;function He(t){const e=t.pattern.test(Fe);Ue(t,t.className,e),Ue(t,t.inactiveClassName,!e)}function Ue(t,e,n){(e||"").split(" ").forEach((e=>{e&&(t.node.classList.remove(e),n&&t.node.classList.add(e))}))}function Ve(t,e){if(!(e=e&&("string"==typeof e||"object"==typeof e&&e instanceof RegExp)?{path:e}:e||{}).path&&t.hasAttribute("href")&&(e.path=t.getAttribute("href"),e.path&&e.path.length>1&&"#"==e.path.charAt(0)&&(e.path=e.path.substring(1))),e.className||(e.className="active"),!e.path||"string"==typeof e.path&&(e.path.length<1||"/"!=e.path.charAt(0)&&"*"!=e.path.charAt(0)))throw Error('Invalid value for "path" argument');const{pattern:n}="string"==typeof e.path?dt(e.path):{pattern:e.path},r={node:t,className:e.className,inactiveClassName:e.inactiveClassName,pattern:n};return qe.push(r),He(r),{destroy(){qe.splice(qe.indexOf(r),1)}}}mt.subscribe((t=>{Fe=t.location+(t.querystring?"?"+t.querystring:""),qe.map(He)}));const Ye={lists:[],notes:""},Qe=["notes"];function Xe(){}class Ge{constructor(t,e){this.initialized=!1,this._list_db=new PouchDB(t),this._document_db=new PouchDB(e)}init(){return new Promise(((t,e)=>{this._list_db.allDocs({include_docs:!0}).then((n=>{n.rows.map((t=>t.doc.name)).includes("Bookmarks")?(this.initialized=!0,t()):this._list_db.post({name:"Bookmarks"}).then((n=>{if(!n.ok)throw console.error(n),e(new Error("There was an error initializing the bookmarks data. Check the logs for more details.")),new Xe;this.initialized=!0,t()})).catch((t=>{throw console.error(t),e(new Error("There was an error initializing the bookmarks data. Check the logs for more details.")),new Xe}))})).catch(Xe,(()=>{})).catch((t=>{console.error(t),e(new Error("There was an error loading bookmarks data. Check the logs for more details."))}))}))}waitForInit(){return new Promise(((t,e)=>{let n=!1;const r=()=>{this.initialized?(t(),n=!0):setTimeout(r,10)};n||r()}))}getLists(){return new Promise(((t,e)=>{this._list_db.allDocs({include_docs:!0}).then((e=>{t(e.rows.map((t=>t.doc.name)))})).catch((t=>{console.error(t),e(new Error("There was an error fetching the available word lists."))}))}))}getEmptyLists(){let t;return new Promise(((e,n)=>{this._list_db.allDocs({include_docs:!0}).then((e=>(t=e.rows.map((t=>t.doc)),this._document_db.allDocs({include_docs:!0})))).then((n=>{n=n.rows.map((t=>t.doc));const r=t.filter((t=>{const e=t._id;return!n.filter((t=>t.lists.includes(e))).length})).map((t=>t.name));e(r)})).catch((t=>{console.error(t),n(new Error("There was an error trying to fetch empty lists."))}))}))}createList(t){return new Promise(((e,n)=>{this._list_db.allDocs({include_docs:!0}).then((t=>t.rows.map((t=>t.doc.name)))).then((e=>{if(e.includes(t))throw n(new Error(`Cannot create list. A list with the name ${t} already exists.`)),new Xe;return this._list_db.post({name:t})})).then((r=>{r.ok?e():(console.error(r),n(new Error(`There was an error while creating ${t}. Check the logs for more details.`)))})).catch(Xe,(()=>{})).catch((e=>{console.error(e),n(new Error(`There was an error while creating ${t}. Check the logs for more details.`))}))}))}deleteList(t){let e;return new Promise(((n,r)=>{this._list_db.allDocs({include_docs:!0}).then((n=>{const s=n.rows.filter((e=>e.doc.name===t))[0];if(!s)throw r(new Error(`There was an error deleting the list ${t}. The list does not exist.`)),new Xe;return s.doc._deleted=!0,e=s.doc._id,this._list_db.put(s.doc)})).then((e=>{if(e.ok)return this._document_db.allDocs({include_docs:!0});throw console.error(e),r(`There was an error deleting the list ${t}. Check the log for more details.`),new Xe})).then((t=>{const n=t.rows.map((t=>t.doc));for(let t=0;tt!==e)),r.lists.length||(r._deleted=!0)}return this._document_db.bulkDocs(n)})).then((e=>{e.map((t=>t.ok)).includes(!1)?(console.error(e),r(new Error(`There was an error deleting the list ${t}. Check the log for more details.`))):n()})).catch(Xe,(()=>{})).catch((e=>{console.error(e),r(new Error(`There was an error deleting the list ${t}. Check the log for more details.`))}))}))}getListContent(t){let e;return new Promise(((n,r)=>{this._list_db.allDocs({include_docs:!0}).then((n=>{const s=n.rows.filter((e=>e.doc.name===t))[0];if(!s)throw console.error(n),r(new Error(`There was an error fetching the contents of ${t}. List does not exist! Check the log for more details.`)),new Xe;return e=s.doc._id,this._document_db.allDocs({include_docs:!0})})).then((t=>{n(t.rows.filter((t=>t.doc.lists.includes(e))).map((t=>t.doc)))})).catch(Xe,(()=>{})).catch((e=>{console.error(e),r(new Error(`There was an error loading the list ${t}. Check the log for more details.`))}))}))}getWordByHash(t){return new Promise(((e,n)=>{this._document_db.allDocs({include_docs:!0}).then((n=>{e(n.rows.filter((e=>e.doc.hash===t)).map((t=>t.doc))[0])}))}))}_createWordEntry(t,e){const n={...Ye,...t};return n.lists=[e],n}addToList(t,e){let n;return new Promise(((r,s)=>{this._list_db.allDocs({include_docs:!0}).then((e=>{const r=e.rows.filter((e=>e.doc.name===t)).map((t=>t.doc))[0];if(!r)throw s(new Error(`There was an error adding the word to ${t}. List does not exist!`)),new Xe;return n=r._id,this._document_db.allDocs({include_docs:!0})})).then((t=>{const r=t.rows.map((t=>t.doc));let s=r.filter((t=>t.hash===e.hash))[0];return s?(s.lists.includes(n)||s.lists.push(n),this._document_db.put(s)):(s=this._createWordEntry(e,n),this._document_db.post(s))})).then((e=>{e.ok?r():(console.error(e),s(new Error(`There was an error adding the word to ${t}. Check the log for more details.`)))})).catch(Xe,(()=>{})).catch((e=>{console.error(e),s(new Error(`There was an error adding the word to ${t}. Check the log for more details.`))}))}))}removeFromList(t,e){let n;return new Promise(((r,s)=>{this._list_db.allDocs({include_docs:!0}).then((e=>{const r=e.rows.filter((e=>e.doc.name===t)).map((t=>t.doc))[0];if(!r)throw s(new Error(`There was an error removing the word from ${t}. The list does not exist.`)),new Xe;return n=r._id,this._document_db.allDocs({include_docs:!0})})).then((r=>{const o=r.rows.map((t=>t.doc));let i=o.filter((t=>t.hash===e.hash))[0];if(i)return i.lists=i.lists.filter((t=>t!==n)),this._document_db.put(i);throw s(new Error(`There was an error removing the word from ${t}. The word does not exist!`)),new Xe})).then((e=>{e.ok?r():(console.error(e),s(new Error(`There was an error removing the word from ${t}. Check the log for more details.`)))})).catch(Xe,(()=>{})).catch((e=>{console.error(e),s(new Error(`There was an error removing the word from ${t}. Check the log for more details.`))}))}))}inList(t){let e;return new Promise(((n,r)=>{this.getWordByHash(t).then((t=>(e=t?t.lists:[],this._list_db.allDocs({include_docs:!0})))).then((t=>{n(t.rows.filter((t=>e.includes(t.doc._id))).map((t=>t.doc.name)))})).catch((t=>{console.error(t),r(new Error("There was an error fetching bookmarks data. Please check the log for more details."))}))}))}updateProperty(t,e,n){return new Promise(((r,s)=>{this.getWordByHash(t).then((t=>{if(!t)throw s(new Error("There was an error updating the bookmarks entry. That word could not be found in any of your lists.")),new Xe;if(!Qe.includes(e))throw s(new Error(`There was an error updating the bookmarks entry. The property ${e} cannot be updated with this method.`)),new Xe;return t[e]=n,this._document_db.put(t)})).then((t=>{t.ok?r():s(new Error("There was an error updating the bookmarks entry."))})).catch(Xe,(()=>{})).catch((t=>{console.error(t),s(new Error("There was an error updating the bookmarks entry. Check the log for more details."))}))}))}}const Ke=(t,e)=>{e&&console.error(e),alert(t)},Je=(t,e)=>({requiresRestart:t,value:e});class Ze{constructor(t){this._name=t,this._config={},this.initialized=!1}init(){return new Promise(((t,e)=>{this._db=new PouchDB(this._name),this._db.get("config").catch((t=>{if("not_found"===t.name)return{_id:"config",transparency:Je(!0,!1),beta:Je(!0,!1),toneColors:Je(!0,{colors:["--sy-color--blue-3","--sy-color--yellow-1","--sy-color--red-1","--sy-color--green-3","--sy-color--grey-4"],hasCustomColors:!1})};console.error(t),e("There was an error loading user preferences. Check the logs for more details.")})).then((e=>{this._config=e,this.initialized=!0,t()})).catch((t=>{console.error(t),e("There was an error loading user preferences. Check the logs for more details.")}))}))}waitForInit(){return new Promise(((t,e)=>{let n=!1;const r=()=>{this.initialized?(t(),n=!0):setTimeout(r,10)};n||r()}))}get(t){if(!this.initialized)return Ke("Cannot read preferences. Preferences not yet initialized."),void console.log("Trying to access property "+t);const e=this._config[t];return e||Ke(`Requested preference ${t} does not exist!`),e.value}set(t,e){if(!this.initialized)return void Ke("Cannot save preferences. Preferences not yet initialized.");const n=this._config[t];n?(n.requiresRestart&&alert("You must restart Syng for this change to take effect."),this._config[t].value=e,this._db.put(this._config).then((t=>{t.ok?this._config._rev=t.rev:Ke("Cannot save preferences. An unknown error occurred. Check the log for more details.",t)})).catch((t=>{Ke("Cannot save preferences. An unknown error occurred. Check the logs for more details.",t)}))):Ke(`Requested preference ${t} does not exist!`)}}const tn=async()=>"debug"in await(async()=>{try{const t=await window.__TAURI__.cli.getMatches();return"run"===t.subcommand.name?t.subcommand.matches.args:t.args}catch(t){return console.error(t),{}}})();function en(){return en=Object.assign||function(t){for(var e=1;e=g),v="y"===i&&(m<=0||m+u>=f);w||v||(r=!1,n.removeEventListener(un,l),n.removeEventListener(un,c),"translate3d(0px, 0px, 0px)"!==n.style.transform&&(n.style.transition="none",n.style.transform=pn)),m===s&&$===o||(s=m,o=$,r||!w&&!v||(r=!0,n.addEventListener(un,l),n.style.transition="transform ".concat(e.duration[0],"ms ").concat(e.easing),n.style.transform="translate3d(".concat(w?e.intensity*-h:0,"px, ").concat(v?e.intensity*-d:0,"px, 0)")))}function l(){n.removeEventListener(un,l),n.addEventListener(un,c),n.style.transition="transform ".concat(e.duration[1],"ms ").concat(e.easing),n.style.transform=pn}function c(){n.removeEventListener(un,c),r=!1}function h(){e.appleDevicesOnly&&!hn||(e.useNative&&cn?t.style.webkitOverflowScrolling="touch":e.useNative&&cn||t.addEventListener("wheel",a,{passive:!0}))}h();var d={el:t,props:e,enable:h,disable:function(){t.style.webkitOverflowScrolling="",t.removeEventListener("wheel",a,{passive:!0})}};return t._elasticScroll=d,d}function gn(t){var e,n=en({},nn,t),r=(e=n.targets,"string"==typeof e?dn(document.querySelectorAll(e)):e instanceof NodeList?dn(e):e instanceof Element?[e]:[]).map((function(t){return fn(t,n)})).filter(Boolean);return n.targets instanceof Element?r[0]:r}gn.defaults=nn,window.onload=()=>{gn({appleDevicesOnly:!1,intensity:1})};const mn=()=>{const t=tn(),e=t?"development_config":"config",n=t?"development_word-lists":"word-lists",r=t?"development_bookmarks":"bookmarks";window.preferenceManager=new Ze(e),window.bookmarkManager=new Ge(n,r);const s=[{name:"init-dictionary",action:window.__TAURI__.invoke("init_dictionary")},{name:"init-preference-manager",action:window.preferenceManager.init()},{name:"cache-platform",action:window.__TAURI__.os.platform()},{name:"init-bookmark-manager",action:window.bookmarkManager.init()}];Promise.all(s.map((t=>t.action))).then((t=>{const e=(t=>t.map(((t,e)=>({name:s[e].name,result:t}))))(t);window.platform=((t,e)=>{const n=e.find((e=>e.name===t));return n?n.result:void 0})("cache-platform",e),document.dispatchEvent(new Event("init")),(()=>{const t=window.preferenceManager.get("toneColors");if(t.hasCustomColors){const e=document.querySelector(":root").style,n=t.colors;for(let t=0;t{Ke("There was an error starting Syng. Please quit and try again. If this problem persists please file a bug report.",t)}))};function $n(t,e,n){const r=t.slice();return r[6]=e[n],r}function wn(t,e,n){const r=t.slice();return r[6]=e[n],r}function vn(t){let e,n,r,s,o,i,a,l,c,h,d,u=t[6].title+"";var p=t[6].icon;return p&&(r=P(p,{props:{size:"24"}})),{c(){e=v("a"),n=v("span"),r&&nt(r.$$.fragment),s=y(),o=v("div"),i=v("p"),a=_(u),l=y(),C(n,"class","navigation--item svelte-81zlxj"),C(o,"class","sy-tooltip--body sy-tooltip--body-right"),C(e,"href",`#/${t[6].link}`),C(e,"class","sy-tooltip--container")},m(u,p){m(u,e,p),g(e,n),r&&rt(r,n,null),g(e,s),g(e,o),g(o,i),g(i,a),g(e,l),c=!0,h||(d=f(Ve.call(null,n,{path:t[6].pattern||`/${t[6].link}`,className:"navigation--item-active"})),h=!0)},p(e,s){if(p!==(p=(t=e)[6].icon)){if(r){G();const t=r;Z(t.$$.fragment,1,0,(()=>{st(t,1)})),K()}p?(r=P(p,{props:{size:"24"}}),nt(r.$$.fragment),J(r.$$.fragment,1),rt(r,n,null)):r=null}},i(t){c||(r&&J(r.$$.fragment,t),c=!0)},o(t){r&&Z(r.$$.fragment,t),c=!1},d(t){t&&$(e),r&&st(r),h=!1,d()}}}function kn(t){let e,n,r=(!t[6].beta||t[0])&&vn(t);return{c(){r&&r.c(),e=x()},m(t,s){r&&r.m(t,s),m(t,e,s),n=!0},p(t,n){!t[6].beta||t[0]?r?(r.p(t,n),1&n&&J(r,1)):(r=vn(t),r.c(),J(r,1),r.m(e.parentNode,e)):r&&(G(),Z(r,1,1,(()=>{r=null})),K())},i(t){n||(J(r),n=!0)},o(t){Z(r),n=!1},d(t){r&&r.d(t),t&&$(e)}}}function _n(t){let e,n,r,s,o,i,a,l,c,h,d,u=t[6].title+"";var p=t[6].icon;function w(t){return{props:{size:t[6].size}}}return p&&(r=P(p,w(t))),{c(){e=v("a"),n=v("span"),r&&nt(r.$$.fragment),s=y(),o=v("div"),i=v("p"),a=_(u),l=y(),C(n,"class","navigation--item svelte-81zlxj"),C(o,"class","sy-tooltip--body sy-tooltip--body-right"),C(e,"href",`#/${t[6].link}`),C(e,"class","sy-tooltip--container")},m(u,p){m(u,e,p),g(e,n),r&&rt(r,n,null),g(e,s),g(e,o),g(o,i),g(i,a),g(e,l),c=!0,h||(d=f(Ve.call(null,n,{path:`/${t[6].link}`,className:"navigation--item-active"})),h=!0)},p(e,s){if(p!==(p=(t=e)[6].icon)){if(r){G();const t=r;Z(t.$$.fragment,1,0,(()=>{st(t,1)})),K()}p?(r=P(p,w(t)),nt(r.$$.fragment),J(r.$$.fragment,1),rt(r,n,null)):r=null}},i(t){c||(r&&J(r.$$.fragment,t),c=!0)},o(t){r&&Z(r.$$.fragment,t),c=!1},d(t){t&&$(e),r&&st(r),h=!1,d()}}}function yn(t){let e,n,r=(!t[6].beta||t[0])&&_n(t);return{c(){r&&r.c(),e=x()},m(t,s){r&&r.m(t,s),m(t,e,s),n=!0},p(t,n){!t[6].beta||t[0]?r?(r.p(t,n),1&n&&J(r,1)):(r=_n(t),r.c(),J(r,1),r.m(e.parentNode,e)):r&&(G(),Z(r,1,1,(()=>{r=null})),K())},i(t){n||(J(r),n=!0)},o(t){Z(r),n=!1},d(t){r&&r.d(t),t&&$(e)}}}function xn(t){let e,n,r,s,o,i=t[3],a=[];for(let e=0;eZ(a[t],1,1,(()=>{a[t]=null}));let c=t[4],h=[];for(let e=0;eZ(h[t],1,1,(()=>{h[t]=null}));return{c(){e=v("div"),n=v("div");for(let t=0;t{n(5,o="darwin"===t[1]),n(2,l=o),n(0,i=window.preferenceManager.get("beta")),n(1,a=o&&window.preferenceManager.get("transparency"))})).catch((t=>{Ke("There was an unexpected error reading system information. Syng may not operate as expected. Please restart Syng. If this problem persists, please report this bug. For more details check the logs.",t)})),t.$$.update=()=>{32&t.$$.dirty&&o&&window.__TAURI__.window.appWindow.onResized((()=>{window.__TAURI__.window.appWindow.isFullscreen().then((t=>{n(2,l=!t)}))})).then((t=>{console.log("We got unlisten back"),console.log(t)})).catch((t=>{console.log("There was an error doing this whole thing. Error = "),console.log(t)}))},[i,a,l,r,s,o]}class Cn extends it{constructor(t){super(),ot(this,t,bn,xn,i,{})}}function zn(t){let e,n,r,s;const o=t[12].default,i=l(o,t,t[11],null);return{c(){e=v("button"),i&&i.c(),C(e,"class",p(t[2]())+" svelte-161klet"),e.disabled=t[0],C(e,"data-testid","sy-button")},m(o,a){m(o,e,a),i&&i.m(e,null),n=!0,r||(s=b(e,"click",t[13]),r=!0)},p(t,[r]){i&&i.p&&(!n||2048&r)&&d(i,o,t,t[11],n?h(o,t[11],r,null):u(t[11]),null),(!n||1&r)&&(e.disabled=t[0])},i(t){n||(J(i,t),n=!0)},o(t){Z(i,t),n=!1},d(t){t&&$(e),i&&i.d(t),r=!1,s()}}}function Sn(t,e,n){let{$$slots:r={},$$scope:s}=e,{style:o="filled"}=e,{size:i="medium"}=e,{shape:a="rectangle"}=e,{disabled:l=!1}=e,{grouped:c=!1}=e,{color:h}=e,{hover:d}=e,{center:u=!1}=e,{classes:p=[]}=e;const f=D();return t.$$set=t=>{"style"in t&&n(3,o=t.style),"size"in t&&n(4,i=t.size),"shape"in t&&n(5,a=t.shape),"disabled"in t&&n(0,l=t.disabled),"grouped"in t&&n(6,c=t.grouped),"color"in t&&n(7,h=t.color),"hover"in t&&n(8,d=t.hover),"center"in t&&n(9,u=t.center),"classes"in t&&n(10,p=t.classes),"$$scope"in t&&n(11,s=t.$$scope)},[l,f,()=>p.concat(["sy-button",`sy-button--${o}`,`sy-button--${i}`,`sy-button--${a}`,u?"sy-button--center":"",h?`sy-button--color-${h}`:"",d?`sy-button--hover-${d}`:"",c?"sy-button--grouped":""]).join(" "),o,i,a,c,h,d,u,p,s,r,()=>f("click")]}class Pn extends it{constructor(t){super(),ot(this,t,Sn,zn,i,{style:3,size:4,shape:5,disabled:0,grouped:6,color:7,hover:8,center:9,classes:10})}}function Tn(t){let e,n;const r=t[3].default,s=l(r,t,t[2],null);return{c(){e=v("div"),s&&s.c(),C(e,"class",p(t[0]())+" svelte-vpwbgu")},m(t,r){m(t,e,r),s&&s.m(e,null),n=!0},p(t,[e]){s&&s.p&&(!n||4&e)&&d(s,r,t,t[2],n?h(r,t[2],e,null):u(t[2]),null)},i(t){n||(J(s,t),n=!0)},o(t){Z(s,t),n=!1},d(t){t&&$(e),s&&s.d(t)}}}function En(t,e,n){let{$$slots:r={},$$scope:s}=e,{size:o="medium"}=e;return t.$$set=t=>{"size"in t&&n(1,o=t.size),"$$scope"in t&&n(2,s=t.$$scope)},[()=>["sy-button-bar--container",`sy-button-bar--container--${o}`].join(" "),o,s,r]}class Wn extends it{constructor(t){super(),ot(this,t,En,Tn,i,{size:1})}}function Mn(e){let n,r,o,i;return{c(){n=v("span"),r=_(e[0]),C(n,"class",p(e[1]())+" svelte-312fzw")},m(t,s){m(t,n,s),g(n,r),o||(i=[b(n,"click",e[2]),b(n,"keyup",e[2])],o=!0)},p(t,[e]){1&e&&z(r,t[0])},i:t,o:t,d(t){t&&$(n),o=!1,s(i)}}}function Dn(t,e,n){let{text:r}=e,{color:s="black"}=e,{hover:o="blue"}=e,{icon:i}=e;const a=D();return t.$$set=t=>{"text"in t&&n(0,r=t.text),"color"in t&&n(3,s=t.color),"hover"in t&&n(4,o=t.hover),"icon"in t&&n(5,i=t.icon)},[r,()=>["st-dropdown-item--container",`st-dropdown-item--color--${s}`,`st-dropdown-item--hover--${o}`].join(" "),t=>{a("click",t)},s,o,i]}class An extends it{constructor(t){super(),ot(this,t,Dn,Mn,i,{text:0,color:3,hover:4,icon:5})}}function Ln(t,e,n){const r=t.slice();return r[13]=e[n],r}function Rn(t){let e,n,r;function s(...e){return t[9](t[13],...e)}var o=t[13].component;function i(t){return{props:{text:t[13].text,icon:t[13].icon,color:t[13].color,hover:t[13].hover}}}return o&&(e=P(o,i(t)),e.$on("click",s)),{c(){e&&nt(e.$$.fragment),n=x()},m(t,s){e&&rt(e,t,s),m(t,n,s),r=!0},p(r,a){t=r;const l={};if(1&a&&(l.text=t[13].text),1&a&&(l.icon=t[13].icon),1&a&&(l.color=t[13].color),1&a&&(l.hover=t[13].hover),1&a&&o!==(o=t[13].component)){if(e){G();const t=e;Z(t.$$.fragment,1,0,(()=>{st(t,1)})),K()}o?(e=P(o,i(t)),e.$on("click",s),nt(e.$$.fragment),J(e.$$.fragment,1),rt(e,n.parentNode,n)):e=null}else o&&e.$set(l)},i(t){r||(e&&J(e.$$.fragment,t),r=!0)},o(t){e&&Z(e.$$.fragment,t),r=!1},d(t){t&&$(n),e&&st(e,t)}}}function In(t){let e,n,r,o,i,a,c,f;const k=t[8].default,_=l(k,t,t[7],null);let x=t[0],z=[];for(let e=0;eZ(z[t],1,1,(()=>{z[t]=null}));return{c(){e=v("div"),n=v("span"),_&&_.c(),r=y(),o=v("div"),i=v("div");for(let t=0;t{t.composedPath().includes(l)||n(1,c=!1)},u=t=>{t&&(h("selection",t),n(1,c=!1))};M((()=>{document.removeEventListener("click",d,{capture:!0})}));return t.$$set=t=>{"values"in t&&n(0,o=t.values),"position"in t&&n(6,i=t.position),"$$scope"in t&&n(7,s=t.$$scope)},t.$$.update=()=>{2&t.$$.dirty&&(c?document.addEventListener("click",d,{capture:!0}):document.removeEventListener("click",d,{capture:!0}))},[o,c,a,u,()=>{n(1,c=!c)},()=>["sy-dropdown--list",`sy-dropdown--list--${i}`].join(" "),i,s,r,(t,e)=>u(t.id)]}class jn extends it{constructor(t){super(),ot(this,t,Bn,In,i,{values:0,position:6})}}function On(t){let e,n,r,o,i,a,l,c;var h=t[0];return h&&(n=P(h,{props:{size:"14"}})),{c(){e=v("span"),n&&nt(n.$$.fragment),r=_("\n\t \n\t"),o=v("span"),i=_(t[1]),C(e,"class",p(t[2]())+" svelte-rlw7fj")},m(s,h){m(s,e,h),n&&rt(n,e,null),g(e,r),g(e,o),g(o,i),a=!0,l||(c=[b(e,"click",t[3]),b(e,"keyup",t[3])],l=!0)},p(t,[s]){if(1&s&&h!==(h=t[0])){if(n){G();const t=n;Z(t.$$.fragment,1,0,(()=>{st(t,1)})),K()}h?(n=P(h,{props:{size:"14"}}),nt(n.$$.fragment),J(n.$$.fragment,1),rt(n,e,r)):n=null}(!a||2&s)&&z(i,t[1])},i(t){a||(n&&J(n.$$.fragment,t),a=!0)},o(t){n&&Z(n.$$.fragment,t),a=!1},d(t){t&&$(e),n&&st(n),l=!1,s(c)}}}function Nn(t,e,n){let{icon:r}=e,{text:s=""}=e,{hover:o="blue"}=e,{color:i="black"}=e;const a=D();return t.$$set=t=>{"icon"in t&&n(0,r=t.icon),"text"in t&&n(1,s=t.text),"hover"in t&&n(4,o=t.hover),"color"in t&&n(5,i=t.color)},[r,s,()=>["twi-dropdown-item--container",`twi-dropdown-item--color--${i}`,`twi-dropdown-item--hover--${o}`].join(" "),t=>{a("click",t)},o,i]}class qn extends it{constructor(t){super(),ot(this,t,Nn,On,i,{icon:0,text:1,hover:4,color:5})}}function Fn(t,e,n){const r=t.slice();return r[7]=e[n],r}function Hn(t){let e,n,r,s;var o=t[1];function i(t){return{props:{value:t[7]}}}return o&&(n=P(o,i(t)),n.$on("selection",t[5]),n.$on("event",t[6])),{c(){e=v("div"),n&&nt(n.$$.fragment),r=y(),C(e,"class","sy-list--list-item svelte-kedf8z")},m(t,o){m(t,e,o),n&&rt(n,e,null),g(e,r),s=!0},p(t,s){const a={};if(1&s&&(a.value=t[7]),2&s&&o!==(o=t[1])){if(n){G();const t=n;Z(t.$$.fragment,1,0,(()=>{st(t,1)})),K()}o?(n=P(o,i(t)),n.$on("selection",t[5]),n.$on("event",t[6]),nt(n.$$.fragment),J(n.$$.fragment,1),rt(n,e,r)):n=null}else o&&n.$set(a)},i(t){s||(n&&J(n.$$.fragment,t),s=!0)},o(t){n&&Z(n.$$.fragment,t),s=!1},d(t){t&&$(e),n&&st(n)}}}function Un(t){let e,n,r=t[0],s=[];for(let e=0;eZ(s[t],1,1,(()=>{s[t]=null}));return{c(){e=v("div");for(let t=0;t{"values"in t&&n(0,r=t.values),"component"in t&&n(1,s=t.component),"highlight"in t&&n(3,o=t.highlight),"filterable"in t&&n(4,i=t.filterable)},[r,s,a,o,i,t=>a("selection",t.detail),function(e){A.call(this,t,e)}]}class Yn extends it{constructor(t){super(),ot(this,t,Vn,Un,i,{values:0,component:1,highlight:3,filterable:4})}}function Qn(e){let n,r,o;return{c(){n=v("input"),C(n,"placeholder",e[0]),C(n,"type",e[1]),C(n,"class",p(e[5]())+" svelte-z7kzs5"),C(n,"id",e[2]),C(n,"spellcheck",e[3])},m(t,s){m(t,n,s),r||(o=[b(n,"change",e[10]),b(n,"keyup",e[6])],r=!0)},p(t,[e]){1&e&&C(n,"placeholder",t[0]),2&e&&C(n,"type",t[1]),4&e&&C(n,"id",t[2]),8&e&&C(n,"spellcheck",t[3])},i:t,o:t,d(t){t&&$(n),r=!1,s(o)}}}function Xn(t,e,n){let{style:r="standard"}=e,{size:s="medium"}=e,{transparency:o=!1}=e,{placeholder:i=""}=e,{type:a="text"}=e,{id:l}=e,{spellcheck:c}=e;const h=D();return t.$$set=t=>{"style"in t&&n(7,r=t.style),"size"in t&&n(8,s=t.size),"transparency"in t&&n(9,o=t.transparency),"placeholder"in t&&n(0,i=t.placeholder),"type"in t&&n(1,a=t.type),"id"in t&&n(2,l=t.id),"spellcheck"in t&&n(3,c=t.spellcheck)},[i,a,l,c,h,()=>["sy-text-input",o?"sy-text-input--transparency":"",`sy-text-input--${r}`,`sy-text-input--${s}`].join(" "),t=>{"Enter"==t.code?h("enter",t):h("keyup",t.srcElement.value)},r,s,o,t=>h("change",t.srcElement.value)]}class Gn extends it{constructor(t){super(),ot(this,t,Xn,Qn,i,{style:7,size:8,transparency:9,placeholder:0,type:1,id:2,spellcheck:3})}}function Kn(e){let n,r,o,i,a,l,c,h,d,u,f,w=e[6](e[2])+"";return{c(){n=v("div"),r=v("p"),o=_(e[0]),i=y(),a=v("p"),l=_(e[1]),c=y(),h=v("p"),d=_(w),C(r,"class","sy-list-preview-item--text sy-list-preview-item--headline svelte-14tz0cu"),C(a,"class","sy-list-preview-item--text sy-list-preview-item--subtitle svelte-14tz0cu"),C(h,"class","sy-list-preview-item--text sy-list-preview-item--content svelte-14tz0cu"),C(n,"class",p(e[8]())+" svelte-14tz0cu"),S(n,"sy-list-preview-item-container--active",e[4]&&e[5])},m(t,s){m(t,n,s),g(n,r),g(r,o),g(n,i),g(n,a),g(a,l),g(n,c),g(n,h),g(h,d),u||(f=[b(n,"click",e[10]),b(n,"keyup",e[9])],u=!0)},p(t,[e]){1&e&&z(o,t[0]),2&e&&z(l,t[1]),4&e&&w!==(w=t[6](t[2])+"")&&z(d,w),48&e&&S(n,"sy-list-preview-item-container--active",t[4]&&t[5])},i:t,o:t,d(t){t&&$(n),u=!1,s(f)}}}function Jn(t,e,n){let{headline:r=""}=e,{subtitle:s=""}=e,{content:o=""}=e,{index:i}=e,{active:a=!1}=e,{highlight:l}=e;const c=D();return t.$$set=t=>{"headline"in t&&n(0,r=t.headline),"subtitle"in t&&n(1,s=t.subtitle),"content"in t&&n(2,o=t.content),"index"in t&&n(3,i=t.index),"active"in t&&n(4,a=t.active),"highlight"in t&&n(5,l=t.highlight)},[r,s,o,i,a,l,t=>t.length>25?`${t.slice(0,22)}...`:t,c,()=>["sy-list-preview-item-container"].join(" "),t=>{13===t.keycode&&c("click",i)},()=>c("click",i)]}class Zn extends it{constructor(t){super(),ot(this,t,Jn,Kn,i,{headline:0,subtitle:1,content:2,index:3,active:4,highlight:5})}}function tr(t,e,n){const r=t.slice();return r[11]=e[n],r[13]=n,r}function er(e){let n,r;return n=new Gn({props:{spellcheck:!1,placeholder:"Filter",size:"large",id:e[4]}}),n.$on("keyup",e[6]),{c(){nt(n.$$.fragment)},m(t,e){rt(n,t,e),r=!0},p:t,i(t){r||(J(n.$$.fragment,t),r=!0)},o(t){Z(n.$$.fragment,t),r=!1},d(t){st(n,t)}}}function nr(t){let e,n;return e=new Zn({props:{headline:t[11].headline,subtitle:t[11].subtitle,content:t[11].content,active:t[2]===t[13],index:t[13],highlight:t[0]}}),e.$on("click",t[5]),e.$on("event",t[9]),{c(){nt(e.$$.fragment)},m(t,r){rt(e,t,r),n=!0},p(t,n){const r={};8&n&&(r.headline=t[11].headline),8&n&&(r.subtitle=t[11].subtitle),8&n&&(r.content=t[11].content),4&n&&(r.active=t[2]===t[13]),1&n&&(r.highlight=t[0]),e.$set(r)},i(t){n||(J(e.$$.fragment,t),n=!0)},o(t){Z(e.$$.fragment,t),n=!1},d(t){st(e,t)}}}function rr(t){let e,n,r,s=t[1]&&er(t),o=t[3],i=[];for(let e=0;eZ(i[t],1,1,(()=>{i[t]=null}));return{c(){s&&s.c(),e=y();for(let t=0;t{s=null})),K()),45&r){let e;for(o=t[3],e=0;e{"values"in t&&n(7,o=t.values),"highlight"in t&&n(0,i=t.highlight),"filterable"in t&&n(1,a=t.filterable),"component"in t&&n(8,l=t.component)},t.$$.update=()=>{if(130&t.$$.dirty&&o&&(n(3,c=o),a)){const t=document.getElementById(r);t&&(t.value="")}},[i,a,s,c,r,t=>{n(2,s=t.detail),h("selection",{index:o.indexOf(c[s]),value:c[s]})},t=>{t=t.detail,n(3,c=o.filter((e=>e.content.includes(t)||e.headline.includes(t)||e.subtitle.includes(t))))},o,l,function(e){A.call(this,t,e)}]}class or extends it{constructor(t){super(),ot(this,t,sr,rr,i,{values:7,highlight:0,filterable:1,component:8})}}function ir(t){let e,n,r;var s=t[6][t[0]];function o(t){return{props:{values:t[1],component:t[2],highlight:t[3],filterable:t[4]}}}return s&&(e=P(s,o(t)),e.$on("selection",t[7]),e.$on("event",t[8])),{c(){e&&nt(e.$$.fragment),n=x()},m(t,s){e&&rt(e,t,s),m(t,n,s),r=!0},p(t,[r]){const i={};if(2&r&&(i.values=t[1]),4&r&&(i.component=t[2]),8&r&&(i.highlight=t[3]),16&r&&(i.filterable=t[4]),1&r&&s!==(s=t[6][t[0]])){if(e){G();const t=e;Z(t.$$.fragment,1,0,(()=>{st(t,1)})),K()}s?(e=P(s,o(t)),e.$on("selection",t[7]),e.$on("event",t[8]),nt(e.$$.fragment),J(e.$$.fragment,1),rt(e,n.parentNode,n)):e=null}else s&&e.$set(i)},i(t){r||(e&&J(e.$$.fragment,t),r=!0)},o(t){e&&Z(e.$$.fragment,t),r=!1},d(t){t&&$(n),e&&st(e,t)}}}function ar(t,e,n){let{style:r="content"}=e,{values:s=[]}=e,{component:o}=e,{highlight:i}=e,{filterable:a=!1}=e;const l=D(),c={preview:or,content:Yn};return t.$$set=t=>{"style"in t&&n(0,r=t.style),"values"in t&&n(1,s=t.values),"component"in t&&n(2,o=t.component),"highlight"in t&&n(3,i=t.highlight),"filterable"in t&&n(4,a=t.filterable)},[r,s,o,i,a,l,c,t=>l("selection",t.detail),function(e){A.call(this,t,e)}]}class lr extends it{constructor(t){super(),ot(this,t,ar,ir,i,{style:0,values:1,component:2,highlight:3,filterable:4})}}function cr(t){let e,n,r,s;const o=t[3].default,i=l(o,t,t[2],null);return{c(){e=v("a"),i&&i.c(),C(e,"href","javascript:void(0)"),C(e,"class","dictionary-link svelte-vhlbnn"),C(e,"data-testid","dictionary-link")},m(o,a){m(o,e,a),i&&i.m(e,null),n=!0,r||(s=b(e,"click",t[4]),r=!0)},p(t,[e]){i&&i.p&&(!n||4&e)&&d(i,o,t,t[2],n?h(o,t[2],e,null):u(t[2]),null)},i(t){n||(J(i,t),n=!0)},o(t){Z(i,t),n=!1},d(t){t&&$(e),i&&i.d(t),r=!1,s()}}}function hr(t,e,n){let{$$slots:r={},$$scope:s}=e,{link:o}=e;const i=D(),a=()=>i("open",o);return t.$$set=t=>{"link"in t&&n(1,o=t.link),"$$scope"in t&&n(2,s=t.$$scope)},[a,o,s,r,()=>a()]}class dr extends it{constructor(t){super(),ot(this,t,hr,cr,i,{link:1})}}function ur(e){let n;return{c(){n=_(e[0])},m(t,e){m(t,n,e)},p(t,e){1&e&&z(n,t[0])},i:t,o:t,d(t){t&&$(n)}}}function pr(t){let e,n,r,s,o=t[0].split(t[1](t[0]))+"";return r=new dr({props:{link:t[3](t[1](t[0])),$$slots:{default:[fr]},$$scope:{ctx:t}}}),r.$on("open",t[4]),{c(){e=_(o),n=_(" \n\t\t"),nt(r.$$.fragment)},m(t,o){m(t,e,o),m(t,n,o),rt(r,t,o),s=!0},p(t,n){(!s||1&n)&&o!==(o=t[0].split(t[1](t[0]))+"")&&z(e,o);const i={};1&n&&(i.link=t[3](t[1](t[0]))),129&n&&(i.$$scope={dirty:n,ctx:t}),r.$set(i)},i(t){s||(J(r.$$.fragment,t),s=!0)},o(t){Z(r.$$.fragment,t),s=!1},d(t){t&&$(e),t&&$(n),st(r,t)}}}function fr(t){let e,n=t[2](t[1](t[0]))+"";return{c(){e=_(n)},m(t,n){m(t,e,n)},p(t,r){1&r&&n!==(n=t[2](t[1](t[0]))+"")&&z(e,n)},d(t){t&&$(e)}}}function gr(t){let e,n,r,s,o;const i=[pr,ur],a=[];function l(t,e){return 1&e&&(n=null),null==n&&(n=!!mr.test(t[0])),n?0:1}return r=l(t,-1),s=a[r]=i[r](t),{c(){e=v("div"),s.c(),C(e,"class","dictionary-content--definition-item svelte-1qtxwq5")},m(t,n){m(t,e,n),a[r].m(e,null),o=!0},p(t,[n]){let o=r;r=l(t,n),r===o?a[r].p(t,n):(G(),Z(a[o],1,1,(()=>{a[o]=null})),K(),s=a[r],s?s.p(t,n):(s=a[r]=i[r](t),s.c()),J(s,1),s.m(e,null))},i(t){o||(J(s),o=!0)},o(t){Z(s),o=!1},d(t){t&&$(e),a[r].d()}}}const mr=/\s\S+\[(\S|\s\S)+.\]/g;function $r(t,e,n){let{value:r}=e;const s=t=>{const e=t.split("[")[0].split("|");return{traditional:e[0],simplified:e[1]||e[0]}},o=D();return t.$$set=t=>{"value"in t&&n(0,r=t.value)},[r,t=>{const e=t.match(mr);return e?e[0]:null},t=>{const e=s(t);return e.traditional==e.simplified?`${e.traditional}`:`${e.simplified} (${e.traditional})`},t=>s(t).traditional,t=>o("event",t.detail)]}class wr extends it{constructor(t){super(),ot(this,t,$r,gr,i,{value:0})}}function vr(t,e,n){const r=t.slice();return r[2]=e[n],r[4]=n,r}function kr(t){let e,n,r,s=t[2]+"";return{c(){e=v("span"),n=_(s),C(e,"class",r=p(`colored-characters--tone-${t[1][t[4]]||5}`)+" svelte-sic3zr")},m(t,r){m(t,e,r),g(e,n)},p(t,o){1&o&&s!==(s=t[2]+"")&&z(n,s),2&o&&r!==(r=p(`colored-characters--tone-${t[1][t[4]]||5}`)+" svelte-sic3zr")&&C(e,"class",r)},d(t){t&&$(e)}}}function _r(e){let n,r=e[0],s=[];for(let t=0;t{"characters"in t&&n(0,r=t.characters),"tones"in t&&n(1,s=t.tones)},[r,s]}class xr extends it{constructor(t){super(),ot(this,t,yr,_r,i,{characters:0,tones:1})}}function br(t){let e,n,r,s;return n=new xr({props:{characters:t[0].traditional,tones:t[0].tone_marks}}),{c(){e=_(" ("),nt(n.$$.fragment),r=_(")")},m(t,o){m(t,e,o),rt(n,t,o),m(t,r,o),s=!0},p(t,e){const r={};1&e&&(r.characters=t[0].traditional),1&e&&(r.tones=t[0].tone_marks),n.$set(r)},i(t){s||(J(n.$$.fragment,t),s=!0)},o(t){Z(n.$$.fragment,t),s=!1},d(t){t&&$(e),st(n,t),t&&$(r)}}}function Cr(t){let e,n,r,s,o,i,a,l,c,h=t[0].pinyin_marks+"";r=new xr({props:{characters:t[0].simplified,tones:t[0].tone_marks}});let d=t[0].simplified!=t[0].traditional&&br(t);return{c(){e=v("div"),n=v("h1"),nt(r.$$.fragment),s=y(),d&&d.c(),o=y(),i=v("div"),a=v("h3"),l=_(h),C(n,"class","chinese-characters--character-container chinese-characters--character svelte-k2y6zv"),C(n,"data-testid","chinese-characters"),C(a,"class","chinese-characters--pinyin-container svelte-k2y6zv"),C(e,"class","chinese-characters--container svelte-k2y6zv")},m(t,h){m(t,e,h),g(e,n),rt(r,n,null),g(n,s),d&&d.m(n,null),g(e,o),g(e,i),g(i,a),g(a,l),c=!0},p(t,[e]){const s={};1&e&&(s.characters=t[0].simplified),1&e&&(s.tones=t[0].tone_marks),r.$set(s),t[0].simplified!=t[0].traditional?d?(d.p(t,e),1&e&&J(d,1)):(d=br(t),d.c(),J(d,1),d.m(n,null)):d&&(G(),Z(d,1,1,(()=>{d=null})),K()),(!c||1&e)&&h!==(h=t[0].pinyin_marks+"")&&z(l,h)},i(t){c||(J(r.$$.fragment,t),J(d),c=!0)},o(t){Z(r.$$.fragment,t),Z(d),c=!1},d(t){t&&$(e),st(r),d&&d.d()}}}function zr(t,e,n){let{word:r={}}=e;return t.$$set=t=>{"word"in t&&n(0,r=t.word)},[r]}class Sr extends it{constructor(t){super(),ot(this,t,zr,Cr,i,{word:0})}}function Pr(t){let e,n,r,s=t[0].traditional+"";return{c(){e=_(" ("),n=_(s),r=_(")")},m(t,s){m(t,e,s),m(t,n,s),m(t,r,s)},p(t,e){1&e&&s!==(s=t[0].traditional+"")&&z(n,s)},d(t){t&&$(e),t&&$(n),t&&$(r)}}}function Tr(t){let e,n,r,s=t[0].simplified+"",o=t[0].simplified!=t[0].traditional&&Pr(t);return{c(){e=_(s),n=y(),o&&o.c(),r=x()},m(t,s){m(t,e,s),m(t,n,s),o&&o.m(t,s),m(t,r,s)},p(t,n){1&n&&s!==(s=t[0].simplified+"")&&z(e,s),t[0].simplified!=t[0].traditional?o?o.p(t,n):(o=Pr(t),o.c(),o.m(r.parentNode,r)):o&&(o.d(1),o=null)},d(t){t&&$(e),t&&$(n),o&&o.d(t),t&&$(r)}}}function Er(t){let e,n,r;return n=new dr({props:{link:t[0].traditional,$$slots:{default:[Tr]},$$scope:{ctx:t}}}),n.$on("open",t[1]),{c(){e=v("div"),nt(n.$$.fragment),C(e,"class","dictionary-content--mw svelte-n92ii8")},m(t,s){m(t,e,s),rt(n,e,null),r=!0},p(t,[e]){const r={};1&e&&(r.link=t[0].traditional),9&e&&(r.$$scope={dirty:e,ctx:t}),n.$set(r)},i(t){r||(J(n.$$.fragment,t),r=!0)},o(t){Z(n.$$.fragment,t),r=!1},d(t){t&&$(e),st(n)}}}function Wr(t,e,n){let{value:r}=e;const s=D();return t.$$set=t=>{"value"in t&&n(0,r=t.value)},[r,t=>s("event",t.detail)]}class Mr extends it{constructor(t){super(),ot(this,t,Wr,Er,i,{value:0})}}function Dr(t,e,n){const r=t.slice();return r[18]=e[n],r}function Ar(t){let e,n,r,s,o,i,a,l,c,h,d,u,p;n=new Sr({props:{word:t[0]}}),s=new Wn({props:{$$slots:{default:[Fr]},$$scope:{ctx:t}}}),c=new lr({props:{values:t[0].english,component:wr}}),c.$on("event",t[2]);let f=t[0].measure_words.length&&Hr(t),w="string"==typeof t[0].notes&&Ur(t);return{c(){e=v("section"),nt(n.$$.fragment),r=y(),nt(s.$$.fragment),o=y(),i=v("section"),a=v("h2"),a.textContent="Definitions",l=y(),nt(c.$$.fragment),h=y(),f&&f.c(),d=y(),w&&w.c(),u=x(),C(e,"class","dictionary-content dictionary-content--header svelte-1dqewiq"),C(a,"class","dictionary-content--section-title svelte-1dqewiq"),C(i,"class","dictionary-content svelte-1dqewiq")},m(t,$){m(t,e,$),rt(n,e,null),g(e,r),rt(s,e,null),m(t,o,$),m(t,i,$),g(i,a),g(i,l),rt(c,i,null),m(t,h,$),f&&f.m(t,$),m(t,d,$),w&&w.m(t,$),m(t,u,$),p=!0},p(t,e){const r={};1&e&&(r.word=t[0]),n.$set(r);const o={};2097154&e&&(o.$$scope={dirty:e,ctx:t}),s.$set(o);const i={};1&e&&(i.values=t[0].english),c.$set(i),t[0].measure_words.length?f?(f.p(t,e),1&e&&J(f,1)):(f=Hr(t),f.c(),J(f,1),f.m(d.parentNode,d)):f&&(G(),Z(f,1,1,(()=>{f=null})),K()),"string"==typeof t[0].notes?w?w.p(t,e):(w=Ur(t),w.c(),w.m(u.parentNode,u)):w&&(w.d(1),w=null)},i(t){p||(J(n.$$.fragment,t),J(s.$$.fragment,t),J(c.$$.fragment,t),J(f),p=!0)},o(t){Z(n.$$.fragment,t),Z(s.$$.fragment,t),Z(c.$$.fragment,t),Z(f),p=!1},d(t){t&&$(e),st(n),st(s),t&&$(o),t&&$(i),st(c),t&&$(h),f&&f.d(t),t&&$(d),w&&w.d(t),t&&$(u)}}}function Lr(t){let e,n;return e=new Pn({props:{grouped:"true",classes:["sy-tooltip--container"],$$slots:{default:[Br]},$$scope:{ctx:t}}}),e.$on("click",(function(){o(t[18].action)&&t[18].action.apply(this,arguments)})),{c(){nt(e.$$.fragment)},m(t,r){rt(e,t,r),n=!0},p(n,r){t=n;const s={};2097154&r&&(s.$$scope={dirty:r,ctx:t}),e.$set(s)},i(t){n||(J(e.$$.fragment,t),n=!0)},o(t){Z(e.$$.fragment,t),n=!1},d(t){st(e,t)}}}function Rr(t){let e,n;return e=new jn({props:{values:t[18].dropdown,position:"right",$$slots:{default:[Nr]},$$scope:{ctx:t}}}),e.$on("selection",t[4]),{c(){nt(e.$$.fragment)},m(t,r){rt(e,t,r),n=!0},p(t,n){const r={};2&n&&(r.values=t[18].dropdown),2097154&n&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(J(e.$$.fragment,t),n=!0)},o(t){Z(e.$$.fragment,t),n=!1},d(t){st(e,t)}}}function Ir(t){let e,n,r,s=t[18].tooltip+"";return{c(){e=v("div"),n=v("p"),r=_(s),C(e,"class","sy-tooltip--body sy-tooltip--body-bottom")},m(t,s){m(t,e,s),g(e,n),g(n,r)},p(t,e){2&e&&s!==(s=t[18].tooltip+"")&&z(r,s)},d(t){t&&$(e)}}}function Br(t){let e,n,r,s;var o=t[18].component;o&&(e=P(o,{props:{size:"18"}}));let i=t[18].tooltip&&Ir(t);return{c(){e&&nt(e.$$.fragment),n=y(),i&&i.c(),r=y()},m(t,o){e&&rt(e,t,o),m(t,n,o),i&&i.m(t,o),m(t,r,o),s=!0},p(t,s){if(2&s&&o!==(o=t[18].component)){if(e){G();const t=e;Z(t.$$.fragment,1,0,(()=>{st(t,1)})),K()}o?(e=P(o,{props:{size:"18"}}),nt(e.$$.fragment),J(e.$$.fragment,1),rt(e,n.parentNode,n)):e=null}t[18].tooltip?i?i.p(t,s):(i=Ir(t),i.c(),i.m(r.parentNode,r)):i&&(i.d(1),i=null)},i(t){s||(e&&J(e.$$.fragment,t),s=!0)},o(t){e&&Z(e.$$.fragment,t),s=!1},d(t){e&&st(e,t),t&&$(n),i&&i.d(t),t&&$(r)}}}function jr(t){let e,n,r,s=t[18].tooltip+"";return{c(){e=v("div"),n=v("p"),r=_(s),C(e,"class","sy-tooltip--body sy-tooltip--body-bottom")},m(t,s){m(t,e,s),g(e,n),g(n,r)},p(t,e){2&e&&s!==(s=t[18].tooltip+"")&&z(r,s)},d(t){t&&$(e)}}}function Or(t){let e,n,r,s;var o=t[18].component;o&&(e=P(o,{props:{size:"18"}}));let i=t[18].tooltip&&jr(t);return{c(){e&&nt(e.$$.fragment),n=y(),i&&i.c(),r=x()},m(t,o){e&&rt(e,t,o),m(t,n,o),i&&i.m(t,o),m(t,r,o),s=!0},p(t,s){if(2&s&&o!==(o=t[18].component)){if(e){G();const t=e;Z(t.$$.fragment,1,0,(()=>{st(t,1)})),K()}o?(e=P(o,{props:{size:"18"}}),nt(e.$$.fragment),J(e.$$.fragment,1),rt(e,n.parentNode,n)):e=null}t[18].tooltip?i?i.p(t,s):(i=jr(t),i.c(),i.m(r.parentNode,r)):i&&(i.d(1),i=null)},i(t){s||(e&&J(e.$$.fragment,t),s=!0)},o(t){e&&Z(e.$$.fragment,t),s=!1},d(t){e&&st(e,t),t&&$(n),i&&i.d(t),t&&$(r)}}}function Nr(t){let e,n,r;return e=new Pn({props:{grouped:"true",classes:["sy-tooltip--container",...t[18].classes],$$slots:{default:[Or]},$$scope:{ctx:t}}}),e.$on("click",(function(){o(t[18].action)&&t[18].action.apply(this,arguments)})),{c(){nt(e.$$.fragment),n=y()},m(t,s){rt(e,t,s),m(t,n,s),r=!0},p(n,r){t=n;const s={};2&r&&(s.classes=["sy-tooltip--container",...t[18].classes]),2097154&r&&(s.$$scope={dirty:r,ctx:t}),e.$set(s)},i(t){r||(J(e.$$.fragment,t),r=!0)},o(t){Z(e.$$.fragment,t),r=!1},d(t){st(e,t),t&&$(n)}}}function qr(t){let e,n,r,s;const o=[Rr,Lr],i=[];function a(t,e){return t[18].dropdown?0:1}return e=a(t),n=i[e]=o[e](t),{c(){n.c(),r=x()},m(t,n){i[e].m(t,n),m(t,r,n),s=!0},p(t,s){let l=e;e=a(t),e===l?i[e].p(t,s):(G(),Z(i[l],1,1,(()=>{i[l]=null})),K(),n=i[e],n?n.p(t,s):(n=i[e]=o[e](t),n.c()),J(n,1),n.m(r.parentNode,r))},i(t){s||(J(n),s=!0)},o(t){Z(n),s=!1},d(t){i[e].d(t),t&&$(r)}}}function Fr(t){let e,n,r=t[1],s=[];for(let e=0;eZ(s[t],1,1,(()=>{s[t]=null}));return{c(){for(let t=0;t{r=null})),K())},i(t){n||(J(r),n=!0)},o(t){Z(r),n=!1},d(t){t&&$(e),r&&r.d()}}}function Yr(t,e,n){let r,{word:s}=e,{lists:o=[]}=e,{backgroundColor:i="grey"}=e,a=[];const l=()=>{window.bookmarkManager.inList(s.hash).then((t=>{n(8,a=t),n(1,r[0].component=f(),r),n(1,r[0].tooltip=g(),r)})).catch((t=>{Ke("There was an error fetching list membership. Check the log for more details.",t)}))},c=(t,e,n)=>{window.bookmarkManager[t](e,n).then((()=>{l()})).catch((t=>{Ke("There was an error modifying the list membership. Check the log for more details.",{e:t,word:n,list:e})}))},h=(t,e)=>{c("removeFromList",t,e)},d=(t,e)=>{c("addToList",t,e)},u=window.__TAURI__.invoke,p=D(),f=()=>a.length?Lt:$e,g=()=>`${a.length?"Remove from":"Add to"} ${o.length>1?"List":"Bookmarks"}`;let m;return t.$$set=t=>{"word"in t&&n(0,s=t.word),"lists"in t&&n(6,o=t.lists),"backgroundColor"in t&&n(7,i=t.backgroundColor)},t.$$.update=()=>{1&t.$$.dirty&&s&&l(),321&t.$$.dirty&&n(1,r=[{component:f(),tooltip:g(),action:()=>{if(1===o.length){const t=o[0];a.includes(t)?h(t,s):d(t,s)}},dropdown:1===o.length?void 0:o.map((t=>{let e=a.includes(t);return{text:t,id:t,component:e?qn:An,icon:e?Lt:void 0,hover:e?"red":void 0}})),classes:["sy-button--grouped--first"]},{component:ne,tooltip:"Enlarge Characters",action:()=>{u("open_character_window",{word:{traditional:s.traditional,simplified:s.simplified}}).catch((t=>{Ke("An unknown error occurred while trying to open the enlarged character window. Please check the log for more details.",t)}))}}])},[s,r,t=>p("link",t.detail),()=>{const t=s;clearTimeout(m),m=setTimeout((()=>{const e=document.getElementById("dictionary-content--notes").value.trim();window.bookmarkManager.updateProperty(t.hash,"notes",e).then((()=>{t.notes=e})).catch((t=>{Ke("An unknown error occurred while trying to save the notes. Please check the log for more details.",t)}))}),500)},t=>{const e=t.detail;a.includes(e)?h(e,s):d(e,s)},()=>["dictionary-content-container",`dictionary-content--background-${i}`].join(" "),o,i,a]}class Qr extends it{constructor(t){super(),ot(this,t,Yr,Vr,i,{word:0,lists:6,backgroundColor:7})}}function Xr(e){let n;return{c(){n=v("hr"),C(n,"class","sy-dropdown--divider svelte-n4h875")},m(t,e){m(t,n,e)},p:t,i:t,o:t,d(t){t&&$(n)}}}function Gr(t,e,n){let{text:r}=e,{icon:s}=e;return t.$$set=t=>{"text"in t&&n(0,r=t.text),"icon"in t&&n(1,s=t.icon)},[r,s]}class Kr extends it{constructor(t){super(),ot(this,t,Gr,Xr,i,{text:0,icon:1})}}const Jr=t=>({}),Zr=t=>({}),ts=t=>({}),es=t=>({});function ns(e){let n,r;return n=new Ne({props:{size:"14"}}),{c(){nt(n.$$.fragment)},m(t,e){rt(n,t,e),r=!0},p:t,i(t){r||(J(n.$$.fragment,t),r=!0)},o(t){Z(n.$$.fragment,t),r=!1},d(t){st(n,t)}}}function rs(t){let e,n,r,s,o,i,a,c,p,f,w,k,x,b;a=new Pn({props:{style:"ghost",$$slots:{default:[ns]},$$scope:{ctx:t}}}),a.$on("click",t[4]);const P=t[3].body,T=l(P,t,t[5],es),E=t[3].footer,W=l(E,t,t[5],Zr);return{c(){e=v("div"),n=v("div"),r=v("div"),s=v("h2"),o=_(t[1]),i=y(),nt(a.$$.fragment),c=y(),p=v("div"),T&&T.c(),f=y(),w=v("div"),W&&W.c(),k=y(),x=v("div"),C(s,"class","sy-modal--title svelte-sr1ian"),C(r,"class","sy-modal--header svelte-sr1ian"),C(p,"class","sy-modal--body svelte-sr1ian"),C(w,"class","sy-modal--footer svelte-sr1ian"),C(n,"class","sy-modal--content svelte-sr1ian"),C(x,"class","sy-modal--backdrop svelte-sr1ian"),C(e,"class","sy-modal--container svelte-sr1ian"),S(e,"sy-modal--active",t[0])},m(t,l){m(t,e,l),g(e,n),g(n,r),g(r,s),g(s,o),g(r,i),rt(a,r,null),g(n,c),g(n,p),T&&T.m(p,null),g(n,f),g(n,w),W&&W.m(w,null),g(e,k),g(e,x),b=!0},p(t,[n]){(!b||2&n)&&z(o,t[1]);const r={};32&n&&(r.$$scope={dirty:n,ctx:t}),a.$set(r),T&&T.p&&(!b||32&n)&&d(T,P,t,t[5],b?h(P,t[5],n,ts):u(t[5]),es),W&&W.p&&(!b||32&n)&&d(W,E,t,t[5],b?h(E,t[5],n,Jr):u(t[5]),Zr),(!b||1&n)&&S(e,"sy-modal--active",t[0])},i(t){b||(J(a.$$.fragment,t),J(T,t),J(W,t),b=!0)},o(t){Z(a.$$.fragment,t),Z(T,t),Z(W,t),b=!1},d(t){t&&$(e),st(a),T&&T.d(t),W&&W.d(t)}}}function ss(t,e,n){let{$$slots:r={},$$scope:s}=e,{visible:o=!1}=e,{title:i=""}=e;const a=D();return t.$$set=t=>{"visible"in t&&n(0,o=t.visible),"title"in t&&n(1,i=t.title),"$$scope"in t&&n(5,s=t.$$scope)},[o,i,a,r,t=>{a("close",t)},s]}class os extends it{constructor(t){super(),ot(this,t,ss,rs,i,{visible:0,title:1})}}function is(t,e,n){const r=t.slice();return r[30]=e[n],r}function as(t){let e,n,r,s;return r=new Bt({props:{size:"20"}}),{c(){e=_(t[0]),n=_(" "),nt(r.$$.fragment)},m(t,o){m(t,e,o),m(t,n,o),rt(r,t,o),s=!0},p(t,n){(!s||1&n[0])&&z(e,t[0])},i(t){s||(J(r.$$.fragment,t),s=!0)},o(t){Z(r.$$.fragment,t),s=!1},d(t){t&&$(e),t&&$(n),st(r,t)}}}function ls(t){let e,n;return e=new Pn({props:{size:"large",style:"ghost",center:!0,$$slots:{default:[as]},$$scope:{ctx:t}}}),{c(){nt(e.$$.fragment)},m(t,r){rt(e,t,r),n=!0},p(t,n){const r={};1&n[0]|4&n[1]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(J(e.$$.fragment,t),n=!0)},o(t){Z(e.$$.fragment,t),n=!1},d(t){st(e,t)}}}function cs(t){let e,n,r,s;return n=new Pn({props:{style:"ghost",disabled:t[30].disabled,hover:t[30].hover,classes:["sy-tooltip--container"],$$slots:{default:[hs]},$$scope:{ctx:t}}}),n.$on("click",t[30].action),{c(){e=v("span"),nt(n.$$.fragment),r=y(),C(e,"class","bookmarks--header--action-item svelte-12dvz92")},m(t,o){m(t,e,o),rt(n,e,null),g(e,r),s=!0},p(t,e){const r={};4&e[1]&&(r.$$scope={dirty:e,ctx:t}),n.$set(r)},i(t){s||(J(n.$$.fragment,t),s=!0)},o(t){Z(n.$$.fragment,t),s=!1},d(t){t&&$(e),st(n)}}}function hs(t){let e,n,r,s,o,i,a=t[30].tooltip+"";var l=t[30].icon;return l&&(e=P(l,{props:{size:"20"}})),{c(){e&&nt(e.$$.fragment),n=y(),r=v("div"),s=v("p"),o=_(a),C(r,"class","sy-tooltip--body sy-tooltip--body-bottom")},m(t,a){e&&rt(e,t,a),m(t,n,a),m(t,r,a),g(r,s),g(s,o),i=!0},p(t,r){if(l!==(l=t[30].icon)){if(e){G();const t=e;Z(t.$$.fragment,1,0,(()=>{st(t,1)})),K()}l?(e=P(l,{props:{size:"20"}}),nt(e.$$.fragment),J(e.$$.fragment,1),rt(e,n.parentNode,n)):e=null}},i(t){i||(e&&J(e.$$.fragment,t),i=!0)},o(t){e&&Z(e.$$.fragment,t),i=!1},d(t){e&&st(e,t),t&&$(n),t&&$(r)}}}function ds(t){let e,n,r=!t[30].exclude.includes(t[0]),s=r&&cs(t);return{c(){s&&s.c(),e=x()},m(t,r){s&&s.m(t,r),m(t,e,r),n=!0},p(t,n){1&n[0]&&(r=!t[30].exclude.includes(t[0])),r?s?(s.p(t,n),1&n[0]&&J(s,1)):(s=cs(t),s.c(),J(s,1),s.m(e.parentNode,e)):s&&(G(),Z(s,1,1,(()=>{s=null})),K())},i(t){n||(J(s),n=!0)},o(t){Z(s),n=!1},d(t){s&&s.d(t),t&&$(e)}}}function us(e){let n,r,s,o,i;return o=new Gn({props:{size:"large",placeholder:`ex. ${e[10]()}`,id:"create-new-list-input"}}),{c(){n=v("div"),r=v("p"),r.textContent="What would you like to call this list?",s=y(),nt(o.$$.fragment),C(n,"class","bookmarks-modal-content svelte-12dvz92"),C(n,"slot","body")},m(t,e){m(t,n,e),g(n,r),g(n,s),rt(o,n,null),i=!0},p:t,i(t){i||(J(o.$$.fragment,t),i=!0)},o(t){Z(o.$$.fragment,t),i=!1},d(t){t&&$(n),st(o)}}}function ps(t){let e;return{c(){e=_("Cancel")},m(t,n){m(t,e,n)},d(t){t&&$(e)}}}function fs(t){let e;return{c(){e=_("Create")},m(t,n){m(t,e,n)},d(t){t&&$(e)}}}function gs(t){let e,n,r,s;return e=new Pn({props:{size:"large",$$slots:{default:[ps]},$$scope:{ctx:t}}}),e.$on("click",t[11]),r=new Pn({props:{size:"large",color:"green",disabled:t[6],$$slots:{default:[fs]},$$scope:{ctx:t}}}),r.$on("click",t[12]),{c(){nt(e.$$.fragment),n=_("\n\t\t\t \n\t\t\t"),nt(r.$$.fragment)},m(t,o){rt(e,t,o),m(t,n,o),rt(r,t,o),s=!0},p(t,n){const s={};4&n[1]&&(s.$$scope={dirty:n,ctx:t}),e.$set(s);const o={};64&n[0]&&(o.disabled=t[6]),4&n[1]&&(o.$$scope={dirty:n,ctx:t}),r.$set(o)},i(t){s||(J(e.$$.fragment,t),J(r.$$.fragment,t),s=!0)},o(t){Z(e.$$.fragment,t),Z(r.$$.fragment,t),s=!1},d(t){st(e,t),t&&$(n),st(r,t)}}}function ms(t){let e,n,r,s,o,i,a,l,c,h,d,u,p,f,k;r=new jn({props:{values:t[3],$$slots:{default:[ls]},$$scope:{ctx:t}}}),r.$on("selection",t[9]);let _=t[14],x=[];for(let e=0;e<_.length;e+=1)x[e]=ds(is(t,_,e));const b=t=>Z(x[t],1,1,(()=>{x[t]=null}));return c=new lr({props:{style:"preview",values:t[4],highlight:t[7],filterable:!0}}),c.$on("selection",t[13]),u=new Qr({props:{word:t[1],lists:t[2]}}),f=new os({props:{title:"Create List",visible:t[5],$$slots:{footer:[gs],body:[us]},$$scope:{ctx:t}}}),f.$on("close",t[11]),{c(){e=v("div"),n=v("div"),nt(r.$$.fragment),s=y(),o=v("div");for(let t=0;t{window.bookmarkManager.getLists().then((e=>{n(2,a=e),n(3,l=[...e.map((t=>({text:t,id:t,component:An}))).sort(((t,e)=>t.text.localeCompare(e.text))),{component:Kr},{text:"Create New",id:"create-new",component:qn,icon:$e,color:"blue",hover:"green"}]),t()})).catch((t=>{Ke("There was an error fetching word lists. Check the logs for more details.",t)}))};c((()=>{}));let h=[],d=[];const u=t=>{window.bookmarkManager.getListContent(i).then((e=>{var r;h=e,n(4,(r=e,n(7,v=!1),d=r.map((t=>({headline:t.traditional===t.simplified?t.simplified:`${t.simplified} (${t.traditional})`,subtitle:t.pinyin_marks,content:t.english.join("; "),active:!1}))))),t()})).catch((t=>{Ke("There was an error fetching the word list content. Check the logs for more details.",t)}))};u((()=>{}));const p=t=>{n(0,i=t),u((()=>{}))},f=["HSK 1","Week 3 Vocab","Internet Slang","Idioms","Chapter 7"],g=["create-new","Bookmarks"];let m=!1,$=!1;const w=()=>{n(5,m=!1),document.getElementById("create-new-list-input").value="",n(6,$=!1)};let v=!0,k=!1;return[i,o,a,l,d,m,$,v,s,t=>{"create-new"!==t.detail?p(t.detail):n(5,m=!0)},()=>f.slice(Math.random()*f.length)[0],w,()=>{n(6,$=!0);const t=document.getElementById("create-new-list-input").value.trim();if(!t||g.includes(t))return Ke(`Cannot create new list with name ${t}.`),void w();window.bookmarkManager.createList(t).then((()=>{c((()=>{w()}))})).catch((e=>{Ke(`There was an unexpected error while attempting to create the list ${t}. Check the log for more details.`,e),w()}))},t=>{n(1,o=h[t.detail.index]),n(7,v=!0)},[{icon:Gt,action:()=>{r("import_list_data").then((t=>{if(t){const e=((t,e)=>{let n=t,r=2;for(;e.includes(n)&&r<=100;)n=`${t} ${r}`,r++;return n})(t.meta.name,a);window.bookmarkManager.createList(e).then((()=>{const n=t.entries.reduceRight(((t,e)=>t.find((t=>t.hash===e.hash))?t:[...t,e]),[]).map((t=>window.bookmarkManager.addToList(e,t)));return Promise.all(n)})).then((()=>{c((()=>{}))})).catch((t=>{Ke("There was an error importing the list. Check the log for more details.",t)}))}})).catch((t=>{Ke("There was an error importing the list. Check the log for more details.",t)}))},tooltip:"Import",exclude:[],disabled:!1},{icon:Be,action:()=>{r("export_list_data",{name:i,data:h}).then((()=>{})).catch((t=>{Ke("There was an error exporting your list. Check the log for more details.",t)}))},tooltip:"Export",exclude:[],disabled:!1},{icon:Me,action:()=>{k=!0,window.__TAURI__.dialog.ask(`Are you sure you want to delete ${i}?`,"Delete List").then((t=>{t?window.bookmarkManager.deleteList(i).then((()=>{p("Bookmarks"),c((()=>{k=!1}))})).catch((t=>{Ke(`There was an unexpected error deleting the list ${i}. Please check the log for more details.`,t),k=!1})):k=!1})).catch((t=>{Ke(`There was an unexpected error while attempting to delete the list ${i}. Check the log for more details.`,t),k=!1}))},tooltip:"Delete",exclude:["Bookmarks"],disabled:k,hover:"red"}]]}class ws extends it{constructor(t){super(),ot(this,t,$s,ms,i,{},null,[-1,-1])}}function vs(e){let n,r;return{c(){n=v("center"),r=v("h1"),r.textContent=`${ks}`},m(t,e){m(t,n,e),g(n,r)},p:t,i:t,o:t,d(t){t&&$(n)}}}let ks="CHAT";class _s extends it{constructor(t){super(),ot(this,t,null,vs,i,{})}}function ys(e){let n,r;return{c(){n=v("center"),r=v("h1"),r.textContent=`${xs}`},m(t,e){m(t,n,e),g(n,r)},p:t,i:t,o:t,d(t){t&&$(n)}}}let xs="HELP";class bs extends it{constructor(t){super(),ot(this,t,null,ys,i,{})}}function Cs(e){let n,r;return{c(){n=v("center"),r=v("h1"),r.textContent=`${zs}`},m(t,e){m(t,n,e),g(n,r)},p:t,i:t,o:t,d(t){t&&$(n)}}}let zs="NOT FOUND";class Ss extends it{constructor(t){super(),ot(this,t,null,Cs,i,{})}}function Ps(e){let n,r;return{c(){n=v("center"),r=v("h1"),r.textContent=`${Ts}`},m(t,e){m(t,n,e),g(n,r)},p:t,i:t,o:t,d(t){t&&$(n)}}}let Ts="READER";class Es extends it{constructor(t){super(),ot(this,t,null,Ps,i,{})}}function Ws(e){let n,r;return n=new Nt({props:{size:"20"}}),{c(){nt(n.$$.fragment)},m(t,e){rt(n,t,e),r=!0},p:t,i(t){r||(J(n.$$.fragment,t),r=!0)},o(t){Z(n.$$.fragment,t),r=!1},d(t){st(n,t)}}}function Ms(e){let n,r;return n=new Ht({props:{size:"20"}}),{c(){nt(n.$$.fragment)},m(t,e){rt(n,t,e),r=!0},p:t,i(t){r||(J(n.$$.fragment,t),r=!0)},o(t){Z(n.$$.fragment,t),r=!1},d(t){st(n,t)}}}function Ds(t){let e;return{c(){e=_(t[4])},m(t,n){m(t,e,n)},p(t,n){16&n&&z(e,t[4])},d(t){t&&$(e)}}}function As(t){let e,n,r,s,o,i,a,l,c,h,d,u,p,f,w,k,_,x;return r=new Pn({props:{style:"ghost",size:"large",disabled:null==t[7][t[0]-1],$$slots:{default:[Ws]},$$scope:{ctx:t}}}),r.$on("click",t[9]),o=new Pn({props:{style:"ghost",size:"large",disabled:null==t[7][t[0]+1],$$slots:{default:[Ms]},$$scope:{ctx:t}}}),o.$on("click",t[10]),a=new Pn({props:{style:"ghost",size:"large",$$slots:{default:[Ds]},$$scope:{ctx:t}}}),a.$on("click",t[15]),c=new Gn({props:{spellcheck:"false",style:"ghost",size:"large",placeholder:"Search...",id:"search",transparency:Rs}}),c.$on("change",t[16]),c.$on("keyup",t[17]),c.$on("enter",t[13]),f=new lr({props:{style:"preview",values:t[1],highlight:t[5]}}),f.$on("selection",t[12]),_=new Qr({props:{word:t[3],lists:t[2]}}),_.$on("link",t[14]),{c(){e=v("div"),n=v("div"),nt(r.$$.fragment),s=y(),nt(o.$$.fragment),i=y(),nt(a.$$.fragment),l=y(),nt(c.$$.fragment),d=y(),u=v("div"),p=v("div"),nt(f.$$.fragment),w=y(),k=v("div"),nt(_.$$.fragment),C(n,"class","search-bar-container svelte-sv63r7"),C(n,"data-testid","search-bar-container"),C(n,"data-tauri-drag-region",h=!!t[6]||void 0),S(n,"search-bar-container--transparency",Rs),C(p,"class","search-results svelte-sv63r7"),C(p,"data-elastic",""),C(k,"class","dictionary-content svelte-sv63r7"),C(u,"class","search-content-container svelte-sv63r7"),C(e,"class","search-page-container svelte-sv63r7")},m(t,h){m(t,e,h),g(e,n),rt(r,n,null),g(n,s),rt(o,n,null),g(n,i),rt(a,n,null),g(n,l),rt(c,n,null),g(e,d),g(e,u),g(u,p),rt(f,p,null),g(u,w),g(u,k),rt(_,k,null),x=!0},p(t,[e]){const s={};1&e&&(s.disabled=null==t[7][t[0]-1]),33554432&e&&(s.$$scope={dirty:e,ctx:t}),r.$set(s);const i={};1&e&&(i.disabled=null==t[7][t[0]+1]),33554432&e&&(i.$$scope={dirty:e,ctx:t}),o.$set(i);const l={};33554448&e&&(l.$$scope={dirty:e,ctx:t}),a.$set(l),(!x||64&e&&h!==(h=!!t[6]||void 0))&&C(n,"data-tauri-drag-region",h);const c={};2&e&&(c.values=t[1]),32&e&&(c.highlight=t[5]),f.$set(c);const d={};8&e&&(d.word=t[3]),4&e&&(d.lists=t[2]),_.$set(d)},i(t){x||(J(r.$$.fragment,t),J(o.$$.fragment,t),J(a.$$.fragment,t),J(c.$$.fragment,t),J(f.$$.fragment,t),J(_.$$.fragment,t),x=!0)},o(t){Z(r.$$.fragment,t),Z(o.$$.fragment,t),Z(a.$$.fragment,t),Z(c.$$.fragment,t),Z(f.$$.fragment,t),Z(_.$$.fragment,t),x=!1},d(t){t&&$(e),st(r),st(o),st(a),st(c),st(f),st(_)}}}let Ls,Rs=!1;function Is(t,e,n){let r,s=-1,o=[],i=[],a=[],l=[],c="EN",h=!0,d=!1;window.__TAURI__.os.platform().then((t=>{n(6,d="darwin"===t)}));const u=window.__TAURI__.invoke,p=["EN","PY","ZH"],f=(t,e)=>{(t.length||e)&&(n(5,h=!1),a=t,n(1,i=t.map((t=>({headline:t.traditional===t.simplified?t.simplified:`${t.simplified} (${t.traditional})`,subtitle:t.pinyin_marks,content:t.english.join("; "),active:!1})))))},g=(t,e,r)=>{t?(u("classify",{text:t}).then((t=>{n(4,c=t)})).catch((t=>{Ke("There was an error classifying the language of your query.",t)})),u("query",{text:t}).then((t=>{f(t,e),null!=r&&q().then((()=>{w(r)}))})).catch((t=>{Ke("There was an error searching the dictionary for your query.",t)}))):f([],!0)},m=(t,e)=>{n(3,r=t),n(5,h=e)},$=()=>{const t=p.indexOf(c)+1;n(4,c=p[t{try{switch(e){case"EN":u("query_by_english",{text:t}).then((t=>f(t,!0)));break;case"PY":u("query_by_pinyin",{text:t}).then((t=>f(t,!0)));break;case"ZH":u("query_by_chinese",{text:t}).then((t=>f(t,!0)))}}catch(t){Ke("There was an error searching the dictionary for your query.",t)}})(document.getElementById("search").value,c)},w=t=>{try{document.getElementsByClassName("sy-list-preview-item-container")[t].click()}catch(t){}};window.bookmarkManager.getLists().then((t=>{n(2,l=t)})).catch((t=>{Ke("There was an error fetching word lists. Check the log for more details.",t)}));return[s,i,l,r,c,h,d,o,g,t=>{n(0,s-=1),m(o[s],!1)},t=>{n(0,s+=1),m(o[s],!1)},$,t=>{const e=a[t.detail.index];m(e,!0);let r=o.map((t=>t.word_id)).indexOf(e.word_id);r>=0&&(o.splice(r,1),n(0,s-=1)),o.push(e),n(0,s+=1)},t=>{w(0)},t=>{const e=t.detail;document.getElementById("search").value=e,g(e,!0,0)},()=>$(),t=>g(t.detail,!0),t=>g(t.detail,!1)]}class Bs extends it{constructor(t){super(),ot(this,t,Is,As,i,{})}}function js(t,e,n){const r=t.slice();return r[7]=e[n],r}function Os(t){let e,n,r,s,o,i,a,l,c=t[7].label+"";function h(){return t[2](t[7])}return{c(){e=v("div"),n=v("label"),r=_(c),s=y(),o=v("input"),i=y(),C(n,"for",`tone-${t[7].index+1}`),C(o,"type","color"),o.value=t[7].color,C(o,"id",`tone-${t[7].index+1}`),C(o,"name",`tone-${t[7].index+1}`),C(e,"class","tone-color-picker--tone svelte-1wk3p9z")},m(t,c){m(t,e,c),g(e,n),g(n,r),g(e,s),g(e,o),g(e,i),a||(l=b(o,"change",h),a=!0)},p(e,n){t=e},d(t){t&&$(e),a=!1,l()}}}function Ns(e){let n,r=e[0],s=[];for(let t=0;t{return(e=t,"--"==e.substring(0,2)?n.getPropertyValue(e):e).trim();var e})),s=[{label:"First Tone",color:r[0],index:0},{label:"Second Tone",color:r[1],index:1},{label:"Third Tone",color:r[2],index:2},{label:"Fourth Tone",color:r[3],index:3},{label:"No Tone",color:r[4],index:4}],o=t=>{r[t]=document.getElementById(`tone-${t+1}`).value,e("change",{hasCustomColors:!0,colors:r})};return[s,o,t=>o(t.index)]}class Fs extends it{constructor(t){super(),ot(this,t,qs,Ns,i,{})}}function Hs(e){let n,r,s,o,i,a;return{c(){n=v("div"),r=v("span"),r.textContent="You are up to date",s=y(),o=v("span"),i=_("Version "),a=_(e[0]),C(r,"class","updater-checker--status--title svelte-19yodez"),C(o,"class","update-checker--status--subtitle svelte-19yodez"),C(n,"class","update-checker--up-to-date update-checker--status svelte-19yodez")},m(t,e){m(t,n,e),g(n,r),g(n,s),g(n,o),g(o,i),g(o,a)},p(t,e){1&e&&z(a,t[0])},i:t,o:t,d(t){t&&$(n)}}}function Us(t){let e,n,r,s,o,i,a,l,c,h,d,u,p;return u=new Pn({props:{color:"green",size:"large",disabled:t[6],$$slots:{default:[Xs]},$$scope:{ctx:t}}}),u.$on("click",t[10]),{c(){e=v("div"),n=v("span"),n.textContent="Update available",r=y(),s=v("span"),o=_("Version "),i=_(t[1]),a=v("br"),l=_("\n\t\t\t\tRelease Notes: "),c=_(t[2]),h=y(),d=v("span"),nt(u.$$.fragment),C(n,"class","updater-checker--status--title svelte-19yodez"),C(s,"class","update-checker--status--subtitle svelte-19yodez"),C(d,"class","update-checker--update-button svelte-19yodez"),C(e,"class","update-checker--status update-checker--update-available svelte-19yodez")},m(t,f){m(t,e,f),g(e,n),g(e,r),g(e,s),g(s,o),g(s,i),g(s,a),g(s,l),g(s,c),g(e,h),g(e,d),rt(u,d,null),p=!0},p(t,e){(!p||2&e)&&z(i,t[1]),(!p||4&e)&&z(c,t[2]);const n={};64&e&&(n.disabled=t[6]),4160&e&&(n.$$scope={dirty:e,ctx:t}),u.$set(n)},i(t){p||(J(u.$$.fragment,t),p=!0)},o(t){Z(u.$$.fragment,t),p=!1},d(t){t&&$(e),st(u)}}}function Vs(t){let e,n,r,s;const o=[Ks,Gs],i=[];function a(t,e){return t[5]?0:1}return e=a(t),n=i[e]=o[e](t),{c(){n.c(),r=x()},m(t,n){i[e].m(t,n),m(t,r,n),s=!0},p(t,s){let l=e;e=a(t),e===l?i[e].p(t,s):(G(),Z(i[l],1,1,(()=>{i[l]=null})),K(),n=i[e],n?n.p(t,s):(n=i[e]=o[e](t),n.c()),J(n,1),n.m(r.parentNode,r))},i(t){s||(J(n),s=!0)},o(t){Z(n),s=!1},d(t){i[e].d(t),t&&$(r)}}}function Ys(t){let e;return{c(){e=_("Updating...")},m(t,n){m(t,e,n)},d(t){t&&$(e)}}}function Qs(t){let e;return{c(){e=_("Update")},m(t,n){m(t,e,n)},d(t){t&&$(e)}}}function Xs(t){let e;function n(t,e){return t[6]?Ys:Qs}let r=n(t),s=r(t);return{c(){s.c(),e=x()},m(t,n){s.m(t,n),m(t,e,n)},p(t,o){r!==(r=n(t))&&(s.d(1),s=r(t),s&&(s.c(),s.m(e.parentNode,e)))},d(t){s.d(t),t&&$(e)}}}function Gs(t){let e,n;return e=new Pn({props:{size:"large",$$slots:{default:[Js]},$$scope:{ctx:t}}}),e.$on("click",t[9]),{c(){nt(e.$$.fragment)},m(t,r){rt(e,t,r),n=!0},p(t,n){const r={};4096&n&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(J(e.$$.fragment,t),n=!0)},o(t){Z(e.$$.fragment,t),n=!1},d(t){st(e,t)}}}function Ks(t){let e,n;return e=new Pn({props:{disabled:!0,size:"large",$$slots:{default:[Zs]},$$scope:{ctx:t}}}),{c(){nt(e.$$.fragment)},m(t,r){rt(e,t,r),n=!0},p(t,n){const r={};4096&n&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(J(e.$$.fragment,t),n=!0)},o(t){Z(e.$$.fragment,t),n=!1},d(t){st(e,t)}}}function Js(t){let e;return{c(){e=_("Check for updates")},m(t,n){m(t,e,n)},d(t){t&&$(e)}}}function Zs(t){let e;return{c(){e=_("Checking for updates...")},m(t,n){m(t,e,n)},d(t){t&&$(e)}}}function to(t){let e,n,r,s;const o=[Vs,Us,Hs],i=[];function a(t,e){return t[3]?t[4]?1:2:0}return n=a(t),r=i[n]=o[n](t),{c(){e=v("div"),r.c(),C(e,"class","update-checker svelte-19yodez")},m(t,r){m(t,e,r),i[n].m(e,null),s=!0},p(t,[s]){let l=n;n=a(t),n===l?i[n].p(t,s):(G(),Z(i[l],1,1,(()=>{i[l]=null})),K(),r=i[n],r?r.p(t,s):(r=i[n]=o[n](t),r.c()),J(r,1),r.m(e,null))},i(t){s||(J(r),s=!0)},o(t){Z(r),s=!1},d(t){t&&$(e),i[n].d()}}}function eo(t,e,n){let r=window.version||"",s=window.updateVersion||"",o=window.updateReleaseNotes||"",i=window.updateStatusAvailable||!1,a=window.updateAvailable||!1,l=!1,c=!1;window.version||window.__TAURI__.app.getVersion().then((t=>{n(0,r=t),window.version=t}));const h=()=>{n(5,l=!1),n(6,c=!1),n(4,a=!1),n(3,i=!1),n(1,s=""),n(2,o=""),window.updateAvailable=!1,window.updateStatusAvailable=!1,window.updateVersion="",window.updateReleaseNotes=""},d=()=>{n(5,l=!0),n(6,c=!1),window.__TAURI__.updater.checkUpdate().then((t=>{t.shouldUpdate?(n(1,s=t.manifest.version),n(2,o=t.manifest.body),n(3,i=!0),n(4,a=!0),n(5,l=!1),window.updateVersion=t.manifest.version,window.updateReleaseNotes=t.manifest.body,window.updateStatusAvailable=!0,window.updateAvailable=!0):(n(3,i=!0),n(5,l=!1),n(4,a=!1),window.updateAvailable=!1,window.updateStatusAvailable=!0)})).catch((t=>{h(),Ke("There was an error checking for updates. Please try again later. Check the log for more details.",t)}))},u=()=>{n(6,c=!0),window.__TAURI__.updater.installUpdate().then((()=>{window.__TAURI__.process.relaunch()})).catch((t=>{h(),Ke("There was an error fetching the update. Please try again later. Check the log for more details.",t)}))};return[r,s,o,i,a,l,c,d,u,()=>d(),()=>u()]}class no extends it{constructor(t){super(),ot(this,t,eo,to,i,{})}}const ro=new Uint8Array(16);function so(){if(!Ls&&(Ls="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Ls))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ls(ro)}const oo=[];for(let t=0;t<256;++t)oo.push((t+256).toString(16).slice(1));var io={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function ao(t,e,n){if(io.randomUUID&&!e&&!t)return io.randomUUID();const r=(t=t||{}).random||(t.rng||so)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,e){n=n||0;for(let t=0;t<16;++t)e[n+t]=r[t];return e}return function(t,e=0){return oo[t[e+0]]+oo[t[e+1]]+oo[t[e+2]]+oo[t[e+3]]+"-"+oo[t[e+4]]+oo[t[e+5]]+"-"+oo[t[e+6]]+oo[t[e+7]]+"-"+oo[t[e+8]]+oo[t[e+9]]+"-"+oo[t[e+10]]+oo[t[e+11]]+oo[t[e+12]]+oo[t[e+13]]+oo[t[e+14]]+oo[t[e+15]]}(r)}function lo(e){let n,r,s,o,i,a,l;return{c(){n=v("span"),r=v("input"),s=y(),o=v("label"),i=_("Toggle"),C(r,"type","checkbox"),C(r,"id",e[1]),C(r,"class","sy-toggle svelte-ssxm77"),r.value=e[2],r.checked=e[0],C(o,"for",e[1]),C(o,"class","sy-toggle--label svelte-ssxm77"),C(n,"class","sy-toggle--container svelte-ssxm77")},m(t,c){m(t,n,c),g(n,r),g(n,s),g(n,o),g(o,i),a||(l=b(r,"change",e[4]),a=!0)},p(t,[e]){2&e&&C(r,"id",t[1]),4&e&&(r.value=t[2]),1&e&&(r.checked=t[0]),2&e&&C(o,"for",t[1])},i:t,o:t,d(t){t&&$(n),a=!1,l()}}}function co(t,e,n){let{checked:r=!1}=e,{id:s=ao()}=e,{value:o}=e;const i=D();return t.$$set=t=>{"checked"in t&&n(0,r=t.checked),"id"in t&&n(1,s=t.id),"value"in t&&n(2,o=t.value)},[r,s,o,i,t=>i("change",t.srcElement.checked)]}class ho extends it{constructor(t){super(),ot(this,t,co,lo,i,{checked:0,id:1,value:2})}}function uo(t,e,n){const r=t.slice();return r[2]=e[n],r}function po(t){let n,r,s,o,i,a,l,c=t[2].label+"";const h=[t[2].props];var d=t[2].component;function u(t){let n={};for(let t=0;t{st(t,1)})),K()}d?(i=P(d,u()),i.$on("change",t[2].handler),nt(i.$$.fragment),J(i.$$.fragment,1),rt(i,n,a)):i=null}else d&&i.$set(r)},i(t){l||(i&&J(i.$$.fragment,t),l=!0)},o(t){i&&Z(i.$$.fragment,t),l=!1},d(t){t&&$(n),i&&st(i)}}}function fo(t){let e,n,r,s,o,i,a,l=t[1],c=[];for(let e=0;eZ(c[t],1,1,(()=>{c[t]=null}));return{c(){e=v("div"),n=v("div"),r=v("h1"),s=_("Settings"),o=y(),i=v("div");for(let t=0;twindow.preferenceManager.set("beta",t.detail),component:ho,props:{checked:window.preferenceManager.get("beta")}},{label:"Updates",centerLabel:!1,component:no,props:{},handler:()=>{}},{label:"Tone Colors",centerLabel:!1,handler:t=>window.preferenceManager.set("toneColors",t.detail),component:Fs,props:{}}]]}class mo extends it{constructor(t){super(),ot(this,t,go,fo,i,{})}}function $o(t,e,n){const r=t.slice();return r[4]=e[n],r}function wo(t){let e,n,r,s,o,i,a,l=t[4].tooltip+"";var c=t[4].icon;return c&&(e=P(c,{props:{size:"18"}})),{c(){e&&nt(e.$$.fragment),n=y(),r=v("div"),s=v("p"),o=_(l),i=y(),C(r,"class","sy-tooltip--body sy-tooltip--body-bottom")},m(t,l){e&&rt(e,t,l),m(t,n,l),m(t,r,l),g(r,s),g(s,o),m(t,i,l),a=!0},p(t,r){if(c!==(c=t[4].icon)){if(e){G();const t=e;Z(t.$$.fragment,1,0,(()=>{st(t,1)})),K()}c?(e=P(c,{props:{size:"18"}}),nt(e.$$.fragment),J(e.$$.fragment,1),rt(e,n.parentNode,n)):e=null}},i(t){a||(e&&J(e.$$.fragment,t),a=!0)},o(t){e&&Z(e.$$.fragment,t),a=!1},d(t){e&&st(e,t),t&&$(n),t&&$(r),t&&$(i)}}}function vo(t){let e,n;return e=new Pn({props:{center:!0,size:"large",classes:["sy-tooltip--container"],$$slots:{default:[wo]},$$scope:{ctx:t}}}),e.$on("click",t[4].action),{c(){nt(e.$$.fragment)},m(t,r){rt(e,t,r),n=!0},p(t,n){const r={};128&n&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(J(e.$$.fragment,t),n=!0)},o(t){Z(e.$$.fragment,t),n=!1},d(t){st(e,t)}}}function ko(t){let e,n,r,s,o,i,a=t[1],l=[];for(let e=0;eZ(l[t],1,1,(()=>{l[t]=null}));return{c(){e=v("div"),n=v("span"),r=_(t[0]),s=y(),o=v("span");for(let t=0;t{r&&s("selection",r)},tooltip:`Flashcards for ${r}`}];return t.$$set=t=>{"value"in t&&n(0,r=t.value)},[r,o]}class yo extends it{constructor(t){super(),ot(this,t,_o,ko,i,{value:0})}}function xo(e){let n;return{c(){n=v("div"),n.innerHTML="To take a quiz or study flashcards, add vocab words to your\n\t\t\t\t\tlists.",C(n,"class","study--empty svelte-1hd52ir")},m(t,e){m(t,n,e)},p:t,i:t,o:t,d(t){t&&$(n)}}}function bo(t){let e,n;return e=new lr({props:{values:t[0],component:yo}}),e.$on("selection",t[2]),{c(){nt(e.$$.fragment)},m(t,r){rt(e,t,r),n=!0},p(t,n){const r={};1&n&&(r.values=t[0]),e.$set(r)},i(t){n||(J(e.$$.fragment,t),n=!0)},o(t){Z(e.$$.fragment,t),n=!1},d(t){st(e,t)}}}function Co(t){let e,n,r,s,o,i,a,l,c;const h=[bo,xo],d=[];function u(t,e){return t[0].length?0:1}return a=u(t),l=d[a]=h[a](t),{c(){e=v("div"),n=v("div"),r=v("h1"),s=_("Study"),o=y(),i=v("div"),l.c(),C(r,"data-tauri-drag-region",!!t[1]||void 0),C(n,"class","study--title svelte-1hd52ir"),C(n,"data-tauri-drag-region",!!t[1]||void 0),C(i,"class","study--content"),C(e,"class","study--container svelte-1hd52ir")},m(t,l){m(t,e,l),g(e,n),g(n,r),g(r,s),g(e,o),g(e,i),d[a].m(i,null),c=!0},p(t,[e]){let n=a;a=u(t),a===n?d[a].p(t,e):(G(),Z(d[n],1,1,(()=>{d[n]=null})),K(),l=d[a],l?l.p(t,e):(l=d[a]=h[a](t),l.c()),J(l,1),l.m(i,null))},i(t){c||(J(l),c=!0)},o(t){Z(l),c=!1},d(t){t&&$(e),d[a].d()}}}function zo(t,e,n){const r="darwin"===window.platform;let s=[],o=[],i=[];window.bookmarkManager.getLists().then((t=>{n(3,s=t.sort(((t,e)=>t.localeCompare(e))))})).catch((t=>{Ke("There was an error fetching word lists. Check the logs for more details.",t)})),window.bookmarkManager.getEmptyLists().then((t=>{n(4,o=t)})).catch((t=>{Ke("There was an error fetching the empty lists. Check the log for more details.",t)}));return t.$$.update=()=>{24&t.$$.dirty&&n(0,i=s.filter((t=>!o.includes(t))))},[i,r,t=>{const e=`#/study/flashcards?list=${t.detail}`;document.location.href=e},s,o]}class So extends it{constructor(t){super(),ot(this,t,zo,Co,i,{})}}function Po(e){let n,r;return{c(){n=v("center"),r=v("h1"),r.textContent=`${To}`},m(t,e){m(t,n,e),g(n,r)},p:t,i:t,o:t,d(t){t&&$(n)}}}let To="TOOLS";class Eo extends it{constructor(t){super(),ot(this,t,null,Po,i,{})}}function Wo(t,e,n){const r=t.slice();return r[12]=e[n],r}function Mo(t,e,n){const r=t.slice();return r[12]=e[n],r}function Do(t){let e,n,r,s,o,i=t[12].label+"";var a=t[12].icon;return a&&(e=P(a,{})),{c(){e&&nt(e.$$.fragment),n=_("\n  \n "),r=_(i),s=y()},m(t,i){e&&rt(e,t,i),m(t,n,i),m(t,r,i),m(t,s,i),o=!0},p(t,s){if(32&s&&a!==(a=t[12].icon)){if(e){G();const t=e;Z(t.$$.fragment,1,0,(()=>{st(t,1)})),K()}a?(e=P(a,{}),nt(e.$$.fragment),J(e.$$.fragment,1),rt(e,n.parentNode,n)):e=null}(!o||32&s)&&i!==(i=t[12].label+"")&&z(r,i)},i(t){o||(e&&J(e.$$.fragment,t),o=!0)},o(t){e&&Z(e.$$.fragment,t),o=!1},d(t){e&&st(e,t),t&&$(n),t&&$(r),t&&$(s)}}}function Ao(t){let e,n;return e=new Pn({props:{disabled:t[12].disabled,style:"ghost",center:!0,$$slots:{default:[Do]},$$scope:{ctx:t}}}),e.$on("click",(function(){o(t[12].action)&&t[12].action.apply(this,arguments)})),{c(){nt(e.$$.fragment)},m(t,r){rt(e,t,r),n=!0},p(n,r){t=n;const s={};32&r&&(s.disabled=t[12].disabled),131104&r&&(s.$$scope={dirty:r,ctx:t}),e.$set(s)},i(t){n||(J(e.$$.fragment,t),n=!0)},o(t){Z(e.$$.fragment,t),n=!1},d(t){st(e,t)}}}function Lo(t){let e,n,r,s,o,i=t[12].label+"";var a=t[12].icon;return a&&(r=P(a,{})),{c(){e=_(i),n=_("\n  \n "),r&&nt(r.$$.fragment),s=y()},m(t,i){m(t,e,i),m(t,n,i),r&&rt(r,t,i),m(t,s,i),o=!0},p(t,n){if((!o||64&n)&&i!==(i=t[12].label+"")&&z(e,i),64&n&&a!==(a=t[12].icon)){if(r){G();const t=r;Z(t.$$.fragment,1,0,(()=>{st(t,1)})),K()}a?(r=P(a,{}),nt(r.$$.fragment),J(r.$$.fragment,1),rt(r,s.parentNode,s)):r=null}},i(t){o||(r&&J(r.$$.fragment,t),o=!0)},o(t){r&&Z(r.$$.fragment,t),o=!1},d(t){t&&$(e),t&&$(n),r&&st(r,t),t&&$(s)}}}function Ro(t){let e,n;return e=new Pn({props:{disabled:t[12].disabled,style:"ghost",center:!0,$$slots:{default:[Lo]},$$scope:{ctx:t}}}),e.$on("click",(function(){o(t[12].action)&&t[12].action.apply(this,arguments)})),{c(){nt(e.$$.fragment)},m(t,r){rt(e,t,r),n=!0},p(n,r){t=n;const s={};64&r&&(s.disabled=t[12].disabled),131136&r&&(s.$$scope={dirty:r,ctx:t}),e.$set(s)},i(t){n||(J(e.$$.fragment,t),n=!0)},o(t){Z(e.$$.fragment,t),n=!1},d(t){st(e,t)}}}function Io(e){let n;function r(t,e){return t[2].length>0?Oo:jo}let s=r(e),o=s(e);return{c(){n=v("div"),o.c(),C(n,"class","flashcard--front svelte-1mngjuk")},m(t,e){m(t,n,e),o.m(n,null)},p(t,e){s===(s=r(t))&&o?o.p(t,e):(o.d(1),o=s(t),o&&(o.c(),o.m(n,null)))},i:t,o:t,d(t){t&&$(n),o.d()}}}function Bo(t){let e,n,r,s;return r=new Qr({props:{word:t[2][t[0]],backgroundColor:"white",lists:t[4]}}),{c(){e=v("div"),n=v("div"),nt(r.$$.fragment),C(n,"class","flashcard--back--container svelte-1mngjuk"),C(e,"class","flashcard--back svelte-1mngjuk")},m(t,o){m(t,e,o),g(e,n),rt(r,n,null),s=!0},p(t,e){const n={};5&e&&(n.word=t[2][t[0]]),16&e&&(n.lists=t[4]),r.$set(n)},i(t){s||(J(r.$$.fragment,t),s=!0)},o(t){Z(r.$$.fragment,t),s=!1},d(t){t&&$(e),st(r)}}}function jo(t){let e,n,r=(t[3]?Fo:qo)+"";return{c(){e=v("h1"),n=_(r),C(e,"class","svelte-1mngjuk")},m(t,r){m(t,e,r),g(e,n)},p(t,e){8&e&&r!==(r=(t[3]?Fo:qo)+"")&&z(n,r)},d(t){t&&$(e)}}}function Oo(t){let e,n,r,s,o,i=t[2][t[0]].simplified+"",a=t[2][t[0]].traditional+"";return{c(){e=v("h1"),n=_(i),r=_(" ("),s=_(a),o=_(")"),C(e,"class","svelte-1mngjuk")},m(t,i){m(t,e,i),g(e,n),g(e,r),g(e,s),g(e,o)},p(t,e){5&e&&i!==(i=t[2][t[0]].simplified+"")&&z(n,i),5&e&&a!==(a=t[2][t[0]].traditional+"")&&z(s,a)},d(t){t&&$(e)}}}function No(t){let e,n,r,s,o,i,a,l,c,h,d=t[5],u=[];for(let e=0;eZ(u[t],1,1,(()=>{u[t]=null}));let f=t[6],k=[];for(let e=0;eZ(k[t],1,1,(()=>{k[t]=null})),x=[Bo,Io],b=[];function z(t,e){return t[1]?0:1}return l=z(t),c=b[l]=x[l](t),{c(){e=v("div"),n=v("div"),r=v("div");for(let t=0;t{b[n]=null})),K(),c=b[l],c?c.p(t,e):(c=b[l]=x[l](t),c.c()),J(c,1),c.m(a,null))},i(t){if(!h){for(let t=0;tn(9,r=t),t.$$.on_destroy.push(a(s,o));let i=!0;const l="darwin"===window.platform;let c,h=0,d=!1,u=[],p=new URLSearchParams(r);c=p.get("list");let f=[];window.bookmarkManager.getLists().then((t=>{n(4,f=t)})).catch((t=>{Ke("There was an error fetching word lists. Check the log for more details.",t)}));let g=[{icon:Nt,label:"Back",disabled:!1,action:()=>{window.history.back()}},{icon:xt,label:"Previous",disabled:0===h,action:()=>{n(0,h-=1)}}],m=[{icon:xe,label:"Flip",disabled:!1,action:()=>{n(1,d=!d)}},{icon:zt,label:"Next",disabled:h===u.length-1,action:()=>{n(0,h+=1)}}];return t.$$.update=()=>{1&t.$$.dirty&&n(5,g[1].disabled=0===h,g),5&t.$$.dirty&&n(6,m[1].disabled=h===u.length-1,m),1&t.$$.dirty&&n(1,d=!1),2&t.$$.dirty&&n(6,m[0].icon=d?ke:xe,m)},window.bookmarkManager.getListContent(c).then((t=>{n(2,u=t),n(3,i=!1)})).catch((t=>{Ke("There was an error fetching list content. Check the log for more details.",t)})),[h,d,u,i,f,g,m,l]}class Uo extends it{constructor(t){super(),ot(this,t,Ho,No,i,{})}}function Vo(e){let n,r,s,o,i,a,l;return s=new Cn({}),a=new kt({props:{routes:e[0]}}),{c(){n=v("div"),r=v("div"),nt(s.$$.fragment),o=y(),i=v("div"),nt(a.$$.fragment),C(r,"class","navigation-container svelte-1izwdrv"),C(i,"class","content-container svelte-1izwdrv"),C(n,"class","app-container svelte-1izwdrv")},m(t,e){m(t,n,e),g(n,r),rt(s,r,null),g(n,o),g(n,i),rt(a,i,null),l=!0},p:t,i(t){l||(J(s.$$.fragment,t),J(a.$$.fragment,t),l=!0)},o(t){Z(s.$$.fragment,t),Z(a.$$.fragment,t),l=!1},d(t){t&&$(n),st(s),st(a)}}}function Yo(t){mn();return[{"/":Bs,"/read":Es,"/bookmarks":ws,"/study":So,"/study/flashcards":Uo,"/tools":Eo,"/help":bs,"/settings":mo,"/chat":_s,"*":Ss}]}class Qo extends it{constructor(t){super(),ot(this,t,Yo,Vo,i,{})}}var Xo;const Go="undefined"==typeof window?global:window,Ko=Go.performance&&(()=>Go.performance.now())||(()=>Date.now()),Jo=Go.requestAnimationFrame||(t=>setTimeout((()=>t(Ko())),1e3/60)),Zo=Go.cancelAnimationFrame||clearTimeout;function ti(t){return t[t.length-1]}const ei=(t,e)=>t<0?e+t:t;function ni(t,e){const n={...t};for(const r in e){const s=t[r],o=e[r];s!==o&&(s&&o&&"object"==typeof s&&"object"==typeof o&&!Array.isArray(o)?n[r]=ni(s,o):n[r]=o)}return n}let ri=0;function si(){return ri++,ri}function oi(t){return t.reduce(((t,e)=>e+t),0)/t.length}function ii(t){const e=t.toUpperCase().trim();if(/^#([A-F0-9]{3}){1,2}$/.test(e)){let t=e.substring(1).split("");3===t.length&&(t=[t[0],t[0],t[1],t[1],t[2],t[2]]);const n=`${t.join("")}`;return{r:parseInt(n.slice(0,2),16),g:parseInt(n.slice(2,4),16),b:parseInt(n.slice(4,6),16),a:1}}const n=e.match(/^RGBA?\((\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*(\d*\.?\d+))?\)$/);if(n)return{r:parseInt(n[1],10),g:parseInt(n[2],10),b:parseInt(n[3],10),a:parseFloat(n[4]||1,10)};throw new Error(`Invalid color: ${t}`)}function ai(t,e){const n={};for(let r=0;r0||ci.indexOf("Trident/")>0||ci.indexOf("Edge/")>0,di=()=>{};class ui{constructor(t,e,n=di){this._mutationChains=[],this._onStateChange=n,this.state={options:{drawingFadeDuration:e.drawingFadeDuration,drawingWidth:e.drawingWidth,drawingColor:ii(e.drawingColor),strokeColor:ii(e.strokeColor),outlineColor:ii(e.outlineColor),radicalColor:ii(e.radicalColor||e.strokeColor),highlightColor:ii(e.highlightColor)},character:{main:{opacity:e.showCharacter?1:0,strokes:{}},outline:{opacity:e.showOutline?1:0,strokes:{}},highlight:{opacity:1,strokes:{}}},userStrokes:null};for(let e=0;et.scope));return this.cancelMutations(n),new Promise((r=>{const s={_isActive:!0,_index:0,_resolve:r,_mutations:t,_loop:e.loop,_scopes:n};this._mutationChains.push(s),this._run(s)}))}_run(t){if(!t._isActive)return;const e=t._mutations;if(t._index>=e.length){if(!t._loop)return t._isActive=!1,this._mutationChains=this._mutationChains.filter((e=>e!==t)),void t._resolve({canceled:!1});t._index=0}t._mutations[t._index].run(this).then((()=>{t._isActive&&(t._index++,this._run(t))}))}_getActiveMutations(){return this._mutationChains.map((t=>t._mutations[t._index]))}pauseAll(){this._getActiveMutations().forEach((t=>t.pause()))}resumeAll(){this._getActiveMutations().forEach((t=>t.resume()))}cancelMutations(t){for(const e of this._mutationChains)for(const n of e._scopes)for(const r of t)(n.startsWith(r)||r.startsWith(n))&&this._cancelMutationChain(e)}cancelAll(){this.cancelMutations([""])}_cancelMutationChain(t){var e;t._isActive=!1;for(let e=t._index;ee!==t))}}const pi=(t,e)=>({x:t.x-e.x,y:t.y-e.y}),fi=t=>Math.sqrt(Math.pow(t.x,2)+Math.pow(t.y,2)),gi=(t,e)=>fi(pi(t,e)),mi=(t,e=1)=>{const n=10*e;return{x:Math.round(n*t.x)/n,y:Math.round(n*t.y)/n}},$i=t=>{let e=t[0];return t.slice(1).reduce(((t,n)=>{const r=gi(n,e);return e=n,t+r}),0)},wi=(t,e,n)=>{const r=pi(e,t),s=n/fi(r);return{x:e.x+s*r.x,y:e.y+s*r.y}},vi=t=>{const e=((t,e=30)=>{const n=$i(t)/(e-1),r=[t[0]],s=ti(t),o=t.slice(1);for(let t=0;tt.x))),y:oi(e.map((t=>t.y)))},r=e.map((t=>pi(t,n))),s=Math.sqrt(oi([Math.pow(r[0].x,2)+Math.pow(r[0].y,2),Math.pow(ti(r).x,2)+Math.pow(ti(r).y,2)]));return((t,e=.05)=>{const n=t.slice(0,1);for(const r of t.slice(1)){const t=n[n.length-1],s=gi(r,t);if(s>e){const o=Math.ceil(s/e),i=s/o;for(let e=0;e({x:t.x/s,y:t.y/s}))))};function ki(t,e=!1){const n=mi(t[0]),r=t.slice(1);let s=`M ${n.x} ${n.y}`;return r.forEach((t=>{const e=mi(t);s+=` L ${e.x} ${e.y}`})),e&&(s+="Z"),s}const _i=(t,e)=>{const n=(t=>{if(t.length<3)return t;const e=[t[0],t[1]];return t.slice(2).forEach((t=>{const n=e.length,r=pi(t,e[n-1]),s=pi(e[n-1],e[n-2]);r.y*s.x-r.x*s.y==0&&e.pop(),e.push(t)})),e})(t);if(n.length<2)return n;const r=n[1],s=n[0],o=wi(r,s,e),i=n.slice(1);return i.unshift(o),i};class yi{constructor(t,e,n,r=!1){this.path=t,this.points=e,this.strokeNum=n,this.isInRadical=r}getStartingPoint(){return this.points[0]}getEndingPoint(){return this.points[this.points.length-1]}getLength(){return $i(this.points)}getVectors(){let t=this.points[0];return this.points.slice(1).map((e=>{const n=pi(e,t);return t=e,n}))}getDistance(t){const e=this.points.map((e=>gi(e,t)));return Math.min(...e)}getAverageDistance(t){return t.reduce(((t,e)=>t+this.getDistance(e)),0)/t.length}}class xi{constructor(t,e){this.symbol=t,this.strokes=e}}function bi({radStrokes:t,strokes:e,medians:n}){return e.map(((e,r)=>{const s=n[r].map((t=>{const[e,n]=t;return{x:e,y:n}}));return new yi(e,s,r,(o=r,(null!==(i=null==t?void 0:t.indexOf(o))&&void 0!==i?i:-1)>=0));var o,i}))}const[Ci,zi]=[{x:0,y:-124},{x:1024,y:900}],Si=zi.x-Ci.x,Pi=zi.y-Ci.y;class Ti{constructor(t){const{padding:e,width:n,height:r}=t;this.padding=e,this.width=n,this.height=r;const s=n-2*e,o=r-2*e,i=s/Si,a=o/Pi;this.scale=Math.min(i,a);const l=e+(s-this.scale*Si)/2,c=e+(o-this.scale*Pi)/2;this.xOffset=-1*Ci.x*this.scale+l,this.yOffset=-1*Ci.y*this.scale+c}convertExternalPoint(t){return{x:(t.x-this.xOffset)/this.scale,y:(this.height-this.yOffset-t.y)/this.scale}}}const Ei=(t,e)=>{const n=(t=>{const e=[];let n=t[0];return t.slice(1).forEach((t=>{e.push(pi(t,n)),n=t})),e})(t),r=e.getVectors();return oi(n.map((t=>{const e=r.map((e=>{return r=t,((n=e).x*r.x+n.y*r.y)/fi(n)/fi(r);var n,r}));return Math.max(...e)})))>0},Wi=t=>{if(t.length<2)return t;const[e,...n]=t,r=[e];for(const t of n)s=t,o=r[r.length-1],(s.x!==o.x||s.y!==o.y)&&r.push(t);var s,o;return r},Mi=[Math.PI/16,Math.PI/32,0,-1*Math.PI/32,-1*Math.PI/16],Di=(t,e,n)=>{const r=vi(t),s=vi(e);let o=1/0;return Mi.forEach((t=>{const e=((t,e)=>{const n=t.length>=e.length?t:e,r=t.length>=e.length?e:t,s=(t,e,s,o)=>{if(0===t&&0===e)return gi(n[0],r[0]);if(t>0&&0===e)return Math.max(s[0],gi(n[t],r[0]));const i=o[o.length-1];return 0===t&&e>0?Math.max(i,gi(n[0],r[e])):Math.max(Math.min(s[e],s[e-1],i),gi(n[t],r[e]))};let o=[];for(let t=0;tt.map((t=>({x:Math.cos(e)*t.x-Math.sin(e)*t.y,y:Math.sin(e)*t.x+Math.cos(e)*t.y}))))(s,t));e{const{leniency:r=1,isOutlineVisible:s=!1,checkBackwards:o=!0,averageDistanceThreshold:i=350}=n,a=e.getAverageDistance(t),l=a<=i*(s||e.strokeNum>0?.5:1)*r;if(!l)return{isMatch:!1,avgDist:a,meta:{isStrokeBackwards:!1}};const c=((t,e,n)=>{const r=gi(e.getStartingPoint(),t[0]),s=gi(e.getEndingPoint(),t[t.length-1]);return r<=250*n&&s<=250*n})(t,e,r),h=Ei(t,e),d=Di(t,e.points,r),u=((t,e,n)=>n*($i(t)+25)/(e.getLength()+25)>=.35)(t,e,r),p=l&&c&&h&&d&&u;if(o&&!p){if(Ai([...t].reverse(),e,{...n,checkBackwards:!1}).isMatch)return{isMatch:p,avgDist:a,meta:{isStrokeBackwards:!0}}}return{isMatch:p,avgDist:a,meta:{isStrokeBackwards:!1}}};class Li{constructor(t,e,n){this.id=t,this.points=[e],this.externalPoints=[n]}appendPoint(t,e){this.points.push(t),this.externalPoints.push(e)}}class Ri{constructor(t,e,n={}){this._tick=t=>{if(null!==this._startPauseTime)return;const e=Math.min(1,(t-this._startTime-this._pausedDuration)/this._duration);if(1===e)this._renderState.updateState(this._values),this._frameHandle=void 0,this.cancel(this._renderState);else{const t=ji(e),n=Ii(this._startState,this._values,t);this._renderState.updateState(n),this._frameHandle=Jo(this._tick)}},this.scope=t,this._valuesOrCallable=e,this._duration=n.duration||0,this._force=n.force,this._pausedDuration=0,this._startPauseTime=null}run(t){return this._values||this._inflateValues(t),0===this._duration&&t.updateState(this._values),0===this._duration||Bi(t.state,this._values)?Promise.resolve():(this._renderState=t,this._startState=t.state,this._startTime=performance.now(),this._frameHandle=Jo(this._tick),new Promise((t=>{this._resolve=t})))}_inflateValues(t){let e=this._valuesOrCallable;"function"==typeof this._valuesOrCallable&&(e=this._valuesOrCallable(t.state)),this._values=function(t,e){const n=t.split("."),r={};let s=r;for(let t=0;t=0?n*(o-i)+i:Ii(i,o,n)}return r}function Bi(t,e){for(const n in e){const r=e[n],s=null==t?void 0:t[n];if(r>=0){if(r!==s)return!1}else if(!Bi(s,r))return!1}return!0}Ri.Delay=class{constructor(t){this._duration=t,this._startTime=null,this._paused=!1,this.scope=`delay.${t}`}run(){return this._startTime=Ko(),this._runningPromise=new Promise((t=>{this._resolve=t,this._timeout=setTimeout((()=>this.cancel()),this._duration)})),this._runningPromise}pause(){if(this._paused)return;const t=performance.now()-(this._startTime||0);this._duration=Math.max(0,this._duration-t),clearTimeout(this._timeout),this._paused=!0}resume(){this._paused&&(this._startTime=performance.now(),this._timeout=setTimeout((()=>this.cancel()),this._duration),this._paused=!1)}cancel(){clearTimeout(this._timeout),this._resolve&&this._resolve(),this._resolve=void 0}};const ji=t=>-Math.cos(t*Math.PI)/2+.5,Oi=(t,e,n)=>[new Ri(`character.${t}.strokes`,ai({opacity:1,displayPortion:1},e.strokes.length),{duration:n,force:!0})],Ni=(t,e,n)=>[new Ri(`character.${t}`,{opacity:1,strokes:ai({opacity:1,displayPortion:1},e.strokes.length)},{duration:n,force:!0})],qi=(t,e,n)=>[new Ri(`character.${t}.opacity`,0,{duration:n,force:!0}),...Oi(t,e,0)],Fi=(t,e,n)=>[new Ri(`options.${t}`,e,{duration:n})],Hi=(t,e,n)=>{const r=t.strokeNum,s=(t.getLength()+600)/(3*n);return[new Ri("options.highlightColor",e),new Ri("character.highlight",{opacity:1,strokes:{[r]:{displayPortion:0,opacity:0}}}),new Ri(`character.highlight.strokes.${r}`,{displayPortion:1,opacity:1},{duration:s}),new Ri(`character.highlight.strokes.${r}.opacity`,0,{duration:s,force:!0})]},Ui=(t,e,n)=>{const r=e.strokeNum,s=(e.getLength()+600)/(3*n);return[new Ri(`character.${t}`,{opacity:1,strokes:{[r]:{displayPortion:0,opacity:1}}}),new Ri(`character.${t}.strokes.${r}.displayPortion`,1,{duration:s})]},Vi=(t,e,n,r,s)=>{let o=qi(t,e,n);return o=o.concat(Oi(t,e,0)),o.push(new Ri(`character.${t}`,{opacity:1,strokes:ai({opacity:0},e.strokes.length)},{force:!0})),e.strokes.forEach(((e,n)=>{n>0&&o.push(new Ri.Delay(s)),o=o.concat(Ui(t,e,r))})),o},Yi=(t,e)=>[new Ri(`userStrokes.${t}.opacity`,0,{duration:e}),new Ri(`userStrokes.${t}`,null,{force:!0})];class Qi{constructor(t,e,n){this._currentStrokeIndex=0,this._mistakesOnStroke=0,this._totalMistakes=0,this._character=t,this._renderState=e,this._isActive=!1,this._positioner=n}startQuiz(t){this._isActive=!0,this._options=t;const e=ei(t.quizStartStrokeNum,this._character.strokes.length);return this._currentStrokeIndex=Math.min(e,this._character.strokes.length-1),this._mistakesOnStroke=0,this._totalMistakes=0,this._renderState.run((n=this._character,r=t.strokeFadeDuration,s=this._currentStrokeIndex,[...qi("main",n,r),new Ri("character.highlight",{opacity:1,strokes:ai({opacity:0},n.strokes.length)},{force:!0}),new Ri("character.main",{opacity:1,strokes:li(n.strokes.length,(t=>({opacity:t[new Ri("quiz.activeUserStrokeId",t,{force:!0}),new Ri(`userStrokes.${t}`,{points:[e],opacity:1},{force:!0})])(n,e))}continueUserStroke(t){if(!this._userStroke)return Promise.resolve();const e=this._positioner.convertExternalPoint(t);this._userStroke.appendPoint(e,t);const n=this._userStroke.points.slice(0);return this._renderState.run((r=this._userStroke.id,[new Ri(`userStrokes.${r}.points`,n,{force:!0})]));var r}setPositioner(t){this._positioner=t}endUserStroke(){var t;if(!this._userStroke)return;if(this._renderState.run(Yi(this._userStroke.id,null!==(t=this._options.drawingFadeDuration)&&void 0!==t?t:300)),1===this._userStroke.points.length)return void(this._userStroke=void 0);const{acceptBackwardsStrokes:e,markStrokeCorrectAfterMisses:n}=this._options,r=this._getCurrentStroke(),{isMatch:s,meta:o}=function(t,e,n,r={}){const s=e.strokes,o=Wi(t.points);if(o.length<2)return{isMatch:!1,meta:{isStrokeBackwards:!1}};const{isMatch:i,meta:a,avgDist:l}=Ai(o,s[n],r);if(!i)return{isMatch:i,meta:a};const c=s.slice(n+1);let h=l;for(let t=0;t0,leniency:this._options.leniency,averageDistanceThreshold:this._options.averageDistanceThreshold}),i=n&&this._mistakesOnStroke+1>=n;if(s||i||o.isStrokeBackwards&&e)this._handleSuccess(o);else{this._handleFailure(o);const{showHintAfterMisses:t,highlightColor:e,strokeHighlightSpeed:n}=this._options;!1!==t&&this._mistakesOnStroke>=t&&this._renderState.run(Hi(r,ii(e),n))}this._userStroke=void 0}cancel(){this._isActive=!1,this._userStroke&&this._renderState.run(Yi(this._userStroke.id,this._options.drawingFadeDuration))}_getStrokeData({isCorrect:t,meta:e}){return{character:this._character.symbol,strokeNum:this._currentStrokeIndex,mistakesOnStroke:this._mistakesOnStroke,totalMistakes:this._totalMistakes,strokesRemaining:this._character.strokes.length-this._currentStrokeIndex-(t?1:0),drawnPath:(n=this._userStroke,{pathString:ki(n.externalPoints),points:n.points.map((t=>mi(t)))}),isBackwards:e.isStrokeBackwards};var n}_handleSuccess(t){if(!this._options)return;const{strokes:e,symbol:n}=this._character,{onCorrectStroke:r,onComplete:s,highlightOnComplete:o,strokeFadeDuration:i,highlightCompleteColor:a,highlightColor:l,strokeHighlightDuration:c}=this._options;null==r||r({...this._getStrokeData({isCorrect:!0,meta:t})});let h=(d="main",u=this._currentStrokeIndex,[new Ri(`character.${d}.strokes.${u}`,{displayPortion:1,opacity:1},{duration:i,force:!0})]);var d,u;this._mistakesOnStroke=0,this._currentStrokeIndex+=1;this._currentStrokeIndex===e.length&&(this._isActive=!1,null==s||s({character:n,totalMistakes:this._totalMistakes}),o&&(h=h.concat(((t,e,n)=>[new Ri("options.highlightColor",e),...qi("highlight",t),...Ni("highlight",t,n/2),...qi("highlight",t,n/2)])(this._character,ii(a||l),2*(c||0))))),this._renderState.run(h)}_handleFailure(t){var e,n;this._mistakesOnStroke+=1,this._totalMistakes+=1,null===(e=(n=this._options).onMistake)||void 0===e||e.call(n,this._getStrokeData({isCorrect:!1,meta:t}))}_getCurrentStroke(){return this._character.strokes[this._currentStrokeIndex]}}function Xi(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function Gi(t,e,n){t.setAttributeNS(null,e,n)}function Ki(t,e){Object.keys(e).forEach((n=>Gi(t,n,e[n])))}function Ji(t){var e;null==t||null===(e=t.parentNode)||void 0===e||e.removeChild(t)}class Zi{constructor(t){this.stroke=t,this._pathLength=t.getLength()+Zi.STROKE_WIDTH/2}_getStrokeDashoffset(t){return.999*this._pathLength*(1-t)}_getColor({strokeColor:t,radicalColor:e}){return e&&this.stroke.isInRadical?e:t}}Zi.STROKE_WIDTH=200;class ta extends Zi{constructor(t){super(t),this._oldProps=void 0}mount(t){this._animationPath=Xi("path"),this._clip=Xi("clipPath"),this._strokePath=Xi("path");const e=`mask-${si()}`;Gi(this._clip,"id",e),Gi(this._strokePath,"d",this.stroke.path),this._animationPath.style.opacity="0",Gi(this._animationPath,"clip-path",function(t){let e="";return window.location&&window.location.href&&(e=window.location.href.replace(/#[^#]*$/,"").replace(/"/gi,"%22")),`url("${e}#${t}")`}(e));const n=_i(this.stroke.points,100);return Gi(this._animationPath,"d",ki(n)),Ki(this._animationPath,{stroke:"#FFFFFF","stroke-width":200..toString(),fill:"none","stroke-linecap":"round","stroke-linejoin":"miter","stroke-dasharray":`${this._pathLength},${this._pathLength}`}),this._clip.appendChild(this._strokePath),t.defs.appendChild(this._clip),t.svg.appendChild(this._animationPath),this}render(t){var e,n;if(t===this._oldProps||!this._animationPath)return;t.displayPortion!==(null===(e=this._oldProps)||void 0===e?void 0:e.displayPortion)&&(this._animationPath.style.strokeDashoffset=this._getStrokeDashoffset(t.displayPortion).toString());const r=this._getColor(t);if(!this._oldProps||r!==this._getColor(this._oldProps)){const{r:t,g:e,b:n,a:s}=r;Ki(this._animationPath,{stroke:`rgba(${t},${e},${n},${s})`})}t.opacity!==(null===(n=this._oldProps)||void 0===n?void 0:n.opacity)&&(this._animationPath.style.opacity=t.opacity.toString()),this._oldProps=t}}class ea{constructor(t){this._oldProps=void 0,this._strokeRenderers=t.strokes.map((t=>new ta(t)))}mount(t){const e=t.createSubRenderTarget();this._group=e.svg,this._strokeRenderers.forEach((t=>{t.mount(e)}))}render(t){var e,n;if(t===this._oldProps||!this._group)return;const{opacity:r,strokes:s,strokeColor:o,radicalColor:i=null}=t;var a;r!==(null===(e=this._oldProps)||void 0===e?void 0:e.opacity)&&(this._group.style.opacity=r.toString(),hi||(0===r?this._group.style.display="none":0===(null===(a=this._oldProps)||void 0===a?void 0:a.opacity)&&this._group.style.removeProperty("display")));const l=!this._oldProps||o!==this._oldProps.strokeColor||i!==this._oldProps.radicalColor;if(l||s!==(null===(n=this._oldProps)||void 0===n?void 0:n.strokes))for(let t=0;t{t(this._eventify(e,this._getMousePoint))})),this.node.addEventListener("touchstart",(e=>{t(this._eventify(e,this._getTouchPoint))}))}addPointerMoveListener(t){this.node.addEventListener("mousemove",(e=>{t(this._eventify(e,this._getMousePoint))})),this.node.addEventListener("touchmove",(e=>{t(this._eventify(e,this._getTouchPoint))}))}addPointerEndListener(t){document.addEventListener("mouseup",t),document.addEventListener("touchend",t)}getBoundingClientRect(){return this.node.getBoundingClientRect()}updateDimensions(t,e){this.node.setAttribute("width",`${t}`),this.node.setAttribute("height",`${e}`)}_eventify(t,e){return{getPoint:()=>e.call(this,t),preventDefault:()=>t.preventDefault()}}_getMousePoint(t){const{left:e,top:n}=this.getBoundingClientRect();return{x:t.clientX-e,y:t.clientY-n}}_getTouchPoint(t){const{left:e,top:n}=this.getBoundingClientRect();return{x:t.touches[0].clientX-e,y:t.touches[0].clientY-n}}}class sa extends ra{constructor(t,e){super(t),this.svg=t,this.defs=e,"createSVGPoint"in t&&(this._pt=t.createSVGPoint())}static init(t,e="100%",n="100%"){const r="string"==typeof t?document.getElementById(t):t;if(!r)throw new Error(`HanziWriter target element not found: ${t}`);const s=r.nodeName.toUpperCase(),o=(()=>{if("SVG"===s||"G"===s)return r;{const t=Xi("svg");return r.appendChild(t),t}})();Ki(o,{width:e,height:n});const i=Xi("defs");return o.appendChild(i),new sa(o,i)}createSubRenderTarget(){const t=Xi("g");return this.svg.appendChild(t),new sa(t,this.defs)}_getMousePoint(t){if(this._pt&&(this._pt.x=t.clientX,this._pt.y=t.clientY,"getScreenCTM"in this.node)){var e;const t=this._pt.matrixTransform(null===(e=this.node.getScreenCTM())||void 0===e?void 0:e.inverse());return{x:t.x,y:t.y}}return super._getMousePoint.call(this,t)}_getTouchPoint(t){if(this._pt&&(this._pt.x=t.touches[0].clientX,this._pt.y=t.touches[0].clientY,"getScreenCTM"in this.node)){var e;const t=this._pt.matrixTransform(null===(e=this.node.getScreenCTM())||void 0===e?void 0:e.inverse());return{x:t.x,y:t.y}}return super._getTouchPoint(t)}}var oa={HanziWriterRenderer:class{constructor(t,e){this._character=t,this._positioner=e,this._mainCharRenderer=new ea(t),this._outlineCharRenderer=new ea(t),this._highlightCharRenderer=new ea(t),this._userStrokeRenderers={}}mount(t){const e=t.createSubRenderTarget(),n=e.svg,{xOffset:r,yOffset:s,height:o,scale:i}=this._positioner;Gi(n,"transform",`translate(${r}, ${o-s}) scale(${i}, ${-1*i})`),this._outlineCharRenderer.mount(e),this._mainCharRenderer.mount(e),this._highlightCharRenderer.mount(e),this._positionedTarget=e}render(t){const{main:e,outline:n,highlight:r}=t.character,{outlineColor:s,radicalColor:o,highlightColor:i,strokeColor:a,drawingWidth:l,drawingColor:c}=t.options;this._outlineCharRenderer.render({opacity:n.opacity,strokes:n.strokes,strokeColor:s}),this._mainCharRenderer.render({opacity:e.opacity,strokes:e.strokes,strokeColor:a,radicalColor:o}),this._highlightCharRenderer.render({opacity:r.opacity,strokes:r.strokes,strokeColor:i});const h=t.userStrokes||{};for(const t in this._userStrokeRenderers){var d;if(!h[t])null===(d=this._userStrokeRenderers[t])||void 0===d||d.destroy(),delete this._userStrokeRenderers[t]}for(const t in h){const e=h[t];if(!e)continue;const n={strokeWidth:l,strokeColor:c,...e};(()=>{if(this._userStrokeRenderers[t])return this._userStrokeRenderers[t];const e=new na;return e.mount(this._positionedTarget),this._userStrokeRenderers[t]=e,e})().render(n)}}destroy(){Ji(this._positionedTarget.svg),this._positionedTarget.defs.innerHTML=""}},createRenderTarget:sa.init};const ia=(t,e)=>{t.beginPath();const n=e[0],r=e.slice(1);t.moveTo(n.x,n.y);for(const e of r)t.lineTo(e.x,e.y);t.stroke()};class aa extends Zi{constructor(t,e=!0){super(t),e&&Path2D?this._path2D=new Path2D(this.stroke.path):this._pathCmd=(t=>{const e=t.split(/(^|\s+)(?=[A-Z])/).filter((t=>" "!==t)),n=[t=>t.beginPath()];for(const t of e){const[e,...r]=t.split(/\s+/),s=r.map((t=>parseFloat(t)));"M"===e?n.push((t=>t.moveTo(...s))):"L"===e?n.push((t=>t.lineTo(...s))):"C"===e?n.push((t=>t.bezierCurveTo(...s))):"Q"===e&&n.push((t=>t.quadraticCurveTo(...s)))}return t=>n.forEach((e=>e(t)))})(this.stroke.path),this._extendedMaskPoints=_i(this.stroke.points,Zi.STROKE_WIDTH/2)}render(t,e){if(e.opacity<.05)return;var n;(t.save(),this._path2D)?t.clip(this._path2D):(null===(n=this._pathCmd)||void 0===n||n.call(this,t),t.globalAlpha=0,t.stroke(),t.clip());const{r:r,g:s,b:o,a:i}=this._getColor(e),a=1===i?`rgb(${r},${s},${o})`:`rgb(${r},${s},${o},${i})`,l=this._getStrokeDashoffset(e.displayPortion);t.globalAlpha=e.opacity,t.strokeStyle=a,t.fillStyle=a,t.lineWidth=Zi.STROKE_WIDTH,t.lineCap="round",t.lineJoin="round",t.setLineDash([this._pathLength,this._pathLength],l),t.lineDashOffset=l,ia(t,this._extendedMaskPoints),t.restore()}}class la{constructor(t){this._strokeRenderers=t.strokes.map((t=>new aa(t)))}render(t,e){if(e.opacity<.05)return;const{opacity:n,strokeColor:r,radicalColor:s,strokes:o}=e;for(let e=0;e{if("CANVAS"===s)return r;const t=document.createElement("canvas");return r.appendChild(t),t})();return o.setAttribute("width",e),o.setAttribute("height",n),new ha(o)}getContext(){return this.node.getContext("2d")}}var da={HanziWriterRenderer:class{constructor(t,e){this.destroy=di,this._character=t,this._positioner=e,this._mainCharRenderer=new la(t),this._outlineCharRenderer=new la(t),this._highlightCharRenderer=new la(t)}mount(t){this._target=t}_animationFrame(t){const{width:e,height:n,scale:r,xOffset:s,yOffset:o}=this._positioner,i=this._target.getContext();i.clearRect(0,0,e,n),i.save(),i.translate(s,n-o),i.transform(1,0,0,-1,0,0),i.scale(r,r),t(i),i.restore(),i.draw&&i.draw()}render(t){const{outline:e,main:n,highlight:r}=t.character,{outlineColor:s,strokeColor:o,radicalColor:i,highlightColor:a,drawingColor:l,drawingWidth:c}=t.options;this._animationFrame((h=>{this._outlineCharRenderer.render(h,{opacity:e.opacity,strokes:e.strokes,strokeColor:s}),this._mainCharRenderer.render(h,{opacity:n.opacity,strokes:n.strokes,strokeColor:o,radicalColor:i}),this._highlightCharRenderer.render(h,{opacity:r.opacity,strokes:r.strokes,strokeColor:a});const d=t.userStrokes||{};for(const t in d){const e=d[t];if(e){ca(h,{strokeWidth:c,strokeColor:l,...e})}}}))}},createRenderTarget:ha.init};const ua={charDataLoader:(t,e,n)=>{const r=new XMLHttpRequest;r.overrideMimeType&&r.overrideMimeType("application/json"),r.open("GET",(t=>`https://cdn.jsdelivr.net/npm/hanzi-writer-data@2.0/${t}.json`)(t),!0),r.onerror=t=>{n(r,t)},r.onreadystatechange=()=>{4===r.readyState&&(200===r.status?e(JSON.parse(r.responseText)):0!==r.status&&n&&n(r))},r.send(null)},onLoadCharDataError:null,onLoadCharDataSuccess:null,showOutline:!0,showCharacter:!0,renderer:"svg",width:0,height:0,padding:20,strokeAnimationSpeed:1,strokeFadeDuration:400,strokeHighlightDuration:200,strokeHighlightSpeed:2,delayBetweenStrokes:1e3,delayBetweenLoops:2e3,strokeColor:"#555",radicalColor:null,highlightColor:"#AAF",outlineColor:"#DDD",drawingColor:"#333",leniency:1,showHintAfterMisses:3,highlightOnComplete:!0,highlightCompleteColor:null,markStrokeCorrectAfterMisses:!1,acceptBackwardsStrokes:!1,quizStartStrokeNum:0,averageDistanceThreshold:350,drawingFadeDuration:300,drawingWidth:4,strokeWidth:2,outlineWidth:2,rendererOverride:{}};class pa{constructor(t){this._loadCounter=0,this._isLoading=!1,this.loadingFailed=!1,this._options=t}_debouncedLoad(t,e){const n=t=>{var n;e===this._loadCounter&&(null===(n=this._resolve)||void 0===n||n.call(this,t))},r=t=>{var n;e===this._loadCounter&&(null===(n=this._reject)||void 0===n||n.call(this,t))},s=this._options.charDataLoader(t,n,r);s&&("then"in s?s.then(n).catch(r):n(s))}_setupLoadingPromise(){return new Promise(((t,e)=>{this._resolve=t,this._reject=e})).then((t=>{var e,n;return this._isLoading=!1,null===(e=(n=this._options).onLoadCharDataSuccess)||void 0===e||e.call(n,t),t})).catch((t=>{if(this._isLoading=!1,this.loadingFailed=!0,this._options.onLoadCharDataError)return void this._options.onLoadCharDataError(t);if(t instanceof Error)throw t;const e=new Error(`Failed to load char data for ${this._loadingChar}`);throw e.reason=t,e}))}loadCharData(t){this._loadingChar=t;const e=this._setupLoadingPromise();return this.loadingFailed=!1,this._isLoading=!0,this._loadCounter++,this._debouncedLoad(t,this._loadCounter),e}}class fa{constructor(t,e={}){const{HanziWriterRenderer:n,createRenderTarget:r}="canvas"===e.renderer?da:oa,s=e.rendererOverride||{};this._renderer={HanziWriterRenderer:s.HanziWriterRenderer||n,createRenderTarget:s.createRenderTarget||r},this.target=this._renderer.createRenderTarget(t,e.width,e.height),this._options=this._assignOptions(e),this._loadingManager=new pa(this._options),this._setupListeners()}static create(t,e,n){const r=new fa(t,n);return r.setCharacter(e),r}static loadCharacterData(t,e={}){const n=(()=>{const{_loadingManager:n,_loadingOptions:r}=fa;return(null==n?void 0:n._loadingChar)===t&&r===e?n:new pa({...ua,...e})})();return fa._loadingManager=n,fa._loadingOptions=e,n.loadCharData(t)}static getScalingTransform(t,e,n=0){const r=new Ti({width:t,height:e,padding:n});return{x:r.xOffset,y:r.yOffset,scale:r.scale,transform:(s=`\n translate(${r.xOffset}, ${r.height-r.yOffset})\n scale(${r.scale}, ${-1*r.scale})\n `,s.replace(/^\s+/,"").replace(/\s+$/,"")).replace(/\s+/g," ")};var s}showCharacter(t={}){return this._options.showCharacter=!0,this._withData((()=>{var e;return null===(e=this._renderState)||void 0===e?void 0:e.run(Ni("main",this._character,"number"==typeof t.duration?t.duration:this._options.strokeFadeDuration)).then((e=>{var n;return null===(n=t.onComplete)||void 0===n||n.call(t,e),e}))}))}hideCharacter(t={}){return this._options.showCharacter=!1,this._withData((()=>{var e;return null===(e=this._renderState)||void 0===e?void 0:e.run(qi("main",this._character,"number"==typeof t.duration?t.duration:this._options.strokeFadeDuration)).then((e=>{var n;return null===(n=t.onComplete)||void 0===n||n.call(t,e),e}))}))}animateCharacter(t={}){return this.cancelQuiz(),this._withData((()=>{var e;return null===(e=this._renderState)||void 0===e?void 0:e.run(Vi("main",this._character,this._options.strokeFadeDuration,this._options.strokeAnimationSpeed,this._options.delayBetweenStrokes)).then((e=>{var n;return null===(n=t.onComplete)||void 0===n||n.call(t,e),e}))}))}animateStroke(t,e={}){return this.cancelQuiz(),this._withData((()=>{var n;return null===(n=this._renderState)||void 0===n?void 0:n.run(((t,e,n,r)=>{const s=e.strokes[n];return[new Ri(`character.${t}`,(n=>{const r=n.character[t],s={opacity:1,strokes:{}};for(let t=0;t{var n;return null===(n=e.onComplete)||void 0===n||n.call(e,t),t}))}))}highlightStroke(t,e={}){return this._withData((()=>{var n,r;if(this._character&&this._renderState)return this._renderState.run(Hi((n=this._character.strokes,r=t,n[ei(r,n.length)]),ii(this._options.highlightColor),this._options.strokeHighlightSpeed)).then((t=>{var n;return null===(n=e.onComplete)||void 0===n||n.call(e,t),t}))}))}async loopCharacterAnimation(){return this.cancelQuiz(),this._withData((()=>this._renderState.run(((t,e,n,r,s,o)=>{const i=Vi(t,e,n,r,s);return i.push(new Ri.Delay(o)),i})("main",this._character,this._options.strokeFadeDuration,this._options.strokeAnimationSpeed,this._options.delayBetweenStrokes,this._options.delayBetweenLoops),{loop:!0})))}pauseAnimation(){return this._withData((()=>{var t;return null===(t=this._renderState)||void 0===t?void 0:t.pauseAll()}))}resumeAnimation(){return this._withData((()=>{var t;return null===(t=this._renderState)||void 0===t?void 0:t.resumeAll()}))}showOutline(t={}){return this._options.showOutline=!0,this._withData((()=>{var e;return null===(e=this._renderState)||void 0===e?void 0:e.run(Ni("outline",this._character,"number"==typeof t.duration?t.duration:this._options.strokeFadeDuration)).then((e=>{var n;return null===(n=t.onComplete)||void 0===n||n.call(t,e),e}))}))}hideOutline(t={}){return this._options.showOutline=!1,this._withData((()=>{var e;return null===(e=this._renderState)||void 0===e?void 0:e.run(qi("outline",this._character,"number"==typeof t.duration?t.duration:this._options.strokeFadeDuration)).then((e=>{var n;return null===(n=t.onComplete)||void 0===n||n.call(t,e),e}))}))}updateDimensions({width:t,height:e,padding:n}){if(void 0!==t&&(this._options.width=t),void 0!==e&&(this._options.height=e),void 0!==n&&(this._options.padding=n),this.target.updateDimensions(this._options.width,this._options.height),this._character&&this._renderState&&this._hanziWriterRenderer&&this._positioner){this._hanziWriterRenderer.destroy();const t=this._initAndMountHanziWriterRenderer(this._character);this._renderState.overwriteOnStateChange((e=>t.render(e))),t.render(this._renderState.state),this._quiz&&this._quiz.setPositioner(this._positioner)}}updateColor(t,e,n={}){var r;let s=[];const o=ii((()=>"radicalColor"!==t||e?e:this._options.strokeColor)());this._options[t]=e;const i=null!==(r=n.duration)&&void 0!==r?r:this._options.strokeFadeDuration;return s=s.concat(Fi(t,o,i)),"radicalColor"!==t||e||(s=s.concat(Fi(t,null,0))),this._withData((()=>{var t;return null===(t=this._renderState)||void 0===t?void 0:t.run(s).then((t=>{var e;return null===(e=n.onComplete)||void 0===e||e.call(n,t),t}))}))}quiz(t={}){return this._withData((async()=>{this._character&&this._renderState&&this._positioner&&(this.cancelQuiz(),this._quiz=new Qi(this._character,this._renderState,this._positioner),this._options={...this._options,...t},this._quiz.startQuiz(this._options))}))}cancelQuiz(){this._quiz&&(this._quiz.cancel(),this._quiz=void 0)}setCharacter(t){return this.cancelQuiz(),this._char=t,this._hanziWriterRenderer&&this._hanziWriterRenderer.destroy(),this._renderState&&this._renderState.cancelAll(),this._hanziWriterRenderer=null,this._withDataPromise=this._loadingManager.loadCharData(t).then((e=>{if(!e||this._loadingManager.loadingFailed)return;this._character=function(t,e){const n=bi(e);return new xi(t,n)}(t,e),this._renderState=new ui(this._character,this._options,(t=>n.render(t)));const n=this._initAndMountHanziWriterRenderer(this._character);n.render(this._renderState.state)})),this._withDataPromise}_initAndMountHanziWriterRenderer(t){const{width:e,height:n,padding:r}=this._options;this._positioner=new Ti({width:e,height:n,padding:r});const s=new this._renderer.HanziWriterRenderer(t,this._positioner);return s.mount(this.target),this._hanziWriterRenderer=s,s}async getCharacterData(){if(!this._char)throw new Error("setCharacter() must be called before calling getCharacterData()");return await this._withData((()=>this._character))}_assignOptions(t){const e={...ua,...t};return t.strokeAnimationDuration&&!t.strokeAnimationSpeed&&(e.strokeAnimationSpeed=500/t.strokeAnimationDuration),t.strokeHighlightDuration&&!t.strokeHighlightSpeed&&(e.strokeHighlightSpeed=500/e.strokeHighlightDuration),t.highlightCompleteColor||(e.highlightCompleteColor=e.highlightColor),this._fillWidthAndHeight(e)}_fillWidthAndHeight(t){const e={...t};if(e.width&&!e.height)e.height=e.width;else if(e.height&&!e.width)e.width=e.height;else if(!e.width&&!e.height){const{width:t,height:n}=this.target.getBoundingClientRect(),r=Math.min(t,n);e.width=r,e.height=r}return e}_withData(t){if(this._loadingManager.loadingFailed)throw Error("Failed to load character data. Call setCharacter and try again.");return this._withDataPromise?this._withDataPromise.then((()=>{if(!this._loadingManager.loadingFailed)return t()})):Promise.resolve().then(t)}_setupListeners(){this.target.addPointerStartListener((t=>{this._quiz&&(t.preventDefault(),this._quiz.startUserStroke(t.getPoint()))})),this.target.addPointerMoveListener((t=>{this._quiz&&(t.preventDefault(),this._quiz.continueUserStroke(t.getPoint()))})),this.target.addPointerEndListener((()=>{var t;null===(t=this._quiz)||void 0===t||t.endUserStroke()}))}}function ga(t){let e;return{c(){e=v("span"),e.textContent="Simplified",C(e,"class","svelte-377oc3"),S(e,"script-selector--active","simplified"==t[1])},m(t,n){m(t,e,n)},p(t,n){2&n&&S(e,"script-selector--active","simplified"==t[1])},d(t){t&&$(e)}}}function ma(t){let e;return{c(){e=v("span"),e.textContent="Traditional",C(e,"class","svelte-377oc3"),S(e,"script-selector--active","traditional"==t[1])},m(t,n){m(t,e,n)},p(t,n){2&n&&S(e,"script-selector--active","traditional"==t[1])},d(t){t&&$(e)}}}function $a(t){let e,n,r,s,o;return n=new Pn({props:{classes:["sy-tooltip--container"],$$slots:{default:[ba]},$$scope:{ctx:t}}}),n.$on("click",t[9]),{c(){e=v("div"),nt(n.$$.fragment),r=y(),s=v("div"),s.innerHTML='
',C(e,"class","character-actions svelte-377oc3"),C(s,"class","character-container svelte-377oc3")},m(t,i){m(t,e,i),rt(n,e,null),m(t,r,i),m(t,s,i),o=!0},p(t,e){const r={};262156&e&&(r.$$scope={dirty:e,ctx:t}),n.$set(r)},i(t){o||(J(n.$$.fragment,t),o=!0)},o(t){Z(n.$$.fragment,t),o=!1},d(t){t&&$(e),st(n),t&&$(r),t&&$(s)}}}function wa(e){let n;return{c(){n=v("div"),n.innerHTML="

Character Data Not Found

\n\t\t\t\t

The stroke order data cannot be found for at least one of\n\t\t\t\t\tthe characters in this word.

",C(n,"class","character-window--character-not-found--container svelte-377oc3")},m(t,e){m(t,n,e)},p:t,i:t,o:t,d(t){t&&$(n)}}}function va(t){let e,n;return e=new de({props:{size:"18"}}),{c(){nt(e.$$.fragment)},m(t,r){rt(e,t,r),n=!0},i(t){n||(J(e.$$.fragment,t),n=!0)},o(t){Z(e.$$.fragment,t),n=!1},d(t){st(e,t)}}}function ka(t){let e,n;return e=new fe({props:{size:"18"}}),{c(){nt(e.$$.fragment)},m(t,r){rt(e,t,r),n=!0},i(t){n||(J(e.$$.fragment,t),n=!0)},o(t){Z(e.$$.fragment,t),n=!1},d(t){st(e,t)}}}function _a(t){let e;return{c(){e=_("Play Stroke Order")},m(t,n){m(t,e,n)},d(t){t&&$(e)}}}function ya(t){let e;return{c(){e=_("Resume")},m(t,n){m(t,e,n)},d(t){t&&$(e)}}}function xa(t){let e;return{c(){e=_("Pause")},m(t,n){m(t,e,n)},d(t){t&&$(e)}}}function ba(t){let e,n,r,s,o,i,a;const l=[ka,va],c=[];function h(t,e){return t[2]?1:0}function d(t,e){return t[2]?xa:t[3]?ya:_a}n=h(t),r=c[n]=l[n](t);let u=d(t),p=u(t);return{c(){e=v("span"),r.c(),s=y(),o=v("div"),i=v("p"),p.c(),C(e,"class","animate-button--icon-container svelte-377oc3"),C(e,"data-testid","control-button"),C(i,"data-testid","tooltip-text"),C(o,"class","sy-tooltip--body sy-tooltip--body-bottom")},m(t,r){m(t,e,r),c[n].m(e,null),m(t,s,r),m(t,o,r),g(o,i),p.m(i,null),a=!0},p(t,s){let o=n;n=h(t),n!==o&&(G(),Z(c[o],1,1,(()=>{c[o]=null})),K(),r=c[n],r||(r=c[n]=l[n](t),r.c()),J(r,1),r.m(e,null)),u!==(u=d(t))&&(p.d(1),p=u(t),p&&(p.c(),p.m(i,null)))},i(t){a||(J(r),a=!0)},o(t){Z(r),a=!1},d(t){t&&$(e),c[n].d(),t&&$(s),t&&$(o),p.d()}}}function Ca(t){let e,n,r,s,o,i,a,l,c,h,d;r=new Pn({props:{style:"ghost",size:"large",$$slots:{default:[ga]},$$scope:{ctx:t}}}),r.$on("click",t[7]),o=new Pn({props:{style:"ghost",size:"large",$$slots:{default:[ma]},$$scope:{ctx:t}}}),o.$on("click",t[8]);const u=[wa,$a],p=[];function f(t,e){return t[4]?0:1}return c=f(t),h=p[c]=u[c](t),{c(){e=v("div"),n=v("div"),nt(r.$$.fragment),s=y(),nt(o.$$.fragment),a=y(),l=v("div"),h.c(),C(n,"class","script-selector-container svelte-377oc3"),C(n,"data-tauri-drag-region",i=!!t[0]||void 0),C(l,"class","character-window--content svelte-377oc3"),C(e,"class","character-window-container svelte-377oc3")},m(t,i){m(t,e,i),g(e,n),rt(r,n,null),g(n,s),rt(o,n,null),g(e,a),g(e,l),p[c].m(l,null),d=!0},p(t,[e]){const s={};262146&e&&(s.$$scope={dirty:e,ctx:t}),r.$set(s);const a={};262146&e&&(a.$$scope={dirty:e,ctx:t}),o.$set(a),(!d||1&e&&i!==(i=!!t[0]||void 0))&&C(n,"data-tauri-drag-region",i);let g=c;c=f(t),c===g?p[c].p(t,e):(G(),Z(p[g],1,1,(()=>{p[g]=null})),K(),h=p[c],h?h.p(t,e):(h=p[c]=u[c](t),h.c()),J(h,1),h.m(l,null))},i(t){d||(J(r.$$.fragment,t),J(o.$$.fragment,t),J(h),d=!0)},o(t){Z(r.$$.fragment,t),Z(o.$$.fragment,t),Z(h),d=!1},d(t){t&&$(e),st(r),st(o),p[c].d()}}}fa._loadingManager=null,fa._loadingOptions=null;function za(t,e,n){let r,s=!1;window.__TAURI__.os.platform().then((t=>{n(0,s="darwin"===t)}));let o,i,a=[],l="simplified",c=!1,h=!1,d=!1;const u=()=>window.matchMedia("(prefers-color-scheme: dark)").matches,p=t=>{n(1,l=t),n(2,c=!1),n(3,h=!1),f(r[l])},f=t=>{n(4,d=!1),q().then((()=>{const e=document.getElementById("character-target");e&&(e.innerHTML=""),a=[];for(let e=0;e{fetch(`resources/hanzi-writer-data/data/${t}.json`).then((t=>t.json())).then((t=>{e(t)})).catch((t=>{n(4,d=!0),console.log(t)}))}}),a.push(i);var r}))},g=(t,e)=>{if(e){n(2,c=!0);for(let t=0;t=0&&tg(t+1,!1)})):(n(2,c=!1),n(3,h=!1))},m=()=>{c?(n(3,h=!0),n(2,c=!1),a[o].pauseAnimation()):h?(n(3,h=!1),n(2,c=!0),a[o].resumeAnimation()):g(0,!0)};window.__TAURI__.event.listen("display-characters",(t=>{r=t.payload,f(r[l])})),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",(t=>{f(r[l])}));return[s,l,c,h,d,p,m,()=>p("simplified"),()=>p("traditional"),()=>m()]}class Sa extends it{constructor(t){super(),ot(this,t,za,Ca,i,{})}}let Pa;const Ta=document.getElementById("app"),Ea=document.getElementById("characters");return Ta?Pa=new Qo({target:Ta}):Ea&&(Pa=new Sa({target:Ea})),Pa}(); //# sourceMappingURL=bundle.js.map diff --git a/src/views/templates/build/bundle.js.map b/src/views/templates/build/bundle.js.map index d1011e2f..4b2b21e8 100644 --- a/src/views/templates/build/bundle.js.map +++ b/src/views/templates/build/bundle.js.map @@ -1 +1 @@ -{"version":3,"file":"bundle.js","sources":["../../../../node_modules/svelte/internal/index.mjs","../../../../node_modules/svelte/store/index.mjs","../../../../node_modules/regexparam/dist/index.mjs","../../../../node_modules/svelte-spa-router/Router.svelte","../../../../node_modules/svelte-feather-icons/src/icons/ArrowLeftIcon.svelte","../../../../node_modules/svelte-feather-icons/src/icons/ArrowRightIcon.svelte","../../../../node_modules/svelte-feather-icons/src/icons/BookOpenIcon.svelte","../../../../node_modules/svelte-feather-icons/src/icons/BookmarkIcon.svelte","../../../../node_modules/svelte-feather-icons/src/icons/CheckIcon.svelte","../../../../node_modules/svelte-feather-icons/src/icons/ChevronDownIcon.svelte","../../../../node_modules/svelte-feather-icons/src/icons/ChevronLeftIcon.svelte","../../../../node_modules/svelte-feather-icons/src/icons/ChevronRightIcon.svelte","../../../../node_modules/svelte-feather-icons/src/icons/CopyIcon.svelte","../../../../node_modules/svelte-feather-icons/src/icons/DownloadIcon.svelte","../../../../node_modules/svelte-feather-icons/src/icons/HelpCircleIcon.svelte","../../../../node_modules/svelte-feather-icons/src/icons/Maximize2Icon.svelte","../../../../node_modules/svelte-feather-icons/src/icons/MessageCircleIcon.svelte","../../../../node_modules/svelte-feather-icons/src/icons/MoreVerticalIcon.svelte","../../../../node_modules/svelte-feather-icons/src/icons/PauseIcon.svelte","../../../../node_modules/svelte-feather-icons/src/icons/PlayIcon.svelte","../../../../node_modules/svelte-feather-icons/src/icons/PlusIcon.svelte","../../../../node_modules/svelte-feather-icons/src/icons/RotateCcwIcon.svelte","../../../../node_modules/svelte-feather-icons/src/icons/RotateCwIcon.svelte","../../../../node_modules/svelte-feather-icons/src/icons/SearchIcon.svelte","../../../../node_modules/svelte-feather-icons/src/icons/SettingsIcon.svelte","../../../../node_modules/svelte-feather-icons/src/icons/Trash2Icon.svelte","../../../../node_modules/svelte-feather-icons/src/icons/TrendingUpIcon.svelte","../../../../node_modules/svelte-feather-icons/src/icons/UploadIcon.svelte","../../../../node_modules/svelte-feather-icons/src/icons/XIcon.svelte","../../../../node_modules/svelte-spa-router/active.js","../utils/bookmarkManager.js","../utils/error.js","../utils/preferenceManager.js","../utils/process.js","../../../../node_modules/elastic-scroll-polyfill/dist/esm/elasticScroll.js","../utils/startup.js","../components/Navigation/Navigation.svelte","../components/SyButton/SyButton.svelte","../components/SyButtonBar/SyButtonBar.svelte","../components/SyDropdown/SimpleTextDropdownItem.svelte","../components/SyDropdown/SyDropdown.svelte","../components/SyDropdown/TextWithIconDropdownItem.svelte","../components/SyList/SyListContent.svelte","../components/SyTextInput/SyTextInput.svelte","../components/SyList/SyListPreviewItem.svelte","../components/SyList/SyListPreview.svelte","../components/SyList/SyList.svelte","../components/DictionaryContent/DictionaryLink.svelte","../components/DictionaryContent/DefinitionItem.svelte","../components/DictionaryContent/ChineseCharacters.svelte","../components/DictionaryContent/EntryTopline.svelte","../components/DictionaryContent/MeasureWord.svelte","../components/DictionaryContent/DictionaryContent.svelte","../components/SyDropdown/DividerDropdownItem.svelte","../components/SyModal/SyModal.svelte","../routes/Bookmarks.svelte","../utils/name.js","../routes/Chat.svelte","../routes/Help.svelte","../routes/NotFound.svelte","../routes/Reader.svelte","../routes/Search.svelte","../../../../node_modules/uuid/dist/esm-browser/rng.js","../components/SettingsOption/ToneColorPicker.svelte","../components/SettingsOption/UpdateChecker.svelte","../../../../node_modules/uuid/dist/esm-browser/stringify.js","../../../../node_modules/uuid/dist/esm-browser/native.js","../../../../node_modules/uuid/dist/esm-browser/v4.js","../components/SyToggle/SyToggle.svelte","../routes/Settings.svelte","../components/StudyListItem/StudyListItem.svelte","../routes/Study.svelte","../routes/Tools.svelte","../routes/Study/Flashcards.svelte","../App.svelte","../../../../node_modules/hanzi-writer/dist/index.esm.js","../CharacterWindow.svelte","../app.js"],"sourcesContent":["function noop() { }\nconst identity = x => x;\nfunction assign(tar, src) {\n // @ts-ignore\n for (const k in src)\n tar[k] = src[k];\n return tar;\n}\n// Adapted from https://github.com/then/is-promise/blob/master/index.js\n// Distributed under MIT License https://github.com/then/is-promise/blob/master/LICENSE\nfunction is_promise(value) {\n return !!value && (typeof value === 'object' || typeof value === 'function') && typeof value.then === 'function';\n}\nfunction add_location(element, file, line, column, char) {\n element.__svelte_meta = {\n loc: { file, line, column, char }\n };\n}\nfunction run(fn) {\n return fn();\n}\nfunction blank_object() {\n return Object.create(null);\n}\nfunction run_all(fns) {\n fns.forEach(run);\n}\nfunction is_function(thing) {\n return typeof thing === 'function';\n}\nfunction safe_not_equal(a, b) {\n return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');\n}\nlet src_url_equal_anchor;\nfunction src_url_equal(element_src, url) {\n if (!src_url_equal_anchor) {\n src_url_equal_anchor = document.createElement('a');\n }\n src_url_equal_anchor.href = url;\n return element_src === src_url_equal_anchor.href;\n}\nfunction not_equal(a, b) {\n return a != a ? b == b : a !== b;\n}\nfunction is_empty(obj) {\n return Object.keys(obj).length === 0;\n}\nfunction validate_store(store, name) {\n if (store != null && typeof store.subscribe !== 'function') {\n throw new Error(`'${name}' is not a store with a 'subscribe' method`);\n }\n}\nfunction subscribe(store, ...callbacks) {\n if (store == null) {\n return noop;\n }\n const unsub = store.subscribe(...callbacks);\n return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;\n}\nfunction get_store_value(store) {\n let value;\n subscribe(store, _ => value = _)();\n return value;\n}\nfunction component_subscribe(component, store, callback) {\n component.$$.on_destroy.push(subscribe(store, callback));\n}\nfunction create_slot(definition, ctx, $$scope, fn) {\n if (definition) {\n const slot_ctx = get_slot_context(definition, ctx, $$scope, fn);\n return definition[0](slot_ctx);\n }\n}\nfunction get_slot_context(definition, ctx, $$scope, fn) {\n return definition[1] && fn\n ? assign($$scope.ctx.slice(), definition[1](fn(ctx)))\n : $$scope.ctx;\n}\nfunction get_slot_changes(definition, $$scope, dirty, fn) {\n if (definition[2] && fn) {\n const lets = definition[2](fn(dirty));\n if ($$scope.dirty === undefined) {\n return lets;\n }\n if (typeof lets === 'object') {\n const merged = [];\n const len = Math.max($$scope.dirty.length, lets.length);\n for (let i = 0; i < len; i += 1) {\n merged[i] = $$scope.dirty[i] | lets[i];\n }\n return merged;\n }\n return $$scope.dirty | lets;\n }\n return $$scope.dirty;\n}\nfunction update_slot_base(slot, slot_definition, ctx, $$scope, slot_changes, get_slot_context_fn) {\n if (slot_changes) {\n const slot_context = get_slot_context(slot_definition, ctx, $$scope, get_slot_context_fn);\n slot.p(slot_context, slot_changes);\n }\n}\nfunction update_slot(slot, slot_definition, ctx, $$scope, dirty, get_slot_changes_fn, get_slot_context_fn) {\n const slot_changes = get_slot_changes(slot_definition, $$scope, dirty, get_slot_changes_fn);\n update_slot_base(slot, slot_definition, ctx, $$scope, slot_changes, get_slot_context_fn);\n}\nfunction get_all_dirty_from_scope($$scope) {\n if ($$scope.ctx.length > 32) {\n const dirty = [];\n const length = $$scope.ctx.length / 32;\n for (let i = 0; i < length; i++) {\n dirty[i] = -1;\n }\n return dirty;\n }\n return -1;\n}\nfunction exclude_internal_props(props) {\n const result = {};\n for (const k in props)\n if (k[0] !== '$')\n result[k] = props[k];\n return result;\n}\nfunction compute_rest_props(props, keys) {\n const rest = {};\n keys = new Set(keys);\n for (const k in props)\n if (!keys.has(k) && k[0] !== '$')\n rest[k] = props[k];\n return rest;\n}\nfunction compute_slots(slots) {\n const result = {};\n for (const key in slots) {\n result[key] = true;\n }\n return result;\n}\nfunction once(fn) {\n let ran = false;\n return function (...args) {\n if (ran)\n return;\n ran = true;\n fn.call(this, ...args);\n };\n}\nfunction null_to_empty(value) {\n return value == null ? '' : value;\n}\nfunction set_store_value(store, ret, value) {\n store.set(value);\n return ret;\n}\nconst has_prop = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);\nfunction action_destroyer(action_result) {\n return action_result && is_function(action_result.destroy) ? action_result.destroy : noop;\n}\nfunction split_css_unit(value) {\n const split = typeof value === 'string' && value.match(/^\\s*(-?[\\d.]+)([^\\s]*)\\s*$/);\n return split ? [parseFloat(split[1]), split[2] || 'px'] : [value, 'px'];\n}\nconst contenteditable_truthy_values = ['', true, 1, 'true', 'contenteditable'];\n\nconst is_client = typeof window !== 'undefined';\nlet now = is_client\n ? () => window.performance.now()\n : () => Date.now();\nlet raf = is_client ? cb => requestAnimationFrame(cb) : noop;\n// used internally for testing\nfunction set_now(fn) {\n now = fn;\n}\nfunction set_raf(fn) {\n raf = fn;\n}\n\nconst tasks = new Set();\nfunction run_tasks(now) {\n tasks.forEach(task => {\n if (!task.c(now)) {\n tasks.delete(task);\n task.f();\n }\n });\n if (tasks.size !== 0)\n raf(run_tasks);\n}\n/**\n * For testing purposes only!\n */\nfunction clear_loops() {\n tasks.clear();\n}\n/**\n * Creates a new task that runs on each raf frame\n * until it returns a falsy value or is aborted\n */\nfunction loop(callback) {\n let task;\n if (tasks.size === 0)\n raf(run_tasks);\n return {\n promise: new Promise(fulfill => {\n tasks.add(task = { c: callback, f: fulfill });\n }),\n abort() {\n tasks.delete(task);\n }\n };\n}\n\nconst globals = (typeof window !== 'undefined'\n ? window\n : typeof globalThis !== 'undefined'\n ? globalThis\n : global);\n\n/**\n * Resize observer singleton.\n * One listener per element only!\n * https://groups.google.com/a/chromium.org/g/blink-dev/c/z6ienONUb5A/m/F5-VcUZtBAAJ\n */\nclass ResizeObserverSingleton {\n constructor(options) {\n this.options = options;\n this._listeners = 'WeakMap' in globals ? new WeakMap() : undefined;\n }\n observe(element, listener) {\n this._listeners.set(element, listener);\n this._getObserver().observe(element, this.options);\n return () => {\n this._listeners.delete(element);\n this._observer.unobserve(element); // this line can probably be removed\n };\n }\n _getObserver() {\n var _a;\n return (_a = this._observer) !== null && _a !== void 0 ? _a : (this._observer = new ResizeObserver((entries) => {\n var _a;\n for (const entry of entries) {\n ResizeObserverSingleton.entries.set(entry.target, entry);\n (_a = this._listeners.get(entry.target)) === null || _a === void 0 ? void 0 : _a(entry);\n }\n }));\n }\n}\n// Needs to be written like this to pass the tree-shake-test\nResizeObserverSingleton.entries = 'WeakMap' in globals ? new WeakMap() : undefined;\n\n// Track which nodes are claimed during hydration. Unclaimed nodes can then be removed from the DOM\n// at the end of hydration without touching the remaining nodes.\nlet is_hydrating = false;\nfunction start_hydrating() {\n is_hydrating = true;\n}\nfunction end_hydrating() {\n is_hydrating = false;\n}\nfunction upper_bound(low, high, key, value) {\n // Return first index of value larger than input value in the range [low, high)\n while (low < high) {\n const mid = low + ((high - low) >> 1);\n if (key(mid) <= value) {\n low = mid + 1;\n }\n else {\n high = mid;\n }\n }\n return low;\n}\nfunction init_hydrate(target) {\n if (target.hydrate_init)\n return;\n target.hydrate_init = true;\n // We know that all children have claim_order values since the unclaimed have been detached if target is not \n let children = target.childNodes;\n // If target is , there may be children without claim_order\n if (target.nodeName === 'HEAD') {\n const myChildren = [];\n for (let i = 0; i < children.length; i++) {\n const node = children[i];\n if (node.claim_order !== undefined) {\n myChildren.push(node);\n }\n }\n children = myChildren;\n }\n /*\n * Reorder claimed children optimally.\n * We can reorder claimed children optimally by finding the longest subsequence of\n * nodes that are already claimed in order and only moving the rest. The longest\n * subsequence of nodes that are claimed in order can be found by\n * computing the longest increasing subsequence of .claim_order values.\n *\n * This algorithm is optimal in generating the least amount of reorder operations\n * possible.\n *\n * Proof:\n * We know that, given a set of reordering operations, the nodes that do not move\n * always form an increasing subsequence, since they do not move among each other\n * meaning that they must be already ordered among each other. Thus, the maximal\n * set of nodes that do not move form a longest increasing subsequence.\n */\n // Compute longest increasing subsequence\n // m: subsequence length j => index k of smallest value that ends an increasing subsequence of length j\n const m = new Int32Array(children.length + 1);\n // Predecessor indices + 1\n const p = new Int32Array(children.length);\n m[0] = -1;\n let longest = 0;\n for (let i = 0; i < children.length; i++) {\n const current = children[i].claim_order;\n // Find the largest subsequence length such that it ends in a value less than our current value\n // upper_bound returns first greater value, so we subtract one\n // with fast path for when we are on the current longest subsequence\n const seqLen = ((longest > 0 && children[m[longest]].claim_order <= current) ? longest + 1 : upper_bound(1, longest, idx => children[m[idx]].claim_order, current)) - 1;\n p[i] = m[seqLen] + 1;\n const newLen = seqLen + 1;\n // We can guarantee that current is the smallest value. Otherwise, we would have generated a longer sequence.\n m[newLen] = i;\n longest = Math.max(newLen, longest);\n }\n // The longest increasing subsequence of nodes (initially reversed)\n const lis = [];\n // The rest of the nodes, nodes that will be moved\n const toMove = [];\n let last = children.length - 1;\n for (let cur = m[longest] + 1; cur != 0; cur = p[cur - 1]) {\n lis.push(children[cur - 1]);\n for (; last >= cur; last--) {\n toMove.push(children[last]);\n }\n last--;\n }\n for (; last >= 0; last--) {\n toMove.push(children[last]);\n }\n lis.reverse();\n // We sort the nodes being moved to guarantee that their insertion order matches the claim order\n toMove.sort((a, b) => a.claim_order - b.claim_order);\n // Finally, we move the nodes\n for (let i = 0, j = 0; i < toMove.length; i++) {\n while (j < lis.length && toMove[i].claim_order >= lis[j].claim_order) {\n j++;\n }\n const anchor = j < lis.length ? lis[j] : null;\n target.insertBefore(toMove[i], anchor);\n }\n}\nfunction append(target, node) {\n target.appendChild(node);\n}\nfunction append_styles(target, style_sheet_id, styles) {\n const append_styles_to = get_root_for_style(target);\n if (!append_styles_to.getElementById(style_sheet_id)) {\n const style = element('style');\n style.id = style_sheet_id;\n style.textContent = styles;\n append_stylesheet(append_styles_to, style);\n }\n}\nfunction get_root_for_style(node) {\n if (!node)\n return document;\n const root = node.getRootNode ? node.getRootNode() : node.ownerDocument;\n if (root && root.host) {\n return root;\n }\n return node.ownerDocument;\n}\nfunction append_empty_stylesheet(node) {\n const style_element = element('style');\n append_stylesheet(get_root_for_style(node), style_element);\n return style_element.sheet;\n}\nfunction append_stylesheet(node, style) {\n append(node.head || node, style);\n return style.sheet;\n}\nfunction append_hydration(target, node) {\n if (is_hydrating) {\n init_hydrate(target);\n if ((target.actual_end_child === undefined) || ((target.actual_end_child !== null) && (target.actual_end_child.parentNode !== target))) {\n target.actual_end_child = target.firstChild;\n }\n // Skip nodes of undefined ordering\n while ((target.actual_end_child !== null) && (target.actual_end_child.claim_order === undefined)) {\n target.actual_end_child = target.actual_end_child.nextSibling;\n }\n if (node !== target.actual_end_child) {\n // We only insert if the ordering of this node should be modified or the parent node is not target\n if (node.claim_order !== undefined || node.parentNode !== target) {\n target.insertBefore(node, target.actual_end_child);\n }\n }\n else {\n target.actual_end_child = node.nextSibling;\n }\n }\n else if (node.parentNode !== target || node.nextSibling !== null) {\n target.appendChild(node);\n }\n}\nfunction insert(target, node, anchor) {\n target.insertBefore(node, anchor || null);\n}\nfunction insert_hydration(target, node, anchor) {\n if (is_hydrating && !anchor) {\n append_hydration(target, node);\n }\n else if (node.parentNode !== target || node.nextSibling != anchor) {\n target.insertBefore(node, anchor || null);\n }\n}\nfunction detach(node) {\n if (node.parentNode) {\n node.parentNode.removeChild(node);\n }\n}\nfunction destroy_each(iterations, detaching) {\n for (let i = 0; i < iterations.length; i += 1) {\n if (iterations[i])\n iterations[i].d(detaching);\n }\n}\nfunction element(name) {\n return document.createElement(name);\n}\nfunction element_is(name, is) {\n return document.createElement(name, { is });\n}\nfunction object_without_properties(obj, exclude) {\n const target = {};\n for (const k in obj) {\n if (has_prop(obj, k)\n // @ts-ignore\n && exclude.indexOf(k) === -1) {\n // @ts-ignore\n target[k] = obj[k];\n }\n }\n return target;\n}\nfunction svg_element(name) {\n return document.createElementNS('http://www.w3.org/2000/svg', name);\n}\nfunction text(data) {\n return document.createTextNode(data);\n}\nfunction space() {\n return text(' ');\n}\nfunction empty() {\n return text('');\n}\nfunction comment(content) {\n return document.createComment(content);\n}\nfunction listen(node, event, handler, options) {\n node.addEventListener(event, handler, options);\n return () => node.removeEventListener(event, handler, options);\n}\nfunction prevent_default(fn) {\n return function (event) {\n event.preventDefault();\n // @ts-ignore\n return fn.call(this, event);\n };\n}\nfunction stop_propagation(fn) {\n return function (event) {\n event.stopPropagation();\n // @ts-ignore\n return fn.call(this, event);\n };\n}\nfunction stop_immediate_propagation(fn) {\n return function (event) {\n event.stopImmediatePropagation();\n // @ts-ignore\n return fn.call(this, event);\n };\n}\nfunction self(fn) {\n return function (event) {\n // @ts-ignore\n if (event.target === this)\n fn.call(this, event);\n };\n}\nfunction trusted(fn) {\n return function (event) {\n // @ts-ignore\n if (event.isTrusted)\n fn.call(this, event);\n };\n}\nfunction attr(node, attribute, value) {\n if (value == null)\n node.removeAttribute(attribute);\n else if (node.getAttribute(attribute) !== value)\n node.setAttribute(attribute, value);\n}\n/**\n * List of attributes that should always be set through the attr method,\n * because updating them through the property setter doesn't work reliably.\n * In the example of `width`/`height`, the problem is that the setter only\n * accepts numeric values, but the attribute can also be set to a string like `50%`.\n * If this list becomes too big, rethink this approach.\n */\nconst always_set_through_set_attribute = ['width', 'height'];\nfunction set_attributes(node, attributes) {\n // @ts-ignore\n const descriptors = Object.getOwnPropertyDescriptors(node.__proto__);\n for (const key in attributes) {\n if (attributes[key] == null) {\n node.removeAttribute(key);\n }\n else if (key === 'style') {\n node.style.cssText = attributes[key];\n }\n else if (key === '__value') {\n node.value = node[key] = attributes[key];\n }\n else if (descriptors[key] && descriptors[key].set && always_set_through_set_attribute.indexOf(key) === -1) {\n node[key] = attributes[key];\n }\n else {\n attr(node, key, attributes[key]);\n }\n }\n}\nfunction set_svg_attributes(node, attributes) {\n for (const key in attributes) {\n attr(node, key, attributes[key]);\n }\n}\nfunction set_custom_element_data_map(node, data_map) {\n Object.keys(data_map).forEach((key) => {\n set_custom_element_data(node, key, data_map[key]);\n });\n}\nfunction set_custom_element_data(node, prop, value) {\n if (prop in node) {\n node[prop] = typeof node[prop] === 'boolean' && value === '' ? true : value;\n }\n else {\n attr(node, prop, value);\n }\n}\nfunction set_dynamic_element_data(tag) {\n return (/-/.test(tag)) ? set_custom_element_data_map : set_attributes;\n}\nfunction xlink_attr(node, attribute, value) {\n node.setAttributeNS('http://www.w3.org/1999/xlink', attribute, value);\n}\nfunction get_binding_group_value(group, __value, checked) {\n const value = new Set();\n for (let i = 0; i < group.length; i += 1) {\n if (group[i].checked)\n value.add(group[i].__value);\n }\n if (!checked) {\n value.delete(__value);\n }\n return Array.from(value);\n}\nfunction init_binding_group(group) {\n let _inputs;\n return {\n /* push */ p(...inputs) {\n _inputs = inputs;\n _inputs.forEach(input => group.push(input));\n },\n /* remove */ r() {\n _inputs.forEach(input => group.splice(group.indexOf(input), 1));\n }\n };\n}\nfunction init_binding_group_dynamic(group, indexes) {\n let _group = get_binding_group(group);\n let _inputs;\n function get_binding_group(group) {\n for (let i = 0; i < indexes.length; i++) {\n group = group[indexes[i]] = group[indexes[i]] || [];\n }\n return group;\n }\n function push() {\n _inputs.forEach(input => _group.push(input));\n }\n function remove() {\n _inputs.forEach(input => _group.splice(_group.indexOf(input), 1));\n }\n return {\n /* update */ u(new_indexes) {\n indexes = new_indexes;\n const new_group = get_binding_group(group);\n if (new_group !== _group) {\n remove();\n _group = new_group;\n push();\n }\n },\n /* push */ p(...inputs) {\n _inputs = inputs;\n push();\n },\n /* remove */ r: remove\n };\n}\nfunction to_number(value) {\n return value === '' ? null : +value;\n}\nfunction time_ranges_to_array(ranges) {\n const array = [];\n for (let i = 0; i < ranges.length; i += 1) {\n array.push({ start: ranges.start(i), end: ranges.end(i) });\n }\n return array;\n}\nfunction children(element) {\n return Array.from(element.childNodes);\n}\nfunction init_claim_info(nodes) {\n if (nodes.claim_info === undefined) {\n nodes.claim_info = { last_index: 0, total_claimed: 0 };\n }\n}\nfunction claim_node(nodes, predicate, processNode, createNode, dontUpdateLastIndex = false) {\n // Try to find nodes in an order such that we lengthen the longest increasing subsequence\n init_claim_info(nodes);\n const resultNode = (() => {\n // We first try to find an element after the previous one\n for (let i = nodes.claim_info.last_index; i < nodes.length; i++) {\n const node = nodes[i];\n if (predicate(node)) {\n const replacement = processNode(node);\n if (replacement === undefined) {\n nodes.splice(i, 1);\n }\n else {\n nodes[i] = replacement;\n }\n if (!dontUpdateLastIndex) {\n nodes.claim_info.last_index = i;\n }\n return node;\n }\n }\n // Otherwise, we try to find one before\n // We iterate in reverse so that we don't go too far back\n for (let i = nodes.claim_info.last_index - 1; i >= 0; i--) {\n const node = nodes[i];\n if (predicate(node)) {\n const replacement = processNode(node);\n if (replacement === undefined) {\n nodes.splice(i, 1);\n }\n else {\n nodes[i] = replacement;\n }\n if (!dontUpdateLastIndex) {\n nodes.claim_info.last_index = i;\n }\n else if (replacement === undefined) {\n // Since we spliced before the last_index, we decrease it\n nodes.claim_info.last_index--;\n }\n return node;\n }\n }\n // If we can't find any matching node, we create a new one\n return createNode();\n })();\n resultNode.claim_order = nodes.claim_info.total_claimed;\n nodes.claim_info.total_claimed += 1;\n return resultNode;\n}\nfunction claim_element_base(nodes, name, attributes, create_element) {\n return claim_node(nodes, (node) => node.nodeName === name, (node) => {\n const remove = [];\n for (let j = 0; j < node.attributes.length; j++) {\n const attribute = node.attributes[j];\n if (!attributes[attribute.name]) {\n remove.push(attribute.name);\n }\n }\n remove.forEach(v => node.removeAttribute(v));\n return undefined;\n }, () => create_element(name));\n}\nfunction claim_element(nodes, name, attributes) {\n return claim_element_base(nodes, name, attributes, element);\n}\nfunction claim_svg_element(nodes, name, attributes) {\n return claim_element_base(nodes, name, attributes, svg_element);\n}\nfunction claim_text(nodes, data) {\n return claim_node(nodes, (node) => node.nodeType === 3, (node) => {\n const dataStr = '' + data;\n if (node.data.startsWith(dataStr)) {\n if (node.data.length !== dataStr.length) {\n return node.splitText(dataStr.length);\n }\n }\n else {\n node.data = dataStr;\n }\n }, () => text(data), true // Text nodes should not update last index since it is likely not worth it to eliminate an increasing subsequence of actual elements\n );\n}\nfunction claim_space(nodes) {\n return claim_text(nodes, ' ');\n}\nfunction claim_comment(nodes, data) {\n return claim_node(nodes, (node) => node.nodeType === 8, (node) => {\n node.data = '' + data;\n return undefined;\n }, () => comment(data), true);\n}\nfunction find_comment(nodes, text, start) {\n for (let i = start; i < nodes.length; i += 1) {\n const node = nodes[i];\n if (node.nodeType === 8 /* comment node */ && node.textContent.trim() === text) {\n return i;\n }\n }\n return nodes.length;\n}\nfunction claim_html_tag(nodes, is_svg) {\n // find html opening tag\n const start_index = find_comment(nodes, 'HTML_TAG_START', 0);\n const end_index = find_comment(nodes, 'HTML_TAG_END', start_index);\n if (start_index === end_index) {\n return new HtmlTagHydration(undefined, is_svg);\n }\n init_claim_info(nodes);\n const html_tag_nodes = nodes.splice(start_index, end_index - start_index + 1);\n detach(html_tag_nodes[0]);\n detach(html_tag_nodes[html_tag_nodes.length - 1]);\n const claimed_nodes = html_tag_nodes.slice(1, html_tag_nodes.length - 1);\n for (const n of claimed_nodes) {\n n.claim_order = nodes.claim_info.total_claimed;\n nodes.claim_info.total_claimed += 1;\n }\n return new HtmlTagHydration(claimed_nodes, is_svg);\n}\nfunction set_data(text, data) {\n data = '' + data;\n if (text.data === data)\n return;\n text.data = data;\n}\nfunction set_data_contenteditable(text, data) {\n data = '' + data;\n if (text.wholeText === data)\n return;\n text.data = data;\n}\nfunction set_data_maybe_contenteditable(text, data, attr_value) {\n if (~contenteditable_truthy_values.indexOf(attr_value)) {\n set_data_contenteditable(text, data);\n }\n else {\n set_data(text, data);\n }\n}\nfunction set_input_value(input, value) {\n input.value = value == null ? '' : value;\n}\nfunction set_input_type(input, type) {\n try {\n input.type = type;\n }\n catch (e) {\n // do nothing\n }\n}\nfunction set_style(node, key, value, important) {\n if (value == null) {\n node.style.removeProperty(key);\n }\n else {\n node.style.setProperty(key, value, important ? 'important' : '');\n }\n}\nfunction select_option(select, value, mounting) {\n for (let i = 0; i < select.options.length; i += 1) {\n const option = select.options[i];\n if (option.__value === value) {\n option.selected = true;\n return;\n }\n }\n if (!mounting || value !== undefined) {\n select.selectedIndex = -1; // no option should be selected\n }\n}\nfunction select_options(select, value) {\n for (let i = 0; i < select.options.length; i += 1) {\n const option = select.options[i];\n option.selected = ~value.indexOf(option.__value);\n }\n}\nfunction select_value(select) {\n const selected_option = select.querySelector(':checked');\n return selected_option && selected_option.__value;\n}\nfunction select_multiple_value(select) {\n return [].map.call(select.querySelectorAll(':checked'), option => option.__value);\n}\n// unfortunately this can't be a constant as that wouldn't be tree-shakeable\n// so we cache the result instead\nlet crossorigin;\nfunction is_crossorigin() {\n if (crossorigin === undefined) {\n crossorigin = false;\n try {\n if (typeof window !== 'undefined' && window.parent) {\n void window.parent.document;\n }\n }\n catch (error) {\n crossorigin = true;\n }\n }\n return crossorigin;\n}\nfunction add_iframe_resize_listener(node, fn) {\n const computed_style = getComputedStyle(node);\n if (computed_style.position === 'static') {\n node.style.position = 'relative';\n }\n const iframe = element('iframe');\n iframe.setAttribute('style', 'display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; ' +\n 'overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;');\n iframe.setAttribute('aria-hidden', 'true');\n iframe.tabIndex = -1;\n const crossorigin = is_crossorigin();\n let unsubscribe;\n if (crossorigin) {\n iframe.src = \"data:text/html,\";\n unsubscribe = listen(window, 'message', (event) => {\n if (event.source === iframe.contentWindow)\n fn();\n });\n }\n else {\n iframe.src = 'about:blank';\n iframe.onload = () => {\n unsubscribe = listen(iframe.contentWindow, 'resize', fn);\n // make sure an initial resize event is fired _after_ the iframe is loaded (which is asynchronous)\n // see https://github.com/sveltejs/svelte/issues/4233\n fn();\n };\n }\n append(node, iframe);\n return () => {\n if (crossorigin) {\n unsubscribe();\n }\n else if (unsubscribe && iframe.contentWindow) {\n unsubscribe();\n }\n detach(iframe);\n };\n}\nconst resize_observer_content_box = /* @__PURE__ */ new ResizeObserverSingleton({ box: 'content-box' });\nconst resize_observer_border_box = /* @__PURE__ */ new ResizeObserverSingleton({ box: 'border-box' });\nconst resize_observer_device_pixel_content_box = /* @__PURE__ */ new ResizeObserverSingleton({ box: 'device-pixel-content-box' });\nfunction toggle_class(element, name, toggle) {\n element.classList[toggle ? 'add' : 'remove'](name);\n}\nfunction custom_event(type, detail, { bubbles = false, cancelable = false } = {}) {\n const e = document.createEvent('CustomEvent');\n e.initCustomEvent(type, bubbles, cancelable, detail);\n return e;\n}\nfunction query_selector_all(selector, parent = document.body) {\n return Array.from(parent.querySelectorAll(selector));\n}\nfunction head_selector(nodeId, head) {\n const result = [];\n let started = 0;\n for (const node of head.childNodes) {\n if (node.nodeType === 8 /* comment node */) {\n const comment = node.textContent.trim();\n if (comment === `HEAD_${nodeId}_END`) {\n started -= 1;\n result.push(node);\n }\n else if (comment === `HEAD_${nodeId}_START`) {\n started += 1;\n result.push(node);\n }\n }\n else if (started > 0) {\n result.push(node);\n }\n }\n return result;\n}\nclass HtmlTag {\n constructor(is_svg = false) {\n this.is_svg = false;\n this.is_svg = is_svg;\n this.e = this.n = null;\n }\n c(html) {\n this.h(html);\n }\n m(html, target, anchor = null) {\n if (!this.e) {\n if (this.is_svg)\n this.e = svg_element(target.nodeName);\n /** #7364 target for