import { a as IGNORABLE_RUNTIME_WARNINGS, c as NAMESPACE_SVG, s as NAMESPACE_MATHML } from "./constants-Dd0-6Ncu.js"; import { _ as is_void, a as is_boolean_attribute, b as escape_html, c as is_dom_property, d as is_passive_event, g as is_svg, h as is_state_creation_rune, i as hash, l as is_load_error_element, m as is_rune, n as can_delegate_event, o as is_capture_event, p as is_reserved, r as cannot_be_set_statically, s as is_content_editable_binding, t as REGEX_VALID_TAG_NAME, u as is_mathml, v as normalize_attribute, y as sanitize_location } from "./utils-BWzPBw9Y.js"; import { a as closing_tag_omitted, i as EMPTY_COMMENT, n as BLOCK_OPEN, o as is_tag_valid_with_ancestor, r as BLOCK_OPEN_ELSE, s as is_tag_valid_with_parent, t as BLOCK_CLOSE } from "./hydration-Bgwk4N_v.js"; import { t as VERSION } from "./version-DLaxZhN9.js"; // \0rolldown/runtime.js var __defProp = Object.defineProperty; var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod, mod.exports), cb = null), mod.exports); var __exportAll = (all, no_symbols) => { let target = {}; for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" }); return target; }; // node_modules/zimmerframe/src/walk.js /** @import { Context, Visitor, Visitors } from './types.js' */ /** * @template {{ type: string }} T * @template {Record | null} U * @param {T} node * @param {U} state * @param {Visitors} visitors */ function walk$1(node, state, visitors) { const universal = visitors._; let stopped = false; const stop = () => { stopped = true; }; /** * @param {T} node * @param {T[]} path * @param {U} state * @returns {T | undefined} */ function visit_children(node, path, state) { /** @type {Record | null} lazily initialized for performance reasons */ let mutations = null; path.push(node); for (const key in node) { if (key === "type" || key === "__proto__") continue; const child_node = node[key]; if (child_node && typeof child_node === "object") { if (Array.isArray(child_node)) { /** @type {T[] | null} lazily cloned on first mutation */ let mutated_array = null; const len = child_node.length; for (let i = 0; i < len; i++) { const node = child_node[i]; if (node && typeof node === "object") { const result = visit(node, path, state); if (result) (mutated_array ??= child_node.slice())[i] = result; } } if (mutated_array) (mutations ??= {})[key] = mutated_array; } else { const result = visit(child_node, path, state); if (result) (mutations ??= {})[key] = result; } } } path.pop(); if (mutations) return apply_mutations(node, mutations); } /** * @param {T} node * @param {T[]} path * @param {U} state * @returns {T | undefined} */ function visit(node, path, state) { if (stopped) return; if (!node.type) return; const visitor = visitors[node.type]; if (!universal && !visitor) return visit_children(node, path, state); /** @type {T | void} */ let result; /** @type {T | undefined} */ let next_result; /** @type {Context['next']} */ const next = (next_state = state) => next_result = visit_children(node, path, next_state); /** @type {Context['visit']} */ const visit_node = (next_node, next_state = state) => { path.push(node); const result = visit(next_node, path, next_state) ?? next_node; path.pop(); return result; }; if (universal) { /** @type {T | void} */ let inner_result; result = universal(node, { path, state, /** @param {U} next_state */ next: (next_state = state) => { state = next_state; inner_result = visitor ? visitor(node, { path, state: next_state, next, stop, visit: visit_node }) : next(next_state); return inner_result; }, stop, visit: visit_node }); if (!result && inner_result) result = inner_result; } else result = visitor(node, { path, state, next, stop, visit: visit_node }); if (!result && next_result) result = next_result; if (result) return result; } return visit(node, [], state) ?? node; } /** * @template {Record} T * @param {T} node * @param {Record} mutations * @returns {T} */ function apply_mutations(node, mutations) { /** @type {Record} */ const obj = {}; const descriptors = Object.getOwnPropertyDescriptors(node); for (const key in descriptors) Object.defineProperty(obj, key, descriptors[key]); for (const key in mutations) obj[key] = mutations[key]; return obj; } // node_modules/svelte/src/compiler/phases/patterns.js var regex_whitespaces = /\s+/; var regex_starts_with_newline = /^\r?\n/; var regex_starts_with_whitespace = /^\s/; var regex_starts_with_whitespaces = /^[ \t\r\n]+/; var regex_ends_with_whitespace = /\s$/; var regex_ends_with_whitespaces = /[ \t\r\n]+$/; /** Not \S because that also removes explicit whitespace defined through things like ` ` */ var regex_not_whitespace = /[^ \t\r\n]/; /** Not \s+ because that also includes explicit whitespace defined through things like ` ` */ var regex_whitespaces_strict = /[ \t\n\r\f]+/g; var regex_only_whitespaces = /^[ \t\n\r\f]+$/; var regex_not_newline_characters = /[^\n]/g; var regex_is_valid_identifier = /^[a-zA-Z_$][a-zA-Z_$0-9]*$/; var regex_invalid_identifier_chars = /(^[^a-zA-Z_$]|[^a-zA-Z0-9_$])/g; var regex_starts_with_vowel = /^[aeiou]/; var regex_heading_tags = /^h[1-6]$/; var regex_illegal_attribute_character = /(^[0-9-.])|[\^$@%&#?!|()[\]{}^*+~;]/; var regex_bidirectional_control_characters = /[\u202a\u202b\u202c\u202d\u202e\u2066\u2067\u2068\u2069]+/g; var regex_js_prefix = /^\W*javascript:/i; var regex_redundant_img_alt = /\b(image|picture|photo)\b/i; // node_modules/svelte/src/compiler/utils/fuzzymatch.js /** * @param {string} name * @param {string[]} names * @returns {string | null} */ function fuzzymatch(name, names) { if (names.length === 0) return null; const matches = new FuzzySet(names).get(name); return matches && matches[0][0] > .7 ? matches[0][1] : null; } var GRAM_SIZE_LOWER = 2; var GRAM_SIZE_UPPER = 3; /** * @param {string} str1 * @param {string} str2 */ function _distance(str1, str2) { if (str1 === null && str2 === null) throw "Trying to compare two null values"; if (str1 === null || str2 === null) return 0; str1 = String(str1); str2 = String(str2); return 1 - levenshtein(str1, str2) / Math.max(str1.length, str2.length); } /** * @param {string} str1 * @param {string} str2 */ function levenshtein(str1, str2) { /** @type {number[]} */ const current = []; let prev = 0; for (let i = 0; i <= str2.length; i++) for (let j = 0; j <= str1.length; j++) { let value; if (i && j) { if (str1.charAt(j - 1) === str2.charAt(i - 1)) value = prev; else value = Math.min(current[j], current[j - 1], prev) + 1; } else value = i + j; prev = current[j]; current[j] = value; } return current.pop(); } var non_word_regex = /[^\w, ]+/; /** * @param {string} value * @param {any} gram_size */ function iterate_grams(value, gram_size = 2) { const simplified = "-" + value.toLowerCase().replace(non_word_regex, "") + "-"; const len_diff = gram_size - simplified.length; const results = []; if (len_diff > 0) for (let i = 0; i < len_diff; ++i) value += "-"; for (let i = 0; i < simplified.length - gram_size + 1; ++i) results.push(simplified.slice(i, i + gram_size)); return results; } /** * @param {string} value * @param {any} gram_size */ function gram_counter(value, gram_size = 2) { /** @type {Record} */ const result = {}; const grams = iterate_grams(value, gram_size); let i = 0; for (; i < grams.length; ++i) if (grams[i] in result) result[grams[i]] += 1; else result[grams[i]] = 1; return result; } /** * @param {MatchTuple} a * @param {MatchTuple} b */ function sort_descending(a, b) { return b[0] - a[0]; } var FuzzySet = class { /** @type {Record} */ exact_set = {}; /** @type {Record} */ match_dict = {}; /** @type {Record} */ items = {}; /** @param {string[]} arr */ constructor(arr) { for (let i = GRAM_SIZE_LOWER; i < 4; ++i) this.items[i] = []; for (let i = 0; i < arr.length; ++i) this.add(arr[i]); } /** @param {string} value */ add(value) { if (value.toLowerCase() in this.exact_set) return false; let i = GRAM_SIZE_LOWER; for (; i < 4; ++i) this._add(value, i); } /** * @param {string} value * @param {number} gram_size */ _add(value, gram_size) { const normalized_value = value.toLowerCase(); const items = this.items[gram_size] || []; const index = items.length; items.push(0); const gram_counts = gram_counter(normalized_value, gram_size); let sum_of_square_gram_counts = 0; let gram; let gram_count; for (gram in gram_counts) { gram_count = gram_counts[gram]; sum_of_square_gram_counts += Math.pow(gram_count, 2); if (gram in this.match_dict) this.match_dict[gram].push([index, gram_count]); else this.match_dict[gram] = [[index, gram_count]]; } items[index] = [Math.sqrt(sum_of_square_gram_counts), normalized_value]; this.items[gram_size] = items; this.exact_set[normalized_value] = value; } /** @param {string} value */ get(value) { const normalized_value = value.toLowerCase(); const result = this.exact_set[normalized_value]; if (result) return [[1, result]]; for (let gram_size = GRAM_SIZE_UPPER; gram_size >= GRAM_SIZE_LOWER; --gram_size) { const results = this.__get(value, gram_size); if (results.length > 0) return results; } return null; } /** * @param {string} value * @param {number} gram_size * @returns {MatchTuple[]} */ __get(value, gram_size) { const normalized_value = value.toLowerCase(); /** @type {Record} */ const matches = {}; const gram_counts = gram_counter(normalized_value, gram_size); const items = this.items[gram_size]; let sum_of_square_gram_counts = 0; let gram; let gram_count; let i; let index; let other_gram_count; for (gram in gram_counts) { gram_count = gram_counts[gram]; sum_of_square_gram_counts += Math.pow(gram_count, 2); if (gram in this.match_dict) for (i = 0; i < this.match_dict[gram].length; ++i) { index = this.match_dict[gram][i][0]; other_gram_count = this.match_dict[gram][i][1]; if (index in matches) matches[index] += gram_count * other_gram_count; else matches[index] = gram_count * other_gram_count; } } const vector_normal = Math.sqrt(sum_of_square_gram_counts); /** @type {MatchTuple[]} */ let results = []; let match_score; for (const match_index in matches) { match_score = matches[match_index]; results.push([match_score / (vector_normal * items[match_index][0]), items[match_index][1]]); } results.sort(sort_descending); /** @type {MatchTuple[]} */ let new_results = []; const end_index = Math.min(50, results.length); for (let i = 0; i < end_index; ++i) new_results.push([_distance(results[i][1], normalized_value), results[i][1]]); results = new_results; results.sort(sort_descending); new_results = []; for (let i = 0; i < results.length; ++i) if (results[i][0] === results[0][0]) new_results.push([results[i][0], this.exact_set[results[i][1]]]); return new_results; } }; /** @typedef {[score: number, match: string]} MatchTuple */ // node_modules/locate-character/src/index.js /** @typedef {import('./types').Location} Location */ /** * @param {import('./types').Range} range * @param {number} index */ function rangeContains(range, index) { return range.start <= index && index < range.end; } /** * @param {string} source * @param {import('./types').Options} [options] */ function getLocator$1(source, options = {}) { const { offsetLine = 0, offsetColumn = 0 } = options; let start = 0; const ranges = source.split("\n").map((line, i) => { const end = start + line.length + 1; /** @type {import('./types').Range} */ const range = { start, end, line: i }; start = end; return range; }); let i = 0; /** * @param {string | number} search * @param {number} [index] * @returns {Location | undefined} */ function locator(search, index) { if (typeof search === "string") search = source.indexOf(search, index ?? 0); if (search === -1) return void 0; let range = ranges[i]; const d = search >= range.end ? 1 : -1; while (range) { if (rangeContains(range, search)) return { line: offsetLine + range.line, column: offsetColumn + search - range.start, character: search }; i += d; range = ranges[i]; } } return locator; } // node_modules/svelte/src/compiler/state.js /** @import { Location } from 'locate-character' */ /** @import { CompileOptions } from './types' */ /** @import { AST, Warning } from '#compiler' */ /** @typedef {{ start?: number, end?: number }} NodeLike */ /** @type {Warning[]} */ var warnings = []; /** * The filename relative to the rootDir (if specified). * This should not be used in the compiler output except in dev mode * @type {string} */ var filename; /** * This is the fallback used when no filename is specified. */ var UNKNOWN_FILENAME = "(unknown)"; /** * The name of the component that is used in the `export default function ...` statement. */ var component_name = ""; /** * The original source code * @type {string} */ var source; /** * The source code split into lines, initialized when a diagnostic needs a code frame * @type {string[] | undefined} */ var source_lines; function get_source_lines() { return source_lines ??= source.split("\n"); } /** * True if compiling with `dev: true` * @type {boolean} */ var dev; var runes = false; /** @type {(index: number) => Location} */ var locator; /** @param {string} value */ function set_source(value) { source = value; source_lines = void 0; const l = getLocator$1(source, { offsetLine: 1 }); locator = (i) => { const loc = l(i); if (!loc) throw new Error("An impossible situation occurred"); return loc; }; } /** * @param {AST.SvelteNode & { start?: number | undefined }} node */ function locate_node(node) { const loc = locator(node.start); return `${sanitize_location(filename)}:${loc?.line}:${loc.column}`; } /** @type {NonNullable} */ var warning_filter; /** * The current stack of ignored warnings * @type {Set[]} */ var ignore_stack = []; /** * For each node the list of warnings that should be ignored for that node. * Exists in addition to `ignore_stack` because not all warnings are emitted * while the stack is being built. * @type {Map[]>} */ var ignore_map = /* @__PURE__ */ new Map(); /** * Cached snapshot of the ignore_stack. Only re-created when the stack changes * (i.e. when push_ignore or pop_ignore is called), avoiding a structuredClone * on every node visit during analysis. * @type {Set[] | null} */ var cached_ignore_snapshot = null; /** * Returns a snapshot of the current ignore_stack, reusing a cached copy * when the stack hasn't changed since the last call. * @returns {Set[]} */ function get_ignore_snapshot() { if (cached_ignore_snapshot === null) cached_ignore_snapshot = ignore_stack.map((s) => new Set(s)); return cached_ignore_snapshot; } /** * @param {string[]} ignores */ function push_ignore(ignores) { const next = /* @__PURE__ */ new Set([...ignore_stack.at(-1) || [], ...ignores]); ignore_stack.push(next); cached_ignore_snapshot = null; } function pop_ignore() { ignore_stack.pop(); cached_ignore_snapshot = null; } /** * @param {AST.SvelteNode | NodeLike} node * @param {typeof import('../constants.js').IGNORABLE_RUNTIME_WARNINGS[number]} code * @returns */ function is_ignored(node, code) { return dev && !!ignore_map.get(node)?.some((codes) => codes.has(code)); } /** * Call this to reset the compiler state. Should be called before each compilation. * @param {{ warning?: (warning: Warning) => boolean; filename: string | undefined }} state */ function reset(state) { dev = false; runes = false; component_name = UNKNOWN_FILENAME; source = ""; source_lines = void 0; filename = (state.filename ?? "(unknown)").replace(/\\/g, "/"); warning_filter = state.warning ?? (() => true); warnings = []; } /** * Adjust the compiler state based on the provided state object. * Call this after parsing and basic analysis happened. * @param {{ * dev: boolean; * component_name?: string; * rootDir?: string; * runes: boolean; * }} state */ function adjust(state) { const root_dir = state.rootDir?.replace(/\\/g, "/"); dev = state.dev; runes = state.runes; component_name = state.component_name ?? "(unknown)"; if (typeof root_dir === "string" && filename.startsWith(root_dir)) filename = filename.replace(root_dir, "").replace(/^[/\\]/, ""); ignore_stack = []; ignore_map.clear(); cached_ignore_snapshot = null; } // node_modules/svelte/src/compiler/utils/compile_diagnostic.js /** @import { Location } from 'locate-character' */ var regex_tabs = /^\t+/; /** * @param {string} str */ function tabs_to_spaces(str) { return str.replace(regex_tabs, (match) => match.split(" ").join(" ")); } /** * @param {number} line * @param {number} column */ function get_code_frame(line, column) { const lines = get_source_lines(); const frame_start = Math.max(0, line - 2); const frame_end = Math.min(line + 3, lines.length); const digits = String(frame_end + 1).length; return lines.slice(frame_start, frame_end).map((str, i) => { const is_error_line = frame_start + i === line; const line_num = String(i + frame_start + 1).padStart(digits, " "); if (is_error_line) { const indicator = " ".repeat(digits + 2 + tabs_to_spaces(str.slice(0, column)).length) + "^"; return `${line_num}: ${tabs_to_spaces(str)}\n${indicator}`; } return `${line_num}: ${tabs_to_spaces(str)}`; }).join("\n"); } /** * @typedef {{ * code: string; * message: string; * stack?: string; * filename?: string; * start?: Location; * end?: Location; * position?: [number, number]; * frame?: string; * }} ICompileDiagnostic */ /** @implements {ICompileDiagnostic} */ var CompileDiagnostic = class { name = "CompileDiagnostic"; /** * @param {string} code * @param {string} message * @param {[number, number] | undefined} position */ constructor(code, message, position) { this.code = code; this.message = message; if (filename !== "(unknown)") this.filename = filename; if (position) { this.position = position; this.start = locator(position[0]); this.end = locator(position[1]); if (this.start && this.end) this.frame = get_code_frame(this.start.line - 1, this.end.column); } } toString() { let out = `${this.code}: ${this.message}`; if (this.filename) { out += `\n${this.filename}`; if (this.start) out += `:${this.start.line}:${this.start.column}`; } if (this.frame) out += `\n${this.frame}`; return out; } toJSON() { return { code: this.code, message: this.message, filename: this.filename, start: this.start, end: this.end, position: this.position, frame: this.frame }; } }; // node_modules/svelte/src/compiler/warnings.js /** @typedef {{ start?: number, end?: number }} NodeLike */ var InternalCompileWarning = class extends CompileDiagnostic { name = "CompileWarning"; /** * @param {string} code * @param {string} message * @param {[number, number] | undefined} position */ constructor(code, message, position) { super(code, message, position); } }; /** * @param {null | NodeLike} node * @param {string} code * @param {string} message */ function w(node, code, message) { let stack = ignore_stack; if (node) stack = ignore_map.get(node) ?? ignore_stack; if (stack && stack.at(-1)?.has(code)) return; const warning = new InternalCompileWarning(code, message, node && node.start !== void 0 ? [node.start, node.end ?? node.start] : void 0); if (!warning_filter(warning)) return; warnings.push(warning); } var codes$1 = [ "a11y_accesskey", "a11y_aria_activedescendant_has_tabindex", "a11y_aria_attributes", "a11y_autocomplete_valid", "a11y_autofocus", "a11y_click_events_have_key_events", "a11y_consider_explicit_label", "a11y_distracting_elements", "a11y_figcaption_index", "a11y_figcaption_parent", "a11y_hidden", "a11y_img_redundant_alt", "a11y_incorrect_aria_attribute_type", "a11y_incorrect_aria_attribute_type_boolean", "a11y_incorrect_aria_attribute_type_id", "a11y_incorrect_aria_attribute_type_idlist", "a11y_incorrect_aria_attribute_type_integer", "a11y_incorrect_aria_attribute_type_token", "a11y_incorrect_aria_attribute_type_tokenlist", "a11y_incorrect_aria_attribute_type_tristate", "a11y_interactive_supports_focus", "a11y_invalid_attribute", "a11y_label_has_associated_control", "a11y_media_has_caption", "a11y_misplaced_role", "a11y_misplaced_scope", "a11y_missing_attribute", "a11y_missing_content", "a11y_mouse_events_have_key_events", "a11y_no_abstract_role", "a11y_no_interactive_element_to_noninteractive_role", "a11y_no_noninteractive_element_interactions", "a11y_no_noninteractive_element_to_interactive_role", "a11y_no_noninteractive_tabindex", "a11y_no_redundant_roles", "a11y_no_static_element_interactions", "a11y_positive_tabindex", "a11y_role_has_required_aria_props", "a11y_role_supports_aria_props", "a11y_role_supports_aria_props_implicit", "a11y_unknown_aria_attribute", "a11y_unknown_role", "bidirectional_control_characters", "legacy_code", "unknown_code", "options_deprecated_accessors", "options_deprecated_immutable", "options_missing_custom_element", "options_removed_enable_sourcemap", "options_removed_hydratable", "options_removed_loop_guard_timeout", "options_renamed_ssr_dom", "custom_element_props_identifier", "export_let_unused", "legacy_component_creation", "non_reactive_update", "perf_avoid_inline_class", "perf_avoid_nested_class", "reactive_declaration_invalid_placement", "reactive_declaration_module_script_dependency", "state_referenced_locally", "store_rune_conflict", "css_unused_selector", "attribute_avoid_is", "attribute_global_event_reference", "attribute_illegal_colon", "attribute_invalid_property_name", "attribute_quoted", "bind_invalid_each_rest", "block_empty", "component_name_lowercase", "element_implicitly_closed", "element_invalid_self_closing_tag", "event_directive_deprecated", "node_invalid_placement_ssr", "script_context_deprecated", "script_unknown_attribute", "slot_element_deprecated", "svelte_component_deprecated", "svelte_element_invalid_this", "svelte_self_deprecated" ]; /** * Avoid using accesskey * @param {null | NodeLike} node */ function a11y_accesskey(node) { w(node, "a11y_accesskey", `Avoid using accesskey\nhttps://svelte.dev/e/a11y_accesskey`); } /** * An element with an aria-activedescendant attribute should have a tabindex value * @param {null | NodeLike} node */ function a11y_aria_activedescendant_has_tabindex(node) { w(node, "a11y_aria_activedescendant_has_tabindex", `An element with an aria-activedescendant attribute should have a tabindex value\nhttps://svelte.dev/e/a11y_aria_activedescendant_has_tabindex`); } /** * `<%name%>` should not have aria-* attributes * @param {null | NodeLike} node * @param {string} name */ function a11y_aria_attributes(node, name) { w(node, "a11y_aria_attributes", `\`<${name}>\` should not have aria-* attributes\nhttps://svelte.dev/e/a11y_aria_attributes`); } /** * '%value%' is an invalid value for 'autocomplete' on `` * @param {null | NodeLike} node * @param {string} value * @param {string} type */ function a11y_autocomplete_valid(node, value, type) { w(node, "a11y_autocomplete_valid", `'${value}' is an invalid value for 'autocomplete' on \`\`\nhttps://svelte.dev/e/a11y_autocomplete_valid`); } /** * Avoid using autofocus * @param {null | NodeLike} node */ function a11y_autofocus(node) { w(node, "a11y_autofocus", `Avoid using autofocus\nhttps://svelte.dev/e/a11y_autofocus`); } /** * Visible, non-interactive element `<%element%>` with a click event must be accompanied by a keyboard event handler. Consider whether an interactive element such as `