import { legacy_mode_flag } from "./chunk-EXIRPMAV.js"; // node_modules/esm-env/browser-dev.js var BROWSER = true; var DEV = true; // node_modules/svelte/src/internal/shared/utils.js var is_array = Array.isArray; var array_from = Array.from; var object_keys = Object.keys; var define_property = Object.defineProperty; var get_descriptor = Object.getOwnPropertyDescriptor; var get_descriptors = Object.getOwnPropertyDescriptors; var object_prototype = Object.prototype; var array_prototype = Array.prototype; var get_prototype_of = Object.getPrototypeOf; function is_function(thing) { return typeof thing === "function"; } var noop = () => { }; function is_promise(value) { return typeof (value == null ? void 0 : value.then) === "function"; } function run(fn) { return fn(); } function run_all(arr) { for (var i = 0; i < arr.length; i++) { arr[i](); } } function fallback(value, fallback2, lazy = false) { return value === void 0 ? lazy ? ( /** @type {() => V} */ fallback2() ) : ( /** @type {V} */ fallback2 ) : value; } // node_modules/svelte/src/internal/client/constants.js var DERIVED = 1 << 1; var EFFECT = 1 << 2; var RENDER_EFFECT = 1 << 3; var BLOCK_EFFECT = 1 << 4; var BRANCH_EFFECT = 1 << 5; var ROOT_EFFECT = 1 << 6; var UNOWNED = 1 << 7; var DISCONNECTED = 1 << 8; var CLEAN = 1 << 9; var DIRTY = 1 << 10; var MAYBE_DIRTY = 1 << 11; var INERT = 1 << 12; var DESTROYED = 1 << 13; var EFFECT_RAN = 1 << 14; var EFFECT_TRANSPARENT = 1 << 15; var LEGACY_DERIVED_PROP = 1 << 16; var INSPECT_EFFECT = 1 << 17; var HEAD_EFFECT = 1 << 18; var EFFECT_HAS_DERIVED = 1 << 19; var STATE_SYMBOL = Symbol("$state"); var STATE_SYMBOL_METADATA = Symbol("$state metadata"); var LEGACY_PROPS = Symbol("legacy props"); var LOADING_ATTR_SYMBOL = Symbol(""); // node_modules/svelte/src/internal/client/errors.js function bind_invalid_checkbox_value() { if (DEV) { const error = new Error(`bind_invalid_checkbox_value Using \`bind:value\` together with a checkbox input is not allowed. Use \`bind:checked\` instead`); error.name = "Svelte error"; throw error; } else { throw new Error("bind_invalid_checkbox_value"); } } function bind_invalid_export(component, key, name) { if (DEV) { const error = new Error(`bind_invalid_export Component ${component} has an export named \`${key}\` that a consumer component is trying to access using \`bind:${key}\`, which is disallowed. Instead, use \`bind:this\` (e.g. \`<${name} bind:this={component} />\`) and then access the property on the bound component instance (e.g. \`component.${key}\`)`); error.name = "Svelte error"; throw error; } else { throw new Error("bind_invalid_export"); } } function bind_not_bindable(key, component, name) { if (DEV) { const error = new Error(`bind_not_bindable A component is attempting to bind to a non-bindable property \`${key}\` belonging to ${component} (i.e. \`<${name} bind:${key}={...}>\`). To mark a property as bindable: \`let { ${key} = $bindable() } = $props()\``); error.name = "Svelte error"; throw error; } else { throw new Error("bind_not_bindable"); } } function component_api_changed(parent, method, component) { if (DEV) { const error = new Error(`component_api_changed ${parent} called \`${method}\` on an instance of ${component}, which is no longer valid in Svelte 5. See https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes for more information`); error.name = "Svelte error"; throw error; } else { throw new Error("component_api_changed"); } } function component_api_invalid_new(component, name) { if (DEV) { const error = new Error(`component_api_invalid_new Attempted to instantiate ${component} with \`new ${name}\`, which is no longer valid in Svelte 5. If this component is not under your control, set the \`compatibility.componentApi\` compiler option to \`4\` to keep it working. See https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes for more information`); error.name = "Svelte error"; throw error; } else { throw new Error("component_api_invalid_new"); } } function derived_references_self() { if (DEV) { const error = new Error(`derived_references_self A derived value cannot reference itself recursively`); error.name = "Svelte error"; throw error; } else { throw new Error("derived_references_self"); } } function each_key_duplicate(a, b, value) { if (DEV) { const error = new Error(`each_key_duplicate ${value ? `Keyed each block has duplicate key \`${value}\` at indexes ${a} and ${b}` : `Keyed each block has duplicate key at indexes ${a} and ${b}`}`); error.name = "Svelte error"; throw error; } else { throw new Error("each_key_duplicate"); } } function effect_in_teardown(rune) { if (DEV) { const error = new Error(`effect_in_teardown \`${rune}\` cannot be used inside an effect cleanup function`); error.name = "Svelte error"; throw error; } else { throw new Error("effect_in_teardown"); } } function effect_in_unowned_derived() { if (DEV) { const error = new Error(`effect_in_unowned_derived Effect cannot be created inside a \`$derived\` value that was not itself created inside an effect`); error.name = "Svelte error"; throw error; } else { throw new Error("effect_in_unowned_derived"); } } function effect_orphan(rune) { if (DEV) { const error = new Error(`effect_orphan \`${rune}\` can only be used inside an effect (e.g. during component initialisation)`); error.name = "Svelte error"; throw error; } else { throw new Error("effect_orphan"); } } function effect_update_depth_exceeded() { if (DEV) { const error = new Error(`effect_update_depth_exceeded Maximum update depth exceeded. This can happen when a reactive block or effect repeatedly sets a new value. Svelte limits the number of nested updates to prevent infinite loops`); error.name = "Svelte error"; throw error; } else { throw new Error("effect_update_depth_exceeded"); } } function hydration_failed() { if (DEV) { const error = new Error(`hydration_failed Failed to hydrate the application`); error.name = "Svelte error"; throw error; } else { throw new Error("hydration_failed"); } } function invalid_snippet() { if (DEV) { const error = new Error(`invalid_snippet Could not \`{@render}\` snippet due to the expression being \`null\` or \`undefined\`. Consider using optional chaining \`{@render snippet?.()}\``); error.name = "Svelte error"; throw error; } else { throw new Error("invalid_snippet"); } } function lifecycle_legacy_only(name) { if (DEV) { const error = new Error(`lifecycle_legacy_only \`${name}(...)\` cannot be used in runes mode`); error.name = "Svelte error"; throw error; } else { throw new Error("lifecycle_legacy_only"); } } function props_invalid_value(key) { if (DEV) { const error = new Error(`props_invalid_value Cannot do \`bind:${key}={undefined}\` when \`${key}\` has a fallback value`); error.name = "Svelte error"; throw error; } else { throw new Error("props_invalid_value"); } } function props_rest_readonly(property) { if (DEV) { const error = new Error(`props_rest_readonly Rest element properties of \`$props()\` such as \`${property}\` are readonly`); error.name = "Svelte error"; throw error; } else { throw new Error("props_rest_readonly"); } } function rune_outside_svelte(rune) { if (DEV) { const error = new Error(`rune_outside_svelte The \`${rune}\` rune is only available inside \`.svelte\` and \`.svelte.js/ts\` files`); error.name = "Svelte error"; throw error; } else { throw new Error("rune_outside_svelte"); } } function state_descriptors_fixed() { if (DEV) { const error = new Error(`state_descriptors_fixed Property descriptors defined on \`$state\` objects must contain \`value\` and always be \`enumerable\`, \`configurable\` and \`writable\`.`); error.name = "Svelte error"; throw error; } else { throw new Error("state_descriptors_fixed"); } } function state_prototype_fixed() { if (DEV) { const error = new Error(`state_prototype_fixed Cannot set prototype of \`$state\` object`); error.name = "Svelte error"; throw error; } else { throw new Error("state_prototype_fixed"); } } function state_unsafe_local_read() { if (DEV) { const error = new Error(`state_unsafe_local_read Reading state that was created inside the same derived is forbidden. Consider using \`untrack\` to read locally created state`); error.name = "Svelte error"; throw error; } else { throw new Error("state_unsafe_local_read"); } } function state_unsafe_mutation() { if (DEV) { const error = new Error(`state_unsafe_mutation Updating state inside a derived or a template expression is forbidden. If the value should not be reactive, declare it without \`$state\``); error.name = "Svelte error"; throw error; } else { throw new Error("state_unsafe_mutation"); } } // node_modules/svelte/src/constants.js var EACH_ITEM_REACTIVE = 1; var EACH_INDEX_REACTIVE = 1 << 1; var EACH_IS_CONTROLLED = 1 << 2; var EACH_IS_ANIMATED = 1 << 3; var EACH_ITEM_IMMUTABLE = 1 << 4; var PROPS_IS_IMMUTABLE = 1; var PROPS_IS_RUNES = 1 << 1; var PROPS_IS_UPDATED = 1 << 2; var PROPS_IS_BINDABLE = 1 << 3; var PROPS_IS_LAZY_INITIAL = 1 << 4; var TRANSITION_IN = 1; var TRANSITION_OUT = 1 << 1; var TRANSITION_GLOBAL = 1 << 2; var TEMPLATE_FRAGMENT = 1; var TEMPLATE_USE_IMPORT_NODE = 1 << 1; var HYDRATION_START = "["; var HYDRATION_START_ELSE = "[!"; var HYDRATION_END = "]"; var HYDRATION_ERROR = {}; var ELEMENT_PRESERVE_ATTRIBUTE_CASE = 1 << 1; var UNINITIALIZED = Symbol(); var FILENAME = Symbol("filename"); var HMR = Symbol("hmr"); var NAMESPACE_SVG = "http://www.w3.org/2000/svg"; // node_modules/svelte/src/internal/client/warnings.js var bold = "font-weight: bold"; var normal = "font-weight: normal"; function binding_property_non_reactive(binding, location) { if (DEV) { console.warn(`%c[svelte] binding_property_non_reactive %c${location ? `\`${binding}\` (${location}) is binding to a non-reactive property` : `\`${binding}\` is binding to a non-reactive property`}`, bold, normal); } else { console.warn("binding_property_non_reactive"); } } function console_log_state(method) { if (DEV) { console.warn(`%c[svelte] console_log_state %cYour \`console.${method}\` contained \`$state\` proxies. Consider using \`$inspect(...)\` or \`$state.snapshot(...)\` instead`, bold, normal); } else { console.warn("console_log_state"); } } function event_handler_invalid(handler, suggestion) { if (DEV) { console.warn(`%c[svelte] event_handler_invalid %c${handler} should be a function. Did you mean to ${suggestion}?`, bold, normal); } else { console.warn("event_handler_invalid"); } } function hydration_attribute_changed(attribute, html, value) { if (DEV) { console.warn(`%c[svelte] hydration_attribute_changed %cThe \`${attribute}\` attribute on \`${html}\` changed its value between server and client renders. The client value, \`${value}\`, will be ignored in favour of the server value`, bold, normal); } else { console.warn("hydration_attribute_changed"); } } function hydration_html_changed(location) { if (DEV) { console.warn(`%c[svelte] hydration_html_changed %c${location ? `The value of an \`{@html ...}\` block ${location} changed between server and client renders. The client value will be ignored in favour of the server value` : "The value of an `{@html ...}` block changed between server and client renders. The client value will be ignored in favour of the server value"}`, bold, normal); } else { console.warn("hydration_html_changed"); } } function hydration_mismatch(location) { if (DEV) { console.warn(`%c[svelte] hydration_mismatch %c${location ? `Hydration failed because the initial UI does not match what was rendered on the server. The error occurred near ${location}` : "Hydration failed because the initial UI does not match what was rendered on the server"}`, bold, normal); } else { console.warn("hydration_mismatch"); } } function invalid_raw_snippet_render() { if (DEV) { console.warn(`%c[svelte] invalid_raw_snippet_render %cThe \`render\` function passed to \`createRawSnippet\` should return HTML for a single element`, bold, normal); } else { console.warn("invalid_raw_snippet_render"); } } function legacy_recursive_reactive_block(filename) { if (DEV) { console.warn(`%c[svelte] legacy_recursive_reactive_block %cDetected a migrated \`$:\` reactive block in \`${filename}\` that both accesses and updates the same reactive value. This may cause recursive updates when converted to an \`$effect\`.`, bold, normal); } else { console.warn("legacy_recursive_reactive_block"); } } function lifecycle_double_unmount() { if (DEV) { console.warn(`%c[svelte] lifecycle_double_unmount %cTried to unmount a component that was not mounted`, bold, normal); } else { console.warn("lifecycle_double_unmount"); } } function ownership_invalid_binding(parent, child2, owner) { if (DEV) { console.warn(`%c[svelte] ownership_invalid_binding %c${parent} passed a value to ${child2} with \`bind:\`, but the value is owned by ${owner}. Consider creating a binding between ${owner} and ${parent}`, bold, normal); } else { console.warn("ownership_invalid_binding"); } } function ownership_invalid_mutation(component, owner) { if (DEV) { console.warn(`%c[svelte] ownership_invalid_mutation %c${component ? `${component} mutated a value owned by ${owner}. This is strongly discouraged. Consider passing values to child components with \`bind:\`, or use a callback instead` : "Mutating a value outside the component that created it is strongly discouraged. Consider passing values to child components with `bind:`, or use a callback instead"}`, bold, normal); } else { console.warn("ownership_invalid_mutation"); } } function state_proxy_equality_mismatch(operator) { if (DEV) { console.warn(`%c[svelte] state_proxy_equality_mismatch %cReactive \`$state(...)\` proxies and the values they proxy have different identities. Because of this, comparisons with \`${operator}\` will produce unexpected results`, bold, normal); } else { console.warn("state_proxy_equality_mismatch"); } } // node_modules/svelte/src/internal/client/dom/hydration.js var hydrating = false; function set_hydrating(value) { hydrating = value; } var hydrate_node; function set_hydrate_node(node) { if (node === null) { hydration_mismatch(); throw HYDRATION_ERROR; } return hydrate_node = node; } function hydrate_next() { return set_hydrate_node( /** @type {TemplateNode} */ get_next_sibling(hydrate_node) ); } function reset(node) { if (!hydrating) return; if (get_next_sibling(hydrate_node) !== null) { hydration_mismatch(); throw HYDRATION_ERROR; } hydrate_node = node; } function hydrate_template(template) { if (hydrating) { hydrate_node = template.content; } } function next(count = 1) { if (hydrating) { var i = count; var node = hydrate_node; while (i--) { node = /** @type {TemplateNode} */ get_next_sibling(node); } hydrate_node = node; } } function remove_nodes() { var depth = 0; var node = hydrate_node; while (true) { if (node.nodeType === 8) { var data = ( /** @type {Comment} */ node.data ); if (data === HYDRATION_END) { if (depth === 0) return node; depth -= 1; } else if (data === HYDRATION_START || data === HYDRATION_START_ELSE) { depth += 1; } } var next2 = ( /** @type {TemplateNode} */ get_next_sibling(node) ); node.remove(); node = next2; } } // node_modules/svelte/src/internal/client/dev/ownership.js var boundaries = {}; var chrome_pattern = /at (?:.+ \()?(.+):(\d+):(\d+)\)?$/; var firefox_pattern = /@(.+):(\d+):(\d+)$/; function get_stack() { const stack2 = new Error().stack; if (!stack2) return null; const entries = []; for (const line of stack2.split("\n")) { let match = chrome_pattern.exec(line) ?? firefox_pattern.exec(line); if (match) { entries.push({ file: match[1], line: +match[2], column: +match[3] }); } } return entries; } function get_component() { var _a; const stack2 = (_a = get_stack()) == null ? void 0 : _a.slice(4); if (!stack2) return null; for (let i = 0; i < stack2.length; i++) { const entry = stack2[i]; const modules = boundaries[entry.file]; if (!modules) { if (i === 0) return null; continue; } for (const module of modules) { if (module.end == null) { return null; } if (module.start.line < entry.line && module.end.line > entry.line) { return module.component; } } } return null; } var ADD_OWNER = Symbol("ADD_OWNER"); function mark_module_start() { var _a, _b; const start = (_a = get_stack()) == null ? void 0 : _a[2]; if (start) { (boundaries[_b = start.file] ?? (boundaries[_b] = [])).push({ start, // @ts-expect-error end: null, // @ts-expect-error we add the component at the end, since HMR will overwrite the function component: null }); } } function mark_module_end(component) { var _a; const end = (_a = get_stack()) == null ? void 0 : _a[2]; if (end) { const boundaries_file = boundaries[end.file]; const boundary = boundaries_file[boundaries_file.length - 1]; boundary.end = end; boundary.component = component; } } function add_owner(object, owner, global = false, skip_warning = false) { if (object && !global) { const component = dev_current_component_function; const metadata = object[STATE_SYMBOL_METADATA]; if (metadata && !has_owner(metadata, component)) { let original = get_owner(metadata); if (owner[FILENAME] !== component[FILENAME] && !skip_warning) { ownership_invalid_binding(component[FILENAME], owner[FILENAME], original[FILENAME]); } } } add_owner_to_object(object, owner, /* @__PURE__ */ new Set()); } function add_owner_effect(get_object, Component, skip_warning = false) { user_pre_effect(() => { add_owner(get_object(), Component, false, skip_warning); }); } function widen_ownership(from, to) { if (to.owners === null) { return; } while (from) { if (from.owners === null) { to.owners = null; break; } for (const owner of from.owners) { to.owners.add(owner); } from = from.parent; } } function add_owner_to_object(object, owner, seen) { const metadata = ( /** @type {ProxyMetadata} */ object == null ? void 0 : object[STATE_SYMBOL_METADATA] ); if (metadata) { if ("owners" in metadata && metadata.owners != null) { metadata.owners.add(owner); } } else if (object && typeof object === "object") { if (seen.has(object)) return; seen.add(object); if (ADD_OWNER in object && object[ADD_OWNER]) { render_effect(() => { object[ADD_OWNER](owner); }); } else { var proto = get_prototype_of(object); if (proto === Object.prototype) { for (const key in object) { add_owner_to_object(object[key], owner, seen); } } else if (proto === Array.prototype) { for (let i = 0; i < object.length; i += 1) { add_owner_to_object(object[i], owner, seen); } } } } } function has_owner(metadata, component) { if (metadata.owners === null) { return true; } return metadata.owners.has(component) || metadata.parent !== null && has_owner(metadata.parent, component); } function get_owner(metadata) { var _a; return ((_a = metadata == null ? void 0 : metadata.owners) == null ? void 0 : _a.values().next().value) ?? get_owner( /** @type {ProxyMetadata} */ metadata.parent ); } var skip = false; function skip_ownership_validation(fn) { skip = true; fn(); skip = false; } function check_ownership(metadata) { if (skip) return; const component = get_component(); if (component && !has_owner(metadata, component)) { let original = get_owner(metadata); if (original[FILENAME] !== component[FILENAME]) { ownership_invalid_mutation(component[FILENAME], original[FILENAME]); } else { ownership_invalid_mutation(); } } } // node_modules/svelte/src/internal/client/proxy.js function proxy(value, parent = null, prev) { var _a, _b; if (typeof value !== "object" || value === null || STATE_SYMBOL in value) { return value; } const prototype = get_prototype_of(value); if (prototype !== object_prototype && prototype !== array_prototype) { return value; } var sources = /* @__PURE__ */ new Map(); var is_proxied_array = is_array(value); var version = source(0); if (is_proxied_array) { sources.set("length", source( /** @type {any[]} */ value.length )); } var metadata; if (DEV) { metadata = { parent, owners: null }; if (prev) { const prev_owners = (_b = (_a = prev.v) == null ? void 0 : _a[STATE_SYMBOL_METADATA]) == null ? void 0 : _b.owners; metadata.owners = prev_owners ? new Set(prev_owners) : null; } else { metadata.owners = parent === null ? component_context !== null ? /* @__PURE__ */ new Set([component_context.function]) : null : /* @__PURE__ */ new Set(); } } return new Proxy( /** @type {any} */ value, { defineProperty(_, prop, descriptor) { if (!("value" in descriptor) || descriptor.configurable === false || descriptor.enumerable === false || descriptor.writable === false) { state_descriptors_fixed(); } var s = sources.get(prop); if (s === void 0) { s = source(descriptor.value); sources.set(prop, s); } else { set(s, proxy(descriptor.value, metadata)); } return true; }, deleteProperty(target, prop) { var s = sources.get(prop); if (s === void 0) { if (prop in target) { sources.set(prop, source(UNINITIALIZED)); } } else { if (is_proxied_array && typeof prop === "string") { var ls = ( /** @type {Source} */ sources.get("length") ); var n = Number(prop); if (Number.isInteger(n) && n < ls.v) { set(ls, n); } } set(s, UNINITIALIZED); update_version(version); } return true; }, get(target, prop, receiver) { var _a2; if (DEV && prop === STATE_SYMBOL_METADATA) { return metadata; } if (prop === STATE_SYMBOL) { return value; } var s = sources.get(prop); var exists = prop in target; if (s === void 0 && (!exists || ((_a2 = get_descriptor(target, prop)) == null ? void 0 : _a2.writable))) { s = source(proxy(exists ? target[prop] : UNINITIALIZED, metadata)); sources.set(prop, s); } if (s !== void 0) { var v = get(s); if (DEV) { var prop_metadata = v == null ? void 0 : v[STATE_SYMBOL_METADATA]; if (prop_metadata && (prop_metadata == null ? void 0 : prop_metadata.parent) !== metadata) { widen_ownership(metadata, prop_metadata); } } return v === UNINITIALIZED ? void 0 : v; } return Reflect.get(target, prop, receiver); }, getOwnPropertyDescriptor(target, prop) { var descriptor = Reflect.getOwnPropertyDescriptor(target, prop); if (descriptor && "value" in descriptor) { var s = sources.get(prop); if (s) descriptor.value = get(s); } else if (descriptor === void 0) { var source2 = sources.get(prop); var value2 = source2 == null ? void 0 : source2.v; if (source2 !== void 0 && value2 !== UNINITIALIZED) { return { enumerable: true, configurable: true, value: value2, writable: true }; } } return descriptor; }, has(target, prop) { var _a2; if (DEV && prop === STATE_SYMBOL_METADATA) { return true; } if (prop === STATE_SYMBOL) { return true; } var s = sources.get(prop); var has = s !== void 0 && s.v !== UNINITIALIZED || Reflect.has(target, prop); if (s !== void 0 || active_effect !== null && (!has || ((_a2 = get_descriptor(target, prop)) == null ? void 0 : _a2.writable))) { if (s === void 0) { s = source(has ? proxy(target[prop], metadata) : UNINITIALIZED); sources.set(prop, s); } var value2 = get(s); if (value2 === UNINITIALIZED) { return false; } } return has; }, set(target, prop, value2, receiver) { var _a2; var s = sources.get(prop); var has = prop in target; if (is_proxied_array && prop === "length") { for (var i = value2; i < /** @type {Source} */ s.v; i += 1) { var other_s = sources.get(i + ""); if (other_s !== void 0) { set(other_s, UNINITIALIZED); } else if (i in target) { other_s = source(UNINITIALIZED); sources.set(i + "", other_s); } } } if (s === void 0) { if (!has || ((_a2 = get_descriptor(target, prop)) == null ? void 0 : _a2.writable)) { s = source(void 0); set(s, proxy(value2, metadata)); sources.set(prop, s); } } else { has = s.v !== UNINITIALIZED; set(s, proxy(value2, metadata)); } if (DEV) { var prop_metadata = value2 == null ? void 0 : value2[STATE_SYMBOL_METADATA]; if (prop_metadata && (prop_metadata == null ? void 0 : prop_metadata.parent) !== metadata) { widen_ownership(metadata, prop_metadata); } check_ownership(metadata); } var descriptor = Reflect.getOwnPropertyDescriptor(target, prop); if (descriptor == null ? void 0 : descriptor.set) { descriptor.set.call(receiver, value2); } if (!has) { if (is_proxied_array && typeof prop === "string") { var ls = ( /** @type {Source} */ sources.get("length") ); var n = Number(prop); if (Number.isInteger(n) && n >= ls.v) { set(ls, n + 1); } } update_version(version); } return true; }, ownKeys(target) { get(version); var own_keys = Reflect.ownKeys(target).filter((key2) => { var source3 = sources.get(key2); return source3 === void 0 || source3.v !== UNINITIALIZED; }); for (var [key, source2] of sources) { if (source2.v !== UNINITIALIZED && !(key in target)) { own_keys.push(key); } } return own_keys; }, setPrototypeOf() { state_prototype_fixed(); } } ); } function update_version(signal, d = 1) { set(signal, signal.v + d); } function get_proxied_value(value) { if (value !== null && typeof value === "object" && STATE_SYMBOL in value) { return value[STATE_SYMBOL]; } return value; } function is(a, b) { return Object.is(get_proxied_value(a), get_proxied_value(b)); } // node_modules/svelte/src/internal/client/dev/equality.js function init_array_prototype_warnings() { const array_prototype2 = Array.prototype; const cleanup = Array.__svelte_cleanup; if (cleanup) { cleanup(); } const { indexOf, lastIndexOf, includes } = array_prototype2; array_prototype2.indexOf = function(item, from_index) { const index = indexOf.call(this, item, from_index); if (index === -1) { const test = indexOf.call(get_proxied_value(this), get_proxied_value(item), from_index); if (test !== -1) { state_proxy_equality_mismatch("array.indexOf(...)"); } } return index; }; array_prototype2.lastIndexOf = function(item, from_index) { const index = lastIndexOf.call(this, item, from_index ?? this.length - 1); if (index === -1) { const test = lastIndexOf.call( get_proxied_value(this), get_proxied_value(item), from_index ?? this.length - 1 ); if (test !== -1) { state_proxy_equality_mismatch("array.lastIndexOf(...)"); } } return index; }; array_prototype2.includes = function(item, from_index) { const has = includes.call(this, item, from_index); if (!has) { const test = includes.call(get_proxied_value(this), get_proxied_value(item), from_index); if (test) { state_proxy_equality_mismatch("array.includes(...)"); } } return has; }; Array.__svelte_cleanup = () => { array_prototype2.indexOf = indexOf; array_prototype2.lastIndexOf = lastIndexOf; array_prototype2.includes = includes; }; } function strict_equals(a, b, equal = true) { try { if (a === b !== (get_proxied_value(a) === get_proxied_value(b))) { state_proxy_equality_mismatch(equal ? "===" : "!=="); } } catch { } return a === b === equal; } function equals(a, b, equal = true) { if (a == b !== (get_proxied_value(a) == get_proxied_value(b))) { state_proxy_equality_mismatch(equal ? "==" : "!="); } return a == b === equal; } // node_modules/svelte/src/internal/client/dom/operations.js var $window; var $document; var first_child_getter; var next_sibling_getter; function init_operations() { if ($window !== void 0) { return; } $window = window; $document = document; var element_prototype = Element.prototype; var node_prototype = Node.prototype; first_child_getter = get_descriptor(node_prototype, "firstChild").get; next_sibling_getter = get_descriptor(node_prototype, "nextSibling").get; element_prototype.__click = void 0; element_prototype.__className = ""; element_prototype.__attributes = null; element_prototype.__styles = null; element_prototype.__e = void 0; Text.prototype.__t = void 0; if (DEV) { element_prototype.__svelte_meta = null; init_array_prototype_warnings(); } } function create_text(value = "") { return document.createTextNode(value); } function get_first_child(node) { return first_child_getter.call(node); } function get_next_sibling(node) { return next_sibling_getter.call(node); } function child(node, is_text) { if (!hydrating) { return get_first_child(node); } var child2 = ( /** @type {TemplateNode} */ get_first_child(hydrate_node) ); if (child2 === null) { child2 = hydrate_node.appendChild(create_text()); } else if (is_text && child2.nodeType !== 3) { var text = create_text(); child2 == null ? void 0 : child2.before(text); set_hydrate_node(text); return text; } set_hydrate_node(child2); return child2; } function first_child(fragment, is_text) { var _a, _b; if (!hydrating) { var first = ( /** @type {DocumentFragment} */ get_first_child( /** @type {Node} */ fragment ) ); if (first instanceof Comment && first.data === "") return get_next_sibling(first); return first; } if (is_text && ((_a = hydrate_node) == null ? void 0 : _a.nodeType) !== 3) { var text = create_text(); (_b = hydrate_node) == null ? void 0 : _b.before(text); set_hydrate_node(text); return text; } return hydrate_node; } function sibling(node, count = 1, is_text = false) { let next_sibling = hydrating ? hydrate_node : node; var last_sibling; while (count--) { last_sibling = next_sibling; next_sibling = /** @type {TemplateNode} */ get_next_sibling(next_sibling); } if (!hydrating) { return next_sibling; } var type = next_sibling == null ? void 0 : next_sibling.nodeType; if (is_text && type !== 3) { var text = create_text(); if (next_sibling === null) { last_sibling == null ? void 0 : last_sibling.after(text); } else { next_sibling.before(text); } set_hydrate_node(text); return text; } set_hydrate_node(next_sibling); return ( /** @type {TemplateNode} */ next_sibling ); } function clear_text_content(node) { node.textContent = ""; } // node_modules/svelte/src/internal/client/reactivity/equality.js function equals2(value) { return value === this.v; } function safe_not_equal(a, b) { return a != a ? b == b : a !== b || a !== null && typeof a === "object" || typeof a === "function"; } function not_equal(a, b) { return a !== b; } function safe_equals(value) { return !safe_not_equal(value, this.v); } // node_modules/svelte/src/internal/client/reactivity/deriveds.js function derived(fn) { var flags = DERIVED | DIRTY; if (active_effect === null) { flags |= UNOWNED; } else { active_effect.f |= EFFECT_HAS_DERIVED; } var parent_derived = active_reaction !== null && (active_reaction.f & DERIVED) !== 0 ? ( /** @type {Derived} */ active_reaction ) : null; const signal = { children: null, ctx: component_context, deps: null, equals: equals2, f: flags, fn, reactions: null, v: ( /** @type {V} */ null ), version: 0, parent: parent_derived ?? active_effect }; if (parent_derived !== null) { (parent_derived.children ?? (parent_derived.children = [])).push(signal); } return signal; } function derived_safe_equal(fn) { const signal = derived(fn); signal.equals = safe_equals; return signal; } function destroy_derived_children(derived2) { var children = derived2.children; if (children !== null) { derived2.children = null; for (var i = 0; i < children.length; i += 1) { var child2 = children[i]; if ((child2.f & DERIVED) !== 0) { destroy_derived( /** @type {Derived} */ child2 ); } else { destroy_effect( /** @type {Effect} */ child2 ); } } } } var stack = []; function get_derived_parent_effect(derived2) { var parent = derived2.parent; while (parent !== null) { if ((parent.f & DERIVED) === 0) { return ( /** @type {Effect} */ parent ); } parent = parent.parent; } return null; } function execute_derived(derived2) { var value; var prev_active_effect = active_effect; set_active_effect(get_derived_parent_effect(derived2)); if (DEV) { let prev_inspect_effects = inspect_effects; set_inspect_effects(/* @__PURE__ */ new Set()); try { if (stack.includes(derived2)) { derived_references_self(); } stack.push(derived2); destroy_derived_children(derived2); value = update_reaction(derived2); } finally { set_active_effect(prev_active_effect); set_inspect_effects(prev_inspect_effects); stack.pop(); } } else { try { destroy_derived_children(derived2); value = update_reaction(derived2); } finally { set_active_effect(prev_active_effect); } } return value; } function update_derived(derived2) { var value = execute_derived(derived2); var status = (skip_reaction || (derived2.f & UNOWNED) !== 0) && derived2.deps !== null ? MAYBE_DIRTY : CLEAN; set_signal_status(derived2, status); if (!derived2.equals(value)) { derived2.v = value; derived2.version = increment_version(); } } function destroy_derived(derived2) { destroy_derived_children(derived2); remove_reactions(derived2, 0); set_signal_status(derived2, DESTROYED); derived2.v = derived2.children = derived2.deps = derived2.ctx = derived2.reactions = null; } // node_modules/svelte/src/internal/client/reactivity/effects.js function validate_effect(rune) { if (active_effect === null && active_reaction === null) { effect_orphan(rune); } if (active_reaction !== null && (active_reaction.f & UNOWNED) !== 0) { effect_in_unowned_derived(); } if (is_destroying_effect) { effect_in_teardown(rune); } } function push_effect(effect2, parent_effect) { var parent_last = parent_effect.last; if (parent_last === null) { parent_effect.last = parent_effect.first = effect2; } else { parent_last.next = effect2; effect2.prev = parent_last; parent_effect.last = effect2; } } function create_effect(type, fn, sync, push2 = true) { var is_root = (type & ROOT_EFFECT) !== 0; var parent_effect = active_effect; if (DEV) { while (parent_effect !== null && (parent_effect.f & INSPECT_EFFECT) !== 0) { parent_effect = parent_effect.parent; } } var effect2 = { ctx: component_context, deps: null, deriveds: null, nodes_start: null, nodes_end: null, f: type | DIRTY, first: null, fn, last: null, next: null, parent: is_root ? null : parent_effect, prev: null, teardown: null, transitions: null, version: 0 }; if (DEV) { effect2.component_function = dev_current_component_function; } if (sync) { var previously_flushing_effect = is_flushing_effect; try { set_is_flushing_effect(true); update_effect(effect2); effect2.f |= EFFECT_RAN; } catch (e) { destroy_effect(effect2); throw e; } finally { set_is_flushing_effect(previously_flushing_effect); } } else if (fn !== null) { schedule_effect(effect2); } var inert = sync && effect2.deps === null && effect2.first === null && effect2.nodes_start === null && effect2.teardown === null && (effect2.f & EFFECT_HAS_DERIVED) === 0; if (!inert && !is_root && push2) { if (parent_effect !== null) { push_effect(effect2, parent_effect); } if (active_reaction !== null && (active_reaction.f & DERIVED) !== 0) { var derived2 = ( /** @type {Derived} */ active_reaction ); (derived2.children ?? (derived2.children = [])).push(effect2); } } return effect2; } function effect_tracking() { if (active_reaction === null) { return false; } return !skip_reaction; } function teardown(fn) { const effect2 = create_effect(RENDER_EFFECT, null, false); set_signal_status(effect2, CLEAN); effect2.teardown = fn; return effect2; } function user_effect(fn) { validate_effect("$effect"); var defer = active_effect !== null && (active_effect.f & BRANCH_EFFECT) !== 0 && component_context !== null && !component_context.m; if (DEV) { define_property(fn, "name", { value: "$effect" }); } if (defer) { var context = ( /** @type {ComponentContext} */ component_context ); (context.e ?? (context.e = [])).push({ fn, effect: active_effect, reaction: active_reaction }); } else { var signal = effect(fn); return signal; } } function user_pre_effect(fn) { validate_effect("$effect.pre"); if (DEV) { define_property(fn, "name", { value: "$effect.pre" }); } return render_effect(fn); } function inspect_effect(fn) { return create_effect(INSPECT_EFFECT, fn, true); } function effect_root(fn) { const effect2 = create_effect(ROOT_EFFECT, fn, true); return () => { destroy_effect(effect2); }; } function effect(fn) { return create_effect(EFFECT, fn, false); } function legacy_pre_effect(deps, fn) { var context = ( /** @type {ComponentContextLegacy} */ component_context ); var token = { effect: null, ran: false }; context.l.r1.push(token); token.effect = render_effect(() => { deps(); if (token.ran) return; token.ran = true; set(context.l.r2, true); untrack(fn); }); } function legacy_pre_effect_reset() { var context = ( /** @type {ComponentContextLegacy} */ component_context ); render_effect(() => { if (!get(context.l.r2)) return; for (var token of context.l.r1) { var effect2 = token.effect; if ((effect2.f & CLEAN) !== 0) { set_signal_status(effect2, MAYBE_DIRTY); } if (check_dirtiness(effect2)) { update_effect(effect2); } token.ran = false; } context.l.r2.v = false; }); } function render_effect(fn) { return create_effect(RENDER_EFFECT, fn, true); } function template_effect(fn) { if (DEV) { define_property(fn, "name", { value: "{expression}" }); } return block(fn); } function block(fn, flags = 0) { return create_effect(RENDER_EFFECT | BLOCK_EFFECT | flags, fn, true); } function branch(fn, push2 = true) { return create_effect(RENDER_EFFECT | BRANCH_EFFECT, fn, true, push2); } function execute_effect_teardown(effect2) { var teardown2 = effect2.teardown; if (teardown2 !== null) { const previously_destroying_effect = is_destroying_effect; const previous_reaction = active_reaction; set_is_destroying_effect(true); set_active_reaction(null); try { teardown2.call(null); } finally { set_is_destroying_effect(previously_destroying_effect); set_active_reaction(previous_reaction); } } } function destroy_effect_deriveds(signal) { var deriveds = signal.deriveds; if (deriveds !== null) { signal.deriveds = null; for (var i = 0; i < deriveds.length; i += 1) { destroy_derived(deriveds[i]); } } } function destroy_effect_children(signal, remove_dom = false) { var effect2 = signal.first; signal.first = signal.last = null; while (effect2 !== null) { var next2 = effect2.next; destroy_effect(effect2, remove_dom); effect2 = next2; } } function destroy_block_effect_children(signal) { var effect2 = signal.first; while (effect2 !== null) { var next2 = effect2.next; if ((effect2.f & BRANCH_EFFECT) === 0) { destroy_effect(effect2); } effect2 = next2; } } function destroy_effect(effect2, remove_dom = true) { var removed = false; if ((remove_dom || (effect2.f & HEAD_EFFECT) !== 0) && effect2.nodes_start !== null) { var node = effect2.nodes_start; var end = effect2.nodes_end; while (node !== null) { var next2 = node === end ? null : ( /** @type {TemplateNode} */ get_next_sibling(node) ); node.remove(); node = next2; } removed = true; } destroy_effect_children(effect2, remove_dom && !removed); destroy_effect_deriveds(effect2); remove_reactions(effect2, 0); set_signal_status(effect2, DESTROYED); var transitions = effect2.transitions; if (transitions !== null) { for (const transition of transitions) { transition.stop(); } } execute_effect_teardown(effect2); var parent = effect2.parent; if (parent !== null && parent.first !== null) { unlink_effect(effect2); } if (DEV) { effect2.component_function = null; } effect2.next = effect2.prev = effect2.teardown = effect2.ctx = effect2.deps = effect2.parent = effect2.fn = effect2.nodes_start = effect2.nodes_end = null; } function unlink_effect(effect2) { var parent = effect2.parent; var prev = effect2.prev; var next2 = effect2.next; if (prev !== null) prev.next = next2; if (next2 !== null) next2.prev = prev; if (parent !== null) { if (parent.first === effect2) parent.first = next2; if (parent.last === effect2) parent.last = prev; } } function pause_effect(effect2, callback) { var transitions = []; pause_children(effect2, transitions, true); run_out_transitions(transitions, () => { destroy_effect(effect2); if (callback) callback(); }); } function run_out_transitions(transitions, fn) { var remaining = transitions.length; if (remaining > 0) { var check = () => --remaining || fn(); for (var transition of transitions) { transition.out(check); } } else { fn(); } } function pause_children(effect2, transitions, local) { if ((effect2.f & INERT) !== 0) return; effect2.f ^= INERT; if (effect2.transitions !== null) { for (const transition of effect2.transitions) { if (transition.is_global || local) { transitions.push(transition); } } } var child2 = effect2.first; while (child2 !== null) { var sibling2 = child2.next; var transparent = (child2.f & EFFECT_TRANSPARENT) !== 0 || (child2.f & BRANCH_EFFECT) !== 0; pause_children(child2, transitions, transparent ? local : false); child2 = sibling2; } } function resume_effect(effect2) { resume_children(effect2, true); } function resume_children(effect2, local) { if ((effect2.f & INERT) === 0) return; if (check_dirtiness(effect2)) { update_effect(effect2); } effect2.f ^= INERT; var child2 = effect2.first; while (child2 !== null) { var sibling2 = child2.next; var transparent = (child2.f & EFFECT_TRANSPARENT) !== 0 || (child2.f & BRANCH_EFFECT) !== 0; resume_children(child2, transparent ? local : false); child2 = sibling2; } if (effect2.transitions !== null) { for (const transition of effect2.transitions) { if (transition.is_global || local) { transition.in(); } } } } // node_modules/svelte/src/internal/client/dom/task.js var request_idle_callback = typeof requestIdleCallback === "undefined" ? (cb) => setTimeout(cb, 1) : requestIdleCallback; var is_micro_task_queued = false; var is_idle_task_queued = false; var current_queued_micro_tasks = []; var current_queued_idle_tasks = []; function process_micro_tasks() { is_micro_task_queued = false; const tasks = current_queued_micro_tasks.slice(); current_queued_micro_tasks = []; run_all(tasks); } function process_idle_tasks() { is_idle_task_queued = false; const tasks = current_queued_idle_tasks.slice(); current_queued_idle_tasks = []; run_all(tasks); } function queue_micro_task(fn) { if (!is_micro_task_queued) { is_micro_task_queued = true; queueMicrotask(process_micro_tasks); } current_queued_micro_tasks.push(fn); } function queue_idle_task(fn) { if (!is_idle_task_queued) { is_idle_task_queued = true; request_idle_callback(process_idle_tasks); } current_queued_idle_tasks.push(fn); } function flush_tasks() { if (is_micro_task_queued) { process_micro_tasks(); } if (is_idle_task_queued) { process_idle_tasks(); } } // node_modules/svelte/src/internal/shared/errors.js function invalid_default_snippet() { if (DEV) { const error = new Error(`invalid_default_snippet Cannot use \`{@render children(...)}\` if the parent component uses \`let:\` directives. Consider using a named snippet instead`); error.name = "Svelte error"; throw error; } else { throw new Error("invalid_default_snippet"); } } function lifecycle_outside_component(name) { if (DEV) { const error = new Error(`lifecycle_outside_component \`${name}(...)\` can only be used during component initialisation`); error.name = "Svelte error"; throw error; } else { throw new Error("lifecycle_outside_component"); } } function store_invalid_shape(name) { if (DEV) { const error = new Error(`store_invalid_shape \`${name}\` is not a store with a \`subscribe\` method`); error.name = "Svelte error"; throw error; } else { throw new Error("store_invalid_shape"); } } function svelte_element_invalid_this_value() { if (DEV) { const error = new Error(`svelte_element_invalid_this_value The \`this\` prop on \`\` must be a string, if defined`); error.name = "Svelte error"; throw error; } else { throw new Error("svelte_element_invalid_this_value"); } } // node_modules/svelte/src/internal/client/runtime.js var FLUSH_MICROTASK = 0; var FLUSH_SYNC = 1; var handled_errors = /* @__PURE__ */ new WeakSet(); var scheduler_mode = FLUSH_MICROTASK; var is_micro_task_queued2 = false; var is_flushing_effect = false; var is_destroying_effect = false; function set_is_flushing_effect(value) { is_flushing_effect = value; } function set_is_destroying_effect(value) { is_destroying_effect = value; } var queued_root_effects = []; var flush_count = 0; var dev_effect_stack = []; var active_reaction = null; function set_active_reaction(reaction) { active_reaction = reaction; } var active_effect = null; function set_active_effect(effect2) { active_effect = effect2; } var derived_sources = null; function set_derived_sources(sources) { derived_sources = sources; } var new_deps = null; var skipped_deps = 0; var untracked_writes = null; function set_untracked_writes(value) { untracked_writes = value; } var current_version = 0; var skip_reaction = false; var captured_signals = null; var component_context = null; function set_component_context(context) { component_context = context; } var dev_current_component_function = null; function set_dev_current_component_function(fn) { dev_current_component_function = fn; } function increment_version() { return ++current_version; } function is_runes() { return !legacy_mode_flag || component_context !== null && component_context.l === null; } function check_dirtiness(reaction) { var _a, _b; var flags = reaction.f; if ((flags & DIRTY) !== 0) { return true; } if ((flags & MAYBE_DIRTY) !== 0) { var dependencies = reaction.deps; var is_unowned = (flags & UNOWNED) !== 0; if (dependencies !== null) { var i; if ((flags & DISCONNECTED) !== 0) { for (i = 0; i < dependencies.length; i++) { ((_a = dependencies[i]).reactions ?? (_a.reactions = [])).push(reaction); } reaction.f ^= DISCONNECTED; } for (i = 0; i < dependencies.length; i++) { var dependency = dependencies[i]; if (check_dirtiness( /** @type {Derived} */ dependency )) { update_derived( /** @type {Derived} */ dependency ); } if (is_unowned && active_effect !== null && !skip_reaction && !((_b = dependency == null ? void 0 : dependency.reactions) == null ? void 0 : _b.includes(reaction))) { (dependency.reactions ?? (dependency.reactions = [])).push(reaction); } if (dependency.version > reaction.version) { return true; } } } if (!is_unowned) { set_signal_status(reaction, CLEAN); } } return false; } function handle_error(error, effect2, component_context2) { var _a, _b; if (!DEV || handled_errors.has(error) || component_context2 === null) { throw error; } const component_stack = []; const effect_name = (_a = effect2.fn) == null ? void 0 : _a.name; if (effect_name) { component_stack.push(effect_name); } let current_context = component_context2; while (current_context !== null) { if (DEV) { var filename = (_b = current_context.function) == null ? void 0 : _b[FILENAME]; if (filename) { const file = filename.split("/").pop(); component_stack.push(file); } } current_context = current_context.p; } const indent = /Firefox/.test(navigator.userAgent) ? " " : " "; define_property(error, "message", { value: error.message + ` ${component_stack.map((name) => ` ${indent}in ${name}`).join("")} ` }); const stack2 = error.stack; if (stack2) { const lines = stack2.split("\n"); const new_lines = []; for (let i = 0; i < lines.length; i++) { const line = lines[i]; if (line.includes("svelte/src/internal")) { continue; } new_lines.push(line); } define_property(error, "stack", { value: error.stack + new_lines.join("\n") }); } handled_errors.add(error); throw error; } function update_reaction(reaction) { var _a; var previous_deps = new_deps; var previous_skipped_deps = skipped_deps; var previous_untracked_writes = untracked_writes; var previous_reaction = active_reaction; var previous_skip_reaction = skip_reaction; var prev_derived_sources = derived_sources; var previous_component_context = component_context; var flags = reaction.f; new_deps = /** @type {null | Value[]} */ null; skipped_deps = 0; untracked_writes = null; active_reaction = (flags & (BRANCH_EFFECT | ROOT_EFFECT)) === 0 ? reaction : null; skip_reaction = !is_flushing_effect && (flags & UNOWNED) !== 0; derived_sources = null; component_context = reaction.ctx; try { var result = ( /** @type {Function} */ (0, reaction.fn)() ); var deps = reaction.deps; if (new_deps !== null) { var i; remove_reactions(reaction, skipped_deps); if (deps !== null && skipped_deps > 0) { deps.length = skipped_deps + new_deps.length; for (i = 0; i < new_deps.length; i++) { deps[skipped_deps + i] = new_deps[i]; } } else { reaction.deps = deps = new_deps; } if (!skip_reaction) { for (i = skipped_deps; i < deps.length; i++) { ((_a = deps[i]).reactions ?? (_a.reactions = [])).push(reaction); } } } else if (deps !== null && skipped_deps < deps.length) { remove_reactions(reaction, skipped_deps); deps.length = skipped_deps; } return result; } finally { new_deps = previous_deps; skipped_deps = previous_skipped_deps; untracked_writes = previous_untracked_writes; active_reaction = previous_reaction; skip_reaction = previous_skip_reaction; derived_sources = prev_derived_sources; component_context = previous_component_context; } } function remove_reaction(signal, dependency) { let reactions = dependency.reactions; if (reactions !== null) { var index = reactions.indexOf(signal); if (index !== -1) { var new_length = reactions.length - 1; if (new_length === 0) { reactions = dependency.reactions = null; } else { reactions[index] = reactions[new_length]; reactions.pop(); } } } if (reactions === null && (dependency.f & DERIVED) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear // to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps` // allows us to skip the expensive work of disconnecting and immediately reconnecting it (new_deps === null || !new_deps.includes(dependency))) { set_signal_status(dependency, MAYBE_DIRTY); if ((dependency.f & (UNOWNED | DISCONNECTED)) === 0) { dependency.f ^= DISCONNECTED; } remove_reactions( /** @type {Derived} **/ dependency, 0 ); } } function remove_reactions(signal, start_index) { var dependencies = signal.deps; if (dependencies === null) return; for (var i = start_index; i < dependencies.length; i++) { remove_reaction(signal, dependencies[i]); } } function update_effect(effect2) { var flags = effect2.f; if ((flags & DESTROYED) !== 0) { return; } set_signal_status(effect2, CLEAN); var previous_effect = active_effect; var previous_component_context = component_context; active_effect = effect2; if (DEV) { var previous_component_fn = dev_current_component_function; dev_current_component_function = effect2.component_function; } try { if ((flags & BLOCK_EFFECT) !== 0) { destroy_block_effect_children(effect2); } else { destroy_effect_children(effect2); } destroy_effect_deriveds(effect2); execute_effect_teardown(effect2); var teardown2 = update_reaction(effect2); effect2.teardown = typeof teardown2 === "function" ? teardown2 : null; effect2.version = current_version; if (DEV) { dev_effect_stack.push(effect2); } } catch (error) { handle_error( /** @type {Error} */ error, effect2, previous_component_context ); } finally { active_effect = previous_effect; if (DEV) { dev_current_component_function = previous_component_fn; } } } function infinite_loop_guard() { if (flush_count > 1e3) { flush_count = 0; if (DEV) { try { effect_update_depth_exceeded(); } catch (error) { define_property(error, "stack", { value: "" }); console.error( "Last ten effects were: ", dev_effect_stack.slice(-10).map((d) => d.fn) ); dev_effect_stack = []; throw error; } } else { effect_update_depth_exceeded(); } } flush_count++; } function flush_queued_root_effects(root_effects) { var length = root_effects.length; if (length === 0) { return; } infinite_loop_guard(); var previously_flushing_effect = is_flushing_effect; is_flushing_effect = true; try { for (var i = 0; i < length; i++) { var effect2 = root_effects[i]; if ((effect2.f & CLEAN) === 0) { effect2.f ^= CLEAN; } var collected_effects = []; process_effects(effect2, collected_effects); flush_queued_effects(collected_effects); } } finally { is_flushing_effect = previously_flushing_effect; } } function flush_queued_effects(effects) { var length = effects.length; if (length === 0) return; for (var i = 0; i < length; i++) { var effect2 = effects[i]; if ((effect2.f & (DESTROYED | INERT)) === 0 && check_dirtiness(effect2)) { update_effect(effect2); if (effect2.deps === null && effect2.first === null && effect2.nodes_start === null) { if (effect2.teardown === null) { unlink_effect(effect2); } else { effect2.fn = null; } } } } } function process_deferred() { is_micro_task_queued2 = false; if (flush_count > 1001) { return; } const previous_queued_root_effects = queued_root_effects; queued_root_effects = []; flush_queued_root_effects(previous_queued_root_effects); if (!is_micro_task_queued2) { flush_count = 0; if (DEV) { dev_effect_stack = []; } } } function schedule_effect(signal) { if (scheduler_mode === FLUSH_MICROTASK) { if (!is_micro_task_queued2) { is_micro_task_queued2 = true; queueMicrotask(process_deferred); } } var effect2 = signal; while (effect2.parent !== null) { effect2 = effect2.parent; var flags = effect2.f; if ((flags & (ROOT_EFFECT | BRANCH_EFFECT)) !== 0) { if ((flags & CLEAN) === 0) return; effect2.f ^= CLEAN; } } queued_root_effects.push(effect2); } function process_effects(effect2, collected_effects) { var current_effect = effect2.first; var effects = []; main_loop: while (current_effect !== null) { var flags = current_effect.f; var is_branch = (flags & BRANCH_EFFECT) !== 0; var is_skippable_branch = is_branch && (flags & CLEAN) !== 0; if (!is_skippable_branch && (flags & INERT) === 0) { if ((flags & RENDER_EFFECT) !== 0) { if (is_branch) { current_effect.f ^= CLEAN; } else if (check_dirtiness(current_effect)) { update_effect(current_effect); } var child2 = current_effect.first; if (child2 !== null) { current_effect = child2; continue; } } else if ((flags & EFFECT) !== 0) { effects.push(current_effect); } } var sibling2 = current_effect.next; if (sibling2 === null) { let parent = current_effect.parent; while (parent !== null) { if (effect2 === parent) { break main_loop; } var parent_sibling = parent.next; if (parent_sibling !== null) { current_effect = parent_sibling; continue main_loop; } parent = parent.parent; } } current_effect = sibling2; } for (var i = 0; i < effects.length; i++) { child2 = effects[i]; collected_effects.push(child2); process_effects(child2, collected_effects); } } function flush_sync(fn) { var previous_scheduler_mode = scheduler_mode; var previous_queued_root_effects = queued_root_effects; try { infinite_loop_guard(); const root_effects = []; scheduler_mode = FLUSH_SYNC; queued_root_effects = root_effects; is_micro_task_queued2 = false; flush_queued_root_effects(previous_queued_root_effects); var result = fn == null ? void 0 : fn(); flush_tasks(); if (queued_root_effects.length > 0 || root_effects.length > 0) { flush_sync(); } flush_count = 0; if (DEV) { dev_effect_stack = []; } return result; } finally { scheduler_mode = previous_scheduler_mode; queued_root_effects = previous_queued_root_effects; } } async function tick() { await Promise.resolve(); flush_sync(); } function get(signal) { var _a; var flags = signal.f; var is_derived = (flags & DERIVED) !== 0; if (is_derived && (flags & DESTROYED) !== 0) { var value = execute_derived( /** @type {Derived} */ signal ); destroy_derived( /** @type {Derived} */ signal ); return value; } if (captured_signals !== null) { captured_signals.add(signal); } if (active_reaction !== null) { if (derived_sources !== null && derived_sources.includes(signal)) { state_unsafe_local_read(); } var deps = active_reaction.deps; if (new_deps === null && deps !== null && deps[skipped_deps] === signal) { skipped_deps++; } else if (new_deps === null) { new_deps = [signal]; } else { new_deps.push(signal); } if (untracked_writes !== null && active_effect !== null && (active_effect.f & CLEAN) !== 0 && (active_effect.f & BRANCH_EFFECT) === 0 && untracked_writes.includes(signal)) { set_signal_status(active_effect, DIRTY); schedule_effect(active_effect); } } else if (is_derived && /** @type {Derived} */ signal.deps === null) { var derived2 = ( /** @type {Derived} */ signal ); var parent = derived2.parent; var target = derived2; while (parent !== null) { if ((parent.f & DERIVED) !== 0) { var parent_derived = ( /** @type {Derived} */ parent ); target = parent_derived; parent = parent_derived.parent; } else { var parent_effect = ( /** @type {Effect} */ parent ); if (!((_a = parent_effect.deriveds) == null ? void 0 : _a.includes(target))) { (parent_effect.deriveds ?? (parent_effect.deriveds = [])).push(target); } break; } } } if (is_derived) { derived2 = /** @type {Derived} */ signal; if (check_dirtiness(derived2)) { update_derived(derived2); } } return signal.v; } function safe_get(signal) { return signal && get(signal); } function invalidate_inner_signals(fn) { var previous_captured_signals = captured_signals; captured_signals = /* @__PURE__ */ new Set(); var captured = captured_signals; var signal; try { untrack(fn); if (previous_captured_signals !== null) { for (signal of captured_signals) { previous_captured_signals.add(signal); } } } finally { captured_signals = previous_captured_signals; } for (signal of captured) { if ((signal.f & LEGACY_DERIVED_PROP) !== 0) { for ( const dep of /** @type {Derived} */ signal.deps || [] ) { if ((dep.f & DERIVED) === 0) { mutate( dep, null /* doesnt matter */ ); } } } else { mutate( signal, null /* doesnt matter */ ); } } } function untrack(fn) { const previous_reaction = active_reaction; try { active_reaction = null; return fn(); } finally { active_reaction = previous_reaction; } } var STATUS_MASK = ~(DIRTY | MAYBE_DIRTY | CLEAN); function set_signal_status(signal, status) { signal.f = signal.f & STATUS_MASK | status; } function getContext(key) { const context_map = get_or_init_context_map("getContext"); const result = ( /** @type {T} */ context_map.get(key) ); if (DEV) { const fn = ( /** @type {ComponentContext} */ component_context.function ); if (fn) { add_owner(result, fn, true); } } return result; } function setContext(key, context) { const context_map = get_or_init_context_map("setContext"); context_map.set(key, context); return context; } function hasContext(key) { const context_map = get_or_init_context_map("hasContext"); return context_map.has(key); } function getAllContexts() { const context_map = get_or_init_context_map("getAllContexts"); if (DEV) { const fn = component_context == null ? void 0 : component_context.function; if (fn) { for (const value of context_map.values()) { add_owner(value, fn, true); } } } return ( /** @type {T} */ context_map ); } function get_or_init_context_map(name) { if (component_context === null) { lifecycle_outside_component(name); } return component_context.c ?? (component_context.c = new Map(get_parent_context(component_context) || void 0)); } function get_parent_context(component_context2) { let parent = component_context2.p; while (parent !== null) { const context_map = parent.c; if (context_map !== null) { return context_map; } parent = parent.p; } return null; } function update(signal, d = 1) { var value = +get(signal); set(signal, value + d); return value; } function update_pre(signal, d = 1) { return set(signal, +get(signal) + d); } function exclude_from_object(obj, keys) { var result = {}; for (var key in obj) { if (!keys.includes(key)) { result[key] = obj[key]; } } return result; } function push(props, runes = false, fn) { component_context = { p: component_context, c: null, e: null, m: false, s: props, x: null, l: null }; if (legacy_mode_flag && !runes) { component_context.l = { s: null, u: null, r1: [], r2: source(false) }; } if (DEV) { component_context.function = fn; dev_current_component_function = fn; } } function pop(component) { var _a; const context_stack_item = component_context; if (context_stack_item !== null) { if (component !== void 0) { context_stack_item.x = component; } const component_effects = context_stack_item.e; if (component_effects !== null) { var previous_effect = active_effect; var previous_reaction = active_reaction; context_stack_item.e = null; try { for (var i = 0; i < component_effects.length; i++) { var component_effect = component_effects[i]; set_active_effect(component_effect.effect); set_active_reaction(component_effect.reaction); effect(component_effect.fn); } } finally { set_active_effect(previous_effect); set_active_reaction(previous_reaction); } } component_context = context_stack_item.p; if (DEV) { dev_current_component_function = ((_a = context_stack_item.p) == null ? void 0 : _a.function) ?? null; } context_stack_item.m = true; } return component || /** @type {T} */ {}; } function deep_read_state(value) { if (typeof value !== "object" || !value || value instanceof EventTarget) { return; } if (STATE_SYMBOL in value) { deep_read(value); } else if (!Array.isArray(value)) { for (let key in value) { const prop = value[key]; if (typeof prop === "object" && prop && STATE_SYMBOL in prop) { deep_read(prop); } } } } function deep_read(value, visited = /* @__PURE__ */ new Set()) { if (typeof value === "object" && value !== null && // We don't want to traverse DOM elements !(value instanceof EventTarget) && !visited.has(value)) { visited.add(value); if (value instanceof Date) { value.getTime(); } for (let key in value) { try { deep_read(value[key], visited); } catch (e) { } } const proto = get_prototype_of(value); if (proto !== Object.prototype && proto !== Array.prototype && proto !== Map.prototype && proto !== Set.prototype && proto !== Date.prototype) { const descriptors = get_descriptors(proto); for (let key in descriptors) { const get2 = descriptors[key].get; if (get2) { try { get2.call(value); } catch (e) { } } } } } } if (DEV) { let throw_rune_error = function(rune) { if (!(rune in globalThis)) { let value; Object.defineProperty(globalThis, rune, { configurable: true, // eslint-disable-next-line getter-return get: () => { if (value !== void 0) { return value; } rune_outside_svelte(rune); }, set: (v) => { value = v; } }); } }; throw_rune_error("$state"); throw_rune_error("$effect"); throw_rune_error("$derived"); throw_rune_error("$inspect"); throw_rune_error("$props"); throw_rune_error("$bindable"); } // node_modules/svelte/src/internal/client/reactivity/sources.js var inspect_effects = /* @__PURE__ */ new Set(); function set_inspect_effects(v) { inspect_effects = v; } function source(v) { return { f: 0, // TODO ideally we could skip this altogether, but it causes type errors v, reactions: null, equals: equals2, version: 0 }; } function state(v) { return push_derived_source(source(v)); } function mutable_source(initial_value, immutable = false) { var _a; const s = source(initial_value); if (!immutable) { s.equals = safe_equals; } if (legacy_mode_flag && component_context !== null && component_context.l !== null) { ((_a = component_context.l).s ?? (_a.s = [])).push(s); } return s; } function mutable_state(v, immutable = false) { return push_derived_source(mutable_source(v, immutable)); } function push_derived_source(source2) { if (active_reaction !== null && (active_reaction.f & DERIVED) !== 0) { if (derived_sources === null) { set_derived_sources([source2]); } else { derived_sources.push(source2); } } return source2; } function mutate(source2, value) { set( source2, untrack(() => get(source2)) ); return value; } function set(source2, value) { if (active_reaction !== null && is_runes() && (active_reaction.f & (DERIVED | BLOCK_EFFECT)) !== 0 && // If the source was created locally within the current derived, then // we allow the mutation. (derived_sources === null || !derived_sources.includes(source2))) { state_unsafe_mutation(); } return internal_set(source2, value); } function internal_set(source2, value) { if (!source2.equals(value)) { source2.v = value; source2.version = increment_version(); mark_reactions(source2, DIRTY); if (is_runes() && active_effect !== null && (active_effect.f & CLEAN) !== 0 && (active_effect.f & BRANCH_EFFECT) === 0) { if (new_deps !== null && new_deps.includes(source2)) { set_signal_status(active_effect, DIRTY); schedule_effect(active_effect); } else { if (untracked_writes === null) { set_untracked_writes([source2]); } else { untracked_writes.push(source2); } } } if (DEV && inspect_effects.size > 0) { const inspects = Array.from(inspect_effects); var previously_flushing_effect = is_flushing_effect; set_is_flushing_effect(true); try { for (const effect2 of inspects) { if ((effect2.f & CLEAN) !== 0) { set_signal_status(effect2, MAYBE_DIRTY); } if (check_dirtiness(effect2)) { update_effect(effect2); } } } finally { set_is_flushing_effect(previously_flushing_effect); } inspect_effects.clear(); } } return value; } function mark_reactions(signal, status) { var reactions = signal.reactions; if (reactions === null) return; var runes = is_runes(); var length = reactions.length; for (var i = 0; i < length; i++) { var reaction = reactions[i]; var flags = reaction.f; if ((flags & DIRTY) !== 0) continue; if (!runes && reaction === active_effect) continue; if (DEV && (flags & INSPECT_EFFECT) !== 0) { inspect_effects.add(reaction); continue; } set_signal_status(reaction, status); if ((flags & (CLEAN | UNOWNED)) !== 0) { if ((flags & DERIVED) !== 0) { mark_reactions( /** @type {Derived} */ reaction, MAYBE_DIRTY ); } else { schedule_effect( /** @type {Effect} */ reaction ); } } } } // node_modules/svelte/src/internal/client/dom/elements/misc.js function autofocus(dom, value) { if (value) { const body = document.body; dom.autofocus = true; queue_micro_task(() => { if (document.activeElement === body) { dom.focus(); } }); } } function remove_textarea_child(dom) { if (hydrating && get_first_child(dom) !== null) { clear_text_content(dom); } } var listening_to_form_reset = false; function add_form_reset_listener() { if (!listening_to_form_reset) { listening_to_form_reset = true; document.addEventListener( "reset", (evt) => { Promise.resolve().then(() => { var _a; if (!evt.defaultPrevented) { for ( const e of /**@type {HTMLFormElement} */ evt.target.elements ) { (_a = e.__on_r) == null ? void 0 : _a.call(e); } } }); }, // In the capture phase to guarantee we get noticed of it (no possiblity of stopPropagation) { capture: true } ); } } // node_modules/svelte/src/internal/client/dom/elements/bindings/shared.js function listen(target, events, handler, call_handler_immediately = true) { if (call_handler_immediately) { handler(); } for (var name of events) { target.addEventListener(name, handler); } teardown(() => { for (var name2 of events) { target.removeEventListener(name2, handler); } }); } function without_reactive_context(fn) { var previous_reaction = active_reaction; var previous_effect = active_effect; set_active_reaction(null); set_active_effect(null); try { return fn(); } finally { set_active_reaction(previous_reaction); set_active_effect(previous_effect); } } function listen_to_event_and_reset_event(element, event2, handler, on_reset = handler) { element.addEventListener(event2, () => without_reactive_context(handler)); const prev = element.__on_r; if (prev) { element.__on_r = () => { prev(); on_reset(); }; } else { element.__on_r = on_reset; } add_form_reset_listener(); } // node_modules/svelte/src/internal/client/dom/elements/events.js var all_registered_events = /* @__PURE__ */ new Set(); var root_event_handles = /* @__PURE__ */ new Set(); function replay_events(dom) { if (!hydrating) return; if (dom.onload) { dom.removeAttribute("onload"); } if (dom.onerror) { dom.removeAttribute("onerror"); } const event2 = dom.__e; if (event2 !== void 0) { dom.__e = void 0; queueMicrotask(() => { if (dom.isConnected) { dom.dispatchEvent(event2); } }); } } function create_event(event_name, dom, handler, options) { function target_handler(event2) { if (!options.capture) { handle_event_propagation.call(dom, event2); } if (!event2.cancelBubble) { return without_reactive_context(() => { return handler.call(this, event2); }); } } if (event_name.startsWith("pointer") || event_name.startsWith("touch") || event_name === "wheel") { queue_micro_task(() => { dom.addEventListener(event_name, target_handler, options); }); } else { dom.addEventListener(event_name, target_handler, options); } return target_handler; } function on(element, type, handler, options = {}) { var target_handler = create_event(type, element, handler, options); return () => { element.removeEventListener(type, target_handler, options); }; } function event(event_name, dom, handler, capture, passive) { var options = { capture, passive }; var target_handler = create_event(event_name, dom, handler, options); if (dom === document.body || dom === window || dom === document) { teardown(() => { dom.removeEventListener(event_name, target_handler, options); }); } } function delegate(events) { for (var i = 0; i < events.length; i++) { all_registered_events.add(events[i]); } for (var fn of root_event_handles) { fn(events); } } function handle_event_propagation(event2) { var _a; var handler_element = this; var owner_document = ( /** @type {Node} */ handler_element.ownerDocument ); var event_name = event2.type; var path = ((_a = event2.composedPath) == null ? void 0 : _a.call(event2)) || []; var current_target = ( /** @type {null | Element} */ path[0] || event2.target ); var path_idx = 0; var handled_at = event2.__root; if (handled_at) { var at_idx = path.indexOf(handled_at); if (at_idx !== -1 && (handler_element === document || handler_element === /** @type {any} */ window)) { event2.__root = handler_element; return; } var handler_idx = path.indexOf(handler_element); if (handler_idx === -1) { return; } if (at_idx <= handler_idx) { path_idx = at_idx; } } current_target = /** @type {Element} */ path[path_idx] || event2.target; if (current_target === handler_element) return; define_property(event2, "currentTarget", { configurable: true, get() { return current_target || owner_document; } }); var previous_reaction = active_reaction; var previous_effect = active_effect; set_active_reaction(null); set_active_effect(null); try { var throw_error; var other_errors = []; while (current_target !== null) { var parent_element = current_target.assignedSlot || current_target.parentNode || /** @type {any} */ current_target.host || null; try { var delegated = current_target["__" + event_name]; if (delegated !== void 0 && !/** @type {any} */ current_target.disabled) { if (is_array(delegated)) { var [fn, ...data] = delegated; fn.apply(current_target, [event2, ...data]); } else { delegated.call(current_target, event2); } } } catch (error) { if (throw_error) { other_errors.push(error); } else { throw_error = error; } } if (event2.cancelBubble || parent_element === handler_element || parent_element === null) { break; } current_target = parent_element; } if (throw_error) { for (let error of other_errors) { queueMicrotask(() => { throw error; }); } throw throw_error; } } finally { event2.__root = handler_element; delete event2.currentTarget; set_active_reaction(previous_reaction); set_active_effect(previous_effect); } } function apply(thunk, element, args, component, loc, has_side_effects = false, remove_parens = false) { let handler; let error; try { handler = thunk(); } catch (e) { error = e; } if (typeof handler === "function") { handler.apply(element, args); } else if (has_side_effects || handler != null || error) { const filename = component == null ? void 0 : component[FILENAME]; const location = loc ? ` at ${filename}:${loc[0]}:${loc[1]}` : ` in ${filename}`; const event_name = args[0].type; const description = `\`${event_name}\` handler${location}`; const suggestion = remove_parens ? "remove the trailing `()`" : "add a leading `() =>`"; event_handler_invalid(description, suggestion); if (error) { throw error; } } } export { BROWSER, DEV, is_array, array_from, object_keys, define_property, get_descriptor, get_descriptors, object_prototype, get_prototype_of, is_function, noop, is_promise, run, run_all, fallback, BLOCK_EFFECT, BRANCH_EFFECT, ROOT_EFFECT, DIRTY, MAYBE_DIRTY, INERT, DESTROYED, EFFECT_RAN, EFFECT_TRANSPARENT, LEGACY_DERIVED_PROP, HEAD_EFFECT, STATE_SYMBOL, LEGACY_PROPS, LOADING_ATTR_SYMBOL, safe_not_equal, not_equal, safe_equals, bind_invalid_checkbox_value, bind_invalid_export, bind_not_bindable, component_api_changed, component_api_invalid_new, each_key_duplicate, hydration_failed, invalid_snippet, lifecycle_legacy_only, props_invalid_value, props_rest_readonly, source, state, mutable_source, mutable_state, mutate, set, internal_set, EACH_ITEM_REACTIVE, EACH_INDEX_REACTIVE, EACH_IS_CONTROLLED, EACH_IS_ANIMATED, EACH_ITEM_IMMUTABLE, PROPS_IS_IMMUTABLE, PROPS_IS_RUNES, PROPS_IS_UPDATED, PROPS_IS_BINDABLE, PROPS_IS_LAZY_INITIAL, TRANSITION_IN, TRANSITION_OUT, TRANSITION_GLOBAL, TEMPLATE_FRAGMENT, TEMPLATE_USE_IMPORT_NODE, HYDRATION_START, HYDRATION_START_ELSE, HYDRATION_END, HYDRATION_ERROR, UNINITIALIZED, FILENAME, HMR, NAMESPACE_SVG, binding_property_non_reactive, console_log_state, hydration_attribute_changed, hydration_html_changed, hydration_mismatch, invalid_raw_snippet_render, legacy_recursive_reactive_block, lifecycle_double_unmount, hydrating, set_hydrating, hydrate_node, set_hydrate_node, hydrate_next, reset, hydrate_template, next, remove_nodes, get_component, ADD_OWNER, mark_module_start, mark_module_end, add_owner, add_owner_effect, skip_ownership_validation, proxy, is, strict_equals, equals, $window, $document, init_operations, create_text, get_first_child, get_next_sibling, child, first_child, sibling, clear_text_content, derived, derived_safe_equal, validate_effect, effect_tracking, teardown, user_effect, user_pre_effect, inspect_effect, effect_root, effect, legacy_pre_effect, legacy_pre_effect_reset, render_effect, template_effect, block, branch, destroy_effect, pause_effect, run_out_transitions, pause_children, resume_effect, queue_micro_task, queue_idle_task, invalid_default_snippet, lifecycle_outside_component, store_invalid_shape, svelte_element_invalid_this_value, active_reaction, set_active_reaction, active_effect, set_active_effect, captured_signals, component_context, set_component_context, dev_current_component_function, set_dev_current_component_function, is_runes, flush_sync, tick, get, safe_get, invalidate_inner_signals, untrack, set_signal_status, getContext, setContext, hasContext, getAllContexts, update, update_pre, exclude_from_object, push, pop, deep_read_state, deep_read, autofocus, remove_textarea_child, add_form_reset_listener, listen, without_reactive_context, listen_to_event_and_reset_event, all_registered_events, root_event_handles, replay_events, create_event, on, event, delegate, handle_event_propagation, apply }; //# sourceMappingURL=chunk-OTO7APUV.js.map